content
stringlengths
7
1.05M
fixed_cases
stringlengths
1
1.28M
def func(): print("func() in one.py") print("Top level one.py") if __name__ == '__main__': print("one.py is being run directly") else: print('one.py has been imported')
def func(): print('func() in one.py') print('Top level one.py') if __name__ == '__main__': print('one.py is being run directly') else: print('one.py has been imported')
lista = list() letras = ['A', 'B', 'C', 'D', 'E'] while True: entrada1 = input() if entrada1 == '0': break for c in range(int(entrada1)): entrada = input().split() for pos, elemento in enumerate(entrada): entrada[pos] = int(elemento) lista.append(entrada) for ques...
lista = list() letras = ['A', 'B', 'C', 'D', 'E'] while True: entrada1 = input() if entrada1 == '0': break for c in range(int(entrada1)): entrada = input().split() for (pos, elemento) in enumerate(entrada): entrada[pos] = int(elemento) lista.append(entrada) for qu...
def konda(c, options = {}): palette = { 'background': '#0f0f0f', 'background-alt': '#0f0f0f', 'background-attention': '#050505', 'border': '#0f0f0f', 'current-line': '#191919', 'selection': '#191919', 'foreground': '#f0f0f0', 'foreground-alt': '#e7e7e7...
def konda(c, options={}): palette = {'background': '#0f0f0f', 'background-alt': '#0f0f0f', 'background-attention': '#050505', 'border': '#0f0f0f', 'current-line': '#191919', 'selection': '#191919', 'foreground': '#f0f0f0', 'foreground-alt': '#e7e7e7', 'foreground-attention': '#f0f0f0', 'comment': '#4c4c4c', 'cyan':...
QUANDL_API_KEY = 'o1asPBK4sj_pb5-CJ17X' QUANDL_API_HTTPS = 'https://www.quandl.com/api' QUANDL_API_VERSION = 'v3'
quandl_api_key = 'o1asPBK4sj_pb5-CJ17X' quandl_api_https = 'https://www.quandl.com/api' quandl_api_version = 'v3'
''' Date: 2021-02-07 10:48:03 LastEditors: Jecosine LastEditTime: 2021-02-07 11:00:08 ''' class User(object): def __init__(self): self.username = '' self.password = ''
""" Date: 2021-02-07 10:48:03 LastEditors: Jecosine LastEditTime: 2021-02-07 11:00:08 """ class User(object): def __init__(self): self.username = '' self.password = ''
def has_permission(user): if user: if user.is_superuser: return True if user.is_staff and user.groups.filter(name__iexact='djedi').exists(): return True return False def get_username(user): if hasattr(user, 'get_username'): return user.get_username() e...
def has_permission(user): if user: if user.is_superuser: return True if user.is_staff and user.groups.filter(name__iexact='djedi').exists(): return True return False def get_username(user): if hasattr(user, 'get_username'): return user.get_username() else...
class Node: def __init__ (self, element, next = None ): self.element = element self.next = next self.previous = None def display(self): print(self.element) class LinkedList: def __init__(self): self.head = None self.size = 0 ...
class Node: def __init__(self, element, next=None): self.element = element self.next = next self.previous = None def display(self): print(self.element) class Linkedlist: def __init__(self): self.head = None self.size = 0 def _len_(self): retur...
class Solution: def check(self, nums: list[int]) -> bool: return sum(a > b for a, b in zip(nums, nums[1:] + nums[:1])) < 2 if __name__ == '__main__': for test in [ [3, 4, 5, 1, 2], [2, 1, 3, 4], [1, 2, 3], [1, 1, 1], [2, 1], [2, 7, 4, 1, 2, 6, 2], ]:...
class Solution: def check(self, nums: list[int]) -> bool: return sum((a > b for (a, b) in zip(nums, nums[1:] + nums[:1]))) < 2 if __name__ == '__main__': for test in [[3, 4, 5, 1, 2], [2, 1, 3, 4], [1, 2, 3], [1, 1, 1], [2, 1], [2, 7, 4, 1, 2, 6, 2]]: print(solution().check(test))
class Node: def __init__(self, item, link): self.item = item self.next = link def add(item): global size global front global rear new_node = Node(item, None) if size == 0: front = new_node else: rear.next = new_node rear = new_node size += 1 def rem...
class Node: def __init__(self, item, link): self.item = item self.next = link def add(item): global size global front global rear new_node = node(item, None) if size == 0: front = new_node else: rear.next = new_node rear = new_node size += 1 def rem...
class Postback: def __init__(self, id, payload): self.id = id self.value = payload def __repr__(self): return str(self.__dict__)
class Postback: def __init__(self, id, payload): self.id = id self.value = payload def __repr__(self): return str(self.__dict__)
def factorial(num): if not str(num).isdigit(): return 'error, non-integer entered' if num<0: return 'error, negative number entered' if num>1: return num*factorial(num-1) else: return 1 def fact2(num): if not str(num).isdigit(): return 'error, non...
def factorial(num): if not str(num).isdigit(): return 'error, non-integer entered' if num < 0: return 'error, negative number entered' if num > 1: return num * factorial(num - 1) else: return 1 def fact2(num): if not str(num).isdigit(): return 'error, non-int...
class Config(object): SSL = True CERT_PATH = 'redlure-cert.pem' KEY_PATH = 'redlure-key.pem' HOST = '0.0.0.0' PORT = 4200
class Config(object): ssl = True cert_path = 'redlure-cert.pem' key_path = 'redlure-key.pem' host = '0.0.0.0' port = 4200
# coding=utf-8 n, k = map(int, input().split()) ans = [list('.'*n) for _ in range(4)] if k%2 == 0: for i in range(k//2): ans[1][i+1], ans[2][i+1] = '#', '#' else: for i in range((k%(n-2))//2): ans[1][i+1], ans[1][n-1-1-i] = '#', '#' if k//(n-2) == 1: ans[2] = list('#'*n) an...
(n, k) = map(int, input().split()) ans = [list('.' * n) for _ in range(4)] if k % 2 == 0: for i in range(k // 2): (ans[1][i + 1], ans[2][i + 1]) = ('#', '#') else: for i in range(k % (n - 2) // 2): (ans[1][i + 1], ans[1][n - 1 - 1 - i]) = ('#', '#') if k // (n - 2) == 1: ans[2] = lis...
# QtBluetooth QtBluetooth.QBluetoothSocket.bytesAvailable QtBluetooth.QBluetoothSocket.bytesToWrite QtBluetooth.QBluetoothSocket.canReadLine QtBluetooth.QBluetoothSocket.close QtBluetooth.QBluetoothSocket.isSequential QtBluetooth.QBluetoothSocket.readData QtBluetooth.QBluetoothSocket.writeData QtBluetooth.QBluetoothTra...
QtBluetooth.QBluetoothSocket.bytesAvailable QtBluetooth.QBluetoothSocket.bytesToWrite QtBluetooth.QBluetoothSocket.canReadLine QtBluetooth.QBluetoothSocket.close QtBluetooth.QBluetoothSocket.isSequential QtBluetooth.QBluetoothSocket.readData QtBluetooth.QBluetoothSocket.writeData QtBluetooth.QBluetoothTransferReply.err...
class logicalResult: def __init__(self): self.resultList=[] def addLogicalResult(self,item): self.resultList.append(item) def getData(self): return self.resultList
class Logicalresult: def __init__(self): self.resultList = [] def add_logical_result(self, item): self.resultList.append(item) def get_data(self): return self.resultList
# # PySNMP MIB module INFORMANT-MBM (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/INFORMANT-MBM # Produced by pysmi-0.3.4 at Wed May 1 13:53:37 2019 # On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4 # Using Python version 3.7.3 (default, Mar 27 201...
(integer, object_identifier, octet_string) = mibBuilder.importSymbols('ASN1', 'Integer', 'ObjectIdentifier', 'OctetString') (named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues') (value_size_constraint, constraints_intersection, value_range_constraint, constraints_union, single_value_constraint) ...
num = 9119 def square_digits(num): num = str(num) list = [digit for digit in num] list2 = [ int(i) for i in list ] list3 = [ i **2 for i in list2 ] list4 = [ str(i) for i in list3 ] output = "" for i in list4: output += i output = int(output) return output print(square_dig...
num = 9119 def square_digits(num): num = str(num) list = [digit for digit in num] list2 = [int(i) for i in list] list3 = [i ** 2 for i in list2] list4 = [str(i) for i in list3] output = '' for i in list4: output += i output = int(output) return output print(square_digits(num...
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
class Instancehook(object): def __init__(self, config, client, post=False): if self.__class__ is InstanceHook: raise NotImplementedError self.config = config self.client = client self.post = post def pre_create(self, instance): raise NotImplementedError ...
# AUTOGENERATED BY NBDEV! DO NOT EDIT! __all__ = ["index", "modules", "custom_doc_links", "git_url"] index = {"getText": "10-process-data.ipynb", "docx_to_df": "10-process-data.ipynb", "find_timestamp": "10-process-data.ipynb", "add_splits": "12-training-dev-test.ipynb", "check_lab...
__all__ = ['index', 'modules', 'custom_doc_links', 'git_url'] index = {'getText': '10-process-data.ipynb', 'docx_to_df': '10-process-data.ipynb', 'find_timestamp': '10-process-data.ipynb', 'add_splits': '12-training-dev-test.ipynb', 'check_label': '42-wav-embedding-preprocess.ipynb', 'check_ts': '13-validate-csv.ipynb'...
def split_spells(spells, classes): print("Splitting spells into classes...") class_spells = {} for c in classes: class_spells[c] = [] for s in spells: split = s[2].split(',') for item in split: class_spells[item].append(s) print("Splitting complete.\n") ...
def split_spells(spells, classes): print('Splitting spells into classes...') class_spells = {} for c in classes: class_spells[c] = [] for s in spells: split = s[2].split(',') for item in split: class_spells[item].append(s) print('Splitting complete.\n') return...
a = (1,5,8,4,5) sum_x = 10 for i in a: sum_x += i print (sum_x)
a = (1, 5, 8, 4, 5) sum_x = 10 for i in a: sum_x += i print(sum_x)
class Number(Primitive): # print with preselected number of digits (rounded) def val(self): if self.value == None: return Nil.html if isinstance(self.value, float): if not self.prec: return f'{int(self.value)}' else: return f'{round(self.v...
class Number(Primitive): def val(self): if self.value == None: return Nil.html if isinstance(self.value, float): if not self.prec: return f'{int(self.value)}' else: return f'{round(self.value, self.prec)}' raise type_error(...
# 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 averageOfLevels(self, root: TreeNode) -> List[float]: res = [root.val] ar = [root] ...
class Solution: def average_of_levels(self, root: TreeNode) -> List[float]: res = [root.val] ar = [root] def func(curr, ar): next_ar = [] if curr == None: return for i in ar: if i.left != None: next_ar....
def find_it(seq): for number in seq: if seq.count(number) % 2 != 0: return number
def find_it(seq): for number in seq: if seq.count(number) % 2 != 0: return number
#!/usr/bin/env python3 def do(s: str) -> str: last = {} # last index seen lastlast = set() # in here if seen twice for (i, x) in enumerate(s): if x in lastlast: return "NO" if x in last: lastlast.add(x) if (i - last[x]) % 2 == 0: return "...
def do(s: str) -> str: last = {} lastlast = set() for (i, x) in enumerate(s): if x in lastlast: return 'NO' if x in last: lastlast.add(x) if (i - last[x]) % 2 == 0: return 'NO' else: last[x] = i return 'YES' s = inpu...
def shulambs(n, opt=10, maybe=20): return n + opt + maybe # print("shulambs(): {0}".format(shulambs())) print("shulambs(5): {0}".format(shulambs(5))) print("shulambs(5, 5): {0}".format(shulambs(5, 5))) print("shulambs(5, 5, 5): {0}".format(shulambs(5, 5, 5))) print("shulambs(5, maybe=5): {0}".format(shulambs(5, ma...
def shulambs(n, opt=10, maybe=20): return n + opt + maybe print('shulambs(5): {0}'.format(shulambs(5))) print('shulambs(5, 5): {0}'.format(shulambs(5, 5))) print('shulambs(5, 5, 5): {0}'.format(shulambs(5, 5, 5))) print('shulambs(5, maybe=5): {0}'.format(shulambs(5, maybe=5)))
# # @lc app=leetcode id=821 lang=python3 # # [821] Shortest Distance to a Character # # @lc code=start class Solution: def shortestToChar(self, S: str, C: str) -> List[int]: n, pos = len(S), -float('inf') res = [n] * n for i in list(range(n)) + list(range(n)[::-1]): if S[i] == C...
class Solution: def shortest_to_char(self, S: str, C: str) -> List[int]: (n, pos) = (len(S), -float('inf')) res = [n] * n for i in list(range(n)) + list(range(n)[::-1]): if S[i] == C: pos = i res[i] = min(res[i], abs(i - pos)) return res
class invalid_clipboard_format_given(Exception): def __init__(self, f): Exception.__init__(self, "Invalid clipboard format given. Require int or str, but got '%s'" % f) class unknown_clipboard_format_given(Exception): def __init__(self, f): if type(f) is int: Exception.__init...
class Invalid_Clipboard_Format_Given(Exception): def __init__(self, f): Exception.__init__(self, "Invalid clipboard format given. Require int or str, but got '%s'" % f) class Unknown_Clipboard_Format_Given(Exception): def __init__(self, f): if type(f) is int: Exception.__init__(se...
first = int(input()) second = int(input()) if first >= second: print (first) else: print (second)
first = int(input()) second = int(input()) if first >= second: print(first) else: print(second)
# Pograma que da um desconto de 12 porcento de um produto produto = 'Video Game' valor = float(input('Entre com o valor do produto: R$')) desc = (valor * 12) / 100 print(f'Produto: {produto}.\nValor: R${valor}\nDesconto: R${desc}\nTotal a pagar: R${valor - desc}')
produto = 'Video Game' valor = float(input('Entre com o valor do produto: R$')) desc = valor * 12 / 100 print(f'Produto: {produto}.\nValor: R${valor}\nDesconto: R${desc}\nTotal a pagar: R${valor - desc}')
n=int(input("Give the value of n:")) if n>1: for i in range(2,n): if (n%i)==0: print(n,"is not prime") break else: print(n,"is a prime number")
n = int(input('Give the value of n:')) if n > 1: for i in range(2, n): if n % i == 0: print(n, 'is not prime') break else: print(n, 'is a prime number')
# We can slice a string into a separate substring name = 'Patrick' # Slicing includes the first index and excludes the last print(name[0:3]) print(name[3:7]) # Leaving the first index blank means the first index is 0 by default. # Leaving the second index blank means the second index is the size of the # string by...
name = 'Patrick' print(name[0:3]) print(name[3:7]) print(name[:3]) print(name[3:]) print(name[-4:]) print(name[:-4])
class Enumerator(object): def __init__(self): self._full_index = tuple() def _last_index(self): return self._full_index[-1] def _depth(self): return len(self._full_index) def add_enumerate(self, level): assert level > 0 if level > self._depth() + 1: ...
class Enumerator(object): def __init__(self): self._full_index = tuple() def _last_index(self): return self._full_index[-1] def _depth(self): return len(self._full_index) def add_enumerate(self, level): assert level > 0 if level > self._depth() + 1: ...
n,k=map(int,input().split()) if n-k>=2 and k>=2: print("YES") print("swap", k, k + 1) print("reverse", 1, k) print("reverse", k + 1, n) print("swap", 1, n) print("reverse", 1, n) else: if n==2: print("YES") for _ in range(5): print("swap 1 2") elif k==1: ...
(n, k) = map(int, input().split()) if n - k >= 2 and k >= 2: print('YES') print('swap', k, k + 1) print('reverse', 1, k) print('reverse', k + 1, n) print('swap', 1, n) print('reverse', 1, n) elif n == 2: print('YES') for _ in range(5): print('swap 1 2') elif k == 1: if n == 3...
class BaseService(object): def __init__(self, *args, **kwargs): # super().__init__(*args, **kwargs) self.raw_data = kwargs.get('raw_data') self.data = kwargs.get('data') self.args = args self.kwargs = kwargs ''' This method will perform authorization for _fetch '...
class Baseservice(object): def __init__(self, *args, **kwargs): self.raw_data = kwargs.get('raw_data') self.data = kwargs.get('data') self.args = args self.kwargs = kwargs '\n This method will perform authorization for _fetch\n ' def _auth(self): pass '\n ...
# Path of azure devops # '/home/vsts/work/1/s' # Path of Dario Windows Computer # 'C:\\Users\\dario\\OneDrive\\Documentos\\Github\\IA-4-ROS' program_path = '/home/vsts/work/1/s'
program_path = '/home/vsts/work/1/s'
text = '''The Lord is my shepherd; I shall not want. He maketh me to lie down in green pastures: he leadeth me beside the still waters. He restoreth my soul: he leadeth me in the paths of righteousness for his name's sake. Yea, though I walk through the valley of the shadow of death, I will fear no evil: for thou art w...
text = "The Lord is my shepherd; I shall not want.\nHe maketh me to lie down in green pastures: he leadeth me beside the still waters.\nHe restoreth my soul: he leadeth me in the paths of righteousness for his name's sake.\nYea, though I walk through the valley of the shadow of death, I will fear no evil: for thou art ...
def write(_socket, data): f = _socket.makefile('wb', buffer_size ) pickle.dump(data, f, pickle.HIGHEST_PROTOCOL) f.close() def read(_socket): f = _socket.makefile('rb', buffer_size ) data = pickle.load(f) f.close() return data
def write(_socket, data): f = _socket.makefile('wb', buffer_size) pickle.dump(data, f, pickle.HIGHEST_PROTOCOL) f.close() def read(_socket): f = _socket.makefile('rb', buffer_size) data = pickle.load(f) f.close() return data
indents_test_text_001 = ''' def func(): pass ''' indents_test_text_002 = ''' def func(): pass ''' indents_test_text_003 = ''' def func(): \tpass ''' indents_test_text_004 = ''' if True: pass ''' indents_test_text_005 = ''' if True: pass ''' indents_test_text_006 = ''' if True: pass ''' ind...
indents_test_text_001 = '\ndef func():\n pass\n' indents_test_text_002 = '\ndef func():\n pass\n' indents_test_text_003 = '\ndef func():\n\tpass\n' indents_test_text_004 = '\nif True:\n pass\n' indents_test_text_005 = '\nif True:\n pass\n' indents_test_text_006 = '\nif True:\n pass\n' indents_t...
# https://www.codewars.com/kata/5592e3bd57b64d00f3000047/train/python def find_nb(m): sum = 0 i = 0 while(m > sum): i = i + 1 sum += pow(i, 3) if m == sum: return i else: return -1
def find_nb(m): sum = 0 i = 0 while m > sum: i = i + 1 sum += pow(i, 3) if m == sum: return i else: return -1
'''Make an iterator that aggregates elements from each of the iterables. Returns an iterator of tuples, where the i-th tuple contains the i-th element from each of the argument sequences or iterables. The iterator stops when the shortest input iterable is exhausted. With a single iterable argument, it returns an iter...
"""Make an iterator that aggregates elements from each of the iterables. Returns an iterator of tuples, where the i-th tuple contains the i-th element from each of the argument sequences or iterables. The iterator stops when the shortest input iterable is exhausted. With a single iterable argument, it returns an iter...
ipaypaypay hahaha hehe
ipaypaypay hahaha hehe
class Solution: def lengthOfLongestSubstring(self, s: str) -> int: result = "" mapping = {} start = 0 for i, c in enumerate(s): if c in mapping: start = max(start, mapping.get(c)+1) if len(result) < i - start + 1: result = s[sta...
class Solution: def length_of_longest_substring(self, s: str) -> int: result = '' mapping = {} start = 0 for (i, c) in enumerate(s): if c in mapping: start = max(start, mapping.get(c) + 1) if len(result) < i - start + 1: result...
fname = input('Enter a file name:') try: fhand = open(fname) except: print('File cannot be opened:', fname) exit() count = 0 total = 0 for line in fhand: if line.startswith('X-DSPAM-Confidence:'): count = count + 1 sppos = line.find(' ') fnum = float(line[sppos + 1:]) t...
fname = input('Enter a file name:') try: fhand = open(fname) except: print('File cannot be opened:', fname) exit() count = 0 total = 0 for line in fhand: if line.startswith('X-DSPAM-Confidence:'): count = count + 1 sppos = line.find(' ') fnum = float(line[sppos + 1:]) tot...
class Error(Exception): def __init__(self, mssg): super().__init__(mssg) def __str__(self): return repr(self.mssg) class NoInputForProcessing(Error): def __init__(self, mssg): super().__init__(mssg) class InputOverloadForProcessing(Error): def __init__(self, mssg): sup...
class Error(Exception): def __init__(self, mssg): super().__init__(mssg) def __str__(self): return repr(self.mssg) class Noinputforprocessing(Error): def __init__(self, mssg): super().__init__(mssg) class Inputoverloadforprocessing(Error): def __init__(self, mssg): ...
#from connect import * print("definitions setup") def LWheels(speed): negative = False speed = int(speed) # I don't understand this condition here. Why are you excluding -10,9,...,-1,1,...,9,10? if (speed > 10 and speed < 999) or (speed < -10 and speed > -999): if speed < -10: speed...
print('definitions setup') def l_wheels(speed): negative = False speed = int(speed) if speed > 10 and speed < 999 or (speed < -10 and speed > -999): if speed < -10: speed *= -1 negative = True while len(str(speed)) < 4: speed = '0' + str(speed) if...
__author__ = 'chira' def module1_function1(): print('this is function1 of Module1.py') def module1_function2(): print('this is function2 of Module1.py')
__author__ = 'chira' def module1_function1(): print('this is function1 of Module1.py') def module1_function2(): print('this is function2 of Module1.py')
def time_saved1(lim, avg, d): return ((d/lim - d/avg)*60, 1) def time_saved2(s_lim, s_avg, d): norm_time = (d/s_lim)*60 fast_time = (d/s_avg)*60 worth = norm_time - fast_time return round(worth, 1) ts1 = time_saved1(80, 90, 40), time_saved1(80, 90, 4000), time_saved1(80, 100, 40), time_sav...
def time_saved1(lim, avg, d): return ((d / lim - d / avg) * 60, 1) def time_saved2(s_lim, s_avg, d): norm_time = d / s_lim * 60 fast_time = d / s_avg * 60 worth = norm_time - fast_time return round(worth, 1) ts1 = (time_saved1(80, 90, 40), time_saved1(80, 90, 4000), time_saved1(80, 100, 40), time_s...
PKG_DEBUG_OPT = select({":enable_debug": ["-g"], "//conditions:default": []}) PKG_VERBOSE_OPT = select({":enable_verbose": ["-verbose"], "//conditions:default": []}) PKG_OPTS = PKG_DEBUG_OPT + PKG_VERBOSE_OPT
pkg_debug_opt = select({':enable_debug': ['-g'], '//conditions:default': []}) pkg_verbose_opt = select({':enable_verbose': ['-verbose'], '//conditions:default': []}) pkg_opts = PKG_DEBUG_OPT + PKG_VERBOSE_OPT
# Program 15: Given a list of numbers, find maximum and minimum in this list. a=input('enter the integers').split(" ") b=[int(i) for i in a] c=max(b) d=min(b) print(c,d)
a = input('enter the integers').split(' ') b = [int(i) for i in a] c = max(b) d = min(b) print(c, d)
a=5 b = format(a & 0x1fff, '13b') i=0 b1='' while i<len(b): if b[i]==' ': b1=b1+'0' else: b1=b1+b[i] i=i+1 print(b1)
a = 5 b = format(a & 8191, '13b') i = 0 b1 = '' while i < len(b): if b[i] == ' ': b1 = b1 + '0' else: b1 = b1 + b[i] i = i + 1 print(b1)
# this method ensures that value is True # or throws a ValueError with the specified message def precondition(value, msg): if not value: raise ValueError(msg) def precondition_strings_equal(stra, strb): if stra != strb: raise ValueError("Expected '%s' to equal '%s'" % (stra, strb))
def precondition(value, msg): if not value: raise value_error(msg) def precondition_strings_equal(stra, strb): if stra != strb: raise value_error("Expected '%s' to equal '%s'" % (stra, strb))
def add(a, b): return a + b if __name__ == '__main__': print(add(2, 3)) print(add(1, 5))
def add(a, b): return a + b if __name__ == '__main__': print(add(2, 3)) print(add(1, 5))
### Append and Delete - Solution def appendAndDelete(s, t, k): numOfSameChars = min(len(s), len(t)) for i in range(len(t)): if s[:i] != t[:i]: numOfSameChars = i - 1 break diff = (len(s)-numOfSameChars) + (len(t)-numOfSameChars) print("Yes" if ((diff <= k and diff%2 == k...
def append_and_delete(s, t, k): num_of_same_chars = min(len(s), len(t)) for i in range(len(t)): if s[:i] != t[:i]: num_of_same_chars = i - 1 break diff = len(s) - numOfSameChars + (len(t) - numOfSameChars) print('Yes' if diff <= k and diff % 2 == k % 2 or len(s) + len(t) ...
def promptUserforFile(): while True: fileName = input("Enter file:") # will input name below in terminal FileLocation = 'Text\\Lesson8' filePath = (f'{FileLocation}\\{fileName}') print(filePath) try: file = open(filePath) return file ...
def prompt_userfor_file(): while True: file_name = input('Enter file:') file_location = 'Text\\Lesson8' file_path = f'{FileLocation}\\{fileName}' print(filePath) try: file = open(filePath) return file except: print('file not found')...
# Classes this time around # yay class koala: def __init__(animal, armlen, leglen, eyenum, tail, fur): animal.armlen = float(armlen) animal.leglen = float(leglen) animal.eyenum = int(eyenum) animal.tail = bool(tail) animal.fur = bool(fur) def printDesc(animal): print("My favorite animal is...
class Koala: def __init__(animal, armlen, leglen, eyenum, tail, fur): animal.armlen = float(armlen) animal.leglen = float(leglen) animal.eyenum = int(eyenum) animal.tail = bool(tail) animal.fur = bool(fur) def print_desc(animal): print('My favorite animal is the...
class Node: def __init__(self): self.child = {} root = Node() nodes = 0 n = int(input()) for i in range(n): phone = [i for i in input()] current = root for i in phone: if not i in current.child: current.child[i] = Node() nodes += 1 ...
class Node: def __init__(self): self.child = {} root = node() nodes = 0 n = int(input()) for i in range(n): phone = [i for i in input()] current = root for i in phone: if not i in current.child: current.child[i] = node() nodes += 1 current = current.child...
def LPSubstr(s): n = len(s) p = [[0] * (n + 1), [0] * n] for z, p_z in enumerate(p): left, right = 0, 0 for i in range(n): t = right - i + 1 - z if i < right: p_z[i] = min(t, p_z[left + t]) L, R = i - p_z[i], i + p_z[i] - 1 + z ...
def lp_substr(s): n = len(s) p = [[0] * (n + 1), [0] * n] for (z, p_z) in enumerate(p): (left, right) = (0, 0) for i in range(n): t = right - i + 1 - z if i < right: p_z[i] = min(t, p_z[left + t]) (l, r) = (i - p_z[i], i + p_z[i] - 1 + z) ...
#!/usr/bin/env python # -*- coding: utf-8 -*- config = { "consumer": { # application consumer key & secret "key": "******************", "secret": "******************", }, "token": { # user token & secret "key": "******************", "secret": "***************...
config = {'consumer': {'key': '******************', 'secret': '******************'}, 'token': {'key': '******************', 'secret': '******************'}, 'accept_accounts': ['your_screen_name'], 'profile_match_key': ['name', 'description'], 'simple_trigger': {'^prof(ile)1$': 'prof1', '^prof(ile)?2$': {'key': 'prof2'...
def subclasses(cls): return set(cls.__subclasses__()).union([s for c in cls.__subclasses__() for s in subclasses(c)]) def subclasses_dict(cls): return {cls.__name__: cls for cls in subclasses(cls)}
def subclasses(cls): return set(cls.__subclasses__()).union([s for c in cls.__subclasses__() for s in subclasses(c)]) def subclasses_dict(cls): return {cls.__name__: cls for cls in subclasses(cls)}
# Auto generated by make_terminal_widths.py CELL_WIDTHS = [ (0, 0, 0), (1, 31, -1), (35, 35, 2), (42, 42, 2), (127, 159, -1), (169, 169, 2), (174, 174, 2), (768, 879, 0), (1155, 1161, 0), (1425, 1469, 0), (1471, 1471, 0), (1473, 1474, 0), (1476, 1477, 0), (1479, ...
cell_widths = [(0, 0, 0), (1, 31, -1), (35, 35, 2), (42, 42, 2), (127, 159, -1), (169, 169, 2), (174, 174, 2), (768, 879, 0), (1155, 1161, 0), (1425, 1469, 0), (1471, 1471, 0), (1473, 1474, 0), (1476, 1477, 0), (1479, 1479, 0), (1552, 1562, 0), (1611, 1631, 0), (1648, 1648, 0), (1750, 1756, 0), (1759, 1764, 0), (1767, ...
#{ #Driver Code Starts #Initial Template for Python 3 # } Driver Code Ends #User function Template for python3 # Function to perform increment and decrement def do_operation(x, y): # Your code here print (x-1) print (y+1) #{ #Driver Code Starts. # Driver code def main(): testcase = int(inpu...
def do_operation(x, y): print(x - 1) print(y + 1) def main(): testcase = int(input()) while testcase > 0: input1 = input().split() x = int(input1[0]) y = int(input1[1]) do_operation(x, y) testcase -= 1 if __name__ == '__main__': main()
# now we are going to code a layer which has 3 neuron with 4 inputs # so there will be 3 sets of weights and 3 unique biases for each neuron and each weight set will consists of 4 values # INPUT inputs = [1 , 2 , 3 , 2.5] # WEIGHTS weights1 = [0.2 , 0.8 , -0.5 , 1.0] weights2 = [0.5 , -0.91 , 0.26 , -0.5] weights3 = ...
inputs = [1, 2, 3, 2.5] weights1 = [0.2, 0.8, -0.5, 1.0] weights2 = [0.5, -0.91, 0.26, -0.5] weights3 = [-0.26, -0.27, 0.17, 0.87] bias1 = 2 bias2 = 3 bias3 = 0.5 output = [inputs[0] * weights1[0] + inputs[1] * weights1[1] + inputs[2] * weights1[2] + inputs[3] * weights1[3] + bias1, inputs[0] * weights2[0] + inputs[1] ...
num = int(input("Enter the number:")) for i in range(2, int(num / 2)): if num % i == 0: print("Not a Prime Number") break else: print("It is a Prime Number")
num = int(input('Enter the number:')) for i in range(2, int(num / 2)): if num % i == 0: print('Not a Prime Number') break else: print('It is a Prime Number')
# An example of how a third-party production tracker can # be linked into a project. name = "ftrack" version = "1.0.1" build_command = False _environ = { "FTRACK_URI": "ftrack.mystudio.co.jp", "FTRACK_PROTOCOL": "https", } def commands(): global env global this global building for key, valu...
name = 'ftrack' version = '1.0.1' build_command = False _environ = {'FTRACK_URI': 'ftrack.mystudio.co.jp', 'FTRACK_PROTOCOL': 'https'} def commands(): global env global this global building for (key, value) in this._environ.items(): env[key] = value
#!/usr/bin/env python3 def gen_config(): stage_sizes = [1, 2, 4, 8] step_per_stage = 3 config = ','.join('%d:%d' % (size, step_per_stage) for size in stage_sizes) max_step = step_per_stage * len(stage_sizes) return config, max_step config, max_step = gen_config() print('--schedule %s' % (confi...
def gen_config(): stage_sizes = [1, 2, 4, 8] step_per_stage = 3 config = ','.join(('%d:%d' % (size, step_per_stage) for size in stage_sizes)) max_step = step_per_stage * len(stage_sizes) return (config, max_step) (config, max_step) = gen_config() print('--schedule %s' % config) print('--max-step %s'...
def fibonacci(n): result = [0, 1] for _ in range(2, n): result.append(result[-2] + result[-1]) return result if __name__ == '__main__': print(fibonacci(10))
def fibonacci(n): result = [0, 1] for _ in range(2, n): result.append(result[-2] + result[-1]) return result if __name__ == '__main__': print(fibonacci(10))
''' --- Day 8: Two-Factor Authentication --- You come across a door implementing what you can only assume is an implementation of two-factor authentication after a long game of requirements telephone. To get past the door, you first swipe a keycard (no problem; there was one on a nearby desk). Then, it displays a cod...
""" --- Day 8: Two-Factor Authentication --- You come across a door implementing what you can only assume is an implementation of two-factor authentication after a long game of requirements telephone. To get past the door, you first swipe a keycard (no problem; there was one on a nearby desk). Then, it displays a cod...
def worker_func(): atttendence=30 print("this is variable from function",atttendence) worker_func() #print(atttendence)
def worker_func(): atttendence = 30 print('this is variable from function', atttendence) worker_func()
def main(): _ = input() list_A = list(map(int, input().split())) list_B = list(map(int, input().split())) sum = 0 for a, b in zip(list_A, list_B): sum += a * b if sum == 0: print("Yes") else: print("No") if __name__ == "__main__": main()
def main(): _ = input() list_a = list(map(int, input().split())) list_b = list(map(int, input().split())) sum = 0 for (a, b) in zip(list_A, list_B): sum += a * b if sum == 0: print('Yes') else: print('No') if __name__ == '__main__': main()
# # PySNMP MIB module MANTRA-TRAP-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/MANTRA-TRAP-MIB # Produced by pysmi-0.3.4 at Wed May 1 14:09:36 2019 # On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4 # Using Python version 3.7.3 (default, Mar 27...
(unknown_device_trap_contents, domain, new_file, old_file, file, my_port, device_type, my_host, mate_port, name, sb_producer_port, sn_name, result, run_status, mate_host, minutes, dev_name, port, pep_name, reason, group, host, sb_producer_host) = mibBuilder.importSymbols('AGGREGATED-EXT-MIB', 'unknownDeviceTrapContents...
class Graph: # todo: create random graphs graph = { # 4 4 # A--B--C # 3/| | # S |5 |5 G # 4\| | /3 # D--E--F # 2 4 'a': ['s', 'd', 'b'], 'b': ['e', 'c', 'a'], 'c': ['b'], 'd': ['s', 'e', 'a'], '...
class Graph: graph = {'a': ['s', 'd', 'b'], 'b': ['e', 'c', 'a'], 'c': ['b'], 'd': ['s', 'e', 'a'], 'e': ['f', 'd', 'b'], 'f': ['g', 'e'], 'g': ['f'], 's': ['d', 'a']} weights = {('a', 'b'): 4, ('a', 'd'): 5, ('a', 's'): 3, ('b', 'a'): 3, ('b', 'c'): 4, ('b', 'e'): 5, ('c', 'b'): 4, ('d', 'a'): 5, ('d', 'e'): 2...
print("Plz Provide your Marks") b = input() c=int(input()) print(type(b)) print(type(c))
print('Plz Provide your Marks') b = input() c = int(input()) print(type(b)) print(type(c))
#!/usr/bin/env python3 passports = [] data = {} with open('input.txt') as fp: for line in fp: if line.strip() == '': passports.append(data) data = {} continue kv_pairs = line.split() for kv in kv_pairs: k, v = kv.split(':') data[k]...
passports = [] data = {} with open('input.txt') as fp: for line in fp: if line.strip() == '': passports.append(data) data = {} continue kv_pairs = line.split() for kv in kv_pairs: (k, v) = kv.split(':') data[k] = v passports.app...
''' CELEBRITY PROBLEM In a group of N people, there is 1 person, who is known to everyone, but he knows noone. We need to find such a person, if present. There will be a matrix input, such that M[i][j] = 1, if ith person knows jth person, else 0. ''' def Celebrity(Person, n): start = 0 end = n - 1 while(...
""" CELEBRITY PROBLEM In a group of N people, there is 1 person, who is known to everyone, but he knows noone. We need to find such a person, if present. There will be a matrix input, such that M[i][j] = 1, if ith person knows jth person, else 0. """ def celebrity(Person, n): start = 0 end = n - 1 while ...
#!/usr/bin/env python3 n, h, *d = map(int, open(0).read().split()) a = max(d[::2]) b = sorted(b for b in d[1::2] if b >= a)[::-1] i = 0 for b in b: h -= b i += 1 if h <= 0: print(i) exit() print(i + 0--h // a)
(n, h, *d) = map(int, open(0).read().split()) a = max(d[::2]) b = sorted((b for b in d[1::2] if b >= a))[::-1] i = 0 for b in b: h -= b i += 1 if h <= 0: print(i) exit() print(i + 0 - -h // a)
class Solution: def lengthOfLongestSubstringTwoDistinct(self, s: str) -> int: ret, l, r = 0, 0, 0 cnt = dict() hash_set = set() while r < len(s): cs = s[r] # print(hash_set, cnt, l, r) if cs not in cnt: cnt[cs] = 1 else:...
class Solution: def length_of_longest_substring_two_distinct(self, s: str) -> int: (ret, l, r) = (0, 0, 0) cnt = dict() hash_set = set() while r < len(s): cs = s[r] if cs not in cnt: cnt[cs] = 1 else: cnt[cs] += 1 ...
class Table(): def name(self) -> str: pass def alias(self) -> str: pass def prefix(self) -> str: pass def to_table(table: object) -> "Table": if isinstance(table, str): return SimpleTable(table) elif isinstance(table, Table): return table def new_table(n...
class Table: def name(self) -> str: pass def alias(self) -> str: pass def prefix(self) -> str: pass def to_table(table: object) -> 'Table': if isinstance(table, str): return simple_table(table) elif isinstance(table, Table): return table def new_table(nam...
def hello(): print("Hello!") print("===============") print(__name__) print("===============")
def hello(): print('Hello!') print('===============') print(__name__) print('===============')
''' Write a program to get two integers (a and b) and then proceed as follows: 1) Find all the odd numbers between a and b (including a and b) then display the result on the screen and separate each number with a space. 2) Find the sum of all the odd numbers from 1) and display the result on the screen. Input: A single...
""" Write a program to get two integers (a and b) and then proceed as follows: 1) Find all the odd numbers between a and b (including a and b) then display the result on the screen and separate each number with a space. 2) Find the sum of all the odd numbers from 1) and display the result on the screen. Input: A single...
class BaseRunner: def __init__(self): pass def run(self, config): raise NotImplementedError()
class Baserunner: def __init__(self): pass def run(self, config): raise not_implemented_error()
#Code for datetime # Python code to convert string to list TimeDelta = [] #timeStart def Convert(string): li = list(string.split("_")) return li # Driver code TStart = sheet_obj.cell(row=1, column=2) t1 = TStart.value #print(t1) #print(Convert(t1[0:4])) #print(t1) #print("Total years in hrs:") T1Yearsinhrs ...
time_delta = [] def convert(string): li = list(string.split('_')) return li t_start = sheet_obj.cell(row=1, column=2) t1 = TStart.value t1_yearsinhrs = 365 * 24 * int(t1[0:4]) t1months = int(t1[5:7]) if T1months == 1 or T1months == 3 or T1months == 5 or (T1months == 7) or (T1months == 8) or (T1months == 10) or...
coordinates_7F0030 = ((142, 128), (142, 131), (143, 128), (143, 132), (144, 127), (144, 129), (144, 130), (144, 131), (144, 133), (145, 127), (145, 129), (145, 130), (145, 131), (145, 133), (146, 126), (146, 128), (146, 129), (146, 130), (146, 131), (146, 132), (146, 134), (147, 126), (147, 128), (147, 129), (147, 13...
coordinates_7_f0030 = ((142, 128), (142, 131), (143, 128), (143, 132), (144, 127), (144, 129), (144, 130), (144, 131), (144, 133), (145, 127), (145, 129), (145, 130), (145, 131), (145, 133), (146, 126), (146, 128), (146, 129), (146, 130), (146, 131), (146, 132), (146, 134), (147, 126), (147, 128), (147, 129), (147, 130...
p = ('aprender','programar', 'linguagem', 'python', 'curso', 'gratis', 'estedar', 'praticar', 'trabalhar', 'mercado', 'programador', 'mercado', 'programador', 'futuro') for n in p: print(f'\nNa palavra {n.upper()}, temos: ', end='') for l in n: if l.lower() in 'aeiouy': print(l, end=' '...
p = ('aprender', 'programar', 'linguagem', 'python', 'curso', 'gratis', 'estedar', 'praticar', 'trabalhar', 'mercado', 'programador', 'mercado', 'programador', 'futuro') for n in p: print(f'\nNa palavra {n.upper()}, temos: ', end='') for l in n: if l.lower() in 'aeiouy': print(l, end=' ')
passports_valid = 0 default_value_passport = { 'byr': None, 'iyr': None, 'eyr': None, 'hgt': None, 'hcl': None, 'ecl': None, 'pid': None, 'cid': None } passport = None def is_valid(passport): for key, value in passport.items(): if key == 'cid': continue ...
passports_valid = 0 default_value_passport = {'byr': None, 'iyr': None, 'eyr': None, 'hgt': None, 'hcl': None, 'ecl': None, 'pid': None, 'cid': None} passport = None def is_valid(passport): for (key, value) in passport.items(): if key == 'cid': continue if value is None: ret...
print("Please welcome to the fibonacci sequence game") fib_count = input("Please enter the number of fibonacci numbers you want to have displayed. (Should be greater than or equal to 2): ") def find_fib(number): list_fib_numbers = [1,1] for number in range(2,number): new_fib_number = list_fib_numbers[-1] + lis...
print('Please welcome to the fibonacci sequence game') fib_count = input('Please enter the number of fibonacci numbers you want to have displayed. (Should be greater than or equal to 2): ') def find_fib(number): list_fib_numbers = [1, 1] for number in range(2, number): new_fib_number = list_fib_numbers...
# -*- coding: utf-8 -*- BOT_NAME = 'books' SPIDER_MODULES = ['books.spiders'] NEWSPIDER_MODULE = 'books.spiders' ROBOTSTXT_OBEY = True HTTPCACHE_ENABLED = True
bot_name = 'books' spider_modules = ['books.spiders'] newspider_module = 'books.spiders' robotstxt_obey = True httpcache_enabled = True
connection_uri = "postgresql://repl:password@localhost:5432/dwh" db_engine = sqlalchemy.create_engine(connection_uri) def load_to_dwh(recommendations): recommendations.to_sql("recommendations", db_engine, if_exists="replace") ''' In [1]: recommendations.to_sql? Signature: recommendations.to_sql(name, con, schem...
connection_uri = 'postgresql://repl:password@localhost:5432/dwh' db_engine = sqlalchemy.create_engine(connection_uri) def load_to_dwh(recommendations): recommendations.to_sql('recommendations', db_engine, if_exists='replace') " \nIn [1]: recommendations.to_sql?\nSignature: recommendations.to_sql(name, con, schema=...
a = input("Choose between 2 doors") if a == str(1): print("Door #1 choosen") elif a == str(2): print("Door #2 choosen") else: print("Wrong door! Choose again!") #if r = 1, restart counter r = 1 while r == 1: a = input("Choose between 2 doors") if a == str(1): ...
a = input('Choose between 2 doors') if a == str(1): print('Door #1 choosen') elif a == str(2): print('Door #2 choosen') else: print('Wrong door! Choose again!') r = 1 while r == 1: a = input('Choose between 2 doors') if a == str(1): print('Door #1 choosen') b ...
input_file = open("input.txt", "r") entriesArray = input_file.read().split("\n") iterationLength = len(entriesArray) - 1 #print(entriesArray) entrySum = 0 goalSum = 2020 pointer1 = pointer2 = 0 def main(): for pointer1 in range(iterationLength): for x in range(iterationLength - pointer1 - 1): ...
input_file = open('input.txt', 'r') entries_array = input_file.read().split('\n') iteration_length = len(entriesArray) - 1 entry_sum = 0 goal_sum = 2020 pointer1 = pointer2 = 0 def main(): for pointer1 in range(iterationLength): for x in range(iterationLength - pointer1 - 1): pointer2 = x + poi...
# Set and Dictionary Comprehensions friends = ['Rolf','ruth','charlie','Jen'] guests = ['jose','Bob','Rolf','Charlie','michael'] friends_lower = set([f.lower() for f in friends]) guests_lower = set([g.lower() for g in guests]) # Instead of using the set function, we can use as. friends_lower = {f.lower() for f in fr...
friends = ['Rolf', 'ruth', 'charlie', 'Jen'] guests = ['jose', 'Bob', 'Rolf', 'Charlie', 'michael'] friends_lower = set([f.lower() for f in friends]) guests_lower = set([g.lower() for g in guests]) friends_lower = {f.lower() for f in friends} guests_lower = {g.lower() for g in guests} present_friends = {name.title() fo...
'test unpacking variables' def func1(): 'should not warn' x, z = (5, 2) def func2(): 'should warn' x, y, z = (5, 2) def func3(): 'should warn' a = (5, 2) x, y, z = a def func4(): 'should warn' x, = (5, 2) def func5(): 'should warn' x, y = 5, def func6(): 'should war...
"""test unpacking variables""" def func1(): """should not warn""" (x, z) = (5, 2) def func2(): """should warn""" (x, y, z) = (5, 2) def func3(): """should warn""" a = (5, 2) (x, y, z) = a def func4(): """should warn""" (x,) = (5, 2) def func5(): """should warn""" (x, y) ...
class Node(object): def __init__(self, val): self.val = val self.children = [] def __repr__(self): return "Val: {}, Children: {}".format(self.val, self.children) def add_child(self, obj): self.children.append(obj)
class Node(object): def __init__(self, val): self.val = val self.children = [] def __repr__(self): return 'Val: {}, Children: {}'.format(self.val, self.children) def add_child(self, obj): self.children.append(obj)
fuck = '25670134 01234567 76543210 01234576 67543210 01234657 75643210 01234675 57643210 01234756 65743210 01234765 56743210 01235467 76453210 01235476 67453210 01235647 74653210 01235674 47653210 01235746 64753210 01235764 46753210 01236457 75463210 01236475 57463210 01236547 74563210 01236574 47563210 01236745 547632...
fuck = '25670134 01234567 76543210 01234576 67543210 01234657 75643210 01234675 57643210 01234756 65743210 01234765 56743210 01235467 76453210 01235476 67453210 01235647 74653210 01235674 47653210 01235746 64753210 01235764 46753210 01236457 75463210 01236475 57463210 01236547 74563210 01236574 47563210 01236745 547632...
set_of_numbers = {1,2,3} print(set_of_numbers) #{1, 2, 3} set_of_strings = {"a", "b"} print(set_of_strings) #{'b', 'a'} set_of_imutables = {"a", 1, "b", 2, 3} print(set_of_imutables) #{'a', 'b', 2, 3, 1} set_of_mutables = { [1,2,3], ["a", "b"] } print(set_of_imutables) #TypeError: unhashable type: 'list'
set_of_numbers = {1, 2, 3} print(set_of_numbers) set_of_strings = {'a', 'b'} print(set_of_strings) set_of_imutables = {'a', 1, 'b', 2, 3} print(set_of_imutables) set_of_mutables = {[1, 2, 3], ['a', 'b']} print(set_of_imutables)
{ "includes": [ "../common.gypi" ], "targets": [ { "target_name": "libgdal_ogr_sua_frmt", "type": "static_library", "sources": [ "../gdal/ogr/ogrsf_frmts/sua/ogrsuadatasource.cpp", "../gdal/ogr/ogrsf_frmts/sua/ogrsuadriver.cpp", "../gdal/ogr/ogrsf_frmts/sua/ogrsualayer.cpp" ], "include...
{'includes': ['../common.gypi'], 'targets': [{'target_name': 'libgdal_ogr_sua_frmt', 'type': 'static_library', 'sources': ['../gdal/ogr/ogrsf_frmts/sua/ogrsuadatasource.cpp', '../gdal/ogr/ogrsf_frmts/sua/ogrsuadriver.cpp', '../gdal/ogr/ogrsf_frmts/sua/ogrsualayer.cpp'], 'include_dirs': ['../gdal/ogr/ogrsf_frmts/sua', '...
class Solution(object): def countSubstrings(self, S): res = 0 # Account for centers in between characters for i in range((2*len(S))-1): left = int(i / 2) right = int((i+1)/2) # Perform expand and match at each center while left >= 0 and righ...
class Solution(object): def count_substrings(self, S): res = 0 for i in range(2 * len(S) - 1): left = int(i / 2) right = int((i + 1) / 2) while left >= 0 and right < len(S): if S[left] == S[right]: res += 1 else...
class BaseProvider(object): def __init__(self, opts): self.opts = opts def get_site_info(self): return {} def get_images(self): return {} def get_templates(self): return {} def get_compute_endpoints(self): return {} def get_storage_endpoints(self): ...
class Baseprovider(object): def __init__(self, opts): self.opts = opts def get_site_info(self): return {} def get_images(self): return {} def get_templates(self): return {} def get_compute_endpoints(self): return {} def get_storage_endpoints(self): ...
class Contestant: def __init__(self, first_name, last_name, email_address, registration_number): self.first_name = '' self.last_name = '' self.email_address = '' self.registration_number = '' def notify(self): pass
class Contestant: def __init__(self, first_name, last_name, email_address, registration_number): self.first_name = '' self.last_name = '' self.email_address = '' self.registration_number = '' def notify(self): pass
class Folders: def __init__(self): self.camera_left_front = 'camera_left_front/' self.camera_left_side = 'camera_left_side/' self.camera_right_front = 'camera_right_front/' self.camera_right_side = 'camera_right_side/' self.camera_ir = 'camera_ir/' self.lidar_left = ...
class Folders: def __init__(self): self.camera_left_front = 'camera_left_front/' self.camera_left_side = 'camera_left_side/' self.camera_right_front = 'camera_right_front/' self.camera_right_side = 'camera_right_side/' self.camera_ir = 'camera_ir/' self.lidar_left = ...