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
../../../../../../../share/pyshared/orca/scripts/apps/evolution/formatting.py
Alberto-Beralix/Beralix
i386-squashfs-root/usr/lib/python2.7/dist-packages/orca/scripts/apps/evolution/formatting.py
Python
gpl-3.0
77
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright (C) Alex Urban (2019-2020) # # This file is part of GWpy. # # GWpy 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 ...
areeda/gwpy
examples/miscellaneous/range-spectrogram.py
Python
gpl-3.0
2,377
# coding: utf-8 from django.utils.translation import ugettext_lazy as _ class MultiFieldsValidator(object): fields = () error_messages = { 'invalid' : _(u'Value is not valid.') } def raise_error(self, form, error="invalid"): for field in self.fields: form._errors[f...
matllubos/django-simple-utilities
utilities/forms/validators.py
Python
gpl-3.0
479
# ------------------- Information --------------------- # # Author: Joey Dumont <joey.dumont@gmail.com> # # Date created: October 18th, 2013 # # Date mod. October 18th, 2013 # # Description: We plot the times it took to compute # # sets of Wigner symbols of different # # sizes. # # ---------------------------...
valandil/msc_thesis
figs/backmatter/sphericalHarmonics.py
Python
gpl-3.0
998
# -*- encoding: utf-8 -*- from abjad import * def test_pitchtools_PitchClass_is_pitch_class_number_01(): assert pitchtools.PitchClass.is_pitch_class_number(0) assert pitchtools.PitchClass.is_pitch_class_number(0.5) assert pitchtools.PitchClass.is_pitch_class_number(11) assert pitchtools.PitchClass.is...
mscuthbert/abjad
abjad/tools/pitchtools/test/test_pitchtools_PitchClass_is_pitch_class_number.py
Python
gpl-3.0
727
# FST tests related classes # Copyright (c) 2015, Qualcomm Atheros, Inc. # # This software may be distributed under the terms of the BSD license. # See README for more details. import logging import os import signal import time import re import hostapd import wpaspy import utils from wpasupplicant import WpaSupplican...
s0lst1c3/eaphammer
local/hostapd-eaphammer/tests/hwsim/fst_module_aux.py
Python
gpl-3.0
33,202
from django.contrib import admin from . import models
sachinkum/Bal-Aveksha
WebServer/Authentications/admin.py
Python
gpl-3.0
54
import sys import numpy import scipy import json import itertools import random import os from sys import stderr, exit, argv from scipy.sparse.linalg import spsolve from sklearn.metrics.pairwise import euclidean_distances from nltk.stem import SnowballStemmer def load_data_sparse(prefix) : return scipy.sparse.csr...
genie9/pulp
pulp_simulator.py
Python
gpl-3.0
13,319
""" Copyright (c) 2012-2020 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...
rockstor/rockstor-core
src/rockstor/smart_manager/views/cpu_util.py
Python
gpl-3.0
963
# -*- coding: utf-8 -*- import base64 import os import io import six from tempfile import _TemporaryFileWrapper from pretty_bad_protocol._util import _STREAMLIKE_TYPES from cryptography.exceptions import AlreadyFinalized from cryptography.hazmat.backends import default_backend from cryptography.hazmat.primitives.ciphe...
ehartsuyker/securedrop
securedrop/secure_tempfile.py
Python
agpl-3.0
6,113
# -*- coding: utf-8 -*- # # 2017-01-23 Cornelius Kölbel <cornelius.koelbel@netknights.it> # Avoid XML bombs # 2016-07-17 Cornelius Kölbel <cornelius.koelbel@netknights.it> # Add GPG encrpyted import # 2016-01-16 Cornelius Kölbel <cornelius.koelbel@netknights.it> # Add PSKC import ...
wheldom01/privacyidea
privacyidea/lib/importotp.py
Python
agpl-3.0
20,360
# -*- coding: utf-8 -*- ############################################################################## # # Copyright (C) 2012-2014 Didotech (<http://www.didotech.com>) # All Rights Reserved # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero Genera...
odoousers2014/LibrERP
material_asset/wizard/asset_assign_category.py
Python
agpl-3.0
2,528
from ..utils import * ## # Minions class AT_019: "Dreadsteed" deathrattle = Summon(CONTROLLER, "AT_019") class AT_021: "Tiny Knight of Evil" events = Discard(FRIENDLY).on(Buff(SELF, "AT_021e")) AT_021e = buff(+1, +1) class AT_023: "Void Crusher" inspire = Destroy(RANDOM_ENEMY_MINION | RANDOM_FRIENDLY_MINI...
beheh/fireplace
fireplace/cards/tgt/warlock.py
Python
agpl-3.0
950
from coalib.bearlib.abstractions.Linter import linter from coalib.bears.requirements.GoRequirement import GoRequirement @linter(executable='gofmt', use_stdin=True, output_format='corrected', result_message='Formatting can be improved.') class GofmtBear: """ Suggest better formatting op...
sounak98/coala-bears
bears/go/GofmtBear.py
Python
agpl-3.0
935
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved # Copyright (C) 2004-2012 Micronaet srl. All Rights Reserved # d$ # # This pr...
Micronaet/micronaet-addons-private
task_manager/wizard/wizard_report.py
Python
agpl-3.0
11,463
# -*- coding: utf-8 -*- ## Copyright 2015 Rasmus Scholer Sorensen, rasmusscholer@gmail.com ## ## This file is part of Nascent. ## ## Nascent 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 Foundati...
scholer/nascent
nascent/graph_sim_nx/debug.py
Python
agpl-3.0
1,923
#! /usr/bin/env python # -*- coding: utf-8 -*- # OpenFisca -- A versatile microsimulation software # By: OpenFisca Team <contact@openfisca.fr> # # Copyright (C) 2011, 2012, 2013, 2014, 2015 OpenFisca Team # https://github.com/openfisca # # This file is part of OpenFisca. # # OpenFisca is free software; you can redist...
MalkIPP/openfisca-france-data
openfisca_france_data/input_data_builders/build_openfisca_survey_data/run_all.py
Python
agpl-3.0
3,682
# -*- coding: utf-8 -*- from django.db import migrations def create_switch(apps, schema_editor): """Create the async_order_fulfillment switch if it does not already exist.""" Switch = apps.get_model('waffle', 'Switch') Switch.objects.get_or_create(name='async_order_fulfillment', defaults={'active': Fals...
edx/ecommerce
ecommerce/core/migrations/0007_auto_20151005_1333.py
Python
agpl-3.0
780
""" Task performed by user in django view """ import functools from django.core.urlresolvers import reverse from django.conf.urls import url from django.shortcuts import get_object_or_404 from ..activation import Activation, ViewActivation, STATUS from ..exceptions import FlowRuntimeError from . import base def flo...
codingjoe/viewflow
viewflow/flow/task_view.py
Python
agpl-3.0
9,690
import os import sys from recommonmark.parser import CommonMarkParser sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..', 'askomics')) extensions = ['sphinx.ext.autodoc', 'sphinx.ext.napoleon'] master_doc = 'index' # The suffix of source filenames. source_suffix = ['.rst', '.md'] source_parsers = { ...
askomics/askomics
docs/conf.py
Python
agpl-3.0
778
# -*- coding: utf-8 -*- # ocitysmap, city map and street index generator from OpenStreetMap data # Copyright (C) 2010 David Decotigny # Copyright (C) 2010 Frédéric Lehobey # Copyright (C) 2010 Pierre Mauduit # Copyright (C) 2010 David Mentré # Copyright (C) 2010 Maxime Petazzoni # Copyright (C) 2010 Thomas Petaz...
dittaeva/ocitysmap
ocitysmap2/layoutlib/commons.py
Python
agpl-3.0
1,272
# Generated by Django 3.0.9 on 2020-08-16 20:47 from django.db import migrations, models import django.db.models.deletion import django.utils.timezone class Migration(migrations.Migration): dependencies = [ ('groups', '0042_auto_20200507_1258'), ('activities', '0021_remove_activity_feedback_as_su...
yunity/foodsaving-backend
karrot/activities/migrations/0022_add_activity_types.py
Python
agpl-3.0
1,901
#!/usr/bin/env python # Copyright (C) 2006-2016 Music Technology Group - Universitat Pompeu Fabra # # This file is part of Essentia # # Essentia 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 (FSF), e...
carthach/essentia
test/src/unittests/standard/test_idct.py
Python
agpl-3.0
2,364
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations def add_criteria(apps, schema_editor): Criterion = apps.get_model('activities', 'Criterion') StudentClubYear = apps.get_model('core', 'StudentClubYear') year_2015_2016 = StudentClubYear.objects.get(sta...
enjaz/enjaz
activities/migrations/0020_modify_citeria.py
Python
agpl-3.0
1,939
#===- cindex.py - Python Indexing Library Bindings -----------*- python -*--===# # # The LLVM Compiler Infrastructure # # This file is distributed under the University of Illinois Open Source # License. See LICENSE.TXT for details. # #===--------------------------------------------------------------...
thiblahute/hotdoc
hotdoc/extensions/c/clang/cindex.py
Python
lgpl-2.1
117,967
""" hapefile.py Provides read and write support for ESRI Shapefiles. author: jlawhead<at>geospatialpython.com date: 20110927 version: 1.1.4 Compatible with Python versions 2.4-3.x """ from struct import pack, unpack, calcsize, error import os import sys import time import array # # Constants for shape types NULL = 0 P...
janhui/test_engine
dev/plugins/define_boundary_ids/shapefile.py
Python
lgpl-2.1
38,004
# -*- coding: utf-8 -*- # Resource object code # # Created: Thu Jul 25 00:08:39 2013 # by: The Resource Compiler for PyQt (Qt v4.8.4) # # WARNING! All changes made in this file will be lost! from PyQt4 import QtCore qt_resource_data = "\ \x00\x00\x05\x3e\ \x89\ \x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d\x49\x...
adamcandy/QGIS-Meshing
plugins/boundary_identification/resources.py
Python
lgpl-2.1
6,749
#! /usr/bin/env python #/* # * example_02.c: sample gnome-print code # * # * This program is free software; you can redistribute it and/or # * modify it under the terms of the GNU Library General Public License # * as published by the Free Software Foundation; either version 2 of # * the License, or (at your optio...
dieterv/gnome-python-desktop
examples/gnomeprint/example_02.py
Python
lgpl-2.1
2,964
#!/usr/bin/env python ########################################################################## # # QGIS-meshing plugins. # # Copyright (C) 2012-2013 Imperial College London and others. # # Please see the AUTHORS file in the main source directory for a # full list of copyright holders. # # Dr Adam S. Can...
adamcandy/qgis-plugins-meshing
dev/tests/gaussian_bump.py
Python
lgpl-2.1
4,413
# -*- coding: utf-8 -*- ''' Tests for basic capturing ''' import os import os.path import shutil import tempfile import unittest from pyca import capture, config, db, utils from tests.tools import should_fail, terminate_fn, reload class TestPycaCapture(unittest.TestCase): def setUp(self): utils.http_r...
opencast/pyCA
tests/test_capture.py
Python
lgpl-3.0
3,301
#!/usr/bin/env python # Copyright (C) 2014 Swift Navigation Inc. # Contact: Gareth McMullin <gareth@swift-nav.com> # # This source is subject to the license found in the file 'LICENSE' which must # be be distributed together with this source. All other rights reserved. # # THIS CODE AND INFORMATION IS PROVIDED "AS IS" ...
denniszollo/piksi_tools
piksi_tools/fileio.py
Python
lgpl-3.0
6,491
#!/usr/bin/python # -*- coding: utf-8 -*- """File used to unit test the pacifica archive interface.""" import unittest import os from stat import ST_MODE from six import PY2 from pacifica.archiveinterface.archive_utils import bytes_type from pacifica.archiveinterface.backends.posix.archive import PosixBackendArchive im...
dmlb2000/pacifica-archiveinterface
tests/posix_test.py
Python
lgpl-3.0
6,379
# This file is part of PyEMMA. # # Copyright (c) 2015, 2014 Computational Molecular Biology Group, Freie Universitaet Berlin (GER) # # PyEMMA 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 versi...
markovmodel/PyEMMA
pyemma/coordinates/transform/tica.py
Python
lgpl-3.0
11,423
import sys from services.spawn import MobileTemplate from services.spawn import WeaponTemplate from resources.datatables import WeaponType from resources.datatables import Difficulty from resources.datatables import Options from java.util import Vector def addTemplate(core): mobileTemplate = MobileTemplate...
agry/NGECore2
scripts/mobiles/endor/arachne_webmaster.py
Python
lgpl-3.0
1,565
#file : InMoov2.minimal.py # this will run with versions of MRL above 1695 # a very minimal script for InMoov # although this script is very short you can still # do voice control of a right hand or finger box # for any command which you say - you will be required to say a confirmation # e.g. you say -> open hand, InM...
mecax/pyrobotlab
toSort/InMoov2.minimal.py
Python
apache-2.0
2,008
# Copyright 2016 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agree...
ethanbao/artman
artman/tasks/requirements/ruby_requirements.py
Python
apache-2.0
1,142
from sklearn import preprocessing import numpy as np X = np.array([[ 1., -1., 2.], [ 2., 0., 0.], [ 2., 0., 0.], [ 0., 1., -1.]]) print X X_scaled = preprocessing.scale(X) print X_scaled
zaqwes8811/ml-cv
ml_tests.py
Python
apache-2.0
241
#!/usr/bin/python -u # Copyright (c) 2010-2012 OpenStack Foundation # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by ap...
gotostack/swift
test/probe/test_object_handoff.py
Python
apache-2.0
9,005
# Copyright 2011-2013 Colin Scott # Copyright 2011-2013 Andreas Wundsam # # 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...
jmiserez/sts
tests/unit/sts/socket_multiplexer_test.py
Python
apache-2.0
4,969
# 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) import copy import u...
jessrosenfield/pants
tests/python/pants_test/option/test_option_value_container.py
Python
apache-2.0
3,394
from sqlalchemy import create_engine from sqlalchemy.ext.declarative import declarative_base from sqlalchemy.orm import sessionmaker engine = create_engine('sqlite:////tmp/db.sqlite', echo=True) Base = declarative_base() Session = sessionmaker(bind=engine)
reykjavik-university/2014-T-514-VEFT
Week10/examples/sqlalchemy-elasticsearch-example/db.py
Python
apache-2.0
258
import logging import time from collections import OrderedDict, defaultdict from datetime import datetime, timedelta from typing import Callable, Dict, Optional, Sequence, Tuple, Type, Union from django.conf import settings from django.db import connection from django.db.models import F from psycopg2.sql import SQL, C...
showell/zulip
analytics/lib/counts.py
Python
apache-2.0
29,578
"""Tests for the update coordinator.""" import asyncio from datetime import timedelta import logging import urllib.error import aiohttp import pytest import requests from homeassistant.helpers import update_coordinator from homeassistant.util.dt import utcnow from tests.async_mock import AsyncMock, Mock, patch from ...
GenericStudent/home-assistant
tests/helpers/test_update_coordinator.py
Python
apache-2.0
7,348
# Copyright (c) 2012 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...
mahak/neutron
neutron/cmd/ovs_cleanup.py
Python
apache-2.0
2,691
import sys sys.path.insert(1,"../../../") import h2o from tests import pyunit_utils import pandas as pd import zipfile import statsmodels.api as sm def link_functions_binomial(): print("Read in prostate data.") h2o_data = h2o.import_file(path=pyunit_utils.locate("smalldata/prostate/prostate_complete.csv...
madmax983/h2o-3
h2o-py/tests/testdir_algos/glm/pyunit_DEPRECATED_link_functions_binomialGLM.py
Python
apache-2.0
1,473
# -*- coding: utf-8 -*- # Copyright 2017, Digital Reasoning # # 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...
clarkperkins/stackdio
stackdio/core/viewsets.py
Python
apache-2.0
13,461
from .distillers import Distill, Distiller class NewsDistiller(Distiller): site = Distill("og:site_name") title = Distill("s:headline", "og:title") image_url = Distill("s:associatedMedia.ImageObject/url", "og:image") pub_date = Distill("s:datePublished") author = Distill("s:creator.Person/name", "...
emmett9001/schema.to
schemato/distillery.py
Python
apache-2.0
1,053
#!/usr/bin/env python2.7 import numpy as np import matplotlib.pyplot as plt Freq=np.array([30,40,45,50,53,55,60,65,70,80,90,95,98,100,110,120]) Db=np.array([70.5,78.6,83.2,88.4,87.5,86.7,85.2,83.9,85.1,88,95.7,100.4,100.4,99.2,94.7,94.9]) plt.xlabel('Frecuencia') plt.ylabel('Decibel') plt.title('DecibelvsFreq a 0.1vol...
P1R/cinves
TrabajoFinal/tubo350cm/2-DbvsFreq/tubo2huecos/DbvsFreq-Ampde0.1v-2huequitos.py
Python
apache-2.0
511
# Copyright 2014 ARM Limited # # Licensed under the Apache License, Version 2.0 # See LICENSE file for details. # standard library modules, , , import re import logging from collections import OrderedDict import functools import binascii import calendar import datetime import hashlib import base64 import os try: f...
autopulated/yotta
yotta/lib/registry_access.py
Python
apache-2.0
27,971
# Copyright (c) 2014 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...
tellesnobrega/sahara
sahara/utils/notification/sender.py
Python
apache-2.0
2,996
""" Module responsible for translating reference sequence data into GA4GH native objects. """ from __future__ import division from __future__ import print_function from __future__ import unicode_literals import hashlib import json import os import random import pysam import ga4gh.datamodel as datamodel import ga4gh....
diekhans/ga4gh-server
ga4gh/datamodel/references.py
Python
apache-2.0
15,873
# Copyright 2015-2017 Cisco Systems, Inc. # All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless req...
meidli/yabgp
yabgp/message/attribute/mpunreachnlri.py
Python
apache-2.0
9,951
import numpy as np import pytest import xarray as xr from aospy import Region from aospy.region import ( _get_land_mask, BoundsRect, ) from aospy.internal_names import ( LAT_STR, LON_STR, SFC_AREA_STR, LAND_MASK_STR ) from aospy.utils import Longitude @pytest.fixture() def values_for_reg_arr(...
spencerkclark/aospy
aospy/test/test_region.py
Python
apache-2.0
7,452
# Copyright (c) 2011-2014 OpenStack Foundation. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agre...
swiftstack/swift
test/unit/common/middleware/s3api/__init__.py
Python
apache-2.0
7,238
# Licensed to the StackStorm, Inc ('StackStorm') 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 use th...
alfasin/st2
st2actions/st2actions/utils/param_utils.py
Python
apache-2.0
14,817
# -*- coding: utf-8 -*- import sys import pytest py3 = sys.version_info[0] >= 3 class DummyCollector(pytest.collect.File): def collect(self): return [] def pytest_pycollect_makemodule(path, parent): bn = path.basename if "py3" in bn and not py3 or ("py2" in bn and py3): return DummyCol...
cloudera/hue
desktop/core/ext-py/pytest-4.6.11/doc/en/example/py2py3/conftest.py
Python
apache-2.0
348
#!/usr/bin/python # # 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 b...
caioserra/apiAdwords
examples/adspygoogle/dfp/v201311/user_team_association_service/get_user_team_associations_by_statement.py
Python
apache-2.0
2,518
import axi2s_c import sys uut = axi2s_c.axi2s_c() uut.read(sys.argv[1])
ruishihan/R7-with-notes
src/python/ioread.py
Python
apache-2.0
82
# Copyright 2010-2011 OpenStack Foundation # Copyright 2012-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/li...
Metaswitch/calico-nova
nova/tests/unit/db/test_migrations.py
Python
apache-2.0
28,211
from .estimator_base import * class H2OKMeansEstimator(H2OEstimator): def __init__(self, model_id=None, k=None, max_iterations=None,standardize=None,init=None,seed=None, nfolds=None,fold_assignment=None, user_points=None,ignored_columns=None, score_each_iteration=None, keep_cross_valid...
pchmieli/h2o-3
h2o-py/h2o/estimators/kmeans.py
Python
apache-2.0
4,684
# =============================================================================== # Copyright 2016 ross # # 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/LICE...
USGSDenverPychron/pychron
pychron/entry/tasks/project/project_manager.py
Python
apache-2.0
4,367
# 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...
resmo/cloudstack
test/integration/plugins/nuagevsp/test_nuage_vpc_internal_lb.py
Python
apache-2.0
123,514
#!/usr/bin/env python3 # Copyright 2020 Red Hat, Inc. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 #...
openstack/neutron
tools/files_in_patch.py
Python
apache-2.0
2,508
import re from scrapy.spider import BaseSpider from scrapy.selector import HtmlXPathSelector from scrapy.http import Request, FormRequest, HtmlResponse from scrapy.utils.response import get_base_url from scrapy.utils.url import urljoin_rfc from scrapy.http import FormRequest from productloader import load_product im...
0--key/lib
portfolio/Python/scrapy/inkshop/cartridgesavecouk.py
Python
apache-2.0
2,521
# Copyright (c) 2018 PaddlePaddle 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 app...
luotao1/Paddle
python/paddle/fluid/incubate/fleet/parameter_server/ir/ps_dispatcher.py
Python
apache-2.0
3,500
# (c) Copyright 2014 Cisco Systems Inc. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unl...
openstack/cinder
cinder/zonemanager/drivers/cisco/cisco_fc_zone_client_cli.py
Python
apache-2.0
20,088
# coding: utf-8 """ Kubernetes No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) OpenAPI spec version: v1.7.4 Generated by: https://github.com/swagger-api/swagger-codegen.git """ from __future__ import absolute_import import os import sys im...
djkonro/client-python
kubernetes/test/test_v1_event_source.py
Python
apache-2.0
843
# -*- encoding: utf-8 -*- # # 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 ...
xflin/spark
python/pyspark/sql/tests.py
Python
apache-2.0
131,465
# Copyright 2018 Red Hat, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agre...
openstack/diskimage-builder
diskimage_builder/elements/package-installs/tests/test_package_squash.py
Python
apache-2.0
7,323
__author__ = 'alexs' import theano.tensor as T import theano import numpy as np import cPickle import pandas as pd from sklearn.preprocessing import LabelEncoder from sklearn.preprocessing import StandardScaler import numpy as np import random import json def getReferenceLabels(): referenceLabels = dict() fo...
big-data-research/neuralnetworks_workshop_bucharest_2015
nn_demo/01nn_otto.py
Python
apache-2.0
11,593
#!/usr/bin/env python """ Copyright 2012 GroupDocs. 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...
liosha2007/temporary-groupdocs-python3-sdk
groupdocs/models/ChangePasswordResult.py
Python
apache-2.0
920
# Copyright (c) 2016 PaddlePaddle 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 applic...
gangliao/Paddle
python/paddle/v2/config_base.py
Python
apache-2.0
5,435
# Copyright (C) 2018 Red Hat, Inc # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable ...
mahak/nova
nova/tests/functional/libvirt/base.py
Python
apache-2.0
14,789
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2012 NEC Corporation # # 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 #...
tuskar/tuskar-ui
openstack_dashboard/dashboards/admin/networks/subnets/tables.py
Python
apache-2.0
2,757
import json import logging from django.core.management.base import BaseCommand from django.db import transaction from osf.models import AbstractProvider, PreprintProvider, PreprintService, Subject from osf.models.provider import rules_to_subjects from scripts import utils as script_utils from osf.models.validators im...
HalcyonChimera/osf.io
osf/management/commands/populate_custom_taxonomies.py
Python
apache-2.0
14,704
import os from geotrek.flatpages.models import FlatPage from geotrek.flatpages.views import FlatPageViewSet, FlatPageMeta from django.db.models import Q class SyncRando: def __init__(self, sync): self.global_sync = sync def sync(self, lang): self.global_sync.sync_geojson(lang, FlatPageViewS...
makinacorpus/Geotrek
geotrek/flatpages/helpers_sync.py
Python
bsd-2-clause
988
# -*- coding: utf-8 -*- from .dev import * # noqa INSTALLED_APPS += ( 'django_extensions', ) DATABASES = { 'default': { 'ENGINE': 'django.contrib.gis.db.backends.postgis', 'NAME': 'healthsites_dev', 'USER': '', 'PASSWORD': '', 'HOST': 'localhost', # Set to empt...
ismailsunni/healthsites
django_project/core/settings/dev_dodobas.py
Python
bsd-2-clause
1,782
"""This file contains information on how to translate different ufuncs into numba. It is a database of different ufuncs and how each of its loops maps to a function that implements the inner kernel of that ufunc (the inner kernel being the per-element function). Use the function get_ufunc_info to get the information r...
GaZ3ll3/numba
numba/targets/ufunc_db.py
Python
bsd-2-clause
34,872
# requests-oauth 0.4.0 # Hacked to support RSA-SHA1 encryption for Atlassian OAuth. # Original author: Miguel Araujo # Forked from https://github.com/maraujop/requests_oauth # Original license: 3-clause BSD from hook import OAuthHook
blackspiraldev/jira-python
jira/packages/requests_oauth/__init__.py
Python
bsd-2-clause
235
# -*- coding: UTF-8 -*- from lino.projects.std.settings import * import logging logging.getLogger('weasyprint').setLevel("ERROR") # see #1462 class Site(Site): title = "Lino@prj1" # server_url = "https://prj1.mydomain.com" SITE = Site(globals()) # locally override attributes of individual plugins # SIT...
lino-framework/book
docs/admin/mypy/prj1/settings.py
Python
bsd-2-clause
724
#!/usr/bin/python3 # # Copyright (C) 2012 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: # # 1. Redistributions of source code must retain the above copyright notice, # this list o...
ganeti/ganeti
test/py/ganeti.rapi.testutils_unittest.py
Python
bsd-2-clause
7,060
from tests import BaseTestCase import mock import time from redash.models import User from redash.authentication.account import invite_token from tests.handlers import get_request, post_request class TestInvite(BaseTestCase): def test_expired_invite_token(self): with mock.patch('time.time') as patched_ti...
easytaxibr/redash
tests/handlers/test_authentication.py
Python
bsd-2-clause
2,187
# # This file is part of pyasn1-modules software. # # Created by Russ Housley # Copyright (c) 2019, Vigil Security, LLC # License: http://snmplabs.com/pyasn1/license.html # import sys import unittest from pyasn1.codec.der.decoder import decode as der_decoder from pyasn1.codec.der.encoder import encode as der_encoder f...
etingof/pyasn1-modules
tests/test_rfc4043.py
Python
bsd-2-clause
4,870
{% extends 'setup.py.jj2' %} {%block platform_block%} {%endblock%} {%block additional_keywords%} "plain", "simple", "grid", "pipe", "orgtbl", "rst", "mediawiki", "latex", "latex_booktabs", "html", "json" {%endblock%}
pyexcel/pyexcel-text
.moban.d/setup.py
Python
bsd-3-clause
264
# -*- coding: utf-8 -*- # Licensed under a 3-clause BSD style license - see LICENSE.rst from __future__ import (absolute_import, division, print_function, unicode_literals) import io import os import sys import subprocess import pytest from ...tests.helper import catch_warnings from ...exter...
kelle/astropy
astropy/config/tests/test_configs.py
Python
bsd-3-clause
10,072
# coding: utf-8 """ Test cases for .hist method """ import pytest from pandas import Series, DataFrame import pandas.util.testing as tm import pandas.util._test_decorators as td import numpy as np from numpy.random import randn from pandas.plotting._core import grouped_hist from pandas.plotting._compat import _mpl...
harisbal/pandas
pandas/tests/plotting/test_hist_method.py
Python
bsd-3-clause
15,814
# -*- coding: utf-8 -*- """ Unit tests for reverse URL lookups. """ from __future__ import unicode_literals import sys import threading import unittest from admin_scripts.tests import AdminScriptTestCase from django.conf import settings from django.conf.urls import include, url from django.contrib.auth.models import...
dfunckt/django
tests/urlpatterns_reverse/tests.py
Python
bsd-3-clause
50,749
from __future__ import with_statement import pytest from django.core import mail from django.db import connection from pytest_django_test.app.models import Item # It doesn't matter which order all the _again methods are run, we just need # to check the environment remains constant. # This is possible with some of t...
tomviner/pytest-django
tests/test_environment.py
Python
bsd-3-clause
6,155
# Authors: Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr> # License: BSD 3 clause import numpy as np from scipy import sparse from sklearn.utils.testing import (assert_array_almost_equal, assert_equal, assert_greater, assert_almost_equal, ...
toastedcornflakes/scikit-learn
sklearn/tests/test_calibration.py
Python
bsd-3-clause
12,016
import re from project.models import PageChunk contacts_map_coordinates = \ re.compile( r".*" r"@(?P<latitude>\-?[\d\.]+)," r"(?P<longitude>\-?[\d\.]+)," r"(?P<zoom>[\d\.]+)z" r".*" ) def inject_pagechunks(): chunks = {chunk.name: chunk.text for chunk in PageChunk...
uaprom-summer-2015/Meowth
project/utils.py
Python
bsd-3-clause
368
from openstatesapi.jurisdiction import make_jurisdiction J = make_jurisdiction('nd') J.url = 'http://nd.gov'
sunlightlabs/billy
billy2pupa/nd.py
Python
bsd-3-clause
110
""" sentry.web.forms.accounts ~~~~~~~~~~~~~~~~~~~~~~~~~ :copyright: (c) 2010-2014 by the Sentry Team, see AUTHORS for more details. :license: BSD, see LICENSE for more details. """ from __future__ import absolute_import import pytz import six from datetime import datetime from django import forms from django.conf im...
looker/sentry
src/sentry/web/forms/accounts.py
Python
bsd-3-clause
29,165
from __future__ import print_function import string import sys from collections import deque import numpy as np from sklearn.base import BaseEstimator from sklearn.utils import check_array, check_random_state from sklearn.utils.validation import check_is_fitted from . import _hmmc from .utils import normalize, logsu...
stringertheory/hmmlearn
hmmlearn/base.py
Python
bsd-3-clause
19,415
import unittest import numpy as np from robo.models.bayesian_linear_regression import BayesianLinearRegression class TestBayesianLinearRegression(unittest.TestCase): def setUp(self): self.X = np.random.rand(10, 1) y = self.X * 2 self.y = y[:, 0] self.model = BayesianLinearRegress...
numairmansur/RoBO
test/test_models/test_bayesian_linear_regression.py
Python
bsd-3-clause
1,352
""" Package for handling logical expressions. """ from .boolalg import (ITE, And, Equivalent, Implies, Nand, Nor, Not, Or, POSform, SOPform, Xor, bool_map, false, simplify_logic, to_cnf, to_dnf, to_nnf, true) from .inference import satisfiable __all__ = ('ITE', 'And', 'Equ...
skirpichev/omg
diofant/logic/__init__.py
Python
bsd-3-clause
512
# -*- coding: utf-8 -*- """ werkzeug.exceptiosn test ~~~~~~~~~~~~~~~~~~~~~~~~ :copyright: (c) 2011 by the Werkzeug Team, see AUTHORS for more details. :license: BSD license. """ from nose.tools import assert_raises from werkzeug import exceptions from werkzeug.exceptions import Aborter, abort from wer...
r-kitaev/lucid-python-werkzeug
tests/test_exceptions.py
Python
bsd-3-clause
2,680
import os import finder import re import sys def makefilter(name, xtrapath=None): typ, nm, fullname = finder.identify(name, xtrapath) if typ in (finder.SCRIPT, finder.GSCRIPT, finder.MODULE): return ModFilter([os.path.splitext(nm)[0]]) if typ == finder.PACKAGE: return PkgFilter([fullname]) ...
toontownfunserver/Panda3D-1.9.0
direct/pyinst/tocfilter.py
Python
bsd-3-clause
4,386
from __future__ import absolute_import from rest_framework.response import Response from sentry.plugins.base import plugins from sentry.api.bases.project import ProjectEndpoint from sentry.api.serializers import serialize from sentry.api.serializers.models.plugin import PluginSerializer class ProjectPluginsEndpoint...
beeftornado/sentry
src/sentry/api/endpoints/project_plugins.py
Python
bsd-3-clause
605
# -*- coding: utf-8 -*- import logging, logging.handlers from django.conf import settings def get_logger(name, level=logging.INFO, format='[%(asctime)s] %(message)s', handler=None, filename=None): new_logger = logging.getLogger(name) new_logger.setLevel(level) if not handler: filename = filename...
leliel12/handy
handy/logger.py
Python
bsd-3-clause
733
from __future__ import absolute_import import os from celery import Celery # set the default Django settings module for the 'celery' program. os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'config.settings.production') from django.conf import settings app = Celery('tecnoservicio.tareas') # Using a string here me...
flipjack/tecnoservicio
config/settings/celery.py
Python
bsd-3-clause
588