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
timm/timmnix
pypy3-v5.5.0-linux64/lib-python/3/encodings/tis_620.py
272
12300
""" Python Character Mapping Codec tis_620 generated from 'python-mappings/TIS-620.TXT' with gencodec.py. """#" import codecs ### Codec APIs class Codec(codecs.Codec): def encode(self,input,errors='strict'): return codecs.charmap_encode(input,errors,encoding_table) def decode(self,input,errors='st...
mit
vhda/ctags
Test/simple.py
85
1037
"""A long string literal """ from bsddb import btopen # Public global constants VERSION = '1.2.0' # Flags for list() and children() ALL = 0xff KEY = 0x01 TREEID = 0x02 INDENT = 0x04 DATA = 0x08 # Used by dbtreedata class one: x = lambda x: x y = 0 def __init__(self, filename, pathsep='', treegap...
gpl-2.0
JAOSP/aosp_platform_external_chromium_org
native_client_sdk/src/build_tools/sdk_tools/command/info.py
160
1162
# Copyright (c) 2012 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import command_common import logging import manifest_util def Info(manifest, bundle_names): valid_bundles, invalid_bundles = command_common.GetValidBu...
bsd-3-clause
yafeunteun/wikipedia-spam-classifier
revscoring/revscoring/utilities/fit.py
1
2484
""" ``revscoring fit -h`` :: Fits a dependent (an extractable value like a Datasource or Feature) to observed data. These are often used along with bag-of-words methods to reduce the feature space prior to training and testing a model or to train a sub-model. Usage: fit -h | --help ...
mit
indevgr/django
django/conf/locale/en_AU/formats.py
504
2117
# -*- encoding: utf-8 -*- # This file is distributed under the same license as the Django package. # from __future__ import unicode_literals # The *_FORMAT strings use the Django date format syntax, # see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date DATE_FORMAT = 'j M Y' # '25 Oc...
bsd-3-clause
eethomas/eucalyptus
clc/eucadmin/eucadmin/deregisterarbitrator.py
7
1487
# Copyright 2011-2012 Eucalyptus Systems, Inc. # # Redistribution and use of this software 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 ...
gpl-3.0
yotchang4s/cafebabepy
src/main/python/test/test_importlib/source/test_path_hook.py
11
1190
from .. import util machinery = util.import_importlib('importlib.machinery') import unittest class PathHookTest: """Test the path hook for source.""" def path_hook(self): return self.machinery.FileFinder.path_hook((self.machinery.SourceFileLoader, self.machinery.SOURCE_SUFFIXES)) ...
bsd-3-clause
hkariti/ansible
test/runner/lib/http.py
81
4729
""" Primitive replacement for requests to avoid extra dependency. Avoids use of urllib2 due to lack of SNI support. """ from __future__ import absolute_import, print_function import json import time try: from urllib import urlencode except ImportError: # noinspection PyCompatibility, PyUnresolvedReferences ...
gpl-3.0
mbroadst/rethinkdb
drivers/python/rethinkdb/_restore.py
7
9211
#!/usr/bin/env python '''`rethinkdb restore` loads data into a RethinkDB cluster from an archive''' from __future__ import print_function import copy, datetime, multiprocessing, optparse, os, shutil, sys, tarfile, tempfile, time, traceback from . import net, utils_common, _import usage = "rethinkdb restore FILE [-c...
agpl-3.0
ojake/django
tests/template_tests/templatetags/inclusion.py
174
8479
import operator from django.template import Engine, Library from django.utils import six engine = Engine(app_dirs=True) register = Library() @register.inclusion_tag('inclusion.html') def inclusion_no_params(): """Expected inclusion_no_params __doc__""" return {"result": "inclusion_no_params - Expected resul...
bsd-3-clause
xzturn/tensorflow
tensorflow/python/ops/signal/shape_ops.py
3
9270
# 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
blackzw/openwrt_sdk_dev1
staging_dir/target-mips_r2_uClibc-0.9.33.2/usr/lib/python2.7/test/test_netrc.py
69
3715
import netrc, os, unittest, sys, textwrap from test import test_support temp_filename = test_support.TESTFN class NetrcTestCase(unittest.TestCase): def tearDown(self): os.unlink(temp_filename) def make_nrc(self, test_data): test_data = textwrap.dedent(test_data) mode = 'w' if...
gpl-2.0
mwv/scikit-learn
sklearn/utils/sparsetools/_graph_validation.py
364
2407
from __future__ import division, print_function, absolute_import import numpy as np from scipy.sparse import csr_matrix, isspmatrix, isspmatrix_csc from ._graph_tools import csgraph_to_dense, csgraph_from_dense,\ csgraph_masked_from_dense, csgraph_from_masked DTYPE = np.float64 def validate_graph(csgraph, direc...
bsd-3-clause
ppries/tensorflow
tensorflow/contrib/slim/python/slim/evaluation.py
6
10502
# 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 applicable ...
apache-2.0
icclab/hurtle_sample_runtime_so
wsgi.py
18
40851
#!/usr/bin/python import os virtenv = os.environ['OPENSHIFT_PYTHON_DIR'] + '/virtenv/' virtualenv = os.path.join(virtenv, 'bin/activate_this.py') try: execfile(virtualenv, dict(__file__=virtualenv)) except IOError: pass # # IMPORTANT: Put any additional includes below this line. If placed above this # line, i...
apache-2.0
stensonowen/spim-grader
spim-grader.py
2
3172
#!/usr/bin/python ''' SPIM Auto-grader Owen Stenson Grades every file in the 'submissions' folder using every test in the 'samples' folder. Writes to 'results' folder. ''' import os, time, re from subprocess import Popen, PIPE, STDOUT def run(fn, sample_input='\n'): #start process and write input p...
gpl-2.0
j29rios/flinchbot
requests/packages/chardet/gb2312freq.py
3132
36011
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Communicator client 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 R...
gpl-3.0
RudoCris/horizon
openstack_dashboard/test/api_tests/lbaas_tests.py
10
16542
# Copyright 2013, Big Switch Networks, 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 applic...
apache-2.0
superdump/cerbero
cerbero/packages/wix_packager.py
21
11202
# cerbero - a multi-platform build system for Open Source software # Copyright (C) 2012 Andoni Morales Alastruey <ylatuya@gmail.com> # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Library General Public # License as published by the Free Software Foundation; eit...
lgpl-2.1
magicrub/MissionPlanner
Lib/site-packages/scipy/misc/tests/test_doccer.py
61
2281
''' Some tests for the documenting decorator and support functions ''' import numpy as np from numpy.testing import assert_equal, assert_raises from nose.tools import assert_true from scipy.misc import doccer docstring = \ """Docstring %(strtest1)s %(strtest2)s %(strtest3)s """ param_doc1 = \ """A...
gpl-3.0
ndingwall/scikit-learn
sklearn/metrics/_plot/tests/test_plot_det_curve.py
11
2224
import pytest import numpy as np from numpy.testing import assert_allclose from sklearn.datasets import load_iris from sklearn.linear_model import LogisticRegression from sklearn.metrics import det_curve from sklearn.metrics import plot_det_curve @pytest.fixture(scope="module") def data(): return load_iris(retu...
bsd-3-clause
acroreiser/LowLatencyKernel
tools/perf/scripts/python/net_dropmonitor.py
1258
1562
# Monitor the system for dropped packets and proudce a report of drop locations and counts import os import sys sys.path.append(os.environ['PERF_EXEC_PATH'] + \ '/scripts/python/Perf-Trace-Util/lib/Perf/Trace') from perf_trace_context import * from Core import * from Util import * drop_log = {} kallsyms = [] def...
gpl-2.0
Azulinho/ansible
lib/ansible/modules/network/cloudengine/ce_link_status.py
65
22134
#!/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
suhe/odoo
addons/payment_ogone/data/ogone.py
107
30329
# -*- coding: utf-8 -*- OGONE_ERROR_MAP = { '0020001001': "Authorization failed, please retry", '0020001002': "Authorization failed, please retry", '0020001003': "Authorization failed, please retry", '0020001004': "Authorization failed, please retry", '0020001005': "Authorization failed, please ret...
gpl-3.0
dnjohnstone/hyperspy
hyperspy/tests/axes/test_axes_manager.py
4
12899
# -*- coding: utf-8 -*- # Copyright 2007-2020 The HyperSpy developers # # This file is part of HyperSpy. # # HyperSpy 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...
gpl-3.0
TheoRettisch/p2pool-aiden
wstools/XMLSchema.py
289
109858
# Copyright (c) 2003, The Regents of the University of California, # through Lawrence Berkeley National Laboratory (subject to receipt of # any required approvals from the U.S. Dept. of Energy). All rights # reserved. # # Copyright (c) 2001 Zope Corporation and Contributors. All Rights Reserved. # # This software is ...
gpl-3.0
peheje/baselines
baselines/ddpg/ddpg.py
5
17098
from copy import copy from functools import reduce import numpy as np import tensorflow as tf import tensorflow.contrib as tc from baselines import logger from baselines.common.mpi_adam import MpiAdam import baselines.common.tf_util as U from baselines.common.mpi_running_mean_std import RunningMeanStd from baselines....
mit
JasonGross/mozjs
testing/mozbase/mozprofile/mozprofile/profile.py
2
17306
# 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/. __all__ = ['Profile', 'FirefoxProfile', 'MetroFirefoxProfile', 'ThunderbirdProfile'] i...
mpl-2.0
FCP-INDI/C-PAC
CPAC/utils/tests/test_datasource.py
1
2537
import os import json from CPAC.pipeline import nipype_pipeline_engine as pe import nipype.interfaces.utility as util from CPAC.utils.test_resources import setup_test_wf from CPAC.utils.datasource import match_epi_fmaps def test_match_epi_fmaps(): # good data to use s3_prefix = "s3://fcp-indi/data/Projects...
bsd-3-clause
ojengwa/oh-mainline
vendor/packages/docutils/test/test_parsers/test_rst/test_directives/test_topics.py
18
5059
#! /usr/bin/env python # $Id: test_topics.py 7062 2011-06-30 22:14:29Z milde $ # Author: David Goodger <goodger@python.org> # Copyright: This module has been placed in the public domain. """ Tests for the "topic" directive. """ from __init__ import DocutilsTestSupport def suite(): s = DocutilsTestSupport.Parser...
agpl-3.0
OpenTrons/opentrons-api
api/src/opentrons/system/camera.py
3
1170
import asyncio import os from pathlib import Path from opentrons.config import IS_OSX class CameraException(Exception): pass async def take_picture(filename: Path, loop: asyncio.AbstractEventLoop = None): """ Take a picture and save it to filename :param filename: Name of fil...
apache-2.0
mmllr/MMFlowView
scripts/objc_dep.py
3
6277
#!/usr/bin/python # Nicolas Seriot # 2011-01-06 -> 2011-12-16 # https://github.com/nst/objc_dep/ """ Input: path of an Objective-C project Output: import dependencies Graphviz format Typical usage: $ python objc_dep.py /path/to/project [-x regex] [-i subfolder [subfolder ...]] > graph.dot The .dot file can be open...
mit
igemsoftware/SYSU-Software2013
project/Python27/Lib/site-packages/flask/views.py
140
5610
# -*- coding: utf-8 -*- """ flask.views ~~~~~~~~~~~ This module provides class-based views inspired by the ones in Django. :copyright: (c) 2011 by Armin Ronacher. :license: BSD, see LICENSE for more details. """ from .globals import request http_method_funcs = frozenset(['get', 'post', 'head', '...
mit
HelloAWorld/NoahGameFrame
Dependencies/protobuf-2.5.0/python/google/protobuf/text_format.py
61
22180
# Protocol Buffers - Google's data interchange format # Copyright 2008 Google Inc. All rights reserved. # http://code.google.com/p/protobuf/ # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions o...
apache-2.0
stackforge/networking-mlnx
doc/source/conf.py
2
2469
# -*- coding: utf-8 -*- # 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...
apache-2.0
cyberark-bizdev/ansible
test/units/module_utils/basic/test_no_log.py
53
6160
# -*- coding: utf-8 -*- # (c) 2015, Toshio Kuratomi <tkuratomi@ansible.com> # (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 from ansible.compat.tests import un...
gpl-3.0
luiscberrocal/django_quiz_factory
django_quiz_factory/quiz/models.py
2
18611
from __future__ import unicode_literals import re import json from django.db import models from django.core.exceptions import ValidationError from django.core.validators import MaxValueValidator from django.utils.translation import ugettext as _ from django.utils.timezone import now from django.utils.encoding import p...
mit
lahosken/pants
src/python/pants/init/options_initializer.py
5
6563
# coding=utf-8 # Copyright 2016 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import (absolute_import, division, generators, nested_scopes, print_function, unicode_literals, with_statement) import logging impor...
apache-2.0
jjffryan/pymtl
accel/mvmult/MatrixVecLaneRTL_test.py
7
10181
#============================================================================== # MatrixVecLaneBL_test #============================================================================== import pytest from pymtl import * from pclib.ifcs import mem_msgs from pclib.test import TestSource, TestMemory from MatrixVe...
bsd-3-clause
styxit/CouchPotatoServer
libs/html5lib/treebuilders/etree.py
721
12609
from __future__ import absolute_import, division, unicode_literals from six import text_type import re from . import _base from .. import ihatexml from .. import constants from ..constants import namespaces from ..utils import moduleFactoryFactory tag_regexp = re.compile("{([^}]*)}(.*)") def getETreeBuilder(Elemen...
gpl-3.0
gnuhub/intellij-community
python/lib/Lib/site-packages/django/contrib/gis/tests/layermap/tests.py
78
12254
import os from decimal import Decimal from django.utils.copycompat import copy from django.utils.unittest import TestCase from django.contrib.gis.gdal import DataSource from django.contrib.gis.tests.utils import mysql from django.contrib.gis.utils.layermapping import LayerMapping, LayerMapError, InvalidDecimal, Missi...
apache-2.0
bowang/tensorflow
tensorflow/contrib/data/__init__.py
3
2402
# 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
jeffreymingyue/ansible
v1/ansible/cache/memcached.py
132
5890
# (c) 2014, Brian Coca, Josh Drake, et al # # 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. ...
gpl-3.0
wreckJ/intellij-community
python/lib/Lib/site-packages/django/utils/importlib.py
445
1229
# Taken from Python 2.7 with permission from/by the original author. import sys def _resolve_name(name, package, level): """Return the absolute name of the module to be imported.""" if not hasattr(package, 'rindex'): raise ValueError("'package' not set to a string") dot = len(package) for x in ...
apache-2.0
Kubuxu/cjdns
node_build/dependencies/libuv/build/gyp/pylib/gyp/generator/eclipse.py
1825
17014
# 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. """GYP backend that generates Eclipse CDT settings files. This backend DOES NOT generate Eclipse CDT projects. Instead, it generates XML files that can be importe...
gpl-3.0
zhaochao/fuel-main
fuelweb_test/tests/test_services.py
4
36313
# Copyright 2013 Mirantis, 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
elishowk/flaskexperiment
commonecouteserver/data/__init__.py
1
6483
# -*- coding: utf-8 -*- # Copyright (c) 2011 CommOnEcoute http://commonecoute.com # # 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. # # This program is distributed in the hope that it...
agpl-3.0
sonnyhu/scipy
scipy/weave/swigptr.py
103
12378
# swigptr.py from __future__ import absolute_import, print_function swigptr_code = """ /*********************************************************************** * $Header$ * swig_lib/python/python.cfg * * Contains variable linking and pointer type-checking code. ***************************************************...
bsd-3-clause
MalloyPower/parsing-python
front-end/testsuite-python-lib/Python-2.7/Lib/sqlite3/test/userfunctions.py
16
13208
#-*- coding: ISO-8859-1 -*- # pysqlite2/test/userfunctions.py: tests for user-defined functions and # aggregates. # # Copyright (C) 2005-2007 Gerhard Häring <gh@ghaering.de> # # This file is part of pysqlite. # # This software is provided 'as-is', without any express or implied # warran...
mit
Timus1712/boto
tests/integration/ec2/test_cert_verification.py
3
1502
# Copyright (c) 2012 Mitch Garnaat http://garnaat.org/ # Copyright (c) 2012 Amazon.com, Inc. or its affiliates. # All rights reserved. # # 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 withou...
mit
ivanhorvath/openshift-tools
ansible/roles/lib_openshift_3.2/library/oc_serviceaccount.py
6
40250
#!/usr/bin/env python # pylint: disable=too-many-lines # ___ ___ _ _ ___ ___ _ _____ ___ ___ # / __| __| \| | __| _ \ /_\_ _| __| \ # | (_ | _|| .` | _|| / / _ \| | | _|| |) | # \___|___|_|\_|___|_|_\/_/_\_\_|_|___|___/_ _____ # | \ / _ \ | \| |/ _ \_ _| | __| \_ _|_ _| # | |) | (_) ...
apache-2.0
petebachant/scipy
scipy/fftpack/basic.py
56
20010
""" Discrete Fourier Transforms - basic.py """ # Created by Pearu Peterson, August,September 2002 from __future__ import division, print_function, absolute_import __all__ = ['fft','ifft','fftn','ifftn','rfft','irfft', 'fft2','ifft2'] from numpy import zeros, swapaxes import numpy from . import _fftpack im...
bsd-3-clause
alexherns/biotite-scripts
cluster_coverage.py
1
2808
#!/usr/bin/env python2.7 import sys, operator, argparse from Bio import SeqIO parser = argparse.ArgumentParser(description='''Prints out the coverage values for each cluster, by sample and total. Also lists number of hits in each cluster.''', formatter_class=argparse.ArgumentDefaultsHelpFormatter, add_help=False, epil...
mit
alexanderturner/ansible
lib/ansible/modules/network/nxos/nxos_pim_rp_address.py
8
12638
#!/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
diorcety/intellij-community
python/lib/Lib/site-packages/django/utils/tree.py
310
5778
""" A class for storing a tree graph. Primarily used for filter constructs in the ORM. """ from django.utils.copycompat import deepcopy class Node(object): """ A single internal node in the tree graph. A Node should be viewed as a connection (the root) with the children being either leaf nodes or other ...
apache-2.0
mythmon/airmozilla
airmozilla/starred/tests/test_context_processors.py
12
1985
from nose.tools import eq_ from django.test.client import RequestFactory from django.contrib.auth.models import User, AnonymousUser from airmozilla.main.models import Event from airmozilla.base.tests.testbase import DjangoTestCase from airmozilla.starred.models import StarredEvent from airmozilla.starred.context_proc...
bsd-3-clause
mackong/gitql
prettytable/prettytable.py
1
54214
#!/usr/bin/env python # # Copyright (c) 2009-2013, Luke Maurits <luke@maurits.id.au> # All rights reserved. # With contributions from: # * Chris Clark # * Klein Stephane # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met:...
mit
wrouesnel/ansible
lib/ansible/modules/cloud/rackspace/rax_mon_notification_plan.py
45
5675
#!/usr/bin/python # Copyright: 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.1', 'status': ['preview'], ...
gpl-3.0
mjudsp/Tsallis
sklearn/metrics/tests/test_score_objects.py
23
15933
import pickle import tempfile import shutil import os import numbers import numpy as np from sklearn.utils.testing import assert_almost_equal from sklearn.utils.testing import assert_array_equal from sklearn.utils.testing import assert_raises from sklearn.utils.testing import assert_raises_regexp from sklearn.utils.t...
bsd-3-clause
chrisenuf/fullerite
src/diamond/collectors/ipmisensor/test/testipmisensor.py
29
3995
#!/usr/bin/python # coding=utf-8 ################################################################################ from test import CollectorTestCase from test import get_collector_config from test import unittest from mock import Mock from mock import patch from diamond.collector import Collector from ipmisensor impo...
apache-2.0
powerlim2/project_free_insight
data_api/venv/lib/python2.7/site-packages/pip/_vendor/requests/packages/chardet/eucjpprober.py
2919
3678
######################## 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...
bsd-3-clause
croxis/SpaceDrive
spacedrive/renderpipeline/rpplugins/vxgi/voxelization_stage.py
1
8394
""" RenderPipeline Copyright (c) 2014-2016 tobspr <tobias.springer1@gmail.com> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the right...
mit
gfarmerfr/nicotine-plus
pynicotine/pynicotine.py
2
73335
# -*- coding: utf-8 -*- # # COPYRIGHT (C) 2016-2017 Michael Labouebe <gfarmerfr@free.fr> # COPYRIGHT (C) 2016 Mutnick <muhing@yahoo.com> # COPYRIGHT (C) 2013 eL_vErDe <gandalf@le-vert.net> # COPYRIGHT (C) 2008-2012 Quinox <quinox@users.sf.net> # COPYRIGHT (C) 2009 Hedonist <ak@sensi.org> # COPYRIGHT (C) 2006-2009 Daels...
gpl-3.0
cliftonmcintosh/openstates
openstates/md/committees.py
2
6091
import lxml.html from billy.scrape.committees import CommitteeScraper, Committee def clean_name(com_name): if com_name.startswith("Joint "): com_name = com_name.replace("Joint ", "", 1) com_name = com_name.replace("Special Committee on ", "") com_name = com_name.replace("Committee on ", "") i...
gpl-3.0
yashodhank/erpnext
erpnext/stock/report/itemwise_recommended_reorder_level/itemwise_recommended_reorder_level.py
37
3345
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals import frappe from frappe import _ from frappe.utils import getdate, flt def execute(filters=None): if not filters: filters = {} float_preceision = f...
agpl-3.0
rameshg87/pyremotevbox
pyremotevbox/ZSI/twisted/WSsecurity.py
1
13760
########################################################################### # Joshua R. Boverhof, LBNL # See Copyright for copyright notice! # $Id: WSsecurity.py 1134 2006-02-24 00:23:06Z boverhof $ ########################################################################### import sys, time, warnings import sha, base6...
apache-2.0
o5k/openerp-oemedical-v0.1
openerp/addons/smsclient/smsclient.py
1
17026
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). # Copyright (C) 2011 SYLEAM (<http://syleam.fr/>) # Copyright (C) 2013 Julius Network Solutions SARL <co...
agpl-3.0
mrquim/repository.mrquim
plugin.program.indigo/libs/requests/packages/urllib3/util/retry.py
86
14123
from __future__ import absolute_import import time import logging from collections import namedtuple from itertools import takewhile import email import re from ..exceptions import ( ConnectTimeoutError, MaxRetryError, ProtocolError, ReadTimeoutError, ResponseError, InvalidHeader, ) from ..pack...
gpl-2.0
crtrott/lammps
tools/moltemplate/src/nbody_Dihedrals.py
19
2460
from nbody_graph_search import Ugraph # This file defines how dihedral interactions are generated by moltemplate.sh # by default. It can be overridden by supplying your own custom file. # To find 4-body "dihedral" interactions, we would use this subgraph: # # 1st bond connects atoms 0...
gpl-2.0
40223214/-2015cd_midterm2
static/Brython3.1.1-20150328-091302/Lib/posixpath.py
722
14212
"""Common operations on Posix pathnames. Instead of importing this module directly, import os and refer to this module as os.path. The "os.path" name is an alias for this module on Posix systems; on other systems (e.g. Mac, Windows), os.path provides the same operations in a manner specific to that platform, and is a...
agpl-3.0
bloyl/mne-python
tutorials/inverse/30_mne_dspm_loreta.py
3
5666
""" .. _tut-inverse-methods: Source localization with MNE/dSPM/sLORETA/eLORETA ================================================= The aim of this tutorial is to teach you how to compute and apply a linear minimum-norm inverse method on evoked/raw/epochs data. """ import os.path as op import numpy as np import matplo...
bsd-3-clause
snickl/buildroot-iu
support/testing/infra/builder.py
3
2028
import os import shutil import subprocess import infra class Builder(object): def __init__(self, config, builddir, logtofile): self.config = '\n'.join([line.lstrip() for line in config.splitlines()]) + '\n' self.builddir = builddir self.logfile = infra.ope...
gpl-2.0
bderembl/mitgcm_configs
eddy_airsea/analysis/ode_wave.py
1
1112
#!/usr/bin/env python import numpy as np import matplotlib.pyplot as plt import scipy.integrate as integrate plt.ion() f0 = 1e-4 u0 = 1.0 R0 = 40e3 # radius vmax = -1.0 # m/s def v1(rr): v = -vmax*rr/R0*np.exp(-0.5*(rr/R0)**2) # v = -vmax*np.tanh(rr/R0)/(np.cosh(rr/R0))**2/(np.tanh(1.0)/(np.cosh(1.0))...
mit
wndias/bc.repository
script.module.youtube.dl/lib/youtube_dl/extractor/chilloutzone.py
169
3600
from __future__ import unicode_literals import re import base64 import json from .common import InfoExtractor from ..utils import ( clean_html, ExtractorError ) class ChilloutzoneIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?chilloutzone\.net/video/(?P<id>[\w|-]+)\.html' _TESTS = [{ '...
gpl-2.0
Changaco/oh-mainline
vendor/packages/twisted/twisted/scripts/test/test_tap2rpm.py
18
12479
# Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ Tests for L{twisted.scripts.tap2rpm}. """ import os from twisted.trial.unittest import TestCase, SkipTest from twisted.python import procutils from twisted.python.failure import Failure from twisted.internet import utils from twisted.scripts i...
agpl-3.0
gilneidp/FinalProject
ALL_FILES/pox/messenger/example.py
46
3835
# Copyright 2011,2012 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 ...
mit
xxsergzzxx/python-for-android
python3-alpha/python3-src/Lib/distutils/command/build_py.py
46
16957
"""distutils.command.build_py Implements the Distutils 'build_py' command.""" import sys, os import sys from glob import glob from distutils.core import Command from distutils.errors import * from distutils.util import convert_path, Mixin2to3 from distutils import log class build_py (Command): description = "\...
apache-2.0
MIPS/external-chromium_org
tools/telemetry/telemetry/page/actions/wait.py
33
2372
# Copyright (c) 2012 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import time from telemetry.core import util from telemetry.page.actions import page_action class WaitAction(page_action.PageAction): DEFAULT_TIMEOUT =...
bsd-3-clause
Opentrons/labware
api/src/opentrons/calibration_storage/helpers.py
2
2397
""" opentrons.calibration_storage.helpers: various miscellaneous functions This module has functions that you can import to save robot or labware calibration to its designated file location. """ import typing import json from hashlib import sha256 from . import types as local_types if typing.TYPE_CHECKING: from...
apache-2.0
cmc333333/regulations-parser
regparser/tree/paragraph.py
1
6226
import hashlib import re from regparser.tree import struct from regparser.tree.depth import markers as mtypes from regparser.search import segments p_levels = [list(mtypes.lower), list(mtypes.ints), list(mtypes.roman), list(mtypes.upper), list(mtypes.em_ints), list(mtypes.em_roman)] def p_level_of(mark...
cc0-1.0
ivanbusthomi/inasafe
safe/test/test_init.py
15
1925
# coding=utf-8 """Tests for map creation in QGIS plugin.""" __author__ = 'Tim Sutton <tim@kartoza.com>' __revision__ = '$Format:%H$' __date__ = '17/10/2010' __license__ = "GPL" __copyright__ = 'Copyright 2012, Australia Indonesia Facility for ' __copyright__ += 'Disaster Reduction' import os import unittest import lo...
gpl-3.0
louiskun/flaskGIT
venv/lib/python2.7/site-packages/sqlalchemy/sql/ddl.py
34
37540
# sql/ddl.py # Copyright (C) 2009-2016 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 """ Provides the hierarchy of DDL-defining schema items as well as routines to invoke them...
mit
jhawkesworth/ansible
lib/ansible/modules/notification/catapult.py
52
4251
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2016, Jonathan Mainguy <jon@soh.re> # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # # basis of code taken from the ansible twillio and nexmo modules from __future__ import absolute_import, division, print_function __metacla...
gpl-3.0
DanielSBrown/osf.io
scripts/approve_embargo_terminations.py
17
2819
"""EmbargoTerminationApprovals are the Sanction subclass that allows users to make Embargoes public before the official end date. Like RegistrationAprpovals and Embargoes, if an admin fails to approve or reject this request within 48 hours it is approved automagically. Run nightly, this script will approve any embarg...
apache-2.0
cyberden/CouchPotatoServer
couchpotato/core/media/movie/providers/trailer/youtube_dl/extractor/space.py
127
1528
from __future__ import unicode_literals import re from .common import InfoExtractor from .brightcove import BrightcoveIE from ..utils import RegexNotFoundError, ExtractorError class SpaceIE(InfoExtractor): _VALID_URL = r'https?://(?:(?:www|m)\.)?space\.com/\d+-(?P<title>[^/\.\?]*?)-video\.html' _TEST = { ...
gpl-3.0
sbalde/edx-platform
common/djangoapps/student/tests/test_verification_status.py
20
14997
"""Tests for per-course verification status on the dashboard. """ from datetime import datetime, timedelta import unittest import ddt from mock import patch from pytz import UTC from django.core.urlresolvers import reverse from django.conf import settings from student.helpers import ( VERIFY_STATUS_NEED_TO_VERIFY...
agpl-3.0
JoseBlanca/ngs_crumbs
test/seq/test_guess_seq_format.py
1
8427
# Copyright 2012 Jose Blanca, Peio Ziarsolo, COMAV-Univ. Politecnica Valencia # This file is part of ngs_crumbs. # ngs_crumbs 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, ...
gpl-3.0
eamars/webserver
site-package/roster/sql.py
1
4194
import mysql.connector SQL_CREATE_TABLE = \ """ CREATE TABLE `{}` ( `date` date NOT NULL UNIQUE, `chair` char(64) NOT NULL DEFAULT '', `minute` char(64) NOT NULL DEFAULT '', PRIMARY KEY (`date`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 """ def create_database(cursor, database_name): try: curs...
mit
vhanla/CudaText
app/cudatext.app/Contents/Resources/py/cuda_addonman/work_cudatext_updates.py
4
2356
import sys import os import re import platform import tempfile import webbrowser import cudatext as app from .work_remote import * p = sys.platform X64 = platform.architecture()[0]=='64bit' ##p = 'win32' ##X64 = False DOWNLOAD_PAGE = \ 'https://sourceforge.net/projects/cudatext/files/release/Linux/' if p.startswi...
mpl-2.0
YongseopKim/coreclr
src/ToolBox/SOS/tests/t_cmd_name2ee.py
43
1390
import lldb import re import testutils as test def runScenario(assembly, debugger, target): process = target.GetProcess() res = lldb.SBCommandReturnObject() ci = debugger.GetCommandInterpreter() # Run debugger, wait until libcoreclr is loaded, # set breakpoint at Test.Main and stop there test...
mit
coberger/DIRAC
WorkloadManagementSystem/JobWrapper/WatchdogLinux.py
4
4118
######################################################################## # $HeadURL$ # Author: Stuart Paterson # eMail : Stuart.Paterson@cern.ch ######################################################################## """ The Watchdog class is used by the Job Wrapper to resolve and monitor the system CPU and mem...
gpl-3.0
Gateworks/platform-external-chromium_org
third_party/protobuf/python/google/protobuf/internal/wire_format.py
561
8431
# Protocol Buffers - Google's data interchange format # Copyright 2008 Google Inc. All rights reserved. # http://code.google.com/p/protobuf/ # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions o...
bsd-3-clause
elizahyde/goog-python-learning
basic/solution/list2.py
207
2774
#!/usr/bin/python -tt # 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/ # Additional basic list exercises # D. Given a list of numbers, return a list where # al...
apache-2.0
crazy-cat/incubator-mxnet
example/speech-demo/lstm_proj.py
25
7073
# 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
hoytak/SFrame
cxxtest/python/cxxtest/cxxtest_fog.py
55
4022
#------------------------------------------------------------------------- # CxxTest: A lightweight C++ unit testing library. # Copyright (c) 2008 Sandia Corporation. # This software is distributed under the LGPL License v3 # For more information, see the COPYING file in the top CxxTest directory. # Under the terms of ...
bsd-3-clause
shear/rppy
rppy/fluid.py
2
5952
#!/usr/bin/env python # -*- coding: utf-8 -*- # rppy - a geophysical library for Python # Copyright (c) 2014, Sean M. Contenti # 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. Re...
bsd-2-clause
cmacmackin/ford
ford/graphs.py
1
48315
#!/usr/bin/env python # -*- coding: utf-8 -*- # # graphs.py # This file is part of FORD. # # Copyright 2015 Christopher MacMackin <cmacmackin@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 Softwa...
gpl-3.0
WillGuan105/django
tests/signed_cookies_tests/tests.py
288
2768
from __future__ import unicode_literals from django.core import signing from django.http import HttpRequest, HttpResponse from django.test import SimpleTestCase, override_settings from django.test.utils import freeze_time class SignedCookieTest(SimpleTestCase): def test_can_set_and_read_signed_cookies(self): ...
bsd-3-clause
otron/zenodo
zenodo/base/upgrades/zenodo_2015_06_10_fix_alternate_identifiers.py
2
4755
# -*- 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-3.0
popazerty/dvbapp-gui2
lib/python/Components/NetworkTime.py
24
1473
from Components.Console import Console from config import config from enigma import eTimer, eDVBLocalTimeHandler, eEPGCache from Tools.StbHardware import setRTCtime from time import time # _session = None # def AutoNTPSync(session=None, **kwargs): global ntpsyncpoller ntpsyncpoller = NTPSyncPoller() ntpsyncpoller.s...
gpl-2.0