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
synesenom/model.py
distributions/distribution.py
1
5033
#!/usr/bin/env python3 #title : distribution.py #description : Imports distributions and defines their default settings. #author : Enys Mones #date : 2015.06.20 #version : 0.1 #usage : python distribution.py #=================================================================...
mit
ndparker/wolfe
_setup/py3/util.py
43
1811
# -*- coding: ascii -*- # # Copyright 2007, 2008, 2009, 2010, 2011 # Andr\xe9 Malo or his licensors, as applicable # # 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.or...
apache-2.0
Alzemand/Rastema
models/db.py
2
6663
# -*- coding: utf-8 -*- ######################################################################### ## This scaffolding model makes your app work on Google App Engine too ## File is released under public domain and you can use without limitations ######################################################################### ...
mit
nburn42/tensorflow
tensorflow/examples/speech_commands/label_wav.py
68
4683
# 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
eltonsantos/django
tests/template_tests/test_callables.py
117
4121
from __future__ import unicode_literals from django import template from django.utils.unittest import TestCase class CallableVariablesTests(TestCase): def test_callable(self): class Doodad(object): def __init__(self, value): self.num_calls = 0 self.value = val...
bsd-3-clause
letsgoexploring/economicData
usConvergenceData/stateIncomeData.py
1
5246
# coding: utf-8 # In[1]: from __future__ import division,unicode_literals # get_ipython().magic('matplotlib inline') import numpy as np import pandas as pd import json import runProcs from urllib.request import urlopen import matplotlib.pyplot as plt # In[2]: # 0. State abbreviations # 0.1 dictionary: stateAbbr...
mit
forge33/CouchPotatoServer
couchpotato/core/media/movie/providers/torrent/torrentshack.py
52
1075
from couchpotato.core.event import fireEvent from couchpotato.core.helpers.encoding import tryUrlencode from couchpotato.core.logger import CPLog from couchpotato.core.media._base.providers.torrent.torrentshack import Base from couchpotato.core.media.movie.providers.base import MovieProvider log = CPLog(__name__) aut...
gpl-3.0
pwarren/AGDeviceControl
agdevicecontrol/thirdparty/site-packages/linux2/twisted/internet/app.py
17
31579
# -*- test-case-name: twisted.test.test_app -*- # Copyright (c) 2001-2004 Twisted Matrix Laboratories. # See LICENSE for details. """This module is DEPRECATED. Maintainer: U{Itamar Shtull-Trauring<mailto:twisted@itamarst.org>} """ # System Imports import os import string import socket import types import warnings...
gpl-2.0
kikokubo/Sick-Beard-TPB
sickbeard/providers/nzbs_org_old.py
13
4458
# Author: Nic Wolfe <nic@wolfeden.ca> # URL: http://code.google.com/p/sickbeard/ # # This file is part of Sick Beard. # # Sick Beard is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the Lice...
gpl-3.0
zhukaixy/kbengine
kbe/src/lib/python/Lib/ctypes/test/test_objects.py
80
1682
r''' This tests the '_objects' attribute of ctypes instances. '_objects' holds references to objects that must be kept alive as long as the ctypes instance, to make sure that the memory buffer is valid. WARNING: The '_objects' attribute is exposed ONLY for debugging ctypes itself, it MUST NEVER BE MODIFIED! '_object...
lgpl-3.0
djmaze/phantomjs
src/qt/qtwebkit/Tools/Scripts/webkitpy/common/net/failuremap.py
134
4062
# Copyright (C) 2010 Google Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the ...
bsd-3-clause
shubhdev/edx-platform
openedx/core/djangoapps/user_api/tests/test_models.py
29
5872
import json from django.db import IntegrityError from django.test import TestCase from student.tests.factories import UserFactory from student.tests.tests import UserSettingsEventTestMixin from xmodule.modulestore.tests.factories import CourseFactory from xmodule.modulestore.tests.django_utils import ModuleStoreTestC...
agpl-3.0
Pragith/p8ste
src/page/error/error404/__init__.py
2
1092
# Copyright 2008 Thomas Quemard # # Paste-It 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.0, or (at your option) # any later version. # # Paste-It is distributed in the hope that it will be...
gpl-3.0
gw0/myhdl
myhdl/test/conversion/toVerilog2/test_loops.py
1
1068
from __future__ import absolute_import import os path = os.path from random import randrange from myhdl import * from myhdl.conversion import verify, analyze from myhdl import ConversionError from myhdl.conversion._misc import _error def ForLoopError1(a, out): @instance def logic(): while 1: ...
lgpl-2.1
ALSchwalm/python-prompt-toolkit
prompt_toolkit/eventloop/win32.py
2
5301
""" Win32 asyncio event loop. Windows notes: - Somehow it doesn't seem to work with the 'ProactorEventLoop'. """ from __future__ import unicode_literals from ..terminal.win32_input import ConsoleInputReader from ..win32_types import SECURITY_ATTRIBUTES from .base import EventLoop, INPUT_TIMEOUT from .inputhook im...
bsd-3-clause
jordanemedlock/psychtruths
temboo/core/Library/Google/Spreadsheets/RetrieveCellFeed.py
4
5884
# -*- coding: utf-8 -*- ############################################################################### # # RetrieveCellFeed # Retrieves a list of cell names and values in a specified Google worksheet. # # Python versions 2.6, 2.7, 3.x # # Copyright 2014, Temboo Inc. # # Licensed under the Apache License, Version 2.0 ...
apache-2.0
michalliu/chromium-depot_tools
third_party/boto/gs/connection.py
51
4527
# Copyright 2010 Google Inc. # # 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, modify, merge, publish, dis- # trib...
bsd-3-clause
chiefspace/udemy-rest-api
udemy_rest_api_section4/env/lib/python3.4/site-packages/werkzeug/useragents.py
86
5640
# -*- coding: utf-8 -*- """ werkzeug.useragents ~~~~~~~~~~~~~~~~~~~ This module provides a helper to inspect user agent strings. This module is far from complete but should work for most of the currently available browsers. :copyright: (c) 2014 by the Werkzeug Team, see AUTHORS for more deta...
gpl-2.0
demarle/VTK
IO/EnSight/Testing/Python/EnSightNfacedBin.py
20
1514
#!/usr/bin/env python import vtk from vtk.test import Testing from vtk.util.misc import vtkGetDataRoot VTK_DATA_ROOT = vtkGetDataRoot() # create a rendering window and renderer ren1 = vtk.vtkRenderer() renWin = vtk.vtkRenderWindow() renWin.AddRenderer(ren1) renWin.StereoCapableWindowOn() iren = vtk.vtkRenderWindowInte...
bsd-3-clause
trietptm/idapython
examples/ex_custview.py
15
5241
# ----------------------------------------------------------------------- # This is an example illustrating how to use customview in Python # (c) Hex-Rays # import idaapi import idc from idaapi import simplecustviewer_t #<pycode(py_custviewerex1)> class say_something_handler_t(idaapi.action_handler_t): d...
bsd-3-clause
denisff/python-for-android
python3-alpha/python3-src/Lib/test/test_bisect.py
55
13116
import sys import unittest from test import support from collections import UserList # We do a bit of trickery here to be able to test both the C implementation # and the Python implementation of the module. # Make it impossible to import the C implementation anymore. sys.modules['_bisect'] = 0 # We must also handle ...
apache-2.0
mrknow/filmkodi
plugin.video.mrknow/resources/lib/crypto/keyedHash/prf_dot11.py
7
1374
# -*- coding: iso-8859-1 -*- """ prf_dot11.py The PRF function is used in a number of places in 802.11i to create psuedo random octet strings. The parameter 'prefix' is a string that shall be a unique label for each different purpose of the PRF. """ import hmac, sha # available in any Python 2.x def PRF( ke...
apache-2.0
olgabrani/synnefo
snf-cyclades-app/synnefo/userdata/migrations/0001_initial.py
10
3130
# encoding: utf-8 import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): depends_on = ( ("db", "0025_auto__del_field_virtualmachine_sourceimage"), ) def forwards(self, orm): # Adding model 'PublicKeyPair...
gpl-3.0
pylbert/upm
examples/python/adxl345.py
6
1853
#!/usr/bin/env python from __future__ import print_function # Author: Mihai Tudor Panu <mihai.tudor.panu@intel.com> # Copyright (c) 2014 Intel Corporation. # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal i...
mit
ChristinaZografou/sympy
sympy/core/compatibility.py
6
28803
""" Reimplementations of constructs introduced in later versions of Python than we support. Also some functions that are needed SymPy-wide and are located here for easy import. """ from __future__ import print_function, division import operator from collections import defaultdict from sympy.external import import_modu...
bsd-3-clause
dmeulen/home-assistant
homeassistant/components/media_player/soundtouch.py
6
12953
"""Support for interface with a Bose Soundtouch.""" import logging from os import path import voluptuous as vol import homeassistant.helpers.config_validation as cv from homeassistant.components.media_player import ( SUPPORT_NEXT_TRACK, SUPPORT_PAUSE, SUPPORT_PREVIOUS_TRACK, SUPPORT_TURN_OFF, SUPPORT_VOLUME_M...
mit
ymorired/s4backup
filelister.py
1
1541
__author__ = 'mori.yuichiro' import os import fnmatch class FileLister(): def __init__(self, target_path, ignore_dirs=None, ignore_file_patterns=None): abs_path = os.path.abspath(target_path) if not os.path.isdir(abs_path): raise Exception('Invalid target path!') self.target_...
mit
savanu/servo
components/script/dom/bindings/codegen/parser/tests/test_typedef.py
154
1880
def WebIDLTest(parser, harness): parser.parse(""" typedef long mylong; typedef long? mynullablelong; interface Foo { const mylong X = 5; const mynullablelong Y = 7; const mynullablelong Z = null; void foo(mylong arg); }; """) results = parser.finish()...
mpl-2.0
JCBarahona/edX
common/test/acceptance/pages/lms/dashboard.py
39
6715
# -*- coding: utf-8 -*- """ Student dashboard page. """ from bok_choy.page_object import PageObject from . import BASE_URL class DashboardPage(PageObject): """ Student dashboard, where the student can view courses she/he has registered for. """ def __init__(self, browser): """Initialize th...
agpl-3.0
vmindru/ansible
test/units/modules/cloud/amazon/test_kinesis_stream.py
54
10919
import pytest import unittest boto3 = pytest.importorskip("boto3") botocore = pytest.importorskip("botocore") from ansible.modules.cloud.amazon import kinesis_stream aws_region = 'us-west-2' class AnsibleKinesisStreamFunctions(unittest.TestCase): def test_convert_to_lower(self): example = { ...
gpl-3.0
inveniosoftware/invenio-testing
docs/_ext/ultramock.py
164
2830
# -*- coding: utf-8 -*- # # This file is part of Invenio. # Copyright (C) 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 the # License, or (at your option) any later...
gpl-2.0
dkubiak789/OpenUpgrade
addons/web/static/lib/py.js/doc/conf.py
543
7829
# -*- coding: utf-8 -*- # # py.js documentation build configuration file, created by # sphinx-quickstart on Sun Sep 9 19:36:23 2012. # # 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 c...
agpl-3.0
chaowyc/youtube-dl
youtube_dl/extractor/azubu.py
143
3350
from __future__ import unicode_literals import json from .common import InfoExtractor from ..utils import float_or_none class AzubuIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?azubu\.tv/[^/]+#!/play/(?P<id>\d+)' _TESTS = [ { 'url': 'http://www.azubu.tv/GSL#!/play/15575/2014-hot6-...
unlicense
hkchenhongyi/django
tests/serializers_regress/tests.py
86
23113
""" A test spanning all the capabilities of all the serializers. This class defines sample data and a dynamically generated test case that is capable of testing the capabilities of the serializers. This includes all valid data values, plus forward, backwards and self references. """ from __future__ import unicode_lite...
bsd-3-clause
sumspr/scikit-learn
examples/linear_model/plot_lasso_and_elasticnet.py
249
1982
""" ======================================== Lasso and Elastic Net for Sparse Signals ======================================== Estimates Lasso and Elastic-Net regression models on a manually generated sparse signal corrupted with an additive noise. Estimated coefficients are compared with the ground-truth. """ print(...
bsd-3-clause
ryfeus/lambda-packs
Tensorflow_Pandas_Numpy/source3.6/tensorflow/python/ops/candidate_sampling_ops.py
55
17656
# 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...
mit
ant-Korn/math_tournaments
math_tournaments/users/migrations/0001_initial.py
1
2701
# -*- coding: utf-8 -*- # Generated by Django 1.11b1 on 2017-09-23 23:21 from __future__ import unicode_literals import django.core.validators from django.db import migrations, models import users.models class Migration(migrations.Migration): initial = True dependencies = [ ('auth', '0008_alter_use...
mit
kapt/django-oscar
oscar/apps/basket/reports.py
36
4534
from oscar.core.loading import get_model from django.utils.translation import ugettext_lazy as _ from oscar.core.loading import get_class ReportGenerator = get_class('dashboard.reports.reports', 'ReportGenerator') ReportCSVFormatter = get_class('dashboard.reports.reports', 'ReportCSVForm...
bsd-3-clause
teoliphant/scipy
scipy/stats/distributions.py
2
215895
# Functions to implement several important functions for # various Continous and Discrete Probability Distributions # # Author: Travis Oliphant 2002-2011 with contributions from # SciPy Developers 2004-2011 # import math import warnings from copy import copy from scipy.misc import comb, derivative from s...
bsd-3-clause
guptaankita/python-novaclient
novaclient/tests/unit/v2/test_versions.py
1
2817
# Copyright 2015 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
roadmapper/ansible
test/support/integration/plugins/modules/ec2_instance.py
24
72387
#!/usr/bin/python # Copyright: Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['preview'], ...
gpl-3.0
google/google-ctf
third_party/edk2/AppPkg/Applications/Python/Python-2.7.10/Lib/encodings/iso8859_11.py
93
12898
""" Python Character Mapping Codec iso8859_11 generated from 'MAPPINGS/ISO8859/8859-11.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...
apache-2.0
BackupGGCode/python-for-android
python-modules/twisted/twisted/internet/test/test_posixprocess.py
49
1628
# Copyright (c) 2010 Twisted Matrix Laboratories. # See LICENSE for details. """ Tests for POSIX-based L{IReactorProcess} implementations. """ import errno, os, sys try: import fcntl except ImportError: platformSkip = "non-POSIX platform" else: from twisted.internet import process platformSkip = None...
apache-2.0
Zurfazz/BiSci
SIZExWEIGHT/SIZExWEIGHT.py
1
1141
# @Author: Vegard S. <BioVegas> # @Date: 17-Nov-2016 # @Email: vegard.stuerzinger@gmail.com # @Project: BiSci # @Filename: SIZExWEIGHT.py # @Last modified by: BioVegas # @Last modified time: 17-Nov-2016 # @Copyright: Open Source import numpy as np from Tkinter import * #saving entry fields filename="SIZExWEIGHT....
mit
jasonzio/azure-linux-extensions
TestHandlerLinux/bin/enable.py
16
5423
#!/usr/bin/env python """ Example Azure Handler script for Linux IaaS Enable example """ import os import imp import subprocess import time import json waagent=imp.load_source('waagent','/usr/sbin/waagent') from waagent import LoggerInit hutil=imp.load_source('HandlerUtil','./resources/HandlerUtil.py') LoggerInit(...
apache-2.0
fortiema/stackexch-nlp
docs/conf.py
1
7917
# -*- coding: utf-8 -*- # # stackexch-nlp documentation build configuration file, created by # sphinx-quickstart. # # 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 ...
mit
PaulStoffregen/Arduino-1.6.7-Teensyduino
arduino-core/src/processing/app/i18n/python/requests/packages/urllib3/connectionpool.py
184
20547
# urllib3/connectionpool.py # Copyright 2008-2012 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 import socket import errno from socket import error as SocketError, time...
lgpl-2.1
sdcooke/django
django/views/generic/edit.py
225
11226
import inspect import re import warnings from django.core.exceptions import ImproperlyConfigured from django.forms import models as model_forms from django.http import HttpResponseRedirect from django.utils import six from django.utils.deprecation import RemovedInDjango110Warning from django.utils.encoding import forc...
bsd-3-clause
lafayette/JBTT
framework/python/Lib/compiler/pyassem.py
7
26171
"""A flow graph representation for Python bytecode""" import dis import types import sys from compiler import misc from compiler.consts \ import CO_OPTIMIZED, CO_NEWLOCALS, CO_VARARGS, CO_VARKEYWORDS class FlowGraph: def __init__(self): self.current = self.entry = Block() self.exit = Block("...
mit
ctaylo37/OTM2
opentreemap/importer/models/trees.py
3
15251
# -*- coding: utf-8 -*- from __future__ import print_function from __future__ import unicode_literals from __future__ import division from django.core.exceptions import ValidationError from django.contrib.gis.db import models from django.contrib.gis.geos import Point from django.contrib.gis.measure import D from djang...
gpl-3.0
chvalean/lis-test
WS2012R2/lisa/Infrastructure/patch-utils/server.py
9
3190
from BaseHTTPServer import BaseHTTPRequestHandler, HTTPServer import SocketServer import logging import json import threading import os from utils import parse_results from collections import defaultdict from shutil import move logger=logging.getLogger(__name__) class PatchServerHandler(object): post_request_coun...
apache-2.0
ezequielpereira/Time-Line
libs64/wx/lib/dialogs.py
6
15334
#---------------------------------------------------------------------- # Name: wx.lib.dialogs # Purpose: ScrolledMessageDialog, MultipleChoiceDialog and # function wrappers for the common dialogs by Kevin Altis. # # Author: Various # # Created: 3-January-2002 # RCS-ID: $Id: dialog...
gpl-3.0
CTcue/CTcUMLS
_scripts/dbc_treatments.py
2
2239
#!/usr/bin/python # -*- coding: utf-8 -*- from __future__ import unicode_literals from elasticsearch import Elasticsearch, helpers import csv import argparse import time import json import os def read_rows(filename, delimiter=";"): with open(filename, "rb") as f: datareader = csv.reader(f, delimiter=str(...
mit
itdxer/neupy
tests/algorithms/gd/test_optimizers.py
1
4608
from functools import partial from neupy import algorithms, layers from helpers import simple_classification, compare_networks from base import BaseTestCase class OptimizersTestCase(BaseTestCase): def setUp(self): super(OptimizersTestCase, self).setUp() self.network = layers.join( la...
mit
idano/home
lib/ansible/runner/action_plugins/fail.py
161
1472
# Copyright 2012, 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 # (at your option) any later versi...
gpl-3.0
wangkai2014/viro-pox
pox/misc/full_payload.py
46
1079
# Copyright 2012 James McCauley # # 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 writi...
apache-2.0
carljm/django
tests/admin_views/custom_has_permission_admin.py
380
1089
""" A custom AdminSite for AdminViewPermissionsTest.test_login_has_permission(). """ from __future__ import unicode_literals from django.contrib import admin from django.contrib.auth import get_permission_codename from django.contrib.auth.forms import AuthenticationForm from . import admin as base_admin, models PERM...
bsd-3-clause
dimara/synnefo
snf-cyclades-app/synnefo/volume/util.py
1
6444
# Copyright (C) 2010-2015 GRNET S.A. and individual contributors # # 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. # # T...
gpl-3.0
joseph-torres/spark
examples/src/main/python/wordcount.py
51
1457
# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not us...
apache-2.0
AOSPB/external_skia
tools/embed_resources.py
57
2573
#!/usr/bin/python ''' Copyright 2015 Google Inc. Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. ''' import argparse def bytes_from_file(f, chunksize=8192): while True: chunk = f.read(chunksize) if chunk: for b in chunk: yield ord(b) els...
bsd-3-clause
CRXTeam/kernel_samsung_u8500
tools/perf/scripts/python/syscall-counts.py
11181
1522
# 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
B-MOOC/edx-platform
lms/envs/content.py
168
1088
""" These are debug machines used for content creators, so they're kind of a cross between dev machines and AWS machines. """ # We intentionally define lots of variables that aren't used, and # want to import all variables from base settings files # pylint: disable=wildcard-import, unused-wildcard-import from .aws im...
agpl-3.0
ArtsiomCh/tensorflow
tensorflow/python/keras/_impl/keras/activations.py
15
3477
# 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
costa23c/rdmw_cloudkit
xbgw_dashboard/settings.py
3
13728
# # This Source Code Form is subject to the terms of the Mozilla Public License, # v. 2.0. If a copy of the MPL was not distributed with this file, You can # obtain one at http://mozilla.org/MPL/2.0/. # # Copyright (c) 2015 Digi International Inc., All Rights Reserved. # import os import dj_database_url import binasci...
mpl-2.0
bopo/tablib
tablib/packages/odf3/style.py
56
4672
# -*- coding: utf-8 -*- # Copyright (C) 2006-2007 Søren Roug, European Environment Agency # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at you...
mit
clumsy/intellij-community
python/lib/Lib/site.py
80
14670
"""Append module search paths for third-party packages to sys.path. **************************************************************** * This module is automatically imported during initialization. * **************************************************************** In earlier versions of Python (up to 1.5a3), scripts or...
apache-2.0
ambrosef/HLx_Examples
Acceleration/memcached/regressionSims/testgen/memtest_regressions.py
1
5540
#!/usr/bin/python import memlib ## EDIT HERE ################################################################### keySizes = [1,3,4,5,7,8,9,10,12,13,15,16,17,24,25,28,84,128] #valueSizes = [1,3,4,5,8,9,10,12,13,16,17,24,28,184,208,1024] valueSizes = [1,3,4,5,8,9,10,12,13,16,17,24,28,184,208, 256] seq1repeat = 5 key...
bsd-3-clause
KuroeKurose/gem5
src/mem/slicc/ast/AST.py
73
2473
# Copyright (c) 1999-2008 Mark D. Hill and David A. Wood # Copyright (c) 2009 The Hewlett-Packard Development Company # 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 co...
bsd-3-clause
svanschalkwyk/datafari
windows/python/Lib/test/test_doctest.py
12
86542
# -*- coding: utf-8 -*- """ Test script for doctest. """ import sys from test import test_support import doctest # NOTE: There are some additional tests relating to interaction with # zipimport in the test_zipimport_support test module. ###################################################################### ## ...
apache-2.0
mensler/ansible
lib/ansible/plugins/lookup/fileglob.py
131
1519
# (c) 2012, 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) any lat...
gpl-3.0
paolodedios/tensorflow
tensorflow/python/kernel_tests/distributions/exponential_test.py
44
6575
# 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
beav/katello
cli/src/katello/client/core/filters.py
2
6563
# # Katello User actions # Copyright (c) 2010 Red Hat, Inc. # # This software is licensed to you under the GNU General Public License, # version 2 (GPLv2). There is NO WARRANTY for this software, express or # implied, including the implied warranties of MERCHANTABILITY or FITNESS # FOR A PARTICULAR PURPOSE. You should ...
gpl-2.0
wkschwartz/django
tests/delete_regress/tests.py
9
14484
import datetime from django.db import connection, models, transaction from django.db.models import Exists, OuterRef from django.test import ( SimpleTestCase, TestCase, TransactionTestCase, skipUnlessDBFeature, ) from .models import ( Award, AwardNote, Book, Child, Contact, Eaten, Email, File, Food, FooFile, ...
bsd-3-clause
kevinastone/sentry
tests/sentry/web/frontend/test_auth_organization_login.py
23
6946
from __future__ import absolute_import from django.core.urlresolvers import reverse from sentry.models import AuthIdentity, AuthProvider, OrganizationMember from sentry.testutils import AuthProviderTestCase # TODO(dcramer): this is an integration test class OrganizationAuthSettingsTest(AuthProviderTestCase): de...
bsd-3-clause
kenwang815/KodiPlugins
script.module.youtube.dl/lib/youtube_dl/extractor/everyonesmixtape.py
88
2819
from __future__ import unicode_literals import re from .common import InfoExtractor from ..utils import ( ExtractorError, sanitized_Request, ) class EveryonesMixtapeIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?everyonesmixtape\.com/#/mix/(?P<id>[0-9a-zA-Z]+)(?:/(?P<songnr>[0-9]))?$' _TESTS ...
gpl-2.0
imk1/IMKTFBindingCode
selectFIMOCutoff.py
1
5703
import sys import argparse from itertools import izip import pybedtools as bt import os def parseArgument(): # Parse the input parser = argparse.ArgumentParser(description="Select the FIMO cutoff by maximizing F1 for a list of FIMO files") parser.add_argument("--FIMOFileListFileName", required=True, \ help="List ...
mit
zzzombat/lucid-python-django
django/core/files/base.py
235
3888
import os try: from cStringIO import StringIO except ImportError: from StringIO import StringIO from django.utils.encoding import smart_str, smart_unicode from django.core.files.utils import FileProxyMixin class File(FileProxyMixin): DEFAULT_CHUNK_SIZE = 64 * 2**10 def __init__(self, file, name=None)...
bsd-3-clause
candrews/portage
pym/_emerge/show_invalid_depstring_notice.py
14
1455
# Copyright 1999-2010 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 import logging import textwrap import portage from portage import os from portage.util import writemsg_level def show_invalid_depstring_notice(parent_node, depstring, error_msg): msg1 = "\n\n!!! Invalid or cor...
gpl-2.0
huguesv/azure-sdk-for-python
azure-servicebus/azure/servicebus/_common_error.py
7
2823
#------------------------------------------------------------------------- # Copyright (c) Microsoft. 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.apa...
apache-2.0
lombritz/odoo
addons/stock/wizard/stock_transfer_details.py
49
8368
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-TODAY OpenERP S.A. <http://www.odoo.com> # # This program is free software: you can redistribute it and/or modify # it under the terms of t...
agpl-3.0
GoogleCloudPlatform/training-data-analyst
courses/machine_learning/deepdive2/end_to_end_ml/solutions/serving/application/lib/flask/debughelpers.py
318
6024
# -*- coding: utf-8 -*- """ flask.debughelpers ~~~~~~~~~~~~~~~~~~ Various helpers to make the development experience better. :copyright: (c) 2015 by Armin Ronacher. :license: BSD, see LICENSE for more details. """ from ._compat import implements_to_string, text_type from .app import Flask from .bl...
apache-2.0
shaufi/odoo
addons/l10n_ma/__openerp__.py
260
2074
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (c) 2010 kazacube (http://kazacube.com). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU ...
agpl-3.0
jonathanverner/brython
www/src/Lib/copyreg.py
749
6611
"""Helper to provide extensibility for pickle. This is only useful to add pickle support for extension types defined in C, not for instances of user-defined classes. """ __all__ = ["pickle", "constructor", "add_extension", "remove_extension", "clear_extension_cache"] dispatch_table = {} def pickle(ob_typ...
bsd-3-clause
kanteshraj/ansible
samples/multi.py
210
4058
#!/usr/bin/env python import time import Queue import traceback from multiprocessing import Process, Manager, Pipe, RLock from ansible.playbook.play import Play from ansible.playbook.task import Task from ansible.utils.debug import debug NUM_WORKERS = 50 NUM_HOSTS = 2500 NUM_TASKS = 1 class Foo: def __init__...
gpl-3.0
coreycb/horizon
openstack_dashboard/api/keystone.py
1
33412
# Copyright 2012 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # Copyright 2012 OpenStack Foundation # Copyright 2012 Nebula, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use t...
apache-2.0
kskalski/grpc
src/python/grpcio_tests/tests/unit/resources.py
10
1267
# Copyright 2015 gRPC 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 applicable law or agreed to in writing...
apache-2.0
MarcoFalke/bitcoin
test/functional/mempool_compatibility.py
6
3026
#!/usr/bin/env python3 # Copyright (c) 2017-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 that mempool.dat is both backward and forward compatible between versions NOTE: The test is desig...
mit
tntraina/aff4
scons-local-1.2.0/SCons/Node/FS.py
12
107375
"""scons.Node.FS File system nodes. These Nodes represent the canonical external objects that people think of when they think of building software: files and directories. This holds a "default_fs" variable that should be initialized with an FS that can be used by scripts or modules looking for the canonical default....
gpl-3.0
henrysher/imagefactory
imagefactory-plugins/OpenStackCloud/OpenStackCloud.py
1
4825
#!/usr/bin/python import logging import zope import libxml2 from imgfac.BuildDispatcher import BuildDispatcher from imgfac.ImageFactoryException import ImageFactoryException from imgfac.CloudDelegate import CloudDelegate from glance import client as glance_client def glance_upload(image_filename, creds = {'auth_url':...
apache-2.0
zxl200406/minos
client/deploy_hdfs.py
5
16767
import deploy_utils import parallel_deploy import service_config import subprocess import sys import time from log import Log ALL_JOBS = ["journalnode", "zkfc", "namenode", "datanode"] SHELL_COMMAND_INFO = { "dfs": ("org.apache.hadoop.fs.FsShell", "run a filesystem command on the file systems supported in Ha...
apache-2.0
benjaminrigaud/django
tests/ordering/tests.py
45
6059
from __future__ import unicode_literals from datetime import datetime from operator import attrgetter from django.test import TestCase from .models import Article, Author class OrderingTests(TestCase): def setUp(self): self.a1 = Article.objects.create( headline="Article 1", pub_date=datetim...
bsd-3-clause
ChristosChristofidis/bokeh
sphinx/source/docs/tutorials/exercises/brushing.py
20
1478
from bokeh.plotting import ColumnDataSource, figure, gridplot, output_file, show from bokeh.sampledata.autompg import autompg output_file("brushing.html") # Load some Automobile data into a data source. Interesting columns are: # "yr" - Year manufactured # "mpg" - miles per gallon # "displ" - engine displacement # "h...
bsd-3-clause
google-research/open-covid-19-data
src/pipeline/config.py
1
5665
# Copyright 2020 Google LLC. # # 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, ...
apache-2.0
vicky2135/lucious
tests/integration/payment/test_forms.py
7
5832
import datetime from django.core.exceptions import ImproperlyConfigured from django.test import TestCase from django.forms import ValidationError from oscar.apps.payment import forms, models # types=[bankcards.VISA, bankcards.VISA_ELECTRON, bankcards.MASTERCARD, # bankcards.AMEX, bankcards.MAESTRO, ban...
bsd-3-clause
brianmay/karaage
karaage/management/commands/migrate_project_users.py
2
3798
import sys import django.db.transaction import tldap.transaction from django.core.management.base import BaseCommand from karaage.projects.models import Project class Command(BaseCommand): help = "Move all project users (except leaders) out of project safely" def add_arguments(self, parser): parser...
gpl-3.0
t0mk/ansible
lib/ansible/module_utils/iosxr.py
12
4452
# This code is part of Ansible, but is an independent component. # This particular file snippet, and this file snippet only, is BSD licensed. # Modules you write using this snippet, which is embedded dynamically by Ansible # still belong to the author of the module, and may assign their own license # to the complete wo...
gpl-3.0
awilliam/qemu-kvm
scripts/qapi.py
52
5019
# # QAPI helper library # # Copyright IBM, Corp. 2011 # # Authors: # Anthony Liguori <aliguori@us.ibm.com> # # This work is licensed under the terms of the GNU GPLv2. # See the COPYING.LIB file in the top-level directory. from ordereddict import OrderedDict def tokenize(data): while len(data): if data[0]...
gpl-2.0
domeger/SplunkTAforPuppetEnterprise
bin/splunktaforpuppetenterprise/requests/packages/chardet/langgreekmodel.py
2763
12628
######################## 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...
apache-2.0
takeshineshiro/glance
glance/common/swift_store_utils.py
10
3854
# Copyright 2014 Rackspace # # 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
naemono/pyrax
samples/cloud_monitoring/create_notification.py
13
2210
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright (c)2013 Rackspace US, 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.ap...
apache-2.0