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
""" .. _ex-limo-data: ============================================================= Single trial linear regression analysis with the LIMO dataset ============================================================= Here we explore the structure of the data contained in the `LIMO dataset`_. This example replicates and extend...
Teekuningas/mne-python
examples/datasets/plot_limo_data.py
Python
bsd-3-clause
13,302
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ The astropy.utils.iers package provides access to the tables provided by the International Earth Rotation and Reference Systems Service, in particular allowing interpolation of published UT1-UTC values for given times. These are used in `astropy.time`...
larrybradley/astropy
astropy/utils/iers/iers.py
Python
bsd-3-clause
46,942
#!/usr/bin/env python ########################################################################## # # Copyright (c) 2020, Cinesite VFX Ltd. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # ...
GafferHQ/gaffer
.github/workflows/main/setBuildVars.py
Python
bsd-3-clause
6,394
#! /usr/bin/env python """ Notes ----- Calculations are carried out with numpy.float64 precision. This Python implementation is not optimized for speed. Angles are in radians unless specified otherwise. Quaternions ix+jy+kz+w are represented as [x, y, z, w]. """ import rospy # Messages from std_msgs.msg import Float...
fsuarez6/rate_position_controller
scripts/bubble_technique.py
Python
bsd-3-clause
12,314
""" All of pandas' ExtensionArrays. See :ref:`extending.extension-types` for more. """ from pandas.core.arrays import ( IntervalArray, PeriodArray, Categorical, SparseArray, IntegerArray, PandasArray, DatetimeArray, TimedeltaArray, ) __all__ = [ 'Categorical', 'DatetimeArray', 'IntegerArr...
GuessWhoSamFoo/pandas
pandas/arrays/__init__.py
Python
bsd-3-clause
427
from django.shortcuts import render from django.contrib.auth.decorators import permission_required from django.conf import settings from django.template import RequestContext from django.template.loader import render_to_string from wagtail.wagtailadmin import hooks from wagtail.wagtailcore.models import Page, PageRev...
suziesparkle/wagtail
wagtail/wagtailadmin/views/home.py
Python
bsd-3-clause
2,933
from tests.base import TestCase from vilya.models.project import CodeDoubanProject from vilya.models.project_conf import PROJECT_CONF_FILE from nose.tools import raises class TestProjectConf(TestCase): def test_create_project_without_conf(self): self.clean_up() project = CodeDoubanProject.add( ...
xtao/code
tests/test_project_conf.py
Python
bsd-3-clause
2,543
# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # --------------------------------------------------------------------...
QingChenmsft/azure-cli
src/command_modules/azure-cli-extension/azure/cli/command_modules/extension/__init__.py
Python
mit
698
__all__ = [ 'diff', 'dirs', 'flushfile', 'id', 'stats', 'sync' ]
bkahlert/seqan-research
raw/workshop11/workshop2011-data-20110925/trunk/misc/seqan_instrumentation/py2exe/dist/classes/__init__.py
Python
mit
81
import os import tempfile import unittest from node import db_store, setup_db class TestDbOperations(unittest.TestCase): """Test DB operations in an unencrypted DB.""" disable_sqlite_crypt = True @classmethod def setup_path(cls): cls.db_dir = tempfile.mkdtemp() cls.db_path = os.path...
akhavr/OpenBazaar
tests/test_db_store.py
Python
mit
5,980
# License MIT (https://opensource.org/licenses/MIT). from . import models from . import controllers
it-projects-llc/pos-addons
wechat/__init__.py
Python
mit
100
import logging import colander from grano.core import db, celery from grano.model import Entity from grano.logic import properties as properties_logic from grano.logic.references import ProjectRef, AccountRef from grano.logic.references import SchemaRef, EntityRef from grano.plugins import notify_plugins log = loggi...
CodeForAfrica/grano
grano/logic/entities.py
Python
mit
6,574
"""Helpers for listening to events.""" import functools as ft from datetime import timedelta from ..const import ( ATTR_NOW, EVENT_STATE_CHANGED, EVENT_TIME_CHANGED, MATCH_ALL) from ..util import dt as dt_util def track_state_change(hass, entity_ids, action, from_state=None, to_state=None)...
justyns/home-assistant
homeassistant/helpers/event.py
Python
mit
7,340
#!/bin/python import os, subprocess import logging from autotest.client import test from autotest.client.shared import error class pciutils(test.test): """ Autotest module for testing basic functionality of pciutils @author Andrew Pham, apham@austin.ibm.com """ version = 1 nfail = 0 ...
PoornimaNayak/autotest-client-tests
linux-tools/pciutils/pciutils.py
Python
gpl-2.0
1,172
#!/usr/bin/env python # -*- coding: utf-8 -*- # # $Id$ # # Copyright 2009 Glencoe Software, Inc. All rights reserved. # Use is subject to license terms supplied in LICENSE.txt # # General build scripts. import os import sys import subprocess BUILD_PY = "-Dbuild.py=true" def popen(args, stdin=None, stdout=subprocess...
jburel/openmicroscopy
build.py
Python
gpl-2.0
3,952
# This file is part of BurnMan - a thermoelastic and thermodynamic toolkit for the Earth and Planetary Sciences # Copyright (C) 2012 - 2015 by the BurnMan team, released under the GNU # GPL v2 or later. ''' example_build_planet -------------------- For Earth we have well-constrained one-dimensional density models. ...
lordkman/burnman
examples/example_build_planet.py
Python
gpl-2.0
7,538
#!/usr/bin/env python # 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 the hope that ...
narasimhan-v/avocado-misc-tests-1
io/net/bridge.py
Python
gpl-2.0
4,362
import os import sys import tempfile import shutil import random import tarfile from copy import deepcopy from unittest import TestCase from mock import Mock, patch from base import ServerTests import mock from nectar.downloaders.local import LocalFileDownloader from nectar.config import DownloaderConfig sys.path.i...
nthien/pulp
nodes/test/nodes_tests/test_plugins.py
Python
gpl-2.0
37,679
import _surface import chimera try: import chimera.runCommand except: pass from VolumePath import markerset as ms try: from VolumePath import Marker_Set, Link new_marker_set=Marker_Set except: from VolumePath import volume_path_dialog d= volume_path_dialog(True) new_marker_set= d.new_marker_set marker_set...
batxes/4Cin
SHH_WT_models/SHH_WT_models_final_output_0.1_-0.1_11000/mtx1_models/SHH_WT_models8077.py
Python
gpl-3.0
17,576
from couchpotato.core.logger import CPLog from couchpotato.core.notifications.base import Notification log = CPLog(__name__) class Trakt(Notification): urls = { 'base': 'http://api.trakt.tv/%s', 'library': 'movie/library/%s', 'unwatchlist': 'movie/unwatchlist/%s', } listen_to = [...
rooi/CouchPotatoServer
couchpotato/core/notifications/trakt/main.py
Python
gpl-3.0
1,553
from networkx.algorithms.isomorphism.isomorph import * from networkx.algorithms.isomorphism.vf2userfunc import * from networkx.algorithms.isomorphism.matchhelpers import * from networkx.algorithms.isomorphism.temporalisomorphvf2 import * from networkx.algorithms.isomorphism.ismags import * from networkx.algorithms.isom...
SpaceGroupUCL/qgisSpaceSyntaxToolkit
esstoolkit/external/networkx/algorithms/isomorphism/__init__.py
Python
gpl-3.0
354
# -*- coding: utf-8 -*- # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and contributors # For license information, please see license.txt from __future__ import unicode_literals import frappe from frappe import _ from frappe.utils import flt from frappe.model.document import Document from erpnext.education.api im...
manassolanki/erpnext
erpnext/education/doctype/assessment_result/assessment_result.py
Python
gpl-3.0
2,265
import logging from urlparse import urlparse from django.core.management.base import BaseCommand from kombu import (Connection, Exchange) from kombu.messaging import Producer logger = logging.getLogger(__name__) class Command(BaseCommand): """ Management command to publish a job to a puls...
tojon/treeherder
treeherder/etl/management/commands/publish_to_pulse.py
Python
mpl-2.0
1,737
# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) class PyAzureMgmtIotcentral(PythonPackage): """Microsoft Azure IoTCentral Management Client Library for Python.""" ...
LLNL/spack
var/spack/repos/builtin/packages/py-azure-mgmt-iotcentral/package.py
Python
lgpl-2.1
955
# This file is part of PyEMMA. # # Copyright (c) 2016 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 version 3 o...
gph82/PyEMMA
pyemma/thermo/util/__init__.py
Python
lgpl-3.0
790
# Copyright (C) 2013 Hewlett-Packard Development Company, L.P. # 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/LICEN...
swamireddy/python-cinderclient
cinderclient/tests/v2/test_volume_backups.py
Python
apache-2.0
2,562
# Copyright 2012 Grid Dynamics # 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...
vmthunder/nova
nova/tests/virt/libvirt/test_imagebackend.py
Python
apache-2.0
53,414
# Copyright 2017 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...
sharifelgamal/runtimes-common
ftl/php/builder.py
Python
apache-2.0
2,878
# Copyright 2008 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 or agreed to in writing, ...
damonkohler/statsmonkey
auth/tests.py
Python
apache-2.0
1,407
"""Class to hold all media player accessories.""" import logging from pyhap.const import CATEGORY_SWITCH from homeassistant.components.media_player import ( ATTR_INPUT_SOURCE, ATTR_INPUT_SOURCE_LIST, ATTR_MEDIA_VOLUME_LEVEL, ATTR_MEDIA_VOLUME_MUTED, DOMAIN, SERVICE_SELECT_SOURCE, SUPPORT_P...
lukas-hetzenecker/home-assistant
homeassistant/components/homekit/type_media_players.py
Python
apache-2.0
13,280
from __future__ import absolute_import import logging import time from collections import namedtuple from multiprocessing import Process, Manager as MPManager try: from Queue import Empty, Full except ImportError: # python 2 from queue import Empty, Full from .base import ( AUTO_COMMIT_MSG_COUNT, AUTO_...
vshlapakov/kafka-python
kafka/consumer/multiprocess.py
Python
apache-2.0
10,236
# Copyright 2012 Nebula, Inc. # 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...
whitepages/nova
nova/tests/functional/api_sample_tests/test_shelve.py
Python
apache-2.0
2,280
# 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...
areitz/pants
src/python/pants/backend/jvm/tasks/scala_repl.py
Python
apache-2.0
2,743
""" 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 use this ...
arenadata/ambari
ambari-server/src/main/resources/stacks/BigInsights/4.2/services/KNOX/package/scripts/ldap.py
Python
apache-2.0
1,729
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2012 Locaweb. # 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/license...
vijayendrabvs/hap
neutron/tests/unit/test_iptables_manager.py
Python
apache-2.0
28,031
# coding: utf-8 from __future__ import absolute_import from datetime import date, datetime # noqa: F401 from typing import List, Dict # noqa: F401 from tapi_server.models.base_model_ import Model from tapi_server.models.tapi_odu_deg_thr_type import TapiOduDegThrType # noqa: F401,E501 from tapi_server.models.tapi_...
karthik-sethuraman/ONFOpenTransport
RI/flask_server/tapi_server/models/tapi_odu_deg_thr.py
Python
apache-2.0
3,907
# 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...
annarev/tensorflow
tensorflow/python/keras/optimizer_v2/nadam.py
Python
apache-2.0
9,337
""" BIC for LINEAR light curve -------------------------- Figure 10.19 BIC as a function of the number of frequency components for the light curve shown in figure 10.18. BIC for the two prominent frequency peaks is shown. The inset panel details the area near the maximum. For both frequencies, the BIC peaks at between...
nhuntwalker/astroML
book_figures/chapter10/fig_LINEAR_BIC.py
Python
bsd-2-clause
3,400
import esda import giddy import inequality import pointpats import spaghetti import segregation
sjsrey/pysal
pysal/explore/__init__.py
Python
bsd-3-clause
96
############################################################################# # Copyright (c) 2010 by Casey Duncan # 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 c...
wrightjb/bolt-planar
transform.py
Python
bsd-3-clause
12,182
#!/usr/bin/env python strings=['hey','guys','i','am','a','string'] parameter_list=[[strings]] def features_string_char (strings): from shogun import StringCharFeatures, RAWBYTE from numpy import array #create string features f=StringCharFeatures(strings, RAWBYTE) #and output several stats #print("max string l...
lambday/shogun
examples/undocumented/python/features_string_char.py
Python
bsd-3-clause
792
""" This module converts requested URLs to callback view functions. RegexURLResolver is the main class here. Its resolve() method takes a URL (as a string) and returns a tuple in this format: (view_function, function_args, function_kwargs) """ from __future__ import unicode_literals import re from threading impo...
pjdelport/django
django/core/urlresolvers.py
Python
bsd-3-clause
21,379
from __future__ import absolute_import from django.conf import settings from django.core.exceptions import ImproperlyConfigured from django.test import TestCase from .models import (AppConf, TestConf, PrefixConf, YetAnotherPrefixConf, SeparateConf, ProxyConf, CustomHolderConf,...
treyhunner/django-appconf
tests/tests.py
Python
bsd-3-clause
5,628
#!/usr/bin/env python2.6 # -*- coding: utf-8 -*- # Thanks to Jonas Kjellström and Cody Boisclair for their help in finding bugs in this script! import re import os import sys import tempfile from fontTools.ttLib import TTFont, newTable doc = """USAGE: python /path/to/inputCustomize.py [INPUT] [--dest=OUTPUT] [OPTION...
danrharms/harmsway
repos/fonts/terminus-font-4.46/alt/Input-Font/Scripts/inputCustomize.py
Python
mit
9,734
from iktomi.utils import cached_property from .base import Cli class LazyCli(Cli): ''' Wrapper for creating lazy command digests. Sometimes it is not needed to import all of application parts to start a particular command. LazyCli allows you to define all imports in a function called only on the ...
boltnev/iktomi
iktomi/cli/lazy.py
Python
mit
1,023
# encoding: 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): # Deleting model 'Repo' db.delete_table('package_repo') # Deleting field 'Package.repo' d...
miketheman/opencomparison
package/migrations/0015_auto__del_repo__del_field_package_repo.py
Python
mit
10,959
''' Test cases for pyclbr.py Nick Mathewson ''' from test.test_support import run_unittest import unittest, sys from types import ClassType, FunctionType, MethodType, BuiltinFunctionType import pyclbr from unittest import TestCase StaticMethodType = type(staticmethod(lambda: None)) ClassMethodType = type(classme...
xbmc/atv2
xbmc/lib/libPython/Python/Lib/test/test_pyclbr.py
Python
gpl-2.0
7,102
#! /usr/bin/env python import os, sys, tempfile, shutil, hashlib, tarfile import cgi, cgitb cgitb.enable() PKGDIR = os.environ.get('PKGDIR', os.path.abspath('../packages')) # Upload a package to the package directory. # It is meant to contain a list of tar packages: # # PKGDIR/pkgname/pkgver/common.tar # PKGDIR/pkgn...
evancich/apm_motor
modules/waf/playground/distnet/server/cgi-bin/upload.py
Python
gpl-3.0
1,298
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. from odoo import api, fields, models, _ from odoo.exceptions import ValidationError import odoo.addons.decimal_precision as dp class Event(models.Model): _inherit = 'event.event' def _default_tickets(self): ...
chienlieu2017/it_management
odoo/addons/event_sale/models/event.py
Python
gpl-3.0
7,511
#!/usr/bin/python # -*- coding: utf-8 import unittest import tempfile from test_base import * from gp.client import * def read_lines( filepath ): f = open(filepath, 'ra') lines = [ s for s in f ] f.close() return lines # Tests a connection to a slave process, as well as general client # lib fu...
wmde/render-algbackend
gp/tests/slave_test.py
Python
gpl-3.0
11,673
from __future__ import unicode_literals from frappe import _ def get_data(): return [ { "label": _("Stock Transactions"), "items": [ { "type": "doctype", "name": "Stock Entry", "description": _("Record item movement."), }, { "type": "doctype", "name": "Delivery Note", ...
emmuchira/kps_erp
erpnext/config/stock.py
Python
gpl-3.0
7,192
# -*- coding: utf-8 -*- # © 2015 Antiun Ingenieria S.L. - Antonio Espinosa # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). from openerp.tests.common import TransactionCase from openerp import fields from email.utils import formataddr # One test case per method class TestResPartner(TransactionCas...
open-synergy/social
mass_mailing_statistic_extra/tests/test_mail_mail.py
Python
agpl-3.0
2,279
# Copyright 2013-2016 DataStax, 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 writi...
Richard-Mathie/cassandra_benchmark
vendor/github.com/datastax/python-driver/tests/integration/long/test_ipv6.py
Python
apache-2.0
4,499
# 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 applicable ...
sandeepdsouza93/TensorFlow-15712
tensorflow/contrib/training/python/training/evaluation.py
Python
apache-2.0
21,638
# -*- coding: utf-8 -*- import datetime from django.utils.translation import get_language from django.conf import settings class LanguageCookieMiddleware(object): def process_response(self, request, response): language = get_language() if settings.LANGUAGE_COOKIE_NAME in request.COOKIES and \ ...
mpetyx/palmdrop
venv/lib/python2.7/site-packages/cms/middleware/language.py
Python
apache-2.0
722
#!/usr/bin/env python # Copyright (C) 2012 OpenStack, 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...
sunyi00/jenkins-job-builder
jenkins_jobs/builder.py
Python
apache-2.0
12,420
"""Selectors for Home Assistant.""" from __future__ import annotations from collections.abc import Callable from typing import Any, cast import voluptuous as vol from homeassistant.const import CONF_MODE, CONF_UNIT_OF_MEASUREMENT from homeassistant.util import decorator SELECTORS = decorator.Registry() def valida...
jawilson/home-assistant
homeassistant/helpers/selector.py
Python
apache-2.0
5,138
# 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 appli...
Canpio/Paddle
python/paddle/fluid/tests/unittests/test_elementwise_pow_op.py
Python
apache-2.0
1,482
"""Support for Axis devices.""" import voluptuous as vol from homeassistant import config_entries from homeassistant.const import ( CONF_DEVICE, CONF_MAC, CONF_NAME, CONF_TRIGGER_TIME, EVENT_HOMEASSISTANT_STOP, ) from homeassistant.helpers import config_validation as cv from .config_flow import D...
fbradyirl/home-assistant
homeassistant/components/axis/__init__.py
Python
apache-2.0
2,370
# ---------------------------------------------------------------------------- # pyglet # Copyright (c) 2006-2007 Alex Holkner # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # # * Redistribu...
hazelnusse/sympy-old
sympy/thirdparty/pyglet/pyglet/gl/agl.py
Python
bsd-3-clause
28,537
import unittest from nose.tools import (assert_equal, assert_raises, assert_in, assert_not_in) import numpy from scipy.stats import randint, uniform from sklearn.grid_search import GridSearchCV, RandomizedSearchCV from sklearn.cross_validation import cross_val_score from sknn.mlp import Regressor as MLPR, Classifier...
gticket/scikit-neuralnetwork
sknn/tests/test_sklearn.py
Python
bsd-3-clause
2,706
from sympy.external import import_module from sympy.utilities.pytest import warns # fixes issue that arose in addressing issue 6533 def test_no_stdlib_collections(): ''' make sure we get the right collections when it is not part of a larger list ''' import collections matplotlib = import_module...
kaushik94/sympy
sympy/external/tests/test_importtools.py
Python
bsd-3-clause
1,405
# This file is part of QuTiP: Quantum Toolbox in Python. # # Copyright (c) 2011 and later, Paul D. Nation and Robert J. Johansson. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: ...
zasdfgbnm/qutip
qutip/entropy.py
Python
bsd-3-clause
10,172
# -*- coding: utf-8 -*- """ DBSCAN: Density-Based Spatial Clustering of Applications with Noise """ # Author: Robert Layton <robertlayton@gmail.com> # Joel Nothman <joel.nothman@gmail.com> # Lars Buitinck # # License: BSD 3 clause import warnings import numpy as np from scipy import sparse from ..ba...
valexandersaulys/airbnb_kaggle_contest
venv/lib/python3.4/site-packages/sklearn/cluster/dbscan_.py
Python
gpl-2.0
12,482
import os,logging from autotest.client.shared import error from virttest import utils_test def run_9p(test, params, env): """ Run an autotest test inside a guest. @param test: kvm test object. @param params: Dictionary with test parameters. @param env: Dictionary with the test environment. ""...
ehabkost/virt-test
qemu/tests/9p.py
Python
gpl-2.0
1,818
import PHPDeserializer import sys class HordeSignatureConverter: def __init__(self, user, domain): self.user = user self.domain = domain self.domainLen = len(domain) def fetchSignatures(self, conn): self.signatures = None self.conn = conn self.fetchIdentities() ...
SlavekB/sogo
Migration/Horde/HordeSignatureConverter.py
Python
gpl-2.0
2,559
# -*- coding: utf-8 -*- # Copyright: (c) 2017 Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type from itertools import product import pytest # the module we are actually te...
shepdelacreme/ansible
test/units/module_utils/test_distribution_version.py
Python
gpl-3.0
39,710
from pylons import tmpl_context as c from adhocracy.lib.auth import can from util import render_tile, BaseTile class VariantRow(object): def __init__(self, tile, variant, poll): self.tile = tile self.variant = variant self.poll = poll if tile.frozen: freeze_time = til...
DanielNeugebauer/adhocracy
src/adhocracy/lib/tiles/selection_tiles.py
Python
agpl-3.0
2,711
# Copyright 2015, Province of British Columbia # License: https://github.com/bcgov/ckanext-bcgov/blob/master/license import ckan.plugins.toolkit as toolkit from ckan.logic import get_action, NotFound def get_tag_name(vocab_id, tag_id): '''Returns the name of a tag for a given vocabulary and tag id. Eac...
gjlawran/ckanext-bcgov
ckanext/bcgov/util/__init__.py
Python
agpl-3.0
965
"""manage frames Revision ID: 5a590ae95255 Revises: 59f4456a029 Create Date: 2015-11-25 16:43:10.104442 """ # revision identifiers, used by Alembic. revision = '5a590ae95255' down_revision = '14346346596e' from alembic import op import sqlalchemy as sa def upgrade(): op.create_table('frame', sa.Column('id'...
ballouche/navitia
source/sql/alembic/versions/5a590ae95255_manage_frames.py
Python
agpl-3.0
1,090
# OpenSCAD gui init module # # Gathering all the information to start FreeCAD # This is the second one of three init scripts, the third one # runs when the gui is up #*************************************************************************** #* (c) Juergen Riegel (juergen.riegel@web.de) 2002 *...
sanguinariojoe/FreeCAD
src/Mod/OpenSCAD/InitGui.py
Python
lgpl-2.1
5,293
from website.addons.base.serializer import OAuthAddonSerializer from website.addons.googledrive.exceptions import ExpiredAuthError class GoogleDriveSerializer(OAuthAddonSerializer): @property def addon_serialized_urls(self): node = self.node_settings.owner return { 'files': node....
haoyuchen1992/osf.io
website/addons/googledrive/serializer.py
Python
apache-2.0
1,189
# Copyright 2015 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...
tensorflow/tensorflow
tensorflow/python/framework/traceable_stack_test.py
Python
apache-2.0
5,145
# 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...
karllessard/tensorflow
tensorflow/python/saved_model/nested_structure_coder.py
Python
apache-2.0
17,543
import unittest import copy import json import os from mock import patch, MagicMock from common import RESOURCE_3, SQS_MESSAGE_5 from c7n_mailer.slack_delivery import SlackDelivery from c7n_mailer.email_delivery import EmailDelivery SLACK_TOKEN = "slack-token" SLACK_POST_MESSAGE_API = "https://slack.com/api/chat.pos...
capitalone/cloud-custodian
tools/c7n_mailer/tests/test_slack.py
Python
apache-2.0
8,070
# Copyright 2012 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # Copyright 2012 Nebula, Inc. # Copyright (c) 2012 X.commerce, a business unit of eBay Inc. # # Licensed under the Apache License, Version 2.0 (the "License")...
zouyapeng/horizon-newtouch
openstack_dashboard/test/api_tests/nova_tests.py
Python
apache-2.0
10,232
import time import pytest import logging from cassandra import Unauthorized from ccmlib.common import is_win from ccmlib.node import Node from dtest_setup_overrides import DTestSetupOverrides from dtest import Tester from tools.assertions import assert_all, assert_invalid from tools.misc import ImmutableMapping sin...
beobal/cassandra-dtest
upgrade_internal_auth_test.py
Python
apache-2.0
9,980
## This file is part of Scapy ## See http://www.secdev.org/projects/scapy for more informations ## Copyright (C) Philippe Biondi <phil@secdev.org> ## Copyright (C) 6WIND <olivier.matz@6wind.com> ## This program is published under a GPLv2 license """ SCTP (Stream Control Transmission Protocol). """ import struct from...
mytliulei/Scapy
scapy/layers/sctp.py
Python
apache-2.0
17,954
"""Back-end code to support the OSF Preregistration campaign Keeping the code together in this file should make it easier to remove the features added to the OSF specifically to support this initiative in the future. Other resources that are a part of the OSF Preregistration: * website/static/js/pages/reg-landing-pa...
mfraezz/osf.io
website/prereg/views.py
Python
apache-2.0
508
# -*- coding: UTF-8 -*- # Authors: Thomas Hartmann <thomas.hartmann@th-ht.de> # Dirk Gütlin <dirk.guetlin@stud.sbg.ac.at> # # License: BSD (3-clause) import numpy as np from .utils import _create_info, _set_tmin, _create_events, \ _create_event_metadata, _validate_ft_struct from .. import RawArray from ....
Teekuningas/mne-python
mne/io/fieldtrip/fieldtrip.py
Python
bsd-3-clause
6,508
# mapper/util.py # Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 Michael Bayer # mike_mp@zzzcomputing.com # # This module is part of SQLAlchemy and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php import sqlalchemy.exceptions as sa_exc from sqlalchemy import sql, util from sql...
dbbhattacharya/kitsune
vendor/packages/sqlalchemy/lib/sqlalchemy/orm/util.py
Python
bsd-3-clause
23,666
from __future__ import unicode_literals from django import forms from django.contrib.contenttypes.forms import generic_inlineformset_factory from django.contrib.contenttypes.models import ContentType from django.core.exceptions import FieldError from django.db.models import Q from django.test import TestCase from djan...
Sonicbids/django
tests/generic_relations/tests.py
Python
bsd-3-clause
25,137
from __future__ import print_function import sys import json from pandas.io.common import urlopen from datetime import datetime class Milestone(object): def __init__(self, title, number): self.title = title self.number = number def __eq__(self, other): if isinstance(other, Milestone)...
jmmease/pandas
scripts/gen_release_notes.py
Python
bsd-3-clause
2,434
""" Compute a harmonic 1-cochain basis for a square with 4 holes. """ from numpy import asarray, eye, outer, inner, dot, vstack from numpy.random import seed, rand from numpy.linalg import norm from scipy.sparse.linalg import cg from pydec import d, delta, simplicial_complex, read_mesh def hodge_decomposition(omega):...
pkuwwt/pydec
Examples/HodgeDecomposition/driver.py
Python
bsd-3-clause
2,724
import sys import time from concurrent import futures from random import randrange from arcfour import arcfour JOBS = 12 SIZE = 2**18 KEY = b"'Twas brillig, and the slithy toves\nDid gyre" STATUS = '{} workers, elapsed time: {:.2f}s' def arcfour_test(size, key): in_text = bytearray(randrange(256) for i in range...
everaldo/example-code
17-futures/crypto/arcfour_futures.py
Python
mit
1,219
#!c:\\python\\python.exe import getopt import sys sys.path.append(r"../../../paimei") import utils import pgraph USAGE = "\nUSAGE: crashbin_explorer.py <xxx.crashbin>" \ "\n [-t|--test #] dump the crash synopsis for a specific test case number" \ "\n [...
cirosantilli/sulley
utils/crashbin_explorer.py
Python
gpl-2.0
2,593
# This file is part of beets. # Copyright 2014, Adrian Sampson. # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, ...
DxCx/nzbToMedia
libs/beets/mediafile.py
Python
gpl-3.0
56,908
#!/usr/bin/env python # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. from __future__ import absolute_import, print_function, unicode_literals import argparse import ...
StYaphet/firefox-ios
taskcluster/scripts/get-secret.py
Python
mpl-2.0
2,717
# -*- coding: utf-8 -*- # This file is part of Shoop. # # Copyright (c) 2012-2015, Shoop Ltd. All rights reserved. # # This source code is licensed under the AGPLv3 license found in the # LICENSE file in the root directory of this source tree. from decimal import Decimal from shoop.core.models.units import SalesUnit ...
arth-co/shoop
shoop_tests/core/test_sales_unit.py
Python
agpl-3.0
775
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals import frappe from frappe.utils import cstr, flt, cint, nowdate, now, add_days, comma_and from frappe import msgprint, _ from frappe.model.document im...
rohitwaghchaure/GenieManager-erpnext
erpnext/manufacturing/doctype/production_planning_tool/production_planning_tool.py
Python
agpl-3.0
15,108
# # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # ...
rdo-management/heat
heat/api/cfn/v1/signal.py
Python
apache-2.0
2,047
# 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...
kchodorow/tensorflow
tensorflow/contrib/bayesflow/python/kernel_tests/stochastic_variables_test.py
Python
apache-2.0
6,122
# coding: utf-8 # 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 ap...
sesamesushi/desatisrevu
tests/functional/review_stats.py
Python
apache-2.0
4,268
DEFAULT_DOCKER_API_VERSION = '1.19' DEFAULT_TIMEOUT_SECONDS = 60 STREAM_HEADER_SIZE_BYTES = 8 CONTAINER_LIMITS_KEYS = [ 'memory', 'memswap', 'cpushares', 'cpusetcpus' ]
Melraidin/docker-py
docker/constants.py
Python
apache-2.0
173
""" Manage OS-level configuration """ import logging l = logging.getLogger("angr.simos") from archinfo import ArchARM, ArchMIPS32, ArchX86, ArchAMD64 from simuvex import SimState, SimIRSB, SimStateSystem, SimActionData from simuvex import s_options as o from simuvex.s_procedure import SimProcedure, SimProcedureContin...
GuardianRG/angr
angr/simos.py
Python
bsd-2-clause
19,350
# Copyright (c) 2010, 2011 Linaro Limited # 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 co...
makinacorpus/linaro-django-pagination
linaro_django_pagination/test_project/tests.py
Python
bsd-3-clause
1,764
from matplotlib.patches import _Style, FancyArrowPatch from matplotlib.transforms import IdentityTransform from matplotlib.path import Path import numpy as np class _FancyAxislineStyle: class SimpleArrow(FancyArrowPatch): """ The artist class that will be returned for SimpleArrow style. """...
lthurlow/Network-Grapher
proj/external/matplotlib-1.2.1/lib/mpl_toolkits/axisartist/axisline_style.py
Python
mit
5,156
# http://stackoverflow.com/a/33822606 -- `from None` disables Python 3' # semi-smart exception chaining, which we don't want in this case. def reraise_impl(e, traceback): raise e.with_traceback(traceback) from None
dianchen96/gym
utils/reraise_impl_py3.py
Python
mit
219
from gettext import gettext as _ import glob import gzip import logging import os import shutil import traceback from xml.sax.saxutils import XMLGenerator from pulp.common import error_codes from pulp.server.exceptions import PulpCodedValidationException, PulpCodedException from verification import CHECKSUM_FUNCTION...
credativ/pulp
server/pulp/plugins/util/metadata_writer.py
Python
gpl-2.0
16,777
from Crypt import CryptBitcoin class TestCryptBitcoin: def testSignOld(self): privatekey = "23DKQpDz7bXM7w5KN5Wnmz7bwRNqNHcdQjb2WwrdB1QtTf5gM3pFdf" privatekey_bad = "23DKQpDz7bXM7w5KN5Wnmz6bwRNqNHcdQjb2WwrdB1QtTf5gM3pFdf" # Get address by privatekey address = CryptBitcoin.privatek...
bashrc/zeronet-debian
src/src/Test/TestCryptBitcoin.py
Python
gpl-2.0
2,344