content
stringlengths
7
1.05M
fixed_cases
stringlengths
1
1.28M
def code_to_color(code): assert len(code) in (4, 5, 7, 9), f'Bad format color code: {code}' if len(code) == 4 or len(code) == 5: # "#RGB" or "#RGBA" return tuple(map(lambda x: int(x, 16) * 17, code[1:])) elif len(code) == 7 or len(code) == 9: # "#RRGGBB" or "#RRGGBBAA" return tuple(map(la...
def code_to_color(code): assert len(code) in (4, 5, 7, 9), f'Bad format color code: {code}' if len(code) == 4 or len(code) == 5: return tuple(map(lambda x: int(x, 16) * 17, code[1:])) elif len(code) == 7 or len(code) == 9: return tuple(map(lambda x, y: int(x + y, 16), code[::1], code[1::1]))...
class Payload: @staticmethod def login_payload(username, password): return {'UserName': username, 'Password': password, 'ValidateUser': '1', 'dbKeyAuth': 'JusticePA', 'SignOn': 'Sign+On'} @staticmethod def payload(param_parser, last_name, first_name, middle_name, birth_date): ...
class Payload: @staticmethod def login_payload(username, password): return {'UserName': username, 'Password': password, 'ValidateUser': '1', 'dbKeyAuth': 'JusticePA', 'SignOn': 'Sign+On'} @staticmethod def payload(param_parser, last_name, first_name, middle_name, birth_date): payload =...
class Solution: def addBinary(self, a: str, b: str) -> str: max_len = max(len(a), len(b)) a = a.zfill(max_len) b = b.zfill(max_len) result = '' # initialize the carry carry = 0 # Traverse the string for i in range(max_len - 1, -1, -1): r...
class Solution: def add_binary(self, a: str, b: str) -> str: max_len = max(len(a), len(b)) a = a.zfill(max_len) b = b.zfill(max_len) result = '' carry = 0 for i in range(max_len - 1, -1, -1): r = carry r += 1 if a[i] == '1' else 0 ...
''' Locating suspicious data You will now inspect the suspect record by locating the offending row. You will see that, according to the data, Joyce Chepchumba was a man that won a medal in a women's event. That is a data error as you can confirm with a web search. INSTRUCTIONS 70XP Create a Boolean Series with a con...
""" Locating suspicious data You will now inspect the suspect record by locating the offending row. You will see that, according to the data, Joyce Chepchumba was a man that won a medal in a women's event. That is a data error as you can confirm with a web search. INSTRUCTIONS 70XP Create a Boolean Series with a con...
class InvalidSymbolException(Exception): pass class InvalidMoveException(Exception): pass class InvalidCoordinateInputException(Exception): pass
class Invalidsymbolexception(Exception): pass class Invalidmoveexception(Exception): pass class Invalidcoordinateinputexception(Exception): pass
def odd_nums(number: int) -> int: for num in range(1, number + 1, 2): yield num pass n = 15 generator = odd_nums(n) for _ in range(1, n + 1, 2): print(next(generator)) next(generator)
def odd_nums(number: int) -> int: for num in range(1, number + 1, 2): yield num pass n = 15 generator = odd_nums(n) for _ in range(1, n + 1, 2): print(next(generator)) next(generator)
def find_nemo(array): for item in array: if item == 'nemo': print('found NEMO') nemo = ['nemo'] find_nemo(nemo)
def find_nemo(array): for item in array: if item == 'nemo': print('found NEMO') nemo = ['nemo'] find_nemo(nemo)
def loss_function(X_values, X_media, X_org): # X_media = { # "labels": ["facebook", "tiktok"], # "coefs": [6.454, 1.545], # "drs": [0.6, 0.7] # } # X_org = { # "labels": ["const"], # "coefs": [-27.5], # "values": [1] # } y = 0 for i in range(len(X_values)): ...
def loss_function(X_values, X_media, X_org): y = 0 for i in range(len(X_values)): transform = X_values[i] ** X_media['drs'][i] contrib = X_media['coefs'][i] * transform y += contrib for i in range(len(X_org)): contrib = X_org['coefs'][i] * X_org['values'][i] y += cont...
"""map() and filter(): ('list' only a literal list if you call list over it) map(func, list) -> Returns 'list' with func applied to items. strings = map(str, [hello, world]) strings == ['hello', 'world'] filter(func, list) -> Returns 'list' of items that func already applies to. even = filter(lambda n: n % 2, [3, ...
"""map() and filter(): ('list' only a literal list if you call list over it) map(func, list) -> Returns 'list' with func applied to items. strings = map(str, [hello, world]) strings == ['hello', 'world'] filter(func, list) -> Returns 'list' of items that func already applies to. even = filter(lambda n: n % 2, [3, ...
def getcommonletters(strlist): return ''.join([x[0] for x in zip(*strlist) \ if reduce(lambda a,b:(a == b) and a or None,x)]) def findcommonstart(strlist): strlist = strlist[:] prev = None while True: common = getcommonletters(strlist) if common == prev: ...
def getcommonletters(strlist): return ''.join([x[0] for x in zip(*strlist) if reduce(lambda a, b: a == b and a or None, x)]) def findcommonstart(strlist): strlist = strlist[:] prev = None while True: common = getcommonletters(strlist) if common == prev: break strlist...
# DO NOT comment out # (REQ) REQUIRED # ***************************************************************************** # DATA DISCOVERY ENGINE - MAIN (REQ) # ***************************************************************************** # name also used on metadata SITE_NAME = "NIAID Data Portal" SITE_DESC = 'An aggr...
site_name = 'NIAID Data Portal' site_desc = 'An aggregator of open datasets, with a particular focus on allergy and infectious diseases' api_url = 'https://crawler.biothings.io/api/' site_url = 'https://discovery.biothings.io/niaid/' contact_repo = 'https://github.com/SuLab/niaid-data-portal' contact_email = 'cd2h-meta...
# pylint: skip-file POKEAPI_POKEMON_LIST_EXAMPLE = { "count": 949, "previous": None, "results": [ { "url": "https://pokeapi.co/api/v2/pokemon/21/", "name": "spearow" }, { "url": "https://pokeapi.co/api/v2/pokemon/22/", "name": "fearow"...
pokeapi_pokemon_list_example = {'count': 949, 'previous': None, 'results': [{'url': 'https://pokeapi.co/api/v2/pokemon/21/', 'name': 'spearow'}, {'url': 'https://pokeapi.co/api/v2/pokemon/22/', 'name': 'fearow'}]} pokeapi_pokemon_data_example_first = {'forms': [{'url': 'https://pokeapi.co/api/v2/pokemon-form/21/', 'nam...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- class Mapping: def __init__(self, iterable): self.items_list = [] self.__update(iterable) def __update(self, iterable): for item in iterable: self.items_list.append(item) def test_parent(self): print(self.__update...
class Mapping: def __init__(self, iterable): self.items_list = [] self.__update(iterable) def __update(self, iterable): for item in iterable: self.items_list.append(item) def test_parent(self): print(self.__update) class Mappingsubclass(Mapping): def __up...
class Solution: def removeElement(self, nums: List[int], val: int) -> int: i = 0 length = len(nums) while i < length: if nums[i] == val: nums[i:] = nums[i + 1:] length -= 1 else: i += 1 return length
class Solution: def remove_element(self, nums: List[int], val: int) -> int: i = 0 length = len(nums) while i < length: if nums[i] == val: nums[i:] = nums[i + 1:] length -= 1 else: i += 1 return length
# 7x^1 - 2x^2 + 1x^3 + 2x^4 = 3 # 2x^1 + 8x^2 + 3x^3 + 1x^4 = -2 # -1x^1 + 0x^2 + 5x^3 + 2x^4 = 5 # 0x^1 + 2x^2 - 1x^3 + 4x^4 = 4 def getX1(x2,x3,x4): return (3+2*x2-x3-2*x4)/7 def getX2(x1,x3,x4): return (-2-2*x1-3*x3-x4)/8 def getX3(x1,x2,x4): return (5+x1-2*x4)/5 def getX4(x1,x2,x3): return...
def get_x1(x2, x3, x4): return (3 + 2 * x2 - x3 - 2 * x4) / 7 def get_x2(x1, x3, x4): return (-2 - 2 * x1 - 3 * x3 - x4) / 8 def get_x3(x1, x2, x4): return (5 + x1 - 2 * x4) / 5 def get_x4(x1, x2, x3): return (4 - 2 * x2 + x3) / 4 x1 = 0 x2 = 0 x3 = 0 x4 = 0 x1a = 1e-05 x2a = 1e-05 x3a = 1e-05 x4a = ...
def calc_fact(num): total = 0 final_tot = 1 for x in range(num): total = final_tot * (x+1) final_tot = total print(total) calc_fact(10) # excepted output: 3628800
def calc_fact(num): total = 0 final_tot = 1 for x in range(num): total = final_tot * (x + 1) final_tot = total print(total) calc_fact(10)
z = int(input()) y = int(input()) x = int(input()) space = x * y * z box = int(0) box_space = int(0) while box != "Done": box = input() if box != "Done": box = float(box) box = int(box) box_space += box if box_space > space: print(f"No more free space! You need {box_space - s...
z = int(input()) y = int(input()) x = int(input()) space = x * y * z box = int(0) box_space = int(0) while box != 'Done': box = input() if box != 'Done': box = float(box) box = int(box) box_space += box if box_space > space: print(f'No more free space! You need {box_space - s...
DEBUG_MODE = False #DIR_BASE = '/tmp/sms' DIR_BASE = '/var/spool/sms' DIR_INCOMING = 'incoming' DIR_OUTGOING = 'outgoing' DIR_CHECKED = 'checked' DIR_FAILED = 'failed' DIR_SENT = 'sent' # Default international phone code DEFAULT_CODE = '62' # Unformatted messages will forward to FORWARD_TO ...
debug_mode = False dir_base = '/var/spool/sms' dir_incoming = 'incoming' dir_outgoing = 'outgoing' dir_checked = 'checked' dir_failed = 'failed' dir_sent = 'sent' default_code = '62' forward_to = ('62813123123', '62813123124')
#=============================================================== # DMXIS Macro (c) 2010 db audioware limited #=============================================================== sel = GetAllSelCh(False) if len(sel)>0: for ch in sel: RemoveFixture(ch)
sel = get_all_sel_ch(False) if len(sel) > 0: for ch in sel: remove_fixture(ch)
class Solution(object): def getRow(self, rowIndex): """ :type numRows: int :rtype: List[List[int]] """ if rowIndex == 0: return [1] if rowIndex == 1: return [1, 1] r = [1, 1] for n in range(2, rowIndex + 1): row = []...
class Solution(object): def get_row(self, rowIndex): """ :type numRows: int :rtype: List[List[int]] """ if rowIndex == 0: return [1] if rowIndex == 1: return [1, 1] r = [1, 1] for n in range(2, rowIndex + 1): row = ...
#!/usr/bin/python3 def echo(input): return input def count_valid(data, anagrams=True): valid = 0 if anagrams: sort = echo else: sort = sorted for line in data: words = [] for word in line.split(): if sort(word) not in words: words.appen...
def echo(input): return input def count_valid(data, anagrams=True): valid = 0 if anagrams: sort = echo else: sort = sorted for line in data: words = [] for word in line.split(): if sort(word) not in words: words.append(sort(word)) ...
def initialize(): global detected, undetected, unsupported, total, report_id detected = {} undetected = {} unsupported = {} total = {} report_id = {} def initialize_colours(): global HEADER, OKBLUE, OKCYAN, OKGREEN, WARNING, FAIL, ENDC, BOLD, UNDERLINE, ALERT, GRAY, WHITE, END global C...
def initialize(): global detected, undetected, unsupported, total, report_id detected = {} undetected = {} unsupported = {} total = {} report_id = {} def initialize_colours(): global HEADER, OKBLUE, OKCYAN, OKGREEN, WARNING, FAIL, ENDC, BOLD, UNDERLINE, ALERT, GRAY, WHITE, END global C ...
""" Problem 2_1: Write a function 'problem2_1()' that sets a variable lis = list(range(20,30)) and does all of the following, each on a separate line: (a) print the element of lis with the index 3 (b) print lis itself (c) write a 'for' loop that prints out every element of lis. Recall that len() will give you the l...
""" Problem 2_1: Write a function 'problem2_1()' that sets a variable lis = list(range(20,30)) and does all of the following, each on a separate line: (a) print the element of lis with the index 3 (b) print lis itself (c) write a 'for' loop that prints out every element of lis. Recall that len() will give you the l...
##Afficher les communs diverseurs du nombre naturel N n = int(input()) for a in range (1, n + 1) : if n % a == 0 : print(a) else : print(' ')
n = int(input()) for a in range(1, n + 1): if n % a == 0: print(a) else: print(' ')
MAIL_USERNAME = 'buildasaasappwithflask@gmail.com' MAIL_PASSWORD = 'helicopterpantswalrusfoot' STRIPE_SECRET_KEY = 'sk_test_nycOOQdO9C16zxubr2WWtbug' STRIPE_PUBLISHABLE_KEY = 'pk_test_ClU5mzNj1YxRRnrdZB5jEO29'
mail_username = 'buildasaasappwithflask@gmail.com' mail_password = 'helicopterpantswalrusfoot' stripe_secret_key = 'sk_test_nycOOQdO9C16zxubr2WWtbug' stripe_publishable_key = 'pk_test_ClU5mzNj1YxRRnrdZB5jEO29'
#Called when SMU is in List mode class SlaveMaster: SLAVE = 0 MASTER = 1
class Slavemaster: slave = 0 master = 1
def private(): pass class Abra: def other(): private()
def private(): pass class Abra: def other(): private()
class Solution: def majorityElement(self, nums: List[int]) -> int: counter, target = 0, nums[0] for i in nums: if counter == 0: target = i if target != i: counter -= 1 else: counter += 1 return target
class Solution: def majority_element(self, nums: List[int]) -> int: (counter, target) = (0, nums[0]) for i in nums: if counter == 0: target = i if target != i: counter -= 1 else: counter += 1 return target
class QuotaOptions(object): def __init__(self, start_quota: int = 0, refresh_by: str = "month", warning_rate: float = 0.8): self.start_quota = start_quota self.refresh_by = refresh_by self.warning_rate = warning_rate
class Quotaoptions(object): def __init__(self, start_quota: int=0, refresh_by: str='month', warning_rate: float=0.8): self.start_quota = start_quota self.refresh_by = refresh_by self.warning_rate = warning_rate
#!/usr/bin/python # https://practice.geeksforgeeks.org/problems/find-equal-point-in-string-of-brackets/0 def sol(s): """ Build an aux array from left that stores the no. of opening brackets before that index Build an aux array from right that stores the no. of closing brackets from that index ...
def sol(s): """ Build an aux array from left that stores the no. of opening brackets before that index Build an aux array from right that stores the no. of closing brackets from that index Compare the two for a given index """ n = len(s) op_left = [0] * n cb_right = [0] * n ...
def FoodStoreLol(Money, time, im): print("What would you like to eat?") time.sleep(2) print("!Heres the menu!") time.sleep(2) im.show() time.sleep(2) eeee = input("Say Any Key to continue.") FoodList = [] cash = 0 time.sleep(5) for Loopies in range(3): ord...
def food_store_lol(Money, time, im): print('What would you like to eat?') time.sleep(2) print('!Heres the menu!') time.sleep(2) im.show() time.sleep(2) eeee = input('Say Any Key to continue.') food_list = [] cash = 0 time.sleep(5) for loopies in range(3): order = int(...
''' An array is monotonic if it is either monotone increasing or monotone decreasing. An array A is monotone increasing if for all i <= j, A[i] <= A[j]. An array A is monotone decreasing if for all i <= j, A[i] >= A[j]. Return true if and only if the given array A is monotonic. Example 1: Input: [1,2,2,3] Outpu...
""" An array is monotonic if it is either monotone increasing or monotone decreasing. An array A is monotone increasing if for all i <= j, A[i] <= A[j]. An array A is monotone decreasing if for all i <= j, A[i] >= A[j]. Return true if and only if the given array A is monotonic. Example 1: Input: [1,2,2,3] Outpu...
#!/usr/local/bin/python3 def imprime(maximo, atual): if atual >= maximo: return print(atual) imprime(maximo, atual + 1) if __name__ == '__main__': imprime(100, 1)
def imprime(maximo, atual): if atual >= maximo: return print(atual) imprime(maximo, atual + 1) if __name__ == '__main__': imprime(100, 1)
project = 'pydatastructs' modules = ['linear_data_structures'] backend = '_backend' cpp = 'cpp' dummy_submodules = ['_arrays.py']
project = 'pydatastructs' modules = ['linear_data_structures'] backend = '_backend' cpp = 'cpp' dummy_submodules = ['_arrays.py']
# Given a list of numbers and a number k. # Return whether any two numbers from the list add up to k. # # For example: # Give [1,2,3,4] and k of 7 # Return true since 3 + 4 is 7 def input_array(): print("Len of array = ", end='') array_len = int(input()) print() array = [] for i in range(array_le...
def input_array(): print('Len of array = ', end='') array_len = int(input()) print() array = [] for i in range(array_len): print('Value of array[{}] = '.format(i), end='') element = int(input()) array.append(element) print('Array is: ', array) return array def input_...
operator = input() num_one = int(input()) num_two = int(input()) def multiply_nums(x, y): result = x * y return result def divide_nums(x, y): if y != 0: result = int(x / y) return result def add_nums(x, y): result = x + y return result def subtract_nums(x, y): result = x ...
operator = input() num_one = int(input()) num_two = int(input()) def multiply_nums(x, y): result = x * y return result def divide_nums(x, y): if y != 0: result = int(x / y) return result def add_nums(x, y): result = x + y return result def subtract_nums(x, y): result = x - y ...
print(" I will now count my chickens:") print("Hens",25+30/6) print("Roosters", 100-25*3%4) print("Now I will continue the eggs:") print(3+2+1-5+4%2-1/4+6) print("Is it true that 3+2<5-7?") print(3+2<5-7) print("What is 3+2?", 3+2) print("What is 5=7?", 5-7) print("Oh, that;s why it;s false.") print("How abao...
print(' I will now count my chickens:') print('Hens', 25 + 30 / 6) print('Roosters', 100 - 25 * 3 % 4) print('Now I will continue the eggs:') print(3 + 2 + 1 - 5 + 4 % 2 - 1 / 4 + 6) print('Is it true that 3+2<5-7?') print(3 + 2 < 5 - 7) print('What is 3+2?', 3 + 2) print('What is 5=7?', 5 - 7) print('Oh, that;s why it...
# Created by MechAviv # Wicked Witch Damage Skin | (2433184) if sm.addDamageSkin(2433184): sm.chat("'Wicked Witch Damage Skin' Damage Skin has been added to your account's damage skin collection.") sm.consumeItem()
if sm.addDamageSkin(2433184): sm.chat("'Wicked Witch Damage Skin' Damage Skin has been added to your account's damage skin collection.") sm.consumeItem()
n = int(input()) votos = [] for i in range(n): x = int(input()) votos.append(x) if votos[0] >= max(votos): print("S") else: print("N")
n = int(input()) votos = [] for i in range(n): x = int(input()) votos.append(x) if votos[0] >= max(votos): print('S') else: print('N')
# Dasean Volk, dvolk@usc.edu # Fall 2021, ITP115 # Section: Boba # Lab 9 # --------------------------------------SHOW RECOMMENDER & FILE CREATOR----------------------------------------------- # def display_menu(): print("TV Shows \nPossible genres are action & adventure, animation, comedy, " "\ndocument...
def display_menu(): print('TV Shows \nPossible genres are action & adventure, animation, comedy, \ndocumentary, drama, mystery & suspense, science fiction & fantasy') def read_file(user_genre, file_name='shows.csv'): show_list = [] open_file = open(file_name, 'r') for line in open_file: line = ...
print('Mind Mapping') print('') q = input('1) ') q1 = input('1.1) ') q2 = input('1.2) ') print('') w = input('2) ') w1 = input('2.1) ') w2 = input('2.2) ') print('') e = input('3) ') e1 = input('3.1) ') e2 = input('3.2) ') print('') r = input('4) ') r1 = input('4.1) ') r2 = input('4.2) ') print('') print('') print('1) ...
print('Mind Mapping') print('') q = input('1) ') q1 = input('1.1) ') q2 = input('1.2) ') print('') w = input('2) ') w1 = input('2.1) ') w2 = input('2.2) ') print('') e = input('3) ') e1 = input('3.1) ') e2 = input('3.2) ') print('') r = input('4) ') r1 = input('4.1) ') r2 = input('4.2) ') print('') print('') print('1) ...
def ejercicio_1(cadena): i=0 while cadena[i]== " ": i+=1 return cadena[i:] print (ejercicio_1("programacion_1"))
def ejercicio_1(cadena): i = 0 while cadena[i] == ' ': i += 1 return cadena[i:] print(ejercicio_1('programacion_1'))
mask, memory, answer = None, {}, 0 for line in open('input.txt', 'r').readlines(): inst, val = line.strip().replace(' ', '').split('=') if 'mask' in inst: mask = val elif 'mem' in inst: mem_add = '{:036b}'.format(int(inst[4:-1])) num = '{:036b}'.format(int(val)) masked_num = [mask[i] if mask[i] in ['1', '0']...
(mask, memory, answer) = (None, {}, 0) for line in open('input.txt', 'r').readlines(): (inst, val) = line.strip().replace(' ', '').split('=') if 'mask' in inst: mask = val elif 'mem' in inst: mem_add = '{:036b}'.format(int(inst[4:-1])) num = '{:036b}'.format(int(val)) masked_...
def get_sec(time_str): """Get Seconds from time.""" h, m, s = time_str.split(':') return int(h) * 3600 + int(m) * 60 + int(s)
def get_sec(time_str): """Get Seconds from time.""" (h, m, s) = time_str.split(':') return int(h) * 3600 + int(m) * 60 + int(s)
# Part 1 counter = 0 for line in open('input.txt', 'r').readlines(): # iterate output for entry in line.split(" | ")[1].split(" "): entry = entry.strip() # count trivial numbers if len(entry) == 2 or len(entry) == 3 or len(entry) == 4 or len(entry) == 7: counter += 1 print("...
counter = 0 for line in open('input.txt', 'r').readlines(): for entry in line.split(' | ')[1].split(' '): entry = entry.strip() if len(entry) == 2 or len(entry) == 3 or len(entry) == 4 or (len(entry) == 7): counter += 1 print('Part 1', counter) solution_sum = 0 for line in open('input.tx...
# -*- coding: utf-8 -*- """ magrathea.core.feed.info ~~~~~~~~~~~~~~~~~~~~~~~~ :copyright: Copyright 2014 by the RootForum.org team, see AUTHORS. :license: MIT License, see LICENSE for details. """ class FeedInfo(object): """ A simple namespace object for passing information to an entry ""...
""" magrathea.core.feed.info ~~~~~~~~~~~~~~~~~~~~~~~~ :copyright: Copyright 2014 by the RootForum.org team, see AUTHORS. :license: MIT License, see LICENSE for details. """ class Feedinfo(object): """ A simple namespace object for passing information to an entry """ def __init__(self,...
#coding=utf-8 ''' Created on 2016-10-28 @author: Administrator ''' class TestException(object): ''' classdocs ''' @staticmethod def exception_1(): raise Exception("fdsfdsfsd")
""" Created on 2016-10-28 @author: Administrator """ class Testexception(object): """ classdocs """ @staticmethod def exception_1(): raise exception('fdsfdsfsd')
class Token: def __init__(self, token_index_in_sentence, text, pos_tag=None, mate_tools_pos_tag=None, mate_tools_lemma=None, tree_tagger_lemma=None, iwnlp_lemma=None, polarity=None, spacy_pos_stts=None, spacy_pos_universal_google=None, spacy_ner_type=None, ...
class Token: def __init__(self, token_index_in_sentence, text, pos_tag=None, mate_tools_pos_tag=None, mate_tools_lemma=None, tree_tagger_lemma=None, iwnlp_lemma=None, polarity=None, spacy_pos_stts=None, spacy_pos_universal_google=None, spacy_ner_type=None, spacy_ner_iob=None, spacy_shape=None, spacy_is_punct=None,...
#OS_MA_NFVO_IP = '192.168.1.219' OS_MA_NFVO_IP = '192.168.1.197' OS_USER_DOMAIN_NAME = 'Default' OS_USERNAME = 'admin' OS_PASSWORD = '0000' OS_PROJECT_DOMAIN_NAME = 'Default' OS_PROJECT_NAME = 'admin'
os_ma_nfvo_ip = '192.168.1.197' os_user_domain_name = 'Default' os_username = 'admin' os_password = '0000' os_project_domain_name = 'Default' os_project_name = 'admin'
a = int(input()) l1 = [] i=0 temp = 1 print(2^3) while i<a: if temp^a==0: i+=1 else: l1.append(i) temp+=1 print(temp) print(l1)
a = int(input()) l1 = [] i = 0 temp = 1 print(2 ^ 3) while i < a: if temp ^ a == 0: i += 1 else: l1.append(i) temp += 1 print(temp) print(l1)
""" Original author: Francisco Massa https://github.com/fmassa/vision/blob/voc_dataset/torchvision/datasets/voc.py Updated by: Ellis Brown, Max deGroot from https://github.com/amdegroot/ssd.pytorch ssd.pytorch/data/voc0712.py file """ configuration = { 'labels': [ 'aeroplane', 'bicycle', 'bird', 'boat', ...
""" Original author: Francisco Massa https://github.com/fmassa/vision/blob/voc_dataset/torchvision/datasets/voc.py Updated by: Ellis Brown, Max deGroot from https://github.com/amdegroot/ssd.pytorch ssd.pytorch/data/voc0712.py file """ configuration = {'labels': ['aeroplane', 'bicycle', 'bird', 'boat', 'bottle', 'bus', ...
def solve(): ab=input() ans=ab[0] ans+="".join(ab[1:-1:2]) ans+=ab[-1] print(ans) if __name__ == '__main__': t=int(input()) for _ in range(t): solve()
def solve(): ab = input() ans = ab[0] ans += ''.join(ab[1:-1:2]) ans += ab[-1] print(ans) if __name__ == '__main__': t = int(input()) for _ in range(t): solve()
def configure(ctx): ctx.env.has_mpi = False mpiccpath = ctx.find_program("mpicc") if mpiccpath: ctx.env.has_mpi = True envmpi = ctx.env.copy() ctx.setenv('mpi', envmpi) ctx.env.CC = [mpiccpath] ctx.env.LINK_CC = [mpiccpath] envmpibld = envmpi = ctx.env.copy() ...
def configure(ctx): ctx.env.has_mpi = False mpiccpath = ctx.find_program('mpicc') if mpiccpath: ctx.env.has_mpi = True envmpi = ctx.env.copy() ctx.setenv('mpi', envmpi) ctx.env.CC = [mpiccpath] ctx.env.LINK_CC = [mpiccpath] envmpibld = envmpi = ctx.env.copy() ...
# These inheritance models are distinct from the official OMIM models of inheritance for variants # which are specified by GENETIC_MODELS (in variant_tags.py). # The following models are used while describing inheritance of genes in gene panels # It's a custom-compiled list of values GENE_PANELS_INHERITANCE_MODELS = ( ...
gene_panels_inheritance_models = (('AD', 'AD - Autosomal Dominant'), ('AR', 'AR - Autosomal recessive'), ('XL', 'XL - X Linked'), ('XD', 'XD - X Linked Dominant'), ('XR', 'XR - X Linked Recessive'), ('NA', 'NA - not available'), ('AD (imprinting)', 'AD (imprinting) - Autosomal Dominant (imprinting)'), ('digenic', 'dige...
# # PySNMP MIB module CABH-PS-DEV-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/CABH-PS-DEV-MIB # Produced by pysmi-0.3.4 at Mon Apr 29 17:26:31 2019 # On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4 # Using Python version 3.7.3 (default, Mar 27...
(object_identifier, octet_string, integer) = mibBuilder.importSymbols('ASN1', 'ObjectIdentifier', 'OctetString', 'Integer') (named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues') (constraints_union, value_range_constraint, value_size_constraint, constraints_intersection, single_value_constraint) ...
def spliceOut(self): if self.isLeaf(): if self.isLeftChild(): self.parent.leftChild = None else: self.parent.rightChild = None elif self.hasAnyChildren(): if self.hasLeftChild(): if self.isLeftChild(): self.parent.leftChild = self.leftC...
def splice_out(self): if self.isLeaf(): if self.isLeftChild(): self.parent.leftChild = None else: self.parent.rightChild = None elif self.hasAnyChildren(): if self.hasLeftChild(): if self.isLeftChild(): self.parent.leftChild = self.left...
def string_starts(s, m): return s[:len(m)] == m def split_sentence_in_words(s): return s.split() def modify_uppercase_phrase(s): if s == s.upper(): words = split_sentence_in_words( s.lower() ) res = [ w.capitalize() for w in words ] return ' '.join( res ) else: return s...
def string_starts(s, m): return s[:len(m)] == m def split_sentence_in_words(s): return s.split() def modify_uppercase_phrase(s): if s == s.upper(): words = split_sentence_in_words(s.lower()) res = [w.capitalize() for w in words] return ' '.join(res) else: return s
string = "3113322113" for loop in range(50): output = "" count = 1 digit = string[0] for i in range(1, len(string)): if string[i] == digit: count += 1 else: output += str(count) + digit digit = string[i] count = 1 output += str(count) + digit #print(loop, output) string =...
string = '3113322113' for loop in range(50): output = '' count = 1 digit = string[0] for i in range(1, len(string)): if string[i] == digit: count += 1 else: output += str(count) + digit digit = string[i] count = 1 output += str(count) +...
class Color: """Class for RGB colors""" def __init__(self, *args, **kwargs): """ Initialize new color Acceptable args: String with hex representation (ex. hex = #1234ab) Named parameters (ex. r = 0.2, green = 0.44, blue = 0.12) Acceptable keywords: ...
class Color: """Class for RGB colors""" def __init__(self, *args, **kwargs): """ Initialize new color Acceptable args: String with hex representation (ex. hex = #1234ab) Named parameters (ex. r = 0.2, green = 0.44, blue = 0.12) Acceptable keywords: ...
class PoolRaidLevels(object): def read_get(self, name, idx_name, unity_client): return unity_client.get_pool_raid_levels(idx_name) class PoolRaidLevelsColumn(object): def get_idx(self, name, idx, unity_client): return unity_client.get_pools()
class Poolraidlevels(object): def read_get(self, name, idx_name, unity_client): return unity_client.get_pool_raid_levels(idx_name) class Poolraidlevelscolumn(object): def get_idx(self, name, idx, unity_client): return unity_client.get_pools()
# Python3 program to find Intersection of two # Sorted Arrays (Handling Duplicates) def IntersectionArray(a, b, n, m): ''' :param a: given sorted array a :param n: size of sorted array a :param b: given sorted array b :param m: size of sorted array b :return: array of intersection of two array o...
def intersection_array(a, b, n, m): """ :param a: given sorted array a :param n: size of sorted array a :param b: given sorted array b :param m: size of sorted array b :return: array of intersection of two array or -1 """ intersection = [] i = j = 0 while i < n and j < m: ...
def ask_yes_no(question): response = None expected_responses = ('no', 'n', 'yes', 'y') while response not in expected_responses: response = input(question + "\n").lower() # Error message if response not in expected_responses: print('Wrong input please <yes/no...
def ask_yes_no(question): response = None expected_responses = ('no', 'n', 'yes', 'y') while response not in expected_responses: response = input(question + '\n').lower() if response not in expected_responses: print('Wrong input please <yes/no>') return response == 'yes' or r...
"""Olap Client exceptions module Contains the errors and exceptions the code can raise at some point during execution. """ class EmptyDataException(Exception): """EmptyDataException This exception occurs when a query against a server returns an empty dataset. This might want to be caught and reported to ...
"""Olap Client exceptions module Contains the errors and exceptions the code can raise at some point during execution. """ class Emptydataexception(Exception): """EmptyDataException This exception occurs when a query against a server returns an empty dataset. This might want to be caught and reported to ...
""" Hypercorn application server settings """ bind = "0.0.0.0:8080" workers = 4
""" Hypercorn application server settings """ bind = '0.0.0.0:8080' workers = 4
# -*- coding: utf-8 -*- # # view.py # aopy # # Created by Alexander Rudy on 2014-07-16. # Copyright 2014 Alexander Rudy. All rights reserved. # """ :mod:`aperture.view` ==================== """
""" :mod:`aperture.view` ==================== """
class Config: epochs = 50 batch_size = 8 learning_rate_decay_epochs = 10 # save model save_frequency = 5 save_model_dir = "saved_model/" load_weights_before_training = False load_weights_from_epoch = 0 # test image test_single_image_dir = "" test_images_during_training = F...
class Config: epochs = 50 batch_size = 8 learning_rate_decay_epochs = 10 save_frequency = 5 save_model_dir = 'saved_model/' load_weights_before_training = False load_weights_from_epoch = 0 test_single_image_dir = '' test_images_during_training = False training_results_save_dir = ...
class Polygon(): def __init__(self, no_of_sides): self.n = no_of_sides self.sides = [0 for i in range (no_of_sides)] def inputSides(self): self.sides = [float(input('Enter side '+str(i+1)+' : ')) for i in range(self.n)] def dispSides(self): for i in range(self.n): ...
class Polygon: def __init__(self, no_of_sides): self.n = no_of_sides self.sides = [0 for i in range(no_of_sides)] def input_sides(self): self.sides = [float(input('Enter side ' + str(i + 1) + ' : ')) for i in range(self.n)] def disp_sides(self): for i in range(self.n): ...
class DaiquiriException(Exception): def __init__(self, errors): self.errors = errors def __str__(self): return repr(self.errors)
class Daiquiriexception(Exception): def __init__(self, errors): self.errors = errors def __str__(self): return repr(self.errors)
# Do not edit this file directly. # It was auto-generated by: code/programs/reflexivity/reflexive_refresh load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") def glib(): http_archive( name="glib" , build_file="//bazel/deps/glib:build.BUILD" , sha256="80753e02bd0baddfa0380...
load('@bazel_tools//tools/build_defs/repo:http.bzl', 'http_archive') def glib(): http_archive(name='glib', build_file='//bazel/deps/glib:build.BUILD', sha256='80753e02bd0baddfa03807dccc6da4e063f272026f07fd0e05e17c6e5353b07e', strip_prefix='glib-2ba0f14b5298f49dcc3b376d2bdf6505b2c32bd3', urls=['https://github.com/U...
class Environment(object): """Base class for environment.""" def __init__(self): pass @property def num_of_actions(self): raise NotImplementedError def GetState(self): """Returns current state as numpy (possibly) multidimensional array. If the current state is terminal, returns None. ""...
class Environment(object): """Base class for environment.""" def __init__(self): pass @property def num_of_actions(self): raise NotImplementedError def get_state(self): """Returns current state as numpy (possibly) multidimensional array. If the current state is termin...
# QI = {"AGE": 1, "SEX": 1, "CURADM_DAYS": 1, "OUTCOME": 0, "CURRICU_FLAG":0, # "PREVADM_NO":0, "PREVADM_DAYS":0, "PREVICU_DAYS":0, "READMISSION_30_DAYS":0} # K = 20 CATEGORICAL_ATTRIBUTES = {"AGE": 0, "SEX": 1, "CURADM_DAYS": 0, "OUTCOME": 1, "CURRICU_FLAG":1, "PREVADM_NO":0, "PREV...
categorical_attributes = {'AGE': 0, 'SEX': 1, 'CURADM_DAYS': 0, 'OUTCOME': 1, 'CURRICU_FLAG': 1, 'PREVADM_NO': 0, 'PREVADM_DAYS': 0, 'PREVICU_DAYS': 0, 'READMISSION_30_DAYS': 1} input_directory = '/home/arianna/CSL Docs/Papers/Paper_Anonymized_ML/dataset' result_directory = f'/home/arianna/CSL Docs/Papers/Paper_Anonymi...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Fri Oct 350 17:10:37 2020 @author: daniel """ mat02 = [[1,2,3], [4,5,6], [7,8,9]] n = int ( input ("dimension del cuadro? ")) mat01 = [ [0] * n for i in range(n) ] ren = 0 col = n // 2 for x in range (1,n*n + 1): mat01[ren][col] = x if x %...
""" Created on Fri Oct 350 17:10:37 2020 @author: daniel """ mat02 = [[1, 2, 3], [4, 5, 6], [7, 8, 9]] n = int(input('dimension del cuadro? ')) mat01 = [[0] * n for i in range(n)] ren = 0 col = n // 2 for x in range(1, n * n + 1): mat01[ren][col] = x if x % n == 0: ren = ren + 1 else: ren =...
_base_ = [ '../../_base_/models/retinanet_r50_fpn.py', '../../_base_/datasets/dota_detection_v2.0_hbb.py', '../../_base_/schedules/schedule_2x.py', '../../_base_/default_runtime.py' ] model = dict( bbox_head=dict( num_classes=18, ) ) optimizer =dict(lr=0.01) work_dir = './work_d...
_base_ = ['../../_base_/models/retinanet_r50_fpn.py', '../../_base_/datasets/dota_detection_v2.0_hbb.py', '../../_base_/schedules/schedule_2x.py', '../../_base_/default_runtime.py'] model = dict(bbox_head=dict(num_classes=18)) optimizer = dict(lr=0.01) work_dir = './work_dirs/retinanet_r50_fpn_1x_dota'
# -*- coding: utf-8 -*- """This file contains the Windows NT Known Folder identifier definitions.""" # For now ignore the line too long errors. # pylint: disable=line-too-long # For now copied from: # https://code.google.com/p/libfwsi/wiki/KnownFolderIdentifiers # TODO: store these in a database or equiv. DESCRIPTI...
"""This file contains the Windows NT Known Folder identifier definitions.""" descriptions = {u'008ca0b1-55b4-4c56-b8a8-4de4b299d3be': u'Account Pictures', u'00bcfc5a-ed94-4e48-96a1-3f6217f21990': u'Roaming Tiles', u'0139d44e-6afe-49f2-8690-3dafcae6ffb8': u'(Common) Programs', u'0482af6c-08f1-4c34-8c90-e17ec98b1e17': u'...
# # PySNMP MIB module ALCATEL-IND1-TIMETRA-SAP-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/ALCATEL-IND1-TIMETRA-SAP-MIB # Produced by pysmi-0.3.4 at Mon Apr 29 17:04:02 2019 # On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4 # Using Python vers...
(t_filter_id,) = mibBuilder.importSymbols('ALCATEL-IND1-TIMETRA-FILTER-MIB', 'TFilterID') (timetra_srmib_modules,) = mibBuilder.importSymbols('ALCATEL-IND1-TIMETRA-GLOBAL-MIB', 'timetraSRMIBModules') (t_burst_percent_or_default, t_virtual_scheduler_name, t_scheduler_policy_name, t_burst_size, t_adaptation_rule) = mibBu...
""" 937. Reorder Data in Log Files Easy You are given an array of logs. Each log is a space-delimited string of words, where the first word is the identifier. There are two types of logs: Letter-logs: All words (except the identifier) consist of lowercase English letters. Digit-logs: All words (except the identifie...
""" 937. Reorder Data in Log Files Easy You are given an array of logs. Each log is a space-delimited string of words, where the first word is the identifier. There are two types of logs: Letter-logs: All words (except the identifier) consist of lowercase English letters. Digit-logs: All words (except the identifie...
class Product: def doStuff(self): pass def foo(product): product.doStuff()
class Product: def do_stuff(self): pass def foo(product): product.doStuff()
'''input -1 -1 1 1 ''' a = list(map(int, input().split())) print(abs(a[2]-a[0]) + abs(a[3]-a[1]))
"""input -1 -1 1 1 """ a = list(map(int, input().split())) print(abs(a[2] - a[0]) + abs(a[3] - a[1]))
def histogram(s): d = dict() for c in s: d[c] = d.get(c, s.count(c)) return d def invert_dict(d): inverse = dict() for key in d: value = d[key] inverse.setdefault(value, []) inverse[value].append(key) return inverse h = histogram('brontosaurus') print(invert_dic...
def histogram(s): d = dict() for c in s: d[c] = d.get(c, s.count(c)) return d def invert_dict(d): inverse = dict() for key in d: value = d[key] inverse.setdefault(value, []) inverse[value].append(key) return inverse h = histogram('brontosaurus') print(invert_dict...
# CPU: 0.06 s line = input() length = len(line) upper_count = 0 lower_count = 0 whitespace_count = 0 symbol_count = 0 for char in line: if char == "_": whitespace_count += 1 elif 97 <= ord(char) <= 122: lower_count += 1 elif 65 <= ord(char) <= 90: upper_count += 1 else: ...
line = input() length = len(line) upper_count = 0 lower_count = 0 whitespace_count = 0 symbol_count = 0 for char in line: if char == '_': whitespace_count += 1 elif 97 <= ord(char) <= 122: lower_count += 1 elif 65 <= ord(char) <= 90: upper_count += 1 else: symbol_count +=...
""" ID: caleb.h1 LANG: PYTHON3 PROG: friday """ ''' Test 1: TEST OK [0.025 secs, 9280 KB] Test 2: TEST OK [0.025 secs, 9276 KB] Test 3: TEST OK [0.022 secs, 9428 KB] Test 4: TEST OK [0.025 secs, 9324 KB] Test 5: TEST OK [0.025 secs, 9284 KB] Test 6: TEST OK [0.025 secs, 9428 KB] Test 7: TEST OK [0...
""" ID: caleb.h1 LANG: PYTHON3 PROG: friday """ '\n Test 1: TEST OK [0.025 secs, 9280 KB]\n Test 2: TEST OK [0.025 secs, 9276 KB]\n Test 3: TEST OK [0.022 secs, 9428 KB]\n Test 4: TEST OK [0.025 secs, 9324 KB]\n Test 5: TEST OK [0.025 secs, 9284 KB]\n Test 6: TEST OK [0.025 secs, 9428 KB]\n Test 7: TEST O...
# Test Program # This program prints "Hello World!" to Standard Output print('Hello World!')
print('Hello World!')
""" Given an integer array nums, return true if any value appears at least twice in the array, and return false if every element is distinct. Example 1: Input: nums = [1,2,3,1] Output: true Example 2: Input: nums = [1,2,3,4] Output: false Example 3: Input: nums = [1,1,1,3,3,4,3,2,4,2] Output: true Constraints...
""" Given an integer array nums, return true if any value appears at least twice in the array, and return false if every element is distinct. Example 1: Input: nums = [1,2,3,1] Output: true Example 2: Input: nums = [1,2,3,4] Output: false Example 3: Input: nums = [1,1,1,3,3,4,3,2,4,2] Output: true Constraints...
# http://www.practicepython.org/exercise/2014/02/15/03-list-less-than-ten.html # 3 listLessThanTen.py a = [1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89] for i in a: if i < 5: print(i) print('') # Extra 1 b = [] for i in a: if i < 5: b.append(i) print(b) print('') # Extra 2 print([x for x in a if ...
a = [1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89] for i in a: if i < 5: print(i) print('') b = [] for i in a: if i < 5: b.append(i) print(b) print('') print([x for x in a if x < 5]) print('') num = input('Give me a number: ') print('These are the numbers smaller than ' + num + ': ' + str([x for x in a ...
""" [2015-06-26] Challenge #220 [Hard] Substitution Cryptanalysis https://www.reddit.com/r/dailyprogrammer/comments/3b668g/20150626_challenge_220_hard_substitution/ # [](#HardIcon) _(Hard)_: Substitution Cryptanalysis A [substitution cipher](https://en.wikipedia.org/?title=Substitution_cipher) is one where each lette...
""" [2015-06-26] Challenge #220 [Hard] Substitution Cryptanalysis https://www.reddit.com/r/dailyprogrammer/comments/3b668g/20150626_challenge_220_hard_substitution/ # [](#HardIcon) _(Hard)_: Substitution Cryptanalysis A [substitution cipher](https://en.wikipedia.org/?title=Substitution_cipher) is one where each lette...
MAINNET_PORT = 18981 TESTNET_PORT = 28981 LOCAL_ADDRESS = "127.0.0.1" LOCAL_DAEMON_ADDRESS_MAINNET = "{}:{}".format(LOCAL_ADDRESS, MAINNET_PORT) LOCAL_DAEMON_ADDRESS_TESTNET = "{}:{}".format(LOCAL_ADDRESS, TESTNET_PORT) DAEMON_RPC_URL = "http://{}/json_rpc"
mainnet_port = 18981 testnet_port = 28981 local_address = '127.0.0.1' local_daemon_address_mainnet = '{}:{}'.format(LOCAL_ADDRESS, MAINNET_PORT) local_daemon_address_testnet = '{}:{}'.format(LOCAL_ADDRESS, TESTNET_PORT) daemon_rpc_url = 'http://{}/json_rpc'
def main(): compute_deeper_readings('src/december01/depths.txt') def compute_deeper_readings(readings): deeper_readings = 0 previous_depth = 0 with open(readings, 'r') as depths: for depth in depths: if int(depth) > previous_depth: deeper_readings += 1 ...
def main(): compute_deeper_readings('src/december01/depths.txt') def compute_deeper_readings(readings): deeper_readings = 0 previous_depth = 0 with open(readings, 'r') as depths: for depth in depths: if int(depth) > previous_depth: deeper_readings += 1 pr...
## https://leetcode.com/problems/unique-email-addresses/ ## goal is to find the number of unique email addresses, given ## some rules for simplifying a given email address. ## solution is to write a function to sanitize a single ## email address, then map it over the inputs, then return ## the size of a set of th...
class Solution: def sanitize_email_address(self, email: str) -> str: (user, domain) = email.split('@') user = user.split('+')[0] user = user.replace('.', '') return user + '@' + domain def num_unique_emails(self, emails: List[str]) -> int: cleaned_emails = map(self.sani...
# # Copyright 2013-2016 University of Southern California # # 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 applica...
"""ERMREST URL abstract syntax tree (AST) for data resource path-addressing. """ class Pathelem(object): is_filter = False is_context = False class Tableelem(PathElem): """A path element with a single name must be a table.""" def __init__(self, name): self.name = name self.alias = No...
i = 0 while i == 0: file1 = open('APPMAKE', 'r') Lines = file1.readlines() count = 0 checkpoint = 0 ccount = 1 # Strips the newline character for line in Lines: count += 1 ccount += 1 modeset += 1 if ccount > checkpoint: checkpoint += 1 if modeset > 2: ...
i = 0 while i == 0: file1 = open('APPMAKE', 'r') lines = file1.readlines() count = 0 checkpoint = 0 ccount = 1 for line in Lines: count += 1 ccount += 1 modeset += 1 if ccount > checkpoint: checkpoint += 1 if modeset > 2: mo...
def main(): with open("input.txt") as f: nums = [int(line) for line in f.readlines()] for num in nums: for num2 in nums: if num + num2 == 2020: print(num * num2) exit(0) exit(1) if __name__ == "__main__": main()
def main(): with open('input.txt') as f: nums = [int(line) for line in f.readlines()] for num in nums: for num2 in nums: if num + num2 == 2020: print(num * num2) exit(0) exit(1) if __name__ == '__main__': main()
"""Define decorators used throughout Celest.""" def set_module(module): """Override the module of a class or function.""" def decorator(func): if module is not None: func.__module__ = module return func return decorator
"""Define decorators used throughout Celest.""" def set_module(module): """Override the module of a class or function.""" def decorator(func): if module is not None: func.__module__ = module return func return decorator
class ISortEntry: """ * Basic necessity to sort anything """ DIRECTION_ASC = 'ASC' DIRECTION_DESC = 'DESC' def set_key(self, key: str): """ * Set by which key the entry will be sorted """ raise NotImplementedError('TBA') def get_key(self) -> str: ...
class Isortentry: """ * Basic necessity to sort anything """ direction_asc = 'ASC' direction_desc = 'DESC' def set_key(self, key: str): """ * Set by which key the entry will be sorted """ raise not_implemented_error('TBA') def get_key(self) -> str: ...
# # PySNMP MIB module HP-ICF-BYOD-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/HP-ICF-BYOD-MIB # Produced by pysmi-0.3.4 at Wed May 1 13:33:32 2019 # On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4 # Using Python version 3.7.3 (default, Mar 27...
(octet_string, object_identifier, integer) = mibBuilder.importSymbols('ASN1', 'OctetString', 'ObjectIdentifier', 'Integer') (named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues') (value_size_constraint, value_range_constraint, constraints_intersection, constraints_union, single_value_constraint) ...
# 3. Repeat String # Write a function that receives a string and a repeat count n. # The function should return a new string (the old one repeated n times). def repeat_string(string, repeat_times): return string * repeat_times text = input() n = int(input()) result = repeat_string(text, n) print(result)
def repeat_string(string, repeat_times): return string * repeat_times text = input() n = int(input()) result = repeat_string(text, n) print(result)
class Interval: # interval is [left, right] # note that endpoints are included def __init__(self, left, right): self.left = left self.right = right def getLeftEndpoint(self): return self.left def getRightEndpoint(self): return self.right def isEqualTo(self, i): ...
class Interval: def __init__(self, left, right): self.left = left self.right = right def get_left_endpoint(self): return self.left def get_right_endpoint(self): return self.right def is_equal_to(self, i): left_endpoints_match = self.getLeftEndpoint() == i.getL...
#!/usr/bin/env python if __name__ == "__main__": with open("input") as fh: data = fh.readlines() two_letters = 0 three_letters = 0 for d in data: counts = {} for char in d: if char not in counts: counts[char] = 0 counts[char] += 1 if 2 in counts.values(): two_letter...
if __name__ == '__main__': with open('input') as fh: data = fh.readlines() two_letters = 0 three_letters = 0 for d in data: counts = {} for char in d: if char not in counts: counts[char] = 0 counts[char] += 1 if 2 in counts.values()...
# encoding: utf-8 # module win32uiole # from C:\Python27\lib\site-packages\Pythonwin\win32uiole.pyd # by generator 1.147 # no doc # no imports # Variables with simple values COleClientItem_activeState = 3 COleClientItem_activeUIState = 4 COleClientItem_emptyState = 0 COleClientItem_loadedState = 1 COleClientItem_open...
c_ole_client_item_active_state = 3 c_ole_client_item_active_ui_state = 4 c_ole_client_item_empty_state = 0 c_ole_client_item_loaded_state = 1 c_ole_client_item_open_state = 2 ole_changed = 0 ole_changed_aspect = 5 ole_changed_state = 4 ole_closed = 2 ole_renamed = 3 ole_saved = 1 def afx_ole_init(*args, **kwargs): ...
# # PySNMP MIB module H3C-VOSIP-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/H3C-VOSIP-MIB # Produced by pysmi-0.3.4 at Mon Apr 29 19:11:30 2019 # On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4 # Using Python version 3.7.3 (default, Mar 27 201...
(octet_string, object_identifier, integer) = mibBuilder.importSymbols('ASN1', 'OctetString', 'ObjectIdentifier', 'Integer') (named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues') (value_size_constraint, constraints_intersection, value_range_constraint, single_value_constraint, constraints_union) ...
{ "targets": [ { "target_name": "cpp_mail", "sources": [ "src/cpp/dkim.cpp", "src/cpp/model.cpp", "src/cpp/smtp.cpp", "src/cpp/main.cpp", ], 'cflags_cc': [ '-fexceptions -g' ], 'cflags': [ '-fexceptions -g' ], "ldflags": ["-z,defs"], 'var...
{'targets': [{'target_name': 'cpp_mail', 'sources': ['src/cpp/dkim.cpp', 'src/cpp/model.cpp', 'src/cpp/smtp.cpp', 'src/cpp/main.cpp'], 'cflags_cc': ['-fexceptions -g'], 'cflags': ['-fexceptions -g'], 'ldflags': ['-z,defs'], 'variables': {'node_shared_openssl%': 'true'}, 'conditions': [['node_shared_openssl=="false"', {...