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
318a2010a96334b02dd4f61b014f3ff16741aec4
Python
leticiawanderley/aa
/presentinho/econ_brazil.py
UTF-8
192
2.921875
3
[]
no_license
#URI 1796 q = int(input()) v = list(map(int, input().split())) count = 0 i = 0 while count <= q/2 and i < q: if v[i] == 0: count += 1 i += 1 if count > q/2: print("Y") else: print("N")
true
256ffcbfaea13bb683b9a158bcb15baf97d15ed3
Python
KarmicCode/interview-seed
/create_tables.py
UTF-8
363
2.65625
3
[]
no_license
#!/usr/bin/env python3.4 """Create the database and ensure a row exists.""" from models import db, User def create_tables(): db.create_all() def ensure_user(): if User.query.count() == 0: jake = User('jake', 'jake@gmail.com') db.session.add(jake) db.session.commit() if __name__ == ...
true
b7487c434ad4a3e63f79fdc5420e7462fecc3423
Python
waverim/leetcode
/python/set-matrix-zeroes.py
UTF-8
1,650
3.890625
4
[]
no_license
""" 用矩阵第一行和第一列「存储」0: 1. 遍历第一行和第一列,如果有0则保存在两个bool变量中 2. 对整个表遍历,如果发现0,则其在第一行和第一列对应的位置置0 3. 再次遍历第一行和第一列,若出现了0,则置相应的行/列为0 4. 判断第一步中的变量,若变量为真,则将第一行/第一列置0 """ class Solution: # @param matrix, a list of lists of integers # RETURN NOTHING, MODIFY matrix IN PLACE. def setZeroes(self, matrix): row = len(matr...
true
41b678e50113d99f0b7ab67506669f1a23a20865
Python
kadulemos/Data-Science---Python
/Seaborn/data_visualization_seaborn.py
UTF-8
4,727
3.8125
4
[ "MIT" ]
permissive
# To add a new cell, type '# %%' # To add a new markdown cell, type '# %% [markdown]' # %% from IPython import get_ipython # %% [markdown] # <h2>Minerando Dados - Visualização de Dados</h2> # # **Trabalhando com Seaborn** # # * Biblioteca para visualização de dados baseado em MATPLOTLIB; # * Interface de alto nível ...
true
9725bbd3e14436b040e15422134ed0e232b64c65
Python
macbeez/CAP-5610_Machine-Learning
/Assignment_03/src/task1.py
UTF-8
3,401
3.09375
3
[]
no_license
import pandas as pd from sklearn import preprocessing from sklearn.naive_bayes import GaussianNB from sklearn import metrics from sklearn.neighbors import KNeighborsClassifier import nltk # needed for Naive-Bayes import numpy as np train_df = pd.read_csv("include/train2.csv") test_df = pd.read_csv("include/test2.csv")...
true
0b1d003b73fc610463183875e110f0dee53e15da
Python
cs-manughian/Python-Web-Server
/server.py
UTF-8
2,531
3.484375
3
[]
no_license
####################################################### # # Author: Cosima Manughian-Peter # Date: September 21, 2015 # Purpose: Develop a web server that handles one # HTTP request at a time. The web server # will accept and parse an HTTP request # message, get the requested...
true
e0b708838e22e975d639f2464d702c91b75a52ed
Python
pmachek/barcode
/src/stripes/font.py
UTF-8
4,443
3.03125
3
[ "MIT" ]
permissive
import re from os import path def repeat(it, coeff): for value in it: for _ in range(coeff): yield value class Font: def __init__(self, filename): self.characters = self.load_models(filename) sample_char = [[]] for character in self.characters.values(): ...
true
eeefcdb7eafa0e9eed55af2c0f3aad79cd631be5
Python
jasnaurbancic/NLPAssignment4
/pickleData.py
UTF-8
832
2.890625
3
[]
no_license
import pandas import pickle prefix = '../DOWNLOAD/twitter_download/' files = ['test.txt', 'test2.txt'] dfs = (pandas.DataFrame.from_csv(prefix + f, sep='\t', index_col=False, header = None) for f in files) data = pandas.concat(dfs, ignore_index=True) # Go over all the data and remove Not Available tweets data = dat...
true
87b4039a3fd5221ddb9e3759f62df0291100fe8a
Python
lcxx16/RecipeBot
/push.py
UTF-8
2,170
2.59375
3
[]
no_license
"""push.py * 日次(AM8:30)のJobプログラム * 賞味期限切れ商品の削除 * 賞味期限間近の商品の通知 """ from linebot import ( LineBotApi ) from linebot.models import ( TextSendMessage, FlexSendMessage ) from sqlalchemy.sql.functions import * from setting import * import datetime import os # LineApi YOUR_CHANNEL_ACCESS_TOKEN = os.envi...
true
657e9463f62ccd4d985edd1ba179ef724a815a1a
Python
willmadev/APCSP_Lab4
/26_PMCH.py
UTF-8
955
3
3
[]
no_license
## Problem 26 - PMCH (Perfect Matchings and RNA Secondary Structures) ## Willma ## 1/11/2021 ## http://rosalind.info/problems/pmch/ import resources class Node(): def __init__(self, nt): self.nt = nt self.basepair_edges = [] def __repr__(self): return self.nt def PMCH(rna_seq): ...
true
faf5cd81a5337b0c0b0c7e204bf8bee1a66a308f
Python
edysuardiyana/Staged-CC
/non_cascade.py
UTF-8
1,634
3.046875
3
[]
no_license
from collections import namedtuple import feature_extract import csv ARRAY_TUPLED = namedtuple('ARRAY_TUPLED', 'AXC AYC AZC GXC GYC GZC AVMC GVMC ANNOTCHEST ACTIVE_CHEST' ' AXT AYT AZT GXT GYT GZT AVMT GVMT ANNOTTHIGH ACTIVE_THIGH') def read_data(file_path): """ This functions read sa...
true
6bf3371eda9be884132e9a5b92ffc3234c36bc58
Python
CarVonDark/AutomaticBoat
/drive.py
UTF-8
840
2.625
3
[]
no_license
import RPi.GPIO as GPIO import time import os import sys def init(): GPIO.setmode(GPIO.BOARD) GPIO.setup(18, GPIO.OUT) # ENDB GPIO.setup(11, GPIO.OUT) # logic 1 GPIO.setup(13, GPIO.OUT) # logic 2 GPIO.setup(22, GPIO.OUT) # ENDA GPIO.setup(15, GPIO.OUT) # logic 3 GPIO.setup(2...
true
68eb698e439e9f8625df3a800ef9ae62ab28a163
Python
bonzai133/PiAtHome
/www/Charts_Solar.py
UTF-8
6,681
2.5625
3
[]
no_license
#!/usr/bin/env python # -*- coding: utf-8 -*- ''' Created on 8 déc. 2013 @author: laurent ''' from bottle import route, template import json import datetime from Charts_Authentication import * # route to historic @route("/prod_historic", apply=authenticated) def prod_historic(db): #Month names MONTHES_SHORT...
true
a0395e232d89878c4db452e43597e5657f94a67b
Python
Michelindoll/maeslantkering-project
/meetstation.py
UTF-8
214
2.703125
3
[]
no_license
import db import time def GetDataFromSensor(): SensorData = 3.00 return SensorData WaterLevel = GetDataFromSensor() Unixtime = int(time.time()) db.WriteSensorDataToDB(WaterLevel, Unixtime) time.sleep(60)
true
c64008f843fa9ea86a7401fb72ece367785911c6
Python
digitalladder/leetcode
/problem1438.py
UTF-8
1,335
3.625
4
[]
no_license
# problem 1438 / longest continuous subarray with absolute diff less than or equal to limit # heap def longestSubarray(self, A, limit): maxq, minq = [], [] res = i = 0 for j, a in enumerate(A): heapq.heappush(maxq, [-a, j]) heapq.heappush(minq, [a, j]) while -...
true
dd31426a37fd4fea92752319bb808788d7757d45
Python
alexandraback/datacollection
/solutions_5634697451274240_0/Python/MottyP/pancakeflip.py
UTF-8
391
3.203125
3
[]
no_license
import sys def solveCase(state): state += '+' return len([i for i in range(len(state)-1) if state[i] != state[i+1]]) def _doMain(): inp = sys.stdin ncases = int(inp.readline()) for cs in range(1, ncases+1): state = inp.readline().strip() flipnum = solveCase(state) print "Ca...
true
fba7e2027d11375dfbe9b970b552f41b251b415c
Python
vsanjorge/Dado-de-N-caras
/main.py
UTF-8
767
3.765625
4
[]
no_license
# Pequeño proyecto de prueba que lanza un dado de N caras, donde N es introducido por el usuario from random import choice import re # módulo para control de expresiones regulares dado = 0 validacion = r"[0-9]+" # expresión regular que vamos a estar comprobando en la entrada de datos del usuario while True: dado =...
true
a7c1cea71a370673927efa65fcf01c0eb20bf693
Python
USU-Team-Green/assn2
/task4/views.py
UTF-8
4,269
2.859375
3
[]
no_license
import tkinter from tkinter import filedialog from key_gen import generate_keys, encrypt, decrypt class View(): children = [] def clear(self): for child in self.children: child.destroy() class MainMenu(View): def __init__(self, master, go_keys, go_e, go_d): super().__in...
true
3bb0fb27a2950cc4434dcad321819cca9ac89b95
Python
AndrBecker/movie-trailer-website
/movie_trailer_website/entertainment_center.py
UTF-8
2,101
3.15625
3
[]
no_license
# This python script creates the media.Movie objects describing # the favourite movies and calls fresh_tomatoes open_movies_page # with the list of the movie objects (which generates the # fresh_tomatoes.html file and opens it in a webbrowser). # Import modules import media import fresh_tomatoes # Create...
true
fc4a38ec078f96fffc5ed076ff49aca5e1283126
Python
MandeepLamba/Python
/exp4.py
UTF-8
142
4.09375
4
[]
no_license
string = input("Enter String: ") if(string== string[::-1]): print("String is a Palindrome") else: print("String is not a Palindrome")
true
3346f6d130647f32818a2b4afcee9ac38cce489e
Python
laurent-dinh/fuel
/fuel/datasets/cifar10.py
UTF-8
1,558
2.828125
3
[ "MIT" ]
permissive
from fuel.datasets import H5PYDataset from fuel.transformers.defaults import uint8_pixels_to_floatX from fuel.utils import find_in_data_path class CIFAR10(H5PYDataset): """The CIFAR10 dataset of natural images. This dataset is a labeled subset of the ``80 million tiny images'' dataset [TINY]. It consists...
true
aa4d58a9c4f91404f08c396fa2e27588edaf24cf
Python
erdem6161/PythonInternshipProject
/staj.py
UTF-8
9,009
3
3
[]
no_license
import openpyxl, pprint, statistics from openpyxl.styles import Alignment print('Opening workbook...') wb = openpyxl.load_workbook('Notlar.xlsx') sheet = wb.get_sheet_by_name('BIL2001') studentData = [] print('Reading rows...') for row in range(1, sheet.max_row + 1): numara = sheet['A' + str(...
true
60c154f574482d15d502c3a3d80ac9ea009a75ad
Python
dnil/cg
/tests/apps/balsamic/test_fastqfilenamecreator.py
UTF-8
1,065
2.84375
3
[]
no_license
# -*- coding: utf-8 -*- """Test FastqHandlerBalsamic""" import re import datetime as dt from cg.apps.balsamic.fastq import FastqFileNameCreator def test_create(valid_fastq_filename_pattern) -> dict: """Test the method that creates balsamic file names for us""" # given we have all the necessary inputs to cre...
true
befdb9d75429ceaa80307b8254c1cce749dfd1e5
Python
albertowd/live-telemetry
/apps/python/LiveTelemetry/lib/lt_config.py
UTF-8
5,420
2.59375
3
[]
no_license
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Module to load and save app options. @author: albertowd """ from configparser import ConfigParser from math import floor from os import path from sys import exc_info from lib.lt_util import get_docs_path, log class Config(object): """ Singleton to handle config...
true
ac584c660425726e04abaad54c16cf90fbc81fc4
Python
dannyburrows/Scheduling
/website/main.py
UTF-8
42,077
2.875
3
[]
no_license
#!/usr/bin/env python import httplib2 import os import MySQLdb from apiclient import discovery from oauth2client import appengine from oauth2client import client from google.appengine.api import memcache from datetime import * import webapp2 import jinja2 ##############################################################...
true
751765906ef7c6b27e702bff165285826fac1486
Python
ChenYingpeng/pl-siim-covid19-detection
/src/loss/taylor_loss.py
UTF-8
3,384
3.015625
3
[ "MIT" ]
permissive
''' Copy from https://github.com/CoinCheung/pytorch-loss/blob/d76a6f8eaaab6fcf0cc89c011e1917159711c9fb/pytorch_loss/taylor_softmax.py#L44 ''' import torch import torch.nn as nn import torch.nn.functional as F ''' proposed in this paper: [Exploring Alternatives to Softmax Function](https://arxiv.org/pdf/2011.11538.pdf)...
true
f6263600549b320d7d617834fefc212ebbff5dd2
Python
TOnodera/python-topological-sort
/src/__tests__/linked_list_test.py
UTF-8
226
3.09375
3
[]
no_license
from linked_list import LinkedList def test_データの挿入と削除が出来る(): list = LinkedList() for i in range(10): list.insert(i, i*2) for i in range(10): assert list.index(i*2) == i
true
818d2310bfd45a2b1ec4f36baeb38caf24a191da
Python
letsmakeadeal/SinglePersonKeypoints
/pipeline/losses.py
UTF-8
1,246
3.09375
3
[]
no_license
import torch from torch import nn class L1Loss(object): def __init__(self): pass def __call__(self, predicted: torch.tensor, gt: torch.tensor): return torch.abs(predicted - gt).mean() class MSELoss(object): def __init__(self): self._mse_loss = nn.MSELoss(reduction='mean') d...
true
c5d1752ecaf2a8d92509e2f799ad71864066690f
Python
leeiopd/algorithm
/before2021/python/day19_SW응용2_problem/3_컨테이너운반.py
UTF-8
1,971
3.40625
3
[]
no_license
''' 화물이 실려 있는 N개의 컨테이너를 M대의 트럭으로 A도시에서 B도시로 운반하려고 한다. 트럭당 한 개의 컨테이너를 운반 할 수 있고, 트럭의 적재용량을 초과하는 컨테이너는 운반할 수 없다. 컨테이너마다 실린 화물의 무게와 트럭마다의 적재용량이 주어지고, A도시에서 B도시로 최대 M대의 트럭이 편도로 한번 만 운행한다고 한다. 이때 이동한 화물의 총 중량이 최대가 되도록 컨테이너를 옮겼다면, 옮겨진 화물의 전체 무게가 얼마인지 출력하는 프로그램을 만드시오. 화물을 싣지 못한 트럭이 있을 수도 있고, 남는 화물이 있을 수도 있다. 컨테이너...
true
d940f6a44b553d26260c93f27213ae22cc3f427c
Python
Akshay-a-j/100DaysofCode
/Machine Learning/Regression/LinearRegression.py
UTF-8
3,133
3
3
[]
no_license
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Sat May 8 11:25:13 2021 @author: sysad """ import numpy as np import pandas as pd import matplotlib.pyplot as plt import seaborn as sns from sklearn.model_selection import train_test_split from sklearn import preprocessing, linear_model, metrics #%% Read...
true
fe81208ebbc945aef6057b5f1002422d830b35a4
Python
euatreyu/m-society
/ex018_Sen_Cos_Tan.py
UTF-8
371
4.6875
5
[]
no_license
#Leia um ângulo qualquer e mostre na tela seu Seno, Cosseno e Tangente desse ângulo from math import sin, cos, tan, radians angulo = float(input('Digite o ângulo que deseja: ')) seno = sin(radians(angulo)) coss = cos(radians(angulo)) tng = tan(radians(angulo)) print(f'O ângulo {angulo} tem como SENO {seno:.2f}, s...
true
3c59e3b60cc0a36ba3bceca47073dd0e9e385b30
Python
dani-fn/Projetinhos_Python
/aulas/AULA#20-funções1.py
UTF-8
383
4.0625
4
[ "MIT" ]
permissive
from random import randint def mensagem(txt): """ :param txt: :return: """ print('-' * 16) print(txt) print('-' * 16) def soma(a, b): print(f'A = {a} e B = {b}') s = a + b print(f'A soma A + B = {s}') mensagem(input('Escreva algo: ')) # a = randint(1...
true
4d75ed9a3279155f79e385db259557bb89407b0f
Python
philsson/AdventOfCode
/2019/1/1.py
UTF-8
631
3.9375
4
[]
no_license
#!/usr/bin/env python # -*- coding: utf-8 -*- import math def calc_fuel(mass: int, recurse: bool) -> int: fuel = 0 while True: mass = max(math.floor(mass / 3) - 2, 0) fuel += mass if mass == 0 or recurse is not True: return fuel if __name__ == '__main__': fuel_a, fu...
true
d6cb276094a3d80921415df77672c4310f5b91fb
Python
22Lorenl/Space-Invaders-1
/space_invader.py
UTF-8
1,987
3.28125
3
[]
no_license
# print("Hello World") # Turtle = 500 # Cookies = Turtle # Turtle + Cookies from tkinter import * import time import random tk = Tk() tk.title("Ball Paddle Game") tk.resizable(0, 0) tk.wm_attributes("-topmost", 1) canvas = Canvas(tk, width=500, height=400, bd=0, highlightthickness=0) canvas.pack() tk.update class Bal...
true
fc5c3c6eb2c0854a85c56dd4c6ded30db60551e4
Python
sgupta25/IT-Academy-2019
/Lab2-4-Gupta.py
UTF-8
413
3.828125
4
[]
no_license
# Sarvesh Gupta # Car salesman program # 8/31/2019 def fullCarPrice(carPrice): tax = carPrice * .075 DL = carPrice * .05 dealerPrep = 500 destCharge = 1200 fullPrice = carPrice + tax + DL + dealerPrep + destCharge return fullPrice carPrice=input('What is the base price of the...
true
c15f0b695ee030bf8351df4a0b3091ab12684f43
Python
theirfanirfi/flask-book-exchange-apis
/application/BusinessLogic/cpanel/CategoriesBL.py
UTF-8
853
2.609375
3
[]
no_license
from application import db from application.Models.models import Categories class CategoriesBL: def add_category(self, form): cat = Categories.query.filter_by(cat_title=form.cat_title.data) if cat.count() > 0: return False, 'Category already exists' cat = Categories() cat.cat_title = form.cat_title.data ...
true
2456dbe97e2591b0167c816d0f0e69087359c3a1
Python
Jinholy/python
/17/2.py
UTF-8
356
2.984375
3
[]
no_license
cost_red = [] cost_green = [] cost_blue = [] ipt = int(input()) cmd_lst = [] for i in range(ipt): r, g, b = map(int, input().split(' ')) cost_red.append(r) cost_green.append(g) cost_blue.append(b) def get_lowest_cost(n, color): r = cost_red[i] g = cost_green[i] b = cost_blue[i] last_colo...
true
3363d348e0744dd2d88e41161385805f54af3804
Python
hayam8/SmartHomeManagementSystem
/fakesensor/fakesensor.py
UTF-8
4,747
3.0625
3
[]
no_license
import paho.mqtt.client as mqtt import random import threading import json from datetime import datetime """ This class is used to simulate a DHT22 sensor which sends humidity and temperature data to the gateway. The sensor data is randomly generated. When an instance of DHT22 is created, it takes the parameters of gat...
true
e221d492c2cfb595009de16162354e66ac3adbff
Python
gbjuno/data_structure_and_algorithms_in_python
/chapter1/r-1.5.py
UTF-8
68
3.203125
3
[]
no_license
for i in [1,2,3,4,5,6,7,100]: print sum(x**2 for x in range(i))
true
63cdaba888f59acb0936d7a541454dca467a4183
Python
jhernandez10/CompareAnswers
/compareAnswers.py
UTF-8
1,915
3.765625
4
[]
no_license
import sys #prints out results of the comparison def reportStats(error,line_counter,report): report.write("#####################################\n") line_info = "Lines Compared: " + str(line_counter) + "\n" error_info = "Errors Found: " + str(error) + "\n" report.write(line_info) report.write(error_info) #compar...
true
683c48c0c128ba5aa4c961c979c2ad8468b26cc8
Python
hirwaraissa/PythonProject
/Valeur max.py
UTF-8
110
3.21875
3
[]
no_license
def fact(n): a=0 n=int(input('Entrez un nombre: ')) for z in range(n,1): a=n*z fact('n')
true
eb450bffc4380ad6d276c0cc74ac616f54b44638
Python
zhihuicRepo/pytest
/cmdb_jump.py
UTF-8
5,162
2.59375
3
[]
no_license
#!/usr/bin/env # _*_coding:UTF-8_*_ __Author__ = "kaiz" import os,sys,re,requests def get_appid(): res = requests.get('http://cmdb.xxxxx.com/api/App/getapplist') list_app = res.text.split(",") list_app_dst = filter(lambda x:re.search("ApplicationID",x),list_app) list_app_dst = map(lambda x:re.search('\d+',x)...
true
195db45f249e32b72d7b750ac472c9bb37e2e7a6
Python
isabellabvo/Design-de-Software
/Progressão Aritmética e Progressão Geométrica.py
UTF-8
749
3.9375
4
[]
no_license
#---------ENUNCIADO---------# ''' Escreva uma função que recebe uma lista de números e devolve "PA", se ela for uma progressão aritmética, "PG", se for uma progressão geométrica, e "NA" se não for nenhuma das duas. Caso a sequência seja tanto uma PA quanto uma PG, devolva "AG". O nome da sua função deve ser verifica_...
true
c8c17f8722b211a4318eba480d3aacdf5753547a
Python
mikwit/adventofcode
/lwhite17/2021/Day6/Day6.py
UTF-8
2,053
3.28125
3
[]
no_license
import numpy as np def load_txt(filename, sep=None, ignore_empties=True, convert_to_type=None): if sep is None: sep = '\n' with open(r'' + filename, 'r') as f: results = f.read().split(sep) if ignore_empties: for element in results: if len(element) == 0: ...
true
8eed35110de64b8192c7cb58a13bcc32efc35d67
Python
daniel-reich/turbo-robot
/fTXXkQ7bfuQDjgNyH_24.py
UTF-8
935
4.03125
4
[]
no_license
""" Each year has 365 or 366 days. Given a string `date` representing a Gregorian calendar date formatted as `month/day/year`, return the _day-number_ of the year. ### Examples day_of_year("11/16/2020") ➞ 321 day_of_year("1/9/2019") ➞ 9 day_of_year("3/1/2004") ➞ 61 day_of_year("12/31...
true
2dcce91e4b81da7ca31879dc584de1ed820dce54
Python
emmett-shang/my-pandas
/list_index.py
UTF-8
937
3.03125
3
[]
no_license
random = ['Messi','Pele','Maradona','Ronaldinho','Ronaldo'] index = random.index('Messi') print("The index of Messi is:", index) random.append('Zidane') print('Updated list: ', random) random_2 = ['Modric', 'Griezemann', 'Neymar ', 'Salah', 'Suarez','Kane', 'Hazard'] random.extend(random_2) print('random list:', ran...
true
442bc049aad0575c5f9312f4e1e95e8674992ece
Python
tansir1/ReverseAStar
/src/reverseastar/model.py
UTF-8
10,001
3.515625
4
[]
no_license
import random import copy class WorldCell(object): ''' Simple structure to hold the row and column coordinates of a world grid cell. ''' def __init__(self): self._row = -1 self._col = -1 self._isObstacle = False self._distTraveled = 0.0 self._pathCost = ...
true
e4c092e60549b1f793eb6516ff7eaa59fa3eb3d6
Python
lucasliano/Candidate-Test-NovoSpace
/solution/ejercicio_1/main.py
UTF-8
14,023
2.84375
3
[]
no_license
from nmigen import * from nmigen_cocotb import run import cocotb from cocotb.triggers import RisingEdge, FallingEdge, Timer from cocotb.clock import Clock from random import randrange from bitstring import BitArray # Used external module! pip install bitstring class Stream(Record): def __init__(self, width, ...
true
b8eddba34e7ebe46bb1d156050f33b32642ac3a6
Python
SatyamJindal/Competitive-Programming
/CodeChef/Chef and Socks.py
UTF-8
130
2.96875
3
[]
no_license
jc,sc,mo = [int(i) for i in input().split()] if(((mo-jc)//sc)%2==1): print('Unlucky Chef') else: print('Lucky Chef')
true
ccdb04592fcd22f73c7798bbc1d6fbdbf601f05d
Python
Cienxia/WebTour
/WebTour/com/hpeu/WebTours/Order.py
UTF-8
1,467
2.53125
3
[]
no_license
import unittest import time from com.hpeu.WebTours.Flight import Flight from selenium import webdriver from com.hpeu.Tools.ReadFile import ReadFile from com.hpeu.Tools.GetScreenshot import GetScreenshot class Order(unittest.TestCase): def setUp(self): self.driver = webdriver.Firefox() self.getValue=...
true
ff1cab711acff8022bb3665ddd03d51ac4c89417
Python
beepboop-tech/theGarrison
/src/Trolley.py
UTF-8
2,182
3.1875
3
[]
no_license
from abc import ABC, abstractmethod from Stepper import Stepper import constants class Trolley(): def __init__(self, stepper=Stepper(), homePosition=constants.HOME_POSITION): self.stepper = stepper self.homePosition = homePosition self.observers = [] def reset(self): s...
true
31d906ec549fbae75c01d237720ceabf403a291d
Python
fmoctezuma/notetags
/notetags/util.py
UTF-8
3,012
3.34375
3
[ "MIT" ]
permissive
# -*- coding: utf-8 -*- import glob import os import re from builtins import any as b_any from collections import Counter # Core Data-Gathering def get_files(path, extensions): """ Returns a set of files as discovered recursively in the provided config_path, so long as it matches the allowed file ext...
true
7d2ddb72a4826f594473780b0ee3ec1ddd343eb1
Python
lonelyarcher/leetcode.python3
/stack_Equation.py
UTF-8
1,421
3.890625
4
[]
no_license
''' 给你一个string和x的value让你解出y的值 比如'2x - ((x - (3x + 1) + 2) + 3) + 4 = x + y' ''' def caculate(s, xVal): l, r = s.split('=') al, bl, cl = processOneSide(l) ar, br, cr = processOneSide(r) return (cr - cl + (ar - al) * xVal) / (bl - br) def processOneSide(s): a, b, c = 0, 0, 0 tmp = 0 cur_sign...
true
c0374ab03d3d1b916e93c1932dca05559acd6fa2
Python
DavidLittleRock/LogDavidWeather
/MQTTApp.py
UTF-8
6,051
2.6875
3
[]
no_license
# This will communicate with Mosquitto, # and write into # main and short datatable import pymysql as mdb import paho.mqtt.client as mqtt import time import logging import Settings import OneDay import OneWeek import OneMonth import OneDayA import OneWeekA import OneMonthA import TestGraph import gc from matplotlib i...
true
812c496b02865ffc3d22be571343c1ed5869b47d
Python
RoHawks/InnovationChallenge2021
/OriginalRetroZoom/logger.py
UTF-8
2,907
2.953125
3
[ "MIT" ]
permissive
import datetime import json import os import time import math ISO_8601 = '%Y-%m-%d %H:%M:%S.%f' class Logger: def __init__(self, limt=.25): self.time_data = {'Daily_limt': limt*60, 'Start_Date_Time': None, 'End_Date_Time': None, 'Time_Spent': 0} self.emotion_data = { ...
true
8dd74ded6fc89bded5b8722169622b38908c75bf
Python
mebinjohnson/Basic-Python-Programs
/Library OLd/Library - Graphical - Copy/0 Main.py
UTF-8
2,085
3.09375
3
[]
no_license
from Functions import * from Tkinter import * from ttk import * def bookissue(): execfile( "1 Book Issue.py") def bookdeposit(): execfile( "2 Book Deposit.py") def adminmenu(): execfile( "3 Administrator Menu.py") #___________________________________________________________________________________________...
true
ff9a8c472f987ffcd7da8e1f7f82158b23f54230
Python
automl/learna
/src/analyse/process_data.py
UTF-8
4,111
2.796875
3
[ "Apache-2.0" ]
permissive
import pandas as pd import numpy as np import scikits.bootstrap as sci def time_across_length(runs, ids, times, sequence_lengths): df_min = pd.DataFrame({"run": runs, "time": times}, index=ids) df_min = df_min.pivot(index=df_min.index, columns="run")["time"] df_min = df_min.min(axis=1) df_min = pd.Dat...
true
31489b6b2ef15d06ca761d8a9d0ed3b27a2a0432
Python
Occulow/utility
/grideye_test/create_mp4.py
UTF-8
886
2.78125
3
[ "MIT" ]
permissive
# Creates <csv_file_name>.mp4 import sys import numpy import matplotlib matplotlib.use("Agg") import matplotlib.pyplot as plt from matplotlib import animation def main(): if len(sys.argv) < 2: print "Usage ./plot.py <csv_file_name>" metadata = dict(title="animation", artist="Occulow") FFMpegWriter = animat...
true
054904a8b76812a5e0d7d112283d8ce0d0daeccb
Python
pvela23/EdurekaPython
/M7/CS2.py
UTF-8
1,770
2.875
3
[]
no_license
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Tue Sep 4 14:37:06 2018 @author: amit """ # Importing libraries import numpy as np import pandas as pd import matplotlib.pyplot as plt plt.rcParams['axes.labelsize'] = 14 plt.rcParams['xtick.labelsize'] = 12 plt.rcParams['ytick.labelsize'] = 12 # to make ...
true
11bcaa54aba9b5e3182722d71cb30ab3b2500e89
Python
MinksChung/BigdataCourse
/Big46/main.py
UTF-8
2,315
3.03125
3
[]
no_license
from urllib import request from bs4 import BeautifulSoup import 네이버뮤직.file_save as file import 네이버뮤직.db_save as insert import 네이버뮤직.select as select ########################################################################################### # file_save함수, insert함수 호출 file.naverMusic() ####################...
true
15e0ee2f45555a22f615fc648c21f5af151ce113
Python
jihoonyou/problem-solving
/programmers/문자열 다루기 기본.py
UTF-8
334
3.4375
3
[]
no_license
''' 문자열 다루기 기본 https://programmers.co.kr/learn/courses/30/lessons/12918 ''' def solution(s): if len(s) ==4 or len(s) == 6: for char in s: if ord('0') > ord(char) or ord('9') < ord(char): return False return True return False # return s.isdigit() and len(s) in (4, 6)
true
0c6b79fb580b473c555eeeca79241c9a8fae8c93
Python
luismi31/thethingsIoT
/cloudConnector.py
UTF-8
516
2.96875
3
[]
no_license
from thethings import ThethingsAPI class thethings: def __init__(self,token): self.connector = ThethingsAPI(token) def sendData(self,name,value): try: self.connector.addVar(name, value) self.connector.write() print 'SENT DATA TO THINGS.IO' ...
true
9c495fd5c759b7bf208001fecdf6ad82f4e83a55
Python
afcarl/google-research
/aqt/jax/flax/struct.py
UTF-8
5,704
2.71875
3
[ "CC-BY-4.0", "Apache-2.0" ]
permissive
# coding=utf-8 # Copyright 2021 The Google Research Authors. # # 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 applicab...
true
edc7029a70212bcf9458ab884f50e15abd4e60b3
Python
ramonsolis159/csc1010
/csc1010_Pycharm_Projects_Python/admin.py
UTF-8
1,580
3.0625
3
[]
no_license
from user import User class Admin(User): """Represents the special kind of user""" def __init__(self, first_name, last_name, age, location): """Initialize the different attributes""" super().__init__(first_name, last_name, age, location) self.privileges = Privileges() class Privilege...
true
d821e248276cda12caa8291da6346d77ae7adb64
Python
byunli/python
/1029test.py
UTF-8
1,398
2.953125
3
[]
no_license
import requests from datetime import datetime, date, timedelta from bs4 import BeautifulSoup resp = requests.get('https://data.taipei/api/v1/dataset/89027714-a61a-485d-9abc-b8fca186e9fc?scope=resourceAquire') dictData = resp.json() for data in dictData["result"]["results"]: nowYear = data["年月別"].split("年")[0] ...
true
9487449fb9f5d9c3cc71ef1c63642f12bfd28462
Python
psotresc/Asi-Se-Siente-Mi-Barrio
/AssmbMainCode.py
UTF-8
5,841
2.59375
3
[]
no_license
#! /usr/bin/env python #Programa desarrollado por Pablo Sotres para el proyecto Asi se siente mi Barrio #Este fue un cambio importante # Todo esta conectado de la siguiente manera: ## Relays: 2(5V), 38(20) y 40(21) Relays ## RFID: 1(3.3), 6(GND) 19(MOSI),21(MISO),23(SCK), 24(SDA) ## Boton Rei: 7(4), 17(3.3) ## Boton...
true
fa818cb749684d241ec9dca1146e0a27ccad85b4
Python
ll0221/python-test
/5-myself/4-test.py
UTF-8
273
3.28125
3
[]
no_license
#!/usr/bin/env python #-*- coding:utf8 -*- __metaclass__ = type class Person(): def __init__(self,name): self.name = name def getName(self): #return self.name return girl.name girl = Person("canglaoshi") name = girl.getName() print name
true
bc02465f4342aaa3cb848edac5d36c511fcbd520
Python
dsvargas/Progra-I-Taller
/Logica.py
UTF-8
3,438
3.265625
3
[]
no_license
__author__ = 'Dylana' # Nombre: Dylana Sancho # Fecha de entrega: 17-09-2014 # horas de trabajo: tipovariable = {"num":"int", "deci": "float", "letter": "str", "V": "True", "F": "False"} Condicionales = {'si': 'if', "sifi": "elif", "sino": "else"} Bucles = {"mientras": "while", "hagase": "for"} Funciones = {"impri...
true
c46d936a4639daee6b5ec317518ca3d58b43c840
Python
Gon41/FINAL-PROYECT-APP-for-Accommodation-in-Madrid
/funciones_AIRBNB.py
UTF-8
2,597
3.25
3
[]
no_license
import pandas as pd import numpy as np import re from unicodedata import normalize from haversine import haversine, Unit ##### FUNCIÓN 4: BÚSQUEDA DE PISOS ##### def busquedas_piso(distrito, kind, min_price, max_price, minimum_nights,number_reviews): data = pd.read_csv("listings.csv") # Filtro...
true
d5e54e86f150aabcec5b9771b283df501708eaaa
Python
tijugeorge/Movie-trailer-website
/mindstorms.py
UTF-8
712
3.640625
4
[]
no_license
import turtle def draw_figures(): window = turtle.Screen() window.bgcolor("aquamarine2") brad = turtle.Turtle() brad.shape("turtle") brad.color("red") #https://www.tcl.tk/man/tcl8.4/TkCmd/colors.htm brad.speed(1) for i in range(4): brad.forward(100) brad.right(90) george = turtle.Turtl...
true
a5d85d3c9acac514bad9fe5e57ae817778d89791
Python
redyeti/bitsandbites
/stage2/lang/wiktionary/__init__.py
UTF-8
2,011
2.84375
3
[ "MIT" ]
permissive
import urllib2, urllib from lxml import etree import db TOS_CATEGORIES = { "Category:English verbs": "VB", "Category:English plurals": "NNS", "Category:English nouns": "NN", "Category:English adjectives": "JJ", "Category:English adverbs": "RB", "Category:English present participles": "VBG", "Category:English th...
true
898835777e6ca391c11d3342781b2cc26424404f
Python
paneldata2015/Blockchain-Data-Trading
/seller.py
UTF-8
2,719
2.703125
3
[]
no_license
from math import ceil import base64 import os from blockchain import MinimalBlock, MinimalChain from random import randint from Crypto.Cipher import AES from cryptography.hazmat.primitives.ciphers import Cipher, algorithms, modes from cryptography.hazmat.backends import default_backend backend = default_backend() # ...
true
b435c2ce123b441dea47ee912d6d78ac28dc0938
Python
qq1197977022/learnPython
/itcast/02_python核心编程/02_linux系统编程/day02_线程/demo12_多线程不共享局部变量.py
UTF-8
416
3.421875
3
[]
no_license
import threading import time def fun(): num = 100 t_name = threading.current_thread().name if t_name == 'Thread-1': num += 1 else: time.sleep(2) print(f'{t_name:->30}{num:->30}') if __name__ == '__main__': t1 = threading.Thread(target=fun) t1.start() t2 = threading.T...
true
57b5f0b13cf4859d980e52d44b49d8b6df1262e0
Python
joepbasile/CS115
/lab2.py
UTF-8
2,247
3.453125
3
[]
no_license
''' Created on Sep 12, 2018 I pledge my honor that I have abided by the Stevens Honor System. @author: Joseph Basile username: jbasile1 ''' from cs115 import map, range, reduce def add(x,y): """this will take integer x and y as input and output he sum of x+y""" return x + y def dot(L, K): "...
true
737b903215503b09aa833a33faba1e08262fd65a
Python
nguyntyler/Projects
/EscapeGame/Escape.py
UTF-8
34,196
3.0625
3
[]
no_license
from random import randint import random from os import system, name import time from subprocess import call import os class Mob: def __init__(self): self.health = 10 self.damage = 4 self.max_health = 10 def get_hit(self, enemy): self.health -= enemy.damage if self.hea...
true
87cd4dcda97cd65686b189658c42bb28e3ef82f3
Python
vaaniek/The_Weather_App
/weather_callings.py
UTF-8
1,291
3.421875
3
[]
no_license
import http.client import json #api key: 200fc5f09a8b7dbdcaba9696e065a971 class Weather(): def __init__(self,datetime,temp): self.datetime=datetime self.temp=temp def current_weather_data(cityname): conn=http.client.HTTPSConnection("api.openweathermap.org") conn.request("GET",...
true
cb4961d51962f6d599d952eab3d6ac2c3039beed
Python
freeskyES/ML-study
/gradientDescent/logistic_regression.py
UTF-8
2,113
3.21875
3
[]
no_license
import tensorflow.compat.v1 as tf tf.disable_v2_behavior() tf.set_random_seed(777) x_data = [[1, 2], [2, 3], [3, 1], [4, 3], [5, 3], [6, 2]] y_data = [[0], [0], [0], [1], [1], [1]] X = tf.placeholder(tf.float32, shape=...
true
662c721137b92a1329c55832eb97e40310b08ec8
Python
alfiya400/kaggle-rain
/preprocess.py
UTF-8
8,210
2.78125
3
[]
no_license
__author__ = 'alfiya' import csv import pandas as pd import numpy as np import time import cPickle from joblib import Parallel, delayed NAN = np.array([-99900.0, np.nan, -99903.0, -99901.0, 999.0]) # values corresponding to nan HYDROMETEOR_TYPE = { 0: "no_echo", 1: "moderate_rain", 2: "moderate_rain", ...
true
3c717ba6c8f10a01dc298420865127c3f6cfe34e
Python
thijsishiernietgoedinaarts/prog
/p.3.19.py
UTF-8
112
3.015625
3
[]
no_license
import math a, b, c = 3, 4, 5 if a < b and c < b and (a + b )== c: print('ture') else: print('not oke')
true
ba2878ecfad6faf18d6925db35af962073f7f87d
Python
Hee-Jae/Algorithm
/kakao_codingtest/2022-2cha/main.py
UTF-8
5,513
2.578125
3
[]
no_license
# 외부소스 출처 : https://github.com/kswamen/2021_kakao_2nd_bike_management_simulation import requests import json from collections import defaultdict BASE_URL = "https://huqeyhi95c.execute-api.ap-northeast-2.amazonaws.com/prod" AUTHORIZATION = '' N = 30 TIME = 0 waiting_queue = defaultdict(list) # 유저 티어에 따른 대기열 {티어 : (id,...
true
998da1936a3b1c3302fe06c336438d99130f48d0
Python
protocollabs/dmpr-simulator
/dmprsim/simulator/models.py
UTF-8
3,877
2.828125
3
[ "MIT" ]
permissive
import functools import logging import math import random class TimeWrapper(object): """ Global Time object, needed for patching the logger """ time = 0 def patch_log_record_factory(): default_record_factory = logging.getLogRecordFactory() def patch_time_factory(*args, **kwargs): re...
true
785f11ab05befbaf8dfb15cc041ef74ed87e1cce
Python
programhung/learn-python
/xcv.py
UTF-8
322
4.15625
4
[]
no_license
print("Input a number from 1 to 7") x=input() x=int(x) if x==1: print("1-Sunday") elif x==2: print("2-Monday") elif x==3: print("3-Tuesday") elif x==4: print("4-Wednesday") elif x==5: print("5-Thursday") elif x==6: print("6-Friday") elif x==7: print("7-Saturday") else: print(str(x)+" is not between 1 and 7.") ...
true
19f12e8c5964f8eeb786f62da1df46e24ce74169
Python
pyvista/pyvista
/pyvista/core/utilities/features.py
UTF-8
16,418
2.953125
3
[ "MIT" ]
permissive
"""Module containing geometry helper functions.""" import collections.abc import os import sys from typing import Sequence import numpy as np import pyvista from pyvista.core import _vtk_core as _vtk from .helpers import wrap def voxelize(mesh, density=None, check_surface=True): """Voxelize mesh to Unstructur...
true
74a2b4c11fa3d51d55603e6ee4f355e3be787ea7
Python
tophensen/PACMAN
/pacman/model/partitioned_graph/partitioned_graph.py
UTF-8
11,030
2.921875
3
[]
no_license
# pacman imports from pacman.exceptions import PacmanInvalidParameterException from pacman.exceptions import PacmanAlreadyExistsException from pacman.utilities.utility_objs.ordered_set import OrderedSet from pacman.utilities.utility_objs.outgoing_edge_partition \ import OutgoingEdgePartition # general imports impo...
true
d551cbbffed6d1806f45c2cbfbe525a66884493a
Python
saeedzou/Flight-Fare-Prediction-MH
/Flight Fare Prediction MH/Flight_flare_Test.py
UTF-8
1,692
2.578125
3
[]
no_license
import pandas as pd import lightgbm #%% # Preprocessing df = pd.read_excel('Test_set.xlsx', engine='openpyxl') df = df.dropna() df = df.drop(columns=['Additional_Info', 'Route'], axis=1) df['Dep_H'] = df.apply(lambda x: int(x['Dep_Time'].split(':')[0]), axis=1) df['Dep_M'] = df.apply(lambda x: int(x['Dep_Time...
true
73a692a1b0d705adf6053381b1e7f4955466c2f7
Python
Madrich-routes/routes_laboratory
/algorithms/construction_heuristics/tsp.py
UTF-8
5,063
2.828125
3
[]
no_license
import random from itertools import combinations from random import randrange, choice import numexpr as ne import numpy as np from blist._blist import blist from scipy.sparse.csgraph._min_spanning_tree import minimum_spanning_tree from data_structures.unionfind import UnionFind from utils.types import Array # TODO:...
true
1c2e9ee1079f434e9bc834588f6e262e18f49add
Python
rikukawamura/algo
/動的計画法/2次元の動的計画法/Q2-3.py
UTF-8
673
2.59375
3
[]
no_license
def int_sp(): return map(int, input().split()) def li_int_sp(): return list(map(int, input().split())) def trans_li_int_sp(): return list(map(list, (zip(*[li_int_sp() for _ in range(N)])))) import pdb N = int(input()) A = [li_int_sp() for _ in range(N)] dp = [[0]*3 for _ in range(N)] for i in range(3):...
true
d078a8b6215f0459a5e4708290ef5cad6c59fe58
Python
huazhige/EART119_Lab
/hw1/late/sheridanzachary_late_33570_1251242_Problem_1.py
UTF-8
786
4.3125
4
[]
no_license
# -*- coding: utf-8 -*- """ 1. Write a program that computes the area of a rectangle (A=b*c) and the area of a triangle (A = 0.5*hb*b). The input of your function will be b and c for the rectangle and hb and b for the triangle. """ import numpy as np A_rect = 0 #Area of Rectangle A_tri = 0 #Area of Trian...
true
35e7f227da88c58abcc280859d046b967f498e6b
Python
Sverber/v4_py38
/utils/models/cycle/Discriminator.py
UTF-8
2,054
2.65625
3
[]
no_license
import torch import torch.nn as nn import torch.nn.functional as F class Discriminator(nn.Module): """ Discriminator network of the GAN """ def __init__(self, in_channels: int, out_channels: int): super().__init__() self.in_channels = in_channels self.out_channels = out_channels ...
true
535499842df0eaba43f7ad4a735eb49db7dc656a
Python
zronghui/hello
/helloDjango/article/tests.py
UTF-8
221
2.65625
3
[]
no_license
from django.test import TestCase # Create your tests here. # 类名无所谓 class ATestClass(TestCase): # 测试方法以 test 开头 def test_aTestMethod(self): self.assertEquals([1, 2, 3], [1, 2, 3])
true
b2a9ae5abe331621c0d7c531dbcf73c7b89d7e69
Python
MathiasSoender/PokerBotDB
/Bot/Misc/Clickers.py
UTF-8
6,157
2.65625
3
[]
no_license
# Clicker function, must work with multiple processes. # ID 0 = Left, ID 1 = Right import time from Bot.Misc.MouseMover import HumanMovementCreator as HMC import pyautogui as p import random from Bot.Readers.misc import change_dir from Misc.Simulator_package import click_package class Clicker: def __init__(self...
true
8ce2214b1efb360640d0e7a17ec948e223615ed0
Python
danielcelin/nomina_helper
/modelo/nomina.py
UTF-8
2,586
2.640625
3
[]
no_license
class Empleado: def __init__(self, id, nombre, salario, cargo): self.id = id self.nombre = nombre self.salario = float(salario) self.cargo = cargo class Deduccion: def __init__(self, salud_empleado, pension_empleado, aporte_fondo_solidaridad): self.salud_empleado = floa...
true
fe43c8df38b3c5b26ec2ad782c6e93636fbe0604
Python
AdamZhouSE/pythonHomework
/Code/CodeRecords/2242/60690/273704.py
UTF-8
308
2.96875
3
[]
no_license
rec1=input().split(",") rec2=input().split(",") for i in range(4): rec1[i]=int(rec1[i]) rec2[i]=int(rec2[i]) if rec1[2]<=rec2[0]: print(False)#x2<=x1' elif rec1[0]>=rec2[2] : print(False)#x2'<=x1 elif rec1[1]>=rec2[3] :print(False)#y1>=y2' elif rec1[3]<=rec2[1]:print(False)#y1'>=y2 else:print(True)
true
e36d198128e87d78afd8d49e005e391806ea87c2
Python
itcodium/Javascript
/varios/Python/templates/template.py
UTF-8
1,072
2.859375
3
[]
no_license
from mako.template import Template list=("one aa", "two bb", "three cc") mytemplate = Template(filename='./views/index.html') print(mytemplate.render(time="jack",list=list)) properties = {'fname': "string", 'lname': "string", 'email': "string"} methods= [ {'method': {"verbo":"get","value":"search"} , "parameter...
true
1e6598f88538fef00b5dac97149800656f48e990
Python
hosanabarcelos/studies-py
/basic/script10.py
UTF-8
260
3.578125
4
[]
no_license
tempo = float(input('Digite o tempo gasto: ')) vm = float(input('Digite a velocidade: ')) dist = tempo * vm lus = dist /12 print('A velocidade média foi {}, o tempo foi {}, a distancia {} e a quantidade de litros foi {}'. format(vm, tempo, dist, lus))
true
aad6d3f3ffadc244701c0a7dd6c727a5ff7caf05
Python
igor-dulger/learn_algorithms
/Alg2/Week5/burrows_wheeler.py
UTF-8
1,741
3.0625
3
[]
no_license
from binary.bitwriter import BitWriter from binary.bitreader import BitReader from strings.circular_sufix_array import CircularSuffixArray import sys class BurrowsWheeler(object): def __init__(self): pass @classmethod def transform(cls): reader = BitReader(sys.stdin.buffer) writer...
true
2b7f5a5f241af7455f77dc64d143e7126417efa5
Python
wilsonfr4nco/cursopython
/Modulo_Intermediario/Exercício_list_comprehension/exercicio.py
UTF-8
1,007
3.984375
4
[]
no_license
""" Exercício Dada a string: string = '0123456789012345678901234567890123456789012345678901234567890123456789' Utilizando list comprehension transformar a string acima em: lista = ['0123456789','0123456789','0123456789','0123456789','0123456789'] E depois transormar a lista acima em uma string conforme exemplo abaix...
true
89a0c683e50bb928bec448b23e8cc682708f4f4d
Python
CoachEd/advent-of-code
/2021/day21/part2.py
UTF-8
2,208
3.28125
3
[]
no_license
""" AoC """ import time import sys from copy import copy, deepcopy start_secs = time.time() print('') board_len = 10 board = [ (n+1) for n in range(board_len)] di = 0 dice = [ x for x in range(1,101) ] def roll(): global di global dice n = dice[di] di += 1 if di >= len(dice): di = 0 return n def mov...
true
d30c0cd058d2e6208de03ed516e2a9a1ee71fe80
Python
d7688326/PythonDataAnalysis
/bookStat.py
UTF-8
794
2.765625
3
[]
no_license
''' This is the query for finding the relation between related books and vote value ''' import pymongo,json def findkey(dictobject,key): if dictobject.has_key(key): return True else: return False connection=pymongo.Connection('localhost',27017) db=connection.courses savecourse=db.course_list rateValue=0.0 rate...
true
234031d6c6292512ef91a5f62d061514aa354fbb
Python
JuanRojasC/Python-Mision-TIC-2021
/Control Flow Statements/Ejercicio 1 - Dias de la semana.py
UTF-8
536
4.375
4
[]
no_license
# 1. leer el nombre un numero entre 1 y 7 y mostrar el dia de la semana # Entrada del numero numeroDia = int(input('Ingrese un numero del 1 al 7: ')) # Comparacion if numeroDia == 1 : print('El dia 1 es Domingo') if numeroDia == 2 : print('El dia 2 es Lunes') if numeroDia == 3 : print('El dia 3 es Mart...
true