blob_id
stringlengths
40
40
language
stringclasses
1 value
repo_name
stringlengths
5
133
path
stringlengths
2
333
src_encoding
stringclasses
30 values
length_bytes
int64
18
5.47M
score
float64
2.52
5.81
int_score
int64
3
5
detected_licenses
listlengths
0
67
license_type
stringclasses
2 values
text
stringlengths
12
5.47M
download_success
bool
1 class
89fe3f0295ebf82b45fd715b5386857dc5394ba6
Python
josiah-bennett/mp3p
/mp3p/time_manipulation.py
UTF-8
1,686
3.484375
3
[ "MIT" ]
permissive
from mp3p.time_util import TimeUtil def goto_help(cmd): """display the help screen for the goto method.""" print('The goto command takes a timestamp and jumps to that location in the audio.') print('Syntax: goto timestamp') print('timestamp: hour:minutes:seconds') print(' minutes:seconds') print(' ...
true
ffd58bc32ac7880558cdd9405c1737dee465feb4
Python
pvigier/lpc-scripts
/apply_palette.py
UTF-8
753
2.9375
3
[ "MIT" ]
permissive
import sys import time import numpy as np from PIL import Image def color_image(indices, palette): print(indices.shape, palette.shape) return Image.fromarray(palette[0,indices], mode='RGBA') if __name__ == '__main__': if len(sys.argv) < 3: print('Too few arguments: a greyscale image and a palette ...
true
12cbad83d2bbc01d506131d4db5f9120fa4c0abd
Python
Wanqianxn/refugees-say
/helpers.py
UTF-8
4,671
2.890625
3
[]
no_license
import random import pandas as pd import numpy as np class MatchingAlgo: def __init__(self, cases, sites): self.cases = cases self.sites = sites # Takes community's details (city, state) and returns dict of relevant info. def communityInfo(self, city, state): comDf = self.sites[(s...
true
03ebcf5ea77d0c9a8f5670c8d744f8a22a8be0d0
Python
loveAlakazam/Homeworks2019
/ProgramTraining/SW_Expert_Academy/1284/수도요금경쟁.py
UTF-8
283
2.84375
3
[]
no_license
#13분14초 T=int(input()) for t in range(1,T+1): P,Q,R,S,W= map(int, input().split()) A= W*P #A사: 1리터당 P원, W리터당=> P*W원 #B사: (W<=R) Q원 (W>R) Q+(W-R)*S B=Q if(W>R): B+=S*(W-R) result=min(A,B) print('#{} {}'.format(t, result))
true
0775c1cbf181f32510c4ecdc0c17d1ab0c6f247b
Python
reddyonlinenow/codebreakers-solutions
/leetcode/142/142.py
UTF-8
1,045
3.796875
4
[]
no_license
# Definition for singly-linked list. # class ListNode: # def __init__(self, x): # self.val = x # self.next = None class Solution: def detectCycle(self, head: ListNode) -> ListNode: # check to see if head is None or of length 1 if not head or not head.next: return Non...
true
214029d2049d7faddad3649690b541b973cb5fa1
Python
Lukdes/ATM-project
/main.py
UTF-8
1,213
3.25
3
[]
no_license
from Banksystem import Bank Luke = Bank("Luke", "1234" , "4321" ) go = Luke.Login() while go: #once acess is granted, you need to choose one of the seven choices and then hit enter. If something else is typed you are told to choose a number from 1 to 7 print "_________________________________________________...
true
1a170e0fe6fa3a81f2c9159275d4af16c9aa1caf
Python
pawelczapla/gameofcheckers
/checkers/constants.py
UTF-8
543
2.921875
3
[]
no_license
import pygame # Dimensions WIDTH, HEIGHT = 800, 800 ROWS, COLS = 8, 8 square_size = 100 # Colors RED = (255, 0, 0) WHITE = (255, 255, 255) BLACK = (0, 0, 0) BLUE = (0, 0, 255) GREY = (128, 128, 128) # Assets circle = pygame.image.load('assets/circle.png') background = pygame.image.load('assets/black.jpg') tile = pyg...
true
ece28d6043f3c38ab3f403232d87dd06648f0ea6
Python
PyrosCoffee/KBA-iot-portfolio
/monitor_ii/db.py
UTF-8
1,154
2.5625
3
[]
no_license
""" Edited the db.py that was in the base components to suit the needs of the project """ import os from sqlalchemy import Column, DateTime, Float, Integer, String from sqlalchemy.ext.declarative import declarative_base from datetime import datetime # data folder doesnt get things added to it, fix later db_folder = ...
true
fe29ea0ad32892dc9f3b87d211a9622e0900befd
Python
TheHa1fBloodPrince/formautofill
/FormAutoFill.py
UTF-8
2,208
3.3125
3
[]
no_license
#Created by: TheHalfBloodPrince from selenium import webdriver import pyautogui from datetime import datetime from threading import Timer print ('Executing Order 66...') option = webdriver.ChromeOptions() browser = webdriver .Chrome('/usr/bin/chromedriver') browser.get ("Insert form link") #Function that ma...
true
fc4d345dc456d380ced074d053837d533651f082
Python
adarshsingh994/Practice
/Python/MaximisingXor.py
UTF-8
382
3.03125
3
[]
no_license
#!/bin/python3 import math import os import random import re import sys # Complete the maximizingXor function below. def maximizingXor(l, r): maxXor = 0 for i in range(l, r + 1): for j in range(i, r + 1): curXor = i ^ j if curXor > maxXor: maxXor = curXor print(maxXor) if __name__ == '__main__': l...
true
639d69e2e9b3e5c77a1cc63ee40c45db6cdb8c3a
Python
songcq/mammoth
/tube_wrap.py
UTF-8
2,285
2.796875
3
[]
no_license
import solid as sc import math from solid.utils import Point2 import utils def f(x): l = x a = x p = Point2(math.cos(a), math.sin(a)) p.set_length(l) return p points = [f(i * 0.3) for i in range(100)] # d = _sp.catmull_rom_polygon(points, subdivisions=10) d = sc.text("hi", halign="center", val...
true
e8603fb188666256208b4440113f0f39d83671ba
Python
durbanie/ProjectEuler
/src/P1/Problem25.py
UTF-8
2,036
4.125
4
[]
no_license
''' Problem: Find the index of the first 1000 digit fibonacci number. Strategy: Brute-force & Mathematical Notes: Implementing this as an array with each digit as an entry in the array. In Python, this is actually not necessary (python allows an arbitrary number of digits in an integer), but in other langu...
true
8af18bb462c1a194394b1126f32ebe170d827b73
Python
guptaabhishekknp/algorithms_project-graphs
/allcode/Map.py
UTF-8
28,498
3.125
3
[]
no_license
#!/usr/bin/env python # coding: utf-8 # In[1]: import math import sys # In[2]: #functions for heap data structure #adjacency lists are implemented as python dictionaries def PARENT(i,D): n = len(D) if i>0: return math.floor((i-1)/2) else: return -1 def LCHILD...
true
4774c9f8023d73bbea0a50f30f5849ba2ca1a610
Python
newfull5/Baekjoon-Online-Judge
/[11399] ATM.py
UTF-8
158
3.046875
3
[]
no_license
input() cost = list(map(int, input().split())) cost = sorted(cost) answer = 0 for i in range(1,len(cost)+1): answer += sum(cost[:i]) print(answer)
true
6a122314914452ee9d4d921c4069fbadaf9404ef
Python
operfly/distribute_scpider
/test_2.py
UTF-8
1,994
3.65625
4
[]
no_license
# -*-coding:utf-8-*- import threading mutex_lock = threading.RLock() # 互斥锁的声明 ticket = 100000 # 总票数 # 用于统计各个线程的得票数 ticket_stastics = [] class myThread(threading.Thread): # 线程处理函数 def __init__(self, name): threading.Thread.__init__(self) # 线程类必须的初始化 self.thread_name = name # 将传递过来的name构造到类中的n...
true
bf859c72db9b4e519f2c4623e64f716e11df32f1
Python
MonchoG/Computer-Vision
/modules/face_recognition/Server.py
UTF-8
3,091
2.65625
3
[]
no_license
import base64 import pickle import socket import struct import sys import time from _thread import start_new_thread import cv2 import modules.face_recognition.recognize_faces as recognizer def string_to_image(string, title): fh = open("{}.png".format(title), "wb") fh.write(base64.b64decode(string)) prin...
true
99983da8be525ee89e20e4c9a95ba2cc3a4ac471
Python
GriffinPeirce/Aquabot_Streaming
/udpServer_pi.py
UTF-8
814
3.21875
3
[]
no_license
import socket def main(): #host = '192.168.1.101' #port = 22 #port for server #pass tuple of host and port #DGRAM = datagram s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) #by default, socket is TCP so we should specify it is UDP host = '192.168.1.101' port = 5000 #bind sock...
true
c6910f5ccefea5b2a641830d9dc8603254f64f62
Python
ambv/aiotone
/aiotone/uspectro.py
UTF-8
3,841
2.671875
3
[ "MIT" ]
permissive
#!/usr/bin/env python3 from __future__ import annotations from functools import lru_cache import os from pathlib import Path import click import numpy from PIL import Image from aiotone import audiofile from aiotone.colors import get_color, colors_to_buckets, convert_html_to_hsv BETA = 3.14159265359 * 2.55 def ...
true
15e82493228fb5e225f8d4a3089f689bb8cfeba1
Python
Sho-Tamura-Create/LearningPY
/pyxel/test00.py
UTF-8
1,611
2.96875
3
[]
no_license
import pyxel alphaChanel = 11 charset = {'A':0,'B':1,'C':2,'D':3,'E':4,'F':5,'G':6,'H':7,'I':8,'J':9,'K':10,'L':11,'M':12,'N':13,'O':14,'P':15,'Q':16,'R':17,'S':18,'T':19,'U':20,'V':21,'W':22,'X':23,'Y':24,'Z':25,'.':26,':':27,'!':28,'?':39,'0':0,'1':1,'2':2,'3':3,'4':4,'5':5,'6':6,'7':7,'8':8,'9':9} s = 0 class App: ...
true
801beb7d522948ed45d8c59b1929a0a8e58d1db2
Python
DevMayurJ/Duplicate-File-Finder
/DuplicateFileFinder.py
UTF-8
2,090
3.328125
3
[]
no_license
from sys import * import os; import hashlib; def hashfile(path, blocksize = 1024): fd = open(path, 'rb') hasher = hashlib.md5() buff = fd.read(blocksize) while len(buff) > 0: hasher.update(buff) buff = fd.read(blocksize) fd.close() return hasher.hexdigest() ...
true
55ba7e5f885c735a1352a557d239f433c75ba1e5
Python
RaymondZano/MBAN-Python-Course
/6_pandas and matplotlib essentials.py
UTF-8
2,670
3.625
4
[]
no_license
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Fri Aug 10 18:11:26 2018 @author: chase.kusterer Working Directory: /Users/chase.kusterer/Desktop/PyCourse Purpose: To introduce pandas and matplotlib """ ############################################################################### # Importing lib...
true
8602ab26cba7c4992d475b5fc0024141f5c0016b
Python
ArdelH/spaceGame
/classes.py
UTF-8
7,237
2.953125
3
[]
no_license
import pygame as pg from PIL import ImageFont pg.font.init() # Parent class buttons_and_labels(): def __init__(self, game_display, rectX, rectY, rectW, rectH, rectC, text, textC, font, size, bold, italic): self.game_display = game_display self.rectX = rectX self.rectY = rectY ...
true
fa5ded646961aa362414beafda4b7ea8136f28a5
Python
lettergram/DataProfiler
/dataprofiler/validators/base_validators.py
UTF-8
4,684
3.28125
3
[ "Apache-2.0" ]
permissive
#!/usr/bin/env python """ coding=utf-8 Build model for a dataset by identifying type of column along with its respective parameters. """ from __future__ import print_function from __future__ import division def is_in_range(x, config): """ Checks to see x is in the range of the config. :param x: number ...
true
55959cb38abe6244116ea968c4ec9e830590b4ca
Python
mingzeng8/ionization_calculator
/ADK_calculator.py
UTF-8
3,260
3.078125
3
[]
no_license
#calculate the parameters in ADK model import numpy as np import matplotlib.pyplot as plt import matplotlib.cm as cm from scipy.special import gamma from scipy.constants import c, e, m_e, physical_constants from fbpic.particles.elementary_process.ionization.read_atomic_data import get_ionization_energies class ADK_cal...
true
aca8078a350790d5cceb7626e0e9e266d3aca80d
Python
shamoldas/pythonBasic
/numpy/empty.py
UTF-8
269
3.796875
4
[]
no_license
# Python Programming illustrating # numpy.empty method import numpy as geek b = geek.empty(2, dtype = int) print("Matrix b : \n", b) a = geek.empty([2, 2], dtype = int) print("\nMatrix a : \n", a) c = geek.empty([3, 3]) print("\nMatrix c : \n", c)
true
dd1b6a3bd78415bd3d49561510c29f385b950ca9
Python
Deadlysmurf/Code-Scraps
/t_test_summary_stats.py
UTF-8
1,276
2.8125
3
[]
no_license
### For t-test hypothesis testing when only summary statistics are provided ## DEPENDANCIES: ## import numpy as np ## import scipy.stats as ss def t_test(sample_mean, mu, sd, n, alpha, tails): if tails == 1: t_critical = (sample_mean-mu)/(sd/(np.sqrt(n))) pval = ss.t.sf(np.abs(t_critical), n-1) ...
true
9ee6f4db7e25a239e2725a8c95d7cc841b3d9015
Python
Iammagneat/gl_test_numbers1
/count_numbers.py
UTF-8
170
3.3125
3
[]
no_license
with open('numbers.txt') as file: text_list = [line.rstrip() for line in file] x = 0 for i in text_list: if not i.startswith('#'): x += float(i) print(x)
true
734175ef5d647a7f807616e06a1cd73c3c482606
Python
impelfin/rpi_with_iot
/python/p17_if.py
UTF-8
161
3.828125
4
[]
no_license
a = int(input("Input the First number : ")) b = int(input("Input the Second number : ")) if a > b: print("Max is %d" % a) else: print("Max is %d" % b)
true
c2c6506fcfaa21c79ce94e1b2db30218f6d062dd
Python
Bootstrap360/RL
/environments/gridworld2.py
UTF-8
10,105
2.859375
3
[]
no_license
import numpy as np import random, copy, math import itertools import scipy.misc import matplotlib.pyplot as plt from PIL import Image import cv2 class gameOb(): def __init__(self,coordinates,size,color,reward,name): self.x = coordinates[0] self.y = coordinates[1] self.size = size s...
true
db71ec188766bf306982476b1f7c1715afe7a993
Python
Teenspirit-Hao/Discrete-Event-Simulator
/model.py
UTF-8
1,660
2.671875
3
[]
no_license
import numpy as np import os import random """ Machines are created here Whenever you use the machine release it """ class Machine(object): def __init__(self, name): self.machineID = int(name) self.machineName = "Machine_"+str(name) self.machineBusy = False self.jobO...
true
09044b8a8fcc699a61a9bc9fbf7a6d39f10fa07b
Python
pbharathkoundinya/CSD-LAB
/CSD LAB/Lab 1/problem4.py
UTF-8
252
3.234375
3
[]
no_license
l=[] n=int(input("enter no.of elements :")) for i in range(n): i=int(input("enter element :")) l.append(i) d=max(l) a=[] l.remove(max(l)) for i in l: a.append(i) s=2*max(a) if d>=s: print("true") else: print("false")
true
10febffda3220a7edaf2fe9c65f3d6fe7edd3937
Python
laiy/Distributed_Computing
/wsgi/wsgi_app_on_tornado.py
UTF-8
433
2.515625
3
[]
no_license
import tornado.web import tornado.httpserver import tornado.wsgi def simple_app(environ, start_response): status = "200 OK" response_headers = [("Content-type", "text/plain")] start_response(status, response_headers) return ["Hello world!\n"] container = tornado.wsgi.WSGIContainer(simple_app) http_se...
true
536e1643495f44085345c591facd6f46371452e2
Python
Dwape/domotics
/back/webapp/read_db.py
UTF-8
2,896
3.1875
3
[]
no_license
#!/usr/bin/python #import MySQLdb import pymysql pymysql.install_as_MySQLdb() import datetime #cur = None # Database cursor db = None # A reference to the database def connect(): ''' Connects to the database use to store sensore values. ''' global db db = pymysql.connect(host="localhost", # y...
true
073336cf5dafa02e3eef78460604fb7ec33d0945
Python
Moenupa/MINEWORLDY
/titanic/sklearnimputer.py
UTF-8
2,209
2.609375
3
[]
no_license
# -*- coding: utf-8 -*- # @Author: Moenupa 2019/05/21 import pandas as pd import numpy as np from sklearn.experimental import enable_iterative_imputer from sklearn.impute import IterativeImputer, SimpleImputer from sklearn.impute import KNNImputer def func_procs(): try: dir = "C:\\Github\\MINEWORLDY\\titan...
true
da7348722198a214518ffb9dc426529b8a862c6f
Python
shazack/LeetCode-Pythonsolns-
/reverseVowels.py
UTF-8
1,186
3.578125
4
[]
no_license
class Solution(object): def reverseVowels(self, s): vowels = ('a','e','i','o','u','A','E','I','O','U') if len(s)==0: return "" r = list(s) start=0 end=len(s)-1 while start!=end or start+1==end: #both consonants if r[start] ...
true
fd12bbd584d6976f93c98517494ed4ea1d40eb50
Python
renukadeshmukh/Leetcode_Solutions
/142_LinkedListCycleII.py
UTF-8
1,974
4.25
4
[]
no_license
''' 142. Linked List Cycle II Given a linked list, return the node where the cycle begins. If there is no cycle, return null. To represent a cycle in the given linked list, we use an integer pos which represents the position (0-indexed) in the linked list where tail connects to. If pos is -1, then there is no cycl...
true
b54efff3d63c72f2d7678de530f8727c6ea9b594
Python
harshit0810/Acadview-Python-Assignments
/Assignment-4/solution.py
UTF-8
774
4.21875
4
[]
no_license
#QUESTION-1 list1=[23,34,553,542] print(list1[::-1]) #QUESTION-2 string1='Game Of Thrones' for i in string1: if(i.isupper()): print(i,end=' ') print() #QUESTION-3 string2=input("Enter the list:- ") string2=string2.split(',') list2=[] for i in string2: list2.append(int(i)) print(list2) #QUESTION-4 s...
true
af2bce3e12318369dcd612b306c39d93518901b5
Python
joanaosoriosousa/small-python-projects
/tic-tac-toe.py
UTF-8
6,230
4.375
4
[ "MIT" ]
permissive
import random game_board = """ {} | {} | {} --------- {} | {} | {} --------- {} | {} | {} """ def display_board(board): print(game_board.format(*board)) def ask_player_name(): player1 = input("Player 1, what's your name? \n") player2 = input("Player 2, what's your name? \n") return player1, playe...
true
006ca52082311ef223ecdb1ebb36ecb59e540c04
Python
EduardoAlbert/python-exercises
/Mundo 2 - Estruturas de controle/057-065 Estrutura de repetição while/ex065.py
UTF-8
449
3.71875
4
[]
no_license
opcao = '' c = 0 soma = 0 lista = [] media = 0 while opcao in 'S': valor = int(input('\033[36mDigite um número: ')) lista.append(valor) c += 1 soma += valor opcao = str(input('\033[30mQuer continuar [S|N]? ')).strip().upper()[0] media = soma / c print('\033[31mA média entre todos o valores é {}'.f...
true
e2d3d22f35f4c8c976941e4a3a082eb6de73133d
Python
peskin55/PythonProgramming1
/Zachary_Peskin_Final_Programming_Assignment.py
UTF-8
3,185
2.96875
3
[]
no_license
#!/usr/bin/env python from bs4 import BeautifulSoup from re import findall from urllib.parse import urljoin from urllib.parse import urlparse from html.parser import HTMLParser from urllib.request import urlopen class Vocab(HTMLParser): def __init__(self, url): HTMLParser.__init__(self) self.url = ...
true
b4a42fb58d1ef59e54a3be25ac257f0b53bd33cf
Python
amolpandit38/fingercursor
/handTrackingModule.py
UTF-8
4,363
3.140625
3
[]
no_license
"""------------------Creating Hand trackig Package----------------------------""" import cv2 import mediapipe as np import time import math """-------------------------------Creation of Hand_Detection Class---------------------------------""" """ Methods inside Hand Detection Class ...
true
e0c5795434c4aec4a669371f5cc6dbe6f6c79d33
Python
RJHarvest/book-web-scraper
/scrapeInfo.py
UTF-8
1,244
3.328125
3
[]
no_license
import requests import pandas as pd from bs4 import BeautifulSoup def main(): titles = [] prices = [] ratings = [] for i in range(1,51): html_page = requests.get(f'http://books.toscrape.com/catalogue/page-{i}.html') content = html_page.content soup = BeautifulSoup(content, 'htm...
true
b593f6e13c384045c0dcdb719d6fa4003551caf8
Python
ypark54/Python
/discord_test/keyboard_test.py
UTF-8
95
2.703125
3
[]
no_license
import keyboard while True: a = keyboard.read_key() #print(a)
true
ade8e27ddc455e3e6d82dec3ecf0b01988ba42d1
Python
matiasimc/RedesNeuronales
/tarea1/src/Network.py
UTF-8
1,497
2.9375
3
[]
no_license
from Layer import * class NeuralNetwork: def __init__(self, opts): self.learningRate = opts.learningRate self.iterations = opts.iterations self.layers = [] self.layers.append(Layer(opts.input_size, opts.input_size)) for (i, c) in enumerate(opts.hidden_layers): se...
true
b02714461499f2c5976014c7d94bb4bfaf84a1b1
Python
LakhanShanker/TextConvertor
/speechToText.py
UTF-8
975
3.375
3
[]
no_license
import speech_recognition as speech def takeCommand(): #method to take audio r = speech.Recognizer() #recognizer class of speech recognition with speech.Microphone() as source: #taking input through microphone r.adjust_for_ambient_noise(source) #adjusting noise print("Listening........
true
ebc456fcb0bf5c1381cb041a38b34ca24caef050
Python
kbala42ylv/ebabot
/classes/browser.py
UTF-8
2,250
2.515625
3
[]
no_license
from selenium import webdriver from selenium.common.exceptions import NoSuchElementException from selenium.common.exceptions import TimeoutException from selenium.common.exceptions import StaleElementReferenceException from selenium.webdriver.support.ui import WebDriverWait import classes.log as log import settings ch...
true
b9ff020e560202b96093a4d1844f6f4e428a79a4
Python
Data-Tach/ML-4-e
/operations-on-opencv/ex2.py
UTF-8
207
2.5625
3
[ "MIT" ]
permissive
# Blur image import cv2 import imutils img = cv2.imread("resizeImg.png") gaussianBlur = cv2.GaussianBlur(img, (21,21), 0) cv2.imshow("gaussianBlur.png", gaussianBlur) cv2.waitKey(0) cv2.destroyAllWindows()
true
fcbd4a19dc0269f8b94b3b1b1000b79ae3a2ad7a
Python
yangyuxiang1996/leetcode
/out/production/leetcode/225.用队列实现栈.py
UTF-8
1,305
3.75
4
[]
no_license
# # @lc app=leetcode.cn id=225 lang=python3 # # [225] 用队列实现栈 # # @lc code=start from collections import deque class MyStack: def __init__(self): """ Initialize your data structure here. """ self.deque1 = deque() self.deque2 = deque() def push(self, x: int) -> None: ...
true
7ab93dbabb0b11f2e22e6bb98cbee14e33a7c288
Python
qiufengdiewu/LPInsider
/039description2POS.py
UTF-8
2,441
2.734375
3
[ "Apache-2.0" ]
permissive
# coding=utf-8 import stanfordcorenlp import pandas as pd """ 注释一是将lncrinter的正样本作为训练集 """ def precess(description): description = description.replace('(', ' ') description = description.replace(',', ' ') description = description.replace(')', ' ') description = description.replace('.', ' ') ...
true
806bb757144b41b9e12627e25277317dcea6ba31
Python
c18gour/K_book
/chapter8/8-printTime.py
UTF-8
452
3.625
4
[]
no_license
class Time: pass def printTime(time): print(str(time.hours)+':'+str(time.minutes)+':'+str(time.seconds)) currentTime = Time() currentTime.hours = 9 currentTime.minutes = 14 currentTime.seconds = 30 printTime(currentTime) class Time: def printTime(time): print(str(time.hours)+':'+str(time.minutes)+':'+str...
true
ab477d85c8ff0a2b42799f6745ee6db12150118c
Python
joordan/greyhound-bus-scraper
/scrape.py
UTF-8
2,032
2.828125
3
[]
no_license
import numpy as np from selenium import webdriver from selenium.webdriver.support.ui import Select outputfile = open("output.txt","w+",encoding='utf-8') options = webdriver.ChromeOptions() options.add_argument('headless') #driver = webdriver.Chrome() driver = webdriver.Chrome(chrome_options=options) #driver.get("...
true
a139822cec07ad589557b6938ea59d9305582c7c
Python
mohrobati/JS-Buxter
/repair/live_variables_extractor.py
UTF-8
3,265
2.75
3
[ "MIT" ]
permissive
from copy import deepcopy class LiveVariablesExtractor: def __init__(self, program): self.__program = program self.__live_variable_elements = self.__getLiveVariableElements('./configs/live_variable_elements.txt') self.__variables = [] def __getLiveVariableElements(self, path): ...
true
f2f745d476bba9cd17b9ffefdce7018a9af41e01
Python
jdpatt/AoC
/2020/day_8/day_8.py
UTF-8
2,310
3.65625
4
[]
no_license
"""Day 8""" import copy from os import read from pathlib import Path from typing import Tuple class BootCodeError(Exception): ... def read_in_boot_code(): """Each line consists of an operation and an argument.""" with open(Path(__file__).parent.joinpath("input.txt")) as puzzle_input: instruction...
true
aa4650835a8287ce9ed7c7a6b097cabde1f18a71
Python
nickliqian/keep_learning
/KnowledgeMapping/SpiderExp/1-Code/panyu.goodjob.cn/run.py
UTF-8
699
2.6875
3
[ "MIT" ]
permissive
import requests from lxml import etree import csv url = "http://panyu.goodjob.cn/job/pos970735.html" headers = { "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.108 Safari/537.36", } r = requests.get(url=url) html = etree.HTML(r.text) l...
true
1d530679716fe70c37d8e34991cce9d5045e162f
Python
piotrszleg/symbolic_manipulation
/expression.py
UTF-8
1,325
2.90625
3
[]
no_license
from itertools import zip_longest, product, accumulate from blist import sorteddict from dataclasses import dataclass, field @dataclass(unsafe_hash=True) class Expression: def matches(self, other, variables): return True def cost(self): return 1 def __lt__(self, other): return self....
true
32a77271e31d021b0af76d9c43df900a813f7d38
Python
1MT3J45/pyprog
/max.py
UTF-8
79
2.90625
3
[]
no_license
a = [8,5,9,6,8,4] max1 = a[0] for i in a : if i < max1: max1=i print max1
true
2596fc8ea7ceadae2dc5e3e49808bc7e00547a17
Python
jmslip/clever-historical-data
/service/calculos_geral.py
UTF-8
3,055
2.796875
3
[ "MIT" ]
permissive
from datetime import datetime, timedelta import pandas as pd from service.historico import HistoricoService from utils.clever_generics import CleverGenerics class CalculosGeral: def __init__(self) -> None: self.historico_service = HistoricoService() self.clever_generics = CleverGenerics() ...
true
c3459f21f5be23e39a8cd31008b0b8f4bfa8d405
Python
bitgrease/python_bases_exercises_1
/Chapter10Ex/10.3Ex/Dog.py
UTF-8
444
4.125
4
[]
no_license
class Dog: species = "Canis Familiaris" def __init__(self, age, name): self.age = age self.name = name def __str__(self): return f"{self.name} is {self.age} years old." def speak(self, sound): return f"{self.name} says {sound}." class GoldenRetriever(Dog): def s...
true
c7fd0888b68ae03ac5597c632dd23fd0a5c7f337
Python
gurlwithcurlz/hackday_django_test
/backend/power_analysis/models.py
UTF-8
1,502
2.765625
3
[]
no_license
from django.db import models import numpy as np from scipy.stats import norm, ttest_ind, ttest_ind_from_stats def binomial_std(n, p): """Calculate the standard deviation of the sample i.e. sqrt( var(X/n) ) or standard error.""" return np.sqrt(p*(1 - p)/n) # Create your models here. class PowerAnalysis(model...
true
05f3075883fb76081dab850a71ca33c2162d4a6a
Python
talkowski-lab/rCNV2
/data_curation/other/curate_gnomad_sv_gene_counts.py
UTF-8
3,058
2.578125
3
[ "LicenseRef-scancode-unknown-license-reference", "MIT" ]
permissive
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright (c) 2020 Ryan L. Collins <rlcollins@g.harvard.edu> # and the Talkowski Laboratory # Distributed under terms of the MIT license. """ Curates counts of functional SVs from gnomAD-SV VCF """ import pandas as pd import numpy as np import argparse from os.path i...
true
cf8a29c6366c0759d6b1c4c33dda9e658af5c03c
Python
ArakelyanEdgar/MachineLearningAlgorithms
/SVR/svr.py
UTF-8
1,089
3.125
3
[]
no_license
#SVR #importing libraries import pandas as pd import numpy as np import matplotlib.pyplot as plt import statsmodels.formula.api as sm from sklearn.preprocessing import StandardScaler from sklearn.preprocessing import LabelEncoder from sklearn.preprocessing import OneHotEncoder from sklearn.preprocessing import Polyno...
true
34dc9e5bc782e41718c86374e453af8f6c266a12
Python
simuxs123/Python
/exercise/exercise9.py
UTF-8
522
3.734375
4
[]
no_license
import random a = random.randint(1, 9) kiek=0; while True: inpt=input("Guess the number:") if inpt=="exit": break if inpt.isnumeric(): if a==int(inpt): print("Corect, you did",kiek,"guesses") print("Play again") a = random.randint(1, 9) kiek=0...
true
7607d066f6dcd9cd9fd4efb25191d435f69f6135
Python
lukas-manduch/spoj
/ADDREV/adding_reversed_numbers.py
UTF-8
132
3.296875
3
[]
no_license
i = int(input()) while i > 0: i -= 1 arr = input().split() print(int(str(int(arr[0][::-1]) + int(arr[1][::-1]))[::-1]))
true
491619af3190e0edbde90d9c3e045578a84704f4
Python
rodrigocarlos2/TermoGeralPA
/source.py
UTF-8
183
3.5
4
[]
no_license
a1 = input('Write the first name: ') r = input('Write the reason: ') n = input('Write the wished element number: ') an = a1+(n-1)*r print(an) while a1<=an: print(a1), a1 += r
true
906ebfcb9c624728e45a9f57ec87d4f99d6657a8
Python
marcosD67/HackerEarth
/MayEasy/subsets.py
UTF-8
101
2.734375
3
[]
no_license
#Result: 60/100 #Solved: 2:06:45 #Mainly meant to test their testcases. n = int(input()) print(n)
true
79b5ae6675325b55477fca9f6c7a5b59fa37a2ab
Python
dbgithub/recommender-systems
/recommendationasaservice/utils.py
UTF-8
1,719
3
3
[]
no_license
""" This module is called 'utils' because it owns miscellaneous methods that can come in handy in different scenarios throughout the project/application. For instance, statistics methods, subroutines for main methods in main, etc. """ __author__ = "Aitor De Blas Granja" __email__ = "aitor.deblas@ugent.be" from main ...
true
a28b98295caac98462e1e408e94ac1067aa84078
Python
rgommers/scipy
/scipy/stats/tests/test_odds_ratio.py
UTF-8
6,705
2.609375
3
[ "BSL-1.0", "BSD-2-Clause", "MIT", "LicenseRef-scancode-unknown-license-reference", "Qhull", "BSD-3-Clause" ]
permissive
import pytest import numpy as np from numpy.testing import assert_equal, assert_allclose from .._discrete_distns import nchypergeom_fisher, hypergeom from scipy.stats._odds_ratio import odds_ratio from .data.fisher_exact_results_from_r import data class TestOddsRatio: @pytest.mark.parametrize('parameters, rresul...
true
22118959ff67e0105463724ec921e4874058ea06
Python
marchampson/cbir_api
/cbir/quantize_example.py
UTF-8
1,222
2.703125
3
[]
no_license
from __future__ import print_function from mainwaring.ir import BagOfVisualWords from sklearn.metrics import pairwise import numpy as np # rand gen vocabular/cluster centers along with the feature vectors, we'll generate 10 FV containing # 6 real-valued entries, along with a codebook containing 3 'visual words' np.ran...
true
958a6d467305cfa427ee92c93773ebd60f38d986
Python
RVaishnavi-999/Advanced-Python-Programs
/Employee payroll programpy.py
UTF-8
701
3.890625
4
[]
no_license
# -*- coding: utf-8 -*- """ @author: Vaishnavi R """ """8. Program to calculate the employee weekly payroll using method overloading concept.""" class emp: def weekly_pay(self,whrs=None,pay=None,ohrs=None): if whrs!=None and pay!=None and ohrs!=None: total=whrs*pay+ohrs*pay print("t...
true
ad0ed6bfab03bb63177aaba00ed38c565acfe944
Python
jnaneshjain/PythonProjects
/com/underscorepython/pythonunderscoreinterpretor.py
UTF-8
165
3.0625
3
[]
no_license
''' >>> 5 + 4 9 >>> _ # stores the result of the above expression 9 >>> _ + 6 15 >>> _ 15 >>> a = _ # assigning the value of _ to another variable >>> a 15 '''
true
971fef3cce531b8247a4d35a8d3ea1e5cf30fb80
Python
gitman00/Pygame
/Demo Collision/collision_file.py
UTF-8
952
2.953125
3
[]
no_license
import pygame as p p.init() SCREEN_WIDTH,SCREEN_HEIGHT=1100,2250 SCREEN=p.display.set_mode((SCREEN_WIDTH,SCREEN_HEIGHT)) rect1=p.Rect(500,500,200,200) x_speed,y_speed=5,-4 rect2=p.Rect(400,1000,200,400) rect2_speed=2 def moving_rect(): global x_speed,y_speed rect1.x += x_speed rect1.y += y_speed if rect1.r...
true
ab0061747c4085c779edaba1567fb455198e9acf
Python
JZDBB/tensorflow
/basis/session_basis.py
UTF-8
597
3.421875
3
[]
no_license
# tf.Session() # 创建一个会话,当上下文管理器退出时会话关闭和资源释放自动完成。 # # tf.Session().as_default() # 创建一个默认会话,当上下文管理器退出时会话没有关闭,还可以通过调用会话进行run()和eval()操作. import tensorflow as tf a = tf.constant(1.0) b = tf.constant(2.0) with tf.Session() as sess: print(a.eval()) print(b.eval(session=sess)) a = tf.constant(1.0) b = tf.constant(2.0) wit...
true
bf847af14dbea2c27ea4ab879d495b3e6da0134c
Python
JY-Justin/pydailynotes
/pach/test_002.py
UTF-8
2,442
3.734375
4
[]
no_license
# python 解析库 lxml from lxml import etree text = ''' <div> <ul> <li class="item-0"><a href="link1.html">first item</a></li> <li class="item-1"><a href="link2.html">second item</a></li> <li class="item-inactive"><a href="link3.html">third item</a></li> <li class="item-1"><a href="...
true
2bfee52174d8686c1042c2d372a6c78f8a38b48b
Python
Hanler/Project-bio-beta
/animation.py
UTF-8
819
2.875
3
[]
no_license
from PyQt5 import QtCore class Animation(): @property def center(self): return self._center def animation(self, lb, x_center, y_center, parent): initial_rect = QtCore.QRect( x_center, y_center, 171, 171 ) zoom_factor...
true
185b94d18e39bcbdbeb5e11dfb31169eb8a75e3e
Python
pulakanamnikitha/nikki
/21.py
UTF-8
56
2.828125
3
[]
no_license
a,b,c=map(int,raw_input().split()) s=b+c c=s*a print(c)
true
14852021adb74dfdc2a3ec52f39119ec2d759e15
Python
JosiahRooney/Python
/sum.py
UTF-8
99
3.3125
3
[ "MIT" ]
permissive
def sumArray(arr): sum = 0 for x in arr: sum += x return sum print sumArray([1,2,5,10,255,3])
true
afa89c20f7c3dd75db788dc8d325363bb72c369b
Python
SuperZG/MyPythonLearning
/my_first_project/day3/chapter9/demo4(持续追加).py
UTF-8
373
3.328125
3
[]
no_license
with open('D:\\inout9\\multi2.txt', 'w') as example: flag = True while flag: message = input('Input anything, quit to exit:\n') if message == 'quit': flag = False else: message = message + '\n' example.write(message) with open('D:\\inout9\\multi2.txt'...
true
a0bd848d8d6b45213fe6788efab634ecc4cec125
Python
SahilMund/A_ML_Cheatsheets
/Machine Learning A-Z Template Folder/Part 1 - Data Preprocessing/datapreprocessingtamplete.py
UTF-8
616
2.921875
3
[]
no_license
# -*- coding: utf-8 -*- import numpy as np import matplotlib.pyplot as plt import pandas as pd #importing the data set dataset = pd.read_csv("Data.csv") #distinguishing bn independent and dependent coloumns in dataset X = dataset.iloc [:, :-1].values Y=dataset.iloc[:,3] #splitting data into test and train sets from ...
true
d1f788d554e9cea1f9656901af308bca0d431cb5
Python
chui101/covid-vis
/calculate_trends.py
UTF-8
2,982
3.171875
3
[]
no_license
#!/usr/bin/python3 import numpy from states import state_info, state_historic_data from matplotlib import pyplot def growth_rate(data, data_name='positive'): values = map(lambda x: 0 if (data_name not in x or x[data_name] is None) else x[data_name], data) nonzero = filter(lambda x: x > 0, values) y = numpy...
true
783648533d356a7e8db1e3e04e55b2fc61f0332a
Python
neilrobertson/BICRCode
/Baselib/genemapping/genelookup.py
UTF-8
2,683
3.09375
3
[]
no_license
# class for looking up information about a gene # so far includes: # - coordinate lookup (what coord for gene x?) # - name lookup (given gene id, provide common name?) # - interval overlap (given interval, what genes overlap?) from genemapping.coordlookup import * from datastructures.genomicintervalfinder import * cl...
true
40a64286d5cd10347dc43c6f6dbd8eefa8b2edaa
Python
shujji/iot
/snk/AnalogLight/al2.py
UTF-8
1,166
2.78125
3
[]
no_license
#!/usr/bin/env python # Example for RC timing reading for Raspberry Pi # Must be used with GPIO 0.3.1a or later - earlier verions # are not fast enough! import RPi.GPIO as GPIO, time, os import requests import time import datetime from time import gmtime, strftime DEBUG = 1 GPIO.setmode(GPIO.BCM) today = dat...
true
ec4018b16a5f78247377ce139b7117969499d5d2
Python
abhishek8899/Space-Invaders
/classes.py
UTF-8
362
2.984375
3
[]
no_license
class freeze(): def __init__(self, x, y, ti): self.x = x self.y = y self.t = ti class fire(): def __init__(self, x, y): self.x = x self.y = y class fire1(fire): def __init__(self, x, y): fire.__init__(self, x, y) class fire2(fire): def __init__(self,...
true
0a3eb7fbfb6dd0731c4f17f065d8c8e206abe293
Python
F1schGott/CSC108
/A1/admission_functions.py
UTF-8
4,545
3.9375
4
[]
no_license
"""Starter code for Assignment 1 CSC108 Summer 2018""" SPECIAL_CASE_SCHOOL_1 = 'Fort McMurray Composite High' SPECIAL_CASE_SCHOOL_2 = 'Father Mercredi High School' SPECIAL_CASE_YEAR = '2017' # Add other constants here DEGREE_LEN = 6 COURSE_LEN = 9 def is_special_case(record: str) -> bool: """Return True iff the...
true
6bc6815baa190c14aa42dd41a854930f3e6c61e2
Python
facelessuser/sublime-markdown-popups
/st3/mdpopups/coloraide/spaces/ipt.py
UTF-8
2,871
2.65625
3
[ "MIT" ]
permissive
""" The IPT color space. https://www.researchgate.net/publication/\ 221677980_Development_and_Testing_of_a_Color_Space_IPT_with_Improved_Hue_Uniformity. """ from ..spaces import Space, Labish from ..channels import Channel, FLG_MIRROR_PERCENT from ..cat import WHITES from .. import algebra as alg from ..types import V...
true
1c4b589a00eea38377806ffdcba657aac40f3261
Python
khua19/k
/flower.py
UTF-8
261
3.84375
4
[]
no_license
import turtle window = turtle.Screen() flower=turtle.Turtle() for i in range(25): flower.forward(150) flower.left(90) flower.forward(150) flower.left(90) flower.forward(150) flower.left(90) flower.forward(150) flower.left(75)
true
5140804f171aa8d6e8306c338549ee4d7f1b2dbe
Python
rootcoma/imageglitch
/image_glitch.py
UTF-8
24,387
2.734375
3
[ "MIT" ]
permissive
import ctypes from OpenGL import GL as gl from PIL import Image import sdl2 from shader_filters import * import random DEF_WINDOW_WIDTH = 1024 DEF_WINDOW_HEIGHT = 768 class View: """ Holds coordinates for navigating ortho view """ offset = (0.0, 0.0) zoom = 1 def reset(se...
true
119bcc198438a5c304bba7d3824e007f12b828d5
Python
avielb/DevOps0803
/11.py
UTF-8
356
3.15625
3
[]
no_license
myfile = open("read_my_contents.txt", "r") all_lines = myfile.readlines() for line in all_lines: print(line, end='') myfile.close() my_new_file = open("my_file.txt", "w") my_new_file.write("Hello my file....") my_new_file.close() my_other_file = open("read_my_contents.txt", "a") my_other_file.write("\nthis is th...
true
2cdeb1295969b6e9d21e01202713432f050a021f
Python
turner3467/football_scores
/scripts/download.py
UTF-8
1,206
2.765625
3
[]
no_license
#! /usr/bin/env python import csv import urllib.request as req import io base_url = "http://football-data.co.uk/mmz4281/" # 1516/E0.csv seasons = [str(i % 100).zfill(2) + str((i + 1) % 100).zfill(2) for i in range(100, 116)] leagues = [1, 2] cntry = {"eng": "E", "ger": "D", "fra": "F", ...
true
60d40adc65941e4f13ab2a1daac1ed64b71fde5e
Python
iCodeIN/pe
/test/test__parse.py
UTF-8
3,317
2.84375
3
[ "MIT" ]
permissive
from pe.operators import ( Dot, Literal, Class, Sequence, Choice, Optional, Star, Plus, Nonterminal, And, Not, Capture, Bind, ) from pe._parse import loads def eloads(s): start, defmap = loads(s) return defmap[start] def test_loads_dot(): assert eload...
true
34055eba8478acc8b7fe99b62b1268a1855f1cbc
Python
nathantheinventor/solved-problems
/URI Online Judge/Beginner/1017 Fuel Spent/fuel.py
UTF-8
56
2.546875
3
[]
no_license
print("{:.3f}".format(int(input()) * int(input()) / 12))
true
113dd3323512d928c75262939970dfb2d43d69f6
Python
ChanceQZ/rs-img-classification
/src/readTif.py
UTF-8
353
2.5625
3
[]
no_license
import cv2 import numpy as np import tifffile img = tifffile.imread('678.tif') a = img[:,:,0]+img[:,:,1]+img[:,:,2] b = np.zeros(a.shape, dtype=np.uint8) b[np.where(a == 0)] = 255 print(img.shape, np.max(img)) cv2.namedWindow("Image") cv2.imshow("Image", cv2.resize(b, (img.shape[0]//10, img.shape[1]//10))) cv2.wai...
true
6188784782489cd05bc1e843a03216e728968647
Python
StasyaZlato/Home-Work
/2016-2017/classworks/programming_test.py
UTF-8
1,528
3.671875
4
[]
no_license
#Задание1. Открыть файл и вывести на экран строчки, содержащие союз with open ('freq.txt', 'r', encoding = 'utf-8') as f: lines = f.readlines () for line in lines: if 'союз' in line: print (line) #Задание2. Распечатать через запятую все существительные женского рода #единственного числа и...
true
142077bb9333312704700bde57afb717423c0017
Python
emarahimself/mnist-pytorch
/dataset.py
UTF-8
3,654
2.875
3
[]
no_license
import idx2numpy from sklearn import preprocessing from sklearn.datasets import load_iris, load_digits, make_blobs from sklearn.model_selection import train_test_split import numpy as np import matplotlib.pyplot as plt from sklearn.decomposition import PCA class DatasetBase: x_train = None x_test = None y_...
true
8ffb9e82c988e8a26e41b8f39025f79e25df8327
Python
AleksanderKarmazin/Test_july_2020
/test.py
UTF-8
10,710
2.953125
3
[ "Apache-2.0" ]
permissive
import time from selenium import webdriver import pytest from selenium.common.exceptions import ElementClickInterceptedException, NoSuchElementException from loginPage import LoginPage from homePage import HomePage @pytest.mark.usefixtures("driver_init") class Test_Class_01(): # ТС_1.1. Логин с корректным ID по...
true
77ad1958758f8a399d137006b7eab0b92f900673
Python
davidcolton/bitesofpy
/304/max_letter.py
UTF-8
1,258
3.765625
4
[]
no_license
from typing import Tuple from collections import Counter import re def max_letter_word(text) -> Tuple[str, str, int]: """ Find the word in text with the most repeated letters. If more than one word has the highest number of repeated letters choose the first one. Return a tuple of the word, th...
true
dba44ccc13d136c8a703806e079aa30b96b2d197
Python
levit123/Basic-Python-Projects
/Budget/Budget.py
UTF-8
579
4.03125
4
[]
no_license
#new function named "calcBills" def calcBills(): #creates a variable with the following properties myBills = {'Electric': 120.00, 'Rent': 1200.00, 'Water_Sewer': 60.00, 'Car_Insurance': 75.00, 'Phone': 65.00} #creates an integer and sets its value to 0 total = 0 #uses a for loop to add all the numbe...
true
62b37d7d3843b46916ad86b61a882f1e1bdc2f9d
Python
otak007/RailNL
/code/algorithms/depth_first.py
UTF-8
6,128
2.90625
3
[]
no_license
from code.classes.map import Map from code.classes.stations import Station from code.classes.traject import Traject import copy import csv import matplotlib.pyplot as plt def all_stations(distance, color, map, all_critical, max_time, crit_stations, steps): ## Goes over all start stations and chooses best traject...
true
81aa66e73d243eae8768e1461f83acbeab3591d2
Python
DanielBaudry/makemegreen
/engine/footprint.py
UTF-8
4,481
2.59375
3
[]
no_license
""" Footprint """ from models import BaseObject, Footprint, User, FootprintType from engine import dictionnary as info from flask import current_app as app class BadUserException(Exception): pass class BadArgException(Exception): pass class ComputeFootprint: def __init__(self): pass def ge...
true
72c304aa7723b031632e35521b6b044ca579ac55
Python
erasta/blockly-cv2
/prj/water/code.py
UTF-8
274
2.609375
3
[]
no_license
import cv2 import numpy as np image = cv2.imread('media/lena.jpg',1) markers = [(10,10), (100,100), None] water = cv2.watershed(image,markers) print(water) cv2.imshow('mywin',image) cv2.imshow('watershed',water) if cv2.waitKey(0)&0xff == 27: pass cv2.destroyAllWindows()
true
1900ebf9d609ac767d5e0349077683068fa1055e
Python
tuxmsantos/exemple02
/operations.py
UTF-8
129
3.515625
4
[]
no_license
num1 = input("digite o primeiro numero....:") num2 = input("digite o segundo numero.....:") total = int(num1 / num2) print total
true