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
nafex/pyload
module/plugins/hoster/FilepostCom.py
12
4821
# -*- coding: utf-8 -*- import re import time from module.common.json_layer import json_loads from module.plugins.captcha.ReCaptcha import ReCaptcha from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo class FilepostCom(SimpleHoster): __name__ = "FilepostCom" __type__ = "hoste...
gpl-3.0
davidharrigan/django
tests/utils_tests/test_decorators.py
319
4870
from django.http import HttpResponse from django.template import engines from django.template.response import TemplateResponse from django.test import RequestFactory, SimpleTestCase from django.utils.decorators import classproperty, decorator_from_middleware class ProcessViewMiddleware(object): def process_view(s...
bsd-3-clause
sirMackk/ZeroNet
update.py
3
4537
import urllib import zipfile import os import ssl import httplib import socket import re import json import cStringIO as StringIO from gevent import monkey monkey.patch_all() def download(): from src.util import helper urls = [ "https://github.com/HelloZeroNet/ZeroNet/archive/master.zip", "h...
gpl-2.0
Jildor/ZoneLimit
dep/libmpq/bindings/python/mpq.py
501
10430
"""wrapper for libmpq""" # 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 th...
gpl-2.0
harisibrahimkv/django
django/utils/numberformat.py
44
2476
from decimal import Decimal from django.conf import settings from django.utils.safestring import mark_safe def format(number, decimal_sep, decimal_pos=None, grouping=0, thousand_sep='', force_grouping=False): """ Get a number (as a number or string), and return it as a string, using formats de...
bsd-3-clause
vanessajurtz/lasagne4bio
secondary_proteins_prediction/predict.py
1
2125
import sys import numpy as np import importlib import lasagne as nn import theano from theano import tensor as T import os import glob import data import utils if not (2 <= len(sys.argv) <= 3): sys.exit("Usage: python predict.py <metadata_path> [subset=test]") sym_y = T.imatrix('target_output') sym_x = T.tensor3...
gpl-3.0
tdhopper/scikit-learn
sklearn/decomposition/tests/test_dict_learning.py
69
8605
import numpy as np from sklearn.utils.testing import assert_array_almost_equal from sklearn.utils.testing import assert_array_equal from sklearn.utils.testing import assert_equal from sklearn.utils.testing import assert_true from sklearn.utils.testing import assert_less from sklearn.utils.testing import assert_raises...
bsd-3-clause
pulinagrawal/nupic
tests/unit/nupic/regions/anomaly_region_test.py
5
4314
# ---------------------------------------------------------------------- # Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2015, Numenta, Inc. Unless you have purchased from # Numenta, Inc. a separate commercial license for this software code, the # following terms and conditions apply: # # This pro...
agpl-3.0
pratikmallya/hue
desktop/core/ext-py/Django-1.6.10/django/db/backends/oracle/creation.py
104
12331
import sys import time from django.conf import settings from django.db.backends.creation import BaseDatabaseCreation from django.utils.six.moves import input TEST_DATABASE_PREFIX = 'test_' PASSWORD = 'Im_a_lumberjack' class DatabaseCreation(BaseDatabaseCreation): # This dictionary maps Field objects to their ass...
apache-2.0
shadowmint/nwidget
lib/pyglet-1.4.4/tests/window/MODE_SWITCH.py
29
1220
#!/usr/bin/env python ''' ''' __docformat__ = 'restructuredtext' __version__ = '$Id: $' import unittest from pyglet import window from pyglet.window.event import WindowEventLogger from pyglet.window import key from pyglet.gl import * import window_util class WINDOW_SET_FULLSCREEN(unittest.TestCase): def on_te...
apache-2.0
cytec/SickRage
lib/unidecode/x0fb.py
252
3838
data = ( 'ff', # 0x00 'fi', # 0x01 'fl', # 0x02 'ffi', # 0x03 'ffl', # 0x04 'st', # 0x05 'st', # 0x06 '[?]', # 0x07 '[?]', # 0x08 '[?]', # 0x09 '[?]', # 0x0a '[?]', # 0x0b '[?]', # 0x0c '[?]', # 0x0d '[?]', # 0x0e '[?]', # 0x0f '[?]', # 0x10 '[?]', # 0x11 '[?]', ...
gpl-3.0
pedrobaeza/odoo
addons/account/wizard/account_move_bank_reconcile.py
385
2684
# -*- 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
2mny/mylar
lib/cherrypy/wsgiserver/ssl_builtin.py
79
2589
"""A library for integrating Python's builtin ``ssl`` library with CherryPy. The ssl module must be importable for SSL functionality. To use this module, set ``CherryPyWSGIServer.ssl_adapter`` to an instance of ``BuiltinSSLAdapter``. """ try: import ssl except ImportError: ssl = None from cherrypy import ws...
gpl-3.0
ChenJunor/hue
apps/oozie/src/oozie/migrations/0007_auto__chg_field_sqoop_script_path.py
40
19875
# encoding: utf-8 import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Changing field 'Sqoop.script_path' db.alter_column('oozie_sqoop', 'script_path', self.gf('django.db.models.field...
apache-2.0
cdcarter/CumulusCI
cumulusci/tasks/release_notes/github_api.py
2
2818
import httplib import json import re import requests from .exceptions import GithubApiNotFoundError from .exceptions import GithubApiNoResultsError from .exceptions import GithubApiUnauthorized class GithubApiMixin(object): github_api_base_url = 'https://api.github.com' @property def github_owner(self)...
bsd-3-clause
eagleamon/home-assistant
homeassistant/components/netatmo.py
14
4057
""" Support for the Netatmo devices. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/netatmo/ """ import logging from datetime import timedelta from urllib.error import HTTPError import voluptuous as vol from homeassistant.const import ( CONF_API_KE...
apache-2.0
sudheesh001/oh-mainline
vendor/packages/kombu/kombu/tests/transport/virtual/test_scheduling.py
38
1835
from __future__ import absolute_import from kombu.transport.virtual.scheduling import FairCycle from kombu.tests.case import Case class MyEmpty(Exception): pass def consume(fun, n): r = [] for i in range(n): r.append(fun()) return r class test_FairCycle(Case): def test_cycle(self): ...
agpl-3.0
40223139/2015cdaa5-12
static/Brython3.1.0-20150301-090019/Lib/unittest/test/test_result.py
788
19069
import io import sys import textwrap from test import support import traceback import unittest class Test_TestResult(unittest.TestCase): # Note: there are not separate tests for TestResult.wasSuccessful(), # TestResult.errors, TestResult.failures, TestResult.testsRun or # TestResult.shouldStop because t...
gpl-3.0
neogis-de/qgis-remote-debug
RemoteDebug/dbg_client/coverage/execfile.py
2
1150
"""Execute files of Python code.""" import imp, os, sys def run_python_file(filename, args): """Run a python file as if it were the main program on the command line. `filename` is the path to the file to execute, it need not be a .py file. `args` is the argument array to present as sys.argv, includin...
gpl-3.0
orgito/ansible
lib/ansible/modules/network/f5/bigip_password_policy.py
21
13252
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright: (c) 2018, F5 Networks Inc. # GNU General Public License v3.0 (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', ...
gpl-3.0
bbenko/shinkicker
django/db/backends/__init__.py
77
31617
import decimal try: import thread except ImportError: import dummy_thread as thread from threading import local from django.conf import settings from django.db import DEFAULT_DB_ALIAS from django.db.backends import util from django.db.transaction import TransactionManagementError from django.utils import datet...
bsd-3-clause
beni55/pyechonest
pyechonest/proxies.py
21
7355
#!/usr/bin/env python # encoding: utf-8 """ Copyright (c) 2010 The Echo Nest. All rights reserved. Created by Tyler Williams on 2010-04-25. """ import util class ResultList(list): def __init__(self, li, start=0, total=0): self.extend(li) self.start = start if total == 0: total ...
bsd-3-clause
bealdav/OpenUpgrade
addons/account_test/account_test.py
39
2179
# -*- encoding: utf-8 -*- ############################################################################## # # Copyright (c) 2005-2006 TINY SPRL. (http://tiny.be) All Rights Reserved. # # $Id: product_expiry.py 4304 2006-10-25 09:54:51Z ged $ # # WARNING: This program as such is intended to be used by professional # prog...
agpl-3.0
kaos/cattle
tests/integration/cattletest/core/test_user_preferences.py
7
3604
from common_fixtures import * # NOQA from gdapi import ApiError @pytest.fixture(scope='module') def user_client(context): return context.user_client def _user_preference(client, name=None): if name is None: name = random_str() preference = client.wait_success(client.create_user_preference( ...
apache-2.0
wwmm/wwplot
WWplot/fit.py
1
1679
# -*- coding: utf-8 -*- import scipy.odr from numpy import * from PySide2.QtCore import QObject, Signal class Fit(QObject): finished = Signal() def __init__(self, maxit=1000): QObject.__init__(self) self.maxit = maxit self.ready = False self.x, self.xerr = [], [] se...
gpl-3.0
terbolous/cloudstack-ec2stack
tests/tags_tests.py
3
6771
#!/usr/bin/env python # encoding: utf-8 # # 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 Licens...
apache-2.0
mzizzi/ansible
lib/ansible/modules/monitoring/nagios.py
71
36457
#!/usr/bin/python # -*- coding: utf-8 -*- # # This file is largely copied from the Nagios module included in the # Func project. Original copyright follows: # # func-nagios - Schedule downtime and enables/disable notifications # Copyright 2011, Red Hat, Inc. # Tim Bielawa <tbielawa@redhat.com> # # This software may be ...
gpl-3.0
toast38coza/DJProcess
process/tasks/google_natural_language/test_extract_sentiment.py
1
1090
from google.cloud import language client = language.Client() import csv def get_sentiment(message): doc = client.document_from_text(message) f_in = open('/Users/toast38coza/Downloads/verbatims.csv', 'rb') f_out = open('/Users/toast38coza/Downloads/verbatims-new.csv', 'wb') reader = csv.reader(f_in) writer = csv.w...
mit
kenshay/ImageScripter
Script_Runner/PYTHON/Lib/site-packages/PyQt5/uic/Compiler/indenter.py
12
2742
############################################################################# ## ## Copyright (C) 2014 Riverbank Computing Limited. ## Copyright (C) 2006 Thorsten Marek. ## All right reserved. ## ## This file is part of PyQt. ## ## You may use this file under the terms of the GPL v2 or the revised BSD ## license as fol...
gpl-3.0
mystic123/DeepLearning
Basics/optimizers.py
1
7742
import numpy as np class Optimizer: """ Optimizer class """ def __init__(self, net, cost, learning_rate, *args, **kwargs): self.net = net self.cost = cost self.learning_rate = learning_rate def compute_gradients(self, batch, y, *args, **kwargs): zs, as_ = self.net...
mit
JoshuaSenouf/GLEngine
api/assimp/port/PyAssimp/scripts/sample.py
31
2716
#!/usr/bin/env python #-*- coding: UTF-8 -*- """ This module demonstrates the functionality of PyAssimp. """ import os, sys import logging logging.basicConfig(level=logging.INFO) import pyassimp import pyassimp.postprocess def recur_node(node,level = 0): print(" " + "\t" * level + "- " + str(node)) for chi...
gpl-3.0
faust64/ansible
lib/ansible/plugins/lookup/dict.py
220
1203
# (c) 2014, Kent R. Spillner <kspillner@acm.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 3 of the License, or # (at your option) any later ve...
gpl-3.0
adamcharnock/swiftwind
swiftwind/billing_cycle/tests.py
2
18116
import six from django.db import transaction from django.db.utils import IntegrityError from django.test import TestCase, TransactionTestCase from django.core import mail from datetime import date from unittest.mock import patch from django.urls.base import reverse from django.utils.timezone import datetime from freez...
mit
joker946/nova
nova/tests/unit/virt/hyperv/test_ioutils.py
64
2176
# Copyright 2014 Cloudbase Solutions Srl # 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 r...
apache-2.0
linjoahow/W16_test1
static/Brython3.1.0-20150301-090019/Lib/site-packages/pygame/rect.py
603
13689
#!/usr/bin/env python '''Pygame object for storing rectangular coordinates. ''' __docformat__ = 'restructuredtext' __version__ = '$Id$' import copy #import SDL.video import SDL class _RectProxy: '''Proxy for SDL_Rect that can handle negative size.''' __slots__ = ['x', 'y', 'w', 'h'] def __init__(self...
gpl-3.0
nitin-cherian/LifeLongLearning
Python/PythonProgrammingLanguage/Encapsulation/encap_env/lib/python3.5/site-packages/jupyter_core/tests/test_command.py
8
3909
"""Test the Jupyter command-line""" import json import os import sys from subprocess import check_output, CalledProcessError import pytest try: from unittest.mock import patch except ImportError: # py2 from mock import patch from jupyter_core import __version__ from jupyter_core.command import list_subco...
mit
zonk1024/moto
tests/test_swf/models/test_workflow_execution.py
3
17490
from sure import expect from freezegun import freeze_time from moto.swf.models import ( ActivityType, Timeout, WorkflowType, WorkflowExecution, ) from moto.swf.exceptions import ( SWFDefaultUndefinedFault, ) from ..utils import ( auto_start_decision_tasks, get_basic_domain, get_basic_w...
apache-2.0
Miserlou/OpenWatch
openwatch/settings.py
1
4279
import os DEBUG = True TEMPLATE_DEBUG = DEBUG ADMINS = ( # ('Your Name', 'your_email@domain.com'), ) BASE_URL = 'http://www.openwatch.net' MANAGERS = ADMINS DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'. ...
apache-2.0
southpawtech/TACTIC-DEV
src/pyasm/prod/web/composite_wdg.py
6
6370
########################################################### # # Copyright (c) 2005, Southpaw Technology # All Rights Reserved # # PROPRIETARY INFORMATION. This software is proprietary to # Southpaw Technology, and is not to be reproduced, transmitted, # or disclosed in any way without written permi...
epl-1.0
marcosmodesto/django-testapp
django/contrib/localflavor/at/forms.py
88
2515
""" AT-specific Form helpers """ import re from django.core.validators import EMPTY_VALUES from django.forms import ValidationError from django.forms.fields import Field, RegexField, Select from django.utils.translation import ugettext_lazy as _ re_ssn = re.compile(r'^\d{4} \d{6}') class ATZipCodeField(RegexField)...
bsd-3-clause
salguarnieri/intellij-community
python/lib/Lib/distutils/command/bdist_rpm.py
81
20200
"""distutils.command.bdist_rpm Implements the Distutils 'bdist_rpm' command (create RPM source and binary distributions).""" # This module should be kept compatible with Python 2.1. __revision__ = "$Id: bdist_rpm.py 52742 2006-11-12 18:56:18Z martin.v.loewis $" import sys, os, string import glob from types import *...
apache-2.0
dednal/chromium.src
third_party/gtk+/gtk/compose-parse.py
149
34346
#!/usr/bin/env python # -*- coding: utf-8 -*- # # compose-parse.py, version 1.3 # # multifunction script that helps manage the compose sequence table in GTK+ (gtk/gtkimcontextsimple.c) # the script produces statistics and information about the whole process, run with --help for more. # # You may need to switch your pyt...
bsd-3-clause
joebowen/movement_validation_cloud
djangodev/lib/python2.7/site-packages/boto/services/__init__.py
782
1108
# Copyright (c) 2006,2007 Mitch Garnaat http://garnaat.org/ # # 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, modi...
mit
ocefpaf/odvc
tests/test_ocean_s_coordinate_g1.py
3
2760
from __future__ import absolute_import, division, print_function import os import unittest import dask.array as da import numpy as np from netCDF4 import Dataset from odvc import ocean_s_coordinate_g1 from odvc.utils import ( get_formula_terms, get_formula_terms_dims, get_formula_terms_variables, pre...
bsd-3-clause
jmacmahon/invenio
modules/miscutil/lib/containerutils.py
2
8584
# This file is part of Invenio. # Copyright (C) 2012 CERN. # # Invenio is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License as # published by the Free Software Foundation; either version 2 of the # License, or (at your option) any later version. # # Invenio is d...
gpl-2.0
da1z/intellij-community
python/testData/inspections/PyUnreachableCodeInspection/Unreachable.py
4
2105
def f(): return <warning descr="This code is unreachable">a = 1</warning> def f(): if 0: return a = 1 # pass def f(): raise Exception() <warning descr="This code is unreachable">a = 1</warning> def f(): for x in []: break <warning descr="This code is unreachable...
apache-2.0
EricMuller/mywebmarks-backend
apps/webmarks/bookmarks/migrations/0001_initial.py
4
7577
# -*- coding: utf-8 -*- # Generated by Django 1.11 on 2017-06-04 09:58 from __future__ import unicode_literals from django.conf import settings from django.db import migrations, models import django.db.models.deletion import mptt.fields class Migration(migrations.Migration): initial = True dependencies = [...
mit
sperez4mba/pyNES
pynes/tests/dec_test.py
28
2231
# -*- coding: utf-8 -*- import unittest from pynes.compiler import lexical, syntax, semantic class DecTest(unittest.TestCase): def test_dec_zp(self): tokens = list(lexical('DEC $00')) self.assertEquals(2, len(tokens)) self.assertEquals('T_INSTRUCTION', tokens[0]['type']) self.as...
bsd-3-clause
jmesteve/saas3
openerp/addons/account/wizard/account_subscription_generate.py
38
2269
# -*- 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
TalShafir/ansible
lib/ansible/modules/storage/netapp/na_ontap_svm.py
9
18691
#!/usr/bin/python # (c) 2018, NetApp, Inc # GNU General Public License v3.0+ # (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['preview'], ...
gpl-3.0
VanillaProject/platform_external_chromium
testing/gtest/test/gtest_uninitialized_test.py
2901
2480
#!/usr/bin/env python # # Copyright 2008, 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...
bsd-3-clause
aviarypl/mozilla-l10n-addons-server
src/olympia/accounts/tests/test_tasks.py
7
1771
from datetime import datetime from olympia.accounts.tasks import primary_email_change_event from olympia.accounts.tests.test_utils import totimestamp from olympia.amo.tests import TestCase, user_factory class TestPrimaryEmailChangeEvent(TestCase): def test_success(self): user = user_factory(email='old-e...
bsd-3-clause
krattai/noo-ebs
docs/zeroMQ-guide2/examples/Python/ticlient.py
1
1692
""" Titanic client example Implements client side of http:rfc.zeromq.org/spec:9 Author : Min RK <benjaminrk@gmail.com> """ import sys import time from mdcliapi import MajorDomoClient def service_call (session, service, request): """Calls a TSP service Returns reponse if successful (status code 200 OK),...
bsd-2-clause
kamailio/kamcli
kamcli/commands/cmd_uacreg.py
1
6162
import click from sqlalchemy import create_engine from kamcli.ioutils import ioutils_dbres_print from kamcli.cli import pass_context from kamcli.iorpc import command_ctl @click.group( "uacreg", help="Manage uac remote registrations", short_help="Manage uac registrations", ) @pass_context def cli(ctx): ...
gpl-2.0
stroykova/luigi
luigi/contrib/opener.py
6
7235
# -*- coding: utf-8 -*- # # Copyright 2012-2015 Spotify AB # # 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...
apache-2.0
accraze/bitcoin
contrib/devtools/security-check.py
14
6474
#!/usr/bin/python2 ''' Perform basic ELF security checks on a series of executables. Exit status will be 0 if successful, and the program will be silent. Otherwise the exit status will be 1 and it will log which executables failed which checks. Needs `readelf` (for ELF) and `objdump` (for PE). ''' from __future__ impor...
mit
EduPepperPDTesting/pepper2013-testing
lms/djangoapps/reportlab/pdfbase/_fontdata_widths_courierbold.py
20
3893
widths = {'A': 600, 'AE': 600, 'Aacute': 600, 'Acircumflex': 600, 'Adieresis': 600, 'Agrave': 600, 'Aring': 600, 'Atilde': 600, 'B': 600, 'C': 600, 'Ccedilla': 600, 'D': 600, 'E': 600, 'Eacute': 600, 'Ecircumflex': 600, 'Edieresis': 600, 'Egrave': 600, 'Eth': 600, 'Euro': 600, 'F':...
agpl-3.0
Jonadabe/letsencrypt
letsencrypt/achallenges.py
1
2725
"""Client annotated ACME challenges. Please use names such as ``achall`` to distiguish from variables "of type" :class:`acme.challenges.Challenge` (denoted by ``chall``) and :class:`.ChallengeBody` (denoted by ``challb``):: from acme import challenges from acme import messages from letsencrypt import achallenge...
apache-2.0
mja054/swift_plugin
test/unit/container/test_updater.py
4
8220
# Copyright (c) 2010-2011 OpenStack, LLC. # # 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 ...
apache-2.0
cxxgtxy/tensorflow
tensorflow/contrib/kernel_methods/python/mappers/dense_kernel_mapper.py
113
1907
# 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
rjschwei/boto
tests/integration/sqs/test_cert_verification.py
126
1535
# Copyright (c) 2012 Mitch Garnaat http://garnaat.org/ # Copyright (c) 2012 Amazon.com, Inc. or its affiliates. # All rights reserved. # # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated documentation files (the # "Software"), to deal in the Software withou...
mit
LokiCoder/Sick-Beard
lib/requests/adapters.py
10
16627
# -*- coding: utf-8 -*- """ requests.adapters ~~~~~~~~~~~~~~~~~ This module contains the transport adapters that Requests uses to define and maintain connections. """ import socket from .models import Response from .packages.urllib3.poolmanager import PoolManager, proxy_from_url from .packages.urllib3.response impo...
gpl-3.0
ksachs/invenio
modules/websession/lib/webgroup_unit_tests.py
16
1868
# -*- coding: utf-8 -*- ## ## This file is part of Invenio. ## Copyright (C) 2007, 2008, 2009, 2010, 2011 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 ## Licens...
gpl-2.0
Ballz0fSteel/Umeko
lib/pip/basecommand.py
341
11910
"""Base Command class, and related routines""" from __future__ import absolute_import import logging import os import sys import optparse import warnings from pip import cmdoptions from pip.index import PackageFinder from pip.locations import running_under_virtualenv from pip.download import PipSession from pip.excep...
gpl-3.0
edx/i18n-tools
tests/test_changed.py
1
2745
from os import remove from shutil import copyfile import ddt from unittest import mock from i18n.changed import Changed from . import I18nToolTestCase, MOCK_APPLICATION_DIR @ddt.ddt class TestChanged(I18nToolTestCase): """ Tests functionality of i18n/changed.py """ def setUp(self): super().s...
apache-2.0
gcasey/cosmotrack
scripts/configParsers.py
1
4387
################################################################################ # # Copyright 2013 Kitware, 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...
apache-2.0
indrajitr/ansible
lib/ansible/module_utils/common/text/converters.py
29
13313
# -*- coding: utf-8 -*- # Copyright (c) 2019 Ansible Project # (c) 2016 Toshio Kuratomi <tkuratomi@ansible.com> # Simplified BSD License (see licenses/simplified_bsd.txt or https://opensource.org/licenses/BSD-2-Clause) from __future__ import absolute_import, division, print_function __metaclass__ = type import codecs...
gpl-3.0
MeshCollider/bitcoin
test/functional/rpc_rawtransaction.py
15
30223
#!/usr/bin/env python3 # Copyright (c) 2014-2020 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Test the rawtransaction RPCs. Test the following RPCs: - createrawtransaction - signrawtransacti...
mit
drufat/vispy
examples/demo/scene/picking.py
17
2996
import numpy as np import vispy.plot as vp from vispy.color import get_colormap # load example data from vispy.io import load_data_file data = np.load(load_data_file('electrophys/iv_curve.npz'))['arr_0'] data *= 1000 # V -> mV dt = 1e-4 # this data is sampled at 10 kHz # create figure with plot fig = vp.Fig() plt =...
bsd-3-clause
ArthurGarnier/SickRage
lib/guessit/rules/properties/bonus.py
34
1523
#!/usr/bin/env python # -*- coding: utf-8 -*- """ bonus property """ from rebulk.remodule import re from rebulk import Rebulk, AppendMatch, Rule from .title import TitleFromPosition from ..common.formatters import cleanup from ..common.validators import seps_surround def bonus(): """ Builder for rebulk obje...
gpl-3.0
pattern3/pattern
pattern/text/en/inflect.py
3
32321
#### PATTERN | EN | INFLECT ############################################## # -*- coding: utf-8 -*- # Copyright (c) 2010 University of Antwerp, Belgium # Author: Tom De Smedt <tom@organisms.be> # License: BSD (see LICENSE.txt for details). ########################################################################## # Reg...
bsd-3-clause
moreati/numpy
numpy/core/setup_common.py
27
13934
from __future__ import division, absolute_import, print_function # Code common to build tools import sys import warnings import copy import binascii from numpy.distutils.misc_util import mingw32 #------------------- # Versioning support #------------------- # How to change C_API_VERSION ? # - increase C_API_VERSI...
bsd-3-clause
google/earthenterprise
earth_enterprise/src/update_fusion_version.py
5
5884
#!/usr/bin/env python2.7 # # Copyright 2017 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 l...
apache-2.0
tornadozou/tensorflow
tensorflow/contrib/slim/python/slim/nets/resnet_v2_test.py
49
18547
# 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
plin1112/pysimm
pysimm/cli.py
3
6798
# ****************************************************************************** # pysimm.cli module # ****************************************************************************** # # command line interface for pysimm # # ****************************************************************************** # License # *****...
mit
lundjordan/mozharness
mozharness/mozilla/buildbot.py
5
8030
#!/usr/bin/env python # ***** BEGIN LICENSE BLOCK ***** # 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/. # ***** END LICENSE BLOCK ***** """Code to tie into buildbot. Ide...
mpl-2.0
crakensio/django_training
lib/python2.7/site-packages/coverage/phystokens.py
160
7401
"""Better tokenizing for coverage.py.""" import codecs, keyword, re, sys, token, tokenize from coverage.backward import set # pylint: disable=W0622 from coverage.parser import generate_tokens def phys_tokens(toks): """Return all physical tokens, even line continuations. tokenize.genera...
cc0-1.0
meyerson/luigi
luigi/contrib/sparkey.py
92
2010
# -*- coding: utf-8 -*- # # Copyright 2012-2015 Spotify AB # # 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...
apache-2.0
mitchcapper/mythbox
resources/lib/twisted/twisted/python/dispatch.py
64
1187
# Copyright (c) 2001-2004 Twisted Matrix Laboratories. # See LICENSE for details. import warnings warnings.warn( "Create your own event dispatching mechanism, " "twisted.python.dispatch will soon be no more.", DeprecationWarning, 2) class EventDispatcher: """ A global event dispatcher for events....
gpl-2.0
letouriste001/SmartForest_2.0
python3.4Smartforest/lib/python3.4/site-packages/django/utils/translation/trans_null.py
1
1408
# These are versions of the functions in django.utils.translation.trans_real # that don't actually do anything. This is purely for performance, so that # settings.USE_I18N = False can use this module rather than trans_real.py. from django.conf import settings from django.utils.encoding import force_text def ngettext...
mit
davidmueller13/android_kernel_lge_msm8974
tools/perf/scripts/python/syscall-counts.py
11181
1522
# system call counts # (c) 2010, Tom Zanussi <tzanussi@gmail.com> # Licensed under the terms of the GNU GPL License version 2 # # Displays system-wide system call totals, broken down by syscall. # If a [comm] arg is specified, only syscalls called by [comm] are displayed. import os import sys sys.path.append(os.envir...
gpl-2.0
jkorell/PTVS
Python/Tests/TestData/VirtualEnv/env/Lib/encodings/cp863.py
93
35206
""" Python Character Mapping Codec generated from 'VENDORS/MICSFT/PC/CP863.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_map) def decode(self,input,errors=...
apache-2.0
ProjectQ-Framework/ProjectQ
projectq/setups/decompositions/h2rx.py
1
2023
# -*- coding: utf-8 -*- # Copyright 2017 ProjectQ-Framework (www.projectq.ch) # # 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 # # ...
apache-2.0
gram526/VTK
ThirdParty/Twisted/twisted/test/test_roots.py
41
1797
# Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. from twisted.trial import unittest from twisted.python import roots import types class RootsTest(unittest.TestCase): def testExceptions(self): request = roots.Request() try: request.write("blah") except No...
bsd-3-clause
xinl/blog2json
boto/services/result.py
5
5783
#!/usr/bin/env python # Copyright (c) 2006,2007 Mitch Garnaat http://garnaat.org/ # # 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 rig...
bsd-2-clause
smblance/ggplot
ggplot/tests/test_chart_components.py
12
1664
from __future__ import (absolute_import, division, print_function, unicode_literals) import numpy as np import pandas as pd from nose.tools import assert_raises, assert_equal, assert_is_none from ggplot import * from ggplot.utils.exceptions import GgplotError def test_chart_components(): ...
bsd-2-clause
montyly/manticore
manticore/native/state.py
1
2684
from ..core.state import StateBase, Concretize, TerminateState from ..native.memory import ConcretizeMemory, MemoryException class State(StateBase): @property def cpu(self): """ Current cpu state """ return self._platform.current @property def mem(self): """ ...
apache-2.0
krez13/scikit-learn
sklearn/preprocessing/imputation.py
29
14119
# Authors: Nicolas Tresegnie <nicolas.tresegnie@gmail.com> # License: BSD 3 clause import warnings import numpy as np import numpy.ma as ma from scipy import sparse from scipy import stats from ..base import BaseEstimator, TransformerMixin from ..utils import check_array from ..utils.fixes import astype from ..utils...
bsd-3-clause
Ambuj-UF/ConCat-1.0
src/Utils/Bio/SCOP/Cla.py
5
3745
# Copyright 2001 by Gavin E. Crooks. All rights reserved. # Modifications Copyright 2010 Jeffrey Finkelstein. All rights reserved. # # This code is part of the Biopython distribution and governed by its # license. Please see the LICENSE file that should have been included # as part of this package. """ Handle the SC...
gpl-2.0
martijnthe/qemu_stm32
scripts/tracetool/format/h.py
16
1119
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Generate .h file. """ __author__ = "Lluís Vilanova <vilanova@ac.upc.edu>" __copyright__ = "Copyright 2012, Lluís Vilanova <vilanova@ac.upc.edu>" __license__ = "GPL version 2 or (at your option) any later version" __maintainer__ = "Stefan Hajnoczi" __email__ ...
gpl-2.0
c72578/poedit
deps/boost/tools/build/test/core_actions_quietly.py
51
1038
#!/usr/bin/python # Copyright 2007 Rene Rivera. # Copyright 2011 Steven Watanabe # Distributed under the Boost Software License, Version 1.0. # (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) import BoostBuild t = BoostBuild.Tester(pass_toolset=0) t.write("file.jam", """\ actions qui...
mit
vamsirajendra/nupic
nupic/regions/RecordSensor.py
25
18728
#!/usr/bin/env python # ---------------------------------------------------------------------- # Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2013-15, Numenta, Inc. Unless you have an agreement # with Numenta, Inc., for a separate license for this software code, the # following terms and conditi...
agpl-3.0
the-adrian/demoFlask
venv/lib/python2.7/site-packages/pip/_vendor/distlib/compat.py
357
38875
# -*- coding: utf-8 -*- # # Copyright (C) 2013 Vinay Sajip. # Licensed to the Python Software Foundation under a contributor agreement. # See LICENSE.txt and CONTRIBUTORS.txt. # from __future__ import absolute_import import os import re import sys if sys.version_info[0] < 3: from StringIO import StringIO stri...
gpl-3.0
Ahmad31/Web_Flask_Cassandra
flask/lib/python2.7/site-packages/cassandra/connection.py
2
42216
# Copyright 2013-2016 DataStax, 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 writi...
apache-2.0
treejames/viewfinder
backend/base/test/testing_test.py
13
1897
import mock from cStringIO import StringIO from tornado import httpclient from viewfinder.backend.base import testing kURL = "http://www.example.com/" class MockAsyncHTTPClientTestCase(testing.BaseTestCase): def setUp(self): super(MockAsyncHTTPClientTestCase, self).setUp() self.http_client = testing.MockAs...
apache-2.0
kholidfu/django
tests/migrations/test_graph.py
99
11829
import warnings from django.db.migrations.exceptions import ( CircularDependencyError, NodeNotFoundError, ) from django.db.migrations.graph import RECURSION_DEPTH_WARNING, MigrationGraph from django.test import SimpleTestCase from django.utils.encoding import force_text class GraphTests(SimpleTestCase): """ ...
bsd-3-clause
kmoocdev2/edx-platform
lms/djangoapps/dashboard/git_import.py
10
11864
""" Provides a function for importing a git repository into the lms instance when using a mongo modulestore """ import logging import os import re import StringIO import subprocess import mongoengine from django.conf import settings from django.core import management from django.core.management.base import CommandErr...
agpl-3.0
Jgarcia-IAS/SAT
openerp/addons-extra/odoo-pruebas/odoo-server/addons/auth_signup/__init__.py
446
1039
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2012-today OpenERP SA (<http://www.openerp.com>) # # This program is free software: you can redistribute it and/or modify # it under the terms o...
agpl-3.0
EricMuller/mywebmarks-backend
requirements/twisted/Twisted-17.1.0/build/lib.linux-x86_64-3.5/twisted/names/test/test_tap.py
13
4961
# Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ Tests for L{twisted.names.tap}. """ from twisted.internet.base import ThreadedResolver from twisted.names.client import Resolver from twisted.names.dns import PORT from twisted.names.resolve import ResolverChain from twisted.names.secondary i...
mit
cisco-openstack/neutron
neutron/tests/unit/agent/linux/test_iptables_manager.py
21
43633
# Copyright 2012 Locaweb. # 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