repo_name
stringlengths
5
100
path
stringlengths
4
375
copies
stringclasses
991 values
size
stringlengths
4
7
content
stringlengths
666
1M
license
stringclasses
15 values
sjohannes/exaile
tests/xl/trax/test_search.py
2
16207
# -*- coding: utf-8 from mox3 import mox from xl.trax import search from xl.trax import track import pytest def test_search_result_track_get_track(): val = 'foo' search_result_track = search.SearchResultTrack(val) assert search_result_track.track == val, search_result_track.track def get_search_result...
gpl-2.0
Netuitive/netuitive-diamond
src/collectors/kvm/kvm.py
31
1279
# coding=utf-8 """ Collects /sys/kernel/debug/kvm/* #### Dependencies * /sys/kernel/debug/kvm """ import diamond.collector import os class KVMCollector(diamond.collector.Collector): PROC = '/sys/kernel/debug/kvm' def get_default_config_help(self): config_help = super(KVMCollector, self).get_de...
mit
pnedunuri/scipy
scipy/sparse/linalg/isolve/iterative/test.py
110
4126
from __future__ import division, print_function, absolute_import from scipy import * from iterative import * def test_fun(alpha, x, beta, y, A, n): # compute z = alpha*A*x + beta*y xx = x[:n] yy = y[:n] w = dot(A,xx) z = alpha*w+beta*yy y[:n] = z return def test_fun_t(alpha, x, beta, y,...
bsd-3-clause
Yashasvi-Sriram/EscapeErrands
escapeerrands/settings.py
1
2950
import os import dj_database_url BASE_DIR = os.path.dirname(os.path.dirname(__file__)) PROJECT_APP = os.path.dirname(os.path.abspath(__file__)) # SECURITY WARNING: keep the secret key used in production secret! SECRET_KEY = 'rt$g!n6fo^gs91m%osd#4ia-rc^qyhaaisj%+0=^dd05p7@=&h' # SECURITY WARNING: don't run with debug...
apache-2.0
ledsusop/airflow
airflow/contrib/operators/dataflow_operator.py
14
3784
# -*- coding: utf-8 -*- # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software ...
apache-2.0
saisaizhang/Food
flask/lib/python2.7/site-packages/whoosh/lang/__init__.py
71
4308
# coding=utf-8 # Copyright 2012 Matt Chaput. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # 1. Redistributions of source code must retain the above copyright notice, # this list of co...
bsd-3-clause
iagapov/ocelot
utils/db.py
2
6438
import sqlite3 import os, sys import datetime, time class Tuning: def __init__(self, pars): self.time = pars[0] self.id = pars[1] self.wl = pars[2] self.charge = pars[3] self.comment = pars[4] class ActionResult: def __init__(self, pars): self.tuning_id = pars[...
gpl-3.0
javiergarridomellado/Empresa_django
devcodela/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/util.py
248
21407
# urllib3/util.py # Copyright 2008-2013 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 from base64 import b64encode from binascii import hexlify, unhexlify from collections import name...
gpl-2.0
calebkleveter/Mist
node_modules/node-gyp/gyp/pylib/gyp/generator/analyzer.py
1382
30567
# Copyright (c) 2014 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """ This script is intended for use as a GYP_GENERATOR. It takes as input (by way of the generator flag config_path) the path of a json file that dictates the file...
mit
jiachenning/odoo
addons/website_mail/models/mail_thread.py
338
1454
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2013-Today OpenERP SA (<http://www.openerp.com>). # # This program is free software: you can redistribute it and/or modify # it under the terms ...
agpl-3.0
kennedyshead/home-assistant
homeassistant/components/logentries/__init__.py
24
1699
"""Support for sending data to Logentries webhook endpoint.""" import json import logging import requests import voluptuous as vol from homeassistant.const import CONF_TOKEN, EVENT_STATE_CHANGED from homeassistant.helpers import state as state_helper import homeassistant.helpers.config_validation as cv _LOGGER = log...
apache-2.0
scharron/chardet
chardet/gb2312freq.py
323
36001
######################## 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...
lgpl-2.1
Alberto-Beralix/Beralix
i386-squashfs-root/usr/share/software-center/softwarecenter/ui/gtk3/widgets/unused__pathbar.py
2
37728
from gi.repository import Atk from gi.repository import Gtk, Gdk from gi.repository import GObject from gi.repository import Pango from softwarecenter.ui.gtk3.em import em from gettext import gettext as _ import logging LOG = logging.getLogger("softwarecenter.view.widgets.NavigationBar") # pi constants from math im...
gpl-3.0
nju520/django
tests/model_meta/models.py
192
5039
from django.contrib.contenttypes.fields import ( GenericForeignKey, GenericRelation, ) from django.contrib.contenttypes.models import ContentType from django.db import models class Relation(models.Model): pass class AbstractPerson(models.Model): # DATA fields data_abstract = models.CharField(max_len...
bsd-3-clause
chaluemwut/fbserver
venv/lib/python2.7/site-packages/scipy/interpolate/tests/test_polyint.py
9
18758
from __future__ import division, print_function, absolute_import import warnings from numpy.testing import (assert_almost_equal, assert_array_equal, TestCase, run_module_suite, assert_allclose, assert_equal, assert_) from scipy.interpolate import (KroghInterpolator, krogh_interpolate, BarycentricInter...
apache-2.0
tombstone/models
official/nlp/transformer/beam_search_v1_test.py
2
3370
# Copyright 2018 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
apache-2.0
karanisverma/flasktest
lib/flask/__init__.py
345
1672
# -*- coding: utf-8 -*- """ flask ~~~~~ A microframework based on Werkzeug. It's extensively documented and follows best practice patterns. :copyright: (c) 2011 by Armin Ronacher. :license: BSD, see LICENSE for more details. """ __version__ = '0.10' # utilities we import from Werkzeug and J...
apache-2.0
linovia/django-rest-framework
rest_framework/mixins.py
20
3013
""" Basic building blocks for generic class based views. We don't bind behaviour to http method handlers yet, which allows mixin classes to be composed in interesting ways. """ from __future__ import unicode_literals from rest_framework import status from rest_framework.response import Response from rest_framework.se...
bsd-2-clause
idlead/scikit-learn
examples/decomposition/plot_pca_iris.py
29
1484
#!/usr/bin/python # -*- coding: utf-8 -*- """ ========================================================= PCA example with Iris Data-set ========================================================= Principal Component Analysis applied to the Iris dataset. See `here <http://en.wikipedia.org/wiki/Iris_flower_data_set>`_ fo...
bsd-3-clause
hugsy/sstoper
misc/SSTP_Fuzzer.py
1
2599
#!/usr/bin/env python # -*- coding: utf-8 -*- # # ptit fuzzer pour tester le server sstp windows # from binascii import hexlify from socket import socket from ssl import wrap_socket from sys import argv from random import randint from struct import pack if len(argv) != 2: print("usage: python %s <target_ip_addr>"...
gpl-2.0
sundresh/organize_photos
helpers/find_processed_photos.py
1
1081
#!/usr/bin/env python from collections import defaultdict import exifread, os, PIL.Image, sys DATE_TIME = 'Image DateTime' DATE_TIME_ORIGINAL = 'EXIF DateTimeOriginal' SOFTWARE = 'Image Software' num_bytes = 0 for (dirpath, dirnames, filenames) in os.walk(sys.argv[1]): for filename in filenames: filepath = os.pa...
agpl-3.0
HKUST-SING/tensorflow
tensorflow/python/util/keyword_args_test.py
163
1804
# 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
treedledee/flask
examples/minitwit/minitwit.py
156
8492
# -*- coding: utf-8 -*- """ MiniTwit ~~~~~~~~ A microblogging application written with Flask and sqlite3. :copyright: (c) 2015 by Armin Ronacher. :license: BSD, see LICENSE for more details. """ import time from sqlite3 import dbapi2 as sqlite3 from hashlib import md5 from datetime import datetim...
bsd-3-clause
burntcustard/DeskBot-Zero
src/Python/infrared.py
1
2009
#! /usr/bin/env python # coding: utf8 """ Test code for 4tronix Picon Zero to work with an analog Infrared Distance Sensor (e.g. GP2Y0A21). Currently just prints the signal from an analog pin. #----------------------------------------------------------------- # GP2Y0A21 info: # Datasheet: http://www.robot-electronic...
mit
paolodoz/timesheet
core/api/crud.py
1
3803
try: from pymongo import MongoClient as Connection except ImportError as e: from pymongo import Connection from core.validation.validation import TSValidationError, validate_request, recursive_merge, update_password_salt_user_list, validate_json_list, sanitize_objectify_json, stringify_objectid_cursor, stringi...
gpl-2.0
Scapogo/zipline
zipline/utils/run_algo.py
1
13108
import os import re from runpy import run_path import sys import warnings from functools import partial import pandas as pd import click try: from pygments import highlight from pygments.lexers import PythonLexer from pygments.formatters import TerminalFormatter PYGMENTS = True except: PYGMENTS ...
apache-2.0
hkchenhongyi/django
django/forms/utils.py
16
5976
from __future__ import unicode_literals import json import sys from django.conf import settings from django.core.exceptions import ValidationError # backwards compatibility from django.utils import six, timezone from django.utils.encoding import force_text, python_2_unicode_compatible from django.utils.html import e...
bsd-3-clause
40223149/2015springfinal
static/Brython3.1.0-20150301-090019/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
BaxterStockman/ansible-modules-core
network/dellos9/dellos9_facts.py
19
17799
#!/usr/bin/python # # (c) 2015 Peter Sprygada, <psprygada@ansible.com> # # Copyright (c) 2016 Dell Inc. # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either versi...
gpl-3.0
abloomston/sympy
sympy/core/tests/test_diff.py
115
2793
from sympy import Symbol, Rational, cos, sin, tan, cot, exp, log, Function, \ Derivative, Expr, symbols, pi, I, S from sympy.utilities.pytest import raises def test_diff(): x, y = symbols('x, y') assert Rational(1, 3).diff(x) is S.Zero assert I.diff(x) is S.Zero assert pi.diff(x) is S.Zero ass...
bsd-3-clause
Dangetsu/vnr
Frameworks/Sakura/py/libs/restful/online.py
1
3628
# coding: utf8 # online.py # 8/12/2013 jichi # # See: http://ymotongpoo.hatenablog.com/entry/20081123/1227430671 __all__ = 'DataParser', 'FileParser', 'JsonFileParser' if __name__ == '__main__': # DEBUG import sys sys.path.append("..") import json, urllib2 from sakurakit import sknetio from sakurakit.skdebug imp...
gpl-3.0
toolforger/sympy
sympy/matrices/expressions/matexpr.py
41
13161
from __future__ import print_function, division from functools import wraps from sympy.core import S, Symbol, Tuple, Integer, Basic, Expr from sympy.core.decorators import call_highest_priority from sympy.core.compatibility import range from sympy.core.sympify import SympifyError, sympify from sympy.functions import ...
bsd-3-clause
rev112/playterminal
games/utils/stepic_client.py
1
1714
import requests STEPIC_URL = 'https://stepic.org/' STEPIC_API_URL = STEPIC_URL + 'api/' STEPIC_OAUTH_TOKEN_URL = STEPIC_URL + 'oauth2/token/' STEPIC_API_ATTEMPTS_URL = STEPIC_API_URL + 'attempts' STEPIC_API_ATTEMPT_URL = STEPIC_API_ATTEMPTS_URL + '/{id}' class LoginError(Exception): """An exception raised when ...
apache-2.0
brython-dev/brython
www/src/Lib/test/test_peepholer.py
1
20531
import dis import unittest from test.support.bytecode_helper import BytecodeTestCase def count_instr_recursively(f, opname): count = 0 for instr in dis.get_instructions(f): if instr.opname == opname: count += 1 if hasattr(f, '__code__'): f = f.__code__ for c in f.co_consts...
bsd-3-clause
saisai/phantomjs
src/breakpad/src/tools/gyp/test/additional-targets/gyptest-additional.py
137
1617
#!/usr/bin/env python # Copyright (c) 2009 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """ Verifies simple actions when using an explicit build target of 'all'. """ import TestGyp test = TestGyp.TestGyp() test.run_gyp('all.g...
bsd-3-clause
yanheven/console
horizon/test/tests/forms.py
10
3590
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # # 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
Innovahn/cybex
addons/l10n_th/__init__.py
893
1045
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU...
agpl-3.0
plumps/google-python-exercises
basic/string1.py
1
3485
#!/usr/bin/python -tt # Copyright 2010 Google Inc. # Licensed under the Apache License, Version 2.0 # http://www.apache.org/licenses/LICENSE-2.0 # Google's Python Class # http://code.google.com/edu/languages/google-python-class/ # Basic string exercises # Fill in the code for the functions below. main() is already se...
apache-2.0
davidovitch/f90wrap
f90wrap/fortrantype.py
1
2892
import weakref class Singleton(type): _instances = {} def __call__(cls, *args, **kwargs): if cls not in cls._instances: cls._instances[cls] = super(Singleton, cls).__call__(*args, **kwargs) return cls._instances[cls] class FortranModule(object): """ Baseclass for Fortran mo...
gpl-2.0
rishikksh20/scikit-learn
sklearn/gaussian_process/tests/test_kernels.py
51
12799
"""Testing for kernels for Gaussian processes.""" # Author: Jan Hendrik Metzen <jhm@informatik.uni-bremen.de> # License: BSD 3 clause from sklearn.externals.funcsigs import signature import numpy as np from sklearn.gaussian_process.kernels import _approx_fprime from sklearn.metrics.pairwise \ import PAIRWISE_K...
bsd-3-clause
asimshankar/tensorflow
tensorflow/python/autograph/operators/logical.py
8
3349
# Copyright 2018 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
apache-2.0
barnabytprowe/great3-public
validation/test_offsets.py
2
6031
# Copyright (c) 2014, the GREAT3 executive committee (http://www.great3challenge.info/?q=contacts) # All rights reserved. # # Redistribution and use in source and binary forms, with or without modification, are permitted # provided that the following conditions are met: # # 1. Redistributions of source code must retain...
bsd-3-clause
AlanZatarain/cortex-vfx
test/IECore/ops/maths/multiply/multiply-1.py
17
2435
########################################################################## # # Copyright (c) 2007-2011, Image Engine Design 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: # # * Redis...
bsd-3-clause
sunlightlabs/bulgogi
foreign/urls.py
1
2559
from django.conf.urls import patterns, include, url # Uncomment the next two lines to enable the admin: # from django.contrib import admin # admin.autodiscover() urlpatterns = patterns('', url(r'^$', 'foreign.views.map', name='home'), url(r'^about', 'foreign.views.about', name='about'), url(r'^methodology', ...
mit
tmrowco/electricitymap
parsers/statnett.py
2
7190
#!/usr/bin/env python3 # The arrow library is used to handle datetimes import arrow import logging # The request library is used to fetch content through HTTP import requests exchanges_mapping = { 'BY->LT': [ 'BY->LT' ], 'DE->DK-DK1': [ 'DE->DK1', ], 'DE->DK-DK2': [ 'DE->DK2'...
gpl-3.0
impowski/servo
tests/wpt/web-platform-tests/tools/py/py/_code/_assertionold.py
218
17863
import py import sys, inspect from compiler import parse, ast, pycodegen from py._code.assertion import BuiltinAssertionError, _format_explanation passthroughex = py.builtin._sysex class Failure: def __init__(self, node): self.exc, self.value, self.tb = sys.exc_info() self.node = node class View(...
mpl-2.0
DataDog/integrations-core
exchange_server/tests/common.py
1
7880
# (C) Datadog, Inc. 2010-present # All rights reserved # Licensed under Simplified BSD License (see LICENSE) MINIMAL_INSTANCE = {'host': '.'} CHECK_NAME = 'exchange_server' DATABASE_INSTANCES = [ 'Information Store/_Total', 'Information Store - Mailbox Database 1266275882/_Total', 'edgetransport/_Total', ...
bsd-3-clause
mcanthony/oiio
src/python/iconvert.py
9
9390
#!/usr/bin/env python # Parse the options the user provided from the command line def option_parser(): parser = OptionParser() parser.add_option("-v", action="store_true", dest="verbose", default=False) parser.add_option("--inplace", action="store_true", dest="inplace", default=False) parser.add_option(...
bsd-3-clause
UnrememberMe/pants
tests/python/pants_test/source/test_filespec.py
6
4202
# coding=utf-8 # Copyright 2017 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import (absolute_import, division, generators, nested_scopes, print_function, unicode_literals, with_statement) import re import uni...
apache-2.0
fengbaicanhe/intellij-community
python/lib/Lib/site-packages/django/contrib/localflavor/id/id_choices.py
439
3217
import warnings from django.utils.translation import ugettext_lazy as _ # Reference: http://id.wikipedia.org/wiki/Daftar_provinsi_Indonesia # Indonesia does not have an official Province code standard. # I decided to use unambiguous and consistent (some are common) 3-letter codes. warnings.warn( 'There have been...
apache-2.0
jnovinger/django
tests/backends/tests.py
59
47291
# -*- coding: utf-8 -*- # Unit and doctests for specific database backends. from __future__ import unicode_literals import copy import datetime import re import threading import unittest import warnings from decimal import Decimal, Rounded from django.conf import settings from django.core.exceptions import Improperly...
bsd-3-clause
gnuhub/intellij-community
python/helpers/profiler/thrift/TSCons.py
237
1267
# # 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
maximusmai/sqlalchemy-migrate
migrate/changeset/databases/oracle.py
140
3655
""" Oracle database specific implementations of changeset classes. """ import sqlalchemy as sa from sqlalchemy.databases import oracle as sa_base from migrate import exceptions from migrate.changeset import ansisql OracleSchemaGenerator = sa_base.OracleDDLCompiler class OracleColumnGenerator(OracleSchemaGenerat...
mit
Yhgenomics/dcos-cli
tests/test_jsonitem.py
1
4943
from dcos import jsonitem from dcos.errors import DCOSException import pytest @pytest.fixture(params=range(6)) def bad_object(request): return [ '{"key":value}', 'this is a string', '4.5', '4', 'true', '[1,2,3]', ][request.param] @pytest.fixture(params=range(...
apache-2.0
lz1988/company-site
django/contrib/comments/admin.py
96
3680
from __future__ import unicode_literals from django.contrib import admin from django.contrib.auth import get_user_model from django.contrib.comments.models import Comment from django.utils.translation import ugettext_lazy as _, ungettext from django.contrib.comments import get_model from django.contrib.comments.views....
bsd-3-clause
minhphung171093/GreenERP_V8
openerp/addons/fleet/__openerp__.py
267
2245
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU...
agpl-3.0
chriscate/python-sharepoint
sharepoint/site.py
2
1848
import functools from lxml import etree from six.moves.urllib.request import Request from six.moves.urllib.parse import urljoin from .lists import SharePointLists from .users import SharePointUsers from .xml import soap_body, namespaces, OUT class SharePointSite(object): def __init__(self, url, opener, timeout...
bsd-3-clause
axinging/sky_engine
mojo/python/tests/bindings_serialization_deserialization_unittest.py
9
3005
# 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 math import mojo_unittest # pylint: disable=E0611,F0401 import mojo_bindings.serialization as serialization import mojo_system # Generated files # ...
bsd-3-clause
Zen-CODE/kivy
kivy/input/providers/mouse.py
17
9957
''' Mouse provider implementation ============================= On linux systems, the mouse provider can be annoying when used with another multitouch provider (hidinput or mtdev). The Mouse can conflict with them: a single touch can generate one event from the mouse provider and another from the multitouch provider. ...
mit
fangxingli/hue
desktop/core/ext-py/tablib-0.10.0/test_tablib.py
29
20578
#!/usr/bin/env python # -*- coding: utf-8 -*- """Tests for Tablib.""" import json import unittest import sys import os import tablib from tablib.compat import markup, unicode, is_py3 class TablibTestCase(unittest.TestCase): """Tablib test cases.""" def setUp(self): """Create simple data set with ...
apache-2.0
spaceninja/mltshp
test/unit/external_relationship_tests.py
1
1114
from models import User, ExternalRelationship from base import BaseTestCase class ExternalRelationshipTests(BaseTestCase): def test_add_relationship(self): """ ExternalRelationship.add_relationship should correctly save a new entry. If a duplicate entry is passed in, no errors are thr...
mpl-2.0
danithaca/mxnet
example/neural-style/model_vgg19.py
16
5189
import find_mxnet import mxnet as mx import os, sys from collections import namedtuple ConvExecutor = namedtuple('ConvExecutor', ['executor', 'data', 'data_grad', 'style', 'content', 'arg_dict']) def get_symbol(): # declare symbol data = mx.sym.Variable("data") conv1_1 = mx.symbol.Convolution(name='conv1_...
apache-2.0
tntnatbry/tensorflow
tensorflow/contrib/distributions/python/ops/bijectors/exp_impl.py
107
2076
# 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
charlietrypsin/ATD_gui
unpickler.py
1
1282
import cPickle as pickle from os import listdir, walk import argparse parser = argparse.ArgumentParser(description='pull data from .txt files') parser.add_argument ('dataFn', help='Folder Name', action='store') args = parser.parse_args() dataFn = args.dataFn for dirpath, dirnames, filenames in walk(dataFn): # pri...
gpl-2.0
Orav/kbengine
kbe/src/lib/python/Lib/lib2to3/fixes/fix_ws_comma.py
5
1129
"""Fixer that changes 'a ,b' into 'a, b'. This also changes '{a :b}' into '{a: b}', but does not touch other uses of colons. It does not touch other uses of whitespace. """ from .. import pytree from ..pgen2 import token from .. import fixer_base class FixWsComma(fixer_base.BaseFix): explicit = T...
lgpl-3.0
tatsuhiro-t/grpc
src/python/src/grpc/framework/base/packets/interfaces.py
5
3105
# Copyright 2015, Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the f...
bsd-3-clause
Reddine/dzlibs
tweeza/items/forms.py
9
1931
# -*- coding: utf-8 -*- from flask.ext.wtf import Form from wtforms import TextField, TextAreaField, SubmitField, SelectField from wtforms.fields.html5 import URLField from flask.ext.babel import lazy_gettext as _ from flask_wtf.file import FileField class BaseForm(Form): """ this contains shared fields amon...
mpl-2.0
alexholehouse/SBMLIntegrator
libsbml-5.0.0/src/bindings/python/test/annotation/TestDate_newSetters.py
1
8745
# # @file TestDate_newSetters.py # @brief Date unit tests # # @author Akiya Jouraku (Python conversion) # @author Sarah Keating # # $Id: TestDate_newSetters.py 11531 2010-07-22 17:36:00Z mhucka $ # $HeadURL: https://sbml.svn.sourceforge.net/svnroot/sbml/trunk/libsbml/src/bindings/python/test/annotation/TestDate...
gpl-3.0
bengosney/romrescue.org
dogs/admin.py
1
4979
# Standard Library import json import os # Django from django.contrib import admin # Third Party from adminsortable2.admin import SortableAdminMixin, SortableInlineAdminMixin from image_cropping import ImageCroppingMixin # First Party from dogs import models from modulestatus.admin import statusAdmin from romrescue....
gpl-3.0
alerta/alerta-contrib
plugins/amqp/listener.py
1
1246
#!/usr/bin/env python from kombu import Connection, Exchange, Queue from kombu.mixins import ConsumerMixin AMQP_URL = 'mongodb://localhost:27017/kombu' AMQP_TOPIC = 'notify' class FanoutConsumer(ConsumerMixin): def __init__(self, conn): self.connection = conn self.channel = self.connection.chann...
mit
iemejia/beam
sdks/python/apache_beam/examples/snippets/transforms/elementwise/partition.py
5
4767
# coding=utf-8 # # 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");...
apache-2.0
tensorflow/tensorflow
tensorflow/python/kernel_tests/linalg/sparse/csr_sparse_matrix_test.py
14
10085
# Copyright 2019 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
xaviercobain88/framework-python
openerp/addons/base_report_designer/openerp_sxw2rml/openerp_sxw2rml.py
112
14182
# -*- coding: utf-8 -*- ############################################################################## # # Copyright (c): # # 2005 pyopenoffice.py Martin Simon (http://www.bezirksreiter.de) # 2005 Fabien Pinckaers, TINY SPRL. (http://tiny.be) # # This program is free software: you can redistribute it and/or ...
agpl-3.0
Schibum/naclports
build_tools/check_sums.py
1
1075
#!/usr/bin/env python # Copyright (c) 2013 The Native Client Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Tool which checks the sha1 sums of all packages. """ from __future__ import print_function import argparse import os impo...
bsd-3-clause
haeusser/tensorflow
tensorflow/contrib/tensor_forest/hybrid/python/models/k_feature_decisions_to_data_then_nn.py
189
1874
# 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
Bysmyyr/chromium-crosswalk
tools/telemetry/third_party/gsutilz/third_party/boto/boto/ec2/cloudwatch/dimension.py
152
1533
# Copyright (c) 2006-2012 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...
bsd-3-clause
SarahBA/b2share
b2share/modules/communities/signals.py
3
2085
# -*- coding: utf-8 -*- # # This file is part of EUDAT B2Share. # Copyright (C) 2016 University of Tuebingen, CERN. # Copyright (C) 2015 University of Tuebingen. # # B2Share 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...
gpl-2.0
Srisai85/scikit-learn
examples/covariance/plot_outlier_detection.py
235
3891
""" ========================================== Outlier detection with several methods. ========================================== When the amount of contamination is known, this example illustrates two different ways of performing :ref:`outlier_detection`: - based on a robust estimator of covariance, which is assumin...
bsd-3-clause
openstack/python-neutronclient
neutronclient/tests/unit/test_validators.py
13
4101
# 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 b...
apache-2.0
teanet/Nazabore
Script/archive.py
1
4184
#!/usr/bin/env python import os import logging import argparse import subprocess import hashlib logging.basicConfig(level=logging.INFO, format="%(asctime)s %(levelname)s %(message)s") script_dir = os.path.dirname(os.path.realpath(__file__)) root_dir = os.path.join(script_dir, "../") build_dir = os...
mit
doganaltunbay/odoo
setup/win32/win32_setup.py
363
1310
# -*- coding: utf-8 -*- import os import glob import py2exe from distutils.core import setup execfile(os.path.join(os.path.dirname(__file__), '..', '..', 'openerp', 'release.py')) def generate_files(): actions = { 'start': ['stop', 'start'], 'stop': ['stop'], } files = [] if os.nam...
agpl-3.0
Jenselme/servo
tests/wpt/web-platform-tests/tools/html5lib/html5lib/treewalkers/pulldom.py
1729
2302
from __future__ import absolute_import, division, unicode_literals from xml.dom.pulldom import START_ELEMENT, END_ELEMENT, \ COMMENT, IGNORABLE_WHITESPACE, CHARACTERS from . import _base from ..constants import voidElements class TreeWalker(_base.TreeWalker): def __iter__(self): ignore_until = None...
mpl-2.0
kwlzn/pants
src/python/pants/backend/jvm/tasks/classpath_products.py
8
13071
# coding=utf-8 # Copyright 2015 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import (absolute_import, division, generators, nested_scopes, print_function, unicode_literals, with_statement) import os from twit...
apache-2.0
mtndesign/mtnvim
myvim/bundle/ropevim/ftplugin/python/libs/rope/refactor/importutils/__init__.py
90
12748
"""A package for handling imports This package provides tools for modifying module imports after refactorings or as a separate task. """ import rope.base.evaluate from rope.base.change import ChangeSet, ChangeContents from rope.refactor import occurrences, rename from rope.refactor.importutils import module_imports, ...
gpl-2.0
HyperBaton/ansible
test/units/modules/network/check_point/test_cp_mgmt_publish.py
19
2400
# Ansible module to manage CheckPoint Firewall (c) 2019 # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Ansible is dist...
gpl-3.0
lavvy/osmc
package/mediacenter-skin-osmc/files/usr/share/kodi/addons/script.module.unidecode/lib/unidecode/x09a.py
253
4623
data = ( 'E ', # 0x00 'Cheng ', # 0x01 'Xin ', # 0x02 'Ai ', # 0x03 'Lu ', # 0x04 'Zhui ', # 0x05 'Zhou ', # 0x06 'She ', # 0x07 'Pian ', # 0x08 'Kun ', # 0x09 'Tao ', # 0x0a 'Lai ', # 0x0b 'Zong ', # 0x0c 'Ke ', # 0x0d 'Qi ', # 0x0e 'Qi ', # 0x0f 'Yan ', # 0x10 'Fei '...
gpl-2.0
synicalsyntax/zulip
zproject/dev_settings.py
1
6926
import os import pwd from typing import Optional, Set, Tuple from six.moves.urllib.parse import SplitResult ZULIP_ADMINISTRATOR = "desdemona+admin@zulip.com" # We want LOCAL_UPLOADS_DIR to be an absolute path so that code can # chdir without having problems accessing it. Unfortunately, this # means we need a duplic...
apache-2.0
tobyhodges/timers
browsertimer.py
2
8025
#! /usr/bin/env python ''' A script to create a simple, browser-based countdown timer. usage: python browsertimer.py ''' # Imports from bokeh.layouts import column, row from bokeh import plotting as bkplt from bokeh.models import ColumnDataSource, Button, Slider, CustomJS # Set default/starting values default_minutes...
mit
SpaceKatt/CSPLN
apps/scaffolding/mac/web2py/web2py.app/Contents/Resources/gluon/contrib/gae_retry.py
43
3653
def autoretry_datastore_timeouts(attempts=5.0, interval=0.1, exponent=2.0): """ Copyright (C) 2009 twitter.com/rcb 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 ...
gpl-3.0
pabloborrego93/edx-platform
openedx/core/djangoapps/service_status/views.py
11
1336
""" Django Views for service status app """ import json import time from django.http import HttpResponse from dogapi import dog_stats_api from djcelery import celery from celery.exceptions import TimeoutError from openedx.core.djangoapps.service_status.tasks import delayed_ping def index(_): """ An empty...
agpl-3.0
petrutlucian94/nova_dev
nova/filters.py
21
3305
# Copyright (c) 2011-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 # # Un...
apache-2.0
openwrt-es/linux
scripts/checkkconfigsymbols.py
345
15854
#!/usr/bin/env python3 # SPDX-License-Identifier: GPL-2.0-only """Find Kconfig symbols that are referenced but not defined.""" # (c) 2014-2017 Valentin Rothberg <valentinrothberg@gmail.com> # (c) 2014 Stefan Hengelein <stefan.hengelein@fau.de> # import argparse import difflib import os import re import signal impor...
gpl-2.0
nanditav/15712-TensorFlow
tensorflow/python/training/proximal_adagrad_test.py
12
7941
# 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
DataDog/integrations-core
tokumx/datadog_checks/tokumx/vendor/bson/son.py
1
8713
# Copyright 2009-2015 MongoDB, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writin...
bsd-3-clause
sdague/home-assistant
homeassistant/components/zha/core/channels/lighting.py
2
4177
"""Lighting channels module for Zigbee Home Automation.""" from typing import Optional import zigpy.zcl.clusters.lighting as lighting from .. import registries, typing as zha_typing from ..const import REPORT_CONFIG_DEFAULT from .base import ClientChannel, ZigbeeChannel @registries.ZIGBEE_CHANNEL_REGISTRY.register(...
apache-2.0
jperon/musite_old
lib/cherrypy/_cpserver.py
58
8275
"""Manage HTTP servers with CherryPy.""" import warnings import cherrypy from cherrypy.lib import attributes from cherrypy._cpcompat import basestring, py3k # We import * because we want to export check_port # et al as attributes of this module. from cherrypy.process.servers import * class Server(ServerAdapter): ...
gpl-3.0
Contraz/demosys-py
demosys/geometry/points.py
1
1066
import random import numpy import moderngl from demosys.opengl.vao import VAO def points_random_3d(count, range_x=(-10.0, 10.0), range_y=(-10.0, 10.0), range_z=(-10.0, 10.0), seed=None) -> VAO: """ Generates random positions inside a confied box. Args: count (int): Number of points to generate ...
isc
UdS-TelecommunicationsLab/SDNalytics
sdnalyzer/analyzer/topology.py
1
2673
# The MIT License (MIT) # # Copyright (c) 2015 Saarland University # # 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, c...
mit
hsaputra/tensorflow
tensorflow/python/estimator/model_fn.py
21
12770
# 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
jjs0sbw/CSPLN
apps/scaffolding/win/web2py/gluon/contrib/pyrtf/PropertySets.py
43
14016
""" PropertySets group common attributes together, each property set is used to control a specific part of the rendering. PropertySets can be used in different elements of the document. For example the FramePropertySet is used in paragraphs, tables, cells, etc. The TextPropertySet can be used for text or in a Paragr...
gpl-3.0