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
# 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 # distributed under the...
dtroyer/python-openstacksdk
openstack/cloud/_network.py
Python
apache-2.0
104,230
# Copyright (C) 2013-2016 DNAnexus, Inc. # # This file is part of dx-toolkit (DNAnexus platform client libraries). # # 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...
johnwallace123/dx-toolkit
src/python/dxpy/cli/workflow.py
Python
apache-2.0
11,696
"""Test the Dyson fan component.""" import json import unittest from unittest import mock import asynctest from libpurecool.const import FanMode, FanSpeed, NightMode, Oscillation from libpurecool.dyson_pure_cool import DysonPureCool from libpurecool.dyson_pure_cool_link import DysonPureCoolLink from libpurecool.dyson_...
Teagan42/home-assistant
tests/components/dyson/test_fan.py
Python
apache-2.0
30,624
# watch.py # usage: watch.py [-h] [-c COUNT] [-i INTERVAL] [-d] command # # This script displays the output of a specified CLI command every n seconds # Example "run script watch.py "show port packet no-ref"" # # positional arguments: # command Command to iterate. Should be enclosed in quotes (i.e. # ...
extremenetworks/xkit
EXOS/Python/watch/watch.py
Python
bsd-2-clause
5,605
import unittest from collections import namedtuple from datetime import datetime, timedelta import random from tkp.steps.misc import group_per_timestep MockOrmImage = namedtuple('MockOrmImage', ['taustart_ts', 'freq_eff', 'stokes']) now = datetime.now() def create_input(): """ returns a list of mock orm imag...
mkuiack/tkp
tests/test_utility/test_sorting.py
Python
bsd-2-clause
1,609
import sys import sysconfig import os import re import errno import shlex import shutil import subprocess import itertools import concurrent.futures from site import USER_SITE from glob import iglob from collections import namedtuple, deque from xml.sax.saxutils import escape from distutils import version import pkg_...
marinkaz/orange3
Orange/canvas/application/addons.py
Python
bsd-2-clause
26,262
from __future__ import division, print_function import numpy as np from lmfit.models import VoigtModel from scipy.signal import argrelmax import matplotlib.pyplot as plt def lamda_from_bragg(th, d, n): return 2 * d * np.sin(th / 2.) / n def find_peaks(chi, sides=6, intensity_threshold=0): # Find all potenti...
NSLS-II-XPD/ipython_ophyd
archived/profile_collection-dev/startup/42-energy-calib.py
Python
bsd-2-clause
4,842
""" Copyright (c) 2015 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. It returns the dockerfile itself and therefore displays it in results. """ from __future__ import unicode_literals import os from os.path impor...
TomasTomecek/atomic-reactor
atomic_reactor/plugins/prepub_squash.py
Python
bsd-3-clause
4,451
from django.contrib.auth.models import User from django.test import TestCase import autofixture autofixture.autodiscover() class AutodiscoverTestCase(TestCase): def test_builtin_fixtures(self): from autofixture.autofixtures import UserFixture self.assertEqual(autofixture.REGISTRY[User], UserFixt...
gregmuellegger/django-autofixture
autofixture_tests/tests/test_autodiscover.py
Python
bsd-3-clause
325
import sys import os from runtests import run if __name__ == '__main__': if sys.version_info > (3, 3): run(coverage=True, coveralls=True) else: run()
lsbardel/python-stdnet
covrun.py
Python
bsd-3-clause
177
from django.conf import settings from django.contrib.sites.models import Site from django.db import models, connection, DatabaseError from django.db.models import loading from django.utils.translation import ugettext_lazy as _ from keyedcache import cache_key, cache_get, cache_set, NotCachedError from keyedcache.models...
pombredanne/django-livesettings
livesettings/models.py
Python
bsd-3-clause
6,191
# -*- coding: utf8 -*- from __future__ import absolute_import """ """ __author__ = "Jerome Samson" __copyright__ = "Copyright 2014, Mikros Image" import logging import time try: import simplejson as json except ImportError: import json from tornado.web import HTTPError from octopus.core.communication.http i...
mikrosimage/OpenRenderManagement
src/octopus/dispatcher/webservice/job.py
Python
bsd-3-clause
3,190
"""Tests for input validation functions""" import warnings from tempfile import NamedTemporaryFile from itertools import product import numpy as np from numpy.testing import assert_array_equal, assert_warns import scipy.sparse as sp from nose.tools import assert_raises, assert_true, assert_false, assert_equal from ...
danbob123/gplearn
gplearn/skutils/tests/test_validation.py
Python
bsd-3-clause
14,136
import pandas from emission.net.api.stats import storeClientEntry, storeServerEntry, storeResultEntry def loadEntries(fname): df = pandas.read_csv(fname) entries = [] for c in range(len(df)): entry = {} for key in df.keys(): entry[key] = df[key][c] entries.append(entry) return entries def storeClientEn...
joshzarrabi/e-mission-server
emission/net/int_service/giles/store_existing_stats.py
Python
bsd-3-clause
1,854
# Merge Sort # Complexity: O(nlog(n)) def _merge(L, R): m, i, j = [], 0, 0 while i < len(L) and j < len(R): if L[i] <= R[j]: m.append(L[i]) i += 1 else: m.append(R[j]) j += 1 if i == len(L): m.extend(R[j:]) else: m.extend(...
rehassachdeva/pydsa
pydsa/merge_sort.py
Python
bsd-3-clause
683
__author__ = "mfreer" __date__ = "2011-05-27 14:27" __version__ = "1.0" __all__ = ["TempVirtualCnrm"] import egads.core.egads_core as egads_core import egads.core.metadata as egads_metadata class TempVirtualCnrm(egads_core.EgadsAlgorithm): """ FILE temp_virtual_cnrm.py VERSION 1.0 CA...
eufarn7sp/egads-eufar
egads/algorithms/thermodynamics/temp_virtual_cnrm.py
Python
bsd-3-clause
3,161
"""OAuth 2.0 WSGI server middleware providing MyProxy certificates as access tokens """ __author__ = "W van Engen" __date__ = "01/11/12" __copyright__ = "(C) 2011 FOM / Nikhef" __license__ = "BSD - see LICENSE file in top-level directory" __contact__ = "wvengen+oauth2@nikhef.nl" __revision__ = "$Id$" from base64 impor...
cedadev/ndg_oauth
ndg_oauth_server/ndg/oauth/server/lib/authenticate/password_authenticator.py
Python
bsd-3-clause
2,193
#!/usr/bin/env python import os import sys import time import platform import argparse from datetime import datetime from space_checker_utils import wget_wrapper import ConfigParser def create_directory(directory): """Create parent directories as necessary. :param directory: (~str) Path of directory to be ...
DePierre/owtf
install/install.py
Python
bsd-3-clause
10,142
"""Core implementation of import. This module is NOT meant to be directly imported! It has been designed such that it can be bootstrapped into Python as the implementation of import. As such it requires the injection of specific modules and attributes in order to work. One should use importlib as the public-facing ver...
kikocorreoso/brython
www/src/Lib/importlib/_bootstrap.py
Python
bsd-3-clause
39,424
from flask.ext.security import SQLAlchemyUserDatastore from .models import Role, User, db # Setup Flask-Security user_datastore = SQLAlchemyUserDatastore(db, User, Role)
Infinidat/lanister
flask_app/auth.py
Python
bsd-3-clause
172
#! /usr/bin/python # Version info: $Id: NonLinearFit2D.py 230 2010-06-30 20:20:14Z zunzun.com $ # the pythonequations base is located up one directory from the top-level examples # directory, go up one directory in the path from there for the import to work properly import sys, os if os.path.join(sys.path[0][:sys.p...
JMoravec/unkRadnet
zunzunCode/pythonequations/Examples/SimpleExamples/NonLinearFit2D.py
Python
bsd-3-clause
1,888
#!/usr/bin/env python from setuptools import setup, find_packages setup( name='wafw00f', version=__import__('wafw00f').__version__, description=('WAFW00F identifies and fingerprints ' 'Web Application Firewall (WAF) products.'), author='sandrogauci', author_email='sandro@enables...
dtrip/wafw00f
setup.py
Python
bsd-3-clause
940
from django.utils.six.moves.builtins import str # # django-atompub by James Tauber <http://jtauber.com/> # http://code.google.com/p/django-atompub/ # An implementation of the Atom format and protocol for Django # # For instructions on how to use this module to generate Atom feeds, # see http://code.google.com/p/django-...
nharsch/django-scheduler
schedule/feeds/atom.py
Python
bsd-3-clause
22,525
"""Site-specific content, templatetags and such."""
JamesJGarner/cms
src/cms/project_template/project_name/apps/site/__init__.py
Python
bsd-3-clause
51
#!/usr/bin/python # try: import gdb except ImportError as e: raise ImportError("This script must be run in GDB: ", str(e)) import sys import os sys.path.append(os.getcwd()) import common_helpers simple_types = ["CMasternode", "CMasternodeVerification", "CMasternodeBroadcast", "CMasternodePing...
ivansib/sibcoin
contrib/auto_gdb/simple_class_obj.py
Python
mit
2,004
#!/usr/bin/env python3 # Copyright (c) 2020 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Test fee filters during and after IBD.""" from decimal import Decimal from test_framework.messages import ...
AkioNak/bitcoin
test/functional/p2p_ibd_txrelay.py
Python
mit
1,575
# -*- coding: utf-8 -*- """ tests.test_directory ~~~~~~~~~~~~~~~~~~~~ Tests pickup.directory :author: Feei <feei@feei.cn> :homepage: https://github.com/wufeifei/cobra :license: MIT, see LICENSE for more details. :copyright: Copyright (c) 2017 Feei. All rights reserved """ import os ...
braveghz/cobra
tests/test_directory.py
Python
mit
905
# Copyright (C) 2014 - Oscar Campos <oscar.campos@member.fsf.org> # This program is Free Software see LICENSE file for details """AnacondaPHP is a PHP linting plugin for Sublime Text 3 """ from .plugin_version import anaconda_required_version from .anaconda_lib.anaconda_plugin import anaconda_version if anaconda_r...
danalec/dotfiles
sublime/.config/sublime-text-3/Packages/anaconda_php/anaconda_php.py
Python
mit
673
from django.db import models from django.db.models.fields.files import FieldFile from django.core.files import File def get_video_dimensions(path): from ffvideo import VideoStream vs = VideoStream(path) return (vs.frame_width, vs.frame_height) class VideoFile(File): """ A mixin for use alongsi...
akhilari7/pa-dude
lib/python2.7/site-packages/image/video_field.py
Python
mit
1,087
#! /usr/bin/python import threading import socket import sys,time import SocketServer,struct,select global bufLen global endflag global socksPort ################### socksPort = 50000 #Default socks5 proxy port ################### endflag = [] bufLen = 4*1024 class startThreadSoket(threading.Thread): def __init_...
0ps/reprocks
client/reprocks_client.py
Python
mit
9,685
# coding: utf-8 """Test that tokenizer exceptions and emoticons are handles correctly.""" from __future__ import unicode_literals import pytest @pytest.mark.parametrize('text', ["auf'm", "du's", "über'm", "wir's"]) def test_de_tokenizer_splits_contractions(de_tokenizer, text): tokens = de_tokenizer(text) a...
recognai/spaCy
spacy/tests/lang/de/test_exceptions.py
Python
mit
1,230
# -*- coding: utf-8 -*- """ Messaging module """ module = "msg" if deployment_settings.has_module(module): def messaging_tables(): """ Load the tables required for Messaging, when-required""" # Message priority msg_priority_opts = { 3:T("High"), 2:T("Medium"),...
flavour/porto
models/msg.py
Python
mit
32,132
from chainer import cuda from chainer import function from chainer.utils import type_check def _kern(): return cuda.elementwise( 'T cond, T x, T slope', 'T y', 'y = cond >= 0 ? x : (T)(slope * x)', 'lrelu') class LeakyReLU(function.Function): """Leaky rectifier unit.""" def __init__(se...
kiyukuta/chainer
chainer/functions/activation/leaky_relu.py
Python
mit
2,382
# This file is part of Indico. # Copyright (C) 2002 - 2021 CERN # # Indico is free software; you can redistribute it and/or # modify it under the terms of the MIT License; see the # LICENSE file for more details. from sqlalchemy import func from indico.modules.rb.models.rooms import Room from indico.modules.rb.operat...
pferreir/indico
indico/modules/rb/user_prefs.py
Python
mit
2,767
from flask import Flask, request, send_from_directory from time import sleep app = Flask(__name__, static_url_path='/public') @app.route('/') def root(): return send_from_directory('./', 'index.html') @app.route('/feedback.js') def script(): return send_from_directory('./', 'feedback.js') @app.route('/feedb...
deviantintegral/feedback
src/listener.py
Python
mit
622
#vim: set encoding=utf-8 from copy import deepcopy from lxml import etree from regparser.notice.diff import DesignateAmendment from regparser.notice.util import spaces_then_remove from regparser.tree.struct import Node, treeify from regparser.tree.xml_parser import interpretations, tree_utils def _is_interp_amend(a...
EricSchles/regulations-parser
regparser/notice/build_interp.py
Python
cc0-1.0
2,849
from datetime import datetime from regulations.generator import api_reader from regulations.generator.layers.utils import convert_to_python def fetch_regulations_and_future_versions(): """ Returns a dict for all the regulations in the API. The dict includes lists of future versions for each regulation. """ ...
jeremiak/regulations-site
regulations/generator/versions.py
Python
cc0-1.0
1,918
""" controller device support class(es) http://libvirt.org/formatdomain.html#elementsControllers """ from virttest.libvirt_xml import accessors from virttest.libvirt_xml.devices import base, librarian class Controller(base.TypedDeviceBase): __slots__ = ('type', 'index', 'model', 'driver', 'address') def _...
rbian/virt-test
virttest/libvirt_xml/devices/controller.py
Python
gpl-2.0
1,764
# # This is an extension to the Nautilus file manager to allow better # integration with the Subversion source control system. # # Copyright (C) 2010 by Jason Heeris <jason.heeris@gmail.com> # # RabbitVCS is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License a...
CloCkWeRX/rabbitvcs-svn-mirror
rabbitvcs/ui/property_page.py
Python
gpl-2.0
7,016
# 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. from gi.repository import Gtk import quodlibet.config from quodlibet.b...
quodlibet/quodlibet
tests/test_browsers_audiofeeds.py
Python
gpl-2.0
1,973
# -*-python-*- # GemRB - Infinity Engine Emulator # Copyright (C) 2011 The GemRB Project # # 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) ...
flaing/gemrb
gemrb/GUIScripts/GUIRECCommon.py
Python
gpl-2.0
19,924
#!/usr/bin/env python # -*- coding: utf-8 -*- # file lyx_pot.py # This file is part of LyX, the document processor. # Licence details can be found in the file COPYING. # # \author Bo Peng # # Full author contact details are available in file CREDITS # Usage: use # lyx_pot.py -h # to get usage message # This scri...
thomasjm/LyX
po/lyx_pot.py
Python
gpl-2.0
27,060
#!/usr/bin/python """ Cartesian configuration format file parser. Filter syntax: * ``,`` means ``OR`` * ``..`` means ``AND`` * ``.`` means ``IMMEDIATELY-FOLLOWED-BY`` * ``(xx=yy)`` where ``xx=VARIANT_NAME`` and ``yy=VARIANT_VALUE`` Example: :: qcow2..(guest_os=Fedora).14, RHEL.6..raw..boot, smp2..qcow2..migr...
xutian/avocado-vt
virttest/cartesian_config.py
Python
gpl-2.0
78,677
# -*- coding: utf-8 -*- # import xbmcaddon import logging import kodilogging from service import traktService from utilities import createError __addon__ = xbmcaddon.Addon('script.trakt') __addonversion__ = __addon__.getAddonInfo('version') __addonid__ = __addon__.getAddonInfo('id') kodilogging.config() logger = loggi...
AMOboxTV/AMOBox.LegoBuild
script.trakt/default.py
Python
gpl-2.0
582
#!usr/bin/env python # # Copyright 2013 Matthew Wall # See the file LICENSE.txt for your full rights. # # Thanks to Kenneth Lavrsen for the Open2300 implementation: # http://www.lavrsen.dk/foswiki/bin/view/Open2300/WebHome # description of the station communication interface: # http://www.lavrsen.dk/foswiki/bin/vie...
garretlh/nimbus-drivers
src/main/python/nimbusdrivers/ws23xx.py
Python
gpl-3.0
72,031
# -*- coding: utf-8 -*- # Author: Nic Wolfe <nic@wolfeden.ca> # URL: http://code.google.com/p/sickbeard/ # # This file is part of SickRage. # # SickRage is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either ...
mcus/SickRage
sickbeard/metadata/helpers.py
Python
gpl-3.0
1,450
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt import frappe def execute(): frappe.reload_doc('manufacturing', 'doctype', 'job_card_time_log') if (frappe.db.table_exists("Job Card") and frappe.get_meta("Job Card").has_f...
mhbu50/erpnext
erpnext/patches/v11_1/make_job_card_time_logs.py
Python
gpl-3.0
1,348
import sys print >>sys.stdout, 'Hello World' print >>sys.stdout, 1, 2, 3 print >>sys.stdout, 1, 2, 3, print >>sys.stdout
zrax/pycdc
tests/input/test_extendedPrint.py
Python
gpl-3.0
122
# =============================================================================== # Copyright (C) 2010 Diego Duclos # # This file is part of eos. # # eos 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, ...
blitzmann/Pyfa
eos/db/gamedata/group.py
Python
gpl-3.0
1,802
# Copyright (C) IBM Corp. 2017. # # 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 of the License, or # (at your option) any later version. # # This program is distributed in the...
open-power-host-os/builds
lib/subcommands/update_metapackage.py
Python
gpl-3.0
2,543
# # Copyright 2008-2018 Universidad Complutense de Madrid # # This file is part of PyEmir # # PyEmir is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any l...
guaix-ucm/pyemir
emirdrp/tools/merge_bounddict_files.py
Python
gpl-3.0
3,275
import os from fabric.api import run, sudo, cd, env, task, settings from ..literals import FABFILE_MARKER def delete_mayan(): """ Delete Mayan EDMS files from an Linux system """ sudo('rm %(virtualenv_path)s -Rf' % env) def install_mayan(): """ Install Mayan EDMS on an Linux system ...
appsembler/mayan_appsembler
fabfile/platforms/linux.py
Python
gpl-3.0
922
# 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 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful,...
pombreda/pydbgr
trepan/bwprocessor/__init__.py
Python
gpl-3.0
785
# -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*- # # Copyright (C) 2016-2017 Canonical Ltd # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License version 3 as # published by the Free Software Foundation. # # This program is distributed in ...
dpniel/snapcraft
integration_tests/test_parts.py
Python
gpl-3.0
4,131
#! /usr/bin/python2.7 # -*- coding: utf-8 -*- from __future__ import unicode_literals import requests from requests_oauthlib import OAuth1 from urlparse import parse_qs REQUEST_TOKEN_URL = "https://api.twitter.com/oauth/request_token" AUTHORIZE_URL = "https://api.twitter.com/oauth/authorize?oauth_token=" ACCESS_TOKE...
teampopong/crawlers
twitter/setup.py
Python
agpl-3.0
1,997
'''Unit tests for the i18n_subsites plugin''' import os import locale import unittest import subprocess from tempfile import mkdtemp from shutil import rmtree from . import i18n_subsites as i18ns from pelican import Pelican from pelican.tests.support import get_settings from pelican.settings import read_settings cl...
mikitex70/pelican-plugins
i18n_subsites/test_i18n_subsites.py
Python
agpl-3.0
5,011
# This file is part of Shuup. # # Copyright (c) 2012-2017, Shoop Commerce Ltd. All rights reserved. # # This source code is licensed under the OSL-3.0 license found in the # LICENSE file in the root directory of this source tree. import pytest from shuup.simple_cms.plugins import PageLinksPlugin from shuup_tests.front...
suutari-ai/shoop
shuup_tests/simple_cms/test_plugins.py
Python
agpl-3.0
2,133
# Copyright 2016 Eficent Business and IT Consulting Services S.L. # Copyright 2016 Serpent Consulting Services Pvt. Ltd. # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). from . import test_query_generation
brain-tec/server-tools
base_search_fuzzy/tests/__init__.py
Python
agpl-3.0
221
""" The allchannel community is used to collect votes for channels and thereby discover which channels are most popular. """
vandenheuvel/tribler
Tribler/community/allchannel/__init__.py
Python
lgpl-3.0
125
# Copyright 2016 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, ...
jgeewax/gcloud-python
scripts/verify_included_modules.py
Python
apache-2.0
6,286
"""Support for Pilight binary sensors.""" import datetime import logging import voluptuous as vol from homeassistant.components import pilight from homeassistant.components.binary_sensor import PLATFORM_SCHEMA, BinarySensorDevice from homeassistant.const import ( CONF_DISARM_AFTER_TRIGGER, CONF_NAME, CONF...
leppa/home-assistant
homeassistant/components/pilight/binary_sensor.py
Python
apache-2.0
6,144
# # This file is part of pyasn1-modules software. # # Created by Russ Housley # Copyright (c) 2019, Vigil Security, LLC # License: http://snmplabs.com/pyasn1/license.html # import sys from pyasn1.codec.der import decoder as der_decoder from pyasn1.codec.der import encoder as der_encoder from pyasn1_modules import pe...
kawamon/hue
desktop/core/ext-py/pyasn1-modules-0.2.6/tests/test_rfc5649.py
Python
apache-2.0
1,730
# Copyright 2020 The StackStorm Authors. # Copyright 2019 Extreme Networks, 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 ...
nzlosh/st2
st2common/st2common/models/utils/action_param_utils.py
Python
apache-2.0
6,217
import pytest from waterbutler.providers.onedrive.path import OneDrivePath from tests.providers.onedrive.fixtures import (path_fixtures, root_provider_fixtures, subfolder_provider_fixtures) class TestApiIdentifier: de...
rdhyee/waterbutler
tests/providers/onedrive/test_path.py
Python
apache-2.0
5,141
#!/usr/bin/env python # Copyright 2018 The Kubernetes 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 appli...
kargakis/test-infra
experiment/fix_testgrid_config.py
Python
apache-2.0
2,759
"""Sensor platform for Hass.io addons.""" from __future__ import annotations from homeassistant.components.sensor import ( SensorEntity, SensorEntityDescription, SensorStateClass, ) from homeassistant.config_entries import ConfigEntry from homeassistant.const import PERCENTAGE from homeassistant.core impor...
home-assistant/home-assistant
homeassistant/components/hassio/sensor.py
Python
apache-2.0
3,165
# Copyright 2012 Red Hat, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, so...
tanglei528/nova
nova/virt/disk/vfs/guestfs.py
Python
apache-2.0
8,034
#!/usr/bin/env python # Copyright 2015 The LUCI Authors. All rights reserved. # Use of this source code is governed under the Apache License, Version 2.0 # that can be found in the LICENSE file. import os import sys THIS_DIR = os.path.dirname(os.path.abspath(__file__)) sys.path.insert(0, os.path.join(THIS_DIR, '..', ...
luci/luci-py
appengine/components/components/config/run_coverage.py
Python
apache-2.0
491
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright 2010 British Broadcasting Corporation and Kamaelia Contributors(1) # # (1) Kamaelia Contributors are listed in the AUTHORS file and at # http://www.kamaelia.org/AUTHORS - please extend this file, # not this notice. # # Licensed under the Apache License...
sparkslabs/kamaelia
Sketches/MH/KPI.py
Python
apache-2.0
3,026
from unittest import TestCase from nose.tools import assert_false, ok_, eq_ from tests.alert_page import AlertPage from webium.windows_handler import WindowsHandler class TestSwitchToNewWindow(TestCase): def test_switch_to_new_window(self): page = AlertPage() handler = WindowsHandler() pa...
drptbl/webium
tests/alert_page/test_switch_to_new_window.py
Python
apache-2.0
736
# Copyright 2015 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, ...
quom/google-cloud-python
bigquery/google/cloud/bigquery/__init__.py
Python
apache-2.0
1,261
# # 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...
msonnabaum/thrift
test/crossrunner/run.py
Python
apache-2.0
9,516
from __future__ import print_function import jsons import logging import os BIG_FILE_SIZE = 47684 class Payload: def __init__(self, message, response_code=200, headers={}): self.__response_code = response_code self.__message = message self.__headers = headers def respo...
alexzatsepin/omim
tools/python/ResponseProvider.py
Python
apache-2.0
7,364
# Copyright 2012 Hewlett-Packard Development Company, L.P. # # 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...
carroarmato0/jenkins-job-builder
jenkins_jobs/modules/wrappers.py
Python
apache-2.0
61,023
# Copyright 2014 IBM Corp. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed ...
sebrandon1/nova
nova/tests/unit/virt/hyperv/test_vmops.py
Python
apache-2.0
76,595
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2011 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # Copyright 2011 Nebula, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # no...
rnirmal/openstack-dashboard
django-openstack/django_openstack/middleware/keystone.py
Python
apache-2.0
2,747
# Copyright 2017 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
annarev/tensorflow
tensorflow/python/data/experimental/kernel_tests/directed_interleave_dataset_test.py
Python
apache-2.0
6,838
from __future__ import print_function, unicode_literals import threading from weblab.core.wl import weblab_api """ The target is to forget all the internal things of weblab / Flask and be able to run things like: with wlcontext(server, reservation_id = reservation_id): list_experiments() """ class wlcontext(obje...
morelab/weblabdeusto
server/src/test/util/wlcontext.py
Python
bsd-2-clause
1,599
''' Basic processing procedures for analog signals (e.g., performing a z-score of a signal, or filtering a signal). :copyright: Copyright 2014-2015 by the Elephant team, see AUTHORS.txt. :license: Modified BSD, see LICENSE.txt for details. ''' from __future__ import division, print_function import numpy as np import ...
sonjagruen/elephant
elephant/signal_processing.py
Python
bsd-3-clause
9,104
from .analysis import * from .toolbox import * from . import utils
Geosyntec/python-tidegates
tidegates/__init__.py
Python
bsd-3-clause
67
from __future__ import absolute_import, division, print_function try: import h5py # h5py has precedence over pytables except: pass from multipledispatch import halt_ordering, restart_ordering halt_ordering() # Turn off multipledispatch ordering from .utils import ignoring from .convert import convert from...
ywang007/odo
odo/__init__.py
Python
bsd-3-clause
2,109
#!/usr/bin/env python import os.path import sys # Version file managment scheme and graceful degredation for # setuptools borrowed and adapted from GitPython. try: from setuptools import setup, find_packages # Silence pyflakes assert setup assert find_packages except ImportError: from ez_setup imp...
heroku/wal-e
setup.py
Python
bsd-3-clause
1,831
from __future__ import print_function, division from itertools import product from sympy.core.sympify import _sympify, sympify from sympy.core.basic import Basic from sympy.core.singleton import Singleton, S from sympy.core.evalf import EvalfMixin from sympy.core.numbers import Float from sympy.core.compatibility imp...
ga7g08/sympy
sympy/sets/sets.py
Python
bsd-3-clause
59,122
""" Base classes for writing management commands (named commands which can be executed through ``django-admin.py`` or ``manage.py``). """ import os import sys from optparse import make_option, OptionParser import traceback import django from django.core.exceptions import ImproperlyConfigured from django.core.managem...
andymckay/django
django/core/management/base.py
Python
bsd-3-clause
13,731
# -*- coding: utf-8 -*- import json from vilya.libs import api_errors from vilya.models.gist import ( Gist, gist_detail, PRIVILEGE_PUBLIC, PRIVILEGE_SECRET) from vilya.views.api.gist import GistUI from vilya.views.api.utils import json_body _q_exports = ['starred'] @json_body def _q_index(request): if reque...
douban/code
vilya/views/api/gists.py
Python
bsd-3-clause
2,398
import argparse import numpy as np import os from dagbldr.datasets import fetch_fer from dagbldr.utils import load_checkpoint, interpolate_between_points, make_gif parser = argparse.ArgumentParser() parser.add_argument("saved_functions_file", help="Saved pickle file from vae training") parser.add_...
dribnet/dagbldr
examples/faces_vae/flying_faces_vae.py
Python
bsd-3-clause
2,380
from __future__ import unicode_literals from datetime import date from django.contrib.auth import ( BACKEND_SESSION_KEY, SESSION_KEY, authenticate, get_user, ) from django.contrib.auth.backends import ModelBackend from django.contrib.auth.hashers import MD5PasswordHasher from django.contrib.auth.models import Ano...
varunnaganathan/django
tests/auth_tests/test_auth_backends.py
Python
bsd-3-clause
25,359
from __future__ import absolute_import import copy import os from raven._compat import string_types from raven.utils.imports import import_string def convert_options(settings, defaults=None): """ Convert a settings object (or dictionary) to parameters which may be passed to a new ``Client()`` instance. ...
johansteffner/raven-python
raven/utils/conf.py
Python
bsd-3-clause
2,163
# Copyright 2019 The ANGLE Project Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. def CheckChangeOnUpload(input_api, output_api): return input_api.canned_checks.CheckChangedLUCIConfigs(input_api, output_api) def CheckChangeOnCo...
endlessm/chromium-browser
third_party/angle/infra/config/PRESUBMIT.py
Python
bsd-3-clause
431
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright (c) 2015, Vispy Development Team. # Distributed under the (new) BSD License. See LICENSE.txt for more info. """ This example shows how to use the `ArrowVisual` for a quiver plot """ from __future__ import division import sys import itertools import numpy as ...
michaelaye/vispy
examples/basics/visuals/arrows_quiver.py
Python
bsd-3-clause
2,742
#!/usr/bin/env python """ This script accepts .csv pipeline output and gives a .ps file with a basic tree structure """ __author__ = "Paul Donovan" __maintainer__ = "Paul Donovan" __email__ = "pauldonovandonegal@gmail.com" import sys import argparse from ete3 import NCBITaxa #Display help and usage parser = argpar...
GiantSpaceRobot/FindFungi
FindFungi-v0.23/CSV-to-Tree.py
Python
mit
2,781
from django.core.management.base import BaseCommand, CommandError try: from django.contrib.auth import get_user_model except ImportError: from django.contrib.auth.models import User else: User = get_user_model() from django_otp import devices_for_user class Command(BaseCommand): """ Command for d...
mathspace/django-two-factor-auth
two_factor/management/commands/two_factor_disable.py
Python
mit
998
import json import logging import math import re import tba_config import urllib from difflib import SequenceMatcher from google.appengine.api import memcache, urlfetch from google.appengine.ext import ndb from models.location import Location from models.sitevar import Sitevar from models.team import Team class Loc...
bdaroz/the-blue-alliance
helpers/location_helper.py
Python
mit
24,876
# -*- Mode: Python -*- # GObject-Introspection - a framework for introspecting GObject libraries # Copyright (C) 2008 Johan Dahlin # # 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; eithe...
dieterv/gobject-introspection
giscanner/xmlwriter.py
Python
gpl-2.0
6,059
'''OpenGL extension SGIX.resample This module customises the behaviour of the OpenGL.raw.GL.SGIX.resample to provide a more Python-friendly API Overview (from the spec) This extension enhances the unpacking resampling capabilities of the SGIX_subsample extension. When pixel data is received from the client a...
D4wN/brickv
src/build_data/windows/OpenGL/GL/SGIX/resample.py
Python
gpl-2.0
1,244
#!/usr/bin/env python # # Shell-script style. import os import requests import shutil import subprocess import sys import tempfile import time SQLITE_DB = 'pdns.sqlite3' WEBPORT = '5556' APIKEY = '1234567890abcdefghijklmnopq-key' PDNSUTIL_CMD = ["../pdns/pdnsutil", "--config-dir=."] NAMED_CONF_TPL = """ # Generated ...
job/pdns
regression-tests.api/runtests.py
Python
gpl-2.0
4,913
q1_start = 0 q1_end = 1 N_q1 = 128 q2_start = 0 q2_end = 1 N_q2 = 3 p1_start = -4 p1_end = 4 N_p1 = 4 p2_start = -0.5 p2_end = 0.5 N_p2 = 1 p3_start = -0.5 p3_end = 0.5 N_p3 = 1 N_ghost = 3
ShyamSS-95/Bolt
example_problems/nonrelativistic_boltzmann/beam_test/1D/domain.py
Python
gpl-3.0
225
''' Copyright (C) 2014 Travis DeWolf 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 of the License, or (at your option) any later version. This program is distributed in the hope t...
Vidhyalakshimi/blog
Control/Controllers/trace.py
Python
gpl-3.0
3,021
# Author: Nic Wolfe <nic@wolfeden.ca> # URL: http://code.google.com/p/sickbeard/ # # This file is part of Sick Beard. # # Sick Beard is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of t...
LokiCoder/Sick-Beard
sickbeard/sab.py
Python
gpl-3.0
7,698
# Copyright 2012 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 a...
harshilasu/LinkurApp
y/google-cloud-sdk/platform/gcutil/lib/google_compute_engine/gcutil_lib/windows_password_test.py
Python
gpl-3.0
3,274