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
LeetCode/leetcode 691.py
Xi-Plus/OJ-Code
0
12780751
class Solution: def minStickers(self, stickers, target): targetdict = {} for char in target: if char not in targetdict: targetdict[char] = 0 targetdict[char] += 1 pool = [{'cost': 0}] for sticker in stickers: for i in range(len(poo...
3.453125
3
tests/unit/streaming_hmm/utils.py
cylance/perturbed-sequence-model
4
12780752
import numpy as np import pytest def get_argmax_of_matrix_as_tuple(mat): return np.unravel_index(mat.argmax(), mat.shape)
2.171875
2
client/sdk/python/network/network_pb2_grpc.py
gofortwos/micro
37
12780753
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! """Client and server classes corresponding to protobuf-defined services.""" import grpc from network import network_pb2 as network_dot_network__pb2 class NetworkStub(object): """Network service is usesd to gain visibility into networks """...
2.21875
2
src/steps/step_configure.py
RLogik/phpytex
0
12780754
<gh_stars>0 #!/usr/bin/env python3 # -*- coding: utf-8 -*- # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # IMPORTS # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ from src.local.misc import *; from src.local.system import *; from src.local.typing import *; from src.core.log im...
1.570313
2
OpenFOAM-wrapper/beam_solver.py
Lenferd/ANSYS-OpenFOAM
0
12780755
from executor.executor import Executor from argparse import ArgumentParser from configs.mesh import add_mesh_switch_arguments from configs.mesh import SimpleBlockMeshConfig, SimpleBlockMeshArguments from configs.mesh import RailMeshArguments, RailMeshConfig from configs.fragmentation import FragmentationConfig, Fragmen...
2.125
2
apps/tasks/templatetags/taskfilter.py
raiots/CHRDITools
0
12780756
<reponame>raiots/CHRDITools from django import template from datetime import datetime from dateutil.relativedelta import relativedelta register = template.Library() @register.filter(name='quarter_cate') def quarter_cate(value, year_quarter): year_now = datetime.now().strftime('%Y') month = value.deadline.st...
2.671875
3
tests/test_remix.py
audeering/audresample
2
12780757
from glob import glob from os import path import pytest import audiofile as af import numpy as np import audresample def set_ones(signal, channels): signal[channels, :] = 1 return signal def mixdown(signal): return np.atleast_2d(np.mean(signal, axis=0)) @pytest.mark.parametrize( 'signal, channel...
2.328125
2
notebooks/helpers.py
thomasfrederikhoeck/ml_tooling
7
12780758
<gh_stars>1-10 import numpy as np import re title_map = { "Mr.": "Mr", "Miss.": "Miss", "Mrs.": "Mrs", "Master.": "Master", "Dr.": "Other", "Rev.": "Other", "Major.": "Other", "Col.": "Other", "Mlle.": "Miss", "Lady.": "Other", "Jonkheer.": "Other", "Ms.": "Miss", "C...
2.6875
3
ons_ras_common/ons_rest_exercise.py
ONSdigital/ras-common
1
12780759
<reponame>ONSdigital/ras-common """ Generic Configuration tool for Micro-Service environment discovery License: MIT Copyright (c) 2017 Crown Copyright (Office for National Statistics) ONSCase wraps routines used to access the case service """ class ONSExercise(object): """ This class is designe...
2.40625
2
src/units/_identificator.py
ferrocactus/cellar
7
12780760
<gh_stars>1-10 import json from abc import abstractmethod from functools import reduce import os import numpy as np from scipy.stats import hypergeom from ..log import setup_logger from ..utils.tools import parse from ._unit import Unit this_dir = os.path.dirname(__file__) def join_root(path): return os.path.ab...
2.53125
3
jass/logic/player.py
gregunz/JassAI
0
12780761
from typing import List, Dict, Optional from jass.agents.agent import Agent from jass.agents.state import PlayCardState, ChooseTrumpState from jass.logic.card import Card, Suit from jass.logic.exceptions import IllegalMoveError from jass.logic.hand import Hand class Player: def __init__(self, name: str, agent: A...
2.84375
3
tests/fixtures/abaco.py
SD2E/python-datacatalog
0
12780762
<reponame>SD2E/python-datacatalog<gh_stars>0 import pytest from datacatalog.identifiers import abaco __all__ = ['nonce_id', 'manager_actor_id', 'actor_id', 'exec_id', 'worker_id'] @pytest.fixture(scope='session') def nonce_id(): return abaco.nonceid.generate() @pytest.fixture(scope='session') def mana...
2.234375
2
next_release_problem/problems.py
mandriv/next-release-problem
0
12780763
<reponame>mandriv/next-release-problem from abc import ABCMeta, abstractmethod from platypus import Problem, Binary, Real, RandomGenerator class NRP_Problem(): __metaclass__ = ABCMeta def __init__(self, requirements, clients, budget_constraint): self.requirements = requirements.copy() self.c...
2.71875
3
calculator.py
savrus/algory
2
12780764
#!/usr/bin/python import sys all_tokens = dict([ ["_", -1], ["!", 0], ["~", 0], ["^", 1], ["&", 1], ["|", 1], ["**", 2], ["*", 3], ["/", 3], ["%", 3], ["+", 4], ["-", 4], ["&&", 6], ["||", 6], ["==", 7], ["!=", 7], ["<", 7], [">", 7], ["<=", 7], [">=", 7], ["=", 8], ["(", 99], [")", 99]]) unary = ...
3.375
3
build/lib/agent/mapping.py
SAEONData/textfile-harvester
0
12780765
mapping = { "ORIGIN": {"key": "XXXXX", "default": "ZZZZZ"}, "REQUEST_ID": {"key": "XXXXX", "default": "ZZZZZ"}, "LANDSAT_SCENE_ID": {"key": "XXXXX", "default": "ZZZZZ"}, "COLLECTION_NUMBER": {"key": "XXXXX", "default": "ZZZZZ"}, "FILE_DATE": {"key": "publicationYear", "default": "2018", 'slice': (0,...
1.515625
2
portfolio/migrations/0008_auto_20190225_1927.py
sarath196/Portfolio-Web-Theme
3
12780766
# Generated by Django 2.0 on 2019-02-25 19:27 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('portfolio', '0007_auto_20190225_1849'), ] operations = [ migrations.AddField( model_name='portfoliopage', name='git_ur...
1.53125
2
oct_26_2019/myproject.py
SoundBoySelecta/BDT_1160_homework
0
12780767
<filename>oct_26_2019/myproject.py import sys import pandas as pd import matplotlib.pyplot as plt import os file_name = sys.argv[1] #print(file_name) df = pd.read_csv(file_name, sep=',', header=None) df.columns = ['id', 'diagnosis', 'mean radius', 'mean texture', 'mean perimeter', '...
2.84375
3
trainer/rename.py
Originofamonia/pylon
16
12780768
def rename(newname): """define the name of the function""" def decorator(f): f.__name__ = newname return f return decorator
3.640625
4
Mundo1/aula7c.py
OliveiraVasconcelos/Python-CursoemVideo
0
12780769
<gh_stars>0 ### crie um algoritmo que leia um numero e mostre seu dobro, triplo e raizq num = int(input('Digite um valor: ')) dobro = num * 2 triplo = num * 3 raizq = num ** (1/2) print('{} foi recebido, o dobro de num é {}, o triplo é {} e a raiz quadrada é {}'.format(num, dobro, triplo, raizq))
3.90625
4
katachi/tools/assign_landmarks.py
WhoIsJack/data-driven-analysis-lateralline
3
12780770
<gh_stars>1-10 # -*- coding: utf-8 -*- """ Created on Wed Nov 22 11:04:07 2017 @author: <NAME> @ Gilmour group @ EMBL Heidelberg @descript: Generates a sparse 3D point cloud representation for each cell in a segmented stack based on the intensity distribution of a second stack within the c...
2.234375
2
livereload/cli.py
andreycizov/python-livereload
0
12780771
<filename>livereload/cli.py import argparse import tornado.log from livereload.server import Server parser = argparse.ArgumentParser(description='Start a `livereload` server') parser.add_argument( '--host', help='Hostname to run `livereload` server on', type=str, default='127.0.0.1' ) parser.add_arg...
2.546875
3
panda/migrations/0001_initial.py
higs4281/panda
72
12780772
# encoding: 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 model 'Category' db.create_table('panda_category', ( ('id', self.gf('django.db.models...
2.203125
2
Hybrid-P2P_ChatPy/server_users.py
davidcawork/uah-lrss_
0
12780773
<reponame>davidcawork/uah-lrss_<filename>Hybrid-P2P_ChatPy/server_users.py #usr/bin/env python3 import socket import sys import pickle import select import os #PROTOCOL MSGs P2P_CHAT_PY_PROTOCOL_HI = 'ChatPy_Hi' P2P_CHAT_PY_PROTOCOL_HI_ACK = 'ChatPy_Hi_Ack' P2P_CHAT_PY_PROTOCOL_BYE = 'ChatPy_Bye' P2P_CHAT_PY_PROTOCOL...
2.421875
2
klotski/image_recognition.py
Strivingperson/store
0
12780774
import requests import json import base64 import numpy as np import matplotlib.pyplot as plt import pickle import imageio def get_jsonstr(url): url = "http://172.16.58.3:8089/api/problem?stuid=031804104" response = requests.get(url) jsonstr = json.loads(response.text) return jsonstr def ...
2.953125
3
Python/zzz_training_challenge/Python_Challenge/solutions/tests/ch03_recursion/ex09_pascal_test.py
Kreijeck/learning
0
12780775
<gh_stars>0 # Beispielprogramm für das Buch "Python Challenge" # # Copyright 2020 by <NAME> import pytest from ch03_recursion.solutions.ex09_pascal_triangle import calc_pascal_with_action @pytest.mark.parametrize("n, expected", [(1, [1]), (2, [1, 1]), ...
3.0625
3
setup.py
IPASC/IPASC_DataConversionTool
3
12780776
import setuptools with open('README.md', 'r') as readme_file: long_description = readme_file.read() with open('requirements.txt', 'r') as requirements_file: requirements = requirements_file.read().splitlines() setuptools.setup( name="ipasc_tool", version="0.1.3", author="International Photoacoust...
1.5625
2
pyxing/res.py
sharebook-kr/pyxing
12
12780777
<reponame>sharebook-kr/pyxing # RES file parser ''' {'trcode': "CSPAT00600", 'inblock': [ {'CSPAT00600InBlock1': [ ]} ], 'outblock': [ {'CSPAT00600OutBlock1': [ ]} {'CSPAT00600OutBlock2': [ ]} } ''' # res 파일 정보 라인 파싱 함수 def parse_info(data): tokens = data.split(',') return tokens[2].strip()...
2.609375
3
Scripts/simulation/retail/retail_elements.py
velocist/TS4CheatsInfo
0
12780778
<reponame>velocist/TS4CheatsInfo # 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\retail\retail_elements.py # Compiled at: 2016-03-08 02:17:38 # Size...
1.945313
2
views/login.py
vug/personalwebapp
0
12780779
<reponame>vug/personalwebapp """ This Blueprint gives the ability of user logins, and login_required functionality using Flask-Login extension. """ from flask import Blueprint, render_template, request, flash, redirect, url_for from flask_login import login_required, logout_user, login_user from extensions import logi...
2.703125
3
aggcat/tests/test_parser.py
djedi/python-aggcat
1
12780780
<reponame>djedi/python-aggcat<gh_stars>1-10 from __future__ import absolute_import from ..parser import Objectify class TestParser(object): """Test XML Objectification""" @classmethod def setup_class(self): self.o = None with open('aggcat/tests/data/sample_xml.xml', 'r') as f: ...
2.78125
3
quex/engine/analyzer/door_id_address_label.py
smmckay/quex-mirror
0
12780781
import quex.engine.state_machine.index as sm_index from quex.engine.misc.tools import print_callstack, \ TypedSet from quex.blackboard import Lng from quex.constants import E_IncidenceIDs, \ E_StateIndices, \ ...
1.65625
2
software/utils/drc_utils/python/atlas_pressure_monitor.py
liangfok/oh-distro
92
12780782
import lcm import drc as lcmdrc import atlas as lcmatlas import numpy as np import time class AtlasPressureCommander(object): def __init__(self, desired_rpm=5000, max_psi=2500, min_psi=1500): self.desired_rpm = desired_rpm self.max_psi = max_psi ...
2.296875
2
git_sentry/handlers/git_team.py
git-sentry/git-sentry
0
12780783
from git_sentry.handlers.access_controlled_git_object import AccessControlledGitObject from git_sentry.handlers.git_repo import GitRepo from git_sentry.handlers.git_user import GitUser class GitTeam(AccessControlledGitObject): def __init__(self, git_object): super().__init__(git_object) def name(self...
2.265625
2
framework/openCV/pyimagesearch_ppao/ch6_image_processing.py
friendlyantz/learning
1
12780784
import numpy as np import argparse import imutils import cv2 ap = argparse.ArgumentParser() ap.add_argument("-i", "--image", required = True, help = "Path to the image") ap.add_argument("-i2", "--image2", required = True, help = "Path to the image 2") ap.add_argument("-i3", "--image3", required = True, help = "Path to...
2.96875
3
users/factories.py
bllli/Django-China-API
187
12780785
# factories that automatically create user data import factory from users.models import User class UserFactory(factory.DjangoModelFactory): class Meta: model = User username = factory.Sequence(lambda n: 'user%s' % n) email = factory.LazyAttribute(lambda o: <EMAIL>' % o.username) password = '...
2.59375
3
Array/Easy/busyStudent.py
pavi-ninjaac/leetcode
0
12780786
# -*- coding: utf-8 -*- """ Created on Wed Dec 30 22:57:38 2020 @author: ninjaac """ """ Given two integer arrays startTime and endTime and given an integer queryTime. The ith student started doing their homework at the time startTime[i] and finished it at time endTime[i]. Return the number of student...
3.421875
3
TEP/lista7/D.py
GuilhermeBraz/unb-workflow
0
12780787
<filename>TEP/lista7/D.py<gh_stars>0 # You've got a rectangular parallelepiped with integer edge lengths. You know the areas of its three faces that have a common vertex. # Your task is to find the sum of lengths of all 12 edges of this parallelepiped. from math import sqrt x, y, z = map(int, input().split()) perimete...
3.671875
4
api/algo.py
unithmallavaram/TeamFormationAssistant_V2
3
12780788
import sys f = open("success.txt", "w")
1.40625
1
home/views.py
apoorvanand/tweet-search
51
12780789
import datetime import random import csv import json # TODO: Fix * imports from django.shortcuts import * from django.contrib.auth.decorators import login_required, user_passes_test from django.contrib.auth import logout as auth_logout from social.apps.django_app.default.models import UserSocialAuth from gnip_search...
2.359375
2
tests/test_data_models.py
datarevenue-berlin/omigami
7
12780790
<reponame>datarevenue-berlin/omigami<filename>tests/test_data_models.py from py_muvr.data_structures import SelectedFeatures def test_n_features(dataset): assert dataset.n_features == 12 def test_input_data_slice(dataset): assert dataset[:5, 3:7].X.shape == (5, 4) assert dataset[[1, 2, 5], [3, 4, 7]].X....
2.15625
2
yapylib/helpers.py
twocucao/YaPyLib
2
12780791
<filename>yapylib/helpers.py<gh_stars>1-10 import os def get_load_dotenv(default=True): val = os.environ.get('YAPYLIB_SKIP_DOTENV') if not val: return default return val.lower() in ('0', 'false', 'no')
2.375
2
exp/data_processing/get_cropped_image.py
dangxuanvuong98/pineapples_harvester
0
12780792
<reponame>dangxuanvuong98/pineapples_harvester<gh_stars>0 import cv2 import os import xml.etree.ElementTree as ET from tqdm import tqdm data_directory_path = '/media/trivu/data/DataScience/ComputerVision/dua/new_data/train' result_path = '/media/trivu/data/DataScience/ComputerVision/dua/new_data/cropped_pineapple' lab...
2.421875
2
logistic_regression.py
AbChatt/Final-Project-C11-Part-2-Python
0
12780793
<gh_stars>0 """ CSCC11 - Introduction to Machine Learning, Winter 2020, Exam <NAME>, <NAME> =========================================================== COMPLETE THIS TEXT BOX: Student Name: <NAME> Student number: 1004820615 UtorID: chatt114 I hereby certify that the work contained here is my own _<NAME>_ (s...
3.96875
4
testing/distributions/gamma_test.py
jnkm/MXFusion
0
12780794
import pytest import mxnet as mx import numpy as np from mxfusion.components.variables.runtime_variable import add_sample_dimension, is_sampled_array, get_num_samples from mxfusion.components.distributions import Gamma, GammaMeanVariance from mxfusion.util.testutils import numpy_array_reshape from mxfusion.util.testuti...
2.046875
2
server/danesfield_server/loader.py
Kitware/Danesfield-App
25
12780795
<reponame>Kitware/Danesfield-App #!/usr/bin/env python # -*- coding: utf-8 -*- ############################################################################### # Copyright Kitware Inc. and Contributors # Distributed under the Apache License, 2.0 (apache.org/licenses/LICENSE-2.0) # See accompanying Copyright.txt and LIC...
1.78125
2
file_builder/test/hash_dirs_test.py
btrekkie/file-builder
1
12780796
import hashlib import os from .. import FileBuilder from .file_builder_test import FileBuilderTest class HashDirsTest(FileBuilderTest): """Tests a hash directory build operation. The build operation computes SHA-256 hashes for all of the files and directories in a given root directory. A directory's has...
3.109375
3
2019/02_ProgramAlarm/aoc_pa.py
deanearlwright/AdventOfCode
1
12780797
# ====================================================================== # Program Alarm # Advent of Code 2019 Day 02 -- <NAME> -- https://adventofcode.com # # Computer simulation by Dr. <NAME> III # ====================================================================== # ====================================...
2.5
2
timm/version.py
chilung/pytorch-image-models
0
12780798
<reponame>chilung/pytorch-image-models __version__ = '0.4.13.22'
0.941406
1
lib/solutions/checkout.py
DPNT-Sourcecode/CHK-hqvw01
0
12780799
# Basic price table, without offers PRICES = {"A": 50, "B": 30, "C": 20, "D": 15, "E": 40, "F": 10, "G": 20, "H": 10, "I": 35, "J": 60, "K": 70, "L": 90, "M": 15, "N": 40, "O": 1...
3.90625
4
make.py
kagu/kunquat
13
12780800
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # Author: <NAME>, Finland 2014-2018 # # This file is part of Kunquat. # # CC0 1.0 Universal, http://creativecommons.org/publicdomain/zero/1.0/ # # To the extent possible under law, Kunquat Affirmers have waived all # copyright and related or neighboring rights to Kunqua...
2.109375
2
scraper/urls.py
pekasen/DBoeS-Automatization
0
12780801
""" List of German Wikipedia pages to extract parliamentarian information from. Index points to table indices (running id) where to find information on the page. """ BASE = "https://de.wikipedia.org/wiki/" parliaments = { "sachsen": { "name": "Sachsen", "url": BASE + "Liste_der_Mitglieder_des_S%C3%A...
2.921875
3
examples/z_segmenting_accurately.py
thejasvibr/itsfm
1
12780802
""" Segmenting real-world sounds correctly with synthetic sounds ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ It's easy to figure out if a sound is being correcly segmented if the signal at hand is well defined, and repeatable, like in many technological/ engineering applications. However, in bioacoust...
2.609375
3
code/cloudmanager/install/hws/hws_util.py
Hybrid-Cloud/cloud_manager
0
12780803
<filename>code/cloudmanager/install/hws/hws_util.py import os from heat.engine.resources.hwcloud.hws_service.hws_client import HWSClient from heat.engine.resources.cloudmanager.util.retry_decorator import RetryDecorator from heat.openstack.common import log as logging from heat.engine.resources.cloudmanager.util.cloud...
1.890625
2
tests/conftest.py
eleme/meepo
50
12780804
# -*- coding: utf-8 -*- from __future__ import absolute_import import logging logging.basicConfig(level=logging.DEBUG) import json import os import uuid import pymysql import pytest import redis from meepo._compat import urlparse @pytest.fixture(scope="session") def conf(): """Try load local conf.json ""...
1.9375
2
examples/e12.py
pepprseed/svgdatashapes
11
12780805
<reponame>pepprseed/svgdatashapes<gh_stars>10-100 import svgdatashapes as s import svgdatashapes_dt as sdt # for date/time support def example12(): # Secchi depth readings plot with reversed Y axis depthdata = [ ('09/21/2016', 6.60), ('09/19/2016', 6.20), ('09/08/2016', 4.85), ('09/01/2016', 6.00...
2.359375
2
ques3.py
shreya643/test_feb_19
0
12780806
<gh_stars>0 '''Q3. Create a Employee class and initialize it with first_name, last_name and salary. Also, it has a derived attribute called email, which is self generated when instance is created. Now, make methods to : a. Display - It should display all information of the employee instance.''' class Employee: de...
4.3125
4
rebase/api/predicter.py
rebaseenergy/rebase-sdk
0
12780807
import rebase as rb import pickle from datetime import datetime import rebase.util.api_request as api_request class Predicter(): @classmethod def load_data(cls, pred, start_date, end_date): site_config = rb.Site.get(pred.site_id) return pred.load_data(site_config, start_date, end_date) ...
2.421875
2
setup.py
MrBurtyyy/yoti-python-sdk
0
12780808
<gh_stars>0 # -*- coding: utf-8 -*- from setuptools import setup, find_packages from yoti_python_sdk import __version__ long_description = ( "This package contains the tools you need to quickly " "integrate your Python back-end with Yoti, so that your " "users can share their identity details with your " ...
1.304688
1
gupb/controller/shallow_mind/utils.py
syforcee/GUPB
0
12780809
from typing import Tuple, List from gupb.model.characters import Action def points_dist(cord1, cord2): return int(((cord1.x - cord2.x) ** 2 + (cord1.y - cord2.y) ** 2) ** 0.5) def get_first_possible_move(moves: List[Tuple[Action, int]]): return next((next_move for next_move in moves if next_...
2.640625
3
src/TrussModel.py
somu15/Small_Pf_code
0
12780810
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Thu Dec 17 15:24:18 2020 @author: dhulls """ from anastruct import SystemElements import numpy as np class TrussModel: def HF(self, young1=None, young2=None, area1=None, area2=None, P1=None, P2=None, P3=None, P4=None, P5=None, P6=None): ...
2.40625
2
research/realty_type_quantities.py
Ramilll/raifhack_ds
0
12780811
<reponame>Ramilll/raifhack_ds<gh_stars>0 import pandas as pd import matplotlib.pyplot as plt import seaborn as sns data_dir = '../data/' train = pd.read_csv(data_dir + 'train.csv') rt = train.realty_type counts = rt.groupby(rt).count().rename('count').reset_index() fig, ax = plt.subplots(figsize=(10, 5)) sns.barpl...
2.515625
3
file/models.py
CaptainMorch/TJU_Cats
0
12780812
from django.db import models from django.urls import reverse from datetime import date # Create your models here. class Photo(models.Model): """猫猫相片的数据库模型""" image = models.ImageField( '图像', upload_to='image/' ) title = models.CharField('标题', blank=True, max_length=8) descript...
2.59375
3
datasets/NIH.py
tnaren3/pytorch-adda
0
12780813
<filename>datasets/NIH.py import os import csv from PIL import Image import numpy as np import torch import torch.utils.data as data from torchvision import datasets, transforms import params class NIH(data.Dataset): def __init__(self, root, train=True, val=False, transform=None): """Init NIH dataset....
3
3
src/djai/util/cli/_server_files/asgi.py
Django-AI/DjAI
3
12780814
""" ASGI config for DjAI project. It exposes the ASGI callable as a module-level variable named ``application`` For more information on this file, see docs.djangoproject.com/en/dev/howto/deployment/asgi """ # ref: django-configurations.readthedocs.io import os # from django.core.asgi import get_asgi_application...
1.546875
2
src/utils.py
carlps/bikeshare
2
12780815
<filename>src/utils.py # Common utils used in different scripts from os import environ from sqlalchemy import create_engine from sqlalchemy.orm import sessionmaker def get_session(env='DEV', echo=False): ''' Create db connection and sqlalchemy engine Return a session to interact with db Echo def...
2.5625
3
shared/management/commands/settings.py
dArignac/shared
0
12780816
from django.conf import settings from django.core.management.base import BaseCommand, CommandError from pprint import pformat class Command(BaseCommand): args = '<setting>' help = 'Outputs the value of the given setting name' def handle(self, *args, **options): if len(args) != 1: rai...
2.609375
3
model.py
pedrocarvalhoaguiar/ProjetoP2-Braga-Alessandra
0
12780817
from estruturadedados.avltree import AVL from estruturadedados.queue import Queue from biometria.biometria import Biometria as Bio from bancodedados.paths import * import json from os import listdir, remove class GerenciadorPrincipal(): def __init__(self): self.gerVacina = GerenciadorVacina() ...
2.484375
2
icevision/models/rcnn/mask_rcnn/fastai/__init__.py
lee00286/icevision
0
12780818
<filename>icevision/models/rcnn/mask_rcnn/fastai/__init__.py from icevision.models.rcnn.mask_rcnn.fastai.callbacks import * from icevision.models.rcnn.mask_rcnn.fastai.learner import *
1.148438
1
Unet/threshold_analysis.py
prediction2020/unet-vessel-segmentation
23
12780819
<reponame>prediction2020/unet-vessel-segmentation # -*- coding: utf-8 -*- """ File name: threshold_analysis.py Author: <NAME> Date created: 06/12/2018 The goal of this script is to: 1) Display calibration plots of the pulled Unet and half-Unet output 2) Assuming the output is not calibrated, Find the optimal t...
2.71875
3
simulations/simulation.py
Jackil1993/metainventory
3
12780820
<filename>simulations/simulation.py import numpy as np import matplotlib.pyplot as plt # create a .txt file to write down all the discrete events for further tracing) file = open("protocol.txt","w") # a static class containing all the utilized random number generators class Generator: def normal(self, mu, sigm...
3.53125
4
AML/HW3/utils/utils.py
ZRZ-Unknow/20fall-CourseNote
0
12780821
<filename>AML/HW3/utils/utils.py<gh_stars>0 import numpy as np import os from bidict import bidict def load_data(shared_nums): """ Return: data: list, each of it is a numpy array of shape (k,321) label: list, each of it is a numpy array of shape (k,) """ train_path, test_path = './Dataset/train/', ...
2.25
2
utils/sampling.py
PranavPai/Dissertation
0
12780822
import numpy as np import pandas as pd from sklearn import datasets from sklearn.model_selection import train_test_split test_size = 0.25 def sampling(**kwargs): if kwargs['dataset'] == 'moons': X, y = datasets.make_moons(n_samples=kwargs['sample_size'], noise=kwargs['n...
2.953125
3
app/grandchallenge/algorithms/migrations/0020_auto_20200214_0912.py
njmhendrix/grand-challenge.org
1
12780823
# Generated by Django 3.0.2 on 2020-02-14 09:12 import django.contrib.postgres.fields.jsonb import django.db.models.deletion from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ("cases", "0019_auto_20200120_0604"), ("algorithms", "0019_auto_20200210_0...
1.953125
2
Final Project/new_clrs/clrs/_src/algorithms/strings_graph_structures.py
mohammedElfatihSalah/string-experiments
0
12780824
import numpy as np def get_predecessor(T,P): # copy the inputs T = np.copy(T) P = np.copy(P) P_size = P.shape[0] T_size = T.shape[0] adj = np.zeros((P_size + T_size,P_size + T_size)) # predecessor for Text for i in range(1,T_size): adj[i, i-1] = 1 # predecessor for Pattern for i in range(...
3.171875
3
model/BFS_Agent.py
cogtoolslab/tools_block_construction
0
12780825
import os import sys proj_dir = os.path.dirname(os.path.dirname(os.path.realpath(__file__))) sys.path.insert(0,proj_dir) import random from itertools import repeat import utils.blockworld as blockworld from model.utils.Search_Tree import * class BFS_Agent: """An agent performing exhaustive BFS search. This can t...
2.96875
3
scalation_kernel/__init__.py
KevinBonanno/scalation_kernel
0
12780826
<reponame>KevinBonanno/scalation_kernel """A Scala+ScalaTionkernel for Jupyter""" __version__ = '1.0' from .kernel import ScalaTionKernel
1.015625
1
rf_optimizer.py
bGhorbani/linearized_neural_networks
0
12780827
<gh_stars>0 """This file implements functionalities that allow fitting large random feature models with conjugate gradient type algorithms. """ import tensorflow as tf import numpy as np import sys sys.path.insert(0, './linear_algebra/') from tensor_utils import AssignmentHelper class RF_Optimizer(object): def __in...
2.171875
2
mrsketch/__init__.py
Simonl07/mrsketch
0
12780828
<reponame>Simonl07/mrsketch<filename>mrsketch/__init__.py import threading import types from copy import copy, deepcopy from functools import reduce import json import pickle supported_graph_serialization = { 'json': json, 'pickle': pickle } class StateDescriptor(object): def __init__(self, constructor,...
2.5
2
main.py
biogui/royal-flush-telegram-bot
0
12780829
from telegram.ext import Updater, CommandHandler, ConversationHandler, MessageHandler, Filters, CallbackQueryHandler from env import TOKEN from commands import show_challs, choose_chall_to_show, SHOWS_CHOSEN_CHALL from commands import try_answer, choose_chall_to_answer, check_answer, CHOOSE_CHALL_TO_ANSWER def ...
2.453125
2
main.py
KevHg/tictactoe-cli
0
12780830
import random from copy import deepcopy def print_board(board, max_width): for row in range(len(board)): for col in range(len(board)): print("{:>{}}".format(board[row][col], max_width), end='') print() def win_check(board, player, n, row, col): horizontal, vertical, diagonal_down...
4.03125
4
faker_GB.py
bogordon86/Python_Faker
0
12780831
<gh_stars>0 #Import Dependencies from faker import Faker import pandas as pd #For generating fake ID import random #Great Britain fake data (why not?) fake = Faker('en_GB') # dictionary dict_data = { "name":[], "address":[], "dob":[], "gender":[], "phone_number":[], "imei":[] } #Loop...
3.203125
3
2task1.py
inwk6312fall2018/programmingtask2-Adityapuni
0
12780832
file=open('Crime.csv') lineA=[] lineB=[] dict={} #take crime id as key and crime name as value def histogram(s): """to check s in string""" d={} for c in s: d[c]=1+d.get(c,0) return d """make list of all words""" for line in file: line.strip() for i in line.split(','): lineA.append(i) """all crime ID""" i...
3.25
3
pages/quitPage.py
amalthomas-exe/Windown-Installer-GUI
0
12780833
<filename>pages/quitPage.py # -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'quitPage.ui' # # Created by: PyQt5 UI code generator 5.15.4 # # WARNING: Any manual changes made to this file will be lost when pyuic5 is # run again. Do not edit this file unless you know what you are doing. f...
2.15625
2
quotes/routes.py
vsgobbi/Quotes-Pyramid-REST-API
0
12780834
def includeme(config): config.add_route('index', '/') config.add_route('home', '/home') config.add_route('quotes', '/quotes') config.add_route('random_quote', '/quotes/random') config.add_route('get_quote', '/quotes/{id}') config.add_route('delete_quote', '/delete/{id}') config.add_route('ge...
1.703125
2
examples/root_std_map.py
jjacob/DailyPythonScripts
0
12780835
import rootpy.stl as stl import ROOT # Create a vector type StrVector = stl.vector(stl.string) # Instantiate strvector = StrVector() strvector.push_back("Hello") # etc. MapStrRoot = stl.map(stl.string, ROOT.TH1D) MapStrRootPtr = stl.map(stl.string, "TH1D*") StrHist = stl.pair(stl.string, "TH1*") m = MapStrRootPtr() a...
3.203125
3
selseq/selseq_clustering.py
GrigoriiPechkovskii/selseq
0
12780836
print('start identity_percent') import os import pandas as pd import numpy as np from sklearn.cluster import KMeans import subprocess from selseq_main import *#all? from selseq_constant import * def clustering_kmeans_aln(aln_file,itself=True): '''input file the aligned sequence output clustering by kmeans f...
2.703125
3
zeee_bot/cogs/test.py
zeee2/ZEEE-Discord-Bot
1
12780837
from os import name import pathlib from discord.ext import commands import discord from dislash import InteractionClient, ActionRow, Button, ButtonStyle, SelectMenu, SelectOption from colored import fore, back, style from PIL import Image, ImageFont, ImageDraw, ImageEnhance from zeee_bot.common import glob class Test...
2.5
2
setup.py
gabrielfern/automated-leda-tasks
9
12780838
#!/usr/bin/env python # -*- coding: utf-8 -*- # <NAME> <<EMAIL>> # <NAME> <<EMAIL>> try: from setuptools import setup except ImportError: from os import system system('pip install --user setuptools') from setuptools import setup setup( name='automated', version='1.3.2', description='Automat...
1.5625
2
example.py
JustEdro/appstoreconnectapi
0
12780839
<reponame>JustEdro/appstoreconnectapi #!/usr/bin/env python import sys from appstoreconnect import Api if __name__ == "__main__": key_id = sys.argv[1] key_file = sys.argv[2] issuer_id = sys.argv[3] api = Api(key_id, key_file, issuer_id) apps = api.apps() for app in apps["data"]: print(app["attributes"]["nam...
2.15625
2
computeFeatures/seqStep/seqToolManagers/conservationTools/Al2coManager.py
rsanchezgarc/BIPSPI
5
12780840
from __future__ import absolute_import, print_function import os import numpy as np from subprocess import Popen, PIPE from Bio.PDB.Polypeptide import aa1 as AA_STANDARD from ....featuresComputer import FeatureComputerException from ...seqToolManager import SeqToolManager from .al2coWorkers.parsePsiBlast import parseP...
2.28125
2
data.py
nikhilroxtomar/Polyp-Segmentation-using-UNET-in-TensorFlow-2.0
45
12780841
import os import numpy as np import cv2 from glob import glob import tensorflow as tf from sklearn.model_selection import train_test_split def load_data(path, split=0.1): images = sorted(glob(os.path.join(path, "images/*"))) masks = sorted(glob(os.path.join(path, "masks/*"))) total_size = len(images) ...
2.609375
3
reddit/posts/urls.py
Arnman16/reddirt
0
12780842
<gh_stars>0 from django.urls import include, path from .views import PostView, SubredditView, AllSubredditsView, FrontPageView app_name = 'reddit' urlpatterns = [ path("frontpage/", FrontPageView.as_view()), path("all/", AllSubredditsView.as_view(), name='all' ), path(route='<slug:slug>/', view=SubredditV...
2.046875
2
baseline/CLIP-zero-shot/detection/sliding_params.py
Wuziyi616/slot_attention
0
12780843
<filename>baseline/CLIP-zero-shot/detection/sliding_params.py from typing import Tuple import attr @attr.s(auto_attribs=True) class SlidingParams: # model configs resolution: Tuple[int, int] = (256, 256) # since we not using ViT num_slots: int = 7 # at most 6 obj per image/video # architecture of ...
2.046875
2
day23/lib.py
heijp06/AoC-2021
0
12780844
from queue import PriorityQueue from burrow import Burrow, parse def part1(rows: list[str]) -> int | None: return go(rows) def part2(rows: list[str]) -> int | None: new_rows = list(rows[:3]) + [ " #D#C#B#A#", " #D#B#A#C#", ] + list(rows[3:]) return go(new_rows) def go(rows: list[...
3.625
4
InterviewBit/Trees/postorder_traversal.py
codervikash/online-courses
0
12780845
""" Given a binary tree, return the postorder traversal of its nodes’ values. Example : Given binary tree 1 \ 2 / 3 return [3,2,1]. Using recursion is not allowed. """ # Definition for a binary tree node # class TreeNode: # def __init__(self, x): # self.val = x # self.left =...
4.0625
4
hits_per_minute.py
nathan242/sysadmin-tools
0
12780846
<gh_stars>0 #!/usr/bin/python import sys import os import time count = {} total = 0 highest = 0 average = 0 log = open(sys.argv[1], "r") for line in log: datestring = line.split()[3].replace("[", "")[:-3] if datestring in count: count[datestring] += 1 else: count[datestring] = 1 for i ...
3.515625
4
Easy/Codeland Username Validation.py
edaaydinea/Coderbyte
6
12780847
import re def CodelandUsernameValidation(strParam): # code goes here valid = "false" if strParam[0].isalpha(): if 4 < len(strParam) < 25: if strParam[-1] != '_': if re.match('^[a-zA-Z0-9_]+$', strParam): valid = "true" # code goes here retu...
3.34375
3
inject_version.py
Open-Security-Tools/security_model_tw_plugin
1
12780848
#!/usr/bin/env python import os import subprocess TID_FILE = "src/tiddlers/system/plugins/security_tools/twsm.tid" VERSION_FILE = "VERSION" def get_commit_count(): return int(subprocess.check_output(["git", "rev-list", "--count", "HEAD"]).decode('utf-8')) def main(): with open(VERSION_FILE, "r") as f: ...
2.625
3
image_viewer.py
juu7g/Python-Image-Viewer
0
12780849
""" 画像ビューワー """ import itertools, os, sys import tkinter as tk import tkinter.ttk as ttk import tkinter.font as tkFont from tkinter import filedialog from tkinterdnd2 import * from typing import Tuple # 関数アノテーション用 from PIL import Image, ImageTk # Pillow from PIL.ExifTags import TAGS, GPSTAGS ...
3.296875
3
envs_agents/cartpole/dqn_cartpole_minimal_example.py
dertilo/reinforcement-learning
0
12780850
<reponame>dertilo/reinforcement-learning<filename>envs_agents/cartpole/dqn_cartpole_minimal_example.py import os import time from typing import Iterator, Dict, NamedTuple, Generator import gym import torch import torch.nn as nn import numpy as np from gym.envs.classic_control import CartPoleEnv from gym.wrappers import...
2.28125
2