content
stringlengths
7
1.05M
fixed_cases
stringlengths
1
1.28M
""" A module storing strings used to display messages. """ INVALID_INTERNAL_RESAMPLING_OPTIMAL = "Invalid CAT12 configuration! Resampling type 'optimal' can only be set with an internal resampling value of 1. Valid configuration coerced." INVALID_INTERNAL_RESAMPLING_FIXED = "Invalid CAT12 configuration! Resampling typ...
""" A module storing strings used to display messages. """ invalid_internal_resampling_optimal = "Invalid CAT12 configuration! Resampling type 'optimal' can only be set with an internal resampling value of 1. Valid configuration coerced." invalid_internal_resampling_fixed = "Invalid CAT12 configuration! Resampling type...
command = input() compare_string_lower = {"coding", "dog", "cat", "movie"} compare_string_upper = {"CODING", "DOG", "CAT", "MOVIE"} coffee = 0 get_sleep = False while not command == "END": if command.isupper() and command in compare_string_upper: coffee += 2 if command.islower() and command in compare_s...
command = input() compare_string_lower = {'coding', 'dog', 'cat', 'movie'} compare_string_upper = {'CODING', 'DOG', 'CAT', 'MOVIE'} coffee = 0 get_sleep = False while not command == 'END': if command.isupper() and command in compare_string_upper: coffee += 2 if command.islower() and command in compare_s...
"""Various useful string conversions utilities for XRPL.""" def str_to_hex(input: str) -> str: """ Convert a UTF-8-encoded string into hexadecimal encoding. XRPL uses hex strings as inputs in fields like `domain` in the `AccountSet` transaction. Args: input: UTF-8-encoded string to conver...
"""Various useful string conversions utilities for XRPL.""" def str_to_hex(input: str) -> str: """ Convert a UTF-8-encoded string into hexadecimal encoding. XRPL uses hex strings as inputs in fields like `domain` in the `AccountSet` transaction. Args: input: UTF-8-encoded string to convert...
print('nice' in 'nice to meet you') a=1000000 b=1000000 c=a+b print(c)
print('nice' in 'nice to meet you') a = 1000000 b = 1000000 c = a + b print(c)
a = 1 b = 1 while 32 >= a: print(a,-b) b *= 2 a += 1 print("Year",b/365)
a = 1 b = 1 while 32 >= a: print(a, -b) b *= 2 a += 1 print('Year', b / 365)
# Please contact the author(s) of this library if you have any questions. # Authors: Kai-Chieh Hsu ( kaichieh@princeton.edu ) class _scheduler(object): def __init__(self, last_epoch=-1, verbose=False): self.cnt = last_epoch self.verbose = verbose self.variable = None self.step() ...
class _Scheduler(object): def __init__(self, last_epoch=-1, verbose=False): self.cnt = last_epoch self.verbose = verbose self.variable = None self.step() def step(self): self.cnt += 1 value = self.get_value() self.variable = value def get_value(self...
#!/usr/bin/env python3 inp = [] with open('03.txt') as fp: for line in fp: inp.append(line.strip()) def part1(arr): acc = [0] * len(arr[0]) for x in arr: for i in range(len(x)): acc[i] += int(x[i]) gamma = list(map(lambda x: '1' if x >= len(arr)/2.0 else '0', acc)) eps...
inp = [] with open('03.txt') as fp: for line in fp: inp.append(line.strip()) def part1(arr): acc = [0] * len(arr[0]) for x in arr: for i in range(len(x)): acc[i] += int(x[i]) gamma = list(map(lambda x: '1' if x >= len(arr) / 2.0 else '0', acc)) epsilon = list(map(lambda ...
# ac N = int(input()) A = list(map(int,input().split())) mid = int(2**N/2) left, right = A[:mid], A[mid:] second = min(max(left), max(right)) print(A.index(second)+1)
n = int(input()) a = list(map(int, input().split())) mid = int(2 ** N / 2) (left, right) = (A[:mid], A[mid:]) second = min(max(left), max(right)) print(A.index(second) + 1)
"""Exceptions for Unmanic.""" class UnmanicError(Exception): """Generic Unmanic Exception.""" pass class UnmanicBadRequestRequestedEndpointNotFoundError(UnmanicError): """Unmanic bad request endpoint not found exception.""" pass class UnmanicBadRequestRequestedMethodNotAllowedError(UnmanicError)...
"""Exceptions for Unmanic.""" class Unmanicerror(Exception): """Generic Unmanic Exception.""" pass class Unmanicbadrequestrequestedendpointnotfounderror(UnmanicError): """Unmanic bad request endpoint not found exception.""" pass class Unmanicbadrequestrequestedmethodnotallowederror(UnmanicError): ...
# eln:decorators READERS = dict() # Decorator for adding reader functions def register_reader(function): READERS[function.__name__] = function return function
readers = dict() def register_reader(function): READERS[function.__name__] = function return function
# -*- coding: utf-8 -*- ''' File name: code\permuted_matrices\sol_559.py Author: Vaidic Joshi Date created: Oct 20, 2018 Python Version: 3.x ''' # Solution to Project Euler Problem #559 :: Permuted Matrices # # For more information see: # https://projecteuler.net/problem=559 # Problem Statement '''...
""" File name: code\\permuted_matrices\\sol_559.py Author: Vaidic Joshi Date created: Oct 20, 2018 Python Version: 3.x """ '\nAn ascent of a column j in a matrix occurs if the value of column j is smaller than the value of column j+1 in all rows.\n\nLet P(k, r, n) be the number of r x n matrices with th...
# oci-utils # # Copyright (c) 2019, 2020 Oracle and/or its affiliates. All rights reserved. # Licensed under the Universal Permissive License v 1.0 as shown # at http://oss.oracle.com/licenses/upl. """ Module with oci migrate related exceptions. """ class OciMigrateException(Exception): """ Exceptions for the Im...
""" Module with oci migrate related exceptions. """ class Ocimigrateexception(Exception): """ Exceptions for the Image Migrate to OCI context. """ __args = None def __init__(self, message=None): """ Initialisation of the Oci Migrate Exception. Parameters ---------- ...
def assert_valid_git_hub_url(edit_on_github_url: str, page_path: str): # Do you like to include yet another organization? Thing twice :) url_lower = edit_on_github_url.lower() assert \ url_lower.startswith('https://github.com/JetBrains/'.lower()) \ or \ url_lower.startswith('https:...
def assert_valid_git_hub_url(edit_on_github_url: str, page_path: str): url_lower = edit_on_github_url.lower() assert url_lower.startswith('https://github.com/JetBrains/'.lower()) or url_lower.startswith('https://github.com/kotlin/'.lower()), 'Check `edit_on_github_url` for `' + page_path + '` to be either `JetB...
class RigPacket: def __init__(self, velocity=0, direction=0): self.velocity = velocity self.direction = direction
class Rigpacket: def __init__(self, velocity=0, direction=0): self.velocity = velocity self.direction = direction
""" This package represents Presentation layer. Put your views for different API. Your views should use services from Application layer, without implementing logic and only preparing given data from request for services and formatting it for response. All of sub-packages should use the same services interfaces, diffe...
""" This package represents Presentation layer. Put your views for different API. Your views should use services from Application layer, without implementing logic and only preparing given data from request for services and formatting it for response. All of sub-packages should use the same services interfaces, diffe...
""" A direct child HAS TO define required class variables (pseudo "abstract"). """ class ClassWithAbstractVariables(object): @classmethod def __init_subclass__(cls): required_class_variables = [ 'abstract_class_variables_0', 'abstract_class_variables_1', 'abstract_...
""" A direct child HAS TO define required class variables (pseudo "abstract"). """ class Classwithabstractvariables(object): @classmethod def __init_subclass__(cls): required_class_variables = ['abstract_class_variables_0', 'abstract_class_variables_1', 'abstract_class_variables_2'] for var in...
#!/usr/bin/env python # Copyright Contributors to the Open Shading Language project. # SPDX-License-Identifier: BSD-3-Clause # https://github.com/AcademySoftwareFoundation/OpenShadingLanguage command += testshade("-t 1 -g 256 256 -od uint8 -o Cout out_varying_index_float.tif test_varying_index_float") command += tes...
command += testshade('-t 1 -g 256 256 -od uint8 -o Cout out_varying_index_float.tif test_varying_index_float') command += testshade('-t 1 -g 256 256 -od uint8 -o Cout out_varying_index_int.tif test_varying_index_int') command += testshade('-t 1 -g 256 256 -od uint8 -o Cout out_varying_index_string.tif test_varying_inde...
def fibonacci_element(n, computed = {0: 0, 1: 1}): """ calculate N'th Fibonacci number. """ if n not in computed: computed[n] = fibonacci_element(n-1, computed) + fibonacci_element(n-2, computed) return computed[n] def sequence_calc(nterms = 1): """ Calculate Fibonacci sequence from start """...
def fibonacci_element(n, computed={0: 0, 1: 1}): """ calculate N'th Fibonacci number. """ if n not in computed: computed[n] = fibonacci_element(n - 1, computed) + fibonacci_element(n - 2, computed) return computed[n] def sequence_calc(nterms=1): """ Calculate Fibonacci sequence from start """ ...
def task1(s): """ Function which receives a sequence of comma-separated numbers and generate a list and a tuple which contains every number Input: string with comma separated numbers Output: list and tuple with all the numbers """ pass def task2(): """ Function which receives a se...
def task1(s): """ Function which receives a sequence of comma-separated numbers and generate a list and a tuple which contains every number Input: string with comma separated numbers Output: list and tuple with all the numbers """ pass def task2(): """ Function which receives a seq...
NL_MATERIAL = { "math": { "title": "Didactiek van wiskundig denken", "text": "Leermateriaal over wiskunde en didactiek op de universiteit.", "url": "https://maken.wikiwijs.nl/91192/Wiskundedidactiek_en_ICT", "files": [ [{ "mime_type": "application/x-zip", ...
nl_material = {'math': {'title': 'Didactiek van wiskundig denken', 'text': 'Leermateriaal over wiskunde en didactiek op de universiteit.', 'url': 'https://maken.wikiwijs.nl/91192/Wiskundedidactiek_en_ICT', 'files': [[{'mime_type': 'application/x-zip', 'url': 'https://maken.wikiwijs.nl/91192/Wiskundedidactiek_en_ICT', '...
# Suppose the cover price of a book is $24.95, but bookstores get a 40% discount. # Shipping costs $3 for the first copy and 75 cents for each additional copy. # What is the total wholesale cost for 60 copies? print(round((24.95 - (24.95 * (40 / 100))) * 60 + 3 + 0.75 * 59, 2))
print(round((24.95 - 24.95 * (40 / 100)) * 60 + 3 + 0.75 * 59, 2))
''' Global Variables Variables that are created outside of a function (as in all of the examples above) are known as global variables. Global variables can be used by everyone, both inside of functions and outside. ''' #Example #Create a variable outside of a function, and use it inside the function x = "awesome" ...
""" Global Variables Variables that are created outside of a function (as in all of the examples above) are known as global variables. Global variables can be used by everyone, both inside of functions and outside. """ x = 'awesome' def myfunction(): print('python is ' + x) myfunction() '\n\nIf you create a var...
''' 5. b. To get a string from a given string where all occurrences of its first char have been changed to '$', except the first char itself. ''' word = input("Enter a long word: ") #arastratiosphecomyia first_char = word[0] # set first character of our string to first_char variable new_string = fi...
""" 5. b. To get a string from a given string where all occurrences of its first char have been changed to '$', except the first char itself. """ word = input('Enter a long word: ') first_char = word[0] new_string = first_char for pointer in word[1:]: if pointer == first_char: new_string += '$' ...
points = [[0, 0]] n = int(input()) for i in range(n): x, y = map(int, input().split()) points.append([x, y]) distance_pairs = [] for i in range(n + 1): for j in range(i, n + 1): dx = points[i][0] - points[j][0] dy = points[i][1] - points[j][1] distance_pairs.append([dx ** 2 + dy ** 2, i, j]) distanc...
points = [[0, 0]] n = int(input()) for i in range(n): (x, y) = map(int, input().split()) points.append([x, y]) distance_pairs = [] for i in range(n + 1): for j in range(i, n + 1): dx = points[i][0] - points[j][0] dy = points[i][1] - points[j][1] distance_pairs.append([dx ** 2 + dy **...
''' NetworkX betweenness centrality on a social network Betweenness centrality is a node importance metric that uses information about the shortest paths in a network. It is defined as the fraction of all possible shortest paths between any pair of nodes that pass through the node. NetworkX provides the nx.betweennes...
""" NetworkX betweenness centrality on a social network Betweenness centrality is a node importance metric that uses information about the shortest paths in a network. It is defined as the fraction of all possible shortest paths between any pair of nodes that pass through the node. NetworkX provides the nx.betweennes...
#Desafio MDC def mdc(numeros): pass if __name__ == '__main__': print(mdc([21, 7])) #7 print(mdc([125, 40])) #5 print(mdc([9, 564, 66, 3])) #3 print(mdc([55, 22])) #11 print(mdc([15, 150])) #15 print(mdc([7, 9])) #1
def mdc(numeros): pass if __name__ == '__main__': print(mdc([21, 7])) print(mdc([125, 40])) print(mdc([9, 564, 66, 3])) print(mdc([55, 22])) print(mdc([15, 150])) print(mdc([7, 9]))
N = int(input()) K = int(input()) print(K % N)
n = int(input()) k = int(input()) print(K % N)
""" def -> Used to define new functions -> Binds a function object to a name -> Executed at runtime """
""" def -> Used to define new functions -> Binds a function object to a name -> Executed at runtime """
'''Test file for file_path_operations.py.''' master = FileMaster('/Users/person1/Pictures/house.png') test.describe('Description Test Cases') test.assert_equals(master.extension(), 'png') test.assert_equals(master.filename(), 'house') test.assert_equals(master.dirpath(), '/Users/person1/Pictures/')
"""Test file for file_path_operations.py.""" master = file_master('/Users/person1/Pictures/house.png') test.describe('Description Test Cases') test.assert_equals(master.extension(), 'png') test.assert_equals(master.filename(), 'house') test.assert_equals(master.dirpath(), '/Users/person1/Pictures/')
'''solved, super easy''' class Solution: def removeElement(self, nums, val): """ :type nums: List[int] :type val: int :rtype: int """ i = 0 while i < len(nums): if nums[i] == val: del nums[i] else: i += ...
"""solved, super easy""" class Solution: def remove_element(self, nums, val): """ :type nums: List[int] :type val: int :rtype: int """ i = 0 while i < len(nums): if nums[i] == val: del nums[i] else: i +...
class Solution: # @param {int[]} nums a set of distinct positive integers # @return {int[]} the largest subset def largestDivisibleSubset(self, nums): # Write your code here if not nums: return 0 nums = sorted(nums) # n = len(nums) dp, prev =...
class Solution: def largest_divisible_subset(self, nums): if not nums: return 0 nums = sorted(nums) (dp, prev) = ({}, {}) for num in nums: dp[num] = 1 prev[num] = -1 last_num = nums[0] for num in nums: for factor in sel...
""" @Date: 2021/11/06 @description: """
""" @Date: 2021/11/06 @description: """
def complicated_logic(first, second): print(f"You passed: {first}, {second}") # return first + second * 12 - 4 * 12 number1 = 10 number2 = 3 result = complicated_logic(number1, number2) print(result)
def complicated_logic(first, second): print(f'You passed: {first}, {second}') number1 = 10 number2 = 3 result = complicated_logic(number1, number2) print(result)
class Solution: def powerfulIntegers(self, x: int, y: int, bound: int) -> List[int]: ans = set() for i in range(bound): if pow(x,i) > bound or (x==1 and i>0): break for j in range(bound): if pow(y,j) > bound or (y==1 and j>0): ...
class Solution: def powerful_integers(self, x: int, y: int, bound: int) -> List[int]: ans = set() for i in range(bound): if pow(x, i) > bound or (x == 1 and i > 0): break for j in range(bound): if pow(y, j) > bound or (y == 1 and j > 0): ...
class Node(): def __init__(self, val): self.val = val self.right = None self.left = None def insert(root, val): if root is None: return Node(val) elif val < root.val: root.left = insert(root.left, val) elif val > root.val: root.right = insert(root.right,...
class Node: def __init__(self, val): self.val = val self.right = None self.left = None def insert(root, val): if root is None: return node(val) elif val < root.val: root.left = insert(root.left, val) elif val > root.val: root.right = insert(root.right, v...
input() num = set(map(int,input().split())) prime = set([i for i in range(3,max(num)+1,2)]) for i in range(3,max(num)+1,2): if i in prime: prime -= set([i for i in range(i*2,max(num)+1,i)]) prime.add(2) print(len(num.intersection(prime)))
input() num = set(map(int, input().split())) prime = set([i for i in range(3, max(num) + 1, 2)]) for i in range(3, max(num) + 1, 2): if i in prime: prime -= set([i for i in range(i * 2, max(num) + 1, i)]) prime.add(2) print(len(num.intersection(prime)))
class TestOptimizeO: """Test interaction of -O flag and optimize parameter of compile.""" def setup_method(self, method): space = self.space self._w_flags = space.sys.get('flags') # imitate -O space.appexec([], """(): import sys flags = list(sys.flags) ...
class Testoptimizeo: """Test interaction of -O flag and optimize parameter of compile.""" def setup_method(self, method): space = self.space self._w_flags = space.sys.get('flags') space.appexec([], '():\n import sys\n flags = list(sys.flags)\n flags[3] =...
# draw a rectangle # rect(x, y, width, height) rect(20, 50, 100, 200) rect(130, 50, 100, 200) oval(240, 50, 100, 200) oval(20, 250, 100, 100) oval(130, 250, 100, 100) rect(240, 250, 100, 100) for x in range(20, 300, 50): rect(x, 370, 40, 40) for x in range(20, 300, 50): if random() > 0.5: rect(x,...
rect(20, 50, 100, 200) rect(130, 50, 100, 200) oval(240, 50, 100, 200) oval(20, 250, 100, 100) oval(130, 250, 100, 100) rect(240, 250, 100, 100) for x in range(20, 300, 50): rect(x, 370, 40, 40) for x in range(20, 300, 50): if random() > 0.5: rect(x, 420, 40, 40) else: oval(x, 420, 40, 40)
""" Pagination support code. """ BUFFER = 5 def paginator(page_num, max_page, buffer_size=BUFFER): """ Pagination generator. Generates a sequence of page numbers, giving the pages at the beginning and end, and around the current page, with a number of buffer pages on each side of both. Omitted ...
""" Pagination support code. """ buffer = 5 def paginator(page_num, max_page, buffer_size=BUFFER): """ Pagination generator. Generates a sequence of page numbers, giving the pages at the beginning and end, and around the current page, with a number of buffer pages on each side of both. Omitted pag...
scores = { "John": 81.5, "Fred": 100, "Chad": 50, "Wopper": 30, "Katie": 73 } def calc_grade(score): if score >= 91: return "Outstanding" elif score >= 81: return "Exceeds Expectations" elif score >= 71: return "Acceptable" elif score >= 61: return "...
scores = {'John': 81.5, 'Fred': 100, 'Chad': 50, 'Wopper': 30, 'Katie': 73} def calc_grade(score): if score >= 91: return 'Outstanding' elif score >= 81: return 'Exceeds Expectations' elif score >= 71: return 'Acceptable' elif score >= 61: return 'Needs Improvement' ...
# eval utils def statistics_degrees(A_in): """ Compute min, max, mean degree Parameters ---------- A_in: sparse matrix or np.array The input adjacency matrix. Returns ------- d_max. d_min, d_mean """ degrees = A_in.sum(axis=0) return np.max(degrees), np.min(degree...
def statistics_degrees(A_in): """ Compute min, max, mean degree Parameters ---------- A_in: sparse matrix or np.array The input adjacency matrix. Returns ------- d_max. d_min, d_mean """ degrees = A_in.sum(axis=0) return (np.max(degrees), np.min(degrees), np.mean(d...
""" A statement function set holds a set of statement functions that can be used in statements. """ class BaseStatementFuncSet(object): """ A statement function set holds a set of statement functions that can be used in statements. """ def __init__(self): self.funcs = {} self.at_creat...
""" A statement function set holds a set of statement functions that can be used in statements. """ class Basestatementfuncset(object): """ A statement function set holds a set of statement functions that can be used in statements. """ def __init__(self): self.funcs = {} self.at_creati...
# -*- coding: utf-8 -*- """ Created on Tue Sep 3 14:53:06 2019 @author: ISHA """ arr = [ [ 'XYZ', 1, 88, 56, 45], [ 'ABC', 2, 45, 86, 52], [ 'LMN', 3, 87, 39, 40], [ 'QWS', 4, 96, 86, 85], [ 'TRE', 5, 76, 56, 53], [ 'UTH', 6, 35, 79, 48], [ ...
""" Created on Tue Sep 3 14:53:06 2019 @author: ISHA """ arr = [['XYZ', 1, 88, 56, 45], ['ABC', 2, 45, 86, 52], ['LMN', 3, 87, 39, 40], ['QWS', 4, 96, 86, 85], ['TRE', 5, 76, 56, 53], ['UTH', 6, 35, 79, 48], ['GHJ', 7, 88, 98, 88], ['DFS', 8, 72, 80, 68], ['CVB', 9, 45, 56, 50], ['PQR', 10, 78, 36, 25]] sum_col = [] ...
""" *graphical color* Spectral color measures. """ # from ._color import Color # from ._rgb import Rgba # from ._hsv import Hsba __all__ = [ "Color", "Rgba", "Hsba", ]
""" *graphical color* Spectral color measures. """ __all__ = ['Color', 'Rgba', 'Hsba']
#!/usr/bin/env python3 ''' Write a function that will find all the anagrams of a word from a list. You will be given two inputs a word and an array with words. You should return an array of all the anagrams or an empty array if there are none. ''' def anagrams(word, words): analis = [] for item in words: ...
""" Write a function that will find all the anagrams of a word from a list. You will be given two inputs a word and an array with words. You should return an array of all the anagrams or an empty array if there are none. """ def anagrams(word, words): analis = [] for item in words: if sorted(word) ==...
YEAR_CHOICES = ( (1,'First'), (2,'Second'), (3,'Third'), (4,'Fourth'), (5,'Fifth'), )
year_choices = ((1, 'First'), (2, 'Second'), (3, 'Third'), (4, 'Fourth'), (5, 'Fifth'))
# -*- coding: utf-8 -*- """ Created on Fri May 31 10:11:51 2019 @author: Administrator """ class Solution: def myPow(self, x: float, n: int) -> float: # if n == 1: # return x # if x!=0 and n == 0: # return 1 # if x == 0 and n <= 0: # return None # if n>...
""" Created on Fri May 31 10:11:51 2019 @author: Administrator """ class Solution: def my_pow(self, x: float, n: int) -> float: if n < 0: n = -n x = 1.0 / x ans = 1 cp = x while n >= 1: ans = ans * cp ** (n % 2) cp *= cp ...
# day 6... # count distinct questions or whatever # parse forms from input file. Split by group! def parse_forms(file): raw = file.read() # Ths smushes each group's responses together, to better facilitate part 1. # I'm sure I'll regret this in part 2. # grouplist = ["".join(p.splitlines()) for p in r...
def parse_forms(file): raw = file.read() grouplist = [p.splitlines() for p in raw.split('\n\n')] return grouplist def main(): with open('input/day6.txt') as f: group_list = parse_forms(f) sumcounts1 = 0 sumcounts2 = 0 for group in group_list: groupset = {c for c in ''.join(g...
# # PySNMP MIB module DOCS-RPHY-PTP-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/DOCS-RPHY-PTP-MIB # Produced by pysmi-0.3.4 at Wed May 1 12:53:44 2019 # On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4 # Using Python version 3.7.3 (default, Ma...
(object_identifier, octet_string, integer) = mibBuilder.importSymbols('ASN1', 'ObjectIdentifier', 'OctetString', 'Integer') (named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues') (value_range_constraint, single_value_constraint, constraints_union, constraints_intersection, value_size_constraint) ...
# -*- coding: utf-8 -*- # @Author: ZwEin # @Date: 2016-07-08 13:48:24 # @Last Modified by: ZwEin # @Last Modified time: 2016-07-08 13:48:34 def attr_func_state(attr_vals): pass
def attr_func_state(attr_vals): pass
# Domains list DOMAINS = [ { 'url': 'https://ifmo.su', 'message': '@guryn' } ] # Notifications link from https://t.me/wbhkbot WEBHOOK = ''
domains = [{'url': 'https://ifmo.su', 'message': '@guryn'}] webhook = ''
@state_trigger("sensor.power_meter != '9999'") def load_optimizer(value=None): pass
@state_trigger("sensor.power_meter != '9999'") def load_optimizer(value=None): pass
## Alphabet war ## 7 kyu ## https://www.codewars.com/kata/59377c53e66267c8f6000027 def alphabet_war(fight): l = dict(zip('wpbs', range(4,0,-1))) r = dict(zip('mqdz', range(4,0,-1))) left, right = 0,0 for char in fight: if char in l: left += l[char] elif char ...
def alphabet_war(fight): l = dict(zip('wpbs', range(4, 0, -1))) r = dict(zip('mqdz', range(4, 0, -1))) (left, right) = (0, 0) for char in fight: if char in l: left += l[char] elif char in r: right += r[char] if left > right: return 'Left side wins!' ...
"""Define routes.""" def includeme(config): """App routes.""" config.add_static_view( 'static', 'pyramid_learning_journal:static', cache_max_age=3600 ) config.add_route('home', '/') config.add_route('detail', '/journal/{id:\d+}') config.add_route('new', '/journal/new-en...
"""Define routes.""" def includeme(config): """App routes.""" config.add_static_view('static', 'pyramid_learning_journal:static', cache_max_age=3600) config.add_route('home', '/') config.add_route('detail', '/journal/{id:\\d+}') config.add_route('new', '/journal/new-entry') config.add_route('ed...
class Solution: # Codes (Accepted), O(n) time and space def replaceDigits(self, s: str) -> str: li, n = [], len(s) for i in range(0, n, 2): if i+1 < n: code = ord(s[i]) + int(s[i+1]) li += [s[i], chr(code)] else: li.append(s...
class Solution: def replace_digits(self, s: str) -> str: (li, n) = ([], len(s)) for i in range(0, n, 2): if i + 1 < n: code = ord(s[i]) + int(s[i + 1]) li += [s[i], chr(code)] else: li.append(s[i]) return ''.join(li) ...
class SubmissionStatus(object): SUBMITTED = -4 WAITING = -3 JUDGING = -2 WRONG_ANSWER = -1 ACCEPTED = 0 TIME_LIMIT_EXCEEDED = 1 IDLENESS_LIMIT_EXCEEDED = 2 MEMORY_LIMIT_EXCEEDED = 3 RUNTIME_ERROR = 4 SYSTEM_ERROR = 5 COMPILE_ERROR = 6 SCORED = 7 REJECTED = 10 JUDGE_ERROR = 11 PRETEST_PASSE...
class Submissionstatus(object): submitted = -4 waiting = -3 judging = -2 wrong_answer = -1 accepted = 0 time_limit_exceeded = 1 idleness_limit_exceeded = 2 memory_limit_exceeded = 3 runtime_error = 4 system_error = 5 compile_error = 6 scored = 7 rejected = 10 judg...
""" Given a string str, we need to extract the symbols and words of the string in order. Example 1: input: str = "(hi (i am)bye)" outut:["(","hi","(","i","am",")","bye",")"]. Explanation:Separate symbols and words. Solution: Go through the str, push the alphabetical into stack and append it to res list if we meet a...
""" Given a string str, we need to extract the symbols and words of the string in order. Example 1: input: str = "(hi (i am)bye)" outut:["(","hi","(","i","am",")","bye",")"]. Explanation:Separate symbols and words. Solution: Go through the str, push the alphabetical into stack and append it to res list if we meet a...
# -*- coding: utf-8 -*- """ Created on Wed Nov 20 13:51:55 2019 @author: nehap """ """ Input: 5 Output : * * * * * * * * * * * * * * * """ if __name__=="__main__": n = int(input("Input: ")) #Initial Spaces k=n-1 print("Output :") #Outer loop - controlling number of rows for ...
""" Created on Wed Nov 20 13:51:55 2019 @author: nehap """ '\nInput: 5\nOutput :\n* * * * *\n * * * *\n * * * \n * * \n *\n' if __name__ == '__main__': n = int(input('Input: ')) k = n - 1 print('Output :') for i in range(n, 0, -1): for j in range(i, n, 1): print(end=' ') ...
str1 = "Liu Kang " str2 = "Johnny Cage " str3 = "Scorpion " str4 = "Sub-Zero " str5 = "Sonya " str6 = "Test yo might! " print(str1 + str2 + str3 + str4 + str5 + str6) print(str3 * 5) print(str3 * (5 + 4)) print(str3 * 5 + "4") today = "Tuesday" # bool - in operator print("day" in today) print("scorpion" in today) ...
str1 = 'Liu Kang ' str2 = 'Johnny Cage ' str3 = 'Scorpion ' str4 = 'Sub-Zero ' str5 = 'Sonya ' str6 = 'Test yo might! ' print(str1 + str2 + str3 + str4 + str5 + str6) print(str3 * 5) print(str3 * (5 + 4)) print(str3 * 5 + '4') today = 'Tuesday' print('day' in today) print('scorpion' in today)
# pylint: disable=missing-docstring def stupid_function(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9): # [too-many-arguments] return arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9
def stupid_function(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9): return (arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9)
class DsapiParams: def __init__(self, limit=1, bundles = [], role=None, tenant=None, format = 'json'): self.limit = limit self.bundles = bundles self.role = role self.tenant = tenant self.format = format def formatForRequest(self): formattedString = '?' n...
class Dsapiparams: def __init__(self, limit=1, bundles=[], role=None, tenant=None, format='json'): self.limit = limit self.bundles = bundles self.role = role self.tenant = tenant self.format = format def format_for_request(self): formatted_string = '?' n...
def decode_flag(value, alphabet): # Construct inverse alphabet. map_inv = [0]*len(alphabet) for i in range(len(alphabet)): map_inv[alphabet[i]] = i # Apply. result = bytearray() for i in range(len(value)): c = value[i] if i % 2 == 1: c -= 1 cc = map_...
def decode_flag(value, alphabet): map_inv = [0] * len(alphabet) for i in range(len(alphabet)): map_inv[alphabet[i]] = i result = bytearray() for i in range(len(value)): c = value[i] if i % 2 == 1: c -= 1 cc = map_inv[c] result.append(cc) return res...
### ### Copyright (C) 2019-2022 Intel Corporation ### ### SPDX-License-Identifier: BSD-3-Clause ### subsampling = { "Y800" : ("YUV400", 8), "I420" : ("YUV420", 8), "NV12" : ("YUV420", 8), "YV12" : ("YUV420", 8), "P010" : ("YUV420", 10), "P012" : ("YUV420", 12), "I010" : ("YUV420", 10), "422H" : ("Y...
subsampling = {'Y800': ('YUV400', 8), 'I420': ('YUV420', 8), 'NV12': ('YUV420', 8), 'YV12': ('YUV420', 8), 'P010': ('YUV420', 10), 'P012': ('YUV420', 12), 'I010': ('YUV420', 10), '422H': ('YUV422', 8), '422V': ('YUV422', 8), 'YUY2': ('YUV422', 8), 'Y210': ('YUV422', 10), 'Y212': ('YUV422', 12), '444P': ('YUV444', 8), '...
# Definition for a binary tree node. class TreeNode(object): def __init__(self, x): self.val = x self.left = None self.right = None class Solution(object): def maxDepth(self, root): """ :type root: TreeNode :rtype: int """ height_left = self.ma...
class Treenode(object): def __init__(self, x): self.val = x self.left = None self.right = None class Solution(object): def max_depth(self, root): """ :type root: TreeNode :rtype: int """ height_left = self.maxDepth(root.left) height_righ...
class Matrix: def __init__(self, matrix_string): self.row_string = matrix_string.splitlines() self.matrix = [[int(num) for num in row.split()] for row in self.row_string] def row(self, index): return self.matrix[index -1] def column(self, index): return [row[index -1] for r...
class Matrix: def __init__(self, matrix_string): self.row_string = matrix_string.splitlines() self.matrix = [[int(num) for num in row.split()] for row in self.row_string] def row(self, index): return self.matrix[index - 1] def column(self, index): return [row[index - 1] fo...
""" Genre class """ class Genre(object): """ Represents a genre for MyMusic Key properties are: * `id` - ID of the artist (Amazon ASIN) * `name` - Artist name. * `coverUrl` - URL containing cover art for the artist. * `genre` - Genre of the album. * `rating` - Average review score (ou...
""" Genre class """ class Genre(object): """ Represents a genre for MyMusic Key properties are: * `id` - ID of the artist (Amazon ASIN) * `name` - Artist name. * `coverUrl` - URL containing cover art for the artist. * `genre` - Genre of the album. * `rating` - Average review score (out...
class DataClassFile(): def functionName1(self): """ One Function (without parameters) with one test function (with single line comments) where the documentation had not been generated. """ say = "say" fu = "fu" return say + " " + fu
class Dataclassfile: def function_name1(self): """ One Function (without parameters) with one test function (with single line comments) where the documentation had not been generated. """ say = 'say' fu = 'fu' return say + ' ' + fu
class Solution(object): def myAtoi(self, _str): """ :type str: str :rtype: int """ valid = set(['1', '2', '3', '4', '5', '6', '7', '8', '9', '0']) signs = set(['-', '+']) ns = [] ss = _str.strip() if len(ss) == 0: return 0 f...
class Solution(object): def my_atoi(self, _str): """ :type str: str :rtype: int """ valid = set(['1', '2', '3', '4', '5', '6', '7', '8', '9', '0']) signs = set(['-', '+']) ns = [] ss = _str.strip() if len(ss) == 0: return 0 ...
#coding=utf-8 """ __create_time__ = '13-10-29' __author__ = 'Madre' """
""" __create_time__ = '13-10-29' __author__ = 'Madre' """
""" LeetCode Problem: 694. Number of Distinct Islands Link: https://leetcode.com/problems/number-of-distinct-islands/ Language: Python Written by: Mostofa Adib Shakib Time Complexity: O(n) Space Complexity: O(n) X => Start O => Out of bound or water U => Up L => Left R => Right D => Down """ class Solution: ...
""" LeetCode Problem: 694. Number of Distinct Islands Link: https://leetcode.com/problems/number-of-distinct-islands/ Language: Python Written by: Mostofa Adib Shakib Time Complexity: O(n) Space Complexity: O(n) X => Start O => Out of bound or water U => Up L => Left R => Right D => Down """ class Solution: def...
#!/usr/bin/env python """Script for producing bad_ants text files.""" JDs = [ 2458098, 2458099, 2458101, 2458102, 2458103, 2458104, 2458105, 2458106, 2458107, 2458108, 2458109, 2458110, 2458111, 2458112, 2458113, 2458114, 2458115, 2458116, 245...
"""Script for producing bad_ants text files.""" j_ds = [2458098, 2458099, 2458101, 2458102, 2458103, 2458104, 2458105, 2458106, 2458107, 2458108, 2458109, 2458110, 2458111, 2458112, 2458113, 2458114, 2458115, 2458116, 2458140] always_flagged = [0, 2, 50, 98, 136] for jd in JDs: flagged = set(always_flagged) if ...
# Leo colorizer control file for velocity mode. # This file is in the public domain. # Properties for velocity mode. properties = { "commentEnd": "*#", "commentStart": "#*", "lineComment": "##", } # Attributes dict for velocity_main ruleset. velocity_main_attributes_dict = { "default": "nu...
properties = {'commentEnd': '*#', 'commentStart': '#*', 'lineComment': '##'} velocity_main_attributes_dict = {'default': 'null', 'digit_re': '', 'escape': '', 'highlight_digits': 'true', 'ignore_case': 'true', 'no_word_sep': ''} velocity_velocity_attributes_dict = {'default': 'null', 'digit_re': '', 'escape': '', 'high...
"""Constants used in Integer. """ MAX_INT = 2 ** 31 - 1 FAILED = -2147483646.0
"""Constants used in Integer. """ max_int = 2 ** 31 - 1 failed = -2147483646.0
num_waves = 4 num_eqn = 5 num_aux = 5 # Conserved quantities sigma_11 = 0 sigma_22 = 1 sigma_12 = 2 u = 3 v = 4 # Auxiliary variables density = 0 lamda = 1 mu = 2 cp = 3 cs = 4
num_waves = 4 num_eqn = 5 num_aux = 5 sigma_11 = 0 sigma_22 = 1 sigma_12 = 2 u = 3 v = 4 density = 0 lamda = 1 mu = 2 cp = 3 cs = 4
# encoding:utf-8 class Word: def __init__(self, id, form, label): self.id = id self.org_form = form self.form = form.lower() self.label = label def __str__(self): values = [str(self.id), self.org_form, self.label] return '\t'.join(values) class Sentence: d...
class Word: def __init__(self, id, form, label): self.id = id self.org_form = form self.form = form.lower() self.label = label def __str__(self): values = [str(self.id), self.org_form, self.label] return '\t'.join(values) class Sentence: def __init__(self,...
BATCH_SIZE = 100 # Constants describing the training process. MOVING_AVERAGE_DECAY = 0.9999 # The decay to use for the moving average. NUM_EPOCHS_PER_DECAY = 50 # Epochs after which learning rate decays. LEARNING_RATE_DECAY_FACTOR = 0.1 # Learning rate decay factor. INITIAL_LEARNING_RATE = 0.001 # Ini...
batch_size = 100 moving_average_decay = 0.9999 num_epochs_per_decay = 50 learning_rate_decay_factor = 0.1 initial_learning_rate = 0.001 eval_interval_secs = 60 'How often to run the eval.' num_examples_per_epoch_for_eval = 800 eval_num_examples = 800 'Number of examples to run for eval.' eval_run_once = False 'Whether ...
def rsum(any_list): '''(list of int) -> int REQ: Length of the list must be greater than 0 This function will add up all the integers in the given list of integers >>>rsum([9,1000,-1000,57,78,0]) 144 >>>rsum([1]) 1 ''' # Base case for one element if len(any_list) == 1: # ...
def rsum(any_list): """(list of int) -> int REQ: Length of the list must be greater than 0 This function will add up all the integers in the given list of integers >>>rsum([9,1000,-1000,57,78,0]) 144 >>>rsum([1]) 1 """ if len(any_list) == 1: return any_list[0] else: ...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # This file is part of Androwarn. # # Copyright (C) 2012, 2019, Thomas Debize <tdebize at mail.com> # All rights reserved. # # Androwarn is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as published by #...
media_recorder__audio_source = {0: 'DEFAULT', 1: 'MIC', 2: 'VOICE_UPLINK', 3: 'VOICE_DOWNLINK', 4: 'VOICE_CALL', 5: 'CAMCORDER', 6: 'VOICE_RECOGNITION', 7: 'VOICE_COMMUNICATION', 8: 'REMOTE_SUBMIX', 9: 'UNPROCESSED'} media_recorder__video_source = {0: 'DEFAULT', 1: 'CAMERA', 2: 'SURFACE'} package_manager__package_info ...
# network size ict_head_size = None # checkpointing ict_load = None bert_load = None # data titles_data_path = None query_in_block_prob = 0.1 use_one_sent_docs = False # training report_topk_accuracies = [] # faiss index faiss_use_gpu = False block_data_path = None # indexer indexer_batch_size = 128 indexer_log_i...
ict_head_size = None ict_load = None bert_load = None titles_data_path = None query_in_block_prob = 0.1 use_one_sent_docs = False report_topk_accuracies = [] faiss_use_gpu = False block_data_path = None indexer_batch_size = 128 indexer_log_interval = 1000
# # PySNMP MIB module TFTIF-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/TFTIF-MIB # Produced by pysmi-0.3.4 at Wed May 1 15:16:16 2019 # On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4 # Using Python version 3.7.3 (default, Mar 27 2019, 09:23...
(object_identifier, octet_string, integer) = mibBuilder.importSymbols('ASN1', 'ObjectIdentifier', 'OctetString', 'Integer') (named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues') (constraints_intersection, constraints_union, value_size_constraint, single_value_constraint, value_range_constraint) ...
"""chfn help text""" CHSH = dict( text="""chsh changes your "shell" on Redbrick. ** WARNING - Do not use this command if you are unsure ** of what you are doing! :-) A "Shell" is the style of command line environment on RedBrick. It is essentially, the 'prompt' and set of commands that you get when you log in. ...
"""chfn help text""" chsh = dict(text='chsh changes your "shell" on Redbrick.\n\n** WARNING - Do not use this command if you are unsure\n** of what you are doing! :-)\n\nA "Shell" is the style of command line environment on RedBrick.\nIt is essentially, the \'prompt\' and set of commands that you get\nwhen you log in.\...
def partition(lista: list[int], low: int, high: int) -> int: i = low pivot = lista[high] for j in range(low, high): if lista[j] <= pivot: # swap lista[i], lista[j] = lista[j], lista[i] i += 1 lista[i], lista[high] = lista[high], lista[i] return i def f...
def partition(lista: list[int], low: int, high: int) -> int: i = low pivot = lista[high] for j in range(low, high): if lista[j] <= pivot: (lista[i], lista[j]) = (lista[j], lista[i]) i += 1 (lista[i], lista[high]) = (lista[high], lista[i]) return i def find_k(lista: l...
DATA_FOLDER = './materialist/data' TEST_FOLDER = './materialist/data/test' TRAIN_FOLDER = './materialist/data/train' VALIDATION_FOLDER = './materialist/data/validation' TEST_FILE = './materialist/data/test.json' TRAIN_FILE = './materialist/data/train.json' VALIDATION_FILE = './materialist/data/validation.json' TEST_...
data_folder = './materialist/data' test_folder = './materialist/data/test' train_folder = './materialist/data/train' validation_folder = './materialist/data/validation' test_file = './materialist/data/test.json' train_file = './materialist/data/train.json' validation_file = './materialist/data/validation.json' test_pic...
print(f'This is the python code file bar.py and my name currently is:{__name__}') if __name__ == 'bar': print(f'I was imported as a module.') print(f'bar.py __file__ variable:{__file__}') print('If the slashes in the file path lean to the right then I am __main__')
print(f'This is the python code file bar.py and my name currently is:{__name__}') if __name__ == 'bar': print(f'I was imported as a module.') print(f'bar.py __file__ variable:{__file__}') print('If the slashes in the file path lean to the right then I am __main__')
class View: @staticmethod def show_message(message): print(message) @staticmethod def get_input(): return input()
class View: @staticmethod def show_message(message): print(message) @staticmethod def get_input(): return input()
class Test: def ptr(self): print(self) print(self.__class__) class Test2: def ptr(baidu): print(baidu) print(baidu.__class__) class people: name = '' age = 0 __weight = 0 def __init__(self, n, a, w): self.name = n self.age = a self.__w...
class Test: def ptr(self): print(self) print(self.__class__) class Test2: def ptr(baidu): print(baidu) print(baidu.__class__) class People: name = '' age = 0 __weight = 0 def __init__(self, n, a, w): self.name = n self.age = a self.__w...
class LambdaContext(object): def __init__( self, request_id="request_id", function_name="my-function", function_version="v1.0", ): self.aws_request_id = request_id self.function_name = function_name self.function_version = function_version def get_rem...
class Lambdacontext(object): def __init__(self, request_id='request_id', function_name='my-function', function_version='v1.0'): self.aws_request_id = request_id self.function_name = function_name self.function_version = function_version def get_remaining_time_in_millis(self): r...
for i in range(int(input())): n,m,x,y = [int(j) for j in input().split()] if((n-1)%x==0 and (m-1)%y==0): print('Chefirnemo') elif(n-2>=0 and m-2>=0): if((n-2)%x==0 and (m-2)%y==0): print('Chefirnemo') else: print('Pofik') else: print('Pofik')
for i in range(int(input())): (n, m, x, y) = [int(j) for j in input().split()] if (n - 1) % x == 0 and (m - 1) % y == 0: print('Chefirnemo') elif n - 2 >= 0 and m - 2 >= 0: if (n - 2) % x == 0 and (m - 2) % y == 0: print('Chefirnemo') else: print('Pofik') ...
################################################### # header_common.py # This file contains common declarations. # DO NOT EDIT THIS FILE! ################################################### server_event_preset_message = 0 server_event_play_sound = 1 server_event_scene_prop_p...
server_event_preset_message = 0 server_event_play_sound = 1 server_event_scene_prop_play_sound = 2 server_event_play_sound_at_position = 3 server_event_agent_equip_armor = 4 server_event_player_set_slot = 5 server_event_scene_prop_set_slot = 6 server_event_faction_set_slot = 7 server_event_troop_set_slot = 8 server_eve...
# -*- coding: utf-8 -*- """ Created on Tue Feb 1 09:38:18 2022 @author: JHOSS """ #CONTAR LOS NUMEROS PRIMOS DEL 1 AL 100 num = 1 while num <=100: cont =1 x=0 while cont <= num: if num % cont == 0: x=x+1 cont = cont +1 if x==2: print(num) num = num +1 ...
""" Created on Tue Feb 1 09:38:18 2022 @author: JHOSS """ num = 1 while num <= 100: cont = 1 x = 0 while cont <= num: if num % cont == 0: x = x + 1 cont = cont + 1 if x == 2: print(num) num = num + 1
## class <nombre_del_objeto>: ## def <metodo_del_objeto>(self): # variable -> atributos # funciones -> metodos def hola(): print("hola a todos") hola() class Persona: def __init__(self, nombre): self.nombre = nombre def hola(self): print("Hola a todos, soy", self.nombre) de...
def hola(): print('hola a todos') hola() class Persona: def __init__(self, nombre): self.nombre = nombre def hola(self): print('Hola a todos, soy', self.nombre) def agregar_apellido(self, apellido): self.apellido = apellido def agregar_edad(self, edad): self.edad...
# # PySNMP MIB module CISCO-IETF-SCTP-EXT-CAPABILITY (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/CISCO-IETF-SCTP-EXT-CAPABILITY # Produced by pysmi-0.3.4 at Wed May 1 12:01:04 2019 # On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4 # Using Python ...
(octet_string, object_identifier, integer) = mibBuilder.importSymbols('ASN1', 'OctetString', 'ObjectIdentifier', 'Integer') (named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues') (single_value_constraint, constraints_intersection, value_size_constraint, constraints_union, value_range_constraint) ...
def first_last(s1): # [out of bound error] s2 = s1[0] + s1[1] + s1[4] + s1[5] # [out of bound error] s2 = s1[0] + s1[1] + s1[-2] + s1[-1] # [false result] s2 = s1[0:2] + s1[-2:-1] s2 = s1[0:2] + s1[-2:] # [out of bound error] s2 = s1[:2] + s1[-2] return s2 print(first_last("spring")) p...
def first_last(s1): s2 = s1[0:2] + s1[-2:] return s2 print(first_last('spring')) print(first_last('hello')) print(first_last('a')) print(first_last('abc'))
ref = [ "A00002", "A00005", "A10001", "A10002", "A10003", "A10004", "A10005", "A10006", "A10007", "A10008", "A10009", "A10010", "A10011", "A10012", "A10013", "A10014", "A10015", "A10016", "A10017", "A10018", "A10019", "A10020", ...
ref = ['A00002', 'A00005', 'A10001', 'A10002', 'A10003', 'A10004', 'A10005', 'A10006', 'A10007', 'A10008', 'A10009', 'A10010', 'A10011', 'A10012', 'A10013', 'A10014', 'A10015', 'A10016', 'A10017', 'A10018', 'A10019', 'A10020', 'A10021', 'A10022', 'A10023', 'A10024', 'A10025', 'A10026', 'A10027', 'A10028', 'A10029', 'A1...
# Copyright 2008 Canonical Ltd. # This file is part of lazr.restfulclient. # # lazr.restfulclient is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as # published by the Free Software Foundation, either version 3 of the # License, or (at your option) ...
"""lazr.restfulclient errors.""" __metaclass__ = type __all__ = ['BadRequest', 'Conflict', 'ClientError', 'CredentialsError', 'CredentialsFileError', 'HTTPError', 'MethodNotAllowed', 'NotFound', 'PreconditionFailed', 'RestfulError', 'ResponseError', 'ServerError', 'Unauthorized', 'UnexpectedResponseError'] class Restf...
ROBOT_POSITION_RESSOURCE = '/robotposition' CUBE_POSITION_RESSOURCE = '/cubeposition' PATH_RESSOURCE = '/path' FLAG_RESSOURCE = '/flag'
robot_position_ressource = '/robotposition' cube_position_ressource = '/cubeposition' path_ressource = '/path' flag_ressource = '/flag'
server = "uri.pi" port = 4711 # well World home = Vec3(-66.9487,7.0,-39.5313)
server = 'uri.pi' port = 4711 home = vec3(-66.9487, 7.0, -39.5313)
def Black_mesa(thoughts, eyes, eye, tongue): return f""" {thoughts} {thoughts} .-;+\$XHHHHHHX\$+;-. ,;X\@\@X%/;=----=:/%X\@\@X/, =\$\@\@%=. .=+H\@X: -XMX: =XMX= /\@\@: =H\@+ %\@X, .\$\@\$ ...
def black_mesa(thoughts, eyes, eye, tongue): return f'\n {thoughts}\n {thoughts}\n .-;+\\$XHHHHHHX\\$+;-.\n ,;X\\@\\@X%/;=----=:/%X\\@\\@X/,\n =\\$\\@\\@%=. .=+H\\@X:\n -XMX: =XMX=\n /\\@\\@: =H\\@+\n %\\@X, ...
# file handling # 1) without using with statement file = open('t1.txt', 'w') file.write('hello world !') file.close() # 2) without using with statement file = open('t2.txt', 'w') try: file.write('hello world') finally: file.close() # 3) using with statement with open('t3.txt', 'w') as file: file.write('h...
file = open('t1.txt', 'w') file.write('hello world !') file.close() file = open('t2.txt', 'w') try: file.write('hello world') finally: file.close() with open('t3.txt', 'w') as file: file.write('hello world !')
""" Sentinel module to signify that a parameter should use its default value. Useful when the default value or ``None`` are both valid options. """
""" Sentinel module to signify that a parameter should use its default value. Useful when the default value or ``None`` are both valid options. """