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
tkaitchuck/nupic
py/nupic/research/TP_R.py
1
127081
#! /usr/bin/env python # ---------------------------------------------------------------------- # Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2013, Numenta, Inc. Unless you have purchased from # Numenta, Inc. a separate commercial license for this software code, the # following terms and conditi...
gpl-3.0
AdamRTomkins/libSpineML
libSpineML/smlUtils.py
1
10142
""" A script to convert the drosophila connectome into SpineML This build upon the pure data to add in the required infered network components: # Install libSpineML from source # https://github.com/AdamRTomkins/libSpineML """ from __future__ import division from libSpineML import smlExperiment as exp from libSpine...
gpl-3.0
arju88nair/projectCulminate
venv/lib/python3.5/encodings/shift_jisx0213.py
816
1059
# # shift_jisx0213.py: Python Unicode Codec for SHIFT_JISX0213 # # Written by Hye-Shik Chang <perky@FreeBSD.org> # import _codecs_jp, codecs import _multibytecodec as mbc codec = _codecs_jp.getcodec('shift_jisx0213') class Codec(codecs.Codec): encode = codec.encode decode = codec.decode class IncrementalEnc...
apache-2.0
yannickcr/CouchPotatoServer
couchpotato/core/media/_base/providers/torrent/thepiratebay.py
7
6057
import re import traceback from bs4 import BeautifulSoup from couchpotato.core.helpers.encoding import toUnicode from couchpotato.core.helpers.variable import tryInt from couchpotato.core.logger import CPLog from couchpotato.core.media._base.providers.torrent.base import TorrentMagnetProvider import six log = CPLog(...
gpl-3.0
yaukwankiu/twstocks
mark1.py
1
9719
# -*- coding: utf8 -*- ############################ # imports import time import datetime import urllib2 import re import os import pickle import numpy as np import matplotlib.pyplot as plt ############################ # defining the parameters currentPriceRegex = re.compile(r'(?<=\<td\ align\=\"center\"\ bgcolor\...
cc0-1.0
pplatek/odoo
addons/account/wizard/account_journal_select.py
385
2068
# -*- 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
cyrusin/tornado
tornado/test/runtests.py
1
7199
#!/usr/bin/env python from __future__ import absolute_import, division, print_function, with_statement import gc import locale # system locale module, not tornado.locale import logging import operator import textwrap import sys from tornado.httpclient import AsyncHTTPClient from tornado.httpserver import HTTPServer f...
apache-2.0
Bunshinn/myPython
智联职位爬取/jobs_of_data_analysis_on_zhilian.py
1
2488
# -*- coding: utf-8 -*- """ @author: QQ:412319433 """ import requests from bs4 import BeautifulSoup import sqlite3 import time s = time.clock() def htmlparse(bs, tag, attr = None, attrs= None): ''' bs : BeautifulSoup对象 tag : 要处理的标签名 attr : 要获取属性值的属性名 attrs : 要查找的属性值对 ''' content ...
gpl-3.0
popbones/jieba
test/parallel/test_pos.py
65
4862
#encoding=utf-8 from __future__ import print_function import sys sys.path.append("../../") import jieba jieba.enable_parallel(4) import jieba.posseg as pseg def cuttest(test_sent): result = pseg.cut(test_sent) for w in result: print(w.word, "/", w.flag, ", ", end=' ') print("") if __name__ == "...
mit
ryfeus/lambda-packs
Tensorflow/source/tensorflow/core/framework/types_pb2.py
2
8950
# Generated by the protocol buffer compiler. DO NOT EDIT! # source: tensorflow/core/framework/types.proto import sys _b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) from google.protobuf.internal import enum_type_wrapper from google.protobuf import descriptor as _descriptor from google.proto...
mit
Z2PackDev/bandstructure_utils
bands_inspect/eigenvals.py
2
3489
# -*- coding: utf-8 -*- # (c) 2017-2019, ETH Zurich, Institut fuer Theoretische Physik # Author: Dominik Gresch <greschd@gmx.ch> """ Defines the data container for eigenvalue data (bandstructures). """ import types import numpy as np from fsc.export import export from fsc.hdf5_io import HDF5Enabled, subscribe_hdf5 ...
gpl-3.0
windyuuy/opera
chromium/src/tools/gyp/test/copies/gyptest-all.py
264
1289
#!/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 file copies using an explicit build target of 'all'. """ import TestGyp test = TestGyp.TestGyp() test.run_gyp('copies.gyp', ...
bsd-3-clause
lukas-ke/faint-graphics-editor
build-sys/build_sys/help_util/markup_regex.py
1
2539
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # Copyright 2014 Lukas Kemmer # # 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 # # Unl...
apache-2.0
pchauncey/ansible
lib/ansible/modules/windows/win_regmerge.py
33
3903
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2015, Jon Hawkesworth (@jhawkesworth) <figs@unity.demon.co.uk> # # 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, eith...
gpl-3.0
apostle/apostle.py
apostle/mail.py
1
2161
import json import base64 class Mail(object): """ An object that represents a single email to be sent via Apostle.io Arbitrary attributes can be added at runtime and will be sent as the 'data' key to Apostle.io """ # The template slug to be sent template_id = None # The email address to be sent to email =...
mit
petrjasek/superdesk-core
superdesk/data_updates/00007_20180321-092824_archive.py
2
1613
# -*- coding: utf-8; -*- # This file is part of Superdesk. # For the full copyright and license information, please see the # AUTHORS and LICENSE files distributed with this source code, or # at https://www.sourcefabric.org/superdesk/license # # Author : tomas # Creation: 2018-03-21 09:28 import superdesk import subp...
agpl-3.0
yangkf1985/tornado
tornado/httpclient.py
104
26658
"""Blocking and non-blocking HTTP client interfaces. This module defines a common interface shared by two implementations, ``simple_httpclient`` and ``curl_httpclient``. Applications may either instantiate their chosen implementation class directly or use the `AsyncHTTPClient` class from this module, which selects an...
apache-2.0
joeyb/joeyb-blog
externals/pygments/styles/autumn.py
24
2123
# -*- coding: utf-8 -*- """ pygments.styles.autumn ~~~~~~~~~~~~~~~~~~~~~~ A colorful style, inspired by the terminal highlighting style. :copyright: 2006-2007 by Armin Ronacher. :license: BSD, see LICENSE for more details. """ from pygments.style import Style from pygments.token import Keyword, N...
mit
kblin/supybot-gsoc
src/log.py
5
15607
### # Copyright (c) 2002-2005, Jeremiah Fincher # 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 co...
bsd-3-clause
rosmo/ansible
lib/ansible/plugins/lookup/varnames.py
50
2238
# (c) 2017 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 DOCUMENTATION = """ lookup: varnames author: Ansible Core version_added: "2.8" short_descriptio...
gpl-3.0
discosultan/quake-console
Samples/Sandbox/Lib/encodings/cp874.py
593
12851
""" Python Character Mapping Codec cp874 generated from 'MAPPINGS/VENDORS/MICSFT/WINDOWS/CP874.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,inpu...
mit
kyonetca/onionshare
onionshare/web.py
1
7477
# -*- coding: utf-8 -*- """ OnionShare | https://onionshare.org/ Copyright (C) 2014 Micah Lee <micah@micahflee.com> 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, o...
gpl-3.0
kmad1729/website
django/utils/dictconfig.py
335
22939
# This is a copy of the Python logging.config.dictconfig module, # reproduced with permission. It is provided here for backwards # compatibility for Python versions prior to 2.7. # # Copyright 2009-2010 by Vinay Sajip. All Rights Reserved. # # Permission to use, copy, modify, and distribute this software and its # docu...
bsd-3-clause
cntnboys/410Lab6
v1/lib/python2.7/site-packages/django/contrib/gis/tests/geo3d/tests.py
62
12075
from __future__ import unicode_literals import os import re from unittest import skipUnless from django.contrib.gis.gdal import HAS_GDAL from django.contrib.gis.geos import HAS_GEOS from django.contrib.gis.tests.utils import postgis from django.test import TestCase from django.utils._os import upath if HAS_GEOS: ...
apache-2.0
mdrumond/tensorflow
tensorflow/contrib/slim/python/slim/data/prefetch_queue_test.py
76
8616
# 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
vpramo/contrail-sandesh
library/python/pysandesh/example/pysandesh_example/generator.py
6
4239
# # Copyright (c) 2013 Juniper Networks, Inc. All rights reserved. # import gevent from gevent import monkey; monkey.patch_all() from pysandesh.sandesh_base import * from gen_py.generator_msg.ttypes import * from pysandesh_example.gen_py.vn.ttypes import * from pysandesh_example.gen_py.vm.ttypes import * import sandes...
apache-2.0
vitan/hue
desktop/core/ext-py/Pygments-1.3.1/pygments/cmdline.py
75
13055
# -*- coding: utf-8 -*- """ pygments.cmdline ~~~~~~~~~~~~~~~~ Command line interface. :copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ import sys import getopt from textwrap import dedent from pygments import __version__, highlight fro...
apache-2.0
torchingloom/edx-platform
cms/djangoapps/contentstore/features/course-settings.py
21
7212
# pylint: disable=C0111 # pylint: disable=W0621 from lettuce import world, step from terrain.steps import reload_the_page from selenium.webdriver.common.keys import Keys from common import type_in_codemirror, upload_file from django.conf import settings from nose.tools import assert_true, assert_false, assert_equal ...
agpl-3.0
xwolf12/django
django/contrib/admin/checks.py
18
38392
# -*- coding: utf-8 -*- from __future__ import unicode_literals from itertools import chain from django.contrib.admin.utils import ( NotRelationField, flatten, get_fields_from_path, ) from django.core import checks from django.core.exceptions import FieldDoesNotExist from django.db import models from django.forms...
bsd-3-clause
edmorley/django
django/db/migrations/serializer.py
24
13457
import builtins import collections import datetime import decimal import enum import functools import math import re import types import uuid from django.db import models from django.db.migrations.operations.base import Operation from django.db.migrations.utils import COMPILED_REGEX_TYPE, RegexObject from django.utils...
bsd-3-clause
Dexhub/MTX
src/mem/slicc/ast/TypeFieldMethodAST.py
18
2396
# 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
yl565/statsmodels
statsmodels/tools/tests/test_grouputils.py
31
11494
import numpy as np import pandas as pd from statsmodels.tools.grouputils import Grouping from statsmodels.tools.tools import categorical from statsmodels.datasets import grunfeld, anes96 from pandas.util import testing as ptesting class CheckGrouping(object): def test_reindex(self): # smoke test ...
bsd-3-clause
waidyanatha/sambro-eden
tests/climate/__init__.py
56
3002
ClimateDataPortal = local_import('ClimateDataPortal') def clear_tables(): ClimateDataPortal.place.truncate() ClimateDataPortal.rainfall_mm.truncate() ClimateDataPortal.temperature_celsius.truncate() db.commit() #clear_tables() def frange(start, end, inc=1.0): value = start i = 0 while Tru...
mit
pwoodworth/intellij-community
python/lib/Lib/tarfile.py
80
74279
#!/usr/bin/env python # -*- coding: iso-8859-1 -*- #------------------------------------------------------------------- # tarfile.py #------------------------------------------------------------------- # Copyright (C) 2002 Lars Gustäbel <lars@gustaebel.de> # All rights reserved. # # Permission is hereby granted, fre...
apache-2.0
takeflight/django
django/conf/urls/i18n.py
113
1193
import warnings from django.conf import settings from django.conf.urls import patterns, url from django.core.urlresolvers import LocaleRegexURLResolver from django.utils import six from django.utils.deprecation import RemovedInDjango20Warning from django.views.i18n import set_language def i18n_patterns(prefix, *args...
bsd-3-clause
lucasgr7/silverplate
crawler/tests/test_crawler.py
1
2392
from django.test import TestCase from crawler.engine import LinkFinder, IngredientFinder import urllib.request from ..models import DataIngredient class CrawlerTestCase(TestCase): def test_links_finder_count(self): """Test the count of links in link finder is equal to the expected amount""" finde...
mit
hackersql/sq1map
plugins/dbms/maxdb/takeover.py
3
1050
#!/usr/bin/env python """ Copyright (c) 2006-2017 sqlmap developers (http://sqlmap.org/) See the file 'doc/COPYING' for copying permission """ from lib.core.exception import SqlmapUnsupportedFeatureException from plugins.generic.takeover import Takeover as GenericTakeover class Takeover(GenericTakeover): def __i...
gpl-3.0
c0defreak/python-for-android
python-modules/twisted/twisted/internet/_pollingfile.py
59
8276
# -*- test-case-name: twisted.internet.test.test_pollingfile -*- # Copyright (c) 2001-2009 Twisted Matrix Laboratories. # See LICENSE for details. """ Implements a simple polling interface for file descriptors that don't work with select() - this is pretty much only useful on Windows. """ from zope.interface import i...
apache-2.0
miptliot/edx-platform
openedx/core/djangoapps/user_api/tests/test_middleware.py
152
4415
"""Tests for user API middleware""" from mock import Mock, patch from unittest import TestCase from django.http import HttpResponse from django.test.client import RequestFactory from student.tests.factories import UserFactory, AnonymousUserFactory from ..tests.factories import UserCourseTagFactory from ..middleware ...
agpl-3.0
StellarCN/py-stellar-base
stellar_sdk/xdr/asset_alpha_num12.py
1
2052
# This is an automatically generated file. # DO NOT EDIT or your changes may be overwritten import base64 from xdrlib import Packer, Unpacker from .account_id import AccountID from .asset_code12 import AssetCode12 __all__ = ["AssetAlphaNum12"] class AssetAlphaNum12: """ XDR Source Code -----------------...
apache-2.0
jittat/adm2
application/migrations-temp/0032_add_is_offline_to_applicant.py
2
9317
# -*- coding: utf-8 -*- from south.db import db from django.db import models from adm.application.models import * class Migration: def forwards(self, orm): # Adding field 'Applicant.is_offline' db.add_column('application_applicant', 'is_offline', orm['application.applicant:is_offline...
agpl-3.0
jmcarbo/openerp7
openerp/addons/project/company.py
55
1543
# -*- 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
absoludity/servo
tests/wpt/web-platform-tests/annotation-protocol/tools/protocol-server.py
71
14265
# protocol-server # # a reference implementation of the Web Annotation Protocol # # Developed by Benjamin Young (@bigbulehat) and Shane McCarron (@halindrome). # Sponsored by Spec-Ops (https://spec-ops.io) # # Copyright (c) 2016 Spec-Ops # # for license information, see http://www.w3.org/Consortium/Legal/2008/04-testsu...
mpl-2.0
zooba/PTVS
Python/Product/Miniconda/Miniconda3-x64/Lib/multiprocessing/popen_forkserver.py
11
2016
import io import os from .context import reduction, set_spawning_popen if not reduction.HAVE_SEND_HANDLE: raise ImportError('No support for sending fds between processes') from . import forkserver from . import popen_fork from . import spawn from . import util __all__ = ['Popen'] # # Wrapper for an fd used whil...
apache-2.0
Salat-Cx65/python-for-android
python-build/python-libs/gdata/build/lib/gdata/tlslite/utils/Python_RSAKey.py
239
7707
"""Pure-Python RSA implementation.""" from cryptomath import * import xmltools from ASN1Parser import ASN1Parser from RSAKey import * class Python_RSAKey(RSAKey): def __init__(self, n=0, e=0, d=0, p=0, q=0, dP=0, dQ=0, qInv=0): if (n and not e) or (e and not n): raise AssertionError() ...
apache-2.0
QuickSander/CouchPotatoServer
libs/CodernityDB/index.py
81
4746
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright 2011-2013 Codernity (http://codernity.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/L...
gpl-3.0
Arcanemagus/plexpy
lib/cloudinary/search.py
3
1732
import json from copy import deepcopy from . import api class Search: """Build and execute a search query.""" def __init__(self): self.query = {} def expression(self, value): """Specify the search query expression.""" self.query["expression"] = value return self def m...
gpl-3.0
mediatum/mediatum-docs
docs/source/conf.py
1
10337
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # mediatum documentation build configuration file, created by # sphinx-quickstart on Wed Aug 31 15:26:33 2016. # # This file is execfile()d with the current directory set to its # containing dir. # # Note that not all possible configuration values are present in this # a...
gpl-3.0
ajenhl/eats
server/eats/models/entity_type_property_assertion.py
1
2595
from tmapi.models import Association from base_manager import BaseManager from entity_type import EntityType from property_assertion import PropertyAssertion class EntityTypePropertyAssertionManager (BaseManager): def filter_by_authority_entity_type (self, authority, entity_type): return self.filter(sco...
gpl-3.0
chase-seibert/flask-admin
flask_admin/contrib/sqla/fields.py
25
8740
""" Useful form fields for use with SQLAlchemy ORM. """ import operator from wtforms import widgets from wtforms.fields import SelectFieldBase from wtforms.validators import ValidationError from .tools import get_primary_key from flask_admin._compat import text_type, string_types from flask_admin.form import Form...
bsd-3-clause
stonebig/bokeh
bokeh/protocol/__init__.py
2
3715
#----------------------------------------------------------------------------- # Copyright (c) 2012 - 2019, Anaconda, Inc., and Bokeh Contributors. # All rights reserved. # # The full license is in the file LICENSE.txt, distributed with this software. #-------------------------------------------------------------------...
bsd-3-clause
gussan/kyototycoon
example/ktrestex.py
12
1597
import time import urllib import http.client # RESTful interface of Kyoto Tycoon class KyotoTycoon: # connect to the server def open(self, host = "127.0.0.1", port = 1978, timeout = 30): self.ua = http.client.HTTPConnection(host, port, False, timeout) # close the connection def close(self): ...
gpl-3.0
sebrandon1/bitcoin
test/functional/test_runner.py
1
24076
#!/usr/bin/env python3 # Copyright (c) 2014-2017 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Run regression test suite. This module calls down into individual test cases via subprocess. It will f...
mit
svanschalkwyk/datafari
windows/python/Tools/versioncheck/pyversioncheck.py
98
4051
"""pyversioncheck - Module to help with checking versions""" import types import rfc822 import urllib import sys # Verbose options VERBOSE_SILENT=0 # Single-line reports per package VERBOSE_NORMAL=1 # Single-line reports per package, more info if outdated VERBOSE_EACHFILE=2 # Report on each URL chec...
apache-2.0
ttm/percolationlegacy
percolation/sparql/classes.py
1
17704
__doc__=""" NOTES: See https://rdflib.readthedocs.org/en/4.2.1/_modules/rdflib/plugins/stores/sparqlstore.html where SparQLClient + SparQLQuery is called a "sparql store" INSERTs and DELETEs without a WHERE clause have the DATA keyword: INSERT DATA { ... } DELETE DATA { ... }. DELETE INSERT WHERE ...
mit
bischjer/auxiliary
aux/engine/actor/reactor.py
3
1565
from multiprocessing import Process, Pipe from aux.engine.actor.base import BaseActor import select class Reactor(BaseActor): def __init__(self, name, looper="select"): self.parent = super(Reactor, self) self.parent.__init__(name) self.callbacks = list() self.shouldStop = F...
bsd-3-clause
msvbhat/distaf
tests_d/example/test_basic_gluster_tests.py
1
1966
# This file is part of DiSTAF # Copyright (C) 2015-2016 Red Hat, Inc. <http://www.redhat.com> # # 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 # any l...
gpl-2.0
zsdonghao/tensorlayer
examples/basic_tutorials/tutorial_mnist_simple.py
1
2087
#! /usr/bin/python # -*- coding: utf-8 -*- import tensorflow as tf import tensorlayer as tl tf.logging.set_verbosity(tf.logging.DEBUG) tl.logging.set_verbosity(tl.logging.DEBUG) sess = tf.InteractiveSession() # prepare data X_train, y_train, X_val, y_val, X_test, y_test = tl.files.load_mnist_dataset(shape=(-1, 784)...
apache-2.0
iivic/BoiseStateX
lms/djangoapps/shoppingcart/processors/helpers.py
169
1025
""" Helper methods for credit card processing modules. These methods should be shared among all processor implementations, but should NOT be imported by modules outside this package. """ from django.conf import settings from microsite_configuration import microsite def get_processor_config(): """ Return a dic...
agpl-3.0
C-Blu/npyscreen
build/lib/npyscreen/stdfmemail.py
15
9374
import curses import weakref import npyscreen import email import mimetypes import os.path class EmailTreeLine(npyscreen.TreeLine): def display_value(self, vl): return vl if vl: return vl.getContent().get_content_type() else: return "" class EmailTree(npyscreen....
bsd-2-clause
netscaler/horizon
openstack_dashboard/dashboards/project/networks/forms.py
11
2268
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2012 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # Copyright 2012 NEC Corporation # # Licensed under the Apache License, Version 2.0 (the "License"); you may # ...
apache-2.0
calebmadrigal/radio-hacking-scripts
auto_crop_signal.py
1
2186
import sys import scipy import numpy as np def read_pcm_file(file_path, file_type=scipy.complex64): with open(file_path, 'rb') as f: return scipy.fromfile(f, dtype=file_type) def write_pcm_file(file_path, signal_data, file_type='complex64'): np.array(signal_data).astype('complex64').tofile(file_path) ...
mit
abhishekgahlot/scikit-learn
sklearn/externals/joblib/memory.py
50
36180
""" A context object for caching a function's return value each time it is called with the same input arguments. """ # Author: Gael Varoquaux <gael dot varoquaux at normalesup dot org> # Copyright (c) 2009 Gael Varoquaux # License: BSD Style, 3 clauses. from __future__ import with_statement import os import shutil ...
bsd-3-clause
Ragora/T2-ScriptDump
scripts/playerdb.py
1
2392
""" Player datablock generator, written to test an experimental super-2046 DB count patch. """ import sys import math class PseudoNumber: _value = None _digits = None _decimal_value = None _converted = None def __init__(self, digits=None, value=None): self._digits = digits self._decimal_value = int(value)...
mit
intel-iot-devkit/upm
examples/python/mcp2515.py
6
2931
#!/usr/bin/env python # Author: Jon Trulson <jtrulson@ics.com> # Copyright (c) 2016 Intel Corporation. # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # witho...
mit
jerluc/wmii
alternative_wmiircs/python/pyxp/client.py
9
9838
# Copyright (C) 2009 Kris Maglione import operator import os import re import sys from threading import * import traceback import pyxp from pyxp import fcall, fields from pyxp.mux import Mux from pyxp.types import * if os.environ.get('NAMESPACE', None): namespace = os.environ['NAMESPACE'] else: try: ...
mit
dumrelu/Snake
snake GPIO.py
1
6425
#!/usr/bin/python import time import os from random import randint GPIO.setmode(GPIO.BCM); BUTON_SUS=17;BUTON_JOS=22;BUTON_STANGA=27;BUTON_DREAPTA=4; LED0=23;LED1=24;LED2=25; GPIO.setup(BUTON_SUS,GPIO.IN); GPIO.setup(BUTON_JOS,GPIO.IN); GPIO.setup(BUTON_STANGA,GPIO.IN); GPIO.setup(BUTON_DREAPTA,GPIO.IN); GPIO.setup(...
mit
KaranToor/MA450
google-cloud-sdk/.install/.backup/lib/third_party/apitools/gen/extended_descriptor.py
25
21730
#!/usr/bin/env python # # Copyright 2015 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 o...
apache-2.0
blossomica/airmozilla
mysql2postgres/py-mysql2pgsql-0.1.5/mysql2pgsql/lib/mysql_reader.py
16
7435
from __future__ import with_statement, absolute_import import re from contextlib import closing import MySQLdb import MySQLdb.cursors re_column_length = re.compile(r'\((\d+)\)') re_column_precision = re.compile(r'\((\d+),(\d+)\)') re_key_1 = re.compile(r'CONSTRAINT `(\w+)` FOREIGN KEY \(`(\w+)`\) REFERENCES `(\w+)`...
bsd-3-clause
M4rtinK/anaconda
pyanaconda/core/timer.py
4
3465
# Timer class for scheduling methods after some time. # # Copyright (C) 2018 Red Hat, Inc. # # This copyrighted material is made available to anyone wishing to use, # modify, copy, or redistribute it subject to the terms and conditions of # the GNU General Public License v.2, or (at your option) any later version. # Th...
gpl-2.0
Poles/Poles
platforms/linux/JsonCpp/scons-local-2.3.0/SCons/Tool/ifort.py
11
3362
"""SCons.Tool.ifort Tool-specific initialization for newer versions of the Intel Fortran Compiler for Linux/Windows (and possibly Mac OS X). There normally shouldn't be any need to import this module directly. It will usually be imported through the generic SCons.Tool.Tool() selection method. """ # # Copyright (c) ...
gpl-3.0
XiaominZhang/Impala
tests/comparison/cli_options.py
12
7034
# Copyright (c) 2014 Cloudera, 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 o...
apache-2.0
txemi/ansible
lib/ansible/utils/module_docs_fragments/dellos9.py
303
2451
# # (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 version 3 of the Licens...
gpl-3.0
fotinakis/sentry
src/sentry/models/eventerror.py
1
2581
from __future__ import absolute_import import six class EventError(object): INVALID_DATA = 'invalid_data' INVALID_ATTRIBUTE = 'invalid_attribute' VALUE_TOO_LONG = 'value_too_long' UNKNOWN_ERROR = 'unknown_error' SECURITY_VIOLATION = 'security_violation' RESTRICTED_IP = 'restricted_ip' JS...
bsd-3-clause
hainm/scikit-learn
examples/preprocessing/plot_function_transformer.py
161
1949
""" ========================================================= Using FunctionTransformer to select columns ========================================================= Shows how to use a function transformer in a pipeline. If you know your dataset's first principle component is irrelevant for a classification task, you ca...
bsd-3-clause
blackzw/openwrt_sdk_dev1
staging_dir/target-mips_r2_uClibc-0.9.33.2/usr/lib/python2.7/keyword.py
179
1994
#! /usr/bin/env python """Keywords (from "graminit.c") This file is automatically generated; please don't muck it up! To update the symbols in this file, 'cd' to the top directory of the python source tree after building the interpreter and run: python Lib/keyword.py """ __all__ = ["iskeyword", "kwlist"] kwli...
gpl-2.0
dmnyu/bitcurator
bctools/fiwalk.py
3
9124
#!/usr/bin/env python ### DO NOT MODIFY THIS FILE ### ### DOWNLOAD NEW FILE FROM https://raw.github.com/simsong/dfxml/master/python/fiwalk.py # # fiwalk version 0.6.3 # # %%% BEGIN NO FILL """fiwalk module This is the part of dfxml that is dependent on fiwalk.py """ import dfxml from sys import stderr from subprocess...
gpl-3.0
dodo5522/python-xbee
xbee/tests/test_frame.py
51
3082
#! /usr/bin/python """ test_frame.py Paul Malmsten, 2010 pmalmsten@gmail.com Tests frame module for proper behavior """ import unittest from xbee.frame import APIFrame from xbee.python2to3 import byteToInt, intToByte class TestAPIFrameGeneration(unittest.TestCase): """ XBee class must be able to create a val...
mit
woodpecker1/phantomjs
src/qt/qtwebkit/Tools/QueueStatusServer/handlers/gc.py
146
2038
# Copyright (C) 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 of conditions and the...
bsd-3-clause
arnoldlu/lisa
libs/utils/android/benchmark.py
3
13801
# SPDX-License-Identifier: Apache-2.0 # # Copyright (C) 2015, ARM Limited and contributors. # # 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
573719929/Common-Processor
gen-py/hbase/ttypes.py
1
38818
# # Autogenerated by Thrift Compiler (0.8.0) # # DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING # # options string: py # from thrift.Thrift import TType, TMessageType, TException from thrift.transport import TTransport from thrift.protocol import TBinaryProtocol, TProtocol try: from ...
apache-2.0
Workday/OpenFrame
tools/telemetry/third_party/gsutilz/third_party/apitools/apitools/base/py/testing/mock.py
22
11755
"""The mock module allows easy mocking of apitools clients. This module allows you to mock out the constructor of a particular apitools client, for a specific API and version. Then, when the client is created, it will be run against an expected session that you define. This way code that is not aware of the testing fr...
bsd-3-clause
kaplun/inspire-next
inspirehep/modules/theme/ext.py
2
4001
# -*- coding: utf-8 -*- # # This file is part of INSPIRE. # Copyright (C) 2014-2017 CERN. # # INSPIRE 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 ...
gpl-3.0
jmighion/ansible
lib/ansible/modules/windows/win_scheduled_task.py
21
17716
#!/usr/bin/python # -*- coding: utf-8 -*- # This file is part of Ansible # Copyright (c) 2017 Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['preview'], 'supp...
gpl-3.0
luogangyi/Ceilometer-oVirt
build/lib/ceilometer/network/statistics/opendaylight/client.py
4
6462
# # Copyright 2013 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 by applicable...
apache-2.0
colinligertwood/odoo
addons/web/tests/test_menu.py
34
5729
# -*- coding: utf-8 -*- import collections import mock import unittest2 from openerp.http import request as req from . import common from ..controllers import main class Placeholder(object): def __init__(self, **kwargs): for k, v in kwargs.iteritems(): setattr(self, k, v) class LoadTest(co...
agpl-3.0
ambikeshwar1991/gnuradio-3.7.4
gr-utils/python/modtool/templates.py
27
20572
# # Copyright 2013 Free Software Foundation, Inc. # # This file is part of GNU Radio # # GNU Radio is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3, or (at your option) # any later version. # #...
gpl-3.0
egabancho/lumberjack
lumberjack/schemas.py
3
4741
# -*- coding: utf-8 -*- # # This file is part of Lumberjack. # Copyright 2014 CERN. # # Lumberjack is free software: you can redistribute it and/or modify it under # the terms of the GNU Lesser General Public License as published by the Free # Software Foundation, either version 3 of the License, or (at your option) an...
gpl-3.0
mconlon17/vivo-pump
uf_examples/courses/merge_filter.py
3
1328
#!/usr/bin/env/python """ merge_filter.py -- find the courses in VIVO, and match them to the courses in the source. They must match on ccn There are two inputs: 1. Courses in VIVO. Keyed by ccn 2. UF courses in the source. Keyed the same. There are three cases 1. Course in VIVO and in ...
bsd-2-clause
titasakgm/brc-stock
openerp/addons/l10n_ch/account_wizard.py
424
2192
# -*- coding: utf-8 -*- ############################################################################## # # Author: Nicolas Bessi. Copyright Camptocamp SA # Financial contributors: Hasa SA, Open Net SA, # Prisme Solutions Informatique SA, Quod SA # # Translation contributors: brain-te...
agpl-3.0
shipci/sympy
sympy/core/tests/test_expr.py
4
55752
from __future__ import division from sympy import (Add, Basic, S, Symbol, Wild, Float, Integer, Rational, I, sin, cos, tan, exp, log, nan, oo, sqrt, symbols, Integral, sympify, WildFunction, Poly, Function, Derivative, Number, pi, NumberSymbol, zoo, Piecewise, Mul, Pow, nsimplify, ratsimp, trigsimp, radsim...
bsd-3-clause
gh1026/linux-3.4
Documentation/networking/cxacru-cf.py
14668
1626
#!/usr/bin/env python # Copyright 2009 Simon Arlott # # 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. # # This program i...
gpl-2.0
marvin-jens/clip_analysis
scorethresh.py
1
1049
#!/usr/bin/env python # Simple script to filter lines of the input for meeting a numeric # threshold on one, or one of multiple (comma-separated) column numbers. # If threshold is required on each column, you can chain multiple # scorethresh.py calls with pipes. # by default, the column value has to be larger or equa...
gpl-3.0
pap/rethinkdb
test/rql_test/connections/http_support/werkzeug/wsgi.py
146
37745
# -*- coding: utf-8 -*- """ werkzeug.wsgi ~~~~~~~~~~~~~ This module implements WSGI related helpers. :copyright: (c) 2014 by the Werkzeug Team, see AUTHORS for more details. :license: BSD, see LICENSE for more details. """ import re import os import sys import posixpath import mimetypes from itert...
agpl-3.0
pku9104038/edx-platform
lms/djangoapps/instructor_task/views.py
69
10964
import json import logging from django.http import HttpResponse from django.utils.translation import ugettext as _ from celery.states import FAILURE, REVOKED, READY_STATES from instructor_task.api_helper import (get_status_from_instructor_task, get_updated_instructor_task) fr...
agpl-3.0
maestrano/odoo
addons/stock_invoice_directly/stock_invoice_directly.py
337
2132
# -*- 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
BBN-Q/Auspex
src/auspex/instruments/kepco.py
1
1699
# Copyright 2016 Raytheon BBN Technologies # # 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 __all__ = ['BOP2020M'] from auspex.log import lo...
apache-2.0
krafczyk/spack
var/spack/repos/builtin/packages/p4est/package.py
5
2340
############################################################################## # Copyright (c) 2013-2018, Lawrence Livermore National Security, LLC. # Produced at the Lawrence Livermore National Laboratory. # # This file is part of Spack. # Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved. # LLNL-CODE-64...
lgpl-2.1
dischinator/pyload
module/plugins/crypter/ImgurCom.py
3
5831
# -*- coding: utf-8 -*- import re from module.plugins.internal.SimpleCrypter import SimpleCrypter from module.plugins.internal.misc import json, uniqify class ImgurCom(SimpleCrypter): __name__ = "ImgurCom" __type__ = "crypter" __version__ = "0.59" __status__ = "testing" __pattern__ = r'h...
gpl-3.0
usc-isi/horizon-old
horizon/horizon/dashboards/syspanel/images/forms.py
2
3258
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2011 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # Copyright 2011 Nebula, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # no...
apache-2.0