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 |
|---|---|---|---|---|---|---|---|---|---|---|
b7282e3df479c69f011085d81ce3523b9af22fec | chenxiang0108/python | /ch7-3.py | UTF-8 | 727 | 3.796875 | 4 | [] | no_license | class shoppingcar():
def __init__(self,owner):
self.__owner = owner
self.__product = []
def getowner(self):
return self.__owner
# 新增到購物車
def addproduct(self,product):
self.__product.append(product)
# 從購物車移除
def removeproduct(self,product):
self.... | true |
805b48b94e0c11d6e9293d77a1b92522dd0120c7 | ManUtdMoon/Gym-Carla | /gym_carla/envs/misc.py | UTF-8 | 1,228 | 2.984375 | 3 | [] | no_license | #!/usr/bin/env python
# Copyright (c) 2020: Dongjie yu (yudongjie.moon@foxmail.com)
#
# This file is modified from <https://github.com/cjy1992/gym-carla>:
# Copyright (c) 2019:
# authors: Jianyu Chen (jianyuchen@berkeley.edu).
#
# This work is licensed under the terms of the MIT license.
# For a copy, see <https://ope... | true |
be97c1aaac73c2039c0b059b4f446a8d6959b3e8 | jhochmuth/YouToxic | /youtoxic/app/services/pipeline.py | UTF-8 | 9,826 | 2.671875 | 3 | [] | no_license | """Contains implementation of the Pipeline object.
"""
# TODO: Eliminate the need for the fastai import.
from fastai.text.transform import Tokenizer
import numpy as np
import torch
from torch.autograd.variable import Variable
from youtoxic.app.utils.functions import softmax
from youtoxic.app.utils.load_files import... | true |
50b6f9db866015a19a9164ca0518a3eb294ba58e | kamezamw/notes | /python/elasticsearch_query.py | UTF-8 | 1,465 | 2.671875 | 3 | [
"MIT"
] | permissive | #!/usr/bin/env python
import json
import argparse
from elasticsearch import Elasticsearch,helpers
def jsonpretty(text):
return json.dumps(text, indent=4, sort_keys=True)
def arguments_parser():
parser = argparse.ArgumentParser(description="Options:")
parser.add_argument('--host', help='hostname', defaul... | true |
112d67490aa59c14fd356d9ed1f859b0d93edaac | plaethos01/Automate-the-Boring-Stuff-with-Python-Solutions | /Chapter-03/Collatz.py | UTF-8 | 364 | 3.859375 | 4 | [] | no_license | import sys
def collatz(number):
if number%2==0:
ans=number//2
print(ans)
else:
ans=3*number+1
print(ans)
return ans
print('Enter Number: ')
while True:
try:
x=collatz(int(input()))
except ValueError:
print('Wrong Input: Enter an i... | true |
a2a4447904044c53a6f05fa6d46ba46d28e1bf48 | BassP97/CTCI | /Med/rightPoint.py | UTF-8 | 565 | 4.25 | 4 | [] | no_license | """
Write a program in your language of choice that prints the numbers from 1 to 100. But for multiples of three print “right” instead of the number and for the multiples of five print “point”. For numbers which are multiples of both three and five print “rightpoint”.*
"""
def rightPoint():
for i in range(1,101):
... | true |
2258a3b11a0ca9cdf55cdc08383091eb77a826da | AlexanderEkeh/A-ToDo-List-Application | /dowell/forms.py | UTF-8 | 1,231 | 2.515625 | 3 | [] | no_license | from wtforms import Form, BooleanField, TextField, PasswordField, validators, TextAreaField
class RegistrationForm(Form):
username = TextField('Username', [validators.Length(min=4, max=25, message=None)])
email = TextField('Email', [validators.Email(message = "Please enter a valid email address.")])
passwo... | true |
4aa12c4436861a46ec577017055aa708196078ac | khwla23/Piaic | /slicing.py | UTF-8 | 72 | 3.140625 | 3 | [] | no_license | lst = [1,3,5,0,13,2]
new_lst = [lst[2] , lst[3], lst[4]]
print(new_lst)
| true |
c6abe09bbb87032defe1c0874581e4308139c503 | zarkle/code_challenges | /leetcode/excel_col_num.py | UTF-8 | 344 | 3.21875 | 3 | [] | no_license | # https://leetcode.com/problems/excel-sheet-column-number/
# runtime: 28 ms, 74%; memory: 10.7 MB, 51%
class Solution(object):
def titleToNumber(self, s):
"""
:type s: str
:rtype: int
"""
res = 0
for letter in s:
res *= 26
res += ord(letter) ... | true |
d42fd06bd3c6502873ccb05ac3d60c149375f9d0 | rifqideveloper/pirple-home-work | /python/class.py | UTF-8 | 3,223 | 3.328125 | 3 | [] | no_license | import random
class Vehicle:
def __init__(self,Make, Model, Year, w ,t=0 , n=False):
self.Make = Make
self.Model = Model
self.Year = Year
self.Weight = w
self.NeedsMaintenance = n
self.TripsSinceMaintenance = t
def Vehicle_spec(self):
return " ma... | true |
eef18cd20cc422161390797a6fa84c60f1ad66a4 | tp6fu6m3/Chatbot | /chatbot.py | UTF-8 | 1,955 | 2.921875 | 3 | [] | no_license | # -*- coding: utf-8 -*-
import os
import random
from console import Console
from RuleMatcher.answerer import Answerer
class Chatbot(object):
def __init__(self, isChat):
self.speech_domain = ''
self.isChat = isChat
if isChat:
self.console = Console()
self.an... | true |
0d247fe5834f677a9c26cf304bc6b77c80f33566 | Parvez-Khan-1/Practical_ML | /tensorflow/basic_operation_using_tf_placeholder.py | UTF-8 | 688 | 2.734375 | 3 | [] | no_license | import os
import tensorflow as tf
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3'
val1 = tf.placeholder(tf.int32)
val2 = tf.placeholder(tf.int32)
add = tf.add(val1, val2)
sub = tf.subtract(val1, val2)
mul = tf.multiply(val1, val2)
div = tf.divide(val1, val2)
mod = tf.mod(val1, val2)
with tf.Session() as sess:
print(... | true |
d35c2406b85a8bdb83d8bb99f8813ca1852e48c8 | filipesouzacit/plotScript | /createPlotLines.py | UTF-8 | 1,782 | 2.5625 | 3 | [] | no_license | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed Mar 31 23:10:11 2021
@author: filipe
"""
import sys
import glob
import matplotlib.pyplot as plt
import numpy as np
import os
if __name__ == '__main__':
if len(sys.argv) < 2:
print ("Error - Incorrect input")
print ("Expecting python... | true |
fa7ddfb0e333f5936e88c0c35f0131e0afdf2618 | kimkh0930/korea-ipo-scraper | /crawling_38com.py | UTF-8 | 11,976 | 2.625 | 3 | [
"MIT"
] | permissive | import requests
import pandas as pd
from datetime import datetime, timedelta
from bs4 import BeautifulSoup
from enum import Enum
class DemandForcastColumn(Enum):
IPO_AMOUNT = 0 #공모 규모
COMPETITION_RATIO = 1 #기관 경쟁률
COMMITMENT_RATIO = 2 #의무보유 확약 비율
class BiddingDateColumn(Enum):
... | true |
c7098cf57424fe05ec4b92412e4f1ac888d37bda | IsaacVG/Red-PC | /RED_PC-master/PYTHON/pull_by_road.py | UTF-8 | 2,299 | 2.765625 | 3 | [] | no_license | # from urllib2 import Request, urlopen
from urllib.request import Request, urlopen
import json
import pandas as pd
# from StringIO import StringIO
from io import StringIO
import numpy as np
import googlemaps
import time
#import matplotlib.pyplot as plt
# Modify with own key
keyJASL = 'AIzaSyDVWjCMy78Zuk244tB3duLXCK2v... | true |
046483eb22128b5c3e5f4bd868d6ac35314ba9bd | BattalionCommander/Python | /Code/untitled1/KNN_3.py | UTF-8 | 2,175 | 3.3125 | 3 | [] | no_license | import numpy as np
import matplotlib.pyplot as plt
from sklearn import neighbors, datasets
#颜色库
from matplotlib.colors import ListedColormap
# 创建颜色集
cmap_light = ListedColormap(['#FFAAAA', '#AAFFAA', '#AAAAFF'])
cmap_bold = ListedColormap(['#FF0000', '#00FF00', '#0000FF'])
# 导入鸢尾花数据
iris = datasets.load_iris()
X = ir... | true |
8ba8907bae0d698b5bdb5cb8ef46f1ae13d6816f | tobias-fyi/vela | /cs/lambda_cs/07_computer_architecture/ls8/cpu.py | UTF-8 | 9,220 | 3.703125 | 4 | [
"MIT"
] | permissive | """Computer Architecture :: CPU emulator class"""
import os
import sys
class CPU:
"""Main CPU class."""
def __init__(self):
"""Construct a new CPU."""
# 256 bytes (8 bits = 1 byte) of RAM
self.ram = [0b00000000] * 256
# === Internal registers === #
self.reg = [0b0000... | true |
923840f289ead46b53de1861a01573baed26d140 | Aurel509/PythonLearning | /scripts/exos/ex2.py | UTF-8 | 477 | 4.34375 | 4 | [] | no_license | #On récupère la valeur donnée par l'utilisateur
reponse = input('Donnez votre âge : ')
#On transforme la valeur récupérée en nombre
age = int(reponse)
#On vérifie si l'âge donné est valide.
if(age > 0 and age < 120):
#Vérification de l'âge
if(age < 18):
print("Vous êtes mineur")
else:
print(... | true |
8c6a1ea2e32f89297cd77eb2a29db66c52df79eb | bbnsdevelop/python_3_estudos | /python3/fundamentos/dicionario.py | UTF-8 | 667 | 3.703125 | 4 | [] | no_license | #!/usr/bin/python
# coding: utf-8
dicionario = {'chave1': 'valor', 'chave2': 3}
print(dicionario)
for item in dicionario:
print(dicionario[item])
lista = dicionario.values()
print(lista)
lista = dicionario.keys()
print(lista)
for i in lista:
print(i)
pessoa = {'nome': 'Ana', 'idade': 38, 'cursos': [... | true |
f9cc215cd0d5c817cc674a17a34ed926db07279c | nate2411/lifechoices-online | /sign_up.py | UTF-8 | 4,282 | 2.828125 | 3 | [] | no_license | from datetime import datetime
from tkinter import *
from info import *
from tkinter import messagebox
from database_connection import *
window = Tk()
window.title("Life Choices Online")
window.geometry("500x440")
# Will check information
def validate_entries(name, surname, id_number, phone_number, nok_name, nok_pho... | true |
edb0171b0a9c9a9c949fa4f668473a3af74f698c | vektorelpython19/pythontemel | /OpenCV/Utku/OpenCv2.py | UTF-8 | 268 | 2.53125 | 3 | [] | no_license | import cv2
import numpy as np
from matplotlib import pyplot as plt
# RGB
# BGR
img = cv2.imread(r"OpenCV\resim.jpg")
gri = cv2.cvtColor(img,cv2.COLOR_BGR2GRAY)
print(gri[55,55])
print(gri.shape)
cv2.imshow("resmi ekledim",gri)
cv2.waitKey(0)
cv2.destroyAllWindows() | true |
ed03a4231b6711343f71593bc79babbdcf319707 | RushaliRajesh/gcnn_keras | /kgcnn/ops/initializer.py | UTF-8 | 919 | 2.828125 | 3 | [
"MIT"
] | permissive | import tensorflow as tf
import tensorflow.keras as ks
@tf.keras.utils.register_keras_serializable(package='kgcnn',name='glorot_orthogonal')
class GlorotOrthogonal(tf.initializers.Initializer):
"""
@TODO: Generalize and inherit from Orthogonal
(stated by eg. "Reducing overfitting in deep networks by decorre... | true |
8268764f8619057c8900b6ba7f85be8c58682b6c | simonolander/euler | /euler-181.py | UTF-8 | 647 | 3.125 | 3 | [
"MIT"
] | permissive | def rec(b, w, b1, w1, memo):
if (b, w, b1, w1) in memo:
return memo[(b, w, b1, w1)]
if b == 0 and w == 0:
return 1
ans = 0
min_b2 = 1 if b > 0 else 0
max_b2 = min(b, b1)
for b2 in range(min_b2, max_b2 + 1):
min_w2 = 1 if b2 == 0 else 0
max_w2 = min(w, w1 if b2 ==... | true |
8b9536ede681aec996354876c5fed87b4e225adc | zauberzeug/nicegui | /website/more_documentation/menu_documentation.py | UTF-8 | 1,188 | 2.78125 | 3 | [
"MIT"
] | permissive | from nicegui import ui
from ..documentation_tools import text_demo
def main_demo() -> None:
with ui.row().classes('w-full items-center'):
result = ui.label().classes('mr-auto')
with ui.button(icon='menu'):
with ui.menu() as menu:
ui.menu_item('Menu item 1', lambda: res... | true |
4055d1667ec7681aee6a051ddaa208aa02811192 | eaydin-dev/GTU_Courses | /Machine_Learning/feature_selection/part3.py | UTF-8 | 1,075 | 3.5625 | 4 | [] | no_license |
"""
Part 3: Principal component analysis for classification.
o Pick a dataset for classification.
o Apply PCA on the real-valued attributes of the data.
o Choose a set of principle components to train a classification algorithm of your choice.
o Draw the graph showing the accuracy vs the number of components used.
o ... | true |
721ff0097e1b104907b4149e180709b1b794a5c2 | JoannaSM/kodolamacz-simple_calculator | /calkulator_better.py | UTF-8 | 2,097 | 4.375 | 4 | [] | no_license | def main():
next_operation = True
while next_operation:
print('Podaj w oddzielnych wierszach liczbę, operację matematyczną: +,-,*,/,%, a następnie kolejną liczbę:')
print('')
input_1 = input('liczba > ')
while not isfloat(input_1):
print('To nie jest liczba!')
... | true |
fcade2e77bae3b4f6ad086ddf0d76d9daf4a2566 | williamcheung94/CISC5950P1Q2.1 | /reducer.py | UTF-8 | 1,398 | 3.296875 | 3 | [] | no_license | #!/usr/bin/python
import sys
stat = {}
# get the keys and values
for line in sys.stdin:
line = line.strip()
pair, shot_raw = line.split('\t')
a, b = shot_raw.split('m')
shot = (int(a), int(b))
# combaine them
if pair not in stat.keys():
stat[pair] = shot
else:
stat[pair] = ... | true |
8cc476c1e44448901b8639d8d03974b74c666fff | ShahradX/Term2 | /example_turtle01.py | UTF-8 | 68 | 2.828125 | 3 | [] | no_license | from turtle import Turtle, done
t = Turtle()
t.circle(50)
done() | true |
d2af62ef77f34a3bcd7ec2c26a3272e6c83c343d | 40586/Selection | /Selection_stretch2.py | UTF-8 | 901 | 3.375 | 3 | [] | no_license | #kieran burnett
# 7-10-2014
#stretch Ex2
date = int(input("Please enter the date in the format: DdMmYy : with no spaces or breaks"))
day = str(date)[0:2]
month = str(date)[2:4]
year = str(date)[4:6]
#DAY_P
int(year)
#MONTH_P
if month == "01":
month_p = "January"
elif month == "02":
month_p ... | true |
849e5e1fbae9b42a72f686d19c0b73ae812f9291 | Randle9000/pythonCheatSheet | /pythonCourseEu/Math/__init__.py | UTF-8 | 1,049 | 3.671875 | 4 | [] | no_license | def first_word(text: str) -> str:
# my solution
# list = []
# trigger = False
# counter = 0
# for character in text:
# if not trigger and character.isalpha():
# list.append(counter)
# trigger = True
# if trigger and not character.isalpha() and charact... | true |
147944b55bb5e4e2570a9b651c63f0c408d91c1d | filenkoB/databases | /lab3/view.py | UTF-8 | 4,416 | 2.796875 | 3 | [] | no_license | from model import Model
import time
class View:
def __init__(self):
self.model = Model()
def insert_goods(self, item):
self.model.insert_goods(item)
print("Done! {} was inserted!".format(item))
def insert_customer(self, item):
self.model.insert_customer(item)
prin... | true |
a1f2302c5744a36d75736b00c03a0ba9f18ecff5 | hb918902/Python_easypractices | /0021/0021.py | UTF-8 | 826 | 3.390625 | 3 | [] | no_license | #! /usr/bin/python3
# -*-coding:utf-8-*-
import uuid
import hashlib
def encrypt_password(password,salt=None):
if salt is None:
salt = uuid.uuid4().hex
result = password
for i in range(10):
result = hashlib.sha256(salt.encode() + result.encode()).hexdigest()
return result + ':' + salt
... | true |
5c9b6e8a4db58fc8ffbba2bc369af4532c808159 | TheBigFish/simple-python | /socketserver/mytcphandle_client.py | UTF-8 | 619 | 2.921875 | 3 | [
"MIT"
] | permissive | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @File : mytcphandle_client.py
# @Author: yubo
# @Date : 2018/12/19
# @Desc :
import socket
import sys
HOST, PORT = "localhost", 9999
data = "hello" #" ".join(sys.argv[1:])
# Create a socket (SOCK_STREAM means a TCP socket)
sock = socket.socket(socket.AF_INET, socke... | true |
47a0cb15ffe4b2f694d80c9cddaa65a00d991699 | lindo-zy/leetcode | /字节/41.py | UTF-8 | 728 | 3.359375 | 3 | [] | no_license | #!/usr/bin/python3
# -*- coding:utf-8 -*-
from typing import List
class Solution:
def firstMissingPositive(self, nums: List[int]) -> int:
n = len(nums)
for i in range(n):
while 1 <= nums[i] <= n and nums[i] != nums[nums[i] - 1]:
nums[nums[i] - 1], nums[i] = nums[i], num... | true |
1c71f5f42abbf11ce575ce47767c839184802de6 | cassLaffan/Neural_Network | /localize_images.py | UTF-8 | 387 | 2.53125 | 3 | [] | no_license | from PIL import Image
import requests
from io import BytesIO
link_list = []
# Takes a URL and sucks the image out of it
# I'm keeping that phrasing
def skim_image(url, num):
response = requests.get(url)
img = Image.open(BytesIO(response.content))
path_name = 'C:/Users/Cassandra/C Coding/CNN/Tra... | true |
ffa3be4e4af8bb1ce9375345a7d99bfed71d8d74 | StefanDimitrovDimitrov/Python_Fundamentals | /Python_Fundamentals/Fundamentals level/03.Data Types/02. Centuries to Minutes.py | UTF-8 | 449 | 3.625 | 4 | [] | no_license | # centuries = int(input())
#
# years = centuries * 100
# days = int(years * 365.2422)
# hours = days * 24
# minutes = hours * 60
#
# print(f'{centuries} centuries = {years} years = {days} days = {hours} hours = {minutes} minutes')
centuries = int(input())
years = centuries * 100
days = int(years * 365.2422)
hours = ... | true |
e50d8642ec6c74b97916c5bb17e6443ddb6ae7dd | Akif-Mufti/Machine-Learning-with-Python | /Lm_ridge1.py | UTF-8 | 1,933 | 3.4375 | 3 | [] | no_license | # -*- coding: utf-8 -*-
"""
Created on Sun Apr 16 16:02:08 2017
@author: user
"""
#Ridge Regression
from sklearn.linear_model import Ridge
import matplotlib.pyplot as plt
import numpy as np
from sklearn.linear_model import LinearRegression
import mglearn
try:
from sklearn.datasets import train_test_sp... | true |
e8f841d51d50ada6b67103a96edb74c567b06062 | wisest30/AlgoStudy | /source/leetcode/1673/hyoseong.py | UTF-8 | 545 | 2.84375 | 3 | [] | no_license | from heapq import heappush as hpush, heappop as hpop, heapify as hfy
class Solution:
def mostCompetitive(self, nums: List[int], k: int) -> List[int]:
n = len(nums)
A = []
q = []
for i in range(n - k + 1) :
hpush(q, [nums[i], i])
A.append(hpop(q))
... | true |
6763c50d6a47a07c0756c5b4646397ce7dfd95fa | mshadloo/Algorithm | /array-bootcamp.py | UTF-8 | 1,209 | 3.1875 | 3 | [] | no_license | import math;
def nextPermutation(p):
n=len(p)
if(n==1):
return None
if(isMaximum(p)):
return None
if(n==2):
switch(p,0,1)
return p;
# isDone=False
# for k in range(n-2,-1,-1):
# s=nextPermutation(p[k:n])
# if(s is None):
# for i in range(n-1... | true |
3c52ddc8875defdb52629f7435f73dd5db6c4ff0 | zonanjaro86/atcoder | /python/src/arc114_b.py | UTF-8 | 1,048 | 3.234375 | 3 | [] | no_license | # N = int(input())
# f = tuple(map(int, input().split()))
N = 2
f = (2, 1)
mod = 998244353
class UnionFindTree:
def __init__(self, n):
self.size = [0]*n
self.parents = [0]*n
for i in range(n):
self.make_tree(i)
def make_tree(self, x):
self.parents[x] = x
s... | true |
85ba907519c5a304e2b725d9dc77361338d5e9df | Lumiere2304/Information-Communication-Technology | /HW5/Exercise 2.py | UTF-8 | 144 | 4.25 | 4 | [] | no_license | # Exercise 2:
n = int(input("Enter a positive integer: "))
sum = n * (n + 1) / 2
print("The sum of the first", n, "positive integers", sum) | true |
2adbf61bbda51913854da7a612f33c92a1bedc3f | siyunw/RNAseq | /utility/check_header.py | UTF-8 | 628 | 2.59375 | 3 | [] | no_license | #!/usr/bin/python
import sys
import gzip
import pdb
f1=gzip.open(sys.argv[1],'rb')
f2=gzip.open(sys.argv[2],'rb')
m = 4000000
i=1
c=10000
while i < m:
if (i % c) ==0:
sys.stderr.write('At line ' + str(i) + '\n')
line1=next(f1)
line2=next(f2)
id1=line1.split()
id2=line2.split()
seq1=n... | true |
8e50883770b5e922b952d92cd1b7eebf0007d632 | hongwenjun/pillow_font | /image_font.py | UTF-8 | 1,040 | 3.015625 | 3 | [] | no_license | import os, sys, glob
from PIL import Image, ImageDraw, ImageFont
text = [ "!\"#$%&]'()*+,-./0123456789:;<=>?@",
"ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`",
"abcdefghijklmnopqrstuvwxyz{|}~" ]
files = []
for f in sys.argv[1:]:
files = files + glob.glob(f)
for f in files:
im = Image.open("bg.png")
(width, ... | true |
480336569cea57640f1651ceff8ad568a82e9060 | es0j/gdplataforma | /main 2/gameClasses.py | UTF-8 | 10,746 | 2.640625 | 3 | [] | no_license | import pygame
import game
from gameConstants import *
from auxiliares import *
class Entity(pygame.sprite.Sprite):
def __init__(self,rect,path="",tags=[],color="#DD00FF",netstate=IS_MIRROR):
super().__init__()
print(isinstance(game.GameManager,object))
self.manager=game.game.GameManager.ins... | true |
6e23f20d29b16720576d4762019db55e2d81dea1 | bara111/BookStore-master | /BookStore/catalog servers/first replica/Flask_app.py | UTF-8 | 14,950 | 2.515625 | 3 | [] | no_license | import os
import json
from flask import Flask,request,redirect
def readDistributedSystemsFile(): #read DOS files
dataForDosBooks = {}
namesForDosBooks=[]
quantitysForDosBooks=[]
idsForDosBooks=[]
dataForDosBooks['book'] = []
f = open("/home/bara111/FlaskApp/distributed_systems.txt", "r")
m... | true |
237db246307cd188ab066884ddd857b3f77dc7df | Jake-Moss/chess-analysis | /processing.py | UTF-8 | 3,689 | 3.109375 | 3 | [] | no_license | #!/usr/bin/env python3
import chess
import chess.pgn
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from typing import List, Tuple, Dict, Union
def uci_to_1d_array_index(uci: str) -> int:
""""
Converts uci notation to 1d array indexing.
a b c
------
8|1 2 3 --> [1... | true |
5c3b19c50836b9401fef05a404bdf27def67d15f | DanielBraunstein/beltGit | /apps/beltApp/models.py | UTF-8 | 3,644 | 2.65625 | 3 | [] | no_license | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import re
import bcrypt
from django.db import models
import time
EMAIL_REGEX = re.compile(r'^[a-zA-Z0-9\.\+_-]+@[a-zA-Z0-9\._-]+\.[a-zA-Z]*$')
MONOMIAL_REGEX = re.compile(r'^[a-zA-Z0-9]\w+$')
BINOMIAL_REGEX = re.compile(r'^[a-zA-Z\.\+_-]{2,}[\ ]{1}[a-zA-Z... | true |
00248a6d17f461afa600f7fbbafd3d89cca852a4 | razco/music_similarity | /alg/utils.py | UTF-8 | 2,339 | 3.109375 | 3 | [
"MIT"
] | permissive | '''
Created on Sep 3, 2017
@author: Raz
'''
import numpy as np
import sys
from collections import namedtuple
def print_mat(mat):
if len(mat.shape) == 2:
for y in xrange(mat.shape[0]):
for x in xrange(mat.shape[1]):
sys.stdout.write('%s\t' % str(mat[y][x]))
print ''... | true |
6330920b9ae75be6eab3a61f5dcbf744a008e0c4 | flow123d/flow123d | /bin/python/python_path_script.py | UTF-8 | 3,010 | 2.953125 | 3 | [] | no_license | #!/usr/bin/python
# -*- coding: utf-8 -*-
# author: Jan Hybs
from optparse import OptionParser
import sys, os, re, json
usage="""
Simple script for getting information about python paths and python in general
$> python_path_script ACTION [--format FORMAT]
ACTION must be one of the following:
sys_prefix ... | true |
929297de1484e3a2eba14cc634fd8a2b1174aaf5 | Nightaway/LeNet5 | /train.py | UTF-8 | 1,510 | 2.8125 | 3 | [] | no_license | from LeNet import *
from dataset import *
import torch.optim as optim
import torchvision
import torchvision.transforms as transforms
import matplotlib.pyplot as plt
import numpy as np
classes = ('0', '1', '2', '3', '4', '5', '6', '7', '8', '9')
net = LeNet()
criterion = nn.CrossEntropyLoss()
# create your optimizer
... | true |
4430bff393324048c4b60755c76f27fbabf5a5c9 | cutewindy/CodingInterview | /LintCode_Python/removeElem.py | UTF-8 | 679 | 4.25 | 4 | [] | no_license | # Given an array and a value, remove all occurrences of that value in place and return the new length.
# The order of elements can be changed, and the elements after the new length don't matter.
# Have you met this question in a real interview? Yes
# Example
# Given an array [0,4,4,0,0,2,4,4], value=4
# return 4 and... | true |
f5f0ade2eb31a780dfac69c3ae35421efa4abd61 | TomOnTime/timetravelpdb | /demo_program.py | UTF-8 | 251 | 3.125 | 3 | [] | no_license | #!/usr/bin/python2.6
import timetravelpdb
x = 500
def add10(number):
return number + 10
print "foo"
print "bar"
print "baz"
timetravelpdb.set_trace()
y = add10(x)
x = 15
z = x + y
for i in range(15):
print "THE NUMBER IS", i
y = add10(i)
| true |
ade85b260710fd5415f5b9b3e2d0b38803df39bc | freshklauser/fresh-hadoopspark | /notes/flume-confs/test_py/randomdata.py | UTF-8 | 485 | 3.0625 | 3 | [] | no_license | # -*- coding: utf-8 -*-
"""
Created on Fri Jan 31 19:48:01 2020
@author: Administrator
"""
import time
import random
import numpy as np
def to_txt(data):
str_data = str(data)
with open("random_data.txt", "a") as f:
f.write(str_data + '\n')
print(random.randrange(10, 100, 3))
flag = 1
while flag:
... | true |
a59bf2b53e75ec6b40b33f0f093d04b80bcadab5 | pedrooct/AVGCalculatorUFP | /api/getCredits.py | UTF-8 | 1,950 | 3.265625 | 3 | [
"MIT"
] | permissive | # -*- coding: utf-8 -*-
#Imports necessários !
from lxml import html
import time
import sys
import re
from robobrowser import RoboBrowser
from bs4 import BeautifulSoup
from bs4 import Comment
import json
'''
Esta função permite estrutura o json para um formato amigável para o php intepretar
'''
def prepareJson(json... | true |
abcf7fa882ecc463f570eb20498aa9a253b012c6 | angelicaba23/MisionTic2022 | /Python/RETOS/reto2.py | UTF-8 | 7,134 | 3.484375 | 3 | [] | no_license | """
------------MinTic-----------------
-------------UPB-------------------
-------Angélica Barranco-----------
------------RETO 2-----------------
"""
# Requisitos funcionales:
#RF01
print("\nBienvenido al sistema de ubicación para zonas públicas WIFI")
#RF02
corect_user = 51745
corect_password = 54715
user = int(in... | true |
b65084e6adc33755072f8d487a231cb58ec3cef1 | nisn/exercises | /ex19.py | UTF-8 | 145 | 3.234375 | 3 | [] | no_license |
n = 20
m = 40
soma = 0
for i in range(m-n):
if (i == 0):
pass
else:
print(n+i)
soma = soma + (n+i)
print(soma)
| true |
c5f7ffd6e25f62aeec6349d565206ee50295f8a8 | theGreenJedi/Path | /Python Books/Athena/training/exercises/exercises/python_language/ascii_log_file/ascii_log_file_solution2.py | UTF-8 | 1,028 | 3.828125 | 4 | [] | no_license | """
This version is about 35% faster than the original on largish files
because it reads in all the data at once and then uses array slicing
to assign the data elements to the correct column (or log).
"""
log_file = open('long_logs.crv')
# The first line is a header that has all the log names:
header = log_file.read... | true |
7cacbd98e50b2f0c6d0c2cd88a5d0d5dc61e539e | mrsata/social-influence | /runSteps_nonpar.py | UTF-8 | 7,136 | 2.53125 | 3 | [] | no_license | from __future__ import division
from copy import deepcopy
import random
# import matplotlib.pyplot as plt
import numpy as np
import scipy.stats as stats
import time
from item import Item
from user import User
from plat2d import Platform
import os
rdm_quality = False # assign item quality randomly
#plotQuality = False... | true |
bd4fe687fb7b43d60f27b4b5b31b8d4c33be55ad | DeryShona/Volume-Hand-control | /HandTrackingModule.py | UTF-8 | 3,534 | 2.921875 | 3 | [] | no_license | import cv2 as cv
import mediapipe as mp
import time
#Reading from the web camera
#capture = cv.VideoCapture(0)
#creating a class
#initialiazation
class handDetector():
def __init__(self, mode=False, maxHands=2, detectionCon=0.5, trackCon=0.5):
self.mode = mode
self.maxHands = maxHa... | true |
57c61bc9a0869f8b98e483b3b8bacf022e0a24a7 | Hardmun/excelFusion | /excelFusion.py | UTF-8 | 9,386 | 2.703125 | 3 | [] | no_license | import logging
import os
import sys
from copy import copy
from shutil import rmtree
from openpyxl import Workbook
from openpyxl import load_workbook
from openpyxl.utils import get_column_letter
projectDir: str = ""
loggerglobal = None
def getGlobalVariables():
"""global path"""
global projectDir
projectD... | true |
c7a81908f659965a062d77480625e62d37c2da97 | csJd/oj-codes | /leetcode/42.trapping-rain-water.py | UTF-8 | 2,380 | 3.6875 | 4 | [] | no_license | #
# @lc app=leetcode id=42 lang=python3
#
# [42] Trapping Rain Water
#
# https://leetcode.com/problems/trapping-rain-water/description/
#
# algorithms
# Hard (42.74%)
# Likes: 3491
# Dislikes: 63
# Total Accepted: 289K
# Total Submissions: 671.3K
# Testcase Example: '[0,1,0,2,1,0,1,3,2,1,2,1]'
#
# Given n non-ne... | true |
7dc13adf8b15f89d9e28c125052d932e75378dd7 | WonyJeong/algorithm-study | /koalakid1/Graph/bj-14466.py | UTF-8 | 1,668 | 2.71875 | 3 | [] | no_license | import sys
from collections import deque
def draw(i,j,area):
rm = [1,-1,0,0]
cm = [0,0,1,-1]
queue = deque([(i,j)])
graph[i][j] = area
count = 0
while queue:
r,c = queue.popleft()
if location[r][c] == 1:
count += 1
for k in range(4):
rn = r + rm... | true |
62ece68ea8ff8615d1a0ba2ce006ae22454e3c15 | Aasthaengg/IBMdataset | /Python_codes/p03283/s806791008.py | UTF-8 | 351 | 2.875 | 3 | [] | no_license | n, m, q = map(int, input().split())
x = [[0 for i in range(n)] for j in range(n)]
for i in range(m):
a, b = map(int, input().split())
x[a-1][b-1] += 1
for j in range(1, n):
for k in range(n-j):
x[k][j+k] += x[k][j+k-1] + x[k+1][j+k] - x[k+1][j+k-1]
for i in range(q):
a, b = map(int, input().... | true |
5a95b81fe3774d11e3ccf045b1ca46da901811d3 | Remper/re-coding-ws | /src/assign_category.py | UTF-8 | 2,359 | 2.9375 | 3 | [
"Apache-2.0"
] | permissive | from utils.data import load_wiki_data
import json
class Counter:
def __init__(self):
self.value = 0
self.cur = None
self.cur_uid = None
self.categories = {}
self.friends = 0
self.first = True
def add(self, target, uid, score, categories):
if self.cur !=... | true |
50f4e2eef6fd9b71bfe45115b5e014ec214d3b23 | sakshi2912/crime_management | /crime.py | UTF-8 | 7,032 | 2.8125 | 3 | [] | no_license | #!/usr/bin/env python
# coding: utf-8
# In[1]:
import psycopg2
try:
connection = psycopg2.connect(user = "postgres",
password = "q1w2e3",
host = "localhost",
port = "5432",
... | true |
e2efd8a4dd6c8f42c899ab49a59a77ec9dd6f01f | itry1997/python_work_ol | /4-13自助餐.py | UTF-8 | 195 | 3.53125 | 4 | [] | no_license | buffets=('fish','rice','cakes','sausage','beer')
for buffet in buffets:
print(buffet)
print('\n')
buffets=('chicken','rice','cakes','sausage','ice cream')
for buffet in buffets:
print(buffet)
| true |
fc04ca5427f61a6eac240ce1dd4e7369e166a06e | hyperbora/coding-test | /leetcode.com/tree/minimum_height_trees.py | UTF-8 | 2,077 | 3.890625 | 4 | [] | no_license | """
https://leetcode.com/problems/minimum-height-trees/
"""
import collections
from typing import List
import unittest
class TreeNode:
def __init__(self, x):
self.val = x
self.left = None
self.right = None
class Solution:
def findMinHeightTrees(self, n: int, edges: List[List[int]]) -... | true |
354f1341c199719987e7b1be11e726318eb3ea44 | 95Li/oldboy-learning-code | /days47/test.py | UTF-8 | 211 | 2.875 | 3 | [] | no_license | dic={'1':'a','2':'b'}
# k=list(dic)
# print(k)
a='a'
def foo(*a):
print(a)
def f(**w):
print(w)
f(a='a',b='b')
# f(dic)
foo(a)
foo(dic)
foo(a='a',b='b')
# foo()
| true |
a44921e236089898857f66c6fa15dbd018083e4e | rduvalwa5/Examples | /FilePathManuipulations/getFileTypes.py | UTF-8 | 3,211 | 3.15625 | 3 | [] | no_license | '''
Created on Oct 23, 2017
@author: rduvalwa2
get file type from specified directory
'''
import os,sys
class get_file_type():
def __init__(self, root = '.',typ = 'txt'):
self.path = root
self.spec_dirs = os.listdir(self.path)
# print(self.spec_dirs)
self.path = root
self.r... | true |
a0833350a49fb31bf384cf3a28151c955f329580 | DevHunterYZ/Perceptron | /MLP.py | UTF-8 | 989 | 2.828125 | 3 | [] | no_license | import numpy as np
import pandas as pd
import matplotlib.pylot as plt
from sklearn.neural_network import MLPClassifier
from sklearn.cross_validation import train_test_split
from sklearn.linear_model import Perceptron
data=pd.read_csv('mnist.csv')
df_x=data.iloc[:,1:]
df_y=data.iloc[:,0]
x_train, x_test, y_train, y_t... | true |
9bbc86ddb73ac8c5654ebec65a27a22d86780d64 | imalerich/imgo | /policy/generate.py | UTF-8 | 3,247 | 2.890625 | 3 | [
"MIT"
] | permissive | from os.path import isfile, join
from os import listdir
import numpy as np
import random
import caffe
import lmdb
import sgf
# Import our python utilities.
import sys
sys.path.append('../python')
imgo = __import__('imgo')
# Directoryies and Strings.
PATH = '../data/games/'
TRAIN_DB = "../data/lmdb/lmdb_policy_train"
... | true |
ce2d9016de3e960210e3c7438344ef97b82ac396 | JoTaijiquan/Python | /Python101/1-10 copy2/1-1010.py | UTF-8 | 377 | 3.46875 | 3 | [] | no_license | #Example 10.10
#Python 3.7.1
import random
import turtle
t=turtle
r=random
r.seed()
t.setup(800,600)
t.title("Random Line")
t.speed(100)
t.colormode(255)
for i in range(100):
rx=r.randint(-400,400)
ry=r.randint(-290,290)
c=r.randint(0,255),r.randint(0,255),r.randint(0,255)
t.pencolor(c)
t.goto... | true |
9c831528ab60614dc98876109b6faf300e92d89c | leoIMartins/aulaPython | /Aula 5/extracao4.py | UTF-8 | 600 | 2.984375 | 3 | [] | no_license | arquivo = open('C:\\Python\\Aula 5\\1617FedSchoolCodeList.csv', 'r')
lines = arquivo.readlines()
for l in lines:
coluna = l.split(';')
if coluna[5] == "PR":
print("ID: ", coluna[0])
print("SchoolCode: ", coluna[1])
print("SchoolName: ", coluna[2])
print("Address: ", coluna[3])... | true |
9b742811528e62976af9cd3ab847d8fc00a043fd | diyism/tone_classifier | /train/split_wavs.py | UTF-8 | 1,235 | 2.765625 | 3 | [] | no_license | import json
import os
import random
from train.dataset.dataset import get_spk_from_utt
SEED = 1024
random.seed(SEED, version=2)
TRAIN_SIZE = 174
OUT_DIR = 'data'
os.makedirs(OUT_DIR, exist_ok=True)
def split(data: list):
random.shuffle(data)
train = data[:TRAIN_SIZE]
test = data[TRAIN_... | true |
87ae2b5824b4a86525c359dc459fb2e1d7917a67 | kelakty/Testcenter | /testcenter_multithread/test/dicttest.py | UTF-8 | 5,187 | 3.46875 | 3 | [
"MIT"
] | permissive | import threading
from datetime import datetime
import re
# def gendictdata(columnname,cellitem):
# """
# 使用两个列表,生成一一对应的字典
# columnname : 列名称的list
# cellitem : 列值的list
# return一个列名称与列值一一对应的字典
# 如果列表不一样大,则返回空
# """
# dictdata={}
# if len(columnname) != len(cellitem):
# return
... | true |
1e92e456c0c8bd4f9801d7cc80ae31b14d854d0b | kuroshum/signate_lesson2020 | /nishizawa/exercise1_1.py | UTF-8 | 891 | 3.921875 | 4 | [] | no_license | # -*- coding: utf-8 -*-
# numpyをnpとしてインポート
import numpy as np
# pandasをpdとしてインポート
import pandas as pd
# リストの作成
d_list1 = ['Yamada Taro', 'Yamada Hanako', 'Wakayama Dai']
d_list2 = [172.5, 160.5, 180.2]
d_list3 = ['name','height']
# リストからnumpy arrayへの変換
d_array1 = np.array(d_list1)
d_array2 = np.array(d_list2)
d_arr... | true |
49327341e95650cea2b8a251d5a56cec0ea0dbd4 | cassieeric/Python-Exercises_Interview_questions | /小游戏/石头剪刀布游戏.py | UTF-8 | 622 | 4.15625 | 4 | [] | no_license | # -*- coding: utf-8 -*-
import random
while True:
# 1 石头,2 剪刀,3 布
computer = random.randint(1, 3)
people = int(input('请输入数字1(石头)或2(剪刀)或3(布):'))
if people > 3 or people < 1:
people = int(input('对不起,您输错了,请重新输入正确的数字:'))
if (computer == 1 and people == 3) or (computer == 2 and people == 1) or... | true |
f8b074443540de0f2f04cf9304b5c3ae13bedf13 | Jijogeorge69/nba_scores_api_flask_pymongo | /resources/team.py | UTF-8 | 666 | 2.59375 | 3 | [] | no_license | from flask_restful import Resource
# from flask_jwt import jwt_required
from models.team import TeamModel
class Team(Resource):
# @jwt_required()
def get(self, team_name):
try:
team_list = TeamModel.find_by_team(team_name)
if team_list:
return {'r... | true |
22b93299403a5facd5fcc80d0e3962332101e22d | vicsn/deterministic | /deterministicgpg.py | UTF-8 | 1,790 | 2.59375 | 3 | [
"Unlicense"
] | permissive | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2014 Arttu Kasvio <arttu@ubuntu>
#
# This is free and unencumbered software released into the public domain.
# See LICENSE for more info and refer to <http://unlicense.org>
# Requirements: pycrypto, monkeysphere, gpg
import sys
import os
import drbg
impo... | true |
2ededa6306d4e23d43624a70c6c4dd0ac73819f6 | makkar-nishant123/Pythonselenium | /ReadFromExcel/Sheet2.py | UTF-8 | 654 | 3.453125 | 3 | [] | no_license | import xlrd
wb = xlrd.open_workbook('data.xlsx')
sheet2 = wb.sheet_by_index(1)
sheet2.cell_value(0,0)
for i in range(sheet2.ncols):
print(sheet2.cell_value(0,i))
print('-----------------------------')
print('Dispaying value from Cell:'+ sheet2.cell_value(0,0))
print(sheet2.nrows)
print('2nd row value... | true |
8430ed8177ec637f70bd959d9aad255a6db84e24 | liamcraft118/PythonLearning | /NGASpider/nga_topic_wordcloud.py | UTF-8 | 506 | 2.796875 | 3 | [
"MIT"
] | permissive | # -*- coding: utf-8 -*-
from DB import DB
from wordcloud import WordCloud
import jieba
# class WordCloud(object):
if __name__ == '__main__':
db = DB()
db.connect()
result = db.readAllTitle()
titles = ''
for title in result:
titles += title[0]
words = " ".join(jieba.cut(titles))
... | true |
807fab8cfa78ea193b647508cd874b59f72bc6e8 | henryZe/code | /leetcode/now_coder/hw/20.py | UTF-8 | 707 | 3.546875 | 4 | [] | no_license | import re
def check(string):
n = len(string)
if n < 9:
return False
substr = []
for i in range(n - 2):
substr.append(string[i:i+3])
if len(substr) != len(set(substr)):
return False
Upper = '[A-Z]'
Lower = '[a-z]'
num = '\d'
chars = '[^A-Za-z0-9_]'
patte... | true |
9c1bf7379a3e5c56d8d62ecb35f45af0e64d775e | lituan/tools | /replace.py | UTF-8 | 969 | 3.015625 | 3 | [] | no_license | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
relace strings in a file according to a dic file
"""
import os
import sys
def read_dic(dic_f):
lines = dic_f.readlines()
lines = [line.rstrip('\r\n') for line in lines]
lines = [line.split() for line in lines if len(line.split()) == 2]
dic = dict()
... | true |
8be50f9623415cdb9c79897bb60d466e679369f1 | carlchan0514/Constrainted-Optimization | /interior_point.py | UTF-8 | 4,449 | 2.609375 | 3 | [] | no_license | import numpy as np
from numpy.linalg import norm
import matplotlib.pyplot as plt
NORM_EPSILON = 0.001
ETTA_EPSILON = 0.1
def bias(n):
return np.ones(n)
def tridiag(n, d1=-1, d2=4, d3=-1):
a = np.zeros((n, n), int)
d1s = np.repeat(d1, n-1)
d3s = np.repeat(d3, n-1)
np.fill_diagonal(a, d2)
np.f... | true |
4e366d09cbe97da35aeab6ec10e3bb0a89fc20fe | jpanganiban/ytqueue | /ytqueue.py | UTF-8 | 2,123 | 2.828125 | 3 | [] | no_license | #!/usr/bin/env python
from flask import Flask, render_template, redirect, request
from gevent.wsgi import WSGIServer
from gevent import queue, subprocess
import gevent
import argparser
app = Flask(__name__)
# Instance queue. Starts out empty
q = queue.Queue()
# Handler for the webpage
@app.route('/')
def page_ind... | true |
27e8f6eb247c527dd3ec539ce14c4a5e0c1d303e | TatenLee/machine-learning | /bi/core/l11/used_car_price_prediction.py | UTF-8 | 2,683 | 3.34375 | 3 | [] | no_license | # !/usr/bin/env python
# -*- coding: utf-8 -*-
"""
@author: lishuang
@description: 二手车价格预测
数据集:
used_car_train_20200313.csv
used_car_testA_20200313.csv
数据来自某交易平台的二手车交易记录
1、数据探索EDA(20points)
2、使用缺失值可视化工具或pandas_profiling工具(10points)
ToDo:给你一辆车的各个属性(除了price字段),预测它的价格
"""
import matplotlib.pyplot as plt
import missingno... | true |
241030b4a8c32365b8b7212a136b2147a4b0def0 | Chunar5354/Monitor_pi | /motor_factory/fetch_data_server/fetch_data.py | UTF-8 | 3,074 | 2.859375 | 3 | [] | no_license | # Use pymysql and pandas to fetch data
import pymysql
import pandas as pd
import numpy as np
import threading
class Hunter():
def __init__(self):
# every parameter has a different number during one second
self.limit_dict = {'current_A': '250',
'current_B': '250',
'current_C': '250',
'v... | true |
e400f5d78953102e9c6e316746dd33f015cd6172 | nflondo/myprog | /python/online-tutorials/freecodecamp-inte/lec_func_args_adv.py | UTF-8 | 1,692 | 4.21875 | 4 | [] | no_license | #!/usr/bin/env python3
"""
- The difference between arguments (passed when calling) and parameters
(when defining a funct)
- Positional and keyword arguments
- Default arguments
- Variable-length arguments(*args and **kwargs)
- Container unpacking into function arguments
- Local vs global arguments
- Parameter passing... | true |
b44a539ba738236d1b4dd696c8677185ec595240 | yunhui21/CB_AI_3_NLP | /Day_19_03_KerasNaverMovie.py | UTF-8 | 4,073 | 3.109375 | 3 | [] | no_license | # Day_19_03_KerasNaverMovie.py
import csv
import re
import nltk
import collections
import matplotlib.pyplot as plt
import tensorflow as tf
import numpy as np
# 문제
# Day_07_02_NaverMovie.py 파일을 케라스 모델로 수정하세요
# 문제
# 원핫 버전을 복사해서 입베딩 레이어 버전으로 수정하세요.
# 문제
# 우리가 작성한 리뷰에 대해 긍정 또는 부정을 판단하는 함수를 만드세요.(원핫 버전)
def get_data(fil... | true |
2155cac9a4c4f88cc4e975609128f9c46fb40eb0 | dynamicslab/pysindy | /pysindy/optimizers/base.py | UTF-8 | 14,043 | 2.8125 | 3 | [
"MIT"
] | permissive | """
Base class for SINDy optimizers.
"""
import abc
import warnings
from typing import Callable
from typing import Tuple
import numpy as np
from scipy import sparse
from sklearn.linear_model import LinearRegression
from sklearn.linear_model._base import _preprocess_data
from sklearn.utils.extmath import safe_sparse_do... | true |
d2d07632cfb215e968b8d51c0613adf940fe9037 | murane/PS | /Python/atcoder/ABC_180_B.py | UTF-8 | 261 | 3 | 3 | [] | no_license | import sys
r=sys.stdin.readline
N=int(r())
x=list(map(int,r().split()))
arrSum=[]
arrSquareSum=[]
for num in x:
arrSum.append(abs(num))
arrSquareSum.append(abs(num**2))
print(sum(arrSum))
print(format(sum(arrSquareSum)**0.5,'.15f'))
print(max(arrSum))
| true |
df36192a4f973d45ca32df4a5c30b6bbd32c2910 | marek-h/python-nauka | /sprawdzanie-pelnoletnosci.py | UTF-8 | 105 | 3.1875 | 3 | [] | no_license | wiek = input("podaj wiek: ")
if int(wiek) < 18:
print("niepelnotni")
else:
print("pelnoletni")
| true |
b70f5c095e41f9919e4ea06981fe6b958a47f642 | scarletstudio/transithealth | /pipeline/transform/daily_bus_ridership.py | UTF-8 | 768 | 2.765625 | 3 | [
"MIT"
] | permissive | import sys
sys.path.append("../")
import argparse
import pandas as pd
from pipeline.utils.data import extract_data_portal_dates
from timeit import default_timer as timer
cli = argparse.ArgumentParser(description="Transform CTA L Train ridership data.")
cli.add_argument("--input_file", help="File path to read raw CTA... | true |
8a61376041befcf976871a22ea9fe29d76f831d7 | hyejun18/daily-rosalind | /scripts/bioinformatics-stronghold/MGAP.py | UTF-8 | 914 | 3.265625 | 3 | [] | no_license | ##################################################
# Maximizing the Gap Symbols of an Optimal Alignment
#
# http://rosalind.info/problems/MGAP/
#
# Given: Two DNA strings s and t in FASTA format
# (each of length at most 5000 bp).
#
# Return: The maximum number of gap symbols that
# can appear in any maximum score ... | true |
f7f539e3133e682f7ef6744ace7e43684759748d | spacetelescope/stistools | /tests/helpers/utils.py | UTF-8 | 5,942 | 3.078125 | 3 | [
"BSD-2-Clause"
] | permissive | import os
import re
import requests
from astropy.io import fits
__all__ = ['cmp_fitshdr', 'cmp_gen_hdrkeywords',
'word_precision_check', 'abspath',
'download', 'check_url']
RE_URL = re.compile('\w+://\S+')
default_compare = dict(
ignore_keywords=['DATE', 'CAL_VER', 'CAL_VCS', 'CRDS_VER', 'C... | true |
9f61f3178daec6e00b339fc337630b4cfe187c4d | Delaunay/dota2env | /luafun/utils/ring.py | UTF-8 | 2,142 | 3.59375 | 4 | [
"BSD-3-Clause"
] | permissive | import array
# In the future we might want to discard weights that worsened the model
# and start from the best model so far
# to do so we can simply insert in order (ordered by reward)
# that way the worst model is discarded instead of the oldest
# import bisect
# a = [1, 2, 4, 5]
# bisect.insort(a, 3)
# print(a)
... | true |
491cec4eff4ad3b7edb3e7ca917b4de4a9cf4c89 | choidoyeong/BOJ_Algorithm | /9095.py | UTF-8 | 270 | 3.140625 | 3 | [] | no_license | from sys import stdin
roof = int(stdin.readline())
for i in range(0, roof):
num = int(stdin.readline())
dp = [1]
for n in range(1, num+1):
dp.append(0)
if n-1 >= 0: dp[n] += dp[n-1]
if n-2 >= 0: dp[n] += dp[n-2]
if n-3 >= 0: dp[n] += dp[n-3]
print(dp[num])
| true |
86955e5e48e223fb0005b8b8374ce91d75e38931 | Zara-sk/Interpolation | /Tests.py | UTF-8 | 5,335 | 3.703125 | 4 | [] | no_license |
if __name__ == '__main__':
import matplotlib.pyplot as plt
from numpy import arange, sin, cos
from CubicSpline import cubicSpline
from SmoothSpline import smoothSpline
"""Evaluating the inaccuracy"""
def Splining(func, h: float, w: float, p: float, dif: int):
table1 = {i: func(i) for i in arange(0, 10, h... | true |
c60009798865371a9002e007a8586b37d3cf8758 | choroba/perlweeklychallenge-club | /challenge-202/robert-dicicco/python/ch-1.py | UTF-8 | 728 | 3.75 | 4 | [] | no_license | #!/usr/bin/env python
# AUTHOR: Robert DiCicco
# DATE : 2023-01-30
# Challenge 202 Consecutive Odds ( Python )
import re
arrays = [[1,5,3,6],[2,6,3,5],[1,2,3,4],[2,3,5,7]]
for arr in arrays :
print("Input: @array = ",arr)
check = ''
for x in range(0,len(arr)) :
if (arr[x] % 2 == 0... | true |
215609600580be45d5dfb51ffdbf96afa0175c23 | lamihov/learn_python | /functional programming/44. функциональное программирование.py | UTF-8 | 1,481 | 4.125 | 4 | [] | no_license | '''Функции высшего порядка принимают другие функции в качестве аргументов, либо возвращают их как результат'''
def apply_twice(func, arg): #функция высшего порядка
return func(func(arg))
def add_five(x): #аргумент функции высшего порядка
return x + 5
print(apply_twice(add_five, 10))
#пример
def test(fu... | true |