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
msmolens/VTK
ThirdParty/ZopeInterface/zope/interface/tests/test_interface.py
30
72591
############################################################################## # # Copyright (c) 2001, 2002 Zope Foundation and Contributors. # All Rights Reserved. # # This software is subject to the provisions of the Zope Public License, # Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution. # TH...
bsd-3-clause
menardorama/ReadyNAS-Add-ons
headphones-1.0.0/debian/headphones/apps/headphones/lib/requests/auth.py
120
6669
# -*- coding: utf-8 -*- """ requests.auth ~~~~~~~~~~~~~ This module contains the authentication handlers for Requests. """ import os import re import time import hashlib from base64 import b64encode from .compat import urlparse, str from .cookies import extract_cookies_to_jar from .utils import parse_dict_header, ...
gpl-2.0
unatv2/unatv2
qa/rpc-tests/listtransactions.py
145
6081
#!/usr/bin/env python # Copyright (c) 2014 The Bitcoin Core developers # Distributed under the MIT/X11 software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # Exercise the listtransactions API # Add python-bitcoinrpc to module search path: import os import sys sy...
mit
saketkc/statsmodels
tools/backport_pr.py
30
5263
#!/usr/bin/env python """ Backport pull requests to a particular branch. Usage: backport_pr.py branch [PR] e.g.: python tools/backport_pr.py 0.13.1 123 to backport PR #123 onto branch 0.13.1 or python tools/backport_pr.py 1.x to see what PRs are marked for backport that have yet to be applied. Copied fr...
bsd-3-clause
PulsePod/evepod
lib/python2.7/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...
apache-2.0
sergev/mraa
examples/python/rgblcd.py
43
1470
#!/usr/bin/env python # Author: Brendan Le Foll <brendan.le.foll@intel.com> # Copyright (c) 2014 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, inc...
mit
pypa/setuptools
setuptools/command/setopt.py
6
5051
from distutils.util import convert_path from distutils import log from distutils.errors import DistutilsOptionError import distutils import os import configparser from setuptools import Command __all__ = ['config_file', 'edit_config', 'option_base', 'setopt'] def config_file(kind="local"): """Get the filename o...
mit
gonesurfing/Quisk_rpi_remote
hiqsdr/quisk_hardware.py
1
13927
# This is a sample hardware file for UDP control. Use this file for my 2010 transceiver # described in QEX and for the improved version HiQSDR. To turn on the extended # features in HiQSDR, update your FPGA firmware to version 1.1 or later and use use_rx_udp = 2. from __future__ import print_function import struct,...
gpl-2.0
jeezybrick/django
django/conf/locale/lt/formats.py
504
1830
# -*- 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 = r'Y \m. E j \d.' TIME_FORMAT = 'H:...
bsd-3-clause
dmoliveira/networkx
networkx/generators/community.py
30
11963
"""Generators for classes of graphs used in studying social networks.""" import itertools import math import random import networkx as nx # Copyright(C) 2011 by # Ben Edwards <bedwards@cs.unm.edu> # Aric Hagberg <hagberg@lanl.gov> # All rights reserved. # BSD license. __author__ = """\n""".join(['Ben Edw...
bsd-3-clause
hjarmstrong/Odme-plusplus
3rd/build/tools/build/v2/test/TestCmd.py
44
20065
""" TestCmd.py: a testing framework for commands and scripts. The TestCmd module provides a framework for portable automated testing of executable commands and scripts (in any language, not just Python), especially commands and scripts that require file system interaction. In addition to running tests and evaluating...
mit
staranjeet/fjord
vendor/packages/translate-toolkit/translate/search/indexing/CommonIndexer.py
3
25337
# -*- coding: utf-8 -*- # # Copyright 2008 Zuza Software Foundation # # This file is part of translate. # # translate 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 y...
bsd-3-clause
dmeulen/home-assistant
tests/conftest.py
8
1542
"""Setup some common test helper things.""" import functools import logging import pytest import requests_mock as _requests_mock from homeassistant import util from homeassistant.util import location from .common import async_test_home_assistant from .test_util.aiohttp import mock_aiohttp_client logging.basicConfig...
mit
thezawad/flexx
flexx/ui/_formlayout.py
20
8438
""" Example: .. UIExample:: 200 from flexx import ui class Example(ui.Widget): def init(self): with ui.FormLayout(): ui.Label(text='Pet name:') self.b1 = ui.LineEdit() ui.Label(text='Pet Age:') self.b2 = ui.LineEdit()...
bsd-2-clause
louietsai/python-for-android
python-build/python-libs/gdata/build/lib/gdata/tlslite/X509CertChain.py
238
6861
"""Class representing an X.509 certificate chain.""" from utils import cryptomath class X509CertChain: """This class represents a chain of X.509 certificates. @type x509List: list @ivar x509List: A list of L{tlslite.X509.X509} instances, starting with the end-entity certificate and with ever...
apache-2.0
miniconfig/home-assistant
homeassistant/components/switch/netio.py
15
5672
""" The Netio switch component. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/switch.netio/ """ import logging from collections import namedtuple from datetime import timedelta import voluptuous as vol from homeassistant.core import callback from home...
mit
TaiSakuma/AlphaTwirl
tests/unit/roottree/test_EventBuilder.py
1
2175
import unittest import sys from alphatwirl.roottree import EventBuilderConfig ##__________________________________________________________________|| hasROOT = False try: import ROOT hasROOT = True except ImportError: pass if hasROOT: from alphatwirl.roottree.EventBuilder import EventBuilder ##______...
bsd-3-clause
mpare002/HackTech_2017
env/Lib/site-packages/werkzeug/contrib/profiler.py
362
5151
# -*- coding: utf-8 -*- """ werkzeug.contrib.profiler ~~~~~~~~~~~~~~~~~~~~~~~~~ This module provides a simple WSGI profiler middleware for finding bottlenecks in web application. It uses the :mod:`profile` or :mod:`cProfile` module to do the profiling and writes the stats to the stream provide...
mit
TheWaunaKeeganOrganization/Yahtzee
src/yahtzee_categories.py
1
1373
from collections import Counter def ones(d): return 1*d.count(1) def twos(d): return 2*d.count(2) def threes(d): return 3*d.count(3) def fours(d): return 4*d.count(4) def fives(d): return 5*d.count(5) def sixes(d): return 6*d.count(6) def threeOfAKind(d): if max(Counter(d).itervalues())>=3: return sum(d...
gpl-3.0
chaos-adept/timelyb
appengine_config.py
1
1421
#!/usr/bin/env python # # Copyright 2010 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law o...
gpl-3.0
glenux/contrib-mitro
browser-ext/third_party/firefox-addon-sdk/python-lib/simplejson/encoder.py
67
13492
""" Implementation of JSONEncoder """ import re try: from simplejson._speedups import encode_basestring_ascii as c_encode_basestring_ascii except ImportError: pass ESCAPE = re.compile(r'[\x00-\x1f\\"\b\f\n\r\t]') ESCAPE_ASCII = re.compile(r'([\\"]|[^\ -~])') HAS_UTF8 = re.compile(r'[\x80-\xff]') ESCAPE_DCT = ...
gpl-3.0
westial/NdArrayIndexer.py
tests/test_NdArrayIndexer_3axes.py
1
4489
#!/usr/bin/env python # # Testing ndarray with 3 axes # import numpy as np from NdArrayIndexer import NdArrayIndexer # Structure of unsorted list to be converted in the same shape as testing_array testing_list = [ [[[7, 2, 76], [132, 32, 1], [201, 23, 224], [201, 23, 224]], [[101, 102, 103], [111, 112, 113]...
gpl-3.0
gerryhd/diabot-assistant
lib/python2.7/site-packages/jinja2/compiler.py
117
62929
# -*- coding: utf-8 -*- """ jinja2.compiler ~~~~~~~~~~~~~~~ Compiles nodes into python code. :copyright: (c) 2017 by the Jinja Team. :license: BSD, see LICENSE for more details. """ from itertools import chain from copy import deepcopy from keyword import iskeyword as is_python_keyword from functo...
gpl-3.0
OTWillems/GEO1005
SpatialDecision/external/networkx/generators/tests/test_directed.py
77
1313
#!/usr/bin/env python """Generators - Directed Graphs ---------------------------- """ from nose.tools import * from networkx import * from networkx.generators.directed import * class TestGeneratorsDirected(): def test_smoke_test_random_graphs(self): G=gn_graph(100) G=gnr_graph(100,0.5) G...
gpl-2.0
joequant/zipline
zipline/finance/blotter.py
29
14087
# # Copyright 2014 Quantopian, 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 wr...
apache-2.0
kangkot/arangodb
3rdParty/V8-4.3.61/third_party/python_26/Lib/site-packages/pythonwin/pywin/Demos/app/demoutils.py
34
1309
# Utilities for the demos import sys, win32api, win32con, win32ui NotScriptMsg = """\ This demo program is not designed to be run as a Script, but is probably used by some other test program. Please try another demo. """ NeedGUIMsg = """\ This demo program can only be run from inside of Pythonwin You must start Py...
apache-2.0
idegtiarov/gnocchi-rep
gnocchi/ceilometer/resources/ceph_account.py
1
1072
# # Copyright 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 writ...
apache-2.0
hassanabidpk/django
django/template/library.py
348
12752
import functools import warnings from importlib import import_module from django.utils import six from django.utils.deprecation import RemovedInDjango20Warning from django.utils.html import conditional_escape from django.utils.inspect import getargspec from django.utils.itercompat import is_iterable from .base import...
bsd-3-clause
40223110/2015cda_0512
static/Brython3.1.0-20150301-090019/Lib/_string.py
625
1112
"""string helper module""" import re class __loader__(object): pass def formatter_field_name_split(fieldname): """split the argument as a field name""" _list=[] for _name in fieldname: _parts = _name.split('.') for _item in _parts: is_attr=False #fix me if re....
gpl-3.0
aexeagmbh/django-allauth
allauth/socialaccount/providers/paypal/views.py
60
1606
import requests from allauth.socialaccount.providers.oauth2.views import (OAuth2Adapter, OAuth2LoginView, OAuth2CallbackView) from .provider import PaypalProvider class PaypalOAuth2Adapter(OAuth2Adapter...
mit
hiroakis/ansible
v1/ansible/module_utils/cloudstack.py
118
13221
# -*- coding: utf-8 -*- # # (c) 2015, René Moser <mail@renemoser.net> # # This code is part of Ansible, but is an independent component. # This particular file snippet, and this file snippet only, is BSD licensed. # Modules you write using this snippet, which is embedded dynamically by Ansible # still belong to the aut...
gpl-3.0
zasdfgbnm/tensorflow
tensorflow/python/ops/nn_batchnorm_test.py
5
30554
# 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
nimbis/django-cms
cms/management/commands/subcommands/tree.py
4
5434
# -*- coding: utf-8 -*- from __future__ import absolute_import, print_function, unicode_literals from collections import OrderedDict from cms.models import Page, CMSPlugin from .base import SubcommandsCommand def get_descendant_ids(root_id): """ Returns the a generator of primary keys which represent d...
bsd-3-clause
raboof/supybot
plugins/Alias/config.py
15
2179
### # Copyright (c) 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 conditi...
bsd-3-clause
alexforencich/python-ivi
ivi/tektronix/tektronixDPO4032.py
2
1646
""" Python Interchangeable Virtual Instrument Library Copyright (c) 2016-2017 Alex Forencich Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the...
mit
petrutlucian94/nova
nova/objects/__init__.py
9
2746
# Copyright 2013 IBM Corp. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agree...
apache-2.0
40023154/0628
static/Brython3.1.1-20150328-091302/Lib/warnings.py
752
13825
"""Python part of the warnings subsystem.""" # Note: function level imports should *not* be used # in this module as it may cause import lock deadlock. # See bug 683658. import linecache import sys __all__ = ["warn", "showwarning", "formatwarning", "filterwarnings", "resetwarnings", "catch_warnings"] def...
gpl-3.0
coronary/RandomEpisode
depends/Lib/site-packages/setuptools/__init__.py
130
5019
"""Extensions to the 'distutils' for large or complex distributions""" import os import functools import distutils.core import distutils.filelist from distutils.util import convert_path from fnmatch import fnmatchcase from six.moves import filter, map import setuptools.version from setuptools.extension import Extens...
mit
tangfeixiong/nova
nova/tests/unit/objects/test_objects.py
2
59782
# Copyright 2013 IBM Corp. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agree...
apache-2.0
RachitKansal/scikit-learn
examples/mixture/plot_gmm_classifier.py
250
3918
""" ================== GMM classification ================== Demonstration of Gaussian mixture models for classification. See :ref:`gmm` for more information on the estimator. Plots predicted labels on both training and held out test data using a variety of GMM classifiers on the iris dataset. Compares GMMs with sp...
bsd-3-clause
jboeuf/grpc
src/python/grpcio_testing/grpc_testing/_common.py
27
4481
# Copyright 2017 gRPC authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing...
apache-2.0
amith01994/intellij-community
python/lib/Lib/site-packages/django/contrib/contenttypes/tests.py
87
2781
from django import db from django.conf import settings from django.contrib.contenttypes.models import ContentType from django.contrib.sites.models import Site from django.contrib.contenttypes.views import shortcut from django.core.exceptions import ObjectDoesNotExist from django.http import HttpRequest from django.test...
apache-2.0
nelson-liu/scikit-learn
sklearn/cluster/affinity_propagation_.py
30
10689
"""Affinity Propagation clustering algorithm.""" # Author: Alexandre Gramfort alexandre.gramfort@inria.fr # Gael Varoquaux gael.varoquaux@normalesup.org # License: BSD 3 clause import numpy as np from ..base import BaseEstimator, ClusterMixin from ..utils import as_float_array, check_array from ..utils.valid...
bsd-3-clause
ztemt/NX505J_5.1_kernel
scripts/build-all.py
1474
10189
#! /usr/bin/env python # Copyright (c) 2009-2013, The Linux Foundation. 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 # ...
gpl-2.0
steynovich/ansible-modules-extras
cloud/vmware/vmware_vsan_cluster.py
64
3944
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2015, Russell Teague <rteague2 () csc.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 ...
gpl-3.0
PictureYo-self/Picture-Yo-self
code/colorpicker10.py
6
2691
#// screen manager imported from http://kivy.org/docs/api-kivy.uix.screenmanager.html from kivy.app import App from kivy.uix.floatlayout import FloatLayout from kivy.uix.boxlayout import BoxLayout from kivy.lang import Builder from random import random from kivy.uix.widget import Widget from kivy.graphics import Color...
gpl-2.0
widdowquinn/THAPBI-pycits
pycits/cd_hit.py
1
3265
#!/usr/bin/env python # # cd_hit * (clusterassembled reads with database) # cd_hit_est used as this is the nt clustering tool # http://weizhongli-lab.org/lab-wiki/doku.php?id=cd-hit-user-guide # follow this link to get the download. # https://github.com/weizhongli/cdhit # cd_hit-0.9.10-bin-64.tar.gz # # (c) The James H...
mit
mbrukman/flocker
admin/functional/test_aws.py
14
1570
import shutil import os from unittest import skipIf import boto from effect import Effect, sync_perform, ComposedDispatcher from twisted.python.filepath import FilePath from twisted.trial.unittest import SynchronousTestCase from ..aws import boto_dispatcher, UploadToS3 from flocker.provision._effect import dispatcher...
apache-2.0
hughperkins/kgsgo-dataset-preprocessor
dataset_partitioner.py
1
7011
#!/usr/bin/python # # Copyright Hugh Perkins 2015 hughperkins at gmail # # This Source Code Form is subject to the terms of the Mozilla Public License, # v. 2.0. If a copy of the MPL was not distributed with this file, You can # obtain one at http://mozilla.org/MPL/2.0/. # goal of this is to partition the data into ...
mpl-2.0
mattlevesque/py-shrt-lkr
py_shrt_lkr/tests_ORG.py
2
1767
import unittest import transaction from pyramid import testing from .core.models import DBSession # class TestMyViewSuccessCondition(unittest.TestCase): # def setUp(self): # self.config = testing.setUp() # from sqlalchemy import create_engine # engine = create_engine('sqlite://') # from .models import ( # ...
gpl-2.0
BT-rmartin/odoo
addons/account/wizard/account_move_line_select.py
385
2800
# -*- 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
asposewords/Aspose_Words_Cloud
Examples/Python/Examples/GetSpecificRunOfParagraphFromWordDocument.py
2
1537
import asposewordscloud from asposewordscloud.WordsApi import WordsApi from asposewordscloud.WordsApi import ApiException from asposewordscloud.models import RunResponse import asposestoragecloud from asposestoragecloud.StorageApi import StorageApi from asposestoragecloud.StorageApi import ResponseMessage apiKey = "...
mit
mhaessig/servo
tests/wpt/css-tests/tools/pywebsocket/src/setup.py
434
2863
#!/usr/bin/env python # # Copyright 2012, 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...
mpl-2.0
lfz/Guided-Denoise
Attackset/fgsm_inresv2_random/attack_iter.py
1
10010
"""Implementation of sample attack.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import os import numpy as np from scipy.misc import imread from scipy.misc import imsave from nets import inception_v3, inception_v4, inception_resnet_v2, resnet_v2 fro...
apache-2.0
Captnoord/openpli-enigma2
lib/python/Screens/ChoiceBox.py
10
4653
from Screens.Screen import Screen from Components.ActionMap import NumberActionMap from Components.Label import Label from Components.ChoiceList import ChoiceEntryComponent, ChoiceList from Components.Sources.StaticText import StaticText import enigma class ChoiceBox(Screen): def __init__(self, session, title = "", l...
gpl-2.0
hpcuantwerpen/easybuild-easyblocks
easybuild/easyblocks/b/blacs.py
3
8124
## # Copyright 2009-2021 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), # with support of Ghent University (http://ugent.be/hpc), # the Flemish Supercomputer Centre (VSC) (https://www.vscentrum.be), # Flemish Research Foundation (F...
gpl-2.0
cjayb/mne-python
tutorials/source-modeling/plot_eeg_no_mri.py
4
2723
# -*- coding: utf-8 -*- """ .. _tut-eeg-fsaverage-source-modeling: EEG forward operator with a template MRI ======================================== This tutorial explains how to compute the forward operator from EEG data using the standard template MRI subject ``fsaverage``. .. caution:: Source reconstruction witho...
bsd-3-clause
artas360/pythran
pythran/tests/cases/periodic_dist.py
5
1259
#pythran export dist(float [], float[], float[], int, bool, bool, bool) #runas import numpy as np ; N = 20 ; x = np.arange(0., N, 0.1) ; L = 4 ; periodic = True ; dist(x, x, x, L,periodic, periodic, periodic) #bench import numpy as np ; N = 300 ; x = np.arange(0., N, 0.1) ; L = 4 ; periodic = True ; dist(x, x, x, L,per...
bsd-3-clause
emedvedev/st2
st2actions/tests/unit/test_async_runner.py
8
1802
# Licensed to the StackStorm, Inc ('StackStorm') 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 th...
apache-2.0
SectorLabs/django-postgres-extra
psqlextra/partitioning/manager.py
1
4538
from typing import List, Optional, Tuple from django.db import connections from psqlextra.models import PostgresPartitionedModel from .config import PostgresPartitioningConfig from .constants import AUTO_PARTITIONED_COMMENT from .error import PostgresPartitioningError from .partition import PostgresPartition from .p...
mit
nealegibson/Infer
src/GPKernelFunctions.py
1
10701
""" Useful (non-periodic) GP Kernel Functions """ import numpy as np import scipy.spatial from scipy.special import gamma,kv ################################################################################################### #Exponential class def SqExponentialRad(X,Y,theta,white_noise=False): """ Standard square...
gpl-3.0
dsajkl/reqiop
common/lib/xmodule/xmodule/progress.py
127
4896
''' Progress class for modules. Represents where a student is in a module. Useful things to know: - Use Progress.to_js_status_str() to convert a progress into a simple status string to pass to js. - Use Progress.to_js_detail_str() to convert a progress into a more detailed string to pass to js. In particular...
agpl-3.0
tdr130/pupy
pupy/modules/socks5proxy.py
6
7573
# -*- coding: UTF8 -*- # -------------------------------------------------------------- # Copyright (c) 2015, Nicolas VERDIER (contact@n1nj4.eu) # All rights reserved. # # Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: # ...
bsd-3-clause
darshanthaker/nupic
external/linux32/lib/python2.6/site-packages/matplotlib/afm.py
69
15057
""" This is a python interface to Adobe Font Metrics Files. Although a number of other python implementations exist (and may be more complete than mine) I decided not to go with them because either they were either 1) copyrighted or used a non-BSD compatible license 2) had too many dependencies and I wanted a fr...
agpl-3.0
nejucomo/sgg
spiralgalaxygame/demiurge.py
1
4151
import random from math import sin, pi from spiralgalaxygame.body import Body, BodyKind from spiralgalaxygame.geometry import Vector, Circle from spiralgalaxygame.discdist import DiscreteDistribution def generate_galaxy_bodies(randgen = random.random, parentmu = 1000, ...
agpl-3.0
badjr/pysal
pysal/core/IOHandlers/mat.py
20
4377
import pysal import os.path import scipy.io as sio import pysal.core.FileIO as FileIO from pysal.weights import W from pysal.weights.util import full, full2W from warnings import warn __author__ = "Myunghwa Hwang <mhwang4@gmail.com>" __all__ = ["MatIO"] class MatIO(FileIO.FileIO): """ Opens, reads, and write...
bsd-3-clause
rpoleski/MulensModel
examples/use_cases/use_case_14_coordinate_system.py
1
1988
""" Use Case 14 - jcy MulensModel will be written assuming the coordinate system (t0,u0,alpha) are defined relative to the center of mass. This is not always the most efficient choice for fitting. This use case covers the conversion from center of magnification coordinates to center of mass coordinates. Essentially, i...
mit
kmoocdev2/edx-platform
cms/djangoapps/models/settings/course_metadata.py
1
8977
""" Django module for Course Metadata class -- manages advanced settings and related parameters """ from django.conf import settings from django.utils.translation import ugettext as _ from six import text_type from xblock.fields import Scope from xblock_django.models import XBlockStudioConfigurationFlag from xmodule.m...
agpl-3.0
rebstar6/servo
python/servo/devenv_commands.py
5
6435
# Copyright 2013 The Servo Project Developers. See the COPYRIGHT # file at the top-level directory of this distribution. # # Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or # http://www.apache.org/licenses/LICENSE-2.0> or the MIT license # <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your #...
mpl-2.0
keyurpatel076/MissionPlannerGit
Lib/site-packages/scipy/fftpack/pseudo_diffs.py
57
12479
""" Differential and pseudo-differential operators. """ # Created by Pearu Peterson, September 2002 __all__ = ['diff', 'tilbert','itilbert','hilbert','ihilbert', 'cs_diff','cc_diff','sc_diff','ss_diff', 'shift'] from numpy import pi, asarray, sin, cos, sinh, cosh, tanh, iscomplexobj i...
gpl-3.0
luceatnobis/youtube-dl
youtube_dl/extractor/hotstar.py
33
3711
# coding: utf-8 from __future__ import unicode_literals from .common import InfoExtractor from ..utils import ( ExtractorError, determine_ext, int_or_none, ) class HotStarIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?hotstar\.com/(?:.+?[/-])?(?P<id>\d{10})' _TESTS = [{ 'url': 'http...
unlicense
hryamzik/ansible
lib/ansible/modules/cloud/amazon/rds_snapshot_facts.py
32
12499
#!/usr/bin/python # Copyright (c) 2014-2017 Ansible Project # Copyright (c) 2017, 2018 Will Thames # Copyright (c) 2017, 2018 Michael De La Rue # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) ANSIBLE_METADATA = {'status': ['preview'], 'supported_by': 'co...
gpl-3.0
dparaujo/projeto
app_academico/semestre/migrations/0001_initial.py
1
1044
# -*- coding: utf-8 -*- # Generated by Django 1.10.1 on 2016-10-30 23:47 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.CreateModel( name='TblAca...
gpl-3.0
mnull/taccoin
contrib/bitrpc/bitrpc.py
1
7836
from jsonrpc import ServiceProxy import sys import string # ===== BEGIN USER SETTINGS ===== # if you do not set these you will be prompted for a password for every command rpcuser = "" rpcpass = "" # ====== END USER SETTINGS ====== if rpcpass == "": access = ServiceProxy("http://127.0.0.1:9332") else: access = Ser...
mit
dgzurita/odoo
addons/base_import_module/tests/test_module/__openerp__.py
377
1290
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2013-Today OpenERP SA (<http://www.openerp.com>). # # This program is free software: you can redistribute it and/or modify # it under the terms ...
agpl-3.0
cstipkovic/spidermonkey-research
testing/marionette/harness/marionette/runner/mixins/browsermob-proxy-py/docs/conf.py
2
7900
# -*- coding: utf-8 -*- # # BrowserMob Proxy documentation build configuration file, created by # sphinx-quickstart on Fri May 24 12:37:12 2013. # # 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 # autogenerated file...
mpl-2.0
nicholedwight/nichole-theme
node_modules/grunt-docker/node_modules/docker/node_modules/pygmentize-bundled/vendor/pygments/pygments/styles/bw.py
364
1355
# -*- coding: utf-8 -*- """ pygments.styles.bw ~~~~~~~~~~~~~~~~~~ Simple black/white only style. :copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ from pygments.style import Style from pygments.token import Keyword, Name, Comment, Strin...
mit
n-west/gnuradio-volk
gr-analog/python/analog/qa_pll_refout.py
17
7816
#!/usr/bin/env python # # Copyright 2004,2010,2012,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 ...
gpl-3.0
saleemjaveds/https-github.com-openstack-nova
nova/tests/virt/hyperv/test_pathutils.py
12
2298
# Copyright 2014 IBM Corp. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed ...
apache-2.0
ted-gould/nova
nova/virt/hyperv/migrationops.py
15
13161
# Copyright 2013 Cloudbase Solutions Srl # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless r...
apache-2.0
pratikmallya/hue
desktop/core/src/desktop/lib/metrics/file_reporter.py
19
2262
# Licensed to Cloudera, Inc. under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. Cloudera, Inc. licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file ex...
apache-2.0
naparuba/opsbro
data/global-configuration/packs/mongodb/collectors/pymongo/mongo_replica_set_client.py
53
1955
# Copyright 2011-2015 MongoDB, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you # may not use this file except in compliance with the License. You # may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writi...
mit
Taapat/enigma2-openpli-fulan
lib/python/Tools/ASCIItranslit.py
85
4020
# -*- coding:utf-8 -*- ASCIItranslit = { 0x0022: "''", 0x002A: "_", 0x002F: "_", 0x003A: "_", 0x003C: "_", 0x003D: "_", 0x003E: "_", 0x003F: "_", 0x005C: "_", 0x007C: "_", 0x007F: "", 0x00A0: "_", 0x00A1: "!", 0x00A2: "c", 0x00A3: "lb", 0x00A4: "", 0x00A5: "yen", 0x00A6: "I", 0x00A7: "SS", 0x00A8: ...
gpl-2.0
y12uc231/edx-platform
lms/djangoapps/instructor/features/common.py
47
4576
""" Define common steps for instructor dashboard acceptance tests. """ # pylint: disable=missing-docstring # pylint: disable=redefined-outer-name from __future__ import absolute_import from lettuce import world, step from mock import patch from nose.tools import assert_in # pylint: disable=no-name-in-module from c...
agpl-3.0
jmartinezchaine/OpenERP
openerp/workflow/wkf_logs.py
15
1523
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the...
agpl-3.0
lertech/extra-addons
website_disable_odoo/__init__.py
1
1185
# -*- encoding: utf-8 -*- # Python source code encoding : https://www.python.org/dev/peps/pep-0263/ ############################################################################## # # OpenERP, Odoo Source Management Solution # Copyright (c) 2015 Antiun Ingeniería S.L. (http://www.antiun.com) # Anto...
gpl-3.0
wolverineav/neutron
neutron/db/portsecurity_db.py
3
2785
# Copyright 2013 VMware, 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 a...
apache-2.0
route-nazionale/event_subscribe
event_subscribe/default_settings.py
1
2179
""" Django settings for event_subscribe project. For more information on this file, see https://docs.djangoproject.com/en/dev/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/dev/ref/settings/ """ # Build paths inside the project like this: os.path.join(BASE_DIR,...
agpl-3.0
sadanandb/pmt
src/tactic/ui/widget/__init__.py
5
1116
########################################################### # # Copyright (c) 2005-2008, Southpaw Technology # All Rights Reserved # # PROPRIETARY INFORMATION. This software is proprietary to # Southpaw Technology, and is not to be reproduced, transmitted, # or disclosed in any way without written ...
epl-1.0
40223112/w16test
ref/gear.py
68
21704
import cherrypy import os import sys # 這個程式要計算正齒輪的齒面寬, 資料庫連結希望使用 pybean 與 SQLite # 導入 pybean 模組與所要使用的 Store 及 SQLiteWriter 方法 from pybean import Store, SQLiteWriter import math # 確定程式檔案所在目錄, 在 Windows 有最後的反斜線 _curdir = os.path.join(os.getcwd(), os.path.dirname(__file__)) # 將所在目錄設為系統搜尋目錄 sys.path.append(_curdir) if 'O...
agpl-3.0
sinkuri256/python-for-android
python3-alpha/python3-src/Lib/shlex.py
51
11100
"""A lexical analyzer class for simple shell-like syntaxes.""" # Module and documentation by Eric S. Raymond, 21 Dec 1998 # Input stacking and error message cleanup added by ESR, March 2000 # push_source() and pop_source() made explicit by ESR, January 2001. # Posix compliance, split(), string arguments, and # iterato...
apache-2.0
adrientetar/robofab
Lib/robofab/tools/glifExport.py
1
2477
"""Tool for exporting GLIFs from FontLab""" import FL import os from robofab.interface.all.dialogs import ProgressBar from robofab.glifLib import GlyphSet from robofab.tools.glifImport import GlyphPlaceholder from robofab.pens.flPen import drawFLGlyphOntoPointPen def exportGlyph(glyphName, flGlyph, glyphSet): """Ex...
bsd-3-clause
hnjamba/onaclone
onadata/libs/utils/csv_reader.py
6
1612
# vim: ai ts=4 sts=4 et sw=4 encoding=utf-8 import csv class CsvReader(object): """ Typical usage:: csv_reader = CsvReader(path) for d in csv_reader.iter_dicts(): Variable.objects.create(**d) """ def __init__(self, path): self.open(path) def open(self, path): ...
bsd-2-clause
georgejhunt/olpc-kernel
tools/perf/scripts/python/failed-syscalls-by-pid.py
1996
2233
# failed system call counts, by pid # (c) 2010, Tom Zanussi <tzanussi@gmail.com> # Licensed under the terms of the GNU GPL License version 2 # # Displays system-wide failed system call totals, broken down by pid. # If a [comm] arg is specified, only syscalls called by [comm] are displayed. import os import sys sys.pa...
gpl-2.0
ctrevino/DIGITS
digits/model/tasks/caffe_train.py
1
38589
# Copyright (c) 2014-2015, NVIDIA CORPORATION. All rights reserved. import os import re import time import math import subprocess import numpy as np from google.protobuf import text_format import caffe try: import caffe_pb2 except ImportError: # See issue #32 from caffe.proto import caffe_pb2 from train...
bsd-3-clause
lupyuen/RaspberryPiImage
home/pi/GrovePi/Software/Python/others/temboo/Library/Google/Spreadsheets/RetrieveCellFeed.py
4
5884
# -*- coding: utf-8 -*- ############################################################################### # # RetrieveCellFeed # Retrieves a list of cell names and values in a specified Google worksheet. # # Python versions 2.6, 2.7, 3.x # # Copyright 2014, Temboo Inc. # # Licensed under the Apache License, Version 2.0 ...
apache-2.0
CeON/CoAnSys
document-similarity/document-similarity-logic/src/main/python/analyse_unibi.py
4
3007
#! /usr/bin/python import sys,re,string sys.path.append("/home/pdendek/docsim-check/out/document-similarity-logic-1.6-SNAPSHOT-jar-with-dependencies.jar") from pl.edu.icm.coansys.commons.java import DiacriticsRemover def fillDict(inL,langs): innerD = {} for x in inL: t,l = x langs.add(l) innerD[l] = t return...
agpl-3.0
openchange/openchange
mapiproxy/services/ocsmanager/ocsmanager/controllers/authenticate.py
8
3494
import logging import hashlib import os from base64 import urlsafe_b64encode as encode from base64 import urlsafe_b64decode as decode from pylons import request, response, session, tmpl_context as c, url from pylons.controllers.util import abort, redirect from pylons.decorators.rest import restrict from ocsmanager.mo...
gpl-3.0
JGulbronson/rmc
data/aggregator.py
2
14325
import argparse import mongoengine import redis import sys import rmc.models as m import rmc.shared.constants as c import rmc.shared.facebook as facebook import rmc.shared.util as rmc_util import rmc.data.crawler as rmc_crawler import rmc.data.processor as rmc_processor # TODO(mack): remove duplication of fields thro...
mit
openhdf/enigma2-wetek
lib/python/Components/Renderer/valioOledInfo.py
13
2222
# -*- coding: utf-8 -*- # # OLED-Info Renderer for Dreambox/Enigma-2 # Version: 1.0 # Coded by Vali (c)2011 # ####################################################################### from enigma import eLabel from Renderer import Renderer from os import popen from time import localtime, strftime from Component...
gpl-2.0