repo_name
stringlengths
5
104
path
stringlengths
4
248
content
stringlengths
102
99.9k
markreidvfx/pyaaf2
tests/test_auid.py
from __future__ import ( unicode_literals, absolute_import, print_function, division, ) from aaf2.auid import AUID from uuid import UUID import uuid import unittest class MobIDTests(unittest.TestCase): def test_basic(self): s = "0d010101-0101-2100-060e-2b3402060101" v = AUID(s...
lipis/the-smallest-creature
main/api/v1/song.py
# coding: utf-8 from google.appengine.ext import ndb from flask.ext import restful import flask from api import helpers import auth import model import util from main import api_v1 ############################################################################### # Admin ##############################################...
robneville73/OpenEcho
echo/views.py
# Create your views here. from django.shortcuts import render_to_response, get_object_or_404, get_list_or_404 from django.http import Http404 from echo.models import Comment, Reply, CategoryMeta from echo.forms import RegistrationForm, ConfirmRegistration from django.core.urlresolvers import reverse from django.http im...
justephens/ArduMusic
ArduMusic.py
import MuseScoreHelper as MuseScore import SerialHelper while True: # Print a menu of available operations print ("AVAILABLE OPERATIONS:") print (" 1. Connect Device\n") print (" 2. Load Music File\n") print (" 3. Exit Program\n") # Loop until valid input is provided while True:...
exildev/AutoLavadox
maq_autolavadox/bin/pildriver.py
#!/home/dark/Exile/Git/AutoLavadox/maq_autolavadox/bin/python """PILdriver, an image-processing calculator using PIL. An instance of class PILDriver is essentially a software stack machine (Polish-notation interpreter) for sequencing PIL image transformations. The state of the instance is the interpreter stack. The ...
singingwolfboy/flask-dance
tests/consumer/storage/test_sqla.py
import pytest sa = pytest.importorskip("sqlalchemy") import os import responses import flask from flask_sqlalchemy import SQLAlchemy from sqlalchemy import event from flask_caching import Cache from flask_login import LoginManager, UserMixin, current_user, login_user, logout_user from flask_dance.consumer import OAut...
the-it/WS_THEbotIT
archive/online/2015/150914_add_pages_Saint_Germain.py
# -*- coding: utf-8 -*- __author__ = 'eso' import sys sys.path.append('../../') from tools.petscan import PetScan import re import requests import pywikibot list_of_pages =[1134, 1135, 1136, 1137, 1138, 1139, 1140, ...
MHenderson/graph-visualisations
lib/lombardi/LombardiSpirograph.py
"""LombardiSpirograph - draw rotationally symmetric drawings in Lombardi style David Eppstein, UC Irvine, March 2010 For usage information type "python LombardiSpirography.py" without any additional arguments. """ from pyx import canvas,path,color from optparse import OptionParser from math import * import sys # ===...
vtungn/HackaPanzer
Sprite.py
# -*- coding: utf-8 -*- import os import pygame from pygame.locals import * class Sprite(pygame.sprite.Sprite): def __init__(self,SpriteName): pygame.sprite.Sprite.__init__(self) self.Name = SpriteName self.rect = 0 self.image = 0 def getRect(self): return self.rect ...
theMentalItchGuy/NLP
migrations/versions/3cee55aae20_.py
"""empty message Revision ID: 3cee55aae20 Revises: None Create Date: 2015-08-30 22:42:28.320071 """ # revision identifiers, used by Alembic. revision = '3cee55aae20' down_revision = None from alembic import op import sqlalchemy as sa from sqlalchemy.dialects import postgresql def upgrade(): ### commands auto g...
Evert-Arends/AuroraPlusClient
run.py
#!/usr/bin/env python2 # Imports import json import datetime from bin import monitor, register from ClientSettings import ClientSettings from ClientSettings import constants import dataCollector import settings import time import sys Monitor = monitor.Monitor() message1 = "Client script running on version: {0}".form...
monumentum/mongoenginerics
mongoenginerics/adapter/apistar.py
import importlib import json from .base import MongoEnginericsAdapter class ApistarWSGIAdapter(MongoEnginericsAdapter): def __init__(self, *args, **kwargs): self.engine = importlib.import_module('apistar') self._wsgi = importlib.import_module('apistar.frameworks.wsgi') super(ApistarWSGIAda...
clicumu/epo_utils
epo_utils/api.py
# -*- coding: utf-8 -*- """ Module for making calls to EPO-OPS REST-API. This module contain classes and functions to get data from [EPO-OPS API](http://www.epo.org/searching-for-patents/technical/espacenet/ops.html) """ import logging import re import time from base64 import b64encode from collections import namedtup...
PullRequestFive/CmdrData
cmdrdata/cmdrdata.py
import logging import message import os import random import datetime import time import collections from google.appengine.ext.webapp import template try: import simplejson as json except ImportError: import json from abstract_app import AbstractApp class CmdrData(AbstractApp): # A user who has authorized your a...
haystack/eyebrowse-server
api/migrations/0046_auto__add_unique_ratings_user_page.py
# -*- coding: utf-8 -*- from south.utils import datetime_utils as datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding unique constraint on 'Ratings', fields ['user', 'page'] db.creat...
cstewart90/kattis-python
easiest/easiest.py
""" https://open.kattis.com/problems/easiest """ import sys def sum_digits(number): sum_of_digits = 0 while number: sum_of_digits, number = sum_of_digits + number % 10, number // 10 return sum_of_digits for line in sys.stdin: n = int(line) if n == 0: break p = 11 while...
zorchenhimer/NoudaEngine
lib/Level.py
#!/usr/bin/python import pygame import random import math from lib.GameObjects import Player, Enemy from lib.Globals import Vars, FixPath, UnitType, TileImage from lib.Pathing import MovementPath from lib.EventHandler import JoyHandler, KeyHandler from lib.Effects import Explosion from lib.Menu import * from lib.Logge...
EricRho/home-assistant
homeassistant/components/device_tracker/actiontec.py
""" homeassistant.components.device_tracker.actiontec ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Device tracker platform that supports scanning an Actiontec MI424WR (Verizon FIOS) router for device presence. This device tracker needs telnet to be enabled on the router. Configuration: To use the Action...
jimsrc/seatos
shared_lib/shared_funcs.py
#!/usr/bin/env ipython # -*- coding: utf-8 -*- from datetime import datetime, time, timedelta import numpy as np import console_colors as ccl from scipy.io.netcdf import netcdf_file from ShiftTimes import ShiftCorrection, ShiftDts import os, argparse import h5py from h5py import File as h5 from numpy import ( mean...
carlb15/Python
boggle.py
dictionary = {"GEEKS", "FOR", "QUIZ", "GO"} N, M = 3, 3 board = [['G','I','Z'], ['U','E','K'], ['Q','S','E']] class Graph: class Vertex: def __int__(self, v): self.val = v self.adj = [] def findWords(board=board): def search(node, word, visited): if node not in visited: visited.appen...
miraculixx/geocoder
geocoder/api.py
#!/usr/bin/python # coding: utf8 from __future__ import absolute_import from geocoder.osm import Osm from geocoder.w3w import W3W from geocoder.bing import Bing from geocoder.here import Here from geocoder.yahoo import Yahoo from geocoder.baidu import Baidu from geocoder.tomtom import Tomtom from geocoder.arcgis impo...
phalcon/readthedocs.org
readthedocs/core/djangome_urls.py
from django.conf.urls.defaults import patterns, url from urls import urlpatterns as main_patterns ALL_VERSIONS_RE = '(?P<version>.+)' urlpatterns = patterns( '', # base view, flake8 complains if it is on the previous line. url('^$', 'djangome.views.redirect_home', {'version': 'latest'}), ...
lmazuel/azure-sdk-for-python
azure-batch/azure/batch/models/task_id_range.py
# 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 ...
ThiefMaster/indico
indico/modules/events/reminders/forms.py
# This file is part of Indico. # Copyright (C) 2002 - 2021 CERN # # Indico is free software; you can redistribute it and/or # modify it under the terms of the MIT License; see the # LICENSE file for more details. from wtforms.fields import BooleanField, SelectField, TextAreaField from wtforms.validators import DataReq...
cuducos/getgist
getgist/local.py
import os from click import confirm from getgist import GetGistCommons class LocalTools(GetGistCommons): """Helpers to deal with local files and local file system""" def __init__(self, filename, assume_yes=False): """ Sets the file name to be used by the instance. :param filename: (...
tiangolo/fastapi
tests/test_tutorial/test_metadata/test_tutorial001.py
from fastapi.testclient import TestClient from docs_src.metadata.tutorial001 import app client = TestClient(app) openapi_schema = { "openapi": "3.0.2", "info": { "title": "ChimichangApp", "description": "\nChimichangApp API helps you do awesome stuff. 🚀\n\n## Items\n\nYou can **read items**....
KMSkelton/cgm_flask
schema.py
from marshmallow import post_load from marshmallow_sqlalchemy import field_for from models import ma, User, Device, Measurement class UserSchema(ma.Schema): id = field_for(User, 'id', dump_only=True) class Meta: # Fields to expose fields = ('id', 'name', 'username') model = User @...
zhkzyth/a-super-fast-crawler
logmanager.py
#coding:utf8 """ yet another logging wrapper - log level logging.CRITICAL, logging.ERROR, logging.WARNING, logging.INFO, logging.DEBUG """ import logging from config import PROJECT_ROOT def configLogger(logFile="spider.log", logLevel=logging.DEBUG, logTree=""): logFile = PROJECT_ROOT+"/log/"+ logF...
eddiedb6/ej
web/metadata/EJUIMapPage.py
{ "uidPageMap": { W3Const.w3PropType: W3Const.w3TypePanel, W3Const.w3PropSubUI: [ "uidMSMap" ] }, # Map "uidMSMap": { W3Const.w3PropType: W3Const.w3TypeMap, W3Const.w3PropMap: { W3Const.w3AttrMapLocation: "", W3Const.w3Att...
AutorestCI/azure-sdk-for-python
azure-batch/azure/batch/models/cloud_job.py
# 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 ...
Boris-Barboris/rsoi
lab01/client/client_app/views.py
from django.shortcuts import render from django.http import HttpResponse, HttpResponseForbidden, \ HttpResponseRedirect, HttpResponseBadRequest, HttpResponseNotAllowed import logging log = logging.getLogger('client_app') # Create your views here. from .oauthclient import * OAUTH_URL = 'http://192.168.243.5:3900...
mnishida/PyMWM
src/pymwm/cylinder/__init__.py
from __future__ import annotations import cmath import numpy as np import psutil import ray import scipy.special as ssp from pymwm.utils import cylinder_utils from pymwm.waveguide import Database, Sampling, Waveguide from .samples import Samples, SamplesForRay, SamplesLowLoss, SamplesLowLossForRay class Cylinder(...
luizalabs/django-toolkit
django_toolkit/middlewares.py
# -*- coding: utf-8 -*- import logging from django.utils.deprecation import MiddlewareMixin from .shortcuts import get_oauth2_app from .toolkit_settings import API_VERSION, MIDDLEWARE_ACCESS_LOG_FORMAT logger = logging.getLogger(__name__) class VersionHeaderMiddleware(MiddlewareMixin): """ Add a X-API-Vers...
HerlanAssis/scosi
cadastro/migrations/0002_auto_20160224_1443.py
# -*- coding: utf-8 -*- # Generated by Django 1.9.2 on 2016-02-24 17:43 from __future__ import unicode_literals from django.db import migrations, models import django.db.models.manager class Migration(migrations.Migration): dependencies = [ ('cadastro', '0001_initial'), ] operations = [ ...
vladpopovici/WSItk
WSItk/tools/wsi_bot_codebook3.py
#!/usr/bin/env python2 # # wsi_bot_codebook3 # # Version 3 of codebook construction: # # -uses OpenCV for faster operation - but different local descriptors than in the 1st version; # -uses annotation files for defining the regions from where the descriptors are to be # extracted # - try to optimize the codebook with...
mercuree/html-telegraph-poster
html_telegraph_poster/errors.py
# coding=utf8 class Error(Exception): pass class TitleRequiredError(Error): pass class TextRequiredError(Error): pass class APITokenRequiredError(Error): pass class GetImageRequestError(Error): pass class ImageUploadHTTPError(Error): pass class FileTypeNotSupported(Error): pass...
icoxfog417/pyfbi
tests/demo.py
import os import sys import time sys.path.append(os.path.join(os.path.dirname(__file__), "../")) import pyfbi @pyfbi.target def func1(): time.sleep(1) def func2(): time.sleep(2) @pyfbi.target def func3(): time.sleep(3) with pyfbi.watch(): [f() for f in (func1, func2, func3)] pyfbi.show() with py...
benjamincongdon/adept
inventory.py
from item import Item import random from floatingText import FloatingText,FloatingTextManager from playerConsole import PlayerConsole from serializable import Serializable from eventRegistry import Event from eventRegistry import EventRegistry class Inventory(Serializable): INV_SIZE_X = 10 INV_SIZE_Y = 3 ...
cclai999/rango
tango_with_django_project/populate_rango.py
import os os.environ.setdefault('DJANGO_SETTINGS_MODULE','tango_with_django_project.settings') import django django.setup() from rango.models import Category, Page def populate(): # First, we will create lists of dictionaries containing the pages # we want to add into each category. # Then we will create...
StephanH84/reinforcement_learning_explorations
tensorflow/src/MNIST1.py
from tensorflow.examples.tutorials.mnist import input_data mnist = input_data.read_data_sets('MNIST_data', one_hot=True) import tensorflow as tf sess = tf.InteractiveSession() x = tf.placeholder(tf.float32, shape=[None, 784]) y_ = tf.placeholder(tf.float32, shape=[None, 10]) W = tf.Variable(tf.zeros([784,10])) b = t...
kobejohn/PQHelper
pqhelper/easy.py
from pqhelper import base, capture, versus # these parts are heavy so keep one common object for the module _state_investigator = base.StateInvestigator() def versus_summaries(turns=2, sims_to_average=2, async_results_q=None): """Return summaries of the likely resutls of each available action.. Arguments: ...
sfstpala/png.py
png.py
# Copyright (C) 2011 by Stefano Palazzo # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publish,...
Royal-Society-of-New-Zealand/NZ-ORCID-Hub
orcid_api/models/credit_name.py
# coding: utf-8 """ ORCID Member No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) OpenAPI spec version: Latest Generated by: https://github.com/swagger-api/swagger-codegen.git """ from pprint import pformat from six import iteritems import r...
Azure/azure-sdk-for-python
sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_11_01/operations/_private_link_resources_operations.py
# 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 may ...
jshou/bsi
bsi/bsi_parser.py
import ply.yacc as yacc from bsi_lexer import tokens from bsi_object import BsiObject from bsi_array import BsiArray def p_object_pairs(p): 'obj : pairs' p[0] = BsiObject() for pair in p[1]: p[0].set(pair[0], pair[1]) def p_pairs_pair(p): 'pairs : pair' p[0] = [p[1]] def p_pairs_pair_pair...
gnublet/py_explorations
sklearn/exercise_02_sentiment.py
"""Build a sentiment analysis / polarity model Sentiment analysis can be casted as a binary text classification problem, that is fitting a linear classifier on features extracted from the text of the user messages so as to guess wether the opinion of the author is positive or negative. In this examples we will use a ...
Google1234/Information_retrieva_Projectl-
web/main.py
#-*- coding: UTF-8 -*- import os import web import sys sys.path.append("..") import News_Recommend import similar_doc import jieba import config import word2Vec.word2vec as Word2Vec path="../data/netease" query=News_Recommend.CosineScore(path+config.inverted_Dictionary_filename,path+config.inverted_index_filename,conf...
paylogic/atilla
atilla/exceptions.py
"""Exceptions for APIs.""" import werkzeug.exceptions class ApiException(Exception): """An exception raised due to user error. Exceptions derived from ApiException will be logged automatically if raised. User will receive appropriate error response according to the content type. """ descriptio...
jeroendoggen/blackboard-analysis-tools
blackboard_analysis_tools/main.py
""" Blackboard Analysis Tools Copyright 2013, Jeroen Doggen, jeroendoggen@gmail.com """ import sys from blackboard_analysis_tools.blackboard import BlackboardAnalysisTools def run(): """Run the main program""" assignment_analyser = BlackboardAnalysisTools() #assignment_analyser.init() assign...
diego-d5000/MisValesMd
env/lib/python2.7/site-packages/django/contrib/auth/hashers.py
from __future__ import unicode_literals import base64 import binascii import hashlib import importlib from collections import OrderedDict from django.conf import settings from django.core.exceptions import ImproperlyConfigured from django.core.signals import setting_changed from django.dispatch import rece...
attugit/cxxjson
test/conftest.py
from pytest import fixture from itertools import combinations import msgpack as pymsgpack values = [ 42, 7, 3.14, 2.71, 'lorem', 'ipsum', True, False, None, b'lorem', b'ipsum', [], [ 'lorem', 42, 3.14, True, None, ['ipsum']], dict(), { 'lorem': 'ipsum', 'dolor': 42, 'sit': 3.14, 'amet': [ ...
ActiveState/code
recipes/Python/522995_Priority_dict_priority_queue_updatable/recipe-522995.py
from heapq import heapify, heappush, heappop class priority_dict(dict): """Dictionary that can be used as a priority queue. Keys of the dictionary are items to be put into the queue, and values are their respective priorities. All dictionary methods work as expected. The advantage over a standard heap...
tangentstorm/scenetool
spike/vue2svg.py
""" vue2svg : spike/prototype for scenetool. generates an svg scene from VUE files specified on command line. usage: python3.2 vue2svg.py ../test/vue/*.vue https://github.com/tangentstorm/scenetool copyright (c) 2013 michal j wallace. available to the public under the MIT/x11 license. (see ../LICENSE) """ import o...
Staffjoy/client_python
staffjoy/resources/organization.py
from staffjoy.resource import Resource from staffjoy.resources.location import Location from staffjoy.resources.admin import Admin from staffjoy.resources.organization_worker import OrganizationWorker class Organization(Resource): PATH = "organizations/{organization_id}" ID_NAME = "organization_id" def g...
nastya/droidbot
droidbot/adapter/droidbot_ime.py
# coding=utf-8 import logging import time from adapter import Adapter DROIDBOT_APP_PACKAGE = "io.github.ylimit.droidbotapp" IME_SERVICE = DROIDBOT_APP_PACKAGE + "/.DroidBotIME" class DroidBotImeException(Exception): """ Exception in telnet connection """ pass class DroidBotIme(Adapter): """ ...
agronholm/apscheduler
src/apscheduler/datastores/mongodb.py
from __future__ import annotations import operator from collections import defaultdict from contextlib import ExitStack from datetime import datetime, timedelta, timezone from logging import Logger, getLogger from typing import Any, Callable, ClassVar, Iterable from uuid import UUID import attrs import pymongo import...
Azure/azure-sdk-for-python
sdk/formrecognizer/azure-ai-formrecognizer/tests/test_dac_analyze_general_document_async.py
# coding=utf-8 # ------------------------------------ # Copyright (c) Microsoft Corporation. # Licensed under the MIT License. # ------------------------------------ import pytest import functools from devtools_testutils.aio import recorded_by_proxy_async from azure.ai.formrecognizer._generated.models import AnalyzeRe...
CCI-Tools/cate-core
tests/storetest.py
import os import unittest import xcube.core.store as xcube_store from cate.core.ds import DATA_STORE_POOL def _create_test_data_store_config(name: str): local_test_store_path = \ os.path.join(os.path.dirname(__file__), 'ds', 'resources', 'datasources', name) local_test_store_dict = { "store_i...
firedrakeproject/gusto
examples/moist_bf_bubble.py
from gusto import * from gusto import thermodynamics from firedrake import (PeriodicIntervalMesh, ExtrudedMesh, SpatialCoordinate, conditional, cos, pi, sqrt, NonlinearVariationalProblem, NonlinearVariationalSolver, TestFunction, dx, TrialFunction, Constant, Function, ...
JeroenZegers/Nabu-MSSS
nabu/neuralnetworks/models/dblstm_capsnet.py
"""@file dblstm_capsnet.py contains the DBLSTMCapsNet class""" import tensorflow as tf import model from nabu.neuralnetworks.components import layer, ops import pdb class DBLSTMCapsNet(model.Model): """A capsule network with bidirectional recurrent LSTM""" def _get_outputs(self, inputs, input_seq_length, is_trai...
Azure/azure-sdk-for-python
sdk/cognitiveservices/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/filters_py3.py
# 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 ...
caseywstark/colab
colab/apps/ajax_select/fields.py
from ajax_select import get_lookup from django import forms from django.core.urlresolvers import reverse from django.forms.util import flatatt from django.template.defaultfilters import escapejs from django.template.loader import render_to_string from django.utils.safestring import mark_safe from django.utils.translat...
awd4/spnss
datasets/loaders.py
import os import numpy as np import creators from utils import schema_split_helper BASE_DIR = os.path.dirname( os.path.realpath(__file__) ) ''' Load datasets from disk. ''' def load_gd(name, schema=False, split=False): GDIR = os.path.join(BASE_DIR, 'gens.domingos/') trn = np.loadtxt(GDIR+name+'.ts.data',...
rudivs/TaxonLinker
taxonutils.py
#!/usr/bin/env python import csv import difflib try: from settings import FIELD_SEP except ImportError: FIELD_SEP = '\t' class TaxonIndex(): """ TaxonIndex is a class for reading a taxon dictionary file (which must be in the form of a tab-separated CSV text file), and matching genera and taxa ...
prophile/compd
src/screen_db.py
"""Screen database.""" import redis_client import control import re from twisted.internet import defer class ScreenDB(object): """A screen database.""" def __init__(self): """Default constructor.""" pass def set_mode(self, screen, mode): redis_client.connection.set('screen:{0}:mod...
seisman/HinetPy
setup.py
""" Build and install the project. """ from setuptools import find_packages, setup NAME = "HinetPy" AUTHOR = "Dongdong Tian" AUTHOR_EMAIL = "seisman.info@gmail.com" LICENSE = "MIT License" URL = "https://github.com/seisman/HinetPy" DESCRIPTION = ( "A Python package to request and process seismic waveform data from...
ayust/kitnirc
kitnirc/contrib/admintools.py
import logging from kitnirc.client import Channel from kitnirc.modular import Module from kitnirc.user import User _log = logging.getLogger(__name__) def is_admin(controller, client, actor): """Used to determine whether someone issuing a command is an admin. By default, checks to see if there's a line of ...
iandennismiller/gthnk
src/gthnk/server.py
# -*- coding: utf-8 -*- # gthnk (c) Ian Dennis Miller import os import flask import logging from flaskext.markdown import Markdown from mdx_linkify.mdx_linkify import LinkifyExtension from mdx_journal import JournalExtension from . import db, login_manager, bcrypt from .models.day import Day from .models.entry impo...
AustralianAntarcticDataCentre/metadata_xml_convert
print_xsl.py
import logging import os from settings import CONVERSIONS, LOGGING_KWARGS, XSL_PATH logger = logging.getLogger(__name__) def print_xsl_files(): for index, parts in enumerate(CONVERSIONS): file_path = os.path.join(XSL_PATH, parts[0]) print('{}: {}'.format(index + 1, file_path)) if '__main__' == __name__: lo...
jamiebull1/geomeppy
tests/test_regressions.py
"""Tests for issue previously raised and fixed, so we can be alerted if they start failing again.""" import pytest from geomeppy.geom.polygons import Polygon3D from geomeppy.geom.surfaces import set_coords @pytest.fixture def shadow_matching(): shadow_blocks = [ { "name": "PN1001_Bld1000", ...
florensacc/snn4hrl
envs/point/multiMod2D_env.py
from rllab.envs.base import Env from rllab.envs.base import Step from rllab.spaces import Box import numpy as np class MultiMod2DEnv(Env): """ This is a single time-step MDP where the action taken corresponds to the next state (in a 2D plane). The reward has a multi-modal gaussian shape, with the mode mea...
EpicScriptTime/update-wrapper
updatewrapper/__init__.py
import getopt import os import sys from updatewrapper.host import Host from updatewrapper.utils.display import ask_yes_no, print_banner, print_info, print_notice, print_success, print_warning from updatewrapper.utils.file import get_config_file, get_hosts, get_logfile, save_output from updatewrapper.flavor import dete...
Open-E-WEB/django-powerpages
powerpages/tests/test_admin.py
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.test import TestCase from django.conf import settings from django.core.urlresolvers import reverse from django.contrib.auth.models import User from powerpages.models import Page from powerpages.sync import PageFileDumper from powerpages.admi...
GeneralizedLearningUtilities/SuperGLU
python_module/stomp/test/basic_test.py
import os import signal import time import unittest import stomp from stomp import exception from stomp.backward import monotonic from stomp.listener import TestListener from stomp.test.testutils import * class TestBasicSend(unittest.TestCase): def setUp(self): conn = stomp.Connection(get...
lgiordani/slack_hangman
tests/test_guess_manager.py
from main import GuessManager def test_init_uppercase(): g = GuessManager('SOMEWORD') assert g.word == 'SOMEWORD' assert g.mask == [False]*8 def test_init_mask(): mask = [True, False, True, False, True, False, True, False] g = GuessManager('SOMEWORD', mask=mask) assert g.word == 'SOMEWORD' ...
nschloe/meshio
tests/test_ply.py
import pathlib import numpy as np import pytest import meshio from . import helpers @pytest.mark.parametrize( "mesh", [ # helpers.empty_mesh, helpers.tri_mesh, helpers.quad_mesh, helpers.tri_quad_mesh, helpers.add_point_data(helpers.tri_mesh, 1, dtype=int), h...
sciyoshi/dotmod
dotmod.py
import os import imp import sys import six class DotImportHook: def find_module(self, fullname, path=None): bits = fullname.split('.') if len(bits) <= 1: return for folder in sys.path: if os.path.exists(os.path.join(folder, fullname)): return self for i in range(1, len(bits) - 1): package, mod...
datafiniti/Diamond
src/collectors/snmpraw/snmpraw.py
# coding=utf-8 """ The SNMPRawCollector is designed for collecting data from SNMP-enables devices, using a set of specified OIDs #### Configuration Below is an example configuration for the SNMPRawCollector. The collector can collect data any number of devices by adding configuration sections under the *devices* hea...
davidkleiven/PLOD
setup.py
from setuptools import setup ''' The packages subprocess and tkinter is also required from the standard library ''' setup( name='PLOD', version='1.0', description='Matplotlib plot designer', author='David Kleiven', licence='MIT', author_email='davidkleiven446@gmail.com', install_requires=['...
polyaxon/polyaxon-api
polyaxon_lib/datasets/converters/base.py
# -*- coding: utf-8 -*- from __future__ import absolute_import, division, print_function import tensorflow as tf class BaseConverter(object): @staticmethod def to_int64_feature(values): """Returns a TF-Feature of int64s. Args: values: A scalar or list of values. Returns:...
animekita/selvbetjening
sdemo/settings.py
from selvbetjening.settings_base import * ROOT_URLCONF = 'sdemo.urls' # installed applications INSTALLED_APPS.extend([ 'selvbetjening.frontend.base', 'selvbetjening.frontend.auth', 'selvbetjening.frontend.userportal', 'selvbetjening.frontend.eventportal', 'selvbetjening.frontend.eventsingle', ...
myles/twtxt-cli
setup.py
import os from setuptools import setup from twtxtcli import __version__, __project_name__, __project_link__ def read(fname): return open(os.path.join(os.path.dirname(__file__), fname)).read() setup( name=__project_name__, version=__version__, author='Myles Braithwaite', author_email='me@mylesbr...
mchughmk/react-django
backend/api/migrations/0001_initial.py
# -*- coding: utf-8 -*- # Generated by Django 1.11 on 2017-04-28 22:05 from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.Create...
anatolikalysch/VMAttack
lib/VmInstruction.py
# -*- coding: utf-8 -*- """ @author: Tobias Krauss """ from lib.Instruction import Instruction import lib.PseudoInstruction as PI import lib.StartVal as SV from lib.PseudoInstruction import (PseudoInstruction, PseudoOperand) from lib.Register import (get_reg_class, ...
tectronics/yarest
setup.py
## -*- coding: utf-8 -*- # Copyright © 2011-2012 Mike Fled <nonvenia@gmail.com> import codecs, os, re, sys # encoding used for the text files _file_encoding = "utf-8" # get current working directory _cur_dir = os.path.dirname(os.path.realpath(__file__)) # get version string from the yarest package _ver_file = os.pa...
Mikescher/Project-Euler_Befunge
compiled/Python3/Euler_Problem-024.py
#!/usr/bin/env python3 # transpiled with BefunCompile v1.3.0 (c) 2017 import gzip, base64 _g = ("AR+LCAAAAAAABACdUDGOAyEM/AoHW7FBYna5XIKQdQ9B3BUr0VJZKXj8mZAUKXMuzGA8nsHsse3h8/x1uaq3g/RxHNpa8PtcxQ3btQEu/YP8NMA0pWdODzAm0sSU4TLf" + "qw1hRUVItKFGrJ36QD5ThIum/DDZPM4ldiHuaApBkqAaUC1Qfz/6Q3l59bFAFZFs54tluRSpdadvWlUfc8pIojt...
buhii/tomato
tests.py
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Tomato.tests """ import unittest import msgpack import time try: from PIL import Image except ImportError: import Image from tomato.swf_processor import Swf from tomato.exceptions_tomato import MovieClipDoesNotExist from tomato.utils import bits_list2string, B...
mathias4github/ripe-atlas-traceroute2kml
ipdetailscache.py
# Copyright (c) 2014 Pier Carlo Chiodi - http://www.pierky.com # Licensed under The MIT License (MIT) - http://opensource.org/licenses/MIT # # The MIT License (MIT) # ===================== # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation f...
graingert/sqlalchemy
lib/sqlalchemy/dialects/postgresql/__init__.py
# postgresql/__init__.py # Copyright (C) 2005-2020 the SQLAlchemy authors and contributors # <see AUTHORS file> # # This module is part of SQLAlchemy and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php from . import base from . import pg8000 # noqa from . import psycopg2 # noq...
DBrianKimmel/PyHouse
Project/src/Modules/Core/Drivers/Usb/Usb_open.py
""" @name: Modules/CXore/Drivers/USB/usb_open.py @author: D. Brian Kimmel @contact: D.BrianKimmel@gmail.com @copyright: (c) 2011-2020 by D. Brian Kimmel @license: MIT License @note: Created on Mar 27, 2011 @summary: This module is for communicating with USB devices. This will interface various PyHo...
annapowellsmith/openpresc
openprescribing/dmd2/models.py
from django.db import models from . import managers class VTM(models.Model): class Meta: verbose_name = "Virtual Therapeutic Moiety" verbose_name_plural = "Virtual Therapeutic Moieties" ordering = ["nm"] objects = managers.VTMManager() obj_type = "vtm" name_field = "nm" ...
PyRsw/PyRsw
src/Fluxes/SADOURNY_SW.py
import Differentiation as Diff import numpy as np import sys # Geometry: periodic in x and y # Arakawa C-grid # # | | | | # h -- u -- h -- u -- h -- u -- h -- # | | | | # | | | | # v q v q...
vmlaker/mpipe
doc/source/conf.py
# -*- coding: utf-8 -*- # # All configuration values have a default; values that are commented out # serve to show the default. import sys, os # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the # documentation r...
sprymix/importkit
importkit/yaml/validator/tests/test_types.py
## # Copyright (c) 2008-2010 Sprymix Inc. # All rights reserved. # # See LICENSE for details. ## import collections from importkit.yaml import validator from importkit.yaml.validator.tests.base import SchemaTest, raises, result class TestTypes(SchemaTest): def setUp(self): super().setUp() self....
webbhm/OpenAg_MVP_UI
MVP_UI/python/temp_chart.py
# /usr/bin/env python import pygal import requests import json #Use a view in CouchDB to get the data #use the first key for attribute type #order descending so when limit the results will get the latest at the top r = requests.get('http://127.0.0.1:5984/mvp_sensor_data/_design/doc/_view/attribute_value?startkey=["te...
Kalimaha/pact-test
tests/repositories/pact_broker.py
import requests from pact_test.either import * from pact_test.repositories.pact_broker import upload_pact from pact_test.repositories.pact_broker import next_version from pact_test.repositories.pact_broker import format_headers from pact_test.repositories.pact_broker import get_latest_version def test_current_version...
allenwoods/parasys
debug/__init__.py
#! /usr/bin/env python # -*- coding: utf-8 -*- """ @file __init__.py.py @author Allen Woods @date 2016-08-02 @version 16-8-2 上午8:50 ??? Some other Description """ def func(): pass class Main(object): def __init__(self): pass if __name__ == '__main__': pass
jfzhang95/lightML
SupervisedLearning/Neural Layers/methods.py
#!usr/bin/env python #-*- coding:utf-8 -*- """ @author: James Zhang @date: """ import numpy as np import theano import theano.tensor as T from theano.ifelse import ifelse from theano.tensor.shared_randomstreams import RandomStreams from collections import OrderedDict import copy import sys sys.setrecursionlimit(10000...
guilhermef/aws
tc_aws/loaders/s3_loader.py
# coding: utf-8 from boto.s3.bucket import Bucket from thumbor.utils import logger from tornado.concurrent import return_future import urllib2 import thumbor.loaders.http_loader as http_loader from tc_aws.aws.connection import get_connection def _get_bucket(url, root_path=None): """ Returns a tuple contain...
suraj-deshmukh/myCodes
sir.py
def sir(n,I,tt): import matplotlib.pyplot as pt #n=int(input('enter no of population=')) #I=int(input('enter initial infected people=')) #t=int(input('enter time period=')) #dt=int(input('enter step size')) size=tt s=[0 for j in range(size)] i=[0 for j in range(size)] r=[0 for j in range(size)] s[0]=n-I i[0]...