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
EdLeafe/pyrax
samples/images/export_task.py
13
2383
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright (c)2014 Rackspace US, 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.ap...
apache-2.0
tafaRU/account-financial-tools
__unported__/account_move_template/wizard/select_template.py
7
10189
# -*- coding: utf-8 -*- ############################################################################## # # Copyright (C) 2011 Agile Business Group sagl (<http://www.agilebg.com>) # Copyright (C) 2011 Domsense srl (<http://www.domsense.com>) # # This program is free software: you can redistribute it and/or modi...
agpl-3.0
aganzha/tweepy
tweepy/streaming.py
1
16268
# Tweepy # Copyright 2009-2010 Joshua Roesslein # See LICENSE for details. # Appengine users: https://developers.google.com/appengine/docs/python/sockets/#making_httplib_use_sockets from __future__ import absolute_import, print_function import logging import requests from requests.exceptions import Timeout from thre...
mit
rosarior/rua
rua/apps/permissions/migrations/0001_initial.py
4
5607
# encoding: utf-8 from south.db import db from south.v2 import SchemaMigration class Migration(SchemaMigration): def forwards(self, orm): # Adding model 'Permission' db.create_table('permissions_permission', ( ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), ...
gpl-3.0
s20121035/rk3288_android5.1_repo
external/chromium_org/tools/telemetry/telemetry/core/backends/chrome/tab_list_backend.py
46
2790
# Copyright 2013 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import urllib2 from telemetry.core import tab from telemetry.core import util from telemetry.core.backends.chrome import inspector_backend_list class TabL...
gpl-3.0
jetty840/ReplicatorG
skein_engines/skeinforge-35/skeinforge_application/skeinforge_plugins/analyze_plugins/skeiniso.py
6
43737
""" This page is in the table of contents. Skeiniso is an analysis script to display a gcode file in an isometric view. The skeiniso manual page is at: http://www.bitsfrombytes.com/wiki/index.php?title=Skeinforge_Skeiniso ==Operation== The default 'Activate Skeiniso' checkbox is on. When it is on, the functions desc...
gpl-2.0
nschaetti/EchoTorch
examples/generation/narma10_esn_feedbacks.py
1
3043
# -*- coding: utf-8 -*- # # File : examples/timeserie_prediction/switch_attractor_esn # Description : NARMA 30 prediction with ESN. # Date : 26th of January, 2018 # # This file is part of EchoTorch. EchoTorch is free software: you can # redistribute it and/or modify it under the terms of the GNU General Public # Licen...
gpl-3.0
jjmiranda/edx-platform
lms/djangoapps/shoppingcart/admin.py
63
5399
"""Django admin interface for the shopping cart models. """ from ratelimitbackend import admin from shoppingcart.models import ( PaidCourseRegistrationAnnotation, Coupon, DonationConfiguration, Invoice, CourseRegistrationCodeInvoiceItem, InvoiceTransaction ) class SoftDeleteCouponAdmin(admin.M...
agpl-3.0
lzw120/django
tests/regressiontests/many_to_one_regress/models.py
124
1396
""" Regression tests for a few ForeignKey bugs. """ from django.db import models # If ticket #1578 ever slips back in, these models will not be able to be # created (the field names being lower-cased versions of their opposite # classes is important here). class First(models.Model): second = models.IntegerField(...
bsd-3-clause
virtuald/pynsq
setup.py
1
1354
from setuptools import setup from setuptools.command.test import test as TestCommand import sys class PyTest(TestCommand): def finalize_options(self): TestCommand.finalize_options(self) self.test_args = [] self.test_suite = True def run_tests(self): import pytest errno...
mit
Hikari-no-Tenshi/android_external_skia
tools/skpbench/_hardware_pixel2.py
12
4472
# Copyright 2018 Google Inc. # # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. from _hardware import Expectation from _hardware_android import HardwareAndroid CPU_CLOCK_RATE = 2035200 MEM_CLOCK_RATE = 13763 GPU_CLOCK_RATE = 670000000 GPU_POWER_LEVEL = 1 # lower i...
bsd-3-clause
swatilodha/coala
tests/output/ConfWriterTest.py
26
2819
import os import tempfile import unittest from coalib.output.ConfWriter import ConfWriter from coalib.parsing.ConfParser import ConfParser class ConfWriterTest(unittest.TestCase): example_file = ("to be ignored \n" " save=true\n" " a_default, another = val \n" ...
agpl-3.0
DataDog/integrations-core
ibm_mq/datadog_checks/ibm_mq/collectors/stats_collector.py
1
4767
# (C) Datadog, Inc. 2020-present # All rights reserved # Licensed under a 3-clause BSD style license (see LICENSE) from pymqi.CMQCFC import MQCMD_STATISTICS_CHANNEL, MQCMD_STATISTICS_Q from datadog_checks.ibm_mq.stats.base_stats import BaseStats from datadog_checks.ibm_mq.stats.queue_stats import QueueStats from ..m...
bsd-3-clause
netmanchris/PYHPEIMC
archived/pyhpimc.py
3
35486
#!/usr/bin/env python3 # author: @netmanchris """ Copyright 2015 Hewlett Packard Enterprise Development LP Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/lic...
apache-2.0
ramcn/demo3
venv/lib/python3.4/site-packages/pip/_vendor/requests/packages/chardet/codingstatemachine.py
2931
2318
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is mozilla.org 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 Reserved. # # Con...
mit
gonboy/sl4a
python/src/Demo/pdist/rrcs.py
47
3993
#! /usr/bin/env python "Remote RCS -- command line interface" import sys import os import getopt import string import md5 import tempfile from rcsclient import openrcsclient def main(): sys.stdout = sys.stderr try: opts, rest = getopt.getopt(sys.argv[1:], 'h:p:d:qvL') if not rest: ...
apache-2.0
kevenli/FeedIn
tests/util/etreetodicttests.py
2
1761
# -*- coding: utf-8 -*- ''' Created on 2014��11��21�� @author: ��� ''' import unittest from lxml.etree import Element from feedin import util class Test(unittest.TestCase): def test_etree_to_dict(self): root = Element('div') root.append(Element('a', {'href': 'http://aaa.bbb/'})) result =...
apache-2.0
bgxavier/nova
nova/tests/unit/api/openstack/test_common.py
38
23913
# Copyright 2010 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 requ...
apache-2.0
ljnutal6/media-recommend
app/virtualenvs/recommedia/lib/python2.7/site-packages/pip/vendor/html5lib/trie/py.py
80
1774
from __future__ import absolute_import, division, unicode_literals from pip.vendor.six import text_type from bisect import bisect_left from ._base import Trie as ABCTrie class Trie(ABCTrie): def __init__(self, data): if not all(isinstance(x, text_type) for x in data.keys()): raise TypeError(...
gpl-2.0
mozilla/ichnaea
ichnaea/webapp/app.py
1
1488
""" Holds global web application state and the WSGI handler. You can run this script for a one-process webapp. Further, you can pass in ``--check`` which will create the app and then exit making it easier to suss out startup and configuration issues. """ import sys from waitress import serve from ichnaea.conf imp...
apache-2.0
hhg2288/mkdocs
mkdocs/tests/config/config_tests.py
27
7563
#!/usr/bin/env python # coding: utf-8 from __future__ import unicode_literals import os import shutil import tempfile import unittest from mkdocs import config from mkdocs import utils from mkdocs.config import config_options from mkdocs.exceptions import ConfigurationError from mkdocs.tests.base import dedent def ...
bsd-2-clause
mgamer/gyp
test/defines/gyptest-defines-env-regyp.py
268
1350
#!/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 build of an executable with C++ define specified by a gyp define, and the use of the environment during regeneration when the g...
bsd-3-clause
rysson/filmkodi
plugin.video.mrknow/mylib/_pydev_bundle/_pydev_filesystem_encoding.py
50
1095
import sys def __getfilesystemencoding(): ''' Note: there's a copy of this method in interpreterInfo.py ''' try: ret = sys.getfilesystemencoding() if not ret: raise RuntimeError('Unable to get encoding.') return ret except: try: #Handle Jytho...
apache-2.0
josephwilk/qscintilla
Python/configure-old.py
3
14886
# This script configures QScintilla for PyQt v3 and/or v4. # # Copyright (c) 2015 Riverbank Computing Limited <info@riverbankcomputing.com> # # This file is part of QScintilla. # # This file may be used under the terms of the GNU General Public License # version 3.0 as published by the Free Software Foundation and ap...
gpl-3.0
ReactiveX/RxPY
tests/test_observable/test_map.py
1
12515
import unittest from rx import Observable, return_value, throw, empty, create from rx.testing import TestScheduler, ReactiveTest from rx.disposable import SerialDisposable from rx.operators import map, map_indexed on_next = ReactiveTest.on_next on_completed = ReactiveTest.on_completed on_error = ReactiveTest.on_erro...
mit
liveblog/superdesk
server/apps/archived/archived.py
5
2238
# -*- coding: utf-8; -*- # # This file is part of Superdesk. # # Copyright 2013, 2014 Sourcefabric z.u. and contributors. # # For the full copyright and license information, please see the # AUTHORS and LICENSE files distributed with this source code, or # at https://www.sourcefabric.org/superdesk/license from eve.uti...
agpl-3.0
AnnalisaS/migration_geonode
geonode/catalogue/backends/pycsw_local.py
8
5656
######################################################################### # # Copyright (C) 2012 OpenPlans # # 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 #...
gpl-3.0
splaice/Virtbox
tests/functional.py
1
1841
# -*- coding: utf-8 -*- """ This module contains the functional tests for using virbox. :copyright: (c) 2012 by Sean Plaice :license: ISC, see LICENSE for more details. """ #import logging #import testify # #from virtbox.manage import ( # modifyvm, # storageattach, # startvm, # ) #from vir...
isc
blueboxgroup/nova
nova/tests/unit/virt/test_imagecache.py
63
7011
# 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 # # Unless required by applicable law ...
apache-2.0
proversity-org/edx-platform
lms/djangoapps/grades/tests/base.py
14
4306
from capa.tests.response_xml_factory import MultipleChoiceResponseXMLFactory from lms.djangoapps.course_blocks.api import get_course_blocks from openedx.core.djangolib.testing.utils import get_mock_request from student.models import CourseEnrollment from student.tests.factories import UserFactory from xmodule.modulesto...
agpl-3.0
aeron15/luigi
test/wrap_test.py
72
2886
# -*- coding: utf-8 -*- # # Copyright 2012-2015 Spotify AB # # 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...
apache-2.0
lbernau/smarthome
tests/mock/core.py
2
6808
import os import datetime import dateutil.tz import logging import lib.config import lib.connection import lib.item import lib.plugin from lib.shtime import Shtime from lib.module import Modules import lib.utils from lib.model.smartplugin import SmartPlugin from lib.constants import (YAML_FILE, CONF_FILE, DEFAULT_F...
gpl-3.0
od-eon/django-fts-odeon
fts/backends/unported/simple.py
2
3124
"Simple Fts backend" import os from django.contrib.contenttypes.models import ContentType from django.contrib.contenttypes import generic from django.db.models import Q from django.db import transaction from fts.backends.base import BaseClass, BaseModel, BaseManager from fts.models import IndexWord, Index ...
bsd-3-clause
haxoza/django
django/contrib/gis/geos/polygon.py
450
6843
from ctypes import byref, c_uint from django.contrib.gis.geos import prototypes as capi from django.contrib.gis.geos.geometry import GEOSGeometry from django.contrib.gis.geos.libgeos import GEOM_PTR, get_pointer_arr from django.contrib.gis.geos.linestring import LinearRing from django.utils import six from django.util...
bsd-3-clause
giltis/scikit-xray
skxray/core/tests/test_calibration.py
3
4493
# ###################################################################### # Copyright (c) 2014, Brookhaven Science Associates, Brookhaven # # National Laboratory. All rights reserved. # # # # @author: Li Li (lili@bnl.g...
bsd-3-clause
Titan-C/scikit-learn
sklearn/linear_model/omp.py
8
31640
"""Orthogonal matching pursuit algorithms """ # Author: Vlad Niculae # # License: BSD 3 clause import warnings import numpy as np from scipy import linalg from scipy.linalg.lapack import get_lapack_funcs from .base import LinearModel, _pre_fit from ..base import RegressorMixin from ..utils import as_float_array, ch...
bsd-3-clause
rentongzhang/servo
tests/wpt/web-platform-tests/tools/html5lib/parse.py
420
8783
#!/usr/bin/env python """usage: %prog [options] filename Parse a document to a tree, with optional profiling """ import sys import os import traceback from optparse import OptionParser from html5lib import html5parser, sanitizer from html5lib.tokenizer import HTMLTokenizer from html5lib import treebuilders, serializ...
mpl-2.0
unifycore/ryu
ryu/ofproto/ofproto_v1_0.py
11
28910
# Copyright (C) 2011, 2012 Nippon Telegraph and Telephone Corporation. # Copyright (C) 2011, 2012 Isaku Yamahata <yamahata at valinux co jp> # # 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 # ...
apache-2.0
bnbowman/MetagenomicTools
src/pbmgx/nucmer/segment.py
2
2790
#! /usr/bin/env python __author__ = 'bbowman@pacificbiosciences.com' class Segment( object ): """ A Class for representing a segment of a Nucmer Alignment """ def __init__(self, start, end, source=None): assert isinstance(start, int) assert isinstance(end, int) assert start !=...
bsd-3-clause
tkhirianov/kpk2016
graphs/input_graph.py
1
2588
import networkx import matplotlib.pyplot as plt def input_edges_list(): """считывает список рёбер в форме: в первой строке N - число рёбер, затем следует N строк из двух слов и одного числа слова - названия вершин, концы ребра, а число - его вес return граф в форме словаря рёбер и соответствую...
gpl-3.0
justinpotts/mozillians
vendor-local/lib/python/markdown/extensions/abbr.py
11
3057
''' Abbreviation Extension for Python-Markdown ========================================== This extension adds abbreviation handling to Python-Markdown. Simple Usage: >>> import markdown >>> text = """ ... Some text with an ABBR and a REF. Ignore REFERENCE and ref. ... ... *[ABBR]: Abb...
bsd-3-clause
jkankiewicz/kivy
examples/canvas/fbo_canvas.py
59
2544
''' FBO Canvas ========== This demonstrates a layout using an FBO (Frame Buffer Off-screen) instead of a plain canvas. You should see a black canvas with a button labelled 'FBO' in the bottom left corner. Clicking it animates the button moving right to left. ''' __all__ = ('FboFloatLayout', ) from kivy.graphics impo...
mit
kogotko/carburetor
horizon/contrib/bootstrap_datepicker.py
87
1584
# 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 to in writing, s...
apache-2.0
Teamxrtc/webrtc-streaming-node
third_party/webrtc/src/chromium/src/tools/swarming_client/swarming.py
1
46560
#!/usr/bin/env python # Copyright 2013 The Swarming Authors. All rights reserved. # Use of this source code is governed under the Apache License, Version 2.0 that # can be found in the LICENSE file. """Client tool to trigger tasks or retrieve results from a Swarming server.""" __version__ = '0.8.2' import collection...
mit
freakynit/kaggle-ndsb
configurations/featharalick_convroll5_preinit_resume_drop@420.py
6
2821
import numpy as np import theano import theano.tensor as T import lasagne as nn import data import load import nn_plankton import dihedral import tmp_dnn import tta features = [ # "hu", # "tutorial", "haralick", # "aaronmoments", # "lbp", # "pftas", # "zernike_moments", # "image_siz...
mit
lgeiger/ide-python
lib/debugger/VendorLib/vs-py-debugger/pythonFiles/jedi/common/context.py
12
1798
class BaseContext(object): def __init__(self, evaluator, parent_context=None): self.evaluator = evaluator self.parent_context = parent_context def get_root_context(self): context = self while True: if context.parent_context is None: return context ...
mit
labcodes/django
django/contrib/gis/gdal/prototypes/ds.py
189
4413
""" This module houses the ctypes function prototypes for OGR DataSource related data structures. OGR_Dr_*, OGR_DS_*, OGR_L_*, OGR_F_*, OGR_Fld_* routines are relevant here. """ from ctypes import POINTER, c_char_p, c_double, c_int, c_long, c_void_p from django.contrib.gis.gdal.envelope import OGREnvelope from djan...
bsd-3-clause
klonage/nlt-gcs
packages/IronPython.StdLib.2.7.4/content/Lib/htmlentitydefs.py
65
18327
"""HTML character entity references.""" # maps the HTML entity name to the Unicode codepoint name2codepoint = { 'AElig': 0x00c6, # latin capital letter AE = latin capital ligature AE, U+00C6 ISOlat1 'Aacute': 0x00c1, # latin capital letter A with acute, U+00C1 ISOlat1 'Acirc': 0x00c2, # latin...
gpl-3.0
zephyrplugins/zephyr
zephyr.plugin.jython/jython2.5.2rc3/Lib/test/test_datetime.py
17
131537
"""Test date/time type. See http://www.zope.org/Members/fdrake/DateTimeWiki/TestCases """ import os import sys import pickle import cPickle import unittest from test import test_support from datetime import MINYEAR, MAXYEAR from datetime import timedelta from datetime import tzinfo from datetime import time from da...
epl-1.0
mkhutornenko/incubator-aurora
src/main/python/apache/aurora/client/binding_helper.py
1
4930
# # 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 ...
apache-2.0
hogarthj/ansible
lib/ansible/modules/network/nxos/nxos_interface_ospf.py
29
17076
#!/usr/bin/python # # 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 distribut...
gpl-3.0
sublime1809/django
tests/generic_views/test_detail.py
19
5272
from __future__ import unicode_literals from django.core.exceptions import ImproperlyConfigured, ObjectDoesNotExist from django.test import TestCase, override_settings from django.views.generic.base import View from .models import Artist, Author, Page @override_settings(ROOT_URLCONF='generic_views.urls') class Deta...
bsd-3-clause
pombredanne/drf-generators
drf_generators/templates/viewset.py
2
2003
__all__ = ['VIEW_SET_URL', 'VIEW_SET_VIEW'] VIEW_SET_URL = """from rest_framework.routers import SimpleRouter from {{ app }} import views router = SimpleRouter() {% for model in models %} router.register(r'{{ model | lower }}', views.{{ model }}ViewSet, '{{model}}'){% endfor %} urlpatterns = router.urls """ VIE...
mit
mioann47/mobile-app-privacy-analyzer
mypythonscripts/AndroBugs_Framework-master/tools/modified/androguard/core/analysis/ganalysis.py
7
112699
# This file is part of Androguard. # # Copyright (C) 2012, Anthony Desnos <desnos at t0t0.fr> # 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...
gpl-3.0
eggplantbren/DNest4
python/dnest4/builder.py
1
7221
from __future__ import print_function import numpy as np from .distributions import * __all__ = ["Model", "Node", "data_declaration", "data_definition",\ "generate_h", "generate_cpp"] class Model: def __init__(self): self.nodes = [] self.indices = {} self.num_params = 0 d...
mit
drpaneas/linuxed.gr
lib/python2.7/site-packages/paramiko/sftp_file.py
34
19081
# Copyright (C) 2003-2007 Robey Pointer <robeypointer@gmail.com> # # This file is part of paramiko. # # Paramiko 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 2.1 of the License, or (a...
mit
akash1808/nova_test_latest
nova/tests/unit/objects/test_bandwidth_usage.py
20
4910
# 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 # d...
apache-2.0
alinbalutoiu/tempest
tempest/services/compute/json/services_client.py
9
2135
# Copyright 2013 NEC Corporation # Copyright 2013 IBM Corp. # 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-...
apache-2.0
acsone/sale-workflow
sale_service_fleet/report/project_report.py
9
1101
# -*- coding: utf-8 -*- # (c) 2015 Antiun Ingeniería S.L. - Sergio Teruel # (c) 2015 Antiun Ingeniería S.L. - Carlos Dauden # License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html from openerp import models, fields from openerp import tools class ReportProjectTaskUser(models.Model): _inherit = 'report.p...
agpl-3.0
fusionpig/ansible
v1/ansible/module_utils/gce.py
305
4179
# This code is part of Ansible, but is an independent component. # This particular file snippet, and this file snippet only, is BSD licensed. # Modules you write using this snippet, which is embedded dynamically by Ansible # still belong to the author of the module, and may assign their own license # to the complete wo...
gpl-3.0
tecnologiaenegocios/tn.plonemailing
src/tn/plonemailing/converter.py
1
2960
from five import grok from htmlentitydefs import entitydefs from plone.intelligenttext.transforms import \ convertHtmlToWebIntelligentPlainText from tn.plonemailing import interfaces import lxml.html import re links_with_href_re = re.compile( r'(?m)<a([^<]+)href="([^<"]+)"([^<]*)>([^<]+)<\/a>', re.IGNOREC...
bsd-3-clause
reedessick/lvalertTest
bin/sanityCheck_FakeDb.py
1
10948
#!/usr/bin/python usage = "sanityCheck_FakeDb.py [--options]" description = "provides unit tests and basic checks of FakeDb functionality" author = "reed.essick@ligo.org" #------------------------------------------------- import os import random from ligoTest.gracedb.rest import FakeDb import simUtils as utils im...
mit
mikebenfield/scipy
benchmarks/benchmarks/go_benchmark_functions/go_funcs_E.py
35
9862
# -*- coding: utf-8 -*- from __future__ import division, print_function, absolute_import from numpy import abs, asarray, cos, exp, arange, pi, sin, sqrt, sum from .go_benchmark import Benchmark class Easom(Benchmark): r""" Easom objective function. This class defines the Easom [1]_ global optimization ...
bsd-3-clause
eeshangarg/oh-mainline
vendor/packages/Django/django/contrib/gis/db/models/query.py
93
36167
from django.db import connections from django.db.models.query import QuerySet, ValuesQuerySet, ValuesListQuerySet from django.contrib.gis import memoryview from django.contrib.gis.db.models import aggregates from django.contrib.gis.db.models.fields import get_srid_info, PointField, LineStringField from django.contrib....
agpl-3.0
lupyuen/RaspberryPiImage
home/pi/GrovePi/Software/Python/others/temboo/Library/YouTube/Channels/ListChannelsByID.py
5
6409
# -*- coding: utf-8 -*- ############################################################################### # # ListChannelsByID # Returns a list of channels that match the list of IDs provided. # # Python versions 2.6, 2.7, 3.x # # Copyright 2014, Temboo Inc. # # Licensed under the Apache License, Version 2.0 (the "Licen...
apache-2.0
YongseopKim/crosswalk-test-suite
wrt/wrt-packertool-android-tests/metacomm/combinatorics/combinatorics.py
33
1259
#=============================================================================== # code from http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/190465 # all (c) etc. are of the authors of this procedures, see link above #=============================================================================== def ...
bsd-3-clause
ezarko/cfn-init
comtypes/test/test_server.py
1
10411
import atexit, os, unittest ##import comtypes import comtypes.typeinfo, comtypes.client class TypeLib(object): """This class collects IDL code fragments and eventually writes them into a .IDL file. The compile() method compiles the IDL file into a typelibrary and registers it. A function is also ...
apache-2.0
XXMrHyde/android_external_chromium_org
native_client_sdk/src/tools/tests/sel_ldr_test.py
104
2080
#!/usr/bin/env python # Copyright 2013 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import os import sys import unittest SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__)) PARENT_DIR = os.path.dirname(SCRIPT_DIR) ...
bsd-3-clause
SciTools/biggus
biggus/tests/integration/test_maths.py
3
1427
# (C) British Crown Copyright 2015 - 2016, Met Office # # This file is part of Biggus. # # Biggus 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, or # (at your option) a...
gpl-3.0
saydulk/django
tests/postgres_tests/test_array.py
70
19822
import decimal import json import unittest import uuid from django import forms from django.core import exceptions, serializers, validators from django.core.management import call_command from django.db import IntegrityError, connection, models from django.test import TransactionTestCase, override_settings from django...
bsd-3-clause
krzysztofwos/BitcoinUnlimited
qa/rpc-tests/mempool_limit.py
8
2293
#!/usr/bin/env python3 # Copyright (c) 2014-2015 The Bitcoin Core developers # Copyright (c) 2015-2017 The Bitcoin Unlimited developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # Test mempool limiting together/eviction with...
mit
otherness-space/myProject002
my_project_002/lib/python2.7/site-packages/django/contrib/localflavor/fr/forms.py
100
2008
""" FR-specific Form helpers """ from __future__ import absolute_import, unicode_literals import re from django.contrib.localflavor.fr.fr_department import DEPARTMENT_CHOICES from django.core.validators import EMPTY_VALUES from django.forms import ValidationError from django.forms.fields import CharField, RegexField,...
mit
bennomadic/django-webid-provider
src/django_webid/provider/webiduri.py
1
3264
import types from django.conf import settings from django.shortcuts import get_object_or_404, render_to_response from django.template import RequestContext, TemplateDoesNotExist from django.utils.decorators import classonlymethod from django_conneg.views import ContentNegotiatedView from django_conneg.decorators impo...
gpl-2.0
JustArchi/program-y
src/programy/config/brain.py
2
8932
""" Copyright (c) 2016 Keith Sterling Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute,...
mit
AnnaWyszomirska/lesson1_1
tests/test_change_in_the contact.py
1
1546
from model.contact import Contact from random import randrange def test_change_in_the_contact(app,db): if len(db.get_contact_list()) == 0: app.contact.add(Contact(bday="//div[@id='content']/form/select[1]//option[4]", bmonth= "//div[@id='content']/form/select[2]//option[3]"...
apache-2.0
EPDCenter/android_kernel_bq_qc
scripts/tracing/draw_functrace.py
14676
3560
#!/usr/bin/python """ Copyright 2008 (c) Frederic Weisbecker <fweisbec@gmail.com> Licensed under the terms of the GNU GPL License version 2 This script parses a trace provided by the function tracer in kernel/trace/trace_functions.c The resulted trace is processed into a tree to produce a more human view of the call ...
gpl-2.0
VaibhavAgarwalVA/sympy
sympy/simplify/powsimp.py
39
26056
from __future__ import print_function, division from collections import defaultdict from sympy.core.function import expand_log, count_ops from sympy.core import sympify, Basic, Dummy, S, Add, Mul, Pow, expand_mul, factor_terms from sympy.core.compatibility import ordered, default_sort_key, reduce from sympy.core.numb...
bsd-3-clause
highweb-project/highweb-webcl-html5spec
build/config/mac/mac_app.py
21
2701
# Copyright (c) 2015 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 argparse import errno import os import subprocess import sys def MakeDirectories(path): try: os.makedirs(path) except OSError as exc: ...
bsd-3-clause
automl/RoBO
robo/acquisition_functions/log_ei.py
1
4117
import logging from scipy.stats import norm import numpy as np from robo.acquisition_functions.base_acquisition import BaseAcquisitionFunction logger = logging.getLogger(__name__) class LogEI(BaseAcquisitionFunction): def __init__(self, model, par=0.0, **kwargs): r""" Computes for a given x th...
bsd-3-clause
40223134/2015cd_midterm
static/Brython3.1.1-20150328-091302/Lib/encodings/aliases.py
726
15414
""" Encoding Aliases Support This module is used by the encodings package search function to map encodings names to module names. Note that the search function normalizes the encoding names before doing the lookup, so the mapping will have to map normalized encoding names to module names. Con...
gpl-3.0
finklabs/banana
tests/test_template.py
1
3235
# -*- coding: utf-8 -*- from __future__ import print_function, unicode_literals import os try: from banana import template TEMPLATE_MISSING = False except ImportError: TEMPLATE_MISSING = True import pytest from .helpers import create_tempfile, cleanup_tempfiles, temp_folder from . import here @pytest.ma...
mit
dotKom/onlineweb4
apps/marks/models.py
1
8113
# -*- coding: utf-8 -*- from datetime import date, datetime, timedelta from django.conf import settings from django.db import models from django.utils import timezone from django.utils.translation import ugettext as _ User = settings.AUTH_USER_MODEL DURATION = 30 # summer starts 1st June, ends 15th August SUMMER = ...
mit
raj-krishnan/PyAlpha
pyalpha/alpha/stock_lists.py
1
23247
""" Contains lists of stocks in the S&P100 and S&P500. NOTE ==== Some of the stocks have been commented out due to errors arising when on attempting to procure their data using ystockquote. ISSUE: https://github.com/cgoldberg/ystockquote/issues/43 """ SNP100 = [ "AAPL", # Apple Inc. "ABBV", # AbbV...
apache-2.0
PXke/invenio
invenio/legacy/websubmit/functions/Print_Success_CPLX.py
4
2815
## This file is part of Invenio. ## Copyright (C) 2007, 2008, 2010, 2011 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 2 of the ## License, or (at your option) any later ...
gpl-2.0
drtconway/bioinfosummer2016
solutions/exercise-2/mlst.py
1
2255
from pykmer.basics import kmers from pykmer.file import readFasta import pykmer.kfset as kfset import gzip import sys def isFasta(nm): """does this filename look like a FASTA file?""" if nm.endswith(".fa"): return True if nm.endswith(".fas"): return True if nm.endswith(".fasta"): ...
apache-2.0
alberto-antonietti/nest-simulator
pynest/examples/hh_phaseplane.py
12
5096
# -*- coding: utf-8 -*- # # hh_phaseplane.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, ...
gpl-2.0
sunze/py_flask
migrations/versions/41a93799080_.py
1
2207
"""empty message Revision ID: 41a93799080 Revises: 1a9765a646b Create Date: 2015-07-02 14:38:39.418104 """ # revision identifiers, used by Alembic. revision = '41a93799080' down_revision = '1a9765a646b' from alembic import op import sqlalchemy as sa from sqlalchemy.dialects import mysql def upgrade(): ### comm...
mit
PyGithub/PyGithub
tests/GitBlob.py
3
3579
############################ Copyrights and license ############################ # # # Copyright 2012 Vincent Jacques <vincent@vincent-jacques.net> # # Copyright 2012 Zearin <zearin@gonk.net> ...
lgpl-3.0
jordanemedlock/psychtruths
temboo/Library/Klout/User/Score.py
5
3024
# -*- coding: utf-8 -*- ############################################################################### # # Score # Retrieves a user's Klout Score and deltas. # # Python versions 2.6, 2.7, 3.x # # Copyright 2014, Temboo Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this fil...
apache-2.0
fritsvanveen/QGIS
python/plugins/processing/algs/qgis/DeleteColumn.py
1
2904
# -*- coding: utf-8 -*- """ *************************************************************************** DeleteColumn.py --------------------- Date : May 2010 Copyright : (C) 2010 by Michael Minn Email : pyqgis at michaelminn dot com ************************...
gpl-2.0
glatard/nipype
nipype/interfaces/slicer/registration/tests/test_auto_VBRAINSDemonWarp.py
9
4045
# AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT from nipype.testing import assert_equal from nipype.interfaces.slicer.registration.specialized import VBRAINSDemonWarp def test_VBRAINSDemonWarp_inputs(): input_map = dict(args=dict(argstr='%s', ), arrayOfPyramidLevelIterations=dict(argstr='--arrayOfPyr...
bsd-3-clause
willusher/ansible-modules-core
system/authorized_key.py
7
17223
#!/usr/bin/python # -*- coding: utf-8 -*- """ Ansible module to add authorized_keys for ssh logins. (c) 2012, Brad Olson <brado@movedbylight.com> 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 ...
gpl-3.0
levinas/assembly
lib/assembly/plugins/bwa.py
2
2226
import os from plugins import BaseAligner from yapsy.IPlugin import IPlugin from asmtypes import ArastDataInputError class BwaAligner(BaseAligner, IPlugin): def run(self, contig_file=None, reads=None, merged_pair=False): ### Data Checks if len(self.data.contigfiles) != 1: raise ArastDa...
mit
Shrhawk/edx-platform
common/lib/xmodule/xmodule/library_content_module.py
10
24844
# -*- coding: utf-8 -*- """ LibraryContent: The XBlock used to include blocks from a library in a course. """ import json from lxml import etree from copy import copy from capa.responsetypes import registry from gettext import ngettext from lazy import lazy from .mako_module import MakoModuleDescriptor from opaque_key...
agpl-3.0
Elettronik/SickRage
lib/tvdb_api/tvdb_ui.py
92
5494
#!/usr/bin/env python2 #encoding:utf-8 #author:dbr/Ben #project:tvdb_api #repository:http://github.com/dbr/tvdb_api #license:unlicense (http://unlicense.org/) """Contains included user interfaces for Tvdb show selection. A UI is a callback. A class, it's __init__ function takes two arguments: - config, which is the ...
gpl-3.0
2uller/LotF
App/Lib/site-packages/pygame/tests/run_tests__tests/print_stdout/fake_2_test.py
75
1178
if __name__ == '__main__': import sys import os pkg_dir = (os.path.split( os.path.split( os.path.split( os.path.abspath(__file__))[0])[0])[0]) parent_dir, pkg_name = os.path.split(pkg_dir) is_pygame_pkg = (pkg_name == 'test...
gpl-2.0
bclau/nova
nova/tests/api/openstack/compute/plugins/v3/test_multiple_create.py
7
19700
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2013 IBM Corp. # 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/licen...
apache-2.0
perkinslr/pypyjs
website/js/pypy.js-0.2.0/lib/modules/test/test_fractions.py
97
24516
"""Tests for Lib/fractions.py.""" from decimal import Decimal from test.test_support import run_unittest import math import numbers import operator import fractions import sys import unittest from copy import copy, deepcopy from cPickle import dumps, loads F = fractions.Fraction gcd = fractions.gcd # decorator for sk...
mit
ahmadRagheb/goldenHR
erpnext/hr/doctype/job_applicant/job_applicant.py
23
1515
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt # For license information, please see license.txt from __future__ import unicode_literals from frappe.model.document import Document import frappe from frappe import _ from frappe.utils impor...
gpl-3.0
carljm/django
django/contrib/gis/utils/layermapping.py
137
27371
# LayerMapping -- A Django Model/OGR Layer Mapping Utility """ The LayerMapping class provides a way to map the contents of OGR vector files (e.g. SHP files) to Geographic-enabled Django models. For more information, please consult the GeoDjango documentation: https://docs.djangoproject.com/en/dev/ref/contrib/gi...
bsd-3-clause