seq_id
stringlengths
4
11
text
stringlengths
113
2.92M
repo_name
stringlengths
4
125
sub_path
stringlengths
3
214
file_name
stringlengths
3
160
file_ext
stringclasses
18 values
file_size_in_byte
int64
113
2.92M
program_lang
stringclasses
1 value
lang
stringclasses
93 values
doc_type
stringclasses
1 value
stars
int64
0
179k
dataset
stringclasses
3 values
pt
stringclasses
78 values
17057244494
#!/usr/bin/env python # -*- coding: utf-8 -*- import json from alipay.aop.api.constant.ParamConstants import * class OpenIdConfigRequestExt(object): def __init__(self): self._biz_id = None self._biz_type = None self._cal_type = None self._execute_mode = None self._gray_mo...
alipay/alipay-sdk-python-all
alipay/aop/api/domain/OpenIdConfigRequestExt.py
OpenIdConfigRequestExt.py
py
4,187
python
en
code
241
github-code
13
43262791312
def main(): ans = X for _ in range(K): ans, mod = divmod(ans, 10) if mod > 4: ans += 1 return print(ans * 10**K) if __name__ == '__main__': X, K = map(int, input().split()) main()
Shirohi-git/AtCoder
abc271-/abc273_b.py
abc273_b.py
py
231
python
en
code
2
github-code
13
39051725437
#!/usr/bin/python3 # -*- coding: utf-8 -*- """ Created on: 2019-01-02 @author: Byng Zeng """ from tkinter import * from tkinter.filedialog import askdirectory, askopenfilename class WebImageCrawlerWindow(object): HELP_MENU = ( '==================================', ' Template help', '=...
SanniZ/python
tk/webcrawler.py
webcrawler.py
py
5,397
python
en
code
0
github-code
13
16388480711
import re from datetime import datetime from sqlalchemy import Column, Integer, String, DateTime, Boolean, Date, ForeignKey, Double from sqlalchemy.ext.declarative import as_declarative from sqlalchemy.orm import relationship, backref, declared_attr # Example : One to One Relationship # class Parent(Base): # __ta...
dongbin98/popple-fastapi
src/models.py
models.py
py
4,286
python
en
code
0
github-code
13
36069672222
import os import re from collections import defaultdict dct = defaultdict(dict) def listfiles(folder): for root, folders, files in os.walk(folder): for filename in folders + files: if filename.endswith(".py"): yield os.path.join(root, filename) def read_file(path): with ...
msgoff/Python_Scripts
walk.py
walk.py
py
2,946
python
en
code
0
github-code
13
5261669810
def sum_of_num(numb_array): res = 0 for numbers in numb_array: res += float(numbers) return res def extract_numbers(numb_array, degree): numbers = [] unknown = [] i = 0 while (i < len(numb_array)): if numb_array[i] == '-' or numb_array[i] == '+' or (i == 0 and (numb_array[i:].find('-') > numb_array[i:].fi...
Ethma/ComputorV1
utils.py
utils.py
py
4,198
python
en
code
0
github-code
13
14738119981
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*- import os import math import numpy as np #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~# # Parameters #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~# MAX_CHILD_CNT = 1500 # the max number of children in the file system arborescence NAMEL...
DCEN-tech/Mushroom_Py-cture_Recognition
src/lib/datasource/image/path.py
path.py
py
3,732
python
en
code
0
github-code
13
70166114259
"""Script to update all game logs by year.""" import sys import requests from classes.database import Database from functions.new_game_logs import new_game_logs from functions.check_duplicate_game_logs import check_duplicate_game_logs BASE_URL = "http://lookup-service-prod.mlb.com/lookup/json/" GAME_LOG_EXT = ( "n...
jarrett-pon/mlbscrapper
insert_game_logs_by_year.py
insert_game_logs_by_year.py
py
7,140
python
en
code
0
github-code
13
73042605779
# -*- coding: utf-8 -*- # @Time : 2021/9/26 10:46 # @Author : kanghe # @Email : 244783726@qq.com # @File : test_title.py import allure import pytest params = [ ("tom", "en name"), ("张三", "zh name") ] # 可以读取参数化中的变量作为用例标题 @allure.title("{title}") @pytest.mark.parametrize("name, title", params) def tes...
dengfan2018/python-api-testing
testcase/pytest_learn/test_title.py
test_title.py
py
420
python
en
code
0
github-code
13
2929369785
#!/usr/bin/env python # -*- encoding: utf-8 -*- __NAME__ = 'Griffin Lim Algorithm' import scipy import shutil import numpy as np import librosa from librosa import display from optparse import OptionParser from matplotlib import pyplot as plt def griffin_lim(stftm_matrix, shape, min_iter=20, max_iter=50, delta=20): ...
aishoot/Audio_Signal_Processing
05-GriffinLim/GriffinLim_example.py
GriffinLim_example.py
py
2,606
python
en
code
52
github-code
13
73147672017
from tkinter import * class SoftwareActivationWindow(Tk): def __init__(self, software_activation_function): # Copy over functions needed for operation self.software_activation = software_activation_function # Create window self.instantiate_window() # ...
AndreiCravtov/python-software-activation-wrapper
src/client/activategui.py
activategui.py
py
3,361
python
en
code
0
github-code
13
27180238856
from sqlalchemy.orm import Session from models.client import Place def load_menu(db: Session, place_id: int, username ): place = db.query(Place).get(place_id) return {"username": username, "place": place.name, "menus": place.menus}
ah00ee/kiosk-fastapi
apis/kiosk/menu/menu_crud.py
menu_crud.py
py
281
python
en
code
0
github-code
13
27730602193
#!/usr/bin/env python # -*- coding: utf-8 -*- import os import numpy as np from PIL import Image from torch.utils.data import Dataset class FACES(Dataset): def __init__(self, dataset_path, tv_transforms, partition): super().__init__() self.dataset_path = dataset_path self.partition = par...
geriskenderi/mtl-models
data/faces.py
faces.py
py
2,599
python
en
code
3
github-code
13
29278062256
#Programmer: Collin M. Fields #Date: 11/05/2018 #Purpose: Count the number of words in a text. def wordCounter(textToCountWords): wordCount = 0 textToBeCounted = textToCountWords.split(" ") for word in textToBeCounted: wordCount += 1 return wordCount
CollinFields/ProjectsWIP
TextProjects/wordCounter.py
wordCounter.py
py
259
python
en
code
0
github-code
13
32308960675
import os from .buf_app import WidgetBufferWithInputs, WidgetList, TextWidget, SimpleInput, WidgetBuffer, BufferHistory, MultiSelectWidget from .func_register import vim_register from .vim_utils import SetVimRegister, Normal_GI, Singleton, input_no_throw, escape, win_eval import vim from functools import partial from ....
2742195759/xkvim
xiongkun/plugin/pythonx/Xiongkun/buf_app_git_committer.py
buf_app_git_committer.py
py
6,565
python
en
code
2
github-code
13
36480723056
from mmcv.ops import diff_iou_rotated_2d import torch if __name__ == '__main__': pred = torch.tensor([[40.0, 50, 20, 20, 0.8], \ [40.0, 50, 20, 20, 1], \ [40.0, 50, 20, 20, 0.7]]).to('cuda:0') gt = torch.tensor([[40.0, 50, 20, 20, 1], \ ...
liangkaiwen159/icann_dino_detr
test_rotate.py
test_rotate.py
py
708
python
en
code
0
github-code
13
21264428616
from collections import deque class Node: def __init__(self, val: int = 0, left: 'Node' = None, right: 'Node' = None, next: 'Node' = None): self.val = val self.left = left self.right = right self.next = next class Solution: def connectAllSiblings(self, root): queue =...
sundaycat/Leetcode-Practice
solution/connect-all-level-order-siblings.py
connect-all-level-order-siblings.py
py
850
python
en
code
0
github-code
13
12605275472
import math #CONSTANTES DO SISTEMA RaioTerra = 6378.173 #Raio da terra em Km CentroMassa = 42158 #Centro de massa em Km velocidadeLuz = 300000000 #velocidade da luz #-- 1º LOCALIZAÇÃO DAS ESTAÇÕES nomeEstacaoA = input('Nome da localização da estaçao terrena - ') #-- 1.1º Latitudes e longitudes das estações latitudeE...
PauloTec/link-sat-lite-em-Python
distancia estacao terrena satelite.py
distancia estacao terrena satelite.py
py
2,502
python
pt
code
0
github-code
13
26073699474
import os, glob, sys import numpy as np import matplotlib.pyplot as plt def limiter(a,b): return minmod(a,b) # more diffusive # return superbee(a,b) # less diffusive # return vanLeer(a,b) # return vanAlbada1(a,b) def superbee(a,b): return maxmod(minmod(a,2.*b),minmod(2.*a,b)) def maxmod(a,b): return 0...
benjym/poly-mpm
new_integrator.py
new_integrator.py
py
5,742
python
en
code
13
github-code
13
38715618003
# Program to detect multiple alternatives in a class import re def parse(text, components): print('RE: TEXT', text) # Convert all component names to lower case for i in range(len(components)): components[i] = components[i].lower() # Stores the final output in string format outp...
vyshnavkarunonYT/ai-based-flight-debriefing
src/utils/regparser.py
regparser.py
py
3,471
python
en
code
0
github-code
13
39068911930
from django.conf.urls import patterns, include, url from .views import index, db urlpatterns = patterns('', url(r'^db/(\w+)/', db, name='translate_db'), url(r'^pofile/$', 'rosetta.views.home', name='rosetta-home'), url(r'^$', index, name='translate_index'), url(r'^download/$', 'rosetta.views.download_f...
TechnoServe/SMSBookkeeping
tns_glass/translate/urls.py
urls.py
py
476
python
en
code
0
github-code
13
24600362260
from spack import * import os class Castep(MakefilePackage): """ CASTEP is a leading code for calculating the properties of materials from first principles. """ homepage = "http://www.castep.org" url = "file://%s/CASTEP-21.11.tar.gz" % os.getcwd() licensed = True version('21.11', sha...
epfl-scitas/spack-repo-externals
packages/castep/package.py
package.py
py
1,235
python
en
code
3
github-code
13
27617479520
from os import listdir from os.path import join from werkzeug.utils import secure_filename from flask import jsonify from routes.detect_image import detect_image import json #--Methods-- def listmodels(): models_list = [m for m in listdir('./static/models')] response = jsonify(models_list) return response ...
gianmartind/Skripsi-6181801015
Lampiran/app.py
app.py
py
1,025
python
en
code
0
github-code
13
33038329966
''' N개의 숫자로 이루어진 수열 맨 앞의 숫자를 맨뒤로 보내는 작업을 M번했을 때 수열의 맨 앞에 있는 숫자는? ''' def order(lst, M): for _ in range(M): lst.append(lst.pop(0)) return lst[0] import sys sys.stdin = open('input.txt', 'r') T=int(input()) for test_case in range(1,T+1): N, M = map(int, input().split()) lst = list(map(int,...
Seobway23/Laptop
Algorithm/february_class/0220/회전.py
회전.py
py
467
python
ko
code
0
github-code
13
38058590890
"""Aliqout Number The aliquot of a number is defined as the sum of the proper divisors of a number. Example - 1: aliquot of 15 = 1 + 3 + 5 = 9 Example - 2: aliquot of 30 = 1 + 2 + 3 + 5 + 6 + 10 + 15 = 42 Note : aliquot of any prime is 1. Write a function that determines the aliquot of a given number. """ def ali...
unitinguncle/PythonPrograms
Aliqout Number.py
Aliqout Number.py
py
526
python
en
code
0
github-code
13
21578257551
import torch from torch import nn from torch.nn.parameter import Parameter class ECALayer(nn.Module): """Constructs a ECA module. Args: channel: Number of channels of the input feature map k_size: Adaptive selection of kernel size """ def __init__(self, channel, k_size=3): super...
cxgincsu/SemanticGuidedHumanMatting
model/attention.py
attention.py
py
2,071
python
en
code
160
github-code
13
7665157825
#written by Aceroni #aceroni.com import asyncio import os import discord from discord.ext import commands TOKEN = os.getenv('DISCORD_TOKEN') intents = discord.Intents.all() intents.members = True intents.presences = True bot = commands.Bot(command_prefix="!", intents=intents) class Ctf(commands.Cog): def __ini...
BSidesPDX/CTF-2022
misc/100-discordia/src/bot.py
bot.py
py
5,811
python
en
code
0
github-code
13
25102934966
from sense_hat import SenseHat sense = SenseHat() from time import sleep b=(0,0,0) w=(255,255,255) r=(255,0,0) g=(0,255,0) x=2 y=2 game_over = 0 board = [ [r,r,r,r,r,r,r,r], [r,b,b,b,b,b,b,r], [b,b,b,b,g,r,b,r], [b,r,r,b,r,r,b,r], [b,b,b,b,b,b,b,b], [b,r,b,r,r,b,b,b], [b,b,b,r,b,b,b,r], [r,r,b,b,b,r...
bleow/CZ1103-IntroToCS_Python
lab6.py
lab6.py
py
1,575
python
en
code
0
github-code
13
36941751198
# Caluculate the different ways of climbing the stairs, assuming this person can only climb 1 or 2 steps at a time # Solved by using recursion class Solution: def climbStairs(self, numStairs): return self.fib(numStairs + 1) def fib(self, n): fib = [] fib.insert(0, 0) fib.insert(1, 1) for i in range(2, n...
amandazhuyilan/Breakfast-Burrito
Problems-and-Solutions/python/climbingStairs.py
climbingStairs.py
py
726
python
en
code
3
github-code
13
69806485777
import threading import ELYZA_res #import LINE_res #import rinna_res #import rinna_gptq_res import talk import time from datetime import datetime, timedelta ### for speach recognition import speech_recognition as sr ### for julius import socket import re import vosk_streaming SPEECH_RECOGNITION_GOOGLE = 0 SPEECH_RECOG...
fernangit/win_py_Greeting
LLM_chat.py
LLM_chat.py
py
4,630
python
en
code
0
github-code
13
10176748855
import sys #recipe = { "ingredients": [], "meal": "", "prep_time": } Sandwich = { "ingredients" : ["ham", "bread", "cheese", "tomatoes"], "meal" : "lunch", "prep_time" : 10} Cake = { "ingredients" : ["flour", "sugar", "eggs"], "meal" : "dessert", "prep_time" : 60} Salad = { "ingredients" : ["avocado", "arugula", "toma...
jmcheon/python_module
00/ex06/recipe.py
recipe.py
py
3,949
python
en
code
0
github-code
13
24617965622
""" Test the redis interface for user and docs handling. """ import pytest import os from lib.data import Data from lib.ebook import write_epub config = { 'REDIS_HOST': 'localhost', 'REDIS_PORT': 6379, 'REDIS_DATABASE': 1, # <-- TESTING 'ADMIN_USER': 'admin', 'TIME_ZONE': 'Australia/Sydney', } ...
eukras/article-wiki
lib/test/test_ebook.py
test_ebook.py
py
649
python
en
code
0
github-code
13
17814465955
import re value = "3113322113" def describe(match): return str(len(match[0])) + match[1] def look_and_say(inp): sections = re.findall(r"((.)\2*)", inp) return "".join(map(describe, sections)) for x in range(0, 40): value = look_and_say(value) print(len(value)) for x in range(0, 10): value = l...
QuarkNerd/adventOfCode
2015/10.py
10.py
py
360
python
en
code
1
github-code
13
26589609195
#!/usr/bin/env python """Script to run before releasing a new version.""" import argparse import os import subprocess from rich.progress import Progress from project_stats import stats PROJECT_NAME = 'nori_ui' ROOT_DIR = os.path.dirname(os.path.abspath(__file__)) PROJECT_DIR = os.path.join(ROOT_DIR, PROJECT_NAME) D...
amorphousWaste/nori_ui
prerelease.py
prerelease.py
py
2,811
python
en
code
1
github-code
13
73389309778
import logging import sys import os from rubikscube import Cube, HalfTurnMetric import unittest import timeit class TestBenchMarkEnv(unittest.TestCase): def setUp(self): self.trials = int(1e7) self.log = logging.getLogger('BenchLogger') def test_turn_repr_solved(self): t_turn_repr_s...
h4rr9/rcube
train/tests/test_bench.py
test_bench.py
py
1,657
python
en
code
0
github-code
13
24997465360
#Модуль gemes # Демонстрирует сосдание модуля def ask_yes_no(question): """топрос да или нет""" response = None while response not in ("y", "n"): response = input(question + ' (y/n)? ').lower() return response # def ask_number(question, low, high): """Просит вести число и...
Timyr486786866745/black-jack
BJ/games.py
games.py
py
690
python
ru
code
0
github-code
13
3498097744
from django.shortcuts import render from .models import RestOpening , Resturant from rest_framework.decorators import api_view from datetime import datetime from django.views.decorators.csrf import csrf_exempt import re from .serializers import RestOpeningSerializer from rest_framework.views import APIView from rest_fr...
abdullahalsaidi16/resturant_opening_hours
api/views.py
views.py
py
3,908
python
en
code
0
github-code
13
23723605180
#!/usr/bin/env python3 import pdb, csv, os from datetime import datetime from PaySlip import PaySlip from CsvFile import CsvFile if __name__ == "__main__": src_field_names = ['First Name', 'Last Name', 'Annual Salary', 'Super Rate', 'Payment Start Date'] out_field_names = ['Name', 'Pay Period', 'Gross Income...
iascending/pay_slip
src/myob-exercise.py
myob-exercise.py
py
989
python
en
code
0
github-code
13
39660717314
# This code contains various helper functions used to process household survey data with pandas import pandas as pd import numpy as np import time import h5toDF import imp import scipy.stats as stats import math def round_add_percent(number): ''' Rounds a floating point number and adds a percent sign ''' if ...
psrc/travel-studies
2014/region/summary/scripts/helpers.py
helpers.py
py
4,203
python
en
code
5
github-code
13
31346876690
## program to find result of arithmatic operations ## using user defined functions +, -,*,/,%,** ## ##input : 2 numbers , opration ##output : Result depending on operation ##operation: functions, conditional stmts def add2(x,y): print("The sum is",x+y) def sub2(x,y): print("The Difference is",x-y) def mul2(...
bcshylesh/PythonPrograms
ArithmaticFunction.py
ArithmaticFunction.py
py
574
python
en
code
0
github-code
13
39476963410
#!/usr/bin/env python3 from jsread import jsread from settings import * import argparse import sys sys.path.append("../atp") from channel import Channel import socket import pyinotify import re import time from threading import Thread class SpeedOrder(Thread): # TODO : utiliser un mutex sur x et y, et utiliser u...
7Robot-Soft/jsbot
jsbot.py
jsbot.py
py
5,385
python
en
code
0
github-code
13
13103657254
# https://www.acmicpc.net/problem/1744 from sys import stdin from bisect import bisect_left, bisect_right input = stdin.readline N = int(input()) numbers = sorted([int(input()) for _ in range(N)]) ans = 0 has_zero = True if 0 in numbers else False has_one = True if 1 in numbers else False first_zero = bisect_left(num...
olwooz/algorithm-practice
practice/2022_08/220830_Baekjoon_1744_BindNumbers/220830_Baekjoon_1744_BindNumbers.py
220830_Baekjoon_1744_BindNumbers.py
py
881
python
en
code
0
github-code
13
43592727973
#!/usr/bin/python3 # -*- coding: utf-8 -*- # @Date : 2018-02-11 17:20:15 # @Author : fxb1rd (w1589534127@outlook.com) # @Link : http:// # @Version : $Id$ #只适用于有序列表 def binary_search(list,item): low = 0 high = len(list) - 1 while low<=high: mid = (low + high) guess = list[mid]#取得元素 ...
Fxb1rd/Algorithm_learning
Algorithm_diagram/二分查找.py
二分查找.py
py
625
python
en
code
0
github-code
13
9753665758
from main import Main import itertools # Hyperparameters BATCH = 32 EPOCH = 100 SEED = 5 VAL_RATIO = 0.1 EARLY_STOP = -1 REPORT = 'best' DEVICE = 'cuda' MODEL_PATH = '' slide_win = [20] dim = [64] slide_stride = [1] out_layer_num = [3] out_layer_inter_dim = [128] decay = [0] topk = [20] dataset = [ 'adasyn_1' ] ...
CKAbundant/Project
GDN/wrapper.py
wrapper.py
py
1,104
python
en
code
0
github-code
13
5125727784
# pypy import sys N = int(input()) matrixs : list = [] for i in range(N): matrixs.append(list(map(int, sys.stdin.readline().split()))) dp = [[0]*N for _ in range(N)] for i in range(1, N): for j in range(N-i): if i == 1: dp[j][j+i] = matrixs[j][0]*matrixs[j][1]*matrixs[j+1][1] c...
JeongHooon-Lee/ps_python_rust
2022_4/11049.py
11049.py
py
552
python
en
code
0
github-code
13
73875534097
import torch import torch.nn as nn from modules.view import View class Encoder(nn.Module): def __init__(self, latent_size: int): super().__init__() self.__sequential_blocks = [ nn.Flatten(start_dim=1), nn.Linear(28 * 28, 200), nn.ReLU(), ...
gmum/cwae-pytorch
src/architectures/mnist.py
mnist.py
py
1,515
python
en
code
6
github-code
13
43822384035
""" Save segment files to mongodb format: word_dict: { "word": "代驾", "length": 2, "pinyin": { "vowels": [ "ia", "ai" ], "tones": [ "4", "4" ...
tanx-code/levelup
howtorap/dictionaries/script_save_to_db.py
script_save_to_db.py
py
5,223
python
en
code
0
github-code
13
43360995144
from django.conf.urls import patterns, url from BandList import views urlpatterns = patterns('', (r'^$', views.base), (r'^shows/$', views.shows), (r'^bands/$', views.bands), (r'^register/$', views.register), url(r'home/$', views.home, name='home'), (r'^accounts/login/$', views.user_login), (r'^add/$', views....
Goldielocks/bander
BandList/urls.py
urls.py
py
358
python
en
code
0
github-code
13
17433034612
from datetime import time ,datetime, timedelta def check_time_interval(time1, time2): fmt = '%H:%M:%S' # get time interval between time1 and time2 as timedelta object time_interval = datetime.strptime(str(time1), fmt) - datetime.strptime(str(time2), fmt) return (time_interval >= timedelta(0)) class Menu: d...
bessilfie-nyame/basta-fazoolin
basta_fazoolin.py
basta_fazoolin.py
py
3,756
python
en
code
0
github-code
13
28326100947
from odoo import api, fields, models from odoo.tools.translate import html_translate class EventType(models.Model): _inherit = "event.type" description = fields.Html( string="Description", oldname="note", translate=html_translate, sanitize_attributes=False, readonly=Fa...
odoo-cae/odoo-addons-hr-incubator
hr_cae_event/models/event.py
event.py
py
3,049
python
en
code
0
github-code
13
2992872703
import requests API_VERSION = '5.131' def get_upload_url(token, group_id): """Получить адрес для загрузки фото""" params = { 'access_token': token, 'v': API_VERSION, 'group_id': group_id } response = requests.get( 'https://api.vk.com/method/photos.getWallUploadServer',...
dmitry-zharinov/xkcd-publisher
vk.py
vk.py
py
2,168
python
en
code
0
github-code
13
73130288019
import time # from bs4 import BeautifulSoup from tqdm import tqdm from definitions import NOVEL_URL, TAG_NAME from driver import driver from logger import log from scraper import collect_chapter_content def get_chapter_count(url=""): try: driver.get(url) book_name = url.removeprefix(NOVEL_URL + "/"...
tejasmr/ScrapeBoxnovel
chapters.py
chapters.py
py
1,150
python
en
code
0
github-code
13
1362264455
################################ # Program name: # Author: Tom Gill # Course: CWCT Python Essentials # Date: 9/16/2021 # Assignment: MOD01A1 Phone List # Purpose: Write a program that provides a menu-driven digital contact list to the user. The program should utilize a # file containing names, phone numbers (numb...
Gillt1/Python_Class
Python Class/M01A1_Phone_list/M01A1_Main.py
M01A1_Main.py
py
4,400
python
en
code
0
github-code
13
15390625407
import os import sys import _init_paths import torch import torch.nn as nn import torchvision import torchvision.transforms as transforms import torchvision.datasets as datasets from vit_pytorch_loc.vit_pytorch import ViT from utils.utils import set_gpu, seed_all, _pil_interp, load_partial_weight from tqdm import tq...
Sebastian-X/vit-pytorch-with-pretrained-weights
tools/cifar10_finetune.py
cifar10_finetune.py
py
10,283
python
en
code
5
github-code
13
42596553634
import configparser import random import requests import mysql.connector as mysql import re import argparse import platform import os import time parser = argparse.ArgumentParser(description = "GNS3 Management Tool") parser.add_argument("-o", "--optie", help = "Opties: aanmaken, verwijderen, exporteren, importeren", ...
rouwens/Fontys
test/functions.py
functions.py
py
6,071
python
nl
code
0
github-code
13
10115640125
import streamlit as st import numpy as np import pandas as pd from sklearn.feature_extraction.text import TfidfVectorizer #cosine similarity function is a efficient way to calculate similarity of 2 data from sklearn.metrics.pairwise import cosine_similarity #diiflib is used to indentify given input with closest data i...
W4R10CK99/Movie-Recommendation-System
streamlit_app.py
streamlit_app.py
py
3,084
python
en
code
0
github-code
13
26203222785
from resource.base.handler.lcp import LCP as BaseLCP from requests import delete as delete_req from requests import post as post_req from requests import put as put_req from document.ebpf_program.catalog import _eBPFProgramCatalogDocument from document.exec_env import ExecEnvDocument from lib.response import UnprocEn...
guard-project/cb-manager
resource/ebpf_program/handler/lcp.py
lcp.py
py
3,789
python
en
code
1
github-code
13
41237702720
#Various Barcharts Codes #Code 1 #https://stackoverflow.com/questions/43554521/add-data-label-to-grouped-bar-chart-in-matplotlib #Code adapted from: #https://chrisalbon.com/python/matplotlib_grouped_bar_plot.html #matplotlib online #Grouped bars import pandas as pd import matplotlib.pyplot as plt import numpy as np...
TSSFL/Dataset_Archives
barcharts_demo.py
barcharts_demo.py
py
21,062
python
en
code
0
github-code
13
8775258853
ch=input() def check(ch): if(ch>="a" and ch<="z") or (ch>="A" and ch<="Z"): if ch in 'aeiou' or ch in "AIEOU": print("Vowel") else: print("Consonent") else: print("invalid") check(ch)
sinha414tanya/tsinha
vowel_consonent.py
vowel_consonent.py
py
252
python
en
code
1
github-code
13
13420087231
import tensorflow as tf import numpy as np import os from datetime import datetime from numpy import linalg as LA from convnet import convnet_inference from resnet_model import resnet_inference from os import listdir import pandas as pd import cifar_input as cifar_data import my_utils tf.logging.set_verbo...
yzhuoning/StagewiseSGD
eval_compute_theta_mu.py
eval_compute_theta_mu.py
py
7,415
python
en
code
3
github-code
13
20884705523
import os from discord.ext import commands import discord '''Handles the voice state updates logger for moderation purposes. Built with Love <3 by Afnan for the Piano Planet Discord Server.''' # Dictionary of Guild IDs and their corresponding logs channel IDs # Used to route the logs to the correct logging channel # ...
Sayed-Afnan-Khazi/My-First-Discord-Bot
ext/voicelogger.py
voicelogger.py
py
2,660
python
en
code
0
github-code
13
22757618115
# head, eyes, spine, legs, arms template = """|------ | | | | | | | --------""" template1 = """|------ | | | ( ) | | | | --------""" template2 = """|------ | | | (° °) | | | | --------""" template3 = """|------ | | | (° °) | | | | | | --------""" template4 = """|------ | | | ...
SwyftAx/Hangman
hangman.py
hangman.py
py
1,133
python
en
code
0
github-code
13
13611822367
""" Exercício Crie uma função que encontra o primeiro duplicado considerando o segundo número como a duplicação. Retorne a duplicação considerada. Requisitos: A ordem do número duplicado é considerada a partir da segunda ocorrência do número, ou seja, o número duplicado em si. Exemplo: [1, 2, 3, ->3...
marcosab10/python
curso/exercicio_listas.py
exercicio_listas.py
py
1,993
python
pt
code
0
github-code
13
15499656392
#!/usr/bin/python from math import sqrt users = {"Angelica": {"Blues Traveler": 3.5, "Broken Bells": 2.0, "Norah Jones": 4.5, "Phoenix": 5.0, "Slightly Stoopid": 1.5, "The Strokes": 2.5, "Vampire Weekend": 2.0}, "Bill": {"Blues Traveler": 2.0, "Broken Bells": 3.5, "Deadmau5": 4.0, "Phoenix...
erikmingo/beerbuddy
recommender.py
recommender.py
py
4,833
python
en
code
1
github-code
13
73582678417
from .todo_server import todo_server, mocked_todo_server from .server_responses import AllTasksServerResponse, Task, TaskServerResponse from reports import models class __ReportsManager: def save_task(self, response_or_task: TaskServerResponse | Task) -> models.CompletedTaskReport | models.PendingTaskReport | Non...
TR0NZ0D/Distributed-System-Task-Server
ReportsServer/templates/utils/reports_manager.py
reports_manager.py
py
6,085
python
en
code
1
github-code
13
27151768084
from sqlite3 import PrepareProtocol from django.test import TestCase, Client from django.contrib.auth.models import User from issue.views import filter_issues from label.models import Label from repository.models import Repository from django.urls import reverse from issue.models import Issue as Iss from milestone.mode...
marijamilanovic/UksGitHub
Uks/issue/tests/test_views.py
test_views.py
py
10,482
python
en
code
0
github-code
13
10589093766
""" Testing admin stuff """ import os import re import sys import warnings import pytest import country_converter as coco # noqa TESTPATH = os.path.dirname(os.path.abspath(__file__)) sys.path.append(os.path.join(TESTPATH, "..")) CHANGELOG_FILE = os.path.join(TESTPATH, "..", "CHANGELOG.md") def test_version_cons...
IndEcol/country_converter
tests/test_admin.py
test_admin.py
py
1,077
python
en
code
188
github-code
13
4776614198
#functions from keras.models import Sequential from keras.layers import Dense, Dropout, BatchNormalization, Activation from keras.optimizers import Adam from keras.wrappers.scikit_learn import KerasClassifier from keras.models import load_model #read fasta def read_fasta(fa): name, seq = None, [] for line in fa: li...
bioinfolabmu/piRNN
functions.py
functions.py
py
2,785
python
en
code
2
github-code
13
39243164559
# -*- coding: utf-8 -*- # python默认的最大递归深度为998 # 这里我们可以自定义最大递归深度 import sys sys.setrecursionlimit(30000) class Solution: def NumberOf1Between1AndN_Solution(self, n): # write code here def sub_count(f,i): if i>n: return f count=self.count_1(i) ...
RellRex/Sword-for-offer-with-python-2.7
test31_整数中1出现的次数.py
test31_整数中1出现的次数.py
py
775
python
en
code
2
github-code
13
38072030018
##################################################################################################### # # top level jobOptions to run Muon chains in the RTT or standalone # sets some global variables that adjust the execution of TrigInDetValidation_RTT_Common.py # # Jiri.Masik@manchester.ac.uk # #######################...
rushioda/PIXELVALID_athena
athena/Trigger/TrigValidation/TrigInDetValidation/share/TrigInDetValidation_RTT_topOptions_MuonSlice.py
TrigInDetValidation_RTT_topOptions_MuonSlice.py
py
2,847
python
en
code
1
github-code
13
19905246837
# Definition for singly-linked list. # class ListNode(object): # def __init__(self, x): # self.val = x # self.next = None class Solution(object): def reorderList(self, head): """ :type head: ListNode :rtype: void Do not return anything, modify head in-place instead. ...
littleliona/leetcode
medium/143.reorder_list.py
143.reorder_list.py
py
2,026
python
en
code
0
github-code
13
16723512138
"""Unit tests for the date parsing method""" import os import sys import builtins from datetime import datetime, timedelta import mock from tp_timesheet.date_utils import get_start_date, assert_start_date from tp_timesheet.config import Config # Import config fixture from adjacent test # pylint: disable=(unused-import...
ThorpeJosh/tp-timesheet
tp_timesheet/tests/test_date_utils.py
test_date_utils.py
py
5,348
python
en
code
4
github-code
13
3302376037
import nltk import re import signal from mosestokenizer import MosesSentenceSplitter, MosesTokenizer from string import punctuation from text_categorizer import constants, pickle_manager from text_categorizer.logger import logger from text_categorizer.SpellChecker import SpellChecker from text_categorizer.ui import get...
LuisVilarBarbosa/TextCategorizer
text_categorizer/Preprocessor.py
Preprocessor.py
py
4,106
python
en
code
0
github-code
13
11163451717
''' Tests for basic HTTP request handling ''' from unittest import TestCase from urllib import parse from tornado.web import Application from tornado.httputil import HTTPHeaders from tornado.httputil import HTTPConnection from tornado.httputil import HTTPServerRequest from f5.handlers import BaseRequestHandler cla...
brendanberg/f5
test/test_handlers.py
test_handlers.py
py
3,113
python
en
code
0
github-code
13
74881411538
import os from azure.identity import DefaultAzureCredential from azure.storage.blob import BlobServiceClient, BlobClient, ContainerClient from dotenv import load_dotenv load_dotenv() dirname = os.path.dirname(__file__) local_path_noleak = os.path.join(dirname, "../../videos/results") if not os.path.exists(local_path_n...
equinor/gas-analysis
src/gas_analysis/download_dataset.py
download_dataset.py
py
1,682
python
en
code
0
github-code
13
22223792994
# Define your item pipelines here # # Don't forget to add your pipeline to the ITEM_PIPELINES setting # See: https://docs.scrapy.org/en/latest/topics/item-pipeline.html # useful for handling different item types with a single interface import csv import os import requests from itemadapter import ItemAdapter from yao...
qifiqi/codebase
python_codebase/爬虫/yaofangwang-未完成/yaofangwang/pipelines.py
pipelines.py
py
994
python
en
code
3
github-code
13
6576197410
# -*- coding: utf-8 -*- """ Created on Tue Oct 19 12:50:26 2021 @author: seoleary Provides a simple example class for implementing a thread for counting down, in the commented out code at the bottom, this class will implement two threads that will not execute sequentially because of a built in delay """ import threa...
seanmoleary/asynchronous
myThread.py
myThread.py
py
1,026
python
en
code
0
github-code
13
4064974811
import sys from functools import reduce def solution(): n = int(sys.stdin.readline()) li = [*range(n+1)] suming = reduce(lambda a, b: a + b, li, 0) print(suming) if __name__ == '__main__': solution()
GoodDonkey/algorithm_study
acmicpc/8393.py
8393.py
py
224
python
en
code
0
github-code
13
23160168456
#!/usr/bin/env python # coding: utf-8 # In[55]: import os import gzip import numpy as np import pandas as pd from keras.datasets import fashion_mnist import matplotlib.pyplot as plt from sklearn.svm import SVC from sklearn.model_selection import train_test_split from sklearn.svm import LinearSVC from sklearn import ...
coraljain/Machine-Learning-CPT_S-570
Support Vector Machines.py
Support Vector Machines.py
py
5,142
python
en
code
0
github-code
13
27834879944
# Write a class called Converter. # The user will pass a length and a unit when declaring an object from # the class—for example, c = Converter (9,'inches'). # The possible units are inches, feet, yards, miles, kilometers, # meters, centimeters, and millimeters. For each of these units # there should b...
rbrox/Python
30.py
30.py
py
983
python
en
code
0
github-code
13
30305553585
import numpy as np import h5py def grad(X, Y, W, lambd=0): return np.dot(np.asarray(X).T, np.dot(X, W) - np.asarray(Y)) + lambd * W def decent(W, alpha, grad): return W - alpha * grad def SSE(Y, Y_pred): return np.sum(0.5 * np.square(Y_pred - Y)) def cost_with_regular(Y, Y_pred, lambd, W): retur...
WangXurun/HIT-MLlab
util/util.py
util.py
py
4,198
python
en
code
0
github-code
13
3980108084
import os import data import header import threading def scan_destination_for_mp4_files(): """ scans the destination folder and collects all mp4 files names :return: void """ for file in os.listdir(header.source_folder_path): if "mp4" in file: header.source_files_list.append(st...
311725154/TelemetryPyExtractor
mission.py
mission.py
py
1,322
python
en
code
0
github-code
13
23007067189
import asyncio import discord import frosch2010_Console_Utils as fCU async def send_edit_embed_msg(term, term_words, tabuLanguage, channel): embed = discord.Embed(title=tabuLanguage.tabu_card_term_prefix + term, description=tabuLanguage.tabu_edit_description, color=0x22a7f0) embed.add_field(name="#...
Frosch2010/discord-taboo
code-files/frosch2010_Tabu_edit_system_functions.py
frosch2010_Tabu_edit_system_functions.py
py
2,219
python
en
code
1
github-code
13
36574469465
# Image Censor Application # Assignment 1 - Image Enhancement in Spatial Domain # 1. Blacken part of the image # 2. Darken part of the image # 3. Brighten pat of the image import cv2 as cv import numpy as np import tkinter as tk from tkinter import * from tkinter import filedialog from PIL import ImageTk, Image cla...
tasyadew/image-censor-app
imageCensor.py
imageCensor.py
py
8,128
python
en
code
0
github-code
13
20266852875
from csv import reader import sys from tkinter import messagebox, ttk from tkinter import * import Relay class solenoid_valve_control(Frame): font_size = 20 sv_num = 8 on_time_ms = 100 def __init__(self, master=None): # ウィンドウ初期化 super().__init__(master) self.master = master ...
cherry2022automation/cherry_classifier
solenoid_valve.py
solenoid_valve.py
py
2,717
python
en
code
0
github-code
13
14629280087
from hypothesis import given from swagger_server.models import Leaf from swagger_server.test.strategies import leaves @given(leaf_1=leaves(), leaf_2=leaves()) def test_creating_leaves_with_existing_leaf_ids(leaf_1, leaf_2, create_leaf, sample_graph): leaf_2.leaf_id = leaf_1.leaf_id try: create_leaf(...
Mykrobe-tools/mykrobe-atlas-distance-api
swagger_server/test/e2e/test_tree_post_controller.py
test_tree_post_controller.py
py
815
python
en
code
0
github-code
13
19191703005
import tensorflow as tf import tensorflow.keras as keras from tensorflow.keras.layers import Conv2D, MaxPool2D, Dense, LeakyReLU, ConvLSTM2D, Concatenate, Reshape import random from tensorflow.keras.models import Model import numpy as np import matplotlib.pyplot as plt import tensorflow as tf import os from tensorflo...
Belzerion/SwimDetect
LSTM_ResNet.py
LSTM_ResNet.py
py
4,303
python
en
code
0
github-code
13
3021846506
import collections import datetime import os import random import sys import struct import threading import time def log_msg(msg): dtstr = str(datetime.datetime.now()).split('.')[0] print('{0}: {1}'.format(dtstr, msg)) class VIOSApp(threading.Thread): def __init__(self, _queueHandler): threading.T...
manesajian/VIOS
vioslib.py
vioslib.py
py
20,297
python
en
code
0
github-code
13
3698195897
DOUBLE_ISLAND_POINT = 543 TEA_TREE_NOOSA = 544 COOLUM_BEACH = 545 THE_BLUFF = 546 HAPPYS_CALOUNDRA = 547 AGNES_WATER = 1001 FRASER_ISLAND = 1002 ALEXANDRIA_BAY_NOOSA = 1003 SUNSHINE_BEACH = 1004 PIN_CUSHION_MAROOCHYDORE = 1005 KAWANA = 1006 POINT_CARTWRIGHT = 1007 MOFFATS = 1008 NORTH_STRADBROKE_ISLAND = 1009 SOUTH_STR...
hhubbell/python-msw
msw/spots/australasia/sunshine_coast.py
sunshine_coast.py
py
342
python
en
code
1
github-code
13
23826411409
#!/usr/bin/python # Script to estimate the reef structure underneath the corals. Used to help close the meshes of individual colonies # extracted from a reef record (e.g. for the Palau data). from osgeo import gdal import numpy as np # import cv2 import matplotlib.pyplot as plt # import os # import scipy.ndimage # imp...
nbou/reefMin
reefMin2D.py
reefMin2D.py
py
4,680
python
en
code
0
github-code
13
29008231150
import argparse import os from common.functionutil import makedir, removefile, removedir, join_path_names, is_exist_exec, is_exists_hexec, \ list_files_dir, basename, basename_filenoext, fileextension, get_regex_pattern_filename, \ find_file_inlist_with_pattern from common.exceptionmanager import catch_error_...
antonioguj/bronchinet
src/scripts_util/convert_images_to_nifti.py
convert_images_to_nifti.py
py
5,426
python
en
code
42
github-code
13
16682365904
import os import pathlib import time from prometheus_client import start_http_server, Gauge, Enum def main(): # exporter 监听的端口 exporter_port: int = int(os.getenv("EXPORTER_PORT", "9876")) # 数据采集间隔 polling_interval_seconds: int = int(os.getenv("POLLING_INTERVAL_SECONDS", "5")) # 定义采集指标 file_...
zhengtong0898/notebook
devops/alertmanager/multiple_file/exporter.py
exporter.py
py
1,054
python
en
code
4
github-code
13
14567353400
import numpy as np import cv2 img = cv2.imread('bgorig.png') mask = cv2.imread('bgmask.png', 0) inpaintRadius = 5 dstTelea = cv2.inpaint(img, mask, inpaintRadius, cv2.INPAINT_TELEA) dstNs = cv2.inpaint(img, mask, inpaintRadius, cv2.INPAINT_NS) cv2.imshow('Telea', dstTelea) cv2.imshow('Navier-Stokes', dstNs) cv2.wait...
coollog/VideoBarcode
matcher/infill.py
infill.py
py
351
python
en
code
1
github-code
13
9821233263
import datetime import db.db_handler as database from flask import request,make_response,jsonify def GetMaterialOnWS(): conn = database.connector() cursor = conn.cursor() query = "SELECT * FROM mat_d_materialonws" cursor.execute(query) row_headers = [x[0] for x in cursor.description] json_dat...
lunaticXOXO/INKA-Full
backend/material/MaterialOnWorkstation/controller/MaterialOnWorkstationController.py
MaterialOnWorkstationController.py
py
2,481
python
en
code
2
github-code
13
12111057913
''' 3.实现 strStr() 函数 给你两个字符串 haystack 和 needle ,请你在 haystack 字符串中找出 needle 字符串出现的第一个位置(下标从 0 开始)。如果不存在,则返回 -1 。 ''' def strStr(haystack: str, needle: str) -> int: ''' 查找子字符串在字符串中的索引值位置 :param haystack: 字符串 :param needle: 子字符串 :return: 索引值 ''' # 1 子字符串长度大于字符串的长度,直接返回-1 if len(needl...
15149295552/Code
Month06/day21/exercise03.py
exercise03.py
py
864
python
zh
code
1
github-code
13
28352180395
#!/usr/bin/env python3 # Python3 # # Simple array class that dynamically saves temp files to disk to conserve memory # import logging import pickle from datetime import timedelta from itertools import islice from os import makedirs, remove from os.path import exists from shutil import rmtree from time import time s...
logwet/genome-imager
largearray.py
largearray.py
py
5,693
python
en
code
0
github-code
13
14759201707
# -*- coding: utf-8 -*- """import_settings.py - Contains ImportSettings class definition.""" # This file is part of Telemetry-Grapher. # Telemetry-Grapher 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, eith...
rysoseeryous/Telemetry-Grapher
classes/manager/import_settings.py
import_settings.py
py
14,251
python
en
code
5
github-code
13
38235452899
import pytesseract from typing import List from numpy import ndarray from bpmn_redrawer_backend.bpmn.bpmn_elements import Participant, Element from bpmn_redrawer_backend.bpmn.predictions import Text from bpmn_redrawer_backend.commons.utils import get_nearest_element def get_text_from_img(img: ndarray) -> List[Text]: ...
PROSLab/BPMN-Redrawer
backend/bpmn_redrawer_backend/api/services/ocr_service.py
ocr_service.py
py
2,115
python
en
code
4
github-code
13
14578484626
from time import time data = 3017957 def josephus(n): bn = bin(n)[2:] return int(bn[1:]+bn[0], 2) print(josephus(data)) class Item: def __init__(self, pos): self.pos = pos self.n = None self.p = None def steal(self): self.p.n = self.n self.n.p = self.p def e...
kryptn/Challenges
Advent/2016/day_19/nineteen.py
nineteen.py
py
865
python
en
code
1
github-code
13
16863779603
from __future__ import print_function from future import standard_library standard_library.install_aliases() from builtins import str from builtins import map from builtins import object import sys import networkx as nx import greedy_chicagoan as gs import math import random default_gapsize=100 def same_component(s1,s...
DovetailGenomics/HiRise_July2015_GR
scripts/hiriseJoin.py
hiriseJoin.py
py
8,837
python
en
code
28
github-code
13