text
stringlengths
6
947k
repo_name
stringlengths
5
100
path
stringlengths
4
231
language
stringclasses
1 value
license
stringclasses
15 values
size
int64
6
947k
score
float64
0
0.34
# -*- coding: utf-8 -*- import unittest import json from api_health.verifier import Verifier class JsonVerifier(unittest.TestCase): def test_constructor_should_be_smart_about_params(self): simple_json = u'{ "foo": "bar" }' json_dict = json.loads(simple_json) try: v1 = Verifier(...
bigodines/api-health
tests/test_verifier.py
Python
mit
1,105
0.00181
# This file is part of Gem. # # Gem 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. # # Gem is distributed in the hope that it wi...
kaye64/gem
content/player.py
Python
gpl-3.0
838
0.001193
from cStringIO import StringIO from datetime import datetime from unidecode import unidecode from handler import Patobj, PatentHandler import re import uuid import xml.sax import xml_util import xml_driver xml_string = 'ipg050104.xml' xh = xml_driver.XMLHandler() parser = xml_driver.make_parser() parser.setContentHan...
namunu/MBS_Patent
parser_test/test.py
Python
bsd-2-clause
962
0.008316
from tests.support.asserts import assert_error, assert_dialog_handled from tests.support.fixtures import create_dialog from tests.support.inline import inline alert_doc = inline("<script>window.alert()</script>") def get_window_rect(session): return session.transport.send( "GET", "session/{session_id}/w...
mbrubeck/servo
tests/wpt/web-platform-tests/webdriver/tests/get_window_rect/user_prompts.py
Python
mpl-2.0
2,153
0.000464
""" Common test utilities for courseware functionality """ from abc import ABCMeta, abstractmethod from datetime import datetime import ddt from mock import patch from urllib import urlencode from lms.djangoapps.courseware.url_helpers import get_redirect_url from student.tests.factories import AdminFactory, UserFacto...
rismalrv/edx-platform
lms/djangoapps/courseware/testutils.py
Python
agpl-3.0
7,642
0.002355
# Copyright (c) 2016 RIPE NCC # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the h...
pierky/ripe-atlas-tools
ripe/atlas/tools/settings/__init__.py
Python
gpl-3.0
7,761
0
# -*- coding: utf-8 -*- # Copyright 2007-2022 The HyperSpy developers # # This file is part of HyperSpy. # # HyperSpy 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 y...
jat255/hyperspy
hyperspy/learn/ornmf.py
Python
gpl-3.0
13,811
0.00029
# -*- coding: utf-8 -*- """ UV Light 2.0 Plugin Copyright (C) 2018 Ishraq Ibne Ashraf <ishraq@tinkerforge.com> __init__.py: Package initialization 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; eit...
Tinkerforge/brickv
src/brickv/plugin_system/plugins/uv_light_v2/__init__.py
Python
gpl-2.0
931
0
# # Copyright (c) SAS Institute 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 w...
sassoftware/conary
conary/local/schema.py
Python
apache-2.0
36,311
0.003883
def __bootstrap__(): global __bootstrap__, __loader__, __file__ import sys, pkg_resources, imp __file__ = pkg_resources.resource_filename(__name__,'win32service.pyd') __loader__ = None; del __bootstrap__, __loader__ imp.load_dynamic(__name__,__file__) __bootstrap__()
JulienMcJay/eclock
windows/Python27/Lib/site-packages/pywin32-218-py2.7-win32.egg/win32service.py
Python
gpl-2.0
283
0.035336
# Copyright (c) 2018 PaddlePaddle 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 app...
reyoung/Paddle
python/paddle/fluid/layers/ops.py
Python
apache-2.0
3,701
0.00027
# 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...
Huyuwei/tvm
tests/webgl/test_static_webgl_library.py
Python
apache-2.0
2,490
0.001606
import _plotly_utils.basevalidators class XpadValidator(_plotly_utils.basevalidators.NumberValidator): def __init__( self, plotly_name="xpad", parent_name="scatter.marker.colorbar", **kwargs ): super(XpadValidator, self).__init__( plotly_name=plotly_name, parent_name=pa...
plotly/plotly.py
packages/python/plotly/plotly/validators/scatter/marker/colorbar/_xpad.py
Python
mit
460
0.002174
import sys import pkg_resources from style.styled_string_builder import _StyledStringBuilder try: __version__ = pkg_resources.get_distribution('style').version except Exception: __version__ = 'unknown' _enabled = sys.stdout.isatty() if '--color' in sys.argv: _enabled = True elif '--no-color' in sys.argv:...
lmittmann/clr
style/__init__.py
Python
mit
533
0
from django import http import mock from nose.tools import eq_ from olympia.amo.tests import TestCase from olympia.addons import decorators as dec from olympia.addons.models import Addon class TestAddonView(TestCase): def setUp(self): super(TestAddonView, self).setUp() self.addon = Addon.object...
jpetto/olympia
src/olympia/addons/tests/test_decorators.py
Python
bsd-3-clause
5,023
0
''' Created on 3 cze 2014 @author: Przemek ''' from src.items.bytes import Bytes from src.parser.measurable import Measurable class StringIdItem(Measurable): ''' classdocs ''' def __init__(self, parent): ''' Constructor ''' Measurable.__init__(self, parent) ...
PrzemekBurczyk/dalvik-compiler
src/items/string_id_item.py
Python
mit
347
0.005764
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2010 OpenStack LLC. # 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/...
superstack/nova
nova/tests/api/openstack/__init__.py
Python
apache-2.0
3,850
0.000519
#!/usr/bin/env python # -*- encoding: utf-8 -*- # Modules used for ETL - Create User # Modules required: import os import xmlrpclib, sys, csv, ConfigParser from datetime import datetime # Set up parameters (for connection to Open ERP Database) ********************* config = ConfigParser.ConfigParser() file_config = o...
Micronaet/micronaet-quality
quality/etl/errata_corrige.py
Python
agpl-3.0
1,215
0.014815
''' 3D Rotating Monkey Head ======================== This example demonstrates using OpenGL to display a rotating monkey head. This includes loading a Blender OBJ file, shaders written in OpenGL's Shading Language (GLSL), and using scheduled callbacks. The monkey.obj file is an OBJ file output from the Blender free 3...
Cheaterman/kivy
examples/3Drendering/main.py
Python
mit
2,405
0
# Copyright 2019 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...
alexgorban/models
official/nlp/xlnet/xlnet_config.py
Python
apache-2.0
6,110
0.003764
#!/usr/bin/env python3 import sys from mltm.cli import add_entry, show_entries if __name__ == '__main__': n = len(sys.argv[1:]) if n == 0: show_entries() elif sys.argv[1] == 'add': add_entry() else: show_entries(sys.argv[1])
sanchopanca/my-long-term-memory
app.py
Python
apache-2.0
269
0
import os path = os.path.dirname(os.path.realpath(__file__)) sbmlFilePath = os.path.join(path, 'BIOMD0000000102.xml') with open(sbmlFilePath,'r') as f: sbmlString = f.read() def module_exists(module_name): try: __import__(module_name) except ImportError: return False else: ret...
biomodels/BIOMD0000000102
BIOMD0000000102/model.py
Python
cc0-1.0
427
0.009368
import difflib import json import connexion from flask import Response, abort, jsonify from auslib.blobs.base import BlobValidationError, createBlob from auslib.db import OutdatedDataError, ReadOnlyError from auslib.global_state import dbo from auslib.web.admin.views.base import AdminView, requirelogin, serialize_sig...
testbhearsum/balrog
src/auslib/web/admin/views/releases.py
Python
mpl-2.0
26,017
0.003306
# Copyright 2013 IBM Corp. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed t...
openstack/tempest
tempest/test_discover/test_discover.py
Python
apache-2.0
1,891
0
import Adafruit_BBIO.PWM as PWM class Servo: def __init__(self, pin): self.servo_pin = pin self.duty_min = 3 self.duty_max = 14.5 self.duty_span = self.duty_max - self.duty_min def StartServo(self): print("Starting servo") print(self.servo_pin) PWM.start(self.servo_pin, (100 - self.duty_min), 60.0...
sahdman/Plane
Servo.py
Python
gpl-3.0
804
0.039801
from __future__ import absolute_import from Components.VariableValue import VariableValue from Components.Renderer.Renderer import Renderer from enigma import eSlider class Progress(VariableValue, Renderer): def __init__(self): Renderer.__init__(self) VariableValue.__init__(self) self.__start = 0 self.__end ...
atvcaptain/enigma2
lib/python/Components/Renderer/Progress.py
Python
gpl-2.0
1,048
0.02958
from distutils.core import setup setup(name="card", author="Benoit Michau", author_email="michau.benoit@gmail.com", url="http://michau.benoit.free.fr/codes/smartcard/", description="A library to manipulate smartcards used in telecommunications systems (SIM, USIM)", long_description=open("...
1mentat/card
setup.py
Python
gpl-2.0
417
0.002398
# Test methods with long descriptive names can omit docstrings # pylint: disable=missing-docstring from unittest.mock import MagicMock import numpy as np from AnyQt.QtCore import QRectF from Orange.data import Table, Domain, ContinuousVariable, DiscreteVariable from Orange.widgets.tests.base import WidgetTest, Widge...
cheral/orange3
Orange/widgets/visualize/tests/test_owscatterplot.py
Python
bsd-2-clause
3,898
0.000257
'''Autogenerated by xml_generate script, do not edit!''' from OpenGL import platform as _p, arrays # Code generation uses this from OpenGL.raw.GLX import _types as _cs # End users want this... from OpenGL.raw.GLX._types import * from OpenGL.raw.GLX import _errors from OpenGL.constant import Constant as _C import ctype...
stack-of-tasks/rbdlpy
tutorial/lib/python2.7/site-packages/OpenGL/raw/GLX/OML/sync_control.py
Python
lgpl-3.0
1,569
0.045252
import conv import tools from ..api.clss import api from ..sql.clss import sql from pandas import DataFrame import time as tm class data(object): def __init__(self): self.a = api() self.s = sql() self.jobs = [] self.trd = DataFrame() self.prc = DataFrame() def add_tra...
rosspalmer/bitQuant
bitquant/data/clss.py
Python
mit
3,127
0.011193
#! /usr/bin/env python try: from setuptools import setup except ImportError: from distutils.core import setup import sys import taskit long_description = '''TaskIt -- A light-weight task management library. TaskIt is a light-weight library to turn a function into a full-featured, threadable task. It is com...
pydsigner/taskit
setup.py
Python
lgpl-3.0
1,455
0.003436
""" spring2.py The rk4_two() routine in this program does a two step integration using an array method. The current x and xprime values are kept in a global list named 'val'. val[0] = current position; val[1] = current velocity The results are compared with analytically calculated values. """ from pylab import * d...
wavicles/pycode-browser
Code/Physics/spring2.py
Python
gpl-3.0
1,784
0.040919
#!/usr/bin/env python # reflect input bytes to output, printing as it goes import serial, sys, optparse, time parser = optparse.OptionParser("davis_log") parser.add_option("--baudrate", type='int', default=57600, help='baud rate') opts, args = parser.parse_args() if len(args) != 2: print("usage: reflector.py <D...
tridge/DavisSi1000
Firmware/tools/davis_log.py
Python
bsd-2-clause
715
0.004196
# -*- coding: utf-8 -*- ''' File encryption for stash Uses AES in CBC mode. usage: crypt.py [-h] [-k KEY] [-d] infile [outfile] positional arguments: infile File to encrypt/decrypt. outfile Output file. optional arguments: -h, --help show this help message and exit -k KEY, --ke...
ywangd/stash
bin/crypt.py
Python
mit
2,462
0.001219
# -*- coding: utf-8 -*- from __future__ import unicode_literals import sys from winsys._compat import unittest import uuid import winerror import win32api import win32con import win32evtlog import win32security import pywintypes from winsys.tests import utils as testutils from winsys import event_logs, registry, uti...
operepo/ope
laptop_credential/winsys/tests/test_event_logs.py
Python
mit
6,794
0.002944
#!/usr/bin/env python # -*- coding:utf-8 -*- # from __future__ import unicode_literals import codecs import sys reload(sys) sys.setdefaultencoding('utf8') # ranges of ordinals of unicode ideographic characters ranges = [ {"from": ord(u"\u3300"), "to": ord(u"\u33ff")}, # compatibility ideographs {"from": ord...
jntkym/rappers
utils.py
Python
mit
1,664
0.001202
# -*- coding:utf-8 -*- import os import random import sys import importlib importlib.reload(sys) UNK_ID = 3 train_encode_file = 'data/middle_data/train.enc' train_decode_file = 'data/middle_data/train.dec' test_encode_file = 'data/middle_data/test.enc' test_decode_file = 'data/middle_data/test.dec' train_encode_vo...
xinruobingqing/robotChat
vector.py
Python
apache-2.0
1,599
0.012203
from __future__ import unicode_literals import pytest @pytest.fixture def doc(EN): return EN('This is a sentence. This is another sentence. And a third.') @pytest.mark.models def test_sent_spans(doc): sents = list(doc.sents) assert sents[0].start == 0 assert sents[0].end == 5 assert len(sents)...
lukw00/spaCy
tests/spans/test_span.py
Python
mit
579
0.001727
#!/usr/bin/env python # encoding: utf-8 import sys import subprocess from flask_script import Manager from flask_script.commands import ShowUrls from flask_migrate import MigrateCommand from application import create_app from application.extensions import db from utils.commands import GEventServer, ProfileServer ma...
luke0922/celery_learning
manage.py
Python
apache-2.0
1,290
0.000775
# # Copyright (c) 2004 Conectiva, Inc. # # Written by Gustavo Niemeyer <niemeyer@conectiva.com> # # This file is part of Smart Package Manager. # # Smart Package Manager 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 Fou...
dmacvicar/spacewalk
client/solaris/smartpm/smart/sorter.py
Python
gpl-2.0
22,108
0.001357
#! /usr/bin/env python """ # control_get_firmware.py: get firmware version of Gemalto readers # Copyright (C) 2009-2012 Ludovic Rousseau """ # 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 Foun...
sixtyfive/pcsc-ctapi-wrapper
PCSC/UnitaryTests/control_get_firmware.py
Python
lgpl-2.1
2,053
0.001461
from corpsearchsystem import CorpSearchSystem from modules.editdistance.normalized import \ NormalizedEditDistanceQueryToHandle,\ NormalizedEditDistanceQueryToDisplayName from modules.editdistance.lengths import \ LengthOfQuery, LengthOfHandle, LengthOfDisplayName from modules.editdistance.stopwords import...
WING-NUS/corpSearch
system/systems.py
Python
lgpl-3.0
2,889
0
#!/usr/bin/env python from __future__ import division from math import * import numpy as np from numpy.fft import fft, fftshift, fftfreq def fermi(x, smearing): """Return Fermi function""" return 1./(1. + np.exp(x/smearing)) def step(x, delta, smearing): """Return smoothed step-function Fermi(x-Delta)-Fe...
ottodietz/rough-q1d
q1d/q1d_step.py
Python
gpl-3.0
2,411
0.014932
from cred.models import CredChangeQ from django.conf import settings from django.utils import timezone def base_template_reqs(request): cntx = { 'pageurl': request.path, 'LDAP_ENABLED': settings.LDAP_ENABLED, 'GOAUTH2_ENABLED': settings.GOAUTH2_ENABLED, 'EXPORT_ENABLED': not settin...
ipernet/RatticWeb
ratticweb/context_processors.py
Python
gpl-2.0
1,262
0.001585
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.test import TestCase from django.contrib.auth import get_user_model from django.core.urlresolvers import reverse import json from model_mommy import mommy from io import BytesIO from PIL import Image from tiny_rest.tests import Client import s...
allisson/django-tiny-rest
testproject/blog/tests/test_views.py
Python
mit
10,142
0
# -*- coding: utf-8 -*- # Generated by Django 1.10.1 on 2016-09-18 06:21 from __future__ import unicode_literals from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('CareerTinder', '0004_auto_20160918_0152'), ] operations = [ migrations.RenameField(...
sarojaerabelli/HVGS
CareerTinderServer/CareerTinder/migrations/0005_auto_20160918_0221.py
Python
mit
573
0
import pygame import time import scripts """ Score class Handles all the score area package: ianna """ class IannaScore(): def __init__ (self, buffer, screen, game_entities): self.score_image = pygame.image.load('artwork/marcador.png').convert() self.font = pygame.image.load('artwork/font.png').convert() ...
fjpena/sword-of-ianna-zx
python_src/ianna_score.py
Python
apache-2.0
6,072
0.049407
from sympy.core import pi, oo, symbols, Function, Rational, Integer, GoldenRatio, EulerGamma, Catalan, Lambda, Dummy from sympy.functions import Piecewise, sin, cos, Abs, exp, ceiling, sqrt from sympy.utilities.pytest import raises from sympy.printing.jscode import JavascriptCodePrinter from sympy.utilities.lambdify im...
srjoglekar246/sympy
sympy/printing/tests/test_jscode.py
Python
bsd-3-clause
8,432
0.010911
import logging log = logging.getLogger(__name__) def has_bin(arg): """ Helper function checks whether args contains binary data :param args: list | tuple | bytearray | dict :return: (bool) """ if type(arg) is list or type(arg) is tuple: return reduce(lambda has_binary, item: has_binar...
shuoli84/gevent_socketio2
socketio/__init__.py
Python
mit
583
0.003431
import codecs import os import re from setuptools import Command, find_packages, setup here = os.path.abspath(os.path.dirname(__file__)) version = "0.0.0" changes = os.path.join(here, "CHANGES.rst") match = r"^#*\s*(?P<version>[0-9]+\.[0-9]+(\.[0-9]+)?)$" with codecs.open(changes, encoding="utf-8") as changes: f...
allisson/python-vindi
setup.py
Python
mit
1,845
0
# -*- coding: utf-8 -*- # © 2016 FactorLibre - Hugo Santos <hugo.santos@factorlibre.com> # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). from . import computed_purchase_order
factorlibre/odoo-addons-cpo
purchase_compute_order_product_filter_season/models/__init__.py
Python
agpl-3.0
197
0
# ##### BEGIN GPL LICENSE BLOCK ##### # # 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 distrib...
elfnor/sverchok
nodes/vector/interpolation_mk2.py
Python
gpl-3.0
7,301
0.003013
from functions import global_functions def debug_step_here(): """ Creates a Breakpoint when executed in debug-mode :return: """ if global_functions.get_config_key("debug"): try: input("Press any key to continue") except SyntaxError: pass def print_out_var...
Fahrenholz/maat-analyzer
functions/debugging_functions.py
Python
gpl-3.0
537
0.005587
import os.path import urllib.parse import requests import rfc6266 import settings import utilities from markdown import Extension from markdown.inlinepatterns import ImagePattern, IMAGE_LINK_RE class ImageDownloadPattern(ImagePattern): def handleMatch(self, match): el = super(ImageDownloadPattern, self)...
Tigge/trello-to-web
markdown_imaged.py
Python
mit
1,141
0.003506
#!/usr/bin/env python # -*- coding: utf-8 -*- """Tests for rsyslog state checks.""" from grr.lib import flags from grr.lib import test_lib from grr.lib.checks import checks_test_lib from grr.parsers import config_file class RsyslogCheckTests(checks_test_lib.HostCheckTest): """Test the rsyslog checks.""" @class...
pidydx/grr
grr/checks/rsyslog_test.py
Python
apache-2.0
1,801
0.004442
import logging # This is a minimal configuration to get you started with the Text mode. # If you want to connect Errbot to chat services, checkout # the options in the more complete config-template.py from here: # https://raw.githubusercontent.com/errbotio/errbot/master/errbot/config-template.py BACKEND = 'Text' # E...
PeytonXu/learn-python
cases/errbot/config.py
Python
mit
761
0.011827
#!/usr/bin/env python ## # This file is part of the uSherpa Python Library project # # Copyright (C) 2012 Stefan Wendler <sw@kaltpost.de> # # The uSherpa Python 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 Sof...
wendlers/usherpa-pysherpa
setup.py
Python
lgpl-2.1
1,459
0.023304
# -*- coding: utf-8 -*- from __future__ import print_function from __future__ import unicode_literals from __future__ import division import string import re import sass import json from django.utils.translation import ugettext as _ from django.core.urlresolvers import reverse from django.conf import settings from dj...
maurizi/otm-core
opentreemap/treemap/views/misc.py
Python
agpl-3.0
8,998
0
# generated from catkin/cmake/template/pkg.context.pc.in CATKIN_PACKAGE_PREFIX = "" PROJECT_PKG_CONFIG_INCLUDE_DIRS = "".split(';') if "" != "" else [] PROJECT_CATKIN_DEPENDS = "".replace(';', ' ') PKG_CONFIG_LIBRARIES_WITH_PREFIX = "".split(';') if "" != "" else [] PROJECT_NAME = "ur_description" PROJECT_SPACE_DIR = "...
robotic-ultrasound-image-system/ur5
build/ur5-master/universal_robot-kinetic-devel/ur_description/catkin_generated/pkg.installspace.context.pc.py
Python
apache-2.0
380
0
#! /usr/bin/env python # Copyright (C) 2005 # ASTRON (Netherlands Institute for Radio Astronomy) # P.O.Box 2, 7990 AA Dwingeloo, The Netherlands # # This file is part of the LOFAR software suite. # The LOFAR software suite is free software: you can redistribute it and/or # modify it under the terms of the GNU General ...
jjdmol/LOFAR
LCS/Tools/src/makeClass.py
Python
gpl-3.0
17,838
0.029432
# (C) British Crown Copyright 2016, Met Office # # This file is part of Biggus. # # Biggus 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 late...
pelson/biggus
biggus/tests/unit/init/__init__.py
Python
gpl-3.0
882
0
# Copyright 2017 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import css_checker import html_checker import js_checker import resource_checker def IsResource(f): return f.LocalPath().endswith(('.html', '.css', '.js...
endlessm/chromium-browser
tools/web_dev_style/presubmit_support.py
Python
bsd-3-clause
1,332
0.010511
#!/usr/bin/env python import os import sys if __name__ == "__main__": os.environ.setdefault("DJANGO_SETTINGS_MODULE", "sentinel.settings.local") from django.core.management import execute_from_command_line execute_from_command_line(sys.argv)
MikaelSchultz/dofiloop-sentinel
sentinel/manage.py
Python
mit
257
0
# Extension imports from flask.ext.wtf import Form, RecaptchaField from flask_wtf.html5 import TelField, IntegerField from wtforms import StringField, PasswordField, BooleanField, SubmitField, TextAreaField, SelectField, DecimalField from wtforms.validators import Email, DataRequired, EqualTo #from flask_wtf.file imp...
takwas/flask_app_template
template_app/forms.py
Python
mit
2,863
0.028292
"""Tests for distutils.archive_util.""" __revision__ = "$Id: test_archive_util.py 86596 2010-11-20 19:04:17Z ezio.melotti $" import unittest import os import tarfile from os.path import splitdrive import warnings from distutils.archive_util import (check_archive_formats, make_tarball, ...
MalloyPower/parsing-python
front-end/testsuite-python-lib/Python-3.2/Lib/distutils/tests/test_archive_util.py
Python
mit
7,249
0.001104
#!/usr/bin/env python # -*- coding: utf-8 -*- from nose.tools import ok_ import os from py_utilities.fs.path_utilities import expanded_abspath from py_utilities.fs.path_utilities import filename from py_utilities.fs.path_utilities import get_first_dir_path from py_utilities.fs.path_utilities import get_first_file_path...
ryankanno/py-utilities
tests/fs/test_path_utilities.py
Python
mit
1,597
0
#!/usr/bin/env python # # GrovePi Hardware Test # Connect Buzzer to Port D8 # Connect Button to Analog Port A0 # # The GrovePi connects the Raspberry Pi and Grove sensors. You can learn more about GrovePi here: http://www.grovepi.com # # Have a question about this example? Ask on the forums here: http://www.dexteri...
dmazzer/nors
remote/GrovePi/Software/Python/GrovePi_Hardware_Test.py
Python
mit
2,308
0.011698
# -*- coding:utf-8 -*- import unittest import mock from ...haystack.utils import get_indexes class GetIndexesTestCase(unittest.TestCase): @mock.patch('libs.haystack.utils.connections') @mock.patch('libs.haystack.utils.connection_router.for_write') def test_get_indexes_should_yield_get_index( ...
hellhovnd/dentexchange
dentexchange/apps/libs/tests/haystack/test_get_indexes.py
Python
bsd-3-clause
1,159
0.001726
from bs4 import BeautifulSoup import helper from datetime import datetime import click import time import calendar #Example values #START_DATE = datetime(2014, 05, 15) #END_DATE = datetime(2015, 05, 15) #DAY_DELTA = 7 #TIMEOUT_SECONDS = 30 #Example Command #python Scraper.py 2014/05/25 2015/05/15 4 0 YYZ POS @click....
j2ali/FlightScraper
Scraper.py
Python
bsd-3-clause
1,950
0.007179
""" WSGI config for smarterer project. It exposes the WSGI callable as a module-level variable named ``application``. For more information on this file, see https://docs.djangoproject.com/en/1.8/howto/deployment/wsgi/ """ import os from django.core.wsgi import get_wsgi_application os.environ.setdefault("DJANGO_SET...
agronick/WebServiceExample
smarterer/smarterer/wsgi.py
Python
gpl-2.0
395
0
# -*- coding: utf-8 -*- # Generated by Django 1.11.4 on 2017-08-09 03:42 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('debate', '0009_auto_20170807_2329'), ] operations = [ migrations.AlterField...
steventimberman/masterDebater
debate/migrations/0010_auto_20170808_2242.py
Python
mit
466
0
# -*- coding: utf-8 -*- import unittest from mock import MagicMock, patch from munch import munchify from openprocurement.edge.traversal import Root class TestTraversal(unittest.TestCase): def test_Root(self): request = munchify({'registry': {'db': 'database'}}) root = Root(request) self....
openprocurement/openprocurement.edge
openprocurement/edge/tests/traversal.py
Python
apache-2.0
638
0.001567
""" Unit tests for LTI 1.3 consumer implementation """ from unittest.mock import MagicMock, patch import ddt from Cryptodome.PublicKey import RSA from django.test.testcases import TestCase from rest_framework import exceptions from lti_consumer.lti_1p3.consumer import LtiConsumer1p3 from lti_consumer.lti_1p3.extensi...
edx/xblock-lti-consumer
lti_consumer/lti_1p3/tests/extensions/rest_framework/test_authentication.py
Python
agpl-3.0
4,164
0.00024
from __future__ import print_function import sys sys.path.append('..') from src.sim import Sim from src.packet import Packet from networks.network import Network class BroadcastApp(object): def __init__(self, node): self.node = node def receive_packet(self, packet): print(Sim.scheduler.cu...
zappala/bene
examples/broadcast.py
Python
gpl-2.0
2,081
0.001922
import random # -------------------------------------------------------------- # DEFINITION of the Coriolis stencil object coriolis = Stencil ( ) # # add the U stage to the Coriolis stencil # uSlowTensStage = coriolis.addStage ( ) @uSlowTensStage.attachDo def uStageDo (utens, v, fc): """ ...
lichinka/pystella
coriolis_alla_stella.py
Python
bsd-2-clause
3,432
0.015443
from . import series from . import images def _setup(): import logging logger = logging.getLogger(__name__) logger.setLevel(logging.INFO) formatter = logging.Formatter('[%(name)s] %(levelname)s %(message)s') ch = logging.StreamHandler() ch.setFormatter(formatter) logger.addHandler(ch) _set...
jwittenbach/thunder
thunder/__init__.py
Python
apache-2.0
347
0.008646
#!/usr/bin/env python import sys str = sys.stdin.read().decode('utf-8') characters = set(str) for c in characters: print c.encode('utf-8') # EOF #
Lily-Ayta/aosc-os-abbs
extra-games/pingus/autobuild/overrides/usr/share/pingus/images/fonts/buildset.py
Python
gpl-2.0
155
0.006452
from battle_tested.beta.input_type_combos import input_type_combos
CodyKochmann/battle_tested
battle_tested/beta/fuzz_planner.py
Python
mit
68
0.014706
# Copyright 2013 Huawei Technologies Co., Ltd # 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 # # Unl...
Hybrid-Cloud/cinder
cinder/tests/unit/api/contrib/test_quotas_classes.py
Python
apache-2.0
6,020
0
#! /usr/bin/env python # -*- coding: utf-8 -*- # vim: set et sw=4 fenc=utf-8: # # Copyright 2016 INVITE Communications Co., Ltd. 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 Founda...
invitecomm/asterisk-ivr
pigeonhole/wardial.py
Python
gpl-3.0
3,694
0.004061
#!/usr/bin/env python from __future__ import print_function ''' display a image in a subprocess Andrew Tridgell June 2012 ''' import time from MAVProxy.modules.lib.wx_loader import wx import cv2 import numpy as np import warnings from MAVProxy.modules.lib import mp_util from MAVProxy.modules.lib import mp_widgets f...
Dronecode/MAVProxy
MAVProxy/modules/lib/mp_image.py
Python
gpl-3.0
20,342
0.00295
# -*- coding: utf-8 -*- # # Copyright (C) 2012-2013 Edgewall Software # 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://trac.edgewall.org/wiki/TracLicense. # # This software consi...
dafrito/trac-mirror
tracopt/versioncontrol/svn/tests/__init__.py
Python
bsd-3-clause
731
0.002736
# Copyright 2021 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ...
googleapis/python-recaptcha-enterprise
samples/snippets/migrate_site_key.py
Python
apache-2.0
1,870
0.001604
# Copyright (c) 2018 PaddlePaddle 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...
Canpio/Paddle
python/paddle/fluid/tests/unittests/test_elementwise_pow_op.py
Python
apache-2.0
1,482
0
from django.http import JsonResponse from django.shortcuts import render from django.views.generic import View # model #from drawroute.models import * # Create your views here. class MapHandler(View): '''This class manages the map where lines are drawn ''' def __init__(self): self.context={} def get(s...
SmartcitySantiagoChile/onlineGPS
drawroute/views.py
Python
mit
422
0.018957
from .shape import Shape from .shape import Pane from .shape import mergeBoundary from .shape import offsetBoundary class StrokePath(Shape): def __init__(self, segments): self.segments = segments boundary = self.computeBoundary() self.pane = Pane(*boundary) def __eq__(self, other): return (isinstance(other...
xrloong/Xie
src/xie/graphics/stroke_path.py
Python
apache-2.0
24,937
0.0473
# 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-servicefabric/azure/servicefabric/models/fabric_error.py
Python
mit
1,580
0.000633
########################################################################## # # Processor specific code # CPU = "Z80" # Description = "Zilog 8-bit microprocessor." # DataWidth = 8 # 8-bit data # AddressWidth = 16 # 16-bit addresses # Maximum length of an instruction (for formatting purposes) maxLength = 4 # Leadin ...
jefftranter/udis
z80.py
Python
apache-2.0
32,759
0.094142
#!/usr/bin/env python from __future__ import print_function import roslib roslib.load_manifest('lane_detection') import rospy import sys from std_msgs.msg import Int32 import cv2 from sensor_msgs.msg import Image from cv_bridge import CvBridge, CvBridgeError from picamera import PiCamera from picamera.array import PiRG...
isarlab-department-engineering/ros_dt_lane_follower
deprecated_nodes/old-lane-detection.py
Python
bsd-3-clause
9,077
0.048695
from bee import * from bee.segments import * import libcontext from libcontext.socketclasses import * from libcontext.pluginclasses import * def get_worker(name, xyz): class moverel(worker): """Relative movement along %s axis""" % xyz __beename__ = name moverel = antenna("push", "float") ...
agoose77/hivesystem
dragonfly/scene/bound/moverel.py
Python
bsd-2-clause
978
0.002045
# Copyright 2013 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 requ...
zhimin711/nova
nova/virt/imagecache.py
Python
apache-2.0
4,660
0.000215
import datetime from decimal import Decimal as D, InvalidOperation from django.contrib import messages from django.utils.translation import ugettext_lazy as _ from django.core.urlresolvers import reverse from django.core.exceptions import ObjectDoesNotExist from django.db.models.loading import get_model from django.db...
Idematica/django-oscar
oscar/apps/dashboard/orders/views.py
Python
bsd-3-clause
28,253
0.000035
import json SHOWNAMES_DICT = { "lipsyncbattle": "Lip Sync Battle", "archer2009": "Archer (2009)", "thedailyshow": "The Daily Show", "atmidnight": "@midnight" } with open("test_file.json", "w") as f: json.dump(SHOWNAMES_DICT, f, indent=4)
ROldford/tvregex
tests/experiments/json_test.py
Python
mit
261
0
#!/usr/bin/env python #encoding: utf8 import rospy, actionlib from std_msgs.msg import UInt16 from pimouse_ros.msg import MusicAction, MusicResult, MusicFeedback def write_freq(hz=0): bfile = "/dev/rtbuzzer0" try: with open(bfile,"w") as f: f.write(str(hz) + "\n") except IOError: ...
e1211205/pimouse_ros
scripts/buzzer4.py
Python
gpl-3.0
701
0.011412
#!/usr/bin/env python ''' Created on Dec 6, 2013 :author: jzupka ''' import os import logging import select import cPickle import time import remote_interface import cStringIO import base64 class IOWrapper(object): """ Class encaptulates io opearation to be more consist in different implementations. (...
rbian/avocado-vt
virttest/remote_commander/messenger.py
Python
gpl-2.0
7,889
0.000127
""" Experimental agent implementation running separate threads for emulation and GPU training. This is slightly (estimate ~20%) faster than the sequential implementation, but results might be different. Copyright 2016 Rasmus Larsen This software may be modified and distributed under the terms of the MIT license. See ...
rlrs/deep-rl
dqn/ParallelAgent.py
Python
mit
2,448
0.003268
from __future__ import unicode_literals from django.test import TestCase from .models import A, B, D, Bar, DataPoint, Foo, RelatedPoint class SimpleTest(TestCase): def setUp(self): self.a1 = A.objects.create() self.a2 = A.objects.create() for x in range(20): B.objects.create(...
Endika/django
tests/update/tests.py
Python
bsd-3-clause
5,112
0.000196
#!/usr/bin/env python import os import sys import argparse import subprocess from shutil import copyfile def main(): progname = os.path.basename(sys.argv[0]) usage = progname + """ [options] <*.png> convert -average *.png output.png In total 210 images, first average 15, then 14. """ args_def = {} parser = ...
emkailu/PAT3DEM
bin/p3convert.py
Python
mit
998
0.036072
from createsend import * auth = { 'access_token': 'YOUR_ACCESS_TOKEN', 'refresh_token': 'YOUR_REFRESH_TOKEN' } listId = 'YOUR_LIST_ID' emailAddress = 'YOUR_SUBSCRIBER_EMAIL_ADDRESS' subscriber = Subscriber(auth, listId, emailAddress) # Get the details for a subscriber subscriberDetail = subscriber.get...
campaignmonitor/createsend-python
samples/subscribers.py
Python
mit
411
0.004866
""" # lint-amnesty, pylint: disable=cyclic-import XFields for video module. """ import datetime from xblock.fields import Boolean, DateTime, Dict, Float, List, Scope, String from xmodule.fields import RelativeTime # Make '_' a no-op so we can scrape strings. Using lambda instead of # `django.utils.translation.ug...
eduNEXT/edx-platform
common/lib/xmodule/xmodule/video_module/video_xfields.py
Python
agpl-3.0
9,242
0.004653