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
shopkeep/shpkpr
tests/marathon/test_client.py
1
6276
# stdlib imports import json import os # third-party imports import mock import pytest import responses # local imports from shpkpr.marathon import ClientError from shpkpr.marathon import DeploymentNotFound from shpkpr.marathon import DryRun from shpkpr.marathon import MarathonClient def _load_json_fixture(name): ...
mit
COSMOGRAIL/COSMOULINE
pipe/3_align_scripts/2a_alignimages.py
1
4429
# # here we do the actual geomap and gregister (pyraf) # we apply this inprinciple to all images gogogo, treatme, and flagali # execfile("../config.py") from kirbybase import KirbyBase, KBError import math from pyraf import iraf from variousfct import * from datetime import datetime, timedelta # As we will tweak th...
gpl-3.0
MridulS/sympy
sympy/solvers/deutils.py
12
10025
"""Utility functions for classifying and solving ordinary and partial differential equations. Contains ======== _preprocess ode_order _desolve """ from __future__ import print_function, division from sympy.core.function import Function, Derivative, AppliedUndef from sympy.core.relational import Equality, Eq from sym...
bsd-3-clause
joshisa/taiga-back
taiga/users/gravatar.py
17
2017
# Copyright (C) 2014 Andrey Antukh <niwi@niwi.be> # Copyright (C) 2014 Jesús Espino <jespinog@gmail.com> # Copyright (C) 2014 David Barragán <bameda@dbarragan.com> # Copyright (C) 2014 Anler Hernández <hello@anler.me> # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU...
agpl-3.0
AIFDR/inasafe
safe/utilities/geonode/test/test_geonode_uploaded.py
6
4637
# coding=utf-8 """Test for uploading a layer to Geonode.""" __copyright__ = "Copyright 2018, The InaSAFE Project" __license__ = "GPL version 3" __email__ = "info@inasafe.org" __revision__ = '$Format:%H$' import os import unittest from safe.definitions.constants import INASAFE_TEST from safe.test.utilities import st...
gpl-3.0
LambdaCast/LambdaCast
portal/migrations/0016_auto__add_field_collection_date.py
1
11744
# -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding field 'Collection.date' db.add_column('portal_collection', 'date', self.gf('d...
bsd-2-clause
ezietsman/seismo
seismo/timeseries.py
1
9364
''' This contains some useful routines I need for finding and analysing frequencies in pulsating star lightcurves ''' import multiprocessing import numpy as np import f90periodogram from scipy.interpolate import interpolate try: import pyopencl as cl OPENCL = True except ImportError: print("opencl not a...
mit
devs1991/test_edx_docmode
venv/lib/python2.7/site-packages/sorl/thumbnail/conf/defaults.py
16
3616
from __future__ import unicode_literals from django.conf import settings # When True ThumbnailNode.render can raise errors THUMBNAIL_DEBUG = False # Backend THUMBNAIL_BACKEND = 'sorl.thumbnail.base.ThumbnailBackend' # Key-value store, ships with: # sorl.thumbnail.kvstores.cached_db_kvstore.KVStore # sorl.thumbnail.k...
agpl-3.0
SusannaMaria/beets
test/test_embyupdate.py
16
10149
# -*- coding: utf-8 -*- from __future__ import division, absolute_import, print_function from test.helper import TestHelper from beetsplug import embyupdate import unittest import responses class EmbyUpdateTest(unittest.TestCase, TestHelper): def setUp(self): self.setup_beets() self.load_plugins...
mit
horizontracy/rpi_tool
api/venv/lib/python2.7/site-packages/markupsafe/tests.py
674
6107
# -*- coding: utf-8 -*- import gc import sys import unittest from markupsafe import Markup, escape, escape_silent from markupsafe._compat import text_type class MarkupTestCase(unittest.TestCase): def test_adding(self): # adding two strings should escape the unsafe one unsafe = '<script type="appl...
mit
chrislyon/dj_ds1
static/Brython3.2.0-20150701-214155/Lib/test/unittests/test_pkg.py
34
9611
# Test packages (dotted-name import) import sys import os import tempfile import textwrap import unittest from test import support # Helpers to create and destroy hierarchies. def cleanout(root): names = os.listdir(root) for name in names: fullname = os.path.join(root, name) if os.path.isdir...
gpl-2.0
mdepak/ML-practice
naive_bayes_classifier/com/mdepak/ml/classifier/classifier.py
1
2346
import random import re import sys from collections import Counter, defaultdict from math import log def tokenize(text): """Break up text into words""" return re.findall('[a-z0-9]+', text) def read_training_file(filename): priors = Counter() likelihood = defaultdict(Counter) with open(filename)...
apache-2.0
uclmr/inferbeddings
scripts/guo-fb122/UCL_GUO-FB122_adv_xshot-head_v1.py
1
4374
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import itertools import os import os.path import sys import argparse import logging def cartesian_product(dicts): return (dict(zip(dicts, x)) for x in itertools.product(*dicts.values())) def summary(configuration): kvs = sorted([(k, v) for k, v in configurati...
mit
turon/openthread
tools/harness-automation/cases/leader_5_1_5.py
1
1877
#!/usr/bin/env python # # Copyright (c) 2016, The OpenThread Authors. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # 1. Redistributions of source code must retain the above copyright # notic...
bsd-3-clause
Drooids/odoo
addons/web_graph/controllers/main.py
251
3561
from openerp import http import simplejson from openerp.http import request, serialize_exception as _serialize_exception from cStringIO import StringIO from collections import deque try: import xlwt except ImportError: xlwt = None class TableExporter(http.Controller): @http.route('/web_graph/check_xlwt',...
agpl-3.0
Pexego/PXGO_00019_2014_BU
project-addons/custom_documents/account.py
1
1521
# -*- coding: utf-8 -*- ############################################################################## # # Copyright (C) 2014 Pexego All Rights Reserved # $Jesús Ventosinos Mayor <jesus@pexego.es>$ # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affer...
agpl-3.0
flgiordano/netcash
+/google-cloud-sdk/lib/googlecloudsdk/third_party/appengine/api/apiproxy_stub_map.py
7
25678
# # Copyright 2006 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 o...
bsd-3-clause
dhananjay92/servo
tests/wpt/web-platform-tests/tools/html5lib/html5lib/treebuilders/_base.py
715
13699
from __future__ import absolute_import, division, unicode_literals from six import text_type from ..constants import scopingElements, tableInsertModeElements, namespaces # The scope markers are inserted when entering object elements, # marquees, table cells, and table captions, and are used to prevent formatting # fr...
mpl-2.0
boyuegame/kbengine
kbe/res/scripts/common/Lib/site-packages/setuptools/command/sdist.py
72
8346
import os import re import sys from glob import glob import pkg_resources from distutils.command.sdist import sdist as _sdist from distutils.util import convert_path from distutils import log from setuptools import svn_utils READMES = ('README', 'README.rst', 'README.txt') def walk_revctrl(dirname=''): """Find ...
lgpl-3.0
TansyArron/pants
src/python/pants/backend/jvm/tasks/scaladoc_gen.py
6
1945
# coding=utf-8 # Copyright 2014 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import (absolute_import, division, generators, nested_scopes, print_function, unicode_literals, with_statement) from pants.backend.j...
apache-2.0
ABaldwinHunter/django-clone-classic
django/contrib/auth/context_processors.py
189
1939
# PermWrapper and PermLookupDict proxy the permissions system into objects that # the template system can understand. class PermLookupDict(object): def __init__(self, user, app_label): self.user, self.app_label = user, app_label def __repr__(self): return str(self.user.get_all_permissions()) ...
bsd-3-clause
studyindenmark/newscontrol
feedparser.py
89
166583
"""Universal feed parser Handles RSS 0.9x, RSS 1.0, RSS 2.0, CDF, Atom 0.3, and Atom 1.0 feeds Visit https://code.google.com/p/feedparser/ for the latest version Visit http://packages.python.org/feedparser/ for the latest documentation Required: Python 2.4 or later Recommended: iconv_codec <http://cjkpython.i18n.org...
mit
phpcanada/phpcanada
src/AppBundle/Resources/private/node_modules/gulp-sass/node_modules/node-sass/node_modules/node-gyp/gyp/pylib/gyp/generator/xcode.py
1363
58344
# 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. import filecmp import gyp.common import gyp.xcodeproj_file import gyp.xcode_ninja import errno import os import sys import posixpath import re import shutil import...
mit
40223148/2015cd_midterm
static/Brython3.1.0-20150301-090019/Lib/reprlib.py
923
5110
"""Redo the builtin repr() (representation) but with limits on most sizes.""" __all__ = ["Repr", "repr", "recursive_repr"] import builtins from itertools import islice try: from _thread import get_ident except ImportError: from _dummy_thread import get_ident def recursive_repr(fillvalue='...'): 'Decorato...
gpl-3.0
horance-liu/tensorflow
tensorflow/contrib/estimator/python/estimator/head_test.py
11
39352
# 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
anugrah-saxena/pycroscopy
pycroscopy/processing/svd_utils.py
1
13152
# -*- coding: utf-8 -*- """ Created on Mon Mar 28 09:45:08 2016 @author: Suhas Somnath, Chris Smith """ from __future__ import division, print_function, absolute_import import time from warnings import warn from multiprocessing import cpu_count import numpy as np from sklearn.utils import gen_batches from sklearn.uti...
mit
adityacs/ansible
lib/ansible/modules/storage/netapp/netapp_e_snapshot_group.py
45
15206
#!/usr/bin/python # (c) 2016, NetApp, Inc # # 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
abdoosh00/edx-platform
common/lib/xmodule/xmodule/tests/test_lti_unit.py
17
18462
# -*- coding: utf-8 -*- """Test for LTI Xmodule functional logic.""" from mock import Mock, patch, PropertyMock import textwrap from lxml import etree from webob.request import Request from copy import copy import urllib from xmodule.lti_module import LTIDescriptor from xmodule.lti_2_util import LTIError from . imp...
agpl-3.0
srifqi/three.js
utils/exporters/blender/addons/io_three/exporter/api/texture.py
97
3680
from bpy import data, types from .. import constants, logger from .constants import IMAGE, MAG_FILTER, MIN_FILTER, MAPPING from . import image def _texture(func): """ :param func: """ def inner(name, *args, **kwargs): """ :param name: :param *args: :param **kwargs: ...
mit
HewlettPackard/oneview-redfish-toolkit
oneview_redfish_toolkit/api/network_interface_collection.py
1
2511
# -*- coding: utf-8 -*- # Copyright (2017-2018) 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/licenses/LICENSE-2.0 # # U...
apache-2.0
WillianPaiva/1flow
oneflow/core/management/commands/dump_processors.py
1
4051
# -*- coding: utf-8 -*- u""" Copyright 2015 Olivier Cortès <oc@1flow.io>. This file is part of the 1flow project. 1flow 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 ...
agpl-3.0
bzennn/blog_flask
python/lib/python3.5/site-packages/sqlalchemy/orm/state.py
32
27492
# orm/state.py # Copyright (C) 2005-2017 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 """Defines instrumentation of instances. This module is usually not directly visible t...
gpl-3.0
Open-Source-Coins/smart-dat
contrib/pyminer/pyminer.py
766
6434
#!/usr/bin/python # # Copyright (c) 2011 The Bitcoin developers # Distributed under the MIT/X11 software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # import time import json import pprint import hashlib import struct import re import base64 import httplib import...
mit
pyrrho314/recipesystem
trunk/astrodata/Proxies.py
1
9143
import os import time import select import socket import xmlrpclib import subprocess from time import sleep from pprint import pformat from SimpleXMLRPCServer import SimpleXMLRPCServer from astrodata.adutils import logutils from astrodata.Errors import ADCCCommunicationError # --------------------------------------...
mpl-2.0
gojira/tensorflow
tensorflow/python/kernel_tests/linalg/linear_operator_lower_triangular_test.py
9
3428
# 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
mjjohnson/django-u2f
django_u2f/forms.py
2
2412
import django from django import forms from django.core.exceptions import ValidationError, NON_FIELD_ERRORS class KeyResponseForm(forms.Form): response = forms.CharField() if django.get_version() < (1, 7): def add_error(self, field, error): """ Update the content of `self._err...
bsd-2-clause
MichaelNedzelsky/intellij-community
python/helpers/profiler/thrift/server/THttpServer.py
164
3145
# # 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 u...
apache-2.0
tschul/SuraHeinz
src/bot.py
1
1117
import logging as l import random from src.reddit import RedditPRAW from src.twitter_api import Twitter from src.utils import authenticate_reddit, generate_tweet_from_reddit class Bot: user = dict() twitter = object reddit = object cfg = dict() def __init__(self, config): self.cfg = con...
apache-2.0
harrissoerja/vumi
vumi/scripts/tests/test_inject_messages.py
3
2654
import StringIO import json from twisted.internet.defer import inlineCallbacks from vumi.scripts.inject_messages import MessageInjector from vumi.tests.helpers import VumiTestCase, WorkerHelper class TestMessageInjector(VumiTestCase): DEFAULT_DATA = { 'content': 'CODE2', 'transport_type': 'sms'...
bsd-3-clause
UXE/local-edx
lms/djangoapps/notes/models.py
50
3152
from django.db import models from django.contrib.auth.models import User from django.core.urlresolvers import reverse from django.core.exceptions import ValidationError from django.utils.html import strip_tags import json from xmodule_django.models import CourseKeyField class Note(models.Model): user = models.Fo...
agpl-3.0
jabesq/home-assistant
homeassistant/components/mobile_app/sensor.py
7
2104
"""Sensor platform for mobile_app.""" from functools import partial from homeassistant.const import CONF_WEBHOOK_ID from homeassistant.core import callback from homeassistant.helpers.dispatcher import async_dispatcher_connect from .const import (ATTR_SENSOR_STATE, ATTR_SENSOR_TYPE_SENSOR as ENTITY...
apache-2.0
captainpete/rethinkdb
test/rql_test/connections/http_support/werkzeug/posixemulation.py
147
3543
# -*- coding: utf-8 -*- r""" werkzeug.posixemulation ~~~~~~~~~~~~~~~~~~~~~~~ Provides a POSIX emulation for some features that are relevant to web applications. The main purpose is to simplify support for systems such as Windows NT that are not 100% POSIX compatible. Currently this only imple...
agpl-3.0
axltxl/kaoru
kaoru/command.py
1
2263
# -*- coding: utf-8 -*- """ kaoru.commands ~~~~~~~~ Command handlers :copyright: (c) 2015 by Alejandro Ricoveri :license: MIT, see LICENSE for more details. """ from . import log from .commands import ( about, start, hello, help, screenlock, screenshot, dryrun, cancel, poweroff,...
mit
mogoweb/webkit_for_android5.1
webkit/Tools/Scripts/webkitpy/layout_tests/layout_package/single_test_runner.py
15
14825
# Copyright (C) 2011 Google Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the ...
apache-2.0
Elettronik/SickRage
lib/requests/packages/urllib3/contrib/pyopenssl.py
43
15231
""" SSL with SNI_-support for Python 2. Follow these instructions if you would like to verify SSL certificates in Python 2. Note, the default libraries do *not* do certificate checking; you need to do additional work to validate certificates yourself. This needs the following packages installed: * pyOpenSSL (tested w...
gpl-3.0
CheckYourScreen/Arsenic.Kernel_onyx-oos
tools/perf/scripts/python/failed-syscalls-by-pid.py
11180
2058
# failed 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 failed system call totals, broken down by pid. # If a [comm] arg is specified, only syscalls called by [comm] are displayed. import os import sys sys.pa...
gpl-2.0
40223136/2015cd_0505
static/Brython3.1.1-20150328-091302/Lib/xml/sax/__init__.py
637
3505
"""Simple API for XML (SAX) implementation for Python. This module provides an implementation of the SAX 2 interface; information about the Java version of the interface can be found at http://www.megginson.com/SAX/. The Python version of the interface is documented at <...>. This package contains the following modu...
agpl-3.0
zhangxq5012/sky_engine
sky/tools/webkitpy/common/read_checksum_from_png.py
207
1877
# Copyright (c) 2011 Google Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the ...
bsd-3-clause
blckshrk/Weboob
weboob/applications/qhavedate/contacts.py
3
22538
# -*- coding: utf-8 -*- # Copyright(C) 2010-2011 Romain Bignon # # 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 License, or # (at your...
agpl-3.0
Maspear/odoo
addons/resource/faces/resource.py
433
25890
#@+leo-ver=4 #@+node:@file resource.py #@@language python #@<< Copyright >> #@+node:<< Copyright >> ############################################################################ # Copyright (C) 2005, 2006, 2007, 2008 by Reithinger GmbH # mreithinger@web.de # # This file is part of faces. # # faces is free softwa...
agpl-3.0
doheekim/chuizonetest
lib/setuptools/tests/test_test.py
42
3697
# -*- coding: UTF-8 -*- """develop tests """ import os import shutil import site import sys import tempfile import unittest from distutils.errors import DistutilsError from setuptools.compat import StringIO, PY2 from setuptools.command.test import test from setuptools.command import easy_install as easy_install_pkg f...
apache-2.0
vtslab/sensafety-midterm
ilp/Libxml2_Library/Downloads/libxml2-2.9.1/python/tests/nsdel.py
32
1589
#!/usr/bin/python -u # # this test exercise the XPath basic engine, parser, etc, and # allows to detect memory leaks # import sys import libxml2 instance="""<?xml version="1.0"?> <tag xmlns:foo='urn:foo' xmlns:bar='urn:bar' xmlns:baz='urn:baz' />""" def namespaceDefs(node): n = node.nsDefs() while n: ...
apache-2.0
nemesisdesign/django
tests/gis_tests/geos_tests/test_geos.py
17
54175
from __future__ import unicode_literals import ctypes import json import random from binascii import a2b_hex, b2a_hex from io import BytesIO from unittest import skipUnless from django.contrib.gis import gdal from django.contrib.gis.gdal import HAS_GDAL from django.contrib.gis.geos import ( HAS_GEOS, GeometryColl...
bsd-3-clause
zhujzhuo/Sahara
sahara/tests/unit/service/validation/test_cluster_create_validation.py
8
26342
# Copyright (c) 2013 Mirantis Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writ...
apache-2.0
kgn/cssutils
src/tests/test_cssimportrule.py
1
18623
"""Testcases for cssutils.css.CSSImportRule""" __version__ = '$Id$' import xml.dom import test_cssrule import cssutils class CSSImportRuleTestCase(test_cssrule.CSSRuleTestCase): def setUp(self): super(CSSImportRuleTestCase, self).setUp() self.r = cssutils.css.CSSImportRule() self.rRO = cs...
gpl-3.0
Mchakravartula/rockstor-core
src/rockstor/storageadmin/views/disk_smart.py
1
5886
""" Copyright (c) 2012-2013 RockStor, Inc. <http://rockstor.com> This file is part of RockStor. RockStor 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 la...
gpl-3.0
andresailer/DIRAC
AccountingSystem/private/Policies/FilterExecutor.py
19
1394
import types from DIRAC import S_OK, S_ERROR, gLogger class FilterExecutor: ALLKW = "all" def __init__( self ): self.__filters = {} self.__globalFilters = [] def applyFilters( self, iD, credDict, condDict, groupingList ): filters2Apply = list( self.__globalFilters ) if iD in self.__filters: ...
gpl-3.0
drtconway/pykmer
pykmer/codec64.py
1
3404
""" A 64-bit word based codec. The 64-bit word is divided in to 4 tag bits in the low-order positions, and the remaining 60 bits are divided in to equal sized codes: Number Width 1 60 2 30 3 20 4 15 5 12 6 10 7 8 8 7 10 6 12 5 15 4 20 3 30 ...
apache-2.0
openstack/glance
glance/async_/flows/ovf_process.py
1
11064
# Copyright 2015 Intel Corporation # 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
zokis/mapa_do_cidadao
mapa_cidadao/mapa_cidadao/core/utils.py
1
1833
# coding: utf-8 import json from os.path import join from unicodedata import normalize from django.conf import settings from django.core.cache import cache from django.core.serializers.json import DjangoJSONEncoder from municipios.models import Municipio MUNICIPIO_ID = getattr(settings, 'MUNICIPIO_ID', 3549904) MUNI...
mit
SujaySKumar/django
tests/admin_filters/tests.py
86
44461
from __future__ import unicode_literals import datetime from django.contrib.admin import ( AllValuesFieldListFilter, BooleanFieldListFilter, ModelAdmin, RelatedOnlyFieldListFilter, SimpleListFilter, site, ) from django.contrib.admin.views.main import ChangeList from django.contrib.auth.admin import UserAdmin ...
bsd-3-clause
RPGOne/Skynet
scikit-learn-0.18.1/sklearn/linear_model/tests/test_base.py
83
15089
# Author: Alexandre Gramfort <alexandre.gramfort@inria.fr> # Fabian Pedregosa <fabian.pedregosa@inria.fr> # # License: BSD 3 clause import numpy as np from scipy import sparse from scipy import linalg from itertools import product from sklearn.utils.testing import assert_array_almost_equal from sklearn.utils...
bsd-3-clause
easyw/kicad-3d-models-in-freecad
cadquery/FCAD_script_generator/Buzzer_Beeper/cq_parameters.py
1
1472
#!/usr/bin/python # -*- coding: utf-8 -*- # # This is derived from a cadquery script for generating QFP/GullWings models in X3D format. # # from https://bitbucket.org/hyOzd/freecad-macros # author hyOzd # ## file of parametric definitions import collections from collections import namedtuple import FreeCAD, Draft, F...
gpl-2.0
Sidney84/pa-chromium
media/tools/bug_hunter/bug_hunter_unittest.py
47
6473
# 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. """Unit Tests for bug hunter.""" import logging from optparse import Values import smtplib import sys import unittest from bug_hunter import BugHunter ...
bsd-3-clause
toontownfunserver/Panda3D-1.9.0
python/Lib/site-packages/pip/vcs/mercurial.py
392
5820
import os import tempfile import re import sys from pip.util import call_subprocess from pip.util import display_path, rmtree from pip.log import logger from pip.vcs import vcs, VersionControl from pip.download import path_to_url from pip.backwardcompat import ConfigParser class Mercurial(VersionControl): name = ...
bsd-3-clause
KaranToor/MA450
google-cloud-sdk/lib/surface/datastore/create_indexes.py
6
2465
# Copyright 2013 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ag...
apache-2.0
felipenaselva/felipe.repository
plugin.video.streamhub/resources/lib/sources/en/ddlvalley.py
1
6574
# -*- coding: utf-8 -*- ''' Covenant Add-on 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 prog...
gpl-2.0
hyuh/m7-wls
tools/perf/python/twatch.py
7370
1334
#! /usr/bin/python # -*- python -*- # -*- coding: utf-8 -*- # twatch - Experimental use of the perf python interface # Copyright (C) 2011 Arnaldo Carvalho de Melo <acme@redhat.com> # # This application is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License...
gpl-2.0
rodrigosurita/GDAd
sdaps/reporttex/__init__.py
1
1689
# -*- coding: utf8 -*- # SDAPS - Scripts for data acquisition with paper based surveys # Copyright(C) 2008, Christoph Simon <post@christoph-simon.eu> # Copyright(C) 2008, 2011, Benjamin Berg <benjamin@sipsolutions.net> # # This program is free software: you can redistribute it and/or modify # it under the terms of the ...
gpl-3.0
robbymeals/scikit-learn
examples/neighbors/plot_nearest_centroid.py
264
1804
""" =============================== Nearest Centroid Classification =============================== Sample usage of Nearest Centroid classification. It will plot the decision boundaries for each class. """ print(__doc__) import numpy as np import matplotlib.pyplot as plt from matplotlib.colors import ListedColormap f...
bsd-3-clause
SurfaceTemp/ISTI_Clean_Worlds
Geography.py
1
3009
#!/usr/local/sci/bin/python #*************************************** # Code to work out useful things from spatial data: # #1. TwoPointDistanceKm # Distance between two points in space in km # Needs latitudes (-90 to 90) and longitudes (-180 to 180) # www.johndcook.com/python_longitude_latotude.html # 6 June 2...
cc0-1.0
Spacecup/shadowsocks
shadowsocks/encrypt.py
990
5180
#!/usr/bin/env python # # Copyright 2012-2015 clowwindy # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable la...
apache-2.0
gbraad/git-repo
subcmds/cherry_pick.py
40
3432
# # Copyright (C) 2010 The Android Open Source Project # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable la...
apache-2.0
puzan/ansible
lib/ansible/plugins/shell/fish.py
45
4770
# (c) 2014, Chris Church <chris@ninemoreminutes.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 Software Foundation, either version 3 of the License, or # (at your option) any lat...
gpl-3.0
monikagrabowska/osf.io
api_tests/base/test_throttling.py
12
4480
import pytest import mock from nose.tools import * # flake8: noqa from api.base.settings.defaults import API_BASE from tests.base import ApiTestCase from osf_tests.factories import AuthUserFactory, ProjectFactory pytestmark = pytest.mark.skip('Unskip when throttling no longer fails on travis') class TestDefaultT...
apache-2.0
phievo/phievo
Examples/immune/Immune/test_network.py
1
2700
#from run_evolution import * from classes_eds2 import * from mutation import * from interaction_pMHC import * from phievo.Networks.deriv2 import * from initialization_pMHC import * import random seed=int(random.random()*100000) g=random.Random(seed) # initializing the network. L=Mutable_Network(g) L.activator_...
lgpl-3.0
yaniv14/OpenCommunity
src/users/south_migrations/0003_auto__add_field_invitation_name.py
3
9497
# -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding field 'Invitation.name' db.add_column(u'users_invitation', 'name', self.gf('d...
bsd-3-clause
sudheesh001/oh-mainline
vendor/packages/scrapy/scrapy/core/downloader/handlers/__init__.py
19
1193
"""Download handlers for different schemes""" from scrapy.exceptions import NotSupported, NotConfigured from scrapy.utils.httpobj import urlparse_cached from scrapy.conf import settings from scrapy.utils.misc import load_object class DownloadHandlers(object): def __init__(self): self._handlers = {} ...
agpl-3.0
sunweaver/ganetimgr
auditlog/signals.py
3
1715
# -*- coding: utf-8 -*- # Copyright (C) 2010-2014 GRNET S.A. # # 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...
gpl-3.0
GinnyN/towerofdimensions-django
tests/modeltests/field_subclassing/fields.py
28
2109
from django.db import models from django.utils import simplejson as json from django.utils.encoding import force_unicode class Small(object): """ A simple class to show that non-trivial Python objects can be used as attributes. """ def __init__(self, first, second): self.first, self.second...
bsd-3-clause
repotvsupertuga/tvsupertuga.repository
script.vodextende/scrapers/mintmovies_scraper.py
6
3599
""" SALTS XBMC Addon Copyright (C) 2014 tknorris 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. T...
gpl-2.0
dfunckt/django
tests/check_framework/test_database.py
42
2085
import unittest from django.core.checks import Tags, run_checks from django.core.checks.registry import CheckRegistry from django.db import connection from django.test import TestCase, mock class DatabaseCheckTests(TestCase): @property def func(self): from django.core.checks.database import check_dat...
bsd-3-clause
nathanielvarona/airflow
tests/providers/google/cloud/hooks/test_secret_manager.py
1
3599
# pylint: disable=no-member # # 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 (t...
apache-2.0
googleinterns/wss
third_party/deeplab/core/nas_genotypes.py
1
1804
# Lint as: python2, python3 # 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 # #...
apache-2.0
haihala/sagum
client/client.py
1
8231
from pygame.rect import * import pygame import math from player import * import socket import threading import object from mapper import * from hud import * x = pygame.init() if not x == (6, 0): print "Failed pygame init" sys.exit(1) def collides(a): # returns a boolean, if a collides with any object glo...
bsd-2-clause
cobalys/django
django/template/base.py
2
49883
from __future__ import absolute_import, unicode_literals import re from functools import partial from inspect import getargspec from django.conf import settings from django.template.context import (Context, RequestContext, ContextPopException) from django.utils.importlib import import_module from django.utils.ite...
bsd-3-clause
omaciel/robottelo
tests/foreman/api/test_filter.py
3
2493
"""Unit tests for the ``filters`` paths. An API reference is available here: http://theforeman.org/api/apidoc/v2/filters.html :Requirement: Filter :CaseAutomation: Automated :CaseLevel: Acceptance :CaseComponent: UsersRoles :TestType: Functional :CaseImportance: High :Upstream: No """ from nailgun import entit...
gpl-3.0
sve-odoo/odoo
addons/account_followup/report/account_followup_report.py
382
4561
# -*- 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
Pexego/odoo
addons/account_budget/wizard/account_budget_crossovered_summary_report.py
373
2191
# -*- 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
vdods/fabric
bddtests/steps/bdd_compose_util.py
3
10262
# # Copyright IBM Corp. 2016 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 ...
apache-2.0
jptomo/rpython-lang-scheme
rpython/rlib/rsre/test/test_char.py
1
7711
from rpython.rlib.rsre import rsre_char from rpython.rlib.rsre.rsre_char import SRE_FLAG_LOCALE, SRE_FLAG_UNICODE def setup_module(mod): from rpython.rlib.unicodedata import unicodedb rsre_char.set_unicode_db(unicodedb) UPPER_PI = 0x3a0 LOWER_PI = 0x3c0 INDIAN_DIGIT = 0x966 ROMAN_NUMERAL = 0x2165 FULLWIDTH_DI...
mit
matejc/searx
tests/unit/test_results.py
11
1225
# -*- coding: utf-8 -*- from searx.results import ResultContainer from searx.testing import SearxTestCase def fake_result(url='https://aa.bb/cc?dd=ee#ff', title='aaa', content='bbb', engine='wikipedia', **kwargs): result = {'url': url, 'title': title,...
agpl-3.0
AlanD88/website
web2py/gluon/sqlhtml.py
8
148256
#!/usr/bin/env python # -*- coding: utf-8 -*- """ | This file is part of the web2py Web Framework | Copyrighted by Massimo Di Pierro <mdipierro@cs.depaul.edu> | License: LGPLv3 (http://www.gnu.org/licenses/lgpl.html) Holds: - SQLFORM: provide a form for a table (with/without record) - SQLTABLE: provides a table for ...
mit
hzhao/gensim
gensim/corpora/hashdictionary.py
51
9719
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright (C) 2012 Homer Strong, Radim Rehurek # Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html """ This module implements the `"hashing trick" <http://en.wikipedia.org/wiki/Hashing-Trick>`_ -- a mapping between words and their integer ids us...
gpl-3.0
zstyblik/infernal-twin
build/pillow/PIL/ImageChops.py
113
6184
# # The Python Imaging Library. # $Id$ # # standard channel operations # # History: # 1996-03-24 fl Created # 1996-08-13 fl Added logical operations (for "1" images) # 2000-10-12 fl Added offset method (from Image.py) # # Copyright (c) 1997-2000 by Secret Labs AB # Copyright (c) 1996-2000 by Fredrik Lundh # # See...
gpl-3.0
afable/HealthyTweets
src/wordcount.py
1
3740
""" wordcount.py will count the number of states that are tweeting about health words """ import MapReduce import sys ## abbreviation and full dictionaries swapping state full names and their abbreviations abrTable = { 'AK': 'Alaska', 'AL': 'Alabama', 'AR': 'Arkansas', 'AS': 'American Samoa', 'AZ': 'Arizona', 'C...
lgpl-3.0
studentisgss/booking
authentication/urls.py
1
2077
"""auth URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/1.8/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-based ...
gpl-3.0
pangtouyu/flasky
app/auth/forms.py
111
3139
from flask.ext.wtf import Form from wtforms import StringField, PasswordField, BooleanField, SubmitField from wtforms.validators import Required, Length, Email, Regexp, EqualTo from wtforms import ValidationError from ..models import User class LoginForm(Form): email = StringField('Email', validators=[Required(),...
mit
crobinso/virt-manager
tests/test_osdict.py
2
3554
# Copyright (C) 2013 Red Hat, Inc. # # This work is licensed under the GNU GPLv2 or later. # See the COPYING file in the top-level directory. import pytest from virtinst import Guest from virtinst import OSDB from virtinst import xmlutil from virtinst.install import urldetect from tests import utils ##############...
gpl-2.0
lnln1111/huhamhire-hosts
gui/__doc__.py
24
6277
#!/usr/bin/env python # -*- coding: utf-8 -*- # # __doc__.py : Document in reST format of gui module. # # Copyleft (C) 2014 - huhamhire <me@huhamhire.com> # ===================================================================== # Licensed under the GNU General Public License, version 3. You should # have received a cop...
gpl-3.0