code
stringlengths
2
1.05M
repo_name
stringlengths
5
104
path
stringlengths
4
251
language
stringclasses
1 value
license
stringclasses
15 values
size
int32
2
1.05M
import t class b08(t.Test): class TestResource(t.Resource): def is_authorized(self, req, rsp): if req.headers.get('authorization') == 'yay': return True return 'oauth' def to_html(self, req, rsp): return "nom nom" def test_...
benoitc/pywebmachine
tests/decisions/b08_test.py
Python
mit
664
import urllib2 import base64 import simplejson as json import logging from urllib import urlencode from functools import partial log = logging.getLogger(__name__) log_formatter = logging.Formatter('%(name)s - %(message)s') log_handler = logging.StreamHandler() log_handler.setFormatter(log_formatter) log.addHandler(lo...
rozap/arb
src/api/campbx.py
Python
mit
3,615
# coding=utf-8 import random import math import n_queen def simulated_annealing_search(problem): # annealing parameters alpha = 0.99 T = 10000.0 T_min = 3.95 current = problem while T > T_min: T = T * alpha successor = n_queen.NQueenState.random_successor(current) E = c...
m3zbaul/ai-search
simulated_annealing.py
Python
mit
668
# blog.py - controller # -*- coding: utf-8 -*- # imports from flask import Flask, render_template, request, session, \ flash, redirect, url_for, g import sqlite3 from functools import wraps # configuration DATABASE = 'blog.db' USERNAME = 'admin' PASSWORD = 'test' SECRET_KEY = u'zbu#<)sA6qp<=Swr!§h?qCVs5' app = F...
mjochum64/flask-blog
blog.py
Python
mit
2,302
# encoding: utf-8 import os.path __all__ = [ "__title__", "__summary__", "__uri__", "__version__", "__author__", "__email__", "__license__", "__copyright__", ] try: base_dir = os.path.dirname(os.path.abspath(__file__)) except NameError: base_dir = None __title__ = "ciscoreputation" __summary__ = "G...
cescobarresi/ciscoreputation
ciscoreputation/__about__.py
Python
mit
1,212
from fastapi import FastAPI, File, UploadFile app = FastAPI() @app.post("/files/") async def create_file(file: bytes | None = File(None)): if not file: return {"message": "No file sent"} else: return {"file_size": len(file)} @app.post("/uploadfile/") async def create_upload_file(file: Uploa...
tiangolo/fastapi
docs_src/request_files/tutorial001_02_py310.py
Python
mit
462
"""Base class for filesystem wrappers. """ from __future__ import unicode_literals import typing import six from . import errors from .base import FS from .copy import copy_file, copy_dir from .info import Info from .path import abspath, join, normpath from .error_tools import unwrap_errors if typing.TYPE_CHECKING...
PyFilesystem/pyfilesystem2
fs/wrapfs.py
Python
mit
17,455
from datetime import datetime def days_diff(date1, date2): """ Find absolute diff in days between dates """ days = datetime(*date1) - datetime(*date2) print abs(days) return abs(days.days) if __name__ == '__main__': # These "asserts" using only for self-checking and not necessary for...
Dani4kor/Checkio
days-diff.py
Python
mit
504
from . import views from django.urls import path urlpatterns = [ path("", views.PublicWidgets.as_view(), name="home"), path("create/widget", views.WidgetCreate.as_view(), name="widget-create"), path("subscription/<pk>/delete", views.SubscriptionDelete.as_view(), name="subscription-delete"), path("user...
kfdm/django-simplestats
quickstats/urls.py
Python
mit
1,550
# Only add tests to this file if they really are specific to the behaviour # of this backend. For cross-backend or `http_common.py` tests use # `test_http.py` instead. import http.cookiejar import math import pytest pytest.importorskip("ipfshttpclient.http_httpx") import ipfshttpclient.http_httpx cookiejar = http.co...
ipfs/py-ipfs-api
test/unit/test_http_httpx.py
Python
mit
2,058
import subprocess def run_qcl(args): subprocess.call('qcl ' + ' '.join(args), shell=True)
LSaldyt/qnp
scripts/run_qcl.py
Python
mit
96
# import the necessary packages from .mxalexnet import MxAlexNet from .mxvggnet import MxVGGNet from .mxgooglenet import MxGoogLeNet from .mxresnet import MxResNet from .mxsqueezenet import MxSqueezeNet from .mxagegendernet import MxAgeGenderNet
CyberLabs-BR/face_detect
pyimagesearch/nn/mxconv/__init__.py
Python
mit
245
import numpy file = open("input.txt") lights = numpy.zeros((1000,1000), 'int') def split_instruction(line): split = line.split(' ') if "turn on" in line or "turn off" in line: instruction = "%s_%s" % (split[0], split[1]) first_pair = [int(x) for x in split[2].split(",")] second_pair =...
mstoppert/adventofcode
06/answer.py
Python
mit
1,930
#!/usr/bin/env python # -*- coding: utf-8 -*- import sys from os.path import exists as path_exists from pyscaffold.api import create_project from pyscaffold.cli import run from pyscaffold.extensions import travis def test_create_project_with_travis(tmpfolder): # Given options with the travis extension, opts ...
cpaulik/pyscaffold
tests/extensions/test_travis.py
Python
mit
1,578
import math from equations import * from my_functions import * import numpy as np def function(fn,x): x = [x] fx = fn(x) return fx def bip(fn,xaxis=[-1,1],inc=0.1,edes=0.01): """This function runs bi(), but first shows you a plot and lets you choose the roots you want. 'fn' is the name of an equat...
JoshMayberry/Numerical_Methods
Bisection/bisection plotable 2.py
Python
mit
2,124
from flask_restful import Api from application import app from application.resources.v1.auth import Login, Register from application.resources.v1.bucketlists import Bucketlists, BucketlistResource from application.resources.v1.items import Items, ItemResource def load_urls(api): api.add_resource(Login, "/auth/log...
bmwachajr/bucketlist
application/resource_urls.py
Python
mit
733
from bson import DBRef from pymongo.database import Database __author__ = 'SkyLapse' from abc import ABCMeta, abstractmethod class BaseModel(): __metaclass__ = ABCMeta def __init__(self, base, config, client, db): self.base = base self.config = config self.client = client se...
SkyLapse/DMS
src/Server/model/basemodel.py
Python
mit
1,731
from emailhooks.settings import * # Add a secret: SECRET_KEY = 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
DeMille/emailhooks
settings.example.py
Python
mit
103
# -*- coding: utf-8 -*- __all__ = ['common', 'http', 'native', 'QueueClient'] class QueueClient(object): def __new__(cls, method='native', *args, **kwargs): if method == 'native': from zenqueue.client.native import QueueClient elif method == 'http': from zenqueue.clie...
zacharyvoase/zenqueue
zenqueue/client/__init__.py
Python
mit
475
""" Django settings for django_magic_login project. Generated by 'django-admin startproject' using Django 1.10.3. For more information on this file, see https://docs.djangoproject.com/en/1.10/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.10/ref/settings/ """...
greglinch/sourcelist
django-magic-link/django_magic_login/settings.py
Python
mit
3,560
################################################################################ # # # cmd_line_helper.py # # Copyright (c) 10/9/2009 Leo Goodstadt # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # ...
bunbun/ruffus
ruffus/cmdline.py
Python
mit
31,898
import unittest2 as unittest from suds import null from testcases.base import BaseTestCaseMixin class AddIntegersTestCase(BaseTestCaseMixin, unittest.TestCase): def test_null(self): self.assertEqual( self.service.add_integers(null(), null()), 0) def test_empty(self): self.asser...
stepank/pyws
tests/python/suds/testcases/test_add_integers.py
Python
mit
470
import logging import select import socket from collections import deque from amqpsfw import amqp_spec from amqpsfw.exceptions import SfwException from amqpsfw.configuration import Configuration amqpsfw_logger = logging.getLogger('amqpsfw') log_handler = logging.StreamHandler() formatter = logging.Formatter('%(ascti...
akayunov/amqpsfw
lib/amqpsfw/application.py
Python
mit
6,761
from colorama import Fore from plugin import plugin @plugin("calories") class calories: """ calculates recommended daily calorie intake,calories for weight add and loss. The calculating method is based on gender, age, height and weight. since it uses the Miffin-St Jeor Equation as it is considered...
sukeesh/Jarvis
jarviscli/plugins/calories.py
Python
mit
6,664
# dependency import matplotlib as mp # set fonts and use latex packages params = { "font.family" : "serif", "font.serif" : "Computer Modern", "text.usetex" : True, "text.latex.preamble" : r"\usepackage{amsmath}", "font.size" : font_size } rcParams.update(params) # default ...
mikaperlin/scripts-configs-etc
templates/py_figs.py
Python
mit
1,445
import _plotly_utils.basevalidators class WidthValidator(_plotly_utils.basevalidators.NumberValidator): def __init__( self, plotly_name="width", parent_name="histogram2dcontour.line", **kwargs ): super(WidthValidator, self).__init__( plotly_name=plotly_name, parent_name...
plotly/plotly.py
packages/python/plotly/plotly/validators/histogram2dcontour/line/_width.py
Python
mit
469
# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # --------------------------------------------------------------------...
yugangw-msft/azure-cli
src/azure-cli/azure/cli/command_modules/storage/tests/hybrid_2020_09_01/test_storage_account_scenarios.py
Python
mit
13,249
try: from collections import namedtuple, OrderedDict, deque, defaultdict except ImportError: try: from ucollections import namedtuple, OrderedDict, deque except ImportError: from ucollections import namedtuple, OrderedDict if "deque" not in globals(): from .deque import d...
dmazzella/uble
micropython-lib/collections/__init__.py
Python
mit
401
import sys from PyQt5.QtWidgets import QApplication, QWidget, QInputDialog, QLineEdit from PyQt5.QtGui import QIcon class App(QWidget): def __init__(self): super().__init__() self.title = 'PyQt5 input dialogs - pythonspot.com' self.left = 10 self.top = 10 self.wi...
steinnymir/RegAscope2017
test_scripts/GUI_test/PyQt5 Examples/inputDialogs.py
Python
mit
1,518
import unittest import numpy import chainer from chainer.backends import cuda from chainer import functions from chainer import gradient_check from chainer import testing from chainer.functions.rnn import lstm from chainer.testing import backend def _sigmoid(x): half = x.dtype.type(0.5) return numpy.tanh(x ...
okuta/chainer
tests/chainer_tests/functions_tests/rnn_tests/test_function_lstm.py
Python
mit
7,898
#!/usr/bin/env python # -*- coding: utf-8 -*- import email import smtpd import asyncore import logging import socket import base64 from lathermail.compat import bytes log = logging.getLogger(__name__) class SMTPChannelWithAuth(smtpd.SMTPChannel, object): def __init__(self, server, conn, addr, on_close=lambda s...
reclosedev/lathermail
lathermail/smtp.py
Python
mit
3,815
from alfred.modules.api.a_base_model import ABaseModel class Article(ABaseModel): def __init__(self, title, summary, date, url, image): super().__init__() self.title = title self.summary = summary self.date = date self.url = url self.image = image class Source(ABa...
Sefrwahed/alfred-news
alfred_news/models.py
Python
mit
791
from .exceptions import ( SMTPAuthenticationError, SMTPCommandFailedError, SMTPException, SMTPLoginError, SMTPNoRecipientError, ) from .smtp import SMTP, SMTP_SSL __all__ = ( "SMTP", "SMTP_SSL", "SMTPException", "SMTPLoginError", "SMTPNoRecipientError", "SMTPCommandFailedErr...
hwmrocker/smtplibaio
smtplibaio/__init__.py
Python
mit
358
# -*- coding: utf-8 -*- """This module contains classes and functions for processing data.""" from __future__ import division, print_function import numpy as np from pxl import timeseries as ts from pxl.timeseries import calc_uncertainty, calc_exp_uncertainty import matplotlib.pyplot as plt from scipy.io import loadma...
UNH-CORE/RVAT-Re-dep
pyrvatrd/processing.py
Python
mit
35,800
from .actions import * from .actions_re import * from .expectations import *
spyoungtech/behave-webdriver
behave_webdriver/steps/__init__.py
Python
mit
77
# Copyright 2009 The Closure Library 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 a...
BOKteam/common
closure/google-closure-builder/builder/source.py
Python
mit
3,415
mod = 10 ** 9+7 def inv(x): return pow(x, mod - 2, mod) r1, c1, r2, c2 = map(int, input().split()) fact, inv_fact = [1, 1], [1, 1] for i in range(2, r2+c2+3): fact.append(fact[-1] * i % mod) inv_fact.append(inv(fact[-1])) def nCr(n, r): return fact[n] * inv_fact[r] * inv_fact[n-r] % mod def path...
knuu/competitive-programming
atcoder/abc/abc154_f.py
Python
mit
558
#!/usr/bin/env python #Copyright (C) 2006-2011 by Benedict Paten (benedictpaten@gmail.com) # #Released under the MIT license, see LICENSE.txt #!/usr/bin/env python import sys import os import re import math import SparseAlign def getStartStates(stateMachine): def fn(i): if i == MATCH: re...
benedictpaten/pecan
bp/pecan/SparsePecan.py
Python
mit
4,509
#!/usr/bin/python import json import os import sys import tempfile import urllib2 import zipfile # Get the manifest urls. req = urllib2.Request( "https://www.bungie.net//platform/Destiny/Manifest/", headers={'X-API-Key': sys.argv[1]}, ) resp = json.loads(urllib2.urlopen(req).read()) if resp['ErrorCode'] != 1:...
zhirsch/destinykioskstatus
tools/update_manifest.py
Python
mit
993
import urllib API_SSL_SERVER="https://www.google.com/recaptcha/api" API_SERVER="http://www.google.com/recaptcha/api" VERIFY_SERVER="www.google.com" class RecaptchaResponse(object): def __init__(self, is_valid, error_code=None): self.is_valid = is_valid self.error_code = error_code def display_htm...
boreq/recaptcha-client-python3
captcha.py
Python
mit
3,161
# 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 ...
Azure/azure-sdk-for-python
sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/models/endpoint_settings_dto_active_learning.py
Python
mit
946
''' Created on 23 Aug 2017 Loop detection: Given a circular linked list, implement an algorithm that returns the beginning of the loop DEFINITION Circular linked list: A (corrupt) linked list in which a node's next pointer points to another as to make a loop in the linked list. EXAMPLE: Input A -> B -> C -> D -> E -...
igoroya/igor-oya-solutions-cracking-coding-interview
crackingcointsolutions/chapter2/exerciseeight.py
Python
mit
2,720
# coding: utf-8 """ DocuSign REST API The DocuSign REST API provides you with a powerful, convenient, and simple Web services API for interacting with DocuSign. # noqa: E501 OpenAPI spec version: v2.1 Contact: devcenter@docusign.com Generated by: https://github.com/swagger-api/swagger-codegen.gi...
docusign/docusign-python-client
docusign_esign/models/notary_journal_list.py
Python
mit
9,255
# Median blur device import os from plantcv.plantcv._debug import _debug from plantcv.plantcv import params from plantcv.plantcv import fatal_error from scipy.ndimage.filters import median_filter def median_blur(gray_img, ksize): """ Applies a median blur filter (applies median value to central pixel within ...
danforthcenter/plantcv
plantcv/plantcv/median_blur.py
Python
mit
1,066
import sympy from math import e, sin, cos, tan def make_func(f): f = f.replace('-x', '(-x)') f = f.replace('x', '(x)') f = f.replace('^', '**') return lambda x: eval(f) def solve(msg): _, fstr = msg.split(' ') f = make_func(fstr) x = sympy.Symbol('x') return sympy.solvers.solve(f(x)) def limit(msg): _, ...
caiopo/riemann-bot
src/calculus.py
Python
mit
1,421
# Codon Usage probability for each scpecie' USAGE_FREQ = {'E.coli':{'GGG': 0.15,'GGA': 0.11,'GGT': 0.34,'GGC': 0.4,\ 'GAG': 0.31,'GAA': 0.69,'GAT': 0.63,'GAC': 0.37,\ 'GTG': 0.37,'GTA': 0.15,'GTT': 0.26,'GTC': 0.22,\ 'GCG': 0.36,...
kimlaborg/NGSKit
ngskit/utils/codons_info.py
Python
mit
6,184
# /auth/redirect/(douban|weibo) import web import traceback from util import oauth class auth_redirect: def GET(self,name): try: client = oauth.createClientWithName(name) url = client.redirect() web.seeother(url) except Exception: return traceback.form...
supersheep/huixiang
controller/page/auth_redirect.py
Python
mit
329
from re import compile, match REGEX = compile(r'((25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)\.){3}' r'(25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)$') def is_valid_IP(strng): """ is_valid_ip == PEP8 (forced mixedCase by CodeWars) """ return bool(match(REGEX, strng))
the-zebulan/CodeWars
katas/kyu_4/ip_validation.py
Python
mit
276
import logging import sys console = logging.StreamHandler(sys.stdout) logging.basicConfig( level=logging.DEBUG, format='[%(asctime)s] {%(filename)s:%(lineno)d} %(levelname)s - %(message)s', handlers=[console] ) module_logger = logging.getLogger(__name__)
altager/SampleProject
rpc_handlers/__init__.py
Python
mit
268
import csv with open('historical_data.csv', 'rb') as csvfile: reader = csv.DictReader(csvfile) for row in reader: if int(row["TIME"]) == 0 : save = float(row["Speed"]) else: if(float(row["Speed"]) - save >= 0.1*save or -float(row["Speed"]) + save >= 0.1*save ): print row["SER"] + "->" , int(row["TIME"...
manglakaran/TrafficKarmaSent
extras/check_break.py
Python
mit
361
# 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 ...
Azure/azure-sdk-for-python
sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/_configuration.py
Python
mit
3,262
# coding=gbk #------------------------------------------------------------------------------- # Name: Chalearn LAP sample # Purpose: Provide easy access to Chalearn LAP challenge data samples # # Author: Xavier Baro # # Created: 21/01/2014 # Copyright: (c) Xavier Baro 2014 # Licence: <your lic...
xiawei0000/Kinectforactiondetect
ChalearnLAPSample.py
Python
mit
41,779
#!/usr/bin/python3 from PyQt4 import QtGui import sys import TetrisMainWindow import GameWidget import TetrisGame app = QtGui.QApplication(sys.argv) gameWidget = GameWidget.GameWidget() mainWindow = TetrisMainWindow.TetrisMainWindow(gameWidget) game = TetrisGame.TetrisGame(mainWindow, gameWidget) mainWindow.show(...
Daniel2357/tetris
tetris.py
Python
mit
346
#!/usr/bin/env python #-*- coding:utf-8 -*- import sys import os import stat import argparse from scapy.all import( Ether, ARP, sendp, hexdump, ) def process_cmd(ns): eth = Ether() arp = ARP( op = "is-at", hwsrc="12:34:56:78:9A:BC", psrc="192.168.12.34", ) p...
matrix65537/xgo
src/python/tcpip/arp.py
Python
mit
987
# -*- coding: utf-8 -*- import os, tempfile PROJECT_ROOT = os.path.dirname(__file__) TMP_DIR = tempfile.mkdtemp() DOWNLOAD_DIR = os.path.join(TMP_DIR, "download") LOG_DIR = os.path.join(TMP_DIR, "logs") try: os.makedirs(DOWNLOAD_DIR) except OSError: pass try: os.makedirs(LOG_DIR) except OSError: p...
rafallo/p2c
settings.py
Python
mit
760
""" airPy is a flight controller based on pyboard and written in micropython. The MIT License (MIT) Copyright (c) 2016 Fabrizio Scimia, fabrizio.scimia@gmail.com 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...
Sokrates80/air-py
aplink/messages/ap_imu.py
Python
mit
2,582
# -*- coding: utf-8 -*- """ Created on Tue Mar 22 14:18:45 2016 @author: Alex Kerr Define functions that draw molecule objects. """ import copy from itertools import cycle import matplotlib.pyplot as plt from matplotlib import colors from mpl_toolkits.mplot3d import Axes3D import numpy as np from .molecule import ...
ajkerr0/kappa
kappa/plot.py
Python
mit
16,060
#!/usr/bin/env python # -*- coding: utf-8 -*- import os import sys import time sys.path.append(os.path.join(os.path.abspath(os.path.dirname(__file__)), '..', '..', '..', 'static-inspector')) from inspector.saql.sams import SAMS if __name__ == '__main__': sams = SAMS() try: ind = sys.argv.index('-d')...
amiraliakbari/static-inspector
inspector/saql/interpreter.py
Python
mit
1,012
import json import requests import logging from mixins import DripQueryPathMixin logger = logging.getLogger(__name__) class DripPy(DripQueryPathMixin): """ The main class that interacts with Drip https://www.getdrip.com/docs/rest-api#subscribers """ def __init__(self, token, account_id, endpoint...
SpringboardEdu/drip-py
drip/drip.py
Python
mit
4,987
from decimal import * class PI: #Sets decimal to 25 digits of precision getcontext().prec = 1000 @staticmethod def factorial(n): # if n<1: # return 1 # else: # return n * PI.factorial(n-1) result = 1 for i in xrange(2, n+1): result *=...
susemeee/Chunsabot-framework
chunsabot/pi.py
Python
mit
1,587
from Graph import Graph def mkTestGraph4(): return Graph( ['a','b','c','d'], [ ('a','b'), ('b','c'), ('c','a'), ('a','d') ] ) def mkTestGraph4b(): ## isomorphic with 4 return Graph( ['a','c','b','d'], ...
J-Adrian-Zimmer/GraphIsomorphism
TestGraphs.py
Python
mit
5,052
""" apiparse Parse API and API groups from sources. List the API occurences from all directories and sub directories """ # Main Routine if __name__ == "__main__": import calltree f = calltree.calltree.calltree() f.showtree() f.showgraph()
vadivelmurugank/calltree
calltree/__main__.py
Python
mit
259
import re import socket import ssl class MyNntp: def __init__(self, server, port, use_ssl): """Constructor Pass in the server, port, and ssl usage value for connect. """ # just store the values for now self.server = server self.port = port self.ssl = use_s...
dgm816/simple-index
nntp/nntp.py
Python
mit
11,160
from flask import Flask, render_template from opentok import Client import os try: api_key = os.environ["API_KEY"] api_secret = os.environ["API_SECRET"] except Exception: raise Exception("You must define API_KEY and API_SECRET environment variables") app = Flask(__name__) opentok = Client(api_key, api_sec...
opentok/Opentok-Python-SDK
sample/HelloWorld/helloworld.py
Python
mit
660
from django.urls import re_path, include urlpatterns = [ re_path( r'^callback/', include('djconnectwise.urls', namespace='djconnectwise') ), ]
KerkhoffTechnologies/django-connectwise
djconnectwise/tests/urls.py
Python
mit
168
import pytest from tests.functional.ucare_cli.helpers import arg_namespace from pyuploadcare.ucare_cli.commands.update_webhook import update_webhook @pytest.mark.vcr def test_update_webhooks(capsys, uploadcare): update_webhook( arg_namespace( "update_webhook 865715 --deactivate " ...
uploadcare/pyuploadcare
tests/functional/ucare_cli/test_update_webhook.py
Python
mit
484
# _*_ coding: utf-8 _*_ __author__ = 'nislam <connect2nazrul@gmail.com>' import re from wtforms.validators import ValidationError class EmailProviders(object): def __init__(self, message=None): if message is None: message = u'We are only accept Gmail or Yahoo or AOL or Outlook' self.m...
nazrulworld/mailbox
application/validators.py
Python
mit
565
#!/usr/bin/env python3 # author: greyshell from .tblpost01 import * from .tblpost02 import * from .tblpost03 import *
greyshell/Pen-Test
web/sqli/models/__init__.py
Python
mit
120
import os import sys import skimage.transform import skimage.exposure import time import glob import numpy as np import mahotas import random import matplotlib import matplotlib.pyplot as plt import scipy import scipy.ndimage import json from scipy.ndimage.filters import maximum_filter base_path = os.path.dirname(__fi...
fegonda/icon_demo
code/model/unet/ff.py
Python
mit
36,759
from random import choice, shuffle names_fd = open('names.txt', 'ro') names = map(lambda name: name.strip(), names_fd.readlines()) events = [] for i in xrange(7): events.append("meet") for i in xrange(3): events.append("friends") names_fd.close() entries = set() while len(entries) < 8000: event = ...
MAPSuio/spring-challenge16
frengers/generate.py
Python
mit
734
# -*- encoding: utf-8 -*- import csv from allauth.socialaccount.models import SocialToken from django.core.management.base import BaseCommand from apps.filters.filter import get_api import os from django.conf import settings from yaml import load from apps.filters.models import Collection, Entry, Category class Co...
WarmongeR1/feedly-filter
apps/filters/management/commands/load_data.py
Python
mit
1,534
import requests from ate import response, exception from tests.base import ApiServerUnittest class TestResponse(ApiServerUnittest): def test_parse_response_object_json(self): url = "http://127.0.0.1:5000/api/users" resp = requests.get(url) resp_obj = response.ResponseObject(resp) p...
vlaw/ApiTestEngine
tests/test_response.py
Python
mit
8,049
# -*- coding: utf-8 -*- # Generated by Django 1.10.2 on 2018-08-08 19:17 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.CreateModel( name='Option...
WarwickAnimeSoc/aniMango
polls/migrations/0001_initial.py
Python
mit
883
"""URL managment for profile based pages.""" from django.conf.urls import url from imager_profile.views import ( ProfileView, PublicProfileView, ProfileEditView ) from django.contrib.auth.decorators import login_required urlpatterns = [ url(r'^$', login_required(ProfileView.as_view()), name='p...
cahudson94/django-imager
imagersite/imager_profile/urls.py
Python
mit
514
"""Contains a baseclass for plugins.""" ############################################################################### # # TODO: [ ] # ############################################################################### # standard library imports from collections import Iterable from functools import wraps import loggin...
Sirs0ri/PersonalAssistant
samantha/plugins/plugin.py
Python
mit
4,002
# -*- test-case-name: axiom.test.historic.test_textlist -*- from axiom.item import Item from axiom.attributes import textlist from axiom.test.historic.stubloader import saveStub class Dummy(Item): typeName = 'axiom_textlist_dummy' schemaVersion = 1 attribute = textlist(doc="a textlist") def createDat...
twisted/axiom
axiom/test/historic/stub_textlist.py
Python
mit
509
#!/usr/bin/env python import os import sys if __name__ == "__main__": os.environ.setdefault("DJANGO_SETTINGS_MODULE", "contactmps.settings") from django.core.management import execute_from_command_line execute_from_command_line(sys.argv)
OpenUpSA/contact-mps
manage.py
Python
mit
253
#!/usr/bin/env python import os import sys if __name__ == "__main__": os.environ.setdefault("DJANGO_SETTINGS_MODULE", "mobilepolls.settings") from django.core.management import execute_from_command_line execute_from_command_line(sys.argv)
jacol12345/TP-ankiety-web-app
mobilepolls/manage.py
Python
mit
254
from distutils.core import setup from setuptools import find_packages setup(name='ddns_updater_aws', version='0.1', author='Felix Bouliane', license='MIT', py_modules=[], packages=find_packages(exclude=['contrib', 'docs', 'test']), url='https://github.com/fbouliane/ddns-updater-aws',...
fbouliane/ddns-updater-aws
setup.py
Python
mit
1,053
""" A python module for demonstrating head orientation tracking for binaural synthesis. Usage: python opti_ssr_demo.py [SSR_IP] [SSR_port] [optitrack ip] [multicast address] [optitrack port] [end_message] """ import sys from time import sleep import opti_ssr def demo(ssr_ip='localhost', ssr_port=4711, opti_unicast_...
bertmcmeyer/opti_ssr
opti_ssr_demo_headtracker.py
Python
mit
1,936
import sys from logging import warning from glob import iglob import json import os import shutil from ..common import chdir, run from .cache import cache_specs from .dirs import get_specs_dir def load_all_specs(*, basedir=get_specs_dir(), skip_update_check=True): os.makedirs(basedir, exist_ok=True) if not ...
StoDevX/cs251-toolkit
cs251tk/specs/load.py
Python
mit
2,467
#!/usr/local/bin/python """ Author: Parikshit Juluri Contact: pjuluri@umkc.edu Testing: import dash_client mpd_file = <MPD_FILE> dash_client.playback_duration(mpd_file, 'http://198.248.242.16:8005/') From commandline: python dash_client.py -m "http://198.248.242.16:8006/media/m...
pari685/AStream
dist/client/dash_client.py
Python
mit
23,767
import loggingstyleadapter log = loggingstyleadapter.getLogger(__name__) from PyQt5.QtGui import QKeySequence import hotkeys, plat class Host: def __init__(self): pass #enddef def registerDestination(self, destination): print("Don't forget to implement me (registerDestination)") #enddef def registerCommand...
Xcelled/cap-n-snap
host.py
Python
mit
1,016
import logging from collections import defaultdict class EventInsightsHelper(object): @classmethod def calculate_event_insights(cls, matches, year): INSIGHTS_MAP = { 2016: cls.calculate_event_insights_2016 } if year in INSIGHTS_MAP: return INSIGHTS_MAP[year](ma...
synth3tk/the-blue-alliance
helpers/event_insights_helper.py
Python
mit
6,320
import simplejson as json import os import subprocess import sys import unittest if sys.version_info.major >= 3: from http.server import HTTPServer from http.server import BaseHTTPRequestHandler else: from BaseHTTPServer import HTTPServer from BaseHTTPServer import BaseHTTPRequestHandler tests_dir = o...
backtrace-labs/backtrace-python
tests/__init__.py
Python
mit
3,903
#--------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. #---------------------------------------------------------------------...
BurtBiel/azure-cli
src/command_modules/azure-cli-resource/azure/cli/command_modules/resource/tests/test_validators.py
Python
mit
1,205
import os __version__ = 'v0.0.7' # update also in setup.py root_dir = os.path.dirname(os.path.abspath(os.path.dirname(__file__))) info = { "name": "NiLabels", "version": __version__, "description": "", "repository": { "type": "git", "url":...
SebastianoF/LabelsManager
nilabels/definitions.py
Python
mit
1,452
import hashlib import libvirt from django.forms.models import model_to_dict from utils.common import gen_passwd from utils.common import gen_user_passwd from backstage.models import LibvirtPass from utils.salt_utils import SaltApiHandler def get_host_passwd(host): """ * desc 获取机器的用户名和密码 * input 主机ip ...
hanleilei/note
python/vir_manager/utils/libvirt_utils.py
Python
cc0-1.0
3,602
''' First Created 2016/05/05 by Blaise Thompson Last Edited 2016/08/08 by Blaise Thompson Contributors: Blaise Thompson ''' ### import #################################################################### import os import sys import importlib import collections import WrightTools as wt ### define ##############...
wright-group/WrightData
2011-11 Yurs/workup.py
Python
cc0-1.0
4,760
import os path = os.path.dirname(os.path.realpath(__file__)) sbmlFilePath = os.path.join(path, 'MODEL1108260010.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/MODEL1108260010
MODEL1108260010/model.py
Python
cc0-1.0
427
from setuptools import setup, find_packages setup(name='MODEL1006230031', version=20140916, description='MODEL1006230031 from BioModels', url='http://www.ebi.ac.uk/biomodels-main/MODEL1006230031', maintainer='Stanley Gu', maintainer_url='stanleygu@gmail.com', packages=find_packages(...
biomodels/MODEL1006230031
setup.py
Python
cc0-1.0
377
# -*- coding: utf-8 -*- """ Created on Sun Aug 2 19:02:52 2015 @author: piotr at nicecircuits.com """ from libraryManager.symbol import symbol from libraryManager.symbolPrimitive import * from libraryManager.defaults import defaults from libraryManager.common import * class symbolIC(symbol): """ IC symbol g...
NiceCircuits/pcbLibraryManager
src/pcbLibraryManager/symbols/symbolsIC.py
Python
cc0-1.0
3,334
#!/usr/bin/env python import urllib import urllib2 import urlparse import json import os PUSHOVER_API = "https://api.pushover.net/1/" class PushoverError(Exception): pass def pushover(**kwargs): assert 'message' in kwargs if not 'token' in kwargs: kwargs['token'] = os.environ['PUSHOVER_TOKEN'] ...
abelboldu/nagpy-pushover
nagpy/util/pushover.py
Python
epl-1.0
690
#!/usr/bin/python ''' This programs is to integrate dog reference genome from chr to a single one. Author: Hongzhi Luo ''' import gzip import glob import shutil path='/vlsci/LSC0007/shared/canine_alport_syndrome/ref_files/' #path='' prefix='cfa_ref_CanFam3.1' def integrate_genome(): ''' @param: num: chr1...ch...
verityrise/Canine_Analysis
integrate_genome.py
Python
epl-1.0
753
""" Cross-platform clipboard syncing tool Copyright (C) 2013 Syncboard This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your opt...
syncboard/syncboard
src/session.py
Python
gpl-2.0
8,410
import csv import django.http try: import autotest.common as common except ImportError: import common from autotest_lib.frontend.afe import rpc_utils class CsvEncoder(object): def __init__(self, request, response): self._request = request self._response = response self._output_rows ...
libvirt/autotest
frontend/tko/csv_encoder.py
Python
gpl-2.0
5,495
# # Copyright 2009-2011 Red Hat, Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed ...
aglitke/vdsm
vdsm/storage/storage_exception.py
Python
gpl-2.0
44,109
from . import v1
cpwr/mediasite
app/api/__init__.py
Python
gpl-2.0
17
import datetime import logging import sqlite3 import time from os import environ import relays class Latch: DIGIT_TIMEOUT = 60 LOCKOUT_TIMEOUT = 300 LOCKOUT_THRESHOLD = 5 VALID_CH = set('0123456789#*') def __init__(self, latch_id, latch_index): self._logger = logging.getLogger(__name__)...
donhoffman/pi-keypad-controller
src/door_latch.py
Python
gpl-2.0
4,286
#!/usr/bin/env python3 import urllib3 import sys import os import json from datetime import datetime import urllib.parse import requests import time import argparse urllib3.disable_warnings() debug = os.getenv('DEBUG', 0) batch_size = 100 workspace = os.getenv('WORKSPACE', os.getcwd()) user_name = 'jenkins-testerdh' u...
gwsu2008/automation
python/git-branch-diff.py
Python
gpl-2.0
3,650