repo_name
stringlengths
5
100
path
stringlengths
4
375
copies
stringclasses
991 values
size
stringlengths
4
7
content
stringlengths
666
1M
license
stringclasses
15 values
ybellavance/python-for-android
python3-alpha/python3-src/Lib/linecache.py
785
3864
"""Cache lines from files. This is intended to read lines from modules imported -- hence if a filename is not found, it will look down the module search path for a file by that name. """ import sys import os import tokenize __all__ = ["getline", "clearcache", "checkcache"] def getline(filename, lineno, module_globa...
apache-2.0
igor-toga/local-snat
neutron/tests/tempest/scenario/base.py
4
5427
# Copyright 2016 Red Hat, Inc. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by...
apache-2.0
sauloal/cnidaria
scripts/venv/local/lib/python2.7/encodings/mac_romanian.py
593
13917
""" Python Character Mapping Codec mac_romanian generated from 'MAPPINGS/VENDORS/APPLE/ROMANIAN.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...
mit
coderb0t/CouchPotatoServer
libs/suds/cache.py
164
9133
# This program is free software; you can redistribute it and/or modify # it under the terms of the (LGPL) GNU Lesser 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 it will ...
gpl-3.0
fiddlerwoaroof/new_rl
libs/combat_parts/skills.py
1
2932
from ..dice import MULT, ADD from .. import dice from .constants import * import collections def health_mod(func): def _inner(self): mod = 0 if self.attr.state >= WOUNDED: mod = -3 result = func(self) result += mod return result return _inner class Skills(object): def __init__(self, attr): self.ski...
apache-2.0
cybercarnage/mongo-web-shell
mongows/initializers/util.py
7
3214
# Copyright 2013 10gen 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...
apache-2.0
draekko/androguard
androguard/core/api_specific_resources/aosp_permissions/aosp_permissions.py
15
2110
import androguard.core.api_specific_resources.aosp_permissions.aosp_permissions_api9 as api9 import androguard.core.api_specific_resources.aosp_permissions.aosp_permissions_api10 as api10 import androguard.core.api_specific_resources.aosp_permissions.aosp_permissions_api14 as api14 import androguard.core.api_specific_r...
apache-2.0
nacc/autotest
frontend/migrations/058_drone_management.py
16
1979
UP_SQL = """ CREATE TABLE afe_drones ( id INT AUTO_INCREMENT NOT NULL PRIMARY KEY, hostname VARCHAR(255) NOT NULL ) ENGINE=InnoDB; ALTER TABLE afe_drones ADD CONSTRAINT afe_drones_unique UNIQUE KEY (hostname); CREATE TABLE afe_drone_sets ( id INT AUTO_INCREMENT NOT NULL PRIMARY KEY, name VARCHAR(255) NOT NUL...
gpl-2.0
gale320/newfies-dialer
newfies/appointment/management/commands/load_example_data.py
9
4524
from django.core.management.base import NoArgsCommand class Command(NoArgsCommand): help = "Load some sample data into the db" def handle_noargs(self, **options): import datetime from schedule.models import Calendar from schedule.models import Event from schedule.models import...
mpl-2.0
ianweller/fedora-business-cards
fedora_business_cards/frontend/cmdline.py
1
6944
### # fedora-business-cards - for rendering Fedora contributor business cards # Copyright (C) 2012 Red Hat, Inc. and others. # Primary maintainer: Ian Weller <iweller@redhat.com> # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published...
gpl-2.0
buildhappy/ice
cpp/test/IceGrid/replicaGroup/run.py
3
1267
#!/usr/bin/env python # ********************************************************************** # # Copyright (c) 2003-2015 ZeroC, Inc. All rights reserved. # # This copy of Ice is licensed to you under the terms described in the # ICE_LICENSE file included in this distribution. # # *************************************...
gpl-2.0
danielvdao/TheAnimalFarm
venv/lib/python2.7/site-packages/pip/_vendor/requests/packages/chardet/compat.py
2943
1157
######################## BEGIN LICENSE BLOCK ######################## # Contributor(s): # Ian Cordasco - port to Python # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # versio...
gpl-2.0
pybrain2/pybrain2
pybrain/datasets/supervised.py
2
7529
from __future__ import print_function __author__ = 'Thomas Rueckstiess, ruecksti@in.tum.de' from numpy import random from random import sample from scipy import isscalar from pybrain.datasets.dataset import DataSet from pybrain.utilities import fListToString class SupervisedDataSet(DataSet): """SupervisedDataS...
bsd-3-clause
lfblogs/aio2py
aio2py/required/aiopg/connection.py
1
12976
import asyncio import sys import warnings import psycopg2 from psycopg2.extensions import ( POLL_OK, POLL_READ, POLL_WRITE, POLL_ERROR) from psycopg2 import extras from aio2py.required.aiopg.cursor import Cursor __all__ = ('connect',) TIMEOUT = 60.0 PY_34 = sys.version_info >= (3, 4) @asyncio.coroutine def ...
apache-2.0
garrett-schlesinger/python-social-auth
social/backends/behance.py
13
1489
""" Behance OAuth2 backend, docs at: http://psa.matiasaguirre.net/docs/backends/behance.html """ from social.backends.oauth import BaseOAuth2 class BehanceOAuth2(BaseOAuth2): """Behance OAuth authentication backend""" name = 'behance' AUTHORIZATION_URL = 'https://www.behance.net/v2/oauth/authenticate'...
bsd-3-clause
smartforceplus/SmartForceplus
addons/hr_holidays/wizard/__init__.py
442
1122
# -*- 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
magicrub/MissionPlanner
Lib/site-packages/scipy/linalg/tests/test_build.py
61
1698
from subprocess import call, PIPE, Popen import sys import re from numpy.testing import TestCase, dec from numpy.compat import asbytes from scipy.linalg import flapack # XXX: this is copied from numpy trunk. Can be removed when we will depend on # numpy 1.3 class FindDependenciesLdd: def __init__(self): ...
gpl-3.0
andmos/ansible
lib/ansible/modules/storage/purestorage/purefa_volume.py
13
10501
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2018, Simon Dodsley (simon@purestorage.com) # 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
marcosmodesto/django-testapp
django/django/db/models/aggregates.py
521
2101
""" Classes to represent the definitions of aggregate functions. """ class Aggregate(object): """ Default Aggregate definition. """ def __init__(self, lookup, **extra): """Instantiate a new aggregate. * lookup is the field on which the aggregate operates. * extra is a diction...
bsd-3-clause
MebiusHKU/flask-web
flask/lib/python2.7/site-packages/wtforms/validators.py
58
18872
from __future__ import unicode_literals import re import warnings from wtforms.compat import string_types, text_type __all__ = ( 'DataRequired', 'data_required', 'Email', 'email', 'EqualTo', 'equal_to', 'IPAddress', 'ip_address', 'InputRequired', 'input_required', 'Length', 'length', 'NumberRange', 'numb...
bsd-3-clause
Venryx/VTools
Main/vdebug.py
1
2149
from vtools import * from vtools.vglobals import * import time # profiling # ========== '''def StartBlock(): { stopwatch.Reset(); stopwatch.Start(); #Log("Starting timer."); } public static void MidBlock(string name) { EndBlock(name); StartBlock(); } public static void EndBlock(string name) {...
gpl-2.0
ashemedai/ansible
lib/ansible/modules/cloud/openstack/os_quota.py
27
16687
#!/usr/bin/python # Copyright (c) 2016 Pason System Corporation # # This module 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. # # Thi...
gpl-3.0
jesperronn/bootstrap-datepicker
docs/conf.py
276
8002
# -*- coding: utf-8 -*- # # bootstrap-datepicker documentation build configuration file, created by # sphinx-quickstart on Fri Aug 2 14:45:57 2013. # # 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 ...
apache-2.0
js850/PyGMIN
pygmin/thermodynamics/heat_capacity.py
1
3175
import numpy as np def dos_to_cv(energies, ldos, T, K=1.): """compute the heat capacity and other thermodynamic quantities from density of states Parameters ---------- energies : array array of energies ldos : array ldos[i] is the log of the density of states at energy energies[i]...
gpl-3.0
mattvick/phantomjs
src/qt/qtwebkit/Tools/Scripts/webkitpy/performance_tests/perftestsrunner.py
115
17309
# Copyright (C) 2012 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 ...
bsd-3-clause
c7zero/chipsec
chipsec/utilcmd/mmcfg_cmd.py
6
3307
#!/usr/bin/python #CHIPSEC: Platform Security Assessment Framework #Copyright (c) 2010-2015, Intel Corporation # #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; Version 2. # #This program is distr...
gpl-2.0
edx/ecommerce
ecommerce/programs/migrations/0001_initial.py
1
1029
# -*- coding: utf-8 -*- # Generated by Django 1.9.13 on 2017-05-08 21:46 from django.db import migrations class Migration(migrations.Migration): initial = True dependencies = [ ('offer', '0012_condition_program_uuid'), ] operations = [ migrations.CreateModel( name='Abs...
agpl-3.0
auready/docker-py
docker/types/swarm.py
14
1639
class SwarmSpec(dict): def __init__(self, task_history_retention_limit=None, snapshot_interval=None, keep_old_snapshots=None, log_entries_for_slow_followers=None, heartbeat_tick=None, election_tick=None, dispatcher_heartbeat_period=None, node_cert_...
apache-2.0
salamer/django
tests/dbshell/test_mysql.py
442
2849
from django.db.backends.mysql.client import DatabaseClient from django.test import SimpleTestCase class MySqlDbshellCommandTestCase(SimpleTestCase): def test_fails_with_keyerror_on_incomplete_config(self): with self.assertRaises(KeyError): self.get_command_line_arguments({}) def test_bas...
bsd-3-clause
jjas0nn/solvem
tensorflow/lib/python2.7/site-packages/numpy/__init__.py
49
6274
""" NumPy ===== Provides 1. An array object of arbitrary homogeneous items 2. Fast mathematical operations over arrays 3. Linear Algebra, Fourier Transforms, Random Number Generation How to use the documentation ---------------------------- Documentation is available in two forms: docstrings provided with the c...
mit
bbockelm/condor-network-accounting
src/condor_contrib/condor_pigeon/src/condor_pigeon_client/skype_linux_tools/Skype4Py/Languages/et.py
10
6941
apiAttachAvailable = u'Leitud' apiAttachNotAvailable = u'Kadunud' apiAttachPendingAuthorization = u'Autoriseerimine' apiAttachRefused = u'Keeldumine' apiAttachSuccess = u'\xdchendatud' apiAttachUnknown = u'M\xe4\xe4ramata' budDeletedFriend = u'Kustutatud S\xf5ber' budFriend = u'S\xf5ber' budNeverBeenFriend = u'...
apache-2.0
carthach/essentia
test/src/QA/snr/test_snr.py
1
8236
#!/usr/bin/env python # Copyright (C) 2006-2019 Music Technology Group - Universitat Pompeu Fabra # # This file is part of Essentia # # Essentia 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 (FSF), e...
agpl-3.0
ekalosak/boto
tests/integration/kinesis/test_cert_verification.py
122
1502
# Copyright (c) 2014 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 without restriction, including # without limitation the right...
mit
cpausmit/Kraken
filefi/016/data.py
1
1870
# $Id: data.py,v 1.1 2011/03/19 01:52:27 paus Exp $ import FWCore.ParameterSet.Config as cms process = cms.Process('FILLER') # import of standard configurations process.load('Configuration/StandardSequences/Services_cff') process.load('FWCore/MessageService/MessageLogger_cfi') process.load('Configuration.StandardSeq...
mit
QuintoNetworks/connector-telephony
ovh_telephony_connector/__openerp__.py
2
1482
# -*- encoding: utf-8 -*- ############################################################################## # # OVH Connector module for Odoo # Copyright (C) 2015 Alexis de Lattre <alexis@via.ecp.fr> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero...
agpl-3.0
aemal/westcat
amcat/scripts/article_upload/apa_prof.py
2
10553
########################################################################### # (C) Vrije Universiteit, Amsterdam (the Netherlands) # # # # This file is part of AmCAT - The Amsterdam Content Analysis Toolkit # # ...
agpl-3.0
codyhanson/puntective
part_of_speech.py
1
1081
from py2neo import neo4j from nltk.corpus import wordnet as wn from collections import defaultdict import operator #this routine will scan each word in the phrase, and if it has a hyphenation, attach that information in a node via the edge #it will also attach both sides of the hypenation as new nodes def analyze(gr...
mit
EduPepperPDTesting/pepper2013-testing
common/djangoapps/student/migrations/0012_auto__add_field_userprofile_gender__add_field_userprofile_date_of_birt.py
188
12238
# -*- coding: 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): # Adding field 'UserProfile.gender' db.add_column('auth_userprofile', 'gender', self.g...
agpl-3.0
gregbanks/mongodrums
scripts/update_indexes.py
2
4619
import argparse import copy import os import json import logging import subprocess import sys from pymongo import MongoClient, ASCENDING, DESCENDING from pymongo.uri_parser import parse_uri from mongodrums.util import get_default_database _DEFAULT_URI = 'mongodb://localhost:27017/mongodrums' def backup_indexes(da...
mit
FRidh/scipy
scipy/linalg/_decomp_qz.py
23
8974
from __future__ import division, print_function, absolute_import import warnings import numpy as np from numpy import asarray_chkfinite from .misc import LinAlgError, _datacopied from .lapack import get_lapack_funcs from scipy._lib.six import callable __all__ = ['qz'] _double_precision = ['i','l','d'] def _sele...
bsd-3-clause
svkampen/James
plugins/util/data.py
1
2115
www_headers = { "User-Agent": "Mozilla/5.0 (compatible) (Python 3.3, en_US) James/5.0 IRC bot" } import inspect import random import gc from types import FunctionType import math import re def zalgify(string): return ''.join(i+''.join(random.sample(zalgo, 10)) if i != ' ' else i for i in string) try: zal...
mit
xeregin/rpc-openstack
maas/plugins/nova_api_local_check.py
3
2875
#!/usr/bin/env python # Copyright 2014, Rackspace US, 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 applicabl...
apache-2.0
puttarajubr/commcare-hq
corehq/apps/sofabed/tests/test_formdata.py
1
3028
from django.test import TestCase from corehq.apps.hqadmin.dbaccessors import get_all_forms_in_all_domains from couchforms.models import XFormInstance from couchforms.util import SubmissionPost import os from corehq.apps.sofabed.models import FormData from datetime import date, datetime class FormDataTestCase(TestCase...
bsd-3-clause
aragos/tichu-tournament
python/reportlab/lib/randomtext.py
3
19604
#!/bin/env python #Copyright ReportLab Europe Ltd. 2000-2016 #see license.txt for license details #history http://www.reportlab.co.uk/cgi-bin/viewcvs.cgi/public/reportlab/trunk/reportlab/lib/randomtext.py __version__='3.3.0' ############################################################################### # generates...
mit
noba3/KoTos
addons/plugin.video.tvondesizonexl/xoze/snapvideo/Videozer.py
3
4582
''' Created on Dec 22, 2011 @author: ajju ''' from xoze.snapvideo import VideoHost, Video, STREAM_QUAL_SD from xoze.utils import http import base64 import binascii import urllib try: import json except ImportError: import simplejson as json def getVideoHost(): video_host = VideoHost() video_host.set_...
gpl-2.0
eric-stanley/youtube-dl
youtube_dl/extractor/gamespot.py
105
3168
from __future__ import unicode_literals import re import json from .common import InfoExtractor from ..compat import ( compat_urllib_parse_unquote, compat_urlparse, ) from ..utils import ( unescapeHTML, ) class GameSpotIE(InfoExtractor): _VALID_URL = r'http://(?:www\.)?gamespot\.com/.*-(?P<id>\d+)/?...
unlicense
majidaldo/ansible-modules-core
database/postgresql/postgresql_db.py
112
11226
#!/usr/bin/python # -*- coding: utf-8 -*- # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. #...
gpl-3.0
Inspq/ansible
lib/ansible/plugins/lookup/keyring.py
66
2278
# (c) 2016, Samuel Boucher <boucher.samuel.c@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) any l...
gpl-3.0
Prashant-Surya/addons-server
src/olympia/migrations/356-add-currencies.py
31
3896
from decimal import Decimal from market.models import Price, PriceCurrency currencies = { 'CAD': { 'Tier 1': '0.99', 'Tier 2': '1.99', 'Tier 3': '2.99', 'Tier 4': '3.99', 'Tier 5': '4.99', 'Tier 6': '5.99', 'Tier 7': '6.99', 'Tier 8': '7.99', ...
bsd-3-clause
kionetworks/openstack-dashboard-havana
openstack_dashboard/dashboards/admin/flavors/tables.py
5
3867
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2012 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # Copyright 2012 Nebula, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # no...
apache-2.0
tcxurun/todo
static/script/bootstrap/test-infra/s3_cache.py
1700
3523
#!/usr/bin/env python2.7 from __future__ import absolute_import, unicode_literals, print_function, division from sys import argv from os import environ, stat, remove as _delete_file from os.path import isfile, dirname, basename, abspath from hashlib import sha256 from subprocess import check_call as run from boto.s3....
apache-2.0
uni2u/neutron
neutron/db/routerservicetype_db.py
10
2269
# Copyright 2013 VMware, Inc. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by a...
apache-2.0
aktech/sympy
sympy/simplify/tests/test_powsimp.py
23
11832
from sympy import ( symbols, powsimp, symbols, MatrixSymbol, sqrt, pi, Mul, gamma, Function, S, I, exp, simplify, sin, E, log, hyper, Symbol, Dummy, powdenest, root, Rational) from sympy.abc import x, y, z, t, a, b, c, d, e, f, g, h, i, k def test_powsimp(): x, y, z, n = symbols('x,y,z,n') f = Fu...
bsd-3-clause
Changaco/oh-mainline
vendor/packages/twisted/twisted/persisted/journal/base.py
19
6454
# -*- test-case-name: twisted.test.test_journal -*- # # Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. # """Basic classes and interfaces for journal.""" from __future__ import nested_scopes # system imports import os, time try: import cPickle as pickle except ImportError: import pi...
agpl-3.0
ajk8/hatchery
setup.py
1
1960
from setuptools import setup from imp import find_module, load_module PROJECT_NAME = 'hatchery' GITHUB_USER = 'ajk8' GITHUB_ROOT = 'https://github.com/{}/{}'.format(GITHUB_USER, PROJECT_NAME) found = find_module('_version', [PROJECT_NAME]) _version = load_module('{}._version'.format(PROJECT_NAME), *found) setup( ...
mit
whummer/moto
moto/core/access_control.py
1
14158
""" This implementation is NOT complete, there are many things to improve. The following is a list of the most important missing features and inaccuracies. TODO add support for more principals, apart from IAM users and assumed IAM roles TODO add support for the Resource and Condition parts of IAM policies TODO add sup...
apache-2.0
Jumpscale/python-pretty-toml
prettytoml/elements/inlinetable.py
5
2898
from prettytoml.elements import factory, abstracttable from prettytoml.elements.common import Element class InlineTableElement(abstracttable.AbstractTable): """ An Element containing key-value pairs, representing an inline table. Implements dict-like interface. Assumes input sub_elements are correct...
mit
maartenq/ansible
lib/ansible/plugins/terminal/enos.py
101
2824
# (C) 2017 Red Hat Inc. # Copyright (C) 2017 Lenovo. # # GNU General Public License v3.0+ # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for ...
gpl-3.0
javierag/samba
third_party/dnspython/dns/rdtypes/IN/DHCID.py
100
2124
# Copyright (C) 2006, 2007, 2009-2011 Nominum, Inc. # # Permission to use, copy, modify, and distribute this software and its # documentation for any purpose with or without fee is hereby granted, # provided that the above copyright notice and this permission notice # appear in all copies. # # THE SOFTWARE IS PROVIDED ...
gpl-3.0
drptbl/Just-Metadata
modules/analytics/geo.py
1
8908
''' This is a module that can carry out the top X (top 10 or more/less) analysis against the IPs loaded into the framework. ''' class Analytics: def __init__(self, cli_options): self.cli_name = "GeoInfo" self.description = "Analyzes IPs geographical/ISP information" if cli_options is None...
gpl-3.0
dekkers/django-easycrud
easycrud/views.py
1
7660
from django.views.generic import (ListView as DjangoListView, DetailView as DjangoDetailView, UpdateView as DjangoUpdateView, CreateView as DjangoCreateView, DeleteView as DjangoDeleteView) from django.conf import settings from django.contrib.auth.deco...
bsd-2-clause
40223141/0505
static/Brython3.1.1-20150328-091302/Lib/logging/__init__.py
733
66279
# Copyright 2001-2013 by Vinay Sajip. All Rights Reserved. # # Permission to use, copy, modify, and distribute this software and its # documentation for any purpose and without fee is hereby granted, # provided that the above copyright notice appear in all copies and that # both that copyright notice and this permissio...
agpl-3.0
fzheng/codejam
lib/python2.7/site-packages/requests/packages/urllib3/util/timeout.py
713
9596
from __future__ import absolute_import # The default socket timeout, used by httplib to indicate that no timeout was # specified by the user from socket import _GLOBAL_DEFAULT_TIMEOUT import time from ..exceptions import TimeoutStateError # A sentinel value to indicate that no timeout was specified by the user in # u...
mit
shrtcww/pymel
docs/source/conf.py
9
8125
# -*- coding: utf-8 -*- # # PyMEL documentation build configuration file, created by # sphinx-quickstart on Thu Jan 29 22:10:49 2009. # # This file is execfile()d with the current directory set to its containing dir. # # The contents of this file are pickled, so don't put values in the namespace # that aren't pickleabl...
bsd-3-clause
cuongnv23/ansible
lib/ansible/modules/packaging/language/pip.py
8
21296
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2012, Matt Wright <matt@nobien.net> # 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
hmgaudecker/econ-project-templates
docs/bld/example/python/python_example/.mywaflib/waflib/extras/fsc.py
56
1909
#!/usr/bin/env python # encoding: utf-8 # Thomas Nagy, 2011 (ita) """ Experimental F# stuff FSC="mono /path/to/fsc.exe" waf configure build """ from waflib import Utils, Task from waflib.TaskGen import before_method, after_method, feature from waflib.Tools import ccroot, cs ccroot.USELIB_VARS['fsc'] = set(['CSFLAGS...
bsd-3-clause
longmen21/edx-platform
common/lib/xmodule/xmodule/modulestore/django.py
15
13411
""" Module that provides a connection to the ModuleStore specified in the django settings. Passes settings.MODULESTORE as kwargs to MongoModuleStore """ from __future__ import absolute_import from importlib import import_module import gettext import logging from pkg_resources import resource_filename import re from...
agpl-3.0
geekboxzone/lollipop_external_chromium_org_tools_gyp
test/win/gyptest-link-safeseh.py
32
1340
#!/usr/bin/env python # Copyright (c) 2014 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """ Make sure safeseh setting is extracted properly. """ import TestGyp import sys if sys.platform == 'win32': test = TestGyp.TestGyp(f...
bsd-3-clause
adelton/django
django/template/utils.py
308
4736
import os import warnings from collections import Counter, OrderedDict from django.apps import apps from django.conf import settings from django.core.exceptions import ImproperlyConfigured from django.utils import lru_cache from django.utils._os import upath from django.utils.deprecation import RemovedInDjango110Warni...
bsd-3-clause
braghiere/JULESv4.6_clump
examples/point_loobos/output/plot.py
2
11652
from netCDF4 import Dataset # http://code.google.com/p/netcdf4-python/ import numpy as np import datetime as dt # Python standard library datetime module import matplotlib.pyplot as plt from mpl_toolkits.basemap import Basemap, addcyclic, shiftgrid def ncdump(nc_fid, verb=True): ''' ncdump outputs dimension...
gpl-2.0
collinss/Cinnamon
files/usr/share/cinnamon/cinnamon-slideshow/cinnamon-slideshow.py
3
13603
#!/usr/bin/python3 from gi.repository import Gio, GLib import dbus, dbus.service, dbus.glib from dbus.mainloop.glib import DBusGMainLoop import random import os, locale from xml.etree import ElementTree from setproctitle import setproctitle SLIDESHOW_DBUS_NAME = "org.Cinnamon.Slideshow" SLIDESHOW_DBUS_PATH = "/org/Ci...
gpl-2.0
Core2idiot/Kernel-Samsung-3.0...-
Documentation/networking/cxacru-cf.py
14668
1626
#!/usr/bin/env python # Copyright 2009 Simon Arlott # # 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 i...
gpl-2.0
SNoiraud/gramps
gramps/gen/filters/rules/source/_hasattribute.py
5
1806
# # Gramps - a GTK+/GNOME based genealogy program # # Copyright (C) 2008 Gary Burton # Copyright (C) 2019 Matthias Kemmer # # 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 ...
gpl-2.0
thinkopensolutions/tkobr-addons
unported/tko_l10n_br_base/res_partner.py
2
8648
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). # # ThinkOpen Solutions Brasil # Copyright (C) Thinkopen Solutions <http://www.tkobr.com>. # # This...
agpl-3.0
ivannotes/luigi
test/instance_test.py
14
2551
# -*- 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
joonty/vdebug
python3/vdebug/breakpoint.py
2
9153
import base64 from . import error from . import log class Store: def __init__(self): self.breakpoints = {} self.api = None def link_api(self, api): self.api = api num_bps = len(self.breakpoints) if num_bps > 0: log.Log("Registering %i breakpoints with the...
mit
vidyacraghav/cplusdratchio
deps/boost_1_55_0/libs/python/test/calling_conventions.py
44
1638
# Copyright Nicolas Lelong, 2010. Distributed under the Boost # Software License, Version 1.0 (See accompanying # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) """ >>> from calling_conventions_ext import * >>> f_0__cdecl() 17041 >>> f_1__cdecl(1) 1 >>> f_2__cdecl(1, 2) 21 >>> f_3__cdecl(1, 2,...
gpl-3.0
dforsi/codespell
codespell_lib/tests/test_dictionary.py
1
2871
# -*- coding: utf-8 -*- import os.path as op import re def test_dictionary_formatting(): """Test that all dictionary entries are valid.""" err_dict = dict() ws = re.compile(r'.*\s.*') # whitespace comma = re.compile(r'.*,.*') # comma with open(op.join(op.dirname(__file__), '..', 'data', ...
gpl-2.0
0xDCA/marshmallow
tests/test_deserialization.py
1
38434
# -*- coding: utf-8 -*- import datetime as dt import uuid import decimal import pytest from marshmallow import fields, utils, Schema from marshmallow.exceptions import UnmarshallingError, ValidationError from marshmallow.compat import text_type, total_seconds from tests.base import ( assert_almost_equal, ass...
mit
mtnbikenc/ansible-modules-extras
network/f5/bigip_virtual_server.py
7
22135
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2015, Etienne Carriere <etienne.carriere@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 ...
gpl-3.0
JioCloud/nova_test_latest
nova/tests/functional/test_legacy_v3_compatible_wrapper.py
7
1429
# Copyright 2015 Intel Corporation. # 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 requir...
apache-2.0
imsparsh/python-for-android
python-modules/twisted/twisted/plugins/twisted_qtstub.py
61
1417
# Copyright (c) 2006 Twisted Matrix Laboratories. # See LICENSE for details. """ Backwards-compatibility plugin for the Qt reactor. This provides a Qt reactor plugin named C{qt} which emits a deprecation warning and a pointer to the separately distributed Qt reactor plugins. """ import warnings from twisted.applica...
apache-2.0
muromec/mplayer-mt-tegra
TOOLS/vdpau_functions.py
2
1843
# Generate vdpau_template.c functions = """ # get_error_string should be first, because the function lookup loop should # have it available to print errors for other functions get_error_string bitmap_surface_create bitmap_surface_destroy bitmap_surface_put_bits_native bitmap_surface_query_capabilities decoder_create ...
gpl-3.0
markfinal/BuildAMation
codingtools/choose_default_dependent_in_tests.py
1
2459
#!/usr/bin/python import argparse import os import platform import subprocess import sys system = platform.system() if system == 'Windows': bam_shell = 'bam.bat' else: bam_shell = 'bam' def _log(message): print >>sys.stdout, message sys.stdout.flush() def get_bam_installdir(): try: ret...
bsd-3-clause
zombo/p2pool
p2pool/web.py
33
25661
from __future__ import division import errno import json import os import sys import time import traceback from twisted.internet import defer, task from twisted.python import log from twisted.web import resource, static import p2pool from bitcoin import data as bitcoin_data from . import data as p2pool_data from uti...
gpl-3.0
bunnyitvn/webptn
tests/regressiontests/utils/datastructures.py
44
10873
""" Tests for stuff in django.utils.datastructures. """ import copy import pickle import warnings from django.test import SimpleTestCase from django.utils.datastructures import (DictWrapper, ImmutableList, MultiValueDict, MultiValueDictKeyError, MergeDict, SortedDict) from django.utils import six class SortedDi...
bsd-3-clause
ParadigmaXis/dadosabertos_cmporto_pt
ckanext/dados_cmporto_pt/relationships_plugin.py
1
3412
# -*- coding: utf-8 -*- import ckan.plugins as plugins import ckan.model as model import ckan.new_authz as new_authz import ckan.lib.dictization.model_dictize as model_dictize from pylons import c import logging log = logging.getLogger(__name__) class RelationshipsPlugin(plugins.SingletonPlugin): plugins.imple...
agpl-3.0
crosswalk-project/blink-crosswalk
Tools/Scripts/webkitpy/style/checker.py
50
28706
# Copyright (C) 2009 Google Inc. All rights reserved. # Copyright (C) 2010 Chris Jerdonek (chris.jerdonek@gmail.com) # Copyright (C) 2010 ProFUSION embedded systems # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # ...
bsd-3-clause
zadgroup/edx-platform
lms/djangoapps/courseware/features/staff_debug_info.py
173
1472
""" Steps for staff_debug_info.feature lettuce tests """ from django.contrib.auth.models import User from lettuce import world, step from common import create_course, course_id from courseware.courses import get_course_by_id from instructor.access import allow_access @step(u'i am staff member for the course "([^"]*)...
agpl-3.0
01org/isafw
tests/CFAPluginTestCase.py
1
4664
# # CFAPluginTestCase.py - Test cases for CFA plugin, part of ISA FW # # Copyright (c) 2015, Intel Corporation # # 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 abo...
bsd-3-clause
TheStrix/android_kernel_xiaomi_armani_OLD
scripts/gcc-wrapper.py
1276
3382
#! /usr/bin/env python # -*- coding: utf-8 -*- # Copyright (c) 2011-2012, The Linux Foundation. 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 th...
gpl-2.0
skoolkid/skoolkit
tests/test_skoolhtml.py
1
411368
import html from io import StringIO from os.path import basename, isdir, isfile from posixpath import join from textwrap import dedent from unittest.mock import patch from skoolkittest import SkoolKitTestCase, Stream from macrotest import CommonSkoolMacroTest, nest_macros from skoolkit import BASE_10, BASE_16, VERSION...
gpl-3.0
gorjuce/odoo
addons/sale_analytic_plans/__init__.py
443
1208
# -*- 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
krieger-od/nwjs_chromium.src
build/android/pylib/base/base_test_result.py
9
5913
# Copyright (c) 2013 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Module containing base test results classes.""" class ResultType(object): """Class enumerating test types.""" PASS = 'PASS' SKIP = 'SKIP' FAI...
bsd-3-clause
mvaled/OpenUpgrade
addons/hw_escpos/escpos/escpos.py
65
31673
# -*- coding: utf-8 -*- import time import copy import io import base64 import math import md5 import re import traceback import xml.etree.ElementTree as ET import xml.dom.minidom as minidom from PIL import Image try: import jcconv except ImportError: jcconv = None try: import qrcode except ImportError...
agpl-3.0
scylladb/scylla-longevity-tests
sdcm/ec2_client.py
1
16120
import logging import datetime import time import boto3 import base64 from botocore.exceptions import ClientError, NoRegionError from .utils import retrying logger = logging.getLogger(__name__) STATUS_FULFILLED = 'fulfilled' STATUS_PRICE_TOO_LOW = 'price-too-low' STATUS_ERROR = 'error' FLEET_LIMIT_EXCEEDED_ERROR = '...
agpl-3.0
ToxicFrog/lancow
madcow/include/twisted/python/context.py
89
2282
# -*- test-case-name: twisted.test.test_context -*- # Copyright (c) 2001-2004 Twisted Matrix Laboratories. # See LICENSE for details. # """ Dynamic pseudo-scoping for Python. Call functions with context.call({key: value}, func); func and functions that it calls will be able to use 'context.get(key)' to retrieve 'val...
gpl-3.0
aquamatt/ZCMS
zcms/views.py
1
2647
""" Views that support the work of the CMS. Note that in all of these the CMS context is pulled out of the session and put into the thread because the context processor in the application hasn't been called. Need to weedle out whether this can be altered - it will no doubt be a problem for other apps. Wrapping in zcms...
bsd-3-clause
ksachs/invenio
modules/miscutil/lib/upgrades/invenio_2014_05_26_new_index_country.py
5
5876
# -*- coding: utf-8 -*- ## ## This file is part of Invenio. ## Copyright (C) 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 option) a...
gpl-2.0
teamtuga4/teamtuga4ever.repository
plugin.video.pancas/resources/lib/libraries/f4mproxy/flvlib/scripts/index_flv.py
98
13650
import os import sys import shutil import logging import tempfile from optparse import OptionParser from flvlib import __versionstr__ from flvlib.constants import TAG_TYPE_AUDIO, TAG_TYPE_VIDEO, TAG_TYPE_SCRIPT from flvlib.constants import FRAME_TYPE_KEYFRAME from flvlib.astypes import MalformedFLV, FLVObject from fl...
gpl-2.0