repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
karansingh1559/coala | refs/heads/master | coalib/settings/SectionFilling.py | 2 | import copy
from inspect import signature
import logging
from coalib.bears.BEAR_KIND import BEAR_KIND
from coalib.collecting import Dependencies
from coalib.collecting.Collectors import (
collect_bears, collect_bears_by_aspects)
from coalib.settings.Setting import Setting
def fill_section(section, acquire_settin... |
psdh/servo | refs/heads/master | tests/wpt/css-tests/tools/pywebsocket/src/test/test_mux.py | 427 | #!/usr/bin/env python
#
# Copyright 2012, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list... |
xfournet/intellij-community | refs/heads/master | python/lib/Lib/distutils/util.py | 80 | """distutils.util
Miscellaneous utility functions -- anything that doesn't fit into
one of the other *util.py modules.
"""
__revision__ = "$Id: util.py 59116 2007-11-22 10:14:26Z ronald.oussoren $"
import sys, os, string, re
from distutils.errors import DistutilsPlatformError
from distutils.dep_util import newer
fro... |
z0by/django | refs/heads/master | tests/gis_tests/models.py | 281 | from django.core.exceptions import ImproperlyConfigured
from django.db import models
class DummyField(models.Field):
def __init__(self, dim=None, srid=None, geography=None, spatial_index=True, *args, **kwargs):
super(DummyField, self).__init__(*args, **kwargs)
try:
from django.contrib.gis.db import ... |
albertomurillo/ansible | refs/heads/devel | lib/ansible/module_utils/facts/other/facter.py | 232 | # This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is distributed in the hope that ... |
kisel/trex-core | refs/heads/master | scripts/stl/udp_1pkt_mac_mask3.py | 2 | from trex_stl_lib.api import *
# step is not 1.
class STLS1(object):
def __init__ (self):
self.fsize =64; # the size of the packet
def create_stream (self):
# Create base packet and pad it to size
size = self.fsize - 4; # HW will add 4 bytes ethernet FCS
base_pkt = Ether... |
cmlasu/smm_gem5 | refs/heads/smm | ext/ply/test/lex_state1.py | 174 | # lex_state1.py
#
# Bad state declaration
import sys
if ".." not in sys.path: sys.path.insert(0,"..")
import ply.lex as lex
tokens = [
"PLUS",
"MINUS",
"NUMBER",
]
states = 'comment'
t_PLUS = r'\+'
t_MINUS = r'-'
t_NUMBER = r'\d+'
# Comments
def t_comment(t):
r'/\*'
t.lexer.begin('comment... |
barykaed/Pelican-Test | refs/heads/gh-pages | fsp_env/Lib/site-packages/pip/_vendor/requests/packages/urllib3/poolmanager.py | 253 | import logging
try: # Python 3
from urllib.parse import urljoin
except ImportError:
from urlparse import urljoin
from ._collections import RecentlyUsedContainer
from .connectionpool import HTTPConnectionPool, HTTPSConnectionPool
from .connectionpool import port_by_scheme
from .exceptions import LocationValue... |
Changaco/oh-mainline | refs/heads/master | vendor/packages/twisted/doc/core/howto/tutorial/listings/finger/finger19c_changes.py | 22 | from twisted.internet import protocol, reactor, defer, utils
import pwd
import os
# Yet another back-end
class LocalFingerService(service.Service):
implements(IFingerService)
def getUser(self, user):
user = user.strip()
try:
entry = pwd.getpwnam(user)
except KeyError:
... |
kuchi/imageio | refs/heads/master | imageio/plugins/freeimage.py | 4 | # -*- coding: utf-8 -*-
# Copyright (c) 2015, imageio contributors
# imageio is distributed under the terms of the (new) BSD License.
""" Plugin that wraps the freeimage lib. The wrapper for Freeimage is
part of the core of imageio, but it's functionality is exposed via
the plugin system (therefore this plugin is very... |
PsypherPunk/django-annotations | refs/heads/master | annotation/migrations/0003_auto_20160129_1341.py | 1 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('annotation', '0002_auto_20160129_1311'),
]
operations = [
migrations.AlterField(
model_name='range',
... |
gooftroop/Zeus | refs/heads/master | contrib/tornado/process.py | 109 | #!/usr/bin/env python
#
# Copyright 2011 Facebook
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... |
aktech/sympy | refs/heads/master | sympy/functions/elementary/trigonometric.py | 16 | from __future__ import print_function, division
from sympy.core.add import Add
from sympy.core.basic import sympify, cacheit
from sympy.core.function import Function, ArgumentIndexError
from sympy.core.numbers import igcdex, Rational, pi
from sympy.core.singleton import S
from sympy.core.symbol import Symbol, Wild
fro... |
Hasan-Jawaheri/games | refs/heads/master | games/settings.py | 1 | """
Django settings for games project.
Generated by 'django-admin startproject' using Django 1.9.1.
For more information on this file, see
https://docs.djangoproject.com/en/1.9/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.9/ref/settings/
"""
import os
# B... |
duct-tape/taped-toggl | refs/heads/master | setup.py | 1 | #!/usr/bin/env python
from distutils.core import setup
setup(
name='tapedtoggl',
version='0.0.5',
description=(
"Toggl API wrapper."
),
author="Andriy Doroshenko",
author_email='mapleukraine@gmail.com',
url='https://github.com/duct-tape/taped-toggl',
packages=[
'tapedto... |
sergio-incaser/odoo | refs/heads/8.0 | openerp/addons/test_uninstall/__init__.py | 2074 | # -*- coding: utf-8 -*-
import models
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
cguZZman/clouddrive-common-kodi-module | refs/heads/master | clouddrive/common/export.py | 1 | #-------------------------------------------------------------------------------
# Copyright (C) 2017 Carlos Guzman (cguZZman) carlosguzmang@protonmail.com
#
# This file is part of Cloud Drive Common Module for Kodi
#
# Cloud Drive Common Module for Kodi is free software: you can redistribute it and/or modify
# it un... |
ingokegel/intellij-community | refs/heads/master | python/testData/pyi/type/functionType/FunctionType.py | 57 | def <caret>f(x):
pass
|
likeleon/Python | refs/heads/master | cookbook/8.7 부모 클래스의 메소드 호출.py | 1 | #
class A:
def spam(self):
print('A.spam')
class B(A):
def spam(self):
print('B.spam')
super().spam()
b = B()
b.spam()
#
class Base:
def __init__(self):
print('Base.__init__')
class A(Base):
def __init__(self):
super().__init__()
print('A.__init__')
... |
TBIproject/WolfEyes | refs/heads/Python | WolfEyes/Utils/Vector.py | 1 | # -*- coding: utf-8 -*-
"""Custom weird vector, very useful."""
import numpy
import math
__all__ = [
'Vector',
]
# Plus simple pour gérer les points/vecteurs 2d
class Vector(numpy.array):
"""Some custom vector"""
# Valeur d'arrondi extrême
ROUND = 14
# Init
def __init__(this, *args):
... |
arthurio/coc_war_planner | refs/heads/dev | coc_war_planner/core/migrations/0004_auto_20150815_2040.py | 1 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('core', '0003_member_name'),
]
operations = [
migrations.AlterField(
model_name='clan',
name='chief',... |
ajohnstone/kubernetes | refs/heads/master | vendor/github.com/hashicorp/go-msgpack/codec/msgpack_test.py | 1233 | #!/usr/bin/env python
# This will create golden files in a directory passed to it.
# A Test calls this internally to create the golden files
# So it can process them (so we don't have to checkin the files).
import msgpack, msgpackrpc, sys, os, threading
def get_test_data_list():
# get list with all primitive typ... |
g19-hs/personfinder | refs/heads/master | app/pytz/zoneinfo/Asia/Beirut.py | 9 | '''tzinfo timezone information for Asia/Beirut.'''
from pytz.tzinfo import DstTzInfo
from pytz.tzinfo import memorized_datetime as d
from pytz.tzinfo import memorized_ttinfo as i
class Beirut(DstTzInfo):
'''Asia/Beirut timezone definition. See datetime.tzinfo for details'''
zone = 'Asia/Beirut'
_utc_tran... |
prashanthr/wakatime | refs/heads/master | wakatime/packages/pygments_py3/pygments/lexers/dalvik.py | 72 | # -*- coding: utf-8 -*-
"""
pygments.lexers.dalvik
~~~~~~~~~~~~~~~~~~~~~~
Pygments lexers for Dalvik VM-related languages.
:copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
from pygments.lexer import RegexLexer, include, bygr... |
etxc/namebench | refs/heads/master | tools/check_nameserver_popularity.py | 174 | #!/usr/bin/env python
import os
import re
import sys
import pickle
import time
import traceback
import yahoo.search
from yahoo.search.web import WebSearch
APP_ID = 'P5ihFKzV34G69QolFfb3nN7p0rSsYfC9tPGq.IUS.NLWEeJ14SG9Lei0rwFtgwL8cDBrA6Egdw--'
QUERY_MODIFIERS = '-site:txdns.net -site:sitedossier.com -mx -site:dataopedi... |
mibanescu/pulp | refs/heads/master | bindings/test/unit/test_search.py | 8 | import unittest
import mock
from pulp.bindings.search import SearchAPI, Operator, IntOperator, CSVOperator
class TestSearchAPI(unittest.TestCase):
def setUp(self):
super(TestSearchAPI, self).setUp()
self.api = SearchAPI(mock.MagicMock())
self.api.PATH = '/some/path'
def test_calls_p... |
Craxic/plyj | refs/heads/master | example/symbols.py | 1 | #!/usr/bin/env python2
import sys
from plyj.model.classes import FieldDeclaration
from plyj.model.method import MethodDeclaration
from plyj.model.statement import VariableDeclaration
from plyj.parser import Parser
p = Parser()
tree = p.parse_file(sys.argv[1])
print('declared types:')
for type_decl in tree.type_decla... |
hchen1202/django-react | refs/heads/master | virtualenv/lib/python3.6/site-packages/django/contrib/gis/db/backends/spatialite/base.py | 445 | import sys
from ctypes.util import find_library
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.db.backends.sqlite3.base import (
Database, DatabaseWrapper as SQLiteDatabaseWrapper, SQLiteCursorWrapper,
)
from django.utils import six
from .client import SpatiaL... |
gabrielfalcao/lettuce | refs/heads/master | tests/integration/lib/Django-1.3/tests/regressiontests/forms/tests/media.py | 51 | # -*- coding: utf-8 -*-
from django.conf import settings
from django.forms import TextInput, Media, TextInput, CharField, Form, MultiWidget
from django.utils.unittest import TestCase
class FormsMediaTestCase(TestCase):
# Tests for the media handling on widgets and forms
def setUp(self):
super(FormsMed... |
chudaol/edx-platform | refs/heads/master | openedx/core/djangoapps/credit/tests/test_tasks.py | 10 | """
Tests for credit course tasks.
"""
import mock
from datetime import datetime, timedelta
from pytz import UTC
from openedx.core.djangoapps.credit.api import get_credit_requirements
from openedx.core.djangoapps.credit.exceptions import InvalidCreditRequirements
from openedx.core.djangoapps.credit.models import Cred... |
martwo/ndhist | refs/heads/master | examples/python/struct_arr.py | 1 | import numpy as np
import ndhist
h = ndhist.ndhist( np.array([2,2])
, [np.array([0,1,2], dtype=np.dtype(np.int64)),
np.array([0,1,2], dtype=np.dtype(np.float64))]
, dtype=np.dtype(np.float64))
print("h.max_tuple_fill_nd = %d"%(h.max_tuple_fill_nd))
a0 = np.array([... |
jcao02/EventPlanner | refs/heads/master | app/Biblioteca/EventPlanner.py | 1 | # -*- coding: utf-8 -*-
from flask import request, session, Blueprint, json, g
from werkzeug import secure_filename
EventPlanner = Blueprint('EventPlanner', __name__)
@EventPlanner.route('/eventplanner/ACancelReservation')
def ACancelReservation():
eventid = request.args.get('eventId')
if eventid is None:... |
klunwebale/odoo | refs/heads/8.0 | addons/gamification/wizard/update_goal.py | 386 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2013 OpenERP SA (<http://www.openerp.com>)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the ... |
tech-sketch/zabbix_book_sample | refs/heads/master | 2nd_edition/Chapter12/12-4_set_hv_hostname.py | 1 | #!/bin/env python
import sys
from pyVim.connect import SmartConnect, Disconnect
from pyVmomi import vim
import ssl
import subprocess
argvs = sys.argv
HV_NAME = argvs[1]
VSPHERE_HOST = argvs[2]
ZABBIX_SERVER = 'Zabbixサーバホスト名またはIPアドレス'
VSPHERE_ID = 'vSphereユーザ名'
VSPHERE_PASSWORD = 'vSphereパスワード'
ZABBIX_SENDER = 'zabbix_... |
ga4gh/schemas | refs/heads/master | python/ga4gh/schemas/protocol.py | 4 | """
Definitions of the GA4GH protocol types.
"""
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import datetime
import json
import inspect
import sys
import array
from _protocol_version import version # noqa
from ga4gh.common_pb2 import * # noqa
from ga... |
pelya/commandergenius | refs/heads/sdl_android | project/jni/python/src/Lib/json/tests/test_speedups.py | 53 | import decimal
from unittest import TestCase
from json import decoder
from json import encoder
class TestSpeedups(TestCase):
def test_scanstring(self):
self.assertEquals(decoder.scanstring.__module__, "_json")
self.assert_(decoder.scanstring is decoder.c_scanstring)
def test_encode_basestring... |
ecanzonieri/kafka-python | refs/heads/master | kafka/codec.py | 20 | from io import BytesIO
import gzip
import struct
import six
from six.moves import xrange
_XERIAL_V1_HEADER = (-126, b'S', b'N', b'A', b'P', b'P', b'Y', 0, 1, 1)
_XERIAL_V1_FORMAT = 'bccccccBii'
try:
import snappy
_has_snappy = True
except ImportError:
_has_snappy = False
def has_gzip():
return True... |
ssvsergeyev/ZenPacks.zenoss.AWS | refs/heads/develop | ZenPacks/zenoss/AWS/datasources/AWSDataSource.py | 1 | ##############################################################################
#
# Copyright (coffee) Zenoss, Inc. 2013, all rights reserved.
#
# This content is made available according to terms specified in
# License.zenoss under the directory where your Zenoss product is installed.
#
################################... |
Vertical-Datashield/vertical_datashield | refs/heads/master | source/common/tidy_paths.py | 1 | #! /usr/bin/env python
#get rid of any old temp data sitting around
import os
import shutil
import ds_config
#Get rid of the temp dir if it exists
if (os.pa... |
RafaelTorrealba/odoo | refs/heads/8.0 | addons/account_analytic_analysis/__init__.py | 425 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the... |
stewartpark/django | refs/heads/master | django/contrib/admin/tests.py | 10 | import os
from unittest import SkipTest
from django.contrib.staticfiles.testing import StaticLiveServerTestCase
from django.test import modify_settings
from django.utils.module_loading import import_string
from django.utils.translation import ugettext as _
class CSPMiddleware(object):
"""The admin's JavaScript s... |
kaibozhou/flink | refs/heads/master | flink-python/pyflink/datastream/tests/test_stream_execution_environment_completeness.py | 5 | ################################################################################
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this... |
rleigh-dundee/openmicroscopy | refs/heads/develop | components/tools/OmeroPy/test/t_rtypes.py | 4 | """
/*
* $Id$
*
* Copyright 2008 Glencoe Software, Inc. All rights reserved.
* Use is subject to license terms supplied in LICENSE.txt
*/
"""
import unittest, omero
import omero_model_ImageI # For Image
from omero.rtypes import *
# Data
ids = [rlong(1)]
class TestModel(unittest.TestCase):
def testCon... |
dyoung418/tensorflow | refs/heads/master | tensorflow/contrib/learn/python/learn/learn_io/numpy_io_test.py | 79 | # Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
gq213/linux-3.10.72 | refs/heads/master | tools/perf/scripts/python/net_dropmonitor.py | 2669 | # Monitor the system for dropped packets and proudce a report of drop locations and counts
import os
import sys
sys.path.append(os.environ['PERF_EXEC_PATH'] + \
'/scripts/python/Perf-Trace-Util/lib/Perf/Trace')
from perf_trace_context import *
from Core import *
from Util import *
drop_log = {}
kallsyms = []
def... |
odoo-brazil/l10n-brazil-wip | refs/heads/10.0-develop | l10n_br_account/models/account.py | 3 | # -*- coding: utf-8 -*-
# Copyright (C) 2009 - TODAY Renato Lima - Akretion
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
from odoo import models, fields, api
class AccountJournal(models.Model):
_inherit = 'account.journal'
revenue_expense = fields.Boolean('Gera Financeiro')
class Accou... |
daoluan/decode-Django | refs/heads/master | Django-1.5.1/django/contrib/formtools/tests/wizard/namedwizardtests/tests.py | 90 | from __future__ import unicode_literals
from django.core.urlresolvers import reverse
from django.http import QueryDict
from django.test import TestCase
from django.contrib.auth.models import User
from django.contrib.auth.tests.utils import skipIfCustomUser
from django.contrib.formtools.wizard.views import (NamedUrlS... |
alsoicode/djangocms-text-ckeditor | refs/heads/master | djangocms_text_ckeditor/models.py | 4 | import re
import sys
try:
from softhyphen.html import hyphenate
except ImportError:
hyphenate = lambda t: t
from django.db import models
from django.utils.encoding import force_text, python_2_unicode_compatible
from django.utils.html import strip_tags
from django.utils.text import Truncator
from django.utils.... |
kbrebanov/ansible | refs/heads/devel | lib/ansible/plugins/callback/logentries.py | 7 | # (c) 2015, Logentries.com, Jimmy Tang <jimmy.tang@logentries.com>
# (c) 2017 Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
DOCUMENTATION = '''
callback: logentries... |
andela-earinde/bellatrix-py | refs/heads/master | app/js/lib/lib/modules/test/__init__.py | 2547 | # Dummy file to make this directory a package.
|
javierlgroba/Eventer-gapp | refs/heads/master | django/contrib/localflavor/fi/fi_municipalities.py | 109 | # -*- coding: utf-8 -*-
"""
An alphabetical list of Finnish municipalities for use as `choices` in a
formfield.
This exists in this standalone file so that it's only imported into memory
when explicitly needed.
"""
from __future__ import unicode_literals
MUNICIPALITY_CHOICES = (
('akaa', "Akaa"),
('alajarvi'... |
jvkops/titanium_mobile | refs/heads/master | support/common/markdown/html4.py | 133 | # markdown/html4.py
#
# Add html4 serialization to older versions of Elementree
# Taken from ElementTree 1.3 preview with slight modifications
#
# Copyright (c) 1999-2007 by Fredrik Lundh. All rights reserved.
#
# fredrik@pythonware.com
# http://www.pythonware.com
#
# --------------------------------------------------... |
jss-emr/openerp-7-src | refs/heads/master | openerp/addons/l10n_in_hr_payroll/__init__.py | 430 | #-*- coding:utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2011 OpenERP SA (<http://openerp.com>). All Rights Reserved
#
# This program is free software: you can redistribute it and/or modify
# it under th... |
Xyrotechnology/Project-Anthrax | refs/heads/master | SD/libraries/Scripts/Pixhawk/Firmware-master/cmake/test/cmake_tester.py | 1 | #!/usr/bin/env python
"""
The module facilitates testing in cmake.
It takes a command and a regex for failure ok passing.
It passes if:
* No stderr output.
* Stdout doesn't match failure regex.
* Stdout matches ok regex if given.
"""
from __future__ import print_function
import argparse
import subprocess
i... |
nvoron23/hue | refs/heads/master | desktop/core/ext-py/tablib-develop/tablib/formats/__init__.py | 42 | # -*- coding: utf-8 -*-
""" Tablib - formats
"""
from . import _csv as csv
from . import _json as json
from . import _xls as xls
from . import _yaml as yaml
from . import _tsv as tsv
from . import _html as html
from . import _xlsx as xlsx
from . import _ods as ods
available = (json, xls, yaml, csv, tsv, html, xlsx, ... |
40223121/w17 | refs/heads/master | static/Brython3.1.1-20150328-091302/Lib/_markupbase.py | 891 | """Shared support for scanning document type declarations in HTML and XHTML.
This module is used as a foundation for the html.parser module. It has no
documented public API and should not be used directly.
"""
import re
_declname_match = re.compile(r'[a-zA-Z][-_.a-zA-Z0-9]*\s*').match
_declstringlit_match = re.com... |
florentchandelier/zipline | refs/heads/development | zipline/finance/trading.py | 1 | #
# Copyright 2016 Quantopian, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wr... |
dfdx2/django | refs/heads/master | tests/gis_tests/gdal_tests/test_geom.py | 21 | import json
import pickle
import unittest
from binascii import b2a_hex
from unittest import skipUnless
from django.contrib.gis.gdal import HAS_GDAL
from ..test_data import TestDataMixin
if HAS_GDAL:
from django.contrib.gis.gdal import (
CoordTransform, GDALException, OGRGeometry, OGRGeomType, OGRIndexErr... |
irin4eto/Bar-Management | refs/heads/master | website/static/django_tables2/columns/filecolumn.py | 4 | # coding: utf-8
from __future__ import absolute_import, unicode_literals
from django.db import models
from django.utils.safestring import mark_safe
from django_tables2.utils import AttributeDict
import os
from .base import Column, library
@library.register
class FileColumn(Column):
"""
Attempts to render `.Fi... |
wlerin/streamlink | refs/heads/master | tests/plugins/test_dingittv.py | 4 | import unittest
from streamlink.plugins.dingittv import DingitTV
class TestPluginDingitTV(unittest.TestCase):
def test_can_handle_url(self):
should_match = [
'http://www.dingit.tv/highlight/123123123',
]
for url in should_match:
self.assertTrue(DingitTV.can_handle_... |
CFDEMproject/LIGGGHTS-PUBLIC | refs/heads/master | doc/conf.py | 3 | # -*- coding: utf-8 -*-
#
# LIGGGHTS documentation build configuration file, created by
# sphinx-quickstart on Tue Apr 5 00:38:42 2016.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# ... |
Teagan42/home-assistant | refs/heads/dev | homeassistant/components/lock/device_trigger.py | 8 | """Provides device automations for Lock."""
from typing import List
import voluptuous as vol
from homeassistant.components.automation import AutomationActionType, state
from homeassistant.components.device_automation import TRIGGER_BASE_SCHEMA
from homeassistant.const import (
CONF_DEVICE_ID,
CONF_DOMAIN,
... |
piantado/LOTlib | refs/heads/master | LOTlib/Projects/NumberGame/Demo.py | 2 | from Model import *
from Model.Grammar import lot_grammar as grammar
h0 = NumberGameHypothesis(grammar=grammar)
data = [FunctionData(input=[], output=[2, 8, 9, 10, 16], alpha=0.99)]
from LOTlib import break_ctrlc
from LOTlib.Inference.Samplers.MetropolisHastings import MHSampler
from LOTlib.SampleStream import *
f... |
Soya93/Extract-Refactoring | refs/heads/master | python/testData/pyi/type/functionReturnType/FunctionReturnType.py | 57 | def f():
pass
<caret>x = f()
|
rtx3/ip2aliyun | refs/heads/master | src/config.py | 1 | # Copyright 2004-2010 by Vinay Sajip. All Rights Reserved.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose and without fee is hereby granted,
# provided that the above copyright notice appear in all copies and that
# both that copyright notice and this permissio... |
arachsys/mailflow | refs/heads/master | MailFlow.py | 1 | from AppKit import NSAlternateKeyMask, NSApplication, NSMenuItem
import objc
import re
def Category(classname):
return objc.Category(objc.lookUpClass(classname))
def Class(classname):
return objc.lookUpClass(classname)
def flow(text, width = 77):
quote, indent = re.match(r'(>+ ?|)(\s*)', text, re.UNICODE... |
GoSteven/Diary | refs/heads/master | django/contrib/localflavor/mx/forms.py | 13 | """
Mexican-specific form helpers.
"""
from django.forms.fields import Select
class MXStateSelect(Select):
"""
A Select widget that uses a list of Mexican states as its choices.
"""
def __init__(self, attrs=None):
from mx_states import STATE_CHOICES
super(MXStateSelect, sel... |
YaniLozanov/Software-University | refs/heads/master | Python/PyCharm/06.Drawing Figures with Loops/09.House.py | 1 | # Problem:
# Write a program that introduces a number n (2 ≤ n ≤ 100) and prints a cot with a size n x n.
n = int(input())
asterisk = "*"
minuses = "-"
for i in range(1, n + 1):
if n % 2 == 0 and i % 2 == 0:
asterisk = i
minuses = (n - i ) // 2
print("-" * minuses + "*" * asterisk + "-"... |
robhudson/kuma | refs/heads/master | vendor/packages/translate/convert/test_tiki2po.py | 26 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# tiki2po unit tests
# Author: Wil Clouser <wclouser@mozilla.com>
# Date: 2008-12-01
from translate.convert import test_convert, tiki2po
from translate.misc import wStringIO
class TestTiki2Po:
def test_converttiki_defaults(self):
inputfile = """
"zero_sourc... |
cdyang-ustc/ycd-blog | refs/heads/master | www/models.py | 1 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
'''
Models for user, blog, comment.
'''
import time
import uuid
from orm import Model, StringField, BooleanField, FloatField, TextField
def next_id():
return '%015d%s000' % (int(time.time() * 1000), uuid.uuid4().hex)
class User(Model):
__table__ = 'users'
... |
flh/odoo | refs/heads/master | openerp/netsvc.py | 27 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2014 OpenERP SA (<http://www.openerp.com>)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of... |
fredericmohr/mitro | refs/heads/master | mitro-mail/build/venv/lib/python2.7/site-packages/tornado/test/process_test.py | 5 | #!/usr/bin/env python
from __future__ import absolute_import, division, with_statement
import logging
import os
import signal
import sys
from tornado.httpclient import HTTPClient, HTTPError
from tornado.httpserver import HTTPServer
from tornado.ioloop import IOLoop
from tornado.netutil import bind_sockets
from tornad... |
xodus7/tensorflow | refs/heads/master | tensorflow/python/debug/cli/cli_config.py | 62 | # Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
hyperized/ansible | refs/heads/devel | lib/ansible/modules/network/aos/_aos_template.py | 348 | #!/usr/bin/python
#
# (c) 2017 Apstra Inc, <community@apstra.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['removed'],
'supported_by': 'community'}
from ansible.module... |
thinkgen/thirdparty | refs/heads/master | script.module.urlresolver/lib/urlresolver/plugnplay/__init__.py | 3 | """
urlresolver XBMC Addon
Copyright (C) 2011 t0mm0
based on plugnplay by https://github.com/daltonmatos
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of th... |
chrissmall22/cassini | refs/heads/master | mininet/nac_simple.py | 1 | #!/usr/bin/python
"""
This example shows how to create an empty Mininet object
(without a topology object) and add nodes to it manually.
"""
from mininet.net import Mininet
from mininet.node import Controller, RemoteController, OVSSwitch, Node
from mininet.cli import CLI
from mininet.log import setLogLevel, info
def... |
alexandrucoman/vbox-nova-driver | refs/heads/master | nova/tests/functional/v3/api_paste_fixture.py | 25 | # Copyright 2015 NEC Corporation. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable l... |
sookocheff/modelviewcontroller | refs/heads/master | model/__init__.py | 2 | """
Models go here.
"""
|
laosiaudi/tensorflow | refs/heads/master | tensorflow/python/training/proximal_gradient_descent.py | 33 | # Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
cyberark-bizdev/ansible | refs/heads/devel | test/units/modules/cloud/amazon/test_elb_application_lb.py | 33 | #
# (c) 2017 Michael Tinning
#
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import (absolute_import, division, print_function)
import json
from copy import deepcopy
import pytest
from ansible.module_utils._text import to_bytes
from ansible.module_utils... |
giruenf/GRIPy | refs/heads/master | lib/yapsy/VersionedPluginManager.py | 1 | # -*- coding: utf-8; tab-width: 4; indent-tabs-mode: t; python-indent: 4 -*-
"""
Role
====
Defines the basic interface for a plugin manager that also keeps track
of versions of plugins
API
===
"""
from distutils.version import StrictVersion
from lib.yapsy.PluginInfo import PluginInfo
from lib.yapsy.IPlugin import ... |
kenshay/ImageScripter | refs/heads/master | ProgramData/SystemFiles/Python/Lib/site-packages/pylint/test/functional/no_self_use_py3.py | 15 | # pylint: disable=missing-docstring,no-init,unused-argument,invalid-name,too-few-public-methods
class A:
def __init__(self):
self.store = {}
def get(self, key, default=None):
return self.store.get(key, default)
class B(A):
def get_memo(self, obj):
return super().get(obj)
|
ryano144/intellij-community | refs/heads/master | python/testData/inspections/importFromModuleStar/source.py | 83 | from target import *
<error descr="Unresolved reference 'xyzzy'">x<caret>yzzy</error>
shazam()
|
JetBrains/intellij-community | refs/heads/master | python/testData/resolve/multiFile/dontResolveToMissingNameInDynamicDunderAll/DontResolveToMissingNameInDynamicDunderAll.py | 31 | from m1 import *
print(internal_name)
# <ref>
|
amolkahat/pandas | refs/heads/master | pandas/core/computation/eval.py | 2 | #!/usr/bin/env python
"""Top level ``eval`` module.
"""
import warnings
import tokenize
from pandas.io.formats.printing import pprint_thing
from pandas.core.computation.scope import _ensure_scope
from pandas.compat import string_types
from pandas.core.computation.engines import _engines
from pandas.util._validators i... |
hugoatease/TuneHub | refs/heads/master | mutagen/_vorbis.py | 3 | # Vorbis comment support for Mutagen
# Copyright 2005-2006 Joe Wreschnig
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of version 2 of the GNU General Public License as
# published by the Free Software Foundation.
"""Read and write Vorbis comment data.
Vorbis comments a... |
phobson/statsmodels | refs/heads/master | statsmodels/sandbox/nonparametric/kde2.py | 34 | # -*- coding: utf-8 -*-
from __future__ import print_function
from statsmodels.compat.python import lzip, zip
import numpy as np
from . import kernels
#TODO: should this be a function?
class KDE(object):
"""
Kernel Density Estimator
Parameters
----------
x : array-like
N-dimensional array... |
Kalyzee/edx-platform | refs/heads/master | pavelib/paver_tests/test_servers.py | 6 | """Unit tests for the Paver server tasks."""
import ddt
import os
from paver.easy import call_task
from .utils import PaverTestCase
EXPECTED_COFFEE_COMMAND = (
"node_modules/.bin/coffee --compile `find {platform_root}/lms "
"{platform_root}/cms {platform_root}/common -type f -name \"*.coffee\"`"
)
EXPECTED_S... |
yatinkumbhare/openstack-nova | refs/heads/master | nova/api/openstack/compute/extensions.py | 35 | # Copyright 2011 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... |
bonitadecker77/python-for-android | refs/heads/master | python3-alpha/python3-src/Lib/textwrap.py | 50 | """Text wrapping and filling.
"""
# Copyright (C) 1999-2001 Gregory P. Ward.
# Copyright (C) 2002, 2003 Python Software Foundation.
# Written by Greg Ward <gward@python.net>
import string, re
__all__ = ['TextWrapper', 'wrap', 'fill', 'dedent']
# Hardcode the recognized whitespace characters to the US-ASCII
# whites... |
atsaki/ansible-modules-extras | refs/heads/devel | notification/osx_say.py | 161 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2013, Michael DeHaan <michael@ansible.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the ... |
clk8908/pymc3 | refs/heads/master | pymc3/tests/test_distributions.py | 9 | from __future__ import division
import unittest
import itertools
from .checks import *
from pymc3 import *
from numpy import array, inf
import numpy
from numpy.linalg import inv
from scipy import integrate
import scipy.stats.distributions as sp
import scipy.stats
from .knownfailure import *
class Domain(object):... |
dannywillems/tk_hadOneJob | refs/heads/master | ListImage.py | 1 | from urllib import urlopen
from bs4 import BeautifulSoup
from random import randint
from GSFile import *
from os import system
class ListImage(object):
def __init__(self, update, f="hadOneJob.list"):
self.URL = "http://hadonejob.com/"
self.SEEN = []
self.list = f
if updat... |
fritsvanveen/QGIS | refs/heads/master | python/ext-libs/pygments/formatters/svg.py | 50 | # -*- coding: utf-8 -*-
"""
pygments.formatters.svg
~~~~~~~~~~~~~~~~~~~~~~~
Formatter for SVG output.
:copyright: Copyright 2006-2015 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from pygments.formatter import Formatter
from pygments.util import get_bool_opt, get... |
adist/drunken-sansa | refs/heads/master | openerp/addons/hr/hr.py | 15 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... |
openshift/openshift-tools | refs/heads/prod | ansible/roles/lib_openshift_3.2/build/src/oc_edit.py | 13 | # pylint: skip-file
class Edit(OpenShiftCLI):
''' Class to wrap the oc command line tools
'''
# pylint: disable=too-many-arguments
def __init__(self,
kind,
namespace,
resource_name=None,
kubeconfig='/etc/origin/master/admin.kubeconfig'... |
joeythesaint/yocto-autobuilder | refs/heads/master | lib/python2.7/site-packages/buildbot-0.8.8-py2.7.egg/buildbot/test/unit/test_process_debug.py | 4 | # This file is part of Buildbot. Buildbot is free software: you can
# redistribute it and/or modify it under the terms of the GNU General Public
# License as published by the Free Software Foundation, version 2.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without eve... |
madmax983/h2o-3 | refs/heads/master | py2/testdir_single_jvm/test_DL_basic.py | 20 | import unittest, time, sys, random
sys.path.extend(['.','..','../..','py'])
import h2o2 as h2o
import h2o_cmd, h2o_import as h2i, h2o_jobs
from h2o_test import verboseprint, dump_json, OutputObj
class Basic(unittest.TestCase):
def tearDown(self):
h2o.check_sandbox_for_errors()
@classmethod
def se... |
Workday/OpenFrame | refs/heads/master | tools/perf/measurements/webrtc.py | 14 | # Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from telemetry.page import page_test
from metrics import cpu
from metrics import media
from metrics import memory
from metrics import power
from metrics imp... |
wilvk/ansible | refs/heads/devel | lib/ansible/modules/cloud/cloudstack/cs_facts.py | 99 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# (c) 2015, René Moser <mail@renemoser.net>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the Lice... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.