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
wscullin/spack
var/spack/repos/builtin/packages/xlsclients/package.py
3
1794
############################################################################## # Copyright (c) 2013-2017, Lawrence Livermore National Security, LLC. # Produced at the Lawrence Livermore National Laboratory. # # This file is part of Spack. # Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved. # LLNL-CODE-64...
lgpl-2.1
Arkapravo/morse-0.6
testing/base/orientation_testing.py
1
4444
#! /usr/bin/env python """ This script tests the 'data stream' oriented feature of the socket interface. """ from morse.testing.testing import MorseTestCase try: # Include this import to be able to use your test file as a regular # builder script, ie, usable with: 'morse [run|exec] <your test>.py from mo...
bsd-3-clause
clovett/MissionPlanner
Lib/tokenize.py
53
16889
"""Tokenization help for Python programs. generate_tokens(readline) is a generator that breaks a stream of text into Python tokens. It accepts a readline-like method which is called repeatedly to get the next line of input (or "" for EOF). It generates 5-tuples with these members: the token type (see tok...
gpl-3.0
ice9js/servo
tests/wpt/web-platform-tests/tools/py/testing/process/test_cmdexec.py
163
1127
import py from py.process import cmdexec def exvalue(): return py.std.sys.exc_info()[1] class Test_exec_cmd: def test_simple(self): out = cmdexec('echo hallo') assert out.strip() == 'hallo' assert py.builtin._istext(out) def test_simple_newline(self): import sys ou...
mpl-2.0
rpmcpp/Audacity
lib-src/lv2/serd/waflib/ConfigSet.py
61
3736
#! /usr/bin/env python # encoding: utf-8 # WARNING! Do not edit! http://waf.googlecode.com/git/docs/wafbook/single.html#_obtaining_the_waf_file import copy,re,os from waflib import Logs,Utils re_imp=re.compile('^(#)*?([^#=]*?)\ =\ (.*?)$',re.M) class ConfigSet(object): __slots__=('table','parent') def __init__(self,...
gpl-2.0
xubenben/scikit-learn
examples/ensemble/plot_feature_transformation.py
21
4095
""" =============================================== Feature transformations with ensembles of trees =============================================== Transform your features into a higher dimensional, sparse space. Then train a linear model on these features. First fit an ensemble of trees (totally random trees, a rand...
bsd-3-clause
ghchinoy/tensorflow
tensorflow/python/distribute/input_ops_test.py
3
12254
# Copyright 2018 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
WarrenWeckesser/scipy
scipy/_lib/tests/test__pep440.py
21
2277
from pytest import raises as assert_raises from scipy._lib._pep440 import Version, parse def test_main_versions(): assert Version('1.8.0') == Version('1.8.0') for ver in ['1.9.0', '2.0.0', '1.8.1']: assert Version('1.8.0') < Version(ver) for ver in ['1.7.0', '1.7.1', '0.9.9']: assert Vers...
bsd-3-clause
drelu/SAGA-Hadoop
hadoop1/bootstrap_hadoop.py
1
8798
#!/usr/bin/env python """ Hadoop Bootstrap Script (based on hadoop 0.20.203 release) """ import os, sys import pdb import urllib import subprocess import logging import uuid import shutil import time import signal from optparse import OptionParser logging.basicConfig(level=logging.DEBUG) # For automatic Download and ...
apache-2.0
Dino0631/RedRain-Bot
lib/youtube_dl/extractor/livestream.py
29
13725
from __future__ import unicode_literals import re import itertools from .common import InfoExtractor from ..compat import ( compat_str, compat_urlparse, ) from ..utils import ( find_xpath_attr, xpath_attr, xpath_with_ns, xpath_text, orderedSet, update_url_query, int_or_none, fl...
gpl-3.0
crcresearch/osf.io
addons/mendeley/migrations/0001_initial.py
56
1509
# -*- coding: utf-8 -*- # Generated by Django 1.9 on 2017-03-23 20:34 from __future__ import unicode_literals from django.db import migrations, models import osf.models.base import osf.utils.datetime_aware_jsonfield class Migration(migrations.Migration): initial = True dependencies = [ ] operation...
apache-2.0
anurag313/scikit-learn
sklearn/manifold/mds.py
257
15138
""" Multi-dimensional Scaling (MDS) """ # author: Nelle Varoquaux <nelle.varoquaux@gmail.com> # Licence: BSD import numpy as np import warnings from ..base import BaseEstimator from ..metrics import euclidean_distances from ..utils import check_random_state, check_array, check_symmetric from ..externals.joblib impo...
bsd-3-clause
h2oai/h2o
py/testdir_single_jvm/test_GLM2_tnc3_10.py
9
3305
import unittest, time, sys sys.path.extend(['.','..','../..','py']) import h2o, h2o_cmd, h2o_glm, h2o_import as h2i import h2o_exec as h2e print "colswap doesn't seem like it can update a col with NAs correctly." print "smalldata/tnc3.csv was modified all missing entries replaced with <dquote>-1<dquote>." print "then...
apache-2.0
irwinlove/django
django/contrib/contenttypes/admin.py
273
5345
from __future__ import unicode_literals from functools import partial from django.contrib.admin.checks import InlineModelAdminChecks from django.contrib.admin.options import InlineModelAdmin, flatten_fieldsets from django.contrib.contenttypes.fields import GenericForeignKey from django.contrib.contenttypes.forms impo...
bsd-3-clause
mrquim/repository.mrquim
repo/plugin.video.mrpiracy/resources/lib/js2py/constructors/jsuint8clampedarray.py
20
2801
# this is based on jsarray.py from ..base import * try: import numpy except: pass @Js def Uint8ClampedArray(): TypedArray = (PyJsInt8Array,PyJsUint8Array,PyJsUint8ClampedArray,PyJsInt16Array,PyJsUint16Array,PyJsInt32Array,PyJsUint32Array,PyJsFloat32Array,PyJsFloat64Array) a = arguments[0] if isin...
gpl-2.0
Rav3nPL/bitcoin
test/functional/invalidtxrequest.py
19
2639
#!/usr/bin/env python3 # Copyright (c) 2015-2016 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Test node responses to invalid transactions. In this test we connect to one node over p2p, and test tx...
mit
synergeticsedx/deployment-wipro
lms/djangoapps/shoppingcart/processors/helpers.py
23
1057
""" Helper methods for credit card processing modules. These methods should be shared among all processor implementations, but should NOT be imported by modules outside this package. """ from django.conf import settings from openedx.core.djangoapps.site_configuration import helpers as configuration_helpers def get_pr...
agpl-3.0
haudren/scipy
scipy/sparse/extract.py
46
4711
"""Functions to extract parts of sparse matrices """ from __future__ import division, print_function, absolute_import __docformat__ = "restructuredtext en" __all__ = ['find', 'tril', 'triu'] from .coo import coo_matrix def find(A): """Return the indices and values of the nonzero elements of a matrix Par...
bsd-3-clause
swapnil96/paper-hunt
Process/process.py
1
2818
#! /usr/bin/env import string import pdf_to_text import re import os import sys import section import nltk from nltk.tokenize import SExprTokenizer from nltk.tokenize import sent_tokenize import ref_sent reload(sys) sys.setdefaultencoding('utf8') pri_matches = {"RELATED WORK": 10, "RELATED": 7, "SIMILAR": 9, "SIMILA...
gpl-3.0
JTCunning/sentry
src/sentry/nodestore/cassandra/backend.py
9
1171
""" sentry.nodestore.cassandra.backend ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ :copyright: (c) 2010-2014 by the Sentry Team, see AUTHORS for more details. :license: BSD, see LICENSE for more details. """ from __future__ import absolute_import, print_function import casscache from sentry.nodestore.base import NodeStorage...
bsd-3-clause
federicobaldo/stacker
stacker/hooks/ecs.py
2
1284
# A lot of this code exists to deal w/ the broken ECS connect_to_region # function, and will be removed once this pull request is accepted: # https://github.com/boto/boto/pull/3143 import logging logger = logging.getLogger(__name__) from boto.regioninfo import get_regions from boto.ec2containerservice.layer1 import...
bsd-2-clause
odootr/odoo
addons/lunch/wizard/lunch_cancel.py
440
1274
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2012 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the G...
agpl-3.0
chadversary/chromiumos.chromite
scripts/upload_package_status_unittest.py
2
15865
#!/usr/bin/python # Copyright (c) 2011 The Chromium OS Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Unit tests for cros_portage_upgrade.py.""" import exceptions import mox from chromite.lib import cros_test_lib from chromite....
bsd-3-clause
KevinGoodsell/sympy
sympy/mpmath/quadrature.py
4
35806
from mptypes import (mp, mpf, mpmathify, inf, eps, nstr, make_mpf, AS_POINTS, fdot) from functions import pi, exp, log, ldexp from libmpf import mpf_neg import math def NEG(x): return make_mpf(mpf_neg(x._mpf_)) class Quadrature(object): """ Quadrature rules are implemented using this class, in order...
bsd-3-clause
HiroIshikawa/21playground
thumblelog/myproject/lib/python3.5/site-packages/setuptools/command/egg_info.py
301
16852
"""setuptools.command.egg_info Create a distribution's .egg-info directory and contents""" from distutils.filelist import FileList as _FileList from distutils.util import convert_path from distutils import log import distutils.errors import distutils.filelist import os import re import sys try: from setuptools_s...
mit
zarnovican/ansible
lib/ansible/plugins/cache/jsonfile.py
31
5314
# (c) 2014, Brian Coca, Josh Drake, et al # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. ...
gpl-3.0
shiroyuki/Tori
tori/application.py
1
16643
# -*- coding: utf-8 -*- """ :Author: Juti Noppornpitak ..note:: The documentation of this module yet conforms with the standard documenting style used by the official Python documenters. """ # Standard libraries import json import os import sys # Third-party libraries from imagination.entity import Entity ...
mit
BFriedland/UserDataBase-Heroku
venv/Lib/encodings/koi8_r.py
272
13779
""" Python Character Mapping Codec koi8_r generated from 'MAPPINGS/VENDORS/MISC/KOI8-R.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
jirenz/CS229_Project
hearthbreaker/constants.py
9
2079
class CARD_RARITY: FREE = 1 COMMON = 2 RARE = 3 EPIC = 4 LEGENDARY = 5 __rarities = { "FREE": FREE, "COMMON": COMMON, "RARE": RARE, "EPIC": EPIC, "LEGENDARY": LEGENDARY, } @staticmethod def from_str(rarity_name): return CARD_RARITY.__...
mit
rogerthat-platform/gae-plugin-framework
src/framework/server/main_admin.py
1
1218
# -*- coding: utf-8 -*- # Copyright 2017 GIG Technology NV # # 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...
apache-2.0
jjingrong/PONUS-1.2
modules/views.py
1
9191
from django.shortcuts import render from django.shortcuts import render_to_response from modules.models import * from django.template import RequestContext from django import forms from django.contrib.auth.models import User from django.db.models.query import EmptyQuerySet from django.http import HttpResponse from modu...
mit
rileychapman/roscopter-1
mavlink/pymavlink/build/scripts-2.7/mavsigloss.py
2
1995
#!/usr/bin/python ''' show times when signal is lost ''' import sys, time, os from optparse import OptionParser parser = OptionParser("sigloss.py [options]") parser.add_option("--no-timestamps",dest="notimestamps", action='store_true', help="Log doesn't have timestamps") parser.add_option("--planner",dest="planner",...
bsd-3-clause
denniszollo/MAVProxy
MAVProxy/modules/mavproxy_terrain.py
14
5651
""" MAVProxy terrain handling module """ import time from MAVProxy.modules.mavproxy_map import mp_elevation from MAVProxy.modules.lib import mp_util from MAVProxy.modules.lib import mp_module from MAVProxy.modules.lib import mp_settings class TerrainModule(mp_module.MPModule): def __init__(self, mpstate): ...
gpl-3.0
sorenh/cc
vendor/Twisted-10.0.0/twisted/web/static.py
3
36476
# -*- test-case-name: twisted.web.test.test_static -*- # Copyright (c) 2001-2010 Twisted Matrix Laboratories. # See LICENSE for details. """ Static resources for L{twisted.web}. """ import os import warnings import urllib import itertools import cgi import time from zope.interface import implements from twisted.web...
apache-2.0
mattcaldwell/django-cms
cms/tests/rendering.py
6
17102
# -*- coding: utf-8 -*- from __future__ import with_statement from cms import plugin_rendering from cms.api import create_page, add_plugin from cms.models.placeholdermodel import Placeholder from cms.models.pluginmodel import CMSPlugin from cms.plugin_rendering import (render_plugins, PluginContext, render_placeho...
bsd-3-clause
Celthi/youtube-dl-GUI
youtube_dl/extractor/theonion.py
27
2340
# coding: utf-8 from __future__ import unicode_literals import re from .common import InfoExtractor from ..utils import ExtractorError class TheOnionIE(InfoExtractor): _VALID_URL = r'(?x)https?://(?:www\.)?theonion\.com/video/[^,]+,(?P<article_id>[0-9]+)/?' _TEST = { 'url': 'http://www.theonion.com/...
mit
as110/as110.github.io
node_modules/grunt-docker/node_modules/docker/node_modules/pygmentize-bundled/vendor/pygments/build-3.3/pygments/lexers/hdl.py
363
16209
# -*- coding: utf-8 -*- """ pygments.lexers.hdl ~~~~~~~~~~~~~~~~~~~ Lexers for hardware descriptor languages. :copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ import re from pygments.lexer import RegexLexer, bygroups, include, using, t...
mit
anythingrandom/eclcli
eclcli/identity/v3/ec2creds.py
2
6600
# 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
kingvuplus/nn-gui
lib/python/Plugins/Extensions/MediaPlayer/settings.py
28
5037
from Screens.Screen import Screen from Screens.HelpMenu import HelpableScreen from Components.FileList import FileList from Components.Sources.StaticText import StaticText from Components.MediaPlayer import PlayList from Components.config import config, getConfigListEntry, ConfigSubsection, configfile, ConfigText, Conf...
gpl-2.0
highco-groupe/odoo
addons/account/wizard/account_move_line_unreconcile_select.py
385
1864
# -*- 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
raphaelmerx/flower
tests/views/test_auth.py
13
1080
import base64 from tests import AsyncHTTPTestCase class AuthTests(AsyncHTTPTestCase): def test_auth_without_credentials(self): ba = self._app.options.basic_auth self._app.options.basic_auth = ["hello:world"] r = self.get('/') self._app.options.basic_auth = ba self.assertEqu...
bsd-3-clause
nabilbendafi/script.module.pydevd
lib/pydevd_frame.py
6
27159
import linecache import os.path import re import traceback # @Reimport import pydev_log from pydevd_breakpoints import get_exception_breakpoint, get_exception_name from pydevd_comm import CMD_STEP_CAUGHT_EXCEPTION, CMD_STEP_RETURN, CMD_STEP_OVER, CMD_SET_BREAK, \ CMD_STEP_INTO, CMD_SMART_STEP_INTO, CMD_RUN_TO_LIN...
epl-1.0
michaelaye/vispy
vispy/scene/__init__.py
20
1472
# -*- coding: utf-8 -*- # Copyright (c) 2015, Vispy Development Team. # Distributed under the (new) BSD License. See LICENSE.txt for more info. """ The vispy.scene subpackage provides high-level, flexible, and easy to use functionality for creating scenes composed of multiple visual objects. Overview -------- Sceneg...
bsd-3-clause
ianstalk/Flexget
flexget/plugins/input/apple_trailers.py
2
7158
import re import feedparser from loguru import logger from requests.auth import AuthBase from flexget import plugin from flexget.entry import Entry from flexget.event import event from flexget.utils.cached_input import cached from flexget.utils.requests import RequestException logger = logger.bind(name='apple_traile...
mit
danakj/chromium
third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/coverage/annotate.py
68
3029
"""Source file annotation for Coverage.""" import os, re from coverage.report import Reporter class AnnotateReporter(Reporter): """Generate annotated source files showing line coverage. This reporter creates annotated copies of the measured source files. Each .py file is copied as a .py,cover file, with...
bsd-3-clause
dayatz/taiga-back
taiga/events/backends/base.py
1
1923
# -*- coding: utf-8 -*- # Copyright (C) 2014-2017 Andrey Antukh <niwi@niwi.nz> # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # published by the Free Software Foundation, either version 3 of the # License, or (at your option) any l...
agpl-3.0
flericoin-project/flericoin
external/gtest/scripts/pump.py
2471
23673
#!/usr/bin/env python # # Copyright 2008, 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...
mit
hogarthww/tinydav-fork
test/TestUtil.py
1
12114
# Unittests for util module. # coding: utf-8 # Copyright (C) 2009 Manuel Hermann <manuel-hermann@gmx.net> # # This file is part of tinydav. # # tinydav is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as published by # the Free Software Foundation, e...
gpl-3.0
AnishShah/tensorflow
tensorflow/python/debug/lib/debug_graphs.py
65
15623
# 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
noironetworks/neutron
neutron/tests/functional/agent/l3/test_ha_router.py
1
20975
# Copyright (c) 2014 Red Hat, 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 require...
apache-2.0
vitorespindola/home-assistant
homeassistant/util/dt.py
12
3414
""" homeassistant.util.dt ~~~~~~~~~~~~~~~~~~~~~ Provides helper methods to handle the time in HA. """ import datetime as dt import pytz DATETIME_STR_FORMAT = "%H:%M:%S %d-%m-%Y" DATE_STR_FORMAT = "%Y-%m-%d" TIME_STR_FORMAT = "%H:%M" UTC = DEFAULT_TIME_ZONE = pytz.utc def set_default_time_zone(time_zone): """ ...
mit
PRabahy/bitcoin
qa/rpc-tests/disablewallet.py
27
1156
#!/usr/bin/env python2 # Copyright (c) 2014-2015 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # # Exercise API with -disablewallet. # from test_framework.test_framework import BitcoinTestFramework f...
mit
codrut3/tensorflow
tensorflow/python/ops/rnn_cell_impl.py
5
50321
# 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
kowall116/roadTrip
node_modules/gulp-sass/node_modules/node-sass/node_modules/node-gyp/gyp/pylib/gyp/generator/gypsh.py
2779
1665
# Copyright (c) 2011 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. """gypsh output module gypsh is a GYP shell. It's not really a generator per se. All it does is fire up an interactive Python session with a few local variables...
mit
jbedorf/tensorflow
tensorflow/tools/common/traverse.py
21
3773
# 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
kcompher/scipy2015-blaze-bokeh
app/viz2.py
12
4846
# -*- coding: utf-8 -*- import math from collections import OrderedDict import numpy as np import pandas as pd import netCDF4 from bokeh.plotting import figure, show, output_notebook from bokeh.models import DatetimeTickFormatter, ColumnDataSource, HoverTool, Plot, Range1d from bokeh.palettes import RdBu11 from bokeh...
mit
TathagataChakraborti/resource-conflicts
PLANROB-2015/seq-sat-lama/Python-2.5.2/Lib/asyncore.py
16
16744
# -*- Mode: Python -*- # Id: asyncore.py,v 2.51 2000/09/07 22:29:26 rushing Exp # Author: Sam Rushing <rushing@nightmare.com> # ====================================================================== # Copyright 1996 by Sam Rushing # # All Rights Reserved # # Permission to use, copy, modify,...
mit
Hellowlol/HTPC-Manager
libs/colorama/initialise.py
474
1597
# Copyright Jonathan Hartley 2013. BSD 3-Clause license, see LICENSE file. import atexit import sys from .ansitowin32 import AnsiToWin32 orig_stdout = sys.stdout orig_stderr = sys.stderr wrapped_stdout = sys.stdout wrapped_stderr = sys.stderr atexit_done = False def reset_all(): AnsiToWin32(orig_stdout).rese...
mit
Storj/storjcore
storjcore/audit.py
1
1509
import hashlib import partialhash # FIXME remove reward wif (will use micropayment channels instead) def generate_response(btctxstore, data, challenge): """ Generates the response for a requested audit. Arguments: btctxstore: BtcTxStore instance used generate the reward wif. data: File path...
mit
guschmue/tensorflow
tensorflow/contrib/receptive_field/python/util/receptive_field_test.py
16
10660
# 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
MyAOSP/external_chromium_org_third_party_skia
gm/rebaseline_server/column.py
21
2846
#!/usr/bin/python """ Copyright 2014 Google Inc. Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. ColumnHeaderFactory class (see class docstring for details) """ # Keys used within dictionary representation of each column header. # NOTE: Keep these in sync with stati...
bsd-3-clause
madan96/sympy
sympy/polys/tests/test_polyoptions.py
38
11959
"""Tests for options manager for :class:`Poly` and public API functions. """ from sympy.polys.polyoptions import ( Options, Expand, Gens, Wrt, Sort, Order, Field, Greedy, Domain, Split, Gaussian, Extension, Modulus, Symmetric, Strict, Auto, Frac, Formal, Polys, Include, All, Gen, Symbols, Method) from sym...
bsd-3-clause
joakim-hove/opm-common
python/tests/test_connection.py
9
2148
import unittest from opm.io.parser import Parser from opm.io.ecl_state import EclipseState from opm.io.schedule import Schedule try: from tests.utils import test_path except ImportError: from utils import test_path def flowing(connection): return connection.state == 'OPEN' def closed(connection): ret...
gpl-3.0
letouriste001/SmartForest_2.0
python3.4Smartforest/lib/python3.4/site-packages/pip/_vendor/html5lib/utils.py
436
3267
from __future__ import absolute_import, division, unicode_literals from types import ModuleType from pip._vendor.six import text_type try: import xml.etree.cElementTree as default_etree except ImportError: import xml.etree.ElementTree as default_etree __all__ = ["default_etree", "MethodDispatcher", "isSurr...
mit
magic2du/contact_matrix
Contact_maps/GetDDIsHaveOver2InterfacesHave50_150Examples_pseudo.py
1
1912
import _mysql from dealFile import * #Get of Domains which has more than 2 interfaces have 16-20 examples db=_mysql.connect(host="localhost",user="root",passwd="zxcv4321",db="DDI") #db.query("""select COUNT(*) from PPI inner join example on (ID = PPI_ID) where domain1="ACT" and domain2="ACT" and topology_1 = 6 and topo...
gpl-2.0
arbrandes/edx-platform
lms/djangoapps/instructor_analytics/tests/test_distributions.py
5
4841
""" Tests for analytics.distributions """ import pytest from django.test import TestCase from opaque_keys.edx.locator import CourseLocator from common.djangoapps.student.models import CourseEnrollment from common.djangoapps.student.tests.factories import UserFactory from lms.djangoapps.instructor_analytics.distribut...
agpl-3.0
georgeriz/myFlaskBackend
lib/flask/templating.py
783
4707
# -*- coding: utf-8 -*- """ flask.templating ~~~~~~~~~~~~~~~~ Implements the bridge to Jinja2. :copyright: (c) 2011 by Armin Ronacher. :license: BSD, see LICENSE for more details. """ import posixpath from jinja2 import BaseLoader, Environment as BaseEnvironment, \ TemplateNotFound from .glo...
apache-2.0
eight-pack-abdominals/androguard
androguard/gui/apkloading.py
8
1587
from androguard.core import androconf from PySide import QtCore from androguard.misc import * import os.path class ApkLoadingThread(QtCore.QThread): def __init__(self, parent=None): QtCore.QThread.__init__(self, parent) self.apk_path = None self.session_path = None def load(self, ap...
apache-2.0
hglkrijger/azure-linux-automation
remote-scripts/DoIOTest.py
8
5213
#!/usr/bin/python #V-SHISAV@MICROSOFT.COM from azuremodules import * import argparse import sys parser = argparse.ArgumentParser() parser.add_argument('-d', '--diskPaths', help='Please mention disk path in format /dev/sdX. e.g. -d "/dev/sdc" or you can give multiple disks. e.g. -d "/dev/sdc^/dev/sdd"', required=True, ...
apache-2.0
ykaneko/ryu
ryu/contrib/ncclient/operations/retrieve.py
64
3714
# Copyright 2009 Shikhar Bhushan # # 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 writin...
apache-2.0
apanju/odoo
addons/hw_posbox_homepage/controllers/main.py
99
2009
# -*- coding: utf-8 -*- import logging import os import time from os import listdir import openerp from openerp import http from openerp.http import request from openerp.tools.translate import _ _logger = logging.getLogger(__name__) index_template = """ <!DOCTYPE HTML> <html> <head> <title>Odoo's PosBox<...
agpl-3.0
alsrgv/tensorflow
tensorflow/python/kernel_tests/sparse_reshape_op_test.py
13
14277
# 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
SickRage/SickRage
sickrage/clients/__init__.py
2
12822
# Author: echel0n <echel0n@sickrage.ca> # URL: https://sickrage.ca # # This file is part of SickRage. # # SickRage 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...
gpl-3.0
alistairlow/tensorflow
tensorflow/contrib/fused_conv/python/ops/fused_conv2d_bias_activation_benchmark.py
40
9766
# 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
hujiajie/chromium-crosswalk
native_client_sdk/src/build_tools/verify_ppapi.py
11
6372
#!/usr/bin/env python # Copyright (c) 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. """Helper script for PPAPI's PRESUBMIT.py to detect if additions or removals of PPAPI interfaces have been propagated to the Native...
bsd-3-clause
rtrdd/ch
content/themes/cinemaholics/node_modules/node-gyp/gyp/pylib/gyp/msvs_emulation.py
1407
47697
# 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. """ This module helps emulate Visual Studio 2008 behavior on top of other build systems, primarily ninja. """ import os import re import subprocess import sys fr...
mit
florian-dacosta/OpenUpgrade
addons/warning/warning.py
26
11659
# -*- 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
boutproject/BOUT-2.0
tools/tokamak_grids/all/grid2bout.py
4
1567
""" @brief Convert an equilibrium set of flux surfaces into a BOUT++ grid """ try: from numpy import max except ImportError: print "ERROR: numpy module required" raise try: from boututils import DataFile except ImportError: print "ERROR: restart module needs boututils.DataFile" raise def gr...
gpl-3.0
fuhongliang/odoo
addons/crm_project_issue/project_issue.py
380
2373
from openerp.osv import osv, fields class crm_lead_to_project_issue_wizard(osv.TransientModel): """ wizard to convert a Lead into a Project Issue and move the Mail Thread """ _name = "crm.lead2projectissue.wizard" _inherit = 'crm.partner.binding' _columns = { "lead_id": fields.many2one("crm....
agpl-3.0
DEGoodmanWilson/bacon
cgi-bin/Config.py
1
1479
""" Copyright 2005, Donald E. Goodman, Jr. This file is part of Bacon. Bacon 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. Bacon is distr...
gpl-2.0
mozilla/relman-auto-nag
auto_nag/scripts/workflow/p1_no_activity.py
2
2611
# 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/. from auto_nag import utils from auto_nag.bzcleaner import BzCleaner from auto_nag.escalation import Escalation, NoActivi...
bsd-3-clause
OwaJawa/kaggle-galaxies
try_convnet_cc_multirotflip_3x69r45_8433n_maxout2048.py
7
17257
import numpy as np # import pandas as pd import theano import theano.tensor as T import layers import cc_layers import custom import load_data import realtime_augmentation as ra import time import csv import os import cPickle as pickle from datetime import datetime, timedelta # import matplotlib.pyplot as plt # plt.i...
bsd-3-clause
jamesgk/feaTools
Lib/feaTools/writers/printWriter.py
1
1625
""" Printing writer. Used for testing. """ from baseWriter import AbstractFeatureWriter class PrintFeatureWriter(AbstractFeatureWriter): def feature(self, name): print ("feature", name) return self def lookup(self, name): print ("lookup", name) return self def featureRe...
mit
Icenowy/MissionPlanner
Lib/site-packages/numpy/distutils/command/install_clib.py
96
1249
import os from distutils.core import Command from distutils.ccompiler import new_compiler from numpy.distutils.misc_util import get_cmd class install_clib(Command): description = "Command to install installable C libraries" user_options = [] def initialize_options(self): self.install_dir = None ...
gpl-3.0
Eyepea/aiohttp
tests/test_py35/test_multipart_35.py
6
2597
import io import json import aiohttp import aiohttp.hdrs as h class Stream(object): def __init__(self, content): self.content = io.BytesIO(content) async def read(self, size=None): return self.content.read(size) def at_eof(self): return self.content.tell() == len(self.content.g...
apache-2.0
jhnnsnk/nest-simulator
doc/userdoc/conf.py
4
9297
# -*- coding: utf-8 -*- # # conf.py # # This file is part of NEST. # # Copyright (C) 2004 The NEST Initiative # # NEST 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 ...
gpl-2.0
jcoady9/python-for-android
python3-alpha/python3-src/Lib/idlelib/PyParse.py
67
19414
import re import sys # Reason last stmt is continued (or C_NONE if it's not). (C_NONE, C_BACKSLASH, C_STRING_FIRST_LINE, C_STRING_NEXT_LINES, C_BRACKET) = range(5) if 0: # for throwaway debugging output def dump(*stuff): sys.__stdout__.write(" ".join(map(str, stuff)) + "\n") # Find what looks like the...
apache-2.0
gef756/scipy
scipy/optimize/_lsq/common.py
2
18582
"""Functions used by least-squares algorithms.""" from math import copysign import numpy as np from numpy.linalg import norm from scipy.linalg import cho_factor, cho_solve, LinAlgError from scipy.sparse import issparse from scipy.sparse.linalg import LinearOperator, aslinearoperator EPS = np.finfo(float).eps # Fu...
bsd-3-clause
jazkarta/edx-platform
lms/djangoapps/instructor/views/instructor_dashboard.py
8
27079
""" Instructor Dashboard Views """ import logging import datetime from opaque_keys import InvalidKeyError from opaque_keys.edx.keys import CourseKey import uuid import pytz from django.contrib.auth.decorators import login_required from django.views.decorators.http import require_POST from django.utils.translation imp...
agpl-3.0
DrMeers/django
tests/invalid_models_tests/test_models.py
4
13342
# -*- encoding: utf-8 -*- from __future__ import unicode_literals from django.core.checks import Error from django.db import models from django.test.utils import override_settings from .base import IsolatedModelsTestCase class IndexTogetherTests(IsolatedModelsTestCase): def test_non_iterable(self): cla...
bsd-3-clause
sourcefrog/cram
cram/_diff.py
2
5116
"""Utilities for diffing test files and their output""" import codecs import difflib import re from cram._encoding import b __all__ = ['esc', 'glob', 'regex', 'unified_diff'] def _regex(pattern, s): """Match a regular expression or return False if invalid. >>> from cram._encoding import b >>> [bool(_re...
gpl-2.0
makinacorpus/odoo
openerp/tools/convert.py
26
41184
# -*- 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 GNU...
agpl-3.0
strk/QGIS
tests/src/python/test_testrunner.py
45
1672
# -*- coding: utf-8 -*- """QGIS Unit tests for the docker python test runner .. note:: 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 ...
gpl-2.0
lordmuffin/aws-cfn-plex
functions/credstash/Crypto/PublicKey/__init__.py
124
1876
# -*- coding: utf-8 -*- # # =================================================================== # The contents of this file are dedicated to the public domain. To # the extent that dedication to the public domain is not available, # everyone is granted a worldwide, perpetual, royalty-free, # non-exclusive license to e...
mit
simongibbons/numpy
numpy/distutils/command/build_src.py
8
31180
""" Build swig and f2py sources. """ import os import re import sys import shlex import copy from distutils.command import build_ext from distutils.dep_util import newer_group, newer from distutils.util import get_platform from distutils.errors import DistutilsError, DistutilsSetupError # this import can't be done h...
bsd-3-clause
panmari/tensorflow
tensorflow/python/kernel_tests/sparse_tensor_dense_matmul_grad_test.py
13
2971
# Copyright 2016 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 a...
apache-2.0
nttcom/eclcli
eclcli/orchestration/heatclient/common/event_utils.py
1
7361
# Copyright 2015 Red Hat 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 agree...
apache-2.0
blackbliss/medity-expo-2014
remote-api/flask/lib/python2.7/site-packages/pip/commands/show.py
344
2767
import os from pip.basecommand import Command from pip.log import logger from pip._vendor import pkg_resources class ShowCommand(Command): """Show information about one or more installed packages.""" name = 'show' usage = """ %prog [options] <package> ...""" summary = 'Show information about in...
mit
nthiep/global-ssh-server
lib/python2.7/site-packages/django/contrib/auth/tests/views.py
12
24891
import os import re from django.conf import global_settings, settings from django.contrib.sites.models import Site, RequestSite from django.contrib.auth.models import User from django.core import mail from django.core.exceptions import SuspiciousOperation from django.core.urlresolvers import reverse, NoReverseMatch fr...
agpl-3.0
Storj/heartbeat
tests/tests_unit_merkle.py
1
7148
#!/usr/bin/env python # -*- coding: utf-8 -*- # This file is part of Heartbeat: https://github.com/Storj/heartbeat # # The MIT License (MIT) # # Copyright (c) 2014 Paul Durivage <pauldurivage+git@gmail.com> for Storj Labs # Copyright (c) 2014 Will James <jameswt@gmail.com> # # Permission is hereby granted, free of cha...
mit