code
stringlengths
6
947k
repo_name
stringlengths
5
100
path
stringlengths
4
226
language
stringclasses
1 value
license
stringclasses
15 values
size
int64
6
947k
"""Test config validators.""" from datetime import date, datetime, timedelta import enum import os from socket import _GLOBAL_DEFAULT_TIMEOUT from unittest.mock import Mock, patch import uuid import pytest import voluptuous as vol import homeassistant import homeassistant.helpers.config_validation as cv def test_bo...
joopert/home-assistant
tests/helpers/test_config_validation.py
Python
apache-2.0
26,925
# -*- coding: utf-8 -*- # Copyright (c) 2012-2015, Ben Lopatin and contributors # 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 ...
DESHRAJ/django-organizations
organizations/app_settings.py
Python
bsd-2-clause
1,816
''' Datastore via remote webdav connection ''' from __future__ import unicode_literals from future import standard_library standard_library.install_aliases() import os import tarfile import logging from fs.contrib.davfs import DAVFS from urllib.parse import urlparse from contextlib import closing # needed for Python ...
maxalbert/sumatra
sumatra/datastore/davfs.py
Python
bsd-2-clause
3,618
"""Oral Argument Audio Scraper for Eighth Circuit Court of Appeals CourtID: ca8 Court Short Name: 8th Cir. Author: Brian W. Carver Date created: 2014-06-21 History: - 2014-07-22: download_url fixed by mlr """ from datetime import datetime from juriscraper.OralArgumentSite import OralArgumentSite class Site(OralArg...
Andr3iC/juriscraper
oral_args/united_states/federal_appellate/ca8.py
Python
bsd-2-clause
2,115
""" test PWM """ from bbio import * from Servo import * import time servo1 = Servo(PWM1A) servo2 = Servo(PWM2A) servo1.write(90) servo2.write(90) time.sleep(2) servo1.detach() servo2.detach()
Southampton-Maritime-Robotics/autonomous-sailing-robot
src/boat_servo_sail/src/boat_servo_sail/servo_control.py
Python
bsd-2-clause
195
""" Internal subroutines for e.g. aborting execution with an error message, or performing indenting on multiline output. """ import os import six import sys import textwrap from traceback import format_exc def _encode(msg, stream): if six.PY2 and isinstance(msg, unicode) and hasattr(stream, 'encoding') and not st...
rodrigc/fabric
fabric/utils.py
Python
bsd-2-clause
13,245
""" Copyright (c) 2017 Red Hat, Inc All rights reserved. This software may be modified and distributed under the terms of the BSD license. See the LICENSE file for details. """ from __future__ import print_function, unicode_literals import os import json from flexmock import flexmock from atomic_reactor.constants ...
vrutkovs/atomic-reactor
tests/plugins/test_compare_components.py
Python
bsd-3-clause
4,488
""" Convenient way to expose filepaths to scripts. Also, important constants are centralized here to avoid multiple copies. """ import sys, os sys.path.append(os.path.join(os.path.dirname(__file__), '..')) sys.path.append(os.path.join(os.path.dirname(__file__))) sys.path.append(os.path.join(os.path.dirname(__file__), ...
nhejazi/project-gamma
code/project_config.py
Python
bsd-3-clause
562
#!/usr/bin/env python3 # Copyright (c) 2009, Giampaolo Rodola'. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """ Run unit tests. This is invoked by: $ python -m psutil.tests """ from .runner import main main()
giampaolo/psutil
psutil/tests/__main__.py
Python
bsd-3-clause
293
# -*- coding: utf-8 -*- from abc import ABCMeta, abstractmethod from collections import defaultdict from itertools import chain import uuid import numpy as np from pyfr.nputil import fuzzysort class BaseReader(object, metaclass=ABCMeta): @abstractmethod def __init__(self): pass @abstractmethod...
Aerojspark/PyFR
pyfr/readers/base.py
Python
bsd-3-clause
7,767
import os import unittest from manolo_scraper.spiders.minsa import MinsaSpider from utils import fake_response_from_file class TestMinsaSpider(unittest.TestCase): def setUp(self): self.spider = MinsaSpider() def test_parse_item(self): filename = os.path.join('data/minsa', '18-08-2015.html')...
aniversarioperu/django-manolo
scrapers/tests/test_minsa_spider.py
Python
bsd-3-clause
1,311
import sys import traceback from io import BytesIO from unittest import TestCase from wsgiref import simple_server from django.core.servers.basehttp import get_internal_wsgi_application from django.test import RequestFactory, override_settings from .views import FILE_RESPONSE_HOLDER # If data is too large, socket wi...
kaedroho/django
tests/builtin_server/tests.py
Python
bsd-3-clause
5,660
#!/usr/bin/env python # -*- coding: utf-8 -*- # # agnez documentation build configuration file, created by # sphinx-quickstart on Tue Jul 9 22:26:36 2013. # # 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 # autog...
EderSantana/agnez
docs/conf.py
Python
bsd-3-clause
8,361
# -*- coding: utf-8 -*- # # This file is part of Istex_Mental_Rotation. # Copyright (C) 2016 3ST ERIC Laboratory. # # This is a free software; you can redistribute it and/or modify it # under the terms of the Revised BSD License; see LICENSE file for # more details. # Load and transform ISTEX and wiki articles into ba...
ERICUdL/ISTEX_MentalRotation
ids2docs_years.py
Python
bsd-3-clause
2,227
import mne import scipy.io as sio import sys as sys file_events = str(sys.argv[2]) file_data = str(sys.argv[1]) events = mne.read_events(file_events) raw = mne.fiff.Raw(file_data) start = raw.first_samp print "start:"+str(start) print "events[0]:"+str(events[0,0])+"->"+str(events[0,0]-start) events[:,0] = events[:,0]-...
kingjr/natmeg_arhus
get_events.py
Python
bsd-3-clause
383
from __future__ import unicode_literals from builtins import str from builtins import object import logging, os, os.path, shutil from django.test import TestCase from scrapy import signals from scrapy.exceptions import DropItem from scrapy.utils.project import get_project_settings settings = get_project_settings() ...
DeanSherwin/django-dynamic-scraper
tests/scraper/scraper_test.py
Python
bsd-3-clause
10,956
from __future__ import absolute_import, unicode_literals from six import text_type from django.db import models from django.db.models.query import QuerySet from django.utils import timezone from django.utils.encoding import python_2_unicode_compatible from django.utils.text import slugify from django.utils.translatio...
frague59/wagtailpolls
wagtailpolls/models.py
Python
bsd-3-clause
2,687
#!/usr/bin/env python # 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. """This script is a wrapper around the GN binary that is pulled from Google Cloud Storage when you sync Chrome. The binaries go into pl...
michalliu/chromium-depot_tools
gn.py
Python
bsd-3-clause
1,319
# -*- coding: utf-8 -*- ######################################################################## # # License: BSD # Created: September 4, 2002 # Author: Francesc Alted - faltet@pytables.com # # $Id$ # ######################################################################## """Here is defined the Group class.""" impo...
dotsdl/PyTables
tables/group.py
Python
bsd-3-clause
47,685
from cpptrimesh import CppTriMesh from menpo.shape.mesh.base import TriMesh from menpo.shape.mesh.coloured import ColouredTriMesh from menpo.shape.pointcloud import PointCloud class FastTriMesh(TriMesh, CppTriMesh): """A TriMesh with an underlying C++ data structure, allowing for efficient iterations around m...
jabooth/menpo-archive
menpo/shape/mesh/__init__.py
Python
bsd-3-clause
1,181
''' Created on Sep 23, 2013 @author: sean ''' from coverage.summary import SummaryReporter from coverage.results import Numbers from coverage.misc import NotPython import sys WARNING = '\033[33m' OKBLUE = '\033[34m' OKGREEN = '\033[32m' FAIL = '\033[31m' ENDC = '\033[0m' BOLD = "\033[1m" def green(text): return ...
GiovanniConserva/TestDeploy
venv/Lib/site-packages/binstar_client/tests/coverage_report.py
Python
bsd-3-clause
4,112
""" Unit tests for DateRange parameter. """ import datetime as dt import param from . import API1TestCase # Assuming tests of range parameter cover most of what's needed to # test date range. class TestDateRange(API1TestCase): bad_range = (dt.datetime(2017,2,27),dt.datetime(2017,2,26)) def test_wrong_type_...
ceball/param
tests/API1/testdaterangeparam.py
Python
bsd-3-clause
2,007
# $ANTLR 3.1.3 Mar 17, 2009 19:23:44 /Users/walsh/Development/workspace/Intellect/intellect/grammar/Policy.g 2013-03-25 15:29:47 import sys from antlr3 import * from antlr3.compat import set, frozenset from intellect.Node import * # for convenience in actions HIDDEN = BaseRecognizer.HIDDEN # token types ...
nemonik/Intellect
intellect/grammar/PolicyParser.py
Python
bsd-3-clause
180,891
"""contact zip code to text field Revision ID: 16e5b0c1ffc8 Revises: 8ac7c042469 Create Date: 2015-10-12 15:23:39.600694 """ # revision identifiers, used by Alembic. revision = '16e5b0c1ffc8' down_revision = '8ac7c042469' from alembic import op import sqlalchemy as sa def upgrade(): ### commands auto generate...
CityofPittsburgh/pittsburgh-purchasing-suite
migrations/versions/16e5b0c1ffc8_contact_zip_code_to_text_field.py
Python
bsd-3-clause
1,648
# ###################################################################### # Copyright (c) 2014, Brookhaven Science Associates, Brookhaven # # National Laboratory. All rights reserved. # # # # Redistribution and use in ...
Nikea/VTTools
vttools/tests/test_utils.py
Python
bsd-3-clause
4,142
try: import cPickle as pickle except ImportError: import pickle as pickle from django.core.management.color import color_style from django.db.models import signals, get_apps, get_app from django_evolution import is_multi_db, models as django_evolution from django_evolution.evolve import get_evolution_sequence...
dekom/threepress-bookworm-read-only
bookworm/django_evolution/management/__init__.py
Python
bsd-3-clause
4,908
""" sentry.models.event ~~~~~~~~~~~~~~~~~~~ :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 warnings from collections import OrderedDict from django.db import models from django.utils import tim...
hongliang5623/sentry
src/sentry/models/event.py
Python
bsd-3-clause
7,063
# -*- coding: utf-8 -*- """Test dbtoyaml and yamltodb using autodoc schema but I/O to/from a directory Same as test_autodoc.py but with directory tree instead of a single YAML file. See http://cvs.pgfoundry.org/cgi-bin/cvsweb.cgi/~checkout~/autodoc/autodoc/ regressdatabase.sql?rev=1.2 """ from pyrseas.testutils import...
reedstrm/Pyrseas
tests/functional/test_autodoc_dir.py
Python
bsd-3-clause
2,782
# -*- encoding:utf-8 -*- from __future__ import unicode_literals MESSAGES = { "Also available in": "També disponibles en", "Archive": "Arxiu", "Categories": "", "LANGUAGE": "Català", "More posts about": "Més entrades sobre", "Newer posts": "Entrades posteriors", "Next post": "Entrada següen...
damianavila/nikola
nikola/data/themes/base/messages/messages_ca.py
Python
mit
823
__all__ = [ "InputInterface" ] class InputInterface(): def get_move(self): pass
gynvael/stream
006-xoxoxo-more-con/input_interface.py
Python
mit
100
from django.core import mail from django.core.management import call_command from django_mailer import models from django_mailer.tests.base import MailerTestCase from django import VERSION if (VERSION[0] >= 1 and VERSION[1] >= 4): from django.utils.timezone import now from datetime import date, timedelta else:...
damkop/django-mailer-2
django_mailer/tests/commands.py
Python
mit
3,433
from django.conf.urls import patterns, include, url from django.conf import settings from cabot.cabotapp.views import ( run_status_check, graphite_api_data, checks_run_recently, duplicate_icmp_check, duplicate_graphite_check, duplicate_http_check, duplicate_jenkins_check, duplicate_instance, acknowledge_ale...
mcansky/cabotapp
cabot/urls.py
Python
mit
6,860
#! /usr/bin/env python # -*- coding: utf-8 -*- from pycket import impersonators as imp from pycket import values from pycket import vector as values_vector from pycket.cont import continuation, label, loop_label from pycket.error import SchemeException from pycket.prims.expose import unsafe, default, expose, subclass_...
pycket/pycket
pycket/prims/vector.py
Python
mit
11,249
# -*- coding: utf-8 -*- from __future__ import unicode_literals from pokemongo_bot import inventory from pokemongo_bot.constants import Constants from pokemongo_bot.walkers.walker_factory import walker_factory from pokemongo_bot.worker_result import WorkerResult from pokemongo_bot.base_task import BaseTask from utils ...
dhluong90/PokemonGo-Bot
pokemongo_bot/cell_workers/move_to_fort.py
Python
mit
5,477
import sqlalchemy as sa from sqlalchemy import Computed from sqlalchemy import event from sqlalchemy import Identity from sqlalchemy import Integer from sqlalchemy import String from sqlalchemy import testing from sqlalchemy.testing import eq_ from sqlalchemy.testing import fixtures from sqlalchemy.testing.assertsql im...
zzzeek/sqlalchemy
test/orm/test_defaults.py
Python
mit
16,424
# -*- coding: utf-8 -*- from time import strftime from django.db.models import Max from django.shortcuts import render_to_response, get_object_or_404 from django.core.paginator import QuerySetPaginator, InvalidPage, EmptyPage from django.core.urlresolvers import reverse from django.utils.feedgenerator import Rss201rev...
omat/django-timeline
timeline/views.py
Python
mit
4,465
# Copyright (C) Dnspython Contributors, see LICENSE for text of ISC license # Copyright (C) 2003-2007, 2009-2011 Nominum, Inc. # # Permission to use, copy, modify, and distribute this software and its # documentation for any purpose with or without fee is hereby granted, # provided that the above copyright notice and ...
4shadoww/usploit
lib/dns/rdtypes/ANY/HINFO.py
Python
mit
2,266
# coding: utf-8 #------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. #---------------------------------------------------------------------...
SUSE/azure-sdk-for-python
azure-mgmt/tests/test_graphrbac.py
Python
mit
1,961
"""Utilities for B2share deposit.""" from flask import request from werkzeug.local import LocalProxy from werkzeug.routing import PathConverter def file_id_to_key(value): """Convert file UUID to value if in request context.""" from invenio_files_rest.models import ObjectVersion _, record = request.view_...
emanueldima/b2share
b2share/modules/deposit/utils.py
Python
gpl-2.0
823
import abc import xbmcaddon abstractstaticmethod = abc.abstractmethod class abstractclassmethod(classmethod): __isabstractmethod__ = True def __init__(self, callable): callable.__isabstractmethod__ = True super(abstractclassmethod, self).__init__(callable) class Scraper: __metaclass__ = a...
repotvsupertuga/tvsupertuga.repository
script.module.universalscrapers/lib/universalscrapers/scraper.py
Python
gpl-2.0
2,679
# -*- coding: utf-8 -*- """ *************************************************************************** lasvalidatePro.py --------------------- Date : October 2014 Copyright : (C) 2014 by Martin Isenburg Email : martin near rapidlasso point com ************...
AsgerPetersen/QGIS
python/plugins/processing/algs/lidar/lastools/lasvalidatePro.py
Python
gpl-2.0
2,511
#!/usr/bin/python """Simple shallow test of the CASTEP interface""" import os import shutil import tempfile import traceback from ase.test import NotAvailable # check if CASTEP_COMMAND is set a environment variable if not os.environ.has_key('CASTEP_COMMAND'): print("WARNING: Environment variable CASTEP_COMMAND ...
JConwayAWT/PGSS14CC
lib/python/multimetallics/ase/test/castep/castep_interface.py
Python
gpl-2.0
3,656
###################################################################### # # Pdu7930 object class # ###################################################################### from Globals import InitializeClass from Products.ZenRelations.RelSchema import * from Products.ZenModel.Device import Device from Products.ZenModel.Z...
zenoss/ZenPacks.Iwillfearnoevil.Powernet7930
ZenPacks/Iwillfearnoevil/Powernet7930/Pdu7930.py
Python
gpl-2.0
1,065
from textwrap import dedent from unittest import TestCase from lxml import etree from pcs_test.tools.assertions import AssertPcsMixin from pcs_test.tools.cib import get_assert_pcs_effect_mixin from pcs_test.tools.misc import get_test_resource as rc from pcs_test.tools.misc import ( get_tmp_file, skip_unless_c...
tomjelinek/pcs
pcs_test/tier1/test_cib_options.py
Python
gpl-2.0
32,976
#!/usr/bin/env python # coding: utf8 # ____ _____ # ________ _________ ____ / __ \/ ___/ # / ___/ _ \/ ___/ __ \/ __ \/ / / /\__ \ # / / / __/ /__/ /_/ / / / / /_/ /___/ / # ...
Daverball/reconos
tools/python/mhstools.py
Python
gpl-2.0
7,320
"""MIT License, Will Bond <will@wbond.net>, see README.md for full info""" import sublime class ThreadProgress(): """ Animates an indicator, [= ], in the status area while a thread runs :param thread: The thread to track for activity :param message: The message to display next to t...
Oblongmana/sublime-salesforce-reference
ThreadProgress.py
Python
gpl-3.0
1,341
# -*- coding: utf-8 -*- ######################################################################### # # Copyright (C) 2016 OSGeo # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 ...
cjahangir/geodash
geonode/documents/tests.py
Python
gpl-3.0
11,741
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright 2013 Communications Engineering Lab (CEL) / Karlsruhe Institute of Technology (KIT) # # This 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...
sdrkjt/gr-lte
python/qa_pcfich_unpack_vfm.py
Python
gpl-3.0
2,263
#! /usr/bin/env python # -*- coding: utf-8 -*- import portfolio # NOTE: when using iterated search included, we must include the option # "plan_counter=PLANCOUNTER" CONFIGS = [ # eager_greedy_ff (330, ["--heuristic", "h=ff(cost_type=H_COST_TYPE)", "--search", "eager_greedy(h,preferr...
rock-planning/planning-fd_cedalion
src/search/downward-seq-sat-fdss-2.py
Python
gpl-3.0
2,712
from __future__ import unicode_literals # # Copyright 2004 Free Software Foundation, Inc. # # This file is part of GNU Radio # # SPDX-License-Identifier: GPL-3.0-or-later # class NotDAG (Exception): """Not a directed acyclic graph""" pass class CantHappen (Exception): """Can't happen""" pass
jdemel/gnuradio
gnuradio-runtime/python/gnuradio/gr/exceptions.py
Python
gpl-3.0
311
""" Failover Transfer The failover transfer client exposes the following methods: - transferAndRegisterFile() - transferAndRegisterFileFailover() Initially these methods were developed inside workflow modules but have evolved to a generic 'transfer file with failover' client. The transferAndR...
coberger/DIRAC
DataManagementSystem/Client/FailoverTransfer.py
Python
gpl-3.0
11,229
""" Python wrappers for Orthogonal Distance Regression (ODRPACK). Classes ======= Data -- stores the data and weights to fit against RealData -- stores data with standard deviations and covariance matrices Model -- stores the model and its related information Output -- stores all of the output from an ODR run ODR...
ygenc/onlineLDA
onlineldavb_new/build/scipy/scipy/odr/odrpack.py
Python
gpl-3.0
39,749
# Authors: Ana Krivokapic <akrivoka@redhat.com> # # Copyright (C) 2013 Red Hat # see file 'COPYING' for use and warranty information # # 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 ver...
apophys/freeipa
ipaserver/advise/plugins/legacy_clients.py
Python
gpl-3.0
15,674
# Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2019, Numenta, Inc. Unless you have an agreement # with Numenta, Inc., for a separate license for this software code, the # following terms and conditions apply: # # This program is free software: you can redistribute it and/or modify # it unde...
mrcslws/nupic.research
projects/rsm/rsm_samplers.py
Python
agpl-3.0
9,884
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2010 Savoir-faire Linux (<http://www.savoirfairelinux.com>). # # This program is free software: you can redistribute it and/or modify # it und...
jobiols/management-system
mgmtsystem_hazard_risk/__openerp__.py
Python
agpl-3.0
1,727
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2010-today OpenERP SA (<http://www.openerp.com>) # # This program is free software: you can redistribute it and/or modify # it under the terms o...
cdrooom/odoo
addons/mail/mail_mail.py
Python
agpl-3.0
18,908
from django import forms from django.db.models import ( BinaryField, BooleanField, Case, CharField, Q, Value, When, ) from django.utils.functional import cached_property from django.utils.html import format_html from django.utils.translation import ugettext_lazy as _ from ..models import ( Place, VisibilitySet...
tejoesperanto/pasportaservo
hosting/forms/visibility.py
Python
agpl-3.0
11,039
# This file is part of Shuup. # # Copyright (c) 2012-2017, Shoop Commerce Ltd. All rights reserved. # # This source code is licensed under the OSL-3.0 license found in the # LICENSE file in the root directory of this source tree. from django.conf import settings from django.conf.urls import include, url from django.con...
suutari-ai/shoop
shuup/testing/single_page_checkout_with_login_and_register_conf.py
Python
agpl-3.0
1,619
#!/usr/bin/python2 ''' This script parses JPEG images of text documents to isolate and save images of individual characters. The size of these output images in pixels is specified by the parameters desired_height and desired_width. The JPEG images are converted to grey scale using a parameter called luminance_thre...
numenta/nupic.vision
src/nupic/vision/data/OCR/characters/parseJPG.py
Python
agpl-3.0
7,772
"""Ensure we can compute activity for a set of events""" import datetime from edx.analytics.tasks.tests.acceptance import AcceptanceTestCase class UserActivityAcceptanceTest(AcceptanceTestCase): """Ensure we can compute activity for a set of events""" INPUT_FILE = 'user_activity_tracking.log' END_DATE ...
sssllliang/edx-analytics-pipeline
edx/analytics/tasks/tests/acceptance/test_user_activity.py
Python
agpl-3.0
5,050
from . import test_l10n_br_hr from . import test_hr_employee_dependent
OCA/l10n-brazil
l10n_br_hr/tests/__init__.py
Python
agpl-3.0
71
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations from django.conf import settings class Migration(migrations.Migration): dependencies = [ ('registration', '0001_initial'), ] operations = [ migrations.AlterField( model_n...
yourcelf/btb
scanblog/btb/registration_migrations/0002_auto_20150902_1253.py
Python
agpl-3.0
479
#!/usr/bin/env python3 # # fdroidserver/__main__.py - part of the FDroid server tools # Copyright (C) 2020 Michael Pöhn <michael.poehn@fsfe.org> # Copyright (C) 2010-2015, Ciaran Gultnieks, ciaran@ciarang.com # Copyright (C) 2013-2014 Daniel Marti <mvdan@mvdan.cc> # # This program is free software: you can redistribute...
fdroidtravis/fdroidserver
fdroidserver/__main__.py
Python
agpl-3.0
9,662
"""Deprecated import support. Auto-generated by import_shims/generate_shims.sh.""" # pylint: disable=redefined-builtin,wrong-import-position,wildcard-import,useless-suppression,line-too-long from import_shims.warn import warn_deprecated_import warn_deprecated_import('discussion.signals.handlers', 'lms.djangoapps.disc...
eduNEXT/edunext-platform
import_shims/lms/discussion/signals/handlers.py
Python
agpl-3.0
404
"""Deprecated import support. Auto-generated by import_shims/generate_shims.sh.""" # pylint: disable=redefined-builtin,wrong-import-position,wildcard-import,useless-suppression,line-too-long from import_shims.warn import warn_deprecated_import warn_deprecated_import('contentstore.config.tests', 'cms.djangoapps.conten...
eduNEXT/edunext-platform
import_shims/studio/contentstore/config/tests/__init__.py
Python
agpl-3.0
398
# -*- Mode: Python; test-case-name: -*- # vi:si:et:sw=4:sts=4:ts=4 # Flumotion - a streaming media server # Copyright (C) 2004,2005,2006,2007,2008,2009 Fluendo, S.L. # Copyright (C) 2010,2011 Flumotion Services, S.A. # All rights reserved. # # This file may be distributed and/or modified under the terms of # the GNU L...
flumotion-mirror/flumotion
flumotion/component/misc/httpserver/serverstats.py
Python
lgpl-2.1
7,784
# 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 Dust(Package): """du + rust = dust. Like du but more intuitive.""" homepage = "https:...
LLNL/spack
var/spack/repos/builtin/packages/dust/package.py
Python
lgpl-2.1
1,546
# 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 PyThreadpoolctl(PythonPackage): """Python helpers to limit the number of threads used in the threadpool-bac...
LLNL/spack
var/spack/repos/builtin/packages/py-threadpoolctl/package.py
Python
lgpl-2.1
857
# # Copyright (C) 2012-2014 Red Hat, Inc. # # Licensed under the GNU Lesser General Public License Version 2.1 # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of th...
yavor-atanasov/hawkey
tests/python/tests/test_query.py
Python
lgpl-2.1
11,221
# -*- coding: utf-8 -*- import werkzeug from openerp.addons.web import http from openerp.addons.web.http import request from openerp.addons.saas_portal.controllers.main import SaasPortal def signup_redirect(): url = '/web/signup?' redirect_url = '%s?%s' % (request.httprequest.base_url, werkzeug.urls.url_encod...
iledarn/odoo-saas-tools
saas_portal_demo/controllers/main.py
Python
lgpl-3.0
1,196
"""The Smart Meter Texas integration.""" import asyncio import logging from smart_meter_texas import Account, Client from smart_meter_texas.exceptions import ( SmartMeterTexasAPIError, SmartMeterTexasAuthError, ) from homeassistant.config_entries import ConfigEntry from homeassistant.const import CONF_PASSWOR...
w1ll1am23/home-assistant
homeassistant/components/smart_meter_texas/__init__.py
Python
apache-2.0
4,059
"""Device tracker support for OPNSense routers.""" from homeassistant.components.device_tracker import DeviceScanner from . import CONF_TRACKER_INTERFACE, OPNSENSE_DATA async def async_get_scanner(hass, config, discovery_info=None): """Configure the OPNSense device_tracker.""" interface_client = hass.data[OP...
home-assistant/home-assistant
homeassistant/components/opnsense/device_tracker.py
Python
apache-2.0
2,172
# This service simply echoes back the URL-encoded arguments passed to it. def run(*pargs, **kwargs): response = "" # Dump the positional arguments. if len(pargs) > 0: response += "[" + ", ".join(pargs) + "]" # Dump the keyword arguments. for k in kwargs: response += "\n%s -> %s" % ...
mathstuf/tangelo
tests/web/echo.py
Python
apache-2.0
462
""" For types associated with installation schemes. For a general overview of available schemes and their context, see https://docs.python.org/3/install/index.html#alternate-installation. """ SCHEME_KEYS = ['platlib', 'purelib', 'headers', 'scripts', 'data'] class Scheme: """A Scheme holds paths which are used...
google/material-design-icons
update/venv/lib/python3.9/site-packages/pip/_internal/models/scheme.py
Python
apache-2.0
770
# -*- coding: utf-8 -*- import scrapy class SchoolSpider(scrapy.Spider): name = "school" resources = "xhr" def start_requests(self): # 中国教育在线 url = 'http://gkcx.eol.cn/soudaxue/queryschool.html?page=' # p=76 下载失败 p=88 下载失败 p=94 下载失败 下载完成 for num in range(1, 278): ...
petersn-github/Gandalf
stark-crawler/src/spiders/school.py
Python
apache-2.0
1,041
import logging import pytest from unittest.mock import patch, call from collections import namedtuple from opentrons.config.reset import ResetOptionId from opentrons.config import advanced_settings # TODO(isk: 3/20/20): test validation errors after refactor # return {message: string} @pytest.mark.parametrize( "l...
Opentrons/labware
robot-server/tests/service/legacy/routers/test_settings.py
Python
apache-2.0
16,224
import os import sys import codecs from contextlib import contextmanager from itertools import repeat from functools import update_wrapper from .types import convert_type, IntRange, BOOL from .utils import make_str, make_default_short_help, echo from .exceptions import ClickException, UsageError, BadParameter, Abort, ...
sourlows/rating-cruncher
src/lib/click/core.py
Python
apache-2.0
65,670
#!/usr/bin/env python # -*- coding: utf-8 -*- # # This file is part of PyBuilder # # Copyright 2011-2020 PyBuilder Team # # 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 # # h...
pybuilder/pybuilder
setup.py
Python
apache-2.0
1,895
# 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...
madjam/mxnet
python/mxnet/_ctypes/ndarray.py
Python
apache-2.0
5,374
# coding=utf-8 # Copyright 2018 The Tensor2Tensor Authors. # # 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...
mlperf/training_results_v0.5
v0.5.0/google/research_v3.32/gnmt-tpuv3-32/code/gnmt/model/t2t/tensor2tensor/models/research/transformer_vae_test.py
Python
apache-2.0
2,344
"""Support for the Tuya climate devices.""" from datetime import timedelta import logging from homeassistant.components.climate import ( DOMAIN as SENSOR_DOMAIN, ENTITY_ID_FORMAT, ClimateEntity, ) from homeassistant.components.climate.const import ( FAN_HIGH, FAN_LOW, FAN_MEDIUM, HVAC_MODE_...
tboyce021/home-assistant
homeassistant/components/tuya/climate.py
Python
apache-2.0
7,772
# Copyright (c) 2014 Alex Meade. All rights reserved. # Copyright (c) 2014 Clinton Knight. All rights reserved. # Copyright (c) 2014 Andrew Kerr. All rights reserved. # Copyright (c) 2015 Tom Barron. All rights reserved. # Copyright (c) 2015 Goutham Pacha Ravi. All rights reserved. # All Rights Reserved. # # Lic...
tobegit3hub/cinder_docker
cinder/tests/unit/volume/drivers/netapp/dataontap/test_block_base.py
Python
apache-2.0
38,413
#!/usr/bin/env python3 # This file is part of BenchExec, a framework for reliable benchmarking: # https://github.com/sosy-lab/benchexec # # SPDX-FileCopyrightText: 2007-2020 Dirk Beyer <https://www.sosy-lab.org> # # SPDX-License-Identifier: Apache-2.0 import argparse import itertools import sys from benchexec import...
ultimate-pa/benchexec
contrib/plots/quantile-generator.py
Python
apache-2.0
5,188
# 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...
pixelrebel/st2
st2common/st2common/bootstrap/sensorsregistrar.py
Python
apache-2.0
6,750
"""Fixtures for pywemo.""" import asyncio from unittest.mock import create_autospec, patch import pytest import pywemo from homeassistant.components.wemo import CONF_DISCOVERY, CONF_STATIC from homeassistant.components.wemo.const import DOMAIN from homeassistant.setup import async_setup_component MOCK_HOST = "127.0....
partofthething/home-assistant
tests/components/wemo/conftest.py
Python
apache-2.0
2,417
import csv import random import cassandra from nose.tools import assert_items_equal class DummyColorMap(object): def __getitem__(self, *args): return '' def csv_rows(filename, delimiter=None): """ Given a filename, opens a csv file and yields it line by line. """ reader_opts = {} i...
carlyeks/cassandra-dtest
cqlsh_tests/cqlsh_tools.py
Python
apache-2.0
2,124
from __future__ import print_function, division, absolute_import from fontTools.misc.py23 import * from fontTools.misc.textTools import safeEval, readHex from fontTools.ttLib import getSearchRange from fontTools.unicode import Unicode from . import DefaultTable import sys import struct import array import operator cl...
googlei18n/fontuley
src/third_party/fontTools/Lib/fontTools/ttLib/tables/_c_m_a_p.py
Python
apache-2.0
45,080
#!/usr/bin/env python3 ############################################################################### # Copyright 2018 The Apollo 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...
xiaoxq/apollo
modules/tools/open_space_visualization/open_space_roi_visualizer.py
Python
apache-2.0
3,303
"""Add autoincrement Revision ID: 73b63ad41d3 Revises: 331f2c45f5a Create Date: 2017-07-25 17:09:55.204538 """ # revision identifiers, used by Alembic. revision = '73b63ad41d3' down_revision = '331f2c45f5a' from alembic import op from sqlalchemy import Integer import sqlalchemy as sa def upgrade(): op.alter_c...
porduna/appcomposer
alembic/versions/73b63ad41d3_add_autoincrement.py
Python
bsd-2-clause
446
from django.contrib import admin from geotrek.core.models import (PathSource, Stake, Usage, Network, Comfort) class PathSourceAdmin(admin.ModelAdmin): list_display = ('source', 'structure') search_fields = ('source', 'structure') list_filter = ('structure',) class StakeAdmin(admin.ModelAdmin): list...
mabhub/Geotrek
geotrek/core/admin.py
Python
bsd-2-clause
1,125
"""Takes an unrolled StencilModel and converts it to a C++ AST. The third stage in processing. Input must be processed with StencilUnrollNeighborIter first to remove neighbor loops and InputElementZeroOffset nodes. Done once per call. """ import ast import asp.codegen.cpp_ast as cpp_ast import asp.codegen.ast_tools a...
shoaibkamil/asp
tools/debugger/stencil/stencil_convert.py
Python
bsd-3-clause
9,147
ACTIVITY_EVENT_ATTEND = 'Attended an Event' ACTIVITY_EVENT_CREATE = 'Organized an Event' ACTIVITY_CAMPAIGN = 'Participated in a campaign' ACTIVITY_MONTH_PLANNING = 'Month planning' ACTIVITY_MONTH_RECAP = 'Month recap' ACTIVITY_POST_EVENT_METRICS = 'Completed post-event metrics' ACTIVITY_RECRUITMENT_EFFORT = 'Recruitmen...
chirilo/remo
remo/reports/__init__.py
Python
bsd-3-clause
844
import itertools import pickle import numpy as np from numpy.testing import assert_array_almost_equal import pytest from scipy.spatial.distance import cdist from sklearn.neighbors import DistanceMetric from sklearn.neighbors import BallTree from sklearn.utils import check_random_state from sklearn.utils._testing imp...
shyamalschandra/scikit-learn
sklearn/neighbors/tests/test_dist_metrics.py
Python
bsd-3-clause
8,002
# -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding field 'ProjectKey.user_added' db.add_column('sentry_projectkey', 'user_added', ...
beni55/sentry
src/sentry/migrations/0068_auto__add_field_projectkey_user_added__add_field_projectkey_date_added.py
Python
bsd-3-clause
20,383
from __future__ import print_function import warnings import os.path as op import copy as cp from nose.tools import assert_true, assert_raises, assert_equal import numpy as np from numpy.testing import assert_array_equal, assert_array_almost_equal import mne from mne.datasets import testing from mne.beamformer import...
jaeilepp/mne-python
mne/beamformer/tests/test_dics.py
Python
bsd-3-clause
13,250
import os import sys import click from .packages import get_package_info, register_package, publish_package from .cli import pass_context def ensure_plugin(): here = os.getcwd() if not os.path.isfile(os.path.join(here, 'setup.py')): raise click.UsageError('This command must be run in a ' ...
lektor/lektor-archive
lektor/devcli.py
Python
bsd-3-clause
3,718
# -*- coding: utf-8 -*- import json from vilya.libs import api_errors from vilya.models.project import CodeDoubanProject from vilya.views.api.utils import RestAPIUI, api_require_login, jsonize from vilya.views.api.repos.product import ProductUI from vilya.views.api.repos.summary import SummaryUI from vilya.views.api....
xtao/code
vilya/views/api/repos/__init__.py
Python
bsd-3-clause
4,261
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # # Code generated by Microsoft (R) AutoRest Code Generator. # Changes ...
lmazuel/azure-sdk-for-python
azure-mgmt-logic/azure/mgmt/logic/models/business_identity.py
Python
mit
1,162
# -*- coding: utf-8 -*- from __future__ import unicode_literals, absolute_import import functools import inspect from .common import * # pylint: disable=redefined-builtin from .datastructures import Context from .exceptions import FieldError, DataError from .transforms import import_loop, validation_converter from ....
georgestarcher/TA-SyncKVStore
bin/ta_synckvstore/solnlib/packages/schematics/validate.py
Python
mit
3,988
# -*- coding: utf-8 -*- import datetime, time, csv, os from utils.db import SqliteDB from utils.rwlogging import log from utils.rwlogging import strategyLogger as logs from trader import Trader from indicator import ma, macd, bolling, rsi, kdj from strategy.pool import StrategyPool highest = 0 def runStrategy(prices)...
rolandwz/pymisc
utrader/strategy/bollingTrader.py
Python
mit
2,348