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
src/CLSystemReferenceImport.py
shmouses/SpectrumImageAnalysisPy
3
12798151
from __future__ import print_function import csv import numpy as np import re import Spectrum #import matplotlib.pyplot as plt def ReadCSVRef(filename): with open(filename) as csvfile: reader = csv.reader(csvfile, delimiter=',') headers = list(filter(None, next(reader))) data = [] f...
2.71875
3
email_utils/email_verification.py
Aayush-hub/Bulk-Mailer
0
12798152
<reponame>Aayush-hub/Bulk-Mailer<gh_stars>0 from itsdangerous import URLSafeTimedSerializer, SignatureExpired from json import load config = None with open("import.json", "r") as f: config = load(f)["jsondata"] # Token is valid for 1 day if len(config["email_verification_timeout"]) != 0: MAX_TIME = int(config...
2.5
2
evennia_wiki/markdown_engine.py
vlegoff/evennia-wiki
2
12798153
"""Class containing the generic markdown engine used by evenniq_wiki.""" from bs4 import BeautifulSoup from markdown import Markdown class MarkdownEngine(Markdown): """A special markdown engine for the evennia_wiki. This pre-loads some common extensions and allows some inner processing. """ def __...
3.421875
3
services/web/canonizer.py
vpodpecan/canonical_forms
0
12798154
<filename>services/web/canonizer.py import os import classla import csv import argparse from lemmagen3 import Lemmatizer classla.download('sl', logging_level='WARNING') BASEDIR = os.path.dirname(__file__) def lem_adj(gender, wrd): lem = Lemmatizer() if gender == 'm': lem.load_model(os.path.join(BASE...
2.5
2
roster2ical/roster.py
SimonCW/roster2cal
0
12798155
# AUTOGENERATED! DO NOT EDIT! File to edit: 00_roster.ipynb (unless otherwise specified). __all__ = ['ShiftProperties', 'Shift', 'Roster'] # Cell from dataclasses import dataclass from datetime import datetime, timedelta, date, time from ics import Calendar, Event import re from typing import Optional from zoneinfo i...
2.65625
3
ArticleTranslation.py
soumendrak/Odia-Translation
0
12798156
#!/usr/bin/env python # -*- coding: utf-8 -*- import urllib2 import re import goslate def trans(word): gs = goslate.Goslate() ro = gs.translate(word, 'or') if ro == "": ro = word return ro i = 3 while i != 100000: ArtName = raw_input('\n\ntype the name of article from english wikipedia: '...
3.328125
3
EloRater.py
Wally869/RankingELO-Python
2
12798157
from __future__ import annotations def GetWinningProbability(rating1: float, rating2: float): return 1.0 / (1.0 + 10 ** ((rating1 - rating2) / 400)) def ComputeDeltaRating(ratingPlayer1: float, ratingPlayer2: float, isWinPlayer1: bool) -> float: P1 = (1.0 / (1.0 + pow(10, ((ratingPlayer1 - ratin...
2.8125
3
src/command/voice_log/main.py
link1345/Vol-GameClanTools-DiscordBot
0
12798158
import sys import discord from discord.ext import tasks import base.command_base as base import base.DiscordSend as Sendtool import base.ColorPrint as CPrint import base.time_check as CTime import os import collections as cl from datetime import datetime, timedelta from dateutil.relativedelta import relativedelta ...
2.203125
2
backend/app/routers/documents.py
nokia-wroclaw/innovativeproject-wiki
9
12798159
<filename>backend/app/routers/documents.py """ TODO module docstring """ import json from fastapi import APIRouter from app.routers.files import get_document_path from app.utils.message import Message, MsgStatus router = APIRouter(prefix="/api/document", tags=["Document Management"]) DOCUMENT_FILE = "document.json"...
2.640625
3
leetcode/add_binary.py
zhangao0086/Python-Algorithm
3
12798160
<gh_stars>1-10 #!/usr/bin/python3 # -*-coding:utf-8-*- __author__ = "Bannings" class Solution: def addBinary(self, a: str, b: str) -> str: carry, ans = 0 , '' for i in range(max(len(a), len(b))): carry += ord(a[len(a) - i - 1]) - ord('0') if i < len(a) else 0 carry += ord(b...
3.265625
3
cvpy25.py
L3ndry/guanabara-python
0
12798161
nome_completo = input("Digite o seu nome completo: ").lower() print("silva" in nome_completo)
3.234375
3
blackjack/hand.py
Simon-Lee-UK/blackjack-game
1
12798162
""" This module exports the 'Hand' class, 'PlayerHand' and 'DealerHand' subclasses, and related methods. """ import time draw_delay = 1 # The pause in seconds between drawn card actions twenty_one = 21 # Ideal score value for both players class Hand: """ A class defining the properties and methods of a han...
3.796875
4
create_input_files_coco.py
sulabhkatiyar/show_tell
0
12798163
from utils import create_input_files """ To create files that contain all images stored in h5py format and captions stored in json files. Minimum word frequencies to be used as cut-off for removing rare words to be specifiied here. """ if __name__ == '__main__': create_input_files(dataset='coco', ...
3.03125
3
website/TableManager.py
uclchem/HITS
0
12798164
import pandas as pd class TableManager: def __init__(self,table_file): self.master_table=pd.read_csv(table_file).sort_values("Info",ascending=False) def get_filtered_table(self,low_freq,high_freq,delta_freq,target): low_freq=float(low_freq) high_freq=float(high_freq) delta_freq...
3.203125
3
Python 3/Crash course/list comprehension.py
DarkShadow4/python
0
12798165
# Without list comprehension squares1 = [] for value in range(1, 11): squares1.append(value**2) print(squares1) # With list comprehension squares2 = [value**2 for value in range(1, 11)] print(squares2)
3.90625
4
pytorch2paddle.py
JiaoPaner/craft-det
0
12798166
# -*- coding: utf-8 -*- # @Time : 2022/3/8 14:38 # @Author : jiaopaner import sys sys.path.insert(0, './') import torch from collections import OrderedDict from craft import CRAFT def copyStateDict(state_dict): if list(state_dict.keys())[0].startswith("module"): start_idx = 1 else: start_id...
2.203125
2
Data/EGFR.py
cdhavala26/railroad-diagrams
0
12798167
import sys from railroad import * print('<h1>Molecules</h1>') add("EGF", Diagram( "EGF(", Choice(0, Comment(" "), "Site",), ")" )) add("EGFR", Diagram( "EGFR(", Choice(0, Comment(" "), "ecd",), Choice(0, Comment(" "), "t...
2.390625
2
examples/spatially-varying-anisotropy/run.py
davidcortesortuno/finmag
10
12798168
<filename>examples/spatially-varying-anisotropy/run.py<gh_stars>1-10 """ Demonstrating spatially varying anisotropy. Example with anisotropy vectors as follows: ----------------------------------- --> --> --> --> --> --> --> --> --> --> --> --> --> --> --> --> --> --> --> --> --> --> --> --> --> --> --> ------------...
2.71875
3
MetioTube/profiles/models.py
Sheko1/MetioTube
0
12798169
from cloudinary.models import CloudinaryField from django.contrib.auth import get_user_model from django.db import models # Create your models here. from MetioTube.core.validators import validate_image UserModel = get_user_model() class Profile(models.Model): username = models.CharField( max_length=30 ...
2.34375
2
getseq.py
l0o0/bio-analysis-kit
3
12798170
<reponame>l0o0/bio-analysis-kit #!/bin/python # 2014-11-4 Linxzh # retrive gene seq for genome seq by gene id import argparse from Bio import SeqIO parser = argparse.ArgumentParser(description='Retrive gene sequence by gene id', prog='SeqGeter', usage='PROG [options]') parser.add_argument('-i', help='file contains g...
2.984375
3
FRCScouting/TheBlueAlliance/team.py
xNovax/FRCScouting.ca
1
12798171
<gh_stars>1-10 from django.conf import settings import tbaapiv3client from tbaapiv3client.rest import ApiException def get_team(teamkey): configuration = tbaapiv3client.Configuration() configuration.api_key['X-TBA-Auth-Key'] = settings.THE_BLUE_ALLIANCE_KEY api_instance = tbaapiv3client.TeamApi(tbaapiv3cli...
2.015625
2
ecco_v4_py/test/test_ecco_utils.py
owang01/ECCOv4-py
24
12798172
import warnings from datetime import datetime import numpy as np import xarray as xr import pytest import ecco_v4_py from .test_common import all_mds_datadirs, get_test_ds @pytest.mark.parametrize("mytype",['xda','nparr','list','single']) def test_extract_dates(mytype): dints = [[1991,8,9,13,10,15],[1992,10,20,...
2.34375
2
prompt_toolkit/contrib/ssh/__init__.py
anthonyrota/school-yr10-russian-mafia-game
0
12798173
# from .server import PromptToolkitSession, PromptToolkitSSHServer # __all__ = [ # "PromptToolkitSession", # "PromptToolkitSSHServer", # ]
1.039063
1
src/genie/libs/parser/iosxe/tests/ShowLicenseSummary/cli/equal/golden_output2_expected.py
oianson/genieparser
1
12798174
expected_output = { 'license_usage':{ 'C9300 48P DNA Advantage':{ 'entitlement':'C9300-48 DNA Advantage', 'count':'2', 'status':'AUTHORIZED' }, 'C9300 48P Network Adv...':{ 'entitlement':'C9300-48 Network Advan...', 'count':'2', 'status':'AUTHOR...
1.53125
2
src/multi_SIR.py
suryadheeshjith/episimmer
0
12798175
<reponame>suryadheeshjith/episimmer import sys import ReadFile import pickle import World import importlib.util import os.path as osp import policy_generator as pg import matplotlib import matplotlib.pyplot as plt matplotlib.use("pgf") matplotlib.rcParams.update({ "pgf.texsystem": "pdflatex", 'font.family': 's...
2.09375
2
pagi_api.py
RAIRLab/PAGIapi-python
0
12798176
<reponame>RAIRLab/PAGIapi-python<gh_stars>0 """ Python PAGIworld API """ __author__ = "<NAME>" __copyright__ = "Copyright 2015, RAIR Lab" __credits__ = ["<NAME>"] __license__ = "MIT" import math import os import socket import time ERROR_CHECK = True VALID_COMMANDS = ["sensorRequest", "addForce", "loadTask", "print",...
2.28125
2
code_python/Easy_Run.py
pinxau1000/Computer-Vision
0
12798177
<filename>code_python/Easy_Run.py import subprocess import sys _PYTHON_INTERPRETER = sys.executable _CURRENT_DIRECTORY = sys.path[0] _opt = "" while _opt != '0': print("---------------- MAIN MENU ----------------") print("1 - Noise Removal") print("2 - Edge Extraction") print("3 - Corner Detection") ...
3.140625
3
ped.py
rchui/Stat530
0
12798178
import csv import sys csv.field_size_limit(sys.maxsize) """Reads in data passed by the user from a CSV file.""" count = 0 fileName = sys.argv[1] csvArray = {} with open(fileName) as csvFile: reader = csv.reader(csvFile) for row in reader: row.pop() if count != 0: readRow = [i for i in row] csvArray[readRo...
3.296875
3
rss-feeds.py
jimit105/rss-feeds-articles
1
12798179
<reponame>jimit105/rss-feeds-articles<gh_stars>1-10 # -*- coding: utf-8 -*- """ @author: Jimit.Dholakia """ from datetime import datetime, timedelta import time import os import itertools import feedparser import urllib.parse import dateutil.parser import signal import sys os.environ['TZ'] = 'Asia/Kolkata' if os.name...
1.726563
2
test_project_2/demo/models.py
Munduruca/django
0
12798180
<reponame>Munduruca/django from django.db import models class Book(models.Model): title = models.CharField(max_length=36, unique=True) description = models.TextField(max_length=256, default=None)
2.609375
3
homeassistant/components/laundrify/__init__.py
liangleslie/core
30,023
12798181
"""The laundrify integration.""" from __future__ import annotations from laundrify_aio import LaundrifyAPI from laundrify_aio.exceptions import ApiConnectionException, UnauthorizedException from homeassistant.config_entries import ConfigEntry from homeassistant.const import CONF_ACCESS_TOKEN, Platform from homeassist...
2.15625
2
swexpert/d3/sw_3499.py
ruslanlvivsky/python-algorithm
3
12798182
<gh_stars>1-10 test_cases = int(input()) for t in range(1, test_cases + 1): n = int(input()) cards = list(input().split()) deck = [] if len(cards) % 2 == 0: mid = len(cards) // 2 for i in range(mid): deck.append(cards[i]) deck.append(cards[i + mid]) else: ...
3.171875
3
helloworld-tls/src/app/__init__.py
JeNeSuisPasDave/Selenium-and-TLS
2
12798183
# Copyright 2017 <NAME> # # Licensed under the MIT License. If the LICENSE file is missing, you # can find the MIT license terms here: https://opensource.org/licenses/MIT from flask import Flask, render_template from config import config def create_app(config_name): app = Flask(__name__) app.config.from_objec...
1.992188
2
lux_ai/lux_gym/reward_spaces.py
mrzhuzhe/Kaggle_Lux_AI_2021
44
12798184
from abc import ABC, abstractmethod import copy import logging import numpy as np from scipy.stats import rankdata from typing import Dict, NamedTuple, NoReturn, Tuple from ..lux.game import Game from ..lux.game_constants import GAME_CONSTANTS from ..lux.game_objects import Player def count_city_tiles(game_state: Ga...
2.46875
2
A2/Q3.py
Vasily-Piccone/ECSE543-NumericalMethods
0
12798185
import numpy as np import matplotlib.pyplot as plt # To use LaTeX in the plots plt.rcParams.update({ "text.usetex": True, "font.family": "sans-serif", "font.sans-serif": ["Helvetica"]}) # for Palatino and other serif fonts use: plt.rcParams.update({ "text.usetex": True, "font.family": "serif", ...
3.015625
3
sdks/blue-krill/tests/storages/conftest.py
alex-smile/bkpaas-python-sdk
17
12798186
<gh_stars>10-100 # -*- coding: utf-8 -*- """ * TencentBlueKing is pleased to support the open source community by making 蓝鲸智云-蓝鲸 PaaS 平台(BlueKing-PaaS) available. * Copyright (C) 2017-2021 TH<NAME>, a Tencent company. All rights reserved. * Licensed under the MIT License (the "License"); you may not use this file ex...
1.984375
2
hackerhub/urls.py
jason17h/hackerhub
0
12798187
from django.urls import path from hackerhub import views app_name = 'hackerhub' urlpatterns = [ # path('hackathons/', views.hackathonList, name='hackathonList'), ]
1.476563
1
MPIderivHelperFuncs.py
Carlson-J/energy-transfer-analysis
1
12798188
<gh_stars>1-10 import numpy as np import FFTHelperFuncs def MPIderiv2(comm,var,dim): """Returns first derivative (2-point central finite difference) of a 3-dimensional, real space, uniform grid (with L = 1) variable. Assumes that the field is split on axis 0 between processes. Args: c...
2.5
2
numpy_practice.py
MiroGasparek/python_intro
0
12798189
<reponame>MiroGasparek/python_intro # 21 February 2018 <NAME> # Practice with NumPy import numpy as np # Practice 1 # Generate array of 0 to 10 my_ar1 = np.arange(0,11,dtype='float') print(my_ar1) my_ar2 = np.linspace(0,10,11,dtype='float') print(my_ar2) # Practice 2 # Load in data xa_high = np.loadtxt('data/xa_hig...
4.46875
4
core/Sessions/sessions.py
ctg-group/scky
0
12798190
<filename>core/Sessions/sessions.py import pickle import os from .Connection import * class Session: def __init__(self, display_name, conn): self.display_name = display_name self.conn = conn self.id = conn.id def load_sessions(): if os.path.exists('.sessions') and os.path.isfile('.sessi...
2.953125
3
examples/dialogs1.py
akloster/blender-asyncio
54
12798191
import bpy import asyncio from asyncio import Task, coroutine, sleep import blender_async class TestDialog(blender_async.dialogs.AsyncDialog): my_float = bpy.props.FloatProperty(name="Some Floating Point") my_bool = bpy.props.BoolProperty(name="Toggle Option") my_string = bpy.props.StringProperty(name="S...
2.6875
3
Bank_loan_project/code.py
NehaBhojani/ga-learner-dsmp-repo
0
12798192
# -------------- # Import packages import numpy as np import pandas as pd from scipy.stats import mode bank = pd.read_csv(path) categorical_var = bank.select_dtypes(include='object') print(categorical_var) numerical_var = bank.select_dtypes(include='number') print(numerical_var) # code starts here # code end...
2.8125
3
03_01_dice.py
bolivaralejandro/prog_pi_ed2-
0
12798193
#03_01_dice import random # import random module for x in range(1,11): # for loop to go from 1 -10 random_number = random.randint(1, 6) # ranint pick between 1 and 6 print(random_number) # print the # that was saved to variable random_number
3.71875
4
TPP/API/top_pro_pack.py
Buddyboy201/top_pro_pack-v3
0
12798194
<reponame>Buddyboy201/top_pro_pack-v3 import os import sys import sqlalchemy from pathlib import Path from TPP.API.centroid_protein import CentroidProtein import json from shutil import copyfile from time import perf_counter def get_config(name, pdb_path, json_path, exclude_backbone, distance_cutoff, ignored_paths): ...
2.078125
2
src/task_runner/tests/test_api.py
tessia-project/tessia-mesh
0
12798195
<gh_stars>0 # Copyright 2021 IBM Corp. # # 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 in ...
1.984375
2
tap/parser.py
cans/tappy-pkg
0
12798196
<reponame>cans/tappy-pkg # Copyright (c) 2015, <NAME> import re from tap.directive import Directive from tap.line import Bail, Diagnostic, Plan, Result, Unknown, Version class Parser(object): """A parser for TAP files and lines.""" # ok and not ok share most of the same characteristics. result_base = r...
2.796875
3
solutions/python3/811.py
sm2774us/amazon_interview_prep_2021
42
12798197
<filename>solutions/python3/811.py<gh_stars>10-100 class Solution: def subdomainVisits(self, cpdomains): counter = collections.Counter() for cpdomain in cpdomains: count, *domains = cpdomain.replace(" ",".").split(".") for i in range(len(domains)): counter["."...
3.21875
3
directorio de trabajo/Jorge/convertirGeodata/convertir_geodata.py
felinblackcat/Trabajo1TAE2020
0
12798198
# -*- coding: utf-8 -*- """ Created on Tue Nov 17 23:03:32 2020 @author: quipo """ import pandas as pd import numpy as np import re from unidecode import unidecode def diccionario_quitar_tildes(col): return {col: {'á': 'a', 'Á': 'A','é': 'e', 'É': 'E','í': 'i', 'Í': 'I','ó': 'o', 'Ó': 'O','ú': 'u', 'Ú': 'U'}} dat...
2.59375
3
tests/BaseTest.py
connor9/python-draytonwiser-api
7
12798199
<gh_stars>1-10 import os import unittest import logging #logging.basicConfig(level=logging.INFO) class BaseTest(unittest.TestCase): def setUp(self): self.wiser_hub_ip = '192.168.1.171' self.base_url = url = "http://{}/data/domain/".format(self.wiser_hub_ip) self.token = "<PASSWORD>" ...
2.609375
3
getimage.py
junerye/test
5
12798200
#!/usr/local/bin/python3 #encoding:utf8 ''' 作用:爬取京东商城手机分类下的的所有手机商品的展示图片。 url:为需要爬取的网址 page:页数 ''' import re import urllib.request def getimage(url, page): html = urllib.request.urlopen(url).read(); html = str(html); pattern1 = '<div id="plist".+? <div class="page clearfix">'; ...
3.28125
3
DBSHA256/catalog/urls.py
darketmaster/DBSHA256
1
12798201
<gh_stars>1-10 from django.urls import path from . import views urlpatterns = [ path("", views.home, name="home"), #path("<name>", views.mainPage, name="main"), path("about/", views.about, name="about"), #path("contact/", views.contact, name="contact"), path("home/", views.home, name="main"), p...
1.90625
2
app/server.py
LlamaComedian/personal-cw-proto
0
12798202
import os import json from flask import Flask, render_template from flask.ext.assets import Environment app = Flask(__name__) app.debug = True # govuk_template asset path @app.context_processor def asset_path_context_processor(): return { 'asset_path': '/static/govuk-template/', 'prototypes_asset_path': '/...
2.5
2
tools/read_test_results.py
VirgiAgl/updated_AutoGP
0
12798203
<gh_stars>0 '''Directly copied from MMD case''' from numpy import sqrt import os from pickle import load import sys os.chdir(sys.argv[1]) load_filename = "results.bin" load_f = open(load_filename,"r") [counter, numTrials, param, average_time, pvalues] = load(load_f) load_f.close() rate = counter/float(numTrials) std...
2.328125
2
help/migrations/0004_article_faq_article_order_articlecategory_order_and_more.py
AppointmentGuru/kb
0
12798204
<filename>help/migrations/0004_article_faq_article_order_articlecategory_order_and_more.py # Generated by Django 4.0.1 on 2022-02-01 17:49 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('help', '0003_article_categories_articlecategory'), ] oper...
1.59375
2
Day_00/01_Basics/temperature.py
saudijack/unfpyboot
0
12798205
<reponame>saudijack/unfpyboot<gh_stars>0 faren = raw_input("Enter the temperature in Fahrenheit): ") faren = float(faren) # The calculation on the right gets saved to the variable on the left cel = 5./9. * (faren - 32.) print "The temperature in Celcius is " + str(cel) + " degrees."
3.65625
4
app/submission/urls.py
PICT-ACM-Student-Chapter/OJ_API
2
12798206
<reponame>PICT-ACM-Student-Chapter/OJ_API<filename>app/submission/urls.py from django.urls import path from .views import Run, CheckRunStatus, CallbackRunNow, \ CallbackSubmission urlpatterns = [ path('run', Run.as_view()), path('run/<int:id>', CheckRunStatus.as_view()), path('callback/run/<int:sub_id...
1.820313
2
poolink_backend/apps/board/migrations/0001_initial.py
jaethewiederholen/Poolink_backend
0
12798207
<reponame>jaethewiederholen/Poolink_backend<gh_stars>0 # Generated by Django 3.1.12 on 2021-06-24 15:23 from django.conf import settings from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): initial = True dependencies = [ migrations.swappa...
1.78125
2
inferlo/base/graph_model.py
InferLO/inferlo
1
12798208
<filename>inferlo/base/graph_model.py<gh_stars>1-10 # Copyright (c) 2020, The InferLO authors. All rights reserved. # Licensed under the Apache License, Version 2.0 - see LICENSE file. from __future__ import annotations import abc import itertools from typing import TYPE_CHECKING, Iterable, Tuple, Dict, List import n...
2.53125
3
game/version1/main.py
aniknagato/Balloon-Blaster-Mace-Ball
0
12798209
# need better design import pyglet import resources import random import math from pyglet.window import key score = 0 game_window = pyglet.window.Window() pyglet.resource.path = ['./resources'] pyglet.resource.reindex() ast_img = pyglet.resource.image("player.png") def distance(point_1=(0, 0), point_2=(0, 0)): ""...
3.09375
3
Files/add_edit_delete_share.py
SlaveForGluten/MyWallet
0
12798210
<filename>Files/add_edit_delete_share.py import tkinter as tk from tkinter import messagebox from Files import (shares_page, manage_db, calculate, scrap_web) FONT = "Calabria 12" def add_shares(parent): """allows you to add share""" def save(): if(manage_db.check_if_valid_name(name.get()) and ...
3
3
Codewars/IpValidation.py
SelvorWhim/competitive
0
12798211
<reponame>SelvorWhim/competitive<gh_stars>0 def is_valid_octet(n_str): return n_str.isdigit() and (n_str[0] != '0' or n_str == '0') and int(n_str) <= 255 # isdigit also returns false for empty strings and negatives def is_valid_IP(str): nums = str.split('.') return (len(nums) == 4) and all(is_valid_octet(n...
3.125
3
rial/util/util.py
L3tum/RIAL
2
12798212
import hashlib import random import string from llvmlite.ir import Context def generate_random_name(count: int): return ''.join(random.choices(string.ascii_uppercase + string.ascii_lowercase + string.digits, k=count)) def rreplace(s, old, new, occurrence=-1): li = s.rsplit(old, occurrence) return new.j...
2.5
2
swmmnetwork/convert.py
austinorr/swmmnetwork
9
12798213
<reponame>austinorr/swmmnetwork<filename>swmmnetwork/convert.py<gh_stars>1-10 import pandas import networkx as nx import hymo from .util import _upper_case_column, _validate_hymo_inp from .compat import from_pandas_edgelist, set_node_attributes SWMM_LINK_TYPES = [ 'weirs', 'orifices', 'conduits', '...
2.234375
2
tlh/data/rom.py
notyourav/the-little-hat
0
12798214
from typing import Optional from tlh.const import RomVariant from tlh import settings class Rom: def __init__(self, filename: str): with open(filename, 'rb') as rom: self.bytes = bytearray(rom.read()) def get_bytes(self, from_index: int, to_index: int) -> bytearray: # TODO apply c...
2.578125
3
accounts/forms.py
xNovax/RoomScout
24
12798215
<filename>accounts/forms.py<gh_stars>10-100 from captcha.fields import ReCaptchaField from captcha.widgets import ReCaptchaV3 from django import forms class AllauthSignupForm(forms.Form): captcha = ReCaptchaField(widget=ReCaptchaV3, label='') field_order = ['email', 'password1', 'password2', 'captcha'] d...
2.53125
3
linuxOperation/app/security/views.py
zhouli121018/core
0
12798216
# -*- coding: utf-8 -*- from __future__ import unicode_literals import re import copy # import os import json # import ConfigParser from django.shortcuts import render from django.http import HttpResponseRedirect, HttpResponse, Http404 from django.core.urlresolvers import reverse from django.contrib import messages fro...
1.820313
2
clai/server/plugins/helpme/helpme.py
cohmoti/clai
391
12798217
# # Copyright (C) 2020 IBM. All Rights Reserved. # # See LICENSE.txt file in the root directory # of this source tree for licensing information. # import os from pathlib import Path from clai.tools.colorize_console import Colorize from clai.server.searchlib.data import Datastore from clai.server.agent import Agent f...
2.03125
2
cli/src/orchestrate/main.py
muskanmahajan37/solutions-cloud-orchestrate
17
12798218
<reponame>muskanmahajan37/solutions-cloud-orchestrate # python3 # Copyright 2020 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 of the License at # # https://www.apache.org/licenses/LICENSE-2.0...
2.109375
2
Terry_toolkit/SearchBaidu.py
napoler/Terry-toolkit
0
12798219
<reponame>napoler/Terry-toolkit<filename>Terry_toolkit/SearchBaidu.py from MagicBaidu import MagicBaidu import pprint class SearchBaidu: """SearchBaidu 百度搜索结果抓取 使用https://github.com/napoler/MagicBaidu """ def __init__(self): print('kaishi') # self.text = text # self.salary...
2.984375
3
dentcam/mainwin.py
molkoback/dentcam
0
12798220
from .app import data_path from .optionswin import OptionsWin from .camera import Camera, CameraControl, getCameraDevices from .camlabel import CamLabel from PyQt5.QtCore import pyqtSlot from PyQt5.QtGui import QImage, QIcon from PyQt5.QtWidgets import QApplication, QWidget, QMainWindow, QAction, QVBoxLayout, QHBoxLay...
2.140625
2
src/cython/test.py
chandnii7/ImageProcessing
3
12798221
<filename>src/cython/test.py import smoothing_convolution import numpy as np print(smoothing_convolution.apply_convolution(np.array([[1,1,1],[1,1,1],[1,1,1]]), np.array([[1,1,1],[1,1,1],[1,1,1]])))
2.328125
2
tensorflow1/basic-graph.py
Alwaysproblem/explore-ipu
0
12798222
<filename>tensorflow1/basic-graph.py import numpy as np from tensorflow.python.ipu.scopes import ipu_scope import tensorflow.compat.v1 as tf from tensorflow.python.ipu.config import IPUConfig tf.disable_v2_behavior() # Configure arguments for targeting the IPU cfg = IPUConfig() cfg.auto_select_ipus = 1 cfg.configure_...
3.140625
3
surro/util.py
MatthewScholefield/surro
0
12798223
import sys from os.path import join from threading import Timer import numpy as np from openal.audio import SoundSource assets_root = getattr(sys, '_MEIPASS', '.') def get_sfx(name): return join(assets_root, 'assets', name) def new_pt(*values): return np.array(values or (0, 0, 0), dtype=float) def vec_m...
2.28125
2
datatrans/fooddata/search/request.py
KooCook/datatrans
1
12798224
<reponame>KooCook/datatrans """ References: https://fdc.nal.usda.gov/api-guide.html#food-search-endpoint """ from typing import Dict, Union from datatrans import utils from datatrans.utils.classes import JSONEnum as Enum __all__ = ['FoodDataType', 'SortField', 'SortDirection', 'FoodSearchCriteria'] class Food...
2.703125
3
tensorflowQuantum/hackernoon/play.py
hpssjellis/tfQuantumJs
1
12798225
import cirq import numpy as np from cirq import Circuit from cirq.devices import GridQubit # creating circuit with 5 qubit length = 5 qubits = [cirq.GridQubit(i, j) for i in range(length) for j in range(length)] print(qubits) circuit = cirq.Circuit() H1 = cirq.H(qubits[0]) H2 = cirq.H(qubits[1]) H3 = cirq.H(qubits[...
2.609375
3
flybirds/utils/dsl_helper.py
LinuxSuRen/flybirds
1
12798226
<reponame>LinuxSuRen/flybirds<filename>flybirds/utils/dsl_helper.py # -*- coding: utf-8 -*- """ dsl helper """ import re import flybirds.utils.flybirds_log as log # generate result_dic def add_res_dic(dsl_params, functin_pattern, def_key): result_dic = {} match_obj = re.match(functin_pattern, dsl_params) ...
2.578125
3
solver.py
hahachicken/EA_Proj
0
12798227
import networkx as nx from parse import read_input_file, write_output_file from Utility import is_valid_network, average_pairwise_distance, average_pairwise_distance_fast import sys import time import multiprocessing def solve(G, depth): """ Args: G: networkx.Graph Returns: T: networkx.Gra...
2.9375
3
xastropy/cgm/core.py
bpholden/xastropy
3
12798228
<filename>xastropy/cgm/core.py """ #;+ #; NAME: #; cgm.core #; Version 1.0 #; #; PURPOSE: #; Module for core routines of CGM analysis #; 29-Nov-2014 by JXP #;- #;------------------------------------------------------------------------------ """ from __future__ import print_function, absolute_import, division,...
2.15625
2
courseevaluations/lib/async.py
rectory-school/rectory-apps
0
12798229
<reponame>rectory-school/rectory-apps<filename>courseevaluations/lib/async.py from courseevaluations.models import StudentEmailTemplate from academics.models import Student from django.core.mail import send_mail import time def send_student_email_from_template(template_id, student_id, override_email=None): time.sl...
2.203125
2
tests/test_dev_mode.py
adrienbrunet/mixt
27
12798230
# coding: mixt """Ensure that dev-mode can be toggled and does not validate data if off.""" from typing import Union import pytest from mixt.internal.base import Base from mixt.exceptions import InvalidPropChoiceError, InvalidPropBoolError, InvalidPropValueError from mixt.internal.proptypes import BasePropTypes as Pr...
1.835938
2
set_matrix_zeros.py
lutianming/leetcode
0
12798231
class Solution: # @param matrix, a list of lists of integers # RETURN NOTHING, MODIFY matrix IN PLACE. def setZeroes(self, matrix): x = len(matrix) if x > 0: y = len(matrix[0]) else: y = 0 rows = [1]*x cols = [1]*y for i in range(x): ...
3.59375
4
botforces/utils/discord_common.py
coniferousdyer/Botforces
0
12798232
""" Contains functions related to Discord-specific features, such as embeds. """ import discord import datetime import time from botforces.utils.constants import ( NUMBER_OF_ACS, USER_WEBSITE_URL, PROBLEM_WEBSITE_URL, ) from botforces.utils.services import enclose_tags_in_spoilers """ User embeds. """ ...
2.953125
3
tests/test_circuit/test_undriven_unused.py
leonardt/magma
167
12798233
""" Test the ability to ignore undriven inputs (useful for formal verification tools that use undriven inputs to mark wires that can take on any value) """ import pytest import magma as m from magma.testing import check_files_equal def test_ignore_unused_undriven_basic(): class Main(m.Circuit): _ignore_...
2.6875
3
ehlers_danlos_syndrome/snpedia.py
thehappydinoa/ehlers-danlos-syndrome
0
12798234
import re from typing import Optional, List, NamedTuple, Dict, Any import requests import bs4 GENO_REGEX = re.compile(r"\(.;.\)") DESC_STYLE = ( "border: 1px; background-color: #FFFFC0;" + "border-style: solid; margin:1em; width:90%;" ) class SNP: def __init__( self, rsid: str, table: Optional[...
2.625
3
src/optimizers.py
nunocclourenco/BAIcO
0
12798235
<filename>src/optimizers.py ''' This is the implentations of Simulated Annealing and NSGA-II used in the paper. Created on Nov, 2020 @author: <NAME> <<EMAIL>> NSGA - Adapted from https://github.com/ChengHust/NSGA-II Updated to handle constraint optimization and fast non-dominated sorting SA - Addapted from <NAME>'s...
2.984375
3
Programs/Chapter8-programs/python/unit_test_example/src/PairingBasisGenerated.py
cpmoca/LectureNotesPhysics
24
12798236
class PairingBasisGen: def generateFermi(self): for i in range(0,self.nParticles): self.below_fermi.append(i) for j in range(self.nParticles, self.nSpStates): self.above_fermi.append(j) def generateStates(self): for sp in range(0,self.nSpStates/2): se...
2.78125
3
driving.py
julianx4/skippycar
5
12798237
import time import math as m import redis import struct import numpy as np from adafruit_servokit import ServoKit r = redis.Redis(host='localhost', port=6379, db=0) kit = ServoKit(channels=16) #controllable variables def rget_and_float(name, default = None): output = r.get(name) if output == None: ret...
2.734375
3
02-make_figures.py
kochanczyk/covid19-pareto
1
12798238
#!/usr/bin/env python3 #pylint: disable = C, R #pylint: disable = E1101 # no-member (generated-members) #pylint: disable = C0302 # too-many-lines """ This code features the article "Pareto-based evaluation of national responses to COVID-19 pandemic shows that saving lives and protecting economy are non-trade-o...
1.726563
2
website/src/contact_form/models.py
iamcholo/videoplatform
0
12798239
from django.db import models from django.utils.translation import ugettext_lazy as _ from utilities.models import BaseDateTime class Contact(BaseDateTime): title = models.CharField( _('TITLE_LABEL'), max_length=255 ) name = models.CharField( _('NAME_L...
2.234375
2
danlp/datasets/ddisco.py
alexandrainst/DaNLP
1
12798240
<gh_stars>1-10 import os import pandas as pd from danlp.download import DEFAULT_CACHE_DIR, download_dataset, _unzip_process_func, DATASETS class DDisco: """ Class for loading the DDisco dataset. The DDisco dataset is annotated for discourse coherence. It contains user-generated texts from Reddit and...
2.890625
3
test2/stalking/stalking.py
gr0mph/OceanOfCode
0
12798241
<filename>test2/stalking/stalking.py import sys sys.path.append('../../') # Global variables from test2.test_main import TREASURE_MAP # From OceanOfCode # Class from OceanOfCode import StalkAndLegal from OceanOfCode import StalkAndTorpedo from OceanOfCode import Submarine from OceanOfCode import Board # Global from ...
2.890625
3
segme/backbone/port/big_transfer/tests/test_applications_predict.py
shkarupa-alex/segme
2
12798242
import numpy as np from absl.testing import parameterized from keras.preprocessing import image from keras.utils import data_utils from tensorflow.python.platform import test from ..bit import BiT_S_R50x1, BiT_S_R50x3, BiT_S_R101x1, BiT_S_R101x3, BiT_S_R152x4 from ..bit import BiT_M_R50x1, BiT_M_R50x3, BiT_M_R101x1, Bi...
2.421875
2
nnunet/inference/validate_nifti_folder.py
PawelPeczek/Abdomen-CT-Image-Segmentation
15
12798243
<reponame>PawelPeczek/Abdomen-CT-Image-Segmentation from batchgenerators.utilities.file_and_folder_operations import * from nnunet.evaluation.evaluator import aggregate_scores def validate(folder, gt_folder): patient_ids = subfiles(folder, suffix=".nii.gz", join=False) pred_gt_tuples = [] for p in patie...
2.34375
2
movement/test_steering.py
pwoosam/JaloPy
0
12798244
#!/usr/bin/env python3 from Adafruit_PCA9685 import PCA9685 import time pwm = PCA9685() servo_min = 250 servo_max = 450 pulse = servo_min increasing = True step_size = 1 while True: pwm.set_pwm(0, 0, pulse) if pulse < servo_max and increasing: pulse += step_size increasing = True elif pul...
3.21875
3
drones/app/routers/__init__.py
codeshard/drones-api
0
12798245
from .deliveries import * # noqa from .drones import * # noqa from .medications import * # noqa
1.046875
1
tests/test_sockets.py
initbar/SIPd
1
12798246
# MIT License # # Copyright (c) 2018 <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 # to use, copy, modify, merge, publi...
2
2
Indian Sign Language Recognation For Static and Dynamic Gestures/ISL-CNN-Model.py
itsjaysuthar/Projetcts
0
12798247
<filename>Indian Sign Language Recognation For Static and Dynamic Gestures/ISL-CNN-Model.py # Importing all the libraries from keras.models import Sequential from keras.layers import Conv2D, MaxPooling2D, Flatten, Dense, Dropout # Initialising the CNN classifier = Sequential() # Step 1 - Convolution classifier.add(Co...
2.640625
3
Hackerearth Set/TheOldMonk.py
Siddharth2016/PYTHON3_prog
2
12798248
<gh_stars>1-10 # THE OLD MONK for _ in range(int(input())): N = int(input()) A = [int(a) for a in input().split()] B = [int(a) for a in input().split()] res = 0 mx = 0 for i in range(N): for j in range(i,N,1): if A[i]>B[j]: break res = j-i ...
2.828125
3
payment/tests/integ/test_api.py
Al-bambino/aws-serverless-ecommerce-platform
758
12798249
<filename>payment/tests/integ/test_api.py import uuid import pytest import requests from fixtures import iam_auth # pylint: disable=import-error from helpers import get_parameter # pylint: disable=import-error,no-name-in-module @pytest.fixture(scope="module") def payment_3p_api_url(): return get_parameter("/ecomm...
2.28125
2
e2xgrader/tests/utils/test_extra_cells.py
divindevaiah/e2xgrader
2
12798250
<filename>e2xgrader/tests/utils/test_extra_cells.py import nbformat import unittest from e2xgrader.models import PresetModel from e2xgrader.utils.extra_cells import ( is_extra_cell, is_multiplechoice, is_singlechoice, get_choices, get_num_of_choices, clear_choices, has_solution, ) from ..te...
2.515625
3