content
stringlengths
7
1.05M
fixed_cases
stringlengths
1
1.28M
class Solution: def twoCitySchedCost(self, costs: List[List[int]]) -> int: for i in range(0,len(costs)): costs[i].append(costs[i][0]-costs[i][1]) costs.sort(key = lambda x:x[2]) result=0 for i in range(0,len(costs)//2): result+=costs[i][0] for ...
class Solution: def two_city_sched_cost(self, costs: List[List[int]]) -> int: for i in range(0, len(costs)): costs[i].append(costs[i][0] - costs[i][1]) costs.sort(key=lambda x: x[2]) result = 0 for i in range(0, len(costs) // 2): result += costs[i][0] ...
""" Constants Module for Flambda APP Version: 1.0.0 """ LIMIT = 20 OFFSET = 0 PAGINATION_LIMIT = 100
""" Constants Module for Flambda APP Version: 1.0.0 """ limit = 20 offset = 0 pagination_limit = 100
print("To print the place values of integer") a=int(input("Enter the integer value:")) n=a%10 print("The unit digit of {} is{}".format(a,n))
print('To print the place values of integer') a = int(input('Enter the integer value:')) n = a % 10 print('The unit digit of {} is{}'.format(a, n))
# Definition for a binary tree node. # class TreeNode(object): # def __init__(self, val=0, left=None, right=None): # self.val = val # self.left = left # self.right = right class Solution(object): def deleteNode(self, root, key): if not root: # if root doesn't exist, just return i...
class Solution(object): def delete_node(self, root, key): if not root: return root if root.val > key: root.left = self.deleteNode(root.left, key) elif root.val < key: root.right = self.deleteNode(root.right, key) else: if not root.righ...
ilksayi=1 ikincisayi=1 fibo=[ilksayi,ikincisayi] for i in range(0,20): ilksayi,ikincisayi=ikincisayi,ilksayi+ikincisayi fibo.append(ikincisayi) print(fibo)
ilksayi = 1 ikincisayi = 1 fibo = [ilksayi, ikincisayi] for i in range(0, 20): (ilksayi, ikincisayi) = (ikincisayi, ilksayi + ikincisayi) fibo.append(ikincisayi) print(fibo)
class BinaryNotFound(Exception): def __init__(self, binary_name): Exception.__init__(self) self.binary_name = binary_name class BinaryCallFailed(Exception): def __init__(self): Exception.__init__(self) class InvalidMedia(Exception): def __init__(self, media_path): Excepti...
class Binarynotfound(Exception): def __init__(self, binary_name): Exception.__init__(self) self.binary_name = binary_name class Binarycallfailed(Exception): def __init__(self): Exception.__init__(self) class Invalidmedia(Exception): def __init__(self, media_path): Except...
#!/usr/bin/python2.4 # # Copyright 2009 Google Inc. # # Licensed under the Apache License, Version 2.0 (the 'License') # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ...
""" Defines the code snippets that the JavaScript Knowledge Base tracks. """ __author__ = 'msamuel@google.com (Mike Samuel)' __all__ = ['SNIPPET_GROUPS', 'with_name', 'CODE', 'DOC', 'GOOD', 'NAME', 'SUMMARY', 'VALUES', 'ABBREV', 'SNIPPET_NAMES'] def alt(mayThrow, altValue): """Combines an expression with a fallbac...
# Definition for singly-linked list. class ListNode: def __init__(self, val=0, next=None): self.val = val self.next = next class Solution: def removeElements(self, head: ListNode, val: int) -> ListNode: current = head previous = None while current is not None: ...
class Listnode: def __init__(self, val=0, next=None): self.val = val self.next = next class Solution: def remove_elements(self, head: ListNode, val: int) -> ListNode: current = head previous = None while current is not None: if current.val == val: ...
## ## # File auto-generated against equivalent DynamicSerialize Java class class DeleteFilesRequest(object): def __init__(self): self.datesToDelete = None def getDatesToDelete(self): return self.datesToDelete def setDatesToDelete(self, datesToDelete): self.datesToDelete = datesT...
class Deletefilesrequest(object): def __init__(self): self.datesToDelete = None def get_dates_to_delete(self): return self.datesToDelete def set_dates_to_delete(self, datesToDelete): self.datesToDelete = datesToDelete def get_filename(self): return self.filename ...
# -*- coding: utf-8 -*- ''' In a given list the first element should become the last one. An empty list or list with only one element should stay the same. Input: List. Output: Iterable. ''' def replace_first(items): # your code here return items[1:] + items[:1] if __name__ == "__main__": print("Examp...
""" In a given list the first element should become the last one. An empty list or list with only one element should stay the same. Input: List. Output: Iterable. """ def replace_first(items): return items[1:] + items[:1] if __name__ == '__main__': print('Example:') print(list(replace_first([1, 2, 3, 4]))...
#!/usr/bin/python # coding=utf-8 """Scripts related to datasets dowloading and preprocessing."""
"""Scripts related to datasets dowloading and preprocessing."""
''' FetcherResponse will return a well-formed FetcherResponse object { name: string, payload: {file_name: binary_data} | None, source: string error: Error object } "payload" - string - binary data from a successful url fetch or None on fail "source" - string - the url t...
""" FetcherResponse will return a well-formed FetcherResponse object { name: string, payload: {file_name: binary_data} | None, source: string error: Error object } "payload" - string - binary data from a successful url fetch or None on fail "source" - string - the url t...
load(":character_classes.bzl", "is_alphanumeric", "is_lower_case_letter", "is_numeric", "is_upper_case_letter") def tokenize(s): queue = [] parts = [] part = "" for i in range(len(s)): ch = s[i] if is_alphanumeric(ch): if len(queue) == 2: if is_upper_case_let...
load(':character_classes.bzl', 'is_alphanumeric', 'is_lower_case_letter', 'is_numeric', 'is_upper_case_letter') def tokenize(s): queue = [] parts = [] part = '' for i in range(len(s)): ch = s[i] if is_alphanumeric(ch): if len(queue) == 2: if is_upper_case_let...
# stats.py def init(): global _stats _stats = {} def event_occurred(event): global _stats try: _stats[event] = _stats[event] + 1 except KeyError: _stats[event] = 1 def get_stats(): global _stats return sorted(_stats.items())
def init(): global _stats _stats = {} def event_occurred(event): global _stats try: _stats[event] = _stats[event] + 1 except KeyError: _stats[event] = 1 def get_stats(): global _stats return sorted(_stats.items())
""" his file illustrates the bad version of some_fun. I've included the dependencies but the implementations are dummied out. """ class Logger: def log(self, msg): pass logger = Logger() def is_valid(x): pass def some_fun(x): if is_valid(x): return x * 5 else: logger.log(...
""" his file illustrates the bad version of some_fun. I've included the dependencies but the implementations are dummied out. """ class Logger: def log(self, msg): pass logger = logger() def is_valid(x): pass def some_fun(x): if is_valid(x): return x * 5 else: logger.log('Inv...
class TimSort: def __init__(self, array, run_size=32): self.array = array self.run_size = run_size def insertionSort(self, array, left_index, right_index): """ performs insertion sort on a given array :param array: the array to sort :param left_index: the lower bound of ...
class Timsort: def __init__(self, array, run_size=32): self.array = array self.run_size = run_size def insertion_sort(self, array, left_index, right_index): """ performs insertion sort on a given array :param array: the array to sort :param left_index: the lower bound o...
def is_odd(n): return n % 2 == 1 def collatz(n): xs = [] while n != 1: xs.append(n) if is_odd(n): n = 3*n + 1 else: n = n // 2 xs.append(1) return xs def test_collatz(): assert collatz(8) == [8, 4, 2, 1] assert collatz(5) == [5, 16, 8, 4, 2, ...
def is_odd(n): return n % 2 == 1 def collatz(n): xs = [] while n != 1: xs.append(n) if is_odd(n): n = 3 * n + 1 else: n = n // 2 xs.append(1) return xs def test_collatz(): assert collatz(8) == [8, 4, 2, 1] assert collatz(5) == [5, 16, 8, 4, 2...
email = [ "rwandaonline.rw", "rra.gov.rw", "ur.ac.rw", "gmail.com", "yahoo.com", "yahoo.fr" ]
email = ['rwandaonline.rw', 'rra.gov.rw', 'ur.ac.rw', 'gmail.com', 'yahoo.com', 'yahoo.fr']
print('list as x y z ...') a = [] a = input().split(' ') a = list(map(int, a)) for elemt in (map(lambda x: 'par' if x%2 == 0 else 'impar', a)): print (elemt)
print('list as x y z ...') a = [] a = input().split(' ') a = list(map(int, a)) for elemt in map(lambda x: 'par' if x % 2 == 0 else 'impar', a): print(elemt)
while True: try: n = int(input()) except: break data = list() maax = list() miin = list() for x in range(n): data.append(list(map(int, input().split()))) for x in range(n): maax.append(data[x][1]) miin.append(data[x][0]) result = [0]*(...
while True: try: n = int(input()) except: break data = list() maax = list() miin = list() for x in range(n): data.append(list(map(int, input().split()))) for x in range(n): maax.append(data[x][1]) miin.append(data[x][0]) result = [0] * (max(maax) -...
applyPatch('20210630-dldt-disable-unused-targets.patch') applyPatch('20210630-dldt-pdb.patch') applyPatch('20210630-dldt-disable-multidevice-autoplugin.patch') applyPatch('20210630-dldt-vs-version.patch')
apply_patch('20210630-dldt-disable-unused-targets.patch') apply_patch('20210630-dldt-pdb.patch') apply_patch('20210630-dldt-disable-multidevice-autoplugin.patch') apply_patch('20210630-dldt-vs-version.patch')
try: age = int(input("How old are you: ")) #if statement if age < 0: print("You are a time traveller") else: if 0 < age <= 17: print("Too young to vote") else: if age >= 18: print("You can vote") except: print("Please use only numeric...
try: age = int(input('How old are you: ')) if age < 0: print('You are a time traveller') elif 0 < age <= 17: print('Too young to vote') elif age >= 18: print('You can vote') except: print('Please use only numeric values')
# iterating backwards # removing rogue vlues # when an item 's removed from the list, all the later items are shuffled down, to fill in the gap # That messes upu the index numbers, as we work forwards through the list data = [104, 101, 4, 105, 308, 103, 5, 107, 100, 306, 106, 102, 108] min_valid = 100 max_valid...
data = [104, 101, 4, 105, 308, 103, 5, 107, 100, 306, 106, 102, 108] min_valid = 100 max_valid = 200 top_index = len(data) - 1 for (index, value) in enumerate(reversed(data)): if value < min_valid or value > max_valid: print(top_index - index, value) del data[top_index - index] print(data)
# A quick solution for day 12 part 2 in Python # for debugging of the Pascal version x = 0 y = 0 wx = 10 wy = -1 with open('resources/input.txt', 'r') as f: for l in f.readlines(): l = l.strip() i = l[0] n = int(l[1:]) if i == 'N': wy -= n elif i == 'W': ...
x = 0 y = 0 wx = 10 wy = -1 with open('resources/input.txt', 'r') as f: for l in f.readlines(): l = l.strip() i = l[0] n = int(l[1:]) if i == 'N': wy -= n elif i == 'W': wx -= n elif i == 'S': wy += n elif i == 'E': ...
a = get() b = execute(mogrify(get())) print(b) mogrify(a) c = get()
a = get() b = execute(mogrify(get())) print(b) mogrify(a) c = get()
""" (System)Verilog language keyword lists """ IEEE1364_1995_KEYWORDS = [ "always", "and", "assign", "begin", "buf", "bufif0", "bufif1", "case", "casex", "casez", "cmos", "deassign", "default", "defparam", "disable", "edge", "else", "end", "en...
""" (System)Verilog language keyword lists """ ieee1364_1995_keywords = ['always', 'and', 'assign', 'begin', 'buf', 'bufif0', 'bufif1', 'case', 'casex', 'casez', 'cmos', 'deassign', 'default', 'defparam', 'disable', 'edge', 'else', 'end', 'endcase', 'endfunction', 'endmodule', 'endprimitive', 'endspecify', 'endtable', ...
year=int(input('enter a num:')) if year%4==0 or year%400==0: print('leap year') else: print('not')
year = int(input('enter a num:')) if year % 4 == 0 or year % 400 == 0: print('leap year') else: print('not')
# A few global config settings API_KEY='' ORG_ID='' S3_BUCKET_NAME='' S3_ACCESS_KEY='' S3_SECRET_KEY='' MY_ID='' PLAYER_LICENSE=''
api_key = '' org_id = '' s3_bucket_name = '' s3_access_key = '' s3_secret_key = '' my_id = '' player_license = ''
__authors__ = "" __copyright__ = "(c) 2014, pymal" __license__ = "BSD License" __contact__ = "Name Of Current Guardian of this file <email@address>" USER_AGENT = 'api-indiv-0829BA2B33942A4A5E6338FE05EFB8A1' HOST_NAME = "http://myanimelist.net" DEBUG = False RETRY_NUMBER = 4 RETRY_SLEEP = 1 SHORT_SITE_FORMAT_TIME = ...
__authors__ = '' __copyright__ = '(c) 2014, pymal' __license__ = 'BSD License' __contact__ = 'Name Of Current Guardian of this file <email@address>' user_agent = 'api-indiv-0829BA2B33942A4A5E6338FE05EFB8A1' host_name = 'http://myanimelist.net' debug = False retry_number = 4 retry_sleep = 1 short_site_format_time = '%b ...
class Solution: def nextGreaterElements(self, nums: List[int]) -> List[int]: n = len(nums) stack = [] result = [-1] * n for i in range(n * 2): value = nums[i % n] while stack and nums[stack[-1] % n] < value: result[stack.pop() % n] = va...
class Solution: def next_greater_elements(self, nums: List[int]) -> List[int]: n = len(nums) stack = [] result = [-1] * n for i in range(n * 2): value = nums[i % n] while stack and nums[stack[-1] % n] < value: result[stack.pop() % n] = value ...
# Part One matrix = [] with open("input") as f: for row in f: matrix.append(row) gama_rate = "" epsilon_rate = "" element_list = [] def most_frequent(List): return max(set(List), key=List.count) l_row = int(len(matrix[0])) for el in range(1, l_row): for row in matrix: element = row[el...
matrix = [] with open('input') as f: for row in f: matrix.append(row) gama_rate = '' epsilon_rate = '' element_list = [] def most_frequent(List): return max(set(List), key=List.count) l_row = int(len(matrix[0])) for el in range(1, l_row): for row in matrix: element = row[el - 1] ele...
class Address: host = 'localhost' port = '9666' def __init__(self, host=None, port=None): if host is not None: self.host = host if port is not None: self.port = port def is_empty(self) -> bool: return self.host == '' or self.port == '' def string(se...
class Address: host = 'localhost' port = '9666' def __init__(self, host=None, port=None): if host is not None: self.host = host if port is not None: self.port = port def is_empty(self) -> bool: return self.host == '' or self.port == '' def string(se...
f = open("cub_200/val.txt", "r") class_dict = {} rtn = open('val_tmp.txt', 'w') for x in f: class_int = int(x[7:10]) if class_int not in class_dict.keys(): class_dict[class_int] = 1 else: class_dict[class_int] += 1 if class_dict[class_int] > 5: if class_int % 2 == 0: ...
f = open('cub_200/val.txt', 'r') class_dict = {} rtn = open('val_tmp.txt', 'w') for x in f: class_int = int(x[7:10]) if class_int not in class_dict.keys(): class_dict[class_int] = 1 else: class_dict[class_int] += 1 if class_dict[class_int] > 5: if class_int % 2 == 0: ...
class Solution(object): def kSmallestPairs(self, nums1, nums2, k): """ :type nums1: List[int] :type nums2: List[int] :type k: int :rtype: List[List[int]] """ # https://discuss.leetcode.com/topic/50450/slow-1-liner-to-fast-solutions queue = [] d...
class Solution(object): def k_smallest_pairs(self, nums1, nums2, k): """ :type nums1: List[int] :type nums2: List[int] :type k: int :rtype: List[List[int]] """ queue = [] def push(i, j): if i < len(nums1) and j < len(nums2): ...
# coding: utf-8 DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', 'NAME': ':memory:', }, } INSTALLED_APPS = ( 'django.contrib.auth', 'django.contrib.sites', 'django.contrib.sessions', 'django.contrib.contenttypes', 'registration', 'test_app', ) SECRET_K...
databases = {'default': {'ENGINE': 'django.db.backends.sqlite3', 'NAME': ':memory:'}} installed_apps = ('django.contrib.auth', 'django.contrib.sites', 'django.contrib.sessions', 'django.contrib.contenttypes', 'registration', 'test_app') secret_key = '_' site_id = 1 root_urlconf = 'test_app.urls' template_loaders = ('dj...
# -*- coding: utf-8 -*- """ 1561. Maximum Number of Coins You Can Get There are 3n piles of coins of varying size, you and your friends will take piles of coins as follows: In each step, you will choose any 3 piles of coins (not necessarily consecutive). Of your choice, Alice will pick the pile with the maximum numbe...
""" 1561. Maximum Number of Coins You Can Get There are 3n piles of coins of varying size, you and your friends will take piles of coins as follows: In each step, you will choose any 3 piles of coins (not necessarily consecutive). Of your choice, Alice will pick the pile with the maximum number of coins. You will pic...
class APIError(Exception): code = -1 message = 'Unknown error' def __init__(self, message=None, details=None, data={}, response=None): self.message = message or self.message self.details = details self.data = data or {} self.response = response def __str__(self): ...
class Apierror(Exception): code = -1 message = 'Unknown error' def __init__(self, message=None, details=None, data={}, response=None): self.message = message or self.message self.details = details self.data = data or {} self.response = response def __str__(self): ...
def show_state(state, player): return { 'hands': state['hands'], 'turn': state['turn'], }
def show_state(state, player): return {'hands': state['hands'], 'turn': state['turn']}
class MultimodalDataset: def __init__(self, samples, modality_factories): super().__init__() self.samples = samples self.modality_factories = modality_factories self._register_modalites_to_samples() def _register_modalites_to_samples(self): for sample in self.samples: ...
class Multimodaldataset: def __init__(self, samples, modality_factories): super().__init__() self.samples = samples self.modality_factories = modality_factories self._register_modalites_to_samples() def _register_modalites_to_samples(self): for sample in self.samples: ...
class Solution: def isValid(self, s: str) -> bool: matched=[0 for i in range(len(s))] open_brace=0 find='' for i in range (len(s)): if(s[i]==')' or s[i]=='}' or s[i]==']'): if(s[i]==')'): find='(' ...
class Solution: def is_valid(self, s: str) -> bool: matched = [0 for i in range(len(s))] open_brace = 0 find = '' for i in range(len(s)): if s[i] == ')' or s[i] == '}' or s[i] == ']': if s[i] == ')': find = '(' elif s[i...
def generate( args ): args = args.split(',') start = int(args[0]) numGroups = int(args[1]) perGroup = int(args[2]) interval = int(args[3]) ret = '' for i in range(numGroups): first = start + i * interval last = first + perGroup - 1 ret = ret + '{0}-{1}'.format...
def generate(args): args = args.split(',') start = int(args[0]) num_groups = int(args[1]) per_group = int(args[2]) interval = int(args[3]) ret = '' for i in range(numGroups): first = start + i * interval last = first + perGroup - 1 ret = ret + '{0}-{1}'.format(first, ...
_base_ = '../retinanet/retinanet_r50_fpn_1x_coco.py' model = dict( neck=[ dict( type='FPN', in_channels=[256, 512, 1024, 2048], out_channels=256, start_level=1, add_extra_convs='on_input', num_outs=5), dict( type='SEPC...
_base_ = '../retinanet/retinanet_r50_fpn_1x_coco.py' model = dict(neck=[dict(type='FPN', in_channels=[256, 512, 1024, 2048], out_channels=256, start_level=1, add_extra_convs='on_input', num_outs=5), dict(type='SEPC', out_channels=256, Pconv_num=4, pconv_deform=False, lcconv_deform=False, iBN=False)], bbox_head=dict(typ...
def main(): week={'A':'MON','B':'TUE','C':'WED','D':'THU','E':'FRI','F':'SAT','G':'SUN'} strs = [] for i in range(0,4): strs.append(input()) for i in range(0,min(len(strs[0]),len(strs[1]))): if(strs[0][i]==strs[1][i]): if(strs[0][i]>='A' and strs[0][i]<='G'): ...
def main(): week = {'A': 'MON', 'B': 'TUE', 'C': 'WED', 'D': 'THU', 'E': 'FRI', 'F': 'SAT', 'G': 'SUN'} strs = [] for i in range(0, 4): strs.append(input()) for i in range(0, min(len(strs[0]), len(strs[1]))): if strs[0][i] == strs[1][i]: if strs[0][i] >= 'A' and strs[0][i] <=...
# Copyright 2020 The Kythe Authors. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law...
"""RBE toolchain specification.""" load('//tools/platforms/configs:versions.bzl', 'TOOLCHAIN_CONFIG_AUTOGEN_SPEC') default_toolchain_config_suite_spec = {'repo_name': 'io_kythe', 'output_base': 'tools/platforms/configs', 'container_repo': 'kythe-repo/kythe-builder', 'container_registry': 'gcr.io', 'default_java_home': ...
class Mail: def __init__(self, application, driver_config=None): self.application = application self.drivers = {} self.driver_config = driver_config or {} self.options = {} def add_driver(self, name, driver): self.drivers.update({name: driver}) def set_configuration...
class Mail: def __init__(self, application, driver_config=None): self.application = application self.drivers = {} self.driver_config = driver_config or {} self.options = {} def add_driver(self, name, driver): self.drivers.update({name: driver}) def set_configuratio...
# # PySNMP MIB module H3C-BLG-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/H3C-BLG-MIB # Produced by pysmi-0.3.4 at Wed May 1 13:21:27 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, 0...
(octet_string, object_identifier, integer) = mibBuilder.importSymbols('ASN1', 'OctetString', 'ObjectIdentifier', 'Integer') (named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues') (single_value_constraint, constraints_union, constraints_intersection, value_range_constraint, value_size_constraint) ...
class AutoTuneCommands(object): _command = "ju" def __init__(self, send_command): self._send_command = send_command async def call(self): return await self._send_command(self._command, 1)
class Autotunecommands(object): _command = 'ju' def __init__(self, send_command): self._send_command = send_command async def call(self): return await self._send_command(self._command, 1)
#Heap Sort as the name suggests, uses the heap data structure. #First the array is converted into a binary heap. Then the first element which is the maximum elemet in case of a max-heap, #is swapped with the last element so that the maximum element goes to the end of the array as it should be in a sorted array. #Then t...
count = 0 def max_heapify(array, heap_size, i): left = 2 * i + 1 right = 2 * i + 2 largest = i global count if left < heap_size: count += 1 if array[left] > array[largest]: largest = left if right < heap_size: count += 1 if array[right] > array[larges...
class A: def __init__(self, *, a): pass class B(A): def __init__(self, a): super().__init__(a=a)
class A: def __init__(self, *, a): pass class B(A): def __init__(self, a): super().__init__(a=a)
class Ball: def __init__(self): self.position = PVector(width * 0.5, height * 0.5) self.w = 20 self.velocity = PVector(5, 5) self.score_player_one = False self.score_player_two = False def show(self): fill(255) ellipse(self.position.x, self.position.y, sel...
class Ball: def __init__(self): self.position = p_vector(width * 0.5, height * 0.5) self.w = 20 self.velocity = p_vector(5, 5) self.score_player_one = False self.score_player_two = False def show(self): fill(255) ellipse(self.position.x, self.position.y,...
#!/usr/bin/env python3 # coding: utf8 """ This script contains functions to calculate error rates, including word error rate, sentence error rate, and more specific error rates such as digit error rate. """ def sentence_error(source, target): """ Evaluate whether the target is identical to the source. ...
""" This script contains functions to calculate error rates, including word error rate, sentence error rate, and more specific error rates such as digit error rate. """ def sentence_error(source, target): """ Evaluate whether the target is identical to the source. Args: source (str): Source strin...
ISOCHRONES_DATASET_NAME = "webapp_isochrones" LOCATIONS_DATASET_NAME = "webapp_locations" CUSTOMERS_DATASET_NAME = "webapp_customers" CUSTOMERS_NO_FILTERING_COLUMNS = [ 'id', 'customer_uuid', 'location_uuid', 'isochrone_type', 'distance_customer_location', 'isochrone_id', 'isochrone_amplit...
isochrones_dataset_name = 'webapp_isochrones' locations_dataset_name = 'webapp_locations' customers_dataset_name = 'webapp_customers' customers_no_filtering_columns = ['id', 'customer_uuid', 'location_uuid', 'isochrone_type', 'distance_customer_location', 'isochrone_id', 'isochrone_amplitude', 'isochrone_label', 'isoch...
# # PySNMP MIB module Nortel-MsCarrier-MscPassport-AtmBearerServiceMIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/Nortel-MsCarrier-MscPassport-AtmBearerServiceMIB # Produced by pysmi-0.3.4 at Wed May 1 14:29:02 2019 # On host DAVWANG4-M-1475 platform Darwin version 18....
(object_identifier, octet_string, integer) = mibBuilder.importSymbols('ASN1', 'ObjectIdentifier', 'OctetString', 'Integer') (named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues') (constraints_union, value_range_constraint, constraints_intersection, value_size_constraint, single_value_constraint) ...
class Solution: def XXX(self, a: str, b: str) -> str: if len(a) < len(b): a, b = b, a b = '0' * (len(a) - len(b)) + b c = [] flag = 0 for i in range(1, len(a) + 1): c.insert(0, str( (int(a[-i]) + int(b[-i]) + flag) % 2)) flag = ( int(a[-i]...
class Solution: def xxx(self, a: str, b: str) -> str: if len(a) < len(b): (a, b) = (b, a) b = '0' * (len(a) - len(b)) + b c = [] flag = 0 for i in range(1, len(a) + 1): c.insert(0, str((int(a[-i]) + int(b[-i]) + flag) % 2)) flag = (int(a[-...
def application(environment, start_response): response_body = ( 'Greetings to all Python developers! ' 'This is standard WSGI handler.' ) status = '200 OK' response_headers = [ ('Content-Type', 'text/plain'), ('Content-Length', str(len(response_body))), ] start_re...
def application(environment, start_response): response_body = 'Greetings to all Python developers! This is standard WSGI handler.' status = '200 OK' response_headers = [('Content-Type', 'text/plain'), ('Content-Length', str(len(response_body)))] start_response(status, response_headers) return [respo...
# 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 isValidBST(self, root: TreeNode) -> bool: if not root: return True stack=[(r...
class Solution: def is_valid_bst(self, root: TreeNode) -> bool: if not root: return True stack = [(root, -math.inf, math.inf)] while stack: (node, lower, upper) = stack.pop() if node: val = node.val print(val, lower, upper)...
def test_soap(app): project_list = app.soap.get_project_name_list("administrator", "root") print("\n" + str(project_list)) print(len(project_list))
def test_soap(app): project_list = app.soap.get_project_name_list('administrator', 'root') print('\n' + str(project_list)) print(len(project_list))
MOCK_DATA = [ { "symbol": "AMD", "companyName": "Advanced Micro Devices Inc.", "exchange": "NASDAQ Capital Market", "industry": "Semiconductors", "website": "http://www.amd.com", "description": "Advanced Micro Devices Inc designs and produces microprocessors and low-p...
mock_data = [{'symbol': 'AMD', 'companyName': 'Advanced Micro Devices Inc.', 'exchange': 'NASDAQ Capital Market', 'industry': 'Semiconductors', 'website': 'http://www.amd.com', 'description': 'Advanced Micro Devices Inc designs and produces microprocessors and low-power processor solutions for the computer, communicati...
""" Identities: module definition """ PROPERTIES = { 'title': 'Contacts', 'details': 'Manage users, groups, companies and corresponding contacts', 'url': '/contacts/', 'system': True, 'type': 'minor', } URL_PATTERNS = [ '^/contacts/', ]
""" Identities: module definition """ properties = {'title': 'Contacts', 'details': 'Manage users, groups, companies and corresponding contacts', 'url': '/contacts/', 'system': True, 'type': 'minor'} url_patterns = ['^/contacts/']
"""Without the letter 'E', CodeWars Kata, level 7.""" def with_without_e(s): """Return number of Es in string. input = string output = count in string form of Es """ if not s: return s count = 0 for e in s: if e == 'e' or e == 'E': count += 1 if count == 0:...
"""Without the letter 'E', CodeWars Kata, level 7.""" def with_without_e(s): """Return number of Es in string. input = string output = count in string form of Es """ if not s: return s count = 0 for e in s: if e == 'e' or e == 'E': count += 1 if count == 0: ...
class Solution: # O(n) time | O(1) space - where n is the length of the input list. def maxProfit(self, prices: List[int]) -> int: minPrice = prices[0] maxProfit = 0 for i in range(1, len(prices)): if prices[i] < minPrice: minPrice = prices[i] eli...
class Solution: def max_profit(self, prices: List[int]) -> int: min_price = prices[0] max_profit = 0 for i in range(1, len(prices)): if prices[i] < minPrice: min_price = prices[i] elif prices[i] - minPrice > maxProfit: max_profit = pri...
class Article: def __init__(self,title,urlToImage,description,url,author): self.title=title self.urlToImage=urlToImage self.description=description self.author=author self.url=url class Source: def __init__(self,name,description): self.name=name self.desc...
class Article: def __init__(self, title, urlToImage, description, url, author): self.title = title self.urlToImage = urlToImage self.description = description self.author = author self.url = url class Source: def __init__(self, name, description): self.name = n...
def findDecision(obj): #obj[0]: Passanger, obj[1]: Time, obj[2]: Coupon, obj[3]: Coupon_validity, obj[4]: Gender, obj[5]: Age, obj[6]: Children, obj[7]: Education, obj[8]: Occupation, obj[9]: Income, obj[10]: Bar, obj[11]: Coffeehouse, obj[12]: Restaurant20to50, obj[13]: Direction_same, obj[14]: Distance # {"feature":...
def find_decision(obj): if obj[6] > 0: if obj[10] <= 1.0: if obj[1] > 0: if obj[12] <= 1.0: return 'False' elif obj[12] > 1.0: return 'True' else: return 'True' elif obj[1] <= ...
""" ThreatStack Python Client Exceptions """ class Error(Exception): pass class ThreatStackClientError(Exception): pass class ThreatStackAPIError(Error): pass class APIRateLimitError(Error): """ Used to trigger retry on rate limit """ pass
""" ThreatStack Python Client Exceptions """ class Error(Exception): pass class Threatstackclienterror(Exception): pass class Threatstackapierror(Error): pass class Apiratelimiterror(Error): """ Used to trigger retry on rate limit """ pass
class Solution: def XXX(self, nums: List[int]) -> bool: nextdis = 0 curdis = 0 for i in range(len(nums)): nextdis = max(i+nums[i], nextdis) if i==curdis: curdis = nextdis if nextdis >= len(nums)-1: return True ...
class Solution: def xxx(self, nums: List[int]) -> bool: nextdis = 0 curdis = 0 for i in range(len(nums)): nextdis = max(i + nums[i], nextdis) if i == curdis: curdis = nextdis if nextdis >= len(nums) - 1: return True...
"""This module is for learning This module has basic functions to work with numbers """ def is_even(number: int) -> bool: """ This method will find if the number passed is even or not :param number : a number :return: True if even False otherwise """ if number <= 0: return False ...
"""This module is for learning This module has basic functions to work with numbers """ def is_even(number: int) -> bool: """ This method will find if the number passed is even or not :param number : a number :return: True if even False otherwise """ if number <= 0: return False r...
class FieldError(Exception): """ Base class for errors to do with setting fields on PointClouds and their subclasses. """ pass class PointFieldError(FieldError): """ Raised when setting point fields on PointClouds. """ pass
class Fielderror(Exception): """ Base class for errors to do with setting fields on PointClouds and their subclasses. """ pass class Pointfielderror(FieldError): """ Raised when setting point fields on PointClouds. """ pass
name = 'pyjoystick' version = '1.2.4' description = 'Tools to get Joystick events.' url = 'https://github.com/justengel/pyjoystick' author = 'Justin Engel' author_email = 'jengel@sealandaire.com'
name = 'pyjoystick' version = '1.2.4' description = 'Tools to get Joystick events.' url = 'https://github.com/justengel/pyjoystick' author = 'Justin Engel' author_email = 'jengel@sealandaire.com'
pi = "141592653589793238462643383279502884197169399375105820974944592307816406286208998628034825342117067982148086513282306647093844609550582231725359408128" pi += "48111745028410270193852110555964462294895493038196442881097566593344612847564823378678316527120190914564856692346034861045432664821339360726024914127372458...
pi = '141592653589793238462643383279502884197169399375105820974944592307816406286208998628034825342117067982148086513282306647093844609550582231725359408128' pi += '48111745028410270193852110555964462294895493038196442881097566593344612847564823378678316527120190914564856692346034861045432664821339360726024914127372458...
#Before running this code we should run 2 commands in command prompt they are :- #1) pip install Image #2) pip install qrcodeimport qrcode code=qrcode.QRCode(version=5,box_size=15,border=5) link=input("copy the content:") code.add_data(link) code.make(fit=True) img=code.make_image(fill="black",back_color="white...
code = qrcode.QRCode(version=5, box_size=15, border=5) link = input('copy the content:') code.add_data(link) code.make(fit=True) img = code.make_image(fill='black', back_color='white') img.save(input('Enter the Qrcode name:') + '.png')
def find_outlier(integers): even, odd = [], [] for i in sorted(integers): if i % 2 != 0: odd.append(i) else: even.append(i) if len(even) > 1 and len(odd) != 0: return odd[0] elif len(odd) > 1 and len(even) != 0: return even[0]
def find_outlier(integers): (even, odd) = ([], []) for i in sorted(integers): if i % 2 != 0: odd.append(i) else: even.append(i) if len(even) > 1 and len(odd) != 0: return odd[0] elif len(odd) > 1 and len(even) != 0: return even[0]
class BaseSnappyError(Exception): """ Base error class for snappy module. """ class CorruptError(BaseSnappyError): """ Corrupt input. """ class TooLargeError(BaseSnappyError): """ Decoded block is too large. """
class Basesnappyerror(Exception): """ Base error class for snappy module. """ class Corrupterror(BaseSnappyError): """ Corrupt input. """ class Toolargeerror(BaseSnappyError): """ Decoded block is too large. """
#Thea M Factorial of a positive no def func_factorial(n): # factorial is n * by all the '+' no less than it #n= 7 #if n == 1: # if n is 1 return 1 #return n #else: #return n * (n-1) # # Python program to find the factorial of a number provided by the user. # ch...
def func_factorial(n): factorial = 1 if n < 0: print('not doing factorial for zero') elif n == 0: print('The factorial of 0 is 1') else: for i in range(1, n + 1): factorial = factorial * i print('The factorial of', n, 'is', factorial) func_factorial(7)
class Solution(object): def reverseString(self, s): """ :type s: str :rtype: str """ rs = [] for i in range(len(s) - 1, -1, -1): rs.append(s[i]) return "".join(rs)
class Solution(object): def reverse_string(self, s): """ :type s: str :rtype: str """ rs = [] for i in range(len(s) - 1, -1, -1): rs.append(s[i]) return ''.join(rs)
class Solution(object): def numDistinct(self, s, t): """ :type s: str :type t: str :rtype: int """ row, col = len(s), len(t) if col > row: return 0 dp = [[0 for _ in range(col+1)] for _ in range(row+1)] for r in range(row+1): ...
class Solution(object): def num_distinct(self, s, t): """ :type s: str :type t: str :rtype: int """ (row, col) = (len(s), len(t)) if col > row: return 0 dp = [[0 for _ in range(col + 1)] for _ in range(row + 1)] for r in range(row ...
def build_ast_dictionary(code, prefix=tuple(), d=None): if d is None: d = dict() if prefix == tuple(): d['total'] = code else: d[prefix] = code tag, subcode = code if isinstance(subcode, list): for i, subitem in enumerate(subcode): build_ast_dictionary(su...
def build_ast_dictionary(code, prefix=tuple(), d=None): if d is None: d = dict() if prefix == tuple(): d['total'] = code else: d[prefix] = code (tag, subcode) = code if isinstance(subcode, list): for (i, subitem) in enumerate(subcode): build_ast_dictionary...
_base_ = [ '../_base_/models/upernet_swin.py', '../_base_/datasets/Vaihingen.py', '../_base_/default_runtime.py', '../_base_/schedules/schedule_80k.py' ] model = dict( pretrained='pretrain/swin_tiny_patch4_window7_224.pth', backbone=dict( embed_dims=96, depths=[2, 2, 6, 2], num_h...
_base_ = ['../_base_/models/upernet_swin.py', '../_base_/datasets/Vaihingen.py', '../_base_/default_runtime.py', '../_base_/schedules/schedule_80k.py'] model = dict(pretrained='pretrain/swin_tiny_patch4_window7_224.pth', backbone=dict(embed_dims=96, depths=[2, 2, 6, 2], num_heads=[3, 6, 12, 24], window_size=7, use_abs_...
num = 1 for i in range(5): for j in range(i+1): print(num, end=" ") num+=1 print()
num = 1 for i in range(5): for j in range(i + 1): print(num, end=' ') num += 1 print()
""" Given an array of intervals where intervals[i] = [starti, endi], merge all overlapping intervals, and return an array of the non-overlapping intervals that cover all the intervals in the input. Example 1: Input: intervals = [[1,3],[2,6],[8,10],[15,18]] Output: [[1,6],[8,10],[15,18]] Explanation: Since interv...
""" Given an array of intervals where intervals[i] = [starti, endi], merge all overlapping intervals, and return an array of the non-overlapping intervals that cover all the intervals in the input. Example 1: Input: intervals = [[1,3],[2,6],[8,10],[15,18]] Output: [[1,6],[8,10],[15,18]] Explanation: Since interv...
class Quiz: def __init__(self,question, alt, correct): self.question = question self.alt = alt self.correct = correct self.s ="" for a in range(len(self.alt)): self.s =self.s+str(a+1)+". "+self.alt[a]+"\n" def corect_ansrer_txt(self): return "correct ...
class Quiz: def __init__(self, question, alt, correct): self.question = question self.alt = alt self.correct = correct self.s = '' for a in range(len(self.alt)): self.s = self.s + str(a + 1) + '. ' + self.alt[a] + '\n' def corect_ansrer_txt(self): re...
program_list = [] def execute_command_with_params(input): command, params = input.split(sep=" ", maxsplit=1) if command == "insert": i, e = map(int, params.split(sep=" ", maxsplit=1)) program_list.insert(i, e) if command == "remove": e = int(params) program_list.remove(e)...
program_list = [] def execute_command_with_params(input): (command, params) = input.split(sep=' ', maxsplit=1) if command == 'insert': (i, e) = map(int, params.split(sep=' ', maxsplit=1)) program_list.insert(i, e) if command == 'remove': e = int(params) program_list.remove(e...
def help(): help_file = "help.txt" with open(help_file) as help: content = help.read() return(content)
def help(): help_file = 'help.txt' with open(help_file) as help: content = help.read() return content
"""params.py: default parameters for the neural style algorithm""" #TODO: These should all be settable by command line flags to the actual script content_path = "./images/mitart_lowres.jpg" # relative path of content input image style_path = "./images/starrynight.jpg" # relative path of style input image output_pa...
"""params.py: default parameters for the neural style algorithm""" content_path = './images/mitart_lowres.jpg' style_path = './images/starrynight.jpg' output_path = './images/output/lowres' content_layer = 9 style_layers = [0, 2, 4, 8, 12] style_weights = [1.0 / len(style_layers)] * len(style_layers) iterations = 1000 ...
def euclide_e(a, n): u, v = 1, 0 u1, v1 = 0, 1 while n > 0: u1_t = u - a // n * u1 v1_t = v - a // n * v1 u, v = u1, v1 u1, v1 = u1_t, v1_t a, n = n, a - a // n * n; return [u, v, a] print(euclide_e(39, 5))
def euclide_e(a, n): (u, v) = (1, 0) (u1, v1) = (0, 1) while n > 0: u1_t = u - a // n * u1 v1_t = v - a // n * v1 (u, v) = (u1, v1) (u1, v1) = (u1_t, v1_t) (a, n) = (n, a - a // n * n) return [u, v, a] print(euclide_e(39, 5))
# Third-party dependencies fetched by Bazel # Unlike WORKSPACE, the content of this file is unordered. # We keep them separate to make the WORKSPACE file more maintainable. # Install the nodejs "bootstrap" package # This provides the basic tools for running and packaging nodejs programs in Bazel load("@bazel_tools//to...
load('@bazel_tools//tools/build_defs/repo:http.bzl', 'http_archive') def fetch_dependencies(): http_archive(name='build_bazel_rules_nodejs', sha256='8f5f192ba02319254aaf2cdcca00ec12eaafeb979a80a1e946773c520ae0a2c9', urls=['https://github.com/bazelbuild/rules_nodejs/releases/download/3.7.0/rules_nodejs-3.7.0.tar.gz...
""" Copyright 2020 Daniel Cortez Stevenson Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at https://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing...
""" Copyright 2020 Daniel Cortez Stevenson Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at https://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing...
class Solution: def allPathsSourceTarget(self, graph: List[List[int]]) -> List[List[int]]: def dfs(cur, path): if cur == len(graph) - 1: res.append(path) else: for i in graph[cur]: dfs(i, path + [i]) res = [] dfs(0, ...
class Solution: def all_paths_source_target(self, graph: List[List[int]]) -> List[List[int]]: def dfs(cur, path): if cur == len(graph) - 1: res.append(path) else: for i in graph[cur]: dfs(i, path + [i]) res = [] df...
# model settings # norm_cfg = dict(type='BN', requires_grad=False) model = dict( type='FasterRCNN', pretrained='open-mmlab://resnext101_32x4d', #resnet50_caffe backbone=dict( type='ResNeXt', depth=101, #50 groups=32, num_stages=3, strides=(1, 2, 2), dilations=...
model = dict(type='FasterRCNN', pretrained='open-mmlab://resnext101_32x4d', backbone=dict(type='ResNeXt', depth=101, groups=32, num_stages=3, strides=(1, 2, 2), dilations=(1, 1, 1), out_indices=(2,), frozen_stages=1, style='pytorch'), shared_head=dict(type='ResxLayer', depth=101, stage=3, stride=1, dilation=2, style='p...
def resolve(): ''' code here ''' N, H = [int(item) for item in input().split()] ab = [[int(item) for item in input().split()] for _ in range(N)] a_max = max(ab, key=lambda x:x[0]) res = H // a_max if H % a_max != 0: res += 1 temp_attack = res * a_max b_delta = [b - ...
def resolve(): """ code here """ (n, h) = [int(item) for item in input().split()] ab = [[int(item) for item in input().split()] for _ in range(N)] a_max = max(ab, key=lambda x: x[0]) res = H // a_max if H % a_max != 0: res += 1 temp_attack = res * a_max b_delta = [b - a_m...
def parensvalid(stringInput): opencount = 0 closedcount = 0 for i in range(0, len(stringInput), 1): if stringInput[i] == "(": opencount += 1 elif stringInput[i] == ")": closedcount += 1 if closedcount > opencount: return False ...
def parensvalid(stringInput): opencount = 0 closedcount = 0 for i in range(0, len(stringInput), 1): if stringInput[i] == '(': opencount += 1 elif stringInput[i] == ')': closedcount += 1 if closedcount > opencount: return False if opencount ...
"""Chapter 1 Practice Projects. Attributes: VOWELS (tuple): Tuple containing characters of the English vowels (except for 'y') ENCODE_ERROR (str): String with :py:exc:`TypeError` for Pig Latin :func:`~p1_pig_latin.encode`. FREQ_ANALYSIS_ERROR (str): String with :py:exc:`TypeError` for Poo...
"""Chapter 1 Practice Projects. Attributes: VOWELS (tuple): Tuple containing characters of the English vowels (except for 'y') ENCODE_ERROR (str): String with :py:exc:`TypeError` for Pig Latin :func:`~p1_pig_latin.encode`. FREQ_ANALYSIS_ERROR (str): String with :py:exc:`TypeError` for Poo...
expected_output = { "operation_summary": { 1: { "command": "rollback", "duration": "00:00:04", "end_date": "2021-11-02", "end_time": "06:50:48", "op_id": 1, "start_date": "2021-11-02", "start_time": "06:50:44", "...
expected_output = {'operation_summary': {1: {'command': 'rollback', 'duration': '00:00:04', 'end_date': '2021-11-02', 'end_time': '06:50:48', 'op_id': 1, 'start_date': '2021-11-02', 'start_time': '06:50:44', 'status': 'Fail', 'uuid': '2021_11_02_06_50_44_op_rollback'}, 2: {'command': 'rollback', 'duration': '00:00:05',...
a = int(input("Input number a:\n")) b = int(input("Input number b:\n")) print(f"a + b = {a+b}") print(f"a - b = {a-b}") print(f"a * b = {a*b}") print(f"a / b = {a/b}") print(f"a ** b = {a**b}")
a = int(input('Input number a:\n')) b = int(input('Input number b:\n')) print(f'a + b = {a + b}') print(f'a - b = {a - b}') print(f'a * b = {a * b}') print(f'a / b = {a / b}') print(f'a ** b = {a ** b}')
""" This module includes information about Google search page specific HTML information to be used in parsing. It includes class names such as the class assigned to search result DIV's etc. """ class GoogleDomInfoBase(object): RESULT_TITLE_CLASS = 'r' RESULT_URL_CLASS = '_Rm' RESULT_DESCRIPTION_CLASS = '...
""" This module includes information about Google search page specific HTML information to be used in parsing. It includes class names such as the class assigned to search result DIV's etc. """ class Googledominfobase(object): result_title_class = 'r' result_url_class = '_Rm' result_description_class = 's...
# Our Input Array arr = [3,2,4,1] def Cyclic_sort(arr): """ This function will check if the element at i is at the correct index or not. If it is not at the correct index then it will swap places and if it is then we will increment the value of i by 1. """ i = 0 while i < len(arr): ...
arr = [3, 2, 4, 1] def cyclic_sort(arr): """ This function will check if the element at i is at the correct index or not. If it is not at the correct index then it will swap places and if it is then we will increment the value of i by 1. """ i = 0 while i < len(arr): correct_index ...
NAME = "vt2geojson" DESCRIPTION = "Dump vector tiles to GeoJSON from remote URLs or local system files." AUTHOR = "Theophile Dancoisne" AUTHOR_EMAIL = "dancoisne.theophile@gmail.com" URL = "https://github.com/Amyantis/python-vt2geojson" __version__ = "0.2.1"
name = 'vt2geojson' description = 'Dump vector tiles to GeoJSON from remote URLs or local system files.' author = 'Theophile Dancoisne' author_email = 'dancoisne.theophile@gmail.com' url = 'https://github.com/Amyantis/python-vt2geojson' __version__ = '0.2.1'
n= int(input()) my_dict = {} for i in range((n*(n-1))//2): mylist = [] x, y, z = input().split() mylist.append(x) mylist.append(y) mylist.append(z) first_t=mylist[0] second_t = mylist[1] first_t_score = mylist[2][0] second_t_score = mylist[2][2] if first_t_score<second_t_score: ...
n = int(input()) my_dict = {} for i in range(n * (n - 1) // 2): mylist = [] (x, y, z) = input().split() mylist.append(x) mylist.append(y) mylist.append(z) first_t = mylist[0] second_t = mylist[1] first_t_score = mylist[2][0] second_t_score = mylist[2][2] if first_t_score < second...
''' Katie Naughton Final Project Intro to Programming Sources: '''
""" Katie Naughton Final Project Intro to Programming Sources: """
# NOTE: This address must be verified with Amazon SES. SENDER = "Sender <no-reply@sender.com>" # AWS Region you're using for Amazon SES. AWS_REGION = "us-east-1" # The character encoding for the email. CHARSET = "UTF-8" # This variable should be passed in from the invoker. # NOTE: If your account is still in the sa...
sender = 'Sender <no-reply@sender.com>' aws_region = 'us-east-1' charset = 'UTF-8' default_recipient = 'default@recipient.com' default_subject = 'Default email subject' default_body_text = 'Default email body, non HTML version. No one should ever get this email.' default_body_html = "<html>\n<head></head>\n<body>\n <h...
class Canvas(): """A Canvas.""" def __init__(self, height, width): """Initialize Canvas object""" self.height = height self.width = width self.shapes = [] self.canvas_matrix = [] self.clear_shapes() def print_canvas(self): """Print canvas drawing (wi...
class Canvas: """A Canvas.""" def __init__(self, height, width): """Initialize Canvas object""" self.height = height self.width = width self.shapes = [] self.canvas_matrix = [] self.clear_shapes() def print_canvas(self): """Print canvas drawing (with...