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
Ormod/Diamond
src/collectors/ip/test/testip.py
30
4178
#!/usr/bin/env python # coding=utf-8 ############################################################################### from test import CollectorTestCase from test import get_collector_config from test import unittest from mock import Mock from mock import patch try: from cStringIO import StringIO except ImportErro...
mit
crosick/zhishu
ENV/lib/python2.7/site-packages/pip/_vendor/requests/compat.py
1039
1469
# -*- coding: utf-8 -*- """ pythoncompat """ from .packages import chardet import sys # ------- # Pythons # ------- # Syntax sugar. _ver = sys.version_info #: Python 2.x? is_py2 = (_ver[0] == 2) #: Python 3.x? is_py3 = (_ver[0] == 3) try: import simplejson as json except (ImportError, SyntaxError): # si...
mit
TwinkleChawla/nova
nova/opts.py
39
4802
# Licensed under the Apache License, Version 2.0 (the "License"); you may not # use this file except in compliance with the License. You may obtain a copy # of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the Li...
apache-2.0
MayOneUS/pledgeservice
lib/mailchimp/requests/structures.py
279
3541
# -*- coding: utf-8 -*- """ requests.structures ~~~~~~~~~~~~~~~~~~~ Data structures that power Requests. """ import os import collections from itertools import islice class IteratorProxy(object): """docstring for IteratorProxy""" def __init__(self, i): self.i = i # self.i = chain.from_iter...
apache-2.0
DinoCow/airflow
airflow/models/log.py
10
2239
# # 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...
apache-2.0
fedorpatlin/ansible
lib/ansible/modules/windows/win_say.py
45
4641
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2016, Jon Hawkesworth (@jhawkesworth) <figs@unity.demon.co.uk> # # 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, eith...
gpl-3.0
cloudfoundry-attic/api
python/istio_api/config/mcp/v1alpha1/mcp_pb2.py
2
10595
# Generated by the protocol buffer compiler. DO NOT EDIT! # source: config/mcp/v1alpha1/mcp.proto import sys _b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message from google.protobuf import refl...
apache-2.0
astropy/astropy
astropy/tests/tests/test_quantity_helpers.py
8
1626
import pytest from astropy import units as u from astropy.tests.helper import assert_quantity_allclose def test_assert_quantity_allclose(): assert_quantity_allclose([1, 2], [1, 2]) assert_quantity_allclose([1, 2] * u.m, [100, 200] * u.cm) assert_quantity_allclose([1, 2] * u.m, [101, 201] * u.cm, atol=...
bsd-3-clause
kvar/ansible
lib/ansible/modules/network/fortios/fortios_firewall_shaper_traffic_shaper.py
13
13174
#!/usr/bin/python from __future__ import (absolute_import, division, print_function) # Copyright 2019 Fortinet, Inc. # # 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 Lic...
gpl-3.0
dbaxa/django
tests/redirects_tests/tests.py
336
3396
from django import http from django.conf import settings from django.contrib.redirects.middleware import RedirectFallbackMiddleware from django.contrib.redirects.models import Redirect from django.contrib.sites.models import Site from django.core.exceptions import ImproperlyConfigured from django.test import TestCase, ...
bsd-3-clause
mahendra-r/edx-platform
cms/djangoapps/contentstore/management/commands/export.py
64
1688
""" Script for exporting courseware from Mongo to a tar.gz file """ import os from django.core.management.base import BaseCommand, CommandError from xmodule.modulestore.xml_exporter import export_course_to_xml from xmodule.modulestore.django import modulestore from opaque_keys.edx.keys import CourseKey from xmodule.co...
agpl-3.0
encode101/tracker
node_modules/gulp-sass/node_modules/node-sass/node_modules/pangyp/gyp/gyptest.py
1752
8019
#!/usr/bin/env python # 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. __doc__ = """ gyptest.py -- test runner for GYP tests. """ import os import optparse import subprocess import sys class CommandRunner(obje...
gpl-2.0
jlspyaozhongkai/Uter
third_party_backup/Python-2.7.9/Lib/collections.py
13
26142
__all__ = ['Counter', 'deque', 'defaultdict', 'namedtuple', 'OrderedDict'] # For bootstrapping reasons, the collection ABCs are defined in _abcoll.py. # They should however be considered an integral part of collections.py. from _abcoll import * import _abcoll __all__ += _abcoll.__all__ from _collections import deque, ...
gpl-3.0
jpetto/olympia
src/olympia/amo/tests/test_readonly.py
1
2126
from django.conf import settings from django.db import models from django.utils import importlib import MySQLdb as mysql from nose.tools import assert_raises, eq_ from pyquery import PyQuery as pq from olympia.amo.tests import TestCase from olympia.addons.models import Addon def pubdir(ob): for name in dir(ob):...
bsd-3-clause
goldeneye-source/ges-python
lib/test/test_venv.py
7
16359
""" Test harness for the venv module. Copyright (C) 2011-2012 Vinay Sajip. Licensed to the PSF under a contributor agreement. """ import ensurepip import os import os.path import shutil import struct import subprocess import sys import tempfile from test.support import (captured_stdout, captured_stderr, run_unittest,...
gpl-3.0
dedalusdev/docker-registry
docker_registry/images.py
29
15688
# -*- coding: utf-8 -*- import datetime import functools import logging import time import flask from docker_registry.core import compat from docker_registry.core import exceptions json = compat.json from . import storage from . import toolkit from .app import app from .app import cfg from .lib import cache from .l...
apache-2.0
cernops/nova
nova/tests/unit/api/openstack/compute/test_quotas.py
34
31659
# 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
michaelwu/servo
components/script/dom/bindings/codegen/parser/WebIDL.py
8
208982
# 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/. """ A WebIDL parser. """ from ply import lex, yacc import re import os import traceback import math from collections im...
mpl-2.0
dstufft/sqlalchemy
lib/sqlalchemy/event/legacy.py
60
5814
# event/legacy.py # Copyright (C) 2005-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 """Routines to handle adaption of legacy call signatures, generation of deprecation ...
mit
tronlogistics/micro
flask/lib/python3.4/site-packages/pip/_vendor/html5lib/treebuilders/__init__.py
1730
3405
"""A collection of modules for building different kinds of tree from HTML documents. To create a treebuilder for a new type of tree, you need to do implement several things: 1) A set of classes for various types of elements: Document, Doctype, Comment, Element. These must implement the interface of _base.treebuilders...
bsd-3-clause
doug-fish/horizon
openstack_dashboard/dashboards/admin/metadata_defs/urls.py
62
1253
# (c) Copyright 2014 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...
apache-2.0
hggh/linux
tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/Util.py
12527
1935
# Util.py - Python extension for perf script, miscellaneous utility code # # Copyright (C) 2010 by Tom Zanussi <tzanussi@gmail.com> # # This software may be distributed under the terms of the GNU General # Public License ("GPL") version 2 as published by the Free Software # Foundation. import errno, os FUTEX_WAIT = 0...
gpl-2.0
Vignesh2208/Awlsim
awlsim/core/instructions/insn_on.py
2
1481
# -*- coding: utf-8 -*- # # AWL simulator - instructions # # Copyright 2012-2014 Michael Buesch <m@bues.ch> # # 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 ...
gpl-2.0
par2/lamana
lamana/models/fixtures/fixture_model_class.py
1
10351
#------------------------------------------------------------------------------ '''Class-style Model This fixture is used to test the importing of models, handled by the `theories.handshake()` module. As of 0.4.11, models can: - be located in the `lamana.models` folder - module and classes can have any pythonic name...
bsd-3-clause
mglidden/git-analysis
analysis/word_frequencies.py
1
1325
import fix_paths import common import config from load_samples import load_samples_from_file from models.commit import Commit from collections import Counter import json import string def get_words_from_message(commit_message): #TODO: clean up this method cleaned_message = str(commit_message.encode('ascii', 'ign...
mit
laszlocsomor/tensorflow
tensorflow/python/training/server_lib_test.py
62
16839
# 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
chebee7i/dit
dit/algorithms/optutil.py
1
8288
""" Various utilities that can be helpful for optimization problems. """ from __future__ import division, print_function from collections import defaultdict import itertools import numpy as np import dit from .frankwolfe import frank_wolfe def as_full_rank(A, b): """ From a linear system Ax = b, return Bx...
bsd-3-clause
vipul-sharma20/oh-mainline
vendor/packages/Django/django/contrib/gis/gdal/prototypes/errcheck.py
219
4257
""" This module houses the error-checking routines used by the GDAL ctypes prototypes. """ from ctypes import c_void_p, string_at from django.contrib.gis.gdal.error import check_err, OGRException, SRSException from django.contrib.gis.gdal.libgdal import lgdal from django.utils import six # Helper routines for retrie...
agpl-3.0
pombredanne/bigcouch
couchjs/scons/scons-local-2.0.1/SCons/Tool/g++.py
61
3234
"""SCons.Tool.g++ Tool-specific initialization for g++. There normally shouldn't be any need to import this module directly. It will usually be imported through the generic SCons.Tool.Tool() selection method. """ # # Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 The SCons Foundation # # P...
apache-2.0
ppwwyyxx/tensorflow
tensorflow/python/util/tf_contextlib.py
154
1377
# 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
tiagochiavericosta/edx-platform
common/lib/xmodule/xmodule/editing_module.py
120
4149
"""Descriptors for XBlocks/Xmodules, that provide editing of atrributes""" from pkg_resources import resource_string from xmodule.mako_module import MakoModuleDescriptor from xblock.fields import Scope, String import logging log = logging.getLogger(__name__) class EditingFields(object): """Contains specific tem...
agpl-3.0
bigswitch/neutron
neutron/services/externaldns/drivers/designate/driver.py
4
8813
# Copyright (c) 2016 IBM # 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 appli...
apache-2.0
monetaproject/moneta
qa/rpc-tests/util.py
1
5291
# Copyright (c) 2014 The Bitcoin Core developers # Copyright (c) 2014-2015 The Moneta developers # Distributed under the MIT/X11 software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # # Helpful routines for regression testing # # Add python-bitcoinrpc to module s...
mit
evanccnyc/ansible-modules-core
cloud/amazon/ec2_tag.py
54
6007
#!/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 distributed...
gpl-3.0
evanma92/routeh
flask/lib/python2.7/site-packages/pip/_vendor/lockfile/pidlockfile.py
488
6221
# -*- coding: utf-8 -*- # pidlockfile.py # # Copyright © 2008–2009 Ben Finney <ben+python@benfinney.id.au> # # This is free software: you may copy, modify, and/or distribute this work # under the terms of the Python Software Foundation License, version 2 or # later as published by the Python Software Foundation. # No ...
bsd-3-clause
wright-group/WrightData
2015-12 Czech/workup.py
1
3041
''' First Created 2016/05/05 by Blaise Thompson Last Edited 2016/08/08 by Blaise Thompson Contributors: Blaise Thompson, Kyle Czech ''' ### import #################################################################### import os import sys import importlib import collections import WrightTools as wt ### define ##...
cc0-1.0
sympsi/sympsi
sympsi/tests/test_density.py
25
9696
from sympy import pprint, latex, symbols, S, log from sympy.matrices import Matrix from sympy.core.trace import Tr from sympy.external import import_module from sympy.physics.quantum.density import Density, entropy, fidelity from sympy.physics.quantum.state import Ket, Bra, TimeDepKet from sympy.physics.quantum.qubit i...
bsd-3-clause
michael-dev2rights/ansible
lib/ansible/plugins/callback/oneline.py
44
3309
# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com> # (c) 2017 Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # Make coding more python3-ish from __future__ import (absolute_import, division, print_function) __metaclass__ = type DOCUMENTATION = ''' ...
gpl-3.0
hectord/lettuce
tests/integration/lib/Django-1.2.5/tests/regressiontests/utils/module_loading.py
38
4790
import os import sys import unittest from zipimport import zipimporter from django.utils.importlib import import_module from django.utils.module_loading import module_has_submodule class DefaultLoader(unittest.TestCase): def test_loader(self): "Normal module existence can be tested" test_module = ...
gpl-3.0
scripting/trex
deps/libxml2/python/tests/xpathleak.py
10
1258
#!/usr/bin/python import sys, libxml2 libxml2.debugMemory(True) expect="""--> Invalid expression --> xmlXPathEval: evaluation failed --> Invalid expression --> xmlXPathEval: evaluation failed --> Invalid expression --> xmlXPathEval: evaluation failed --> Invalid expression --> xmlXPathEval: evaluation failed --> Inva...
gpl-3.0
tomchristie/django
django/contrib/gis/geos/prototypes/__init__.py
67
1221
""" This module contains all of the GEOS ctypes function prototypes. Each prototype handles the interaction between the GEOS library and Python via ctypes. """ from django.contrib.gis.geos.prototypes.coordseq import ( # NOQA create_cs, cs_clone, cs_getdims, cs_getordinate, cs_getsize, cs_getx, cs_gety, cs_...
bsd-3-clause
lacion/forge
forge/forge.py
1
5804
#!/usr/bin/env python """ forge.forge ~~~~~ :copyright: (c) 2010-2013 by Luis Morales :license: BSD, see LICENSE for more details. """ #heavely based on diamond https://github.com/BrightcoveOS/Diamond import os import sys import argparse import logging import traceback import inspect from util import load_class_fro...
bsd-3-clause
shubham0d/smc
salvus/scripts/storage_gluster.py
6
27125
#!/usr/bin/env python ############################################################################### # # SageMathCloud: A collaborative web-based interface to Sage, IPython, LaTeX and the Terminal. # # Copyright (C) 2014, William Stein # # This program is free software: you can redistribute it and/or modify # ...
gpl-3.0
brokenjacobs/ansible
lib/ansible/modules/cloud/centurylink/clc_publicip.py
70
12577
#!/usr/bin/python # # Copyright (c) 2015 CenturyLink # # 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 la...
gpl-3.0
Jordonbc/GlassOS
Glass_OS/build/lib/GlassOS/libaries/requests/packages/urllib3/connectionpool.py
196
31221
from __future__ import absolute_import import errno import logging import sys import warnings from socket import error as SocketError, timeout as SocketTimeout import socket try: # Python 3 from queue import LifoQueue, Empty, Full except ImportError: from Queue import LifoQueue, Empty, Full # Queue is im...
mit
dpayne9000/Rubixz-Coin
qa/rpc-tests/p2p-acceptblock.py
96
12411
#!/usr/bin/env python3 # Copyright (c) 2015-2016 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. from test_framework.mininode import * from test_framework.test_framework import BitcoinTestFramework from...
mit
morph027/ansible-modules-extras
monitoring/airbrake_deployment.py
57
3911
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright 2013 Bruce Pennypacker <bruce@pennypacker.org> # # 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...
gpl-3.0
boberfly/gaffer
python/GafferImageTest/EmptyTest.py
8
5362
########################################################################## # # Copyright (c) 2012, John Haddon. All rights reserved. # Copyright (c) 2013, Image Engine Design Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that ...
bsd-3-clause
jborean93/ansible
lib/ansible/playbook/helpers.py
11
16215
# (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
edgedb/edgedb
edb/testbase/protocol/render_utils.py
1
1595
# # This source file is part of the EdgeDB open source project. # # Copyright 2020-present MagicStack Inc. and the EdgeDB 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...
apache-2.0
sienatime/python_koans
python3/koans/about_string_manipulation.py
84
2580
#!/usr/bin/env python # -*- coding: utf-8 -*- from runner.koan import * class AboutStringManipulation(Koan): def test_use_format_to_interpolate_variables(self): value1 = 'one' value2 = 2 string = "The values are {0} and {1}".format(value1, value2) self.assertEqual(__, string) ...
mit
RevelSystems/django
tests/custom_pk/fields.py
379
1731
import random import string from django.db import models from django.utils import six from django.utils.encoding import python_2_unicode_compatible @python_2_unicode_compatible class MyWrapper(object): def __init__(self, value): self.value = value def __repr__(self): return "<%s: %s>" % (sel...
bsd-3-clause
EmadMokhtar/Django
django/contrib/messages/storage/cookie.py
47
6532
import json from django.conf import settings from django.contrib.messages.storage.base import BaseStorage, Message from django.http import SimpleCookie from django.utils.crypto import constant_time_compare, salted_hmac from django.utils.safestring import SafeData, mark_safe class MessageEncoder(json.JSONEncoder): ...
mit
derekjchow/models
research/object_detection/meta_architectures/ssd_meta_arch_test_lib.py
1
9018
# Copyright 2018 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
apache-2.0
yvaucher/hr
__unported__/hr_payroll_register_report/report/payroll_register.py
5
9273
#-*- coding:utf-8 -*- # # # OpenERP, Open Source Management Solution # Copyrigth (C) 2013 Michael Telahun Makonnen <mmakonnen@gmail.com> # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved # d$ # # This program is free software: you can redistribute it and/or modify # it under ...
agpl-3.0
glevand/buildroot--buildroot
support/testing/tests/package/test_python_django.py
21
1268
from tests.package.test_python import TestPythonPackageBase class TestPythonDjango(TestPythonPackageBase): config = TestPythonPackageBase.config sample_scripts = ["tests/package/sample_python_django.py"] def run_sample_scripts(self): timeout = 35 * self.emulator.timeout_multiplier cmd = ...
gpl-2.0
zenodo/invenio
invenio/modules/refextract/models.py
19
1287
# -*- coding: utf-8 -*- # # This file is part of Invenio. # Copyright (C) 2011, 2012, 2014 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 optio...
gpl-2.0
AnhellO/DAS_Sistemas
Ene-Jun-2019/juanalmaguer/Extraordinario/Ejercicio 4.py
1
1725
import peewee import sqlite3 file = 'countries.db' db = peewee.SqliteDatabase(file) class Pais(peewee.Model): nombre = peewee.TextField() lenguajes = peewee.TextField() continente = peewee.TextField() capital = peewee.TextField() zona = peewee.TextField() class Meta: database = db ...
mit
provaleks/o8
addons/mrp_operations/report/mrp_code_barcode.py
381
1511
# -*- 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
javierag/samba
source4/dsdb/tests/python/sam.py
2
120631
#!/usr/bin/env python # -*- coding: utf-8 -*- # This is a port of the original in testprogs/ejs/ldap.js import optparse import sys import os sys.path.insert(0, "bin/python") import samba from samba.tests.subunitrun import SubunitOptions, TestProgram samba.ensure_external_module("testtools", "testtools") samba.ensure_...
gpl-3.0
TuftsBCB/Walker
run_walker.py
1
2820
""" Main script for running tissue-specific graph walk experiments, to convergence. """ import sys import argparse from walker import Walker def generate_seed_list(seed_file): """ Read seed file into a list. """ seed_list = [] try: fp = open(seed_file, "r") except IOError: sys.exit("E...
mit
CM-Tab-S/stock_chagalllte
tools/perf/python/twatch.py
7370
1334
#! /usr/bin/python # -*- python -*- # -*- coding: utf-8 -*- # twatch - Experimental use of the perf python interface # Copyright (C) 2011 Arnaldo Carvalho de Melo <acme@redhat.com> # # This application is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License...
gpl-2.0
barachka/odoo
addons/crm_partner_assign/crm_lead.py
112
2985
# -*- 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
bkahlert/seqan-research
raw/pmbs12/pmsb13-data-20120615/trunk/misc/seqan_instrumentation/py2exe/dist/classes/id.py
17
1157
import os from datetime import datetime import random import string """Generates a permanent ID.""" class ID(object): """ @param cache_file is the file the generated ID is stored in """ def __init__(self, cache_file): self.minlength = 8 self.length = 16 self.cache_file = cache_file self.is_li...
mit
brunoabud/ic
ic/queue.py
1
4887
# coding: utf-8 # Copyright (C) 2016 Bruno Abude Cardoso # # Imagem Cinemática 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. # # Imag...
gpl-3.0
fotinakis/sentry
tests/sentry/api/endpoints/test_release_details.py
2
3182
from __future__ import absolute_import from django.core.urlresolvers import reverse from sentry.models import File, Release, ReleaseFile from sentry.testutils import APITestCase class ReleaseDetailsTest(APITestCase): def test_simple(self): self.login_as(user=self.user) project = self.create_pro...
bsd-3-clause
bwrsandman/OpenUpgrade
addons/hr_holidays/wizard/hr_holidays_summary_employees.py
337
2152
# -*- 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
adelina-t/nova
nova/tests/unit/fake_volume.py
19
10160
# 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 # d...
apache-2.0
mxlei01/healthcareai-py
healthcareai/common/model_eval.py
4
13696
"""Model evaluation tools.""" import os import sklearn import itertools import numpy as np import pandas as pd import sklearn.metrics as skmetrics from matplotlib import pyplot as plt from healthcareai.common.healthcareai_error import HealthcareAIError DIAGONAL_LINE_COLOR = '#bbbbbb' DIAGONAL_LINE_STYLE = 'dotted'...
mit
WPI-ARC/constrained_path_generator
scripts/demo.py
1
2723
#!/usr/bin/python import math import rospy import random from sensor_msgs.msg import * from geometry_msgs.msg import * from constrained_path_generator.msg import * from constrained_path_generator.srv import * def make_pose((px, py, pz), (rx, ry, rz, rw)): new_pose = Pose() new_pose.position.x = px new_po...
bsd-2-clause
dpkp/kafka-python
kafka/metrics/metric_config.py
11
1154
from __future__ import absolute_import import sys class MetricConfig(object): """Configuration values for metrics""" def __init__(self, quota=None, samples=2, event_window=sys.maxsize, time_window_ms=30 * 1000, tags=None): """ Arguments: quota (Quota, optional): U...
apache-2.0
sankroh/satchmo
satchmo/accounts/mail.py
2
1509
"""Sends mail related to accounts.""" from django.conf import settings from django.core.mail import send_mail from django.template import Context from django.template import loader from django.utils.translation import ugettext from satchmo.shop.models import Config from socket import error as SocketError import loggin...
bsd-3-clause
SUSE/azure-sdk-for-python
azure-batch/azure/batch/models/job_schedule_get_options.py
3
3302
# 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 ...
mit
talhajaved/nyuadmarket
flask/lib/python2.7/site-packages/setuptools/command/sdist.py
385
7079
from glob import glob from distutils import log import distutils.command.sdist as orig import os import sys from setuptools.compat import PY3 from setuptools.utils import cs_path_exists import pkg_resources READMES = 'README', 'README.rst', 'README.txt' _default_revctrl = list def walk_revctrl(dirname=''): """...
mit
ehashman/oh-mainline
mysite/customs/migrations/0016_lengthen_bugzilla_url_field.py
17
6004
# This file is part of OpenHatch. # Copyright (C) 2010 OpenHatch, Inc. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later v...
agpl-3.0
hadim/fiji_tools
src/main/resources/script_templates/Hadim_Scripts/ROI/ROI_and_Image_saver.py
2
1562
# @File(label="Select a directory", style="directory") parent_dir # @Dataset dataset # @DatasetIOService io # @OpService ops # @DatasetService ds import os from ij.plugin.frame import RoiManager def get_axis(axis_type): from net.imagej.axis import Axes return {'X': Axes.X, 'Y': Axes.Y, 'Z': Axes.Z, 'TIME': Axes.TIM...
bsd-3-clause
MakMukhi/grpc
tools/buildgen/bunch.py
44
2469
# Copyright 2015, 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
sbbic/core
wizards/com/sun/star/wizards/ui/UnoDialog.py
9
14148
# # # This file is part of the LibreOffice project. # # 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/. # # This file incorporates work covered by the following license no...
gpl-3.0
sanjeevtripurari/hue
desktop/core/ext-py/tablib-0.10.0/tablib/packages/openpyxl3/namedrange.py
116
2415
# file openpyxl/namedrange.py # Copyright (c) 2010 openpyxl # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, mod...
apache-2.0
TheWylieStCoyote/gnuradio
gr-fft/python/fft/qa_fft.py
2
10105
#!/usr/bin/env python # # Copyright 2008,2010,2012 Free Software Foundation, Inc. # # This file is part of GNU Radio # # SPDX-License-Identifier: GPL-3.0-or-later # # from __future__ import division from gnuradio import gr, gr_unittest, fft, blocks # Note: Octave code to verify these results: # primes = [2, 3, 5, 7,...
gpl-3.0
yqm/sl4a
python/src/Lib/test/test_isinstance.py
198
9806
# Tests some corner cases with isinstance() and issubclass(). While these # tests use new style classes and properties, they actually do whitebox # testing of error conditions uncovered when using extension types. import unittest from test import test_support import sys class TestIsInstanceExceptions(unittest.Tes...
apache-2.0
uwafsl/MissionPlanner
Lib/encodings/mac_centeuro.py
93
14665
""" Python Character Mapping Codec mac_centeuro generated from 'MAPPINGS/VENDORS/APPLE/CENTEURO.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 de...
gpl-3.0
vrenaville/stock-logistics-workflow
stock_picking_deliver_uos/wizard/stock_transfer_details.py
10
3611
# -*- coding: utf-8 -*- ############################################################################## # # Copyright (C) 2014-15 Agile Business Group sagl (<http://www.agilebg.com>) # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public Li...
agpl-3.0
dyoung418/tensorflow
tensorflow/contrib/slim/python/slim/data/prefetch_queue_test.py
76
8616
# 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
DHI-GRAS/processing_SWAT
GetTRMMData.py
2
11351
"""" #------------------------------------------------------------------------------- # Name: GetTRMMClimateData # # Author: Cecile Kittel # Created: February 2016 ******************************************************** This python code 1. Downloads TRMM 3B42 version 7 3-hourly binary files 2....
gpl-3.0
roderickmackenzie/gpvdm
gpvdm_gui/gui/license_key.py
1
2732
# # General-purpose Photovoltaic Device Model - a drift diffusion base/Shockley-Read-Hall # model for 1st, 2nd and 3rd generation solar cells. # Copyright (C) 2012-2017 Roderick C. I. MacKenzie r.c.i.mackenzie at googlemail.com # # https://www.gpvdm.com # Room B86 Coates, University Park, Nottingham, NG7 2RD...
gpl-2.0
oshanz/Learn-Django
tests/test_client/urls.py
53
1784
from __future__ import absolute_import from django.conf.urls import patterns from django.views.generic import RedirectView from . import views urlpatterns = patterns('', (r'^get_view/$', views.get_view), (r'^post_view/$', views.post_view), (r'^header_view/$', views.view_with_header), (r'^raw_post_vi...
gpl-3.0
EmanueleCannizzaro/scons
test/Climb/U-Default-no-target.py
1
1782
#!/usr/bin/env python # # Copyright (c) 2001 - 2016 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 limitation the rights to us...
mit
leiferikb/bitpop
src/third_party/tlslite/tlslite/BaseDB.py
114
3608
# Authors: # Trevor Perrin # Martin von Loewis - python 3 port # # See the LICENSE file for legal information regarding use of this file. """Base class for SharedKeyDB and VerifierDB.""" try: import anydbm except ImportError: # Python 3 import dbm as anydbm import threading class BaseDB(object): ...
gpl-3.0
lneuhaus/pyrpl
pyrpl/widgets/module_widgets/pid_widget.py
1
1109
""" A widget for pid modules. """ from .base_module_widget import ModuleWidget from qtpy import QtCore, QtWidgets class PidWidget(ModuleWidget): """ Widget for a single PID. """ def init_gui(self): self.init_main_layout(orientation="vertical") #self.main_layout = QtWidgets.QVBoxLayou...
gpl-3.0
javiergarridomellado/Empresa_django
devcodela/lib/python2.7/site-packages/django/template/debug.py
110
3602
from django.template.base import Lexer, Parser, tag_re, NodeList, VariableNode, TemplateSyntaxError from django.utils.encoding import force_text from django.utils.html import escape from django.utils.safestring import SafeData, EscapeData from django.utils.formats import localize from django.utils.timezone import templ...
gpl-2.0
openweave/openweave-tlv-schema
openweave/tlv/schema/tool.py
1
8124
#!/usr/bin/env python3 # # Copyright (c) 2020 Google LLC. # 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....
apache-2.0
rhythmsosad/numpy
numpy/distutils/fcompiler/__init__.py
152
38302
"""numpy.distutils.fcompiler Contains FCompiler, an abstract base class that defines the interface for the numpy.distutils Fortran compiler abstraction model. Terminology: To be consistent, where the term 'executable' is used, it means the single file, like 'gcc', that is executed, and should be a string. In contras...
bsd-3-clause
samueljohn/pelican-plugins
asciidoc_reader/asciidocapi.py
85
8424
#!/usr/bin/env python """ asciidocapi - AsciiDoc API wrapper class. The AsciiDocAPI class provides an API for executing asciidoc. Minimal example compiles `mydoc.txt` to `mydoc.html`: import asciidocapi asciidoc = asciidocapi.AsciiDocAPI() asciidoc.execute('mydoc.txt') - Full documentation in asciidocapi.txt. ...
agpl-3.0
uday1889/gensim
gensim/test/test_corpora_dictionary.py
46
9161
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html """ Unit tests for the `corpora.Dictionary` class. """ from collections import Mapping import logging import tempfile import unittest import os import os.path import scipy import gensim from ge...
gpl-3.0
mozillazg/bild.me-cli
setup.py
1
1880
#!/usr/bin/env python # -*- coding: utf-8 -*- from codecs import open import sys import os try: from setuptools import setup except ImportError: from distutils.core import setup import bild if sys.argv[-1] == 'publish': os.system('python setup.py sdist upload') sys.exit() requirements = [ 'requ...
mit
kamailio/kamcli
kamcli/commands/cmd_shv.py
1
1435
import click from kamcli.cli import pass_context from kamcli.iorpc import command_ctl @click.group( "shv", help="Manage $shv(name) variables", short_help="Manage $shv(name) variables", ) @pass_context def cli(ctx): pass @cli.command("get", short_help="Get the value for $shv(name)") @click.argument("...
gpl-2.0
z-fork/scrapy
scrapy/http/request/form.py
54
6789
""" This module implements the FormRequest class which is a more convenient class (than Request) to generate Requests based on form data. See documentation in docs/topics/request-response.rst """ from six.moves.urllib.parse import urljoin, urlencode import lxml.html from parsel.selector import create_root_node import...
bsd-3-clause
CXQERP/ODOOERP
addons/account/report/account_central_journal.py
381
5417
# -*- 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
abele/bokeh
bokeh/tests/test_query.py
45
6836
from __future__ import absolute_import import unittest import bokeh.query as query from bokeh.models import ( Axis, BoxZoomTool, ColumnDataSource, DatetimeAxis, GlyphRenderer, Grid, LinearAxis, LogAxis, PanTool, Plot, PreviewSaveTool, Range1d, ResetTool, ResizeTool, Tool, WheelZoomTool, ) from bokeh.models.g...
bsd-3-clause