content stringlengths 7 1.05M |
|---|
# Find the set of maximums and minimums in a series,
# with some tolerance for multiple max or minimums
# if some highest or lowest values in a series are
# tolerance_threshold away
def find_maxs_or_mins_in_series(series, kind, tolerance_threshold):
isolated_globals = []
if kind == "max":
global_max_or_min = s... |
load("//cipd/internal:cipd_client.bzl", "cipd_client_deps")
def cipd_deps():
cipd_client_deps()
|
class Holding:
"""A single holding in a fund. Subclasses of Holding include Equity, Bond, and Cash."""
def __init__(self, name):
self.name = name
"""The name of the security."""
self.identifier_cusip = None
"""The CUSIP identifier for the security, if available and applica... |
'''
Detect Cantor set membership
Status: Accepted
'''
###############################################################################
def main():
"""Read input and print output"""
while True:
value = input()
if value == 'END':
break
value = float(value)
lhs, rhs,... |
class State:
def __init__(self):
self.pixel = None
self.keyboard = None
self.keyboard_layout = None
pass
def start(self):
pass
def end(self):
pass
def onTick(self):
pass
def onButtonPress(self):
pass
def onButtonRelease(self):
... |
def convert( s: str, numRows: int) -> str:
print('hi')
# Algorithm:
# Output: Linearize the zig zagged string matrix
# input: string and number of rows in which to make the string zag zag
# Algorithm steps:
# d and nd list /diagonal and nondiagonal lists
#remove all prints if pasting in leetc... |
class Node:
"""create a Node"""
def __init__(self, val):
self.val = val
self.left = None
self.right = None
def __repr__(self):
return 'Node Val: {}'.format(self.val)
def __str__(self):
return str(self.val)
|
#Receber altura e largura de uma parede, mostrar sua área e dizer quantos litros de tinta serão necessários para pintar
altura = float(input("Digite a altura: "));
largura = float(input("Digite a largura: "));
area = (altura * largura);
tinta= (area/2);
print(f"A área de {altura} x {largura} calculada foi igual a ... |
class Solution:
def reconstructQueue(self, people: list) -> list:
if not people:
return []
def func(x):
return -x[0], x[1]
people.sort(key=func)
new_people = [people[0]]
for i in people[1:]:
new_people.insert(i[1], i)
return new_p... |
# -*- coding: utf-8 -*-
"""
equip.visitors.classes
~~~~~~~~~~~~~~~~~~~~~~
Callback the visit method for each encountered class in the program.
:copyright: (c) 2014 by Romain Gaucher (@rgaucher)
:license: Apache 2, see LICENSE for more details.
"""
class ClassVisitor(object):
"""
A class visitor that ... |
class Post():
def __init__(self, userIden, content, timestamp, image=None, score='0', replies=None):
self.userIden = userIden
self.content = content
self.timestamp = timestamp
self.image = image
self.score = score
self.replies = [] if not replies else replies
|
d = dict()
d["nome"] = input('Nome: ')
d["media"] = float(input('Média: '))
print(f'O nome é {d["nome"]} \nA média é {d["media"]}')
if d["media"] < 4:
print('A situação atual é REPROVADO!')
elif d["media"] < 7:
print('A situação atuai é RECUPERAÇÃO!')
else:
print('A situação atual é APROVADO!')
|
def radix_sort(alist, base=10):
if alist == []:
return
def key_factory(digit, base):
def key(alist, index):
return ((alist[index]//(base**digit)) % base)
return key
largest = max(alist)
exp = 0
while base**exp <= largest:
alist = counting_sort(alist, bas... |
N, *A = map(int, open(0).read().split())
result = 0
for i in range(2, 1000):
t = 0
for a in A:
if a % i == 0:
t += 1
result = max(result, t)
print(result)
|
#{
#Driver Code Starts
#Initial Template for Python 3
# } Driver Code Ends
#User function Template for python3
# Function to calculate average
def calc_average(nums):
# Your code here
mini = min(nums)
maxi = max(nums)
n = len(nums)
s = sum(nums)-mini-maxi
s = s//(n-2)
return s
#{ ... |
# Remove all elements from a linked list of integers that have value val.
# Example:
# Input: 1->2->6->3->4->5->6, val = 6
# Output: 1->2->3->4->5
# Definition for singly-linked list.
class ListNode(object):
def __init__(self, x):
self.val = x
self.next = None
class Solution(object):
def remo... |
# in file: models/db_custom.py
db.define_table('company', Field('name', notnull = True, unique = True), format = '%(name)s')
db.define_table(
'contact',
Field('name', notnull = True),
Field('company', 'reference company'),
Field('picture', 'upload'),
Field('email', requires = IS_EMAIL()),
Field('phone... |
meuCartao = int(input("Digite o número do cartão de crédito: "))
cartaolido = 1
encontreiMeuCartaoNaLista = False
while cartaolido != 0 and not encontreiMeuCartaoNaLista:
cartaolido = int(input("Digite o número do próximo cartão de crédito: "))
if cartaolido == meuCartao:
encontreiMeuCartaoNaLista = T... |
def main():
i = 0
while True:
print(i)
i += 1
if i > 5:
break
j = 10
while j < 100:
print(j)
j += 10
while 1:
print(j + i)
break
while 0.1:
print(j + i)
break
while 0:
print("This never executes")... |
example = """
..##.......
#...#...#..
.#....#..#.
..#.#...#.#
.#...##..#.
..#.##.....
.#.#.#....#
.#........#
#.##...#...
#...##....#
.#..#...#.#"""
example_list = [list(x) for x in example.split()]
with open('test.in', mode='r') as f:
puzzle_input = [list(x.strip()) for x in f.readlines()]
def tree_hitting_fun... |
'''
Synchronization phenomena in networked dynamics
'''
def kuramoto(G, k: float, w: Callable):
'''
Kuramoto lattice
k: coupling gain
w: intrinsic frequency
'''
phase = gds.node_gds(G)
w_vec = np.array([w(x) for x in phase.X])
phase.set_evolution(dydt=lambda t, y: w_vec + k * phase.div(np.sin(phase.grad())))
... |
'''
Determine sum of integer digits between two inclusive limits
Status: Accepted
'''
###############################################################################
def digit_sum(value):
"""Return the sum of all digits between 0 and input value"""
result = 0
if value > 0:
magnitude = value // 1... |
def Markov1_3D_BC_taper_init(particle, fieldset, time):
# Initialize random velocity magnitudes in the isopycnal plane
u_iso_prime_abs = ParcelsRandom.normalvariate(0, math.sqrt(fieldset.nusquared))
v_iso_prime_abs = ParcelsRandom.normalvariate(0, math.sqrt(fieldset.nusquared))
# (double) derivativ... |
def factorial(number):
if(number == 0):
return 1
return number * factorial(number - 1)
def run():
number = int(input('\nIngresa un número para saber su factorial: '))
result = factorial(number)
print('\nEl factorial de {} es: {} \n'.format(number, result))
if __name__ == '__main__':
... |
# Definition for a binary tree node.
# class TreeNode:
# def __init__(self, val=0, left=None, right=None):
# self.val = val
# self.left = left
# self.right = right
class Solution:
def verticalTraversalRec(self, root, row, col, columns):
if not root:
return
co... |
'''
Author: Shuailin Chen
Created Date: 2021-09-14
Last Modified: 2021-09-25
content:
'''
_base_ = [
'../_base_/models/deeplabv3_r50a-d8.py',
'../_base_/datasets/sn6_sar_pro.py', '../_base_/default_runtime.py',
'../_base_/schedules/schedule_20k.py'
]
model = dict(
decode_head=dict(num_classes=2), auxi... |
"""
Module provides state and state history for agent.
"""
class AgentState(object):
"""
AgentState class.
Agent state is a class that specifies current agent behaviour. It
provides methods that describe the way agent cooperate with
percepted stimulus coming from environment.
@attention: You ... |
#!/usr/bin/env python3
# -- coding: utf-8 --
if __name__ == '__main__':
s1 = input("Введите первое слово: ")
s2 = input("Введите второе слово: ")
z = 0
for i in range(0, len(s1)):
if s1[i] == s2[i]:
z += 1
if z:
print(f"{z} начальные буквы первого слова, совпадают со вто... |
# encoding=utf-8
d = dict(one=1, two=2)
d1 = {'one': 1, "two": 2}
d2 = dict()
d2['one'] = 1
d2['two'] = 2
# [(key,value), (key, value)]
my_dict = {}.setdefault().append(1)
print(my_dict[1]) |
# Matrix Ops some helper functions for matrix operations
#
# Legal:
# ==============
# Copyright 2021 lukasjoc<jochamlu@gmail.com>
# 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 Softw... |
"""Problem 001
If we list all the natural numbers below 10 that are
multiples of 3 or 5, we get 3, 5, 6 and 9.
The sum of these multiples is 23.
Find the sum of all the multiples of 3 or 5 below 1000.
"""
ans = sum(n for n in range(1000) if n % 3 == 0 or n % 5 == 0)
print(ans)
|
@app.route('/home')
def home():
return redirect(url_for('about', name='World'))
@app.route('/about/<name>')
def about(name):
return f'Hello {name}' |
# coding: utf-8
#
# Copyright 2022 :Barry-Thomas-Paul: Moss
#
# 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 applicab... |
def Naturals(n):
yield n
yield from Naturals(n+1)
s = Naturals(1)
print("Natural #s", next(s), next(s), next(s), next(s))
def sieve(s):
n = next(s)
yield n
yield from sieve(i for i in s if i%n != 0)
p = sieve(Naturals(2))
print("Prime #s", next(p), next(p), next(p), \
next(p), next(p), next(p)... |
"""
Storage for script settings and parameter grids
Authors: Vincent Yu
Date: 12/03/2020
"""
# GENERAL SETTINGS
# Set to true to re-read the latest version of the dataset csv files
update_dset = False
# Set the rescale factor to inflate the dataset
rescale = 1000
# FINE TUNING RELATED
# Set the random grid search st... |
##
## parse argument
##
## written by @ciku370
##
def toxic(wibu_bau,bawang):
shit = bawang.split(',')
dan_buriq = 0
result = {}
for i in wibu_bau:
if i in shit:
try:
result.update({wibu_bau[dan_buriq]:wibu_bau[dan_buriq+1]})
except IndexError:
... |
raise NotImplementedError("'str' object has no attribute named '__getitem__' looks like I can't index a string?")
def countGroups(related):
groups = 0
def follow_subusers(matrix_lookup, user_id, users_in_group):
"""
Recursive helper to follow users across matrix that have associations possibl... |
num = [8, 5, 9, 1]
num[2] = 3
# as listas são mutáveis
num.append(7)
#num.sort(reverse=True)
num.insert(2, 0)
num.pop(2)
if 4 in num:
num.remove(4)
else:
print('Não encontrei o valor 4')
print(num)
print(f'Essa lista tem {len(num)} elementos')
|
for linha in range(5):
for coluna in range(3):
if (linha == 0 and coluna == 0) or (linha == 4 and coluna == 0):
print(' ', end='')
elif linha == 0 or linha == 4 or coluna == 0:
print('*', end='')
else:
print(' ', end='')
print()
|
IV = bytearray.fromhex("391e95a15847cfd95ecee8f7fe7efd66")
CT = bytearray.fromhex("8473dcb86bc12c6b6087619c00b6657e")
# Hashes from the description of challenge
ORIGINAL_MESSAGE = bytearray.fromhex(
"464952455f4e554b45535f4d454c4121") # FIRE_NUKES_MELA!
ALTERED_MESSAGE = bytearray.fromhex(
"53454e445f4e55444... |
def draw(stick: int, cx: str):
"""Function to draw of the board.
Args:
stick: nb of sticks left
cx: past
"""
if stick == 11:
print(
"#######################\n | | | | | | | | | | | \n#######################"
)
if stick == 10:
print(
"#... |
#Check String
'''To check if a certain phrase or character is present in a string, we can use the keyword in.'''
#Check if "free" is present in the following text:
txt = "The best things in life are free!"
print("free" in txt)
txt = "Hello buddie owo!"
if "owo" in txt:
print("Yes, 'owo' is present.")
'''
Terminal... |
testes = int(input())
casos = []
for x in range(testes):
casos_ = input().split()
casos.append(casos_)
for x in range(testes):
a = int(casos[x][0])
b = int(casos[x][1])
print(a+b)
|
# led-control WS2812B LED Controller Server
# Copyright 2021 jackw01. Released under the MIT License (see LICENSE for details).
default = {
0: {
'name': 'Sunset Light',
'mode': 0,
'colors': [
[
0.11311430089613972,
1,
1
... |
class Solution:
def myAtoi(self, s: str) -> int:
s = s.strip(' ')
s = s.rstrip('.')
lens = len(s)
if (not s) or s[0].isalpha() or (lens == 1 and not s[0].isdecimal()):
return 0
string, i = '', 0
if s[0] in {'-', '+'}:
i = 1
string... |
while(True):
try:
n,k=map(int,input().split())
text=input()
except EOFError:
break
p=0
for i in range(1,n):
if text[0:i]==text[n-i:n]:
p=i
#print(p)
s=text+text[p:]*(k-1)
print(s) |
class ExileError(Exception):
pass
class SCardError(ExileError):
pass
class YKOATHError(ExileError):
pass
|
class Team:
def __init__(self, client):
self.client = client
async def info(self):
result = await self.client.api_call('GET', 'team.info')
return result['team']
|
def chunk_string(string, chunk_size=450):
# Limit = 462, cutting off at 450 to be safe.
string_chunks = []
while len(string) != 0:
current_chunk = string[0:chunk_size]
string_chunks.append(current_chunk)
string = string[len(current_chunk):]
return string_chunks
|
class Solution:
def twoSum(self, numbers, target):
"""
:type numbers: List[int]
:type target: int
:rtype: List[int]
"""
l, r = 0, len(numbers) - 1
while numbers[l] + numbers[r] != target:
if numbers[l] + numbers[r] < target:
l += 1
... |
def maiusculas(frase):
palavra = ''
for letra in frase:
if ord(letra) >= 65 and ord(letra) <= 90:
palavra += letra
return palavra
def maiusculas2(frase):
palavra = ''
for letra in frase:
if letra.isupper():
palavra += letra
return palavra
|
# SQRT(X) LEETCODE SOLUTION:
# creating a class.
class Solution(object):
# creating a function to solve the problem.
def mySqrt(self, x):
# declaring a variable to track the output.
i = 0
# creating a while-loop to run while the output variable squared is less than or equa... |
with open("input_blocks.txt") as file:
content = file.read()
for idx, block in enumerate(content.strip().split("---\n")):
with open(f"blocks/{idx+1}.txt", "w") as file:
print(block.rstrip(), file=file) |
# Defining a Function
def iterPower(base, exp):
# Making an Iterative Call
result = 1
while exp > 0:
result *= base
exp -= 1
return result
|
class Solution:
def isSolvable(self, words, result) -> bool:
for word in words:
if len(word) > len(result):
return False
words = [word[::-1] for word in words]
result = result[::-1]
c2i = [-1] * 26
i2c = [False] * 10
def dfs(idx, digit, s)... |
"""
Script to find positive array with max sum
"""
class MaxSumSubArray():
"""
# @param A : list of integers
# @return a list of integers
"""
def maxsub(self, A):
"""
Function
"""
if not isinstance(A, (tuple, list)):
A = tuple([A])
n = len(A)
... |
def findMin(l):
min = -1
for i in l:
print (i)
if i<min:
min = i
print("the lowest value is: ",min)
l=[12,0,15,-30,-24,40]
findMin(l)
|
{
"targets": [
{
"target_name": "towerdef",
"sources": [ "./cpp/towerdef_Main.cpp",
"./cpp/towerdef.cpp",
"./cpp/towerdef_Map.cpp",
"./cpp/towerdef_PathMap.cpp",
"./cpp/towerdef_Structure.cpp",
"./cpp/... |
def main():
T = int(input())
case_id = 1
while case_id <= T:
num = int(input())
if num == 0:
print("Case #{case_id}: INSOMNIA".format(case_id=case_id))
case_id += 1
continue
all_nums = []
res = 0
cur_num = num
while... |
#POO 2 - POLIFORMISMO
#
class Coche():
def desplazamiento(self):
print("Me desplazo utilizando cuatro ruedas")
class Moto():
def desplazamiento(self):
print("Me Desplazo utilizando dos Ruedas")
class Camion():
def desplazamiento(self):
print("Me Desplazo utilizando seis Rue... |
# ESTRUTURAS DE CONTROLE (REPETIÇÃO)
'''for c in range(0, 6):
print('OI')
print('fim')'''
# o ultimo número é ignorado
'''for c in range(1,7):
print(c)
print('fim')'''
# -1 que diz qual a ITERAÇÃO, neste caso, contagem regressiva
'''for c in range(6,0,-1):
print(c)
print('fim')'''
# Com a ITERAÇÃO 2 ele d... |
a=int(input('Enter first number:'))
b=int(input('Enter second number:'))
a=a+b
b=a-b
a=a-b
print('After swaping first number is=',a)
print('After swaping second number is=',b)
|
class Iterable(object):
"""
可迭代对象
"""
def __iter__(self):
return self
def __next__(self):
self.next()
|
# automatically generated by the FlatBuffers compiler, do not modify
# namespace: papi
class Side(object):
Sell = -1
None_ = 0
Buy = 1
|
class DriverTarget:
bone_target = None
data_path = None
id = None
id_type = None
transform_space = None
transform_type = None
|
N = int(input())
road_ends = []
barns_list = []
for x in range(0, N):
barns_list.append(x)
for x in range(0, N):
road_ends.append(-1)
for x in range(0, N-1):
temp_list = input().split()
road_ends[int(temp_list[1])-1] = int(temp_list[0])-1
for x in range(0, N):
wasthere = []
... |
def grade(arg, key):
if "flag{1_h4v3_4_br41n}".lower() == key.lower():
return True, "You are not insane!"
else:
return False, "..."
|
def selection_form(data, target, name, radio=False):
body = ''
for i in data:
body += '<input value="{0}" name="{1}" type="{2}"> {0}</br>'.format(i, name, 'radio' if radio else 'checkbox')
body += '</br><input type="submit" value="Submit">'
return '<form method="post" action="{0}">{1}</form>'.format(target, body)... |
def resolve():
'''
code here
'''
N = int(input())
As = [int(item) for item in input().split()]
Bs = [int(item) for item in input().split()]
Ds = [a - b for a, b in zip(As, Bs)]
cnt_minus = 0
total_minus = 0
minus_list = []
cnt_plus_to_drow = 0
plus_list = []
for i... |
# We your solution for 1.4 here!
def is_prime(x):
t=1
while t<x:
if x%t==0:
if t!=1 and t!=x:
return False
t=t+1
return True
print(is_prime(5191))
|
{
"targets": [
{
"target_name": "knit_decoder",
"sources": ["src/main.cpp", "src/context.hpp", "src/worker.hpp"],
"include_dirs" : [
"<!(node -e \"require('nan')\")"
],
"cflags_cc!": ["-fno-rtti", "-fno-exceptions"],
"cflags!": ["-fno-exceptions", "-Wall", "-std=c++11"]... |
"""
:authors: v.oficerov
:license: MIT
:copyrighting: 2022 www.sqa.engineer
"""
__author__ = 'v.oficerov'
__version__ = '0.3.1'
__email__ = 'valeryoficerov@gmail.com'
|
class Properties:
def __init__(self, client):
self.client = client
def search(self, params={}):
url = '/properties'
property_params = {'property': params}
return self.client.request('GET', url, property_params)
|
#Nicolas Andrade de Freitas - Turma 2190
#Exercicio 26
m2 = float(input("Digite o valor em m²"))
h = m2*0.0001
print("o valor {}m² em hectares é:{}".format(m2,h))
|
'''
面试题55 - I. 二叉树的深度
输入一棵二叉树的根节点,求该树的深度。从根节点到叶节点依次经过的节点(含根、叶节点)形成树的一条路径,最长路径的长度为树的深度。
例如:
给定二叉树 [3,9,20,null,null,15,7],
3
/ \
9 20
/ \
15 7
返回它的最大深度 3 。
提示:
节点总数 <= 10000
执行用时 :52 ms, 在所有 Python3 提交中击败了57.39%的用户
内存消耗 :14.9 MB, 在所有 Python3 提交中击败了100.00%的用户
'''
# Definition for a binary tree node.... |
DISCOUNT_TYPES = (
('percent', 'درصدی'),
('fixed', 'مقدار ثابت'),
)
DISCOUNT_ITEM_TYPES = (
('hotel', 'هتل'),
('room', 'اتاق'),
)
DISCOUNT_CACHE_KEY = 'discount_{}'
DISCOUNT_ALL_INFO_CACHE_KEY = 'discount_detailed_{}'
|
class Solution:
def longestPalindrome(self, s: str) -> int:
total = 0
for i in collections.Counter(list(s)).values():
total += i // 2 * 2
if i % 2 == 1 and total % 2 == 0:
total += 1
return total |
def build_question_context(rendered_block, form):
question = rendered_block["question"]
context = {
"block": rendered_block,
"form": {
"errors": form.errors,
"question_errors": form.question_errors,
"mapped_errors": form.map_errors(),
"answer_erro... |
class Product:
def __init__(self, id, isOwner, name, description, main_img):
self.id = id
self.isOwner = isOwner
self.name = name
self.description = description
self.main_img = main_img
self.images = []
self.stock = {}
self.price = {}
def add_imag... |
# File: difference_of_squares.py
# Purpose: To find th difference of squares of first n numbers
# Programmer: Amal Shehu
# Course: Exercism
# Date: Saturday 3rd September 2016, 01:50 PM
def sum_of_squares(number):
return sum([i**2 for i in range(1, number+1)])
def square_of_sum(number):
... |
class InvalidOperationError(BaseException):
pass
class Node():
def __init__(self, value, next = None):
self.value = value
self.next = next
class AnimalShelter():
def __init__(self):
self.front = None
self.rear = None
def __str__(self):
# FRONT -> { a } -> {... |
"""
"""
def compute(address, mask):
""" Funkcja przeliczająca adres IP.
Args:
address (str): Adres IP.
mask (str): Maska IP.
Returns:
str: Binary address name.
str: Klasa.
str: Adres rozgłoszeniowy.
str: Zakres górny.
... |
#!/usr/bin/env python3
"""Adds commands that need to be executed after the container starts."""
ENTRYPOINT_FILE = "/usr/local/bin/docker-entrypoint.sh"
UPDATE_HOSTS_COMMAND = ("echo 127.0.0.1 c1 c2 c3 c4 c5 c6 c7 c8 c9 c10"
" >> /etc/hosts\n")
RUN_SSHD_COMMAND = "/usr/sbin/sshd\n"
EXEC_LINE ... |
#!/usr/bin/env python3
# -*- coding: UTF-8 -*-
# If-else-if flow control.
marks = 84
if 80 < marks and 100 >= marks:
print("A")
elif 60 < marks and 80 >= marks:
print("B")
elif 50 < marks and 60 >= marks:
print("C")
elif 35 < marks and 50 >= marks:
print("S")
else:
print("F")
# Iteration/loop flo... |
symbol748 = {}
def _update(code_748, code_gbk, numchars):
for i in range(numchars):
symbol748[code_748 + i] = code_gbk + i
_update(0x8EFF, 0x8E8F, 1) # 8EFF -> 8E8F
_update(0x94FF, 0x94DA, 1) # 94FF -> 94DA
_update(0x95FF, 0x95F1, 1) # 95FF -> 95F1
_update(0x9680, 0xB17E, 1) # 9680 -> B17E
_update... |
# The method below seems to yield correct result but will end in TLE for large cases.
# def candy(ratings) -> int:
# n = len(ratings)
# candies = [0]*n
# while True:
# changed = False
# for i in range(1, n):
# if ratings[i-1] < ratings[i] and candies[i-1]... |
def InsertionSort(array):
for i in range(1,len(array)):
current = array[i]
j = i-1
while(j >= 0 and current < array[j]):
array[j+1] = array[j]
j -= 1
array[j+1] = current
array = [32,33,1,0,23,98,-19,15,7,-52,76]
print("Before sort: ")
print(*array,sep=', ')
print("After sort: ")
InsertionSort(array)
pri... |
"""Skylark extension for terraform_sut_component."""
load("//skylark:toolchains.bzl", "toolchain_container_images")
load("//skylark:integration_tests.bzl", "sut_component")
def terraform_sut_component(name, tf_files, setup_timeout_seconds=None, teardown_timeout_seconds=None):
# Create a list of terraform file locat... |
class JobErrorCode:
""" Error Codes returned by Job related operations """
NoError = 0
JobNotFound = 1
MultipleJobsFound = 2
JobFailed = 3
SubmitNotAllowed = 4
ErrorOccurred = 5
InternalSchedulerError = 6
JobUnsanitary = 7
Executable... |
HTTP_OK = 200
HTTP_UNAUTHORIZED = 401
HTTP_FOUND = 302
HTTP_BAD_REQUEST = 400
HTTP_NOT_FOUND = 404
HTTP_SERVICE_UNAVAILABLE = 503
|
x=int(input("enter x1"))
y=int(input("enter x2"))
c=x*y
print(c)
|
mode = 2
host = "ftp.gportal.jaxa.jp"
user = "id"
pw = "pw"
TargetFor = ".h5"
lat = [0, 20]
lon = [100, 150]
start = [2021, 10, 10, 10]
end = [2021, 10, 10, 12]
delta = "H"
ElementNum = -1
"""
-----------------以下メモ欄-----------------
〇 mode : 0:ダウン... |
coordinates_E0E1E1 = ((126, 112),
(126, 114), (126, 115), (126, 130), (126, 131), (127, 113), (127, 115), (127, 131), (128, 92), (128, 115), (128, 116), (128, 121), (128, 131), (129, 92), (129, 116), (129, 118), (129, 119), (129, 131), (130, 92), (130, 117), (130, 122), (130, 131), (131, 87), (131, 89), (131, 90), (1... |
books = input().split("&")
while True:
commands = input().split(" | ")
if commands[0] == "Done":
print(", ".join(books))
break
elif commands[0] == "Add Book":
book_name = commands[1]
if book_name not in books:
ins = books.insert(0, book_name)
else:
... |
'''Crie um programa que leia duas notas de uma aluno e calcule sua média,
mostrando uma mensagem no final, de acordo com a média atingida:
-Média abaixo de 5.0: REPROVADO;
-Média entre 5.0 e 6.9: RECUPERAÇÃO;
-Média 7.0 ou superior: APROVADO'''
nome = str(input('Qual o nome do aluno?: ')).strip().capitalize()
na1 = flo... |
'''
This utility is for Custom Exceptions.
a) Stop_Test_Exception
You can raise a generic exceptions using just a string.
This is particularly useful when you want to end a test midway based on some condition.
'''
class Stop_Test_Exception(Exception):
def __init__(self,message):
self.message=message
... |
class Node:
def __init__(self, value):
self.val = value
self.next = self.prev = None
class MyLinkedList(object):
def __init__(self):
self.__head = self.__tail = Node(-1)
self.__head.next = self.__tail
self.__tail.prev = self.__head
self.__size = 0
def get(... |
class NotFound(Exception):
pass
class HTTPError(Exception):
pass
|
#!/usr/bin/env python
"""Common constants."""
IO_CHUNK_SIZE = 128
|
#!/usr/bin/python
# -*- coding: utf-8 -*-
__author__ = 'liyiqun'
# microsrv_linkstat_url = 'http://127.0.0.1:32769/microsrv/link_stat'
# microsrv_linkstat_url = 'http://127.0.0.1:33710/microsrv/link_stat'
# microsrv_linkstat_url = 'http://10.9.63.208:7799/microsrv/ms_link/link/links'
# microsrv_linkstat_url = '... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.