blob_id
large_string
repo_name
large_string
path
large_string
src_encoding
large_string
length_bytes
int64
score
float64
int_score
int64
detected_licenses
large list
license_type
large_string
text
string
download_success
bool
249f2d1766f3adfc3d5354a87a839349e015345a
tachyon83/code-rhino
/DAY001~099/DAY99-BOJ1774-우주신과의 교감/shinjam.py
UTF-8
883
3.03125
3
[]
no_license
from math import sqrt import sys input = sys.stdin.readline def distance(a, b): return sqrt((a[0]-b[0])**2 + (a[1]-b[1])**2) def find(node): if parent[node] != node: parent[node] = find(parent[node]) return parent[node] def union(node_a, node_b): parent_a, parent_b = find(node_a), find(n...
true
2ae8748ec7ed351f8fb2226de590cdbfcdb5a7cc
longhao54/leetcode
/normal/366.py
UTF-8
564
2.8125
3
[]
no_license
from collections import defaultdict class Solution: def findLeaves(self, root: TreeNode) -> List[List[int]]: c = float("-inf") ans_list = [] def check(r): nonlocal c if not r: return 0 a = check(r.left) b = check(r.right) ...
true
efc663a7b5224b779a9521fd9040351b71802f41
lukaszog/PythonGTKBallsGame
/main.py
UTF-8
13,679
3.546875
4
[]
no_license
# coding=utf-8 from random import randrange import gi gi.require_version('Gtk', '3.0') from gi.repository import Gtk, GdkPixbuf # liczba kulek przy starcie gry BALLS_AMOUNT = 50 # liczba nowych kulek po przestawieniu kuli BALLS_PER_CLICK = 3 # liczba kolumn SIZE_X = 10 # liczba wierszy SIZE_Y = 10 """Prosta gra w ...
true
383e17e542843c415e34c7879b3727b6047157b5
ziyuan912/ML_2019
/hw6/13-16.py
UTF-8
2,960
2.90625
3
[]
no_license
import numpy as np import matplotlib.pyplot as plt def decision_stump(X, Y, theta, u): predict = np.sign(X - theta) error1 = u.dot(Y != predict)/np.sum(u) error2 = 1 - error1 if(error1 > error2): return (error2, -1) else: return (error1, 1) def adaboost(X, Y, theta, u): trainnum = u.shape[0] Ein = [] g =...
true
c78e0e2ff676575a0023105ca77b95e8afec6b13
Omkarkale0002/Developer
/php/05_Bit.py
UTF-8
303
3.90625
4
[]
no_license
#Performing Bitwise operator a=60 b=13 c=0 c = a & b #ANd print("The AND is ",c) #bitwise opr c = a | b #Or print("The OR is ",c) c= ~a #compli print("The Compliment is ",c) c= a<<b print("The Left is",c) c= a>>b print("The Right is",c) #c= a>>>b #print("The right most is",c)
true
f31efbfdae548f6e8dc02da7a68cb1cea71913bd
daiyunbin/crawler
/crawler_sys/framework/get_redirect_resp.py
UTF-8
2,126
2.515625
3
[]
no_license
# -*- coding: utf-8 -*- """ Created on Wed Jun 13 10:52:58 2018 tested on toutiao @author: hanye """ import re from crawler_sys.utils.output_results import retry_get_url def get_redirected_resp(ori_url): headers = { "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:60.0) Gecko/20100101 Firefox...
true
7e3b8c4cb5a1ba32c9d2543b45f57defe185900f
LucaZampieri/NonnaScan
/nonnascan/script/digitalize.py
UTF-8
1,717
3.0625
3
[]
no_license
""" Might use https://cloud.google.com/vision/docs/handwriting instead """ import glob import argparse import subprocess import os from PIL import Image # import Image def main(): parser = argparse.ArgumentParser(description="Digitalize a bunch of images.") parser.add_argument("--data", type=str, default="....
true
b7d88c914a285b806dabf7fbe4d74a913e92ea87
alexchungio/Keras-Learning-Advance
/text_vectorization/word_embedding.py
UTF-8
2,572
2.765625
3
[]
no_license
#!/usr/bin/env python # -*- coding: utf-8 -*- #------------------------------------------------------ # @ File : word_embedding.py # @ Description: # @ Author : Alex Chung # @ Contact : yonganzhong@outlook.com # @ License : Copyright (c) 2017-2018 # @ Time : 2020/3/4 上午9:48 # @ Software : PyCh...
true
08a62f195517eb0e96177af07f0fcf7900a28b78
calmahn/jump_to_python
/2. 자료형/02-2-14.py
UTF-8
185
2.953125
3
[]
no_license
y = 3.42134234 a = "{0:0.4f}" .format(y) print(a) b = "{0:10.4f}" .format(y) print(b) # {} 포매팅 문자가 아닌 문자 그대로 사용할 때 c = "{{ and }}" .format() print(c)
true
fe35c4cf843342183f05d4a46330e33e9c915d95
vladison27/botsteamby
/summ.py
UTF-8
310
2.828125
3
[]
no_license
def summ(idd): file = open(F"{idd}.txt") file_mass = [] for i in file.readlines(): file_mass.append(i) del(file_mass[0]) file = file_mass waste = [] for info in file: info = info.split(" ") waste.append(int(info[1])) sum = 0 for i in waste: sum += i return sum
true
4849f659b7f95ba78f781c7466c36a294f417d98
TheSnekySnek/HEIGVD-SWI-Labo2-WPA
/files/scairodump.py
UTF-8
8,125
2.875
3
[]
no_license
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Dictionary attack on passphrase derived from the 4-way handshake info, uses an interface in monitor mode to sniff packets """ __author__ = "Diego Villagrasa, Fabio Marques" __copyright__ = "Copyright 2021, HEIG-VD" __license__ = "GPL" __version__ = "1.0" __e...
true
455da3deb78eaf1d17b1eae37d8a794411dbb919
Python-Geek-Labs/AmamaScript
/AmaScript/41_SP搜索词报告检查下错.py
UTF-8
5,152
3.078125
3
[]
no_license
# -*- coding: utf-8 -*- """ Created on Sat Dec 7 14:54:17 2019 @author: Administrator """ ''' 由于会下载400个excel左右,此脚本是检查搜索词报告是否下错 检查的逻辑为: 1.搜索词报告的文件名是否存在在广告活动中,一般批量广告活动一定会存在文件名,如075-us 2.搜索词报告中的货币,是否与国家对应的货币一致 3.判断是否有广告(有数据),判断长度 4.判断下载是否是英文报告(区分中文和英文),区分daily和total报告的区别, 根据表头是否一致来判断 update20210121:采用for else语法对 站点是否...
true
71f3f36d811d09576e6750ae4d8af33c28842098
potomatoo/TIL
/Baekjoon/boj_20058_마법사 상어와 파이어스톰.py
UTF-8
2,841
2.8125
3
[]
no_license
import sys sys.setrecursionlimit(10000) def rotate(split_board): k = len(split_board) return_board = [[] for _ in range(k)] for y in range(k-1, -1, -1): for x in range(k): return_board[x].append(split_board[y][x]) return return_board def check_ice(y, x, s_board): k = len(s_boar...
true
f59f46cfb6aa51804d28575a3fd1442ac12aa559
andreh7/ecal-rechits-torch-training
/plotROCs.py
UTF-8
21,048
2.609375
3
[]
no_license
#!/usr/bin/env python # given a results-* directory, finds the # Torch tensor files with the network outputs # for different epochs, calculates the ROC area # and plots the progress # given a table of serialized Torch labels, # weights and target values, calculates and prints # the area under the ROC curve (using sk...
true
cd79e5f661413bf3e95b42f806a57d8979acebf5
iam66/sele_project_test1
/hello.py
UTF-8
321
3.890625
4
[]
no_license
temp=input('不妨猜一下小甲鱼现在心里想的是哪个数字:\n') guess = int(temp) if guess ==8: print('卧槽,你是小甲鱼心里的蛔虫吗?!') print('哼,猜中了也没有奖励!') else: print('猜错啦,小甲鱼现在心里想的是8!') print('游戏结束,不玩啦!')
true
feaa17d8284e2479ae85f18263d11337a13ebf7a
zheedong/BaekJoon
/python/11053.py
UTF-8
986
3.34375
3
[ "MIT" ]
permissive
n = int(input()) inp_list = list(map(int, input().split())) # Index를 넣으면 그 idx에서 최대 길이를 출력함. dyn_idx_length = dict([]) def solution(idx): # Dynamic Programming try: # 먼저 이미 알고 있던 값인지 확인한다. return dyn_idx_length[idx] except: # 초기값은 1. dyn_idx_length[idx] = 1 # 가능한 모든...
true
f7cfd3126b1b40c3bef60c8a6edcac27b914b53f
vishweshs4/GA-DSI
/curriculum/week-09/4.2-flask/hello.py
UTF-8
354
3.0625
3
[]
no_license
import flask app = flask.Flask(__name__) @app.route('/') def hello(): return ''' <body> <h2> Hello World! blah </h2> </body> ''' @app.route('/greet/<name>') def greet(name): "Say hello to your first parameter" print hello() print 'aaa' return "Hello, %s!" %name if __name__ == '__...
true
8b1908d34f9115646ca9baddfda7973cf826b75e
ctec121-spring19/programming-assignment-9-MichaelLionHart
/problem-set-9-problem-1.py
UTF-8
1,522
4.90625
5
[]
no_license
# Module 6 - Problem Set No. 9 - Problem 1 """ READ ALL INFORMATION CAREFULLY AND THEN READ IT AGAIN IMPORTANT - PROVIDE AN IPO (Inputs, Processes, and Output) AT THE TOP OF EACH PROGRAM USING COMMENTS. Write a program that gets a string containing the person's first, middle and last names using input(), and then ...
true
0da9429076756519fc5aa785680ecc8ba3f69f1d
blueLibertas/BOJ
/Python/#2588 곱셈.py
UTF-8
187
2.921875
3
[ "BSD-3-Clause" ]
permissive
# 문제 출처: https://www.acmicpc.net/problem/2588 # 풀이: 2021.01.15 A = int(input()) B = input() print("{}\n{}\n{}\n{}\n".format(A*int(B[2]), A*int(B[1]), A*int(B[0]), A*int(B)))
true
0a96064bd8973394d4019c5a82fdf7c7feac1b0a
syco/python3-eventlib
/greentest/test__coros_queue.py
UTF-8
5,442
2.921875
3
[]
no_license
from greentest import LimitedTestCase from unittest import main from eventlib import api, coros def waiting(queue): try: return len(queue.sem._waiters) except AttributeError: return len(queue.sem.lower_bound._waiters) class TestQueue(LimitedTestCase): def test_send_first(self): q ...
true
1ffcad952c95c1cb57d27b1a2d4c00211473605a
renrut/Self-Driving-Car
/mechanics/websocket_controller.py
UTF-8
590
2.5625
3
[]
no_license
#!/usr/bin/env python import asyncio import websockets class websocket_controller: def __init__(self, port=8765): self.port = port self.server = None def start_connection(self, callback): try: asyncio.get_event_loop() except: asyncio.set_event_loop(asyn...
true
53197020c3c4de861a82566f2267f296614de128
tobby2002/Ontospy
/ontospy/tests/mylocal_pinelien_test.py
UTF-8
8,035
2.5625
3
[ "MIT" ]
permissive
#!/usr/bin/env python import urllib.request, urllib.parse, urllib.error import sys from rdflib import Graph import logging # see https://docs.python.org/2/howto/logging.html from time import gmtime, strftime import re # global variables wdRegEx = re.compile(r"\<http://www.wikidata.org/entity/(?P<localName>.+)\>") g ...
true
ec041ca1903945c1e93e2a11ea89289c44f8b9fc
valerielim/MIT-gentle-python
/Projects - Pig latin translator.py
UTF-8
1,920
4.1875
4
[]
no_license
# Name: Valerie Lim # Date completed: 6 Feb 2017, Monday # Title: Pig Latin Translator ##### Pig Latin Translator # This code will ask for a phrase you would like to convert. # It will then print the translation in pig latin. # It will not change or remove punctuation. # It will not change or remove numbers ...
true
a0e1f5e380048d226a19d26718ee7cc0eddc1662
664120817/python-test
/web+多线程/进程/进程的名称编号_02.py
UTF-8
794
2.9375
3
[]
no_license
from multiprocessing import Process import time,multiprocessing,os def work(): for i in range(5): print("子进程执行了 编号为:",multiprocessing.current_process().pid) print("os模块获取子进程编号:", os.getpid(),"获取父进程ID:",os.getppid()) time.sleep(5) if __name__ == '__main__': #获取主进程名称 print(multiproce...
true
311d0543388d140c4207d867f9356c1e33560945
juliafealves/tst-lp1
/unidade-3/ciclo-trig/ciclo_trig.py
UTF-8
506
3.65625
4
[]
no_license
# coding: utf-8 # Programação 1 - 2017.2 UFCG # Aluna: Júlia Fernandes Alves (117211383) # Atividade: Ciclo Trig - Unidade 3 # Entrada dos dados referente aos graus. angulo = float(raw_input()) # Verificar se deu a volta no ciclo. if angulo > 360: angulo = angulo % 360 # Verificando os quadrantes. if 0 < angulo < 9...
true
139fc76620dedb7f1ddff7861829b1e4da1b6ff3
MarAvFe/ia-p2
/codigo/cargaDatos.py
UTF-8
5,163
2.65625
3
[]
no_license
import logging from pyDatalog import pyEngine from pyDatalog.pyDatalog import assert_fact, load, create_terms, ask create_terms('derived, etymologically, etymologically_related, etymology, has_derived_form, variant') create_terms('padre, hijo, padre2,X,Y,Z,N,N1,F, relacion4, factorial, first_remainder, odd,even, _spl...
true
046c163a076d51434d40ffd17124b8cbff4044dd
gaivits/code_Kidding
/2_Grading-132452.py
UTF-8
315
3.546875
4
[]
no_license
a = int(input()) b = int(input()) c = int(input()) d = int(input()) n = a+b+c+d if n >= 80: print('A') elif n >=75: print('B+') elif n>=70: print('B') elif n>=65: print('C+') elif n>=60: print('C') elif n>=55: print('D+') elif n>=50: print('D') else: print('F')
true
8b89016ebfb7072629b7b4976c055a91145aa414
ABlack-git/501
/dash_app/utils.py
UTF-8
416
2.875
3
[]
no_license
import json def read_json(path): with open(path, 'r', encoding='utf-8') as f: j_file = json.load(f) return j_file def save_json(d_file, path): with open(path, 'w', encoding='utf-8') as f: json.dump(d_file, f, ensure_ascii=False) def check_activity_matches_existing(activity_list, in_act...
true
c8f0dc6ce0da0631cf1a5c33e84b3a169c371a64
SpartanPlume/Tosurnament
/backend/common/databases/tosurnament/team.py
UTF-8
276
2.578125
3
[ "MIT" ]
permissive
"""Team table""" from encrypted_mysqldb.table import Table from encrypted_mysqldb.fields import IdField, StrField, DatetimeField class Team(Table): """Team class""" bracket_id = IdField() name = StrField() utc = StrField() created_at = DatetimeField()
true
7c9924cef2af5da2f82b60ab32b3ef896d57d0e3
yvesrychener/mini_deepL-framework
/src/nn_module/loss.py
UTF-8
1,206
3.09375
3
[]
no_license
# +-----------------------------------------------------------------------+ # | loss.py | # | This module implements loss functions | # +-----------------------------------------------------------------------+ import torch to...
true
944c46c81d0fdd3587d4d4792a008a55a1475549
przemko07/pokemon_trainer
/source/linq.py
UTF-8
2,389
3.421875
3
[]
no_license
class Linq: def __init__(self, collection): self.collection = collection def where(self, func): new_collection = [] for obj in self.collection: if (func(obj)): new_collection.append(obj) return Linq(new_collection) def select(self, func): ...
true
5cfeecd173644c6eb84508b5facaba08bd2b0dae
gsliu/bundleanalytics
/es/load_vmk_log.py
UTF-8
1,910
2.625
3
[]
no_license
from datetime import datetime from elasticsearch import Elasticsearch from os import listdir from os.path import isfile, join class Bundleanalytics_Log_Loader: def __init__(self, log_file): self.es = Elasticsearch() self.index = 'vmw' self.doc_type = 'vmw' self.log_file = log_file ...
true
a4e54198fde1b8e518f6a559d61679cfd5b1cdf2
Shuimoningxiang/untitled
/DengLuPage.py
UTF-8
2,803
3.046875
3
[]
no_license
# from selenium import webdriver # from selenium.webdriver.common.by import By # # url = "http://172.31.4.74/index.php?m=user&c=public&a=login" # # class LoginPage: # username_input_loc=(By.ID,"username") # password_input_loc=(By.ID,"password") # login_button_loc =(By.CLASS_NAME,"login_btn") # # def __i...
true
6a73cd8d3f389175fd4d8009e0622b19b34adf09
jamesh1999/odin-qem
/client-requests/monitor_temperatures.py
UTF-8
735
2.671875
3
[]
no_license
#!~/develop/projects/odin/venv/bin/python import requests, sys, time print "Continuously reading all temperatures: (Use Ctrl-C to close script)" try: while True: theLot = requests.get('http://beagle03.aeg.lan:8888/api/0.1/lpdpower/') # Read all 11 temperatures, display on the same line for...
true
87b175fe86f1ed6a05f8139ec62785d868b5fb59
Lornatang/DayHR
/Python/img2cartton/3_项目中所有代码/fast-style-transfer(pencil)/opencv/img_to_silhouettes.py
UTF-8
2,200
2.59375
3
[ "Apache-2.0" ]
permissive
# Copyright 2019 ChangyuLiu Authors. All Rights Reserved. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
true
71a4da5f23277872e50912ed432786fe1d0d4b51
jm4302/Ambulance-Service-Project
/Project_Code/arimaMaker.py
UTF-8
5,986
2.875
3
[]
no_license
import logging import matplotlib.pyplot as plt import pmdarima as pm from statsmodels.tsa.arima_model import ARIMA from statsmodels.tsa.statespace.sarimax import SARIMAX import math from statsmodels.graphics.tsaplots import plot_acf, plot_pacf from sklearn.metrics import mean_squared_error from sklearn.metrics import r...
true
67e717d8bbe9a8ffb87362363442073fc8b67545
ikitcheng/pystock
/pystock/indicators.py
UTF-8
2,195
3.53125
4
[]
no_license
# -*- coding: utf-8 -*- """ Created on Thursday June 22 13:58:19 2023 @author: I Kit Cheng script: indicators.py """ import numpy as np class Indicator(): def __init__(self, df, period): """ Indicators class constructor. Args: df (pd.DataFrame): stock dataframe containing ohlcv. ...
true
cee61b43d37a8090f921b4eeb9c7c9217716f420
willchamberlain/aa1_vos_android
/src/vos_aa1/robotId.py
UTF-8
841
2.625
3
[]
no_license
import random import string class RobotIdentifier: def __init__(self, native_id_): self.native_id = native_id_ self.vos_id = '' self.assign_vos_id(self.native_id) def assign_vos_id(self, native_id_): random.seed() str_ = '' for i_ i...
true
b25e909bcdeca67353935e53b034ecfae44e7b03
Siilbon/pythonthehardway
/ex4.py
UTF-8
605
3.515625
4
[]
no_license
cars = 100 space_in_a_car = 4 drivers = 30 passengers = 90 cars_driven = drivers cars_not_driven = cars - drivers carpool_capacity = cars_driven * space_in_a_car average_passenders_per_car = passengers / cars_driven print "There are", cars, "cars available." print "There are only", drivers, "drivers available." print...
true
3d23abbf8f5f77bdb6bdb0be42d24a8998c20f35
otoomueez/abdulMueez
/abdulMueez/Turntabl/Lists.py
UTF-8
222
3.921875
4
[]
no_license
list = [] # an empty list list.append("a") # this appends or adds figures to the empty list print(list) # prints the list with the figures def minmax(): l = [1,2,5,3,2,6,6,4] m = min(l) n = max(l)
true
b034b43242a2b9124789c0f5a9e04f33c1c48ae5
loicsacre/code-master-thesis
/info/generate_pairs.py
UTF-8
1,562
2.96875
3
[]
no_license
import csv import os from itertools import combinations from path import Paths def generate_pairs(): """ Generate all the pairs of images as list of (tissue, dye1, dye2, path_to_img, original_name1, original_name2, extension) """ tissue2info = dict() with open('./info/project-info.csv...
true
b3f415a05d3576dff4e7d0c773ae4f77b19166cc
appan-roy/Seleniun-Python
/PytestPOM/Pages/LoginPage.py
UTF-8
887
2.84375
3
[]
no_license
from Pages.BasePage import BasePage from selenium.webdriver.common.by import By from Config.config import TestData class LoginPage(BasePage): """Login Page Objects""" USERNAME = (By.ID, "txtUsername") PASSWORD = (By.ID, "txtPassword") LOGIN_BUTTON = (By.ID, "btnLogin") FORGOT_PWD_LINK = (By.LI...
true
579498fce5b91c2f459b6eb2a31367697e6e0cf5
Shaquon/backend-webscraper-assessment
/main.py
UTF-8
3,400
3.375
3
[]
no_license
#!/usr/bin/env python # -*- coding: utf-8 -*- """ A simple webscraper. This takes in a file as an arg and parses out the urls, emails, and phone numbers found in the html. """ __author__ = "Shaquon Kelley" # Imports go at the top of your file, after the module docstring. # One module per import line. These are for e...
true
fd5249bdf96e63d000c0477a206658abae809812
Kawser-nerd/CLCDSA
/Source Codes/AtCoder/arc095/A/4751971.py
UTF-8
289
2.625
3
[]
no_license
n,*a=map(int,open(0).read().split()) d=0 l=[] a=sorted(enumerate(a),key=lambda x:x[1]) b=a[n//2][1] c=a[n//2-1][1] for(k,v)in a: d+=1 if d<n//2+1: l.append((k,b)) else: l.append((k,c)) #print(l) for(k,v)in sorted(l,key=lambda x:x[0]): print(v)
true
f001abe1d6bfd994f1438d8b6adb7d0446235d0f
marcteves/cs180-proj
/test.py
UTF-8
210
2.875
3
[]
no_license
from itertools import chain, combinations i = set([0, 1, 2, 3,4,5,6,7,8,9,10,11,12,13]) s = [] for z in chain.from_iterable(combinations(i, r) for r in range(len(i)+1)): s.append(z) for l in s: print l
true
5dbc1dad647e5d42fbe0d825bd830d92cfb2c397
JanBednarik/europe
/content/obrysy/initial.py
UTF-8
3,274
2.59375
3
[]
no_license
# -*- coding: utf-8 -*- """ Outlines of european countries. Outlines are stored as SVG files in `svg/` directory. They came from wikipedia image https://commons.wikimedia.org/wiki/Category:Blank_SVG_maps_of_Europe#/media/File:Blank_map_europe_coloured.svg, which was transformed into individual files. (NOTE: wikipedi...
true
da26b99db3093e4c3b6affe40e1ce7090dd6dec1
GroupLe/grouple-face-tagger
/backend/http_utils/handlers/tag_characters_handler.py
UTF-8
3,699
2.578125
3
[ "MIT" ]
permissive
from typing import List, Dict from itertools import chain from tornado.web import RequestHandler import inject import regex as re import requests as r import cv2 import os import numpy as np from pathlib import Path from PIL import Image from grouple.backend.entities import Manga from grouple.models.NER.models.lstm.mod...
true
b49de69e26d4dd574579a053e166658982056db3
hitmoon/ML
/tensorflow/mnist.py
UTF-8
4,451
2.765625
3
[]
no_license
import numpy as np import tensorflow as tf import matplotlib.pyplot as plt from tensorflow.examples.tutorials.mnist import input_data print ("packs loaded") print ("Download and Extract MNIST dataset") mnist = input_data.read_data_sets('data/', one_hot = True) print ("type of 'mnist' is %s " % (type(mnist))) print ...
true
d4dfdfd220375c71504cba151460432bd2e4f5f6
dawitgr/Programming-for-the-Data-Science
/Dawit_2.3.py
UTF-8
2,726
4.4375
4
[]
no_license
#!/usr/bin/env python # coding: utf-8 # In[1]: #Dawit Reda #ID#10189420 #Module 2.3 Assignment #Programming for the Data Science #Re-Submitting to Dr. Daniel Wu # In[ ]: # 2.3 Pig Latin is a game taking the first letter of a word, puts it at the end, and appends “ay”. #The exception is if the first letter is a vo...
true
2a9c6036737229054996ab84a29d0b336c100b19
GoosenA/OverdriveGUI
/main.py
UTF-8
3,721
2.8125
3
[]
no_license
import pygame import utils import os from utils import SurfaceObject from pathlib import Path BLACK = (0,0,0) WHITE = (255,255,255) PLAYER = (0,255,0) OPPONENT = (255,0,0) GREY = (150,150,150) MUD = (128,120,98) OIL = (66,66,66) PU_BOOST = (12,188,194) PU_OIL = (13,19,189) WIDTH = 30 HEIGHT = 20 MARGIN = 5 ROWS = 15...
true
cb6deb690bdb57ab517decc298f1ca902fcc09e8
tsugumi-sys/automation-stock
/DC/dc.py
UTF-8
3,057
3.15625
3
[]
no_license
import numpy as np import pandas as pd import yfinance as yf import datetime as dt import matplotlib.pyplot as plt import mplfinance as mpf start = '2016-01-01' end = dt.datetime.now() stock_code = 'AMD' df = yf.download(stock_code, start, end, interval='1d') print(df.head()) term = 20 # chek the highest price in the...
true
11397e26648a275c4f490e446db2e79a51dc953a
TaYpworm/clstr-parser
/clstr_parser.py
UTF-8
6,447
3.53125
4
[]
no_license
import re class ClusterParser(object): """ Parses clstr file format for converstion to a tab separated file specified by UNR Bioinformatics. The parser pulls out clusters with percentages. There may be multiple lines that list a percentage for each cluster. The desired output columns are: Cluster Identifier ...
true
5584e230d5facd6d86e8f561f03f4a7d11358827
dtabb73/Zorbit-Analyzer
/202102115-icechia.py
UTF-8
29,129
2.90625
3
[ "Apache-2.0" ]
permissive
import numpy as np import pandas as pd from io import StringIO import re import csv from csv import reader, writer import sys import os import glob import fnmatch from os import path import matplotlib from matplotlib import pyplot as plt print("You are using Zorbit Analyzer v0.1") directory_path = input...
true
084aafd4ac60dc2dc6163e1f987483dfc834a6a1
ventilator/peuler
/problem 003 - primfactor/problem.py
UTF-8
238
3.453125
3
[]
no_license
# -*- coding: utf-8 -*- #x = 13195 x = 600851475143 divisor = 2 while divisor < x: while x % divisor != 0: divisor = divisor + 1 print 'Primfaktor: ' + str(divisor) x = x / divisor print 'Rest: ' + str(x)
true
08161d21d1c62b14deeecde1c236f8e8a11c6385
Tonologist/Housing_SH
/5_cleaning_data-title.py
UTF-8
1,100
2.71875
3
[]
no_license
import csv import os import time xiaoqu_title = ['名字', '建筑年代', '详情链接', '销售历史链接', '租房链接', '区', '街道','建筑类型','物业费用','物业公司','开发商','楼栋总数','房屋总数','附近门店'] districts_all=["chongming", "qingpu", "baoshan", "changning", "fengxian", "hongkou", "huangpu", "jiading", "jingan", "jinshan", "minhang", "pudong", "putuo", "songjiang",...
true
df1c905fc22d963a155f3e1dc0127c658aa6189d
wilianrevejes/programmingrepository
/exercices/python/ex003.py
UTF-8
229
4.28125
4
[]
no_license
# ex003 - Crie um programa que leia dois números e mostr a soma entre eles. n1 = int(input('Digite um número: ')) n2 = int(input('Digite outro: ')) s = n1 + n2 print('A soma entre {0} e {1} resulta em {2}.'.format(n1, n2, s))
true
1861f19404afa79bf76b8404a17343aba55abf55
316513979/thc
/Clases/Programas/PythonFácil/Problema2.py
UTF-8
434
3.1875
3
[]
no_license
def tupla(M): Sf=[] Sc=[] I=len(M) E=len(M[0]) s=0 for fila in M: for n in fila: s=s+n Sf.append(s) s=0 for elemento in range(E): for columna in range(I): s=s+M[columna][elemento] Sc.append(s) s=0 T=(Sf, Sc) pri...
true
ffd20b898c50522dc730cfbab92143ea42744596
sharingov/workspace
/google/kickstart/2021/A/l.py
UTF-8
1,231
2.921875
3
[]
no_license
for t in range(int(input())): r, c = list(map(int, input().split())) grid = [] total = 0 for i in range(r): grid.append(list(map(int, input().split()))) for i in range(r): for j in range(c): if grid[i][j]: for xdir in range(-1, 2, 2): x...
true
357f9b267f15d23357466b609a1d843bff050910
nadiagherman/GradientDescentBatch
/myGDBatch.py
UTF-8
1,701
2.953125
3
[]
no_license
import random class MyGDregressor: def __init__(self): self.intercept_ = 0.0 self.coef_ = [] # Batch Gradient Descent def fit(self, x, y, learningRate=0.001, noEpochs=10000): self.coef_ = [0.0 for _ in range(len(x[0]) + 1)] # self.coef_ = [random.random() for _ in range(le...
true
235c5a078a0513f5ec05b5d3e36db66e7c5eb7f6
kronostechnologies/zendesk-utils
/search_and_replace/replace.py
UTF-8
3,539
2.90625
3
[ "MIT" ]
permissive
#!/bin/python from zdesk import Zendesk import os import sys import argparse def query_yes_no(question, default="no"): """Ask a yes/no question via input() and return their answer. "question" is a string that is presented to the user. "default" is the presumed answer if the user just hits <Enter>. ...
true
2d648c1276b9bab55e3f90637395628e5d377519
ox-it/moxie-contacts
/moxie_contacts/domain.py
UTF-8
267
2.625
3
[]
no_license
class Person(object): def __init__(self, name, unit, email=None, internal_tel=None, external_tel=None): self.name = name self.unit = unit self.email = email self.internal_tel = internal_tel self.external_tel = external_tel
true
44b021dab5982191c9f092410941619a5b10856e
BBuniverse/OpenCV
/Test/008_Line_Rectangle.py
UTF-8
1,139
2.859375
3
[]
no_license
import cv2 import numpy as np # When pressing mouse turn to true drawing = False # True for rectangle, False for straight line, changed by press 'm' mode = True ix, iy = -1, -1 def draw(event, x, y, flags, param): global ix, iy, drawing, mode if event == cv2.EVENT_LBUTTONDOWN: drawing = True ...
true
f9ec61836623ffdffd96d54398d30f4850c7f651
harricHe/HSM
/hsm.py
UTF-8
5,369
3.09375
3
[ "MIT" ]
permissive
""" The MIT License (MIT) Copyright (c) 2015-2018 Howard Chan https://github.com/howard-chan/HSM Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation ...
true
65ee1ae556bd0325dad985e4f1556e94123363fa
ashtonteng/squad_exp
/pseudocode/model.py
UTF-8
4,140
3.0625
3
[ "MIT" ]
permissive
import tensorflow as tf from tensorflow.contrib import rnn import os os.environ["TF_CPP_MIN_LOG_LEVEL"]="2" import numpy as np class BiRNNLayer(): """A feed-forward layer that implements a bi-directional RNN of variable cell types and number of layers. INPUT: batch_size x seq_length OUTPUT: seq_lengt...
true
36aaf7ee44dbdd62e9fd23536b9451fa62d1c5c4
AdrianoAzuos/vsgb
/vsgb/input.py
UTF-8
1,928
3.046875
3
[]
no_license
#!/usr/bin/env python # -*- coding: utf-8 -*- # Documentation source: # - http://bgb.bircd.org/pandocs.htm # FF00 - P1/JOYP - Joypad (R/W) # The eight gameboy buttons/direction keys are arranged in form of a 2x4 matrix. # Select either button or direction keys by writing to this register, then read-out bit 0-3. # B...
true
0079755c3be4e5928e98c6f2ab8c630085de518c
obligate/python3-king
/it-king/day12_mysql/02_1orm_create_table.py
UTF-8
775
3
3
[]
no_license
# Author: Peter # 1. 第一种方式创建表o2_orm_basic # 2. 第二种方式创建02_2orm_create_metadata,虽不常用,但还是看看吧 # 我们用第一种方式o2_orm_basic创建的表就是基于第2种方式的再封装 import sqlalchemy from sqlalchemy import create_engine from sqlalchemy.ext.declarative import declarative_base from sqlalchemy import Column, Integer, String engine = create_engine...
true
959dabcbc602bad3310d7cc2e276f165bf4bc37b
markguitar/learningPython_1
/practise_file_1.py
UTF-8
102
2.734375
3
[]
no_license
guitar_parts = ["body", "neck", "bridge", "scratch-plate"] for part in guitar_parts: print(part)
true
be8e93539b0cc2d4333a4aa0e44e7239e7667405
Snowerest/leetcodeQuestion-Python
/string_multipy.py
UTF-8
108
3.25
3
[ "MIT" ]
permissive
def string_multiply(first: string, second: string) -> string: return string(int(first) * int(second))
true
f36812c5b4ea250e6d1bc8a46a34bc0bd5b9705c
here0009/LeetCode
/Books/CrackingtheCodingInterview/1005_SparseArraySearchLCCI.py
UTF-8
1,913
3.828125
4
[]
no_license
""" 稀疏数组搜索。有个排好序的字符串数组,其中散布着一些空字符串,编写一种方法,找出给定字符串的位置。 示例1: 输入: words = ["at", "", "", "", "ball", "", "", "car", "", "","dad", "", ""], s = "ta" 输出:-1 说明: 不存在返回-1。 示例2: 输入:words = ["at", "", "", "", "ball", "", "", "car", "", "","dad", "", ""], s = "ball" 输出:4 提示: words的长度在[1, 1000000]之间 来源:力扣(LeetCode) 链接:ht...
true
18c03236a6c5134fda3cd73281d0cceae575041d
rachit-k/Regressions_GDA
/A1/Q3.py
UTF-8
2,126
3.046875
3
[]
no_license
import numpy as np import csv import matplotlib.pyplot as plt import math import sys def main(): # (a) with open("logisticX.csv") as f1: x = np.genfromtxt(f1,delimiter=',') with open("logisticY.csv") as f2: y = np.genfromtxt(f2,delimiter=',') x1=x[:,0] x2=x[:,1] x1=(x1-np.mean...
true
2b9a77d7b6ae6bf7734c83e581a8ae8729f467c7
chunyi-lai/marshmallow-code
/app/etl_process.py
UTF-8
2,281
3.015625
3
[]
no_license
from database import Database from util import getCityNamesFromFile, getConfig, transform, MAJOR_CITIES import json import time import requests def transform(weather_data): return { "city_id": weather_data['id'], "city_name": weather_data['name'], "country": weather_data['sys']['c...
true
99418f3afef877801e32a46ae658a0768bbacbe7
P-Deasy/PythonMovieLibrary
/movieLib.py
UTF-8
4,119
3.921875
4
[]
no_license
from functools import total_ordering @total_ordering class Movie: """ Represents a single Movie. """ def __init__(self, i_title, i_date=None, i_runtime=None): """ Initialise a Movie Object. """ self._title = i_title self._date = i_date self._time = i_runtime de...
true
708a87fca9f1ffa867e3c5becbafa1be95b33036
fechan/VocabSubs
/vocabinjector.py
UTF-8
5,445
2.953125
3
[]
no_license
import pysubs2 import re from fugashi import Tagger from jamdict import Jamdict class VocabInjector: def __init__(self, pos_excludes = [], vocab_max_appearances = -1, appearances_carryover = False, max_gloss_terms = -1, sub_filter = lambda x: True, lemma_excludes = []): """Construct a VocabInje...
true
12550fcf26b23b7ca21a971104f396f73579a32b
ggiesa/AutonoTrader
/utils/toolbox.py
UTF-8
5,845
3.015625
3
[]
no_license
'''Miscellaneous utility functions to be used project-wide.''' # Basics import pandas as pd import numpy as np import json import urllib.request as request import requests import ndjson import pymysql from datetime import datetime, timedelta import time import sys # Binance API from binance.client import Client from ...
true
df83cdad3aea2d7c68f8bfe38c468355c42dfd18
aunetx/loulou
/scripts/train.py
UTF-8
3,638
2.6875
3
[ "MIT" ]
permissive
#!/usr/bin/env python3 import argparse import json from loulou import runTrain from utils import listToArch if __name__ == '__main__': params = {} params['epochs'] = 15 params['batch'] = 20 params['learning_rate'] = 0.03 params['activations'] = ['relu'] params['save_timeout'] = 0 params[...
true
fa89c9140d3680519449847eb59334d7512c252e
CJKu/pycairo
/png_mask.py
UTF-8
1,430
3.171875
3
[]
no_license
#!/usr/bin/python ''' ZetCode PyCairo tutorial This program shows how to draw an image on a GTK window in PyCairo. author: Jan Bodnar website: zetcode.com last edited: August 2012 ''' from gi.repository import Gtk import cairo class Example(Gtk.Window): def __init__(self): super(Example, self).__i...
true
b867f699778d3c307fbf34f0f6b41f3ea50e883e
santiagocarod/Checkers
/checkers.py
UTF-8
11,026
2.59375
3
[]
no_license
import sys import time import random as rand import os import threading import traceback import subprocess import signal BLANCO='-' TOT=0 J1={ 'pieces':'xX', 'adversary':'oO', 'crown':7, 'direction':{ 'x':[(1,1),(1,-1)], 'X':[(1,1),(1,-1),(-1,1),(-1,-1)] } } J2={ 'pieces':'oO'...
true
d8ce826e7c0cbea9a0803386c082b9533d192603
AndrewMiranda/holbertonschool-higher_level_programming
/0x0A-python-inheritance/9-rectangle.py
UTF-8
740
3.359375
3
[]
no_license
#!/usr/bin/python3 """ A module for BaseGeometry class. """ BaseGeometry = __import__('7-base_geometry').BaseGeometry class Rectangle(BaseGeometry): """A rectangle class.""" def __init__(self, width, height): """Initialize the rectangle class.""" self.__width = width self.__height =...
true
54b818c9417cff700875bdf07503dc2c92a2aa47
makechatbot/tensor-flow-tutorial
/08-StudyForMySelf/transpose_example.py
UTF-8
3,505
3.296875
3
[]
no_license
import tensorflow as tf from tensorflow.contrib import rnn import numpy as np def transposeTest1(perm): print("------------------------") x = [[1, 2, 3], [4, 5, 6]] print("x",x) print("perm 이 = ",perm, " 일 때 ") transPose1 = tf.transpose(x, perm=perm); with tf.Session() as sess: ...
true
1fcdfde8749b4202d8cd99ad51627c4cc6befd4f
yashvkirloskar/HExIt
/Test_State_Utils.py
UTF-8
1,794
3.234375
3
[]
no_license
from State_Utils import * def testBFSRight(board, game_size, expected): test = bfs_right(board, game_size) assert(np.array_equal(test, expected)) def testBFSLeft(board, game_size, expected): test = bfs_left(board, game_size) assert(np.array_equal(test, expected)) def testBFSDown(board, game_size, exp...
true
63a7551bef83f3fefbf117c206affe49a19222d9
pradyumnac26/Leetcode
/relativesort.py
UTF-8
366
2.90625
3
[]
no_license
class Solution: def relativeSortArray(self, arr1: List[int], arr2: List[int]) -> List[int]: b=[] q=[] for i in arr2 : for j in arr1 : if i==j : b.append(i) for i in arr1 : if i not in b : q.append(i) ...
true
fb7b99fcde1f2a350fd1e1829990eb340b85d5d7
TheScrawl/Scripts
/slowPrint.py
UTF-8
720
2.75
3
[]
no_license
import sys, time printf = sys.stdout.write flush = sys.stdout.flush def sp(text, speed): for char in text: printf(char) time.sleep(speed) flush() sp('''------------------------------------------------------------------ Hi. My name is Bit, and if you're hearing this, i'm alread...
true
6a86e585a31cef26643ea50c096028b7509767e3
onezerosix/cpsc-452-prj2
/CipherDriver.py
UTF-8
7,109
3.09375
3
[]
no_license
""" CPSC 452 Assignment 2 Cipher Driver Python 2.7 CFB is slow for large files run long file: python CipherDriver.py DES 1234567890abcdef ENC long.txt des.enc; python CipherDriver.py DES 1234567890abcdef DEC des.enc des.dec; python CipherDriver.py RSA pubkey.pem ENC long.txt rsa.enc; python CipherDriver...
true
d4343cefb5acf00d99567576f93a955003e1dbca
Jasonjiang27/mycodes
/DragonCurve.py
UTF-8
321
3.265625
3
[]
no_license
import turtle as t def dragon(level=4,size=200,zig=t.right,zag=t.left): if level <= 0: t.forward(size) return size /= 1.41421 zig(45) dragon(level-1,size,t.right,t.left) zag(90) dragon(level-1,size,t.left,t.right) zig(45) t.speed(0) t.hideturtle() dragon(8) t.exitonclick()...
true
546101e509e5c1e0abaefe5724f53ed420cb6451
qkralswl689/CodingTestStudy
/Algorithm_python/ct0718/cu6017.py
UTF-8
92
3.078125
3
[]
no_license
import sys a = sys.stdin.readline().strip() for i in range(3) : print(a, '', end='')
true
6a52241f3cb33d35a014c42815ddbf3001ee275e
helenwxp/China_A_shares_industry_analysis
/webscraping+wordcloud/industry_policy_scraping.py
UTF-8
3,633
2.703125
3
[]
no_license
# %% from bs4 import BeautifulSoup import requests as reqs import os from openpyxl import Workbook from openpyxl import load_workbook import pandas as pd import numpy as np import re from tqdm import tqdm # %% visit website: zhengce.chinabaogao.com header = { 'User-Agent':'Mozilla/5.0 (Windows NT 10.0...
true
2289172d900a7dd46988ed974a89c504c7c68815
mbroihier/garage-door-opener
/Lock.py
UTF-8
4,131
3.140625
3
[ "MIT" ]
permissive
''' Created on Apr 16, 2018 @author: broihier ''' class Lock(object): ''' Creates and uses a lock object ''' MODULO = 214326 SLOPE = 1807 OFFSET = 45289 MAX_LIST_SIZE = 1000 def __init__(self, key, last_seed): ''' Constructor ''' self.key_list = [] ...
true
0db1e42a3d166f4120c914d2115dbdfd41b0c311
FangyeShi/Web_Scraping
/classifier_based_on_word_embedding.py
UTF-8
7,462
3.15625
3
[]
no_license
import tensorflow as tf import tensorflow_hub as hub import numpy as np import pandas as pd import re import matplotlib.pyplot as plt import seaborn as sns from sklearn.model_selection import train_test_split # This is a script to train a sentiment classifier using a pretrained word-embedding model and a NN w...
true
612c592e9ff739a32fa91b22922cc9f2cab9c75d
linnndachen/coding-practice
/Leetcode/444-toposort.py
UTF-8
1,182
3.265625
3
[]
no_license
# check there exist a seq # check that's the only seq # check the only seq is the same as the given one from collections import deque class Solution: def sequenceReconstruction(self, org: List[int], seqs: List[List[int]]) -> bool: graph = {} degree = {} for seq in seqs: for num i...
true
bacf007b9b7a22333fadda7ad65bbebcce0d3265
jdrahoz/Credit_Cards
/app/src/save.py
UTF-8
3,131
2.71875
3
[]
no_license
# ------------------------------------------- # # # file: save.py # author: julia drahozal # # store data in spreadsheet # # ------------------------------------------- # # include libraries import xlwt # include files from constants import * # ------------------------------------------- # # run save def runSave (...
true
9245d7ecc9c82935cade7950485c841ad505a4e3
raufkarakas/PythonExercises
/3_ageInSeconds/ageInSeconds.py
UTF-8
284
3.640625
4
[]
no_license
__author__ = 'rkarakas' from datetime import * def ageInSeconds(): birth = input("Please enter your birth date (DD.MM.YYYY) -> ") age = datetime.now() - datetime.strptime(birth, "%d.%m.%Y") print("You have been living %i seconds." %(age.total_seconds())) ageInSeconds()
true
c5b9423d41c63e55ba5f9d59b090befde58ab6b0
maverickho4572021/discord-bot
/ext/keyword.py
UTF-8
1,900
2.671875
3
[]
no_license
import json from discord.ext import commands EXT_PATH = "./ext" KEYWORD_PATH = EXT_PATH + "/Keyword" class Keyword(commands.Cog): def __init__(self, bot): self.bot = bot self.data = None @commands.Cog.listener() async def on_ready(self): with open(f"{KEYWORD_PATH}/__data__.json", ...
true
42fed3e861cc40cc227d1c659ac3508950dc38bb
Beltus/MIT_OCW_Exercises-Into-to-Computer-Science
/ps1.py
UTF-8
2,224
3.46875
3
[ "Giftware" ]
permissive
# -*- coding: utf-8 -*- """ Created on Sat Feb 2 02:57:36 2019 @author: Acer """ """ % Inputs Section User enters annual salary into annual_salary display "Enter your annual Salary:" User enters monthly %tage of salary to be saved into portion_saved dısplay "Enter the percent of your salary to sa...
true
6c57179927bf203eb41ade9a7cea0893682fdb05
sirnicolaz/trading-facility
/tests/test_sell_profit_calculator.py
UTF-8
2,853
2.765625
3
[]
no_license
from unittest import TestCase from controllers.profit_calculator import get_achieved_profit class TestSellProfitCalculator(TestCase): def test_get_sell_profit_base_case(self): orders = [{ 'OrderType': 'LIMIT_BUY', 'ActualQuantity': 5.0, 'PricePerUnit': 0.003 }, ...
true
18e934d465fbde6d9009aa84dea980c7b4c78309
JoePater/eurobot
/code/hardware/servos.py
UTF-8
375
2.625
3
[]
no_license
from bus import bus servos_addr = 41 current_byte = 0 def setServo(num,x): global current_byte if x: current_byte |= 1 << num else: current_byte &= ~(1 << num) bus.write_byte(servos_addr,current_byte) # "GRABBED" or "RELEASED" def setHolder(num,stat): setServo(num,stat==...
true
90f913184c9e1e4e2296f019d032fabe31ae84d8
covid19-modeling/pyncov-19
/pyncov/pyncov.py
UTF-8
12,525
2.859375
3
[ "MIT" ]
permissive
# -*- coding: utf-8 -*- """ SARS-CoV-2 probabilistic simulator https://github.com/covid19-modeling This simulator was used to train the predictions available at: https://covid19-modeling.github.io/ The method is described in detail in the preprint: Matabuena, M., Meijide-García, C., Rodríguez-Mier, P., & Leborán...
true
c114ebcd3829443f0de0d65eb89c2e3b83244268
rlorigro/mungus
/test_feature_extraction.py
UTF-8
3,510
2.578125
3
[ "MIT" ]
permissive
from modules.IterativeHistogram import IterativeHistogram from matplotlib.patches import ConnectionPatch from modules.align import BriefAligner from matplotlib import pyplot from random import randint from scipy import signal import os.path import numpy import math import sys import cv2 def get_sortable_...
true
f0ec5bf86f8967d52989b61510da64abc1c63663
nicholasinatel/Udacity
/Projects/02-Break-Time-App/break_time.py
UTF-8
489
3.46875
3
[ "MIT" ]
permissive
# This Program # STEP:0 - Count Time Upon Activation # STEP:1 - If time = 2 hours : Take a Break # STEP:2 - Open Browser With Video Song # STEP:3 - Go back to Step:0 import webbrowser import time total_breaks = 2 break_count = 0 timer = 5 url = raw_input("Enter with desired URL: ") # for var in (inicio, fim, passo) ...
true
69c975a9773de08d86c8d310db3311a3825b133d
y2sec/Algorithm
/Baekjoon/1504_Problem.py
UTF-8
1,228
3.484375
3
[]
no_license
# 1504 특정한 최단 경로 import sys import heapq def dijkstra(start): distances = [[float('inf'), start] for _ in range(N+1)] distances[start] = [0, start] queue = [] heapq.heappush(queue, [0, start]) while queue: curr_distance, curr_vertex = heapq.heappop(queue) if curr_distance > dist...
true
10f5bebd850726bbe70c069382fbaf5c3565af0c
alexandraback/datacollection
/solutions_5640146288377856_0/Python/Nyaganya/brattleship.py
UTF-8
227
2.890625
3
[]
no_license
from sys import stdin T = int(stdin.readline()) for t in xrange(1,T+1): C, R, W = map(int, stdin.readline().split()) x=0 if (R%W != 0): x+=1 res = R/W+(W-1) +x print "Case #%d: %d" %(t,res)
true