repo_name
stringlengths
5
100
path
stringlengths
4
375
copies
stringclasses
991 values
size
stringlengths
4
7
content
stringlengths
666
1M
license
stringclasses
15 values
LandRegistry/register-metadata
application/models.py
1
1217
from sqlalchemy import Column, String, Integer from application import db class cre(db.Model): __tablename__ = 'cre' code = Column(String, primary_key=True) version = Column(Integer, primary_key=True) template = Column(String) infills = Column(String) restriction_name = Column(String) su...
mit
dropbox/bazel
third_party/py/abseil/absl/flags/__init__.py
15
5381
# Copyright 2017 The Abseil 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 in ...
apache-2.0
brettlangdon/dd-agent
checks/libs/vmware/all_metrics.py
34
62550
CPU_METRICS = { # CPU Capacity Contention # Compatibility: 3.5.0 / 4.0.0 / 4.1.0 / 5.0.0 'cpu.capacity.contention': { 's_type': 'rate', 'unit': 'percent', 'rollup': 'average', 'entity': ['ResourcePool'] }, # CPU Capacity Demand # Compatibility: 3.5.0 / 4.0.0 / 4.1...
bsd-3-clause
apdavison/python-neo
neo/test/iotest/test_neuroexplorerio.py
3
1522
""" Tests of neo.io.neuroexplorerio """ import unittest from neo.io import NeuroExplorerIO from neo.test.iotest.common_io_test import BaseTestIO from neo.test.iotest.tools import get_test_file_full_path class TestNeuroExplorerIO(BaseTestIO, unittest.TestCase, ): ioclass = NeuroExplorerIO _prefered_signal_g...
bsd-3-clause
devrajpatel/tutorial-for-PIE-in-ns-3-
doc/tutorial/source/conf.py
14
7055
# -*- coding: utf-8 -*- # # ns-3 documentation build configuration file, created by # sphinx-quickstart on Tue Dec 14 09:00:39 2010. # # This file is execfile()d with the current directory set to its containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # # All co...
gpl-2.0
TsinghuaX/edx-platform
cms/envs/devstack.py
1
2112
""" Specific overrides to the base prod settings to make development easier. """ from .aws import * # pylint: disable=wildcard-import, unused-wildcard-import DEBUG = True USE_I18N = True TEMPLATE_DEBUG = DEBUG ################################ LOGGERS ###################################### import logging # Disable ...
agpl-3.0
dmlc/mxnet
python/mxnet/io/io.py
4
34603
# 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 u...
apache-2.0
vallsv/pyqtgraph
examples/multiprocess.py
28
1531
# -*- coding: utf-8 -*- import initExample ## Add path to library (just for examples; you do not need this) import numpy as np import pyqtgraph.multiprocess as mp import pyqtgraph as pg import time print("\n=================\nStart Process") proc = mp.Process() import os print("parent:", os.getpid(), "child:", proc...
mit
rcharp/toyota-flask
numpy/numpy/core/numerictypes.py
37
29192
""" numerictypes: Define the numeric type objects This module is designed so "from numerictypes import \\*" is safe. Exported symbols include: Dictionary with all registered number types (including aliases): typeDict Type objects (not all will be available, depends on platform): see variable sctypes fo...
apache-2.0
CristianBB/SickRage
sickbeard/metadata/generic.py
1
39987
# coding=utf-8 # Author: Nic Wolfe <nic@wolfeden.ca> # URL: http://code.google.com/p/sickbeard/ # # This file is part of SickRage. # # SickRage 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...
gpl-3.0
munnerz/CouchPotatoServer
libs/oauth2/clients/imap.py
885
1685
""" The MIT License Copyright (c) 2007-2010 Leah Culver, Joe Stump, Mark Paschal, Vic Fryzel 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 ...
gpl-3.0
Remper/sociallink
align-train/pairwise_models/smt.py
1
4739
import tensorflow as tf from pairwise_models.model import Model from tensorflow.contrib import slim from pairwise_models.simple import SimpleModel class SMTModel(SimpleModel): """ Simple model that doesn't require fancy features from KB side, but explicitly merges textual features Designed to wo...
apache-2.0
dkubiak789/OpenUpgrade
addons/point_of_sale/report/pos_details.py
99
9296
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU...
agpl-3.0
drewx2/caf-kernel
tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/Util.py
12527
1935
# 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...
gpl-2.0
tomgade09/geoplasmasim
python/utils/loadDistributions.py
1
2207
import ctypes from utilsAPI import * MASS_ELEC = 9.10938356e-31 name_orig = ctypes.create_string_buffer(bytes('orig dist', encoding='utf-8')) name_comp = ctypes.create_string_buffer(bytes('comp dist', encoding='utf-8')) fold_orig = ctypes.create_string_buffer(bytes('./../../_in/data/Limited Mag Source', encoding='utf...
gpl-3.0
aisipos/django
django/contrib/gis/geos/prototypes/prepared.py
178
1184
from ctypes import c_char from django.contrib.gis.geos.libgeos import ( GEOM_PTR, PREPGEOM_PTR, GEOSFuncFactory, ) from django.contrib.gis.geos.prototypes.errcheck import check_predicate # Prepared geometry constructor and destructors. geos_prepare = GEOSFuncFactory('GEOSPrepare', argtypes=[GEOM_PTR], restype=PRE...
bsd-3-clause
CactusTribe/PyRobot
src/server/PyRobot_Serveur.py
1
4662
import socket, sys, subprocess, time, threading, re, io, copy import RPi.GPIO as GPIO import Adafruit_DHT as dht import traceback from devices.Devices import * import SharedParams from modules.MainModule import MainModule from modules.EventModule import EventModule from modules.SensorsModule import SensorsModule from...
gpl-3.0
yangdw/repo.python
src/annotation/haven/haven/mixins.py
2
4101
# -*- coding: utf-8 -*- import functools from events import Events from .utils import safe_func class RoutesMixin(object): """ 专门做路由管理 """ rule_map = None def __init__(self): self.rule_map = dict() def add_route_rule(self, cmd, view_func, **options): if cmd in self.rule_ma...
mit
dbremner/bite-project
deps/gdata-python-client/src/gdata/core.py
103
8239
#!/usr/bin/env python # # Copyright (C) 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...
apache-2.0
shssoichiro/servo
tests/wpt/harness/wptrunner/wptmanifest/tests/test_serializer.py
59
4791
# 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/. import sys import unittest from cStringIO import StringIO import pytest from .. import parser, serializer class Tok...
mpl-2.0
graphite/TeX4Web-INVENIO
modules/webstat/lib/webstat_regression_tests.py
18
2085
# -*- coding: utf-8 -*- ## ## This file is part of Invenio. ## Copyright (C) 2009, 2010, 2011 CERN. ## ## Invenio 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 yo...
gpl-2.0
nitin-cherian/LifeLongLearning
Python/PythonProgrammingLanguage/Encapsulation/encap_env/lib/python3.5/site-packages/ipykernel/inprocess/blocking.py
12
3045
""" Implements a fully blocking kernel client. Useful for test suites and blocking terminal interfaces. """ #----------------------------------------------------------------------------- # Copyright (C) 2012 The IPython Development Team # # Distributed under the terms of the BSD License. The full license is in # ...
mit
WriterOfAlicrow/servo
tests/wpt/web-platform-tests/tools/pywebsocket/src/example/abort_handshake_wsh.py
465
1781
# 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...
mpl-2.0
dudonwai/dudonsblog
Lib/warnings.py
42
14185
"""Python part of the warnings subsystem.""" # Note: function level imports should *not* be used # in this module as it may cause import lock deadlock. # See bug 683658. import linecache import sys import types __all__ = ["warn", "warn_explicit", "showwarning", "formatwarning", "filterwarnings", "simplefil...
mit
ferabra/edx-platform
common/lib/xmodule/xmodule/tests/test_export.py
29
13560
""" Tests of XML export """ import ddt import lxml.etree import mock import os import pytz import shutil import tarfile import unittest import uuid from datetime import datetime, timedelta, tzinfo from fs.osfs import OSFS from path import Path as path from tempfile import mkdtemp from textwrap import dedent from xbl...
agpl-3.0
capturePointer/or-tools
examples/python/kakuro.py
34
5175
# Copyright 2010 Hakan Kjellerstrand hakank@bonetmail.com # # 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 ...
apache-2.0
bearstech/ansible
lib/ansible/modules/identity/ipa/ipa_sudocmd.py
7
5792
#!/usr/bin/python # -*- coding: utf-8 -*- # 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__ = type ANSIBLE_METADATA = {'metadata_version': '1.0', ...
gpl-3.0
apanju/GMIO_Odoo
addons/mail/mail_followers.py
168
12482
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2009-today OpenERP SA (<http://www.openerp.com>) # # This program is free software: you can redistribute it and/or modify # it under the terms o...
agpl-3.0
Jorge-Rodriguez/ansible
lib/ansible/modules/storage/purestorage/purefa_pgsnap.py
14
7775
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2017, Simon Dodsley (simon@purestorage.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 ANSIBLE_METADATA = {'metadata_version': '1.1',...
gpl-3.0
chaoskey/micolog-modify
blog.py
1
22390
# -*- coding: utf-8 -*- import cgi, os,sys,math import wsgiref.handlers import google.appengine.api # Google App Engine imports. from google.appengine.ext.webapp import util from google.appengine.ext.webapp import template, \ WSGIApplication from google.appengine.api import users ##import app.webapp as web...
mit
drufat/vispy
vispy/app/backends/_pyqt5.py
21
1582
# -*- coding: utf-8 -*- # Copyright (c) 2015, Vispy Development Team. # Distributed under the (new) BSD License. See LICENSE.txt for more info. """ PyQt5 proxy backend for the qt backend. """ import sys from .. import backends from ...util import logger from ... import config USE_EGL = config['gl_backend'].lower()....
bsd-3-clause
cloudfoundry/php-buildpack-legacy
builds/runtimes/python-2.7.6/lib/python2.7/encodings/uu_codec.py
383
3738
""" Python 'uu_codec' Codec - UU content transfer encoding Unlike most of the other codecs which target Unicode, this codec will return Python string objects for both encode and decode. Written by Marc-Andre Lemburg (mal@lemburg.com). Some details were adapted from uu.py which was written by Lance Ell...
mit
anisyonk/pilot
SysLog.py
4
1197
import syslog from commands import getoutput from pUtil import tolog def sysLog(message): """ Write message to syslog """ status = False try: if message != "": syslog.syslog(syslog.LOG_ERR, message) else: tolog("!!WARNING!!4444!! Will not write empty message to sys...
apache-2.0
briney/env-analysis
region_align/region_align.py
2
6768
#!/usr/bin/python # filename: region_align.py import time import argparse from Bio import SeqIO from Bio import AlignIO from Bio import pairwise2 from Bio.SubsMat import MatrixInfo as matlist from operator import itemgetter import multiprocessing as mp parser = argparse.ArgumentParser("Analyses a database of Env AA...
mit
ToonTownInfiniteRepo/ToontownInfinite
Panda3D-1.9.0/direct/p3d/PackageInfo.py
2
48711
from pandac.PandaModules import Filename, URLSpec, DocumentSpec, Ramfile, Multifile, Decompressor, EUOk, EUSuccess, VirtualFileSystem, Thread, getModelPath, ExecutionEnvironment, PStatCollector, TiXmlDocument, TiXmlDeclaration, TiXmlElement from pandac import PandaModules from libpandaexpress import ConfigVariableInt f...
mit
KaiRo-at/socorro
socorro/cron/crontabber_app.py
2
4414
#!/usr/bin/env python # 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 crontabber.app import CronTabberBase DEFAULT_JOBS = ''' socorro.cron.jobs.weekly_reports_...
mpl-2.0
devs1991/test_edx_docmode
venv/lib/python2.7/site-packages/django/utils/html_parser.py
82
5221
import re import sys from django.utils.six.moves import html_parser as _html_parser current_version = sys.version_info use_workaround = ( (current_version < (2, 7, 3)) or (current_version >= (3, 0) and current_version < (3, 2, 3)) ) try: HTMLParseError = _html_parser.HTMLParseError except AttributeError...
agpl-3.0
armando-migliaccio/neutron
neutron/plugins/nec/drivers/trema.py
4
11888
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2012 NEC Corporation. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org...
apache-2.0
renard/ansible
test/units/module_utils/common/parameters/test_list_deprecations.py
37
1535
# -*- coding: utf-8 -*- # Copyright (c) 2019 Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type import pytest from ansible.module_utils.common.parameters import list_depreca...
gpl-3.0
morbozoo/sonyHeadphones
src/freetype/tools/cordic.py
401
1588
# compute arctangent table for CORDIC computations in fttrigon.c import sys, math #units = 64*65536.0 # don't change !! units = 256 scale = units/math.pi shrink = 1.0 comma = "" def calc_val( x ): global units, shrink angle = math.atan(x) shrink = shrink * math.cos(angle) return angle/math.pi *...
bsd-2-clause
ProfOak/terminal-card-games
tcg/deck.py
1
2490
import random from enum import Enum from colored import attr, bg, fg class Suits(Enum): HEART = 1 DIAMOND = 2 SPADE = 3 CLOVER = 4 class Colors(Enum): BLACK = 1 RED = 2 class Card: def __init__(self, suit, rank): """ suit: Heart, Diamond, Club, Spade rank: ...
gpl-2.0
sestrella/ansible
test/units/modules/network/fortios/test_fortios_system_admin.py
21
28531
# Copyright 2019 Fortinet, Inc. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the...
gpl-3.0
mkennedy04/knodj
env/Lib/site-packages/django/db/models/fields/related.py
9
114841
from __future__ import unicode_literals import warnings from operator import attrgetter from django import forms from django.apps import apps from django.core import checks, exceptions from django.core.exceptions import FieldDoesNotExist from django.db import connection, connections, router, transaction from django.d...
mit
FireWRT/OpenWrt-Firefly-Libraries
staging_dir/target-mipsel_1004kc+dsp_uClibc-0.9.33.2/usr/lib/python3.4/test/test_thread.py
84
8285
import os import unittest import random from test import support thread = support.import_module('_thread') import time import sys import weakref from test import lock_tests NUMTASKS = 10 NUMTRIPS = 3 _print_mutex = thread.allocate_lock() def verbose_print(arg): """Helper function for printing out debugging outp...
gpl-2.0
kelp404/elasticsearch-py
elasticsearch/transport.py
12
14606
import re import time from itertools import chain from .connection import Urllib3HttpConnection from .connection_pool import ConnectionPool, DummyConnectionPool from .serializer import JSONSerializer, Deserializer, DEFAULT_SERIALIZERS from .exceptions import ConnectionError, TransportError, SerializationError, \ ...
apache-2.0
gsmaxwell/phase_offset_rx
volk/gen/volk_arch_defs.py
8
3290
# # Copyright 2012 Free Software Foundation, Inc. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is ...
gpl-3.0
Brocade-OpenSource/OpenStack-DNRM-Nova
nova/api/openstack/compute/plugins/v3/quota_classes.py
3
3418
# Copyright 2012 OpenStack Foundation # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requ...
apache-2.0
charles1018/Nexus_5
scripts/build-all.py
305
10150
#! /usr/bin/env python # Copyright (c) 2009-2013, The Linux Foundation. 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 # ...
gpl-2.0
goFrendiAsgard/kokoropy
kokoropy/packages/sqlalchemy/sql/schema.py
22
134852
# sql/schema.py # Copyright (C) 2005-2014 the SQLAlchemy authors and contributors # <see AUTHORS file> # # This module is part of SQLAlchemy and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php """The schema module provides the building blocks for database metadata. Each element...
mit
bqbn/addons-server
src/olympia/devhub/tests/test_models.py
5
2120
from olympia import amo from olympia.addons.models import Addon from olympia.amo.tests import TestCase from olympia.devhub.models import BlogPost from olympia.files.models import File from olympia.versions.models import Version class TestVersion(TestCase): fixtures = ['base/users', 'base/addon_3615'] def set...
bsd-3-clause
roadmapper/ansible
lib/ansible/modules/network/avi/avi_pkiprofile.py
28
5555
#!/usr/bin/python # # @author: Gaurav Rastogi (grastogi@avinetworks.com) # Eric Anderson (eanderson@avinetworks.com) # module_check: supported # Avi Version: 17.1.1 # # Copyright: (c) 2017 Gaurav Rastogi, <grastogi@avinetworks.com> # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses...
gpl-3.0
h3llrais3r/SickRage
lib/unidecode/x01f.py
252
3899
data = ( 'a', # 0x00 'a', # 0x01 'a', # 0x02 'a', # 0x03 'a', # 0x04 'a', # 0x05 'a', # 0x06 'a', # 0x07 'A', # 0x08 'A', # 0x09 'A', # 0x0a 'A', # 0x0b 'A', # 0x0c 'A', # 0x0d 'A', # 0x0e 'A', # 0x0f 'e', # 0x10 'e', # 0x11 'e', # 0x12 'e', # 0x13 'e', # 0...
gpl-3.0
shianyow/kernel-android-skyrocket
scripts/gcc-wrapper.py
43
3735
#! /usr/bin/env python # -*- coding: utf-8 -*- # Copyright (c) 2011, Code Aurora Forum. 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 ...
gpl-2.0
redshodan/xmppcli
src/xmpp/dispatcher.py
200
17974
## transports.py ## ## Copyright (C) 2003-2005 Alexey "Snake" Nezhdanov ## ## 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, or (at your option) ## any later versi...
lgpl-2.1
eduNEXT/edunext-platform
common/lib/capa/capa/registry.py
10
1927
"""A registry for finding classes based on tags in the class.""" class TagRegistry(object): """ A registry mapping tags to handlers. (A dictionary with some extra error checking.) """ def __init__(self): self._mapping = {} def register(self, cls): """ Register cls as ...
agpl-3.0
noblehelm/tcc-fuzzy
main.py
1
8557
import matplotlib.pyplot as plt import pandas as pd import numpy as np import sys import fuzzy temp_min = pd.read_csv('data_selection.csv',usecols=['TempMinimaMedia']) temp_min = temp_min.values temp_min = temp_min.astype('float32') temp_min = np.swapaxes(temp_min,0,1) temp_max = pd.read_csv('data_selection.csv',usec...
mit
suutari-ai/shoop
shuup/configuration.py
3
4388
# -*- coding: utf-8 -*- # This file is part of Shuup. # # Copyright (c) 2012-2017, Shoop Commerce Ltd. All rights reserved. # # This source code is licensed under the OSL-3.0 license found in the # LICENSE file in the root directory of this source tree. """ API for Shuup's Dynamic Configuration. Idea of the Dynamic Co...
agpl-3.0
jhona22baz/blog-flask
python2.7/lib/python2.7/site-packages/babel/core.py
79
30999
# -*- coding: utf-8 -*- """ babel.core ~~~~~~~~~~ Core locale representation and locale data access. :copyright: (c) 2013 by the Babel Team. :license: BSD, see LICENSE for more details. """ import os from babel import localedata from babel._compat import pickle, string_types __all__ = ['Unknown...
mit
Voluntarynet/BitmessageKit
BitmessageKit/Vendor/static-python/Lib/test/test_errno.py
91
1184
#! /usr/bin/env python """Test the errno module Roger E. Masse """ import errno from test import test_support import unittest std_c_errors = frozenset(['EDOM', 'ERANGE']) class ErrnoAttributeTests(unittest.TestCase): def test_for_improper_attributes(self): # No unexpected attributes should be on the ...
mit
kosz85/django
django/contrib/contenttypes/forms.py
21
3557
from django.contrib.contenttypes.models import ContentType from django.db import models from django.forms import ModelForm, modelformset_factory from django.forms.models import BaseModelFormSet class BaseGenericInlineFormSet(BaseModelFormSet): """ A formset for generic inline objects to a parent. """ ...
bsd-3-clause
darshanthaker/nupic
src/nupic/data/generators/anomalyzer.py
35
7775
#!/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 ...
agpl-3.0
dpac-vlsi/SynchroTrace
src/arch/x86/isa/insts/general_purpose/data_transfer/stack_operations.py
75
7026
# Copyright (c) 2007-2008 The Hewlett-Packard Development Company # All rights reserved. # # The license below extends only to copyright in the software and shall # not be construed as granting a license to any other intellectual # property including but not limited to intellectual property relating # to a hardware imp...
bsd-3-clause
CredoReference/edx-platform
common/djangoapps/util/db.py
8
11325
""" Utility functions related to databases. """ import random # TransactionManagementError used below actually *does* derive from the standard "Exception" class. # pylint: disable=nonstandard-exception from contextlib import contextmanager from functools import wraps from django.db import DEFAULT_DB_ALIAS, DatabaseErr...
agpl-3.0
erickt/hue
desktop/core/ext-py/avro-1.7.6/test/test_protocol.py
58
12340
# 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 u...
apache-2.0
ryfeus/lambda-packs
Tensorflow_OpenCV_Nightly/source/tensorflow/contrib/opt/python/training/drop_stale_gradient_optimizer.py
56
4333
# 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...
mit
eeshangarg/oh-mainline
vendor/packages/BeautifulSoup/setup.py
16
2712
from distutils.core import setup import unittest import warnings warnings.filterwarnings("ignore", "Unknown distribution option") import sys # patch distutils if it can't cope with the "classifiers" keyword if sys.version < '2.2.3': from distutils.dist import DistributionMetadata DistributionMetadata.classifie...
agpl-3.0
herilalaina/scikit-learn
sklearn/cluster/k_means_.py
5
60896
"""K-means clustering""" # Authors: Gael Varoquaux <gael.varoquaux@normalesup.org> # Thomas Rueckstiess <ruecksti@in.tum.de> # James Bergstra <james.bergstra@umontreal.ca> # Jan Schlueter <scikit-learn@jan-schlueter.de> # Nelle Varoquaux # Peter Prettenhofer <peter.prettenh...
bsd-3-clause
modsy/incubator-airflow
tests/contrib/operators/ssh_execute_operator.py
7
1692
import unittest from datetime import datetime from airflow import configuration from airflow.settings import Session from airflow import models, DAG from airflow.contrib.operators.ssh_execute_operator import SSHExecuteOperator TEST_DAG_ID = 'unit_tests' DEFAULT_DATE = datetime(2015, 1, 1) configuration.test_mode() ...
apache-2.0
petroniocandido/pyFTS
pyFTS/models/seasonal/cmsfts.py
1
3307
import numpy as np from pyFTS.common import FuzzySet, FLR from pyFTS.models.seasonal import sfts from pyFTS.models import chen class ContextualSeasonalFLRG(sfts.SeasonalFLRG): """ Contextual Seasonal Fuzzy Logical Relationship Group """ def __init__(self, seasonality): super(ContextualSeasonal...
gpl-3.0
kythe/kythe
kythe/proto/generate_protobufs.py
2
4029
#!/usr/bin/env python2 # # Copyright 2016 The Kythe 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 r...
apache-2.0
dataxu/ansible
lib/ansible/modules/network/nxos/nxos_vxlan_vtep_vni.py
16
13971
#!/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 distribut...
gpl-3.0
DepthDeluxe/ansible
lib/ansible/modules/windows/win_uri.py
27
4369
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2015, Corwin Brown <corwin@corwinbrown.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...
gpl-3.0
guijomatos/SickRage
lib/github/tests/GitCommit.py
39
3235
# -*- coding: utf-8 -*- # ########################## Copyrights and license ############################ # # # Copyright 2012 Vincent Jacques <vincent@vincent-jacques.net> # # Copyright 2012 Zearin <zearin@gonk.net> ...
gpl-3.0
vimagick/youtube-dl
youtube_dl/extractor/teamcoco.py
114
6633
# -*- coding: utf-8 -*- from __future__ import unicode_literals import base64 import binascii import re import json from .common import InfoExtractor from ..utils import ( ExtractorError, qualities, determine_ext, ) from ..compat import compat_ord class TeamcocoIE(InfoExtractor): _VALID_URL = r'http...
unlicense
mikesun/xen-cow-checkpointing
tools/python/xen/util/xsconstants.py
1
4075
#============================================================================ # This library is free software; you can redistribute it and/or # modify it under the terms of version 2.1 of the GNU Lesser General Public # License as published by the Free Software Foundation. # # This library is distributed in the hope th...
gpl-2.0
bobthecow/ManipulateCoda
src/Support/Library/docutils/parsers/__init__.py
70
1457
# $Id: __init__.py 5618 2008-07-28 08:37:32Z strank $ # Author: David Goodger <goodger@python.org> # Copyright: This module has been placed in the public domain. """ This package contains Docutils parser modules. """ __docformat__ = 'reStructuredText' from docutils import Component class Parser(Component): co...
mit
petteyg/intellij-community
python/testData/inspections/PyNumpyType/Empty.py
69
1456
def empty(shape, dtype=None, order='C'): # real signature unknown; restored from __doc__ """ empty(shape, dtype=float, order='C') Return a new array of given shape and type, without initializing entries. Parameters ---------- shape : int or tuple of int Shape of the...
apache-2.0
Stargrazer82301/CAAPR
CAAPR/CAAPR_AstroMagic/PTS/pts/do/eagle/collect.py
1
3406
#!/usr/bin/env python # -*- coding: utf8 -*- # ***************************************************************** # ** PTS -- Python Toolkit for working with SKIRT ** # ** © Astronomical Observatory, Ghent University ** # ***************************************************************** ##...
mit
h8rift/android_kernel_htc_msm8960-evita
scripts/build-all.py
1250
9474
#! /usr/bin/env python # Copyright (c) 2009-2011, Code Aurora Forum. 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 # n...
gpl-2.0
anorfleet/turntable
test/lib/python2.7/site-packages/pip/_vendor/html5lib/treebuilders/dom.py
559
8469
from __future__ import absolute_import, division, unicode_literals from xml.dom import minidom, Node import weakref from . import _base from .. import constants from ..constants import namespaces from ..utils import moduleFactoryFactory def getDomBuilder(DomImplementation): Dom = DomImplementation class A...
mit
Alberto-Beralix/Beralix
i386-squashfs-root/usr/share/pyshared/butterfly/channel_manager.py
3
6675
# telepathy-butterfly - an MSN connection manager for Telepathy # # Copyright (C) 2006-2007 Ali Sabil <ali.sabil@gmail.com> # # 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 ...
gpl-3.0
pakohan/syso-kernel
linux-3.4.68/scripts/rt-tester/rt-tester.py
11005
5307
#!/usr/bin/python # # rt-mutex tester # # (C) 2006 Thomas Gleixner <tglx@linutronix.de> # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License version 2 as # published by the Free Software Foundation. # import os import sys import getopt import sh...
gpl-2.0
drjeep/django
tests/generic_inline_admin/tests.py
154
22749
# -*- coding: utf-8 -*- from __future__ import unicode_literals import datetime from django.contrib import admin from django.contrib.admin.sites import AdminSite from django.contrib.auth.models import User from django.contrib.contenttypes.admin import GenericTabularInline from django.contrib.contenttypes.forms import...
bsd-3-clause
special/telepathy-qt-upstream
tools/libtpcodegen.py
28
6610
"""Library code for language-independent D-Bus-related code generation. The master copy of this library is in the telepathy-glib repository - please make any changes there. """ # Copyright (C) 2006-2008 Collabora Limited # # This library is free software; you can redistribute it and/or # modify it under the terms of ...
lgpl-2.1
mixja/eap-sim-lab
lib/pyscard-1.6.16/build/lib.macosx-10.10-x86_64-2.7/smartcard/wx/SimpleSCardApp.py
3
3139
"""Simple wxPython wxApp for smartcard. __author__ = "gemalto http://www.gemalto.com" Copyright 2001-2012 gemalto Author: Jean-Daniel Aussel, mailto:jean-daniel.aussel@gemalto.com This file is part of pyscard. pyscard is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser Gener...
mit
Tolriq/xbmc
lib/libUPnP/Platinum/Build/Tools/Scripts/VsMake.py
263
2456
#! /usr/bin/env python """ Visual Studio 2005 Build Script $Id: VsMake.py 655 2010-09-29 22:40:22Z soothe $ """ import os import sys import getopt import subprocess # Setup some path stuff try: if environ['VISUALSTUDIO_BIN']: VSBINDIR = environ['VISUALSTUDIO_BIN'] except NameError: # Use default va...
gpl-2.0
zak-k/iris
lib/iris/tests/unit/quickplot/test_pcolor.py
11
2324
# (C) British Crown Copyright 2014 - 2016, Met Office # # This file is part of Iris. # # Iris 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 3 of the License, or # (at your option) any l...
gpl-3.0
sajeeshcs/nested_quota_latest
nova/tests/unit/objects/test_ec2.py
12
6394
# Copyright (C) 2014, 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/licenses/LICENSE-2.0 # # Unless required by applicable law or...
apache-2.0
proxysh/Safejumper-for-Mac
buildmac/Resources/env/lib/python2.7/site-packages/obfsproxy/test/transports/test_b64.py
18
1903
import unittest import twisted.trial.unittest import obfsproxy.transports.b64 as b64 class test_b64_splitting(twisted.trial.unittest.TestCase): def _helper_splitter(self, string, expected_chunks): chunks = b64._get_b64_chunks_from_str(string) self.assertEqual(chunks, expected_chunks) def test...
gpl-2.0
bd-j/magellanic
magellanic/starfit/catio.py
1
10171
import numpy as np import astropy.io.fits as pyfits from StringIO import StringIO from astropy.io import ascii import sqlite3 as lite import observate import hrdspyutils as utils ########## #### Data Inputs #### ######### def load_image_cube(rp): """Convert input catalogs into nstar x nfilter arrays for the fitt...
gpl-2.0
Venturi/cms
env/lib/python2.7/site-packages/phonenumbers/data/region_BM.py
10
1781
"""Auto-generated file, do not edit by hand. BM metadata""" from ..phonemetadata import NumberFormat, PhoneNumberDesc, PhoneMetadata PHONE_METADATA_BM = PhoneMetadata(id='BM', country_code=1, international_prefix='011', general_desc=PhoneNumberDesc(national_number_pattern='[4589]\\d{9}', possible_number_pattern='\...
gpl-2.0
mancoast/CPythonPyc_test
cpython/243_test_unpack.py
17
2562
doctests = """ Unpack tuple >>> t = (1, 2, 3) >>> a, b, c = t >>> a == 1 and b == 2 and c == 3 True Unpack list >>> l = [4, 5, 6] >>> a, b, c = l >>> a == 4 and b == 5 and c == 6 True Unpack implied tuple >>> a, b, c = 7, 8, 9 >>> a == 7 and b == 8 and c == 9 True Unpa...
gpl-3.0
gilneidp/TADD
lib/ioworker/workers.py
42
6537
# Copyright 2012-2013 James McCauley # # 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 ...
apache-2.0
ryfeus/lambda-packs
Tensorflow_LightGBM_Scipy_nightly/source/google/protobuf/internal/any_test_pb2.py
6
7055
# Generated by the protocol buffer compiler. DO NOT EDIT! # source: google/protobuf/internal/any_test.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 i...
mit
gonboy/sl4a
python/src/Lib/colorsys.py
60
3459
"""Conversion functions between RGB and other color systems. This modules provides two functions for each color system ABC: rgb_to_abc(r, g, b) --> a, b, c abc_to_rgb(a, b, c) --> r, g, b All inputs and outputs are triples of floats in the range [0.0...1.0] (with the exception of I and Q, which covers a slightly...
apache-2.0
factorlibre/OCB
addons/hr_contract/__init__.py
381
1107
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-Today OpenERP SA (<http://www.openerp.com) # # This program is free software: you can redistribute it and/or modify # it under the term...
agpl-3.0
andres-h/webdc3
wsgi/eida.py
2
8353
import os import datetime import sys import string from xml.dom.minidom import Document as E from xml.dom.minidom import parseString class Nodes(object): def __init__(self): self._nodes = {} self._groups = {} def getHTMLOptions(self): options = "" for node in self: ...
gpl-3.0
ahmedbodi/p2pool-gre
p2pool/util/variable.py
270
2541
import itertools import weakref from twisted.internet import defer, reactor from twisted.python import failure, log class Event(object): def __init__(self): self.observers = {} self.id_generator = itertools.count() self._once = None self.times = 0 def run_and_watch(self, f...
gpl-3.0
pimanttr/nixysa
nixysa/writer.py
9
1201
#!/usr/bin/python2.4 # # Copyright 2009 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...
apache-2.0
anbangleo/NlsdeWeb
Python-3.6.0/Lib/abc.py
53
8628
# Copyright 2007 Google, Inc. All Rights Reserved. # Licensed to PSF under a Contributor Agreement. """Abstract Base Classes (ABCs) according to PEP 3119.""" from _weakrefset import WeakSet def abstractmethod(funcobj): """A decorator indicating abstract methods. Requires that the metaclass is ABCMeta or de...
mit