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
blueburningcoder/pybrain
pybrain/optimization/populationbased/evolution.py
31
1133
__author__ = 'Tom Schaul, tom@idsia.ch' from pybrain.utilities import abstractMethod from pybrain.optimization.optimizer import BlackBoxOptimizer class Evolution(BlackBoxOptimizer): """ Base class for evolutionary algorithms, seen as function optimizers. """ populationSize = 10 storeAllPopulations = Fa...
bsd-3-clause
OpenUpgrade/OpenUpgrade
addons/email_template/wizard/__init__.py
446
1130
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2009 Sharoon Thomas # Copyright (C) 2010-Today OpenERP SA (<http://www.openerp.com>) # # This program is free software: you can redistribute it ...
agpl-3.0
wdv4758h/ZipPy
lib-python/3/encodings/quopri_codec.py
55
1550
"""Codec for quoted-printable encoding. This codec de/encodes from bytes to bytes and is therefore usable with bytes.transform() and bytes.untransform(). """ import codecs import quopri from io import BytesIO def quopri_encode(input, errors='strict'): assert errors == 'strict' f = BytesIO(input) g = Byte...
bsd-3-clause
martinghunt/ariba
ariba/sequence_metadata.py
2
1992
from ariba import sequence_variant class Error (Exception): pass class SequenceMetadata: def __init__(self, line): try: self.name, seq_type, var_only, variant, variant_id, self.free_text = line.rstrip().split('\t') except: raise Error('Error parsing line of file:\n' + line...
gpl-3.0
roadev/electron
script/lib/github.py
200
2214
#!/usr/bin/env python import json import os import re import sys REQUESTS_DIR = os.path.abspath(os.path.join(__file__, '..', '..', '..', 'vendor', 'requests')) sys.path.append(os.path.join(REQUESTS_DIR, 'build', 'lib')) sys.path.append(os.path.join(REQUESTS_DIR, 'build', 'l...
mit
dboyliao/codecombat
scripts/analytics/mixpanelLevelRates.py
97
6288
# Calculate level completion rates via mixpanel export API # TODO: why are our 'time' fields in PST time? targetLevels = ['dungeons-of-kithgard', 'the-raised-sword', 'endangered-burl'] eventFunnel = ['Started Level', 'Saw Victory'] import sys from datetime import datetime, timedelta from mixpanel import Mixpanel t...
mit
arenadata/ambari
ambari-server/src/main/resources/stacks/ADH/1.4/services/SOLR/package/scripts/service_check.py
2
1936
#!/usr/bin/env python import os from resource_management.core.logger import Logger from resource_management.core.resources.system import Execute from resource_management.libraries.functions.format import format from resource_management.libraries.script import Script from solr_utils import exists_collection class S...
apache-2.0
arenadata/ambari
ambari-server/src/test/python/TestStackAdvisor.py
2
19610
''' 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 this ...
apache-2.0
insiderr/insiderr-app
ios-patches/basemodules/twisted/web/_newclient.py
5
58220
# -*- test-case-name: twisted.web.test.test_newclient -*- # Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ An U{HTTP 1.1<http://www.w3.org/Protocols/rfc2616/rfc2616.html>} client. The way to use the functionality provided by this module is to: - Connect a L{HTTP11ClientProtocol} to an HT...
gpl-3.0
himmih/cluedo
venv/lib/python2.7/site-packages/pip/_vendor/html5lib/treeadapters/sax.py
1835
1661
from __future__ import absolute_import, division, unicode_literals from xml.sax.xmlreader import AttributesNSImpl from ..constants import adjustForeignAttributes, unadjustForeignAttributes prefix_mapping = {} for prefix, localName, namespace in adjustForeignAttributes.values(): if prefix is not None: pre...
apache-2.0
Southpaw-TACTIC/Team
src/python/Lib/site-packages/PySide/examples/declarative/scrolling.py
1
2311
#!/usr/bin/env python # Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). # All rights reserved. # Contact: PySide Team (pyside@openbossa.org) # # This file is part of the examples of PySide: Python for Qt. # # You may use this file under the terms of the BSD license as follows: # # "Redistribution and...
epl-1.0
hosseinmh/jango_learning
.venv/lib/python2.7/site-packages/django/db/models/fields/related.py
33
66699
from __future__ import unicode_literals import warnings from functools import partial from django import forms from django.apps import apps from django.core import checks, exceptions from django.db import connection, router from django.db.backends import utils from django.db.models import Q from django.db.models.dele...
mit
j-marjanovic/myhdl
myhdl/_always_comb.py
1
4522
# This file is part of the myhdl library, a Python package for using # Python as a Hardware Description Language. # # Copyright (C) 2003-2009 Jan Decaluwe # # The myhdl library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public License as # published by t...
lgpl-2.1
uskudnik/amazon-glacier-cmd-interface
glacier/glacierexception.py
8
9197
import traceback import re import sys import logging """ ********** Note by wvmarle: This file contains the complete code from chained_exception.py plus the error handling code from GlacierWrapper.py, allowing it to be used in other modules like glaciercorecalls as well. ********** """ class GlacierException(Except...
mit
dongguangming/youtube-dl
youtube_dl/extractor/vgtv.py
102
7096
# coding: utf-8 from __future__ import unicode_literals import re from .common import InfoExtractor from ..utils import ( ExtractorError, float_or_none, ) class VGTVIE(InfoExtractor): IE_DESC = 'VGTV and BTTV' _VALID_URL = r'''(?x) (?: vgtv:| ...
unlicense
redhat-openstack/rally
tests/unit/plugins/openstack/context/ec2/test_servers.py
10
4021
# 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 applicable law or agreed to in writing, software #...
apache-2.0
ict-felix/stack
vt_manager/src/python/vt_manager/common/rpc4django/xmlrpcdispatcher.py
9
2733
""" Implements an XMLRPC dispatcher """ import sys import xmlrpclib from xmlrpclib import Fault from SimpleXMLRPCServer import SimpleXMLRPCDispatcher import traceback class XMLRPCDispatcher(SimpleXMLRPCDispatcher): """ Encodes and decodes XMLRPC messages, dispatches to the requested method and returns any...
apache-2.0
rhdedgar/openshift-tools
ansible/roles/lib_openshift_3.2/build/ansible/oc_obj.py
12
4493
# pylint: skip-file # pylint: disable=too-many-branches def main(): ''' ansible oc module for services ''' module = AnsibleModule( argument_spec=dict( kubeconfig=dict(default='/etc/origin/master/admin.kubeconfig', type='str'), state=dict(default='present', type='str', ...
apache-2.0
dongxingshui/virt-manager
virtinst/snapshot.py
5
2621
# # Copyright 2013-2014 Red Hat, Inc. # Cole Robinson <crobinso@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 by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later ver...
gpl-2.0
matthieudumont/dipy
tools/pack_examples.py
22
1148
#!/usr/bin/env python """ Script to pack built examples into suitably named archive Usage %s output_dir [doc_dir] """ import os from os.path import join as pjoin import sys import shutil import tarfile import dipy __doc__ = __doc__ % sys.argv[0] EG_BUILT_SDIR = 'examples_built' dpv = 'dipy-' + dipy.__version__ arc...
bsd-3-clause
VoiDeD/Sick-Beard
sickbeard/databases/mainDB.py
10
31970
# Author: Nic Wolfe <nic@wolfeden.ca> # URL: http://code.google.com/p/sickbeard/ # # This file is part of Sick Beard. # # Sick Beard 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 t...
gpl-3.0
zhenzhai/edx-platform
lms/djangoapps/ccx/modulestore.py
13
13391
# -*- coding: utf-8 -*- """A modulestore wrapper It will 'unwrap' ccx keys on the way in and re-wrap them on the way out In practical terms this means that when an object is retrieved from modulestore using a CCXLocator or CCXBlockUsageLocator as the key, the equivalent CourseLocator or BlockUsageLocator will actuall...
agpl-3.0
srvg/ansible
test/integration/targets/var_precedence/ansible-var-precedence-check.py
35
18772
#!/usr/bin/env python # A tool to check the order of precedence for ansible variables # https://github.com/ansible/ansible/blob/devel/test/integration/test_var_precedence.yml from __future__ import (absolute_import, division, print_function) __metaclass__ = type import json import os import sys import shutil import ...
gpl-3.0
TheTypoMaster/chromium-crosswalk
chrome/common/extensions/docs/server2/admin_servlets.py
37
4612
# 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 json import logging from appengine_wrappers import memcache from commit_tracker import CommitTracker from environment import IsDevServer from environ...
bsd-3-clause
szha/mxnet
cpp-package/scripts/lint.py
16
7389
#!/usr/bin/env python # 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 # "L...
apache-2.0
llvm-mirror/lldb
packages/Python/lldbsuite/test/lang/objc/objc-static-method/TestObjCStaticMethod.py
5
2614
"""Test calling functions in static methods.""" from __future__ import print_function import lldb from lldbsuite.test.decorators import * from lldbsuite.test.lldbtest import * from lldbsuite.test import lldbutil class TestObjCStaticMethod(TestBase): mydir = TestBase.compute_mydir(__file__) def setUp(self...
apache-2.0
chyeh727/django
django/db/migrations/operations/models.py
290
21735
from __future__ import unicode_literals from django.db import models from django.db.migrations.operations.base import Operation from django.db.migrations.state import ModelState from django.db.models.options import normalize_together from django.utils import six from django.utils.functional import cached_property cl...
bsd-3-clause
zenlambda/pip
pip/_vendor/requests/cookies.py
413
17191
# -*- coding: utf-8 -*- """ Compatibility code to be able to use `cookielib.CookieJar` with requests. requests.utils imports from here, so be careful with imports. """ import copy import time import collections from .compat import cookielib, urlparse, urlunparse, Morsel try: import threading # grr, pyflakes...
mit
enricobacis/cineca-scopus
src/cineca3.py
1
3928
#!/usr/bin/env python #coding: utf-8 from contextlib import closing from operator import itemgetter from datetime import datetime from argparse import ArgumentParser from unicodecsv import DictWriter from utils import read_cineca_file, csv_to_db import sqlite3 import json import re FIELDS = ['Ateneo', 'Facoltà', 'Fas...
mit
ar7z1/ansible
lib/ansible/modules/storage/netapp/na_elementsw_ldap.py
9
8686
#!/usr/bin/python # (c) 2017, 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
chewing/chewing-editor
gmock/gtest/scripts/fuse_gtest_files.py
2577
8813
#!/usr/bin/env python # # Copyright 2009, 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...
gpl-2.0
vmax-feihu/hue
desktop/core/ext-py/Django-1.6.10/tests/sites_framework/tests.py
150
1800
from __future__ import absolute_import from django.conf import settings from django.contrib.sites.models import Site from django.test import TestCase from .models import (SyndicatedArticle, ExclusiveArticle, CustomArticle, InvalidArticle, ConfusedArticle) class SitesFrameworkTestCase(TestCase): def setUp(se...
apache-2.0
SerCeMan/intellij-community
python/lib/Lib/select.py
79
9130
""" This is an select module for use on JVMs > 1.5. It is documented, along with known issues and workarounds, on the jython wiki. http://wiki.python.org/jython/SelectModule """ import java.nio.channels.SelectableChannel import java.nio.channels.SelectionKey import java.nio.channels.Selector from java.nio.channels.Sel...
apache-2.0
TathagataChakraborti/resource-conflicts
PLANROB-2015/seq-sat-lama/Python-2.5.2/Lib/pstats.py
94
25940
"""Class for printing reports on profiled python code.""" # Class for printing reports on profiled python code. rev 1.0 4/1/94 # # Based on prior profile module by Sjoerd Mullender... # which was hacked somewhat by: Guido van Rossum # # see profile.doc and profile.py for more info. # Copyright 1994, by InfoSeek Co...
mit
MJuddBooth/pandas
pandas/tests/series/test_block_internals.py
2
1472
# -*- coding: utf-8 -*- import pandas as pd # Segregated collection of methods that require the BlockManager internal data # structure class TestSeriesBlockInternals(object): def test_setitem_invalidates_datetime_index_freq(self): # GH#24096 altering a datetime64tz Series inplace invalidates the ...
bsd-3-clause
j-rock/cs598ps
src/py/main.py
1
4059
import sys import time from cssigps.offlineclassifier import * from cssigps.dataset import * from cssigps.feature import * from cssigps.experiments import * from get_dropbox_path import * def print_usage(): """ Print the usage for the main script. """ print("USAGE: use the run.sh or the main.py direct...
mit
StefanRijnhart/OpenUpgrade
addons/account_followup/tests/__init__.py
175
1128
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Business Applications # Copyright (c) 2012-TODAY OpenERP S.A. <http://openerp.com> # # This program is free software: you can redistribute it and/or modify # it under the terms of ...
agpl-3.0
valentinas/mediaBam
bs4/dammit.py
36
29653
# -*- coding: utf-8 -*- """Beautiful Soup bonus library: Unicode, Dammit This class forces XML data into a standard format (usually to UTF-8 or Unicode). It is heavily based on code from Mark Pilgrim's Universal Feed Parser. It does not rewrite the XML or HTML to reflect a new encoding; that's the tree builder's job....
mit
seemoo-lab/nexmon
buildtools/gcc-arm-none-eabi-5_4-2016q2-osx/arm-none-eabi/lib/armv7e-m/fpu/fpv5-sp-d16/libstdc++.a-gdb.py
6
2626
# -*- python -*- # Copyright (C) 2009-2015 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your option) any later versio...
gpl-3.0
Antiun/odoo
addons/event/__openerp__.py
261
2296
# -*- 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
AnhellO/DAS_Sistemas
Ago-Dic-2017/Enrique Castillo/Ordinario/test/Lib/site-packages/pip/commands/search.py
343
4502
from __future__ import absolute_import import logging import sys import textwrap from pip.basecommand import Command, SUCCESS from pip.compat import OrderedDict from pip.download import PipXmlrpcTransport from pip.models import PyPI from pip.utils import get_terminal_size from pip.utils.logging import indent_log from...
mit
jhawkesworth/ansible
lib/ansible/modules/cloud/huawei/hwc_network_vpc.py
3
12864
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright (C) 2018 Huawei # 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 #################################################################...
gpl-3.0
eepalms/gem5-newcache
tests/configs/simple-atomic-mp.py
69
2376
# Copyright (c) 2013 ARM Limited # All rights reserved. # # The license below extends only to copyright in the software and shall # not be construed as granting a license to any other intellectual # property including but not limited to intellectual property relating # to a hardware implementation of the functionality ...
bsd-3-clause
a-parhom/edx-platform
lms/djangoapps/shoppingcart/tests/test_payment_fake.py
13
4211
""" Tests for the fake payment page used in acceptance tests. """ from collections import OrderedDict from django.test import TestCase from shoppingcart.processors.CyberSource2 import sign, verify_signatures from shoppingcart.processors.exceptions import CCProcessorSignatureException from shoppingcart.tests.payment_...
agpl-3.0
saintdragon2/python-3-lecture-2015
civil-final/2nd_presentation/11조/pygame/tests/sysfont_test.py
21
1666
#################################### IMPORTS ################################### if __name__ == '__main__': import sys import os pkg_dir = os.path.split(os.path.abspath(__file__))[0] parent_dir, pkg_name = os.path.split(pkg_dir) is_pygame_pkg = (pkg_name == 'tests' and os.path....
mit
abought/osf.io
scripts/tests/test_migrate_logs_fix.py
57
1339
from website.models import Node from tests.base import OsfTestCase from tests.factories import ProjectFactory, UserFactory, NodeFactory from scripts.migrate_logs_fix import ( do_migration, get_targets ) class TestMigrateLogs(OsfTestCase): def tearDown(self): OsfTestCase.tearDown(self) Node.re...
apache-2.0
jtaghiyar/kronos
setup.py
1
1513
''' Created on Jul 10, 2014 @author: jtaghiyar ''' import codecs import os import re from setuptools import setup def read(*paths): here = os.path.dirname(os.path.abspath(__file__)) with open(os.path.join(here, *paths)) as f: return f.read() def get_version(): version_file = read("kronos", "kron...
mit
DecipherOne/Troglodyte
Trog Build Dependencies/Python26/Lib/logging/config.py
2
13417
# Copyright 2001-2007 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...
mit
sasukeh/acos-client
acos_client/v21/slb/member.py
4
1790
# Copyright 2014, Doug Wiegley, A10 Networks. # # 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
ATIX-AG/ansible
lib/ansible/modules/network/f5/bigip_hostname.py
28
6234
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright (c) 2017 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
fernandezcuesta/ansible
lib/ansible/modules/database/misc/redis.py
8
10672
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright: Ansible Project # 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.0', ...
gpl-3.0
wdv4758h/ZipPy
edu.uci.python.benchmark/src/micro/boolean-logic.py
1
1621
# zwei 04/24/2014 # micro benchmark: method call polymorphic inspired by richards import time iteration = 50000 class Task(object): def __init__(self, p, w, h): self.packet_pending = p self.task_waiting = w self.task_holding = h self.link = None def isTaskHoldingOrWaiting(self...
bsd-3-clause
pelson/conda-build
tests/test_misc.py
4
2003
import json from os.path import join import pytest from conda_build.utils import on_win import conda_build._link as _link from conda_build.conda_interface import PathType, EntityEncoder, CrossPlatformStLink def test_pyc_f_2(): assert _link.pyc_f('sp/utils.py', (2, 7, 9)) == 'sp/utils.pyc' def test_pyc_f_3(): ...
bsd-3-clause
abought/osf.io
website/addons/box/tests/test_models.py
15
1908
# -*- coding: utf-8 -*- import mock from nose.tools import * # noqa (PEP8 asserts) from tests.base import OsfTestCase from tests.factories import UserFactory from website.addons.box.tests.factories import ( BoxUserSettingsFactory, BoxNodeSettingsFactory, BoxAccountFactory ) from website.addons.box.model ...
apache-2.0
sergey-dryabzhinsky/denyhosts_sync
tests/test_models.py
2
6478
# denyhosts sync server # Copyright (C) 2015 Jan-Pascal van Best <janpascal@vanbest.org> # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published # by the Free Software Foundation, either version 3 of the License, or # (at your op...
agpl-3.0
ucrawler/cp-uc
libs/pyutil/scripts/memdump2dot.py
106
1589
#!/usr/bin/env python import bindann bindann.install_exception_handler() import sys inf = open(sys.argv[1], "r") outf = open(sys.argv[1]+".dot", "w") outf.write("digraph %s {\n" % sys.argv[1].replace(".","")) def parse_netstring(l, i): try: j = l.find(':', i) if j == -1: return (Non...
gpl-3.0
BiznetGIO/horizon
openstack_dashboard/api/base.py
1
12067
# 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 # not use this file except in compliance with the...
apache-2.0
robinro/ansible
lib/ansible/modules/cloud/webfaction/webfaction_site.py
63
7118
#!/usr/bin/python # # Create Webfaction website using Ansible and the Webfaction API # # ------------------------------------------ # # (c) Quentin Stafford-Fraser 2015 # # 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 Lic...
gpl-3.0
Ernesto99/odoo
addons/website/models/ir_http.py
162
13407
# -*- coding: utf-8 -*- import logging import os import re import traceback import werkzeug import werkzeug.routing import werkzeug.utils import openerp from openerp.addons.base import ir from openerp.addons.base.ir import ir_qweb from openerp.addons.website.models.website import slug, url_for, _UNSLUG_RE from opener...
agpl-3.0
CLVsol/oehealth_gs
oehealth_gs_medicament/__openerp__.py
1
2003
# -*- encoding: utf-8 -*- ################################################################################ # # # Copyright (C) 2013-Today Carlos Eduardo Vercelino - CLVsol # # ...
agpl-3.0
bop/bauhaus
lib/python2.7/site-packages/django/contrib/gis/db/backends/postgis/introspection.py
109
4592
from django.db.backends.postgresql_psycopg2.introspection import DatabaseIntrospection from django.contrib.gis.gdal import OGRGeomType class GeoIntrospectionError(Exception): pass class PostGISIntrospection(DatabaseIntrospection): # Reverse dictionary for PostGIS geometry types not populated until # intro...
mit
GbalsaC/bitnamiP
venv/lib/python2.7/site-packages/django/contrib/gis/tests/layermap/models.py
239
2241
from django.contrib.gis.db import models class State(models.Model): name = models.CharField(max_length=20) objects = models.GeoManager() class County(models.Model): name = models.CharField(max_length=25) state = models.ForeignKey(State) mpoly = models.MultiPolygonField(srid=4269) # Multipolygon in...
agpl-3.0
migonzalvar/youtube-dl
youtube_dl/extractor/vidme.py
49
3430
from __future__ import unicode_literals from .common import InfoExtractor from ..utils import ( int_or_none, float_or_none, str_to_int, ) class VidmeIE(InfoExtractor): _VALID_URL = r'https?://vid\.me/(?:e/)?(?P<id>[\da-zA-Z]+)' _TESTS = [{ 'url': 'https://vid.me/QNB', 'md5': 'f42d...
unlicense
Big-B702/python-for-android
python-build/python-libs/gdata/src/gdata/health/__init__.py
263
7090
#!/usr/bin/python # # Copyright 2009 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 b...
apache-2.0
espressomd/espresso
testsuite/python/elc.py
2
2980
# Copyright (C) 2010-2019 The ESPResSo project # # This file is part of ESPResSo. # # ESPResSo 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 v...
gpl-3.0
eventql/eventql
deps/3rdparty/spidermonkey/mozjs/python/virtualenv/docs/conf.py
30
4590
# -*- coding: utf-8 -*- # # Paste documentation build configuration file, created by # sphinx-quickstart on Tue Apr 22 22:08:49 2008. # # 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...
agpl-3.0
ozmartian/tvlinker
tvlinker/threads.py
1
11150
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import os import sys import time from datetime import datetime, timedelta from tzlocal import get_localzone import pytz import requests from PyQt5.QtCore import QObject, QSettings, QThread, pyqtSignal, pyqtSlot from PyQt5.QtWidgets import QMessageBox, qApp from bs4 imp...
gpl-3.0
jacky-young/crosswalk-test-suite
webapi/tct-download-tizen-tests/inst.xpk.py
357
6759
#!/usr/bin/env python import os import shutil import glob import time import sys import subprocess import string from optparse import OptionParser, make_option SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__)) PKG_NAME = os.path.basename(SCRIPT_DIR) PARAMETERS = None #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=...
bsd-3-clause
lianwutech/plugin_tcpclient_yykjir
plugin.py
2
3860
#!/usr/bin/env python # -*- coding:utf-8 -*- """ modbus网络的串口数据采集插件 1、device_id的组成方式为ip_port_slaveid 2、设备类型为0,协议类型为modbus 3、devices_info_dict需要持久化设备信息,启动时加载,变化时写入 4、device_cmd内容:json字符串 """ import time from setting import * from libs.daemon import Daemon from libs.plugin import * from libs.mqttclie...
apache-2.0
DirkHoffmann/indico
indico/modules/events/posters.py
4
2466
# This file is part of Indico. # Copyright (C) 2002 - 2021 CERN # # Indico is free software; you can redistribute it and/or # modify it under the terms of the MIT License; see the # LICENSE file for more details. from collections import namedtuple from reportlab.lib.units import cm from reportlab.lib.utils import Ima...
gpl-3.0
thnee/ansible
test/units/template/test_safe_eval.py
58
1820
# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com> # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) an...
gpl-3.0
abferm/libqmi
build-aux/qmi-codegen/MessageList.py
6
9514
#!/usr/bin/env python # -*- Mode: python; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- # # This program 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 version 2 of the License, or ...
gpl-2.0
debugger87/spark
examples/src/main/python/sql/hive.py
24
3317
# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not us...
apache-2.0
xunilrj/sandbox
courses/course-edx-dat2031x/Simulation.py
1
2680
# -*- coding: utf-8 -*- def sim_normal(nums, mean = 600, sd = 30): import numpy as np import numpy.random as nr for n in nums: dist = nr.normal(loc = mean, scale = sd, size = n) titl = 'Normal distribution with ' + str(n) + ' values' print('Summary for ' + str(n) + ' samples') ...
apache-2.0
willdavidc/piel
catkin_ws/src/piel/scripts/venv/lib/python2.7/site-packages/pip/_vendor/colorama/ansi.py
640
2524
# Copyright Jonathan Hartley 2013. BSD 3-Clause license, see LICENSE file. ''' This module generates ANSI character codes to printing colors to terminals. See: http://en.wikipedia.org/wiki/ANSI_escape_code ''' CSI = '\033[' OSC = '\033]' BEL = '\007' def code_to_chars(code): return CSI + str(code) + 'm' def set...
mit
rancher/cattle
tests/integration-v1/cattletest/core/test_authorization.py
5
80090
from common import * # NOQA @pytest.fixture(scope='module') def user_client(admin_user_client): return create_context(admin_user_client, create_project=False, add_host=False, kind='user').user_client @pytest.fixture(scope='module') def read_admin_client(admin_user_client): return ...
apache-2.0
samdroid-apps/sugar-toolkit-gtk3
src/sugar3/bundle/activitybundle.py
1
14091
# Copyright (C) 2007, Red Hat, Inc. # # 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 # version 2 of the License, or (at your option) any later version. # # This library is distrib...
lgpl-2.1
shashank971/edx-platform
common/djangoapps/embargo/models.py
53
25524
""" Models for embargoing visits to certain courses by IP address. WE'RE USING MIGRATIONS! If you make changes to this model, be sure to create an appropriate migration file and check it in at the same time as your model changes. To do that, 1. Go to the edx-platform dir 2. ./manage.py lms schemamigration embargo --...
agpl-3.0
txemagon/1984
modules/Telegram-bot-python/telegram/inputmessagecontent.py
3
1952
#!/usr/bin/env python # # A library that provides a Python interface to the Telegram Bot API # Copyright (C) 2015-2017 # Leandro Toledo de Souza <devs@python-telegram-bot.org> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser Public License as published by #...
gpl-3.0
diofeher/django-nfa
build/lib/django/views/defaults.py
3
3482
from django.core.exceptions import ObjectDoesNotExist from django.template import Context, RequestContext, loader from django.contrib.contenttypes.models import ContentType from django.contrib.sites.models import Site from django import http def shortcut(request, content_type_id, object_id): "Redirect to an object...
bsd-3-clause
specify/specify7
specifyweb/stored_queries/tests.py
1
11203
from sqlalchemy import orm from unittest import skip from specifyweb.specify.api_tests import ApiTests from .queryfieldspec import QueryFieldSpec from . import models @skip("These tests are out of date.") class StoredQueriesTests(ApiTests): # def setUp(self): # super(StoredQueriesTests, self).setUp() ...
gpl-2.0
uclouvain/osis
learning_unit/ddd/domain/description_fiche.py
1
2627
############################################################################## # # OSIS stands for Open Student Information System. It's an application # designed to manage the core business of higher education institutions, # such as universities, faculties, institutes and professional schools. # The core ...
agpl-3.0
txemi/ansible
lib/ansible/plugins/lookup/shelvefile.py
89
2496
# (c) 2015, Alejandro Guirao <lekumberri@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 later...
gpl-3.0
yoki/phantomjs
src/qt/qtwebkit/Tools/Scripts/webkitpy/port/port_testcase.py
115
28371
# Copyright (C) 2010 Google Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the f...
bsd-3-clause
roger-zhao/ardupilot-3.3
Tools/LogAnalyzer/tests/TestVibration.py
261
3069
from LogAnalyzer import Test,TestResult import DataflashLog import numpy class TestVibration(Test): '''test for accelerometer vibration (accX/accY/accZ) within recommendations''' def __init__(self): Test.__init__(self) self.name = "Vibration" def run(self, logdata, verbose): se...
gpl-3.0
GeekBoy666/VGCS
ExtLibs/Mavlink/pymavlink/generator/lib/minixsv/xsvalErrorHandler.py
82
5624
# # minixsv, Release 0.9.0 # file: xsvalErrorHandler.py # # XML schema validator classes # # history: # 2004-09-23 rl created # # Copyright (c) 2004-2008 by Roland Leuthe. All rights reserved. # # -------------------------------------------------------------------- # The minixsv XML schema validator is ...
gpl-3.0
jaor/bigmler
bigmler/anomaly/dispatcher.py
1
10221
# -*- coding: utf-8 -*- # # Copyright 2014-2020 BigML # # 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
sirex/Misago
misago/threads/views/labelsadmin.py
8
1455
from django.contrib import messages from django.utils.translation import ugettext_lazy as _ from misago.admin.views import generic from misago.core import cachebuster from misago.threads.models import Label from misago.threads.forms.admin import LabelForm class LabelsAdmin(generic.AdminBaseMixin): root_link = '...
gpl-2.0
servo/servo
tests/wpt/web-platform-tests/tools/third_party/h2/examples/asyncio/asyncio-server.py
14
7261
# -*- coding: utf-8 -*- """ asyncio-server.py ~~~~~~~~~~~~~~~~~ A fully-functional HTTP/2 server using asyncio. Requires Python 3.5+. This example demonstrates handling requests with bodies, as well as handling those without. In particular, it demonstrates the fact that DataReceived may be called multiple times, and ...
mpl-2.0
twz915/django
tests/postgres_tests/test_indexes.py
5
4692
from django.contrib.postgres.indexes import BrinIndex, GinIndex from django.db import connection from django.test import skipUnlessDBFeature from . import PostgreSQLTestCase from .models import CharFieldModel, IntegerArrayModel @skipUnlessDBFeature('has_brin_index_support') class BrinIndexTests(PostgreSQLTestCase): ...
bsd-3-clause
Weuxel/cjdns
node_build/dependencies/libuv/build/gyp/test/mac/gyptest-strip.py
83
1991
#!/usr/bin/env python # Copyright (c) 2012 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """ Verifies that stripping works. """ import TestGyp import TestMac import re import subprocess import sys import time if sys.platform =...
gpl-3.0
LordDamionDevil/Lony
lib/discord/ext/commands/errors.py
18
4513
# -*- coding: utf-8 -*- """ The MIT License (MIT) Copyright (c) 2015-2016 Rapptz Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to us...
gpl-3.0
KohlsTechnology/ansible
test/sanity/code-smell/use-compat-six.py
68
1803
#!/usr/bin/env python import os import re import sys def main(): skip = set([ 'test/sanity/code-smell/%s' % os.path.basename(__file__), # digital_ocean is checking for six because dopy doesn't specify the # requirement on six so it needs to try importing six to give the correct error mess...
gpl-3.0
susilehtola/psi4
tests/pytests/test_zeta.py
7
12752
import pytest from .utils import * import psi4 import numpy as np pytestmark = pytest.mark.skip ref = { "conv": { "ene": { "d": -100.01941126909895, "t": -100.05801143109962, "q": -100.06768524807164, "5": -100.0704303543983, "6": -100.07073832...
lgpl-3.0
katsko/pybbm
pybb/south_migrations/0015_autosubscribe.py
11
10047
# encoding: utf-8 import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models from pybb.compat import get_image_field_full_name, get_user_model_path, get_user_frozen_models AUTH_USER = get_user_model_path() class Migration(SchemaMigration): def forwards(self, orm):...
bsd-2-clause
Aplopio/document-converter
converters/utilities.py
1
4138
import sys import re import os import shutil import logging as log sys.path.append('..') from config import OUTPUT_FOLDER, UPLOAD_FOLDER PARENT_DIR = os.path.dirname(os.path.dirname(os.path.realpath(__file__))) TMP_DIR = os.path.join(PARENT_DIR, UPLOAD_FOLDER) from html_pdf import HtmlPdf from html_txt import HtmlTx...
mit
codilime/veles
python/veles/scli/client.py
1
13837
# Copyright 2017 CodiLime # # 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, softwar...
apache-2.0
mikel-egana-aranguren/SADI-Galaxy-Docker
galaxy-dist/tools/data_source/ucsc_proxy.py
2
1610
#!/usr/bin/env python import urllib import sys, os assert sys.version_info[:2] >= ( 2, 4 ) CHUNK = 2**20 # 1Mb MAXSIZE = CHUNK * 100 if __name__ == '__main__': if len(sys.argv) != 3: print 'Usage ucsc.py input_params output_file' sys.exit() inp_file = sys.argv[1] out_file = sys.argv[2...
gpl-3.0
liamgh/liamgreenhughes-sl4a-tf101
python/gdata/tests/coverage.py
128
21809
#!/usr/bin/env python # # Perforce Defect Tracking Integration Project # <http://www.ravenbrook.com/project/p4dti/> # # COVERAGE.PY -- COVERAGE TESTING # # Gareth Rees, Ravenbrook Limited, 2001-12-04 # # # 1. INTRODUCTION # # This module provides coverage testing f...
apache-2.0
alesnav/p2ptv-pi
acestream/ACEStream/Core/Utilities/timeouturlopen.py
4
3362
#Embedded file name: ACEStream\Core\Utilities\timeouturlopen.pyo import sys import httplib import socket import urllib2 import urllib import urlparse from gzip import GzipFile from StringIO import StringIO from ACEStream.version import VERSION USER_AGENT = 'ACEStream/' + VERSION DEBUG = False def urlOpenTimeout(url, t...
mit