content
stringlengths
7
1.05M
fixed_cases
stringlengths
1
1.28M
#!/usr/bin/env python3 # coding: utf-8 class RdboxNodeReport(object): def __init__(self, rdbox_node_list, formatter): self.rdbox_node_list = rdbox_node_list self.formatter = formatter def output_report(self): return self.formatter.output_report(self.rdbox_node_list)
class Rdboxnodereport(object): def __init__(self, rdbox_node_list, formatter): self.rdbox_node_list = rdbox_node_list self.formatter = formatter def output_report(self): return self.formatter.output_report(self.rdbox_node_list)
class CONFIG: server_addr = '127.0.0.1' server_port = 2333 buffersize = 1024 atp_size = 512 head_size = 8 cnt_frames = 1024
class Config: server_addr = '127.0.0.1' server_port = 2333 buffersize = 1024 atp_size = 512 head_size = 8 cnt_frames = 1024
# @author Huaze Shen # @date 2020-05-02 def hamming_weight(n: int) -> int: num_ones = 0 while n != 0: num_ones += (n & 1) n = n >> 1 return num_ones if __name__ == '__main__': print(hamming_weight(5))
def hamming_weight(n: int) -> int: num_ones = 0 while n != 0: num_ones += n & 1 n = n >> 1 return num_ones if __name__ == '__main__': print(hamming_weight(5))
def replace_domain(email, old_domain, new_domain): if "@" + old_domain in email: index = email.index("@" + old_domain) new_email = email[:index] + "@" + new_domain return new_email return email w = 1 while w == 1: ask = input("Enter your email id, old domain, new domain :").split(",") print(replace_domain(ask[0], ask[1], ask[2])) ask_new = input("Do you want to change another mail id? type 'y' to continue.....! :").lower() if ask_new != "y": w += 1
def replace_domain(email, old_domain, new_domain): if '@' + old_domain in email: index = email.index('@' + old_domain) new_email = email[:index] + '@' + new_domain return new_email return email w = 1 while w == 1: ask = input('Enter your email id, old domain, new domain :').split(',') print(replace_domain(ask[0], ask[1], ask[2])) ask_new = input("Do you want to change another mail id? type 'y' to continue.....! :").lower() if ask_new != 'y': w += 1
def mergesort(arra): ''' Uses the merge sort algorithm to sort a list Inputs: arra: a list Returns a sorted version of that list ''' if len(arra)>1: middle = len(arra)//2 LHS = mergesort(arra[:middle]) RHS = mergesort(arra[middle:]) l = 0 r = 0 i = 0 new_arra = [] while l < len(LHS) and r < len(RHS): if LHS[l][1] < RHS[r][1]: new_arra.append(LHS[l]) l+=1 else: new_arra.append(RHS[r]) r+=1 i+=1 for x in LHS[l:]: new_arra.append(x) for y in RHS[r:]: new_arra.append(y) else: new_arra = arra[:] return new_arra
def mergesort(arra): """ Uses the merge sort algorithm to sort a list Inputs: arra: a list Returns a sorted version of that list """ if len(arra) > 1: middle = len(arra) // 2 lhs = mergesort(arra[:middle]) rhs = mergesort(arra[middle:]) l = 0 r = 0 i = 0 new_arra = [] while l < len(LHS) and r < len(RHS): if LHS[l][1] < RHS[r][1]: new_arra.append(LHS[l]) l += 1 else: new_arra.append(RHS[r]) r += 1 i += 1 for x in LHS[l:]: new_arra.append(x) for y in RHS[r:]: new_arra.append(y) else: new_arra = arra[:] return new_arra
class Server: def __init__(self, host_name, port): self.host_name = host_name self.port = port
class Server: def __init__(self, host_name, port): self.host_name = host_name self.port = port
# Enumerate, tuples (KO) my_list = ['apple', 'banana', 'grapes', 'pear'] counter_list = list(enumerate(my_list, 1)) print(counter_list) # Lamba (OK) def multiply(x): return (x*x) def add(x): return (x+x) funcs = [multiply, add] for i in range(5): value = list(map(lambda x: x(i), funcs)) print(value) # Reversed (OK) my_str = 'AiBohPhoBiA' l = range(-1, 2) # reverse the string rev_str = reversed(my_str) rev_l = reversed(l) # check if the string is equal to its reverse if list(my_str) == list(rev_str): print("The string is a palindrome.") else: print("The string is not a palindrome.")
my_list = ['apple', 'banana', 'grapes', 'pear'] counter_list = list(enumerate(my_list, 1)) print(counter_list) def multiply(x): return x * x def add(x): return x + x funcs = [multiply, add] for i in range(5): value = list(map(lambda x: x(i), funcs)) print(value) my_str = 'AiBohPhoBiA' l = range(-1, 2) rev_str = reversed(my_str) rev_l = reversed(l) if list(my_str) == list(rev_str): print('The string is a palindrome.') else: print('The string is not a palindrome.')
# 270010300 if not sm.hasQuestCompleted(3503): # time lane quest sm.chat("You have not completed the appropriate quest to enter here.") else: sm.warp(270010400, 5) sm.dispose()
if not sm.hasQuestCompleted(3503): sm.chat('You have not completed the appropriate quest to enter here.') else: sm.warp(270010400, 5) sm.dispose()
nt=float(input()) np=float(input()) media=(nt+np)/2 if media>=6: print(f'aprovado') elif media<6 and nt>=2: print(f'talvez com a sub') else: print(f'reprovado')
nt = float(input()) np = float(input()) media = (nt + np) / 2 if media >= 6: print(f'aprovado') elif media < 6 and nt >= 2: print(f'talvez com a sub') else: print(f'reprovado')
def getReferenceParam(paramType, model, trial, latent, neuron, kernelParamIndex, indPointIndex, indPointIndex2): if paramType=="kernel": kernelsParams = model.getKernelsParams() refParam = kernelsParams[latent][kernelParamIndex] elif paramType=="embeddingC": embeddingParams = model.getSVEmbeddingParams() refParam = embeddingParams[0][neuron,latent] elif paramType=="embeddingD": embeddingParams = model.getSVEmbeddingParams() refParam = embeddingParams[1][neuron] else: raise ValueError("Invalid paramType: {:s}".format(paramType)) answer = refParam.clone() return answer def getParamUpdateFun(paramType): def updateKernelParam(model, paramValue, trial, latent, neuron, kernelParamIndex, indPointIndex, indPointIndex2): kernelsParams = model.getKernelsParams() kernelsParams[latent][kernelParamIndex] = paramValue model.buildKernelsMatrices() def updateCParam(model, paramValue, trial, latent, neuron, kernelParamIndex, indPointIndex, indPointIndex2): embeddingParams = model.getSVEmbeddingParams() embeddingParams[0][neuron,latent] = paramValue def updateDParam(model, paramValue, trial, latent, neuron, kernelParamIndex, indPointIndex, indPointIndex2): embeddingParams = model.getSVEmbeddingParams() embeddingParams[1][neuron] = paramValue if paramType=="kernel": return updateKernelParam elif paramType=="embeddingC": return updateCParam elif paramType=="embeddingD": return updateDParam else: raise ValueError("Invalid paramType: {:s}".format(paramType)) def getKernelParamTypeString(kernelParamIndex): if kernelParamIndex==0: paramTypeString = "Lengthscale" elif kernelParamIndex==1: paramTypeString = "Period" else: raise ValueError("Invalid kernelParamIndex {:d}".format(kernelParamIndex)) return paramTypeString def getParamTitle(paramType, trial, latent, neuron, kernelParamIndex, indPointIndex, indPointIndex2, indPointsLocsKMSRegEpsilon): if paramType=="kernel": kernelParamTypeString = getKernelParamTypeString(kernelParamIndex=kernelParamIndex) title = "Kernel {:s}, Latent {:d}, Epsilon {:f}".format(kernelParamTypeString, latent, indPointsLocsKMSRegEpsilon) elif paramType=="embeddingC": title = "Embedding Mixing Matrix, Neuron {:d}, Latent{:d}, Epsilon {:f}".format(neuron, latent), indPointsLocsKMSRegEpsilon elif paramType=="embeddingD": title = "Embedding offset vector, Neuron {:d}, Epsilon {:f}".format(neuron, indPointsLocsKMSRegEpsilon) else: raise ValueError("Invalid paramType: {:s}".format(paramType)) return title def getFigFilenamePattern(prefixNumber, descriptor, paramType, indPointsLocsKMSRegEpsilon, trial, latent, neuron, kernelParamIndex, indPointIndex, indPointIndex2): if paramType=="kernel": kernelParamTypeString = getKernelParamTypeString(kernelParamIndex=kernelParamIndex) figFilename = "figures/{:08d}_{:s}_epsilon{:f}_kernel_{:s}_latent{:d}.{{:s}}".format(prefixNumber, descriptor, indPointsLocsKMSRegEpsilon, kernelParamTypeString, latent) elif paramType=="embeddingC": figFilename = "figures/{:08d}_{:s}_epsilon{:f}_C[{:d},{:d}].{{:s}}".format(prefixNumber, descriptor, indPointsLocsKMSRegEpsilon, neuron, latent) elif paramType=="embeddingD": figFilename = "figures/{:08d}_{:s}_epsilon{:f}_d[{:d}].{{:s}}".format(prefixNumber, descriptor, indPointsLocsKMSRegEpsilon, neuron) else: raise ValueError("Invalid paramType: {:s}".format(paramType)) return figFilename
def get_reference_param(paramType, model, trial, latent, neuron, kernelParamIndex, indPointIndex, indPointIndex2): if paramType == 'kernel': kernels_params = model.getKernelsParams() ref_param = kernelsParams[latent][kernelParamIndex] elif paramType == 'embeddingC': embedding_params = model.getSVEmbeddingParams() ref_param = embeddingParams[0][neuron, latent] elif paramType == 'embeddingD': embedding_params = model.getSVEmbeddingParams() ref_param = embeddingParams[1][neuron] else: raise value_error('Invalid paramType: {:s}'.format(paramType)) answer = refParam.clone() return answer def get_param_update_fun(paramType): def update_kernel_param(model, paramValue, trial, latent, neuron, kernelParamIndex, indPointIndex, indPointIndex2): kernels_params = model.getKernelsParams() kernelsParams[latent][kernelParamIndex] = paramValue model.buildKernelsMatrices() def update_c_param(model, paramValue, trial, latent, neuron, kernelParamIndex, indPointIndex, indPointIndex2): embedding_params = model.getSVEmbeddingParams() embeddingParams[0][neuron, latent] = paramValue def update_d_param(model, paramValue, trial, latent, neuron, kernelParamIndex, indPointIndex, indPointIndex2): embedding_params = model.getSVEmbeddingParams() embeddingParams[1][neuron] = paramValue if paramType == 'kernel': return updateKernelParam elif paramType == 'embeddingC': return updateCParam elif paramType == 'embeddingD': return updateDParam else: raise value_error('Invalid paramType: {:s}'.format(paramType)) def get_kernel_param_type_string(kernelParamIndex): if kernelParamIndex == 0: param_type_string = 'Lengthscale' elif kernelParamIndex == 1: param_type_string = 'Period' else: raise value_error('Invalid kernelParamIndex {:d}'.format(kernelParamIndex)) return paramTypeString def get_param_title(paramType, trial, latent, neuron, kernelParamIndex, indPointIndex, indPointIndex2, indPointsLocsKMSRegEpsilon): if paramType == 'kernel': kernel_param_type_string = get_kernel_param_type_string(kernelParamIndex=kernelParamIndex) title = 'Kernel {:s}, Latent {:d}, Epsilon {:f}'.format(kernelParamTypeString, latent, indPointsLocsKMSRegEpsilon) elif paramType == 'embeddingC': title = ('Embedding Mixing Matrix, Neuron {:d}, Latent{:d}, Epsilon {:f}'.format(neuron, latent), indPointsLocsKMSRegEpsilon) elif paramType == 'embeddingD': title = 'Embedding offset vector, Neuron {:d}, Epsilon {:f}'.format(neuron, indPointsLocsKMSRegEpsilon) else: raise value_error('Invalid paramType: {:s}'.format(paramType)) return title def get_fig_filename_pattern(prefixNumber, descriptor, paramType, indPointsLocsKMSRegEpsilon, trial, latent, neuron, kernelParamIndex, indPointIndex, indPointIndex2): if paramType == 'kernel': kernel_param_type_string = get_kernel_param_type_string(kernelParamIndex=kernelParamIndex) fig_filename = 'figures/{:08d}_{:s}_epsilon{:f}_kernel_{:s}_latent{:d}.{{:s}}'.format(prefixNumber, descriptor, indPointsLocsKMSRegEpsilon, kernelParamTypeString, latent) elif paramType == 'embeddingC': fig_filename = 'figures/{:08d}_{:s}_epsilon{:f}_C[{:d},{:d}].{{:s}}'.format(prefixNumber, descriptor, indPointsLocsKMSRegEpsilon, neuron, latent) elif paramType == 'embeddingD': fig_filename = 'figures/{:08d}_{:s}_epsilon{:f}_d[{:d}].{{:s}}'.format(prefixNumber, descriptor, indPointsLocsKMSRegEpsilon, neuron) else: raise value_error('Invalid paramType: {:s}'.format(paramType)) return figFilename
n=int(input()) lst=map(int,input().split()) lst2=lst.sort() print(lst2) print(min(lst2))
n = int(input()) lst = map(int, input().split()) lst2 = lst.sort() print(lst2) print(min(lst2))
print ('Current value of var test is: ', test) test.Value = 'New value set by Python' print ('New value is:', test) print ('-----------------------------------------------------') class C: def __init__(Self, Arg): Self.Arg = Arg def __str__(Self): return '<C instance contains: ' + str(Self.Arg) + '>' print ('Current value of var object is: ', object) object.Value = C('Hello !') print ('New value is:', object)
print('Current value of var test is: ', test) test.Value = 'New value set by Python' print('New value is:', test) print('-----------------------------------------------------') class C: def __init__(Self, Arg): Self.Arg = Arg def __str__(Self): return '<C instance contains: ' + str(Self.Arg) + '>' print('Current value of var object is: ', object) object.Value = c('Hello !') print('New value is:', object)
'''3. Write a Python program to get the largest number from a list.''' def get_largest(lst): return max(lst) print(get_largest([1, 2, 5, 3, 60, 2, 5]))
"""3. Write a Python program to get the largest number from a list.""" def get_largest(lst): return max(lst) print(get_largest([1, 2, 5, 3, 60, 2, 5]))
hello_message = "Hi there :wave:" welcome_attachment = [ { "pretext": "I am here to take some *feedback* about your meeting room.", "text": "*_How do you feel about your meeting room?_*", "callback_id": "os", "color": "#3AA3E3", "attachment_type": "default", "actions": [ { "name": "bad", "text": "Bad", "type": "button", "style": "danger", "value": "bad" }, { "name": "notsure", "text": "Not Sure", "type": "button", "value": "notsure" }, { "name": "awesome", "text": "Awesome", "type": "button", "style": "primary", "value": "awesome" } ] } ] feedback_form = { "title": "Converge Feedback", "submit_label": "Submit", "callback_id": "two", "elements": [ { "label": "Title", "type": "text", "name": "feedback_title", "placeholder": "Enter feedback title", }, { "label": "Feedback", "type": "textarea", "name": "feedback_description", "placeholder": "Enter your feedback", } ] } taking_feedback_message = { "as_user": "true", "text": "Taking your feedback.", "response_type": "ephemeral", "replace_original": "true" } thank_you_message = { "as_user": "true", "text": "Thank you for your feedback.", "response_type": "ephemeral", "replace_original": "true" } cancellation_message = { "text": "Cool! It is also ok.", "response_type": "ephemeral", "replace_original": "true" }
hello_message = 'Hi there :wave:' welcome_attachment = [{'pretext': 'I am here to take some *feedback* about your meeting room.', 'text': '*_How do you feel about your meeting room?_*', 'callback_id': 'os', 'color': '#3AA3E3', 'attachment_type': 'default', 'actions': [{'name': 'bad', 'text': 'Bad', 'type': 'button', 'style': 'danger', 'value': 'bad'}, {'name': 'notsure', 'text': 'Not Sure', 'type': 'button', 'value': 'notsure'}, {'name': 'awesome', 'text': 'Awesome', 'type': 'button', 'style': 'primary', 'value': 'awesome'}]}] feedback_form = {'title': 'Converge Feedback', 'submit_label': 'Submit', 'callback_id': 'two', 'elements': [{'label': 'Title', 'type': 'text', 'name': 'feedback_title', 'placeholder': 'Enter feedback title'}, {'label': 'Feedback', 'type': 'textarea', 'name': 'feedback_description', 'placeholder': 'Enter your feedback'}]} taking_feedback_message = {'as_user': 'true', 'text': 'Taking your feedback.', 'response_type': 'ephemeral', 'replace_original': 'true'} thank_you_message = {'as_user': 'true', 'text': 'Thank you for your feedback.', 'response_type': 'ephemeral', 'replace_original': 'true'} cancellation_message = {'text': 'Cool! It is also ok.', 'response_type': 'ephemeral', 'replace_original': 'true'}
class Solution: # @return a boolean def isScramble(self, s1, s2): cnt = {} for ch in s1: if ch not in cnt: cnt[ch] = 1 else: cnt[ch] += 1 for ch in s2: if ch not in cnt: return False else: cnt[ch] -= 1 if len(filter(int, cnt.values())) != 0: return False l = len(s1) if l == 1: return True for idx in xrange(1, l): if (self.isScramble(s1[:idx], s2[:idx]) and self.isScramble(s1[idx:], s2[idx:])): return True if (self.isScramble(s1[:idx], s2[-idx:]) and self.isScramble(s1[idx:], s2[:-idx])): return True return False
class Solution: def is_scramble(self, s1, s2): cnt = {} for ch in s1: if ch not in cnt: cnt[ch] = 1 else: cnt[ch] += 1 for ch in s2: if ch not in cnt: return False else: cnt[ch] -= 1 if len(filter(int, cnt.values())) != 0: return False l = len(s1) if l == 1: return True for idx in xrange(1, l): if self.isScramble(s1[:idx], s2[:idx]) and self.isScramble(s1[idx:], s2[idx:]): return True if self.isScramble(s1[:idx], s2[-idx:]) and self.isScramble(s1[idx:], s2[:-idx]): return True return False
# pylint: disable=missing-module-docstring __all__ = [ 'test_int__postgres_orm', ]
__all__ = ['test_int__postgres_orm']
# scripts/pretty_printer.py class bcolors: HEADER = '\033[95m' OKBLUE = '\033[94m' OKGREEN = '\033[92m' WARNING = '\033[93m' FAIL = '\033[91m' ENDC = '\033[0m' def disable(self): self.HEADER = '' self.OKBLUE = '' self.OKGREEN = '' self.WARNING = '' self.FAIL = '' self.ENDC = '' def printHeader(string): print(bcolors.HEADER + string + bcolors.ENDC) def printBlue(string): print(bcolors.OKBLUE + string + bcolors.ENDC) def printGreen(string): print(bcolors.OKGREEN + string + bcolors.ENDC) def printWarning(string): print(bcolors.WARNING + string + bcolors.ENDC) def printFail(string): print(bcolors.FAIL + string + bcolors.ENDC) def printDefault(string): print(string)
class Bcolors: header = '\x1b[95m' okblue = '\x1b[94m' okgreen = '\x1b[92m' warning = '\x1b[93m' fail = '\x1b[91m' endc = '\x1b[0m' def disable(self): self.HEADER = '' self.OKBLUE = '' self.OKGREEN = '' self.WARNING = '' self.FAIL = '' self.ENDC = '' def print_header(string): print(bcolors.HEADER + string + bcolors.ENDC) def print_blue(string): print(bcolors.OKBLUE + string + bcolors.ENDC) def print_green(string): print(bcolors.OKGREEN + string + bcolors.ENDC) def print_warning(string): print(bcolors.WARNING + string + bcolors.ENDC) def print_fail(string): print(bcolors.FAIL + string + bcolors.ENDC) def print_default(string): print(string)
#given an array and a target number, the goal is to find the target number in ther array and then move those target numbers to the end of the array. # O(n) time | O(n) space def moveElementToEnd(array, toMove): idx = 0 idj = len(array) - 1 # We've just made to pointers at the start and the end of the array to call upon in the while loop. while idx < idj: while idx < idj and array[idj] == toMove: idj -= 1 # The first condition will check if the first pointer and is less than the second pointer, AND the second pointer is equal to the target number(2), move the second pointer down one. if array[idx] == toMove: array[idx], array[idj] = array[idj], array[idx] idx += 1 # this second condition will check if the first pointer is equal to the target number(2) if so, it will swap the integers of idx and idj, moving them the target number to the back to the array - just as we want them to. # it will then move the idx up the array. return array # Once we have reordered the array in place and all the idj integers are bigger than the idx integers. Remeber that as the reordering takes place the idj moves to the left so at this stage, all the large numbers should be on the left of the array - moving down. # then this will print our reordered array blah = moveElementToEnd([2,3,2,1,2,4,2,4,2], 2) print(blah)
def move_element_to_end(array, toMove): idx = 0 idj = len(array) - 1 while idx < idj: while idx < idj and array[idj] == toMove: idj -= 1 if array[idx] == toMove: (array[idx], array[idj]) = (array[idj], array[idx]) idx += 1 return array blah = move_element_to_end([2, 3, 2, 1, 2, 4, 2, 4, 2], 2) print(blah)
''' Given head which is a reference node to a singly-linked list. The value of each node in the linked list is either 0 or 1. The linked list holds the binary representation of a number. Return the decimal value of the number in the linked list. Example 1: Input: head = [1,0,1] Output: 5 Explanation: (101) in base 2 = (5) in base 10 Example 2: Input: head = [0] Output: 0 Example 3: Input: head = [1] Output: 1 Example 4: Input: head = [1,0,0,1,0,0,1,1,1,0,0,0,0,0,0] Output: 18880 Example 5: Input: head = [0,0] Output: 0 Constraints: The Linked List is not empty. Number of nodes will not exceed 30. Each node's value is either 0 or 1. ''' # Definition for singly-linked list. # class ListNode: # def __init__(self, x): # self.val = x # self.next = None class Solution: def getDecimalValue(self, head: ListNode) -> int: binary_numbers_list = [] binary_numbers_list.append(head.val) while(head.next is not None): head = head.next binary_numbers_list.append(head.val) answer = 0 power = 0 # from len(binary_numbers_list) - 1 -> 0 for digit in range(len(binary_numbers_list) - 1, -1, -1): if(binary_numbers_list[digit] > 0): answer += ((2 ** power) * binary_numbers_list[digit]) power += 1 return answer
""" Given head which is a reference node to a singly-linked list. The value of each node in the linked list is either 0 or 1. The linked list holds the binary representation of a number. Return the decimal value of the number in the linked list. Example 1: Input: head = [1,0,1] Output: 5 Explanation: (101) in base 2 = (5) in base 10 Example 2: Input: head = [0] Output: 0 Example 3: Input: head = [1] Output: 1 Example 4: Input: head = [1,0,0,1,0,0,1,1,1,0,0,0,0,0,0] Output: 18880 Example 5: Input: head = [0,0] Output: 0 Constraints: The Linked List is not empty. Number of nodes will not exceed 30. Each node's value is either 0 or 1. """ class Solution: def get_decimal_value(self, head: ListNode) -> int: binary_numbers_list = [] binary_numbers_list.append(head.val) while head.next is not None: head = head.next binary_numbers_list.append(head.val) answer = 0 power = 0 for digit in range(len(binary_numbers_list) - 1, -1, -1): if binary_numbers_list[digit] > 0: answer += 2 ** power * binary_numbers_list[digit] power += 1 return answer
n=int(input()) s=input() l,r=s.rfind('L')+1,s.find('R')+1 if r>0: print(r,r+s.count('R')) else: print(l,l-s.count('L'))
n = int(input()) s = input() (l, r) = (s.rfind('L') + 1, s.find('R') + 1) if r > 0: print(r, r + s.count('R')) else: print(l, l - s.count('L'))
# Optimal Division class Solution: def optimalDivision(self, nums): if len(nums) == 1: return str(nums[0]) elif len(nums) == 2: return f"{nums[0]}/{nums[1]}" lhs = nums[0] rhs = '/'.join(str(e) for e in nums[1:]) return f"{lhs}/({rhs})" if __name__ == "__main__": sol = Solution() inp = [2] print(sol.optimalDivision(inp))
class Solution: def optimal_division(self, nums): if len(nums) == 1: return str(nums[0]) elif len(nums) == 2: return f'{nums[0]}/{nums[1]}' lhs = nums[0] rhs = '/'.join((str(e) for e in nums[1:])) return f'{lhs}/({rhs})' if __name__ == '__main__': sol = solution() inp = [2] print(sol.optimalDivision(inp))
class NotFoundException(Exception): def __init__(self, name, regex_string): self.name = name self.regex_string = regex_string def __str__(self): return ( 'No matches found about the following pattern.\n' + 'PATTERN_NAME: ' + repr(self.name) + '\n' + 'REGEX: ' + repr(self.regex_string) ) class NotRegisteredPatternException(Exception): def __init__(self, pattern_name): self.pattern_name = pattern_name def __str__(self): return ( "Not registered the following pattern.\n" + "Perhaps, don't you miss-spell?\n" + 'PATTERN_NAME: ' + repr(self.pattern_name) )
class Notfoundexception(Exception): def __init__(self, name, regex_string): self.name = name self.regex_string = regex_string def __str__(self): return 'No matches found about the following pattern.\n' + 'PATTERN_NAME: ' + repr(self.name) + '\n' + 'REGEX: ' + repr(self.regex_string) class Notregisteredpatternexception(Exception): def __init__(self, pattern_name): self.pattern_name = pattern_name def __str__(self): return 'Not registered the following pattern.\n' + "Perhaps, don't you miss-spell?\n" + 'PATTERN_NAME: ' + repr(self.pattern_name)
p1=input("Rock,Paper or Scissors: ") p2=input("Rock,Paper or Scissors: ") print("Player1 choosed ",p1) print("Player2 choosed ",p2) while p1=="Rock": if p2=="Rock": print("Game is equal") elif p2=="Paper": print("Winner is Player2") elif p2=="Scissors": print("Winner is player2") break while p1=="Paper": if P2=="Rock": print("Winner is player1") elif p2=="Paper": print("Game is equal") elif p2=="Scissors": print("Winner is player2") break while p1=="Scissors": if P2=="Rock": print("Winner is player2") elif p2=="Paper": print("Winner is player1") elif p2=="Scissors": print("Game is equal") break
p1 = input('Rock,Paper or Scissors: ') p2 = input('Rock,Paper or Scissors: ') print('Player1 choosed ', p1) print('Player2 choosed ', p2) while p1 == 'Rock': if p2 == 'Rock': print('Game is equal') elif p2 == 'Paper': print('Winner is Player2') elif p2 == 'Scissors': print('Winner is player2') break while p1 == 'Paper': if P2 == 'Rock': print('Winner is player1') elif p2 == 'Paper': print('Game is equal') elif p2 == 'Scissors': print('Winner is player2') break while p1 == 'Scissors': if P2 == 'Rock': print('Winner is player2') elif p2 == 'Paper': print('Winner is player1') elif p2 == 'Scissors': print('Game is equal') break
input=__import__('sys').stdin.readline n,m=map(int,input().split());d=[list(map(int,input().split())) for _ in range(n)] for i in range(n): for j in range(m): if i==0 and j==0: continue elif i==0: d[i][j]+=d[i][j-1] elif j==0: d[i][j]+=d[i-1][j] else: d[i][j]+=max(d[i-1][j-1],d[i][j-1],d[i-1][j]) print(d[n-1][m-1])
input = __import__('sys').stdin.readline (n, m) = map(int, input().split()) d = [list(map(int, input().split())) for _ in range(n)] for i in range(n): for j in range(m): if i == 0 and j == 0: continue elif i == 0: d[i][j] += d[i][j - 1] elif j == 0: d[i][j] += d[i - 1][j] else: d[i][j] += max(d[i - 1][j - 1], d[i][j - 1], d[i - 1][j]) print(d[n - 1][m - 1])
# Part 1 def jump1(jumps): j = jumps.split("\n") l = [] for item in j: l += [int(item)] length = len(l) loc = 0 counter = 0 while 0 <= loc and loc < length: counter += 1 jump = l[loc] l[loc] += 1 loc += jump return(counter) # Part 2 def jump2(jumps): j = jumps.split("\n") l = [] for item in j: l += [int(item)] length = len(l) loc = 0 counter = 0 while 0 <= loc and loc < length: counter += 1 jump = l[loc] if jump >= 3: l[loc] -= 1 else: l[loc] += 1 loc += jump return(counter)
def jump1(jumps): j = jumps.split('\n') l = [] for item in j: l += [int(item)] length = len(l) loc = 0 counter = 0 while 0 <= loc and loc < length: counter += 1 jump = l[loc] l[loc] += 1 loc += jump return counter def jump2(jumps): j = jumps.split('\n') l = [] for item in j: l += [int(item)] length = len(l) loc = 0 counter = 0 while 0 <= loc and loc < length: counter += 1 jump = l[loc] if jump >= 3: l[loc] -= 1 else: l[loc] += 1 loc += jump return counter
# list of random English nouns used for resource name utilities words = [ 'People', 'History', 'Way', 'Art', 'World', 'Information', 'Map', 'Two', 'Family', 'Government', 'Health', 'System', 'Computer', 'Meat', 'Year', 'Thanks', 'Music', 'Person', 'Reading', 'Method', 'Data', 'Food', 'Understanding', 'Theory', 'Law', 'Bird', 'Literature', 'Problem', 'Software', 'Control', 'Knowledge', 'Power', 'Ability', 'Economics', 'Love', 'Internet', 'Television', 'Science', 'Library', 'Nature', 'Fact', 'Product', 'Idea', 'Temperature', 'Investment', 'Area', 'Society', 'Activity', 'Story', 'Industry', 'Media', 'Thing', 'Oven', 'Community', 'Definition', 'Safety', 'Quality', 'Development', 'Language', 'Management', 'Player', 'Variety', 'Video', 'Week', 'Security', 'Country', 'Exam', 'Movie', 'Organization', 'Equipment', 'Physics', 'Analysis', 'Policy', 'Series', 'Thought', 'Basis', 'Boyfriend', 'Direction', 'Strategy', 'Technology', 'Army', 'Camera', 'Freedom', 'Paper', 'Environment', 'Child', 'Instance', 'Month', 'Truth', 'Marketing', 'University', 'Writing', 'Article', 'Department', 'Difference', 'Goal', 'News', 'Audience', 'Fishing', 'Growth', 'Income', 'Marriage', 'User', 'Combination', 'Failure', 'Meaning', 'Medicine', 'Philosophy', 'Teacher', 'Communication', 'Night', 'Chemistry', 'Disease', 'Disk', 'Energy', 'Nation', 'Road', 'Role', 'Soup', 'Advertising', 'Location', 'Success', 'Addition', 'Apartment', 'Education', 'Math', 'Moment', 'Painting', 'Politics', 'Attention', 'Decision', 'Event', 'Property', 'Shopping', 'Student', 'Wood', 'Competition', 'Distribution', 'Entertainment', 'Office', 'Population', 'President', 'Unit', 'Category', 'Cigarette', 'Context', 'Introduction', 'Opportunity', 'Performance', 'Driver', 'Flight', 'Length', 'Magazine', 'Newspaper', 'Relationship', 'Teaching', 'Cell', 'Dealer', 'Debate', 'Finding', 'Lake', 'Member', 'Message', 'Phone', 'Scene', 'Appearance', 'Association', 'Concept', 'Customer', 'Death', 'Discussion', 'Housing', 'Inflation', 'Insurance', 'Mood', 'Woman', 'Advice', 'Blood', 'Effort', 'Expression', 'Importance', 'Opinion', 'Payment', 'Reality', 'Responsibility', 'Situation', 'Skill', 'Statement', 'Wealth', 'Application', 'City', 'County', 'Depth', 'Estate', 'Foundation', 'Grandmother', 'Heart', 'Perspective', 'Photo', 'Recipe', 'Studio', 'Topic', 'Collection', 'Depression', 'Imagination', 'Passion', 'Percentage', 'Resource', 'Setting', 'Ad', 'Agency', 'College', 'Connection', 'Criticism', 'Debt', 'Description', 'Memory', 'Patience', 'Secretary', 'Solution', 'Administration', 'Aspect', 'Attitude', 'Director', 'Personality', 'Psychology', 'Recommendation', 'Response', 'Selection', 'Storage', 'Version', 'Alcohol', 'Argument', 'Complaint', 'Contract', 'Emphasis', 'Highway', 'Loss', 'Membership', 'Possession', 'Preparation', 'Steak', 'Union', 'Agreement', 'Cancer', 'Currency', 'Employment', 'Engineering', 'Entry', 'Interaction', 'Limit', 'Mixture', 'Preference', 'Region', 'Republic', 'Seat', 'Tradition', 'Virus', 'Actor', 'Classroom', 'Delivery', 'Device', 'Difficulty', 'Drama', 'Election', 'Engine', 'Football', 'Guidance', 'Hotel', 'Match', 'Owner', 'Priority', 'Protection', 'Suggestion', 'Tension', 'Variation', 'Anxiety', 'Atmosphere', 'Awareness', 'Bread', 'Climate', 'Comparison', 'Confusion', 'Construction', 'Elevator', 'Emotion', 'Employee', 'Employer', 'Guest', 'Height', 'Leadership', 'Mall', 'Manager', 'Operation', 'Recording', 'Respect', 'Sample', 'Transportation', 'Boring', 'Charity', 'Cousin', 'Disaster', 'Editor', 'Efficiency', 'Excitement', 'Extent', 'Feedback', 'Guitar', 'Homework', 'Leader', 'Mom', 'Outcome', 'Permission', 'Presentation', 'Promotion', 'Reflection', 'Refrigerator', 'Resolution', 'Revenue', 'Session', 'Singer', 'Tennis', 'Basket', 'Bonus', 'Cabinet', 'Childhood', 'Church', 'Clothes', 'Coffee', 'Dinner', 'Drawing', 'Hair', 'Hearing', 'Initiative', 'Judgment', 'Lab', 'Measurement', 'Mode', 'Mud', 'Orange', 'Poetry', 'Police', 'Possibility', 'Procedure', 'Queen', 'Ratio', 'Relation', 'Restaurant', 'Satisfaction', 'Sector', 'Signature', 'Significance', 'Song', 'Tooth', 'Town', 'Vehicle', 'Volume', 'Wife', 'Accident', 'Airport', 'Appointment', 'Arrival', 'Assumption', 'Baseball', 'Chapter', 'Committee', 'Conversation', 'Database', 'Enthusiasm', 'Error', 'Explanation', 'Farmer', 'Gate', 'Girl', 'Hall', 'Historian', 'Hospital', 'Injury', 'Instruction', 'Maintenance', 'Manufacturer', 'Meal', 'Perception', 'Pie', 'Poem', 'Presence', 'Proposal', 'Reception', 'Replacement', 'Revolution', 'River', 'Son', 'Speech', 'Tea', 'Village', 'Warning', 'Winner', 'Worker', 'Writer', 'Assistance', 'Breath', 'Buyer', 'Chest', 'Chocolate', 'Conclusion', 'Contribution', 'Cookie', 'Courage', 'Dad', 'Desk', 'Drawer', 'Establishment', 'Examination', 'Garbage', 'Grocery', 'Honey', 'Impression', 'Improvement', 'Independence', 'Insect', 'Inspection', 'Inspector', 'King', 'Ladder', 'Menu', 'Penalty', 'Piano', 'Potato', 'Profession', 'Professor', 'Quantity', 'Reaction', 'Requirement', 'Salad', 'Sister', 'Supermarket', 'Tongue', 'Weakness', 'Wedding', 'Affair', 'Ambition', 'Analyst', 'Apple', 'Assignment', 'Assistant', 'Bathroom', 'Bedroom', 'Beer', 'Birthday', 'Celebration', 'Championship', 'Cheek', 'Client', 'Consequence', 'Departure', 'Diamond', 'Dirt', 'Ear', 'Fortune', 'Friendship', 'Snapewife', 'Funeral', 'Gene', 'Girlfriend', 'Hat', 'Indication', 'Intention', 'Lady', 'Midnight', 'Negotiation', 'Obligation', 'Passenger', 'Pizza', 'Platform', 'Poet', 'Pollution', 'Recognition', 'Reputation', 'Shirt', 'Sir', 'Speaker', 'Stranger', 'Surgery', 'Sympathy', 'Tale', 'Throat', 'Trainer', 'Uncle', 'Youth', 'Time', 'Work', 'Film', 'Water', 'Money', 'Example', 'While', 'Business', 'Study', 'Game', 'Life', 'Form', 'Air', 'Day', 'Place', 'Number', 'Part', 'Field', 'Fish', 'Back', 'Process', 'Heat', 'Hand', 'Experience', 'Job', 'Book', 'End', 'Point', 'Type', 'Home', 'Economy', 'Value', 'Body', 'Market', 'Guide', 'Interest', 'State', 'Radio', 'Course', 'Company', 'Price', 'Size', 'Card', 'List', 'Mind', 'Trade', 'Line', 'Care', 'Group', 'Risk', 'Word', 'Fat', 'Force', 'Key', 'Light', 'Training', 'Name', 'School', 'Top', 'Amount', 'Level', 'Order', 'Practice', 'Research', 'Sense', 'Service', 'Piece', 'Web', 'Boss', 'Sport', 'Fun', 'House', 'Page', 'Term', 'Test', 'Answer', 'Sound', 'Focus', 'Matter', 'Kind', 'Soil', 'Board', 'Oil', 'Picture', 'Access', 'Garden', 'Range', 'Rate', 'Reason', 'Future', 'Site', 'Demand', 'Exercise', 'Image', 'Case', 'Cause', 'Coast', 'Action', 'Age', 'Bad', 'Boat', 'Record', 'Result', 'Section', 'Building', 'Mouse', 'Cash', 'Class', 'Nothing', 'Period', 'Plan', 'Store', 'Tax', 'Side', 'Subject', 'Space', 'Rule', 'Stock', 'Weather', 'Chance', 'Figure', 'Man', 'Model', 'Source', 'Beginning', 'Earth', 'Program', 'Chicken', 'Design', 'Feature', 'Head', 'Material', 'Purpose', 'Question', 'Rock', 'Salt', 'Act', 'Birth', 'Car', 'Dog', 'Object', 'Scale', 'Sun', 'Note', 'Profit', 'Rent', 'Speed', 'Style', 'War', 'Bank', 'Craft', 'Half', 'Inside', 'Outside', 'Standard', 'Bus', 'Exchange', 'Eye', 'Fire', 'Position', 'Pressure', 'Stress', 'Advantage', 'Benefit', 'Box', 'Frame', 'Issue', 'Step', 'Cycle', 'Face', 'Item', 'Metal', 'Paint', 'Review', 'Room', 'Screen', 'Structure', 'View', 'Account', 'Ball', 'Discipline', 'Medium', 'Share', 'Balance', 'Bit', 'Black', 'Bottom', 'Choice', 'Gift', 'Impact', 'Machine', 'Shape', 'Tool', 'Wind', 'Address', 'Average', 'Career', 'Culture', 'Morning', 'Pot', 'Sign', 'Table', 'Task', 'Condition', 'Contact', 'Credit', 'Egg', 'Hope', 'Ice', 'Network', 'North', 'Square', 'Attempt', 'Date', 'Effect', 'Link', 'Post', 'Star', 'Voice', 'Capital', 'Challenge', 'Friend', 'Self', 'Shot', 'Brush', 'Couple', 'Exit', 'Front', 'Function', 'Lack', 'Living', 'Plant', 'Plastic', 'Spot', 'Summer', 'Taste', 'Theme', 'Track', 'Wing', 'Brain', 'Button', 'Click', 'Desire', 'Foot', 'Gas', 'Influence', 'Notice', 'Rain', 'Wall', 'Base', 'Damage', 'Distance', 'Feeling', 'Pair', 'Savings', 'Staff', 'Sugar', 'Target', 'Text', 'Animal', 'Author', 'Budget', 'Discount', 'File', 'Ground', 'Lesson', 'Minute', 'Officer', 'Phase', 'Reference', 'Register', 'Sky', 'Stage', 'Stick', 'Title', 'Trouble', 'Bowl', 'Bridge', 'Campaign', 'Character', 'Club', 'Edge', 'Evidence', 'Fan', 'Letter', 'Lock', 'Maximum', 'Novel', 'Option', 'Pack', 'Park', 'Plenty', 'Quarter', 'Skin', 'Sort', 'Weight', 'Baby', 'Background', 'Carry', 'Dish', 'Factor', 'Fruit', 'Glass', 'Joint', 'Master', 'Muscle', 'Red', 'Strength', 'Traffic', 'Trip', 'Vegetable', 'Appeal', 'Chart', 'Gear', 'Ideal', 'Kitchen', 'Land', 'Log', 'Mother', 'Net', 'Party', 'Principle', 'Relative', 'Sale', 'Season', 'Signal', 'Spirit', 'Street', 'Tree', 'Wave', 'Belt', 'Bench', 'Commission', 'Copy', 'Drop', 'Minimum', 'Path', 'Progress', 'Project', 'Sea', 'South', 'Status', 'Stuff', 'Ticket', 'Tour', 'Angle', 'Blue', 'Breakfast', 'Confidence', 'Daughter', 'Degree', 'Doctor', 'Dot', 'Dream', 'Duty', 'Essay', 'Father', 'Fee', 'Finance', 'Hour', 'Juice', 'Luck', 'Milk', 'Mouth', 'Peace', 'Pipe', 'Stable', 'Storm', 'Substance', 'Team', 'Trick', 'Afternoon', 'Bat', 'Beach', 'Blank', 'Catch', 'Chain', 'Consideration', 'Cream', 'Crew', 'Detail', 'Gold', 'Interview', 'Kid', 'Mark', 'Mission', 'Pain', 'Pleasure', 'Score', 'Screw', 'Gratitude', 'Shop', 'Shower', 'Suit', 'Tone', 'Window', 'Agent', 'Band', 'Bath', 'Block', 'Bone', 'Calendar', 'Candidate', 'Cap', 'Coat', 'Contest', 'Corner', 'Court', 'Cup', 'District', 'Door', 'East', 'Finger', 'Garage', 'Guarantee', 'Hole', 'Hook', 'Implement', 'Layer', 'Lecture', 'Lie', 'Manner', 'Meeting', 'Nose', 'Parking', 'Partner', 'Profile', 'Rice', 'Routine', 'Schedule', 'Swimming', 'Telephone', 'Tip', 'Winter', 'Airline', 'Bag', 'Battle', 'Bed', 'Bill', 'Bother', 'Cake', 'Code', 'Curve', 'Designer', 'Dimension', 'Dress', 'Ease', 'Emergency', 'Evening', 'Extension', 'Farm', 'Fight', 'Gap', 'Grade', 'Holiday', 'Horror', 'Horse', 'Host', 'Husband', 'Loan', 'Mistake', 'Mountain', 'Nail', 'Noise', 'Occasion', 'Package', 'Patient', 'Pause', 'Phrase', 'Proof', 'Race', 'Relief', 'Sand', 'Sentence', 'Shoulder', 'Smoke', 'Stomach', 'String', 'Tourist', 'Towel', 'Vacation', 'West', 'Wheel', 'Wine', 'Arm', 'Aside', 'Associate', 'Bet', 'Blow', 'Border', 'Branch', 'Breast', 'Brother', 'Buddy', 'Bunch', 'Chip', 'Coach', 'Cross', 'Document', 'Draft', 'Dust', 'Expert', 'Floor', 'God', 'Golf', 'Habit', 'Iron', 'Judge', 'Knife', 'Landscape', 'League', 'Mail', 'Mess', 'Native', 'Opening', 'Parent', 'Pattern', 'Pin', 'Pool', 'Pound', 'Request', 'Salary', 'Shame', 'Shelter', 'Shoe', 'Silver', 'Tackle', 'Tank', 'Trust', 'Assist', 'Bake', 'Bar', 'Bell', 'Bike', 'Blame', 'Boy', 'Brick', 'Chair', 'Closet', 'Clue', 'Collar', 'Comment', 'Conference', 'Devil', 'Diet', 'Fear', 'Fuel', 'Glove', 'Jacket', 'Lunch', 'Monitor', 'Mortgage', 'Nurse', 'Pace', 'Panic', 'Peak', 'Plane', 'Reward', 'Row', 'Sandwich', 'Shock', 'Spite', 'Spray', 'Surprise', 'Till', 'Transition', 'Weekend', 'Welcome', 'Yard', 'Alarm', 'Bend', 'Bicycle', 'Bite', 'Blind', 'Bottle', 'Cable', 'Candle', 'Clerk', 'Cloud', 'Concert', 'Counter', 'Flower', 'Grandfather', 'Harm', 'Knee', 'Lawyer', 'Leather', 'Load', 'Mirror', 'Neck', 'Pension', 'Plate', 'Purple', 'Ruin', 'Ship', 'Skirt', 'Slice', 'Snow', 'Specialist', 'Stroke', 'Switch', 'Trash', 'Tune', 'Zone', 'Anger', 'Award', 'Bid', 'Bitter', 'Boot', 'Bug', 'Camp', 'Candy', 'Carpet', 'Cat', 'Champion', 'Channel', 'Clock', 'Comfort', 'Cow', 'Crack', 'Engineer', 'Entrance', 'Fault', 'Grass', 'Guy', 'Hell', 'Highlight', 'Incident', 'Island', 'Joke', 'Jury', 'Leg', 'Lip', 'Mate', 'Motor', 'Nerve', 'Passage', 'Pen', 'Pride', 'Priest', 'Prize', 'Promise', 'Resident', 'Resort', 'Ring', 'Roof', 'Rope', 'Sail', 'Scheme', 'Script', 'Sock', 'Station', 'Toe', 'Tower', 'Truck', 'Witness', 'Asparagus', 'You', 'It', 'Can', 'Will', 'If', 'One', 'Many', 'Most', 'Other', 'Use', 'Make', 'Good', 'Look', 'Help', 'Go', 'Great', 'Being', 'Few', 'Might', 'Still', 'Public', 'Read', 'Keep', 'Start', 'Give', 'Human', 'Local', 'General', 'She', 'Specific', 'Long', 'Play', 'Feel', 'High', 'Tonight', 'Put', 'Common', 'Set', 'Change', 'Simple', 'Past', 'Big', 'Possible', 'Particular', 'Today', 'Major', 'Personal', 'Current', 'National', 'Cut', 'Natural', 'Physical', 'Show', 'Try', 'Check', 'Second', 'Call', 'Move', 'Pay', 'Let', 'Increase', 'Single', 'Individual', 'Turn', 'Ask', 'Buy', 'Guard', 'Hold', 'Main', 'Offer', 'Potential', 'Professional', 'International', 'Travel', 'Cook', 'Alternative', 'Following', 'Special', 'Working', 'Whole', 'Dance', 'Excuse', 'Cold', 'Commercial', 'Low', 'Purchase', 'Deal', 'Primary', 'Worth', 'Fall', 'Necessary', 'Positive', 'Produce', 'Search', 'Present', 'Spend', 'Talk', 'Creative', 'Tell', 'Cost', 'Drive', 'Green', 'Support', 'Glad', 'Remove', 'Return', 'Run', 'Complex', 'Due', 'Effective', 'Middle', 'Regular', 'Reserve', 'Independent', 'Leave', 'Original', 'Reach', 'Rest', 'Serve', 'Watch', 'Beautiful', 'Charge', 'Active', 'Break', 'Negative', 'Safe', 'Stay', 'Visit', 'Visual', 'Affect', 'Cover', 'Report', 'Rise', 'Walk', 'White', 'Beyond', 'Junior', 'Pick', 'Unique', 'Anything', 'Classic', 'Final', 'Lift', 'Mix', 'Private', 'Stop', 'Teach', 'Western', 'Concern', 'Familiar', 'Fly', 'Official', 'Broad', 'Comfortable', 'Gain', 'Maybe', 'Rich', 'Save', 'Stand', 'Young', 'Heavy', 'Hello', 'Lead', 'Listen', 'Valuable', 'Worry', 'Handle', 'Leading', 'Meet', 'Release', 'Sell', 'Finish', 'Normal', 'Press', 'Ride', 'Secret', 'Spread', 'Spring', 'Tough', 'Wait', 'Brown', 'Deep', 'Display', 'Flow', 'Hit', 'Objective', 'Shoot', 'Touch', 'Cancel', 'Chemical', 'Cry', 'Dump', 'Extreme', 'Push', 'Conflict', 'Eat', 'Fill', 'Formal', 'Jump', 'Kick', 'Opposite', 'Pass', 'Pitch', 'Remote', 'Total', 'Treat', 'Vast', 'Abuse', 'Beat', 'Burn', 'Deposit', 'Print', 'Raise', 'Sleep', 'Somewhere', 'Advance', 'Anywhere', 'Consist', 'Dark', 'Double', 'Draw', 'Equal', 'Fix', 'Hire', 'Internal', 'Join', 'Kill', 'Sensitive', 'Tap', 'Win', 'Attack', 'Claim', 'Constant', 'Drag', 'Drink', 'Guess', 'Minor', 'Pull', 'Raw', 'Soft', 'Solid', 'Wear', 'Weird', 'Wonder', 'Annual', 'Count', 'Dead', 'Doubt', 'Feed', 'Forever', 'Impress', 'Nobody', 'Repeat', 'Round', 'Sing', 'Slide', 'Strip', 'Whereas', 'Wish', 'Combine', 'Command', 'Dig', 'Divide', 'Equivalent', 'Hang', 'Hunt', 'Initial', 'March', 'Mention', 'Spiritual', 'Survey', 'Tie', 'Adult', 'Brief', 'Crazy', 'Escape', 'Gather', 'Hate', 'Prior', 'Repair', 'Rough', 'Sad', 'Scratch', 'Sick', 'Strike', 'Employ', 'External', 'Hurt', 'Illegal', 'Laugh', 'Lay', 'Mobile', 'Nasty', 'Ordinary', 'Respond', 'Royal', 'Senior', 'Split', 'Strain', 'Struggle', 'Swim', 'Train', 'Upper', 'Wash', 'Yellow', 'Convert', 'Crash', 'Dependent', 'Fold', 'Funny', 'Grab', 'Hide', 'Miss', 'Permit', 'Quote', 'Recover', 'Resolve', 'Roll', 'Sink', 'Slip', 'Spare', 'Suspect', 'Sweet', 'Swing', 'Twist', 'Upstairs', 'Usual', 'Abroad', 'Brave', 'Calm', 'Concentrate', 'Estimate', 'Grand', 'Male', 'Mine', 'Prompt', 'Quiet', 'Refuse', 'Regret', 'Reveal', 'Rush', 'Shake', 'Shift', 'Shine', 'Steal', 'Suck', 'Surround', 'Anybody', 'Bear', 'Brilliant', 'Dare', 'Dear', 'Delay', 'Drunk', 'Female', 'Hurry', 'Inevitable', 'Invite', 'Kiss', 'Neat', 'Pop', 'Punch', 'Quit', 'Reply', 'Representative', 'Resist', 'Rip', 'Rub', 'Silly', 'Smile', 'Spell', 'Stretch', 'Stupid', 'Tear', 'Temporary', 'Tomorrow', 'Wake', 'Wrap', 'Yesterday', ]
words = ['People', 'History', 'Way', 'Art', 'World', 'Information', 'Map', 'Two', 'Family', 'Government', 'Health', 'System', 'Computer', 'Meat', 'Year', 'Thanks', 'Music', 'Person', 'Reading', 'Method', 'Data', 'Food', 'Understanding', 'Theory', 'Law', 'Bird', 'Literature', 'Problem', 'Software', 'Control', 'Knowledge', 'Power', 'Ability', 'Economics', 'Love', 'Internet', 'Television', 'Science', 'Library', 'Nature', 'Fact', 'Product', 'Idea', 'Temperature', 'Investment', 'Area', 'Society', 'Activity', 'Story', 'Industry', 'Media', 'Thing', 'Oven', 'Community', 'Definition', 'Safety', 'Quality', 'Development', 'Language', 'Management', 'Player', 'Variety', 'Video', 'Week', 'Security', 'Country', 'Exam', 'Movie', 'Organization', 'Equipment', 'Physics', 'Analysis', 'Policy', 'Series', 'Thought', 'Basis', 'Boyfriend', 'Direction', 'Strategy', 'Technology', 'Army', 'Camera', 'Freedom', 'Paper', 'Environment', 'Child', 'Instance', 'Month', 'Truth', 'Marketing', 'University', 'Writing', 'Article', 'Department', 'Difference', 'Goal', 'News', 'Audience', 'Fishing', 'Growth', 'Income', 'Marriage', 'User', 'Combination', 'Failure', 'Meaning', 'Medicine', 'Philosophy', 'Teacher', 'Communication', 'Night', 'Chemistry', 'Disease', 'Disk', 'Energy', 'Nation', 'Road', 'Role', 'Soup', 'Advertising', 'Location', 'Success', 'Addition', 'Apartment', 'Education', 'Math', 'Moment', 'Painting', 'Politics', 'Attention', 'Decision', 'Event', 'Property', 'Shopping', 'Student', 'Wood', 'Competition', 'Distribution', 'Entertainment', 'Office', 'Population', 'President', 'Unit', 'Category', 'Cigarette', 'Context', 'Introduction', 'Opportunity', 'Performance', 'Driver', 'Flight', 'Length', 'Magazine', 'Newspaper', 'Relationship', 'Teaching', 'Cell', 'Dealer', 'Debate', 'Finding', 'Lake', 'Member', 'Message', 'Phone', 'Scene', 'Appearance', 'Association', 'Concept', 'Customer', 'Death', 'Discussion', 'Housing', 'Inflation', 'Insurance', 'Mood', 'Woman', 'Advice', 'Blood', 'Effort', 'Expression', 'Importance', 'Opinion', 'Payment', 'Reality', 'Responsibility', 'Situation', 'Skill', 'Statement', 'Wealth', 'Application', 'City', 'County', 'Depth', 'Estate', 'Foundation', 'Grandmother', 'Heart', 'Perspective', 'Photo', 'Recipe', 'Studio', 'Topic', 'Collection', 'Depression', 'Imagination', 'Passion', 'Percentage', 'Resource', 'Setting', 'Ad', 'Agency', 'College', 'Connection', 'Criticism', 'Debt', 'Description', 'Memory', 'Patience', 'Secretary', 'Solution', 'Administration', 'Aspect', 'Attitude', 'Director', 'Personality', 'Psychology', 'Recommendation', 'Response', 'Selection', 'Storage', 'Version', 'Alcohol', 'Argument', 'Complaint', 'Contract', 'Emphasis', 'Highway', 'Loss', 'Membership', 'Possession', 'Preparation', 'Steak', 'Union', 'Agreement', 'Cancer', 'Currency', 'Employment', 'Engineering', 'Entry', 'Interaction', 'Limit', 'Mixture', 'Preference', 'Region', 'Republic', 'Seat', 'Tradition', 'Virus', 'Actor', 'Classroom', 'Delivery', 'Device', 'Difficulty', 'Drama', 'Election', 'Engine', 'Football', 'Guidance', 'Hotel', 'Match', 'Owner', 'Priority', 'Protection', 'Suggestion', 'Tension', 'Variation', 'Anxiety', 'Atmosphere', 'Awareness', 'Bread', 'Climate', 'Comparison', 'Confusion', 'Construction', 'Elevator', 'Emotion', 'Employee', 'Employer', 'Guest', 'Height', 'Leadership', 'Mall', 'Manager', 'Operation', 'Recording', 'Respect', 'Sample', 'Transportation', 'Boring', 'Charity', 'Cousin', 'Disaster', 'Editor', 'Efficiency', 'Excitement', 'Extent', 'Feedback', 'Guitar', 'Homework', 'Leader', 'Mom', 'Outcome', 'Permission', 'Presentation', 'Promotion', 'Reflection', 'Refrigerator', 'Resolution', 'Revenue', 'Session', 'Singer', 'Tennis', 'Basket', 'Bonus', 'Cabinet', 'Childhood', 'Church', 'Clothes', 'Coffee', 'Dinner', 'Drawing', 'Hair', 'Hearing', 'Initiative', 'Judgment', 'Lab', 'Measurement', 'Mode', 'Mud', 'Orange', 'Poetry', 'Police', 'Possibility', 'Procedure', 'Queen', 'Ratio', 'Relation', 'Restaurant', 'Satisfaction', 'Sector', 'Signature', 'Significance', 'Song', 'Tooth', 'Town', 'Vehicle', 'Volume', 'Wife', 'Accident', 'Airport', 'Appointment', 'Arrival', 'Assumption', 'Baseball', 'Chapter', 'Committee', 'Conversation', 'Database', 'Enthusiasm', 'Error', 'Explanation', 'Farmer', 'Gate', 'Girl', 'Hall', 'Historian', 'Hospital', 'Injury', 'Instruction', 'Maintenance', 'Manufacturer', 'Meal', 'Perception', 'Pie', 'Poem', 'Presence', 'Proposal', 'Reception', 'Replacement', 'Revolution', 'River', 'Son', 'Speech', 'Tea', 'Village', 'Warning', 'Winner', 'Worker', 'Writer', 'Assistance', 'Breath', 'Buyer', 'Chest', 'Chocolate', 'Conclusion', 'Contribution', 'Cookie', 'Courage', 'Dad', 'Desk', 'Drawer', 'Establishment', 'Examination', 'Garbage', 'Grocery', 'Honey', 'Impression', 'Improvement', 'Independence', 'Insect', 'Inspection', 'Inspector', 'King', 'Ladder', 'Menu', 'Penalty', 'Piano', 'Potato', 'Profession', 'Professor', 'Quantity', 'Reaction', 'Requirement', 'Salad', 'Sister', 'Supermarket', 'Tongue', 'Weakness', 'Wedding', 'Affair', 'Ambition', 'Analyst', 'Apple', 'Assignment', 'Assistant', 'Bathroom', 'Bedroom', 'Beer', 'Birthday', 'Celebration', 'Championship', 'Cheek', 'Client', 'Consequence', 'Departure', 'Diamond', 'Dirt', 'Ear', 'Fortune', 'Friendship', 'Snapewife', 'Funeral', 'Gene', 'Girlfriend', 'Hat', 'Indication', 'Intention', 'Lady', 'Midnight', 'Negotiation', 'Obligation', 'Passenger', 'Pizza', 'Platform', 'Poet', 'Pollution', 'Recognition', 'Reputation', 'Shirt', 'Sir', 'Speaker', 'Stranger', 'Surgery', 'Sympathy', 'Tale', 'Throat', 'Trainer', 'Uncle', 'Youth', 'Time', 'Work', 'Film', 'Water', 'Money', 'Example', 'While', 'Business', 'Study', 'Game', 'Life', 'Form', 'Air', 'Day', 'Place', 'Number', 'Part', 'Field', 'Fish', 'Back', 'Process', 'Heat', 'Hand', 'Experience', 'Job', 'Book', 'End', 'Point', 'Type', 'Home', 'Economy', 'Value', 'Body', 'Market', 'Guide', 'Interest', 'State', 'Radio', 'Course', 'Company', 'Price', 'Size', 'Card', 'List', 'Mind', 'Trade', 'Line', 'Care', 'Group', 'Risk', 'Word', 'Fat', 'Force', 'Key', 'Light', 'Training', 'Name', 'School', 'Top', 'Amount', 'Level', 'Order', 'Practice', 'Research', 'Sense', 'Service', 'Piece', 'Web', 'Boss', 'Sport', 'Fun', 'House', 'Page', 'Term', 'Test', 'Answer', 'Sound', 'Focus', 'Matter', 'Kind', 'Soil', 'Board', 'Oil', 'Picture', 'Access', 'Garden', 'Range', 'Rate', 'Reason', 'Future', 'Site', 'Demand', 'Exercise', 'Image', 'Case', 'Cause', 'Coast', 'Action', 'Age', 'Bad', 'Boat', 'Record', 'Result', 'Section', 'Building', 'Mouse', 'Cash', 'Class', 'Nothing', 'Period', 'Plan', 'Store', 'Tax', 'Side', 'Subject', 'Space', 'Rule', 'Stock', 'Weather', 'Chance', 'Figure', 'Man', 'Model', 'Source', 'Beginning', 'Earth', 'Program', 'Chicken', 'Design', 'Feature', 'Head', 'Material', 'Purpose', 'Question', 'Rock', 'Salt', 'Act', 'Birth', 'Car', 'Dog', 'Object', 'Scale', 'Sun', 'Note', 'Profit', 'Rent', 'Speed', 'Style', 'War', 'Bank', 'Craft', 'Half', 'Inside', 'Outside', 'Standard', 'Bus', 'Exchange', 'Eye', 'Fire', 'Position', 'Pressure', 'Stress', 'Advantage', 'Benefit', 'Box', 'Frame', 'Issue', 'Step', 'Cycle', 'Face', 'Item', 'Metal', 'Paint', 'Review', 'Room', 'Screen', 'Structure', 'View', 'Account', 'Ball', 'Discipline', 'Medium', 'Share', 'Balance', 'Bit', 'Black', 'Bottom', 'Choice', 'Gift', 'Impact', 'Machine', 'Shape', 'Tool', 'Wind', 'Address', 'Average', 'Career', 'Culture', 'Morning', 'Pot', 'Sign', 'Table', 'Task', 'Condition', 'Contact', 'Credit', 'Egg', 'Hope', 'Ice', 'Network', 'North', 'Square', 'Attempt', 'Date', 'Effect', 'Link', 'Post', 'Star', 'Voice', 'Capital', 'Challenge', 'Friend', 'Self', 'Shot', 'Brush', 'Couple', 'Exit', 'Front', 'Function', 'Lack', 'Living', 'Plant', 'Plastic', 'Spot', 'Summer', 'Taste', 'Theme', 'Track', 'Wing', 'Brain', 'Button', 'Click', 'Desire', 'Foot', 'Gas', 'Influence', 'Notice', 'Rain', 'Wall', 'Base', 'Damage', 'Distance', 'Feeling', 'Pair', 'Savings', 'Staff', 'Sugar', 'Target', 'Text', 'Animal', 'Author', 'Budget', 'Discount', 'File', 'Ground', 'Lesson', 'Minute', 'Officer', 'Phase', 'Reference', 'Register', 'Sky', 'Stage', 'Stick', 'Title', 'Trouble', 'Bowl', 'Bridge', 'Campaign', 'Character', 'Club', 'Edge', 'Evidence', 'Fan', 'Letter', 'Lock', 'Maximum', 'Novel', 'Option', 'Pack', 'Park', 'Plenty', 'Quarter', 'Skin', 'Sort', 'Weight', 'Baby', 'Background', 'Carry', 'Dish', 'Factor', 'Fruit', 'Glass', 'Joint', 'Master', 'Muscle', 'Red', 'Strength', 'Traffic', 'Trip', 'Vegetable', 'Appeal', 'Chart', 'Gear', 'Ideal', 'Kitchen', 'Land', 'Log', 'Mother', 'Net', 'Party', 'Principle', 'Relative', 'Sale', 'Season', 'Signal', 'Spirit', 'Street', 'Tree', 'Wave', 'Belt', 'Bench', 'Commission', 'Copy', 'Drop', 'Minimum', 'Path', 'Progress', 'Project', 'Sea', 'South', 'Status', 'Stuff', 'Ticket', 'Tour', 'Angle', 'Blue', 'Breakfast', 'Confidence', 'Daughter', 'Degree', 'Doctor', 'Dot', 'Dream', 'Duty', 'Essay', 'Father', 'Fee', 'Finance', 'Hour', 'Juice', 'Luck', 'Milk', 'Mouth', 'Peace', 'Pipe', 'Stable', 'Storm', 'Substance', 'Team', 'Trick', 'Afternoon', 'Bat', 'Beach', 'Blank', 'Catch', 'Chain', 'Consideration', 'Cream', 'Crew', 'Detail', 'Gold', 'Interview', 'Kid', 'Mark', 'Mission', 'Pain', 'Pleasure', 'Score', 'Screw', 'Gratitude', 'Shop', 'Shower', 'Suit', 'Tone', 'Window', 'Agent', 'Band', 'Bath', 'Block', 'Bone', 'Calendar', 'Candidate', 'Cap', 'Coat', 'Contest', 'Corner', 'Court', 'Cup', 'District', 'Door', 'East', 'Finger', 'Garage', 'Guarantee', 'Hole', 'Hook', 'Implement', 'Layer', 'Lecture', 'Lie', 'Manner', 'Meeting', 'Nose', 'Parking', 'Partner', 'Profile', 'Rice', 'Routine', 'Schedule', 'Swimming', 'Telephone', 'Tip', 'Winter', 'Airline', 'Bag', 'Battle', 'Bed', 'Bill', 'Bother', 'Cake', 'Code', 'Curve', 'Designer', 'Dimension', 'Dress', 'Ease', 'Emergency', 'Evening', 'Extension', 'Farm', 'Fight', 'Gap', 'Grade', 'Holiday', 'Horror', 'Horse', 'Host', 'Husband', 'Loan', 'Mistake', 'Mountain', 'Nail', 'Noise', 'Occasion', 'Package', 'Patient', 'Pause', 'Phrase', 'Proof', 'Race', 'Relief', 'Sand', 'Sentence', 'Shoulder', 'Smoke', 'Stomach', 'String', 'Tourist', 'Towel', 'Vacation', 'West', 'Wheel', 'Wine', 'Arm', 'Aside', 'Associate', 'Bet', 'Blow', 'Border', 'Branch', 'Breast', 'Brother', 'Buddy', 'Bunch', 'Chip', 'Coach', 'Cross', 'Document', 'Draft', 'Dust', 'Expert', 'Floor', 'God', 'Golf', 'Habit', 'Iron', 'Judge', 'Knife', 'Landscape', 'League', 'Mail', 'Mess', 'Native', 'Opening', 'Parent', 'Pattern', 'Pin', 'Pool', 'Pound', 'Request', 'Salary', 'Shame', 'Shelter', 'Shoe', 'Silver', 'Tackle', 'Tank', 'Trust', 'Assist', 'Bake', 'Bar', 'Bell', 'Bike', 'Blame', 'Boy', 'Brick', 'Chair', 'Closet', 'Clue', 'Collar', 'Comment', 'Conference', 'Devil', 'Diet', 'Fear', 'Fuel', 'Glove', 'Jacket', 'Lunch', 'Monitor', 'Mortgage', 'Nurse', 'Pace', 'Panic', 'Peak', 'Plane', 'Reward', 'Row', 'Sandwich', 'Shock', 'Spite', 'Spray', 'Surprise', 'Till', 'Transition', 'Weekend', 'Welcome', 'Yard', 'Alarm', 'Bend', 'Bicycle', 'Bite', 'Blind', 'Bottle', 'Cable', 'Candle', 'Clerk', 'Cloud', 'Concert', 'Counter', 'Flower', 'Grandfather', 'Harm', 'Knee', 'Lawyer', 'Leather', 'Load', 'Mirror', 'Neck', 'Pension', 'Plate', 'Purple', 'Ruin', 'Ship', 'Skirt', 'Slice', 'Snow', 'Specialist', 'Stroke', 'Switch', 'Trash', 'Tune', 'Zone', 'Anger', 'Award', 'Bid', 'Bitter', 'Boot', 'Bug', 'Camp', 'Candy', 'Carpet', 'Cat', 'Champion', 'Channel', 'Clock', 'Comfort', 'Cow', 'Crack', 'Engineer', 'Entrance', 'Fault', 'Grass', 'Guy', 'Hell', 'Highlight', 'Incident', 'Island', 'Joke', 'Jury', 'Leg', 'Lip', 'Mate', 'Motor', 'Nerve', 'Passage', 'Pen', 'Pride', 'Priest', 'Prize', 'Promise', 'Resident', 'Resort', 'Ring', 'Roof', 'Rope', 'Sail', 'Scheme', 'Script', 'Sock', 'Station', 'Toe', 'Tower', 'Truck', 'Witness', 'Asparagus', 'You', 'It', 'Can', 'Will', 'If', 'One', 'Many', 'Most', 'Other', 'Use', 'Make', 'Good', 'Look', 'Help', 'Go', 'Great', 'Being', 'Few', 'Might', 'Still', 'Public', 'Read', 'Keep', 'Start', 'Give', 'Human', 'Local', 'General', 'She', 'Specific', 'Long', 'Play', 'Feel', 'High', 'Tonight', 'Put', 'Common', 'Set', 'Change', 'Simple', 'Past', 'Big', 'Possible', 'Particular', 'Today', 'Major', 'Personal', 'Current', 'National', 'Cut', 'Natural', 'Physical', 'Show', 'Try', 'Check', 'Second', 'Call', 'Move', 'Pay', 'Let', 'Increase', 'Single', 'Individual', 'Turn', 'Ask', 'Buy', 'Guard', 'Hold', 'Main', 'Offer', 'Potential', 'Professional', 'International', 'Travel', 'Cook', 'Alternative', 'Following', 'Special', 'Working', 'Whole', 'Dance', 'Excuse', 'Cold', 'Commercial', 'Low', 'Purchase', 'Deal', 'Primary', 'Worth', 'Fall', 'Necessary', 'Positive', 'Produce', 'Search', 'Present', 'Spend', 'Talk', 'Creative', 'Tell', 'Cost', 'Drive', 'Green', 'Support', 'Glad', 'Remove', 'Return', 'Run', 'Complex', 'Due', 'Effective', 'Middle', 'Regular', 'Reserve', 'Independent', 'Leave', 'Original', 'Reach', 'Rest', 'Serve', 'Watch', 'Beautiful', 'Charge', 'Active', 'Break', 'Negative', 'Safe', 'Stay', 'Visit', 'Visual', 'Affect', 'Cover', 'Report', 'Rise', 'Walk', 'White', 'Beyond', 'Junior', 'Pick', 'Unique', 'Anything', 'Classic', 'Final', 'Lift', 'Mix', 'Private', 'Stop', 'Teach', 'Western', 'Concern', 'Familiar', 'Fly', 'Official', 'Broad', 'Comfortable', 'Gain', 'Maybe', 'Rich', 'Save', 'Stand', 'Young', 'Heavy', 'Hello', 'Lead', 'Listen', 'Valuable', 'Worry', 'Handle', 'Leading', 'Meet', 'Release', 'Sell', 'Finish', 'Normal', 'Press', 'Ride', 'Secret', 'Spread', 'Spring', 'Tough', 'Wait', 'Brown', 'Deep', 'Display', 'Flow', 'Hit', 'Objective', 'Shoot', 'Touch', 'Cancel', 'Chemical', 'Cry', 'Dump', 'Extreme', 'Push', 'Conflict', 'Eat', 'Fill', 'Formal', 'Jump', 'Kick', 'Opposite', 'Pass', 'Pitch', 'Remote', 'Total', 'Treat', 'Vast', 'Abuse', 'Beat', 'Burn', 'Deposit', 'Print', 'Raise', 'Sleep', 'Somewhere', 'Advance', 'Anywhere', 'Consist', 'Dark', 'Double', 'Draw', 'Equal', 'Fix', 'Hire', 'Internal', 'Join', 'Kill', 'Sensitive', 'Tap', 'Win', 'Attack', 'Claim', 'Constant', 'Drag', 'Drink', 'Guess', 'Minor', 'Pull', 'Raw', 'Soft', 'Solid', 'Wear', 'Weird', 'Wonder', 'Annual', 'Count', 'Dead', 'Doubt', 'Feed', 'Forever', 'Impress', 'Nobody', 'Repeat', 'Round', 'Sing', 'Slide', 'Strip', 'Whereas', 'Wish', 'Combine', 'Command', 'Dig', 'Divide', 'Equivalent', 'Hang', 'Hunt', 'Initial', 'March', 'Mention', 'Spiritual', 'Survey', 'Tie', 'Adult', 'Brief', 'Crazy', 'Escape', 'Gather', 'Hate', 'Prior', 'Repair', 'Rough', 'Sad', 'Scratch', 'Sick', 'Strike', 'Employ', 'External', 'Hurt', 'Illegal', 'Laugh', 'Lay', 'Mobile', 'Nasty', 'Ordinary', 'Respond', 'Royal', 'Senior', 'Split', 'Strain', 'Struggle', 'Swim', 'Train', 'Upper', 'Wash', 'Yellow', 'Convert', 'Crash', 'Dependent', 'Fold', 'Funny', 'Grab', 'Hide', 'Miss', 'Permit', 'Quote', 'Recover', 'Resolve', 'Roll', 'Sink', 'Slip', 'Spare', 'Suspect', 'Sweet', 'Swing', 'Twist', 'Upstairs', 'Usual', 'Abroad', 'Brave', 'Calm', 'Concentrate', 'Estimate', 'Grand', 'Male', 'Mine', 'Prompt', 'Quiet', 'Refuse', 'Regret', 'Reveal', 'Rush', 'Shake', 'Shift', 'Shine', 'Steal', 'Suck', 'Surround', 'Anybody', 'Bear', 'Brilliant', 'Dare', 'Dear', 'Delay', 'Drunk', 'Female', 'Hurry', 'Inevitable', 'Invite', 'Kiss', 'Neat', 'Pop', 'Punch', 'Quit', 'Reply', 'Representative', 'Resist', 'Rip', 'Rub', 'Silly', 'Smile', 'Spell', 'Stretch', 'Stupid', 'Tear', 'Temporary', 'Tomorrow', 'Wake', 'Wrap', 'Yesterday']
#Problem URL: https://www.hackerrank.com/challenges/grading/problem def gradingStudents(grades): for x in range (0, len(grades)): if(grades[x] >= 38): difference = 5 - (grades[x] % 5) if(difference < 3): grades[x] += difference return grades
def grading_students(grades): for x in range(0, len(grades)): if grades[x] >= 38: difference = 5 - grades[x] % 5 if difference < 3: grades[x] += difference return grades
def mul_by_2(num): return num*2 def mul_by_3(num): return num*3
def mul_by_2(num): return num * 2 def mul_by_3(num): return num * 3
def severity2color(sev): red = [0.674,0.322] orange = [0.700,0.400] yellow = [0.700, 0.500] white = [0.350,0.350] green = [0.408,0.517] sevMap = {5:red, 4:orange, 3:yellow, 2:yellow, 1:white, 0:white, -1:white, -2:green} return sevMap[sev]
def severity2color(sev): red = [0.674, 0.322] orange = [0.7, 0.4] yellow = [0.7, 0.5] white = [0.35, 0.35] green = [0.408, 0.517] sev_map = {5: red, 4: orange, 3: yellow, 2: yellow, 1: white, 0: white, -1: white, -2: green} return sevMap[sev]
class Solution: def minSteps(self, n): ans = 0 while n >= 2: facter = self.minFacter(n) if facter is not None: ans += facter n /= facter return int(ans) def minFacter(self, n): ans = None for i in Primes.elements: if n % i == 0: ans = i break if i * i > n: break if ans is not None: return ans else: return n class Primes: elements = [2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107, 109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223, 227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337, 347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457, 461,463,467,479,487,491,499,503,509,521,523,541,547,557,563,569,571,577,587,593, 599,601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691,701,709,719, 727,733,739,743,751,757,761,769,773,787,797,809,811,821,823,827,829,839,853,857, 859,863,877,881,883,887,907,911,919,929,937,941,947,953,967,971,977,983,991,997]
class Solution: def min_steps(self, n): ans = 0 while n >= 2: facter = self.minFacter(n) if facter is not None: ans += facter n /= facter return int(ans) def min_facter(self, n): ans = None for i in Primes.elements: if n % i == 0: ans = i break if i * i > n: break if ans is not None: return ans else: return n class Primes: elements = [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199, 211, 223, 227, 229, 233, 239, 241, 251, 257, 263, 269, 271, 277, 281, 283, 293, 307, 311, 313, 317, 331, 337, 347, 349, 353, 359, 367, 373, 379, 383, 389, 397, 401, 409, 419, 421, 431, 433, 439, 443, 449, 457, 461, 463, 467, 479, 487, 491, 499, 503, 509, 521, 523, 541, 547, 557, 563, 569, 571, 577, 587, 593, 599, 601, 607, 613, 617, 619, 631, 641, 643, 647, 653, 659, 661, 673, 677, 683, 691, 701, 709, 719, 727, 733, 739, 743, 751, 757, 761, 769, 773, 787, 797, 809, 811, 821, 823, 827, 829, 839, 853, 857, 859, 863, 877, 881, 883, 887, 907, 911, 919, 929, 937, 941, 947, 953, 967, 971, 977, 983, 991, 997]
for _ in range(int(input())): x, y , k = map(int, input().split(' ')) if x * y - 1 == k: print("YES") else: print("NO")
for _ in range(int(input())): (x, y, k) = map(int, input().split(' ')) if x * y - 1 == k: print('YES') else: print('NO')
a = list() for i in 'LastNightStudy': if (i == 'i'): pass else: a.append(i) if a is not None: print(a)
a = list() for i in 'LastNightStudy': if i == 'i': pass else: a.append(i) if a is not None: print(a)
fin = open("input") fout = open("output", "w") n = int(fin.readline()) fout.write("#" * n) fout.close()
fin = open('input') fout = open('output', 'w') n = int(fin.readline()) fout.write('#' * n) fout.close()
# recursive def pascal_triangle(n): assert n >= 1 if n == 1: return 1 elif n == 2: return 1, 1 else: x = pascal_helper(pascal_triangle(n-1)) x.insert(0, 1) x.append(1) return x def pascal_helper(lst): def helper(): for pair in zip(lst, lst[1:]): yield sum(pair) return list(helper())
def pascal_triangle(n): assert n >= 1 if n == 1: return 1 elif n == 2: return (1, 1) else: x = pascal_helper(pascal_triangle(n - 1)) x.insert(0, 1) x.append(1) return x def pascal_helper(lst): def helper(): for pair in zip(lst, lst[1:]): yield sum(pair) return list(helper())
class Pessoa: def __init__(self,nome=None,idade=35,*filhos): self.idade = idade self.nome=nome self.filhos=list(filhos) def cumprimentar(self): return 'ola' @staticmethod def estatico(): return 42 @classmethod def nome_atributos_de_classes(cls): return cls.estatico() class Homen(Pessoa): pass if __name__ == '__main__': darion=Homen('dario') paulo=Homen('paulo', 13, darion) print(darion.nome) darion.nome= 'dario nzita' print(darion.nome) print(darion.idade) print(paulo.idade) for filho in paulo.filhos: print(filho.nome) paulo.sobrenome='garcia' del darion.filhos print(paulo.sobrenome) print(darion.nome_atributos_de_classes())
class Pessoa: def __init__(self, nome=None, idade=35, *filhos): self.idade = idade self.nome = nome self.filhos = list(filhos) def cumprimentar(self): return 'ola' @staticmethod def estatico(): return 42 @classmethod def nome_atributos_de_classes(cls): return cls.estatico() class Homen(Pessoa): pass if __name__ == '__main__': darion = homen('dario') paulo = homen('paulo', 13, darion) print(darion.nome) darion.nome = 'dario nzita' print(darion.nome) print(darion.idade) print(paulo.idade) for filho in paulo.filhos: print(filho.nome) paulo.sobrenome = 'garcia' del darion.filhos print(paulo.sobrenome) print(darion.nome_atributos_de_classes())
config = { "DATA_DIR": "/data/temp_archive/", "IRODS_ROOT": "/ZoneA/home/rods/", "FDSNWS_ADDRESS": "http://rdsa-test.knmi.nl/fdsnws/station/1/query", "MONGO": [ { "NAME": "WFCatalog-daily", "HOST": "wfcatalog_mongo", "PORT": 27017, "DATABASE": "wfrepo", "COLLECTION": "daily_streams" }, { "NAME": "WFCatalog-segments", "HOST": "wfcatalog_mongo", "PORT": 27017, "DATABASE": "wfrepo", "COLLECTION": "c_segments" }, { "NAME": "Dublin Core", "HOST": "wfcatalog_mongo", "PORT": 27017, "DATABASE": "wfrepo", "COLLECTION": "dublin_core" }, { "NAME": "PPSD", "HOST": "ppsd_mongo", "PORT": 27017, "DATABASE": "ppsd", "COLLECTION": "ppsd" } ], "S3": { "BUCKET_NAME": "seismo-test-sds", "PREFIX": "my-sds", "PROFILE": "knmi-sandbox-saml" }, "IRODS": { "HOST": "localhost", "PORT": "1247", "USER": "username", "PASS": "password", "ZONE": "ZoneA" }, "LOGGING": { "LEVEL": "INFO", "FILENAME": None # use None for stdout }, "DEFAULT_RULE_TIMEOUT" : 10, "DELETION_DB": "./deletion.db" }
config = {'DATA_DIR': '/data/temp_archive/', 'IRODS_ROOT': '/ZoneA/home/rods/', 'FDSNWS_ADDRESS': 'http://rdsa-test.knmi.nl/fdsnws/station/1/query', 'MONGO': [{'NAME': 'WFCatalog-daily', 'HOST': 'wfcatalog_mongo', 'PORT': 27017, 'DATABASE': 'wfrepo', 'COLLECTION': 'daily_streams'}, {'NAME': 'WFCatalog-segments', 'HOST': 'wfcatalog_mongo', 'PORT': 27017, 'DATABASE': 'wfrepo', 'COLLECTION': 'c_segments'}, {'NAME': 'Dublin Core', 'HOST': 'wfcatalog_mongo', 'PORT': 27017, 'DATABASE': 'wfrepo', 'COLLECTION': 'dublin_core'}, {'NAME': 'PPSD', 'HOST': 'ppsd_mongo', 'PORT': 27017, 'DATABASE': 'ppsd', 'COLLECTION': 'ppsd'}], 'S3': {'BUCKET_NAME': 'seismo-test-sds', 'PREFIX': 'my-sds', 'PROFILE': 'knmi-sandbox-saml'}, 'IRODS': {'HOST': 'localhost', 'PORT': '1247', 'USER': 'username', 'PASS': 'password', 'ZONE': 'ZoneA'}, 'LOGGING': {'LEVEL': 'INFO', 'FILENAME': None}, 'DEFAULT_RULE_TIMEOUT': 10, 'DELETION_DB': './deletion.db'}
def content(): topic_dict = { "Basics": [["Introduction to Python", "/introduction-to-python-programming/"], ["Installing modules", "/installing-modules/"], ["Math basics", "/math-basics/"]], "Web Dev": [] } return topic_dict
def content(): topic_dict = {'Basics': [['Introduction to Python', '/introduction-to-python-programming/'], ['Installing modules', '/installing-modules/'], ['Math basics', '/math-basics/']], 'Web Dev': []} return topic_dict
# Run in QGIS python console settings = QSettings(QSettings.NativeFormat, QSettings.UserScope, 'QuantumGIS', 'QGis') settings.setValue('/Projections/projectDefaultCrs', 'EPSG:2278') settings.value('/Projections/projectDefaultCrs') settings.sync()
settings = q_settings(QSettings.NativeFormat, QSettings.UserScope, 'QuantumGIS', 'QGis') settings.setValue('/Projections/projectDefaultCrs', 'EPSG:2278') settings.value('/Projections/projectDefaultCrs') settings.sync()
#!/usr/bin/env python # -*- coding: utf-8 -*- SubConfKey = set(["dataset", "trainer", "model"]) class Config(object): def __init__(self, d): self.d = d def __repr__(self): return str(self.d) def _get_main_conf(conf, d): return {k: v for k, v in d.items() if k not in SubConfKey} def __getattr__(self, name): if name in SubConfKey: d = dict(self.d.get(name, {}), **self._get_main_conf(self.d)) return self.__class__(d) else: return self.d.get(name) def check_config_none(conf, keys=None): keys = keys or [] for key in keys: if getattr(conf, key, None) is None: raise AttributeError("Config key `{}` should not be None".format(key))
sub_conf_key = set(['dataset', 'trainer', 'model']) class Config(object): def __init__(self, d): self.d = d def __repr__(self): return str(self.d) def _get_main_conf(conf, d): return {k: v for (k, v) in d.items() if k not in SubConfKey} def __getattr__(self, name): if name in SubConfKey: d = dict(self.d.get(name, {}), **self._get_main_conf(self.d)) return self.__class__(d) else: return self.d.get(name) def check_config_none(conf, keys=None): keys = keys or [] for key in keys: if getattr(conf, key, None) is None: raise attribute_error('Config key `{}` should not be None'.format(key))
def _ceil_pow2(n: int) -> int: x = 0 while (1 << x) < n: x += 1 return x def _bsf(n: int) -> int: x = 0 while n % 2 == 0: x += 1 n //= 2 return x
def _ceil_pow2(n: int) -> int: x = 0 while 1 << x < n: x += 1 return x def _bsf(n: int) -> int: x = 0 while n % 2 == 0: x += 1 n //= 2 return x
# Definition for a binary tree node. # class TreeNode: # def __init__(self, x): # self.val = x # self.left = None # self.right = None class Solution: def inorderTraversal(self, root: TreeNode) -> List[int]: result = [] while root: if not root.left: result.append(root.val) root = root.right else: predecessor = root.left while predecessor.right and predecessor.right != root: predecessor = predecessor.right # predecessor.right == current, meaning we're going back to the root if not predecessor.right: predecessor.right = root root = root.left else: predecessor.right = None result.append(root.val) root = root.right return result
class Solution: def inorder_traversal(self, root: TreeNode) -> List[int]: result = [] while root: if not root.left: result.append(root.val) root = root.right else: predecessor = root.left while predecessor.right and predecessor.right != root: predecessor = predecessor.right if not predecessor.right: predecessor.right = root root = root.left else: predecessor.right = None result.append(root.val) root = root.right return result
{ 'targets' : [ #native { 'target_name' : 'node_native', 'type' : 'static_library', 'nnative_use_openssl%': 'true', 'nnative_shared_openssl%': 'false', 'nnative_target_type%': 'static_library', 'variables': { 'nnative_regex_name%': 're2', # possible values: re2, std, boost }, 'dependencies': [ '../deps/libuv/uv.gyp:libuv', '../deps/http-parser/http_parser.gyp:http_parser', ], 'include_dirs' : [ '../deps/libuv/include', '../deps/http-parser', '../include' ], 'sources' : [ '../src/async/AsyncBase.cpp', '../src/async/ActionCallback.cpp', '../src/async/FutureShared.cpp', '../src/async/FutureSharedResolver.cpp', '../src/base/Handle.cpp', '../src/base/Stream.cpp', '../src/crypto/utils.cpp', '../src/crypto/PBKDF2.cpp', '../src/crypto.cpp', '../src/fs.cpp', '../src/helper/CallStack_gcc.cpp', '../src/helper/CallStack_win.cpp', '../src/http/ClientRequest.cpp', '../src/http/ClientResponse.cpp', '../src/http/HttpUtils.cpp', '../src/http/MessageBase.cpp', '../src/http/IncomingMessage.cpp', '../src/http/OutgoingMessage.cpp', '../src/http/ServerConnection.cpp', '../src/http/Server.cpp', '../src/http/ServerPlugin.cpp', '../src/http/ServerRequest.cpp', '../src/http/ServerResponse.cpp', '../src/http/UrlObject.cpp', '../src/http.cpp', '../src/Loop.cpp', '../src/net/net_utils.cpp', '../src/Pipe.cpp', '../src/Process.cpp', '../src/net/Tcp.cpp', '../src/Regex.cpp', '../src/Timer.cpp', '../src/worker/WorkerBase.cpp', '../src/worker/WorkerCallback.cpp', '../src/UriTemplate.cpp', '../src/UriTemplateFormat.cpp', '../src/UriTemplateValue.cpp', ], 'direct_dependent_settings' : { 'include_dirs' : [ '../include', '../deps/libuv/include', '../deps/http-parser' ] }, 'all_dependent_settings' : { 'cflags':[ '-std=c++14' ] }, 'cflags':[ '-std=c++14' ], 'conditions' : [ ['nnative_regex_name=="re2"', { 'dependencies': [ 're2.gyp:re2', ], 'defines': [ 'NNATIVE_USE_RE2=1', 'NNATIVE_USE_STDREGEX=0', 'NNATIVE_USE_BOOSTREGEX=0', ], 'all_dependent_settings': { 'defines': [ 'NNATIVE_USE_RE2=1', 'NNATIVE_USE_STDREGEX=0', 'NNATIVE_USE_BOOSTREGEX=0', ], } }, 'nnative_regex_name=="std"', { 'defines': [ 'NNATIVE_USE_RE2=0', 'NNATIVE_USE_STDREGEX=1', 'NNATIVE_USE_BOOSTREGEX=0', ], 'all_dependent_settings': { 'defines': [ 'NNATIVE_USE_RE2=0', 'NNATIVE_USE_STDREGEX=1', 'NNATIVE_USE_BOOSTREGEX=0', ], } }, 'nnative_regex_name=="boost"', { 'defines': [ 'NNATIVE_USE_RE2=0', 'NNATIVE_USE_STDREGEX=0', 'NNATIVE_USE_BOOSTREGEX=1', ], 'ldflags': [ '-lboost_regex', '-lboost_iostreams' ], 'all_dependent_settings': { 'defines': [ 'NNATIVE_USE_RE2=0', 'NNATIVE_USE_STDREGEX=0', 'NNATIVE_USE_BOOSTREGEX=1', ], 'ldflags': [ '-lboost_regex', '-lboost_iostreams' ], }, }, { 'defines': [ 'NNATIVE_USE_RE2=0', 'NNATIVE_USE_STDREGEX=0', 'NNATIVE_USE_BOOSTREGEX=0', ] } ], ['OS=="mac"', { 'xcode_settings': { 'OTHER_CPLUSPLUSFLAGS' : ['-std=c++14', '-stdlib=libc++'], #'MACOSX_DEPLOYMENT_TARGET': '10.7', #'OTHER_LDFLAGS': ['-stdlib=libc++'] #'ARCHS': '$(ARCHS_STANDARD_64_BIT)' }, 'link_settings': { 'libraries': [ '$(SDKROOT)/System/Library/Frameworks/CoreServices.framework', '$(SDKROOT)/System/Library/Frameworks/CoreFoundation.framework' ] }, 'cflags': [ '-stdlib=libc++' ], 'all_dependent_settings': { 'xcode_settings': { 'OTHER_CPLUSPLUSFLAGS' : ['-std=c++14', '-stdlib=libc++'], #'MACOSX_DEPLOYMENT_TARGET': '10.7', #'OTHER_LDFLAGS': ['-stdlib=libc++'] #'ARCHS': '$(ARCHS_STANDARD_64_BIT)' }, 'link_settings': { 'libraries': [ '$(SDKROOT)/System/Library/Frameworks/CoreServices.framework', '$(SDKROOT)/System/Library/Frameworks/CoreFoundation.framework' ] }, 'cflags': [ '-stdlib=libc++' ] } }], ['OS=="linux"', { 'defines': [ '_GNU_SOURCE' ], }], ['nnative_use_openssl=="true"', { 'defines': [ 'HAVE_OPENSSL=1' ], 'sources': [ ], 'conditions': [ [ 'nnative_shared_openssl=="false"', { 'dependencies': [ '../deps/openssl/openssl.gyp:openssl', # for tests '../deps/openssl/openssl.gyp:openssl-cli', ], # Do not let unused OpenSSL symbols to slip away 'conditions': [ # -force_load or --whole-archive are not applicable for # the static library [ 'nnative_target_type!="static_library"', { 'xcode_settings': { 'OTHER_LDFLAGS': [ '-Wl,-force_load,<(PRODUCT_DIR)/<(OPENSSL_PRODUCT)', ] }, 'conditions': [ ['OS in "linux freebsd"', { 'ldflags': [ '-Wl,--whole-archive <(PRODUCT_DIR)/<(OPENSSL_PRODUCT)', '-Wl,--no-whole-archive', ] }] ] }] ] }] ] }, { 'defines': [ 'HAVE_OPENSSL=0' ] }] ] } ] }
{'targets': [{'target_name': 'node_native', 'type': 'static_library', 'nnative_use_openssl%': 'true', 'nnative_shared_openssl%': 'false', 'nnative_target_type%': 'static_library', 'variables': {'nnative_regex_name%': 're2'}, 'dependencies': ['../deps/libuv/uv.gyp:libuv', '../deps/http-parser/http_parser.gyp:http_parser'], 'include_dirs': ['../deps/libuv/include', '../deps/http-parser', '../include'], 'sources': ['../src/async/AsyncBase.cpp', '../src/async/ActionCallback.cpp', '../src/async/FutureShared.cpp', '../src/async/FutureSharedResolver.cpp', '../src/base/Handle.cpp', '../src/base/Stream.cpp', '../src/crypto/utils.cpp', '../src/crypto/PBKDF2.cpp', '../src/crypto.cpp', '../src/fs.cpp', '../src/helper/CallStack_gcc.cpp', '../src/helper/CallStack_win.cpp', '../src/http/ClientRequest.cpp', '../src/http/ClientResponse.cpp', '../src/http/HttpUtils.cpp', '../src/http/MessageBase.cpp', '../src/http/IncomingMessage.cpp', '../src/http/OutgoingMessage.cpp', '../src/http/ServerConnection.cpp', '../src/http/Server.cpp', '../src/http/ServerPlugin.cpp', '../src/http/ServerRequest.cpp', '../src/http/ServerResponse.cpp', '../src/http/UrlObject.cpp', '../src/http.cpp', '../src/Loop.cpp', '../src/net/net_utils.cpp', '../src/Pipe.cpp', '../src/Process.cpp', '../src/net/Tcp.cpp', '../src/Regex.cpp', '../src/Timer.cpp', '../src/worker/WorkerBase.cpp', '../src/worker/WorkerCallback.cpp', '../src/UriTemplate.cpp', '../src/UriTemplateFormat.cpp', '../src/UriTemplateValue.cpp'], 'direct_dependent_settings': {'include_dirs': ['../include', '../deps/libuv/include', '../deps/http-parser']}, 'all_dependent_settings': {'cflags': ['-std=c++14']}, 'cflags': ['-std=c++14'], 'conditions': [['nnative_regex_name=="re2"', {'dependencies': ['re2.gyp:re2'], 'defines': ['NNATIVE_USE_RE2=1', 'NNATIVE_USE_STDREGEX=0', 'NNATIVE_USE_BOOSTREGEX=0'], 'all_dependent_settings': {'defines': ['NNATIVE_USE_RE2=1', 'NNATIVE_USE_STDREGEX=0', 'NNATIVE_USE_BOOSTREGEX=0']}}, 'nnative_regex_name=="std"', {'defines': ['NNATIVE_USE_RE2=0', 'NNATIVE_USE_STDREGEX=1', 'NNATIVE_USE_BOOSTREGEX=0'], 'all_dependent_settings': {'defines': ['NNATIVE_USE_RE2=0', 'NNATIVE_USE_STDREGEX=1', 'NNATIVE_USE_BOOSTREGEX=0']}}, 'nnative_regex_name=="boost"', {'defines': ['NNATIVE_USE_RE2=0', 'NNATIVE_USE_STDREGEX=0', 'NNATIVE_USE_BOOSTREGEX=1'], 'ldflags': ['-lboost_regex', '-lboost_iostreams'], 'all_dependent_settings': {'defines': ['NNATIVE_USE_RE2=0', 'NNATIVE_USE_STDREGEX=0', 'NNATIVE_USE_BOOSTREGEX=1'], 'ldflags': ['-lboost_regex', '-lboost_iostreams']}}, {'defines': ['NNATIVE_USE_RE2=0', 'NNATIVE_USE_STDREGEX=0', 'NNATIVE_USE_BOOSTREGEX=0']}], ['OS=="mac"', {'xcode_settings': {'OTHER_CPLUSPLUSFLAGS': ['-std=c++14', '-stdlib=libc++']}, 'link_settings': {'libraries': ['$(SDKROOT)/System/Library/Frameworks/CoreServices.framework', '$(SDKROOT)/System/Library/Frameworks/CoreFoundation.framework']}, 'cflags': ['-stdlib=libc++'], 'all_dependent_settings': {'xcode_settings': {'OTHER_CPLUSPLUSFLAGS': ['-std=c++14', '-stdlib=libc++']}, 'link_settings': {'libraries': ['$(SDKROOT)/System/Library/Frameworks/CoreServices.framework', '$(SDKROOT)/System/Library/Frameworks/CoreFoundation.framework']}, 'cflags': ['-stdlib=libc++']}}], ['OS=="linux"', {'defines': ['_GNU_SOURCE']}], ['nnative_use_openssl=="true"', {'defines': ['HAVE_OPENSSL=1'], 'sources': [], 'conditions': [['nnative_shared_openssl=="false"', {'dependencies': ['../deps/openssl/openssl.gyp:openssl', '../deps/openssl/openssl.gyp:openssl-cli'], 'conditions': [['nnative_target_type!="static_library"', {'xcode_settings': {'OTHER_LDFLAGS': ['-Wl,-force_load,<(PRODUCT_DIR)/<(OPENSSL_PRODUCT)']}, 'conditions': [['OS in "linux freebsd"', {'ldflags': ['-Wl,--whole-archive <(PRODUCT_DIR)/<(OPENSSL_PRODUCT)', '-Wl,--no-whole-archive']}]]}]]}]]}, {'defines': ['HAVE_OPENSSL=0']}]]}]}
n = int(input()) mat = [] for i in range (n): l = [] for j in range(n): l.append(int(input())) mat.append(l) inver = [] for i in range (n): inver.append(mat[i][i]) for i in range (n): mat[i][i] = mat[i][n - 1 - i] for j in range (len(mat)): mat[j][n-1-j] = inver[j] prin = [] for k in range (1): for i in range(n): prin.append(mat[k][n-1-i]) for k in range (1): for i in range (n): mat[k][i] = prin[i] print('{}'.format(mat))
n = int(input()) mat = [] for i in range(n): l = [] for j in range(n): l.append(int(input())) mat.append(l) inver = [] for i in range(n): inver.append(mat[i][i]) for i in range(n): mat[i][i] = mat[i][n - 1 - i] for j in range(len(mat)): mat[j][n - 1 - j] = inver[j] prin = [] for k in range(1): for i in range(n): prin.append(mat[k][n - 1 - i]) for k in range(1): for i in range(n): mat[k][i] = prin[i] print('{}'.format(mat))
class JSONDecodeError(Exception): pass class APIErrorException(Exception): error_code = 0 def get_error_code(self): return self.error_code def __init__(self, message, code, error_code, response_dict): self.message = message self.code = code self.error_code = error_code self.response_dict = response_dict def __str__(self): return self.message class InvalidArgumentException(Exception): pass class InvalidAccountType(Exception): pass class InvalidQrCodeType(Exception): pass
class Jsondecodeerror(Exception): pass class Apierrorexception(Exception): error_code = 0 def get_error_code(self): return self.error_code def __init__(self, message, code, error_code, response_dict): self.message = message self.code = code self.error_code = error_code self.response_dict = response_dict def __str__(self): return self.message class Invalidargumentexception(Exception): pass class Invalidaccounttype(Exception): pass class Invalidqrcodetype(Exception): pass
class Game: def __init__(self,x=640,y=480): self.x = x self.y = y pygame.init() self.fps = pygame.time.Clock() pygame.key.set_repeat(5,5) self.window = pygame.display.set_mode((self.x,self.y)) pygame.display.set_caption('Russian game, Made in the UK, by an American.') self.speed = 60 self.keys = pygame.key.get_pressed() self.piece = None def __call__(self): return self.update() def update(self): pygame.event.pump() self.keys = pygame.key.get_pressed() window.fill((0,0,0)) board.update(self.score) self.score.update() if self.piece: self.piece.interact(self.keys) if self.piece: self.piece.update() else: self.piece = Piece() self.piece.update() pygame.display.update() fps.tick(speed) # if con: # return True # return False return True
class Game: def __init__(self, x=640, y=480): self.x = x self.y = y pygame.init() self.fps = pygame.time.Clock() pygame.key.set_repeat(5, 5) self.window = pygame.display.set_mode((self.x, self.y)) pygame.display.set_caption('Russian game, Made in the UK, by an American.') self.speed = 60 self.keys = pygame.key.get_pressed() self.piece = None def __call__(self): return self.update() def update(self): pygame.event.pump() self.keys = pygame.key.get_pressed() window.fill((0, 0, 0)) board.update(self.score) self.score.update() if self.piece: self.piece.interact(self.keys) if self.piece: self.piece.update() else: self.piece = piece() self.piece.update() pygame.display.update() fps.tick(speed) return True
def selection_sort(arr): for i in range(len(arr)): min_index = i for j in range(i,len(arr)): if arr[min_index] > arr[j]: min_index = j arr[i],arr[min_index] = arr[min_index],arr[i] a = [25,12,7,10,8,23] print(a) selection_sort(a) print(a)
def selection_sort(arr): for i in range(len(arr)): min_index = i for j in range(i, len(arr)): if arr[min_index] > arr[j]: min_index = j (arr[i], arr[min_index]) = (arr[min_index], arr[i]) a = [25, 12, 7, 10, 8, 23] print(a) selection_sort(a) print(a)
# # PySNMP MIB module HH3C-TE-TUNNEL-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/HH3C-TE-TUNNEL-MIB # Produced by pysmi-0.3.4 at Wed May 1 13:30:00 2019 # On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4 # Using Python version 3.7.3 (default, Mar 27 2019, 09:23:15) # ObjectIdentifier, OctetString, Integer = mibBuilder.importSymbols("ASN1", "ObjectIdentifier", "OctetString", "Integer") NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues") ConstraintsIntersection, SingleValueConstraint, ValueSizeConstraint, ConstraintsUnion, ValueRangeConstraint = mibBuilder.importSymbols("ASN1-REFINEMENT", "ConstraintsIntersection", "SingleValueConstraint", "ValueSizeConstraint", "ConstraintsUnion", "ValueRangeConstraint") hh3cCommon, = mibBuilder.importSymbols("HH3C-OID-MIB", "hh3cCommon") MplsTunnelIndex, MplsLabel, MplsExtendedTunnelId, MplsTunnelInstanceIndex = mibBuilder.importSymbols("MPLS-TC-STD-MIB", "MplsTunnelIndex", "MplsLabel", "MplsExtendedTunnelId", "MplsTunnelInstanceIndex") ModuleCompliance, ObjectGroup, NotificationGroup = mibBuilder.importSymbols("SNMPv2-CONF", "ModuleCompliance", "ObjectGroup", "NotificationGroup") IpAddress, NotificationType, Counter64, Unsigned32, Bits, Counter32, TimeTicks, iso, MibIdentifier, ModuleIdentity, Gauge32, Integer32, MibScalar, MibTable, MibTableRow, MibTableColumn, ObjectIdentity = mibBuilder.importSymbols("SNMPv2-SMI", "IpAddress", "NotificationType", "Counter64", "Unsigned32", "Bits", "Counter32", "TimeTicks", "iso", "MibIdentifier", "ModuleIdentity", "Gauge32", "Integer32", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "ObjectIdentity") DisplayString, TextualConvention, RowPointer = mibBuilder.importSymbols("SNMPv2-TC", "DisplayString", "TextualConvention", "RowPointer") hh3cTeTunnel = ModuleIdentity((1, 3, 6, 1, 4, 1, 25506, 2, 115)) if mibBuilder.loadTexts: hh3cTeTunnel.setLastUpdated('201103240948Z') if mibBuilder.loadTexts: hh3cTeTunnel.setOrganization('Hangzhou H3C Tech. Co., Ltd.') if mibBuilder.loadTexts: hh3cTeTunnel.setContactInfo('Platform Team Hangzhou H3C Tech. Co., Ltd. Hai-Dian District Beijing P.R. China http://www.h3c.com Zip:100085') if mibBuilder.loadTexts: hh3cTeTunnel.setDescription('This MIB contains managed object definitions for the Multiprotocol Label Switching (MPLS) Te Tunnel.') hh3cTeTunnelScalars = MibIdentifier((1, 3, 6, 1, 4, 1, 25506, 2, 115, 1)) hh3cTeTunnelMaxTunnelIndex = MibScalar((1, 3, 6, 1, 4, 1, 25506, 2, 115, 1, 1), MplsTunnelIndex()).setMaxAccess("readonly") if mibBuilder.loadTexts: hh3cTeTunnelMaxTunnelIndex.setStatus('current') if mibBuilder.loadTexts: hh3cTeTunnelMaxTunnelIndex.setDescription('The max value of tunnel id is permitted configure on the device.') hh3cTeTunnelObjects = MibIdentifier((1, 3, 6, 1, 4, 1, 25506, 2, 115, 2)) hh3cTeTunnelStaticCrlspTable = MibTable((1, 3, 6, 1, 4, 1, 25506, 2, 115, 2, 1), ) if mibBuilder.loadTexts: hh3cTeTunnelStaticCrlspTable.setStatus('current') if mibBuilder.loadTexts: hh3cTeTunnelStaticCrlspTable.setDescription('This table contains information for static-crlsp, and through this to get detail information about this static-crlsp. Only support transit LSR and egress LSR.') hh3cTeTunnelStaticCrlspEntry = MibTableRow((1, 3, 6, 1, 4, 1, 25506, 2, 115, 2, 1, 1), ).setIndexNames((0, "HH3C-TE-TUNNEL-MIB", "hh3cTeTunnelStaticCrlspInLabel")) if mibBuilder.loadTexts: hh3cTeTunnelStaticCrlspEntry.setStatus('current') if mibBuilder.loadTexts: hh3cTeTunnelStaticCrlspEntry.setDescription('The entry in this table describes static-crlsp information.') hh3cTeTunnelStaticCrlspInLabel = MibTableColumn((1, 3, 6, 1, 4, 1, 25506, 2, 115, 2, 1, 1, 1), MplsLabel()) if mibBuilder.loadTexts: hh3cTeTunnelStaticCrlspInLabel.setStatus('current') if mibBuilder.loadTexts: hh3cTeTunnelStaticCrlspInLabel.setDescription('This is unique label value that manualy assigned. Uniquely identifies a static-crlsp. Managers should use this to obtain detail static-crlsp information.') hh3cTeTunnelStaticCrlspName = MibTableColumn((1, 3, 6, 1, 4, 1, 25506, 2, 115, 2, 1, 1, 2), OctetString().subtype(subtypeSpec=ValueSizeConstraint(1, 15))).setMaxAccess("readonly") if mibBuilder.loadTexts: hh3cTeTunnelStaticCrlspName.setStatus('current') if mibBuilder.loadTexts: hh3cTeTunnelStaticCrlspName.setDescription('The unique name assigned to the static-crlsp.') hh3cTeTunnelStaticCrlspStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 25506, 2, 115, 2, 1, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("up", 1), ("down", 2)))).setMaxAccess("readonly") if mibBuilder.loadTexts: hh3cTeTunnelStaticCrlspStatus.setStatus('current') if mibBuilder.loadTexts: hh3cTeTunnelStaticCrlspStatus.setDescription('Indicates the actual status of this static-crlsp, The value must be up when the static-crlsp status is up and the value must be down when the static-crlsp status is down.') hh3cTeTunnelStaticCrlspRole = MibTableColumn((1, 3, 6, 1, 4, 1, 25506, 2, 115, 2, 1, 1, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("transit", 1), ("tail", 2)))).setMaxAccess("readonly") if mibBuilder.loadTexts: hh3cTeTunnelStaticCrlspRole.setStatus('current') if mibBuilder.loadTexts: hh3cTeTunnelStaticCrlspRole.setDescription('This value indicate the role of this static-crlsp. This value must be transit at transit point of the tunnel, and tail at terminating point of the tunnel.') hh3cTeTunnelStaticCrlspXCPointer = MibTableColumn((1, 3, 6, 1, 4, 1, 25506, 2, 115, 2, 1, 1, 5), RowPointer()).setMaxAccess("readonly") if mibBuilder.loadTexts: hh3cTeTunnelStaticCrlspXCPointer.setStatus('current') if mibBuilder.loadTexts: hh3cTeTunnelStaticCrlspXCPointer.setDescription('This pointer unique identify a row of mplsXCTable. This value should be zeroDotZero when the static-crlsp is down. The mplsXCTable identifies the segments that compose this tunnel, their characteristics, and relationships to each other.') hh3cTeTunnelCoTable = MibTable((1, 3, 6, 1, 4, 1, 25506, 2, 115, 2, 2), ) if mibBuilder.loadTexts: hh3cTeTunnelCoTable.setStatus('current') if mibBuilder.loadTexts: hh3cTeTunnelCoTable.setDescription('This table contains information for Co-routed reverse crlsp and infomation of Co-routed bidirectional Tunnel Interface. If hh3cCorouteTunnelLspInstance is zero, to obtain infomation of Co-routed bidirectional Tunnel Interface, otherwise to obtain Co-routed reverse crlsp infomation.') hh3cTeTunnelCoEntry = MibTableRow((1, 3, 6, 1, 4, 1, 25506, 2, 115, 2, 2, 1), ).setIndexNames((0, "HH3C-TE-TUNNEL-MIB", "hh3cTeTunnelCoIndex"), (0, "HH3C-TE-TUNNEL-MIB", "hh3cTeTunnelCoLspInstance"), (0, "HH3C-TE-TUNNEL-MIB", "hh3cTeTunnelCoIngressLSRId"), (0, "HH3C-TE-TUNNEL-MIB", "hh3cTeTunnelCoEgressLSRId")) if mibBuilder.loadTexts: hh3cTeTunnelCoEntry.setStatus('current') if mibBuilder.loadTexts: hh3cTeTunnelCoEntry.setDescription('The entry in this table describes Co-routed infomation of bidirectional Tunnel Interface and reserver lsp information.') hh3cTeTunnelCoIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 25506, 2, 115, 2, 2, 1, 1), MplsTunnelIndex()) if mibBuilder.loadTexts: hh3cTeTunnelCoIndex.setStatus('current') if mibBuilder.loadTexts: hh3cTeTunnelCoIndex.setDescription('Uniquely identifies a set of tunnel instances between a pair of ingress and egress LSRs that specified at originating point. This value should be equal to the value signaled in the Tunnel Id of the Session object.') hh3cTeTunnelCoLspInstance = MibTableColumn((1, 3, 6, 1, 4, 1, 25506, 2, 115, 2, 2, 1, 2), MplsTunnelInstanceIndex()) if mibBuilder.loadTexts: hh3cTeTunnelCoLspInstance.setStatus('current') if mibBuilder.loadTexts: hh3cTeTunnelCoLspInstance.setDescription('When obtain infomation of Co-routed bidirectional Tunnel Interface, this vlaue should be zero. And this value must be LspID to obtain reverse crlsp information. Values greater than 0, but less than or equal to 65535, should be useless.') hh3cTeTunnelCoIngressLSRId = MibTableColumn((1, 3, 6, 1, 4, 1, 25506, 2, 115, 2, 2, 1, 3), MplsExtendedTunnelId()) if mibBuilder.loadTexts: hh3cTeTunnelCoIngressLSRId.setStatus('current') if mibBuilder.loadTexts: hh3cTeTunnelCoIngressLSRId.setDescription('Identity the ingress LSR associated with this tunnel instance. This vlaue is equal to the LsrID of originating endpoint.') hh3cTeTunnelCoEgressLSRId = MibTableColumn((1, 3, 6, 1, 4, 1, 25506, 2, 115, 2, 2, 1, 4), MplsExtendedTunnelId()) if mibBuilder.loadTexts: hh3cTeTunnelCoEgressLSRId.setStatus('current') if mibBuilder.loadTexts: hh3cTeTunnelCoEgressLSRId.setDescription('Identity of the egress LSR associated with this tunnel instance. This vlaue is equal to the LsrID of terminating point.') hh3cTeTunnelCoBiMode = MibTableColumn((1, 3, 6, 1, 4, 1, 25506, 2, 115, 2, 2, 1, 5), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("coroutedActive", 1), ("coroutedPassive", 2)))).setMaxAccess("readonly") if mibBuilder.loadTexts: hh3cTeTunnelCoBiMode.setStatus('current') if mibBuilder.loadTexts: hh3cTeTunnelCoBiMode.setDescription('This vlaue indicated the bidirection mode of tunnel interface. The valuemust be coroutedActive at the originating point of the tunnel and coroutedPassive at the terminating point.') hh3cTeTunnelCoReverseLspInstance = MibTableColumn((1, 3, 6, 1, 4, 1, 25506, 2, 115, 2, 2, 1, 6), MplsTunnelInstanceIndex()).setMaxAccess("readonly") if mibBuilder.loadTexts: hh3cTeTunnelCoReverseLspInstance.setStatus('current') if mibBuilder.loadTexts: hh3cTeTunnelCoReverseLspInstance.setDescription('This value indicated the reverse lsp instance, and should be equal to obverse lsp instance.') hh3cTeTunnelCoReverseLspXCPointer = MibTableColumn((1, 3, 6, 1, 4, 1, 25506, 2, 115, 2, 2, 1, 7), RowPointer()).setMaxAccess("readonly") if mibBuilder.loadTexts: hh3cTeTunnelCoReverseLspXCPointer.setStatus('current') if mibBuilder.loadTexts: hh3cTeTunnelCoReverseLspXCPointer.setDescription('This pointer unique index to mplsXCTable of the reverse lsp. The mplsXCTable identifies the segments that compose this tunnel, their characteristics, and relationships to each other. A value of zeroDotZero indicate that there is no crlsp assigned to this.') hh3cTeTunnelPsTable = MibTable((1, 3, 6, 1, 4, 1, 25506, 2, 115, 2, 3), ) if mibBuilder.loadTexts: hh3cTeTunnelPsTable.setStatus('current') if mibBuilder.loadTexts: hh3cTeTunnelPsTable.setDescription('This table defines some objects for managers to obtain TE tunnel Protection Switching group current status information.') hh3cTeTunnelPsEntry = MibTableRow((1, 3, 6, 1, 4, 1, 25506, 2, 115, 2, 3, 1), ).setIndexNames((0, "HH3C-TE-TUNNEL-MIB", "hh3cTeTunnelPsIndex"), (0, "HH3C-TE-TUNNEL-MIB", "hh3cTeTunnelPsIngressLSRId"), (0, "HH3C-TE-TUNNEL-MIB", "hh3cTeTunnelPsEgressLSRId")) if mibBuilder.loadTexts: hh3cTeTunnelPsEntry.setStatus('current') if mibBuilder.loadTexts: hh3cTeTunnelPsEntry.setDescription('The entry in this table describes TE tunnel Protection Switching group infromation.') hh3cTeTunnelPsIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 25506, 2, 115, 2, 3, 1, 1), MplsTunnelIndex()) if mibBuilder.loadTexts: hh3cTeTunnelPsIndex.setStatus('current') if mibBuilder.loadTexts: hh3cTeTunnelPsIndex.setDescription('Uniquely identifies a TE tunnel Protection Switching group instance. This value must be equal to the tunnel id of work tunnel instance.') hh3cTeTunnelPsIngressLSRId = MibTableColumn((1, 3, 6, 1, 4, 1, 25506, 2, 115, 2, 3, 1, 2), MplsExtendedTunnelId()) if mibBuilder.loadTexts: hh3cTeTunnelPsIngressLSRId.setStatus('current') if mibBuilder.loadTexts: hh3cTeTunnelPsIngressLSRId.setDescription('Identity the ingress LSR associated with work tunnel instance.') hh3cTeTunnelPsEgressLSRId = MibTableColumn((1, 3, 6, 1, 4, 1, 25506, 2, 115, 2, 3, 1, 3), MplsExtendedTunnelId()) if mibBuilder.loadTexts: hh3cTeTunnelPsEgressLSRId.setStatus('current') if mibBuilder.loadTexts: hh3cTeTunnelPsEgressLSRId.setDescription('Identity of the egress LSR associated with work tunnel instance.') hh3cTeTunnelPsProtectIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 25506, 2, 115, 2, 3, 1, 4), MplsTunnelIndex()).setMaxAccess("readonly") if mibBuilder.loadTexts: hh3cTeTunnelPsProtectIndex.setStatus('current') if mibBuilder.loadTexts: hh3cTeTunnelPsProtectIndex.setDescription('Uniquely identifies a TE tunnel Protection Switching group instance. This value must be equal to the tunnel id of TE tunnel Protection Switching group instance.') hh3cTeTunnelPsProtectIngressLSRId = MibTableColumn((1, 3, 6, 1, 4, 1, 25506, 2, 115, 2, 3, 1, 5), MplsExtendedTunnelId()).setMaxAccess("readonly") if mibBuilder.loadTexts: hh3cTeTunnelPsProtectIngressLSRId.setStatus('current') if mibBuilder.loadTexts: hh3cTeTunnelPsProtectIngressLSRId.setDescription('Identity the ingress LSR associated with TE tunnel Protection Switching group instance.') hh3cTeTunnelPsProtectEgressLSRId = MibTableColumn((1, 3, 6, 1, 4, 1, 25506, 2, 115, 2, 3, 1, 6), MplsExtendedTunnelId()).setMaxAccess("readonly") if mibBuilder.loadTexts: hh3cTeTunnelPsProtectEgressLSRId.setStatus('current') if mibBuilder.loadTexts: hh3cTeTunnelPsProtectEgressLSRId.setDescription('Identity of the egress LSR associated with TE tunnel Protection Switching group instance.') hh3cTeTunnelPsProtectType = MibTableColumn((1, 3, 6, 1, 4, 1, 25506, 2, 115, 2, 3, 1, 7), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("oneToOne", 1), ("onePlusOne", 2))).clone('oneToOne')).setMaxAccess("readonly") if mibBuilder.loadTexts: hh3cTeTunnelPsProtectType.setStatus('current') if mibBuilder.loadTexts: hh3cTeTunnelPsProtectType.setDescription('This value indicated TE tunnel Protection Switching group type. The default value is oneToOne.') hh3cTeTunnelPsRevertiveMode = MibTableColumn((1, 3, 6, 1, 4, 1, 25506, 2, 115, 2, 3, 1, 8), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("revertive", 1), ("noRevertive", 2))).clone('revertive')).setMaxAccess("readonly") if mibBuilder.loadTexts: hh3cTeTunnelPsRevertiveMode.setStatus('current') if mibBuilder.loadTexts: hh3cTeTunnelPsRevertiveMode.setDescription('This value indicated protect switch mode. The value must be revertive or nonRevertive, default value is revertive. ') hh3cTeTunnelPsWtrTime = MibTableColumn((1, 3, 6, 1, 4, 1, 25506, 2, 115, 2, 3, 1, 9), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(0, 60)).clone(24)).setUnits('30 seconds').setMaxAccess("readonly") if mibBuilder.loadTexts: hh3cTeTunnelPsWtrTime.setStatus('current') if mibBuilder.loadTexts: hh3cTeTunnelPsWtrTime.setDescription('The cycle time that switch to protect tunnel.') hh3cTeTunnelPsHoldOffTime = MibTableColumn((1, 3, 6, 1, 4, 1, 25506, 2, 115, 2, 3, 1, 10), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(0, 20))).setUnits('500ms').setMaxAccess("readonly") if mibBuilder.loadTexts: hh3cTeTunnelPsHoldOffTime.setStatus('current') if mibBuilder.loadTexts: hh3cTeTunnelPsHoldOffTime.setDescription('This value is switchback delay time. When detected the work path fault, switch to protect path after this time.') hh3cTeTunnelPsSwitchMode = MibTableColumn((1, 3, 6, 1, 4, 1, 25506, 2, 115, 2, 3, 1, 11), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("uniDirectional", 1), ("biDirectional", 2))).clone('uniDirectional')).setMaxAccess("readonly") if mibBuilder.loadTexts: hh3cTeTunnelPsSwitchMode.setStatus('current') if mibBuilder.loadTexts: hh3cTeTunnelPsSwitchMode.setDescription('This value indicated TE tunnel Protection Switching group switch mode.') hh3cTeTunnelPsWorkPathStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 25506, 2, 115, 2, 3, 1, 12), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("none", 1), ("noDefect", 2), ("inDefect", 3)))).setMaxAccess("readonly") if mibBuilder.loadTexts: hh3cTeTunnelPsWorkPathStatus.setStatus('current') if mibBuilder.loadTexts: hh3cTeTunnelPsWorkPathStatus.setDescription('This value indicates work path status. none, noDefect, inDefect will be used.') hh3cTeTunnelPsProtectPathStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 25506, 2, 115, 2, 3, 1, 13), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("none", 1), ("noDefect", 2), ("inDefect", 3)))).setMaxAccess("readonly") if mibBuilder.loadTexts: hh3cTeTunnelPsProtectPathStatus.setStatus('current') if mibBuilder.loadTexts: hh3cTeTunnelPsProtectPathStatus.setDescription('This value indicates protect path status. none, noDefect, inDefect(3) will be used.') hh3cTeTunnelPsSwitchResult = MibTableColumn((1, 3, 6, 1, 4, 1, 25506, 2, 115, 2, 3, 1, 14), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("workPath", 1), ("protectPath", 2)))).setMaxAccess("readonly") if mibBuilder.loadTexts: hh3cTeTunnelPsSwitchResult.setStatus('current') if mibBuilder.loadTexts: hh3cTeTunnelPsSwitchResult.setDescription('This value indicated current using path is work path or protect path.') hh3cTeTunnelNotifications = MibIdentifier((1, 3, 6, 1, 4, 1, 25506, 2, 115, 3)) hh3cTeTunnelNotificationsPrefix = MibIdentifier((1, 3, 6, 1, 4, 1, 25506, 2, 115, 3, 0)) hh3cTeTunnelPsSwitchWtoP = NotificationType((1, 3, 6, 1, 4, 1, 25506, 2, 115, 3, 0, 1)).setObjects(("HH3C-TE-TUNNEL-MIB", "hh3cTeTunnelPsWorkPathStatus"), ("HH3C-TE-TUNNEL-MIB", "hh3cTeTunnelPsProtectPathStatus")) if mibBuilder.loadTexts: hh3cTeTunnelPsSwitchWtoP.setStatus('current') if mibBuilder.loadTexts: hh3cTeTunnelPsSwitchWtoP.setDescription('This notification is generated when protect workgroup switch from work tunnel to protect tunnel.') hh3cTeTunnelPsSwitchPtoW = NotificationType((1, 3, 6, 1, 4, 1, 25506, 2, 115, 3, 0, 2)).setObjects(("HH3C-TE-TUNNEL-MIB", "hh3cTeTunnelPsWorkPathStatus"), ("HH3C-TE-TUNNEL-MIB", "hh3cTeTunnelPsProtectPathStatus")) if mibBuilder.loadTexts: hh3cTeTunnelPsSwitchPtoW.setStatus('current') if mibBuilder.loadTexts: hh3cTeTunnelPsSwitchPtoW.setDescription('This notification is generated when protect workgroup switch from protect tunnel to work tunnel.') hh3cTeTunnelConformance = MibIdentifier((1, 3, 6, 1, 4, 1, 25506, 2, 115, 4)) hh3cTeTunnelCompliances = MibIdentifier((1, 3, 6, 1, 4, 1, 25506, 2, 115, 4, 1)) hh3cTeTunnelCompliance = ModuleCompliance((1, 3, 6, 1, 4, 1, 25506, 2, 115, 4, 1, 1)).setObjects(("HH3C-TE-TUNNEL-MIB", "hh3cTeTunnelNotificationsGroup"), ("HH3C-TE-TUNNEL-MIB", "hh3cTeTunnelScalarsGroup"), ("HH3C-TE-TUNNEL-MIB", "hh3cTeTunnelStaticCrlspGroup"), ("HH3C-TE-TUNNEL-MIB", "hh3cTeTunnelCorouteGroup"), ("HH3C-TE-TUNNEL-MIB", "hh3cTeTunnelPsGroup")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): hh3cTeTunnelCompliance = hh3cTeTunnelCompliance.setStatus('current') if mibBuilder.loadTexts: hh3cTeTunnelCompliance.setDescription('The compliance statement for SNMP.') hh3cTeTunnelGroups = MibIdentifier((1, 3, 6, 1, 4, 1, 25506, 2, 115, 4, 2)) hh3cTeTunnelNotificationsGroup = NotificationGroup((1, 3, 6, 1, 4, 1, 25506, 2, 115, 4, 2, 1)).setObjects(("HH3C-TE-TUNNEL-MIB", "hh3cTeTunnelPsSwitchPtoW"), ("HH3C-TE-TUNNEL-MIB", "hh3cTeTunnelPsSwitchWtoP")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): hh3cTeTunnelNotificationsGroup = hh3cTeTunnelNotificationsGroup.setStatus('current') if mibBuilder.loadTexts: hh3cTeTunnelNotificationsGroup.setDescription('This group contains MPLS Te Tunnel traps.') hh3cTeTunnelScalarsGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 25506, 2, 115, 4, 2, 2)).setObjects(("HH3C-TE-TUNNEL-MIB", "hh3cTeTunnelMaxTunnelIndex")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): hh3cTeTunnelScalarsGroup = hh3cTeTunnelScalarsGroup.setStatus('current') if mibBuilder.loadTexts: hh3cTeTunnelScalarsGroup.setDescription('Scalar object needed to implement MPLS te tunnels.') hh3cTeTunnelStaticCrlspGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 25506, 2, 115, 4, 2, 3)).setObjects(("HH3C-TE-TUNNEL-MIB", "hh3cTeTunnelStaticCrlspName"), ("HH3C-TE-TUNNEL-MIB", "hh3cTeTunnelStaticCrlspStatus"), ("HH3C-TE-TUNNEL-MIB", "hh3cTeTunnelStaticCrlspRole"), ("HH3C-TE-TUNNEL-MIB", "hh3cTeTunnelStaticCrlspXCPointer")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): hh3cTeTunnelStaticCrlspGroup = hh3cTeTunnelStaticCrlspGroup.setStatus('current') if mibBuilder.loadTexts: hh3cTeTunnelStaticCrlspGroup.setDescription('Objects for quering static-crlsp information.') hh3cTeTunnelCorouteGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 25506, 2, 115, 4, 2, 4)).setObjects(("HH3C-TE-TUNNEL-MIB", "hh3cTeTunnelCoBiMode"), ("HH3C-TE-TUNNEL-MIB", "hh3cTeTunnelCoReverseLspInstance"), ("HH3C-TE-TUNNEL-MIB", "hh3cTeTunnelCoReverseLspXCPointer")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): hh3cTeTunnelCorouteGroup = hh3cTeTunnelCorouteGroup.setStatus('current') if mibBuilder.loadTexts: hh3cTeTunnelCorouteGroup.setDescription('Objects for quering Co-routed reverse crlsp information.') hh3cTeTunnelPsGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 25506, 2, 115, 4, 2, 5)).setObjects(("HH3C-TE-TUNNEL-MIB", "hh3cTeTunnelPsProtectIndex"), ("HH3C-TE-TUNNEL-MIB", "hh3cTeTunnelPsProtectIngressLSRId"), ("HH3C-TE-TUNNEL-MIB", "hh3cTeTunnelPsProtectEgressLSRId"), ("HH3C-TE-TUNNEL-MIB", "hh3cTeTunnelPsProtectType"), ("HH3C-TE-TUNNEL-MIB", "hh3cTeTunnelPsRevertiveMode"), ("HH3C-TE-TUNNEL-MIB", "hh3cTeTunnelPsWtrTime"), ("HH3C-TE-TUNNEL-MIB", "hh3cTeTunnelPsHoldOffTime"), ("HH3C-TE-TUNNEL-MIB", "hh3cTeTunnelPsSwitchMode"), ("HH3C-TE-TUNNEL-MIB", "hh3cTeTunnelPsWorkPathStatus"), ("HH3C-TE-TUNNEL-MIB", "hh3cTeTunnelPsProtectPathStatus"), ("HH3C-TE-TUNNEL-MIB", "hh3cTeTunnelPsSwitchResult")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): hh3cTeTunnelPsGroup = hh3cTeTunnelPsGroup.setStatus('current') if mibBuilder.loadTexts: hh3cTeTunnelPsGroup.setDescription('Objects for quering protect workgroup information.') mibBuilder.exportSymbols("HH3C-TE-TUNNEL-MIB", hh3cTeTunnelPsProtectIndex=hh3cTeTunnelPsProtectIndex, hh3cTeTunnelPsGroup=hh3cTeTunnelPsGroup, hh3cTeTunnelPsSwitchResult=hh3cTeTunnelPsSwitchResult, hh3cTeTunnelPsSwitchWtoP=hh3cTeTunnelPsSwitchWtoP, hh3cTeTunnelPsProtectType=hh3cTeTunnelPsProtectType, PYSNMP_MODULE_ID=hh3cTeTunnel, hh3cTeTunnelStaticCrlspGroup=hh3cTeTunnelStaticCrlspGroup, hh3cTeTunnelPsProtectEgressLSRId=hh3cTeTunnelPsProtectEgressLSRId, hh3cTeTunnelCoIndex=hh3cTeTunnelCoIndex, hh3cTeTunnelCoTable=hh3cTeTunnelCoTable, hh3cTeTunnelPsProtectIngressLSRId=hh3cTeTunnelPsProtectIngressLSRId, hh3cTeTunnelPsSwitchPtoW=hh3cTeTunnelPsSwitchPtoW, hh3cTeTunnelPsIndex=hh3cTeTunnelPsIndex, hh3cTeTunnelPsProtectPathStatus=hh3cTeTunnelPsProtectPathStatus, hh3cTeTunnelMaxTunnelIndex=hh3cTeTunnelMaxTunnelIndex, hh3cTeTunnel=hh3cTeTunnel, hh3cTeTunnelStaticCrlspInLabel=hh3cTeTunnelStaticCrlspInLabel, hh3cTeTunnelNotifications=hh3cTeTunnelNotifications, hh3cTeTunnelCoIngressLSRId=hh3cTeTunnelCoIngressLSRId, hh3cTeTunnelObjects=hh3cTeTunnelObjects, hh3cTeTunnelNotificationsGroup=hh3cTeTunnelNotificationsGroup, hh3cTeTunnelScalars=hh3cTeTunnelScalars, hh3cTeTunnelCompliance=hh3cTeTunnelCompliance, hh3cTeTunnelPsSwitchMode=hh3cTeTunnelPsSwitchMode, hh3cTeTunnelConformance=hh3cTeTunnelConformance, hh3cTeTunnelStaticCrlspRole=hh3cTeTunnelStaticCrlspRole, hh3cTeTunnelCoBiMode=hh3cTeTunnelCoBiMode, hh3cTeTunnelPsIngressLSRId=hh3cTeTunnelPsIngressLSRId, hh3cTeTunnelGroups=hh3cTeTunnelGroups, hh3cTeTunnelPsRevertiveMode=hh3cTeTunnelPsRevertiveMode, hh3cTeTunnelNotificationsPrefix=hh3cTeTunnelNotificationsPrefix, hh3cTeTunnelCoEgressLSRId=hh3cTeTunnelCoEgressLSRId, hh3cTeTunnelPsEgressLSRId=hh3cTeTunnelPsEgressLSRId, hh3cTeTunnelScalarsGroup=hh3cTeTunnelScalarsGroup, hh3cTeTunnelCorouteGroup=hh3cTeTunnelCorouteGroup, hh3cTeTunnelPsTable=hh3cTeTunnelPsTable, hh3cTeTunnelStaticCrlspTable=hh3cTeTunnelStaticCrlspTable, hh3cTeTunnelCoLspInstance=hh3cTeTunnelCoLspInstance, hh3cTeTunnelStaticCrlspEntry=hh3cTeTunnelStaticCrlspEntry, hh3cTeTunnelCompliances=hh3cTeTunnelCompliances, hh3cTeTunnelPsEntry=hh3cTeTunnelPsEntry, hh3cTeTunnelStaticCrlspStatus=hh3cTeTunnelStaticCrlspStatus, hh3cTeTunnelPsWtrTime=hh3cTeTunnelPsWtrTime, hh3cTeTunnelCoEntry=hh3cTeTunnelCoEntry, hh3cTeTunnelPsWorkPathStatus=hh3cTeTunnelPsWorkPathStatus, hh3cTeTunnelCoReverseLspInstance=hh3cTeTunnelCoReverseLspInstance, hh3cTeTunnelStaticCrlspXCPointer=hh3cTeTunnelStaticCrlspXCPointer, hh3cTeTunnelStaticCrlspName=hh3cTeTunnelStaticCrlspName, hh3cTeTunnelPsHoldOffTime=hh3cTeTunnelPsHoldOffTime, hh3cTeTunnelCoReverseLspXCPointer=hh3cTeTunnelCoReverseLspXCPointer)
(object_identifier, octet_string, integer) = mibBuilder.importSymbols('ASN1', 'ObjectIdentifier', 'OctetString', 'Integer') (named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues') (constraints_intersection, single_value_constraint, value_size_constraint, constraints_union, value_range_constraint) = mibBuilder.importSymbols('ASN1-REFINEMENT', 'ConstraintsIntersection', 'SingleValueConstraint', 'ValueSizeConstraint', 'ConstraintsUnion', 'ValueRangeConstraint') (hh3c_common,) = mibBuilder.importSymbols('HH3C-OID-MIB', 'hh3cCommon') (mpls_tunnel_index, mpls_label, mpls_extended_tunnel_id, mpls_tunnel_instance_index) = mibBuilder.importSymbols('MPLS-TC-STD-MIB', 'MplsTunnelIndex', 'MplsLabel', 'MplsExtendedTunnelId', 'MplsTunnelInstanceIndex') (module_compliance, object_group, notification_group) = mibBuilder.importSymbols('SNMPv2-CONF', 'ModuleCompliance', 'ObjectGroup', 'NotificationGroup') (ip_address, notification_type, counter64, unsigned32, bits, counter32, time_ticks, iso, mib_identifier, module_identity, gauge32, integer32, mib_scalar, mib_table, mib_table_row, mib_table_column, object_identity) = mibBuilder.importSymbols('SNMPv2-SMI', 'IpAddress', 'NotificationType', 'Counter64', 'Unsigned32', 'Bits', 'Counter32', 'TimeTicks', 'iso', 'MibIdentifier', 'ModuleIdentity', 'Gauge32', 'Integer32', 'MibScalar', 'MibTable', 'MibTableRow', 'MibTableColumn', 'ObjectIdentity') (display_string, textual_convention, row_pointer) = mibBuilder.importSymbols('SNMPv2-TC', 'DisplayString', 'TextualConvention', 'RowPointer') hh3c_te_tunnel = module_identity((1, 3, 6, 1, 4, 1, 25506, 2, 115)) if mibBuilder.loadTexts: hh3cTeTunnel.setLastUpdated('201103240948Z') if mibBuilder.loadTexts: hh3cTeTunnel.setOrganization('Hangzhou H3C Tech. Co., Ltd.') if mibBuilder.loadTexts: hh3cTeTunnel.setContactInfo('Platform Team Hangzhou H3C Tech. Co., Ltd. Hai-Dian District Beijing P.R. China http://www.h3c.com Zip:100085') if mibBuilder.loadTexts: hh3cTeTunnel.setDescription('This MIB contains managed object definitions for the Multiprotocol Label Switching (MPLS) Te Tunnel.') hh3c_te_tunnel_scalars = mib_identifier((1, 3, 6, 1, 4, 1, 25506, 2, 115, 1)) hh3c_te_tunnel_max_tunnel_index = mib_scalar((1, 3, 6, 1, 4, 1, 25506, 2, 115, 1, 1), mpls_tunnel_index()).setMaxAccess('readonly') if mibBuilder.loadTexts: hh3cTeTunnelMaxTunnelIndex.setStatus('current') if mibBuilder.loadTexts: hh3cTeTunnelMaxTunnelIndex.setDescription('The max value of tunnel id is permitted configure on the device.') hh3c_te_tunnel_objects = mib_identifier((1, 3, 6, 1, 4, 1, 25506, 2, 115, 2)) hh3c_te_tunnel_static_crlsp_table = mib_table((1, 3, 6, 1, 4, 1, 25506, 2, 115, 2, 1)) if mibBuilder.loadTexts: hh3cTeTunnelStaticCrlspTable.setStatus('current') if mibBuilder.loadTexts: hh3cTeTunnelStaticCrlspTable.setDescription('This table contains information for static-crlsp, and through this to get detail information about this static-crlsp. Only support transit LSR and egress LSR.') hh3c_te_tunnel_static_crlsp_entry = mib_table_row((1, 3, 6, 1, 4, 1, 25506, 2, 115, 2, 1, 1)).setIndexNames((0, 'HH3C-TE-TUNNEL-MIB', 'hh3cTeTunnelStaticCrlspInLabel')) if mibBuilder.loadTexts: hh3cTeTunnelStaticCrlspEntry.setStatus('current') if mibBuilder.loadTexts: hh3cTeTunnelStaticCrlspEntry.setDescription('The entry in this table describes static-crlsp information.') hh3c_te_tunnel_static_crlsp_in_label = mib_table_column((1, 3, 6, 1, 4, 1, 25506, 2, 115, 2, 1, 1, 1), mpls_label()) if mibBuilder.loadTexts: hh3cTeTunnelStaticCrlspInLabel.setStatus('current') if mibBuilder.loadTexts: hh3cTeTunnelStaticCrlspInLabel.setDescription('This is unique label value that manualy assigned. Uniquely identifies a static-crlsp. Managers should use this to obtain detail static-crlsp information.') hh3c_te_tunnel_static_crlsp_name = mib_table_column((1, 3, 6, 1, 4, 1, 25506, 2, 115, 2, 1, 1, 2), octet_string().subtype(subtypeSpec=value_size_constraint(1, 15))).setMaxAccess('readonly') if mibBuilder.loadTexts: hh3cTeTunnelStaticCrlspName.setStatus('current') if mibBuilder.loadTexts: hh3cTeTunnelStaticCrlspName.setDescription('The unique name assigned to the static-crlsp.') hh3c_te_tunnel_static_crlsp_status = mib_table_column((1, 3, 6, 1, 4, 1, 25506, 2, 115, 2, 1, 1, 3), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('up', 1), ('down', 2)))).setMaxAccess('readonly') if mibBuilder.loadTexts: hh3cTeTunnelStaticCrlspStatus.setStatus('current') if mibBuilder.loadTexts: hh3cTeTunnelStaticCrlspStatus.setDescription('Indicates the actual status of this static-crlsp, The value must be up when the static-crlsp status is up and the value must be down when the static-crlsp status is down.') hh3c_te_tunnel_static_crlsp_role = mib_table_column((1, 3, 6, 1, 4, 1, 25506, 2, 115, 2, 1, 1, 4), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('transit', 1), ('tail', 2)))).setMaxAccess('readonly') if mibBuilder.loadTexts: hh3cTeTunnelStaticCrlspRole.setStatus('current') if mibBuilder.loadTexts: hh3cTeTunnelStaticCrlspRole.setDescription('This value indicate the role of this static-crlsp. This value must be transit at transit point of the tunnel, and tail at terminating point of the tunnel.') hh3c_te_tunnel_static_crlsp_xc_pointer = mib_table_column((1, 3, 6, 1, 4, 1, 25506, 2, 115, 2, 1, 1, 5), row_pointer()).setMaxAccess('readonly') if mibBuilder.loadTexts: hh3cTeTunnelStaticCrlspXCPointer.setStatus('current') if mibBuilder.loadTexts: hh3cTeTunnelStaticCrlspXCPointer.setDescription('This pointer unique identify a row of mplsXCTable. This value should be zeroDotZero when the static-crlsp is down. The mplsXCTable identifies the segments that compose this tunnel, their characteristics, and relationships to each other.') hh3c_te_tunnel_co_table = mib_table((1, 3, 6, 1, 4, 1, 25506, 2, 115, 2, 2)) if mibBuilder.loadTexts: hh3cTeTunnelCoTable.setStatus('current') if mibBuilder.loadTexts: hh3cTeTunnelCoTable.setDescription('This table contains information for Co-routed reverse crlsp and infomation of Co-routed bidirectional Tunnel Interface. If hh3cCorouteTunnelLspInstance is zero, to obtain infomation of Co-routed bidirectional Tunnel Interface, otherwise to obtain Co-routed reverse crlsp infomation.') hh3c_te_tunnel_co_entry = mib_table_row((1, 3, 6, 1, 4, 1, 25506, 2, 115, 2, 2, 1)).setIndexNames((0, 'HH3C-TE-TUNNEL-MIB', 'hh3cTeTunnelCoIndex'), (0, 'HH3C-TE-TUNNEL-MIB', 'hh3cTeTunnelCoLspInstance'), (0, 'HH3C-TE-TUNNEL-MIB', 'hh3cTeTunnelCoIngressLSRId'), (0, 'HH3C-TE-TUNNEL-MIB', 'hh3cTeTunnelCoEgressLSRId')) if mibBuilder.loadTexts: hh3cTeTunnelCoEntry.setStatus('current') if mibBuilder.loadTexts: hh3cTeTunnelCoEntry.setDescription('The entry in this table describes Co-routed infomation of bidirectional Tunnel Interface and reserver lsp information.') hh3c_te_tunnel_co_index = mib_table_column((1, 3, 6, 1, 4, 1, 25506, 2, 115, 2, 2, 1, 1), mpls_tunnel_index()) if mibBuilder.loadTexts: hh3cTeTunnelCoIndex.setStatus('current') if mibBuilder.loadTexts: hh3cTeTunnelCoIndex.setDescription('Uniquely identifies a set of tunnel instances between a pair of ingress and egress LSRs that specified at originating point. This value should be equal to the value signaled in the Tunnel Id of the Session object.') hh3c_te_tunnel_co_lsp_instance = mib_table_column((1, 3, 6, 1, 4, 1, 25506, 2, 115, 2, 2, 1, 2), mpls_tunnel_instance_index()) if mibBuilder.loadTexts: hh3cTeTunnelCoLspInstance.setStatus('current') if mibBuilder.loadTexts: hh3cTeTunnelCoLspInstance.setDescription('When obtain infomation of Co-routed bidirectional Tunnel Interface, this vlaue should be zero. And this value must be LspID to obtain reverse crlsp information. Values greater than 0, but less than or equal to 65535, should be useless.') hh3c_te_tunnel_co_ingress_lsr_id = mib_table_column((1, 3, 6, 1, 4, 1, 25506, 2, 115, 2, 2, 1, 3), mpls_extended_tunnel_id()) if mibBuilder.loadTexts: hh3cTeTunnelCoIngressLSRId.setStatus('current') if mibBuilder.loadTexts: hh3cTeTunnelCoIngressLSRId.setDescription('Identity the ingress LSR associated with this tunnel instance. This vlaue is equal to the LsrID of originating endpoint.') hh3c_te_tunnel_co_egress_lsr_id = mib_table_column((1, 3, 6, 1, 4, 1, 25506, 2, 115, 2, 2, 1, 4), mpls_extended_tunnel_id()) if mibBuilder.loadTexts: hh3cTeTunnelCoEgressLSRId.setStatus('current') if mibBuilder.loadTexts: hh3cTeTunnelCoEgressLSRId.setDescription('Identity of the egress LSR associated with this tunnel instance. This vlaue is equal to the LsrID of terminating point.') hh3c_te_tunnel_co_bi_mode = mib_table_column((1, 3, 6, 1, 4, 1, 25506, 2, 115, 2, 2, 1, 5), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('coroutedActive', 1), ('coroutedPassive', 2)))).setMaxAccess('readonly') if mibBuilder.loadTexts: hh3cTeTunnelCoBiMode.setStatus('current') if mibBuilder.loadTexts: hh3cTeTunnelCoBiMode.setDescription('This vlaue indicated the bidirection mode of tunnel interface. The valuemust be coroutedActive at the originating point of the tunnel and coroutedPassive at the terminating point.') hh3c_te_tunnel_co_reverse_lsp_instance = mib_table_column((1, 3, 6, 1, 4, 1, 25506, 2, 115, 2, 2, 1, 6), mpls_tunnel_instance_index()).setMaxAccess('readonly') if mibBuilder.loadTexts: hh3cTeTunnelCoReverseLspInstance.setStatus('current') if mibBuilder.loadTexts: hh3cTeTunnelCoReverseLspInstance.setDescription('This value indicated the reverse lsp instance, and should be equal to obverse lsp instance.') hh3c_te_tunnel_co_reverse_lsp_xc_pointer = mib_table_column((1, 3, 6, 1, 4, 1, 25506, 2, 115, 2, 2, 1, 7), row_pointer()).setMaxAccess('readonly') if mibBuilder.loadTexts: hh3cTeTunnelCoReverseLspXCPointer.setStatus('current') if mibBuilder.loadTexts: hh3cTeTunnelCoReverseLspXCPointer.setDescription('This pointer unique index to mplsXCTable of the reverse lsp. The mplsXCTable identifies the segments that compose this tunnel, their characteristics, and relationships to each other. A value of zeroDotZero indicate that there is no crlsp assigned to this.') hh3c_te_tunnel_ps_table = mib_table((1, 3, 6, 1, 4, 1, 25506, 2, 115, 2, 3)) if mibBuilder.loadTexts: hh3cTeTunnelPsTable.setStatus('current') if mibBuilder.loadTexts: hh3cTeTunnelPsTable.setDescription('This table defines some objects for managers to obtain TE tunnel Protection Switching group current status information.') hh3c_te_tunnel_ps_entry = mib_table_row((1, 3, 6, 1, 4, 1, 25506, 2, 115, 2, 3, 1)).setIndexNames((0, 'HH3C-TE-TUNNEL-MIB', 'hh3cTeTunnelPsIndex'), (0, 'HH3C-TE-TUNNEL-MIB', 'hh3cTeTunnelPsIngressLSRId'), (0, 'HH3C-TE-TUNNEL-MIB', 'hh3cTeTunnelPsEgressLSRId')) if mibBuilder.loadTexts: hh3cTeTunnelPsEntry.setStatus('current') if mibBuilder.loadTexts: hh3cTeTunnelPsEntry.setDescription('The entry in this table describes TE tunnel Protection Switching group infromation.') hh3c_te_tunnel_ps_index = mib_table_column((1, 3, 6, 1, 4, 1, 25506, 2, 115, 2, 3, 1, 1), mpls_tunnel_index()) if mibBuilder.loadTexts: hh3cTeTunnelPsIndex.setStatus('current') if mibBuilder.loadTexts: hh3cTeTunnelPsIndex.setDescription('Uniquely identifies a TE tunnel Protection Switching group instance. This value must be equal to the tunnel id of work tunnel instance.') hh3c_te_tunnel_ps_ingress_lsr_id = mib_table_column((1, 3, 6, 1, 4, 1, 25506, 2, 115, 2, 3, 1, 2), mpls_extended_tunnel_id()) if mibBuilder.loadTexts: hh3cTeTunnelPsIngressLSRId.setStatus('current') if mibBuilder.loadTexts: hh3cTeTunnelPsIngressLSRId.setDescription('Identity the ingress LSR associated with work tunnel instance.') hh3c_te_tunnel_ps_egress_lsr_id = mib_table_column((1, 3, 6, 1, 4, 1, 25506, 2, 115, 2, 3, 1, 3), mpls_extended_tunnel_id()) if mibBuilder.loadTexts: hh3cTeTunnelPsEgressLSRId.setStatus('current') if mibBuilder.loadTexts: hh3cTeTunnelPsEgressLSRId.setDescription('Identity of the egress LSR associated with work tunnel instance.') hh3c_te_tunnel_ps_protect_index = mib_table_column((1, 3, 6, 1, 4, 1, 25506, 2, 115, 2, 3, 1, 4), mpls_tunnel_index()).setMaxAccess('readonly') if mibBuilder.loadTexts: hh3cTeTunnelPsProtectIndex.setStatus('current') if mibBuilder.loadTexts: hh3cTeTunnelPsProtectIndex.setDescription('Uniquely identifies a TE tunnel Protection Switching group instance. This value must be equal to the tunnel id of TE tunnel Protection Switching group instance.') hh3c_te_tunnel_ps_protect_ingress_lsr_id = mib_table_column((1, 3, 6, 1, 4, 1, 25506, 2, 115, 2, 3, 1, 5), mpls_extended_tunnel_id()).setMaxAccess('readonly') if mibBuilder.loadTexts: hh3cTeTunnelPsProtectIngressLSRId.setStatus('current') if mibBuilder.loadTexts: hh3cTeTunnelPsProtectIngressLSRId.setDescription('Identity the ingress LSR associated with TE tunnel Protection Switching group instance.') hh3c_te_tunnel_ps_protect_egress_lsr_id = mib_table_column((1, 3, 6, 1, 4, 1, 25506, 2, 115, 2, 3, 1, 6), mpls_extended_tunnel_id()).setMaxAccess('readonly') if mibBuilder.loadTexts: hh3cTeTunnelPsProtectEgressLSRId.setStatus('current') if mibBuilder.loadTexts: hh3cTeTunnelPsProtectEgressLSRId.setDescription('Identity of the egress LSR associated with TE tunnel Protection Switching group instance.') hh3c_te_tunnel_ps_protect_type = mib_table_column((1, 3, 6, 1, 4, 1, 25506, 2, 115, 2, 3, 1, 7), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('oneToOne', 1), ('onePlusOne', 2))).clone('oneToOne')).setMaxAccess('readonly') if mibBuilder.loadTexts: hh3cTeTunnelPsProtectType.setStatus('current') if mibBuilder.loadTexts: hh3cTeTunnelPsProtectType.setDescription('This value indicated TE tunnel Protection Switching group type. The default value is oneToOne.') hh3c_te_tunnel_ps_revertive_mode = mib_table_column((1, 3, 6, 1, 4, 1, 25506, 2, 115, 2, 3, 1, 8), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('revertive', 1), ('noRevertive', 2))).clone('revertive')).setMaxAccess('readonly') if mibBuilder.loadTexts: hh3cTeTunnelPsRevertiveMode.setStatus('current') if mibBuilder.loadTexts: hh3cTeTunnelPsRevertiveMode.setDescription('This value indicated protect switch mode. The value must be revertive or nonRevertive, default value is revertive. ') hh3c_te_tunnel_ps_wtr_time = mib_table_column((1, 3, 6, 1, 4, 1, 25506, 2, 115, 2, 3, 1, 9), unsigned32().subtype(subtypeSpec=value_range_constraint(0, 60)).clone(24)).setUnits('30 seconds').setMaxAccess('readonly') if mibBuilder.loadTexts: hh3cTeTunnelPsWtrTime.setStatus('current') if mibBuilder.loadTexts: hh3cTeTunnelPsWtrTime.setDescription('The cycle time that switch to protect tunnel.') hh3c_te_tunnel_ps_hold_off_time = mib_table_column((1, 3, 6, 1, 4, 1, 25506, 2, 115, 2, 3, 1, 10), unsigned32().subtype(subtypeSpec=value_range_constraint(0, 20))).setUnits('500ms').setMaxAccess('readonly') if mibBuilder.loadTexts: hh3cTeTunnelPsHoldOffTime.setStatus('current') if mibBuilder.loadTexts: hh3cTeTunnelPsHoldOffTime.setDescription('This value is switchback delay time. When detected the work path fault, switch to protect path after this time.') hh3c_te_tunnel_ps_switch_mode = mib_table_column((1, 3, 6, 1, 4, 1, 25506, 2, 115, 2, 3, 1, 11), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('uniDirectional', 1), ('biDirectional', 2))).clone('uniDirectional')).setMaxAccess('readonly') if mibBuilder.loadTexts: hh3cTeTunnelPsSwitchMode.setStatus('current') if mibBuilder.loadTexts: hh3cTeTunnelPsSwitchMode.setDescription('This value indicated TE tunnel Protection Switching group switch mode.') hh3c_te_tunnel_ps_work_path_status = mib_table_column((1, 3, 6, 1, 4, 1, 25506, 2, 115, 2, 3, 1, 12), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3))).clone(namedValues=named_values(('none', 1), ('noDefect', 2), ('inDefect', 3)))).setMaxAccess('readonly') if mibBuilder.loadTexts: hh3cTeTunnelPsWorkPathStatus.setStatus('current') if mibBuilder.loadTexts: hh3cTeTunnelPsWorkPathStatus.setDescription('This value indicates work path status. none, noDefect, inDefect will be used.') hh3c_te_tunnel_ps_protect_path_status = mib_table_column((1, 3, 6, 1, 4, 1, 25506, 2, 115, 2, 3, 1, 13), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3))).clone(namedValues=named_values(('none', 1), ('noDefect', 2), ('inDefect', 3)))).setMaxAccess('readonly') if mibBuilder.loadTexts: hh3cTeTunnelPsProtectPathStatus.setStatus('current') if mibBuilder.loadTexts: hh3cTeTunnelPsProtectPathStatus.setDescription('This value indicates protect path status. none, noDefect, inDefect(3) will be used.') hh3c_te_tunnel_ps_switch_result = mib_table_column((1, 3, 6, 1, 4, 1, 25506, 2, 115, 2, 3, 1, 14), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('workPath', 1), ('protectPath', 2)))).setMaxAccess('readonly') if mibBuilder.loadTexts: hh3cTeTunnelPsSwitchResult.setStatus('current') if mibBuilder.loadTexts: hh3cTeTunnelPsSwitchResult.setDescription('This value indicated current using path is work path or protect path.') hh3c_te_tunnel_notifications = mib_identifier((1, 3, 6, 1, 4, 1, 25506, 2, 115, 3)) hh3c_te_tunnel_notifications_prefix = mib_identifier((1, 3, 6, 1, 4, 1, 25506, 2, 115, 3, 0)) hh3c_te_tunnel_ps_switch_wto_p = notification_type((1, 3, 6, 1, 4, 1, 25506, 2, 115, 3, 0, 1)).setObjects(('HH3C-TE-TUNNEL-MIB', 'hh3cTeTunnelPsWorkPathStatus'), ('HH3C-TE-TUNNEL-MIB', 'hh3cTeTunnelPsProtectPathStatus')) if mibBuilder.loadTexts: hh3cTeTunnelPsSwitchWtoP.setStatus('current') if mibBuilder.loadTexts: hh3cTeTunnelPsSwitchWtoP.setDescription('This notification is generated when protect workgroup switch from work tunnel to protect tunnel.') hh3c_te_tunnel_ps_switch_pto_w = notification_type((1, 3, 6, 1, 4, 1, 25506, 2, 115, 3, 0, 2)).setObjects(('HH3C-TE-TUNNEL-MIB', 'hh3cTeTunnelPsWorkPathStatus'), ('HH3C-TE-TUNNEL-MIB', 'hh3cTeTunnelPsProtectPathStatus')) if mibBuilder.loadTexts: hh3cTeTunnelPsSwitchPtoW.setStatus('current') if mibBuilder.loadTexts: hh3cTeTunnelPsSwitchPtoW.setDescription('This notification is generated when protect workgroup switch from protect tunnel to work tunnel.') hh3c_te_tunnel_conformance = mib_identifier((1, 3, 6, 1, 4, 1, 25506, 2, 115, 4)) hh3c_te_tunnel_compliances = mib_identifier((1, 3, 6, 1, 4, 1, 25506, 2, 115, 4, 1)) hh3c_te_tunnel_compliance = module_compliance((1, 3, 6, 1, 4, 1, 25506, 2, 115, 4, 1, 1)).setObjects(('HH3C-TE-TUNNEL-MIB', 'hh3cTeTunnelNotificationsGroup'), ('HH3C-TE-TUNNEL-MIB', 'hh3cTeTunnelScalarsGroup'), ('HH3C-TE-TUNNEL-MIB', 'hh3cTeTunnelStaticCrlspGroup'), ('HH3C-TE-TUNNEL-MIB', 'hh3cTeTunnelCorouteGroup'), ('HH3C-TE-TUNNEL-MIB', 'hh3cTeTunnelPsGroup')) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): hh3c_te_tunnel_compliance = hh3cTeTunnelCompliance.setStatus('current') if mibBuilder.loadTexts: hh3cTeTunnelCompliance.setDescription('The compliance statement for SNMP.') hh3c_te_tunnel_groups = mib_identifier((1, 3, 6, 1, 4, 1, 25506, 2, 115, 4, 2)) hh3c_te_tunnel_notifications_group = notification_group((1, 3, 6, 1, 4, 1, 25506, 2, 115, 4, 2, 1)).setObjects(('HH3C-TE-TUNNEL-MIB', 'hh3cTeTunnelPsSwitchPtoW'), ('HH3C-TE-TUNNEL-MIB', 'hh3cTeTunnelPsSwitchWtoP')) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): hh3c_te_tunnel_notifications_group = hh3cTeTunnelNotificationsGroup.setStatus('current') if mibBuilder.loadTexts: hh3cTeTunnelNotificationsGroup.setDescription('This group contains MPLS Te Tunnel traps.') hh3c_te_tunnel_scalars_group = object_group((1, 3, 6, 1, 4, 1, 25506, 2, 115, 4, 2, 2)).setObjects(('HH3C-TE-TUNNEL-MIB', 'hh3cTeTunnelMaxTunnelIndex')) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): hh3c_te_tunnel_scalars_group = hh3cTeTunnelScalarsGroup.setStatus('current') if mibBuilder.loadTexts: hh3cTeTunnelScalarsGroup.setDescription('Scalar object needed to implement MPLS te tunnels.') hh3c_te_tunnel_static_crlsp_group = object_group((1, 3, 6, 1, 4, 1, 25506, 2, 115, 4, 2, 3)).setObjects(('HH3C-TE-TUNNEL-MIB', 'hh3cTeTunnelStaticCrlspName'), ('HH3C-TE-TUNNEL-MIB', 'hh3cTeTunnelStaticCrlspStatus'), ('HH3C-TE-TUNNEL-MIB', 'hh3cTeTunnelStaticCrlspRole'), ('HH3C-TE-TUNNEL-MIB', 'hh3cTeTunnelStaticCrlspXCPointer')) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): hh3c_te_tunnel_static_crlsp_group = hh3cTeTunnelStaticCrlspGroup.setStatus('current') if mibBuilder.loadTexts: hh3cTeTunnelStaticCrlspGroup.setDescription('Objects for quering static-crlsp information.') hh3c_te_tunnel_coroute_group = object_group((1, 3, 6, 1, 4, 1, 25506, 2, 115, 4, 2, 4)).setObjects(('HH3C-TE-TUNNEL-MIB', 'hh3cTeTunnelCoBiMode'), ('HH3C-TE-TUNNEL-MIB', 'hh3cTeTunnelCoReverseLspInstance'), ('HH3C-TE-TUNNEL-MIB', 'hh3cTeTunnelCoReverseLspXCPointer')) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): hh3c_te_tunnel_coroute_group = hh3cTeTunnelCorouteGroup.setStatus('current') if mibBuilder.loadTexts: hh3cTeTunnelCorouteGroup.setDescription('Objects for quering Co-routed reverse crlsp information.') hh3c_te_tunnel_ps_group = object_group((1, 3, 6, 1, 4, 1, 25506, 2, 115, 4, 2, 5)).setObjects(('HH3C-TE-TUNNEL-MIB', 'hh3cTeTunnelPsProtectIndex'), ('HH3C-TE-TUNNEL-MIB', 'hh3cTeTunnelPsProtectIngressLSRId'), ('HH3C-TE-TUNNEL-MIB', 'hh3cTeTunnelPsProtectEgressLSRId'), ('HH3C-TE-TUNNEL-MIB', 'hh3cTeTunnelPsProtectType'), ('HH3C-TE-TUNNEL-MIB', 'hh3cTeTunnelPsRevertiveMode'), ('HH3C-TE-TUNNEL-MIB', 'hh3cTeTunnelPsWtrTime'), ('HH3C-TE-TUNNEL-MIB', 'hh3cTeTunnelPsHoldOffTime'), ('HH3C-TE-TUNNEL-MIB', 'hh3cTeTunnelPsSwitchMode'), ('HH3C-TE-TUNNEL-MIB', 'hh3cTeTunnelPsWorkPathStatus'), ('HH3C-TE-TUNNEL-MIB', 'hh3cTeTunnelPsProtectPathStatus'), ('HH3C-TE-TUNNEL-MIB', 'hh3cTeTunnelPsSwitchResult')) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): hh3c_te_tunnel_ps_group = hh3cTeTunnelPsGroup.setStatus('current') if mibBuilder.loadTexts: hh3cTeTunnelPsGroup.setDescription('Objects for quering protect workgroup information.') mibBuilder.exportSymbols('HH3C-TE-TUNNEL-MIB', hh3cTeTunnelPsProtectIndex=hh3cTeTunnelPsProtectIndex, hh3cTeTunnelPsGroup=hh3cTeTunnelPsGroup, hh3cTeTunnelPsSwitchResult=hh3cTeTunnelPsSwitchResult, hh3cTeTunnelPsSwitchWtoP=hh3cTeTunnelPsSwitchWtoP, hh3cTeTunnelPsProtectType=hh3cTeTunnelPsProtectType, PYSNMP_MODULE_ID=hh3cTeTunnel, hh3cTeTunnelStaticCrlspGroup=hh3cTeTunnelStaticCrlspGroup, hh3cTeTunnelPsProtectEgressLSRId=hh3cTeTunnelPsProtectEgressLSRId, hh3cTeTunnelCoIndex=hh3cTeTunnelCoIndex, hh3cTeTunnelCoTable=hh3cTeTunnelCoTable, hh3cTeTunnelPsProtectIngressLSRId=hh3cTeTunnelPsProtectIngressLSRId, hh3cTeTunnelPsSwitchPtoW=hh3cTeTunnelPsSwitchPtoW, hh3cTeTunnelPsIndex=hh3cTeTunnelPsIndex, hh3cTeTunnelPsProtectPathStatus=hh3cTeTunnelPsProtectPathStatus, hh3cTeTunnelMaxTunnelIndex=hh3cTeTunnelMaxTunnelIndex, hh3cTeTunnel=hh3cTeTunnel, hh3cTeTunnelStaticCrlspInLabel=hh3cTeTunnelStaticCrlspInLabel, hh3cTeTunnelNotifications=hh3cTeTunnelNotifications, hh3cTeTunnelCoIngressLSRId=hh3cTeTunnelCoIngressLSRId, hh3cTeTunnelObjects=hh3cTeTunnelObjects, hh3cTeTunnelNotificationsGroup=hh3cTeTunnelNotificationsGroup, hh3cTeTunnelScalars=hh3cTeTunnelScalars, hh3cTeTunnelCompliance=hh3cTeTunnelCompliance, hh3cTeTunnelPsSwitchMode=hh3cTeTunnelPsSwitchMode, hh3cTeTunnelConformance=hh3cTeTunnelConformance, hh3cTeTunnelStaticCrlspRole=hh3cTeTunnelStaticCrlspRole, hh3cTeTunnelCoBiMode=hh3cTeTunnelCoBiMode, hh3cTeTunnelPsIngressLSRId=hh3cTeTunnelPsIngressLSRId, hh3cTeTunnelGroups=hh3cTeTunnelGroups, hh3cTeTunnelPsRevertiveMode=hh3cTeTunnelPsRevertiveMode, hh3cTeTunnelNotificationsPrefix=hh3cTeTunnelNotificationsPrefix, hh3cTeTunnelCoEgressLSRId=hh3cTeTunnelCoEgressLSRId, hh3cTeTunnelPsEgressLSRId=hh3cTeTunnelPsEgressLSRId, hh3cTeTunnelScalarsGroup=hh3cTeTunnelScalarsGroup, hh3cTeTunnelCorouteGroup=hh3cTeTunnelCorouteGroup, hh3cTeTunnelPsTable=hh3cTeTunnelPsTable, hh3cTeTunnelStaticCrlspTable=hh3cTeTunnelStaticCrlspTable, hh3cTeTunnelCoLspInstance=hh3cTeTunnelCoLspInstance, hh3cTeTunnelStaticCrlspEntry=hh3cTeTunnelStaticCrlspEntry, hh3cTeTunnelCompliances=hh3cTeTunnelCompliances, hh3cTeTunnelPsEntry=hh3cTeTunnelPsEntry, hh3cTeTunnelStaticCrlspStatus=hh3cTeTunnelStaticCrlspStatus, hh3cTeTunnelPsWtrTime=hh3cTeTunnelPsWtrTime, hh3cTeTunnelCoEntry=hh3cTeTunnelCoEntry, hh3cTeTunnelPsWorkPathStatus=hh3cTeTunnelPsWorkPathStatus, hh3cTeTunnelCoReverseLspInstance=hh3cTeTunnelCoReverseLspInstance, hh3cTeTunnelStaticCrlspXCPointer=hh3cTeTunnelStaticCrlspXCPointer, hh3cTeTunnelStaticCrlspName=hh3cTeTunnelStaticCrlspName, hh3cTeTunnelPsHoldOffTime=hh3cTeTunnelPsHoldOffTime, hh3cTeTunnelCoReverseLspXCPointer=hh3cTeTunnelCoReverseLspXCPointer)
def maximo(x,y,z): if x>=y: if x>z: return x else: return z if y>=x: if y>z: return y else: return z
def maximo(x, y, z): if x >= y: if x > z: return x else: return z if y >= x: if y > z: return y else: return z
text_file = open("test.txt", "r") data = text_file.read() print(data) text_file.close()
text_file = open('test.txt', 'r') data = text_file.read() print(data) text_file.close()
class PipHisto(): apps_list = [] def __init__(self, apps_list): self.setApps(apps_list) def print_pip_histo(self, apps_list=[], version=None, egg=None): app_histo = self.pip_histo(apps_list, version, egg) header_string = '' if version: header_string = ' | version' print(' # | {0:<25} '.format('App-Name') + header_string) vers = '' for n in app_histo: if version: vers = ' | ' if '==' in n[0]: vers += n[0].split('==')[1] print('{0:>4d} | {1:<25} {2}').format(n[1], n[0].split('==')[0], vers) vers = '' def pip_histo(self, apps_list=[], version=None, egg=None): if apps_list: self.setApps(apps_list) apps = {} app_histo = [] for n in self.apps_list: if '#egg=' in n: if egg: n = n.split('#egg=')[1] else: continue if not version: n = n.split('==')[0] if n in apps.keys(): apps[n] = apps[n] + 1 else: apps[n] = 1 # Convert dic to list app_histo = [[k, v] for k, v in apps.items()] # Sort list by name app_histo = sorted(app_histo, key=lambda x: x[0], reverse=False) # Sort list by number of installations app_histo = sorted(app_histo, key=lambda x: x[1], reverse=True) # for k, v in sorted(apps.items(), key=lambda kv: kv[1], reverse=True): # app_histo.append([k, v]) # app_histo = l return app_histo def setApps(self, apps_list): self.apps_list = apps_list
class Piphisto: apps_list = [] def __init__(self, apps_list): self.setApps(apps_list) def print_pip_histo(self, apps_list=[], version=None, egg=None): app_histo = self.pip_histo(apps_list, version, egg) header_string = '' if version: header_string = ' | version' print(' # | {0:<25} '.format('App-Name') + header_string) vers = '' for n in app_histo: if version: vers = ' | ' if '==' in n[0]: vers += n[0].split('==')[1] print('{0:>4d} | {1:<25} {2}').format(n[1], n[0].split('==')[0], vers) vers = '' def pip_histo(self, apps_list=[], version=None, egg=None): if apps_list: self.setApps(apps_list) apps = {} app_histo = [] for n in self.apps_list: if '#egg=' in n: if egg: n = n.split('#egg=')[1] else: continue if not version: n = n.split('==')[0] if n in apps.keys(): apps[n] = apps[n] + 1 else: apps[n] = 1 app_histo = [[k, v] for (k, v) in apps.items()] app_histo = sorted(app_histo, key=lambda x: x[0], reverse=False) app_histo = sorted(app_histo, key=lambda x: x[1], reverse=True) return app_histo def set_apps(self, apps_list): self.apps_list = apps_list
class Solution: def singleNonDuplicate(self, nums: List[int]) -> int: if len(nums) == 1: return nums[0] left, right = 0, len(nums)-1 while left <= right: mid = left + (right - left)//2 if mid != 0 and mid < len(nums)-1: if nums[mid] != nums[mid-1] and nums[mid] != nums[mid+1]: return nums[mid] elif mid == len(nums)-1: if nums[mid] != nums[mid-1]: return nums[mid] elif mid == 0: if nums[mid] != nums[mid+1]: return nums[mid] if mid % 2 == 0: # both sides are equal if nums[mid-1] != nums[mid]: left = mid+1 else: right = mid-1 else: if nums[mid-1] == nums[mid]: left = mid+1 else: right = mid-1
class Solution: def single_non_duplicate(self, nums: List[int]) -> int: if len(nums) == 1: return nums[0] (left, right) = (0, len(nums) - 1) while left <= right: mid = left + (right - left) // 2 if mid != 0 and mid < len(nums) - 1: if nums[mid] != nums[mid - 1] and nums[mid] != nums[mid + 1]: return nums[mid] elif mid == len(nums) - 1: if nums[mid] != nums[mid - 1]: return nums[mid] elif mid == 0: if nums[mid] != nums[mid + 1]: return nums[mid] if mid % 2 == 0: if nums[mid - 1] != nums[mid]: left = mid + 1 else: right = mid - 1 elif nums[mid - 1] == nums[mid]: left = mid + 1 else: right = mid - 1
def mx_cc_copts(): return ["-fdiagnostics-color=always", "-Werror"] def mx_cuda_copts(): return ["-xcuda", "-std=c++11"] def mx_cc_library( name, srcs = [], deps = [], copts = [], **kwargs): native.cc_library( name = name, copts = mx_cc_copts() + copts, srcs = srcs, deps = deps, **kwargs ) def mx_cc_binary( name, srcs = [], deps = [], copts = [], **kwargs): native.cc_binary( name = name, copts = mx_cc_copts() + copts, srcs = srcs, deps = deps, **kwargs ) def mx_cc_test( name, srcs = [], deps = [], copts = [], **kwargs): native.cc_test( name = name, copts = mx_cc_copts() + copts, srcs = srcs, deps = deps, **kwargs ) def mx_cuda_library( name, srcs = [], deps = [], copts = [], **kwargs): native.cc_library( name = name, copts = mx_cuda_copts() + copts, srcs = srcs, deps = deps, **kwargs ) def mx_cuda_binary( name, srcs = [], deps = [], copts = [], **kwargs): native.cc_binary( name = name, copts = mx_cuda_copts() + copts, srcs = srcs, deps = deps, **kwargs )
def mx_cc_copts(): return ['-fdiagnostics-color=always', '-Werror'] def mx_cuda_copts(): return ['-xcuda', '-std=c++11'] def mx_cc_library(name, srcs=[], deps=[], copts=[], **kwargs): native.cc_library(name=name, copts=mx_cc_copts() + copts, srcs=srcs, deps=deps, **kwargs) def mx_cc_binary(name, srcs=[], deps=[], copts=[], **kwargs): native.cc_binary(name=name, copts=mx_cc_copts() + copts, srcs=srcs, deps=deps, **kwargs) def mx_cc_test(name, srcs=[], deps=[], copts=[], **kwargs): native.cc_test(name=name, copts=mx_cc_copts() + copts, srcs=srcs, deps=deps, **kwargs) def mx_cuda_library(name, srcs=[], deps=[], copts=[], **kwargs): native.cc_library(name=name, copts=mx_cuda_copts() + copts, srcs=srcs, deps=deps, **kwargs) def mx_cuda_binary(name, srcs=[], deps=[], copts=[], **kwargs): native.cc_binary(name=name, copts=mx_cuda_copts() + copts, srcs=srcs, deps=deps, **kwargs)
class UndergroundSystem: def __init__(self): # {id: (stationName, time)} self.checkIns = {} # {route: (numTrips, totalTime)} self.checkOuts = defaultdict(lambda: [0, 0]) def checkIn(self, id: int, stationName: str, t: int) -> None: self.checkIns[id] = (stationName, t) def checkOut(self, id: int, stationName: str, t: int) -> None: startStation, startTime = self.checkIns.pop(id) route = (startStation, stationName) self.checkOuts[route][0] += 1 self.checkOuts[route][1] += t - startTime def getAverageTime(self, startStation: str, endStation: str) -> float: numTrips, totalTime = self.checkOuts[(startStation, endStation)] return totalTime / numTrips
class Undergroundsystem: def __init__(self): self.checkIns = {} self.checkOuts = defaultdict(lambda : [0, 0]) def check_in(self, id: int, stationName: str, t: int) -> None: self.checkIns[id] = (stationName, t) def check_out(self, id: int, stationName: str, t: int) -> None: (start_station, start_time) = self.checkIns.pop(id) route = (startStation, stationName) self.checkOuts[route][0] += 1 self.checkOuts[route][1] += t - startTime def get_average_time(self, startStation: str, endStation: str) -> float: (num_trips, total_time) = self.checkOuts[startStation, endStation] return totalTime / numTrips
# Coding Question: Given JSON object that have marks of students, create a json object that returns the average marks in each subject class StudentRecords: 'Student records management' def getAverageMarks(self, total_students_dict): Total = {} student_marks_list = [] total_students = len(total_students_dict) #Defined lists dynamically - for total marks and average marks for k, v in total_students_dict.items(): marks_List = list(v.values()) student_marks_list.append(marks_List) # Dynamic lists using list comprehension for required design total_marks_list = [0 for n in list(v)] average_marks_list = [0 for n in list(v)] for j in student_marks_list: for i in range(0, len(student_marks_list[0])): total_marks_list[i] = total_marks_list[i] + j[i] average_marks_counter = 0 for i in total_marks_list: # round() method is used to store average marks - Added limit of 2 digits after decimal point average_marks_list[average_marks_counter] = round(i/total_students, 2) average_marks_counter += 1 update_records_counter = 0 for k,v in total_students_dict.items(): for i,j in v.items(): Total[i] = average_marks_list[update_records_counter] update_records_counter += 1 break return Total # Input total_students_dict = { 'Student1' : {'english': 90,'maths': 50,'science': 80}, 'Student2' : {'english': 70,'maths': 70,'science': 70} } # Function call - get average marks in each subject student_records = StudentRecords() Total = student_records.getAverageMarks(total_students_dict) # Output print("Input - Total students :", total_students_dict) print("Output - Average marks in each subject :", Total)
class Studentrecords: """Student records management""" def get_average_marks(self, total_students_dict): total = {} student_marks_list = [] total_students = len(total_students_dict) for (k, v) in total_students_dict.items(): marks__list = list(v.values()) student_marks_list.append(marks_List) total_marks_list = [0 for n in list(v)] average_marks_list = [0 for n in list(v)] for j in student_marks_list: for i in range(0, len(student_marks_list[0])): total_marks_list[i] = total_marks_list[i] + j[i] average_marks_counter = 0 for i in total_marks_list: average_marks_list[average_marks_counter] = round(i / total_students, 2) average_marks_counter += 1 update_records_counter = 0 for (k, v) in total_students_dict.items(): for (i, j) in v.items(): Total[i] = average_marks_list[update_records_counter] update_records_counter += 1 break return Total total_students_dict = {'Student1': {'english': 90, 'maths': 50, 'science': 80}, 'Student2': {'english': 70, 'maths': 70, 'science': 70}} student_records = student_records() total = student_records.getAverageMarks(total_students_dict) print('Input - Total students :', total_students_dict) print('Output - Average marks in each subject :', Total)
testing=False interval=900 static=False staticColor =(0, 0, 255) nightmode=False beginSleep=21 stopSleep=4 # LED Strip Config # If you use the Waveshare LED HAT, recommended on GitHub, you should not need to change these LED_COUNT = 32 LED_PIN = 18 LED_FREQ_HZ = 800000 LED_DMA = 5 LED_BRIGHTNESS = 100 LED_INVERT = False
testing = False interval = 900 static = False static_color = (0, 0, 255) nightmode = False begin_sleep = 21 stop_sleep = 4 led_count = 32 led_pin = 18 led_freq_hz = 800000 led_dma = 5 led_brightness = 100 led_invert = False
#!/usr/bin/env python3 if __name__ == "__main__": a = [-1, 1, 66.25, 333, 333, 1234.5] print(a) del a[0] print(a) del a[2:4] print(a) del a[:] print(a) del a # Below causes an error since 'a' is no more available # print(a)
if __name__ == '__main__': a = [-1, 1, 66.25, 333, 333, 1234.5] print(a) del a[0] print(a) del a[2:4] print(a) del a[:] print(a) del a
fp = open("./packet.csv", "r") vals = fp.readlines() count = 1 pre_val = 0 current = 0 val_bins = [] for i in range(len(vals)): pre_val = current current = int(vals[i]) if current == pre_val: count = count + 1 else: count = 1 if count == 31: print(pre_val) val_bins.append(pre_val) count = 1 c = 0 for i in range(len(val_bins)): val = int(val_bins[i]) c = (c << 1) | val if i % 8 == 7: print(chr(c), end="") c = 0 print("")
fp = open('./packet.csv', 'r') vals = fp.readlines() count = 1 pre_val = 0 current = 0 val_bins = [] for i in range(len(vals)): pre_val = current current = int(vals[i]) if current == pre_val: count = count + 1 else: count = 1 if count == 31: print(pre_val) val_bins.append(pre_val) count = 1 c = 0 for i in range(len(val_bins)): val = int(val_bins[i]) c = c << 1 | val if i % 8 == 7: print(chr(c), end='') c = 0 print('')
MANAGER_PATHS = { 'service': { 'ASSESSMENT': ('dlkit.services.assessment.AssessmentManager', 'dlkit.services.assessment.AssessmentManager'), 'REPOSITORY': ('dlkit.services.repository.RepositoryManager', 'dlkit.services.repository.RepositoryManager'), 'LEARNING': ('dlkit.services.learning.LearningManager', 'dlkit.services.learning.LearningManager'), 'COMMENTING': ('dlkit.services.commenting.CommentingManager', 'dlkit.services.commenting.CommentingManager'), 'RESOURCE': ('dlkit.services.resource.ResourceManager', 'dlkit.services.resource.ResourceManager'), 'GRADING': ('dlkit.services.grading.GradingManager', 'dlkit.services.grading.GradingManager') }, 'json': { 'ASSESSMENT': ('dlkit.json_.assessment.managers.AssessmentManager', 'dlkit.json_.assessment.managers.AssessmentProxyManager'), 'REPOSITORY': ('dlkit.json_.repository.managers.RepositoryManager', 'dlkit.json_.repository.managers.RepositoryProxyManager'), 'LEARNING': ('dlkit.json_.learning.managers.LearningManager', 'dlkit.json_.learning.managers.LearningProxyManager'), 'COMMENTING': ('dlkit.json_.commenting.managers.CommentingManager', 'dlkit.json_.commenting.managers.CommentingProxyManager'), 'RESOURCE': ('dlkit.json_.resource.managers.ResourceManager', 'dlkit.json_.resource.managers.ResourceProxyManager'), 'GRADING': ('dlkit.json_.grading.managers.GradingManager', 'dlkit.json_.grading.managers.GradingProxyManager') }, 'authz_adapter': { 'ASSESSMENT': ('dlkit.authz_adapter.assessment.managers.AssessmentManager', 'dlkit.authz_adapter.assessment.managers.AssessmentProxyManager'), 'REPOSITORY': ('dlkit.authz_adapter.repository.managers.RepositoryManager', 'dlkit.authz_adapter.repository.managers.RepositoryProxyManager'), 'LEARNING': ('dlkit.authz_adapter.learning.managers.LearningManager', 'dlkit.authz_adapter.learning.managers.LearningProxyManager'), 'COMMENTING': ('dlkit.authz_adapter.commenting.managers.CommentingManager', 'dlkit.authz_adapter.commenting.managers.CommentingProxyManager'), 'RESOURCE': ('dlkit.authz_adapter.resource.managers.ResourceManager', 'dlkit.authz_adapter.resource.managers.ResourceProxyManager'), 'GRADING': ('dlkit.authz_adapter.grading.managers.GradingManager', 'dlkit.authz_adapter.grading.managers.GradingProxyManager') }, 'time_based_authz': { 'AUTHORIZATION': ('dlkit.stupid_authz_impls.time_based_authz.AuthorizationManager', 'dlkit.stupid_authz_impls.time_based_authz.AuthorizationProxyManager') }, 'ask_me_authz': { 'AUTHORIZATION': ('dlkit.stupid_authz_impls.ask_me_authz.AuthorizationManager', 'dlkit.stupid_authz_impls.ask_me_authz.AuthorizationProxyManager') }, 'handcar': { 'LEARNING': ('dlkit.handcar.learning.managers.LearningManager', 'dlkit.handcar.learning.managers.LearningProxyManager'), 'TYPE': ('dlkit.handcar.type.managers.TypeManager', 'dlkit.handcar.type.managers.TypeManager'), 'REPOSITORY': ('dlkit.handcar.repository.managers.RepositoryManager', 'dlkit.handcar.repository.managers.RepositoryProxyManager'), }, 'aws_adapter': { 'REPOSITORY': ('dlkit.aws_adapter.repository.managers.RepositoryManager', 'dlkit.aws_adapter.repository.managers.RepositoryProxyManager') }, 'qbank_authz': { 'AUTHORIZATION': ('qbank_authz.authorization.managers.AuthorizationManager', 'qbank_authz.authorization.managers.AuthorizationProxyManager') }, 'resource_agent_authz_adapter': { 'RESOURCE': ('resource_agent_authz_adapter.managers.ResourceManager', 'resource_agent_authz_adapter.managers.ResourceProxyManager') }, }
manager_paths = {'service': {'ASSESSMENT': ('dlkit.services.assessment.AssessmentManager', 'dlkit.services.assessment.AssessmentManager'), 'REPOSITORY': ('dlkit.services.repository.RepositoryManager', 'dlkit.services.repository.RepositoryManager'), 'LEARNING': ('dlkit.services.learning.LearningManager', 'dlkit.services.learning.LearningManager'), 'COMMENTING': ('dlkit.services.commenting.CommentingManager', 'dlkit.services.commenting.CommentingManager'), 'RESOURCE': ('dlkit.services.resource.ResourceManager', 'dlkit.services.resource.ResourceManager'), 'GRADING': ('dlkit.services.grading.GradingManager', 'dlkit.services.grading.GradingManager')}, 'json': {'ASSESSMENT': ('dlkit.json_.assessment.managers.AssessmentManager', 'dlkit.json_.assessment.managers.AssessmentProxyManager'), 'REPOSITORY': ('dlkit.json_.repository.managers.RepositoryManager', 'dlkit.json_.repository.managers.RepositoryProxyManager'), 'LEARNING': ('dlkit.json_.learning.managers.LearningManager', 'dlkit.json_.learning.managers.LearningProxyManager'), 'COMMENTING': ('dlkit.json_.commenting.managers.CommentingManager', 'dlkit.json_.commenting.managers.CommentingProxyManager'), 'RESOURCE': ('dlkit.json_.resource.managers.ResourceManager', 'dlkit.json_.resource.managers.ResourceProxyManager'), 'GRADING': ('dlkit.json_.grading.managers.GradingManager', 'dlkit.json_.grading.managers.GradingProxyManager')}, 'authz_adapter': {'ASSESSMENT': ('dlkit.authz_adapter.assessment.managers.AssessmentManager', 'dlkit.authz_adapter.assessment.managers.AssessmentProxyManager'), 'REPOSITORY': ('dlkit.authz_adapter.repository.managers.RepositoryManager', 'dlkit.authz_adapter.repository.managers.RepositoryProxyManager'), 'LEARNING': ('dlkit.authz_adapter.learning.managers.LearningManager', 'dlkit.authz_adapter.learning.managers.LearningProxyManager'), 'COMMENTING': ('dlkit.authz_adapter.commenting.managers.CommentingManager', 'dlkit.authz_adapter.commenting.managers.CommentingProxyManager'), 'RESOURCE': ('dlkit.authz_adapter.resource.managers.ResourceManager', 'dlkit.authz_adapter.resource.managers.ResourceProxyManager'), 'GRADING': ('dlkit.authz_adapter.grading.managers.GradingManager', 'dlkit.authz_adapter.grading.managers.GradingProxyManager')}, 'time_based_authz': {'AUTHORIZATION': ('dlkit.stupid_authz_impls.time_based_authz.AuthorizationManager', 'dlkit.stupid_authz_impls.time_based_authz.AuthorizationProxyManager')}, 'ask_me_authz': {'AUTHORIZATION': ('dlkit.stupid_authz_impls.ask_me_authz.AuthorizationManager', 'dlkit.stupid_authz_impls.ask_me_authz.AuthorizationProxyManager')}, 'handcar': {'LEARNING': ('dlkit.handcar.learning.managers.LearningManager', 'dlkit.handcar.learning.managers.LearningProxyManager'), 'TYPE': ('dlkit.handcar.type.managers.TypeManager', 'dlkit.handcar.type.managers.TypeManager'), 'REPOSITORY': ('dlkit.handcar.repository.managers.RepositoryManager', 'dlkit.handcar.repository.managers.RepositoryProxyManager')}, 'aws_adapter': {'REPOSITORY': ('dlkit.aws_adapter.repository.managers.RepositoryManager', 'dlkit.aws_adapter.repository.managers.RepositoryProxyManager')}, 'qbank_authz': {'AUTHORIZATION': ('qbank_authz.authorization.managers.AuthorizationManager', 'qbank_authz.authorization.managers.AuthorizationProxyManager')}, 'resource_agent_authz_adapter': {'RESOURCE': ('resource_agent_authz_adapter.managers.ResourceManager', 'resource_agent_authz_adapter.managers.ResourceProxyManager')}}
# A magic index in an array A[0...n-1] is defined to be an indexe such that # A[i] = i. Given a sorted array of distinct integers, write a method to find a # magic index, if one exists, in array A. # Assumes distinct def find(sorted_array): i = 0 while i < len(sorted_array): difference = sorted_array[i] - i if difference > 0: return None elif difference == 0: return i else: i += -difference return None def findr(sorted_array): def h(a, l, r): if l > r or a[l] > l or a[r] < r: return None m = (l + r) // 2 difference = a[m] - m if difference == 0: return m elif difference > 0: return h(sorted_array, l, m - 1) else: return h(sorted_array, m - difference, r) return h(sorted_array, 0, len(sorted_array) - 1) print(find([-1, 0, 1, 2, 4, 5])) print(findr([-1, 0, 1, 2, 4, 5])) print(findr([3, 3, 3, 3, 3])) # should give "None" # for duplicates, i don't really see a good way to salvage the recursive # solution... here's an iterative one, which is O(n) average and worst case, # but might work nicely for some inputs def find_with_dups(sorted_array): i = 0 while i < len(sorted_array): difference = sorted_array[i] - i if difference > 0: i += difference elif difference == 0: return i else: i += 1 return None print(find_with_dups([3, 3, 3, 3, 3]))
def find(sorted_array): i = 0 while i < len(sorted_array): difference = sorted_array[i] - i if difference > 0: return None elif difference == 0: return i else: i += -difference return None def findr(sorted_array): def h(a, l, r): if l > r or a[l] > l or a[r] < r: return None m = (l + r) // 2 difference = a[m] - m if difference == 0: return m elif difference > 0: return h(sorted_array, l, m - 1) else: return h(sorted_array, m - difference, r) return h(sorted_array, 0, len(sorted_array) - 1) print(find([-1, 0, 1, 2, 4, 5])) print(findr([-1, 0, 1, 2, 4, 5])) print(findr([3, 3, 3, 3, 3])) def find_with_dups(sorted_array): i = 0 while i < len(sorted_array): difference = sorted_array[i] - i if difference > 0: i += difference elif difference == 0: return i else: i += 1 return None print(find_with_dups([3, 3, 3, 3, 3]))
def read_pairs(): file_name = "Data/day14.txt" file = open(file_name, "r") pairs = {} for line in file: line = line.strip("\n").split(" -> ") pairs[(line[0][0], line[0][1])] = line[1] return pairs, set(pairs.values()) def insertion_process(template, pairs, letters, steps): pair_counts = {pair: 0 for pair in pairs.keys()} for i in range(len(template) - 1): pair_counts[(template[i], template[i + 1])] += 1 for t in range(steps): new_pair_counts = {pair: 0 for pair in pairs.keys()} for pair, letter in pairs.items(): new_pair_counts[(pair[0], letter)] += pair_counts[pair] new_pair_counts[(letter, pair[1])] += pair_counts[pair] pair_counts = new_pair_counts count = {letter: 0 for letter in letters} for pair, n in pair_counts.items(): count[pair[0]] += n/2 count[pair[1]] += n/2 count[template[0]] += 0.5 count[template[-1]] += 0.5 return int(max(count.values()) - min(count.values())) if __name__ == "__main__": template = "KBKPHKHHNBCVCHPSPNHF" pairs, letters = read_pairs() print(f"Part one: {insertion_process(template, pairs, letters, 10)}") print(f"Part two: {insertion_process(template, pairs, letters, 40)}")
def read_pairs(): file_name = 'Data/day14.txt' file = open(file_name, 'r') pairs = {} for line in file: line = line.strip('\n').split(' -> ') pairs[line[0][0], line[0][1]] = line[1] return (pairs, set(pairs.values())) def insertion_process(template, pairs, letters, steps): pair_counts = {pair: 0 for pair in pairs.keys()} for i in range(len(template) - 1): pair_counts[template[i], template[i + 1]] += 1 for t in range(steps): new_pair_counts = {pair: 0 for pair in pairs.keys()} for (pair, letter) in pairs.items(): new_pair_counts[pair[0], letter] += pair_counts[pair] new_pair_counts[letter, pair[1]] += pair_counts[pair] pair_counts = new_pair_counts count = {letter: 0 for letter in letters} for (pair, n) in pair_counts.items(): count[pair[0]] += n / 2 count[pair[1]] += n / 2 count[template[0]] += 0.5 count[template[-1]] += 0.5 return int(max(count.values()) - min(count.values())) if __name__ == '__main__': template = 'KBKPHKHHNBCVCHPSPNHF' (pairs, letters) = read_pairs() print(f'Part one: {insertion_process(template, pairs, letters, 10)}') print(f'Part two: {insertion_process(template, pairs, letters, 40)}')
class Stack: sizeof = 0 def __init__(self,list = None): if list == None: self.item =[] else : self.item = list def push(self,i): self.item.append(i) def size(self): return len(self.item) def isEmpty(self): if self.size()==0: return True else: return False def pop(self): return self.item.pop() def peek(self): tmp = self.item[self.size()-1] return tmp def hypnotize(a): if a%2==0: a-=1 if a<1: a=1 elif a%2==1: a+=2 return a def turnBack(sin,h): counter = 1 while sin.size()>=2 : if h == False: a = sin.pop() b = sin.peek() else: a = hypnotize(sin.pop()) b = hypnotize(sin.peek()) if a<b : counter+=1 return counter h= False s = Stack() lst = list(input("Enter Input : ").split(",")) # print(lst) for i in lst: if i.split()[0] == 'A': if h == False: # print("nothypno") s.push(int(i.split()[1])) else: # print("hypnoed") c = int(i.split()[1]) if c%2==0: c-=1 if c < 1 : c = 1 elif c%2==1: c+=2 s.push(c) elif i.split()[0] == 'B': print(turnBack(s,h)) elif i.split()[0] == 'S': h = True
class Stack: sizeof = 0 def __init__(self, list=None): if list == None: self.item = [] else: self.item = list def push(self, i): self.item.append(i) def size(self): return len(self.item) def is_empty(self): if self.size() == 0: return True else: return False def pop(self): return self.item.pop() def peek(self): tmp = self.item[self.size() - 1] return tmp def hypnotize(a): if a % 2 == 0: a -= 1 if a < 1: a = 1 elif a % 2 == 1: a += 2 return a def turn_back(sin, h): counter = 1 while sin.size() >= 2: if h == False: a = sin.pop() b = sin.peek() else: a = hypnotize(sin.pop()) b = hypnotize(sin.peek()) if a < b: counter += 1 return counter h = False s = stack() lst = list(input('Enter Input : ').split(',')) for i in lst: if i.split()[0] == 'A': if h == False: s.push(int(i.split()[1])) else: c = int(i.split()[1]) if c % 2 == 0: c -= 1 if c < 1: c = 1 elif c % 2 == 1: c += 2 s.push(c) elif i.split()[0] == 'B': print(turn_back(s, h)) elif i.split()[0] == 'S': h = True
# https://adventofcode.com/2021/day/17 # SAMPLE # target area: x=20..30, y=-10..-5 target_x = [20, 30] target_y = [-10, -5] # velocity ranges to probe brute force (start by big enough values then tweak it down based on the printed value range) velocity_range_x = [0, 40] velocity_range_y = [-30, 1000] steps_range = 25 # we conclude if we hit or miss after this amount of steps # INPUT # target area: x=144..178, y=-100..-76 target_x = [144, 178] target_y = [-100, -76] # velocity ranges to probe brute force velocity_range_x = [0, 350] velocity_range_y = [-101, 100] steps_range = 200 # we conclude if we hit or miss after this amount of steps total_max_y = 0 hit_counter = 0 # guide values to calibrate ranges total_max_steps_to_hit = 0 range_y_min = 999999 range_y_max = 0 for x in range(velocity_range_x[0], velocity_range_x[1]): for y in range(velocity_range_y[0], velocity_range_y[1]): hit = False probe_x = 0 probe_y = 0 velocity_x = x velocity_y = y y = y probe_max_y = 0 hit = False for steps in range(steps_range): # new coordinates probe_x += velocity_x probe_y += velocity_y probe_max_y = max(probe_y, probe_max_y) # update velocities with drag if velocity_x > 0: velocity_x -= 1 if velocity_x < 0: velocity_x += 1 velocity_y -= 1 if target_x[0] <= probe_x <= target_x[1] and target_y[0] <= probe_y <= target_y[1]: # hit the target hit = True total_max_steps_to_hit = max(steps, total_max_steps_to_hit) range_y_min = min(y, range_y_min) range_y_max = max(y, range_y_max) break if hit: hit_counter += 1 total_max_y = max(total_max_y, probe_max_y) print("x={}, y={}, velocity_range_min_y={}, velocity_range_max_y={}, total_max_steps_to_hit={}, total_max_y={}" .format(x, y, range_y_min, range_y_max, total_max_steps_to_hit, total_max_y)) print("part 1: highest y position reached whilst hitting the target: {}".format(total_max_y)) # 4950 print("part 2: number of distinct initial velocity values hit the target: {}".format(hit_counter)) # 1477 print("OK")
target_x = [20, 30] target_y = [-10, -5] velocity_range_x = [0, 40] velocity_range_y = [-30, 1000] steps_range = 25 target_x = [144, 178] target_y = [-100, -76] velocity_range_x = [0, 350] velocity_range_y = [-101, 100] steps_range = 200 total_max_y = 0 hit_counter = 0 total_max_steps_to_hit = 0 range_y_min = 999999 range_y_max = 0 for x in range(velocity_range_x[0], velocity_range_x[1]): for y in range(velocity_range_y[0], velocity_range_y[1]): hit = False probe_x = 0 probe_y = 0 velocity_x = x velocity_y = y y = y probe_max_y = 0 hit = False for steps in range(steps_range): probe_x += velocity_x probe_y += velocity_y probe_max_y = max(probe_y, probe_max_y) if velocity_x > 0: velocity_x -= 1 if velocity_x < 0: velocity_x += 1 velocity_y -= 1 if target_x[0] <= probe_x <= target_x[1] and target_y[0] <= probe_y <= target_y[1]: hit = True total_max_steps_to_hit = max(steps, total_max_steps_to_hit) range_y_min = min(y, range_y_min) range_y_max = max(y, range_y_max) break if hit: hit_counter += 1 total_max_y = max(total_max_y, probe_max_y) print('x={}, y={}, velocity_range_min_y={}, velocity_range_max_y={}, total_max_steps_to_hit={}, total_max_y={}'.format(x, y, range_y_min, range_y_max, total_max_steps_to_hit, total_max_y)) print('part 1: highest y position reached whilst hitting the target: {}'.format(total_max_y)) print('part 2: number of distinct initial velocity values hit the target: {}'.format(hit_counter)) print('OK')
class Object(): def __init__(self, pos, img): self.pos = pos self.img = img self.rect = [] def fromSafe(string): string = string.strip() s = string.split(",") ret = Object((int(s[2]), int(s[1])), s[0]) return ret
class Object: def __init__(self, pos, img): self.pos = pos self.img = img self.rect = [] def from_safe(string): string = string.strip() s = string.split(',') ret = object((int(s[2]), int(s[1])), s[0]) return ret
class MovieModel: def __init__(self, *, id, title, year, rating): self.id = id self.title = title self.year = year self.rating = rating
class Moviemodel: def __init__(self, *, id, title, year, rating): self.id = id self.title = title self.year = year self.rating = rating
N = int(input()) IN = OUT = 0 for _ in range(0, N): X = int(input()) if 10 <= X <= 20: IN += 1 else: OUT += 1 print(f"{IN} in") print(f"{OUT} out")
n = int(input()) in = out = 0 for _ in range(0, N): x = int(input()) if 10 <= X <= 20: in += 1 else: out += 1 print(f'{IN} in') print(f'{OUT} out')
# https://quera.ir/problemset/contest/9595/ n = int(input()) lines = [input() for i in range(2 * n)] cnt = 0 for i in range(0, 2 * n, 2): if lines[i].replace(' ', '') == lines[i + 1].replace(' ', ''): continue cnt += 1 print(cnt)
n = int(input()) lines = [input() for i in range(2 * n)] cnt = 0 for i in range(0, 2 * n, 2): if lines[i].replace(' ', '') == lines[i + 1].replace(' ', ''): continue cnt += 1 print(cnt)
#!/usr/bin/env python3 class Piece: def __init__(self, id, value): self.__id = id self.__value = value @property def id(self): return self.__id @id.setter def id(self, id): self.__id = id @property def value(self): return self.__value @value.setter def value(self, value): self.__value = value def copy_piece(self, other): self.__value = other.__value self.__id = other.__id def set_piece(self, id, value): self.__value = value self.__id = id
class Piece: def __init__(self, id, value): self.__id = id self.__value = value @property def id(self): return self.__id @id.setter def id(self, id): self.__id = id @property def value(self): return self.__value @value.setter def value(self, value): self.__value = value def copy_piece(self, other): self.__value = other.__value self.__id = other.__id def set_piece(self, id, value): self.__value = value self.__id = id
class Person: def __init__(self, age): self.age = age def drink(self): return "drinking" def drive(self): return "driving" def drink_and_drive(self): return "driving while drunk" class ResponsiblePerson: def __init__(self, person): self.person = person def drink(self): if self.person.age >= 18: return self.person.drink() return "too young" def drive(self): if self.person.age >= 16: return self.person.drive() return "too young" def drink_and_drive(self): return "dead"
class Person: def __init__(self, age): self.age = age def drink(self): return 'drinking' def drive(self): return 'driving' def drink_and_drive(self): return 'driving while drunk' class Responsibleperson: def __init__(self, person): self.person = person def drink(self): if self.person.age >= 18: return self.person.drink() return 'too young' def drive(self): if self.person.age >= 16: return self.person.drive() return 'too young' def drink_and_drive(self): return 'dead'
class A(object): pass class B(object): pass
class A(object): pass class B(object): pass
sum=0 for i in range(5): n=int(input()) sum+=n print(sum)
sum = 0 for i in range(5): n = int(input()) sum += n print(sum)
# # @lc app=leetcode id=170 lang=python3 # # [170] Two Sum III - Data structure design # # @lc code=start class TwoSum: def __init__(self): self.vals = [] def add(self, number: int) -> None: self.vals.append(number) def find(self, value: int) -> bool: s = set() for val in self.vals: if value - val in s: return True else: if val not in s: s.add(val) return False # @lc code=end
class Twosum: def __init__(self): self.vals = [] def add(self, number: int) -> None: self.vals.append(number) def find(self, value: int) -> bool: s = set() for val in self.vals: if value - val in s: return True elif val not in s: s.add(val) return False
def go_to_formation_2_alg(position_blue_robots): rule_0 = [0] + go_to_point(position_blue_robots[0][0], position_blue_robots[0][1], -4500.0, 0.0) rule_1 = [1] + go_to_point(position_blue_robots[1][0], position_blue_robots[1][1], -3600.0, -550.0) rule_2 = [2] + go_to_point(position_blue_robots[2][0], position_blue_robots[2][1], -3600.0, 550.0) rule_3 = [3] + go_to_point(position_blue_robots[3][0], position_blue_robots[3][1], -645.0, 0.0) rule_4 = [4] + go_to_point(position_blue_robots[4][0], position_blue_robots[4][1], -645.0, 2100.0) rule_5 = [5] + go_to_point(position_blue_robots[5][0], position_blue_robots[5][1], -645.0, -2100.0) rule_6 = [6] + go_to_point(position_blue_robots[6][0], position_blue_robots[6][1], -2000.0, 750.0) rule_7 = [7] + go_to_point(position_blue_robots[7][0], position_blue_robots[7][1], -2000.0, -750.0) rules = [rule_0, rule_1, rule_2, rule_3, rule_4, rule_5, rule_6, rule_7] return rules def go_to_point(cur_x, cur_y, point_x, point_y): command = [0, 0, 0, 0, 0] if (abs(cur_x - point_x) <= 40) and (abs(cur_y - point_y) <= 40): command = [0, 0, 0, 0, 0] elif (abs(cur_x - point_x) <= 40) and (cur_y > point_y) and (abs(cur_y - point_y) > 40): command = [0, 10, 0, 0, 0] elif (abs(cur_x - point_x) <= 40) and (cur_y < point_y) and (abs(cur_y - point_y) > 40): command = [0, -10, 0, 0, 0] elif (abs(cur_x - point_x) > 40) and (cur_x > point_x) and (abs(cur_y - point_y) <= 40): command = [-10, 0, 0, 0, 0] elif (abs(cur_x - point_x) > 40) and (cur_x > point_x) and (cur_y > point_y) and (abs(cur_y - point_y) > 40): command = [-10, 10, 0, 0, 0] elif (abs(cur_x - point_x) > 40) and (cur_x > point_x) and (cur_y < point_y) and (abs(cur_y - point_y) > 40): command = [-10, -10, 0, 0, 0] elif (abs(cur_x - point_x) > 40) and (cur_x < point_x) and (abs(cur_y - point_y) <= 40): command = [10, 0, 0, 0, 0] elif (abs(cur_x - point_x) > 40) and (cur_x < point_x) and (cur_y > point_y) and (abs(cur_y - point_y) > 40): command = [10, 10, 0, 0, 0] elif (abs(cur_x - point_x) > 40) and (cur_x < point_x) and (cur_y < point_y) and (abs(cur_y - point_y) > 40): command = [10, -10, 0, 0, 0] return command
def go_to_formation_2_alg(position_blue_robots): rule_0 = [0] + go_to_point(position_blue_robots[0][0], position_blue_robots[0][1], -4500.0, 0.0) rule_1 = [1] + go_to_point(position_blue_robots[1][0], position_blue_robots[1][1], -3600.0, -550.0) rule_2 = [2] + go_to_point(position_blue_robots[2][0], position_blue_robots[2][1], -3600.0, 550.0) rule_3 = [3] + go_to_point(position_blue_robots[3][0], position_blue_robots[3][1], -645.0, 0.0) rule_4 = [4] + go_to_point(position_blue_robots[4][0], position_blue_robots[4][1], -645.0, 2100.0) rule_5 = [5] + go_to_point(position_blue_robots[5][0], position_blue_robots[5][1], -645.0, -2100.0) rule_6 = [6] + go_to_point(position_blue_robots[6][0], position_blue_robots[6][1], -2000.0, 750.0) rule_7 = [7] + go_to_point(position_blue_robots[7][0], position_blue_robots[7][1], -2000.0, -750.0) rules = [rule_0, rule_1, rule_2, rule_3, rule_4, rule_5, rule_6, rule_7] return rules def go_to_point(cur_x, cur_y, point_x, point_y): command = [0, 0, 0, 0, 0] if abs(cur_x - point_x) <= 40 and abs(cur_y - point_y) <= 40: command = [0, 0, 0, 0, 0] elif abs(cur_x - point_x) <= 40 and cur_y > point_y and (abs(cur_y - point_y) > 40): command = [0, 10, 0, 0, 0] elif abs(cur_x - point_x) <= 40 and cur_y < point_y and (abs(cur_y - point_y) > 40): command = [0, -10, 0, 0, 0] elif abs(cur_x - point_x) > 40 and cur_x > point_x and (abs(cur_y - point_y) <= 40): command = [-10, 0, 0, 0, 0] elif abs(cur_x - point_x) > 40 and cur_x > point_x and (cur_y > point_y) and (abs(cur_y - point_y) > 40): command = [-10, 10, 0, 0, 0] elif abs(cur_x - point_x) > 40 and cur_x > point_x and (cur_y < point_y) and (abs(cur_y - point_y) > 40): command = [-10, -10, 0, 0, 0] elif abs(cur_x - point_x) > 40 and cur_x < point_x and (abs(cur_y - point_y) <= 40): command = [10, 0, 0, 0, 0] elif abs(cur_x - point_x) > 40 and cur_x < point_x and (cur_y > point_y) and (abs(cur_y - point_y) > 40): command = [10, 10, 0, 0, 0] elif abs(cur_x - point_x) > 40 and cur_x < point_x and (cur_y < point_y) and (abs(cur_y - point_y) > 40): command = [10, -10, 0, 0, 0] return command
infile=int(open('primes.in','r').readline()) outfile=open('primes.out','w') max1=10**infile for i in range(infile,max1): prime=True for e in range(2,i//2): if (i%e) == 0: prime=False break if i==1: answer=0 break elif prime==True: answer=i break outfile.write(str(answer)) outfile.close()
infile = int(open('primes.in', 'r').readline()) outfile = open('primes.out', 'w') max1 = 10 ** infile for i in range(infile, max1): prime = True for e in range(2, i // 2): if i % e == 0: prime = False break if i == 1: answer = 0 break elif prime == True: answer = i break outfile.write(str(answer)) outfile.close()
class Node: def __init__(self, data=None): self.data = data self.left = None self.right = None # Insert method to create nodes def insert(self, data): if self.data: if data < self.data: if self.left is None: self.left = Node(data) else: self.left.insert(data) elif data > self.data: if self.right is None: self.right = Node(data) else: self.right.insert(data) else: self.data = data # find the val to compare the value with nodes def findval(self, val): if val < self.data: if self.left is None: return str(val) + " not found" return self.left.findval(val) elif val > self.data: if self.right is None: return str(val) + " not found" return self.right.findval(val) else: print(str(self.data) + " is found") # Print the tree def PrintTree(self): if self.left: self.left.PrintTree() print(self.data), if self.right: self.right.PrintTree() root = Node(12) root.insert(6) root.insert(14) root.insert(3) root.insert(1) root.insert(15) # print(root.findval(7)) # print(root.findval(14)) print(root.right.left) # root.PrintTree()
class Node: def __init__(self, data=None): self.data = data self.left = None self.right = None def insert(self, data): if self.data: if data < self.data: if self.left is None: self.left = node(data) else: self.left.insert(data) elif data > self.data: if self.right is None: self.right = node(data) else: self.right.insert(data) else: self.data = data def findval(self, val): if val < self.data: if self.left is None: return str(val) + ' not found' return self.left.findval(val) elif val > self.data: if self.right is None: return str(val) + ' not found' return self.right.findval(val) else: print(str(self.data) + ' is found') def print_tree(self): if self.left: self.left.PrintTree() (print(self.data),) if self.right: self.right.PrintTree() root = node(12) root.insert(6) root.insert(14) root.insert(3) root.insert(1) root.insert(15) print(root.right.left)
n, m = [int(i) for i in input().split()] if n-m > m-1: print(min(m+1, n)) else: print(max(m-1, 1))
(n, m) = [int(i) for i in input().split()] if n - m > m - 1: print(min(m + 1, n)) else: print(max(m - 1, 1))
#!/usr/bin/env python 3 ############################################################################################ # # # Program purpose: Count the number of substrings from a given string of lowercase # # alphabets. # # Program Author : Happi Yvan <ivensteinpoker@gmail.com> # # Creation Date : November 5, 2019 # # # ############################################################################################ def has_uppercase(data: str) -> bool: for char in data: if str.isupper(char): return True return False def obtain_user_data(input_mess: str) -> str: is_valid, user_data = False, '' while is_valid is False: try: user_data = input(input_mess) if len(user_data) == 0: raise ValueError('Oops! Data is needed') if has_uppercase(user_data): raise ValueError('String must be lowercase') is_valid = True except ValueError as ve: print(f'[ERROR]: {ve}') return user_data def count_k_dist(str1: str, k_val: int) -> int: str_len = len(str1) result = 0 ctr = [0] * 27 for i in range(0, str_len): dist_ctr = 0 ctr = [0] * 27 for j in range(i, str_len): if ctr[ord(str1[j]) - 97] == 0: dist_ctr += 1 ctr[ord(str1[j]) - 97] += 1 if dist_ctr == k_val: result += 1 if dist_ctr > k_val: break return result if __name__ == "__main__": user_input_data = obtain_user_data(input_mess='Enter some string data (lowercase): ') k = int(-1) while k < 0: try: k = int(input('Input value of k: ')) except ValueError as ve: print(f'[ERROR]: {ve}') print(f'Number of substrings with exactly {k} distinct characters: {count_k_dist(str1=user_input_data, k_val=k)}')
def has_uppercase(data: str) -> bool: for char in data: if str.isupper(char): return True return False def obtain_user_data(input_mess: str) -> str: (is_valid, user_data) = (False, '') while is_valid is False: try: user_data = input(input_mess) if len(user_data) == 0: raise value_error('Oops! Data is needed') if has_uppercase(user_data): raise value_error('String must be lowercase') is_valid = True except ValueError as ve: print(f'[ERROR]: {ve}') return user_data def count_k_dist(str1: str, k_val: int) -> int: str_len = len(str1) result = 0 ctr = [0] * 27 for i in range(0, str_len): dist_ctr = 0 ctr = [0] * 27 for j in range(i, str_len): if ctr[ord(str1[j]) - 97] == 0: dist_ctr += 1 ctr[ord(str1[j]) - 97] += 1 if dist_ctr == k_val: result += 1 if dist_ctr > k_val: break return result if __name__ == '__main__': user_input_data = obtain_user_data(input_mess='Enter some string data (lowercase): ') k = int(-1) while k < 0: try: k = int(input('Input value of k: ')) except ValueError as ve: print(f'[ERROR]: {ve}') print(f'Number of substrings with exactly {k} distinct characters: {count_k_dist(str1=user_input_data, k_val=k)}')
http = require("net/http") def hello(w, req): w.WriteHeader(201) w.Write("hello world\n") http.HandleFunc("/hello", hello) http.ListenAndServe(":8080", http.Handler)
http = require('net/http') def hello(w, req): w.WriteHeader(201) w.Write('hello world\n') http.HandleFunc('/hello', hello) http.ListenAndServe(':8080', http.Handler)
''' Sum of even & odd Write a program to input an integer N and print the sum of all its even digits and sum of all its odd digits separately. Digits mean numbers, not the places! That is, if the given integer is "13245", even digits are 2 & 4 and odd digits are 1, 3 & 5. Input format : Integer N Output format : Sum_of_Even_Digits Sum_of_Odd_Digits (Print first even sum and then odd sum separated by space) Constraints 0 <= N <= 10^8 Sample Input 1: 1234 Sample Output 1: 6 4 Sample Input 2: 552245 Sample Output 2: 8 15 Explanation for Input 2: For the given input, the even digits are 2, 2 and 4 and if we take the sum of these digits it will come out to be 8(2 + 2 + 4) and similarly, if we look at the odd digits, they are, 5, 5 and 5 which makes a sum of 15(5 + 5 + 5). Hence the answer would be, 8(evenSum) <single space> 15(oddSum) ''' ## Note : For printing multiple values in one line, put them inside print separated by space. ## You can follow this syntax for printing values of two variables val1 and val2 separaetd by space - ## print(val1, " ", val2) se=0 so=0 n=int(input()) while n!=0: x = n%10 if x%2 == 0: se+=x else: so+=x n=n//10 print(se, " ", so)
""" Sum of even & odd Write a program to input an integer N and print the sum of all its even digits and sum of all its odd digits separately. Digits mean numbers, not the places! That is, if the given integer is "13245", even digits are 2 & 4 and odd digits are 1, 3 & 5. Input format : Integer N Output format : Sum_of_Even_Digits Sum_of_Odd_Digits (Print first even sum and then odd sum separated by space) Constraints 0 <= N <= 10^8 Sample Input 1: 1234 Sample Output 1: 6 4 Sample Input 2: 552245 Sample Output 2: 8 15 Explanation for Input 2: For the given input, the even digits are 2, 2 and 4 and if we take the sum of these digits it will come out to be 8(2 + 2 + 4) and similarly, if we look at the odd digits, they are, 5, 5 and 5 which makes a sum of 15(5 + 5 + 5). Hence the answer would be, 8(evenSum) <single space> 15(oddSum) """ se = 0 so = 0 n = int(input()) while n != 0: x = n % 10 if x % 2 == 0: se += x else: so += x n = n // 10 print(se, ' ', so)
# Eoin Lees # this program creates a tuple that prints the summer months months = ("January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December") summer = months[4:7] for month in summer: print(month)
months = ('January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December') summer = months[4:7] for month in summer: print(month)
# PERSON SEARCH_PERSON = ''' query SearchPerson($searchTerm: String){ searchPerson(searchTerm: $searchTerm){ id birth{ surname } } } '''
search_person = '\nquery SearchPerson($searchTerm: String){\n searchPerson(searchTerm: $searchTerm){\n id\n birth{\n surname\n }\n }\n}\n'
def is_paired(input_string): pairs = {'[': ']', '{': '}', '(': ')'} stack = list() for char in input_string: if char in pairs.keys(): stack.append(char) elif char in pairs.values(): if not stack or pairs[stack.pop()] != char: return False return not stack # if stack is empty return True else False
def is_paired(input_string): pairs = {'[': ']', '{': '}', '(': ')'} stack = list() for char in input_string: if char in pairs.keys(): stack.append(char) elif char in pairs.values(): if not stack or pairs[stack.pop()] != char: return False return not stack
def missing_number(original_list=[1,2,3,4,6,7,10], num_list=[10,11,12,14,17]): original_list = [x for x in range(num_list[0], num_list[-1] + 1)] num_list = set(num_list) return (list(num_list ^ set(original_list))) print(missing_number([1,2,3,4,6,7,10])) print(missing_number([10,11,12,14,17]))
def missing_number(original_list=[1, 2, 3, 4, 6, 7, 10], num_list=[10, 11, 12, 14, 17]): original_list = [x for x in range(num_list[0], num_list[-1] + 1)] num_list = set(num_list) return list(num_list ^ set(original_list)) print(missing_number([1, 2, 3, 4, 6, 7, 10])) print(missing_number([10, 11, 12, 14, 17]))
def plateau_affichage(plateau,taille,plateau_list,Htaille,plateau_lists = []) : L=taille H=taille for x in range (0,L+1) : print (str(x),(' '), end='') for y in range (0,H+1) : if y==0 : print (' ') else : print (str(y), ) for y in range(H): if x < 8 and y == 0: print(" ", end = "") elif x >= 8 : print('',end = "") print(plateau_lists[taille][Htaille], end = " ") print("") def plateau_list(taille,Htaille): damier = taille * ['.'] for i in range(len(damier)): damier[i] = Htaille * ['.'] return damier def jeu() : taille = 0 taille = int(input('Quelle est la taille du plateau ?')) Htaille = taille plateau = [] for x in range(taille): plateau.append([" "] * taille) plateau[3][3] = "X" plateau[3][4] = "O" plateau[4][3] = "O" plateau[4][4] = "X" plateau_affichage(plateau,taille,plateau_list,Htaille) plateau_list(taille,Htaille) jeu()
def plateau_affichage(plateau, taille, plateau_list, Htaille, plateau_lists=[]): l = taille h = taille for x in range(0, L + 1): print(str(x), ' ', end='') for y in range(0, H + 1): if y == 0: print(' ') else: print(str(y)) for y in range(H): if x < 8 and y == 0: print(' ', end='') elif x >= 8: print('', end='') print(plateau_lists[taille][Htaille], end=' ') print('') def plateau_list(taille, Htaille): damier = taille * ['.'] for i in range(len(damier)): damier[i] = Htaille * ['.'] return damier def jeu(): taille = 0 taille = int(input('Quelle est la taille du plateau ?')) htaille = taille plateau = [] for x in range(taille): plateau.append([' '] * taille) plateau[3][3] = 'X' plateau[3][4] = 'O' plateau[4][3] = 'O' plateau[4][4] = 'X' plateau_affichage(plateau, taille, plateau_list, Htaille) plateau_list(taille, Htaille) jeu()
# !/usr/bin/env python # coding: utf-8 ''' Description: Given an array nums containing n + 1 integers where each integer is between 1 and n (inclusive), prove that at least one duplicate number must exist. Assume that there is only one duplicate number, find the duplicate one. Note: 1. You must not modify the array (assume the array is read only). 2. You must use only constant, O(1) extra space. 3. Your runtime complexity should be less than O(n^2). 4. There is only one duplicate number in the array, but it could be repeated more than once. Tags: Binary Search, Array, Two Pointers '''
""" Description: Given an array nums containing n + 1 integers where each integer is between 1 and n (inclusive), prove that at least one duplicate number must exist. Assume that there is only one duplicate number, find the duplicate one. Note: 1. You must not modify the array (assume the array is read only). 2. You must use only constant, O(1) extra space. 3. Your runtime complexity should be less than O(n^2). 4. There is only one duplicate number in the array, but it could be repeated more than once. Tags: Binary Search, Array, Two Pointers """
# needed to let the vscode test discoverer find and import the tests __all__ = [ 'TestUnitCaja', 'TestUnitSplitter' ]
__all__ = ['TestUnitCaja', 'TestUnitSplitter']
GENOMES_DIR='/media/data1/genomes' OUT_DIR = '/media/data2/HuR_human_mouse/mouse/ribo-seq' SRC_DIR = '/home/saket/github_projects/clip_seq_pipeline/scripts' RAWDATA_DIR ='/media/data1/HuR_human_mouse/mouse/ribo/Penalva_L_03222017' GENOME_BUILD = 'mm10' GENOME_FASTA = GENOMES_DIR + '/' + GENOME_BUILD + '/fasta/'+ GENOME_BUILD+ '.fa' STAR_INDEX = GENOMES_DIR + '/' + GENOME_BUILD + '/star_annotated' GTF = GENOMES_DIR + '/' + GENOME_BUILD + '/annotation/' + 'gencode.vM11.annotation.without_rRNA_tRNA.gtf' GENE_NAMES = GENOMES_DIR + '/' + GENOME_BUILD + '/annotation/' + GENOME_BUILD+'_gene_names_stripped.tsv' GENE_LENGTHS = GENOMES_DIR + '/' + GENOME_BUILD + '/annotation/' + 'gencode.vM11.coding_lengths.tsv' #+ GENOME_BUILD+'_gene_lengths.tsv' DESIGN_FILE = RAWDATA_DIR + '/' + 'design.txt' HTSEQ_STRANDED = 'yes' FEATURECOUNTS_S = '-s 1' GENE_BED = GENOMES_DIR + '/' + GENOME_BUILD + '/annotation/' + 'gencode.vM11.genes.fromucsc.bed' #+ GENOME_BUILD+'_gene_lengths.tsv' FEATURECOUNTS_T='cds' HTSEQ_MODE='union'
genomes_dir = '/media/data1/genomes' out_dir = '/media/data2/HuR_human_mouse/mouse/ribo-seq' src_dir = '/home/saket/github_projects/clip_seq_pipeline/scripts' rawdata_dir = '/media/data1/HuR_human_mouse/mouse/ribo/Penalva_L_03222017' genome_build = 'mm10' genome_fasta = GENOMES_DIR + '/' + GENOME_BUILD + '/fasta/' + GENOME_BUILD + '.fa' star_index = GENOMES_DIR + '/' + GENOME_BUILD + '/star_annotated' gtf = GENOMES_DIR + '/' + GENOME_BUILD + '/annotation/' + 'gencode.vM11.annotation.without_rRNA_tRNA.gtf' gene_names = GENOMES_DIR + '/' + GENOME_BUILD + '/annotation/' + GENOME_BUILD + '_gene_names_stripped.tsv' gene_lengths = GENOMES_DIR + '/' + GENOME_BUILD + '/annotation/' + 'gencode.vM11.coding_lengths.tsv' design_file = RAWDATA_DIR + '/' + 'design.txt' htseq_stranded = 'yes' featurecounts_s = '-s 1' gene_bed = GENOMES_DIR + '/' + GENOME_BUILD + '/annotation/' + 'gencode.vM11.genes.fromucsc.bed' featurecounts_t = 'cds' htseq_mode = 'union'
class Solution: # @param A : head node of linked list # @param B : integer # @return the head node in the linked list def partition(self, A, B): head0 = None tail0 = None head1 = None tail1 = None ptr = A while ptr is not None : ptr2 = ptr.next ptr.next = None if ptr.val < B : if head0 is None : head0 = ptr tail0 = ptr else : tail0.next = ptr tail0 = ptr else : if head1 is None : head1 = ptr tail1 = ptr else : tail1.next = ptr tail1 = ptr ptr = ptr2 if tail0 is not None : tail0.next = head1 return head0 if head0 is not None else head1
class Solution: def partition(self, A, B): head0 = None tail0 = None head1 = None tail1 = None ptr = A while ptr is not None: ptr2 = ptr.next ptr.next = None if ptr.val < B: if head0 is None: head0 = ptr tail0 = ptr else: tail0.next = ptr tail0 = ptr elif head1 is None: head1 = ptr tail1 = ptr else: tail1.next = ptr tail1 = ptr ptr = ptr2 if tail0 is not None: tail0.next = head1 return head0 if head0 is not None else head1
# Author : SNEH DESAI # Description : THIS IS THE CODE FOR NAIVE BAYES THEOREM # AND IT HAD ALSO BEEN TESTED FOR ALL THE POSSIBLE RESULTS. # DATA MINING # Open File to read myFile = open('Play Or Not.csv', 'r') # Logic ListOfLines = myFile.read().splitlines() # Reads The Lines print(ListOfLines[0]) # All The Counter Variable. count = 0 sunny = 0 overcast = 0 rainy = 0 hot = 0 mild = 0 cool = 0 high = 0 normal = 0 t = 0 f = 0 yes = 0 no = 0 # The Yes Along with Individual Counter Variable y_sunny = 0 y_overcast = 0 y_rainy = 0 y_hot = 0 y_mild = 0 y_cool = 0 y_high = 0 y_normal = 0 y_t = 0 y_f = 0 # The No Along with Individual Counter Variables n_sunny = 0 n_overcast = 0 n_rainy = 0 n_hot = 0 n_mild = 0 n_cool = 0 n_high = 0 n_normal = 0 n_t = 0 n_f = 0 # The Real Program starts from Here for i in range(1,len(ListOfLines),1): # Loop for all the column in a row. aLine = ListOfLines[i] lineItem = aLine.split(',') Outlook = lineItem[0] Temp = lineItem[1] Humidity = lineItem[2] Windy = lineItem[3] Play = lineItem[4] count += 1 print(Outlook,' | ', Temp, ' | ', Humidity, ' | ', Windy, " | ", Play) print("Count = ",count) # Casual Checking if Outlook == 'sunny' : sunny += 1 if Outlook == 'overcast': overcast += 1 if Outlook == 'rainy': rainy += 1 if Temp == 'mild': mild += 1 if Temp == 'cool': cool += 1 if Temp == 'hot': hot += 1 if Humidity == 'high': high += 1 if Humidity == 'normal': normal += 1 if Windy == 'TRUE': t += 1 if Windy == 'FALSE': f += 1 if Play == 'yes': yes += 1 if Play == 'no': no += 1 # End Casual Checking # Checking Individual with 'Yes' and 'No' if Outlook == 'sunny' and Play == 'yes': y_sunny += 1 if Outlook == 'overcast' and Play == 'yes': y_overcast += 1 if Outlook == 'rainy' and Play == 'yes' : y_rainy += 1 if Temp == 'mild' and Play == 'yes': y_mild += 1 if Temp == 'cool' and Play == 'yes': y_cool += 1 if Temp == 'hot' and Play == 'yes': y_hot += 1 if Humidity == 'high' and Play == 'yes': y_high += 1 if Humidity == 'normal' and Play == 'yes': y_normal += 1 if Windy == 'TRUE' and Play == 'yes': y_t += 1 if Windy == 'FALSE' and Play == 'yes': y_f += 1 # Checking Individual with 'Yes' and 'No' if Outlook == 'sunny' and Play == 'no': n_sunny += 1 if Outlook == 'overcast' and Play == 'no': n_overcast += 1 if Outlook == 'rainy' and Play == 'no' : n_rainy += 1 if Temp == 'mild' and Play == 'no': n_mild += 1 if Temp == 'cool' and Play == 'no': n_cool += 1 if Temp == 'hot' and Play == 'no': n_hot += 1 if Humidity == 'high' and Play == 'no': n_high += 1 if Humidity == 'normal' and Play == 'no': n_normal += 1 if Windy == 'TRUE' and Play == 'no': n_t += 1 if Windy == 'FALSE' and Play == 'no': n_f += 1 # The PRINT of Count of Individual TYPE print('No. of Sunny = ', sunny) print('No. of Overcast = ', overcast) print('No. of Rainy = ', rainy) print('No. of Cool = ', cool) print('No. of Mild = ', mild) print('No. of Hot = ', hot) print('No. of High = ', high) print('No. of Normal = ', normal) print('No. of True = ', t) print('No. of False = ', f) print('No. of Yes = ', yes) print('No. of No = ', no) print('\n\n') # The Print of Count of Yes and Individual Type print('No. of Yes and Sunny = ', y_sunny) print('No. of Yes and Overcast = ', y_overcast) print('No. of Yes and Rainy = ', y_rainy) print('No. of Yes and Cool = ', y_cool) print('No. of Yes and Mild = ', y_mild) print('No. of Yes and Hot = ', y_hot) print('No. of Yes and High = ', y_high) print('No. of Yes and Normal = ', y_normal) print('No. of Yes and True = ', y_t) print('No. of Yes and False = ', y_f) print('\n\n') # The Print of Count of No and Individual Types print('No. of No and Sunny = ', n_sunny) print('No. of No and Overcast = ', n_overcast) print('No. of No and Rainy = ', n_rainy) print('No. of No and Cool = ', n_cool) print('No. of No and Mild = ', n_mild) print('No. of No and Hot = ', n_hot) print('No. of No and High = ', n_high) print('No. of No and Normal = ', n_normal) print('No. of No and True = ', n_t) print('No. of NO and False = ', n_f) # Selection Process to find out the result. print("\n\nFind Out Weather the Whether is Good enough to play or not??") # Selection of OUTLOOK out_yes = 1 out_no = 1 print("\n\n Select the OutLook. \n1. Sunny\n2. Overcast\n3. Rainy") print('\n Enter The Selection : ') inp = input() if inp == "1": sel = 1 out_yes = (y_sunny / yes) out_no = (n_sunny / no) elif inp == "2": sel = 2 out_yes = y_overcast / yes out_no = n_overcast / no elif inp == "3": sel = 3 out_yes = y_rainy / yes out_no = n_rainy / no else: print("Wrong Choice entered") # SELECTION OF TEMPERATURE out1_no = 0 out1_yes = 0 print('\n Select the Type of Temperature.\n1. Hot\n2. Mild\n3. Cool') print('\n Enter The Selection : ') inp1=input() if inp1 == '1': sel1 = 1 out1_yes = y_hot / yes out1_no = n_hot / no elif inp1 == '2': sel1 = 2 out1_yes = y_mild / yes out1_no = n_mild / no elif inp1 == '3': sel1 = 3 out1_yes = y_cool / yes out1_no = n_cool / no else: print("Wrong Choice entered") # SELECTION OF HUMIDITY out2_no = 0 out2_yes = 0 print('\n Select the Humidity Level.\n1. High\n2. Normal') print('\n Enter The Selection : ') inp2=input() if inp2 == '1': sel2 = 1 out2_yes = y_high / yes out2_no = n_high / no elif inp2 == '2': sel2 = 2 out2_yes = y_normal / yes out2_no = n_normal / no else: print("Wrong Choice entered") # SELECTION OF WIND PRESENCE out3_no = 0 out3_yes = 0 print('\n Select the Wind Presence. \n1. Yes\n2. No') print('\n Enter The Selection : ') inp3=input() if inp3 == '1': sel3 = 1 out3_yes = y_t / yes out3_no = n_t / no elif inp3 == '2': sel3 = 2 out3_yes = y_f / yes out3_no = n_f / no else: print("Wrong Choice entered") # Implementing Naive Bayesian p = yes / count q = no / count output_yes = out_yes * out1_yes * out2_yes * out3_yes * p output_no = out_no * out1_no * out2_no * out3_no * q probability_y = output_yes / (output_yes + output_no) probability_n = output_no / (output_yes + output_no) if probability_y > probability_n : print("Yes You Can Play") elif probability_n > probability_y: print("No You Cant Play")
my_file = open('Play Or Not.csv', 'r') list_of_lines = myFile.read().splitlines() print(ListOfLines[0]) count = 0 sunny = 0 overcast = 0 rainy = 0 hot = 0 mild = 0 cool = 0 high = 0 normal = 0 t = 0 f = 0 yes = 0 no = 0 y_sunny = 0 y_overcast = 0 y_rainy = 0 y_hot = 0 y_mild = 0 y_cool = 0 y_high = 0 y_normal = 0 y_t = 0 y_f = 0 n_sunny = 0 n_overcast = 0 n_rainy = 0 n_hot = 0 n_mild = 0 n_cool = 0 n_high = 0 n_normal = 0 n_t = 0 n_f = 0 for i in range(1, len(ListOfLines), 1): a_line = ListOfLines[i] line_item = aLine.split(',') outlook = lineItem[0] temp = lineItem[1] humidity = lineItem[2] windy = lineItem[3] play = lineItem[4] count += 1 print(Outlook, ' | ', Temp, ' | ', Humidity, ' | ', Windy, ' | ', Play) print('Count = ', count) if Outlook == 'sunny': sunny += 1 if Outlook == 'overcast': overcast += 1 if Outlook == 'rainy': rainy += 1 if Temp == 'mild': mild += 1 if Temp == 'cool': cool += 1 if Temp == 'hot': hot += 1 if Humidity == 'high': high += 1 if Humidity == 'normal': normal += 1 if Windy == 'TRUE': t += 1 if Windy == 'FALSE': f += 1 if Play == 'yes': yes += 1 if Play == 'no': no += 1 if Outlook == 'sunny' and Play == 'yes': y_sunny += 1 if Outlook == 'overcast' and Play == 'yes': y_overcast += 1 if Outlook == 'rainy' and Play == 'yes': y_rainy += 1 if Temp == 'mild' and Play == 'yes': y_mild += 1 if Temp == 'cool' and Play == 'yes': y_cool += 1 if Temp == 'hot' and Play == 'yes': y_hot += 1 if Humidity == 'high' and Play == 'yes': y_high += 1 if Humidity == 'normal' and Play == 'yes': y_normal += 1 if Windy == 'TRUE' and Play == 'yes': y_t += 1 if Windy == 'FALSE' and Play == 'yes': y_f += 1 if Outlook == 'sunny' and Play == 'no': n_sunny += 1 if Outlook == 'overcast' and Play == 'no': n_overcast += 1 if Outlook == 'rainy' and Play == 'no': n_rainy += 1 if Temp == 'mild' and Play == 'no': n_mild += 1 if Temp == 'cool' and Play == 'no': n_cool += 1 if Temp == 'hot' and Play == 'no': n_hot += 1 if Humidity == 'high' and Play == 'no': n_high += 1 if Humidity == 'normal' and Play == 'no': n_normal += 1 if Windy == 'TRUE' and Play == 'no': n_t += 1 if Windy == 'FALSE' and Play == 'no': n_f += 1 print('No. of Sunny = ', sunny) print('No. of Overcast = ', overcast) print('No. of Rainy = ', rainy) print('No. of Cool = ', cool) print('No. of Mild = ', mild) print('No. of Hot = ', hot) print('No. of High = ', high) print('No. of Normal = ', normal) print('No. of True = ', t) print('No. of False = ', f) print('No. of Yes = ', yes) print('No. of No = ', no) print('\n\n') print('No. of Yes and Sunny = ', y_sunny) print('No. of Yes and Overcast = ', y_overcast) print('No. of Yes and Rainy = ', y_rainy) print('No. of Yes and Cool = ', y_cool) print('No. of Yes and Mild = ', y_mild) print('No. of Yes and Hot = ', y_hot) print('No. of Yes and High = ', y_high) print('No. of Yes and Normal = ', y_normal) print('No. of Yes and True = ', y_t) print('No. of Yes and False = ', y_f) print('\n\n') print('No. of No and Sunny = ', n_sunny) print('No. of No and Overcast = ', n_overcast) print('No. of No and Rainy = ', n_rainy) print('No. of No and Cool = ', n_cool) print('No. of No and Mild = ', n_mild) print('No. of No and Hot = ', n_hot) print('No. of No and High = ', n_high) print('No. of No and Normal = ', n_normal) print('No. of No and True = ', n_t) print('No. of NO and False = ', n_f) print('\n\nFind Out Weather the Whether is Good enough to play or not??') out_yes = 1 out_no = 1 print('\n\n Select the OutLook. \n1. Sunny\n2. Overcast\n3. Rainy') print('\n Enter The Selection : ') inp = input() if inp == '1': sel = 1 out_yes = y_sunny / yes out_no = n_sunny / no elif inp == '2': sel = 2 out_yes = y_overcast / yes out_no = n_overcast / no elif inp == '3': sel = 3 out_yes = y_rainy / yes out_no = n_rainy / no else: print('Wrong Choice entered') out1_no = 0 out1_yes = 0 print('\n Select the Type of Temperature.\n1. Hot\n2. Mild\n3. Cool') print('\n Enter The Selection : ') inp1 = input() if inp1 == '1': sel1 = 1 out1_yes = y_hot / yes out1_no = n_hot / no elif inp1 == '2': sel1 = 2 out1_yes = y_mild / yes out1_no = n_mild / no elif inp1 == '3': sel1 = 3 out1_yes = y_cool / yes out1_no = n_cool / no else: print('Wrong Choice entered') out2_no = 0 out2_yes = 0 print('\n Select the Humidity Level.\n1. High\n2. Normal') print('\n Enter The Selection : ') inp2 = input() if inp2 == '1': sel2 = 1 out2_yes = y_high / yes out2_no = n_high / no elif inp2 == '2': sel2 = 2 out2_yes = y_normal / yes out2_no = n_normal / no else: print('Wrong Choice entered') out3_no = 0 out3_yes = 0 print('\n Select the Wind Presence. \n1. Yes\n2. No') print('\n Enter The Selection : ') inp3 = input() if inp3 == '1': sel3 = 1 out3_yes = y_t / yes out3_no = n_t / no elif inp3 == '2': sel3 = 2 out3_yes = y_f / yes out3_no = n_f / no else: print('Wrong Choice entered') p = yes / count q = no / count output_yes = out_yes * out1_yes * out2_yes * out3_yes * p output_no = out_no * out1_no * out2_no * out3_no * q probability_y = output_yes / (output_yes + output_no) probability_n = output_no / (output_yes + output_no) if probability_y > probability_n: print('Yes You Can Play') elif probability_n > probability_y: print('No You Cant Play')
# https://www.codechef.com/problems/ADACRA for T in range(int(input())): s,u,d=input(),0,0 if(s[0]=='U'): u+=1 elif(s[0]=='D'): d+=1 for z in range(1,len(s)): if(s[z]=='D' and s[z-1]=='U'): d+=1 elif(s[z]=='U' and s[z-1]=='D'): u+=1 print(min(d,u))
for t in range(int(input())): (s, u, d) = (input(), 0, 0) if s[0] == 'U': u += 1 elif s[0] == 'D': d += 1 for z in range(1, len(s)): if s[z] == 'D' and s[z - 1] == 'U': d += 1 elif s[z] == 'U' and s[z - 1] == 'D': u += 1 print(min(d, u))
__author__ = 'fengyuyao' class Node(object): pass
__author__ = 'fengyuyao' class Node(object): pass
pynasqmin = ''\ '# -*- Mode: json -*-\n'\ '############################################################\n'\ '# HPC Info (Slurm Supported)\n'\ '############################################################\n'\ '# Change here whether you are working on your personal computer\n'\ '# or an HPC with SLURM\n'\ ' "is_hpc": "False",\n'\ '# If on hpc, what is the name of your job?\n'\ ' "job_name": "job_name",\n'\ '# How many nodes will you be working on?\n'\ ' "number_nodes": "1",\n'\ '# How many processors will be on a node?\n'\ ' "processors_per_node": "16",\n'\ '# How much memory per node, provide string\n'\ ' "memory_per_node": "2000mb",\n'\ '# What is the maximum amount of jobs you want to run at once?\n'\ ' "max_jobs": "4",\n'\ '# What do you want to set as your default walltime?\n'\ '# 0h:0m:0s\n'\ ' "walltime": "95:00:00",\n'\ '# Whats queue do you want the job to go to\n'\ ' "qos": "YourQOS",\n'\ '# These are your email options for the slurm interface\n'\ ' "email": "YourEmail",\n'\ '# Additive Choice: 1-Begin, 2-End, 4-Fail\n'\ ' "email_options": "3",\n'\ '############################################################\n'\ '# General Job Type\n'\ '############################################################\n'\ '# Change here whether your simulation is qmmm\n'\ ' "is_qmmm": "True",\n'\ '# If periodic what type of constant value are you using?\n'\ '# 1-constant volume, 2-constant pressure\n'\ ' "constant_value": "1",\n'\ '# Are you performing tully surface hopping?\n'\ ' "is_tully": "False",\n'\ '# If you are using tully, how many quantum steps should be performed for every classical?\n'\ ' "qsteps": "4",\n'\ '# Change here the time step, in fs, that will be shared by\n'\ '# each trajectory\n'\ ' "time_step": "0.5",\n'\ '############################################################\n'\ '# MM Ground State Calculation\n'\ '############################################################\n'\ '# Do you want to run ground state dynamics\n'\ ' "run_ground_state_dynamics": "False",\n'\ '# Change here the runtime, in ps, of the initial ground state MD\n'\ ' "ground_state_run_time": "0.01",\n'\ '# Change here the time step, in fs, that will be used by\n'\ '# the mm ground state trajectory\n'\ ' "ground_state_time_step": "0.5",\n'\ '# Change here the number of restarts of length ground_state_run_time you wish to run\n'\ ' "n_ground_runs": "2",\n'\ '# Change here how often you want to print the ground state trajectory files\n'\ ' "n_steps_to_print_gmcrd": "5",\n'\ '# Change here how often you want to print the ground state trajectory\n'\ ' "n_steps_to_print_gs": "5",\n'\ '############################################################\n'\ '# QM Ground State Calculation\n'\ '############################################################\n'\ '# Do you want to run the trajectories used for the abjorption specta\n'\ ' "run_qmground_trajectories": "False",\n'\ '# Change here the number of snapshots you wish to take\n'\ '# from the initial ground state trajectory to run the\n'\ '# further ground state dynamics\n'\ ' "n_snapshots_qmground": "2",\n'\ '# File listing the trajectories you wish to run\n'\ '# Leave black to run all\n'\ ' "qmground_traj_index_file": "",\n'\ '# Change here the runtime in PS for the the trajectories\n'\ '# used to create calculated the absorption\n'\ ' "qmground_run_time": "0.004",\n'\ '# Change here the time step, in fs, that will be used by\n'\ '# the qm ground state trajectory\n'\ ' "qmground_time_step": "0.5",\n'\ '# Number of restarts = this number - 1. Controls how you want to segmentate\n'\ '# the runs for shorter run times, and to allow restarting if failure arises\n'\ ' "n_qmground_runs": "1",\n'\ '# Change here how often you want to print the absorption trajectory files\n'\ '# Use -1 to skip\n'\ ' "n_steps_to_print_qmgmcrd": "5",\n'\ '# Change here how often you want to print the absorption trajectories\n'\ ' "n_steps_to_print_qmground": "4",\n'\ '# Change here the number of states you wish to\n'\ '# include in the qmground state trajectories.\n'\ '# If unsure, this should be 0\n'\ ' "n_qmground_exc": "5",\n'\ '############################################################\n'\ '# Absorption\n'\ '############################################################\n'\ '# Do you want to run the single point snapshots from these\n'\ '# absorption\n'\ ' "run_absorption_snapshots": "False",\n'\ '# How many excited states do you want to include in the absorption\n'\ '# calculation\n'\ ' "n_abs_exc": "10",\n'\ '# Do you want to collect the data from the absorption calculations?\n'\ ' "run_absorption_collection": "False",\n'\ '# Some time will be needed for the molecule to equilibrate\n'\ '# from jumping from the MM to QM\n'\ '# We don\'t want to include this data in the calculation\n'\ '# We therefore set a time delay in fs.\n'\ ' "absorption_time_delay": "000",\n'\ '############################################################\n'\ '# Excited State Calculation\n'\ '############################################################\n'\ '# Do you want to run the exctied state trajectories?\n'\ ' "run_excited_state_trajectories": "False",\n'\ '# Change here the number of snapshots you wish to take\n'\ '# from the initial ground state trajectory to run the\n'\ '# new excited state dynamics. Needs to be <= n_snapshots_gs\n'\ ' "n_snapshots_ex": "2",\n'\ '# File listing the trajectories you wish to run\n'\ '# Leave black to run all\n'\ ' "qmexcited_traj_index_file": "",\n'\ '# Change here the runtime, in ps, for the the trajectories\n'\ '# used to create calculated the fluorescence\n'\ ' "exc_run_time": "0.002",\n'\ '# Change here the time step, in fs, that will be used by\n'\ '# the qm excited state trajectory\n'\ ' "exc_time_step": "0.5",\n'\ '# Number of restarts = this number - 1. Controls how you want to segmentate\n'\ '# the runs for shorter run times, and to allow restarting if failure arises\n'\ ' "n_exc_runs": "2",\n'\ '# Change here how often you want to print the excited state trajectory files\n'\ '# Use -1 to skip\n'\ ' "n_steps_to_print_emcrd": "5",\n'\ '# Change here how often you want to print the excited state trajectories\n'\ ' "n_steps_to_print_exc": "10",\n'\ '# Change here the number of excited states you\n'\ '# with to have in the CIS calculation\n'\ ' "n_exc_states_propagate": "5",\n'\ '# Change here the initial state, set to "-1" if you want to simulate laser exitation.\n'\ '# Change to -2 for pump pulse simulation\n'\ ' "exc_state_init": "1",\n'\ '# Change here the energy of the laser used for excitation?\n'\ ' "laser_energy": "4.2",\n'\ '# Change here the full width half max of the laser in fs\n'\ '# Note that 100fs FWHM of a laser will correspond to a 0.1621eV FWHM FC broadening\n'\ '# Conversion is E_ev = 16.21 / E_fs\n'\ ' "fwhm": "100",\n'\ '############################################################\n'\ '# Fluorescence\n'\ '############################################################\n'\ '# Do you want to collect the data from the exctied state trajectory\n'\ '# calculations?\n'\ ' "run_fluorescence_collection": "False",\n'\ '# Some time will be needed for the molecule to equilibrate\n'\ '# from jumping from the ground state to the excited state.\n'\ '# We don\'t want to include this data in the calculation\n'\ '# of the fluorescence. We therefore set a time delay in fs.\n'\ ' "fluorescence_time_delay": "0000",\n'\ '# Truncation will remove so many fs off the back of the trajectory\n'\ ' "fluorescence_time_truncation": "0000",\n'\ '############################################################\n'\ '# QM Solvents\n'\ '############################################################\n'\ '# Do you want to restrain the closest solvents?\n'\ ' "restrain_solvents": "False",\n'\ '# The amber mask to determine the center of your system\n'\ ' "mask_for_center": ":1",\n'\ '# Number of solvents closest to mask to include in qm\n'\ ' "number_nearest_solvents": "0"\n'\ '\n'
pynasqmin = '# -*- Mode: json -*-\n############################################################\n# HPC Info (Slurm Supported)\n############################################################\n# Change here whether you are working on your personal computer\n# or an HPC with SLURM\n "is_hpc": "False",\n# If on hpc, what is the name of your job?\n "job_name": "job_name",\n# How many nodes will you be working on?\n "number_nodes": "1",\n# How many processors will be on a node?\n "processors_per_node": "16",\n# How much memory per node, provide string\n "memory_per_node": "2000mb",\n# What is the maximum amount of jobs you want to run at once?\n "max_jobs": "4",\n# What do you want to set as your default walltime?\n# 0h:0m:0s\n "walltime": "95:00:00",\n# Whats queue do you want the job to go to\n "qos": "YourQOS",\n# These are your email options for the slurm interface\n "email": "YourEmail",\n# Additive Choice: 1-Begin, 2-End, 4-Fail\n "email_options": "3",\n############################################################\n# General Job Type\n############################################################\n# Change here whether your simulation is qmmm\n "is_qmmm": "True",\n# If periodic what type of constant value are you using?\n# 1-constant volume, 2-constant pressure\n "constant_value": "1",\n# Are you performing tully surface hopping?\n "is_tully": "False",\n# If you are using tully, how many quantum steps should be performed for every classical?\n "qsteps": "4",\n# Change here the time step, in fs, that will be shared by\n# each trajectory\n "time_step": "0.5",\n############################################################\n# MM Ground State Calculation\n############################################################\n# Do you want to run ground state dynamics\n "run_ground_state_dynamics": "False",\n# Change here the runtime, in ps, of the initial ground state MD\n "ground_state_run_time": "0.01",\n# Change here the time step, in fs, that will be used by\n# the mm ground state trajectory\n "ground_state_time_step": "0.5",\n# Change here the number of restarts of length ground_state_run_time you wish to run\n "n_ground_runs": "2",\n# Change here how often you want to print the ground state trajectory files\n "n_steps_to_print_gmcrd": "5",\n# Change here how often you want to print the ground state trajectory\n "n_steps_to_print_gs": "5",\n############################################################\n# QM Ground State Calculation\n############################################################\n# Do you want to run the trajectories used for the abjorption specta\n "run_qmground_trajectories": "False",\n# Change here the number of snapshots you wish to take\n# from the initial ground state trajectory to run the\n# further ground state dynamics\n "n_snapshots_qmground": "2",\n# File listing the trajectories you wish to run\n# Leave black to run all\n "qmground_traj_index_file": "",\n# Change here the runtime in PS for the the trajectories\n# used to create calculated the absorption\n "qmground_run_time": "0.004",\n# Change here the time step, in fs, that will be used by\n# the qm ground state trajectory\n "qmground_time_step": "0.5",\n# Number of restarts = this number - 1. Controls how you want to segmentate\n# the runs for shorter run times, and to allow restarting if failure arises\n "n_qmground_runs": "1",\n# Change here how often you want to print the absorption trajectory files\n# Use -1 to skip\n "n_steps_to_print_qmgmcrd": "5",\n# Change here how often you want to print the absorption trajectories\n "n_steps_to_print_qmground": "4",\n# Change here the number of states you wish to\n# include in the qmground state trajectories.\n# If unsure, this should be 0\n "n_qmground_exc": "5",\n############################################################\n# Absorption\n############################################################\n# Do you want to run the single point snapshots from these\n# absorption\n "run_absorption_snapshots": "False",\n# How many excited states do you want to include in the absorption\n# calculation\n "n_abs_exc": "10",\n# Do you want to collect the data from the absorption calculations?\n "run_absorption_collection": "False",\n# Some time will be needed for the molecule to equilibrate\n# from jumping from the MM to QM\n# We don\'t want to include this data in the calculation\n# We therefore set a time delay in fs.\n "absorption_time_delay": "000",\n############################################################\n# Excited State Calculation\n############################################################\n# Do you want to run the exctied state trajectories?\n "run_excited_state_trajectories": "False",\n# Change here the number of snapshots you wish to take\n# from the initial ground state trajectory to run the\n# new excited state dynamics. Needs to be <= n_snapshots_gs\n "n_snapshots_ex": "2",\n# File listing the trajectories you wish to run\n# Leave black to run all\n "qmexcited_traj_index_file": "",\n# Change here the runtime, in ps, for the the trajectories\n# used to create calculated the fluorescence\n "exc_run_time": "0.002",\n# Change here the time step, in fs, that will be used by\n# the qm excited state trajectory\n "exc_time_step": "0.5",\n# Number of restarts = this number - 1. Controls how you want to segmentate\n# the runs for shorter run times, and to allow restarting if failure arises\n "n_exc_runs": "2",\n# Change here how often you want to print the excited state trajectory files\n# Use -1 to skip\n "n_steps_to_print_emcrd": "5",\n# Change here how often you want to print the excited state trajectories\n "n_steps_to_print_exc": "10",\n# Change here the number of excited states you\n# with to have in the CIS calculation\n "n_exc_states_propagate": "5",\n# Change here the initial state, set to "-1" if you want to simulate laser exitation.\n# Change to -2 for pump pulse simulation\n "exc_state_init": "1",\n# Change here the energy of the laser used for excitation?\n "laser_energy": "4.2",\n# Change here the full width half max of the laser in fs\n# Note that 100fs FWHM of a laser will correspond to a 0.1621eV FWHM FC broadening\n# Conversion is E_ev = 16.21 / E_fs\n "fwhm": "100",\n############################################################\n# Fluorescence\n############################################################\n# Do you want to collect the data from the exctied state trajectory\n# calculations?\n "run_fluorescence_collection": "False",\n# Some time will be needed for the molecule to equilibrate\n# from jumping from the ground state to the excited state.\n# We don\'t want to include this data in the calculation\n# of the fluorescence. We therefore set a time delay in fs.\n "fluorescence_time_delay": "0000",\n# Truncation will remove so many fs off the back of the trajectory\n "fluorescence_time_truncation": "0000",\n############################################################\n# QM Solvents\n############################################################\n# Do you want to restrain the closest solvents?\n "restrain_solvents": "False",\n# The amber mask to determine the center of your system\n "mask_for_center": ":1",\n# Number of solvents closest to mask to include in qm\n "number_nearest_solvents": "0"\n\n'
class OrderError(Exception): pass class DimensionError(Exception): pass class IncompatibleOrder(Exception): pass class InvalidOperation(Exception): pass class OperationNotAllowed(Exception): pass class OutOfRange(Exception): pass class ImprobableError(Exception): pass class UnacceptableToken(ValueError): pass class QueryError(Exception): pass class KindError(Exception): pass class Vague(Exception): pass class Void(Exception): pass class InvalidAttribute(AttributeError): pass class InconsistencyError(UnacceptableToken): pass class ConcurrenceError(Exception): pass class ActionDuplicationError(Exception): pass
class Ordererror(Exception): pass class Dimensionerror(Exception): pass class Incompatibleorder(Exception): pass class Invalidoperation(Exception): pass class Operationnotallowed(Exception): pass class Outofrange(Exception): pass class Improbableerror(Exception): pass class Unacceptabletoken(ValueError): pass class Queryerror(Exception): pass class Kinderror(Exception): pass class Vague(Exception): pass class Void(Exception): pass class Invalidattribute(AttributeError): pass class Inconsistencyerror(UnacceptableToken): pass class Concurrenceerror(Exception): pass class Actionduplicationerror(Exception): pass
level = { "Fresher" : list(range(20,36)), "Junior": list(range(36,51)), "Middle": list(range(51,76)), "Senior": list(range(76,101)) } keys = { "Frontend":{ "ReactJS":{ "Component": 6, "Redux": 6, "Hook": 5, "Event": 4, "Function Component": 3, "Class Component": 3, "React performance": 4, "Unit test": 3, "Unittest": 3, "RestAPI": 4, "Rest API": 4, "Scrum": 6, "HTML": 3, "CSS": 3, "jQuery": 4, "Javascript": 3, "Agile": 3, "Styled": 6 }, "VueJS":{ "Component": 6, "Rest API": 4, "Javascript": 3, "Event": 4, }, "Angular":{ "Component": 6, "Rest API": 4, "Javascript": 3, "Event": 4, } }, "Backend":{ ".Net":{ "Component": 6, "Rest API": 4, "API": 3, "serverless": 4, }, "Java":{ "Component": 6, "Rest API": 4, "API": 3, "serverless": 4, }, "PHP":{ "Lavarel": 6, "WordPress": 4, "API": 3, "serverless": 4, } }, "Mobile":{ }, "Tester":{ }, "Devops":{ }, "Fullstack":{ } }
level = {'Fresher': list(range(20, 36)), 'Junior': list(range(36, 51)), 'Middle': list(range(51, 76)), 'Senior': list(range(76, 101))} keys = {'Frontend': {'ReactJS': {'Component': 6, 'Redux': 6, 'Hook': 5, 'Event': 4, 'Function Component': 3, 'Class Component': 3, 'React performance': 4, 'Unit test': 3, 'Unittest': 3, 'RestAPI': 4, 'Rest API': 4, 'Scrum': 6, 'HTML': 3, 'CSS': 3, 'jQuery': 4, 'Javascript': 3, 'Agile': 3, 'Styled': 6}, 'VueJS': {'Component': 6, 'Rest API': 4, 'Javascript': 3, 'Event': 4}, 'Angular': {'Component': 6, 'Rest API': 4, 'Javascript': 3, 'Event': 4}}, 'Backend': {'.Net': {'Component': 6, 'Rest API': 4, 'API': 3, 'serverless': 4}, 'Java': {'Component': 6, 'Rest API': 4, 'API': 3, 'serverless': 4}, 'PHP': {'Lavarel': 6, 'WordPress': 4, 'API': 3, 'serverless': 4}}, 'Mobile': {}, 'Tester': {}, 'Devops': {}, 'Fullstack': {}}
# # PySNMP MIB module ASCEND-MIBVACM-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/ASCEND-MIBVACM-MIB # Produced by pysmi-0.3.4 at Mon Apr 29 17:12:49 2019 # On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4 # Using Python version 3.7.3 (default, Mar 27 2019, 09:23:15) # configuration, = mibBuilder.importSymbols("ASCEND-MIB", "configuration") ObjectIdentifier, OctetString, Integer = mibBuilder.importSymbols("ASN1", "ObjectIdentifier", "OctetString", "Integer") NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues") SingleValueConstraint, ValueRangeConstraint, ConstraintsIntersection, ConstraintsUnion, ValueSizeConstraint = mibBuilder.importSymbols("ASN1-REFINEMENT", "SingleValueConstraint", "ValueRangeConstraint", "ConstraintsIntersection", "ConstraintsUnion", "ValueSizeConstraint") ModuleCompliance, NotificationGroup = mibBuilder.importSymbols("SNMPv2-CONF", "ModuleCompliance", "NotificationGroup") Unsigned32, Integer32, ModuleIdentity, MibIdentifier, Counter64, iso, NotificationType, ObjectIdentity, Counter32, IpAddress, TimeTicks, Bits, MibScalar, MibTable, MibTableRow, MibTableColumn, Gauge32 = mibBuilder.importSymbols("SNMPv2-SMI", "Unsigned32", "Integer32", "ModuleIdentity", "MibIdentifier", "Counter64", "iso", "NotificationType", "ObjectIdentity", "Counter32", "IpAddress", "TimeTicks", "Bits", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "Gauge32") TextualConvention, DisplayString = mibBuilder.importSymbols("SNMPv2-TC", "TextualConvention", "DisplayString") class DisplayString(OctetString): pass mibvacmSecurityGroupProfile = MibIdentifier((1, 3, 6, 1, 4, 1, 529, 23, 135)) mibvacmViewTreeProfile = MibIdentifier((1, 3, 6, 1, 4, 1, 529, 23, 137)) mibvacmAccessProfile = MibIdentifier((1, 3, 6, 1, 4, 1, 529, 23, 136)) mibvacmSecurityGroupProfileTable = MibTable((1, 3, 6, 1, 4, 1, 529, 23, 135, 1), ) if mibBuilder.loadTexts: mibvacmSecurityGroupProfileTable.setStatus('mandatory') mibvacmSecurityGroupProfileEntry = MibTableRow((1, 3, 6, 1, 4, 1, 529, 23, 135, 1, 1), ).setIndexNames((0, "ASCEND-MIBVACM-MIB", "vacmSecurityGroupProfile-SecurityProperties-SecurityModel"), (0, "ASCEND-MIBVACM-MIB", "vacmSecurityGroupProfile-SecurityProperties-SecurityName")) if mibBuilder.loadTexts: mibvacmSecurityGroupProfileEntry.setStatus('mandatory') vacmSecurityGroupProfile_SecurityProperties_SecurityModel = MibScalar((1, 3, 6, 1, 4, 1, 529, 23, 135, 1, 1, 1), Integer32()).setLabel("vacmSecurityGroupProfile-SecurityProperties-SecurityModel").setMaxAccess("readonly") if mibBuilder.loadTexts: vacmSecurityGroupProfile_SecurityProperties_SecurityModel.setStatus('mandatory') vacmSecurityGroupProfile_SecurityProperties_SecurityName = MibScalar((1, 3, 6, 1, 4, 1, 529, 23, 135, 1, 1, 2), OctetString()).setLabel("vacmSecurityGroupProfile-SecurityProperties-SecurityName").setMaxAccess("readonly") if mibBuilder.loadTexts: vacmSecurityGroupProfile_SecurityProperties_SecurityName.setStatus('mandatory') vacmSecurityGroupProfile_Active = MibScalar((1, 3, 6, 1, 4, 1, 529, 23, 135, 1, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("no", 1), ("yes", 2)))).setLabel("vacmSecurityGroupProfile-Active").setMaxAccess("readwrite") if mibBuilder.loadTexts: vacmSecurityGroupProfile_Active.setStatus('mandatory') vacmSecurityGroupProfile_GroupName = MibScalar((1, 3, 6, 1, 4, 1, 529, 23, 135, 1, 1, 4), OctetString()).setLabel("vacmSecurityGroupProfile-GroupName").setMaxAccess("readwrite") if mibBuilder.loadTexts: vacmSecurityGroupProfile_GroupName.setStatus('mandatory') vacmSecurityGroupProfile_Action_o = MibScalar((1, 3, 6, 1, 4, 1, 529, 23, 135, 1, 1, 5), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("noAction", 1), ("createProfile", 2), ("deleteProfile", 3)))).setLabel("vacmSecurityGroupProfile-Action-o").setMaxAccess("readwrite") if mibBuilder.loadTexts: vacmSecurityGroupProfile_Action_o.setStatus('mandatory') mibvacmViewTreeProfileTable = MibTable((1, 3, 6, 1, 4, 1, 529, 23, 137, 1), ) if mibBuilder.loadTexts: mibvacmViewTreeProfileTable.setStatus('mandatory') mibvacmViewTreeProfileEntry = MibTableRow((1, 3, 6, 1, 4, 1, 529, 23, 137, 1, 1), ).setIndexNames((0, "ASCEND-MIBVACM-MIB", "vacmViewTreeProfile-TreeProperties-ViewName"), (0, "ASCEND-MIBVACM-MIB", "vacmViewTreeProfile-TreeProperties-ViewTreeOid")) if mibBuilder.loadTexts: mibvacmViewTreeProfileEntry.setStatus('mandatory') vacmViewTreeProfile_TreeProperties_ViewName = MibScalar((1, 3, 6, 1, 4, 1, 529, 23, 137, 1, 1, 1), OctetString()).setLabel("vacmViewTreeProfile-TreeProperties-ViewName").setMaxAccess("readonly") if mibBuilder.loadTexts: vacmViewTreeProfile_TreeProperties_ViewName.setStatus('mandatory') vacmViewTreeProfile_TreeProperties_ViewTreeOid = MibScalar((1, 3, 6, 1, 4, 1, 529, 23, 137, 1, 1, 2), DisplayString()).setLabel("vacmViewTreeProfile-TreeProperties-ViewTreeOid").setMaxAccess("readonly") if mibBuilder.loadTexts: vacmViewTreeProfile_TreeProperties_ViewTreeOid.setStatus('mandatory') vacmViewTreeProfile_Active = MibScalar((1, 3, 6, 1, 4, 1, 529, 23, 137, 1, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("no", 1), ("yes", 2)))).setLabel("vacmViewTreeProfile-Active").setMaxAccess("readwrite") if mibBuilder.loadTexts: vacmViewTreeProfile_Active.setStatus('mandatory') vacmViewTreeProfile_TreeOidMask = MibScalar((1, 3, 6, 1, 4, 1, 529, 23, 137, 1, 1, 4), DisplayString()).setLabel("vacmViewTreeProfile-TreeOidMask").setMaxAccess("readwrite") if mibBuilder.loadTexts: vacmViewTreeProfile_TreeOidMask.setStatus('mandatory') vacmViewTreeProfile_TreeType = MibScalar((1, 3, 6, 1, 4, 1, 529, 23, 137, 1, 1, 5), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(2, 3))).clone(namedValues=NamedValues(("included", 2), ("excluded", 3)))).setLabel("vacmViewTreeProfile-TreeType").setMaxAccess("readwrite") if mibBuilder.loadTexts: vacmViewTreeProfile_TreeType.setStatus('mandatory') vacmViewTreeProfile_Action_o = MibScalar((1, 3, 6, 1, 4, 1, 529, 23, 137, 1, 1, 6), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("noAction", 1), ("createProfile", 2), ("deleteProfile", 3)))).setLabel("vacmViewTreeProfile-Action-o").setMaxAccess("readwrite") if mibBuilder.loadTexts: vacmViewTreeProfile_Action_o.setStatus('mandatory') mibvacmAccessProfileTable = MibTable((1, 3, 6, 1, 4, 1, 529, 23, 136, 1), ) if mibBuilder.loadTexts: mibvacmAccessProfileTable.setStatus('mandatory') mibvacmAccessProfileEntry = MibTableRow((1, 3, 6, 1, 4, 1, 529, 23, 136, 1, 1), ).setIndexNames((0, "ASCEND-MIBVACM-MIB", "vacmAccessProfile-AccessProperties-GroupName"), (0, "ASCEND-MIBVACM-MIB", "vacmAccessProfile-AccessProperties-ContextPrefix"), (0, "ASCEND-MIBVACM-MIB", "vacmAccessProfile-AccessProperties-SecurityModel"), (0, "ASCEND-MIBVACM-MIB", "vacmAccessProfile-AccessProperties-SecurityLevel")) if mibBuilder.loadTexts: mibvacmAccessProfileEntry.setStatus('mandatory') vacmAccessProfile_AccessProperties_GroupName = MibScalar((1, 3, 6, 1, 4, 1, 529, 23, 136, 1, 1, 1), OctetString()).setLabel("vacmAccessProfile-AccessProperties-GroupName").setMaxAccess("readonly") if mibBuilder.loadTexts: vacmAccessProfile_AccessProperties_GroupName.setStatus('mandatory') vacmAccessProfile_AccessProperties_ContextPrefix = MibScalar((1, 3, 6, 1, 4, 1, 529, 23, 136, 1, 1, 2), OctetString()).setLabel("vacmAccessProfile-AccessProperties-ContextPrefix").setMaxAccess("readonly") if mibBuilder.loadTexts: vacmAccessProfile_AccessProperties_ContextPrefix.setStatus('mandatory') vacmAccessProfile_AccessProperties_SecurityModel = MibScalar((1, 3, 6, 1, 4, 1, 529, 23, 136, 1, 1, 3), Integer32()).setLabel("vacmAccessProfile-AccessProperties-SecurityModel").setMaxAccess("readonly") if mibBuilder.loadTexts: vacmAccessProfile_AccessProperties_SecurityModel.setStatus('mandatory') vacmAccessProfile_AccessProperties_SecurityLevel = MibScalar((1, 3, 6, 1, 4, 1, 529, 23, 136, 1, 1, 4), Integer32()).setLabel("vacmAccessProfile-AccessProperties-SecurityLevel").setMaxAccess("readonly") if mibBuilder.loadTexts: vacmAccessProfile_AccessProperties_SecurityLevel.setStatus('mandatory') vacmAccessProfile_Active = MibScalar((1, 3, 6, 1, 4, 1, 529, 23, 136, 1, 1, 5), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("no", 1), ("yes", 2)))).setLabel("vacmAccessProfile-Active").setMaxAccess("readwrite") if mibBuilder.loadTexts: vacmAccessProfile_Active.setStatus('mandatory') vacmAccessProfile_MatchMethod = MibScalar((1, 3, 6, 1, 4, 1, 529, 23, 136, 1, 1, 6), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(2, 3))).clone(namedValues=NamedValues(("exactMatch", 2), ("prefixMatch", 3)))).setLabel("vacmAccessProfile-MatchMethod").setMaxAccess("readwrite") if mibBuilder.loadTexts: vacmAccessProfile_MatchMethod.setStatus('mandatory') vacmAccessProfile_ReadViewName = MibScalar((1, 3, 6, 1, 4, 1, 529, 23, 136, 1, 1, 7), OctetString()).setLabel("vacmAccessProfile-ReadViewName").setMaxAccess("readwrite") if mibBuilder.loadTexts: vacmAccessProfile_ReadViewName.setStatus('mandatory') vacmAccessProfile_WriteViewName = MibScalar((1, 3, 6, 1, 4, 1, 529, 23, 136, 1, 1, 8), OctetString()).setLabel("vacmAccessProfile-WriteViewName").setMaxAccess("readwrite") if mibBuilder.loadTexts: vacmAccessProfile_WriteViewName.setStatus('mandatory') vacmAccessProfile_NotifyViewName = MibScalar((1, 3, 6, 1, 4, 1, 529, 23, 136, 1, 1, 9), OctetString()).setLabel("vacmAccessProfile-NotifyViewName").setMaxAccess("readwrite") if mibBuilder.loadTexts: vacmAccessProfile_NotifyViewName.setStatus('mandatory') vacmAccessProfile_Action_o = MibScalar((1, 3, 6, 1, 4, 1, 529, 23, 136, 1, 1, 10), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("noAction", 1), ("createProfile", 2), ("deleteProfile", 3)))).setLabel("vacmAccessProfile-Action-o").setMaxAccess("readwrite") if mibBuilder.loadTexts: vacmAccessProfile_Action_o.setStatus('mandatory') mibBuilder.exportSymbols("ASCEND-MIBVACM-MIB", vacmAccessProfile_Active=vacmAccessProfile_Active, vacmAccessProfile_AccessProperties_SecurityModel=vacmAccessProfile_AccessProperties_SecurityModel, mibvacmSecurityGroupProfileTable=mibvacmSecurityGroupProfileTable, vacmSecurityGroupProfile_Active=vacmSecurityGroupProfile_Active, mibvacmViewTreeProfileEntry=mibvacmViewTreeProfileEntry, mibvacmAccessProfile=mibvacmAccessProfile, mibvacmAccessProfileEntry=mibvacmAccessProfileEntry, vacmAccessProfile_Action_o=vacmAccessProfile_Action_o, vacmViewTreeProfile_Action_o=vacmViewTreeProfile_Action_o, vacmAccessProfile_ReadViewName=vacmAccessProfile_ReadViewName, mibvacmAccessProfileTable=mibvacmAccessProfileTable, vacmAccessProfile_MatchMethod=vacmAccessProfile_MatchMethod, vacmAccessProfile_AccessProperties_GroupName=vacmAccessProfile_AccessProperties_GroupName, DisplayString=DisplayString, vacmSecurityGroupProfile_SecurityProperties_SecurityModel=vacmSecurityGroupProfile_SecurityProperties_SecurityModel, vacmAccessProfile_WriteViewName=vacmAccessProfile_WriteViewName, mibvacmViewTreeProfileTable=mibvacmViewTreeProfileTable, vacmAccessProfile_AccessProperties_ContextPrefix=vacmAccessProfile_AccessProperties_ContextPrefix, mibvacmSecurityGroupProfileEntry=mibvacmSecurityGroupProfileEntry, vacmSecurityGroupProfile_SecurityProperties_SecurityName=vacmSecurityGroupProfile_SecurityProperties_SecurityName, vacmSecurityGroupProfile_GroupName=vacmSecurityGroupProfile_GroupName, vacmAccessProfile_AccessProperties_SecurityLevel=vacmAccessProfile_AccessProperties_SecurityLevel, vacmViewTreeProfile_TreeProperties_ViewTreeOid=vacmViewTreeProfile_TreeProperties_ViewTreeOid, vacmViewTreeProfile_Active=vacmViewTreeProfile_Active, vacmViewTreeProfile_TreeProperties_ViewName=vacmViewTreeProfile_TreeProperties_ViewName, mibvacmViewTreeProfile=mibvacmViewTreeProfile, vacmAccessProfile_NotifyViewName=vacmAccessProfile_NotifyViewName, mibvacmSecurityGroupProfile=mibvacmSecurityGroupProfile, vacmSecurityGroupProfile_Action_o=vacmSecurityGroupProfile_Action_o, vacmViewTreeProfile_TreeOidMask=vacmViewTreeProfile_TreeOidMask, vacmViewTreeProfile_TreeType=vacmViewTreeProfile_TreeType)
(configuration,) = mibBuilder.importSymbols('ASCEND-MIB', 'configuration') (object_identifier, octet_string, integer) = mibBuilder.importSymbols('ASN1', 'ObjectIdentifier', 'OctetString', 'Integer') (named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues') (single_value_constraint, value_range_constraint, constraints_intersection, constraints_union, value_size_constraint) = mibBuilder.importSymbols('ASN1-REFINEMENT', 'SingleValueConstraint', 'ValueRangeConstraint', 'ConstraintsIntersection', 'ConstraintsUnion', 'ValueSizeConstraint') (module_compliance, notification_group) = mibBuilder.importSymbols('SNMPv2-CONF', 'ModuleCompliance', 'NotificationGroup') (unsigned32, integer32, module_identity, mib_identifier, counter64, iso, notification_type, object_identity, counter32, ip_address, time_ticks, bits, mib_scalar, mib_table, mib_table_row, mib_table_column, gauge32) = mibBuilder.importSymbols('SNMPv2-SMI', 'Unsigned32', 'Integer32', 'ModuleIdentity', 'MibIdentifier', 'Counter64', 'iso', 'NotificationType', 'ObjectIdentity', 'Counter32', 'IpAddress', 'TimeTicks', 'Bits', 'MibScalar', 'MibTable', 'MibTableRow', 'MibTableColumn', 'Gauge32') (textual_convention, display_string) = mibBuilder.importSymbols('SNMPv2-TC', 'TextualConvention', 'DisplayString') class Displaystring(OctetString): pass mibvacm_security_group_profile = mib_identifier((1, 3, 6, 1, 4, 1, 529, 23, 135)) mibvacm_view_tree_profile = mib_identifier((1, 3, 6, 1, 4, 1, 529, 23, 137)) mibvacm_access_profile = mib_identifier((1, 3, 6, 1, 4, 1, 529, 23, 136)) mibvacm_security_group_profile_table = mib_table((1, 3, 6, 1, 4, 1, 529, 23, 135, 1)) if mibBuilder.loadTexts: mibvacmSecurityGroupProfileTable.setStatus('mandatory') mibvacm_security_group_profile_entry = mib_table_row((1, 3, 6, 1, 4, 1, 529, 23, 135, 1, 1)).setIndexNames((0, 'ASCEND-MIBVACM-MIB', 'vacmSecurityGroupProfile-SecurityProperties-SecurityModel'), (0, 'ASCEND-MIBVACM-MIB', 'vacmSecurityGroupProfile-SecurityProperties-SecurityName')) if mibBuilder.loadTexts: mibvacmSecurityGroupProfileEntry.setStatus('mandatory') vacm_security_group_profile__security_properties__security_model = mib_scalar((1, 3, 6, 1, 4, 1, 529, 23, 135, 1, 1, 1), integer32()).setLabel('vacmSecurityGroupProfile-SecurityProperties-SecurityModel').setMaxAccess('readonly') if mibBuilder.loadTexts: vacmSecurityGroupProfile_SecurityProperties_SecurityModel.setStatus('mandatory') vacm_security_group_profile__security_properties__security_name = mib_scalar((1, 3, 6, 1, 4, 1, 529, 23, 135, 1, 1, 2), octet_string()).setLabel('vacmSecurityGroupProfile-SecurityProperties-SecurityName').setMaxAccess('readonly') if mibBuilder.loadTexts: vacmSecurityGroupProfile_SecurityProperties_SecurityName.setStatus('mandatory') vacm_security_group_profile__active = mib_scalar((1, 3, 6, 1, 4, 1, 529, 23, 135, 1, 1, 3), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('no', 1), ('yes', 2)))).setLabel('vacmSecurityGroupProfile-Active').setMaxAccess('readwrite') if mibBuilder.loadTexts: vacmSecurityGroupProfile_Active.setStatus('mandatory') vacm_security_group_profile__group_name = mib_scalar((1, 3, 6, 1, 4, 1, 529, 23, 135, 1, 1, 4), octet_string()).setLabel('vacmSecurityGroupProfile-GroupName').setMaxAccess('readwrite') if mibBuilder.loadTexts: vacmSecurityGroupProfile_GroupName.setStatus('mandatory') vacm_security_group_profile__action_o = mib_scalar((1, 3, 6, 1, 4, 1, 529, 23, 135, 1, 1, 5), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3))).clone(namedValues=named_values(('noAction', 1), ('createProfile', 2), ('deleteProfile', 3)))).setLabel('vacmSecurityGroupProfile-Action-o').setMaxAccess('readwrite') if mibBuilder.loadTexts: vacmSecurityGroupProfile_Action_o.setStatus('mandatory') mibvacm_view_tree_profile_table = mib_table((1, 3, 6, 1, 4, 1, 529, 23, 137, 1)) if mibBuilder.loadTexts: mibvacmViewTreeProfileTable.setStatus('mandatory') mibvacm_view_tree_profile_entry = mib_table_row((1, 3, 6, 1, 4, 1, 529, 23, 137, 1, 1)).setIndexNames((0, 'ASCEND-MIBVACM-MIB', 'vacmViewTreeProfile-TreeProperties-ViewName'), (0, 'ASCEND-MIBVACM-MIB', 'vacmViewTreeProfile-TreeProperties-ViewTreeOid')) if mibBuilder.loadTexts: mibvacmViewTreeProfileEntry.setStatus('mandatory') vacm_view_tree_profile__tree_properties__view_name = mib_scalar((1, 3, 6, 1, 4, 1, 529, 23, 137, 1, 1, 1), octet_string()).setLabel('vacmViewTreeProfile-TreeProperties-ViewName').setMaxAccess('readonly') if mibBuilder.loadTexts: vacmViewTreeProfile_TreeProperties_ViewName.setStatus('mandatory') vacm_view_tree_profile__tree_properties__view_tree_oid = mib_scalar((1, 3, 6, 1, 4, 1, 529, 23, 137, 1, 1, 2), display_string()).setLabel('vacmViewTreeProfile-TreeProperties-ViewTreeOid').setMaxAccess('readonly') if mibBuilder.loadTexts: vacmViewTreeProfile_TreeProperties_ViewTreeOid.setStatus('mandatory') vacm_view_tree_profile__active = mib_scalar((1, 3, 6, 1, 4, 1, 529, 23, 137, 1, 1, 3), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('no', 1), ('yes', 2)))).setLabel('vacmViewTreeProfile-Active').setMaxAccess('readwrite') if mibBuilder.loadTexts: vacmViewTreeProfile_Active.setStatus('mandatory') vacm_view_tree_profile__tree_oid_mask = mib_scalar((1, 3, 6, 1, 4, 1, 529, 23, 137, 1, 1, 4), display_string()).setLabel('vacmViewTreeProfile-TreeOidMask').setMaxAccess('readwrite') if mibBuilder.loadTexts: vacmViewTreeProfile_TreeOidMask.setStatus('mandatory') vacm_view_tree_profile__tree_type = mib_scalar((1, 3, 6, 1, 4, 1, 529, 23, 137, 1, 1, 5), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(2, 3))).clone(namedValues=named_values(('included', 2), ('excluded', 3)))).setLabel('vacmViewTreeProfile-TreeType').setMaxAccess('readwrite') if mibBuilder.loadTexts: vacmViewTreeProfile_TreeType.setStatus('mandatory') vacm_view_tree_profile__action_o = mib_scalar((1, 3, 6, 1, 4, 1, 529, 23, 137, 1, 1, 6), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3))).clone(namedValues=named_values(('noAction', 1), ('createProfile', 2), ('deleteProfile', 3)))).setLabel('vacmViewTreeProfile-Action-o').setMaxAccess('readwrite') if mibBuilder.loadTexts: vacmViewTreeProfile_Action_o.setStatus('mandatory') mibvacm_access_profile_table = mib_table((1, 3, 6, 1, 4, 1, 529, 23, 136, 1)) if mibBuilder.loadTexts: mibvacmAccessProfileTable.setStatus('mandatory') mibvacm_access_profile_entry = mib_table_row((1, 3, 6, 1, 4, 1, 529, 23, 136, 1, 1)).setIndexNames((0, 'ASCEND-MIBVACM-MIB', 'vacmAccessProfile-AccessProperties-GroupName'), (0, 'ASCEND-MIBVACM-MIB', 'vacmAccessProfile-AccessProperties-ContextPrefix'), (0, 'ASCEND-MIBVACM-MIB', 'vacmAccessProfile-AccessProperties-SecurityModel'), (0, 'ASCEND-MIBVACM-MIB', 'vacmAccessProfile-AccessProperties-SecurityLevel')) if mibBuilder.loadTexts: mibvacmAccessProfileEntry.setStatus('mandatory') vacm_access_profile__access_properties__group_name = mib_scalar((1, 3, 6, 1, 4, 1, 529, 23, 136, 1, 1, 1), octet_string()).setLabel('vacmAccessProfile-AccessProperties-GroupName').setMaxAccess('readonly') if mibBuilder.loadTexts: vacmAccessProfile_AccessProperties_GroupName.setStatus('mandatory') vacm_access_profile__access_properties__context_prefix = mib_scalar((1, 3, 6, 1, 4, 1, 529, 23, 136, 1, 1, 2), octet_string()).setLabel('vacmAccessProfile-AccessProperties-ContextPrefix').setMaxAccess('readonly') if mibBuilder.loadTexts: vacmAccessProfile_AccessProperties_ContextPrefix.setStatus('mandatory') vacm_access_profile__access_properties__security_model = mib_scalar((1, 3, 6, 1, 4, 1, 529, 23, 136, 1, 1, 3), integer32()).setLabel('vacmAccessProfile-AccessProperties-SecurityModel').setMaxAccess('readonly') if mibBuilder.loadTexts: vacmAccessProfile_AccessProperties_SecurityModel.setStatus('mandatory') vacm_access_profile__access_properties__security_level = mib_scalar((1, 3, 6, 1, 4, 1, 529, 23, 136, 1, 1, 4), integer32()).setLabel('vacmAccessProfile-AccessProperties-SecurityLevel').setMaxAccess('readonly') if mibBuilder.loadTexts: vacmAccessProfile_AccessProperties_SecurityLevel.setStatus('mandatory') vacm_access_profile__active = mib_scalar((1, 3, 6, 1, 4, 1, 529, 23, 136, 1, 1, 5), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('no', 1), ('yes', 2)))).setLabel('vacmAccessProfile-Active').setMaxAccess('readwrite') if mibBuilder.loadTexts: vacmAccessProfile_Active.setStatus('mandatory') vacm_access_profile__match_method = mib_scalar((1, 3, 6, 1, 4, 1, 529, 23, 136, 1, 1, 6), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(2, 3))).clone(namedValues=named_values(('exactMatch', 2), ('prefixMatch', 3)))).setLabel('vacmAccessProfile-MatchMethod').setMaxAccess('readwrite') if mibBuilder.loadTexts: vacmAccessProfile_MatchMethod.setStatus('mandatory') vacm_access_profile__read_view_name = mib_scalar((1, 3, 6, 1, 4, 1, 529, 23, 136, 1, 1, 7), octet_string()).setLabel('vacmAccessProfile-ReadViewName').setMaxAccess('readwrite') if mibBuilder.loadTexts: vacmAccessProfile_ReadViewName.setStatus('mandatory') vacm_access_profile__write_view_name = mib_scalar((1, 3, 6, 1, 4, 1, 529, 23, 136, 1, 1, 8), octet_string()).setLabel('vacmAccessProfile-WriteViewName').setMaxAccess('readwrite') if mibBuilder.loadTexts: vacmAccessProfile_WriteViewName.setStatus('mandatory') vacm_access_profile__notify_view_name = mib_scalar((1, 3, 6, 1, 4, 1, 529, 23, 136, 1, 1, 9), octet_string()).setLabel('vacmAccessProfile-NotifyViewName').setMaxAccess('readwrite') if mibBuilder.loadTexts: vacmAccessProfile_NotifyViewName.setStatus('mandatory') vacm_access_profile__action_o = mib_scalar((1, 3, 6, 1, 4, 1, 529, 23, 136, 1, 1, 10), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3))).clone(namedValues=named_values(('noAction', 1), ('createProfile', 2), ('deleteProfile', 3)))).setLabel('vacmAccessProfile-Action-o').setMaxAccess('readwrite') if mibBuilder.loadTexts: vacmAccessProfile_Action_o.setStatus('mandatory') mibBuilder.exportSymbols('ASCEND-MIBVACM-MIB', vacmAccessProfile_Active=vacmAccessProfile_Active, vacmAccessProfile_AccessProperties_SecurityModel=vacmAccessProfile_AccessProperties_SecurityModel, mibvacmSecurityGroupProfileTable=mibvacmSecurityGroupProfileTable, vacmSecurityGroupProfile_Active=vacmSecurityGroupProfile_Active, mibvacmViewTreeProfileEntry=mibvacmViewTreeProfileEntry, mibvacmAccessProfile=mibvacmAccessProfile, mibvacmAccessProfileEntry=mibvacmAccessProfileEntry, vacmAccessProfile_Action_o=vacmAccessProfile_Action_o, vacmViewTreeProfile_Action_o=vacmViewTreeProfile_Action_o, vacmAccessProfile_ReadViewName=vacmAccessProfile_ReadViewName, mibvacmAccessProfileTable=mibvacmAccessProfileTable, vacmAccessProfile_MatchMethod=vacmAccessProfile_MatchMethod, vacmAccessProfile_AccessProperties_GroupName=vacmAccessProfile_AccessProperties_GroupName, DisplayString=DisplayString, vacmSecurityGroupProfile_SecurityProperties_SecurityModel=vacmSecurityGroupProfile_SecurityProperties_SecurityModel, vacmAccessProfile_WriteViewName=vacmAccessProfile_WriteViewName, mibvacmViewTreeProfileTable=mibvacmViewTreeProfileTable, vacmAccessProfile_AccessProperties_ContextPrefix=vacmAccessProfile_AccessProperties_ContextPrefix, mibvacmSecurityGroupProfileEntry=mibvacmSecurityGroupProfileEntry, vacmSecurityGroupProfile_SecurityProperties_SecurityName=vacmSecurityGroupProfile_SecurityProperties_SecurityName, vacmSecurityGroupProfile_GroupName=vacmSecurityGroupProfile_GroupName, vacmAccessProfile_AccessProperties_SecurityLevel=vacmAccessProfile_AccessProperties_SecurityLevel, vacmViewTreeProfile_TreeProperties_ViewTreeOid=vacmViewTreeProfile_TreeProperties_ViewTreeOid, vacmViewTreeProfile_Active=vacmViewTreeProfile_Active, vacmViewTreeProfile_TreeProperties_ViewName=vacmViewTreeProfile_TreeProperties_ViewName, mibvacmViewTreeProfile=mibvacmViewTreeProfile, vacmAccessProfile_NotifyViewName=vacmAccessProfile_NotifyViewName, mibvacmSecurityGroupProfile=mibvacmSecurityGroupProfile, vacmSecurityGroupProfile_Action_o=vacmSecurityGroupProfile_Action_o, vacmViewTreeProfile_TreeOidMask=vacmViewTreeProfile_TreeOidMask, vacmViewTreeProfile_TreeType=vacmViewTreeProfile_TreeType)
def peer(parser,logic,logging,args=0): if args: if "ip" in args.keys() and "p" in args.keys(): ip = args["ip"][0] try: port = int(args["p"][0]) except: parser.print(args["p"][0]+": could not be cast to integer") return if "hid" in args.keys(): answer = logic.honeypot_peer(args["hid"],ip,port) for honeypot in answer.keys(): parser.print(honeypot+" peered to ip:"+answer[honeypot][0]+" port:"+str(answer[honeypot][1])) for h in args["hid"]: if h not in answer.keys(): parser.print(h+": did not respond") else: if logic.connect(ip,port): parser.print("Peered to ip:"+ip+" port:"+str(port)) else: parser.print("Could not peer to ip:"+ip+" port:"+str(port)) else: parser.print("Not all necessary parameters passed") else: parser.print("No Arguments passed")
def peer(parser, logic, logging, args=0): if args: if 'ip' in args.keys() and 'p' in args.keys(): ip = args['ip'][0] try: port = int(args['p'][0]) except: parser.print(args['p'][0] + ': could not be cast to integer') return if 'hid' in args.keys(): answer = logic.honeypot_peer(args['hid'], ip, port) for honeypot in answer.keys(): parser.print(honeypot + ' peered to ip:' + answer[honeypot][0] + ' port:' + str(answer[honeypot][1])) for h in args['hid']: if h not in answer.keys(): parser.print(h + ': did not respond') elif logic.connect(ip, port): parser.print('Peered to ip:' + ip + ' port:' + str(port)) else: parser.print('Could not peer to ip:' + ip + ' port:' + str(port)) else: parser.print('Not all necessary parameters passed') else: parser.print('No Arguments passed')
nc = str(input('Digite seu nome completo:')).strip() print('Maisculo: {}'.format(nc.upper())) print('Minusculo: {}'.format(nc.lower())) print('Total de letras: {}'.format(len(nc.replace(' ', '')))) dividido = nc.split() print('Total de letras do primeiro nome: {}'.format(len(dividido[0]))) nc2 = str(input('Digite seu nome completo:')).strip() print('Maisculo: {}'.format(nc2.upper())) print('Minusculo: {}'.format(nc2.lower())) print('Total de letras: {}'.format(len(nc2) - nc2.count(' '))) print('Total de letras do primeiro nome: {}'.format(nc2.find(' ')))
nc = str(input('Digite seu nome completo:')).strip() print('Maisculo: {}'.format(nc.upper())) print('Minusculo: {}'.format(nc.lower())) print('Total de letras: {}'.format(len(nc.replace(' ', '')))) dividido = nc.split() print('Total de letras do primeiro nome: {}'.format(len(dividido[0]))) nc2 = str(input('Digite seu nome completo:')).strip() print('Maisculo: {}'.format(nc2.upper())) print('Minusculo: {}'.format(nc2.lower())) print('Total de letras: {}'.format(len(nc2) - nc2.count(' '))) print('Total de letras do primeiro nome: {}'.format(nc2.find(' ')))
nCups = int(input()) cups = {} for i in range(nCups): line = input().split() if line[0].isnumeric(): cups[int(line[0])/2] = line[1] else: cups[int(line[1])] = line[0] print("\n".join([cups[k] for k in sorted(cups.keys())]))
n_cups = int(input()) cups = {} for i in range(nCups): line = input().split() if line[0].isnumeric(): cups[int(line[0]) / 2] = line[1] else: cups[int(line[1])] = line[0] print('\n'.join([cups[k] for k in sorted(cups.keys())]))
def test_args_kwargs(*args, **kwargs): for k in kwargs.keys(): print(k) test_args_kwargs(fire="hot", ice="cold")
def test_args_kwargs(*args, **kwargs): for k in kwargs.keys(): print(k) test_args_kwargs(fire='hot', ice='cold')
for episode in range(nb_episodes): callbacks.on_episode_begin(episode) episode_reward = 0. episode_step = 0 # Obtain the initial observation by resetting the environment. self.reset_states() observation = deepcopy(env.reset()) if self.processor is not None: observation = self.processor.process_observation(observation) assert observation is not None # Perform random starts at beginning of episode and do not record them into the experience. # This slightly changes the start position between games. nb_random_start_steps = 0 if nb_max_start_steps == 0 else np.random.randint(nb_max_start_steps) for _ in range(nb_random_start_steps): if start_step_policy is None: action = env.action_space.sample() else: action = start_step_policy(observation) if self.processor is not None: action = self.processor.process_action(action) callbacks.on_action_begin(action) observation, r, done, info = env.step(action) observation = deepcopy(observation) if self.processor is not None: observation, r, done, info = self.processor.process_step(observation, r, done, info) callbacks.on_action_end(action) if done: warnings.warn( 'Env ended before {} random steps could be performed at the start. You should probably lower the `nb_max_start_steps` parameter.'.format( nb_random_start_steps)) observation = deepcopy(env.reset()) if self.processor is not None: observation = self.processor.process_observation(observation) break # Run the episode until we're done. done = False while not done: callbacks.on_step_begin(episode_step) action = self.forward(observation) if self.processor is not None: action = self.processor.process_action(action) reward = 0. accumulated_info = {} for _ in range(action_repetition): callbacks.on_action_begin(action) observation, r, d, info = env.step(action) observation = deepcopy(observation) if self.processor is not None: observation, r, d, info = self.processor.process_step(observation, r, d, info) callbacks.on_action_end(action) reward += r for key, value in info.items(): if not np.isreal(value): continue if key not in accumulated_info: accumulated_info[key] = np.zeros_like(value) accumulated_info[key] += value if d: done = True break if nb_max_episode_steps and episode_step >= nb_max_episode_steps - 1: done = True self.backward(reward, terminal=done) episode_reward += reward step_logs = { 'action': action, 'observation': observation, 'reward': reward, 'episode': episode, 'info': accumulated_info, } callbacks.on_step_end(episode_step, step_logs) episode_step += 1 self.step += 1 # We are in a terminal state but the agent hasn't yet seen it. We therefore # perform one more forward-backward call and simply ignore the action before # resetting the environment. We need to pass in `terminal=False` here since # the *next* state, that is the state of the newly reset environment, is # always non-terminal by convention. self.forward(observation) self.backward(0., terminal=False) ################################ # env.trajectory() # basic = env.putout() # drz ################################ # Report end of episode. episode_logs = { 'episode_reward': episode_reward, 'nb_steps': episode_step, # 'episode_basic_data': basic } callbacks.on_episode_end(episode, episode_logs)
for episode in range(nb_episodes): callbacks.on_episode_begin(episode) episode_reward = 0.0 episode_step = 0 self.reset_states() observation = deepcopy(env.reset()) if self.processor is not None: observation = self.processor.process_observation(observation) assert observation is not None nb_random_start_steps = 0 if nb_max_start_steps == 0 else np.random.randint(nb_max_start_steps) for _ in range(nb_random_start_steps): if start_step_policy is None: action = env.action_space.sample() else: action = start_step_policy(observation) if self.processor is not None: action = self.processor.process_action(action) callbacks.on_action_begin(action) (observation, r, done, info) = env.step(action) observation = deepcopy(observation) if self.processor is not None: (observation, r, done, info) = self.processor.process_step(observation, r, done, info) callbacks.on_action_end(action) if done: warnings.warn('Env ended before {} random steps could be performed at the start. You should probably lower the `nb_max_start_steps` parameter.'.format(nb_random_start_steps)) observation = deepcopy(env.reset()) if self.processor is not None: observation = self.processor.process_observation(observation) break done = False while not done: callbacks.on_step_begin(episode_step) action = self.forward(observation) if self.processor is not None: action = self.processor.process_action(action) reward = 0.0 accumulated_info = {} for _ in range(action_repetition): callbacks.on_action_begin(action) (observation, r, d, info) = env.step(action) observation = deepcopy(observation) if self.processor is not None: (observation, r, d, info) = self.processor.process_step(observation, r, d, info) callbacks.on_action_end(action) reward += r for (key, value) in info.items(): if not np.isreal(value): continue if key not in accumulated_info: accumulated_info[key] = np.zeros_like(value) accumulated_info[key] += value if d: done = True break if nb_max_episode_steps and episode_step >= nb_max_episode_steps - 1: done = True self.backward(reward, terminal=done) episode_reward += reward step_logs = {'action': action, 'observation': observation, 'reward': reward, 'episode': episode, 'info': accumulated_info} callbacks.on_step_end(episode_step, step_logs) episode_step += 1 self.step += 1 self.forward(observation) self.backward(0.0, terminal=False) episode_logs = {'episode_reward': episode_reward, 'nb_steps': episode_step} callbacks.on_episode_end(episode, episode_logs)
# sources: http://www.atrixnet.com/bs-generator.html # https://en.wikipedia.org/wiki/List_of_buzzwords # http://cbsg.sourceforge.net/cgi-bin/live BUZZWORDS = { 'en': ['as a tier 1 company', 'paving the way for', 'relative to our peers', '-free', '200%', '24/365', '24/7', '360-degree', '360-degree thinking', '50/50', '99.9', 'ability to deliver', 'ability to move fast', 'above-average', 'accelerate', 'accelerate the strategy', 'accelerated', 'accelerating', 'accepted', 'accessible', 'accomplishment', 'account executive', 'accountability', 'accountable talk', 'acculturated', 'accurate', 'achieve', 'achieve efficiencies', 'across and beyond the', 'across geographies', 'across industry sectors', 'across our portfolio', 'across the', 'across the board', 'across the wider group', 'action forward', 'action item', 'action items', 'action plan', 'actionable', 'activate', 'active differentiation', 'actualize', 'adapt', 'adaptability', 'adaptive', 'address', 'address the overarching issues', 'adequate', 'adequately', 'administrate', 'adoptable', 'aggregate', 'aggregator', 'aggressive', 'aggressively', 'agile', 'agility', 'agreed-upon', 'ahead of schedule', 'alert', 'align resources', 'aligned', 'alignment', 'alternative', 'an expanded array of', 'analyse', 'analytic', 'analytics', 'analytics-based', 'applications', 'appropriately', 'architect', 'architectural approach', 'architecture', 'articulate', 'as a consequence of', 'as part of the plan', 'aspirations', 'assertive', 'asset', 'at the end of the day', 'at the individual, team and organizational level', 'atmosphere', 'attitude', 'attractive-enough', 'attractiveness', 'authoritatively', 'avoid', 'awareness', 'awesome', 'b2b', 'b2c', 'backward-compatible', 'balanced', 'balanced scorecard', 'ballpark figure', 'bandwidth', 'barriers', 'barriers to success', 'baseline starting point', 'be cautiously optimistic', 'be committed', 'because', 'benchmark', 'benchmark the portfolio', 'benchmarking', 'benefit', 'benefits', 'best of breed', 'best practice', 'best practices', 'best-in-class', 'best-of-breed', 'best-of-class', 'better-than-planned', 'bi-face', 'big data', 'big picture', 'big society', 'big-picture thinking', 'bizmeth', 'black swans', 'bleeding edge', 'bleeding-edge', 'blended approach', "bloom's taxonomy", 'board-level executives', 'book value growth', 'boost', 'bottom line', 'bottom-up', 'boundaryless', 'brand identity', 'brand image', 'brand manager', 'brand pyramid', 'brand value', 'branding', 'branding strategy', 'break through the clutter', 'breakneck', 'breakout', 'breakthrough', 'brick-and-mortar', 'bricks-and-clicks', 'bring to the table', 'bring your own device', 'broaden', 'broader thinking', 'build', 'build winning teams', 'bullet-proof', 'business case', 'business development', 'business enabling', 'business equation', 'business leaders', 'business line', 'business model', 'business philosophy', 'business platform', 'business-for-business', 'business-led', 'buzzword compliant', 'expanding boundaries', 'levelling the playing field', 'leveraging', 'nurturing talent', 'thinking and acting beyond boundaries', 'thinking outside of the box', 'calibrate', 'calibration', 'capability', 'capitalize on', 'carefully', 'carefully thought-out', 'cascading', 'case study', 'catalyst for growth', 'catalysts for change', 'category manager', 'cautiously', 'celebrate the success', 'centerpiece', 'centralized', 'challenge', 'challenge established ideas', 'challenge the status quo', 'challenging', 'challenging market conditions', 'champion', 'change', 'change management', 'channel', 'channels', 'circle back', 'clear goal', 'clear-cut', 'clicks-and-mortar', 'clickthrough', 'client event', 'client focus', 'client needs', 'client perspective', 'client satisfaction', 'client-based', 'client-centered', 'client-centric', 'client-oriented', 'close the loop', 'cloud', 'co-create', 'co-develop', 'co-innovation', 'co-opetition', 'cognitive', 'collaboration', 'collaborative', 'collateral', 'come to a landing', 'come-to-jesus moment', 'commitment', 'common core', 'communicate', 'communication', 'communities', 'community', 'compatible', 'compelling', 'competent', 'competently', 'competitive', 'competitive advantage', 'competitive success', 'competitiveness', 'compliance', 'compliant', 'comprehensive', 'concept', 'conceptualize', 'concerns', 'connect the dots', 'connect the dots to the end game', 'connectivity', 'conservatively', 'consistency', 'consistent', 'consistently', 'constraints', 'constructive', 'consumer-facing', 'consumer/agent disconnects', 'content', 'context-aware', 'continual', 'continually', 'continuity', 'control', 'control information system', 'control-based', 'controllable', 'controlled', 'conveniently', 'convergence', 'conversate', 'cooperative', 'coordinate', 'coordinated', 'core business', 'core capacity', 'core competencies', 'core competency', 'core meeting', 'cornerstone', 'corporate', 'corporate governance', 'corporate identity', 'correlation', 'cost effectiveness', 'cost efficiency', 'cost reduction', 'cost savings', 'cost-competitive', 'cost-effective', 'covalent', 'create long-term value', 'creative', 'credibility', 'credible', 'credibly', 'critical', 'cross fertilization', 'cross-breeding', 'cross-enterprise', 'cross-functional', 'cross-industry', 'cross-static', 'cross-platform', 'cross-sell message', 'cross-unit', 'cultivate', 'cultivate talent', 'cultural', 'culturally', 'culture', 'curated', 'customer centricity', 'customer directed', 'customer experience', 'customer footprint', 'customer service', 'customer-centric', 'customer-directed', 'customer-facing', 'customer-focused', 'customized', 'cutting-edge', 'dashboard', 'data-driven', 'day-to-day', 'decentralized', 'decision', 'decision making', 'decision-making', 'dedicated', 'dedication', 'deep dive', 'deep web', 'deepen', 'deliver', 'deliver on commitments', 'delivery framework', 'deploy', 'design pattern', 'design philosophy', 'develop the blue print for execution', 'develop the plan', 'dialogue', 'differentially', 'differentiate', 'differentiated', 'differentiating', 'differentiator', 'digital divide', 'digital economy', 'digital literacy', 'digital remastering', 'digital signage', 'diligently', 'dinintermediate disseminate', 'discipline', 'disciplined', 'disruptive', 'distinctive', 'distributed', 'diverse', 'diversification', 'diversifying', 'diversity', 'divisional structure', 'dna', 'do more with less', 'do the projects right', 'do the right projects', 'do things differently', 'document', 'document management', 'documented', 'dot-bomb', 'dotted line', 'double-digit', 'downsizing', 'downtimes', 'dramatic', 'dramatically', 'drill down', 'drill-down', 'drinking the kool-aid', 'drive', 'drive revenue', 'drive the business forward', 'dynamic', 'dynamics', 'e-commerce', 'e-learning', 'e-tailers', 'early-stage', 'eating your own dogfood', 'ebitda', 'economic value creation', 'economically sound', 'ecosystem', 'edge', 'educated', 'effective', 'effective execution', 'effectiveness', 'efficacy', 'efficiency', 'efficiency gain', 'efficient', 'efficient frontier', 'efficiently', 'elastic', 'elite', 'embrace', 'emerging', 'emotional impact', 'emotional intelligence', 'empower', 'empowerment', 'enable', 'enable customer interaction', 'enabler', 'end-to-end', 'energistically', 'energize', 'energy', 'enforce', 'engage', 'engagement', 'engineer', 'enhance', 'enhance the strength', 'enhanced', 'enhanced data capture', 'ensuring', 'enterprise', 'enterprise content management', 'enterprise risk management', 'enterprise-wide', 'enthusiastically', 'entitlement', 'entrepreneur', 'environment', 'envision', 'envisioneer', 'equity invested', 'escalation', 'establish', 'established', 'ethical', 'event horizon', 'evidence-based', 'evisculate', 'evolution', 'evolutionary', 'evolve', 'evolve our culture', 'exceed expectations', 'excellence', 'excellent', 'exceptional', 'execute', 'execute on priorities', 'execute the strategy', 'execution', 'executive', 'executive talent', 'executive-level', 'exit strategy', 'expanding', 'expansion', 'expectations and allocations', 'expediently', 'expedite', 'experiences', 'expertise', 'exploit', 'extensible', 'extensive', 'eyeballs', 'fabricate', 'face time', 'facilitate', 'facilitators', 'fact-based', 'fairness', 'far-reaching', 'fashion', 'fast-evolving', 'fast-growth', 'fast-track', 'feedback', 'feedback-based', 'fierce', 'figure out where we come from, where we are going to', 'fine-grained', 'fintech', 'firm-wide', 'first-class', 'fleet dynamism', 'flesh out', 'flexibility', 'flexible', 'flipped classroom', 'flow charting', 'focus', 'focus on', 'focus on speed', 'focused', 'folksonomy', 'footprint', 'formulate', 'forward planning', 'forward-looking', 'forward-thinking', 'foster', 'framework', 'franchise', 'frictionless', 'from the get-go', 'front-face', 'fuel changes', 'fulfilment issues', 'full range of products', 'full-scale', 'fully networked', 'fully researched', 'fully tested', 'functional', 'fungibility', 'fungible', 'fungibly', 'future', 'future-oriented', 'future-proof', 'future-ready', 'gain in task efficiency', 'game changer', 'game changers', 'game-changing', 'gamification', 'gaps', 'gatekeeper', 'generation x', 'generation y', 'generic', 'genuine', 'genuinely', 'get from here to here', 'global', 'global footprint', 'global network', 'global reach', 'global touch-base', 'globally', 'go forward', 'go forward together', 'go-to-market', 'goal', 'goal setting', 'goal-based', 'goal-directed', 'goal-oriented', 'going forward', 'governance', 'gradually', 'granular', 'granularity', 'granularize', 'ground-breaking', 'group', 'grow', 'grow and diversify', 'growing', 'growth', 'growth years', 'guided reading', 'guideline', 'hashtag', 'hands-on', 'harness', 'headlights', 'headwinds', 'healthy', 'heart-of-the-business', 'heavy lifting', 'herding cats', 'high quality', 'high standards in', 'high-definition', 'high-grade', 'high-growth', 'high-impact', 'high-level', 'high-margin', 'high-payoff', 'high-performance', 'high-performing', 'high-powered', 'high-priority', 'high-quality', 'higher-order thinking', 'highly satisfactory', 'highly-curated', 'holistic', 'human capital', 'human resources', 'humanizing', 'hunt the business down', 'hyper-hybrid', 'hyperlocal', 'ideas', 'identify', 'idiosyncrasy', 'idiosyncratic', 'image', 'immersion', 'immersive', 'impact', 'impactful', 'imperatives', 'impetus', 'implementation', 'implication', 'impressive', 'improve', 'improved', 'improvement', 'in the core', 'in the marketplace', 'in this space', 'in-depth', 'incentive', 'incentivise', 'incentivize', 'increase customer satisfaction', 'increase in margins', 'incremental', 'incubate', 'industry', 'industry-standard', 'inefficiencies', 'inexpensive', 'influence', 'infomediaries', 'information overloads', 'information-age', 'informationalization', 'informed', 'infrastructure', 'ingenious', 'ingenuity', 'initiate', 'initiative', 'initiatives', 'innovate', 'innovation', 'innovation-driven', 'innovative', 'innovative edge', 'innovativeness', 'innovator', 'insight', 'insight-based', 'insightful', 'insightfulness', 'inspirational', 'inspire', 'inspiring', 'installed base', 'institutionalize', 'integrate', 'integrated', 'integration', 'integrative', 'integrativeness', 'integrity', 'intellect', 'intellectual capital', 'intelligence', 'intelligent', 'inter-company', 'interact with', 'interactive', 'interactively', 'interconnected', 'interdependency', 'interdependent', 'interfaces', 'intermandated', 'internal client', 'internet of things', 'interoperability', 'interoperable', 'interpersonal skills', 'intra-company', 'intra-organisational', 'intricacies', 'intrinsically', 'intuitive', 'intuitiveness', 'inventory-planning', 'invested in', 'investor confidence', 'invigorate', 'issues', 'iterate', 'jaw-dropping', 'jump-start', 'just in time', 'keep it on the radar', 'key people', 'key performance indicators', 'key representatives', 'key target markets', 'kick-off', 'knowledge management', 'knowledge sharing', 'knowledge transfer', 'knowledge-based', 'known unknowns', 'landscape', 'large-scale', 'laser-focused', 'leadership', 'leadership development system', 'leadership strategy', 'leading', 'leading-edge', 'learn', 'learnability', 'learning', 'lessons learned', 'lever', 'leverage', 'leverage the benefits of our differentiation', 'leveraged', 'limitations', 'line of business', 'line-of-sight', 'line-up', 'local-for-local strategy', 'location-specific', 'logistics', 'long tail', 'long-established', 'long-running', 'long-standing', 'long-term', 'longer-term', 'loop back', 'low hanging fruit', 'low-risk high-yield', 'machine learning', 'macroscopic', 'magnetic', 'maintain', 'make it pop', 'make it possible', 'make the abstract concrete', 'make things happen', 'manage', 'manage the balance', 'manage the cycle', 'manage the downside', 'manage the mix', 'manage the portfolio', 'management information system', 'market', 'market conditions', 'market environment', 'market forces', 'market gaps', 'market opportunities', 'market positioning', 'market practice', 'market thinker', 'market thinkers', 'market-altering', 'market-changing', 'market-driven', 'market-driving', 'marketplace', 'markets', 'mashup', 'materials', 'matrix', 'maximize', 'maximize the value', 'measurable', 'measure', 'measured', 'measurement', 'mediators', 'medium-to-long-term', 'meet the challenges', 'meet the surge', 'mesh', 'methodologies', 'methodology', 'metrics-driven', 'micro-macro', 'microsegment', 'milestone', 'millennial', 'mind share', 'mind-blowing', 'mindful', 'mindset', 'mindshare', 'minimize', 'mission', 'mission critical', 'mission-critical', 'mitigate', 'mobile strategies', 'models', 'modular', 'momentum', 'monetize', 'monotonectally', 'morph', 'motivate', 'motivational', 'movable', 'move forward', 'move the needle', 'move the progress forward', 'moving forward', 'multi-channel', 'multi-divisional', 'multi-source', 'multi-tasked', 'multidisciplinary', 'multimedia based', 'multiple intelligences', 'myocardinate', 'naming committee', 'negotiate', 'netiquette', 'network', 'new economy', 'new normal', 'new-generation', 'next generation', 'next step', 'next-generation', 'next-level', 'niche', 'niches', 'nimble', 'non-deterministic', 'non-linear', 'non-mainstream', 'non-manufacturing', 'non-standard', 'nosql', 'number-one', 'nurture talent', 'objective', 'objectively', 'obstacles', 'offshoring', 'omni-channel', 'on a day-to-day basis', 'on a transitional basis', 'on the runway', 'on-boarding process', 'on-demand', 'on-message', 'on-the-fly', 'onboarding solution', 'one-on-one', 'one-to-one', 'open', 'open-door policy', 'openness', 'operating strategy', 'operationalize', 'opportunities', 'opportunity', 'optimal', 'optimize', 'optionality', 'options', 'orchestrate', 'organic', 'organization-wide', 'organizational', 'organizational diseconomies', 'organizing principles', 'orthogonal', 'out-of-the-box', 'outperform peers', 'outside the box', 'outside-in', 'outsourced', 'outsourcing', 'outstanding', 'outward-looking', 'over the long term', 'overarching', 'overcome', 'overdeliver', 'overlaps', 'ownership', 'paas', 'pain point', 'pandemic', 'paradigm', 'paradigm shift', 'parallel', 'paralysis by analysis', 'partners', 'partnership', 'partnerships', 'passionate', 'peel the onion', 'performance', 'performance based', 'performance culture', 'performance-based', 'personalized', 'perspective', 'phased', 'philosophy', 'phosfluorescently', 'pillar', 'pioneers', 'pipeline', 'pitfalls', 'plagiarize', 'planning granularity', 'platform', 'platforms', 'plug-and-play', 'pockets of opportunities', 'policy', 'policy makers', 'political capital', 'pontificate', 'portal', 'portals', 'portfolio shaping', 'potential', 'potentialities', 'potentiate', 'powerful', 'powerful champion', 'pre-approved', 'pre-integrated', 'pre-plan', 'pre-prepare', 'predictability', 'predominate', 'preemptive', 'premier', 'premium', 'present-day', 'principle-based', 'principle-centered', 'prioritize', 'prioritizing', 'priority', 'proactive', 'proactively', 'problem-solving', 'problems', 'problems/difficulties', 'process', 'process-centric', 'procrastinate', 'product manager', 'productive', 'productivity improvement', 'professional', 'profile', 'profit center', 'profit-maximizing', 'profit-oriented', 'profitable', 'progressive', 'project leader', 'project-based learning', 'projection', 'promising', 'promote', 'prospective', 'proven', 'provide access to', 'pursue', 'push the envelope', 'push the envelope to the tilt', 'pyramid', 'quality', 'quality assurance', 'quality management system', 'quality research', 'quality-oriented', 'quarter results', 'quest for quality', 'quickly', 'radical', 'rapid', 'rapidiously', 're-aggregate', 're-imagine', 're-imagined', 'reach out', 'real-time', 'realignment', 'reality-based', 'reaped from our', 'rebalance', 'recalibration', 'recaptiualize', 'recognition', 'reconceptualize', 'recurring', 'redefine', 'reintermediate', 'reinvent', 'reinvest in', 'relationship', 'relationships', 'relevant', 'reliable', 'repurpose', 'reputation', 'requests / solutions', 'requirement', 'reset the benchmark', 'resiliency', 'resilient', 'resource', 'resource-leveling', 'resource-maximizing', 'resourcefulness', 'respect', 'responsibility', 'responsible', 'responsive', 'responsiveness', 'restore', 'result in', 'result-driven', 'resulting in', 'results-centric', 'results-oriented', 'return on investment', 'revealing', 'reverse fulfilment', 'review cycle', 'revolition', 'revolutionary', 'revolutionise', 'revolutionize', 'reward', 'right', 'right-scale', 'right-shore', 'right-size', 'rightshoring', 'rise to the challenge', 'risk appetite', 'risk management', 'risk taking', 'risk/return profile', 'roadmap', 'robust', 'robustify', 'rocess improvements', 'rock-solid', 'roe', 'roi', 'role building', 'roles and responsibilities', 'roll-out', 'rollout plan', 'sales target', 'say/do ratio', 'scalability', 'scalable', 'scale', 'scale-as-you-grow', 'scaling', 'scenario-based', 'scenarios', 'schemas', 'science-based', 'scoping', 'scrums', 'sea change', 'seamless', 'seamlessly', 'secure', 'see around the corner', 'segmentation', 'seize', 'selective', 'selectivity', 'self-awareness', 'self-efficacy', 'senior support staff', 'sensorization', 'serum', 'service-oriented', 'serviceability', 'services', 'share options', 'shareholder value', 'shift in value', 'shoot it over', 'shortcomings', 'shortfalls', 'showcase', 'sign-off', 'significant', 'significantly', 'siloed', 'simplicity', 'single-minded', 'sisterhood', 'situational', 'six-sigma', 'sizeable', 'skill', 'skillset', 'smooth transition', 'social bookmarking', 'social implications', 'social software', 'social sphere', 'socially conscious', 'socially enabled', 'soft cycle issues', 'solid', 'solid profitability', 'solution', 'solution orientation', 'solution provider', 'solution-oriented', 'solutions-based', 'sources', 'sox', 'specific', 'specification quality', 'spectral', 'speedup', 'sphere', 'spin-up', 'sprints', 'stakeholder', 'stand out from the crowd', 'stand-alone', 'standard-setters', 'standardization', 'standardize', 'standardized', 'standards compliant', 'startup', 'state of the art', 'state-of-the-art', 'stay ahead', 'stay in the mix', 'stay in the wings', 'stay in the zone', 'stay on trend', 'steering committee', 'stellar', 'sticky', 'storytelling', 'straightforwardly', 'strategic', 'strategic management system', 'strategic staircase', 'strategic thinking', 'strategically', 'strategize', 'strategy', 'strategy formulation', 'strategy-focused', 'streamline', 'streamline the process', 'streamlined', 'streamlining', 'strengthen', 'stress management', 'stretch our data bucket', 'stretch the status quo', 'structural', 'structured', 'style guidelines', 'subpar returns', 'success factor', 'successful execution', 'superior', 'superior-quality', 'supply', 'supply-chain', 'support structure', 'surge ahead', 'surprises', 'survival strategy', 'sustainability', 'sustainable', 'sustained', 'swiftly', 'swim lanes', 'swot analysis', 'sync-up', 'synchronized', 'syndicate', 'synergistic', 'synergize', 'synergy', 'synthesize', 'systematized', 'systems', 'table', 'tactical', 'tactics', 'tagging', 'take a bite out of', 'take control', 'take control of', 'take it offline', 'take offline', 'taking advantage of', 'talent', 'talent relationship management', 'talent retention', 'target', 'targeted', 'task-oriented', 'team building', 'team players', 'teamwork', 'teamwork-oriented', 'technical excellence', 'technical strength', 'technically', 'technically sound', 'technological', 'technological masturbation', 'technologies', 'technology', 'technology-centered', 'technology-driven', 'testing procedures', 'think across the full value chain', 'think differently', 'think out of the box', 'thinkers/planners', 'thought leader', 'thought leaders', 'thought leadership', 'thought-provoking', 'threats', 'throughout the organization', 'throughput increase', 'time-honored', 'time-phase', 'time-phased', 'time-to-market', 'time-to-value', 'timeline', 'timely', 'tolerably expensive', 'top', 'top-class', 'top-down', 'top-level', 'top-line', 'total linkage', 'touchpoint', 'traceable', 'transfer', 'transform', 'transformation process', 'transformational', 'transformative', 'transition', 'transitional', 'transmedia', 'transparency', 'transparent', 'trend', 'tri-face', 'trigger event', 'trust-based', 'trusted', 'trustworthy', 'turbocharge', 'turn every stone', 'turn-key', 'turnkey', 'ubiquitous', 'uncertainties', 'under-the-radar', 'underlying', 'underperforming areas', 'underwhelm', 'unfavorable developments', 'unified', 'uniformity', 'unique', 'unknown unknowns', 'unleash', 'unpack', 'unparalleled', 'unprecedented', 'up, down and across the', 'up-front', 'up-sell message', 'upper single-digit', 'upside focus', 'usage-based', 'user friendly', 'user-centric', 'users', 'utilize', 'validation', 'value', 'value chain', 'value creation', 'value creation goals', 'value proposition', 'value realization', 'value-added', 'value-adding', 'value-driven', 'value-enhancing', 'values congruence', 'values-based', 'verifiable', 'versatile', 'vertical', 'viral', 'visibility', 'vision', 'vision-setting', 'visionary', 'visual thinking', 'visualize', 'vital', 'vlogging', 'vortal', 'water under the bridge', 'weaknesses', 'web 2.0', 'web-readiness', 'weblog', 'well-communicated', 'well-crafted', 'well-defined', 'well-implemented', 'well-planned', 'well-positioned', 'well-scoped', 'wellness', 'wheelhouse', 'white paper', 'white-collar efficiency', 'white-collar productivity', 'white-collar workers', 'white-collar workforce', 'whiteboard', 'wide-ranging', 'wide-spectrum', 'wikiality', 'win-win', 'win-win solution', 'winning', 'wins', 'within the', 'within the industry', 'workflow', 'workshops', 'world-class', 'wow factor', 'yield enhancement'] }
buzzwords = {'en': ['as a tier 1 company', 'paving the way for', 'relative to our peers', '-free', '200%', '24/365', '24/7', '360-degree', '360-degree thinking', '50/50', '99.9', 'ability to deliver', 'ability to move fast', 'above-average', 'accelerate', 'accelerate the strategy', 'accelerated', 'accelerating', 'accepted', 'accessible', 'accomplishment', 'account executive', 'accountability', 'accountable talk', 'acculturated', 'accurate', 'achieve', 'achieve efficiencies', 'across and beyond the', 'across geographies', 'across industry sectors', 'across our portfolio', 'across the', 'across the board', 'across the wider group', 'action forward', 'action item', 'action items', 'action plan', 'actionable', 'activate', 'active differentiation', 'actualize', 'adapt', 'adaptability', 'adaptive', 'address', 'address the overarching issues', 'adequate', 'adequately', 'administrate', 'adoptable', 'aggregate', 'aggregator', 'aggressive', 'aggressively', 'agile', 'agility', 'agreed-upon', 'ahead of schedule', 'alert', 'align resources', 'aligned', 'alignment', 'alternative', 'an expanded array of', 'analyse', 'analytic', 'analytics', 'analytics-based', 'applications', 'appropriately', 'architect', 'architectural approach', 'architecture', 'articulate', 'as a consequence of', 'as part of the plan', 'aspirations', 'assertive', 'asset', 'at the end of the day', 'at the individual, team and organizational level', 'atmosphere', 'attitude', 'attractive-enough', 'attractiveness', 'authoritatively', 'avoid', 'awareness', 'awesome', 'b2b', 'b2c', 'backward-compatible', 'balanced', 'balanced scorecard', 'ballpark figure', 'bandwidth', 'barriers', 'barriers to success', 'baseline starting point', 'be cautiously optimistic', 'be committed', 'because', 'benchmark', 'benchmark the portfolio', 'benchmarking', 'benefit', 'benefits', 'best of breed', 'best practice', 'best practices', 'best-in-class', 'best-of-breed', 'best-of-class', 'better-than-planned', 'bi-face', 'big data', 'big picture', 'big society', 'big-picture thinking', 'bizmeth', 'black swans', 'bleeding edge', 'bleeding-edge', 'blended approach', "bloom's taxonomy", 'board-level executives', 'book value growth', 'boost', 'bottom line', 'bottom-up', 'boundaryless', 'brand identity', 'brand image', 'brand manager', 'brand pyramid', 'brand value', 'branding', 'branding strategy', 'break through the clutter', 'breakneck', 'breakout', 'breakthrough', 'brick-and-mortar', 'bricks-and-clicks', 'bring to the table', 'bring your own device', 'broaden', 'broader thinking', 'build', 'build winning teams', 'bullet-proof', 'business case', 'business development', 'business enabling', 'business equation', 'business leaders', 'business line', 'business model', 'business philosophy', 'business platform', 'business-for-business', 'business-led', 'buzzword compliant', 'expanding boundaries', 'levelling the playing field', 'leveraging', 'nurturing talent', 'thinking and acting beyond boundaries', 'thinking outside of the box', 'calibrate', 'calibration', 'capability', 'capitalize on', 'carefully', 'carefully thought-out', 'cascading', 'case study', 'catalyst for growth', 'catalysts for change', 'category manager', 'cautiously', 'celebrate the success', 'centerpiece', 'centralized', 'challenge', 'challenge established ideas', 'challenge the status quo', 'challenging', 'challenging market conditions', 'champion', 'change', 'change management', 'channel', 'channels', 'circle back', 'clear goal', 'clear-cut', 'clicks-and-mortar', 'clickthrough', 'client event', 'client focus', 'client needs', 'client perspective', 'client satisfaction', 'client-based', 'client-centered', 'client-centric', 'client-oriented', 'close the loop', 'cloud', 'co-create', 'co-develop', 'co-innovation', 'co-opetition', 'cognitive', 'collaboration', 'collaborative', 'collateral', 'come to a landing', 'come-to-jesus moment', 'commitment', 'common core', 'communicate', 'communication', 'communities', 'community', 'compatible', 'compelling', 'competent', 'competently', 'competitive', 'competitive advantage', 'competitive success', 'competitiveness', 'compliance', 'compliant', 'comprehensive', 'concept', 'conceptualize', 'concerns', 'connect the dots', 'connect the dots to the end game', 'connectivity', 'conservatively', 'consistency', 'consistent', 'consistently', 'constraints', 'constructive', 'consumer-facing', 'consumer/agent disconnects', 'content', 'context-aware', 'continual', 'continually', 'continuity', 'control', 'control information system', 'control-based', 'controllable', 'controlled', 'conveniently', 'convergence', 'conversate', 'cooperative', 'coordinate', 'coordinated', 'core business', 'core capacity', 'core competencies', 'core competency', 'core meeting', 'cornerstone', 'corporate', 'corporate governance', 'corporate identity', 'correlation', 'cost effectiveness', 'cost efficiency', 'cost reduction', 'cost savings', 'cost-competitive', 'cost-effective', 'covalent', 'create long-term value', 'creative', 'credibility', 'credible', 'credibly', 'critical', 'cross fertilization', 'cross-breeding', 'cross-enterprise', 'cross-functional', 'cross-industry', 'cross-static', 'cross-platform', 'cross-sell message', 'cross-unit', 'cultivate', 'cultivate talent', 'cultural', 'culturally', 'culture', 'curated', 'customer centricity', 'customer directed', 'customer experience', 'customer footprint', 'customer service', 'customer-centric', 'customer-directed', 'customer-facing', 'customer-focused', 'customized', 'cutting-edge', 'dashboard', 'data-driven', 'day-to-day', 'decentralized', 'decision', 'decision making', 'decision-making', 'dedicated', 'dedication', 'deep dive', 'deep web', 'deepen', 'deliver', 'deliver on commitments', 'delivery framework', 'deploy', 'design pattern', 'design philosophy', 'develop the blue print for execution', 'develop the plan', 'dialogue', 'differentially', 'differentiate', 'differentiated', 'differentiating', 'differentiator', 'digital divide', 'digital economy', 'digital literacy', 'digital remastering', 'digital signage', 'diligently', 'dinintermediate disseminate', 'discipline', 'disciplined', 'disruptive', 'distinctive', 'distributed', 'diverse', 'diversification', 'diversifying', 'diversity', 'divisional structure', 'dna', 'do more with less', 'do the projects right', 'do the right projects', 'do things differently', 'document', 'document management', 'documented', 'dot-bomb', 'dotted line', 'double-digit', 'downsizing', 'downtimes', 'dramatic', 'dramatically', 'drill down', 'drill-down', 'drinking the kool-aid', 'drive', 'drive revenue', 'drive the business forward', 'dynamic', 'dynamics', 'e-commerce', 'e-learning', 'e-tailers', 'early-stage', 'eating your own dogfood', 'ebitda', 'economic value creation', 'economically sound', 'ecosystem', 'edge', 'educated', 'effective', 'effective execution', 'effectiveness', 'efficacy', 'efficiency', 'efficiency gain', 'efficient', 'efficient frontier', 'efficiently', 'elastic', 'elite', 'embrace', 'emerging', 'emotional impact', 'emotional intelligence', 'empower', 'empowerment', 'enable', 'enable customer interaction', 'enabler', 'end-to-end', 'energistically', 'energize', 'energy', 'enforce', 'engage', 'engagement', 'engineer', 'enhance', 'enhance the strength', 'enhanced', 'enhanced data capture', 'ensuring', 'enterprise', 'enterprise content management', 'enterprise risk management', 'enterprise-wide', 'enthusiastically', 'entitlement', 'entrepreneur', 'environment', 'envision', 'envisioneer', 'equity invested', 'escalation', 'establish', 'established', 'ethical', 'event horizon', 'evidence-based', 'evisculate', 'evolution', 'evolutionary', 'evolve', 'evolve our culture', 'exceed expectations', 'excellence', 'excellent', 'exceptional', 'execute', 'execute on priorities', 'execute the strategy', 'execution', 'executive', 'executive talent', 'executive-level', 'exit strategy', 'expanding', 'expansion', 'expectations and allocations', 'expediently', 'expedite', 'experiences', 'expertise', 'exploit', 'extensible', 'extensive', 'eyeballs', 'fabricate', 'face time', 'facilitate', 'facilitators', 'fact-based', 'fairness', 'far-reaching', 'fashion', 'fast-evolving', 'fast-growth', 'fast-track', 'feedback', 'feedback-based', 'fierce', 'figure out where we come from, where we are going to', 'fine-grained', 'fintech', 'firm-wide', 'first-class', 'fleet dynamism', 'flesh out', 'flexibility', 'flexible', 'flipped classroom', 'flow charting', 'focus', 'focus on', 'focus on speed', 'focused', 'folksonomy', 'footprint', 'formulate', 'forward planning', 'forward-looking', 'forward-thinking', 'foster', 'framework', 'franchise', 'frictionless', 'from the get-go', 'front-face', 'fuel changes', 'fulfilment issues', 'full range of products', 'full-scale', 'fully networked', 'fully researched', 'fully tested', 'functional', 'fungibility', 'fungible', 'fungibly', 'future', 'future-oriented', 'future-proof', 'future-ready', 'gain in task efficiency', 'game changer', 'game changers', 'game-changing', 'gamification', 'gaps', 'gatekeeper', 'generation x', 'generation y', 'generic', 'genuine', 'genuinely', 'get from here to here', 'global', 'global footprint', 'global network', 'global reach', 'global touch-base', 'globally', 'go forward', 'go forward together', 'go-to-market', 'goal', 'goal setting', 'goal-based', 'goal-directed', 'goal-oriented', 'going forward', 'governance', 'gradually', 'granular', 'granularity', 'granularize', 'ground-breaking', 'group', 'grow', 'grow and diversify', 'growing', 'growth', 'growth years', 'guided reading', 'guideline', 'hashtag', 'hands-on', 'harness', 'headlights', 'headwinds', 'healthy', 'heart-of-the-business', 'heavy lifting', 'herding cats', 'high quality', 'high standards in', 'high-definition', 'high-grade', 'high-growth', 'high-impact', 'high-level', 'high-margin', 'high-payoff', 'high-performance', 'high-performing', 'high-powered', 'high-priority', 'high-quality', 'higher-order thinking', 'highly satisfactory', 'highly-curated', 'holistic', 'human capital', 'human resources', 'humanizing', 'hunt the business down', 'hyper-hybrid', 'hyperlocal', 'ideas', 'identify', 'idiosyncrasy', 'idiosyncratic', 'image', 'immersion', 'immersive', 'impact', 'impactful', 'imperatives', 'impetus', 'implementation', 'implication', 'impressive', 'improve', 'improved', 'improvement', 'in the core', 'in the marketplace', 'in this space', 'in-depth', 'incentive', 'incentivise', 'incentivize', 'increase customer satisfaction', 'increase in margins', 'incremental', 'incubate', 'industry', 'industry-standard', 'inefficiencies', 'inexpensive', 'influence', 'infomediaries', 'information overloads', 'information-age', 'informationalization', 'informed', 'infrastructure', 'ingenious', 'ingenuity', 'initiate', 'initiative', 'initiatives', 'innovate', 'innovation', 'innovation-driven', 'innovative', 'innovative edge', 'innovativeness', 'innovator', 'insight', 'insight-based', 'insightful', 'insightfulness', 'inspirational', 'inspire', 'inspiring', 'installed base', 'institutionalize', 'integrate', 'integrated', 'integration', 'integrative', 'integrativeness', 'integrity', 'intellect', 'intellectual capital', 'intelligence', 'intelligent', 'inter-company', 'interact with', 'interactive', 'interactively', 'interconnected', 'interdependency', 'interdependent', 'interfaces', 'intermandated', 'internal client', 'internet of things', 'interoperability', 'interoperable', 'interpersonal skills', 'intra-company', 'intra-organisational', 'intricacies', 'intrinsically', 'intuitive', 'intuitiveness', 'inventory-planning', 'invested in', 'investor confidence', 'invigorate', 'issues', 'iterate', 'jaw-dropping', 'jump-start', 'just in time', 'keep it on the radar', 'key people', 'key performance indicators', 'key representatives', 'key target markets', 'kick-off', 'knowledge management', 'knowledge sharing', 'knowledge transfer', 'knowledge-based', 'known unknowns', 'landscape', 'large-scale', 'laser-focused', 'leadership', 'leadership development system', 'leadership strategy', 'leading', 'leading-edge', 'learn', 'learnability', 'learning', 'lessons learned', 'lever', 'leverage', 'leverage the benefits of our differentiation', 'leveraged', 'limitations', 'line of business', 'line-of-sight', 'line-up', 'local-for-local strategy', 'location-specific', 'logistics', 'long tail', 'long-established', 'long-running', 'long-standing', 'long-term', 'longer-term', 'loop back', 'low hanging fruit', 'low-risk high-yield', 'machine learning', 'macroscopic', 'magnetic', 'maintain', 'make it pop', 'make it possible', 'make the abstract concrete', 'make things happen', 'manage', 'manage the balance', 'manage the cycle', 'manage the downside', 'manage the mix', 'manage the portfolio', 'management information system', 'market', 'market conditions', 'market environment', 'market forces', 'market gaps', 'market opportunities', 'market positioning', 'market practice', 'market thinker', 'market thinkers', 'market-altering', 'market-changing', 'market-driven', 'market-driving', 'marketplace', 'markets', 'mashup', 'materials', 'matrix', 'maximize', 'maximize the value', 'measurable', 'measure', 'measured', 'measurement', 'mediators', 'medium-to-long-term', 'meet the challenges', 'meet the surge', 'mesh', 'methodologies', 'methodology', 'metrics-driven', 'micro-macro', 'microsegment', 'milestone', 'millennial', 'mind share', 'mind-blowing', 'mindful', 'mindset', 'mindshare', 'minimize', 'mission', 'mission critical', 'mission-critical', 'mitigate', 'mobile strategies', 'models', 'modular', 'momentum', 'monetize', 'monotonectally', 'morph', 'motivate', 'motivational', 'movable', 'move forward', 'move the needle', 'move the progress forward', 'moving forward', 'multi-channel', 'multi-divisional', 'multi-source', 'multi-tasked', 'multidisciplinary', 'multimedia based', 'multiple intelligences', 'myocardinate', 'naming committee', 'negotiate', 'netiquette', 'network', 'new economy', 'new normal', 'new-generation', 'next generation', 'next step', 'next-generation', 'next-level', 'niche', 'niches', 'nimble', 'non-deterministic', 'non-linear', 'non-mainstream', 'non-manufacturing', 'non-standard', 'nosql', 'number-one', 'nurture talent', 'objective', 'objectively', 'obstacles', 'offshoring', 'omni-channel', 'on a day-to-day basis', 'on a transitional basis', 'on the runway', 'on-boarding process', 'on-demand', 'on-message', 'on-the-fly', 'onboarding solution', 'one-on-one', 'one-to-one', 'open', 'open-door policy', 'openness', 'operating strategy', 'operationalize', 'opportunities', 'opportunity', 'optimal', 'optimize', 'optionality', 'options', 'orchestrate', 'organic', 'organization-wide', 'organizational', 'organizational diseconomies', 'organizing principles', 'orthogonal', 'out-of-the-box', 'outperform peers', 'outside the box', 'outside-in', 'outsourced', 'outsourcing', 'outstanding', 'outward-looking', 'over the long term', 'overarching', 'overcome', 'overdeliver', 'overlaps', 'ownership', 'paas', 'pain point', 'pandemic', 'paradigm', 'paradigm shift', 'parallel', 'paralysis by analysis', 'partners', 'partnership', 'partnerships', 'passionate', 'peel the onion', 'performance', 'performance based', 'performance culture', 'performance-based', 'personalized', 'perspective', 'phased', 'philosophy', 'phosfluorescently', 'pillar', 'pioneers', 'pipeline', 'pitfalls', 'plagiarize', 'planning granularity', 'platform', 'platforms', 'plug-and-play', 'pockets of opportunities', 'policy', 'policy makers', 'political capital', 'pontificate', 'portal', 'portals', 'portfolio shaping', 'potential', 'potentialities', 'potentiate', 'powerful', 'powerful champion', 'pre-approved', 'pre-integrated', 'pre-plan', 'pre-prepare', 'predictability', 'predominate', 'preemptive', 'premier', 'premium', 'present-day', 'principle-based', 'principle-centered', 'prioritize', 'prioritizing', 'priority', 'proactive', 'proactively', 'problem-solving', 'problems', 'problems/difficulties', 'process', 'process-centric', 'procrastinate', 'product manager', 'productive', 'productivity improvement', 'professional', 'profile', 'profit center', 'profit-maximizing', 'profit-oriented', 'profitable', 'progressive', 'project leader', 'project-based learning', 'projection', 'promising', 'promote', 'prospective', 'proven', 'provide access to', 'pursue', 'push the envelope', 'push the envelope to the tilt', 'pyramid', 'quality', 'quality assurance', 'quality management system', 'quality research', 'quality-oriented', 'quarter results', 'quest for quality', 'quickly', 'radical', 'rapid', 'rapidiously', 're-aggregate', 're-imagine', 're-imagined', 'reach out', 'real-time', 'realignment', 'reality-based', 'reaped from our', 'rebalance', 'recalibration', 'recaptiualize', 'recognition', 'reconceptualize', 'recurring', 'redefine', 'reintermediate', 'reinvent', 'reinvest in', 'relationship', 'relationships', 'relevant', 'reliable', 'repurpose', 'reputation', 'requests / solutions', 'requirement', 'reset the benchmark', 'resiliency', 'resilient', 'resource', 'resource-leveling', 'resource-maximizing', 'resourcefulness', 'respect', 'responsibility', 'responsible', 'responsive', 'responsiveness', 'restore', 'result in', 'result-driven', 'resulting in', 'results-centric', 'results-oriented', 'return on investment', 'revealing', 'reverse fulfilment', 'review cycle', 'revolition', 'revolutionary', 'revolutionise', 'revolutionize', 'reward', 'right', 'right-scale', 'right-shore', 'right-size', 'rightshoring', 'rise to the challenge', 'risk appetite', 'risk management', 'risk taking', 'risk/return profile', 'roadmap', 'robust', 'robustify', 'rocess improvements', 'rock-solid', 'roe', 'roi', 'role building', 'roles and responsibilities', 'roll-out', 'rollout plan', 'sales target', 'say/do ratio', 'scalability', 'scalable', 'scale', 'scale-as-you-grow', 'scaling', 'scenario-based', 'scenarios', 'schemas', 'science-based', 'scoping', 'scrums', 'sea change', 'seamless', 'seamlessly', 'secure', 'see around the corner', 'segmentation', 'seize', 'selective', 'selectivity', 'self-awareness', 'self-efficacy', 'senior support staff', 'sensorization', 'serum', 'service-oriented', 'serviceability', 'services', 'share options', 'shareholder value', 'shift in value', 'shoot it over', 'shortcomings', 'shortfalls', 'showcase', 'sign-off', 'significant', 'significantly', 'siloed', 'simplicity', 'single-minded', 'sisterhood', 'situational', 'six-sigma', 'sizeable', 'skill', 'skillset', 'smooth transition', 'social bookmarking', 'social implications', 'social software', 'social sphere', 'socially conscious', 'socially enabled', 'soft cycle issues', 'solid', 'solid profitability', 'solution', 'solution orientation', 'solution provider', 'solution-oriented', 'solutions-based', 'sources', 'sox', 'specific', 'specification quality', 'spectral', 'speedup', 'sphere', 'spin-up', 'sprints', 'stakeholder', 'stand out from the crowd', 'stand-alone', 'standard-setters', 'standardization', 'standardize', 'standardized', 'standards compliant', 'startup', 'state of the art', 'state-of-the-art', 'stay ahead', 'stay in the mix', 'stay in the wings', 'stay in the zone', 'stay on trend', 'steering committee', 'stellar', 'sticky', 'storytelling', 'straightforwardly', 'strategic', 'strategic management system', 'strategic staircase', 'strategic thinking', 'strategically', 'strategize', 'strategy', 'strategy formulation', 'strategy-focused', 'streamline', 'streamline the process', 'streamlined', 'streamlining', 'strengthen', 'stress management', 'stretch our data bucket', 'stretch the status quo', 'structural', 'structured', 'style guidelines', 'subpar returns', 'success factor', 'successful execution', 'superior', 'superior-quality', 'supply', 'supply-chain', 'support structure', 'surge ahead', 'surprises', 'survival strategy', 'sustainability', 'sustainable', 'sustained', 'swiftly', 'swim lanes', 'swot analysis', 'sync-up', 'synchronized', 'syndicate', 'synergistic', 'synergize', 'synergy', 'synthesize', 'systematized', 'systems', 'table', 'tactical', 'tactics', 'tagging', 'take a bite out of', 'take control', 'take control of', 'take it offline', 'take offline', 'taking advantage of', 'talent', 'talent relationship management', 'talent retention', 'target', 'targeted', 'task-oriented', 'team building', 'team players', 'teamwork', 'teamwork-oriented', 'technical excellence', 'technical strength', 'technically', 'technically sound', 'technological', 'technological masturbation', 'technologies', 'technology', 'technology-centered', 'technology-driven', 'testing procedures', 'think across the full value chain', 'think differently', 'think out of the box', 'thinkers/planners', 'thought leader', 'thought leaders', 'thought leadership', 'thought-provoking', 'threats', 'throughout the organization', 'throughput increase', 'time-honored', 'time-phase', 'time-phased', 'time-to-market', 'time-to-value', 'timeline', 'timely', 'tolerably expensive', 'top', 'top-class', 'top-down', 'top-level', 'top-line', 'total linkage', 'touchpoint', 'traceable', 'transfer', 'transform', 'transformation process', 'transformational', 'transformative', 'transition', 'transitional', 'transmedia', 'transparency', 'transparent', 'trend', 'tri-face', 'trigger event', 'trust-based', 'trusted', 'trustworthy', 'turbocharge', 'turn every stone', 'turn-key', 'turnkey', 'ubiquitous', 'uncertainties', 'under-the-radar', 'underlying', 'underperforming areas', 'underwhelm', 'unfavorable developments', 'unified', 'uniformity', 'unique', 'unknown unknowns', 'unleash', 'unpack', 'unparalleled', 'unprecedented', 'up, down and across the', 'up-front', 'up-sell message', 'upper single-digit', 'upside focus', 'usage-based', 'user friendly', 'user-centric', 'users', 'utilize', 'validation', 'value', 'value chain', 'value creation', 'value creation goals', 'value proposition', 'value realization', 'value-added', 'value-adding', 'value-driven', 'value-enhancing', 'values congruence', 'values-based', 'verifiable', 'versatile', 'vertical', 'viral', 'visibility', 'vision', 'vision-setting', 'visionary', 'visual thinking', 'visualize', 'vital', 'vlogging', 'vortal', 'water under the bridge', 'weaknesses', 'web 2.0', 'web-readiness', 'weblog', 'well-communicated', 'well-crafted', 'well-defined', 'well-implemented', 'well-planned', 'well-positioned', 'well-scoped', 'wellness', 'wheelhouse', 'white paper', 'white-collar efficiency', 'white-collar productivity', 'white-collar workers', 'white-collar workforce', 'whiteboard', 'wide-ranging', 'wide-spectrum', 'wikiality', 'win-win', 'win-win solution', 'winning', 'wins', 'within the', 'within the industry', 'workflow', 'workshops', 'world-class', 'wow factor', 'yield enhancement']}