repo_name
stringlengths
5
100
path
stringlengths
4
375
copies
stringclasses
991 values
size
stringlengths
4
7
content
stringlengths
666
1M
license
stringclasses
15 values
9nix00/mongoengine
tests/queryset/field_list.py
30
15452
import sys sys.path[0:0] = [""] import unittest from mongoengine import * from mongoengine.queryset import QueryFieldList __all__ = ("QueryFieldListTest", "OnlyExcludeAllTest") class QueryFieldListTest(unittest.TestCase): def test_empty(self): q = QueryFieldList() self.assertFalse(q) ...
mit
lfz/Guided-Denoise
Attackset/fgsm_v4_random/nets/inception_utils.py
66
2630
# 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
kidaa30/spacewalk
backend/common/test/unit-test/test_rhnLib.py
12
3335
#!/usr/bin/python # # Copyright (c) 2008--2015 Red Hat, Inc. # # This software is licensed to you under the GNU General Public License, # version 2 (GPLv2). There is NO WARRANTY for this software, express or # implied, including the implied warranties of MERCHANTABILITY or FITNESS # FOR A PARTICULAR PURPOSE. You should...
gpl-2.0
turbokongen/home-assistant
homeassistant/components/hassio/websocket_api.py
1
2559
"""Websocekt API handlers for the hassio integration.""" import logging import voluptuous as vol from homeassistant.components import websocket_api from homeassistant.components.websocket_api.connection import ActiveConnection from homeassistant.core import HomeAssistant, callback import homeassistant.helpers.config_...
apache-2.0
dgzurita/odoo
addons/l10n_fr/wizard/__init__.py
424
1462
# -*- coding: utf-8 -*- ############################################################################## # # Copyright (c) 2008 JAILLET Simon - CrysaLEAD - www.crysalead.fr # # WARNING: This program as such is intended to be used by professional # programmers who take the whole responsability of assessing all potential #...
agpl-3.0
raymondxyang/tensorflow
tensorflow/python/kernel_tests/unique_op_test.py
20
3876
# 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
todotobe1/apprtc
src/third_party/oauth2client/old_run.py
173
5548
# Copyright (C) 2013 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writ...
bsd-3-clause
nrwahl2/ansible
lib/ansible/modules/network/avi/avi_backupconfiguration.py
27
4642
#!/usr/bin/python # # Created on Aug 25, 2016 # @author: Gaurav Rastogi (grastogi@avinetworks.com) # Eric Anderson (eanderson@avinetworks.com) # module_check: supported # # # 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...
gpl-3.0
40223246/0622W17test2
static/Brython3.1.3-20150514-095342/Lib/subprocess.py
728
67282
# subprocess - Subprocesses with accessible I/O streams # # For more information about this module, see PEP 324. # # Copyright (c) 2003-2005 by Peter Astrand <astrand@lysator.liu.se> # # Licensed to PSF under a Contributor Agreement. # See http://www.python.org/2.4/license for licensing details. r"""subprocess - Subpr...
gpl-3.0
hujiajie/chromium-crosswalk
tools/telemetry/third_party/webpagereplay/setup.py
31
1785
#!/usr/bin/env python # Copyright 2012 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...
bsd-3-clause
sgraham/nope
tools/perf/benchmarks/sunspider.py
1
6150
# Copyright 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. import collections import json import os from metrics import power from telemetry import benchmark from telemetry import page as page_module from telemetry.p...
bsd-3-clause
KazukiOhashi/kubernetes
Godeps/_workspace/src/github.com/ugorji/go/codec/test.py
670
3808
#!/usr/bin/env python # This will create golden files in a directory passed to it. # A Test calls this internally to create the golden files # So it can process them (so we don't have to checkin the files). # Ensure msgpack-python and cbor are installed first, using: # pip install --user msgpack-python # pip inst...
apache-2.0
yize/grunt-tps
tasks/lib/python/Lib/python2.7/test/profilee.py
398
3041
""" Input for test_profile.py and test_cprofile.py. IMPORTANT: This stuff is touchy. If you modify anything above the test class you'll have to regenerate the stats by running the two test files. *ALL* NUMBERS in the expected output are relevant. If you change the formatting of pstats, please don't just regenerate t...
mit
saisai/phantomjs
src/qt/qtwebkit/Tools/Scripts/webkitpy/common/checkout/baselineoptimizer_unittest.py
118
7755
# 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
Endika/odoo
addons/stock_picking_wave/wizard/picking_to_wave.py
382
1624
############################################################################## # # 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 Affero General Public L...
agpl-3.0
deepchem/deepchem
deepchem/molnet/load_function/load_dataset_template.py
2
8348
""" Short docstring description of dataset. """ import os import logging import deepchem from deepchem.feat import Featurizer from deepchem.trans import Transformer from deepchem.splits.splitters import Splitter from deepchem.molnet.defaults import get_defaults from typing import List, Tuple, Dict, Optional logger = ...
mit
notriddle/servo
tests/wpt/web-platform-tests/tools/wptrunner/wptrunner/update/sync.py
12
6709
import fnmatch import os import re import shutil import sys import uuid from .base import Step, StepRunner from .tree import Commit here = os.path.abspath(os.path.split(__file__)[0]) bsd_license = """W3C 3-clause BSD License Redistribution and use in source and binary forms, with or without modification, are permit...
mpl-2.0
mrry/tensorflow
tensorflow/contrib/distributions/python/kernel_tests/quantized_distribution_test.py
4
18061
# 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
charlesccychen/beam
sdks/python/apache_beam/coders/coders.py
2
30433
# # 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
TRex22/Sick-Beard
lib/hachoir_parser/audio/xm.py
90
15154
""" Parser of FastTrackerII Extended Module (XM) version 1.4 Documents: - Modplug source code (file modplug/soundlib/Load_xm.cpp) http://sourceforge.net/projects/modplug - Dumb source code (files include/dumb.h and src/it/readxm.c http://dumb.sf.net/ - Documents of "XM" format on Wotsit http://www.wotsit.org Au...
gpl-3.0
absoludity/servo
tests/wpt/css-tests/tools/pytest/_pytest/config.py
166
45047
""" command line options, ini-file and conftest.py processing. """ import argparse import shlex import traceback import types import warnings import py # DON't import pytest here because it causes import cycle troubles import sys, os import _pytest._code import _pytest.hookspec # the extension point definitions from ...
mpl-2.0
hollabaq86/haikuna-matata
env/lib/python2.7/site-packages/alembic/operations/ops.py
7
72904
from .. import util from ..util import sqla_compat from . import schemaobj from sqlalchemy.types import NULLTYPE from .base import Operations, BatchOperations import re class MigrateOperation(object): """base class for migration command and organization objects. This system is part of the operation extensibi...
mit
ojengwa/oh-mainline
vendor/packages/Django/django/contrib/localflavor/mk/forms.py
109
3594
from __future__ import absolute_import, unicode_literals import datetime from django.core.validators import EMPTY_VALUES from django.forms import ValidationError from django.forms.fields import RegexField, Select from django.utils.translation import ugettext_lazy as _ from django.contrib.localflavor.mk.mk_choices im...
agpl-3.0
pidydx/grr
grr/lib/queue_manager_test.py
2
23589
#!/usr/bin/env python """Tests the queue manager.""" import time from grr.lib import config_lib from grr.lib import data_store from grr.lib import flags from grr.lib import queue_manager from grr.lib import queues from grr.lib import rdfvalue from grr.lib import stats from grr.lib import test_lib from grr.lib.rdfva...
apache-2.0
cyranodb/namebench
nb_third_party/dns/rdtypes/IN/NAPTR.py
248
4889
# Copyright (C) 2003-2007, 2009, 2010 Nominum, Inc. # # Permission to use, copy, modify, and distribute this software and its # documentation for any purpose with or without fee is hereby granted, # provided that the above copyright notice and this permission notice # appear in all copies. # # THE SOFTWARE IS PROVIDED ...
apache-2.0
defaultnamehere/grr
gui/plugins/fileview_test.py
1
19676
#!/usr/bin/env python # -*- mode: python; encoding: utf-8 -*- """Test the fileview interface.""" from grr.gui import runtests_test from grr.lib import access_control from grr.lib import action_mocks from grr.lib import aff4 from grr.lib import flags from grr.lib import rdfvalue from grr.lib import test_lib from gr...
apache-2.0
caveman-dick/ansible
lib/ansible/modules/crypto/openssl_publickey.py
26
10548
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2016, Yanis Guenane <yanis+ansible@guenane.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': '...
gpl-3.0
jjscarafia/odoo
addons/base_vat/res_company.py
448
1404
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Business Applications # Copyright (c) 2011 OpenERP S.A. <http://openerp.com> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GN...
agpl-3.0
IllusionRom-deprecated/android_platform_external_chromium_org
native_client_sdk/src/build_tools/parse_dsc.py
25
8237
#!/usr/bin/env python # 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. import collections import fnmatch import optparse import os import sys VALID_TOOLCHAINS = ['newlib', 'glibc', 'pnacl', 'win', 'lin...
bsd-3-clause
DavidGarciaCat/letsencrypt
certbot/colored_logging.py
4
1508
"""A formatter and StreamHandler for colorizing logging output.""" import logging import sys from certbot import le_util class StreamHandler(logging.StreamHandler): """Sends colored logging output to a stream. If the specified stream is not a tty, the class works like the standard logging.StreamHandler....
apache-2.0
nelson-liu/scikit-learn
sklearn/linear_model/sag.py
18
11273
"""Solvers for Ridge and LogisticRegression using SAG algorithm""" # Authors: Tom Dupre la Tour <tom.dupre-la-tour@m4x.org> # # License: BSD 3 clause import numpy as np import warnings from ..exceptions import ConvergenceWarning from ..utils import check_array from ..utils.extmath import row_norms from .base import ...
bsd-3-clause
tynn/numpy
numpy/lib/financial.py
21
24495
"""Some simple financial calculations patterned after spreadsheet computations. There is some complexity in each function so that the functions behave like ufuncs with broadcasting and being able to be called with scalars or arrays (or other sequences). Functions support the :class:`decimal.Decimal` type unless othe...
bsd-3-clause
eeshangarg/oh-mainline
vendor/packages/typecheck/tests/test_examples.py
16
7690
import support from support import TODO, TestCase if __name__ == '__main__': support.adjust_path() ### /Bookkeeping ### import typecheck from typecheck import check_type class TypeCheckedTree(TestCase): def setUp(self): from typecheck import typecheck_args, register_type from typecheck import...
agpl-3.0
ettm2012/MissionPlanner
Lib/optparse.py
55
62827
"""A powerful, extensible, and easy-to-use option parser. By Greg Ward <gward@python.net> Originally distributed as Optik. For support, use the optik-users@lists.sourceforge.net mailing list (http://lists.sourceforge.net/lists/listinfo/optik-users). Simple usage example: from optparse import OptionPa...
gpl-3.0
Zerschmetterling91/three.js
utils/exporters/blender/addons/io_three/exporter/api/object.py
54
13118
import math import mathutils import bpy from bpy import data, context, types from bpy_extras.io_utils import axis_conversion from .. import constants, logger, utilities, exceptions from .constants import ( MESH, EMPTY, ARMATURE, LAMP, SPOT, SUN, POINT, HEMI, CAMERA, PERSP, OR...
mit
hryamzik/ansible
lib/ansible/modules/network/cnos/cnos_image.py
10
8818
#!/usr/bin/python # -*- coding: utf-8 -*- from __future__ import (absolute_import, division, print_function) __metaclass__ = type # # Copyright (C) 2017 Lenovo, 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 Licens...
gpl-3.0
ahu-odoo/odoo
addons/website_mail/controllers/main.py
203
4237
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2013-Today OpenERP SA (<http://www.openerp.com>). # # This program is free software: you can redistribute it and/or modify # it under the terms ...
agpl-3.0
seem-sky/kbengine
kbe/res/scripts/common/Lib/sqlite3/dump.py
149
2825
# Mimic the sqlite3 console shell's .dump command # Author: Paul Kippes <kippesp@gmail.com> # Every identifier in sql is quoted based on a comment in sqlite # documentation "SQLite adds new keywords from time to time when it # takes on new features. So to prevent your code from being broken by # future enhancements, y...
lgpl-3.0
SSL-Roots/CON-SAI
behavior_tree_visualizer/src/behavior_tree_visualizer/btv.py
1
6031
import os import rospy import rospkg from rqt_gui_py.plugin import Plugin from python_qt_binding import loadUi from python_qt_binding.QtGui import QWidget from python_qt_binding.QtGui import QPalette from python_qt_binding.QtCore import Qt from consai_msgs.msg import nodeData, nodeDataArray from xdot.xdot_qt import ...
mit
UK992/servo
tests/wpt/web-platform-tests/tools/wptserve/tests/functional/base.py
14
5484
from __future__ import print_function import base64 import logging import os import pytest import unittest from six.moves.urllib.parse import urlencode, urlunsplit from six.moves.urllib.request import Request as BaseRequest from six.moves.urllib.request import urlopen from six import binary_type, iteritems, PY3 from...
mpl-2.0
eoyilmaz/anima
anima/render/redshift.py
1
3637
import os class RedShiftTextureProcessor(object): """A wrapper for the ``redshiftTextureProcessor.exe`` TextureProcessor <inputfile> [options] Options are: -l Force linear gamma (recommended for floating point textures) -s Force SRGB gamma (recommended f...
mit
GELOG/1kg-metadata
src/node_modules/restify/node_modules/dtrace-provider/compile.py
228
1769
{ 'conditions': [ ['OS=="mac" or OS=="solaris"', { 'variables': { 'escaped_root': '<!(printf %q "<(module_root_dir)")', }, # If we are on the Mac, or a Solaris derivative, attempt # to build the DTrace provider extension. 'targets':...
apache-2.0
priestd09/mopidy
mopidy/core/playlists.py
2
6200
from __future__ import absolute_import, unicode_literals import itertools import urlparse import pykka from . import listener class PlaylistsController(object): pykka_traversable = True def __init__(self, backends, core): self.backends = backends self.core = core def get_playlists(sel...
apache-2.0
y12uc231/edx-platform
common/djangoapps/student/helpers.py
8
8855
"""Helpers for the student app. """ import time from datetime import datetime from pytz import UTC from django.utils.http import cookie_date from django.conf import settings from verify_student.models import SoftwareSecurePhotoVerification # pylint: disable=F0401 from course_modes.models import CourseMode from student...
agpl-3.0
Jobava/zamboni
mkt/feed/models.py
7
17313
""" The feed is an assembly of items of different content types. For ease of querying, each different content type is housed in the FeedItem model, which also houses metadata indicating the conditions under which it should be included. So a feed is actually just a listing of FeedItem instances that match the user's reg...
bsd-3-clause
thjashin/tensorflow
tensorflow/contrib/slim/python/slim/nets/inception_v2_test.py
111
11157
# 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
BenjamenMeyer/openstackinabox
openstackinabox/models/keystone/exceptions.py
2
1202
""" Keystone Model Exceptions """ from openstackinabox.models.base_model import BaseModelExceptions class KeystoneError(BaseModelExceptions): pass class KeystoneTenantError(KeystoneError): pass class KeystoneUserError(KeystoneError): pass class KeystoneDisabledUserError(KeystoneUserError): pass ...
apache-2.0
doctorwidget/dj-stripe
tests/test_subscriptions.py
9
13785
import calendar import copy import datetime import decimal from django.contrib.auth import get_user_model from django.test import TestCase from django.utils import timezone from mock import patch, PropertyMock from stripe import InvalidRequestError from djstripe.exceptions import SubscriptionCancellationFailure, Sub...
bsd-3-clause
kontais/EFI-MIPS
ToolKit/cmds/python/Lib/test/good/test_module.py
33
1252
# Test the module type from test.test_support import verify, vereq, verbose, TestFailed import sys module = type(sys) # An uninitialized module has no __dict__ or __name__, and __doc__ is None foo = module.__new__(module) verify(foo.__dict__ is None) try: s = foo.__name__ except AttributeError: pass else: ...
bsd-3-clause
MattRijk/django-ecomsite
lib/python2.7/site-packages/django/views/generic/dates.py
90
25603
from __future__ import unicode_literals import datetime from django.conf import settings from django.db import models from django.core.exceptions import ImproperlyConfigured from django.http import Http404 from django.utils.encoding import force_str, force_text from django.utils.functional import cached_property from ...
cc0-1.0
rlbabyuk/integration_tests
cfme/tests/control/test_import_policies.py
5
1165
# -*- coding: utf-8 -*- import pytest from cfme.control import import_export from utils.path import data_path from utils import error from utils.version import current_version from cfme import test_requirements pytestmark = [ test_requirements.control, pytest.mark.tier(3) ] @pytest.fixture(scope="module") ...
gpl-2.0
thibault/btctools
btctools/scripts/base.py
1
3449
from __future__ import unicode_literals import six from scripts import constants as C from encoding import ( b58c_decode, bytes_to_hex, little_endian_uint8, little_endian_uint16, little_endian_uint32 ) class Script(object): """Script management class.""" def __init__(self, stack): """Initia...
mit
enkay3987/pmipv6-flow-mobility
src/aodv/bindings/callbacks_list.py
95
1688
callback_classes = [ ['void', 'ns3::Ptr<ns3::Packet const>', 'ns3::Ipv4Header const&', 'ns3::Socket::SocketErrno', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty'], ['void', 'ns3::Ptr<ns3::Ipv4Route>', 'ns3::Ptr<ns3::Packet const>', 'ns3::Ipv4Header const&', 'ns3::empty', 'ns3...
gpl-2.0
kenshay/ImageScripter
ProgramData/SystemFiles/Python/Lib/site-packages/networkx/algorithms/community/community_utils.py
13
1107
# -*- coding: utf-8 -*- # # utils.py - helper functions for community-finding algorithms # # Copyright 2011 Ben Edwards <bedwards@cs.unm.edu>. # Copyright 2011 Aric Hagberg <hagberg@lanl.gov>. # Copyright 2015 NetworkX developers. # # This file is part of NetworkX. # # NetworkX is distributed under a BSD license; see L...
gpl-3.0
dims/mincntr
mincntr/docker_api.py
1
10513
# 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 # distribu...
apache-2.0
WiFast/pbr
pbr/tests/base.py
58
8683
# Copyright 2010-2011 OpenStack Foundation # Copyright (c) 2013 Hewlett-Packard Development Company, L.P. # # 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/licens...
apache-2.0
LegitSavage/namebench
nb_third_party/dns/rdtypes/keybase.py
248
5017
# Copyright (C) 2004-2007, 2009, 2010 Nominum, Inc. # # Permission to use, copy, modify, and distribute this software and its # documentation for any purpose with or without fee is hereby granted, # provided that the above copyright notice and this permission notice # appear in all copies. # # THE SOFTWARE IS PROVIDED ...
apache-2.0
mrknow/filmkodi
script.mrknow.urlresolver/lib/urlresolver9/plugins/alldebrid.py
4
4281
""" urlresolver XBMC Addon Copyright (C) 2011 t0mm0, JUL1EN094 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 v...
apache-2.0
luiseduardohdbackup/odoo
addons/web/tests/test_menu.py
303
1628
# -*- coding: utf-8 -*- import unittest2 from ..controllers import main class ActionMungerTest(unittest2.TestCase): def test_actual_treeview(self): action = { "views": [[False, "tree"], [False, "form"], [False, "calendar"]], "view_type": "tree", "...
agpl-3.0
open-pli/enigma2
lib/python/Components/Playlist.py
32
2877
from ServiceReference import ServiceReference from enigma import eServiceReference import os class PlaylistIO: def __init__(self): self.list = [] # returns a list of services or None if filename is not a valid playlist def open(self, filename): return None OK = 0 FILEEXISTS = 1 WRITEERROR = 2 ERROR = 3 U...
gpl-2.0
benjaminbrinkman/open-ad-platform
.venv/lib/python3.4/site-packages/migrate/versioning/util/keyedinstance.py
81
1148
#!/usr/bin/env python # -*- coding: utf-8 -*- class KeyedInstance(object): """A class whose instances have a unique identifier of some sort No two instances with the same unique ID should exist - if we try to create a second instance, the first should be returned. """ _instances = dict() def ...
mit
destan/electron
script/dump-symbols.py
144
1962
#!/usr/bin/env python import os import sys from lib.config import PLATFORM from lib.util import atom_gyp, execute, rm_rf SOURCE_ROOT = os.path.abspath(os.path.dirname(os.path.dirname(__file__))) DIST_DIR = os.path.join(SOURCE_ROOT, 'dist') OUT_DIR = os.path.join(SOURCE_ROOT, 'out', 'R') CHROMIUM_DIR = os.path.join(...
mit
navyjeff/keras
tests/auto/test_optimizers.py
74
1924
from __future__ import print_function import numpy as np np.random.seed(1337) from keras.utils.test_utils import get_test_data from keras.optimizers import SGD, RMSprop, Adagrad, Adadelta, Adam from keras.models import Sequential from keras.layers.core import Dense, Activation from keras.utils.np_utils import to_categ...
mit
B-UMMI/INNUca
src/SPAdes-3.14.0-Linux/share/spades/joblib2/numpy_pickle.py
18
15334
""" Utilities for fast persistence of big data, with optional compression. """ # Author: Gael Varoquaux <gael dot varoquaux at normalesup dot org> # Copyright (c) 2009 Gael Varoquaux # License: BSD Style, 3 clauses. import pickle import traceback import sys import os import zlib import warnings if sys.version_info[0...
gpl-3.0
wangjohn/wallace
wallace/parameters.py
1
11526
import random import copy class ParameterSet(object): def __init__(self, parameter_values, validity_check=None, default_values=None): self.parameter_values = parameter_values self.validity_check = validity_check if default_values == None: self.default_values = {} else: ...
mit
ajaxsys/dict-admin
docutils/math/latex2mathml.py
2
21278
#!/usr/bin/env python # -*- coding: utf8 -*- # :Id: $Id: latex2mathml.py 7058 2011-06-27 11:38:56Z milde $ # :Copyright: © 2010 Günter Milde. # Based on rst2mathml.py from the latex_math sandbox project # © 2005 Jens Jørgen Mortensen # :License: Released under the terms of the `2-Clause ...
bsd-3-clause
Tesora-Release/tesora-trove
trove/db/sqlalchemy/migrate_repo/versions/012_backup.py
5
2131
# Copyright [2013] Hewlett-Packard Development Company, L.P. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable la...
apache-2.0
krousey/test-infra
boskos/janitor/janitor.py
2
10361
#!/usr/bin/env python # Copyright 2016 The Kubernetes Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
apache-2.0
XXMrHyde/android_external_chromium_org
chrome/common/extensions/docs/server2/file_system_test.py
48
1844
#!/usr/bin/env python # Copyright 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. import unittest from test_file_system import TestFileSystem file_system = TestFileSystem({ 'templates': { 'public': { 'ap...
bsd-3-clause
ConnorGBrewster/servo
tests/wpt/web-platform-tests/tools/third_party/html5lib/html5lib/tests/test_encoding.py
30
4801
from __future__ import absolute_import, division, unicode_literals import os import pytest from .support import get_data_files, test_dir, errorMessage, TestData as _TestData from html5lib import HTMLParser, _inputstream def test_basic_prescan_length(): data = "<title>Caf\u00E9</title><!--a--><meta charset='utf...
mpl-2.0
www220/esp-idf
tools/cmake/convert_to_cmake.py
3
7496
#!/usr/bin/env python # # Command line tool to convert simple ESP-IDF Makefile & component.mk files to # CMakeLists.txt files # import argparse import subprocess import re import os.path import glob import sys debug = False def get_make_variables(path, makefile="Makefile", expected_failure=False, variables={}): "...
apache-2.0
40223225/2015-cdb-g3-test2-
static/Brython3.1.1-20150328-091302/Lib/csv.py
637
16166
""" csv.py - read/write/investigate CSV files """ import re from _csv import Error, __version__, writer, reader, register_dialect, \ unregister_dialect, get_dialect, list_dialects, \ field_size_limit, \ QUOTE_MINIMAL, QUOTE_ALL, QUOTE_NONNUMERIC, QUOTE_NONE, \ ...
gpl-3.0
2014c2g4/2015cda0623
static/Brython3.1.3-20150514-095342/Lib/site-packages/pygame/surface.py
603
3844
from browser import document, html, window from javascript import console, JSConstructor from .rect import Rect #import pygame.rect canvas_ID=1 _canvas_id=None class Surface: def __init__(self, dim=[], depth=16, surf=None): if surf is None: self._depth=depth self._canvas=html.CANVAS(width=...
gpl-3.0
CMPUT410W15T02/CMPUT410W15-project
testenv/lib/python2.7/site-packages/django/conf/locale/it/formats.py
82
2094
# -*- 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 = 'd F Y' # 25 Ottobre 2006 TIME_FO...
gpl-2.0
toomoresuch/pysonengine
eggs/gaepytz-2010l-py2.6.egg/pytz/reference.py
839
3649
''' Reference tzinfo implementations from the Python docs. Used for testing against as they are only correct for the years 1987 to 2006. Do not use these for real code. ''' from datetime import tzinfo, timedelta, datetime from pytz import utc, UTC, HOUR, ZERO # A class building tzinfo objects for fixed-offset time zo...
mit
NendoTaka/CodeForReference
Codingame/Python/Easy/skynetTheChasm.py
1
1134
import sys import math # Auto-generated code below aims at helping you parse # the standard input according to the problem statement. road = int(input()) # the length of the road before the gap. gap = int(input()) # the length of the gap. platform = int(input()) # the length of the landing platform. print (road, ...
mit
velocyno/glances
glances/ports_list.py
1
5667
# -*- coding: utf-8 -*- # # This file is part of Glances. # # Copyright (C) 2016 Nicolargo <nicolas@nicolargo.com> # # Glances is free software; you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as published by # the Free Software Foundation, either version 3 of the Lic...
lgpl-3.0
item4/cliche
cliche/migrations/versions/441c936f555_tvtropes_models.py
2
1506
"""TVTropes models Revision ID: 441c936f555 Revises: 57fc5e85328 # changed from 1ed82ef0071 Create Date: 2014-08-08 03:42:59.602574 """ from alembic.op import create_table, drop_table from sqlalchemy.schema import (Column, ForeignKeyConstraint, PrimaryKeyConstraint) from sqlalchemy.type...
agpl-3.0
Microsoft/hummingbird
tests/test_sklearn_nb_converter.py
1
5440
""" Tests sklearn Naive Bayes model (BernoulliNB, GaussianNB, MultinomialNB) converters. """ import unittest import warnings import numpy as np import torch from sklearn.naive_bayes import BernoulliNB, GaussianNB, MultinomialNB import hummingbird.ml class TestSklearnNBClassifier(unittest.TestCase): # Bernoulli...
mit
40423252/2016fallcadp_hw
plugin/sitemap/sitemap.py
292
8774
# -*- coding: utf-8 -*- ''' Sitemap ------- The sitemap plugin generates plain-text or XML sitemaps. ''' from __future__ import unicode_literals import re import collections import os.path from datetime import datetime from logging import warning, info from codecs import open from pytz import timezone from pelican...
gpl-3.0
neumerance/cloudloon2
.venv/lib/python2.7/site-packages/keystoneclient/v2_0/client.py
2
8707
# Copyright 2011 Nebula, 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 ...
apache-2.0
kisel/trex-core
scripts/automation/regression/misc_methods.py
3
10447
#!/router/bin/python import sys if sys.version_info >= (3, 0): import configparser else: import ConfigParser import outer_packages import yaml from collections import namedtuple import subprocess, shlex import os TRexConfig = namedtuple('TRexConfig', 'trex, router, tftp') # debug/development purpose, lists o...
apache-2.0
2013Commons/HUE-SHARK
desktop/core/ext-py/Django-1.2.3/build/lib.linux-i686-2.7/django/core/cache/backends/db.py
6
5799
"Database cache backend." from django.core.cache.backends.base import BaseCache from django.db import connections, router, transaction, DatabaseError import base64, time from datetime import datetime try: import cPickle as pickle except ImportError: import pickle class Options(object): """A class that wil...
apache-2.0
javier95/reposjaviergm
FlaskItsaeUno/ec/edu/itsae/dao/PersonaDAO.py
4
2010
#-*- coding:utf-8 -*- ''' Created on 18/2/2015 @author: PC06 ''' from ec.edu.itsae.conn import DBcon import json class PersonaDao(DBcon.DBcon): ''' classdocs ''' def __init__(self): ''' Constructor ''' pass def reportarPersona(self): con=self.conexion()...
gpl-2.0
vvv1559/intellij-community
python/lib/Lib/subprocess.py
80
60033
# subprocess - Subprocesses with accessible I/O streams # # For more information about this module, see PEP 324. # # This module should remain compatible with Python 2.2, see PEP 291. # # Copyright (c) 2003-2005 by Peter Astrand <astrand@lysator.liu.se> # # Licensed to PSF under a Contributor Agreement. # See http://ww...
apache-2.0
craftytrickster/servo
tests/wpt/harness/wptrunner/wptmanifest/tests/test_static.py
139
2863
# This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this file, # You can obtain one at http://mozilla.org/MPL/2.0/. import unittest from cStringIO import StringIO from ..backends import static # There aren't many tests here because i...
mpl-2.0
VeNoMouS/Sick-Beard
lib/hachoir_core/field/padding.py
90
4491
from lib.hachoir_core.field import Bits, Bytes from lib.hachoir_core.tools import makePrintable, humanFilesize from lib.hachoir_core import config class PaddingBits(Bits): """ Padding bits used, for example, to align address (of next field). See also NullBits and PaddingBytes types. Arguments: * ...
gpl-3.0
yppiti/StClairWebProject
bootstrap-3.3.2/test-infra/s3_cache.py
2166
5734
#!/usr/bin/env python2.7 # pylint: disable=C0301 from __future__ import absolute_import, unicode_literals, print_function, division from sys import argv from os import environ, stat, chdir, remove as _delete_file from os.path import dirname, basename, abspath, realpath, expandvars from hashlib import sha256 from subpr...
gpl-3.0
hdinsight/hue
desktop/core/ext-py/pycrypto-2.6.1/setup.py
34
18058
#! /usr/bin/env python # # setup.py : Distutils setup script # # Part of the Python Cryptography Toolkit # # =================================================================== # Portions Copyright (c) 2001, 2002, 2003 Python Software Foundation; # All Rights Reserved # # This file contains code from the Python 2.2 s...
apache-2.0
liulion/mayavi
integrationtests/mayavi/run.py
2
2498
#!/usr/bin/env python """Script to run all the tests. """ # Author: Prabhu Ramachandran <prabhu [at] aero . iitb . ac . in> # Copyright (c) 2008, Prabhu Ramachandran # License: BSD Style. import sys import os from os.path import splitext import glob from common import TestCase def get_tests(): """Get all the tes...
bsd-3-clause
sibirrer/astrofunc
astrofunc/LensingProfiles/p_jaffe_ellipse.py
1
2605
from astrofunc.LensingProfiles.p_jaffe import PJaffe import numpy as np class PJaffe_Ellipse(object): """ this class contains functions concerning the NFW profile relation are: R_200 = c * Rs """ def __init__(self): self.spherical = PJaffe() self._diff = 0.000001 def function...
mit
markneville/nupic
external/linux32/lib/python2.6/site-packages/matplotlib/backends/backend_mixed.py
70
3776
from matplotlib._image import frombuffer from matplotlib.backends.backend_agg import RendererAgg class MixedModeRenderer(object): """ A helper class to implement a renderer that switches between vector and raster drawing. An example may be a PDF writer, where most things are drawn with PDF vector comm...
agpl-3.0
marcli/sos
sos/plugins/gfs2.py
4
2268
# 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. # This program is distributed in the hope that it will be useful, # but...
gpl-2.0
pescobar/easybuild-framework
test/framework/repository.py
2
8673
## # Copyright 2012-2020 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), # with support of Ghent University (http://ugent.be/hpc), # the Flemish Supercomputer Centre (VSC) (https://www.vscentrum.be), # Flemish Research Foundation (F...
gpl-2.0
Adel-Magebinary/odoo
addons/sale_stock/__openerp__.py
214
2553
# -*- 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
alkyl1978/gnuradio
gr-digital/python/digital/__init__.py
54
1763
# Copyright 2011-2013 Free Software Foundation, Inc. # # This file is part of GNU Radio # # GNU Radio is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3, or (at your option) # any later version...
gpl-3.0
fretboardfreak/escadrille
src/escadrille/tasks/rst2dtree.py
1
4854
# Copyright 2017 Curtis Sand <curtissand@gmail.com> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or...
apache-2.0
harisibrahimkv/django
tests/m2m_and_m2o/tests.py
131
2700
from django.db.models import Q from django.test import TestCase from .models import Issue, StringReferenceModel, User class RelatedObjectTests(TestCase): def test_related_objects_have_name_attribute(self): for field_name in ('test_issue_client', 'test_issue_cc'): obj = User._meta.get_field(f...
bsd-3-clause
SilversApprentice/PigeonScript
IDE/modules/pathlib2.py
9
51006
import ctypes import fnmatch import functools import io import ntpath import os import posixpath import re import six import sys from collections import Sequence from contextlib import contextmanager from errno import EINVAL, ENOENT, ENOTDIR, EEXIST from operator import attrgetter from stat import ( S_ISDIR, S_ISLN...
mit
mozilla/sheriffs
vendor-local/src/python-nose/functional_tests/test_program.py
2
6884
import os import unittest from cStringIO import StringIO from nose import SkipTest from nose.core import TestProgram from nose.config import Config from nose.plugins.manager import DefaultPluginManager from nose.result import _TextTestResult here = os.path.dirname(__file__) support = os.path.join(here, 'support') cla...
bsd-3-clause