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
mid_exam/runge_kutta_fourth_order_calculator.py
GiantSweetroll/Computational-Mathematics
0
12773951
import sympy as sp def get_4th_order_rungekutta(dydx, x0, y0, n:int, h, x = sp.Symbol('x'), y = sp.Symbol('y')): """ Method to get the values of x, y and dy/dx using fourth-order Runge-Kutta method in a form of a 2d list Parameters: dydx: Equation to get the derivative x0: initial value of...
3.4375
3
tests/singleton_test.py
markusressel/container-app-conf
2
12773952
<reponame>markusressel/container-app-conf # Copyright (c) 2019 <NAME> # . # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # ...
1.976563
2
myp/package/__init__.py
YunisDEV/py-scripts
2
12773953
from .reader import MYPReader
1.007813
1
pyutl/localenv.py
valldriz/pyutl
0
12773954
import os import sys import json class NoEnvironmentFile(Exception): pass class KeyNotFound(Exception): pass DEFAULT = object() class LocalEnv: _BOOLEANS = {'1': True, 'yes': True, 'true': True, 'on': True, '0': False, 'no': False, 'false': False, 'off': False, '': False} def _...
2.8125
3
tests/providers/cloudera/utils.py
zomborinorbert/airflow
0
12773955
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
2.34375
2
NER-Chinese-BiLSTM+CRF/data/boson/data_util.py
aka-zyq/NER-TF
47
12773956
<filename>NER-Chinese-BiLSTM+CRF/data/boson/data_util.py #!/usr/bin/python # -*- coding: UTF-8 -*- import codecs import pandas as pd import numpy as np import re def data2pkl(): datas = list() labels = list() linedata=list() linelabel=list() tags = set() input_data = codecs.open('./wordtagspl...
2.703125
3
examples/apps/reverse_image_search/server.py
keunhong/scanner
1
12773957
import subprocess try: from flask import Flask, request, send_from_directory except ImportError: print('This example needs Flask to run. Try running:\n' 'pip install flask') app = Flask(__name__) STATIC_DIR = 'examples/reverse_image_search/static' # TODO(wcrichto): figure out how to prevent image ...
2.546875
3
input.py
albertliangcode/DiceRoll
0
12773958
<filename>input.py """ Input 3/26/15 <NAME> Just a quick check to make sure input can be taken in from the user through the console. On the side, it also tests conditionals. """ while(True): s = raw_input("Enter string to print: ") print s,"\n" if(s.lower() == "exit"): break print "Exiting..."
3.28125
3
examples/_gen_playback.py
JacobKosowski/mpl-point-clicker
3
12773959
<reponame>JacobKosowski/mpl-point-clicker from mpl_playback.record import record_file # record_file("heatmap_slicer.py", "fig") record_file("example.py", "fig")
1.65625
2
Extra/Waste Seggregation using trashnet/Final Files/utils.py
KushajveerSingh/pytorch_projects
19
12773960
<reponame>KushajveerSingh/pytorch_projects<gh_stars>10-100 import onnx from onnx_tf.backend import prepare import numpy as np from PIL import Image __all__ = ['prepare_model', 'open_img', 'classes', 'get_pred'] def prepare_model(path='mobilenetv2.onnx'): model = onnx.load(path) tf_rep = prepare(model, devi...
2.328125
2
lib/losses/centernet_loss.py
DuZzzs/monodleX
10
12773961
import torch import torch.nn as nn import torch.nn.functional as F from lib.helpers.decode_helper import _transpose_and_gather_feat from lib.losses.focal_loss import focal_loss_cornernet from lib.losses.uncertainty_loss import laplacian_aleatoric_uncertainty_loss from lib.losses.dim_aware_loss import dim_aware_l1_loss...
1.976563
2
25_DFSBFS/Step01/wowo0709.py
StudyForCoding/BEAKJOON
0
12773962
'''인접 행렬로 풀이''' import sys input = sys.stdin.readline def dfs(v): # 재귀 print(v,end=' ') visited[v] = 1 for i in range(1,N+1): if (not visited[i]) and (graph[v][i]): dfs(i) def bfs(v): # 큐 q = [] q.append(v) visited[v] = 1 while q: v = q.pop(0) print(v,en...
3.296875
3
ABC/187/D.py
yu9824/AtCoder
0
12773963
<reponame>yu9824/AtCoder def LI(): return list(map(int, input().split())) def I(): return int(input()) import sys sys.setrecursionlimit(10 ** 9) ''' 青木派でsortして上から順番に寝返り? 得失点差でsortして上から順番に寝返り? ''' def main(*args): N, AB = args # aoki = [] # takahashi = [] # for a, b in AB: # takahashi.app...
3.203125
3
hkm/migrations/0022_museum_only_products.py
andersinno/kuvaselaamo
1
12773964
# -*- coding: utf-8 -*- # Generated by Django 1.10.2 on 2017-07-19 10:17 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('hkm', '0021_page_ref'), ] operations = [ migrations.AddField( m...
1.609375
2
zfactor_py/calculate_zfactor.py
mkamyab/zfactor
2
12773965
# This code calculates compressibility factor (z-factor) for natural hydrocarbon gases # with 3 different methods. It is the outcomes of the following paper: # <br> # <NAME>.; <NAME>., <NAME>.; <NAME>. & <NAME>, <NAME>. # Using artificial neural networks to estimate the Z-Factor for natural hydrocarbon gases ...
3
3
ml_collections/config_dict/tests/field_reference_test.py
wyddmw/ViT-pytorch-1
311
12773966
# Copyright 2021 The ML Collections Authors. # # 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 law or agreed...
2.640625
3
evaluation.py
maylilyo/wd60
0
12773967
# Standard import gc from pathlib import Path import time # PIP from ignite.metrics import PSNR, SSIM from lpips import LPIPS from ptflops import get_model_complexity_info import torch from torch.utils.data import DataLoader from tqdm import tqdm # Custom from custom.softsplat.model import SoftSplat from custom.vimeo...
2.015625
2
Partylist.py
mas250/Python2
0
12773968
<filename>Partylist.py #PartyList.py print "\t\tThis program allows you to maintain" print "t\t\a list of names opf people to invite" print "\t\tto a party\n" names = [] # Creat an empty list choice = "z" #Initalize choice with value to set while loop to true while choice != "q": print """ C...
4.28125
4
fitness-backend/src/app/dao/class_descs_dao.py
cuappdev/archives
0
12773969
from . import * def get_all_class_descs(): return ClassDesc.query.all() def get_class_desc_by_id(gym_class_id): return ClassDesc.query.filter(ClassDesc.id == gym_class_id).first() def get_class_descs_by_ids(class_desc_id_list): result = [] for class_desc_id in class_desc_id_list: optional_class_desc = ...
2.78125
3
setup.py
teknologist/algolia-doc-manager
0
12773970
<reponame>teknologist/algolia-doc-manager try: from setuptools import setup except ImportError: from ez_setup import use_setuptools use_setuptools() from setuptools import setup import sys test_suite = "tests" tests_require = ["mongo-orchestration>= 0.2, < 0.4", "requests>=2.5.1"] if sys.version_info[...
1.484375
1
gem/tests/base.py
praekelt/molo-gem
3
12773971
<gh_stars>1-10 import json from django.contrib.auth import get_user_model from django.contrib.contenttypes.models import ContentType from wagtail.core.models import Page from molo.core.models import ( Main, SectionPage, ArticlePage, PageTranslation, Tag, BannerPage, Languages, SiteLanguageRelation) from molo...
1.90625
2
ggongsul/member/migrations/0008_auto_20211126_1014.py
blc-cruise/ggongsul-api
2
12773972
<filename>ggongsul/member/migrations/0008_auto_20211126_1014.py<gh_stars>1-10 # Generated by Django 3.1.5 on 2021-11-26 10:18 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('member', '0007_memberdetail_recommended_place'), ] operations = [ ...
1.671875
2
nemo/collections/tts/helpers/partialconv1d.py
MikyasDesta/NeMo
0
12773973
# Copyright (c) 2022, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
1.8125
2
birthday_pages/apps.py
JoshZero87/site
4
12773974
from __future__ import unicode_literals from django.apps import AppConfig class BirthdayPagesConfig(AppConfig): name = 'birthday_pages'
1.304688
1
DiseaseIdentifier/DiseaseClassify/migrations/0002_auto_20190515_0951.py
Rosan93/Disease-Identifier
0
12773975
# Generated by Django 2.2.1 on 2019-05-15 09:51 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('DiseaseClassify', '0001_initial'), ] operations = [ migrations.AlterField( model_name='uploadimage', name='predict_i...
1.398438
1
python3/286.walls-and-gates.250862961.ac.py
Diego-Zulu/leetcode_answers
0
12773976
<reponame>Diego-Zulu/leetcode_answers # # @lc app=leetcode id=286 lang=python3 # # [286] Walls and Gates # # https://leetcode.com/problems/walls-and-gates/description/ # # algorithms # Medium (53.35%) # Likes: 1050 # Dislikes: 15 # Total Accepted: 113.7K # Total Submissions: 212.9K # Testcase Example: '[[2147483...
3.671875
4
OpenGL/lazywrapper.py
t20100/pyopengl
210
12773977
"""Simplistic wrapper decorator for Python-coded wrappers""" from OpenGL.latebind import Curry from OpenGL import MODULE_ANNOTATIONS class _LazyWrapper( Curry ): """Marker to tell us that an object is a lazy wrapper""" def lazy( baseFunction ): """Produce a lazy-binding decorator that uses baseFunction A...
3.265625
3
train_interfaces.py
pgruening/fp_nets_as_novel_deep_networks_inspired_by_vision
0
12773978
<filename>train_interfaces.py import numpy as np import torch import torch.nn as nn import torch.nn.init as init from DLBio.pt_train_printer import IPrinterFcn from DLBio.pt_training import ITrainInterface from DLBio.pytorch_helpers import ActivationGetter, get_device from DLBio.train_interfaces import (Accuracy, Class...
2.265625
2
main.py
ahlumcho/RyeongBot
0
12773979
print("Hello world! i'm <NAME>" ) print("캔디크러시팡팡파라바라팡팡팡" ) print('웅앵옹앙응')
2.15625
2
rlagent.py
Ankur-Deka/Emergent-Multiagent-Strategies
23
12773980
from rlcore.algo import PPO from rlcore.storage import RolloutStorage class Neo(object): def __init__(self, args, policy, obs_shape, action_space): super().__init__() self.obs_shape = obs_shape self.action_space = action_space self.actor_critic = policy # it is MPNN instance self.rollou...
2.265625
2
serene_load/serene_load/helpers/load_helpers.py
NICTA/serene-etl
0
12773981
<filename>serene_load/serene_load/helpers/load_helpers.py<gh_stars>0 import collections import json import logging import subprocess import os from serene_load.helpers.containers.container_base import BaseContainer, FileContainer from serene_metadata import REQUIRED_LOAD_FIELDS, PRIMARY_ID class load_logger(object):...
2
2
Alihossein/contest/8901/8901.py
alihossein/quera-answers
0
12773982
<gh_stars>0 # question : https://quera.ir/problemset/contest/8901 x_n = input().split(' ') x = x_n[1] n = int(x_n[0]) default_value = { 'L': 0, 'M': 0, 'R': 0, } movements = [] for one_input in range(n): movements.append(input().split(' ')) default_value[x] = 1 for one_movement in movements: temp ...
3.265625
3
api/users/serializers.py
individuo7/wololo-tournaments-api
2
12773983
<reponame>individuo7/wololo-tournaments-api<filename>api/users/serializers.py<gh_stars>1-10 from rest_framework.serializers import ModelSerializer from django.contrib.auth import get_user_model User = get_user_model() class UserSerializer(ModelSerializer): class Meta: model = User fields = [ ...
2.078125
2
server_client/manager.py
shrijaltamrakar/Descent_py
2
12773984
<reponame>shrijaltamrakar/Descent_py import os, threading from time import sleep server = "python server.py" client = "python client.py" multi_server = "python multi_server.py" multi_client = "python multi_client.py" class run_cmd(threading.Thread): def __init__(self,command): threading.Thread.__init__(...
3.140625
3
code/Phase_1_CNN/CompileTensor.py
MMarochov/SEE_ICE
4
12773985
# -*- coding: utf-8 -*- """ Created on Sat Feb 6 14:52:32 2021 @author: Patrice Simple utility script to read tiles from drive and compile a large tensor saved as an npy file. Use only if you have enough ram to contain all your samples at once """ import numpy as np import glob import skimage.io as io def tic(): ...
2.546875
3
CursoemVideo/ex104.py
arthxvr/coding--python
0
12773986
<gh_stars>0 from colorama import init init() def leiaInt(msg): while True: num = str(input(msg)).strip() if num.isnumeric(): int(num) break else: print('\033[0;31mERRO! Digite um número inteiro válido.\033[m') return num num = leiaInt('Digite um nú...
3.5
4
py/codeforces/842C.py
shhuan/algorithms
0
12773987
# -*- coding: utf-8 -*- import math import collections import bisect import heapq import time import random import itertools import sys """ created by shhuan at 2017/10/20 15:45 """ def gcd(a, b): if b == 0: return a return gcd(b, a%b) N = 2*10**5+5 vis = [0] * N G = collections.defaultdict(list...
3.171875
3
Python/empire/aws/dynamodb/table_struct.py
Tombmyst/Empire
0
12773988
<gh_stars>0 from empire import * from datetime import datetime from empire.structs import * from empire.enums.base_enum import BaseEnum class TableStatuses(BaseEnum): CREATING: Final[str] = 'CREATING' UPDATING: Final[str] = 'UPDATING' DELETING: Final[str] = 'DELETING' ACTIVE: Final[str] = ...
2.015625
2
gui_tools/create_gui_zip.py
kusterlab/SIMSI-Transfer
0
12773989
<filename>gui_tools/create_gui_zip.py from pathlib import Path import shutil simsi_dist_dir = Path.cwd() / 'dist' / 'SIMSI-Transfer' lib_dir = simsi_dist_dir / 'lib' lib_dir.mkdir(parents=True, exist_ok=True) print("Moving libraries to lib directory") for f in simsi_dist_dir.glob('*'): if f.name.endswith(".egg-i...
2.484375
2
variation/schemas/hgvs_to_copy_number_schema.py
cancervariants/varlex
0
12773990
<reponame>cancervariants/varlex """Module containing schemas used in HGVS To Copy Number endpoints""" from typing import Type, Any, Dict, Union from ga4gh.vrsatile.pydantic.vrs_models import RelativeCopyClass, AbsoluteCopyNumber, \ RelativeCopyNumber, Text from pydantic import StrictStr from variation.schemas.cla...
2.15625
2
scraper/scraper.py
keanu-xoren/budget-generator
0
12773991
<gh_stars>0 from bs4 import BeautifulSoup import requests TEST_CITY = { "city" : "Oakland", "state" : "IL", "country" : "United States" } NUMBEO_URL = "https://www.numbeo.com/cost-of-living/in/" def formatLocationURL(city, country='', state=''): return ('-').join(filter(None, city.split(' ') + state...
3.3125
3
PathDSP/myModel.py
TangYiChing/PathDSP
2
12773992
""" Feedforward model construct number of hidden layers:5 neural units of hidden layers: [2000, 1000, 800, 500, 100] activation function: elu """ import torch as tch class FNN(tch.nn.Module): def __init__(self, n_inputs): # call constructors from superclass super(FNN, self).__init__()...
3.75
4
train/data/iphi_dates.py
sommerschield/iphi
7
12773993
<filename>train/data/iphi_dates.py # Copyright 2021 <NAME>, <NAME>, # <NAME>, <NAME>, <NAME>, # University of Oxford, DeepMind Technologies Limited, Google LLC # # 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 o...
2.3125
2
tests/test_startup.py
tearf001/fastapi-sqla
33
12773994
import httpx from asgi_lifespan import LifespanManager from fastapi import FastAPI from pytest import mark from sqlalchemy import text def test_startup(): from fastapi_sqla import _Session, startup startup() session = _Session() assert session.execute(text("SELECT 1")).scalar() == 1 @mark.asyncio...
2.328125
2
gblda/__init__.py
ChengjieWU/LatentDirichletAllocation
2
12773995
"""Copyright (c) 2020 <NAME>""" from .gblda import GibbsLDA
0.925781
1
setup.py
Kushagrabainsla/create-flask-app
11
12773996
from setuptools import setup, find_packages import pathlib HERE = pathlib.Path(__file__).parent README = (HERE / "README.md").read_text() setup( name='build-flask-app', description='Set up a modern flask web server by running one command.', long_description=README, long_description_content_type="text/...
1.554688
2
Tests/EndToEndTests/CNTKv2Python/Examples/ConvNet_CIFAR10_DataAug_test.py
shyamalschandra/CNTK
17,702
12773997
# Copyright (c) Microsoft. All rights reserved. # Licensed under the MIT license. See LICENSE.md file in the project root # for full license information. # ============================================================================== import numpy as np import os import sys from cntk.ops.tests.ops_test_utils import ...
2.0625
2
landscape_setup/concourse.py
jia-jerry/cc-utils
0
12773998
<gh_stars>0 # Copyright (c) 2019 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed # under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance wit...
1.640625
2
dataStructures/queue.py
evanxg852000/rockstartdev
1
12773999
from linkedlist import LinkedList class Queue(object): def __init__(self): self._store = LinkedList() def enqueue(self, data): self._store.add_back(data) def dequeue(self): if(self._store.front() != None): data = self._store.front().data self._store.delete(...
3.921875
4
adventofcode/2019/python/day03.py
shanavas786/coding-fu
1
12774000
<reponame>shanavas786/coding-fu #!/usr/bin/env python3 def get_vertices(wire): x = y = steps = 0 vertices = [(x, y, 0)] for edge in wire: length = int(edge[1:]) steps += length if edge[0] == "R": x += length if edge[0] == "L": x -= length ...
3.609375
4
weibospider/daemon_tweet.py
uglyghost/WeiboSpider
0
12774001
<gh_stars>0 import os while 1: run_depth_pct = 'python run_spider.py tweet' os.system(run_depth_pct)
1.867188
2
mandalka/node.py
squirrelinhell/mandalka
0
12774002
<gh_stars>0 # Copyright (c) 2017 SquirrelInHell # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, ...
1.921875
2
test/raven/test_raven_utils.py
wudidaizi/RAVEN
0
12774003
<reponame>wudidaizi/RAVEN<gh_stars>0 # %% import torch from RAVEN.pe.raven.utils import poly import matplotlib.pyplot as plt # %% """ # test poly """ # %% device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu") a = torch.arange(0, 1, 0.001).to(device) precise = torch.exp(a).to(device) var = a coef...
2.53125
3
Curso_Em_Video_Python/ex051.py
ThallesTorres/Curso_Em_Video_Python
0
12774004
<gh_stars>0 # Ex: 051 - Desenvolva um programa que leia o primeiro termo e a razão de uma # PA. No final. mostre os 10 primeiros termos dessa progressão. print(''' -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- --Seja bem-vindo! --Exercício 051 -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- ''') print('--Progressão Aritmética\n...
3.78125
4
post-sermon/extract-meta.py
tstephen/cbc-gsuite
0
12774005
#!/usr/bin/python3 # # Extract audio metadata from m4a file # # Author: <NAME> # Date: 04 Jan 2021 # import glob from mutagen.mp4 import MP4 import numpy as np filez = glob.glob("2020_12_27_AM.m4a") mp4file = MP4(filez[0]) for tag in mp4file.tags: print('{}: {}'.format(tag, mp4file.tags[tag]))
2.78125
3
src/test/test_urilib2.py
supheart/python-spider
0
12774006
# -*- coding: utf-8 -* import urllib2 import urllib import cookielib import json url = "http://www.baidu.com" url_json = "http://zhiboba.3b2o.com/article/showListJson/EKo5qjn6Mq4" # print urllib2.urlopen("http://baike.baidu.com/view/20965.htm").read() readText = urllib2.urlopen(url_json).read() content = json.loads(...
2.890625
3
util.py
ZiyaoWei/pyMatrixProfile
29
12774007
import numpy as np import numpy.fft as fft def zNormalize(ts): """Return a z-normalized version of the time series ts. >>> zNormalize(np.array([1.0, 1.0, 1.0])) array([ 0., 0., 0.]) >>> np.round(zNormalize(np.array([1.0, 2.0, 0.0])), 3) array([ 0. , 1.225, -1.225]) >>> np.round(zNormaliz...
3.0625
3
alocadorDeMemoria/algoritmo.py
lucascust/alocador-de-memoria
1
12774008
<reponame>lucascust/alocador-de-memoria # ncoding=utf-8 # DEFINIÇÃO DO PADRÃO DE ESCRITA # COMENTÁRIOS # 1º Modo de escrita dos comentários livre, ´~^-_+=, etc, permitidos #ex: meu nome é, variável de saída # FUNÇÕES # 2º Nomes das funções SEM ´~^-_+=, etc. E pode usar "De" #...
3.578125
4
imghide.py
heyDevlopr/imghide
0
12774009
#!/usr/bin/python3 import tkinter as tk from tkinter import messagebox from PIL import ImageTk from PIL import Image from os import path from Crypto.Cipher import AES from Crypto.Hash import SHA256 from Crypto import Random import base64 from sys import exit global mainBgColr, secBgColr, theme mainBgColr = "#121212" ...
3
3
spar_python/query_generation/query_bounds.py
nathanawmk/SPARTA
37
12774010
<filename>spar_python/query_generation/query_bounds.py # ***************************************************************** # Copyright 2013 MIT Lincoln Laboratory # Project: SPAR # Authors: ATLH # Description: Functions to delinate the bounds for different # query ...
2.359375
2
tests/unit/exponential_distribution_test.py
konradarchicinski/stpp
1
12774011
<filename>tests/unit/exponential_distribution_test.py import unittest import fistpp as fs class ExponetialDistributionTests(unittest.TestCase): def setUp(self): self.expdist = fs.ExponentialDistribution() self.expected_values = [ 0.001000500333583534, 0.005012541823544286, 0.0100503358...
2.78125
3
config/common/all_params.py
leozz37/makani
1,178
12774012
# Copyright 2020 Makani Technologies LLC # # 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 law or agreed to...
1.570313
2
cogbot/cogs/robo_mod/robo_mod_options.py
Arcensoth/cogbot
8
12774013
<filename>cogbot/cogs/robo_mod/robo_mod_options.py from typing import Dict, List, Optional, Set from discord import Color from cogbot.cogs.robo_mod.robo_mod_rule import RoboModRule from cogbot.cogs.robo_mod.robo_mod_trigger_type import RoboModTriggerType from cogbot.types import ChannelId, RoleId class RoboModOptio...
2.1875
2
RRT/old versions/29_june_2016_single_RRT/parameters.py
hasauino/Python
0
12774014
<reponame>hasauino/Python<filename>RRT/old versions/29_june_2016_single_RRT/parameters.py dim=10.0 eta=0.5 steps=100 #must be integer (no decimal point) rneighb=eta
1.203125
1
util/measure/modularity.py
yuhsiangfu/Multiple-Spreaders
0
12774015
""" Measure: modularity (set) @auth: <NAME> @date 2015/10/09 @update 2016/02/13 """ # 模塊性: Newman's modularity def modularity(G, community_list): """ The estimated time complexity of this version (2016/02/13) is approximating O(V) + O(E) """ import copy as c NODE_DEGREE = 'node_degree' ...
3.53125
4
train/new_train.py
zeroAska/TFSegmentation
633
12774016
<filename>train/new_train.py """ New trainer faster than ever """ from metrics.metrics import Metrics from utils.reporter import Reporter from utils.misc import timeit from tqdm import tqdm import numpy as np import tensorflow as tf import matplotlib import time matplotlib.use('Agg') import matplotlib.pyplot as plt ...
2.359375
2
rps_nk.py
naraekwon/udacity-rock-paper-scissor
0
12774017
<gh_stars>0 #!/usr/bin/env python3 import random import pdb """This program plays a game of Rock, Paper, Scissors between two Players, and reports both Player's scores each round.""" moves = ['rock', 'paper', 'scissors'] """The Player class is the parent class for all of the Players in this game""" class Player: ...
4.1875
4
BinarySearch/MorPracticesII/Median of Two Sorted Arrays.py
mamoudmatook/Leetcode
0
12774018
# # Created on Wed Sep 01 2021 # # The MIT License (MIT) # Copyright (c) 2021 Maatuq # # Permission is hereby granted, free of charge, to any person obtaining a copy of this software # and associated documentation files (the "Software"), to deal in the Software without restriction, # including without limitation the ri...
3.109375
3
midonet/neutron/tests/unit/test_midonet_plugin.py
midokura/python-neutron-plugin-midonet
0
12774019
<reponame>midokura/python-neutron-plugin-midonet<gh_stars>0 # vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright (C) 2012 Midokura Japan K.K. # Copyright (C) 2013 Midokura PTE LTD # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in c...
1.476563
1
camkes/visualCAmkES/View/Instance_Property_Widget.py
aisamanra/camkes-tool
0
12774020
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright 2017, Data61 # Commonwealth Scientific and Industrial Research Organisation (CSIRO) # ABN 41 687 119 230. # # This software may be distributed and modified according to the terms of # the BSD 2-Clause license. Note that NO WARRANTY is provided. # See "LICENSE_...
2.4375
2
client/utils/config_jim.py
DoctorChe/Python_DataBase_PyQT
1
12774021
<filename>client/utils/config_jim.py """Константы для jim протокола, настройки""" ACTION = "action" # тип сообщения между клиентом и сервером TIME = "time" # время запроса DATA = "data" # данные пересылаемые в сообщении (вложенный словарь) TOKEN = "token" # токен RESPONSE = "response" # код ответа # Значения (Ти...
2.421875
2
ui.py
volkmaster/word-image-collage
0
12774022
<reponame>volkmaster/word-image-collage import sys from PyQt5.QtWidgets import QMainWindow, QApplication, QDialog, QLabel, QLineEdit, QPushButton from PyQt5.QtCore import pyqtSlot from api import api_caller from filtering import elastic_transform, japanify, pixelsort, smoothing, ripple_effect, segmentation import patte...
2.453125
2
70/main.py
pauvrepetit/leetcode
0
12774023
# 70. 爬楼梯 # # 20210716 # huao from math import comb class Solution: def climbStairs(self, n: int) -> int: count = 0 for i in range(n // 2 + 1): count += comb(n - i, i) return count print(Solution().climbStairs(2)) print(Solution().climbStairs(3))
3.296875
3
tests/cors_test.py
aio-libs-abandoned/aiorest
3
12774024
<gh_stars>1-10 import unittest import asyncio import aiohttp import contextlib from aiorest import RESTServer class REST: def __init__(self, test): self.test = test def index(self, request): return {'status': 'ok'} def check_origin(self, request): return {'status': 'ok'} clas...
2.390625
2
algnuth/polynom.py
louisabraham/algnuth
290
12774025
""" Modular arithmetic """ from collections import defaultdict import numpy as np class ModInt: """ Integers of Z/pZ """ def __init__(self, a, n): self.v = a % n self.n = n def __eq__(a, b): if isinstance(b, ModInt): return not bool(a - b) else: ...
3.421875
3
tests/test_prelude_tagblock.py
iwschris/ezodf2
4
12774026
<reponame>iwschris/ezodf2 #!/usr/bin/env python #coding:utf-8 # Purpose: test node organizer # Created: 31.01.2011 # Copyright (C) 2011, <NAME> # License: MIT from __future__ import unicode_literals, print_function, division __author__ = "mozman <<EMAIL>>" import unittest # test helpers from mytesttools i...
2.453125
2
clevr_dataloader.py
CatarauCorina/representation_learning
0
12774027
import os import torch import matplotlib.pyplot as plt from torchvision import transforms from torch.utils.data import Dataset import cv2 from PIL import Image class CustomDataSet(Dataset): def __init__(self, main_dir, type='train', resolution=(128,128)): self.main_dir = main_dir self.root_dir =...
2.84375
3
examples/sentiment_analysis/sentiment_analysis.py
ruanchaves/word_segmentation
1
12774028
<reponame>ruanchaves/word_segmentation<gh_stars>1-10 import json from dataclasses import dataclass, field import logging import os import sys from torch import nn import torch from contextlib import suppress from pythonjsonlogger import jsonlogger import datasets from datasets import ( load_dataset, ...
2.203125
2
official/projects/edgetpu/vision/configs/mobilenet_edgetpu_config.py
62theories/tf-flask
82,518
12774029
# Copyright 2021 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
1.828125
2
whales_model.py
avain/DeepLearningTutorial
1
12774030
<reponame>avain/DeepLearningTutorial from keras.models import Sequential from keras.layers import Flatten,Dense,Conv2D,MaxPooling2D from keras.engine import Layer import keras.backend as K def my_ConvNet(input_shape): model = Sequential() #conv1 model.add(Conv2D(filters=96, kernel_size=(11, 11), ...
3.390625
3
server.py
RobinKarlsson/protobuf-chat
1
12774031
<reponame>RobinKarlsson/protobuf-chat<filename>server.py<gh_stars>1-10 import protobuf import select, socket, struct class ChatServer: def __init__(self, host = "", port = 8942): self.port = port self.host = host #inet streaming server socket self.ssocket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)...
2.90625
3
caldera/app/commands/command.py
m4l1c3/caldera
3
12774032
<reponame>m4l1c3/caldera from typing import Union, List class CommandLine(object): def __init__(self, command_line: Union[str, List[str]] = None): if command_line and isinstance(command_line, list): command_line = ' '.join(command_line) self.command_line = command_line
2.734375
3
tensorflow_impl/rsrcs/aggregator_tf/average.py
sahareslami/Garfield
8
12774033
import numpy as np class Average: @staticmethod def aggregate(gradients): assert len(gradients) > 0, "Empty list of gradient to aggregate" if len(gradients) > 1: return np.mean(gradients, axis=0) else: return gradients[0]
3.265625
3
FbxPipeline/generated/apemodefb/EAnimCurvePropertyFb.py
johnfredcee/FbxPipeline
72
12774034
# automatically generated by the FlatBuffers compiler, do not modify # namespace: apemodefb class EAnimCurvePropertyFb(object): LclTranslation = 0 RotationOffset = 1 RotationPivot = 2 PreRotation = 3 PostRotation = 4 LclRotation = 5 ScalingOffset = 6 ScalingPivot = 7 LclScaling = 8...
1.179688
1
mscv/image/__init__.py
misads/mscv
1
12774035
<reponame>misads/mscv<filename>mscv/image/__init__.py from .image_io import tensor2im __all__ = ['tensor2im']
1.1875
1
setup.py
rotdrop/rhasspy-wake-precise-hermes
0
12774036
<filename>setup.py """Setup file for rhasspywake_precise_hermes""" from pathlib import Path import setuptools this_dir = Path(__file__).parent with open(this_dir / "README.md") as readme_file: long_description = readme_file.read() with open(this_dir / "requirements.txt") as requirements_file: requirements = ...
1.835938
2
examples/example11.py
pyrate-build/pyrate-build
41
12774037
<gh_stars>10-100 #!/usr/bin/env pyrate executable('example11.bin', 'test.cpp test.c foo.cpp', link_mode = 'direct') # automatic switching to 'single' mode
1.289063
1
src/main.py
chengkunli96/KinectFusion
28
12774038
<reponame>chengkunli96/KinectFusion<gh_stars>10-100 import matplotlib.pyplot as plt from os.path import join as opj import os import json import open3d as o3d from data_loader import * from kinect_fusion import * from utils.pyrender_show import showMesh from utils.open3d_show import showPointCloud # for ...
2.15625
2
jug/tests/jugfiles/custom_hash_function.py
dombrno/jug
309
12774039
<gh_stars>100-1000 from jug import TaskGenerator from jug.utils import CustomHash hash_called = 0 def bad_hash(x): global hash_called hash_called += 1 return ('%s' % x).encode('utf-8') @TaskGenerator def double(x): return 2*x one = CustomHash(1, bad_hash) two = double(one)
2.484375
2
recipes/wav2vec_collect.py
sciforce/phones-las
35
12774040
<filename>recipes/wav2vec_collect.py from tqdm import tqdm import h5py import os import argparse import numpy as np import tensorflow as tf from preprocess_all import make_example if __name__ == '__main__': parser = argparse.ArgumentParser() parser.add_argument('--data_dir', type=str, help='directory with ge...
2.59375
3
pegasusio/nanostring_data.py
hoondy/pegasusio
0
12774041
<reponame>hoondy/pegasusio<filename>pegasusio/nanostring_data.py import numpy as np import pandas as pd from scipy.sparse import csr_matrix from typing import List, Dict, Union import logging logger = logging.getLogger(__name__) import anndata from pegasusio import UnimodalData from .views import INDEX, _parse_index,...
2.234375
2
setup_test.py
nahidupa/grr
1
12774042
#!/usr/bin/env python """A quick script to verify that setup.py actually installs all files.""" # pylint: disable=g-import-not-at-top import os import re try: import setuptools setuptools.setup = lambda *args, **kw: None except ImportError: from distutils import core core.setup = lambda *args, **kw: None im...
2.265625
2
vbb_backend/users/migrations/0009_auto_20210320_1800.py
patrickb42/backend-vbb-portal
3
12774043
<gh_stars>1-10 # Generated by Django 3.0.10 on 2021-03-20 18:00 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('users', '0008_auto_20210320_1759'), ] operations = [ migrations.AlterField( model_name='newslettersubscriber', ...
1.765625
2
src/t/__init__.py
danpalmer/t
1
12774044
from .cli import autodiscover, cli def main(): autodiscover() cli() __all__ = ( "autodiscover", "cli", "main", )
1.195313
1
lib/python3.8/site-packages/ansible/module_utils/facts/sysctl.py
cjsteel/python3-venv-ansible-2.10.5
4
12774045
# This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Ansible is distributed in the hope that ...
2.03125
2
stoa.py
petehague/stoa
0
12774046
#!/usr/bin/env python import os import sys import re params = {"port": 9000, "target": "./example"} if len(sys.argv)>1: for arg in sys.argv: tokens = re.split("=",arg.strip()) if len(tokens)>1: var = tokens[0] value = tokens[1] params[var] = value #TODO: make this a more python...
2.328125
2
plato/internal/weak_id_dict.py
jgosmann/plato
0
12774047
"""Provides a dictionary indexed by object identity with a weak reference.""" import weakref from typing import Any, Dict, Generic, Iterator, TypeVar T = TypeVar("T") class WeakIdDict(Generic[T]): """Dictionary using object identity with a weak reference as key.""" data: Dict[int, T] refs: Dict[int, we...
2.84375
3
parser/team02/proyec/Valor/Valor.py
webdev188/tytus
35
12774048
from ast.Expresion import Expresion class Valor(Expresion): def __init__(self,value,line,column): self.value = valor def getValor(self,entorno,tree): return self.value
2.5625
3
Swit/inner/branch.py
NogaOs/wit
0
12774049
<filename>Swit/inner/branch.py from Swit.common.exceptions import BranchNameExistsError, CommitRequiredError from loguru import logger def does_branch_exist(branch_name: str) -> bool: """Returns True if there's already a branch with the given name.""" lines = path_to.references.read_text().split("\n") fo...
3.125
3
utils/bleu_metric/__init__.py
arfu2016/DuReader
0
12774050
__author__ = 'tylin' # from .bleu import Bleu # # __all__ = ['Bleu']
1.101563
1