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
gkotton/neutron
neutron/plugins/mlnx/common/comm_utils.py
10
2323
# Copyright 2013 Mellanox Technologies, Ltd # # 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 t...
apache-2.0
akvo/akvo-rsr
akvo/rsr/migrations/0042_auto_20153011_1450.py
1
1498
# -*- coding: utf-8 -*- from django.db import models, migrations from ..models.project import Project def change_primary_organisations(apps, schema_editor): Project = apps.get_model("rsr", "Project") for project in Project.objects.all(): primary_organisation = None # Pick the reporting org...
agpl-3.0
TechBK/horizon-dev
openstack_dashboard/dashboards/project/data_processing/job_binaries/forms.py
23
8922
# Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the...
apache-2.0
hannes/linux
Documentation/target/tcm_mod_builder.py
497
22865
#!/usr/bin/python # The TCM v4 multi-protocol fabric module generation script for drivers/target/$NEW_MOD # # Copyright (c) 2010 Rising Tide Systems # Copyright (c) 2010 Linux-iSCSI.org # # Author: nab@kernel.org # import os, sys import subprocess as sub import string import re import optparse tcm_dir = "" fabric_ops...
gpl-2.0
jzoldak/edx-platform
common/lib/xmodule/xmodule/assetstore/tests/test_asset_xml.py
113
3631
""" Test for asset XML generation / parsing. """ from path import Path as path from lxml import etree from contracts import ContractNotRespected import unittest from opaque_keys.edx.locator import CourseLocator from xmodule.assetstore import AssetMetadata from xmodule.modulestore.tests.test_assetstore import AssetSto...
agpl-3.0
kenshay/ImageScripter
ProgramData/SystemFiles/Python/Lib/site-packages/skimage/io/tests/test_imread.py
4
2468
import os from tempfile import NamedTemporaryFile import numpy as np from skimage import data_dir, io from skimage.io import imread, imsave, use_plugin, reset_plugins from skimage._shared import testing from skimage._shared.testing import (TestCase, assert_array_equal, assert_arra...
gpl-3.0
mavit/ansible
lib/ansible/modules/windows/win_timezone.py
52
1808
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2015, Phil Schwartz <schwartzmx@gmail.com> # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['preview'], 'supported_by...
gpl-3.0
kimjaejoong/nova
nova/tests/unit/api/openstack/compute/contrib/test_admin_password.py
33
7070
# Copyright 2011 OpenStack Foundation # Copyright 2013 IBM Corp. # 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/LIC...
apache-2.0
ruibarreira/linuxtrail
usr/lib/python3.4/idlelib/RemoteDebugger.py
137
12029
"""Support for remote Python debugging. Some ASCII art to describe the structure: IN PYTHON SUBPROCESS # IN IDLE PROCESS # # oid='gui_adapter' +----------+ # +------------+ ...
gpl-3.0
hedaoyuan/Paddle
python/paddle/trainer_config_helpers/data_sources.py
14
7727
# Copyright (c) 2016 PaddlePaddle 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 applic...
apache-2.0
Azure/azure-sdk-for-python
sdk/network/azure-mgmt-network/azure/mgmt/network/v2021_02_01/aio/operations/_operations.py
1
4679
# 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
Tiryoh/mbed
workspace_tools/host_tests/host_tests_plugins/module_copy_mbed.py
74
2858
""" mbed SDK Copyright (c) 2011-2013 ARM Limited 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 wr...
apache-2.0
jmehnle/ansible
lib/ansible/parsing/yaml/constructor.py
16
6062
# (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
cloudbau/nova
nova/openstack/common/context.py
27
2733
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2011 OpenStack Foundation. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apac...
apache-2.0
xapi-project/xapi-storage-datapath-plugins
datapath/test.py
5
2930
# Run these tests with 'nosetests': # install the 'python-nose' package (Fedora/CentOS or Ubuntu) # run 'nosetests' in the root of the repository import iscsi import image import device import unittest import os import socket import struct import errno raw_path = "/tmp/test-raw-disk" class Tests(unittest.TestCa...
lgpl-2.1
futurepr0n/Books-solutions
Python-For-Everyone-Horstmann/Chapter7-Files-and-Exceptions/P7.10.py
1
1769
# Get the data for baby names in prior years from the Social Security Administration. # Paste the table data in files named babynames2010.txt , etc. Modify the babynames.py # program so that it prompts the user for a file name. Can you spot a trend in the # frequencies? ## # This program displays the most common baby...
mit
elkingtonmcb/django
tests/defer/tests.py
338
11262
from __future__ import unicode_literals from django.db.models.query_utils import DeferredAttribute, InvalidQuery from django.test import TestCase from .models import ( BigChild, Child, ChildProxy, Primary, RefreshPrimaryProxy, Secondary, ) class AssertionMixin(object): def assert_delayed(self, obj, num): ...
bsd-3-clause
jirikuncar/invenio-records
invenio_records/bundles.py
4
1121
# -*- coding: utf-8 -*- # # This file is part of Invenio. # Copyright (C) 2014, 2015 CERN. # # Invenio is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License as # published by the Free Software Foundation; either version 2 of the # License, or (at your option) any...
gpl-2.0
Aorjoa/aiyara-ceph-dash
.tox/py27/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/packages/ssl_match_hostname/_implementation.py
2360
3778
"""The match_hostname() function from Python 3.3.3, essential when using SSL.""" # Note: This file is under the PSF license as the code comes from the python # stdlib. http://docs.python.org/3/license.html import re __version__ = '3.4.0.2' class CertificateError(ValueError): pass def _dnsname_match(dn, host...
bsd-2-clause
gautamMalu/rootfs_xen_arndale
usr/lib/python3.4/lib2to3/fixes/fix_execfile.py
175
1990
# Copyright 2006 Google, Inc. All Rights Reserved. # Licensed to PSF under a Contributor Agreement. """Fixer for execfile. This converts usages of the execfile function into calls to the built-in exec() function. """ from .. import fixer_base from ..fixer_util import (Comma, Name, Call, LParen, RParen, Dot, Node, ...
gpl-2.0
dantebarba/docker-media-server
plex/Sub-Zero.bundle/Contents/Libraries/Shared/html5lib/html5parser.py
45
118951
from __future__ import absolute_import, division, unicode_literals from six import with_metaclass, viewkeys import types from collections import OrderedDict from . import _inputstream from . import _tokenizer from . import treebuilders from .treebuilders.base import Marker from . import _utils from .constants impor...
gpl-3.0
rmills220/p2pool-maxcoin
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
pepsipepsi/nodebox_opengl_python3
nodebox/ext/psyco/src/test/bpnn.py
4
5155
#!/usr/bin/python # Back-Propagation Neural Networks # # Written in Python. See http://www.python.org/ # # Neil Schemenauer <nascheme@enme.ucalgary.ca> import math import random import operator import string import psyco #psyco.full() from psyco.classes import * #psyco.log() #psyco.profile() #__metaclass__ = type ...
bsd-3-clause
rhaschke/catkin_tools
tests/system/verbs/catkin_build/test_modify_ws.py
2
1193
from __future__ import print_function import os TEST_DIR = os.path.dirname(__file__) RESOURCES_DIR = os.path.join(os.path.dirname(__file__), '..', '..', 'resources') BUILD = ['build', '--no-notify', '--no-status'] CLEAN = ['clean', '--all', '--yes'] # , '--no-notify', '--no-color', '--no-status'] def test_add_pac...
apache-2.0
fernandezcuesta/ansible
test/units/plugins/strategy/test_strategy_base.py
69
21292
# (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
samchrisinger/osf.io
website/notifications/events/utils.py
66
5782
from itertools import product from website.notifications.emails import compile_subscriptions from website.notifications import utils, constants def get_file_subs_from_folder(addon, user, kind, path, name): """Find the file tree under a specified folder.""" folder = dict(kind=kind, path=path, name=name) f...
apache-2.0
flavour/ifrc_qa
static/scripts/tools/xls2xml.py
16
10070
# -*- coding: utf-8 -*- # # Debug/Helper script for XLS stylesheet development # # >>> python xls2xml <XLS File> # ... converts the XLS file into XML # # >>> python xls2xml <XLS File> <XSLT Stylesheet> # ... converts the XLS file into XML and transforms it using the stylesheet # import datetime import sys ...
mit
IS-ENES-Data/esgf-pid
esgfpid/rabbit/asynchronous/thread_confirmer.py
1
9200
import logging import copy from esgfpid.utils import loginfo, logdebug, logtrace, logerror, logwarn, log_every_x_times from .exceptions import UnknownServerResponse LOGGER = logging.getLogger(__name__) LOGGER.addHandler(logging.NullHandler()) ''' ========= Confirmer ========= The confirmer is responsible for handlin...
apache-2.0
15Dkatz/pants
tests/python/pants_test/goal/test_products.py
4
4421
# coding=utf-8 # Copyright 2015 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 os from colle...
apache-2.0
EliotBerriot/django
tests/model_fields/test_uuid.py
119
6590
import json import uuid from django.core import exceptions, serializers from django.db import IntegrityError, models from django.test import ( SimpleTestCase, TestCase, TransactionTestCase, skipUnlessDBFeature, ) from .models import ( NullableUUIDModel, PrimaryKeyUUIDModel, RelatedToUUIDModel, UUIDGrandchild,...
bsd-3-clause
thaumos/ansible
lib/ansible/modules/network/fortimanager/fmgr_ha.py
38
13484
#!/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
NTAWolf/pyExamPrepper
interfaces/base_interface.py
1
3185
# encoding: utf-8 class QuizInterfaceBase(object): """This is the base user interface for an ExamPrepper quiz. Extend and implement it in subclasses, catering to different views. """ def set_media_folder(s, path): s.media_folder = path def select_categories(s, categories): """All...
gpl-2.0
deepmind/dm_control
dm_control/locomotion/walkers/rodent.py
1
12164
# Copyright 2020 The dm_control Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to i...
apache-2.0
antoviaque/edx-platform
common/lib/xmodule/xmodule/poll_module.py
146
7498
"""Poll module is ungraded xmodule used by students to to do set of polls. On the client side we show: If student does not yet anwered - Question with set of choices. If student have answered - Question with statistics for each answers. """ import cgi import json import logging from copy import deepcopy from collecti...
agpl-3.0
nrgaway/qubes-core-admin
qubes/tests/tarwriter.py
5
5801
# # The Qubes OS Project, http://www.qubes-os.org # # Copyright (C) 2016 Marek Marczykowski-Górecki # <marmarek@invisiblethingslab.com> # # 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 t...
gpl-2.0
foobarbazblarg/stayclean
stayclean-2020-december/venv/lib/python3.8/site-packages/pip/_vendor/toml/decoder.py
11
38954
import datetime import io from os import linesep import re import sys from pip._vendor.toml.tz import TomlTz if sys.version_info < (3,): _range = xrange # noqa: F821 else: unicode = str _range = range basestring = str unichr = chr def _detect_pathlib_path(p): if (3, 4) <= sys.version_info: ...
mit
samedder/azure-cli
src/command_modules/azure-cli-sf/azure/cli/command_modules/sf/tests/test_sf_node.py
2
1601
# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # --------------------------------------------------------------------...
mit
beckastar/django
tests/select_related_onetoone/tests.py
59
9624
from __future__ import unicode_literals import unittest from django.test import TestCase from .models import (User, UserProfile, UserStat, UserStatResult, StatDetails, AdvancedUserStat, Image, Product, Parent1, Parent2, Child1, Child2, Child3, Child4) class ReverseSelectRelatedTestCase(TestCase): def s...
bsd-3-clause
hans/lightblue-0.4
build/lib/lightblue/_LightAquaBlue.py
83
2357
# Copyright (c) 2009 Bea Lam. All rights reserved. # # This file is part of LightBlue. # # LightBlue 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 l...
gpl-3.0
abhattad4/Digi-Menu
digimenu2/django/core/servers/fastcgi.py
170
6631
""" FastCGI (or SCGI, or AJP1.3 ...) server that implements the WSGI protocol. Uses the flup python package: http://www.saddi.com/software/flup/ This is an adaptation of the flup package to add FastCGI server support to run Django apps from Web servers that support the FastCGI protocol. This module can be run standal...
bsd-3-clause
janewangfb/spark
examples/src/main/python/ml/normalizer_example.py
123
1807
# # 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
jasondunsmore/python-heatclient
heatclient/tests/test_software_configs.py
4
3527
# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under t...
apache-2.0
cheertarts/filter-comments
filter-comments.py
1
4693
#!/usr/bin/env python3 # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that...
gpl-3.0
die88/ardupilot
Tools/autotest/common.py
32
9718
from __future__ import print_function import math import time from pymavlink import mavwp from pysim import util # a list of pexpect objects to read while waiting for # messages. This keeps the output to stdout flowing expect_list = [] def expect_list_clear(): """clear the expect list.""" global expect_lis...
gpl-3.0
metaplinius/still-lambda
pyglet/media/drivers/openal/__init__.py
2
23315
# ---------------------------------------------------------------------------- # pyglet # Copyright (c) 2006-2008 Alex Holkner # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # # * Redistribu...
bsd-3-clause
wteiken/letsencrypt
certbot/tests/auth_handler_test.py
4
16114
"""Tests for certbot.auth_handler.""" import functools import logging import unittest import mock from acme import challenges from acme import client as acme_client from acme import messages from certbot import achallenges from certbot import errors from certbot import le_util from certbot.tests import acme_util ...
apache-2.0
HeraclesHX/scikit-learn
examples/neighbors/plot_nearest_centroid.py
264
1804
""" =============================== Nearest Centroid Classification =============================== Sample usage of Nearest Centroid classification. It will plot the decision boundaries for each class. """ print(__doc__) import numpy as np import matplotlib.pyplot as plt from matplotlib.colors import ListedColormap f...
bsd-3-clause
sysalexis/kbengine
kbe/res/scripts/common/Lib/idlelib/PathBrowser.py
73
3111
import os import sys import importlib.machinery from idlelib.TreeWidget import TreeItem from idlelib.ClassBrowser import ClassBrowser, ModuleBrowserTreeItem from idlelib.PyShell import PyShellFileList class PathBrowser(ClassBrowser): def __init__(self, flist, _htest=False): """ _htest - bool, ch...
lgpl-3.0
brchiu/tensorflow
tensorflow/python/grappler/layout_optimizer_test.py
2
58174
# 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
justinHowlett/KivaServer
node_modules/jitsu/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/MSVSVersion.py
115
13925
# Copyright (c) 2013 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Handle version information related to Visual Stuio.""" import errno import os import re import subprocess import sys import gyp class VisualStudioVersion(obj...
mit
heromod/migrid
mig/shared/functionality/rmvgridowner.py
1
24999
#!/usr/bin/python # -*- coding: utf-8 -*- # # --- BEGIN_HEADER --- # # rmvgridowner - remove a vgrid owner # Copyright (C) 2003-2015 The MiG Project lead by Brian Vinter # # This file is part of MiG. # # MiG is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License ...
gpl-2.0
alexgorban/models
official/vision/detection/modeling/architecture/heads.py
1
44483
# Copyright 2019 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
julienr/vispy
vispy/gloo/gl/tests/test_use.py
18
1865
""" Test the use function. """ from vispy.testing import assert_is, requires_pyopengl from vispy.gloo import gl from vispy.testing import run_tests_if_main def teardown_module(): gl.use_gl() # Reset to default @requires_pyopengl() def test_use_desktop(): """ Testing that gl.use injects all names in gl na...
bsd-3-clause
supercollider/supercollider
editors/sced/scedwin/py/ConfigurationDialog.py
44
6061
# sced (SuperCollider mode for gedit) # # Copyright 2012 Jakob Leben # Copyright 2009 Artem Popov and other contributors (see AUTHORS) # # sced 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, ei...
gpl-3.0
Jaimenms/google-python-exercises
basic/string1.py
1
3750
#!/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/ # Basic string exercises # Fill in the code for the functions below. main() is already se...
apache-2.0
hajicj/safire
safire/data/composite_corpus.py
1
11234
""" This module contains classes that ... """ import logging import copy import gensim import itertools import numpy # import safire.datasets.transformations import safire.utils.transcorp from safire.utils import IndexedTransformedCorpus, flatten_composite_item __author__ = "Jan Hajic jr." class Zipper(gensim.interf...
gpl-3.0
maritaria/Isomurphy
tests/ColorAndBranchTest.py
2
2391
import unittest from graph.graphIO import loadgraphs, writeDOT from isomorphism.IndividualizationRefinementChecker import IndividualizationRefinementChecker class IsomorphTest(unittest.TestCase): def setUp(self): self._checker = IndividualizationRefinementChecker() def test_Quick(self): self._graphs = loadgra...
mit
saffroncoin/csfrd
docs/conf.py
1
7704
# -*- coding: utf-8 -*- # # csfrd documentation build configuration file, created by # sphinx-quickstart on Mon Jan 20 15:45:40 2014. # # This file is execfile()d with the current directory set to its containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # # All c...
mit
pnavarro/neutron
neutron/tests/unit/agent/linux/test_ipset_manager.py
8
4469
# # 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
javilonas/NCam
cross/android-toolchain/lib/python2.7/encodings/cp1026.py
593
13369
""" Python Character Mapping Codec cp1026 generated from 'MAPPINGS/VENDORS/MICSFT/EBCDIC/CP1026.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,inp...
gpl-3.0
mattupstate/flask-social
tests/functional_tests.py
3
14205
import unittest import mock from tests.test_app.sqlalchemy import create_app as create_sql_app from tests.test_app.mongoengine import create_app as create_mongo_app from tests.test_app.peewee_app import create_app as create_peewee_app def get_mock_twitter_response(): return { 'oauth_token_secret': 'the_oau...
mit
monibu1548/linux
scripts/checkkconfigsymbols.py
221
9497
#!/usr/bin/env python """Find Kconfig symbols that are referenced but not defined.""" # (c) 2014-2015 Valentin Rothberg <Valentin.Rothberg@lip6.fr> # (c) 2014 Stefan Hengelein <stefan.hengelein@fau.de> # # Licensed under the terms of the GNU GPL License version 2 import os import re import sys from subprocess impor...
gpl-2.0
arvinsingla/CouchPotatoServer
libs/CodernityDB/migrate.py
81
1317
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright 2011-2013 Codernity (http://codernity.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/L...
gpl-3.0
kerr-huang/SL4A
python/src/Lib/test/test_types.py
56
25078
# Python test set -- part 6, built-in types from test.test_support import run_unittest, have_unicode, run_with_locale import unittest import sys import locale class TypesTests(unittest.TestCase): def test_truth_values(self): if None: self.fail('None is true instead of false') if 0: self.fail('0 i...
apache-2.0
gwsu2008/automation
python/rotate-iam-keys.py
1
4429
import json import boto3 import os import time import base64 from datetime import datetime from botocore.exceptions import ClientError iam_client = boto3.client('iam') secret_client = boto3.client('secretsmanager') kms_client = boto3.client('kms') sqs_client = boto3.client('sqs') now = datetime.now() iam_users = os.ge...
gpl-2.0
run2/citytour
4symantec/Lib/site-packages/pip/_vendor/lockfile/symlinklockfile.py
487
2613
from __future__ import absolute_import import time import os from . import (LockBase, LockFailed, NotLocked, NotMyLock, LockTimeout, AlreadyLocked) class SymlinkLockFile(LockBase): """Lock access to a file using symlink(2).""" def __init__(self, path, threaded=True, timeout=None): # s...
mit
xyrnwbtj/dockerAutomatedBuild
pyspider/database/sqlalchemy/taskdb.py
5
5778
#!/usr/bin/env python # -*- encoding: utf-8 -*- # vim: set et sw=4 ts=4 sts=4 ff=unix fenc=utf8: # Author: Binux<roy@binux.me> # http://binux.me # Created on 2014-12-04 22:33:43 import re import six import time import json from sqlalchemy import (create_engine, MetaData, Table, Column, Index, ...
apache-2.0
chienlieu2017/it_management
odoo/odoo/workflow/instance.py
20
4912
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. import workitem from odoo.workflow.helpers import Session from odoo.workflow.helpers import Record from odoo.workflow.workitem import WorkflowItem class WorkflowInstance(object): def __init__(self, session, record, v...
gpl-3.0
ericfc/django
tests/custom_pk/models.py
99
1256
# -*- coding: utf-8 -*- """ Using a custom primary key By default, Django adds an ``"id"`` field to each model. But you can override this behavior by explicitly adding ``primary_key=True`` to a field. """ from __future__ import unicode_literals from django.db import models from django.utils.encoding import python_2_...
bsd-3-clause
jstoxrocky/statsmodels
statsmodels/sandbox/tsa/fftarma.py
30
16438
# -*- coding: utf-8 -*- """ Created on Mon Dec 14 19:53:25 2009 Author: josef-pktd generate arma sample using fft with all the lfilter it looks slow to get the ma representation first apply arma filter (in ar representation) to time series to get white noise but seems slow to be useful for fast estimation for nobs=1...
bsd-3-clause
dimitri-justeau/niamoto-core
niamoto/api/publish_api.py
2
1717
# coding: utf-8 import sys from niamoto.data_publishers.base_data_publisher import PUBLISHER_REGISTRY from niamoto.exceptions import WrongPublisherKeyError, \ UnavailablePublishFormat def publish(publisher_key, publish_format, *args, destination=sys.stdout, **kwargs): """ Api method for proc...
gpl-3.0
RalphBariz/RalphsDotNet
Old/RalphsDotNet.Apps.OptimizationStudio/Resources/PyLib/numpy/core/tests/test_errstate.py
58
1715
# The following exec statement (or something like it) is needed to # prevent SyntaxError on Python < 2.5. Even though this is a test, # SyntaxErrors are not acceptable; on Debian systems, they block # byte-compilation during install and thus cause the package to fail # to install. import sys if sys.version_info[:2] >=...
gpl-3.0
shtouff/django
tests/gis_tests/geos_tests/test_geos.py
38
44711
from __future__ import unicode_literals import ctypes import json import random import unittest from binascii import a2b_hex, b2a_hex from io import BytesIO from unittest import skipUnless from django.contrib.gis import gdal from django.contrib.gis.gdal import HAS_GDAL from django.contrib.gis.geos import ( HAS_GE...
bsd-3-clause
kyleconroy/vogeltron
tests/test_sports.py
1
6742
import mock from datetime import datetime, timezone import pytz from nose.tools import assert_equals, assert_raises from vogeltron import baseball from bs4 import BeautifulSoup YEAR = datetime.today().year def date_for_month(month, day, hour, minute): timez = pytz.timezone('US/Pacific') return timez.localize...
mit
junhuac/MQUIC
src/tools/gyp/pylib/gyp/MSVSToolFile.py
2736
1804
# 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 project reader/writer.""" import gyp.common import gyp.easy_xml as easy_xml class Writer(object): """Visual Studio XML tool file writer.""" ...
mit
YathishReddy/Robust_ECN_Signalling_With_Nonces
src/wifi/doc/source/conf.py
92
7432
# -*- coding: utf-8 -*- # # ns-3 documentation build configuration file, created by # sphinx-quickstart on Tue Dec 14 09:00:39 2010. # # This file is execfile()d with the current directory set to its containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # # All co...
gpl-2.0
kanpol/hk
hooker_xp/hooker_xp/release.py
2
5522
# -*- coding: utf-8 -*- #+---------------------------------------------------------------------------+ #| | #| Android's Hooker | #| ...
gpl-3.0
sundisee/django-dynamic-scraper
dynamic_scraper/management/commands/run_checker_tests.py
6
3056
from optparse import make_option from subprocess import Popen, PIPE from django.conf import settings from django.core.mail import mail_admins from django.core.management.base import BaseCommand from dynamic_scraper.models import Scraper class Command(BaseCommand): help = 'Runs all checker tests' option_li...
bsd-3-clause
sudheesh001/oh-mainline
vendor/packages/twisted/twisted/web/test/test_webclient.py
18
46700
# Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ Tests for L{twisted.web.client}. """ import os from errno import ENOSPC from urlparse import urlparse from twisted.trial import unittest from twisted.web import server, static, client, error, util, resource, http_headers from twisted.intern...
agpl-3.0
jpasosa/agroapex
plugins/apostrophePlugin/web/js/fckeditor/editor/filemanager/connectors/py/zope.py
89
5685
#!/usr/bin/env python """ FCKeditor - The text editor for Internet - http://www.fckeditor.net Copyright (C) 2003-2009 Frederico Caldeira Knabben == BEGIN LICENSE == Licensed under the terms of any of the following licenses at your choice: - GNU General Public License Version 2 or later (the "GPL") http:...
mit
ds-hwang/chromium-crosswalk
third_party/WebKit/Source/devtools/scripts/modular_build.py
32
6644
#!/usr/bin/env python # # Copyright 2014 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. """ Utilities for the modular DevTools build. """ from os import path import os try: import simplejson as json except ImportErr...
bsd-3-clause
altsen/diandiyun-platform
lms/djangoapps/django_comment_client/permissions.py
7
4151
""" Module for checking permissions with the comment_client backend """ import logging from django.core import cache CACHE = cache.get_cache('default') CACHE_LIFESPAN = 60 def cached_has_permission(user, permission, course_id=None): """ Call has_permission if it's not cached. A change in a user's role or ...
agpl-3.0
jvassev/dd-agent
tests/checks/integration/test_http_check.py
10
8334
# stdlibb import time # 3p import mock from nose.plugins.attrib import attr # project from config import AGENT_VERSION from tests.checks.common import AgentCheckTest from util import headers as agent_headers RESULTS_TIMEOUT = 10 AGENT_CONFIG = { 'version': AGENT_VERSION, 'api_key': 'toto' } CONFIG = { ...
bsd-3-clause
insidenothing/3D-Printing-Software
skein_engines/skeinforge-47/fabmetheus_utilities/geometry/manipulation_meta/_copy.py
12
2877
""" Boolean geometry copy. """ from __future__ import absolute_import #Init has to be imported first because it has code to workaround the python bug where relative imports don't work if the module is imported as a main module. import __init__ from fabmetheus_utilities.geometry.creation import lineation from fabmeth...
gpl-2.0
HiSPARC/station-software
user/python/Lib/site-packages/pip/_vendor/chardet/eucjpprober.py
289
3749
######################## 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...
gpl-3.0
Nick-Hall/gramps
gramps/plugins/lib/libprogen.py
4
84334
# -*- coding: utf-8 -*- # # Gramps - a GTK+/GNOME based genealogy program # # Copyright (C) 2008-2011 Kees Bakker # Copyright (C) 2008 Brian G. Matherly # Copyright (C) 2013-2017 Alois Poettker # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Publi...
gpl-2.0
mmaelicke/scikit-gstat
skgstat/plotting/stvariogram_plot3d.py
1
3989
import numpy as np import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3D try: import plotly.graph_objects as go except ImportError: pass def __calculate_plot_data(stvariogram, **kwargs): xx, yy = stvariogram.meshbins z = stvariogram.experimental # x = xx.flatten() # y = yy.fla...
mit
shaufi10/odoo
addons/hr_timesheet_sheet/wizard/__init__.py
443
1075
# -*- 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
cmdunkers/DeeperMind
PythonEnv/lib/python2.7/site-packages/scipy/weave/examples/binary_search.py
97
6783
# Offers example of inline C for binary search algorithm. # Borrowed from Kalle Svensson in the Python Cookbook. # The results are nearly in the "not worth it" category. # # C:\home\ej\wrk\scipy\compiler\examples>python binary_search.py # Binary search for 3000 items in 100000 length list of integers: # speed in pytho...
bsd-3-clause
ibressler/pyqtgraph
examples/Draw.py
28
1142
# -*- coding: utf-8 -*- """ Demonstrate ability of ImageItem to be used as a canvas for painting with the mouse. """ import initExample ## Add path to library (just for examples; you do not need this) from pyqtgraph.Qt import QtCore, QtGui import numpy as np import pyqtgraph as pg app = QtGui.QApplication([]) ## ...
mit
Imaginashion/cloud-vision
.fr-d0BNfn/django-jquery-file-upload/venv/lib/python3.5/encodings/raw_unicode_escape.py
852
1208
""" Python 'raw-unicode-escape' Codec Written by Marc-Andre Lemburg (mal@lemburg.com). (c) Copyright CNRI, All Rights Reserved. NO WARRANTY. """ import codecs ### Codec APIs class Codec(codecs.Codec): # Note: Binding these as C functions will result in the class not # converting them to methods. This is ...
mit
timchen86/ntulifeguardapp
gdata-2.0.18/samples/apps/marketplace_sample/appengine_utilities/settings_default.py
26
3607
""" Copyright (c) 2008, appengine-utilities project 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 ...
apache-2.0
mjvakili/ccppabc
ccppabc/code/test_data.py
1
4243
''' Test the data.py module ''' import numpy as np import matplotlib.pyplot as plt import util import data as Data # --- Halotools --- from halotools.empirical_models import PrebuiltHodModelFactory from ChangTools.plotting import prettyplot from ChangTools.plotting import prettycolors def PlotCovariance(obvs, ...
mit
michealcarrerweb/LHVent_app
time_log/migrations/0006_auto_20170731_1738.py
1
4838
# -*- coding: utf-8 -*- # Generated by Django 1.11 on 2017-07-31 17:38 from __future__ import unicode_literals from django.conf import settings from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('work_order', '0007_order_tim...
mit
ramitalat/odoo
addons/crm_claim/report/__init__.py
446
1080
# -*- 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...
agpl-3.0
zhengwsh/InplusTrader_Linux
InplusTrader/backtestEngine/api/helper.py
2
1115
# -*- coding: utf-8 -*- # # Copyright 2017 Ricequant, 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 ...
mit
shawnadelic/shuup
shuup/campaigns/models/context_conditions.py
2
2074
# This file is part of Shuup. # # Copyright (c) 2012-2016, Shoop Ltd. All rights reserved. # # This source code is licensed under the AGPLv3 license found in the # LICENSE file in the root directory of this source tree. from django.db import models from django.utils.translation import ugettext_lazy as _ from polymorphi...
agpl-3.0
timonwong/OmniMarkupPreviewer
OmniMarkupLib/Renderers/libs/markdown/blockprocessors.py
16
22431
""" CORE MARKDOWN BLOCKPARSER =========================================================================== This parser handles basic parsing of Markdown blocks. It doesn't concern itself with inline elements such as **bold** or *italics*, but rather just catches blocks, lists, quotes, etc. The BlockParser is made up ...
mit
pdufour/sqlalchemy
lib/sqlalchemy/sql/dml.py
40
31506
# sql/dml.py # Copyright (C) 2009-2015 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 """ Provide :class:`.Insert`, :class:`.Update` and :class:`.Delete`. """ from .base impo...
mit
Andreea-G/Codds_DarkMatter
src/experiment_HaloIndep_Band.py
1
59260
""" Copyright (c) 2015 Andreea Georgescu Created on Wed Mar 4 00:47:37 2015 This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 2 of the License, or (at your option) any later version. ...
gpl-2.0