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
drewandersonnz/openshift-tools
openshift/installer/vendored/openshift-ansible-3.10.0-0.29.0/roles/openshift_health_checker/test/package_availability_test.py
26
1983
import pytest from openshift_checks.package_availability import PackageAvailability @pytest.mark.parametrize('pkg_mgr,openshift_is_containerized,is_active', [ ('yum', False, True), ('yum', True, False), ('dnf', True, False), ('dnf', False, False), ]) def test_is_active(pkg_mgr, openshift_is_container...
apache-2.0
nitin-cherian/LifeLongLearning
Python/PythonProgrammingLanguage/Encapsulation/encap_env/lib/python3.5/site-packages/dateutil/tz/win.py
32
11397
# This code was originally contributed by Jeffrey Harris. import datetime import struct from six.moves import winreg from six import text_type try: import ctypes from ctypes import wintypes except ValueError: # ValueError is raised on non-Windows systems for some horrible reason. raise ImportError("Ru...
mit
ceejatec/git-repo
subcmds/prune.py
90
1792
# # Copyright (C) 2008 The Android Open Source Project # # 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 la...
apache-2.0
StephenKing/summerschool-2015-ryu
ryu/tests/unit/packet/test_dhcp.py
11
10523
# Copyright (C) 2013 Nippon Telegraph and Telephone Corporation. # # 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 applicab...
apache-2.0
jeffzheng1/tensorflow
tensorflow/python/ops/data_flow_ops.py
4
58078
# 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
rcrowder/nupic
src/nupic/frameworks/opf/safe_interpreter.py
50
1453
# ---------------------------------------------------------------------- # Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2013, Numenta, Inc. Unless you have an agreement # with Numenta, Inc., for a separate license for this software code, the # following terms and conditions apply: # # This progra...
agpl-3.0
vim-IDE/python-mode
pymode/libs/astroid/node_classes.py
8
29797
# copyright 2003-2013 LOGILAB S.A. (Paris, FRANCE), all rights reserved. # contact http://www.logilab.fr/ -- mailto:contact@logilab.fr # # This file is part of astroid. # # astroid 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 #...
lgpl-3.0
andela-ooladayo/django
tests/check_framework/test_security.py
242
17428
from django.conf import settings from django.core.checks.security import base, csrf, sessions from django.test import SimpleTestCase from django.test.utils import override_settings class CheckSessionCookieSecureTest(SimpleTestCase): @property def func(self): from django.core.checks.security.sessions i...
bsd-3-clause
qateam123/eq
app/validation/date_range_check.py
1
1649
import logging from datetime import datetime from app.validation.abstract_validator import AbstractValidator from app.validation.validation_result import ValidationResult logger = logging.getLogger(__name__) class DateRangeCheck(AbstractValidator): def validate(self, user_answers): """ Validat...
mit
CyanogenMod/android_external_chromium_org
build/android/gyp/create_standalone_apk.py
126
1886
#!/usr/bin/env python # # Copyright 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. """Combines stripped libraries and incomplete APK into single standalone APK. """ import optparse import os import shutil import sy...
bsd-3-clause
ConnorGBrewster/servo
tests/wpt/web-platform-tests/xhr/resources/inspect-headers.py
5
1421
def get_response(raw_headers, filter_value, filter_name): result = "" for line in raw_headers.headers: if line[-2:] != '\r\n': return "Syntax error: missing CRLF: " + line line = line[:-2] if ':' not in line: return "Syntax error: no colon found: " + line ...
mpl-2.0
rob356/SickRage
lib/unidecode/x093.py
252
4666
data = ( 'Lun ', # 0x00 'Kua ', # 0x01 'Ling ', # 0x02 'Bei ', # 0x03 'Lu ', # 0x04 'Li ', # 0x05 'Qiang ', # 0x06 'Pou ', # 0x07 'Juan ', # 0x08 'Min ', # 0x09 'Zui ', # 0x0a 'Peng ', # 0x0b 'An ', # 0x0c 'Pi ', # 0x0d 'Xian ', # 0x0e 'Ya ', # 0x0f 'Zhui ', # 0x10 'Le...
gpl-3.0
1950195/mojito
docs/dev_guide/intro/conf.py
6
7244
# # Cocktails documentation build configuration file, created by # sphinx-quickstart on Wed Oct 12 18:07:15 2011. # # This file is execfile()d with the current directory set to its containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # # All configuration values...
bsd-3-clause
stonebig/numba
numba/core/controlflow.py
1
30419
import collections import functools import sys from numba.core import utils from numba.core.ir import Loc from numba.core.errors import UnsupportedError # List of bytecodes creating a new block in the control flow graph # (in addition to explicit jump labels). NEW_BLOCKERS = frozenset(['SETUP_LOOP', 'FOR_ITER', 'SETU...
bsd-2-clause
felixmatt/shyft
shyft/tests/api/test_time_axis.py
1
3311
from builtins import range from shyft import api import numpy as np import unittest class TimeAxis(unittest.TestCase): """Verify and illustrate TimeAxis defined as n periods non-overlapping ascending """ def setUp(self): self.c = api.Calendar() self.d = api.deltahours(1) ...
lgpl-3.0
code-google-com/rad2py
psp2py/controllers/projects.py
8
1263
# coding: utf8 # try something like def index(): return dict(form=crud.select(db.psp_project, linkto='show')) def search(): form, table=crud.search(db.psp_project, linkto='edit') return dict(form=form, table=table) def create(): return dict(form=crud.create(db.psp_project)) def show(): ...
gpl-3.0
perrygeo/Fiona
fiona/collection.py
1
17081
# -*- coding: utf-8 -*- # Collections provide file-like access to feature data import os import sys from fiona.ogrext import Iterator, ItemsIterator, KeysIterator from fiona.ogrext import Session, WritingSession from fiona.ogrext import ( calc_gdal_version_num, get_gdal_version_num, get_gdal_release_name) from fi...
bsd-3-clause
noroutine/ansible
test/units/template/test_templar.py
48
20034
# (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
CaiZhongda/psutil
psutil/_compat.py
4
9627
#!/usr/bin/env python # Copyright (c) 2009, Jay Loden, Giampaolo Rodola'. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Module which provides compatibility with older Python versions.""" __all__ = ["PY3", "int", "long", "xrange", "exec_"...
bsd-3-clause
DIRACGrid/DIRAC
src/DIRAC/Core/DISET/test/Test_AuthManager.py
2
11586
""" Basic unit tests for AuthManager """ from __future__ import absolute_import from __future__ import division from __future__ import print_function import unittest from diraccfg import CFG from DIRAC import gConfig from DIRAC.Core.DISET.AuthManager import AuthManager __RCSID__ = "$Id$" testSystemsCFG = """ System...
gpl-3.0
chaos33/httpie
httpie/context.py
48
2652
import sys from httpie.compat import is_windows from httpie.config import DEFAULT_CONFIG_DIR, Config class Environment(object): """ Information about the execution context (standard streams, config directory, etc). By default, it represents the actual environment. All of the attributes can be ov...
bsd-3-clause
Celthi/youtube-dl-GUI
youtube_dl/extractor/worldstarhiphop.py
31
1824
from __future__ import unicode_literals import re from .common import InfoExtractor class WorldStarHipHopIE(InfoExtractor): _VALID_URL = r'https?://(?:www|m)\.worldstar(?:candy|hiphop)\.com/videos/video\.php\?v=(?P<id>.*)' _TEST = { "url": "http://www.worldstarhiphop.com/videos/video.php?v=wshh6a7q1...
mit
willingc/cookiecutter
tests/test_output_folder.py
5
1969
# -*- coding: utf-8 -*- """ test_output_folder ------------------ Test formerly known from a unittest residing in test_generate.py named TestOutputFolder.test_output_folder """ from __future__ import unicode_literals import os import pytest from cookiecutter import generate from cookiecutter import utils from cooki...
bsd-3-clause
amenonsen/ansible
lib/ansible/modules/remote_management/ucs/ucs_vlans.py
64
6941
#!/usr/bin/python # -*- coding: utf-8 -*- # 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
Peekmo/three.js
utils/exporters/blender/addons/io_three/exporter/api/camera.py
125
1823
from bpy import data, types, context from .. import logger def _camera(func): """ :param func: """ def inner(name, *args, **kwargs): """ :param name: :param *args: :param **kwargs: """ if isinstance(name, types.Camera): camera = name ...
mit
lioncash/dolphin
Tools/IDA/LoadDolphinMap.py
45
1743
# Copyright 2018 Dolphin Emulator Project # Licensed under GPLv2+ # Refer to the license.txt file included. from collections import namedtuple DolphinSymbol = namedtuple("DolphinSymbol", [ "section", "addr", "size", "vaddr", "align", "name" ]) def load_dolphin_map(filepath): with open(filepath, "r") as f: ...
gpl-2.0
d0ugal/readthedocs.org
readthedocs/core/management/commands/archive.py
7
1045
from glob import glob import os import logging from optparse import make_option from django.conf import settings from django.core.management.base import BaseCommand from django.template import Context, loader as template_loader log = logging.getLogger(__name__) class Command(BaseCommand): """Custom management co...
mit
Djlavoy/scrapy
tests/test_selector_csstranslator.py
59
6026
""" Selector tests for cssselect backend """ from twisted.trial import unittest from scrapy.http import HtmlResponse from scrapy.selector.csstranslator import ScrapyHTMLTranslator from scrapy.selector import Selector from cssselect.parser import SelectorSyntaxError from cssselect.xpath import ExpressionError HTMLBODY...
bsd-3-clause
bkochendorfer/reviewboard
reviewboard/webapi/errors.py
5
4650
from __future__ import unicode_literals from djblets.webapi.errors import WebAPIError # # Standard error messages # UNSPECIFIED_DIFF_REVISION = WebAPIError( 200, 'Diff revision not specified.', http_status=400) # 400 Bad Request INVALID_DIFF_REVISION = WebAPIError( 201, 'Invalid diff revision.'...
mit
lociii/googleads-python-lib
examples/adspygoogle/dfp/v201308/line_item_service/get_all_line_items.py
2
1733
#!/usr/bin/python # # Copyright 2013 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
sathnaga/virt-test
tests/nfs_corrupt.py
6
8512
import logging, os, re from autotest.client.shared import error from autotest.client import utils, os_dep from virttest import utils_misc from virttest import env_process class NFSCorruptConfig(object): """ This class sets up nfs_corrupt test environment. """ def __init__(self, test, params): ...
gpl-2.0
Jens-G/thrift
contrib/fb303/py/fb303/FacebookBase.py
43
2038
#!/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
wfxiang08/django178
tests/admin_docs/models.py
32
1228
""" Models for testing various aspects of the djang.contrib.admindocs app """ from django.db import models class Company(models.Model): name = models.CharField(max_length=200) class Group(models.Model): name = models.CharField(max_length=200) class Family(models.Model): last_name = models.CharField(m...
bsd-3-clause
nitin-cherian/LifeLongLearning
Python/Experiments/JINJA/RealPython/jinja_env/lib/python3.5/site-packages/flask/logging.py
122
2751
# -*- coding: utf-8 -*- """ flask.logging ~~~~~~~~~~~~~ Implements the logging support for Flask. :copyright: (c) 2015 by Armin Ronacher. :license: BSD, see LICENSE for more details. """ from __future__ import absolute_import import sys from werkzeug.local import LocalProxy from logging import ...
mit
BrianCoveney/teammates
BackupFiles/upload_data.py
24
3131
#This script should be placed in the GAE Python SDK directory. #The path of the SDK will look like C:\Program Files (x86)\Google\google_appengine #The script is to be used in conjunction with the generated_bulkloader.yaml file #The script will upload all types of entities from the backup files to the GAE datastore. #T...
gpl-2.0
justintweaver/mtchi-cert-game
makahiki/apps/widgets/bonus_points/migrations/0004_auto__add_field_bonuspoint_claim_date__add_field_bonuspoint_create_dat.py
7
4911
# encoding: utf-8 import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding field 'BonusPoint.claim_date' db.add_column('bonus_points_bonuspoint', 'claim_date', self.gf('dja...
gpl-3.0
hschaa/openwrt
scripts/flashing/jungo-image.py
758
7069
#!/usr/bin/env python # # Copyright 2008, 2009 (C) Jose Vasconcellos <jvasco@verizon.net> # # A script that can communicate with jungo-based routers # (such as MI424-WR, USR8200 and WRV54G) to backup the installed # firmware and replace the boot loader. # # Tested with Python 2.5 on Linux and Windows # """Usage: %s [op...
gpl-2.0
394954369/horizon
openstack_dashboard/dashboards/project/data_processing/job_binaries/tables.py
4
2665
# 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...
apache-2.0
sommars/DynamicPrevariety
python_interface.py
1
2548
""" #Cyclic 4 R.<x1,x2,x3,x4> = QQ[] polys = [x1+x2+x3+x4,x1*x2+x2*x3+x3*x4+x4*x1,x1*x2*x3+x2*x3*x4+x3*x4*x1+x4*x1*x2] TropicalPrevariety(polys) #Should be equivalent (up to homogenization) to: R.ideal(polys).groebner_fan().tropical_intersection().rays() #Reduced cyclic 8 R.<y_1,y_2,y_3,y_4,y_5,y_6,y_7> = QQ[]...
gpl-3.0
zarnold/transitfeed
extensions/googletransit/pybcp47/testpybcp47.py
6
4427
#!/usr/bin/python2.5 # Copyright (C) 2011 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 la...
apache-2.0
cartertech/odoo-hr-ng
hr_report_manpower/report/daily_manpower.py
1
22435
#-*- coding:utf-8 -*- ############################################################################## # # Copyright (C) 2015 One Click Software (http://oneclick.solutions) # and Copyright (C) 2013 Michael Telahun Makonnen <mmakonnen@gmail.com>. # # This program is free software: you can redistribute it and/or m...
agpl-3.0
maohongyuan/kbengine
kbe/res/scripts/common/Lib/test/test_generators.py
72
50910
import gc import sys import unittest import weakref from test import support class FinalizationTest(unittest.TestCase): def test_frame_resurrect(self): # A generator frame can be resurrected by a generator's finalization. def gen(): nonlocal frame try: yie...
lgpl-3.0
mitocw/edx-platform
openedx/core/djangoapps/user_authn/views/tests/test_register.py
2
79864
# -*- coding: utf-8 -*- """Tests for account creation""" import json from unittest import skipIf, skipUnless from datetime import datetime import ddt import httpretty import mock import six from six.moves import range from django.conf import settings from django.contrib.auth.models import User from django.core impo...
agpl-3.0
sebdelsol/pyload
module/plugins/hoster/CzshareCom.py
1
5871
# -*- coding: utf-8 -*- # # Test links: # http://czshare.com/5278880/random.bin import re from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo from module.utils import parseFileSize class CzshareCom(SimpleHoster): __name__ = "CzshareCom" __type__ = "hoster" __version__ = "...
gpl-3.0
chaffra/sympy
sympy/tensor/indexed.py
5
21131
"""Module that defines indexed objects The classes ``IndexedBase``, ``Indexed``, and ``Idx`` represent a matrix element ``M[i, j]`` as in the following diagram:: 1) The Indexed class represents the entire indexed object. | ___|___ ' ' M[i, j] ...
bsd-3-clause
guerrerocarlos/odoo
addons/auth_openid/res_users.py
163
3778
############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2010-2012 OpenERP s.a. (<http://openerp.com>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General P...
agpl-3.0
manuelli/director
src/python/director/planplayback.py
1
7857
import os import vtkAll as vtk import math import time import re import numpy as np from director.timercallback import TimerCallback from director import objectmodel as om from director.simpletimer import SimpleTimer from director.utime import getUtime from director import robotstate import copy import pickle import ...
bsd-3-clause
Neil741/ryu-master
ryu/services/protocols/bgp/net_ctrl.py
8
14584
# Copyright (C) 2014 Nippon Telegraph and Telephone Corporation. # # 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
jrha/release
src/documentation_builder/lib/quattordocbuild/builder.py
2
5872
"""Build documentation from quattor sources.""" import os import sys import re import codecs from multiprocessing import Pool from vsc.utils import fancylogger from sourcehandler import get_source_files from rsthandler import generate_rst_from_repository from config import build_repository_map logger = fancylogger.ge...
apache-2.0
nelango/ViralityAnalysis
model/lib/pandas/tests/test_msgpack/test_except.py
15
1043
#!/usr/bin/env python # coding: utf-8 import unittest import nose import datetime from pandas.msgpack import packb, unpackb class DummyException(Exception): pass class TestExceptions(unittest.TestCase): def test_raise_on_find_unsupported_value(self): import datetime self.assertRaises(TypeEr...
mit
chandolia/python-social-auth
social/tests/backends/test_steam.py
80
5412
import json import datetime from httpretty import HTTPretty from social.p3 import urlencode from social.exceptions import AuthFailed from social.tests.backends.open_id import OpenIdTest INFO_URL = 'http://api.steampowered.com/ISteamUser/GetPlayerSummaries/v0002/?' JANRAIN_NONCE = datetime.datetime.now().strftime('...
bsd-3-clause
40223136/w11-2
static/Brython3.1.0-20150301-090019/Lib/site-packages/pygame/sprite.py
603
55779
## pygame - Python Game Library ## Copyright (C) 2000-2003, 2007 Pete Shinners ## (C) 2004 Joe Wreschnig ## 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; e...
gpl-3.0
s20121035/rk3288_android5.1_repo
external/chromium_org/tools/resources/find_used_resources.py
55
1754
#!/usr/bin/env 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 re import sys usage = """find_used_resources.py Prints out (to stdout) the sorted list of resource ids that are part of unkno...
gpl-3.0
bart-h/linux-kernel-wm8505
Documentation/networking/cxacru-cf.py
14668
1626
#!/usr/bin/env python # Copyright 2009 Simon Arlott # # This program is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by the Free # Software Foundation; either version 2 of the License, or (at your option) # any later version. # # This program i...
gpl-2.0
bsmelo/soletta
data/scripts/sol-flow-node-type-validate.py
9
10615
#!/usr/bin/env python3 # This file is part of the Soletta (TM) Project # # Copyright (C) 2015 Intel Corporation. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # ...
apache-2.0
chhao91/QGIS
python/ext-libs/pygments/lexers/_lassobuiltins.py
77
137633
# -*- coding: utf-8 -*- """ pygments.lexers._lassobuiltins ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Built-in Lasso types, traits, and methods. :copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ BUILTINS = { 'Types': [ 'null', '...
gpl-2.0
Tarsbot/pika
tests/unit/frame_tests.py
11
4424
""" Tests for pika.frame """ try: import unittest2 as unittest except ImportError: import unittest from pika import exceptions from pika import frame from pika import spec class FrameTests(unittest.TestCase): BASIC_ACK = (b'\x01\x00\x01\x00\x00\x00\r\x00<\x00P\x00\x00\x00\x00\x00\x00' ...
bsd-3-clause
thedrow/django
django/utils/timesince.py
409
2671
from __future__ import unicode_literals import calendar import datetime from django.utils.html import avoid_wrapping from django.utils.timezone import is_aware, utc from django.utils.translation import ugettext, ungettext_lazy TIMESINCE_CHUNKS = ( (60 * 60 * 24 * 365, ungettext_lazy('%d year', '%d years')), ...
bsd-3-clause
mszewczy/odoo
addons/website_customer/__openerp__.py
313
1571
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2013-Today OpenERP S.A. (<http://www.openerp.com>). # # This program is free software: you can redistribute it and/or modify # it under the term...
agpl-3.0
DedMemez/ODS-August-2017
battle/DistributedBattleBldg.py
1
8958
# Fuck you Disyer. Stealing my fucking paypal. GET FUCKED: toontown.battle.DistributedBattleBldg from panda3d.core import Lens, Point3, Vec3 from direct.actor import Actor from direct.directnotify import DirectNotifyGlobal from direct.fsm import State from direct.interval.IntervalGlobal import * import random fr...
apache-2.0
skirsdeda/django
django/core/mail/backends/filebased.py
35
2765
"""Email backend that writes messages to a file.""" import datetime import os from django.conf import settings from django.core.exceptions import ImproperlyConfigured from django.core.mail.backends.console import EmailBackend as ConsoleEmailBackend from django.utils import six class EmailBackend(ConsoleEmailBackend...
bsd-3-clause
Impavidity/SearchEngine
Data Cleaning/booleanQuery.py
1
3845
#!/usr/bin/python #import time import json import os import myTokenize from porter import PorterStemmer import utils def inverseList(termDict): """NOT 1 posting list--> return a list""" return { # 'term':'', 'docFreq':wholeLen - termDict['docFreq'], 'docIDs':[x for x in wholeList if x not in termDict['docIDs'...
mit
NexusIS/tempest
tempest/api/compute/security_groups/test_security_group_rules.py
1
8053
# Copyright 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 requ...
apache-2.0
khara914/cf-phpbuildpack
lib/yaml/composer.py
534
4921
__all__ = ['Composer', 'ComposerError'] from error import MarkedYAMLError from events import * from nodes import * class ComposerError(MarkedYAMLError): pass class Composer(object): def __init__(self): self.anchors = {} def check_node(self): # Drop the STREAM-START event. if se...
apache-2.0
Finntack/pootle
pootle/core/initdb.py
2
10505
# -*- coding: utf-8 -*- # # Copyright (C) Pootle contributors. # # This file is a part of the Pootle project. It is distributed under the GPL3 # or later license. See the LICENSE file for a copy of the license and the # AUTHORS file for copyright and authorship information. import logging from django.contrib.auth imp...
gpl-3.0
Arcanemagus/SickRage
lib/rtorrent/lib/bencode.py
43
9232
# Copyright (C) 2011 by clueless <clueless.nospam ! mail.com> # # 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, mo...
gpl-3.0
Cojacfar/Maker
comm/lib/python2.7/site-packages/django/core/management/sql.py
107
8922
from __future__ import unicode_literals import codecs import os import re from django.conf import settings from django.core.management.base import CommandError from django.db import models from django.db.models import get_models from django.utils._os import upath def sql_create(app, style, connection): "Returns...
gpl-2.0
voxmedia/thumbor
integration_tests/__init__.py
3
1877
import os.path from tornado.testing import AsyncHTTPTestCase from thumbor.app import ThumborServiceApp from thumbor.importer import Importer from thumbor.config import Config from thumbor.context import Context, ServerParameters from .urls_helpers import single_dataset # , combined_dataset from thumbor.utils import ...
mit
remb0/CouchPotatoServer
libs/argparse.py
490
87791
# Author: Steven J. Bethard <steven.bethard@gmail.com>. """Command-line parsing library This module is an optparse-inspired command-line parsing library that: - handles both optional and positional arguments - produces highly informative usage messages - supports parsers that dispatch to sub-parsers The...
gpl-3.0
paboldin/rally
rally/plugins/common/sla/iteraion_time.py
14
1664
# Copyright 2014: Mirantis 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
louietsai/python-for-android
python-build/python-libs/gdata/build/lib/gdata/analytics/__init__.py
261
6995
#!/usr/bin/python # # Original Copyright (C) 2006 Google Inc. # Refactored in 2009 to work for Google Analytics by Sal Uryasev at Juice 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 # ...
apache-2.0
perwin/imfit
distribution_manifest.py
1
6640
# Lists of files for use by make_distributions.py binary_only_files = """ imfit imfit-mcmc makeimage """ documentation_files = """ imfit_howto.pdf imfit_howto.tex """ misc_required_files = """ COPYING.txt DISCLAIMER README.txt CHANGELOG.md cdream/LICENSE_cdream.txt """ extras_files = """ imfit_completions.bash READ...
gpl-3.0
jjmleiro/hue
desktop/core/ext-py/boto-2.38.0/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...
apache-2.0
sahlinet/fastapp
fastapp/api_views.py
1
13365
# -*- coding: utf-8 -*- import zipfile import requests import json from threading import Thread from rest_framework.renderers import JSONRenderer, JSONPRenderer from rest_framework import permissions, viewsets, views from rest_framework import status from django.utils.decorators import method_decorator from django.vie...
mit
Neamar/django
django/core/serializers/pyyaml.py
439
2843
""" YAML serializer. Requires PyYaml (http://pyyaml.org/), but that's checked for in __init__. """ import collections import decimal import sys from io import StringIO import yaml from django.core.serializers.base import DeserializationError from django.core.serializers.python import ( Deserializer as PythonDes...
bsd-3-clause
alianmohammad/linux-kernel-4.2.6-hacks
tools/perf/scripts/python/syscall-counts.py
1996
1700
# system call counts # (c) 2010, Tom Zanussi <tzanussi@gmail.com> # Licensed under the terms of the GNU GPL License version 2 # # Displays system-wide system call totals, broken down by syscall. # If a [comm] arg is specified, only syscalls called by [comm] are displayed. import os import sys sys.path.append(os.envir...
gpl-2.0
Rajeshkumar90/ansible-modules-extras
commands/expect.py
11
7702
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2015, Matt Martz <matt@sivel.net> # # 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, ...
gpl-3.0
coldfix/udiskie
udiskie/notify.py
1
9790
""" Notification utility. """ import logging from gi.repository import GLib from .async_ import run_bg from .common import exc_message, DaemonBase, format_exc from .mount import DeviceActions from .locale import _ __all__ = ['Notify'] class Notify(DaemonBase): """ Notification tool. Can be connecte...
mit
guangtunbenzhu/BGT-Cosmology
Spectroscopy/nmf.py
2
4022
""" Code for Non-negative Matrix Factorization (NMF) Why class: taking advantage of encapsulation and inheritance in this case n_instance: Number of instances (input data points) n_dimention: Number of dimension of each instance To-do: - Sparese matrix """ from __future__ import division import scipy.linalg as ...
mit
deepmind/acme
acme/agents/tf/dmpo/agent.py
1
7916
# python3 # Copyright 2018 DeepMind Technologies Limited. 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 re...
apache-2.0
harshita-gupta/Harvard-FRSEM-Catalog-2016-17
flask/lib/python2.7/site-packages/pip/commands/list.py
168
7412
from __future__ import absolute_import import logging import warnings from pip.basecommand import Command from pip.exceptions import CommandError from pip.index import PackageFinder from pip.utils import ( get_installed_distributions, dist_is_editable) from pip.utils.deprecation import RemovedInPip10Warning from ...
mit
coufon/neon-distributed
tests/test_initializers.py
3
2974
# ---------------------------------------------------------------------------- # Copyright 2015 Nervana Systems 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.o...
apache-2.0
flother/agate
tests/test_type_tester.py
4
4667
#!/usr/bin/env python # -*- coding: utf8 -*- try: import unittest2 as unittest except ImportError: import unittest from agate.data_types import * from agate.type_tester import TypeTester class TestTypeTester(unittest.TestCase): def setUp(self): self.tester = TypeTester() def test_text_type(...
mit
tboyce021/home-assistant
homeassistant/components/wirelesstag/sensor.py
16
3592
"""Sensor support for Wireless Sensor Tags platform.""" import logging import voluptuous as vol from homeassistant.components.sensor import PLATFORM_SCHEMA from homeassistant.const import CONF_MONITORED_CONDITIONS from homeassistant.core import callback import homeassistant.helpers.config_validation as cv from homeas...
apache-2.0
krismcfarlin/gae_endpoints_aloha
endpoints_proto_datastore/ndb/utils.py
14
8427
# Copyright 2012 Google Inc. All Rights Reserved. """Utility module for converting NDB properties to ProtoRPC messages/fields. In the dictionary NDB_PROPERTY_TO_PROTO, each property defined by NDB is registered. The registry values can either be a ProtoRPC field for simple types/properties or a custom method for conv...
lgpl-3.0
dag/stutuz
stutuz/utils/tex.py
1
1947
#-*- coding:utf-8 -*- from __future__ import division from __future__ import absolute_import from __future__ import with_statement from __future__ import print_function from __future__ import unicode_literals import re class Tex(object): """Wraps a string of TeX such that wrapping it in :class:`~flask.Marku...
bsd-2-clause
druce/safewithdrawal_tensorflow
lifetable.py
1
8359
import numpy as np import pandas as pd from pandas import DataFrame ############################################################ # Life tables # https://www.ssa.gov/oact/STATS/table4c6.html ############################################################ ############################################################ # Male...
mit
dpiers/coderang-meteor
public/jsrepl/extern/python/unclosured/lib/python2.7/encodings/euc_jis_2004.py
816
1051
# # euc_jis_2004.py: Python Unicode Codec for EUC_JIS_2004 # # Written by Hye-Shik Chang <perky@FreeBSD.org> # import _codecs_jp, codecs import _multibytecodec as mbc codec = _codecs_jp.getcodec('euc_jis_2004') class Codec(codecs.Codec): encode = codec.encode decode = codec.decode class IncrementalEncoder(m...
mit
chelsea1620/google-belay
station/openid/store/filestore.py
153
13542
""" This module contains an C{L{OpenIDStore}} implementation backed by flat files. """ import string import os import os.path import time from errno import EEXIST, ENOENT try: from tempfile import mkstemp except ImportError: # Python < 2.3 import warnings warnings.filterwarnings("ignore", ...
apache-2.0
jwlin/web-crawler-tutorial
ch8/twse.py
1
1294
# source: https://github.com/yotsuba1022/web-crawler-practice/blob/master/ch4/tw_stock_exchange.py import requests import time TWSE_URL = 'http://www.twse.com.tw/exchangeReport/STOCK_DAY?response=json' def get_web_content(stock_id, current_date): resp = requests.get(TWSE_URL + '&date=' + current_date + '&stock...
mit
tomekwojcik/osxnotify-python-cffi
setup.py
1
2466
# -*- coding: utf-8 -*- # Copyright (c) 2015 Tomek Wójcik <tomek@bthlabs.pl> # # 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 # t...
mit
shi2wei3/virt-test
virttest/libvirt_xml/nwfilter_protocols/ipv6.py
26
5232
""" ipv6 protocl support class(es) http://libvirt.org/formatnwfilter.html#nwfelemsRulesProtoIPv6 """ from virttest.libvirt_xml import accessors, xcepts from virttest.libvirt_xml.nwfilter_protocols import base class Ipv6(base.TypedDeviceBase): """ Create new Ipv6 xml instances Properties: attrs: l...
gpl-2.0
GeraudBourdin/Ti.infrared_demo_app
plugins/ti.alloy/plugin.py
1729
5251
import os, sys, subprocess, hashlib import subprocess def check_output(*popenargs, **kwargs): r"""Run command with arguments and return its output as a byte string. Backported from Python 2.7 as it's implemented as pure python on stdlib. >>> check_output(['/usr/bin/python', '--version']) Python 2.6....
apache-2.0
minor-jason/notepad-plus-plus
scintilla/scripts/Face.py
56
3553
# Face.py - module for reading and parsing Scintilla.iface file # Implemented 2000 by Neil Hodgson neilh@scintilla.org # Released to the public domain. # Requires Python 2.5 or later def sanitiseLine(line): if line[-1:] == '\n': line = line[:-1] if line.find("##") != -1: line = line[:line.find("##")] lin...
gpl-2.0
rodrigc/buildbot
master/buildbot/test/unit/db_migrate/test_versions_043_add_changes_parent.py
6
3886
# This file is part of Buildbot. Buildbot is free software: you can # redistribute it and/or modify it under the terms of the GNU General Public # License as published by the Free Software Foundation, version 2. # # This program is distributed in the hope that it will be useful, but WITHOUT # ANY WARRANTY; without eve...
gpl-2.0
yd0str/infernal-twin
build/reportlab/src/reportlab/graphics/widgets/eventcal.py
34
13239
#see license.txt for license details #history http://www.reportlab.co.uk/cgi-bin/viewcvs.cgi/public/reportlab/trunk/reportlab/graphics/widgets/eventcal.py # Event Calendar widget # author: Andy Robinson __version__=''' $Id$ ''' __doc__="""This file is a """ from reportlab.lib import colors from reportlab.lib.validato...
gpl-3.0
hubert667/AIR
build/kombu/kombu/entity.py
4
26357
""" kombu.entity ================ Exchange and Queue declarations. """ from __future__ import absolute_import from .abstract import MaybeChannelBound from .exceptions import ContentDisallowed from .serialization import prepare_accept_content TRANSIENT_DELIVERY_MODE = 1 PERSISTENT_DELIVERY_MODE = 2 DELIVERY_MODES = ...
gpl-3.0
antsmc2/mics
survey/tests/forms/test_location_details_form.py
2
1673
from django.test import TestCase from survey.forms.location_details import LocationDetailsForm class LocationDetailsFormTest(TestCase): def test_should_know_the_fields(self): details_form = LocationDetailsForm() fields = ['required', 'has_code', 'length_of_code', 'levels'] [self.assertIn(...
bsd-3-clause
drvinceknight/Axelrod
docs/strategies.py
1
1047
""" A script to generate the file needed for the strategy documentation. Run: python strategies.py > strategies.rst """ import os import sys sys.path.insert(0, os.path.abspath("../")) from axelrod import basic_strategies from axelrod import ordinary_strategies from axelrod import cheating_strategies def print_...
mit
demon012/RedwoodMinecraftPack
Configs/idchecker.py
1
1404
#!/usr/bin/env python import re import os import pdb configs_dir = 'config' id_files = {} idre = re.compile(r'(?P<id>\d+)', re.I|re.DOTALL) # item_line_re = re.compile(r'I:(?P<itemname>.+?)=(?P<itemid>\d+)') # add hack for advancedmachine block for config\AdvancedMachines.cfg # add hack to search for config\EnderSt...
unlicense