repo_name
stringlengths
6
100
path
stringlengths
4
294
copies
stringlengths
1
5
size
stringlengths
4
6
content
stringlengths
606
896k
license
stringclasses
15 values
Architektor/PySnip
venv/lib/python2.7/site-packages/twisted/conch/test/test_conch.py
2
20891
# -*- test-case-name: twisted.conch.test.test_conch -*- # Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. import os, sys, socket from itertools import count from zope.interface import implementer from twisted.cred import portal from twisted.internet import reactor, defer, protocol from twisted....
gpl-3.0
hottwaj/django
tests/utils_tests/test_tree.py
429
1951
import copy import unittest from django.utils.tree import Node class NodeTests(unittest.TestCase): def setUp(self): self.node1_children = [('a', 1), ('b', 2)] self.node1 = Node(self.node1_children) self.node2 = Node() def test_str(self): self.assertEqual(str(self.node1), "(DE...
bsd-3-clause
saada/ansible
plugins/inventory/gce.py
13
10489
#!/usr/bin/env python # Copyright 2013 Google Inc. # # 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 ...
gpl-3.0
gajim/python-nbxmpp
nbxmpp/dispatcher.py
1
19414
# Copyright (C) 2019 Philipp Hörist <philipp AT hoerist.com> # # This file is part of nbxmpp. # # 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 opt...
gpl-3.0
unnikrishnankgs/va
venv/lib/python3.5/site-packages/tensorflow/contrib/linear_optimizer/python/ops/sparse_feature_column.py
119
3797
# 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...
bsd-2-clause
angdraug/nova
nova/keymgr/mock_key_mgr.py
18
4432
# Copyright (c) 2013 The Johns Hopkins University/Applied Physics Laboratory # 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
jrief/django-angular
examples/server/tests/settings.py
1
3584
# -*- coding: utf-8 -*- from __future__ import unicode_literals """Django settings for unit test project.""" import os DEBUG = True BASE_DIR = os.path.abspath(os.path.join(os.path.dirname(__file__), os.pardir, os.pardir)) DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', 'NAME': ...
mit
deanhiller/databus
webapp/play1.3.x/python/Lib/email/utils.py
3
10124
# Copyright (C) 2001-2006 Python Software Foundation # Author: Barry Warsaw # Contact: email-sig@python.org """Miscellaneous utilities.""" __all__ = [ 'collapse_rfc2231_value', 'decode_params', 'decode_rfc2231', 'encode_rfc2231', 'formataddr', 'formatdate', 'getaddresses', ...
mpl-2.0
kornyone/google-kernel-steelhead
tools/perf/scripts/python/syscall-counts-by-pid.py
11180
1927
# system call counts, by pid # (c) 2010, Tom Zanussi <tzanussi@gmail.com> # Licensed under the terms of the GNU GPL License version 2 # # Displays system-wide system call totals, broken down by syscall. # If a [comm] arg is specified, only syscalls called by [comm] are displayed. import os, sys sys.path.append(os.env...
gpl-2.0
kursitet/edx-platform
common/djangoapps/third_party_auth/tests/specs/test_testshib.py
46
5259
""" Third_party_auth integration tests using a mock version of the TestShib provider """ import unittest import httpretty from mock import patch from third_party_auth.tasks import fetch_saml_metadata from third_party_auth.tests import testutil from .base import IntegrationTestMixin TESTSHIB_ENTITY_ID = 'https://idp...
agpl-3.0
Ialong/shogun
examples/undocumented/python_modular/modelselection_grid_search_liblinear_modular.py
26
3062
#!/usr/bin/env python # # 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. # # Written (W) 2011 Heiko Strathmann # Copyrigh...
gpl-3.0
zhjunlang/kbengine
kbe/res/scripts/common/Lib/test/test_codecs.py
60
111483
import codecs import contextlib import io import locale import sys import unittest import warnings import encodings from test import support if sys.platform == 'win32': VISTA_OR_LATER = (sys.getwindowsversion().major >= 6) else: VISTA_OR_LATER = False try: import ctypes except ImportError: ctypes = N...
lgpl-3.0
MrBasset/libcloud
libcloud/test/common/test_gandi.py
66
1293
# 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 ...
apache-2.0
sebastic/NLExtract
bag/src/bestuurlijkobject.py
2
5596
__author__ = "Just van den Broecke" __date__ = "Dec 25, 2011 3:46:27 PM$" """ Naam: BestuurlijkObject.py Omschrijving: Classes voor Bestuurlijke objecten De BAG bevat geen bestuurlijke objecten, zoals gemeenten en provincies. Daarom verrijken we de BAG met additionele bestuurlijke data. Deze is te verkrij...
gpl-3.0
hbrunn/OpenUpgrade
addons/edi/models/res_partner.py
437
4243
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Business Applications # Copyright (c) 2011-2012 OpenERP S.A. <http://openerp.com> # # This program is free software: you can redistribute it and/or modify # it under the terms of t...
agpl-3.0
crs4/pydoop
test/hdfs/try_hdfs.py
2
1699
# BEGIN_COPYRIGHT # # Copyright 2009-2021 CRS4. # # 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 agree...
apache-2.0
weiawe/django
tests/sessions_tests/tests.py
10
24700
import base64 import os import shutil import string import sys import tempfile import unittest from datetime import timedelta from django.conf import settings from django.contrib.sessions.backends.cache import SessionStore as CacheSession from django.contrib.sessions.backends.cached_db import \ SessionStore as Cac...
bsd-3-clause
AkademieOlympia/sympy
sympy/printing/octave.py
52
22542
""" Octave (and Matlab) code printer The `OctaveCodePrinter` converts SymPy expressions into Octave expressions. It uses a subset of the Octave language for Matlab compatibility. A complete code generator, which uses `octave_code` extensively, can be found in `sympy.utilities.codegen`. The `codegen` module can be us...
bsd-3-clause
Lsquared13/nbproject
apps/base/jobs.py
1
19665
""" jobs.py - base notification routines Author Sacha Zyto <sacha@csail.mit.edu> License Copyright (c) 2010-2012 Massachusetts Institute of Technology. MIT License (cf. MIT-LICENSE.txt or http://www.opensource.org/licenses/mit-license.php) """ import sys,os import datetime if "." not in sys.path: sy...
mit
dhruv13J/scikit-learn
examples/svm/plot_iris.py
62
3251
""" ================================================== Plot different SVM classifiers in the iris dataset ================================================== Comparison of different linear SVM classifiers on a 2D projection of the iris dataset. We only consider the first 2 features of this dataset: - Sepal length - Se...
bsd-3-clause
JoaoVasques/aws-devtool
eb/macosx/python3/lib/aws/requests/packages/urllib3/contrib/ntlmpool.py
262
4740
# urllib3/contrib/ntlmpool.py # Copyright 2008-2012 Andrey Petrov and contributors (see CONTRIBUTORS.txt) # # This module is part of urllib3 and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php """ NTLM authenticating pool, contributed by erikcederstran Issue #10, see: http://co...
apache-2.0
clearcode/Apache2Piwik
src/daemons.py
1
2900
#-*- coding: utf-8 -*- #!/usr/bin/env python import sys, os, time, atexit from signal import SIGTERM from datetime import datetime class Daemon: """ A generic daemon class. Usage: subclass the Daemon class and override the run() method """ def __init__(self, pidfile, stdin='/dev/null', stdout='/dev/null', std...
gpl-3.0
waheedahmed/edx-platform
common/lib/xmodule/xmodule/modulestore/mongoengine_fields.py
209
3190
""" Custom field types for mongoengine """ import mongoengine from opaque_keys.edx.locations import SlashSeparatedCourseKey, Location from types import NoneType from opaque_keys.edx.keys import CourseKey, UsageKey class CourseKeyField(mongoengine.StringField): """ Serializes and deserializes CourseKey's to mo...
agpl-3.0
xin3liang/platform_external_chromium-trace
trace-viewer/third_party/pywebsocket/src/test/test_handshake_hybi00.py
30
15038
#!/usr/bin/env python # # Copyright 2011, 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...
bsd-3-clause
BrandonY/gsutil
gslib/encryption_helper.py
10
3614
# -*- coding: utf-8 -*- # Copyright 2015 Google Inc. 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 require...
apache-2.0
gsmartway/odoo
addons/auth_oauth/res_users.py
157
4897
import logging import werkzeug.urls import urlparse import urllib2 import simplejson import openerp from openerp.addons.auth_signup.res_users import SignupError from openerp.osv import osv, fields from openerp import SUPERUSER_ID _logger = logging.getLogger(__name__) class res_users(osv.Model): _inherit = 'res....
agpl-3.0
nuuuboo/odoo
addons/membership/report/report_membership.py
313
5267
# -*- 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
datenbetrieb/odoo
openerp/service/server.py
17
37987
#----------------------------------------------------------- # Threaded, Gevent and Prefork Servers #----------------------------------------------------------- import datetime import errno import logging import os import os.path import platform import random import select import signal import socket import subprocess ...
agpl-3.0
mdigiorgio/lisa
tests/benchmarks/android_geekbench.py
4
3914
#!/usr/bin/env python import os from time import sleep # The workload class MUST be loaded before the LisaBenchmark from android import Workload from android import LisaBenchmark from devlib.exception import TargetError class GeekbenchTest(LisaBenchmark): # Android Workload to run bm_name = 'Geekbench' ...
apache-2.0
ikaee/bfr-attendant
facerecognitionlibrary/jni-build/jni/include/tensorflow/contrib/rnn/python/ops/rnn.py
25
10321
# Copyright 2015 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
apache-2.0
onoga/toolib
toolib/web/kit/JSONRPCServlet.py
2
4091
"""JSON-RPC servlet base class Written by Jean-Francois Pieronne """ DEBUG = 0 import traceback from MiscUtils import StringIO try: import simplejson except ImportError: print "ERROR: simplejson is not installed." print "Get it from http://cheeseshop.python.org/pypi/simplejson" from WebKit.HTTPContent import HT...
gpl-2.0
puzan/ansible
lib/ansible/modules/system/setup.py
16
5737
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2012, Michael DeHaan <michael.dehaan@gmail.com> # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of...
gpl-3.0
methoxid/micropystat
tests/bytecode/pylib-tests/socket.py
22
14915
# Wrapper module for _socket, providing some additional facilities # implemented in Python. """\ This module provides socket operations and some related functions. On Unix, it supports IP (Internet Protocol) and Unix domain sockets. On other systems, it only supports IP. Functions specific for a socket are available a...
mit
ilo10/scikit-learn
examples/plot_johnson_lindenstrauss_bound.py
134
7452
""" ===================================================================== The Johnson-Lindenstrauss bound for embedding with random projections ===================================================================== The `Johnson-Lindenstrauss lemma`_ states that any high dimensional dataset can be randomly projected in...
bsd-3-clause
bbc/kamaelia
Sketches/MPS/BugReports/FixTests/Kamaelia/Examples/Multicast/BasicSystems/MulticastStreamingSystem.py
6
1623
#!/usr/bin/python # -*- coding: utf-8 -*- # # Basic acceptance test harness for the Multicast_sender and receiver # components. # # Copyright 2010 British Broadcasting Corporation and Kamaelia Contributors(1) # # (1) Kamaelia Contributors are listed in the AUTHORS file and at # http://www.kamaelia.org/AUTHORS - ple...
apache-2.0
kevenli/scrapydd
docs/conf.py
1
10111
# -*- coding: utf-8 -*- # # scrapydd documentation build configuration file, created by # sphinx-quickstart on Fri Oct 07 20:40:31 2016. # # This file is execfile()d with the current directory set to its # containing dir. # # Note that not all possible configuration values are present in this # autogenerated f...
apache-2.0
netvigator/myPyPacks
DbApi/Boolean.py
2
3440
#!/usr/bin/pythonTest # -*- coding: utf-8 -*- # # DbApi functions Boolean # # 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 option) any later versi...
gpl-2.0
computersalat/ansible
test/lib/ansible_test/_internal/ci/azp.py
8
9846
"""Support code for working with Azure Pipelines.""" from __future__ import (absolute_import, division, print_function) __metaclass__ = type import os import re import tempfile import uuid from .. import types as t from ..encoding import ( to_bytes, ) from ..config import ( CommonConfig, TestConfig, ) ...
gpl-3.0
imatge-upc/saliency-2016-cvpr
shallow/train.py
2
3064
# add to kfkd.py from lasagne import layers from lasagne.updates import nesterov_momentum from nolearn.lasagne import NeuralNet,BatchIterator import os import numpy as np from sklearn.utils import shuffle import cPickle as pickle import matplotlib.pyplot as plt import Image import ImageOps from scipy import misc import...
mit
SUSE/azure-sdk-for-python
examples/AzureResourceViewer/ptvs_virtualenv_proxy.py
58
4204
 # ############################################################################ # # Copyright (c) Microsoft Corporation. # # This source code is subject to terms and conditions of the Apache License, Version 2.0. A # copy of the license can be found in the License.html file at the root of this distribution. If ...
mit
fmacias64/Dato-Core
src/unity/python_deps/psutil/examples/top.py
44
7382
#!/usr/bin/env python # Copyright (c) 2009, Giampaolo Rodola'. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """ A clone of top / htop. Author: Giampaolo Rodola' <g.rodola@gmail.com> $ python examples/top.py CPU0 [| ...
agpl-3.0
shaunstanislaus/Skoarcery
Skoarcery/dragonsets.py
3
5398
# ========================================== # FIRST and FOLLOW sets from the dragon book # ========================================== from Skoarcery.langoids import Nonterminal, Production, Langoid FIRST = None FOLLOW = None def init(compute=True): global FIRST, FOLLOW FIRST = DragonSet("FIRST") FOLLOW...
artistic-2.0
hryamzik/ansible
lib/ansible/modules/network/panos/panos_query_rules.py
16
18383
#!/usr/bin/python # -*- coding: utf-8 -*- # # Ansible module to manage PaloAltoNetworks Firewall # (c) 2016, techbizdev <techbizdev@paloaltonetworks.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 publish...
gpl-3.0
ximion/dak-dep11
dak/stats.py
6
15923
#!/usr/bin/env python """ Various statistical pr0nography fun and games """ # Copyright (C) 2000, 2001, 2002, 2003, 2006 James Troup <james@nocrew.org> # Copyright (C) 2013 Luca Falavigna <dktrkranz@debian.org> # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU Ge...
gpl-2.0
appsembler/edx-platform
lms/djangoapps/teams/tests/factories.py
23
1230
"""Factories for testing the Teams API.""" from datetime import datetime from uuid import uuid4 import factory import pytz from factory.django import DjangoModelFactory from lms.djangoapps.teams.models import CourseTeam, CourseTeamMembership LAST_ACTIVITY_AT = datetime(2015, 8, 15, 0, 0, 0, tzinfo=pytz.utc) class...
agpl-3.0
sysadminmatmoz/OCB
addons/rating_project_issue/models/project_issue.py
51
5818
# -*- coding: utf-8 -*- from openerp import api, fields, models class ProjectIssue(models.Model): _name = "project.issue" _inherit = ['project.issue', 'rating.mixin'] @api.multi def write(self, values): if 'stage_id' in values and values.get('stage_id'): template = self.env['proj...
agpl-3.0
firebitsbr/raspberry_pwn
src/pentest/voiper/sulley/nix_process_monitor.py
8
9347
import os import sys import getopt import signal import time import threading from sulley import pedrpc ''' By nnp http://www.unprotectedhex.com This intended as a basic replacement for Sulley's process_monitor.py on *nix. The below options are accepted. Crash details are limited to the signal that caused the death ...
gpl-3.0
shakhat/act
act/engine/core.py
1
7144
# 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 writing, software # distributed under the ...
apache-2.0
hubsaysnuaa/odoo
openerp/tools/translate.py
27
45371
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 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
rscnt/django-cms
cms/south_migrations/0056_auto__del_field_page_published_languages.py
63
18273
# -*- coding: utf-8 -*- from south.utils import datetime_utils as datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Deleting field 'Page.published_languages' db.delete_column(u'cms_page',...
bsd-3-clause
albertliangcode/Pi_MonteCarloSim
venv/lib/python2.7/site-packages/pip/_vendor/requests/packages/chardet/mbcssm.py
1783
19590
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is mozilla.org code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 1998 # the Initial Developer. All Rights Reserved. # # Con...
mit
opveclib/opveclib
opveclib/stdops/test_math.py
2
14420
# Copyright 2016 Hewlett Packard Enterprise Development LP # # 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
Dhivyap/ansible
lib/ansible/modules/network/netconf/netconf_config.py
6
19384
#!/usr/bin/python # (c) 2016, Leandro Lisboa Penz <lpenz at lpenz.org> # 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
LTD-Beget/sprutio-rpc
lib/FileManager/workers/sftp/newFile.py
1
1671
import traceback from lib.FileManager.workers.baseWorkerCustomer import BaseWorkerCustomer class NewFile(BaseWorkerCustomer): def __init__(self, path, session, *args, **kwargs): super(NewFile, self).__init__(*args, **kwargs) self.path = path self.session = session def run(self): ...
gpl-3.0
surban/libsvm-orig
tools/subset.py
124
3202
#!/usr/bin/env python import os, sys, math, random from collections import defaultdict if sys.version_info[0] >= 3: xrange = range def exit_with_help(argv): print("""\ Usage: {0} [options] dataset subset_size [output1] [output2] This script randomly selects a subset of the dataset. options: -s method : method of...
bsd-3-clause
Creworker/FreeCAD
src/Mod/Path/PathScripts/PathDrilling.py
9
8433
# -*- coding: utf-8 -*- #*************************************************************************** #* * #* Copyright (c) 2014 Yorik van Havre <yorik@uncreated.net> * #* ...
lgpl-2.1
antb/TPT----My-old-mod
src/python/stdlib/hashlib.py
12
4893
# $Id: hashlib.py 78528 2010-03-01 02:01:47Z gregory.p.smith $ # # Copyright (C) 2005 Gregory P. Smith (greg@krypto.org) # Licensed to PSF under a Contributor Agreement. # __doc__ = """hashlib module - A common interface to many hash functions. new(name, string='') - returns a new hash object implementing the ...
gpl-2.0
puruckertom/poptox
poptox/yulefurry/yulefurry_qaqc.py
1
1396
import os os.environ['DJANGO_SETTINGS_MODULE']='settings' import webapp2 as webapp from google.appengine.ext.webapp.util import run_wsgi_app from google.appengine.ext.webapp import template import numpy as np import cgi import cgitb cgitb.enable() class yulefurryQaqcPage(webapp.RequestHandler): de...
unlicense
aerickson/ansible
lib/ansible/modules/cloud/vmware/vsphere_copy.py
36
6516
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright 2015 Dag Wieers <dag@wieers.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 Lice...
gpl-3.0
skg-net/ansible
lib/ansible/modules/cloud/openstack/os_subnet.py
27
12816
#!/usr/bin/python # coding: utf-8 -*- # (c) 2013, Benno Joy <benno@ansible.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
gnowgi/gnowsys-studio
objectapp/urls/search.py
2
3476
# Copyright (c) 2011, 2012 Free Software Foundation # This program 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 Free Software Foundation, either version 3 of the # License, or (at your option) any later vers...
agpl-3.0
horance-liu/tensorflow
tensorflow/python/data/ops/dataset_ops.py
2
60412
# 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...
apache-2.0
RasPlex/systemtap
scripts/kprobes_test/readelf.py
15
2430
#!/usr/bin/python # Copyright (C) 2008 Red Hat Inc. # # This file is part of systemtap, and is free software. You can # redistribute it and/or modify it under the terms of the GNU General # Public License (GPL); either version 2, or (at your option) any # later version. import re import sys import os #import pickle...
gpl-2.0
nwjs/chromium.src
build/android/pylib/utils/xvfb.py
143
1551
# Copyright (c) 2013 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. # pylint: disable=W0702 import os import signal import subprocess import sys import time def _IsLinux(): """Return True if on Linux; else False.""" ...
bsd-3-clause
bruno314/invenio-logging-old
tests/test_invenio_logging.py
1
3090
# -*- coding: utf-8 -*- # # This file is part of Invenio. # Copyright (C) 2015 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 your option) any later...
gpl-2.0
ivano666/tensorflow
tensorflow/python/training/input.py
3
36755
# Copyright 2015 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
apache-2.0
vintasoftware/django-role-permissions
rolepermissions/tests/test_permissions.py
1
2083
from django.test import TestCase from rolepermissions.permissions import PermissionsManager, register_object_checker from rolepermissions.exceptions import CheckerNotRegistered class PermissionsManagerTests(TestCase): def setUp(self): PermissionsManager._checkers = {} def test_register_checker(sel...
mit
chankeypathak/pandas-matplotlib-examples
Lesson 9/export.py
1
1179
import pandas as pd from sqlalchemy import create_engine, MetaData, Table, select # Parameters TableName = "data" DB = { 'drivername': 'mssql+pyodbc', 'servername': 'DAVID-THINK', #'port': '5432', #'username': 'lynn', #'password': '', 'database': 'BizIntel', 'driver': 'SQL Server Native Cl...
mit
aam-at/tensorflow
tensorflow/python/ops/ragged/strings_reduce_join_op_test.py
15
5488
# 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...
apache-2.0
40223117cda/w17test
static/Brython3.1.1-20150328-091302/Lib/bisect.py
1261
2595
"""Bisection algorithms.""" def insort_right(a, x, lo=0, hi=None): """Insert item x in list a, and keep it sorted assuming a is sorted. If x is already in a, insert it to the right of the rightmost x. Optional args lo (default 0) and hi (default len(a)) bound the slice of a to be searched. """ ...
gpl-3.0
jaywreddy/django
django/contrib/gis/db/backends/spatialite/models.py
510
2946
""" The GeometryColumns and SpatialRefSys models for the SpatiaLite backend. """ from django.contrib.gis.db.backends.base.models import SpatialRefSysMixin from django.contrib.gis.db.backends.spatialite.base import DatabaseWrapper from django.db import connection, models from django.db.backends.signals import connectio...
bsd-3-clause
yasoob/PythonRSSReader
venv/lib/python2.7/dist-packages/reportlab/platypus/tableofcontents.py
1
20681
#Copyright ReportLab Europe Ltd. 2000-2012 #see license.txt for license details #history http://www.reportlab.co.uk/cgi-bin/viewcvs.cgi/public/reportlab/trunk/reportlab/platypus/tableofcontents.py __version__=''' $Id$ ''' __doc__="""Experimental class to generate Tables of Contents easily This module defines a single...
mit
mKeRix/home-assistant
homeassistant/components/enphase_envoy/sensor.py
15
5480
"""Support for Enphase Envoy solar energy monitor.""" import logging from envoy_reader.envoy_reader import EnvoyReader import requests import voluptuous as vol from homeassistant.components.sensor import PLATFORM_SCHEMA from homeassistant.const import ( CONF_IP_ADDRESS, CONF_MONITORED_CONDITIONS, CONF_NAM...
mit
gpersistence/tstop
python/persistence/PartitionData.py
1
8153
#TSTOP # #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 hope that it will be useful, ...
gpl-3.0
AeroDragon/ArduCopter
Tools/autotest/jsbsim/runsim.py
32
11496
#!/usr/bin/env python # run a jsbsim model as a child process import sys, os, pexpect, socket import math, time, select, struct, signal, errno sys.path.insert(0, os.path.join(os.path.dirname(os.path.realpath(__file__)), '..', 'pysim')) import util, atexit, fdpexpect from pymavlink import fgFDM class control_state(o...
gpl-3.0
clems71/pogle
pogle/pogle_scene.py
1
3346
from pogle_math import Vector, Matrix4x4, Transform __author__ = 'Clement JACOB' __copyright__ = "Copyright 2013, The Python OpenGL Engine" __license__ = "Closed Source" __version__ = "0.0.1" __email__ = "clems71@gmail.com" __status__ = "Prototype" class Light(object): def __init__(self, pos=Vector(0.0, 0....
mit
Immortalin/python-for-android
python-modules/twisted/twisted/internet/cfreactor.py
49
17464
# -*- test-case-name: twisted.internet.test.test_core -*- # Copyright (c) 2010 Twisted Matrix Laboratories # See LICENSE for details. """ A reactor for integrating with U{CFRunLoop<http://bit.ly/cfrunloop>}, the CoreFoundation main loop used by MacOS X. This is useful for integrating Twisted with U{PyObjC<http://pyob...
apache-2.0
Mailea/detailed-skyrim-calculator
skycalc/calculator.py
2
4763
"""Calculate optimal training strategies to reach a certain character level. 3 Versions: fast, easy and balanced. """ def simulate_training(original_skill_levels, current, goal, selected_from): """Simulate skill training and return resulting information. Attributes: original_skill_levels: dict conta...
mit
indashnet/InDashNet.Open.UN2000
android/external/chromium_org/v8/tools/run-valgrind.py
92
2874
#!/usr/bin/env python # # Copyright 2009 the V8 project authors. 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 # noti...
apache-2.0
pombredanne/pangyp
gyp/pylib/gyp/simple_copy.py
1869
1247
# Copyright 2014 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. """A clone of the default copy.deepcopy that doesn't handle cyclic structures or complex types except for dicts and lists. This is because gyp copies so large structur...
mit
sdphome/UHF_Reader
rfs/rootfs/usr/lib/python2.7/random.py
53
32323
"""Random variable generators. integers -------- uniform within range sequences --------- pick random element pick random sample generate random permutation distributions on the real line: ------------------------------ uniform ...
gpl-3.0
zaksoup/gpdb
gpMgmt/bin/gppylib/operations/initstandby.py
35
9596
#!/usr/bin/env python import os import base64 import pickle from gppylib.gpparseopts import OptParser, OptChecker from gppylib.mainUtils import addStandardLoggingAndHelpOptions from collections import defaultdict from gppylib import gplog from gppylib.commands import unix from gppylib.commands.base import REMOTE, Wor...
apache-2.0
fuchsia-mirror/third_party-grpc
src/c-ares/gen_build_yaml.py
18
5765
#!/usr/bin/env python2.7 # Copyright 2015 gRPC 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 l...
apache-2.0
GbalsaC/bitnamiP
venv/lib/python2.7/site-packages/social/apps/django_app/default/fields.py
80
2513
import json import six from django.core.exceptions import ValidationError from django.db import models try: from django.utils.encoding import smart_unicode as smart_text smart_text # placate pyflakes except ImportError: from django.utils.encoding import smart_text class JSONField(six.with_metaclass(mod...
agpl-3.0
FireWRT/OpenWrt-Firefly-Libraries
staging_dir/target-mipsel_1004kc+dsp_uClibc-0.9.33.2/usr/lib/python3.4/unittest/test/test_case.py
8
62504
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, ...
gpl-2.0
eusi/MissionPlanerHM
Lib/site-packages/numpy/ma/tests/test_regression.py
60
1082
from numpy.testing import * import numpy as np rlevel = 1 class TestRegression(TestCase): def test_masked_array_create(self,level=rlevel): """Ticket #17""" x = np.ma.masked_array([0,1,2,3,0,4,5,6],mask=[0,0,0,1,1,1,0,0]) assert_array_equal(np.ma.nonzero(x),[[1,2,6,7]]) def test_masked...
gpl-3.0
bheesham/servo
tests/wpt/web-platform-tests/tools/html5lib/html5lib/inputstream.py
618
30855
from __future__ import absolute_import, division, unicode_literals from six import text_type from six.moves import http_client import codecs import re from .constants import EOF, spaceCharacters, asciiLetters, asciiUppercase from .constants import encodings, ReparseException from . import utils from io import String...
mpl-2.0
ibethune/lammps
tools/moltemplate/moltemplate/force_fields/convert_EMC_files_to_LT_files/emcprm2lt.py
3
24145
#!/usr/bin/python import os, sys, getopt import datetime __version__ = 0.2 #################### UNITS #################### # Only used with --units flag econv = 1.0 # Additional Factor for unit conversion if needed (energies) lconv = 1.0 # Additional Factor for unit conversion if neededa (lengths) dconv = 1.0 # Addi...
gpl-2.0
simvisage/oricreate
docs/howtos/ex04_cp_operators/cp_F_L_bases.py
1
1043
r''' This example demonstrates the crease pattern factory usage for Yoshimura crease pattern. ''' def create_cp(): # begin from oricreate.api import CreasePatternState import numpy as np x = np.array([[0, 0, 0], [1, 0, 0], [1, 1, 0], [2, 1, 0] ...
gpl-3.0
compiteing/flask-ponypermission
venv/lib/python2.7/site-packages/pip/_vendor/cachecontrol/controller.py
317
10124
""" The httplib2 algorithms ported for use with requests. """ import re import calendar import time from email.utils import parsedate_tz from pip._vendor.requests.structures import CaseInsensitiveDict from .cache import DictCache from .serialize import Serializer URI = re.compile(r"^(([^:/?#]+):)?(//([^/?#]*))?([^?...
mit
Theer108/invenio
invenio/modules/workflows/definitions.py
13
5875
# -*- coding: utf-8 -*- # # This file is part of Invenio. # Copyright (C) 2014, 2015 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 your option) any...
gpl-2.0
noelevans/sandpit
kaggle/washington_bike_share/knn_normalising.py
1
3166
import datetime import logging import math import random import pandas as pd logging.basicConfig(level=logging.INFO) INPUT_FIELDS = ('holiday', 'workingday', 'temp', 'atemp', 'humidity', 'windspeed', 'hour', 'day_of_year', 'day_of_week') PERIODICS = ('hour', 'day_of_year', 'day_of_week') RESULT_FIE...
mit
gyyu/cmu-debate
node_modules/node-gyp/gyp/pylib/gyp/MSVSVersion.py
1509
17165
# Copyright (c) 2013 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. """Handle version information related to Visual Stuio.""" import errno import os import re import subprocess import sys import gyp import glob class VisualStudi...
mit
jordan-wright/python-wireless-attacks
dnspwn.py
2
1605
from scapy.all import * import time import logging logger = logging.getLogger('main') logging.basicConfig(format='%(levelname)s: %(message)s', level=logging.DEBUG) logger.setLevel(logging.DEBUG) # Set the interface for scapy to use conf.iface = 'mon0' # Set the spoofed response spoofed_ip = 'x.x.x.x' def send_respons...
mit
wangmiao1981/spark
python/pyspark/pandas/tests/test_stats.py
6
18881
# # 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...
apache-2.0
takeshineshiro/keystone
keystone/catalog/schema.py
14
2387
# 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 writing, software # distributed under the Li...
apache-2.0
nyalldawson/QGIS
tests/src/python/test_qgsfieldformatters.py
16
30927
# -*- coding: utf-8 -*- """QGIS Unit tests for field formatters. .. note:: 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 option) any later version. """ ...
gpl-2.0
jtmorgan/hostbot
top_1000_report.py
1
10578
#! /usr/bin/env python from datetime import datetime, timedelta import hb_config import json import pandas as pd import requests from requests_oauthlib import OAuth1 from urllib import parse rt_header = """== Popular articles {date7} to {date1} == Last updated on ~~~~~ {{| class="wikitable sortable" !Rank !Article !...
mit
jerli/sympy
sympy/series/residues.py
84
2386
""" This module implements the Residue function and related tools for working with residues. """ from __future__ import print_function, division from sympy import sympify from sympy.utilities.timeutils import timethis @timethis('residue') def residue(expr, x, x0): """ Finds the residue of ``expr`` at the po...
bsd-3-clause
chrisdunelm/grpc
src/python/grpcio_tests/tests/unit/beta/_beta_features_test.py
13
13790
# Copyright 2015 gRPC 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 writing...
apache-2.0