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 |
|---|---|---|---|---|---|---|---|---|---|---|
5ddc50dbb9e94c4e81d927991ec87e2c767d3b47 | hiyamgh/DataScienceTutorials | /distribution_fitting/distribution_fitting.py | UTF-8 | 9,353 | 2.921875 | 3 | [] | no_license | import warnings
import numpy as np
import pandas as pd
import scipy.stats as st
from scipy.stats._continuous_distns import _distn_names as distn_names
from sklearn import datasets
import matplotlib.pyplot as plt
import os
plt.rcParams['figure.figsize'] = (16.0, 12.0)
plt.style.use('ggplot')
def mkdir(folder):
if... | true |
5911747166adb4778d58a6d71696738a7a46d53c | vtrvalentim/Trainee-Python-Course-2020 | /TEAM 1/GUIAssignment/operations.py | UTF-8 | 297 | 3.3125 | 3 | [] | no_license | import numpy as np
def plus (x,y):
return x+y
def minus (x,y):
return x-y
def div(x,y):
return (1.*x)/(1.*y)
def times(x,y):
return x*y
def square(x):
return x**2
def sqroot(x):
return np.sqrt(x)
def percent(x):
return x/100.
def inverse(x):
return 1/(1.*x) | true |
f34d1372c9658d4c4de185db6b74b22d63b50ca9 | Briancodes23/Python | /Arithmetic/Arithmetic_in_Python/Arithmetic_coding.py | UTF-8 | 622 | 3.578125 | 4 | [] | no_license | import random
import sys
#The order of operations matter, uses BODMAS way of showing results
print("5+2=",5+2)
print("5-2=",5-2)
print("5*2=",5*2)
print("5/2=",5/2)
print("5%2=",5%2)
print("5//2=",5//2)
print("1+2-3*2=",1+2-3*2)
print("(1+2-3)*2=",(1+2-3)*2)
#Personal notes
'''
+ Addition
-Sub... | true |
25f4526428f133e1e792466ba8ba1abb9feabfb3 | ThomasZeTankEngine/IGCSE-stuff | /Grading program.py | UTF-8 | 392 | 3.46875 | 3 | [] | no_license | student = int(input("What is the number of students?"))
name = []
score = []
for i in range(student):
name.append(str((input("Gimme a name"))))
score.append(int(input("Gimme their score")))
for i in range(len(score)):
max = score[0]
if score[i]>max:
max = score[i]
position = score.index(max)
... | true |
3b2e651c102579bcdebd95b121742c3c49d6cec1 | oorucelik/scrapfil | /onepage.py | UTF-8 | 3,080 | 2.734375 | 3 | [
"MIT"
] | permissive | import requests
from bs4 import BeautifulSoup
import pandas as pd
import openpyxl
import numpy as np
from time import sleep
from random import randint
name = 'oorucelik'
types = []
images = []
titles = []
durations = []
releaseDates = []
imdbScores = []
genres = []
tvseriesCount=0
r = requests.get('https://www.sinefil... | true |
2beac3f7ca51a7929309af9bc7c10a35df2d1770 | jantzen/eugene | /build/lib.linux-x86_64-2.7/eugene/scripts_demos/LotkaVolterraDemo.py | UTF-8 | 2,896 | 2.796875 | 3 | [
"MIT"
] | permissive | # LotkaVolterraDemo.py
import eugene as eu
from eugene.src.virtual_sys.LotkaVolterra2D import *
import matplotlib.pyplot as plt
def LotkaVolterraDemo(noise_stdev=2., epsilon=10**(-3), resolution=[300,2], alpha=1):
# build sensors and actuators
tsensor = eu.sensors.VABTimeSensor([])
x1sensor = eu.sen... | true |
248ec7dbd4dcdfc00789e1bd51c36b43e0d91435 | shubhamb98/object_detection | /aa.py | UTF-8 | 1,287 | 2.59375 | 3 | [] | no_license | from bs4 import BeautifulSoup
from urllib.request import Request,urlopen
import re
import numpy as np
# scores,classes,category_index,image_np=bb.detectt()
from PIL import Image
def quote(topic):
req = Request("https://www.brainyquote.com/topics/"+topic, headers={'User-Agent': 'Mozilla/5.0'})
webpage = urlopen(... | true |
da499c4a8f12b22a7c656644a1583065f5179b6d | xenron/sandbox-github-clone | /csrgxtu/maxent/src/basketball/Utility.py | UTF-8 | 3,168 | 3.046875 | 3 | [] | no_license | #!/usr/bin/env python
# coding = utf8
#
# Author: Archer Reilly
# File: Utility.py
# Date: 15/Oct/2014
# Desc: some useful utilities
#
# Produced By CSRGXTU
from numpy import loadtxt
# str2file
# save string to file
#
# @param string
# @param outFile
# @return nothing
def str2file(string, outFile):
with open(outFil... | true |
2d58b3c5293081ad9c7d0ad9abda65f36d0aff23 | nirajmark/pythonprograms | /ex3.py~ | UTF-8 | 280 | 3.53125 | 4 | [] | no_license | print " I will now count my chickens"
print "Hens",25+30/6
print "roosters",100-25*3%4
print "Now i will count the egg"
print 3+2+1-5+4%2-1/4+6
print "is 3+2<5-7?"
print 3+2<5-7
print "3+2=",3+2
print "5-7=",5-7
print "Ohh, thats why its false"
print "How about some more"
| true |
2b0501782fd6389f1b5deeb120098e863c7a7ceb | LanceJCL/ECE143Group4 | /plot_code.py | UTF-8 | 2,334 | 2.59375 | 3 | [] | no_license | from dataprocess import *
import matplotlib.pyplot as plt
import plotly
import plotly.plotly as py
import plotly.graph_objs as go
import cufflinks as cf
df_certified, totaldf, Companyd, jobs, sorted_Company_count, sorted_Site_count = load_data_company('totalnew.csv')
new_input_new, new_list_name = data_for_... | true |
ad1beb492b92d218d36594d0c07be4a6c2e75e28 | zachsaeed/python_notes | /099 Notes Under preparation/old/etc note files. Need to move to main files and delete/30-CompositeDataTypes/30.0-intro.py | UTF-8 | 1,672 | 3.71875 | 4 | [] | no_license | # Composite Datatypes:
# All
# Sequence Types:
# - A sequence is a group of items with a deterministic ordering. The order in which we put them in is the order in
# which we get an item out from them.
# - All python sequences have 'indexes' and can be 'sliced'.
# - Python offers 7 types of sequences:
# Text Sequenc... | true |
1e1ec85ea71fb0ed44059a4c8493f1c7827e3a48 | srio/shadow3-scripts | /example_undulator_chubar_slide.py | UTF-8 | 10,072 | 2.515625 | 3 | [
"MIT"
] | permissive | """
This example shows the focusing of an ideal lens in 1:1 configuration
for an undulator source sources (see main program at the bottom)
"""
import numpy
from srxraylib.waveoptics.wavefront2D import Wavefront2D
from srxraylib.waveoptics.propagator2D import propagate_2D_fraunhofer
from srxraylib.waveoptic... | true |
362d46c27d9105c1fd4ec9c36f5eefd28e57a809 | BoxOfCereal/raspi-conveyor-camera | /laser.py | UTF-8 | 796 | 2.9375 | 3 | [] | no_license | import RPi.GPIO as GPIO # Import Raspberry Pi GPIO library
from guizero import App, Text, TextBox, PushButton, Slider, Picture
def say_my_name():
welcome_message.value = my_name.value
def change_text_size(slider_value):
welcome_message.size = slider_value
BEAM_PIN = 10
#GPIO SETUP
GPIO.setwarnings(... | true |
077ea4a05af0fac5328eb849e8f005794a18cdc9 | ArrayZero/raspberry-pi | /testing/raspiLapseCam.py | UTF-8 | 1,927 | 2.75 | 3 | [] | no_license | #!/usr/bin/env python
import os
import time
import RPi.GPIO as GPIO
from datetime import datetime
GPIO.setmode(GPIO.BCM)
GPIO.setup(3, GPIO.IN)
GPIO.setup(4, GPIO.OUT)
prev_input = 1
# camera loop function
def lapseLoop():
d = datetime.now()
initYear = "%04d" % (d.year)
initMonth = "%02d" % (d.month)
initDate =... | true |
a016bbabcc1d62c927ae78224bbdd20068a7daa2 | Thelordofdream/Fast-implementation-of-Kruskal-s-algorithm | /kruskal.py | UTF-8 | 3,295 | 3.265625 | 3 | [] | no_license | # coding=utf-8
from math import sqrt
import matplotlib.pyplot as plt
def kruskal(edge, vertex, draw):
length = get_length(edge, vertex)
n = len(edge) # 边数量
num_Of_edge = [i for i in range(n)] # 生成边的编号,以便在大规模数据情况下,从外部可以获取最小生成树的边集
quick_sort(0, len(length) - 1, length, edge, num_Of_edge) # 用快速排序根据边长... | true |
0c6563c9bf326217364943025d2e8dde2063f3cc | simbadSid/mosig-s3 | /scientificMethodologyAndPerformanceEvaluation/project_os/resultPrinter/util.py | UTF-8 | 2,095 | 3.234375 | 3 | [] | no_license | import os
# ---------------------------------------
# Global variables
# ---------------------------------------
DEFAULT_COMMENT = "#"
DEFAULT_DATA_SEPARATOR = " "
# ---------------------------------------
# Local method
# ---------------------------------------
def isEndOfFile(fic):
return (fic.t... | true |
8c5d4fa90dd7ac8ed38d66b5ffad0d4ca67b5d7f | brainglobe/brainrender | /examples/brain_regions.py | UTF-8 | 415 | 2.625 | 3 | [
"BSD-3-Clause",
"GPL-3.0-only"
] | permissive | from brainrender import Scene
from rich import print
from myterial import orange
from pathlib import Path
print(f"[{orange}]Running example: {Path(__file__).name}")
# Create a brainrender scene
scene = Scene(title="brain regions")
# Add brain regions
scene.add_brain_region("TH")
# You can specify color, transparen... | true |
c1737cb87ab292029dddb71fb6581adda13fcbf4 | tojazaneta/Automation_practice_selenium_webdriver | /automation_practice.py | UTF-8 | 3,428 | 2.890625 | 3 | [] | no_license | ###Login to the website => select women evening dress => select colour and sieze => add item to the basket => checkout"
import time
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.common.by import By
from selenium.webdriver.support.wait import WebDriverWait
f... | true |
b19cbdd13adb0ac799d2416565dba4bfb9521b71 | rodrigueslopesantosdev/FirstRestApiPython | /Data control/ManipulacaoArquivos.py | UTF-8 | 762 | 3.75 | 4 | [] | no_license | #Funcao OPEN para abrir arquivos
arquivo = open('endereco/nom_arquivo', 'opcoes de abertura')
'''
#opcoes de abertura
r - abrir o arquivo apenas para leitura
a - abrir o arquivo para escrita, adicionando lihas no final do arquivo (append)
w - abrir o arquivo para escrita, porém esse modo sobrescreve o arquivo. Logo ... | true |
0e47491741e6f267e749a2b53bc0e3733e2838c9 | trombonehero/grove-examples | /1AnalogRead/3Visual/Code/brightness.py | UTF-8 | 640 | 3.109375 | 3 | [
"Apache-2.0"
] | permissive | #Conversion information from Arduino documentations
#Resistor calculations: http://www.mouser.com/catalog/specsheets/Seeed_101020022.pdf
from nanpy import (ArduinoApi, SerialManager)
from time import sleep
#Connect to Arduino. Automatically finds serial port.
connection = SerialManager()
a = ArduinoApi(connec... | true |
822d464bc20b8f59560d4396d7bb640cc66835c6 | javase/learn_python | /liaoxuefeng/my script/dynamic_add_attr_method.py | UTF-8 | 654 | 3.9375 | 4 | [] | no_license | # -*- coding: utf-8 -*-
class Student(object):
pass
s = Student()
s.name = 'Michael'
print('s.name:',s.name)
def set_age(self,age):
self.age = age
from types import MethodType
s.set_age = MethodType(set_age,s) # 给实例绑定一个方法
s.set_age(25) # 调用实例方法
print('s.age:',s.age)
# 但是,给一个实例绑定的方法,对另一个实例是不起作用的
s2 = Student()
#... | true |
df750f4d4a11e1b330ed40ea79d9af9a7f058c54 | Manoji97/Data-Structures-Algorithms-Complete | /InterviewQuestions/Python/3_LinkedLists/2_NthNodeFromTail.py | UTF-8 | 3,006 | 3.859375 | 4 | [] | no_license | '''
for a given single linked List check if there is any cycle in between them
'''
class Node(object):
def __init__(self, val):
self.val = val
self.next = None
def __repr__(self):
return str(self.val)
def __str__(self):
return str(self.val)
class LinkedList(object):
def __init__(self):
self.head = N... | true |
1ebc5d7ee86f5fd05597565470faaf9ef57d68f4 | LSC910814/109021062-20210604-practice-class | /practice.py | UTF-8 | 827 | 3.78125 | 4 | [] | no_license | from tkinter import * # import* 元件.... tk 開放原始碼(open source)
def setLabText(): #建立函式 更改標籤內文字
labl.config(text="hello")
window = Tk() # 建立空白視窗
window.title("First Python Window") # 視窗title
window.geometry("600x400+100+50") # 指定視窗所在位置(+位移量x,y)
window.config(bg = "#ccddff") # 背景顏色
labl = Label(window, text =">_<"... | true |
44dfa3ffe89377064d53adc638b7e4a88f4edaae | YTsurugi/Favorite-Movies | /entertainment_center.py | UTF-8 | 2,421 | 2.59375 | 3 | [] | no_license | # -*- coding: utf-8 -*-
"""
Created on Sun Jun 18 14:20:55 2017
@author: Sword
"""
import fresh_tomatoes
import media
Mission_impossible = media.Movie("Mission impossible III",
"A 2006 American action spy film",
"https://i.jeded.com/i/mission-impossible-iii-mi-3-mi3.228... | true |
f354bafc90ee58ff02f31559249e6e3f1e7e5af9 | marialobillo/dataquest | /python_basics/python5/07_in_dic.py | UTF-8 | 153 | 3.03125 | 3 | [] | no_license | planet_numbers = {"mercury": 1, "venus": 2, "earth": 3, "mars": 4}
jupiter_found = "jupiter" in planet_numbers
earth_found = "earth" in planet_numbers
| true |
6ade1c0b6b1ee1108edb525d2910118d3bf2ddee | sgrant28/Final-Project-League-Calculator | /LeagueBarChart.py | UTF-8 | 576 | 2.96875 | 3 | [] | no_license | import pandas as pd
import plotly.offline as pyo
import plotly.graph_objs as go
# Load CSV file from Datasets folder
df = pd.read_csv('../Datasets/LCS2019SummerChamps.csv')
# Preparing data
data = [go.Bar(x=df['Champion'], y=df['Games Played'])]
# Preparing layout
layout = go.Layout(title='League of Leg... | true |
0f8bd338e819b07a74f8113f1fada8fb26d073c6 | tbariciak/vexu-feature-preview | /power/plotWithoutPowerManager.py | UTF-8 | 1,810 | 2.828125 | 3 | [] | no_license | import matplotlib.pyplot as plt
import matplotlib.animation as animation
# the maximum current per motor without a central power manager is limited to
# maxCurrent / numMotors
numMotors = 16
maxCurrent = 20
perMotorCap = maxCurrent / numMotors
def gen():
time = -1
while time <= 18:
time += 1
y... | true |
d4e62f36ed7e21d8a92ca4fb70474d64e90a7efa | wippra/BigIdeasLab5 | /something.py | UTF-8 | 594 | 4.65625 | 5 | [
"Apache-2.0"
] | permissive | name = input("What's your name? ")
print(f"Hi {name}!")
given = input("Now give me an Integer!")
given = int(given)
nameLength = int(len(name))
if (nameLength<given):
print("Your name has "+str(nameLength)+" characters, which is less than your given integer's value.")
elif (nameLength>given):
print("Your name ... | true |
544d37d8e7ec9a1cbd2a943088116471b5985895 | mukeshmk/pygrams | /algos/sort/selectionSort.py | UTF-8 | 713 | 3.984375 | 4 | [] | no_license | def selectionSort(array):
# Traverse through all array elements
for i in range(len(array)):
# Find the minimum element in remaining
# unsorted array
min_idx = i
for j in range(i+1, len(array)):
if array[min_idx] > array[j]:
min_idx = j
# Swap ... | true |
9cdbe8c98004270c0d7f8b37e0f8beada4f4d222 | pawwahn/python_practice | /machine_learning/numpy/no_copy_and_id_numpy.py | UTF-8 | 173 | 3.609375 | 4 | [] | no_license | import numpy as np
a = np.arange(6)
print('Our array is:')
print(a)
print('Applying id() function:')
print(id(a))
print('a is assigned to b:')
b = a
print(b)
print(id(b)) | true |
288d2422d8475251550e56952e8ec3fc8619df86 | TonyCalvez/DEEPDART | /data_augmentation.py | UTF-8 | 5,960 | 3.078125 | 3 | [] | no_license | import cv2
import random
import os
import shutil
import numpy
class dataAugmentation:
def __init__(self, path, image_name):
'''
Import image
:param path: Path to the image
:param image_name: image name
'''
self.path = path
self.name = image_name
self... | true |
59ce1e1eb4fbc635af46b2ccb0f3d578aea98afd | 3fraa/100_days_of_programming_python | /L16.py | UTF-8 | 656 | 4.0625 | 4 | [] | no_license | List = ["Afraa" , "Amal"]
Tuple = ("Noha" , "Laila")
print("List = " , List)
print("Tuple = " , Tuple)
print()
List = []
Tuple = ()
print("List = " , List)
print("Tuple = " , Tuple)
print()
List = [3]
# if we write as follows //Tuple = (3)
#it will look like item not tuple ,so we must add comma
item = 3
item1 = (3... | true |
48cf9db03aa093b2e136ef9b703668730a8f4495 | arkdevuk/mjpeg-relay | /app/streaming.py | UTF-8 | 2,342 | 2.640625 | 3 | [
"MIT"
] | permissive | import sys
import Queue
import socket
import threading
from broadcaster import Broadcaster
try:
from SimpleWebSocketServer.SimpleWebSocketServer import WebSocket
except ImportError, e:
print "Failed to import dependency: {}".format(e)
print "Please ensure the SimpleWebSocketServer submodule has been corre... | true |
f359e0ea83419b98cb890242979179031552aba7 | cheryi/PRHW03 | /MAP_wine.py | UTF-8 | 4,617 | 3.109375 | 3 | [] | no_license | '''
1.load data
2.random chose data or odd&even to make training data(50%)
remember to normalize data with /max
3.calculate M and Sigma of each class (M for mean vector;Sigma for covariance matrix)
4.MAP classification
5.professor's request
(1)training accuracy
(2)test accuracy
(3)cost time
'''
import numpy as np
fr... | true |
c15ae9c2c13df050dea18c64a127c1a5c33a85bf | CALFEM/calfem-python | /calfem/mesh.py | UTF-8 | 41,959 | 2.84375 | 3 | [
"LicenseRef-scancode-proprietary-license",
"MIT"
] | permissive | # -*- coding: iso-8859-15 -*-
"""
CALFEM Mesh module
Contains functions and classes for generating meshes from geometries.
"""
import os
import sys
import tempfile
import shutil
import subprocess
import numpy as np
from calfem.core import createdofs
from calfem.utils import which
import calfem.core as cfc
import lo... | true |
298589557916e06474648a805c3ddfbabba28e2b | youngminpark2559/statistics_analysis | /Statistical_analysis/KyungSubNoh/003_Data_and_statistic_value/001_How_to_collect_data/main.py | UTF-8 | 1,606 | 2.546875 | 3 | [] | no_license | # conda activate py36gputorch100 && \
# cd /mnt/1T-5e7/mycodehtml/statistics_analysis/Statistical_analysis/KyungSubNoh_py/003_Data_and_statistic_value/001_How_to_collect_data && \
# rm e.l && python main.py \
# 2>&1 | tee -a e.l && code e.l
# ============================================================================... | true |
b9b9b9a5e2cd2831741bb8e86d6991adecc4a09a | dbates4/NBA-Clusters | /season_allstats_stand_dimred.py | UTF-8 | 2,496 | 2.78125 | 3 | [] | no_license | # -*- coding: utf-8 -*-
"""
Created on Wed Mar 25 16:09:10 2020
@author: dylan
Level: Season averages
Variables: Standardized, Reduced, All Stats
"""
# Do the imports --------------------
import pandas as pd
import os
from sklearn.decomposition import PCA
from sklearn.mixture import GaussianMixture
from sklearn.met... | true |
538234fada93e4df1f530a500ccf3f1b2ab4e35e | pmheintz/PythonTutorials | /basicsyntax/strings.py | UTF-8 | 465 | 4.375 | 4 | [] | no_license | """
Examples of working with strings
"""
# Strings can be defined in double or single quotes
a = "A simple string"
b = 'And it can use single qoutes too'
print(a)
print(b)
c = "Need to use \"qoutes\" inside a string? Use a \\"
print(c)
d = "No need to escape if single in double qoute, see ' this work"
print(d)
e =... | true |
4879cfeaf7626dca452340564b3c23127b202267 | Rahul91/HT_Binary | /binary_tree.py | UTF-8 | 5,688 | 3.765625 | 4 | [
"MIT"
] | permissive | #!/usr/bin/python
import sys
class Node:
def __init__(self, data):
self.left = None
self.right = None
self.data = data
def insert_node(self, data):
if self.data:
if data < self.data:
if self.left == None:
self.left = Node(data)
... | true |
b763e662e0cee95513503ad24229f53a00089ba0 | SimmonsChen/LeetCode | /公司真题/demo.py | UTF-8 | 346 | 3.015625 | 3 | [] | no_license | a = bin(16).replace('0b', '')
b = bin(32).replace('0b', '')
print(a, b)
print(bin(16*32).replace('0b', ''))
c = oct(16).replace('0o', '')
d = oct(32).replace('0o', '')
print(c, d)
e = hex(16).replace('0x', '')
f = hex(32).replace('0x', '')
print(e, f)
aa = int('0x16', 16)
bb = int('0x32', 16)
print(aa, bb)
print(hex... | true |
a257f2eed30bbe3ce1445a25cfe5e7c24d35add5 | csadrian/wae | /sinkhorn_sp.py | UTF-8 | 6,290 | 2.703125 | 3 | [
"BSD-3-Clause"
] | permissive | import numpy as np
import tensorflow as tf
import cv2
import moviepy.editor as mvp
from moviepy.video.io.ffmpeg_writer import FFMPEG_VideoWriter
def mat_vec_fn(x, y_i, k):
v = tf.matmul(x, tf.expand_dims(y_i, 1))
top_values, top_indices = tf.nn.top_k(-v[:, 0], k=k)
# top_indices = tf.range(3)
# top_v... | true |
9e101e63b57155adbfb4e8d79ad844995538df5b | utecrobotics/labs_robotica_20191 | /lab6/src/percepcion/otros/5-hough.py | UTF-8 | 2,053 | 2.859375 | 3 | [] | no_license | import cv2
import numpy as np
I = cv2.imread('imagenes/utec3.jpg')
Igray = cv2.cvtColor(I, cv2.COLOR_BGR2GRAY)
Iedges = cv2.Canny(Igray, 150, 200)
# Transformada de Hough clasica
distResolution = 1
angleResolution = 1*np.pi/180
minVotes = 150
lines = cv2.HoughLines(Iedges, distResolution, angleResolution, minVotes)
f... | true |
0266df1effe9f9eb4f80c47e2f705e9c73de8c1d | noppakorn-11417/psit-2019 | /problem/Day_I.py | UTF-8 | 170 | 2.953125 | 3 | [] | no_license | """psit"""
def main(day):
"""love psit"""
if day%400 == 0 or (day%4 == 0 and day%100 != 0):
print("Yes")
else:
print("No")
main(int(input()))
| true |
87c8061dc4d431755bd469ef20c42daf21c2050e | HuangHai1997/python123-Python- | /4.5.py | UTF-8 | 1,053 | 4.03125 | 4 | [] | no_license | """
用户登录(三次机会)
描述
给用户三次输入用户名和密码的机会,要求如下:
1)如输入第一行输入用户名为‘Kate’,第二行输入密码为‘666666’,输出‘登录成功!’,退出程序;
2)当一共有3次输入用户名或密码不正确输出“3次用户名或者密码均有误!退出程序。”。
输入输出示例
示例 1
输入
Kate
666666
输出
登录成功!
示例 2
输入
kate
123
alice
456
john
111111
输出
3次用户名或者密码均有误!退出程序。
"""
# -*- coding:utf-8 -*-
def Right... | true |
d85a6ddf024836f273044db6df9471fe035e17af | chintanbetrabet/coding | /Hackerrank/DS/fenwicktree/fenwick.py | UTF-8 | 1,032 | 2.53125 | 3 | [] | no_license | global gmax
gmax=0
def update(l,h,cl,ch,val,g,index):
if(l>h):
return 0
if(l<cl or h> ch):
return 0;
if(l==cl and h==ch):
g[index]+=val;
return 1;
left=2*index+1;
right=2*index+2;
lu=update(max(cl,l),min(h,cl+(ch-cl)/2),cl,cl+(ch-cl)/2,val,g,2*index+1);
ru=update(max(l,cl+(ch-cl)/2+1),h,cl+(ch-cl)/2+1,ch... | true |
4987888d9b486b486526fd1f619907cf7c69c981 | DamourYouKnow/HAHA-NO-UR | /data_controller/database_controller.py | UTF-8 | 424 | 2.640625 | 3 | [
"MIT"
] | permissive | class DatabaseController:
"""
Class for providing a controller that performs operations on
a mongodb database.
"""
def __init__(self, mongo_client, collection: str):
"""
Constructor for a DatabaseController.
:param mongo_client: Mongo client used by this controller.
... | true |
8c6c57bec5c84affbb451da2cb7326760d7b5c11 | Surendra58/Suri | /PyTorch.py | UTF-8 | 2,351 | 3.671875 | 4 | [] | no_license | #!/usr/bin/env python
# coding: utf-8
# In[1]:
import torch
torch.tensor([[1,2],[3,4]])
# In[ ]:
torch.tensor([[1,2,3],[4,5,6]])
# In[ ]:
torch.tensor([[1.,-1.],[1.,-1.]])
# In[ ]:
import numpy as np
torch.tensor(np.array([[1,2,3],[4,5,6]]))
# In[ ]:
torch.zeros([2,4],dtype=torch.int32)
torch.zeros([... | true |
1f3e512755a0f04f8853787a4e48493bace5ad26 | prasadovhal/Python-Codes | /ODE/ode5.py | UTF-8 | 250 | 3.015625 | 3 | [] | no_license | import numpy as np
from scipy.integrate import odeint
import matplotlib.pyplot as plt
def eqn(y,x):
Y1 = y[0]
Y2 = y[1]
Y3 = -x + 1.0 - x**2 * Y2 + 5.0 * Y1
return (Y2,Y3)
y0 = [0,-1]
x = np.arange(0.0,1.0,0.2)
y = odeint(eqn,y0,x)
print(y)
| true |
7a5c4597960938d36b650949c1a0db648ffcad31 | hms-dbmi/rcc_pathology | /tumor_normal/malignancy_CPTAC_predictions.py | UTF-8 | 2,539 | 2.546875 | 3 | [] | no_license | # malignancy_CPTAC_predictions.py
# Get predictions of malignancy classifier on CPTAC data
#
# 2019.10.26 Eliana Marostica
# Set parameters
subtype = 'KIRC' # CPTAC only contains clear cell data
model_type = 'Res50' # one of 'VGG16', 'IncV3', or 'Res50'
date = '' # the date ... | true |
7a1138a76efdec171209f68b3e818087e904cc8c | Daishijun/InterviewAlgorithmCoding | /ZuoShenBook/arrayAndMatrix/arrayAfterSortedneighborMaxdis.py | UTF-8 | 1,348 | 3.59375 | 4 | [] | no_license | # -*- coding: utf-8 -*-
# @Date : 2019/5/20
# @Time : 16:10
# @Author : Daishijun
# @File : arrayAfterSortedneighborMaxdis.py
# Software : PyCharm
'''数组排序之后相邻数的最大差值'''
def maxGap(nums):
if not nums or len(nums)<2:
return 0
length = len(nums)
minval = min(nums)
maxval = max(nums)
... | true |
6a396d8992233460ef372dc7111cfebfa781c76f | fahmimnalfrzki/RXTE-Automation | /colorcolor.py | UTF-8 | 5,558 | 2.578125 | 3 | [] | no_license | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sat Feb 9 13:20:21 2019
@author: fahmi
"""
import numpy as np
from matplotlib.pyplot import*
import pandas as pd
nama_obj=np.array(['4U1608-522','XTEJ1752-223','CirX-1','4U1608-522'])
a=np.array(['navy','gold','black','green'])
b=np.array(['orange','blue'... | true |
ed46534507b095d862e876c029c27d37af220f08 | josancamon19/python-blockchain | /signatures.py | UTF-8 | 2,084 | 3.140625 | 3 | [] | no_license | from cryptography.hazmat.primitives.asymmetric import rsa, padding
from cryptography.hazmat.primitives import hashes
from cryptography.exceptions import InvalidSignature
from cryptography.hazmat.primitives import serialization
def generate_keys():
"""
Generate private and public keys
:return: keys
"""... | true |
98f8aa9ca46a3c66252f1909f4a829f755eea2fc | singofwalls/Textboxes | /wrap_tests/chars.py | UTF-8 | 529 | 3.03125 | 3 | [] | no_license | """Wrap and display all chars.
Must be ran from root of project.
"""
from time import sleep
import string
import random
from interface.display import TextBox, Text, Font
import interface.start
interface.start.init()
font1 = Font("Courier New", 50, True)
y = TextBox([.1, .1, .9, .9])
for i in range(0, 100):
c... | true |
d45c986f8388eaef7150cd29738b50d4aecd2e3f | udhayprakash/PythonMaterial | /python3/10_Modules/13_pydotenv_module/dotenv_usage.py | UTF-8 | 1,107 | 2.640625 | 3 | [] | no_license | #!/usr/bin/python
"""
Purpose: dotenv module
pip install -U python-dotenv --user
"""
import os
from pathlib import Path # Python 3.6+ only
import dotenv
print(f"{dotenv.find_dotenv() =}")
# recognizes .env in current directory, if not specified
# To load the .env file
# dotenv.load_dotenv()
# dotenv.load_dote... | true |
810cc3a1718aba3c96cfdf267a1f7d9d56df099a | ArchieDash/Python-Basics | /num_format.py | UTF-8 | 172 | 3.3125 | 3 | [] | no_license | import time
print('Task_1')
num1 = 25000000
num2 = 25_000_000
print(f'{num1:,}\n{num2:,}')
time.sleep(3)
print('\nTask_2')
num = 175e3
print(f'{num:.1f}')
time.sleep(3)
| true |
d0a37a22b3f2c29d7d6954c42c7760361fbf2e86 | shinigambit/raspi-crypto | /crypto/elgamal.py | UTF-8 | 283 | 2.609375 | 3 | [] | no_license | from Crypto.PublicKey import ElGamal
from Crypto import Random
key = ElGamal.generate(1024, Random.new().read)
publickey = key.publickey()
encrypted = publickey.encrypt('hack the planet!')
print 'encrypted', encrypted
decrypted = key.decrypt(encrypted)
print 'decrypted', decrypted
| true |
53f4ad53ed76eab32fdd5f9e38bfb6a4e8939ee4 | Robinamixan/Goblins-pygame | /main.py | UTF-8 | 7,280 | 2.890625 | 3 | [] | no_license | import pygame.locals as locals
import copy
from MobObjects.MobCreator import *
from GameController import *
from ItemObjects.ItemCreator import *
from MapObject import *
from Camera import *
from ConstantVariables import *
def set_window_settings(size, title):
pygame.init()
screen = pygame.display.set_mode(s... | true |
4ff6d77dd6d90445d25213551b26590cb898bf3c | Sharmisthasen/mypython | /pract_py.py | UTF-8 | 481 | 3.890625 | 4 | [] | no_license | '''x = 5
y = "John"
print(x)
print(y)'''
'''x = 1
y = 2.8
z = 1j
a = 2j
b = z + a
print(type(x))
print(type(y))
print(type(z))
print('addition of two complex number is : ',b)
thisset = {"apple", "banana", "cherry"}
print(thisset)'''
'''thisdict = {
"apple": "green",
"banana": "yellow",
"c... | true |
b9a48b27ef5344be252a47185229ed5b14f198af | 596acres/urbanreviewer | /scripts/add_dispositions.py | UTF-8 | 1,473 | 2.96875 | 3 | [] | no_license | """
Add filterable and edited dispositions to each lot in a borough table using the
lots' raw dispositions.
"""
import click
import sqlite3
@click.command()
@click.option('--borough')
@click.option('--db')
def add_dispositions(borough, db):
conn = sqlite3.connect(db)
c = conn.cursor()
# Add disposition c... | true |
8bb81413b642acc466890e999bd069188b116e3e | yw326/Circular-Repeats-Postprocessing | /helpers/save.py | UTF-8 | 3,294 | 2.796875 | 3 | [] | no_license | import matplotlib.pyplot as plt
import pickle
import os
def save_cr_pairs_info(output_dir, pairs, pairs_info, seq_info):
output_dir = os.path.join(output_dir, "pairs")
os.mkdir(output_dir)
csv_path = os.path.join(output_dir, "circular repeated pairs.csv")
with open(csv_path, "wb") as csv_file:
... | true |
425808fecd590b390dc6e930eb2a8c066289cfb3 | ryan-jr/Side-Projects | /DailyProgrammer/Easy/22 - CompareUniqueItems/22-CompareUniqueItems.py | UTF-8 | 704 | 4.3125 | 4 | [] | no_license | """
https://www.reddit.com/r/dailyprogrammer/comments/qr0hg/3102012_challenge_22_easy/
[3/10/2012] Challenge #22 [easy]
Write a program that will compare two lists, and append any elements in the second list that doesn't exist in the first.
input: ["a","b","c",1,4,], ["a", "x", 34, "4"]
output: ["a", "b", "c",1,4,... | true |
ffe5144c1aeb06656767a90ee354c4ac1d7b83df | Adarsh-NP/tkinterbasics | /selfadjusting widgets.py | UTF-8 | 242 | 3.015625 | 3 | [] | no_license | from tkinter import *
root = Tk()
Label1 = Label(root, text = "Hello there!", bg='blue', fg="White")
Label2 = Label(root, text = "Hello there!", bg='blue', fg="White")
Label1.pack(fill = X)
Label2.pack(side = LEFT, fill=Y)
root.mainloop() | true |
12dbdc32b95f96e53d690f9233d81ebcffec90bb | tommykoch/msgboard | /main.py | UTF-8 | 3,095 | 2.8125 | 3 | [] | no_license | """`main` is the top level module for your Flask application."""
# Import the Flask Framework
from flask import Flask, request, session, redirect, url_for, render_template
from datetime import datetime
from collections import namedtuple
Message = namedtuple('Message', ['sender', 'message', 'date'])
app = Flask(__name... | true |
15ac8c4886c37bf87daf955775ece362c49803a7 | gerarldlee/task | /scripts/add-ons/export-sql.py | UTF-8 | 5,335 | 2.546875 | 3 | [
"MIT"
] | permissive | #! /usr/bin/python
###############################################################################
#
# Copyright 2006 - 2015, Paul Beckingham, Federico Hernandez.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to d... | true |
2b722c73ab8c5fcea7f6c667c0157d518a331dc6 | daniel-reich/turbo-robot | /Es985FEDzEQ2tkM75_9.py | UTF-8 | 641 | 4.15625 | 4 | [] | no_license | """
Create a function that takes two arguments (`text`, `key`) and returns a new
encrypted text using the `key`. For example, if the input is `"a"` and the key
is `1`, it should move that letter 1 step in alphabetic order so the output
would be `"b"`.
### Examples
caesar_cipher("hello", 5) ➞ "mjqqt"
c... | true |
5a7f0144d7f9e1eb64967b28fe750a9e84498738 | firefeifei/CodePool | /fzutils/fzutils/data/str_utils.py | UTF-8 | 2,457 | 3.125 | 3 | [
"MIT"
] | permissive | # coding:utf-8
'''
@author = super_fazai
@File : str_utils.py
@Time : 2016/8/4 13:15
@connect : superonesfazai@gmail.com
'''
"""
字符处理utils
"""
from re import compile as re_compile
from ..exceptions import catch_exceptions
__all__ = [
'char_is_alphabet', # 判断单个字符是否是英文字母
'char_is... | true |
0504877145fa6dd3c1ba2b37951cb589ed1e9939 | sergeynikifforov/Hydrogen_plots | /2.py | UTF-8 | 3,815 | 2.515625 | 3 | [] | no_license | import matplotlib.pyplot as plt
import math
from scipy import optimize as opt
import cantera as ct
alpha = [1.,0.35,0.43,14.3]
def f_0_ER_H2(ER = 1,alpha = 0):
return 2*ER/(1+2*ER + alpha + 3.76)
def f_0_ER_O2(ER = 1,alpha = 0):
return 1/(1+2*ER + alpha + 3.76)
def f_0_ER_H2O(ER = 1,alpha = 0):
return al... | true |
12fe4208d87940442f2b06444f8a9800ae2266cf | lucasdutraf/web-scraping-test | /test.py | UTF-8 | 1,014 | 2.921875 | 3 | [] | no_license | import requests
from bs4 import BeautifulSoup
page = requests.get("https://nerdstore.com.br/categoria/especiais/game-of-thrones/")
soup = BeautifulSoup(page.content, 'html.parser')
# print(soup.prettify())
a = soup.find_all(class_="woocommerce-loop-product__title")
b = soup.find_all(class_="attachment-woocommerce_... | true |
08fcd24de98ffa50e1172516a4ec8fdd04b96dc5 | Jungack/Genetic-algorithm | /TDD/project.py | UTF-8 | 1,987 | 3.734375 | 4 | [] | no_license | class Person:
def __init__(self, firstName, lastName, age):
self.firstName = firstName;
self.lastName = lastName;
self.age = age;
class IDCard(Person):
def __init__(self, firstName, lastName, age, height, eyeColour):
Person.__init__(self, firstName, lastName, age)
self.h... | true |
706f5f8c7434598b30840f405154cf0ff815f580 | devashish9599/PythonPractice | /space.py | UTF-8 | 314 | 3.328125 | 3 | [] | no_license | a=input("enter the string ")
class func:
def __init__(self,name):
self.name=name
def show(self):
space=" "
d=[]
print a[0],
for i in range(0,len(a)):
if space in a[i]:
d=a[i+1]
print d,
x=func(a)
x.show()
| true |
8b1b87de4141c7bb4e153a4f32be45635a3b189d | M0R1u5/Part2_Task13 | /Task13.py | UTF-8 | 86 | 4.28125 | 4 | [] | no_license | integer = int(input('Enter an integer: '))
for i in range(1, integer):
print(i*i) | true |
eb41be670b5db2c67615e25a4449002f441b1be0 | zezeze12138/ScrapySpider | /.idea/editScrapy/CreateScrapy.py | UTF-8 | 1,166 | 2.578125 | 3 | [] | no_license |
newScrapycContext = '''
import scrapy
from demo1.items import Demo1Item
class Demo1Spider(scrapy.Spider):
name = "demoSpider"
allowed_domains = ["travel.sina.com.cn"]
start_urls = [
"http://travel.sina.com.cn/domestic/news/2018-06-26/detail-ihencxtu2975652.shtml"
]
def parse(self, respon... | true |
51e1b042452f48699a4cb5437224ef20f5cd9beb | terratenney/Attachment-Cleaner | /zotero_attachment.py | UTF-8 | 5,387 | 3.09375 | 3 | [] | no_license | #!/usr/bin/env python
import sqlite3
import os
import os.path
from collections import Counter
class zotero_cleaner(object):
"""
This is a simple tool that checks if an item attachment is a file in your storage directory and deletes
the record if it is not. Options include cleaning the pdf directory for du... | true |
6e79facc00b2aad3de3d860472bfcad8ea74cd5e | ai-kmu/etc | /algorithm/Basic_Class/문제풀이코드/06_Greedy/큰수만들기_wooseong.py | UTF-8 | 606 | 3.40625 | 3 | [] | no_license | from collections import deque
def solution(number, k):
answer = []
# number가 남아 있는 동안
for num in number:
# answer의 마지막이 새로운 애보다 작고 (앞에 두 개)
# 아직 지울 게 남아 있다면 (k)
while answer and answer[-1] < num and k:
# 걔 버림
answer.pop()
k -= 1
... | true |
3f2812649677847aecb96136e02faa9638c5e95e | lovejavaee/dev-machine | /scripts/tests/gnuplots/txtCombine.py | UTF-8 | 587 | 2.90625 | 3 | [] | no_license | # this file takes the input files and combines the output
# to output_name file
import sys
input_1 = sys.argv[1]
input_2 = sys.argv[2]
input_3 = sys.argv[3]
output_name = sys.argv[4]
#script, input_1, input_2, input_3, output_name = argv
f1 = open(input_1)
f2 = open(input_2)
f3 = open(input_3)
out = open(output_name,... | true |
8324b473a64eb386cfcb17b424a3cf205acb1d1a | colo6299/CS-1.2-Intro-Data-Structures | /Code/rand_words.py | UTF-8 | 349 | 2.9375 | 3 | [] | no_license | import random
import sys
import cProfile
def sample_words():
f = open('/usr/share/dict/words')
words_list = f.readlines()
f.close()
length = len(words_list)
print()
for i in range(int(sys.argv[1])):
print(words_list[int(random.random() * length)])
if __name__ == "__main__":
cProfi... | true |
5d701109a436608045f9086a0f8544fd204decf7 | daksh-l/summer-of-qode | /Python/2021/Class 4/Student Code/Daksh Leekha/rockPaperScissor.py | UTF-8 | 2,263 | 3.890625 | 4 | [
"MIT"
] | permissive | import random
import time
play = True
while play == True:
play = True
act = random.randrange(1, 4)
opt = input("\nPlease type the first letter of your action: ")
# telling player input
if opt == "r":
print("\nYou have chosen rock!")
elif opt == "s":
print("\nYo... | true |
c35390955fd2afa5dc23cb35266fcc92828a7f75 | aatapa/RLScore | /docs/src/kernel2.py | UTF-8 | 809 | 2.6875 | 3 | [
"MIT"
] | permissive | import numpy as np
from rlscore.learner import RLS
from rlscore.measure import sqerror
from housing_data import load_housing
def train_rls():
X_train, Y_train, X_test, Y_test = load_housing()
learner = RLS(X_train, Y_train, kernel="GaussianKernel", regparam=0.0003, gamma=0.00003)
#Leave-one-out cross-val... | true |
5c5b6af7ceff524521bfe06fec681175d6cf4202 | modestdaniel/Baekjoon | /2443.py | UTF-8 | 168 | 3.390625 | 3 | [] | no_license | import sys
n=int(sys.stdin.readline())
for i in range(n):
for j in range(i): print(" ",end='')
for j in range(2*(n-i-1)+1): print("*",end='')
print("") | true |
db9de65693c5a799749d8f0726dc7f40310bce2b | Dillon1john/Python | /classworknov1.py | UTF-8 | 232 | 2.609375 | 3 | [] | no_license | s="THE NAME OF MY COLLEGE IS NEW YORK CITY COLLEGE OF TECHNOLOGY, BROOKLYN, NEW YORK, UNITED STATES OF AMERICA"
A=s.count("A")
E=s.count("E")
I=s.count("I")
O=s.count("O")
U=s.count("U")
print(A)
print(E)
print(I)
print(O)
print(U)
| true |
773169fe1e10769b965f411919918d3d251b5748 | Val-Potitova/pybook | /homework01/vigenere.py | UTF-8 | 2,382 | 3.75 | 4 | [] | no_license | def encrypt_vigenere(plaintext: str, keyword: str) -> str:
"""
Encrypts plaintext using a Vigenere cipher.
>>> encrypt_vigenere("PYTHON", "A")
'PYTHON'
>>> encrypt_vigenere("python", "a")
'python'
>>> encrypt_vigenere("ATTACKATDAWN", "LEMON")
'LXFOPVEFRNHR'
"""
cipher... | true |
d3d67be767044d6a8309276283ef60d0f2cc6f3d | AbrahamCHL/Curso_IA | /python/ejercicios/python/busConClases_pasajeros/functionsBus.py | UTF-8 | 3,488 | 3.53125 | 4 | [] | no_license | from Bus import Bus
def crearBus(buses):
nombre_existe = False
nombre = input("Introducir nombre del bus: ")
for x in range(len(buses)):
if nombre == buses[x].getNombre():
nombre_existe = True
if nombre_existe == False:
while True:
try:
... | true |
89839ba6f0feac16725784f0f501c4b8a419acc4 | DaHuO/Supergraph | /codes/CodeJamCrawler/16_0_2/nyxpho/pancakes.py | UTF-8 | 525 | 3.046875 | 3 | [] | no_license | import sys
if __name__ == "__main__":
rb = open(sys.argv[1], 'r')
wb = open(sys.argv[2], 'w')
n = int(rb.readline().strip())
for i in range(0,n):
line = rb.readline().strip()
flips = 0
j = 0
if line[j] == '-':
while j < len(line) and line[j] == '-':
j+=1
flips+=1
while j < len(line):
while j... | true |
0ccd1d9c87b75f0e4744eca6f7c4ce4f8050775b | tcgarvin/adventOfCode2019 | /23/nic.py | UTF-8 | 2,538 | 3.15625 | 3 | [] | no_license | from intcode import IntCodeRuntime, IntCodeStatus, get_program_input
from typing import List
def solve_part_1(puzzle_input):
nics : List[IntCodeRuntime] = []
for i in range(50):
runtime = IntCodeRuntime()
runtime.set_program(puzzle_input[:])
runtime.run()
runtime.input_number(i)... | true |
cf87c37e53caf6110ac32e4cca2245045aca65f0 | jairock282/pythonWorshop | /Practicas/Clase2/esSubcadena.py | UTF-8 | 358 | 3.59375 | 4 | [] | no_license | #Pedimos las cadenas de caracteres
cont = 0
#igual = false
print("Ingrese su primera cadena: ")
primera = input()
print("Ingrese su segunda cadena: ")
segunda = input()
if primera.find(segunda) >= 0:
print("La segunda cadena es subCadena de la primera!")
else:
print("La seguda cadena no es subCadena de la primer... | true |
06c1865224d8101754319b7dfdbef28fc48d00bb | Happzy-WHU/Clock | /DataBaseOperation.py | UTF-8 | 3,994 | 2.8125 | 3 | [] | no_license | import pymysql.cursors
# 连接数据库
connect = pymysql.connect("localhost","root","12345678","attendsystem" )
# 获取游标
cursor = connect.cursor()
#<editor-fold desc="增加">
def insertIntoDatabase(firstList,lastList,tablename):
if(len(firstList)!=len(lastList)):
print("insertIntoDatabase输入参数错误")
return
s=... | true |
1a327e5998ca5331007b1af544a36d343fc09363 | lzccc/BPnetwork-for-Digital-Recognition | /BPnetwork/BPnetwork.py | UTF-8 | 7,926 | 2.71875 | 3 | [] | no_license | # -*- coding:utf-8 -*-
'''
Created on 2017年12月24日
@author: lenovo
'''
import os
import numpy as np
import pickle
import matplotlib
import math
import random
matplotlib.use('Agg')
import matplotlib.pyplot as plt
import copy
def write_reult(value, name):
with open(name,"w+") as f:
for i in range(len(value... | true |
e9ac9dcd1024fcad5edf1c591a974826fc8498cf | crew/dds-slides | /parrot_or_carrot/layout.py | UTF-8 | 1,880 | 2.671875 | 3 | [] | no_license | import clutter
from crew.dds import baseslide
import gobject
import time
from urllib import urlretrieve
SCREEN_HEIGHT = 1200
SCREEN_WIDTH = 1920
class ParrotOrCarrot(baseslide.BaseSlide):
def __init__(self):
baseslide.BaseSlide.__init__(self)
def event_beforeshow(self):
self.zoomed_image = ur... | true |
ac489620a8903ffd7649c0c6de8eb2d2d1bd52c2 | iyevenko/Address-Parser | /address_parser/model.py | UTF-8 | 2,582 | 2.578125 | 3 | [] | no_license | import json
import os
import matplotlib.pyplot as plt
import numpy as np
import tensorflow as tf
from tensorflow.keras.layers import Bidirectional, Embedding, GRU, Dense, SpatialDropout1D
import address_parser.dataset as ds
CHECKPOINT_PATH = os.path.join(os.path.dirname(__file__), '..', "saved_models")
def model_f... | true |
67e90b7ea54666fc3617f8b111a98d1518155ee5 | youngsoomoon/codeUp | /6089.py | UTF-8 | 304 | 3.5 | 4 | [] | no_license | '''
입력
시작 값(a), 등비의 값(r), 몇 번째 인지를 나타내는 정수(n)가
공백을 두고 입력된다.(모두 0 ~ 10)
출력
n번째 수를 출력한다.
입력 예시
2 3 7
출력 예시
1458
'''
a,r,n = map(int,input().split())
s = a
for i in range(1,n,1):
s = s * r
print(s) | true |
96a29155fdb22441420e4be568f1b02f672baee0 | GaloisInc/amase-code-generator | /concept/auto_generated/afrl/cmasi/ServiceStatusType.py | UTF-8 | 696 | 3.359375 | 3 | [] | no_license | #! /usr/bin/python
class ServiceStatusType:
Information = 0
Warning = 1
Error = 2
def get_ServiceStatusType_str(str):
"""
Returns a numerical value from a string
"""
if str == "Information": return ServiceStatusType.Information
if str == "Warning": return ServiceStatusType.Warning
... | true |
d974b44348e16462d8041ff29772b09f31c0a11b | donghaoye/pytorch-fast-neural-style | /loss.py | UTF-8 | 1,688 | 2.625 | 3 | [] | no_license | import os
import torch
from torch.nn import MSELoss
from torch.utils.serialization import load_lua
from torch.autograd import Variable
import models
from data_utils import vgg_mean_subtraction
def vgg16_model():
if not os.path.exists('vgg16feature.pth'):
if not os.path.exists('vgg16.t7'):
os.s... | true |
5363d650144d456485e30cd4df18081916c61d99 | learlinian/Python-Leetcode-Solution | /792. Number of Matching Subsequences.py | UTF-8 | 1,554 | 3.234375 | 3 | [] | no_license | # slow solution. Time complexity O(m*n)
# class Solution(object):
# def numMatchingSubseq(self, s, words):
# result = 0
# words_len = len(words)
# i_list = [0] * words_len
# for c in s:
# for i in range(words_len):
# if i_list[i] == -1:
# ... | true |
f12145b905a2972082449fafe1eea38c990b4288 | skojaku/core-periphery-detection | /cpnet/Divisive.py | UTF-8 | 6,905 | 2.75 | 3 | [
"Apache-2.0"
] | permissive | import numba
import numpy as np
from scipy import sparse
from . import utils
from .BE import BE
from .CPAlgorithm import CPAlgorithm
class Divisive(CPAlgorithm):
"""Divisive algorithm.
This algorithm partitions a network into communities using the Louvain algorithm.
Then, it partitions each community in... | true |
d94e0c9f0ff5a0c9b130d4ecfbc4a1663d31aca9 | Tometoyou1983/Python | /Python web programs/terminalemailsend.py | UTF-8 | 2,066 | 2.921875 | 3 | [] | no_license | # Python 3
# this program triggers a selenium script to send out an email thru terminal
#this can be alterted to enter info thru command line as well as copy/paste data using pyperclip
#this asks for email id of recipient, subject and body
# this program also needs to be updated with ur user id and pass for logging int... | true |
a091546d69171efa9e61e1bf49e85053ca35d361 | 4teamwork/opengever.core | /opengever/ogds/base/tests/test_cookie_storage.py | UTF-8 | 1,645 | 2.59375 | 3 | [] | no_license | from datetime import date
from datetime import datetime
from datetime import timedelta
from opengever.ogds.base.utils import CookieStorage
from opengever.testing import FunctionalTestCase
class TestCookieStorage(FunctionalTestCase):
use_default_fixture = False
def setUp(self):
super(TestCookieStorage... | true |
8bfe1413e81a3cbf8e0408f3fdb307c0490ccede | RoboticBase/ogc-poc1-device | /src/dest_led.py | UTF-8 | 6,346 | 2.78125 | 3 | [
"Apache-2.0"
] | permissive | #!/usr/bin/env python3
import time
import ssl
import paho.mqtt.client as mqtt
import neopixel
import argparse
parser = argparse.ArgumentParser(description="LED controller")
parser.add_argument("--host",
help="MQTT Address(Default:localhost)",
default='localhost')
parser.add_argu... | true |
7c9e1499aabaaa4d2a4df0f24c73f88457767d30 | MrHamdulay/csc3-capstone | /examples/data/Assignment_2/01375526/question2.py | UTF-8 | 2,346 | 3.46875 | 3 | [] | no_license | print ("Welcome to the 30 Second Rule Expert")
print ("------------------------------------")
print ("Answer the following questions by selecting from among the options.")
ans = input ("Did anyone see you? (yes/no)\n")
if (ans == "yes"):
ans = input ("Was it a boss/lover/parent? (yes/no)\n")
if (ans == "yes"):
... | true |
ae4f4e1bb85e73d53c0f6aae29c577937d5a4ea9 | snowmint/Neural_Network_Concept | /HW08_Diabetes Prediction.py | UTF-8 | 1,340 | 3.09375 | 3 | [] | no_license | # import some packages here
from sklearn.preprocessing import StandardScaler
from sklearn.model_selection import train_test_split
from sklearn.metrics import classification_report
from sklearn.metrics import confusion_matrix
from sklearn.linear_model import LogisticRegression
import numpy as np
import pandas as ... | true |
38c5ea120d5f9d9bab0ca7c30974d0ca8dbe5ba4 | TrendingTechnology/nlp-space-news-topic-modeling | /api/api_helpers/api_webpage_banner_image_processing.py | UTF-8 | 3,178 | 3.015625 | 3 | [
"MIT"
] | permissive | #!/usr/bin/python3
# -*- coding: utf-8 -*-
from io import BytesIO
import numpy as np
import requests
from PIL import Image, ImageOps
def crop_image(original, single_image_height, single_image_width):
width, height = original.size # Get dimensions
# print(width, height)
left_margin = (width / 2) - (si... | true |