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
from __future__ import unicode_literals from django.db import models from django.contrib.auth.models import User from django.contrib.postgres.fields import JSONField from django.utils.encoding import python_2_unicode_compatible from transcriptic_tools import utils from transcriptic_tools.utils import _CONTAINER_TYPES ...
scottbecker/autolims
autolims/models.py
Python
mit
28,120
import numpy from os import listdir from os.path import isfile, join import h5py import numpy from scipy import misc rng = numpy.random.RandomState(123522) path = '/data/lisatmp3/xukelvin/' if __name__ == "__main__": files = [f for f in listdir(join('train')) if isfile(join('train', f))] # Shu...
kelvinxu/representation-learning
generate_dataset.py
Python
mit
2,368
"""empty message Revision ID: dde8a74cfffa Revises: 0c2841d4cfcd Create Date: 2016-07-29 17:42:17.142867 """ # revision identifiers, used by Alembic. revision = 'dde8a74cfffa' down_revision = '0c2841d4cfcd' from alembic import op import sqlalchemy as sa def upgrade(): ### commands auto generated by Alembic - ...
perna/podigger
migrations/versions/dde8a74cfffa_.py
Python
mit
618
# -*- coding: utf-8 -*- # !/usr/bin/python import pygame from classes.pre_game.pre_game_item import PreGameItem class PreGame(): def __init__(self, screen, actions, players): # Screen für Instanz definieren self.screen = screen self.screen_width = self.screen.get_rect().width self....
timlapluie/gldsprnt
classes/pre_game/pre_game.py
Python
mit
3,265
import numpy as np import itertools import timeit import time import pdb def form_all_kmers(A,k): """ Given an alphabet and `k`, this forms an array of all possible k-mers using that alphabet. Arguments A : list alphabet - all possible characters k : int the len...
rajanil/mkboost
src/mismatch.py
Python
mit
2,433
import os basedir = os.path.abspath(os.path.dirname(__file__)) class Config: SECRET_KEY = os.environ.get('SECRET_KEY') or 'hard-to-guess-key' SQLALCHEMY_COMMIT_TEARDOWN = True MAIL_SERVER = 'smtp@qq.com' MAIL_PORT = 25 MAIL_USER_TLS = False MAIL_USERNAME = os.environ.get('MAIL_USERNAME') M...
chenke91/LearnFlask
config.py
Python
mit
1,387
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ] operations = [ migrations.CreateModel( name='Buffer', fields=[ ('id', models.AutoField(seria...
mpetyx/energagement
energagement/myapp/migrations/0001_initial.py
Python
mit
6,753
# -*- coding: utf-8 -*- """Functions called when player or monsters dies.""" import colors from random import randint from game_messages import Message from game_states import GameStates from render_functions import RenderOrder from texts import Texts def kill_player(player): """Change player's properties and ret...
kuraha4/roguelike-tutorial-python
src/death_functions.py
Python
mit
1,349
# old_python.py class OldPython(object): def __init__(self, age): if age < 50: raise ValueError("%d isn't old" % age) self.age = age def hiss(self): if self.age < 60: return "sss sss" elif self.age < 70: return "SSss SSss" else: ...
evandrix/Splat
doc/existing-work/pythoscope/wild_pythons/old_python.py
Python
mit
359
class TodoooError(Exception): """Catch all error for the Todooo application""" pass class InvalidCommandError(TodoooError): """An error where the command is not recognized by the REPL""" def __str__(self): return 'You entered an invalid command' class NoListError(TodoooError): """An erro...
dansackett/Todooo
todooo/errors.py
Python
mit
1,302
# coding: utf-8 __author__ = 'Rafael Borges' ''' Ex. de teste do uso e leitura de grafos ''' grafo = { '1': ['2', '5'], '2': ['1', '3', '5'], '3': ['2', '4'], '4': ['3', '5', '6'], '5': ['1', '2', '4'], '6': ['4'] } def encontra_caminho(grafo, inicio, fim, caminho=None): if caminho is None: ...
Razborges/algGrafos
Trabalho2/teste_grafo.py
Python
mit
916
# Python script to organize PixelPOS "Profit by Summary Group" sales reports # tidied up by saleswiz.py into single tables for chart production. import os import csv import sys from glob import glob from collections import OrderedDict from copy import deepcopy # *sales_clean.csv columns. cols = ['Category', 'Subcat...
malwatt/saleswiz
flipwiz.py
Python
mit
3,460
from post import views as post_views from utils.helpers import search_keyword, \ get_id_from_response, \ get_suggested_id_from_response, get_search_object def search(request): domain = request.GET.get('domain') if domain == 'post': return search_in_post(request) elif domain == 'category': ...
Prakash2403/Blog
search/views.py
Python
mit
1,090
# MIT License # # Copyright (c) 2015-2021 Iakiv Kramarenko # # 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, modif...
yashaka/selene
tests/integration/browser__switch_to__alert_test.py
Python
mit
2,778
""" Constants file """ API_URL = 'https://graph.facebook.com/v2.9/me/messages' NEWS_URL = 'https://newsapi.org/v1/'
MichaelYusko/Bot-Chucky
bot_chucky/constants.py
Python
mit
117
"""Language-specific word tokenizers. Primary purpose is to handle enclitics. Re: latin Starter lists have been included to handle the Latin enclitics (-que, -ne, -ue/-ve, -cum). These lists are based on high-frequency vocabulary and have been supplemented on a as-needed basis; i.e. they are not comprehensive. Addit...
coderbhupendra/cltk
cltk/tokenize/word.py
Python
mit
15,959
# coding: utf-8 """Classes for storing and reporting solutions of malloovia problems.""" from typing import Union, NamedTuple, Optional, List, Sequence, Tuple from enum import IntEnum from functools import singledispatch import pulp # type: ignore from .model import ( remove_namedtuple_defaultdoc, Performan...
asi-uniovi/malloovia
malloovia/solution_model.py
Python
mit
11,913
import datetime import os import re import pdb import numpy as np import pandas as pd from wfdb.io import download from wfdb.io import _signal """ Notes ----- In the original WFDB package, certain fields have default values, but not all of them. Some attributes need to be present for core functionality, i.e. baseli...
MIT-LCP/wfdb-python
wfdb/io/_header.py
Python
mit
36,630
from app.utils import readable from pymongo import MongoClient class WebcomicDao(): def __init__(self): self.client = MongoClient('mongodb://localhost:27017/') self.db = self.client.penny def create_comic(self, comic_id, initial_data): """ Creates a new webcomic and ret...
arpitbbhayani/penny
app/dao/items/webcomicDao.py
Python
mit
2,415
from __future__ import unicode_literals from .core.lock import Lock from .core.errors import * from .backends.redis_lox_backend import RedisLoxBackend from .backends.postgres_lox_backend import PostgresLoxBackend DEFAULT_LOX_CONFIG = { "backend": { "redis": "redis://:@localhost:6379/0" } } class Lox...
sternb0t/lox
lox/lox.py
Python
mit
3,823
from okapi.templatetags import headers from okapi.templatetags.exports import curl, jira from okapi.templatetags import misc filters = { 'nl2br': misc.nl2br, 'status_code_class': misc.status_code_class, 'escape_payload': curl.escape_payload, 'headers_as_string': headers.headers_as_string, 'expor...
Team-Zeus/okapi
okapi/templatetags/__init__.py
Python
mit
387
# -*- coding: utf-8 -*- """ proxy.py ~~~~~~~~ get proxy list from http://pachong.com """ from bs4 import BeautifulSoup import requests import re import socket import sys reload(sys) sys.setdefaultencoding('utf-8') import time if 'threading' in sys.modules: del sys.modules['threading'] import gevent impor...
atupal/ccrawler
request/proxy.py
Python
mit
6,854
from coyote_framework.config.abstract_config import ConfigBase class TimeoutConfig(ConfigBase): def __init__(self): super(TimeoutConfig, self).__init__('timeout')
Shapeways/coyote_framework
coyote_framework/config/timeout_config.py
Python
mit
177
import importlib def get_full_class_path_name(obj): if hasattr(obj,'__call__'): obj = obj() return obj.__module__ + "." + obj.__class__.__name__ def get_orient_valid_class_name(obj): name = get_full_class_path_name(obj) return name.replace(".", "___dot___") def get_module_class_name_from_o...
ejesse/ogorm
models/model_utils.py
Python
mit
1,141
from django.shortcuts import render from django.views import View class LoadTimes(View): def get(self, request): from apps.statistics.models import MStatistics data = { 'feed_loadtimes_1min': MStatistics.get('last_1_min_time_taken'), 'feed_loadtimes_avg_hour': MSta...
samuelclay/NewsBlur
apps/monitor/views/newsblur_loadtimes.py
Python
mit
882
#!/usr/bin/env python import math, optparse, random, sys, time, socket, struct from collections import deque import dpkt # For debugging import pdb class IDS(object): MAC_ADDRESSES = { '\xC0\xA8\x00\x64': '\x7C\xD1\xC3\x94\x9E\xB8', # 192.168.0.100 '\xC0\xA8\x00\x67': '\xD8\x96\x95\x01\xA5\xC9', ...
somethingnew2-0/CS642-HW2
main.py
Python
mit
4,175
import csv import math def get_samples(path='./ld2/examples.txt'): # read attributes with open(path) as f: # `\d\\t\d\\n` format example = [(int(a[0]), int(a[1])) for a in csv.reader(f, delimiter='\t')] return example def get_results(path='./ld2/d.txt'): with open(...
ktaube/neural-network-course
neural-netoworks/ld2.py
Python
mit
3,074
from random import random, seed from ast import literal_eval from movement import bot_map, direction crash_flag = 0 seed() values = {'weight': random(), 'threshold': 0, 'alpha': 15} def init(): # first time write to file global values dump = open('dump.txt', 'w') dump.write(str(values)) dump.close(...
braininahat/sonny
perceptron.py
Python
mit
796
import os __all__ = [ 'is_updated', ] def is_updated(old_file, new_file): return not os.path.exists(new_file) or \ os.stat(old_file).st_mtime > os.stat(new_file).st_mtime
axiak/jinja-static
jinjastatic/utils.py
Python
mit
189
from setuptools import setup, find_packages import os CLASSIFIERS = [ 'Environment :: Web Environment', 'Framework :: Django', 'Intended Audience :: Developers', 'License :: OSI Approved :: MIT License', 'Operating System :: OS Independent', 'Programming Language :: Python', 'Programming La...
furious-luke/django-ajax
setup.py
Python
mit
1,325
import models import urllib import urllib2 import simplejson as json import re from porterstemmer import Stemmer from datetime import datetime from itertools import count stemmer = Stemmer() PLUS_LIST = [ 'cool', 'awesome', 'like', 'good', 'love', 'great', 'enjoy', 'amazing', 'go...
mop/twit-miner
twit_miner/crits/twitlib.py
Python
mit
5,119
from api.parsers.constants.en import GENDER, CASES, NUMBER, MOOD, TENSE, PERSONS, VOICE, DEFINITENESS, POSSESSIVENESS def render_non_lemma(non_lemma_type): def wrapper(non_lemma) -> str: explanation = non_lemma_type ret = explanation + ' of [[%s]]' % (non_lemma.lemma) return ret retur...
radomd92/botjagwar
api/parsers/renderers/en.py
Python
mit
1,923
from __future__ import division import collections import importlib from datetime import datetime from time import mktime DATE_SUFFIX = collections.OrderedDict([ (31557600, "year"), (2592000, "month"), (604800, "week"), (86400, "day"), (3600, "hour"), (60, "minute"), (0, "second") ]) def ...
clugg/humanizepy
humanizepy/_datetime.py
Python
mit
1,676
"""urlconf for the base application""" from django.conf.urls import url, patterns from . import views urlpatterns = patterns('base.views', url(r'^$', 'home', name='home'), url(r'^grow/monitor/$', 'monitor', name='monitor'), url(r'^grow/about/$', 'about', name='about'), url(r'^grow/control/$', 'contro...
jpk0727/growApp
apps/base/urls.py
Python
mit
344
from PIL import Image import math import numpy as np class SheetImage: def __init__(self, source_image_path): # initializes image metadata from analyzing image self.image = Image.open(source_image_path) self.image_array = np.asarray(self.image) # static methods used for image analysis ...
sfmckenrick/sight-parse
src/imaging/sheet_image.py
Python
mit
10,494
import json import logging import traceback import urllib from dart.context.locator import injectable from dart.message.call import SubscriptionCall from dart.model.subscription import SubscriptionState _logger = logging.getLogger(__name__) @injectable class SubscriptionListener(object): def __init__(self, sub...
RetailMeNotSandbox/dart
src/python/dart/message/subscription_listener.py
Python
mit
3,702
# Copyright Jonathan Hartley 2013. BSD 3-Clause license, see LICENSE file. from . import win32 # from wincon.h class WinColor(object): BLACK = 0 BLUE = 1 GREEN = 2 CYAN = 3 RED = 4 MAGENTA = 5 YELLOW = 6 GREY = 7 # from wincon.h class WinStyle(object): NORMAL ...
deathsec/instagram-py
InstagramPy/colors/winterm.py
Python
mit
6,314
#! /usr/bin/env python3 import prime from itertools import islice description = """ Truncatable primes Problem 37 The number 3797 has an interesting property. Being prime itself, it is possible to continuously remove digits from left to right, and remain prime at each stage: 3797, 797, 97, and 7. Similarly we can wor...
mbuhot/mbuhot-euler-solutions
python/problem-037.py
Python
mit
945
# A continuacion el algoritmo de corte minimo # dado un grafo # La implementacion de este algoritmo fue desarrollada por Raul Bernardo # Rodas Herrera, el 20 de Septiembre del ano 2013. # Se importan las librerias correspondientes # Libreria para el manejo de grafos. # Para obtener valores aleatorios import random ...
BRodas/k-cut
lib_python/Min_Cut_Kargers.py
Python
mit
8,073
import pytest import chainerx.testing from chainerx_tests import cuda_utils def pytest_configure(config): _register_cuda_marker(config) def pytest_runtest_setup(item): _setup_cuda_marker(item) def pytest_runtest_teardown(item, nextitem): current_device = cuda_utils.get_current_device() assert cu...
okuta/chainer
tests/chainerx_tests/conftest.py
Python
mit
3,665
"""Place jobs into our DEP queue!""" import sys import os import datetime import time from io import StringIO import pika from pyiem.util import get_dbconn, logger YEARS = datetime.date.today().year - 2006 class WeppRun: """Represents a single run of WEPP. Filenames have a 51 character restriction. """...
akrherz/dep
scripts/RT/enqueue_jobs.py
Python
mit
6,180
from .toolkit_tests import ToolkitTests
DarkmatterVale/regex4dummies
regex4dummies/tests/toolkit_tests/__init__.py
Python
mit
40
""" Created on 22 Jun 2019 @author: Bruno Beloff (bruno.beloff@southcoastscience.com) """ import optparse from scs_core.display.display_conf import DisplayConf # -------------------------------------------------------------------------------------------------------------------- class CmdDisplayConf(object): "...
south-coast-science/scs_mfr
src/scs_mfr/cmd/cmd_display_conf.py
Python
mit
4,026
""" smashlib.inputsplitter """ import re import os ope = os.path.exists from IPython.core.inputsplitter import IPythonInputSplitter r_ed = 'ed [^:]*' class SmashInputSplitter(IPythonInputSplitter): """ It may be useful for something else in the future, but at the moment Smash overrides the core IPyth...
mattvonrocketstein/smash
smashlib/inputsplitter.py
Python
mit
922
#!/usr/bin/env python #Copyright (c) 2016 Ramnatthan Alagappan #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, modif...
ramanala/PACE
pacenonrsmexplorer.py
Python
mit
23,519
#!/usr/bin/env python3 import sys import re def extract(s): return [int(x) for x in re.findall(r'(-?\d+).?', s)] def fold_x(dot, x): if dot[0] > x: diff = dot[0] - x return (x - diff, dot[1]) return dot def main(args): p1, p2 = sys.stdin.read().split("\n\n") dots = [tuple(extrac...
msullivan/advent-of-code
2021/13a.py
Python
mit
559
from pymogilefs import backend, client, exceptions # Set default logging handler to avoid "No handler found" warnings. import logging try: # Python 2.7+ from logging import NullHandler except ImportError: class NullHandler(logging.Handler): def emit(self, record): pass logging.getLogger(_...
bwind/pymogilefs
pymogilefs/__init__.py
Python
mit
354
# Definition for a binary tree node. # class TreeNode(object): # def __init__(self, x): # self.val = x # self.left = None # self.right = None class Solution(object): def isSameTree(self, p, q): """ :type p: TreeNode :type q: TreeNode :rtype: bool ...
pineal/Leetcode_OJ
python/100_Same_Tree.py
Python
mit
615
from flask import Blueprint from flask import render_template, jsonify, request, redirect, url_for mod = Blueprint('demo1', __name__, ) @mod.route('/', methods=["GET", "POST"]) def index(): return redirect(url_for('demo1.editor')) @mod.route('/editor', methods=["GET", "POST"]) def editor(): return render_t...
arpitbbhayani/editor-demo
app/views/demo1.py
Python
mit
1,134
import copy import functools from jsonobject import * from couchdbkit import schema from restkit import ResourceNotFound from couchjock.proxy_dict import ProxyDict SchemaProperty = ObjectProperty SchemaListProperty = ListProperty StringListProperty = functools.partial(ListProperty, unicode) SchemaDictProperty = DictPr...
dannyroberts/couchjock
couchjock/__init__.py
Python
mit
4,152
# Note: Some of these commands will technically not allow an attacker to execute # arbitrary system commands, but only specify the program to be executed. The general # consensus was that even this is still a high security risk, so we also treat them as # system command executions. # # As an example, executing `subproc...
github/codeql
python/ql/test/library-tests/frameworks/stdlib/SystemCommandExecution.py
Python
mit
8,427
from pythonosc import osc_server from pythonosc import osc_packet import threading import socketserver import socket class SimpleUDPClient(object): def __init__(self, address, port): self._sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) self._sock.setblocking(0) self._address = address self....
philipbjorge/osc-spy
forwarder.py
Python
mit
1,519
# -*- coding: utf-8 -*- from __future__ import unicode_literals import logging from django.utils.encoding import python_2_unicode_compatible from django.db import models LOG = logging.getLogger(__name__) @python_2_unicode_compatible class IndexSpecification(models.Model): project = models.ForeignKey('sunlumo_p...
candela-it/sunlumo
django_project/sunlumo_similaritysearch/models.py
Python
mit
1,234
# MIT License # # Copyright (c) 2018 Matthew Bedder (matthew@bedder.co.uk) # # 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...
bedder/gifbot
test/test_gif_bot.py
Python
mit
7,000
import json from django import template from django.utils.safestring import mark_safe register = template.Library() @register.filter def jsonify(value): return mark_safe(json.dumps(value))
tayfun/bilgisayfam
bilgisayfam/utils/templatetags/jsonify.py
Python
mit
197
import cv2 from http.server import BaseHTTPRequestHandler, HTTPServer from socketserver import ThreadingMixIn from threading import Thread import imutils import sys import socket import numpy as np import time from operator import itemgetter import math import os from subprocess import Popen, PIPE, STDOUT import socket...
SachinKonan/Windows-RPI-Vision-Framework
Combined/visionServer.py
Python
mit
11,133
import functools def concat(li: "list of strings") -> str: return functools.reduce(lambda a, b: a + b, li) def compose(*functions): def compose2(f, g): return lambda x: f(g(x)) return functools.reduce(compose2, functions) def thread_compose(*functions): return compose(*list(reversed(functions...
zekna/py-types
py_types/utils.py
Python
mit
596
import threading import queue import time import types def schedule(task): def send_message(self, message): self.get_queue().put(message) def set_queue(self, queue): self.queue = queue def get_queue(self): return self.queue task.send_message = types.MethodType(send_message, task) task.set_queue = type...
XBigTK13X/wiiu-memshark
background/background.py
Python
mit
833
def check(cur, uid): cur.execute("SELECT first_login FROM users WHERE uid=%s", (str(uid),)) result = cur.fetchall() if len(result) == 0: return ("This was not found in the database.", 412) return (str(result[0][0]), 200) def get(cur, uid, jsonenc): cur.execute("SELECT * FROM users WHERE uid=%s", (str(uid),)) r...
YtvwlD/dyluna
ajaxmod/first_login.py
Python
mit
1,638
#-*- coding:utf-8 -*- """ @author: Jeff Zhang @date: 2017-08-22 """ import numpy as np import random import math random.seed(0) # calculate a random number where: a <= rand < b def rand(a, b): return (b - a) * random.random() + a def dtanh(y): return 1.0 - y ** 2 def sigmoid(sum): return 1.0 / (1...
jfzhang95/lightML
SupervisedLearning/NeuralNetwork.py
Python
mit
4,222
# -*- coding: utf-8 -*- """ Created on Thu Aug 24 01:01:54 2017 @author: Suryansh """ # Importing the libraries import numpy as np import matplotlib.pyplot as plt import pandas as pd # Importing the dataset dataset = pd.read_csv('C:/Users/Suryansh/Desktop/Data Science Project/nlp/Natural-Language-Proces...
Maverick2024/R-vs-Python-why-you-should-learn-both
Python_NLP.py
Python
mit
1,886
""" Compute a hash for a JSON data structure, such that semantically equivalent JSON structures get the same hash. The notion of "semantic equivalence" is currently rather basic and informal. Eg, the following are semantically equivalent, and this is reflected in the computed hashes: ``` d3 = {'d1': {'a': 1, 'b': [...
schollii/sandals
json_sem_hash.py
Python
mit
2,297
#!/usr/bin/env python import sys def brute_force_optimal(string): """Return the longest duplicated substring. Keyword Arguments: string -- the string to examine for duplicated substrings This approach examines each possible pair of starting points for duplicated substrings. If the characters at...
taylor-peterson/longest-duplicated-substring
longest_duplicated_substring.py
Python
mit
1,103
""" This script is used to make a standard healpixel database in the `opsimsummary/example_data` repository. This database is a coarse grained NSIDE = 128 healpixelized OpSim created from enigma_1189_micro.db and is used for testing purposes. NOTE: To make this database, it is important to run this from the scripts ...
rbiswas4/simlib
scripts/make_healpixdb.py
Python
mit
2,819
from haystack import indexes from .models import Lecture class LectureIndex(indexes.SearchIndex, indexes.Indexable): university = indexes.CharField(model_attr='university') department = indexes.CharField(model_attr='department') name = indexes.CharField(document=True, use_template=True) year = indexes.IntegerFiel...
thebenwaters/openclickio
core/index.py
Python
mit
460
# coding: utf-8 """ Example of a « echo » websocket server by using `tornado_websocket.WebSocket`. """
Dturati/projetoUFMT
estagio/estagio/base/websocket/echo.py
Python
mit
111
import os from squadron.fileio.symlink import force_create_symlink def compare_contents(one, two): with open(one) as f1: with open(two) as f2: return f1.read() == f2.read() def test_symlink(tmpdir): tmpdir = str(tmpdir) source1 = os.path.join(tmpdir, 'source1') with open(source1, ...
gosquadron/squadron
squadron/fileio/tests/test_symlink.py
Python
mit
745
# -*- coding: utf-8 -*- import os import sys import json import time import pytest from errno import EEXIST from shutil import rmtree from tempfile import mkdtemp from gevent import socket from httplib import HTTPConnection from urllib2 import build_opener, AbstractHTTPHandler from gevent.subprocess import Popen, check...
snaury/copper
contrib/python-copper/t/conftest.py
Python
mit
3,321
import pygame as pg import os from Data.spritesheet_functions import SpriteSheet from Data.images import * from Data.level_classes import * from Data.player_related import * import Data.eztext pg.init() class Menu(): font_name = pg.font.SysFont('Terminal', 22, True, False) txtbx = Data.eztext.Input(maxlength=...
JamesStudd/PythonRPG
Data/menu.py
Python
mit
3,185
from django.conf.urls import url from . import views_for_staff urlpatterns = [ url(r'^$', views_for_staff.main, name='staff_area'), # Categories url(r'^categories/$', views_for_staff.categories, name='categories'), url(r'^categories/(?P<category_slug>[-\w]+)/$', ...
samitnuk/online_shop
apps/shop/urls_for_staff.py
Python
mit
1,213
#!/usr/bin/env python3 import os from setuptools import setup, find_packages # vcs+proto://host/path@revision#egg=project-version # this is latest upstream commit (April 2017) # upstream maintainer of urwidtrees doesn't maintain PyPI urwidtrees urwidtrees_source = "git+https://github.com/pazz/urwidtrees.git@9142c59d...
TomasTomecek/sen
setup.py
Python
mit
1,539
import subliminal import io from babelfish import Language def get_subtitle_path(video_path, video_language): video_extension = video_path.rsplit(".", 1)[-1] return video_path.replace(video_extension, video_language.alpha3 + ".srt") def save_subtitle(video, video_subtitle, encoding=None): subtitle_path...
rkohser/gustaf
app/core/subtitlesdownloader.py
Python
mit
1,561
import urllib.request import requests from hashlib import md5 import json import os from time import gmtime, strftime with open("config.json") as configfile: config = json.load(configfile) MANAGER_URL = config["MANAGER_URL"] SECRET_FOLDER = config["SECRET_FOLDER"] CAPABILITIES = config.get("CAPABILITI...
lanyudhy/Halite-II
apiserver/worker/backend.py
Python
mit
4,570
#!/usr/bin/python3 from selenium import webdriver from selenium.webdriver.common.keys import Keys import time import re import requests def guess_password(driver): driver.get("http://127.0.0.1:5000/") with open("names.txt", "r") as f: names = f.read() print(names) names = names.split("\n"...
shantnu/PythonForHackers
hack1.py
Python
mit
2,989
#!/usr/bin/env python3 #-*- encoding: utf-8 -*- import os, sys, tempfile, unittest import lxml.etree as etree ECMDS_INSTALL_DIR = os.path.normpath(os.path.join( os.path.dirname(os.path.realpath(sys.argv[0])), "..", ".." )) sys.path.insert(1, ECMDS_INSTALL_DIR + os.sep + 'lib') from net.ecromedos.error impor...
tobijk/ecromedos
test/ut/test_plugin_strip.py
Python
mit
2,099
from flask_wtf import Form from flask_wtf.html5 import EmailField from wtforms import StringField, PasswordField from wtforms.validators import DataRequired class SingUp(Form): name = StringField('name', validators=[DataRequired()]) email = EmailField('email', validators=[DataRequired()]) password = Passwo...
Tboan/academicforge
forms.py
Python
mit
368
from . import app from .model import github, pivotal from flask import request, abort import requests import re PIVOTAL_ACCESS_TOKEN = app.config['PIVOTAL_ACCESS_TOKEN'] GITHUB_ACCESS_TOKEN = app.config['GITHUB_ACCESS_TOKEN'] BLACKLISTED_GITHUB_ACTIONS = ('labeled', 'unlabeled') def log_and_abort(e): app.logger....
bionikspoon/pivotal-github-status
app/views.py
Python
mit
2,582
import os import numpy as np from PIL import Image import six import json import cv2 from io import BytesIO import common.paths as paths import numpy as np from .datasets_base import datasets_base class horse2zebra_train(datasets_base): def __init__(self, dataset_path=paths.root_horse2zebra, flip=1, resize_to=172,...
Aixile/chainer-cyclegan
datasets/horse2zebra.py
Python
mit
2,254
# Copyright (c) 2010-2014 Bo Lin # Copyright (c) 2010-2014 Yanhong Annie Liu # Copyright (c) 2010-2014 Stony Brook University # Copyright (c) 2010-2014 The Research Foundation of SUNY # # Permission is hereby granted, free of charge, to any person # obtaining a copy of this software and associated documentation files #...
mayli/DistAlgo
da/compiler/parser.py
Python
mit
75,023
__author__ = 'diegoj'
intelligenia/modeltranslation
modeltranslation/admin/__init__.py
Python
mit
22
#!/usr/bin/env python # vim: set fdm=marker: from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals import os import os.path import unittest import tempdir from .. import smart_dir_copy __version__ = '0.1' class Test_Sma...
shalesbridge/steamssdmanager
tests/test_smart_dir_copy.py
Python
mit
13,521
# coding: UTF-8 ''' Created on Apr 16, 2014 @author: hernan ''' import re from usig_normalizador_amba.settings import CALLE_ALTURA, CALLE_Y_CALLE, INVALIDO from usig_normalizador_amba.Calle import Calle class Direccion: ''' @ivar calle: Calle de la direccion @type calle: Calle @ivar altura: Altura ...
usig/normalizador-amba
usig_normalizador_amba/Direccion.py
Python
mit
3,273
#!/usr/bin/python3 import os os.system("git submodule init") os.system("git submodule update") print("Setup Completed")
SadGaming/SadSDLGame
scripts/setup.py
Python
mit
120
import ld import os import sys from flask_restful import Resource IS_WIN = os.name == 'nt' IS_LINUX = sys.platform.startswith('linux') IS_DARWIN = sys.platform.startswith('darwin') class Platform(Resource): def get(self): if IS_LINUX: return dict( id=ld.id(), ...
natict/roomservice
roomservice/system/platform.py
Python
mit
491
# 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/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations/_ddos_protection_plans_operations.py
Python
mit
23,738
# -*- coding: utf-8 -*- import 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 'Cfda', fields ['program_number'] db.create_unique('data_cfda', ['program_numb...
npp/npp-api
data/migrations/0032_auto__add_unique_cfda_program_number.py
Python
mit
165,019
# 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/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2021_06_01/aio/operations/_policy_definitions_operations.py
Python
mit
32,611
from django.conf.urls import url, include from diaries.api import * urlpatterns = [ url(r'^diary/', include("english_diary.urls.api.diary", namespace="diary")), url(r'^naver/', include("english_diary.urls.api.naver", namespace="naver")), url(r'^user/', include("english_diary.urls.api.user", namespace="us...
jupiny/EnglishDiary
english_diary/english_diary/urls/api/__init__.py
Python
mit
329
import sys import os import numpy l = [] for lines in open(sys.argv[1], 'rU'): lines = lines.strip() lexemes = lines.split('\t') if len(lexemes) == 12: seq_id = lexemes[3] seq_len = int(lexemes[5]) avg_Q = int(lexemes[-4]) overlap = int(lexemes[-3]) if avg_Q >= 25: # print seq_id l.append(overlap) ...
chnops/code
rdp_assem_stat_parser.py
Python
mit
804
# pylint: disable=C0111,R0903 # -*- coding: utf-8 -*- """Displays information about the current song in mocp. Left click toggles play/pause. Right click toggles shuffle. Requires the following executable: * mocp Parameters: * mocp.format: Format string for the song information. Replace string sequences with ...
tobi-wan-kenobi/bumblebee-status
bumblebee_status/modules/contrib/mocp.py
Python
mit
1,800
# encoding: UTF-8 """ 本模块中主要包含: 1. 从通联数据下载历史行情的引擎 2. 用来把MultiCharts导出的历史数据载入到MongoDB中用的函数 """ import os,sys from datetime import datetime, timedelta import pymongo from time import time from multiprocessing.pool import ThreadPool from ctaBase import * from vtConstant import * from vtFunction import loadMongoSetting f...
zhengwsh/InplusTrader_Linux
InplusTrader/ctaAlgo/ctaHistoryData.py
Python
mit
14,272
class Field: def __init__(self, (x,y,z), radius): self.coords = (x,y,z) self.radius = radius class AsteroidField(Field) class MineField(Field) class NavPoint: def __init__(self, ships = (), fields = (), coords = (x,y,z), stealth_flag = 0): self.ships = ships self.fields = fields self.coords = (x,y,z) ...
delMar43/wcmodtoolsources
WC1_clone/data_structures/FlightMission.py
Python
mit
481
import argparse import sys import os import json import math import re import datetime import html import subprocess import requests import appdirs from ratelimit import * __version__ = "0.1" headers = { 'Connection': 'keep-alive', 'Cache-Control': 'max-age=0', 'User-Agent': 'Mozilla/5.0 (Macintosh; Inte...
DrLuke/GazelleSort
gazellesort.py
Python
mit
11,974
from pythonforandroid.recipe import PythonRecipe class RequestsRecipe(PythonRecipe): version = '2.13.0' url = 'https://github.com/kennethreitz/requests/archive/v{version}.tar.gz' depends = ['setuptools'] site_packages_name = 'requests' call_hostpython_via_targetpython = False recipe = RequestsRe...
kronenpj/python-for-android
pythonforandroid/recipes/requests/__init__.py
Python
mit
327
from nose.tools import assert_equal from ..views.email import download, stringify from .... import make def test_download(): app = make() with app.app_context(): r = download('https://yuno.yande.re/data/preview/d0/94/d094d41d27b75027c48986f1294b3f3a.jpg', 'https://yande.re/') assert_equal(stri...
Answeror/torabot
torabot/mods/booru/test/test_download.py
Python
mit
404
import _plotly_utils.basevalidators class SelectedpointsValidator(_plotly_utils.basevalidators.AnyValidator): def __init__( self, plotly_name="selectedpoints", parent_name="scatterpolar", **kwargs ): super(SelectedpointsValidator, self).__init__( plotly_name=plotly_name, ...
plotly/python-api
packages/python/plotly/plotly/validators/scatterpolar/_selectedpoints.py
Python
mit
478
#!/usr/bin/python3 # coding: utf8 ########################################################### # # anime-checker.py # # by Eason Chang <eason@easonchang.com> # # A python script to automatically check whether my favorite animes # have updated and then send me an email to notify me. # # This script does a one-time ...
Kamigami55/anime-checker
main.py
Python
mit
2,465
#!/usr/bin/env python # -*- coding: utf-8 -*- """Check spelling of a file.""" import logging # pyspell files import utils def check(text, vocabulary): """Check ``text`` for mistakes by using ``vocabulary``.""" pass def main(input_file, vocabulary_file): """Automatically check and correct the spelling...
MartinThoma/pyspell
pyspell/check.py
Python
mit
1,278
from persistence.models import BaseModel from peewee import * class Agent(BaseModel): """description of class""" name = CharField(unique=True, null=True) hostname = CharField(unique=True, null=True) phonenumber = CharField(unique=True, null=True) def as_dict(self): c_timestamp = self.cre...
onnovalkering/sparql-over-sms
sos-service/src/persistence/models/agent.py
Python
mit
683
from PySide import QtGui, QtCore, QtSql __updated__ = "2015-07-14 10:12:08" # Display formats dateDispFormat = 'M/d/yyyy' disp_DateTime = 'M/d/yyyy h:map' timeDispFormat = 'h:mmap' # Internal formats DB_Date = 'yyyy-MM-dd' DB_Time = 'hh:mm:ss' DB_DateTime = DB_Date + ' ' + DB_Time # Scanner prefixes scanPrefix = '%...
galbrads/Gear_Manager
Util.py
Python
mit
12,446