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
Batterfii/django
django/utils/deprecation.py
34
2556
from __future__ import absolute_import import inspect import warnings class RemovedInDjango20Warning(PendingDeprecationWarning): pass RemovedInNextVersionWarning = DeprecationWarning class warn_about_renamed_method(object): def __init__(self, class_name, old_method_name, new_method_name, deprecation_warn...
bsd-3-clause
elkingtonmcb/sympy
sympy/plotting/pygletplot/plot_camera.py
120
3888
from __future__ import print_function, division from pyglet.gl import * from plot_rotation import get_spherical_rotatation from util import get_model_matrix from util import screen_to_model, model_to_screen from util import vec_subs class PlotCamera(object): min_dist = 0.05 max_dist = 500.0 min_ortho_d...
bsd-3-clause
dkodnik/Ant
addons/account_check_writing/account_voucher.py
33
6716
# -*- 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
Ali-aqrabawi/ezclinic
lib/django/db/migrations/operations/base.py
127
4888
from __future__ import unicode_literals from django.db import router class Operation(object): """ Base class for migration operations. It's responsible for both mutating the in-memory model state (see db/migrations/state.py) to represent what it performs, as well as actually performing it agains...
mit
Orav/kbengine
kbe/res/scripts/common/Lib/test/test_unpack_ex.py
5
4311
# Tests for extended unpacking, starred expressions. doctests = """ Unpack tuple >>> t = (1, 2, 3) >>> a, *b, c = t >>> a == 1 and b == [2] and c == 3 True Unpack list >>> l = [4, 5, 6] >>> a, *b = l >>> a == 4 and b == [5, 6] True Unpack implied tuple >>> ...
lgpl-3.0
cmjatai/cmj
cmj/cerimonial/models.py
1
27858
from django.contrib.auth.models import Group from django.db import models from django.db.models.deletion import SET_NULL, PROTECT, CASCADE from django.utils.translation import ugettext_lazy as _ from cmj.core.models import CmjModelMixin, Trecho, Distrito, RegiaoMunicipal,\ CmjAuditoriaModelMixin, CmjSearchMixin, ...
gpl-3.0
rajalokan/nova
nova/tests/functional/notification_sample_tests/test_instance.py
1
34922
# 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
TiVo/kafka
tests/kafkatest/services/security/minikdc.py
8
6343
# 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 use ...
apache-2.0
ghandiosm/Test
addons/sale/res_config.py
3
6335
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. import logging from openerp.osv import fields, osv _logger = logging.getLogger(__name__) class sale_configuration(osv.TransientModel): _inherit = 'sale.config.settings' _columns = { 'group_product_va...
gpl-3.0
mcking49/apache-flask
Python/Lib/bsddb/test/test_sequence.py
68
5274
import unittest import os from test_all import db, test_support, get_new_environment_path, get_new_database_path class DBSequenceTest(unittest.TestCase): def setUp(self): self.int_32_max = 0x100000000 self.homeDir = get_new_environment_path() self.filename = "test" self.dbenv = d...
mit
Aorjoa/aiyara-ceph-dash
.tox/py27/lib/python2.7/site-packages/requests/packages/urllib3/util/url.py
713
5879
from __future__ import absolute_import from collections import namedtuple from ..exceptions import LocationParseError url_attrs = ['scheme', 'auth', 'host', 'port', 'path', 'query', 'fragment'] class Url(namedtuple('Url', url_attrs)): """ Datastructure for representing an HTTP URL. Used as a return value f...
bsd-2-clause
yufengg/tensorflow
tensorflow/contrib/metrics/python/ops/histogram_ops.py
159
10459
# 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
lixiangning888/whole_project
modules/signatures/antivm_generic_diskreg.py
3
1470
# -*- coding: utf-8 -*- # Copyright (C) 2012,2015 Claudio "nex" Guarnieri (@botherder), Accuvant, Inc. (bspengler@accuvant.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 by # the Free Software Foundation, either version 3...
lgpl-3.0
t0in4/django
tests/template_tests/test_smartif.py
580
2178
import unittest from django.template.smartif import IfParser class SmartIfTests(unittest.TestCase): def assertCalcEqual(self, expected, tokens): self.assertEqual(expected, IfParser(tokens).parse().eval({})) # We only test things here that are difficult to test elsewhere # Many other tests are f...
bsd-3-clause
nirmeshk/oh-mainline
vendor/packages/south/south/hacks/django_1_0.py
118
3378
""" Hacks for the Django 1.0/1.0.2 releases. """ import django from django.conf import settings from django.db.backends.creation import BaseDatabaseCreation from django.db.models.loading import cache from django.core import management from django.core.management.commands.flush import Command as FlushCommand from djang...
agpl-3.0
theonewolf/siegvswolf
lib/flask/config.py
781
6234
# -*- coding: utf-8 -*- """ flask.config ~~~~~~~~~~~~ Implements the configuration related objects. :copyright: (c) 2011 by Armin Ronacher. :license: BSD, see LICENSE for more details. """ import imp import os import errno from werkzeug.utils import import_string from ._compat import string_type...
mit
monarch-initiative/dipper
dipper/sources/OMIM.py
2
47719
import logging import re import json import urllib import time from urllib.error import HTTPError from datetime import date, datetime, timedelta from dipper.sources.OMIMSource import OMIMSource from dipper.sources.Source import USER_AGENT from dipper.models.Model import Model from dipper.models.assoc.G2PAssoc import G...
bsd-3-clause
stchepanhagn/domain-learning
plan_learning.py
1
2767
""" plan_learning.py - This module contain the procedure used for learning plans from experience. Copyright (C) 2016 Stephan Chang 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 ...
gpl-3.0
CVML/pybrain
pybrain/tools/customxml/networkwriter.py
25
4150
__author__ = 'Tom Schaul, tom@idsia.ch' from inspect import isclass from .handling import XMLHandling from pybrain.structure.connections.shared import SharedConnection from pybrain.structure.networks.network import Network from pybrain.structure.networks.recurrent import RecurrentNetwork from pybrain.utilities import...
bsd-3-clause
Rawk/xbmc
tools/EventClients/Clients/PS3 Sixaxis Controller/ps3d.py
168
12019
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright (C) 2008-2013 Team XBMC # # 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) ...
gpl-2.0
mikewiebe-ansible/ansible
lib/ansible/modules/network/nso/nso_query.py
69
3295
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright (c) 2017 Cisco and/or its affiliates. # # 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...
gpl-3.0
tedder/ansible
test/units/parsing/test_unquote.py
298
1602
# coding: utf-8 # (c) 2015, Toshio Kuratomi <tkuratomi@ansible.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 o...
gpl-3.0
dcy/epush
examples/rabbitmq/xiaomi.py
1
1181
#!/usr/bin/env python #coding:utf-8 import pika import json HOST = 'localhost' USERNAME = 'hisir' PASSWORD = 'hisir123' class Xiaomi(): def __init__(self): credentials = pika.PlainCredentials(USERNAME, PASSWORD) self.connection = pika.BlockingConnection(pika.ConnectionParameters(host=HOST, crede...
bsd-3-clause
yeming233/horizon
openstack_dashboard/test/integration_tests/config.py
4
6346
# 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
dominikl/bioformats
components/xsd-fu/python/genshi/template/tests/plugin.py
24
9862
# -*- coding: utf-8 -*- # # Copyright (C) 2006-2007 Edgewall Software # Copyright (C) 2006 Matthew Good # All rights reserved. # # This software is licensed as described in the file COPYING, which # you should have received as part of this distribution. The terms # are also available at http://genshi.edgewall.org/wiki/...
gpl-2.0
czgu/opendataexperience
env/lib/python2.7/site-packages/django/contrib/sessions/backends/base.py
61
11249
from __future__ import unicode_literals import base64 from datetime import datetime, timedelta import logging import string from django.conf import settings from django.core.exceptions import SuspiciousOperation from django.utils.crypto import constant_time_compare from django.utils.crypto import get_random_string fr...
apache-2.0
morphis/home-assistant
homeassistant/helpers/config_validation.py
10
16175
"""Helpers for config validation using voluptuous.""" from collections import OrderedDict from datetime import timedelta, datetime as datetime_sys import os import re from urllib.parse import urlparse from socket import _GLOBAL_DEFAULT_TIMEOUT from typing import Any, Union, TypeVar, Callable, Sequence, Dict import vo...
apache-2.0
zack3241/incubator-airflow
airflow/contrib/hooks/vertica_hook.py
60
1381
# -*- coding: utf-8 -*- # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software ...
apache-2.0
jeremiahmarks/sl4a
python/src/Lib/test/test_fractions.py
55
16373
"""Tests for Lib/fractions.py.""" from decimal import Decimal from test.test_support import run_unittest import math import operator import fractions import unittest from copy import copy, deepcopy from cPickle import dumps, loads F = fractions.Fraction gcd = fractions.gcd class GcdTest(unittest.TestCase): def ...
apache-2.0
pusateri/vectorformats
vectorformats/formats/spatialite.py
2
2825
''' Created on Sep 14, 2012 @author: michel ''' from pyspatialite import dbapi2 as db from .format import Format from .wkt import to_wkt class SpatiaLite(Format): _connection = None _cursor = None def encode(self, features, **kwargs): tmpFile = kwargs["tmpFile"] if len...
mit
BenHall/docker
vendor/src/github.com/ugorji/go/codec/test.py
670
3808
#!/usr/bin/env python # This will create golden files in a directory passed to it. # A Test calls this internally to create the golden files # So it can process them (so we don't have to checkin the files). # Ensure msgpack-python and cbor are installed first, using: # pip install --user msgpack-python # pip inst...
apache-2.0
franmolinaca/BitaCR
node_modules/node-gyp/gyp/pylib/gyp/common.py
1292
20063
# 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. from __future__ import with_statement import collections import errno import filecmp import os.path import re import tempfile import sys # A minimal memoizing d...
mit
rdm-dev/uboot-curie
tools/buildman/cmdline.py
3
5133
# # Copyright (c) 2014 Google, Inc # # SPDX-License-Identifier: GPL-2.0+ # from optparse import OptionParser def ParseArgs(): """Parse command line arguments from sys.argv[] Returns: tuple containing: options: command line options args: command lin arguments """ p...
gpl-2.0
snakeleon/YouCompleteMe-x64
third_party/ycmd/third_party/bottle/test/test_formsdict.py
49
1243
# -*- coding: utf-8 -*- # '瓶' means "Bottle" import unittest from bottle import FormsDict, touni, tob class TestFormsDict(unittest.TestCase): def test_attr_access(self): """ FomsDict.attribute returs string values as unicode. """ d = FormsDict(py2=tob('瓶'), py3=tob('瓶').decode('latin1')) s...
gpl-3.0
labkaxita/lakaxita
bootstrap.py
40
10525
############################################################################## # # Copyright (c) 2006 Zope Foundation and Contributors. # All Rights Reserved. # # This software is subject to the provisions of the Zope Public License, # Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution. # THIS SOF...
agpl-3.0
justanr/flask
flask/json.py
140
8458
# -*- coding: utf-8 -*- """ flask.jsonimpl ~~~~~~~~~~~~~~ Implementation helpers for the JSON support in Flask. :copyright: (c) 2015 by Armin Ronacher. :license: BSD, see LICENSE for more details. """ import io import uuid from datetime import date from .globals import current_app, request from ._...
bsd-3-clause
iShoto/testpy
codes/20200104_metric_learning_mnist/src/train_mnist_original_center.py
1
5545
import torch import torch.nn as nn import torch.nn.functional as F import torch.optim as optim from torchvision import datasets, transforms from torch.utils.data import DataLoader import torch.optim.lr_scheduler as lr_scheduler from torch.autograd.function import Function import torchvision import os import matplotlib...
mit
technologiescollege/Blockly-rduino-communication
scripts_XP/Lib/site-packages/jedi/evaluate/helpers.py
5
6531
import copy import sys import re import os from itertools import chain from contextlib import contextmanager from parso.python import tree from jedi._compatibility import unicode from jedi.parser_utils import get_parent_scope from jedi.evaluate.compiled import CompiledObject def is_stdlib_path(path): # Python s...
gpl-3.0
moniqx4/bite-project
deps/gdata-python-client/samples/apps/marketplace_sample/gdata/apps/organization/data.py
102
12186
#!/usr/bin/python2.4 # # Copyright 2011 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required ...
apache-2.0
TeamMac/android_kernel_huawei_p6-u06
tools/perf/scripts/python/check-perf-trace.py
11214
2503
# perf script event handlers, generated by perf script -g python # (c) 2010, Tom Zanussi <tzanussi@gmail.com> # Licensed under the terms of the GNU GPL License version 2 # # This script tests basic functionality such as flag and symbol # strings, common_xxx() calls back into perf, begin, end, unhandled # events, etc. ...
gpl-2.0
AlanZatarain/cortex-vfx
test/IECoreMaya/PlaybackFrameList.py
17
2314
########################################################################## # # Copyright (c) 2008-2010, Image Engine Design 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: # # * Redis...
bsd-3-clause
Pluto-tv/chromium-crosswalk
third_party/closure_compiler/runner/build_runner_jar.py
85
2327
#!/usr/bin/python # Copyright 2014 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import os import shutil import subprocess import sys import tempfile def rel_to_abs(rel_path): script_path = os.path.dirname(os.path.ab...
bsd-3-clause
nishantjr/pjproject
tests/pjsua/scripts-sendto/171_timer_initiated_by_uas.py
40
1090
# $Id$ import inc_sip as sip import inc_sdp as sdp sdp = \ """ v=0 o=- 0 0 IN IP4 127.0.0.1 s=pjmedia c=IN IP4 127.0.0.1 t=0 0 m=audio 4000 RTP/AVP 0 101 a=rtpmap:0 PCMU/8000 a=sendrecv a=rtpmap:101 telephone-event/8000 a=fmtp:101 0-15 """ # RFC 4028 Section 9: # If the incoming request contains a Supported header ...
gpl-2.0
julianprabhakar/eden_car
controllers/tour.py
36
1785
# -*- coding: utf-8 -*- """ Guided Tour, Controllers """ module = request.controller resourcename = request.function if not settings.has_module(module): raise HTTP(404, body="Module disabled: %s" % module) # ----------------------------------------------------------------------------- def index(): """ ...
mit
ZhaoCJ/django
django/core/serializers/json.py
5
3694
""" Serialize data to/from JSON """ # Avoid shadowing the standard library json module from __future__ import absolute_import from __future__ import unicode_literals import datetime import decimal import json import sys from django.core.serializers.base import DeserializationError from django.core.serializers.python...
bsd-3-clause
iw3hxn/LibrERP
account_payment_term_month/models/inherit_account_invoice.py
1
3307
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Micronaet SRL (<http://www.micronaet.it>). # Copyright (C) 2014 Agile Business Group sagl # (<http://www.agilebg.com>) # # This pro...
agpl-3.0
DreamSourceLab/DSView
libsigrokdecode4DSL/decoders/sdq/pd.py
4
4130
## ## This file is part of the libsigrokdecode project. ## ## Copyright (C) 2019-2020 Philip Åkesson <philip.akesson@gmail.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 by ## the Free Software Foundation; either versi...
gpl-3.0
lablup/sorna-agent
src/ai/backend/kernel/vendor/aws_polly/__init__.py
1
3171
import asyncio import ctypes import logging import os import threading import janus from ... import BaseRunner from .inproc import PollyInprocRunner log = logging.getLogger() class Runner(BaseRunner): log_prefix = 'vendor.aws_polly-kernel' def __init__(self, *args, **kwargs): super().__init__(*ar...
lgpl-3.0
reinaH/osf.io
scripts/analytics/email_invites.py
55
1332
# -*- coding: utf-8 -*- import os import matplotlib.pyplot as plt from framework.mongo import database from website import settings from utils import plot_dates, mkdirp user_collection = database['user'] FIG_PATH = os.path.join(settings.ANALYTICS_PATH, 'figs', 'features') mkdirp(FIG_PATH) def analyze_email_invi...
apache-2.0
gabrielfalcao/lettuce
tests/integration/lib/Django-1.3/django/core/cache/backends/db.py
227
6002
"Database cache backend." from django.core.cache.backends.base import BaseCache from django.db import connections, router, transaction, DatabaseError import base64, time from datetime import datetime try: import cPickle as pickle except ImportError: import pickle class Options(object): """A class that wil...
gpl-3.0
haeusser/tensorflow
tensorflow/contrib/training/python/training/sampling_ops_test.py
130
14840
# 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
zetaops/ulakbus
ulakbus/views/reports/base.py
1
6017
# -*- coding: utf-8 -*- """ """ # Copyright (C) 2015 ZetaOps Inc. # # This file is licensed under the GNU General Public License v3 # (GPLv3). See LICENSE.txt for details. from io import BytesIO from zengine.lib.translation import gettext as _, gettext_lazy import six from zengine.forms import JsonForm from zengine....
gpl-3.0
marcoantoniooliveira/labweb
oscar/apps/order/south_migrations/0001_initial.py
16
48240
# encoding: utf-8 import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models from oscar.core.compat import AUTH_USER_MODEL, AUTH_USER_MODEL_NAME class Migration(SchemaMigration): depends_on = ( ('catalogue', '0001_initial'), ('customer', '0001_initial'...
bsd-3-clause
venomJ/AndroidViewClient
examples/settings-sound-phone_ringtone.py
9
2025
#! /usr/bin/env python ''' Copyright (C) 2012 Diego Torres Milano Created on Sep 8, 2012 @author: diego @see: http://code.google.com/p/android/issues/detail?id=36544 ''' import re import sys import os # This must be imported before MonkeyRunner and MonkeyDevice, # otherwise the import fails. # PyDev sets PYTHONPA...
apache-2.0
hsluo/youtube-dl
youtube_dl/extractor/npo.py
85
17188
from __future__ import unicode_literals import re from .common import InfoExtractor from ..utils import ( fix_xml_ampersands, parse_duration, qualities, strip_jsonp, unified_strdate, ) class NPOBaseIE(InfoExtractor): def _get_token(self, video_id): token_page = self._download_webpage...
unlicense
TheWardoctor/Wardoctors-repo
plugin.video.salts/js2py/legecy_translators/nparser.py
96
99391
# JUST FOR NOW, later I will write my own - much faster and better. # Copyright (C) 2013 Ariya Hidayat <ariya.hidayat@gmail.com> # Copyright (C) 2013 Thaddee Tyl <thaddee.tyl@gmail.com> # Copyright (C) 2012 Ariya Hidayat <ariya.hidayat@gmail.com> # Copyright (C) 2012 Mathias Bynens <mathias@qiwi.be> # Copyright (...
apache-2.0
lordmuffin/aws-cfn-plex
functions/credstash/cryptography/exceptions.py
27
1234
# This file is dual licensed under the terms of the Apache License, Version # 2.0, and the BSD License. See the LICENSE file in the root of this repository # for complete details. from __future__ import absolute_import, division, print_function from enum import Enum class _Reasons(Enum): BACKEND_MISSING_INTERFA...
mit
pombredanne/nTLP
examples/gridworlds/gw_bm_analysis.py
1
4888
# Copyright (c) 2011, 2012 by California Institute of Technology # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # # 1. Redistributions of source code must retain the above copyright # notice...
bsd-3-clause
hazelnusse/sympy-old
sympy/geometry/curve.py
5
1190
from sympy.core import sympify from sympy.geometry.exceptions import GeometryError from entity import GeometryEntity class Curve(GeometryEntity): """ A curve in space. Example: ======== >>> from sympy import sin, cos, Symbol >>> t = Symbol("t") >>> C = Curve([sin(t), cos(t)], (...
bsd-3-clause
bleib1dj/neomodel
neomodel/core.py
3
8157
import os from .exception import DoesNotExist from .properties import Property, PropertyManager from .signals import hooks from .util import Database, deprecated, classproperty DATABASE_URL = os.environ.get('NEO4J_REST_URL', 'http://localhost:7474/db/data/') db = Database(DATABASE_URL) def install_labels(cls): ...
mit
fernandezcuesta/ansible
lib/ansible/plugins/action/net_base.py
12
8156
# (c) 2015, Ansible Inc, # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Ansible is di...
gpl-3.0
zhangpanrobot/myblog
node_modules/grunt-docker/node_modules/docker/node_modules/pygmentize-bundled/vendor/pygments/build-3.3/pygments/styles/autumn.py
364
2144
# -*- coding: utf-8 -*- """ pygments.styles.autumn ~~~~~~~~~~~~~~~~~~~~~~ A colorful style, inspired by the terminal highlighting style. :copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ from pygments.style import Style from pygments.to...
mit
lyhiving/livestreamer
src/livestreamer/plugins/cybergame.py
34
2269
import re from livestreamer.compat import urlparse from livestreamer.plugin import Plugin from livestreamer.plugin.api import http, validate from livestreamer.stream import RTMPStream PLAYLIST_URL = "http://api.cybergame.tv/p/playlist.smil" _url_re = re.compile(""" http(s)?://(\w+\.)?cybergame.tv (?: ...
bsd-2-clause
mathiasertl/django-ca
ca/django_ca/deprecation.py
1
1194
# This file is part of django-ca (https://github.com/mathiasertl/django-ca). # # django-ca 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
Desarrollo-CeSPI/meran
dev-plugins/node/lib/node/wafadmin/__init__.py
4
1914
#!/usr/bin/env python # Meran - MERAN UNLP is a ILS (Integrated Library System) wich provides Catalog, # Circulation and User's Management. It's written in Perl, and uses Apache2 # Web-Server, MySQL database and Sphinx 2 indexing. # Copyright (C) 2009-2013 Grupo de desarrollo de Meran CeSPI-UNLP # # This file is part ...
gpl-3.0
ForAP/Advanc3d-Pr0graming
Kivy-Resources/kivy-examples/widgets/effectwidget.py
38
5814
''' Example usage of the effectwidget. Currently highly experimental. ''' from kivy.app import App from kivy.uix.effectwidget import EffectWidget from kivy.uix.image import Image from kivy.uix.floatlayout import FloatLayout from kivy.uix.scatter import Scatter from kivy.uix.button import Button from kivy.uix.spinner ...
gpl-2.0
rcharp/toyota-flask
venv/lib/python2.7/site-packages/requests/packages/urllib3/request.py
853
5751
try: from urllib.parse import urlencode except ImportError: from urllib import urlencode from .filepost import encode_multipart_formdata __all__ = ['RequestMethods'] class RequestMethods(object): """ Convenience mixin for classes who implement a :meth:`urlopen` method, such as :class:`~urllib3....
apache-2.0
lubosz/cerbero
test/test_cerbero_packages_packagesstore.py
27
5247
# cerbero - a multi-platform build system for Open Source software # Copyright (C) 2012 Andoni Morales Alastruey <ylatuya@gmail.com> # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Library General Public # License as published by the Free Software Foundation; eit...
lgpl-2.1
isandlaTech/cohorte-runtime
python/src/lib/python/unidecode/x0bd.py
253
4752
data = ( 'bols', # 0x00 'bolt', # 0x01 'bolp', # 0x02 'bolh', # 0x03 'bom', # 0x04 'bob', # 0x05 'bobs', # 0x06 'bos', # 0x07 'boss', # 0x08 'bong', # 0x09 'boj', # 0x0a 'boc', # 0x0b 'bok', # 0x0c 'bot', # 0x0d 'bop', # 0x0e 'boh', # 0x0f 'bwa', # 0x10 'bwag', # 0x...
apache-2.0
was4444/chromium.src
build/android/play_services/update_test.py
19
14850
#!/usr/bin/env python # Copyright 2015 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. '''Unittests for update.py. They set up a temporary directory that is used to mock a bucket, the directory containing the configuratio...
bsd-3-clause
DataDog/integrations-core
couchbase/tests/test_unit.py
1
3050
# (C) Datadog, Inc. 2018-present # All rights reserved # Licensed under a 3-clause BSD style license (see LICENSE) from copy import deepcopy import mock import pytest from datadog_checks.couchbase import Couchbase def test_camel_case_to_joined_lower(instance): couchbase = Couchbase('couchbase', {}, [instance]) ...
bsd-3-clause
tarzasai/Flexget
flexget/plugins/metainfo/rottentomatoes_lookup.py
3
4365
from __future__ import unicode_literals, division, absolute_import from builtins import * # pylint: disable=unused-import, redefined-builtin from past.builtins import basestring import logging from flexget import plugin from flexget.event import event from flexget.utils.log import log_once try: from flexget.plu...
mit
seem-sky/kbengine
kbe/res/scripts/common/Lib/site-packages/pip/_vendor/requests/packages/chardet/charsetprober.py
3127
1902
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Universal charset detector code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 2001 # the Initial Developer. All R...
lgpl-3.0
mzbotr/python-gsmmodem
gsmmodem/pdu.py
10
32236
# -*- coding: utf8 -*- """ SMS PDU encoding methods """ from __future__ import unicode_literals import sys, codecs, math from datetime import datetime, timedelta, tzinfo from copy import copy from .exceptions import EncodingError # For Python 3 support PYTHON_VERSION = sys.version_info[0] if PYTHON_VERSION >= 3: ...
lgpl-3.0
mrrrgn/olympia
apps/amo/tests/test_redirects.py
15
8955
# -*- coding: utf-8 -*- """Check all our redirects from remora to zamboni.""" from nose.tools import eq_ import amo import amo.tests from addons.models import Category from django.db import connection class TestRedirects(amo.tests.TestCase): fixtures = ['reviews/test_models', 'addons/persona', 'base/global-stat...
bsd-3-clause
lz1988/flaskweb
Lib/site-packages/pip/_vendor/requests/packages/urllib3/contrib/ntlmpool.py
1010
4507
""" NTLM authenticating pool, contributed by erikcederstran Issue #10, see: http://code.google.com/p/urllib3/issues/detail?id=10 """ try: from http.client import HTTPSConnection except ImportError: from httplib import HTTPSConnection from logging import getLogger from ntlm import ntlm from urllib3 import HTT...
bsd-2-clause
shantanu561993/volatility
volatility/plugins/gui/windows.py
54
4108
# Volatility # Copyright (C) 2007-2013 Volatility Foundation # Copyright (C) 2010,2011,2012 Michael Hale Ligh <michael.ligh@mnin.org> # # This file is part of Volatility. # # Volatility is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the F...
gpl-2.0
sahiljain/catapult
third_party/gsutil/third_party/boto/boto/vpc/customergateway.py
170
1968
# Copyright (c) 2009-2010 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...
bsd-3-clause
TwolDE2/enigma2
lib/python/Plugins/SystemPlugins/VideoTune/VideoFinetune.py
6
11055
from enigma import gFont, getDesktop, gMainDC, eSize, RT_HALIGN_RIGHT, RT_WRAP from Screens.Screen import Screen from Components.Sources.CanvasSource import CanvasSource from Components.ActionMap import NumberActionMap from Tools.Directories import fileExists def RGB(r,g,b): return (r<<16)|(g<<8)|b class OverscanT...
gpl-2.0
roshchupkin/hase
tools/VCF2hdf5.py
1
4024
import os import sys sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) from config import PYTHON_PATH if PYTHON_PATH is not None: for i in PYTHON_PATH: sys.path.insert(0,i) import argparse import h5py import pandas as pd import numpy as np from hdgwas.tools import Timer import tables import...
gpl-3.0
gnemoug/scrapy
scrapy/tests/test_spidermiddleware_offsite.py
25
1694
from unittest import TestCase from scrapy.http import Response, Request from scrapy.spider import BaseSpider from scrapy.contrib.spidermiddleware.offsite import OffsiteMiddleware class TestOffsiteMiddleware(TestCase): def setUp(self): self.spider = self._get_spider() self.mw = OffsiteMiddleware(...
bsd-3-clause
follow99/django
tests/transactions/tests.py
88
19722
from __future__ import unicode_literals import sys import threading import time from unittest import skipIf, skipUnless from django.db import ( DatabaseError, Error, IntegrityError, OperationalError, connection, transaction, ) from django.test import ( TransactionTestCase, skipIfDBFeature, skipUnlessDBFea...
bsd-3-clause
Designist/audacity
lib-src/lv2/lv2/waflib/Scripting.py
177
10667
#! /usr/bin/env python # encoding: utf-8 # WARNING! Do not edit! http://waf.googlecode.com/git/docs/wafbook/single.html#_obtaining_the_waf_file import os,shlex,shutil,traceback,errno,sys,stat from waflib import Utils,Configure,Logs,Options,ConfigSet,Context,Errors,Build,Node build_dir_override=None no_climb_commands=[...
gpl-2.0
FurCode/SubChannel
botcore/reloader.py
33
2824
import asyncio import os.path from watchdog.observers import Observer from watchdog.events import PatternMatchingEventHandler class PluginReloader(object): def __init__(self, bot): """ :type bot: cloudbot.bot.CloudBot """ self.observer = Observer() self.bot = bot s...
gpl-2.0
maleficarium/youtube-dl
youtube_dl/extractor/closertotruth.py
83
3095
# coding: utf-8 from __future__ import unicode_literals import re from .common import InfoExtractor class CloserToTruthIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?closertotruth\.com/(?:[^/]+/)*(?P<id>[^/?#&]+)' _TESTS = [{ 'url': 'http://closertotruth.com/series/solutions-the-mind-body-prob...
unlicense
neudesk/neucloud
openstack_dashboard/dashboards/admin/flavors/extras/urls.py
9
1194
# 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
eeshangarg/oh-mainline
vendor/packages/scrapy/scrapy/utils/reqser.py
81
2081
""" Helper functions for serializing (and deserializing) requests. """ from scrapy.http import Request def request_to_dict(request, spider=None): """Convert Request object to a dict. If a spider is given, it will try to find out the name of the spider method used in the callback and store that as the cal...
agpl-3.0
creativecommons/open-ledger
util/scheduled-snapshots/requests/packages/chardet/gb2312freq.py
3132
36011
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Communicator client code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 1998 # the Initial Developer. All Rights R...
mit
ZhangXinNan/tensorflow
tensorflow/compiler/tests/segment_reduction_ops_test.py
8
7759
# 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
georgestarcher/TA-SyncKVStore
bin/ta_synckvstore/solnlib/user_access.py
6
30144
# Copyright 2016 Splunk, 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 writing,...
mit
maurizi/otm-core
opentreemap/otm1_migrator/migration_rules/philadelphia.py
12
3768
from otm1_migrator.migration_rules.standard_otm1 import MIGRATION_RULES from treemap.models import ITreeCodeOverride, ITreeRegion, User UDFS = { 'plot': { 'owner_additional_id': { 'udf.name': 'Owner Additional Id' }, 'owner_additional_properties': { 'udf.name': 'Own...
agpl-3.0
rjeli/scikit-image
skimage/draw/tests/test_draw3d.py
37
4429
import numpy as np from numpy.testing import assert_array_equal, assert_allclose from nose.tools import raises from skimage.draw import ellipsoid, ellipsoid_stats @raises(ValueError) def test_ellipsoid_sign_parameters1(): ellipsoid(-1, 2, 2) @raises(ValueError) def test_ellipsoid_sign_parameters2(): ellips...
bsd-3-clause
joanayma/pyautorunalize
pyautorunanalize.py
1
5119
#! /bin/env python """ PyAutorunalizer 0.1 Python script for autorunalize: http://sysinternals.com/autoruns.com listing autoruns Windows items. Version 11.6 or greater needed. http://Virutotal.com externa database of viruses. original idea: http://trustedsignal.blogspot.com.es/2012/02/finding-evil-automating-aut...
gpl-2.0
openhatch/oh-mainline
vendor/packages/sqlparse/tests/test_regressions.py
15
8709
# -*- coding: utf-8 -*- import sys from tests.utils import TestCaseBase, load_file import sqlparse from sqlparse import sql from sqlparse import tokens as T class RegressionTests(TestCaseBase): def test_issue9(self): # make sure where doesn't consume parenthesis p = sqlparse.parse('(where 1)')...
agpl-3.0
moutai/scikit-learn
sklearn/manifold/locally_linear.py
37
25852
"""Locally Linear Embedding""" # Author: Fabian Pedregosa -- <fabian.pedregosa@inria.fr> # Jake Vanderplas -- <vanderplas@astro.washington.edu> # License: BSD 3 clause (C) INRIA 2011 import numpy as np from scipy.linalg import eigh, svd, qr, solve from scipy.sparse import eye, csr_matrix from ..base import B...
bsd-3-clause
bilke/OpenSG-1.8
SConsLocal/scons-local-0.96.1/SCons/Tool/__init__.py
2
13279
"""SCons.Tool SCons tool selection. This looks for modules that define a callable object that can modify a construction environment as appropriate for a given tool (or tool chain). Note that because this subsystem just *selects* a callable that can modify a construction environment, it's possible for people to defin...
lgpl-2.1
juharris/tensorflow
tensorflow/python/tools/print_selective_registration_header.py
6
4243
# 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
nshalman/qemu
scripts/analyse-9p-simpletrace.py
333
9058
#!/usr/bin/env python # Pretty print 9p simpletrace log # Usage: ./analyse-9p-simpletrace <trace-events> <trace-pid> # # Author: Harsh Prateek Bora import os import simpletrace symbol_9p = { 6 : 'TLERROR', 7 : 'RLERROR', 8 : 'TSTATFS', 9 : 'RSTATFS', 12 : 'TLOPEN', 13 : 'RLOPEN', ...
gpl-2.0
CYBAI/servo
tests/wpt/web-platform-tests/tools/wptrunner/wptrunner/executors/protocol.py
4
16295
import traceback from abc import ABCMeta, abstractmethod class Protocol(object): """Backend for a specific browser-control protocol. Each Protocol is composed of a set of ProtocolParts that implement the APIs required for specific interactions. This reflects the fact that not all implementaions will...
mpl-2.0
jsheedy/velotronheavyindustries.com
intro-to-d3-grid-map/node_modules/node-sass/node_modules/node-gyp/gyp/pylib/gyp/generator/analyzer.py
1382
30567
# 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. """ This script is intended for use as a GYP_GENERATOR. It takes as input (by way of the generator flag config_path) the path of a json file that dictates the file...
mit