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
sample_problems/problems_with_solution23.py
adi01trip01/adi_workspace
0
29000
<gh_stars>0 # Write a Python program to get the n (non-negative integer) copies of the first 2 characters of a given string. # Return the n copies of the whole string if the length is less than 2 s = input("Enter a string: ") def copies(string, number): copy = "" for i in range(number): copy += strin...
3.84375
4
codeforces/binarySearch二分搜索/1400/1284B上升组合.py
yofn/pyacm
0
29001
#!/usr/bin/env python3 #https://codeforces.com/problemset/problem/1284/B #记录每个序列是否有上升,如果没有min.max是多少.. #n=1e5,还得避免O(N**2).. #上升情况分解 #情况1: sx+sy中sx或sy本身是上升的 #情况2: sx,sy都不上升,判断四个极值的情况(存在几个上升) #DP..增量计数; f(n+1)=f(n)+X; X=?? # 如果s本身上升,X=(2n+1) # 如果s本身不升,拿s的min/max去一个数据结构去检查(min/max各一个?)..(低于线性..binary search??) # .. def ...
2.8125
3
tests/regressiontests/auth_decorators/__init__.py
mdornseif/huDjango
0
29002
"""Test hudjango.auth.decorator functionality."""
1.101563
1
examples/ttt_wm_vs_human.py
pearlfranz20/AL_Core
10
29003
<reponame>pearlfranz20/AL_Core from apprentice.agents import SoarTechAgent from apprentice.working_memory import ExpertaWorkingMemory from apprentice.working_memory.representation import Sai # from apprentice.learners.when_learners import q_learner from ttt_simple import ttt_engine, ttt_oracle def get_user_demo(): ...
2.25
2
pic_carver.py
volf52/black_hat_python
0
29004
<reponame>volf52/black_hat_python #!/usr/bin/env python """ @author : '<NAME> <<EMAIL>>' """ import re import zlib import cv2 from scapy.all import * pics = "pictues" faces_dir = "faces" pcap_file = "bhp.pcap" def get_http_headers(http_payload): try: headers_raw = http_payload[:http_payload.index("\r...
2.484375
2
py/testdir_hosts/test_rf_311M_rows_hosts.py
vkuznet/h2o
0
29005
import unittest, sys, time sys.path.extend(['.','..','py']) import h2o_cmd, h2o, h2o_hosts, h2o_browse as h2b, h2o_import as h2i # Uses your username specific json: pytest_config-<username>.json # copy pytest_config-simple.json and modify to your needs. class Basic(unittest.TestCase): def tearDown(self): h...
2.140625
2
.ipynb_checkpoints/config-checkpoint.py
BillKiller/ECG_shandong
0
29006
# -*- coding: utf-8 -*- ''' @time: 2019/9/8 18:45 @ author: javis ''' import os class Config: # for data_process.py #root = r'D:\ECG' root = r'data' train_dir = os.path.join(root, 'ecg_data/') # test_dir = os.path.join(root, 'ecg_data/testA') # train_label = os.path.join(root, 'hf_round1_labe...
2.109375
2
integration-tests/steps/test_update_stack.py
rootifera/sceptre
2
29007
<reponame>rootifera/sceptre<filename>integration-tests/steps/test_update_stack.py from behave import * import subprocess import os import boto3 @when("the stack config is changed") def step_impl(context): # Get config file path vpc_config_file = os.path.abspath(os.path.join( os.path.dirname(os.path.di...
2.046875
2
test.py
ask-santosh/Document-Matching
0
29008
import cv2 import matplotlib.pyplot as plt import easyocr reader = easyocr.Reader(['en'], gpu=False) image = cv2.imread('results/JK_21_05/page_1.jpg') gray = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY) dilated = cv2.dilate(image, None, iterations=1) eroded = cv2.erode(image, None, iterations=1) res = reader.readtext(erod...
2.875
3
configs/_base_/models/x3d.py
ptoupas/mmaction2
0
29009
<reponame>ptoupas/mmaction2<gh_stars>0 # model settings model = dict( type='Recognizer3D', backbone=dict(type='X3D', frozen_stages = -1, gamma_w=1, gamma_b=2.25, gamma_d=2.2), cls_head=dict( type='X3DHead', in_channels=432, num_classes=400, multi_class=False, spatial_...
1.421875
1
amktools/util.py
jimbo1qaz/amktools
2
29010
<gh_stars>1-10 from typing import TypeVar, Optional def ceildiv(n: int, d: int) -> int: return -(-n // d) T = TypeVar("T") def coalesce(*args: Optional[T]) -> T: if len(args) == 0: raise TypeError("coalesce expected >=1 argument, got 0") for arg in args: if arg is not None: ...
3.109375
3
tello_detection_v2.py
m0dzi77a/jetson-nano-drone-surveillance
0
29011
<filename>tello_detection_v2.py from djitellopy import Tello import cv2, math import numpy as np import jetson.inference import jetson.utils from threading import Thread import time net = jetson.inference.detectNet("ssd-mobilenet-v1", threshold=0.5) #facenet is working; ssd-mobilenet-v1 drohne = Tello() drohne.connec...
2.5
2
sql_judge/model/load_types.py
r4ulill0/gui_dbjudge
1
29012
from PyQt5.QtCore import QAbstractTableModel, QAbstractItemModel from PyQt5.QtCore import Qt, QModelIndex, pyqtSlot class LoadTypesProcess(QAbstractTableModel): def __init__(self): super().__init__() self.csv_values = [] self.header_model = HeaderModel() def index(self, row, column, p...
2.34375
2
examples/example1.py
michael-riha/gstreamer-101-python
4
29013
#!/usr/bin/env python # mix of: # https://www.programcreek.com/python/example/88577/gi.repository.Gst.Pipeline # https://github.com/GStreamer/gst-python/blob/master/examples/helloworld.py # http://lifestyletransfer.com/how-to-launch-gstreamer-pipeline-in-python/ import sys import collections from pprint import pprint...
2.21875
2
tests/server1_test.py
kalebswartz7/sirepo
0
29014
# -*- coding: utf-8 -*- u"""Test simulationSerial :copyright: Copyright (c) 2016 RadiaSoft LLC. All Rights Reserved. :license: http://www.apache.org/licenses/LICENSE-2.0.html """ from __future__ import absolute_import, division, print_function import pytest pytest.importorskip('srwl_bl') #: Used for a sanity check o...
2.140625
2
kg_nodeexporter/tests/test_builder.py
RangelReale/kg_nodeexporter
0
29015
import unittest from kubragen import KubraGen from kubragen.jsonpatch import FilterJSONPatches_Apply, ObjectFilter, FilterJSONPatch from kubragen.provider import Provider_Generic from kg_nodeexporter import NodeExporterBuilder, NodeExporterOptions class TestBuilder(unittest.TestCase): def setUp(self): s...
2.234375
2
docs/ASH/notebooks/object-segmentation-on-azure-stack/score.py
RichardZhaoW/AML-Kubernetes
176
29016
import os import json import time import torch # Called when the deployed service starts def init(): global model global device # Get the path where the deployed model can be found. model_filename = 'obj_segmentation.pkl' model_path = os.path.join(os.environ['AZUREML_MODEL_DIR'], model_filename) ...
2.4375
2
acos_client/v21/slb/virtual_port.py
jjmanzer/acos-client
0
29017
<reponame>jjmanzer/acos-client # Copyright 2014, <NAME>, A10 Networks. # # 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 # # ...
1.648438
2
base/struct_data.py
cateatfish108/AutoTest
0
29018
<filename>base/struct_data.py #coding:utf-8 # 数据库结构体 class DataBase: url = "" port = 3306 username = "" password = "" database = "" charset = "" # 测试用例信息结构体 class CaseInfo: path = "" case_list = [] # 测试用例结构体 class Case: url = "" db_table = "" case_id = "" m...
2.359375
2
pox/info/debug_deadlock.py
korrigans84/pox_network
416
29019
<reponame>korrigans84/pox_network # Copyright 2012 <NAME> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at: # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable...
1.9375
2
src/test/chirc/tests/fixtures.py
Schrotty/sIRC
2
29020
<filename>src/test/chirc/tests/fixtures.py channels1 = { "#test1": ("@user1", "user2", "user3"), "#test2": ("@user4", "user5", "user6"), "#test3": ("@user7", "user8", "user9") } channels2 = { "#test1": ("@user1", "user2", "user3"), "#test2": ("@user4", "user5", "us...
1.960938
2
src/annalist_root/annalist/models/entityfinder.py
gklyne/annalist
18
29021
from __future__ import unicode_literals from __future__ import absolute_import, division, print_function """ This module contains (and isolates) logic used to find entities based on entity type, list selection criteria and search terms. """ __author__ = "<NAME> (<EMAIL>)" __copyright__ = "Copyright 2014, <NAME...
2.328125
2
screengrab.py
denosawr/fairdyne-ai
0
29022
<reponame>denosawr/fairdyne-ai<filename>screengrab.py from mss import mss from PIL import Image def screengrab(monitor=0, output="screenshot.png"): """ Uses MSS to capture a screenshot quickly. """ sct = mss() monitors = sct.enum_display_monitors() scale = 1 game_x = 300*scale game_y = 300*sc...
2.71875
3
camper/handlers/users/edit.py
mrtopf/camper
13
29023
<filename>camper/handlers/users/edit.py #encoding=utf8 from starflyer import Handler, redirect, asjson from camper import BaseForm, db, BaseHandler from camper import logged_in, is_admin from wtforms import * from sfext.babel import T from camper.handlers.forms import * import werkzeug.exceptions from bson import Objec...
2.28125
2
scripts/citation_extractor/citation_extractor.py
elainehoml/Savu
39
29024
import argparse import h5py import sys import os from savu.version import __version__ class NXcitation(object): def __init__(self, description, doi, endnote, bibtex): self.description = description.decode('UTF-8') self.doi = doi.decode('UTF-8') self.endnote = endnote.decode('UTF-8') ...
2.5625
3
src/predict_ball_pos/src/predict_ball_position.py
diddytpq/Predict-Tennisball-LandingPoint
0
29025
<reponame>diddytpq/Predict-Tennisball-LandingPoint<gh_stars>0 #! /home/drcl_yang/anaconda3/envs/py36/bin/python from pathlib import Path import sys FILE = Path(__file__).absolute() sys.path.append(FILE.parents[0].as_posix()) # add code to path path = str(FILE.parents[0]) import numpy as np from sympy import Symbol...
1.898438
2
methylize/genome_browser.py
FoxoTech/methylize
2
29026
import time import pymysql # for pulling UCSC data import pandas as pd from pathlib import Path import logging # app from .progress_bar import * # tqdm, context-friendly LOGGER = logging.getLogger(__name__) logging.basicConfig(level=logging.INFO) logging.getLogger('numexpr').setLevel(logging.WARNING) # these login st...
2.125
2
node_modules/python-shell/test/python/echo_json.py
brenocg29/TP1RedesInteligentes
22
29027
import sys, json # simple JSON echo script for line in sys.stdin: print json.dumps(json.loads(line))
1.96875
2
test.py
sxhfut/Kashgari
1
29028
# encoding: utf-8 """ @author: BrikerMan @contact: <EMAIL> @blog: https://eliyar.biz @version: 1.0 @license: Apache Licence @file: test.py.py @time: 2019-01-25 14:43 """ import unittest from tests import * from kashgari.utils.logger import init_logger init_logger() if __name__ == '__main__': unittest.main()
0.972656
1
crossasr/text.py
mhilmiasyrofi/CrossASRv2
3
29029
import functools @functools.total_ordering class Text: def __init__(self, id: int, text: str): self.id = id self.text = text def __eq__(self, other): return self.id == other.id and self.text == other.text def __lt__(self, other): return (self.id, self.text) < (other.id, ot...
3.46875
3
models/Forest.py
guitassinari/random-forest
0
29030
<gh_stars>0 from models.DecisionTree import DecisionTree class Forest: def __init__(self, hyper_parameters, training_set): """ Inicializa a floresta com suas árvores. :param hyper_parameters: dictionary/hash contendo os hiper parâmetros :param training_set: dataset de treinamento ...
3.0625
3
ansibler/exceptions/ansibler.py
ProfessorManhattan/ansibler
0
29031
class BaseAnsiblerException(Exception): message = "Error" def __init__(self, *args, **kwargs) -> None: super().__init__(*args) self.__class__.message = kwargs.get("message", self.message) def __str__(self) -> str: return self.__class__.message class CommandNotFound(BaseAnsiblerEx...
2.453125
2
gestao_contato/tests.py
rbiassusi/gesta_contatos
0
29032
<filename>gestao_contato/tests.py # -*- coding: utf-8 -*- from django.test import TestCase, Client from models import Contato import json class TestCase(TestCase): """ Realiza o teste utilizando request a API e avaliando seu retorno """ def setUp(self): self.c = Client() def test_contato...
2.65625
3
bouncy.py
kary1806/bouncy
0
29033
from itertools import count, tee class Bouncy: def __init__(self, porcentage): """ print the number bouncy :type porcentage: int -> this is porcentage of the bouncy """ nums = count(1) rebound = self.sum_number(map(lambda number: float(self.is_rebound(number)), coun...
3.5625
4
pipeline.py
ankitshah009/BioASQ-Rabbit
1
29034
#!/usr/bin/env python import sys from deiis.rabbit import Message, MessageBus from deiis.model import Serializer, DataSet, Question if __name__ == '__main__': if len(sys.argv) == 1: print 'Usage: python pipeline.py <data.json>' exit(1) # filename = 'data/training.json' filename = sys.argv...
2.53125
3
106 Construct Binary Tree from Preorder and Inorder Traversal.py
gavinfish/LeetCode
1
29035
<gh_stars>1-10 """ Given preorder and inorder traversal of a tree, construct the binary tree. Note: You may assume that duplicates do not exist in the tree. """ __author__ = 'Danyang' class TreeNode: def __init__(self, x): self.val = x self.left = None self.right = None ...
3.765625
4
Python/python_study_4/page13/script.py
zharmedia386/Progate-Course-Repo
0
29036
<filename>Python/python_study_4/page13/script.py from menu_item import MenuItem # Move the code above to menu_item.py # Import the MenuItem class from menu_item.py menu_item1 = MenuItem('Sandwich', 5) print(menu_item1.info()) result = menu_item1.get_total_price(4) print('Your total is $' + str(result))
3.484375
3
ipysimulate/tools.py
JoelForamitti/ipysimulate
5
29037
<filename>ipysimulate/tools.py<gh_stars>1-10 def make_list(element, keep_none=False): """ Turns element into a list of itself if it is not of type list or tuple. """ if element is None and not keep_none: element = [] # Convert none to empty list if not isinstance(element, (list, tuple, set)): ...
3.5
4
2048/View.py
nsiegner/AI-ML-learning
1
29038
import tkinter as tk class View(): def __init__(self): window = tk.Tk() self.frame = tk.Frame(master=window, width=200, height=200) self.frame.pack() def show_grid(self, grid): for i in range(4): for j in range(4): label = tk.Label(master=self.frame,...
3.375
3
other tests/test_6_create_record_label.py
pavelwearevolt/Cross_Edit_TestsAutomatization
0
29039
<filename>other tests/test_6_create_record_label.py<gh_stars>0 __author__ = 'pavelkosicin' from model.label import Label def test_create_record_label(app): app.label.create_recording_artist(Label(name="rl_#1", asap="WB86-8RH31.50UTS-J", note="Mens autem qui est in festi...
1.703125
2
tensorsketch/evaluate.py
udellgroup/tensorsketch
6
29040
import numpy as np def eval_rerr(X, X_hat, X0=None): """ :param X: tensor, X0 or X0+noise :param X_hat: output for apporoximation :param X0: true signal, tensor :return: the relative error = ||X- X_hat||_F/ ||X_0||_F """ if X0 is not None: error = X0 - X_hat return np.linalg....
2.734375
3
mne/datasets/visual_92_categories/visual_92_categories.py
fmamashli/mne-python
3
29041
<filename>mne/datasets/visual_92_categories/visual_92_categories.py # License: BSD Style. from ...utils import verbose from ..utils import _data_path, _data_path_doc, _get_version, _version_doc @verbose def data_path(path=None, force_update=False, update_path=True, download=True, verbose=None): """...
2.59375
3
src/commons/helpers.py
thierrydecker/nfpy
0
29042
"""helpers module """ import json import pcap import yaml def get_adapters_names(): """Finds all adapters on the system :return: A list of the network adapters available on the system """ return pcap.findalldevs() def config_loader_yaml(config_name): """Loads a .yml configuration file :p...
3.171875
3
evaluarnumprimo.py
neriphy/numeros_primos
0
29043
<reponame>neriphy/numeros_primos #Evaludador de numero primo #Created by @neriphy numero = input("Ingrese el numero a evaluar: ") divisor = numero - 1 residuo = True while divisor > 1 and residuo == True: if numero%divisor != 0: divisor = divisor - 1 print("Evaluando") residuo = True elif numero%divisor ==...
4.25
4
src/ssp/ml/transformer/text_preprocessor.py
gyan42/spark-streaming-playground
10
29044
<filename>src/ssp/ml/transformer/text_preprocessor.py<gh_stars>1-10 #!/usr/bin/env python __author__ = "<NAME>" __copyright__ = "Copyright 2020, The Spark Structured Playground Project" __credits__ = [] __license__ = "Apache License" __version__ = "2.0" __maintainer__ = "<NAME>" __email__ = "<EMAIL>" __status__ = "Edu...
2.390625
2
multi_lan_ner.py
jpotwor/multi_lan_ner
0
29045
import spacy def find_entities(input_phrase, language): models = { 'en': 'en_core_web_sm', 'pl': 'pl_core_news_sm', 'fr': 'fr_core_news_sm', 'de': 'de_core_news_sm', 'it': 'it_core_news_sm', } if language in models: nlp = spacy.load(models[language]) doc = nlp(input_phrase)...
2.78125
3
Daily-Coding-Problem/Problem4/Problem4.py
grisreyesrios/Solutions--Daily-Coding-Problems
1
29046
# Python programming that returns the weight of the maximum weight path in a triangle def triangle_max_weight(arrs, level=0, index=0): if level == len(arrs) - 1: return arrs[level][index] else: return arrs[level][index] + max( triangle_max_weight(arrs, level + 1, index), triangle_ma...
3.921875
4
src/users/models/componentsschemasmicrosoft_graph_workbooktablesortallof1.py
peombwa/Sample-Graph-Python-Client
0
29047
# coding=utf-8 # -------------------------------------------------------------------------- # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is # regenerated. # -------------------------------------------------------------------------- from ...
1.820313
2
python/FPgrowth/updateConfidence.py
gingi99/research_dr
1
29048
# -*- coding:utf-8 -*- # Usage : python ~~.py import sys import os import pickle import collections import pandas as pd import numpy as np from itertools import chain from itertools import combinations from itertools import compress from itertools import product from sklearn.metrics import accuracy_score from multiproc...
2.484375
2
24/03/0.py
pylangstudy/201708
0
29049
<gh_stars>0 #!python3.6 import difflib from pprint import pprint import sys text1 = ''' 1. Beautiful is better than ugly. 2. Explicit is better than implicit. 3. Simple is better than complex. 4. Complex is better than complicated. '''.splitlines(keepends=True) text2 = ''' 1. Beautiful is better than ugly. 3...
3.234375
3
domestic/views/ukef.py
uktrade/great-cms
10
29050
from directory_forms_api_client.actions import PardotAction from directory_forms_api_client.helpers import Sender from django.conf import settings from django.http import HttpResponseRedirect from django.shortcuts import redirect from django.urls import reverse, reverse_lazy from django.utils.decorators import method_d...
1.851563
2
sbol_utilities/excel_to_sbol.py
ArchitJain1201/SBOL-utilities
3
29051
import unicodedata import warnings import logging import re import argparse import sbol3 import openpyxl import tyto from .helper_functions import toplevel_named, strip_sbol2_version, is_plasmid, url_to_identity, strip_filetype_suffix from .workarounds import type_to_standard_extension BASIC_PARTS_COLLECTION = 'Basi...
1.671875
2
jsonschema/tests/test_jsonschema_test_suite.py
prdpklyn/greens-jsonschema
0
29052
<reponame>prdpklyn/greens-jsonschema<filename>jsonschema/tests/test_jsonschema_test_suite.py """ Test runner for the JSON Schema official test suite Tests comprehensive correctness of each draft's validator. See https://github.com/json-schema-org/JSON-Schema-Test-Suite for details. """ import sys from jsonschema im...
2.171875
2
signalworks/tracking/multitrack.py
lxkain/tracking
2
29053
import copy import json import os from collections import UserDict from signalworks.tracking import Event, Partition, TimeValue, Value, Wave class MultiTrack(UserDict): """ A dictionary containing time-synchronous tracks of equal duration and fs """ def __init__(self, mapping=None): if mappi...
2.5
2
fixture/__init__.py
hippa777/python_training
0
29054
from .contact_helper import ContactHelper
1.039063
1
blur.py
yasue32/afm-denoise
1
29055
import cv2 import matplotlib.pyplot as plt import glob import os filepath ="afm_dataset4/20211126/" files = [line.rstrip() for line in open((filepath+"sep_trainlist.txt"))] files = glob.glob("orig_img/20211112/*") def variance_of_laplacian(image): # compute the Laplacian of the image and then return the focus # me...
2.984375
3
python/component/base/utils.py
ModerateFish/component
0
29056
import os def check_path(path): if not path or not path.strip() or os.path.exists(path): return os.makedirs(path) pass
2.46875
2
python/solutii/ingrid_stoleru/Cursor.py
broascaiulian/labs
0
29057
#!/usr/bin/env python # *-* coding: UTF-8 *-* """Solutia problemei Cursor""" DIRECTIONS = {" stanga ": [-1, 0], " dreapta ": [1, 0], " jos ": [0, -1], " sus ": [0, 1]} def distanta(string, pozitie): """Determinarea distantei""" directie, valoare = string.split() directie = direct...
3.40625
3
hoods/models.py
badruu/neighborhood
0
29058
<filename>hoods/models.py from django.db import models import datetime from django.utils import timezone from django.contrib.auth.models import User from django.urls import reverse from django.core.validators import MaxValueValidator, MinValueValidator class Hoods(models.Model): name = models.CharField(max_length ...
2.234375
2
src/clf_comparison.py
UBC-MDS/DSCI522_group17
1
29059
# Author: <NAME>, <NAME>, <NAME> # Date: 2020/11/27 """Compare the performance of different classifier and train the best model given cross_validate results . Usage: src/clf_comparison.py <input_file> <input_file1> <output_file> <output_file1> Options: <input_file> Path (including filename and file extension) to ...
2.984375
3
hebbmodel/fc.py
aimir-lab/hebbian-learning-cnn
18
29060
<reponame>aimir-lab/hebbian-learning-cnn import torch.nn as nn import params as P import hebbmodel.hebb as H class Net(nn.Module): # Layer names FC = 'fc' CLASS_SCORES = FC # Symbolic name of the layer providing the class scores as output def __init__(self, input_shape=P.INPUT_SHAPE): super(Net, self).__init...
3.296875
3
pure_sklearn/feature_extraction/__init__.py
ashetty1-m/pure-predict
62
29061
<gh_stars>10-100 """ The :mod:`pure_sklearn.feature_extraction` module deals with feature extraction from raw data. It currently includes methods to extract features from text. """ from ._dict_vectorizer import DictVectorizerPure from . import text __all__ = ["DictVectorizerPure", "text"]
1.734375
2
plugin.video.mrstealth.serialu.net/uppod.py
mrstealth/kodi-isengard
0
29062
#------------------------------------------------------------------------------- # Uppod decoder #------------------------------------------------------------------------------- import urllib2 import cookielib def decode(param): try: #-- define variables loc_3 = [0,0,0,0] ...
2.734375
3
Eir/DTMC/spatialModel/randomMovement/randMoveSIRDV.py
mjacob1002/Eir
35
29063
<reponame>mjacob1002/Eir<gh_stars>10-100 import numpy as np from matplotlib import pyplot as plt import pandas as pd from Eir.DTMC.spatialModel.randomMovement.randMoveSIRD import RandMoveSIRD from Eir.utility import Person1 as Person class RandMoveSIRDV(RandMoveSIRD): """ An SIRDV model that follows the Ra...
3.125
3
localtalk/application.py
mattcollie/LocalTalk
0
29064
<filename>localtalk/application.py<gh_stars>0 from localtalk import create_app, create_server app = create_app() server = create_server() # server.start() if __name__ == '__main__': app.run(debug=True, host='localhost')
1.804688
2
generate_numpy_data.py
kamleshpawar17/FeTS2021
1
29065
import glob import os import numpy as np import nibabel as nb import argparse def get_dir_list(train_path): fnames = glob.glob(train_path) list_train = [] for k, f in enumerate(fnames): list_train.append(os.path.split(f)[0]) return list_train def ParseData(list_data): ''' Creates a...
2.484375
2
podcast/tests/urls.py
richardcornish/django-applepodcast
7
29066
<reponame>richardcornish/django-applepodcast try: from django.urls import include, re_path except ImportError: from django.conf.urls import include, url as re_path urlpatterns = [ re_path(r'^podcast/', include('podcast.urls', namespace='podcast')), ]
1.679688
2
odoo_actions/odoo_client/common.py
catalyst-cloud/adjutant-odoo
1
29067
from collections import Iterable class BaseManager(object): # you must initialise self.resource_env in __init__ fields = None class Meta: abstract = True def _is_iterable(self, ids): if isinstance(ids, str) or not isinstance(ids, Iterable): ids = [ids, ] return ...
3.125
3
biokeypy/moduleForShowingJudges.py
zacandcheese/biokeypy
0
29068
#moduleForShowingJudges #cmd /K "$(FULL_CURRENT_PATH)" #cd ~/Documents/GitHub/Keyboard-Biometric-Project/Project_Tuples #sudo python -m pip install statistics #python analyzeData.py """ Author: <NAME> and <NAME> Date: 3/09/2018 Program Description: This code can record the Press Time and Flight Time of a tuple as a ...
2.703125
3
dcstats/__init__.py
aplested/DC_Pyps
1
29069
<filename>dcstats/__init__.py from dcstats import * from _version import __version__
1.132813
1
206_reverse_linked_list.py
wasim92007/leetcode
0
29070
# Definition for singly-linked list. # class ListNode: # def __init__(self, val=0, next=None): # self.val = val # self.next = next class Solution: def reverseList(self, head: Optional[ListNode]) -> Optional[ListNode]: ## By passing the case if empty linked list if not he...
4.125
4
python/test_func.py
cuihua-more/code_strudy
0
29071
import unittest def get_formatted_name(first, last, middle = ""): """生成整洁的姓名""" if middle: full_name = f"{first} {middle} {last}" else: full_name = f"{first} {last}" return full_name.title() class NamesTestCase(unittest.TestCase): #创建一个测试类,继承于unittest.TestCase 这样才能Python自动测试 """测试...
3.84375
4
api.py
bart02/RaspTomskBot
0
29072
<reponame>bart02/RaspTomskBot<gh_stars>0 import requests as r from collections import defaultdict class session(): req = {"jsonrpc": "2.0", "id": 1} sid = None def __init__(self, server='http://raspisanie.admin.tomsk.ru/api/rpc.php'): self.server = server self.sid = self.request...
2.828125
3
donor/models.py
noRubidium/VampirePty
0
29073
from __future__ import unicode_literals from django.db import models from hospital.models import Hospital # Create your models here. class Donor(models.Model): name = models.CharField(max_length = 200) username = models.CharField(max_length = 200) password = models.CharField(max_length = 200) gender =...
2.078125
2
tests/e2e/example/flowapi/test_handler.py
rog-works/lambda-fw
0
29074
from unittest import TestCase from lf3py.test.helper import data_provider from tests.helper.example.flowapi import perform_api class TestHandler(TestCase): @data_provider([ ( { 'path': '/models', 'httpMethod': 'GET', 'headers': {}, ...
2.609375
3
hard-gists/3a2a081e4f3089920fd8aecefecbe280/snippet.py
jjhenkel/dockerizeme
21
29075
<reponame>jjhenkel/dockerizeme<gh_stars>10-100 '''Trains a simple convnet on the MNIST dataset. Does flat increment from <NAME> "Error-Driven Incremental Learning in Deep Convolutional Neural Network for Large-Scale Image Classification" Starts with just 3 classes, trains for 12 epochs then incrementally trains the ...
2.953125
3
loss_fn/hybrid_loss.py
alireza-nasiri/SoundCLR
7
29076
<filename>loss_fn/hybrid_loss.py import torch import torch.nn as nn from loss_fn import contrastive_loss import config class HybridLoss(nn.Module): def __init__(self, alpha=0.5, temperature=0.07): super(HybridLoss, self).__init__() self.contrastive_loss = contrastive_loss.SupConLoss(temperature) self.alpha = a...
2.34375
2
keystone_tempest_plugin/services/identity/clients.py
ilay09/keystone
0
29077
<filename>keystone_tempest_plugin/services/identity/clients.py # Copyright 2016 Red Hat, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2...
1.882813
2
history/migrations/0007_auto_20141026_2348.py
atish3/mig-website
4
29078
<reponame>atish3/mig-website # -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('history', '0006_committeemember_member'), ] operations = [ migrations.AlterField( m...
1.648438
2
utils/web_socket_client.py
deezusdyse/Hand-controlled-breakout
78
29079
<gh_stars>10-100 ## Author: <NAME> ## Web socket client which is used to send socket messages to a connected server. import websocket import time import json from websocket import WebSocketException, WebSocketConnectionClosedException import sys #import _thread as thread import websocket ws = websocket.WebSocket() r...
3.09375
3
app/helpers/header_helpers.py
petechd/eq-questionnaire-runner
3
29080
<reponame>petechd/eq-questionnaire-runner def get_span_and_trace(headers): try: trace, span = headers.get("X-Cloud-Trace-Context").split("/") except (ValueError, AttributeError): return None, None span = span.split(";")[0] return span, trace
2.375
2
scFates/tools/pseudotime.py
LouisFaure/scFates
4
29081
from anndata import AnnData import numpy as np import pandas as pd from scipy.sparse import csr_matrix from joblib import delayed from tqdm import tqdm import sys import igraph from .utils import ProgressParallel from .. import logging as logg from .. import settings def pseudotime(adata: AnnData, n_jobs: int = 1, ...
2.25
2
libai/data/samplers/samplers.py
Oneflow-Inc/libai
55
29082
# coding=utf-8 # Copyright 2021 The OneFlow 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 require...
2.640625
3
nipype/interfaces/niftyseg/tests/test_lesions.py
mfalkiewicz/nipype
1
29083
<filename>nipype/interfaces/niftyseg/tests/test_lesions.py # emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*- # vi: set ft=python sts=4 ts=4 sw=4 et: import pytest from ....testing import example_data from ...niftyreg import get_custom_path from ...niftyreg.tests.test_regutils import no_nifty_t...
2.03125
2
tests/test_services/test_run_filters/actions.py
Jumpscale/ays_jumpscale8
4
29084
<filename>tests/test_services/test_run_filters/actions.py def init_actions_(service, args): """ this needs to returns an array of actions representing the depencies between actions. Looks at ACTION_DEPS in this module for an example of what is expected """ # some default logic for simple actions...
2.625
3
api/test_processor_api.py
AlexRogalskiy/asma
4
29085
<gh_stars>1-10 from fastapi.testclient import TestClient import os import sys sys.path.append("..") from libs.config_engine import ConfigEngine from api.config_keys import Config from api.processor_api import ProcessorAPI import pytest config_path='/repo/config-coral.ini' config = ConfigEngine(config_path) app_instan...
2.25
2
setup.py
kiminh/lambda-learner
1
29086
from os import path from setuptools import find_namespace_packages, setup this_directory = path.abspath(path.dirname(__file__)) with open('README.md', encoding='utf-8') as f: long_description = f.read() setup( name='lambda-learner', namespace_packages=['linkedin'], version='0.0.1', long_description...
1.476563
1
graphiql_strawberry_debug_toolbar/serializers.py
przemub/django-graphiql-strawberry-debug-toolbar
67
29087
from django.core.serializers.json import DjangoJSONEncoder class CallableJSONEncoder(DjangoJSONEncoder): def default(self, obj): if callable(obj): return obj() return super().default(obj)
2.25
2
Famcy/_util_/_fsubmission.py
nexuni/Famcy
0
29088
<gh_stars>0 import abc import enum import json import pickle import time import Famcy import _ctypes import os import datetime from flask import session from werkzeug.utils import secure_filename # GLOBAL HELPER def get_fsubmission_obj(parent, obj_id): """ Inverse of id() function. But only works if the object is not...
2.328125
2
user/forms.py
apuc/django-rest-framework
0
29089
<filename>user/forms.py from crispy_forms import layout from crispy_forms.helper import FormHelper from django.conf import settings from django.contrib.auth.forms import UserCreationForm from django.urls import reverse_lazy from django import forms from .models import UserProfile class RegisterForm(UserCreationForm):...
2.484375
2
wadi.py
sensepost/wadi
137
29090
import sys import os from multiprocessing import Process, Queue, Manager from threading import Timer from wadi_harness import Harness from wadi_debug_win import Debugger import time import hashlib def test(msg): while True: print 'Process 2:' + msg #print msg def test2(): print 'Process 1' tim...
2.34375
2
learnIndependentRegressionModel.py
zawlin/multi-modal-regression
29
29091
# -*- coding: utf-8 -*- """ Independent model based on Geodesic Regression model R_G """ import torch from torch import nn, optim from torch.autograd import Variable from torch.utils.data import DataLoader import torch.nn.functional as F from dataGenerators import ImagesAll, TestImages, my_collate from axisAngle impo...
1.953125
2
rick_and_morty_app/views.py
esalcedo94/final_project
0
29092
# from django.shortcuts import render, redirect, get_object_or_404 from .forms import CharacterForm from rick_and_morty_app.models import Character from django.views.generic import ListView, CreateView, UpdateView, DetailView, DeleteView from django.urls import reverse_lazy # new # Create your views here. class HomeP...
2.1875
2
samples/contacts/pathUtils.py
Trevol/Mask_RCNN
0
29093
<reponame>Trevol/Mask_RCNN import os, sys def mrcnnPath(): filePath = os.path.dirname(os.path.realpath(__file__)) return os.path.abspath(os.path.join(filePath, os.pardir, os.pardir)) def currentFilePath(file=None): file = file if file else __file__ return os.path.dirname(os.path.realpath(file)) def m...
2.4375
2
event_extractor/train/train.py
chenking2020/event_extract_master
30
29094
<reponame>chenking2020/event_extract_master from __future__ import print_function import sys, os sys.path.append(os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))) from event_extractor.dataprocess import data_loader from event_extractor.train.eval import evaluate import importlib import ti...
2.109375
2
src/oci/object_storage/models/commit_multipart_upload_part_details.py
LaudateCorpus1/oci-python-sdk
0
29095
<filename>src/oci/object_storage/models/commit_multipart_upload_part_details.py # coding: utf-8 # Copyright (c) 2016, 2022, Oracle and/or its affiliates. All rights reserved. # This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apac...
2.125
2
sorter/lib/data_handler.py
1shooperman/gr-sorter
0
29096
<gh_stars>0 ''' data_handler.py ''' import os from sorter.lib.db import DB from sorter.lib.book_utils import get_by_id, get_by_isbn from sorter.lib.parse_xml import parse_isbn13_response, parse_id_response def store_data(books, db_file): ''' Store the book data in the provided database ''' database = D...
2.53125
3
data_conversions/prepare_las_filelists.py
nazarred/PointCNN
0
29097
<filename>data_conversions/prepare_las_filelists.py #!/usr/bin/python3 '''Prepare Filelists for Semantic3D Segmentation Task.''' from __future__ import absolute_import from __future__ import division from __future__ import print_function import logging import os import math import pathlib import random import argpars...
2.1875
2
survol/sources_types/CIM_ComputerSystem/__init__.py
AugustinMascarelli/survol
0
29098
<reponame>AugustinMascarelli/survol """ Computer system. Scripts related to the class CIM_ComputerSystem. """ import sys import socket import lib_util # This must be defined here, because dockit cannot load modules from here, # and this ontology would not be defined. def EntityOntology(): return ( ["Name"], ) i...
2.15625
2
Primeiros Passos/1-DAY ONE/Sabendo se o nome da cidade tem santo.py
pedroluceena/TreinosPI
0
29099
<gh_stars>0 cidade = str(input('Qual é o Nome da sua Cidade ?: ')).strip() print('Sua cidade possui o nome Santo?',cidade[:5].upper() == 'SANTO')
3.75
4