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
b9f92b2df654304ca59ae1b6ff5ff9d9168c6316
hasanalkholil/fashion-mnist-cnn
/fashion-cnn.py
UTF-8
1,877
2.96875
3
[]
no_license
import numpy as np import pandas as pd from keras.models import Sequential from keras.layers import Conv2D from keras.layers import MaxPooling2D from keras.layers import Flatten from keras.layers import Dense from keras.layers import Dropout from keras.utils import to_categorical data_train = pd.read_csv('fashion-mni...
true
44b8bdb88b04a9e0de763b5108b9c77edfc46bc1
erickdaguilar/Python
/files/ejercicio.py
UTF-8
296
3.46875
3
[ "MIT" ]
permissive
# -*- coding: utf-8 -*- """ Created on Thu Nov 14 13:50:51 2019 @author: usuario """ print("¿Cual es tu nombre?") nombre= input() print("¿En que año naciste?") edad= int(input()) edad= 2019-edad edad= str(edad) with open ("datos.txt","w") as file: file.write(nombre) file.write(edad)
true
dcfb70da7d4d0f04ce7eb1275b2d2ee1fb695482
Kabelo741/potato-milk
/DQN_Cartpole.py
UTF-8
5,042
2.671875
3
[]
no_license
import tensorflow as tf import numpy as np import os class DeepQNet(object): def __init__(self, lr, n_actions, name, input_dims, fc1_dims=256, fc2_dims=256): self.name = name self.lr = lr self.n_actions = n_actions self.input_dims = input_dims self.fc1_dims = fc1_d...
true
730df08b5abe8ad748692945f3e3da368f5a09c6
yanfulin/yabook
/check_file_size.py
UTF-8
2,539
2.859375
3
[]
no_license
import pandas as pd from pathlib import Path df=pd.read_csv("backup/test_yabook.csv", index_col='index') df["size_bit"]=0.0 #print (df.head()) # need to check the file size is correct!! target_dir=Path("E:/yabook/") def update_file_download_status(criteria=-10): for index, row in df.iterrows(): size=row....
true
05f2e4db9ae70178778e1511c5c87a7385076ee1
Prajan87/Python-Codes
/Web Scrapping/nrb.py
UTF-8
695
2.578125
3
[]
no_license
import bs4 from urllib.request import urlopen as uReq from bs4 import BeautifulSoup as soup url = "https://www.nrb.org.np/fxmexchangerate.php" uclient = uReq(url) page_html = uclient.read() uclient.close() page_soup = soup(page_html, "html.parser") containers = page_soup.findAll("table",{"align":"center", "width":450})...
true
534cc40b856c99234d6e7933cee7012bfef0821c
everilae/furnish
/tests/test_decorators.py
UTF-8
2,681
2.765625
3
[ "MIT" ]
permissive
import pytest import furnish from furnish import create, url, get, post, headers, BaseClient, Body, Json from furnish.exc import FurnishError @pytest.fixture def test_headers(): return { "X-Test": "test" } class TestDecorators: def test_simple_definition(self): class Api: p...
true
29c799ef7abb86d5066f0771b8b81b777208b610
int-brain-lab/analysis
/python/fit_learning_curves.py
UTF-8
6,015
2.96875
3
[ "MIT" ]
permissive
import pandas as pd import numpy as np import scipy as sp import matplotlib.pyplot as plt import seaborn as sns from IPython import embed as shell # for debugging from scipy.optimize import curve_fit # ================================================================== # # DEFINE LEARNING CURVES # FROM GUIDO https://...
true
3d6e40e7487e4d72ac98975bbb875a72533a0fa0
ThyEvilOne/LSC-python-class-Noah-David
/DavidBChap10/4.9CarCalcWithTry.py
UTF-8
768
3.390625
3
[]
no_license
# Type your code here errorInt = 1 while errorInt == 1: user_service = str(input('Enter desired auto service:\n')) services = {'Oil change':35, 'Tire rotation':19, 'Car wash':7} if user_service == 'Oil change': output_serv = 'oil change' elif user_service == 'Tire rotation': output_se...
true
50a659aecf4d41040d6d6677f1f2bd4f63df1bbc
Kinglong-Owen/ML_learn
/机器学习手撕代码/决策树/回归树(别人的代码解析).py
UTF-8
5,225
3.15625
3
[]
no_license
# -*- coding: utf-8 -*- """ Created on Sat Aug 24 15:35:16 2019 @author: Administrator """ import os import numpy as np os.chdir(r'C:\Users\Administrator\Desktop') import pandas as pd def createTree(dataSet, leafType, errType, cond=(1,4)): ''' 创建回归树/模型树。 :param dataSet: :param leafType: :param errType:...
true
afccd6e20a02213d444bb3c0c1517c6c01fbc0cb
huhudaya/leetcode-
/LeetCode/233. 数字 1 的个数.py
UTF-8
1,895
3.9375
4
[]
no_license
''' 给定一个整数 n,计算所有小于等于 n 的非负整数中数字 1 出现的个数。 示例: 输入: 13 输出: 6 解释: 数字 1 出现在以下数字中: 1, 10, 11, 12, 13 。 通过次数8,684提交次数23,868 来源:力扣(LeetCode) 链接:https://leetcode-cn.com/problems/number-of-digit-one 著作权归领扣网络所有。商业转载请联系官方授权,非商业转载请注明出处。 ''' # 字典序 ''' 我们知道,如果对[1..n]的数组按照字典顺序排列,我们构建一棵字典树即可。 假设 n=205,我们需要计算 [1..205] 总共包含多少个1,问题就...
true
e439eae7da3fc96a48e328fc367ff294020966e6
wstam88/rofistar_php
/resources/snippets/Python3/Buildin functions/List /insert.py
UTF-8
125
3.8125
4
[]
no_license
fruits = ['apple', 'banana', 'cherry'] # Adds an element at the specified position fruits.insert(1, "orange") print(fruits)
true
5d7a4dfb10ec9c59a6b3874d743809eea3a9e610
psanjay679/Programming-Questions
/GFG/vacant_seats.py
UTF-8
486
3.046875
3
[]
no_license
from queue import PriorityQueue import sys def main(): t = int(input()) for __ in range(t): a, b = [int(k) for k in sys.stdin.readline().split()] ar = [int(k) for k in sys.stdin.readline().split()] pq = PriorityQueue() for e in ar: pq.put(-e) cnt = 0 ...
true
83a83a13ed47b5376b58f01db07aef3bf712e27e
Aasthaengg/IBMdataset
/Python_codes/p02404/s802569362.py
UTF-8
453
3.125
3
[]
no_license
while True: a,b= map(int,input().split()) if(a==0 and b==0): break; for i in range(a): for j in range(b): if( i == 0 or i == a-1): print('#',end='') elif(j == 0): print('#',end='') elif(j > 0 and j < b-1): ...
true
cf9c38d9bdece506493b450185acfe2ba7e53575
xcltyt/ncss_markov
/data/bigrams.py
UTF-8
929
4.25
4
[ "MIT" ]
permissive
import random text = open(raw_input("What file do you want to learn from? "), 'rU').read() # split the text up into tokens words = text.split() # set up a dictionary to store things in d = {} numwords = len(words) # loop over words, adding each word and the next word for i in range(numwords-1): # if we haven't seen...
true
0b5273dd62afd924a34f2b05ae92342134536f8a
saurin94/Emoticon-Prediction-based-on-Live-Face-Capture
/ocrGoogleCloud.py
UTF-8
1,420
2.78125
3
[]
no_license
import io import time from google.cloud.vision import types from google.cloud import vision import cv2 from PIL import Image class OCR(object): def capture_image(self): path = "" camera = cv2.VideoCapture(0) i = 0 raw_input('Press Enter to capture') while i < 2: ...
true
79c13669afea4648ce7ef0540fc55e76d565d66e
Ajayjeena/Linear-Regression-Simulator
/Simulator.py
UTF-8
1,012
2.890625
3
[ "MIT" ]
permissive
import matplotlib.pyplot as plt import numpy as np import pandas as pd import matplotlib.animation as animation dataset = pd.read_csv('dataset.txt',sep='\t',header=None) dataset.columns = ["X","y"] x = dataset.iloc[:, 0].values y = dataset.iloc[:,1].values x2,y2 = x,y plt.scatter(x,y) plt.show() x = np.res...
true
bb4b353465782b4e2bcd54259892e8983a747119
jsucsy/learning
/euler/001/001.py
UTF-8
547
3.15625
3
[]
no_license
''' jsu created 16 Dec 2012 last edited 16 Dec 2012 *** correct solution*** ''' def sum_multiples(multiplier, limit): '''sum the multiples of multiplier under limit''' values = [] x = 1 while (x * multiplier) < limit: # print "added values.append(x * multiplier) x += 1 return values if __name__ == ...
true
2c766c0dabf676caba0edc65f88de736cd1a47d2
miladibra10/KohonenColorMapper
/Kohonen.py
UTF-8
4,344
2.84375
3
[]
no_license
import numpy as np from matplotlib import pyplot as plt from matplotlib import patches import subprocess as sp class Kohonen: def __init__(self, data, iterations=5000, learning_rate=0.01, normalize_data=True, normalize_by_column=False, network_x_dimension=40, network_y_dimension=40): self.iterations = ite...
true
13a2814e8744c6c09906d790185ed44fc2b3f23e
haodeqi/DiverseFewShot_Amazon
/few_shot_code/SupportSetManager.py
UTF-8
8,000
2.578125
3
[]
no_license
import random import torch import numpy as np from torch.autograd import Variable class SupportSetManager(object): FIXED_FIRST = 0 RANDOM = 1 def __init__(self, datasets, config, sample_per_class): self.config = config (TEXT, LABEL, train, dev, test) = datasets[0] self.TEXT = TEXT ...
true
8970711d4c6f313720973f17520ee4e8c2097f26
moraesmm/learn_python
/cursoEmVideo/pythonExercise/Mundo 01/4 - Usando modulos do Python/ex026_primeira_ultima_ocorrencia.py
UTF-8
622
4.1875
4
[]
no_license
# crie um programa que leia uma frase e retorne quantas vezes aparece "A" em que posicao ela aparece pela primeira vez em que posicao ela aparece a ultima vez f = str(input('Digite uma frase: ')).upper().strip() c = str(input(('Qual letra vc deseja procurar: '))).upper() f_count = f.count(c) f_find = f.find(c) + 1 f_...
true
5b66fdfe243022c22866ba907312ecf36526ff5b
babyfingers/python_scripts
/TensRot.py
UTF-8
5,722
2.765625
3
[]
no_license
#!/usr/local/bin/python class FourTensor: """A four-tensor with the symmetry properties found in the energy-damped purity method. Also contains information about coefficients so that a group of such terms can be combined.""" def __init__(self, coeff, NCos, NSin, myIndices): self.prefac = [[coef...
true
7d4a895627446e6a6939514eb6a380d7404d2e4c
graziano-giuliani/pythoncode
/pyuwphysret/common/pyfiles/atmos/Stability/mixr.py
UTF-8
1,262
3.203125
3
[ "MIT" ]
permissive
#!/usr/bin/env python # mixr.py import numpy as num from esat import esat def mixr(t,p): """mx = mixr(t,p) Computes the saturation mixing ratio given ambient temperature(s) (t) and pressure(s) (p). Inputs: t = dry bulb temperature(s) (deg C or K) (vector of length N) p = pressure(s) (hPa) (vector o...
true
22328b7a080f5ccc1f33c8831c18997e6ef96d77
rheehot/Algorithm-33
/Baekjoon/백준1926. 그림.py
UTF-8
1,043
2.75
3
[]
no_license
import sys sys.stdin = open('백준1926. 그림.txt','r') dx = [0,0,-1,1] dy = [-1,1,0,0] n, m = map(int,input().split()) picture = [ list(map(int,input().split())) for _ in range(n) ] visited = [[0]*m for _ in range(n)] result = list() for i in range(n): for j in range(m): stack = list() if picture[i][j] ...
true
9f35c8e741726c0774d7bea8df5f53f1cc3134eb
Shea-Wolfe/modern-art
/random_art.py
UTF-8
937
4.0625
4
[]
no_license
import random from math import * # Your job is to create better version of create_expression and # run_expression to create random art. # Your expression should have a __str__() function defined for it. def create_expression(): """This function takes no arguments and returns an expression that generates a num...
true
09fbfeb917a125fdc10f0f29f7ccd930dd1179e3
gabrielpreite/progetto-granarolo
/scriptRPI_temporized.py
UTF-8
2,711
2.734375
3
[]
no_license
import Adafruit_DHT as adht import time from datetime import datetime import logging import threading from threading import Timer import mysql.connector import os class InfiniteTimer(): """A Timer class that does not stop, unless you want it to.""" def __init__(self, seconds, target): self._should...
true
012494338988d2aca68c8c99724ce0f3598617ac
priya4-hari/Python
/for loop with range in tuple.py
UTF-8
97
3.453125
3
[]
no_license
thistuple=("apple","banana","orange") for i in range(len(thistuple)): print(thistuple[i])
true
797a18533650ce6c7856bf380e74a37a7d9d429b
Gerson2102/Portafolio4
/Televisor.py
UTF-8
1,207
3.640625
4
[]
no_license
class Televisor: canal_actual = 0 volumen_actual = 0 def __init__(self, marca): self.marca = marca def mostrar(self): return self.marca def tipo(self): return "Televisor" def canal_up(self): Televisor.canal_actual += 1 return "El canal act...
true
3c1f9bdf036be338f733eee316949c985601f8e2
ana2pn/Fundamentals_of_Software_Engeneering2019.2
/mybot/bot.py
UTF-8
589
3.171875
3
[]
no_license
from chatterbot.trainers import ListTrainer from chatterbot import ChatBot bot = ChatBot('NiceBot') texto = open("conversa.txt",'r') texto = texto.readlines() trainer = ListTrainer(bot) trainer.train(texto) while True: try: print("Olá, meu nome é NiceBot estou aqui para te ajudar o que você gostaria de ...
true
66430e55fe3f691221cd70af9a3237875dd562ef
htw-projekt-p2p-volltextsuche/Crawler
/Crawler/rede.py
UTF-8
2,510
3.28125
3
[]
no_license
import re class rede: def __init__(self, title, date): self.title = title self.title_short = self.shorten_title(self.title) self.speaker = "" self.affiliation = "" self.date = date self.text = "" def shorten_title(self, title): _, short = self.remove...
true
0cb7039469d2b604d52f7b238e1e62ea58140f12
AvijitMaity/Avijit-Maity-Computational-Physics-2-Assignment-2
/Problem 11.py
UTF-8
2,548
3.5625
4
[]
no_license
''' Runge-Kutta Method ==================================================================== Author: Avijit Maity ==================================================================== This Program solves the initial value problem using with Runge-Kutta Method ''' import numpy as np import matplotlib.pyplot...
true
6b88c8d6a2612ed9b036ee03aeacd5358148a34f
LuizBoina/data-science-week
/aula01/aula01.py
UTF-8
3,252
3.296875
3
[]
no_license
#!/usr/bin/env python # coding: utf-8 # ## **Semana de Data Science** # # - Minerando Dados # ### Conhecendo a base de dados # Importando as bibliotecas básicas # In[ ]: import pandas as pd import seaborn as sns import numpy as np import matplotlib.pyplot as plt # Carregando a Base de Dados # In[ ]: # carre...
true
fa480762ad0a8e7fbe778adb49bd009d3b657a2c
ryos36/polyphony
/polyphony/compiler/graph.py
UTF-8
2,835
3.203125
3
[ "MIT" ]
permissive
from collections import defaultdict, namedtuple Edge = namedtuple('Edge', ('src', 'dst', 'flags')) class Graph: def __init__(self): self.succ_nodes = defaultdict(set) self.pred_nodes = defaultdict(set) self.edges = set() self.nodes = set() def __str__(self): s = '' ...
true
8e51cda870d3c6db9768b24a5cd1c7474ff0557c
shejianyou/data-news
/other media/白鲸出海.py
UTF-8
2,759
2.53125
3
[]
no_license
# -*- coding: utf-8 -*- """ Created on Sat Dec 14 15:02:03 2019 @author: 佘建友 """ import random from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.support import expected_conditions as EC from selenium.webdriver.common.by import By from lxml import etree import re import json f...
true
6f26261da862c667c9c0a71be64dea40667103f7
Koldar/phdTester
/PhdTester/phdTester/tests/test_series_function.py
UTF-8
1,684
2.890625
3
[ "MIT" ]
permissive
import unittest from phdTester.default_models import SeriesFunction class MyTestCase(unittest.TestCase): def test_01(self): f = SeriesFunction() self.assertEqual(f.number_of_points(), 0) def test_02(self): f = SeriesFunction() f.update_point(3, 4) self.assertEqual(...
true
05fff14617c294953f6a76e67ed5230fa98ddd44
Sleeither1234/t0_7_huatay.chunga
/huatay/iterar_ejercicio_05.py
UTF-8
306
3
3
[]
no_license
#formacion de articulos import os vocal=(os.sys.argv[1]) #asigancion de la cadena ae a la variable vocal for c in vocal: #funcion iteracion de la cadena ae hasta agotar su valor #fin_iterar print(c+"l")#se imprime cada valor de la cadena ae + la letra l print("Fin del bucle")#se imprime un comentario
true
61ea88a22d3dcc4fd8802615abfdac04f1965533
asudeeaydin/event_utils
/lib/data_loaders/hdf5_dataset.py
UTF-8
2,964
2.6875
3
[ "MIT" ]
permissive
import h5py from ..util.event_util import binary_search_h5_dset from .base_dataset import BaseVoxelDataset import matplotlib.pyplot as plt class DynamicH5Dataset(BaseVoxelDataset): """ Dataloader for events saved in the Monash University HDF5 events format (see https://github.com/TimoStoff/event_utils for ...
true
5f8217efb75aacbd2e79a0f8f0cab6467a1448ea
920666358/neural_network
/nn.py
UTF-8
3,956
3.25
3
[]
no_license
import numpy import scipy.special, pylab import matplotlib.pyplot class NueralNetwork(object): # initialise the neural network def __init__(self, input_nodes, hidden_nodes, output_nodes, learning_rate): self.i_nodes = input_nodes self.h_nodes = hidden_nodes self.o_nodes = out...
true
871a1994fff82a2fd052ab295b95f46c54ca755e
developers-youcong/Python-Crawler-Learning
/03/simple01.py
UTF-8
203
2.9375
3
[]
no_license
import re m = re.match('www','www.santostang.com'); print('match result:',m); print('match start and end:',m.span()); print('match start position:',m.start()); print('match end position:',m.end());
true
63d7e2b7e4086c22c1f0819ee8f5c9568ac359ef
RookieWithNoob/Deep-Learning
/opencv_demo/test1.py
UTF-8
1,668
3.28125
3
[]
no_license
import numpy as np import cv2 # 设置打印时显示方式,threshold=np.nan意思是输出数组的时候完全输出,不需要省略号将中间数据省略 # np.set_printoptions(threshold=np.nan) # 创建一个宽512高512的黑色画布,RGB(0,0,0)即黑色 img = np.zeros((512, 512, 3), np.uint8) # 画直线,图片对象,起始坐标(x轴,y轴),结束坐标,颜色,宽度 cv2.line(img, (0, 0), (311, 511), (255, 0, 0), 10) # 画矩形,图片对象,左上角坐标,右下角坐标,颜色,宽度 cv2...
true
0284f95b3cfe3b062dc37fa365053f5bd502bffa
monda00/hackerrank
/python/#56_piling_up.py
UTF-8
441
3.453125
3
[]
no_license
''' Piling Up! ''' if __name__ == '__main__': for _ in range(int(input())): input() cubes = list(map(int, input().split())) min_cube = cubes.index(min(cubes)) left_cubes = cubes[:min_cube] right_cubes = cubes[min_cube:] if(left_cubes == sorted(left_cubes, reverse=T...
true
adc785dcc40d8192461fa8836e102daf58e2d093
h2oai/h2o-3
/scripts/db_check.py
UTF-8
6,829
2.71875
3
[ "Apache-2.0" ]
permissive
import mysql.connector '''A Class to get metrics and health of the mysql database located at 172.16.2.178''' class CheckDB: def __init__(self): self = self ''' Check of whether the mysql databases is up and running. This will run a quick query to get the mysql version. If it returns anything,...
true
a20541b4e923742f31567690707727b29810e35b
Dannyerl/Data2Science
/2020-04-24-ML-neural-network/2020-04-24-ML-neural-network.py
UTF-8
478
2.9375
3
[ "MIT" ]
permissive
import numpy as np from sklearn.neural_network import MLPClassifier from sklearn.model_selection import train_test_split data = np.loadtxt('ex3data.txt', delimiter=' ') X = data[:, 0:400]; y = data[:, -1] X_train, X_test, y_train, y_test = train_test_split(X, y) mlp = MLPClassifier(solver='lbfgs', random_state=1).fit...
true
4f5a6393555d5b066c8756037b78af594306926d
vatsalsaglani/nlp-text-contractions
/NLPContractions/contraction.py
UTF-8
9,042
2.609375
3
[ "MIT" ]
permissive
import re from collections import defaultdict expansionDict = { re.compile('alright', re.I | re.U): "a'ight", re.compile('am not|is not|has not|are not|have not|did not', re.I | re.U): "ain't", re.compile('am not', re.I | re.U): "amn't", re.compile('are not', re.I | re.U): "aren't", re.compile('bec...
true
e880aa20a9e91e27454c0a3280e2412481f20b60
RamAmireddy/problem_solving
/Python3_programs/heaps/get_kthsmallest.py
UTF-8
626
3.3125
3
[]
no_license
import heapq def get_kthsmallest(matrix,k): if matrix is None or k <= 0: return 0 ls = [[matrix[0][0], 0, 0]] mp = set((0, 0)) ans = 0 while k: k = k - 1 ans, i, j = heapq.heappop(ls) if i + 1 < len(matrix) and (i + 1, j) not in mp: heapq.heappush(ls, [ma...
true
7370e1697e0924de5f07404e38f448e75d436ee4
DavidPetrus/RL_assignment
/student-pack/policy_model.py
UTF-8
2,638
2.578125
3
[]
no_license
import pandas as pd import numpy as np import matplotlib.pyplot as plt import torch.nn as nn import torch.nn.functional as F import torch.optim as optim import torch import ipdb from torch.utils.data import Dataset from torch.distributions import Categorical #################################################...
true
ac433d2a57348ce22ad785d249efc9521f9df657
mclose/cli-pipeline-tools
/normalize-rows.py
UTF-8
2,076
3.359375
3
[]
no_license
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # Remove rowspans from all tables in a page # Should probably expand this to deal with colspans too # Should also copy full tag contents from the first rowspan to # subsequent rows. # Example: # curl -s 'https://en.wikipedia.org/wiki/List_of_2015_albums' | normalize-rows.p...
true
f8298e83e8e5b7aad9dabdf073bf483afaf566a3
josephmckinsey/cloudphasesimulation
/python/4D_gif_maker.py
UTF-8
1,746
2.953125
3
[]
no_license
from __future__ import division import numpy as np import matplotlib.pyplot as plt import matplotlib.animation as anim def import_matrix(file_name): matrix = {} with open(file_name, "r") as f: first_line = f.readline() first_line = first_line.split(',') first_line = [int(x) for x in ...
true
ecc70edaed8e4aa242334f48fddb0f0a7d1af63d
xndcn/completor.vim
/pythonx/completor/utils.py
UTF-8
1,307
2.78125
3
[ "MIT" ]
permissive
# -*- coding: utf-8 -*- import logging import functools from ._vim import vim_obj logger = logging.getLogger('completor') def ignore_exception(fallback=()): """Ignore exception raised by the decorated function. When exception happened the fallback value is returned. """ def deco(func): @f...
true
9a46ebc66f6bb31fc6b2647d959b90ced457a909
Rodrigo-Antonio-Silva/ExerciciosPythonCursoemVideo
/Ex0108/test.py
UTF-8
366
3.515625
4
[ "MIT" ]
permissive
from Ex0108 import moeda p = float(input('Digite o preço: R$ ')) print(f'A metade de {(moeda.moeda(p))} é {(moeda.moeda(moeda.metade(p)))}') print(f'O dobro de {(moeda.moeda(p))} é {(moeda.moeda(moeda.dobro(p)))}') print(f'Aumentando em 10%, temos {(moeda.moeda(moeda.aumentar(p, 10)))}') print(f'Reduzindo em 13%, temo...
true
fa4a66afc857d70ba2fab1726c78b3abd76cb71e
Gopinath3/Genesis_Python_Track
/Python Basics/main.py
UTF-8
4,709
2.96875
3
[]
no_license
import pytest import re nonacroom=[1,2,3,4,5] acroom=[6,7,8] specialroom=[9,10] cusid=[] aname=[] aage=[] aaddress=[] aphno=[] checkin=[] checkout=[] i=0 def Admin(): password="Admin123" passwd=input("Enter Password :") if(passwd==password): return status() def Sum(a,b): return a+b ...
true
10ff7af6cf670819622a4ad2dae203ff5720a2fe
jxtwo10/Spikeballstats
/gameRunner.py
UTF-8
7,291
3.09375
3
[]
no_license
# spikeball game stat tracker team1 = 0 team2 = 0 class GameRunner: print("new game") class Player: def __init__(self, name, spikes, aces, assists, saves, faults, errors): self.name = name self.spikes = spikes self.aces = aces self.assists ...
true
e4bf57b2e509fa6011367b0b3a81751435c06a87
Devinlomax/ch2assignment
/number3.py
UTF-8
127
3.359375
3
[]
no_license
feetperacre = 43560 feetofland = float(input("jow many feet?")) var= feetofland/feetperacre print("total acres owned:", var)
true
0d7eae12c763142b4c1c04f5b91b5b6513f6ade5
emilybee3/Flask-Madlibs
/madlibs.py
UTF-8
3,293
3.171875
3
[]
no_license
from random import choice, randint#gets the choice function from random library from flask import Flask, render_template, request #importing the class Flask and the functions render_template and request from flask # "__name__" is a special Python variable for the name of the current module # Flask wants to know this...
true
7a226bfd0a8125097f3ff8c4d374b100100b0b2a
josefa-tramon/MCOC2021-P0
/Entrega 3/timing_inv_caso_1/timing_inv_caso_1.py
UTF-8
1,084
2.734375
3
[]
no_license
#timing_inv_caso_1.py from time import perf_counter from numpy import zeros, dtype from numpy import half, single, double, longdouble, float16, float32, float64 from numpy.linalg import inv from laplaciana import laplaciana Ns = [20,30,50,100,110,120,140,160,180,200,500,800,1000,1100,1200,1300,1500] dts = [] mem...
true
6151412ee01f014d5145901e6551603f7d2c17b0
seunghwako/Algorithm_Python
/for문/boj15552.py
UTF-8
203
3
3
[]
no_license
import sys t = sys.stdin.readline().rstrip() t = int(t) result = [] for i in range(0, t) : a,b = map(int, sys.stdin.readline().split()) result.append(a+b) for r in result : print(r)
true
d8d1e75d8c5e6a9684ac35a1c1c7fccdc084f570
elephantech/bdateutil
/bdateutil/relativedelta.py
UTF-8
12,682
2.671875
3
[]
no_license
# python-bdateutil # ---------------- # Adds business day logic and improved data type flexibility to # python-dateutil. 100% backwards compatible with python-dateutil, # simply replace dateutil imports with bdateutil. # # Author: ryanss <ryanssdev@icloud.com> # Website: https://github.com/ryanss/python-bdateut...
true
346b08f2b38fa41dab9c154af853efe74f491a1e
MichaelGardiner97/Encode-Decode
/Encode:Decode.py
UTF-8
3,218
4.4375
4
[]
no_license
# Michael Gardiner # Due: 10-20-15 # Encode/Decode a given phrase by a given shift amount ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' Also know as Caesar's cipher and the Shift cipher, this cyclic cipher is an example of an encryption technique. This cipher takes a phrase gi...
true
44921ce46182465fb2c1d83a898e5432379ad153
afterimagex/MyD2Ext
/scripts/voctools/vis_voc.py
UTF-8
2,158
2.578125
3
[]
no_license
# -*- coding: utf-8 -*- # ------------------------------------------------------------ # Copyright (C) 2020-Present, Pvening, Co.,Ltd. # # Licensed under the BSD 2-Clause License. # You should have received a copy of the BSD 2-Clause License # along with the software. If not, See, # # <https://opensource.org/licen...
true
2671f7bc7117b79e6587f91a7851680892f28a0e
Aasthaengg/IBMdataset
/Python_codes/p03687/s460432055.py
UTF-8
204
2.765625
3
[]
no_license
s = str(input()) from collections import Counter cntr = Counter(c for c in s) ans = 100100 for ch in cntr.keys(): len_max = max([len(arr) for arr in s.split(ch)]) ans = min(ans, len_max) print(ans)
true
f29658a280629d5895aaf7fa4ed20a598217e83b
TechGirl254/Training101
/List.py
UTF-8
898
4.03125
4
[]
no_license
# list indexing daysoftheweek=["monday","tuesday","wednesday","thursday","friday","saturday"] print(daysoftheweek[0]) # printing out three consecutive days sublist=daysoftheweek[3:4] print(sublist) # terminates at three but position 3 is not included # details of an individula details=["carole",24,"carole@gmail.com"...
true
027fd18d40f40dd86f979f550552d1ed3b0efb0d
JohnnyMarlison/math_and_graphic
/Mark_program/painting_ants.py
UTF-8
1,952
3.046875
3
[ "MIT" ]
permissive
import pygame as pg from collections import deque from random import choice, randrange class Ant: def __init__(self, app, pos, color): self.app = app self.color = color self.x, self.y = pos self.increments = deque([(1, 0), (0, 1), (-1, 0), (0, -1)]) def run(self): valu...
true
28a046be18e5df1b6e79dc6614700293f88fac60
fominpskov/python_Project11
/main.py
UTF-8
250
3.328125
3
[]
no_license
user_input = input("please enter someting") print(type(user_input)) a = float(input("side A:")) b = float(input("side B:")) c = float(input("side C:")) half_P = (a + b + c)/2 area = (half_P * (half_P - a)*(half_P - b)*(half_P -c))**0.5 print(area)
true
5c4434864b14dd8c7cad2aee502f14fae1f058d4
imsoftware/pyoidc
/src/oic/utils/jwt.py
UTF-8
7,963
2.765625
3
[]
no_license
"""JSON Web Token""" # Most of the code herein I have borrowed/stolen from other people # Most notably Jeff Lindsay, Ryan Kelly import base64 import json import logging import re import M2Crypto import hashlib import hmac import struct #import binascii #import rsa from itertools import izip logger = logging.getLog...
true
d136d087230885c1384d8ba76079d2e37fe04943
AdamZhouSE/pythonHomework
/Code/CodeRecords/2526/59018/265258.py
UTF-8
119
2.984375
3
[]
no_license
print(input()) info=input()[1:-1].split(',') a=[int(y) for y in info if y!='null'] print(a)
true
003a461cbbeeb3d51ea395f6c575d7e9458b3422
lumixraku/my-manim
/正十七边形的尺规作图.py
UTF-8
50,002
3.046875
3
[]
no_license
class polygon17_scene1(Scene): def construct(self): text = Text("Definition 1.A point is that which has no part.", font='未署名的信')\ .scale(0.6).shift(UP*2) text_supplement = Text("点是没有部分的东西", font='未署名的信')\ .next_to(text,DOWN).shift(RIGHT) text[0:10].set_color('#EE9A00...
true
996def740eb96ac638cecba9a5ba0507f208b6be
tgkei/Algorithm_study
/by_python/skt/2.py
UTF-8
748
3.390625
3
[]
no_license
# you can write to stdout for debugging purposes, e.g. # print("this is a debug message") def solution(A, F, M): # write your code in Python 3.6 total = M * (len(A) + F) start = 1 needed = total - sum(A) if start * F > needed: return [0] while (((start+1) * F) < needed) and start < 6: s...
true
098b1d322721f2a58d7a10c75c47a34aea465799
PacificDou/algorithm
/coding/segment_tree_v2.py
UTF-8
5,080
3.328125
3
[ "MIT" ]
permissive
# PushDownLazy (children.value + children.lazy): https://blog.csdn.net/zearot/article/details/48299459 # at any time, the lazy is already applied to the value # there is another type of PushDownLazy (self.value + children.lazy) similar to: https://halfrost.com/segment_tree/ class Node: def __init__(self, left...
true
01ef6bbd7b53f334a2686c083403cf6f694ded05
02Debaditya-Mukhopadhyay/Sales-Analysis
/Analysis.py
UTF-8
4,777
3.484375
3
[]
no_license
#!/usr/bin/env python # coding: utf-8 # ### TASK1: Import panda libary # # In[106]: import pandas as pd import os import matplotlib.pyplot as plt from itertools import combinations from collections import Counter # ### Task2: Collate monthly sales # # In[10]: files=[file for file in os.listdir('./Sales_Data'...
true
0d31015cb0e73690c45fb2140b7edea2c3d1c992
doublejy715/Problem-Solve
/BaekJoon_Online/Math/No_1977.py
UTF-8
584
3.75
4
[]
no_license
import math a = int(input()) b = int(input()) c = list() for i in range(a,b+1): print(math.sqrt(i)) print(int(math.sqrt(i))) if math.sqrt(i) == int(math.sqrt(i)): c.append(i) if len(c) == 0: print("-1") else: print(sum(c)) print(min(c)) """ # for 문이 2개이기 때문에 시간이 너무 오래 걸린다. M = int(in...
true
25b8c0b2cfc07823e7ae2f698d993a3ea8dc522b
Azii/Projekte
/Hex/src/main.py
UTF-8
164
2.90625
3
[]
no_license
from turtle import * from Hexagon import Hexagon t = Turtle() t.hideturtle() t.speed = 0 Hexagon.create_n_by_n_grid(5, 40) Hexagon.setTurtle(t) Hexagon.draw_all()
true
31778c98f549a38efee12b56e89d10828db91b65
NightBaRron1412/Py-learning-projects
/gussing_game.py
UTF-8
1,747
4.625
5
[]
no_license
from random import randint print(""" WELCOME TO AMIR'S FIRST PYTHON PROGRAMM !! I'm gonna pick a random integer from 1 to 100, and you have to guess the number. The rules are: 1. On your first turn, if your guess is * within 10 of the number, I'm gonna say "WARM!" * further than 10 away fr...
true
1bb982491bc9716d1cf97c955f5d580bffec3639
zackmdavis/Exercises_A
/Modern_Compiler_Design/1_demo.py
UTF-8
2,880
3.484375
3
[]
no_license
import logging import sys def is_layout_character(ch): return ch in " \t\n" class Token: def __init__(self, ch): self.classification = "digit" if ch in "0123456789" else ch self.representation = ch def __repr__(self): return "{}Token('{}')".format( "Digit" if self.cla...
true
a28d5bc3d0edd6003b6fba6ef574040ae4105f6a
sprax/1337
/python2/l0207_course_schedule.py
UTF-8
2,381
3.328125
3
[]
no_license
# BFS topological sorting. class Solution(object): def canFinish(self, numCourses, prerequisites): """ :type numCourses: int :type prerequisites: List[List[int]] :rtype: bool """ from collections import defaultdict # From prerequisite course to coures...
true
6e2cb73758d8d7d4971d97f2ccf70ee231683cda
DonneyF/MECH-325-Assignments
/A1/gears.py
UTF-8
15,069
2.984375
3
[]
no_license
import json import math # Gear Class. Loads JSON data and runs methods class Gear: # Constants m_n = 1 # Load sharing ratio v_p = 0.3 # Poisson's Ratio for pinion v_g = 0.3 # Posson's Raion for gear load_cycles = 2E4 # Number of load cycles Q_v = 5 # Calculated that the maximum allowable pit...
true
7f4c02217171b1f8bb20eccf61f52d04a2bd6c7d
priya6265/AI-ML-Python
/Python Training/Grading System.py
UTF-8
394
3.9375
4
[]
no_license
print("Enter Marks of student: ") mark=int(input()) if mark<25: print("Your Grade is F") elif mark>25 and mark<45: print("Your Grade is E ") elif mark>45 and mark<50: print("Your Grade is D ") elif mark>50 and mark<60: print("Your Grade is C") elif mark>60 and mark<80: print("Your Grade is B ") elif...
true
636621c099a0d514bd5df556ad72a8f675d9a1bd
Agwave/PDF-Resume-Information-Extraction
/debug.py
UTF-8
9,873
2.515625
3
[]
no_license
# s = "wef:fw:few" # # print(s.split(':')) # # import os # import re # # TRAIN_PDF_PATH = '/home/agwave/Data/resume/resume_train_20200121/pdf' # ORIG_TXT_PATH = '/home/agwave/Data/resume/resume_train_20200121/orig_txt/f2be69555427.txt' # # # # def read_txt(path): # info = [] # with open(path, 'r') as f: # ...
true
49b2649a1f71b9673fc91d33e499e96421fc9b02
ansarishadab121/ZS-associate-competition
/zs_associate_competition..py
UTF-8
1,722
2.84375
3
[]
no_license
#In[7]: import pandas as pd import numpy as np import os from sklearn.model_selection import train_test_split # In[8]: os.getcwd() # In[9]: import warnings warnings.filterwarnings("ignore") # In[10]: data=pd.read_csv('dtu.csv') data=data.fillna(data.mean(),inplace=True) train, test = train_test_split(da...
true
50218d06c3e1d01d85f7ba452f865ba8f00273ac
rcoder/bouncer
/bouncer/web.py
UTF-8
4,295
2.578125
3
[ "MIT" ]
permissive
# Copyright 2013 by Urban Airship and Lennon Day-Reynolds <lennon@urbanairship.com> # See license information in COPYING. import re from flask import Flask, redirect, render_template, request, url_for app = Flask(__name__) from bouncer.db import q, iq # Generic helpers def make_url_dict(row): url_id, slug, full...
true
697a7a08aadf8a2c747f96c3ccc954ab9846d897
huangruihaocst/leetcode-python
/401. Binary Watch/solution.py
UTF-8
1,202
3.0625
3
[]
no_license
class Solution: def readBinaryWatch(self, num): """ :type num: int :rtype: List[str] """ res = list() from itertools import permutations, product for up in range(5): down = num - up if down < 0 or down > 6: continue ...
true
6f2c836d489d81712d0891f5b9aaeff2e92d954c
Aasthaengg/IBMdataset
/Python_codes/p02414/s955188324.py
UTF-8
862
3.140625
3
[]
no_license
import sys; def mul_matrix(a, b): n = len(a); m = len(b); l = len(b[0]); ans = []; for i in range(n): new_row = []; for j in range(l): sum = 0; for k in range(m): sum += a[i][k] * b[k][j]; new_row.append(sum); ans.a...
true
bbcddfde452ce2d0de1960d4d74dfae27b96283c
not-mike-smith/ProfilingCython
/PythonNetwork/NetworkMgr.py
UTF-8
476
2.75
3
[]
no_license
from collections import OrderedDict _node_queue = OrderedDict() _all_nodes = [] def register_node(node): _all_nodes.append(node) def enqueue(node): _node_queue[node] = None def run_one_node(): q = _node_queue.keys() node = next(n for n in q if n.inputs_not_dirty) # if the next() call raises ...
true
b70e2e351b46c86a59eefbdfada8f2363bd8c24f
shwetakadupccm/pccm_db_sk
/sql/add_update_sql_changed.py
UTF-8
9,516
2.78125
3
[]
no_license
import helper_function.ask_y_n_statement as ask import add_edit.add_new as add_new import add_edit.edit_record as edit_record def update_single(conn, cursor, table, column, file_number, var): # update a single column in a sql db. Key is file_number. sql_update = "UPDATE " + table + " SET " + column + "= ...
true
e46d860fe5d5c372acf2c57ff782d53f2da9a442
fenglin-star/Python_Projects
/drop_projiects/Preschool_education/python_def/mail_send.py
UTF-8
1,331
2.71875
3
[]
no_license
#! /usr/bin/env python #coding=utf-8 from email.mime.text import MIMEText from email.header import Header from smtplib import SMTP_SSL def send_usermail(mail_title,mail_content,receiver): #qq邮箱smtp服务器 host_server = 'smtp.qq.com' #sender_qq为发件人的qq号码 sender_qq = '1094470534@qq.com' #pwd为qq邮箱的授权码 ...
true
b96d289a8915d9b1ad8262ea6aefb77dc0f9213c
rene-d/math
/projecteuler/p028.py
UTF-8
194
3.171875
3
[ "MIT" ]
permissive
""" Number spiral diagonals https://projecteuler.net/problem=28 """ somme = 1 n = 1 for i in range(1, 1 + 1001 // 2): for _ in range(4): n += i * 2 somme += n print(somme)
true
f77e22c3a016476d587637f3873fe4f4ca392fde
jiewu-stanford/leetcode
/369. Plus One Linked List.py
UTF-8
1,938
3.890625
4
[]
no_license
''' Title : 369. Plus One Linked List ($$$) Problem : https://leetcode.com/problems/plus-one-linked-list/ : https://www.lintcode.com/problem/plus-one-linked-list/description ''' # Definition of ListNode class ListNode(object): def __init__(self, val, next=None): self.val = val self.n...
true
2425931fcae89d83abf5b2fdf2870ae628585545
py-bootcamp/learn-python-with-tdd
/hello-world/v6/test_hello.py
UTF-8
507
3.5
4
[ "MIT" ]
permissive
from hello import hello def test_hello_without_name(): got = hello() want = "Hello, World" assert got == want def test_hello_with_name(): got = hello("Christian") want = "Hello, Christian" assert got == want def test_hello_with_name_in_spanish(): got = hello("Christian", "Spanish") ...
true
fde38b2a398c515e6970674dd121c0b335b6d6a1
psy2848048/funfun_pundix
/scheduled_job/crawl.py
UTF-8
5,711
2.578125
3
[]
no_license
from decimal import Decimal from datetime import datetime, timedelta import sys import traceback from steem import Steem from dbConn import DBActions # 스팀잇에서 현황 긁어오는데 사용 class SteemPosting(object): def __init__(self): self.steem = Steem() self.account = "funfund" overview = self.steem.ge...
true
ed0f78f1a0e319f5b7248e92c32ef67338dc1fe3
sanskrit/learnsanskrit.org
/lso/sml/render.py
UTF-8
2,455
2.734375
3
[]
no_license
import re from typing import List, Dict import lso.sml.parse as parser from lso.sml.parse import Node, Text from lso.sml.templates import View, TextView from lso.sml.templates import TEMPLATES class Missing(View): """Template for nodes that can't be understood.""" def enter(self): return '<span st...
true
96e7ae9d893ce4d415ffc9926663c3c0888a5e4a
noahbetik/Spring2019Project
/EV3Motion/listen.py
UTF-8
425
2.953125
3
[]
no_license
#!/usr/bin/env python3 import serial from time import sleep port = "/dev/ttyUSB0" #example port, update once found ser = serial.Serial(port, 38400, timeout=0) def receive(): data = ser.read(9999) if len(data) > 0: offsetSpin, offsetLift = data.split() print (offsetSpin, offsetLift) #t...
true
df509fbe1e2bbcf3f875e17fe8cfa21ed6adfe1b
LoveHRTF/tic-tac-toe
/vertex.py
UTF-8
2,632
3.5
4
[]
no_license
import numpy as np import copy import random # Class for vertex # One vertex repersents a step in the game class Vertex: def __init__(self, vertex): """ Initialize vertex class. Require vertex to be 3x3 numpy array""" self.adjacent = [] self.vertex = vertex def set_children(self, verte...
true
7bf669018aa4c08ae1a5774b3353bf00df90fdbf
kongjiadongyuan/How2LearnKernel
/scripts/hook.py
UTF-8
1,879
2.59375
3
[]
no_license
HOOK_FUNCTION_STR = """probe kernel.function("{0}"){{ if (execname() == "{1}"){{ printf("%s -> {0} (%s)\\n", thread_indent(2), $$parms) }} }} probe kernel.function("{0}").return{{ if (execname() == "{1}"){{ printf("%s <- {0} (%s)\\n", thread_indent(-2), $$return) }} }} """ HOOK_SYSCALL...
true
7ff32df93cf6fa13f8f4b78599beaecd91dbbbd2
karanrampal/triplet-loss
/visualization.py
UTF-8
3,972
2.75
3
[ "MIT" ]
permissive
#!/usr/bin/env python3 """Visualize the model""" import argparse import logging import os import numpy as np import torch from torch.utils.tensorboard import SummaryWriter import utils from model.net import Net import model.data_loader as d_l def args_parser(): """Parse commadn line arguments """ parser...
true
0d5150bc47a9d801d12ecb30fcb2b9be2b954fe6
gaddamhareesh/sample1
/azure_secrtes.py
UTF-8
2,897
2.765625
3
[]
no_license
import requests import os import sys ## Token(bearer_all_vaults_token) for listing all the existing vaults. data = { 'grant_type': 'client_credentials', 'client_id': 'a4735b5a-a10d-441a-8ea5-74a9d747d510', 'client_secret': '@7F:X-:9ldp6bT7kVHH7dVs4LScG69a/', 'resource': 'https://management.azure.com/' } all_vaults = ...
true
ae355c8675bbbc6e064c0dae4c18079a7678df52
asifm37/personal-projects
/ATM_Simulation/classes/Accounts.py
UTF-8
5,921
2.828125
3
[]
no_license
import pickle SB_MIN_BAL = 2000 CA_MIN_BAL = 10000 class Account: account_number = 0 __account_password = None __account_balance = 0 _account_type = None _account_holder_name = None _account_branch = None __accounts_dict = {} __account_db_file = "resources/accounts_list.data" _las...
true
5d7d746566410a6bcdc65c14d0c07cbc14f0bbdc
pooja1506/Beginner_python_code
/nestedLoops_2Darray/pig_latin_word.py
UTF-8
1,047
4.59375
5
[]
no_license
""" Write a method pig_latin_word that takes in a word string and translates the word into pig latin. """ # Pig latin translation uses the following rules: # - for words that start with a vowel, add 'yay' to the end # - for words that start with a nonvowel, move all letters before the first vowel to the end of the w...
true
1581f32a22afa4c41d0d410a3b54803160d301f3
walkmiao/Little_Case
/计算字符串中每个字符出现次数.py
UTF-8
817
3.953125
4
[]
no_license
#!/usr/bin/env python # -*- coding: utf-8 -*- # @Time : 2018/4/28 13:17 # @Author : LCH # @Site : # @File : 计算字符串中每个字符出现次数.py # @Software: PyCharm #通过使用dict的setdefault方法巧妙计算 字符串中每个字符出现的次数 进而打印出次数最多的字符 s='i am A pure man,i love study,swimming and basketball!' d={} for i in s: d.setdefault(i,0) d[i]=d...
true
855360d65b402d32166722cad5f6f05885c2e167
rahlk/LeetCode
/22_all_paranthesis.py
UTF-8
1,488
3.234375
3
[ "MIT" ]
permissive
from pdb import set_trace class AllParanthesis: def solution_recur(self, n): """ A recursive solution :type n: int :rtype: List[str] """ def paranthesize(string, left, right, N, combinations): if left == N and right == N: combination...
true
6fa129bc21f75c6580835416c58ba06aaa62e5a7
liuxinren456852/PointCloudWiresPolesClassifier
/src/tools/pc_tools.py
UTF-8
23,015
2.59375
3
[]
no_license
from pathlib import Path import shutil import laspy import numpy as np import matplotlib.pyplot as plt from matplotlib.lines import Line2D import pylab as pl from descartes import PolygonPatch from scipy.spatial import Delaunay from shapely.ops import cascaded_union, polygonize import shapely.geometry as geometry from...
true
42ce89f0beffa5400633ba476571ae6415500976
relaxdiego/mobility
/mobility/framework/configuration.py
UTF-8
2,579
3.15625
3
[ "MIT" ]
permissive
import os import yaml class Configuration: # ========== # EXCEPTIONS # ========== class LoadError(Exception): def __init__(self, path, extra_info): message = "The config file could not be found at %s. Please " \ "make sure that the file is present and valid...
true
93a0e2a30b54781f1e01d63ee3de466852524cec
hmonds/Mood-Food.github.io
/mood-food/main.py
UTF-8
6,521
2.8125
3
[]
no_license
#!/usr/bin/env python # # Copyright 2007 Google Inc. # # 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 applicable law o...
true