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
johnkeepmoving/oss-ftp
python27/win32/Lib/platform.py
51
53554
#!/usr/bin/env python """ This module tries to retrieve as much platform-identifying data as possible. It makes this information available via function APIs. If called from the command line, it prints the platform information concatenated as single string to stdout. The output format is useable as par...
mit
yliu120/dbsystem
HW3/dbsys-hw3/update/dbsys-hw3/Utils/unparse.py
2
17247
"Usage: unparse.py <path to source file>" import sys import ast import io import os # Large float and imaginary literals get turned into infinities in the AST. # We unparse those infinities to INFSTR. INFSTR = "1e" + repr(sys.float_info.max_10_exp + 1) def interleave(inter, f, seq): """Call f on each item in seq...
apache-2.0
noahc3/PokemonGoTeamManager
libs/py/pogoapi/POGOProtos/Networking/Responses/SfidaActionLogResponse_pb2.py
15
4070
# Generated by the protocol buffer compiler. DO NOT EDIT! # source: POGOProtos/Networking/Responses/SfidaActionLogResponse.proto import sys _b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message f...
mit
krig/crmsh
crmsh/clidisplay.py
3
2262
# Copyright (C) 2008-2011 Dejan Muhamedagic <dmuhamedagic@suse.de> # See COPYING for license information. """ Display output for various syntax elements. """ from contextlib import contextmanager from . import config # Enable colors/upcasing _pretty = True def enable_pretty(): global _pretty _pretty = Tr...
gpl-2.0
jasminhalkic/bootstrap
test-infra/s3_cache.py
2166
5734
#!/usr/bin/env python2.7 # pylint: disable=C0301 from __future__ import absolute_import, unicode_literals, print_function, division from sys import argv from os import environ, stat, chdir, remove as _delete_file from os.path import dirname, basename, abspath, realpath, expandvars from hashlib import sha256 from subpr...
mit
tquilian/exelearningTest
twisted/internet/iocpreactor/util.py
20
1176
# Copyright (c) 2001-2004 Twisted Matrix Laboratories. # See LICENSE for details. from twisted.python import log class StateEventMachineType(type): def makeHandleGetter(klass, name): def helpful(self): # log.msg("looking up %s in state %s" % (name, self.state)) return getattr(self,...
gpl-2.0
simonwydooghe/ansible
lib/ansible/modules/network/layer2/_net_l2_interface.py
21
2264
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2017, Ansible by Red Hat, 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
niamoto/niamoto-core
niamoto/data_marts/dimensions/taxon_dimension.py
2
3597
# coding: utf-8 import sqlalchemy as sa from niamoto.data_marts.dimensions.base_dimension import BaseDimension from niamoto.data_publishers.taxon_data_publisher import TaxonDataPublisher from niamoto.db.metadata import TaxonRankEnum class TaxonDimension(BaseDimension): """ Extension of the base dimension re...
gpl-3.0
ZihengJiang/mxnet
example/rcnn/rcnn/dataset/pascal_voc_eval.py
25
6783
# 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 u...
apache-2.0
AthinaB/synnefo
snf-astakos-app/astakos/im/project_notif.py
6
5123
# Copyright (C) 2010-2014 GRNET S.A. # # 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 version. # # This program is distributed i...
gpl-3.0
vhaupert/mitmproxy
examples/contrib/tls_passthrough.py
7
4487
""" This inline script allows conditional TLS Interception based on a user-defined strategy. Example: > mitmdump -s tls_passthrough.py 1. curl --proxy http://localhost:8080 https://example.com --insecure // works - we'll also see the contents in mitmproxy 2. curl --proxy http://localhost:8080 https:...
mit
tedunderwood/horizon
chapter3/code/reproduce_fictional_prestige.py
1
7078
#!/usr/bin/env python3 # reproduce_fictional_prestige.py # Scripts to reproduce models # used in Chapter Three, # The Directions of Literary Change. import csv, os, sys, pickle, math # we add a path to be searched so that we can import # versatiletrainer, which will do most of the work # Versatiletrainer, and the m...
mit
dwalton76/ev3dev-lang-python
tests/motor/motor_motion_unittest.py
1
5822
#!/usr/bin/env python3 # Based on the parameterized test case technique described here: # # http://eli.thegreenplace.net/2011/08/02/python-unit-testing-parametrized-test-cases import unittest import time import ev3dev.ev3 as ev3 import parameterizedtestcase as ptc from motor_info import motor_info class TestMoto...
mit
xuxiao19910803/edx-platform
pavelib/utils/test/suites/nose_suite.py
15
6655
""" Classes used for defining and running nose test suites """ import os from paver.easy import call_task from pavelib.utils.test import utils as test_utils from pavelib.utils.test.suites.suite import TestSuite from pavelib.utils.envs import Env __test__ = False # do not collect class NoseTestSuite(TestSuite): ...
agpl-3.0
matthijsvk/multimodalSR
code/Experiments/neon-master/neon/backends/kernels/cuda/convolution.py
2
23694
from pycuda.tools import context_dependent_memoize from neon.backends.cuda_templates import _ew_types from neon.backends.layer_gpu import _magic64 from neon.backends.util.source_module import SourceModule """ CUDA kernels for convolutional layers. This code will return one of 3 kernels: fprop, bprop, or update. Data f...
mit
wheeler-microfluidics/flatland-fork
tests/_util.py
4
3711
"""Test suite helpers.""" import codecs from functools import wraps from inspect import stack import sys from nose.tools import eq_, assert_raises, raises __all__ = ['asciistr', 'assert_raises', 'eq_', 'raises', 'fails', 'requires_unicode_coercion', 'udict', 'unicode_coercion_available'] # acts like 'str...
mit
egafford/sahara
sahara/tests/unit/plugins/cdh/v5_3_0/test_validation.py
3
3799
# Copyright (c) 2015 Intel Corpration # # 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 w...
apache-2.0
defstryker/Hex-Omega
users/Xav/views.py
1
2547
from users.views import * from .add_leader_form import * from django.db.utils import IntegrityError def create_leader_user(request, username): form = LeaderForm() if request.method == 'POST': form = LeaderForm(request.POST) if form.is_valid(): username = request.POST.get('usernam...
mit
MobiusL/p2pool
p2pool/main.py
2
28558
from __future__ import division import base64 import json import os import random import sys import time import signal import traceback import urlparse if '--iocp' in sys.argv: from twisted.internet import iocpreactor iocpreactor.install() from twisted.internet import defer, reactor, protocol, task from twist...
gpl-3.0
tellesnobrega/horizon
horizon/templatetags/horizon.py
14
7047
# 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 License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agree...
apache-2.0
ptoraskar/scrapy
tests/test_utils_misc/__init__.py
151
2976
import sys import os import unittest from scrapy.item import Item, Field from scrapy.utils.misc import load_object, arg_to_iter, walk_modules __doctests__ = ['scrapy.utils.misc'] class UtilsMiscTestCase(unittest.TestCase): def test_load_object(self): obj = load_object('scrapy.utils.misc.load_object') ...
bsd-3-clause
jal-stats/django
jal_stats/jal_stats/urls.py
1
1604
"""jal_stats URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/1.8/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: url(r'^$', views.home, name='home') Class-b...
mit
Scriptkiddi/Ankipubsub-Client
pubsub/requests/packages/chardet/sbcharsetprober.py
2927
4793
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Universal charset detector code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 2001 # the Initial Developer. All R...
gpl-3.0
eemirtekin/edx-platform
common/lib/xmodule/xmodule/tests/test_textannotation.py
92
2829
# -*- coding: utf-8 -*- "Test for Annotation Xmodule functional logic." import unittest from mock import Mock from lxml import etree from xblock.field_data import DictFieldData from xblock.fields import ScopeIds from xmodule.textannotation_module import TextAnnotationModule from . import get_test_system class Tex...
agpl-3.0
Widiot/simpleblog
venv/lib/python3.5/site-packages/pip/wheel.py
338
32010
""" Support for installing and building the "wheel" binary package format. """ from __future__ import absolute_import import compileall import csv import errno import functools import hashlib import logging import os import os.path import re import shutil import stat import sys import tempfile import warnings from ba...
mit
forblackking/redis-py
tests/conftest.py
42
1200
import pytest import redis from distutils.version import StrictVersion _REDIS_VERSIONS = {} def get_version(**kwargs): params = {'host': 'localhost', 'port': 6379, 'db': 9} params.update(kwargs) key = '%s:%s' % (params['host'], params['port']) if key not in _REDIS_VERSIONS: client = redis.R...
mit
arbrandes/edx-platform
common/lib/xmodule/xmodule/course_module.py
3
63394
""" Django module container for classes and operations related to the "Course Module" content type """ import json import logging from datetime import datetime, timedelta from io import BytesIO import dateutil.parser import requests from django.conf import settings from django.core.validators import validate_email f...
agpl-3.0
silentfuzzle/calibre
src/calibre/gui2/tweak_book/editor/canvas.py
11
24926
#!/usr/bin/env python2 # vim:fileencoding=utf-8 from __future__ import (unicode_literals, division, absolute_import, print_function) __license__ = 'GPL v3' __copyright__ = '2013, Kovid Goyal <kovid at kovidgoyal.net>' import sys, weakref from functools import wraps from PyQt5.Qt import ( ...
gpl-3.0
3L3N4/Egress-Assess
common/orchestra.py
1
1550
''' This is the conductor which controls everything ''' import glob import imp from protocols.servers import * from protocols.clients import * from datatypes import * class Conductor: def __init__(self): # Create dictionaries of supported modules # empty until stuff loaded into them se...
gpl-3.0
cdecker/bitcoin
test/functional/feature_cltv.py
14
6586
#!/usr/bin/env python3 # Copyright (c) 2015-2020 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 BIP65 (CHECKLOCKTIMEVERIFY). Test that the CHECKLOCKTIMEVERIFY soft-fork activates at (regtest) b...
mit
zaccoz/odoo
addons/account/project/__init__.py
427
1100
# -*- 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...
agpl-3.0
ayumilong/rethinkdb
external/v8_3.30.33.16/tools/testrunner/server/work_handler.py
123
5569
# Copyright 2012 the V8 project authors. 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 conditi...
agpl-3.0
deanet/gheimdall
gheimdall/responsecreator/__init__.py
1
5051
#!/usr/bin/python # -*- coding: utf-8 -*- # # GHeimdall - A small web application for Google Apps SSO service. # Copyright (C) 2007 SIOS Technology, 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 S...
gpl-2.0
pospispa/kubernetes
cluster/juju/layers/kubeapi-load-balancer/reactive/load_balancer.py
174
8576
#!/usr/bin/env python # Copyright 2015 The Kubernetes Authors. # # 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
sunzuolei/youtube-dl
youtube_dl/extractor/dctp.py
124
2095
# encoding: utf-8 from __future__ import unicode_literals from .common import InfoExtractor from ..compat import compat_str class DctpTvIE(InfoExtractor): _VALID_URL = r'http://www.dctp.tv/(#/)?filme/(?P<id>.+?)/$' _TEST = { 'url': 'http://www.dctp.tv/filme/videoinstallation-fuer-eine-kaufhausfassade...
unlicense
smallyear/linuxLearn
salt/salt/utils/process.py
1
11798
# -*- coding: utf-8 -*- # Import python libs from __future__ import absolute_import import os import sys import time import types import signal import subprocess import logging import multiprocessing import threading # Import salt libs import salt.defaults.exitcodes import salt.utils # Import 3rd-party libs import ...
apache-2.0
copejon/kubernetes
cluster/juju/layers/kubernetes-e2e/reactive/kubernetes_e2e.py
70
7590
#!/usr/bin/env python # Copyright 2015 The Kubernetes Authors. # # 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
Vixionar/django
tests/flatpages_tests/test_templatetags.py
309
7111
from django.contrib.auth.models import AnonymousUser, User from django.contrib.flatpages.models import FlatPage from django.contrib.sites.models import Site from django.template import Context, Template, TemplateSyntaxError from django.test import TestCase, modify_settings, override_settings from .settings import FLAT...
bsd-3-clause
mohamed--abdel-maksoud/chromium.src
tools/binary_size/run_binary_size_analysis.py
9
26989
#!/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. """Generate a spatial analysis against an arbitrary library. To use, build the 'binary_size_tool' target. Then run this tool, passing ...
bsd-3-clause
sjbog/ajenti
plugins/pkgman/pm_yum.py
17
5149
import os import subprocess from ajenti.com import * from ajenti import utils from ajenti import apis class YumPackageManager(Plugin): implements(apis.pkgman.IPackageManager) platform = ['centos', 'fedora'] _pending = {} def refresh(self, st): p = self._parse_yum(utils.shell('yum -C -q -d0 ...
lgpl-3.0
weebygames/boto
tests/integration/s3/test_connect_to_region.py
52
3075
# -*- coding: utf-8 -*- # Copyright (c) 2014 Steven Richards <sbrichards@mit.edu> # All rights reserved. # # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # wi...
mit
firerszd/kbengine
kbe/res/scripts/common/Lib/token.py
106
3034
"""Token constants (from "token.h").""" __all__ = ['tok_name', 'ISTERMINAL', 'ISNONTERMINAL', 'ISEOF'] # This file is automatically generated; please don't muck it up! # # To update the symbols in this file, 'cd' to the top directory of # the python source tree after building the interpreter and run: # # ./pyth...
lgpl-3.0
YanjieGao/sparrow
deploy/third_party/boto-2.1.1/boto/emr/emrobject.py
15
4791
# Copyright (c) 2010 Spotify AB # Copyright (c) 2010 Jeremy Thurgood <firxen+boto@gmail.com> # Copyright (c) 2010-2011 Yelp # # 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 restricti...
apache-2.0
dsiddharth/access-keys
keystone/assignment/backends/sql.py
2
32146
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2012-13 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 # # U...
apache-2.0
dataxu/ansible
lib/ansible/modules/windows/win_tempfile.py
47
2164
#!/usr/bin/python # coding: utf-8 -*- # (c) 2017 Dag Wieers <dag@wieers.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 # ...
gpl-3.0
ManiacalLabs/BiblioPixelAnimations
BiblioPixelAnimations/matrix/pinwheel.py
2
1351
from bibliopixel.animation.matrix import Matrix class Pinwheel(Matrix): def __init__(self, layout, dir=True, **kwds): super().__init__(layout, **kwds) self._center = (self.width // 2, self.height // 2) self._dir = dir self._len = (self.width * 2) + (self.height * 2) - 2 def p...
mit
mskvortsov/coreclr
src/ToolBox/SOS/tests/t_cmd_histobjfind.py
43
1760
import lldb import re import testutils as test def runScenario(assembly, debugger, target): process = target.GetProcess() res = lldb.SBCommandReturnObject() ci = debugger.GetCommandInterpreter() # Run debugger, wait until libcoreclr is loaded, # set breakpoint at Test.Main and stop there test...
mit
alvarolopez/nova
nova/tests/unit/virt/test_block_device.py
11
36872
# 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...
apache-2.0
palaniyappanBala/androguard
androguard/core/binaries/idawrapper.py
45
5335
# This file is part of Androguard. # # Copyright (C) 2012, Anthony Desnos <desnos at t0t0.fr> # 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...
apache-2.0
ataylor32/django
django/db/backends/mysql/validation.py
368
1336
from django.core import checks from django.db.backends.base.validation import BaseDatabaseValidation class DatabaseValidation(BaseDatabaseValidation): def check_field(self, field, **kwargs): """ MySQL has the following field length restriction: No character (varchar) fields can have a leng...
bsd-3-clause
ego008/ijd8
bae/pygments/lexers/text.py
41
67382
# -*- coding: utf-8 -*- """ pygments.lexers.text ~~~~~~~~~~~~~~~~~~~~ Lexers for non-source code file types. :copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ import re from bisect import bisect from pygments.lexer import Lexer, LexerC...
mit
trondhindenes/ansible
lib/ansible/modules/cloud/amazon/elb_classic_lb_facts.py
8
7054
#!/usr/bin/python # # This is a 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. # # This Ansible library is distributed in the hope that i...
gpl-3.0
campbe13/openhatch
vendor/packages/Django/django/core/serializers/base.py
83
5612
""" Module for abstract serializer/unserializer base classes. """ from django.db import models from django.utils.encoding import smart_text from django.utils import six class SerializerDoesNotExist(KeyError): """The requested serializer was not found.""" pass class SerializationError(Exception): """Somet...
agpl-3.0
trondeau/volk
python/volk_modtool/cfg.py
4
3613
#!/usr/bin/env python # # Copyright 2013, 2014 Free Software Foundation, Inc. # # This file is part of GNU Radio # # GNU Radio 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, or (at your opti...
gpl-3.0
Peacecoindev/Peacecoin
contrib/bitrpc/bitrpc.py
224
7838
from jsonrpc import ServiceProxy import sys import string # ===== BEGIN USER SETTINGS ===== # if you do not set these you will be prompted for a password for every command rpcuser = "" rpcpass = "" # ====== END USER SETTINGS ====== if rpcpass == "": access = ServiceProxy("http://127.0.0.1:9332") else: access = Ser...
mit
Darkmoth/python-django-4
Thing/env/Lib/site-packages/django/contrib/messages/api.py
512
3202
from django.contrib.messages import constants from django.contrib.messages.storage import default_storage from django.http import HttpRequest __all__ = ( 'add_message', 'get_messages', 'get_level', 'set_level', 'debug', 'info', 'success', 'warning', 'error', 'MessageFailure', ) class MessageFailure(E...
gpl-2.0
grueni75/GeoDiscoverer
Source/Platform/Target/Android/core/src/main/jni/gdal-3.2.1/swig/python/scripts/gdal2tiles.py
1
134939
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # ****************************************************************************** # $Id: gdal2tiles.py d712a530aa1b0dabf9717dd935996dd7b9fd8ced 2020-11-15 15:12:13 +0100 Even Rouault $ # # Project: Google Summer of Code 2007, 2008 (http://code.google.com/soc/) # Support: ...
gpl-3.0
jonnyhtw/cylc
lib/cherrypy/test/test_logging.py
7
6053
"""Basic tests for the CherryPy core: request handling.""" import os localDir = os.path.dirname(__file__) import six import cherrypy from cherrypy._cpcompat import ntob, ntou access_log = os.path.join(localDir, "access.log") error_log = os.path.join(localDir, "error.log") # Some unicode strings. tartaros = ntou('\...
gpl-3.0
mespinozas/si
t3/t3loader.py
1
1118
import threading import logging import time import os logging.basicConfig( level=logging.DEBUG, format='[%(levelname)s] - %(threadName)-10s : %(message)s') def worker(x): logging.debug('Lanzado') importer = 'bin/mallet import-svmlight --input archivoEntrenamiento%s.txt --output training%s.mallet' % (x,x) ...
gpl-2.0
sethraymond/JukeBot
test/botrumz.bot.py
2
1629
#!/usr/bin/python3 import discord import asyncio import json from libs.gmusic import GpmSession with open("../secrets/botrumz.secret.json", "r") as secretsFile: secrets = json.load(secretsFile) client = discord.Client() @client.event async def on_ready(): print('Logged in as') print(client.user.name) ...
mit
brownian/frescobaldi
frescobaldi_app/gadgets/cursorkeys.py
3
6095
# This file is part of the Frescobaldi project, http://www.frescobaldi.org/ # # Copyright (c) 2016 - 2016 by Wilbert Berendsen # # 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 ...
gpl-2.0
paddycarey/stretch
tests/stretch/test_application.py
1
2711
# third-party imports import pytest # local imports from stretch import application from stretch.triggers import results from tests.utils import fixture_loader @pytest.fixture def configured_app(): app_json = fixture_loader.json_fixture("web-service-configured") return application.Application(app_json) @py...
mit
kinooo/Sick-Beard
lib/hachoir_core/error.py
90
1350
""" Functions to display an error (error, warning or information) message. """ from lib.hachoir_core.log import log from lib.hachoir_core.tools import makePrintable import sys, traceback def getBacktrace(empty="Empty backtrace."): """ Try to get backtrace as string. Returns "Error while trying to get back...
gpl-3.0
mlittig/transit-data-dashboard-master
utils/mergeUZAs.py
2
2271
# Find UZAs that should be merged import csv reader = csv.DictReader(open('Agency_UZAs.csv')) uzaAllocation = dict() allUzas = [] for row in reader: trsId = row['Trs_Id'].strip() uza = row['UZA_Name'].strip() if uza == 'Non-UZA': continue if not uzaAllocation.has_key(trsId): uzaAll...
lgpl-3.0
alvestrand/old-compare-codecs
lib/mpeg_settings.py
1
3650
#!/usr/bin/python # Copyright 2014 Google. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to...
apache-2.0
NewPresident1/kitsune
kitsune/twitter/__init__.py
19
2972
import logging from django import http from django.conf import settings from twython import Twython log = logging.getLogger('k') PREFIX = 'custcare_' REDIRECT_NAME = PREFIX + 'redirect' REQUEST_KEY_NAME = PREFIX + 'request_key' REQUEST_SECRET_NAME = PREFIX + 'request_secret' MAX_AGE = 3600 def url(request, over...
bsd-3-clause
shabab12/edx-platform
openedx/core/lib/api/tests/test_exceptions.py
14
2774
""" Test Custom Exceptions """ import ddt from django.test import TestCase from nose.plugins.attrib import attr from rest_framework import exceptions as drf_exceptions from .. import exceptions @attr('shard_2') @ddt.ddt class TestDictExceptionsAllowDictDetails(TestCase): """ Standard DRF exceptions coerce de...
agpl-3.0
thezawad/kivy
examples/widgets/lists/fruit_detail_view.py
56
4533
from kivy.uix.gridlayout import GridLayout from kivy.uix.label import Label from kivy.uix.boxlayout import BoxLayout from kivy.uix.image import Image from kivy.properties import StringProperty from fixtures import fruit_data_attributes from fixtures import fruit_data # Used in list_cascade.py example. # class FruitD...
mit
himanshuo/osf.io
website/addons/googledrive/__init__.py
9
1080
import os from website.addons.googledrive import routes, model, views MODELS = [ model.GoogleDriveUserSettings, model.GoogleDriveNodeSettings, model.GoogleDriveOAuthSettings, model.GoogleDriveGuidFile, ] USER_SETTINGS_MODEL = model.GoogleDriveUserSettings NODE_SETTINGS_MODEL = model.GoogleDriveNodeSe...
apache-2.0
chrisp22/xuggle-xuggler
captive/libvpx/csrc/third_party/googletest/src/test/gtest_output_test.py
1733
12005
#!/usr/bin/env python # # Copyright 2008, 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-3.0
fabioz/Pydev
plugins/org.python.pydev.jython/Lib/tempfile.py
13
18233
"""Temporary files. This module provides generic, low- and high-level interfaces for creating temporary files and directories. The interfaces listed as "safe" just below can be used without fear of race conditions. Those listed as "unsafe" cannot, and are provided for backward compatibility only. This module also pr...
epl-1.0
potsmaster/cinder
cinder/tests/unit/keymgr/test_key_mgr.py
43
1083
# Copyright (c) 2013 The Johns Hopkins University/Applied Physics Laboratory # 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/...
apache-2.0
salaria/odoo
addons/account/test/test_parent_structure.py
432
2108
# -*- 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...
agpl-3.0
dawnpower/nova
nova/api/openstack/compute/schemas/v3/block_device_mapping_v1.py
74
1792
# Copyright 2014 NEC Corporation. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required ...
apache-2.0
SebDieBln/QGIS
python/plugins/processing/gui/HistoryDialog.py
3
5658
# -*- coding: utf-8 -*- """ *************************************************************************** HistoryDialog.py --------------------- Date : August 2012 Copyright : (C) 2012 by Victor Olaya Email : volayaf at gmail dot com *************************...
gpl-2.0
teeple/pns_server
work/install/node-v0.10.25/tools/closure_linter/closure_linter/checker.py
13
2902
#!/usr/bin/env python # # Copyright 2007 The Closure Linter 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 #...
gpl-2.0
davidyezsetz/kuma
vendor/packages/Werkzeug/werkzeug/contrib/limiter.py
6
1737
# -*- coding: utf-8 -*- """ werkzeug.contrib.limiter ~~~~~~~~~~~~~~~~~~~~~~~~ A middleware that limits incoming data. This works around problems with Trac_ or Django_ because those directly stream into the memory. .. _Trac: http://trac.edgewall.org/ .. _Django: http://www.djangoproject.com/ ...
mpl-2.0
alexanderturner/ansible
lib/ansible/modules/utilities/logic/async_wrapper.py
89
10775
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2012, Michael DeHaan <michael.dehaan@gmail.com>, and others # # 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 ...
gpl-3.0
phoenixsbk/kvmmgr
packaging/services/ovirt-engine-notifier/ovirt-engine-notifier.py
3
7200
#!/usr/bin/python # Copyright 2012 Red Hat # # 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 i...
apache-2.0
repotvsupertuga/repo
plugin.video.SportsDevil/service/oscrypto/_win/_crypt32_ctypes.py
7
8211
# coding: utf-8 from __future__ import unicode_literals, division, absolute_import, print_function import sys import ctypes from ctypes import windll, wintypes, POINTER, Structure, c_void_p, c_char_p from ctypes.wintypes import DWORD from .._ffi import FFIEngineError from .._types import str_cls from ..errors import...
gpl-2.0
nguyentu1602/statsmodels
statsmodels/graphics/factorplots.py
28
7596
# -*- coding: utf-8 -*- """ Authors: Josef Perktold, Skipper Seabold, Denis A. Engemann """ from statsmodels.compat.python import get_function_name, iterkeys, lrange, zip, iteritems import numpy as np from statsmodels.graphics.plottools import rainbow import statsmodels.graphics.utils as utils def interaction_plo...
bsd-3-clause
infobloxopen/infoblox-netmri
infoblox_netmri/easy/netmri_easy.py
1
10624
########################################################################### # Export of Script Module: netmri_easy # Language: Python # Category: Internal # Description: Object oriented library for Python scripting support ########################################################################### import datetime impor...
apache-2.0
Yuriy-Leonov/nova
nova/virt/hyperv/pathutils.py
7
5822
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # # Copyright 2013 Cloudbase Solutions Srl # 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.a...
apache-2.0
xiaolonginfo/decode-Django
Django-1.5.1/django/contrib/localflavor/mx/forms.py
103
8998
# -*- coding: utf-8 -*- """ Mexican-specific form helpers. """ from __future__ import unicode_literals import re from django.forms import ValidationError from django.forms.fields import Select, RegexField from django.utils import six from django.utils.translation import ugettext_lazy as _ from django.core.validators i...
gpl-2.0
40223229/CDB_Final2
static/Brython3.1.1-20150328-091302/Lib/unittest/test/test_runner.py
785
10718
import io import os import sys import pickle import subprocess import unittest from .support import LoggingResult, ResultWithNoStartTestRunStopTestRun class TestCleanUp(unittest.TestCase): def testCleanUp(self): class TestableTest(unittest.TestCase): def testNothing(self): p...
gpl-3.0
nott/next.filmfest.by
cpm_generic/models.py
2
1500
from django.db import models from django.utils import translation from wagtail.wagtailadmin.edit_handlers import FieldPanel from wagtail.wagtailcore.fields import RichTextField from wagtail.wagtailcore.models import Page class TranslatedField(object): def __init__(self, en_field, be_field, ru_field): sel...
unlicense
jm-begon/scikit-learn
sklearn/__init__.py
154
3014
""" Machine learning module for Python ================================== sklearn is a Python module integrating classical machine learning algorithms in the tightly-knit world of scientific Python packages (numpy, scipy, matplotlib). It aims to provide simple and efficient solutions to learning problems that are acc...
bsd-3-clause
apollux/whose_turn_is_it_anyway
whose_turn_is_it_anyway/app.py
1
2193
# -*- coding: utf-8 -*- """The app module, containing the app factory function.""" from flask import Flask, render_template from whose_turn_is_it_anyway.settings import ProdConfig from whose_turn_is_it_anyway.assets import assets from whose_turn_is_it_anyway.extensions import ( bcrypt, cache, db, login...
bsd-3-clause
doriancoins/doriancoin
test/functional/test_runner.py
1
23307
#!/usr/bin/env python3 # Copyright (c) 2014-2017 The Doriancoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Run regression test suite. This module calls down into individual test cases via subprocess. It wil...
mit
run2/citytour
4symantec/Lib/site-packages/pip/_vendor/requests/packages/chardet/gb2312freq.py
3132
36011
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Communicator client code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 1998 # the Initial Developer. All Rights R...
mit
Dunkas12/BeepBoopBot
lib/requests/packages/chardet/charsetprober.py
3127
1902
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Universal charset detector code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 2001 # the Initial Developer. All R...
gpl-3.0
AndrewGoldstein/grasshopper
grasshopper/public/views.py
1
2732
# -*- coding: utf-8 -*- """Public section, including homepage and signup.""" from flask import Blueprint, flash, redirect, render_template, request, url_for, g from flask_login import login_required, login_user, logout_user from grasshopper.extensions import login_manager from grasshopper.public.forms import LoginForm...
bsd-3-clause
WSDC-NITWarangal/django
tests/utils_tests/test_datastructures.py
262
4154
""" Tests for stuff in django.utils.datastructures. """ import copy from django.test import SimpleTestCase from django.utils import six from django.utils.datastructures import ( DictWrapper, ImmutableList, MultiValueDict, MultiValueDictKeyError, OrderedSet, ) class OrderedSetTests(SimpleTestCase): def ...
bsd-3-clause
reuk/wayverb
scripts/python/dispersion.py
2
6340
from math import e, pi import numpy as np import matplotlib.pyplot as plt from matplotlib import colors, ticker, cm from mpl_toolkits.mplot3d import Axes3D import numpy as np import operator def get_base_vectors(flip): ret = [ np.array([0.0, 2.0 * np.sqrt(2.0) / 3.0, 1.0 / 3.0]), ...
gpl-2.0
KaranToor/MA450
google-cloud-sdk/.install/.backup/platform/bq/remove_pyreadline.py
14
3460
#!/usr/bin/env python # # Copyright 2010 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 or ...
apache-2.0
tombstone/models
research/object_detection/core/matcher_test.py
2
8989
# Copyright 2017 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
apache-2.0
cbick/osmviz
src/osmviz/__init__.py
2
1127
### osmviz module ### # Copyright (c) 2010 Colin Bick, Robert Damphousse # 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...
mit
Serag8/Bachelor
google_appengine/lib/django-1.2/django/conf/locale/nl/formats.py
80
2778
# -*- encoding: utf-8 -*- # This file is distributed under the same license as the Django package. # DATE_FORMAT = 'j F Y' # '20 januari 2009' TIME_FORMAT = 'H:i' # '15:23' DATETIME_FORMAT = 'j F Y H:i' # '20 januari 2009 15:23' YEAR_MONTH_FORMAT = 'F Y' # ...
mit
izonder/intellij-community
python/lib/Lib/mimetypes.py
92
18690
"""Guess the MIME type of a file. This module defines two useful functions: guess_type(url, strict=1) -- guess the MIME type and encoding of a URL. guess_extension(type, strict=1) -- guess the extension for a given MIME type. It also contains the following, for tuning the behavior: Data: knownfiles -- list of fil...
apache-2.0
crawln45/Flexget
flexget/plugins/internal/api_rottentomatoes.py
9
22727
from __future__ import unicode_literals, division, absolute_import from builtins import * # noqa pylint: disable=unused-import, redefined-builtin from past.builtins import basestring from future.moves.urllib.parse import quote_plus from future.moves.urllib.error import URLError import time import logging import diffl...
mit