max_stars_repo_path
stringlengths
3
269
max_stars_repo_name
stringlengths
4
119
max_stars_count
int64
0
191k
id
stringlengths
1
7
content
stringlengths
6
1.05M
score
float64
0.23
5.13
int_score
int64
0
5
Scripts/simulation/apartments/situations/neighbor_react_to_you_situation.py
velocist/TS4CheatsInfo
0
12792151
# uncompyle6 version 3.7.4 # Python bytecode 3.7 (3394) # Decompiled from: Python 3.7.9 (tags/v3.7.9:13c94747c7, Aug 17 2020, 18:58:18) [MSC v.1900 64 bit (AMD64)] # Embedded file name: T:\InGame\Gameplay\Scripts\Server\apartments\situations\neighbor_react_to_you_situation.py # Compiled at: 2018-07-22 23:17:14 # Size o...
1.492188
1
multiclass/train.py
kesamet/examples
1
12792152
<reponame>kesamet/examples<gh_stars>1-10 import joblib from typing import Tuple import bdrk import numpy as np import pandas as pd from bdrk.model_analyzer import ModelAnalyzer, ModelTypes from boxkite.monitoring.collector import ( BaselineMetricCollector, FeatureHistogramCollector, InferenceHistogramColle...
2.46875
2
src/deps/cares/cares.gyp
odant/conan-jscript
0
12792153
<gh_stars>0 { 'target_defaults': { 'conditions': [ ['OS!="win"', { 'defines': [ '_DARWIN_USE_64_BIT_INODE=1', '_LARGEFILE_SOURCE', '_FILE_OFFSET_BITS=64', '_GNU_SOURCE' ] }], [ 'OS=="aix"', { 'include_dirs': [ 'config/aix' ], ...
1.195313
1
app/models/seller_review.py
AlexEpstein1/316Amazon
0
12792154
<gh_stars>0 from flask import current_app as app, flash, redirect, render_template, request, url_for from flask_login import current_user from sqlalchemy import exc import datetime # Reviews of Sellers # CREATE TABLE SellerReview ( # user_id INT NOT NULL REFERENCES Users(id), # seller_id INT NOT NULL REFERENCES Sell...
2.390625
2
web/kwmo/kwmo/controllers/file_download.py
tmbx/kas
0
12792155
import logging import simplejson import time from pylons import request, response, session,config, tmpl_context as c from pylons.controllers.util import abort, redirect_to from kwmo.lib.base import BaseController, render from kfs_lib import * from kwmo.lib.file_download import kfs_download_generator from kwmo.model.k...
2.09375
2
mopro/processing/submitter.py
fact-project/mopro3
1
12792156
from threading import Thread, Event import logging import peewee import socket from ..database import CorsikaRun, CeresRun from ..queries import get_pending_jobs, count_jobs, update_job_status from .corsika import prepare_corsika_job from .ceres import prepare_ceres_job log = logging.getLogger(__name__) hostname = s...
2.109375
2
ensemble.py
statho/pytorch-cifar
0
12792157
<filename>ensemble.py<gh_stars>0 from tqdm import tqdm import os, pdb, logging, argparse import torch import torch.nn as nn import torch.optim as optim import torch.nn.functional as F import torch.backends.cudnn as cudnn from torch.utils.tensorboard import SummaryWriter import torchvision import torchvision.transform...
2.0625
2
web/app/views.py
sanjifr3/Narrator
11
12792158
""" Backend of Narrator web app. """ import os import sys import shutil import pandas as pd import skimage.io as io import PIL from flask import render_template, request, redirect, url_for, send_from_directory, session from app import app sys.path.append(app.config['COCOAPI_PATH'] + 'PythonAPI') from pycocotools.coco ...
2.140625
2
tests/test_collection.py
benthomasson/ansible-events
0
12792159
<gh_stars>0 from ansible_events.collection import ( find_collection, split_collection_name, find_source, load_rules, ) def test_find_collection(): location = find_collection("community.general") assert location is not None def test_find_collection_eda(): location = find_collection("benth...
1.90625
2
tests/test_person.py
FOR-THE-HORDE-OPUS/Orgrimmar
0
12792160
def test_update_person_name(): return def test_update_person_address(): return
1.179688
1
color_detection.py
smitdesai31/Image-Color-Detection
0
12792161
from tkinter import * import cv2 import numpy as np import urllib.request import pandas as pd from tkinter import filedialog from PIL import ImageTk,Image import pyperclip as pc root = Tk() root.title("Image Color Detection") root.geometry("936x536+300+130") root.configure(bg='#243B53') image_path = "" ...
3.109375
3
GM_brightness_metric/test/test_read_video.py
quosi/image_analysis
0
12792162
import pytest, logging from read_video import read_video def test_read_video(): test_data = "/Users/pepper/Projekte/PythonProjects/GM_brightness_metric/resources/video/Brosserness_4sec_h264_1920x1080_24fps_2Ch-stereo.mp4" #logging.info('ERROR') i = 0 for frame in read_video(test_data): logging....
2.34375
2
hackerrank/xor-sequence.py
ichko/DataStructures
3
12792163
<reponame>ichko/DataStructures #!/bin/python3 """ Xor-sequence SRC - https://www.hackerrank.com/challenges/xor-se/problem Sample Input 0: 3 2 4 2 8 5 9 Sample Output 0: 7 9 15 """ """ 11110 11110 30 - Числото 11100 00010 2 - две 11010 11000 24 - числото = числото - 6 11000 00000 0 - ...
3.15625
3
examples/pyglet_hello_world.py
rdeioris/compushady
17
12792164
import pyglet import platform import struct from ctypes import addressof,pointer import ctypes from compushady import HEAP_UPLOAD, Swapchain, Compute, Texture2D, Buffer from compushady.formats import B8G8R8A8_UNORM from compushady.shaders import hlsl if platform.system() != 'Windows': raise Exception('only Windows...
2.328125
2
core/migrations/remove_provider_dns_server_ip_model.py
simpsonw/atmosphere
197
12792165
# -*- coding: utf-8 -*- # Generated by Django 1.11.4 on 2018-09-07 21:53 from __future__ import unicode_literals from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('core', 'remove_atmosphereuser_selected_identity'), ] operations = [ migrations.Alte...
1.546875
2
flyer/decoder.py
FIXFlyer/pyflyer
2
12792166
<gh_stars>1-10 #! /usr/bin/env python #----------------------------------------------------------------------- # COPYRIGHT_BEGIN # Copyright (C) 2017, FixFlyer, LLC. # All rights reserved. # COPYRIGHT_END #----------------------------------------------------------------------- """Protocol decoder.""" import flyer M...
2.296875
2
src/xbrief/margin/matrix_margin/__init__.py
pydget/xbrief
0
12792167
<reponame>pydget/xbrief from .matrix_margin import MatrixMargin from .sizing import sizing
0.976563
1
event_input_cap_example.py
dbgraybeal/pysep
6
12792168
import obspy import read_event_obspy_file as reof from getwaveform import * def get_ev_info(ev_info,iex): # =============================================================== # SilwalTape2016 example event (Anchorage) if iex == 0: ev_info.use_catalog = 0 ev_info.otime = obspy.UTCDateTime("2009-04-07T2...
2.21875
2
rubato/utils/COL_TYPE.py
tinmarr/Alien-Fisher-Man
0
12792169
<reponame>tinmarr/Alien-Fisher-Man from enum import Enum class COL_TYPE(Enum): ELASTIC = 1 STATIC = 2
1.882813
2
spo/spo/doctype/medizinischer_bericht/medizinischer_bericht.py
libracore/spo
0
12792170
<gh_stars>0 # -*- coding: utf-8 -*- # Copyright (c) 2019, libracore and contributors # For license information, please see license.txt from __future__ import unicode_literals import frappe from frappe.model.document import Document from frappe.utils.data import formatdate class MedizinischerBericht(Document): pass ...
2.078125
2
waterbutler/core/streams/zip.py
laurenrevere/waterbutler
0
12792171
<reponame>laurenrevere/waterbutler import asyncio import binascii import struct import time import zipfile import zlib from waterbutler.core.streams import BaseStream from waterbutler.core.streams import MultiStream from waterbutler.core.streams import StringStream class ZipLocalFileDescriptor(BaseStream): """Th...
2.65625
3
img2art.py
kartikanand/img2art
0
12792172
import shutil import sys from PIL import Image def get_term_width(): """ return terminal width this function depends upon shutil.get_terminal_size this works only on Python >= 3.3 """ return shutil.get_terminal_size().columns def get_aspect_ratio(img): """ return the aspect ratio o...
3.828125
4
functions/Melody.py
Skentir/CSC617M
0
12792173
class Melody(): def __init__(self, notes): self.notes = []
1.757813
2
rpiatipo/EventsTest.py
m-c0d3/rpiatipo
0
12792174
from unittest import TestCase from unittest.mock import patch, Mock from rpiatipo.Events import Event, EventService class EventsTest(TestCase): @patch('rpiatipo.Events.EventService') def setUp(self, MockEventService): self.event = Event(type="test", data={"data": 1}) self.eventService = MockEve...
2.890625
3
nn_dataflow/tests/unit_test/test_resource.py
joeshow79/nn_dataflow
0
12792175
""" $lic$ Copyright (C) 2016-2019 by The Board of Trustees of Stanford University This program is free software: you can redistribute it and/or modify it under the terms of the Modified BSD-3 License as published by the Open Source Initiative. This program is distributed in the hope that it will be useful, but WITHOU...
2.15625
2
eworkshop/services/models/service_type.py
frankfern/eWorkshop-api
0
12792176
<reponame>frankfern/eWorkshop-api from django.db import models from eworkshop.utils.models import TimeModel class ServiceType(TimeModel): service_name = models.CharField(max_length=10, blank=False) def __str__(self) -> str: return self.service_name
2.21875
2
test.py
shl3807/ib_insync_
4
12792177
from ib_insync import * ib = IB() ib.connect('127.0.0.1', 7497, clientId=1) contract = Forex('EURUSD') bars = ib.reqHistoricalData(contract, endDateTime='', durationStr='30 D', barSizeSetting='1 hour', whatToShow='MIDPOINT', useRTH=True) # convert to pandas dataframe: df = util.df(bars) print(df[['date', 'op...
2.46875
2
dpm/transforms/affine.py
nextBillyonair/DPM
1
12792178
from .transform import Transform from torch.nn import Parameter import torch class Affine(Transform): def __init__(self, loc=0.0, scale=1.0, learnable=True): super().__init__() if not isinstance(loc, torch.Tensor): loc = torch.tensor(loc).view(1, -1) if not isinstance(scale, t...
2.359375
2
entity/turret/Turret.py
SamJakob/SpaceInvaders2
0
12792179
<gh_stars>0 import pygame class Turret: def __init__(self, MovementControls): self.speed = 40 self.lives = 3 self.score = 0 self.spriteImage = "assets/sprites/turret/shooter.png" self.sprite = pygame.image.load(self.spriteImage) spriteRect = self.sprite.get_rect() ...
2.96875
3
tests/calculate_syndrome_tests.py
Alasdair-Macindoe/HammingCodes
0
12792180
<reponame>Alasdair-Macindoe/HammingCodes<gh_stars>0 """ Lines 5 and 6 were adapted from SO code: http://stackoverflow.com/questions/4383571/importing-files-from-different-folder-in-python """ import sys sys.path.insert(0, '..') """ END """ import main as program import pytest def test_example(): """ From Lecture ...
2.703125
3
automation_infra/plugins/run.py
AnyVisionltd/automation-infra
6
12792181
<reponame>AnyVisionltd/automation-infra<filename>automation_infra/plugins/run.py import socket import logging from automation_infra.plugins import background, parallel import tempfile import os import subprocess from subprocess import CalledProcessError class Run(object): def __init__(self, ssh_client): ...
1.96875
2
config.py
jonas-scholz123/polarisation
0
12792182
<filename>config.py DATA_PATH = "/media/jonas/Extreme SSD/research/polarisation/data/2019_12/" ADJACENCY_MATRIX_PATH = "./intermediate_data/network_matrices/" ID_DICT_PATH = "./intermediate_data/id_to_sub_dicts/" EDGE_LIST_PATH = "./intermediate_data/edge_lists/" COUNT_COL_NAME = "f0_" MIN_COUNT_BOT_EXCLUSION = 500 SUB...
1.148438
1
tests/test_copy_samples.py
EdinburghGenomics/clarity_scripts
2
12792183
from builtins import sorted from itertools import cycle from unittest.mock import patch, Mock from pyclarity_lims.entities import Sample from scripts.copy_samples import Container from scripts.copy_samples import CopySamples from tests.test_common import TestEPP, FakeEntitiesMaker class TestCopySamples(TestEPP): ...
2.03125
2
conversion.py
casperwang/autovc
2
12792184
<reponame>casperwang/autovc #!/usr/bin/env python # coding: utf-8 # In[ ]: #from resemblyzer import preprocess_wav, VoiceEncoder #Style encoder import os import pickle import torch import numpy as np import data_loader.dataLoader as datas from math import ceil from model_vc import Generator device = 'cpu' G = Gener...
2
2
samples/miyukiCamera/sequentialDetecter_1.py
scrambleegg7/Mask_RCNN
0
12792185
# # Object detector (by sequential file read from directory) # import os import sys import random import math import re import time import numpy as np import tensorflow as tf import matplotlib import matplotlib.pyplot as plt import matplotlib.patches as patches from glob import glob import argparse import skimage impo...
2.46875
2
meraki_sdk/models/device_policy_enum.py
meraki/meraki-python-sdk
37
12792186
# -*- coding: utf-8 -*- """ meraki_sdk This file was automatically generated for meraki by APIMATIC v2.0 ( https://apimatic.io ). """ class DevicePolicyEnum(object): """Implementation of the 'DevicePolicy' enum. The policy to apply to the specified client. Can be 'Whitelisted', 'Bl...
1.5
2
app/djangoci/tests/test_hello_world.py
Dierme/django-circleci
0
12792187
from django.test import TestCase from django.test import Client class HelloWorldTestCase(TestCase): """Hello world tests""" def test_successful_case(self): """Successful test case""" self.assertTrue(True) def test_http_request(self): client = Client() response = client.ge...
2.703125
3
modelmapper/base.py
wearefair/modelmapper
5
12792188
import os import sys import logging import importlib from ast import literal_eval from copy import deepcopy from collections import defaultdict from collections import namedtuple, Counter from modelmapper.misc import read_csv_gen, load_toml, camel_to_snake from modelmapper.slack import slack OVERRIDES_FILE_NAME = "...
2.015625
2
ddos.py
black-software-Com/Black-Attacker
1
12792189
<reponame>black-software-Com/Black-Attacker<gh_stars>1-10 #!/usr/bin/python3 # Please read the code. Do not use ctrl + c and ctrl + v (~ ̄▽ ̄)~ import os,sys,socket,threading try: from colorama import Fore,init init() except ImportError: os.system("pip install colorama") end = '\033[0m' def main():...
2.484375
2
devices/server.py
marcelo-h-h/acoes_broker
1
12792190
<filename>devices/server.py import zmq import random import time class Server(): """ The server is the publisher, it has a stock associated with him and constantly generates a new variation of the stock price and publishes it to the forwarder, and consequently,to the subs """ def __init__(self, fro...
3.28125
3
spell-checking/predict_zemberek.py
mukayese-nlp/mukayese-baselines
21
12792191
<reponame>mukayese-nlp/mukayese-baselines from zemberek import ( TurkishSpellChecker, TurkishMorphology, ) import sys import json import pandas as pd from tqdm import tqdm morphology = TurkishMorphology.create_with_defaults() sc = TurkishSpellChecker(morphology) if __name__ == '__main__': df = pd.read_...
2.609375
3
custom/inddex/food.py
dimagilg/commcare-hq
471
12792192
""" This file contains the logic to generate the master dataset for the INDDEX reports Overview -------- Beneficiaries are asked about their diet in a "recall" session. This results in a "foodrecall" case. Every food they mention results in the creation of a "food" case that's a child of this foodrecall. This dataset...
2.046875
2
leprikon/utils.py
leprikon-cz/leprikon
4
12792193
import locale import os import re import string import unicodedata import zlib from datetime import date from urllib.parse import parse_qs, urlencode from django.core.exceptions import ObjectDoesNotExist from django.db import IntegrityError, transaction from django.urls import reverse_lazy as reverse from django.utils...
2.203125
2
OpenGLWrapper_JE/venv/Lib/site-packages/OpenGL/GL/NV/texture_expand_normal.py
JE-Chen/je_old_repo
0
12792194
'''OpenGL extension NV.texture_expand_normal This module customises the behaviour of the OpenGL.raw.GL.NV.texture_expand_normal to provide a more Python-friendly API Overview (from the spec) This extension provides a remapping mode where unsigned texture components (in the range [0,1]) can be treated a...
2.09375
2
runner/runner.py
alanbchristie/PyKubePressureCooker
4
12792195
#!/usr/bin/env python3 """An abstract _Runner_ module. """ from abc import ABCMeta, abstractmethod from collections import namedtuple from enum import Enum, auto, unique import threading import uuid RUNNER_IMAGE = 'alanbchristie/pydatalister' RUNNER_TAG = 'latest' @unique class RunnerState(Enum): """Runner exe...
2.75
3
Betsy/Betsy/modules/add_md_tags_to_bam_folder.py
jefftc/changlab
9
12792196
<reponame>jefftc/changlab<filename>Betsy/Betsy/modules/add_md_tags_to_bam_folder.py from Module import AbstractModule class Module(AbstractModule): def __init__(self): AbstractModule.__init__(self) def run( self, network, antecedents, out_attributes, user_options, num_cores, out_path):...
2.0625
2
examples/models.py
sayanjap/DynamicForms
42
12792197
<gh_stars>10-100 from datetime import timedelta from django.core.validators import MaxValueValidator, MinValueValidator, RegexValidator from django.db import models from django.utils import timezone class Validated(models.Model): """ Shows validation capabilities """ code = models.CharField(max_lengt...
2.515625
3
strings/jaden_case.py
ethyl2/code_challenges
0
12792198
<gh_stars>0 """ https://www.codewars.com/kata/5390bac347d09b7da40006f6 Given a string, return a string in which each word is capitalized Example: Not Jaden-Cased: "How can mirrors be real if our eyes aren't real" Jaden-Cased: "How Can Mirrors Be Real If Our Eyes Aren't Real" """ import string def to_jaden_case(...
4.15625
4
tests/test_chinormfilter.py
po3rin/chinormfilter
2
12792199
from chinormfilter import __version__ from chinormfilter.cli import Filter def test_version(): assert __version__ == '0.5.0' def test_kuro2sudachi_cli(capsys): f = Filter(dict_type="full") assert f.duplicated("林檎,りんご") is True assert f.duplicated("レナリドミド, レナリドマイド") is False assert f.duplicated("...
2.28125
2
test/test_getter.py
taleinat/funcy-chain
2
12792200
<filename>test/test_getter.py from funcy_chain import getter def test_long_path(Chain): data = [{"a": {"b": {"c": [1, 2, {"d": [3, {1: 2}]}]}}}] assert Chain(data).map(getter(["a", "b", "c", 2, "d", 1, 1])).value == [2] def test_names(Chain): data = { "user1": { "firstname": "Alice",...
2.609375
3
ValidacionEmail/validacionemail.py
BrianMarquez3/Python-Course
20
12792201
# Validacion de Correo Electronico en Python contador = 0 email = input("Ingrese su correo electronico: ") for i in email: if ("@" or "."): contador = contador+1 if contador == 2: print("Correo Valido") else: print("Correo Invalido")
3.921875
4
tests/demo_migrations/migrations.py
achaussier/copier
0
12792202
#!/usr/bin/env python3 import json import os import sys NAME = "{VERSION_FROM}-{VERSION_CURRENT}-{VERSION_TO}-{STAGE}.json" with open(NAME.format(**os.environ), "w") as fd: json.dump(sys.argv, fd)
2
2
Exp_train.py
KampfWut/MORE
2
12792203
# Author: <NAME> # Data: 2020-01-10 # Function: Run training #-------------------------- import package --------------------------# from __future__ import division from __future__ import print_function import time import tensorflow as tf import winsound from Code_utils import * from Code_models import G...
2.09375
2
cluster/multi_gpu_test.py
diegoaldarondo/dannce
0
12792204
<reponame>diegoaldarondo/dannce """Tests for locomotion.tasks.two_tap.""" import cluster.multi_gpu as multi_gpu import functools from absl.testing import absltest import numpy as np import os DEMO_PATH = "../demo/markerless_mouse1" CONFIG_PATH = "../tests/configs/dannce_mouse_config.yaml" DANNCE_PATH = "../tests/con...
2.109375
2
twick/response.py
jsvine/twick
63
12792205
from datetime import datetime from twick.tweet import Tweet import twick.settings as settings class Response(object): def __init__(self, raw): self.raw = raw self.tweets = list(map(Tweet, raw["statuses"])) self.metadata = dict(raw["search_metadata"]) self.timestamp = datetime.now() ...
2.890625
3
authors/apps/articles/migrations/0002_auto_20190515_1247.py
andela/ah-backend-dojo
3
12792206
# Generated by Django 2.1 on 2019-05-15 12:47 from django.conf import settings from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): initial = True dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ('articl...
1.648438
2
flask_toolkit/shared/payload_wrap.py
Creditas/flask-toolkit
3
12792207
<filename>flask_toolkit/shared/payload_wrap.py import json class PayloadWrap: _payload = dict() def __init__(self, payload): if isinstance(payload, str): self._payload = json.loads(payload) else: self._payload = payload def to_json(self): return json.dumps...
2.703125
3
tests/models.py
traktor88/test
0
12792208
from django.db import models from tagging.fields import TagField class Perch(models.Model): size = models.IntegerField() smelly = models.BooleanField(default=True) class Parrot(models.Model): state = models.CharField(maxlength=50) perch = models.ForeignKey(Perch, null=True) def __str__(self): ...
2.140625
2
scripts/validate_graph.py
dongguosheng/deepwalk
22
12792209
# -*- coding: gbk -*- import sys def validate(filename): n_max = -1 v_set = set() with open(filename) as fin: n_line = 0 for line in fin: n_line += 1 v_list = line.rstrip().split() if 'adj' in filename: if len(v_list) < 2: ...
3.1875
3
scripts/slave/recipes/simple_ci.py
bopopescu/chromium-build
0
12792210
<filename>scripts/slave/recipes/simple_ci.py # Copyright 2016 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. from recipe_engine.recipe_api import Property DEPS = [ 'recipe_engine/properties', 'recipe_engine/python',...
1.757813
2
io_sedASCII/import_amf.py
naomiEve/io_sedASCII
1
12792211
import bpy from bpy_extras.mesh_utils import ngon_tessellate from . import se3 def get_se3_mesh_form_file(filepath): file_query = se3.ASCIIFileQuery(filepath) version = file_query.get_num_value("SE_MESH") mesh = se3.Mesh(version) num_of_layers = file_query.get_num_value("LAYERS") file_que...
2.328125
2
src/plugins/basic/__init__.py
inuEbisu/inuBot
0
12792212
<filename>src/plugins/basic/__init__.py from nonebot import on_command from nonebot.rule import to_me from nonebot.typing import T_State from nonebot.adapters import Bot, Event from . import req, lang matcher_plugins = on_command('plugins', aliases={'help', '插件', '帮助'}, priority=1) @matcher_plugins.handle() async def ...
1.992188
2
routes.py
Yusef28/flattery
0
12792213
<filename>routes.py<gh_stars>0 #!interpreter [optional-arg] # -*- coding: utf-8 -*- # """ routes.py: All Routes """ #Built-in/Generic import datetime #Libs from flask import Flask, g, redirect, render_template, request, url_for, session, flash from flask_sqlalchemy import SQLAlchemy from sqlalchem...
2.328125
2
program/myparser.py
peter2141/IBT
0
12792214
import ply.lex as lex import ply.yacc as yacc import global_var # definicie tokenov tokens = ( 'STRING', 'NUMBER', 'FIELD', 'GRE', 'LOE', 'EQ', 'NEQ', ) # literaly literals = ['+', '-', '*', '/', '>', '<'] # popis tokenov t_FIELD = r'[a-zA-Z0-9_\.][a-zA-Z0-9_\.]*' t_STRING = r'\".*\"' t_GRE = '>=' t_LOE = '<=' ...
2.65625
3
cloudcix_rest/migrations/0001_initial.py
CloudCIX/framework
0
12792215
<filename>cloudcix_rest/migrations/0001_initial.py # Generated by Django 2.0.7 on 2018-07-09 13:50 from typing import List from django.db import migrations, models class Migration(migrations.Migration): dependencies: List[str] = [] operations = [ migrations.CreateModel( name='APILog', ...
1.992188
2
github/models.py
billryan/github-rss
0
12792216
<reponame>billryan/github-rss from django.db import models class Repo(models.Model): repo_url = models.URLField(max_length=200) owner = models.CharField(max_length=200) repo = models.CharField(max_length=200) def __unicode__(self): return self.owner + '/' + self.repo
2.015625
2
example3.py
djinn/python-duckduckgo
2
12792217
from duckduckgo import query def wikipedia_presence(text): """Find if a query has wikipedia article""" return query(text).abstract.url if query(text).abstract != None and query(text).abstract.source == 'Wikipedia' else None if __name__ == '__main__': import sys print wikipedia_presence(' '.join(sys.ar...
3.09375
3
Training_LSTM.py
monikaheinzl/basecalling-Hopfield
0
12792218
<gh_stars>0 #!/usr/bin/env python """ BSD 2-Clause License Copyright (c) 2021 (<EMAIL>) All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright...
1.390625
1
interview/migrations/0004_auto_20200829_1018.py
Jacklovely/django
63
12792219
# Generated by Django 3.1 on 2020-08-29 02:18 from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('interview', '0003_auto_20200828_2215'), ] operations = [ migrations.AlterModelOptions( name='candidate', options={'permissions...
1.59375
2
testbook/reference.py
loichuder/testbook
291
12792220
<reponame>loichuder/testbook from .exceptions import ( TestbookExecuteResultNotFoundError, TestbookAttributeError, TestbookSerializeError, TestbookRuntimeError ) from .utils import random_varname from .translators import PythonTranslator class TestbookObjectReference: def __init__(self, tb, name):...
2.28125
2
wavenet_tf/train.py
binh-vu/p699
0
12792221
"""Training script for the WaveNet network on the VCTK corpus. This script trains a network with the WaveNet using data from the VCTK corpus, which can be freely downloaded at the following site (~10 GB): http://homepages.inf.ed.ac.uk/jyamagis/page3/page58/page58.html """ from __future__ import print_function import...
2.640625
3
project-django/cry_pragati/usermodel/serializer.py
anuragrawat19/django_restframework
0
12792222
<reponame>anuragrawat19/django_restframework '''writing a serializer for the models so that state of model objects can be converted into a native python datatypes that can be easily rendered into JSON,XML''' from rest_framework import serializers from .models import CarBrands, EmployeeDesignations, Employees, Snippe...
2.484375
2
fly/response.py
tatsuya4649/fly
16
12792223
<filename>fly/response.py from ._fly_server import _fly_response import json from .cookie import * from .exceptions import * class _Response(_fly_response): @property def status_code(self): raise NotImplementedError( "_Response must have status_code attr" ) @property def ...
2.921875
3
dominating_set_testing.py
rbbi/ListMatricesAndRecursionCoursework
1
12792224
<filename>dominating_set_testing.py<gh_stars>1-10 def IsDominatingSet(A,S): NAV=[] for i in range(len(S)): dominator=S[i] vertex=A[dominator] NA=GetNonAdjacents(vertex,[],len(vertex)-1,dominator) NAV.append(NA) ToCheck=RemoveS(NAV,S) return Check(A,S,ToCheck) def Check(A...
2.953125
3
src/run_for_every.py
e2t/cli-tools
0
12792225
<reponame>e2t/cli-tools """ Рекурсивный запуск указанного процесса для каждого из указанных файлов. Программа принимает в качестве аргументов путь к процессу, его параметры и список файлов. Затем процесс запускается с указанными параметрами + имя одного из файлов. Запуск может производиться последовательно или паралле...
2.34375
2
bobocep/rules/events/composite_event.py
r3w0p/bobocep
5
12792226
<reponame>r3w0p/bobocep from typing import Dict from bobocep.rules.events.bobo_event import BoboEvent from bobocep.rules.events.histories.bobo_history import BoboHistory class CompositeEvent(BoboEvent): """A composite event. :param timestamp: The event timestamp indicating when it was first ...
2.90625
3
pymortar/setup.py
gtfierro/mortar-frontend
0
12792227
import setuptools with open("README.md", "r") as fh: long_description = fh.read() print(setuptools.find_packages()) setuptools.setup( name="pymortar", version="0.1.4", author="<NAME>", author_email="<EMAIL>", description="Python3 Mortar", long_description=long_description, long_descrip...
1.601563
2
examples/Imagine/dynamical_test.py
smbct/LOLH
2
12792228
<gh_stars>1-10 #!/usr/bin/python import math import numpy as np import pandas as pd import matplotlib.pyplot as plt import os import sys sys.path.append('../../python') from instance import Instance import visualizer import histogram from network import GData from network import Graph # # read the atoms from t...
2.6875
3
back-end/erasmail/emails/migrations/0043_auto_20210425_0635.py
SamirM-BE/ErasMail
7
12792229
<reponame>SamirM-BE/ErasMail # Generated by Django 3.1.6 on 2021-04-25 06:35 from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('emails', '0042_auto_20210423_0844'), ] operations = [ migrations.RenameField( model_name='emailheaders', ...
1.546875
2
2868.py
ShawonBarman/URI-Online-judge-Ad-Hoc-level-problem-solution-in-python
1
12792230
c = int(input()) while c != 0: c -= 1 num1, sign1, num2, sign2, ans = input().split() correct_ans = 0 if sign1 == "+": correct_ans = int(num1) + int(num2) elif sign1 == "-": correct_ans = int(num1) - int(num2) else: correct_ans = int(num1) * int(num2) answe...
3.6875
4
ogb/graphproppred/ppa/transformer.py
rdangovs/6883-project
0
12792231
<reponame>rdangovs/6883-project import dgl import torch import torch.nn as nn import torch.nn.functional as F import numpy as np from scipy.linalg import eig class TopologicalEncoding(): def __init__(self, encoding_size=50): self.encoding_size = encoding_size def encode(self, graph): A = gra...
2.171875
2
detection.py
harrisonedwards/OET_Controller
0
12792232
import cv2 import numpy as np def detect(img): # finds and fills the located robots img = cv2.convertScaleAbs(img, 1, 1.5) structure = np.ones((3, 3)) canny = np.copy(cv2.Canny(img, 20, 120)) dilated = cv2.dilate(canny, structure) contours, hier = cv2.findContours(dilated, cv2.RETR_T...
2.90625
3
compphys/__init__.py
JWKennington/CompPhys
0
12792233
"""Package-level information""" __MAJOR__ = 0 __MINOR__ = 0 __MICRO__ = 1 __VERSION__ = (__MAJOR__, __MINOR__, __MICRO__) __version__ = '.'.join(str(n) for n in __VERSION__) __github_url__ = 'https://github.com/JWKennington/CompPhys' from compphys.tests import run_tests # top level function for running test suite, an...
1.53125
2
redlight/err.py
sburns/red-light
1
12792234
#!/usr/bin/env python # -*- coding: utf-8 -*- """ err.py Redlight errors """ __author__ = '<NAME> <<EMAIL>>' __copyright__ = 'Copyright 2012 Vanderbilt University. All Rights Reserved' class RedlightError(Exception): pass
1.671875
2
install.py
InfinityMarketing/Harbor-Script
0
12792235
<reponame>InfinityMarketing/Harbor-Script #! /usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Thu Aug 3 14:20:50 2017 @author: <NAME> """ import zipfile import os import requests import glob import subprocess import platform import sys, getopt import argparse import re def main(): pa...
1.6875
2
green/__init__.py
dtan3847/green
0
12792236
<filename>green/__init__.py from __future__ import unicode_literals from .cmdline import main from .version import __version__ main __version__
1.15625
1
PcmPy/vis.py
mehrdadkashefi/PcmPy
0
12792237
<filename>PcmPy/vis.py<gh_stars>0 #!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Functions for visualization of PCM models, Data, and model fits @author: jdiedrichsen """ import numpy as np import matplotlib.pyplot as plt import matplotlib.patches as patches import matplotlib.lines as mlines import seaborn as sb i...
2.765625
3
src/lr/models/transformers/processor.py
felipessalvatore/logical-robustness
0
12792238
<filename>src/lr/models/transformers/processor.py import re import logging import torch import os import pandas as pd import numpy as np from multiprocessing import Pool import random from transformers.data.processors.utils import InputExample, InputFeatures from transformers.data.processors.utils import DataProcessor ...
2.609375
3
k8s_snapshots/logconf.py
gmarkey/k8s-snapshots
326
12792239
<filename>k8s_snapshots/logconf.py<gh_stars>100-1000 import logging import logging.config from collections import OrderedDict from typing import Optional, List, Any, Dict import structlog import sys from k8s_snapshots import serialize class ProcessStructuredErrors: def __init__(self): pass def __ca...
2.171875
2
utserverquery/unrealmaster.py
cwilkc/utserverquery
1
12792240
import socket import re import concurrent.futures from pprint import pformat from .unrealserver import UnrealServer # Setup Logger import logging logger = logging.getLogger(__name__) logger.addHandler(logging.NullHandler()) class UnrealMasterServer(object): def __init__( self, hostname, ...
2.6875
3
tests/test_neo4j.py
NCATS-Gamma/robokop-messenger
0
12792241
"""Test Neo4j.""" # pylint: disable=redefined-outer-name,no-name-in-module,unused-import # ^^^ this stuff happens because of the incredible way we do pytest fixtures import json import os import pytest from .setup.neo4j_ import get_edge_properties, get_node_properties NEO4J_URL = os.environ.get('NEO4J_URL', 'http://lo...
2.234375
2
src/pyTemplateBath/hello.py
StephenRicher/pyTemplate
0
12792242
<gh_stars>0 #!/usr/bin/env python3 """ Print Hello World.""" import logging def hello_world(name='World', **kwargs): print(f'Hello {name}.') logging.debug(f"Printed 'Hello {name}.'")
2.671875
3
prml/kernel/support_vector_classifier.py
dinhtuyen/PRML01
2
12792243
<gh_stars>1-10 import numpy as np class SupportVectorClassifier(object): def __init__(self, kernel, C=np.Inf): """ construct support vector classifier Parameters ---------- kernel : Kernel kernel function to compute inner products C : float ...
2.953125
3
anti-spoof/augmentor.py
hudmgy/insightface
1
12792244
<filename>anti-spoof/augmentor.py<gh_stars>1-10 import Augmentor def RandomAugment(folder, IP=False, Graph=False, Erase=False): if IP==False and Graph==False and Erase==False: return None p = Augmentor.Pipeline(folder) if IP: p.random_color(0.5, min_factor=0.4, max_factor=1.6) p.r...
2.5625
3
registrations/migrations/0015_auto_20181015_1002.py
praekeltfoundation/ndoh-hub
0
12792245
<filename>registrations/migrations/0015_auto_20181015_1002.py # Generated by Django 2.1.2 on 2018-10-15 10:02 import django.db.models.deletion from django.conf import settings from django.db import migrations, models class Migration(migrations.Migration): dependencies = [("registrations", "0014_auto_20180503_14...
1.476563
1
app/routes.py
BrevinS/brebapp
0
12792246
from flask import render_template, flash, redirect, url_for, request from app import app, db from flask_sqlalchemy import sqlalchemy from app.forms import RegisterForm, LoginForm from app.models import User from flask_login import current_user, login_user, logout_user, login_required @app.before_first_request def init...
2.71875
3
codigo_Python_Raspberry/detect_status_plants.py
jonathanramirezislas/HidroTerra
1
12792247
import cv2 import numpy as np cap = cv2.VideoCapture(0) while True: _, frame = cap.read() hsv_frame = cv2.cvtColor(frame, cv2.COLOR_BGR2HSV) # Red color low_red = np.array([161, 155, 84]) high_red = np.array([179, 255, 255]) red_mask = cv2.inRange(hsv_frame, low_red, high_red) red = cv2.b...
2.8125
3
src/articles/utils.py
robzzy/articles-service
0
12792248
<reponame>robzzy/articles-service<gh_stars>0 # -*- coding: utf-8 -*- from datetime import datetime def utcnow(): return datetime.utcnow()
1.992188
2
openstack_registration/views.py
AMfalme/Horizon_Openstack
0
12792249
from django.shortcuts import render from django.conf.urls import url from django.http import HttpResponse from django.views.decorators.csrf import csrf_protect from django.views.decorators.debug import sensitive_post_parameters from django.views.decorators.cache import never_cache from django import shortcuts from djan...
2.0625
2
setup.py
samir-joshi/tmtoolkit
167
12792250
<filename>setup.py<gh_stars>100-1000 """ tmtoolkit setuptools based setup module """ import os from codecs import open from setuptools import setup, find_packages __title__ = 'tmtoolkit' __version__ = '0.10.0' __author__ = '<NAME>' __license__ = 'Apache License 2.0' GITHUB_URL = 'https://github.com/WZBSocialScienc...
1.367188
1