repo_name
stringlengths
5
100
path
stringlengths
4
294
copies
stringclasses
990 values
size
stringlengths
4
7
content
stringlengths
666
1M
license
stringclasses
15 values
brayoh/bucket-list-api
tests/base.py
1
1997
import unittest import json from app import create_app, db from app.models import User class Base(unittest.TestCase): def setUp(self): self.app = create_app("testing") self.client = self.app.test_client() self.user = json.dumps({ "username": "brian", "password": "pa...
mit
gameduell/duell
bin/win/python2.7.9/Lib/site-packages/pip/_vendor/html5lib/filters/whitespace.py
1730
1142
from __future__ import absolute_import, division, unicode_literals import re from . import _base from ..constants import rcdataElements, spaceCharacters spaceCharacters = "".join(spaceCharacters) SPACES_REGEX = re.compile("[%s]+" % spaceCharacters) class Filter(_base.Filter): spacePreserveElements = frozenset...
bsd-2-clause
hkernbach/arangodb
3rdParty/V8/v5.7.492.77/tools/gyp/test/win/gyptest-cl-buffer-security-check.py
344
1612
#!/usr/bin/env python # Copyright (c) 2012 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. """ Make sure buffer security check setting is extracted properly. """ import TestGyp import sys if sys.platform == 'win32': test = Tes...
apache-2.0
TeamNyx/external_chromium
chrome/common/extensions/docs/examples/apps/hello-python/main.py
70
5222
#!/usr/bin/python # Copyright (c) 2010 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. from google.appengine.ext import webapp from google.appengine.ext.webapp import util from google.appengine.api import users from google...
bsd-3-clause
joebowen/LogMyRocket_API
LogMyRocket/libraries/sys_packages/docutils/docutils/utils/math/__init__.py
160
1683
# :Id: $Id: __init__.py 7218 2011-11-08 17:42:40Z milde $ # :Author: Guenter Milde. # :License: Released under the terms of the `2-Clause BSD license`_, in short: # # Copying and distribution of this file, with or without modification, # are permitted in any medium without royalty provided the copyright # noti...
gpl-3.0
kumarkrishna/sympy
sympy/core/function.py
8
83935
""" There are three types of functions implemented in SymPy: 1) defined functions (in the sense that they can be evaluated) like exp or sin; they have a name and a body: f = exp 2) undefined function which have a name but no body. Undefined functions can be defined using a Function cla...
bsd-3-clause
hlzz/dotfiles
graphics/VTK-7.0.0/Utilities/Maintenance/semanticDiffVersion.py
1
21110
#!/usr/bin/env python """ This script generates API changes between two different versions of VTK. The script uses git and ctags to preset a list of classes added/removed, public methods added/removed when going from one version to the other. """ # ctags generated by the command: # ctags -R --sort=yes --c++-kind...
bsd-3-clause
jhseu/tensorflow
tensorflow/python/data/experimental/benchmarks/parallel_interleave_benchmark.py
9
6510
# 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
HarborYuan/cashier
env/Lib/encodings/cp1253.py
272
13094
""" Python Character Mapping Codec cp1253 generated from 'MAPPINGS/VENDORS/MICSFT/WINDOWS/CP1253.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,in...
mit
tysonclugg/django
tests/queries/models.py
27
16763
""" Various complex queries that have been problematic in the past. """ import threading from django.db import models class DumbCategory(models.Model): pass class ProxyCategory(DumbCategory): class Meta: proxy = True class NamedCategory(DumbCategory): name = models.CharField(max_length=10) ...
bsd-3-clause
manishpatell/erpcustomizationssaiimpex123qwe
addons/base_action_rule/__openerp__.py
52
2009
# -*- 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
fuhongliang/odoo
addons/hr_recruitment/res_config.py
352
3627
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Business Applications # Copyright (C) 2004-Today OpenERP S.A. (<http://openerp.com>). # # This program is free software: you can redistribute it and/or modify # it under the terms ...
agpl-3.0
wang1352083/pythontool
python-2.7.12-lib/distutils/tests/test_ccompiler.py
42
2356
"""Tests for distutils.ccompiler.""" import os import unittest from test.test_support import captured_stdout from distutils.ccompiler import (gen_lib_options, CCompiler, get_default_compiler) from distutils.sysconfig import customize_compiler from distutils import debug from distutils....
mit
qwefi/nova
nova/console/vmrc_manager.py
13
6065
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright (c) 2011 Citrix Systems, Inc. # Copyright 2011 OpenStack Foundation # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # ...
apache-2.0
james4424/nest-simulator
topology/examples/connex.py
4
2161
# -*- coding: utf-8 -*- # # connex.py # # This file is part of NEST. # # Copyright (C) 2004 The NEST Initiative # # NEST 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 # (a...
gpl-2.0
txiner/db-xiner
integration_test/test_project_order.py
1
3192
import unittest from disco.core import result_iterator from hustle import select, Table from setup import IMPS from hustle.core.settings import Settings, overrides class TestProjectOrder(unittest.TestCase): def setUp(self): overrides['server'] = 'disco://localhost' overrides['dump'] = False ...
mit
adamjmcgrath/glancydesign
django/contrib/gis/geos/base.py
321
1698
from ctypes import c_void_p from types import NoneType from django.contrib.gis.geos.error import GEOSException, GEOSIndexError # Trying to import GDAL libraries, if available. Have to place in # try/except since this package may be used outside GeoDjango. try: from django.contrib.gis import gdal except ImportErro...
bsd-3-clause
abaditsegay/arangodb
3rdParty/V8-4.3.61/third_party/python_26/Lib/site-packages/win32comext/shell/demos/servers/copy_hook.py
37
2888
# A sample shell copy hook. # To demostrate: # * Execute this script to register the context menu. # * Open Windows Explorer # * Attempt to move or copy a directory. # * Note our hook's dialog is displayed. import sys, os import pythoncom from win32com.shell import shell, shellcon import win32gui import win32con impor...
apache-2.0
yangchaogit/shadowsocks
tests/coverage_server.py
1072
1655
#!/usr/bin/env python # # Copyright 2015 clowwindy # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ...
apache-2.0
edoakes/pyscrape
parsing/parse_repos.py
1
2547
import os, requests, json, subprocess, time, pymongo, signal, sys from multiprocessing import Process, Queue, Lock, Value, current_process script_dir = os.path.dirname(os.path.realpath(__file__)) sys.path.append(os.path.join(script_dir, '..')) from ..parse import parse_files clone_dir = '/home/data/repos' fromdb = c...
apache-2.0
embeddedarm/android_external_chromium_org
tools/multi-process-rss.py
128
3646
#!/usr/bin/env python # Copyright 2013 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. # Counts a resident set size (RSS) of multiple processes without double-counts. # If they share the same page frame, the page frame is ...
bsd-3-clause
gennad/www_gennad_org
django/core/management/commands/inspectdb.py
203
7614
import keyword from optparse import make_option from django.core.management.base import NoArgsCommand, CommandError from django.db import connections, DEFAULT_DB_ALIAS class Command(NoArgsCommand): help = "Introspects the database tables in the given database and outputs a Django model module." option_list =...
bsd-3-clause
OneBitSoftware/jwtSample
src/Spa/env1/Lib/site-packages/setuptools/command/install_scripts.py
505
2231
from distutils import log import distutils.command.install_scripts as orig import os from pkg_resources import Distribution, PathMetadata, ensure_directory class install_scripts(orig.install_scripts): """Do normal script install, plus any egg_info wrapper scripts""" def initialize_options(self): ori...
mit
RandyLowery/erpnext
erpnext/patches/v6_27/fix_recurring_order_status.py
54
1936
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals import frappe def execute(): for doc in ( { "doctype": "Sales Order", "stock_doctype": "Delivery Note", "invoice_doctype": "Sales Invoic...
gpl-3.0
ramalho/eagle-py
examples/quadratic_function_graph.py
2
4017
#!/usr/bin/env python2 # -*- coding: utf-8 -*- from eagle import * import math epsilon = 0.000001 graph_font_size = 8 def clear(app, button): app["graph"].clear() def quadratic(a, b, c, x): return a * (x ** 2) + b * x + c def data_changed(app, *args): a = app["a"] b = app["b"] c = app["c"] ...
lgpl-2.1
jiwanlimbu/aura
keystone/auth/schema.py
2
3011
# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the Li...
apache-2.0
sander76/home-assistant
homeassistant/components/ssdp/__init__.py
4
6916
"""The SSDP integration.""" import asyncio from datetime import timedelta import logging from typing import Any, Mapping import aiohttp from async_upnp_client.search import async_search from defusedxml import ElementTree from netdisco import ssdp, util from homeassistant.const import EVENT_HOMEASSISTANT_STARTED from ...
apache-2.0
cpatrickalves/simprev
modelos/modulos_fazenda/depesas.py
1
20278
# -*- coding: utf-8 -*- """ @author: Patrick Alves """ from util.tabelas import LerTabelas import pandas as pd # Calcula despesas com benefícios # Baseado nas Equações da LDO de 2018 e Planilhas do MF def calc_despesas(despesas, estoques, concessoes, valCoBen, salarios, valMedBenef, probabilidades, nparcelas, resulta...
gpl-3.0
openstack/horizon
openstack_dashboard/test/unit/api/test_network.py
1
6484
# Copyright 2013 NEC Corporation # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ag...
apache-2.0
virneo/nupic
tests/unit/nupic/algorithms/cla_classifier_diff_test.py
35
1634
#!/usr/bin/env python # ---------------------------------------------------------------------- # Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2013, Numenta, Inc. Unless you have an agreement # with Numenta, Inc., for a separate license for this software code, the # following terms and conditions ...
agpl-3.0
GoogleCloudPlatform/PerfKitBenchmarker
perfkitbenchmarker/linux_benchmarks/ior_benchmark.py
1
4221
# Copyright 2018 PerfKitBenchmarker 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 appli...
apache-2.0
tuhangdi/django
tests/utils_tests/test_inspect.py
157
1161
import unittest from django.utils import inspect class Person(object): def no_arguments(self): return None def one_argument(self, something): return something def just_args(self, *args): return args def all_kinds(self, name, address='home', age=25, *args, **kwargs): ...
bsd-3-clause
bradh/six-library
processFiles.py
4
3653
import sys, os, re, subprocess from os.path import isdir, join, split, exists def cosmoSkyMed(filename): path, fname = split(filename) if re.match(r'CSK.*.MBI.tif', fname): xmlName = join(path, fname.rsplit('MBI.tif')[0] + 'attribs.xml') if exists(xmlName): return (xmlName...
lgpl-3.0
pjg101/SickRage
lib/hachoir_metadata/setter.py
94
5203
from datetime import date, datetime import re from hachoir_core.language import Language from locale import setlocale, LC_ALL from time import strptime from hachoir_metadata.timezone import createTimezone from hachoir_metadata import config NORMALIZE_REGEX = re.compile("[-/.: ]+") YEAR_REGEX1 = re.compile("^([0-9]{4})...
gpl-3.0
hradec/gaffer
python/GafferSceneUI/DeleteOutputsUI.py
13
2461
########################################################################## # # Copyright (c) 2015, 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: # # * Redistrib...
bsd-3-clause
TFenby/python-mode
pymode/libs2/rope/refactor/wildcards.py
22
5833
from rope.base import ast, evaluate, builtins, pyobjects from rope.refactor import patchedast, occurrences class Wildcard(object): def get_name(self): """Return the name of this wildcard""" def matches(self, suspect, arg): """Return `True` if `suspect` matches this wildcard""" class Suspec...
lgpl-3.0
JoeriHermans/dist-keras
examples/kafka_producer.py
3
1754
""" This example will be used as a Kafka producer to generate dummy data for our Spark Streaming example. """ ## BEGIN Imports. ############################################################## from kafka import * import sys import pandas import time import json ## END Imports. #####################################...
gpl-3.0
yuval-harpaz/MNE4D
pyScripts/b391g2.py
1
3027
import mne import surfer import numpy as np from compute_g2 import g2 #cd ~/Data/epilepsy/b391/3 rawEmpty = mne.io.bti.read_raw_bti('/home/yuval/Data/emptyRoom/lf_c,rfhp0.1Hz', rename_channels=False, sort_by_ch_name=False) rawEmpty.pick_types('mag') rawEmpty.filter(20,70) events = mne.read_events('/home/yuval/Data/e...
gpl-2.0
saeki-masaki/glance
glance/db/sqlalchemy/migrate_repo/versions/041_add_artifact_tables.py
12
10367
# Copyright (c) 2015 Mirantis, 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...
apache-2.0
yayoiukai/signalserver
reports/views.py
1
6002
from django.shortcuts import render from django.http import HttpResponse from django.template import loader from django.http import HttpResponseRedirect from django.core.urlresolvers import reverse from .models import Summary, Entry, Report, Item from fileuploads.models import Video from groups.models import Process, ...
mit
dcprojects/CoolProp
Web/_ext/edit_on_github.py
3
1396
""" Sphinx extension to add ReadTheDocs-style "Edit on GitHub" links to the sidebar. Loosely based on https://github.com/astropy/astropy/pull/347 Edited by Ian Bell, 2014 to add path_prefix """ import os import warnings __licence__ = 'BSD (3 clause)' def get_github_url(app, view, path): return 'https://githu...
mit
7kbird/chrome
third_party/tlslite/tlslite/utils/cipherfactory.py
151
2934
# Author: Trevor Perrin # See the LICENSE file for legal information regarding use of this file. """Factory functions for symmetric cryptography.""" import os from tlslite.utils import python_aes from tlslite.utils import python_rc4 from tlslite.utils import cryptomath tripleDESPresent = False if cryptomath.m2cry...
bsd-3-clause
jdunaravich/thumbor
tests/test_utils.py
4
3786
#!/usr/bin/python # -*- coding: utf-8 -*- # thumbor imaging service # https://github.com/thumbor/thumbor/wiki # Licensed under the MIT license: # http://www.opensource.org/licenses/mit-license # Copyright (c) 2011 globo.com timehome@corp.globo.com from unittest import TestCase from mock import Mock, patch from preg...
mit
machawk1/pywb
pywb/rewrite/test/test_rewrite_live.py
1
9395
from pywb.rewrite.rewrite_live import LiveRewriter from pywb.rewrite.url_rewriter import UrlRewriter from pywb.rewrite.wburl import WbUrl from pywb import get_test_dir from io import BytesIO # This module has some rewriting tests against the 'live web' # As such, the content may change and the test may break urlrew...
gpl-3.0
DynoGraph/stinger-dynograph
lib/dynograph_util/googletest/test/gtest_xml_output_unittest.py
336
14677
#!/usr/bin/env python # # Copyright 2006, Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list...
gpl-3.0
themech/Machine-Learning-Coursera-Tensorflow
ex3-multi-class-classification/2_neural_networks.py
1
1500
# This classifies the same digit as the logistic regression classifiers from # the first step. But here we're using a pre-trained neural network classifier # (loaded from data/ex3weights.mat) import numpy as np from scipy import io from sklearn import metrics # Load the data. filename = 'data/ex3data1.mat' data = io.l...
mit
Geoion/MITMf
core/sslstrip/StrippingProxy.py
31
1263
# Copyright (c) 2014-2016 Moxie Marlinspike, Marcello Salvati # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License as # published by the Free Software Foundation; either version 3 of the # License, or (at your option) any later version. # # This...
gpl-3.0
smendez-hi/SUMO-hib
tools/net/xmlnodes_applyOffset.py
3
2018
#!/usr/bin/env python """ @file xmlnodes_applyOffset.py @author Daniel Krajzewicz @date 2009-08-01 @version $Id: xmlnodes_applyOffset.py 11671 2012-01-07 20:14:30Z behrisch $ Applies a given offset to edges given in an xml-node-file. The results are written into <XMLNODES>.mod.xml. Call: xmlnodes_applyOffset.py...
gpl-3.0
dozed/Mediawiker
mwclient/page_nowriteapi.py
3
3632
import sys pythonver = sys.version_info[0] import time if pythonver >= 3: from html.parser import HTMLParser from html.entities import name2codepoint else: from HTMLParser import HTMLParser from htmlentitydefs import name2codepoint import errors class OldPage(object): @staticmethod def save(self, text = u'', s...
mit
marcuskelly/recover
Lib/site-packages/Crypto/Cipher/PKCS1_OAEP.py
9
9570
# -*- coding: utf-8 -*- # # Cipher/PKCS1_OAEP.py : PKCS#1 OAEP # # =================================================================== # The contents of this file are dedicated to the public domain. To # the extent that dedication to the public domain is not available, # everyone is granted a worldwide, perpetual, ro...
bsd-2-clause
alanfgates/hive
testutils/ptest/Ssh.py
18
4425
# 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 use ...
apache-2.0
hendradarwin/VTK
ThirdParty/Twisted/twisted/test/process_twisted.py
41
1149
"""A process that reads from stdin and out using Twisted.""" ### Twisted Preamble # This makes sure that users don't have to set up their environment # specially in order to run these programs from bin/. import sys, os pos = os.path.abspath(sys.argv[0]).find(os.sep+'Twisted') if pos != -1: sys.path.insert(0, os.pa...
bsd-3-clause
ualikhansars/Gwent
lib/python2.7/site-packages/django/contrib/gis/db/backends/postgis/adapter.py
373
1695
""" This object provides quoting for GEOS geometries into PostgreSQL/PostGIS. """ from __future__ import unicode_literals from psycopg2 import Binary from psycopg2.extensions import ISQLQuote class PostGISAdapter(object): def __init__(self, geom, geography=False): "Initializes on the geometry." ...
mit
invisiblek/python-for-android
python3-alpha/python3-src/Lib/encodings/iso8859_10.py
272
13589
""" Python Character Mapping Codec iso8859_10 generated from 'MAPPINGS/ISO8859/8859-10.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,input,errors...
apache-2.0
fkraemer/qt_multi_annotator
qt_multi_annotator.py
1
16390
#!/usr/bin/env python # -*- coding: utf-8 -*- import sys from PyQt4 import QtCore, QtGui import numpy as np from annotation_helper import * import unittest import os import pickle import argparse #for file listing from path CLASSBUTTON_MIN_HEIGHT = 30 CLASSBUTTON_MIN_WIDTH = 40 MAX_CLASSES = 20 IMG_SIZE_X = 800 IMG_S...
gpl-3.0
Novasoft-India/OperERP-AM-Motors
openerp/addons/portal_hr_employees/__openerp__.py
53
1751
# -*- 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
spandey2405/phpmyadmin
doc/_ext/configext.py
141
6618
from sphinx.domains import Domain, ObjType from sphinx.roles import XRefRole from sphinx.domains.std import GenericObject, StandardDomain from sphinx.directives import ObjectDescription from sphinx.util.nodes import clean_astext, make_refnode from sphinx.util import ws_re from sphinx import addnodes from sphinx.util.do...
gpl-2.0
rynomster/django
tests/template_tests/syntax_tests/test_numpy.py
353
1429
import warnings from unittest import skipIf from django.test import SimpleTestCase from ..utils import setup try: import numpy except ImportError: numpy = False @skipIf(numpy is False, "Numpy must be installed to run these tests.") class NumpyTests(SimpleTestCase): # Ignore numpy deprecation warnings (...
bsd-3-clause
savoirfairelinux/account-fiscal-rule
__unported__/account_fiscal_position_rule_purchase/purchase.py
2
3496
# -*- encoding: utf-8 -*- ############################################################################### # # account_fiscal_position_rule_purchase for OpenERP # Copyright (C) 2009-TODAY Akretion <http://www.akretion.com> # @author Renato Lima <renato.lima@akretion.com> # This program is free software: you ca...
agpl-3.0
krikru/tensorflow-opencl
tensorflow/contrib/tensor_forest/hybrid/python/models/decisions_to_data_then_nn_test.py
101
4681
# 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
nlgcoin/guldencoin-official
test/functional/feature_minchainwork.py
2
4129
#!/usr/bin/env python3 # Copyright (c) 2017-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 logic for setting nMinimumChainWork on command line. Nodes don't consider themselves out of "init...
mit
Venturi/cms
env/lib/python2.7/site-packages/unidecode/x093.py
252
4666
data = ( 'Lun ', # 0x00 'Kua ', # 0x01 'Ling ', # 0x02 'Bei ', # 0x03 'Lu ', # 0x04 'Li ', # 0x05 'Qiang ', # 0x06 'Pou ', # 0x07 'Juan ', # 0x08 'Min ', # 0x09 'Zui ', # 0x0a 'Peng ', # 0x0b 'An ', # 0x0c 'Pi ', # 0x0d 'Xian ', # 0x0e 'Ya ', # 0x0f 'Zhui ', # 0x10 'Le...
gpl-2.0
pablohoffman/scrapy
scrapy/xlib/pydispatch/robust.py
25
1857
"""Module implementing error-catching version of send (sendRobust)""" from scrapy.xlib.pydispatch.dispatcher import Any, Anonymous, liveReceivers, getAllReceivers from scrapy.xlib.pydispatch.robustapply import robustApply def sendRobust( signal=Any, sender=Anonymous, *arguments, **named ): """Send signal from se...
bsd-3-clause
luzpaz/QGIS
tests/src/python/test_qgsopacitywidget.py
45
1458
# -*- coding: utf-8 -*- """QGIS Unit tests for QgsOpacityWidget .. note:: This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. """ _...
gpl-2.0
dkandalov/katas
python/ml/scikit/plot_iris.py
1
1811
import numpy as np import matplotlib.pyplot as plt from sklearn import svm, datasets iris = datasets.load_iris() # we only take the first two features. We could # avoid this ugly slicing by using a two-dim dataset X = iris.data[:, :2] y = iris.target # We create an instance of SVM and fit out data. # We do not scale...
unlicense
powerjg/gem5-ci-test
src/mem/slicc/ast/NewExprAST.py
91
2107
# 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
jonathonwalz/ansible
lib/ansible/modules/windows/win_chocolatey.py
60
3973
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2014, Trond Hindenes <trond@hindenes.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 L...
gpl-3.0
zadgroup/edx-platform
cms/envs/dev_with_worker.py
127
1180
""" This config file follows the dev enviroment, but adds the requirement of a celery worker running in the background to process celery tasks. The worker can be executed using: django_admin.py celery worker """ # We intentionally define lots of variables that aren't used, and # want to import all variables from bas...
agpl-3.0
raycarnes/account-invoicing
__unported__/stock_invoice_picking_incoterm/account_invoice.py
20
1333
# -*- coding: utf-8 -*- ############################################################################## # # Copyright (C) 2014 Agile Business Group sagl # (<http://www.agilebg.com>) # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public ...
agpl-3.0
choderalab/bayesian-itc
examples/sampl4_notebook/models.py
3
42066
#!/usr/bin/env python """ A test of pymc for ITC. """ #============================================================================================= # IMPORTS #============================================================================================= import numpy import pymc import copy import scipy.optimize im...
gpl-3.0
mitreaadrian/Soccersim
boost/boost_1_59_0/libs/python/test/polymorphism.py
46
1917
# Copyright David Abrahams 2004. Distributed under the Boost # Software License, Version 1.0. (See accompanying # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) import unittest from polymorphism_ext import * class PolymorphTest(unittest.TestCase): def testReturnCpp(self): # Python Cre...
mit
valtech-mooc/edx-platform
common/lib/xmodule/xmodule/tabs.py
6
34362
""" Implement CourseTab """ from abc import ABCMeta, abstractmethod from xblock.fields import List # We should only scrape strings for i18n in this file, since the target language is known only when # they are rendered in the template. So ugettext gets called in the template. _ = lambda text: text class CourseTab(o...
agpl-3.0
kylazhang/virt-test
qemu/tests/migration_multi_host_with_speed_measurement.py
2
8531
import os import re import logging import time import socket from autotest.client.shared import error, utils from autotest.client.shared.barrier import listen_server from autotest.client.shared.syncdata import SyncData from virttest import utils_test, utils_misc def run_migration_multi_host_with_speed_measurement(tes...
gpl-2.0
thnee/ansible
lib/ansible/modules/network/fortimanager/fmgr_script.py
39
8637
#!/usr/bin/python # # 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 version. # # Ansible is distribut...
gpl-3.0
sony-omni/android_kernel_caf_msm8x26
Documentation/target/tcm_mod_builder.py
2358
40707
#!/usr/bin/python # The TCM v4 multi-protocol fabric module generation script for drivers/target/$NEW_MOD # # Copyright (c) 2010 Rising Tide Systems # Copyright (c) 2010 Linux-iSCSI.org # # Author: nab@kernel.org # import os, sys import subprocess as sub import string import re import optparse tcm_dir = "" fabric_ops...
gpl-2.0
donald-pinckney/EM-Simulator
EM Sim/EM Sim/py_lib/lib2to3/fixes/fix_tuple_params.py
324
5577
"""Fixer for function definitions with tuple parameters. def func(((a, b), c), d): ... -> def func(x, d): ((a, b), c) = x ... It will also support lambdas: lambda (x, y): x + y -> lambda t: t[0] + t[1] # The parens are a syntax error in Python 3 lambda (x): x + y -> lambda x: x + y """...
apache-2.0
bzhpwr/MediExports
project_env/lib/python2.6/site-packages/werkzeug/_compat.py
148
6190
import sys import operator import functools try: import builtins except ImportError: import __builtin__ as builtins PY2 = sys.version_info[0] == 2 _identity = lambda x: x if PY2: unichr = unichr text_type = unicode string_types = (str, unicode) integer_types = (int, long) int_to_byte = c...
gpl-2.0
rickerc/neutron_audit
neutron/agent/linux/ovsdb_monitor.py
1
4106
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 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 # #...
apache-2.0
jbteixeir/Openflow-DC-Framework
pox/lib/packet/igmp.py
27
3726
# Copyright 2012 James McCauley # Copyright 2008 (C) Nicira, Inc. # # This file is part of POX. # # POX is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) an...
gpl-3.0
bousmalis/models
transformer/cluttered_mnist.py
19
6535
# 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
Robobench/rapman-subuser
logic/subuserlib/classes/runtime.py
1
7660
#!/usr/bin/env python # This file should be compatible with both Python 2 and 3. # If it is not, please file a bug report. """ Runtime environements which are prepared for subusers to run in. """ #external imports import sys,collections,os #internal imports import subuserlib.classes.userOwnedObject def getRecursiveD...
lgpl-3.0
zer0yu/ZEROScan
thirdparty/requests/packages/urllib3/util/wait.py
8
1491
from .selectors import ( HAS_SELECT, DefaultSelector, EVENT_READ, EVENT_WRITE ) def _wait_for_io_events(socks, events, timeout=None): """ Waits for IO events to be available from a list of sockets or optionally a single socket if passed in. Returns a list of sockets that can be ...
mit
lilydjwg/udt_py
test_udt.py
1
6280
#!/usr/bin/env python3 import sys import socket import unittest import udt import _udt class TestSocket(unittest.TestCase): def create_socket(self): return udt.socket(socket.AF_INET, socket.SOCK_STREAM, 0) def create_int_socket(self): return _udt.socket(socket.AF_INET, socket.SOCK_STREAM, 0)...
bsd-3-clause
bmakarenko/gost-crypto-gui
gostcryptogui/mainwindow.py
1
8305
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'mainwindow.ui' # # Created: Tue May 16 14:32:44 2017 # by: PyQt4 UI code generator 4.6.2 # # WARNING! All changes made in this file will be lost! from PyQt4 import QtCore, QtGui class Ui_MainWindow(object): def setupUi(self, MainW...
mit
rajsadho/django
tests/generic_views/test_list.py
309
12129
# -*- coding: utf-8 -*- from __future__ import unicode_literals import datetime from django.core.exceptions import ImproperlyConfigured from django.test import TestCase, override_settings from django.utils.encoding import force_str from django.views.generic.base import View from .models import Artist, Author, Book, ...
bsd-3-clause
dittert/pyprobe
src/pyprobe/sensors/pegasus/sensor_enclosure.py
1
3128
# coding=utf-8 import platform import subprocess from pyprobe.sensors import * from pyprobe.sensors.pegasus.enclosure import EnclosureParser from pyprobe.sensors.pegasus.helper import determine_executable, determine_controllers from pyprobe.sensors.process_helper import get_outputs_of_process from pyprobe.utils import...
apache-2.0
fightingwalrus/gerbmerge
gerbmerge/config.py
4
14366
#!/usr/bin/env python """ Parse the GerbMerge configuration file. -------------------------------------------------------------------- This program is licensed under the GNU General Public License (GPL) Version 3. See http://www.fsf.org for details of the license. Rugged Circuits LLC http://ruggedcircuits...
gpl-3.0
miguelfervi/SSBW-Restaurantes
restaurantes/lib/python2.7/site-packages/django/db/models/fields/__init__.py
24
88809
# -*- coding: utf-8 -*- from __future__ import unicode_literals import collections import copy import datetime import decimal import math import uuid import warnings from base64 import b64decode, b64encode from functools import total_ordering from django import forms from django.apps import apps from django.conf impo...
gpl-3.0
Lh4cKg/sl4a
python/src/Lib/ctypes/test/test_find.py
51
2472
import unittest import sys from ctypes import * from ctypes.util import find_library from ctypes.test import is_resource_enabled if sys.platform == "win32": lib_gl = find_library("OpenGL32") lib_glu = find_library("Glu32") lib_gle = None elif sys.platform == "darwin": lib_gl = lib_glu = find_library("O...
apache-2.0
phad/certificate-transparency
python/utilities/logobserver/logobserver.py
7
2496
#!/usr/bin/env python import gflags from google.protobuf import text_format import logging import os import sys import requests from ct.client.db import sqlite_connection as sqlitecon from ct.client import prober from ct.client.db import sqlite_log_db from ct.client.db import sqlite_temp_db from ct.client.db import sq...
apache-2.0
mlperf/inference_results_v0.5
closed/Google/code/gnmt/tpu-gnmt/home/kbuilder/mlperf-inference/google3/third_party/mlperf/inference/gnmt/nmt/tpu/model.py
1
18339
# Copyright 2017 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
jazztpt/edx-platform
lms/djangoapps/certificates/migrations/0009_auto__del_field_generatedcertificate_graded_download_url__del_field_ge.py
188
6118
# -*- 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): # Deleting field 'GeneratedCertificate.graded_download_url' db.delete_column('certificates_generatedcertific...
agpl-3.0
paul-breen/paul-breen.github.io
js/sos/proj4js/tools/jsmin.py
95
7687
#!/usr/bin/python # This code is original from jsmin by Douglas Crockford, it was translated to # Python by Baruch Even. The original code had the following copyright and # license. # # /* jsmin.c # 2007-01-08 # # Copyright (c) 2002 Douglas Crockford (www.crockford.com) # # Permission is hereby granted,...
apache-2.0
rosmo/ansible
lib/ansible/modules/network/a10/a10_virtual_server.py
34
11180
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2014, Mischa Peters <mpeters@a10networks.com>, # Eric Chou <ericc@a10networks.com> # # 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__ = t...
gpl-3.0
Zac-HD/home-assistant
homeassistant/helpers/state.py
8
7784
"""Helpers that help with state related things.""" import asyncio import json import logging from collections import defaultdict import homeassistant.util.dt as dt_util from homeassistant.components.media_player import ( ATTR_MEDIA_CONTENT_ID, ATTR_MEDIA_CONTENT_TYPE, ATTR_MEDIA_SEEK_POSITION, ATTR_MEDIA_VOLUM...
apache-2.0
amitskwalia/codesters
Imaging-1.1.7/setup.py
4
17323
#!/usr/bin/env python # # Setup script for PIL 1.1.5 and later # # Usage: python setup.py install # import glob, os, re, struct, string, sys # make it possible to run the setup script from another directory try: os.chdir(os.path.dirname(sys.argv[0])) except OSError: pass def libinclude(root): # map root ...
mit
Tinkerforge/brickv
src/brickv/plugin_system/plugins/piezo_buzzer/piezo_buzzer.py
1
4408
# -*- coding: utf-8 -*- """ Piezo Buzzer Plugin Copyright (C) 2011-2012 Olaf Lüke <olaf@tinkerforge.com> Copyright (C) 2014, 2016 Matthias Bolte <matthias@tinkerforge.com> piezo_buzzer.py: Piezo Buzzer Plugin Implementation This program is free software; you can redistribute it and/or modify it under the terms of the...
gpl-2.0
MatthiasMuellerReineke/push-admin
bin/test_selfcontaining.py
1
46288
#!/usr/bin/env python # -*- coding: utf8 -*- # Copyright (C) 2011 Matthias Müller-Reineke # 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...
gpl-3.0
urba1n/fabric-bolt
src/fabric_bolt/accounts/tables.py
14
1653
""" Tables for the account app """ from django.contrib.auth import get_user_model import django_tables2 as tables from fabric_bolt.core.mixins.tables import ActionsColumn, PaginateTable class UserListTable(PaginateTable): """ Table for displaying users. """ actions = ActionsColumn([ {'title...
mit
ProteinDF/ProteinDF_bridge
tests/test_atom.py
1
2087
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright (C) 2002-2014 The ProteinDF project # see also AUTHORS and README. # # This file is part of ProteinDF. # # ProteinDF 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 Softwa...
gpl-3.0