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
73737553955
# -*- coding: utf-8 -*- """Config for the Trunk. """ __authors__ = "emenager, tnavez" __contact__ = "etienne.menager@inria.fr, tanguy.navez@inria.fr" __version__ = "1.0.0" __copyright__ = "(c) 2020, Inria" __date__ = "Jun 29 2022" import sys import pathlib sys.path.insert(0, str(pathlib.Path(__file__).parent.absolute...
SofaDefrost/CondensedFEMModel
Models/2Finger/Config.py
Config.py
py
1,372
python
en
code
1
github-code
1
12174937484
# SWEA 1983 # ํ•™์ƒ์˜ ์„ฑ์ ์„ ๊ตฌ๋ถ„ํ•˜๊ณ  ํŠน์ • ํ•™์ƒ์˜ ์„ฑ์  ์ถœ๋ ฅ T = int(input()) # ์—ฌ๋Ÿฌ๊ฐœ์˜ ํ…Œ์ŠคํŠธ ์ผ€์ด์Šค๊ฐ€ ์ฃผ์–ด์ง€๋ฏ€๋กœ, ๊ฐ๊ฐ์„ ์ฒ˜๋ฆฌํ•ฉ๋‹ˆ๋‹ค. for test_case in range(1, T + 1): # ์ฒซ๋ฒˆ์งธ๋กœ ํ•™์ƒ ์ˆ˜์™€ ์„ฑ์ ์„ ์•Œ๊ณ  ์‹ถ์–ดํ•˜๋Š” ํ•™์ƒ์˜ Index N, K = map(int, input().split()) letter_grade = ['A+', 'A0', 'A-', 'B+', 'B0', 'B-', 'C+', 'C0', 'C-', 'D'] new_letter_grade = [] for i in...
BonHyuck/Python
SWEA/D2/1983.py
1983.py
py
1,111
python
ko
code
1
github-code
1
41108550582
import time import pytest from gitlabform.gitlabform import GitLabForm from gitlabform.gitlabform.test import ( create_group, create_project_in_group, create_readme_in_project, get_gitlab, GROUP_NAME, ) PROJECT_NAME = "archive_project" GROUP_AND_PROJECT_NAME = GROUP_NAME + "/" + PROJECT_NAME @p...
Pigueiras/gitlabform
gitlabform/gitlabform/test/test_archive_project.py
test_archive_project.py
py
2,990
python
en
code
null
github-code
1
18941046063
from time import sleep from typing import List from utils.PageObject import PageObject PRODUCTS_LINK_SELECTOR = ".product .title > h2 > a" class WallpapersPage(PageObject): page_url = "https://avi-home.co.il/product-category/wallpapers/" def scroll_down(self): self.driver.execute_script("window.scr...
solomonBoltin/AviDesignScrapping
pages/WallpapersPage.py
WallpapersPage.py
py
1,233
python
en
code
0
github-code
1
74000134433
import tkinter as Tkinter import tkinter.messagebox as tkMessageBox import picamera import time import Adafruit_DHT import RPi.GPIO as GPIO from RPLCD.i2c import CharLCD GPIO.setmode(GPIO.BCM) GPIO.setup(16,GPIO.OUT) GPIO.setup(20,GPIO.OUT) GPIO.setup(21,GPIO.OUT) lcd=CharLCD("PCF8574",0x27)...
Beck0797/Raspberry-Pi-B-Smart-Home
SmartHomeIDP_GUI.py
SmartHomeIDP_GUI.py
py
2,603
python
en
code
0
github-code
1
33949911726
# needed imports from matplotlib import pyplot as plt from scipy.cluster.hierarchy import dendrogram, linkage import scipy.cluster.hierarchy as sch import numpy as np # This determines the clustering method. Check https://docs.scipy.org/doc/scipy/reference/generated/scipy.cluster.hierarchy.linkage.html#scipy.cluster.h...
Sockenschlauch/Scenario-Software
clustering.py
clustering.py
py
3,672
python
en
code
0
github-code
1
71228823393
import numpy as np import cv2 '''include if you want some more information about the needed memory''' #from memory_profiler import profile #@profile def NC(): '''Put file name here''' input_name = "demo.png" pic = cv2.imread(input_name,1) gray = cv2.imread(input_name,0) height, width, _ = pic.sh...
Jacobcrease/Normalmap-Calculator
NC.py
NC.py
py
3,977
python
en
code
1
github-code
1
33752525086
# read the dataset # divide it train test splet 60 to 40 # classfication using svm # kernel linear and kerneal rbf # acuuracy and presetion and f1 measure import pandas as pd from sklearn.model_selection import train_test_split from sklearn.svm import SVC df = pd.read_csv('./classficationData/classifier.csv') # dat...
tawfik-s/ML-Algo
Quiz/main.py
main.py
py
1,381
python
en
code
3
github-code
1
24522986960
# -*- coding: utf-8 -*- import time from fastapi import FastAPI,Request from .routers import setu from .db import on_shutdown, on_start app = FastAPI() app.include_router(setu.router) app.on_event("startup")(on_start) app.on_event("shutdown")(on_shutdown) @app.middleware("http") async def add_process_time_header(...
synodriver/asgi-server-benchmark
app/__init__.py
__init__.py
py
542
python
en
code
7
github-code
1
72301148514
from iota.crypto.types import Seed from iota.crypto.addresses import AddressGenerator from iota import Iota from datetime import datetime import requests, json, zmq class Node: def __init__(self, seed=None): if seed != None: self.seed = seed else: self.seed = str(Seed.r...
0xCozart/IOTA-CLI
IotaCli/core/api.py
api.py
py
3,082
python
en
code
0
github-code
1
45184231536
#!/usr/bin/env python # -*- coding: utf-8 -*- ''' Music Widget that play music online. ''' import widget class Widget(widget.WidgetModel): ''' Play music ''' __title__ = 'Music Player' __author__ = 'Michael Liao' __description__ = 'Play a music online' __url__ = 'http://www.expressme.org...
Albertnnn/express-me
src/widget/installed/music_player/__init__.py
__init__.py
py
1,604
python
en
code
0
github-code
1
19676075192
from stl import STL, Signal time_begin = 0 # global begin time signal = Signal(py_dict={"0": {"content": {"x": 1, "y": 2}}, "1": {"content": {"x": 2, "y": 1}}}) #stl_spec = STL("G[0, 1](0 < x < 1)") stl_eval = stl_spec.eval(time_begin, signal) print() #print("original STL expr: ") #print(st...
sychoo/STL-API
stl/example/api/stl/weaken2.py
weaken2.py
py
517
python
en
code
1
github-code
1
32649234953
import signal import subprocess import os import sys def readCard(): print(sys.platform) if(sys.platform == "linux"): proc = subprocess.run('javac -cp .:./lib/pteidlibj.jar main.java', shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT) proc1 = subprocess.run('java -Djava.libr...
surething-project/SurePresenceKiosk
kiosk/card.py
card.py
py
866
python
en
code
0
github-code
1
40329203690
import cvxpy as cvp import numpy as np from collections import namedtuple from mayavi import mlab from mayavi.mlab import points3d, plot3d, quiver3d import matplotlib.pyplot as plt """ http://www.larsblackmore.com/iee_tcst13.pdf carrying the same assumption here that X is up (i.e. normal to land) TODO: - fix q...
heidtn/ksp_autopilot
gfold_test.py
gfold_test.py
py
7,980
python
en
code
1
github-code
1
4458860862
import logging.config import os from flask import Flask, Blueprint import settings from api.restplus import api from api.auth.endpoints.register import ns as authentication_namespace from database.models import mysql as db app = Flask(__name__) logging_conf_path = os.path.normpath(os.path.join(os.path.dirna...
mani144/flask_blueprint_swagger_mysql
server.py
server.py
py
2,094
python
en
code
2
github-code
1
71015652195
# Title: Structure Of Balanced Networks # Link: https://www.acmicpc.net/problem/16721 import sys from collections import defaultdict sys.setrecursionlimit(10 ** 6) def read_single_int(): return int(sys.stdin.readline().strip()) def read_list_words(): return sys.stdin.readline().strip().split(' ') ...
yskang/AlgorithmPractice
baekjoon/python/structure_of_balanced_networks_16721.py
structure_of_balanced_networks_16721.py
py
1,985
python
en
code
1
github-code
1
25431510339
import sys input = sys.stdin.readline def is_palindrome(word: str) -> bool: return word == word[::-1] def is_similarity_palindrome(word: str) -> bool: n = len(word) left, right = 0, n-1 delete = False while left <= right: if word[left] == word[right]: left += 1 ...
reddevilmidzy/baekjoonsolve
๋ฐฑ์ค€/Gold/17609.โ€…ํšŒ๋ฌธ/ํšŒ๋ฌธ.py
ํšŒ๋ฌธ.py
py
951
python
en
code
3
github-code
1
10390872903
from sklearn.decomposition import PCA, TruncatedSVD, SparsePCA from sklearn.feature_extraction.text import CountVectorizer from mpl_toolkits import mplot3d from matplotlib import pyplot as plt import d2v_model import iterate_docs import numpy as np from itertools import accumulate def get_pca(docs): pca = PCA(n_c...
mihir-b-shah/time-analyzer
analyze/doc_visualizer.py
doc_visualizer.py
py
1,264
python
en
code
0
github-code
1
17290104296
from django.urls import path from . import views from .views import Register urlpatterns = [ path('cart/', views.view_cart, name='cart'), path('add_to_cart/<int:product_id>/', views.add_to_cart, name='add_to_cart'), path('remove_from_cart/<int:cart_item_id>/', views.remove_from_cart, name='remove_from_cart...
MAA8007/ecommerce_django
core/urls.py
urls.py
py
957
python
en
code
0
github-code
1
44301343774
# Inspired by allennlp implementation at https://github.com/allenai/allennlp/blob/master/allennlp/common/params.py def flatten(nested_dict: Dict[str, Any]) -> Dict[str, Any]: """ Returns the parameters of a flat dictionary from keys to values. Nested structure is collapsed with periods. """ flat_dic...
nmatthews-asapp/pygist
dict.py
dict.py
py
2,177
python
en
code
0
github-code
1
42298641554
import time import timeit def LinearSearch(A, key): current = 1 found = False AlistSize = len(A) while current <= AlistSize and found != True: if(A[current] == key): found = True print('Found') else: current = current + 1 ...
tamerayoub/Linear-and-Binary-Search
LinearSearch.py
LinearSearch.py
py
1,051
python
en
code
1
github-code
1
34525318959
def main(array:list): #* Step 0: assigning variables to the function array_filter = list() number_of_pawer = [2,3,4,5,6,7,8,9] #* Step 1: filter a numbers for i in range(len(array)): #* Step 2: exclude any number less than one if array[i] > 1: #* Step 3: ensure that th...
oaokm/100-Days-of-Code-Challenge
Python/Algorithms/Numbers/even_and_odd_numbers_algorithm.py
even_and_odd_numbers_algorithm.py
py
1,985
python
en
code
1
github-code
1
20927519600
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """\ Minimum interval cover jill-jรชnn vie et christoph dรผrr - 2014-2020 """ from sys import stdin from math import sqrt from tryalgo.our_std import readarray # pylint: disable=redefined-outer-name def _solve(iles, rayon): II = [] for x, y in iles: if y...
jilljenn/tryalgo
tryalgo/interval_cover.py
interval_cover.py
py
1,638
python
en
code
365
github-code
1
19511530507
""" Created on Jul 24, 2018 @author: ionut """ import logging import datetime from reach.base import Reach class ReachGPS(Reach): """ GPS client implementation for Reach """ def __init__(self, host, port, queue): Reach.__init__(self, host, port, queue, message_delimiter="\n$GNRMC") ...
BWiebe1/openexcavator
openexcavator/reach/gps.py
gps.py
py
2,161
python
en
code
4
github-code
1
5408299059
import copy import sys # for linux env. sys.path.insert(0, '..') import time import pickle import argparse from utils import * from torch.utils.data.sampler import SubsetRandomSampler import numpy as np import torch import torch.nn.functional as F import random import pandas as pd import json import matplotlib.pyplot...
calvin-zcx/hidd-sui
main_lstm.py
main_lstm.py
py
13,250
python
en
code
0
github-code
1
8366309057
#!/usr/bin/python3 """new view for State objects""" from api.v1.views import app_views from models import storage from models.state import State from flask import jsonify, abort, request @app_views.route( '/states', methods=['GET', 'POST'], strict_slashes=False ) def states(): """ GET and POST """ ...
scan3ls/AirBnB_clone_v3
api/v1/views/states.py
states.py
py
1,524
python
en
code
0
github-code
1
2125778137
from __future__ import division from __future__ import absolute_import from __future__ import print_function from pgportfolio.marketdata.coinlist import CoinList import numpy as np import pandas as pd from pgportfolio.tools.data import panel_fillna from pgportfolio.constants import * import sqlite3 from date...
dgeorge1000/portfolio_management_senior_capstone
pgportfolio/marketdata/stockglobaldatamatrix.py
stockglobaldatamatrix.py
py
3,670
python
en
code
2
github-code
1
70171476835
#! /usr/bin/env python3 """ plot the time vs miRNA ratio box plot """ import os, sys, re import json import seaborn as sns import matplotlib.pyplot as plt import matplotlib.ticker as ticker fn = '/data/cqs/chenh19/findadapt/findadapt_bench/2023_realdata/findadapt_res.time_mem_summary.txt' def get_miRNA_ratio(lb): ...
chc-code/findadapt
utils/simulation_and_benchmark/plot_realdata_time_vs_miRNA_ratio.py
plot_realdata_time_vs_miRNA_ratio.py
py
2,843
python
en
code
0
github-code
1
25797944919
# -*- coding: utf-8 -*- import numpy as np, math, operator import time def fwa(W, bitwidth): max_val = 2**(bitwidth-1) - 1 alpha = np.abs(W).max(axis=1) / max_val alpha_old = alpha*1.1 while(np.linalg.norm(alpha-alpha_old)>1e-9): q = W / alpha[:, np.newaxis] q = np.round(q) q =...
chenbohua3/BitSplit
quant.py
quant.py
py
3,395
python
en
code
null
github-code
1
30340972856
#!/usr/bin/env python # Requires PyQt5 and compiltion of GUI files via pyuic from setuptools import setup, Extension from setuptools.command.build_py import build_py try: from pyqt_distutils.build_ui import build_ui except ImportError: print("Please install pyqt_distutils") print( "(sudo) pip(3) install ...
LemmaSoftware/akvo
setup.py
setup.py
py
2,591
python
en
code
2
github-code
1
18481376081
""" Extract activations from a model, almost completely and shamelessly copied from https://github.com/dieuwkehupkes/diagnosing_lms/tree/interventions. """ # STD from argparse import ArgumentParser # EXT from diagnnose.config.setup import ConfigSetup from diagnnose.extractors.base_extractor import Extractor from diag...
Kaleidophon/tenacious-toucan
src/replication/extract.py
extract.py
py
4,218
python
en
code
0
github-code
1
22351360896
""" Module to call all API endpoints Author: Moises Gonzalez Date: 02/Jul/2023 """ import requests import json import logging from pathlib import Path logging.basicConfig(level=logging.INFO) logger = logging.getLogger(__name__) URL = "http://127.0.0.1:8000" with open('config.json', 'r') as f: config = json.load(...
moicesc/mldevops-dynamic-risk-assessment
apicalls.py
apicalls.py
py
1,662
python
en
code
0
github-code
1
22898563383
import random class RockPaperScissors: def __init__(self): self.user_name_list, self.user_score_list = [], [] self.user_score = 0 self.user_name = input("Enter your name: ") print("Hello,", self.user_name) self.options_list = input() self.default_win_conditions = {"...
liviu1406/Rock-Paper-Scissors
Rock-Paper-Scissors/task/rps/game.py
game.py
py
4,596
python
en
code
0
github-code
1
32204723298
########## BOOLEANS ########## # Two possible values: True or False (note capitilisation - must be written as such) isAlive = True # Comparisons # >, <, >=, <= all return a boolean # == equal to (comparing to see if both the same), != not equal to # 4.0 == 4 will show true (int and float is the same) # False, 0.0, 0,...
JLoh17/One-Week-Python
09_Booleans.py
09_Booleans.py
py
826
python
en
code
0
github-code
1
26062129734
'''La empresa XXXXXX S.A. tiene la siguiente tabla de parametros para pagar las comisiones de sus empleados o ejecutivos de venta: 1. Entre 2000000 - 10000000 el 7% 2. Entre 10000000 - 20000000 el 10% 3. Mayor 20000000 el 20% ''' nombre = (input('Ingrese nombre vendedor ')) comision = int(input('Ingrese total ...
talbylastra/commission-code1
ejerciciocomisiones1.py
ejerciciocomisiones1.py
py
720
python
es
code
0
github-code
1
24761517333
from .serializers import * import logging from rest_framework import generics, status from rest_framework.response import Response from rest_framework_simplejwt.tokens import RefreshToken logger = logging.getLogger(__name__) def get_tokens_for_user(user): refresh = RefreshToken.for_user(user) return { ...
slalit360/DRF-assignment
account/views.py
views.py
py
2,047
python
en
code
0
github-code
1
37232639874
from config import * import pygame from bullet import Bullet class Player(pygame.sprite.Sprite): def __init__(self, x, y, file_paths: list, lives,speed_x, sound_bullet, jumping_path, dead_path, character_type) -> None: pygame.sprite.Sprite.__init__(self) self.frame_index = 0 ...
Behrens0/BehrensTomasLab1AJuegoPython
source/PlayerClass.py
PlayerClass.py
py
3,507
python
en
code
0
github-code
1
73613324515
""" Throw-away script to analyze flappy state logs. """ from itertools import ifilter import pickle from pylab import * import sys from flappy import State def analyze_gravity(state_log): dec_sequences = [[]] inc_sequences = [[]] for i in xrange(1, len(state_log)): crt, last = state_log[i], state_log[i - ...
alfonsovgs/flappybot
analyze.py
analyze.py
py
2,640
python
en
code
0
github-code
1
34189932533
import numpy as np import sys import scipy.spatial.distance as dist import pyparticles.forces.force as fr class VanDerWaals( fr.Force ) : def __init__(self , size , dim=3 , m=None , Consts=1.0 ): self.__dim = dim self.__size = size self.__C = Consts # Hamaker coefficient ...
simon-r/PyParticles
pyparticles/forces/van_der_waals_force.py
van_der_waals_force.py
py
987
python
en
code
77
github-code
1
16239791104
import os import time import logging import os.path as osp import torch.distributed as dist def setup_logger(logpth): logfile = 'Deeplab_v3plus-{}.log'.format(time.strftime('%Y-%m-%d-%H-%M-%S')) logfile = osp.join(logpth, logfile) FORMAT = '%(levelname)s %(filename)s(%(lineno)d): %(message)s' log_lev...
NoamRosenberg/autodeeplab
utils/logger.py
logger.py
py
1,133
python
en
code
306
github-code
1
7469955324
''' Mini-Project1 - COMP 551 - Winter 2019 Mahyar Bayran Luis Pinto Rebecca Salganik ''' import json # we need to use the JSON package to load the data, since the data is stored in JSON format import numpy as np import matplotlib.pyplot as pt from proj1_task1 import splitData from proj1_task2 import closed_...
luispintoc/Task-1
proj1_task3.2.py
proj1_task3.2.py
py
1,938
python
en
code
0
github-code
1
71496463393
import numpy as np from scipy.optimize import root_scalar from scipy.optimize import fsolve class sieplasma(object): def __init__(self, theta_E_g, eta, zl, c, Dl, Ds, Dls, psi0_plasma_num, theta_0_num, B, C, delta_rs, deltab_10, deltab_20): self.theta_E_g = theta_E_g self.eta = eta self.ps...
everettiantomi/plasmalens
perturbative/validity_class.py
validity_class.py
py
3,938
python
en
code
0
github-code
1
37615564063
def solution(number, k): stack = [number[0]] for n in number[1:]: while k > 0 and stack and stack[-1] < n: stack.pop() k -= 1 stack.append(n) if k > 0: stack = stack[:-k] return ''.join(stack)
H2-won/Programmers
src/LEVEL2/ํฐ ์ˆ˜ ๋งŒ๋“ค๊ธฐ.py
ํฐ ์ˆ˜ ๋งŒ๋“ค๊ธฐ.py
py
257
python
en
code
0
github-code
1
8266025936
from django.contrib import admin from django.urls import path, include from Crud import views urlpatterns = [ path('admin/', admin.site.urls), path('company/', include('company.urls')), path('department/', include('department.urls')), path('employee/',include('employee.urls')), path('project/',incl...
zala49/CRUD-Django
Crud/urls.py
urls.py
py
371
python
en
code
1
github-code
1
11830335032
import numpy as np import argparse import cv2 ap = argparse.ArgumentParser() ap.add_argument("-i", "--image", required = True, help = "Image pathname") args = vars(ap.parse_args()) image = cv2.imread(args["image"]) image = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY) eq = cv2.equalizeHist(image) cv2.imshow("Histogram Eq...
muhsinali/opencv-book
chapter7/equalize.py
equalize.py
py
372
python
en
code
27
github-code
1
24877260133
"""pytest configuration.""" import pathlib from typing import Generator, Optional, Tuple import pytest from sqlalchemy.orm import Session from remote_command_server.database import Base, database_connection @pytest.fixture() def db() -> Generator[Session, None, None]: """ Fixture for creating a fresh test d...
saltastroops/remote-command-server
conftest.py
conftest.py
py
1,287
python
en
code
0
github-code
1
72593883553
#!/usr/bin/env python # -*- coding: utf-8 -*- # @Time : 2021/3/28 8:39 ไธ‹ๅˆ # @Author : ๅฎ‹็ปง่ดค # @Description : # @File : utils.py # @Software: PyCharm import torch import gensim def build_optimizer(args, model): optimizer = getattr(torch.optim, args.optim)( model.parameters(), lr=args.lr, ...
behome/tianchi
code/utils.py
utils.py
py
837
python
en
code
0
github-code
1
39563984867
#!/usr/bin/env python # -*- coding: utf-8 -*- # @Time : 2020/12/24 13:57 # @Author : Tian Hao # @Email : hao.tian@intcolon.cn # @File : tools.py # @Software: PyCharm # @Desc : ๆ—ถ้—ดๅค„็† import calendar import datetime from BaiduIndex.tools.DBHelper import DBHelper def get_time_range_list(start_date, end_date...
CY113/PythonSpider
BaiduIndex/BaiduIndex/tools/tools.py
tools.py
py
2,033
python
en
code
0
github-code
1
6830251807
# coding=utf-8 # borrowed from FilamentManager # master commit hash: bd1a9c0 on 1 Dec 2017 from __future__ import absolute_import __author__ = "Sven Lohrmann <malnvenshorn@gmail.com> based on work by Gina HรคuรŸge <osd@foosel.net>" __license__ = "GNU Affero General Public License http://www.gnu.org/licenses/agpl.html" _...
OllisGit/OctoPrint-SpoolManager
octoprint_SpoolManager/Odometer.py
Odometer.py
py
4,426
python
en
code
166
github-code
1
16149837506
from pygame import mixer # for audio playing from tkinter import * # for gui import os from mutagen.mp3 import MP3 # extracting metadata from file import tkinter.messagebox # for messages showing error for example from tkinter import filedialog from tkinter import ttk from ttkthemes import themed_tk as t...
MartinKalchev/Music-Player
main.py
main.py
py
8,410
python
en
code
0
github-code
1
21222905723
import random print("Horse race!") num_horses = int(input("How many horses will be in the race?")) # create two empty lists: horse names and horse distances names = list() distances = list() # now populate the lists with the horses and their starting distance # for example, range(3) will produce (0,1,2), then i wil...
davidmerickson01/davidmerickson01.github.io
python/horse_race.py
horse_race.py
py
1,304
python
en
code
0
github-code
1
13763775130
# [ํ”„๋กœ๊ทธ๋ž˜๋จธ์Šค]-ํŒŒ์ด์ฌ-์—ฐ์Šต๋ฌธ์ œ-(ํ‘ธ๋“œ-ํŒŒ์ดํŠธ-๋Œ€ํšŒ)-LV1-(1-๋‚ดํ’€์ด-์ •๋‹ต).py # https://github.com/irishNoah/Algorithm-Study # https://school.programmers.co.kr/learn/courses/30/lessons/134240 ''' *** ์ œํ•œ > ์‹œ๊ฐ„ : ?์ดˆ (๊ธฐ๋ณธ 1์ดˆ) / ๋ฉ”๋ชจ๋ฆฌ : ?MB (๊ธฐ๋ณธ 128MB) *** ์กฐ๊ฑด >>> 2 โ‰ค food์˜ ๊ธธ์ด โ‰ค 9 >>> 1 โ‰ค food์˜ ๊ฐ ์›์†Œ โ‰ค 1,000 >>> food์—๋Š” ์นผ๋กœ๋ฆฌ๊ฐ€ ์ ์€ ์ˆœ์„œ๋Œ€๋กœ ์Œ์‹์˜ ์–‘์ด ๋‹ด๊ฒจ ์žˆ์Šต๋‹ˆ๋‹ค. >>> foo...
irishNoah/Algorithm-Study
์•Œ๊ณ ๋ฆฌ์ฆ˜/ํŒŒ์ด์ฌ(Python)/888-๊ธฐํƒ€&์—ฐ์Šต/009-[ํ”„๋กœ๊ทธ๋ž˜๋จธ์Šค]-ํŒŒ์ด์ฌ-์—ฐ์Šต๋ฌธ์ œ-(ํ‘ธ๋“œ-ํŒŒ์ดํŠธ-๋Œ€ํšŒ)-LV1-(1-๋‚ดํ’€์ด-์ •๋‹ต).py
009-[ํ”„๋กœ๊ทธ๋ž˜๋จธ์Šค]-ํŒŒ์ด์ฌ-์—ฐ์Šต๋ฌธ์ œ-(ํ‘ธ๋“œ-ํŒŒ์ดํŠธ-๋Œ€ํšŒ)-LV1-(1-๋‚ดํ’€์ด-์ •๋‹ต).py
py
1,372
python
ko
code
4
github-code
1
43495306963
import sys read = sys.stdin.readline N = int(input()) graph = list(map(int, read().split())) maxDp = [graph.copy()] + [[0,0,0]] minDp = [graph.copy()] + [[0,0,0]] for t in range(1, N): i = t % 2 graph = list(map(int, read().split())) maxDp[i][0] = max(maxDp[i-1][:2]) + graph[0] maxDp[i][1] = max(maxDp[...
lsdtve/algorithm
Python/2096_๋‚ด๋ ค๊ฐ€๊ธฐ.py
2096_๋‚ด๋ ค๊ฐ€๊ธฐ.py
py
584
python
en
code
0
github-code
1
31697017903
from flask_wtf import FlaskForm from wtforms import StringField, TextAreaField, validators class CategoryForm(FlaskForm): # Minimum in name is only one because some languages such as Japanese can easily have # one character long words such as ัƒั…ั… as in picture. name = StringField( "Category", ...
CrescentKohana/keiji
application/categories/forms.py
forms.py
py
566
python
en
code
0
github-code
1
44247027464
"""Ne changer les adresses que dans la fonction prog Le dossier proteines ne doit contenir que les proteines, et il sera vidรฉ ร  la fin Le dossier photos doit รชtre vide au dรฉbut """ import os def photo(photo_folder_path,protein_folder_path): photo_list = os.listdir(photo_folder_path) protname = get_prot...
chadmdt/transverse
version utilisant PyMOL/main.py
main.py
py
2,567
python
en
code
0
github-code
1
17847458843
from twisted.trial.unittest import TestCase from twisted.python.filepath import FilePath from epsilon.extime import Time from nevow import loaders, rend from nevow.testutil import renderPage, renderLivePage from axiom.store import Store from axiom.dependency import installOn from xmantissa.people import Person, Ema...
rcarmo/divmod.org
Quotient/xquotient/test/test_rendering.py
test_rendering.py
py
6,301
python
en
code
10
github-code
1
535490489
import requests from bs4 import BeautifulSoup import smtplib import email.message Req = "https://store.playstation.com/pt-br/product/UP0082-PPSA10664_00-FF16SIEA00000002" #Substituir o "browserA' pelo seu Browser agent > https://www.whatismybrowser.com/detect/what-is-my-user-agent/ headers = {'User-Agent': ...
Marcos-SL/FFXVI-price-monitor
FFXVImonitor.py
FFXVImonitor.py
py
1,685
python
pt
code
0
github-code
1
13846619059
import os a = Analysis( ['main.py'], datas=[ ('theme', 'theme'), ('i18n.ini', '.'), ('icon-256px.ico', '.'), ('icon-128px.webp', '.'), ], hiddenimports=[ 'PIL._tkinter_finder', ], hookspath=[ 'pyi-hooks', ], excludes=[ '_asyncio', ...
ljty-0322/realesrgan-gui
realesrgan-gui.spec
realesrgan-gui.spec
spec
2,140
python
en
code
null
github-code
1
29690705700
'''Implement a method to perform basic string compression using the counts of repeated characters method.''' def string_compression(input): if len(input) == 0: return "" counter = 1 output = '' for i in range(1,len(input)): if input[i] == input[i-1]: counter += 1 ...
varunp66/Algorithms
Chapter1/Question 6.py
Question 6.py
py
515
python
en
code
0
github-code
1
28443403720
#!/usr/bin/python3 # -*- coding: utf-8 -*- # @Time : 2021/8/6 ไธŠๅˆ10:04 # @Author : PeiP Liu # @FileName: BertModel.py # @Software: PyCharm import torch import torch.nn as nn from torch.nn import LayerNorm as BertLayerNorm import sys sys.path.append("..") import torch.nn.functional as F class BERT_SC(nn.Module): ...
LiuPeiP-CS/BertSeqC4Vul
Bert/BertModel.py
BertModel.py
py
4,238
python
en
code
0
github-code
1
75059026592
import triton import triton.language as tl def conv2d_forward_config( BLOCK_SIZE_BATCH_HEIGHT_WIDTH: int, BLOCK_SIZE_IN_FEAT: int, BLOCK_SIZE_OUT_FEAT: int, n_warps: int = 4, n_stages: int = 2, ) -> triton.Config: """ Creates a triton.Config object for conv2d_forward_kernel given m...
BobMcDear/attorch
attorch/conv_kernels.py
conv_kernels.py
py
9,935
python
en
code
1
github-code
1
2851195816
class Solution: def deckRevealedIncreasing(self, deck: List[int]) -> List[int]: deck.sort() deq = collections.deque(range(len(deck))) loc = [] ans = [0] * len(deck) while deq: loc.append(deq.popleft()) if deq: deq.append(deq.popleft()) ...
sundayTen/algorithm
taewan/week 7/950. Reveal Cards In Increasing Order.py
950. Reveal Cards In Increasing Order.py
py
424
python
en
code
0
github-code
1
13857053749
from operator import truediv import tensorflow as tf from tensorflow.keras import backend as K from tensorflow.keras.utils import get_custom_objects from tensorflow.keras.layers import Conv1D,Conv2D, Conv3D, Flatten, Dense, Reshape, Lambda from tensorflow.keras.layers import Dropout, Input,dot,Activation,MaxPool1D...
henulx/HDECGCN-Framework
HRACPCNN.py
HRACPCNN.py
py
20,118
python
en
code
0
github-code
1
26582542421
import subprocess import warnings import sys import numpy as np from datetime import datetime #---------------------------------------------------------------------------------------# # Dics and Colors #---------------------------------------------------------------------------------------# Dic_Keys = {0:'energy'...
TB-IKP/CBSplot
CBSplot/CBS_commands.py
CBS_commands.py
py
9,902
python
en
code
2
github-code
1
38018655263
import os import h5py import torch import numpy as np import pandas as pd from sklearn.model_selection import train_test_split from collections import Counter def write(data, gts, outfile): ''' This function writes the pre-processed image data to a HDF5 file Args: data: numpy.array, ima...
buchholzmd/SharkBehaviorClassification
datasets/utils.py
utils.py
py
5,524
python
en
code
3
github-code
1
18450438562
import random import hangman_words as hw import hangman_art as art stages=art.stages logo=art.logo print(logo) chosen_word = random.choice(hw.word_list) word_length = len(chosen_word) end_of_game = False lives = 6 #Create blanks display = [] for _ in range(word_length): display += "_" while not end_of_game:...
sangeethsn/Hangman_game
main.py
main.py
py
1,142
python
en
code
0
github-code
1
9859893801
""" Arsh recently found an old rectangular circuit board that he would like to recycle. The circuit board has R rows and C columns of squares. Each square of the circuit board has a thickness, measured in millimetres. The square in the r-th row and c-th column has thickness Vr,c. A circuit board is good if in each ...
pingrunhuang/KickStart
2019/roundc/circuit_board.py
circuit_board.py
py
2,188
python
en
code
0
github-code
1
14760350365
try: import importlib.resources as pkg_resources except ImportError: # Try backported to PY<37 `importlib_resources`. import importlib_resources as pkg_resources import pandas as pd from worldcereal import resources def load_refid_lut(): with pkg_resources.open_text(resources, 'CIB_RefIdLUT.csv') as...
WorldCereal/worldcereal-classification
src/worldcereal/classification/weights.py
weights.py
py
1,057
python
en
code
12
github-code
1
20567576086
import matplotlib.pyplot as plt import numpy as np def loadData(fileName): """ๅŠ ่ฝฝๆ•ฐๆฎ:่งฃๆžไปฅtab้”ฎๅˆ†้š”็š„ๆ–‡ไปถไธญ็š„ๆตฎ็‚นๆ•ฐ Args: fileName : ๆ•ฐๆฎ้›†ๆ–‡ไปถ Returns: dataMat : feature ๅฏนๅบ”็š„ๆ•ฐๆฎ้›† labelMat : feature ๅฏนๅบ”็š„ๅˆ†็ฑปๆ ‡็ญพ๏ผŒๅณ็ฑปๅˆซๆ ‡็ญพ """ # ่Žทๅ–ๆ ทๆœฌ็‰นๅพ็š„ๆ€ปๆ•ฐ๏ผŒไธ็ฎ—ๆœ€ๅŽ็š„็›ฎๆ ‡ๅ˜้‡ numFeat = len(open(fileName).readli...
yijunquan-afk/machine-learning
basic-learn/05-regression/code/Regression4.py
Regression4.py
py
3,509
python
zh
code
1
github-code
1
8742949407
#!/usr/bin/env env/bin/python import argparse import mido from timeit import default_timer as timer PROG_NAME = 'rmidi' PROG_DESCRIP = 'record midi data from given input to given file' DEFAULT_INPUT = 'KeyLab mkII 61:KeyLab mkII 61 MIDI' DEFAULT_BPM = 120 SECONDS_PER_MIN = 60 def get_cmd_args(): parser = argpar...
erickak/audiotools
rmidi/src/main.py
main.py
py
3,066
python
en
code
0
github-code
1
670609188
import pandas as pd import argparse import json # Creates json file with the number of times each hot topic appears in the annotaed file parser = argparse.ArgumentParser() parser.add_argument('-o', '--outfile') parser.add_argument('-i', '--coded_file', required=True) args = parser.parse_args() # "Hot Topics" result =...
BrendaNamuh/COMP598-UniversityHotTopics
src/analyze.py
analyze.py
py
988
python
en
code
0
github-code
1
18461666541
from flask import Flask, jsonify, request from calculation import Calc app = Flask(__name__) @app.route('/get_time', methods=['POST']) def give_res(): do = Calc() answer_dict = {} n = 1 # ะฟะตั€ะตะผะตะฝะฝะฐั ะดะปั ะฝัƒะผะตั€ะฐั†ะธะธ ะพั‚ะฒะตั‚ะพะฒ ะฒ ัะปะพะฒะฐั€ะต answer_dict for i, test in enumerate(request.json): ...
Dortov/Web-API
app.py
app.py
py
921
python
ru
code
0
github-code
1
7978190478
import random class Noise: #Switches 0 to 1 an 1 to 0 in a string def swap_bit(bit: str) -> str: if bit == '1': return '0' else: return '1' #Simple noise. Tests the probability for each bit @staticmethod def simple_noise(data, switch_probability): da...
DocentSzachista/NIDUC-2021
Noise.py
Noise.py
py
1,084
python
en
code
0
github-code
1
35001994938
import scipy.stats as sc class Voting_Regressor: """ Voting Regressor: Makes use of the bagging ensemble method (different algorithms on the same data) to predict continuous values It does this by training the algorithms on the data individually, and aggregating their predictions int...
King-Ogunnowo/written_algorithms
voting_regressor.py
voting_regressor.py
py
1,313
python
en
code
0
github-code
1
16988033518
from django.http import JsonResponse from jam.spotify_api import url_argument_parse import pitchfork import re import urllib try: import urllib.request as urllib2 except ImportError: import urllib2 ####################### # PITCHFORK API WRAPPER ####################### def search(request, artist, album): ...
cartev/Jam
jam/pitchfork_api.py
pitchfork_api.py
py
1,079
python
en
code
1
github-code
1
71345725154
from .models import BookModel, AuthorModel from django import forms import re from django.utils.translation import gettext_lazy as _ from django.core.exceptions import ValidationError import datetime class BookCreateForm(forms.Form): authors = forms.CharField(max_length=100, required=True, widget=forms.TextInput(...
cyber-tatarin/booka
books/forms.py
forms.py
py
3,799
python
ru
code
0
github-code
1
22674612731
# -*- coding: utf-8 -*- import sys from nltk.tag import StanfordNERTagger from nltk.tokenize import word_tokenize from sklearn.metrics import precision_recall_fscore_support as score def computeStatistics(expected_tags, generated_tags): unique_tags = list() floatFormat = "{:.2f}" for tag in generated_tags: i...
YashashreeKolhe/Natural-Language-Processing
111508041_Assign5/111508041_Assign5-Code.py
111508041_Assign5-Code.py
py
2,372
python
en
code
0
github-code
1
73915914915
#!/usr/bin/python3 # a simple script, meant to get the 1st initial shell on openAdmin machine from HTB #ย Exploit Title: OpenNetAdmin 18.1.1 - Remote Code Execution #ย Origin exploit @mattpascoe #ย python version @m3dsec #ย Software Link: https://github.com/opennetadmin/ona # Version: v18.1.1 import requests import json i...
m3dsec/openNetAdmin18.1.1-SemiShell
openNetAdmin18.1.1_SemiShell.py
openNetAdmin18.1.1_SemiShell.py
py
948
python
en
code
2
github-code
1
390364811
class Solution: # @param {int[]} A an integer array sorted in ascending order # @param {int} target an integer # @return {int} an integer def lastPosition(self, A, target): if not A or target is None: return -1 start = 0 end = len(A) - 1 while start + 1 < en...
wusixuan0/practice
binary.py
binary.py
py
1,759
python
en
code
0
github-code
1
38690808253
'''Accept a positive integer n as input and find the print the smallest integer that is divisible by all the integers in the range [1,n], endpoints inclusive.''' n = int(input()) num = n found = False while not found: found = True for i in range(1, n+1): if num % i != 0: found = ...
AashikBobade/General
POuiz1.py
POuiz1.py
py
385
python
en
code
0
github-code
1
27894651886
import streamlit as st from PIL import Image import random import pandas as pd def app(): image = Image.open('./picture/khtn.PNG') st.image(image, width=500) st.markdown("------") st.markdown(""" <style> .big-font { font-size:80px !important; } </style> """, unsafe_allow_html=True) ...
johnluk0092/leesson1
webs/lesson18.py
lesson18.py
py
5,335
python
en
code
0
github-code
1
73981839393
from django.urls import path from .views import (case_detail, add_case, update_case, delete_case, add_task,upload_files, new_case, pending_list, completed_list, CaseList, CaseCreateView, CategoryListView, delete_cat, cat_update, cat_add, add_argument, cat_de...
succeed98/Lawyer
cases/urls.py
urls.py
py
11,114
python
en
code
0
github-code
1
4020893724
from Modulos.Modulo_System import( Command_Run ) #from Modulos.Modulo_Text import( # Text_Read #) from Modulos.Modulo_Files import( Files_List ) from Modulos import Modulo_Util_Debian as Util_Debian from Modulos.Modulo_Language import get_text as Lang from Interface import Modulo_Util_Qt as Util_Qt from pa...
CocoMarck/Linux_PrepararSistema
Script_Preparar-OS_Qt.py
Script_Preparar-OS_Qt.py
py
21,971
python
en
code
0
github-code
1
2378264148
import cv2 from matplotlib import pyplot as plt import numpy as np input_image = "Prasanna.png" def display_save(display_name, file_name, img): cv2.imshow(display_name, img) cv2.waitKey(0) cv2.destroyAllWindows() cv2.imwrite(file_name, img) def grayscale(): img = cv2.imread(input_image, cv2.IMREA...
ppartha2018/ComputerVision---Projects
BasicTransformations/Transformations.py
Transformations.py
py
3,122
python
en
code
1
github-code
1
14366329848
''' @autor Simone Lima ''' import pandas as pd from .files import AppFilesPath from domain.app.models import VersionModel, ReleaseNoteModel, ReleaseNoteType from domain.utils.check_value_utils import CheckValuesUtils from domain.utils.file_utils import CSVColumnsName, CSV_EXTENSION from django.db import transaction cl...
slimaElixir/restaurante
domain/app/services/versions.py
versions.py
py
3,239
python
en
code
0
github-code
1
12039630568
# -*- coding: utf-8 -*- """ Created on 02/17/2019 NSC - AD440 CLOUD PRACTICIUM @author: Dao Nguyen Changed ownership on 03/01/2019 @author: Michael Leon """ import urllib.request import re import os import json import time from selenium import webdriver from selenium.webdriver.common.keys import Keys import selenium....
ActoKids/web-crawler
scripts/browserCrawler/SSScraper.py
SSScraper.py
py
6,625
python
en
code
1
github-code
1
27177815209
""" datasets.py """ import numpy as np import pandas as pd from collections import namedtuple from gensim.corpora import Dictionary # Load two dictionary dct = Dictionary.load_from_text("vocab.txt") def doc2bow(morphemes): """ Converrt strings with non filtered dictionary to vector :param morphemes: morphemes...
pytry3g/pytorch-example
nlp/classification/ldcc/datasets.py
datasets.py
py
1,190
python
en
code
0
github-code
1
74541216032
import os import tornado import importlib from ..base.handlers import default_handlers as default_base_handlers from ..services.kernels.pool import ManagedKernelPool from .cell.parser import APICellParser from .swagger.handlers import SwaggerSpecHandler from .handlers import NotebookAPIHandler, parameterize_path, Noteb...
jupyter-server/kernel_gateway
kernel_gateway/notebook_http/__init__.py
__init__.py
py
6,877
python
en
code
459
github-code
1
14932230430
"""Unit tests for metrics module.""" from ldp.utils import linalg import torch import torch.linalg def test_effective_rank(): """Test effective_rank matches intuition.""" matrix = torch.diag(torch.tensor([100, 100, 1e-6])) actual = linalg.effective_rank(matrix) assert torch.allclose(torch.tensor(actu...
evandez/low-dimensional-probing
tests/utils/linalg_test.py
linalg_test.py
py
1,459
python
en
code
1
github-code
1
28391976299
PATH = 'ex1.txt' with open(PATH) as f: lines = f.readlines() count = 0 for i, line in enumerate(lines[1:]): previous = int(lines[i]) if (int(line) > previous): count += 1 print(count)
batanete/advent-of-code-2021
day1/ex1/ex1.py
ex1.py
py
191
python
en
code
0
github-code
1
6690016722
x = 5 y = 6 print("I eat {} vegetable and {} fruit".format(x, y)) string = "There are 9 planet in solar system " string_1 = string.replace(str(9), str(8)) print(string_1)
Bittu30/python_dhaval
string.py
string.py
py
175
python
en
code
0
github-code
1
38418811597
#!/usr/bin/env python # coding: utf-8 # Data Analysis of Unemployment in India # In[1]: import numpy as np import pandas as pd import matplotlib.pyplot as plt import seaborn as sns import plotly.express as px # In[2]: # importing the given dataset df = pd.read_csv("C:/Users/ASUS/Downloads/Unemployment in India.c...
shrutiiiyadav/UNEMPLOYMENT-IN-INDIA-ANALYSIS-TASK2
Unemployment in India Analysis.py
Unemployment in India Analysis.py
py
2,761
python
en
code
0
github-code
1
43073374913
from PyQt4 import QtCore,QtGui import sys class StdOutRedirector: def __init__(self,edit): self.buff='' self.edit = edit self.__console__=sys.stdout def write(self, output_stream): self.buff+=output_stream self.edit.setText(self.buff) class MainFrame(QtGui.QDialog): ...
UpSea/midProjects
BasicOperations/03_system/redirectStandardout_03.py
redirectStandardout_03.py
py
1,239
python
en
code
1
github-code
1
21701900747
from decimal import Decimal from django.contrib.gis.db.backends.base import BaseSpatialOperations from django.contrib.gis.db.backends.util import SpatialFunction from django.contrib.gis.geometry.backend import Geometry from django.contrib.gis.measure import Distance from django.utils import six from sql_server.pyodbc....
condense/django-pyodbc-gis
django_pyodbc_gis/operations.py
operations.py
py
11,306
python
en
code
2
github-code
1
70050926753
import pandas as pd import os.path class Car: def __init__(self, ID, Model, Year_of_Production, Kilometers_traveled, Price): self.ID = ID self.Model = Model self.Year_of_Production = Year_of_Production self.Kilometers_traveled = Kilometers_traveled self.Price = Price ...
Malek-Aldebsi/Data_Storage_and_Handling_System
Data_Storage_and_Handling_System.py
Data_Storage_and_Handling_System.py
py
4,085
python
en
code
0
github-code
1
71131684833
# ์‹œ๊ฐ„ ์ดˆ๊ณผ def solution1(numbers): answer = [] count = 0 lenNumbers = len(numbers) for item in numbers: count += 1 if item == max(numbers): answer.append(-1) continue if count == lenNumbers: answer.append(-1) else: flag = Fals...
cookie-god/algorithm
programmers/level2/๋’ค์— ์žˆ๋Š” ํฐ ์ˆ˜ ์ฐพ๊ธฐ.py
๋’ค์— ์žˆ๋Š” ํฐ ์ˆ˜ ์ฐพ๊ธฐ.py
py
1,291
python
ko
code
0
github-code
1
70645888353
import os import csv from PIL import Image import torch from torch.utils.data import Dataset from typing import Any, Callable, Optional, Tuple class Emotions(Dataset): def __init__(self, cvs_file, root_dir, transform=None): self.root_dir = root_dir self.transform=transform data_file=os.path...
jump-orange/coms453-project
data.py
data.py
py
1,167
python
en
code
0
github-code
1
42838150553
from google_trans_new import google_translator import pandas as pd def my_autocorrect(): translator = google_translator() df = pd.read_csv("../../Data/menustat_2021_dataset.csv") df["food_category"] = df["food_category"].apply(lambda row: translator.translate(row, lang_tgt="pt")) if __name__ == "__main_...
arduini-eduarda/Pos-MachineLearning
Src/DataProcessing/Translation.py
Translation.py
py
346
python
en
code
0
github-code
1
2929396805
from PyQt5 import QtCore, QtGui, QtWidgets import os import ctypes from PyQt5.QtCore import QCoreApplication import threading from time import sleep from PyQt5.QtGui import QCursor, QWindow from PyQt5.QtCore import Qt, QPoint from PyQt5.QtWidgets import (QMessageBox,QApplication, QWidget, QToolTip, QPushButton,...
ipys/jopmanage
SystemDatabase.py
SystemDatabase.py
py
5,703
python
en
code
0
github-code
1
24666495868
# coding:utf-8 import serial import time import atexit import signal class Laser(object): def __init__(self, com): self.rate = 230400 self.com = com self.port = serial.Serial(port=self.com, baudrate=self.rate, timeout=2) self.stop_cmd = b'e' self.start_cmd = b'b' ...
reece15/hls_flcd2_python
Laser.py
Laser.py
py
3,261
python
en
code
10
github-code
1