code
stringlengths
2
1.05M
repo_name
stringlengths
5
104
path
stringlengths
4
251
language
stringclasses
1 value
license
stringclasses
15 values
size
int32
2
1.05M
# Copyright 2019 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
googleapis/python-bigquery
samples/tests/test_client_query_w_array_params.py
Python
apache-2.0
792
import os import struct from JumpScale import j import JumpScale.baselib.serializers j.application.start("blowfishtest") from random import randrange msg = "" for i in range(1000): msg += chr(randrange(0, 256)) key = "" for i in range(56): key += chr(randrange(0, 256)) # b means blowfish s = j.db.serial...
Jumpscale/jumpscale_examples7
examples/serializers/blowfishtest.py
Python
apache-2.0
482
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'resources/templates/window_settings.ui' # # Created by: PyQt5 UI code generator 5.5.1 # # WARNING! All changes made in this file will be lost! from PyQt5 import QtCore, QtGui, QtWidgets class Ui_Dialog(object): def setupUi(self, Dialog...
GandaG/fomod-designer
src/ui_templates/window_settings.py
Python
apache-2.0
48,001
#!/usr/bin/env python # # Copyright 2007 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law o...
wgrose/leanto
google/appengine/api/memcache/memcache_stub.py
Python
apache-2.0
8,211
# Copyright (c) 2006-2014 LOGILAB S.A. (Paris, FRANCE) <contact@logilab.fr> # Copyright (c) 2014-2016 Claudiu Popa <pcmanticore@gmail.com> # Copyright (c) 2014 Google, Inc. # Licensed under the LGPL: https://www.gnu.org/licenses/old-licenses/lgpl-2.1.en.html # For details: https://github.com/PyCQA/astroid/blob/master/...
arju88nair/projectCulminate
venv/lib/python3.5/site-packages/astroid/__pkginfo__.py
Python
apache-2.0
2,173
import pytest from plenum.common.messages.node_messages import CatchupReq from stp_core.common.log import getlogger from plenum.test.helper import sdk_send_random_and_check logger = getlogger() ledger_id = 1 def test_receive_incorrect_catchup_request_with_end_greater_catchuptill(looper, ...
evernym/zeno
plenum/test/node_catchup/test_incorrect_catchup_request.py
Python
apache-2.0
3,607
import sys sys.path.insert(1, "../../../") import h2o def iris_ignore(ip,port): # Connect to h2o h2o.init(ip,port) iris = h2o.import_frame(path=h2o.locate("smalldata/iris/iris2.csv")) for maxx in range(4): model = h2o.random_forest(y=iris[4], x=iris[range(maxx+1)], ntrees=50, max_depth=100) ...
bikash/h2o-dev
h2o-py/tests/testdir_algos/rf/pyunit_iris_ignoreRF.py
Python
apache-2.0
405
from traductor.translators.base import BaseTranslator class Expose(BaseTranslator): """ """ def translate(self, value): """ :param value: :return: """ if type(value) is not list: return "" return "--expose=%s" % " --expose=".join(value)
the0rem/traductor
traductor/translators/expose.py
Python
apache-2.0
311
# 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...
keedio/sahara
sahara/tests/unit/service/validation/test_cluster_scaling_validation.py
Python
apache-2.0
13,492
# Copyright 2013 IBM Corp. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed t...
HybridF5/jacket
jacket/db/storage/sqlalchemy/migrate_repo/versions/022_add_reason_column_to_service.py
Python
apache-2.0
890
# Copyright 2018 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
seanli9jan/tensorflow
tensorflow/contrib/distribute/__init__.py
Python
apache-2.0
2,776
# -*- coding: utf-8 -*- # 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, softw...
openstack-packages/DLRN
dlrn/tests/test_driver_koji.py
Python
apache-2.0
24,497
# Copyright 2013 VMware, 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 a...
alexandrucoman/vbox-neutron-agent
neutron/plugins/vmware/extensions/qos.py
Python
apache-2.0
7,927
# Copyright 2014 NEC Technologies India Ltd. # 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...
cisco-openstack/tempest
tempest/api/compute/admin/test_floating_ips_bulk.py
Python
apache-2.0
3,760
# 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...
joshua-cogliati-inl/raven
tests/framework/unit_tests/utils/testTreeStructure.py
Python
apache-2.0
8,503
from model.group import Group def test_modify_group_name(app): if app.group.count() == 0: app.group.create(Group(name="testing")) app.group.modify_first_group(Group(name="NewGroup")) def test_modify_group_header(app): if app.group.count() == 0: app.group.create(Group(name="testing")) ...
Manolaru/Python_train
Les_3/Task_9/test/test_modify_group.py
Python
apache-2.0
554
# Copyright 2017, David Wilson # # 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 notice, # this list of conditions and the following disclaimer. # # 2....
edwinsteele/biblebox-pi
ansible/plugins/mitogen-0.2.2/ansible_mitogen/services.py
Python
apache-2.0
16,202
from numpy import unravel_index, prod, arange, asarray, float64 from itertools import product from bolt.construct import ConstructBase from bolt.spark.array import BoltArraySpark from bolt.spark.utils import get_kv_shape, get_kv_axes class ConstructSpark(ConstructBase): @staticmethod def array(a, context=N...
bolt-project/bolt
bolt/spark/construct.py
Python
apache-2.0
7,798
# Copyright 2020 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...
cxxgtxy/tensorflow
tensorflow/python/ops/numpy_ops/np_array_ops.py
Python
apache-2.0
63,472
# 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...
Huyuwei/tvm
nnvm/tests/python/frontend/darknet/test_forward.py
Python
apache-2.0
18,555
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2011 OpenStack LLC. # 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/...
rajarammallya/melange
melange/tests/unit/test_notifier.py
Python
apache-2.0
7,474
#! /usr/bin/env python import random import utilities def read_nodes_from_training(file_name): """ Returns a list of all the nodes in the graph """ node_set = set() for nodes in utilities.edges_generator(file_name): for node in nodes: node_set.add(node) return list(node_s...
ameyavilankar/social-network-recommendation
preprocessing/random_benchmark.py
Python
bsd-2-clause
1,033
from __future__ import absolute_import __all__ = ('Sdk', ) from distutils.version import LooseVersion from django.conf import settings from sentry.interfaces.base import Interface, InterfaceValidationError from sentry.utils.safe import trim def get_with_prefix(d, k, default=None, delimiter=":"): """\ Retri...
looker/sentry
src/sentry/interfaces/sdk.py
Python
bsd-3-clause
2,602
import datetime import itertools import unittest from copy import copy from django.db import ( DatabaseError, IntegrityError, OperationalError, connection, ) from django.db.models import Model from django.db.models.deletion import CASCADE, PROTECT from django.db.models.fields import ( AutoField, BigIntegerFiel...
sgzsh269/django
tests/schema/tests.py
Python
bsd-3-clause
97,864
#! /usr/bin/env python # by gjr; 021514 """ Plot PCoA results from pcoa in mothur % python plot-pcoa.py <file.pcoa.axis> <file.pcoa.loadings> <outfile> """ import sys, os import matplotlib matplotlib.use('Agg') #matplotlib.use('Pdf') import matplotlib.pyplot as plt import numpy as np import brewer2mpl import pandas...
jiarong/SSUsearch
scripts/plot-pcoa.py
Python
bsd-3-clause
2,303
from __future__ import absolute_import from django.apps import AppConfig class Config(AppConfig): name = "sentry.auth.providers.saml2.okta" def ready(self): from sentry.auth import register from .provider import OktaSAML2Provider register("okta", OktaSAML2Provider)
beeftornado/sentry
src/sentry/auth/providers/saml2/okta/apps.py
Python
bsd-3-clause
304
# Update or remove for 2.0.0 from ..v20.grammars.STIXPatternListener import * # noqa: F401
chisholm/cti-pattern-validator
stix2patterns/grammars/STIXPatternListener.py
Python
bsd-3-clause
91
"""Functions for fetching remote datasets.""" from . import brainstorm from . import visual_92_categories from . import eegbci from . import megsim from . import misc from . import sample from . import somato from . import multimodal from . import spm_face from . import testing from . import _fake from .utils import _...
nicproulx/mne-python
mne/datasets/__init__.py
Python
bsd-3-clause
374
""" JSONField automatically serializes most Python terms to JSON data. Creates a TEXT field with a default value of "{}". See test_json.py for more information. from django.db import models from django_extensions.db.fields import json class LOL(models.Model): extra = json.JSONField() """ from __future__ impo...
pabulumm/neighbors
lib/python3.4/site-packages/django_extensions/db/fields/json.py
Python
bsd-3-clause
3,459
''' Present a plot updating according to a set of fixed timeout intervals. Use the ``bokeh serve`` command to run the example by executing: bokeh serve timeout.py at your command prompt. Then navigate to the URL http://localhost:5006/timeout in your browser. ''' import numpy as np from bokeh.palettes im...
justacec/bokeh
examples/app/timeout.py
Python
bsd-3-clause
1,560
"""Protx checkout custom views""" from django.utils.translation import ugettext as _ from satchmo.configuration import config_get_group from satchmo.payment.views import payship, confirm import logging log = logging.getLogger('protx.views') def pay_ship_info(request): return payship.credit_pay_ship_info(requ...
roadhead/satchmo
satchmo/payment/modules/protx/views.py
Python
bsd-3-clause
3,443
from django.views.generic import DetailView from braces.views import SelectRelatedMixin from django_filters.views import FilterView from .models import JST from .filters import JSTFilter from foundation.offices.models import Office from dal import autocomplete class JSTListView(SelectRelatedMixin, FilterView): fi...
ad-m/foundation-manager
foundation/teryt/views.py
Python
bsd-3-clause
1,853
import collections import warnings from operator import add import pytest import numpy as np import dask import dask.array as da from dask.highlevelgraph import HighLevelGraph from dask.blockwise import Blockwise, rewrite_blockwise, optimize_blockwise, index_subs from dask.array.utils import assert_eq from dask.array...
ContinuumIO/dask
dask/array/tests/test_atop.py
Python
bsd-3-clause
17,215
# Copyright (c) IPython-Contrib Team. # Notebook Server Extension to activate/deactivate javascript notebook extensions # from jupyter_core.paths import jupyter_data_dir from notebook.utils import url_path_join as ujoin from notebook.base.handlers import IPythonHandler, json_errors from notebook.nbextensions import _ge...
davande/IPython-notebook-extensions
config/nbextensions.py
Python
bsd-3-clause
3,003
#!/usr/bin/env python # This file is part of khmer, https://github.com/dib-lab/khmer/, and is # Copyright (C) 2012-2015, Michigan State University. # Copyright (C) 2015, The Regents of the University of California. # # Redistribution and use in source and binary forms, with or without # modification, are permitted prov...
souravsingh/khmer
sandbox/sweep-reads2.py
Python
bsd-3-clause
3,734
# Time: O(n * sqrt(n)) # Space: O(n) # Suppose you have a random list of people standing in a queue. # Each person is described by a pair of integers (h, k), # where h is the height of the person and k is the number of people # in front of this person who have a height greater than or equal to h. # Write an algorit...
githubutilities/LeetCode
Python/queue-reconstruction-by-height.py
Python
mit
1,549
arr=[] n=int(input("Please enter the number of elements and then the actual elements themselves!")) for i in range(n): x=int(input()) arr.append(x) for i in range(n-1): for j in range(0,n-i-1): if arr[j]>arr[j+1]: arr[j],arr[j+1]=arr[j+1],arr[j] print("The sorted arr is",arr)
WebClub-NITK/Hacktoberfest-2k17
Sorting/Bubble_Sort/nishanthebbar2011.py
Python
mit
318
from django.conf.urls import patterns, include, url from django.contrib import admin urlpatterns = patterns('', # Examples: # url(r'^$', 'todosite.views.home', name='home'), # url(r'^blog/', include('blog.urls')), url(r'^todo/', include('todo.urls')), url(r'^admin/', include(admin.site.urls)), )
kwailamchan/programming-languages
python/django/elf/todo/todosite/todosite/urls.py
Python
mit
319
#!/usr/bin/env python3 # Copyright (c) 2014-2020 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Test the importprunedfunds and removeprunedfunds RPCs.""" from decimal import Decimal from test_framew...
AkioNak/bitcoin
test/functional/wallet_importprunedfunds.py
Python
mit
5,280
from pylayers.simul.link import * from pylayers.antprop.channel import * from pylayers.antprop.antenna import * from pylayers.util.geomutil import * # parameters fmin = 31.8 # GHz fmax = 33.4 # GHz bw = fmax - fmin # bandwidth in GHz nf = 10001 # sweep frequency points fc = (fmin + fmax)/...
pylayers/pylayers
pylayers/simul/tests/test_espoo.py
Python
mit
2,820
import km # Load digits data from sklearn import datasets data, labels = datasets.load_digits().data, datasets.load_digits().target # Create images for a custom tooltip array import StringIO from scipy.misc import imsave, toimage import base64 tooltip_s = [] for image_data in data: output = StringIO.StringIO() img ...
mrgloom/kepler-mapper
examples/digits/digits.py
Python
mit
1,593
from django.core.urlresolvers import reverse from django.contrib.admin.util import unquote from django.utils.translation import ugettext as _ from django.http import HttpResponseRedirect from django import forms from filer.admin.permissions import PrimitivePermissionAwareModelAdmin from filer.models import File # for...
ojii/django-filer
filer/admin/fileadmin.py
Python
mit
4,673
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('wagtailmenus', '0009_auto_20160201_0859'), ] operations = [ migrations.RenameField( model_name='mainmenuitem', ...
rkhleics/wagtailmenus
wagtailmenus/migrations/0010_auto_20160201_1558.py
Python
mit
408
# Copyright (C) 2009 Canonical Ltd # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in ...
levibostian/launchpad-2-github
bzr-fastimport/build/lib.linux-x86_64-2.7/bzrlib/plugins/fastimport/branch_mapper.py
Python
mit
2,184
#!/usr/bin/env python3 # Copyright (c) 2017 Anki, 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 in the file LICENSE.txt or at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unles...
manxueitp/cozmo-test
object_recognition/04_exposure.py
Python
mit
4,967
####################################################################### # This file is part of Pyblosxom. # # Copyright (C) 2010-2011 by the Pyblosxom team. See AUTHORS. # # Pyblosxom is distributed under the MIT license. See the file # LICENSE for distribution details. ###############################################...
maru-sama/pyblosxom
Pyblosxom/tests/test_tags.py
Python
mit
2,822
#!/usr/bin/python # File created on Nov 27 Jan 2012 from __future__ import division __author__ = "Kishori M Konwar" __copyright__ = "Copyright 2013, MetaPathways" __credits__ = ["r"] __version__ = "1.0" __maintainer__ = "Kishori M Konwar" __status__ = "Release" try: from os import makedirs, sys, remove, rename ...
wholebiome/MetaPathways_Python_Koonkie.3.0
libs/python_scripts/MetaPathways_annotate_fast_threaded.py
Python
mit
36,220
#! /usr/bin/env python from enum import IntEnum, unique @unique class NodeStatus(IntEnum): """Define the boundary-type codes""" #: Indicate a node is *core*. CORE = 0 #: Indicate a boundary node is has a fixed values. FIXED_VALUE = 1 #: Indicate a boundary node is has a fixed gradient. FI...
landlab/landlab
landlab/grid/nodestatus.py
Python
mit
457
from __future__ import with_statement import os from alembic import context from sqlalchemy import engine_from_config, pool from logging.config import fileConfig # this is the Alembic Config object, which provides # access to the values within the .ini file in use. config = context.config # Interpret the config file ...
paultag/moxie
migrations/env.py
Python
mit
2,125
# -*- coding: utf-8 -*- # # Mocha documentation build configuration file, created by # sphinx-quickstart on Thu Nov 13 00:43:40 2014. # # This file is execfile()d with the current directory set to its # containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # # All...
dplarson/Mocha.jl
docs/conf.py
Python
mit
8,570
"""Classes for describing instruction formats.""" from __future__ import absolute_import from .operands import OperandKind, VALUE, VARIABLE_ARGS from .operands import Operand # noqa # The typing module is only required by mypy, and we don't use these imports # outside type comments. try: from typing import Dict, ...
nrc/rustc-perf
collector/benchmarks/cranelift-codegen/cranelift-codegen/meta-python/cdsl/formats.py
Python
mit
10,052
# Natural Language Toolkit: Tagset Mapping # # Copyright (C) 2001-2015 NLTK Project # Author: Nathan Schneider <nathan@cmu.edu> # Steven Bird <stevenbird1@gmail.com> # URL: <http://nltk.org/> # For license information, see LICENSE.TXT """ Interface for converting POS tags from various treebanks to the universa...
nelango/ViralityAnalysis
model/lib/nltk/tag/mapping.py
Python
mit
3,141
""" websocket - WebSocket client library for Python Copyright (C) 2010 Hiroki Ohtani(liris) This library 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, ...
andrewsy97/Treehacks
websocket/websocket/_app.py
Python
mit
10,379
#!/usr/bin/env python """ Project-wide application configuration. DO NOT STORE SECRETS, PASSWORDS, ETC. IN THIS FILE. They will be exposed to users. Use environment variables instead. See get_secrets() below for a fast way to access them. """ import os from authomatic.providers import oauth2 from authomatic import ...
claimsmall/waterbug
app_config.py
Python
mit
5,956
import binascii def b2h(the_bytes): return binascii.hexlify(the_bytes).decode("utf8") def b2h_rev(the_bytes): return binascii.hexlify(bytearray(reversed(the_bytes))).decode("utf8")
maraoz/proofofexistence
pycoin/serialize/__init__.py
Python
mit
200
# This file is part of Buildbot. Buildbot 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, version 2. # # This program is distributed in the hope that it will be useful, but WITHOUT # ANY WARRANTY; without eve...
cmouse/buildbot
master/buildbot/steps/source/svn.py
Python
gpl-2.0
17,366
# -*- coding: utf-8 -*- # # Picard, the next-generation MusicBrainz tagger # # Copyright (C) 2007 Lukáš Lalinský # Copyright (C) 2014 Shadab Zafar # Copyright (C) 2015-2021 Laurent Monin # Copyright (C) 2019 Wieland Hoffmann # Copyright (C) 2019-2020 Philipp Wolfer # # This program is free software; you can redistribut...
metabrainz/picard
picard/pluginmanager.py
Python
gpl-2.0
17,081
import re from gwibber.microblog import network, util import gnomekeyring from oauth import oauth from gwibber.microblog.util import log, resources from gettext import lgettext as _ log.logger.name = "StatusNet" PROTOCOL_INFO = { "name": "StatusNet", "version": 1.1, "config": [ "private:secret_token", ...
rhg/Qwibber
gwibber/microblog/plugins/statusnet/__init__.py
Python
gpl-2.0
9,075
# # Custom partitioning classes. # # Copyright (C) 2012-2014 Red Hat, Inc. # # This copyrighted material is made available to anyone wishing to use, # modify, copy, or redistribute it subject to the terms and conditions of # the GNU General Public License v.2, or (at your option) any later version. # This program is d...
heiden-deng/anaconda
pyanaconda/ui/gui/spokes/custom.py
Python
gpl-2.0
117,264
## This file is part of CDS Invenio. ## Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008 CERN. ## ## CDS 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 (...
pombredanne/invenio-old
modules/bibharvest/lib/bibharvest_templates.py
Python
gpl-2.0
23,444
# -*- coding: utf-8 -*- ## ## This file is part of Invenio. ## Copyright (C) 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) a...
MSusik/invenio
invenio/legacy/bibauthorid/daemon.py
Python
gpl-2.0
13,047
import bpy op = bpy.context.active_operator op.radius = 0.5 op.arc_div = 8 op.lin_div = 0 op.size = (0.0, 0.0, 3.0) op.div_type = 'CORNERS'
Microvellum/Fluid-Designer
win64-vc/2.78/Python/bin/2.78/scripts/addons/presets/operator/mesh.primitive_round_cube_add/Capsule.py
Python
gpl-3.0
141
# Copyright (c) 2007 Enough Project. # See LICENSE for details. ## /* Copyright 2007, Eyal Lotem, Noam Lewis, enoughmail@googlegroups.com */ ## /* ## This file is part of Enough. ## Enough is free software; you can redistribute it and/or modify ## it under the terms of the GNU General Public License as pu...
krfkeith/enough
lib/dot.py
Python
gpl-3.0
6,472
#!/usr/bin/env python # -*-coding: utf-8 -*- """ __init__.py ~~~~~~~~~~~ Configurations for iiify :copyright: (c) 2015 by AUTHORS :license: see LICENSE for more details """ import os import types import configparser path = os.path.dirname(os.path.realpath(__file__)) approot = os.path.abspath(os....
mekarpeles/iiify
niiifty/configs/__init__.py
Python
gpl-3.0
1,589
# -*- coding: utf-8 -*- # # Copyright (C) 2009 Andrew Resch <andrewresch@gmail.com> # Copyright (C) 2011 Pedro Algarvio <pedro@algarvio.me> # # This file is part of Deluge and is licensed under GNU General Public License 3.0, or later, with # the additional special exception to link portions of this program with the Op...
rkokkelk/Gulliver
deluge/ui/client.py
Python
gpl-3.0
26,693
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright (c) 2016 Red Hat, 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 #...
hryamzik/ansible
lib/ansible/modules/cloud/ovirt/ovirt_affinity_label_facts.py
Python
gpl-3.0
5,875
# -*- coding: utf-8 -*- import os.path as op import gzip import io import struct from datetime import datetime from xml.etree import ElementTree import numpy as np import scipy.sparse from aston.resources import cache from aston.trace.Trace import AstonSeries, AstonFrame from aston.tracefile.TraceFile import TraceFile...
molliewebb/aston
aston/tracefile/AgilentMS.py
Python
gpl-3.0
11,532
# -*- coding: utf-8 -*- from odoo import api, fields, models class Post(models.Model): _inherit = 'forum.post' documentation_toc_id = fields.Many2one('forum.documentation.toc', string='Documentation ToC', ondelete='set null') documentation_stage_id = fields.Many2one('forum.documentation.stage', string='...
ayepezv/GAD_ERP
addons/website_forum_doc/models/forum_post.py
Python
gpl-3.0
790
import numpy as np class PathInfo: def __init__(self, type, nlead): self.type = type self.num = 0 self.lead_num = nlead self.energy = [] self.weight = [] self.nres = 0 self.sigma = [] for i in range(nlead): self.sigma.append([]) if...
qsnake/gpaw
gpaw/transport/intctrl.py
Python
gpl-3.0
7,054
# coding=utf-8 # Author: adaur <adaur.underground@gmail.com> # Contributor: PHD <phd59fr@gmail.com> # # 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 Fre...
pjg101/SickRage
sickbeard/providers/yggtorrent.py
Python
gpl-3.0
7,141
"""Class for choosing cli commands.""" import argparse class CommandChooser(object): """Chooses command to run based on commandline arguments.""" def __init__(self, commands_dict): """Initialize CommandChooser. Args: commands_dict: dict from command name to object responsible for executing ...
knotman90/google-interview
problems/distributedJam/dcj_linux/dcj/command_chooser.py
Python
gpl-3.0
1,360
# -*- coding: utf-8 -*- from collections import defaultdict import mock from searx.engines import btdigg from searx.testing import SearxTestCase class TestBtdiggEngine(SearxTestCase): def test_request(self): query = 'test_query' dicto = defaultdict(dict) dicto['pageno'] = 0 params...
misnyo/searx
tests/unit/engines/test_btdigg.py
Python
agpl-3.0
19,083
# -*- coding: utf-8 -*- """ This file is part of checkmate, a meta code checker written in Python. Copyright (C) 2015 Andreas Dewes, QuantifiedCode UG This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foun...
ArnossArnossi/checkmate
checkmate/contrib/plugins/python/metrics/issues_data.py
Python
agpl-3.0
813
# -*- coding: utf-8 -*- # This file is part of Shuup. # # Copyright (c) 2012-2017, Shoop Commerce Ltd. All rights reserved. # # This source code is licensed under the OSL-3.0 license found in the # LICENSE file in the root directory of this source tree. import pytest from shuup import configuration from shuup.api.admi...
suutari-ai/shoop
shuup_tests/api/test_admin.py
Python
agpl-3.0
1,366
# -*- 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...
Jgarcia-IAS/SAT
openerp/addons-extra/odoo-pruebas/odoo-server/addons/stock/wizard/stock_return_picking.py
Python
agpl-3.0
8,537
""" Helper functions for the account/profile Python APIs. This is NOT part of the public API. """ import json import logging import traceback from collections import defaultdict from functools import wraps from django import forms from django.core.serializers.json import DjangoJSONEncoder from django.http import HttpR...
philanthropy-u/edx-platform
openedx/core/djangoapps/user_api/helpers.py
Python
agpl-3.0
20,700
import unittest from ctypes import * import re, struct, sys if sys.byteorder == "little": THIS_ENDIAN = "<" OTHER_ENDIAN = ">" else: THIS_ENDIAN = ">" OTHER_ENDIAN = "<" def normalize(format): # Remove current endian specifier and white space from a format # string if format ...
Orav/kbengine
kbe/src/lib/python/Lib/ctypes/test/test_pep3118.py
Python
lgpl-3.0
8,041
"""Support for getting statistical data from a Pi-hole system.""" import logging from homeassistant.helpers.entity import Entity from .const import ( ATTR_BLOCKED_DOMAINS, DOMAIN as PIHOLE_DOMAIN, SENSOR_DICT, SENSOR_LIST, ) LOGGER = logging.getLogger(__name__) async def async_setup_platform(hass, ...
leppa/home-assistant
homeassistant/components/pi_hole/sensor.py
Python
apache-2.0
2,321
"""Utility functions for Certbot plugin tests.""" import argparse import copy import os import re import shutil import tarfile import josepy as jose from certbot._internal import constants from certbot.tests import util as test_util from certbot_compatibility_test import errors _KEY_BASE = "rsa2048_key.pem" KEY_PATH...
stweil/letsencrypt
certbot-compatibility-test/certbot_compatibility_test/util.py
Python
apache-2.0
1,520
# 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 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...
BiznetGIO/horizon
openstack_dashboard/dashboards/admin/images/tests.py
Python
apache-2.0
9,224
#!/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 # "L...
kou/arrow
cpp/src/arrow/util/bpacking_simd_codegen.py
Python
apache-2.0
6,630
from __future__ import print_function import atexit import argparse import sys from pyVim import connect from pyVmomi import vim from pyvmomi_tools import cli def get_args(): parser = argparse.ArgumentParser() cli.args.add_connection_arguments(parser) parser.add_argument('-n', '--name', ...
borland667/pyvmomi-tools
samples/tasks_different_styles.py
Python
apache-2.0
2,250
# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 # For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt """Source file annotation for coverage.py.""" import os import re from coverage.files import flat_rootname from coverage.misc import ensure_dir, isolate_module fr...
hugovk/coveragepy
coverage/annotate.py
Python
apache-2.0
3,381
#!/usr/bin/env python """ project creation and deletion check for v3 """ # We just want to see any exception that happens # don't want the script to die under any cicumstances # script must try to clean itself up # pylint: disable=broad-except # pylint: disable=invalid-name # pylint: disable=import-error import argpa...
blrm/openshift-tools
scripts/monitoring/cron-send-project-operation.py
Python
apache-2.0
5,158
from scipy.interpolate import interp1d from numpy import arange, amax, amin, asarray, zeros, cumsum, \ transpose, gradient, mean, size def __convert(data, vmodel, interval, interval_new, scale, mode): """ Generic function for converting between scales. Use either time to depth or depth to time ""...
kinverarity1/bruges
bruges/transform/timedepthconv.py
Python
apache-2.0
3,434
# 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...
wangyum/tensorflow
tensorflow/python/tools/saved_model_cli_test.py
Python
apache-2.0
15,971
#!/usr/bin/env python # ___ ___ _ _ ___ ___ _ _____ ___ ___ # / __| __| \| | __| _ \ /_\_ _| __| \ # | (_ | _|| .` | _|| / / _ \| | | _|| |) | # \___|___|_|\_|___|_|_\/_/_\_\_|_|___|___/_ _____ # | \ / _ \ | \| |/ _ \_ _| | __| \_ _|_ _| # | |) | (_) | | .` | (_) || | | _|| |) | | ...
rhdedgar/openshift-tools
ansible/roles/lib_gcloud/library/gcloud_dm_resource_reconciler.py
Python
apache-2.0
25,410
# Copyright (c) 2011 Citrix Systems, Inc. # Copyright 2011 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...
eharney/nova
nova/tests/virt/vmwareapi/stubs.py
Python
apache-2.0
3,393
import os import threading import txaio txaio.use_twisted() from txaio import make_logger from twisted.internet.defer import inlineCallbacks from autobahn.twisted.util import sleep from autobahn.wamp.types import PublishOptions from autobahn.twisted.wamp import ApplicationSession class MyPublisher(ApplicationSessi...
crossbario/crossbar-examples
containers/max_message_size/publisher.py
Python
apache-2.0
1,986
"""Simple HTTP Server. This module builds on BaseHTTPServer by implementing the standard GET and HEAD requests in a fairly straightforward manner. """ __version__ = "0.6" __all__ = ["SimpleHTTPRequestHandler"] import os import posixpath import BaseHTTPServer import urllib import cgi import sys i...
jt6562/XX-Net
python27/1.0/lib/SimpleHTTPServer.py
Python
bsd-2-clause
7,826
#emacs: -*- mode: python-mode; py-indent-offset: 4; tab-width: 4; indent-tabs-mode: nil -*- #ex: set sts=4 ts=4 sw=4 noet: """Some utility functions for commands (e.g. for cmdline handling) """ # Authors: Yaroslav Halchenko <debian@onerussian.com> # # License: BSD (3-clause) import imp, os, re from optparse import O...
jaeilepp/eggie
mne/commands/utils.py
Python
bsd-2-clause
1,576
""" Beam characterization calculations. For more information and the math behind this code go to the `LOFAR imaging capabilities page <http://www.astron.nl/radio-observatory/astronomers/lofar-imaging-capabilities-sensitivity/lofar-imaging-capabilities/lofa>`_. """ import math def fwhm(lambda_, d, alpha1=1.3): ""...
mkuiack/tkp
tkp/telescope/lofar/beam.py
Python
bsd-2-clause
1,207
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations from django.conf import settings import machina.models.fields class Migration(migrations.Migration): dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ] operations ...
reinbach/django-machina
machina/apps/forum_member/migrations/0001_initial.py
Python
bsd-3-clause
1,410
#!/usr/bin/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 # not...
GiedriusM/openthread
tests/scripts/thread-cert/node_cli.py
Python
bsd-3-clause
19,329
# Copyright (C) 2003-2005 Peter J. Verveer # # 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 # notice, this list of conditions and the following d...
sargas/scipy
scipy/ndimage/interpolation.py
Python
bsd-3-clause
25,990
from os import path from django.conf.urls.defaults import * from models import * import views base_dir = path.dirname(path.abspath(__file__)) media_dir = path.join(base_dir, 'media') locale_dir = path.join(base_dir, 'locale') js_info_dict = { 'domain': 'djangojs', 'packages': ('regressiontests.views',), } ...
diofeher/django-nfa
tests/regressiontests/views/urls.py
Python
bsd-3-clause
1,686
# -*- coding: utf-8 -*- # Copyright (C) 2012, Almar Klein # # Visvis is distributed under the terms of the (new) BSD License. # The full license can be found in 'license.txt'. import visvis as vv import numpy as np def volshow2(vol, clim=None, renderStyle=None, cm=None, axesAdjust=True, axes=None): "...
pbfy0/visvis
functions/volshow2.py
Python
bsd-3-clause
2,734
# Copyright 2017 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. """Provides the speed releasing table.""" from __future__ import print_function from __future__ import division from __future__ import absolute_import import...
catapult-project/catapult
dashboard/dashboard/speed_releasing.py
Python
bsd-3-clause
17,257
from django.contrib.postgres.fields import ArrayField, HStoreField from django.db import models class IntegerArrayModel(models.Model): field = ArrayField(models.IntegerField()) class NullableIntegerArrayModel(models.Model): field = ArrayField(models.IntegerField(), blank=True, null=True) class CharArrayMo...
gdi2290/django
tests/postgres_tests/models.py
Python
bsd-3-clause
822
""" ===================================== Multi-class AdaBoosted Decision Trees ===================================== This example reproduces Figure 1 of Zhu et al [1] and shows how boosting can improve prediction accuracy on a multi-class problem. The classification dataset is constructed by taking a ten-dimensional ...
florian-f/sklearn
examples/ensemble/plot_adaboost_multiclass.py
Python
bsd-3-clause
3,612