repo_name
stringlengths
6
100
path
stringlengths
4
294
copies
stringlengths
1
5
size
stringlengths
4
6
content
stringlengths
606
896k
license
stringclasses
15 values
onitake/ansible
lib/ansible/modules/network/netscaler/netscaler_gslb_site.py
72
14171
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright (c) 2017 Citrix Systems # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', ...
gpl-3.0
teleological/camxes-py
transformers/raw.py
1
1215
# pylint: disable=I0011, C0111, too-few-public-methods, no-self-use from collections import OrderedDict from parsimonious.nodes import NodeVisitor KEY_ORDER = { "name" : 1, "type" : 2, "description" : 3, "text" : 4, "pos" : 5, "chi...
mit
kingmotley/SickRage
sickbeard/providers/__init__.py
1
3649
# coding=utf-8 # Author: Nic Wolfe <nic@wolfeden.ca> # # URL: https://sickrage.github.io # # 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 ...
gpl-3.0
kursitet/edx-platform
openedx/core/djangoapps/credit/email_utils.py
32
6890
""" This file contains utility functions which will responsible for sending emails. """ import os import logging import pynliner import urlparse import uuid import HTMLParser from django.conf import settings from django.contrib.auth.models import User from django.contrib.staticfiles import finders from django.core.c...
agpl-3.0
gnowxilef/youtube-dl
youtube_dl/extractor/nfb.py
74
4486
from __future__ import unicode_literals from .common import InfoExtractor from ..utils import ( clean_html, determine_ext, int_or_none, qualities, urlencode_postdata, xpath_text, ) class NFBIE(InfoExtractor): IE_NAME = 'nfb' IE_DESC = 'National Film Board of Canada' _VALID_URL = r...
unlicense
bkirui/odoo
addons/membership/report/report_membership.py
313
5267
# -*- 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
srluge/SickRage
lib/sqlalchemy/dialects/firebird/base.py
78
28412
# firebird/base.py # Copyright (C) 2005-2014 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:: firebird :name: Firebird Firebird Dialects ----------------- ...
gpl-3.0
tylertian/Openstack
openstack F/nova/nova/tests/api/openstack/volume/test_router.py
7
3825
# Copyright 2011 Denali Systems, 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 requ...
apache-2.0
tumbl3w33d/ansible
test/units/modules/net_tools/nios/test_nios_host_record.py
21
5386
# 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. # # Ansible is distributed in the hope that ...
gpl-3.0
adviti/melange
thirdparty/google_appengine/lib/django_1_2/tests/modeltests/m2o_recursive/tests.py
92
1679
from django.test import TestCase from models import Category, Person class ManyToOneRecursiveTests(TestCase): def setUp(self): self.r = Category(id=None, name='Root category', parent=None) self.r.save() self.c = Category(id=None, name='Child category', parent=self.r) self.c.save() ...
apache-2.0
gantsign/ansible-role-java
molecule/java-max-lts/tests/test_role.py
1
1422
import pytest import re def test_java(host): cmd = host.run('. /etc/profile && java -version') assert cmd.rc == 0 m = re.search('(?:java|openjdk) version "([0-9]+)', cmd.stderr) assert m is not None java_version = m.group(1) assert '11' == java_version def test_javac(host): cmd = host.ru...
mit
hyperized/ansible
test/units/modules/network/fortios/test_fortios_switch_controller_qos_ip_dscp_map.py
21
8181
# Copyright 2019 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 License, or # (at your option) any later version. # # This program is distributed in the...
gpl-3.0
montoyjh/pymatgen
pymatgen/analysis/structure_prediction/tests/test_substitutor.py
3
1823
# coding: utf-8 # Copyright (c) Pymatgen Development Team. # Distributed under the terms of the MIT License. import unittest import os import json from pymatgen.core.periodic_table import Specie from pymatgen.core.composition import Composition from pymatgen.analysis.structure_prediction.substitutor import Substitut...
mit
kikocorreoso/brython
www/tests/compression/test_lz77.py
2
2225
import os from lz77 import LZ77 texts = [ "veridique ! dominique pique nique en tunique.", """Pleurez, doux alcyons, ô vous, oiseaux sacrés, Oiseaux chers à Thétis, doux alcyons, pleurez. Elle a vécu, Myrto, la jeune Tarentine. Un vaisseau la portait aux bords de Camarine. Là l'hymen, les chansons, les flût...
bsd-3-clause
debsankha/bedtime-programming
ls222/visual-lv.py
1
3375
from math import * import thread import random import time import visual cat_catch_rate=5*10**-4 #parameter cat_efficiency=0.8 #parameter a=0.2 #will ge...
gpl-3.0
jpmpentwater/cvxpy
examples/expr_trees/1D_convolution.py
12
1453
#!/usr/bin/env python from cvxpy import * import numpy as np import random from math import pi, sqrt, exp def gauss(n=11,sigma=1): r = range(-int(n/2),int(n/2)+1) return [1 / (sigma * sqrt(2*pi)) * exp(-float(x)**2/(2*sigma**2)) for x in r] np.random.seed(5) random.seed(5) DENSITY = 0.008 n = 1000 x = Varia...
gpl-3.0
mpeuster/estate
experiments/scale-down-hack/pox/pox/forwarding/l3_learning.py
36
12330
# Copyright 2012-2013 James McCauley # # 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
jos4uke/getSeqFlankBlatHit
lib/python2.7/site-packages/Cython/Compiler/ParseTreeTransforms.py
2
117197
from __future__ import absolute_import import copy import cython cython.declare(PyrexTypes=object, Naming=object, ExprNodes=object, Nodes=object, Options=object, UtilNodes=object, LetNode=object, LetRefNode=object, TreeFragment=object, EncodedString=object, error=object, w...
gpl-2.0
daizhengy/RDS
trove/guestagent/strategies/backup/experimental/couchbase_impl.py
4
4107
# Copyright (c) 2014 eBay Software 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.apache.org/licenses/LICENSE-2.0 # # Unl...
apache-2.0
damiendallimore/SplunkModularInputsPythonFramework
implementations/twilio_alert/bin/twilio/rest/resources/task_router/workspaces.py
38
3347
from .. import NextGenInstanceResource, NextGenListResource from .statistics import Statistics class Workspace(NextGenInstanceResource): """ A Workspace resource. See the `TaskRouter API reference <https://www.twilio.com/docs/taskrouter/workspaces>_` for more information. .. attribute:: sid ...
apache-2.0
ScaDS/ORC-Schlange
ORCSchlange/command/db.py
1
3559
"""The db commands.""" import sys from ORCSchlange.command import BaseCommand, really def check_date(d): """Check if a string is a valide date of the form "YYYY-MM-DD". :param d: The date string that is checked. :return: True if it is a not valid date string. """ if len(d) != 10: retu...
apache-2.0
kg-bot/SupyBot
plugins/Trivia/test.py
1
1915
### # Copyright (c) 2011, Valentin Lorentz # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # * Redistributions of source code must retain the above copyright notice, # this list of conditi...
gpl-3.0
egabancho/invenio
invenio/legacy/refextract/linker.py
1
3721
# -*- coding: utf-8 -*- ## ## This file is part of Invenio. ## Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2014 CERN. ## ## Invenio 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 ...
gpl-2.0
DhiaEddineSaidi/python-social-auth
social/backends/clef.py
50
1768
""" Clef OAuth support. This contribution adds support for Clef OAuth service. The settings SOCIAL_AUTH_CLEF_KEY and SOCIAL_AUTH_CLEF_SECRET must be defined with the values given by Clef application registration process. """ from social.backends.oauth import BaseOAuth2 class ClefOAuth2(BaseOAuth2): """Clef OAut...
bsd-3-clause
aduggan/rpi-linux
tools/perf/scripts/python/sctop.py
1996
2102
# system call top # (c) 2010, Tom Zanussi <tzanussi@gmail.com> # Licensed under the terms of the GNU GPL License version 2 # # Periodically displays system-wide system call totals, broken down by # syscall. If a [comm] arg is specified, only syscalls called by # [comm] are displayed. If an [interval] arg is specified,...
gpl-2.0
skg-net/ansible
test/units/module_utils/network/ftd/test_configuration.py
9
5568
# Copyright (c) 2018 Cisco and/or its affiliates. # # 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 v...
gpl-3.0
mxrrow/zaicoin
src/deps/boost/tools/build/v2/test/generator_selection.py
15
4350
#!/usr/bin/python # Copyright 2008 Jurko Gospodnetic # Distributed under the Boost Software License, Version 1.0. # (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) # Tests that generators get selected correctly. import BoostBuild #####################################################...
mit
shukiz/VAR-SOM-AM33-Kernel-3-15
tools/perf/tests/attr.py
3174
9441
#! /usr/bin/python import os import sys import glob import optparse import tempfile import logging import shutil import ConfigParser class Fail(Exception): def __init__(self, test, msg): self.msg = msg self.test = test def getMsg(self): return '\'%s\' - %s' % (self.test.path, self.msg)...
gpl-2.0
glavase/limbo-android
jni/qemu/roms/seabios/tools/checkrom.py
103
1842
#!/usr/bin/env python # Script to check a bios image and report info on it. # # Copyright (C) 2008 Kevin O'Connor <kevin@koconnor.net> # # This file may be distributed under the terms of the GNU GPLv3 license. import sys import layoutrom def main(): # Get args objinfo, rawfile, outfile = sys.argv[1:] # ...
gpl-2.0
highlanderkev/kpw.org
kpw-org/languages/uk.py
27
13793
# coding: utf8 { '!langcode!': 'uk', '!langname!': 'Українська', '"update" is an optional expression like "field1=\'newvalue\'". You cannot update or delete the results of a JOIN': '"Оновити" це додатковий вираз, такий, як "field1=\'нове_значення\'". Ви не можете змінювати або вилучати дані об\'єднаних таблиць.', '%d d...
mit
googleworkspace/python-samples
events/next18/customer_spreadsheet_reader.py
3
2691
# Copyright 2018 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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, s...
apache-2.0
Juzley/golfstats
lib/werkzeug/security.py
255
8971
# -*- coding: utf-8 -*- """ werkzeug.security ~~~~~~~~~~~~~~~~~ Security related helpers such as secure password hashing tools. :copyright: (c) 2014 by the Werkzeug Team, see AUTHORS for more details. :license: BSD, see LICENSE for more details. """ import os import hmac import hashlib import posi...
mit
xkollar/spacewalk
spacecmd/src/lib/org.py
5
12499
# # Licensed under the GNU General Public License Version 3 # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # # This p...
gpl-2.0
ftomassetti/intellij-community
python/lib/Lib/site-packages/django/contrib/gis/db/models/sql/where.py
309
3938
from django.db.models.fields import Field, FieldDoesNotExist from django.db.models.sql.constants import LOOKUP_SEP from django.db.models.sql.expressions import SQLEvaluator from django.db.models.sql.where import Constraint, WhereNode from django.contrib.gis.db.models.fields import GeometryField class GeoConstraint(Con...
apache-2.0
stonegithubs/odoo
addons/website/tests/test_crawl.py
251
3415
# -*- coding: utf-8 -*- import logging import urlparse import time import lxml.html import openerp import re _logger = logging.getLogger(__name__) class Crawler(openerp.tests.HttpCase): """ Test suite crawling an openerp CMS instance and checking that all internal links lead to a 200 response. If a use...
agpl-3.0
diaevd/android_kernel_samsung_sm-t325
tools/perf/scripts/python/syscall-counts-by-pid.py
11180
1927
# system call counts, by pid # (c) 2010, Tom Zanussi <tzanussi@gmail.com> # Licensed under the terms of the GNU GPL License version 2 # # Displays system-wide system call totals, broken down by syscall. # If a [comm] arg is specified, only syscalls called by [comm] are displayed. import os, sys sys.path.append(os.env...
gpl-2.0
prospwro/odoo
addons/sale_mrp/__init__.py
445
1062
# -*- 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
yencarnacion/jaikuengine
.google_appengine/lib/django-1.4/tests/regressiontests/one_to_one_regress/tests.py
26
4753
from __future__ import absolute_import from django.test import TestCase from .models import Place, Restaurant, Bar, Favorites, Target, UndergroundBar class OneToOneRegressionTests(TestCase): def setUp(self): self.p1 = Place(name='Demon Dogs', address='944 W. Fullerton') self.p1.save() s...
apache-2.0
sharhar/USB-Thing
UpdaterFiles/Lib/python-3.5.1.amd64/Lib/unittest/result.py
8
7441
"""Test result object""" import io import sys import traceback from . import util from functools import wraps __unittest = True def failfast(method): @wraps(method) def inner(self, *args, **kw): if getattr(self, 'failfast', False): self.stop() return method(self, *args, **kw) ...
apache-2.0
asm666/sympy
sympy/functions/elementary/piecewise.py
69
23292
from __future__ import print_function, division from sympy.core import Basic, S, Function, diff, Tuple from sympy.core.relational import Equality, Relational from sympy.functions.elementary.miscellaneous import Max, Min from sympy.logic.boolalg import (And, Boolean, distribute_and_over_or, Not, Or, true, false) fr...
bsd-3-clause
JamesMura/sentry
src/sentry/models/dsymfile.py
1
18884
""" sentry.models.dsymfile ~~~~~~~~~~~~~~~~~~~~~~ :copyright: (c) 2010-2016 by the Sentry Team, see AUTHORS for more details. :license: BSD, see LICENSE for more details. """ from __future__ import absolute_import import os import shutil import hashlib import six import tempfile from requests.exceptions import Reque...
bsd-3-clause
lxsmnv/spark
examples/src/main/python/ml/decision_tree_classification_example.py
123
3003
# # 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 us...
apache-2.0
rosswhitfield/mantid
Testing/SystemTests/tests/framework/ISIS/SANS/WORKFLOWS/SANSReductionCoreTest.py
3
13544
# Mantid Repository : https://github.com/mantidproject/mantid # # Copyright &copy; 2020 ISIS Rutherford Appleton Laboratory UKRI, # NScD Oak Ridge National Laboratory, European Spallation Source, # Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS # SPDX - License - Identifier: GPL - 3.0 + # py...
gpl-3.0
quattor/aquilon
lib/aquilon/worker/commands/cat_service.py
2
1792
# -*- cpy-indent-level: 4; indent-tabs-mode: nil -*- # ex: set expandtab softtabstop=4 shiftwidth=4: # # Copyright (C) 2008,2009,2010,2011,2012,2013,2015,2016 Contributor # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obt...
apache-2.0
loopCM/chromium
chrome/test/telemetry/chromeos/login_unittest.py
30
4150
# Copyright (c) 2012 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. import json import os import unittest from telemetry.core import browser_finder from telemetry.core import exceptions from telemetry.core import extensio...
bsd-3-clause
sharad/calibre
src/calibre/ebooks/conversion/plugins/rb_output.py
24
1267
# -*- coding: utf-8 -*- __license__ = 'GPL 3' __copyright__ = '2009, John Schember <john@nachtimwald.com>' __docformat__ = 'restructuredtext en' import os from calibre.customize.conversion import OutputFormatPlugin, OptionRecommendation class RBOutput(OutputFormatPlugin): name = 'RB Output' author = 'John ...
gpl-3.0
simonwydooghe/ansible
lib/ansible/modules/cloud/azure/azure_rm_storageaccount_info.py
10
22917
#!/usr/bin/python # # Copyright (c) 2016 Matt Davis, <mdavis@ansible.com> # Chris Houseknecht, <house@redhat.com> # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSI...
gpl-3.0
fevxie/odoo
addons/base_report_designer/plugin/openerp_report_designer/bin/script/ConvertBracesToField.py
384
12556
######################################################################### # # Copyright (c) 2003-2004 Danny Brewer d29583@groovegarden.com # Copyright (C) 2004-2010 OpenERP SA (<http://openerp.com>). # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser Gene...
agpl-3.0
gauribhoite/personfinder
env/google_appengine/lib/django-1.4/django/contrib/sites/managers.py
491
1985
from django.conf import settings from django.db import models from django.db.models.fields import FieldDoesNotExist class CurrentSiteManager(models.Manager): "Use this to limit objects to those associated with the current site." def __init__(self, field_name=None): super(CurrentSiteManager, self).__ini...
apache-2.0
frankvdp/django
django/db/models/sql/datastructures.py
32
6701
""" Useful auxiliary data structures for query construction. Not useful outside the SQL domain. """ # for backwards-compatibility in Django 1.11 from django.core.exceptions import EmptyResultSet # NOQA: F401 from django.db.models.sql.constants import INNER, LOUTER class MultiJoin(Exception): """ Used by join...
bsd-3-clause
Bitl/RBXLegacy-src
Cut/RBXLegacyDiscordBot/lib/pip/_vendor/requests/packages/chardet/gb2312freq.py
3132
36011
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Communicator client code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 1998 # the Initial Developer. All Rights R...
gpl-3.0
openshift/openshift-tools
ansible/roles/lib_oa_openshift/src/ansible/oc_adm_ca_server_cert.py
63
1365
# pylint: skip-file # flake8: noqa # pylint: disable=wrong-import-position from ansible.module_utils.six import string_types def main(): ''' ansible oc adm module for ca create-server-cert ''' module = AnsibleModule( argument_spec=dict( state=dict(default='present', type='str', c...
apache-2.0
dan1/horizon-x509
horizon/forms/base.py
79
2451
# Copyright 2012 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # Copyright 2012 Nebula, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the...
apache-2.0
cooldudezach/android_kernel_zte_warplte
tools/perf/util/setup.py
4998
1330
#!/usr/bin/python2 from distutils.core import setup, Extension from os import getenv from distutils.command.build_ext import build_ext as _build_ext from distutils.command.install_lib import install_lib as _install_lib class build_ext(_build_ext): def finalize_options(self): _build_ext.finalize_optio...
gpl-2.0
shyamalschandra/scikit-learn
examples/decomposition/plot_image_denoising.py
181
5819
""" ========================================= Image denoising using dictionary learning ========================================= An example comparing the effect of reconstructing noisy fragments of the Lena image using firstly online :ref:`DictionaryLearning` and various transform methods. The dictionary is fitted o...
bsd-3-clause
micropython/micropython
tests/misc/sys_settrace_loop.py
8
1144
# test sys.settrace with while and for loops import sys try: sys.settrace except AttributeError: print("SKIP") raise SystemExit def print_stacktrace(frame, level=0): print( "%2d: %s@%s:%s => %s:%d" % ( level, " ", frame.f_globals["__name__"], ...
mit
sbalde/edxplatform
common/djangoapps/student/tests/test_recent_enrollments.py
63
7937
""" Tests for the recently enrolled messaging within the Dashboard. """ import datetime from django.conf import settings from django.core.urlresolvers import reverse from opaque_keys.edx import locator from pytz import UTC import unittest import ddt from shoppingcart.models import DonationConfiguration from student.te...
agpl-3.0
Audacity-Team/Audacity
lib-src/lv2/lv2/plugins/eg01-amp.lv2/waflib/Tools/ruby.py
316
3925
#! /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 os from waflib import Task,Options,Utils from waflib.TaskGen import before_method,feature,after_method,Task,extension from waflib.Configure import conf @feature('rubyex...
mit
openiitbombayx/edx-platform
lms/djangoapps/courseware/features/openended.py
119
2996
# pylint: disable=missing-docstring # pylint: disable=redefined-outer-name from lettuce import world, step from lettuce.django import django_url from nose.tools import assert_equals, assert_in # pylint: disable=no-name-in-module from logging import getLogger logger = getLogger(__name__) @step('I navigate to an open...
agpl-3.0
waytai/odoo
addons/web/controllers/main.py
46
66013
# -*- coding: utf-8 -*- import ast import base64 import csv import functools import glob import itertools import jinja2 import logging import operator import datetime import hashlib import os import re import simplejson import sys import time import urllib2 import zlib from xml.etree import ElementTree from cStringIO ...
agpl-3.0
antoine-de/navitia
source/jormungandr/jormungandr/realtime_schedule/__init__.py
7
1437
# encoding: utf-8 # Copyright (c) 2001-2014, Canal TP and/or its affiliates. All rights reserved. # # This file is part of Navitia, # the software to build cool stuff with public transport. # # Hope you'll enjoy and contribute to this project, # powered by Canal TP (www.canaltp.fr). # Help us simplify mobilit...
agpl-3.0
idaholab/raven
tests/framework/Samplers/DynamicEventTrees/AdaptiveDET/ideal_pump_control.py
2
3041
# Copyright 2017 Battelle Energy Alliance, 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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed t...
apache-2.0
peastman/deepchem
deepchem/data/tests/test_reshard.py
3
2328
import deepchem as dc import numpy as np def test_reshard_with_X(): """Test resharding on a simple example""" X = np.random.rand(100, 10) dataset = dc.data.DiskDataset.from_numpy(X) assert dataset.get_number_shards() == 1 dataset.reshard(shard_size=10) assert (dataset.X == X).all() assert dataset.get_nu...
mit
bitcraft/PyTMX
pytmx/__init__.py
1
1082
# -*- coding: utf-8 -*- """ Copyright (C) 2012-2017, Leif Theden <leif.theden@gmail.com> This file is part of pytmx. pytmx 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, either version 3 of the License, ...
lgpl-3.0
ajayaa/keystone
keystone/contrib/revoke/migrate_repo/versions/001_revoke_table.py
14
1502
# 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
kmacinnis/sympy
sympy/integrals/manualintegrate.py
3
31160
"""Integration method that emulates by-hand techniques. This module also provides functionality to get the steps used to evaluate a particular integral, in the ``integral_steps`` function. This will return nested namedtuples representing the integration rules used. The ``manualintegrate`` function computes the integra...
bsd-3-clause
pong3489/TEST_Mission
Lib/site-packages/scipy/stats/_support.py
57
8775
from numpy import asarray import numpy as np import copy ListType = list TupleType = tuple StringType = str def abut(source, *args): # comment: except for the repetition, this is equivalent to hstack. """\nLike the |Stat abut command. It concatenates two arrays column-wise and returns the result. CAUTIO...
gpl-3.0
kalrey/swift
test/probe/common.py
4
9721
# Copyright (c) 2010-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 agree...
apache-2.0
zhuochenKIDD/FrameworkBenchmarks
frameworks/Python/bottle/app.py
58
5667
from functools import partial from operator import attrgetter, itemgetter from random import randint import os import sys from bottle import Bottle, route, request, run, template, response from bottle.ext import sqlalchemy from sqlalchemy import create_engine, Column, Integer, Unicode from sqlalchemy.ext.declarative ...
bsd-3-clause
TheStrix/android_kernel_xiaomi_armani
arch/ia64/scripts/unwcheck.py
13143
1714
#!/usr/bin/python # # Usage: unwcheck.py FILE # # This script checks the unwind info of each function in file FILE # and verifies that the sum of the region-lengths matches the total # length of the function. # # Based on a shell/awk script originally written by Harish Patil, # which was converted to Perl by Matthew Ch...
gpl-2.0
zimmermant/dlvo_lammps
tools/moltemplate/src/postprocess_input_script.py
19
5958
#!/usr/bin/env python """ Reorder the integer arguments to the commands in a LAMMPS input file if these arguments violate LAMMPS order requirements. We have to do this because the moltemplate.sh script will automatically assign these integers in a way which may violate these restrictions and the user ...
gpl-2.0
RDXT/geopy
geopy/geocoders/geonames.py
13
5902
""" :class:`GeoNames` geocoder. """ from geopy.compat import urlencode from geopy.geocoders.base import Geocoder, DEFAULT_TIMEOUT from geopy.location import Location from geopy.exc import ( GeocoderInsufficientPrivileges, GeocoderServiceError, ConfigurationError ) from geopy.util import logger __all__ =...
mit
iqas/e2gui
lib/python/Components/Renderer/LcdPicon.py
13
6378
import os, re, unicodedata from Renderer import Renderer from enigma import ePixmap, ePicLoad from Tools.Alternatives import GetWithAlternative from Tools.Directories import pathExists, SCOPE_ACTIVE_SKIN, resolveFilename from Components.Harddisk import harddiskmanager from boxbranding import getBoxType from ServiceRefe...
gpl-2.0
jeffdasilva/stattrack
db/player/strings.py
1
4472
import unittest class PlayerStrings(object): Name = 'name' Position = 'position' Team = 'team' FantasyOwner = 'owner' Link = 'link' Stats = 'stats' GamesPlayed = 'GamesPlayed' ProjectedPrefix = 'Projected' def __init__(self, prefix=None): if prefix is None: se...
gpl-2.0
skycucumber/Messaging-Gateway
webapp/venv/lib/python2.7/site-packages/twisted/conch/ssh/session.py
59
10817
# -*- test-case-name: twisted.conch.test.test_session -*- # Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ This module contains the implementation of SSHSession, which (by default) allows access to a shell and a python interpreter over SSH. Maintainer: Paul Swartz """ import struct import ...
gpl-2.0
wasade/qiime
qiime/denoiser/cluster_utils.py
1
9533
#!/usr/bin/env python """Some utility functions for operating on a cluster or MP machine.""" __author__ = "Jens Reeder" __copyright__ = "Copyright 2011, The QIIME Project" # remember to add yourself if you make changes __credits__ = ["Jens Reeder", "Rob Knight", "Nigel Cook", "Jai Ram Rideout"] __license__ = "GPL" __...
gpl-2.0
sterlingbaldwin/acme_workbench
workbench-backend/workbench/urls.py
1
1920
"""workbench URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/1.10/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: url(r'^$', views.home, name='home') Class-...
bsd-2-clause
radicalbit/ambari
ambari-agent/src/test/python/ambari_agent/TestAlerts.py
2
61637
#!/usr/bin/env python ''' 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")...
apache-2.0
blckshrk/Weboob
weboob/tools/test.py
4
2247
# -*- coding: utf-8 -*- # Copyright(C) 2010-2011 Romain Bignon, Laurent Bachelier # # This file is part of weboob. # # weboob 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 Lic...
agpl-3.0
hwu25/AppPkg
Applications/Python/Python-2.7.2/Lib/test/test_mimetools.py
13
1831
import unittest from test import test_support import string import StringIO mimetools = test_support.import_module("mimetools", deprecated=True) msgtext1 = mimetools.Message(StringIO.StringIO( """Content-Type: text/plain; charset=iso-8859-1; format=flowed Content-Transfer-Encoding: 8bit Foo! """)) c...
bsd-2-clause
rharrison10/openshift-ansible
playbooks/common/openshift-cluster/upgrades/library/openshift_upgrade_config.py
91
5294
#!/usr/bin/python # -*- coding: utf-8 -*- # vim: expandtab:tabstop=4:shiftwidth=4 """Ansible module for modifying OpenShift configs during an upgrade""" import os import yaml DOCUMENTATION = ''' --- module: openshift_upgrade_config short_description: OpenShift Upgrade Config author: Jason DeTiberus requirements: [ ]...
apache-2.0
nevir/plexability
extern/depot_tools/third_party/pylint/checkers/imports.py
20
15213
# Copyright (c) 2003-2010 LOGILAB S.A. (Paris, FRANCE). # http://www.logilab.fr/ -- mailto:contact@logilab.fr # # 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, o...
gpl-2.0
andela-ifageyinbo/django
tests/settings_tests/tests.py
74
17758
import os import sys import unittest import warnings from types import ModuleType from django.conf import ENVIRONMENT_VARIABLE, LazySettings, Settings, settings from django.core.exceptions import ImproperlyConfigured from django.http import HttpRequest from django.test import ( SimpleTestCase, TestCase, Transactio...
bsd-3-clause
MediaKraken/MediaKraken_Deployment
source/common/common_libblueray.py
1
1325
""" Copyright (C) 2017 Quinn D Granfor <spootdev@gmail.com> This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2, as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but ...
gpl-3.0
wong2/sentry
tests/sentry/api/endpoints/test_release_files.py
26
2450
from __future__ import absolute_import from django.core.files.uploadedfile import SimpleUploadedFile from django.core.urlresolvers import reverse from sentry.models import File, Release, ReleaseFile from sentry.testutils import APITestCase class ReleaseFilesListTest(APITestCase): def test_simple(self): ...
bsd-3-clause
sasukeh/neutron
neutron/tests/unit/agent/metadata/test_driver.py
16
6206
# Copyright 2014 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.apache.org/licenses/LICENSE-2.0 # # Unless req...
apache-2.0
wathen/PhD
MHD/FEniCS/MHD/Stabilised/SaddlePointForm/Test/ParamTests/MHDmatrixPrecondSetup.py
7
6639
from dolfin import * import petsc4py import sys petsc4py.init(sys.argv) from petsc4py import PETSc import HiptmairSetup import time import MatrixOperations as MO import NSprecondSetup def FluidLinearSetup(Pressure,mu): MO.PrintStr("Preconditioning Fluid linear setup",3,"=","\n\n") parameters['linear_algebra_b...
mit
ghmajx/asuswrt-merlin
release/src/router/samba3/source/python/examples/spoolss/psec.py
55
2139
#!/usr/bin/env python # # Get or set the security descriptor on a printer # import sys, re, string from samba import spoolss if len(sys.argv) != 3: print "Usage: psec.py getsec|setsec printername" sys.exit(1) op = sys.argv[1] printername = sys.argv[2] # Display security descriptor if op == "getsec": t...
gpl-2.0
xiaom/zenodo
zenodo/modules/theme/views.py
7
1315
# -*- coding: utf-8 -*- # # This file is part of Zenodo. # Copyright (C) 2015 CERN. # # Zenodo 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 v...
gpl-2.0
zepto/musio
musio/mp4v2/_mp4v2_wrapper.py
1
10422
#!/usr/bin/env python # vim: sw=4:ts=4:sts=4:fdm=indent:fdl=0: # -*- coding: UTF8 -*- # # mp4v2 object oriented wrapper module. # Copyright (C) 2010 Josiah Gordon <josiahg@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 publi...
gpl-3.0
Medigate/cutiuta-server
cutiuta-server/env/lib/python3.4/site-packages/django/contrib/gis/geos/prototypes/misc.py
483
1300
""" This module is for the miscellaneous GEOS routines, particularly the ones that return the area, distance, and length. """ from ctypes import POINTER, c_double, c_int from django.contrib.gis.geos.libgeos import GEOM_PTR, GEOSFuncFactory from django.contrib.gis.geos.prototypes.errcheck import check_dbl, check_stri...
gpl-3.0
d3trax/kubernetes
cluster/juju/charms/trusty/kubernetes/unit_tests/lib/test_registrator.py
232
2215
#!/usr/bin/env python # Copyright 2015 The Kubernetes 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 # # Unle...
apache-2.0
ClaudeZoo/volatility
volatility/plugins/gui/gditimers.py
44
2791
# Volatility # Copyright (C) 2007-2013 Volatility Foundation # Copyright (C) 2010,2011,2012 Michael Hale Ligh <michael.ligh@mnin.org> # # 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 F...
gpl-2.0
danlrobertson/servo
components/script/dom/bindings/codegen/CodegenRust.py
1
301911
# 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 https://mozilla.org/MPL/2.0/. # Common codegen classes. from collections import defaultdict from itertools import groupby import operator import os...
mpl-2.0
kg-bot/SupyBot
plugins/I18nPlaceholder/plugin.py
3
2369
### # Copyright (c) 2012, Valentin Lorentz # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # * Redistributions of source code must retain the above copyright notice, # this list of conditi...
gpl-3.0
smartjump/backend
src/get_bus_data.py
1
1725
#!/usr/bin/env python3 #****************************************************************************# # Project: Smart Jump # # Author: Alfonso Bilbao Velez <alfon.linux@gmail.com> # # Developed: Hackatinho Mobilidade Sostible ...
agpl-3.0
Huskerboy/startbootstrap-freelancer
freelancer_env/Lib/site-packages/pip/_vendor/distlib/_backport/sysconfig.py
327
26955
# -*- coding: utf-8 -*- # # Copyright (C) 2012 The Python Software Foundation. # See LICENSE.txt and CONTRIBUTORS.txt. # """Access to Python's configuration information.""" import codecs import os import re import sys from os.path import pardir, realpath try: import configparser except ImportError: import Conf...
mit
jonathanslenders/python-deployer
deployer/run/socket_client.py
2
10212
""" Start a deployment shell client. """ from StringIO import StringIO from twisted.internet import fdesc from deployer.utils import esc1 from setproctitle import setproctitle import array import errno import fcntl import getpass import glob import os import pickle import select import signal import socket import su...
bsd-2-clause
thnkloud9/Tandem
server/scripts/clean_orphaned_objects.py
1
1406
from pymongo import MongoClient from bson.objectid import ObjectId client = MongoClient('localhost', 27017) db = client['tandem'] audios = db['audio'] users = db['users'] files = db['fs.files'] chunks = db['fs.chunks'] practice_sets = db['practice_sets'] practice_sessions = db['practice_sessions'] # remove practice...
gpl-2.0
dwsilk/qgis-geosaurus-plugin
geosaurus/functions/processing/offsetcurve.py
1
3600
# -*- coding: utf-8 -*- import re from ...core import database as db from ..enums import ( ReturnType, SpatialFunctionGroup, SpatialType) from ..template import AbstractSpatialFunction class OffsetCurve(AbstractSpatialFunction): """ ST_OffsetCurve """ def __init__(self, distance=0, quad_segs=8,...
bsd-3-clause