repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
gmarek/test-infra | refs/heads/master | gubernator/github/models.py | 4 | # Copyright 2016 The Kubernetes Authors.
#
# 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 ... |
huiyiqun/check_mk | refs/heads/master | web/htdocs/gui_exceptions.py | 1 | #!/usr/bin/python
# -*- encoding: utf-8; py-indent-offset: 4 -*-
# +------------------------------------------------------------------+
# | ____ _ _ __ __ _ __ |
# | / ___| |__ ___ ___| | __ | \/ | |/ / |
# | | | | '_ \ / _ \/ __| |/ /... |
goofy57/google_python_class | refs/heads/master | copyspecial/solution/copyspecial.py | 206 | #!/usr/bin/python
# Copyright 2010 Google Inc.
# Licensed under the Apache License, Version 2.0
# http://www.apache.org/licenses/LICENSE-2.0
# Google's Python Class
# http://code.google.com/edu/languages/google-python-class/
import sys
import re
import os
import shutil
import commands
"""Copy Special exercise
"""
#... |
pnigos/gyp | refs/heads/master | 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 =... |
TheKnarf/apprtc | refs/heads/master | src/app_engine/apiauth.py | 25 | # Copyright 2015 Google Inc. All Rights Reserved.
"""Google API auth utilities."""
import json
import os
import sys
# Insert our third-party libraries first to avoid conflicts with appengine.
sys.path.insert(0, os.path.join(os.path.dirname(__file__), 'third_party'))
from apiclient import discovery
import httplib2
i... |
glatard/nipype | refs/heads/master | nipype/pipeline/plugins/tests/test_pbs.py | 16 | import os
from shutil import rmtree
from tempfile import mkdtemp
from time import sleep
import nipype.interfaces.base as nib
from nipype.testing import assert_equal, skipif
import nipype.pipeline.engine as pe
class InputSpec(nib.TraitedSpec):
input1 = nib.traits.Int(desc='a random int')
input2 = nib.traits.In... |
Mazecreator/tensorflow | refs/heads/master | tensorflow/contrib/session_bundle/session_bundle_test.py | 133 | # 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... |
Weihonghao/ECM | refs/heads/master | Vpy34/lib/python3.5/site-packages/tensorflow/contrib/learn/python/learn/estimators/estimator_test.py | 4 | # 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... |
hackerunion/root | refs/heads/master | home/server/portal.old/hackerunion.org-master/petri/common/lib/twiliotools.py | 1 | import re
from django.conf import settings
from django.utils import simplejson as json
from twilio import util
from twilio.rest import TwilioRestClient
from petri.common.utils.debug import debug
class TwilioException(Exception):
pass
def _get_client():
return TwilioRestClient(settings.TWILIO_SID, settings.TWI... |
joergdietrich/astropy | refs/heads/master | astropy/units/si.py | 4 | # -*- coding: utf-8 -*-
# Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
This package defines the SI units. They are also available in the
`astropy.units` namespace.
"""
from __future__ import (absolute_import, division, print_function,
unicode_literals)
from ..constants im... |
spiiph/owls-hep | refs/heads/master | owls_hep/region.py | 1 | """Provides models for regions
"""
# Future imports
from __future__ import print_function
# System imports
from copy import deepcopy
# owls-hep imports
from owls_hep.expression import multiplied
from owls_hep.variations import Variation
# Set up default exports
__all__ = [
'Region'
]
class Region(object):
... |
kostya-sh/FrameworkBenchmarks | refs/heads/master | toolset/benchmark/__init__.py | 90 | # Benchmark
|
qk4l/Flexget | refs/heads/develop | flexget/tests/test_series_premiere.py | 5 | from __future__ import unicode_literals, division, absolute_import
from builtins import * # noqa pylint: disable=unused-import, redefined-builtin
import pytest
from jinja2 import Template
@pytest.fixture(scope='class', params=['internal', 'guessit'], ids=['internal', 'guessit'])
def config(request):
"""Override... |
johnloucaides/chipsec | refs/heads/master | chipsec/xmlout.py | 1 | #!/usr/bin/python
#CHIPSEC: Platform Security Assessment Framework
#Copyright (c) 2010-2015, Intel Corporation
#
#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; Version 2.
#
#This program is distr... |
Pablo126/SSBW | refs/heads/master | Entrega1/lib/python3.5/site-packages/django/db/backends/oracle/compiler.py | 46 | from django.db.models.sql import compiler
class SQLCompiler(compiler.SQLCompiler):
def as_sql(self, with_limits=True, with_col_aliases=False):
"""
Creates the SQL for this query. Returns the SQL string and list
of parameters. This is overridden from the original Query class
to han... |
EthanBlackburn/sync-engine | refs/heads/master | migrations/versions/050_imap_table_cleanups.py | 1 | """imap table cleanups
Revision ID: 29217fad3f46
Revises: 161b88c17615
Create Date: 2014-07-01 18:56:55.962529
"""
# revision identifiers, used by Alembic.
revision = '29217fad3f46'
down_revision = '1b751e8d9cac'
from alembic import op
import sqlalchemy as sa
def upgrade():
from inbox.models.session import se... |
dbmi-pitt/DIKB-Micropublication | refs/heads/master | scripts/mp-scripts/Bio/stringfns.py | 1 | # Copyright 2000 by Jeffrey Chang. All rights reserved.
# This code is part of the Biopython distribution and governed by its
# license. Please see the LICENSE file that should have been included
# as part of this package.
"""This provides useful general functions for working with strings.
Functions:
splitany ... |
k0ste/ansible | refs/heads/devel | lib/ansible/plugins/action/reboot.py | 17 | # Copyright: (c) 2016-2018, Matt Davis <mdavis@ansible.com>
# Copyright: (c) 2018, Sam Doran <sdoran@redhat.com>
# 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
import random
import tim... |
lecaoquochung/ddnb.django | refs/heads/master | tests/version/tests.py | 352 | from unittest import TestCase
from django import get_version
from django.utils import six
class VersionTests(TestCase):
def test_development(self):
ver_tuple = (1, 4, 0, 'alpha', 0)
# This will return a different result when it's run within or outside
# of a git clone: 1.4.devYYYYMMDDHHM... |
jgowans/directionFinder_backend | refs/heads/master | tests/test_antenna.py | 1 | #!/usr/bin/env python
import unittest
import numpy as np
import sys
from directionFinder_backend import antenna
class AntennaTester(unittest.TestCase):
def setUp(self):
self.antenna = antenna.Antenna(12.34, 23.45) # x,y coordinates
def test_coordinates(self):
self.assertAlmostEqual(self.anten... |
canardleteer/objbomber | refs/heads/master | objbomber/objbomber.py | 1 | #! /usr/bin/env python
# -*- coding: utf-8 -*-
"""
This script doesn't actually do much that's useful.
It was designed to be an orchestration test between a few libraries,
now quite a few libraries.
"""
import os
import time
import sys
import getopt
import logging
import pickle
import random
import datetime
import uu... |
troygrosfield/Django-facebook | refs/heads/master | docs/docs_env/Lib/encodings/iso2022_jp_3.py | 816 | #
# iso2022_jp_3.py: Python Unicode Codec for ISO2022_JP_3
#
# Written by Hye-Shik Chang <perky@FreeBSD.org>
#
import _codecs_iso2022, codecs
import _multibytecodec as mbc
codec = _codecs_iso2022.getcodec('iso2022_jp_3')
class Codec(codecs.Codec):
encode = codec.encode
decode = codec.decode
class Incrementa... |
wagnerand/olympia | refs/heads/master | src/olympia/core/__init__.py | 10 | import threading
default_app_config = 'olympia.core.apps.CoreConfig'
_locals = threading.local()
_locals.user = None
_locals.remote_addr = None
def get_user():
return getattr(_locals, 'user', None)
def set_user(user):
_locals.user = user
def get_remote_addr():
return getattr(_locals, 'remote_addr'... |
shamoons/linguist-samples | refs/heads/master | samples/Python/django-models-base.py | 92 | from __future__ import unicode_literals
import copy
import sys
from functools import update_wrapper
from future_builtins import zip
import django.db.models.manager # Imported to register signal handler.
from django.conf import settings
from django.core.exceptions import (ObjectDoesNotExist,
MultipleObjectsRet... |
analurandis/Tur | refs/heads/master | backend/venv/Lib/site-packages/paste/script/default_sysconfig.py | 6 | # (c) 2005 Ian Bicking and contributors; written for Paste (http://pythonpaste.org)
# Licensed under the MIT license: http://www.opensource.org/licenses/mit-license.php
"""
This module contains default sysconfig settings.
The command object is inserted into this module as a global variable
``paste_command``, and can b... |
barraponto/python-steamtagger | refs/heads/master | src/steamtagger/__main__.py | 5 | import sys
import click
# Why does this file exist, and why __main__?
# For more info, read:
# - https://www.python.org/dev/peps/pep-0338/
# - https://docs.python.org/2/using/cmdline.html#cmdoption-m
# - https://docs.python.org/3/using/cmdline.html#cmdoption-m
@click.command()
@click.argument('names', nargs=-1)
def m... |
tensorflow/tensorboard | refs/heads/master | tensorboard/summary/v1.py | 1 | # 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... |
science09/xhtml2pdf | refs/heads/master | demo/cherrypy/demo-cherrypy.py | 154 | #!/usr/local/bin/python
# -*- coding: utf-8 -*-
#############################################
## (C)opyright by Dirk Holtwick, 2008 ##
## All rights reserved ##
#############################################
import cherrypy as cp
import sx.pisa3 as pisa
import cStringIO as StringIO
try:
im... |
pilliq/mongo-web-shell | refs/heads/master | webapps/trymongo/app.py | 2 | # Copyright 2013 10gen 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... |
mbrukman/flocker | refs/heads/master | flocker/acceptance/integration/testtools.py | 6 | # Copyright ClusterHQ Inc. See LICENSE file for details.
"""
Testing infrastructure for integration tests.
"""
from twisted.trial.unittest import TestCase
from ..testtools import require_cluster, create_dataset
from ...testtools import random_name
def make_dataset_integration_testcase(image_name, volume_path, int... |
eric-stanley/selenium | refs/heads/master | py/selenium/webdriver/opera/webdriver.py | 71 | # 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... |
mfnch/pyrtist | refs/heads/master | pyrtist/win_setup.py | 1 | # Copyright (C) 2017 Matteo Franchin
#
# This file is part of Pyrtist.
# Pyrtist 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 your option) any late... |
40223202/test | refs/heads/master | static/Brython3.1.3-20150514-095342/Lib/copy.py | 628 | """Generic (shallow and deep) copying operations.
Interface summary:
import copy
x = copy.copy(y) # make a shallow copy of y
x = copy.deepcopy(y) # make a deep copy of y
For module specific errors, copy.Error is raised.
The difference between shallow and deep copying is only relev... |
javachengwc/hue | refs/heads/master | desktop/core/ext-py/Django-1.6.10/tests/test_discovery_sample2/tests.py | 114 | from django.test import TestCase
class Test(TestCase):
def test_sample(self):
pass
|
AlexanderSavelyev/rdkit | refs/heads/master | rdkit/Chem/Pharm3D/ExcludedVolume.py | 4 | # $Id$
#
# Copyright (C) 2004-2006 Rational Discovery LLC
#
# @@ All Rights Reserved @@
# This file is part of the RDKit.
# The contents are covered by the terms of the BSD license
# which is included in the file license.txt, found at the root
# of the RDKit source tree.
#
class ExcludedVolume(object):
def __in... |
kaarl/pyload | refs/heads/stable | module/plugins/accounts/FastshareCz.py | 5 | # -*- coding: utf-8 -*-
import re
from module.plugins.internal.Account import Account
from module.plugins.internal.misc import set_cookie
class FastshareCz(Account):
__name__ = "FastshareCz"
__type__ = "account"
__version__ = "0.13"
__status__ = "testing"
__description__ = """Fastshare.c... |
davygeek/vitess | refs/heads/master | py/vtproto/tabletmanagerdata_pb2.py | 3 | # Generated by the protocol buffer compiler. DO NOT EDIT!
# source: tabletmanagerdata.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection... |
drano/django-mailer | refs/heads/master | mailer/engine.py | 3 | import time
import smtplib
import logging
from lockfile import FileLock, AlreadyLocked, LockTimeout
from socket import error as socket_error
from django.conf import settings
from django.core.mail import send_mail as core_send_mail
from django.db import transaction
try:
# Django 1.2
from django.core.mail impo... |
MalloyPower/parsing-python | refs/heads/master | front-end/testsuite-python-lib/Python-2.4/Lib/multifile.py | 103 | """A readline()-style interface to the parts of a multipart message.
The MultiFile class makes each part of a multipart message "feel" like
an ordinary file, as long as you use fp.readline(). Allows recursive
use, for nested multipart messages. Probably best used together
with module mimetools.
Suggested use:
real... |
UrQA/URQA-Server | refs/heads/master | soma3/soma3/settings_dev.py | 1 | from settings import *
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'.
'NAME': urqaDbConfig.get_config('DB_NAME'), # Or path to database file if using sqlite3.
# The following settings are not used w... |
hpcuantwerpen/easybuild-easyblocks | refs/heads/develop | easybuild/easyblocks/s/scalapack.py | 2 | ##
# Copyright 2009-2021 Ghent University
#
# This file is part of EasyBuild,
# originally created by the HPC team of Ghent University (http://ugent.be/hpc/en),
# with support of Ghent University (http://ugent.be/hpc),
# the Flemish Supercomputer Centre (VSC) (https://www.vscentrum.be),
# Flemish Research Foundation (F... |
gradel/mezzanine | refs/heads/master | mezzanine/forms/translation.py | 49 | from modeltranslation.translator import translator, TranslationOptions
from mezzanine.core.translation import TranslatedRichText
from mezzanine.forms.models import Form, Field
class TranslatedForm(TranslatedRichText):
fields = ('button_text', 'response', 'email_subject', 'email_message',)
class TranslatedField(... |
vshtanko/scikit-learn | refs/heads/master | sklearn/cluster/tests/test_bicluster.py | 226 | """Testing for Spectral Biclustering methods"""
import numpy as np
from scipy.sparse import csr_matrix, issparse
from sklearn.grid_search import ParameterGrid
from sklearn.utils.testing import assert_equal
from sklearn.utils.testing import assert_almost_equal
from sklearn.utils.testing import assert_array_equal
from... |
Balburdia/adventofcode | refs/heads/master | day04/puzzle1.py | 1 | #! /usr/bin/python3
from itertools import count
from hashlib import md5
password = 'ckczppom'
for i in count(1):
h = md5((password + str(i)).encode()).hexdigest()
if h[:5] == '00000':
print("MD5: {}".format(h))
print("Number: {}".format(i))
break
|
Azure/azure-sdk-for-python | refs/heads/sync-eng/common-js-nightly-docs-2-1768-ForTestPipeline | sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_generated/v2016_10_01/__init__.py | 17 | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... |
RayMick/scikit-learn | refs/heads/master | examples/linear_model/plot_lasso_model_selection.py | 311 | """
===================================================
Lasso model selection: Cross-Validation / AIC / BIC
===================================================
Use the Akaike information criterion (AIC), the Bayes Information
criterion (BIC) and cross-validation to select an optimal value
of the regularization paramet... |
loop1024/pymo-global | refs/heads/master | android/pgs4a-0.9.6/python-install/lib/python2.7/test/test_doctest2.py | 137 | # -*- coding: utf-8 -*-
u"""A module to test whether doctest recognizes some 2.2 features,
like static and class methods.
>>> print 'yup' # 1
yup
We include some (random) encoded (utf-8) text in the text surrounding
the example. It should be ignored:
ЉЊЈЁЂ
"""
import sys
import unittest
from test import test_sup... |
popazerty/SDG-e2 | refs/heads/master | lib/python/Tools/GetEcmInfo.py | 11 | import os
import time
ECM_INFO = '/tmp/ecm.info'
EMPTY_ECM_INFO = '','0','0','0'
old_ecm_time = time.time()
info = {}
ecm = ''
data = EMPTY_ECM_INFO
class GetEcmInfo:
def pollEcmData(self):
global data
global old_ecm_time
global info
global ecm
try:
ecm_time = os.stat(ECM_INFO).st_mtime
except:
ec... |
badcure/sugarcoat | refs/heads/master | sugarcoat/api/__init__.py | 2 | import flask
from sugarcoat.api.base import app
import sugarcoat.api.template_filters
import sugarcoat.rackspacecloud.blueprint.base
import sugarcoat.openweathermap.blueprint.base
import sugarcoat.sunlightfoundation.blueprint.base
app.register_blueprint(sugarcoat.rackspacecloud.blueprint.base.app)
app.register_bluepri... |
Reflexe/doc_to_pdf | refs/heads/master | Windows/program/python-core-3.5.0/lib/unittest/test/test_case.py | 2 | import contextlib
import difflib
import pprint
import pickle
import re
import sys
import logging
import warnings
import weakref
import inspect
from copy import deepcopy
from test import support
import unittest
from unittest.test.support import (
TestEquality, TestHashing, LoggingResult, LegacyLoggingResult,
... |
syci/OCB | refs/heads/9.0 | addons/procurement/__openerp__.py | 27 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
{
'name' : 'Procurements',
'version' : '1.0',
'website': 'https://www.odoo.com/page/manufacturing',
'category' : 'Hidden/Dependency',
'depends' : ['base', 'product'],
'description': """
This is t... |
Bysmyyr/chromium-crosswalk | refs/heads/master | tools/telemetry/third_party/gsutilz/third_party/boto/tests/integration/beanstalk/test_wrapper.py | 114 | import random
import time
from functools import partial
from tests.compat import unittest
from boto.beanstalk.wrapper import Layer1Wrapper
import boto.beanstalk.response as response
class BasicSuite(unittest.TestCase):
def setUp(self):
self.random_id = str(random.randint(1, 1000000))
self.app_nam... |
calfonso/ansible | refs/heads/devel | test/units/modules/network/f5/test_bigip_virtual_address.py | 7 | # -*- coding: utf-8 -*-
#
# Copyright (c) 2017 F5 Networks 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
import os
import json
import sys
from nose.plugins.skip import SkipTest
i... |
rafaelolg/salienpy | refs/heads/master | view_saliency.py | 1 | #!/usr/bin/env python
import cv2
import numpy
import sys
from time import time
import salienpy.frequency_tuned
import salienpy.signature
import salienpy.dictionary_frequency
from salienpy.commons import minmaxnormalization
def main(img):
saliency_methods = [ ('dictionary_ica_saliency', salienpy.dictionary_freque... |
wujuguang/scrapy | refs/heads/master | tests/test_utils_serialize.py | 28 | import json
import unittest
import datetime
from decimal import Decimal
from twisted.internet import defer
from scrapy.utils.serialize import ScrapyJSONEncoder
from scrapy.http import Request, Response
class JsonEncoderTestCase(unittest.TestCase):
def setUp(self):
self.encoder = ScrapyJSONEncoder()
... |
KaiRo-at/socorro | refs/heads/master | socorro/unittest/external/postgresql/test_crash_data.py | 2 | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from nose.tools import eq_, ok_, assert_raises
from configman import ConfigurationManager, Namespace
from mock import Mo... |
sankhesh/VTK | refs/heads/master | ThirdParty/Twisted/twisted/conch/insults/__init__.py | 138 | """
Insults: a replacement for Curses/S-Lang.
Very basic at the moment."""
from twisted.python import deprecate, versions
deprecate.deprecatedModuleAttribute(
versions.Version("Twisted", 10, 1, 0),
"Please use twisted.conch.insults.helper instead.",
__name__, "colors")
deprecate.deprecatedModuleAttribut... |
arbrandes/edx-platform | refs/heads/master | openedx/core/lib/tests/test_grade_utils.py | 5 | """
Tests for graph traversal generator functions.
"""
from unittest import TestCase
import ddt
import pytest
from ..grade_utils import compare_scores, round_away_from_zero
@ddt.ddt
class TestGradeUtils(TestCase):
""" Tests for the grade_utils module. """
@ddt.data(
(1, 2, 3, 4, False, True, 0.5, 0... |
enomado/beaker | refs/heads/master | tests/test_namespacing.py | 3 | import os
import sys
def teardown():
import shutil
shutil.rmtree('./cache', True)
def test_consistent_namespacing():
sys.path.append(os.path.dirname(__file__))
from tests.test_namespacing_files.namespace_go import go
go()
|
avilaton/transitfeed | refs/heads/master | extensions/__init__.py | 8 | #!/usr/bin/python2.5
# Copyright (C) 2011 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 la... |
odoomrp/server-tools | refs/heads/8.0 | auth_dynamic_groups/model/res_groups.py | 23 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# This module copyright (C) 2013 Therp BV (<http://therp.nl>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of ... |
weblyzard/ewrt | refs/heads/develop | tests/access/test_db.py | 1 | # #!/usr/bin/python
# # -*- coding: utf-8 -*-
# import unittest
#
# from nose.plugins.attrib import attr
#
# from eWRT.access.db import PostgresqlDb
#
#
# class TestDB(unittest.TestCase):
# """ @class TestDB
# db test cases
# """
# @attr("db")
# def test_context_protocol(self):
# ""... |
gnieboer/gnuradio | refs/heads/android | gr-filter/python/filter/__init__.py | 47 | #
# Copyright 2012 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# GNU Radio 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, or (at your option)
# any later version.
#
#... |
openpli-arm/enigma2-arm | refs/heads/master | tools/host_tools/FormatConverter/main.py | 44 | #!/usr/bin/python
from datasource import genericdatasource
from satxml import satxml
from lamedb import lamedb
from input import *
import sys
import os
maindata = genericdatasource()
sources = [satxml, lamedb]
datasources = [maindata]
for source in sources:
datasources.append(source())
for source in datasources:... |
rleigh-dundee/openmicroscopy | refs/heads/develop | components/tools/OmeroPy/test/scriptstest/coverage.py | 4 | #!/usr/bin/env python
"""
Integration test demonstrating various script creation methods
Copyright 2010 Glencoe Software, Inc. All rights reserved.
Use is subject to license terms supplied in LICENSE.txt
"""
import integration.library as lib
import unittest, os, sys
import omero
import omero.rtypes as OR
... |
Innovahn/odoo.old | refs/heads/master | addons/marketing_crm/__openerp__.py | 313 | # -*- coding: utf-8 -*-
{
'name': 'Marketing in CRM',
'version': '1.0',
'depends': ['marketing', 'crm'],
'author': 'OpenERP SA',
'category': 'Hidden/Dependency',
'description': """
Bridge module between marketing and CRM
""",
'website': 'https://www.odoo.com/page/crm',
'data': [
... |
xindus40223115/2015cda_g1 | refs/heads/master | static/Brython3.1.3-20150514-095342/Lib/xml/dom/minidom.py | 727 | """Simple implementation of the Level 1 DOM.
Namespaces and other minor Level 2 features are also supported.
parse("foo.xml")
parseString("<foo><bar/></foo>")
Todo:
=====
* convenience methods for getting elements and text.
* more testing
* bring some of the writer and linearizer code into conformance with this
... |
codepython/restcommander | refs/heads/master | play-1.2.4/python/Lib/site-packages/readline.py | 4 | # -*- coding: UTF-8 -*-
#this file is needed in site-packages to emulate readline
#necessary for rlcompleter since it relies on the existance
#of a readline module
from pyreadline import *
|
Hazelsuko07/17WarmingUp | refs/heads/hy_try | py3.6/lib/python3.6/site-packages/pip/_vendor/requests/packages/urllib3/util/url.py | 713 | from __future__ import absolute_import
from collections import namedtuple
from ..exceptions import LocationParseError
url_attrs = ['scheme', 'auth', 'host', 'port', 'path', 'query', 'fragment']
class Url(namedtuple('Url', url_attrs)):
"""
Datastructure for representing an HTTP URL. Used as a return value f... |
coders-circle/Notifica | refs/heads/master | web/routine/admin.py | 1 | from django.contrib import admin
from routine.models import *
class PeriodInline(admin.StackedInline):
model = Period
extra = 5
class RoutineAdmin(admin.ModelAdmin):
inlines = [PeriodInline]
admin.site.register(Routine, RoutineAdmin)
admin.site.register(Period)
|
catapult-project/catapult | refs/heads/master | third_party/google-endpoints/httplib2/socks.py | 811 | """SocksiPy - Python SOCKS module.
Version 1.00
Copyright 2006 Dan-Haim. All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
... |
leansoft/edx-platform | refs/heads/master | common/djangoapps/course_modes/migrations/0001_initial.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 model 'CourseMode'
db.create_table('course_modes_coursemode', (
('id', self.gf('django.... |
etherkit/OpenBeacon2 | refs/heads/master | client/linux-arm/venv/lib/python3.6/site-packages/PyInstaller/hooks/hook-sqlalchemy.py | 4 | #-----------------------------------------------------------------------------
# Copyright (c) 2005-2020, PyInstaller Development Team.
#
# Distributed under the terms of the GNU General Public License (version 2
# or later) with exception for distributing the bootloader.
#
# The full license is in the file COPYING.txt... |
great-expectations/great_expectations | refs/heads/develop | great_expectations/render/page_renderer_util.py | 1 | import warnings
from great_expectations.render.renderer import ValidationResultsPageRenderer
from great_expectations.render.view import DefaultMarkdownPageView
from great_expectations.validation_operators.types.validation_operator_result import (
ValidationOperatorResult,
)
def render_multiple_validation_result_... |
sruizr/pysync_redmine | refs/heads/master | pysync_redmine/repositories/ganttproject.py | 1 | import datetime
import xml.etree.ElementTree as ET
from pysync_redmine.domain import (Repository,
Project,
Member,
Task,
Phase,
Calendar,
... |
goliate/sarakha63-persomov | refs/heads/master | libs/pyutil/scripts/passphrase.py | 92 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import argparse, math, random
from pyutil.mathutil import div_ceil
from pkg_resources import resource_stream
def recursive_subset_sum(entropy_needed, wordlists):
# Pick a minimalish set of numbers which sum to at least
# entropy_needed.
# Okay now what's th... |
GaelMagnan/PyGitHook | refs/heads/master | src/Tasks/CheckMergeErrorTask.py | 1 | """
Hook task to check if a merge error has been made.
Uses regex to check for existance of standard merge separator.
Inherite of this class and modify the regex attribute for custom merge separator.
AUTHOR:
Gael Magnan de bornier
"""
import re
from src.Tasks.HookTask import HookNewOrModifiedFileTask
class Chec... |
moble/sympy | refs/heads/master | sympy/physics/quantum/identitysearch.py | 58 | from __future__ import print_function, division
from collections import deque
from random import randint
from sympy.core.compatibility import range
from sympy.external import import_module
from sympy import Mul, Basic, Number, Pow, Integer
from sympy.physics.quantum.represent import represent
from sympy.physics.quant... |
Droid-Concepts/DC-Elite_kernel_jf | refs/heads/dc43 | 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... |
idrogeno/enigma2 | refs/heads/master | lib/python/Screens/FactoryReset.py | 51 | from Screens.MessageBox import MessageBox
from boxbranding import getMachineBrand, getMachineName
class FactoryReset(MessageBox):
def __init__(self, session):
MessageBox.__init__(self, session, _("When you do a factory reset, you will lose ALL your configuration data\n"
"(including bouquets, services, satellite ... |
crackerhead/nemio | refs/heads/master | lib/python2.7/site-packages/setuptools/command/install_scripts.py | 285 | from distutils.command.install_scripts import install_scripts \
as _install_scripts
from pkg_resources import Distribution, PathMetadata, ensure_directory
import os
from distutils import log
class install_scripts(_install_scripts):
"""Do normal script install, plus any egg_info wrapper scripts"""
def ini... |
youdonghai/intellij-community | refs/heads/master | python/lib/Lib/site-packages/django/template/response.py | 71 | from django.http import HttpResponse
from django.template import loader, Context, RequestContext
class ContentNotRenderedError(Exception):
pass
class SimpleTemplateResponse(HttpResponse):
def __init__(self, template, context=None, mimetype=None, status=None,
content_type=None):
# It would... |
NhuanTDBK/Kaggle_StackedOverflow | refs/heads/master | is13/utils/tools.py | 3 | import random
def shuffle(lol, seed):
'''
lol :: list of list as input
seed :: seed the shuffling
shuffle inplace each list in the same order
'''
for l in lol:
random.seed(seed)
random.shuffle(l)
def minibatch(l, bs):
'''
l :: list of word idxs
return a list of min... |
jaafarbarek/pyrtos | refs/heads/master | micropython-1.5/tests/bench/arrayop-1-list_inplace.py | 101 | # Array operation
# Type: list, inplace operation using for. What's good about this
# method is that it doesn't require any extra memory allocation.
import bench
def test(num):
for i in iter(range(num//10000)):
arr = [0] * 1000
for i in range(len(arr)):
arr[i] += 1
bench.run(test)
|
SMTorg/smt | refs/heads/master | smt/utils/test/test_kriging_utils.py | 2 | import unittest
import numpy as np
from smt.utils.sm_test_case import SMTestCase
from smt.utils.kriging_utils import standardization
from smt.sampling_methods import LHS
class Test(SMTestCase):
def test_standardization(self):
d, n = (10, 100)
sx = LHS(
xlimits=np.repeat(np.atleast_2d(... |
pgexperts/patroni | refs/heads/master | patroni/__init__.py | 2 | import logging
import os
import sys
import time
import yaml
from patroni.api import RestApiServer
from patroni.etcd import Etcd
from patroni.ha import Ha
from patroni.postgresql import Postgresql
from patroni.utils import setup_signal_handlers, reap_children
from patroni.zookeeper import ZooKeeper
logger = logging.ge... |
erikdejonge/youtube-dl | refs/heads/master | youtube_dl/extractor/newgrounds.py | 28 | from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import (
extract_attributes,
int_or_none,
parse_duration,
parse_filesize,
unified_timestamp,
)
class NewgroundsIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?newgrounds\.com/(?:audio/listen... |
vrsys/avangong | refs/heads/master | avango-connect/python/avango/connect/_SFVec4.py | 6 | # -*- Mode:Python -*-
##########################################################################
# #
# This file is part of AVANGO. #
# ... |
sorenk/ansible | refs/heads/devel | lib/ansible/modules/cloud/cloudstack/cs_network.py | 20 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2017, René Moser <mail@renemoser.net>
# 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': ['stableinterface'],
'supporte... |
fbidu/namebench | refs/heads/master | nb_third_party/jinja2/utils.py | 189 | # -*- coding: utf-8 -*-
"""
jinja2.utils
~~~~~~~~~~~~
Utility functions.
:copyright: (c) 2010 by the Jinja Team.
:license: BSD, see LICENSE for more details.
"""
import re
import sys
import errno
try:
from thread import allocate_lock
except ImportError:
from dummy_thread import allocate_lo... |
Antsypc/shadowsocks | refs/heads/master | shadowsocks/encrypt.py | 990 | #!/usr/bin/env python
#
# Copyright 2012-2015 clowwindy
#
# 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 la... |
tanmaykm/edx-platform | refs/heads/master | lms/djangoapps/certificates/urls.py | 30 | """
URLs for the certificates app.
"""
from django.conf.urls import patterns, url
from django.conf import settings
from certificates import views
urlpatterns = patterns(
'',
# Certificates HTML view end point to render web certs by user and course
url(
r'^user/(?P<user_id>[^/]*)/course/{course_i... |
vaidap/zulip | refs/heads/master | analytics/models.py | 9 | from django.db import models
from zerver.models import Realm, UserProfile, Stream, Recipient
from zerver.lib.str_utils import ModelReprMixin
from zerver.lib.timestamp import floor_to_day
import datetime
from typing import Optional, Tuple, Union, Dict, Any, Text
class FillState(ModelReprMixin, models.Model):
pro... |
ajs124/esp-idf | refs/heads/master | components/idf_test/integration_test/TestCaseScript/TCPStress/TCPSendRecv.py | 15 | from TCAction import TCActionBase
from NativeLog import NativeLog
import time
import random
import string
TEST_COUNT_ONE_ROUND = 1000
class TestCase(TCActionBase.CommonTCActionBase):
def __init__(self, test_case, test_env, timeout=30, log_path=TCActionBase.LOG_PATH):
TCActionBase.CommonTCActionBase.__in... |
boyuegame/kbengine | refs/heads/master | kbe/res/scripts/common/Lib/pickletools.py | 74 | '''"Executable documentation" for the pickle module.
Extensive comments about the pickle protocols and pickle-machine opcodes
can be found here. Some functions meant for external use:
genops(pickle)
Generate all the opcodes in a pickle, as (opcode, arg, position) triples.
dis(pickle, out=None, memo=None, indentl... |
jessemillar/pythonista | refs/heads/master | Desktop/vssh.py | 1 | """Find the IP address of a VirtualBox virtual machine and ssh into it.\
Add or update /etc/hosts entries upon user interaction."""
import os
import subprocess
import sys
def check_exists(name):
"""Check if the virtual machine exists."""
virtualbox_exists = subprocess.Popen(["VBoxManage", "list", "vms"], ... |
BeATz-UnKNoWN/python-for-android | refs/heads/master | python3-alpha/python3-src/Lib/test/test_keywordonlyarg.py | 49 | #!/usr/bin/env python3
"""Unit tests for the keyword only argument specified in PEP 3102."""
__author__ = "Jiwon Seo"
__email__ = "seojiwon at gmail dot com"
import unittest
from test.support import run_unittest
def posonly_sum(pos_arg1, *arg, **kwarg):
return pos_arg1 + sum(arg) + sum(kwarg.values())
def keywo... |
ewbankkit/cloud-custodian | refs/heads/master | tools/sandbox/c7n_sphere11/c7n_sphere11/admin.py | 6 | # Copyright 2017 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... |
ychen820/microblog | refs/heads/master | flask/lib/python2.7/site-packages/pip/_vendor/requests/packages/chardet/compat.py | 2942 | ######################## BEGIN LICENSE BLOCK ########################
# Contributor(s):
# Ian Cordasco - port to Python
#
# 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
# versio... |
chetan51/nupic | refs/heads/master | nupic/frameworks/opf/opfhelpers.py | 15 | # ----------------------------------------------------------------------
# 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... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.