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 |
|---|---|---|---|---|---|
"""
Flash an LED connected via a FTDI UM232R/245R module using pylibftdi
Optionally supply a flash rate (in Hz, default 1) as an argument
Copyright (c) 2010-2014 Ben Bass <benbass@codedstructure.net>
All rights reserved.
"""
import time
import sys
from pylibftdi import BitBangDevice
def flash_forever(rate):
"t... | claudyus/pylibftdi | pylibftdi/examples/led_flash.py | Python | mit | 713 |
from flask import Flask
app = Flask(__name__)
from app import vizarvin
| arvinsahni/ml4 | flask/app/__init__.py | Python | mit | 73 |
# -*- coding: utf-8 -*-
"""Amazon boto interface."""
from __future__ import absolute_import, unicode_literals
try:
import boto
except ImportError: # pragma: no cover
boto = get_regions = ResultSet = RegionInfo = XmlHandler = None
class _void(object):
pass
AWSAuthConnection = AWSQueryConnectio... | ammarkhann/FinalSeniorCode | lib/python2.7/site-packages/kombu/async/aws/ext.py | Python | mit | 863 |
# -*- coding: utf-8 -*-
#
# Flask-RQ documentation build configuration file, created by
# sphinx-quickstart on Mon Mar 12 15:35:21 2012.
#
# 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.
#
# Al... | xen/flask-rq | docs/conf.py | Python | mit | 9,809 |
import pygame as pg
from settings import *
class Map:
def __init__(self, filename):
self.data = []
with open(filename, 'rt') as f:
for line in f:
self.data.append(line.strip())
self.tilewidth = len(self.data[0])
self.tileheight = len(self.data)
s... | kidscancode/gamedev | tutorials/tilemap/part 05/tilemap.py | Python | mit | 1,035 |
import pdb
import numpy as np
from xml.etree.ElementTree import Element
from xml.etree import ElementTree
class ProbeBox(Element):
def __init__(self, Name='port_ut1', Type='wv', Weight='1'):
"""
type: 0 for voltage probing => 'vp'
1 for current probing => 'cp'
2 for E-field probing... | pylayers/pylayers | pylayers/em/openems/probebox.py | Python | mit | 1,149 |
# -*- coding: utf-8 -*-
# vi:si:et:sw=4:sts=4:ts=4
##
## Copyright (C) 2012 Async Open Source <http://www.async.com.br>
## All rights reserved
##
## 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 Foundati... | andrebellafronte/stoq | stoqlib/gui/test/test_stocktransferwizard.py | Python | gpl-2.0 | 2,810 |
import random
class fortunes:
def on_pubmsg(self, nick, connection, event):
message = event.arguments()[0]
source = event.source().split('!')[0]
if message.startswith(".fortune"):
fortunestxt = open("modules/pubmsg/fortunes", 'r')
fortuneslist = fortunestxt.read().splitlines()
response = ran... | Oozemeister/Gypsy | modules/pubmsg/fortunes.py | Python | gpl-2.0 | 393 |
# -*- coding: utf-8 -*-
import threading
from celery import task
from django.conf import settings
from django.core.mail import get_connection
from django.core.mail import EmailMessage
from django.template import loader, Context, RequestContext
@task()
def blocking_mailto(template_name, subject, to_mail, context=Non... | ShaolongHu/Nitrate | tcms/core/utils/mailto.py | Python | gpl-2.0 | 2,265 |
from boxbranding import getImageVersion
from urllib import urlopen
import socket
import os
from enigma import eConsoleAppContainer, eDVBDB
from Screens.Screen import Screen
from Components.ActionMap import ActionMap
from Components.PluginComponent import plugins
from Components.PluginList import PluginList, PluginEnt... | mrnamingo/vix4-34-enigma2-bcm | lib/python/Screens/PluginBrowser.py | Python | gpl-2.0 | 17,217 |
# Opus/UrbanSim urban simulation software.
# Copyright (C) 2005-2009 University of Washington
# See opus_core/LICENSE
from PyQt4.QtCore import Qt, QVariant, SIGNAL, QModelIndex, QAbstractItemModel
from PyQt4.QtCore import QString
from PyQt4.QtGui import QColor, QIcon, QStyle, QMessageBox
from PyQt4.Qt import qApp # Fo... | christianurich/VIBe2UrbanSim | 3rdparty/opus/src/opus_gui/abstract_manager/models/xml_model.py | Python | gpl-2.0 | 21,520 |
import os
from io import BytesIO
from urllib import parse
from translate.convert import oo2po, po2oo, test_convert
from translate.storage import oo, po
from translate.storage.poheader import poheader
class TestOO2PO:
target_filetype = po.pofile
conversion_module = oo2po
conversion_class = oo2po.oo2po
... | translate/translate | translate/convert/test_oo2po.py | Python | gpl-2.0 | 13,354 |
IDLE_VERSION = "1.1.5"
| xbmc/atv2 | xbmc/lib/libPython/Python/Lib/idlelib/idlever.py | Python | gpl-2.0 | 23 |
import codewave_core.command as command
import codewave_core.cmds.core
class EditCmdProp(object):
def __init__(self, name,options):
self.name,options = name,options
defaults = {
'var' : None,
'opt' : None,
'funct' : None,
'dataName' : None,
'showEmpty' : False,
'carret' : False,
... | kevthunder/codewave-subl | codewave_core/edit_cmd_prop.py | Python | gpl-2.0 | 2,549 |
import os
import tuned.logs
from . import base
from tuned.utils.commands import commands
log = tuned.logs.get()
class cpulist_present(base.Function):
"""
Checks whether CPUs from list are present, returns list containing
only present CPUs
"""
def __init__(self):
# arbitrary number of arguments
super(cpulist_... | redhat-performance/tuned | tuned/profiles/functions/function_cpulist_present.py | Python | gpl-2.0 | 691 |
import abc
from custodian.custodian import ErrorHandler, Validator
#TODO: do we stick to custodian's ErrorHandler/Validator inheritance ??
class SRCErrorHandler(ErrorHandler):
HANDLER_PRIORITIES = {'PRIORITY_FIRST': 0,
'PRIORITY_VERY_HIGH': 1,
'PRIORITY_HIGH':... | davidwaroquiers/abiflows | abiflows/fireworks/utils/custodian_utils.py | Python | gpl-2.0 | 3,730 |
#!/usr/bin/env python
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Michael A.G. Aivazis
# California Institute of Technology
# (C) 1998-2005 All Rights Reserved
#
# <LicenseText>
#
# ~~~~~~~~~~~~~~~~~~~~~~~~... | bmi-forum/bmi-pyre | pythia-0.8/packages/mpi/mpi/LauncherMPICH.py | Python | gpl-2.0 | 2,569 |
# This file is part of Copernicus
# http://www.copernicus-computing.org/
#
# Copyright (C) 2011, Sander Pronk, Iman Pouya, Erik Lindahl, and others.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as published
# by the Free Soft... | gromacs/copernicus | cpc/command/platform.py | Python | gpl-2.0 | 11,772 |
# -*- coding: utf-8 -*-
#
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2014 Pierre Bélissent
#
# 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, o... | gramps-project/addons-source | DynamicWeb/run_dynamicweb.py | Python | gpl-2.0 | 7,642 |
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# bu... | CongLi/avocado-vt | setup.py | Python | gpl-2.0 | 3,742 |
str_no_string = 0
str_empty_string = 1
str_yes = 2
str_no = 3
str_blank_string = 4
str_error_string = 5
str_s0 = 6
str_blank_s1 = 7
str_reg1 = 8
str_s50_comma_s51 = 9
str_s50_and_s51 = 10
str_s52_comma_s51 = 11
str_s52_and_s51 = 12
str_msg_battle_won = 13
str_charge = 14
str_color = 15
str_hold_fire = 16
str_blunt_hold... | CatalansMB/War1714 | src/ID_strings.py | Python | gpl-2.0 | 30,810 |
from tensorflow.keras.applications.resnet50 import ResNet50
from tensorflow.keras.preprocessing import image
from tensorflow.keras.applications.resnet50 import preprocess_input, decode_predictions
import numpy as np
model = ResNet50(weights='imagenet')
img_path = 'elephant.jpg'
img = image.load_img(img_path, target_s... | lukas/ml-class | examples/keras-transfer/resnet50-inspect.py | Python | gpl-2.0 | 517 |
from .repository import *
from . import instance
| olysonek/tuned | tuned/plugins/__init__.py | Python | gpl-2.0 | 49 |
from __future__ import print_function
import numpy as np
# Chapter 2 Beginning with NumPy fundamentals
#
# Demonstrates the selection
# of ndarray elements.
#
# Run from the commandline with
#
# python elementselection.py
a = np.array([[1,2],[3,4]])
print("In: a")
print(a)
#Out:
#array([[1, 2],
# [3, 4]])
p... | moonbury/notebooks | github/Numpy/Chapter2/elementselection.py | Python | gpl-3.0 | 492 |
# -*- coding: utf-8 -*-
#
# django-ldapdb
# Copyright (c) 2009-2011, Bolloré telecom
# Copyright (c) 2013, Jeremy Lainé
# All rights reserved.
#
# See AUTHORS file for a full list of contributors.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the foll... | stosdev/nawia2014 | ldapdb/__init__.py | Python | gpl-3.0 | 2,247 |
# This file is generated by /tmp/buildd/python-numpy-1.8.2/setup.py
# It contains system_info results at the time of building this package.
__all__ = ["get_info","show"]
blas_info={'libraries': ['blas'], 'library_dirs': ['/usr/lib'], 'language': 'f77'}
lapack_info={'libraries': ['lapack'], 'library_dirs': ['/usr/lib']... | ruibarreira/linuxtrail | usr/lib/python2.7/dist-packages/numpy/distutils/__config__.py | Python | gpl-3.0 | 1,269 |
# (c) Copyright 2013, 2014, University of Manchester
#
# HydraPlatform is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Hydra... | UMWRG/HydraPlatform | HydraLib/python/HydraLib/config.py | Python | gpl-3.0 | 5,352 |
import os
from datetime import datetime
class HQ(object):
def __init__(self, fpath, kpath):
self.people_in_hq = 0
self.keys_in_hq = 0
self.joined_users = []
self.hq_status = 'unknown'
self.status_since = datetime.now().strftime('%Y-%m-%d %H:%M')
self.is_clean = True... | ccc-ffm/christian | modules/hq.py | Python | gpl-3.0 | 3,293 |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.23 on 2019-10-15 21:32
from __future__ import unicode_literals
import datetime
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('manager', '0035_auto_20191013_1705'),
]
operations = [
mig... | GNUtn/eventoL | eventol/manager/migrations/0036_auto_20191015_2132.py | Python | gpl-3.0 | 624 |
# Copyright 2011-2015 Lars Wirzenius
#
# 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 ... | tjanez/obnam | obnamlib/encryption.py | Python | gpl-3.0 | 7,881 |
# -*- coding: utf-8 -*-
from fontaine.namelist import codepointsInNamelist
class Charset:
common_name = u'Google Fonts: Greek Ancient Musical Symbols'
native_name = u''
abbreviation = 'GREK'
def glyphs(self):
glyphs = codepointsInNamelist("charsets/internals/google_glyphsets/Greek/GF-greek-anc... | davelab6/pyfontaine | fontaine/charsets/internals/google_greek_ancient_musical_symbols.py | Python | gpl-3.0 | 371 |
import socket
import time
import re
from util import hook
socket.setdefaulttimeout(10)
nick_re = re.compile(":(.+?)!")
# Auto-join on Invite (Configurable, defaults to True)
@hook.event('INVITE')
def invite(paraml, conn=None):
invite_join = conn.conf.get('invite_join', True)
if invite_join:
conn.jo... | blha303/ytbot | plugins/core_misc.py | Python | gpl-3.0 | 2,257 |
"""
class to test test_simple_function.py
follows the standards in https://docs.python.org/2/library/unittest.html
"""
import unittest
from LOTlib.Examples.SymbolicRegression.old.test_simple_function import *
class test_simple_functionTest(unittest.TestCase):
# initialization that happens before each test is car... | ebigelow/LOTlib | LOTlib/Testing/old/Examples/SymbolicRegression/old/test_simple_functionTest.py | Python | gpl-3.0 | 522 |
from . crontab import *
def test():
''' Oncely'''
assert convert_to_crontabs_time_str(timezone_parser({'month_of_year': 3, 'day_of_month': 1, 'day_of_week': "*", 'hour': 11, 'minute': 34, 'year': 2016})) == ['34 23 29 2 *']
''' Daily'''
assert convert_to_crontabs_time_str(timezone_parser({'year': "*"... | albertmenglongli/ToolsLibrary | crontab/crontab_test.py | Python | gpl-3.0 | 4,471 |
import sys
import xbmc,xbmcaddon
import sqlite3
from vpnapi import VPNAPI
ADDON = xbmcaddon.Addon(id='script.tvguide.fullscreen')
channel = sys.argv[1]
start = sys.argv[2]
path = xbmc.translatePath('special://profile/addon_data/script.tvguide.fullscreen/source.db')
try:
conn = sqlite3.connect(path, detect_types=... | bigoldboy/repository.bigoldboy | script.tvguide.fullscreen/play.py | Python | gpl-3.0 | 1,273 |
from os import walk
from os.path import basename, splitext, dirname, join, exists
from glob import glob
import importlib
from inspect import getmembers, isclass
import sverchok
from sverchok.utils.testing import *
from sverchok.utils.logging import debug, info, error
from sverchok.node_tree import SverchCustomTreeNod... | DolphinDream/sverchok | tests/ui_tests.py | Python | gpl-3.0 | 2,714 |
from flask.ext.wtf import Form
from wtforms import TextField, BooleanField, SelectField
from wtforms.validators import Required
class GetIdForm(Form):
identifier = TextField('identifier', validators = [Required()])
class SearchForm(Form):
text = TextField('text', validators = [Required()])
class SearchItemsF... | pombreda/https-gitorious.org-appstream-figment | figment/forms.py | Python | gpl-3.0 | 627 |
import unittest
import utils
import mock
class ArpTestCase(unittest.TestCase):
def setUp(self):
self.linux_data = ('IP address HW type Flags HW address Mask Device\n'
'192.168.0.94 0x1 0x2 aa:aa:aa:aa:aa:aa * br0\n'
... | kivarun/libvirt_metadata_api | test/test_arp.py | Python | gpl-3.0 | 2,723 |
"""Provide neighbour searches using OpenCl GPU-code."""
from pkg_resources import resource_filename
import numpy as np
from . import idtxl_exceptions as ex
try:
import pyopencl as cl
except ImportError as err:
ex.package_missing(err, 'PyOpenCl is not available on this system. Install'
... | pwollstadt/IDTxl | dev/search_GPU/neighbour_search_opencl_old.py | Python | gpl-3.0 | 12,468 |
"""
This module checks for the name of a supported game in the arguments to the api command, and
if found it reads the latest patch, printing it to the channel in which it was requested.
"""
import os.path
import typing
#I should probably find a way to utilize these
dota_synonymns=["dota", "Dota", "dota2", "Dota2"]
o... | ocket8888/slackbot | slackbot/modules/patch/patch.py | Python | gpl-3.0 | 1,502 |
[
{
"name": "syoukuloader",
"status": "0"
},
{
"name": "syoukuplayer",
"status": "0"
},
{
"name": "sku6",
"status": "0"
},
{
"name": "studou",
"status": "0"
},
{
"name": "sletv",
"status": "0"
},
... | kafan15536900/ADfree-Player-Offline | onServer/ruletool/oconfiglist.py | Python | gpl-3.0 | 562 |
import logging
from golem.resource.client import AsyncRequest, async_run
from twisted.internet.task import LoopingCall
log = logging.getLogger("golem")
class Service(object):
""" A prototype of Golem service -- an long running "thread" that performs
some tasks in background and responds to request from ... | Radagast-red/golem | golem/transactions/service.py | Python | gpl-3.0 | 1,673 |
import re
from billy.scrape.actions import Rule, BaseCategorizer
# These are regex patterns that map to action categories.
_categorizer_rules = (
Rule([u'Amendment #\\S+ \\((?P<legislator>.+?)\\) bundle YES adopted'],
[u'amendment:passed']),
Rule([u'(?i)Signed by (the )Governor(.*)'], [u'governor:sign... | showerst/openstates | openstates/ma/actions.py | Python | gpl-3.0 | 4,155 |
# -*- coding: utf-8 -*-
class Charset(object):
common_name = 'NotoSansOldItalic-Regular'
native_name = ''
def glyphs(self):
chars = []
chars.append(0x0000) #uniFEFF ????
chars.append(0x0020) #uni00A0 SPACE
chars.append(0x00A0) #uni00A0 NO-BREAK SPACE
chars.appen... | davelab6/pyfontaine | fontaine/charsets/noto_chars/notosansolditalic_regular.py | Python | gpl-3.0 | 2,939 |
# -*- coding: UTF-8 -*-
"""
Lastship Add-on (C) 2019
Credits to Lastship, Placenta and Covenant; our thanks go to their creators
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, e... | lastship/plugin.video.lastship | resources/lib/sources/de/moviedream.py | Python | gpl-3.0 | 5,572 |
import os
# generate an ABSOLUTE PATH to my-file.txt
f = os.getcwd() + '/my-file.txt'
for line in open(f):
print line,
| mgood7123/UPM | Tests/PACKAGES/CDE/tests/pwd_readfile_test/pwd_readfile_test.py | Python | gpl-3.0 | 124 |
from couchpotato.core.event import addEvent
from couchpotato.core.logger import CPLog
from couchpotato.core.notifications.base import Notification
import os
import subprocess
log = CPLog(__name__)
class Synoindex(Notification):
index_path = '/usr/syno/bin/synoindex'
def __init__(self):
super(Synoin... | coolbombom/CouchPotatoServer | couchpotato/core/notifications/synoindex/main.py | Python | gpl-3.0 | 1,093 |
"""Test the despiking algorithms implimented in EQcorrscan."""
import unittest
import os
import numpy as np
from obspy import Trace, read
from eqcorrscan.utils.despike import median_filter, template_remove
class DespikeTesting(unittest.TestCase):
@classmethod
def setUpClass(cls):
cls.testing_path =... | calum-chamberlain/EQcorrscan | eqcorrscan/tests/despike_test.py | Python | gpl-3.0 | 1,501 |
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
# Copyright (c) 2017 Mozilla Corporation
from positive_alert_test_case import PositiveAlertTestCase
from negative_alert_... | Phrozyn/MozDef | tests/alerts/test_nsm_scan_address.py | Python | mpl-2.0 | 4,726 |
DOWNLOAD = '0'
PRIVACY = '1'
OPPORTUNITY = '2'
ACCESSIBILITY = '3'
FREEDOM = '4'
EDUCATION = '5'
CONTROL = '6'
types_map = {
PRIVACY: 'privacy',
OPPORTUNITY: 'opportunity',
ACCESSIBILITY: 'access',
FREEDOM: 'freedom',
EDUCATION: 'learning',
CONTROL: 'control',
}
name_to_id = {v: k for k, v in... | mozilla/mrburns | smithers/smithers/data_types.py | Python | mpl-2.0 | 340 |
# -*- coding: utf-8 -*-
# vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Copyright (C) 2014-2016 GEM Foundation
#
# OpenQuake 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 Licen... | rcgee/oq-hazardlib | openquake/hazardlib/gsim/boore_atkinson_2011.py | Python | agpl-3.0 | 3,604 |
from django import template
import warnings
register = template.Library()
class WarningNode(template.Node):
def render(self, context):
return ''
@register.tag
def warn(parser, token):
"""
A template tag that lets you insert a warning
"""
bits = token.split_contents()
if not len(bit... | khchine5/opal | opal/templatetags/template_warnings.py | Python | agpl-3.0 | 488 |
from juju.charm.errors import CharmURLError
from juju.charm.url import CharmCollection, CharmURL
from juju.lib.testing import TestCase
class CharmCollectionTest(TestCase):
def test_str(self):
self.assertEquals(
str(CharmCollection("foo", "bar", "baz")), "foo:~bar/baz")
self.assertEqua... | anbangr/trusted-juju | juju/charm/tests/test_url.py | Python | agpl-3.0 | 5,620 |
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... | grap/OpenUpgrade | addons/stock/stock.py | Python | agpl-3.0 | 273,917 |
#!/usr/bin/env python
# -*- coding: utf8 -*-
# *****************************************************************
# ** PTS -- Python Toolkit for working with SKIRT **
# ** © Astronomical Observatory, Ghent University **
# *****************************************************************
##... | SKIRT/PTS | core/prep/sphconvert.py | Python | agpl-3.0 | 6,914 |
import logging
import sys
import signal
import click
from contextlib import contextmanager
from datetime import datetime
from flask import current_app
from udata.commands import cli, IS_TTY
from udata.search import es, adapter_catalog
from elasticsearch.helpers import reindex as es_reindex, streaming_bulk
log = ... | opendatateam/udata | udata/search/commands.py | Python | agpl-3.0 | 8,039 |
##############################################################################
# Copyright (c) 2013-2018, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-64... | krafczyk/spack | var/spack/repos/builtin/packages/bwtool/package.py | Python | lgpl-2.1 | 1,568 |
#!/usr/bin/env python2.6
import cgi
import time
import os
import subprocess
"""
problem: cgi scripts run as user 'nobody'
how can we handle signaling the daemon ?
"""
form = cgi.FieldStorage()
print "Content-Type: text/html" # HTML is following
print
print "<TITLE>CGI script output</TITLE>"
print "Hey... | danduggan/hltd | cgi/harakiri_cgi.py | Python | lgpl-3.0 | 593 |
#! /usr/bin/env python
sources = """
eNrsvWuXG0eWICavH+PFzu7MrL27fu06G2UamSIqRVI9M24cgj0URWq4I1E8FNXNOdU1YBaQVZVN
AAlmJlhVrVEf/xT/E/+M/eb/4E/+6vuKdyQAUlL3ro/7zIioyHjcuHHjxo0b9/G//5Pv336Uvvrz
jz76aLa56cq2yzdF25Vn1frtf/bqfx589NFwOEza7dmq6pLzolpumzKpmwRrJm3ZtlW9Tqr1ed2s
ig5/d3VSJKoLqNG8q+ZlnkAvg2q1qZsu2dyMk/amHQzmy6Jtk22... | pombredanne/pycbor | runtests.py | Python | lgpl-3.0 | 205,001 |
# Spawn Area file created with PSWG Planetary Spawn Tool
import sys
from java.util import Vector
def addSpawnArea(core):
mixedGroups = Vector()
mixedGroups.add('quenker_lair_group_1')
mixedGroups.add('huurton_lair_group_1')
mixedGroups.add('dantooine_quenker')
core.spawnService.addMixedSpawnArea(mixedGroups, 1495... | ProjectSWGCore/NGECore2 | scripts/mobiles/spawnareas/dantooine_south_mixed_3.py | Python | lgpl-3.0 | 356 |
import importlib
from .base import BaseTransport
from ..service import Service
class LocalTransport(BaseTransport):
def __init__(self):
super(LocalTransport, self).__init__()
self.__service = None
def __repr__(self):
return self.__class__.__name__
def configure(self, service_na... | brianz/servant | servant/transport/local.py | Python | lgpl-3.0 | 2,255 |
# This file is part of PyEMMA.
#
# Copyright (c) 2015, 2014 Computational Molecular Biology Group, Freie Universitaet Berlin (GER)
#
# PyEMMA is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, either vers... | markovmodel/PyEMMA | pyemma/coordinates/tests/test_pipeline.py | Python | lgpl-3.0 | 7,347 |
import sys
from services.spawn import MobileTemplate
from services.spawn import WeaponTemplate
from resources.datatables import WeaponType
from resources.datatables import Difficulty
from resources.datatables import Options
from java.util import Vector
def addTemplate(core):
mobileTemplate = MobileTemplate()
mobi... | agry/NGECore2 | scripts/mobiles/tatooine/tusken_king.py | Python | lgpl-3.0 | 1,337 |
# Copyright Iris contributors
#
# This file is part of Iris and is released under the LGPL license.
# See COPYING and COPYING.LESSER in the root of the repository for full
# licensing details.
"""Unit tests for the :func:`iris.analysis.maths.divide` function."""
# Import iris.tests first so that some things can be ini... | pp-mo/iris | lib/iris/tests/unit/analysis/maths/test_divide.py | Python | lgpl-3.0 | 2,496 |
#!/usr/bin/env python
"""
a simple script can run and test your html rendering classes.
Uncomment the steps as you add to your rendering.
"""
from io import StringIO
# importing the html_rendering code with a short name for easy typing.
import html_render as hr
# reloading in case you are running this in iPython
#... | weidnem/IntroPython2016 | Solutions/Session07/class_html_render/run_html_render.py | Python | unlicense | 5,392 |
import gc
import pandas as pd
import numpy as np
import os
import arboretum
import json
import sklearn.metrics
from sklearn.metrics import f1_score, roc_auc_score
from sklearn.model_selection import train_test_split
from scipy.sparse import dok_matrix, coo_matrix
from sklearn.utils.multiclass import type_of_target
i... | bataeves/kaggle | instacart/imba/arboretum_submition.py | Python | unlicense | 15,544 |
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
"""Client and server classes corresponding to protobuf-defined services."""
import grpc
import match_pb2 as match__pb2
class MatchServiceStub(object):
"""MatchService is a Google managed service for efficient vector similarity
search at sc... | GoogleCloudPlatform/analytics-componentized-patterns | retail/recommendation-system/bqml-scann/ann_grpc/match_pb2_grpc.py | Python | apache-2.0 | 4,364 |
#!/usr/bin/env python
# encoding: utf-8
"""
Utility script to generate/modify Firebreath plug-in projects.
Original Author(s): Ben Loveridge, Richard Bateman
Created: 14 December 2009
License: Dual license model; choose one of two:
New BSD License
http://www.opensource.org/licenses/bsd-li... | eSDK/esdk_uc_control_js | open_src/firebreath/fbgen.py | Python | apache-2.0 | 7,056 |
import functools
import json
import logging
import traceback
from flask import g, redirect, Response, flash, abort
from flask_babel import gettext as __
from flask_appbuilder import BaseView
from flask_appbuilder import ModelView
from flask_appbuilder.widgets import ListWidget
from flask_appbuilder.actions import act... | BRD-CD/superset | superset/views/base.py | Python | apache-2.0 | 11,040 |
#!/usr/bin/env python
# flake8: noqa
# yapf: disable
# __tutorial_imports_begin__
import argparse
import os
import numpy as np
import torch
import torch.optim as optim
from torchvision import datasets
from ray.tune.examples.mnist_pytorch import train, test, ConvNet,\
get_data_loaders
import ray
from ray import t... | richardliaw/ray | python/ray/tune/examples/pbt_convnet_example.py | Python | apache-2.0 | 4,748 |
import time
import sys
import csv
import re
import argparse
import urllib
import os.path
import fileinput
import subprocess
import socket
import os
import itertools
from collections import defaultdict
from pprint import pprint
from termcolor import colored
from subprocess import call
sid = ""
metasploitPath = ""
#meta... | morgoroth/pentest-scripts | scanners/oracle_pillage/ora_priv.py | Python | apache-2.0 | 9,996 |
"""Config flow for TP-Link."""
from __future__ import annotations
from typing import Any
from kasa import SmartDevice, SmartDeviceException
from kasa.discover import Discover
import voluptuous as vol
from homeassistant import config_entries
from homeassistant.components import dhcp
from homeassistant.const import CO... | home-assistant/home-assistant | homeassistant/components/tplink/config_flow.py | Python | apache-2.0 | 5,772 |
"""Test the roon config flow."""
from homeassistant import config_entries, setup
from homeassistant.components.roon.const import DOMAIN
from homeassistant.const import CONF_HOST
from tests.async_mock import patch
from tests.common import MockConfigEntry
class RoonApiMock:
"""Mock to handle returning tokens for t... | GenericStudent/home-assistant | tests/components/roon/test_config_flow.py | Python | apache-2.0 | 5,782 |
# Copyright 2015 Hitachi Data Systems inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless... | jcsp/manila | manila/tests/share/test_migration.py | Python | apache-2.0 | 19,945 |
#!/usr/bin/env python3
"""
Analyze a evergreen task log page
"""
import argparse
import json
import os
import sys
if __name__ == "__main__" and __package__ is None:
sys.path.append(os.path.dirname(os.path.abspath(os.path.realpath(__file__))))
print(sys.path)
import faultinfo
else:
from . import faultin... | markbenvenuto/buildbaron | analyzer/evg_log_file_analyzer.py | Python | apache-2.0 | 3,551 |
# Copyright 2011 OpenStack Foundation.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless req... | dims/oslo.context | tests/test_context.py | Python | apache-2.0 | 2,079 |
"""Axis switch platform tests."""
from unittest.mock import Mock, call as mock_call
from homeassistant.components import axis
import homeassistant.components.switch as switch
from homeassistant.setup import async_setup_component
from .test_device import NAME, setup_axis_integration
EVENTS = [
{
"operati... | postlund/home-assistant | tests/components/axis/test_switch.py | Python | apache-2.0 | 2,374 |
from __future__ import unicode_literals
from collections import defaultdict
import datetime
import json
from moto.compat import OrderedDict
from moto.core import BaseBackend
from moto.core.utils import unix_time
from .comparisons import get_comparison_func
class DynamoJsonEncoder(json.JSONEncoder):
def default(s... | silveregg/moto | moto/dynamodb/models.py | Python | apache-2.0 | 9,875 |
"""Helper to help store data."""
from __future__ import annotations
import asyncio
from collections.abc import Callable
from contextlib import suppress
from json import JSONEncoder
import logging
import os
from typing import Any
from homeassistant.const import EVENT_HOMEASSISTANT_FINAL_WRITE
from homeassistant.core i... | aronsky/home-assistant | homeassistant/helpers/storage.py | Python | apache-2.0 | 8,433 |
"""Creates ACME accounts for server."""
import datetime
import hashlib
import logging
import os
import socket
from cryptography.hazmat.primitives import serialization
import pyrfc3339
import pytz
import zope.component
from acme import fields as acme_fields
from acme import jose
from acme import messages
from letsenc... | mitnk/letsencrypt | letsencrypt/account.py | Python | apache-2.0 | 7,359 |
# -*- coding: utf-8 -*-
# Copyright 2020 Google 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... | googleads/google-ads-python | google/ads/googleads/v9/services/services/product_bidding_category_constant_service/transports/__init__.py | Python | apache-2.0 | 1,165 |
# Copyright 2018 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | mlperf/training_results_v0.7 | Google/benchmarks/resnet/implementations/resnet-cloud-TF2.0-tpu-v3-32/resnet_imagenet_main.py | Python | apache-2.0 | 12,959 |
# Copyright 2015 Hewlett-Packard
#
# 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, ... | hpcloud-mon/monasca-events-api | monasca_events_api/v2/common/schemas/stream_definition_request_body_schema.py | Python | apache-2.0 | 1,965 |
# Copyright 2016 Pinterest, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writi... | yongwen/teletraan | deploy-board/deploy_board/webapp/helpers/tags_helper.py | Python | apache-2.0 | 1,031 |
__author__ = 'Dmitriy Korsakov'
__doc__ = 'Manage global variables for farm roles'
from scalrctl import commands
class UpdateFarmRoleGlobalVariable(commands.Action):
prompt_for = ["roleId", "globalVariableName"]
class DeleteFarmRoleGlobalVariable(commands.Action):
delete_target = 'globalVariableName' | Scalr/scalr-ctl | scalrctl/commands/farm_role_gv.py | Python | apache-2.0 | 314 |
import flask_testing
from flask import current_app
from flask import Response
from rdflib import URIRef
from typing import Optional, Dict
from depot.manager import DepotManager
class TestCase(flask_testing.TestCase):
def login_new_user(self, *, email: str = "user@example.com", password: str = "password", usernam... | tetherless-world/satoru | whyis/test/test_case.py | Python | apache-2.0 | 3,045 |
# coding=utf-8
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
import os
import re
... | megaserg/pants | src/python/pants/backend/jvm/tasks/jvm_compile/zinc/zinc_compile.py | Python | apache-2.0 | 15,198 |
# Copyright 2015, Ansible, Inc.
# Luke Sneeringer <lsneeringer@ansible.com>
#
# 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 requi... | AlanCoding/tower-cli | tests/test_cli_action.py | Python | apache-2.0 | 2,582 |
import sys
from fileutil import *
import json
from wabbit_wappa import *
from subprocess import call
import numpy as np
import random
from socket import *
import threading, Queue, subprocess
import time
import psutil
import pandas as pd
from seldon.pipeline.pandas_pipelines import BasePandasEstimator
from sklearn.util... | SeldonIO/seldon-server | python/seldon/vw.py | Python | apache-2.0 | 12,228 |
# -*- coding: utf-8 -*-
#
# Copyright 2008 Lin-Chieh Shangkuan & Liang-Heng Chen
#
# 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 ... | tomaash/gaeo | gaeo/controller/helper.py | Python | apache-2.0 | 792 |
# 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... | renesugar/arrow | dev/archery/archery/benchmark/compare.py | Python | apache-2.0 | 3,878 |
"""These are bad """
# pylint: disable=missing-docstring
# pylint: disable=too-few-public-methods
import unittest
# This is bad
class TestCase(unittest.TestCase):
def test_one(self):
pass
class DerivedTestCase(TestCase):
def test_two(self):
pass
# This is bad, but the author seems to know ... | Sveder/edx-lint | test/input/func_layered_tests.py | Python | apache-2.0 | 1,314 |
"""The test for zha device automation actions."""
from unittest.mock import patch
import pytest
import zigpy.profiles.zha
import zigpy.zcl.clusters.general as general
import zigpy.zcl.clusters.security as security
import zigpy.zcl.foundation as zcl_f
import homeassistant.components.automation as automation
from homea... | tboyce1/home-assistant | tests/components/zha/test_device_action.py | Python | apache-2.0 | 3,876 |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 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.apach... | eltonkevani/tempest_el_env | tempest/api/compute/volumes/test_volumes_list.py | Python | apache-2.0 | 4,824 |
# -*- coding: utf-8 -*-
"""
Copyright 2015 Basho Technologies, Inc.
This file is provided to you 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 require... | bmess/riak-python-client | riak/tests/test_search.py | Python | apache-2.0 | 7,512 |
# Copyright 2015 Google 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 in writing, s... | jonparrott/gcloud-python | bigquery/google/cloud/bigquery/table.py | Python | apache-2.0 | 48,513 |
# Copyright 2017 Battelle Energy Alliance, 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 t... | idaholab/raven | framework/SupervisedLearning/ScikitLearn/LinearModel/LassoLarsCV.py | Python | apache-2.0 | 6,473 |
# Copyright DataStax, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, softwa... | mambocab/python-driver | tests/unit/cython/test_types.py | Python | apache-2.0 | 1,042 |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2003-2009 Edgewall Software
# Copyright (C) 2003-2005 Daniel Lundin <daniel@edgewall.com>
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
# are also available at http... | apache/bloodhound | trac/trac/db_default.py | Python | apache-2.0 | 14,109 |
#!/usr/bin/env python
"""Unit tests run as PYTHONPATH=../../.. python3 ./test_valve_dot1x.py."""
# Copyright (C) 2015 Research and Innovation Advanced Network New Zealand Ltd.
# Copyright (C) 2015--2019 The Contributors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file ex... | trungdtbk/faucet | tests/unit/faucet/test_valve_dot1x.py | Python | apache-2.0 | 4,824 |