blob_id
large_string
language
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
28fa8cae1e39309d07173657d7c0bcbccc125cd2
Python
alisson-fs/POO-II
/Lista de exercicios 1/Q6.py
UTF-8
1,622
3.953125
4
[]
no_license
#Aluno: Alisson Fabra da Silva Matricula: 19200409 '''Neste exercício criei apenas a classe baralho que recebe uma lista de cartas, para que possa ser utilizado para qualquer tipo de baralho. Criei um metodo para distribuir as cartas e outro para mostrar a carta de cada jogador.''' from random import randin...
true
63ca5d9e9eee13486456639b77f0c0c95a86d6a7
Python
dingdian110/alpha-ml
/alphaml/datasets/cls_dataset/mushroom.py
UTF-8
337
2.6875
3
[ "BSD-3-Clause" ]
permissive
import pandas as pd def load_mushroom(data_folder): file_path = data_folder + 'dataset_24_mushroom.csv' data = pd.read_csv(file_path, delimiter=',').values return data[:, 1:], data[:, 0] if __name__ == '__main__': x, y = load_mushroom('/home/thomas/PycharmProjects/alpha-ml/data/cls_data/mushroom/') ...
true
95f1d6bc9e121484487a245c1c47237f1593f658
Python
DmitryChitalov/Interview
/lesson_2/task_3.py
UTF-8
883
3.78125
4
[]
no_license
# 3. Усовершенствовать родительский класс таким образом, чтобы получить доступ к защищенным переменным. # Результат выполнения заданий 1 и 2 должен быть идентичным. data = dict(name='Bred', price=42) class ItemDiscount: def __init__(self, name, price): self.__name = name self.__price = price ...
true
64f512827d311b6fa54f98f9c5aca4161d843984
Python
a01633908/m-todosn
/vowel.py
UTF-8
133
3.65625
4
[]
no_license
def count_vowels(txt): vowels = ['a','e','i','o','u'] v = 0 for p in txt: if p in vowels: v += 1 return v
true
027bd9447a7b8ad66065475cc9916ceba37da3cc
Python
Nooralwachi/runtime
/runtime.py
UTF-8
885
2.59375
3
[]
no_license
from datetime import datetime, timedelta def runtime(filename): process ={} with open(filename) as file: file.readline() for line in file: result = [] time,date, pid, status = line.split() process_time = datetime.strptime(time+ ' '+date, '%H:%M:%S %m/%d/%Y') #print(process_time, pid, status) if s...
true
098e10680eacbe906cb1c83770f452aa847d29f5
Python
Corona-/Tower-of-dragon
/shop_window.py
UTF-8
23,316
2.640625
3
[]
no_license
#!/usr/bin/env python # -*- coding: utf-8 -*- import pygame from pygame.locals import * import window import system_notify import character_view import item import shop TITLE, CITY, BAR, INN, SHOP, TEMPLE, CASTLE, TOWER, STATUS_CHECK, GAMEOVER = (0, 1, 2, 3, 4, 5, 6, 7, 8, 9) CHARACTER_MAKE = 10 NO_EXT...
true
6f12b3563910501a611476d4325cf7373e9c91d2
Python
DylanDelucenauag/cspp10
/unit3/ddelucena_numguess.py
UTF-8
650
4.0625
4
[]
no_license
import random comp_number = random.randint(1,100) player_guess = int(input("Guess a number from 1 to 100: ")) while (player_guess != comp_number): if player_guess > comp_number: print ("Too high!") print ("Try again") player_guess = int(input("Guess again: ")) elif player_guess...
true
23cceda111798bbc64df18a91c91f9ba6ed0fce7
Python
TakahiroSono/atcoder
/contest/ABC171/python/A.py
UTF-8
85
2.90625
3
[]
no_license
upper = "QWERTYUIOPASDFGHJKLZXCVBNM" A = input() print('A' if A in upper else 'a')
true
64ded8624318d508b1dce3d36b242797591d1ed8
Python
wanghan79/2019_Python_Tech
/2016010484-张旻政/2016010484-张旻政-第二次作业/第二次作业类运算运行.py
UTF-8
341
3
3
[]
no_license
from Statistic import Statistic # 导入Statistic类 a = Statistic('students.txt') sum = a.statistic_sum() # 求和 print('the sum is ', sum) ava = a.statistic_average() # 求平均值 print('the average is ', ava...
true
cc511f623c747a3834728de4e462309560657ddd
Python
parekh0711/library-system
/main.py
UTF-8
2,643
2.828125
3
[]
no_license
from tables import * from insert import * from create import * import sqlite3 from sqlite3 import Error import pandas as pd def create_connection(db_file): conn = None try: conn = sqlite3.connect(db_file) return conn except Error as e: print(e) return conn def execute_instruct...
true
aac9e85746021583216a85846531980835ac75e4
Python
ArturoBarrios/MusicClassification
/PredictorScripts/CustomFeatureSet.py
UTF-8
28,646
2.78125
3
[]
no_license
from music21 import * from collections import Counter import re from collections import OrderedDict class CustomFeatures: def __init__(self): print(self," doesn't have any arguments") # def maxDensity(self,score): #advanced rhythmic similarity #how similar is each measure in comparison to...
true
2fd69435ee7e7989c09685df961880aa65bc9c4f
Python
AnnanShu/LeetCode
/231-280_py/269-AlienDictionary.py
UTF-8
1,474
3.21875
3
[]
no_license
from collections import deque from functools import reduce class Solution: def alienOrder(self, words: str): indegree = [0] * 26 neibour = [[] for _ in range(26)] m = len(words) for row in range(m-1): if len(words[row]) > len(words[row+1]) and words[row][:len(word...
true
f98f9876241baf48a432e2d9e2d63013d468b214
Python
GIS-PuppetMaster/DQN-QuantTrade
/ActorNetwork.py
UTF-8
4,250
2.5625
3
[]
no_license
import numpy as np from keras.callbacks import * import tensorflow as tf import keras.backend as K from keras.models import Model from keras.layers import Dense, Flatten, Conv1D, Input, Concatenate, BatchNormalization, Activation from keras.utils import plot_model import glo from math import * class ActorNetwork(obje...
true
1c1b6aaf45e616cb2f1468814df5c39a1df2a05a
Python
jonatanwestholm/garageofcode
/garageofcode/other/kmp.py
UTF-8
480
3.34375
3
[ "MIT" ]
permissive
def make_table(W): N = len(W) T = [0]*N T[0] = -1 i = 1 candidate = 0 while i < N: print(i, candidate) if W[i] == W[candidate]: T[i] = T[candidate] else: T[i] = candidate while candidate >= 0 and W[i] != W[candidate]: c...
true
116fff7723b2173b2523d68349cddf14d260693e
Python
HazardDede/machine-learning
/ml/repository/datasets/__init__.py
UTF-8
2,413
2.90625
3
[ "MIT" ]
permissive
"""Provides convenience stuff to fetch datasets for training / experimenting.""" import os from typing import Any, List, Optional from ml.repository import Sets from ml.repository.datasets.catalog import Catalog from ml.repository.datasets.loader import BBCNews, Iris, CatsVsDogs from ml.utils import LogMixin class ...
true
c86072ac929087cedf951a27086daf9ff8eab161
Python
habahnow/332L
/Ghost.py
UTF-8
2,375
3.296875
3
[]
no_license
import os import pygame from spritesheet_functions import SpriteSheet import sys debugging = False class Ghost(pygame.sprite.Sprite): __gravity = 1 __movement_frames = [] __current_frame_reference = 0 __movement_counter = 0 __movement_counter_boundary = 2 __movement_speed = 24 ...
true
381e52cf73d6660778304cd3b9fc9db55af8f793
Python
sciapp/sampledb
/tests/logic/test_units.py
UTF-8
856
2.890625
3
[ "MIT" ]
permissive
# coding: utf-8 """ """ import sampledb.logic def test_unit_registry(): meter = sampledb.logic.units.ureg.Unit("m") inch = sampledb.logic.units.ureg.Unit("in") assert meter.dimensionality == inch.dimensionality def test_custom_units(): sccm = sampledb.logic.units.ureg.Unit("sccm") cubic_centim...
true
8fbd79b8ff3b60133bf09e17d2267cf34e0e4f2c
Python
khotiashova7/-
/solution.py
UTF-8
1,240
2.640625
3
[]
no_license
import sys from PyQt5 import uic # Импортируем uic from PyQt5.QtWidgets import QApplication, QMainWindow import sqlite3 class MyWidget(QMainWindow): def __init__(self): super().__init__() uic.loadUi('solution.ui', self) self.connection = sqlite3.connect('solution.db') ...
true
604febde80e37c3d2b2f8e700973b850522a24bb
Python
KellyJason/Python-Tkinter-example.
/Tkinter_Walkthrough_3.py
UTF-8
1,394
3.859375
4
[]
no_license
import os import tkinter as tk #begining of the window root= tk.Tk() #this creates an area for the labes and button to go in canvas1 = tk.Canvas(root, width = 350, height = 400, bg = 'lightsteelblue2', relief = 'raised') canvas1.pack() # this is the label label1 = tk.Label(root, text='Hello Kelly Girls,''...
true
55c43e1e11ea08da7f4d1fe4213d4a017afc4b3d
Python
sri85/coderbyte
/wordCount.py
UTF-8
73
2.640625
3
[]
no_license
def Wordcount(str): print len(str.split()) Wordcount("one 22 three")
true
1671ba0767798e29bff9d96a576ca3a58913388d
Python
kajetant/adventofcode2018
/AOC06/app06.py
UTF-8
2,473
3.265625
3
[]
no_license
import re from itertools import count, groupby, product from functools import reduce from datetime import datetime import operator from typing import List class Point: def __init__(self, x: int, y: int): self.x = x self.y = y def dist(a: Point, b: Point): return abs(a.x - b.x) + abs(a.y - b....
true
1616eb367541152f7b95e8d935ba296a81ed88cc
Python
kharithomas/GuessingGame
/guess_game.py
UTF-8
570
4.8125
5
[]
no_license
# Implement a guessing game in python import random class Game: def guess(self): max_num = int(input('Set a max: ')) random_number = random.randint(1, max_num) guess = 0 # loop while guess != random_number: guess = int(input(f'Guess a number between 1 and {max...
true
926ba8b0c406580cb8e3796786a6371eeda34e39
Python
dalelyunas/MusicAggr
/LastFm.py
UTF-8
2,376
2.5625
3
[]
no_license
import pylast import time import SpotifyHandler import json import os # API information for last.fm API_KEY = os.getenv("LAST_FM_API_KEY") API_SECRET = os.getenv("LAST_FM_API_SECRET") # Seconds in a week WEEK_SECONDS = 604800 cur_time = time.time() # Authentication for the user username = os.getenv("USERNAME") passw...
true
4addf1c249a93fb19878c41f451b5ced6c5045cf
Python
gen0083/atcoder_python
/python/src/abc151/b_achieve_the_goal.py
UTF-8
402
2.6875
3
[]
no_license
# https://atcoder.jp/contests/abc151/tasks/abc151_b def main(): n, k, m = map(int, input().split(" ")) total = 0 for i in input().split(" "): point = int(i) total += point target = m * n remain = target - total if remain <= 0: print("0") elif remain <= k: pr...
true
17dcfe4c9262ae3eb81f9edc83b884579ab73309
Python
meharbhatia/MIDAS_KG_Construction
/working_code/rest_code/t3.py
UTF-8
10,511
2.9375
3
[]
no_license
# -*- coding: utf-8 -*- import unicodedata import nltk import re from nltk.tokenize import word_tokenize from nltk.tag import pos_tag from nltk import sent_tokenize import csv ex = 'BYD debuted its E-SEED GT concept car and Song Pro SUV alongside its all-new e-series models at the Shanghai International Automobile Ind...
true
ac8a7cea7b483445a7eeacf55879268da0dc2f6f
Python
YuxiG-ba/codingworks
/NLP URL.py
UTF-8
3,349
2.71875
3
[]
no_license
#!/usr/bin/env python # coding: utf-8 # In[17]: import pandas as pd import matplotlib.pyplot as plt import pandas as pd import seaborn as sns import statsmodels.formula.api as smf #import urllib2 df = pd.read_csv('https://raw.githubusercontent.com/resbaz/r-novice-gapminder-files/master/data/gapminder-FiveYearData.cs...
true
956202b9d2d42d33a20d1a4891f3d1770e1b7164
Python
Santiago-Gallego/holbertonschool-higher_level_programming
/0x07-python-test_driven_development/2-matrix_divided.py
UTF-8
1,468
3.671875
4
[]
no_license
#!/usr/bin/python3 """matrix_divided module""" def matrix_divided(matrix, div): """divides all elements of a matrix""" def check_samesize_lists_in_matrix(matrix): """checks if lists in matrix are same size""" size = len(matrix[0]) for i in range(1, len(matrix)): if len(mat...
true
1f64736c1c783a560cbe176342c627a0599ed0ce
Python
phantax/microtags
/plotting.py
UTF-8
5,559
2.515625
3
[]
no_license
#!/usr/bin/python3 import sys import base64 import binascii import microtags import matplotlib import math import numpy as np from scipy import optimize # # _____________________________________________________________________________ # def main(argv): import matplotlib.pyplot as plot globals()['plot'] = pl...
true
eb5f96040b28117c9eb9ba2de75148ae7612f202
Python
RiceeeChang/PythonPractice
/newTest.py
UTF-8
137
3.28125
3
[]
no_license
class Some: def __init__(self, number): self.number = number def printSome(self): print(self.number+5) s = Some(10) s.printSome()
true
19b8f0b2cfa88ca64a75f9cffd0d2d90ea9a116c
Python
dxl2016/Leetcode-Contest
/Weekly Contest 183/1404. Number of Steps to Reduce a Number in Binary Representation to One.py
UTF-8
296
3.09375
3
[]
no_license
class Solution: def numSteps(self, s: str) -> int: s_int = int(s, 2) ans = 0 while(s_int != 1): if s_int%2 == 1: s_int += 1 ans += 1 else: s_int //= 2 ans += 1 return ans
true
a5f6f88eec1d9fd4156205eeb5716c03d16114a9
Python
heidonomm/mhopRL
/DQNAnalyser.py
UTF-8
5,813
2.53125
3
[]
no_license
import json from collections import defaultdict import nltk import torch from utils import words_to_ids from dqn import DQNTrainer class DQNAnalyser(DQNTrainer): def __init__(self): super().__init__() self.model.load_state_dict(torch.load('constrained_verb_only.pt')) self.action_predic...
true
8c173b57c9754f022876a283c8cd8549530469b0
Python
m-L-0/17b-Wangshuyun-2015
/FashionMNIST Challenge/code/cnn.py
UTF-8
4,987
2.625
3
[ "MIT" ]
permissive
import tensorflow as tf from tensorflow.examples.tutorials.mnist import input_data import numpy as np #训练集数据的引入 reader = tf.TFRecordReader() filename_queue = tf.train.string_input_producer(["/home/srhyme/ML project/DS/train.tfrecords"]) _, example = reader.read(filename_queue) features = tf.parse_single_example( ...
true
fbf4e28a040a9615e2ea31e13f7d5d9221307483
Python
sachinyar/Python_Machine-Learning_Codes
/sna/word.py
UTF-8
306
2.9375
3
[]
no_license
fp=open("title.txt",'r') fp1=open("word_freqYEAR.csv",'w') fp1.write("Word, Year\n") while True: line=fp.readline() if not line: break tk=line.split('@') tk1=tk[0].split(' ') for i in range(0,len(tk1)-1): fp1.write(str(tk1[i])+","+str(tk[1])+"\n") fp.close() fp1.close()
true
c70a37d563376b65682b2ac5750702012b16ca3e
Python
tobarg/python
/outbrain.py
UTF-8
1,051
3.234375
3
[]
no_license
outbrain = open('ob2015.txt') keywords = list() counts = dict() for line in outbrain: line = line.rstrip() line = line.split() for word in line: word = word.lower() #replace characters word = word.replace('-',' ').replace('"','').replace(":",'').replace('?','').replace(',','') ...
true
9bfe27e1f2e2d1085c5f381d80ff81a490284882
Python
x10-utils/nlpaug
/nlpaug/augmenter/word/word_embs.py
UTF-8
6,834
2.609375
3
[ "MIT" ]
permissive
""" Augmenter that apply operation to textual input based on word embeddings. """ from nlpaug.augmenter.word import WordAugmenter from nlpaug.util import Action import nlpaug.model.word_embs as nmw from nlpaug.util.exception.warning import WarningMessage WORD2VEC_MODEL = None GLOVE_MODEL = {} FASTTEXT_MODEL = {}...
true
f42cd7d8e8d96a6a1fa930161f443b3e3504fd2a
Python
lowks/python-prompt-toolkit
/prompt_toolkit/code.py
UTF-8
3,672
3.109375
3
[ "BSD-3-Clause" ]
permissive
""" The `Code` object is responsible for parsing a document, received from the `Line` class. It's usually tokenized, using a Pygments lexer. """ from __future__ import unicode_literals from pygments.token import Token __all__ = ( 'Code', 'CodeBase', 'Completion' 'ValidationError', ) class Completion(...
true
9e069b61a4f9ac34ceccec8920882762e0b6776a
Python
tartarica/Mephisto
/src/scripts/mephisto-clicker.py
UTF-8
1,517
2.90625
3
[]
no_license
from random import random import pyautogui import argparse from flask import Flask, request app = Flask(__name__) parser = argparse.ArgumentParser(description='A simple backend to perform simulated clicks for the Mephisto chrome extension.') parser.add_argument('--port', '-p', dest='port', action='store', default=808...
true
12d9bed08cfd2f284a1899cf671256f7a5fcb8de
Python
Dranoxgithub/covid-webscraping
/Colorado/scripts/douglas.py
UTF-8
1,728
2.875
3
[]
no_license
#!/usr/bin/env python # coding: utf-8 # In[114]: import urllib.request from urllib.request import Request, urlopen import re from bs4 import BeautifulSoup as soup url = 'https://www.douglas.co.us/douglascovid19/' req = Request(url , headers={'User-Agent': 'Mozilla/5.0'}) webpage = urlopen(req).read() page_soup = so...
true
feae72433ddb7d7e310d4b308941ddeb7af8efb8
Python
lakshmanboddoju/Deep_Learning_Prerequisites_The_Numpy_Stack_in_Python
/3/19-values_vs_as_matrix.py
UTF-8
146
3.203125
3
[]
no_license
#! python3 import pandas as pd import numpy as np df = pd.DataFrame([[1, 2], [3, 4]]) print(df) print(df.as_matrix()) print(df.values)
true
227fee901daede38870669fb9801f5e39daf84f0
Python
diversen/project-euler
/54.py
UTF-8
4,414
3.421875
3
[]
no_license
""" Python solution to project euler problem 54 """ class Poker(object): def read_file (self, file_name = None): file_name = 'resources/p054_poker.txt' f = open(file_name) fc = f.read() return fc def convert_hand(self, hand): """ convert T to A from 10 to 14. Convert t...
true
77e7b890d247f74cc76c17cc9c70e9c151c32ac9
Python
pronobility/Laci
/guiablak.py
UTF-8
201
2.640625
3
[]
no_license
from tkinter import * abl1 = Tk() tex1 = Label(abl1, text='Jó napot kívánok!', fg='red') tex1.pack() gomb1 = Button(abl1, text='Kilép', command = abl1.destroy) gomb1.pack() abl1.mainloop()
true
c79836c5bed2ac7049cba677cbf9d86a8d2a3f2b
Python
russelldmatt/brain-teasers
/brain-teasers/reverse-birthday-problem/solve.py
UTF-8
638
3.40625
3
[]
no_license
import math from memoize import memoize @memoize def factorial(n): return math.factorial(n) @memoize def choose(n, k): return factorial(n)/factorial(k)/factorial(n-k) @memoize def f(n, k): return k**n - sum([choose(k,i) * f(n, i) for i in xrange(1, k)]) def enough(N): return f(N, 365) > 365**N / 2 def ...
true
9e6534888e7ced5ca4b8c6f51d00551f30e0efb7
Python
aparecida-gui/learning-python
/exercicios/multiplicao.py
UTF-8
479
4.375
4
[ "MIT" ]
permissive
""" Você recebe um integer positivo. Sua função deve calcular o produto dos digitos excluindo qualquer Zeros. Por exemplo: O numero dado é 123405. O resultado será 1*2*3*4*5=120 (Não esquece de excluir os Zeros). """ def checkio(number: int) -> int: produtoDaMultiplicacao = 1 number = str(number) for t i...
true
7dff54c2fa8d6417d1b479db60142a8da80a725b
Python
Win-Htet-Aung/kattis-solutions
/datum.py
UTF-8
226
3.59375
4
[ "MIT" ]
permissive
import calendar weekdays = ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday'] s = input() d = int(s.split()[0]) m = int(s.split()[1]) y = 2009 wd = calendar.weekday(y, m, d) print(weekdays[wd])
true
a4cb01b106d8a8d01c9799cf46ff63b98dfb772d
Python
shshivam/SFWRTECH3RQ3_Project_Tests
/tests/test_accountregistration.py
UTF-8
5,051
2.515625
3
[]
no_license
import datetime from dinnerisserved.account import Account from dinnerisserved.address import Address from dinnerisserved.discountcoupon import DiscountCoupon from dinnerisserved.history import History from dinnerisserved.order import Order from dinnerisserved.paymentinfo import PaymentInfo from dinnerisserved.profile...
true
4323543aedc17123538b0e5f190ab219fea8866d
Python
Zacros7164/Algorithm-Friday
/11:16:18/is-prime.py
UTF-8
1,196
3.578125
4
[]
no_license
# in this universe, 2 and 3 are ALWAY prime known_primes = [2,3] finalPrime = 2 # a function that will find if a number is prime def is_prime(n): # print n total_known_primes = len(known_primes) for i in xrange(0, total_known_primes): if(n % known_primes[i] == 0): # THIS IS DIVISIBLE BY ...
true
42d80a74006cb9cd3289f5b324f2c323b8758231
Python
Kito-vini/curso-python
/Meus projetos/YouTube_Downloader/YT_Downloader.py
UTF-8
1,966
3.234375
3
[]
no_license
from pytube import YouTube import PySimpleGUI as sg # Criando as janelas e layouts def janelaInicial(): sg.theme('reddit') layout = [ [sg.Text('Bem vindo ao YouTube Downloader'), sg.Text(' '), sg.Text('By Kito-Vini')], [sg.Text('Digite o link do vídeo: '), sg.Input(key='url1')], ...
true
da608053da2917b6e3dfe5ce04b4ffa890c8440d
Python
roei-birger/Ex3
/src/DiGraph.py
UTF-8
5,017
3.40625
3
[]
no_license
from GraphInterface import GraphInterface from NodeData import NodeData class DiGraph(GraphInterface): """This class implements a directed weighted graph. Every graph contains a map of all its vertexes, a counter of the number of the vertex in the graph, a counter of the number of edges an...
true
e8e16702da3a76d91cdd29586b7b4d117721b856
Python
BillMaZengou/nature_of_code
/0_Introduction/03_gaussian_distribution/visual_gaussian_distribution.py
UTF-8
710
3.21875
3
[]
no_license
import numpy as np from turtle import * home() std = 100 initial_colour = (0.98, 0.98, 0.98) number_occur = [] while True: h = np.random.randn() h *= std if h not in number_occur: color_factor = number_occur - np.ones_like(number_occur) * h color_factor = [abs(x) <= 10 for x in color_factor...
true
33b0e3184fddb3e49b4225d46c28208f3bb5077f
Python
melissabaljeet/melissabaljeet.github.io
/sensor.py
UTF-8
387
2.828125
3
[]
no_license
us_dist(15) from gopigo import * def turn_right(): enc_tgt(0,1,2) time.sleep(.1) fwd() time.sleep(5) def turn_left(): enc_tgt(1,0, 2) time.sleep(.1) fwd() time.sleep(5) print us_dist(15) for i in range(1, 10): while us_dist(15) >= 20: servo(90) fwd() if us_dist(15) > 20: servo(180) ...
true
e345a738c72d688a104e15b2082cb7cbcd7d5c8d
Python
ShlokMohanty/python
/interacting_with_files.py
UTF-8
1,216
3.53125
4
[]
no_license
#interacting with files #its pretty common to need to read xmen_file = open('xmen_base.txt', 'r') xmen_file xmen_file.read() xmen_file.seek(0) xmen_file.read() for line in xmen_file : print(line, end="") #storm #wolverine #Cyclops #Bishop #Nightcrawler xmen_file.close() xmen_base = open('xmen_base.txt') new...
true
1fb98df3e0bcc56a78295f430c661a7d17130869
Python
royam0820/Python-Course-Tutorial
/files/gettingSleepy.py
UTF-8
145
3.65625
4
[]
no_license
from time import sleep duration = 5 print("Getting sleepy. See you in", duration, "seconds") sleep(duration) print("I'm back. What did I miss?")
true
571db98bbbad0db3f90e522e7574449592d37268
Python
jegerima/ProyectoSIIGrupo6
/fst.py
UTF-8
162
3.34375
3
[]
no_license
def multiply() : print str(2 * 5) def modulo() : print str(5%2) def main(): print str(2 + 5) print str(5-2) modulo() if __name__ == "__main__": main()
true
91428b045807bfec174e61ddfdc93f6cadba7366
Python
SmallLogin/UAV-hybrid-motion-planning-with-privacy-concerns
/GA/mapTools.py
UTF-8
5,228
2.734375
3
[]
no_license
# map generation tools import numpy as np from random import randint import math # 隐私部分的初始化 def privacy_init(grid_x, grid_y, grid_z, occ_grid, radius): #print(radius[0]) pri_grid = np.zeros((grid_x, grid_y, grid_z)) for i in range(grid_x): for j in range(grid_y): for k in range(grid_z...
true
9a5536b40a44eab1dc0d48a4c10e08b61da1f1ad
Python
kevinrodbe/json2html-flask
/main.py
UTF-8
2,910
3.03125
3
[ "MIT" ]
permissive
''' JSON 2 HTML convertor ===================== (c) Varun Malhotra 2013 http://softvar.github.io Source Code: https://github.com/softvar/json2html-flask ------------ LICENSE: MIT -------- ''' # -*- coding: utf-8 -*- import ordereddict import HTMLParser from flask import json from flask import Flask from flask imp...
true
56bf28b4a65708eb6c71625c35ffb83ab7fb596a
Python
srushti-coding-projects/CS-562-NLP
/part3.py
UTF-8
3,075
3.375
3
[]
no_license
''' Counting and Comparing ''' from nltk.corpus import stopwords from collections import Counter from nltk.collocations import BigramCollocationFinder import matplotlib.pyplot as plt import string word_output = open('word_tokenize.txt', 'r') words = word_output.read() word_list = words.split() # Print uniques type...
true
9a1f4fd44352cdfbda27f80d376db96665d67d8a
Python
saswatpp/cupy
/cupyx/scipy/special/_statistics.py
UTF-8
2,086
3.078125
3
[ "MIT", "LicenseRef-scancode-unknown-license-reference" ]
permissive
from cupy import _core logit_definition = """ template <typename T> static __device__ T logit(T x) { x /= 1 - x; return log(x); } """ logit = _core.create_ufunc( 'cupy_logit', ('e->f', 'f->f', 'd->d'), 'out0 = logit(in0)', preamble=logit_definition, doc='''Logit function. Args: ...
true
4eb41e0e12b51847ee1a7df4de518dd3a1dc3dc8
Python
Ji-sunny/farmAiPython
/module/box.py
UTF-8
1,010
2.8125
3
[]
no_license
import pandas as pd import datetime def box(data, table_name): def AddDays(sourceDate, count): targetDate = sourceDate + datetime.timedelta(days = count) return targetDate def GetWeekLastDate(sourceDate): temporaryDate = datetime.datetime(sourceDate.year, sourceDate.month, sourceDate....
true
bbb6ba38e7884bd66d4e32d35fa23928f4b05947
Python
sosuke-k/naruhodo
/naruhodo/utils/misc.py
UTF-8
6,278
3
3
[ "MIT" ]
permissive
""" Module for miscellaneous utility functions. """ import re import json from math import sqrt import numpy as np import networkx as nx from nxpd import draw from naruhodo.utils.dicts import NodeType2StyleDict, NodeType2ColorDict, NodeType2FontColorDict, EdgeType2StyleDict, EdgeType2ColorDict _re_sent = re.compile(r...
true
579554c31ef4059285fdfa445c3d996c0e8bdc7d
Python
Rk85/Stock-Watcher
/models/quote_history.py
UTF-8
871
2.640625
3
[]
no_license
from db_base import Base, engine from sqlalchemy import Column, Integer, String, DATETIME, Boolean, DATE from sqlalchemy.sql.expression import and_, func class TradeHistory(Base): """Contains history of the trades for each symbols """ __tablename__ = 'TradeHistory' __table_args__ = {'useexisting' : T...
true
db713cc2eb7c02a7b10d5129ac7083cd846d5f97
Python
ZnGaP/python_learning
/module.py
UTF-8
340
2.65625
3
[]
no_license
#!/usr/bin/env python3 # -*- coding: utf-8 -*- 'a test mo' __author__ = 'linjx' import sys def test(): args = sys.argv if len(args) == 1: print('hello world!') elif len(args) == 2: print('hello, %s' % args) else: print('Too much argument!') if __name__ == "__...
true
275dcf7021081b228b8e57006804cd8f067b4e0c
Python
computingForSocialScience/cfss-homework-DanyaLagos
/Assignment5/csvUtils.py
UTF-8
1,732
3.421875
3
[]
no_license
from io import open import csv def writeArtistsTable(artist_info_list): """Given a list of dictionries, each as returned from fetchArtistInfo(), write a csv file 'artists.csv'. The csv file should have a header line that looks like this: ARTIST_ID,ARTIST_NAME,ARTIST_FOLLOWERS,ARTIST_POPULARITY "...
true
f316df1f0c671f0a00fd1f971ee37fd50b3a1af5
Python
FMsunyh/RetinaNet
/core/backend/tensorflow_backend.py
UTF-8
9,799
2.625
3
[ "Apache-2.0" ]
permissive
import tensorflow import keras import core.backend def scatter_nd(*args, **kwargs): return tensorflow.scatter_nd(*args, **kwargs) def matmul(*args, **kwargs): return tensorflow.matmul(*args, **kwargs) def range(*args, **kwargs): return tensorflow.range(*args, **kwargs) def gather_nd(params, indices): return ...
true
f328ec242745a0d619e549c4c82fd1df7a7df577
Python
kevinch2008/SublimePlayer
/SublimePlayer.py
UTF-8
2,243
2.671875
3
[]
no_license
# -*- coding: utf-8 -*- import sublime, sublime_plugin import subprocess import threading class RunAsync(threading.Thread): def __init__(self, cb): self.cb = cb threading.Thread.__init__(self) def run(self): self.cb() def run_async(cb): res = RunAsync(cb) res.start() retu...
true
5e3d0f9bbac9becd02f61d5c0d3a55dd1c0d56c0
Python
patjenk/dummydb
/dummydb/ddb.py
UTF-8
2,851
3.3125
3
[]
no_license
from .serializer import dumps, loads class DummyDBException(Exception): pass class DummyDB(): data = None def __init__(self, filename=None): if filename is not None: self.data = self.load_from_disk(filename) else: self.data = {} def load_from_disk(self, filen...
true
1f3f25de7b5eabab93339da5000a001ecf59ea87
Python
scholer/rsenv
/rsenv/rsfavmodules.py
UTF-8
3,848
2.53125
3
[]
no_license
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright 2011 Rasmus Scholer Sorensen, rasmusscholer@gmail.com # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of...
true
a64528a25d320523afa6fd6edf0b0a80d21e6c55
Python
kapnan/AdventOfCode
/AoC_2019/Final_Completed/Day_5.py
UTF-8
4,519
3.015625
3
[]
no_license
# -*- coding: utf-8 -*- """ Created on Mon Jun 1 11:15:50 2020 @author: kriti """ #import math import numpy as np import os import sys import time if __name__ = '__main__': print('Hello, I am Day_5 :)') def Day_5(): t = time.time() os.chdir("C:/Users/kriti/Documents/Learning Python/AdventOf...
true
ab2c2ec41b358e6b5e1938ba72a6880a21071ef7
Python
ropert911/study01_python
/pythoTest/function/namedtuple.py
UTF-8
348
2.8125
3
[]
no_license
from collections import namedtuple user1 = {'userId': 1, 'topAreaList': [12, 13, 14]} user2 = {'userId': 2, 'topAreaList': [22, 23, 24]}; user_list = [user1, user2]; UserWithArea = namedtuple('UserWithArea', ('id', 'top_areas')) user_list = [UserWithArea(user['userId'], [_ for _ in user['topAreaList']]) for user in u...
true
7a168605be529e6872f4eef2f2073d0ee6ddf2e3
Python
czs108/LeetCode-Solutions
/Medium/256. Paint House/solution (1).py
UTF-8
1,113
3.40625
3
[ "MIT" ]
permissive
# 256. Paint House # Runtime: 68 ms, faster than 42.13% of Python3 online submissions for Paint House. # Memory Usage: 14.9 MB, less than 7.26% of Python3 online submissions for Paint House. class Solution: # Recursive Tree def minCost(self, costs: list[list[int]]) -> int: Red, Green, Blue = 0, 1, 2...
true
af081807f141e02a8e1b67a2dcf5eff5fbe0b048
Python
MasterfulDingo/spells
/sqlformat.py
UTF-8
4,276
3.546875
4
[]
no_license
#this list contains a number of lists which have the database column name in the first position and the possible values of the entry following. entfields = [['level','0','1','2','3','4','5','6','7','8','9'],['school','abjuration','conjuration','divination','enchantment','evocation','illusion','necromancy','transmutatio...
true
5d0c08b4054b36604ac0c381e3fe879bee6890d7
Python
J216/snake-engine
/snakec.py
UTF-8
9,991
2.90625
3
[ "MIT" ]
permissive
#execfile('./snakec.py') from math import sin, cos, radians from random import randrange, choice from time import sleep import os class Engine: def __init__(self, location=[-1,-1], engine_type=-1): self.location = location if engine_type == -1: self.item_type = choice([0]) els...
true
716bc3cfe3d90b8db97a5424e0bab30b71f4bbef
Python
diegoponciano/challenge-for-developers
/githubstars/core/management/commands/createuser.py
UTF-8
1,707
2.53125
3
[]
no_license
import sys from django.contrib.auth import get_user_model from django.core.management.base import BaseCommand, CommandError from django.contrib.auth.hashers import make_password from getpass import getpass User = get_user_model() class Command(BaseCommand): help = 'Creates user' requires_migrations_checks =...
true
2c57eecf0efc5290e81d1d5e2fb9640862cafa44
Python
blueones/LeetcodePractices
/backpack92lintcode.py
UTF-8
1,465
2.921875
3
[]
no_license
class Solution: """ @param m: An integer m denotes the size of a backpack @param A: Given n items with size A[i] @return: The maximum size """ def backPack(self, m, A): # write your code self.max_res = 0 self.memo = [[None for i in range(m+1)] for j in range(len(A))] ...
true
6fcf57b6173a2fee165a945352592e7137a24df9
Python
glantucan/Pi-learning
/PyGame/basicMovement.py
UTF-8
1,356
3.625
4
[]
no_license
#!/usr/bin/env/ python3 # -*- coding: utf-8 -*- import pygame # Define colors white = (255, 255, 255) black = (0, 0, 0) red = (255, 0 , 0) gameExit = False lead_x = 300 lead_y = 300 # Initialize pygame pygame.init() # Setup the pygame canvas (called surface) gameDisplay = pygame.display.set_mode((800, 600)) #The par...
true
0f7253e1925913a3e20548778615d8a748c99c5e
Python
venkatvi/Kaggle
/Titanic/predictWOCabinGridSearchRF.py
UTF-8
3,141
2.875
3
[]
no_license
import pandas as pd import numpy as np import math import re from sklearn.ensemble import RandomForestClassifier from sklearn.cross_validation import train_test_split from sklearn.grid_search import GridSearchCV from sklearn.metrics import accuracy_score def mapTitle(titleStr): if titleStr == 'MASTER': return 1 ...
true
db937f15f5d68df139eaadab5fb5baebcf38e371
Python
SebGeek/Kenobi
/motor/motor.py
UTF-8
4,496
2.640625
3
[]
no_license
#!/usr/bin/python # -*- coding: utf-8 -*- import time from rrb3 import RRB3 import multiprocessing import signal import syslog ''' https://github.com/simonmonk/raspirobotboard3 ''' class ThreadMotor(multiprocessing.Process): ''' Create a thread ''' def __init__(self, com_queue_RX, com_queue_TX): sel...
true
97b90caf20a2abd3072336a1d01b9aacccb47928
Python
Tauror/VxRailSentimentAanalysis
/mTest/timeline_bar_4.7.xx.py
UTF-8
5,957
2.59375
3
[]
no_license
import xlrd import numpy as np import matplotlib.pyplot as plt import matplotlib.dates as mdates from datetime import datetime def get_excel_date(t): t_as_datetime = datetime(*xlrd.xldate_as_tuple(t, workbook.datemode)) date = str(t_as_datetime.year)+'-'+str(t_as_datetime.month)+'-'+str(t_as_datetime.day) ...
true
6ed7c66c3dd8ee2ef7516151392dce85aab87711
Python
jhoeksem/SE_with_drones
/01_gettingstarted/hello_drone.py
UTF-8
1,479
2.71875
3
[ "MIT" ]
permissive
# Import DroneKit-Python from dronekit import connect, VehicleMode, time #Setup option parsing to get connection string import argparse parser = argparse.ArgumentParser(description='Print out vehicle state information') parser.add_argument('--connect',help="vehicle connection target string. If not specified, SITL aut...
true
02bfd63aad6189c0267ac1f566ac803e1c8ff0da
Python
dlwns147/Projects
/python/10.py
UTF-8
190
3.640625
4
[]
no_license
sum = 0 n = 1 print("덧셈을 하고 싶은 양의 정수들을 입력하세요. 0 입력시 종료.") while n != 0 : n=int(input()) sum += n print("총합은", sum, "입니다.")
true
a6acdd8bb2cece07b58649ded00f086a313f843e
Python
Dhadhazi/PD52-InstagramFollowerBot
/main.py
UTF-8
1,793
2.546875
3
[]
no_license
from selenium import webdriver from selenium.common.exceptions import ElementClickInterceptedException import time chrome_driver_path = "" ACCOUNT_TO_FOLLOW_FOLLOWERS = "" USERNAME = "" PASSWORD = "" driver = webdriver.Chrome(executable_path=chrome_driver_path) driver.get("https://www.instagram.com/") def login()...
true
8ba5836cc4bab9c20f3eaede4210da1f7fb88aa7
Python
fun-math/Autumn-of-Automation
/OpenCV/Q1,3.py
UTF-8
549
2.640625
3
[ "MIT" ]
permissive
import cv2 import numpy as np img=cv2.imread("meme.jpg",1) rows,cols,channels=img.shape img_hsv=cv2.cvtColor(img,cv2.COLOR_BGR2HSV) mask=cv2.inRange(img_hsv,(-5,50,70),(5,255,255)) mask_inv=cv2.bitwise_not(mask) dst_bg=cv2.bitwise_and(img,img,mask=mask_inv) blue=np.zeros([rows,cols,channels]) blue[:,:,0]=255*np.one...
true
a6777a969158aece3f8527fa2253c34197fc1069
Python
jaymax01/web_scraping
/taking screenshots with selenium/scraping_excersise.py
UTF-8
1,084
3.109375
3
[]
no_license
# -*- coding: utf-8 -*- """ Created on Fri Mar 12 13:58:56 2021 @author: Max """ import re from bs4 import BeautifulSoup import requests url = 'https://www.marketwatch.com/investing/stock/amzn?mod=over_search' page = requests.get(url) #print(page.text) soup = BeautifulSoup(page.text, 'lxml') #print(soup) # Price o...
true
d9f35b277d9df2c77f61f7f8f1811abce78efc3f
Python
sgk-000/algorithm
/Ex08/huhman.py
UTF-8
1,365
3.34375
3
[]
no_license
import sys import heapq class Node: def __init__(self, x): self.data = x self.left = None self.right = None def insert(self,node, x): if node is None: return Node(x) elif x == node.data: return node elif x < node.data: node.left = self.insert(node...
true
14b1adffb349cc954952b0ce4c156dd3235bbe02
Python
davidwparker/csci5606-numcomp
/final.py
UTF-8
21,526
3.328125
3
[]
no_license
from __future__ import division import math class final: epsilon = 0.0 """ final project class """ def __init__(self): self.epsilon = self.machineEpsilon() def printHeader(self): """ Prints the header for the class """ print '\nPrinciples of Numerical Computation' p...
true
b8a2bcec279d315338dc2692ead7f0135d4cb7f9
Python
BrachystochroneSD/machine_learning
/session1/a_star.py
UTF-8
6,637
3.640625
4
[]
no_license
# Based on the wiki page and pseudocode : https://en.wikipedia.org/wiki/A*_search_algorithm import matplotlib as mpl from matplotlib import pyplot import numpy as np class Node: # initialise an object NODE characterized by : # pos : position in the grid # statut : state, opened, blocked... (to k...
true
4fb9fefea278dc4dd50c91d6e5e7f333622d8fbd
Python
akapkotel/introduction_to_algorithms
/sorting/sorting_algorithms.py
UTF-8
1,915
3.984375
4
[]
no_license
#!/usr/bin/env python from typing import List def insertion_sort(list_to_sort: List) -> List: list_to_sort = [e for e in list_to_sort] # to avoid sorting in place, comment this to change original list for j in range(1, len(list_to_sort)): sorted_element = list_to_sort[j] # print('sorted eleme...
true
7e8b43271c259460765d9b8496d61eec55702a15
Python
pratul2789/CS6360-database
/00-test-packing.py
UTF-8
524
2.515625
3
[]
no_license
from file.valuetype import * from binascii import hexlify import datetime dt = DateTime(0) ddt = Date(100000000000000) tm = Time(23, 1, 2, 103) tm2 = Time(4359084) yr = Year(2016) print(dt, ddt, tm, tm2) data = vpack([0, 1, 2, 3, 6, 10, 11, 9, 9, 8, 0xc], NULLVAL, 23, 267, 234524, 4.5654, dt, ddt, tm, tm2, y...
true
110b5a808833c6b315f851bc1c3ed3b00928791b
Python
ArturTask/Mathan6
/drawAnswer.py
UTF-8
518
3.28125
3
[]
no_license
import matplotlib.pyplot as plt def drawPls(answer,title): fig = plt.figure() axes = fig.add_subplot(111) plt.grid() x = [] y = [] for i in range(len(answer)): x.append(answer[i][1]) y.append(answer[i][2]) axes.plot(x,y,c="black",label="полученное решение") y = [] ...
true
df61a3fb43977f034dabad8eaa804ddd981f02dc
Python
gijswobben/pydow-2
/pydow/store/tiny.py
UTF-8
702
2.90625
3
[ "MIT" ]
permissive
from tinydb import TinyDB, Query class Store(object): def __init__(self: object, *args: list, **kwargs: dict) -> None: self._db = TinyDB("database.json") def getState(self: object, key: str, default=None, session_id: str = None, identifier: str = None): """ """ pass def ...
true
5f8bc8bebfa3673348b3883ef5051b52683e280b
Python
acc-cosc-1336/cosc-1336-fall-2017-mmontemayor1
/frames/AboutFrame.py
UTF-8
266
3.34375
3
[ "MIT" ]
permissive
from tkinter import Frame, Label class AboutFrame(Frame): """Frame container for About screen""" def __init__(self, parent): Frame.__init__(self, parent) Label(self, text="About Frame").grid(row=0, column=0, sticky="w")
true
68c437b3dbcf305a82baebe00c4155887180e329
Python
kashewnuts/python-school-ja
/src/downloader.py
UTF-8
1,353
2.65625
3
[ "MIT" ]
permissive
#!/usr/bin/env python # -*- coding: utf-8 -*- """%prog url [, url [, ... ]] Download contents from given URL list. """ import logging import os import urllib from urlparse import urlparse # Check the document about version differences. # http://docs.python.org/library/urlparse.html#urlparse.parse_qs # New in ve...
true
f3636acbbaa2781258954d99e9b762556fbd747a
Python
amanshuraikwar/pr-assignment-2
/code.py
UTF-8
14,489
2.671875
3
[]
no_license
import funcs import sys import math from mpl_toolkits.mplot3d import Axes3D from matplotlib import cm from matplotlib.ticker import LinearLocator, FormatStrFormatter import matplotlib.pyplot as plt import random THRESHOLD=0.001 MAXITERATIONS=50 EMMAXITERATIONS=50 EMTHRESHOLD=0.1 TRAININGDATALIMIT=0.75 CURRENTNOOFCLUS...
true
53ba6f1fefa410fcf5c4c63ead11dcfc5091e74f
Python
patvdheyden/CvoDeVerdieping
/LesVariabelen.py
UTF-8
1,544
3.671875
4
[]
no_license
from termcolor import colored def avg(l): return sum(l, 0.0) / len(l) print ("Oefening 4.1") lijst = [15,26,36] print ("Het gemiddelde van " + str(lijst) + " is " + str("{:.2f}".format(avg(lijst)))) # afronden print 2 dec print("") print ("Oefening 4.2") straal = 5 PI = 3.14159 oppervlakte = (straal**2)*PI print...
true
9f88dd15317c38b6f3abda99e4ac61470c416a22
Python
soriapinnow/Python
/app_python/aula11.py
UTF-8
610
3.609375
4
[]
no_license
lista = [1, 10] try: arquivo = open('teste.txt', 'r') texto = arquivo.read() divisao = 10/1 numero = lista[1] #x = a except ZeroDivisionError: print('Não é possível realizar uma divisão por 0') except ArithmeticError: print('Houve um erro au realizar uma operação aritmética!') except IndexE...
true
4f1c523d93299c39c8fad9e487e0478dd216cac1
Python
Laurox/ZealotBot
/requirements.py
UTF-8
2,994
2.640625
3
[]
no_license
import requests import util.uuid_util import leaderboard import util.converter import time from dotenv import load_dotenv import os load_dotenv() token = os.getenv('API_TOKEN') rq = requests.get("https://api.hypixel.net/guild?key=" + token + "&id=5d2e186677ce8415c3fd0074") c = 0 for member in rq.json()['guild']['memb...
true
d25689642e1f0ee1417a53314ea8e1bf1a176c54
Python
maxim5helopugin/Portfolio
/AntiBullying/src/preproc/emoji.py
UTF-8
868
3.484375
3
[ "MIT", "LicenseRef-scancode-public-domain" ]
permissive
# -*- coding: utf-8 -*- """Module that contains utilities useful for dealing with emojis in text.""" KNOWN_EMOJIS = { ':)': 'smile', ':-)': 'smile', ':(': 'sad', ':-(': 'sad', '&lt;3': 'heart', '>:(': 'angry', '>:-(': 'angry', ':\'(': 'cry', } def replace_emojis(orig_text): """ Replace known emo...
true
58ab0735423d344d6a46b7181dc3e468520af777
Python
XihangJ/leetcode
/BFS/752_Open the Lock.py
UTF-8
1,720
3.625
4
[]
no_license
''' You have a lock in front of you with 4 circular wheels. Each wheel has 10 slots: '0', '1', '2', '3', '4', '5', '6', '7', '8', '9'. The wheels can rotate freely and wrap around: for example we can turn '9' to be '0', or '0' to be '9'. Each move consists of turning one wheel one slot. The lock initially starts at '0...
true
46717a02784fd4893462976ce74b4257e11fa949
Python
aliakatas/SKIRON_analysis_pack
/task_reader.py
UTF-8
14,526
2.65625
3
[ "MIT" ]
permissive
""" Module to define the Task class responsible for parsing the input of users. It performs sanity checks on what is asked from the application. """ import os import ntpath from dateutil.parser import parse from support_data import FILE, NODATA, VEC, SCAL, HISTO, SCATT, ROSE, HEAT, STATS, SERIES, SAVE, FTYPE, METEO, D...
true
8ff86d5c92b599240b7482adeb0d1cea895212a5
Python
Leoberium/CS
/stepik_data_structures/bst_feature.py
UTF-8
1,545
3.328125
3
[]
no_license
import sys def check_feature(bst: list): if not bst: return "CORRECT" stack = [] current = 0 # root key_previous = -sys.maxsize - 1 while True: if current != -1: stack.append(current) current = bst[current][1] # left child elif stack: ...
true
1943507ad7b39735d5f228073321a687c77cdb07
Python
abhishekgupta9807/GIES
/gies.py
UTF-8
50,852
2.515625
3
[]
no_license
#!/usr/bin/env python3 """" ******************************************************************** //File name: gies.py //Creator: Abhishek gupta //Stand alone GUI Desktop aplliction //Last chang: 05/08/2018 ******************************************************************** """ # importing external modules into our a...
true