repo_name
stringlengths
5
100
path
stringlengths
4
294
copies
stringclasses
990 values
size
stringlengths
4
7
content
stringlengths
666
1M
license
stringclasses
15 values
raghavrv/scikit-learn
sklearn/ensemble/tests/test_forest.py
6
42990
""" Testing for the forest module (sklearn.ensemble.forest). """ # Authors: Gilles Louppe, # Brian Holt, # Andreas Mueller, # Arnaud Joly # License: BSD 3 clause import pickle from collections import defaultdict from itertools import combinations from itertools import product import numpy ...
bsd-3-clause
ahhda/sympy
sympy/core/tests/test_trace.py
99
2825
from sympy import symbols, Matrix, Tuple from sympy.core.trace import Tr from sympy.utilities.pytest import raises def test_trace_new(): a, b, c, d, Y = symbols('a b c d Y') A, B, C, D = symbols('A B C D', commutative=False) assert Tr(a + b) == a + b assert Tr(A + B) == Tr(A) + Tr(B) #check trac...
bsd-3-clause
3dfxmadscientist/CBSS
addons/resource/__openerp__.py
57
1993
# -*- 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
markeTIC/l10n-spain
l10n_es_aeat_mod115/__openerp__.py
2
1446
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution. # # 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 Sof...
agpl-3.0
davidwilson-85/easymap
graphic_output/Pillow-4.2.1/Tests/test_imagefont_bitmap.py
1
1533
from helper import unittest, PillowTestCase from PIL import Image, ImageFont, ImageDraw image_font_installed = True try: ImageFont.core.getfont except ImportError: image_font_installed = False @unittest.skipIf(not image_font_installed, "image font not installed") class TestImageFontBitmap(PillowTestCase): ...
gpl-3.0
amjames/psi4
psi4/driver/qcdb/orca.py
1
13098
# # @BEGIN LICENSE # # Psi4: an open-source quantum chemistry software package # # Copyright (c) 2007-2018 The Psi4 Developers. # # The copyrights for code used from other parties are included in # the corresponding files. # # This file is part of Psi4. # # Psi4 is free software; you can redistribute it and/or modify #...
lgpl-3.0
petermalcolm/osf.io
website/files/models/figshare.py
2
1360
from website.util.sanitize import escape_html from website.files.models.base import File, Folder, FileNode, FileVersion __all__ = ('FigshareFile', 'FigshareFolder', 'FigshareFileNode') class FigshareFileNode(FileNode): provider = 'figshare' class FigshareFolder(FigshareFileNode, Folder): pass class Figs...
apache-2.0
anushreejangid/csm-ut
csmpe/core_plugins/csm_install_operations/ios_xe/utils.py
1
18972
# ============================================================================= # # Copyright (c) 2016, Cisco Systems # 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 ...
bsd-2-clause
smalls257/VRvisu
Library/External.LCA_RESTRICTED/Languages/CPython/27/Lib/encodings/utf_16.py
404
3984
""" Python 'utf-16' Codec Written by Marc-Andre Lemburg (mal@lemburg.com). (c) Copyright CNRI, All Rights Reserved. NO WARRANTY. """ import codecs, sys ### Codec APIs encode = codecs.utf_16_encode def decode(input, errors='strict'): return codecs.utf_16_decode(input, errors, True) class IncrementalEncoder(c...
gpl-3.0
adnanh/zulip
zerver/templatetags/minified_js.py
118
1402
from __future__ import absolute_import from django.template import Node, Library, TemplateSyntaxError from django.conf import settings from django.contrib.staticfiles.storage import staticfiles_storage register = Library() class MinifiedJSNode(Node): def __init__(self, sourcefile): self.sourcefile = sour...
apache-2.0
tnemisteam/cdf-steps
teacher/views/teacher_professional_views.py
1
4299
from django.views.generic import ListView, DetailView, CreateView, \ DeleteView, UpdateView, \ ArchiveIndexView, DateDetailView, \ DayArchiveView, MonthArchiveView, \ TodayArchiveView, Wee...
mit
fighterCui/L4ReFiascoOC
l4/pkg/python/contrib/Lib/xml/etree/__init__.py
183
1604
# $Id: __init__.py 1821 2004-06-03 16:57:49Z fredrik $ # elementtree package # -------------------------------------------------------------------- # The ElementTree toolkit is # # Copyright (c) 1999-2004 by Fredrik Lundh # # By obtaining, using, and/or copying this software and/or its # associated documentation, you ...
gpl-2.0
kumar-abhishek/algorithms-1
cake/rotated.py
3
3678
#! opt/local/bin/python3 import sys ''' Given huge array of words, find rotation point. Array is sorted, but has been shifted so start of sorted section is not at the front. ''' def find_rotation_point_iterative(arr, lower, upper): while lower <= upper: partition = (int)((upper + lower + 1) / 2) if partition - 1...
mit
pedroernesto/morphounit
morphounit/tests/morph_cells/test_NeuroM_MorphStats.py
1
20138
import sciunit import sciunit.scores as sci_scores import morphounit.scores as mph_scores # import morphounit.capabilities as mph_cap import morphounit.plots as mph_plots import os import copy import json import neurom as nm import numpy as np import quantities class NeuroM_MorphStats_Test(sciunit.Test): """Te...
bsd-3-clause
jonathanunderwood/numpy
numpy/core/tests/test_function_base.py
68
4911
from __future__ import division, absolute_import, print_function from numpy import (logspace, linspace, dtype, array, finfo, typecodes, arange, isnan) from numpy.testing import ( TestCase, run_module_suite, assert_, assert_equal, assert_raises, assert_array_equal ) class TestLogspace(TestC...
bsd-3-clause
x303597316/hue
desktop/core/ext-py/tablib-0.10.0/tablib/packages/odf3/anim.py
56
1872
# -*- coding: utf-8 -*- # Copyright (C) 2006-2007 Søren Roug, European Environment Agency # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at you...
apache-2.0
ruibarreira/linuxtrail
usr/lib/python2.7/dist-packages/chardet/jpcntx.py
1777
19348
######################## 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
nschloe/pynosh
pynosh/modelevaluator_nls.py
1
15288
# -*- coding: utf-8 -*- # """ Provide information around the nonlinear Schrödinger equations. """ import numpy from scipy import sparse import warnings import krypy class NlsModelEvaluator(object): """Nonlinear Schrödinger model evaluator class. Incorporates * Nonlinear Schrödinger: :math:`g=1.0, V=0....
mit
SmartInfrastructures/fuel-web-dev
nailgun/nailgun/test/integration/test_node_handler.py
1
12873
# -*- coding: utf-8 -*- # 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 requi...
apache-2.0
junwucs/h2o-3
py2/testdir_multi_jvm/test_GLM_basic_2.py
21
3529
import unittest, time, sys, random sys.path.extend(['.','..','../..','py']) import h2o2 as h2o import h2o_cmd, h2o_import as h2i, h2o_jobs, h2o_glm from h2o_test import verboseprint, dump_json, OutputObj class Basic(unittest.TestCase): def tearDown(self): h2o.check_sandbox_for_errors() @classmethod ...
apache-2.0
40423241/2016fallcadp_hw
plugin/liquid_tags/include_code.py
246
4490
""" Include Code Tag ---------------- This implements a Liquid-style video tag for Pelican, based on the octopress video tag [1]_ Syntax ------ {% include_code path/to/code [lang:python] [Title text] [codec:utf8] %} The "path to code" is specified relative to the ``code`` subdirectory of the content directory Option...
agpl-3.0
thnee/ansible
test/units/modules/network/exos/test_exos_command.py
38
4585
# # (c) 2018 Extreme Networks 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 version. # # Ans...
gpl-3.0
jackbrucesimpson/beeunique
src/Processor/PathAssembly/processpaths.py
1
2618
from beedata import BeeData from Processor.Utils.imageutils import gen_gap_coords from Processor.Utils import constants class ProcessPaths(object): def __init__(self): pass def process_paths(self, bee_df): x_list = bee_df['x'].tolist() y_list = bee_df['y'].tolist() frame_nums_...
mit
team-xue/xue
xue/accounts/migrations/0015_delete_major_attr_in_favor_of_klass.py
1
7144
# encoding: utf-8 import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Deleting field 'DMUserProfile.major' db.delete_column('accounts_dmuserprofile', 'major') ...
bsd-3-clause
paul-herrmann/server-examples
python/django-fine-uploader/fine_uploader/utils.py
4
1385
import os, os.path, shutil def combine_chunks(total_parts, total_size, source_folder, dest): """ Combine a chunked file into a whole file again. Goes through each part , in order, and appends that part's bytes to another destination file. Chunks are stored in media/chunks Uploads are saved in media/up...
mit
reyha/zulip
zerver/lib/ccache.py
9
7580
from __future__ import absolute_import from typing import Any, Dict, Optional #!/usr/bin/env python # This file is adapted from samples/shellinabox/ssh-krb-wrapper in # https://github.com/davidben/webathena, which has the following # license: # # Copyright (c) 2013 David Benjamin and Alan Huang # # Permission is hereb...
apache-2.0
kartikm/hy
tests/test_models.py
2
4870
# Copyright 2018 the authors. # This file is part of Hy, which is free software licensed under the Expat # license. See the LICENSE. import copy import hy from clint.textui.colored import clean from hy._compat import long_type, str_type from hy.models import (wrap_value, replace_hy_obj, HyString, HyInteger, HyList, ...
mit
ioanpocol/superdesk-core
superdesk/storage/desk_media_storage.py
2
5576
# -*- coding: utf-8; -*- # # This file is part of Superdesk. # # Copyright 2013, 2014 Sourcefabric z.u. and contributors. # # For the full copyright and license information, please see the # AUTHORS and LICENSE files distributed with this source code, or # at https://www.sourcefabric.org/superdesk/license import loggi...
agpl-3.0
freephys/python_ase
ase/utils/memory.py
12
16716
import os import numpy as np from UserDict import DictMixin # ------------------------------------------------------------------- class MemoryBase(object, DictMixin): """Virtual memory (VM) statistics of the current process obtained from the relevant entries in /proc/<pid>/status: VmPeak Peak virtu...
gpl-3.0
wglass/lighthouse
tests/peer_tests.py
1
2899
try: import unittest2 as unittest except ImportError: import unittest import json from mock import patch from lighthouse.peer import Peer class PeerTests(unittest.TestCase): def test_default_port(self): peer = Peer("service02", "1.2.3.4") self.assertEqual(peer.port, 1024) @patch(...
apache-2.0
janpetras/henley
node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/msvs.py
372
124844
# Copyright (c) 2012 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import collections import copy import ntpath import os import posixpath import re import subprocess import sys import gyp.common import gyp.easy_xml as easy_xml i...
gpl-3.0
selboo/paramiko
tests/loop.py
27
2848
# Copyright (C) 2003-2009 Robey Pointer <robeypointer@gmail.com> # # This file is part of paramiko. # # Paramiko is free software; you can redistribute it and/or modify it under the # terms of the GNU Lesser General Public License as published by the Free # Software Foundation; either version 2.1 of the License, or (a...
lgpl-2.1
dermoth/gramps
gramps/gen/filters/rules/_changedsincebase.py
1
3763
# # Gramps - a GTK+/GNOME based genealogy program # # Copyright (C) 2000-2007 Donald N. Allingham # # 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 you...
gpl-2.0
Shrhawk/edx-platform
common/djangoapps/performance/views/__init__.py
100
1765
import datetime import json import logging from django.http import HttpResponse from track.utils import DateTimeJSONEncoder perflog = logging.getLogger("perflog") def _get_request_header(request, header_name, default=''): """Helper method to get header values from a request's META dict, if present.""" if ...
agpl-3.0
marshall007/rethinkdb
external/v8_3.30.33.16/build/gyp/test/win/gyptest-link-defrelink.py
210
1683
#!/usr/bin/env python # 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. """ Make sure a relink is performed when a .def file is touched. """ import TestGyp import sys if sys.platform == 'win32': test = TestG...
agpl-3.0
piffey/ansible
lib/ansible/modules/cloud/cloudscale/cloudscale_floating_ip.py
49
9740
#!/usr/bin/python # -*- coding: utf-8 -*- # # (c) 2017, Gaudenz Steinlin <gaudenz.steinlin@cloudscale.ch> # 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_ve...
gpl-3.0
Dhivyap/ansible
lib/ansible/modules/network/netvisor/pn_vrouter_bgp.py
26
16772
#!/usr/bin/python # Copyright: (c) 2018, Pluribus Networks # 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': ['...
gpl-3.0
rolandmansilla/microblog
flask/lib/python2.7/site-packages/jinja2/sandbox.py
324
13327
# -*- coding: utf-8 -*- """ jinja2.sandbox ~~~~~~~~~~~~~~ Adds a sandbox layer to Jinja as it was the default behavior in the old Jinja 1 releases. This sandbox is slightly different from Jinja 1 as the default behavior is easier to use. The behavior can be changed by subclassing the environm...
bsd-3-clause
lbishal/scikit-learn
examples/gaussian_process/plot_gpr_noisy.py
104
3778
""" ============================================================= Gaussian process regression (GPR) with noise-level estimation ============================================================= This example illustrates that GPR with a sum-kernel including a WhiteKernel can estimate the noise level of data. An illustration...
bsd-3-clause
Yong-Lee/django
tests/template_tests/syntax_tests/test_cache.py
299
6777
from django.core.cache import cache from django.template import Context, Engine, TemplateSyntaxError from django.test import SimpleTestCase, override_settings from ..utils import setup class CacheTagTests(SimpleTestCase): libraries = { 'cache': 'django.templatetags.cache', 'custom': 'template_tes...
bsd-3-clause
eerwitt/tensorflow
tensorflow/python/framework/dtypes.py
12
19135
# 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
karthik339/Agni
MainDemo/flask/lib/python2.7/site-packages/sqlalchemy/dialects/informix/base.py
17
26186
# informix/base.py # Copyright (C) 2005-2012 the SQLAlchemy authors and contributors <see AUTHORS file> # coding: gbk # # This module is part of SQLAlchemy and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php """Support for the Informix database. .. note:: The Informix dial...
apache-2.0
Azure/azure-sdk-for-python
sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/aio/_container_registry_management_client.py
1
4407
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may ...
mit
JukeboxPipeline/jukebox-core
src/jukeboxcore/gui/widgets/actionreportdialog_ui.py
1
4911
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'h:\projects\jukebox-core\src\jukeboxcore\gui\widgets\actionreportdialog.ui' # # Created: Fri Nov 07 16:12:58 2014 # by: pyside-uic 0.2.15 running on PySide 1.2.2 # # WARNING! All changes made in this file will be lost! from PySide impo...
bsd-3-clause
sgraham/nope
third_party/WebKit/Tools/Scripts/webkitpy/common/system/user_mock.py
40
2381
# Copyright (C) 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 of conditions and the f...
bsd-3-clause
ZacharyRSmith/xpython
palindrome-products/palindrome_products_test.py
11
1679
""" Notes regarding the implementation of smallest_palindrome and largest_palindrome: Both functions must take two keyword arguments: max_factor -- int min_factor -- int, default 0 Their return value must be a tuple (value, factors) where value is the palindrome itself, and factors is an iterable containing b...
mit
sporkexec/urmpc
bin/urwid/util.py
7
12807
#!/usr/bin/python # -*- coding: utf-8 -*- # # Urwid utility functions # Copyright (C) 2004-2011 Ian Ward # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version...
gpl-3.0
resmo/ansible
lib/ansible/modules/network/fortimanager/fmgr_fwpol_ipv4.py
21
49820
#!/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
iulian787/spack
lib/spack/external/jinja2/bccache.py
84
12794
# -*- coding: utf-8 -*- """ jinja2.bccache ~~~~~~~~~~~~~~ This module implements the bytecode cache system Jinja is optionally using. This is useful if you have very complex template situations and the compiliation of all those templates slow down your application too much. Situations whe...
lgpl-2.1
entropy1337/infernal-twin
Modules/build/pip/build/lib.linux-i686-2.7/pip/_vendor/colorama/win32.py
446
5121
# Copyright Jonathan Hartley 2013. BSD 3-Clause license, see LICENSE file. # from winbase.h STDOUT = -11 STDERR = -12 try: import ctypes from ctypes import LibraryLoader windll = LibraryLoader(ctypes.WinDLL) from ctypes import wintypes except (AttributeError, ImportError): windll = None SetCon...
gpl-3.0
yufish/youtube-dl
youtube_dl/extractor/macgamestore.py
142
1275
from __future__ import unicode_literals from .common import InfoExtractor from ..utils import ExtractorError class MacGameStoreIE(InfoExtractor): IE_NAME = 'macgamestore' IE_DESC = 'MacGameStore trailers' _VALID_URL = r'https?://www\.macgamestore\.com/mediaviewer\.php\?trailer=(?P<id>\d+)' _TEST = {...
unlicense
smartboyathome/Wonderland-Engine
tests/DoorknobTests/test_mongodb_service_checks.py
1
4975
''' Copyright (c) 2012 Alexander Abbott This file is part of the Cheshire Cyber Defense Scoring Engine (henceforth referred to as Cheshire). Cheshire 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 Sof...
agpl-3.0
mhei/linux
tools/perf/scripts/python/stackcollapse.py
270
4360
# stackcollapse.py - format perf samples with one line per distinct call stack # # This script's output has two space-separated fields. The first is a semicolon # separated stack including the program name (from the "comm" field) and the # function names from the call stack. The second is a count: # # swapper;start_...
gpl-2.0
joanneko/goodbooks
goodbooks/lib/python2.7/site-packages/setuptools/tests/test_dist_info.py
148
2261
"""Test .dist-info style distributions. """ import os import shutil import tempfile import pytest import pkg_resources from .textwrap import DALS class TestDistInfo: def test_distinfo(self): dists = dict( (d.project_name, d) for d in pkg_resources.find_distributions(self.tmpdir)...
bsd-3-clause
akfullfo/rainbarrel
rainbarrel/netjson.py
1
7874
#!/usr/bin/env python # ________________________________________________________________________ # # Copyright (C) 2015 Andrew Fullford # # 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 # #...
apache-2.0
fzalkow/scikit-learn
sklearn/metrics/pairwise.py
104
42995
# -*- coding: utf-8 -*- # Authors: Alexandre Gramfort <alexandre.gramfort@inria.fr> # Mathieu Blondel <mathieu@mblondel.org> # Robert Layton <robertlayton@gmail.com> # Andreas Mueller <amueller@ais.uni-bonn.de> # Philippe Gervais <philippe.gervais@inria.fr> # Lars Buitinck ...
bsd-3-clause
dezelin/vbox
src/VBox/GuestHost/OpenGL/packer/pack_currenttypes.py
16
2163
# Copyright (c) 2001, Stanford University # All rights reserved. # # See the file LICENSE.txt for information on redistributing this software. # This file is imported by several other Python scripts current_fns = { 'Color': { 'types': ['b','ub','s','us','i','ui','f','d'], 'sizes': [3,4], 'default': [0,0,0,1], ...
gpl-2.0
darksidelemm/alltheFSKs
DePacketizer.py
1
7781
#!/usr/bin/env python # DePacktizer.py - Message DePacketizer # As per https://docs.google.com/document/d/1fwUtzFUhTzwjHrbfUayRG5sM_3TzdPlPgWjwXnY8fsU/edit # # Absorbs bits (numpy arrays, strings, whatever), and emits packets, if found. # # Copyright 2014 Mark Jessop <mark.jessop@adelaide.edu.au> # # This library is f...
gpl-3.0
flibbertigibbet/ashlar
tests/settings_test.py
2
2165
""" Django settings for use when testing Ashlar """ # Build paths inside the project like this: os.path.join(BASE_DIR, ...) import os DEVELOP = True PRODUCTION = False BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) SECRET_KEY = 'testing!' ALLOWED_HOSTS = [] # Application definition INSTAL...
mit
leoliujie/odoo
addons/hr_timesheet/wizard/hr_timesheet_sign_in_out.py
340
8789
# -*- 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
mikegraham/dask
dask/dataframe/tests/test_io.py
1
34901
import gzip import pandas as pd import numpy as np import pandas.util.testing as tm import os import dask import pytest from threading import Lock import shutil from time import sleep import threading import dask.array as da import dask.dataframe as dd from dask.dataframe.io import (from_array, from_bcolz, from_dask_a...
bsd-3-clause
SirNicolas/python-telegram-bot
docs/source/conf.py
2
9334
# -*- coding: utf-8 -*- # # Python Telegram Bot documentation build configuration file, created by # sphinx-quickstart on Mon Aug 10 22:25:07 2015. # # 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...
gpl-3.0
EricMuller/mywebmarks-backend
requirements/twisted/Twisted-17.1.0/src/twisted/internet/test/_posixifaces.py
47
4689
# Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ POSIX implementation of local network interface enumeration. """ from __future__ import division, absolute_import import sys, socket from socket import AF_INET, AF_INET6, inet_ntop from ctypes import ( CDLL, POINTER, Structure, c_char_p...
mit
jarryliu/queue-sim
plot/draw.py
1
15784
#!/usr/local/bin/python from math import factorial, exp import numpy as np import matplotlib.pyplot as plt from matplotlib import cm from mpl_toolkits.mplot3d import axes3d, Axes3D #<-- Note the capitalization! import sys intList = [5000, 1000, 500, 100, 50, 10] trate = [1000000.0/i for i in intList] cpuList = [1.0, ...
mit
mcdaniel67/sympy
sympy/geometry/tests/test_util.py
2
1572
from __future__ import division from sympy import Symbol, sqrt, Derivative from sympy.geometry import Point, Polygon, Segment, convex_hull, intersection, centroid from sympy.geometry.util import idiff from sympy.solvers.solvers import solve from sympy.utilities.pytest import raises x = Symbol('x', real=True) y = Symb...
bsd-3-clause
jmhodges/letsencrypt
acme/acme/other.py
14
2140
"""Other ACME objects.""" import functools import logging import os from acme import jose logger = logging.getLogger(__name__) class Signature(jose.JSONObjectWithFields): """ACME signature. :ivar .JWASignature alg: Signature algorithm. :ivar bytes sig: Signature. :ivar bytes nonce: Nonce. :iva...
apache-2.0
kenshay/ImageScripter
ProgramData/SystemFiles/Python/Lib/site-packages/idna/intranges.py
293
1749
""" Given a list of integers, made up of (hopefully) a small number of long runs of consecutive integers, compute a representation of the form ((start1, end1), (start2, end2) ...). Then answer the question "was x present in the original list?" in time O(log(# runs)). """ import bisect def intranges_from_list(list_): ...
gpl-3.0
scls19fr/cw
generator.py
1
7267
#!/usr/bin/env python # -*- coding: utf-8 -*- import sched, time import datetime import morse_talk as mtalk from morse_talk.utils import wpm_to_duration, WORD from abc import ABCMeta, abstractmethod TRUE = 1 FALSE = 0 def _get_list_of_nb_of_same_bit(s_bin, on_value, off_value): """ Calculate number of cons...
gpl-3.0
mbr0wn/gnuradio
gr-analog/python/analog/qa_ctcss_squelch.py
5
2389
#!/usr/bin/env python # # Copyright 2012,2013 Free Software Foundation, Inc. # # This file is part of GNU Radio # # SPDX-License-Identifier: GPL-3.0-or-later # # from gnuradio import gr, gr_unittest, analog, blocks class test_ctcss_squelch(gr_unittest.TestCase): def setUp(self): self.tb = gr.top_block(...
gpl-3.0
3manuek/scikit-learn
sklearn/tests/test_pipeline.py
162
14875
""" Test the pipeline module. """ import numpy as np from scipy import sparse from sklearn.externals.six.moves import zip from sklearn.utils.testing import assert_raises, assert_raises_regex, assert_raise_message from sklearn.utils.testing import assert_equal from sklearn.utils.testing import assert_false from sklearn...
bsd-3-clause
phisiart/shadowsocks
shadowsocks/asyncdns.py
655
17416
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright 2014-2015 clowwindy # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless r...
apache-2.0
Catch-up-TV-and-More/plugin.video.catchuptvandmore
resources/lib/web_utils.py
1
2074
# -*- coding: utf-8 -*- # Copyright: (c) JUL1EN094, SPM, SylvainCecchetto # Copyright: (c) 2016, SylvainCecchetto # GNU General Public License v2.0+ (see LICENSE.txt or https://www.gnu.org/licenses/gpl-2.0.txt) # This file is part of Catch-up TV & More import json from random import randint from codequick import Scr...
gpl-2.0
andrewyoung1991/abjad
abjad/tools/instrumenttools/ContrabassClarinet.py
2
5003
# -*- encoding: utf-8 -*- from abjad.tools import indicatortools from abjad.tools import markuptools from abjad.tools import pitchtools from abjad.tools.instrumenttools.Instrument import Instrument class ContrabassClarinet(Instrument): r'''A contrassbass clarinet. :: >>> staff = Staff("c'4 d'4 e'4 f...
gpl-3.0
maxalbert/ansible
lib/ansible/playbook/block.py
13
11985
# (c) 2012-2014, 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 the License, or # (at your option) an...
gpl-3.0
fuhongliang/erpnext
erpnext/manufacturing/doctype/bom_replace_tool/bom_replace_tool.py
59
1375
# 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.utils import cstr, flt from frappe import _ from frappe.model.document import Document class BOMReplaceTool(Document): def ...
agpl-3.0
bcantoni/ccm
ccmlib/cmds/command.py
2
3493
from __future__ import absolute_import import sys from optparse import BadOptionError, Option, OptionParser from six import print_ from ccmlib import common from ccmlib.cluster_factory import ClusterFactory # This is fairly fragile, but handy for now class ForgivingParser(OptionParser): def __init__(self, us...
apache-2.0
ryfeus/lambda-packs
Keras_tensorflow_nightly/source2.7/tensorflow/contrib/factorization/python/ops/gen_clustering_ops.py
1
12595
"""Python wrappers around TensorFlow ops. This file is MACHINE GENERATED! Do not edit. Original C++ source file: gen_clustering_ops.cc """ import collections as _collections import six as _six from tensorflow.python import pywrap_tensorflow as _pywrap_tensorflow from tensorflow.python.eager import context as _contex...
mit
tempbottle/ironpython3
Src/StdLib/Lib/test/test_select.py
84
2742
import errno import os import select import sys import unittest from test import support @unittest.skipIf((sys.platform[:3]=='win'), "can't easily test on this system") class SelectTestCase(unittest.TestCase): class Nope: pass class Almost: def fileno(self): retur...
apache-2.0
peri-source/peri
scripts/does_matter/pixel-integration.py
1
3809
import pickle import numpy as np import scipy as sp import scipy.ndimage as nd import scipy.interpolate as intr import common from peri import const, runner from peri.test import init def pxint(radius=8, factor=8, dx=np.array([0,0,0])): # the factor of coarse-graining, goal particle size, and larger size f = ...
mit
muffinresearch/addons-server
apps/reviews/tests/test_views.py
10
22021
# -*- coding: utf-8 -*- import json from nose.tools import eq_ from pyquery import PyQuery as pq import mock import amo.tests from amo import helpers from access.models import Group, GroupUser from addons.models import Addon, AddonUser from devhub.models import ActivityLog from reviews.models import Review, ReviewFla...
bsd-3-clause
Tangcuyu/perfectinfo
lib/tsd/node_modules/prebuild/node_modules/node-ninja/gyp/pylib/gyp/MSVSUserFile.py
2710
5094
# 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. """Visual Studio user preferences file writer.""" import os import re import socket # for gethostname import gyp.common import gyp.easy_xml as easy_xml #------...
mit
callowayproject/django-elections
elections/ap.py
1
37444
#! /usr/bin/env python # -*- coding: utf-8 -*- """ Collects and organizes election results published the Associated Press's data service. In order to use this library, you must pay AP for access to the data. More information can be found on the AP's web site (http://www.apdigitalnews.com/ap_elections.html) or by con...
apache-2.0
mindnervestech/mnrp
addons/account/wizard/account_journal_select.py
385
2068
# -*- 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
rnestler/servo
components/script/dom/bindings/codegen/parser/tests/test_record.py
52
1595
import WebIDL def WebIDLTest(parser, harness): parser.parse(""" dictionary Dict {}; interface RecordArg { void foo(record<DOMString, Dict> arg); }; """) results = parser.finish() harness.check(len(results), 2, "Should know about two things"); harness.ok(isinstanc...
mpl-2.0
prakritish/ansible
test/units/modules/cloud/amazon/test_ec2_vpc_nat_gateway.py
41
17149
import pytest import unittest boto3 = pytest.importorskip("boto3") botocore = pytest.importorskip("botocore") from collections import namedtuple from ansible.parsing.dataloader import DataLoader from ansible.vars import VariableManager from ansible.inventory import Inventory from ansible.playbook.play import Play fro...
gpl-3.0
jkern/bigcouch
couchjs/scons/scons-local-2.0.1/SCons/compat/_scons_builtins.py
61
5039
# # Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 The SCons Foundation # # 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 li...
apache-2.0
makermade/arm_android-21_arm-linux-androideabi-4.8
lib/python2.7/distutils/extension.py
250
10904
"""distutils.extension Provides the Extension class, used to describe C/C++ extension modules in setup scripts.""" __revision__ = "$Id$" import os, string, sys from types import * try: import warnings except ImportError: warnings = None # This class is really only used by the "build_ext" command, so it mig...
gpl-2.0
frjaraur/python-deployer
deployer/exceptions.py
2
1483
class DeployerException(Exception): """ Base exception class. """ pass class ExecCommandFailed(DeployerException): """ Execution of a run() or sudo() call on a host failed. """ def __init__(self, command, host, use_sudo, status_code, result=None): self.command = command ...
bsd-2-clause
yashchandak/GNN
Preprocess/DCI2ours.py
1
4984
from __future__ import print_function import numpy as np import networkx as nx from collections import OrderedDict from scipy.io import loadmat, savemat import os """ IMP: Nodes start from 0 """ dataset = 'facebook' source_path = '../Sample_Run/Datasets/%s/DCI_format/'%(dataset) dest_path = '../Sample_Run/Datasets/%...
mit
maxwward/SCOPEBak
askbot/deps/livesettings/values.py
4
24621
"""Taken and modified from the dbsettings project. http://code.google.com/p/django-values/ """ from decimal import Decimal from django import forms from django.conf import settings as django_settings from django.core.exceptions import ImproperlyConfigured from django.core.cache import cache from django.utils import si...
gpl-3.0
mepps-md/tor
bootstrap.py
31
7509
############################################################################## # # Copyright (c) 2006 Zope Foundation and Contributors. # All Rights Reserved. # # This software is subject to the provisions of the Zope Public License, # Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution. # THIS SOF...
apache-2.0
kenshay/ImageScripter
ProgramData/SystemFiles/Python/Lib/site-packages/django/core/files/storage.py
51
18802
import errno import os import warnings from datetime import datetime from django.conf import settings from django.core.exceptions import SuspiciousFileOperation from django.core.files import File, locks from django.core.files.move import file_move_safe from django.core.signals import setting_changed from django.utils ...
gpl-3.0
omerbartal/open-budget-data
budget/history_neto/download_history.py
2
2066
### encoding: utf8 import os import re import csv import json baseurl = 'http://www.ag.mof.gov.il' xls = re.compile('[^"\']+xls') for fn in []:#'history0.html','history1.html']: data = file(fn).read() xlss = xls.findall(data) for x in xlss: #print os.popen('wget %s%s' % (baseurl, x)).read() ...
mit
wweiradio/django
tests/template_tests/syntax_tests/test_autoescape.py
337
5575
from django.template import TemplateSyntaxError from django.test import SimpleTestCase from django.utils.safestring import mark_safe from ..utils import SafeClass, UnsafeClass, setup class AutoescapeTagTests(SimpleTestCase): @setup({'autoescape-tag01': '{% autoescape off %}hello{% endautoescape %}'}) def te...
bsd-3-clause
cliqz/socorro
alembic/versions/2645cb324bf4_bug_899641_support_w.py
16
1399
"""bug 899641 Support Windows NT 6.3 Revision ID: 2645cb324bf4 Revises: 11cd71153550 Create Date: 2013-07-30 13:09:47.577306 """ # revision identifiers, used by Alembic. revision = '2645cb324bf4' down_revision = '11cd71153550' import sqlalchemy as sa from alembic import op from sqlalchemy.dialects import postgresql...
mpl-2.0
AnderEnder/ansible-modules-extras
storage/netapp/netapp_e_auth.py
26
9633
#!/usr/bin/python # (c) 2016, NetApp, 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 version....
gpl-3.0
Bulochkin/tensorflow_pack
tensorflow/contrib/session_bundle/session_bundle.py
49
6815
# 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...
apache-2.0
grantsewell/nzbToMedia
libs/unidecode/x053.py
252
4616
data = ( 'Yun ', # 0x00 'Mwun ', # 0x01 'Nay ', # 0x02 'Gai ', # 0x03 'Gai ', # 0x04 'Bao ', # 0x05 'Cong ', # 0x06 '[?] ', # 0x07 'Xiong ', # 0x08 'Peng ', # 0x09 'Ju ', # 0x0a 'Tao ', # 0x0b 'Ge ', # 0x0c 'Pu ', # 0x0d 'An ', # 0x0e 'Pao ', # 0x0f 'Fu ', # 0x10 'Gong...
gpl-3.0
mondada/pybsdp
bsdp.py
2
6359
import struct import collections import dhcp TYPE_LIST = 1 TYPE_SELECT = 2 TYPE_FAILED = 3 CODE_TYPE = 1 CODE_VERSION = 2 CODE_SERVER_ID = 3 CODE_SERVER_PRIORITY = 4 CODE_REPLY_PORT = 5 CODE_DEFAULT_BOOT_IMAGE = 7 CODE_SELECTED_BOOT_IMAGE = 8 CODE_BOOT_IMAGE_LIST = 9 CODE_MAX_MESSAGE_SIZE = 12 CODE_SHADOW_MOUNT_URL ...
mit
thewtex/ITKMinimalPathExtraction
setup.py
1
2191
# -*- coding: utf-8 -*- from __future__ import print_function from os import sys try: from skbuild import setup except ImportError: print('scikit-build is required to build from source.', file=sys.stderr) print('Please run:', file=sys.stderr) print('', file=sys.stderr) print(' python -m pip instal...
apache-2.0