content stringlengths 7 1.05M |
|---|
cont = 1
def linha():
print('=' * 30)
def titulo(msg):
print('=' * 30)
print(f'{msg:^30}')
print('=' * 30)
def opc(msg):
global cont
print(f'{cont} - \033[34m{msg}\033[m')
cont = cont + 1
|
# boop specific events
boop_events = ["on_tick", "on_select", "on_activate", "on_decativate", "on_movecamera", "on_mouseover", "on_impulse"]
class EventStateHolder(object):
"""This object is meant to hold event state. It is passed to ever event handler when the event triggers."""
# Any client may indicate th... |
Eur = float(input('Quantos euros eu tenho - €'))
Tax = float(input('Qual a Taxa de Conversão - '))
print('Com {:.2f}€ consigo adquitir ${:.2f} Dólares.'.format(Eur, (Eur*Tax)))
|
"""
Connect Core App
Contains "Base" Template & Static Assets
"""
|
class SubOperation:
def diferenca(self, number1, number2):
return number1 - number2
|
Names = {
"Shakeel": "1735-2015",
"Usman": "2370-2015",
"Sohail": "1432-2015"
}
print("ID for Shakeel is " + Names["Shakeel"])
for k,v in Names.items():
print(k,v) |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
def fact(n):
if n == 1:
return 1
else:
return n * fact(n-1)
def facte(n):
return facter(n, 1)
def facter(num, result):
if num == 1:
return result
return facter(num - 1, num * result)
print(fact(6))
print(fact(100))
print(facte(6))
print(facte(100))
|
n = int(input())
def is_Prime(n):
is_Prime = True
if n > 1:
for i in range(2,n):
if n % i == 0:
is_Prime = False
break
else:
is_Prime = False
return is_Prime
def next_prime(n):
aux = n
while aux >= n:
if is_Prime(aux) == True:... |
DEFAULT_CARDS_VALUES = (
'🂡', '🂢', '🂣', '🂤', '🂥', '🂦', '🂧', '🂨', '🂩', '🂪', '🂫', '🂭', '🂮',
'🂱', '🂲', '🂳', '🂴', '🂵', '🂶', '🂷', '🂸', '🂹', '🂺', '🂻', '🂽', '🂾',
'🃁', '🃂', '🃃', '🃄', '🃅', '🃆', '🃇', '🃈', '🃉', '🃊', '🃋', '🃍', '🃎',
'🃑', '🃒', '🃓', '🃔', '🃕', '🃖', '🃗', '🃘... |
filter_cfg = dict(
type='OneEuroFilter',
min_cutoff=0.004,
beta=0.7,
)
|
# Aula 22 - 10-12-2019
# Como Tratar e Trabalhar Erros!!!
# Com base no seguinte dado bruto:
dadobruto = '1;Arnaldo;23;m;alexcabeludo2@hotmail.com;014908648117'
# 1) Faça uma classe cliente que receba como parametro o dado bruto.
# 2) A classe deve iniciar (__init__) guardando o dado bruto nume variável chamada self... |
#
# PySNMP MIB module Nortel-Magellan-Passport-GeneralVcInterfaceMIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/Nortel-Magellan-Passport-GeneralVcInterfaceMIB
# Produced by pysmi-0.3.4 at Wed May 1 14:27:25 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 ... |
# If the universe is 15 billions years old, how many seconds is it?
# Var declarations
number = 15000000000
# Assuming that
yearinseconds = 1*12*31*24*60*60
# Code
total = number * yearinseconds
print (total)
# Result
|
# https://leetcode.com/problems/pascals-triangle-ii/
class Solution:
def getRow(self, rowIndex: int) -> List[int]:
return self.getRowRecur([1], rowIndex)
def getRowRecur(self, prevRow, rowIndex):
if rowIndex == 0:
return prevRow
curRow = [prevRow[0]]
for... |
# Season 16 rank information
# Assumes rank 18-11 give a free star same as season 15 https://worldofwarships.com/en/news/general-news/ranked-15/
# TODO: Fix rank 17 logic since stars can't be lost (see https://worldofwarships.com/en/news/general-news/ranked-15/).
regular_ranks = {
18: {
'stars': 1,
... |
# http://stackoverflow.com/questions/312443/how-do-you-split-a-list-into-evenly-sized-chunks-in-python/312464#312464
def chunks(l, n):
""" Yield successive n-sized chunks from l.
"""
for i in xrange(0, len(l), n):
yield l[i:i+n] |
class Instruction:
def __init__(self, direction, distance):
self.direction = direction
self.distance = distance
|
##The program will recieve 3 English words inputs from STDIN
##
##These three words will be read one at a time, in three separate line
##The first word should be changed like all vowels should be replaced by *
##The second word should be changed like all consonants should be replaced by @
##The third word should b... |
class Coordinate:
#Built this structure only to make the code more readable
def __init__(self, x, y):
self.x = x
self.y = y
class Atom:
#This structure represents a molecule
def __init__(self, start_coordinate):
self.coordinate = start_coordinate
self.is_alive = False
... |
"""
Finds the sum of all the numbers that can be written as the sum of fifth power of their digits
Author: Juan Rios
"""
def sum_power(power,maximum_limit):
sum_of_numbers = 0
for i in range(maximum_limit,10,-1):
total = 0
for d in str(i):
total += int(d)**power
if total... |
def fibonacci_recursive(n):
# Base case
if n == 0:
return 0
elif n == 1:
return 1
# Recursive case
else:
return fibonacci_recursive(n-1) + fibonacci_recursive(n-2)
def main():
x = 10 # compute the x-th Fibonacci number
for i in range(x):
re... |
test2()
test()
def foo():
pass
test1()
|
#61: Average
count=0
a=1
summ=0
while a!=0:
a=float(input("Enter the number:"))
summ+=a
count+=1
print("Average:",(summ)/(count-1))
|
def cul_a1(N, n):
first_value = (2 * N - n * (n - 1)) // (2 * n)
flag = (2 * N - n * (n - 1)) / (2 * n) == first_value
return flag, first_value
def print_sequence(a1, n):
for a in range(a1, a1 + n-1):
print(a, end=" ")
print(a1 + n-1, end="")
class Sum:
def sum_sequence(self, N, L):
... |
print('-=-=-=-= DESAFIO 48 -=-=-=-=')
print()
print('='*46)
print(' SOMA ENTRE ÍMPARES MÚLTIPLOS DE 3 ENTRE 1-500')
print('='*46)
s = 0
cont = 0
for c in range(1, 501, 2):
if c % 3 == 0:
s += c # ACUMULADOR
cont += 1 # CONTADOR
print('Essa soma de todos os {} valores é {}'.format(cont, s))
|
# Любимый вариант очереди Тимофея — очередь, написанная с использованием
# связного списка. Помогите ему с реализацией. Очередь должна поддерживать
# выполнение трёх команд:
#
# get() — вывести элемент, находящийся в голове очереди, и удалить его.
# Если очередь пуста, то вывести «error».
# put(x) — добавить число x... |
def count_unsorted(s: str) -> dict:
result = {}
for c in s:
# 利用错误处理机制,效率可能会更快
try:
result[c] += 1
except KeyError:
result[c] = 1
return result
def count(s: str) -> list:
# XXX: optimization
result = count_unsorted(s)
result = list(... |
"""
File: anagram.py
Name: Marco
----------------------------------
This program recursively finds all the anagram(s)
for the word input by user and terminates when the
input string matches the EXIT constant defined
at line 19
If you correctly implement this program, you should see the
number of anagrams for each word... |
"""Configurations and Constants."""
COMBINATION_SIZE = 2
|
# -*- coding: utf-8 -*-
"""
Collect all the constants required by the module in one place
"""
# Settings that are required for the library to perform correctly
REQUIRED_SETTINGS = (
'GOOGLE_APPLICATION_CREDENTIALS',
'GCLOUD_PROJECT_NAME',
# default bucket that should be used to store assets
'GCLOUD_DEF... |
''' From Page 11 '''
# Yes or No values 9 and 696969
sheet.cell(row=row, column=col).value = 'Yes / No'
sheet.cell(row=row, column=col).font = Font(size = 9, color='696969')
# ✓ X values 8 and DCDCDC
sheet.cell(row=row, column=col).value = '✓ X'
sheet.cell(row=row, column=col).font = Fon... |
#There's a reduced form of range() - range(max_value), in which case min_value is implicitly set to zero:
for i in range(3):
print(i)
|
def unique(s):
seen = set()
seen_add = seen.add
return [x for x in s if not (x in seen or seen_add(x))]
|
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright (c) 2021, Cisco Systems
# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt)
DOCUMENTATION = r"""
---
module: trusted_certificate_info
short_description: Information module for Trusted Certificate
description:
- Get all Trus... |
class InvalidColorMapException(Exception):
def __init__(self, *args):
if len(args)==1 and isinstance(args[0], str):
self.message = args[0]
else:
self.message = "Invalid colormap."
class InvalidFileFormatException(Exception):
def __init__(self, *args):
if ... |
"""
Naive approaches:
Using two loops:
for each node in list:
from start to curr each node:
check curr node is its next node
using modified Node structure using visited field in each node
traverse list and mark each curr node as visited
while traversing check if curr node is alre... |
line = input().split(', ')
my_dict = {}
counter = 1
country = []
while counter <= 2:
for n in range(len(line)):
if counter ==1:
country.append(line[n])
else:
my_dict[country[n]] = line[n]
counter+=1
if counter >2:
break
line = input(). split(', ')
for ... |
def is_prime(number):
"""checks if a given number is prime"""
prime = True
for n in range(2, number):
if prime and number % n == 0:
prime = False
print("The number is not prime")
if prime:
print("The number is prime")
return prime
if __name__ == "__main__":
... |
"""
528. Flatten Nested List Iterator
https://www.lintcode.com/problem/flatten-nested-list-iterator/description
九章算法强化班C7
大部分计算得在hasNext里就处理掉。因为万一遇到[[],[]],如果不在hasNext里面处理掉。就会造成外部函数调用
hasNext -> 回答 yes
然后去掉 next -> None 的情况。
所以处理必须得在hasNext里面处理掉。
"""
"""
This is the interface that allows for creating nested lists.
You... |
# NOTE: You need to check directory's permission
MAX_HEIGHT = 1536 # 1536 # 768 # 1280 # 1024 # 2048 # 2688
MAX_WIDTH = 3072 # 3072 # 1536 # 2560 # 2048 # 4096 # 5376
CROP_HEIGHT = 512 # 256, 384, 512
CROP_WIDTH = 512 # 512, 768, 1024
RESIZE_HEIGHT = 1536
RESIZE_WIDTH = 3072
# MNT_PATH = '/nfs/host/PConv-Kera... |
# O(n+k) time complexity (Worst time complexity - O(2n-1)):
# O(k) (Get Slice 1)
# O(n-k) (Get Slice 2)
# O(k) (Concatenate Slices)
# CPython time-complexity - https://wiki.python.org/moin/TimeComplexity
# O(1) space complexity
# Rotates the characters in a string by a given input and have the overflow appear ... |
def main():
print ('Filter data')
input_f = open('../data/result_size_large_files.tsv')
output_f = open('../data/result_size_large.csv', 'w')
lines = input_f.readlines()
distributions = ['Combo', 'Diagonal', 'DiagonalRot', 'Gauss', 'Parcel', 'Uniform']
for line in lines:
print (line)
... |
# Implementation of a Stack.
class Stack:
class Node: # Node class (or pointers that hold a value and direction to next node).
def __init__(self, val=None):
self.val = val
self.nextNode = None
def __init__(self):
self.head = None
# Add new node with value to stack... |
# -*- coding: utf-8 -*-
#
# 全局配置
# Author: __author__
# Email: __email__
# Created Time: __created_time__
# 全局测试状态
DEBUG = False
|
"""
Constants and other config variables used throughout the packagemanager module
Copyright (C) 2017-2022 Intel Corporation
SPDX-License-Identifier: Apache-2.0
"""
# Location of ca certs file on Linux
LINUX_CA_FILE = '/etc/ssl/certs/ca-certificates.crt'
# Buffer size for streaming the downlaod file to c... |
j= 7
for i in range(9+1):
if i%2 ==1:
print(f"I={i} J={j}")
print(f"I={i} J={j-1}")
print(f"I={i} J={j-2}")
j =j+2
|
class BearToy:
def __init__(self, name, size, color):
self.name = name
self.size = size
self.color = color
def sing(self):
print('I am %s, lalala...' % self.name)
class NewBear(BearToy):
def __init__(self, name, size, color, material):
# BearToy.__init__(self, name,... |
class DesignerSummary(object):
def __init__(self, designer_name, summary):
self.designer_name = designer_name
self.summary = summary
def print_summary(self):
print("[%s]" % self.designer_name)
print(" %s" % self.max_price())
print(" %s" % self.avg_price())
... |
qrel_input = 'data/expert/qrels-covid_d4_j3.5-4.txt'
doc_type = 'expert'
qrel_name = 'baseline_doc'
qrel_path = f'qrels/{doc_type}/{qrel_name}'
with open(qrel_path, 'w') as fo:
with open(qrel_input) as f:
for line in f:
line = line.strip().split()
if line:
query_id, _, doc_id, dq_rank = line
query_i... |
class BoundingBox:
def __init__(self, x1, y1, x2, y2):
self.x1 = x1
self.y1 = y1
self.x2 = x2
self.y2 = y2
self.k = 2 # scaling factor
def get_x_center(self):
return(self.x1 + self.x2) / 2
def get_y_center(self):
return(self.y1 + self.y2)... |
s = 0
for i in range(2,100):
for j in range(2,i):
if i % j == 0:
break
else:
s += i
print(s) |
n1= input()
n2 = input()
j = 1
for i in range(1,n1+1):
j = i*j
k = j%n2
print(k)
print("\n") |
# Used to test import statements for the NoopAugmentor plugin.
def noop(x):
return x
|
C = int(input())
if C>=2 and C<=99:
for i in range(C):
x =input()
print("gzuz") |
def my_bilateral_filter(ImgNoisy, window_size = 3 , sigma_d = 4, sigma_r = 40):
# sigma_d : smoothing weight factor
# sigma_r : range weight factor
height = ImgNoisy.shape[0]
width = ImgNoisy.shape[1]
# Initialize the filtered image:
filtered_image = np.empty([height,width])
# S... |
#!/usr/bin/python
#-*- coding:utf-8 -*-
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
try:
s.connect((conn_ip,conn_port))
logging.info('IP:'+str(conn_ip)+',PORT:'+str(conn_port)+',connect successful')
except Exception as e:
logging.warning('IP:'+str(conn_ip)+',PORT:'+str(conn_port)+',connect failed!... |
# Python - lab 8
# var 7
# Group 2
# 4/11/2019
__doc__ = """
The simplest Python interpreter ever
See more at https://vadimcpp.ru/python/laba8.html
This is Backus–Naur form
Syntax:
<expression> ::= <digit>|<expression><operation><digit>
<operation> ::= +|-
<digit> ::= 1|2|3|4|5|6|7|8|9
"""
class InterpretError(Ex... |
input = """
% This is most similar to nonground.query.3, just without the second
% constraint. We originally failed to process this correctly.
color(red,X) | color(green,X) | color(blue,X) :- node(X).
node("Cosenza").
node("Vienna").
node("Diamante").
redish :- color(red,"Vienna").
dark :- not color(red,"V... |
class EventTableData:
def __init__(self):
self._header_tag = 'th'
self._dispo_header = False
self._event_row = -1
def store_data(self, case_parser, data):
if self._dispo_header:
self._event_row += 1
case_parser.event_table_data.append([])
... |
"""Ogre Package
@author Michael Reimpell
"""
# epydoc doc format
__docformat__ = "javadoc en"
__all__ = ["base", "gui", "materialexport", "armatureexport", "meshexport"]
|
class IceCreamMachine:
all={}
def __init__(self, ingredients, toppings):
self.ingredients = ingredients
self.toppings = toppings
def scoops(self):
res = []
for i in self.ingredients:
for j in self.toppings:
res.append([i, j])
return res
m... |
class lennox_period(object):
def __init__(self, id):
self.id = id
self.enabled = False
self.startTime = None
self.systemMode = None
self.hsp = None
self.hspC = None
self.csp = None
self.cspC = None
self.sp = None
self.spC = None
... |
#Write a function that reverses a string. The input string is given as an array of characters char[].
#Do not allocate extra space for another array, you must do this by modifying the input array in-place with O(1) extra memory.
#You may assume all the characters consist of printable ascii characters.
#Runtime: beats ... |
#Inverter valores de 2 variaveis lidas.
a = input("Insira o valor de A: "); b = input("Insira o valor de B: ")
c = a
a = b
b = c
print("O valor de A (invertida): " + str(a) + " e o de B (invertido): " + str(b)) |
### Insert a node at the head of a linked list - Solution
class SinglyLinkedListNode:
def __init__(self, node_data):
self.data = node_data
self.next = None
class SinglyLinkedList:
def __init__(self):
self.head = None
self.tail = None
def print_singly_linked_list(node):
whi... |
# function to increase the pixel by one inside each box
def add_heat(heatmap, bbox_list):
# Iterate through list of bboxes
for box in bbox_list:
# Add += 1 for all pixels inside each bbox
# Assuming each "box" takes the form ((x1, y1), (x2, y2))
heatmap[box[0][1]:box[1][1], box[0][0]:box... |
# Definition for singly-linked list.
# class ListNode:
# def __init__(self, val=0, next=None):
# self.val = val
# self.next = next
class Solution:
def __init__(self, head: ListNode):
"""
@param head The linked list's head.
Note that the head is guaranteed to be not null,... |
fim = int(input("Digite um numero: "))
x = 0
while x <= fim:
if not x % 2 == 0:
print(x)
x += 1
|
# !/usr/bin/env python
"""
Provides the gcd and s, t of Euclidian algorithim for a given m, n
The algorithim states that the GCD of 2 numbers is equal to a product
of the one of the numbers and a coefficient, s added with the product
of the remaining number and a coefficient, t.
"""
def gcd(m,n,buffer):
"""Retu... |
class EmployeeApi:
endpoint = 'Employee.json'
def __init__(self, client):
self.client = client
def get_employee(self, employeeId):
return self.client.get(endpoint=self.endpoint, payload={
"employeeID": employeeId,
"load_relations": '["Contact"]'
}) |
# HARD
# Input: "abcd"
# reverse input => as rev = "dcba"
# compare s[:n-i] with rev[i:]
# abcd vs dcba
# abc vs cba
# ab vs ba
# a vs a => i == 3
# the same substring is the overlapped part of the result, thus rev[:i] + s is the result
# Time O(N^2) Space O(n)
# KMP prefix tabl... |
'''
Given a set of distinct integers, nums, return all possible subsets (the power set).
Note: The solution set must not contain duplicate subsets.
Permutation and combination
'''
class Solution:
def dfs(self, result, combination, nums, start_index, depth):
if depth==0:
result.append(combinat... |
'''
Функція замінює один елемент масиву на інший.
Це чиста функція, вона повертає нове значення.
'''
def replace_with(old, new, string):
isstr = False
if isinstance(string, str):
string = list(string)
isstr = True
def wrap(i):
nonlocal string
if len(string) == i:
... |
__author__ = 'ipetrash'
if __name__ == '__main__':
# EN:
# Write a program that displays a number from 1 to 100. In this case, instead of numbers that are
# multiples of three, the program should display the word «Fizz», but instead of multiples of five - the
# word «Buzz». If the number is a multiple... |
def build_schema_query(table_schema):
schema_query = """
SELECT table_name,
column_name,
column_default,
is_nullable,
data_type,
character_maximum_length
FROM information_schema.columns
WHERE table_schema =... |
{ 'application':{ 'type':'Application',
'name':'HtmlPreview',
'backgrounds':
[
{ 'type':'Background',
'name':'bgMin',
'title':'HTML Preview',
#'size':(800, 600),
'statusBar':1,
'style':['resizeable'],
'components':
[
{ 'type':'HtmlWindow',
'name':'html',
... |
# -*- coding: UTF-8 -*-
"""
Created on 2017年11月10日
@author: Leo
"""
class DataValidate:
# 校验是否为数字
@staticmethod
def is_int(data):
if isinstance(data, int):
return {"status": True, "data": data}
else:
return {"status": False, "data": data}
# 校验是否为字符串
@stati... |
expected_output = {
"vrf": {
"default": {
"address_family": {
"ipv4": {
"instance": {
"1": {
"areas": {
"0.0.0.0": {
"database": {
... |
pkgname = "fontconfig"
pkgver = "2.14.0"
pkgrel = 0
build_style = "gnu_configure"
configure_args = [
"--enable-static", "--enable-docs",
f"--with-cache-dir=/var/cache/{pkgname}",
]
make_cmd = "gmake"
hostmakedepends = ["pkgconf", "gperf", "gmake", "python"]
makedepends = ["libexpat-devel", "freetype-bootstrap",... |
# second_index
# Created by JKChang
# 10/04/2018, 09:15
# Tag:
# Description: You are given two strings and you have to find an index of the second occurrence of the second string in
# the first one.
#
# Input: Two strings.
#
# Output: Int or None
def second_index(text: str, symbol: str):
"""
returns the s... |
"""
Print the pattern of
*
* *
* * *
* * * *
* * * * *
"""
n = 5
k = n - 1
for i in range(0, n):
for j in range(0, k):
print(end=" ")
k = k - 1
for j in range(0, i + 1):
print("* ", end="")
print()
|
'''
Created on 09-May-2017
@author: Sathesh Rgs
'''
print("Program to display armstrong numbers between two intervals")
try:
print("Enter the starting and ending intervals")
si=int(input())
ei=int(input())
print("The armstrong numbers between",si,"and",ei,"are")
for num in range(si,ei+1):
... |
class Solution:
def minCostConnectPoints(self, points: List[List[int]]) -> int:
answer=0
u=[0]*len(points)
unionMap={}
if len(points)==1:
return 0
edges=[]
for i in range(len(points)):
u[i]=i
unionMap[i]=[i]
f... |
"""Top-level package for simplecarboncleaner."""
__author__ = """Abhishek Bhatia"""
__email__ = 'bhatiaabhishek8893@gmail.com'
__version__ = '0.1.0'
|
''' A simple test
'''
def test_pytest():
'''test_pytest
Summary
-------
Dummy test function.
'''
assert True
|
#!/usr/bin/env python
def yell(text):
return text.upper() + '!'
print(yell('hello'))
# Functions are objects
bark = yell
print(bark('woof'))
del yell
print(bark('hey'))
# error
# print(yell('hello'))
print(bark.__name__)
print(bark.__qualname__)
funcs = [bark, str.lower, str.capitalize]
print(funcs)
for f in ... |
#Python number
# int
# float
# complex
x = 1
y = 13.23
z = 1j
print(x)
print(y)
print(z)
print("-----------------------------------")
print(type(x))
print(type(y))
print(type(z))
print("-----------------------------------") |
class BaseError(Exception):
pass
class UnknownError(BaseError):
pass
class AccessTokenRequired(BaseError):
pass
class BadOAuthTokenError(BaseError):
pass
class BadRequestError(BaseError):
pass
class TokenError(BaseError):
pass
|
def numIslands(self, grid: List[List[str]]) -> int:
count = 0
rows = len(grid)
cols = len(grid[0])
''' very similar solution to all these permuation problems
going through each coordinate and changing them if they are
connected
'''
... |
"""
For address = "prettyandsimple@example.com", the output should be
findEmailDomain(address) = "example.com";
"""
def findEmailDomain(address):
return address.split('@')[-1]
def findEmailDomain(address):
return address[address.rfind('@')+1:] |
extension = '''
# from sqlalchemy.ext.declarative import declarative_base
# # from core.factories import Session
from sqlalchemy import MetaData
from gino.ext.starlette import Gino
from core.factories import settings
db: MetaData = Gino(dsn=settings.DATABASE_URL)
''' |
STATS = [
{
"num_node_expansions": 0,
"search_time": 0.0553552,
"total_time": 0.13778,
"plan_length": 231,
"plan_cost": 231,
"objects_used": 140,
"objects_total": 250,
"neural_net_time": 0.07324552536010742,
"num_replanning_steps": 0,
"... |
def jwt_response_payload_handler(token,user=None,request=None):
return {
'token': token,
'user_id': user.id,
'username': user.username
}
def jwt_get_user_secret(user):
print(user)
return user.user_secret
|
power = {'BUSES': {'Area': 1.33155,
'Bus/Area': 1.33155,
'Bus/Gate Leakage': 0.00662954,
'Bus/Peak Dynamic': 0.0,
'Bus/Runtime Dynamic': 0.0,
'Bus/Subthreshold Leakage': 0.0691322,
'Bus/Subthreshold Leakage with power gating': 0.0259246,
'Gate... |
#!/usr/bin/env python3
k = int(input())
a, b = map(int, input().split())
for i in range(a, b+1):
if i%k == 0:
print("OK")
exit()
print("NG") |
def user_choice():
"""This function is used for navigating user"""
userWeight = int(input("\nSelect weight conversion\n" +
"1. kg\n" +
"2. stone\n" +
"3. pound\n"))
if userWeight == 1:
kilograms()
elif... |
# generated from genmsg/cmake/pkg-genmsg.context.in
messages_str = "/home/kinova/MillenCapstone/catkin_ws/src/kinova-ros/kinova_msgs/msg/FingerPosition.msg;/home/kinova/MillenCapstone/catkin_ws/src/kinova-ros/kinova_msgs/msg/JointAngles.msg;/home/kinova/MillenCapstone/catkin_ws/src/kinova-ros/kinova_msgs/msg/JointVelo... |
# 5! = 120
#
# 5 * 4 * 3 * 2 * 1
def factorial(n):
if n == 1:
return 1
return n * factorial(n - 1)
print(f'5!={factorial(5):,},' # 120
f' 3!={factorial(3):,},' # 6
f' 11!={factorial(11):,}') # HUGE
|
"""
Central location for all hard coded data needed for tests.
"""
DOWNLOAD_OPTIONS_FROM_ALL_SERVICES = {
# 'svc://nasa:srtm-3-arc-second': {},
# 'svc://nasa:srtm-30-arc-second': {},
'svc://noaa-ncdc:ghcn-daily': {
'properties': [{
'default': None,
'description': 'parameter'... |
class Solution(object):
def isReflected(self, points):
"""
:type points: List[List[int]]
:rtype: bool
"""
if len(points) < 2:
return True
twoTimesMid = min(points)[0] + max(points)[0]
d = set([(i, j) for i, j in points])
for i, j ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.