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 |
|---|---|---|---|---|---|---|---|---|---|---|
8a3fe77e544c3f4fd6726d20c0258e2bb6b63f19 | drumgiovanni/schoolPythonProject | /02/7.py | UTF-8 | 333 | 3.546875 | 4 | [] | no_license | a = int(input("整数を入力してください"))
b = int(input("整数を入力してください"))
c = int(input("整数を入力してください"))
if a < b +c and b < a + c and c < b + a:
print("a,b,cを辺とする三角形が成り立ちます")
else:
print("a,b,cを辺とする三角形が成り立ちません") | true |
70153e1c42f4f4536c642228cf54bef87fa67d7f | sharifnezhad/todolist | /backend.py | UTF-8 | 1,085 | 3.109375 | 3 | [] | no_license | import sqlite3
class Database():
def __init__(self):
self.database_connection=sqlite3.connect('db-todolist.db')
self.my_cursor=self.database_connection.cursor()
self.my_cursor.execute('SELECT * FROM work')
self.data = self.my_cursor.fetchall()
def add_data(self,title... | true |
9b93653b8323da729fa75917954872bcb9d2092a | zhangxiaoxiaohao/python3 | /08.day/飞机大战/4游戏板块.py | UTF-8 | 523 | 2.84375 | 3 | [] | no_license | import pygame
pygame.init()
screen = pygame.display.set_mode((480,700))
bg = pygame.image.load("./images/background.png")
screen.blit(bg,(0,0))
hero = pygame.image.load("./images/hero.gif")
screen.blit(hero,(180,500))
clock = pygame.time.Clock()
hero_rect = pygame.Rect(180,500,200,200)
while True:
clock.tick(60)
... | true |
65274843f34ef964ba39fc6e29fd5b8e540a3498 | hen1379/MSE_Python | /202010655 기계시스템공학부 김회창/ex160.py | UTF-8 | 509 | 3.234375 | 3 | [] | no_license | #!/usr/bin/env python
# coding: utf-8
# In[ ]:
리스트 = ['intra.h', 'intra.c', 'define.h', 'run.py']
for i in 리스트:
#for문 사용하여 리스트안의 원소 하나씩 i에 대입
split = i.split(".")
#split으로 .을 기점으로 반으로 나누어 진다.
if (split[1] == "h") or (split[1] == "c"):
print(i)
# split으로 나누었는데 뒤에 있는것이 h나 c에 있는게 있다면 print(i)가 ... | true |
9e8c075da7cd0ce05e843d19d9f6f2ac07cd8388 | fengfumin/Toutiao_pyppeteer | /Toutiao_pyppeteer/test1.py | UTF-8 | 2,134 | 2.515625 | 3 | [] | no_license | # -*- coding: utf-8 -*-
# __author__="maple"
"""
┏┓ ┏┓
┏┛┻━━━┛┻┓
┃ ☃ ┃
┃ ┳┛ ┗┳ ┃
┃ ┻ ┃
┗━┓ ┏━┛
┃ ┗━━━┓
┃ 神兽保佑 ┣┓
┃ 永无BUG! ┏┛
┗┓┓┏━┳┓┏┛
... | true |
05ca5a27b9ef602b30f87af7a48ada8b6b351527 | iposov/students-site | /21fall/prog_basics/test-system/solutions.py | UTF-8 | 3,135 | 3.671875 | 4 | [] | no_license | # Разборы задач
from testsystem import test
# Задача о выводе трехчлена: a, b, c -> ax^2 + bx + c
# 1, -2, 0 -> "x^2 - 2x"
def poly_solution_1(a, b, c):
# Отдельно соберем три части многочлена, при 2-ой, 1-ой, 0-ой степени
if a == 0:
deg2 = '0'
elif a == 1:
deg2 = 'x^2'
elif a == -1:
... | true |
5231c0a993cf7f42e5dacc39000c2fa5c5eb200d | CommanderPho/pyPhoPlaceCellAnalysis | /src/pyphoplacecellanalysis/GUI/PyQtPlot/Examples/pyqtplot_Legend.py | UTF-8 | 4,109 | 2.875 | 3 | [
"MIT"
] | permissive | import numpy as np
import pyphoplacecellanalysis.External.pyqtgraph as pg
from pyphoplacecellanalysis.External.pyqtgraph.Qt import QtWidgets, mkQApp, QtGui
class PyQtPlotLegendMixin:
def add_legend():
""" https://www.geeksforgeeks.org/pyqtgraph-symbols/
o : Default symbol, round circle symbo... | true |
6f6189526afb80342bb93dbfdc65df9f9b06dcba | caiofov/Controle-Passageiros | /arquivos/dia_semana.py | UTF-8 | 3,198 | 3.34375 | 3 | [] | no_license | import datetime
import json
with open('teste.json') as teste:
teste = json.load(teste)
#Dicionário para converter a representação do dia da semana da biblioteca datetime
#nos nomes dos dias da semana
semana = {
'Segunda-Feira' : 0, 'Terça-Feira' : 1,
'Quarta-Feira' : 2, 'Quinta-Feira' : 3,
'Sexta-F... | true |
116151916f994c9b1c6f0327df3fe4c7becb27f9 | sanketjoshi4/cs81_robotics_lidar_tracker | /target_following/scripts/target.py | UTF-8 | 15,996 | 2.875 | 3 | [] | no_license | #!/usr/bin/env python
import rospy
from geometry_msgs.msg import Twist
from std_msgs.msg import Bool
from nav_msgs.msg import Odometry
from sensor_msgs.msg import LaserScan # laser
import tf
import numpy as np
import math
import random
# TARGET.PY
# class for the target object, using code from PA2 Archita
class Tar... | true |
cdb31b6beab8f2bf7153c61092f74eede2e54be7 | Packman700/Tkinter-Color-Picker | /rgb_hls.py | UTF-8 | 1,518 | 3.0625 | 3 | [] | no_license | import colorsys
import math
import hex
Colors_preset = {'Triad': {1: [120, 30, 0], 2: [120, 0, 0], 4: [240, 0, 0], 5: [240, 30, 0]},
'Complementary': {1: [360, 30, 0], 2: [360, 60, 0], 4: [180, 0, 0], 5: [180, 30, 0]},
'Split-complementary': {1: [150, 30, 0], 2: [150, 0, 0], 4: [210, ... | true |
f8827187d302b4b6ca66408f13dd1f068e51a9a9 | TanjaNuendel/Bioinformatics_2018 | /FASTAdotplotter/fasta_dotplotter.py | UTF-8 | 5,155 | 3.171875 | 3 | [] | no_license | # Bioinformatische Datenanalyse WS 18/19 - Übungsblatt 1
# Autoren: Tanja Nündel (931179), Jonas Heinzel (931167)
# Abgabe: 15.10.2018
import numpy as np
from Bio import SeqIO
from matplotlib import pyplot as plt
bio_arr1 = []
bio_arr2 = []
# Festlegen der Fenstergröße und Übereinstimmungszahl:
window = 2
threshol... | true |
bcd7ceb09d9df5f0728505808bd6d7284d608cdf | dr-dos-ok/Code_Jam_Webscraper | /solutions_python/Problem_138/516.py | UTF-8 | 570 | 2.6875 | 3 | [] | no_license |
f = open('/Users/Wanli/Downloads/D-large.in.txt')
# f = open('input.txt')
ncases = int(f.readline())
for case in range(ncases):
num = int(f.readline())
naomi = sorted([float(x) for x in f.readline().split()])
ken = sorted([float(x) for x in f.readline().split()])
naomi2 = naomi[:]
ken2 = ken[:]
dcount = 0
for... | true |
4f5d13702d58734abf73d7bd765dfa9cd3a25355 | das-jishu/data-structures-basics-leetcode | /Stacks and Queues/deque.py | UTF-8 | 727 | 4.125 | 4 | [
"MIT"
] | permissive |
class Deque(object):
def __init__(self):
self.deq = []
def addFront(self, item):
self.deq.insert(0, item)
def addRear(self, item):
self.deq.append(item)
def removeFront(self):
return self.deq.pop(0)
def removeRear(self):
return self.deq.pop()
def... | true |
ccefc98699ebe6a68cab53421bd756b7c3ade326 | katehrkim/budget | /classes/budget.py | UTF-8 | 1,893 | 3.265625 | 3 | [] | no_license | from classes.savings import Savings
from classes.expenses import Expenses
import os
import csv
class Budget:
def __init__(self, name, amount):
self.name = name
self.amount = amount
self.spendings = []
self.deposits = []
def list_expenses(self):
for object in self.spe... | true |
f71883e9f27ba286ab42d7616a5613b4dd41b482 | Preethi-Malyala/Image-Colourization | /Multivariate Linear Regression.py | UTF-8 | 1,135 | 3.859375 | 4 | [] | no_license | import pandas as pd
#Read the csv file
cars = pd.read_csv('Multivariate Linear Regression.csv')
# Initialise parameters
theta_0 = 1
theta_1 = 1
theta_2 = 1
alpha = 0.1
epsilon = 0.01
# Variables With Feature Scaling
x_1 = (cars.Volume - sum(cars.Volume)/36)/(max(cars.Volume) - min(cars.Volume))
x... | true |
bbe802a4bb013ef592538225950ba747945c2828 | robbynickles/portfolio | /Python/motion_client/libs/server/serverManager.py | UTF-8 | 2,692 | 2.8125 | 3 | [] | no_license | import threading, SocketServer
from plyer.facades import Accelerometer, Compass, Gyroscope
from libs.server.device_handler import DeviceHandler, parse_message
class AccHandler( DeviceHandler ):
device_name = 'Accel'
device_class = Accelerometer
parser = parse_message
class CompassHandler( DeviceHan... | true |
2e528b4296686816a1364a71cde82c1f0070dd35 | aguumg/Curso-Introduccion-a-la-Computacion-para-Matematicos | /Python/BackTracking/Ejercicios resueltos/Código backtracking/grilla.py | UTF-8 | 2,698 | 3.765625 | 4 | [
"MIT"
] | permissive | # implementacion del TAD casillero
class Casillero:
# crea un nuevo casillero con letra l
def __init__(self, l):
self.letra = l
self.marca = False
# devuelve la letra del casillero
def verLetra(self):
return self.letra
# marca el casillero como visitado
def marcar(self):
self.marca = Tru... | true |
377b22cc10879a21b88f78e971272c5d8b965c1c | Submitty/Submitty | /grading/json_syntax_checker.py | UTF-8 | 1,019 | 2.53125 | 3 | [
"BSD-3-Clause",
"MIT"
] | permissive | #!/usr/bin/env python3
import argparse
import os
import json
import re
import traceback
import sys
if __name__ == "__main__":
parser = argparse.ArgumentParser(description="Preprocess a instructor config json to prepare it for main_configure.cpp")
parser.add_argument("file", metavar="file_name", type=str,
... | true |
accccf78f3ab8884e8cdaf505c155753709cb07a | anirudhb/ma_desktop | /scripts/multable.py | UTF-8 | 1,211 | 3.8125 | 4 | [] | no_license | #!/usr/bin/env python
# Multiplication Fact Table
##def multable(n1, n2:
## i = n1
## i2 = 1
## for ix in range(n2):
## print i, "X", i2, "=", i*i2
## i2 += 1
##
##def negmultable(neg1, neg2):
## i = neg1
## if neg2 > 0:
## i2 = 1
## ... | true |
3ecd26af98281820fe44a21a1d59d9310a2c8c1c | AiNguyen237/Prostate-cancer-grade-assessment | /helper_functions.py | UTF-8 | 12,368 | 2.796875 | 3 | [] | no_license | import openslide
import cv2
import tensorflow as tf
import numpy as np
import skimage
import os
import tensorflow_io as tfio
import matplotlib.pyplot as plt
import matplotlib
import pandas as pd
from skimage import io
# Normalization png images
def normalize(input_image, real_image):
""" Normalizing the images to ... | true |
083aa60288b14d90717dd7b8d32615240c0ff999 | PacktWorkshops/The-TensorFlow-Workshop | /Chapter06/Exercise06_04/test06_04.py | UTF-8 | 3,074 | 2.71875 | 3 | [] | no_license | import unittest
import import_ipynb
import pandas as pd
import numpy as np
import pandas.testing as pd_testing
import numpy.testing as np_testing
import tensorflow as tf
from tensorflow.keras.layers import Dense
from sklearn.model_selection import train_test_split
import kerastuner as kt
def model_builder(hp):
model... | true |
f06f0de4124aa66d25ca6706ebb2dc87c1a6a9d2 | HuyNVuong/Numerical-Analysis-Project | /src/accounting.py | UTF-8 | 352 | 2.890625 | 3 | [] | no_license | from typing import Callable
import math
def build_future_income_function(A: Callable[[float], float], T: float, r: float) -> Callable[[float], float]:
return lambda t: A(t) * math.exp(r * (T - t))
def build_present_value_function(A: Callable[[float], float], r: float) -> Callable[[float], float]:
return lambd... | true |
cd51958febc9e79a64f89c10d97c60d3f163ba00 | kapilnegi67/PythonSeleniumDemo | /src/xlrd_data_driven.py | UTF-8 | 976 | 3.015625 | 3 | [] | no_license | import xlrd
from selenium import webdriver
import time
file_location = "../test_data/xlrd_data_driven_data.xlsx"
result_data = []
driver = webdriver.Chrome(executable_path=r"/Users/kapilnegi/Desktop/chromedriver")
driver.get("https://the-internet.herokuapp.com/login")
with xlrd.open_workbook(filename=file_location)... | true |
9190cef5b1ab9b11ac5d4a9f79af7b94cccf4770 | bohnacker/data-manipulation | /csv-manipulation/csv-calculate-values.py | UTF-8 | 2,326 | 3.609375 | 4 | [
"MIT"
] | permissive | # A script to help you with manipulating CSV-files. This is especially necessary when dealing with
# CSVs that have more than 65536 lines because those can not (yet) be opened in Excel or Numbers.
# This script works with the example wintergames_winners.csv, which is an excerpt from
# https://www.kaggle.com/heesoo37/... | true |
4c5864dd52edff609c5438d2196c7ea73cd36bf3 | pratyushmp/code_opensource_2020 | /Python/Data Visualization using Matplotlib.py | UTF-8 | 428 | 3.609375 | 4 | [] | no_license | from matplotlib import pyplot as plt
list1 = [1,2,3,4,5,6,7,8,9,10]
list2 = [2,4,6,8,10,12,14,16,18,20]
plt.plot(list1,list2,color = 'red')
plt.xlabel('list1')
plt.ylabel('list2')
plt.title('Simple Graph Using Matplotlib')
plt.show()
plt.scatter(list1,list2,s= 45 ,color = 'blue', alpha = 0.7) #s->size, al... | true |
da7cc55f3ad47eb1fe40c2902ead1a2b98e10407 | akrherz/DEV | /igniterealtime/save_attachment_json.py | UTF-8 | 2,437 | 2.703125 | 3 | [
"Apache-2.0",
"MIT"
] | permissive | """Get details on attachments in SBS"""
import json
import os
import sys
import requests
API = "https://igniterealtime.jiveon.com/api/core/v3"
JIVEUSER = sys.argv[1]
JIVEPASS = sys.argv[2]
def apiget(url):
"""Get what we need"""
try:
req = requests.get(url, auth=(JIVEUSER, JIVEPASS))
if req.... | true |
3618493571e47bf216e6fa90b74baceb6b0ffe12 | dres-a/PBE | /PruebaCAmbioVariable/prueba.py | UTF-8 | 286 | 3.28125 | 3 | [] | no_license | import threading
import time
class clase:
def __init__(self):
self.arg = "Buenas"
def CambioArg(self):
self.arg = "tardes"
c = clase()
print(c.arg)
thread = threading.Thread(target = c.CambioArg)
thread.start()
time.sleep(2)
print(c.arg)
| true |
46cf2d453956540bd2e1aef3f25adc1df2774434 | vhk2018/fyp | /main/aes_function/reader.py | UTF-8 | 2,681 | 2.53125 | 3 | [] | no_license | import logging
import nltk
import numpy as np
import pickle as pk
import re
from keras.preprocessing import sequence
logger = logging.getLogger(__name__)
num_regex = re.compile('^[+-]?[0-9]+\.?[0-9]*$')
ref_scores_dtype = 'int32'
asap_ranges = {
0: (0, 9)
}
def get_ref_dtype():
return ref_scores_dtype
def ... | true |
56e8b1270df268405fdda8c3e660ba02dd0cd572 | LokeshKD/IBMAIEngineering | /BD_ML_Spark/week1/Functional Programming Basics with RDD.py | UTF-8 | 3,984 | 3.78125 | 4 | [] | no_license | #!/usr/bin/env python
# coding: utf-8
# This notebook is designed to run in a IBM Watson Studio default runtime (NOT the Watson Studio Apache Spark Runtime as the default runtime with 1 vCPU is free of charge). Therefore, we install Apache Spark in local mode for test purposes only. Please don't use it in production.
... | true |
796f494f4dfac853458a0fee530f2831cd4ea90c | Koemyy/Projetos-Python | /PYTHON/Python Exercícios/3 lista de exercicios/1115.py | UTF-8 | 370 | 3.71875 | 4 | [
"MIT"
] | permissive | valor = input().split()
v1 = int(valor[0])
v2 = int(valor[1])
while(v1!=0 and v2!=0):
if(v1>0 and v2>0):
print("primeiro")
if(v1>0 and v2<0):
print("quarto")
if(v1<0 and v2<0):
print("terceiro")
if(v1<0 and v2>0):
print("segundo")
valor = input().split... | true |
416ac334a77ce3d026d6714c417781797bf16e6d | nmaypeter/project_nw_181113 | /Initialization.py | UTF-8 | 9,456 | 3.140625 | 3 | [] | no_license | import random
class Initialization():
def __init__(self, dataname):
### dataname, data_data_path, data_weight_path, data_degree_path: (str)
self.dataname = dataname
self.data_data_path = "data/" + dataname + "/" + dataname + '_data.txt'
self.data_weight_path = "data/" + dataname + "/... | true |
9db5245fe6da989c43ff81d3ccb4fb5d9a53308a | jasonfreak/arena | /1050/500/main.py | UTF-8 | 1,617 | 2.96875 | 3 | [] | no_license | from functools import wraps
#from itertools import permutations
#from itertools import combinations
#from sys import maxint
#
def memo(func):
cache = {}
miss = object()
@wraps(func)
def wrapper(*args):
result = cache.get(args, miss)
if result is miss:
result = f... | true |
88738084854a24a6a40d92ffbd984f4afb92a3f5 | mmoonzhu/spider_python | /main.py | UTF-8 | 3,064 | 2.53125 | 3 | [] | no_license | #!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
#=============================================================================
# FileName: main.py
# Desc:
# Author: lizherui
# Email: lzrak47m4a1@gmail.com
# HomePage: https://github.com/lizherui
# Version: 0.0.1
# LastChange: 2013-... | true |
95eab8d6bd9b282fff6da99f2ec39f5471ec67c1 | KPWysocki/wd3 | /zespolone/oddzielacz.py | UTF-8 | 157 | 3.328125 | 3 | [] | no_license |
Y = complex(input())
Z = (Y.real, Y.imag)
A = Y.real
B = Y.imag
print("Czesc rzeczywista to: ", end="")
print(A)
print("Czesc urojona to: ",end="")
print(B) | true |
91b457472534af35c451d79a9b511b2e9c6caac3 | AndreasMadsen/stable-nalu | /stable_nalu/layer/pos_nac.py | UTF-8 | 1,635 | 2.53125 | 3 | [
"MIT"
] | permissive |
import scipy.optimize
import numpy as np
import torch
from ..functional import nac_weight, sparsity_error
from ..abstract import ExtendedTorchModule
from ._abstract_recurrent_cell import AbstractRecurrentCell
class PosNACLayer(ExtendedTorchModule):
"""Implements the NAC (Neural Accumulator)
Arguments:
... | true |
8a57338b9f6b97eaa3cbaf29980c86949da8786f | DresKeller/Python | /py4e/20210414_Quiz_10.py | UTF-8 | 174 | 3.5 | 4 | [] | no_license | # x , y = 3, 4
# print(y)
# x = { 'chuck' : 1 , 'fred' : 42, 'jan': 100}
# y = x.items()
# print(y)
days = ('Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun')
print(days[2])
| true |
875824abd5d3b44215e94ca645c7bbfcafb2113a | jptafe/ictprg434_435_python_ex | /wk3/wk3_cli_parameters.py | UTF-8 | 1,379 | 3.1875 | 3 | [] | no_license | #!/usr/bin/python
import sys # this is a library of features that extend Python
#print(sys.argv) # this prints the entire list of CLI options including the .py file
single_dash_count = 0
double_dash_count = 0
equals_count = 0
total_count = 0
for single_arg in sys.argv:
total_count += 1
if single... | true |
44849384cef0b510ae708f82694f9fdd749d6832 | alexroederer/moonstone | /read_data.py | UTF-8 | 3,881 | 3.078125 | 3 | [] | no_license | '''
read_data.py
@author: Alexander Roederer
@date: May 10, 2016
Prepares data for reading from Fictive Kin openrecipes project
'''
'''
DatasetManager object
Currently only supports reading recipes in order
Currently only supports acquisition of name and ingredients;
full recipe can be retrieved using recipe-scr... | true |
51d018a462d167afa9c94d08cbaa8eaccc680422 | huazhige/EART119_Lab | /mid-term/waldschmidtluke/waldschmidtluke_20323_1312481_Midterm_1.py | UTF-8 | 752 | 2.703125 | 3 | [] | no_license | #!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
Created on Wed May 8 08:22:57 2019
@author: lukewaldschmidt
"""
import numpy as np
import matplotlib.pyplot as plt
import opt_utils
#import data
file_in = 'data/star_luminos.txt'
mData = np.genfromtxt(file_in).T
T = mData[0]
L = mData[1]
#use opt_utils to find ... | true |
a68d640cd64bf822962e50678a40757feb885743 | sunset326/badou-Tsinghua | /Homework/34-吴崇富-南充/week5/test01_k-means_athlete.py | UTF-8 | 1,969 | 3.53125 | 4 | [] | no_license | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
from sklearn.cluster import KMeans
"""
第一部分:数据集
X表示二维矩阵数据,篮球运动员比赛数据
总共20行,每行两列数据
第一列表示球员每分钟助攻数:assists_per_minute
第二列表示球员每分钟得分数:points_per_minute
"""
X = [[0.0888, 0.5885],
[0.1399, 0.8291],
[0.0747, 0.4974],
[0.0983, 0.5772],
[0.1276, 0... | true |
e01bd57812b10c35c745ed6d4b41b6057b66f127 | kaisAlbi/Kais-Albichari-Master-Thesis-2018-2019 | /StateSimulation/EstimatePayoffPairs.py | UTF-8 | 19,299 | 3.390625 | 3 | [] | no_license | from TreeStrategy import Tree
import numpy as np
from itertools import product
import time
import json
def createStrategies(nb_states):
"""
Generate all possible combination of strategies, depending on the number of states
:return: list of all strategies in the form [T_c,T_d, action state_0, ..., action ... | true |
0d4f149558045285a59f9872e3b0ff306fe893f0 | sgoodspeed/samKeenanGame | /core/app.py | UTF-8 | 4,616 | 2.90625 | 3 | [] | no_license | #!/usr/bin/env python
import pygame
from pygame.locals import *
from ui import InfoText, InfoBlock
from core.input import InputManager, KeyListener, MouseListener
from core.settings import *
# core/sound.py
class SoundManager(object):
def play(self, which):
pass
class Application(object):
hudRect = (... | true |
1466cefd3a4eb10e513bb4ff58e4d444e6a92339 | ramonmoraes/simplePyScrapper | /snippet/Snippet.py | UTF-8 | 713 | 2.546875 | 3 | [] | no_license | from pymongo import MongoClient
from snippet import get_db
from snippet.decorators import info_required
class Snippet:
def __init__(self, url, title, text, img, collection_name = 'snippet'):
self.url = url
self.title = title
self.text = text
self.img = img
self.collection_n... | true |
2c36f08a6e19c9b1a73ba6d5c3df96491b5584b0 | FisicaComputacionalOtono2018/20180829-tareapythoniintial-jordetm5 | /ecuaciones.py | UTF-8 | 403 | 3.65625 | 4 | [] | no_license | #Jorge Dettle Meza Dominguez
#29/08/2018
#solucion de ecuaciones
a=float(input(" dame el valor de a: "))
b=float(input(" dame el valor de b: "))
c=float(input(" dame el valor de c: "))
d=float(input(" dame el valor de d: "))
e=float(input(" dame el valor de e: "))
f=float(input(" dame el valor de f: "))
x=(c... | true |
7c5b88f6ecbbeb5d454da1c889ae18aedc9a8d87 | swesadiqul/python-datatype-conversion | /int () function.py | UTF-8 | 911 | 4.53125 | 5 | [] | no_license | #Programmer Sadiq
#By@Sadiqul Islam
#Use of int() function
#int() function
#int() function convert any string or number to integer
#Syntax of int() function: int(string or float)
#It takes a string or number and return a integer value
#For example
#Example 1
number_one = input("Enter the number of one: ")
number... | true |
ecd99ea7e969bbdadcd87af0d9da9272847f4fc4 | itsolutionscorp/AutoStyle-Clustering | /all_data/exercism_data/python/prime-factors/6fb6f960bb4b492f8213f5c671376567.py | UTF-8 | 305 | 3.390625 | 3 | [] | no_license | def reduce_by_smallest_factor(n):
return next(((f, int(n / f)) for f in range(2, n) if n % f == 0),
(n, 1))
def prime_factor_generator(n):
while n > 1:
x, n = reduce_by_smallest_factor(n)
yield x
def prime_factors(n):
return list(prime_factor_generator(n))
| true |
9ab2ff422e805c7f864054a34728b046ae3d0a6e | williballenthin/ucutils | /ucutils/checkpoint.py | UTF-8 | 2,331 | 2.921875 | 3 | [
"Apache-2.0"
] | permissive | #!/usr/bin/env python
import logging
import contextlib
from typing import Dict
from dataclasses import dataclass
import unicorn
import ucutils.emu
from ucutils import PAGE_SIZE
logger = logging.getLogger(__name__)
class MemWriteTracker(ucutils.emu.Hook):
HOOK_TYPE = unicorn.UC_HOOK_MEM_WRITE
def __init__(... | true |
3544bd7e941e7f7d56315b8e88704c588e98765b | YuvApps/botDataFiller | /requests.py | UTF-8 | 806 | 2.546875 | 3 | [] | no_license | import random
from userGenerator import get_req_by_user
def requests_creation(db, mode):
if mode > 0:
requests_col = db["requests"]
users_col = db["users"]
requests_arr = []
if mode == 1:
for index in range(4000):
requests_arr.append(get_req_by_user(use... | true |
f1d62d342c83aba963bf148463302b9bb2ea168a | nikdoof/python-ts3 | /ts3/test.py | UTF-8 | 5,155 | 2.859375 | 3 | [
"BSD-3-Clause"
] | permissive |
try:
import unittest2 as unittest
except ImportError:
import unittest
import socket
import threading
import time
try:
from collections import OrderedDict
except ImportError:
from ordereddict import OrderedDict
from ts3.protocol import TS3Proto, ConnectionError, NoConnectionError
class TS3ProtoTest(un... | true |
69f19fad4880f47df15300069d8152707289f7b9 | armstrong019/coding_n_project | /Jiuzhang_practice/swap_linked_list_pairs.py | UTF-8 | 1,466 | 3.75 | 4 | [] | no_license | #https://www.cnblogs.com/yrbbest/p/4434861.html
"""
Definition of ListNode
class ListNode(object):
def __init__(self, val, next=None):
self.val = val
self.next = next
"""
class Solution:
def swapPairs(self, head):
"""
:type head: ListNode
:rtype: ListNode
"""
... | true |
f4b60df2a0070ea9637c82ca8b8b29e772fc5d10 | khrapovs/datastorage | /datastorage/cboe.py | UTF-8 | 1,802 | 2.71875 | 3 | [
"MIT"
] | permissive | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Download and process CBOE data.
Volatility:
http://www.cboe.com/micro/vix/historical.aspx
Correlation:
http://www.cboe.com/micro/impliedcorrelation/
"""
from __future__ import print_function, division
import os
import urllib
import pandas as pd
import numpy as np
i... | true |
f4a04e266ffbd378f972ddd8958692bf261c1498 | opendatacube/datacube-zarr | /tests/test_convert.py | UTF-8 | 2,445 | 2.609375 | 3 | [
"Apache-2.0"
] | permissive | import pytest
import rasterio
from datacube_zarr.utils.convert import convert_dir, convert_to_zarr, get_datasets
from datacube_zarr.utils.uris import uri_split
from .utils import _load_dataset, copytree, raster_and_zarr_are_equal
def test_find_datasets_geotif(tmp_dir_of_rasters):
"""Test finding geotif datasets... | true |
be86b229a39e97389f5a8887c577838ba93a1401 | thiyagutenysen/Datastructures_and_Algorithm_in_Python | /Graphs/breadth_first_search.py | UTF-8 | 2,038 | 4.3125 | 4 | [] | no_license | # Breadth First Traversal (or Search) for a graph is similar to
# Breadth First Traversal of a tree (See method 2 of this post).
# The only catch here is, unlike trees, graphs may contain cycles,
# so we may come to the same node again. To avoid processing a node more than once,
# we use a boolean visited array.
from ... | true |
36f2ed999a043b43b6264b05c987b10f929109b6 | praveenjoshi01/Siamese_SentenceSimilarity | /model.py | UTF-8 | 13,416 | 2.703125 | 3 | [] | no_license | ######################################################Input Handler###################################
from keras.preprocessing.sequence import pad_sequences
from keras.preprocessing.text import Tokenizer
from gensim.models import Word2Vec
import numpy as np
import pickle
import gc
def train_word2vec(documents, embed... | true |
5b941f0f422e6c0ee8e38c6706cf062aa673e5b1 | jaeheeLee17/BOJ_Algorithms | /Level2_Arithmetic_Operation/2839.py | UTF-8 | 510 | 3.328125 | 3 | [
"MIT"
] | permissive | def min_BagNum(Weight):
m = 0
possible_answers = []
while (Weight - 5 * m) >= 0:
n = (Weight - 5 * m) / 3
if n != int(n):
pass
else:
n = int(n)
M = n + m
possible_answers.append(M)
m += 1
if len(possible_answers) == 0:
... | true |
55c4e8f32bac1702befa5e8fbabced93f1d6245c | KhazanahAmericasInc/BoxScraper | /box_scrape.py | UTF-8 | 4,463 | 2.828125 | 3 | [] | no_license | from configparser import ConfigParser
from webbot import Browser
from boxsdk import OAuth2
from boxsdk import Client
from PIL import Image
import os
# Creates and returns the path a folder in /project/downloads/<name>
def create_local_folder(name):
# Get path to foldername
cwd = os.getcwd()
path_downloads... | true |
184c643a4a3ec8457f824a94adb077f6edff4e49 | baoyonghua/web_test_frame | /Testcase/test_bee.py | UTF-8 | 4,296 | 2.640625 | 3 | [] | no_license | """
Description: 加入蜂群/公社的测试用例
Version: 2.0
Autor: byh
Date: 2020-11-28 16:03:15
LastEditors: byh
LastEditTime: 2020-12-11 17:14:00
"""
# import os,sys
# base_path=os.path.dirname(os.path.dirname(__file__))
# sys.path.append(base_path)
import time
# import unittest
import pytest
from selenium import webdriver
from Pag... | true |
462f787e2fc816229682519b8c3d2722ebaefa60 | ke0m/scaas | /oway/modelworker.py | UTF-8 | 979 | 2.6875 | 3 | [] | no_license | """
Worker for modeling with one-way wave equation
@author: Joseph Jennings
@version: 2020.08.18
"""
import zmq
from comm.sendrecv import notify_server, send_zipped_pickle, recv_zipped_pickle
from oway.coordgeomchunk import coordgeomchunk
# Connect to socket
context = zmq.Context()
socket = context.socket(zmq.REQ)
so... | true |
139e5eb8f37aa3df3cae79ba17b28641b9bf0ac3 | Faizanf33/ITC-Assignments | /Python Codes/prem.py | UTF-8 | 10,119 | 3.28125 | 3 | [] | no_license | from __future__ import print_function, unicode_literals
import logging
from logging import basicConfig as bC
## Setting up logging
bC(format="%(levelname)s:%(message)s", level=logging.DEBUG)
## For python version 2 and 3
try:
input = raw_input
except:
pass
## verify the string for correct use of characters
def ver... | true |
692efbb0eede10c13aa28a4ca288b8967efd3d08 | bobyuwono/Digital-Image-Processing-Course-Assignment | /UTS3.py | UTF-8 | 1,227 | 2.640625 | 3 | [] | no_license | import cv2
import numpy as np
from matplotlib import pyplot as plt
img = cv2.imread('flowers.tif',0)
img2 = img.copy()
template = cv2.imread('templates.tif',0)
w, h = template.shape[::-1]
# All the 6 methods for comparison in a list
methods = ['CCOEFF', 'CCOEFF_NORMED', 'CCORR',
'CCORR_NORMED', 'SQDIFF', ... | true |
23a7e0eb80a579f2e6257551a125fc25d1213276 | fanqi0312/MachineLearning | /PythonBase/PythonPandas_titanic.py | UTF-8 | 4,937 | 3.71875 | 4 | [] | no_license | """
泰坦尼克数据集
"""
import pandas as pd
import numpy as np
titanic_survival = pd.read_csv("data/titanic_train.csv")
titanic_survival.head()
#The Pandas library uses NaN, which stands for "not a number", to indicate a missing value.
#we can use the pandas.isnull() function which takes a pandas series and returns a seri... | true |
7587caf47965440ab24560e8967297dfa77a084e | fejxc/python | /Test001/test007.py | UTF-8 | 109 | 2.53125 | 3 | [] | no_license | dict={'rope': 1, 'torch': 6, 'gold coin': 42, 'dagger': 1, 'arrow': 12}
for i in dict:
print(dict[i],i)
| true |
2f0dda75b30f52d2e3cf0986c281cb1f5e516e98 | Conorrific/DC-python-3 | /conditions.py | UTF-8 | 440 | 3.609375 | 4 | [] | no_license | age = int(input("Enter age"))
is_clean_record = True
if 2 < 21:
print("Can't apply for license!")
elif age > 100 or is_clean_record == True:
print("Too old to drive!")
elif age > 18 age is_clean_record == True:
print("Sure you can apply!")
else:
print("do something!")
#and means both have to be true... | true |
64815e1414759c088db3deac46bb33db3096c812 | ziadosama/KNN | /NearestNeighbor.py | UTF-8 | 833 | 2.90625 | 3 | [] | no_license | # -*- coding: utf-8 -*-
import numpy as np
from scipy.spatial import distance
class NearestNeighbor(object):
# http://cs231n.github.io/classification/
def __init__(self):
pass
def train(self, xin, yin):
# the nearest neighbor classifier simply remembers all the training
# data
... | true |
ae6c67cffaf2d8ad3a1ebe0d739032d413c601bb | skortchmark9/100-percent | /graph-algorithm.py | UTF-8 | 4,375 | 2.578125 | 3 | [] | no_license | import networkx as nx
from networkx.readwrite import json_graph
from operator import itemgetter
import matplotlib.pyplot as plt
import random,ujson
import papi
# for timing
# "from profilehooks import profile"
# decorate a function with "@profile"
# given: a graph G and a node v,
# return: the graph G, but with the... | true |
2852eb10a53be4f2327ba5b8e6c66bc010aba4a3 | Seeker875/NLP-Toxic-Comments-Classification | /toxicLogR.py | UTF-8 | 1,303 | 2.953125 | 3 | [] | no_license | #!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
Created on Wed Dec 20 09:20:21 2017
@author: Taranpreet singh
"""
from sklearn.feature_extraction.text import CountVectorizer
from sklearn.linear_model import LogisticRegression
from sklearn.multiclass import OneVsRestClassifier
from sklearn.pipeline import Pipel... | true |
c7c866292281ef06a5009564a0708aa4e8d770cb | ryosukeeeee/attendance-notifier | /slashCommandEndpoint/slashCommandEndpoint.py | UTF-8 | 1,637 | 2.625 | 3 | [] | no_license | import urllib.parse
import os
import json
import boto3
def handler(event, context):
# リクエストが正当か確認する
verification_token = os.environ['VERIFICATION_TOKEN']
body = map_to_dict(event["body"])
print(event)
print(body.keys())
if body.get("token", "") != verification_token:
print("token is i... | true |
3d6eed5f598485e063cbceadbd5d0fcc9e5899c1 | bpucker/yam | /map_annotation_via_orthologs_gh.py | UTF-8 | 2,151 | 2.671875 | 3 | [] | no_license | ### Boas Pucker ###
### v0.3 ###
### bpucker@cebitec.uni-bielefeld.de ###
#updated with Araport11 annotation (March 2017)
__usage__ = """"
python map_annotation_via_orthologs.py\n
--in <INPUT_FILE>
--out <OUTPUT_FILE>
bug reports and feature requests: bpucker@cebitec.uni-bielefeld.de
"""
import re... | true |
9602b2de11815fda668ff7c23e403affff11b623 | jimmyue/DataVerification | /forecastwhole/Data_Verification.py | UTF-8 | 2,536 | 2.546875 | 3 | [] | no_license | #!/usr/bin/python3
# -*- coding:utf-8 -*-
'''
Created on 2020年7月1日
@author: yuejing
'''
import pandas as pd
from Common import DatabaseHandle
from Common import eml
from common import wechat
import time
import os
def ExcelData(path='//192.168.2.16/share2/临时全公开/jimmy/SGM预测/'+time.strftime("%Y%m",time.localtime())):
''... | true |
c67d2e965999854a8910dec967c20aa13e759a52 | sumaiya-antara/Getting-familiar-with-Python | /type-convert.py | UTF-8 | 62 | 3.28125 | 3 | [] | no_license | #Type-Conversion
a = str(100)
b = int(a)
c = type(c)
print(c) | true |
6aa1a4d242f4497e2ac86c5e29d49cc85eebca89 | stermaneran/newtons-room | /colors.py | UTF-8 | 1,707 | 3.390625 | 3 | [] | no_license | # // The colors to blend
# source = {'r': 255, 'g': 213, 'b': 0, 'a': 0.6}
# backdrop = {'r': 141, 'g': 214, 'b': 214, 'a': 0.6}
def colorme(colors):
# // This example shows the result of blending 'source' and 'backdrop' with the 'hue' blending mode, according to the W3C or Adobe spec
# // However the composite could ... | true |
4a79c592e030bf71bd780d53bb45733bb33ca2e9 | DavidGrunheidt/Graphic-System | /objectManager.py | UTF-8 | 4,948 | 2.953125 | 3 | [] | no_license | from object import Object
from functools import reduce
from matrices import identity_matrix, identity_matrix_2d, translate_matrix, rotate_x_matrix, rotate_y_matrix, rotate_z_matrix, scale_matrix
import normalizer
import clipper
import numpy as np
# 2D Window and Viewport starts with 0 as all coordinates default value... | true |
a070f5267c0e36287032ee125c007c37b86cc669 | ggjjl1/leetcode | /src/main/python/single-number.py | UTF-8 | 461 | 3.296875 | 3 | [] | no_license | #!/usr/bin/env python
#-*- coding: utf-8 -*-
class Solution(object):
def singleNumber(self, nums):
"""
:type nums: List[int]
:rtype: int
"""
result = 0
for i in range(0, len(nums)):
result = result ^ nums[i]
return result
def main():
nums = [... | true |
b41447f905612c47ac58e7c9f9c437572574cd96 | muskanmahajan37/Chatbot | /avaliação/modelKnn.py | UTF-8 | 2,572 | 3.03125 | 3 | [] | no_license | ###
# Celso Antonio Uliana Junior - Nov 2019
###
# Este trabalho consiste em um chatbot para uma hamburgueria.
# Importação de dependencias.
import csv
import pandas
import numpy as np
import param_grid as params
from sklearn.metrics import recall_score
from sklearn.metrics import accuracy_score
from sklearn.m... | true |
42979a7b0039317e66c4bcc9e392ebbf05b840f6 | Bogdanp/django_dramatiq_example | /dashboard/models.py | UTF-8 | 840 | 2.53125 | 3 | [
"LicenseRef-scancode-unknown-license-reference",
"Apache-2.0"
] | permissive | import time
from django.db import models
class Job(models.Model):
TYPE_SLOW = "slow"
TYPE_FAST = "fast"
TYPES = (
(TYPE_SLOW, "Slow job"),
(TYPE_FAST, "Fast job"),
)
STATUS_PENDING = "pending"
STATUS_DONE = "done"
STATUSES = (
(STATUS_PENDING, "Pending"),
... | true |
06ac1107e72b4c28949e06f73e0a585ce6acbf0a | PushkarGoel/Stock-market-Prediction | /stock_predictor.py | UTF-8 | 3,057 | 2.703125 | 3 | [] | no_license |
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
df=pd.read_csv("infosys2.csv")
req=df.iloc[:,4:7]
req2=df.iloc[:,8:10]
fin=pd.concat([req,req2],axis=1)
training_set=fin.iloc[:,:4].values
train_res=fin.iloc[:,4].values
from sklearn.preprocessing import MinMaxScaler
sc1=MinMaxScaler(feature_... | true |
7c63870069ff263b09342b54d7a358ea54285d7c | nazzang49/py_practice02 | /problem06.py | UTF-8 | 485 | 3.484375 | 3 | [] | no_license | # 1부터 100까지의 랜덤 숫자 생성
import random
min,max = 1, 100
print(min,'-',max)
while True:
answer = random.randrange(max)+min
i = 1
while True:
num = int(input(str(i)+' >> '))
if answer == num:
print('맞았습니다.')
break
elif answer > num:
print('더 높게')
... | true |
be35efa2f5bbd4cc37c942e70d609e71c6a5f7a8 | Nhlamulo/gpkit | /gpkit/solution_array.py | UTF-8 | 14,332 | 2.984375 | 3 | [
"MIT"
] | permissive | """Defines SolutionArray class"""
from collections import Iterable
import numpy as np
from .nomials import NomialArray
from .small_classes import DictOfLists
from .small_scripts import mag, isnan
from .repr_conventions import unitstr
def senss_table(data, showvars=(), title="Sensitivities", **kwargs):
"Returns se... | true |
d00f3e4aee9554d05f6c38aa236f331f177c42d2 | markjluo/MITOCW6.00.1x | /Week 2/W2_Lecture_Check if Palindome.py | UTF-8 | 479 | 4.21875 | 4 | [] | no_license | def isPalin(s):
"""Take a string as input,
check if the string s is a palindrome"""
def toChars(s):
s = s.lower()
ans = ''
for letter in s:
if letter in 'abcdefghijklmnopqrstuvwxyz':
ans += letter
return ans
def isPal(s):
if len(s... | true |
4bc1d748744616db4af639a11fbbdcdadb5e47f7 | tsergien/Python-Django-piscine | /d01/ex03/capital_city.py | UTF-8 | 641 | 3.53125 | 4 | [] | no_license | #!/usr/bin/env python3
import sys
def get_capital(state: str):
states = {
"Oregon" : "OR",
"Alabama" : "AL",
"New Jersey": "NJ",
"Colorado" : "CO"
}
capital_cities = {
"OR": "Salem",
"AL": "Montgomery",
"NJ": "Trenton",
"CO": "Denver"
... | true |
23c2a7d3457f775b594432f3c2852a33be34229a | olucas98/neuro_final | /fix_labels.py | UTF-8 | 638 | 2.53125 | 3 | [] | no_license | import numpy as np
import os
import argparse
parser = argparse.ArgumentParser()
parser.add_argument('--in_dir')
parser.add_argument('--out_dir')
args = parser.parse_args()
labelfiles = os.listdir(args.in_dir)
os.makedirs(args.out_dir, exist_ok=True)
for lf in labelfiles:
with open(os.path.join(args.in_dir, lf), 'r'... | true |
80e429365deae238579928d5abde737848821f74 | Quantum99/IEEEXTREME-9.0 | /girls.py | UTF-8 | 91 | 3.09375 | 3 | [] | no_license | arr = ["Abcde_-!@#","0#T234<>?,"]
print len(arr)
for x in xrange(0,len(arr)):
print arr[x] | true |
e4d1d62ac28602a89a698a7a67c97dac9fb4654b | brixmabz/web_app_mabala | /app_main.py | UTF-8 | 9,300 | 2.8125 | 3 | [] | no_license | from flask import Flask, render_template, request
import sqlite3 as sql
app = Flask(__name__)
class Student(object):
def __init__(self, idnum, Fname, Mname, Lname, Sex, Course, Year):
self.idno = idnum
self.fname = Fname
self.mname = Mname
self.lname = Lname
self.sex = Sex... | true |
484083254cb581d3ea0ebbda30f554abeb06580c | sara-nl/data-exchange | /tasker/tasker/figurer/test/resources/kitpes/train.py | UTF-8 | 3,331 | 2.59375 | 3 | [
"Apache-2.0"
] | permissive | #!/usr/bin/env python3
from __future__ import absolute_import, division, print_function, unicode_literals
import tensorflow as tf
from tensorflow.keras.models import Sequential
from tensorflow.keras.layers import Dense, Conv2D, Flatten, Dropout, MaxPooling2D
from tensorflow.keras.preprocessing.image import ImageData... | true |
83375545aaa23b4875ce195bc07fafe69585c639 | abel-bernabeu/autoencoder | /pyramidal/blocks/densenet/up_conv_transpose_ext.py | UTF-8 | 1,046 | 2.71875 | 3 | [] | no_license | import torch.nn as nn
from pyramidal.blocks.densenet.up_factory import AbstractUpFactory
class UpConvTransposeExt(nn.Module):
"""Upsampler module with transposed convolution plus batch normalization, relu and dropout"""
def __init__(self, channels, n):
super().__init__()
self.netwo... | true |
e6335c2a1c2dab3512482d4d0f9bcf026a329849 | pmaksimilian/python_exercises | /guess_the_number_with_time.py | UTF-8 | 1,386 | 3.171875 | 3 | [] | no_license | import random
import json
import datetime
import time
score_file_name = "score.txt"
player_name =input("Vnesite vase ime: ")
try:
with open(score_file_name, "r") as score_file:
score_list = json.loads(score_file.read())
score_list = sorted(score_list, key=lambda k: k["score"])
print(f"Na... | true |
32992bafb13de1320b4fdd64c92555681df28156 | pankajtripathi/Information-Retrieval-CS6200 | /HW-8/src/dataset_cleaner.py | UTF-8 | 2,011 | 3 | 3 | [] | no_license | __author__ = 'Pankaj Tripathi'
"""
dataset_cleaner.py
----------
Environment - Python 2.7.11
Description - Script to clean the documents in AP89 dataset by extracting only the document numbers, headers and text.
"""
import re
import os
if __name__ == '__main__':
for dirpath, dirnames, filenames in o... | true |
76ff922269e55728297fcebb529ee5ee76169cbc | KateyMG/Algebra_Lineal | /Lab02/Lab02AL.py | UTF-8 | 3,094 | 3.4375 | 3 | [] | no_license | import numpy as np;
import sympy as sp;
print("----LABORATORIO # 2----")
a = np.random.randint(10, size=(10, 10)) #Matriz de 10x10 con random
b = np.random.randint(10, size=(10, 10))
A = np.array([[0, 1, 2, 3, 4, 5, 6, 7, 8, 9], #Matriz de 10x10 manualmente
[3, 4, 1, 0, 2, 9, 3, 8, 7, 5],
... | true |
3fa4df00c911a878865e7709e86f475d0bbe4885 | tyoungman/ColorOf-Python-Client | /colorof-auth-client.py | UTF-8 | 3,202 | 2.765625 | 3 | [
"Apache-2.0"
] | permissive | import requests
API_KEY="<get api key from colorof>"
API_SECRET="<get api key from colorof>"
API_SERVER="http://api.colorof.com"
#Obtain an token from the server to make authenticated requests
def getAuthToken():
#Define Authentication request parameters and authentication token endpoint
AUTH_PARAMS= {
'api_... | true |
c03b53c313c8363a5be001b0a6bb7ba3e150f148 | zfhrp6/competitive-programming | /atcoder/code_festival_qualB_d.py | UTF-8 | 1,038 | 2.8125 | 3 | [] | no_license | # coding: utf-8
n = int(input())
h_list = []
seeable = []
for i in range(n):
h_list.append(int(input()))
seeable.append(0)
h_list = tuple(h_list)
for idx,peek in enumerate(h_list):
if idx == 0:
for i in range(1,n):
if h_list[i] > peek:
break
s... | true |
a822e882981441fef13023a660dcb3832ca36385 | euribates/advent_of_code_2019 | /day02/test_incode.py | UTF-8 | 875 | 3.15625 | 3 | [
"MIT"
] | permissive | #!/usr/bin/env python
import pytest
from intcode import IntCode
def test_example1():
"""Example 1: 1,0,0,0,99 becomes 2,0,0,0,99 (1 + 1 = 2)
"""
int_code = IntCode()
int_code.set_memory("1,0,0,0,99")
assert int_code.dump() == "1,0,0,0,99"
int_code.run()
assert int_code.dump() == "2,0,0,0... | true |
66addaa0a65dd96985832d1c2774cf51f9a193d3 | AdamZhouSE/pythonHomework | /Code/CodeRecords/2342/60762/257257.py | UTF-8 | 396 | 3 | 3 | [] | no_license | #!/usr/bin/python
# -*- coding: UTF-8 -*-
t=int(input())
for i in range (0,t):
k=int(input().split(" ")[1])
l=[int(x) for x in input().split(" ")]
re=""
for j in range (0,len(l),k):
if(len(l)-j>k):
ll=l[j:j+k]
else:
ll=l[j:]
ll.sort()
for m in rang... | true |
7eee25db6c53ec48c30e29bc503dbbd54a067f66 | MrDent0n/LearningPython | /Simple tests/Functions/functional.py | UTF-8 | 855 | 3.421875 | 3 | [] | no_license |
def main():
while True:
result = request_answer(
"Do you want to continue) [Y/N]:", #question
"I am sorry u did not understand your answer, please use only y or n"
#default = False #default
# end = n
#proceed = y
)
if result:
... | true |
92c6dc1d9b4a937ed4ba3f6751e6ac7fd8b56fe0 | moralesdei/test-met | /Matrix/handle_matrix.py | UTF-8 | 1,836 | 3.328125 | 3 | [] | no_license | #!usr/bin/env python
# encoding utf-8
# Prueba para la empresa MET GROUP 2020
# Punto No 1
# Deimer Andres Morales Herrera
class MyMatrix():
def __init__(self, matrix):
self.__matrix = matrix
self.__countDimension = 0
self.__sumMatrix = 0
self.__flagStraight = True
def dimension... | true |
a62ead2c63efbcf2b6ec740db702524ca2da0a90 | max-elliott/StarGAN-Emotional-VC | /postnet.py | UTF-8 | 3,740 | 2.578125 | 3 | [] | no_license | import torch
import torch.nn as nn
import torch.nn.functional as F
import numpy as np
import copy
import audio_utils
class UpConvBlock1D(nn.Module):
def __init__(self, in_channel, out_channel, kernel_length, stride = 1, padding = 1):
super(UpConvBlock1D, self).__init__()
self.conv1 = nn. ConvTran... | true |
381b32b88471664c84736bbd69f54028ed49f70d | summyer/common-source | /python/Mypractice/class_6_super.py | UTF-8 | 1,653 | 3.484375 | 3 | [
"MIT"
] | permissive | class A:
def __init__(self):
self.n = 2
def add(self, m):
# 第四步
# 来自 D.add 中的 super
# self == d, self.n == d.n == 5
print('self is {0} @A.add'.format(self))
self.n += m
# d.n == 7
class B(A):
def __init__(self):
self.n = 3
def add(self,... | true |
49d3b9aa1ad821904a2e1bb0f3481547063f4487 | Kawser-nerd/CLCDSA | /Source Codes/AtCoder/agc029/D/3912528.py | UTF-8 | 315 | 3.109375 | 3 | [] | no_license | X,Y,N = list(map(int,input().split()))
l = []
for i in range(N):
x,y = list(map(int,input().split()))
l.append([x,y])
l.sort()
cnt = 0
ans = 0
for i in l:
if i[0] > i[1]+cnt:
ans = i[0]
break
elif i[0] == i[1]+cnt:
cnt += 1
if ans != 0:
print(ans-1)
else:
print(X) | true |
082846a5b448865155044029fc1ccab9bad9dba0 | mboscovich/Kerberus-Control-Parental | /cliente/tags/releases/es/rel-1.0.0/clases/servidores.py | UTF-8 | 3,262 | 2.765625 | 3 | [] | no_license | # -*- coding: utf-8 *-*
"""Modulo encargado de obtener la lista de servidores activos"""
#Modulos externos
import socket, sys, urllib2,time
#Modulos propios
sys.path.append('../conf')
import config
import logging
modulo_logger = logging.getLogger('kerberus.'+__name__)
#Excepciones
class ServidorError(Exception): ... | true |
89c73795c06d0fe84cef4c918a3111816d47f9d9 | xiaohaiz1/PythonStudy | /Python编程思想/6.IO流/文件的读写/list-tuple-dict-set.py | UTF-8 | 319 | 3.21875 | 3 | [] | no_license |
''''''
'''
对于list-tuple-dict-set的读取
'''
import pickle #数据持久性模块
mylist = [1, 2, 3, 4, 5, "lxr is a good man!"]
path = "a.txt"
f = open(path, "wb")
#写入列表
pickle.dump(mylist, f)
f.close()
#读取
templist = []
f1 = open(path, "rb")
templist = pickle.load(f1)
print(templist)
f1.close() | true |
60a81320e5d74c5280f531706b3e1d12e8eb65c1 | albertomontesg/data-mining-project | /task3/mapreduce.py | UTF-8 | 5,532 | 3.046875 | 3 | [] | no_license | import logging
import numpy as np
logger = logging.getLogger(__name__)
DEBUG = 2
N_CLUSTERS = 200
N_INIT = 20
N_CORESETS = 500
NOTES = """
For sampling the Coresets centers, used the D^2 sampling criteria.
The initialization of the kmeans algorithm is using uniformly sampling.
The best results have been obtained inc... | true |