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
cnbin/linux
tools/perf/scripts/python/netdev-times.py
1544
15191
# Display a process of packets and processed time. # It helps us to investigate networking or network device. # # options # tx: show only tx chart # rx: show only rx chart # dev=: show only thing related to specified device # debug: work with debug mode. It shows buffer status. import os import sys sys.path.append(os...
gpl-2.0
shail2810/nova
nova/tests/unit/api/openstack/compute/test_pause_server.py
35
4186
# Copyright 2011 OpenStack Foundation # 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 ...
apache-2.0
python4vo/coatpy
coatpy/volib/volib/Siap.py
1
5892
''' Created on Mar 13, 2011 SIAP class to handle SIAP queries. @author: shkwok Based on version 2005-06-03 by Shui Hung Kwok Image generation parameters: See http://www.ivoa.net/Documents/WD/SIA/sia-20040524.html MUST parameters are: RA Right ascension in decimal degree DEC declination in d...
mit
lammps/lammps
unittest/force-styles/tests/py_pot.py
7
3033
from __future__ import print_function class LAMMPSPairPotential(object): def __init__(self): self.pmap=dict() self.units='lj' def map_coeff(self,name,ltype): self.pmap[ltype]=name def check_units(self,units): if (units != self.units): raise Exception("Conflicting ...
gpl-2.0
mciantyre/python-elevator-challenge
elevator.py
2
2402
UP = 1 DOWN = 2 FLOOR_COUNT = 6 class ElevatorLogic(object): """ An incorrect implementation. Can you make it pass all the tests? Fix the methods below to implement the correct logic for elevators. The tests are integrated into `README.md`. To run the tests: $ python -m doctest -v README.md T...
mit
garnaat/boto
boto/cloudsearch/domain.py
153
15607
# Copyright (c) 2012 Mitch Garnaat http://garnaat.org/ # Copyright (c) 2012 Amazon.com, Inc. or its affiliates. # All Rights Reserved # # 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...
mit
mldbai/mldb
testing/MLDB-1911_horizontal_agg_no_from.py
1
2016
# # MLDB-1911_horizontal_agg_no_from.py # Francois-Michel L'Heureux, 2016-09-30 # This file is part of MLDB. Copyright 2016 mldb.ai inc. All rights reserved. # import unittest from mldb import mldb, MldbUnitTest, ResponseException class Mldb1911HorizontalAggNoFrom(MldbUnitTest): # noqa @classmethod def setU...
apache-2.0
rgommers/statsmodels
statsmodels/sandbox/examples/try_quantile_regression1.py
33
1188
'''Example to illustrate Quantile Regression Author: Josef Perktold polynomial regression with systematic deviations above ''' import numpy as np from statsmodels.compat.python import zip from scipy import stats import statsmodels.api as sm from statsmodels.regression.quantile_regression import QuantReg sige = 0....
bsd-3-clause
archetipo/stock-logistics-workflow
picking_dispatch/wizard/check_assign_all.py
24
1558
# -*- coding: utf-8 -*- ############################################################################## # # Author: Guewen Baconnier # Copyright 2014 Camptocamp SA # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # pu...
agpl-3.0
theouf/CMStools
FabLab/languages/id.py
148
11233
# coding: utf8 { '!langcode!': 'id', '!langname!': 'Indonesian', '%d days ago': '%d hari yang lalu', '%d hours ago': '%d jam yang lalu', '%d minutes ago': '%d menit yang lalu', '%d months ago': '%d bulan yang lalu', '%d seconds ago': '%d detik yang lalu', '%d seconds from now': '%d detik dari sekarang', '%d weeks ago':...
gpl-2.0
sv0/django-markdown-app
django_markdown/widgets.py
1
1827
""" Widgets for django-markdown. """ import os from django import forms from django.contrib.admin.widgets import AdminTextareaWidget from django.utils.safestring import mark_safe from . import settings from .utils import editor_js_initialization class MarkdownWidget(forms.Textarea): """ Widget for a textarea. ...
lgpl-3.0
groundcall/jobeet
vendor/doctrine/orm/docs/en/conf.py
2448
6497
# -*- coding: utf-8 -*- # # Doctrine 2 ORM documentation build configuration file, created by # sphinx-quickstart on Fri Dec 3 18:10:24 2010. # # 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. ...
mit
onoga/wm
src/gnue/forms/GFObjects/GFTimer.py
2
2244
# GNU Enterprise Forms - GF Object Hierarchy - Box # # Copyright 2001-2007 Free Software Foundation # # This file is part of GNU Enterprise # # GNU Enterprise 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; ei...
gpl-2.0
firerszd/kbengine
kbe/src/lib/python/Lib/logging/__init__.py
63
68934
# Copyright 2001-2014 by Vinay Sajip. All Rights Reserved. # # Permission to use, copy, modify, and distribute this software and its # documentation for any purpose and without fee is hereby granted, # provided that the above copyright notice appear in all copies and that # both that copyright notice and this permissio...
lgpl-3.0
napalm-automation/napalm-yang
napalm_yang/models/openconfig/network_instances/network_instance/protocols/protocol/bgp/neighbors/neighbor/error_handling/config/__init__.py
1
12545
# -*- coding: utf-8 -*- from operator import attrgetter from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType from pyangbind.lib.yangtypes import RestrictedClassType from pyangbind.lib.yangtypes import TypedListType from pyangbind.lib.yangtypes import YANGBool from pyangbind.lib.yangtypes import YANGListTy...
apache-2.0
omarocegueda/dipy
dipy/core/gradients.py
4
12110
from __future__ import division, print_function, absolute_import from dipy.utils.six import string_types import numpy as np try: from scipy.linalg import polar except ImportError: # Some elderly scipy doesn't have polar from dipy.fixes.scipy import polar from scipy.linalg import inv from dipy.io import gra...
bsd-3-clause
ccarvalheira/ws_client
provider.py
1
4203
import requests import datetime import random import json import pickle class Provider(object): min_timedelta = 2 max_timedelta = 5 length_multiplier = 0.1 #in days def get_time(self, before): return before + datetime.timedelta(seconds=random.choice(xrange(self.min_timedelta,self.max_timedel...
bsd-2-clause
kaedroho/django
tests/migrations/models.py
131
1556
from django.apps.registry import Apps from django.db import models class CustomModelBase(models.base.ModelBase): pass class ModelWithCustomBase(models.Model, metaclass=CustomModelBase): pass class UnicodeModel(models.Model): title = models.CharField('ÚÑÍ¢ÓÐÉ', max_length=20, default='“Ðjáñgó”') c...
bsd-3-clause
Bitdv/Envoy
contrib/pyminer/pyminer.py
385
6434
#!/usr/bin/python # # Copyright (c) 2011 The Bitcoin developers # Distributed under the MIT/X11 software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # import time import json import pprint import hashlib import struct import re import base64 import httplib import...
mit
charleswhchan/ansible
lib/ansible/inventory/dir.py
4
12870
# (c) 2013, Daniel Hokka Zakrisson <daniel@hozac.com> # (c) 2014, Serge van Ginderachter <serge@vanginderachter.be> # # 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, ...
gpl-3.0
fleith/coding
solutions/random.py
1
5613
import re # Binary GAP from collections import deque from collections import Counter from itertools import repeat import sys def solution_0(N): # write your code in Python 2.7 nbin = bin(N)[-N.bit_length():] m = re.findall('10+(?=1)', nbin) return (len(max(m, key=len)) - 1) if len(m) > 0 else 0 de...
unlicense
robfletcher/cdnjs
node_modules/execSync/node_modules/ffi/deps/libffi/generate-ios-source-and-headers.py
183
5303
#!/usr/bin/env python import subprocess import re import os import errno import collections import sys class Platform(object): pass sdk_re = re.compile(r'.*-sdk ([a-zA-Z0-9.]*)') def sdkinfo(sdkname): ret = {} for line in subprocess.Popen(['xcodebuild', '-sdk', sdkname, '-version'], stdout=subprocess.PI...
mit
StackStorm/st2-auth-backend-ldap
tests/unit/test_ldap_backend.py
1
19882
# 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
mattesno1/CouchPotatoServer
libs/pyutil/hashexpand.py
106
2890
# Copyright (c) 2002-2012 Zooko Wilcox-O'Hearn # This file is part of pyutil; see README.rst for licensing terms. import warnings """ Cryptographically strong pseudo-random number generator based on SHA256. """ class SHA256Expander: """ Provide a cryptographically strong pseudo-random number generator base...
gpl-3.0
rakeshyeka/PDFprocessor
pdf2htmlEX/test/test_remote_browser.py
1
4437
#!/usr/bin/env python # Run browser tests through Sauce Labs import unittest import sys import os from selenium import webdriver from selenium.webdriver.common.by import By from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.support import expected_conditions from sauceclient import Sauce...
gpl-3.0
alkyl1978/gnuradio
gr-audio/examples/python/test_resampler.py
58
2666
#!/usr/bin/env python # # Copyright 2004,2005,2007,2012 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
rghe/ansible
test/integration/targets/connection/plugin/dummy.py
56
1089
from __future__ import (absolute_import, division, print_function) __metaclass__ = type DOCUMENTATION = """ author: - John Doe connection: dummy short_description: defective connection plugin description: - defective connection plugin version_added: "2.0" options: {} """ import ...
gpl-3.0
GarySparrow/mFlaskWeb
venv/Lib/site-packages/gunicorn/sock.py
19
7124
# -*- coding: utf-8 - # # This file is part of gunicorn released under the MIT license. # See the NOTICE for more information. import errno import fcntl import os import socket import stat import sys import time from gunicorn import util from gunicorn.six import string_types SD_LISTEN_FDS_START = 3 class BaseSocke...
mit
pli3/pli3-openpli3
meta-openembedded/contrib/oe-stylize.py
5
11453
#!/usr/bin/env python """\ Sanitize a bitbake file following the OpenEmbedded style guidelines, see http://openembedded.org/wiki/StyleGuide (C) 2006 Cyril Romain <cyril.romain@gmail.com> MIT license TODO: - add the others OpenEmbedded variables commonly used: - parse command arguments and print usage on misuse ...
gpl-2.0
openp2pdesign/platform_analysis
platform_analysis/discourse.py
2
11255
# -*- encoding: utf-8 -*- # # Social Network Analysis of Discourse discussions # # Author: Massimo Menichinelli # Homepage: http://www.openp2pdesign.org # License: LGPL v.3 # import re from pydiscourse import DiscourseClient import networkx as nx import datetime from time import sleep def discourse_topic_discussion...
lgpl-3.0
duqiao/django
django/db/backends/base/creation.py
147
10102
import sys import time from django.apps import apps from django.conf import settings from django.core import serializers from django.db import router from django.utils.six import StringIO from django.utils.six.moves import input # The prefix to put on the default database name when creating # the test database. TEST_...
bsd-3-clause
shakamunyi/neutron-dvr
neutron/plugins/ml2/drivers/mechanism_fslsdn.py
10
11363
# Copyright (c) 2014 Freescale Semiconductor # # 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
bright-pan/rt-thread
bsp/m16c62p/rtconfig.py
36
2967
import os # toolchains options ARCH = 'm16c' CPU = 'm16c62p' CROSS_TOOL = 'iar' if os.getenv('RTT_CC'): CROSS_TOOL = os.getenv('RTT_CC') if CROSS_TOOL == 'gcc': PLATFORM = 'gcc' EXEC_PATH = 'C:/Program Files/Renesas/Hew/Tools/KPIT Cummins/GNUM16CM32C-ELF/v11.01/m32c-elf/bin' elif CROSS_TOOL == 'iar'...
gpl-2.0
ychen820/microblog
y/google-cloud-sdk/platform/google_appengine/lib/django-1.3/django/contrib/gis/geometry/test_data.py
364
2994
""" This module has the mock object definitions used to hold reference geometry for the GEOS and GDAL tests. """ import gzip import os from django.contrib import gis from django.utils import simplejson # This global used to store reference geometry data. GEOMETRIES = None # Path where reference test data is located...
bsd-3-clause
workflo/dxf2gcode
source/Core/Globals.py
1
2266
# -*- coding: iso-8859-15 -*- # # 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 is distributed in the h...
gpl-3.0
JimCircadian/ansible
lib/ansible/modules/packaging/os/dpkg_selections.py
32
2155
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright: Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', ...
gpl-3.0
hessu/gr-osmosdr
docs/doxygen/swig_doc.py
220
8657
# # Copyright 2010,2011 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
rhiot/rhiot
dockerfiles/openalpr/src/main/docker/2.2.0/src/bindings/python/openalpr/openalpr.py
9
3694
import ctypes import json import platform class Alpr(): def __init__(self, country, config_file, runtime_dir): # Load the .dll for Windows and the .so for Unix-based if platform.system().lower().find("windows") != -1: self._openalprpy_lib = ctypes.cdll.LoadLibrary("openalprpy.dll") ...
apache-2.0
a-b/PopClip-Extensions
source/Pushbullet/requests/packages/chardet/mbcsgroupprober.py
2769
1967
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Universal charset detector code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 2001 # the Initial Developer. All R...
mit
pizzapanther/gae_boto
docs.py
1
1811
#!/usr/bin/env python import os import sys sys.path.insert(0, '..') from gae_boto import AmazonConnection from gae_boto.fields import ListofDicts APIS = ('sqs', 'route53') def write_field (attr, field, fh): if isinstance(field, ListofDicts): items = ', '.join(sorted(field.required.keys())) if field.optio...
bsd-3-clause
stanley-cheung/grpc
src/python/grpcio_tests/tests/csds/test_csds.py
5
4318
# Copyright 2021 The 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 writ...
apache-2.0
renyi533/tensorflow
tensorflow/python/data/experimental/ops/grouping.py
8
19754
# 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
leoliujie/odoo
addons/point_of_sale/report/pos_lines.py
230
2464
# -*- 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
ltilve/chromium
tools/git/mass-rename.py
170
1344
#!/usr/bin/env python # Copyright 2013 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """ mass-rename: update source files (gyp lists, #includes) to reflect a rename. Expects "git diff --cached -M" to list a bunch of ren...
bsd-3-clause
Lispython/pycurl
setup.py
1
3523
#!/usr/bin/env python # -*- coding: utf-8 -*- """ pycurl2 ~~~~~~~ PycURL2 is a revised version of PycURL, that not maintained more than 3 years (from 7.19.0 (Sep 9 2008)). `PycURL`_ is a Python interface to `libcurl`_. `PycURL`_ can be used to fetch objects identified by a URL from a Python program, similar to the `...
lgpl-2.1
nolanliou/tensorflow
tensorflow/python/training/proximal_gradient_descent.py
37
4429
# 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
hwjworld/xiaodun-platform
lms/djangoapps/course_wiki/utils.py
12
4379
""" Utility functions for course_wiki. """ from django.core.exceptions import ObjectDoesNotExist def user_is_article_course_staff(user, article): """ The root of a course wiki is /<course_number>. This means in case there are two courses which have the same course_number they will end up with the sam...
agpl-3.0
cougar-enigma/Enigma2PC
lib/python/Screens/Ipkg.py
18
3667
from Components.ActionMap import ActionMap from Components.Ipkg import IpkgComponent from Components.Label import Label from Components.Slider import Slider from Screens.Screen import Screen from Screens.MessageBox import MessageBox from enigma import eTimer class Ipkg(Screen): def __init__(self, session, cmdList = [...
gpl-2.0
Universal-Model-Converter/UMC3.0a
data/Python/x86/Lib/site-packages/scipy/sparse/linalg/eigen/arpack/setup.py
3
1906
#!/usr/bin/env python from __future__ import division, print_function, absolute_import from os.path import join from scipy._build_utils import needs_g77_abi_wrapper def configuration(parent_package='',top_path=None): from numpy.distutils.system_info import get_info, NotFoundError from numpy.distutils.misc_ut...
mit
sserrot/champion_relationships
venv/Lib/site-packages/win32com/test/testmakepy.py
6
1931
# Test makepy - try and run it over every OCX in the windows system directory. import sys import win32api import traceback import glob import os import traceback import win32com.test.util from win32com.client import makepy, selecttlb, gencache import pythoncom import winerror def TestBuildAll(verbose = 1): num =...
mit
wbyne/QGIS
python/plugins/GdalTools/tools/doOverview.py
5
7511
# -*- coding: utf-8 -*- """ *************************************************************************** doOverview.py --------------------- Date : June 2010 Copyright : (C) 2010 by Giuseppe Sucameli Email : brush dot tyler at gmail dot com *****************...
gpl-2.0
eclipse-ease-addons/engines
jython/org.jython/Lib/encodings/cp866.py
593
34652
""" Python Character Mapping Codec generated from 'VENDORS/MICSFT/PC/CP866.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_map) def decode(self,input,errors='strict'): ...
epl-1.0
gratefulfrog/ArduGuitar
Ardu2/design/POC-3_MAX395/pyboard/DraftDevt/spiIVTTest.py
1
2679
#!/usr/local/bin/python3.4 # spiIVTTest.py # exercise some pyboard SPI with as many MAX395's connected # as needed: """ pin Shift Reg 1 pin 1 : SCLK : Pyboard SCK X6 2 : V+ : 5v 3 : Din : Pyboard MOSI X8 4 : GND : Pyboard GND 24 : CS : Pyboard X5 23 : RESET : 5v 22 : Dout : to next MAX395-0 pin 3 2...
gpl-2.0
speters/cyrf6936_sigrokdecode
regdecode.py
1
3708
## ## Copyright (C) 2016 Soenke J. Peters ## ## This program is free software: you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by ## the Free Software Foundation, either version 3 of the License, or ## (at your option) any later version. ## ## This program is d...
gpl-3.0
jbenden/ansible
test/units/module_utils/test_postgresql.py
63
2863
import json import sys from ansible.compat.tests import unittest from ansible.compat.tests.mock import patch, MagicMock from ansible.module_utils.basic import AnsibleModule from ansible.module_utils.six.moves import builtins from ansible.module_utils._text import to_native from units.mock.procenv import swap_stdin_an...
gpl-3.0
DiUS/build-lights
light-controller/sounds/sound_player.py
2
2138
""" Sound Player """ import os current_dir = os.path.dirname(os.path.realpath(__file__)) parent_dir = os.path.join(current_dir, "..") import sys sys.path.append(parent_dir) import time import signal import subprocess import glob from random import randrange from lib import logger class SoundPlayer(object): def...
gpl-3.0
gamaanderson/artview
artview/components/menu.py
2
25416
""" menu.py Class instance used to create menu for ARTview app. """ from __future__ import print_function import numpy as np import pyart import os import sys import glob from ..core import (Variable, Component, common, QtWidgets, QtCore, componentsList, log) class Menu(Component): '''Class...
bsd-3-clause
StarbuckBG/BTCGPU
test/functional/btg-timelock.py
2
4384
#!/usr/bin/env python3 # Copyright (c) 2017 The Bitcoin Gold developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Test cases for Bitcoin Gold CLTV wallet.""" import io from test_framework.address import * from test_frame...
mit
Kiiv/CouchPotatoServer
libs/requests/packages/chardet/big5freq.py
3133
82594
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Communicator client code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 1998 # the Initial Developer. All Rights R...
gpl-3.0
presstab/PIVX
contrib/devtools/update-translations.py
3
8149
#!/usr/bin/env python # Copyright (c) 2014 Wladimir J. van der Laan # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. ''' Run this script from the root of the repository to update all translations from transifex. It will do the follo...
mit
ChristineDu/onlineLDA
onlineldavb.py
1
12223
# onlineldavb.py: Package of functions for fitting Latent Dirichlet # Allocation (LDA) with online variational Bayes (VB) in parallel. # import sys, re, time, string, threading import numpy as n from scipy.special import gammaln, psi n.random.seed(100000001) meanchangethresh = 0.001 def dirichlet_expectation(alpha)...
gpl-3.0
yetu/repotools
third_party/boto/s3/bucketlogging.py
73
3169
# Copyright (c) 2006,2007 Mitch Garnaat http://garnaat.org/ # # 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 rights to use, copy, modi...
bsd-3-clause
jefflaplante/cli53
setup.py
3
1280
from setuptools import setup, find_packages from setuptools import Command __version__ = '0.4.4' long_description = file('README.markdown', 'r').read() class tag(Command): """Tag git release.""" description = __doc__ user_options = [] def initialize_options(self): pass def finalize_opti...
mit
NaturalGIS/naturalgis_qgis
python/plugins/processing/algs/qgis/RegularPoints.py
30
6285
# -*- coding: utf-8 -*- """ *************************************************************************** RegularPoints.py --------------------- Date : September 2014 Copyright : (C) 2014 by Alexander Bruy Email : alexander dot bruy at gmail dot com *********...
gpl-2.0
aisipos/django
tests/responses/tests.py
33
4881
# -*- coding: utf-8 -*- from __future__ import unicode_literals import io from django.conf import settings from django.core.cache import cache from django.http import HttpResponse from django.http.response import HttpResponseBase from django.test import SimpleTestCase UTF8 = 'utf-8' ISO88591 = 'iso-8859-1' class ...
bsd-3-clause
tmeits/pybrain
pybrain/rl/environments/ode/instances/johnnie.py
31
1429
__author__ = 'Frank Sehnke, sehnke@in.tum.de' from pybrain.rl.environments.ode import ODEEnvironment, sensors, actuators import imp from scipy import array class JohnnieEnvironment(ODEEnvironment): def __init__(self, renderer=True, realtime=False, ip="127.0.0.1", port="21590", buf='16384'): ODEEnvironment...
bsd-3-clause
jakesyl/pychess
lib/pychess/ic/managers/AdjournManager.py
22
7507
from __future__ import absolute_import import re import datetime #from gobject import * from gi.repository import GObject from .BoardManager import BoardManager, moveListHeader1Str, names, months, dates from pychess.ic import * from pychess.ic.FICSObjects import FICSAdjournedGame, FICSPlayer from pychess.Utils.const i...
gpl-3.0
SUSE/azure-sdk-for-python
azure-mgmt-servicebus/azure/mgmt/servicebus/models/sb_namespace.py
2
3047
# 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
dkubiak789/odoo
addons/mrp_repair/mrp_repair.py
27
36915
# -*- 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
andersonresende/django
tests/validation/models.py
139
4590
from __future__ import unicode_literals from datetime import datetime from django.core.exceptions import ValidationError from django.db import models from django.utils.encoding import python_2_unicode_compatible def validate_answer_to_universe(value): if value != 42: raise ValidationError('This is not t...
bsd-3-clause
Abi1ity/uniclust2.0
flask/lib/python2.7/site-packages/pbr/tests/test_commands.py
60
2511
# Copyright (c) 2013 Hewlett-Packard Development Company, L.P. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
bsd-3-clause
jeffrimko/Auxly
lib/auxly/filesys.py
1
19234
"""Library of functions related to file system contents and manipulation.""" ##==============================================================# ## SECTION: Imports # ##==============================================================# import atexit import codecs import hashlib ...
mit
sclabs/sccms-nonrel
django/contrib/auth/tests/models.py
318
1493
from django.conf import settings from django.test import TestCase from django.contrib.auth.models import User, SiteProfileNotAvailable class ProfileTestCase(TestCase): fixtures = ['authtestdata.json'] def setUp(self): """Backs up the AUTH_PROFILE_MODULE""" self.old_AUTH_PROFILE_MODULE = getattr...
bsd-3-clause
ivnc/NVDARemote
addon/globalPlugins/remoteClient/dialogs.py
1
10615
import sys import os sys.path.append(os.path.abspath(os.path.dirname(__file__))) import json sys.path.remove(sys.path[-1]) import random import threading import urllib import wx import gui import serializer import server import transport import socket_utils import addonHandler addonHandler.initTranslatio...
gpl-2.0
hujiajie/pa-chromium
third_party/tlslite/tlslite/messages.py
34
20165
"""Classes representing TLS messages.""" from utils.compat import * from utils.cryptomath import * from errors import * from utils.codec import * from constants import * from X509 import X509 from X509CertChain import X509CertChain # The sha module is deprecated in Python 2.6 try: import sha except ImportError: ...
bsd-3-clause
celebdor/kuryr
kuryr/tests/unit/base.py
1
4793
# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under t...
apache-2.0
huggingface/pytorch-transformers
examples/pytorch/multiple-choice/run_swag_no_trainer.py
1
19753
#!/usr/bin/env python # coding=utf-8 # Copyright The HuggingFace Team and The HuggingFace Inc. team. 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.ap...
apache-2.0
Ghayyas/KodiAddon
resources/lib/nightcrawler/storage/access_manager.py
5
5915
__author__ = 'bromix' import hashlib import time class AccessManager(object): ACCESS_SETTING_KEYS = ['access_token', 'refresh_token', 'expires_in'] def __init__(self, settings): self._settings = settings pass def do_login_and_refresh_token(self, login_method, refresh_token_method): ...
gpl-2.0
arocchi/Klampt
Python/control/roscontroller.py
4
11505
"""This controller accepts ROS JointTrajectory messages from the ROS topic '/[robot_name]/joint_trajectory' and writes out JointState messages to the ROS topic '/[robot_name]/joint_state'. It also acts as a ROS clock server. """ import controller import rospy from klampt.trajectory import Trajectory,HermiteTrajectory...
bsd-3-clause
caorong/mysql-connector-python
lib/mysql/connector/fabric/caching.py
6
9301
# MySQL Connector/Python - MySQL driver written in Python. # Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved. # MySQL Connector/Python is licensed under the terms of the GPLv2 # <http://www.gnu.org/licenses/old-licenses/gpl-2.0.html>, like most # MySQL Connectors. There are special exceptio...
gpl-2.0
mlaitinen/odoo
addons/base_report_designer/plugin/openerp_report_designer/bin/script/ServerParameter.py
384
6603
######################################################################### # # Copyright (c) 2003-2004 Danny Brewer d29583@groovegarden.com # Copyright (C) 2004-2010 OpenERP SA (<http://openerp.com>). # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser Gene...
agpl-3.0
cloudbase/psutil
psutil/_psposix.py
7
5062
# Copyright (c) 2009, Giampaolo Rodola'. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Routines common to all posix systems.""" import errno import glob import os import sys import time from ._common import sdiskusage, usage_percent, mem...
bsd-3-clause
luiscarlosgph/nas
env/lib/python2.7/site-packages/django/conf/locale/nn/formats.py
197
1810
# -*- 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...
mit
starim/penny-auction
lib/web/debugerror.py
68
12346
""" pretty debug errors (part of web.py) portions adapted from Django <djangoproject.com> Copyright (c) 2005, the Lawrence Journal-World Used under the modified BSD license: http://www.xfree86.org/3.3.6/COPYRIGHT2.html#5 """ __all__ = ["debugerror", "djangoerror", "emailerrors"] import sys, urlparse, pprint, traceb...
agpl-3.0
codesyntax/buildout.zrsexample
bootstrap.py
172
6501
############################################################################## # # Copyright (c) 2006 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. # THIS SOF...
gpl-2.0
adamtheturtle/flocker
flocker/acceptance/testtools.py
3
28485
# Copyright Hybrid Logic Ltd. See LICENSE file for details. """ Testing utilities for ``flocker.acceptance``. """ from functools import wraps from json import dumps from os import environ from unittest import SkipTest, skipUnless from uuid import uuid4 import json from twisted.web.http import OK, CREATED from twist...
apache-2.0
seap-udea/tQuakes
stations/bin/tquakes-fetch.py
1
1423
from tquakes import * print "*"*50+"\nRUNNING tquakes-fetch\n"+"*"*50 # ################################################## # CONFIGURATION # ################################################## conf=loadConf("configuration") # ################################################## # LOAD STATION INFORMATION # #############...
gpl-2.0
jnishi/chainer
chainer/testing/attr.py
2
1667
import os import unittest try: import pytest _error = None except ImportError as e: _error = e def is_available(): return _error is None def check_available(): if _error is not None: raise RuntimeError('''\ {} is not available. Reason: {}: {}'''.format(__name__, type(_error).__name__,...
mit
maple42/sample-code
sample-code/examples/python/android_simple.py
36
1787
import os from time import sleep import unittest from appium import webdriver # Returns abs path relative to this file and not cwd PATH = lambda p: os.path.abspath( os.path.join(os.path.dirname(__file__), p) ) class SimpleAndroidTests(unittest.TestCase): def setUp(self): desired_caps = {} de...
apache-2.0
DecipherOne/Troglodyte
Trog Build Dependencies/Python26/Lib/encodings/iso8859_7.py
593
13100
""" Python Character Mapping Codec iso8859_7 generated from 'MAPPINGS/ISO8859/8859-7.TXT' with gencodec.py. """#" import codecs ### Codec APIs class Codec(codecs.Codec): def encode(self,input,errors='strict'): return codecs.charmap_encode(input,errors,encoding_table) def decode(self,input,errors='...
mit
noironetworks/heat
heat/engine/resources/openstack/octavia/l7rule.py
2
5069
# # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # ...
apache-2.0
jimcunderwood/MissionPlanner
Lib/site-packages/scipy/linalg/_testutils.py
62
1738
import numpy as np class _FakeMatrix(object): def __init__(self, data): self._data = data self.__array_interface__ = data.__array_interface__ class _FakeMatrix2(object): def __init__(self, data): self._data = data def __array__(self): return self._data def _get_array(shape...
gpl-3.0
sjohannes/exaile
xlgui/panel/flatplaylist.py
2
5857
# Copyright (C) 2008-2010 Adam Olsen # # 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, or (at your option) # any later version. # # This program is distributed in the hope that...
gpl-2.0
paulmadore/Eric-IDE
6-6.0.9/eric/QScintilla/Lexers/LexerPython.py
2
5391
# -*- coding: utf-8 -*- # Copyright (c) 2002 - 2015 Detlev Offenbach <detlev@die-offenbachs.de> # """ Module implementing a Python lexer with some additional methods. """ from __future__ import unicode_literals import re from PyQt5.Qsci import QsciLexerPython, QsciScintilla from .Lexer import Lexer import Prefere...
gpl-3.0
chiamingyen/pygroup
wsgi/static/Brython2.1.4-20140810-083054/Lib/unittest/case.py
743
48873
"""Test case implementation""" import sys import functools import difflib import pprint import re import warnings import collections from . import result from .util import (strclass, safe_repr, _count_diff_all_purpose, _count_diff_hashable) __unittest = True DIFF_OMITTED = ('\nDiff is %s charact...
gpl-2.0
shreyasp/erpnext
erpnext/accounts/doctype/shipping_rule/test_shipping_rule.py
97
1585
# 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 import unittest from erpnext.accounts.doctype.shipping_rule.shipping_rule import FromGreaterThanToError, ManyBlankToValuesError, Overlappi...
gpl-3.0
raphaelvalentin/qtlayout
syntax/linalg/__init__.py
1
3154
from exceptions import Exception from libarray import * class LinAlgError(Exception): pass import lu import gauss import qr import svd import inv import chol gauss = gauss LULinAlgError = lu.LinAlgError lu = lu.LUDecomposition qr = qr.householder lstsq = svd.lstsq svd = svd.svd inv = inv.inv chol = chol.cholesky...
gpl-2.0
fly19890211/edx-platform
lms/djangoapps/mobile_api/migrations/0001_initial.py
100
4994
# -*- coding: utf-8 -*- from south.utils import datetime_utils as datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding model 'MobileApiConfig' db.create_table('mobile_api_mobileapicon...
agpl-3.0
Lorquas/subscription-manager
test/test_entbranding.py
2
29486
from __future__ import print_function, division, absolute_import import mock from . import fixture from . import stubs from rhsm import certificate2 from subscription_manager import entbranding from subscription_manager import rhelentbranding from subscription_manager import injection as inj # The certificate2.Pro...
gpl-2.0
jakevdp/Mmani
megaman/geometry/affinity.py
3
1893
# LICENSE: Simplified BSD https://github.com/mmp2/megaman/blob/master/LICENSE import numpy as np from scipy.sparse import isspmatrix from sklearn.utils.validation import check_array from .utils import RegisterSubclasses def compute_affinity_matrix(adjacency_matrix, method='auto', **kwargs): """Compute the affin...
bsd-2-clause