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
tscohen/chainer
tests/chainer_tests/functions_tests/array_tests/test_reshape.py
4
1252
import unittest import numpy import chainer from chainer import cuda from chainer import functions from chainer import testing from chainer.testing import attr class TestReshape(unittest.TestCase): out_shape = (2, 2, 6) def setUp(self): self.x = numpy.random.uniform(-1, 1, (4, 3, 2)).astype(numpy.f...
mit
rickerc/ceilometer_audit
ceilometer/storage/sqlalchemy/models.py
2
11448
# -*- encoding: utf-8 -*- # # Author: John Tran <jhtran@att.com> # # 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 app...
apache-2.0
giorgiop/scipy
scipy/ndimage/morphology.py
76
80032
# Copyright (C) 2003-2005 Peter J. Verveer # # 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 conditions and the following d...
bsd-3-clause
lsdlab/awesome_coffice
coffice/migrations/0001_initial.py
1
2228
# -*- coding: utf-8 -*- # Generated by Django 1.11 on 2017-04-29 03:15 from __future__ import unicode_literals from django.db import migrations, models import django.utils.timezone class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.CreateMode...
mit
shodoco/bcc
src/cc/frontends/p4/compiler/ebpfStructType.py
7
4426
# Copyright (c) Barefoot Networks, Inc. # Licensed under the Apache License, Version 2.0 (the "License") from p4_hlir.hlir import P4_SIGNED, P4_SATURATING from ebpfScalarType import * class EbpfField(object): __doc__ = "represents a field in a struct type, not in an instance" def __init__(self, hlirParentTy...
apache-2.0
jbedorf/tensorflow
tensorflow/tools/gcs_test/python/gcs_smoke.py
63
10316
# 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
caphrim007/ansible
lib/ansible/modules/monitoring/pagerduty.py
20
8404
#!/usr/bin/python # -*- coding: utf-8 -*- # # 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', ...
gpl-3.0
jeffrey4l/nova
nova/i18n.py
86
1342
# Copyright 2014 IBM Corp. # # 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, s...
apache-2.0
mosbasik/buzhug
javasrc/lib/Jython/Lib/aifc.py
91
33417
"""Stuff to parse AIFF-C and AIFF files. Unless explicitly stated otherwise, the description below is true both for AIFF-C files and AIFF files. An AIFF-C file has the following structure. +-----------------+ | FORM | +-----------------+ | <size> | +----+------------+ | | AIFC ...
bsd-3-clause
SGenheden/Scripts
Projects/Solvation/create_smiles_list.py
1
1273
# Author: Samuel Genheden samuel.genheden@gmail.com """ Program to list the SMILES string for each solute in a list """ import argparse import os from chemspipy import ChemSpider import dblib if __name__ == '__main__': argparser = argparse.ArgumentParser(description="Script to list SMILES for a solutes in a l...
mit
perovic/root
interpreter/llvm/src/tools/clang/www/builtins.py
99
6633
#!/usr/bin/env python import sys, fileinput err=0 # Giant associative set of builtin->intrinsic mappings where clang doesn't # implement the builtin since the vector operation works by default. repl_map = { '__builtin_ia32_addps': '_mm_add_ps', '__builtin_ia32_addsd': '_mm_add_sd', '__builtin_ia32_addpd': '_mm_add_...
lgpl-2.1
chongtianfeiyu/kbengine
kbe/res/scripts/common/Lib/fileinput.py
78
14570
"""Helper class to quickly write a loop over all standard input files. Typical use is: import fileinput for line in fileinput.input(): process(line) This iterates over the lines of all files listed in sys.argv[1:], defaulting to sys.stdin if the list is empty. If a filename is '-' it is also replace...
lgpl-3.0
kspviswa/personfinder
tests/server_test_cases/download_feed_tests.py
8
2881
#!/usr/bin/python2.7 # encoding: utf-8 # 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 ...
apache-2.0
bflaven/BlogArticlesExamples
extending_streamlit_usage/001_nlp_spacy_python_realp/022_nlp_spacy_python.py
1
1907
#!/usr/bin/python # -*- coding: utf-8 -*- """ [path] cd /Users/brunoflaven/Documents/01_work/blog_articles/extending_streamlit_usage/001_nlp_spacy_python_realp/ [file] python 022_nlp_spacy_python.py # source Source: https://realpython.com/natural-language-processing-spacy-python/ # required pip install textacy ...
mit
PythonCharmers/python-future
src/future/builtins/newround.py
1
3190
""" ``python-future``: pure Python implementation of Python 3 round(). """ from __future__ import division from future.utils import PYPY, PY26, bind_method # Use the decimal module for simplicity of implementation (and # hopefully correctness). from decimal import Decimal, ROUND_HALF_EVEN def newround(number, ndigi...
mit
aswadrangnekar/khandelwal
app/lib/docutils/languages/es.py
148
1962
# -*- coding: utf-8 -*- # $Id: es.py 4572 2006-05-25 20:48:37Z richieadler $ # Author: Marcelo Huerta San Martín <richieadler@users.sourceforge.net> # Copyright: This module has been placed in the public domain. # New language mappings are welcome. Before doing a new translation, please # read <http://docutils.sf.net...
mit
alex8866/cinder
cinder/volume/drivers/smbfs.py
4
24645
# Copyright (c) 2014 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.apache.org/licenses/LICENSE-2.0 # # Unle...
apache-2.0
DirkHoffmann/indico
indico/migrations/versions/20210219_1555_da06d8f50342_separate_authorized_scopes_from_tokens.py
4
3691
"""Separate authorized scopes from tokens Revision ID: da06d8f50342 Revises: 3782de7970da Create Date: 2021-02-19 15:55:53.134744 """ import sqlalchemy as sa from alembic import op from sqlalchemy.dialects import postgresql # revision identifiers, used by Alembic. revision = 'da06d8f50342' down_revision = '3782de79...
gpl-3.0
WoLpH/EventGhost
eg/Classes/IrDecoder/Universal.py
1
2724
# -*- coding: utf-8 -*- # # This file is part of EventGhost. # Copyright © 2005-2016 EventGhost Project <http://www.eventghost.net/> # # EventGhost 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 versio...
gpl-2.0
davidzchen/tensorflow
tensorflow/python/grappler/datasets_test.py
23
15299
# 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
cul-it/Invenio
modules/bibknowledge/lib/bibknowledge_unit_tests.py
14
1317
# -*- coding: utf-8 -*- ## ## This file is part of Invenio. ## Copyright (C) 2009, 2010, 2011 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 yo...
gpl-2.0
Lessig2016/pledgeservice
lib/validictory/tests/test_items.py
34
4555
from unittest import TestCase import validictory class TestItems(TestCase): schema1 = { "type": "array", "items": {"type": "string"} } schema2 = { "type": "array", "items": [{"type": "integer"}, {"type": "string"}, {"type": "boolean"}] } schema3 = { "type...
agpl-3.0
ashishfinoit/django-rest-framework
rest_framework/utils/encoders.py
88
2310
""" Helper classes for parsers. """ from __future__ import unicode_literals import datetime import decimal import json import uuid from django.db.models.query import QuerySet from django.utils import six, timezone from django.utils.encoding import force_text from django.utils.functional import Promise from rest_fram...
bsd-2-clause
hanlind/nova
nova/tests/unit/network/test_config.py
8
1972
# Copyright 2016 HPE, 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 writing, sof...
apache-2.0
INNUENDOCON/INNUca
src/SPAdes-3.9.0-Linux/share/spades/spades_pipeline/truspades/break_by_coverage.py
12
5677
#! /usr/bin/env python ############################################################################ # Copyright (c) 2015 Saint Petersburg State University # All Rights Reserved # See file LICENSE for details. ############################################################################ import SeqIO from SeqIO import ...
gpl-3.0
btallman/incubator-airflow
airflow/api/common/experimental/trigger_dag.py
2
1607
# -*- 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
willharris/django
django/conf/__init__.py
40
7040
""" Settings and configuration for Django. Values will be read from the module specified by the DJANGO_SETTINGS_MODULE environment variable, and then from django.conf.global_settings; see the global settings file for a list of all possible variables. """ import importlib import os import time # Needed for Windows...
bsd-3-clause
Datera/targetcli
targetcli/ui_node.py
1
10550
''' Implements the targetcli base UI node. This file is part of LIO(tm). Copyright (c) 2011-2014 by Datera, 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/L...
apache-2.0
li-xirong/jingwei
model_based/negative_bagging.py
1
6035
import sys import os import time from basic.constant import ROOT_PATH from basic.common import makedirsforfile,checkToSkip,printStatus from basic.annotationtable import readConcepts,readAnnotationsFrom, writeConceptsTo from util.simpleknn.bigfile import BigFile from svms.mlengine_const import * from svms.fiksvm.trai...
mit
xuleiboy1234/autoTitle
tensorflow/tensorflow/contrib/tpu/profiler/pip_package/setup.py
4
2053
# 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...
mit
ssls/beetle-agent
app/modules/apps/models.py
1
1540
# encoding: utf-8 """ Database models -------------------- """ from sqlalchemy_utils import Timestamp from app.extensions import db from app.modules.vcloud.models import JsonEncoder class App(db.Model, Timestamp, JsonEncoder): """ database model. """ app_id = db.Column(db.String(64), primary_key=True) z...
mit
r3tard/BartusBot
lib/oauth2client/xsrfutil.py
14
3583
# # Copyright 2014 the Melange 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 ...
apache-2.0
coreos/autotest
cli/job.py
1
29722
# # Copyright 2008 Google Inc. All Rights Reserved. """ The job module contains the objects and methods used to manage jobs in Autotest. The valid actions are: list: lists job(s) create: create a job abort: abort job(s) stat: detailed listing of job(s) The common options are: See topic_common.py for a High...
gpl-2.0
tetsu31415/farecal
faretable/special_area.py
1
1708
# coding: utf-8 "電車特定区間の運賃計算" import fare import utils class SpecialArea(fare.Fare): """電車特定区間の運賃""" @classmethod def multiply_fare_rate(cls, c_d): # 旅客営業規則 第78条 第2号 # 1kmから300kmまで fare = min(c_d, 3000) * 1530 if c_d > 3000: # 301kmから600kmまで fare += min(c_d - 3000, 3000) * 1215 return fare class L...
mit
mgedmin/objgraph
tests.py
1
24371
#!/usr/bin/python import doctest import gc import glob import os import re import shutil import string import sys import tempfile import textwrap import types import unittest # setuptools imports `imp`, which triggers a DeprecationWarning starting with # Python 3.4 in the middle of my pristine test suite. But if I do...
mit
halober/ovirt-engine
packaging/setup/plugins/ovirt-engine-setup/base/system/environment.py
3
1748
# # ovirt-engine-setup -- ovirt engine setup # Copyright (C) 2013 Red Hat, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless r...
apache-2.0
LagrangianPoint/Directory-MD5-Compare-Python
compare-md5-files.py
1
1458
#!/usr/bin/python import os import sys import re import cPickle from pprint import pprint if len(sys.argv) < 3: print "ERROR: You need to send two files as parameters" sys.exit(1) strFileA = sys.argv[1] strFileB = sys.argv[2] dictData = {} strRegex = '([a-z0-9]{32})\s+(.*)' ### Analyzing file A fh = open(strF...
mit
raptorjr/xbmc
lib/gtest/scripts/upload_gtest.py
1963
2851
#!/usr/bin/env python # # Copyright 2009, Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list...
gpl-2.0
michaelgallacher/intellij-community
python/lib/Lib/httplib.py
91
47249
"""HTTP/1.1 client library <intro stuff goes here> <other stuff, too> HTTPConnection goes through a number of "states", which define when a client may legally make another request or fetch the response for a particular request. This diagram details these state transitions: (null) | | HTTPConnection()...
apache-2.0
mkeilman/sirepo
sirepo/cookie.py
2
6759
# -*- coding: utf-8 -*- u"""User state management via an HTTP cookie :copyright: Copyright (c) 2015 RadiaSoft LLC. All Rights Reserved. :license: http://www.apache.org/licenses/LICENSE-2.0.html """ from __future__ import absolute_import, division, print_function from pykern import pkcompat from pykern import pkconfig...
apache-2.0
muminoff/fabric-bolt
src/fabric_bolt/projects/migrations/0021_auto__add_field_task_description.py
18
9740
# -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding field 'Task.description' db.add_column(u'projects_task', 'description', self....
mit
puilp0502/python-webnoti
webnoti/encryption.py
1
5057
from base64 import urlsafe_b64encode as b64encode import os from cryptography.hazmat.backends import default_backend from cryptography.hazmat.primitives.asymmetric import ec from cryptography.hazmat.primitives import hashes from cryptography.hazmat.primitives.ciphers import Cipher, algorithms, modes from cryptography....
mit
fjammes/scisql
bin/scisql-deploy.py
1
8242
#!/usr/bin/env python import argparse import fileinput import getpass import glob import logging import os import shutil import stat from scisql import configure from scisql import const from scisql import utils import sys import tempfile import time def parse_args(): parser = argparse.ArgumentParser( ...
apache-2.0
AkA84/edx-platform
lms/djangoapps/verify_student/migrations/0005_auto__add_incoursereverificationconfiguration.py
92
9300
# -*- coding: utf-8 -*- from south.utils import datetime_utils as datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding model 'InCourseReverificationConfiguration' db.create_table('ver...
agpl-3.0
haroon-sheikh/django-dynamic-preferences
dynamic_preferences/forms.py
1
4842
from six import string_types from django import forms from django.core.exceptions import ValidationError from collections import OrderedDict from .registries import global_preferences_registry from .models import GlobalPreferenceModel from .exceptions import NotFoundInRegistry class AbstractSinglePreferenceForm(form...
bsd-3-clause
Tanganelli/CoAPthon
coapreverseproxy.py
4
1391
#!/usr/bin/env python import getopt import sys from coapthon.reverse_proxy.coap import CoAP __author__ = 'Giacomo Tanganelli' class CoAPReverseProxy(CoAP): def __init__(self, host, port, xml_file, multicast=False, cache=False, starting_mid=None): CoAP.__init__(self, (host, port), xml_file=xml_file, mult...
mit
dhamaniasad/mythbox
resources/lib/elementtree/elementtree/ElementTree.py
128
40886
# # ElementTree # $Id: ElementTree.py 2326 2005-03-17 07:45:21Z fredrik $ # # light-weight XML support for Python 1.5.2 and later. # # history: # 2001-10-20 fl created (from various sources) # 2001-11-01 fl return root from parse method # 2002-02-16 fl sort attributes in lexical order # 2002-04-06 fl TreeBuilde...
gpl-2.0
gavin-feng/odoo
addons/account/report/account_financial_report.py
380
6365
############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public L...
agpl-3.0
markfasheh/ocfs2-test
programs/splice/splice_test.py
2
5470
#!/usr/bin/env python # # * vim: noexpandtab sw=8 ts=8 sts=0: # * # * splice_test.py # * # * Test splice on ocfs2. # * # * Copyright (C) 2004, 2008 Oracle. All rights reserved. # * # * This program is free software; you can redistribute it and/or # * modify it under the terms of the GNU General Public # * License vers...
gpl-2.0
Charlotte-Morgan/inasafe
safe/gis/raster/reclassify.py
6
5117
# coding=utf-8 """Reclassify a raster layer.""" from os.path import isfile import numpy as np from osgeo import gdal from qgis.core import QgsRasterLayer from safe.common.exceptions import ( FileNotFoundError, InvalidKeywordsForProcessingAlgorithm) from safe.common.utilities import unique_filename, temp_dir fro...
gpl-3.0
ravibhure/ansible
contrib/inventory/nova.py
109
7029
#!/usr/bin/env python # (c) 2012, Marco Vito Moscaritolo <marco@agavee.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
vmindru/ansible
lib/ansible/modules/cloud/centurylink/clc_alert_policy.py
47
17609
#!/usr/bin/python # # Copyright (c) 2015 CenturyLink # 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': ['previ...
gpl-3.0
MartinHjelmare/home-assistant
homeassistant/components/blink/sensor.py
7
2330
"""Support for Blink system camera sensors.""" import logging from homeassistant.const import CONF_MONITORED_CONDITIONS from homeassistant.helpers.entity import Entity from . import BLINK_DATA, SENSORS _LOGGER = logging.getLogger(__name__) def setup_platform(hass, config, add_entities, discovery_info=None): ""...
apache-2.0
ibis-project/ibis
ibis/backends/mysql/registry.py
1
7628
import pandas as pd import sqlalchemy as sa import ibis import ibis.common.exceptions as com import ibis.expr.datatypes as dt import ibis.expr.operations as ops import ibis.expr.types as ir from ibis.backends.base.sql.alchemy import ( fixed_arity, infix_op, reduction, sqlalchemy_operation_registry, ...
apache-2.0
mdeemer/XlsxWriter
xlsxwriter/test/comparison/test_chart_data_labels20.py
8
1648
############################################################################### # # Tests for XlsxWriter. # # Copyright (c), 2013-2015, John McNamara, jmcnamara@cpan.org # from ..excel_comparsion_test import ExcelComparisonTest from ...workbook import Workbook class TestCompareXLSXFiles(ExcelComparisonTest): """...
bsd-2-clause
G4m4/chartreuse
scripts/window.py
1
1851
#!/usr/bin/env python ''' @file window.py @brief Sandbox for window application tests @author gm @copyright gm 2014 This file is part of Chartreuse Chartreuse 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, eith...
gpl-3.0
debugger06/MiroX
tv/lib/libdaap/__init__.py
4
1567
# pydaap - a Python-based daap media sharing library # Copyright (C) 2010 Participatory Culture Foundation # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or #...
gpl-2.0
lazybios/youtube-dl
devscripts/transition_helper_exe/youtube-dl.py
14
3764
#!/usr/bin/env python import sys, os import urllib2 import json, hashlib def rsa_verify(message, signature, key): from struct import pack from hashlib import sha256 from sys import version_info def b(x): if version_info[0] == 2: return x else: return x.encode('latin1') assert(type(...
unlicense
sahitya-pavurala/luigi
luigi/task_register.py
56
7529
# -*- coding: utf-8 -*- # # Copyright 2012-2015 Spotify AB # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law...
apache-2.0
intgr/django-cms
cms/migrations/0001_initial.py
15
30501
# -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models try: from django.contrib.auth import get_user_model except ImportError: # django < 1.5 from django.contrib.auth.models import User else: User = get_user_model() user_orm_label...
bsd-3-clause
brentjens/pyautoplot
test/testutilities.py
1
2159
import unittest import sys from numpy import array, NaN from pyautoplot.utilities import * class UtilitiesTest(unittest.TestCase): def test_is_list(self): self.assertFalse(is_list(array([]))) self.assertFalse(is_list(10)) self.assertTrue(is_list([])) self.assertTrue(is_list([10, 'bo...
gpl-3.0
grani/grpc
tools/run_tests/start_port_server.py
2
1951
#!/usr/bin/env python # Copyright 2017, Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list ...
bsd-3-clause
gliblr/research
modgali.py
1
3573
#import sys #arg = sys.argv[1] #print arg # #print '***************************************' #print ' Solvation Free Energy Calculator' #print '***************************************' inputpdb = "FBSADIMERWIONTEST.pdb" input = open(inputpdb, "r") PDBArray = [] SASArray = [] for line in input: inpieces = line.s...
gpl-2.0
normtown/SickRage
sickbeard/providers/womble.py
7
2411
# Author: Nic Wolfe <nic@wolfeden.ca> # URL: http://code.google.com/p/sickbeard/ # # This file is part of SickRage. # # SickRage is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License,...
gpl-3.0
parag2489/DeepNetworkPruning
pytorch-pruning-master/finetune_2.py
1
10808
import torch from torch.autograd import Variable from torchvision import models, utils import sys import numpy as np import torchvision import torch.nn as nn import torch.nn.functional as F import torch.optim as optim import dataset from prune import * import argparse from operator import itemgetter from heapq import n...
mit
chronium/ChronoScript
ScriptingLanguage/Parser/Parser.py
1
3774
from ScriptingLanguage.Parser.AstNodes.FunctionNodes import FunctionNode from ScriptingLanguage.Parser.AstNodes.ProgramNodes import Program, BodyNode from ScriptingLanguage.Parser.ParsableTokenStream import ParsableTokenStream, DifferentTokenException, FailedCapture from ScriptingLanguage.Parser.parsers.Assignment impo...
gpl-2.0
travisjwarren/train_track
train_track/tests/test_base_template_navigation_links.py
1
3617
__author__ = 'traviswarren' from django.test import TestCase from django.core.urlresolvers import reverse from django.contrib.auth.models import User class AuthenticationLinksTestCases(TestCase): def test_public_nav_links(self): user = User.objects.create_user( username='user', em...
gpl-3.0
dulems/hue
desktop/core/ext-py/tablib-develop/tablib/packages/xlwt/ExcelFormulaLexer.py
69
4205
# -*- coding: windows-1252 -*- import sys from antlr import EOF, CommonToken as Tok, TokenStream, TokenStreamException import struct import ExcelFormulaParser from re import compile as recompile, match, LOCALE, UNICODE, IGNORECASE, VERBOSE int_const_pattern = r"\d+\b" flt_const_pattern = r""" (?: (?: \d*...
apache-2.0
holtgrewe/pyhtslib
tests/test_bam_header.py
1
3049
#!/usr/bin/env python """Tests for module pyhtslib.bam This file contains tests for the header-related code. """ # TODO(holtgrewe): tests for CRAM from collections import OrderedDict # for brevity import pyhtslib.bam as bam from tests.bam_fixtures import * # NOQA __author__ = 'Manuel Holtgrewe <manuel.holtgrewe...
bsd-3-clause
johnparker007/mame
3rdparty/bgfx/3rdparty/spirv-tools/utils/generate_registry_tables.py
30
2607
#!/usr/bin/env python # Copyright (c) 2016 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 ...
gpl-2.0
sebmarchand/syzygy
syzygy/build/gitdeps_test.py
3
10476
# Copyright 2014 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
apache-2.0
linjeffrey/phantomjs
src/qt/qtwebkit/Tools/Scripts/webkitpy/common/net/statusserver_unittest.py
124
2214
# 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
persandstrom/home-assistant
homeassistant/components/notify/knx.py
9
3009
""" KNX/IP notification service. For more details about this platform, please refer to the documentation https://home-assistant.io/components/notify.knx/ """ import voluptuous as vol from homeassistant.components.knx import DATA_KNX, ATTR_DISCOVER_DEVICES from homeassistant.components.notify import PLATFORM_SCHEMA, ...
apache-2.0
prometheanfire/portage
pym/_emerge/EbuildMetadataPhase.py
11
6658
# Copyright 1999-2013 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 from _emerge.SubProcess import SubProcess import sys from portage.cache.mappings import slot_dict_class import portage portage.proxy.lazyimport.lazyimport(globals(), 'portage.package.ebuild._metadata_invalid:eap...
gpl-2.0
andris210296/andris-projeto
backend/venv/lib/python2.7/site-packages/pip/_vendor/requests/packages/charade/langbulgarianmodel.py
2965
12784
######################## 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
hj3938/zulip
zerver/storage.py
120
1787
from __future__ import absolute_import from django.conf import settings from django.contrib.staticfiles.storage import CachedFilesMixin, StaticFilesStorage from pipeline.storage import PipelineMixin class AddHeaderMixin(object): def post_process(self, paths, dry_run=False, **kwargs): if dry_run: ...
apache-2.0
dxc/people_finder_chile
app/recaptcha/client/mailhide.py
40
2253
import base64 import cgi try: from Crypto.Cipher import AES except: raise Exception ("You need the pycrpyto library: http://cheeseshop.python.org/pypi/pycrypto/") MAIL_HIDE_BASE="http://mailhide.recaptcha.net" def asurl (email, public_key, private_key): """Wraps an email...
apache-2.0
petr-s/cleaREST
setup.py
1
1166
from setuptools import setup, find_packages import clearest def parse_requirements(): with open("requirements.txt") as f: return [line for line in f if not line.startswith("#")] setup( name="cleaREST", version=clearest.__version__, author=clearest.__author__, author_email=clearest.__cont...
mit
gtest-org/test12
jenkins_jobs/modules/scm.py
6
21495
# Copyright 2012 Hewlett-Packard Development Company, L.P. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law...
apache-2.0
hahshsj/support-tools
googlecode-issues-exporter/github_issue_converter.py
90
4057
# Copyright 2013 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
apache-2.0
fortunaFiWn/android_kernel_samsung_fortuna
tools/perf/scripts/python/netdev-times.py
11271
15048
# Display a process of packets and processed time. # It helps us to investigate networking or network device. # # options # tx: show only tx chart # rx: show only rx chart # dev=: show only thing related to specified device # debug: work with debug mode. It shows buffer status. import os import sys sys.path.append(os...
gpl-2.0
SU-ECE-17-7/hotspotter
hsgui/_frontend/MainSkelECE1772.py
1
24142
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'MainSkel.ui' # # Created by: PyQt4 UI code generator 4.11.4 # # WARNING! All changes made in this file will be lost! from PyQt4 import QtCore, QtGui try: _fromUtf8 = QtCore.QString.fromUtf8 except AttributeError: def _fromUtf8(s): ...
apache-2.0
tiagofrepereira2012/tensorflow
tensorflow/contrib/data/python/kernel_tests/map_dataset_op_test.py
3
16797
# 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
hehongyu1995/Dxf2GCode
dxf2gcode_images4_rc.py
1
613253
# -*- coding: utf-8 -*- # Resource object code # # Created: mar. oct. 27 02:25:46 2015 # by: The Resource Compiler for PyQt (Qt v4.8.4) # # WARNING! All changes made in this file will be lost! from PyQt4 import QtCore qt_resource_data = "\ \x00\x00\x03\x50\ \x89\ \x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d\x49...
gpl-3.0
google-code-export/exposong
lib/exposong/preslist.py
3
14555
# # vim: ts=4 sw=4 expandtab ai: # # Copyright (C) 2008-2011 Exposong.org # # ExpoSong 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. #...
gpl-3.0
timoschwarzer/blendworks
BlendWorks Server/python/Lib/idlelib/idle_test/test_grep.py
93
2671
""" !Changing this line will break Test_findfile.test_found! Non-gui unit tests for idlelib.GrepDialog methods. dummy_command calls grep_it calls findfiles. An exception raised in one method will fail callers. Otherwise, tests are mostly independent. *** Currently only test grep_it. """ import unittest from test.suppor...
gpl-2.0
szilvajuhos/CAW
scripts/zenodo_upload.py
2
3216
#!/usr/bin/env python # some part are shamelessly stolen from https://github.com/darvasd/upload-to-zenodo import os import requests import click import json import codecs # global static header headers = {"Content-Type": "application/json"} @click.command(context_settings = dict( help_option_names = ['-h', '--help']...
mit
dancingdan/tensorflow
tensorflow/examples/learn/iris_custom_decay_dnn.py
43
3572
# 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 appl...
apache-2.0
ed-/solum
solum/objects/sqlalchemy/execution.py
5
1303
# Copyright 2014 - Rackspace Hosting # # 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
andybak/ansible-modules-extras
monitoring/librato_annotation.py
138
5556
#!/usr/bin/python # -*- coding: utf-8 -*- # # (C) Seth Edwards, 2014 # # 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 ...
gpl-3.0
dudonwai/dudonsblog
Lib/site-packages/gunicorn/workers/gtornado.py
45
3901
# -*- coding: utf-8 - # # This file is part of gunicorn released under the MIT license. # See the NOTICE for more information. import os import sys try: import tornado.web except ImportError: raise RuntimeError("You need tornado installed to use this worker.") import tornado.httpserver from tornado.ioloop imp...
mit
chaowyc/youtube-dl
youtube_dl/extractor/espn.py
106
1940
from __future__ import unicode_literals from .common import InfoExtractor class ESPNIE(InfoExtractor): _VALID_URL = r'https?://espn\.go\.com/(?:[^/]+/)*(?P<id>[^/]+)' _WORKING = False _TESTS = [{ 'url': 'http://espn.go.com/video/clip?id=10365079', 'info_dict': { 'id': 'FkYWtma...
unlicense
pforret/python-for-android
python-modules/twisted/twisted/trial/itrial.py
61
6560
# Copyright (c) 2001-2008 Twisted Matrix Laboratories. # See LICENSE for details. """ Interfaces for Trial. Maintainer: Jonathan Lange """ import zope.interface as zi from zope.interface import Attribute class ITestCase(zi.Interface): """ The interface that a test case must implement in order to be used in...
apache-2.0
endolith/numpy
numpy/f2py/auxfuncs.py
8
21753
#!/usr/bin/env python3 """ Auxiliary functions for f2py2e. Copyright 1999,2000 Pearu Peterson all rights reserved, Pearu Peterson <pearu@ioc.ee> Permission to use, modify, and distribute this software is given under the terms of the NumPy (BSD style) LICENSE. NO WARRANTY IS EXPRESSED OR IMPLIED. USE AT YOUR OWN RI...
bsd-3-clause
yzl0083/orange
Orange/OrangeCanvas/gui/tests/test_stackedwidget.py
16
2216
""" Test for StackedWidget """ from PyQt4.QtGui import QWidget, QLabel, QGroupBox, QListView, QVBoxLayout from .. import test from .. import stackedwidget class TestStackedWidget(test.QAppTestCase): def test(self): window = QWidget() layout = QVBoxLayout() window.setLayout(layout) ...
gpl-3.0
domob1812/huntercore
test/util/rpcauth-test.py
4
1731
#!/usr/bin/env python3 # Copyright (c) 2015-2018 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 share/rpcauth/rpcauth.py """ import base64 import configparser import hmac import importlib import...
mit
zrisher/webapp-public
webapp/apps/taxbrain/migrations/0003_auto_20150518_1146.py
4
5003
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations import webapp.apps.taxbrain.models class Migration(migrations.Migration): dependencies = [ ('taxbrain', '0002_taxsaveinputs_creation_date'), ] operations = [ migrations.AddField( ...
mit
samuelhavron/heroku-buildpack-python
vendor/pip-pop/pip/commands/install.py
187
14659
from __future__ import absolute_import import logging import operator import os import tempfile import shutil import warnings try: import wheel except ImportError: wheel = None from pip.req import RequirementSet from pip.basecommand import RequirementCommand from pip.locations import virtualenv_no_global, dis...
mit
catroot/rethinkdb
test/common/http_support/werkzeug/contrib/sessions.py
295
12450
# -*- coding: utf-8 -*- r""" werkzeug.contrib.sessions ~~~~~~~~~~~~~~~~~~~~~~~~~ This module contains some helper classes that help one to add session support to a python WSGI application. For full client-side session storage see :mod:`~werkzeug.contrib.securecookie` which implements a secure,...
agpl-3.0
ff94315/hiwifi-openwrt-HC5661-HC5761
staging_dir/host/lib/python2.7/distutils/command/bdist_wininst.py
157
14997
"""distutils.command.bdist_wininst Implements the Distutils 'bdist_wininst' command: create a windows installer exe-program.""" __revision__ = "$Id$" import sys import os import string from sysconfig import get_python_version from distutils.core import Command from distutils.dir_util import remove_tree from distut...
gpl-2.0