content stringlengths 7 1.05M |
|---|
test_cases = int(input().strip())
def recursion(n, value):
global result
if value >= result:
return
if n == N:
result = min(result, value)
return
for i in range(N):
if not visited[i]:
visited[i] = True
recursion(n + 1, value + mat[n][i])
... |
# Creating parameters for STFT test
"""
It is equivalent to
[(1024, 128, 'ones'),
(1024, 128, 'hann'),
(1024, 128, 'hamming'),
(2048, 128, 'ones'),
(2048, 512, 'ones'),
(2048, 128, 'hann'),
(2048, 512, 'hann'),
(2048, 128, 'hamming'),
(2048, 512, 'hamming'),
(None, None, None)]
"""
stft_parameters = []
n_fft... |
class LRUCache:
def __init__(self, capacity: int):
self.capacity = capacity
self.items = []
self.indexes = dict()
def get(self, key: int) -> int:
if self.indexes.get(key) is None:
return -1
index = self.indexes[key]
value = self.items[index]... |
# coding=utf-8
# autogenerated using ms_props_generator.py
DATA_TYPE_MAP = {
"0x0000": "PtypUnspecified",
"0x0001": "PtypNull",
"0x0002": "PtypInteger16",
"0x0003": "PtypInteger32",
"0x0004": "PtypFloating32",
"0x0005": "PtypFloating64",
"0x0006": "PtypCurrency",
"0x0007": "PtypFloating... |
print(' a string that you "dont" have to escape \n This \n is a multi-line \n heredoc string -------> example')
|
def GetXSection(fileName): #[pb]
if fileName.find("ST_t-channel_antitop_4f_InclusiveDecays_mtop1695_TuneCP5_PSweights_13TeV-powheg-madspin-pythia8") !=-1 : return 70.89
elif fileName.find("ST_t-channel_antitop_4f_InclusiveDecays_mtop1715_TuneCP5_PSweights_13TeV-powheg-madspin-pythia8") !=-1 : return 69.66
elif fil... |
#
# PySNMP MIB module HH3C-LswMAM-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/HH3C-LswMAM-MIB
# Produced by pysmi-0.3.4 at Mon Apr 29 19:15:14 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 (default, Mar 27... |
"""Author: Gina Chatzimarkaki"""
#test-calculator-substract.py
def handle(str):
"""
Substract two numbers and return the result. If there are more
just take the first two
Parameters
----------
str : String
the provided input
Returns
... |
class MemeDataGenerator(tf.keras.utils.Sequence):
"""
An iterable that returns [batch_size, (images embeddigns, [unrolled input text sequences, text target])].
Instead of batching over images, we choose to batch over [image, description] pairs because unlike typical
image captioning tasks that has 3-5 t... |
#
# elkme - the command-line sms utility
# see main.py for the main entry-point
#
__version__ = '0.6.0'
__release_date__ = '2017-07-17'
|
#
# add leapfrog's template loader
#
TEMPLATE_LOADERS = (
'leapfrog.loaders.Loader',
# then the default template loaders
# ...
)
#
# enable the leapfrog app
#
INSTALLED_APPS = (
# ...
# all your other apps, plus south and the sentry apps:
'south',
'indexer',
'paging',
'sentry',
... |
class BinaryOption:
def __init__(self):
self.__data = None
def SetData(self, bit):
self.__data = bit
def Has(self, value):
return (self.__data & value)
def Set(self, value):
self.__data = self.__data | value
@staticmethod
def Create(value):
... |
#!/usr/bin/env python3
n, p, *a = map(int, open(0).read().split())
c = 0
for a, b in zip(a, a[n:]):
c += min(p+a, b)
p = a - max(min(b-p, a), 0)
print(c) |
#function to generate dicitonary of terms
def stockDictGen():
stockDict = []
stockDict.append({"word": "stock", "definition": "the capital raised by a business or corporation through the issuing of shares"})
stockDict.append({"word":"share", "definition": "the piece of paper that signifies ownership of th... |
r1 = float(input('Digite o valor da primeira reta: '))
r2 = float(input('Digite o valor da segunda reta: '))
r3 = float(input('Digite o valor da terceira reta: '))
if r1 < r2 + r3 and r2 < r1 + r3 and r3 < r1 + r2:
print('Os segmentos acima podem formar um triângulo.')
if r1 == r2 == r3:
print('Equilát... |
var2 = {
# Video Only files
'.webm' : ('WebM', 'Free and libre format created for HTML5 video.'),
'.mkv' : ('Matroska', ''),
'.flv' : ('Flash Video', 'Use of the H.264 and AAC compression formats in the FLV file format has some limitations and authors of Flash Player strongly encourage everyone to embrace the new stan... |
# -*- coding: utf-8 -*-
abstract = """BACKGROUND:
The systematic, complete and correct reconstruction of genome-scale metabolic networks or metabolic pathways is one of
the most challenging tasks in systems biology research. An essential requirement is the access to the complete
biochemical knowledge - especially on... |
def example_1():
###### 0123456789012345678901234567890123456789012345678901234567890
record = ' 100 513.25 '
cost = int(record[20:32]) * float(record[40:48])
print(cost)
SHARES = slice(20, 32)
PRICE = slice(40, 48)
cost = int(record[SHARE... |
#Aprimore o desafio 93 para que ele funcione com vários jogadores, incluindo um sistema de visualização de detalhes de aproveitamento de cada jogador.
lista = dict()
campeonato = []
total = 0
while True:
lista['nome'] = str(input('Nome: '))
lista['partidas'] = int(input(f'Quantas partidas {lista["nome"]} jogou... |
name = 'Escape'
movies = [
{'title': 'My Neighbor Totoro', 'year': '1988'},
{'title': 'Dead Poets Society', 'year': '1989'},
{'title': 'A Perfect World', 'year': '1993'},
{'title': 'Leon', 'year': '1994'},
{'title': 'Mahjong', 'year': '1996'},
{'title': 'Swallowtail Butterfly', 'year': '1996'},... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Copyright 2020- IBM Inc. All rights reserved
# SPDX-License-Identifier: Apache2.0
#
"""
"""
class Array:
array_length = 0
array_element_size = 0
base_element = None
def __init__(self, array_length, base_element, array_element_size):
self.ba... |
def calculated_quadratic_equation(a = 0, b = 0, c = 0):
r = a ** 2 + b + c
return r
print(calculated_quadratic_equation())
|
# %%
__depends__ = []
__dest__ = ['../../data/']
# %% |
def extractIsogashiineetoWordpressCom(item):
'''
Parser for 'isogashiineeto.wordpress.com'
'''
vol, chp, frag, postfix = extractVolChapterFragmentPostfix(item['title'])
if not (chp or vol) or "preview" in item['title'].lower():
return None
tagmap = [
('NEET Hello Work', 'NEET dakedo Hello Work ni Itta... |
with open('students_log.txt', 'r', encoding='utf-8') as f:
for row in f.read().splitlines():
last_name, first_name, patronymic, row_marks = row.split(maxsplit=3)
patronymic = patronymic.strip(',')
# marks = list(map(int, map(str.strip, row_marks.split(','))))
# ' 5' -> map str.strip(... |
class WorkCli:
def __init__(self, workbranch):
self.workbranch = workbranch
def add_subparser(self, subparsers):
work_parser = subparsers.add_parser('work', help="Keep track of a currently important branch")
work_parser.add_argument("current", nargs="?", type=str, default=None, help="... |
class Scope:
def __init__ (self, parent=None):
self.parent = parent
self.elements = dict()
def get_element (self, name, type, current=False):
r = self.elements.get(type, None)
if r != None:
r = r.get(name, None)
if r == None and self.parent ... |
# Fibonacci: Sum of the last two numbers gives the next one.
# Series: 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, 610 .....
# Works only with positive integers
# Step1: Recursive Case
# fibonacci(n) = fibonacci(n-1) + fibonacci(n-2)
# Step2: Base Case
# fibonacci(0) = 0
# fibonacci(1) = 1
# S... |
class Player:
def __init__(self, name):
"""Initializes the player's name. The default score is 0"""
self._name = name
self._score = 0
def get_name(self):
"""Return player's name"""
return self._name
def get_score(self):
"""Return player's score"""
r... |
'''
URL: https://leetcode.com/problems/count-the-number-of-consistent-strings/
Difficulty: Easy
Description: Count the Number of Consistent Strings
You are given a string allowed consisting of distinct characters and an array of strings words. A string is consistent if all characters in the string appear in the stri... |
board_width, board_length = list(map(int, input().split()))
domino_length = 2
if board_width % 2 == 0:
print((board_width // domino_length) * board_length)
elif board_length % 2 == 0:
print((board_length // domino_length) * board_width)
else:
print((board_width * board_length) // domino_length)
|
class VehiclesDataset:
def __init__(self):
self.num_vehicle = 0
self.num_object = 0
self.num_object_with_kp = 0
self.vehicles = dict()
self.valid_ids = set()
self.mean_shape = None
self.pca_comp = None
self.camera_mtx = None
self.image_names = ... |
class UrineProcessorAssembly:
name = "Urine Processor Assembly"
params = [
{
"key": "max_urine_consumed_per_hour",
"label": "",
"units": "kg/hr",
"private": False,
"value": 0.375,
"confidence": 0,
"notes": "9 kg/day / 24... |
n=6
while n >0:
n-=1
if n % 2 ==0:
print(n, end ="")
if n % 3 == 0:
print(n, end='') |
#https://www.wwpdb.org/documentation/file-format-content/format23/v2.3.html
def line_is_ATOM_record(line):
return line.startswith('ATOM ')
def line_is_HETATM_record(line):
return line.startswith('HETATM')
def get_fields_from_ATOM_record(record):
fields={}
fields['ATOM '] = record[0:6]
fields... |
class CircularBufferError(Exception):
pass
class CircularBuffer(object):
"""Unlike traditional circular buffers, this allows reading and writing
multiple values at a time. Additionally, this object provides peeking and
commiting reads. See test_circular_buffer.py for examples.
The interface is ... |
class Calculator:
def __init__(self):
self.calculation = 0
self.operation = None
def plus(self, num):
self.calculation += num
def minus(self, num):
self.calculation -= num
def multiply(self, num):
self.calculation *= num
def divide(self, num):
... |
# Apache License Version 2.0
#
# Copyright (c) 2021., Redis Labs Modules
# All rights reserved.
#
def create_extract_arguments(parser):
parser.add_argument(
"--redis-url",
type=str,
default="redis://localhost:6379",
help="The url for Redis connection",
)
parser.add_argum... |
####################################################################
#
# Copyright (c) 2001-2019, Arm Limited and Contributors. All rights reserved.
#
# SPDX-License-Identifier: BSD-3-Clause
#
# Filename - globaldefinesrsaformat.py
# Description - This file contains global defines used in the RSA
# F... |
"""
Entradas
salario --> int --> s
categoria --> int --> c
Salidas
aumento --> int --> a
salario nuevo --> int --> sn
"""
s = int (input ( "Digotar el salario:" ))
c = int (input ( " Digitar categoria del 1 al 5: "))
if ( c == 1 ):
a = s * .10
if ( c == 2 ):
a = s * .15
if ( c == 3 ):
a == s * .20
... |
class Trie(object):
def __init__(self):
self.child = {}
def insert(self, word):
word = word.strip()
current = self.child
for l in word:
if l not in current:
current[l] = {}
current = current[l]
current['#']=1
def search(self, word):
word = wo... |
def SB_BinaryStats(y,binaryMethod = 'diff'):
yBin = BF_Binarize(y,binaryMethod)
N = len(yBin)
outDict = {}
outDict['pupstat2'] = np.sum((yBin[math.floor(N /2):] == 1)) / np.sum((yBin[:math.floor(N /2)] == 1))
stretch1 = []
stretch0 = []
count = 1
for i in range(1,N):
if... |
"""Basic memory stream with random sampling."""
class MemoryStream(object):
def __init__(self, size):
self.memory = deque([])
def add(self, item):
self.memory.append(item)
if len(self.memory) > size:
memory.popleft()
def sample(self, shape):
return np.random.s... |
"""
Custom exceptions for Clinical Research Study Manager package
"""
class MyException(ValueError):
def __init__(self, msg):
super().__init__(msg)
class HeaderException(MyException):
def __init__(self, msg):
super().__init__(msg)
class InputException(MyException):
"""
Exceptions fo... |
"""
Copyright (C) 2018 SunSpec Alliance
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merg... |
#
# PySNMP MIB module LINKSYS-WLAN-ACCESS-POINT-REF-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/LINKSYS-WLAN-ACCESS-POINT-REF-MIB
# Produced by pysmi-0.3.4 at Wed May 1 14:07:23 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using P... |
print("The variable Pp/Ptot, i.e. the fraction of paused polymerases, seems to provide the best contrast between its minimal and maximal values as K_3 varies, regardless of the values of K_1 and K_2. In this example, it is not very surprising. Sometimes it is more difficult to find which model output is the most sensit... |
# -*- coding: utf-8 -*-
"""
Tencent is pleased to support the open source community by making BK-LOG 蓝鲸日志平台 available.
Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
BK-LOG 蓝鲸日志平台 is licensed under the MIT License.
License for BK-LOG 蓝鲸日志平台:
------------------------------------------------... |
def F():
a,b = 0,1
while True:
yield a
a, b = b, a + b
def SubFib(startNumber, endNumber):
for cur in F():
if cur > endNumber: return
if cur >= startNumber:
yield cur
# for i in SubFib(10, 200):
# print(i)
def fib(x):
if x < 2:
return [i for i... |
#!/usr/bin/python3
Rectangle = __import__('2-rectangle').Rectangle
my_rectangle = Rectangle(2, 4)
print("Area: {} - Perimeter: {}".format(my_rectangle.area(), my_rectangle.perimeter()))
print("--")
my_rectangle.width = 10
my_rectangle.height = 3
print("Area: {} - Perimeter: {}".format(my_rectangle.area(), my_rectang... |
# 순위
#
# https://programmers.co.kr/learn/courses/30/lessons/49191
def solution(n, results):
answer=0
adj=[[0 for _ in range(n+1)] for _ in range(n+1)]
for w,l in results:
adj[w][l]=2
adj[l][w]=1
# for i in range(n+1):
# for j in range(n+1):
# if adj[i][j]==1:
... |
# -*- coding: utf-8 -*-
"""common/tests/__init__.py
By David J. Thomas, thePortus.com, dave.a.base@gmail.com
The init file for the common module tests
"""
|
a = b = c = d = e = f = 12
x, y = 1, 2 # unpacking tuple
print(x)
print(y)
print('unpack tuple - or any sequence type')
data = (1, 2, 3)
a, b, c = data
print(a)
print(b)
print(c)
print('unpack list - or any sequence type')
data_list = [4, 5, 6]
a, b, c = data_list
print(a)
print(b)
print(c)
|
def calcu():
pass
def calc_add(a,b):
return a+b
def calc_minus(a,b):
return a-b
|
HEALTH_STATES = []
class App:
def __init__(self, j):
self.url = 'https://api.newrelic.com/v2/applications.json'
if j:
self.id = j.get('id')
self.name = j.get('name')
self.health_status = j.get('health_status')
links = j.get('links')
self.... |
def has_cycle(head):
slowref=head
if not slowref or not slowref.next:
return False
fastref=head.next.next
while slowref != fastref:
slowref=slowref.next
if not slowref or not slowref.next:
return False
fastref=fastref.next.next
return True |
__title__ = 'electric'
__description__ = "A package manager for Windows, MacOS And Linux!"
__url__ = 'https://github.com/TheBossProSniper/Electric'
__version__ = '0.0.1'
__author__ = 'Electric Inc.'
__credits__ = ""
__license__ = """Apache License 2.0
A permissive license whose main conditions require preservation
of... |
def main():
# input
S = list(input())
# compute
N = len(S)
cnt = 0
while ''.join(S).count('BW') != 0:
for i in range(N-1):
if S[i]=='B' and S[i+1]=='W':
S[i], S[i+1] = S[i+1], S[i]
cnt += 1
print(cnt, ''.join(S))
# output
... |
""" Exceptions. """
# This is the part of *teryt* library.
# Author: Stim (stijm), 2021
# License: MIT
class Error(Exception):
""" An error. """
class ResourceError(Exception):
""" A resource error. """
class MissingResourcesError(ResourceError):
""" Missing resources error. """
class ErroneousUnit... |
'''
In un file di testo e' riportata una sequenza binaria S. Siamo interessati alla
frequenza delle sottosequenze di S(la frequenza di una sottosequenza di S e'
il numero di volte che la sottosequenza occorre in S).
Si consideri ad esempio il file di testo f1.txt contenente la sequenza
01... |
class Solution:
def reverse(self, x: int) -> int:
# get the sign of x
if x == 0:
return x
sign = abs(x) / x
x = abs(x)
# reverse number
num = 0
# reverse process
while x != 0:
temp = x % 10
num = num * 10 + temp
... |
#* Asked in Uber
#? You are given a string of parenthesis. Return the minimum number of parenthesis that would need to be removed
#? in order to make the string valid. "Valid" means that each open parenthesis has a matching closed parenthesis.
#! Example:
# "()())()"
#? The following input should return 1.
# ")"... |
# AUTOGENERATED! DO NOT EDIT! File to edit: nbs/config.ipynb (unless otherwise specified).
__all__ = ['AppConfig', 'PathConfig', 'TrainConfig']
# Cell
class AppConfig:
SEED = 8080
NUM_CLASSES = 7
class PathConfig:
# DATA_PATH = '/content/data'
# IMAGE_PATH = '/content/data/images'
# ... |
#accessibility numbers for science. Pretty sure fosscord just hardcodes this as 128.
class ACCESSIBILITY_FEATURES:
SCREENREADER = 1 << 0
REDUCED_MOTION = 1 << 1
REDUCED_TRANSPARENCY = 1 << 2
HIGH_CONTRAST = 1 << 3
BOLD_TEXT = 1 << 4
GRAYSCALE = 1 << 5
INVERT_COLORS = 1 << 6
PREFERS_COLOR_SCHEME_LIGHT = 1 << 7
... |
"""
Rename this file to 'secret.py' once all settings are defined
"""
SECRET_KEY = "..."
HOSTNAME = "example.com"
DATABASE_URL = "mysql://<user>:<password>@<host>/<database>"
AWS_ACCESS_KEY_ID = "12345"
AWS_SECRET_ACCESS_KEY = "12345"
|
#!/usr/bin/python
# --------------------------------------- #
# Cara Define Sebuah Function pada Python #
# --------------------------------------- #
# def functionname( parameters ): #
# "function_docstring" #
# function_suite #
# return [expression] #
# --------------------------... |
class Custom(
):
pass |
def primitive_triplets():
pass
def triplets_in_range():
pass
def is_triplet():
pass
|
n, m = map(int, input().split())
for i in range(n):
if i % 2 == 0:
print('#' * m)
else:
if (i + 1) % 4 == 0:
print('#' + '.' * (m - 1))
else:
print('.' * (m - 1) + '#') |
pa = int(input('Digite o primeiro termo da PA: '))
r = int(input('Digite a razao da PA: '))
c = 0
mais = 10
tot = 0
print('Os termos são', end=" ")
while mais != 0:
tot += mais
while c <= tot:
c += 1
print('{}'.format(pa), end=' -> ')
pa = pa + r
print('PAUSA')
mais = int(input('... |
# Binary dependencies needed for running the bash commands
DEPS = ["mvn", "openssl", "awk"]
# helper function to encapsulate bash commands.
def _execute(ctx, command):
return ctx.execute(["bash", "-c", """
set -ex
%s""" % command])
# Assert that all relevant binaries are on class path
#TODO(petros): how should I de... |
produto = {}
produto["2295"] = [5.99, "Banana Nanica"]
produto["2219"] = [7.99, "Banana prata"]
produto["2172"] = [9.99, "Maçã Fuji"]
produto["2547"] = [8.99, "Maçã Gala"]
produto["2127"] = [12.99, "Mamão Papaya"]
produto["2134"] = [10.99, "Mamão Formosa"]
produto["5843"] = [12.99, "Pão Francês"]
produto["1052"] = [4.9... |
"""
Given an integer n, count the total number of digit 1 appearing in all non-negative integers less than or equal to n.
Example:
Input: 13
Output: 6
Explanation: Digit 1 occurred in the following numbers: 1, 10, 11, 12, 13.
"""
class Solution:
def countDigitOne(self, n: int) -> int:
cnt = 0
m... |
# Copyright 2015 VMware, Inc.
# All Rights Reserved
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appl... |
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
fb_native = struct(
android_aar = native.android_aar,
android_app_modularity = native.android_app_modularity,
android_binary = nat... |
def getPackageList():
f = open('./libs.txt', 'r')
for line in f.readlines():
# print(line)
line = line.strip()
# print(linestr)
linestrlist = line.split(" ")
# print(linestrlist)
packageList = set(linestrlist)
f.close()
f = open('./built-in_libs.txt', 'r', en... |
jogador = dict()
time = list()
partidas = list ()
print('-='*30)
print(f'{"Estatistica da Bola":^60}')
print('-='*30)
while True:
jogador.clear()
jogador['nome']=str(input('Nome: '))
total=int(input(f'Quantas partidas {jogador["nome"]} jogou? '))
partidas.clear()
for c in range (0, total):
p... |
def findDecision(obj): #obj[0]: Passanger, obj[1]: Time, obj[2]: Coupon, obj[3]: Education, obj[4]: Occupation, obj[5]: Bar, obj[6]: Coffeehouse, obj[7]: Restaurant20to50, obj[8]: Direction_same, obj[9]: Distance
# {"feature": "Coupon", "instances": 8148, "metric_value": 0.4751, "depth": 1}
if obj[2]>1:
# {"feature... |
del_items(0x80124F0C)
SetType(0x80124F0C, "void GameOnlyTestRoutine__Fv()")
del_items(0x80124F14)
SetType(0x80124F14, "int vecleny__Fii(int a, int b)")
del_items(0x80124F38)
SetType(0x80124F38, "int veclenx__Fii(int a, int b)")
del_items(0x80124F64)
SetType(0x80124F64, "void GetDamageAmt__FiPiT1(int i, int *mind, int *... |
info = {
'driver_path' : "\\\\webdriver\\\\content\\\\geckodriver.exe",
'profile_path' : "\\\\webdriver\\\\content\\\\firefox_profile",
'primary_url' : "https://web.whatsapp.com",
'send_url' : "https://web.whatsapp.com/send?phone={}&text={}",
'send_button_class_name' : "_2Ujuu"
}
|
class Group(object):
def __init__(self, _name):
self.name = _name
self.groups = []
self.users = []
def add_group(self, group):
self.groups.append(group)
def add_user(self, user):
self.users.append(user)
def get_groups(self):
return self.groups
def ... |
aluno = {}
print()
aluno['nome'] = str(input('Nome do Aluno: '))
aluno['média'] = float(input(f'Média do {aluno["nome"]}: '))
if aluno['média'] >= 7:
aluno['Situação'] = 'APROVADO'
elif 5 <= aluno['média'] < 7:
aluno['situação'] = 'RECUPERAÇÃO'
else:
aluno['situação'] = 'REPROVADO'
print('*'*40)
for k, v in... |
# -*- coding: utf-8 -*-
info = {
"%%cardinal-alternate2-13": {
"(10, 19)": "零一=%spellout-cardinal-alternate2=;",
"(20, 999999999999)": "零=%spellout-cardinal-alternate2=;",
"(1000000000000, 'inf')": "=%spellout-cardinal-alternate2=;"
},
"%%cardinal-alternate2-2": {
"(1, 9)": "... |
def preencherInventario(lista):
resp="S"
while resp == "S":
equipamento=[input("Equipamento: "),
float(input("Valor: ")),
int(input("Número Serial: ")),
input("Departamento: ")]
lista.append(equipamento)
resp = input('Digite "S" para ... |
config = {
"colors": {
"WHITE": (255, 255, 255),
"RED": (255, 0, 0),
"GREEN": (0, 255, 0),
"BLACK": (0, 0, 0)
},
"globals": {
"WIDTH": 600,
"HEIGHT": 400,
"BALL_RADIUS": 20,
"PAD_WIDTH": 8,
"PAD_HEIGHT": 80
}
}
|
"""Mel cepstral distortion (MCD) computations in python."""
# Copyright 2014, 2015, 2016, 2017 Matt Shannon
# This file is part of mcd.
# See `License` for details of license and warranty.
__version__ = '0.5.dev1'
|
##############################################################################
# Parte do livro Introdução à Programação com Python
# Autor: Nilo Ney Coutinho Menezes
# Editora Novatec (c) 2010-2020
# Primeira edição - Novembro/2010 - ISBN 978-85-7522-250-8
# Segunda edição - Junho/2014 - ISBN 978-85-7522-408-3
# Terce... |
#!/usr/bin/env python
# Income Share Agreement
min = 50000.0
max = 88235.3
max_pay = 30000.0
max_income = 2117647.06
monthly_increment = (max - min)/23
print('\n24 months maximum payment with a minimum of $50,000 annual income')
print('Maximum income for 24 month repayment is $88,235.30\n')
print('For incomes exc... |
#
# PySNMP MIB module IANA-IPPM-METRICS-REGISTRY-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/IANA-IPPM-METRICS-REGISTRY-MIB
# Produced by pysmi-0.3.4 at Mon Apr 29 19:38:44 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python ... |
'''
Created on 1.12.2016
@author: Darren
''''''
Given n, generate all structurally unique BST s (binary search trees) that store values 1...n.
For example,
Given n = 3, your program should return all 5 unique BST s shown below.
1 3 3 2 1
\ / / / \ \
... |
# colorsystem.py is the full list of colors that can be used to easily create themes.
class Gray:
B0 = '#000000'
B10 = '#19232D'
B20 = '#293544'
B30 = '#37414F'
B40 = '#455364'
B50 = '#54687A'
B60 = '#60798B'
B70 = '#788D9C'
B80 = '#9DA9B5'
B90 = '#ACB1B6'
B100 = '#B9BDC1'
... |
# Power Drive System
# Controlword common bits.
IL_MC_CW_SO = (1 << 0)
IL_MC_CW_EV = (1 << 1)
IL_MC_CW_QS = (1 << 2)
IL_MC_CW_EO = (1 << 3)
IL_MC_CW_FR = (1 << 7)
IL_MC_CW_H = (1 << 8)
# Statusword common bits.
IL_MC_SW_RTSO = (1 << 0)
IL_MC_SW_SO = (1 << 1)
IL_MC_SW_OE = (1 << 2)
IL_MC_SW_F = (1 << 3)
IL_MC_SW_VE = (1... |
class base_graph_style():
NAME:str = ''
class default_graph_style(base_graph_style):
NAME:str = 'default'
# Task Nodes:
TASK_NODE_STYLE = 'filled'
TASK_NODE_SHAPE = 'box3d'
TASK_NODE_PENWIDTH = 1,
TASK_NODE_FONTCOLOR = 'black'
DISABLED_TASK_COLOR = 'dimgrey'
DISABLED_TASK_FONTCOL... |
num1 = int(input('Enter number 1: '))
num2 = int(input('Enter number 2: '))
num3 = int(input('Enter number 3: '))
if num1 > num2 and num1 > num3:
print(str(num1) + ' is the greatest!')
if num2 > num3 and num2 > num1:
print(str(num2) + ' is the greatest!')
if num3 > num1 and num3 > num2:
print(str(num3) +... |
MainWindow.clearData()
MainWindow.openPost3D()
PostProcess.script_openFile(-1,"Post3D","%examplesPath%/water.vtk")
PostProcess.script_openFile(-1,"Post3D","%examplesPath%/platform.vtk")
PostProcess.script_applyClicked(-1,"Post3D")
PostProcess.script_Properties_streamline_integration_direction(-1,"Post3D",3,2)
PostProce... |
class deques():
def __init__(self):
self.items = []
def addFront(self,item):
return self.items.append(item)
def addRear(self,item):
return self.items.insert(0,item)
def removeFront(self):
return self.items.pop()
def removeRear(self):
return self.items.pop(... |
#a matriz é obrigatoriamente quadrada, entao eu só preciso passar um parâmetro i = j
def cria_matriz(m):
matriz = []
for i in range(1,(m*2)+1):
linha = []
k = 1
for j in range(1,(m*2)+1):
if i == j:
if m < j:
linha.append((m*2)+1-j)
... |
Despesas = float(input("Quanto foi gasto?"))
Gorjeta = Despesas / 100 * 10
Total = Despesas + Gorjeta
print("--------------------------------------- \n O total foi de R${:.2f} \n Com uma gorjeta de R${:.2f} \n --------------------------------------- ".format(Total, Gorjeta))
|
"""
Entradas
Chelines-->int-->CA
Dracmas-->int-->DG
Pesetas-->int-->P
salidas
CA-->int-->P
DG-->int-->FrancoFrances
P-->int-->Dolares
P-->int-->LirasItalianas
"""
#entrada
CA=int(input("Ingrese la cantidad de Chelines Austriacos a cambiar: "))
DG=int(input("Ingrese la cantidad de Dracmas Griegos a cambiar: "))
P=int(in... |
def cc_lint_test_impl(ctx):
args = " ".join(
[ctx.expand_make_variables("cmd", arg, {})
for arg in ctx.attr.linter_args])
ctx.file_action(
content = "%s %s %s" % (
ctx.executable.linter.short_path,
args,
" ".join([src.short_path for src in ctx.files.srcs])),
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.