repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
barbuza/django | refs/heads/master | django/db/models/signals.py | 399 | from django.apps import apps
from django.dispatch import Signal
from django.utils import six
class_prepared = Signal(providing_args=["class"])
class ModelSignal(Signal):
"""
Signal subclass that allows the sender to be lazily specified as a string
of the `app_label.ModelName` form.
"""
def __in... |
tima/ansible | refs/heads/devel | lib/ansible/module_utils/network/dellos6/dellos6.py | 10 | #
# (c) 2015 Peter Sprygada, <psprygada@ansible.com>
#
# Copyright (c) 2016 Dell Inc.
#
# This code is part of Ansible, but is an independent component.
# This particular file snippet, and this file snippet only, is BSD licensed.
# Modules you write using this snippet, which is embedded dynamically by Ansible
# still b... |
uberamd/NGECore2 | refs/heads/master | scripts/object/draft_schematic/armor/component/armor_core_battle_basic.py | 85615 | import sys
def setup(core, object):
return |
ProjectSWGCore/NGECore2 | refs/heads/master | scripts/object/mobile/dressed_assassin_mission_giver_reb_01.py | 85615 | import sys
def setup(core, object):
return |
Hakuba/youtube-dl | refs/heads/master | youtube_dl/extractor/collegerama.py | 17 | from __future__ import unicode_literals
import json
from .common import InfoExtractor
from ..utils import (
float_or_none,
int_or_none,
sanitized_Request,
)
class CollegeRamaIE(InfoExtractor):
_VALID_URL = r'https?://collegerama\.tudelft\.nl/Mediasite/Play/(?P<id>[\da-f]+)'
_TESTS = [
{
... |
cchamberlain/gyp | refs/heads/master | test/compiler-override/my_cxx.py | 980 | #!/usr/bin/env python
# Copyright (c) 2012 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import sys
print sys.argv
|
TobiasFredersdorf/RIOT | refs/heads/master | tests/lwip_sock_ip/tests/01-run.py | 21 | #!/usr/bin/env python3
# Copyright (C) 2016 Kaspar Schleiser <kaspar@schleiser.de>
#
# This file is subject to the terms and conditions of the GNU Lesser
# General Public License v2.1. See the file LICENSE in the top level
# directory for more details.
import os
import sys
from datetime import datetime
sys.path.app... |
2014c2g9/c2g9 | refs/heads/master | wsgi/static/reeborg/src/libraries/brython/Lib/importlib/_bootstrap.py | 101 | """Core implementation of import.
This module is NOT meant to be directly imported! It has been designed such
that it can be bootstrapped into Python as the implementation of import. As
such it requires the injection of specific modules and attributes in order to
work. One should use importlib as the public-facing ver... |
markovg/nest-simulator | refs/heads/master | topology/examples/conncon_sources.py | 16 | # -*- coding: utf-8 -*-
#
# conncon_sources.py
#
# This file is part of NEST.
#
# Copyright (C) 2004 The NEST Initiative
#
# NEST 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 2 of the License... |
SaganBolliger/nupic | refs/heads/master | tests/swarming/nupic/swarming/experiments/smart_speculation_temporal/description.py | 32 | # ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2013, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions apply:
#
# This progra... |
ReganBell/QReview | refs/heads/master | networkx/linalg/__init__.py | 10 | from networkx.linalg.attrmatrix import *
import networkx.linalg.attrmatrix
from networkx.linalg.spectrum import *
import networkx.linalg.spectrum
from networkx.linalg.graphmatrix import *
import networkx.linalg.graphmatrix
from networkx.linalg.laplacianmatrix import *
import networkx.linalg.laplacianmatrix
from network... |
powellc/beltbadgers | refs/heads/master | beltbadgers/apps/belts/context_processors.py | 2 | from dojo.models import Student
def load_student(request):
try:
stu = Student.objects.get(user=request.user)
except:
stu = None
return {'student': stu} |
KarenKawaii/2.7-python-dev-KarenKawaii | refs/heads/master | pythonexercises/introduction/hello.py | 1 | # -*- coding: utf-8 -*-
"""
This module is a Hello World.
"""
print "Hello World"
|
cmtm/networkx | refs/heads/master | networkx/algorithms/assortativity/connectivity.py | 7 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2011 by
# Jordi Torrents <jtorrents@milnou.net>
# Aric Hagberg <hagberg@lanl.gov>
# All rights reserved.
# BSD license.
#
#
# Authors: Jordi Torrents <jtorrents@milnou.net>
# Aric Hagberg <hagberg@lanl.gov>
from __future__ import division
from collectio... |
nimbusproject/kazoo | refs/heads/master | kazoo/recipe/__init__.py | 82 | |
PCManticore/argus-ci | refs/heads/master | ci/tests.py | 2 | # Copyright 2015 Cloudbase Solutions Srl
# 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 r... |
yitian134/chromium | refs/heads/master | ppapi/generators/idl_node.py | 11 | #!/usr/bin/env python
# Copyright (c) 2012 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.
"""Nodes for PPAPI IDL AST"""
#
# IDL Node
#
# IDL Node defines the IDLAttribute and IDLNode objects which are constructed
# by th... |
shipci/boto | refs/heads/develop | boto/s3/tagging.py | 236 | from boto import handler
import xml.sax
class Tag(object):
def __init__(self, key=None, value=None):
self.key = key
self.value = value
def startElement(self, name, attrs, connection):
return None
def endElement(self, name, value, connection):
if name == 'Key':
... |
agoose77/hivesystem | refs/heads/master | manual/chess/tut-drone-2.py | 1 | import bee
import dragonfly
from dragonfly.commandhive import commandhive, commandapp
from components.drones.keyboardmove import keyboardmove
from components.drones.chessprocessor import chessprocessor
from components.drones.chesskeeper import chesskeeper
from components.drones.chessboard import chessboard
from compon... |
ConeyLiu/spark | refs/heads/master | python/pyspark/streaming/listener.py | 75 | #
# 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 file to You under the Apache License, Version 2.0
# (the "License"); you may not us... |
felixma/nova | refs/heads/master | nova/api/openstack/compute/legacy_v2/contrib/cells.py | 17 | # Copyright 2011-2012 OpenStack Foundation
# All Rights Reserved.
# Copyright 2013 Red Hat, 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/lic... |
proxysh/Safejumper-for-Mac | refs/heads/master | buildlinux/env32/lib/python2.7/site-packages/pyasn1/codec/__init__.py | 3653 | # This file is necessary to make this directory a package.
|
Cl3MM/metagoofil | refs/heads/master | hachoir_metadata/misc.py | 16 | from hachoir_metadata.metadata import RootMetadata, registerExtractor
from hachoir_metadata.safe import fault_tolerant
from hachoir_parser.container import SwfFile
from hachoir_parser.misc import TorrentFile, TrueTypeFontFile, OLE2_File, PcfFile
from hachoir_core.field import isString
from hachoir_core.error import war... |
gnuhub/intellij-community | refs/heads/master | plugins/hg4idea/testData/bin/mercurial/sshpeer.py | 90 | # sshpeer.py - ssh repository proxy class for mercurial
#
# Copyright 2005, 2006 Matt Mackall <mpm@selenic.com>
#
# This software may be used and distributed according to the terms of the
# GNU General Public License version 2 or any later version.
import re
from i18n import _
import util, error, wireproto
class remo... |
40223211/cadpbtest-0420 | refs/heads/master | static/Brython3.1.1-20150328-091302/Lib/imp.py | 637 | """This module provides the components needed to build your own __import__
function. Undocumented functions are obsolete.
In most cases it is preferred you consider using the importlib module's
functionality over this module.
"""
# (Probably) need to stay in _imp
from _imp import (lock_held, acquire_lock, release_lo... |
photocrowd/dj-stripe | refs/heads/master | djstripe/migrations/0006_auto_20150602_1934.py | 13 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('djstripe', '0005_charge_captured'),
]
operations = [
migrations.AlterField(
model_name='invoiceitem',
... |
albertjan/pypyjs | refs/heads/master | website/js/pypy.js-0.2.0/lib/modules/lib2to3/fixes/__init__.py | 2547 | # Dummy file to make this directory a package.
|
nathanielove/pdf-server | refs/heads/master | section/services.py | 1 | def recursive_search(section_dict, section_id):
if section_dict['id'] == section_id:
return section_dict
else:
for child_section in section_dict['children']:
result = recursive_search(child_section, section_id)
if result:
return result
return None
|
wndias/bc.repository | refs/heads/master | plugin.video.youtube/resources/lib/youtube/client/youtube.py | 2 | __author__ = 'bromix'
from resources.lib.kodion import simple_requests as requests
from .login_client import LoginClient
from ..helper.video_info import VideoInfo
class YouTube(LoginClient):
def __init__(self, config={}, language='en-US', region='US', items_per_page=50, access_token='', access_token_tv=''):
... |
jody-frankowski/ansible | refs/heads/devel | lib/ansible/runner/lookup_plugins/fileglob.py | 176 | # (c) 2012, Michael DeHaan <michael.dehaan@gmail.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 License, or
# (at your option) any lat... |
sumspr/scikit-learn | refs/heads/master | sklearn/linear_model/tests/test_base.py | 120 | # Author: Alexandre Gramfort <alexandre.gramfort@inria.fr>
# Fabian Pedregosa <fabian.pedregosa@inria.fr>
#
# License: BSD 3 clause
import numpy as np
from scipy import sparse
from sklearn.utils.testing import assert_array_almost_equal
from sklearn.utils.testing import assert_equal
from sklearn.linear_model.... |
nuobit/odoo-addons | refs/heads/11.0 | account_asset_non_deductible/models/__init__.py | 8 | # Copyright NuoBiT Solutions, S.L. (<https://www.nuobit.com>)
# Eric Antones <eantones@nuobit.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl)
from . import account_invoice
|
rybrogaard/catmap | refs/heads/master | catmap/solvers/mean_field_solver.py | 1 | from solver_base import *
from catmap.data import templates
from copy import copy
import mpmath as mp
from catmap.functions import numerical_jacobian
class MeanFieldSolver(SolverBase):
"""Class for handling mean-field type kinetic models. Can be sub-classed to
get functionality for steady-state solutions, saba... |
marcelometal/holmes-api | refs/heads/master | tests/unit/test_cache.py | 1 | #!/usr/bin/python
# -*- coding: utf-8 -*-
import time
from gzip import GzipFile
from cStringIO import StringIO
from ujson import dumps
import msgpack
from preggy import expect
from tornado.testing import gen_test
from tornado.gen import Task
from holmes.cache import Cache
from holmes.models import Domain, Limiter, P... |
direvus/ansible | refs/heads/devel | lib/ansible/modules/storage/netapp/netapp_e_storage_system.py | 21 | #!/usr/bin/python
# (c) 2016, NetApp, Inc
# 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
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
... |
boyombo/django-stations | refs/heads/master | stations/heathen/migrations/0003_auto_20161128_0519.py | 1 | # -*- coding: utf-8 -*-
# Generated by Django 1.9.5 on 2016-11-28 05:19
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('heathen', '0002_member_gender'),
]
operations = [
... |
Deepomatic/dmake | refs/heads/master | test/test_link_names.py | 1 | import pytest
from dmake.deepobuild import LinkNames, NeededServiceSerializer, DockerLinkSerializer
from dmake.serializer import ValidationError
# docker_links
def test_docker_links_different_simple_service_same_file():
"""multiple docker_links can have different link names"""
LinkNames.reset()
DockerLi... |
OpenUpgrade-dev/OpenUpgrade | refs/heads/8.0 | addons/payment_buckaroo/tests/test_buckaroo.py | 321 | # -*- coding: utf-8 -*-
from lxml import objectify
import urlparse
import openerp
from openerp.addons.payment.models.payment_acquirer import ValidationError
from openerp.addons.payment.tests.common import PaymentAcquirerCommon
from openerp.addons.payment_buckaroo.controllers.main import BuckarooController
from opener... |
Spiderlover/Toontown | refs/heads/master | toontown/launcher/QuickStartLauncher.py | 6 | import sys
sys.path = ['']
import Phase2
from toontown.launcher.QuickLauncher import QuickLauncher
launcher = QuickLauncher()
launcher.notify.info('Reached end of StartQuickLauncher.py.')
|
40223211/cadb_g7_w18test | refs/heads/master | static/Brython3.1.1-20150328-091302/Lib/importlib/__init__.py | 610 | """A pure Python implementation of import."""
__all__ = ['__import__', 'import_module', 'invalidate_caches']
# Bootstrap help #####################################################
# Until bootstrapping is complete, DO NOT import any modules that attempt
# to import importlib._bootstrap (directly or indirectly). Since... |
ormnv/os_final_project | refs/heads/master | django/utils/_os.py | 112 | import os
import stat
import sys
from os.path import join, normcase, normpath, abspath, isabs, sep, dirname
from django.utils.encoding import force_text
from django.utils import six
try:
WindowsError = WindowsError
except NameError:
class WindowsError(Exception):
pass
if not six.PY3:
fs_encoding ... |
atosorigin/ansible | refs/heads/devel | test/units/module_utils/facts/hardware/test_linux.py | 93 | # 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 ... |
daniaki/Enrich2 | refs/heads/py3 | enrich2/base/__init__.py | 1 | # Copyright 2016-2017 Alan F Rubin, Daniel Esposito
#
# This file is part of Enrich2.
#
# Enrich2 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) an... |
OCA/geospatial | refs/heads/12.0 | test_base_geoengine/__manifest__.py | 1 | # Copyright 2019 Camptocamp SA
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
{
'name': 'test-base-geoengine',
'version': '12.0.1.0.0',
'category': 'Tests',
'author': "Camptocamp,ACSONE SA/NV,Odoo Community Association (OCA)",
'license': 'AGPL-3',
'website': 'https://github.com/... |
cogmission/nupic | refs/heads/master | examples/tp/hello_tm.py | 8 | #!/usr/bin/env python
# ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2013, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions ... |
anaran/olympia | refs/heads/master | apps/perf/urls.py | 6 | from django.conf.urls import patterns, url
from . import views
urlpatterns = patterns('',
url('^$', views.index, name='perf.index'),
)
|
donkirkby/django | refs/heads/master | django/conf/locale/lv/formats.py | 504 | # -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
from __future__ import unicode_literals
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = r'Y. \g\a\d\a j. F'
TIME_FORMAT = ... |
batermj/algorithm-challenger | refs/heads/master | code-analysis/programming_anguage/python/source_codes/Python3.8.0/Python-3.8.0/Lib/test/test_asyncio/test_futures.py | 1 | """Tests for futures.py."""
import concurrent.futures
import gc
import re
import sys
import threading
import unittest
from unittest import mock
import asyncio
from asyncio import futures
from test.test_asyncio import utils as test_utils
from test import support
def tearDownModule():
asyncio.set_event_loop_polic... |
Yasumoto/commons | refs/heads/master | tests/python/twitter/common/concurrent/test_concurrent.py | 12 | import time
from functools import partial
from Queue import Empty, Queue
import pytest
from twitter.common.concurrent import deadline, defer, Timeout
from twitter.common.contextutil import Timer
def test_deadline_default_timeout():
timeout = partial(time.sleep, 0.5)
with pytest.raises(Timeout):
deadline(time... |
tinfoil/phantomjs | refs/heads/master | src/qt/qtwebkit/Tools/Scripts/webkitpy/layout_tests/views/__init__.py | 6014 | # Required for Python to search this directory for module files
|
malev/deps | refs/heads/master | setup.py | 1 | from setuptools import setup, find_packages
setup(
name='deps',
version='0.1.0',
author='Marcos Vanetta',
author_email='marcosvanetta@gmail.com',
url='http://github.com/malev/deps',
description='Environment.yml parser',
packages=find_packages(),
install_requires=['pyyaml'],
entry_po... |
AndrewGrossman/django | refs/heads/master | tests/m2m_through/models.py | 115 | from datetime import datetime
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
# M2M described on one of the models
@python_2_unicode_compatible
class Person(models.Model):
name = models.CharField(max_length=128)
class Meta:
ordering = ('name',)
def __s... |
aferrero2707/PhotoFlow | refs/heads/stable | src/external/rawspeed/docs/sphinx-pyexec.py | 3 | try:
from StringIO import StringIO
except ImportError:
from io import StringIO
import sys
from docutils.parsers.rst import Directive
from docutils import nodes
from sphinx.util import nested_parse_with_titles
from docutils.statemachine import StringList
class ExecDirective(Directive):
has_content = True
... |
tizianasellitto/servo | refs/heads/master | tests/wpt/web-platform-tests/tools/pywebsocket/src/example/abort_wsh.py | 465 | # 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 of conditions and the f... |
40223151/2015cd0505 | refs/heads/master | static/Brython3.1.1-20150328-091302/Lib/time.py | 518 | from browser import window
import javascript
# use Javascript Date constructor
date = javascript.JSConstructor(window.Date)
#daylight = 0 # fix me.. returns Non zero if DST timezone is defined
##############################################
# Added to pass some tests
# Are there timezone always in the browser?
# I'm ... |
gltn/stdm | refs/heads/master | stdm/tests/data/utils.py | 1 | from sqlalchemy import create_engine
from stdm import data
from stdm.data.configuration.columns import (
DateColumn,
ForeignKeyColumn,
GeometryColumn,
IntegerColumn,
LookupColumn,
MultipleSelectColumn,
TextColumn,
VarCharColumn
)
from stdm.data.configuration.entity import e... |
JoeEnnever/thrift | refs/heads/master | contrib/fb303/py/fb303_scripts/fb303_simple_mgmt.py | 171 | #!/usr/bin/env python
#
# 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 file
# to you under the Apache License, Version 2.0 (the
# "L... |
stutivarshney/Bal-Aveksha | refs/heads/master | WebServer/BalAvekshaEnv/lib/python3.5/site-packages/wheel/bdist_wheel.py | 232 | """
Create a wheel (.whl) distribution.
A wheel is a built archive format.
"""
import csv
import hashlib
import os
import subprocess
import warnings
import shutil
import json
import wheel
try:
import sysconfig
except ImportError: # pragma nocover
# Python < 2.7
import distutils.sysconfig as sysconfig
i... |
pra85/calibre | refs/heads/master | src/calibre/ebooks/mobi/writer2/resources.py | 3 | #!/usr/bin/env python
# vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:ai
from __future__ import (unicode_literals, division, absolute_import,
print_function)
__license__ = 'GPL v3'
__copyright__ = '2012, Kovid Goyal <kovid@kovidgoyal.net>'
__docformat__ = 'restructuredtext en'
from calibre.e... |
aterrel/blaze | refs/heads/master | blaze/expr/__init__.py | 1 | from .table import TableExpr
|
cryptobanana/ansible | refs/heads/devel | lib/ansible/module_utils/network/aireos/aireos.py | 85 | # This code is part of Ansible, but is an independent component.
# This particular file snippet, and this file snippet only, is BSD licensed.
# Modules you write using this snippet, which is embedded dynamically by Ansible
# still belong to the author of the module, and may assign their own license
# to the complete wo... |
iborko/fmindex | refs/heads/master | sandbox/OccTrivial.py | 1 | """
Provides a trivial Occurence table implementation,
for testing purposes.
"""
import numpy as np
import logging
log = logging.getLogger(__name__)
class OccTrivial(object):
def __init__(self, string):
super(OccTrivial, self).__init__()
# get the string alphabet
self.alphabet = sor... |
Arkapravo/morse-0.6 | refs/heads/master | src/morse/middleware/ros/read_vw_twist.py | 1 | import roslib; roslib.load_manifest('roscpp'); roslib.load_manifest('rospy'); roslib.load_manifest('geometry_msgs'); roslib.load_manifest('rosgraph_msgs')
import rospy
import std_msgs
import math
from geometry_msgs.msg import Twist
def init_extra_module(self, component_instance, function, mw_data):
""" Setup the... |
ehashman/oh-mainline | refs/heads/master | vendor/packages/Django/tests/regressiontests/m2m_through_regress/__init__.py | 45382 | |
alisidd/tensorflow | refs/heads/asgd-dc | tensorflow/python/kernel_tests/random_shuffle_queue_test.py | 65 | # 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... |
wevote/WebAppPublic | refs/heads/master | star/views_admin.py | 1 | # star/views_admin.py
# Brought to you by We Vote. Be good.
# -*- coding: UTF-8 -*-
from .models import StarItem
from .serializers import StarItemSerializer
from rest_framework.views import APIView
from rest_framework.response import Response
import wevote_functions.admin
logger = wevote_functions.admin.get_logger(__... |
Bionetbook/bionetbook | refs/heads/master | bnbapp/bionetbook/profiles/tests/test_middleware.py | 2 | from django.contrib.auth.models import User
from django.core.urlresolvers import reverse
from django.test import TestCase
from profiles.models import Profile
class ProfileMiddlewareTests(TestCase):
def setUp(self):
self.user = User.objects.create_user(
username="testuser",
passw... |
yongtang/tensorflow | refs/heads/master | tensorflow/python/kernel_tests/sparse_ops_test.py | 5 | # 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... |
neowinx/chow-chow | refs/heads/master | samples/prompting_combobox.py | 1 | import wx
class PromptingComboBox(wx.ComboBox):
def __init__(self, parent, value, choices=[], style=0, **par):
wx.ComboBox.__init__(self, parent, wx.ID_ANY, value, style=style|wx.CB_DROPDOWN, choices=choices, **par)
self.choices = choices
self.Bind(wx.EVT_TEXT, self.EvtText)
self.B... |
yuezhou/telephony | refs/heads/master | telephony/Classes/pjproject-2.2.1/tests/pjsua/scripts-pesq/200_codec_g722.py | 59 | # $Id: 200_codec_g722.py 2063 2008-06-26 18:52:16Z nanang $
#
from inc_cfg import *
ADD_PARAM = ""
if (HAS_SND_DEV == 0):
ADD_PARAM += "--null-audio"
# Call with G722 codec
test_param = TestParam(
"PESQ codec G722",
[
InstanceParam("UA1", ADD_PARAM + " --max-calls=1 --add-codec g722 --clock-rate 16000 --play... |
talos/gitdict | refs/heads/master | test/helpers.py | 1 | import os
import unittest
import shutil
from gitdict import DictRepository
REPO_DIR = os.path.join('test', 'tmp')
class RepoTestCase(unittest.TestCase):
def setUp(self):
"""
Build a new test dir for each run.
"""
self.repo = DictRepository(REPO_DIR)
def tearDown(self):
... |
mgagne/nova | refs/heads/master | nova/api/openstack/compute/contrib/server_start_stop.py | 51 | # Copyright 2012 Midokura Japan K.K.
#
# 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 o... |
2014c2g12/c2g12 | refs/heads/master | wsgi/w2/static/Brython2.0.0-20140209-164925/Lib/pickle.py | 1265 | from json import * |
sloria/webargs | refs/heads/dev | src/webargs/fields.py | 1 | # -*- coding: utf-8 -*-
"""Field classes.
Includes all fields from `marshmallow.fields` in addition to a custom
`Nested` field and `DelimitedList`.
All fields can optionally take a special `location` keyword argument, which
tells webargs where to parse the request argument from.
.. code-block:: python
args = {
... |
ltilve/ChromiumGStreamerBackend | refs/heads/master | tools/telemetry/third_party/gsutilz/third_party/protorpc/protorpc/generate_python.py | 39 | #!/usr/bin/env python
#
# Copyright 2010 Google 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 o... |
geng890518/editor-ui | refs/heads/master | node_modules/node-gyp/gyp/tools/pretty_sln.py | 1831 | #!/usr/bin/env python
# Copyright (c) 2012 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Prints the information in a sln file in a diffable way.
It first outputs each projects in alphabetical order with their
dependenci... |
CivicTechTO/open-cabinet | refs/heads/master | openorders/alerts/emailtoken.py | 2 | from itsdangerous import URLSafeTimedSerializer
import ALERTCONFIG
def generate_confirmation_token(email):
serializer = URLSafeTimedSerializer( ALERTCONFIG.EMAIL_KEY )
return serializer.dumps(email, salt=ALERTCONFIG.EMAIL_SALT )
def confirm_token(token, expiration=3600):
serializer = URLSafeTimedSerializ... |
codenote/chromium-test | refs/heads/master | tools/telemetry/telemetry/core/chrome/inspector_page.py | 1 | # Copyright (c) 2012 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.
import json
import logging
from telemetry.core import util
class InspectorPage(object):
def __init__(self, inspector_backend):
self._inspector_bac... |
tangfeixiong/nova | refs/heads/stable/juno | nova/compute/resources/base.py | 95 | # Copyright (c) 2013 Hewlett-Packard Development Company, L.P.
# 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/LICEN... |
divio/django | refs/heads/master | tests/schema/tests.py | 14 | import datetime
import itertools
import unittest
from copy import copy
from django.db import (
DatabaseError, IntegrityError, OperationalError, connection,
)
from django.db.models import Model
from django.db.models.fields import (
AutoField, BigIntegerField, BinaryField, BooleanField, CharField,
DateField,... |
hujiajie/chromium-crosswalk | refs/heads/master | build/android/gyp/create_device_library_links.py | 18 | #!/usr/bin/env python
#
# Copyright 2013 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.
"""Creates symlinks to native libraries for an APK.
The native libraries should have previously been pushed to the device (in
option... |
gandarez/wakatime | refs/heads/master | wakatime/packages/pygments_py2/pygments/console.py | 135 | # -*- coding: utf-8 -*-
"""
pygments.console
~~~~~~~~~~~~~~~~
Format colored console output.
:copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
esc = "\x1b["
codes = {}
codes[""] = ""
codes["reset"] = esc + "39;49;00m"
cod... |
dorotan/pythontraining | refs/heads/master | test/test_modify_group.py | 1 | __author__ = 'dorota'
# -*- coding: utf-8 -*-
from model.group import Group
from random import randrange
def test_modify_group_name(app, db):
if app.group.count() == 0:
app.group.create()
old_groups = db.get_group_list()
index = randrange(len(old_groups))
group = Group(name="test")
group.i... |
gauribhoite/personfinder | refs/heads/master | env/site-packages/django/core/handlers/base.py | 92 | from __future__ import unicode_literals
import logging
import sys
import types
from django import http
from django.conf import settings
from django.core import signals, urlresolvers
from django.core.exceptions import (
MiddlewareNotUsed, PermissionDenied, SuspiciousOperation,
)
from django.db import connections, ... |
da1z/intellij-community | refs/heads/master | python/testData/create_tests/create_tst.py | 27 | class Spam:
def eggs(self):
pass
def eggs_and_ham(self):
pass |
mbrukman/mapnik | refs/heads/master | scons/scons-local-2.3.6/SCons/Tool/packaging/__init__.py | 4 | """SCons.Tool.Packaging
SCons Packaging Tool.
"""
#
# Copyright (c) 2001 - 2015 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# witho... |
bmander/dancecontraption | refs/heads/master | django/contrib/localflavor/it/forms.py | 273 | """
IT-specific Form helpers
"""
from django.core.validators import EMPTY_VALUES
from django.forms import ValidationError
from django.forms.fields import Field, RegexField, Select
from django.utils.translation import ugettext_lazy as _
from django.utils.encoding import smart_unicode
from django.contrib.localflavor.it.... |
sencha/chromium-spacewalk | refs/heads/master | mojo/spy/ui/__init__.py | 42 | # 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 ui import tvcm_stub
|
matthaywardwebdesign/rethinkdb | refs/heads/next | external/v8_3.30.33.16/build/gyp/test/configurations/x64/gyptest-x86.py | 340 | #!/usr/bin/env python
# Copyright (c) 2012 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
Verifies build of an executable in three different configurations.
"""
import TestGyp
import sys
formats = ['msvs']
if sys.platform =... |
FireballDWF/cloud-custodian | refs/heads/master | tools/c7n_azure/c7n_azure/resources/data_factory.py | 3 | # Copyright 2018 Capital One Services, LLC
#
# 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... |
HardlyHaki/crits | refs/heads/master | crits/events/urls.py | 17 | from django.conf.urls import patterns
urlpatterns = patterns('crits.events.views',
(r'^details/(?P<eventid>\w+)/$', 'view_event'),
(r'^add/$', 'add_event'),
(r'^search/$', 'event_search'),
(r'^upload/sample/(?P<event_id>\w+)/$', 'upload_sample'),
(r'^remove/(?P<_id>[\S ]+)$', 'remove_event'),
(... |
cflee/voc | refs/heads/master | tests/builtins/test_max.py | 3 | from .. utils import TranspileTestCase, BuiltinFunctionTestCase
class MaxTests(TranspileTestCase):
def test_args(self):
self.assertCodeExecution("""
try:
max()
except TypeError:
print("Threw an error as expected")
# Single integer
... |
usc-isi/nova | refs/heads/hpc-trunk | nova/exception.py | 1 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compli... |
ntt-sic/nova | refs/heads/master | nova/api/openstack/compute/ips.py | 12 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# 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.apach... |
jazcollins/models | refs/heads/master | object_detection/utils/metrics.py | 17 | # 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... |
asacamano/keyczar | refs/heads/master | cpp/src/tools/scons/scons-local-1.2.0.d20090223/SCons/Tool/MSCommon/vs.py | 19 | #
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitati... |
richardcs/ansible | refs/heads/devel | lib/ansible/modules/storage/netapp/na_ontap_lun_map.py | 7 | #!/usr/bin/python
""" this is lun mapping module
(c) 2018, NetApp, Inc
# 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
ANSIBLE_METADATA = {'metadata_version': '1.1',
... |
Cubillosxy/MYO-PYTHON-BEBOP | refs/heads/master | core/remote_testing/test_allsettings.py | 5 | #!/usr/bin/python
"""
Test request of all drone settings.
status: TESTED, Charles/France 2015-04-20 ... integrated into Bebop initial config()
usage:
./test_allsettings.py <dummytask> [<metalog> [<F>]]
"""
import sys
import os
import inspect
BEBOP_ROOT = os.path.realpath(os.path.abspath(os.path.join(os.pa... |
ecliptik/ansible-modules-core | refs/heads/devel | cloud/rackspace/rax_dns.py | 132 | #!/usr/bin/python
# 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... |
shujaatak/UAV_MissionPlanner | refs/heads/master | Lib/lib2to3/fixes/fix_repr.py | 327 | # Copyright 2006 Google, Inc. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.
"""Fixer that transforms `xyzzy` into repr(xyzzy)."""
# Local imports
from .. import fixer_base
from ..fixer_util import Call, Name, parenthesize
class FixRepr(fixer_base.BaseFix):
BM_compatible = True
PATTE... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.