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
javazquez/vertx-web
src/test/sockjs-protocol/venv/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/tarfile.py
1005
92627
#------------------------------------------------------------------- # tarfile.py #------------------------------------------------------------------- # Copyright (C) 2002 Lars Gustaebel <lars@gustaebel.de> # All rights reserved. # # Permission is hereby granted, free of charge, to any person # obtaining a copy ...
apache-2.0
RonEld/mbed
tools/export/makefile/__init__.py
4
7853
""" mbed SDK Copyright (c) 2011-2016 ARM Limited 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 wr...
apache-2.0
marknca/cling
dependencies/boto3/dynamodb/transform.py
8
12264
# Copyright 2015 Amazon.com, Inc. or its affiliates. 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. A copy of # the License is located at # # http://aws.amazon.com/apache2.0/ # # or in the "license" file accompa...
apache-2.0
jpkrohling/jaeger
plugin/storage/es/esRollover.py
2
11705
#!/usr/bin/env python3 import ast import curator import elasticsearch import logging import os import requests import ssl import subprocess import sys import re from requests.auth import HTTPBasicAuth ARCHIVE_INDEX = 'jaeger-span-archive' ROLLBACK_CONDITIONS = '{"max_age": "2d"}' UNIT = 'days' UNIT_COUNT = 2 SHARDS =...
apache-2.0
Akrog/cinder
cinder/manager.py
1
4996
# Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # 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 ...
apache-2.0
vrenaville/partner-contact
base_location_geonames_import/wizard/geonames_import.py
21
5910
# -*- encoding: utf-8 -*- ############################################################################## # # Base Location Geonames Import module for OpenERP # Copyright (C) 2014 Akretion (http://www.akretion.com) # @author Alexis de Lattre <alexis.delattre@akretion.com> # Copyright (C) 2014 Agile Business ...
agpl-3.0
stackforge/python-tackerclient
tackerclient/tacker/v1_0/nfvo/nsd.py
2
3324
# 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 t...
apache-2.0
veger/ansible
lib/ansible/utils/module_docs_fragments/shell_common.py
79
1833
# Copyright (c) 2017 Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) class ModuleDocFragment(object): # common shelldocumentation fragment DOCUMENTATION = """ options: remote_tmp: description: - Temporary directory to use on targets whe...
gpl-3.0
ionelmc/python-cogen
examples/cogen-chat/ChatApp/chatapp/config/environment.py
4
1470
"""Pylons environment configuration""" import os from mako.lookup import TemplateLookup from pylons import config import chatapp.lib.app_globals as app_globals import chatapp.lib.helpers from chatapp.config.routing import make_map def load_environment(global_conf, app_conf): """Configure the Pylons envi...
mit
debugtalk/ApiTestEngine
httprunner/testcase.py
1
13449
import inspect from typing import Text, Any, Union, Callable from httprunner.models import ( TConfig, TStep, TRequest, MethodEnum, TestCase, ) class Config(object): def __init__(self, name: Text): self.__name = name self.__variables = {} self.__base_url = "" se...
mit
vv1133/home_web
tests/model_fields/test_imagefield.py
54
16032
from __future__ import absolute_import import os import shutil from django.core.exceptions import ImproperlyConfigured from django.core.files import File from django.core.files.images import ImageFile from django.test import TestCase from django.utils._os import upath from django.utils.unittest import skipIf try: ...
bsd-3-clause
drnextgis/QGIS
python/plugins/processing/algs/qgis/SaveSelectedFeatures.py
5
2493
# -*- coding: utf-8 -*- """ *************************************************************************** SaveSelectedFeatures.py --------------------- Date : August 2012 Copyright : (C) 2012 by Victor Olaya Email : volayaf at gmail dot com ******************...
gpl-2.0
elbeardmorez/quodlibet
quodlibet/quodlibet/player/__init__.py
1
1901
# -*- coding: utf-8 -*- # Copyright 2007 Joe Wreschnig # 2013 Christoph Reiter # # 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
AlexOugh/horizon
openstack_dashboard/dashboards/settings/password/forms.py
63
3043
# Copyright 2013 Centrin Data Systems Ltd. # # 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...
apache-2.0
EndPointCorp/interactivespaces-python-api
scripts/ispaces-relaunch.py
1
29285
#!/usr/bin/env python # -*- coding: utf-8 -*- import os import sys sys.path.append("../") sys.path.append("/home/galadmin/src/interactivespaces-python-api/") import time import json import pprint import urllib2 import argparse import requests import commands import eventlet import subprocess import ConfigParser from i...
apache-2.0
GoogleCloudPlatform/python-compat-runtime
appengine-vmruntime/vmruntime/tests/wsgi_config_test.py
1
2403
# Copyright 2015 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 by applicable law or a...
apache-2.0
redaktor/pHash
bindings/python/test/add_mvptree_dct.py
3
3616
#!/usr/bin/python -OO # -*- coding: iso-8859-15 -*- # # # pHash, the open source perceptual hash library # Copyright (C) 2009 Aetilius, Inc. # All rights reserved. # # 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-3.0
dsuch/sec-wall
code/tests/test_core.py
1
7669
# -*- coding: utf-8 -*- """ Copyright (C) 2010 Dariusz Suchojad <dsuch at gefira.pl> Licensed under LGPLv3, see LICENSE.txt for terms and conditions. """ from __future__ import absolute_import, division, print_function, unicode_literals # stdlib import re from datetime import datetime, timedelta from logging import...
gpl-3.0
PW-Sat2/PWSat2OBC
integration_tests/experiment_file/payload.py
1
2312
from parsec import count, joint from base import pid, label_as, field, to_dict from parsing import byte, uint16 from parsec import Parser, Value from emulator.beacon_parser import eps_controller_a_telemetry_parser, eps_controller_b_telemetry_parser, \ error_counting_telemetry, experiment_telemetry_parser, ...
agpl-3.0
conwayje/ase-python
ase/units.py
5
1828
from math import pi, sqrt # Constants from Konrad Hinsen's PhysicalQuantities module (1986 CODATA): _c = 299792458. # speed of light, m/s _mu0 = 4.e-7 * pi # permeability of vacuum _eps0 = 1 / _mu0 / _c**2 # permittivity of vacuum _Grav = 6.67259e-11 # gravitational constant _hplan...
gpl-2.0
gunan/tensorflow
tensorflow/python/util/keyword_args.py
190
1657
# 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
glwu/python-for-android
python-modules/twisted/twisted/conch/test/test_transport.py
49
73648
# Copyright (c) 2001-2010 Twisted Matrix Laboratories. # See LICENSE for details. """ Tests for ssh/transport.py and the classes therein. """ try: import pyasn1 except ImportError: pyasn1 = None try: import Crypto.Cipher.DES3 except ImportError: Crypto = None if pyasn1 is not None and Crypto is not ...
apache-2.0
ThreeSixtyGiving/prototype-tools
scripts/genmodel.py
1
7875
import rdflib from rdflib import URIRef, Literal from rdflib import RDFS, OWL, XSD import operator # Used in sorting from sets import Set # Defaults defaultLanguage = 'en' # Set up the graph g=rdflib.Graph() OPDS = rdflib.Namespace('http://joinedupdata.org/ontologies/philanthropy/') g.namespace_manager.bind('opds',...
mit
360youlun/django-cms
cms/migrations/0016_author_copy.py
525
20033
# -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models try: from django.contrib.auth import get_user_model except ImportError: # django < 1.5 from django.contrib.auth.models import User else: User = get_user_model() user_orm_label...
bsd-3-clause
apark263/tensorflow
tensorflow/python/kernel_tests/parsing_ops_test.py
11
62795
# Copyright 2015 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
EtienneCmb/brainpipe
brainpipe/io/read_json.py
1
2227
"""Load, save and update json files.""" import os import io import json from datetime import datetime def save_json(filename, config): """Save configuration file as JSON. Parameters ---------- filename : string Name of the configuration file to save. config : dict Dictionary of ar...
gpl-3.0
Kirill1243/-tg-station
tools/mapmerge/map_helpers.py
29
18534
import sys try: version = sys.version_info if version.major < 3 or (version.major == 3 and version.minor < 5): print("ERROR: You are running an incompatible version of Python. The current minimum version required is [3.5].\nYour version: {}".format(sys.version)) sys.exit() except: print("ER...
agpl-3.0
rizzatti/luigi
test/contrib/scalding_test.py
68
2092
# -*- 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
pytroll/satpy
satpy/readers/maia.py
1
5259
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright (c) 2017 Satpy developers # # This file is part of satpy. # # satpy 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...
gpl-3.0
karthik-suresh/horizon
openstack_dashboard/test/tests/templates.py
79
3317
# Copyright (c) 2012 OpenStack Foundation # 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 ...
apache-2.0
mozilla/fjord
vendor/packages/urllib3/urllib3/poolmanager.py
550
8977
# urllib3/poolmanager.py # Copyright 2008-2014 Andrey Petrov and contributors (see CONTRIBUTORS.txt) # # This module is part of urllib3 and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php import logging try: # Python 3 from urllib.parse import urljoin except ImportError: ...
bsd-3-clause
heke123/chromium-crosswalk
tools/android/loading/request_track.py
3
29765
# Copyright (c) 2016 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. """The request data track. When executed, parses a JSON dump of DevTools messages. """ import bisect import collections import copy import datetime imp...
bsd-3-clause
munnerz/CouchPotatoServer
couchpotato/core/notifications/nmj.py
75
4379
import re import telnetlib from couchpotato.api import addApiView from couchpotato.core.event import addEvent from couchpotato.core.helpers.encoding import tryUrlencode from couchpotato.core.logger import CPLog from couchpotato.core.notifications.base import Notification try: import xml.etree.cElementTree as etr...
gpl-3.0
luiseduardohdbackup/odoo
addons/hr/res_config.py
377
3452
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Business Applications # Copyright (C) 2004-2012 OpenERP S.A. (<http://openerp.com>). # # This program is free software: you can redistribute it and/or modify # it under the terms o...
agpl-3.0
cschenck/blender_sim
fluid_sim_deps/blender-2.69/2.69/scripts/freestyle/style_modules/Functions0D.py
1
3995
# ##### BEGIN GPL LICENSE BLOCK ##### # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either version 2 # of the License, or (at your option) any later version. # # This program is distrib...
gpl-3.0
ademmers/ansible
test/support/network-integration/collections/ansible_collections/ansible/netcommon/plugins/module_utils/network/netconf/netconf.py
47
4042
# # (c) 2018 Red Hat, 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 ...
gpl-3.0
amondot/QGIS
python/plugins/processing/algs/lidar/lastools/lastilePro.py
9
3739
# -*- coding: utf-8 -*- """ *************************************************************************** lastilePro.py --------------------- Date : April 2014 Copyright : (C) 2014 by Martin Isenburg Email : martin near rapidlasso point com ******************...
gpl-2.0
jkleckner/ansible
lib/ansible/inventory/__init__.py
1
15950
# (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
longmen21/edx-platform
common/djangoapps/terrain/stubs/tests/test_xqueue_stub.py
81
6098
""" Unit tests for stub XQueue implementation. """ import mock import unittest import json import requests from ..xqueue import StubXQueueService class FakeTimer(object): """ Fake timer implementation that executes immediately. """ def __init__(self, delay, func): self.func = func def st...
agpl-3.0
Rover-Yu/ali_kernel
tools/perf/scripts/python/syscall-counts-by-pid.py
34
1923
# system call counts, by pid # (c) 2010, Tom Zanussi <tzanussi@gmail.com> # Licensed under the terms of the GNU GPL License version 2 # # Displays system-wide system call totals, broken down by syscall. # If a [comm] arg is specified, only syscalls called by [comm] are displayed. import os, sys sys.path.append(os.env...
gpl-2.0
SBTMLab/CyworldClubPictureCrawler
cyworldpicture.py
1
1268
#-*- coding: utf-8 -*- import requests import json club_id = ##Set Club ID mainurl = "http://club.cyworld.com/club/board/PhotoViewer/index.asp?club_id=%d"%club_id header = { "Content-Type" :"application/x-www-form-urlencoded; charset=utf-8", "charset" : "utf=8", "Referer" : "http://club.cyworld.com/club/board/Ph...
mit
mancoast/CPythonPyc_test
crash/270_test_mhlib.py
3
11147
""" Tests for the mhlib module Nick Mathewson """ ### BUG: This suite doesn't currently test the mime functionality of ### mhlib. It should. import unittest from test.test_support import run_unittest, TESTFN, import_module import os, StringIO import sys mhlib = import_module('mhlib', deprecated=True) if ...
gpl-3.0
quheng/scikit-learn
sklearn/neighbors/base.py
71
31147
"""Base and mixin classes for nearest neighbors""" # Authors: Jake Vanderplas <vanderplas@astro.washington.edu> # Fabian Pedregosa <fabian.pedregosa@inria.fr> # Alexandre Gramfort <alexandre.gramfort@inria.fr> # Sparseness support by Lars Buitinck <L.J.Buitinck@uva.nl> # Multi-output...
bsd-3-clause
Gateworks/platform-external-chromium_org
tools/telemetry/telemetry/page/actions/play.py
24
1937
# 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. """A Telemetry page_action that performs the "play" action on media elements. Media elements can be specified by a selector attribute. If no selector is...
bsd-3-clause
sernst/cauldron
cauldron/cli/commands/listing/__init__.py
1
1967
import typing from argparse import ArgumentParser from cauldron import cli from cauldron import environ from cauldron.cli.commands.listing import _lister from cauldron.cli.commands.listing import _remover from cauldron.cli.commands.listing import discovery from cauldron.cli.interaction import autocompletion NAME = 'l...
mit
Manojkumar91/odoo_inresto
addons/account/report/account_invoice_report.py
7
12408
# -*- 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
carlgao/lenga
images/lenny64-peon/usr/share/python-support/python-django/django/contrib/auth/management/commands/changepassword.py
320
1527
from django.core.management.base import BaseCommand, CommandError from django.contrib.auth.models import User import getpass class Command(BaseCommand): help = "Change a user's password for django.contrib.auth." requires_model_validation = False def _get_pass(self, prompt="Password: "): p = getpa...
mit
mariansoban/ardupilot
libraries/AP_HAL_ChibiOS/hwdef/scripts/STM32F767xx.py
2
31744
#!/usr/bin/env python ''' these tables are generated from the STM32 datasheet DM00273119.pdf for the STM32F765xx, STM32F767xx, STM32F768aX and STM32F769xx ''' # additional build information for ChibiOS build = { "CHIBIOS_STARTUP_MK" : "os/common/startup/ARMCMx/compilers/GCC/mk/startup_stm32f7xx.mk", "CHIBIOS_...
gpl-3.0
40223246/2015cd_midterm2
static/Brython3.1.1-20150328-091302/Lib/unittest/test/test_suite.py
791
12066
import unittest import sys from .support import LoggingResult, TestEquality ### Support code for Test_TestSuite ################################################################ class Test(object): class Foo(unittest.TestCase): def test_1(self): pass def test_2(self): pass def test_3(self...
agpl-3.0
sharkykh/SickRage
lib/urllib3/packages/backports/makefile.py
339
1461
# -*- coding: utf-8 -*- """ backports.makefile ~~~~~~~~~~~~~~~~~~ Backports the Python 3 ``socket.makefile`` method for use with anything that wants to create a "fake" socket object. """ import io from socket import SocketIO def backport_makefile(self, mode="r", buffering=None, encoding=None, ...
gpl-3.0
julian-seward1/servo
tests/wpt/web-platform-tests/css/tools/w3ctestlib/Sources.py
37
57487
#!/usr/bin/python # CSS Test Source Manipulation Library # Initial code by fantasai, joint copyright 2010 W3C and Microsoft # Licensed under BSD 3-Clause: <http://www.w3.org/Consortium/Legal/2008/03-bsd-license> from os.path import basename, exists, join import os import filecmp import shutil import re import codecs i...
mpl-2.0
crosswalk-project/blink-crosswalk
Tools/Scripts/webkitpy/thirdparty/mod_pywebsocket/memorizingfile.py
680
3709
#!/usr/bin/env python # # Copyright 2011, Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list...
bsd-3-clause
atzengin/OCC
oc-utils/python/modtool/oc-newmod/docs/doxygen/doxyxml/generated/compound.py
344
20296
#!/usr/bin/env python """ Generated Mon Feb 9 19:08:05 2009 by generateDS.py. """ from string import lower as str_lower from xml.dom import minidom from xml.dom import Node import sys import compoundsuper as supermod from compoundsuper import MixedContainer class DoxygenTypeSub(supermod.DoxygenType): def __i...
gpl-3.0
dparks1134/RefineM
refinem/__init__.py
1
1495
############################################################################### # # # 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 ...
gpl-3.0
kittiu/odoo
addons/mail/tests/__init__.py
261
1173
# -*- 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
alajara/servo
tests/wpt/web-platform-tests/tools/py/py/_apipkg.py
210
5855
""" apipkg: control the exported namespace of a python package. see http://pypi.python.org/pypi/apipkg (c) holger krekel, 2009 - MIT license """ import os import sys from types import ModuleType __version__ = '1.3.dev' def _py_abspath(path): """ special version of abspath that will leave paths from jyth...
mpl-2.0
keto/askbot-devel
askbot/search/haystack/searchquery.py
9
2024
from askbot.models import Thread, User from haystack.query import SearchQuerySet class AskbotSearchQuerySet(SearchQuerySet): def _determine_backend(self): '''This is a hack somehow connection_router got wrong values from setting and did not loaded the LanguageRouter''' from haystack impor...
gpl-3.0
gannetson/django
django/contrib/admin/widgets.py
345
14769
""" Form Widget classes specific to the Django admin site. """ from __future__ import unicode_literals import copy from django import forms from django.contrib.admin.templatetags.admin_static import static from django.core.urlresolvers import reverse from django.db.models.deletion import CASCADE from django.forms.uti...
bsd-3-clause
hynnet/hiwifi-openwrt-HC5661-HC5761
staging_dir/host/lib64/scons-2.1.0/SCons/Tool/packaging/targz.py
21
1806
"""SCons.Tool.Packaging.targz The targz SRC packager. """ # # Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), ...
gpl-2.0
TeamTwisted/external_chromium_org
tools/site_compare/scrapers/chrome/chrome011010.py
189
1183
# Copyright (c) 2011 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. """Does scraping for versions of Chrome from 0.1.101.0 up.""" from drivers import windowing import chromebase # Default version version = "0.1.101.0" ...
bsd-3-clause
gdimitris/ChessPuzzlerBackend
Virtual_Environment/lib/python2.7/site-packages/pip/operations/freeze.py
284
3984
from __future__ import absolute_import import logging import re import pip from pip.compat import stdlib_pkgs from pip.req import InstallRequirement from pip.utils import get_installed_distributions from pip._vendor import pkg_resources logger = logging.getLogger(__name__) # packages to exclude from freeze output ...
mit
AdamStelmaszczyk/pyechonest
pyechonest/util.py
1
12016
#!/usr/bin/env python # encoding: utf-8 """ Copyright (c) 2010 The Echo Nest. All rights reserved. Created by Tyler Williams on 2010-04-25. Utility functions to support the Echo Nest web API interface. """ import urllib import urllib2 import httplib import config import logging import socket import re import time imp...
bsd-3-clause
schalkneethling/snippets-service
snippets/base/middleware.py
2
1348
from django.conf import settings from django.core.urlresolvers import Resolver404, resolve from snippets.base.views import fetch_json_snippets, fetch_snippets class FetchSnippetsMiddleware(object): """ If the incoming request is for the fetch_snippets view, execute the view and return it before other mid...
mpl-2.0
tboyce021/home-assistant
homeassistant/components/goalzero/config_flow.py
9
2661
"""Config flow for Goal Zero Yeti integration.""" import logging from goalzero import Yeti, exceptions import voluptuous as vol from homeassistant import config_entries from homeassistant.const import CONF_HOST, CONF_NAME from homeassistant.helpers.aiohttp_client import async_get_clientsession from .const import DEF...
apache-2.0
AutorestCI/azure-sdk-for-python
azure-mgmt-dns/setup.py
1
2805
#!/usr/bin/env python #------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. #----------------------------------------------------------------...
mit
daliwangi/bitcoin
test/functional/proxy_test.py
19
8415
#!/usr/bin/env python3 # Copyright (c) 2015-2016 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Test bitcoind with different proxy configuration. Test plan: - Start bitcoind's with different proxy c...
mit
swannapa/erpnext
erpnext/hr/doctype/expense_claim_type/expense_claim_type.py
41
1031
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals import frappe from frappe import _ from frappe.model.document import Document class ExpenseClaimType(Document): def validate(self): self.validate_ac...
gpl-3.0
pombredanne/commons
tests/python/twitter/common/http/test_building.py
13
3734
# ================================================================================================== # Copyright 2011 Twitter, Inc. # -------------------------------------------------------------------------------------------------- # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use thi...
apache-2.0
lyudmildrx/lymph
lymph/tests/test_mock_helpers.py
11
8021
import re import unittest import mock import lymph from lymph.testing import RPCServiceTestCase from lymph.testing.mock_helpers import MockMixins, RpcMockTestCase, EventMockTestCase class DummyTestCase(unittest.TestCase, MockMixins): def runTest(self): pass class RPCMockHelperTests(unittest.TestCase)...
apache-2.0
Borkata/android-tegra-nv-3.1.10-rel-15r7
tools/perf/scripts/python/failed-syscalls-by-pid.py
11180
2058
# failed system call counts, by pid # (c) 2010, Tom Zanussi <tzanussi@gmail.com> # Licensed under the terms of the GNU GPL License version 2 # # Displays system-wide failed system call totals, broken down by pid. # If a [comm] arg is specified, only syscalls called by [comm] are displayed. import os import sys sys.pa...
gpl-2.0
tellesnobrega/sahara
sahara/utils/openstack/swift.py
3
3632
# Copyright (c) 2014 Red Hat, 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 writ...
apache-2.0
ZhangXinNan/tensorflow
tensorflow/python/grappler/graph_placer_test.py
49
5594
# Copyright 2018 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
apache-2.0
Stanford-Online/edx-platform
common/lib/xmodule/xmodule/tests/xml/factories.py
14
5168
""" Factories for generating edXML for testing XModule import """ import inspect from tempfile import mkdtemp from fs.osfs import OSFS from factory import Factory, lazy_attribute, post_generation, Sequence from lxml import etree from xblock.mixins import HierarchyMixin from xmodule.modulestore.inheritance import Inh...
agpl-3.0
ampamo/smart-build
SmartBuild/SmartBuild/settings/_base.py
1
2793
""" Django settings for SmartBuild project. Generated by 'django-admin startproject' using Django 1.8. For more information on this file, see https://docs.djangoproject.com/en/1.8/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.8/ref/settings/ """ # Build pat...
cc0-1.0
souzainf3/namebench
nb_third_party/graphy/bar_chart.py
233
5769
#!/usr/bin/python2.4 # # Copyright 2008 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law o...
apache-2.0
endlessm/chromium-browser
third_party/catapult/dashboard/dashboard/pinpoint/models/compare/kolmogorov_smirnov_test.py
1
1146
# Copyright 2018 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. from __future__ import print_function from __future__ import division from __future__ import absolute_import import unittest from dashboard.pinpoint.models...
bsd-3-clause
sgnes/PracticeOfIntroductionToAlgorithms
sorting.py
1
2042
#!C:\Python27\python.exe # _*_ coding=utf-8 _*_ import random def main(): max_num = 1000 cur_num = 100 arr = random.sample(range(1,max_num),cur_num) print arr #insert_sort(arr, cur_num) print merge_sort(arr) #bubble_sort(arr) pass def insert_sort(arr, length): """This is the bas...
gpl-2.0
materialsproject/pymatgen
pymatgen/core/spectrum.py
1
7661
# coding: utf-8 # Copyright (c) Pymatgen Development Team. # Distributed under the terms of the MIT License. """ This module defines classes to represent any type of spectrum, essentially any x y value pairs. """ from typing import List, Union, Callable import numpy as np from monty.json import MSONable from scipy i...
mit
eklitzke/spitfire
spitfire/compiler/macros/i18n.py
1
2929
import sys import cStringIO as StringIO from spitfire.compiler import analyzer from spitfire.compiler.ast import * from spitfire.compiler.visitor import print_tree import spitfire.util # generate a reasonable substitute name from a raw placeholder node def make_placeholder_name(placeholder_node): node_type = typ...
bsd-3-clause
rotocoin/rotocoin
contrib/testgen/base58.py
2
2822
''' Rotocoin base58 encoding and decoding. Based on https://rotocointalk.org/index.php?topic=1026.0 (public domain) ''' import hashlib # for compatibility with following code... class SHA256: new = hashlib.sha256 if str != bytes: # Python 3.x def ord(c): return c def chr(n): return by...
mit
carltongibson/django-allauth
allauth/socialaccount/providers/twitter/south_migrations/0004_auto__del_twitteraccount__del_twitterapp.py
83
1925
# encoding: utf-8 from south.db import db from south.v2 import SchemaMigration class Migration(SchemaMigration): def forwards(self, orm): # Deleting model 'TwitterAccount' db.delete_table('twitter_twitteraccount') # Deleting model 'TwitterApp' db.delete_table('twitter_twi...
mit
suninsky/ReceiptOCR
Python/server/lib/python2.7/site-packages/pip/_vendor/html5lib/filters/inject_meta_charset.py
1730
2746
from __future__ import absolute_import, division, unicode_literals from . import _base class Filter(_base.Filter): def __init__(self, source, encoding): _base.Filter.__init__(self, source) self.encoding = encoding def __iter__(self): state = "pre_head" meta_found = (self.enco...
mit
Spoken-tutorial/spoken-website
cron/spoken_search/MySQLdb/MySQLdb/connections.py
1
11091
""" This module implements connections for MySQLdb. Presently there is only one class: Connection. Others are unlikely. However, you might want to make your own subclasses. In most cases, you will probably override Connection.default_cursor with a non-standard Cursor class. """ from MySQLdb import cursors from _mysql...
gpl-3.0
bukalov/phantomjs
src/qt/qtwebkit/Tools/Scripts/webkitpy/tool/commands/queues_unittest.py
115
26224
# Copyright (C) 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 of conditions and the f...
bsd-3-clause
mbauskar/omnitech-erpnext
erpnext/setup/page/setup_wizard/setup_wizard.py
1
17852
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals import frappe, json, copy from frappe.utils import cstr, flt, getdate from frappe import _ from frappe.utils.file_manager import save_file from frappe....
agpl-3.0
YUPlayGodDev/platform_kernel_cyanogen_msm8916
tools/perf/scripts/python/failed-syscalls-by-pid.py
11180
2058
# failed system call counts, by pid # (c) 2010, Tom Zanussi <tzanussi@gmail.com> # Licensed under the terms of the GNU GPL License version 2 # # Displays system-wide failed system call totals, broken down by pid. # If a [comm] arg is specified, only syscalls called by [comm] are displayed. import os import sys sys.pa...
gpl-2.0
leki75/ansible
lib/ansible/modules/network/nxos/nxos_nxapi.py
25
9768
#!/usr/bin/python # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Ansible is distribut...
gpl-3.0
sbusso/rethinkdb
drivers/python/rethinkdb/errors.py
8
4930
# Copyright 2010-2014 RethinkDB, all rights reserved. __all__ = ['RqlError', 'RqlClientError', 'RqlCompileError', 'RqlRuntimeError', 'RqlInternalError', 'RqlResourceError', 'RqlLogicError', 'RqlNonExistenceError', 'RqlOpError', ...
agpl-3.0
utecuy/edx-platform
cms/lib/xblock/test/test_authoring_mixin.py
105
6282
""" Tests for the Studio authoring XBlock mixin. """ from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase from xmodule.modulestore.tests.factories import CourseFactory, ItemFactory from xmodule.partitions.partitions import Group, UserPartition class AuthoringMixinTestCase(ModuleStoreTestCase): ...
agpl-3.0
utecuy/edx-platform
lms/djangoapps/notifier_api/tests.py
115
9872
import itertools import ddt from django.conf import settings from django.test.client import RequestFactory from django.test.utils import override_settings from openedx.core.djangoapps.course_groups.models import CourseUserGroup from django_comment_common.models import Role, Permission from lang_pref import LANGUAGE_K...
agpl-3.0
xsmart/opencvr
3rdparty/miniupnpc/pymoduletest.py
158
1377
#! /usr/bin/python # MiniUPnP project # Author : Thomas Bernard # This Sample code is public domain. # website : http://miniupnp.tuxfamily.org/ # import the python miniupnpc module import miniupnpc import sys # create the object u = miniupnpc.UPnP() print 'inital(default) values :' print ' discoverdelay', u.discoverd...
mit
ted-gould/nova
nova/tests/unit/volume/test_cinder.py
9
16912
# Copyright 2013 Mirantis, Inc. # Copyright 2013 OpenStack Foundation # # 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 # # Un...
apache-2.0
quarkslab/irma
frontend/extras/migration/versions/2cc69d5c53eb_db_revision_creation.py
3
8295
"""DB revision creation Revision ID: 2cc69d5c53eb Revises: Create Date: 2015-05-20 13:54:25.433439 """ # revision identifiers, used by Alembic. revision = '2cc69d5c53eb' down_revision = None branch_labels = None depends_on = None from alembic import op import sqlalchemy as sa def upgrade(): ### commands auto ...
apache-2.0
elennon/ndMVC
node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/xcode.py
1363
58344
# 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. import filecmp import gyp.common import gyp.xcodeproj_file import gyp.xcode_ninja import errno import os import sys import posixpath import re import shutil import...
mit
kasioumis/invenio
invenio/modules/formatter/api.py
6
13012
# -*- coding: utf-8 -*- # # This file is part of Invenio. # Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2015 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 th...
gpl-2.0
MichaelNedzelsky/intellij-community
python/lib/Lib/encodings/mac_centeuro.py
593
14358
""" Python Character Mapping Codec mac_centeuro generated from 'MAPPINGS/VENDORS/APPLE/CENTEURO.TXT' with gencodec.py. """#" import codecs ### Codec APIs class Codec(codecs.Codec): def encode(self,input,errors='strict'): return codecs.charmap_encode(input,errors,encoding_table) def decode(self,inp...
apache-2.0
zonk1024/moto
tests/test_swf/models/test_domain.py
3
4032
from collections import namedtuple from sure import expect from moto.swf.exceptions import SWFUnknownResourceFault from moto.swf.models import Domain # Fake WorkflowExecution for tests purposes WorkflowExecution = namedtuple( "WorkflowExecution", ["workflow_id", "run_id", "execution_status", "open"] ) def ...
apache-2.0
NewpTone/stacklab-nova
nova/tests/compute/test_compute.py
3
234769
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # Copyright 2011 Piston Cloud Computing, Inc. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); y...
apache-2.0
xzturn/tensorflow
tensorflow/python/distribute/parameter_server_strategy_test.py
3
33048
# Copyright 2018 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
apache-2.0
MITPERG/oilsands-mop
env/lib/python2.7/site-packages/pip/_vendor/requests/packages/chardet/charsetgroupprober.py
2929
3791
######################## 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 ...
mit