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
0a331a3b82ed7158160d649998ab4088aa59d354
shaukatmakandar786/Python
/if__name__/b1.py
UTF-8
237
3.5
4
[]
no_license
def fun(Str): return f"my name is {Str}" def add(a,b): return a+b if __name__=='__main__': a=fun("shaukat") print(a) b=add(10,20) print(b) print(__name__) """ output: my name is shaukat 30 __main__ """
true
8d1774a925456d3778616aeb88736e7517acc1dd
Uebbels/csci101
/Week4/Python4-hangman.py
UTF-8
1,319
4.1875
4
[]
no_license
#Brendan Uebelhoer #CSCI 101 Section A #Python Lab 4 guesses = 0 characters_used = [] secret_word = ' ' word_lenght = 0 char = ' ' guessed = False secret_word = input('WORD>') word_length = len(secret_word) guesses = int(input('NUM>')) while guesses > 0 and guessed == False: print('\n\nplease input a character(t...
true
c2b15f477c096b02f9fac20b51b1e757f5a3a29b
PARDEEPKAUR30/my-work
/Python Programs/fileprogram/studentmarks.py
UTF-8
307
3.40625
3
[]
no_license
def marks(): f=open("student marks.txt","r") d=f.readline() print(d) for i in range(1,6): sum=0 m1,m2,m3=[eval(x)for x in (f.readline().split())] sum=m1+m2+m3 print('Sum of total marks of Student',i," in three different subject is: ", sum) marks()
true
d727bdc9b11ce5235a743f3d432ee6da9fa46906
LeandroRamalhodaSilva/cadastroCliente
/lib/interface/__init__.py
UTF-8
876
3.953125
4
[]
no_license
def linha(): lin = ('-' * 35) print(f'{amarelo(lin)}') def cabeçalho(txt): linha() print(f'{amarelo(txt)}'.center(45)) linha() def leiaInt(msg): while True: try: i = int(input(msg)) except ValueError: vermelho(f'Valor inválido. Por favor, tente novamen...
true
5e3075a77f2746b5676350d80ad39bd12800e591
gugunm/bigram-task
/praproses_tahap2.py
UTF-8
342
3
3
[]
no_license
import csv import re out = open('keluaran_fix.csv', 'w') with open ('keluaran2.csv', 'r') as f : reader = f.read().split("\n") #split kalimat dengan new line for row in reader: row_clean = re.sub(' +',' ',row) #untuk menghapus spasi yang lebih dari 1 print(row_clean) out.write(row_cle...
true
8a862efd53512e3efc57dc33463cd5b3fe73bc18
JavierSada/MathPython
/Support/Session 2 HW.py
UTF-8
976
3.65625
4
[]
no_license
# -*- coding: utf-8 -*- print ('\nSolving Module 1 problem Session 2') import matplotlib.pyplot from matplotlib.pyplot import * import numpy from numpy import linspace figure() x=linspace(0,100,100) y=0.056057*x*x+1.06657*x y55=0.056057*(55)**2+1.06657*(55) xlabel('MPH') ylabel('Distance') title ('Plot of S...
true
b6089f87789ba0b78293528e348d2fa253cdeab5
AgustinParmisano/tecnicatura_analisis_sistemas
/programacion1/practica4/mari_prac4ej5.py
UTF-8
262
3.140625
3
[ "Python-2.0" ]
permissive
list_num = [3,4,436,4,1,54] def suma(list_num): valor = 0 for i in list_num: valor += i return valor print(suma(list_num)) def multp(list_num): valor = 1 for i in list_num: valor *= i return valor print(multp(list_num))
true
43323cc2984589fea1171fed86a2b398f3b40ac6
ejd2163/Barnhart-Lab-2020
/Mito-ca.py
UTF-8
1,605
2.625
3
[]
no_license
import pandas as pd import numpy as np from scipy import signal import matplotlib.pyplot as plt import os # from Resample import resample # Read the csv file parent_path = "/Users/zhengyuanlu/Desktop/Ctrl/" F_path = os.path.join(parent_path, "all_F.csv") t_path = os.path.join(parent_path, "all_t.csv") print(F_path, t_...
true
5bb840f1755f1b281eb92a3427e35f2b5c761230
alec-g/robofleet_client
/scripts/basic_status.py
UTF-8
1,680
2.578125
3
[ "MIT" ]
permissive
#!/usr/bin/env python from argparse import ArgumentParser import rospy import rostopic from roslib.message import get_message_class """ This script creates a ROS node to publish basic RobofleetStatus messages. """ # avoid that whole "make a ROS package" issue # make sure ROS_PACKAGE_PATH contains amrl_msgs RobofleetS...
true
6f1cce7687037e6bd072e75d030a5ce2f1c13c1b
tedsilb/PythonProjects
/projects/check_palindrome.py
UTF-8
448
4.53125
5
[ "MIT" ]
permissive
"""Check if a word is a palindrome. By Ted Silbernagel """ def is_palindrome(input_word: str) -> bool: return input_word == input_word[::-1] if __name__ == '__main__': print('This program will check to see if a given word is a palindrome.') string_to_check = input('Please enter a word: ') if is_palindrome(...
true
6ad83291ffa6d37a3a45172587af590432b00734
gazon1/algorithms-codeforce
/555 div 3/B.py
UTF-8
897
3.09375
3
[]
no_license
def sol(n, s, f): f = {k:v for k, v in zip(range(1, 11), f)} i = 0 while i < n and f[s[i]] < s[i]: i += 1 t = i while i < n and f[s[i]] >= s[i]: i += 1 for j in range(t, i): s[j] = f[s[j]] return "".join([str(i) for i in s]) def test(): assert("1557" == sol(4...
true
f6d104b071669d4e691c445bbf1093bb0e0692a5
MichielCottaar/mcot.core
/mcot/core/surface/mesh.py
UTF-8
42,698
2.890625
3
[ "MIT" ]
permissive
"""Defines N-1 dimensional surfaces in N-dimensional space. All surfaces are represented by a Mesh with points and connections (i.e. line segments or triangles) between those points. """ import numpy as np from scipy import sparse, linalg from nibabel import freesurfer, spatialimages, gifti import nibabel as nib from ...
true
eb2a43f3d7ea071aee0fd073e303d8a389b913e5
ajaynb88/ebs-snapshots
/ebs_snapshots/inline_backup_config.py
UTF-8
607
2.71875
3
[ "Apache-2.0" ]
permissive
from backup_config import BackupConfig import yaml import json class InlineBackupConfig(BackupConfig): config = {} path = "" def __init__(self, path): """ Try loading path as inline YAML, then JSON """ try: self.config = yaml.load(path) except: try: ...
true
d297a4af547283cc010cadbb0507066cb1be76c2
SerhiiLypnyk/Softheme_Study
/denominators/denominators.py
UTF-8
124
3.4375
3
[]
no_license
x = abs(int(input('Input number: '))) dels = [] for i in range(1, x+1): if x%i == 0: dels.append(i) print(dels)
true
b1a781105412abc057c5e870f43f72667046f98d
yzerlaut/old-datavyz
/graphs/inset.py
UTF-8
1,702
2.75
3
[]
no_license
from .dependencies import * def inset(graph, ax, rect=[.5,.5,.5,.4], facecolor='w'): fig = graph.gcf() box = ax.get_position() width = box.width height = box.height inax_position = ax.transAxes.transform(rect[0:2]) transFigure = fig.transFigure.inverted() infig_position...
true
41ccf9ac6af094cf515c16b3fff4d566c43c3f4e
faisalraza33/leetcode
/Python/0696. Count Binary Substrings.py
UTF-8
2,162
4.1875
4
[]
no_license
# Given a binary string s, return the number of non-empty substrings that have the same number of 0's and 1's, and all the 0's and all the 1's in these substrings are grouped consecutively. # Substrings that occur multiple times are counted the number of times they occur. # # Example 1: # # Input: s = "00110011" # Outp...
true
9fe2799701de25200e135530cd5963867aedf0d3
kashinoki38/py-assume
/py-assume.py
UTF-8
1,957
2.59375
3
[ "Apache-2.0" ]
permissive
import boto3 import os import configparser import sys def assume(home_path, account_id, role_name): config = configparser.RawConfigParser() config.read(home_path + '/.aws/credentials') access_key = config['default']['aws_access_key_id'] secret_access_key = config['default']['aws_secret_access_key'] ...
true
3b3c2f46214238f51b43d21099fd863a91c9cdbf
negative0101/Python-OOP
/7.Iterators and Generators/reverse_string.py
UTF-8
242
4.0625
4
[]
no_license
def reverse_text(text): current_index = len(text) -1 while current_index >= 0: yield text[current_index] current_index-= 1 print(reverse_text('step')) for char in reverse_text('step'): print(char,end='')
true
ce1f5e192cc05f2827e01a6d5e8a547c58c84320
wsgan001/PyFPattern
/Data Set/bug-fixing-4/cb3ee31438d64ed7c2e4dd0df425e51367a8aaec-<filter_sk_params>-fix.py
UTF-8
633
2.625
3
[]
no_license
def filter_sk_params(self, fn, override=None): "Filters `sk_params` and returns those in `fn`'s arguments.\n\n # Arguments\n fn : arbitrary function\n override: dictionary, values to override sk_params\n\n # Returns\n res : dictionary containing variables\n ...
true
c3ebfcb3f638ceb20c690172772a31a584a049d8
davidadamojr/data_science_from_scratch
/map_reduce/mapreduce_framework.py
UTF-8
815
3.203125
3
[]
no_license
from collections import defaultdict from functools import partial def map_reduce(inputs, mapper, reducer): """runs MapReduce on the inputs using mapper and reducer""" collector = defaultdict(list) for input in inputs: for key, value in mapper(input): collector[key].append(value) ...
true
222270cf379d17a6e7b53ff1dc9676bb34ee1348
kaitlyndlee/RSEnterprise
/src/base/objs/Face/FacialRecognition/FacialRecognition.py
UTF-8
2,334
2.921875
3
[]
no_license
import cv2 import os import numpy as np class FaceRecognition: EIGEN = 0 FISHER = 1 LBPH = 2 IMAGE_PATH = "/home/syndicate/PycharmProjects/Iris/assets/faces/" def __init__(self, type): creation_dictionary = \ { FaceRecognition.EIGEN : cv2.face.createEigenFaceRec...
true
301ef95cf40814470ab0ba0d25b394c5552d66a9
DanishKhan14/DumbCoder
/Python/veryPythonic/Counter.py
UTF-8
2,118
4.375
4
[]
no_license
""" A Counter is a container that keeps track of how many times equivalent values are added. It can be used to implement the same algorithms for which bag or multiset data structures are commonly used in other languages. Counter does not raise KeyError for unknown items. If a value has not been seen in the input (as w...
true
53d057aec3283b998a4d303b261959d6548b4299
silianpan/seal-spider-demo
/github/login.py
UTF-8
2,693
2.515625
3
[ "Apache-2.0" ]
permissive
import requests from lxml import etree class Login(object): def __init__(self): self.headers = { 'Referer': 'https://github.com/login', 'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.169 Safari/537.36', ...
true
daaf225432617079688679ac543f23691295f821
mehulthakral/logic_detector
/backend/dataset/canJump/jumpGame_2.py
UTF-8
617
2.796875
3
[]
no_license
from typing import List class Solution: def canJump(self, nums: List[int]) -> bool: n = len(nums) interval = [0, 0] if n <= 1: return True while True: can_reach = -1 for i in range(interval[0], interval[1] + 1): ...
true
675ee7f33d747d79329e9a1fe1f1512080f4b04f
arkadiuszcyktor/pyGCS
/Grammar/modules/Parsers/CYK/Base/CykBaseTest.py
UTF-8
4,571
2.8125
3
[]
no_license
import unittest from modules.GCSBase.domain.symbol import Symbol from modules.GCSBase.grammar.grammar import Grammar from .CYKBase import CYKBase class CykBaseTest(unittest.TestCase): def setUp(self): self.cyk_base = CYKBase(0) def test_table_init(self): sentence = "I like sunny weather" ...
true
dca6bd3af4c930b6bed6f3186016d314d4c5c5f7
stefannica/zenml
/tests/scripts/test_update_todos.py
UTF-8
5,078
2.625
3
[ "Apache-2.0" ]
permissive
import os import pytest @pytest.fixture(scope="module", autouse=True) def setup_environment(): os.environ["JIRA_BASE_URL"] = "" os.environ["JIRA_USERNAME"] = "" os.environ["JIRA_API_TOKEN"] = "" os.environ["JIRA_BOARD_ID"] = "" os.environ["JIRA_ISSUE_TYPE_ID"] = "" os.environ["JIRA_DONE_STAT...
true
466f27e3c5d1f1fbc2fc938af78dcbb88206acd7
YuqingDuan/Python_03
/example.py
UTF-8
156
3.15625
3
[]
no_license
#匹配网址 import re reg="[a-zA-Z]+://[^\s]*[.com|.cn]" string='<a href="http://www.baidu.com">baidu</a>' res=re.compile(reg).findall(string) print(res)
true
284e3a0688d794eb23925ebc29661a1f606cebb7
running911/py2018
/stringcodes.py
UTF-8
329
2.8125
3
[]
no_license
if __name__==__main__: input_bytes=b'\xff\xfe4\x001\x003\x00\x00i\x00s\x00\x00i\x00n\x00.\x00' input_characters=input_bytes.decode('ascii') print(repr(input_characters)) output_characters='We copy you down,Eagle.\n' output_bytes=output_characters.encode('ascii') with open('eagle.txt','wb') as f: f.write(outpu...
true
2bb661f3d7ccb82e888b97ec727f2b22497dd9f2
Kimbbakar/Classroom
/myproject/accounts/forms.py
UTF-8
1,626
2.6875
3
[ "MIT" ]
permissive
from django import forms from django.contrib.auth.forms import UserCreationForm from django.contrib.auth.models import User CHOICES=[(0,'Student'), (1,'Teacher')] class SignUpForm(UserCreationForm): email = forms.CharField(max_length=254, required=True, widget=forms.EmailInput()) type = forms.Choice...
true
b9b394a782457d13b2480fdf8a7059ef6e0662a2
xmuccm/machine-learning-action
/Ch04/EXTRAS/create2Normal.py
UTF-8
1,138
3.359375
3
[]
no_license
''' Created on Oct 6, 2010 @author: Peter ''' from numpy import * import matplotlib import matplotlib.pyplot as plt def create_date_set(n): fw = open('testSet.txt', 'w') training_mat = zeros((n, 2)) labels = zeros((n, 1)) for i in range(n): r0, r1 = random.standard_normal(2) if random...
true
4e26f15e95362458cde3b88a23c8aa1286c2ceb7
jeffery12697/PBC-Final
/src/const.py
UTF-8
2,463
2.671875
3
[]
no_license
''' 這是負責存全部 constant 的檔案,請不要在裡面引用任何其他的class,避免circular import。 ''' import os os.environ['PYGAME_HIDE_SUPPORT_PROMPT'] = "hide" # 使用 pygame 模組 import pygame ########################################################### ''' 螢幕顯示的參數 ''' # 全螢幕的長寬大小 screen = pygame.display.set_mode((0,0), pygame.FULLSCREEN) screen_width = ...
true
43ea430a97b9d61648bdb4e6a9b249b8e34bf1e8
wodud2970/Data_Analysis
/데이터 분석/복권번호/lotto.py
UTF-8
4,461
3.046875
3
[]
no_license
import numpy as np rows = np.loadtxt("./lotto.csv", delimiter=",") row_count = len(rows) #당첨번호를 원핫인코딩벡터(onbin)으로 변환 def numbers2ohbin(numbers): ohbin = np.zeros(45) for i in range(6): ohbin[int(numbers[i]-1)] = 1 #로또번호가 1부터 시작하지만 벡터의 인덱스는 0부터 시작하므로 1을뺌 return ohbin #원핫인코딩벡터(ohbin)을 번호로 변환 def ...
true
4e9590858099f42d2bf283bbe3255851da54c1b6
crupley/hoodie-development
/code/graphreduce.py
UTF-8
3,292
2.796875
3
[]
no_license
import numpy as np import networkx as nx from collections import Counter from time import time import cPickle as pickle from graph_tool.all import * def graph_reduce(graph, max_size=1): ''' INPUT: Graph G, int max_size OUTPUT: None Sequentially remove most highly connected nodes until largest cluste...
true
c30e76435e279d50c872378c32f3c1dd1f9fad34
igc5972/comp_meth
/homework_1/homework_1_pt3.py
UTF-8
1,843
3.171875
3
[]
no_license
### PURPOSE: ASTP 720 (Computational Methods) HW #1 Pt. 3 ### Solve lens equation for values of x-prime for Gaussian lens ### [Isabella Cox, Aug. 2020] # Import Statements from matplotlib import pyplot as plt import numpy as np from root_library import bisection import math ##for pi from decimal import Decimal ##for ...
true
10876661bc46b3cab2dfb28de53d6bb3ecaf91ae
adcaes/rosalind
/src/gc.py
UTF-8
645
3.140625
3
[]
no_license
''' Given: At most 10 DNA strings in FASTA format (of length at most 1 kbp each). Return: The ID of the string having the highest GC-content, followed by the GC-content of that string. Rosalind allows for a default error of 0.001 in all decimal answers unless otherwise stated; please see the note on absolute error bel...
true
a834e80457118f5f83813f75c937f4ae9bb34bc4
daniel-reich/ubiquitous-fiesta
/Lv3K85ynggbKTbr23_20.py
UTF-8
105
2.5625
3
[]
no_license
def float_sum(A, B): return round(A + B, max(len(str(A).split('.')[-1]),len(str(B).split('.')[-1])))
true
bbcb1f7ac8c735b618b423c0a6cce3fd285eb2ff
Ridee/slackery
/slackery/bot.py
UTF-8
4,334
2.640625
3
[]
no_license
# -*- coding: utf-8 -*- from __future__ import absolute_import, print_function, unicode_literals import asyncio import logging import re from asyncio.events import AbstractEventLoop from slackery.http import SlackAPI logger = logging.getLogger(__name__) def match(expression: str, message: str): return re.match...
true
280d9690bf5f473e79f47a54433667f6f536756a
lqx-bubble/python-
/2.data analysis/0.爬取图片.py
UTF-8
531
2.765625
3
[]
no_license
# -*- codeing = utf-8 -*- # @Time : 2020/8/9 10:56 # @Author : 卢其鑫 # @File : 0.爬取图片.py # @Software: PyCharm import requests if __name__ == '__main__': #如何爬取图片数据 url = 'https://pic.qiushibaike.com/system/pictures/12344/123443932/medium/QDEWZUOD0WDPASOL.jpg' # text(字符串) content(二进制) json() (对象) ...
true
add936795bdb6bfa56e25b31c532c9bea8dee307
vladhc/rocket-paper-spacegoo
/example/random_client/shittyclient.py
UTF-8
1,558
2.65625
3
[]
no_license
#!/usr/bin/env python3 import socket, json import random, pprint #import view #view.init(1024, 768) USERNAME = "random_bot" PASSWORD = "bar" s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) s.connect(('localhost', 6000)) io = s.makefile('rw') def write(data): io.write('%s\n' % (data,)) io.flush() ...
true
e2b6843d82742ccfc2595c6f959fe6aee7d2957d
jung9156/studies
/projects/s03p12a211-bunmin/iot/gps.py
UTF-8
565
2.6875
3
[ "MIT", "LicenseRef-scancode-unknown-license-reference" ]
permissive
import serial import time import string import pynmea2 while True: port="/dev/ttyAMA0" ser=serial.Serial(port, baudrate=9600, timeout=0.5) dataout = pynmea2.NMEAStreamReader() newdata=ser.readline() if newdata[0:6] == "$GPRMC": newmsg=pynmea2.parse(newdata) lat=newmsg.latitude lng=newmsg.longitude gps = ...
true
b32c534728c56013e4e463c6386b71092761bfec
deolhoney/Drawing-FreeCAD
/backup/back.py
UTF-8
11,124
2.828125
3
[]
no_license
stories=8 #Number of stories dep_of_foun=6.0 #Depth of Foundation plinth_lev=4.0 #Plinth level of building cclear_height="3@10+30+6+3@8" #Clear Height of each story dep_slab=1 #Depth of Slab #rep_span_len="2@8+9+1@10+2@12" #Repre...
true
9219b2f2372142bb01fac6bdb5e7e58332411746
drfoland/python-calculator-example
/calculator.py
UTF-8
1,615
4.46875
4
[]
no_license
def get_user_input(): s = input(">>> ").replace(" ", "") #get user input, removes spaces values = [""] #creates list of string values, list is empty right now i = 0 #sets variable i to zero for c in s: #loop through characters in input if (c.isdigit() and i % 2 == 0) or (not c.isdigit() and i %...
true
22f8baf7a09120916574e21f779876beac293b11
cryptowealth-technology/PyTES
/test_class_slab_magnetic.py
UTF-8
2,285
2.65625
3
[ "MIT" ]
permissive
# -*- coding: utf-8 -*- """ Created on Fri Jul 7 11:18:05 2017 @author: Mihai """ import scipy as sc """ We define R1 = rho_1/rho_0 R2 = rho_2/rho_0 M_A = U_0/v_A K = k x_0 c_ph = omega/v_A """ class Asymmetric_magnetic_slab: def __init__(self, R1, R2, kx0, c0, v_A1, v_A2, M_A0, M_A1, M_A2): self.R1 ...
true
3a2d0257a8dc03fe78fde94432d621ff3f763665
ikramulkayes/Numpy-Python-Practice
/Numpy practice/Numpy4.py
UTF-8
183
3.015625
3
[ "MIT" ]
permissive
import numpy as np s = np.array([[12,41,3,13,312,77],[1,42,913,865,5,21]]) print(s) print(s[0,1:3]) print(s[:,1]) print(s[0,:]) print(s[s<12]) b = np.where(s>12,s,-1) print(b)
true
4d52b6586082e04e3080c6dc1a5f112ac52addf7
ben-dasilva/lc-solutions
/lcpy/30dc-0520/c_05_21_20.py
UTF-8
1,353
3.390625
3
[]
no_license
from typing import List class Solution: def countSquares(self, matrix: List[List[int]]) -> int: if not matrix or not matrix[0]: return 0 ncols = len(matrix[0]) prev_row = [0] * ncols count = 0 for row in matrix: this_row = list(prev_row) ...
true
8f775a17a4e2d0920f2973b529bd64c285e21de8
VardaanBajaj/AutomatedShortStrangle
/util/json_util.py
UTF-8
313
2.6875
3
[]
no_license
import json import logging log = logging.getLogger(__name__) class JsonUtil: @classmethod def jsonify(cls, object, encoder, pretty_print=False): tabs = 4 if pretty_print else None json_str = json.dumps( obj=object, cls=encoder, indent=tabs ) return json_str
true
fed9031bf0278b677b63683a0a4c79f3bace5dcd
abhishek-88/IOT-project
/shiffin client.py
UTF-8
842
2.65625
3
[]
no_license
import socket import encodings import sqlite3 import time HOST = '127.0.0.1' PORT = 12345 def my_client(): with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s: s.connect((HOST, PORT)) conn = sqlite3.connect("DATA.db" ) cursor = conn....
true
2539f567daad1a1f7a1871ead7384f0fa052b7a2
Qiuhao-Wu/keras_mnist_fashion_mnist_cifar10
/mnist/MNIST_TensorFlow/mnist_train.py
UTF-8
8,912
2.90625
3
[ "MIT" ]
permissive
# -*- coding: utf-8 -*- import tensorflow as tf import numpy as np from tensorflow.examples.tutorials.mnist import input_data # 加载mnist_inference.py中定义的常量和前向传播的函数 import mnist_inference # 配置实现指数衰减学习率的相关参数 BATCH_SIZE = 100 # 数字越小时,训练过程越接近随机梯度下降;数字越大时,训练越接近梯度下降 LEARNING_RATE_BASE = 0.01 # 基础的学习率 LEARNI...
true
ce9bef57db33b4f71eb25a134d0371fd61434f8c
uk-gov-mirror/moj-analytical-services.pydbtools
/pydbtools/read_sql.py
UTF-8
2,602
2.546875
3
[]
no_license
import pandas as pd import warnings from functools import wraps import awswrangler as wr # setting s3fs cache to false is to try an fix this Access Denied ListObjectsV2 issue # see below https://github.com/pandas-dev/pandas/issues/27528 from pydbtools.get_athena_query_response import get_athena_query_response from pyd...
true
811dc305786ebf88ac0ab88fb9a679924260a6bc
Wilson08/contacts-scrapy
/contacts/spiders/contacts_spider.py
UTF-8
1,046
2.53125
3
[]
no_license
import scrapy from scrapy.crawler import CrawlerProcess import re import sys class ContactSpider(scrapy.Spider): name = "contacts" def start_requests(self): urls = sys.stdin.readlines() for url in urls: yield scrapy.Request(url=url, callback=self.parse) def parse(self, respon...
true
93c0fba184721a35458766ca88fae42daa6cc871
ClementineSz/data_mining_allmusic
/tests/test_scraping_artist.py
UTF-8
186
2.84375
3
[]
no_license
from scraping.artist import Artist def test_scraping_artist(): artist = Artist('test') artist.popularity = 100 print(artist.popularity) assert artist.popularity == 100
true
efba934e1be54f7037ca7218985a19756073ee3a
Grukz/credmap
/websites/airbnb.py
UTF-8
1,716
2.84375
3
[ "MIT" ]
permissive
""" Site: Airbnb.com Description: Online service to list, find, and rent short-term lodging. Author: @LightOS -=Module Details=- Account exists detection: True Account disabled detection: True Captcha detection: N/A 2FA detection: N/A """ __version__ = '0.1' __author__ = 'LightOS' def run(browser, creds): """Ru...
true
bbf4b751d37c15b57a40f3cff3a4d472581b1f61
andreypz/okl
/opros/opros.py
UTF-8
14,470
2.703125
3
[]
no_license
#!/usr/bin/env python # -*- coding: utf-8 -*- from htmlTag import * from datetime import datetime import cgi import sys, os import pickle def cgiFieldStorageToDict( fieldStorage ): """Get a plain dictionary, rather than the '.value' system used by the cgi module.""" params = {} for key in fieldStorage.k...
true
eca4a8aa0582cc43d8fad2df6bede64a34afc710
welvin21/pysimt
/pysimt/vocabulary.py
UTF-8
7,121
3.1875
3
[ "MIT" ]
permissive
import json import pathlib import logging from collections import OrderedDict from typing import List logger = logging.getLogger('pysimt') class Vocabulary: r"""Vocabulary class for integer<->token mapping. Args: fname: The filename of the JSON vocabulary file created by `pysimt-build-vo...
true
6d4f3f906429f601c8bf127ebe3612baacce481b
C-Dongbo/machine_learning
/bi-lstm-attention/main.py
UTF-8
3,822
2.515625
3
[]
no_license
import argparse import os import numpy as np import torch from torch.autograd import Variable from torch import nn, optim from torch.utils.data import DataLoader from sklearn.metrics import classification_report from dataset import SentenceClassificationDataset, preprocess, collate_fn from models import BiLSTM_ATTN...
true
3aada907a6ed646a00fb810a7bf00ea676cde363
chris-tse/CS4173-Lab1
/task1/worddiff.py
UTF-8
324
3.5
4
[]
no_license
#! /usr/local/bin/python3 import sys def n_lower_chars(string): return sum(1 for char in string if char.islower()) diff = int(sys.argv[1]) text = sys.stdin.read().split() for word in text: num_lower_case = n_lower_chars(word) if num_lower_case <= diff and num_lower_case > 0: print(word, end=', '...
true
1a3d9f41e5118d553dd34aae39424ca78b910618
SeanyDcode/codechallenges
/dailychallenge511.py
UTF-8
489
3.921875
4
[]
no_license
# from dailycodingproblem.com # # Daily Challenge #511 # You are given an array of integers, where each element represents the maximum number of steps that can be # jumped going forward from that element. Write a function to return the minimum number of jumps you must # take in order to get from the start to the end ...
true
485a9bbb52c87f82aea60e30e64f9dbf242dc137
szpone/vending_machine
/vending_machine.py
UTF-8
1,764
3.53125
4
[]
no_license
COINS = ['D', 'N', 'Q'] def coin_value(c): if c == 'D': return 10 elif c == 'N': return 5 elif c == 'Q': return 25 class Machine(): def __init__(self): self.response = [] self.coins_inserted = [] self.b_items = 5 self.a_items = 10 self....
true
fd3a5d4ac374fd1733c5448f0f0811c7b05b0639
Jiho1996/python_book
/HongGongPython/06-1.1.py
UTF-8
196
3.15625
3
[]
no_license
numbers = [52, 273, 32, 103, 90 ,10, 275] print("요소 내부에 없는값?") number = 52 try : if numbers.index(number) : print("ㅇㅇ") except : print("ㄴㄴ") print("끝")
true
a7392a27f66b4099bae8fd2a1f0b6cf9261620a4
Leopbrito/Curso_em_Video
/Python/Exercicios/002.py
UTF-8
106
3.21875
3
[]
no_license
nome = input('Digite seu nome: ') print('Seja bem-vindo!\nÉ um prazer te conhecer, {} !!!'. format(nome))
true
6a6a504cb1f839bdfc7dbd44b4311d2a872371f4
vaclavpavlicek/neuralmonkey
/neuralmonkey/nn/mlp.py
UTF-8
1,996
2.859375
3
[ "BSD-3-Clause" ]
permissive
#tests: lint import numpy as np import tensorflow as tf def dense(last_layer, last_layer_size, size, i, activation=tf.tanh): with tf.variable_scope("dense_layer_{}".format(i)): init = np.sqrt(6.0 / (last_layer_size + size)) weights = tf.Variable(tf.random_uniform([last_layer_size, size], ...
true
3d3e0764072b350dbb5e33776b62e0cb297ca66a
messyoxd/CovidRank
/Main.py
UTF-8
702
2.65625
3
[]
no_license
from DataExtraction.CSVFileReader import CSVFileReader from DataComparation.CovidRank import CovidRank from SortingAlgorithm.ShellSort import Shell from rank_casos import RankCasos from novos_casos_mediana import MedianaCasosNovos import os if __name__ == "__main__": options = { 1: "Rank Covid", 2:...
true
d3b1e7a2ccdca72d77caaa22e0b5d1d2bedaa237
thiagohk/bank_process
/tests/test_account.py
UTF-8
2,170
2.953125
3
[ "MIT" ]
permissive
# -*- coding: utf-8 -*- import pytest from bank_process.account import Account from bank_process.transaction import Transaction __author__ = "thiagohk" __copyright__ = "thiagohk" __license__ = "mit" def test_should_apply_fee(): assert Account(1, 10).should_apply_fee() == False assert Account(1, 0).should_ap...
true
66d5de38ace28b56265dc92ce3569863f0d47587
MihirDharmadhikari/ses_pkg
/scripts/turtlebot_cmd_vel_demo.py
UTF-8
535
2.515625
3
[]
no_license
#!/usr/bin/env python import rospy from geometry_msgs.msg import Twist vel_pub = rospy.Publisher('cmd_vel', Twist, queue_size = 10) def vel_publisher(lin_vel, ang_vel): vel_cmd = Twist() vel_cmd.linear.x = lin_vel vel_cmd.angular.z = ang_vel vel_pub.publish(vel_cmd) def shutdown_func(): vel_publisher(0.0, 0.0)...
true
bb8f75fa587330f8748c54e0fd05f662faf85a3b
kedz/ntg
/python/bridge/__init__.py
UTF-8
3,049
2.6875
3
[]
no_license
import torch.nn as nn import torch.nn.functional as F def from_args(args, rnn_hidden_size=None, num_layers=None, bidirectional=None, bridge_type=None): if bidirectional is None: bidirectional = args.bidirectional if rnn_hidden_size is None: rnn_hidden_size = args.rnn_hidden_siz...
true
5259184f54dc8d9bc9fd159a669e1b3e5b1f07c1
SajaSwalgah/diabetesPredector
/secondPage.py
UTF-8
3,411
2.9375
3
[]
no_license
# -*- coding: utf-8 -*- """ Created on Mon Feb 15 18:19:16 2021 @author: Saja """ import tkinter from diabetes import getRersults from menuBar import mainMenue def next_page(name, age, gender): def exitSecondWindow(): window.destroy() window =tkinter.Tk...
true
41b448191b1d0b813437afa2678cba0dfc335197
matsu7874/contest_20190914
/02_sentouryoku/tests/validator.py
UTF-8
101
2.71875
3
[]
no_license
#!/usr/bin/env python3 S = input() assert 2 <= len(S) <= 10 assert all('A' <= c <= 'Z' for c in S)
true
99e1c46c698647fcb0da78cef267331628c28a91
JulianNymark/euler
/10001stprime/main.py
UTF-8
1,075
4.0625
4
[]
no_license
import math def genprimes(n): '''sieve of eratosthenes on array of length n''' primes = [True] * n increasingCoefficient = 2 # first 2's, then 3's ... (but multiples) upTo = math.ceil((math.sqrt(n)) + 1) while (increasingCoefficient <= upTo): i = 2 checkNumber = i * increasingCoe...
true
607ffb6796ae0d4526ead2f0b581631370fb318f
marcosjuniorads/SIN5024
/convex recoloration/py/convex_recoloration_lazy.py
UTF-8
2,856
3
3
[]
no_license
import gurobipy as gp from gurobipy import GRB from functions_callback import * from functions_model import * from functions_files import * from gurobipy.gurobipy import LinExpr import os # path do arquivo diretorio = str('E:\\SIN5024\\convex recoloration\\instancias\\') diretorio_resultados = str('E:\\SIN5024\\convex...
true
e332957756f038a48e335496b7e1ea1c8db73888
Vhiper-JM/practica_flask
/main.py
UTF-8
361
2.546875
3
[ "MIT" ]
permissive
from website import create_app app =create_app() if __name__ == '__main__': #Only if this file is ran (not imported) app.run(debug = True) #This line will be executed and the flask server will be created, along side activating live changes on the page # a.k.a. refreshing the page eve...
true
9569cf6c2f7efbbed93cabe716ce101791cfc5e7
victoriacity/nssim
/nssim/simulator_2d.py
UTF-8
20,916
2.78125
3
[]
no_license
import taichi as ti import numpy as np DIM = 2 ''' A differentiable simulator program which performs fluid simulation and optimized the particle field towards a target image. ''' @ti.data_oriented class MPMSimulator2D: ''' Initializes the simulator which runs on device DEVICE. Note: OpenGL and CUD...
true
be00fb7c1af7ed0cd2e25998c8590a52fed8ce09
HBinhCT/Q-project
/hackerrank/10 Days of Statistics/Day 8 - Least Square Regression Line/solution.py
UTF-8
236
3.140625
3
[ "MIT" ]
permissive
n = 5 xy = list(map(int, input().split()) for _ in range(n)) sx, sy, sx2, sxy = map(sum, zip(*[(x, y, x ** 2, x * y) for x, y in xy])) b = (n * sxy - sx * sy) / (n * sx2 - sx ** 2) a = (sy / n) - b * (sx / n) print(f'{a + b * 80:.3f}')
true
d5b33b83f4433e9a85fc3b411f96876b9c469a05
jm33-m0/proxy_pool
/Util/utilClass.py
UTF-8
1,056
2.71875
3
[ "MIT" ]
permissive
# -*- coding: utf-8 -*- # !/usr/bin/env python """ ------------------------------------------------- File Name: utilClass.py Description : tool class Author : JHao date: 2016/12/3 ------------------------------------------------- Change Activity: 2016/12/3: Class ...
true
f292e405902250df2d359a1aab8d3f9e16d5288e
Asher-MS/Automatic_Transcript_maker
/gui.py
UTF-8
672
2.75
3
[]
no_license
import PySimpleGUI as sg import converter import os running=True main_window_layout=[[sg.Text("Automatic Transcript Maker")],[sg.Text("Enter the FileName")],[sg.Input(key='-FILE_NAME-')],[sg.Button("Convert")],[sg.Text(size=(40,20),key="-OUTPUT-")],[sg.Text("®This Software was desingned and developed by Asher Mathews...
true
ee029c7fb23bab1f31ea2c197acab23294738502
dssudake/AudMIX
/backend/processAPI/models.py
UTF-8
1,914
2.578125
3
[]
no_license
import os import uuid import shutil from django.db import models from django.conf import settings from django.dispatch import receiver def create_with_pk(self): """ Create the AudioFile Object if not created initially """ instance = self.create() instance.save() return instance def get_file...
true
fcb1cc5c364cdcaf68b9c164b0b736642e07c826
d4chinchilla/docs
/report/appendixD/code/mark/led_ctl.py
UTF-8
7,814
3.15625
3
[]
no_license
# Based on example by Adafruit and using Adafruit libraries # imports import time import board import neopixel import json import digitalio import ast from math import pi # Definitions FAN_OUT = 3 NUM_PIXELS = 46 # _____________________________________________________________________________ # Setup # # Setup LEDs f...
true
f20a8f2b4907c63bce62202e2fa4052877ac83b4
karjalan-mies/number_encoder
/app2.py
UTF-8
3,135
3.1875
3
[]
no_license
import hashlib import os.path from tkinter import filedialog as fd from tkinter import messagebox as mb import tkinter as tk import csv def get_path(): path = fd.askopenfilename() return path def insert_path(): entry_path.delete('0', 'end') entry_path.insert('0', get_path()) def show_error(): ...
true
8f6fc1d963b0a7735c2cdf400a390b108fd6cef3
Team9-RobotIX/AWS
/flaskapp/encoder.py
UTF-8
1,361
2.609375
3
[]
no_license
from flask.json import JSONEncoder from classes import Instruction, Target, Delivery, DeliveryState class CustomJSONEncoder(JSONEncoder): def default(self, obj): if isinstance(obj, Instruction): return { 'type': obj.type.name, 'value': obj.value } ...
true
2be390ad872afaa1f05aa581b0dff60ad5455427
MartinRomero2007/Python_Quantum
/Practica1/Hello.py
UTF-8
171
4.15625
4
[]
no_license
def hello(nombre): if nombre == str(name): print(f'Hola {nombre}!') else print(f'Hola mundo') name = str(input('Ingrese su nombre: ')) hello(name)
true
019c752e5995abd82b295ae01d824813d016d840
Yalfoosh/DUBUCE
/LAB4/util/losses.py
UTF-8
1,398
2.71875
3
[ "Apache-2.0" ]
permissive
# Copyright 2020 Miljenko Šuflaj # # 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 or a...
true
9056c0af226927895b6a0537d302e4f5a37608e0
krishnaw14/CFD-codes
/HW1/finite_differences.py
UTF-8
8,517
3.859375
4
[ "MIT" ]
permissive
import numpy as np import matplotlib.pyplot as plt import os def f(x): # Function whose derivative we need to calculate return np.sin(x) def Df(x): # Exact derivative of f. This is used to compute error of the finite differences methods. return np.cos(x) ############################################ # Functions t...
true
8fcb8c0273706227d1e299d037704149fbd9e99e
alexandraback/datacollection
/solutions_5709773144064000_1/Python/TheTaintedOne/solution.py
UTF-8
478
3.015625
3
[]
no_license
import sys import itertools lines = sys.stdin.readlines() ntests = int(lines[0]) curr = 1 for t in range(1, ntests+1): C, F, X = [float(x) for x in lines[curr].split()] S = 2 # cookie speed cumtime = 0 while True: nottime = X/S buytime = (C/S) + (X/(S+F)) if buytime < nottim...
true
d7a83dde402000bcecfe0afb274cf067fa4b2373
RafalH4/ImagesOperations_python_openCV
/arOp_Color.py
UTF-8
12,263
3.265625
3
[]
no_license
#Operacje arytmetyczne na obrazach kolorowych import numpy as np import cv2 class ArOpColor: def sumImgWithNumber(self, img, number): img = cv2.imread(img) fMax = 0 fMin = 255 qMax = 0 x = 0 width = img.shape[1] height = img.shape[0] resultImg = np.em...
true
b2284e9d32eb3855e9ad37c6d3c717e58b65feca
hguochen/algorithms
/python/cci/trees_graphs/4_2_directed_graph_route.py
UTF-8
4,053
4.40625
4
[]
no_license
# Given a directed graph, design an algorithm to find out whether there is a # route between two nodes. # Easier with adjacency matrix # Harder to determine with adjacency list. import digraph def has_route(digraph, node1, node2): """ Return True if node1 is connected to node2 in graph, False otherwise. ...
true
0bea755e35627292b565b1588cfabd75982ff75e
Gwanghun-Im/herokutest
/home/views.py
UTF-8
820
2.65625
3
[]
no_license
from django.shortcuts import render # Create your views here. def index(request): try: username = request.GET.get('username') context = { 'username':username, 'cnt':who(username) } return render(request, 'home/index.html',context) except: return r...
true
f20d8f0f2e901e4acab80ddfc00ac48b74a11237
jiauy/before_work
/PythonAndOop/N40_super_1.py
UTF-8
416
3.9375
4
[ "MIT" ]
permissive
class MyClass: def func(self): print("I'm being called from the Parent class") class ChildClass(MyClass): def func(self): print("I'm actually being called from the Child class") print("But...") # Calling the `func()` method from the Parent class. super(ChildClass, sel...
true
d8a2bab15f07b98fbf04e99251097665a0037054
maxxonair/DataAnalysis
/02_RegressionAndPrediction/showStock3.py
UTF-8
1,401
2.859375
3
[]
no_license
import pandas as pd from alpha_vantage.timeseries import TimeSeries #import alpha_vantage import matplotlib.pyplot as plt import time # Api key to access alpha vantage stock data api_key = "RUNKI8FWHBYTQE4K" #gapminder = pd.read_csv(data_url) #print(gapminder.head(300)) def createPercentageComp(stockIndx1, stockIndx2...
true
5b47b0d092d041275f8deea2ff28bcacadda8976
OlexaNdrus/Codewars
/PaginationHelper.py
UTF-8
1,528
3.921875
4
[]
no_license
# TODO: complete this class from math import ceil class PaginationHelper: # The constructor takes in an array of items and a integer indicating # how many items fit within a single page def __init__(self, collection, items_per_page): self.collection = collection self.items=items_per_page ...
true
64df664cbbd0009e1f243cbe64a1de94768412de
agusmdev/proxy-checker
/proxy_checker.py
UTF-8
2,550
2.765625
3
[]
no_license
from operator import itemgetter import requests from threading import Thread from collections import defaultdict, OrderedDict import concurrent.futures import json class ProxyBenchmark: def __init__(self, slice_size=100, proxies_path='proxies.txt', threaded=True, attempts=3): self.proxies = list...
true
3b9e82f640044ca3319bef5e5ebe45937fcc44ea
Dewei-Yu/Pets-Recognition
/Web/FlaskServer/app.py
UTF-8
2,049
2.703125
3
[]
no_license
import os import base64 import io from PIL import Image from flask import request from flask import jsonify from flask import Flask, render_template from scripts import Cat_Dog_Classifier from scripts import Emotion_Dog from scripts import Emotion_Cat from scripts import Breed_Cat from scripts import Breed_Dog from sh...
true
220c09fe967f1509f6f454be5fada5420ec9e6df
CedricPedric/van-input-naar-output
/pizzaCalculator.py
UTF-8
1,375
4.4375
4
[]
no_license
#Cedric Francis Pizza calculator keuzePizza = input("---------------------------------------------------" + "\n" #Keuze menu van afmetingen (\n voor een nieuwe regel) "| Type welke afmeting pizza u wilt: " + "\n" "| Small:€6.99 " + "\n" "| Medium:€9.99 " + "\n" "| Large:€14.9...
true
082dba19cdc73808d0b2eeb58a8d09d7dc701bc7
SaidRem/just_for_fun
/itertools_replace.py
UTF-8
685
4
4
[]
no_license
# Given a string. # Print all possible size replacement combinations of the string in # lexicographic sorted order. # Input format: # A sinfle line containing the string and integer value separated by a space. # Output format: # Print the combinations with their replacements of the string on separate lines. ...
true
87ab2c4f6ef1438804f5bfcc443dcfad3356455e
johnriv1/Computer_Science_1_Fall_2015
/Lab 1/lab1_part2.py
UTF-8
778
2.84375
3
[]
no_license
base10 = 128 base2 = (base10*(10**9))/(2**30) difference = base10 - base2 print base10, "GB in base 10 is actually", base2, "GB in base 2,", difference, "GB less than advertised." base10 = 256 base2 = (base10*(10**9))/(2**30) difference = base10 - base2 print base10, "GB in base 10 is actually...
true
2e3c6eb6c86d80c00ccc8a4f8acba677c190551e
ngiakhanh96/MesaPlayground
/agv_agent.py
UTF-8
5,362
2.90625
3
[ "MIT" ]
permissive
from mesa import Agent from utilities import * import enum class Agv_Type(enum.Enum): Left = 0, Right = 1 class Status(enum.Enum): Free = 1 GoingTo = 2 Comeback = 3, Filling = 4, Loading = 5 class Agv_Agent(Agent): def __init__(self, unique_id, name, model, home_coordinate, loading_s...
true
a368fe203be1ec023398af4c52113ccdbcc5fd16
CarlYarwood/CS325BigTrees
/translate.py
UTF-8
351
2.78125
3
[]
no_license
''' translate.py Jon Beck A program to read a DNA sense strand from a fasta file and translate it into one-letter amino acid sequence. Assumptions: 1. DNA is 5' to 3' and is a multiple of 3 in length 2. fasta file has only one sequence ''' #from readfasta import readfasta from genetic_code import code def get_codon(...
true
94e8c49c73ac38c10a8217cc377e37cb9923bbdc
wuluwululang/mGui
/mGui/observable.py
UTF-8
7,611
3.25
3
[ "MIT" ]
permissive
""" Observable.py @author: stevetheodore """ import itertools from collections import MutableSequence, Sequence from mGui.bindings import BindableObject from mGui.events import MayaEvent, Event class ObservableCollection(MutableSequence, BindableObject): """ Encapsulates a collection suitable for data bindin...
true
0b46fb6e23697664ae1ef26f2ff6c9dd0e92c2bd
Rahuly-adav/leetcode
/leetcode/BST.py
UTF-8
2,519
3.6875
4
[]
no_license
class Node: def __init__(self,data): self.data=data self.left=None self.right=None class BST: def __init__(self): self.root=None def insert(self,data): if self.root: self.insertNode(data,self.root) else: self.root=No...
true
dc112a4a3ca17893e5a559d85960f33d08eec842
avila196/algo-codings-projects
/heap/Binary_Node.py
UTF-8
939
3.515625
4
[]
no_license
from Double_Node import DNode class BinaryNode(DNode): def __init__(self,priority,element,parent=None,left=None,right=None): #We call the super constructor using the priority as well super().__init__(priority,element,left,right) self._parent=parent #Here, we add the priority as wel...
true
608e329cca5b3bd0da1f500a61a95e2774278672
1ayham1/Data_Science-MemesGenerator
/QuoteEngine/Ingestor.py
UTF-8
1,241
2.90625
3
[ "MIT" ]
permissive
"""Define family of algorithms and make them interchangeable The algorithms vary independetly from the clients using it. This class implements to IngestorInterface and dynamically invoke a suitable algorithm (strategy.algorithm()), through parse() abstract method. i.e. it is independent of how an algorithm is im...
true
37f4ee2d56b33843f0d8970dcf9bc691322fc852
julianconstantine/neural-networks-and-deep-learning
/code/mnist_loader.py
UTF-8
3,724
3.84375
4
[ "MIT" ]
permissive
""" mnist_loader ------------ A library to load the MNIST image data. For details of the data structures that are returned, see the doc strings for load_data() and load_data_wrapper(). In practice, load_data_wrapper() is the function usually called by our neural network code. """ # Libraries import gzip import pickle...
true