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
from __future__ import print_function import glob import os import re import warnings try: from importlib import import_module except ImportError: import_module = __import__ from distutils.version import LooseVersion import pytest import numpy as np from numpy.random import rand from pandas import (DataFr...
mbayon/TFG-MachineLearning
venv/lib/python3.6/site-packages/pandas/tests/io/test_html.py
Python
mit
33,092
import re import logging from autotest.client.shared import error from virttest import utils_v2v def run(test, params, env): """ Check VM after conversion """ target = params.get('target') check_obj = utils_v2v.LinuxVMCheck(test, params, env) logging.info("Check guest os info") os_info =...
rbian/tp-libvirt
v2v/tests/linux_vm_check.py
Python
gpl-2.0
3,241
# -*- coding: utf-8 -*- ## This file is part of Invenio. ## Copyright (C) 2014 CERN. ## ## Invenio is free software; you can redistribute it and/or ## modify it under the terms of the GNU General Public License as ## published by the Free Software Foundation; either version 2 of the ## License, or (at your option) any ...
lnielsen/invenio
invenio/modules/pidstore/admin.py
Python
gpl-2.0
2,270
# -*- test-case-name: twisted.lore.test.test_texi -*- # Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. from cStringIO import StringIO import os, re from twisted.web import domhelpers import latex, tree spaceRe = re.compile('\s+') def texiEscape(text): return spaceRe.sub(text, ' ') entiti...
Oslandia/vizitown_plugin
twisted/lore/texi.py
Python
gpl-2.0
3,134
# # Gramps - a GTK+/GNOME based genealogy program # # Copyright (C) 2000-2007 Donald N. Allingham # Copyright (C) 2017 Nick Hall # # 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 v...
SNoiraud/gramps
gramps/gen/lib/grampstype.py
Python
gpl-2.0
10,010
import logging import commands import random from autotest.client.shared import error from autotest.client import utils from virttest import utils_misc from virttest import utils_test from virttest import utils_net @error.context_aware def run(test, params, env): """ Test the RX jumbo frame function of vnic...
tolimit/tp-qemu
generic/tests/jumbo.py
Python
gpl-2.0
7,693
"""Removed nm_usergroup_roles table Revision ID: 4ff2bc4eb9bf Revises: 57c6ab33ad2f Create Date: 2015-05-10 20:28:01.388673 """ # revision identifiers, used by Alembic. revision = '4ff2bc4eb9bf' down_revision = '57c6ab33ad2f' from alembic import op import sqlalchemy as sa UPGRADE = """""" DOWNGRADE = """""" def...
ThomasJunk/ringo
ringo/alembic/versions/4ff2bc4eb9bf_.py
Python
gpl-2.0
1,013
# -*- coding: utf-8 -*- # # brunel_delta_nest.py # # This file is part of NEST. # # Copyright (C) 2004 The NEST Initiative # # NEST is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 2 of the Licen...
tammoippen/nest-simulator
pynest/examples/brunel_delta_nest.py
Python
gpl-2.0
12,049
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2014, Dimitrios Tydeas Mengidis <tydeas.dr@gmail.com> # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version...
gaqzi/ansible-modules-extras
packaging/language/composer.py
Python
gpl-3.0
6,200
import unittest import os import logging from osm2gtfs.tests.creators.creators_tests import CreatorsTestsAbstract # Define logging level logging.basicConfig(level=os.environ.get("LOGLEVEL", "INFO")) class TestCreatorsNiManagua(CreatorsTestsAbstract): def _get_selector(self): return "ni_managua" def...
nlehuby/osm2gtfs
osm2gtfs/tests/creators/tests_ni_managua.py
Python
gpl-3.0
1,515
# -*- coding: utf-8 -*- # # DiracDocs documentation build configuration file, created by # sphinx-quickstart on Sun Apr 25 17:34:37 2010. # # 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. # # A...
arrabito/DIRAC
docs/source/conf.py
Python
gpl-3.0
9,724
#!/usr/bin/env python # # Copyright 2011-2013 Free Software Foundation, Inc. # # This file is part of GNU Radio # # SPDX-License-Identifier: GPL-3.0-or-later # # import random import cmath from gnuradio import gr, gr_unittest, digital, blocks class test_clock_recovery_mm(gr_unittest.TestCase): def setUp(self):...
skoslowski/gnuradio
gr-digital/python/digital/qa_clock_recovery_mm.py
Python
gpl-3.0
4,755
import csv from django.core.management.base import BaseCommand from crashstats.authentication.migration import migrate_users class Command(BaseCommand): help = """Parsing a CSV file where the first column is the ALIAS email and the second column is the CORRECT email. """ def add_arguments(self, par...
Tayamarn/socorro
webapp-django/crashstats/authentication/management/commands/migrate-users-csv.py
Python
mpl-2.0
1,187
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors and contributors # For license information, please see license.txt from __future__ import unicode_literals import frappe from frappe.model.document import Document class RawMaterialSpecsDetails(Document): pass
indictranstech/focal-erpnext
selling/doctype/raw_material_specs_details/raw_material_specs_details.py
Python
agpl-3.0
285
import avango import avango.gua from examples_common.device import TouchDevice from examples_common.device import TouchCursor class TapDetector(avango.script.Script): Cursor = TouchCursor() TapDetected = avango.SFBool() TapPosition = avango.gua.SFVec2() TapTimeThreshold = avango.SFFloat() #...
jakobharlan/avango
examples/touch_example/modules/gesture_detectors.py
Python
lgpl-3.0
2,904
# 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_oam_meg_ref import TapiOamMegRef # noqa: F401,E501 from tapi_server import util class T...
karthik-sethuraman/ONFOpenTransport
RI/flask_server/tapi_server/models/tapi_oam_mip_ref.py
Python
apache-2.0
2,530
#!/usr/bin/env python # # Copyright (c) Greenplum Inc 2008. All Rights Reserved. # """ gparray.py: Contains three classes representing configuration information of a Greenplum array: GpArray - The primary interface - collection of all GpDB within an array GpDB - represents configuration infor...
yuanzhao/gpdb
gpMgmt/bin/gppylib/gparray.py
Python
apache-2.0
94,119
# Copyright 2019 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 ...
jbedorf/tensorflow
tensorflow/contrib/tpu/python/tpu/_tpu_estimator_embedding.py
Python
apache-2.0
1,005
import cpp_mod class Foo(object): pass foo = Foo() foo.x = ([foo],) foo.y = {'foo': 123} cpp_mod.global_func()
Microsoft/PTVS
Python/Tests/GlassTests/PythonTests/Python/Eval_InNative/py_mod.py
Python
apache-2.0
111
r''' Copyright 2014 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 agreed to i...
joshcooper/nogotofail
nogotofail/mitm/util/tls/tls.py
Python
apache-2.0
2,258
#!/usr/bin/python # # Copyright 2014 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...
coxmediagroup/googleads-python-lib
examples/adwords/adwords_appengine_demo/views/add_campaign_view.py
Python
apache-2.0
2,387
#!/usr/bin/env python '''Deploy docker-ci report container on Digital Ocean. Usage: export CONFIG_JSON=' { "DROPLET_NAME": "Digital_Ocean_dropplet_name", "DO_CLIENT_ID": "Digital_Ocean_client_id", "DO_API_KEY": "Digital_Ocean_api_key", "DOCKER_KEY_ID": ...
wrouesnel/docker
hack/infrastructure/docker-ci/report/deployment.py
Python
apache-2.0
4,268
# Copyright (c) 2010-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 or agreed to ...
tsli/test
test/unit/account/test_server.py
Python
apache-2.0
72,239
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2012 OpenStack LLC # 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...
developerworks/horizon
horizon/tests/authors_tests.py
Python
apache-2.0
2,188
"""HTTP views to interact with the entity registry.""" import voluptuous as vol from homeassistant import config_entries from homeassistant.components import websocket_api from homeassistant.components.websocket_api.const import ERR_NOT_FOUND from homeassistant.components.websocket_api.decorators import ( async_re...
kennedyshead/home-assistant
homeassistant/components/config/entity_registry.py
Python
apache-2.0
6,293
"""Tests for the Wallbox integration.""" import json import requests_mock from homeassistant.components.wallbox.const import CONF_STATION, DOMAIN from homeassistant.const import CONF_PASSWORD, CONF_USERNAME from tests.common import MockConfigEntry test_response = json.loads( '{"charging_power": 0,"max_availabl...
lukas-hetzenecker/home-assistant
tests/components/wallbox/__init__.py
Python
apache-2.0
1,287
#----------------------------------------------------------------------------- # Imports #----------------------------------------------------------------------------- import sys from IPython.lib.kernel import connect_qtconsole from IPython.kernel.zmq.kernelapp import IPKernelApp #-----------------------------------...
pioneers/topgear
ipython-in-depth/examples/Embedding/internal_ipkernel.py
Python
apache-2.0
2,018
# 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...
neilhan/tensorflow
tensorflow/python/training/supervisor_test.py
Python
apache-2.0
30,964
# -*- 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, software ...
mrares/incubator-airflow
tests/utils/log/test_logging.py
Python
apache-2.0
4,229
# -*- coding: UTF-8 -*- from django.core.cache import cache from django.db.models.signals import pre_delete, post_save from django.dispatch import Signal import functools import hashlib try: from inspect import getcallargs except ImportError: import sys from inspect import getargspec, ismethod def get...
artcz/epcon
conference/cachef.py
Python
bsd-2-clause
8,234
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.apps.registry import Apps, apps from django.contrib.contenttypes.fields import ( GenericForeignKey, GenericRelation ) from django.contrib.contenttypes import management from django.contrib.contenttypes.models import ContentType from django...
doismellburning/django
tests/contenttypes_tests/tests.py
Python
bsd-3-clause
16,513
""" Several basic tests for hierarchical clustering procedures """ # Authors: Vincent Michel, 2010, Gael Varoquaux 2012 # License: BSD-like import warnings from tempfile import mkdtemp import numpy as np from scipy import sparse from scipy.cluster import hierarchy from sklearn.utils.testing import assert_true from s...
florian-f/sklearn
sklearn/cluster/tests/test_hierarchical.py
Python
bsd-3-clause
6,780
""" fs: a filesystem abstraction. This module provides an abstract base class 'FS' that defines a consistent interface to different kinds of filesystem, along with a range of concrete implementations of this interface such as: OSFS: access the local filesystem, through the 'os' module TempFS: a ...
duedil-ltd/pyfilesystem
fs/__init__.py
Python
bsd-3-clause
1,781
"""distutils.file_util Utility functions for operating on single files. """ __revision__ = "$Id$" import os from distutils.errors import DistutilsFileError from distutils import log # for generating verbose output in 'copy_file()' _copy_action = {None: 'copying', 'hard': 'hard linking',...
nmercier/linux-cross-gcc
win32/bin/Lib/distutils/file_util.py
Python
bsd-3-clause
8,370
from GenericRequest import GenericRequest class BootClanMemberRequest(GenericRequest): def __init__(self, session, userId): super(BootClanMemberRequest, self).__init__(session) self.url = session.serverURL + "clan_members.php" self.requestData['pwd'] = session.pwd self.requestData['...
ijzer/cwbot-ndy
kol/request/BootClanMemberRequest.py
Python
bsd-3-clause
475
from django import forms from django.core.exceptions import ValidationError from cyder.models import Ctnr from cyder.cydns.address_record.models import AddressRecord from cyder.cydns.view.models import View from cyder.cydns.forms import DNSForm from cyder.cydns.nameserver.models import Nameserver from cyder.cydhcp.int...
akeym/cyder
cyder/cydns/nameserver/forms.py
Python
bsd-3-clause
4,749
import unittest from test import audiotests from audioop import byteswap import io import struct import sys import sunau class SunauTest(audiotests.AudioWriteTests, audiotests.AudioTestsWithSourceFile): module = sunau class SunauPCM8Test(SunauTest, unittest.TestCase): sndfilename = 'pluck-pc...
brython-dev/brython
www/src/Lib/test/test_sunau.py
Python
bsd-3-clause
6,125
import pytest import numpy as np from keras.utils.test_utils import get_test_data from keras.utils import np_utils from keras import backend as K from keras.models import Sequential from keras.layers.core import Dense, Activation from keras.wrappers.scikit_learn import KerasClassifier, KerasRegressor input_dim = 5 h...
kemaswill/keras
tests/keras/wrappers/test_scikit_learn.py
Python
mit
4,769
import unittest from biicode.common.dev.system_resource_names import SystemResourceNames from biicode.common.dev.system_id import SystemID class SystemResourceNamesTest(unittest.TestCase): def setUp(self): self.sut = SystemResourceNames(SystemID("open_gl", "CPP")) def test_add_names(self): s...
zhangf911/common
test/dev/system_resource_names_test.py
Python
mit
936
class BTree: def __init__(self, b_tree_list=list()): self.b_tree_list = b_tree_list self.levels = len(b_tree_list) def visualise(self): for index, level in enumerate(self.b_tree_list): spacing = 2 ** (self.levels - index) - 1 print(((spacing-1)//2)*' ', end='') ...
DakRomo/2017Challenges
challenge_4/python/ning/challenge_4.py
Python
mit
790
# -*- coding: utf-8 -*- # # Cheroke-admin # # Authors: # Alvaro Lopez Ortega <alvaro@alobbs.com> # # Copyright (C) 2001-2014 Alvaro Lopez Ortega # # This program is free software; you can redistribute it and/or # modify it under the terms of version 2 of the GNU General Public # License as published by the Free So...
lmcro/webserver
admin/plugins/error_redir.py
Python
gpl-2.0
4,572
"""Constants used by ansible-test. Imports should not be used in this file.""" # Setting a low soft RLIMIT_NOFILE value will improve the performance of subprocess.Popen on Python 2.x when close_fds=True. # This will affect all Python subprocesses. It will also affect the current Python process if set before subprocess...
EvanK/ansible
test/runner/lib/constants.py
Python
gpl-3.0
379
""" SocksiPy - Python SOCKS module. Version 1.5.0 Copyright 2006 Dan-Haim. 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 ...
brysonreece/Stream
resources/site-packages/stream/socks.py
Python
gpl-3.0
27,176
#!/usr/bin/env python # -*- coding: utf-8 -*- test_names = [] guids = [] populateNames = [] name_results = [] name_file = open('englishTestName.txt','r') sample_type_file = open("sampleType.txt") guid_file = open("guid.txt") result_file = open("../populateNames.sql", "w") for line in name_file: t...
pfschwartz/openelisglobal-core
liquibase/OE4.2/testCatalogCI_Regional_labs/scripts/populateNames.py
Python
mpl-2.0
1,560
# -*- coding: utf-8 -*- # Amara, universalsubtitles.org # # Copyright (C) 2013 Participatory Culture Foundation # # 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 Foundation, either version 3 of the #...
ofer43211/unisubs
apps/subtitles/admin.py
Python
agpl-3.0
6,564
#!/usr/bin/env python # coding=utf-8 # aeneas is a Python/C library and a set of tools # to automagically synchronize audio and text (aka forced alignment) # # Copyright (C) 2012-2013, Alberto Pettarin (www.albertopettarin.it) # Copyright (C) 2013-2015, ReadBeyond Srl (www.readbeyond.it) # Copyright (C) 2015-2017, A...
chrisvire/aeneas
aeneas/ttswrappers/basettswrapper.py
Python
agpl-3.0
34,887
# Generated by Django 1.11.16 on 2018-11-28 19:07 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('course_duration_limits', '0002_auto_20181119_0959'), ] operations = [ migrations.AlterField( model_name='coursedurationlimitc...
eduNEXT/edx-platform
openedx/features/course_duration_limits/migrations/0003_auto_20181128_1407.py
Python
agpl-3.0
601
# Copyright (c) 2013 The Johns Hopkins University/Applied Physics Laboratory # 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/...
Thingee/cinder
cinder/keymgr/conf_key_mgr.py
Python
apache-2.0
4,809
# # 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 us...
rangadi/beam
sdks/python/apache_beam/typehints/trivial_inference_test.py
Python
apache-2.0
7,100
# -*- coding: utf-8 -*- import os import csv from bs4 import BeautifulSoup INFO = {'download_path': 'download/docs', 'doc_base_url': 'https://facebook.github.io/react-native/releases/0.40/docs{}', 'out_file': 'output.txt'} HOME_LINK= 'http://facebook.github.io/react-native/docs/getting-started.ht...
rasikapohankar/zeroclickinfo-fathead
lib/fathead/react_native/parse.py
Python
apache-2.0
15,135
""" Send and receive pre-defined messages through the Bohrium component stack ========================================================================= """ from ._bh_api import message as msg def statistic_enable_and_reset(): """Reset and enable the Bohrium statistic""" return msg("statistic_enable_and_reset...
madsbk/bohrium
bridge/py_api/bohrium_api/messaging.py
Python
apache-2.0
934
# Copyright 2021 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/training/tracking/base_delegate.py
Python
apache-2.0
5,796
# 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...
dennybaa/st2
st2api/st2api/signal_handlers.py
Python
apache-2.0
941
# -*- coding: utf-8 -*- ############################################################################### # # GetService # Retrieves a list of buckets owned by the authenticated user. # # Python versions 2.6, 2.7, 3.x # # Copyright 2014, Temboo Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # y...
jordanemedlock/psychtruths
temboo/core/Library/Amazon/S3/GetService.py
Python
apache-2.0
3,503
"""Support for the Lovelace UI.""" from functools import wraps import logging import os import time import voluptuous as vol from homeassistant.components import websocket_api from homeassistant.exceptions import HomeAssistantError from homeassistant.util.yaml import load_yaml _LOGGER = logging.getLogger(__name__) ...
fbradyirl/home-assistant
homeassistant/components/lovelace/__init__.py
Python
apache-2.0
6,719
# 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...
HaebinShin/tensorflow
tensorflow/contrib/layers/python/layers/regularizers.py
Python
apache-2.0
6,790
# discovery.py - protocol changeset discovery functions # # Copyright 2010 Olivia Mackall <olivia@selenic.com> # # This software may be used and distributed according to the terms of the # GNU General Public License version 2 or any later version. from __future__ import absolute_import import functools from .i18n im...
jwren/intellij-community
plugins/hg4idea/testData/bin/mercurial/discovery.py
Python
apache-2.0
22,739
# Copyright 2014: Mirantis 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...
gluke77/rally
tests/unit/task/test_context.py
Python
apache-2.0
9,745
# -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding model 'UserSettings' db.create_table(u'cms_usersettings', ( (u'id', self.gf('django.db....
SinnerSchraderMobileMirrors/django-cms
cms/migrations/0041_auto__add_usersettings.py
Python
bsd-3-clause
15,866
from django.conf.urls import include, url urlpatterns = [ url(r'^avatar/', include('avatar.urls')), ]
MachineandMagic/django-avatar
tests/urls.py
Python
bsd-3-clause
108
# Copyright 2013 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import os import subprocess from telemetry.core.platform import profiler from telemetry.core import util from telemetry.internal.backends.chrome import andr...
SaschaMester/delicium
tools/telemetry/telemetry/core/platform/profiler/android_screen_recorder_profiler.py
Python
bsd-3-clause
1,492
import os from nmt import train def main(job_id, params): print params username = os.environ['USER'] validerr = train( saveto=params['model'][0], reload_=params['reload'][0], dim_word=params['dim_word'][0], dim=params['dim'][0], n_words=params['n-words'][0], ...
kyunghyuncho/dl4mt-material
session1/train_nmt_all.py
Python
bsd-3-clause
1,635
# AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT from nipype.testing import assert_equal from nipype.interfaces.slicer.filtering.extractskeleton import ExtractSkeleton def test_ExtractSkeleton_inputs(): input_map = dict(InputImageFileName=dict(argstr='%s', position=-2, ), OutputImageFileName=dict(...
mick-d/nipype_source
nipype/interfaces/slicer/filtering/tests/test_auto_ExtractSkeleton.py
Python
bsd-3-clause
1,344
import numpy as np import pytest from sklearn.compose import make_column_transformer from sklearn.datasets import load_breast_cancer, make_classification from sklearn.exceptions import NotFittedError from sklearn.linear_model import LogisticRegression from sklearn.metrics import average_precision_score, precision_reca...
manhhomienbienthuy/scikit-learn
sklearn/metrics/_plot/tests/test_precision_recall_display.py
Python
bsd-3-clause
11,599
import re import os import sys from optparse import make_option from django.core.management.base import BaseCommand from ella.photos.conf import photos_settings class Command(BaseCommand): help = 'Check consistence between database records and coresponding image files' VERBOSITY_ERROR = 0 VERBOSITY_WARN...
WhiskeyMedia/ella
ella/photos/management/commands/check_photo_files_consistence.py
Python
bsd-3-clause
5,635
# Copyright (C) 2010 Google Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the f...
danakj/chromium
third_party/WebKit/Tools/Scripts/webkitpy/tool/servers/rebaseline_server_unittest.py
Python
bsd-3-clause
12,199
"""Helper functions for graphics with Matplotlib.""" from statsmodels.compat.python import lrange __all__ = ['create_mpl_ax', 'create_mpl_fig'] def _import_mpl(): """This function is not needed outside this utils module.""" try: import matplotlib.pyplot as plt except: raise ImportError("M...
statsmodels/statsmodels
statsmodels/graphics/utils.py
Python
bsd-3-clause
4,032
''' Copyright (C) 2016 Turi All rights reserved. This software may be modified and distributed under the terms of the BSD license. See the LICENSE file for details. ''' import logging import pprint class ConsumerMock: def __init__(self): self._num_flushes = 0 def flush(self): self._num_flushes += 1 cla...
ylow/SFrame
oss_src/unity/python/sframe/util/metric_mock.py
Python
bsd-3-clause
1,457
import os from pathlib import Path from django.contrib.sites.models import Site from django.core.urlresolvers import set_urlconf from django.template import Context, Template from django.test import TestCase from .utils import get_doc_path class SearchFormTestCase(TestCase): fixtures = ['doc_test_fixtures'] ...
hassanabidpk/djangoproject.com
docs/tests.py
Python
bsd-3-clause
2,750
from __future__ import absolute_import, unicode_literals import os import subprocess from stat import S_IREAD, S_IRGRP, S_IROTH from virtualenv.util.path import safe_delete, set_tree from virtualenv.util.six import ensure_text from virtualenv.util.subprocess import Popen from .base import PipInstall class SymlinkP...
pypa/virtualenv
src/virtualenv/seed/embed/via_app_data/pip_install/symlink.py
Python
mit
2,362
# -*- coding: utf-8 -*- '''Various noun phrase extractors.''' from __future__ import unicode_literals, absolute_import import nltk from textblob.taggers import PatternTagger from textblob.decorators import requires_nltk_corpus from textblob.utils import tree2str, filter_insignificant from textblob.base import BaseNPE...
sargam111/python
textblob/en/np_extractors.py
Python
mit
6,734
# # Author: John Tran <jhtran@att.com> # Julien Danjou <julien@danjou.info> # # 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...
ChinaMassClouds/copenstack-server
openstack/src/ceilometer-2014.2.2/ceilometer/alarm/storage/impl_sqlalchemy.py
Python
gpl-2.0
12,576
# -*- coding: utf-8 -*- # <Lettuce - Behaviour Driven Development for python> # Copyright (C) <2010-2012> Gabriel Falcão <gabriel@nacaolivre.org> # # 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 Foundatio...
yangming85/lettuce
lettuce/django/apps.py
Python
gpl-3.0
2,947
#!/usr/bin/python # # Copyright 2016 Red Hat | Ansible # 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 ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['prev...
ptisserand/ansible
lib/ansible/modules/cloud/docker/docker_service.py
Python
gpl-3.0
37,555
""" ACE message types for the instructor module. """ from openedx.core.djangoapps.ace_common.message import BaseMessageType class AccountCreationAndEnrollment(BaseMessageType): """ A message for registering and inviting learners into a course. This message includes username and password. """ AP...
eduNEXT/edx-platform
lms/djangoapps/instructor/message_types.py
Python
agpl-3.0
2,230
""" A trivial task for health checks """ from celery import shared_task from edx_django_utils.monitoring import set_code_owner_attribute @shared_task @set_code_owner_attribute def sample_task(): return True
eduNEXT/edx-platform
openedx/core/djangoapps/heartbeat/tasks.py
Python
agpl-3.0
215
# 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) from spack import * class Snap(MakefilePackage): """SNAP serves as a proxy application to model the performance ...
LLNL/spack
var/spack/repos/builtin/packages/snap/package.py
Python
lgpl-2.1
1,642
""" local path implementation. """ from __future__ import with_statement from contextlib import contextmanager import sys, os, re, atexit, io import py from py._path import common from py._path.common import iswin32, fspath from stat import S_ISLNK, S_ISDIR, S_ISREG from os.path import abspath, normpath, isabs, exist...
TheTimmy/spack
lib/spack/external/py/_path/local.py
Python
lgpl-2.1
32,583
'''Autogenerated by xml_generate script, do not edit!''' from OpenGL import platform as _p, arrays # Code generation uses this from OpenGL.raw.GLX import _types as _cs # End users want this... from OpenGL.raw.GLX._types import * from OpenGL.raw.GLX import _errors from OpenGL.constant import Constant as _C import ctype...
stack-of-tasks/rbdlpy
tutorial/lib/python2.7/site-packages/OpenGL/raw/GLX/OML/sync_control.py
Python
lgpl-3.0
1,569
import matplotlib.cm as mpl_cm import matplotlib.pyplot as plt import iris import iris.quickplot as qplt fname = iris.sample_data_path("air_temp.pp") temperature_cube = iris.load_cube(fname) # Load a Cynthia Brewer palette. brewer_cmap = mpl_cm.get_cmap("brewer_OrRd_09") # Draw the contours, with n-levels set for t...
SciTools/iris
docs/src/userguide/plotting_examples/cube_brewer_contourf.py
Python
lgpl-3.0
604
# 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 applicab...
tensorflow/tensorflow
tensorflow/python/kernel_tests/collective_ops_multi_worker_test.py
Python
apache-2.0
12,067
# # 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 us...
MLnick/spark
python/pyspark/worker.py
Python
apache-2.0
8,012
# Copyright 2013 OpenStack Foundation # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in w...
ging/keystone
keystone/tests/ksfixtures/appserver.py
Python
apache-2.0
2,648
"""The tests for the DirecTV Media player platform.""" from datetime import datetime, timedelta from typing import Optional from pytest import fixture from homeassistant.components.directv.media_player import ( ATTR_MEDIA_CURRENTLY_RECORDING, ATTR_MEDIA_RATING, ATTR_MEDIA_RECORDED, ATTR_MEDIA_START_TI...
pschmitt/home-assistant
tests/components/directv/test_media_player.py
Python
apache-2.0
14,615
#!/usr/bin/python # -*- coding: utf-8 -*- # thumbor imaging service # https://github.com/thumbor/thumbor/wiki # Licensed under the MIT license: # http://www.opensource.org/licenses/mit-license # Copyright (c) 2011 globo.com timehome@corp.globo.com from pyvows import Vows, expect from thumbor.point import FocalPoint...
2947721120/thumbor
vows/point_vows.py
Python
mit
4,575
# coding: utf-8 """Test that tokenizer prefixes, suffixes and infixes are handled correctly.""" from __future__ import unicode_literals import pytest @pytest.mark.parametrize('text', ["(can)"]) def test_tokenizer_splits_no_special(en_tokenizer, text): tokens = en_tokenizer(text) assert len(tokens) == 3 @...
aikramer2/spaCy
spacy/tests/lang/en/test_prefix_suffix_infix.py
Python
mit
4,124
import os,shutil from SCons.Script import DefaultEnvironment from platformio import util def copytree(src, dst, symlinks=False, ignore=None): for item in os.listdir(src): s = os.path.join(src, item) d = os.path.join(dst, item) if os.path.isdir(s): shutil.copytree(s, d, symlinks,...
aetel/3D-printer
prusa_i3/Firmware/Marlin-2.0.x/buildroot/share/PlatformIO/scripts/STM32F1_create_variant.py
Python
gpl-2.0
1,009
""" Models a GC-MS experiment represented by a list of signal peaks """ ############################################################################# # # # PyMS software for processing of metabolomic mass-spectrometry data # # Copy...
thegodone/pyms
Experiment/Class.py
Python
gpl-2.0
3,288
# -*- coding: utf-8 -*- """ *************************************************************************** ProcessingConfig.py --------------------- Date : August 2012 Copyright : (C) 2012 by Victor Olaya Email : volayaf at gmail dot com **********************...
Gaia3D/QGIS
python/plugins/processing/core/ProcessingConfig.py
Python
gpl-2.0
8,398
# Copyright 2006 Google, Inc. All Rights Reserved. # Licensed to PSF under a Contributor Agreement. """ Python parse tree definitions. This is a very concrete parse tree; we need to keep every token and even the comments and whitespace between tokens. There's also a pattern matching implementation here. """ __autho...
2ndy/RaspIM
usr/lib/python2.6/lib2to3/pytree.py
Python
gpl-2.0
28,107
#!/usr/bin/env python # -*- coding: utf-8 -*- """Tests for Task 02""" # Import Python libs import mock import unittest import task_02 class Task02TestCase(unittest.TestCase): """Test cases for Task 02""" def test_params(self): """Tests that login() has the correct required parameters.""" ms...
eliz79/is210-week-08-synthesizing
tests/test_task_02.py
Python
mpl-2.0
1,920
# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # d...
klmitch/nova
nova/tests/unit/fake_requests.py
Python
apache-2.0
1,670
"""Support for the sensors in a GreenEye Monitor.""" import logging from homeassistant.const import ( CONF_NAME, CONF_TEMPERATURE_UNIT, POWER_WATT, TIME_HOURS, TIME_MINUTES, TIME_SECONDS, VOLT, ) from homeassistant.helpers.entity import Entity from . import ( CONF_COUNTED_QUANTITY, ...
nkgilley/home-assistant
homeassistant/components/greeneye_monitor/sensor.py
Python
apache-2.0
9,428
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # 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.a...
TieWei/nova
nova/tests/objects/test_pci_device.py
Python
apache-2.0
12,888
# 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...
Guneet-Dhillon/mxnet
example/ssd/demo.py
Python
apache-2.0
6,468
"""Test cases for the switcher_kis component.""" from datetime import timedelta from typing import TYPE_CHECKING, Any, Generator from pytest import raises from homeassistant.components.switcher_kis import ( CONF_AUTO_OFF, DATA_DEVICE, DOMAIN, SERVICE_SET_AUTO_OFF_NAME, SERVICE_SET_AUTO_OFF_SCHEMA...
tchellomello/home-assistant
tests/components/switcher_kis/test_init.py
Python
apache-2.0
5,602
""" Support for the myStrom buttons. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/binary_sensor.mystrom/ """ import asyncio import logging from homeassistant.components.binary_sensor import (BinarySensorDevice, DOMAIN) from homeassistant.components.ht...
ct-23/home-assistant
homeassistant/components/binary_sensor/mystrom.py
Python
apache-2.0
3,028
from django.core.management.base import BaseCommand from wagtail.core.models import PageLogEntry, PageRevision def get_comparison(page, revision_a, revision_b): comparison = page.get_edit_handler().get_comparison() comparison = [comp(revision_a, revision_b) for comp in comparison] comparison = [comp for ...
zerolab/wagtail
wagtail/core/management/commands/create_log_entries_from_revisions.py
Python
bsd-3-clause
4,614
"""This script automates the copying of the default keymap into your own keymap. """ import shutil from pathlib import Path import qmk.path from qmk.decorators import automagic_keyboard, automagic_keymap from milc import cli @cli.argument('-kb', '--keyboard', help='Specify keyboard name. Example: 1upkeyboards/1up60h...
kmtoki/qmk_firmware
lib/python/qmk/cli/new/keymap.py
Python
gpl-2.0
1,884
# -*- coding: utf-8 -*- # Copyright (c) 2013 Red Hat, Inc. # # This software is licensed to you under the GNU General Public # License as published by the Free Software Foundation; either version # 2 of the License (GPLv2) or (at your option) any later version. # There is NO WARRANTY for this software, express or impli...
rbramwell/pulp
nodes/extensions/admin/pulp_node/extensions/admin/sync_schedules.py
Python
gpl-2.0
4,455