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
39885329228
#!/usr/bin/env python3 # Поиск количества программ по заданному числу c = 0 def run(n): global c if n > 57: return elif n == 57: c += 1 else: run(n + 1) run(n + 10) run(35) print(c)
platofff/inf-ege-python
23/5849.py
5849.py
py
234
python
ru
code
7
github-code
90
71726970538
# -*- coding: utf-8 -*- """ Created on Thu Jul 6 23:08:34 2023 @author: Royce """ #on utilise un dictionnaire pour stocker les éléments du tableau en tant que clés et leur nombre d'occurrences en tant que valeurs. def comptage_occurrences1(tableau): compteur = {} for element in tableau: compteur[eleme...
Royce-LAYINDE/Royce-s-Programs
Python/CS 101/EX5.py
EX5.py
py
1,144
python
fr
code
1
github-code
90
25885727261
import os import re import sys import subprocess import json import glob import xml.etree.ElementTree as ET def get_configs_files(): glob_configs = os.path.join(os.path.dirname(os.path.realpath(__file__)), os.path.pardir, "configs", "projects", "*.json") return glob.glob(glob_configs) def get_configs_names():...
matEhickey/utizen
utizen/src/utils.py
utils.py
py
3,313
python
en
code
0
github-code
90
5162228107
#List of animes I have been recommended import random anime = ['Overlord', 'Dororo', 'Black Bullet', 'One Piece', 'Kimetsu', 'Monster', 'Vivy Florite Eyes Song', 'Kenshin', 'Danmachi','Log Horizon', 'Wonder Egg Priority', 'Student Council President Maid', 'Grave of Fireflies', 'Hells Paradise Manga', 'Inazum...
JosuexReyes/anime00
choosing_anime0.py
choosing_anime0.py
py
1,467
python
en
code
2
github-code
90
18105763059
N=int(input()) A=list(map(int,input().split())) c=0 flug = 1 while flug: flug = 0 for j in range(1,N)[::-1]: if A[j]<A[j-1]: A[j],A[j-1]=A[j-1],A[j] flug=1 c+=1 print(*A) print(c)
Aasthaengg/IBMdataset
Python_codes/p02259/s453621220.py
s453621220.py
py
231
python
en
code
0
github-code
90
41164954075
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import with_statement, division, absolute_import, print_function, unicode_literals # ready for the future ! __author__ = "Gael Goret" __copyright__ = "Copyright 2016, CEA" __version__ = "0.1" __email__ = "gael.goret@cea.fr" __status__ = "dev" import vtk fr...
ggoret/mudra
sfi_viewer.py
sfi_viewer.py
py
24,713
python
en
code
0
github-code
90
18072546939
#D問題 import math H,W,A,B = map(int,input().split()) mod = 10**9 + 7 M = H+W-1 fact = [1 for i in range(M)] for i in range(M): if i == 0: pass else: fact[i] = (fact[i-1]*i)%mod refact = [1 for i in range(M)] m = mod-2 b = bin(m) b = b.lstrip("0b") b = b[::-1] m2 = len(b) for i in range(...
Aasthaengg/IBMdataset
Python_codes/p04046/s467882970.py
s467882970.py
py
895
python
en
code
0
github-code
90
42415462444
from utils import * import cv2 import time import numpy as np if __name__ == "__main__": webcam = WebcamImage() model = load_model() i = 0 while True: image = webcam.get_image() coords, image = get_image_and_coords(image, model) cv2.imshow('posenet', image) if c...
abhay-sheshadri/VirtualWorkout
recorder.py
recorder.py
py
571
python
en
code
1
github-code
90
21526334625
import socket,uuid # 获取主机名 hostname = socket.gethostname() #获取IP ip = socket.gethostbyname(hostname) # 获取Mac地址 def get_mac_address(): mac=uuid.UUID(int = uuid.getnode()).hex[-12:] return ":".join([mac[e:e+2] for e in range(0,11,2)]) print(hostname, ip, get_mac_address())
MisterZhouZhou/pythonLearn
hack/arp/ip.py
ip.py
py
302
python
en
code
1
github-code
90
30165420265
from pylab import meshgrid import numpy as np import matplotlib.pyplot as plt x = np.arange(0,5,0.1) y = np.arange(0,5,0.1) def z_func(x,y): return (np.sin(x+y) + (x-y)**2 -1.5*x + 3.5*y + 3) X1,X2 = meshgrid(x,y) xx = np.loadtxt('data',usecols=0) yy = np.loadtxt('data',usecols=1) zz = np.loadtxt('data',usecols=2) Y =...
zarkoivkovicc/Fortran-codes-for-TC-course
Ivkovic_Zarko_Calculus/data/Part 2.1/script.py
script.py
py
597
python
en
code
0
github-code
90
8167496105
import os import sys from src.exception import CustomException from src.logger import logging import pandas as pd import tensorflow as tf from tqdm import tqdm import numpy as np from sklearn.preprocessing import LabelEncoder # from src.components.data_transformation import DataTransformation # from src.co...
rrizwan98/end_to_end_MLOps_projects
MLOps Apply on Neural Network/src/components/data_ingestion.py
data_ingestion.py
py
4,392
python
en
code
0
github-code
90
37629123928
from uuid import uuid4 from datetime import datetime from database import Database __author__ = "prabin bernard" class Post(object): def __init__(self, author, title, content, blog_id, created_date=datetime.utcnow(), id=None, ): self.author = author self.title = title self.content = cont...
prabinbernard/sampleblog
src/models/post.py
post.py
py
1,272
python
en
code
0
github-code
90
27805012669
import operator import re from collections import deque from dataclasses import dataclass from functools import reduce from typing import Any, ClassVar, Optional import gym import numpy as np from art import text2art from gym import RewardWrapper, Space # type: ignore from gym.core import ObservationWrapper from gym....
GPT-RL/fsvf-toy
fsvf/ppo/env_utils.py
env_utils.py
py
12,987
python
en
code
0
github-code
90
29500602905
#!/usr/bin/env python3 from lambda_function import lambda_handler # Run Lambda function using test args through argv. if __name__ == "__main__": args = { "version": "2.0", "routeKey": "ANY /pdt-giran-grafana-webhook-transformer", "rawPath": "/default/pdt-giran-grafana-webhook-transformer", ...
giranm/pagerduty-aws-lambda
grafana-webhook-transformer/lambda_function_test.py
lambda_function_test.py
py
2,288
python
en
code
3
github-code
90
41443479449
from django.urls import path, include from . import views app_name = "ddapp" urlpatterns = [ path("", views.IndexView.as_view(), name = "index"), path("accounts/", include("accounts.urls")), path("mypage/", views.MypageView.as_view(), name = "mypage"), path("post/", views.PostRecordView.as_view(), name...
Eubulon3/DDProject
ddapp/urls.py
urls.py
py
678
python
en
code
0
github-code
90
27365861941
from flask import render_template, request, current_app from mywebsite import db from mywebsite import main_blueprint as main @main.errorhandler(404) def not_found_error(error): current_app.logger.warning(f"404 error for request: f{request.path}") return render_template("404.html"), 404 @main.errorhandler(...
anton-donchev/mywebsite
mywebsite/errors.py
errors.py
py
422
python
en
code
0
github-code
90
6831348824
import pytest import pymongo import bson import testinfra import time import os import docker import threading from datetime import datetime from cluster import Cluster documents=[{"a": 1}, {"b": 2}, {"c": 3}, {"d": 4}] @pytest.fixture(scope="package") def docker_client(): return docker.from_env() @pytest.fixtu...
Percona-QA/psmdb-testing
pbm-functional/pytest/test_PBM-773.py
test_PBM-773.py
py
4,287
python
en
code
0
github-code
90
41672422581
import enviroment as env from xdsDQN import DeepQNetwork env.main() RL = DeepQNetwork(n_actions=8,n_features=env.re_image(self=1).shape[0],learning_rate=0.01, e_greedy=0.9, replace_target_iter=100, memory_size=2000, e_greedy_increment=0.001, ) total_steps = 0 for i_episode in range...
xdongsheng/carmisitake
train_car.py
train_car.py
py
1,248
python
en
code
0
github-code
90
13929371123
from bson.objectid import ObjectId from great import db class Notice(): def __init__(self, id=0, title="", description="", classe=None, createdAt=""): self.id = id self.title = title self.description = description self.classe = classe self.createdAt = createdAt def cre...
alanaecp/great-ui
great/models/Notice.py
Notice.py
py
1,645
python
en
code
0
github-code
90
18161179749
N=int(input()) A=list(map(int,input().split())) sumA=0 sumB=[0] for i in range(N): sumB.append(sumB[i]+A[i]) i=i+1 for j in range(N-1): sumA=sumA+(A[j]*(sumB[N]-sumB[j+1]))%(10**9+7) j=j+1 print(sumA%(10**9+7))
Aasthaengg/IBMdataset
Python_codes/p02572/s100629457.py
s100629457.py
py
226
python
zh
code
0
github-code
90
11032884033
import pytest from mock import patch from util.workers import get_worker_count @pytest.mark.parametrize( "kind_name,env_vars,cpu_affinity,multiplier,minimum,maximum,expected", [ # No override and CPU affinity * multiplier is between min and max => cpu affinity * multiplier. ("registry", {}, [...
quay/quay
util/test/test_workers.py
test_workers.py
py
2,859
python
en
code
2,281
github-code
90
18149389479
s = input() n = int(input()) for _ in range(n): line = input().split() command, args = line[0], line[1:] start = int(args[0]) end = int(args[1]) + 1 if command == 'replace': s = s[:start] + args[2] + s[end:] elif command == 'reverse': s = s[:start] + str(''.join(list(reversed(s[s...
Aasthaengg/IBMdataset
Python_codes/p02422/s496497316.py
s496497316.py
py
400
python
en
code
0
github-code
90
18269237049
# B - Papers, Please # https://atcoder.jp/contests/abc155/tasks/abc155_b n = int(input()) a = list(map(int, input().split())) even = 0 cnt = 0 for i in a: if i % 2 == 0: even += 1 if i % 3 == 0 or i % 5 == 0: cnt += 1 if even == cnt: print('APPROVED') else: print('DENIED')
Aasthaengg/IBMdataset
Python_codes/p02772/s026056542.py
s026056542.py
py
318
python
en
code
0
github-code
90
36014626277
from aiohttp import web import socketio async def index(request): with open('index.html') as f: return web.Response(text=f.read(), content_type='text/html') # creates a new Async Socket IO Server sio = socketio.AsyncServer() # Creates a new Aiohttp Web Application app = web.Application() # Binds our So...
David-Happel/realtime_deepfake_audio_detection
server/sio.py
sio.py
py
501
python
en
code
0
github-code
90
29619196933
import argparse import logging import os import pickle import time from collections import defaultdict import numpy as np import torch from torch.utils.data import DataLoader, RandomSampler, SequentialSampler, TensorDataset from transformers import OpenAIGPTTokenizer, OpenAIGPTLMHeadModel, AdamW, get_linear_schedule_wi...
Loielaine/NLP
hw5_deeplearning/script/generation/model_openai_gpt.py
model_openai_gpt.py
py
19,812
python
en
code
1
github-code
90
5168487822
"""Employee repository""" from sqlalchemy.exc import IntegrityError from sqlalchemy.orm import Session from app.employees.models import Employee class EmployeeRepository: """EmployeeRepository class""" def __init__(self, db: Session): self.db = db def create_employee(self, name, surname, email...
dimiten/Car-workshop
app/employees/repositories/employee_repository.py
employee_repository.py
py
3,183
python
en
code
0
github-code
90
39708192576
from flask import Flask, jsonify, request from pickle import load from urllib.request import Request, urlopen import json app = Flask(__name__) @app.route('/', methods=['GET', 'POST']) def hello_world(): if (request.method == 'POST'): input_json = request.get_json() url = input_json['url'] model = load(open('m...
utkarsh-in/Flair_detector
FlairPrediction.model_deploy.py
FlairPrediction.model_deploy.py
py
1,316
python
en
code
0
github-code
90
1023216564
import pandas as pd #from matplotlib import pyplot as plt #from matplotlib.patches import Ellipse import math class NB(): def __init__(self): pass def fit(self, x_con, x_cat, y): #y is a pandas frame with a single column self.y = y self.y_prior = self.getPrior() ...
ZoomMan12312/naive-bayes
naivebayes.py
naivebayes.py
py
5,988
python
en
code
0
github-code
90
24097885857
def cube_root(a,e,x0): # Your solution here # assert that a, e, x0 are positive numbers are positive numbers. assert a > 0 assert e > 0 assert x0 > 0 XN = x0 N = 0 # condition is in absolute value where it stops when e is more than condiiton # negation of less is m...
adrielhakiiem/core-cw1
ACF/ACF-A.py
ACF-A.py
py
512
python
en
code
1
github-code
90
42781953351
# -*- coding: utf-8 -*- # ------------------------------------------------------------------------- # 文件目的:演示使用岭回归算法分析"岩石&水雷"数据集 # 创建日期:2018/2/3 # ------------------------------------------------------------------------- import numpy import pylab as plt from sklearn import linear_model from sklearn.metrics import roc_...
oraocp/pystat
bk/pa/03/classifierRidgeRocksVMines.py
classifierRidgeRocksVMines.py
py
2,464
python
en
code
0
github-code
90
40303118424
import pyglet from pyglet import gl from pyglet.gl import * from random import randint import math window = pyglet.window.Window(width=800, height=600, caption='Normal INI', resizable=True) n = 300 rpts = [(math.cos(2 * math.pi * (i / n)), math.sin(2 * math.pi * (i / n))) for i in range(n)] pts = [[randint(100, 500)...
dougles/pyglet-practice
examples/lines-points.py
lines-points.py
py
1,001
python
en
code
0
github-code
90
26986711901
# Find the 10001st prime number # I'm thinking something similar to the candidate list, but that won't work because I don't have an upper bound # I'll try it anyway... UB = 1000000 # Upper bound candidates = range(2, UB) index = 0 for i in range(2,UB): number=i temp=i-2 while temp<(len(candidates)-number...
dzmeruk/Euler
P7.py
P7.py
py
625
python
en
code
0
github-code
90
21461360515
from .base_command import BaseCommand from ..errors.errors import NoToken, EmailExist, InvalidToken, InvalidParams from sqlalchemy.exc import IntegrityError from ..models.database import db_session from ..models.blacklist import BlackList import os, requests, uuid, datetime from psycopg2.errors import UniqueViolation ...
rcelisc/miso_devops_grupo_uno
listas_negras/src/commands/create_mail.py
create_mail.py
py
1,486
python
en
code
0
github-code
90
69882407336
from setuptools import setup version = "0.1.1" url = "https://github.com/JIC-CSB/dserve" readme = open('README.rst').read() setup( name='dserve', packages=['dserve'], version=version, description="Tool to serve a dataset over HTTP", long_description=readme, include_package_data=True, autho...
JIC-CSB/dserve
setup.py
setup.py
py
650
python
en
code
0
github-code
90
74337052136
import json import requests from bs4 import BeautifulSoup from dateutil import parser from django.utils.timezone import make_aware from gwml2.harvesters.harvester.base import BaseHarvester from gwml2.harvesters.models.harvester import Harvester from gwml2.models.general import Quantity, Unit from gwml2.models.term_me...
kartoza/IGRAC-WellAndMonitoringDatabase
harvesters/harvester/azul_bdh.py
azul_bdh.py
py
7,417
python
en
code
2
github-code
90
18302813629
N = int(input()) if N % 2 != 0: print(0) else: fives = 0 power = 0 while (5 ** (power+1)) <= N: # Nには5のpower乗まで入る power += 1 for i in range(1, power+1): fives += N // (5 ** i) // 2 print(int(fives))
Aasthaengg/IBMdataset
Python_codes/p02833/s643588621.py
s643588621.py
py
261
python
en
code
0
github-code
90
22514366319
""" class MyCustomError(TypeError): pass raise MyCustomError("Error code 500, OUCH! An error happend.") """ class RuntimeErrorWithCode(TypeError): #Exception raised when a specific error code is needed. def __init__(self, message,code): super.__init__(f'Error code {code}: {message}') self....
MonadWizard/python-basic
basic/learnPythonByDoing/5_errors/4_creatingOwnErrors.py
4_creatingOwnErrors.py
py
411
python
en
code
3
github-code
90
26654752532
from PIL import Image # Will need to make sure PIL is installed import mss output_filename = 'screenshot.png' with mss.mss() as mss_instance: # dimHD = [0, 0, 1280, 720] dim = [0, 0, 1920, 1080] mon = {'top': dim[1], 'left': dim[0], 'width': dim[2], 'height': dim[3]} # monitor_1 = mss_instance.monit...
ahmad-hl/NebulaMCG
test/screencapture.py
screencapture.py
py
528
python
en
code
5
github-code
90
71380576936
import os import re def find_dipole(line): global dipole ifline = lastline ifline = ifline.replace('Dipole moment (field-independent basis, Debye):', 'Dipole moment (field-independent basis, Debye):@') if ifline != lastline: dipole = line[84:104] def find...
xxzou/chemess
Task4_Chem3D/C3dOutFormat.py
C3dOutFormat.py
py
4,289
python
en
code
0
github-code
90
17062034912
import math import os import cv2 import numpy as np import tensorflow as tf import matplotlib.pyplot as plt from skimage.measure import label as label_func from skimage.measure import regionprops from skimage.transform import hough_line, hough_line_peaks from scipy.signal import convolve2d as convolve2d from scipy....
thoklei/sudokubot
sudoku_vision.py
sudoku_vision.py
py
4,625
python
en
code
0
github-code
90
18529260363
actions = { "0": {"name": "Signup"}, "1": {"name": "Signin"}, "2": {"name": "Signout"}, "3": {"name": "Activate User"}, "4": {"name": "Update Role"}, "5": {"name": "Create Performace"}, "6": {"name": "Update Performace"}, "7": {"name": "Approve Performace"}, "6": {"name": "Reject Performace"}, "9": {"name"...
samuelitwaru/clickeat-webiste
app/data.py
data.py
py
594
python
en
code
0
github-code
90
34458843188
# third party import tkinter as tk from tkinter import Menu # local from model import Model from view import View from controller import Controller class App(tk.Tk): def __init__(self): super().__init__() self.title('Multi-Modal-Neural-Interface Demo') self.record_options = ('EEG', 'ECG')...
Funinja/Neural-Interface-GUI
index.py
index.py
py
1,297
python
en
code
0
github-code
90
28811774761
import pytest from conftest import client from modules.logs.models import LogEntry from modules.auth.utils import create_access_token from modules.user.models import User from modules.fixtures.db import test_db @pytest.fixture def test_user(test_db): user = User(hashed_password="testuser", email="test@example.co...
AlexBabilya/SvitITTestTask
modules/logs/tests/upload_log_test.py
upload_log_test.py
py
1,048
python
en
code
0
github-code
90
18574382579
n = int(input()) t = [0] * n x = [0] * n y = [0] * n for i in range(n): t[i], x[i], y[i] = map(int, input().split()) x_defo = 0 y_defo = 0 t_defo = 0 result = 0 for i in range(n): dt = t[i] - t_defo it = abs(x[i]-x_defo) + abs(y[i]-y_defo) if it > dt: result = 1 break if it %2 != d...
Aasthaengg/IBMdataset
Python_codes/p03457/s176426000.py
s176426000.py
py
490
python
en
code
0
github-code
90
32337226737
#!/usr/bin/python # -*- coding: utf-8 -*- import importlib import os from libc.debug_check import accept_param class CreateCode: """ 使用自动生成的代码替换指定文件中的代码。执行时会判断目标代码片段是否改变,仅当目标代码变化后才替换。 Args: target (str): 自动化代码目标文件,相对于项目根路径,不能以 '/' 开头 anchor (str): 界定符,自动化代码位于第一个 anchor 和第二个 anchor 之间, ...
wugifer/penedu
libc/create_code.py
create_code.py
py
5,638
python
zh
code
0
github-code
90
36215800540
answer = 0 def check(x1, y1, x2, y2): if abs(y2 - y1) == abs(x2 - x1): return True else: return False def queen(current, row, n): global answer if row == n: answer += 1 return for i in range(n): skip = False for x1, y1 in current: if...
nbalance97/Programmers
Lv 3/N-Queen.py
N-Queen.py
py
581
python
en
code
0
github-code
90
39218141824
class Solution: def back(self, cds, start, acc, ans, target): if sum(acc) > target: return if sum(acc) == target: ans.append(acc.copy()) return for i in range(start, len(cds)): acc.append(cds[i]) self.back(cds, i, acc, ans, tar...
xgate/leetcode
39-combination-sum/39-combination-sum.py
39-combination-sum.py
py
543
python
en
code
0
github-code
90
22147046896
import requests from concurrent.futures import ThreadPoolExecutor, as_completed from time import time, sleep, ctime import random, os, re, json from urllib.parse import urljoin, urlparse from urllib.error import HTTPError, URLError from colorama import Fore from random_user_agent.user_agent import UserAgent from random...
ademcck/scac
lib/fileFinder.py
fileFinder.py
py
10,274
python
en
code
2
github-code
90
42209846845
# -*- coding: utf-8 -*- from behave import given, when, then from models.course import Course from models.specialization import Specialization @given('a set of specializations') def step_impl(context): for row in context.table: Specialization.get(name=row['name']) @given('a set of courses') def step_im...
summ3rdays/ls_source_new
ls_source/features/steps/search_course.py
search_course.py
py
867
python
en
code
0
github-code
90
18449733359
import sys read = sys.stdin.read readlines = sys.stdin.readlines def main(): n, m, *x = map(int, read().split()) if n >= m: print(0) sys.exit() x.sort() sa = [] pre = x[-1] for xe in x: sa.append(abs(xe - pre)) pre = xe sa.sort() num = m - n r = sum(sa...
Aasthaengg/IBMdataset
Python_codes/p03137/s695452018.py
s695452018.py
py
379
python
en
code
0
github-code
90
73400125415
import requests from bs4 import BeautifulSoup page = requests.get('https://twitter.com/bod_republic') soup = BeautifulSoup(page.text, "lxml") tweets = [] for data in soup.find_all("article", class_="css-1dbjc4n r-1loqt21 r-18u37iz r-1ny4l3l r-1udh08x r-1qhn6m8 r-i023vh r-o7ynqc r-6416eg"): post_tweet = da...
emekadefirst/Movie-downloading-bot
Big shot season from ep 3/tweet.py
tweet.py
py
350
python
en
code
1
github-code
90
23676599730
import setuptools with open("README.md ","r") as file: long_des=file.read() setuptools.setup( name="preprocess_ady", version="0.0.1", author="Adyansh Das", author_mail="adyanshdas1@gmail.com", description="This is a preprocessing package", long_description= long_description, long_description_content_type="tex...
Adyansh29/preprocess_ady
Setup.py
Setup.py
py
541
python
en
code
0
github-code
90
73488695976
def isPrime(number): for i in range(2,number-1): if number % i == 0: return False return True def get_first_n_primes(n): primes = [] numbers = range(2, n) for number in numbers: if isPrime(number): primes.append(number) return primes def goldbach(n): goldbach = [] primes = get_first_n_primes(n) f...
tdhris/HackBulgaria
Week0/goldbach/solution.py
solution.py
py
658
python
en
code
0
github-code
90
28113297350
import os import platform import logging import logging.config from datetime import datetime class SetupInfo: __slots__ = ( 'timestamp', 'extra_data', 'log', 'os', 'input', 'output', 'path', 'auto', 'hash', 'strict' ) def __i...
MrOctopus/pyWhatsUpp
pyWhatsUpp/setup.py
setup.py
py
2,764
python
en
code
11
github-code
90
35305891979
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Sat Nov 17 09:30:56 2018 @author: beidan This file is for extracting certain sessions (e.g. ITEM 2A, ITEM 1.A only) from orginial files see part 4-6 """ # In[0]: Import all the classes from __future__ import print_function import csv, json import time im...
huangbeidan/MyMainAchievement
Capstone- Information Processing Pipeline/10Q_extractor.py
10Q_extractor.py
py
9,501
python
en
code
1
github-code
90
31591182285
from player import Player from board import Board class Game(object): def __init__(self): """ Initializes the Board of size 3x3 """ self.board = Board() self.p1 = Player('x') self.p2 = Player('o') self.win = 0 #print(self.board) def player_play(...
UNR-Teaching/class-activity-3-kuznetsov-talavera2
game.py
game.py
py
1,544
python
en
code
0
github-code
90
5384290295
# -*- coding: iso-8859-1 -*- import os import re import qm3.constants import qm3.engines class run_single( object ): def __init__( self, mol, sele, link = [] ): self.exe = "bash r.dftd4" self._ce = qm3.constants.H2J self._cg = self._ce / qm3.constants.A0 self.sel = sorted( sele )...
sergio-marti/qm3
qm3/engines/dftd4.py
dftd4.py
py
5,690
python
en
code
11
github-code
90
73358797738
#!/usr/bin/env python # -*- coding:utf-8 -*- #author by Elijah_Yi from numpy import * from PIL import Image from compiler.ast import flatten import xlsxwriter import numpy as np def ImageToMatrix(filename): # load image im = Image.open(filename) width,height = im.size im = im.convert("L") data =...
309yt/DDAsrc-2
DDAsrc/pictomat.py
pictomat.py
py
1,932
python
en
code
0
github-code
90
25588503774
import argparse import json import logging import statistics import time from typing import Any, Dict, List from dateutil import parser import requests class Prometheus: """Objects which holds the start time, end time and query URL.""" def __init__( self, url: str, start: str, ...
grpc/grpc
tools/run_tests/performance/prometheus.py
prometheus.py
py
10,347
python
en
code
39,468
github-code
90
18206226489
# -*- coding: utf-8 -*- import sys import numpy as np N,S, *A = map(int, sys.stdin.buffer.read().split()) mod = 998244353 A = sorted(A) answer = np.zeros(3002).astype(np.int64) power2 = 1 total = 0 for a in A: total = min(3001,a+total) answer[a+1:total+1] = (2*answer[a+1:total+1]+answer[1:total-a+1])%mod answe...
Aasthaengg/IBMdataset
Python_codes/p02662/s926866879.py
s926866879.py
py
431
python
en
code
0
github-code
90
73009663658
import requests from bs4 import BeautifulSoup import time,datetime f=open("E:\OneDrive - IIT Delhi\CODE\Deadly_Python\Web Scraper\IPL.txt","r+") x = datetime.datetime.now() daate = x.strftime("%x") taime = x.strftime("%X") # Fetch the HTML Content url = 'https://www.cricbuzz.com/live-cricket-scores/69568/gt-vs-mi-qu...
logxdx/deadly_python
Web Scraper/Live_scores.py
Live_scores.py
py
1,454
python
en
code
0
github-code
90
18216483459
MOD = 998244353 MAX = 510000 fac = [1,1] # factorial finv = [1,1] # inverse of factorial inv = [None, 1] # inverse def comb_init(): for i in range(2, MAX): fac.append(fac[i-1] * i % MOD) inv.append(MOD - inv[MOD % i] * (MOD//i) % MOD) finv.append(finv[i-1] * inv[i] % MOD) def inverse_mod(a): """ Calculate inv...
Aasthaengg/IBMdataset
Python_codes/p02685/s663837991.py
s663837991.py
py
750
python
en
code
0
github-code
90
22017227419
import numpy as np import matplotlib.pyplot as plt import matplotlib as mpl from mpl_toolkits.mplot3d import Axes3D mpl.rcParams['text.usetex'] = True mpl.rcParams['text.latex.preamble'] = [r'\usepackage{amsmath}'] #for \text command def load_csv(loc): data = np.genfromtxt(loc, delimiter=',', dtype=flo...
mhubii/nmpc_pattern_generator
plot/plot_pattern.py
plot_pattern.py
py
3,178
python
en
code
2
github-code
90
27089674338
from spack import * class Cgal(CMakePackage): """The Computational Geometry Algorithms Library (CGAL) is a C++ library that aims to provide easy access to efficient and reliable algorithms in computational geometry. CGAL is used in various areas needing geometric computation, such as geographic inform...
matzke1/spack
var/spack/repos/builtin/packages/cgal/package.py
package.py
py
2,994
python
en
code
2
github-code
90
74337123496
import gzip import json import os from datetime import datetime from django.conf import settings from django.contrib.gis.db import models from django.db.models.signals import post_save from django.dispatch import receiver from django.utils.timezone import make_aware from django.utils.translation import ugettext_lazy a...
kartoza/IGRAC-WellAndMonitoringDatabase
models/well.py
well.py
py
11,685
python
en
code
2
github-code
90
10085194415
#!/usr/bin/env python3 """ data file read in data """ from typing import Tuple, Any import pandas as pd import tensorflow as tf from loguru import logger from utils import file_path_relative import numpy as np from transformers import DistilBertTokenizer NUM_ROWS_TRAIN: int = 15000 TEST_RATIO: float = 0.2 def _run...
jschmidtnj/cs584
final_project/code/src/data_attention.py
data_attention.py
py
2,617
python
en
code
0
github-code
90
33652244147
import abc import dataclasses from typing import Any, ClassVar, Collection, Dict, Optional, Protocol, Type import yarl from graphql import DocumentNode, OperationType from ephyr_control.instance.constants import EphyrApiPaths try: import gql.transport.requests except ImportError: raise RuntimeError("You need...
ALLATRA-IT/ephyr-control
ephyr_control/instance/protocols.py
protocols.py
py
6,179
python
en
code
0
github-code
90
43662594863
""" Name: PdfExporter Authors: Jonathan CASSAING Tool for parsing and extracting PDF file content """ from pdfextractor import create_app app = create_app() if __name__ == "__main__": print("PdfExtractor v1.0.0") print("Server started!") from waitress import serve serve(app, host="0.0.0.0", port=500...
snook9/pdf_extractor
main.py
main.py
py
323
python
en
code
1
github-code
90
19160073591
#!/usr/bin/env python3 # -*- coding: utf-8 -*- #Infomation: Script to brute bitcoin addresses # often the script will stop running, so I have set it up with a cron job which executes it every minute. from bit import Key import os import json import time import ecdsa import hashlib import requests import binascii impor...
loke5555/456
bitcoin_finder.py
bitcoin_finder.py
py
3,449
python
en
code
2
github-code
90
6175750098
# 1. Create a Vehicle class with max_speed and mileage instance attributes class Venicle: def __init__(self, max_speed, mile): self.max_speed = max_speed self.mile = mile # 2. Create a child class Bus that will inherit all of the variables and methods of the Vehicle class and will have seating_capa...
SerhiiDemydov/HomeWork
HW4/HW4_class.py
HW4_class.py
py
1,943
python
en
code
0
github-code
90
26288040815
def populate(apps, schema_editor): question_fields = [ ] choice_fields = [ ] direction_fields = [ ] dependency_fields = [ ] comment_fields = [ ] abort_fields = [ ] reference_fields = [ ] exit_fields = [ ] law_fi...
havingto/lawroby
employment/migrate skeleton.py
migrate skeleton.py
py
3,398
python
en
code
0
github-code
90
33425829537
import sys sys.stdin = open("input.txt", 'rt') if __name__ == "__main__": x = int(input()) case = list(map(int, input().split())) reverse_case = case[::-1] increase = [1 for i in range(x)] # 가장 긴 증가하는 부분 수열 decrease = [1 for i in range(x)] # 가장 긴 감소하는 부분 수열(reversed) for i in range(x): ...
21CatchStudy/minhyeok_repo
DP/beakjoon/가장 긴 바이토닉 부분수열.py
가장 긴 바이토닉 부분수열.py
py
1,206
python
en
code
0
github-code
90
32280045557
from pycocotools.coco import COCO import pandas as pd import torch # function iterates ofver all ocurrences of a person and returns relevant data row by row def get_meta(coco): ids = list(coco.imgs.keys()) for i, img_id in enumerate(ids): img_meta = coco.imgs[img_id] ann_ids = coco.getAnnIds(i...
eliotwalt/vi
data/compute_mean_pose.py
compute_mean_pose.py
py
2,473
python
en
code
0
github-code
90
73576201897
# 33. Search in Rotated Sorted Array # https://leetcode.com/problems/search-in-rotated-sorted-array/description/ class Solution(object): def search(self, nums, target): """ :type nums: List[int] :type target: int :rtype: int """ lo = 0 hi = len(nums) - 1 ...
algorizum/problem-solving
iamminji/leetcode/medium/search_in_rotated_sorted_array.py
search_in_rotated_sorted_array.py
py
863
python
en
code
4
github-code
90
26965557817
import logging from biweeklybudget.models.transaction import Transaction from biweeklybudget.models.txn_reconcile import TxnReconcile logger = logging.getLogger(__name__) def do_budget_transfer(db_sess, txn_date, amount, account, from_budget, to_budget, notes=None): """ Transfer a giv...
jantman/biweeklybudget
biweeklybudget/models/utils.py
utils.py
py
2,205
python
en
code
87
github-code
90
11402237251
import numpy as np import matplotlib.pyplot as plt import h5py import cv2 ####################################################################### # Loading data tables from H5py files ####################################################################### h5f = h5py.File('./dataset/data_train_images.h5', 'r') train_i...
aurianworld/data_challenge
src/utilities/Loading_data_example.py
Loading_data_example.py
py
1,766
python
en
code
1
github-code
90
17983712379
def fact(n): val = 1 for i in range(2, n + 1): val *= i val %= 10**9 + 7 return val x, y = map(int,input().split()) ans = 1 if abs(x-y) > 1: print(0) elif x == y: print((fact(x)**2 *2) % (10**9+7)) else: print((fact(x) * fact(y)) % (10**9+7))
Aasthaengg/IBMdataset
Python_codes/p03681/s388494977.py
s388494977.py
py
287
python
en
code
0
github-code
90
31218073750
#%matplotlib nbagg import matplotlib.pyplot as plt import matplotlib.animation as animation import numpy as np import random import matplotlib.patches as patches import math fig, ax = plt.subplots() ims = [] x = [] y1 = [] y2 = [] for i in range(3000): x.append(random.uniform(-1, 1)) y1.append(random.unifo...
RuoAndo/cit
riron/anime-test.py
anime-test.py
py
644
python
en
code
0
github-code
90
10490986297
""" moduł odpowiedzialny za obsługę wykresu """ import pyqtgraph as pg from pyqtgraph.Qt import QtCore, QtGui import numpy as np def create_new_graph(obj): """ funkcja tworząca widget zawierający wszystkie elementy wykresów """ # inicjalizacja okna obługującego wykresy obj.graphWidget = pg.PlotWi...
Mladog/Masters
app/new_graph.py
new_graph.py
py
2,521
python
pl
code
0
github-code
90
73820237737
class FileSystem: def __init__(self): self.fs = {} def create(self, path: str, value: int) -> bool: directories = path.split('/') size = len(directories) current = self.fs print(directories) for idx in range(1, size - 1): directory = directories[idx...
HarrrrryLi/LeetCode
1166. Design File System/Python 3/solution.py
solution.py
py
941
python
en
code
0
github-code
90
32213492270
import kb_datebase as db import kb_gui as gui version = "0.5" tabel_name = 'kassenbuch' file_name = 'koschis' con = db.sqli(file_name, tabel_name) app = gui.main_window(version,con, tabel_name) app.set_kostenstellen() app.set_steuersaetze() app.CreateStyle() app.AddTopFrame() app.AddInput() app.AddTableFrame() app.ma...
Akron79/Kassenbuch
Kassenbuch.py
Kassenbuch.py
py
500
python
en
code
0
github-code
90
1250403132
import re import dateparser import tldextract import scrapy from tpdb.BaseSceneScraper import BaseSceneScraper class WoodmanCastingXScraper(BaseSceneScraper): name = 'WoodmanCastingX' network = 'Karak Ltd' parent = 'Woodman Casting X' start_urls = [ 'https://www.woodmancastingx.com', ] ...
SFTEAM/scrapers
scenes/siteWoodmanCastingX.py
siteWoodmanCastingX.py
py
5,557
python
en
code
null
github-code
90
10532272502
from odoo import tools from odoo import api, fields, models class InventorySpeedReport(models.Model): _name = "inventory.speed.report" _description = "Reporte Inventarios Veloz" _auto = False categ_id = fields.Many2one('product.category', string=u'Categoría', readonly=True) product_id = fields.Man...
JoryWeb/illuminati
poi_x_toyosa/report/inventory_speed_report.py
inventory_speed_report.py
py
1,725
python
en
code
1
github-code
90
604130704
# 정수 X에 사용할 수 있는 연산은 다음과 같이 세 가지 이다. # 1. X가 3으로 나누어 떨어지면, 3으로 나눈다. # 2. X가 2로 나누어 떨어지면, 2로 나눈다. # 3. 1을 뺀다. # 정수 N이 주어졌을 때, # 위와 같은 연산 세 개를 적절히 사용해서 1을 만들려고 한다. # 연산을 사용하는 횟수의 최솟값을 출력하시오. # ex ) 10 -> 9 -> 3 -> 1 => O # ex ) 10 -> 5 -> 4 -> 2 -> 1 => X # 문제 해결 방법 # 동적 계획법으로 해결하기 위해, 연산횟수를 저장한 리스트를 만든다. # N이 3으로 나누어...
clown924/coding_test_algorithm
coding_test_algorithm/Dynamic_Programming/Dynamic_Programming/pb1463_1로 만들기.py
pb1463_1로 만들기.py
py
1,517
python
ko
code
0
github-code
90
17999510590
# https://www.youtube.com/watch?v=gDLjaMF15mk&list=PLCC34OHNcOtpz7PJQ7Tv7hqFBP_xDDjqg&index=49 from kivymd.app import MDApp from kivy.lang import Builder class Codemy_Tutorial_App(MDApp): def build(self): self.theme_cls.theme_style = 'Dark' self.theme_cls.primary_palette = 'BlueGray' ret...
LivioAlvarenga/Tutoriais_Kivy_KivyMD
Tutorial_Kivy_Codemy/codemy_kivyMd_36_Image_Swiper.py
codemy_kivyMd_36_Image_Swiper.py
py
1,132
python
en
code
1
github-code
90
72889406697
import allure from selenium import webdriver from calculator.CalculatorPage import CalculatorPage @allure.epic("Калькулятор") @allure.id("CALCULATOR-1") @allure.story("Сравнение ФР с ОР") @allure.feature("EXPECTATION") @allure.title("Проверка коректной работы таймера") @allure.description("Таймер ожидает '45 секунд', ...
Andrei196/beta_aqa_tolochko
Les7/calculator_test.py
calculator_test.py
py
784
python
ru
code
0
github-code
90
41697816103
import random #to choose randomly def roll_dice(): dice_total = random.randint(1, 6) + random.randint(1, 6) return dice_total player1 = input("Enter player 1's name: ") player2 = input("Enter player 2's name: ") roll1 = roll_dice() roll2 = roll_dice() print(player1, 'rolled', roll1) print(player2, 'rolled'...
Mennaawalidd/Simple_Codes
python proj/Dice_Game.py
Dice_Game.py
py
487
python
en
code
0
github-code
90
19662046417
#!/usr/bin/python3 """ - A Python script that: - takes in a URL - sends a request to the URL - displays the value of the X-Request-Id variable found in the header of the response - Must use the packages urllib and sys - Not allowed to import packages other than urllib and sys - The value of this variable i...
houdinipapi/Huncho
alx-higher_level_programming/0x11-python-network_1/1-hbtn_header.py
1-hbtn_header.py
py
680
python
en
code
0
github-code
90
13808722090
import json import logging import re from dataclasses import dataclass from typing import Any from ..github import GithubClientError, get_github_client from ..nix import merge_check from ..settings import Settings from .http_response import HttpResponse logger = logging.getLogger(__name__) @dataclass class Issue: ...
NixOS/nixpkgs-merge-bot
nixpkgs_merge_bot/webhook/issue_comment.py
issue_comment.py
py
3,272
python
en
code
13
github-code
90
25290244650
import io import os import shutil import subprocess from itertools import islice from operator import itemgetter from pimlico.core.modules.execute import ModuleExecutionError import numpy as np from pimlico.core.modules.base import BaseModuleExecutor from pimlico.utils.progress import get_progress_bar from pimlico.u...
markgw/pimlico
src/python/pimlico/modules/embeddings/glove/execute.py
execute.py
py
8,119
python
en
code
6
github-code
90
38508554871
import PyPDF2 as PP def cut(file1,initpage,finalpage): '''This function cuts pages from a pdf''' # creating a shell for the new file cutpdfobj = PP.PdfFileWriter() # opening the pdf pdf1File = open(file1, 'rb') # reading the pdf pdf1Reader = PP.PdfFileReader(pdf1File) ...
Raydrian/PDFeditor
CutPDF.py
CutPDF.py
py
992
python
en
code
0
github-code
90
30120115436
# Declaring list of items names = ['John', 'Bob', 'Mosh', 'Sarah', 'Mary'] # Updating values names[0] = 'Samuel' print(names) # Write a program to find the largest number in a list numbers = [1, 3, 4, 67, 32, 45, 90, 87] Max = numbers[0] for i in numbers: if i > Max: Max = i print(f'Largest number is: {Max...
blackcode-creator/Introduction-to-python
List/List.py
List.py
py
324
python
en
code
0
github-code
90
1288178806
from __future__ import absolute_import from __future__ import division from __future__ import print_function import os import random import argparse import sys import numpy as np import tensorflow as tf import input_data_train as input_data import model import h5py from tensorflow.python.platform import gfile FLAG...
liyongze/lstm_speaker_verification
train.py
train.py
py
8,646
python
en
code
35
github-code
90
34290591827
## written by xiongbiao ## date 2020-5-29 ''' 给定 n 个非负整数,用来表示柱状图中各个柱子的高度。每个柱子彼此相邻,且宽度为 1 。 求在该柱状图中,能够勾勒出来的矩形的最大面积。 ''' class Solution(object): ''' 单调栈 ''' def largestRectangleArea(self, heights): """ :type heights: List[int] :rtype: int """ if len(heights) == 0: ...
xb2342996/Algorithm-and-Data-Structure
LeetCode_vII/Stack/84. 柱状图中最大的矩形.py
84. 柱状图中最大的矩形.py
py
3,529
python
en
code
0
github-code
90
22259066572
def comb(f, r): num = 1 den = 1 for i in range(f, f - r, -1): num *= i for i in range(r, 0, -1): den *= i return int(num / den) def solution(n): if n == 1: answer = 1 elif n == 2: answer = 2 else: if n % 2 == 0: cnt = 2 an...
JisungKim94/CodingTest
Programmers/고득점 Kit/lessons_12900_2xn타일링_조합을사용하면int_Type_overflow나서못품.py
lessons_12900_2xn타일링_조합을사용하면int_Type_overflow나서못품.py
py
880
python
en
code
0
github-code
90
5509068566
import csv with open('business.csv', 'r') as businessDataFile: count = 0 businessReader = csv.reader(businessDataFile) businessfile = open('businessGT3.csv', "w", newline='') writer = csv.writer(businessfile,delimiter=',', quoting = csv.QUOTE_ALL) #writer = csv.writer(user50file, delimiter=' ', quotechar='"...
augaonkar/Yelp-Loation-Mining-Project
Data and Script files/businessGT3.py
businessGT3.py
py
533
python
en
code
1
github-code
90
32001544481
import requests, base64 from requests_toolbelt.multipart.encoder import MultipartEncoder import pickle from . import models import json import time # 将图片上传到api请求解析 def upload2api(file_path): # 所用参数赋值 type_num = 504205 url = 'https://api.yimei.ai/v1/api/face/analysis/' + str(type_num) client_id = "f0dbe...
WHU-gentle/Mirror
Face/utils.py
utils.py
py
7,810
python
en
code
1
github-code
90
14296585787
from PyQt5.QtCore import ( QSize, Qt ) from PyQt5.QtWidgets import ( QGridLayout, QGroupBox, QHBoxLayout, QLabel, QPushButton, QRadioButton, QSizePolicy, QTableWidget, QTableWidgetItem, QVBoxLayout, QAbstractItemView, QLineEdit ) class TagSubmitPluginOpt...
metabrainz/picard-plugins
plugins/submit_folksonomy_tags/ui_config.py
ui_config.py
py
7,543
python
en
code
130
github-code
90
26444042056
import rospy import tf import geodesy.utm from novatel_msgs.msg import BESTPOS, CORRIMUDATA, INSCOV, INSPVAX from sensor_msgs.msg import Imu, NavSatFix, NavSatStatus from nav_msgs.msg import Odometry from geometry_msgs.msg import Quaternion, Point, Pose, Twist from math import radians, pow # FIXED COVARIANCES # TODO...
uupks/SensorFusion
src/final_project/src/novatel_span_driver/novatel_span_driver/src/novatel_span_driver/publisher.py
publisher.py
py
10,278
python
en
code
52
github-code
90
11386344651
import time start = time.time() def Square_root_convergents(numerator,denominator,count): for x in range(1, 1001): numerator += 2 * denominator denominator = numerator - denominator if len(str(denominator)) < len(str(numerator)): count += 1 print(count) end = time.time()...
NewtonFractal/Project-Euler-57
Project Euler 57.py
Project Euler 57.py
py
377
python
en
code
0
github-code
90