repo_name
stringlengths
5
100
path
stringlengths
4
294
copies
stringclasses
990 values
size
stringlengths
4
7
content
stringlengths
666
1M
license
stringclasses
15 values
magsilva/scriptLattes
scriptLattes/producoesBibliograficas/apresentacaoDeTrabalho.py
1
3793
#!/usr/bin/python # encoding: utf-8 # filename: apresentacaoDeTrabalho.py # # scriptLattes V8 # Copyright 2005-2013: Jesús P. Mena-Chalco e Roberto M. Cesar-Jr. # http://scriptlattes.sourceforge.net/ # # # Este programa é um software livre; você pode redistribui-lo e/ou # modifica-lo dentro dos termos da Licença ...
gpl-2.0
sveetch/djangotribune
djangotribune/views/help.py
3
2094
# -*- coding: utf-8 -*- """ View to display help DEPRECATED: now we use the doc on readthedoc """ import os from django import http from django.views.generic.base import TemplateView import djangotribune class DummySourceParser(object): """Dummy parser, return the source untransformed""" def __init__(self,...
mit
hsum/sqlalchemy
lib/sqlalchemy/dialects/mysql/zxjdbc.py
59
3942
# mysql/zxjdbc.py # Copyright (C) 2005-2015 the SQLAlchemy authors and contributors # <see AUTHORS file> # # This module is part of SQLAlchemy and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php """ .. dialect:: mysql+zxjdbc :name: zxjdbc for Jython :dbapi: zxjdbc :...
mit
Wafflespeanut/servo
tests/wpt/web-platform-tests/webvtt/parsing/file-parsing/tools/parser.py
89
18918
""" A direct translation of the webvtt file parsing algorithm. See https://w3c.github.io/webvtt/#file-parsing for documentation """ import re import string SPACE_CHARACTERS = [' ', '\t', '\n', '\f', '\r'] SPACE_SPLIT_PATTERN = r"[{}]*".format(''.join(SPACE_CHARACTERS)) DIGITS = string.digits class DictInit: def ...
mpl-2.0
clchiou/garage
py/garage/garage/threads/tasklets.py
1
2796
__all__ = [ 'TaskQueue', 'tasklet', ] import logging from garage.assertions import ASSERT from garage.threads import actors from garage.threads import queues LOG = logging.getLogger(__name__) class TaskQueue(queues.ForwardingQueue): """A task queue (vs executor) is for scenarios that the number of ...
mit
ktan2020/legacy-automation
win/Lib/unittest/test/test_runner.py
9
8340
import unittest from cStringIO import StringIO import pickle from .support import LoggingResult, ResultWithNoStartTestRunStopTestRun class TestCleanUp(unittest.TestCase): def testCleanUp(self): class TestableTest(unittest.TestCase): def testNothing(self): pass ...
mit
nzavagli/UnrealPy
UnrealPyEmbed/Development/Python/2015.08.07-Python2710-x64-Source-vs2015/Python27/Source/pycrypto-2.6.1/lib/Crypto/SelfTest/Hash/__init__.py
116
2518
# -*- coding: utf-8 -*- # # SelfTest/Hash/__init__.py: Self-test for hash modules # # Written in 2008 by Dwayne C. Litzenberger <dlitz@dlitz.net> # # =================================================================== # The contents of this file are dedicated to the public domain. To # the extent that dedication to t...
mit
mandeepdhami/nova
nova/tests/functional/v3/test_simple_tenant_usage.py
24
2813
# 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 t...
apache-2.0
srikantbmandal/ansible
lib/ansible/modules/packaging/os/zypper.py
18
16707
#!/usr/bin/python -tt # -*- coding: utf-8 -*- # (c) 2013, Patrick Callahan <pmc@patrickcallahan.com> # based on # openbsd_pkg # (c) 2013 # Patrik Lundin <patrik.lundin.swe@gmail.com> # # yum # (c) 2012, Red Hat, Inc # Written by Seth Vidal <skvidal at fedoraproject.org> # # This...
gpl-3.0
dgwakeman/mne-python
examples/inverse/plot_gamma_map_inverse.py
30
2316
""" =============================================================================== Compute a sparse inverse solution using the Gamma-Map empirical Bayesian method =============================================================================== See Wipf et al. "A unified Bayesian framework for MEG/EEG source imaging." ...
bsd-3-clause
vinegret/youtube-dl
youtube_dl/extractor/medialaan.py
22
9994
from __future__ import unicode_literals import re from .gigya import GigyaBaseIE from ..compat import compat_str from ..utils import ( int_or_none, parse_duration, try_get, unified_timestamp, ) class MedialaanIE(GigyaBaseIE): _VALID_URL = r'''(?x) https?:// ...
unlicense
bencejuhaasz/L0C4L1Z3R
L0C_SDR.py
1
4881
import math import time import socket from subprocess import call k1 = [] def string2float(s): try: return(float(s)) except: return(s) def convert_deg2rad(deg): rad = (deg / 180) * math.pi return rad def FlushSock(): global sock sock.setblocking(False) while 1: tr...
gpl-3.0
gkarlin/django-jenkins
build/Django/django/utils/tree.py
109
5851
""" A class for storing a tree graph. Primarily used for filter constructs in the ORM. """ import copy class Node(object): """ A single internal node in the tree graph. A Node should be viewed as a connection (the root) with the children being either leaf nodes or other Node instances. """ # S...
lgpl-3.0
nikhil93uf/Qemu
scripts/tracetool/backend/__init__.py
83
3953
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Backend management. Creating new backends --------------------- A new backend named 'foo-bar' corresponds to Python module 'tracetool/backend/foo_bar.py'. A backend module should provide a docstring, whose first non-empty line will be considered its short descripti...
gpl-2.0
CoolProp/CoolProp
Web/scripts/fluid_properties.Mixtures.py
2
2243
from __future__ import print_function from CPWeb.BibtexTools import getCitationOrAlternative, getBibtexParser import CoolProp import os.path web_dir = os.path.abspath(os.path.join(os.path.dirname(__file__), '..')) csvfile = os.path.join(web_dir, 'fluid_properties', 'Mixtures.csv') def merge_args(*args): return ...
mit
darkryder/django
tests/generic_relations/tests.py
24
30730
from __future__ import unicode_literals from django import forms from django.contrib.contenttypes.forms import generic_inlineformset_factory from django.contrib.contenttypes.models import ContentType from django.core.exceptions import FieldError from django.db import IntegrityError from django.db.models import Q from ...
bsd-3-clause
voostar/pdfmergeWEB
pdfmergeWEB/settings.py
1
5511
# Django settings for pdfmergeWEB project. import os DEBUG = True TEMPLATE_DEBUG = DEBUG ADMINS = ( # ('Your Name', 'your_email@example.com'), ) MANAGERS = ADMINS DATABASES = { 'default': { 'ENGINE': 'django.db.backends.', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'. 'NAME': ...
mit
okwasi/gyp
test/gyp-defines/gyptest-regyp.py
268
1260
#!/usr/bin/env python # Copyright (c) 2012 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """ Verifies that when the same value is repeated for a gyp define, duplicates are stripped from the regeneration rule. """ import os impor...
bsd-3-clause
citrix-openstack-build/python-neutronclient
neutronclient/openstack/common/timeutils.py
33
5625
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2011 OpenStack Foundation. # 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.apac...
apache-2.0
rsalveti/xbmc-eden-flattened
addons/script.module.simplejson/lib/simplejson/scanner.py
928
2227
"""JSON token scanner """ import re try: from simplejson._speedups import make_scanner as c_make_scanner except ImportError: c_make_scanner = None __all__ = ['make_scanner'] NUMBER_RE = re.compile( r'(-?(?:0|[1-9]\d*))(\.\d+)?([eE][-+]?\d+)?', (re.VERBOSE | re.MULTILINE | re.DOTALL)) def py_make_scan...
gpl-2.0
appleseedhq/gaffer
python/GafferSceneUI/ShaderTweaksUI.py
1
12283
########################################################################## # # Copyright (c) 2016, Image Engine Design 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: # # * Redistrib...
bsd-3-clause
im-infamou5/volatility
volatility/win32/crashdump.py
58
28101
# Volatility # Copyright (c) 2007-2013 Volatility Foundation # Copyright (c) 2008 Brendan Dolan-Gavitt <bdolangavitt@wesleyan.edu> # # This file is part of Volatility. # # Volatility 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...
gpl-2.0
web30s/odoo-9.0c-20160402
hello/templates/openerp/addons/stock/stock.py
1
296175
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. from datetime import date, datetime from dateutil import relativedelta import json import time import sets import openerp from openerp.osv import fields, osv from openerp.tools.float_utils import float_compare, float_ro...
gpl-3.0
hamish2014/optTune
optTune/tMOPSO_code/test_CPV_evaluation_manager.py
1
1419
#! /usr/bin/env python import sys, numpy sys.path.append('../../') from tMOPSO_module import CPV_evaluation_manager, get_F_vals_at_specified_OFE_budgets def optAlg(y): ''' y = [CPV_1, OFE_budget, randomSeed] ''' n = numpy.random.randint(5,10) E = numpy.arange(1,n) F = numpy.arange(1,n) return F, E...
gpl-3.0
rhyolight/nupic.son
tests/app/soc/mapreduce/test_convert_user.py
1
2682
# Copyright 2012 the Melange 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 wr...
apache-2.0
gonboy/sl4a
python/src/Lib/test/test_weakref.py
55
41054
import gc import sys import unittest import UserList import weakref import operator from test import test_support # Used in ReferencesTestCase.test_ref_created_during_del() . ref_from_del = None class C: def method(self): pass class Callable: bar = None def __call__(self, x): self.bar ...
apache-2.0
siongui/pali
tipitaka/setup/init2tocsToJson.py
2
2237
#!/usr/bin/env python # -*- coding:utf-8 -*- import os import json from variables import getInfoFilePath from variables import getTreeviewJsonPath """ tipitaka_toc.xml contains tipitaka, commentaries, and sun-commentaries toc1.xml contains only tipitaka """ separator = u'#@%' def prettyPrint(obj): print(json.dump...
unlicense
baiyunping333/BurpSuite-Plugins
Sqlmap/lib/parse/configfile.py
2
3636
#!/usr/bin/env python """ Copyright (c) 2006-2014 sqlmap developers (http://sqlmap.org/) See the file 'doc/COPYING' for copying permission """ import codecs from ConfigParser import MissingSectionHeaderError from ConfigParser import ParsingError from lib.core.common import checkFile from lib.core.common import open...
gpl-2.0
ryananguiano/kafka-gConsumer
tests/test_kafka_gconsumer.py
1
2174
#!/usr/bin/env python """ test_kafka_gconsumer ---------------------------------- Tests for `kafka_gconsumer` module. """ import os import gevent import pytest import random import string from confluent_kafka import Producer from confluent_kafka.avro import AvroProducer from kafka_gconsumer import Consumer, AvroCons...
mit
harshavardhana/tweepy
tweepy/cache.py
5
11544
# Tweepy # Copyright 2009-2010 Joshua Roesslein # See LICENSE for details. import time import threading import os try: import cPickle as pickle except ImportError: import pickle try: import hashlib except ImportError: # python 2.4 import md5 as hashlib try: import fcntl except ImportError: ...
apache-2.0
tclose/python-neo
neo/io/asciispiketrainio.py
7
4247
# -*- coding: utf-8 -*- """ Classe for reading/writing SpikeTrains in a text file. It is the simple case where different spiketrains are written line by line. Supported : Read/Write Author: sgarcia """ import os import numpy as np import quantities as pq from neo.io.baseio import BaseIO from neo.core import Segm...
bsd-3-clause
thnee/ansible
lib/ansible/modules/cloud/google/gcp_bigquery_table.py
10
58848
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright (C) 2017 Google # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # ---------------------------------------------------------------------------- # # *** AUTO GENERATED CODE *** AUTO GENERATED CODE *** # ...
gpl-3.0
paulproteus/django
django/template/loader.py
112
7927
# Wrapper for loading templates from storage of some sort (e.g. filesystem, database). # # This uses the TEMPLATE_LOADERS setting, which is a list of loaders to use. # Each loader is expected to have this interface: # # callable(name, dirs=[]) # # name is the template name. # dirs is an optional list of directories ...
bsd-3-clause
Jorge-Rodriguez/ansible
lib/ansible/modules/network/fortios/fortios_authentication_setting.py
24
8962
#!/usr/bin/python from __future__ import (absolute_import, division, print_function) # Copyright 2018 Fortinet, Inc. # # 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 Lic...
gpl-3.0
Dave667/service
plugin.video.tvrain.ru/default.py
2
1096
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright (c) 2011 XBMC-Russia, HD-lab Team, E-mail: dev@hd-lab.ru # Writer (c) 12/03/2011, Kostynoy S.A., E-mail: seppius2@gmail.com # # This Program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as p...
gpl-2.0
RafaelTorrealba/odoo
openerp/report/common.py
457
3337
# -*- 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
adico-somoto/deep-learning
transfer-learning/tensorflow_vgg/test_vgg19_trainable.py
152
1435
""" Simple tester for the vgg19_trainable """ import tensorflow as tf from tensoflow_vgg import vgg19_trainable as vgg19 from tensoflow_vgg import utils img1 = utils.load_image("./test_data/tiger.jpeg") img1_true_result = [1 if i == 292 else 0 for i in range(1000)] # 1-hot result for tiger batch1 = img1.reshape((1...
mit
Garrett-R/scikit-learn
examples/linear_model/plot_ols_ridge_variance.py
387
2060
#!/usr/bin/python # -*- coding: utf-8 -*- """ ========================================================= Ordinary Least Squares and Ridge Regression Variance ========================================================= Due to the few points in each dimension and the straight line that linear regression uses to follow thes...
bsd-3-clause
vseledkin/neon
neon/backends/nervanacpu.py
7
47051
# ---------------------------------------------------------------------------- # Copyright 2014 Nervana Systems 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.o...
apache-2.0
waytai/django
tests/template_tests/filter_tests/test_date.py
207
2534
from datetime import datetime, time from django.template.defaultfilters import date from django.test import SimpleTestCase from django.utils import timezone from ..utils import setup from .timezone_utils import TimezoneTestCase class DateTests(TimezoneTestCase): @setup({'date01': '{{ d|date:"m" }}'}) def t...
bsd-3-clause
qiqi/fds
apps/Reynolds/from_hdf5_to_ReynoldsInputFiles.py
1
1750
import numpy from numpy import * from mpi4py import MPI import h5py import os import sys import argparse import shutil HDF5file_path = sys.argv[1] work_path = sys.argv[2] REF_WORK_PATH = sys.argv[3] comm = MPI.COMM_WORLD rank = comm.Get_rank() size = comm.Get_size() root = 0 if os.path.exists(HDF5file_path): # ...
gpl-3.0
datacommonsorg/data
scripts/oecd/regional_demography/utils_test.py
1
1248
# Copyright 2020 Google LLC # # 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
apache-2.0
Argon-Zhou/django
tests/m2m_multiple/tests.py
228
2386
from __future__ import unicode_literals from datetime import datetime from django.test import TestCase from .models import Article, Category class M2MMultipleTests(TestCase): def test_multiple(self): c1, c2, c3, c4 = [ Category.objects.create(name=name) for name in ["Sports", "N...
bsd-3-clause
srajag/nova
nova/virt/hyperv/utilsfactory.py
13
3118
# 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
amallia/zulip
zerver/test_unread.py
120
6343
# -*- coding: utf-8 -*- from __future__ import absolute_import from zerver.models import ( get_user_profile_by_email, Recipient, UserMessage, ) from zerver.lib.test_helpers import AuthedTestCase import ujson class PointerTest(AuthedTestCase): def test_update_pointer(self): """ Posting a poin...
apache-2.0
Sorsly/subtle
google-cloud-sdk/lib/surface/test/android/versions/__init__.py
4
1368
# Copyright 2015 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ag...
mit
Teagan42/home-assistant
homeassistant/components/tradfri/sensor.py
4
1599
"""Support for IKEA Tradfri sensors.""" from homeassistant.const import DEVICE_CLASS_BATTERY from .base_class import TradfriBaseDevice from .const import CONF_GATEWAY_ID, KEY_API, KEY_GATEWAY async def async_setup_entry(hass, config_entry, async_add_entities): """Set up a Tradfri config entry.""" gateway_id...
apache-2.0
TathagataChakraborti/resource-conflicts
PLANROB-2015/seq-sat-lama/py2.5/lib/python2.5/test/test_sax.py
6
22569
# regression test for SAX 2.0 -*- coding: iso-8859-1 -*- # $Id: test_sax.py 54954 2007-04-25 06:42:41Z neal.norwitz $ from xml.sax import make_parser, ContentHandler, \ SAXException, SAXReaderNotAvailable, SAXParseException try: make_parser() except SAXReaderNotAvailable: # don't...
mit
t-hey/QGIS-Original
scripts/process_function_template.py
12
4210
import sys import os import json import glob sys.path.append( os.path.join( os.path.dirname(os.path.realpath(__file__)), '../python/ext-libs')) from six import string_types cpp = open(sys.argv[1], "w") cpp.write( "#include \"qgsexpression.h\"\n" "\n" "QHash<QString, QgsExpression::Hel...
gpl-2.0
itskewpie/tempest
tempest/api/object_storage/test_container_services.py
3
5029
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2012 OpenStack Foundation # 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.apach...
apache-2.0
jmichalicek/djukebox
djukebox/migrations/0013_auto__chg_field_album_artist.py
1
7027
# -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Changing field 'Album.artist' db.alter_column('djukebox_album', 'artist_id', self.gf('django.db.models.fi...
bsd-2-clause
richardnpaul/FWL-Website
lib/python2.7/site-packages/django/conf/locale/nn/formats.py
108
1629
# -*- encoding: utf-8 -*- # This file is distributed under the same license as the Django package. # from __future__ import unicode_literals # The *_FORMAT strings use the Django date format syntax, # see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date DATE_FORMAT = 'j. F Y' TIME_FORMAT = 'H:i' DATET...
gpl-3.0
aspectron/jsx
build/tools/gyp/test/actions/gyptest-all.py
243
3677
#!/usr/bin/env python # Copyright (c) 2012 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """ Verifies simple actions when using an explicit build target of 'all'. """ import glob import os import TestGyp test = TestGyp.TestGyp(...
mit
soltanmm-google/grpc
src/python/grpcio_tests/tests/protoc_plugin/_python_plugin_test.py
2
20729
# 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
DataDog/integrations-core
vsphere/setup.py
1
1825
# (C) Datadog, Inc. 2018-present # All rights reserved # Licensed under a 3-clause BSD style license (see LICENSE) from codecs import open from os import path from setuptools import setup HERE = path.abspath(path.dirname(__file__)) # Get version info ABOUT = {} with open(path.join(HERE, "datadog_checks", "vsphere", ...
bsd-3-clause
blarghmatey/pip
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
jbedorf/tensorflow
tensorflow/python/layers/normalization_test.py
9
58321
# 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
GunoH/intellij-community
python/helpers/py3only/docutils/readers/pep.py
44
1536
# $Id: pep.py 7320 2012-01-19 22:33:02Z milde $ # Author: David Goodger <goodger@python.org> # Copyright: This module has been placed in the public domain. """ Python Enhancement Proposal (PEP) Reader. """ __docformat__ = 'reStructuredText' from docutils.parsers import rst from docutils.readers import standalone fro...
apache-2.0
jpotterm/django-fluent-contents
fluent_contents/analyzer.py
2
1535
""" Analyze the templates for placeholders of this module. """ from template_analyzer.djangoanalyzer import get_node_instances from fluent_contents.models import PlaceholderData from fluent_contents.templatetags.fluent_contents_tags import PagePlaceholderNode __all__ = ('get_template_placeholder_data',) def get_temp...
apache-2.0
Lyrositor/moul-scripts
Python/system/encodings/uu_codec.py
383
3738
""" Python 'uu_codec' Codec - UU content transfer encoding Unlike most of the other codecs which target Unicode, this codec will return Python string objects for both encode and decode. Written by Marc-Andre Lemburg (mal@lemburg.com). Some details were adapted from uu.py which was written by Lance Ell...
gpl-3.0
gpitel/pyjs
examples/gcharttestapp/GChartExample21.py
6
3818
from pyjamas.ui.Button import Button from pyjamas.ui.HTML import HTML from pyjamas.ui.HorizontalPanel import HorizontalPanel from pyjamas.chart.GChart import GChart from pyjamas.chart import AnnotationLocation from pyjamas.chart import SymbolType """* * * In this example, whenever the user clicks on a point, a * ho...
apache-2.0
jsirois/pants
src/python/pants/backend/project_info/list_roots_test.py
1
1726
# Copyright 2019 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from typing import List, Optional import pytest from pants.backend.project_info import list_roots from pants.backend.project_info.list_roots import Roots from pants.testutil.rule_runner ...
apache-2.0
Dark5ide/mycroft-core
mycroft/util/lang/common_data_pt.py
1
2228
# Undefined articles ["um", "uma", "uns", "umas"] can not be supressed, # in PT, "um cavalo" means "a horse" or "one horse". _PT_ARTICLES = ["o", "a", "os", "as"] _PT_NUMBERS = { "zero": 0, "um": 1, "uma": 1, "uns": 1, "umas": 1, "primeiro": 1, "segundo": 2, "terceiro": 3, "dois": ...
apache-2.0
takat0m0/test_code
tf_rnn/model.py
1
1643
# -*- coding:utf-8 -*- import os import sys import numpy as np import tensorflow as tf from linear_layer import FeatureExtractor, LinearLayers from rnn_layer import RNNLayers class Model(object): def __init__(self, max_time_length, data_dim): self.max_time_length = max_time_length self.data_dim ...
mit
akosyakov/intellij-community
python/helpers/pydev/tests/test_check_pydevconsole.py
41
4796
import threading import unittest import pydevconsole from pydev_imports import xmlrpclib, SimpleXMLRPCServer import sys from pydev_localhost import get_localhost from pydev_ipython_console_011 import get_pydev_frontend try: raw_input raw_input_name = 'raw_input' except NameError: raw_input_name = 'input' ...
apache-2.0
Bismarrck/tensorflow
tensorflow/python/kernel_tests/distributions/dirichlet_test.py
30
11370
# 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
dmckinney5/SlackOff
slackoff/lib/python2.7/site-packages/requests/packages/urllib3/exceptions.py
223
6603
from __future__ import absolute_import from .packages.six.moves.http_client import ( IncompleteRead as httplib_IncompleteRead ) # Base Exceptions class HTTPError(Exception): "Base exception used by this module." pass class HTTPWarning(Warning): "Base warning used by this module." pass class Po...
mit
Work4Labs/lettuce
tests/integration/lib/Django-1.2.5/django/contrib/gis/geos/prototypes/predicates.py
623
1777
""" This module houses the GEOS ctypes prototype functions for the unary and binary predicate operations on geometries. """ from ctypes import c_char, c_char_p, c_double from django.contrib.gis.geos.libgeos import GEOM_PTR from django.contrib.gis.geos.prototypes.errcheck import check_predicate from django.contrib.gis...
gpl-3.0
ruschelp/cortex-vfx
python/IECoreMaya/FnSceneShape.py
5
15323
########################################################################## # # Copyright (c) 2013, Image Engine Design 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: # # * Redistribu...
bsd-3-clause
blaggacao/OpenUpgrade
addons/stock_landed_costs/__openerp__.py
220
1914
# -*- 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
diwer/sublimeconfig
Packages/Package Control/package_control/versions.py
9
2399
import re from .semver import SemVer from .console_write import console_write def semver_compat(v): if isinstance(v, SemVer): return str(v) # Allowing passing in a dict containing info about a package if isinstance(v, dict): if 'version' not in v: return '0' v = v['ve...
mit
lseyesl/phantomjs
src/qt/qtwebkit/Tools/Scripts/webkitpy/port/qt.py
113
7883
# Copyright (C) 2010 Google Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the ...
bsd-3-clause
waseem18/oh-mainline
vendor/packages/gdata/src/gdata/data.py
127
39947
#!/usr/bin/env python # # Copyright (C) 2009 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable ...
agpl-3.0
darktears/chromium-crosswalk
third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/port/browser_test_driver_unittest.py
48
2395
# Copyright (C) 2014 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
ABaldwinHunter/django-clone
tests/aggregation/tests.py
17
45691
from __future__ import unicode_literals import datetime import re from decimal import Decimal from django.core.exceptions import FieldError from django.db import connection from django.db.models import ( F, Avg, Count, DecimalField, DurationField, FloatField, Func, IntegerField, Max, Min, Sum, Value, ) from d...
bsd-3-clause
lkhomenk/integration_tests
cfme/tests/cloud/test_providers.py
2
24565
# -*- coding: utf-8 -*- # pylint: disable=E1101 # pylint: disable=W0621 import uuid import fauxfactory import pytest from widgetastic.exceptions import MoveTargetOutOfBoundsException from cfme import test_requirements from cfme.base.credential import Credential from cfme.cloud.instance import Instance from cfme.cloud...
gpl-2.0
jsha/letsencrypt
certbot/tests/util.py
1
12620
"""Test utilities. .. warning:: This module is not part of the public API. """ import multiprocessing import os import pkg_resources import shutil import tempfile import unittest from cryptography.hazmat.backends import default_backend from cryptography.hazmat.primitives import serialization import mock import OpenS...
apache-2.0
jbloom/mutpath
src/trajectory.py
1
39654
"""Module for representing mutational trajectories as directed graphs. Represents mutational trajectories through sequence space, which is the space in which each node is a unique sequence and edges are directional connections between nodes corresponding to mutations. These digraphs can be used to visualize mutationa...
gpl-3.0
scrollback/kuma
vendor/packages/importlib/importlib/__init__.py
456
1327
"""Backport of importlib.import_module from 3.x.""" # While not critical (and in no way guaranteed!), it would be nice to keep this # code compatible with Python 2.3. import sys def _resolve_name(name, package, level): """Return the absolute name of the module to be imported.""" if not hasattr(package, 'rindex...
mpl-2.0
Katya007/Python-Tutorials
Introduction-to-Computation-and-Programming-Using-Python-Guttag-2016-Finger-Exercises/fingerExercises.py
1
7601
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ @author: Dr Ekaterina Abramova, 2017 Worked through solutions to finger exercises, Guttag 2nd edition, 2016. """ # ----------------------------- exercise p 18 --------------------------------- """ Write a program that examines three variables x, y, z and prints larg...
mit
ghtmtt/QGIS
python/plugins/db_manager/db_plugins/vlayers/plugin.py
29
6103
# -*- coding: utf-8 -*- """ /*************************************************************************** Name : DB Manager plugin for virtual layers Date : December 2015 copyright : (C) 2015 by Hugo Mercier email : hugo dot mercier at oslandia dot com *******...
gpl-2.0
nrhine1/scikit-learn
sklearn/datasets/tests/test_rcv1.py
322
2414
"""Test the rcv1 loader. Skipped if rcv1 is not already downloaded to data_home. """ import errno import scipy.sparse as sp import numpy as np from sklearn.datasets import fetch_rcv1 from sklearn.utils.testing import assert_almost_equal from sklearn.utils.testing import assert_array_equal from sklearn.utils.testing i...
bsd-3-clause
meowler/sandbox
node_modules/node-gyp/gyp/pylib/gyp/generator/eclipse.py
1825
17014
# Copyright (c) 2012 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """GYP backend that generates Eclipse CDT settings files. This backend DOES NOT generate Eclipse CDT projects. Instead, it generates XML files that can be importe...
mit
msmathers/SpasmDB
spasm/crawlers/lastfm.py
1
1103
SLEEP = 21600 # 6 hours import spasm.data.sources as _data import spasm.web.sources as _web import time Data = _data.LastFM() Web = _web.LastFM() def run(artist): # Update name, thumbnail, metadata _artist = Web.get_artist(artist) for field in _artist: if field in artist: artist[fiel...
mit
lexus24/w16b_test
static/Brython3.1.1-20150328-091302/Lib/_sre.py
622
51369
# NOT_RPYTHON """ A pure Python reimplementation of the _sre module from CPython 2.4 Copyright 2005 Nik Haldimann, licensed under the MIT license This code is based on material licensed under CNRI's Python 1.6 license and copyrighted by: Copyright (c) 1997-2001 by Secret Labs AB """ MAXREPEAT = 2147483648 #import ar...
agpl-3.0
wastholm/bitcoin
share/qt/extract_strings_qt.py
321
1873
#!/usr/bin/python ''' Extract _("...") strings for translation and convert to Qt4 stringdefs so that they can be picked up by Qt linguist. ''' from subprocess import Popen, PIPE import glob import operator import os import sys OUT_CPP="qt/bitcoinstrings.cpp" EMPTY=['""'] def parse_po(text): """ Parse 'po' for...
mit
Big-B702/python-for-android
python-build/python-libs/gdata/src/gdata/webmastertools/__init__.py
138
17837
#!/usr/bin/python # # Copyright (C) 2008 Yu-Jie Lin # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law o...
apache-2.0
praveen-pal/edx-platform
common/lib/xmodule/xmodule/video_module.py
1
15580
# pylint: disable=W0223 """Video is ungraded Xmodule for support video content. It's new improved video module, which support additional feature: - Can play non-YouTube video sources via in-browser HTML5 video player. - YouTube defaults to HTML5 mode from the start. - Speed changes in both YouTube and non-YouTube vide...
agpl-3.0
dl1ksv/gnuradio
gr-digital/examples/narrowband/benchmark_add_channel.py
6
3590
#!/usr/bin/env python # # Copyright 2010,2011 Free Software Foundation, Inc. # # This file is part of GNU Radio # # SPDX-License-Identifier: GPL-3.0-or-later # # from gnuradio import channels, gr from gnuradio import blocks from gnuradio import eng_notation from gnuradio.eng_option import eng_option from optparse imp...
gpl-3.0
johnkeepmoving/oss-ftp
python27/win32/Lib/test/test_difflib.py
40
10635
import difflib from test.test_support import run_unittest, findfile import unittest import doctest import sys class TestWithAscii(unittest.TestCase): def test_one_insert(self): sm = difflib.SequenceMatcher(None, 'b' * 100, 'a' + 'b' * 100) self.assertAlmostEqual(sm.ratio(), 0.995, places=3) ...
mit
Mazecreator/tensorflow
tensorflow/contrib/tensor_forest/python/ops/tensor_forest_ops.py
166
1220
# 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
google/google-ctf
third_party/edk2/BaseTools/Source/Python/UPT/Logger/StringTable.py
1
46519
## @file # This file is used to define strings used in the UPT tool # # Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved.<BR> # # This program and the accompanying materials are licensed and made available # under the terms and conditions of the BSD License which accompanies this # distribution....
apache-2.0
kitanata/resume
env/lib/python2.7/site-packages/xhtml2pdf/xhtml2pdf_reportlab.py
44
32291
# -*- coding: utf-8 -*- # Copyright 2010 Dirk Holtwick, holtwick.it # # 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 ...
mit
sigterm9/sigcoin
share/qt/make_spinner.py
4415
1035
#!/usr/bin/env python # W.J. van der Laan, 2011 # Make spinning .mng animation from a .png # Requires imagemagick 6.7+ from __future__ import division from os import path from PIL import Image from subprocess import Popen SRC='img/reload_scaled.png' DST='../../src/qt/res/movies/update_spinner.mng' TMPDIR='/tmp' TMPNAM...
mit
evenmarbles/mlpy
tests/test_mdp.py
1
1816
#!/usr/bin/env python # -*- coding: utf-8 -*- """ test_mdp ---------------------------------- Tests for `mlpy.mdp` module. """ import pytest class TestMDPModel(object): def setup_method(self, _): from mlpy.mdp.stateaction import Action Action.description = None Action.nfeatures = None ...
mit
kindohm/The_Force
pythonBridge/websocketUDPBridge.py
2
2948
import time, sys, os, pkg_resources import SocketServer from twisted.python import log from twisted.internet import reactor from twisted.application import service from twisted.internet.protocol import DatagramProtocol, Protocol, Factory from twisted.web.server import Site from twisted.web.static import File from a...
mit
raildo/keystone
keystone/contrib/access/core.py
6
2112
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2013 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 # # Unle...
apache-2.0
pmediano/ComputationalNeurodynamics
Fall2015/Exercise_3/NetworkWattsStrogatz.py
4
1095
""" Computational Neurodynamics Exercise 3 (C) Murray Shanahan et al, 2015 """ import numpy as np import numpy.random as rn from NetworkRingLattice import NetworkRingLattice def NetworkWattsStrogatz(N, k, p): """ Creates a ring lattice with N nodes and neighbourhood size k, then rewires it according to the Wa...
gpl-3.0
jhayworth/config
.emacs.d/elpy/rpc-venv/local/lib/python2.7/site-packages/jedi/inference/context.py
2
16966
from abc import abstractmethod from contextlib import contextmanager from parso.tree import search_ancestor from parso.python.tree import Name from jedi.inference.filters import ParserTreeFilter, MergedFilter, \ GlobalNameFilter from jedi.inference.names import AnonymousParamName, TreeNameDefinition from jedi.inf...
gpl-3.0
soldag/home-assistant
tests/components/climate/test_device_action.py
15
6595
"""The tests for Climate device actions.""" import pytest import voluptuous_serialize import homeassistant.components.automation as automation from homeassistant.components.climate import DOMAIN, const, device_action from homeassistant.helpers import config_validation as cv, device_registry from homeassistant.setup im...
apache-2.0