code
stringlengths
3
1.05M
repo_name
stringlengths
5
104
path
stringlengths
4
251
language
stringclasses
1 value
license
stringclasses
15 values
size
int64
3
1.05M
#/usr/bin/env python import os from setuptools import setup, find_packages ROOT_DIR = os.path.dirname(__file__) SOURCE_DIR = os.path.join(ROOT_DIR) # Dynamically calculate the version based on photologue.VERSION version_tuple = __import__('photologue').VERSION if len(version_tuple) == 3: version = "%d.%d.%s" % ve...
unomena/django-photologue
setup.py
Python
bsd-3-clause
1,459
import os from astropy import units as u from tardis import io import numpy.testing as npt import pytest import numpy as np test_data_directory = os.path.dirname(__file__) def data_path(filename): data_dir = os.path.dirname(__file__) return os.path.join(data_dir, 'data', filename) def test_simple_ascii_...
utkbansal/tardis
tardis/io/tests/test_ascii_readers.py
Python
bsd-3-clause
2,365
from dfplayer import Player from utime import sleep_ms from machine import Pin class ScanPlayer(Player): def __init__(self, folders=10, scan=True, *a, **k ): if 'busy_pin' not in k: k['busy_pin'] = Pin(0) # configure D3/GPIO0 as default busy pin super().__init__(*a, **k) if fol...
ShrimpingIt/cockle
modules/scanplayer.py
Python
agpl-3.0
2,538
# encoding: utf-8 # module PyQt4.QtCore # from /usr/lib/python3/dist-packages/PyQt4/QtCore.cpython-34m-x86_64-linux-gnu.so # by generator 1.135 # no doc # imports import sip as __sip class QTextBoundaryFinder(): # skipped bases: <class 'sip.simplewrapper'> """ QTextBoundaryFinder() QTextBoundaryFinder(QT...
ProfessorX/Config
.PyCharm30/system/python_stubs/-1247971765/PyQt4/QtCore/QTextBoundaryFinder.py
Python
gpl-2.0
2,621
#!/usr/bin/python import sys, os, urllib, mimetypes from siCore import * import guanaco.webdav import multiprocessing def run(arg): session, args, kargs = arg[0] res = session.run(args, kargs, inter = False) #return session.run(arg, kargs, inter = False) if arg[1]['do'] else arg[1]['default'] if arg[1].get('do', ...
guanacoTeam/saveit
siSession.py
Python
gpl-2.0
7,171
from llvmlite.ir import _utils from llvmlite.ir import types class Context(object): def __init__(self): self.scope = _utils.NameScope() self.identified_types = {} def get_identified_type(self, name): if name not in self.identified_types: self.scope.register(name) ...
numba/llvmlite
llvmlite/ir/context.py
Python
bsd-2-clause
518
# -*- coding: iso-8859-1 -*- # ----------------------------------------------------------------------------- # system.py - System control # ----------------------------------------------------------------------------- # $Id$ # # ----------------------------------------------------------------------------- # Freevo - A ...
pacificIT/freevo2
src/core/system.py
Python
gpl-2.0
11,736
import socket import os from time import strftime myIP=socket.gethostbyname(socket.gethostname()) time=strftime("updated at %Y-%m-%d %H:%M:%S") f=open('myIP.txt','w') f.write(myIP+'\n') f.write(time+'\n') f.close()
cgao/IP
ip.py
Python
mit
228
#!/usr/bin/python # # Copyright (c) 2016, The OpenThread Authors. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # 1. Redistributions of source code must retain the above copyright # not...
Zolertia/openthread
tests/scripts/thread-cert/network_data.py
Python
bsd-3-clause
13,896
#!/usr/bin/env python3 import unittest import logging from tests.test_source import SourceTestCase from dipper.sources.HGNC import HGNC logging.basicConfig(level=logging.WARNING) logger = logging.getLogger(__name__) class HGNCTestCase(SourceTestCase): def setUp(self): self.source = HGNC('rdf_graph', Tr...
TomConlin/dipper
tests/test_hgnc.py
Python
bsd-3-clause
580
# Copyright 2016-2017 University of Pittsburgh # 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 agr...
dbmi-pitt/dbmi-annotator
translation/mp-evidence-base-ETL/deprecated/loadAnnotatorAnnsToRDB.py
Python
apache-2.0
21,241
# coding: utf-8 # Copyright (c) Pymatgen Development Team. # Distributed under the terms of the MIT License. from __future__ import division, unicode_literals """ This module implements input and output processing from PWSCF. """ __author__ = "Shyue Ping Ong" __copyright__ = "Copyright 2012, The Materials Virtual La...
migueldiascosta/pymatgen
pymatgen/io/pwscf.py
Python
mit
7,402
from unittest import TestCase from pygom import Transition, TransitionType, SimulateOde, ODEVariable class TestParameterActions(TestCase): def test_adding_parameters(self): ''' Test adding parameters to a model ''' expected_result =[ODEVariable('beta', 'beta', None, True...
PublicHealthEngland/pygom
tests/test_adding_to_parameterlist.py
Python
gpl-2.0
1,579
#!/usr/bin/python """ Single entry point for test bed CLI. """ import os import sys import logging def parse(): """ main entry point. """ from testbed.core import commands arg_parser = commands.main() args = arg_parser.parse_args() return commands.args_process(args) def env_setup(): """ Mai...
markleehamilton/testbed
bin/tbd.py
Python
gpl-3.0
1,242
from __future__ import absolute_import import six from base64 import b64encode from django.core.urlresolvers import reverse from sentry.models import UserAvatar from sentry.testutils import APITestCase class UserAvatarTest(APITestCase): def test_get(self): user = self.create_user(email='a@example.com')...
JackDanger/sentry
tests/sentry/api/endpoints/test_user_avatar.py
Python
bsd-3-clause
2,972
# -*- coding: utf-8 -*- """ pygments.lexers.actionscript ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lexers for ActionScript and MXML. :copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ import re from pygments.lexer import RegexLexer, bygroups, using,...
prashanthr/wakatime
wakatime/packages/pygments_py3/pygments/lexers/actionscript.py
Python
bsd-3-clause
11,179
# -*- coding: utf-8 -*- # # Copyright (c) 2011: # Christian Forfang, <cforgang@gmail.com> # # 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 opt...
vegarwe/luma
luma/test/LumaLogHandlerTest.py
Python
gpl-2.0
1,885
# # NEPI, a framework to manage network experiments # Copyright (C) 2014 INRIA # # 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 ...
phiros/nepi
src/nepi/resources/linux/ns3/ccn/ns3ccnpokedceapplication.py
Python
gpl-3.0
2,310
# -*- coding: utf-8 -*- # Generated by Django 1.9.13 on 2019-02-07 14:17 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('councilmatic_core', '0043_membership_extras'), ] operations = [ migrations....
datamade/django-councilmatic
councilmatic_core/migrations/0044_bill_restrict_view.py
Python
mit
466
# -*- coding: utf-8 -*- """View model for clustered data.""" #------------------------------------------------------------------------------ # Imports #------------------------------------------------------------------------------ import os.path as op import numpy as np from six import string_types from ...io.kwik...
nsteinme/phy
phy/cluster/manual/view_models.py
Python
bsd-3-clause
37,793
# -*- coding: utf-8 -*- """Tests for the xml module.""" from __future__ import unicode_literals from soco import xml def test_register_namespace(): assert xml.register_namespace def test_ns_tag(): """Test the ns_tag function.""" namespaces = ['http://purl.org/dc/elements/1.1/', 'urn...
dundeemt/SoCo
tests/test_xml.py
Python
mit
623
# 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-redis/azure/mgmt/redis/models/operation_paged.py
Python
mit
923
import OOMP newPart = OOMP.oompItem(9370) newPart.addTag("oompType", "RESE") newPart.addTag("oompSize", "0603") newPart.addTag("oompColor", "X") newPart.addTag("oompDesc", "O432") newPart.addTag("oompIndex", "67") OOMP.parts.append(newPart)
oomlout/oomlout-OOMP
old/OOMPpart_RESE_0603_X_O432_67.py
Python
cc0-1.0
243
#!/usr/bin/env python # # Copyright (c) 2013 by Cisco Systems, Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # 1. Redistributions of source code must retain the above copyright notice, th...
libpcp/pcp
scapy/scapy_pcp.py
Python
bsd-2-clause
12,603
from django.shortcuts import render from user.decorators import user_view from repository.decorators import repository_view @user_view @repository_view def repository(request, user, repository, **kwargs): return render(request, 'app.html')
gitmill/gitmill
django/repository/views.py
Python
mit
245
import numpy as np from functools import wraps import random """ 큐브 게임을 위한 핵식 클래스 모음 """ class face : """ 큐브의 면을 표현 하는 객체 큐브의 색(숫자)을 바꿔준다. """ def __init__( self, n ) : """ n*n 크기의 면의 만든다 :param n: :return: """ dtype = np.uint8 self.size = ...
python-study-ko/twistyRL
twistyRL/core.py
Python
mit
12,834
# 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 version 3 ...
Maximilian-Reuter/SickRage-1
sickbeard/show_queue.py
Python
gpl-3.0
29,527
from pyAnimalTrack.backend.filters.base_filter import BaseFilter import numpy as np class HPF(BaseFilter): """ Class for Low Pass Filter algorithm """ def __init__(self, signal): """ Constructor :param data: Initial input data :returns: void """ sup...
davemccormick/pyAnimalTrack
src/pyAnimalTrack/backend/filters/high_pass_filter.py
Python
gpl-3.0
1,040
class Solution(object): def calculateMinimumHP(self, dungeon): """ :type dungeon: List[List[int]] :rtype: int """ m = len(dungeon); n = len(dungeon[0]) hp = [[sys.maxsize]*(n+1) for i in xrange(m+1)] hp[m][n-1] = hp[m-1][n] = 1 for i in xrange(m-1, -1,...
zqfan/leetcode
algorithms/174. Dungeon Game/solution.py
Python
gpl-3.0
530
import math import unittest import warnings from igraph import Graph, InternalError, IN, OUT, ALL, TREE_IN from math import inf, isnan class SimplePropertiesTests(unittest.TestCase): gfull = Graph.Full(10) gempty = Graph(10) g = Graph(4, [(0, 1), (0, 2), (1, 2), (0, 3), (1, 3)]) gdir = Graph( ...
igraph/python-igraph
tests/test_structural.py
Python
gpl-2.0
35,916
from UpdatedImageProcessing import * import sys from os import walk import numpy as np import json import timeit class ClassifierTester(object): """ Provides convenience functions to extended classes. """ def str_is_int(self, s): """ Borrowed from: https://stackoverflow.com/a/1267145 """ try: int...
FlintHill/SUAS-Competition
tests/non_nose_tests/test_imgproc_color_classifier.py
Python
mit
4,175
import requests import getpass import time # Print notice print("\n\n### NOTICE ###") print("Do not remove this notice.") print("This code is property of Joshua Whitcombe (2017) with permission for attributed code reuse.") print("Contact joshua@whitcombe.me for inquiries.") print("Source available at https://github.co...
jbwhitcombe/AutoEnroll
enroll.py
Python
apache-2.0
3,225
"""Test for Errata related Upgrade Scenario's :Requirement: Upgraded Satellite :CaseAutomation: Automated :CaseLevel: Acceptance :CaseComponent: API :TestType: Functional :CaseImportance: Critical :Upstream: No """ from fabric.api import execute from nailgun import entities from robottelo.api.utils import call_e...
omaciel/robottelo
tests/upgrades/test_errata.py
Python
gpl-3.0
24,334
################################################ #Lords and Ladies # #v0.0.c1 # #Authored by jc6036 # #Python 3.2 with the random module # ################################################ from random import randra...
scubadave/LordsAndLadies
main.py
Python
gpl-2.0
28,196
""" Sampling This step performs downsampling on the training instances to compensate for the heavily skewed distribution: "None", i.e. "no aligment", is by far the majority class. """ # TODO: # - quick & dirty sampling is inaccurate (can make errors of 5% or more) # - sampling is now on Timbl instance files, but shou...
emsrc/daeso-dutch
lib/daeso_nl/ga/exp/sample.py
Python
gpl-3.0
2,301
#!/usr/bin/env python3 # encoding: utf-8 import vim from . import config from .utils import normal, cursor_preserving class Fold(object): """ Object representing a fold in the current buffer. """ def __init__(self, start, *, end=None, length=None, buffer=None): """ Create a new Fold...
obreitwi/vim-sort-folds
python3/sort_folds/fold.py
Python
mit
4,182
"""Support for interacting with and controlling the cmus music player.""" import logging from pycmus import exceptions, remote import voluptuous as vol from homeassistant.components.media_player import PLATFORM_SCHEMA, MediaPlayerEntity from homeassistant.components.media_player.const import ( MEDIA_TYPE_MUSIC, ...
kennedyshead/home-assistant
homeassistant/components/cmus/media_player.py
Python
apache-2.0
7,619
from .base import BaseTestCase from django.template.response import TemplateResponse from sudo.settings import REDIRECT_FIELD_NAME, REDIRECT_URL from sudo.views import ( sudo, redirect_to_sudo, ) from sudo.forms import SudoForm class SudoViewTestCase(BaseTestCase): def test_enforces_logged_in(self): ...
edx/django-sudo
tests/views.py
Python
bsd-3-clause
4,087
# -*- coding: utf-8 -*- ############################################################################### # # UpdateUser # Updates information for an existing user. # # Python versions 2.6, 2.7, 3.x # # Copyright 2014, Temboo Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this...
jordanemedlock/psychtruths
temboo/core/Library/Parse/Users/UpdateUser.py
Python
apache-2.0
3,977
#coding=utf-8 def generatList(n): llist=[] for i in range(n): t=1 if i%3==1: t=2*(i/3+1) llist.append(t) return llist[::-1] def generatitem(n): fz=0 fm=1 llist=generatList(n) for i in llist: temp=fm fm=fz+i*fm fz=temp return (fz+2*fm,fm) fz=[int(x) for x in list(str(generatitem(99)[0]))] print ...
zhouxiumin/projecteuler
python/euler65.py
Python
apache-2.0
329
#! /usr/bin/env python3 # -*- coding:utf-8 -*- from char2vec import Char2Vec from char_dict import CharDict, end_of_sentence, start_of_sentence from data_utils import batch_train_data from paths import save_dir from pron_dict import PronDict from random import random from singleton import Singleton from utils import C...
DevinZ1993/Chinese-Poetry-Generation
generate.py
Python
mit
13,949
# spiv wants this import fcntl, signal class DNotify_Handler: def __init__(self): self.watchers = {} self.installed = 0 def install(self): if self.installed: return signal.signal(signal.SIGIO, self.fire) self.installed = 1 def uninstall(self): i...
gward/buildbot
buildbot/dnotify.py
Python
gpl-2.0
3,447
# -*- coding: utf-8 -*- """ <DefineSource> @Date : Fri Nov 14 13:20:38 2014 \n @Author : Erwan Ledoux \n\n </DefineSource> Catcher instances """ #<DefineAugmentation> import ShareYourSystem as SYS BaseModuleStr="ShareYourSystem.Applyiers.Producer" DecorationModuleStr="ShareYourSystem.Standards.Classors.Classer" S...
Ledoux/ShareYourSystem
Pythonlogy/draft/Noders/Catcher/Drafts/__init__ copy.py
Python
mit
4,693
from datetime import datetime, timedelta def get_total_seconds(td): if hasattr(timedelta, 'total_seconds'): return td.total_seconds() else: return int( (td.microseconds + (td.seconds + td.days * 24 * 3600) * 10 ** 6) / 10 ** 6) class Spy(object): def __init__(self): ...
moira-alert/worker
moira/metrics/spy.py
Python
gpl-3.0
1,525
#!/usr/bin/env python """ Custom freq hopping example - Hops 10 MHz at a time in a custom pattern back and forth increasing the signal amplitude on each loop """ from gnuradio import gr from gnuradio import analog from gnuradio import uhd from time import sleep from optparse import OptionParser import sys from gnuradi...
edwatt/REU2014
custom_freq_hop.py
Python
gpl-3.0
3,826
""" * --------------------- * | | | Coding Game Server | | | * --------------------- * Authors: T. Hilaire Licence: GPL File: Laby.py Contains the class Tile and Laby -> defines the Labyrinth (its rules, moves, etc.) Copyright 2021 T. Hilaire """ from dataclasses im...
thilaire/CodingGameServer
games/LabyrinthClassic/server/Laby.py
Python
gpl-3.0
6,749
#!/usr/bin/env python import webapp2 import logging from google.appengine.ext.webapp.mail_handlers import InboundMailHandler from google.appengine.ext import ndb from MailMessage import MailMessage # the email domain of this app is @pomis-newsletterman.appspotmail.com class EmailHandlerV1(InboundMailHandler): ...
Dudy/newsletterman
src/EmailHandlerV1.py
Python
apache-2.0
1,058
#!/usr/bin/env python def null_decorator(func): return func null_decorator(print)('Hello decorator!') def greet(): return 'Hello!' print(null_decorator(greet)()) print('greet:', greet) print('null_decorator(greet):', null_decorator(greet)) def uppercase(func): def wrapper(): original_result = ...
eroicaleo/LearningPython
PythonTricks/ch03_03.py
Python
mit
2,590
import os.path import typing from mitmproxy import command from mitmproxy import exceptions from mitmproxy import flowfilter from mitmproxy import io from mitmproxy import ctx from mitmproxy import flow import mitmproxy.types class Save: def __init__(self): self.stream = None self.filt = None ...
MatthewShao/mitmproxy
mitmproxy/addons/save.py
Python
mit
3,147
# -*- coding: utf-8 -*- import urllib from resources.lib.gui.gui import cGui from resources.lib.gui.guiElement import cGuiElement from resources.lib.handler.requestHandler import cRequestHandler from resources.lib.parser import cParser from resources.lib.util import cUtil from resources.lib.config import cConfig from r...
kabooom/plugin.video.xstream
sites/kinox_to.py
Python
gpl-3.0
35,260
from django.test import TestCase from django.db import transaction, IntegrityError from models import Place, Restaurant, Waiter, ManualPrimaryKey, RelatedModel, MultiModel class OneToOneTests(TestCase): def setUp(self): self.p1 = Place(name='Demon Dogs', address='944 W. Fullerton') self.p1.save() ...
mzdaniel/oh-mainline
vendor/packages/Django/tests/modeltests/one_to_one/tests.py
Python
agpl-3.0
5,714
class Location(object): def __init__(self, x, y): self.x = x self.y = y def __add__(self, direction): return Location(self.x + direction.x, self.y + direction.y) def __sub__(self, direction): return Location(self.x - direction.x, self.y - direction.y) def __repr__(sel...
Spycho/aimmo
aimmo-game-worker/simulation/location.py
Python
agpl-3.0
529
import numpy as np from PyQt5 import QtCore, QtWidgets class BitSource: def widget(self): try: return globals()[self.__class__.__name__ + '_Widget'](self) except KeyError: return QtWidgets.QLabel('<i>No options available for this source.</i>') class BitSource_Widget(QtWi...
rwnobrega/nyqlab
sources.py
Python
gpl-2.0
2,532
# Copyright 2013-2014 MongoDB, 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 writin...
phaidra/phaidra-bagger
etc/mongo-connector/solr_doc_manager.py
Python
apache-2.0
14,441
# Copyright 2014 Hewlett-Packard Development Company, L.P. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2...
debayanray/ironic_backup
ironic/tests/drivers/ilo/test_common.py
Python
apache-2.0
20,839
""" block_fill.py Optimized functions for mass-replacing blocks in a world. """ from __future__ import absolute_import import logging import numpy import mceditlib from mceditlib import blocktypes from mceditlib.blocktypes import BlockType from mceditlib.operations import Operation log = logging.getLogger(__...
Rubisk/mcedit2
src/mceditlib/operations/block_fill.py
Python
bsd-3-clause
5,223
from os import path, environ class Item: """ parent of Build, Sim, Plot it and its childs hold data for Building, Simulating, Plotting like the Operation class, but (test) case-specific """ def __init__(self, subject=None, configuration=None, directory=None): self._subject, self._...
drjod/icbc
src/item.py
Python
gpl-3.0
3,917
import json import xbmc class JsonRpc(object): id_ = 1 jsonrpc = "2.0" params = None def __init__(self, method, **kwargs): self.method = method for arg in kwargs: # id_(int), jsonrpc(str) self.arg = arg def _query(self): query = { ...
faush01/plugin.video.embycon
resources/lib/jsonrpc.py
Python
gpl-2.0
986
import numpy as np from cyvlfeat.quickshift import quickshift from cyvlfeat.quickshift import flatmap from cyvlfeat.quickshift import imseg def quickseg(image, ratio, kernel_size, max_dist): """ Produce a quickshift segmentation of a greyscale image. Parameters ---------- image : [H, W] or [H, W,...
simmimourya1/cyvlfeat
cyvlfeat/quickshift/quickseg.py
Python
bsd-2-clause
3,196
# Authors: Mr_Orange <mr_orange@hotmail.it> # URL: http://code.google.com/p/sickbeard/ # # This file is part of SickGear. # # SickGear 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 Li...
ressu/SickGear
sickbeard/clients/utorrent.py
Python
gpl-3.0
4,167
""" """ class Log(object): """ .. note:: An instance of this class automatically gets created under :py:class:`pyfldigi.client.client.Client` when it is constructed. """ def __init__(self, clientObj): self.clientObj = clientObj self.client = clientObj.client # def get_frequency(...
KM4YRI/pyFldigi
pyfldigi/client/log.py
Python
gpl-3.0
4,007
#!/usr/bin/env python import base import vault import requests import json import sys from termcolor import colored import time ENABLED = True class style: BOLD = '\033[1m' END = '\033[0m' def shodandomainsearch(domain): time.sleep(0.3) endpoint = "https://api.shodan.io/shodan/host/search?key=%s&q...
upgoingstar/datasploit
domain/domain_shodan.py
Python
gpl-3.0
1,607
import io import pytest from aioworkers import cli, utils from aioworkers.core.config import ValueExtractor def test_main(mocker): mocker.patch.object(cli, 'asyncio') parser = mocker.patch.object(cli, 'parser') ns = mocker.Mock() ns.config = () ns.config_stdin = False ns.multiprocessing = F...
aioworkers/aioworkers
tests/test_cli.py
Python
apache-2.0
1,406
## Copyright (c) 2012-2015 Aldebaran Robotics. All rights reserved. ## Use of this source code is governed by a BSD-style license that can be ## found in the COPYING file. """ Entry point for most of qibuild scripts """ import sys import os import argparse import qisys.script def print_version(script_name): sys....
dmerejkowsky/qibuild
python/qisys/main.py
Python
bsd-3-clause
1,039
import uper, time up = uper.Uper() for i in xrange(100): val = up.analogRead(23) print(val, "papugos") voltai = 5.0/1024 * val print(voltai, "V") if val >= 3: dist = (6787/(val-3))-4 print(dist, "cm") time.sleep(0.5)
8devices/IoTPy
IoTPy/things/sharp_proximity.py
Python
mit
229
"""This directory is setup with configurations to run the main functional test. It exercises a full analysis pipeline on a smaller subset of data. """ import os import subprocess import unittest import shutil import contextlib import collections import functools from nose import SkipTest from nose.plugins.attrib impo...
elkingtonmcb/bcbio-nextgen
tests/test_automated_analysis.py
Python
mit
15,192
# Copyright 2000 by Jeffrey Chang. All rights reserved. # This code is part of the Biopython distribution and governed by its # license. Please see the LICENSE file that should have been included # as part of this package. import sys # Add path to Bio sys.path.append('../..') """Code to work with the prosite.doc fi...
Ambuj-UF/ConCat-1.0
src/Utils/Bio/ExPASy/Prodoc.py
Python
gpl-2.0
5,018
#!/usr/bin/python import wx app = wx.App(False) frame = wx.Frame(None, wx.ID_ANY, "Hello World") frame.Show(True) app.MainLoop()
UMaineECE498/PythonBallooning
height/in_class_wx_demos/wx1.py
Python
gpl-2.0
129
import six class RabixError(BaseException): def __init__(self, message=''): super(RabixError, self).__init__(message) self.message = message class ValidationError(RabixError): def __init__(self, message): super(ValidationError, self).__init__(message) class ResourceUnavailable(Rabi...
RitwikGupta/rabix
rabix/common/errors.py
Python
agpl-3.0
682
#----------------------------------------------------------------------------- # Copyright (c) 2012 - 2019, Anaconda, Inc., and Bokeh Contributors. # All rights reserved. # # The full license is in the file LICENSE.txt, distributed with this software. #-------------------------------------------------------------------...
stonebig/bokeh
bokeh/sampledata/tests/test_autompg2.py
Python
bsd-3-clause
2,129
import operator from rpython.annotator import model as annmodel from rpython.flowspace.model import Constant from rpython.rlib.rarithmetic import intmask from rpython.rlib.unroll import unrolling_iterable from rpython.rtyper.error import TyperError from rpython.rtyper.lltypesystem.lltype import ( Void, Signed, Boo...
oblique-labs/pyVM
rpython/rtyper/rtuple.py
Python
mit
15,180
""" Fake class to help with testing GPIO without a physical bot (used to simulate gpio) """ class DigitalInput(): """ Digital input pin. """ def __init__(self, pin): """ Constructor. Args: pin (int): Digital pin number. """ self.pin = pin def rea...
cornell-cup/cs-minibot
minibot/hardware/virtual_gpio/gpio.py
Python
apache-2.0
1,890
import lightningtrace import os.path import rasterio import geopandas as gp import shapely # Open the raster with rasterio.open(os.path.join(os.path.dirname(os.path.dirname(__file__)), 'data', 'dem.img'), 'r') as rast: # Subset to only a portion of the raster given by a bounding box. subset = lightningtrace.ut...
GeomaticsResearch/lightningtrace
examples/subset_raster_and_extract_contours.py
Python
mit
1,269
# Copyright (c) 2011 - 2016, Zhenyu Wu, NEC Labs America Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # * Redistributions of source code must retain the above copyright notice, this # ...
Adam5Wu/ZWUtils-Python2
DebugLog.py
Python
bsd-3-clause
10,975
#!/usr/bin/env python # File created on 19 Jan 2011 from __future__ import division __author__ = "Justin Kuczynski" __copyright__ = "Copyright 2011, The QIIME Project" __credits__ = ["Justin Kuczynski"] __license__ = "GPL" __version__ = "1.8.0-dev" __maintainer__ = "Justin Kuczynski" __email__ = "justinak@gmail.com" ...
wasade/qiime
scripts/categorized_dist_scatterplot.py
Python
gpl-2.0
6,319
from .. import constants, logger from . import base_classes, api class Object(base_classes.BaseNode): """Class that wraps an object node""" def __init__(self, node, parent=None, type=None): logger.debug("Object().__init__(%s)", node) base_classes.BaseNode.__init__(self, node, parent=parent, ty...
ChainedLupine/ludum-dare-24-jam-entry
web/three.js/utils/exporters/blender/addons/io_three/exporter/object.py
Python
gpl-2.0
5,697
"""Access to the GIT base directory """ __copyright__ = """ Copyright (C) 2006, Catalin Marinas <catalin.marinas@gmail.com> 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 Software Foundation. This program is...
vincele/stgit
stgit/basedir.py
Python
gpl-2.0
1,261
# Given an IP address, geolocate it and send the result over via e-mail from robograph.datamodel.base import graph from robograph.datamodel.nodes.lib import value, http, email def email_geolocated_ip(recipients_list, smtp_server_params, ip_addr): subject = value.Value(value='Test mail') smtp_server_params['...
csparpa/robograph
sample_graphs/email_geolocated_ip.py
Python
apache-2.0
853
# -*- coding: utf-8 -*- import unicodedata class Singleton(type): """ Singleton metaclass. """ def __init__(cls, name, bases, dct): cls.__instance = None type.__init__(cls, name, bases, dct) def __call__(cls, *args, **kw): if cls.__instance is None: cls.__instance = ty...
niwinz/Green-Mine
src/greenmine/core/utils/__init__.py
Python
bsd-3-clause
952
from common_fixtures import * # NOQA import copy from cattle import ApiError from test_authorization import service_client # NOQA from test_machines import machine_context from test_svc_discovery import _validate_compose_instance_start _ = machine_context # Needed just to avoid a pep-8 quirk @pytest.fixture() de...
rancher/cattle
tests/integration/cattletest/core/test_restricted_auth.py
Python
apache-2.0
9,431
# Copyright 2016 Casey Jaymes # This file is part of PySCAP. # # PySCAP 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. # # PySCAP is ...
cjaymes/pyscap
src/scap/model/xnl_2_0/KnownAsElement.py
Python
gpl-3.0
1,043
# Copyright 2015 PerfKitBenchmarker Authors. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
akshara775/PerfKitBenchmarker-master-2
perfkitbenchmarker/providers/openstack/flags.py
Python
apache-2.0
2,804
from src.extract_feature_lib import client, domain_p, ip_p, coll_name_list import time from datetime import datetime def find_in_all(): while True: #for line in open("domains"): #response = line.strip() print "input your query" response = raw_input().strip() if response == "q":...
whodewho/FluxEnder
scripts/printing.py
Python
gpl-2.0
7,265
import pyaf.Bench.TS_datasets as tsds import tests.artificial.process_artificial_dataset as art art.process_dataset(N = 32 , FREQ = 'D', seed = 0, trendtype = "Lag1Trend", cycle_length = 0, transform = "Integration", sigma = 0.0, exog_count = 100, ar_order = 0);
antoinecarme/pyaf
tests/artificial/transf_Integration/trend_Lag1Trend/cycle_0/ar_/test_artificial_32_Integration_Lag1Trend_0__100.py
Python
bsd-3-clause
266
# Copyright 2015 The Brotli Authors. All rights reserved. # # Distributed under MIT license. # See file LICENSE for detail or copy at https://opensource.org/licenses/MIT import os import platform import re import unittest try: from setuptools import Extension from setuptools import setup except: from dist...
nicksay/brotli
setup.py
Python
mit
8,592
# coding: utf-8 # author: Fei Gao <leetcode.com@feigao.xyz> # Problem: implement stack using queues # # Implement the following operations of a stack using queues. # # push(x) -- Push element x onto stack. # # pop() -- Removes the element on top of the stack. # # top() -- Get the top element. # # empty() -- Retur...
feigaochn/leetcode
p225_implement_stack_using_queues.py
Python
mit
2,174
#!/usr/bin/env python # -*- mode: python; coding: utf-8; -*- # ---------------------------------------------------------------------------## # # Copyright (C) 1998-2003 Markus Franz Xaver Johannes Oberhumer # Copyright (C) 2003 Mt. Hood Playing Card Co. # Copyright (C) 2005-2009 Skomoroh # # This program is free softwa...
jimsize/PySolFC
pysollib/games/ultra/hanafuda.py
Python
gpl-3.0
34,324
#!/usr/bin/python from __future__ import (absolute_import, division, print_function) # Copyright 2019 Fortinet, Inc. # # 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 Lic...
amenonsen/ansible
lib/ansible/modules/network/fortios/fortios_system_dns_database.py
Python
gpl-3.0
16,296
# -*- coding: utf-8; -*- # # This file is part of Superdesk. # # Copyright 2013, 2014 Sourcefabric z.u. and contributors. # # For the full copyright and license information, please see the # AUTHORS and LICENSE files distributed with this source code, or # at https://www.sourcefabric.org/superdesk/license import urlli...
nistormihai/superdesk-core
apps/keywords/alchemy.py
Python
agpl-3.0
1,508
import logging from pyvisdk.exceptions import InvalidArgumentError ######################################## # Automatically generated, do not edit. ######################################## log = logging.getLogger(__name__) def ScheduledTaskDescription(vim, *args, **kwargs): '''Static strings for scheduled tasks...
xuru/pyvisdk
pyvisdk/do/scheduled_task_description.py
Python
mit
1,083
from __future__ import unicode_literals from django.apps import AppConfig class ProjectsConfig(AppConfig): name = 'Projects'
matt-dale/designdb
DESIGNDB_REBUILD/Projects/apps.py
Python
apache-2.0
132
#coding=utf-8 from flask import Blueprint auth = Blueprint('auth', __name__) from . import views, errors from app.utils.permission import Permission # 使用app_context_processor这个方法可以向模板中 # 传递,这个方法,只需要在一个地方传递后,其他蓝本 # 也能使用这个方法 @auth.app_context_processor def inject_permissions(): return dict(Permission=Permission)
Leon109/IDCMS-Web
web/app/auth/__init__.py
Python
apache-2.0
407
# =============================================================================== # Copyright 2013 Jake Ross # # 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/licens...
USGSDenverPychron/pychron
pychron/extraction_line/tasks/extraction_line_pane.py
Python
apache-2.0
6,565
#!/usr/bin/python import sys import os # Run analysis on every prefix of the filelist, serialize that prefix, # then complete the analysis. Verify that the points-to sets are # always the same def list_to_string(list): if (len(list) == 0): return "" result = list[0] for elt in list[1:]: result = result +...
rrnewton/cyclone
banshee/tests/andersen-rpersist-test.py
Python
gpl-2.0
1,237
#!/usr/bin/python # (c) 2016, NetApp, Inc # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['preview'], ...
pilou-/ansible
lib/ansible/modules/storage/netapp/netapp_e_volume.py
Python
gpl-3.0
39,630
from testfixtures import TempDirectory import test_activity_data as data from shutil import copyfile from shutil import copy import shutil import re import os class FakeSession: def __init__(self, fake_session): #self.settings = settings #default test data self.session_dict = fake_session...
gnott/elife-bot
tests/activity/classes_mock.py
Python
mit
5,741
# -*- coding: utf-8 -*- # Copyright (c) 2015-2016, Thierry Lemeunier <thierry at lemeunier dot net> # All rights reserved. # # Redistribution and use in source and binary forms, with or without modification, # are permitted provided that the following conditions are met: # # 1. Redistributions of source code must reta...
thethythy/Mnemopwd
mnemopwd/server/clients/protocol/StateS0.py
Python
bsd-2-clause
2,259
import pytest from openapi_core.spec import OpenAPIv30Spec as Spec class TestMinimal: spec_paths = ["data/v3.0/path_param.yaml"] @pytest.mark.parametrize("spec_path", spec_paths) def test_param_present(self, factory, spec_path): spec_dict = factory.spec_from_file(spec_path) spec = Spec....
p1c2u/openapi-core
tests/integration/schema/test_path_params.py
Python
bsd-3-clause
606
import OOMP newPart = OOMP.oompItem(9022) newPart.addTag("oompType", "HESH") newPart.addTag("oompSize", "03") newPart.addTag("oompColor", "R") newPart.addTag("oompDesc", "STAN") newPart.addTag("oompIndex", "01") OOMP.parts.append(newPart)
oomlout/oomlout-OOMP
old/OOMPpart_HESH_03_R_STAN_01.py
Python
cc0-1.0
241
from lux.core import LuxExtension class Extension(LuxExtension): '''{{ project_name }} extension ''' def middleware(self, app): return [] def main(): from lux.core import execute_from_config execute_from_config('{{ project_name }}.config')
quantmind/lux
lux/core/commands/project_template/project_name/__init__.py
Python
bsd-3-clause
273