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
vbshah1992/microblog
flask/lib/python2.7/site-packages/pip-1.5.4-py2.7.egg/pip/_vendor/html5lib/filters/lint.py
250
4062
from __future__ import absolute_import, division, unicode_literals from gettext import gettext _ = gettext from . import _base from ..constants import cdataElements, rcdataElements, voidElements from ..constants import spaceCharacters spaceCharacters = "".join(spaceCharacters) class LintError(Exception): pass ...
bsd-3-clause
FIWARE-TMForum/business-ecosystem-charging-backend
src/wstore/__init__.py
1
2300
# -*- coding: utf-8 -*- # Copyright (c) 2016 - 2017 CoNWeT Lab., Universidad Politécnica de Madrid # This file belongs to the business-charging-backend # of the Business API Ecosystem. # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License...
agpl-3.0
aequitas/home-assistant
homeassistant/components/conversation/__init__.py
7
5514
"""Support for functionality to have conversations with Home Assistant.""" import logging import re import voluptuous as vol from homeassistant import core from homeassistant.components import http from homeassistant.components.cover import ( INTENT_CLOSE_COVER, INTENT_OPEN_COVER) from homeassistant.components.ht...
apache-2.0
valentin-krasontovitsch/ansible
lib/ansible/plugins/doc_fragments/docker.py
5
5695
# -*- coding: utf-8 -*- # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) class ModuleDocFragment(object): # Docker doc fragment DOCUMENTATION = r''' options: docker_host: description: - The URL or Unix socket path used to connect to the Do...
gpl-3.0
rmboggs/django
django/conf/locale/ml/formats.py
1007
1815
# -*- encoding: utf-8 -*- # This file is distributed under the same license as the Django package. # from __future__ import unicode_literals # The *_FORMAT strings use the Django date format syntax, # see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date DATE_FORMAT = 'N j, Y' TIME_FORMAT = 'P' DATETIM...
bsd-3-clause
mbauskar/sapphire-erpnext
erpnext/stock/get_item_details.py
1
15380
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals import frappe from frappe import _, throw from frappe.utils import flt, cint, add_days, cstr import json from erpnext.accounts.doctype.pricing_rule.pric...
agpl-3.0
costypetrisor/scikit-learn
examples/exercises/plot_iris_exercise.py
323
1602
""" ================================ SVM Exercise ================================ A tutorial exercise for using different SVM kernels. This exercise is used in the :ref:`using_kernels_tut` part of the :ref:`supervised_learning_tut` section of the :ref:`stat_learn_tut_index`. """ print(__doc__) import numpy as np i...
bsd-3-clause
Krossom/python-for-android
python-modules/twisted/twisted/words/test/test_irc.py
49
58572
# Copyright (c) 2001-2010 Twisted Matrix Laboratories. # See LICENSE for details. """ Tests for L{twisted.words.protocols.irc}. """ import time from twisted.trial import unittest from twisted.trial.unittest import TestCase from twisted.words.protocols import irc from twisted.words.protocols.irc import IRCClient from...
apache-2.0
ofayans/freeipa
ipaclient/remote_plugins/2_49/automount.py
8
34860
# # Copyright (C) 2016 FreeIPA Contributors see COPYING for license # # pylint: disable=unused-import import six from . import Command, Method, Object from ipalib import api, parameters, output from ipalib.parameters import DefaultFrom from ipalib.plugable import Registry from ipalib.text import _ from ipapython.dn ...
gpl-3.0
gustavo-guimaraes/siga
backend/venv/lib/python2.7/site-packages/unidecode/x026.py
165
4020
data = ( '', # 0x00 '', # 0x01 '', # 0x02 '', # 0x03 '', # 0x04 '', # 0x05 '', # 0x06 '', # 0x07 '', # 0x08 '', # 0x09 '', # 0x0a '', # 0x0b '', # 0x0c '', # 0x0d '', # 0x0e '', # 0x0f '', # 0x10 '', # 0x11 '', # 0x12 '', # 0x13 '[?]', # 0x14 '[?]', # 0x...
mit
ininex/geofire-python
resource/lib/python2.7/site-packages/pip/_vendor/requests/packages/chardet/cp949prober.py
2801
1782
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is mozilla.org 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 Reserved. # # Con...
mit
RecursiveGreen/pymod
formats/MOD.py
1
9729
import struct from pymod.constants import * from pymod.module import * from pymod.tables import * from pymod.util import * MOD_TYPES = ( ('M.K.', 'Amiga-NewTracker', 4), ('M!K!', 'Amiga-ProTracker', 4), ('M&K!', 'Amiga-NoiseTracker', 4), ('N.T.', 'Amiga-NoiseTracker?', 4), # ???, mentioned in libMod...
gpl-3.0
heiko-r/paparazzi
sw/tools/airframe_editor/gui_dialogs.py
29
1632
#!/usr/bin/env python from __future__ import print_function import gtk from os import path if gtk.pygtk_version < (2, 3, 90): print("Please upgrade your pygtk") raise SystemExit def filechooser(pathname): dialog = gtk.FileChooserDialog("Open ...", None, gtk.FILE_CHOO...
gpl-2.0
kuri65536/python-for-android
python-modules/twisted/twisted/python/hook.py
90
5266
# Copyright (c) 2001-2004 Twisted Matrix Laboratories. # See LICENSE for details. """ I define support for hookable instance methods. These are methods which you can register pre-call and post-call external functions to augment their functionality. People familiar with more esoteric languages may think of these a...
apache-2.0
yahoo/npm
node_modules/node-gyp/gyp/pylib/gyp/MSVSSettings_test.py
778
65880
#!/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. """Unit tests for the MSVSSettings.py file.""" import StringIO import unittest import gyp.MSVSSettings as MSVSSettings class TestSequence...
artistic-2.0
leggitta/mne-python
mne/decoding/mixin.py
19
1063
class TransformerMixin(object): """Mixin class for all transformers in scikit-learn""" def fit_transform(self, X, y=None, **fit_params): """Fit to data, then transform it Fits transformer to X and y with optional parameters fit_params and returns a transformed version of X. Pa...
bsd-3-clause
ooici/coi-services
ion/agents/instrument/test/test_agent_persistence.py
1
29918
#!/usr/bin/env python """ @package ion.agents.instrument.test.test_agent_persistence @file ion/agents.instrument/test_agent_persistence.py @author Edward Hunter @brief Test cases for R2 instrument agent state and config persistence between running instances. """ __author__ = 'Edward Hunter' # Import pyon first for ...
bsd-2-clause
akaszynski/vtkInterface
examples/02-plot/lighting.py
1
1906
""" Lighting Controls ~~~~~~~~~~~~~~~~~ Control aspects of the rendered mesh's lighting such as Ambient, Diffuse, and Specular. These options only work if the ``lighting`` argument to ``add_mesh`` is ``True`` (it's true by default). You can turn off all lighting by passing ``lighting=False`` to ``add_mesh``. """ # sp...
mit
nion-software/nionswift
nion/swift/HistogramPanel.py
1
37648
# standard libraries import functools import gettext import operator import typing # third party libraries import numpy # local libraries from nion.data import Core from nion.data import Image from nion.swift import DisplayPanel from nion.swift import Panel from nion.swift.model import DisplayItem from nion.swift.mod...
gpl-3.0
leighpauls/k2cro4
third_party/webdriver/pylib/test/selenium/webdriver/common/google_one_box.py
51
1418
# Copyright 2008-2009 WebDriver committers # Copyright 2008-2009 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 requ...
bsd-3-clause
tcwicklund/django
django/contrib/admin/sites.py
120
21146
from functools import update_wrapper from django.apps import apps from django.conf import settings from django.contrib.admin import ModelAdmin, actions from django.contrib.auth import REDIRECT_FIELD_NAME from django.core.exceptions import ImproperlyConfigured, PermissionDenied from django.core.urlresolvers import NoRe...
bsd-3-clause
elit3ge/SickRage
sickbeard/providers/binsearch.py
7
3930
# Author: moparisthebest <admin@moparisthebest.com> # # This file is part of Sick Beard. # # Sick Beard is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) an...
gpl-3.0
kchodorow/tensorflow
tensorflow/python/client/session_benchmark.py
32
4750
# 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
tatsuy/ardupilot
Tools/LogAnalyzer/tests/TestDualGyroDrift.py
73
5485
from __future__ import print_function from LogAnalyzer import Test,TestResult import DataflashLog # import scipy # import pylab #### TEMP!!! only for dev # from scipy import signal class TestDualGyroDrift(Test): '''test for gyro drift between dual IMU data''' def __init__(self): Test.__init__(self) self.n...
gpl-3.0
fragro/django-postman
setup.py
6
1183
from setuptools import setup, find_packages setup( name='django-postman', version=__import__('postman').__version__, description='User-to-User messaging system for Django, with gateway to AnonymousUser,' \ ' moderation and thread management, user & exchange filters, inbox/sent/archives/trash folder...
bsd-3-clause
konstruktoid/ansible-upstream
lib/ansible/modules/monitoring/icinga2_feature.py
89
4294
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright (c) 2016, Loic Blot <loic.blot@unix-experience.fr> # Copyright (c) 2018, Ansible Project # Sponsored by Infopro Digital. http://www.infopro-digital.com/ # Sponsored by E.T.A.I. http://www.etai.fr/ # # GNU General Public License v3.0+ (see COPYING or https://www.gnu...
gpl-3.0
Distrotech/intellij-community
python/lib/Lib/dummy_threading.py
102
2900
"""Faux ``threading`` version using ``dummy_thread`` instead of ``thread``. The module ``_dummy_threading`` is added to ``sys.modules`` in order to not have ``threading`` considered imported. Had ``threading`` been directly imported it would have made all subsequent imports succeed regardless of whether ``thread`` wa...
apache-2.0
dssg/cincinnati2015-public
evaluation/webapp/evaluation.py
1
5838
from datetime import datetime import numpy as np import pandas as pd import matplotlib.pyplot as plt from sklearn import metrics from webapp import config def weighted_f1(scores): f1_0 = scores["f1"][0] * scores["support"][0] f1_1 = scores["f1"][1] * scores["support"][1] return (f1_0 + f1_1) / (scores[...
mit
oihane/odoo
openerp/addons/base/tests/test_orm.py
49
18125
from collections import defaultdict from openerp.tools import mute_logger from openerp.tests import common UID = common.ADMIN_USER_ID DB = common.DB class TestORM(common.TransactionCase): """ test special behaviors of ORM CRUD functions TODO: use real Exceptions types instead of Exception """ d...
agpl-3.0
anirudhSK/chromium
tools/telemetry/telemetry/core/platform/android_platform_backend_unittest.py
2
3190
# 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. import logging import os import unittest from telemetry import test from telemetry.core import bitmap from telemetry.core import util from telemetry.core.pl...
bsd-3-clause
hubert667/AIR
build/scripts-2.7/summarize-learning-experiment.py
1
3971
#!/usr/bin/python # This file is part of Lerot. # # Lerot 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) any later version. # # Lerot is distribu...
gpl-3.0
devendermishrajio/nova_test_latest
doc/ext/nova_todo.py
64
3385
# -*- coding: utf-8 -*- # This is a hack of the builtin todo extension, to make the todo_list # more user friendly. from sphinx.ext.todo import * import re def _(s): return s def process_todo_nodes(app, doctree, fromdocname): if not app.config['todo_include_todos']: for node in doctree.traverse(tod...
apache-2.0
zuoshifan/instimager
imager/telescope.py
1
33995
import abc import numpy as np import visibility from util import util from util import typeutil from cora.util import hputil, units from caput import config def in_range(arr, min, max): """Check if array entries are within the given range. Parameters ---------- arr : np.ndarray Array to ch...
gpl-2.0
you21979/phantomjs
src/breakpad/src/tools/gyp/test/sibling/gyptest-all.py
151
1061
#!/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. """ """ import TestGyp test = TestGyp.TestGyp() test.run_gyp('build/all.gyp', chdir='src') test.build('build/all.gyp', test.ALL, chdir='...
bsd-3-clause
ovresko/erpnext
erpnext/education/doctype/fee_schedule/fee_schedule.py
7
5324
# -*- coding: utf-8 -*- # Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and contributors # For license information, please see license.txt from __future__ import unicode_literals import frappe, erpnext from frappe.model.document import Document from frappe.model.mapper import get_mapped_doc from frappe.utils impor...
gpl-3.0
iiisthu/sparkSdn
python/pyspark/conf.py
4
5745
# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not us...
apache-2.0
mfjb/scikit-learn
sklearn/feature_selection/rfe.py
137
17066
# Authors: Alexandre Gramfort <alexandre.gramfort@inria.fr> # Vincent Michel <vincent.michel@inria.fr> # Gilles Louppe <g.louppe@gmail.com> # # License: BSD 3 clause """Recursive feature elimination for feature ranking""" import warnings import numpy as np from ..utils import check_X_y, safe_sqr fro...
bsd-3-clause
citrusleaf/dd-agent
utils/flare.py
5
20834
# stdlib import atexit import cStringIO as StringIO from functools import partial import glob try: import grp except ImportError: # The module only exists on Unix platforms grp = None import logging import os try: import pwd except ImportError: # Same as above (exists on Unix platforms only) pwd...
bsd-3-clause
OdifYltsaeb/django-guardian
guardian/backends.py
12
2073
from django.db import models from guardian.conf import settings from guardian.exceptions import WrongAppError from guardian.core import ObjectPermissionChecker from guardian.models import User class ObjectPermissionBackend(object): supports_object_permissions = True supports_anonymous_user = True supports...
bsd-2-clause
inmomentsoftware/pledgeservice
lib/requests/packages/chardet/charsetgroupprober.py
2929
3791
######################## 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 ...
agpl-3.0
ChemiKhazi/Sprytile
rx/linq/observable/groupby.py
3
1224
from rx import Observable from rx.internal import extensionmethod @extensionmethod(Observable) def group_by(self, key_selector, element_selector=None, key_serializer=None): """Groups the elements of an observable sequence according to a specified key selector function and comparer and selects the...
mit
codingvirtual/fullstack-p4-conference
utils.py
384
1576
import json import os import time import uuid from google.appengine.api import urlfetch from models import Profile def getUserId(user, id_type="email"): if id_type == "email": return user.email() if id_type == "oauth": """A workaround implementation for getting userid.""" auth = os.ge...
apache-2.0
zzxuanyuan/root
documentation/doxygen/converttonotebook.py
4
35547
#!/usr/bin/env python # Author: Pau Miquel i Mir <pau.miquel.mir@cern.ch> <pmm1g15@soton.ac.uk>> # Date: July, 2016 # # DISCLAIMER: This script is a prototype and a work in progress. Indeed, it is possible that # it may not work for certain tutorials, and that it, or the tutorial, might need to be # tweaked slightly to...
lgpl-2.1
angelman/phantomjs
src/qt/qtwebkit/Tools/Scripts/webkitpy/layout_tests/reftests/extract_reference_link_unittest.py
122
3414
# Copyright (C) 2011 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
untrustbank/litecoin
test/functional/feature_logging.py
13
2462
#!/usr/bin/env python3 # Copyright (c) 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. """Test debug logging.""" import os from test_framework.test_framework import BitcoinTestFramework class Log...
mit
lmazuel/azure-sdk-for-python
azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/load_balancer_backend_address_pools_operations.py
1
8115
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # # Code generated by Microsoft (R) AutoRest Code Generator. # Changes ...
mit
ingadhoc/odoo
addons/l10n_be_coda/wizard/__init__.py
439
1098
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # # Copyright (c) 2011 Noviat nv/sa (www.noviat.be). All rights reserved. # # This program is free software: you can redistribute it and/or modify # it u...
agpl-3.0
40223234/w16b_test
static/Brython3.1.1-20150328-091302/Lib/unittest/test/testmock/testwith.py
739
5806
import unittest from warnings import catch_warnings from unittest.test.testmock.support import is_instance from unittest.mock import MagicMock, Mock, patch, sentinel, mock_open, call something = sentinel.Something something_else = sentinel.SomethingElse class WithTest(unittest.TestCase): def test_with_sta...
agpl-3.0
zeimusu/D1
nummeth.py
1
1770
def sample_cubic(x): return x**3 - 2*x - 1 def Dsample_cubic(x): return 3*x**2 - 2 def sign(x): if x<0: return -1 else: return 1 def bisection(f,a,b,fa,fb): """given a function, f, and an interval [a,b] in which f changes sign return a new interval [x,y] in which f changes si...
gpl-3.0
HPPTECH/hpp_IOSTressTest
Refer/IOST_OLD_SRC/IOST_0.17/Libs/IOST_AboutDialog.py
2
2723
#!/usr/bin/python #====================================================================== # # Project : hpp_IOStressTest # File : IOST_AboutDialog.py # Date : Sep 21, 2016 # Author : HuuHoang Nguyen # Contact : hhnguyen@apm.com # : hoangnh.hpp@gmail.com # License : MIT License # Copyright : 2016 ...
mit
pietern/caffe2
caffe2/python/helpers/conv.py
3
11062
# Copyright (c) 2016-present, Facebook, 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...
apache-2.0
KurtDeGreeff/infernal-twin
build/pip/build/lib.linux-i686-2.7/pip/_vendor/requests/packages/chardet/hebrewprober.py
2929
13359
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Universal charset detector code. # # The Initial Developer of the Original Code is # Shy Shalom # Portions created by the Initial Developer are Copyright (C) 2005 # the Initial Developer. All Rights Reserved. #...
gpl-3.0
diofeher/django-nfa
django/core/management/commands/runserver.py
16
3339
from django.core.management.base import BaseCommand, CommandError from optparse import make_option import os import sys class Command(BaseCommand): option_list = BaseCommand.option_list + ( make_option('--noreload', action='store_false', dest='use_reloader', default=True, help='Tells Django to ...
bsd-3-clause
yufengg/tensorflow
tensorflow/contrib/boosted_trees/python/ops/model_ops.py
17
5122
# 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
aavanian/bokeh
examples/app/crossfilter/main.py
5
2462
import pandas as pd from bokeh.layouts import row, widgetbox from bokeh.models import Select from bokeh.palettes import Spectral5 from bokeh.plotting import curdoc, figure from bokeh.sampledata.autompg import autompg_clean as df df = df.copy() SIZES = list(range(6, 22, 3)) COLORS = Spectral5 N_SIZES = len(SIZES) N_C...
bsd-3-clause
espadrine/opera
chromium/src/tools/swarm_client/isolateserver_archive.py
2
14494
#!/usr/bin/env python # Copyright (c) 2012 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. """Archives a set of files to a server.""" import binascii import cStringIO import hashlib import itertools import logging import ...
bsd-3-clause
dobbymoodge/origin
vendor/github.com/getsentry/raven-go/docs/_sentryext/sentryext.py
36
25388
import re import os import sys import json import posixpath from itertools import chain from urlparse import urljoin from docutils import nodes from docutils.io import StringOutput from docutils.nodes import document, section from docutils.statemachine import ViewList from docutils.parsers.rst import directives from s...
apache-2.0
2014c2g18/c2g18
w2/static/Brython2.0.0-20140209-164925/Lib/types.py
756
3167
""" Define names for built-in types that aren't directly accessible as a builtin. """ import sys # Iterators in Python aren't a matter of type but of protocol. A large # and changing number of builtin types implement *some* flavor of # iterator. Don't check the type! Use hasattr to check for both # "__iter__" and "...
gpl-2.0
pythonchelle/opencomparison
apps/apiv1/tests/test_resources.py
3
1333
import json from django.test import TestCase from django.core.urlresolvers import reverse from apiv1.tests import data class ResourcesV1Tests(TestCase): base_kwargs = {'api_name': 'v1'} def setUp(self): data.load() def test_01_category(self): kwargs = {'resource_name': 'category'} ...
mit
martinblech/pyfpm
pyfpm/pattern.py
2
10947
""" This module holds the actual pattern implementations. End users should not normally have to deal with it, except for constructing patterns programatically without making use of the pattern syntax parser. """ import re try: # python 2.x base string _basestring = basestring except NameError: # python ...
mit
MarcosCommunity/odoo
comunity_modules/product_prices_update/wizard/wizard_update_prices.py
3
7297
# -*- coding: utf-8 -*- from openerp import fields, models, api, _ from openerp.exceptions import Warning from openerp import tools class prices_update_wizard(models.TransientModel): _name = 'product.prices_update_wizard' price_type = fields.Selection( [('list_price', 'Sale Price'), ('standard_price'...
agpl-3.0
orospakr/peephole
peephole/peephole_client.py
1
5019
#!/usr/bin/env python # Peephole - a D-Bus service providing access to small LCD panels # Copyright (C) 2007-2008 Andrew Clunis # 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...
gpl-3.0
puchake/market-teller
src/data_handling/set_assembly.py
1
7628
import numpy as np import datetime as dt from os import listdir, path def gather_mats( split_mat, avg_5_mat, avg_25_mat, avg_50_mat, dates_mat, min_year ): """ Collects chosen columns from split and avg matrices and adds dates_mat indicator data for each row (each day). :param split_mat: origi...
mit
FlaPer87/django-nonrel
django/dispatch/dispatcher.py
19
8313
import weakref from django.dispatch import saferef WEAKREF_TYPES = (weakref.ReferenceType, saferef.BoundMethodWeakref) def _make_id(target): if hasattr(target, 'im_func'): return (id(target.im_self), id(target.im_func)) return id(target) class Signal(object): """ Base class for all signals ...
bsd-3-clause
margaret/python-datamuse
datamuse/test_api.py
1
1445
import unittest import datamuse from datamuse import Datamuse class DatamuseTestCase(unittest.TestCase): def setUp(self): self.api = Datamuse() self.max = 5 # words endpoint def test_sounds_like(self): args = {'sl': 'orange', 'max': self.max} data = self.api.words(**args) ...
mit
jetskijoe/headphones
lib/unidecode/x0d5.py
253
4680
data = ( 'pyuk', # 0x00 'pyut', # 0x01 'pyup', # 0x02 'pyuh', # 0x03 'peu', # 0x04 'peug', # 0x05 'peugg', # 0x06 'peugs', # 0x07 'peun', # 0x08 'peunj', # 0x09 'peunh', # 0x0a 'peud', # 0x0b 'peul', # 0x0c 'peulg', # 0x0d 'peulm', # 0x0e 'peulb', # 0x0f 'peuls', # 0x1...
gpl-3.0
KiChjang/servo
tests/wpt/web-platform-tests/tools/third_party/h2/examples/fragments/client_https_setup_fragment.py
14
3887
# -*- coding: utf-8 -*- """ Client HTTPS Setup ~~~~~~~~~~~~~~~~~~ This example code fragment demonstrates how to set up a HTTP/2 client that negotiates HTTP/2 using NPN and ALPN. For the sake of maximum explanatory value this code uses the synchronous, low-level sockets API: however, if you're not using sockets direct...
mpl-2.0
farhaanbukhsh/sympy
sympy/plotting/pygletplot/color_scheme.py
85
12579
from __future__ import print_function, division from sympy import Basic, Symbol, symbols, lambdify from util import interpolate, rinterpolate, create_bounds, update_bounds from sympy.core.compatibility import range class ColorGradient(object): colors = [0.4, 0.4, 0.4], [0.9, 0.9, 0.9] intervals = 0.0, 1.0 ...
bsd-3-clause
martinribelotta/micropython
drivers/onewire/onewire.py
66
11789
""" OneWire library ported to MicroPython by Jason Hildebrand. TODO: * implement and test parasite-power mode (as an init option) * port the crc checks The original upstream copyright and terms follow. ------------------------------------------------------------------------------ Copyright (c) 2007, Jim Studt ...
mit
jashug/Lightning
serverutil.py
1
2368
"""Utility functions for the server. This includes the interface from the server implementation to the payment channel and lightning network APIs. requires_auth -- decorator which makes a view function require authentication authenticate_before_request -- a before_request callback for auth api_factory -- returns a fl...
mit
jolevq/odoopub
addons/report_webkit/wizard/report_webkit_actions.py
382
6537
# -*- coding: utf-8 -*- ############################################################################## # # Copyright (c) 2010 Camptocamp SA (http://www.camptocamp.com) # All Right Reserved # # Author : Vincent Renaville # # WARNING: This program as such is intended to be used by professional # programmers who take the...
agpl-3.0
qaugustijn/stk-code
tools/update_characteristics.py
16
2103
#!/usr/bin/env python3 # # SuperTuxKart - a fun racing game with go-kart # Copyright (C) 2006-2015 SuperTuxKart-Team # # 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...
gpl-3.0
mkuron/espresso
src/python/espressomd/lbboundaries.py
1
2672
# Copyright (C) 2010-2018 The ESPResSo project # # This file is part of ESPResSo. # # ESPResSo 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 v...
gpl-3.0
jeasoft/odoo
comunity_modules/house_booking/__openerp__.py
4
1098
# -*- coding: utf-8 -*- { 'name' : 'Booking management', 'version' : '1.2', 'author' : 'Alicia FLOREZ & Sébastien CHAZALLET', 'category': 'Sales Management', 'summary': 'Management of house, guestroom or hotel bookings.', 'description' : """ Manage your bookings ==================== This modul...
agpl-3.0
arokem/scipy
scipy/sparse/linalg/tests/test_norm.py
1
5427
"""Test functions for the sparse.linalg.norm module """ from __future__ import division, print_function, absolute_import import numpy as np from numpy.linalg import norm as npnorm from numpy.testing import assert_allclose from pytest import raises as assert_raises import scipy.sparse from scipy.sparse.linalg import ...
bsd-3-clause
dafei2015/hugula
Client/tools/site-packages/PIL/MicImagePlugin.py
13
2228
# # The Python Imaging Library. # $Id: MicImagePlugin.py 2134 2004-10-06 08:55:20Z fredrik $ # # Microsoft Image Composer support for PIL # # Notes: # uses TiffImagePlugin.py to read the actual image streams # # History: # 97-01-20 fl Created # # Copyright (c) Secret Labs AB 1997. # Copyright (c) Fredri...
mit
pascalguru/florincoin
qa/rpc-tests/getblocktemplate_longpoll.py
163
3683
#!/usr/bin/env python2 # Copyright (c) 2014 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. from test_framework import BitcoinTestFramework from bitcoinrpc.authproxy import AuthServiceProxy, JSONRPCExce...
mit
liavkoren/djangoDev
tests/serializers/models.py
29
3090
# -*- coding: utf-8 -*- """ 42. Serialization ``django.core.serializers`` provides interfaces to converting Django ``QuerySet`` objects to and from "flat" data (i.e. strings). """ from __future__ import unicode_literals from decimal import Decimal from django.db import models from django.utils import six from django...
bsd-3-clause
jeremygillies-ea/data_returns_prototype
node_modules/node-sass/node_modules/pangyp/gyp/PRESUBMIT.py
496
3373
# 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. """Top-level presubmit script for GYP. See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts for more details about the presubmit API built...
mit
LaoZhongGu/kbengine
kbe/src/lib/python/Lib/symbol.py
9
2023
#! /usr/bin/env python3 """Non-terminal symbols of Python grammar (from "graminit.h").""" # 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/symbol...
lgpl-3.0
klebercode/lionsclub
eventi/subscriptions/tests/test_views_subscribe.py
1
3025
# coding: utf-8 from django.test import TestCase from django.core.urlresolvers import reverse as r from eventex.subscriptions.forms import SubscriptionForm from eventex.subscriptions.models import Subscription class SubscribeTest(TestCase): def setUp(self): self.resp = self.client.get(r('subscriptions:sub...
mit
Tennyson53/SUR
magnum/common/pythonk8sclient/client/models/V1beta3_NodeList.py
15
2562
#!/usr/bin/env python """ Copyright 2015 Reverb Technologies, 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 require...
apache-2.0
ccellis/WHACK2016
flask/lib/python2.7/site-packages/migrate/versioning/pathed.py
146
2059
""" A path/directory class. """ import os import shutil import logging from migrate import exceptions from migrate.versioning.config import * from migrate.versioning.util import KeyedInstance log = logging.getLogger(__name__) class Pathed(KeyedInstance): """ A class associated with a path/directory tree...
bsd-3-clause
tomMoulard/python-projetcs
scripts3/say_chat.py
1
2153
__author__ = "Brian Lenihan <brian.lenihan@gmail.com" __copyright__ = "Copyright (c) 2012 Python for Android Project" __license__ = "Apache License, Version 2.0" import logging import sl4a from pyxmpp2.jid import JID from pyxmpp2.client import Client from pyxmpp2.settings import XMPPSettings from pyxmpp2.interfaces i...
apache-2.0
thawatchai/mrkimontour
appengine-django/lib/django/conf/locale/nb/formats.py
504
1766
# -*- encoding: utf-8 -*- # This file is distributed under the same license as the Django package. # from __future__ import unicode_literals # The *_FORMAT strings use the Django date format syntax, # see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date DATE_FORMAT = 'j. F Y' TIME_FORMAT = 'H:i' DATET...
gpl-2.0
vlinhd11/vlinhd11-android-scripting
python/src/Lib/test/pydocfodder.py
194
6329
"""Something just to look at via pydoc.""" import types class A_classic: "A classic class." def A_method(self): "Method defined in A." def AB_method(self): "Method defined in A and B." def AC_method(self): "Method defined in A and C." def AD_method(self): "Method de...
apache-2.0
frreiss/tensorflow-fred
tensorflow/python/autograph/pyct/static_analysis/__init__.py
27
1375
# 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
ramielrowe/magnum
magnum/common/pythonk8sclient/client/models/V1beta3_ServiceStatus.py
15
1172
#!/usr/bin/env python """ Copyright 2015 Reverb Technologies, 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 require...
apache-2.0
manjunaths/tensorflow
tensorflow/contrib/framework/python/framework/tensor_util.py
37
13232
# Copyright 2015 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
apache-2.0
cwisecarver/osf.io
scripts/osfstorage/migrate_to_generic.py
5
6466
from __future__ import unicode_literals import sys import logging import datetime from django.utils import timezone from modularodm import Q from modularodm.storage.base import KeyExistsException from scripts import utils as script_utils from framework.transactions.context import TokuTransaction from website.files...
apache-2.0
storborg/manhattan
manhattan/tests/test_middleware.py
1
5386
from __future__ import absolute_import, division, print_function import re from unittest import TestCase from webob import Request, Response from webtest import TestApp, TestRequest from manhattan.middleware import ManhattanMiddleware from manhattan.record import Record from manhattan.log.memory import MemoryLog cl...
mit
kubeflow/pipelines
components/arena/docker/job_generator.py
3
2817
import argparse import datetime import json import os import sys import logging import requests import subprocess import six import time import yaml from subprocess import Popen,PIPE from shlex import split from utils import * # Generate common options def generate_options(args): gpus = args.gpus cpu = args.c...
apache-2.0
cgstudiomap/cgstudiomap
main/parts/odoo/addons/account_analytic_plans/__openerp__.py
264
3114
# -*- 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
HybridF5/jacket
jacket/db/migration.py
1
1220
# Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # 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 ...
apache-2.0
rahulguptakota/paper-To-Reviewer-Matching-System
citeSentClassifier_gurki.py
1
9088
import xml.etree.ElementTree as ET import re import time import os, csv from nltk.tokenize import sent_tokenize from textblob.classifiers import NaiveBayesClassifier from nltk.corpus import stopwords from nltk.tokenize import word_tokenize from nltk.stem import PorterStemmer from sklearn import naive_bayes from random ...
mit
cfe-lab/MiCall
micall/utils/find_missing_samples.py
1
2703
import re from argparse import ArgumentParser, ArgumentDefaultsHelpFormatter import logging from csv import DictReader from pathlib import Path from micall.utils.sample_sheet_parser import sample_sheet_parser logger = logging.getLogger(__name__) def parse_args(): parser = ArgumentParser( description="Lo...
agpl-3.0
haroldl/homeworklog
django/contrib/auth/tests/permissions.py
231
1654
try: from cStringIO import StringIO except ImportError: from StringIO import StringIO from django.contrib.auth.management import create_permissions from django.contrib.auth import models as auth_models from django.contrib.contenttypes import models as contenttypes_models from django.core.management import call...
bsd-3-clause
ruuk/script.module.youtube.dl
lib/youtube_dl/extractor/streamable.py
53
3891
# coding: utf-8 from __future__ import unicode_literals import re from .common import InfoExtractor from ..utils import ( ExtractorError, float_or_none, int_or_none, ) class StreamableIE(InfoExtractor): _VALID_URL = r'https?://streamable\.com/(?:[es]/)?(?P<id>\w+)' _TESTS = [ { ...
gpl-2.0
mmarchini/python-mingus
mingus/extra/tunings.py
10
26880
#!/usr/bin/python # -*- coding: utf-8 -*- # mingus - Music theory Python package, tunings module. # Copyright (C) 2009, Bart Spaans # # 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 Foundati...
gpl-3.0
rizzatti/luigi
luigi/tools/range.py
12
31004
# -*- coding: utf-8 -*- # Copyright (c) 2014 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 or...
apache-2.0