blob_id large_string | repo_name large_string | path large_string | src_encoding large_string | length_bytes int64 | score float64 | int_score int64 | detected_licenses large list | license_type large_string | text string | download_success bool |
|---|---|---|---|---|---|---|---|---|---|---|
7cb2f7c424f651e3525b5a4fec08c3c3dc2c872b | nekonokoto/python_practice | /vs_test/server.py | UTF-8 | 412 | 2.625 | 3 | [] | no_license | #%%
import socket;
def server():
serverSocket=socket.socket(socket.AF_INET, socket.SOCK_STREAM)
serverSocket.bind((socket.gethostname(),1234,))
serverSocket.listen(5)
while True:
conn, addr = serverSocket.accept()
print('connect from', addr)
data=conn.recv(1024)
conn.send(data)
... | true |
72c8e1ac607bb8a918b07bb901c1d6e0f381959a | herooutman/jargon | /jargon/stats/coverage.py | UTF-8 | 5,288 | 2.640625 | 3 | [] | no_license | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import argparse
import random
import os
import logging
import sqlite3
import json
import pickle
from collections import Counter
from monster.misc import get_res_filepath
from monster.log import init_log
PREPROCESSED_DIR = os.path.abspath(
os.path.join(get_res_filepath... | true |
ab7e927963ca1f98d65641bd5adc796d8adbdeb2 | Selina0210/Python-learning | /14 常用模块/随机数.py | UTF-8 | 767 | 4.15625 | 4 | [] | no_license | import random
# random() 获取0-1之间的随机小数
# 格式:random.random()
# 返回值:随机0-1之间的小数
print(random.random())
# 作业: 利用random函数,注意是函数,生成0-100之间的整数
a=int(random.random()*100)
print(a)
# choice() 随机返回序列中的某个值
# 格式:random.choice(序列)
# 返回值:序列中的某个值
l = [str(i)+"haha" for i in range(10)]
print(l)
rst = random.choic... | true |
c39ab552b5ee8be8dd2ddc66ea3e5171443ca54b | annurg/shop | /khatabook/models.py | UTF-8 | 1,092 | 2.625 | 3 | [] | no_license | from django.db import models
from django.contrib.auth.models import User
import decimal
class Person(models.Model):
name = models.CharField(max_length=50, unique=True)
phone = models.IntegerField(unique=True, default=None)
paid = models.DecimalField(max_digits=10, decimal_places=1, default=0)
def __s... | true |
531f8f315bd02ecac30da06765aea498c2e4cf82 | waynemonteiro97/SoftwareCarpentryWC3_1 | /mundane_Math.py | UTF-8 | 227 | 3.21875 | 3 | [] | no_license | # -*- coding: utf-8 -*-
"""
Created on Sun Sep 22 16:12:24 2019
@author: Wayne Monteiro
"""
sum=0
for i in range(1,100):
if i%2==0:
sum = sum +i
else:
sum=sum
print ("sum of the num=",sum) | true |
98f2379a275010a137cb8ed5bedd017d15e270f2 | babymlin/Python_wxPython | /4.py | UTF-8 | 786 | 3.03125 | 3 | [] | no_license | # -*- coding: utf-8 -*-
"""
Spyder Editor
This is a temporary script file.
"""
#0503作業1
#101_AI班林建名
from colorama import Back, Style, init
import time
import os
count = 0
init()
while True:
if count >=1 and count<= 5:
print(Back.RED + " " + Style.RESET_ALL)
print(f"{count}... | true |
77c870648710b7d4be63892737088d4069509603 | nitheesh-me/24_HourHackthon-Amrita | /YAPS/YAPS_Server/algo.py | UTF-8 | 4,814 | 2.78125 | 3 | [] | no_license | def knapSack(W, wt, val, n):
K = [[0 for w in range(W + 1)]
for i in range(n + 1)]
# Build table K[][] in bottom
# up manner
for i in range(n + 1):
for w in range(W + 1):
if i == 0 or w == 0:
K[i][w] = 0
elif wt[i - 1] <= w: ... | true |
867d1ee5499a0ad28d456d970930990746ac22fa | JinjinsVan/first_python_exercise | /ex0020/ex0020.py | UTF-8 | 627 | 3 | 3 | [] | no_license | #coding=utf-8
import os,json,xlrd
from lxml import etree
workbook = xlrd.open_workbook('src.xls')
sheet = workbook.sheet_by_index(0)
directions = sheet.col_values(2,1,sheet.nrows)
durations = [int(x) for x in sheet.col_values(3,1,sheet.nrows)]
out_duration = []
in_duration = []
for x in range(0,len(directions)):
if... | true |
ed4bc8fdd345fc3daef9353544bf203d10512820 | Logicmn/osrs_exchange_index | /app/models.py | UTF-8 | 763 | 2.828125 | 3 | [] | no_license | from app import db
class Item(db.Model):
id = db.Column(db.Integer, primary_key=True)
game_id = db.Column(db.Integer, index=True)
name = db.Column(db.String(64), index=True)
price = db.Column(db.Integer, index=True)
members = db.Column(db.Boolean, index=True)
buy_avg = db.Column(db.Integer, ind... | true |
db258a0b85879c7f9d88c726b9268bbd89b4ad88 | ilmoi/lphw3 | /projects/testeroozz/build/lib/testeroozz/sum_module.py | UTF-8 | 472 | 3.328125 | 3 | [] | no_license | """This is a simplez testeroozz module. Does naffin useful."""
import random
class Summation(object):
def great_summation(first, second):
print("let's play a game")
print("give me two numbers ill give you their sum")
# first = input("first number: ")
# second = input("second numbe... | true |
254717535fb7961017a3bd71d808cec77934e35d | sk720/MACHINE-LEARNING-PROJECTS | /DIGIT_RECOGNATION/DIGIT_RECOG_XGBOOST.py | UTF-8 | 954 | 2.90625 | 3 | [
"MIT"
] | permissive | # -*- coding: utf-8 -*-
"""
Created on Thu Oct 11 00:06:05 2018
__Kaggle DIGIT RECOGNATION BY XGBOOST___________
@author: MD SAIF UDDIN
"""
import pandas as pd
train = pd.read_csv("train.csv").as_matrix()
X = train[:, 1:]
Y = train[:, 0]
test = pd.read_csv("test.csv").as_matrix()
from xgboost import XG... | true |
6bbd4e56cb3cb4273a29a93ccd4f02a460f3cb60 | ClNo/flask-squirrel | /flask_squirrel/util/uploadroute.py | UTF-8 | 2,971 | 2.578125 | 3 | [
"MIT"
] | permissive | from flask import Blueprint, request, current_app
from werkzeug.utils import secure_filename
import os
import logging
log = logging.getLogger('uploadroute')
log.level = logging.DEBUG
bp = Blueprint('uploadroute', __name__)
# @bp.route('/{0}/upload'.format(API_PATH), methods=['POST'])
@bp.route('/upload', methods=[... | true |
88813a76941fec91dc4245b53a324a41be6889e5 | elliottbolzan/Mojo | /Scripts/scrape.py | UTF-8 | 1,049 | 2.515625 | 3 | [] | no_license | import os
import plistlib
import urllib2
import json
from BeautifulSoup import BeautifulSoup
from io import open
json_str = open(os.getcwd() + '/emojis.json').read()
associations = json.loads(json_str)
url = 'http://unicode.org/emoji/charts/full-emoji-list.html'
page = urllib2.urlopen(url)
soup = BeautifulSoup(page.r... | true |
15a1d2cbc466e2c65b2b843c75ccbb887fb4ddbb | Mathewking-Mosahary/Andrew | /mathewking.py | UTF-8 | 6,667 | 3.390625 | 3 | [] | no_license | import os
class student:
print("""\n*********WELCOME TO PATKIJULI UNIVERSITY
DETAILS OF UNIVERSITY:\n
UNDER GUWAHATI UNIVERSITY
ADDRESS: PATKIJULI,BAKSA,ASSAM,781360
DIRECTOR: ANDREW MOSAHARY
ESTABLISH: 2005""")
def __init__(self):
self.a=""
self.b=""
self.c... | true |
4ca79ab4bd3b6df056cb247b8f3d0050e0a61b2f | uladkasach/Word-Subject-Classification | /2_classify/old/v1/dep/classifier_rand.py | UTF-8 | 13,388 | 2.546875 | 3 | [] | no_license | ###########################################################
## Logistic Regression with Stochastic Gradient Descent Training
############################################################
import tensorflow as tf
import numpy as np
import pandas as pd
import sys
import os
import time
################
## Import Inputs
##... | true |
13a14fc1f839b40f7e291756990a7113e67efab2 | cyber-physical-systems/PrivacyGuard | /data_cleaning/remove_background.py | UTF-8 | 1,340 | 2.671875 | 3 | [] | no_license | import csv
import glob
path = ''
output_path = ''
for file in glob.glob(path + '*.csv'):
name = file.split('/')[-1]
date = name.split('.')[0]
with open(file) as f:
reader = csv.DictReader(f)
header = reader.fieldnames
# print(header)
with open(output_path + na... | true |
8de9c729521a98628307e172b5c4fba8dc40fa07 | prestige-m/diploma_work | /mask_detection/mask_overlay.py | UTF-8 | 4,466 | 2.859375 | 3 | [] | no_license | import os
import sys
import argparse
import numpy as np
import cv2
import face_alignment
import math
from PIL import Image, ImageFile
class FaceOverlay:
def __init__(self):
self.face_img: ImageFile = None
self.mask_img: ImageFile = None
self.face_align = face_alignment.FaceAlignment(face... | true |
05e2f6c54f61916bd1ede3ead96361debea12915 | Mikejmoffitt/Harold-1 | /main.py | UTF-8 | 4,005 | 2.578125 | 3 | [] | no_license | import alsaaudio
import time
import os
import serial
import random
import json
import urllib2
ser = serial.Serial('/dev/ttyACM0', 9600)
ser.flushInput()
timeHour = int(time.strftime('%H'))
# os.system("mplayer -slave -input file=/tmp/mplayer.fifo /home/pi/ding.mp3 &")
os.system("rm -f /tmp/mplayer.fifo")
os.system("... | true |
58ef0786797c1b5406f8e23cbd96b111b00cde79 | 4RG0S/2020-Fall-Jookgorithm | /강재민/10월/[20.10.13]1463.py | UTF-8 | 410 | 2.90625 | 3 | [] | no_license | import sys
input=sys.stdin.readline
N = int(input())
S = [0, 0, 1, 1]
op = 0
for i in range( 4, N + 1 ):
if( i % 3 == 0 and i % 2 == 0 ):
S.append( min( S[ i//3 ] , S[ i-1 ], S[ i//2] ) + 1)
elif( i % 3 == 0 ):
S.append( min( S[ i//3 ] , S[ i-1 ] ) + 1 )
elif( i % 2 == 0 ):
S.appe... | true |
62d4ad07251f24d158868bedaa6161411556fd9c | duheng18/python-study | /testframework/excise/excise/homework/homework3.py | UTF-8 | 1,132 | 4.53125 | 5 | [] | no_license | # 1.实现一个函数,要求对一个列表里面所有数字求和,如果里面含有非数字的元素,直接跳过。
# 比如:[1,2,3]输出是5,如果是[1,2,4,"a"]输出是7。并在另外一个包(目录)里面调用这个函数。
def sumData(data):
sum = 0
for item in data:
if isinstance(item, int) | isinstance(item, float):
sum += item;
else:
continue
print(sum)
# 2.已有字典dic={"name":"xiaozh... | true |
29e790d70848137d6bd9071eda0c719bc6258cfe | KamilPchelka/CcMS-Aktywnosc | /controllers/employee_controller.py | UTF-8 | 3,206 | 3.109375 | 3 | [] | no_license | from models.user_container import UserContainer
from models.student import Student
from services.notification_service import EmailService
from views.employee_view import EmployeeView
import os
class EmployeeController:
def __init__(self, employee):
self.user_container = UserContainer.get_instance()
... | true |
42b3d9d7607c18eaf279b2a53b9d5b9f13063047 | alexeRadu/PunchingMachine | /Display.py | UTF-8 | 688 | 3.203125 | 3 | [] | no_license | import serial as ser
COM_PORT = 4 # COM 5
BAUD_RATE = 115200
TIMEOUT = 1
class Display:
def __init__(self):
self.serial = ser.Serial()
self.serial.baudrate = BAUD_RATE
self.serial.port = COM_PORT
self.serial.timeout = TIMEOUT
self.serial.open()
self.vals = [[150, 140, 130], [120, 114, 106], [10... | true |
7cd6944e06ad1844291711db8795c3207d059ab1 | dr-dos-ok/Code_Jam_Webscraper | /solutions_python/Problem_135/2624.py | UTF-8 | 975 | 3.078125 | 3 | [] | no_license | import string, sys
sourceName = sys.argv[1]
outputName = sys.argv[2]
source = open(sourceName)
output = open(outputName, 'w')
def solve(case, firstNumber, firstMatrix, secondNumber, secondMatrix):
result = ""
candidate = set(firstMatrix[firstNumber-1]).intersection(set(secondMatrix[secondNumber-1]))
if len(candida... | true |
dea1515fca0606dc72478eb3582551f6895c5c40 | daniel-reich/ubiquitous-fiesta | /Yfksxs7kyJf6B3yvK_21.py | UTF-8 | 147 | 2.9375 | 3 | [] | no_license |
def min_miss_pos(lst):
for i in range(1, 2<<64): # huge range instead of "while" or itertools.count
if i not in lst:
return i
| true |
8d7cf71cb28d34beabc985d70edecfcfff60bc74 | Morpheus2112/Rosalind-exercise | /bioinformatics stronghold/PROB.py | UTF-8 | 2,607 | 3.671875 | 4 | [] | no_license | # -*- coding: utf-8 -*-
"""
An array is a structure containing an ordered collection of objects (numbers,
strings, other arrays, etc.). We let A[k] denote the k-th value in array A. You
may like to think of an array as simply a matrix having only one row.
A random string is constructed so that the probability of choo... | true |
c811fec6a92e896881887a705613eaf812403798 | JWhitleyWork/gitlab-graph-generator | /gitlabgraphgenerator/GroupStats.py | UTF-8 | 4,754 | 2.734375 | 3 | [
"MIT"
] | permissive | #!/usr/bin/env python3
import calendar
import datetime
import gitlab
import sys
from datetime import timedelta
def get_monthly_date_ranges(startdate, enddate):
dates = []
for y_idx in range(startdate.year, enddate.year + 1):
# Months in all years in range
if startdate.year == y_idx and enddate.y... | true |
17537f41d88a1440b30ff8674812de0cb0dafe1a | scott-s-douglas/swapr-analysis | /generateCombos.py | UTF-8 | 907 | 2.59375 | 3 | [] | no_license | import sqlite3 as lite
import random
con = lite.connect('AnonymousS2014Campus.sqlite')
cur = con.cursor()
aList = []
bList = []
cur.execute('''select wID from submissions
WHERE labNumber = 1 AND url is not null''')
data = cur.fetchall()
n = 0
cList = []
for x in data:
a = str(x[0])
aList.appen... | true |
a5f2949ea1f6ae554fe60d4c6f2edaf7ad982ab8 | alexandraback/datacollection | /solutions_1484496_0/Python/CodeViking/c.py | UTF-8 | 1,247 | 2.8125 | 3 | [] | no_license | import math, numpy, sys, itertools
from collections import defaultdict
def solve_case(N, S):
sums = defaultdict(set)
for c in range(1, 19):
sys.stderr.write('comb=%d\n' % c)
for choose in itertools.combinations(S, c):
cs = sum(choose)
sums[cs].add(frozenset(choose))
... | true |
92ef01b696775e0fcc0747c3fdb15be8bea43daf | A-very-Cunning-ham/CS-115 | /hw7.py | UTF-8 | 2,603 | 3.671875 | 4 | [] | no_license | """
Created on 3/31/21
@author: Avery Cunningham
Pledge: I pledge my honor that I have abided by the Stevens Honor System
CS115 - HW 7
"""
def numToBaseB(N, B):
"""Converts non-negative base 10 integer N to a string in base B"""
def helper(N, B):
"""Helps account for base case"""
if N =... | true |
4b7098bc42195431de42ca03efd74333029f552b | metanitesh/Data-Structure-Algorithm-Python | /projects/DA-project-3/problem-7.py | UTF-8 | 2,226 | 3.328125 | 3 | [
"MIT"
] | permissive | class RouteTrieNode:
def __init__(self, handler= False):
self.handler = handler;
self.children = {};
class RouteTrie:
def __init__(self, handler):
self.root = RouteTrieNode(handler)
def insert(self, pathList, handler):
node = self.root;
for token in pathList:
if token is '':
... | true |
57f364a516cd13df48e523df7a8b18263e5060a2 | zhaojiawen-coding/Sort | /bubble_sort.py | UTF-8 | 423 | 3.921875 | 4 | [] | no_license | #冒泡排序
import random
def bubbleSort(list):
n = len(list)
for i in range(n-1):
for j in range(n-i-1):
if list[j] > list[j+1]:
temp = list[j]
list[j] = list[j+1]
list[j+1] = temp
return list
if __name__ == '__main__':
l = []
for i... | true |
6fbe75e6012b16be1a1a927093d86020d230dd0a | gymgle/leetcode | /remove-element/sol.py | UTF-8 | 690 | 3.21875 | 3 | [] | no_license | class Solution:
def removeElement(self, nums: list[int], val: int) -> int:
if not nums:
return 0
last = len(nums) - 1
while last > 0:
if nums[last] == val:
last -= 1
else:
break
if last == 0 and nums[last] == val:
... | true |
878c7f0c3d094eb0d3a8d59468464eeed7300926 | jokvedaras/fractals | /MandelbrotSet/Mandelbrot Set.py | UTF-8 | 3,030 | 3.765625 | 4 | [] | no_license | import graphics
#generally use numbers between -1 and 1 for randomiser
#remember to change the window scale and offset
#try : randomiser = -0.5 : y_offset = 1.114499259 : x_offset = 0.50015705
randomiser = 1
precision = 100
win_max = 200
scale = 100
y_offset = 0
x_offset = 0
#Create Graphics Window ca... | true |
91f4dc55e09b66e871733169ad742ecabe72c96d | suwangcompling/OCR | /ocr_test.py | UTF-8 | 3,585 | 2.90625 | 3 | [] | no_license | ## OCR
from PIL import Image
import pytesseract
file = pytesseract.image_to_string(Image.open('test01.JPG')) # test image source: https://www.google.com/search?q=land+contract&espv=2&biw=1330&bih=755&source=lnms&tbm=isch&sa=X&ved=0ahUKEwiCurTgkubKAhVLRyYKHUu5Au4Q_AUICCgD#tbm=isch&q=photocopy+of+land+contract&imgrc=Q7W... | true |
4bd034e1b1e55c64c2ada72865bc2c0dba886e70 | yaobozhang/Plan-for-combating | /week1大作业提交/linguanhao/exercise_1(kylin).py | UTF-8 | 4,204 | 2.828125 | 3 | [] | no_license | from bs4 import BeautifulSoup
import requests
import re
def get_page_content(url):
''' 返回该网页的 html代码 '''
header = { #模拟浏览器
'User-Agent':'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/47.0.2526.106 Safari/537.36'
}
page_content = requests.get(url, headers=h... | true |
494a92d14ad45ca4474ef2bbcf98c64018668e8b | d3vzer0/kickstart-flask-vuejs | /app/models.py | UTF-8 | 893 | 2.75 | 3 | [
"MIT"
] | permissive | from app import db
import mongoengine
# Filter options can be defined like so
filter_options = ('administrator', 'user')
# An example class of a user MongoDB document, containing
class Users(db.Document):
# Define a key field by specifying unique=True
# Combination of fields as a key is available with
# ... | true |
2ff3fd0fa7301819ea768b0ec91bda9747ec7b8c | MarianoCol/um-programacion-i-2020 | /58164-von-Kesselstatt-Philipp/TP1/ejercicio1.py | UTF-8 | 604 | 3.78125 | 4 | [] | no_license | def grupo(self, alumno):
abc = ['a', 'b', 'c', 'd', 'e', 'f',
'g', 'h', 'i', 'j', 'k', 'l',
'm', 'n', 'ñ', 'o', 'p',
'q', 'r', 's', 't', 'u',
'v', 'w', 'x', 'y', 'z']
if (
sex == "f" and abc.index(name[0].lower()) < 12 or
... | true |
2f2f59a18d9163dd00f51c16f2be10e920b92891 | MiniMamini01/-cryptocurrency-notification | /test.py | UTF-8 | 154 | 2.65625 | 3 | [] | no_license |
while True:
print('hello')
with open('what.txt','r') as a :
data = a.read().strip()
if data == 'quit':
quit() | true |
83efa04900795861c6f213d4e356ab8bba627006 | ssoonhoh/poker-player-luckyluke | /ranking.py | UTF-8 | 5,380 | 3.265625 | 3 | [
"MIT"
] | permissive | #!/usr/bin/env python
STRAIGHT_VALUES = ['A', '2', '3', '4', '5', '6', '7', '8', '9', '10', 'J', 'Q', 'K', 'A']
def cmpValue(a, b):
return STRAIGHT_VALUES.index(a["rank"])-STRAIGHT_VALUES.index(b["rank"])
def getValues(cards):
result = []
for card in cards:
result += [card["rank"]]
return res... | true |
514a8cb3d41ee91abb7b9f7d7a9d3f3f35bceff8 | chiefmky/ArrayAndStringProblem | /PalindromePermutation.py | UTF-8 | 407 | 3.765625 | 4 | [] | no_license | #write a function to check if it is a permutation of a palindrome
def PalindPerm(aString):
aString = aString.replace(" ", "")
aSet = set(aString)
oddN = 0
for ch in aSet:
c = aString.count(ch)
if c % 2 == 1:
oddN += 1
if oddN <= 1:
return True
else:
... | true |
aa108d1d815208a6e7bc2a70b48f7a064e19e15d | Fajkowsky/MyEulerSolutions | /Problem3.py | UTF-8 | 395 | 3.59375 | 4 | [] | no_license | def isPrime(number):
i = 2
if(number <= 1):
return False
while(i != number):
if(number % i == 0):
return False
i += 1
return True
def main():
number = 0
while(number != 600851475143):
if(isPrime(number) and 600851475143 % number == 0):
... | true |
a4a148d696725f591e427fd6f8dff1e5a606c5fb | edi-allen/algorithms | /index_of_min.py | UTF-8 | 330 | 4.125 | 4 | [] | no_license | #!/usr/bin/python3
"""
Find index of the minimun element in a list.
"""
def index_of_min(array):
index = 0
for i in range(1, len(array)):
if array[i] < array[index]:
index = i
return index
if __name__ == '__main__':
array = [3, 1, 0, 7, 2, 9]
print(array)
print(index_of_mi... | true |
ef53f1f902f36905c52b5b55acaf77d81bb4614b | aikeke/study-note | /python/queue.py | UTF-8 | 640 | 3.640625 | 4 | [] | no_license | #/usr/bin/env python
# -*- coding: utf-8 -*-
#python 实现队列
class Queue(object):
def __init__(self):
self.items=[]
def isEmpty(self):
return self.items==[]
def enqueue(self,item):
self.items.insert(0,item)
def dequeue(self):
return self.items.pop()
def size... | true |
9e5a726e2d5be50b0d2c7a35ff31d545df893104 | jaisinghchouhan/Forsks | /Day2/pattern.py | UTF-8 | 211 | 3.265625 | 3 | [] | no_license | # -*- coding: utf-8 -*-
"""
Created on Wed May 8 11:11:16 2019
@author: ck069
"""
length=int(input("enter the length"))
for i in range(0,length):
print ("*"*i)
for j in range(length,0,-1):
print("*"*j) | true |
8f6a0847cea3d324f1d69cfd3fe9955a47cefe55 | byung-u/HackerRank | /ProjectEuler_plus/euler_008.py | UTF-8 | 300 | 2.640625 | 3 | [
"MIT"
] | permissive | #!/usr/bin/env python3
import sys
from functools import reduce
t = int(input().strip())
for a0 in range(t):
n,k = input().strip().split(' ')
n,k = [int(n), int(k)]
num = input().strip()
print(max([reduce(lambda x, y: x * y, list(map(int, num[i:i + k]))) for i in range(0, n - k)]))
| true |
e7e232448ba51b8a56683762c6aea7a24c65792c | GShunmugavalli/guvi | /programs/length.py | UTF-8 | 30 | 2.640625 | 3 | [] | no_license | x=input()
s1=len(x)
print(s1)
| true |
1c2c73e2bebe0abbb306e94c9812edb8f995f92c | giovannicadiz/Hackerrank | /Python/2 Basic Data Type/4 Find the Second Largest Number/main.py | UTF-8 | 203 | 2.875 | 3 | [] | no_license | if __name__ == '__main__':
n = int(input())
arr = map(int, input().split())
lista = list(arr)
m = max(lista)
while max(lista) == m:
lista.remove(m)
print(max(lista)) | true |
155f550faabfac0f3d7d48474ac4ecde6653b2b5 | Budabot/Tyrbot | /modules/standard/alien/alien_armor_controller.py | UTF-8 | 14,206 | 2.671875 | 3 | [] | no_license | import math
from core.chat_blob import ChatBlob
from core.command_param_types import Options, Int
from core.decorators import instance, command
from core.text import Text
from modules.standard.items.items_controller import ItemsController
@instance()
class AlienArmorController:
def inject(self, registry):
... | true |
f4b05f9fecbbd6ce617ddd1c5d388362db75c818 | lele0912331037/my_python | /OldBoyPy/day4/homework/game_class/profession.py | UTF-8 | 3,305 | 3.140625 | 3 | [] | no_license | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
class Race(object):
"""种族类"""
def __init__(self, race, ps, grade):
self.race = race
self.ps = ps
self.grade = grade
def get_race(self):
return '门派:{}\n种族:{}'.format(self.ps, self.race)
class Terran(Race):
"""人族类"""
d... | true |
52a0f064327b17a33efb33ba572cceae723486a4 | bpbpublications/Question-Bank-for-Exam-Success-Computer-Science-with-Python-Class-XII-CBSE-083- | /chapter07/ch_7_codelisting.py | UTF-8 | 3,033 | 3.296875 | 3 | [
"MIT"
] | permissive | Short Questions and Answers
# 5. Illustrate how to pickle and unpickle an integer with an example?
# Ans.
import pickle
data = 1
with open(F:\\files\\intdata.dat', 'wb') as _file:
pickle.dump(data, _file)
#Read the value
with open(F:\\files\\intdata.dat', 'rb') as _file:
_dataretrieve =pickle.... | true |
49e98157f5d29b46fe0dde432598c7f7002416e0 | malkoG/polyglot-cp | /BOJ/String/Python/10914.py | UTF-8 | 276 | 3.0625 | 3 | [] | no_license | alphabet="abcdefghijklmnopqrstuvwxyz"
n=int(input())
result=[]
for word in input().split():
s=""
for i in range(len(word)//2):
s+=alphabet[(alphabet.find(word[2*i]) + alphabet.find(word[2*i+1]) - n + 26) % 26]
result.append(s)
print(" ".join(result))
| true |
cb3d947c16fb987e214759b23a8b84a5a5eaa95f | LewisPeacockLab/rewire-keyboard | /display/oldKeyboardDemoThermometer.py | UTF-8 | 3,696 | 2.796875 | 3 | [] | no_license | import pygame
import serial
import sys, glob
from keyboardClass import rewireKeyboard
class testGame(object):
def __init__(self, max_key_force=2.):
# initialize pygame and graphics
pygame.init()
self.max_key_force = max_key_force
self.pygame_keyboard = pygame.joystick.Jo... | true |
21ac2baa1a61290619dee77b5606d3ffb37ebcbc | MrDeshaies/NOT-projecteuler.net | /euler_017.py | UTF-8 | 1,680 | 4.21875 | 4 | [] | no_license | import re
# If the numbers 1 to 5 are written out in words: one, two, three, four, five, then there are 3 + 3 + 5 + 4 + 4 = 19 letters used in total.
# If all the numbers from 1 to 1000 (one thousand) inclusive were written out in words, how many letters would be used?
# NOTE: Do not count spaces or hyphens. For examp... | true |
035e48695758b25b4601dad4fed75011112f59ba | ZoeyMiao/LAS_VASTDB | /remotedata.py | UTF-8 | 2,725 | 2.71875 | 3 | [] | no_license | ###########################################################
# lasdata.py
#
# load movement and communication data csv files to database
# @ author: Zoey Sun
# @ last update : April 12 2018
###########################################################
import os
import datetime
import time
import csv
import mysql.connecto... | true |
3592c17d3a568fda222160dab9d7c461d11b3ad2 | arthurbatista/ml | /linear_regression/linreg3.py | UTF-8 | 790 | 3.796875 | 4 | [] | no_license | from pylab import *
# primero criamos os nossos x e y
# lembre se que o x contem o tamanho dos narizes das pessoas
x = [4.,5.,4.5,3.8]
# o y contem os salarios anuais
y = [3.,5.,4.7,4.3]
# vamos dar uma olhada nos dados...
scatter(x,y)
xlabel('x')
ylabel('y')
show()
# y = mx + b : funcao da linha. o polyfit vai n... | true |
7b69786af032a7220265923af80ca94e887a0403 | DingGuodong/LinuxBashShellScriptForOps | /functions/nosql/database/mysql/get-charset-and-collation.py | UTF-8 | 3,258 | 2.625 | 3 | [] | no_license | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
Created by PyCharm.
File Name: LinuxBashShellScriptForOps:get-charset-and-collation.py
Version: 0.0.1
Author: dgden
Author Email: dgdenterprise@gmail.com
URL: https://github.com/DingGuodong/LinuxBashSh... | true |
1a80a167527ca100d2c70848d550aa4fb8407f5f | euikook/python-moving-average-examples | /wma.py | UTF-8 | 1,489 | 2.765625 | 3 | [
"MIT"
] | permissive | import numpy as np
import pandas as pd
import matplotlib.dates as mdates
from avg import do_cma, do_sma, do_ema, do_wma
from matplotlib import rcParams
rcParams['font.family'] = 'monospace'
rcParams['font.sans-serif'] = ['Tahoma']
import matplotlib.pyplot as plt
N = 15
from matplotlib.ticker import (MultipleLocat... | true |
72bc84f719d66bf8273e3f777e46d673a025079f | CrisCoutinho/Controle_de_Notas | /Controle_Notas.py | UTF-8 | 5,391 | 3.0625 | 3 | [
"MIT"
] | permissive | import time
import massa_teste
import pickle
def menu_principal():
print("\n"+66*"=")
print("Controle de Notas".center(66))
print(66*"="+"\n")
print(" 1 - Listar alunos")
print(" 2 - Matricular aluno")
print(" 3 - Buscar Aluno")
print(" 0 - Sair do Aplicativo\n")
return ... | true |
eed7b62250de710d25b79e2386c3c0b2215af0e3 | git4rajesh/python-learnings | /Behave_demo/parameters/steps/my_steps.py | UTF-8 | 211 | 2.640625 | 3 | [] | no_license | from behave import *
@given(u'I search for a valid number')
def step_impl(context):
assert True
@then('the result page will include "{text}"')
def step_impl(context, text):
assert(text == 'success')
| true |
834e578fefa9b51b0335662cafbbad7c5051ab28 | dutcjh/learnpython | /assign7_1.py | UTF-8 | 983 | 3.203125 | 3 | [] | no_license | """
文件创建
"""
pstr = r"""Very quietly I take my leave
As quietly as I came here;
Quietly I wave good-bye
To the rosy clouds in the western sky.
The golden willows by the riverside
Are young brides in the setting sun;
Their reflections on the shimmering waves
Always linger in the depth of my heart.
The floating heart gr... | true |
e98919adea461ec4937e089d52935c7df201f8a9 | G-V-PHANI-KUMAR/MYPROJECTS | /longestcomsuseq.py | UTF-8 | 1,815 | 3.25 | 3 | [] | no_license | import os,time
def longestcommonsubseq(str1: str,str2: str,verbose=False):
a,b=len(str1),len(str2)
matrix = [[0 for i in range(b+2)] for j in range(a+2)]
for i in range(len(str1)):
matrix[i+2][0]=str1[i]
for j in range(len(str2)):
matrix[0][j+2]=str2[j]
for i in range(2,a+2)... | true |
a7db5602341bd38904b71b21679f5699891eb808 | jjfeng/descent-based-optimization | /code_submission_nonsmooth/realdata_colitis_models.py | UTF-8 | 7,750 | 2.578125 | 3 | [] | no_license | import numpy as np
import scipy as sp
from common import *
CLOSE_TO_ZERO_THRESHOLD = 1e-5
class KFoldData:
def __init__(self, X_train, y_train, X_validate, y_validate, feature_group_sizes, problem_wrapper_klass):
self.feature_group_sizes = feature_group_sizes
self.X_train = X_train
self.y_... | true |
6c4af1a2f60397721cb3306e2c4b25487a594c10 | kiteros/TPE-enigma-replica | /rsa/Dechiffrement RSA.py | UTF-8 | 2,878 | 3.875 | 4 | [] | no_license | # encoding: utf-8
# La fonction PGCD avec ses 2 arguments a et b
def pgcd(a,b):
# L'algo PGCD
while a != b:
if a > b:
a = a - b
else:
b = b - a
return a;
# La fonction factoriser avec en argument n
def factoriser(n):
b=2
while b:
wh... | true |
a80cf42d577b037805f1c36684c67b898ee2e617 | skuep/Munin-Plugins | /ap_ | UTF-8 | 5,056 | 2.65625 | 3 | [] | no_license | #!/usr/bin/env python
# plugin for monitoring a wifi adapter in ap mode
# uses iw <interface> station dump
#
# To use, just link to this file like this:
# ln -s /path/to/ap_ /etc/munin/plugins/ap_clients_wlan0
# ln -s /path/to/ap_ /etc/munin/plugins/ap_rssi_wlan0
# ln -s /path/to/ap_ /etc/munin/plugins/ap_rate_wlan0
#
... | true |
72db8bfe7dd5df8d514bd7bcfaf89e7ebef95af5 | Gitiauxx/DPSForecast | /CaptureRate.py | UTF-8 | 5,069 | 2.9375 | 3 | [] | no_license | import pandas as pd
import numpy as np
def yearAdj(year):
b = int(str(year)[2:4])
b = b - 5
if b == 0:
b = '00'
elif b == -1:
b = '99'
elif b == -2:
b = '98'
elif b == -3:
b = '97'
elif b == -4:
b = '96'
elif b == -5:
b = ... | true |
5a9720ded4de2f3845a1e7749f24ec8e204e20c8 | KodingKing99/TOC_Hw06 | /hw06/hw06/PyCYK/cyk.py | UTF-8 | 1,172 | 2.9375 | 3 | [] | no_license | ###############################################
# module: cyk.py
# Nick Sorenson
# A02287085
###############################################
class CYK(object):
@staticmethod
def is_in_cfl(test_string, cnfg, debug=False):
# Initialize D table
D = [[set() for i in range(len(test_strin... | true |
c291436a0afd889fcd61ae26db5af929e07d531d | Aasthaengg/IBMdataset | /Python_codes/p03477/s394519466.py | UTF-8 | 269 | 3.6875 | 4 | [] | no_license | def main():
weights = list(map(int, input().split()))
if sum(weights[:2]) > sum(weights[2:]):
print("Left")
elif sum(weights[:2]) == sum(weights[2:]):
print("Balanced")
else:
print("Right")
if __name__ == '__main__':
main() | true |
b2dd86eadb945ae2b28721196f61892c0c8e3218 | iwasho1988/ExcelVlook | /ExcelVLOOK.py | UTF-8 | 3,906 | 2.78125 | 3 | [] | no_license | #!/usr/bin/env python3
# coding: utf-8
import openpyxl as opx
import json
import os
import sys
import traceback
ANum = "A"
ACol = "B"
ASiz = "C"
AAmount = "D"
ALast = "E"
BNum = "A"
BCol = "B"
BSiz = "C"
BAmount = "D"
BLast = "E"
def get_file_paths(file_name):
SEPATATER = "/" # for Linux
ENCODING = "utf-8"... | true |
a1f427b10ac349a61eafb3b7a71ce92f2a226cdf | kontsovart/Med_flask | /models.py | UTF-8 | 3,318 | 2.65625 | 3 | [] | no_license | from app_config import db
# python3 manage.py migrate - for start migrations to db
# python3 manage.py upgrade for commit updates
class Condition(db.Model):
__tablename__ = 'condition'
id = db.Column(db.Integer, primary_key=True)
info = db.Column(db.String(300), nullable=False)
def __init__(self, in... | true |
29eaaacb6a18258835df874d86a67a3963e81ea6 | rahuldbhadange/Python | /__offline/__Digital_Twin/__release2/__release2_sprint4/15619 - Link the asset locations to local weather/test11111.py | UTF-8 | 8,083 | 2.578125 | 3 | [] | no_license | from IoticAgent.Core.compat import monotonic
from IoticAgent.ThingRunner import RetryingThingRunner
from IoticAgent import Datatypes, Units
from IoticAgent.Core.Const import SearchScope, DescribeScope
from IoticAgent.IOT.utils import uuid_to_hex, logger
from markupsafe import string_types
class SysthesiserWeather(Ret... | true |
a1ebbba78fe43d518ca4afc5d0cb6eb6514619b1 | davidm3591/Code-Cheats-Settings | /python/CompleteUnicodeInPythonCourse/Working Files/03/cities_latin1.py | ISO-8859-3 | 105 | 3.03125 | 3 | [] | no_license | # -*- coding: latin1 -*-
cities = u'Basel Genve Zrich'.split()
for city in cities:
print(city)
| true |
af6eee919374366c21e21fb12613cdd6ad3360c0 | KehlRafael/top-actors-tweets | /topActorsTweets.py | UTF-8 | 6,828 | 3.046875 | 3 | [] | no_license | import os
import requests
import pandas as pd
import tweepy
from datetime import date
from datetime import datetime
def get_dataset_url(dataset):
"""Returns the url to download an IMDb dataset given it's name"""
if dataset == "name.basics":
return "https://datasets.imdbws.com/name.basics.tsv.gz"
e... | true |
f9c3334176603ae0b12eb40ad472c9302f3785d4 | muthu-gokul/guvi | /set1e.py | UTF-8 | 117 | 2.8125 | 3 | [] | no_license | n1,n2,n3=int(input().split())
if(n1>n2 and n1>n3):
print(l1)
elif(n2>n1 and n2>n3):
print(l2)
else:
print(l3)
| true |
990d7ca1d82357fca85d126d126a45003ebe4cb4 | jiahao-li2000/UPSET-ANGRI | /dataloader.py | UTF-8 | 4,541 | 2.59375 | 3 | [] | no_license | # -*- coding: utf-8 -*-
"""
Created on Sat Aug 1 20:06:27 2020
@author: Li Jiahao
"""
import numpy as np
import struct
import sys
import random
import torch
import matplotlib.pyplot as plt
train_images_idx3_ubyte_file = './data/MNIST/train-images.idx3-ubyte'
train_labels_idx1_ubyte_file = './data/MNI... | true |
9916cb7f8be8c05b17c827dec3af7d0fe2db7d7c | uma-pi1/kge | /kge/util/loss.py | UTF-8 | 10,903 | 2.71875 | 3 | [
"MIT"
] | permissive | import math
import torch
import torch.nn.functional as F
from kge import Config
# Documented losses
# - See description in config-default.yaml
#
# Other, undocumented losses. EXPERIMENTAL, may be removed.
#
# bce_mean (not KvsAll): as BCE but for each positive triple, average the BCE of the
# positive triple and the *... | true |
4cecaed9c94dc8831910dd59619ca0dd021194d9 | akshays-repo/learn.py | /files.py/basicANDtask/num-checkpoint.py | UTF-8 | 1,845 | 4.0625 | 4 | [] | no_license | import numpy
import numpy as np
#check version
print(np.__version__)
import numpy as np
arr = np.array([1, 2, 3, 4, 5])
print(type(arr)) # prints the type of array
print(arr.shape) # prints the number of elements in the array
print(arr[0], arr[1]) # prints the elements in the index position
arr[0] = 5 # changes an... | true |
21b75bc99958f2fc0f690f54a0ac8aab7464ff18 | ahull002/SB_data_pipeline_mini | /package/module.py | UTF-8 | 213 | 2.640625 | 3 | [] | no_license | import csv
from pathlib import Path
base_path = Path(__file__).parent
file_path = (base_path / "../data/third_party_sales_1.csv").resolve()
with open(file_path) as f:
sales = [line for line in csv.reader(f)] | true |
e2b9e88cc0175f93bf5c5b0e05ef4f2541df830c | saketsgh/Pitch_Dimesion_Predictor | /get_template_imgs.py | UTF-8 | 2,804 | 2.78125 | 3 | [
"MIT"
] | permissive | import cv2
import argparse
import copy
import numpy as np
def show_circles(img_):
img = copy.deepcopy(img_)
gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
img = cv2.medianBlur(img,5)
circles = cv2.HoughCircles(gray, cv2.HOUGH_GRADIENT, 1, 50,
param1=300, param2=40, minRad... | true |
a986a2b52dbc71ef47a8f6ab8d33fdd59a5a6ab2 | leonwind/flappy-bird-ai | /flappy_bird/bird.py | UTF-8 | 1,013 | 3.609375 | 4 | [] | no_license | import pygame
class Bird:
VELOCITY = -10.5
GRAVITY = 3
MAX_DISPLACEMENT = 20
def __init__(self, pos_x, pos_y, bird_img):
self.pos_x = pos_x
self.pos_y = pos_y
self.alive = True
self.time_since_jump = 0
self.bird_img: pygame.Surface = bird_img
def jump(sel... | true |
5cc09364b86d20320f636448d2d86d1b9cc68481 | Weeeeeh/hackerrank-challenge-solution | /code.gyp | UTF-8 | 477 | 3.140625 | 3 | [] | no_license | def efficientJanitor(weight, n):
weight.sort()
left_i = 0
trips = 0
n = 3
for i in range(n-1, -1, -1):
if(weight[i] > 1.99):
trips+=1
elif(weight[i] <= 1.99):
if(weight[i]+weight[left_i] <= 3):
left_i+=1
trips+=1
if(left... | true |
ed91c800c52164cf5067668a57e6bd07b7134b9e | SeunghyeunBaek/study_recommendation_system | /02_model_based_CF/src/svd.py | UTF-8 | 1,938 | 3.03125 | 3 | [] | no_license | # from sklearn.decomposition import TruncatedSVD
from scipy.sparse.linalg import svds
import pandas as pd
import numpy as np
import os
"""
https://heartbeat.fritz.ai/recommender-systems-with-python-part-iii-collaborative-filtering-singular-value-decomposition-5b5dcb3f242b
"""
def get_completed_matrix():
# Load da... | true |
dd500e425305424f8168c6f55051bf202694cd78 | etsuura/ImageSignalProcessing | /Assignment1/Assignment1.py | UTF-8 | 1,911 | 2.984375 | 3 | [] | no_license | import sys
import os
import numpy as np
import cv2
def resize(image, scale):
orgHeight, orgWidth = image.shape[:2]
size = (int(orgWidth / scale), int(orgHeight / scale))
reduced_img = cv2.resize(image, size)
return reduced_img
def grayscale_formula(filename):
current_path = os.getcwd()
infi... | true |
6afc0765d6483e76fbc78fab8ca1d8a50a559f22 | DaVinci42/LeetCode | /988.SmallestStringStartingFromLeaf.py | UTF-8 | 968 | 3.15625 | 3 | [] | no_license | from typing import List, Dict
# 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 smallestFromLeaf(self, root: TreeNode) -> str:
if not root:
... | true |
7155ae4af423eb890ecdc54bbc968ca9e98954ac | ffRunKey/QFactorModel | /MiddleData/DataWash.py | UTF-8 | 3,209 | 2.5625 | 3 | [] | no_license | # -- coding: utf-8 --
# Author:zouhao
# email:1084848158@qq.com
'''
数据手动导入,清洗
'''
import pandas as pd
import mylog as mylog
import numpy as np
from GetAndSaveWindData.GetDataToMysql import GetDataToMysql
class DataWash:
def __init__(self):
self.GetDataToMysqlDemo = GetDataToMysql()
def getMain(... | true |
d46617b42f315853ac341495f3e02a7555e7dceb | ozmenbrn/university_projects | /CmpE493_Intro_Information_Retrival/project2/info_retrival.py | UTF-8 | 56,554 | 3.0625 | 3 | [] | no_license | #!/usr/bin/python
import os, sys, glob, time, re
import ast, math, collections
testList = []
trainList = []
vocabCounter = 0
earnCount = 0
acqCount = 0
moneyCount = 0
grainCount = 0
crudeCount = 0
earnOccuranceMap = dict()
acqOccuranceMap = dict()
moneyOccuranceMap = dict()
grainOccuranceMap = d... | true |
16e1d733bed48e3fe6bcf6a04f53f24ba327f912 | Wistick/homeworks_skillfactory | /battleships/battleships/game_logic.py | UTF-8 | 3,060 | 3.734375 | 4 | [] | no_license | from board import *
from battleship import Ship
from player import *
class Game:
def __init__(self, size=6):
self.size = size
pl = self.choose_place()
co = self.random_board()
co.hidden = True
self.ai = AI(co, pl)
self.user = User(pl, co)
def random_board(sel... | true |
06b587d02f0d9708902c93e4e8e25a7c60c2cbb3 | Yoatn/stepik.org | /adaptive_python/3.6 Number sequence.py | UTF-8 | 1,426 | 3.296875 | 3 | [] | no_license | # --------------------------------------------------
# Programm by Yoatn
#
# Start date 07.01.2018 14:32
# End date
#
# Description:
# Напишите программу, которая выводит nn первых
# элементов последовательности 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 ...
# (число повторяется столько раз, чему равно).
#
# Формат ввода... | true |
74809726f09f18ee04c5c4d8d83d2364bb8a3d06 | joseluisvaz/machine_learning_itesm | /ML_Algorithms/Kernel.py | UTF-8 | 673 | 3.140625 | 3 | [] | no_license | import numpy as np
import numpy.linalg as la
class Kernel(object):
"""
This class hass several methods which represent different kernel functions
to use with Kernel Methods e.g. Support Vector Machines
"""
@staticmethod
def linear():
def f(x, y):
return np.inner(x, y)
... | true |
981129e2082eadc9fb3905deb434b44eb892c40f | LXC19980829/-Digital--image-processing | /exp01.py | UTF-8 | 3,643 | 2.953125 | 3 | [] | no_license | import cv2
import numpy as np
import pandas as pd
from PIL import Image
import matplotlib.pylab as plt
from skimage import io
#显示图片
# img = cv2.imread("dog1.jpg")
# print("Shape of the image:",img.shape,"\n\n") #img.shape三个参数分别为:读入图片的高度、读入图片的宽度、读入图像通道数(默认为三通道,设置为-1则为原通道输入)
# cv2.imshow('dog',img)
# cv2.waitKey(0)
#显... | true |
50db02de42ff1e62c34e2a3c816fe21ec84cf003 | taketakeyyy/atcoder | /abc/145/c.py | UTF-8 | 2,147 | 3.3125 | 3 | [] | no_license | # -*- coding:utf-8 -*-
import copy
from math import factorial
def solve2():
N = int(input())
cities = [[None, None]]
for i in range(N):
x, y = list(map(int, input().split()))
cities.append([x,y])
def calc_distance(a, b):
return ((a[0]-b[0])**2+(a[1]-b[1])**2)**(1/2)
memo =... | true |
18a51a5aec06646a249ffb9f8e18166cdfc92461 | alolika9/NLP | /path_jaccard.py | UTF-8 | 558 | 2.578125 | 3 | [] | no_license | def path_jaccard(s1,s2):
i=0
for word1, word2 in product(s1,s2):
t=0
count=0
syns1 = wn.synsets(word1)
syns2 = wn.synsets(word2)
for sense1, sense2 in product(syns1, syns2):
d = wn.path_similarity(sense1, sense2)
if(d!=None and d>0.5):
t=t+d... | true |
078a6c52ec71963b722ee11311f6abdf0b3eb78a | crackCodeLogn/FinanceTracker | /test/HelperTest.py | UTF-8 | 671 | 2.875 | 3 | [] | no_license | # @author Vivek
# @version 1.0
# @since 30-07-2019
import unittest
from util.Helper import Helper
class HelperTest(unittest.TestCase):
helper = Helper()
def test_get_num_total_days(self):
self.assertEqual(28, self.helper.get_num_total_days(2019, 2))
self.assertEqual(31, self.helper.get_num_... | true |
a2ba138b7eef4427a3af7d21a782cc099b24e523 | 633-1-ALGO/introduction-python-Loic-Srd | /11.1- Exercice - Boucle/boucle1.py | UTF-8 | 314 | 3.90625 | 4 | [] | no_license | # Problème : Etant donné un tableau A de "n" nombres réels, on demande la moyenne des nombres du tableau
# Données : un tableau A de n nombre réels
# Résultat attendu : Moyenne des nombres réels du tableau A
A = [1, 5, 15, 25, 10, 55, 50, 35]
b = 0
for i in range(0, len(A)):
b += A[i]
print(b/len(A))
| true |
45846731f76ef291a0de0c0707feee62b80bded6 | gabriellaec/desoft-analise-exercicios | /backup/user_078/ch35_2020_09_16_13_22_22_228154.py | UTF-8 | 214 | 3.84375 | 4 | [] | no_license | pica = True
soma = 0
while pica:
numero = float(input('Insira um número: '))
if numero == 0:
soma += 0
print (soma)
pica = False
else:
soma += numero
print(soma) | true |
7366ff2857a2c829958e65b3d5c494ed1da9b7f0 | aojedao/3DPrintingCalculator | /root/src/graficos2.py | UTF-8 | 1,715 | 3.0625 | 3 | [] | no_license | from matplotlib import pyplot
from list_arrays import *
class Graficas:
def graficoconsumo(self,data,flag=False):
print("llega")
dta=data
datos = ('Filamento','Electricidad','Depreciacion de la impresora','Preparacion','Post-procesing','Consumibles')
if not flag:
slices... | true |
c360ca369168f85ab912f20d990ac48e0a6beb7e | bcoon/Inventory | /Inventory/CustomerSide.py | UTF-8 | 1,804 | 3.375 | 3 | [] | no_license | '''
Created on Sep 12, 2013
Imports inventory data from a csv file with format
ID, price, quantity
@author: Brian
'''
from sys import stdout
from InventorySide import Inventory
import locale
if __name__ == '__main__':
locale.setlocale(locale.LC_ALL, '')
inventory = Inventory()
#open the i... | true |
6abf084dd4467b0a7b2c610962be90092bcecfff | kinseyreeves/Interview-Questions | /Euler/5_smallest_multiple.py | UTF-8 | 211 | 3.5625 | 4 | [] | no_license | def divis_by(n, max):
for i in range(1, max + 1):
if (n % i != 0):
return False
return True
for i in range(1, 1000000000):
if (divis_by(i, 20)):
print(i)
break
| true |
e5a2cdf1150f53c01d04faae2ba8518cc17ac15d | bappi2097/hackerrank-python | /hackerrank/collections-ordereddict.py | UTF-8 | 519 | 3.28125 | 3 | [] | no_license | from collections import OrderedDict
# read and write in text file
# --------start--------
import sys
sys.stdin = open("../input.txt", "r")
sys.stdout = open("../output.txt", "w")
# --------end--------
order_dict = OrderedDict()
for _ in range(int(input())):
inp = input().split()
s = " ".join(inp[:len(inp)-1]... | true |
ec1089ccb73a1e627086da9372b49cd3ef747fd6 | adafruit/circuitpython | /tests/extmod/vfs_lfs_error.py | UTF-8 | 2,689 | 2.671875 | 3 | [
"MIT",
"GPL-1.0-or-later"
] | permissive | # Test for VfsLittle using a RAM device, testing error handling
try:
import uos
uos.VfsLfs1
uos.VfsLfs2
except (ImportError, AttributeError):
print("SKIP")
raise SystemExit
class RAMBlockDevice:
ERASE_BLOCK_SIZE = 1024
def __init__(self, blocks):
self.data = bytearray(blocks * s... | true |
2fcc5098a6d6f94960aae65a8ee7fa84e7db758f | stonkgs/stonkgs | /tests/test_version.py | UTF-8 | 401 | 2.90625 | 3 | [
"MIT"
] | permissive | # -*- coding: utf-8 -*-
"""Trivial version test."""
import unittest
from stonkgs.version import get_version
class TestVersion(unittest.TestCase):
"""Trivially test a version."""
def test_version_type(self):
"""Test the version is a string.
This is only meant to be an example test.
... | true |