content
stringlengths
7
1.05M
fixed_cases
stringlengths
1
1.28M
# color palette for nyu40 labels (correspond to ScanNetV2 ground truth labels) def create_color_palette_gt(): return [ (0, 0, 0), (174, 199, 232), # wall (152, 223, 138), # floor (31, 119, 180), # cabinet (255, 187, 120), # bed (188, 189, 34), # chair (140, 8...
def create_color_palette_gt(): return [(0, 0, 0), (174, 199, 232), (152, 223, 138), (31, 119, 180), (255, 187, 120), (188, 189, 34), (140, 86, 75), (255, 152, 150), (214, 39, 40), (197, 176, 213), (148, 103, 189), (196, 156, 148), (23, 190, 207), (178, 76, 76), (247, 182, 210), (66, 188, 102), (219, 219, 141), (140...
RES_MESSAGE_KEY_NAME = 'message' REQ_USER_EMAIL_KEY_NAME = 'email' REQ_USER_PASSWORD_KEY_NAME = 'password' REQ_USER_FIRST_NAME_KEY_NAME = 'first_name' REQ_USER_LAST_NAME_KEY_NAME = 'last_name' REQ_USER_PHONE_KEY_NAME = 'phone' REQ_USER_PROFILE_PICTURE_DATA_KEY_NAME = 'profile_image_data' REQ_USER_BIRTHDAY_KE...
res_message_key_name = 'message' req_user_email_key_name = 'email' req_user_password_key_name = 'password' req_user_first_name_key_name = 'first_name' req_user_last_name_key_name = 'last_name' req_user_phone_key_name = 'phone' req_user_profile_picture_data_key_name = 'profile_image_data' req_user_birthday_key_name = 'b...
# Populate these fields on your local machine. client_id = '' client_secret = '' redirect_uri = ''
client_id = '' client_secret = '' redirect_uri = ''
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright (c) 2021, Cisco Systems # GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) DOCUMENTATION = r""" --- module: authorization_profile_info short_description: Information module for Authorization Profile description: - Get all ...
documentation = "\n---\nmodule: authorization_profile_info\nshort_description: Information module for Authorization Profile\ndescription:\n- Get all Authorization Profile.\n- Get Authorization Profile by id.\n- Get Authorization Profile by name.\nversion_added: '1.0.0'\nauthor: Rafael Campos (@racampos)\noptions:\n na...
l = [['felipe', 99], ['tamara', 50], ['fernando', 60]] l1 = sorted(l) l = sorted(l) print(l) print(l1)
l = [['felipe', 99], ['tamara', 50], ['fernando', 60]] l1 = sorted(l) l = sorted(l) print(l) print(l1)
_base_ = [ '../../_base_/models/mocov1/r18.py', '../../_base_/datasets/imagenet/mocov1_sz224_bs64.py', '../../_base_/default_runtime.py', ] # interval for accumulate gradient update_interval = 1 # total: 4 x bs64 x 1 accumulates = bs256 # optimizer optimizer = dict(type='SGD', lr=0.03, weight_decay=1e-4,...
_base_ = ['../../_base_/models/mocov1/r18.py', '../../_base_/datasets/imagenet/mocov1_sz224_bs64.py', '../../_base_/default_runtime.py'] update_interval = 1 optimizer = dict(type='SGD', lr=0.03, weight_decay=0.0001, momentum=0.9) use_fp16 = False fp16 = dict(type='apex', loss_scale=dict(init_scale=512.0, mode='dynamic'...
{ 'variables': { 'ENGINE_ROOT': '<(GOOGLE3)/i18n/input/engine', }, 'conditions': [ ['OS!="win"', { 'variables': { 'PROTOC': '<!(which protoc)', }, }], ], 'targets': [ { 'target_name': 'stubs', 'type': '<(library)', 'sources': [ '<(ENGINE_ROOT)/stub...
{'variables': {'ENGINE_ROOT': '<(GOOGLE3)/i18n/input/engine'}, 'conditions': [['OS!="win"', {'variables': {'PROTOC': '<!(which protoc)'}}]], 'targets': [{'target_name': 'stubs', 'type': '<(library)', 'sources': ['<(ENGINE_ROOT)/stubs/google3/base/commandlineflags.cc', '<(ENGINE_ROOT)/stubs/google3/base/commandlineflags...
class Solution: def equalSubstring(self, s: str, t: str, maxCost: int) -> int: N = len(s) max_substring = 0 total_cost = 0 left = 0 for right in range(N): total_cost += self._get_cost(s[right], t[right]) while total_cost > maxCost and left < N: ...
class Solution: def equal_substring(self, s: str, t: str, maxCost: int) -> int: n = len(s) max_substring = 0 total_cost = 0 left = 0 for right in range(N): total_cost += self._get_cost(s[right], t[right]) while total_cost > maxCost and left < N: ...
n=int(input()) if n%2==1: print(max(n, n*(n-1)*(n-2))) else: if n%3==0: print(max(n, (n-1)*(n-2)*(n-3))) else: print(max(n, n*(n-1)*(n-3)))
n = int(input()) if n % 2 == 1: print(max(n, n * (n - 1) * (n - 2))) elif n % 3 == 0: print(max(n, (n - 1) * (n - 2) * (n - 3))) else: print(max(n, n * (n - 1) * (n - 3)))
# ref: https://www.zhihu.com/question/381784377/answer/1099438784 table = 'fZodR9XQDSUm21yCkr6zBqiveYah8bt4xsWpHnJE7jL5VG3guMTKNPAwcF' tr = {} for i in range(58): tr[table[i]] = i s = [11, 10, 3, 8, 4, 6] xor = 177451812 add = 8728348608 def b2a(x): r = 0 for i in range(6): r += tr[x[s[i] - 2]] * ...
table = 'fZodR9XQDSUm21yCkr6zBqiveYah8bt4xsWpHnJE7jL5VG3guMTKNPAwcF' tr = {} for i in range(58): tr[table[i]] = i s = [11, 10, 3, 8, 4, 6] xor = 177451812 add = 8728348608 def b2a(x): r = 0 for i in range(6): r += tr[x[s[i] - 2]] * 58 ** i return r - add ^ xor def a2b(x): x = (x ^ xor) + a...
''' 153. Find Minimum in Rotated Sorted Array https://leetcode.com/problems/find-minimum-in-rotated-sorted-array/ similar problem: "154. Find Minimum in Rotated Sorted Array II" https://leetcode.com/problems/find-minimum-in-rotated-sorted-array-ii/ Suppose an array sorted in ascending order is rotated at some pivot u...
""" 153. Find Minimum in Rotated Sorted Array https://leetcode.com/problems/find-minimum-in-rotated-sorted-array/ similar problem: "154. Find Minimum in Rotated Sorted Array II" https://leetcode.com/problems/find-minimum-in-rotated-sorted-array-ii/ Suppose an array sorted in ascending order is rotated at some pivot u...
def remove_repetidos(lista): """ Recebe uma lista de inteiros e remove os repetidos e retorna uma lista ordenada. >>> remove_repetidos([2, 4, 2, 2, 3, 3, 1]) [1, 2, 3, 4] >>> remove_repetidos([1, 2, 3, 3, 3, 4]) [1, 2, 3, 4] :param lista: list :return: list """ list...
def remove_repetidos(lista): """ Recebe uma lista de inteiros e remove os repetidos e retorna uma lista ordenada. >>> remove_repetidos([2, 4, 2, 2, 3, 3, 1]) [1, 2, 3, 4] >>> remove_repetidos([1, 2, 3, 3, 3, 4]) [1, 2, 3, 4] :param lista: list :return: list """ list...
# Prompt: Given a bst, connect each node with its level order successor. The last node of each level should point to the first node of the next level # Approach: Traverse through the tree. Set curr.right? equal to the next sibling node. # O(n)t | O(n)s def connectSiblings(head): queue = [head] while queue: ...
def connect_siblings(head): queue = [head] while queue: level_size = len(queue) while levelSize: curr = queue[0] queue = queue[1:] if curr.left: queue.append(curr.left) if curr.right: queue.append(curr.right) ...
test_data = {"data":{ "region" : { "name":"africa", "avgAge":19.7, "avgDailyIncomeInUSD":4, "avgDailyIncomePopulation":0.73, }, "periodType":"days", "timeToElapse":38, "reportedCases":2747, "population":92931687, "totalHospitalBeds":678874, }} def estimator(data): _data = data ...
test_data = {'data': {'region': {'name': 'africa', 'avgAge': 19.7, 'avgDailyIncomeInUSD': 4, 'avgDailyIncomePopulation': 0.73}, 'periodType': 'days', 'timeToElapse': 38, 'reportedCases': 2747, 'population': 92931687, 'totalHospitalBeds': 678874}} def estimator(data): _data = data data = data['data'] number...
def find_longest_word(words_list): word_len = [] for n in words_list: word_len.append((len(n), n)) word_len.sort() return word_len[-1][1] print(find_longest_word(["PHP", "Exercises", "Backend"]))
def find_longest_word(words_list): word_len = [] for n in words_list: word_len.append((len(n), n)) word_len.sort() return word_len[-1][1] print(find_longest_word(['PHP', 'Exercises', 'Backend']))
def outer(): x = 10 def inner(): y = 20 inner() return x + y my_func = outer print(my_func()) # h1_tag = html_tag('h1') # print h1_tag # def html_tag(tag): # def print_tag(text): # return '<{0}>{1}</{0}>'.format(tag,text) # return print_tag # h1_tag = html_tag('h1') # print ...
def outer(): x = 10 def inner(): y = 20 inner() return x + y my_func = outer print(my_func())
""" Leetcode 20 - Valid Parentheses https://leetcode.com/problems/valid-parentheses/ 1. Time: O(n) Memory: O(n) (n is length of s) """ class Solution1: """ 1. MINE | Stack """ def is_valid(self, s: str) -> bool: match_dict = {'}': '{', ')': '(', ']': '['} stack = [] for x in s: ...
""" Leetcode 20 - Valid Parentheses https://leetcode.com/problems/valid-parentheses/ 1. Time: O(n) Memory: O(n) (n is length of s) """ class Solution1: """ 1. MINE | Stack """ def is_valid(self, s: str) -> bool: match_dict = {'}': '{', ')': '(', ']': '['} stack = [] for x in s: ...
''' The collections.Sequence abstract base class does not provide support for comparing two sequences to each other. Modify our Sequence class from Code Fragment 2.14 to include a definition for the __eq__ method, so that expression seq1 == seq2 will return True precisely when the two sequences are element by element e...
""" The collections.Sequence abstract base class does not provide support for comparing two sequences to each other. Modify our Sequence class from Code Fragment 2.14 to include a definition for the __eq__ method, so that expression seq1 == seq2 will return True precisely when the two sequences are element by element e...
class PropertyDescriptorCollection(object,ICollection,IEnumerable,IList,IDictionary): """ Represents a collection of System.ComponentModel.PropertyDescriptor objects. PropertyDescriptorCollection(properties: Array[PropertyDescriptor]) PropertyDescriptorCollection(properties: Array[PropertyDescriptor],r...
class Propertydescriptorcollection(object, ICollection, IEnumerable, IList, IDictionary): """ Represents a collection of System.ComponentModel.PropertyDescriptor objects. PropertyDescriptorCollection(properties: Array[PropertyDescriptor]) PropertyDescriptorCollection(properties: Array[PropertyDescriptor],re...
''' Given a binary array nums, return the maximum number of consecutive 1's in the array. Example 1: Input: nums = [1,1,0,1,1,1] Output: 3 Explanation: The first two digits or the last three digits are consecutive 1s. The maximum number of consecutive 1s is 3. Example 2: Input: nums = [1,0,1,1,0,1] Output: 2 ...
""" Given a binary array nums, return the maximum number of consecutive 1's in the array. Example 1: Input: nums = [1,1,0,1,1,1] Output: 3 Explanation: The first two digits or the last three digits are consecutive 1s. The maximum number of consecutive 1s is 3. Example 2: Input: nums = [1,0,1,1,0,1] Output: 2 ...
"""Get map size. Set _n to the number of elements stored in _mymap. This is not always equal to the map capacity. Source: programming-idioms.org """ # Implementation author: bukzor # Created on 2018-04-08T07:21:23.163901Z # Last modified on 2018-04-08T07:21:23.163901Z # Version 1 n = len(mymap)
"""Get map size. Set _n to the number of elements stored in _mymap. This is not always equal to the map capacity. Source: programming-idioms.org """ n = len(mymap)
class HandleRef(object): """ Wraps a managed object holding a handle to a resource that is passed to unmanaged code using platform invoke. HandleRef(wrapper: object,handle: IntPtr) """ @staticmethod def ToIntPtr(value): """ ToIntPtr(value: HandleRef) -> IntPtr Returns the internal integ...
class Handleref(object): """ Wraps a managed object holding a handle to a resource that is passed to unmanaged code using platform invoke. HandleRef(wrapper: object,handle: IntPtr) """ @staticmethod def to_int_ptr(value): """ ToIntPtr(value: HandleRef) -> IntPtr Returns the interna...
# Time: O(n) # Space: O(1) class Solution(object): def getSumAbsoluteDifferences(self, nums): """ :type nums: List[int] :rtype: List[int] """ prefix, suffix = 0, sum(nums) result = [] for i, num in enumerate(nums): suffix -= num resul...
class Solution(object): def get_sum_absolute_differences(self, nums): """ :type nums: List[int] :rtype: List[int] """ (prefix, suffix) = (0, sum(nums)) result = [] for (i, num) in enumerate(nums): suffix -= num result.append(i * num - ...
# quick sort O(nlogn) - Average if pivot is choosen wisely # O(n^2) - Worse # O(logn) - space complexity # this implementaion has worst space complexity of O(n^2) def quick_sort(arr, low, high): if low < high: pivot = partition(arr, low, high) quick_sort(arr, low, pivot - 1) qui...
def quick_sort(arr, low, high): if low < high: pivot = partition(arr, low, high) quick_sort(arr, low, pivot - 1) quick_sort(arr, pivot + 1, high) def partition(arr, low, high): pivot = arr[high] lower_pivot = low - 1 for compare in range(low, high): if arr[compare] <= ar...
#Source : https://leetcode.com/problems/add-two-numbers/ #Author : Yuan Wang #Date : 2021-02-19 ''' ********************************************************************************** *You are given two non-empty linked lists representing two non-negative integers. *The digits are stored in reverse order, and each o...
""" ********************************************************************************** *You are given two non-empty linked lists representing two non-negative integers. *The digits are stored in reverse order, and each of their nodes contains a single *digit. Add the two numbers and return the sum as a linked list. ...
# File: TMQuestion.py """This module defines a class to represent a single question.""" class TMQuestion: MARKER = "-----" def __init__(self, name, text, answers): """Creates a new TMQuestion object with these attributes.""" self._name = name self._text = text self._answers =...
"""This module defines a class to represent a single question.""" class Tmquestion: marker = '-----' def __init__(self, name, text, answers): """Creates a new TMQuestion object with these attributes.""" self._name = name self._text = text self._answers = answers def get_na...
class InvalidYoutubeURLError(Exception): def __init__(self, message, errors = None): super().__init__(message) self.errors = errors class TranscriptNotFoundError(Exception): def __init__(self, message, errors = None): super().__init__(message) self.errors = errors class Invalid...
class Invalidyoutubeurlerror(Exception): def __init__(self, message, errors=None): super().__init__(message) self.errors = errors class Transcriptnotfounderror(Exception): def __init__(self, message, errors=None): super().__init__(message) self.errors = errors class Invalidar...
top = min(gs1.top, gs2.top) bottom = max(gs1.bottom, gs2.bottom) gs1.tight_layout(fig, rect=[None, 0 + (bottom-gs1.bottom), 0.5, 1 - (gs1.top-top)]) gs2.tight_layout(fig, rect=[0.5, 0 + (bottom-gs2.bottom), None, 1 - (gs2.top-top)], h_pad=0.5)
top = min(gs1.top, gs2.top) bottom = max(gs1.bottom, gs2.bottom) gs1.tight_layout(fig, rect=[None, 0 + (bottom - gs1.bottom), 0.5, 1 - (gs1.top - top)]) gs2.tight_layout(fig, rect=[0.5, 0 + (bottom - gs2.bottom), None, 1 - (gs2.top - top)], h_pad=0.5)
def test_get_work_livre(work_object_livre): details = work_object_livre.get_details() assert isinstance(details, dict) assert len(details) == 16 def test_rating_work_livre(work_object_livre): main_rating = work_object_livre.get_main_rating() assert isinstance(main_rating, str) assert main_rati...
def test_get_work_livre(work_object_livre): details = work_object_livre.get_details() assert isinstance(details, dict) assert len(details) == 16 def test_rating_work_livre(work_object_livre): main_rating = work_object_livre.get_main_rating() assert isinstance(main_rating, str) assert main_ratin...
# # Solution to Project Euler problem 216 # Copyright (c) Project Nayuki. All rights reserved. # # https://www.nayuki.io/page/project-euler-solutions # https://github.com/nayuki/Project-Euler-solutions # # As per the problem statement, define t(n) = 2n^2 - 1 and assume that always n > 1. # Hence t(n) >= 7, and the...
def compute(): limit = 50000000 sequence = [2 * i * i - 1 for i in range(LIMIT + 1)] sequence[0] = sequence[1] = -1 ans = 0 for (i, term) in enumerate(sequence): if i < 2: continue if term == 2 * i * i - 1: ans += 1 if 1 < term <= LIMIT * 2: ...
def print_rhombus(n: int): # global namespace GROWING: int = 1 # local namespace SHRINKING: int = -1 # fn-in-fn: closure def print_line(i: int, direction: int): # local namespace if i == 0: return line = ' ' * (n - i) + '* ' * i print(line.rstrip()) if i =...
def print_rhombus(n: int): growing: int = 1 shrinking: int = -1 def print_line(i: int, direction: int): if i == 0: return line = ' ' * (n - i) + '* ' * i print(line.rstrip()) if i == n: direction = SHRINKING print_line(i + direction, direction...
#!/usr/bin/env python3 with open('../notes/gamebits/gamebits.txt', 'rt') as inFile: for line in inFile: line = line.split('|') if not line[0].startswith('0'): continue print('<bit id="0x%s" table="%s" unk1="0x%s" unk2="0x%s" max="0x%s" name="%s">%s</bit>' % ( line[0], ...
with open('../notes/gamebits/gamebits.txt', 'rt') as in_file: for line in inFile: line = line.split('|') if not line[0].startswith('0'): continue print('<bit id="0x%s" table="%s" unk1="0x%s" unk2="0x%s" max="0x%s" name="%s">%s</bit>' % (line[0], line[1], line[2], line[3], line[4]...
class Individual(object): def __init__(self, gedcom, db): data = gedcom # .to_dict() self.id = data.xref self.name = data.get_fact('NAME') self.birth = data.get_fact('BIRT') # print(self.birth.to_dict()) self.parent_family = "" self.parents = [] fa...
class Individual(object): def __init__(self, gedcom, db): data = gedcom self.id = data.xref self.name = data.get_fact('NAME') self.birth = data.get_fact('BIRT') self.parent_family = '' self.parents = [] famc = data.get_fact('FAMC') if famc: ...
#!/usr/bin/python3 lines = [1, 2, 3, 4, 5, 6, 7, 8, 9] i = len(lines + lines) +len("me") + len(lines) - 1 + len("") j = len("hello") k = int("5") + int(5) string = "string" print (len("string")) print ("%d %s length, %d integer sum" % (i+j, string, k), end = ' end\n') a = [3, 6, 8, 2, 78, 1, 23, 45, 9] b = sorted(...
lines = [1, 2, 3, 4, 5, 6, 7, 8, 9] i = len(lines + lines) + len('me') + len(lines) - 1 + len('') j = len('hello') k = int('5') + int(5) string = 'string' print(len('string')) print('%d %s length, %d integer sum' % (i + j, string, k), end=' end\n') a = [3, 6, 8, 2, 78, 1, 23, 45, 9] b = sorted(a) print(b) print(sorted(...
def print_serialization(pstats): # pylint: disable=too-many-locals print("ncalls tottime percall % cumtime percall function") total_pct = 0.0 for path_line_func, data in pstats.sort_stats("module", "cumulative").stats.items(): path, line, func = path_line_func # pylint: disable=unu...
def print_serialization(pstats): print('ncalls tottime percall % cumtime percall function') total_pct = 0.0 for (path_line_func, data) in pstats.sort_stats('module', 'cumulative').stats.items(): (path, line, func) = path_line_func is_rlp = 'rlp' in path is_encoding = '...
class MyClass: def __init__(self, s): self.s = s def function(c: MyClass) -> str: return c.copy().upper() function(MyClass('string'))
class Myclass: def __init__(self, s): self.s = s def function(c: MyClass) -> str: return c.copy().upper() function(my_class('string'))
class Article: def __init__(self, url): ''' Base class to auto extract main information :param url: article's url to crawl data ''' self.url = url # some information need to extract self.title = "" self.text = "" self.authors = [] sel...
class Article: def __init__(self, url): """ Base class to auto extract main information :param url: article's url to crawl data """ self.url = url self.title = '' self.text = '' self.authors = [] self.published_date = '' self.image_url...
# The isBadVersion API is already defined for you. # @param version, an integer # @return a bool # def isBadVersion(version): class Solution: def firstBadVersion(self, n): MAX = n MIN = 1 while MAX >= MIN: MID = (MAX+MIN)//2 #bad if isBadVer...
class Solution: def first_bad_version(self, n): max = n min = 1 while MAX >= MIN: mid = (MAX + MIN) // 2 if is_bad_version(MID): max = MID - 1 else: min = MID + 1 return MAX + 1
class _RBNode: """Implements a Binary Node with additional color bit""" def __init__(self, key, value, isRed, left=None, right=None): self.key, self.value = key, value self.left, self.right = left, right self.isRed = isRed class RedBlackTree: """Implements https://en.wikipedia.org/...
class _Rbnode: """Implements a Binary Node with additional color bit""" def __init__(self, key, value, isRed, left=None, right=None): (self.key, self.value) = (key, value) (self.left, self.right) = (left, right) self.isRed = isRed class Redblacktree: """Implements https://en.wikipe...
# -*- coding: utf-8 -*- def set_FEMM_circuit_prop(femm, circuits, Clabel, I=None): """Create or update the property of a circuit Parameters ---------- femm : FEMMHandler client to send command to a FEMM instance circuits: list list the name of all circuits Clabel: str ...
def set_femm_circuit_prop(femm, circuits, Clabel, I=None): """Create or update the property of a circuit Parameters ---------- femm : FEMMHandler client to send command to a FEMM instance circuits: list list the name of all circuits Clabel: str the label of the circuit s...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # J.V.Ojala 26.11.2021 # marketday (coinstar) class Market_day(): def __init__(self, date, start, end, volume=None, bearish=False): self.date = date self.open_value = start self.close_value = end self.is_bearish = start > end ...
class Market_Day: def __init__(self, date, start, end, volume=None, bearish=False): self.date = date self.open_value = start self.close_value = end self.is_bearish = start > end self.trading_volume = volume self.sell_profit = None
""" Given a linked list, remove the n-th node from the end of list and return its head. Example: Given linked list: 1->2->3->4->5, and n = 2. After removing the second node from the end, the linked list becomes 1->2->3->5. Solution: 1. two pass. Get the length of the linked list at first pass, delete the node at t...
""" Given a linked list, remove the n-th node from the end of list and return its head. Example: Given linked list: 1->2->3->4->5, and n = 2. After removing the second node from the end, the linked list becomes 1->2->3->5. Solution: 1. two pass. Get the length of the linked list at first pass, delete the node at t...
class ParseError(Exception): """ Unable to parse data type """ pass
class Parseerror(Exception): """ Unable to parse data type """ pass
# -*- coding: utf-8 -*- class MockSettings(object): def __init__(self, **kwargs): [self.__setattr__(key, val) for key, val in kwargs.items()]
class Mocksettings(object): def __init__(self, **kwargs): [self.__setattr__(key, val) for (key, val) in kwargs.items()]
pkgname = "dosfstools" pkgver = "4.2" pkgrel = 0 build_style = "gnu_configure" configure_args = ["--enable-compat-symlinks"] hostmakedepends = ["pkgconf"] makedepends = ["eudev-devel", "linux-headers"] pkgdesc = "DOS filesystem tools" maintainer = "q66 <q66@chimera-linux.org>" license = "GPL-3.0-or-later" url = "https:...
pkgname = 'dosfstools' pkgver = '4.2' pkgrel = 0 build_style = 'gnu_configure' configure_args = ['--enable-compat-symlinks'] hostmakedepends = ['pkgconf'] makedepends = ['eudev-devel', 'linux-headers'] pkgdesc = 'DOS filesystem tools' maintainer = 'q66 <q66@chimera-linux.org>' license = 'GPL-3.0-or-later' url = 'https:...
WHITE = "\033[1;37m" YELLOW = "\033[1;33m" GREEN = "\033[1;32m" BLUE = "\033[1;34m" CYAN = "\033[1;36m" RED = "\033[1;31m" MAGENTA = "\033[1;35m" BLACK = "\033[1;30m" DARKWHITE = "\033[0;37m" DARKYELLOW = "\033[0;33m" DARKGREEN = "\033[0;32m" DARKBLUE = "\033[0;34m" DARKCYAN = "\033[0;36m" DARKRED = "\033[...
white = '\x1b[1;37m' yellow = '\x1b[1;33m' green = '\x1b[1;32m' blue = '\x1b[1;34m' cyan = '\x1b[1;36m' red = '\x1b[1;31m' magenta = '\x1b[1;35m' black = '\x1b[1;30m' darkwhite = '\x1b[0;37m' darkyellow = '\x1b[0;33m' darkgreen = '\x1b[0;32m' darkblue = '\x1b[0;34m' darkcyan = '\x1b[0;36m' darkred = '\x1b[0;31m' darkma...
PI = 3.14 if __name__ == '__main__': print("init successful")
pi = 3.14 if __name__ == '__main__': print('init successful')
# Copyright 2018 The Bazel 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 la...
"""Compile Sass files to CSS""" _allowed_src_file_extensions = ['.sass', '.scss', '.css', '.svg', '.png', '.gif', '.cur', '.jpg', '.webp'] _compiler_attr_doc = "Choose which Sass compiler binary to use.\n\nBy default, we use the JavaScript-transpiled version of the\ndart-sass library, based on https://github.com/sass/d...
{ "targets": [{ "target_name": "tree", "sources": [ "src/treegen.cpp" ], "include_dirs": [ "src" ], "cflags_cc+": [ '-std=c++0x' ] }] }
{'targets': [{'target_name': 'tree', 'sources': ['src/treegen.cpp'], 'include_dirs': ['src'], 'cflags_cc+': ['-std=c++0x']}]}
def fib_recursive(n: int) -> int: if n < 2: return 1 else: return fib_recursive(n - 1) + fib_recursive(n - 2) def fib_non_recursive(n: int) -> int: CALL, HANDLE = 0, 1 call_stack = [(CALL, n)] return_stack = [] while call_stack: action, data = call_stack.pop() i...
def fib_recursive(n: int) -> int: if n < 2: return 1 else: return fib_recursive(n - 1) + fib_recursive(n - 2) def fib_non_recursive(n: int) -> int: (call, handle) = (0, 1) call_stack = [(CALL, n)] return_stack = [] while call_stack: (action, data) = call_stack.pop() ...
def constfn(val): def f(_): return val return f class PPOExpConfig: def __init__(self): self.PROJECT = "" self.TAGS = ["PPO"] self.WORLD_SIZE = 1 self.DEVICE = "cuda" self.NUM_ENVS = 2 # 32 * (8 // self.WORLD_SIZE) self.TOTAL_TIMESTEPS = 256e6 ...
def constfn(val): def f(_): return val return f class Ppoexpconfig: def __init__(self): self.PROJECT = '' self.TAGS = ['PPO'] self.WORLD_SIZE = 1 self.DEVICE = 'cuda' self.NUM_ENVS = 2 self.TOTAL_TIMESTEPS = 256000000.0 self.ENTROPY_WEIGHT =...
project_schema = { 'project_name': 'string', 'owner_id': 'string', 'members': [ 'string' ], 'comments': [ { 'body': 'text', 'user': 'string', 'posted': 'timestamp' } ], 'project_repo': 'string', 'project_description': 'text', ...
project_schema = {'project_name': 'string', 'owner_id': 'string', 'members': ['string'], 'comments': [{'body': 'text', 'user': 'string', 'posted': 'timestamp'}], 'project_repo': 'string', 'project_description': 'text', 'project_url': 'string'}
def n_primos(x): continuar = 1 count = 0 while continuar ==1: for aqui in reversed(range(2,x+1)): if all(aqui%d !=0 for d in range(2,aqui)): count += 1 return count continuar = 0
def n_primos(x): continuar = 1 count = 0 while continuar == 1: for aqui in reversed(range(2, x + 1)): if all((aqui % d != 0 for d in range(2, aqui))): count += 1 return count continuar = 0
# # PySNMP MIB module HUAWEI-BRAS-DPI-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/HUAWEI-BRAS-DPI-MIB # Produced by pysmi-0.3.4 at Mon Apr 29 19:31:10 2019 # On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4 # Using Python version 3.7.3 (default...
(octet_string, integer, object_identifier) = mibBuilder.importSymbols('ASN1', 'OctetString', 'Integer', 'ObjectIdentifier') (named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues') (value_size_constraint, constraints_intersection, single_value_constraint, constraints_union, value_range_constraint) ...
def test_data(make_napari_viewer): viewer = make_napari_viewer() n = len(viewer.layers) viewer.open_sample("napari-basicpy", "sample_data") assert len(viewer.layers) == (n + 1) # NOTE # assert viewer.layers[0].dtype == np.uint8
def test_data(make_napari_viewer): viewer = make_napari_viewer() n = len(viewer.layers) viewer.open_sample('napari-basicpy', 'sample_data') assert len(viewer.layers) == n + 1
class BaseAPIException(Exception): status_code = 500 def __init__(self, code='api_error', msg='Unexpected error'): super().__init__(msg) self.code = code self.msg = msg def to_dict(self): return { 'code': self.code, 'msg': self.msg } class ...
class Baseapiexception(Exception): status_code = 500 def __init__(self, code='api_error', msg='Unexpected error'): super().__init__(msg) self.code = code self.msg = msg def to_dict(self): return {'code': self.code, 'msg': self.msg} class Unknownapiexception(BaseAPIExceptio...
print(list(range(5))) print(list(range(5, 10))) print(list(range(0, 10, 2))) print(list(range(10, 0, -2))) print(list(range(0, 10, -2)))
print(list(range(5))) print(list(range(5, 10))) print(list(range(0, 10, 2))) print(list(range(10, 0, -2))) print(list(range(0, 10, -2)))
def event(): print('start yield') one = yield 'get_one' # return next(task) and yield next(task.send('set_two')) assert(one == 'set_two') print(one) yield 'get_two' # return next(task) and yield next(task.send('set_two')) print('exit yield') yield # yield next() to exit or raise StopIteration task = event() ru...
def event(): print('start yield') one = (yield 'get_one') assert one == 'set_two' print(one) yield 'get_two' print('exit yield') yield task = event() run_one = next(task) assert run_one == 'get_one' run_two = task.send('set_two') assert run_two == 'get_two' print('run : ', run_one, ' and ', ...
class Solution: def checkOnesSegment(self, s: str) -> bool: s = list(s) ind = s.index('1') while ind<len(s) and s[ind] == '1': s[ind] = '0' ind += 1 if '1' in s: return False else: return True
class Solution: def check_ones_segment(self, s: str) -> bool: s = list(s) ind = s.index('1') while ind < len(s) and s[ind] == '1': s[ind] = '0' ind += 1 if '1' in s: return False else: return True
# Solution to problem 4 # Rebecca Turley, 2019-03-21 # Collatz.py # The programme invites the user to enter a number. n = float (input ("Please enter a number ")) while n != 1 : # The condition states that while n (the number entered in the previous step by the user) is not equal to 1 so the steps will be run unt...
n = float(input('Please enter a number ')) while n != 1: (print(n, end=' '),) if n % 2 == 0: n = n / 2 else: n = n * 3 + 1 print(1.0)
question_data = [ {"text": "A slug's blood is green.", "answer": "True"}, {"text": "The loudest animal is the African Elephant.", "answer": "False"}, {"text": "Approximately one quarter of human bones are in the feet.", "answer": "True"}, {"text": "The total surface area of a human lungs is the size of ...
question_data = [{'text': "A slug's blood is green.", 'answer': 'True'}, {'text': 'The loudest animal is the African Elephant.', 'answer': 'False'}, {'text': 'Approximately one quarter of human bones are in the feet.', 'answer': 'True'}, {'text': 'The total surface area of a human lungs is the size of a football pitch....
class AbsValidator: """The parent class for all validators. It defines the functions that all validator plugins have to implement and overwrite. """ def validate_file(self, file_path): """ The function validate_file is the main workhorse and connection to the rest of the project. ...
class Absvalidator: """The parent class for all validators. It defines the functions that all validator plugins have to implement and overwrite. """ def validate_file(self, file_path): """ The function validate_file is the main workhorse and connection to the rest of the project. ...
class TreeNode(object): def __init__(self, x): self.val = x self.left = None self.right = None def serialize(root): def build_string(node): if node: vals.append(str(node.val)) build_string(node.left) build_string(node.right) else: ...
class Treenode(object): def __init__(self, x): self.val = x self.left = None self.right = None def serialize(root): def build_string(node): if node: vals.append(str(node.val)) build_string(node.left) build_string(node.right) else: ...
expected_output = { 'lisp_id': { 0: { 'site_name': { 'Shire': { 'instance_id': { 4100: { 'eid_prefix': { '192.168.1.0/24': { 'last_registere...
expected_output = {'lisp_id': {0: {'site_name': {'Shire': {'instance_id': {4100: {'eid_prefix': {'192.168.1.0/24': {'last_registered': 'never', 'who_last_registered': '--', 'up': 'no'}, '192.168.1.71/32': {'last_registered': '00:50:10', 'who_last_registered': '11.11.11.11:33079', 'up': 'yes'}, '194.168.1.0/24': {'last_...
#%% Tables creation session_table_create = ''' CREATE TABLE IF NOT EXISTS session_library ( session_id bigint, item_in_session int, artist_name text, song_title text, song_length float, PRIMARY KEY (session_id, item_in_session) ) ''' user_table_create = '''...
session_table_create = '\n CREATE TABLE IF NOT EXISTS session_library (\n session_id bigint, \n item_in_session int, \n artist_name text, \n song_title text, \n song_length float,\n PRIMARY KEY (session_id, item_in_session)\n ) \n' user_table_create = '\n CREATE TABLE...
N = int(input()) A = input().split() for i in range(N): print(A[N-i-1] , end=" ")
n = int(input()) a = input().split() for i in range(N): print(A[N - i - 1], end=' ')
a=2 b=7 c=a // b print(c)
a = 2 b = 7 c = a // b print(c)
# question can be found on leetcode.com/generate-a-string-with-characters-that-have-odd-counts/ class Solution: def generateTheString(self, n: int) -> str: if n // 2 == 1: return "a" * (n - 2) + "b" + "c" else: return "a" * (n - 2) + "b"
class Solution: def generate_the_string(self, n: int) -> str: if n // 2 == 1: return 'a' * (n - 2) + 'b' + 'c' else: return 'a' * (n - 2) + 'b'
#! /usr/bin/env python def say_name(): """ Asks for name and print it """ name = input("Name: ") print(name) # say_name() def add(num1=1, num2=2): return num1 + num2 # sum = add() # print("Sum is {0}".format(sum)) def madlibs(name, noun="sneakers", adjective="red"): return "{0} has ...
def say_name(): """ Asks for name and print it """ name = input('Name: ') print(name) def add(num1=1, num2=2): return num1 + num2 def madlibs(name, noun='sneakers', adjective='red'): return '{0} has {1} {2}'.format(name, adjective, noun) madlib = madlibs('Nik', 'shoes', 'black') print(madl...
""" this is a regional comment """ #print('hello world') # this is a line comment #print( type(123) ) #print ( type (123.) ) #print( type('123') ) #print( "hello world" ) #print( 'hello world' ) #print ( "Tom's cat" ) #print(2.**3) my_int = 123 print(my_int) my_int = 321 print(my_int) my_float = 123. my_st...
""" this is a regional comment """ my_int = 123 print(my_int) my_int = 321 print(my_int) my_float = 123.0 my_str = 'hello world' print(my_float + 1) print(my_str.upper())
def f1(w): def g1(x, y, z): print(w, x, y, z) return g1 # as in f1 it return g1 this is currying my_f1 = f1(11) my_f1(12, 13, 14)
def f1(w): def g1(x, y, z): print(w, x, y, z) return g1 my_f1 = f1(11) my_f1(12, 13, 14)
# Authors: Kartik Ramasubramanian <r.kartik@berkeley.edu> # License: BSD 3 clause # functions shared across transformers def _define_variables(variables): # Check that variable names are passed in a list. # Can take None as value if not variables or isinstance(variables, list): variables = variabl...
def _define_variables(variables): if not variables or isinstance(variables, list): variables = variables else: variables = [variables] return variables def _define_numerical_dict(the_dict): if not the_dict: the_dict = the_dict elif isinstance(the_dict, dict): if not ...
numero=int(input("Dame un numero")) suma=0 for i in range(0,numero+1): for j in range(1,i+1): suma=suma+j print(suma)
numero = int(input('Dame un numero')) suma = 0 for i in range(0, numero + 1): for j in range(1, i + 1): suma = suma + j print(suma)
class Conf(object): KEY = 'conf' @staticmethod def addParserItems(subparsers): parser = subparsers.add_parser(Conf.KEY, help='Process a ConfLists.txt file to configure accel builds.') parser.add_argument('dir', type=str, help='Location of the ConfLists.txt file.') @staticmethod def f...
class Conf(object): key = 'conf' @staticmethod def add_parser_items(subparsers): parser = subparsers.add_parser(Conf.KEY, help='Process a ConfLists.txt file to configure accel builds.') parser.add_argument('dir', type=str, help='Location of the ConfLists.txt file.') @staticmethod d...
# -*- coding: utf-8 class ParseException(Exception): """ Thrown by Unke parser in case of syntax errors """ def __init__(self, message, line, col): super(ParseException, self).__init__("{}, line {}:{}".format(message, line, col))
class Parseexception(Exception): """ Thrown by Unke parser in case of syntax errors """ def __init__(self, message, line, col): super(ParseException, self).__init__('{}, line {}:{}'.format(message, line, col))
# -*- coding: utf-8 -*- """ Created on Thu Nov 21 19:28:11 2019 @author: nehap """ """ Generate 1 to 10 tables """ if __name__=="__main__": n=10 print("Output:") for i in range(1,n+1): for j in range(1,n+1): print(i*j, end=" ") print("\r")
""" Created on Thu Nov 21 19:28:11 2019 @author: nehap """ '\nGenerate 1 to 10 tables\n' if __name__ == '__main__': n = 10 print('Output:') for i in range(1, n + 1): for j in range(1, n + 1): print(i * j, end=' ') print('\r')
class SimplifyHelperMixin: def max(self, *args, **kwargs): self.simplify() return super(SimplifyHelperMixin, self).max(*args, **kwargs) def min(self, *args, **kwargs): self.simplify() return super(SimplifyHelperMixin, self).min(*args, **kwargs) def eval(self, e, n, *args, *...
class Simplifyhelpermixin: def max(self, *args, **kwargs): self.simplify() return super(SimplifyHelperMixin, self).max(*args, **kwargs) def min(self, *args, **kwargs): self.simplify() return super(SimplifyHelperMixin, self).min(*args, **kwargs) def eval(self, e, n, *args, ...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Sun Nov 3 13:28:57 2019 @author: mehrdad """ def convert_mode_to_tsmode(mode): modemap = dict(train='RAIL', metro='SUBWAY') if mode in modemap: return modemap[mode] else: return str.upper(mode)
""" Created on Sun Nov 3 13:28:57 2019 @author: mehrdad """ def convert_mode_to_tsmode(mode): modemap = dict(train='RAIL', metro='SUBWAY') if mode in modemap: return modemap[mode] else: return str.upper(mode)
class Node: def __init__(self,value): self.value = value self.next = None head = Node("1st Node") head.next = Node("2nd Node") head.next.next = Node("3rd Node") def iter_linked_list(node): while node is not None: print(node.value) node = node.next head.next.next.next = Node("4...
class Node: def __init__(self, value): self.value = value self.next = None head = node('1st Node') head.next = node('2nd Node') head.next.next = node('3rd Node') def iter_linked_list(node): while node is not None: print(node.value) node = node.next head.next.next.next = node('4...
""" EEWMap - Tests Unittest - Used to test modules and utilities. """
""" EEWMap - Tests Unittest - Used to test modules and utilities. """
SOCKET_SLEEP = 2 MAX_RETRIES = 7 RESOURCES_CHECK = 7 CHECK_DELAY = 5
socket_sleep = 2 max_retries = 7 resources_check = 7 check_delay = 5
# Author: OMKAR PATHAK # Wikipedia : In number theory, a perfect number is a positive integer that is equal to the sum of # its proper positive divisors, that is, the sum of its positive divisors excluding the number itself # (also known as its aliquot sum). Equivalently, a perfect number is a number that is half the ...
def perfect_number(number): sum = 0 for x in range(1, number): if number % x == 0: sum += x return sum == number if __name__ == '__main__': print(perfect_number(6)) print(perfect_number(3))
#================================================================ # # File name : configs.py # Author : PyLessons # Created date: 2020-08-18 # Website : https://pylessons.com/ # GitHub : https://github.com/pythonlessons/TensorFlow-2.x-YOLOv3 # Description : yolov3 configuration file # #=====...
yolo_type = 'yolov4' yolo_framework = 'tf' yolo_v3_weights = 'model_data/yolov3.weights' yolo_v4_weights = 'model_data/yolov4.weights' yolo_v3_tiny_weights = 'model_data/yolov3-tiny.weights' yolo_v4_tiny_weights = 'model_data/yolov4-tiny.weights' yolo_trt_quantize_mode = 'INT8' yolo_custom_weights = False yolo_coco_cla...
if l >=2: user = sys.argv[1] else: user = input("Enter the username or ID (do not include the @ symbol): ") try: target = int(user) except: target = user
if l >= 2: user = sys.argv[1] else: user = input('Enter the username or ID (do not include the @ symbol): ') try: target = int(user) except: target = user
""" version Note: __version__: indicates the version of the ansible_navigator applications __version_collection_doc_cache__: indicates the version of the schema of the collection doc cache this is checked during initialization, if the version of the cache differes from below, the cache will be rebuilt. This shoul...
""" version Note: __version__: indicates the version of the ansible_navigator applications __version_collection_doc_cache__: indicates the version of the schema of the collection doc cache this is checked during initialization, if the version of the cache differes from below, the cache will be rebuilt. This shoul...
# Copyright 2014 Google Inc. All rights reserved. # # Use of this source code is governed by a BSD-style # license that can be found in the LICENSE file or at # https://developers.google.com/open-source/licenses/bsd { 'variables': { 'shaka_code': 1, }, 'targets': [ { 'target_name': 'libpackager', ...
{'variables': {'shaka_code': 1}, 'targets': [{'target_name': 'libpackager', 'type': '<(libpackager_type)', 'sources': ['app/job_manager.cc', 'app/job_manager.h', 'app/muxer_factory.cc', 'app/muxer_factory.h', 'app/libcrypto_threading.cc', 'app/libcrypto_threading.h', 'app/packager_util.cc', 'app/packager_util.h', 'app/...
class Solution: def shortestPalindrome(self, s: str) -> str: t = s[::-1] for i in range(len(t)): if s.startswith(t[i:]): return t[:i] + s return t + s
class Solution: def shortest_palindrome(self, s: str) -> str: t = s[::-1] for i in range(len(t)): if s.startswith(t[i:]): return t[:i] + s return t + s
class Rectangle: def __init__(self, offset, size, id): self.offset = (int(offset[0]), int(offset[1])) self.size = (int(size[0]), int(size[1])) self.id = id def fillRect(self, matrix): for i in range(self.offset[0], self.offset[0] + self.size[0]): for j in range(self.offset[1], self.offset[1] + self.size[1...
class Rectangle: def __init__(self, offset, size, id): self.offset = (int(offset[0]), int(offset[1])) self.size = (int(size[0]), int(size[1])) self.id = id def fill_rect(self, matrix): for i in range(self.offset[0], self.offset[0] + self.size[0]): for j in range(sel...
#encoding=utf-8 class Tree_Node: val = None lChild = None rChild = None parent = None height = None def __init__(self, val): self.val = val self.lChild = None self.rChild = None self.parent = None self.height = None def output(self): ...
class Tree_Node: val = None l_child = None r_child = None parent = None height = None def __init__(self, val): self.val = val self.lChild = None self.rChild = None self.parent = None self.height = None def output(self): print(self.val, self.l...
# -*- coding: utf-8 -*- ''' Contains exception classes used by vdirsyncer. Not all exceptions are here, only the most commonly used ones. ''' class Error(Exception): '''Baseclass for all errors.''' def __init__(self, *args, **kwargs): for key, value in kwargs.items(): if getattr(self, key...
""" Contains exception classes used by vdirsyncer. Not all exceptions are here, only the most commonly used ones. """ class Error(Exception): """Baseclass for all errors.""" def __init__(self, *args, **kwargs): for (key, value) in kwargs.items(): if getattr(self, key, object()) is not None...
# Copyright (c) 2020 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved. # SPDX-License-Identifier: Apache-2.0 load("@language_support_ts_deps//eslint:index.bzl", _eslint_test = "eslint_test") load("@os_info//:os_info.bzl", "is_windows") def eslint_test(name, srcs, tsconfig = ":tsconfig.json"...
load('@language_support_ts_deps//eslint:index.bzl', _eslint_test='eslint_test') load('@os_info//:os_info.bzl', 'is_windows') def eslint_test(name, srcs, tsconfig=':tsconfig.json', eslintrc=':.eslintrc.json', data=[], **kwargs): """Run eslint on the given typescript source. Args: name: The name of the ge...
def ting(*args): for arg in args: yield from funcOne(arg) yield from funcTwo(arg) def funcOne(arg): for i in range(10): yield "funcOne says: " + arg def funcTwo(arg): for i in range(10): yield "funcTwo says: " + arg def main(): for blink in ting("tong", "tim", "tin...
def ting(*args): for arg in args: yield from func_one(arg) yield from func_two(arg) def func_one(arg): for i in range(10): yield ('funcOne says: ' + arg) def func_two(arg): for i in range(10): yield ('funcTwo says: ' + arg) def main(): for blink in ting('tong', 'tim', ...
# # Licensed under the LICENSE. # Copyright 2017, Sony Mobile Communications Inc. # ''' get_node_from_keydict ''' def get_node_from_keydict(section, rack, tier, keydict_kc): """ get_node_from_keydict :param section: :param rack: :param tier: :param keydict_kc: :return: """ key = s...
""" get_node_from_keydict """ def get_node_from_keydict(section, rack, tier, keydict_kc): """ get_node_from_keydict :param section: :param rack: :param tier: :param keydict_kc: :return: """ key = section + '_' + rack + '_' + tier idx = keydict_kc[key] return idx
# Advent of Code day 22 # Solution part 1 p1 = [6, 25, 8, 24, 30, 46, 42, 32, 27, 48, 5, 2, 14, 28, 37, 17, 9, 22, 40, 33, 3, 50, 47, 19, 41] p2 = [1, 18, 31, 39, 16, 10, 35, 29, 26, 44, 21, 7, 45, 4, 20, 38, 15, 11, 34, 36, 49, 13, 23, 43, 12] emptytest = False finaldeck = [] def round(p1, p2): global emptytes...
p1 = [6, 25, 8, 24, 30, 46, 42, 32, 27, 48, 5, 2, 14, 28, 37, 17, 9, 22, 40, 33, 3, 50, 47, 19, 41] p2 = [1, 18, 31, 39, 16, 10, 35, 29, 26, 44, 21, 7, 45, 4, 20, 38, 15, 11, 34, 36, 49, 13, 23, 43, 12] emptytest = False finaldeck = [] def round(p1, p2): global emptytest if len(p1) == 0: emptytest = Tr...
path_folder = '../data' #Path to where train and testing lists are located class_mapping = '../action_classes.json' saved_models_dir = 'saved_models/' logs = 'logs/'
path_folder = '../data' class_mapping = '../action_classes.json' saved_models_dir = 'saved_models/' logs = 'logs/'
""" Capstone Team Project. Sets the ROBOT NUMBER for YOUR team's robot. Winter term, 2019-2020. """ def get_robot_number(): my_robot_number = None return my_robot_number # -------------------------------------------------------------------------- # TODO: 1. Set my_robot_number in the above to YOU...
""" Capstone Team Project. Sets the ROBOT NUMBER for YOUR team's robot. Winter term, 2019-2020. """ def get_robot_number(): my_robot_number = None return my_robot_number
"""The code template to supply to the front end. This is what the user will be asked to complete and submit for grading. Do not include any imports. This is not a REPL environment so include explicit 'print' statements for any outputs you want to be displayed back to the user. Use triple single q...
"""The code template to supply to the front end. This is what the user will be asked to complete and submit for grading. Do not include any imports. This is not a REPL environment so include explicit 'print' statements for any outputs you want to be displayed back to the user. Use triple single q...
# Keeps asking for numbers until 0 is entered. # Prints the average value. count = 0 sum = 0.0 number = 1 # set to something that will not exit the while loop immediately. print("Enter 0 to exit the loop.") while number != 0: number = float(input("Enter a number: ")) if number != 0: count = count + 1...
count = 0 sum = 0.0 number = 1 print('Enter 0 to exit the loop.') while number != 0: number = float(input('Enter a number: ')) if number != 0: count = count + 1 sum = sum + number if number == 0: print('The average was:', sum / count)
# Module used by stardoc to generate API documentation. # Not meant for use by bazel-gazelle users. """ Extending Gazelle ================= Gazelle started out as a build file generator for Go projects, but it can be extended to support other languages and custom sets of rules. To extend Gazelle, you must do three th...
""" Extending Gazelle ================= Gazelle started out as a build file generator for Go projects, but it can be extended to support other languages and custom sets of rules. To extend Gazelle, you must do three things: * Write a [go_library] with a function named `NewLanguage` that provides an implementation ...
# Configuration file token = 'put here your token' # Bot owner's username owner_username = 'alexander_baransky496'
token = 'put here your token' owner_username = 'alexander_baransky496'