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
6747544921
from sender import * phone_number = str(input("Enter Your Phone Number(Without First Zero), eg: 9123456789 : ")) number_of_sms = int(input("Number Of SMS, eg: 20 : ")) sent_sms = 0 end = False while number_of_sms: for i in range(len(All)): resp = All[i][1].send(phone_number) if resp["code"] == 200:...
amirmnoohi/SMS-bomber
main.py
main.py
py
632
python
en
code
0
github-code
13
30700095884
import numpy as np import astropy from astropy.io import fits import matplotlib import matplotlib.pyplot as plt from astropy.nddata import CCDData import ccdproc import astropy.units as u from astropy.modeling import models from ccdproc import Combiner import m2fs_process as m2fs import dill as pickle directory='/nfs/...
mgwalkergit/spec
m2fs_apertures_initialize.py
m2fs_apertures_initialize.py
py
2,693
python
en
code
0
github-code
13
14277672686
# ##### BEGIN GPL LICENSE BLOCK ##### # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either version 3 # of the License, or (at your option) any later version. # # This program is distrib...
Tilapiatsu/blender-custom_config
scripts/addon_library/local/slcad_transform/snap_context/drawing.py
drawing.py
py
13,581
python
en
code
5
github-code
13
72523601297
## ## A keyboard layout analyzer , give it a file with all the keys and their relative pos ## The script will calculate how much you need to move your fingers in order to write words ## # IMPORTS AND FILE READING # import sys keylayfile = sys.argv[1] testwordfile = sys.argv[2] testWords = open(testwordfile) klay = ope...
KarlssonLucas/keyboard-analyzer
KeyboardAnalyzer.py
KeyboardAnalyzer.py
py
1,605
python
en
code
0
github-code
13
10952536972
# -*- coding: utf-8 -*- """ Created on Wed Jul 22 17:45:57 2020 @author: lenovo """ from sparql import get_dataframe from preprocessing import find_combinations,delete_null,sort_properties,correlation import pandas as pd import configparser import os CONFIG_FILE = "config.cfg" if os.path.exists(os.path...
RohanYim/Entity-Reconciliation
main.py
main.py
py
1,998
python
en
code
0
github-code
13
21293596179
inherited_money = float(input()) final_year = int(input()) needed_money = 0 for year in range(1800, final_year + 1): if year % 2 == 0: needed_money += 12000 else: needed_money += 12000 + 50 * (year - 1800 + 18) if needed_money <= inherited_money: left_money = inherited_money - needed_mone...
SJeliazkova/SoftUni
Programming-Basic-Python/Exercises-and-Labs/For_Loop_More Exercises/01.Back_To_The_Past.py
01.Back_To_The_Past.py
py
550
python
en
code
0
github-code
13
8984328448
import telebot import os from environs import Env from datetime import datetime import aio_parser as hh from Task import Task import markups # read envoirments variables env = Env() env.read_env() # setup main variables bot = telebot.TeleBot(env('TOKEN')) task = Task() # handlers @bot.message_handler(commands=[...
eddie-nero/hhkeys
bot.py
bot.py
py
3,798
python
ru
code
0
github-code
13
33454556442
import random class Grafo: # Construtor que recebe o número de vértices e inicia o vetor de adjacentes def __init__(self, V): self.V = V self.adj = [[] for i in range(V)] self.estado = ['S' for i in range(V)] pacienteZero = random.randint(0, V - 1) self.estado[pacient...
matheus-reyes/AEDIIGrafos
EP5/código/Grafo.py
Grafo.py
py
3,664
python
pt
code
3
github-code
13
2212925840
# Two opposite co -ordiantes of rectangle are given and check whether two triangle overlap each other or not. """Input: L1=(0,2) R1=(1,1) L2=(-2,-3) R2=(0,2) Output: 0 """ def is_overlap(l1, r1 , l2, r2): if l1[0] > r2[0] or r1[0] < l2[0]: return 0 if l1[1] < r2[1] or r1[1] > l2[1]: ...
1809mayur/6Companies30DayChallenge
goldman/2.py
2.py
py
649
python
en
code
0
github-code
13
21410990578
from collections import OrderedDict class LRUCache: def __init__(self, capacity: int): """Solution 1 [MEMO] Directly use OrderedDict move_to_end and popitem """ self.capacity = capacity self.cache = OrderedDict() def get(self, key: int) -> int: if key not in se...
stevenjst0121/leetcode
146_lru_cache.py
146_lru_cache.py
py
2,948
python
en
code
0
github-code
13
10759058533
from pymongo import MongoClient from bson.code import Code import re #function to connect to the MongoDB def get_db(db_name): client = MongoClient('localhost:27017') db = client[db_name] return db #function to index data in the database (multiple single field indexes) def create_indices(db...
tdraebing/Data_Analyst_Nanodegree-Project3
src/Project/db_ops.py
db_ops.py
py
4,295
python
en
code
0
github-code
13
73677704659
import numpy as np from gensim.models import KeyedVectors import gensim import random import read_config import sys import glob import os import json from gensim.models import Word2Vec from scipy import stats import sys import math def word_assoc(w,A,B,embedding): """ Calculates difference in mean cosine simil...
hljames/compare-embedding-bias
weat.py
weat.py
py
4,704
python
en
code
13
github-code
13
24662487723
# TODO: make a 2nd run for the other bank stand import pyautogui as py import time import random import sys import tkinter from tkinter import messagebox import ctypes py.FAILSAFE = True # Variables for randomly clicking a tab (inv, skills, equip, etc.) xleft = 1580 xright = 1890 yup = 523 ydown = ...
ryanmolin/MMORPGBots
Prayer - Altar Run.py
Prayer - Altar Run.py
py
6,077
python
en
code
0
github-code
13
29165098394
import matplotlib.pyplot as plt import numpy as np from mpl_toolkits.mplot3d import Axes3D from functools import cache from matplotlib import style from concurrent.futures import ProcessPoolExecutor from datetime import datetime import time from math import * import function as func style.use('dark_background') def m...
nobody48sheldor/fuseeinator2.0
position_calculation/waterrocket.py
waterrocket.py
py
3,600
python
en
code
1
github-code
13
72629944979
### IMPORTING PACKAGES import pandas as pd import numpy as np from math import ceil # Read excel from file locations path1 = 'C:\\Users\\Harshit Jha\\Downloads\\Cointab - Asessment\\SUBMISSION\\Assignment details\\Company X - Order Report.xlsx' path2 = 'C:\\Users\\Harshit Jha\\Downloads\\Cointab - Asessment\\SUBMISS...
jayesh-jha/courier_charges_analysis
analysis.py
analysis.py
py
8,023
python
en
code
0
github-code
13
34016301075
# test locally with: docker compose run --rm airflow-cli dags test atd_executive_dashboard_expenses_revenue import os from datetime import datetime, timedelta from airflow.decorators import task from airflow.models import DAG from airflow.operators.docker_operator import DockerOperator from utils.onepassword import...
cityofaustin/atd-airflow
dags/atd_executive_dashboard_expenses_revenue.py
atd_executive_dashboard_expenses_revenue.py
py
3,420
python
en
code
2
github-code
13
70501394898
larger_set = [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20 ] for element in larger_set: element = str(element) smaller_set = ['a','b','c','d','e'] # So, det_set refers to the determining set. that's the set that decides how big the partitions will be. # so if we do a tenth of the det_set, in this case, we'l...
vanshcsingh/indic-lang-development
tests/reiterating_partitioner.py
reiterating_partitioner.py
py
2,015
python
en
code
0
github-code
13
14279052656
#! /usr/bin/python3 """ The tao of unix programming, Python-adapted from github:globalcitizen/taoup Quotes via: https://raw.githubusercontent.com/globalcitizen/taoup/master/taoup """ import itertools import os import random import re import shutil import sys import textwrap TAOFILE = os.path.expanduser('~/.taoup.txt...
tilboerner/pytaoup
taoup.py
taoup.py
py
3,770
python
en
code
1
github-code
13
21311912579
# Python script for decompressing the baserom file. import sys # Address of the first file in the overlay table. firstFileAddr = None # Sizes of all the decompressed files combined. rawSize = None # List of files to skip. skipFiles = [] # List of all addresses for the files. fileAddrs = [] # List of all file sizes...
Fluvian/mnsg
tools/decompress.py
decompress.py
py
8,878
python
en
code
26
github-code
13
14938933858
from deap import base, algorithms, creator, tools from getFitness import getFitness import random import numpy as np import libElitism def geneticAlgorithm(X, y, target, crossover, selection, population, xprob, mutationprob, generations,elitism,real, *args, **kwargs): if (target == "a"): creator.create("Fi...
marcosvporto/ga-wrapper
Scripts/geneticAlgorithm.py
geneticAlgorithm.py
py
2,985
python
en
code
0
github-code
13
73389472337
import re import spacy class Filter: def __init__(self): self.nlp = spacy.load('en_core_web_sm') self.ents = [] pass def remove_postal_codes(self, text): return re.sub("[1-9]{1}[0-9]{2}\\s{0,1}[0-9]{3}$", "<POSTAL INDEX NUMBER>", text) def remove_emails(self, text): ...
theanmolsharma/blurked-backend
filter.py
filter.py
py
2,912
python
en
code
0
github-code
13
38256211822
import unittest from karabo.bound import Configurator, Hash, PythonDevice from ..ImageApplyMask import ImageApplyMask class ImageMask_TestCase(unittest.TestCase): def test_proc(self): proc = Configurator(PythonDevice).create("ImageApplyMask", Hash( "Logger.priority", "WARN", "dev...
European-XFEL/imageProcessor
src/imageProcessor/tests/image_mask_test.py
image_mask_test.py
py
417
python
en
code
0
github-code
13
34552482446
# coding=UTF-8 # importando os outros arquivos que complementam o código from intermediario import * from prepara_tabela import * from prepara_treino_teste import * from relatorio_executions import * from datetime import datetime class Principal(object): def __init__(self, c, gamma, windowSize, windowPosition): ...
Jallyssonmr/DollyTDC
TechDay/MachineLearning/Principal.py
Principal.py
py
3,575
python
pt
code
0
github-code
13
6948587554
from typing import * from collections import defaultdict class Solution: def __init__(self): self.max_time = 0 self.map1 = defaultdict(lambda: []) def numOfMinutes(self, n: int, headID: int, manager: List[int], informTime: List[int]) -> int: for i, m in enumerate(manager): ...
Xiaoctw/LeetCode1_python
搜索_回溯/通知所有员工所需的时间_1376.py
通知所有员工所需的时间_1376.py
py
883
python
en
code
0
github-code
13
19750878488
""" kryptoxin VBA output module. This module contains functions for the visual basic outputs """ from kryptoxin.core.toxin import Toxin from kryptoxin.core.constants import JINJA_TEMPLATES_VBA from kryptoxin.core.constants import JINJA_TEMPLATES_ACTSDIR from kryptoxin.core.constants import JINA_TEMPLATES_FEXT, LANG_VBA...
e3prom/kryptoxin
kryptoxin/output/vba.py
vba.py
py
1,677
python
en
code
4
github-code
13
35711122036
#!/usr/bin/env python # -*- coding: utf-8 -*- # 淘宝/天猫秒杀 import datetime import time from selenium import webdriver # 登陆淘宝 def login(browser): # 打开淘宝登录页,并进行扫码登录 browser.get("https://www.taobao.com/") time.sleep(3) if browser.find_element_by_link_text("亲,请登录"): browser.find_element_by_link_tex...
jokereven/zjing-tools
spike/spike/spike.py
spike.py
py
1,751
python
en
code
1
github-code
13
12317125469
#Part 1# import requests import pandas as pd import numpy as np import os get_resp = requests.get("http://3.85.131.173:8000/random_company") get_resp.text fake_html = get_resp.text.split("\n") fake_html n = 50 df = pd.DataFrame(index = np.arange(n), columns = ["Name", "Purpose"]) #filtering on Name and Purpose, 50 tim...
Agatheee/FE595_Assignment2
NLP Assignment.py
NLP Assignment.py
py
2,563
python
en
code
0
github-code
13
20814434660
import requests, json import networkx as nx from itertools import permutations # Google API URL url = 'https://maps.googleapis.com/maps/api/distancematrix/json?' # Google Dev API key api_key = 'AIzaSyBfYHLkwRPSbY1MucNJL30FtJo7Er-kXTY' # Helper methods def next_permutation(arr): # Find non-increasing suffix ...
dawn-ds/KnoxPot-Guru
flask_potholes/flask_pot/routing.py
routing.py
py
4,107
python
en
code
0
github-code
13
22677079512
import random rock = ''' _______ ---' ____) (_____) (_____) (____) ---.__(___) ''' paper = ''' _______ ---' ____)____ ______) _______) _______) ---.__________) ''' scissors = ''' _______ ---' ____)____ ______) __________) (____) ...
masthanshaik7/Rock-Paper-Scissors
Rock_Paper_Scissors.py
Rock_Paper_Scissors.py
py
1,060
python
en
code
0
github-code
13
42242719003
#This file contains the basic functions for sound manipulation: # Sound(note, duration) # get_key(value, dictionary) # get_song(file, number) # make_music_sheet(list_notes, invert, transpos, amount_of_transposition=0) # get_all_songs_titles(file) # transpose(list_of_notes, transposition): # transposenote(...
PaulZaman/MusikReader
Main.py
Main.py
py
16,213
python
en
code
0
github-code
13
34908358686
import yaml data = { 'key1': ['list1', 'list2', 'list3'], 'key2': 234, 'key3': { 'key31': '€', 'key32': '†' } } with open('file.yaml', 'w') as fh: yaml.dump(data, fh, default_flow_style=False, allow_unicode=True) with open('file.yaml', 'r') as fh: data_yml = yaml.load_all(fh) ...
YuKars1996/Applications
Lesson_2/task_2_3.py
task_2_3.py
py
434
python
en
code
0
github-code
13
34747313762
import time import pymongo import queue from dateutil import parser from queue import Queue from helpers import OANDA from helpers.misc import ( load_config, seconds_to_human, seconds_to_us, ignore_keyboard_interrupt, create_logger, ) from helpers.ipc import expose_telemetry, telemetry_format, Tele...
declanomara/Tidepool
DataGatherer.py
DataGatherer.py
py
11,050
python
en
code
1
github-code
13
15881534177
import os import sys from peano.db.connect import get_db sys.path.append(os.path.join(os.path.dirname(__file__), "..")) def main(): db = get_db() total_count = db.images.aggregate( {"_id": "total", "count": {"$sum": {"$toInt": 1}}} ) if input(f"{total_count['count']}件削除しますか? (...
microwaver17/peano
peano_backend/maintenance/db_del_test.py
db_del_test.py
py
483
python
en
code
1
github-code
13
145956744
import tweepy consumer_key = 'auHo5WKYN4jxzMQkj0D5MRmp7' consumer_secret = 'tIg8lPxREu6U3FGnM5YLyJwS51os0aDN4qjMxZ4e3n6hFjyJJP' key = '1302252892359815169-wuv0kpE41P78thQbbc7UKCC0I1yjvb' secret = 'LqHrNzQZG7Je84W8F3b6ekiPuhEKTKILNQYsN3JFBCar8' auth = tweepy.OAuthHandler(consumer_key, consumer_secret) auth.s...
DhanooshTamizh/Twitter-Bot
bot.py
bot.py
py
438
python
en
code
1
github-code
13
21853656875
#!/usr/bin/python3 """ Improvement algorithm complete routing solution. """ import random import pickle import logging import sys import copy import json import sortedcontainers import numpy as np from math import ceil from .baseobjects import Dispatch, Vehicle, Cost, Solution, Utils from .RollOut import RollOut fr...
sauln/ICRI
src/Improvement.py
Improvement.py
py
6,733
python
en
code
1
github-code
13
6482485962
import threading import queue import requests def test_worker(): while True: try: print("LITLITLITLITLITLI") except Exception: print("death") else: print("I cry") class StatusChecker(threading.Thread): """ The thread that will check HTTP statuses...
dggsax/playground
multithreading/webpageexample.py
webpageexample.py
py
1,969
python
en
code
0
github-code
13
12947050922
import torch import torch.nn as nn import torch.nn.functional as F import pandas as pd import numpy as np class SurnameDataset(Dataset): @calssmethod def load_dataset_and_make_vectorizer(cls, surname_csv): surname_df = pd.read_csv(surname_csv) train_surname_df = surname_df[surname_df.split=="tr...
joannekim0420/PythonStudy
NLP/withPytorch/chapter6/6-2.py
6-2.py
py
1,742
python
en
code
0
github-code
13
30883064306
import heapq dx = [-1,0,0,1] dy = [0,-1,1,0] dy = [0,1,-1,0] d = ['u', 'r', 'l', 'd'] def solution(n, m, sx, sy, ex, ey, k): answer = [] q = [] gr = [[0]*(m+1) for i in range(n+1)] heapq.heappush(q,(0,0,sx,sy,[])) while(q): dist, cnt, x, y,dir = heapq.heappop(q) if cnt==k and [x,y]...
weeeeey/programmers
미로 탈출 명령어.py
미로 탈출 명령어.py
py
860
python
en
code
0
github-code
13
70434215699
#!/usr/bin/python3 # Author: Talhah Peerbhai # Email: hello@talhah.tech ''' This file contains the Internet Relay Chat client, it imports the irc library which I made to abstract the IRC protocol wheras this program deals with the GUI and putting it all together. I'm going to try to break it into more files but at the...
tvlpirb/slick-irc
client.py
client.py
py
17,925
python
en
code
1
github-code
13
35534079583
import random from hw5_cards import Card, print_hand # create the Hand with an initial set of cards class Hand: '''a hand for playing card Class Attributes ---------------- None Instance Attributes ------------------- init_card: list a list of cards ''' def __init__(self, ...
10258392511/W21_HW5
hw5_cards_ec2.py
hw5_cards_ec2.py
py
5,859
python
en
code
null
github-code
13
17039312764
from flask import Flask, render_template, request, redirect from flask_sqlalchemy import SQLAlchemy from datetime import datetime app = Flask(__name__) # database setup app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///posts.db' app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = False db = SQLAlchemy(app) """ create the...
TerryLun/Learm-Flask-with-Database-CRUD
app.py
app.py
py
3,009
python
en
code
0
github-code
13
8665953581
#!/usr/bin/env python # coding: utf-8 import parselmouth import numpy as np import streamlit as st import pandas as pd import matplotlib.pyplot as plt st.markdown('# How Analysis Parameters Affect Pitch Measures in Praat') st.markdown('# ') # Load sound into Praat sound = parselmouth.Sound("03-01-01-01-01-01-01.wav...
drfeinberg/PraatPitchParameters
app.py
app.py
py
1,649
python
en
code
0
github-code
13
37535264833
""" This is a config file for the entire application to work""" ORG_EMAIL = "@gmail.com" FROM_EMAIL = "anitoshri" + ORG_EMAIL FROM_PWD = "tobinaruto" SMTP_SERVER = "imap.gmail.com" SMTP_PORT = 993 CONTENT_EMAIL = "animesh.mukherjeei323460@gmail.com" EXCEL_CONFIG = './input_data.xlsx' LOGO ...
Animesh420/automated_email
config.py
config.py
py
339
python
en
code
0
github-code
13
9051930737
import re from const import Url from util import get_requests_response, get_beautiful_soup_object def get_ammo_data(): ammo_caliber_url_list = [] ammo_header = [] ammo_list = {} res = get_requests_response(Url.EN_WIKI, "Ammunition") soup = get_beautiful_soup_object(res, class_name="mw-parser-output...
sai11121209/Discord-EFT-V2-Bot
src/loadData/get_ammo_data.py
get_ammo_data.py
py
2,657
python
en
code
0
github-code
13
43061977521
import torch import torch.nn as nn from .module import Flatten import math cfg = { 'VGG11': [64, 'M', 128, 'M', 256, 256, 'M', 512, 512, 'M', 512, 512, 'M'], 'VGG13': [64, 64, 'M', 128, 128, 'M', 256, 256, 'M', 512, 512, 'M', 512, 512, 'M'], 'VGG16': [64, 64, 'M', 128, 128, 'M', 256, 256, 256, 'M', 512, 512...
psr6275/ensembleDL
models/cifar10.py
cifar10.py
py
3,872
python
en
code
1
github-code
13
20787332804
""" collect.py """ from collections import Counter import matplotlib.pyplot as plt import networkx as nx import sys import time import itertools from TwitterAPI import TwitterAPI import pickle consumer_key = '1rhjWHiOG0xfHf5zkQL3yqjK6' consumer_secret = 'qWxOCAgtZbhgXb8uJelTPE4xdlAm9A9N64vK9XvRTuCv4Stm2w' access_token...
sshenoy6/Online-Social-Network-Analysis
Sentiment Analysis about John Grisham/collect.py
collect.py
py
3,404
python
en
code
0
github-code
13
32010405734
import os import re from flask import request from validate_email import validate_email from werkzeug.utils import secure_filename pass_reguex = "^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)[^\W_]{8,}$" user_reguex = "^[a-zA-Z0-9 _.-]+$" id_reguex = "^[0-9]+$" F_ACTIVE = 'ACTIVE' F_INACTIVE = 'INACTIVE' EMAIL_APP = 'EMAIL_APP' RE...
leonardochica/MGInventarios
utils.py
utils.py
py
3,068
python
es
code
0
github-code
13
26554216669
#Inspired by: https://towardsdatascience.com/inroduction-to-neural-networks-in-python-7e0b422e6c24 import numpy as np import ActivationFunctions as af input = np.array([ [1,0,1], [0,0,1], [0,0,1], [0,0,1], [1,0,1], [1,0,1], [0,0,1]]) output = [1,0,0,0,1,1,0] class NeuralNetwork: ...
MarianoVilla/NeuralPlayground
NeuralPlayground.PythonConsole/BinaryClassifier.py
BinaryClassifier.py
py
1,774
python
en
code
0
github-code
13
13790344211
import utils import sys import time import numpy as np import itertools def vis(dct): l_vals, c_vals = [x[0] for x in dct], [x[1] for x in dct] l_min, l_max, c_min, c_max = int(min(l_vals)), int(max(l_vals)), int(min(c_vals)), int(max(c_vals)) for l in range(l_max - l_min + 1): for c in range(c_ma...
DennisKlpng/AOC_2022
AOC_23.py
AOC_23.py
py
3,137
python
en
code
1
github-code
13
28700831486
import pygame class Player (pygame.sprite.Sprite): def __init__(self): super().__init__() width = 50 height = 50 self.image = pygame.Surface((width, height)) self.image.fill((150, 0, 0)) self.rect = self.image.get_rect() def update(self): ...
DJLeemstar/PythonLessons
MouseMovement.py
MouseMovement.py
py
978
python
en
code
0
github-code
13
71460683537
from flask import jsonify, make_response, request from app_api import app from app_api.function import * if not models.Role.query.all(): role_list = ['admin', 'guest', 'vip'] index = 1 for r in role_list: add_role(r) @app.route('/') def index(): return "Hello, this is API!" @app.route('/ap...
haraleks/RestAPI_xdev
app_api/routes.py
routes.py
py
4,387
python
en
code
0
github-code
13
29530387131
import pika from Djikstra_Path_Calculator import * from Preprocessing import * """ This code should receive as input: -------------- For the djikstra -------------- Topology["Adjacency_Matrix"] (rand_net) Topology["Network_nodes"] (rand_net) Stream_Source_Destination (rand_net) This value has to be regard as it is n...
gabriel-david-orozco/TSN-CNC-CUC-UPC
CNC/Microservices/Preprocessing_microservice/__init__.py
__init__.py
py
9,140
python
en
code
4
github-code
13
37349993668
# (c) Nelen & Schuurmans & Deltares. GPL licensed, see LICENSE.rst # Code copied from openearth # system modules import bisect import datetime from functools import partial import logging # numpy/scipy from numpy import any, all, ma, apply_along_axis, nonzero, array, isnan, logical_or, nan from numpy.ma import fille...
pombredanne/lizard-kml
lizard_kml/jarkus/nc_models.py
nc_models.py
py
17,724
python
en
code
null
github-code
13
16980477185
# Frontend UI from recogScript import * from tkinter import * import PIL.ImageGrab as ImageGrab # from PIL import Image, ImageTk #for jpeg or jpg image class Draw() : def __init__(self, root) : # Initial config values self.root = root # Window title self.root.title("Handwritten ...
ShambaC/Handwritten-Text-Recognition
textrecog_ui.py
textrecog_ui.py
py
4,037
python
en
code
4
github-code
13
27529470893
import pandas as pd import json from itertools import combinations from nltk.corpus import stopwords # Load the dataset df = pd.read_csv('scrubbed.csv') df = df[df['country'] == 'us'].dropna() df['datetime'] = pd.to_datetime(df['datetime'], errors='coerce') duration = 'duration (seconds)' df[duration] = df[duration].a...
BigSuj/cosmic
network_process.py
network_process.py
py
2,563
python
en
code
0
github-code
13
21580977055
import OpenGL.GL as gl from PIL import Image import numpy as np from typing import Union __all__ = ['Texture2D'] class Texture2D: Format = { 1 : gl.GL_RED, 3 : gl.GL_RGB, 4 : gl.GL_RGBA, } InternalFormat = { (1, 'uint8') : gl.GL_R8, # 归一化 (3, 'uint8') : gl.GL_RG...
Liuyvjin/pyqtOpenGL
pyqtOpenGL/items/texture.py
texture.py
py
4,447
python
en
code
0
github-code
13
1448051351
#!/usr/bin/env python # -*- coding:utf-8 -*- # Author: Zhoutao #create_date:2017-02-14-13:48 # Python 3.5 #最先让你选择校区,然后在校区中进行各种视图操作 import os,sys,time,datetime,pickle,json sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) from conf import settings from core.lessons import Lesson class Sc...
248808194/python
M3/kcb/core/schools.py
schools.py
py
3,543
python
en
code
0
github-code
13
74209440976
## Static Imports import os import importlib import gym import gym_everglades import pdb import sys import random import json import pytest import numpy as np from everglades_server import server from everglades_server import generate_map from everglades_server import generate_3dmap # TODO Change this so that it's us...
JLodge99/Everglades-Server
testing/test_pytest.py
test_pytest.py
py
4,174
python
en
code
3
github-code
13
26575475742
class SparseVector: def __init__(self, nums: List[int]): self.tracnum = {} for i in range(0, len(nums)): if nums[i] != 0: self.tracnum[i] = nums[i] # Return the dotProduct of two sparse vectors def dotProduct(self, vec: 'SparseVector') -> int: dot_produ...
ujas09/Leetcode
1570.py
1570.py
py
680
python
en
code
0
github-code
13
18312188478
"""You are going to design a magical calculator with the following functions. • Function that takes input and calculates it’s factorial. (A) • Function that takes input and calculate it’s sum of digits. (B) • Function that takes input and find’s the largest digit in the input. (C) - Implement all the above functions. -...
mohammed1916/Projects
python_basic_concepts/magical_calculator.py
magical_calculator.py
py
1,482
python
en
code
0
github-code
13
28047642805
import matplotlib.pyplot as plt def funkcija(x1,y1,x2,y2): a = (y2-y1)/(x2-x1) b = y1 - a*x1 if b>=0: predznak = "+" else: predznak = "" print("Jednadžba pravca je y = ",round(a,2),"x",predznak, round(b,2)) plt.plot(x1, y1, marker="o", color="blue") plt.plot(x2, y2, mark...
kvilibic/PAF
Vjezbe/Vjezbe1/Zad5.py
Zad5.py
py
950
python
hr
code
0
github-code
13
20654506174
""" Tests pour le module `math.linalg.utils` """ from unittest import TestCase import numpy as np from pytools.math.linalg.utils import produit_scalaire, sum_vectors, gram_schmidt class TestLinAlgUtils(TestCase): def test_produit_scalaire(self): x = [1,2,3] y = [2,3,4] self.assertEqual(20, p...
Eric-Oll/pytools
tests/math/linalg/test_utils.py
test_utils.py
py
1,117
python
fr
code
0
github-code
13
10518354643
#!/usr/bin/env python from dep_search import * import time import sys import os import ast import DB import Blobldb import importlib import multiprocessing as mp THISDIR=os.path.dirname(os.path.abspath(__file__)) os.chdir(THISDIR) import json import subprocess import pickle import sqlite3 import codecs from datetime i...
TurkuNLP/dep_search
query_mdb.py
query_mdb.py
py
22,569
python
en
code
1
github-code
13
1681769397
from datetime import datetime from datetime import time now = datetime.now() # time object print('date and time=', now) now = datetime.now().time() print("time =", now) time1 = time(0, 0, 12) #makes an object with 12 seconds length print(time1) time2 = datetime() #now.microsecond #now.second #now.hour #now.minute
farzan-dehbashi/toolkit
date_time.py/date_time.py
date_time.py
py
318
python
en
code
5
github-code
13
4321482451
from financepy.utils.date import Date from financepy.products.equity.equity_vanilla_option import EquityVanillaOption from financepy.utils.global_types import OptionTypes from financepy.models.heston import Heston, HestonNumericalScheme import numpy as np # Reference see table 4.1 of Rouah book valuation_date = Date(...
domokane/FinancePy
tests/test_FinModelHeston.py
test_FinModelHeston.py
py
1,846
python
en
code
1,701
github-code
13
73891707856
import pandas as pd import numpy as np df = pd.read_pickle('/data/MERGERS/datasets/df_sample_with_sfr.pk') only_mergers = df.iloc[np.where(df.merger_label < 2)] z0_subfind = only_mergers.z0_subfind unique_at_z0 = np.unique(z0_subfind) n_merging_events = np.zeros_like(unique_at_z0) for i, subfind in enumera...
astroferreira/random-scripts
generate_history_dataset.py
generate_history_dataset.py
py
2,318
python
en
code
0
github-code
13
39130168526
from typing import List, TypedDict, Union from .....models import * from .forum import AV3Forum from .post import AV3DictSubPosts, AV3Posts from .user import AV3User __all__ = ( "AV3ThreadInfo", "AV3ArchiveOptions", "AV3ArchiveUpdateInfo", "AV3ArchiveThread", ) class AV3ThreadInfo: class Archive...
283375/tieba-thread-archive
src/tieba_thread_archive/local/archive/v3/models/archive.py
archive.py
py
3,699
python
en
code
2
github-code
13
31634825242
import math import numpy as np import vincenty as vn # %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% # Distances # %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% def euclideanDistance(a, b): ''' Should be changed for another function if we are us...
Chipdelmal/MoNeT
Markov/distances.py
distances.py
py
2,632
python
en
code
7
github-code
13
35736512943
def tub(a,b): tub_sonlar = [] for n in range(a,b+1): son =True if n == 1: son = False elif n == 2: son =True else : for x in range(2,n): if n % x == 0: son = False if son:tub_sonlar.append(n) retu...
ogabekbahrombekogli/lessons_sariq
20.2 q q func.py
20.2 q q func.py
py
428
python
en
code
0
github-code
13
38035045208
from __future__ import print_function __author__ = "Will Buttinger" __doc__ = """Extract dataset parameters from AMI, and write them to a text file.\nExamples:\n\n\ngetMetadata.py --inDS="mc15_13TeV.361103%DAOD_TRUTH%" --fields=dataset_number,ldn,nfiles,events,crossSection,genFiltEff,generator_name""" import loggin...
rushioda/PIXELVALID_athena
athena/Tools/PyUtils/bin/getMetadata.py
getMetadata.py
py
26,317
python
en
code
1
github-code
13
10977871198
import configparser import json from abc import ABCMeta, abstractmethod from pathlib import Path from typing import List, Optional from model.manufacturer import Manufacturer from pydantic.json import pydantic_encoder from repository.exceptions import ( ManufacturerAlreadyExistsException, ManufacturerNotFoundE...
pedrolp85/pydevice
app/repository/manufacturers/manufacturers.py
manufacturers.py
py
5,094
python
en
code
0
github-code
13
38072288258
from ROOT import * def printClustersAndCells(): fin = TFile('diagnostics.root') fclusters = open('clusters.txt', 'w') fcells = open('cells.txt', 'w') fclusters.write('chain name\t mean number of clusters \t mean Et \n') fcells.write('chain name\t mean number of cells \t mean energy \n') hists = [k.Ge...
rushioda/PIXELVALID_athena
athena/Trigger/TrigValidation/TrigJetValidation/python/clustersAndCells.py
clustersAndCells.py
py
887
python
en
code
1
github-code
13
32951459002
from user import User BROWSERS = ('chrome', 'safari', 'firefox') class Crawler: def __init__(self, method=None, usr=None, pwd=""): ''' :param method - method which app will crawl data ''' self.method = method self.usr = User(usr=usr, pwd=pwd) self.limit = None ...
thecoldstone/Instagram-api
Crawler/crawler.py
crawler.py
py
4,160
python
en
code
0
github-code
13
43114265552
import sys, heapq input = sys.stdin.readline INF = int(1e9) n, m, k, x = map(int, input().split()) graph = [[] for _ in range(n+1)] distance = [INF for _ in range(n+1)] for _ in range(m): a, b = map(int, input().split()) graph[a].append((b, 1)) # graph : (노드, 거리) def dijkstra(start): q = [] heapq.heappush(...
jinhyungrhee/Problem-Solving
BOJ/BOJ_18352_특정거리의도시찾기.py
BOJ_18352_특정거리의도시찾기.py
py
1,034
python
ko
code
0
github-code
13
1690124537
#!/usr/bin/env python import matplotlib.pyplot as plt from matplotlib.font_manager import FontProperties # Press the green button in the gutter to run the script. if __name__ == '__main__': font = FontProperties() font.set_family('serif') font.set_name('Times') plt.yticks(fontname="Times", fontsize =...
farzan-dehbashi/toolkit
mtplotlib_lines/rfid_vs_witag.py
rfid_vs_witag.py
py
1,270
python
en
code
5
github-code
13
19407352041
import dataclasses import importlib import inspect import logging from typing import Any, Dict, Iterable, List, Optional, Set from pynguin.setup.testcluster import TestCluster @dataclasses.dataclass(eq=True, frozen=True) class DefiningClass: """A wrapper for a class definition.""" class_name: str = dataclas...
Abdur-rahmaanJ/pynguin
pynguin/analyses/duckmock/duckmockanalysis.py
duckmockanalysis.py
py
3,836
python
en
code
null
github-code
13
34346390782
import asyncio import mock import pytest from aioredis_cluster.pooler import Pooler from aioredis_cluster.structs import Address def create_pool_mock(): mocked = mock.NonCallableMock() mocked.closed = False mocked.wait_closed = mock.AsyncMock() return mocked async def test_ensure_pool__identical_a...
DriverX/aioredis-cluster
tests/unit_tests/aioredis_cluster/test_pooler.py
test_pooler.py
py
11,058
python
en
code
24
github-code
13
15569860019
from argparse import ArgumentParser import logging import os import sys from io_utils.io_utils import load_text_corpus, save_speech_corpus from synthesis_utils.synthesis_utils import create_sounds asr_dataset_logger = logging.getLogger(__name__) def main(): parser = ArgumentParser() parser.add_argument('-d...
bond005/speechmonger
asr_dataset.py
asr_dataset.py
py
3,373
python
en
code
0
github-code
13
31625655034
# -*- coding: utf-8 -*- """ Created on Mon Feb 22 17:46:36 2016 @author: ajaver """ import pandas as pd import os import tables import numpy as np import matplotlib.pylab as plt from collections import OrderedDict import sys sys.path.append('/Users/ajaver/Documents/GitHub/Multiworm_Tracking') from MWTracker.helperFun...
ver228/work-in-progress
work_in_progress/_old/worm_orientation/correctHeadTailIntensity_global.py
correctHeadTailIntensity_global.py
py
3,755
python
en
code
0
github-code
13
32802828433
#!/usr/bin/env python # -*- coding: utf-8 -*- # @Time : 27/03/2019 12:28 AM # @Author : Pengfei Xiao # @FileName: harvester_manager.py # @Software: PyCharm """This file is used to manage restful harvester that crawling mention and reply to the politicians.""" import pandas as pd import time import sys sys.path.a...
pengfei123xiao/Political_Analysis
restful_harvester/harvester_manager.py
harvester_manager.py
py
1,458
python
en
code
1
github-code
13
37694241147
import threading from typing import Optional from loguru import logger from pwnlib.util.cyclic import cyclic, cyclic_find from pypwn.core.abstract.module import AbstractModule from pypwn.core.abstract.process import AbstractProcess from pypwn.core.protocols import IDebuggable, ITarget class FindOffset(AbstractModul...
lim8en1/pypwn
src/pypwn/modules/find_offset.py
find_offset.py
py
2,044
python
en
code
0
github-code
13
43771204006
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('wzw', '0006_remove_group_token'), ] operations = [ migrations.AddField( model_name='group', name='tok...
Steh/WZW
wzw_projekt/wzw/migrations/0007_group_token.py
0007_group_token.py
py
460
python
en
code
0
github-code
13
14219905040
def best_sum(n , array , memo={}) : if n in memo: return memo[n] if n == 0 : return [] if n < 0 : return None shortestResult = None for a in array: remainder = n - a result = best_sum(remainder , array, memo) if result != None: newResult = ...
tarekichalalen2002/dynamic-programmming
memoization/best-sum.py
best-sum.py
py
533
python
en
code
3
github-code
13
28255335119
import matplotlib.pyplot as plt import math import numpy as np import seaborn as sb import pandas as pd # EFFECT OF ISOTHERM def IsothermResult(x,y): reg = np.polyfit(x,y, deg=1) # out: array(slope, intercept) # r_square correlation_mat = np.corrcoef(x,y) r = correlation_mat[0,1] Iso...
ramanpy/isokintemp
Isokintem.py
Isokintem.py
py
19,204
python
en
code
0
github-code
13
69894358418
# 1 . Biggie Size - Given a list, write a function that changes all positive numbers in the list to "big". # Example: biggie_size([-1, 3, 5, -5]) returns that same list, but whose values are now [-1, "big", "big", -5] def convertbig(x): y = len(x) for val in range (0,y,1): if x[val] > 0: x[...
Jarvis2021/Coding-Dojo
Python_Stack/python/fundamentals/ForLoopBasicII.py
ForLoopBasicII.py
py
3,277
python
en
code
0
github-code
13
21579155925
import copy from gurobipy import Model,GRB,LinExpr import re import math import matplotlib.pyplot as plt import numpy as np import pandas as pd from Gurobi_direct.OptModel_m_pre import OptModel_gurobi class Node: def __init__(self): self.local_LB = 0 self.local_UB = np.inf self.x_sol ={} ...
LiuZunzeng/Code_VRPTW
Branch_and _Bound/Branch_and_Bound.py
Branch_and_Bound.py
py
8,533
python
en
code
0
github-code
13
12400832889
# -*- coding: utf-8 -*- from bs4 import BeautifulSoup import urllib.parse import urllib.request import re class CuisineLibre(object): @staticmethod def search(query_dict): """ Search recipes parsing the returned html data. """ base_url = "http://www.cuisine-libre.fr/?page=recherche&" query_url = urlli...
remaudcorentin-dev/python-cuisinelibre
cuisinelibre/__init__.py
__init__.py
py
2,075
python
en
code
0
github-code
13
9077841000
import sys sys.setrecursionlimit(10000) # 런타임 에러 방지용 dx = [1, -1, 0, 0] dy = [0, 0, 1, -1] T = int(input()) def dfs(x, y): # 상,하,좌,우 확인 for d in range(4): nx = x + dx[d] ny = y + dy[d] if (0 <= nx < N) and (0 <= ny < M): if matrix[nx][ny] == 1: # 상 하 ...
Mins00oo/PythonStudy_CT
BACKJOON/Python/S2/S2_1012_유기농 배추.py
S2_1012_유기농 배추.py
py
989
python
ko
code
0
github-code
13
24356099412
import argparse import numpy.random as rand from datastore import datastore parser = argparse.ArgumentParser(formatter_class=argparse.ArgumentDefaultsHelpFormatter) parser.add_argument('--haste', help='', default=None, type=float) parser.add_argument('--pickiness', help='', default=None, type=float) parser.add_argum...
amrith1/CommNets
batch.py
batch.py
py
3,512
python
en
code
0
github-code
13
8104332694
class Solution: def minSwapsCouples(self, row: List[int]) -> int: from collections import defaultdict num2i = defaultdict(int) for i, v in enumerate(row): num2i[v] = i n = len(row) res = 0 def swap(i, j): row[i], row[j] = row[j], row[i] ...
lumiZGorlic/leetcode
solutions/CouplesHoldingHands/solution.py
solution.py
py
678
python
en
code
0
github-code
13
29726183968
# -*- coding:utf-8 -*- """ paddle train demo """ import os import numpy as np import paddle # 导入paddle模块 import paddle.fluid as fluid import gzip import struct import argparse import time from rudder_autosearch.sdk.amaas_tools import AMaasTools def parse_arg(): """parse arguments""" parser = argparse.ArgumentP...
Baidu-AIP/BML-AutoML-AutoSearch
bml_auto_search_job/paddle_2_1_1/paddlepaddle2.1.1_autosearch.py
paddlepaddle2.1.1_autosearch.py
py
13,336
python
en
code
3
github-code
13
23737934815
import sys from config import Config, Logger from utils import IpUtils from web_connector import GoDaddyConnector if __name__ == '__main__': if len(sys.argv) != 2: print('Invalid arguments') print('Usage:') print('update_dns.py <dev|prod>') sys.exit(1) environment = sys.argv[1...
esceer/godaddy-dns-sync
src/update_dns.py
update_dns.py
py
640
python
en
code
1
github-code
13
34828290831
from math import sqrt import stats_batch as sb import numpy as np from pytest import approx from scipy.stats import ttest_ind_from_stats from scipy.stats import ttest_ind def test_batch_mean_var_t_test(): n = 10_000 a = np.random.normal(size=n) b = np.random.normal(size=n) # First batch # a ------...
christophergandrud/stats_batch
tests/test_batch_mean_var_t.py
test_batch_mean_var_t.py
py
1,055
python
en
code
1
github-code
13
12342497443
# a game of Rock Paper Scissors # a working program that accepts the user's input (r, p, or s) # user 1 while True: while True: p1 = input("Player 1, Enter Rock(r), Paper(p), or Scissors(s): ") if p1 in ["r","p","s"]: break print("Please enter a valid input") # user 2 while...
stevanvillegas/myrepo
Python_myCodingDemo_3.py
Python_myCodingDemo_3.py
py
916
python
en
code
0
github-code
13
70391991699
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Wed Dec 22 11:45:12 2021 @author: testbenutzer """ import numpy as np from scipy.ndimage.filters import maximum_filter from scipy.ndimage.morphology import generate_binary_structure, binary_erosion from scipy.ndimage.measurements import label import matplo...
roundplanet/Laue-Camera
test_split_detection.py
test_split_detection.py
py
6,383
python
en
code
1
github-code
13
37743118340
# encoding: utf-8 import unittest from authors_network.authors_network_builder import AuthorsNetworkBuilder from authors_network.papers_dictionary_builder import PapersDictionaryBuilder class TestAuthorsNetworkBuilder(unittest.TestCase): def test_build(self): builder = AuthorsNetworkBuilder() paper...
ken57/personalize_search_experiment
test/authors_network_builder_test.py
authors_network_builder_test.py
py
830
python
en
code
1
github-code
13
8442080834
""" script to create pi zero mounting """ # ------------------- imports ----------------------------------------- import solid2 as ps # ------------------- main dimensions --------------------------------- thick = 2 screw_od = 2 mount_od = 6 hh = 20 mount_l = 40 mount_w = 40 servo = { "l": 23, "w": 13, "h...
greyliedtke/PyExplore
OpenScad/SP2/ServoMount/RectangleMounting.py
RectangleMounting.py
py
973
python
en
code
0
github-code
13
586646095
class Node: def __init__(self, key): self.key = key self.left = None self.right = None class BST: def __init__(self): self.root = None # BST is inherently a binary tree class Node: def __init__(self, key): self.key = key self.left = None self.right =...
Hienu/TranDanhHieu_CTDL
Đề tài giữa kỳ_DK009/11 Binary Search Trees/001 What are Binary Search Trees/a.py
a.py
py
2,304
python
en
code
0
github-code
13
38046101303
from setuptools import setup, find_packages import os version = open(os.path.join("collective", "wfform", "version.txt")).read().strip() setup(name='collective.wfform', version=version, description="", long_description=open(os.path.join("README.txt")).read() + "\n" + open(os.p...
davismr/collective.wfform
setup.py
setup.py
py
1,237
python
en
code
0
github-code
13
16882555891
from tests.Pages.UpdateBlogPage import UpdateBlogPage from selenium.webdriver.common.action_chains import ActionChains import pytest import marks import os pytestmark = [marks.update_blog_page, pytest.mark.update_blog] # caveats: # - this test share the login state for this entire module, so each test function might a...
stsiwo/python-selenium-testing
tests/TestCase/LoginRequired/UpdateBlogPage/test_update_page.py
test_update_page.py
py
3,087
python
en
code
0
github-code
13