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
613b3938a8ea5db1ad7173a2797d0c5745e1d737
RedFox-Gamer/FakeInfo
/profile.py
UTF-8
211
3.015625
3
[]
no_license
#pip install faker from faker import Faker fake = Faker() #Printing the fake info print(fake.name()) print(fake.email()) print(fake.country()) print(fake.latitude(), fake.longitude()) print(fake.url())
true
00fe9e58faba71157d8d35599ee4315dc82ed454
AndreiKorzhun/Stepik
/Программирование на Python/7/spelling.py
UTF-8
441
3.203125
3
[]
no_license
# number of known words d = int(input()) # put known words in the list lst_d = [i.lower() for _ in range(d) for i in input().split()] # the number of lines of text to check w = int(input()) # lines of text lst_l = [i.lower() for _ in range(w) for i in input().split()] # set of wrong words mist = set() # chech lines o...
true
d94c8779fc1a8120112e07a0bd4c7705678f737f
kassiopea/SendMail
/pages/compose_page.py
UTF-8
2,156
2.59375
3
[]
no_license
from selenium.webdriver import ActionChains from constants import ComposePageMessages from pages.base_page import BasePage from pages.locators import ComposePageLocators class ComposePage(BasePage): def fill_email_field( self, email: str ) -> None: to_input = self.browser.fin...
true
1f093fea9c4e1c9874a4b75a3c42192cc179c92c
saurabhsood91/us-elections
/cross_validation.py
UTF-8
2,134
2.8125
3
[]
no_license
import csv import re import ast # import geocoder from sklearn.naive_bayes import GaussianNB, MultinomialNB from sklearn.feature_extraction.text import TfidfVectorizer, CountVectorizer from sklearn.cross_validation import KFold, cross_val_score, LeaveOneOut from sklearn.metrics import accuracy_score from sklearn import...
true
a78cf3a070c87a9974221a827bff81dc65d12baa
irvs/ros_tms
/tms_rc/tms_rc_pot/scripts/plot_out.py
UTF-8
1,037
2.53125
3
[]
permissive
#!/usr/bin/env python # license removed for brevity import rospy import time from std_msgs.msg import String from geometry_msgs.msg import PoseStamped def talker(): pub = rospy.Publisher('move_base_simple/goal', PoseStamped, queue_size=10) rospy.init_node('plot_out', anonymous=True) tmp_pose = PoseStamped(...
true
244d566401dcb1616e4ca56a3801e9dbf6cc063a
WillCollier/Tensorflow
/convolutional_network.py
UTF-8
7,161
3
3
[]
no_license
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ @author: William Collier """ import tensorflow as tf import matplotlib.pyplot as plt from tensorflow import keras import tensorflow_datasets as tfds #%% """ Deep computer vision """ from tensorflow.keras import datasets, layers, models (train_images, train_lab...
true
7c66380971268e271ea8c04a1d5fc84f8f1c2e97
jzeas2/eBayScanner
/ebayScanner.py
UTF-8
2,071
3.453125
3
[]
no_license
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Mon Feb 4 18:06:12 2019 @author: jonathanzeas This script allows users to continually search on eBay for an item they know will be listed soon. Once the item is found, the pay window opens on the user's computer and all they must do is click the "pay now...
true
40e6d96c46f998b549ce133e9917b197ac61e77f
Yaro1/Exercism-python
/difference-of-squares/difference_of_squares.py
UTF-8
199
3.46875
3
[]
no_license
def square_of_sum(n): return n ** 2*(n+1) ** 2 // 4 def sum_of_squares(n): return n*(n+1)*(2*n+1) // 6 def difference_of_squares(n): return (3 * n ** 4 + 2*n**3 - 3*n**2 - 2*n) // 12
true
cb9415e296ba3e20329ccabbe920e14da6fa7538
krshubham/compete
/college_life/codeforces/rounds/edu_25.py
UTF-8
325
3.046875
3
[]
no_license
t = int(input()) a = input() count = 0 zc=0 st='' i = 0 while (i<t): while(int(a[i]) == 1): count+=1 if(i==t-1): break print(count) while(int(a[i]) == 0): zc+=1 if(i==t-1): break print(zc) if(count != 0): st+=str(count) count = 0 if(zc != 0): for j in range(zc-1): st+=str(0) zc = 0 print(...
true
fd2261824472d8b91523226a81bae990542fd7a8
apulgarr/Pocket_Rocket
/pocketRocket/methods/marcasindividual.py
UTF-8
164
2.546875
3
[]
no_license
import sys import numpy as npy #DEBE SER CUADRADA!! K = [[0, 2, 3], [7, -1, 20], [1, -14, 8]] s = [-1,0,1] print ("Solucion: ", npy.linalg.solve(K,s))
true
ba88fc507ba76bbcfe11bf850e999e9bd4998890
hyeokjinson/algorithm
/ps프로젝트/GP/순열사이클.py
UTF-8
547
2.984375
3
[]
no_license
import sys input=sys.stdin.readline def dfs(v): visit[v]=True for i in graph[v]: if not visit[i]: dfs(i) if __name__ == '__main__': t=int(input()) for _ in range(t): n=int(input()) arr=list(map(int,input().split())) graph=[[] for _ in range(n+1)] ...
true
5615972868ef59914b8e5e3e9989cfe2a21a6273
Edgis/Machine-learning-in-action
/regTrees.py
UTF-8
8,305
3.09375
3
[]
no_license
#coding=utf-8 ''' Created on Aug 19, 2017 Tree-Based Regression Methods @author: Edgis ''' from numpy import * from tkinter import * import matplotlib.pyplot as plt import matplotlib def loadDataSet(fileName): dataMat = [] fr = open(fileName) lines = fr.readlines() for line in lines:...
true
98b102d3b1e32aa7bdd5be2ec5add84e3cc9d6ed
c-dickens/sketching_optimisation
/experiments/ihs_baselines/error_vs_num_iters.py
UTF-8
3,506
2.515625
3
[]
no_license
import json import itertools from timeit import default_timer from pprint import PrettyPrinter import numpy as np import scipy as sp from scipy import sparse from scipy.sparse import load_npz, coo_matrix, csr_matrix import sys sys.path.append('../..') from data_config import datasets from lib.random_projection import R...
true
b11d43e49bf8d24f5c45a081a5e9babec64fbea8
kjahan/evaluation
/tests/test_metrics.py
UTF-8
1,073
2.671875
3
[ "Apache-2.0" ]
permissive
import src.metrics as metrics import pytest def mock_recoms(): recommendations = {1: [(10, 0.1), (20, 0.05)], 2: [(30, 0.8), (40, 0.01)], 3: [(10, 0.5), (50, 0.35)]} user_labels = {1: [10, 30, 60], 2: [20, 50, 70], 3: [10, 50], 6: [10, 70]} return recommendations, user_labels def test_compute_precision_...
true
917d0c18d916eb494ee8e7f7eeb3176db8ecc728
EverBilly/pythonHolaMundo
/archivos.py
UTF-8
227
2.953125
3
[]
no_license
print('----------------------------------------------------------------------') leer = open('archivo.txt') # lineas = leer.readlines() try: for lee in leer.readlines(): print(lee) pass finally: leer.close()
true
2d7cb6850206aaee7cf0bf012513eead0a837cd6
igrek51/trimmer
/tests/test_from_file.py
UTF-8
1,133
2.625
3
[ "MIT" ]
permissive
import os import shutil import eyed3 from pydub import AudioSegment from trimmer.trim_source import trim_from_source def test_trim_from_file(): shutil.copyfile('./tests/tubular_showcase_bad.mp3', './tests/result_tubular_showcase_bad.mp3') source = './tests/result_tubular_showcase_bad.mp3' assert os.path...
true
69d9ba21e111f63d77e728e627eab5c35d6feceb
AverPower/Algorithms_and_Structures
/10. Graphs - 1/Task A.py
UTF-8
810
3.046875
3
[]
no_license
from sys import setrecursionlimit import threading RECURSION_LIMIT = 10 ** 9 STACK_SIZE = 2 ** 24 setrecursionlimit(RECURSION_LIMIT) threading.stack_size(STACK_SIZE) def dfs(v, color, cur, g): color[v] = cur for u in g[v]: if color[u] == 0: dfs(u, color, cur, g) def main(): n, m = m...
true
15dfc8f1e086010ea836c5b05abc6368322014fc
zjun728/FlaskProject
/flask004/apps/views.py
UTF-8
11,124
2.59375
3
[]
no_license
import shutil from werkzeug.utils import secure_filename from apps import app from apps.utils import create_folder, secure_filename_with_uuid, check_files_extension, ALLOWED_IMAGEEXTENSIONS from flask import url_for, render_template, request, redirect, flash, make_response from apps.forms import RegistForm, LoginFo...
true
0c1019f7383482ede69c5120e0216af31b95abca
luca16s/INF1025
/REPETICAO_STRING/EXERCICIO_6.py
UTF-8
1,506
3.375
3
[]
no_license
def converteHorasEmMinutos(horas): return (int(horas[0:2])*60) + int(horas[:2:-1]) def processarVoos(horarioPrevistoChegada, horarioChegada): chegada = converteHorasEmMinutos(horarioChegada) chegadaPrevista = converteHorasEmMinutos(horarioPrevistoChegada) if chegada < chegadaPrevista: print('O ...
true
e27aa713ca25227c0c1daef10ce4b526a9c451b3
sedihub/deep_learning_research
/old_projects/cnn_classifiers/utilities/tile_image_plot_utilities.py
UTF-8
12,617
3.328125
3
[ "MIT" ]
permissive
"""This script contains utility functions for generating tile plots of image/matrices. """ import os import numpy as np import matplotlib.pyplot as plt def custom_tile_image_plot( layout, images, labels=None, filename="", cmap="gray", label_size=16, label_color=None, figure_size=(8....
true
33d70bb5fab210d66fcc4b8f8a7601b4bd9b3d6b
rvh1/mra_blood_vessel_segmentation
/projections/ImageProjections.py
UTF-8
10,338
2.671875
3
[ "LicenseRef-scancode-other-permissive" ]
permissive
#----------------------------------- # Author: Rudiger von Hackewitz # Date: December 2018 # # Running the 2D image projections import numpy as np from utils.support import create_black_image import cv2 class MRAProjection(): def __init__(self, ThreeDImg): self._3d_img = ThreeDImg ...
true
d3f3237c98866e99aca923e493b41ed7f6b90e74
argus100-bit/tome
/argus eatery billing.py
UTF-8
18,295
2.828125
3
[]
no_license
from tkinter import * import random class Bill_App: def __init__(self, root): self.root = root self.root.geometry("1300x700+0+0") self.root.maxsize(width=1280, height=700) self.root.minsize(width=1280, height=700) self.root.title("Billing Software") # =...
true
3cc439482456d7cb1f6387953e618dfa62702427
alu-rwa-dsa/week-3---dynamic-array-bello_brenda_abideen_catherine_cohort2
/Question3.py
UTF-8
974
4.125
4
[]
no_license
from Akatsuki_array import Array from Question2 import DyArray class Third(DyArray, Array): def __init__(self, array): DyArray.__init__(self, array) Array.__init__(self, array) self.array = array def contains(self, val): exist = val in self.array return exist ...
true
3df4b5fd55a6ec610e95ea7cc46dd50d4c526b1d
mrtreasurer/irc
/test2.py
UTF-8
833
2.515625
3
[]
no_license
import socket import sys server = "irc.esper.net" channel = "#stencyl" botnick = "MrGutsy" irc = socket.socket(socket.AF_INET, socket.SOCK_STREAM) print("connecting to:"+server) irc.connect((server, 6667)) irc.send("USER "+ botnick +" "+ botnick +" "+ botnick +" :This is a fun bot!\n") irc.send("NICK "+ botnick +"\...
true
94bc850130e58569c41b2037c1f579a4ce99085c
nolanmclark/food-truck
/Backend/utilities/build/users.py
UTF-8
1,394
2.609375
3
[]
no_license
import sys from foodtruck.database import Session from foodtruck.model import Users, Trucks from pprint import pprint def build(): truck_ids = Session.query(Trucks.tid).all() if len(truck_ids) == 0: print('[ERROR] - There are no trucks.') sys.exit(1) users = [] users.append(Users('rjam...
true
69f2e240463542cf016f433d2270f21d55c27a47
RileyMShea/PyMongoStuff
/Spirelogs.py
UTF-8
1,179
2.546875
3
[]
no_license
import requests from bs4 import BeautifulSoup import pymongo myclient = pymongo.MongoClient("mongodb://localhost:27017/") mydb = myclient["mydatabase"] mycol = mydb["proxies"] mycol.drop() mycol = mydb["proxies"] r = requests.get('https://free-proxy-list.net/') soup = BeautifulSoup(r.text, 'lxml') rows = soup.fi...
true
bf21b8a2b74b61d9f447076af329f0883da59e90
recordbuffer/Coding_Test
/project_python/34.6 게임 캐릭터 클래스.py
UTF-8
382
3.46875
3
[]
no_license
class Annie: def __init__(self,health,mana,ability_power): self.health=health self.mana=mana self.ability_power=ability_power def tibbers(self): print('티버: 피해량 {0}'.format(self.ability_power*0.65+400)) health,mana,ability_power=map(float,input().split()) x=Annie(health=health...
true
740c55fdf8dd738c4031187cc51444b975ee8c4c
alebarbieri1/ocr-fiap
/python/ocr_engine/ocr_manually_labeled_example.py
UTF-8
4,023
2.671875
3
[]
no_license
import pytesseract import cv2 import numpy as np import os def example(): per = 25 limiteDePixel = 500 dados = [[(596, 218), (1206, 306), 'text', 'nomeLoja'], [(596, 308), (1158, 378), 'text', 'cnpj'], [(540, 908), (1386, 976), 'text', 'produto1'], [(1528, 978), (1742, ...
true
76fa8459bac9d6eba48acb4664e9a0e8733a29a1
koalaah/aiforgames
/Spike12/agent.py
UTF-8
978
3.15625
3
[]
no_license
from vector2d import Vector2D from graphics import egi from path import Path class Agent(object): def __init__(self): self.pos = Vector2D(10, 10) self.color = 'GREEN' self.path = Path() def update(self): self.follow_path() def render(self, color=None): # draw ...
true
272e9e0773ce12e70cabb58355b03693367e4a7d
asharkova/python_practice
/CodeAcademy/Reverse_String.py
UTF-8
404
3.828125
4
[]
no_license
# Write your reverse_string function here: def reverse_string(word): reverse_str = "" for i in range((len(word)-1), -1, -1): reverse_str += word[i] return reverse_str # Uncomment these function calls to test your function: print(reverse_string("Codecademy")) # should print ymedacedoC print(reverse_string("...
true
32c08d2a1994c2263599294099b6162b759ab683
miniyk2012/leetcode
/leetcode_projects/leetcode_02_05/main.py
UTF-8
850
3.03125
3
[]
no_license
from leetcode_projects.tree import ListNode class Solution: def addTwoNumbers(self, l1: ListNode, l2: ListNode) -> ListNode: left = l1 right = l2 head, cur = None, None next_val = 0 while True: if not (left or right or next_val != 0): break ...
true
f755e0a049cb4e8efccd0d7e579bc1e8bd737999
RegaipKURT/Machine-Learning-Python
/b-18.1-K_Means.py
UTF-8
1,427
3.609375
4
[]
no_license
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Thu Mar 15 04:18:20 2018 @author: regkr """ # 1. kutuphaneler import numpy as np import matplotlib.pyplot as plt import pandas as pd # 2. Veri Onisleme # 2.1. Veri Yukleme veriler = pd.read_csv('musteriler.csv') x = veriler.iloc[:,3:].valu...
true
108949229da43ca3d541bc12729461bd774515a7
OverlyDev/ACCD-Python
/Python II/classData/servercheck.py
UTF-8
729
3.15625
3
[]
no_license
"""Server Updates This program creates two sets from the contents of two files by nesting an open within a list function which is within a set function. While this level of nesting is not recommended, it's good to know it actually works. The servers set contains a master list of servers to be updated. The updates se...
true
a0b9b60cde099e6c33aca697b37f735f4900d23d
bmdavi3/euler
/euler17.py
UTF-8
841
3.5625
4
[]
no_license
words = { 1: 'one', 2: 'two', 3: 'three', 4: 'four', 5: 'five', 6: 'six', 7: 'seven', 8: 'eight', 9: 'nine', 10: 'ten', 11: 'eleven', 12: 'twelve', 13: 'thirteen', 15: 'fifteen', 18: 'eighteen', 20: 'twenty', 30: 'thirty', 40: 'forty', 50: 'fif...
true
ab4fa6d9498bb6829a0be3a77bd26301c888bcc9
wellysonmartins/algoritmos-uri-online-judge
/PYTHON/Iniciante/uri-1064-positivos-e-media.py
UTF-8
275
3.46875
3
[]
no_license
# -*- coding: utf-8 -*- qtd_positivo = 0 total = 0 for i in range(6): num = float(input()) if num > 0: qtd_positivo += 1 total += num media = total / qtd_positivo print("{} valores positivos".format(qtd_positivo)) print("{:.1f}".format(media))
true
41c903212a007921fd2dac9d542a35ea9aa5cd1e
DaveMcEwan/dmppl
/tests/test_prng.py
UTF-8
922
2.609375
3
[ "MIT" ]
permissive
from dmppl.prng import * import os import unittest class Test_Xoroshiro128plus(unittest.TestCase): # {{{ def test_Basic0(self): prng = Xoroshiro128plus() result = [] for i in range(100): r = prng.next() result.append("%d 0x%x %d" % (i, r, r)) for j in rang...
true
90f7e7bf68398d656fbe6dc03739b63cf4c9b2bb
jwilles/algo-data
/np-complete/week2/opt_tsp.py
UTF-8
1,860
3.140625
3
[]
no_license
from itertools import combinations from math import factorial def process_text(filename): f = open(filename, 'r').readlines() graph_info = int(f[0][:-1]) points = [map(float,line[:-1].split(" ")) for line in f[1:]] return graph_info, points def calc_euclid_distance(x, y): return ((x[0]-y[0])**2 + (x[1]...
true
6606efdc9b66dda247284e05abff54983f0222c2
littlelienpeanut/Leetcode_challenge
/Valid_Anagram.py
UTF-8
725
3.234375
3
[]
no_license
class Solution: def isAnagram(self, s, t): """ :type s: str :type t: str :rtype: bool """ if len(s) != len(t): return False else: dict_s = {} dict_t = {} if set(s) != set(t): return False ...
true
6e62e34583b2a9af5b04bbcd1750d11bd74a6363
lchristina26/CSCI477-2015
/Project3/NN.py
UTF-8
18,089
3.5625
4
[]
no_license
#!/usr/local/bin/python3 """ Author: Clint Cooper, Emily Rohrbough, Leah Thompson Date: 10/25/15 CSCI 447: Project 3 Code for a Generic Neural Network Structure that defaults to Backpropagation. getWeights() and setWeights() allow for this NN to work with other update functions. For more accurate results, run on ...
true
c837bce6bdf54e0d2d533ea33377abe1c38112b3
ahmedabukar-py/secure_rest_api
/secure_rest_api/app/main.py
UTF-8
2,940
3.03125
3
[]
no_license
from flask import Flask, make_response, request, render_template from random import random import datetime import jwt SECRET_KEY = "C7E2F9D46E92DCF2234D18BEF8C6D" flask_app = Flask(__name__) def verify_token(token): if token: decoded_token = jwt.decode(token, SECRET_KEY, "HS256") print(decoded_to...
true
b7183102791047e05955f7efc4fd1f487e0e5140
ohunayogege/djangoadmin
/test.py
UTF-8
225
2.609375
3
[]
no_license
import os import datetime from django.utils import timezone from datetime import timedelta dateandtime = "Aug. 25, 2020, 6:29 a.m." only_date = datetime.datetime.strptime(dateandtime, "%b. %d, %Y, %M %p.") print(only_date)
true
5509a8d50270632dd7ed985735ab20d3b52ba81d
EdinBegic/Pattern-recognition-using-neural-networks
/object_recognition.py
UTF-8
5,260
2.671875
3
[]
no_license
import numpy as np import argparse import imutils from imutils.video import VideoStream from imutils.video import FPS import cv2 def parsing_arguments(): ap = argparse.ArgumentParser() ap.add_argument("-i", "--image", required=True, help="path to input image") ap.add_argument("-p", "--prototxt", re...
true
33636e3c13096fe38530f1613acf3328ec93e47e
AnduinBrian/Root-me_Cracking
/Ptrace_DONE/solve_ch3.py
UTF-8
292
2.625
3
[]
no_license
s = list("ksuiealohgy") index = 0 password = "" # 1: eax + 4 index += 4 password += s[index] index = 0 # 2: eax + 5 index += 5 password += s[index] index = 0 # 3: eax + 1 index += 1 password += s[index] index = 0 # 4: eax + 0xA index += 0xA password += s[index] index = 0 print password
true
02915afbc8f99346ecf7f2c73b48e8abe5da414f
bnl-sdcc/griddev
/lcg-utils/adler32.py
UTF-8
2,063
2.96875
3
[]
no_license
#!/bin/env python2.4 # # import zlib import os, sys, logging, getopt def calcAdler32(filename,chunksize): log.debug("Initial checksum is %d" % zlib.adler32("")) checksum = zlib.adler32("") try: f = open(filename) except IOError: log.error("Problem opening %s" % filename) ...
true
c88f0cb4000a3971e62689197f8771bc695cabea
PrateekJain999/Python-Codes
/re3.py
UTF-8
441
3.078125
3
[]
no_license
# -*- coding: utf-8 -*- """ Created on Tue Feb 26 20:11:44 2019 @author: yogesh """ import re line = "hi This is yogesh mehra"; matchObj = re.match( r'mehra', line, re.M|re.I) if matchObj: print ("match --> matchObj.group() : ", matchObj.group()) else: print ("No match!!") searchObj = re.search( r'mehra', li...
true
23184c94c1ab47ce806bf037625f91eba37d8da1
balexander85/twitter-chronicler
/chronicler.py
UTF-8
4,659
2.859375
3
[]
no_license
"""chronicler.py Containing some helpful objects 1. List of users to follow 2. for each user watch for retweets that quote tweets 3. save screenshot of quoted tweet 4. save URL(s) from quoted tweet 5. Reply to tweet with image of quoted tweet with URL(s) and a disclaimer This Tweet is available! Note: I was tir...
true
fb7aaee342be368331df311df8ff2670702948a2
Eungoun/gmae202807
/game.py
UTF-8
465
4.46875
4
[]
no_license
print("~ 갤러그 게임 시작 ~") print("~~ 비행기 발견 ~~") print("~ 1.발사 2.오른쪽 이동 3.왼쪽 이동 ~") number = input("숫자를 입력하세요: ") print("당신의 입력값?", number) # 만약에 1번을 누르면 발사 if number == "1": print("발사") # 만약에 2번 누르면 오르쪽 이동 if number == "2": print("오른쪽 이동") # 만약에 3번 누르면 왼쪽 이동 if number == "3": print("왼쪽 이동")
true
f512233d78219ff2a39e536eaab267827d9ca694
Sockke/MyData
/Python/fundation/lambda.py
UTF-8
407
3.671875
4
[]
no_license
""" lambda表达式 lambda args : expression """ my_sum = lambda x, y : x + y print(my_sum(5, 10)) arr = [] arr.append({'name': 'sock', 'age': 21}) arr.append({'name': 'laoma', 'age': 22}) arr.append({'name': 'liuchen', 'age': 21}) arr.append({'name': 'xiaoqian', 'age': 20}) arr.sort(key=lambda e: e['a...
true
fcdef4fa15673593c53bf302b0cddf9eb9545a27
rajmohanram/PyLearn
/004-Functions/03_function.py
UTF-8
2,380
3.671875
4
[]
no_license
# functions: Positional argument import ipaddress from pprint import pprint # Input to functions - arguments - parameters within the brackets/paranthesis # - positional argument - required argument # func(ipaddr, pfx_len) - 2 arguments MUST be passed while calling this function # - keyword argument # ...
true
b28417e52c10a2e8889e4f32912803a999b549ff
mattling9/COMP4Coursework
/Implementation/Gui/tests/Finding Postcode Test.py
UTF-8
2,406
2.859375
3
[]
no_license
import sys from PyQt4.QtCore import * from PyQt4.QtGui import * class MainWindow(QMainWindow): def __init__(self): super().__init__() self.setWindowTitle("Adding Member Test") self.resize(400, 300) self.addMember() def addMember(self): ...
true
63d004f3ccab2d69ec8b97625bca33ce26418110
FarizGaharu/Assignment_ITP2017_TAsession
/Ticketing_System.py
UTF-8
3,958
3.34375
3
[]
no_license
import random class Booking: def __init__(self): pass def check_availability(self,**kwargs): booking_type = kwargs['booking_type'] booking_class =kwargs['booking_class'] if booking_type == "Railways": railways = kwargs ["railways"] if railways.Railways_Sea...
true
0ea53c1fb4d20ed3a2d3af5a93d45e731c94d9ee
LittleRandom/python_scripts
/organizeByDate.py
UTF-8
1,088
3.5625
4
[]
no_license
import os from pathlib import Path import time def organizeDirectory(): for item in os.scandir(): if item.is_dir(): continue filePath = Path(item) fileDateRaw = os.path.getmtime(filePath) fileDate = time.ctime(fileDateRaw) year = fileDate[20:24] ...
true
2a21b3cb9721585e4da5978f5ccb2097d21a6bde
allofphysicsgraph/proofofconcept
/v7_pickle_web_interface/flask/introspection/generate_csv.py
UTF-8
1,541
3
3
[ "CC-BY-4.0" ]
permissive
import json import sympy import re from latex_to_sympy import get_sympy_expr_from_AST_str with open('data.json') as json_file: dat = json.load(json_file) #with open('latex_and_expr.csv', 'w') as fil: #    for expr_id, expr_dict in dat['expressions'].items(): #        print(expr_id+", \"" + expr_dict['latex'] +"\"...
true
356245734469911fee42df49dc6e56106ddd1c38
ccf05017/algoTest
/BruteForce/GetMaxNumber/getMaxNumber.py
UTF-8
339
3.640625
4
[]
no_license
def max_product(left_cards, right_cards): max_list = [] for left in left_cards: for right in right_cards: max_list.append(left * right) return max(max_list) # 테스트 print(max_product([1, 6, 5], [4, 2, 3])) print(max_product([1, -9, 3, 4], [2, 8, 3, 1])) print(max_product([-1, -7, 3],...
true
8048db3bcc63a8f681284062944e56212a647a04
nevermoreMao/Gas_collision
/twodthermo.py
UTF-8
25,317
3.03125
3
[]
no_license
# -*- coding: utf-8 -*- """ Created on Thu Feb 1 21:00:41 2018 @author: MZS """ import numpy as np import random import matplotlib.pyplot as plt import matplotlib.animation as animation M_B_distribution_test=False #switch of Maxwell Boltzmann distribution test animate_2d=True #switch of animation of 2d s...
true
6b95fac7d2e3aee7fd41f28ce342c658b9757004
aarshpatel/NBA2K-Ratings-Prediction
/src/commons/utils.py
UTF-8
3,676
2.5625
3
[]
no_license
""" Implementation of the Utils file. This script contains all of the code that will be used in multiple scripts """ import numpy as np from sklearn.metrics import make_scorer, mean_squared_error, mean_absolute_error from sklearn.model_selection import cross_val_score from sklearn.model_selection import GridSearchCV ...
true
92f6ff0580f6795f8b09f35fd90c4084bbc96169
hz9xa/scripts
/plt_cp_scatter.py
UTF-8
622
2.578125
3
[]
no_license
import os,sys from pylab import * import numpy as np file = open("output.txt",'r') lines = file.readlines()[2:] data = np.array([]) for line in lines: data = np.append(data,np.fromstring(line,dtype=float,sep=' ')) reffile=open('ref.txt','r') lines = reffile.readlines()[2:] refdata = np.array([]) for line in lines...
true
68d54b6db157b1705753c3ae37d1e336715a836c
magodyfistery/python-project-2020A-Recommendation
/models/user.py
UTF-8
4,053
2.6875
3
[]
no_license
from models.serializable import Serializable class User(Serializable): def __init__(self, username, fullname, country_id, city_name, email, passwd, id=-1): self.username = username # varchar(30) self.fullname = fullname # varchar(255) self.country_id = country_id # int self.cit...
true
35c2dba833d0f3d832d79ab5d9af11ad8d8756bb
cheeordie1/Article-Filterer
/nlp/models/sif.py
UTF-8
7,971
2.75
3
[]
no_license
import numpy as np import nltk import re import pickle as pkl import sys from preprocess import preprocess from models.model import Model from sklearn.decomposition import PCA from sklearn.feature_extraction.text import CountVectorizer from collections import defaultdict from scipy import spatial class SIF(Model): ...
true
68d87824f0f98396e97ecc03509787c10ab048e4
RafaelHiguera/Python-Bot-For-Web-Games
/code.py
UTF-8
6,924
2.703125
3
[]
no_license
import time import PIL.ImageOps from Actions import * from numpy import * from quickGrab import * from MenuItems import * def startGame(): #for play setMousePos((323,208)) leftClick() time.sleep(.1) #for continuing setMousePos((350,390)) leftClick() time.sleep(.1) #for skipping the...
true
1eb0e260cb30a3df2524a13b044175e0568fcfa2
Hex4Bin/oi_1
/test_app.py
UTF-8
505
2.59375
3
[]
no_license
import unittest from unittest.mock import patch from app import TestAPI class TestApp(unittest.TestCase): """ The basic class that inherits unittest.TestCase """ api = TestAPI("GEOPLUGIN") @patch("app.TestAPI.get_ip", return_value="192.168.0.1") def test_get(self, input): """ ...
true
fdb183e63351e105294226faa352c21cacea0f52
gabriellaec/desoft-analise-exercicios
/backup/user_083/ch85_2020_05_06_16_44_46_336174.py
UTF-8
145
2.609375
3
[]
no_license
with open('macacos-me-mordam.txt') as arquivo: conteudo=arquivo.readlines() if 'banana' in conteudo: contador+=1 print(contador)
true
30fd9603115b4b3009676aad36b86c201cedc4d2
VatsaPatel/cmpe273-final
/temp.py
UTF-8
4,332
3.8125
4
[]
no_license
import hashlib from dataclasses import dataclass class Node(object): def __init__(self, val=None, left=None, right=None): # Hash value of the node via hashlib.sha256(xxxxxx.encode()).hexdigest() self.val = val # Left node self.left = left # Right node self.right = r...
true
aa378ab1c2fe27311fdb965225d1843e00207137
Sarose550/LineAlg
/draw.py
UTF-8
6,375
3.328125
3
[]
no_license
import math fout = open("pic.ppm","w") size = 500 fout.write("P3\n"+str(size)+" "+str(size)+"\n255\n") pixels = [] for i in range(size): pixels.append([]) for j in range(size): pixels[i].append([0,0,0]) def draw_line(x0, y0, x1, y1, screen, r, g, b): #print("Drawing line from (" + str(x...
true
485694b7d078eae29af5c81fe43e394b121ff039
KondakovY/Python
/Lesson4/Task1.py
UTF-8
776
3.734375
4
[]
no_license
""" 1. Реализовать скрипт, в котором должна быть предусмотрена функция расчета заработной платы сотрудника. В расчете необходимо использовать формулу: (выработка в часах * ставка в час) + премия. Для выполнения расчета для конкретных значений необходимо запускать скрипт с параметрами. """ from sys import argv def func(...
true
f024409f6e063a8dc0fea7a4701b1f67c5922e78
land-pack/landport
/example/cut_data.py
UTF-8
521
3
3
[]
no_license
a= [ { "uid":"123", "money":1200 }, { "uid":"234", "money":450 } ] def cut_data(lst, money_limit=500): new_lst = [] for i in lst: money = i.get("money") if money > money_limit: moneys = [money_limit for j in xrange(money/money_limit)] remainder = money % money_limit moneys.append(remainder)...
true
bb30560d4a54bd57c2ed0de778f4e9524d395d4b
wheels1991/PythonTutorial
/example/server.py
UTF-8
536
2.890625
3
[]
no_license
import socket host = '192.168.199.246' port = 31500 def Server(): sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) sock.bind((host, port)) sock.listen(1) while True: connection, address = sock.accept() print connection, address try: connection.settimeout(3) buf = connection.recv(1024) print ...
true
e3e0b0d123e05db68169313dfca91eccd7a1bf36
py555496/leetcode
/code/899_orderlyQueue.py
UTF-8
1,922
2.78125
3
[]
no_license
class Solution(object): def orderlyQueue(self, S, K): if K == 1: index = -1 min_n = 9999 for i in range(len(S)): if ord(S[i]) < min_n: min_n = ord(S[i]) index = i cand_index = [] min_n = chr(m...
true
577c804982233eb3d232e161c977d0dd996501cc
suhasreddy123/python_learning
/week/while loop.py
UTF-8
53
3.0625
3
[]
no_license
spam=0 while(spam<5): print(spam) spam=spam+1
true
21b665999519cde4ddf2ec213fd89c94dac705ac
ningfeiwang/crawler_tianyancha
/main.py
UTF-8
644
2.53125
3
[]
no_license
# -*-coding:utf-8-*- # import sys # reload(sys) # sys.setdefaultencoding('utf8') from bs4 import BeautifulSoup from selenium import webdriver import urllib.request import socket import time import search import name while True: driver = webdriver.PhantomJS(executable_path= r"C:\Users\Administr...
true
db446a13eeefa02edb0620a48925496711afc8db
zhu4ce4/gitpycharm
/快递跟踪查询.py
UTF-8
1,137
3.0625
3
[]
no_license
# -*- coding: utf-8 -*- ''' @time: 2018/8/9 21:58 @author: Jack Luo @file: 快递跟踪查询.py ''' import urllib.request import json def getExpress(company, code): '''funcation: Get Express Infomation 2 args company: the express company code code: the express bill code ''' url = 'http://www.kuaidi100.co...
true
f308693ec29179381b52a054466a2458ce260aaf
nojongmun/python_tensor
/day06_cnn/face_dection_03/mosaic.py
UTF-8
641
3.078125
3
[]
no_license
import cv2 import matplotlib.pyplot as plt def mosaic(img, rect, size): # 모자이크 적용할 부분 추출하기 (x1, y1, x2, y2) = rect w = x2 - x1 h = y2 - y1 i_rect =img[y1:y2, x1:x2] # 축소하고 확대하기 i_small = cv2.resize(i_rect, (size, size)) i_mos = cv2.resize(i_small, (w, h), interpolation=cv2.INTER_AREA) ...
true
b65d1e1c609d2928cecec184673a3c0275646b27
Mohammed-Sunasra/advanced_linear_regression
/q05_lasso/build.py
UTF-8
741
2.828125
3
[]
no_license
# Default imports from sklearn.linear_model import Lasso import pandas as pd import numpy as np from sklearn.metrics import mean_squared_error from greyatomlib.advanced_linear_regression.q01_load_data.build import load_data np.random.seed(9) # We have already loaded the data for you data_set, X_train, X_test, y_train,...
true
64777d851dcfb91a1ab2312f0c6c989b9d950e48
BechirMETTALI/ProjectsRep
/PythonMathProjects/TIMEformatting.py
UTF-8
979
3.1875
3
[]
no_license
# This is a Time formatting python function using only basic data structure operations and split method def format_duration(num): L=['0']*5 a='' b='' if num==0: return 'now' if num // 31536000 == 1: L[0]= str(num // 31536000)+' year' num = num % 31536000 if num > 31536000: L[0]= str(num // 31536000)+' ...
true
f44d305c99f9480e5c17c591c21045f473a351ee
geomeza/space-empires
/src/engines/movement_engine.py
UTF-8
3,837
2.859375
3
[]
no_license
class MovementEngine: def __init__(self, board, game): self.board = board self.game = game self.movement_info = {'1': [1, 1, 1, 2, 2, 2], '2': [ 1, 2, 2, 2, 2, 3], '3': [1, 2, 2, 2, 3, 3]} self.movement_phase = None def complete_movement_phase(self): if self...
true
7de0b517d2228a930df11827e0fd818c086ad4fd
zhaoyu775885/mynn
/naive/GradientDecent.py
UTF-8
3,147
2.765625
3
[]
no_license
# -*- coding: utf-8 -*- """ Created on Wed Aug 29 22:04:01 2018 @author: ZhaoYu """ import numpy as np def softmax(y): if y.ndim == 1: return np.exp(y)/ np.sum(np.exp(y)) if y.ndim == 2: z = np.zeros(y.shape) for row in range(y.shape[0]): z[row, :] = softmax(y...
true
acb0135573f61901da254b7a651ffedfb1358748
yffrankwang/scripts
/py/SvnCopyProps.py
UTF-8
3,379
2.859375
3
[ "Apache-2.0" ]
permissive
#!/usr/bin/python # -*- coding: UTF-8 -*- # # This script will copy all subversion properties from one source tree # to another identical source tree. # # Usage: SvnCopyProps SRC DST import getopt import os import re import subprocess import sys import tempfile class SvnCopyProps: def __init__(self): # ---------...
true
46970b34c8abd48ab719e1f5d0d290e88511db15
nveenverma1/Dataquest
/Practice/18_Calculus_for_Machine_Learning/Understanding Linear and Nonlinear Functions-157.py
UTF-8
832
4.40625
4
[]
no_license
## 1. Why Learn Calculus? ## import numpy as np import matplotlib.pyplot as plt x = np.linspace(0, 3, 100) y = -(x**2) + (3*x) - 1 plt.plot(x, y) plt.show() ## 4. Math Behind Slope ## def slope(x1,x2,y1,y2): ## Finish the function here return (y2-y1)/(x2-x1) slope_one = slope(0,4,1,13) slope_two = slope(5,-...
true
64ade1b40a1c7a4bf51f2cabcaf850f6bef8b28e
greenelab/biovectors
/biorxiv_experiment/04_merge_taggers.py
UTF-8
5,812
2.640625
3
[ "BSD-2-Clause-Patent" ]
permissive
# --- # jupyter: # jupytext: # formats: ipynb,py:light # text_representation: # extension: .py # format_name: light # format_version: '1.5' # jupytext_version: 1.9.1+dev # kernelspec: # display_name: Python [conda env:biovectors] # language: python # name: conda-env-biove...
true
39a85f93587b28623d55926b6a689d23cec760f0
Suvrojyoti/APS-2020
/Codeforces_Submissions/1332D.py
UTF-8
318
2.875
3
[]
no_license
n=int(input()) B=[0]*4 for i in range(4): B[i]=[0]*4 x=18 B[0][0] = (1 << x) - 1 for i in range(4): for j in range(4): B[i][j]=B[0][0] B[1][1] = (1<<(x-1))-1 B[2][0]= B[1][1]+1 B[1][2] =2* B[2][0] B[2][2]=n print(3,3) for i in range(3): for j in range(3): print(B[i][j],end=" ") print()
true
1343b9218096ea7ce9dd2fb821c3b4ef9abfe54b
bolioliagustin/holbertonschool-higher_level_programming1-
/0x04-python-more_data_structures/102-complex_delete.py
UTF-8
236
2.953125
3
[]
no_license
#!/usr/bin/python3 def complex_delete(a_dictionary, value): set_1 = [] for i, k in a_dictionary.items(): if k == value: set_1.append(i) for l in set_1: del a_dictionary[l] return a_dictionary
true
186fb487aaea309bf9df140fa32bc82464fa724e
GTBAE-dev/PythonBasics
/Chapter1. 자료형과 변수.py
UTF-8
1,289
5.0625
5
[]
no_license
''' 1-1. 숫자 자료형 ''' # 정수(음, 양), 실수(소수) 모두 출력 가능 print(10) print(-10) print(3.14) # 사칙연산 가능 print(10+10) print(10-10) print(10*10) print(10/10) ''' 1-2. 문자열 자료형 ''' # 문자열은 작은 따옴표 또는 큰 따옴표로 감싸줘야함 print('Hello World') print("Hello World") # 문자열 곱셈 가능(이외의 사직연산은 불가) print("Hello World"*3) ''' 1-3. Boolean 자료형 ''' # True /...
true
db3985f9872983c962518d7af1d377291c224764
pkc-3/python
/exam1/ex1_2.py
UTF-8
129
3.734375
4
[]
no_license
sum = 0 for k in range(1,11): if k % 2 == 0 or k % 3 == 0: sum += k print('2와 3 배수의 정수의 합 :', sum)
true
cc5097c0e577eafeef9ddc5b4dfd735ab387bc59
lz91715/theano-demo
/In_example.py
UTF-8
606
3.25
3
[]
no_license
import numpy as np import theano.tensor as T from theano import function from theano import In # activation function example x = T.dmatrix('x') s = 1/(1+T.exp(-x)) logistic = function([x], s) print logistic([[0,1],[-2,-3]]) # multiply outputs for a function a,b = T.dmatrices('a','b') diff = a - b abs_diff = abs(diff...
true
2ce0400ada3629333e6f2e3da1655c918e4c17e9
terryjbates/python3-oo-programming
/qpb/chs11-15_code/script4b.py
UTF-8
247
2.515625
3
[]
no_license
#! /usr/bin/env python3.1 import fileinput, glob, sys, os def main(): if os.name == 'nt': sys.argv[1:] = glob.glob(sys.argv[1]) for line in fileinput.input(): if line[:2] != '##': print(line, end="") main()
true
64896517eff9efc75450f78d53a458b724a7fc51
Jose0Cicero1Ribeiro0Junior/Curso_em_Videos
/Python_3/Modulo 1/2-Tratando_dados_e_fazendo_contas/Exercício_004--Dissecando_uma_Váriavel_v0.py
UTF-8
812
4.125
4
[ "MIT" ]
permissive
#Faça um programa que leia algo pelo teclado e mostre na tela o seu tipo primitivo e todas as informações possiveis sobre ela. n = str(input('Digite: ')) print() is_is = [n.isalnum(),n.isalpha(),n.isascii(),n.isdecimal(),n.isdigit(),n.isidentifier(),n.islower(),n.isnumeric(),n.isprintable(),n.isspace(),n.istitle(),n.is...
true
e8b3b614a3f6a81f78c6fc8df3ac0fd81595d43b
jdgwartney/pulse-api-python
/tspapi/measurement.py
UTF-8
4,033
2.546875
3
[ "Apache-2.0" ]
permissive
# Copyright 2016 BMC Software, 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 or agreed to in w...
true
d38010762312f4bc1ba0f85927d100f5619ddf5a
FonziePants/adventofcode
/solutions/day09/day09.py
UTF-8
2,939
3.78125
4
[ "MIT" ]
permissive
# --- Day 9: Encoding Error --- def read_num_array(file_path): file = open(file_path, "r") num_array = [] for line in file: if not line.rstrip(): continue num_array.append(int(line.rstrip())) file.close() return num_array def find_first_invalid_number(full_num_a...
true
664f6c50b7d9a935bd702e66dee708db2619150e
TauDan/2dpolim-analysis
/fitting.py
UTF-8
12,247
2.671875
3
[]
no_license
import numpy as np # def err_portrait_single_funnel_symmetric( params, ex_angles, em_angles, Ftot,\ # mod_depth_excitation, phase_excitation,\ # which_error='chi2' ): # Fem = fit_portrait_single_funnel_symmetric( params, ...
true
79075764fa45ba29a024e79aa137eba7392417ac
Lavanya-C/Python-Play
/hang.py
UTF-8
1,202
3.71875
4
[]
no_license
import random lstNames = ['COMPUETR','KEYBOARD','PRINTER','SCANNER','MOUSE','LABORATORY','DATA','JOYSTICK','TRACKPAD','WEBCAM','LIGHTPEN','MONITOR','PROJECTOR','PROCESSOR'] name = random.choice(lstNames) strlen = len(name) print('HANGMAN') print('You require to trace a Word related to COMPUTER by guessing ch...
true
6965d1348762b8e50190093ab6c75a74253da929
paramire/ACMonitor
/ACM-script/acmmodules/ACMmqtt.py
UTF-8
7,482
2.734375
3
[]
no_license
import mosquitto class acmMQTT(object): """acmMQTT object to manage MQTT ACM connection The object manage the MQTT connection and the message to be sended, the message and the topic of each message posible This Module manage how to send the message and the structure of the messages, and the MQTT connection to...
true
4498f8dc2067b4454a21d0eb6e74236a84d8445a
gl-coding/EasyAmis
/server_file.py
UTF-8
1,716
2.515625
3
[]
no_license
#!/usr/bin/env python #coding:utf-8 import tornado.ioloop import tornado.web #导入tornado模块下的web文件 class dluHandler(tornado.web.RequestHandler): def get(self): self.render("dlu.html") def post(self): file_metas = self.request.files["fafafa"] ...
true
c1f6a6c857798011a9197b577f8df28d3cee180e
hy-kiera/CoDrone-daechul
/src/codrone_move/scripts/CoDrone/system.py
UTF-8
6,917
2.578125
3
[]
no_license
from enum import Enum class Flight: def __init__(self, roll, pitch, yaw, throttle): self.ROLL = roll self.PITCH = pitch self.YAW = yaw self.THROTTLE = throttle class Position: def __init__(self, x, y): self.X = x self.Y = y class Angle: def __init__(self...
true
4ceb96249998a5debf8e7dc13f4292a2c540be3b
zjjhit111/PyTorchLearning
/src/samples/textclass/train.py
UTF-8
2,778
2.734375
3
[]
no_license
# -*- coding: utf-8 -*-# # ------------------------------------------------------------------------------- # Name: train # Description: # Author: lenovo # Date: 2020/5/11 # ------------------------------------------------------------------------------- import sys, os import time from textclass...
true
9a3c1d33c18b03d4302b9f711883fe59eb72d0aa
wellandbb/A-level-Project-Game
/projectiles.py
UTF-8
1,171
3.109375
3
[]
no_license
import pygame, math pygame.init() # bullet class class projectile(pygame.sprite.Sprite): def __init__(self,x,y,height, width, facing, XorY, velocityX, velocityY): super().__init__() self.rect = pygame.Rect(x,y,width,height) self.velX = velocityX self.velY = velocityY self.Xo...
true
ee5a8c8fc88e883aea20ebc7df4822e28b4f5ee1
jchancafe/demo12
/odoo_apps/amazon_vendor_central_ept/model/amazon_edi_interface.py
UTF-8
4,312
2.53125
3
[]
no_license
from odoo import models,fields,api,_ from odoo.osv import expression,osv from odoo.exceptions import Warning from ftplib import FTP from tempfile import NamedTemporaryFile import time import paramiko class AmazonEDIInterface(object): """ A class to represent an FTP connection to the Amazon EDI FTP location. T...
true
512d1e2bc93266cb29b2ed41b9daac96d2052710
tleparmentier/rap_lyrics_generation
/create_structure_de_phrase_df.py
UTF-8
1,067
2.90625
3
[]
no_license
import pandas as pd import sys if __name__ == "__main__": if len(sys.argv) != 2: print('Erreur : Arguments invalides : ') print('\t python create_structure_de_phrase_df.py rappeur.txt') sys.exit(1) file_name_txt = sys.argv[1] file_name = file_name_txt.split('.txt')[0] path_to_...
true
e258310f14f277ba9f815b8c82ae68c3f0670120
jpnewman/jpnewman_ansible_elk
/files/test_app/gerrit/gerrit.py
UTF-8
1,376
2.578125
3
[ "MIT", "BSD-3-Clause" ]
permissive
import random from .project import Project from .review import Review from .patchset_created import PatchsetCreated from .comment_added import CommentAdded from .change_merged import ChangeMerged class Gerrit(object): def __init__(self): self.projects = [Project() for _ in range(100)] self.revie...
true
f79dbcd9817f698cf0cdf26bfd1c849994201b20
smartinsert/CodingProblem
/amazon/min_and_max_of_every_k_size.py
UTF-8
641
3.875
4
[]
no_license
""" Given an array A and an integer K. Find the maximum for each and every contiguous subarray of size K. """ import math def find_max(arr): max_here = -math.inf for i in arr: max_here = max(max_here, i) return max_here def min_max(arr, k): if len(arr) < k: return [] window_star...
true
8801dcd936cfeaf027dd094945c4be18d7830bac
rui725/rui-portf
/practices/python/p4.py
UTF-8
618
3.09375
3
[]
no_license
import re email = raw_input() if(re.search('^[a-zA-Z][a-zA-Z0-9\_]*\@[a-zA-Z]+[a-zA-Z0-9]*\.com',email)): print 'Valid Email Address' else: print 'Invalid Email Address' if not email[0].isalpha(): print 'email address always starts with a letter' print 'sugguest using a'+email elif '@' not in email: print 'm...
true