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
landryb/QGIS
python/plugins/processing/algs/exampleprovider/ProcessingExampleProviderPlugin.py
26
1655
# -*- coding: utf-8 -*- """ *************************************************************************** __init__.py --------------------- Date : July 2013 Copyright : (C) 2013 by Victor Olaya Email : volayaf at gmail dot com ********************************...
gpl-2.0
MalloyPower/parsing-python
front-end/testsuite-python-lib/Python-2.6/Lib/curses/has_key.py
81
5633
# # Emulation of has_key() function for platforms that don't use ncurses # import _curses # Table mapping curses keys to the terminfo capability name _capability_names = { _curses.KEY_A1: 'ka1', _curses.KEY_A3: 'ka3', _curses.KEY_B2: 'kb2', _curses.KEY_BACKSPACE: 'kbs', _curses.KEY_BEG: 'kbeg', ...
mit
mscuthbert/abjad
abjad/tools/timespantools/test/test_timespantools_Timespan_is_congruent_to_timespan.py
2
2925
# -*- encoding: utf-8 -*- from abjad import * def test_timespantools_Timespan_is_congruent_to_timespan_01(): timespan_1 = timespantools.Timespan(0, 15) timespan_2 = timespantools.Timespan(-10, -5) assert not timespan_1.is_congruent_to_timespan(timespan_2) def test_timespantools_Timespan_is_congruent_to_t...
gpl-3.0
PySide/Shiboken
tests/samplebinding/multi_cpp_inheritance_test.py
6
3178
#!/usr/bin/env python # -*- coding: utf-8 -*- # # This file is part of the Shiboken Python Bindings Generator project. # # Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). # # Contact: PySide team <contact@pyside.org> # # This program is free software; you can redistribute it and/or # modify it under the terms...
gpl-2.0
bazitur/brackets-python-tools
pythonfiles/parso/python/token.py
2
1777
from __future__ import absolute_import from itertools import count from token import * from parso._compatibility import py_version _counter = count(N_TOKENS) # Never want to see this thing again. del N_TOKENS COMMENT = next(_counter) tok_name[COMMENT] = 'COMMENT' NL = next(_counter) tok_name[NL] = 'NL' # Sets the...
mit
glaubitz/fs-uae-debian
arcade/launcher/settings/settings_header.py
2
1384
import fsui from fsbc.util import unused from launcher.ui.skin import Skin class SettingsHeader(fsui.Group): ICON_LEFT = 0 ICON_RIGHT = 1 def __init__( self, parent, icon, title, subtitle="", icon_position=ICON_RIGHT ): unused(subtitle) fsui.Group.__init__(self, parent) ...
gpl-2.0
twoh/leevee
env/Lib/encodings/aliases.py
418
14848
""" Encoding Aliases Support This module is used by the encodings package search function to map encodings names to module names. Note that the search function normalizes the encoding names before doing the lookup, so the mapping will have to map normalized encoding names to module names. Con...
mit
djw8605/htcondor
src/condor_contrib/condor_pigeon/src/condor_pigeon_client/skype_linux_tools/find_chat.py
10
4722
#! /usr/bin/python # # Displays all multi-chats and allows to open them. # # (c) Copyright 2007, Vincent Oberle, vincent@oberle.org # # This software may be used and distributed according to the terms # of the GNU Public License, incorporated herein by reference. import sys import re from optparse import OptionParser...
apache-2.0
dangtrinhnt/django-saml2
djangosaml2/templatetags/idplist.py
8
1419
# Copyright (C) 2011-2012 Yaco Sistemas (http://www.yaco.es) # # 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
nevir/plexability
extern/depot_tools/third_party/boto/mashups/server.py
91
14043
# 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...
gpl-2.0
kalahbrown/HueBigSQL
desktop/core/ext-py/django-extensions-1.5.0/docs/conf.py
33
6439
# -*- coding: utf-8 -*- # # django-extensions documentation build configuration file, created by # sphinx-quickstart on Wed Apr 1 20:39:40 2009. # # 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 fil...
apache-2.0
kriswuollett/grpc
examples/python/multiplex/route_guide_resources.py
115
2221
# Copyright 2015, 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 f...
bsd-3-clause
howethomas/synapse
tests/rest/client/v1/test_presence.py
2
12591
# -*- coding: utf-8 -*- # Copyright 2014 OpenMarket Ltd # # 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 la...
apache-2.0
leiferikb/bitpop
src/third_party/pyftpdlib/src/demo/basic_ftpd.py
4
2796
#!/usr/bin/env python # $Id: basic_ftpd.py 977 2012-01-22 23:05:09Z g.rodola $ # pyftpdlib is released under the MIT license, reproduced below: # ====================================================================== # Copyright (C) 2007-2012 Giampaolo Rodola' <g.rodola@gmail.com> # # All Ri...
gpl-3.0
joachimmetz/plaso
plaso/parsers/asl.py
2
11003
# -*- coding: utf-8 -*- """The Apple System Log (ASL) file parser.""" import os from dfdatetime import posix_time as dfdatetime_posix_time from dfdatetime import semantic_time as dfdatetime_semantic_time from plaso.containers import events from plaso.containers import time_events from plaso.lib import definitions fr...
apache-2.0
FireWRT/OpenWrt-Firefly-Libraries
staging_dir/target-mipsel_1004kc+dsp_uClibc-0.9.33.2/usr/lib/python3.4/ctypes/test/test_parameters.py
80
6196
import unittest, sys from ctypes.test import need_symbol class SimpleTypesTestCase(unittest.TestCase): def setUp(self): import ctypes try: from _ctypes import set_conversion_mode except ImportError: pass else: self.prev_conv_mode = set_conversion...
gpl-2.0
SamReha/Concepts-Game
languages/pt-br.py
88
7249
# -*- coding: utf-8 -*- { '!langcode!': 'pt-br', '!langname!': 'Português (do Brasil)', '"update" is an optional expression like "field1=\'newvalue\'". You cannot update or delete the results of a JOIN': '"update" é uma expressão opcional como "campo1=\'novovalor\'". Você não pode atualizar ou apagar os resultados de u...
gpl-2.0
ubic135/odoo-design
addons/auth_signup/__openerp__.py
313
1571
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2009-today OpenERP SA (<http://www.openerp.com>) # # This program is free software: you can redistribute it and/or modify # it under the terms o...
agpl-3.0
dlazz/ansible
lib/ansible/plugins/connection/funcd.py
59
3533
# Based on local.py (c) 2012, Michael DeHaan <michael.dehaan@gmail.com> # Based on chroot.py (c) 2013, Maykel Moya <mmoya@speedyrails.com> # Copyright (c) 2013, Michael Scherer <misc@zarb.org> # Copyright (c) 2017 Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.tx...
gpl-3.0
chamakov/namebench
nb_third_party/dns/rdtypes/ANY/CNAME.py
248
1092
# Copyright (C) 2003-2007, 2009, 2010 Nominum, Inc. # # Permission to use, copy, modify, and distribute this software and its # documentation for any purpose with or without fee is hereby granted, # provided that the above copyright notice and this permission notice # appear in all copies. # # THE SOFTWARE IS PROVIDED ...
apache-2.0
alfredoavanzosc/odoomrp-wip-1
sale_product_variants/__openerp__.py
14
1775
# -*- encoding: utf-8 -*- ############################################################################## # # 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 Licen...
agpl-3.0
titasakgm/brc-stock
openerp/addons/report_geraldo/lib/geraldo/site/newsite/django_1_0/tests/regressiontests/null_queries/models.py
16
1789
from django.db import models class Poll(models.Model): question = models.CharField(max_length=200) def __unicode__(self): return u"Q: %s " % self.question class Choice(models.Model): poll = models.ForeignKey(Poll) choice = models.CharField(max_length=200) def __unicode__(self): r...
agpl-3.0
gsmaxwell/phase_offset_rx
gr-digital/python/qa_probe_density.py
7
2141
#!/usr/bin/env python # # Copyright 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 your option) ...
gpl-3.0
rnestler/servo
tests/wpt/mozilla/tests/webgl/conformance-2.0.0/deqp/functional/gles3/uniformbuffers/uniformbuffers_test_generator.py
51
3333
#!/usr/bin/env python # Copyright (c) 2016 The Khronos Group Inc. # # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and/or associated documentation files (the # "Materials"), to deal in the Materials without restriction, including # without limitation the rights to use...
mpl-2.0
alu042/edx-platform
common/djangoapps/student/tests/test_credit.py
28
8077
""" Tests for credit courses on the student dashboard. """ import unittest import datetime from mock import patch import pytz from django.conf import settings from django.core.urlresolvers import reverse from django.test.utils import override_settings from xmodule.modulestore.tests.django_utils import ModuleStoreTes...
agpl-3.0
snnn/tensorflow
tensorflow/contrib/losses/python/losses/loss_ops.py
19
28132
# 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
tjanez/ansible
lib/ansible/module_utils/dellos9.py
47
4862
# # (c) 2015 Peter Sprygada, <psprygada@ansible.com> # # Copyright (c) 2016 Dell Inc. # # 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 b...
gpl-3.0
TaylorOshan/pysal
pysal/contrib/glm/links.py
35
20123
''' Defines the link functions to be used with GLM and GEE families. ''' import numpy as np import scipy.stats FLOAT_EPS = np.finfo(float).eps class Link(object): """ A generic link function for one-parameter exponential family. `Link` does nothing, but lays out the methods expected of any subclass. ...
bsd-3-clause
athena-voice/athena-voice-client
athena/modules/active/athena_control.py
1
1425
""" Finds and returns the latest bitcoin price Usage Examples: - "What is the price of bitcoin?" - "How much is a bitcoin worth?" """ from athena.classes.module import Module from athena.classes.task import ActiveTask from athena import brain class QuitTask(ActiveTask): d...
gpl-3.0
jumpstarter-io/neutron
neutron/tests/unit/ryu/test_ryu_plugin.py
9
1570
# Copyright (c) 2012 OpenStack Foundation. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to...
apache-2.0
TimBuckley/effective_django
tests/custom_pk/fields.py
33
1629
import random import string from django.db import models from django.utils import six from django.utils.encoding import python_2_unicode_compatible @python_2_unicode_compatible class MyWrapper(object): def __init__(self, value): self.value = value def __repr__(self): return "<%s: %s>" % (sel...
bsd-3-clause
CeltonMcGrath/TACTIC
3rd_party/CherryPy/cherrypy/test/modfcgid.py
6
4258
"""Wrapper for mod_fcgid, for use as a CherryPy HTTP server when testing. To autostart fcgid, the "apache" executable or script must be on your system path, or you must override the global APACHE_PATH. On some platforms, "apache" may be called "apachectl", "apache2ctl", or "httpd"--create a symlink to them if needed. ...
epl-1.0
bergercookie/Pump3000
for_keep/final_code/device_configuration.py
1
1621
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'new_dev.ui' # # Created: Sun Jun 8 13:50:08 2014 # by: pyside-uic 0.2.15 running on PySide 1.2.1 # # WARNING! All changes made in this file will be lost! from PySide import QtCore, QtGui class Ui_Dialog(object): def setupUi(self,...
bsd-2-clause
FrankTsui/robust_rescaled_svm
common.py
1
1636
import numpy as np import matplotlib.pyplot as plt def plot_decision_function(classifier, fea, gnd, title): ''' plot the decision function in 2-d plane classifiers: the svm models fea: array like, shape = (smp_num, fea_num) gnd: array like, shape = (smp_num,) title: title ...
apache-2.0
JeanKossaifi/scikit-learn
sklearn/tree/tests/test_tree.py
48
47506
""" Testing for the tree module (sklearn.tree). """ import pickle from functools import partial from itertools import product import platform import numpy as np from scipy.sparse import csc_matrix from scipy.sparse import csr_matrix from scipy.sparse import coo_matrix from sklearn.random_projection import sparse_rand...
bsd-3-clause
miku/siskin
siskin/test_openurl.py
1
5627
from siskin.openurl import openurl_parameters_from_intermediateschema def test_openurl_from_intermediateschema(): cases = ( ('empty doc', {}, {}), ( 'title only', { 'rft.atitle': 'empty doc' }, { 'ctx_enc': 'info:ofi/e...
gpl-3.0
barryHub20/ServerAss2
lib/itsdangerous.py
626
31840
# -*- coding: utf-8 -*- """ itsdangerous ~~~~~~~~~~~~ A module that implements various functions to deal with untrusted sources. Mainly useful for web applications. :copyright: (c) 2014 by Armin Ronacher and the Django Software Foundation. :license: BSD, see LICENSE for more details. """ imp...
apache-2.0
felixbb/forseti-security
tests/common/gcp_api/bigquery_test.py
1
5019
# Copyright 2017 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 or agreed to in writing, s...
apache-2.0
slohse/ansible
setup.py
34
11028
from __future__ import print_function import json import os import os.path import re import sys import warnings from collections import defaultdict from distutils.command.build_scripts import build_scripts as BuildScripts from distutils.command.sdist import sdist as SDist try: from setuptools import setup, find...
gpl-3.0
sekikn/incubator-airflow
airflow/contrib/hooks/aws_athena_hook.py
12
1153
# # 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...
apache-2.0
clumsy/intellij-community
python/lib/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'): ...
apache-2.0
BackupTheBerlios/espressopp
contrib/mpi4py/mpi4py-1.3/test/test_attributes.py
3
8196
from mpi4py import MPI import mpiunittest as unittest from sys import getrefcount as getrc class BaseTestCommAttr(object): keyval = MPI.KEYVAL_INVALID def tearDown(self): self.comm.Free() if self.keyval != MPI.KEYVAL_INVALID: self.keyval = MPI.Comm.Free_keyval(self.keyval) ...
gpl-3.0
Simran-B/arangodb
3rdParty/V8-4.3.61/third_party/python_26/Lib/numbers.py
59
10271
# Copyright 2007 Google, Inc. All Rights Reserved. # Licensed to PSF under a Contributor Agreement. """Abstract Base Classes (ABCs) for numbers, according to PEP 3141. TODO: Fill out more detailed documentation on the operators.""" from __future__ import division from abc import ABCMeta, abstractmethod, abstractprop...
apache-2.0
mgracer48/panda3d
direct/src/distributed/MsgTypes.py
5
5594
"""MsgTypes module: contains distributed object message types""" from direct.showbase.PythonUtil import invertDictLossless MsgName2Id = { # 2 new params: passwd, char bool 0/1 1 = new account # 2 new return values: 129 = not found, 12 = bad passwd, 'CLIENT_LOGIN': 1, '...
bsd-3-clause
Bulochkin/tensorflow_pack
tensorflow/python/kernel_tests/distributions/multinomial_test.py
48
13141
# 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
sebmarchand/syzygy
third_party/numpy/files/numpy/distutils/fcompiler/gnu.py
85
14383
import re import os import sys import warnings import platform import tempfile from subprocess import Popen, PIPE, STDOUT from numpy.distutils.cpuinfo import cpu from numpy.distutils.fcompiler import FCompiler from numpy.distutils.exec_command import exec_command from numpy.distutils.misc_util import msvc_runtime_libr...
apache-2.0
KirtoXX/Security_Camera
ssd_mobilenet/object_detection/models/faster_rcnn_inception_resnet_v2_feature_extractor.py
13
9042
# 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
jkyeung/XlsxWriter
xlsxwriter/test/comparison/test_fit_to_pages01.py
1
1354
############################################################################### # # Tests for XlsxWriter. # # Copyright (c), 2013-2016, John McNamara, jmcnamara@cpan.org # from ..excel_comparsion_test import ExcelComparisonTest from ...workbook import Workbook class TestCompareXLSXFiles(ExcelComparisonTest): """...
bsd-2-clause
est31/godot
tools/translations/extract.py
4
3162
#!/bin/python import fnmatch import os import shutil import subprocess import sys line_nb = False for arg in sys.argv[1:]: if (arg == "--with-line-nb"): print("Enabling line numbers in the context locations.") line_nb = True else: os.sys.exit("Non supported argument '" + arg + "'. Aborting.") if (not os.p...
mit
kerrpy/kerrpy
docs/source/conf.py
1
10716
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # kerrpy documentation build configuration file, created by # sphinx-quickstart on Wed Aug 10 14:00:40 2016. # # This file is execfile()d with the current directory set to its # containing dir. # # Note that not all possible configuration values are present in this # aut...
gpl-3.0
crazcalm/AngelHack_python34
myenv/Lib/site-packages/pip/exceptions.py
398
1086
"""Exceptions used throughout package""" class PipError(Exception): """Base pip exception""" class InstallationError(PipError): """General exception during installation""" class UninstallationError(PipError): """General exception during uninstallation""" class DistributionNotFound(InstallationError)...
mit
feroda/django
django/contrib/postgres/fields/hstore.py
45
2945
import json from django.contrib.postgres import forms, lookups from django.contrib.postgres.fields.array import ArrayField from django.core import exceptions from django.db.models import Field, TextField, Transform from django.utils import six from django.utils.translation import ugettext_lazy as _ __all__ = ['HStore...
bsd-3-clause
Juniper/tempest
tempest/tests/lib/common/test_http.py
1
2801
# All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in...
apache-2.0
PsychoGame/gee-caf-kernel
Documentation/networking/cxacru-cf.py
14668
1626
#!/usr/bin/env python # Copyright 2009 Simon Arlott # # This program is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by the Free # Software Foundation; either version 2 of the License, or (at your option) # any later version. # # This program i...
gpl-2.0
pratikmallya/hue
desktop/core/ext-py/Django-1.6.10/django/views/decorators/cache.py
129
2286
from functools import wraps from django.utils.decorators import decorator_from_middleware_with_args, available_attrs from django.utils.cache import patch_cache_control, add_never_cache_headers from django.middleware.cache import CacheMiddleware def cache_page(*args, **kwargs): """ Decorator for views that tri...
apache-2.0
sf-wind/caffe2
caffe2/python/pipeline_test.py
4
3358
# 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
tody411/ImageViewerFramework
ivf/cmds/save_depth.py
1
1284
# -*- coding: utf-8 -*- ## @package ivf.cmds.save_depth # # ivf.cmds.save_depth utility package. # @author tody # @date 2016/02/02 from PyQt4.QtGui import * from PyQt4.QtCore import * import os from ivf.cmds.base_cmds import BaseCommand from ivf.scene.gl3d.image_plane import ImagePlane from ivf.io_u...
mit
David-Amaro/bank-payment
account_payment_blocking/__init__.py
16
1081
# -*- encoding: utf-8 -*- ############################################################################## # # Account Payment Blocking module for Odoo # Copyright (C) 2014-2015 ACSONE SA/NV (http://acsone.eu) # @author Stéphane Bidoul <stephane.bidoul@acsone.eu> # # This program is free software: you can red...
agpl-3.0
kisel/trex-core
scripts/astf/param_mss_err.py
2
1056
from trex_astf_lib.api import * # IPV6 tunable example # # ipv6.src_msb # ipv6.dst_msb # ipv6.enable # class Prof1(): def __init__(self): pass def get_profile(self, **kwargs): # ip generator ip_gen_c = ASTFIPGenDist(ip_range=["16.0.0.0", "16.0.0.255"], distribution="seq") ...
apache-2.0
vschs007/buck
third-party/py/pex/pex/interpreter.py
52
12996
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). """pex support for interacting with interpreters.""" from __future__ import absolute_import import os import re import subprocess import sys from collections import defaultdict from pkg...
apache-2.0
AOKP/external_chromium_org
tools/python/google/gethash_timer.py
182
4366
#!/usr/bin/env python # Copyright (c) 2011 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. """Issue a series of GetHash requests to the SafeBrowsing servers and measure the response times. Usage: $ ./gethash_timer.py -...
bsd-3-clause
srinathv/vispy
vispy/visuals/isocurve.py
18
7809
# -*- coding: utf-8 -*- # Copyright (c) 2015, Vispy Development Team. # Distributed under the (new) BSD License. See LICENSE.txt for more info. from __future__ import division import numpy as np from .line import LineVisual from ..color import ColorArray from ..color.colormap import _normalize, get_colormap from ..g...
bsd-3-clause
jef-n/QGIS
python/plugins/processing/tests/SagaAlgorithmsTest.py
36
6002
# -*- coding: utf-8 -*- """ *************************************************************************** SagaAlgorithmsTests.py --------------------- Date : September 2017 Copyright : (C) 2017 by Alexander Bruy Email : alexander dot bruy at gmail dot com ***...
gpl-2.0
cbare/Etudes
python/strings.py
1
1543
""" String algorithms """ def balanced_parens(s: str) -> bool: open = 0 for c in s: if c=='(': open += 1 if c==')': if open > 0: open -= 1 else: return False return open==0 assert balanced_parens('') assert balanced_parens('()') asser...
apache-2.0
lorenzo-desantis/mne-python
mne/preprocessing/eog.py
6
7587
# Authors: Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr> # Denis Engemann <denis.engemann@gmail.com> # Eric Larson <larson.eric.d@gmail.com> # # License: BSD (3-clause) import numpy as np from .peak_finder import peak_finder from .. import pick_types, pick_channels from ..utils import...
bsd-3-clause
ttrifonov/EventBrain
src/eventbrain/bin/launcher.py
1
9958
#!/usr/bin/env python # file: launcher.py import os import sys import logging from optparse import OptionParser, OptionGroup from eventbrain.util.daemon import Daemon FORMAT = '%(asctime)-15s:%(name)s:%(process)d:%(levelname)s === %(message)s' logging.basicConfig(format=FORMAT, level=logging.INFO, stream=sys.stdout) ...
apache-2.0
dhalleine/tensorflow
tensorflow/contrib/distributions/python/kernel_tests/exponential_test.py
3
4546
# 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
BraveSirRobbo/steam-scraper
test.py
1
4225
import unittest from bs4 import BeautifulSoup import re def justOne(ls): assert(len(ls) == 1) return ls[0] def scrapePage(html_doc): soup = BeautifulSoup(html_doc, 'html.parser') ratings = [s.get_text() for s in soup.find_all("span",attrs={ "class": re.compile(r"game_review_summary .*")})] assert(len(ratin...
apache-2.0
felipeAraujo/Bet-Calculator
test_bet.py
1
13680
import unittest from bet_calculator.bet_calculator import Bet_Calculator from decimal import * class Bet_Test_Case(unittest.TestCase): """Test the Bet_Calculator class""" def setUp(self): self.bet_calculator = Bet_Calculator() def test_if_is_calculating_that_odds_will_profit(self): """ ...
mit
zoyanhui/flask
tests/test_templating.py
148
13057
# -*- coding: utf-8 -*- """ tests.templating ~~~~~~~~~~~~~~~~ Template functionality :copyright: (c) 2015 by Armin Ronacher. :license: BSD, see LICENSE for more details. """ import pytest import flask import logging from jinja2 import TemplateNotFound def test_context_processing(): app = f...
bsd-3-clause
eljost/pysisyphus
deprecated/tests/test_dynamics/test_dynamics.py
1
2531
from matplotlib.patches import Circle import matplotlib.pyplot as plt import numpy as np import pytest from pysisyphus.calculators.AnaPot import AnaPot from pysisyphus.dynamics.velocity_verlet import md def test_velocity_verlet(): geom = AnaPot.get_geom((0.52, 1.80, 0)) x0 = geom.coords.copy() v0 = .1 * ...
gpl-3.0
yashsharan/sympy
sympy/calculus/euler.py
16
3263
""" This module implements a method to find Euler-Lagrange Equations for given Lagrangian. """ from itertools import combinations_with_replacement from sympy import Function, sympify, diff, Eq, S, Symbol, Derivative from sympy.core.compatibility import (iterable, range) def euler_equations(L, funcs=(), vars=()): ...
bsd-3-clause
Bachaco-ve/odoo
addons/account_test/report/account_test_report.py
194
3819
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved # $Id$ # # This program is free software: you can redistribute it and/or modify #...
agpl-3.0
adit-chandra/tensorflow
tensorflow/python/keras/applications/imagenet_utils.py
5
1439
# 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
fibbo/DIRAC
Interfaces/scripts/dirac-wms-job-attributes.py
8
1197
#!/usr/bin/env python ######################################################################## # $HeadURL$ # File : dirac-wms-job-attributes # Author : Stuart Paterson ######################################################################## """ Retrieve attributes associated with the given DIRAC job """ __RCSID__...
gpl-3.0
nikhil93uf/Qemu
scripts/tracetool/backend/simple.py
97
2669
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Simple built-in backend. """ __author__ = "Lluís Vilanova <vilanova@ac.upc.edu>" __copyright__ = "Copyright 2012-2014, Lluís Vilanova <vilanova@ac.upc.edu>" __license__ = "GPL version 2 or (at your option) any later version" __maintainer__ = "Stefan Hajnoczi"...
gpl-2.0
tod31/pyload
module/plugins/hoster/RPNetBiz.py
5
3545
# -*- coding: utf-8 -*- import re from module.plugins.internal.MultiHoster import MultiHoster from module.plugins.internal.misc import json class RPNetBiz(MultiHoster): __name__ = "RPNetBiz" __type__ = "hoster" __version__ = "0.20" __status__ = "testing" __pattern__ = r'https?://.+rpnet\...
gpl-3.0
yestech/gae-django-template
django/contrib/gis/db/backends/mysql/introspection.py
624
1426
from MySQLdb.constants import FIELD_TYPE from django.contrib.gis.gdal import OGRGeomType from django.db.backends.mysql.introspection import DatabaseIntrospection class MySQLIntrospection(DatabaseIntrospection): # Updating the data_types_reverse dictionary with the appropriate # type for Geometry fields. d...
bsd-3-clause
jeffery-do/Vizdoombot
doom/lib/python3.5/site-packages/theano/tensor/tests/test_io.py
7
2053
import unittest import theano from theano import tensor, function, Variable, Generic import numpy import os class T_load_tensor(unittest.TestCase): def setUp(self): self.data = numpy.arange(5, dtype=numpy.int32) self.filename = os.path.join( theano.config.compiledir, "_test...
mit
Hellowlol/HTPC-Manager
libs/mako/_ast_util.py
60
25652
# mako/_ast_util.py # Copyright (C) 2006-2015 the Mako authors and contributors <see AUTHORS file> # # This module is part of Mako and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php """ ast ~~~ The `ast` module helps Python applications to process trees of the Pyth...
mit
40223117cda/cda
static/Brython3.1.1-20150328-091302/Lib/test/test_int.py
765
12587
import sys import unittest from test.support import run_unittest L = [ ('0', 0), ('1', 1), ('9', 9), ('10', 10), ('99', 99), ('100', 100), ('314', 314), (' 314', 314), ('314 ', 314), (' \t\t 314 \t\t ', 314), (repr(sys.maxsize...
gpl-3.0
mzdaniel/oh-mainline
vendor/packages/python-otp/otp/hash.py
16
2386
import struct class BaseHash: def __init__(self, name): self.name = name def prepare(self, hash): if type(hash) is long: newhash = '' for i in range(56, -8, -8): newhash += chr((hash>>i)%256) hash = newhash return hash class HashMD5(...
agpl-3.0
rdio/sentry
tests/sentry/udp/tests.py
4
1167
# -*- coding: utf-8 -*- from __future__ import absolute_import from sentry.models import Project, User from sentry.services.udp import SentryUDPServer from sentry.testutils import TestCase, get_auth_header class SentryUDPTest(TestCase): def setUp(self): self.address = (('0.0.0.0', 0)) self.serve...
bsd-3-clause
hoonkim/Lesser
parsers/tests/test_http_parser.py
1
1060
from unittest import TestCase from parsers.http_parser import * __author__ = 'kimothy' class TestHttpParser(TestCase): def test_parse_url(self): testList = parse_url("//foo/bar//") self.assertEqual(testList[0], "foo") self.assertEqual(testList[1], "bar") self.assertEqual(len(test...
mit
kashev/kashev.rocks
manage.py
1
1238
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # kashev.rocks # Kashev Dalmia - kashev.dalmia@gmail.com from flask.ext.script import Manager from flask.ext.assets import ManageAssets from src.kashevrocks import app from src.assets import register_assets manager = Manager(app) assets_env = register_assets(app) manag...
mit
brayden2544/Mystuff-final
account/cached_templates/templates/password_reset.html.py
1
1886
# -*- coding:ascii -*- from mako import runtime, filters, cache UNDEFINED = runtime.UNDEFINED __M_dict_builtin = dict __M_locals_builtin = locals _magic_number = 9 _modified_time = 1397087641.387625 _enable_loop = True _template_filename = 'C:\\app\\account\\templates/password_reset.html' _template_uri = 'password_rese...
apache-2.0
nathanial/lettuce
tests/integration/lib/Django-1.3/tests/modeltests/model_inheritance/models.py
118
3888
""" XX. Model inheritance Model inheritance exists in two varieties: - abstract base classes which are a way of specifying common information inherited by the subclasses. They don't exist as a separate model. - non-abstract base classes (the default), which are models in their own right with ...
gpl-3.0
AtsushiSakai/PythonRobotics
PathPlanning/Eta3SplinePath/eta3_spline_path.py
1
13649
""" eta^3 polynomials planner author: Joe Dinius, Ph.D (https://jwdinius.github.io) Atsushi Sakai (@Atsushi_twi) Ref: - [eta^3-Splines for the Smooth Path Generation of Wheeled Mobile Robots] (https://ieeexplore.ieee.org/document/4339545/) """ import numpy as np import matplotlib.pyplot as plt from scipy.i...
mit
steenzout/python-barcode
docs/conf.py
1
11075
# -*- coding: utf-8 -*- # # Copyright 2010-2013, Thorsten Weimann; 2014, Alexander Shorin; 2016 Pedro Salgado # # 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/lic...
mit
SpredfastLegacy/JsBeautify
jsbeautifier/unpackers/packer.py
76
3302
# # Unpacker for Dean Edward's p.a.c.k.e.r, a part of javascript beautifier # by Einar Lielmanis <einar@jsbeautifier.org> # # written by Stefano Sanfilippo <a.little.coder@gmail.com> # # usage: # # if detect(some_string): # unpacked = unpack(some_string) # """Unpacker for Dean Edward's p.a.c.k.e.r""" import r...
bsd-3-clause
midma101/AndIWasJustGoingToBed
.venv/lib/python2.7/site-packages/markupsafe/__init__.py
371
8205
# -*- coding: utf-8 -*- """ markupsafe ~~~~~~~~~~ Implements a Markup string. :copyright: (c) 2010 by Armin Ronacher. :license: BSD, see LICENSE for more details. """ import re from markupsafe._compat import text_type, string_types, int_types, \ unichr, PY2 __all__ = ['Markup', 'soft_unicod...
mit
denfromufa/pythonnet
demo/helloform.py
8
1769
#!/usr/bin/env python # -*- coding: utf-8 -*- import clr SWF = clr.AddReference("System.Windows.Forms") print (SWF.Location) import System.Windows.Forms as WinForms from System.Drawing import Size, Point class HelloApp(WinForms.Form): """A simple hello world app that demonstrates the essentials of winfor...
mit
SpOOnman/claws
tools/vcard2xml.py
11
8810
#!/usr/bin/env python # -*- coding: latin-1 -*- """ Copyright © 2003 Bogdan Sumanariu <zarrok@yahoo.com> This file 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 ...
gpl-3.0
overtherain/scriptfile
software/googleAppEngine/lib/django_1_4/django/contrib/localflavor/za/forms.py
89
1940
""" South Africa-specific Form helpers """ from django.core.validators import EMPTY_VALUES from django.forms import ValidationError from django.forms.fields import CharField, RegexField from django.utils.checksums import luhn from django.utils.translation import gettext as _ import re from datetime import date id_re ...
mit
charukiewicz/beer-manager
venv/lib/python3.4/site-packages/pip/_vendor/requests/packages/chardet/big5prober.py
2931
1684
######################## 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...
mit
linearregression/socorro
socorro/app/fetch_transform_save_app.py
7
11493
# 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/. """this is the basis for any app that follows the fetch/transform/save model * the configman versions of the crash move...
mpl-2.0
tzanussi/linux-yocto-micro-3.17
Documentation/networking/cxacru-cf.py
14668
1626
#!/usr/bin/env python # Copyright 2009 Simon Arlott # # This program is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by the Free # Software Foundation; either version 2 of the License, or (at your option) # any later version. # # This program i...
gpl-2.0
Weihonghao/ECM
Vpy34/lib/python3.5/site-packages/numpy/f2py/__init__.py
63
2038
#!/usr/bin/env python """Fortran to Python Interface Generator. """ from __future__ import division, absolute_import, print_function __all__ = ['run_main', 'compile', 'f2py_testing'] import sys from . import f2py2e from . import f2py_testing from . import diagnose run_main = f2py2e.run_main main = f2py2e.main de...
agpl-3.0
gomiero/PTVS
Python/Product/Pyvot/Pyvot/xl/__init__.py
18
4494
# Copyright (c) Microsoft Corporation. # # This source code is subject to terms and conditions of the Apache License, Version 2.0. A # copy of the license can be found in the LICENSE.txt file at the root of this distribution. If # you cannot locate the Apache License, Version 2.0, please send an email to # vsp...
apache-2.0
odootr/odoo
addons/account/wizard/account_tax_chart.py
385
3247
# -*- 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