repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
fitermay/intellij-community | refs/heads/master | python/testData/completion/classNameInDocstring.after.py | 48 | class MyClass:
pass
def f(x):
"""
@param x:
@type x: MyClass
""" |
danielchatfield/shreddi.es | refs/heads/master | libs/jinja2/nodes.py | 623 | # -*- coding: utf-8 -*-
"""
jinja2.nodes
~~~~~~~~~~~~
This module implements additional nodes derived from the ast base node.
It also provides some node tree helper functions like `in_lineno` and
`get_nodes` used by the parser and translator in order to normalize
python and jinja nodes.
:... |
hunter007/django | refs/heads/master | django/contrib/humanize/__init__.py | 808 | default_app_config = 'django.contrib.humanize.apps.HumanizeConfig'
|
fhaoquan/kbengine | refs/heads/master | kbe/src/lib/python/Lib/test/seq_tests.py | 104 | """
Tests common to tuple, list and UserList.UserList
"""
import unittest
import sys
import pickle
# Various iterables
# This is used for checking the constructor (here and in test_deque.py)
def iterfunc(seqn):
'Regular generator'
for i in seqn:
yield i
class Sequence:
'Sequence using __getitem__... |
glove747/liberty-neutron | refs/heads/master | neutron/plugins/ml2/rpc.py | 11 | # Copyright (c) 2013 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 ... |
PepperPD/edx-pepper-platform | refs/heads/master | common/lib/xmodule/xmodule/tests/test_self_assessment.py | 6 | import json
from mock import Mock, MagicMock
import unittest
from xmodule.open_ended_grading_classes.self_assessment_module import SelfAssessmentModule
from xmodule.modulestore import Location
from lxml import etree
from . import get_test_system
import test_util_open_ended
class SelfAssessmentTest(unittest.TestCas... |
dongjoon-hyun/tensorflow | refs/heads/master | tensorflow/contrib/distributions/python/ops/seed_stream.py | 36 | # Copyright 2018 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... |
Jgarcia-IAS/SAT | refs/heads/master | openerp/addons-extra/odoo-pruebas/odoo-server/addons/l10n_pe/__init__.py | 2120 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (c) 2011 Cubic ERP - Teradata SAC. (http://cubicerp.com).
#
# WARNING: This program as such is intended to be used by professional
# programmers who take t... |
mtat76/atm-py | refs/heads/master | build/lib/atmPy/for_removal/POPS/raw.py | 6 | # -*- coding: utf-8 -*-
"""
Created on Thu Feb 26 10:41:17 2015
@author: htelg
"""
import os
from struct import unpack, calcsize
import numpy as np
def load_raw(fname):
''' load a raw_file and returns a numpy array.
Note, these files have no x axes. The axes depends on the sampling rate of the particular POP... |
cartwheelweb/packaginator | refs/heads/master | apps/grid/cachekeys.py | 3 | def grid_grid_packages(grid):
return "grid:grid_packages:%s" % grid.id |
mbedmicro/mbed | refs/heads/master | tools/host_tests/detect_auto.py | 13 | """
mbed SDK
Copyright (c) 2011-2013 ARM Limited
SPDX-License-Identifier: Apache-2.0
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 ... |
WoLpH/celery | refs/heads/master | celery/worker/buckets.py | 1 | from __future__ import absolute_import
from __future__ import with_statement
import threading
from collections import deque
from time import time, sleep
from Queue import Queue, Empty
from celery.datastructures import TokenBucket
from celery.utils import timeutils
from celery.utils.compat import izip_longest, chain_... |
Matoking/pastebin-django | refs/heads/master | pastes/models.py | 1 | from django.db import models, transaction, connection
from django.db.models import Q
from django.core.exceptions import ObjectDoesNotExist
from django.contrib.auth.models import User
from django.core.cache import cache
from django_redis import get_redis_connection
from django.utils import timezone
from pastebin impo... |
pnavarro/neutron | refs/heads/master | neutron/api/versions.py | 23 | # Copyright 2011 Citrix Systems.
# 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 ... |
batisteo/pasportaservo | refs/heads/master | hosting/migrations/0055_change_profile_gender_desc.py | 3 | # -*- coding: utf-8 -*-
# Generated by Django 1.11.29 on 2020-10-29 07:30
from __future__ import unicode_literals
from django.db import migrations
import hosting.fields
class Migration(migrations.Migration):
dependencies = [
('hosting', '0054_phones_ordering'),
]
operations = [
migratio... |
Geode/geonode | refs/heads/master | geonode/documents/migrations/0001_initial.py | 5 | # -*- coding: utf-8 -*-
#########################################################################
#
# Copyright (C) 2016 OSGeo
#
# 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 ... |
matmodlab/matmodlab2 | refs/heads/master | tests/test_materials_j2plasticity.py | 1 | import os
import glob
import pytest
import random
import numpy as np
from matmodlab2 import *
from testing_utils import *
@pytest.mark.pandas
@pytest.mark.random
@pytest.mark.material
@pytest.mark.j2plasticity
@pytest.mark.parametrize('realization', range(1,4))
def test_random_j2_1(realization):
myvars = ('Time',... |
JetBrains/intellij-community | refs/heads/master | python/testData/quickFixes/PyAddImportQuickFixTest/orderingWithExistingImport/src.py | 12 | path = "local value, so it should take precedence if there is no import" |
DataDog/moto | refs/heads/master | tests/test_ec2/test_internet_gateways.py | 2 | from __future__ import unicode_literals
# Ensure 'assert_raises' context manager support for Python 2.6
import tests.backport_assert_raises
from nose.tools import assert_raises
import re
import boto
from boto.exception import EC2ResponseError
import sure # noqa
from moto import mock_ec2
VPC_CIDR="10.0.0.0/16"
BA... |
flavour/tldrmp | refs/heads/master | private/templates/SandyRelief/config.py | 2 | # -*- coding: utf-8 -*-
try:
# Python 2.7
from collections import OrderedDict
except:
# Python 2.6
from gluon.contrib.simplejson.ordered_dict import OrderedDict
from gluon import current, TR, TD, DIV
from gluon.storage import Storage
T = current.T
settings = current.deployment_settings
"""
Templ... |
cowboysmall/rosalind | refs/heads/master | src/heights/rosalind_2sum.py | 1 | import os
import sys
sys.path.append(os.path.join(os.path.dirname(__file__), '../tools'))
import files
import sorts
import searches
from collections import defaultdict
def two_sum(A):
H = defaultdict(list)
for i, e in enumerate(A):
H[e].append(i)
if 0 in H and len(H[0]) > 1:
return sor... |
whs/django | refs/heads/master | tests/postgres_tests/migrations/0001_setup_extensions.py | 15 | from unittest import mock
from django.db import migrations
try:
from django.contrib.postgres.operations import (
BtreeGinExtension, CITextExtension, CreateExtension, CryptoExtension,
HStoreExtension, TrigramExtension, UnaccentExtension,
)
except ImportError:
BtreeGinExtension = mock.Mock()... |
Changaco/oh-mainline | refs/heads/master | vendor/packages/zope.interface/src/zope/interface/common/__init__.py | 438 | #
# This file is necessary to make this directory a package.
|
jacquesqiao/Paddle | refs/heads/develop | python/paddle/fluid/trainer.py | 1 | # Copyright (c) 2018 PaddlePaddle 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 app... |
slzatz/micropython | refs/heads/master | tests/pyb/led.py | 48 | import pyb
from pyb import LED
for i in range(4):
print(LED(i+1))
for i in range(4):
LED(i+1).on()
pyb.delay(10)
for i in range(4):
LED(i+1).off()
pyb.delay(10)
for i in range(4):
LED(i+1).toggle()
pyb.delay(10)
for i in range(4):
LED(i+1).intensity(0)
for i in range(256):
LED(4).intensity(i)... |
nurmd2/nurmd | refs/heads/master | openerp/addons/test_inherits/__openerp__.py | 357 | # -*- coding: utf-8 -*-
{
'name': 'test-inherits',
'version': '0.1',
'category': 'Tests',
'description': """A module to verify the inheritance using _inherits.""",
'author': 'Camptocamp',
'website': 'http://www.camptocamp.com',
'depends': ['base'],
'data': [
'ir.model.access.csv'... |
catholabs/esengine | refs/heads/master | tests/test_metaclass.py | 2 | from esengine.bases.metaclass import ModelMetaclass
from esengine.bases.field import BaseField
from esengine.embedded_document import EmbeddedDocument
from six import with_metaclass
def test_derived_class_has_fields_attr():
class NoFields(with_metaclass(ModelMetaclass, object)):
pass
assert hasattr(N... |
Ascoware/get-iplayer-automator | refs/heads/master | Binaries/Crypto/PublicKey/_slowmath.py | 124 | # -*- coding: utf-8 -*-
#
# PubKey/RSA/_slowmath.py : Pure Python implementation of the RSA portions of _fastmath
#
# Written in 2008 by Dwayne C. Litzenberger <dlitz@dlitz.net>
#
# ===================================================================
# The contents of this file are dedicated to the public domain. To
#... |
liberorbis/libernext | refs/heads/master | env/lib/python2.7/site-packages/IPython/parallel/apps/ipcontrollerapp.py | 8 | #!/usr/bin/env python
# encoding: utf-8
"""
The IPython controller application.
Authors:
* Brian Granger
* MinRK
"""
#-----------------------------------------------------------------------------
# Copyright (C) 2008 The IPython Development Team
#
# Distributed under the terms of the BSD License. The full licen... |
sdnlab/floodlight | refs/heads/master | src/main/python/debugserver.py | 110 | #!/usr/bin/env python
import sys
from threading import currentThread
from SocketServer import BaseRequestHandler, TCPServer
from code import InteractiveConsole
_locals = None
class DebugLogger(object):
def do_print(self, *args):
for i in args:
print i,
print
info = do_print
wa... |
rogerhil/cdpc | refs/heads/master | scripts/createuser.py | 1 | # -*- coding: utf-8; Mode: Python -*-
import sys
sys.path.insert(0, '..')
from optparse import OptionParser
from cdpc.app.usuarios import schemas
from cdpc.app.usuarios import models
from cdpc.app.usuarios.cadastro import *
from cdpc.main import setup_models
from shortcuts import *
setup_models()
password = lambda... |
guidj/ir-orc | refs/heads/master | web/main.py | 1 | import os
import json
import flask
import requests
from werkzeug.utils import secure_filename
from irocr.meta import censure
from irocr import config
UPLOAD_FOLDER = 'uploads/'
ALLOWED_EXTENSIONS = {'png', 'jpg', 'jpeg'}
class SolrConfig(object):
def __init__(self):
cfg = config.get('solr')
if no... |
cactusbin/nyt | refs/heads/master | matplotlib/examples/api/watermark_text.py | 7 | """
Use a Text as a watermark
"""
import numpy as np
#import matplotlib
#matplotlib.use('Agg')
import matplotlib.pyplot as plt
fig, ax = plt.subplots()
ax.plot(np.random.rand(20), '-o', ms=20, lw=2, alpha=0.7, mfc='orange')
ax.grid()
# position bottom right
fig.text(0.95, 0.05, 'Property of MPL',
fontsize=5... |
aliyun/oss-ftp | refs/heads/master | python27/win32/Lib/dbhash.py | 188 | """Provide a (g)dbm-compatible interface to bsddb.hashopen."""
import sys
import warnings
warnings.warnpy3k("in 3.x, the dbhash module has been removed", stacklevel=2)
try:
import bsddb
except ImportError:
# prevent a second import of this module from spuriously succeeding
del sys.modules[__name__]
rai... |
jseabold/statsmodels | refs/heads/master | statsmodels/sandbox/distributions/extras.py | 4 | '''Various extensions to distributions
* skew normal and skew t distribution by Azzalini, A. & Capitanio, A.
* Gram-Charlier expansion distribution (using 4 moments),
* distributions based on non-linear transformation
- Transf_gen
- ExpTransf_gen, LogTransf_gen
- TransfTwo_gen
(defines as examples: square, n... |
kamink/RAPCASEC | refs/heads/master | bamliquidator_internal/bamliquidatorbatch/normalize_plot_and_summarize.py | 1 | #!/usr/bin/env python
##################################################################################
# The MIT License (MIT)
#
# Copyright (c) 2013 John DiMatteo (jdimatteo@gmail.com)
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of
# this software and associated documentation fi... |
translate/translate | refs/heads/master | translate/lang/sv.py | 2 | #
# Copyright 2009 Zuza Software Foundation
#
# This file is part of the Translate Toolkit.
#
# 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 2 of the License, or
# (at your optio... |
spcui/avocado-vt | refs/heads/master | virttest/unittest_utils/mock.py | 7 | __author__ = "raphtee@google.com (Travis Miller)"
import re
import collections
import StringIO
import sys
class StubNotFoundError(Exception):
'Raised when god is asked to unstub an attribute that was not stubbed'
pass
class CheckPlaybackError(Exception):
'Raised when mock playback does not match rec... |
lail3344/sms-tools | refs/heads/master | software/models_interface/stft_function.py | 18 | # function to call the main analysis/synthesis functions in software/models/stft.py
import numpy as np
import matplotlib.pyplot as plt
import os, sys
from scipy.signal import get_window
sys.path.append(os.path.join(os.path.dirname(os.path.realpath(__file__)), '../models/'))
import utilFunctions as UF
import stft as ST... |
infoxchange/barman | refs/heads/master | tests/test_output.py | 1 | # Copyright (C) 2013-2017 2ndQuadrant Limited
#
# This file is part of Barman.
#
# Barman 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 versio... |
Ingenico-ePayments/connect-sdk-python3 | refs/heads/master | ingenico/connect/sdk/merchant/productgroups/get_productgroup_params.py | 1 | # -*- coding: utf-8 -*-
#
# This class was auto-generated from the API references found at
# https://epayments-api.developer-ingenico.com/s2sapi/v1/
#
from ingenico.connect.sdk.param_request import ParamRequest
from ingenico.connect.sdk.request_param import RequestParam
class GetProductgroupParams(ParamRequest):
... |
cyberark-bizdev/ansible | refs/heads/devel | lib/ansible/modules/files/tempfile.py | 66 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2016, Krzysztof Magosa <krzysztof@magosa.pl>
# Copyright: (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__ = t... |
supertom/libcloud | refs/heads/trunk | libcloud/test/common/test_aliyun.py | 28 | # 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 use ... |
moylop260/rma | refs/heads/master | __unported__/crm_rma_advance_location/wizard/__init__.py | 10 | # -*- coding: utf-8 -*-
##############################################################################
#
# Copyright 2013 Camptocamp
# Copyright 2009-2013 Akretion,
# Author: Emmanuel Samyn, Raphaël Valyi, Sébastien Beau, Joel Grand-Guillaume
#
# This program is free software: you can redistribute it and/o... |
foxolab/sendpulse-api | refs/heads/master | sendpulse_api/version.py | 1 | # coding: utf-8
VERSION = '1.0.0'
|
DanielSBrown/osf.io | refs/heads/develop | api/tokens/serializers.py | 22 | from rest_framework import serializers as ser
from rest_framework import exceptions
from framework.auth.oauth_scopes import public_scopes
from website.models import ApiOAuth2PersonalToken
from api.base.serializers import JSONAPISerializer, LinksField, IDField, TypeField
class ApiOAuth2PersonalTokenSerializer(JSONAP... |
mitchelljkotler/django | refs/heads/master | tests/model_options/test_tablespaces.py | 337 | from __future__ import unicode_literals
from django.apps import apps
from django.conf import settings
from django.db import connection
from django.test import TestCase, skipIfDBFeature, skipUnlessDBFeature
from .models.tablespaces import (
Article, ArticleRef, Authors, Reviewers, Scientist, ScientistRef,
)
def ... |
tremby/deluge-yarss-plugin | refs/heads/master | yarss2/util/rssfeed_matching_helper.py | 2 | #
# rssfeed_matching_helper.py
#
# Copyright (C) 2012 Bro
#
# Deluge is free software.
#
# You may 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.
#
# deluge is... |
erikarthur/P2_Tournament | refs/heads/master | vagrant/tournament.py | 1 | #!/usr/bin/env python
#
# tournament.py -- implementation of a Swiss-system tournament
#
import psycopg2
import random
import contextlib
def connect():
"""Connect to the PostgreSQL database. Returns a
database connection."""
db = psycopg2.connect("dbname='tournament'")
return db
@contextlib.conte... |
MER-GROUP/intellij-community | refs/heads/master | python/testData/inspections/PyUnresolvedReferencesInspection/NestedNamespacePackageName/a.py | 79 | from linkedin.utils.file import temp_directory
temp_directory()
|
phenoxim/cinder | refs/heads/master | cinder/image/glance.py | 1 | # Copyright 2010 OpenStack Foundation
# Copyright 2013 NTT corp.
# 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/LIC... |
morpheby/levelup-by | refs/heads/master | lms/djangoapps/instructor/tests/test_api.py | 2 | """
Unit tests for instructor.api methods.
"""
# pylint: disable=E1111
import unittest
import json
import requests
from urllib import quote
from django.conf import settings
from django.test import TestCase
from nose.tools import raises
from mock import Mock, patch
from django.test.utils import override_settings
from dj... |
joelthompson/ansible-modules-core | refs/heads/devel | cloud/amazon/ec2_key.py | 51 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# 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.
#
... |
radomd92/botjagwar | refs/heads/master | test/test_dictionary.py | 1 | import json
import os
from subprocess import PIPE
from subprocess import Popen
from time import sleep
from unittest import TestCase
import requests
from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker
from api.decorator import threaded, retry_on_fail
from database.dictionary import Base, Defin... |
kohr-h/odl | refs/heads/master | examples/tomo/ray_trafo_parallel_3d_euler.py | 2 | """Example of using the ray transform in 3D parallel geometry with 2 angles.
The `Parallel3dEulerGeometry` is defined in terms of 2 or 3 Euler angles
and is not aligned to a rotation axis.
"""
import numpy as np
import odl
# Reconstruction space: discretized functions on the cube
# [-20, 20]^3 with 300 samples per ... |
mancoast/CPythonPyc_test | refs/heads/master | cpython/262_test_extcall.py | 55 | """Doctest for method/function calls.
We're going the use these types for extra testing
>>> from UserList import UserList
>>> from UserDict import UserDict
We're defining four helper functions
>>> def e(a,b):
... print a, b
>>> def f(*a, **k):
... print a, test_support.sortdict(k)
... |
staslev/beam | refs/heads/master | sdks/python/apache_beam/examples/complete/game/hourly_team_score_test.py | 18 | #
# 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... |
waytai/xhtml2pdf | refs/heads/master | xhtml2pdf/document.py | 50 | # -*- coding: utf-8 -*-
from xhtml2pdf.context import pisaContext
from xhtml2pdf.default import DEFAULT_CSS
from xhtml2pdf.parser import pisaParser
from reportlab.platypus.flowables import Spacer
from reportlab.platypus.frames import Frame
from xhtml2pdf.xhtml2pdf_reportlab import PmlBaseDoc, PmlPageTemplate
from xhtml... |
richard-willowit/odoo | refs/heads/master | addons/auth_signup/controllers/__init__.py | 738 | # -*- coding: utf-8 -*-
from . import main
|
singhj/locality-sensitive-hashing | refs/heads/master | nose/plugins/allmodules.py | 107 | """Use the AllModules plugin by passing ``--all-modules`` or setting the
NOSE_ALL_MODULES environment variable to enable collection and execution of
tests in all python modules. Normal nose behavior is to look for tests only in
modules that match testMatch.
More information: :doc:`../doc_tests/test_allmodules/test_all... |
ahmadio/edx-platform | refs/heads/master | common/djangoapps/student/migrations/0027_add_active_flag_and_mode_to_courseware_enrollment.py | 114 | # -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'CourseEnrollment.is_active'
db.add_column('student_courseenrollment', 'is_active',
... |
EricMuller/mywebmarks-backend | refs/heads/master | requirements/twisted/Twisted-17.1.0/build/lib.linux-x86_64-3.5/twisted/test/test_protocols.py | 13 | # Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Test cases for twisted.protocols package.
"""
from twisted.trial import unittest
from twisted.protocols import wire, portforward
from twisted.python.compat import iterbytes
from twisted.internet import reactor, defer, address, protocol
from t... |
ocefpaf/system-test | refs/heads/master | pelican-plugins/thumbnailer/test_thumbnails.py | 8 | from thumbnailer import _resizer
from unittest import TestCase, main
import os.path as path
from PIL import Image, ImageChops
class ThumbnailerTests(TestCase):
def path(self, filename):
return path.join(self.img_path, filename)
def setUp(self):
self.img_path = path.join(path.dirname(__file__)... |
uglyboxer/linear_neuron | refs/heads/master | net-p3/lib/python3.5/site-packages/pip/_vendor/distlib/locators.py | 223 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2012-2015 Vinay Sajip.
# Licensed to the Python Software Foundation under a contributor agreement.
# See LICENSE.txt and CONTRIBUTORS.txt.
#
import gzip
from io import BytesIO
import json
import logging
import os
import posixpath
import re
try:
import threading
except Impo... |
todaychi/hue | refs/heads/master | desktop/core/ext-py/South-1.0.2/south/db/sqlite3.py | 92 | from south.db import generic
class DatabaseOperations(generic.DatabaseOperations):
"""
SQLite3 implementation of database operations.
"""
backend_name = "sqlite3"
# SQLite ignores several constraints. I wish I could.
supports_foreign_keys = False
has_check_constrain... |
npe9/depot_tools | refs/heads/master | third_party/boto/__init__.py | 51 | # Copyright (c) 2006-2012 Mitch Garnaat http://garnaat.org/
# Copyright (c) 2010-2011, Eucalyptus Systems, Inc.
# Copyright (c) 2011, Nexenta Systems Inc.
# Copyright (c) 2012 Amazon.com, Inc. or its affiliates.
# Copyright (c) 2010, Google, Inc.
# All rights reserved.
#
# Permission is hereby granted, free of charge, ... |
adelina-t/nova | refs/heads/master | nova/tests/functional/v3/test_baremetal_nodes.py | 33 | # Copyright 2015 IBM Corp.
#
# 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 t... |
stochastic-technologies/impactstory-buildpack | refs/heads/master | vendor/distribute-0.6.36/setuptools/command/setopt.py | 167 | import distutils, os
from setuptools import Command
from distutils.util import convert_path
from distutils import log
from distutils.errors import *
__all__ = ['config_file', 'edit_config', 'option_base', 'setopt']
def config_file(kind="local"):
"""Get the filename of the distutils, local, global, or per-user co... |
fieldOfView/pyZOCP | refs/heads/master | examples/urwZOCP.py | 1 | #!/usr/bin/python3
# Z25 Orchestror Control Protocol
# Copyright (c) 2013, Stichting z25.org, All rights reserved.
# Copyright (c) 2013, Arnaud Loonstra, All rights reserved.
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as publ... |
EduPepperPDTesting/pepper2013-testing | refs/heads/www0 | lms/djangoapps/reportlab/graphics/samples/scatter.py | 1 | #Autogenerated by ReportLab guiedit do not edit
from reportlab.graphics.charts.legends import Legend
from reportlab.graphics.charts.lineplots import ScatterPlot
from reportlab.graphics.shapes import Drawing, _DrawingEditorMixin, String
from reportlab.graphics.charts.textlabels import Label
from reportlab.graphics.... |
agentxan/nzbToMedia | refs/heads/master | libs/xdg/IconTheme.py | 17 | """
Complete implementation of the XDG Icon Spec Version 0.8
http://standards.freedesktop.org/icon-theme-spec/
"""
import os, time
import re
from xdg.IniFile import IniFile, is_ascii
from xdg.BaseDirectory import xdg_data_dirs
from xdg.Exceptions import NoThemeError, debug
import xdg.Config
class IconTheme(IniFile)... |
mrtnrdl/.macdots | refs/heads/master | scripts/bin/platform-tools/systrace/catapult/common/py_utils/py_utils/__init__.py | 6 | #!/usr/bin/env python
# Copyright (c) 2016 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 functools
import inspect
import os
import sys
import time
def GetCatapultDir():
return os.path.normpath(
os.path.... |
stopspazzing/Pluton-Plugins | refs/heads/master | TimePlayed.py | 1 | __author__ = 'Corrosion X'
__name__ = 'TimePlayed'
__version__ = '0.2'
import clr
import sys
clr.AddReferenceByPartialName("Pluton", "UnityEngine")
import UnityEngine
import Pluton
from System import String
import datetime
class TimePlayed:
def On_PluginInit(self):
Commands.Register("timeonline")\
... |
mdworks2016/work_development | refs/heads/master | Python/20_Third_Certification/venv/lib/python3.7/site-packages/celery/signals.py | 1 | # -*- coding: utf-8 -*-
"""Celery Signals.
This module defines the signals (Observer pattern) sent by
both workers and clients.
Functions can be connected to these signals, and connected
functions are called whenever a signal is called.
.. seealso::
:ref:`signals` for more information.
"""
from __future__ impor... |
flv0/qutebrowser | refs/heads/master | tests/unit/utils/test_log.py | 2 | # vim: ft=python fileencoding=utf-8 sts=4 sw=4 et:
# Copyright 2014-2016 Florian Bruhin (The Compiler) <mail@qutebrowser.org>
#
# This file is part of qutebrowser.
#
# qutebrowser 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 S... |
mbayon/TFG-MachineLearning | refs/heads/master | vbig/lib/python2.7/site-packages/scipy/spatial/tests/test_spherical_voronoi.py | 21 | from __future__ import print_function
import numpy as np
import itertools
from numpy.testing import (assert_equal,
assert_almost_equal,
assert_array_equal,
assert_array_almost_equal)
from pytest import raises as assert_raises
from scipy.sp... |
jehiah/assetman | refs/heads/master | assetman/parsers/base.py | 2 | from __future__ import absolute_import, with_statement
from assetman.settings import Settings
from assetman.compilers import JSCompiler, LessCompiler, CSSCompiler, SassCompiler
# Map from template-side assetman manager calls to the corresponding
# compiler classes
compiler_classes = [JSCompiler, LessCompiler, CSSCompi... |
mgagne/nova | refs/heads/master | nova/api/openstack/compute/contrib/user_data.py | 100 | # Copyright 2012 OpenStack Foundation
#
# 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 ... |
p4datasystems/CarnotKE | refs/heads/master | jyhton/bugtests/test338.py | 13 | """
[ #480017 ] Proxy supers are loaded from syspath
Running test338j will throw a ClassCastException if a proxy's superclass is loaded
by the syspath classloader.
"""
import support
support.compileJava("test338cl.java", classpath=".")
support.compileJava("test338j1.java", classpath=".")
support.compileJava("test338j... |
chundi/uwsgi | refs/heads/master | examples/uwsgirouter3.py | 21 |
import uwsgi
current_node = 0
def application(e, s):
global current_node
nodes = uwsgi.cluster_nodes()
print nodes
if len(nodes) == 0:
print "no cluster node available"
raise StopIteration
if current_node >= len(nodes):
current_node = 0
node = nodes[current_node]... |
vane/pywinauto | refs/heads/master | pywinauto/unittests/test_findwindows.py | 19 | # GUI Application automation and testing library
# Copyright (C) 2006 Mark Mc Mahon
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public License
# as published by the Free Software Foundation; either version 2.1
# of the License, or (at you... |
hdinsight/hue | refs/heads/master | desktop/core/ext-py/tablib-0.10.0/tablib/packages/openpyxl3/reader/worksheet.py | 55 | # file openpyxl/reader/worksheet.py
# Copyright (c) 2010 openpyxl
#
# 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 limitation the rights
# to use, cop... |
Catch-up-TV-and-More/plugin.video.catchuptvandmore | refs/heads/master | resources/lib/channels/be/abbe.py | 1 | # -*- coding: utf-8 -*-
# Copyright: (c) 2017, SylvainCecchetto
# GNU General Public License v2.0+ (see LICENSE.txt or https://www.gnu.org/licenses/gpl-2.0.txt)
# This file is part of Catch-up TV & More
from __future__ import unicode_literals
import re
import json
import random
import urlquick
from hashlib import sha... |
mway08/grpc | refs/heads/master | src/python/src/grpc/_adapter/_intermediary_low.py | 2 | # Copyright 2015, 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... |
Aimage/shinken | refs/heads/master | test/test_dependencies.py | 18 | #!/usr/bin/env python
# Copyright (C) 2009-2014:
# Gabes Jean, naparuba@gmail.com
# Gerhard Lausser, Gerhard.Lausser@consol.de
#
# This file is part of Shinken.
#
# Shinken is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the F... |
algorhythms/HackerRankAlgorithms | refs/heads/master | Lego Blocks.py | 1 | # -*- coding: utf-8 -*-
"""
Problem Statement
You have 4 types of lego blocks, of sizes (1 x 1 x 1), (1 x 1 x 2), (1 x 1 x 3), and (1 x 1 x 4). Assume that you have
an infinite number of blocks of each type.
Using these blocks, you want to make a wall of height N and width M. The wall should not have any holes in it.... |
andela-ifageyinbo/django | refs/heads/master | tests/admin_autodiscover/tests.py | 526 | from unittest import TestCase
from django.contrib import admin
class AdminAutoDiscoverTests(TestCase):
"""
Test for bug #8245 - don't raise an AlreadyRegistered exception when using
autodiscover() and an admin.py module contains an error.
"""
def test_double_call_autodiscover(self):
# The... |
dpuyosa/android_kernel_wiko_l5460 | refs/heads/master | tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/Util.py | 12527 | # Util.py - Python extension for perf script, miscellaneous utility code
#
# Copyright (C) 2010 by Tom Zanussi <tzanussi@gmail.com>
#
# This software may be distributed under the terms of the GNU General
# Public License ("GPL") version 2 as published by the Free Software
# Foundation.
import errno, os
FUTEX_WAIT = 0... |
uvbs/Test1 | refs/heads/master | vendor/google-breakpad/src/tools/gyp/test/restat/src/create_intermediate.py | 349 | #!/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 os
import sys
"""
Create argv[1] iff it doesn't already exist.
"""
outfile = sys.argv[1]
if os.path.exists(outfile):
sys.exit()
o... |
unicri/edx-platform | refs/heads/master | lms/djangoapps/instructor/tests/test_legacy_xss.py | 46 | """
Tests of various instructor dashboard features that include lists of students
"""
from django.conf import settings
from django.test.client import RequestFactory
from markupsafe import escape
from nose.plugins.attrib import attr
from student.tests.factories import UserFactory, CourseEnrollmentFactory
from edxmako.... |
silly-wacky-3-town-toon/SOURCE-COD | refs/heads/master | Panda3D-1.10.0/python/Tools/Scripts/nm2def.py | 94 | #! /usr/bin/env python
"""nm2def.py
Helpers to extract symbols from Unix libs and auto-generate
Windows definition files from them. Depends on nm(1). Tested
on Linux and Solaris only (-p option to nm is for Solaris only).
By Marc-Andre Lemburg, Aug 1998.
Additional notes: the output of nm is supposed to look like th... |
jabbrwcky/selenium | refs/heads/master | py/selenium/common/__init__.py | 61 | # Licensed to the Software Freedom Conservancy (SFC) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The SFC licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... |
jasonleaster/MIT_6.034_2015 | refs/heads/master | lab1/production.py | 1 | import re
from utils import *
try:
set()
except NameError:
from sets import Set as set, ImmutableSet as frozenset
try:
sorted([])
except NameError:
def sorted(lst):
new_lst = list(lst)
new_lst.sort()
return new_lst
### We've tried to keep the functions you will need for
### ba... |
qenter/vlc-android | refs/heads/master | toolchains/arm/lib/python2.7/distutils/file_util.py | 171 | """distutils.file_util
Utility functions for operating on single files.
"""
__revision__ = "$Id$"
import os
from distutils.errors import DistutilsFileError
from distutils import log
# for generating verbose output in 'copy_file()'
_copy_action = {None: 'copying',
'hard': 'hard linking',
... |
FFlowerS/swiftp | refs/heads/master | cloud_server/httpd_doc_root/py/error_page.py | 23 | #def get():
# text = """
#
#"""
#return text |
carlospatinos/security | refs/heads/master | l2/atbash.py | 1 | """Encodes and decodes text using the atbash cipher"""
from re import sub
def decode(cipher_text):
"""Decodes atbash cipher text"""
clear_text = ''
for char in cipher_gen(cipher_text):
clear_text += char
return clear_text
def encode(clear_text):
"""Encodes atbash cipher text,
spaces ad... |
dfalt974/SickRage | refs/heads/master | lib/babelfish/script.py | 79 | # -*- coding: utf-8 -*-
#
# Copyright (c) 2013 the BabelFish authors. All rights reserved.
# Use of this source code is governed by the 3-clause BSD license
# that can be found in the LICENSE file.
#
from __future__ import unicode_literals
from collections import namedtuple
from pkg_resources import resource_stream # ... |
SaranyaKarthikeyan/boto | refs/heads/develop | boto/ecs/item.py | 153 | # Copyright (c) 2010 Chris Moyer http://coredumped.org/
#
# 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 limitation the rights to use, copy, modify, ... |
wscullin/spack | refs/heads/qmcpack | var/spack/repos/builtin/packages/r-xlsxjars/package.py | 3 | ##############################################################################
# Copyright (c) 2013-2017, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-64... |
JNPA/DPAcalc | refs/heads/OpenCL-GPU-version | dependencies/papi-5.3.0/papi-5.3.0/src/libpfm-3.y/python/src/session.py | 9 | #!/usr/bin/env python
#
# Copyright (c) 2008 Google, Inc.
# Contributed by Arun Sharma <arun.sharma@google.com>
#
# 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, includi... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.