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 moose import yacml import sys def main( ): yacmlFile = sys.argv[1] yacml.loadModel( yacmlFile ) print( '[INFO] Done ' ) if __name__ == '__main__': main()
dilawar/moose-chemical
test/run_test.py
Python
gpl-2.0
203
# -*- coding: utf-8 -*- ## ## This file is part of Invenio. ## Copyright (C) 2014 CERN. ## ## Invenio is free software; you can redistribute it and/or ## modify it under the terms of the GNU General Public License as ## published by the Free Software Foundation; either version 2 of the ## License, or (at your option) a...
egabancho/invenio
invenio/modules/authors/config.py
Python
gpl-2.0
1,020
#!/usr/bin/python # -*- coding: utf-8 -*- # # --- BEGIN_HEADER --- # # settingsaction - [insert a few words of module description on this line] # Copyright (C) 2003-2014 The MiG Project lead by Brian Vinter # # This file is part of MiG. # # MiG is free software: you can redistribute it and/or modify # it under the ter...
heromod/migrid
mig/shared/functionality/settingsaction.py
Python
gpl-2.0
7,805
try: from flask_babelex import Domain except ImportError: def gettext(string, **variables): return string % variables def ngettext(singular, plural, num, **variables): variables.setdefault('num', num) return (singular if num == 1 else plural) % variables def lazy_gettext(strin...
Widiot/simpleblog
venv/lib/python3.5/site-packages/flask_admin/babel.py
Python
mit
1,945
from .cmd import * from .io import *
gautelinga/BERNAISE
common/__init__.py
Python
mit
37
import os from nav_util import * def signal(): while g.signalling: os.system("(python tone2.py 8000 3000 1200;python tone2.py 8000 3000 1000) 2>/dev/null") def obstaclebeep(): os.system("python tone2.py 16000 3000 2400 2>/dev/null") def dospeak(s, p): if '#' in s: s = s.replace('#', str(...
sics-sse/moped
position/car-control-old/nav_signal.py
Python
gpl-2.0
1,125
#!/usr/bin/python # -*- coding: utf-8 -*- import httplib # causes httplib to return the partial response from a server in case the read fails to be complete. def patch_http_response_read(func): def inner(*args): try: return func(*args) except httplib.IncompleteRead, e: return e.partial return ...
XueAlfred/MALAnalysis
scraper-code/myanimelist/myanimelist.py
Python
mit
405
# -*- coding: utf-8 -*- # Generated by Django 1.9.8 on 2017-04-03 14:53 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('server', '0012_4_14_fault_definitions'), ] operations = [ migrations.RenameF...
migasfree/migasfree
migasfree/server/migrations/0013_4_14_attribute_set.py
Python
gpl-3.0
2,093
#!/usr/bin/python # -*- coding: latin-1 -*- # This program 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, or (at your option) any later # version. # # This program is distributed in t...
trosa/forca
gluon/contrib/pysimplesoap/simplexml.py
Python
gpl-2.0
16,161
def sum_values_above_threshold(value_string, threshold): # Complete the function body. (4 MARKS) ''' (str, int) -> int Precondition: value_string.isdigit() returns True Return the sum of the individual digits in value_string that are greaterthan threshold. >>> sum_values_above_th...
mdnu/snake
csc work/final/w16/Q1.py
Python
mit
525
import select import Queue import logging as log from connection import * class ConnectionManager: def __init__(self): self.Connections = [] self.NewConnectionQueue = Queue.Queue(0) self.DeadConnections = [] def AddConnection(self, connection): self.NewConnectionQ...
SlashRoot/WHAT
what_apps/push/standalonewebsocketserver/connectionManager.py
Python
mit
2,116
#!/usr/bin/env python import os import sys if __name__ == "__main__": os.environ.setdefault("DJANGO_SETTINGS_MODULE", "segtest.settings") from django.core.management import execute_from_command_line execute_from_command_line(sys.argv)
aldryn/aldryn-segmentation
test_project/manage.py
Python
bsd-3-clause
250
""" RESTful API for controlling and monitoring EVA. """ import eva import eva.globe import eva.gpg import eva.rest.resources import falcon import json import re import wsgiref.simple_server class RequireJSON(object): def process_request(self, req, resp): if not req.client_accepts_json: rais...
metno/EVA
eva/rest/__init__.py
Python
gpl-2.0
5,891
# Copyright (C) 2006-2007 Red Hat, Inc. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2 of the License, or (at your option) any later version. # # This library is dis...
manuq/sugar-toolkit-gtk3
src/sugar3/graphics/xocolor.py
Python
lgpl-2.1
8,657
#!/usr/bin/env python """OSX specific actions. Most of these actions share an interface (in/out rdfvalues) with linux actions of the same name. OSX-only actions are registered with the server via libs/server_stubs.py """ import ctypes import logging import os import re import shutil import StringIO import sys import...
statik/grr
client/client_actions/osx/osx.py
Python
apache-2.0
14,584
#!/usr/bin/env python import sys sys.path.insert(0, '../Tools') import fitzhugh as model import prcNetwork import torus_2D import numpy as np class torus(torus_2D.torus_2D): model = model V_trigger = 0. figsize = (13, 6.5) def __init__(self, system, network, traces, info=None, position=None): ...
jusjusjus/Motiftoolbox
Fitzhugh_PRC/torus.py
Python
gpl-2.0
1,328
from typing import Generic, TypeVar, List import pytest import jedi from jedi.inference.value import ModuleValue def interpreter(code, namespace, *args, **kwargs): return jedi.Interpreter(code, [namespace], *args, **kwargs) def test_on_code(): from functools import wraps i = interpreter("wraps.__code_...
snakeleon/YouCompleteMe-x64
third_party/ycmd/third_party/jedi_deps/jedi/test/test_inference/test_mixed.py
Python
gpl-3.0
2,874
# Copyright 2015 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
tensorflow/tensorflow
tensorflow/python/framework/traceable_stack_test.py
Python
apache-2.0
5,145
import flask from flask import render_template from flask import request from flask import url_for from flask import jsonify import uuid import json import logging # Date handling import arrow # Replacement for datetime, based on moment.js import datetime # But we still need time from dateutil import tz # For inter...
Oalamoud/proj7-Gcal
main.py
Python
artistic-2.0
15,064
#!/usr/bin/env python # -*- coding: utf-8 -*- """ gateway tests - Object Wrappers Copyright 2009-2013 Glencoe Software, Inc. All rights reserved. Use is subject to license terms supplied in LICENSE.txt """ from omero.gateway.utils import ServiceOptsDict import pytest class TestServiceOptsDict (object): ...
jballanc/openmicroscopy
components/tools/OmeroPy/test/gatewaytest/test_utils.py
Python
gpl-2.0
6,683
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('applications', '0001_initial'), ] operations = [ migrations.AlterField( model_name='question', name=...
patjouk/djangogirls
applications/migrations/0002_auto_20150308_2229.py
Python
bsd-3-clause
1,002
def agts(queue): queue.add('adenine-thymine_complex_stack.py', ncpus=4, walltime=40)
qsnake/gpaw
gpaw/test/big/vdw/submit.adenine-thymine_complex_stack.agts.py
Python
gpl-3.0
89
# Copyright 2017 Intel Corporation. # # 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...
openstack/neutron-classifier
neutron_classifier/common/resources.py
Python
apache-2.0
4,144
## ## This file is part of the libsigrokdecode project. ## ## Copyright (C) 2013 Uwe Hermann <uwe@hermann-uwe.de> ## ## 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 Li...
martinling/libsigrokdecode
decoders/i2s_dump/__init__.py
Python
gpl-3.0
868
#!/usr/bin/python -W ignore # # This script provides named entity recogntion with the NER-tagger from Stanford NLP. # # Each line is tokenized into sentences -- a few lines are not correctly split into sentences by cc-segment-stories. # # http://www-nlp.stanford.edu/software/CRF-NER.shtml # http://www.nltk.org/api/nlt...
RedHenLab/NLP
NER-StanfordNLP-annotate.py
Python
gpl-2.0
4,821
import logging import logging.config from sha3 import sha3_256 from bitcoin import privtopub import struct import os import sys import rlp import db import random from rlp import big_endian_to_int, int_to_big_endian logger = logging.getLogger(__name__) # decorator def debug(label): def deb(f): def inner...
ethers/pyethereum
pyethereum/utils.py
Python
mit
9,141
#!/usr/bin/env python """Tests for the stats_store classes.""" import math import pandas # pylint: disable=unused-import,g-bad-import-order from grr.lib import server_plugins # pylint: enable=unused-import,g-bad-import-order from grr.lib import aff4 from grr.lib import data_store from grr.lib import flags from gr...
pchaigno/grreat
lib/aff4_objects/stats_store_test.py
Python
apache-2.0
40,610
import unittest def wrap(s, max_len): last_ws = 0 for i in range(len(s)): if s[i] == ' ': last_ws = i if i == max_len: return s[:last_ws], s[last_ws + 1:] return s, '' def wrap_to_lines(s, max_len): while s: line, s = wrap(s, max_len) yield line ...
basp/neko
string_utils.py
Python
mit
3,313
from django.shortcuts import render #using generics from django.views.generic import TemplateView # Create your views here. class BaseView(TemplateView): template_name = 'base.html' class port1View(TemplateView): template_name = 'port1.html' class port2View(TemplateView): template_name = 'port2.html' class por...
nandosarracino/mymainsite
mainsite/views.py
Python
mit
557
# -*- encoding: utf-8 -*- def select_all_but_last_logical_tie_in_pitched_runs(expr=None): r'''Selects all but last logical tie in pitched runs. .. container:: example :: >>> selector = selectortools.select_all_but_last_logical_tie_in_pitched_runs() >>> print(format(selector...
mscuthbert/abjad
abjad/tools/selectortools/select_all_but_last_logical_tie_in_pitched_runs.py
Python
gpl-3.0
2,516
#!/usr/bin/env python # -*- coding: utf-8 -*- # import gps #from time import sleep session = gps.gps() session.read() session.stream() cycles = 0 while 1: session.read() #print 'Fix mode ' , session.fix.mode #print 'Fix ' , ("NO_FIX","FIX","DGPS_FIX")[session.fix.mode - 1] ...
lyusupov/Argus
src/init/GPSWaitFix.py
Python
gpl-2.0
572
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright (c) 2010, Monash e-Research Centre # (Monash University, Australia) # Copyright (c) 2010, VeRSI Consortium # (Victorian eResearch Strategic Initiative, Australia) # All rights reserved. # Redistribution and use in source and binary forms, with or without #...
pansapiens/mytardis
tardis/tardis_portal/tests/test_forms.py
Python
bsd-3-clause
4,976
import numpy as np def order_to_match(array, reference): """ Given an array ``array``, return the index array needed to make it the same as ``reference`` """ return np.argsort(array)[np.argsort(np.argsort(reference))]
astrofrog/sedfitter
sedfitter/utils/misc.py
Python
bsd-2-clause
236
# -*- coding: utf-8 -*- from __future__ import with_statement from django.forms import * from django.test import TestCase from django.utils.translation import ugettext_lazy, override from regressiontests.forms.models import Cheese class FormsRegressionsTestCase(TestCase): def test_class(self): # Tests to...
LethusTI/supportcenter
vendor/django/tests/regressiontests/forms/tests/regressions.py
Python
gpl-3.0
7,700
#!/usr/bin/env python2.7 # Copyright 2017 gRPC authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable la...
quizlet/grpc
tools/interop_matrix/create_matrix_images.py
Python
apache-2.0
9,421
import subprocess def kill_processes_as(user, process_name=None): """ Kill all processes of a given name belonging to a given user. :param user: :param process_name: Name of process to kill, if not specified or None will kill all of the user's processes. :return: """ ...
HaliteChallenge/Halite-II
apiserver/worker/util.py
Python
mit
601
# -*- coding: utf-8 -*- """ Search on Nyaa using RSS. """ __author__ = 'Sohhla' from shared.log import LoggerManager import xml.etree.ElementTree as XMLParser from datetime import datetime import common class NyaaRSS(): """ Search on Nyaa using RSS. """ def __init__(self, network): self.log ...
geosohh/AnimeTorr
animetorr/downloader/anime/nyaa_rss.py
Python
gpl-2.0
3,385
import logging import urllib2 from StringIO import StringIO class MockLoggingHandler(logging.Handler): """Mock logging handler to check for expected logs.""" def __init__(self, *args, **kwargs): self.reset() logging.Handler.__init__(self, *args, **kwargs) def emit(self, record): ...
chrigl/docker-library
plone-chrigl-debian/src/collective.flattr/collective/flattr/tests/mocks.py
Python
apache-2.0
1,128
# -*- coding: utf-8 -*- # (c) 2015 Tuomas Airaksinen # # This file is part of automate-wsgi. # # automate-wsgi 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 opt...
tuomas2/automate-wsgi
automate_wsgi/__init__.py
Python
gpl-3.0
1,018
#!/usr/bin/env python # -*- coding: utf-8 -*- from base import BaseHandler import time import sys sys.path.append('..') from models.user import User class SigninHandler(BaseHandler): def get(self): self.render("signin.html") def post(self): uname = self.get_argument("name") email =...
oujiaqi/suiyue
routes/signin.py
Python
apache-2.0
947
# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # d...
noironetworks/group-based-policy
gbpservice/neutron/tests/unit/services/grouppolicy/test_extension_driver_api.py
Python
apache-2.0
19,823
#!/usr/bin/env python ######################################################################################### # # Test function for sct_spinalcord script # # replace the shell test script in sct 1.0 # # --------------------------------------------------------------------------------------- # Copyright (c) 2014 Poly...
3324fr/spinalcordtoolbox
testing/test_sct_smooth_spinalcord.py
Python
mit
1,053
from django.contrib.staticfiles.testing import StaticLiveServerTestCase from selenium.webdriver.support.ui import WebDriverWait from selenium import webdriver from selenium.webdriver.common.keys import Keys from unittest import skip import time import sys class FunctionalTest(StaticLiveServerTestCase): @classmetho...
naveenpanwar/tgoat
functional_tests/base.py
Python
gpl-3.0
2,208
"""The tests for the Sonarr platform.""" import unittest import time from datetime import datetime import pytest from homeassistant.components.sensor import sonarr from tests.common import get_test_home_assistant def mocked_exception(*args, **kwargs): """Mock exception thrown by requests.get.""" raise OSEr...
LinuxChristian/home-assistant
tests/components/sensor/test_sonarr.py
Python
apache-2.0
34,600
import d class A: a= "a" def test(self): print "aa" class B: b= "b" def test(self): print "bb" d.helper(B) a=A() a.test()
h2oloopan/easymerge
EasyMerge/testcase/self_written/c.py
Python
mit
134
import os from setuptools import setup, find_packages here = os.path.abspath(os.path.dirname(__file__)) with open(os.path.join(here, 'README.txt')) as f: README = f.read() with open(os.path.join(here, 'CHANGES.txt')) as f: CHANGES = f.read() requires = [ 'pyramid', 'pyramid_chameleon', 'pyramid_d...
ArneBab/gamification-engine
setup.py
Python
mit
1,784
#!/usr/bin/env python # # euclid graphics maths module # # Copyright (c) 2006 Alex Holkner # Alex.Holkner@mail.google.com # # This library is free software; you can redistribute it and/or modify it # under the terms of the GNU Lesser General Public License as published by the # Free Software Foundation; either version ...
RT-Thread/rtthread_fsl
utils/mdp/eMPL-pythonclient/euclid.py
Python
lgpl-2.1
69,409
# -*- coding: utf-8 -*- # api.py # Copyright (C) 2015 LEAP # # 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 pr...
leapcode/soledad
src/leap/soledad/client/http_target/api.py
Python
gpl-3.0
9,467
from django.contrib import admin from .models import ( Provider, OsFamily, OperatingSystem, Instance, ServerPlan) admin.site.register(Provider) admin.site.register(OsFamily) admin.site.register(OperatingSystem) admin.site.register(Instance) admin.site.register(ServerPlan)
jcbalmeida/onecloud-store
store/computing/admin.py
Python
mit
296
# UrbanFootprint v1.5 # Copyright (C) 2017 Calthorpe Analytics # # This file is part of UrbanFootprint version 1.5 # # UrbanFootprint is distributed under the terms of the GNU General # Public License version 3, as published by the Free Software Foundation. This # code is distributed WITHOUT ANY WARRANTY, without impl...
CalthorpeAnalytics/urbanfootprint
footprint/client/configuration/default/built_form/old_placetypes.py
Python
gpl-3.0
71,803
from __future__ import print_function from flask import render_template import threading from bokeh.models import ColumnDataSource from bokeh.plotting import figure, cursession, push, output_server from bokeh.embed import autoload_server from devviz import data_handler, app from devviz.views import View class Boke...
hildensia/devviz
devviz/views/bokeh_backend.py
Python
bsd-2-clause
2,327
try: import json assert json # workaround for pyflakes issue #13 except ImportError: import simplejson as json from rdflib.py3compat import PY3 from os import sep from os.path import normpath if PY3: from urllib.parse import urljoin, urlsplit, urlunsplit else: from urlparse import urljoin, urlspl...
dahuo2013/rdflib-jsonld
rdflib_jsonld/util.py
Python
bsd-3-clause
1,936
# Copyright (c) 2014 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 re...
openstack/tempest
tempest/lib/common/preprov_creds.py
Python
apache-2.0
20,875
# 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...
nathanbjenx/cairis
cairis/core/DotTraceParameters.py
Python
apache-2.0
1,055
import json import sys import logging import logging.handlers def load_config(): '''Loads application configuration from a JSON file''' try: json_data = open('config.json') config = json.load(json_data) json_data.close() return config except Exception: print """T...
svera/clouddump
tools.py
Python
gpl-2.0
1,226
''' Implementation of Bitcoin's p2p protocol ''' import random import sys import time from twisted.internet import protocol import p2pool from . import data as bitcoin_data from p2pool.util import deferral, p2protocol, pack, variable class Protocol(p2protocol.Protocol): def __init__(self, net): p2protoc...
dragosbdi/p2pool
p2pool/bitcoin/p2p.py
Python
gpl-3.0
6,499
import logging # Configuración del módulo logging # loguear a la stdout logging.basicConfig(level=logging.DEBUG, format='%(asctime)s - %(levelname)s - %(message)s') # loguear a un archivo # logging.basicConfig(filename='s12l36.log', level=logging.DEBUG, format='%(asctime)s - %(levelname)s - %(message)s') ''' #Program...
sistemasmarcelocastro/pruebas-python
cursoPython1/s12l36.py
Python
mit
926
# This file is part of uSSync. # # 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 i...
oguzhanunlu/uSSync
sync/nt_sync.py
Python
gpl-3.0
908
#! /usr/bin/python from twisted.spread import pb from twisted.internet import reactor class Two(pb.Referenceable): def remote_print(self, arg): print "Two.print() called with", arg def main(): two = Two() factory = pb.PBClientFactory() reactor.connectTCP("localhost", 8800, factory) def1 =...
hortonworks/hortonworks-sandbox
desktop/core/ext-py/Twisted/doc/core/howto/listings/pb/pb3client.py
Python
apache-2.0
555
#!/usr/bin/env python import argparse import math import time import fiona import multiprocessing from rasterio.plot import show import math import os import click #import matlibplot.pyplot as plt import numpy as np import numpy.ma as ma import rasterio from rasterio.plot import show, show_hist from projections.ras...
ricardog/raster-project
user-scripts/katia/ab.py
Python
apache-2.0
4,820
# # Copyright (c) 2013 Markus Eliasson, http://www.quarterapp.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 3 of the License, or # (at your option) any later version...
OlofFredriksson/quarterapp
quarterapp/__init__.py
Python
gpl-3.0
756
# -*- coding: utf-8 -*- """ @author: Fabio Erculiani <lxnay@sabayon.org> @contact: lxnay@sabayon.org @copyright: Fabio Erculiani @license: GPL-2 B{Entropy Framework repository database module}. Entropy repositories (server and client) are implemented as relational databases. Currently, Ent...
kidaa/entropy
lib/entropy/db/__init__.py
Python
gpl-2.0
1,423
"""transdate -- Python implementation of Asian lunisolar calendar Copyright (c) 2004-2006, Kang Seonghoon aka Tokigun. This module declares lunardate class which represents a day of Asian lunisolar calendar. lunardate class is compatible with datetime.date class, so you can use both lunardate and date interchangeably....
lifthrasiir/transdate
transdate.py
Python
lgpl-2.1
26,449
from PyQt5 import QtCore, QtWidgets from PyQt5.QtGui import QIcon from PyQt5.QtCore import pyqtSlot from mazeui.Maze import Config from mazeui.core.MazeBBLTable import MazeBBLTable class MazeUIBBLWindow(QtWidgets.QMainWindow): def __init__(self, parent=None): """ Constructor """ ...
0xPhoeniX/MazeWalker
MazeUI/mazeui/widgets/MazeUIBBLWindow.py
Python
lgpl-3.0
1,255
""" WSGI config for gdgapi project. This module contains the WSGI application used by Django's development server and any production WSGI deployments. It should expose a module-level variable named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover this application via the ``WSGI_APPLICATION`` s...
mrmmm/gdgapi
gdgapi/gdgapi/wsgi.py
Python
mit
1,635
import sys import platform import numpy #if platform.machine() != 'armv6l': #import numpy.core._dotblas import numpy.core.multiarray import numpy.core.multiarray_tests import numpy.core.scalarmath import numpy.core.umath import numpy.core.umath_tests import numpy.fft.fftpack_lite import numpy.lib._compiled_base i...
pitrou/conda-recipes
numpydbg-1.9.2/run_test.py
Python
mit
710
import cassiopeia as cass from cassiopeia import Map, Maps def get_maps(): maps = cass.get_maps(region="NA") for map in maps: print(map.name, map.id) map = Map(name="Summoner's Rift", region="NA") print(map.id) if __name__ == "__main__": get_maps()
robrua/cassiopeia
examples/map.py
Python
mit
282
import asyncio import pytest import aioredis async def _reader(channel, output, waiter, conn): await conn.execute('subscribe', channel) ch = conn.pubsub_channels[channel] waiter.set_result(conn) while await ch.wait_message(): msg = await ch.get() await output.put(msg) @pytest.mark.ru...
ymap/aioredis
tests/pubsub_commands_test.py
Python
mit
9,612
# -*- coding: utf-8 from __future__ import unicode_literals, absolute_import import django DEBUG = True USE_TZ = True # SECURITY WARNING: keep the secret key used in production secret! SECRET_KEY = "$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$" DATABASES = { "default": { "ENGINE": "django.db.backe...
artforlife/django-oscar-stripe
tests/settings.py
Python
mit
636
# coding=utf-8 # Copyright 2022 The Google Research 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 applicab...
google-research/google-research
cascaded_networks/models/densenet.py
Python
apache-2.0
6,633
from setuptools import setup, find_packages setup(name='MODEL8568434338', version=20140916, description='MODEL8568434338 from BioModels', url='http://www.ebi.ac.uk/biomodels-main/MODEL8568434338', maintainer='Stanley Gu', maintainer_url='stanleygu@gmail.com', packages=find_packages(...
biomodels/MODEL8568434338
setup.py
Python
cc0-1.0
377
import unittest import iot_button class FunctionalTest(unittest.TestCase): def test_1(self): event = {"batteryVoltage": "testing", "serialNumber": "testing", "not_a_real_clickType": "LONG"} context = {"aws_request_id": "foo", "log_stream_name": "foo", "invoke...
nanderson/iot_button_lambda_handler
test.py
Python
apache-2.0
889
from __future__ import absolute_import, unicode_literals from .models import BlockedUser from django.contrib import admin admin.site.register(BlockedUser)
emacsway/django-login-secure
login_secure/admin.py
Python
bsd-3-clause
156
import logging logger = logging.getLogger(__name__) import trollius as asyncio from winlib import ( INPUT_RECORD, DWORD, ReadConsoleInput, pointer, WinError, GetStdHandle, STD_INPUT_HANDLE, ) def platform_setup(driver): driver.loop = asyncio.ProactorEventLoop() asyncio.set_event_loop(driver.loop) ...
sstjohn/thundergate
py/tap/win_fun.py
Python
gpl-3.0
1,103
# -*- coding: utf-8 -*- """ AsciiDoc Reader =============== This plugin allows you to use AsciiDoc to write your posts. File extension should be ``.asc``, ``.adoc``, or ``asciidoc``. """ from pelican.readers import BaseReader from pelican import signals import os import re import subprocess def call(cmd): """Cal...
benjaminabel/pelican-plugins
asciidoc_reader/asciidoc_reader.py
Python
agpl-3.0
2,946
# coding: utf-8 import datetime import sys import unittest try: import ezcf except ImportError: sys.path.append('../') import ezcf from subdir.sample_json import * from subdir.sample_yaml import * from subdir.sample_ini import * from subdir.sample_xml import * class TestProto(unittest.TestCase): d...
laike9m/ezcf
tests/test_wildcard_sub.py
Python
mit
1,879
# 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...
e0ne/python-brickagentclient
brickclient/tests/test_http.py
Python
apache-2.0
7,748
# enable or disable the whole program ENABLED = True # if we're in testing mode, output more debug and allow testers to add their own email DEBUG = True # used with above, you can check the output of emails that would have been sent SEND_EMAILS = True # iSAMS Batch API key API_KEY = "11D497FF-A7D9-4646-A6B8-D9D1B871...
CranleighAD/isams-tools
settings_example.py
Python
gpl-3.0
2,947
""" Write a method to replace all spaces in a string with '%20'. You may assume that the string has suffcient space at the end of the string to hold the additional characters, and that you are given the "true" length of the string. Example: Input: "Mr John Smith " Output: "Mr%20John%20Smith" """ def repl...
MFry/pyAlgoDataStructures
Cracking the Coding Interview/Arrays_and_Strings/question4.py
Python
mit
1,278
import web from time import sleep stat_and_cap=''' { "ma-status-and-capabilities": { "ma-agent-id": "550e8400-e29b-41d4-a716-446655440000", "ma-device-id": "urn:dev:mac:0024befffe804ff1", "ma-hardware": "mfr-home-gateway-v10", "ma-firmware": "25637748-rev2a", "ma-version": "ispa-v1.01", "ma-i...
andrewleu/controller-and-server
ma.py
Python
apache-2.0
2,145
#!/usr/bin/env python # # Copyright 2012 Nick Foster # # This file is part of gr-air-modes # # gr-air-modes 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, or (at your option) # any later v...
rsenykoff/gr-air-modes-kml
python/az_map.py
Python
gpl-3.0
8,512
from __future__ import absolute_import from .base import flatten, url_test URLS = flatten(( # bug 832348 **/index.html -> **/ url_test('/any/random/url/with/index.html', '/any/random/url/with/'), # bug 774675 url_test('/en/', '/en-US/'), url_test('/es/', '/es-ES/'), url_test('/pt/', '/pt-BR/...
davehunt/bedrock
test_redirects/map_globalconf.py
Python
mpl-2.0
49,116
# Copyright (c) 2020, Frappe and Contributors # License: GNU General Public License v3. See license.txt import frappe def execute(): count = frappe.db.sql("SELECT COUNT(*) FROM `tabSingles` WHERE doctype='Amazon MWS Settings' AND field='enable_sync';")[0][0] if count == 0: frappe.db.sql("UPDATE `tabSingles` SET f...
gsnbng/erpnext
erpnext/patches/v12_0/rename_mws_settings_fields.py
Python
agpl-3.0
481
# -*- coding: utf-8 -*- from .tests import ( FacetListTestCase, FacetTestCase, QueryFacetTestCase, FacetItemTestCase, ) from .factories import ( FacetListFactory, FacetFactory, FacetItemFactory, )
Squishymedia/feedingdb
django-faceted-search/faceted_search/tests/__init__.py
Python
gpl-3.0
226
# UDP clients and server. # Note that UDP packets may be lost, in which case server may not # receive all requests (and program may need to be terminated # explicitly). import sys, socket import asyncoro def server_proc(n, sock, coro=None): for i in range(n): msg, addr = yield sock.recvfrom(1024) ...
pgiri/asyncoro
examples/udp.py
Python
mit
1,035
from django.contrib import admin from models import Datalogger class DataloggerAdmin(admin.ModelAdmin): list_display = ('event_id','event_type','object_id','model_name','field_name','before_value','after_value','operator','create_at','update_at') search_fields = ('event_id','event_type','object_id','model_nam...
pylixm/django-datalogger
admin.py
Python
mit
427
# __about__.py # # Copyright (C) 2006-2016 wolfSSL Inc. # # This file is part of wolfSSL. (formerly known as CyaSSL) # # wolfSSL 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,...
jakobsa/wolfssl
wrapper/python/wolfcrypt/__about__.py
Python
gpl-2.0
1,703
# @file lassdata.py # @brief load sensor data from lass. management sensor data # README: # MODULE_ARCH: # CLASS_ARCH: # GLOBAL USAGE: #standard import logging #extend import urllib import simplejson import requests #requests need to load after simplejson #library import lib.globalclasses as gc from lib.const impor...
LinkItONEDevGroup/LASS
LASS-Simulator/codes/lassdata.py
Python
mit
8,420
""" The DoInterestManager keeps track of which parent/zones that we currently have interest in. When you want to "look" into a zone you add an interest to that zone. When you want to get rid of, or ignore, the objects in that zone, remove interest in that zone. p.s. A great deal of this code is just code moved from ...
chandler14362/panda3d
direct/src/distributed/DoInterestManager.py
Python
bsd-3-clause
29,162
# -*- coding: utf-8 -*- """ uds.is.mysql ~~~~~~~~~~~~ :copyright: Copyright (c) 2015, National Institute of Information and Communications Technology.All rights reserved. :license: GPL2, see LICENSE for more details. """ import MySQLdb import uds.logging from uds.io.base import M2MDataDao class MySQLDao(M2MDataDao)...
nict-isp/uds-sdk
uds/io/mysql.py
Python
gpl-2.0
12,337
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2011 OpenStack Foundation # Copyright 2012 Justin Santa Barbara # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # h...
Triv90/Nova
nova/tests/api/openstack/compute/contrib/test_security_groups.py
Python
apache-2.0
62,744
import copy from hearthbreaker.tags.base import Status, Action, Aura, Condition, AuraUntil, CardQuery, \ CARD_SOURCE, Effect, Buff, BuffUntil, Amount, Picker, Selector from hearthbreaker.tags.condition import IsSecret from hearthbreaker.tags.selector import AllPicker, ConstantSelector class Give(Action): def ...
Ragowit/hearthbreaker
hearthbreaker/tags/action.py
Python
mit
20,965
# -*- coding: utf-8 -*- from ldtools import __version__, url, author_email import datetime import logging import mimetypes import os import shutil import socket import rdflib from ldtools.utils import urllib2 # set socket timeout. URLError will occur if time passed socket.setdefaulttimeout(5) __useragent__ = 'ldtoo...
dmr/Ldtools
ldtools/backends.py
Python
bsd-2-clause
7,763
import fnmatch import argparse import sys, traceback import os import sqlite3 import xml.etree.ElementTree as ET import csv # The workbench database metric definitions use official CHaMP tier 1 and tier 2 types. # However the CRITFC metric result files use their customized tier types. See critfc_2018.py # for definiti...
SouthForkResearch/CHaMP_Metrics
scripts/critfc_scrape.py
Python
gpl-3.0
7,086
#!/usr/bin/python # -*- coding: UTF-8 -*- from scrapy.spiders import Spider from scrapy.selector import Selector from webcrawl.items import Supplements class SupplementsSpider(Spider): name = "supplements" allowed_domains = ["iherb.cn"] start_urls = ( 'http://www.iherb.cn/Supplements', ) ...
ideaalloc/web-crawl
webcrawl/spiders/supplements.py
Python
mit
766
# -*- encoding: utf-8 -*- ################################################################################ # # # Copyright (C) 2013-Today Carlos Eduardo Vercelino - CLVsol # # ...
CLVsol/odoo_addons_l10n_br
l10n_br_clv_cmed/clv_medicament/clv_medicament.py
Python
agpl-3.0
1,842
# -*- coding: utf-8 -*- from distutils.core import setup from setuptools import find_packages LONGDOC = """ A very simple python library, used to format datetime with *** time ago statement. Install pip install timeago Usage import timeago, datetime d = datetime.datetime.now() + datetime.timedelta(seconds = 60...
avrong/timeago
setup.py
Python
mit
1,607
#!/usr/bin/env python # -*- coding: utf-8 -*- import rdkit from rdkit.Chem import AllChem from rdkit import DataStructs __license__ = "X11" METADATA = { "id": "method_rdkit_fcfp2_1024_tanimoto", "representation": "fcfp2_1024", "similarity": "tanimoto" } def _compute_fingerprint(molecule): return Al...
skodapetr/lbvs-environment
methods/fcfp/fcfp2_1024_tanimoto.py
Python
mit
1,423
# 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...
hehongliang/tensorflow
tensorflow/python/autograph/pyct/parser.py
Python
apache-2.0
3,936
""" AskHandlers related to order relations: positive, negative, etc. """ from sympy.assumptions import Q, ask from sympy.assumptions.handlers import CommonHandler class AskNegativeHandler(CommonHandler): """ This is called by ask() when key='negative' Test that an expression is less (strict) than zero. ...
lidavidm/mathics-heroku
venv/lib/python2.7/site-packages/sympy/assumptions/handlers/order.py
Python
gpl-3.0
5,970