blob_id stringlengths 40 40 | language stringclasses 1
value | repo_name stringlengths 5 133 | path stringlengths 2 333 | src_encoding stringclasses 30
values | length_bytes int64 18 5.47M | score float64 2.52 5.81 | int_score int64 3 5 | detected_licenses listlengths 0 67 | license_type stringclasses 2
values | text stringlengths 12 5.47M | download_success bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|
a4ee1ab4b5c9ea9f311c299832626bdd964c6ed0 | Python | dilipRathoreRepo/Selenium_Game_Playing_Bot | /cookie_cutter_main.py | UTF-8 | 1,550 | 3.078125 | 3 | [] | no_license | from selenium import webdriver
from datetime import datetime as dt
selenium_driver_path = "/Users/diliprathore/Downloads/chromedriver"
driver = webdriver.Chrome(executable_path=selenium_driver_path)
driver.get("http://orteil.dashnet.org/experiments/cookie/")
cookie = driver.find_element_by_id("cookie")
store_item_pr... | true |
098c937482faa2a65dec482bcfb179ba64ef31df | Python | VitorArthur/Pratica-Python | /ex014.py | UTF-8 | 112 | 3.953125 | 4 | [] | no_license | c = float(input('Informe a temperatura em °C: '))
print(f'A temperatura de {c}ºC correponde a {9*c/5+32}ºF')
| true |
39f02cf7ad5b6925f28cf97a72be1d3c37dfed09 | Python | 201600050-comillas/TFG-Business-Analytics--201600050 | /Graficos (3).py | UTF-8 | 2,153 | 2.8125 | 3 | [] | no_license | #!/usr/bin/env python
# coding: utf-8
# In[35]:
#CARGA DE LIBRERÍAS
import pandas as pd
import matplotlib.pyplot as plt
# In[36]:
#CARGA DE DATOS DJSI Europe y S&P Europe BMI
dfES = pd.read_excel (r'/Users/rocioartiaga/Desktop/indices/djsi-returns.xlsx')
# In[37]:
#DETERMINACIÓN DE LOS EJES
dfES.set_axis(['D... | true |
0734c67455e1a1be16c45ffa2b0879320c0f7346 | Python | AndreyRysistov/BeeVSWasp | /dataloaders/datagenerator.py | UTF-8 | 1,691 | 2.75 | 3 | [] | no_license | import tensorflow as tf
import os
class DataLoader:
def __init__(self, config):
self.config = config
self.path = './datasets/data'
self.class_names = os.listdir(self.path)
self.ds = self.set_generator()
def get_data(self):
train, val = self.split_data()
return... | true |
10c0e4ea39701d08cbbd1aa513db6c784a035f2e | Python | letitbezh/redis-mongodb-cache | /main.py | UTF-8 | 278 | 2.5625 | 3 | [] | no_license | import process
import os
import processinsert
choose = raw_input("what you want to do ")
choose = int(choose)
if choose==1:
print process.find()
elif choose==2:
processinsert.insert()
elif choose==3:
flag = process.find()
if(flag):
processinsert.delete() | true |
c77a7050ddc9fe0781091fa12430cafc8cddac68 | Python | WRansohoff/nmigen_ice40_spi_flash | /helpers.py | UTF-8 | 643 | 2.828125 | 3 | [
"MIT"
] | permissive | # Convert a 32-bit word to little-endian byte format.
# 0x1234ABCD -> 0xCDAB3412
def LITTLE_END( v ):
return ( ( ( v & 0x000000FF ) << 24 ) |
( ( v & 0x0000FF00 ) << 8 ) |
( ( v & 0x00FF0000 ) >> 8 ) |
( ( v & 0xFF000000 ) >> 24 ) )
# Helper methods / values for generating test ROM... | true |
6cf16136cd35f69714f4c93c3059f3b450f6fd22 | Python | GuilhermeLaraRusso/python_work | /ch_10_files_and_exceptions/10_1_reading_an_entire_file.py | UTF-8 | 2,826 | 4.625 | 5 | [] | no_license | # To try the following examples yourself, you can enter these lines in an
# editor and save the file as pi_digits.txt, or you can download the file from the
# book’s resources through https://www.nostarch.com/pythoncrashcourse/. Save
# the file in the same directory where you’ll store this chapter’s programs.
# Here’s ... | true |
440089dd4e3ee613b0a2cffba2af747867327d98 | Python | katiepicha/Numpy_Project | /MyArrays1.py | UTF-8 | 3,345 | 4.125 | 4 | [] | no_license | import numpy as np
import random
# two dimensional array (has rows and columns)
# [1,2,3] is the first row with 3 elements and [4,5,6] is the second row with 3 more elements
arr01 = np.array([[1,2,3],
[4,5,6]])
# one dimensional array
arr02 = np.array([0.0, 0.1, 0.2, 0.3, 0.4])
for row in arr01:
... | true |
8301dab1fff11110c7001f30776c3ed5916acd6a | Python | addam/pyg | /examples/tetris.py | UTF-8 | 2,300 | 2.734375 | 3 | [] | no_license | import pyg
from random import choice as randchoice
#TODO vyresit: je Square pozicovany od sveho stredu, nebo od leveho spodniho rohu?
# Jak jsou pozicovane drawables? Ktere pozicovani je defaultni a ktere se musi nastavit rucne?
#Pro inspiraci: v pripade rucniho pozicovani nekterych actoru by se hodilo spustit transakc... | true |
201626bfed3023c3286c747b496e34e6a246f908 | Python | amishapagare25/python_codes | /main.py | UTF-8 | 594 | 2.6875 | 3 | [] | no_license | from tkinter import *
window = Tk()
Label(window,text='Fullname').grid(row=0)
Label(window,text='email').grid(row=1)
Label(window,text='age').grid(row=2)
Label(window,text='Gender').grid(row=3)
e1= Entry(window)
e2= Entry(window)
e3=Entry(window)
e5=Radiobutton(window,text="male",value=0)
e4=Button(window,tex... | true |
466e108165fd0ae24790087d8a5e60762ccbe9af | Python | pradeepshetty1/python-Pandas-and-Numpy- | /Module3/4_exception.py | UTF-8 | 378 | 3.515625 | 4 | [] | no_license | try:
import mylib
except ImportError as ie:
print 'module not found: ',ie
def exception_example(a,b):
c = 0
try:
c=a/b
print 'result is ',c
except Exception as exp:
print 'encountered exception',exp
return c
#exception_example(10,3)
#print 'printing while calling the... | true |
2911b22b0e1aafc5afcc5bd5bfbc2f70f13ce99c | Python | CCorazza/Intra42 | /users/Ldap.py | UTF-8 | 2,234 | 2.53125 | 3 | [] | no_license | import ldap
class Ldap(object):
"""Surcouche du module ldap"""
__host = 'ldaps://ldap.42.fr:636'
__base_dn = 'uid=%s,ou=2013,ou=people,dc=42,dc=fr'
def __init__(self, username, password):
'Constructeur: Ldap(username, password)'
self.handler = None
self.username = username
self.password = pas... | true |
85b9b1bee7ce98ba5d3860efa8c89541328d352f | Python | LUMC/OvoGrowth-dataprocessor | /scripts/validate_input_files.py | UTF-8 | 468 | 2.921875 | 3 | [
"MIT"
] | permissive | import sys
from os import path
arg = sys.argv
def validate_input(files_dataset, required_files):
if len(files_dataset) < 1:
print("No valid dataset files detected")
for file_set in files_dataset:
for rfile in required_files:
if (not path.exists(file_set+"/"+rfile)):
... | true |
2802744bdb6ba909cbfd96435ace75bcf266b514 | Python | akshayravichandran/Foundations-of-Software-Science | /w5/unsuper.py | UTF-8 | 2,038 | 2.640625 | 3 | [] | no_license | from w3.num import Num
from w4.w4 import rows
from w4.w4 import Data
class Unsuper:
def __init__(self, data):
"""
Initialize an unsupervised learner.
"""
self.rows = data.rows.values()
self.enough = len(self.rows) ** 0.5 # magic constant
def band(self, c, lo, hi):
if lo == 0:
ret... | true |
a9389dd4e93d9c1a13b9911d032ffa9b85bb9964 | Python | danielfrgs/python-machine-learning | /adaline-gd.py | UTF-8 | 2,285 | 3.28125 | 3 | [] | no_license | import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from mlxtend.evaluate import plot_decision_regions
class AdalineGD(object):
"""ADAptive LInear NEuron classifier"""
def __init__(self, eta=0.01, n_iter=50):
self.eta = eta
self.n_iter = n_iter
def fit(self, X, y):
... | true |
e15d010d84b29cde52dfcbe8541c183972291e58 | Python | GeorgiyZhuravlevRudn/gzhuravlev.pfur | /2020-2021/Pr./lab03/ex 5.1.py | UTF-8 | 333 | 4.03125 | 4 | [] | no_license |
arr_1 = []
num_of_elements_arr_1 = int(input('Input a number of elements for array: '))
for i in range(num_of_elements_arr_1):
k = int(input(f"element { i } of an array = "))
arr_1.append(k)
print("the largest number in array is ", max(arr_1))
print("normal array", arr_1)
print("reversed array", list(revers... | true |
f83c84cbcdc3c18f94be97c0d406db8b9dfb1050 | Python | jackrushie/02m | /02m/PDF_editting/PDF_Merger.py | UTF-8 | 382 | 2.75 | 3 | [] | no_license | import PyPDF2
import sys
import os
filepath = './02m/PDF_editting/PDFs/'
inputs = os.listdir(filepath)
print(inputs)
def pdf_combined(filepath):
merger = PyPDF2.PdfFileMerger()
for pdf in os.listdir(filepath):
if pdf.endswith((".pdf")):
print(pdf)
merger.append(f'{filepath}{pdf}'... | true |
63313c60c690b38fe8220131dbcf592af96a7e22 | Python | efchakim/Python | /mastermind.py | UTF-8 | 2,741 | 4.125 | 4 | [] | no_license | #This program simulates the code-breaking game Mastermind.
#This program checks the players guess against the initial for random numbers between 1-6.
#Enter four guesses from 1-6, example: 1234.
#By: Diana Hakim
def GenCode():
'generate four random numbers in a list'
import random
List =[]
f... | true |
f33f4b069a7def053f2ae0c97bc892ee8f22e8d6 | Python | CoderQingli/MyLeetCode | /290. Word Pattern.py | UTF-8 | 601 | 3.140625 | 3 | [] | no_license | def wordPattern(self, pattern, str):
"""
:type pattern: str
:type str: str
:rtype: bool
"""
map = {}
map_rev = {}
if not pattern and not str:
return True
if (not pattern and str) or (pattern and not str):
return False
str_l = str.split()
if len(pattern) != len... | true |
b82abf1f80c4375dc0c9508b32e7b04d24df58b7 | Python | StarkTan/Python | /Pandas/multiple_data.py | UTF-8 | 3,542 | 3.25 | 3 | [] | no_license | import pandas as pd
import numpy as np
def _append():
"""
DataFrame.append(other, ignore_index=False, verify_integrity=False, sort=None)
"""
df = pd.DataFrame(np.arange(6).reshape(2, 3), index=[0, 1], columns=list('ABC'))
print(df)
df = df.append([{'A': 6, 'B': 7, 'C': 8}])
print(df)
d... | true |
9a3a1dff2994dd37e225916b40221c64af366245 | Python | huffmp2/python | /numbers.py | UTF-8 | 887 | 3.578125 | 4 | [] | no_license | for value in range(1,5):
print(value)
numbers= list(range(1,6))
print (numbers)
evenumbers= list(range(2,11,2))
print (evenumbers)
squares=[]
for value in range(1,11):
square=value**2
squares.append(square)
print (squares)
squares = []
for value in range(1,11):
squares.append(value**2)
pri... | true |
311e7afb428f755aaa666b624dc4190595b06673 | Python | thomasvangoidsenhoven/Raytracer-3D-Cplus | /mesh/meshpython/lib/lib/meshwriter.py | UTF-8 | 1,788 | 2.96875 | 3 | [] | no_license | import json
def writeJson(data, outfile="C:\\Users\\Thomas\\Desktop\\3D 2019\\3dcg1819-team\\mesh\\meshpython\\lib\\bunnyOP2.json"):
arr = make_array(data)
arr.reverse()
file = open(outfile, "w")
for line in arr:
file.write(line + " \n")
file.close()
def make_array(data):
nodes = [da... | true |
247f26de58c53246d4f814c439b03829a022cf98 | Python | todokku/deepsea-frameextractor | /src/main/extractor.py | UTF-8 | 18,390 | 2.875 | 3 | [
"Apache-2.0"
] | permissive | #!/usr/bin/env python
__author__ = "Danelle Cline, Nathanial Yee"
__copyright__ = "Copyright 2020, MBARI"
__credits__ = ["MBARI"]
__license__ = "GPL"
__maintainer__ = "Danelle Cline"
__email__ = "dcline at mbari.org"
__doc__ = '''
Utility module for converting video to still frames and deinterlacing using the ffmpeg ... | true |
543931a3694b8f78753b64d48ef72022a232e6f2 | Python | xiaosean/leetcode_python | /Q692_Top-K-Frequent-Words.py | UTF-8 | 256 | 3.046875 | 3 | [
"MIT"
] | permissive | class Solution:
def topKFrequent(self, words: List[str], k: int) -> List[str]:
c = Counter(words)
data = [(k, v) for k, v in c.items()]
data = sorted(data, key= lambda x:(-x[1], x[0]))
return [key for key, _ in data[:k]] | true |
f0fb22e559b1c9efc8ebe8b8e12105f7507017f8 | Python | lisennku/web_spider | /practise 1: simplified web scraper.py | UTF-8 | 3,173 | 3.28125 | 3 | [] | no_license | #coding: utf-8
# update: 1.去掉了与书籍相关字符串左右的空格
# update: 2.采用了OOP的方式进行统计
# update:3 利用各个书籍的链接去统计详细信息,并分别写入文件中
'''
针对豆瓣读书中“新书速递”(URL:http://book.douban.com/latest?icn=index-latestbook-all)进行简单的爬虫,并生成TXT文件,
纪录书名、作者以及短评
简单的实现,仍然需要对代码进行优化,现存问题是由于网页源代码中含有过多的换行符('\n'),由此产生的正则表达式结果也会有影响,
需要去解决
'''
# coding: utf-8
import re
im... | true |
10e288e9ccba90b5bc31eb71380adfc42fca69ec | Python | alanbato/proyecto-sisops | /SRT.py | UTF-8 | 6,078 | 2.859375 | 3 | [
"MIT"
] | permissive | '''
Sistemas Operativos LuJu 10
Proyecto Final
Equipo #8
SRT:
Se corre el proceso con el menor tiempo estimado restante (expropiativo).
Si llega un proceso con un menor tiempo restante expulsa al proceso en ejecucion.
'''
import iohelp as io
def srt_scheduling(setup, processes):
'''Política de Scheduling ... | true |
02130d5c8fde80a3cd0043fc51975079c14fba17 | Python | WSHoekstra/experiments_in_reinforcement_learning | /experiments/01_cartpole/cartpole.py | UTF-8 | 2,007 | 2.71875 | 3 | [] | no_license | # -*- coding: utf-8 -*-
# import os
# os.chdir('C:/Users/Walter/Documents/GitHub/experiments_in_reinforcement_learning')
import gym
import numpy as np
from experiments.agents.dqn import DQNAgent
env = gym.make('CartPole-v0')
state = env.reset()
agent = DQNAgent(observation_space_size=env.observation_space... | true |
40011d3e5b5eb2be9f5c700d4ccf5c4096434200 | Python | renjieliu/leetcode | /0600_0999/606.py | UTF-8 | 3,141 | 3.78125 | 4 | [] | no_license | # Definition for a binary tree node.
# class TreeNode:
# def __init__(self, val=0, left=None, right=None):
# self.val = val
# self.left = left
# self.right = right
class Solution:
def tree2str(self, root: 'Optional[TreeNode]') -> str: # O( N | N )
def helper(output, node):
... | true |
ea55f70ff55535b0a7007647ec6f1a09f29db5d5 | Python | mihahauke/scinol_icml2019 | /plot_distributions.py | UTF-8 | 1,875 | 2.859375 | 3 | [
"MIT"
] | permissive | #!/usr/bin/env python3
from distributions import normal_dist_outliers, normal_scaled
import numpy as np
from argparse import ArgumentParser
from matplotlib import pyplot as plt
import seaborn as sns
plt.style.use("ggplot")
def plot_dist(x, labels, probs, jitter, alpha, name):
print("Noise:",np.mean(np.minimum(p... | true |
d4357cfac8facf3e6e56ea419751e6a6a1c717dc | Python | rzhou10/Leetcode | /300/349.py | UTF-8 | 196 | 3.0625 | 3 | [] | no_license | '''
Intersection of Two Arrays
Runtime: 40 ms
'''
class Solution:
def intersection(self, nums1: List[int], nums2: List[int]) -> List[int]:
return list(set(nums1) & set(nums2)) | true |
8441a11e3aead242f895cce7aa2b8379813b68bd | Python | camilogs1/Scripts_UCLA | /Taller1/Parte1/punto3.py | UTF-8 | 503 | 3.8125 | 4 | [] | no_license | horas = float(input("Ingrese el total de horas trabajadas: "))
valor = float(input("Ingrese el valor por cada hora: "))
sueldo = horas * valor
print("El salario bruto es de: ", sueldo)
aux = sueldo * 0.31
print("Las deducciones son de: ", aux)
sueldo -= aux
if (sueldo <= 300):
aux = sueldo * 0.2
print("El sala... | true |
fd7b47e7ef5e60f76f0358134b069d1a81e40215 | Python | DrDrei/Project-Ueler-Solutions | /python/Problem024.py | UTF-8 | 599 | 3.171875 | 3 | [] | no_license | import sys
import math
numbers = list(range(0,10))
def inc(numbers):
#find largest
index = len(numbers)-1
maxi = max(numbers)
while True:
if numbers[index] > numbers[index-1]:
pivot = index-1
new = numbers[pivot:]
new.sort()
piv_val = numbers[pivot]
piv_index = new.index(piv_val)
new_piv_val ... | true |
87afa4be82aaa18e5f66cfe120e7b7aa6dcaef75 | Python | chrstphrbtchr/01-Introduction | /main.py | UTF-8 | 865 | 3.109375 | 3 | [
"MIT"
] | permissive | #!/usr/bin/env python3
import utils
utils.check_version((3,7))
utils.clear()
print('Hello, my name is Christopher Butcher!')
import random
gamez = ['Earthbound','Mother 3','Until Dawn','The Legend of Zelda: A Link to the Past','Castlevania: Symphony of the Night', 'Super Mario World','Fallout 4','Borderlands 2','Hor... | true |
337340cc9cdd16f2b90ed46a1513decfba546716 | Python | ptq204/LearningPython | /ServerClientSelect/client.py | UTF-8 | 420 | 2.828125 | 3 | [] | no_license | import sys
import socket
import os
s = socket.socket()
host = socket.gethostname()
port = 5000
print("client will be connected to {}".format(host))
s.connect(('127.0.0.1',port))
print("connected to server")
while(1):
incoming_msg = s.recv(1024)
incoming_msg = incoming_msg.decode()
print("server: {}".form... | true |
905be0589b5a3638c845bbcf5ed35573dfaf700b | Python | ZubritskiyAlex/Python-Tasks | /HW_10/task 10_03.py | UTF-8 | 465 | 3.75 | 4 | [] | no_license | """Дан файл, содержащий различные даты. Каждая дата - это число, месяц и
год. Найти самую раннюю дату. [02-8.1-ML-29]"""
from datetime import datetime
import csv
with open("10_03.csv",'r') as csv_file:
csvreader = csv.reader(csv_file)
data = []
for line in csvreader:
data.append(datetime.strptime(l... | true |
85ca295170863177a9a2c03aa1e921145e65b2eb | Python | betty29/code-1 | /recipes/Python/436229_RecordJar_Parser/recipe-436229.py | UTF-8 | 2,013 | 3.328125 | 3 | [
"MIT",
"Python-2.0"
] | permissive | #!/usr/bin/env python
# recordjar.py - Parse a Record-Jar into a list of dictionaries.
# Copyright 2005 Lutz Horn <lutz.horn@gmx.de>
# Licensed unter the same terms as Python.
def parse_jar(flo):
"""Parse a Record-Jar from a file like object into a list of dictionaries.
This method parses a file like object ... | true |
cce75c91dc41565e359fe6e142de44c5ff800ab2 | Python | jharman25/python-for-scientists | /docs/_examples/plot_sns_hist.py | UTF-8 | 365 | 3.40625 | 3 | [] | no_license | """
Histogram
=============
Example histogram
"""
import matplotlib.pyplot as plt
import seaborn as sns
import numpy as np
sns.set()
# Initialize a figure and axes object
fig, ax = plt.subplots(figsize=(3,3))
# Data
x = np.random.normal(0, 0.1, 1000)
# Add data a scatter points onto axes
ax.hist(x)
# Name axes
a... | true |
4c4d6b4b5267d61d547b2c87d969703a01592ff1 | Python | laCorse/ReTracker | /models/ResNet.py | UTF-8 | 1,491 | 2.578125 | 3 | [] | no_license | from __future__ import absolute_import
import torch
import torchvision
from torch import nn
from torch.nn import functional as F
# For debug
from IPython import embed
class ResNet50(nn.Module):
def __init__(self, num_classes, loss = {'softmax', 'metric'}, **kwargs):
super(ResNet50, self).__init__()
... | true |
ea5b48e19dbcead768e17ccce99c7fd2e550c722 | Python | PRIYANSUPULAK/Face_Detector | /face_recognition.py | UTF-8 | 480 | 2.5625 | 3 | [] | no_license | import cv2
import sys
image_path=sys.argv[1]
cascPath = "haarcascade_frontalface_default.xml"
faceCascade=cv2.CascadeClassifier(cascPath)
image=cv2.imread(image_path)
gray=cv2.cvtColor(image,cv2.COLOR_BGR2GRAY)
faces= faceCascade.detectMultiScale(gray, scaleFactor=1.3, minNeighbors=9, minSize=(30, 30), flags= cv2.CA... | true |
2b1cd918865e93de587e78a2404aa7fbaeb51280 | Python | eguerrero13/MovieTrailerWebsite | /entertainment_center.py | UTF-8 | 2,679 | 3.3125 | 3 | [] | no_license | import media
import fresh_tomatoes
# Create PI movie object
pi = media.Movie("PI: faith in chaos",
"The story about a mathematician and the obsession with "
"mathematical regularity contrasts two seemingly "
"irreconcilable entities: the imperfect, irrational "
... | true |
9dcc31941d937312d6f3a834f4c26884a1bcb4ee | Python | jie-meng/jie-meng.github.io | /tools/image2webp.py | UTF-8 | 716 | 2.71875 | 3 | [] | no_license | import os
def findFilesRecursively(path, pred = None, ls = None):
if ls == None:
ls = []
for p in os.listdir(path):
p = os.path.join(path, p)
if os.path.isdir(p):
findFilesRecursively(p, pred, ls)
elif os.path.isfile(p):
if not pred or pred(p):
... | true |
6727bdc422920e3e15e9e2a1708eb0cfd0380f25 | Python | lucasfazzib/covid19_python_chart | /project1.py | UTF-8 | 3,732 | 2.96875 | 3 | [] | no_license | from typing import final
import requests as r
import datetime as dt
import csv
from PIL import Image
from IPython.display import display
from urllib.parse import quote
url = 'https://api.covid19api.com/dayone/country/brazil'
resp = r.get(url)
#print(resp.status_code)
raw_data = resp.json()
#print(raw_data[0])
#{'ID':... | true |
1a0dc49074129f9c77237499ff5a0a0bc93dc0d7 | Python | dizpers/python-address-book-assignment | /address_book/person.py | UTF-8 | 3,766 | 3.234375 | 3 | [
"MIT"
] | permissive | __all__ = ['Person']
class Person(object):
searchable_fields = ['first_name', 'last_name', 'email', 'emails']
def __init__(self, first_name, last_name, addresses, phone_numbers, emails):
"""
Constructor of Person class
:param first_name: first name of the person
:type first_n... | true |
2621df087984fbba914d70dd5bd22417f814f42f | Python | matthewmjm/100-days-of-code-days-1-through-10 | /day4/main.py | UTF-8 | 1,275 | 3.890625 | 4 | [] | no_license | import random
rock = '''
_______
---' ____)
(_____)
(_____)
(____)
---.__(___)
'''
paper = '''
_______
---' ____)____
______)
_______)
_______)
---.__________)
'''
scissors = '''
_______
---' ____)____
______)
__________)
(____)
-... | true |
74be2eba6fa3cdabcb8076e6c651fea89420686f | Python | kamyu104/LeetCode-Solutions | /Python/linked-list-random-node.py | UTF-8 | 766 | 3.71875 | 4 | [
"MIT"
] | permissive | # Time: O(n)
# Space: O(1)
from random import randint
class Solution(object):
def __init__(self, head):
"""
@param head The linked list's head. Note that the head is guanranteed to be not null, so it contains at least one node.
:type head: ListNode
"""
self.__head = head
... | true |
47990e21d654f85580ca9b07ce38535128895112 | Python | ek360/Movie-web-app-with-sql-database | /movie/domain/movie.py | UTF-8 | 4,256 | 2.890625 | 3 | [] | no_license | from movie.domain.genre import Genre
from movie.domain.actor import Actor
from movie.domain.director import Director
from movie.domain.review import Review
from datetime import date, datetime
from typing import List, Iterable
class Movie:
def __init__(self, rank, title: str, year: int, description, director, run... | true |
e36b5345d8450aba39c6e6ba93cf9642ce42c056 | Python | deepbuzin/humpback-whale-identification | /loss/triplet_loss.py | UTF-8 | 16,295 | 2.703125 | 3 | [
"MIT"
] | permissive | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import tensorflow as tf
# def euclidean_distance(embeddings):
# """Compute the 2D matrix of pairwise euclidean distances between embeddings.
#
# :param embeddings: tensor of shape (batch_size, embeddin... | true |
112415cde6d3dc34c54456edc40a4f05697a18ed | Python | pooja89299/list | /list tatola even.py | UTF-8 | 294 | 3.203125 | 3 | [] | no_license | # num=[23,14,56,12,19,9,15,31,42,43]
# i=0
# y=[]
# a=[]
# sum=0
# sum1=0
# while i<len(num):
# b=num[i]
# if b%2==0:
# sum=sum+b
# y.append(b)
# else:
# a.append(b)
# sum1=sum1+b
# i=i+1
# print("even",y,"sum:",sum)
# print("odd",a,"sum1:",sum1) | true |
a545b1861ad7812848066fb74f9d16db4b1b3df2 | Python | wrschneider/project-euler | /p006.py | UTF-8 | 161 | 3.296875 | 3 | [] | no_license | n = 100
sum_of_squares = sum(i*i for i in range(1, n+1))
_sum = sum(i for i in range(1, n+1))
square_of_sum = _sum * _sum
print(square_of_sum - sum_of_squares)
| true |
bae1ef8ffb49baa3ff27acb58af57f2f8a5a68fb | Python | hucarlos/OptimalControl | /Scripts/Plots/BoxPlotSELQR.py | UTF-8 | 1,257 | 2.859375 | 3 | [] | no_license | import numpy as np
import matplotlib.pyplot as plt
import matplotlib
if __name__ == '__main__':
matplotlib.rcParams['pdf.fonttype'] = 42
matplotlib.rcParams['ps.fonttype'] = 42
data = np.loadtxt('Results4.txt')
# print data.shape
# data = [data[m] for d, m in zip(data.T, mask.T)]
# mask = ~n... | true |
efead44c4d9c3ea1b6de8a1868cffc3030911343 | Python | mateenjameel/Python-Course-Mathematics-Department | /Week 14_Integration with Plotting Responses/integration_six.py | UTF-8 | 301 | 3.296875 | 3 | [] | no_license | import numpy as np
import matplotlib.pyplot as plt
x = np.linspace(-1,3,1000)
def f(x):
return x**2
plt.plot(x,f(x))
plt.axhline(color='red')
plt.fill_between(x, f(x), where = [(x>0) and (x<2) for x in x], color='blue', alpha =0.3)
# alpha is for transparency
plt.show()
| true |
a0681bfc4259002b7e739bfa27cff2773b738834 | Python | ras-2004-shaikh/MultiLang | /multilang.py | UTF-8 | 1,974 | 2.9375 | 3 | [] | no_license | import os
import time
import json
#solutions=[wherever the solutions are maybe discord?? this will be a list of strings]
test_solution='''java
public static int solution(){
return 5;
}
'''
test_solution_2='''brainf*ck
>+++++[<++++++++++>-]<+++.
'''
solutions=[test_solution,test_solution_2]
test_file... | true |
c1db36698c2c90c7b0338b39f8442b83178938ef | Python | kleinerman/dobie | /server/back_end/crudresndr.py | UTF-8 | 11,251 | 2.671875 | 3 | [] | no_license | import pymysql
import queue
import logging
import json
import re
import time
import threading
import genmngr
import database
from config import *
from msgheaders import *
class CrudReSndr(genmngr.GenericMngr):
'''
This thread has two responsibilities.
It periodically check which controllers has some CRUD... | true |
de4d2ecf7c2e79f6003c26c4c1dccac8305feb8d | Python | tmacjx/flask-quickstart | /common/utils/date_formatter.py | UTF-8 | 2,123 | 3.03125 | 3 | [] | no_license | """
# @Author wk
# @Time 2020/4/23 10:39
"""
from datetime import datetime, date
import time
import numbers
DATE_FORMAT_DEFAULT = "%Y-%m-%d"
DATETIME_FORMAT_DEFAULT = "%Y-%m-%d %H:%M:%S"
def format_date(dt, formatter=DATE_FORMAT_DEFAULT):
"""
:param dt:
:param formatter:
:return:
"""
if isi... | true |
62458a8e3381f5b20e953d97dc710696ee030b65 | Python | peterbarla/AlgoExpertExercises | /ArraysCategory/ZigzagTraverse/my_solution.py | UTF-8 | 1,670 | 4.125 | 4 | [] | no_license | # O(n) time | O(n) space
def zigzagTraverse(array):
i, j = 0, 0
number_of_elements_in_the_array = len(array) * len(array[0])
result = []
if number_of_elements_in_the_array != 0:
result.append(array[i][j])
added_elements = 1
down = False
up = True
if len(array) > 1:
i += 1... | true |
6515f4dfbe4531a4db69bdf1b95dfa34b9f2e0a7 | Python | KunBaoLin/coding-dojo-hw | /band_together/flask_app/models/band.py | UTF-8 | 2,417 | 2.953125 | 3 | [] | no_license | from flask_app.config.mysqlconnection import connectToMySQL
from flask import flash
class Band:
db = 'band_together'
def __init__(self,data):
self.id = data['id']
self.name = data['name']
self.genre = data['genre']
self.city = data['city']
self.created_at = data['create... | true |
5b9d05ac39b7bb38e425ec1c6c6965d177038173 | Python | Ayhan-Huang/CMDB | /auto_client/src/plugin/memory.py | UTF-8 | 1,915 | 2.6875 | 3 | [] | no_license | from lib.config import settings
import os
from lib import convert # 转化MB显示的
class Memory:
def __init__(self):
pass
@classmethod # 日后可以附加其它逻辑
def initial(cls):
return cls()
def process(self, execute_cmd, debug):
if debug:
with open(os.path.join(settings.BASE_DIR, ... | true |
d755b3439b762747c9e100fde6e67a7a8ca09bb4 | Python | approximata/greenfox-weeks | /week-04/day-4/4.py | UTF-8 | 263 | 3.765625 | 4 | [] | no_license | # 4. Given base and n that are both 1 or more, compute recursively (no loops)
# the value of base to the n power, so powerN(3, 2) is 9 (3 squared).
def power(x, n):
if n <= 2:
return x * x
else:
return x * power(x, n-1)
print(power(2, 4))
| true |
66607c860f0a213e0b516abcb5a667a21bc162b5 | Python | carlos3g/URI-solutions | /categorias/iniciante/python/1019.py | UTF-8 | 119 | 3 | 3 | [
"MIT"
] | permissive | # -*- coding: utf-8 -*-
t = int(input())
m = t%3600//60
h = t//3600
s = t%3600%60
print('{}:{}:{}'.format(h, m, s))
| true |
9b562e802acbb135f0ddf0dbda4b3f999fa65ec4 | Python | codio-content/ms-m12-conditionals-and-repetition | /.guides/content/ExFor1.py | UTF-8 | 136 | 3.21875 | 3 | [] | no_license |
for i in range(1,10):
print("pump bellows")
for i in range(1,10,2):
print("Example of stepping by 2")
print (i)
| true |
f21e5e1b717aafdc415ce0384e76b2bf8551dfef | Python | kenaryn/arkheia | /book.py | UTF-8 | 970 | 3.734375 | 4 | [
"BSD-3-Clause"
] | permissive | """Define a set of classes representing a book."""
class Book:
"""A simple class book."""
def __init__(self, title, author, publisher, year):
self.title = title
self.author = author
self.publisher = publisher
self.year = year
def read_book(self):
"""Show information... | true |
a43ecb53122e03529f7d603ddf61f650b75fbdb1 | Python | goldan/pytils | /pytils/test/test_utils.py | UTF-8 | 5,129 | 2.765625 | 3 | [
"MIT"
] | permissive | # -*- coding: utf-8 -*-
"""
Unit-tests for pytils.utils
"""
import unittest
import pytils
import decimal
class ASPN426123TestCase(unittest.TestCase):
"""
Test case for third-party library from ASPN cookbook recipe #426123
This unit-test don't cover all code from recipe
"""
def testTakesP... | true |
44054cf9c1dbd5b2698d5f0f081e2d97b3f51265 | Python | suryakencana007/kensaku | /rak/example-mongo.py | UTF-8 | 2,053 | 2.59375 | 3 | [] | no_license | """
# Copyright (c) 11 2014 | surya
# 17/11/14 nanang.ask@kubuskotak.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 2
# of the License, or (at your option) any later ve... | true |
277d54c6dd709bea99cc2d9d8315910e5af524d4 | Python | Madhur0/MGNREGA | /venv/src/run.py | UTF-8 | 1,746 | 3.296875 | 3 | [] | no_license | """ Initial file for stating the project."""
from block_development_officer import BlockDevelopmentOfficer
from gram_panchayat_member import GramPanchayatMember
from member import Member
from schema import Schema
import sqlite3
def sql_connection():
"""
Setup connection with sqlite3 backend.
:return: sq... | true |
775842cce700a5ce8c6cebefc8d6a4fec794fcb7 | Python | Chetchita641/QT_Tutorials | /advancedpyqt5/examples/modelview/modelindex.py | UTF-8 | 2,178 | 3.21875 | 3 | [] | no_license | #!/usr/bin/python3
# -*- coding: utf-8 -*-
'''
ZetCode Advanced PyQt5 tutorial
In this example, we work with QModelIndex
and QTreeView.
Author: Jan Bodnar
Website: zetcode.com
Last edited: August 2017
'''
from PyQt5.QtWidgets import (QWidget, QApplication, QTreeView,
QVBoxLayout, QAbstractItemView, QLab... | true |
242590806441f1028cad9f22db706671fa613550 | Python | krishnadhara/programs-venky | /decorators_py/func_dec.py | UTF-8 | 384 | 3.546875 | 4 | [] | no_license | def smart_division(func):
def inner(a,b):
print("i am going to divide",a,"and",b)
if b == 0:
print("b canot be divided by zero")
return
return func(a,b)
return inner
@smart_division
def division(a,b):
return a/b
'''val = smart_division(division)
print(val)
bab... | true |
0297a1268aeb6d959b4a46065fb3e97b37f99c7b | Python | Roberto-Mota/CursoemVideo | /exercicios/ex087.py | UTF-8 | 2,261 | 3.890625 | 4 | [
"MIT"
] | permissive | # Desafio 087 -> Aprimore o desafio anterior, mostrando no final:
# A) A soma de todos os valores pares digitados.
# B)A soma dos valores da terceira coluna
# C)O maior valor da segunda coluna
posição = [[], [], []]
linha = 0
coluna = 0
soma_par = 0
soma_coluna3 = 0
maior_c... | true |
9ab7485c142dea162a0f202654570032071551a5 | Python | yurigsilva/modulo_introducao_python_e_programacao_python_full | /23_listas.py | UTF-8 | 87 | 3.078125 | 3 | [] | no_license | x = [1, 2, 3]
y = x
z = x.copy()
print(hex(id(x)))
print(hex(id(y)))
print(hex(id(z))) | true |
750cf2ba192a6334f69ef5c806dc015e0edb5e9e | Python | wlh320/shuaOJ | /AdventOfCode/2020/day21/21.py | UTF-8 | 1,287 | 2.6875 | 3 | [] | no_license | from collections import defaultdict
from copy import deepcopy
lines = open('input').readlines()
def split_input(line):
line = line.strip()
gres, als = line.split('(contains ')
gres = gres.split()
als = als[:-1].split(', ')
return gres, als
Gs = set()
As = set()
cnt = defaultdict(int)
for line in l... | true |
016d45ae3c7c74966b720b451ac9fb71ad6c953c | Python | pariyapariya/pariya_GW_HW_Python | /Part-1-Mini-Assignment/02-HW_CerealCleaner/solved_pariya/cereal_solved.py | UTF-8 | 348 | 3.03125 | 3 | [] | no_license | import os
import csv
cereal_csv = os.path.join('..','Resources', 'cereal.csv')
with open(cereal_csv) as csv_file:
csv_reader = csv.reader(csv_file)
next(csv_reader, None)
for x in csv_reader:
if float(x[7]) >= 5:
print(x[0] + ' has ' + x[7] + ' of Fibe... | true |
bb93f0b4b259da7469e20fe28f5cbf26b81530c3 | Python | kapilnegi67/PythonSeleniumDemo | /src/test_folder/raise_exception.py | UTF-8 | 226 | 3.53125 | 4 | [] | no_license | a = int(input("Enter a dividend: "))
try:
if a == 0:
raise ZeroDivisionError("Can not divide by number 0")
# raise ValueError("That is not a positive number!")
except ZeroDivisionError as ve:
print(ve) | true |
caec599dce7de63937b4de300c978a0ddb9a7960 | Python | fedebrest/curso_python | /Resoluciones/TP 3/simpson.py | UTF-8 | 264 | 3.953125 | 4 | [] | no_license | simpson=[]
cantidad=int(input("ingrese la cantidad de personajes que reconozcas: "))
for i in range(cantidad):
personaje=input("ingrese el nombre del personaje que reconozca: ")
simpson.append(personaje)
print("Los personajes reconocidos son:", simpson)
| true |
291fdf6e87e2c3189ec318e1b05408053a361058 | Python | chatterjeelab2022/VADER | /v2_plotting_tools.py | UTF-8 | 6,674 | 3.03125 | 3 | [] | no_license | import matplotlib.pyplot as plt
import numpy as np
import math
def heat_map(data, colormap, ** keywords):
# keywords
# colormap
# Title
# X_title
# Y_title
# X_labels
# Y_labels
# FigSize
return None
def scatter_plot(x_data, y_data, **... | true |
392304d39b990da1668bb8fc41a1a484e7e09a39 | Python | 17621251436/leetcode_program | /1数组/offer 矩阵中的路径.py | UTF-8 | 652 | 2.8125 | 3 | [] | no_license | class Solution:
def exist(self, board: List[List[str]], word: str) -> bool:
##不越界 访问了 与目标不匹配
def dfs(i,j,k):
if not 0<=i<len(board) or not 0<=j<len(board) or board[i][j]!=word[k]:
return False
if k== len(word)-1 :
return True
tmp... | true |
387097535d42180522d5336ce4efe33a721be3e9 | Python | gomkyungmin/KMTNet_MVC | /LoadData.py | UTF-8 | 2,892 | 2.609375 | 3 | [] | no_license | from os.path import dirname
from os.path import join
import numpy as np
from astropy.io import fits
from sklearn import preprocessing
class Bunch(dict):
"""Container object for datasets: dictionary-like object that
exposes its keys as attributes."""
def __init__(self, **kwargs):
dict.__init__(s... | true |
f4cefb05a7e40ea8e86ef22debee7f864960e933 | Python | NathanHenrySchneider/personalForFun | /CellularAutomata/brians_brain.py | UTF-8 | 4,738 | 2.984375 | 3 | [] | no_license | #Brian's Brain
import time
global on
on = 1
global dying
dying = 2
global off
off = 3
import colorama
import sys
import random
def print_finite_map():
str_prnt = ""
y = 0
while (y < y_bound + 1):
x = 0
str_prnt += " "
while (x < x_bound + 1):
chr_num = map_instance... | true |
120cc6b59c89cb9efbea5d955934a940ffd6f27a | Python | joaothomaz23/Basic_Python_Journey | /embaralha_string.py | UTF-8 | 302 | 3.953125 | 4 | [] | no_license | import random
def embaralhaString(a):
b = []
for i in range(0,len(a),1):
b.append(a[i])
random.shuffle(b)
c = ''
for i in range(0,len(b),1):
c = c + b[i]
return c
val = input('Entre com uma string aleatoria: ')
aux = embaralhaString(val)
print(aux)
| true |
002cb10ee3c772a3b05215a69ec734faf48b40b5 | Python | abpocklington/AtomSortingAlgorithms | /AlgorithmTest.py | UTF-8 | 2,297 | 3.015625 | 3 | [] | no_license | import BalanceCompressAlgorithm
import Snake
import Hungarian
import MakeBoolArray
import datetime
import xlsxwriter
import matplotlib
from Animator import Animator
# these are the 'settings'
title = "practice"
ArrayDim = 10
TargetDim = 'max'
trials = 1
LoadProbability = .6
algorithm = 2
RecordData =... | true |
3a6b789120ab1a4e5387bb370b5309770154f361 | Python | SlidingSteven/Portfolio | /NumericalAnalysis-lab1.py | UTF-8 | 2,222 | 3.953125 | 4 | [] | no_license | #!/usr/bin/env python3
#not sure if the shebang above is necessary but I want to be as thorough as possible
#Name: Steven Tucker
#Date: 9/12/19
arr = [ [1, 3, 2, 1, -2],
[4, 2, 1, 2, 2],
[2, 1, 2, 3, 1],
[1, 2, 4, 1, -1]]
# function to print the matrix from GeeksForGeeks https://www.g... | true |
debe494df348b2fcdd14ea5f636ec472005052a5 | Python | PexoDev/Python_2048 | /main.py | UTF-8 | 2,638 | 3.171875 | 3 | [] | no_license | import GameManager
from os import system
import random
from Block import Block
map = []
freeSpots = []
isGameOver = False
def clearMap():
for i in range(4):
m = []
for j in range(4):
m.append(None)
freeSpots.append((i, j))
map.append(m)
def generateBlocks(count):
... | true |
e7eba81e0f7c097c51bd2c9ef2218606d48d93dc | Python | NickYuu/Python-YouTube | /modles/item.py | UTF-8 | 2,450 | 2.53125 | 3 | [] | no_license | import re
import requests
from bs4 import BeautifulSoup
import youtube_dl
def find_search_content(name):
request = requests.get("https://www.youtube.com/results?search_query={}".format(name))
content = request.content
soup = BeautifulSoup(content, 'html.parser')
return soup
def find_page_content(sear... | true |
5949f2aab324a374a649f495ad2cf2d5398e630c | Python | vasilisbaltas/Customer-Risk-Profiling-and-Loan-Default-Prediction | /Data_Cleaning#1.py | UTF-8 | 3,706 | 2.828125 | 3 | [] | no_license | # -*- coding: utf-8 -*-
import pandas as pd
import numpy as np
################ checking the Loan_Attributes csv file ###################
loan_attributes = pd.read_csv('Loan_Attributes.csv')
### we will replace the NaNs in ACCSTARTDATE column with the values of FIRST_MONTH
### column since they... | true |
74e1b5e4877ca274f3e19b4614f66a4bd1cc12df | Python | nowa360/my_leetcode | /JulyChallenge/IslandPerimeter.py | UTF-8 | 1,941 | 4.0625 | 4 | [] | no_license | """
July 7 Challenge - 463. Island Perimeter
You are given a map in form of a two-dimensional integer grid where 1 represents land and 0 represents water.
Grid cells are connected horizontally/vertically (not diagonally). The grid is completely surrounded by water,
and there is exactly one island (i.e., one or more ... | true |
8f2a69eda834820102763a4e4eb8b08887f18e9c | Python | srinisekaran/anthrolink | /RF Detector/scripts/voltage_plot.py | UTF-8 | 166 | 2.796875 | 3 | [] | no_license | import matplotlib.pyplot as plt
voltage_data = open('values.txt').read().splitlines()
plt.ylabel('Voltage (V)')
plt.plot(voltage_data)
plt.ylim(0.8, 1.3)
plt.show() | true |
e79afffb7fbe4e215715cdddaa4758ac18aebd4e | Python | gariel/lazyetl | /etl/steps/file.py | UTF-8 | 1,131 | 2.71875 | 3 | [
"MIT"
] | permissive | import abc
import io
import os
from typing import List, Optional
from etl.common import StatefulStepController
class File(StatefulStepController, abc.ABC):
filename: str = ""
def __init__(self, mode: str):
super().__init__()
self.mode = mode
self.file: Optional[io.TextIOWrapper] = No... | true |
6ada8c884b99f653a0cecc8ed8c13848f7b4c824 | Python | Uthmanhere/RPiWorkshop | /face2.py | UTF-8 | 506 | 2.640625 | 3 | [] | no_license | import cv2
img = cv2.imread('league.jpg')
img_gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
haar_cascade_face = cv2.CascadeClassifier('/home/pi/opencv/data/haarcascades/haarcascade_frontalface_default.xml')
faces_rects = haar_cascade_face.detectMultiScale(img_gray, scaleFactor=1.1, minNeighbors=2)
print('Faces foun... | true |
75f80454c8d5eda2d3b17e33c04bfde4c795b562 | Python | 15327311512/driver-analysis | /Desktop/code/my_driving/gradient | UTF-8 | 1,854 | 2.890625 | 3 | [] | no_license | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Thu Mar 21 20:50:05 2019
@author: cyq
"""
## 1 gradient
'''
from sympy import S
from sympy.calculus import finite_diff_weights
if __name__ == "__main__":
g2 = x**2 + 3*y
l=g2.diff(x)
print(l)
'''
import scipy.io as scio
from sympy import s... | true |
777c7215714f43fa2dec1b299a3d76ef87f65b77 | Python | raviolican/HTML-Builder | /HTML-Builder.py | UTF-8 | 2,833 | 2.984375 | 3 | [] | no_license | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from mods import *
myObjects = {}
while True:
# Split the command
typedCMD = input("> ")
cmd = typedCMD.split(" ",1)
# Initiate table object and store it in the list
if(cmd[0] == "table"):
name = cmd.pop(1)
try:
myObject... | true |
d3b8a4db3ba671bc0a35e27c6d4568008f29dc6f | Python | prativadas/python-basics | /5. Chapter 5/07_sets.py | UTF-8 | 224 | 3.59375 | 4 | [] | no_license | n1 = input('number 1 is:')
n2 = input('number 2 is:')
n3 = input('number 3 is:')
n4 = input('number 4 is:')
n5 = input('number 5 is:')
my_set = {n1, n2, n3, n4, n5} # set always prints unique numbers
print(my_set) | true |
9d490c1b9a27d680e966b2d76a92389a93353d1c | Python | djanshuman/Algorithms-Data-Structures | /Hashing/Linear_Probing_Remove_modified.py | UTF-8 | 2,305 | 3.53125 | 4 | [] | no_license | '''
Created on 26-Jan-2021
@author: dibyajyoti
'''
''' Open Addressing method for Hashing . Below is the Linear probing implementation'''
def OpenAddressing(list1):
for i in range(0,len(list1)):
print(i ,"->",list1[i])
def hash_calc(key):
return key % len(list1)
def insert(key):
if(list1.c... | true |
10340763d2c2740bc07a38e15d93f50a58851813 | Python | Environmental-Informatics/building-more-complex-programs-with-python-aggarw82 | /program_7.1.py | UTF-8 | 1,010 | 4.15625 | 4 | [] | no_license | """ Program to generate a table of comparison for
own sqrt function vs math.sqrt()
Implementation of Exercise 7.1
Book: Think Python 2nd Edition by Allen B. Downey
Edition: 2e
Link: https://greenteapress.com/wp/think-python-2e/
"""
import math
def mysqrt(a):
x = a - 0.9 # initial guess for x
# calculate squa... | true |
e877b10abe8b7ed82d2603df89bba0c7db5eb348 | Python | jimmesh518/Python_beginner | /while.py | UTF-8 | 115 | 3.8125 | 4 | [] | no_license | for num in (1,13,11,45,35,25,):
if num % 2 == 0:
print("Even ",num)
else:
print("Odd ",num) | true |
9c62af5ea532c9859b224771374f5b1113546fdd | Python | RadkaValkova/SoftUni-Web-Developer | /Programming Fundamentals Python/08 Data Types and Variables Exercise/Print Part of the ASCII Table.py | UTF-8 | 166 | 3.765625 | 4 | [] | no_license | start_index = int(input())
last_index = int(input())
for i in range(start_index, last_index + 1):
current_symbol = chr(i)
print(f'{current_symbol}', end=' ') | true |
74edcdf95d9856fefdba675a458946b6643e3aad | Python | mkumarsgnr/python-reff | /divide apple.py | UTF-8 | 631 | 4.0625 | 4 | [] | no_license | try:
n = int(input("Enter the Number of Apples Harry has Got :"))
mn = int(input("\nEnter the Minimum Range :"))
mx = int(input("\nEnter the Maximum Range :"))
except ValueError:
print("Intiger values Only!")
exit()
if mx<mn:
print("Maximum value can not be less then Minimum!")
elif mx==mn:... | true |
40220aa94ff13233f90c0f5e491fb13e3d43de26 | Python | alexcrawford0927/rainonsnow | /7D_ChiSquareDistance_RelativeTrackDen.py | UTF-8 | 9,086 | 2.8125 | 3 | [] | no_license | '''
Author: Alex Crawford
Date Created: 24 Apr 2019
Date Modified: 31 May 2019 --> Added more parameterizaton
11 Jun 2019 --> Switch from absolute to relative measure of storm density for determining area of interest
4 Jul 2019 --> Make it relative
Purpose: Runs a chi-square distance tes... | true |
6c5a3fe050cbf818b7ef4badfd3c5d23e036df8c | Python | olanseverson/feature_detection | /feature_detection.py | UTF-8 | 5,256 | 2.671875 | 3 | [] | no_license | # -*- coding: utf-8 -*-
"""
Created on Mon Sep 30 11:50:31 2019
@author: olanseverson
https://realpython.com/python-logging/
https://pysource.com/2018/03/23/feature-matching-brute-force-opencv-3-4-with-python-3-tutorial-26/
https://www.life2coding.com/resize-opencv-window-according-screen-resolution/
https://computer-... | true |
02035e8430752e3cbf92cd1a7378754106c4ff0a | Python | jyu001/Old_LeetCode_Python_solutions | /085_maximal_rectangle.py | UTF-8 | 2,609 | 3.671875 | 4 | [] | no_license | """
Given a 2D binary matrix filled with 0's and 1's, find the largest rectangle containing only 1's and return its area.
For example, given the following matrix:
1 0 1 0 0
1 0 1 1 1
1 1 1 1 1
1 0 0 1 0
Return 6
"""
class Solution(object):
def maximalRectangle(self, matrix):
"""
:type matrix: Li... | true |
b4e1ef8f58b322c3b51abcd551159c9a75e03fa9 | Python | alinkak311/10- | /Домашняя работа/number_1_42.py | UTF-8 | 116 | 3.40625 | 3 | [] | no_license | a=int(input())
b=int(input())
c=int(input())
if a<=b>=c:
print(b)
elif b<=a>=c:
print(a)
else:
print(c)
| true |
19f792c1c691c43c8ad39cf80bf3a4a40a4400d1 | Python | Asurada2015/Python-Data-Analysis-Learning-Notes | /Pythontutorials/18_19class_demo.py | UTF-8 | 666 | 4.15625 | 4 | [
"MIT"
] | permissive | """讲解关于类的定义和使用"""
class Calculator:
name = 'Good calculator' # 固有属性,但是如果在init函数中被赋值的话则固有属性会被覆盖掉
price = 18
# 定义类的属性
def __init__(self, name, price, height, width, weight):
self.name = name
self.price = price
self.h = height
self.wi = width
self.we = weight
... | true |
00145335fc8519340b16ad2e287b4b9fc6ce8a06 | Python | Marllonviny/progr1ads | /Media1URI.py | UTF-8 | 190 | 3.203125 | 3 | [] | no_license | a = float(input(''))
b = float(input(''))
x = a * 3.5
y = b * 7.5
media = (x + y) / 11
media2 = 10
if media <= 10:
print('MEDIA = %.5f' % media)
else:
print('MEDIA = %.5f' % media2)
| true |