content
stringlengths
7
1.05M
fixed_cases
stringlengths
1
1.28M
class Hey: def __init__(jose, name="mours"): jose.name = name def get_name(jose): return jose.name class Person(object): def __init__(self, name, phone): self.name = name self.phone = phone class Teenager(Person): def __init__(self, *args, **kwargs): self.website = kwargs.pop("website") super(Teenager, self).__init__(*args, **kwargs) if __name__ == "__main__": #print(Hey().get_name()) teen = Teenager("Joseph Njeri", 924, "www.fowr.gd") print(teen.website)
class Hey: def __init__(jose, name='mours'): jose.name = name def get_name(jose): return jose.name class Person(object): def __init__(self, name, phone): self.name = name self.phone = phone class Teenager(Person): def __init__(self, *args, **kwargs): self.website = kwargs.pop('website') super(Teenager, self).__init__(*args, **kwargs) if __name__ == '__main__': teen = teenager('Joseph Njeri', 924, 'www.fowr.gd') print(teen.website)
# Autor: Anuj Sharma (@optider) # Github Profile: https://github.com/Optider/ # Problem Link: https://leetcode.com/problems/contains-duplicate/ class Solution: def containsDuplicate(self, nums: List[int]) -> bool: count = {} for n in nums : if count.get(n) != None : return True count[n] = 1 return False
class Solution: def contains_duplicate(self, nums: List[int]) -> bool: count = {} for n in nums: if count.get(n) != None: return True count[n] = 1 return False
{ 'target_defaults': { 'win_delay_load_hook': 'false', 'conditions': [ ['OS=="win"', { 'msvs_disabled_warnings': [ 4530, # C++ exception handler used, but unwind semantics are not enabled 4506, # no definition for inline function ], }], ], }, 'targets': [ { 'target_name': 'fs_admin', 'defines': [ "NAPI_VERSION=<(napi_build_version)", ], 'cflags!': [ '-fno-exceptions' ], 'cflags_cc!': [ '-fno-exceptions' ], 'xcode_settings': { 'GCC_ENABLE_CPP_EXCEPTIONS': 'YES', 'CLANG_CXX_LIBRARY': 'libc++', 'MACOSX_DEPLOYMENT_TARGET': '10.7', }, 'msvs_settings': { 'VCCLCompilerTool': { 'ExceptionHandling': 1 }, }, 'sources': [ 'src/main.cc', ], 'include_dirs': [ '<!(node -p "require(\'node-addon-api\').include_dir")', ], 'conditions': [ ['OS=="win"', { 'sources': [ 'src/fs-admin-win.cc', ], 'libraries': [ '-lole32.lib', '-lshell32.lib', ], }], ['OS=="mac"', { 'sources': [ 'src/fs-admin-darwin.cc', ], 'libraries': [ '$(SDKROOT)/System/Library/Frameworks/Security.framework', ], }], ['OS=="linux"', { 'sources': [ 'src/fs-admin-linux.cc', ], }], ], } ] }
{'target_defaults': {'win_delay_load_hook': 'false', 'conditions': [['OS=="win"', {'msvs_disabled_warnings': [4530, 4506]}]]}, 'targets': [{'target_name': 'fs_admin', 'defines': ['NAPI_VERSION=<(napi_build_version)'], 'cflags!': ['-fno-exceptions'], 'cflags_cc!': ['-fno-exceptions'], 'xcode_settings': {'GCC_ENABLE_CPP_EXCEPTIONS': 'YES', 'CLANG_CXX_LIBRARY': 'libc++', 'MACOSX_DEPLOYMENT_TARGET': '10.7'}, 'msvs_settings': {'VCCLCompilerTool': {'ExceptionHandling': 1}}, 'sources': ['src/main.cc'], 'include_dirs': ['<!(node -p "require(\'node-addon-api\').include_dir")'], 'conditions': [['OS=="win"', {'sources': ['src/fs-admin-win.cc'], 'libraries': ['-lole32.lib', '-lshell32.lib']}], ['OS=="mac"', {'sources': ['src/fs-admin-darwin.cc'], 'libraries': ['$(SDKROOT)/System/Library/Frameworks/Security.framework']}], ['OS=="linux"', {'sources': ['src/fs-admin-linux.cc']}]]}]}
DEBUG = True USE_TZ = True SECRET_KEY = "dummy" DATABASES = {"default": {"ENGINE": "django.db.backends.sqlite3", "NAME": ":memory:"}} INSTALLED_APPS = [ "django.contrib.auth", "django.contrib.contenttypes", "django.contrib.sites", "rest_framework", "django_filters", "belt", "tests.app", ] SITE_ID = 1 ROOT_URLCONF = "tests.app.urls" MIDDLEWARE = () REST_FRAMEWORK = { "DEFAULT_FILTER_BACKENDS": ("django_filters.rest_framework.DjangoFilterBackend",) }
debug = True use_tz = True secret_key = 'dummy' databases = {'default': {'ENGINE': 'django.db.backends.sqlite3', 'NAME': ':memory:'}} installed_apps = ['django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sites', 'rest_framework', 'django_filters', 'belt', 'tests.app'] site_id = 1 root_urlconf = 'tests.app.urls' middleware = () rest_framework = {'DEFAULT_FILTER_BACKENDS': ('django_filters.rest_framework.DjangoFilterBackend',)}
#!/usr/bin/env python ''' This module provides configuration options for OS project. No more magic numbers! ''' BLOCK_SIZE = 16 # words WORD_SIZE = 4 # bytes # length od RS in blocks RESTRICTED_LENGTH = 1 # length of DS in blocks DS_LENGTH = 6 # timer value TIMER_VALUE = 10 # buffer size BUFFER_SIZE = 16 # number of blocks in HD HD_BLOCKS_SIZE = 500 # default priorities ROOT_PRIORITY = 40 VM_PRIORITY = 50 LOADER_PRIORITY = 60 INTERRUPT_PRIORITY = 70 PRINT_PRIORITY = 70 # Process states RUNNING_STATE = 'running' READY_STATE = 'ready' BLOCKED_STATE = 'blocked' # Page tables PAGE_TABLE_STARTING_BLOCK = 0 PAGE_TABLE_ENDING_BLOCK = 14 # Shared memory SH_MEMEORY_STARTING_BLOCK = 15 SH_MEMORY_ENDING_BLOCK = 31 # blocks dedicated for user tasks are from USER_STARTING_BLOCK = 32 USER_ENDING_BLOCK = 255
""" This module provides configuration options for OS project. No more magic numbers! """ block_size = 16 word_size = 4 restricted_length = 1 ds_length = 6 timer_value = 10 buffer_size = 16 hd_blocks_size = 500 root_priority = 40 vm_priority = 50 loader_priority = 60 interrupt_priority = 70 print_priority = 70 running_state = 'running' ready_state = 'ready' blocked_state = 'blocked' page_table_starting_block = 0 page_table_ending_block = 14 sh_memeory_starting_block = 15 sh_memory_ending_block = 31 user_starting_block = 32 user_ending_block = 255
class Solution: def jump(self, nums: List[int]) -> int: n = len(nums) dp = [float('inf')] * n dp[0] = 0 tail = 1 for i in range(n): limit = min(n, i + nums[i] + 1) for j in range(tail, limit): dp[j] = min(dp[j], dp[i] + 1) tail = limit - 1 return dp[-1]
class Solution: def jump(self, nums: List[int]) -> int: n = len(nums) dp = [float('inf')] * n dp[0] = 0 tail = 1 for i in range(n): limit = min(n, i + nums[i] + 1) for j in range(tail, limit): dp[j] = min(dp[j], dp[i] + 1) tail = limit - 1 return dp[-1]
#! /usr/bin/python3 # Description: Data_Ghost, concealing data into spaces and tabs making it imperceptable to human eyes. # Author: Ajay Dyavathi # Github: Radical Ajay class Ghost(): def __init__(self, file_name, output_format='txt'): ''' Converts ascii text to spaces and tabs ''' self.file_name = file_name self.output_format = output_format def ascii2bin(self, asc): ''' Converting ascii to bianry ''' return ''.join('{:08b}'.format(ord(i)) for i in asc) def bin2ascii(self, bid): ''' Converting binary to ascii ''' return ''.join(chr(int(bid[i:i + 8], 2)) for i in range(0, len(bid), 8)) def ghost(self, filename): ''' Ghosting data converting it to spaces and tabs ''' with open(filename, 'w') as out_f: with open(self.file_name, 'r') as in_f: for in_data in in_f.readlines(): bin_data = self.ascii2bin(in_data) out_data = bin_data.replace('1', '\t') out_data = out_data.replace('0', ' ') out_f.write(out_data) def unghost(self, in_filename, out_filename): ''' Unghosting data converting back from spaces and tabs to human-readable text ''' with open(out_filename, 'w') as out_f: with open(in_filename, 'r') as in_f: for line in in_f.readlines(): line = line.replace('\t', '1') line = line.replace(' ', '0') out_f.write(self.bin2ascii(line)) # USAGE: # ghoster = Ghost('data.txt') # ghoster.ghost('ghosted.txt') # ghoster.unghost('ghosted.txt', 'unghosted.txt')
class Ghost: def __init__(self, file_name, output_format='txt'): """ Converts ascii text to spaces and tabs """ self.file_name = file_name self.output_format = output_format def ascii2bin(self, asc): """ Converting ascii to bianry """ return ''.join(('{:08b}'.format(ord(i)) for i in asc)) def bin2ascii(self, bid): """ Converting binary to ascii """ return ''.join((chr(int(bid[i:i + 8], 2)) for i in range(0, len(bid), 8))) def ghost(self, filename): """ Ghosting data converting it to spaces and tabs """ with open(filename, 'w') as out_f: with open(self.file_name, 'r') as in_f: for in_data in in_f.readlines(): bin_data = self.ascii2bin(in_data) out_data = bin_data.replace('1', '\t') out_data = out_data.replace('0', ' ') out_f.write(out_data) def unghost(self, in_filename, out_filename): """ Unghosting data converting back from spaces and tabs to human-readable text """ with open(out_filename, 'w') as out_f: with open(in_filename, 'r') as in_f: for line in in_f.readlines(): line = line.replace('\t', '1') line = line.replace(' ', '0') out_f.write(self.bin2ascii(line))
class Solution: def defangIPaddr(self, address: str) -> str: i=0 j=0 strlist=list(address) defang=[] while i< len(strlist): if strlist[i] == '.': defang.append('[') defang.append('.') defang.append(']') else: defang.append(address[i]) i+=1 retstr="" # return string return (retstr.join(defang))
class Solution: def defang_i_paddr(self, address: str) -> str: i = 0 j = 0 strlist = list(address) defang = [] while i < len(strlist): if strlist[i] == '.': defang.append('[') defang.append('.') defang.append(']') else: defang.append(address[i]) i += 1 retstr = '' return retstr.join(defang)
class Node: def __init__(self, path, libgraphql_type, location, name): self.path = path self.parent = None self.children = [] self.libgraphql_type = libgraphql_type self.location = location self.name = name def __repr__(self): return "%s(%s)" % (self.libgraphql_type, self.name)
class Node: def __init__(self, path, libgraphql_type, location, name): self.path = path self.parent = None self.children = [] self.libgraphql_type = libgraphql_type self.location = location self.name = name def __repr__(self): return '%s(%s)' % (self.libgraphql_type, self.name)
class Contact: def __init__(self, first_name, last_name, nickname, address, mobile, email): self.first_name = first_name self.last_name = last_name self.nickname = nickname self.address = address self.mobile = mobile self.email = email
class Contact: def __init__(self, first_name, last_name, nickname, address, mobile, email): self.first_name = first_name self.last_name = last_name self.nickname = nickname self.address = address self.mobile = mobile self.email = email
count = int(input()) title = 0 while count > 0: title += 1 if '666' in str(title): count -= 1 print(title)
count = int(input()) title = 0 while count > 0: title += 1 if '666' in str(title): count -= 1 print(title)
#!/usr/bin/env python3 USER = r'server\user' PASSWORD = 'server_password' HOSTNAME = 'hostname.goes.here.com' DOMAIN = 'domain.goes.here.com' FROM_ADDR = '[email protected]'
user = 'server\\user' password = 'server_password' hostname = 'hostname.goes.here.com' domain = 'domain.goes.here.com' from_addr = '[email protected]'
def createKafkaSecurityGroup(ec2, vpc): sec_group_kafka = ec2.create_security_group( GroupName='kafka', Description='kafka sec group', VpcId=vpc.id) sec_group_kafka.authorize_ingress( IpPermissions=[{'IpProtocol': 'icmp', 'FromPort': -1, 'ToPort': -1, 'IpRanges': [{'CidrIp': '0.0.0.0/0'}]}, {'IpProtocol': 'tcp', 'FromPort': 22, 'ToPort': 22, 'IpRanges': [{'CidrIp': '0.0.0.0/0'}]}, {'IpProtocol': 'tcp', 'FromPort': 9092, 'ToPort': 9092, 'IpRanges': [{'CidrIp': '0.0.0.0/0'}]}] ) print(sec_group_kafka.id) return sec_group_kafka def createZookeeperSecurityGroup(ec2, vpc): sec_group_zookeeper = ec2.create_security_group( GroupName='zookeeper', Description='zookeeper', VpcId=vpc.id) sec_group_zookeeper.authorize_ingress( IpPermissions=[{'IpProtocol': 'icmp', 'FromPort': -1, 'ToPort': -1, 'IpRanges': [{'CidrIp': '0.0.0.0/0'}]}, {'IpProtocol': 'tcp', 'FromPort': 22, 'ToPort': 22, 'IpRanges': [{'CidrIp': '0.0.0.0/0'}]}, {'IpProtocol': 'tcp', 'FromPort': 2181, 'ToPort': 2181, 'IpRanges': [{'CidrIp': '0.0.0.0/0'}]}, {'IpProtocol': 'tcp', 'FromPort': 2888, 'ToPort': 2888, 'IpRanges': [{'CidrIp': '0.0.0.0/0'}]}, {'IpProtocol': 'tcp', 'FromPort': 3888, 'ToPort': 3888, 'IpRanges': [{'CidrIp': '0.0.0.0/0'}]}] ) print(sec_group_zookeeper.id) return sec_group_zookeeper def create_redis_security_group(ec2, vpc): sec_group_redis = ec2.create_security_group( GroupName='redis', Description='redis', VpcId=vpc.id) sec_group_redis.authorize_ingress( IpPermissions=[{'IpProtocol': 'icmp', 'FromPort': -1, 'ToPort': -1, 'IpRanges': [{'CidrIp': '0.0.0.0/0'}]}, {'IpProtocol': 'tcp', 'FromPort': 22, 'ToPort': 22, 'IpRanges': [{'CidrIp': '0.0.0.0/0'}]}, {'IpProtocol': 'tcp', 'FromPort': 6379, 'ToPort': 6379, 'IpRanges': [{'CidrIp': '0.0.0.0/0'}]}] ) print(sec_group_redis.id) return sec_group_redis
def create_kafka_security_group(ec2, vpc): sec_group_kafka = ec2.create_security_group(GroupName='kafka', Description='kafka sec group', VpcId=vpc.id) sec_group_kafka.authorize_ingress(IpPermissions=[{'IpProtocol': 'icmp', 'FromPort': -1, 'ToPort': -1, 'IpRanges': [{'CidrIp': '0.0.0.0/0'}]}, {'IpProtocol': 'tcp', 'FromPort': 22, 'ToPort': 22, 'IpRanges': [{'CidrIp': '0.0.0.0/0'}]}, {'IpProtocol': 'tcp', 'FromPort': 9092, 'ToPort': 9092, 'IpRanges': [{'CidrIp': '0.0.0.0/0'}]}]) print(sec_group_kafka.id) return sec_group_kafka def create_zookeeper_security_group(ec2, vpc): sec_group_zookeeper = ec2.create_security_group(GroupName='zookeeper', Description='zookeeper', VpcId=vpc.id) sec_group_zookeeper.authorize_ingress(IpPermissions=[{'IpProtocol': 'icmp', 'FromPort': -1, 'ToPort': -1, 'IpRanges': [{'CidrIp': '0.0.0.0/0'}]}, {'IpProtocol': 'tcp', 'FromPort': 22, 'ToPort': 22, 'IpRanges': [{'CidrIp': '0.0.0.0/0'}]}, {'IpProtocol': 'tcp', 'FromPort': 2181, 'ToPort': 2181, 'IpRanges': [{'CidrIp': '0.0.0.0/0'}]}, {'IpProtocol': 'tcp', 'FromPort': 2888, 'ToPort': 2888, 'IpRanges': [{'CidrIp': '0.0.0.0/0'}]}, {'IpProtocol': 'tcp', 'FromPort': 3888, 'ToPort': 3888, 'IpRanges': [{'CidrIp': '0.0.0.0/0'}]}]) print(sec_group_zookeeper.id) return sec_group_zookeeper def create_redis_security_group(ec2, vpc): sec_group_redis = ec2.create_security_group(GroupName='redis', Description='redis', VpcId=vpc.id) sec_group_redis.authorize_ingress(IpPermissions=[{'IpProtocol': 'icmp', 'FromPort': -1, 'ToPort': -1, 'IpRanges': [{'CidrIp': '0.0.0.0/0'}]}, {'IpProtocol': 'tcp', 'FromPort': 22, 'ToPort': 22, 'IpRanges': [{'CidrIp': '0.0.0.0/0'}]}, {'IpProtocol': 'tcp', 'FromPort': 6379, 'ToPort': 6379, 'IpRanges': [{'CidrIp': '0.0.0.0/0'}]}]) print(sec_group_redis.id) return sec_group_redis
# STRAND SORT # It is a recursive comparison based sorting technique which sorts in increasing order. # It works by repeatedly pulling sorted sub-lists out of the list to be sorted and merging them # with a result array. # Algorithm: # Create a empty strand (list) and append the first element to it popping it from the input array # Compare this element with the rest of elements of the input array # if a greater element is found then pop and append it to strand otherwise skip # Now merge this array to the final output array # Recur for remaining items in strand and input array. # Utility Function to merge two arrays def merge(arr1, arr2): # list to store merged output merged_list = [] # while there are elements in both arrays while len(arr1) and len(arr2): # the array having smaller first elements gets appended as the resultant array must be sorted if arr1[0] < arr2[0]: merged_list.append(arr1.pop(0)) else: merged_list.append(arr2.pop(0)) # if the length of either of array is exhausted , merge the remaining part to # the merge sublist merged_list += arr1 merged_list += arr2 # return the merged list return merged_list # Function to return the strand (sorted sub-list) def strand(arr): # append the first element to the strand s = [arr.pop(0)] # initialise a pointer i = 0 # while it is less then length while i > len(arr): # compare the input array elements to the last element of the strand if arr[i] > s[-1]: # if we found a greater element than s[-1] then pop it and append to the strand s.append(arr.pop(i)) else: # else increment i += 1 # return the strand return s # Strand Sort Function def strand_sort(arr): # initialise the output array with the strand output = strand(arr) # while there are elements in the array while len(arr): # merge the strand and previous output list to create a new list output = merge(output, strand(arr)) # return the sorted output return output # Driver Code arr = [1, 6, 3, 8, 2, 0, 9] print(strand_sort(arr)) # Time Complexity : O(n^2) [Worst] # O(n*log(n)) [Average] # Space Complexity : O(n) # Stable : Yes # Inplace : No
def merge(arr1, arr2): merged_list = [] while len(arr1) and len(arr2): if arr1[0] < arr2[0]: merged_list.append(arr1.pop(0)) else: merged_list.append(arr2.pop(0)) merged_list += arr1 merged_list += arr2 return merged_list def strand(arr): s = [arr.pop(0)] i = 0 while i > len(arr): if arr[i] > s[-1]: s.append(arr.pop(i)) else: i += 1 return s def strand_sort(arr): output = strand(arr) while len(arr): output = merge(output, strand(arr)) return output arr = [1, 6, 3, 8, 2, 0, 9] print(strand_sort(arr))
class Proceso: def __init__(self,tiempo_de_llegada,t,id): self.t=t self.tiempo_de_llegada=tiempo_de_llegada self.id=id self.inicio=0 self.fin=0 self.T=0 self.E=0 self.P=0 self.tRestantes = t
class Proceso: def __init__(self, tiempo_de_llegada, t, id): self.t = t self.tiempo_de_llegada = tiempo_de_llegada self.id = id self.inicio = 0 self.fin = 0 self.T = 0 self.E = 0 self.P = 0 self.tRestantes = t
def test_add_contact(app, db, json_contacts, check_ui): contact = json_contacts list_before = db.get_contact_list() contact.id_contact = app.contact.get_next_id(list_before) app.contact.create(contact) assert len(list_before) + 1 == len(db.get_contact_list()) list_after = db.get_contact_list() list_before.append(contact) assert sorted(list_before) == sorted(list_after) if check_ui: assert sorted(list_after) == sorted(app.contact.get_list())
def test_add_contact(app, db, json_contacts, check_ui): contact = json_contacts list_before = db.get_contact_list() contact.id_contact = app.contact.get_next_id(list_before) app.contact.create(contact) assert len(list_before) + 1 == len(db.get_contact_list()) list_after = db.get_contact_list() list_before.append(contact) assert sorted(list_before) == sorted(list_after) if check_ui: assert sorted(list_after) == sorted(app.contact.get_list())
# solution 1: Brute Force # time complexity: O(n^2) # space complexity: O(1) def twoNumberSum(arr, n): for i in range(len(arr) - 1): firstNum = arr[i] for j in range(i + 1, len(arr)): secondNum = arr[j] if firstNum + secondNum == n: return [firstNum, secondNum] return [] print(twoNumberSum([3,5,-4,8,11,1,-1,6], 10))
def two_number_sum(arr, n): for i in range(len(arr) - 1): first_num = arr[i] for j in range(i + 1, len(arr)): second_num = arr[j] if firstNum + secondNum == n: return [firstNum, secondNum] return [] print(two_number_sum([3, 5, -4, 8, 11, 1, -1, 6], 10))
class InvalidMovementException(Exception): pass class InvalidMovementTargetException(InvalidMovementException): pass class InvalidMovimentOriginException(InvalidMovementException): pass
class Invalidmovementexception(Exception): pass class Invalidmovementtargetexception(InvalidMovementException): pass class Invalidmovimentoriginexception(InvalidMovementException): pass
FORM_CONTENT_TYPES = [ 'application/x-www-form-urlencoded', 'multipart/form-data' ]
form_content_types = ['application/x-www-form-urlencoded', 'multipart/form-data']
def numb_of_char(a): d = {} for char in set(a): d[char] = a.count(char) return d a = numb_of_char(str(input("Input the word please: "))) print(a)
def numb_of_char(a): d = {} for char in set(a): d[char] = a.count(char) return d a = numb_of_char(str(input('Input the word please: '))) print(a)
class Vector2D: def __init__(self, v: List[List[int]]): def getIt(): for row in v: for val in row: yield val self.it = iter(getIt()) self.val = next(self.it, None) def next(self) -> int: result = self.val self.val = next(self.it, None) return result def hasNext(self) -> bool: return self.val is not None # Your Vector2D object will be instantiated and called as such: # obj = Vector2D(v) # param_1 = obj.next() # param_2 = obj.hasNext()
class Vector2D: def __init__(self, v: List[List[int]]): def get_it(): for row in v: for val in row: yield val self.it = iter(get_it()) self.val = next(self.it, None) def next(self) -> int: result = self.val self.val = next(self.it, None) return result def has_next(self) -> bool: return self.val is not None
n = int(input()) line = list(map(int, input().split())) l = {} res = "" for i, j in enumerate(line): l[j] = i+1 for k in range(n): res += str(l[k+1]) + " " print(res.rstrip())
n = int(input()) line = list(map(int, input().split())) l = {} res = '' for (i, j) in enumerate(line): l[j] = i + 1 for k in range(n): res += str(l[k + 1]) + ' ' print(res.rstrip())
valor = int(input()) for i in range(valor+1): if(i%2 != 0): print(i)
valor = int(input()) for i in range(valor + 1): if i % 2 != 0: print(i)
# https://leetcode.com/problems/delete-and-earn/ class Solution: def deleteAndEarn(self, nums: list[int]) -> int: num_profits = dict() for num in nums: num_profits[num] = num_profits.get(num, 0) + num sorted_nums = sorted(num_profits.keys()) second_last_profit = 0 last_profit = num_profits[sorted_nums[0]] for idx in range(1, len(sorted_nums)): profit_with_curr_num = num_profits[sorted_nums[idx]] if sorted_nums[idx - 1] == sorted_nums[idx] - 1: curr_profit = max(last_profit, second_last_profit + profit_with_curr_num) else: curr_profit = last_profit + profit_with_curr_num second_last_profit, last_profit = last_profit, curr_profit return last_profit
class Solution: def delete_and_earn(self, nums: list[int]) -> int: num_profits = dict() for num in nums: num_profits[num] = num_profits.get(num, 0) + num sorted_nums = sorted(num_profits.keys()) second_last_profit = 0 last_profit = num_profits[sorted_nums[0]] for idx in range(1, len(sorted_nums)): profit_with_curr_num = num_profits[sorted_nums[idx]] if sorted_nums[idx - 1] == sorted_nums[idx] - 1: curr_profit = max(last_profit, second_last_profit + profit_with_curr_num) else: curr_profit = last_profit + profit_with_curr_num (second_last_profit, last_profit) = (last_profit, curr_profit) return last_profit
class BaseStorage(object): def get_rule(self, name): raise NotImplementedError() def get_ruleset(self, name): raise NotImplementedError()
class Basestorage(object): def get_rule(self, name): raise not_implemented_error() def get_ruleset(self, name): raise not_implemented_error()
# https://projecteuler.net/problem=19 def is_leap(year): if year%4 != 0: return False if year%100 == 0 and year%400 != 0: return False return True def year_days(year): if is_leap(year): return 366 return 365 def month_days(month, year): if month == 4 or month == 6 or month == 9 or month == 11: return 30 if month == 2: if is_leap(year): return 29 return 28 return 31 day_19000101 = 1 days_1900 = year_days(1900) day_next_day1 = (day_19000101 + days_1900)%7 print(day_19000101, days_1900, day_next_day1) sum = 0 for i in range(1901, 2001): for j in range(1, 13): if day_next_day1 == 0: print(i, j) sum = sum + 1 days = month_days(j, i) day_next_day1 = (day_next_day1 + days)%7 #print(i, j, days, day_next_day1) print(sum)
def is_leap(year): if year % 4 != 0: return False if year % 100 == 0 and year % 400 != 0: return False return True def year_days(year): if is_leap(year): return 366 return 365 def month_days(month, year): if month == 4 or month == 6 or month == 9 or (month == 11): return 30 if month == 2: if is_leap(year): return 29 return 28 return 31 day_19000101 = 1 days_1900 = year_days(1900) day_next_day1 = (day_19000101 + days_1900) % 7 print(day_19000101, days_1900, day_next_day1) sum = 0 for i in range(1901, 2001): for j in range(1, 13): if day_next_day1 == 0: print(i, j) sum = sum + 1 days = month_days(j, i) day_next_day1 = (day_next_day1 + days) % 7 print(sum)
class Config: ngram = 2 train_set = "data/rmrb.txt" modified_train_set = "data/rmrb_modified.txt" test_set = "" model_file = "" param_file = "" word_max_len = 10 proposals_keep_ratio = 1.0 use_re = 1 subseq_num = 15
class Config: ngram = 2 train_set = 'data/rmrb.txt' modified_train_set = 'data/rmrb_modified.txt' test_set = '' model_file = '' param_file = '' word_max_len = 10 proposals_keep_ratio = 1.0 use_re = 1 subseq_num = 15
def execucoes(): return int(input()) def entradas(): return input().split(' ') def imprimir(v): print(v) def tamanho_a(a): return len(a) def tamanho_b(b): return len(b) def diferenca_tamanhos(a, b): return (len(a) <= len(b)) def analisar(e, i, s): a, b = e if(diferenca_tamanhos(a, b)): for i in range(tamanho_a(a)): s += a[i] s += b[i] s += b[tamanho_a(a):] else: for i in range(tamanho_b(b)): s += a[i] s += b[i] s += a[tamanho_b(b):] return s def combinador(): n = execucoes() for i in range(n): imprimir(analisar(entradas(), i, '')) combinador()
def execucoes(): return int(input()) def entradas(): return input().split(' ') def imprimir(v): print(v) def tamanho_a(a): return len(a) def tamanho_b(b): return len(b) def diferenca_tamanhos(a, b): return len(a) <= len(b) def analisar(e, i, s): (a, b) = e if diferenca_tamanhos(a, b): for i in range(tamanho_a(a)): s += a[i] s += b[i] s += b[tamanho_a(a):] else: for i in range(tamanho_b(b)): s += a[i] s += b[i] s += a[tamanho_b(b):] return s def combinador(): n = execucoes() for i in range(n): imprimir(analisar(entradas(), i, '')) combinador()
class Solution: def allPossibleFBT(self, N): def constr(N): if N == 1: yield TreeNode(0) for i in range(1, N, 2): for l in constr(i): for r in constr(N - i - 1): m = TreeNode(0) m.left = l m.right = r yield m return list(constr(N))
class Solution: def all_possible_fbt(self, N): def constr(N): if N == 1: yield tree_node(0) for i in range(1, N, 2): for l in constr(i): for r in constr(N - i - 1): m = tree_node(0) m.left = l m.right = r yield m return list(constr(N))
def findDecision(obj): #obj[0]: Passanger, obj[1]: Weather, obj[2]: Time, obj[3]: Coupon, obj[4]: Coupon_validity, obj[5]: Gender, obj[6]: Age, obj[7]: Maritalstatus, obj[8]: Children, obj[9]: Education, obj[10]: Occupation, obj[11]: Income, obj[12]: Bar, obj[13]: Coffeehouse, obj[14]: Restaurant20to50, obj[15]: Direction_same, obj[16]: Distance # {"feature": "Maritalstatus", "instances": 34, "metric_value": 0.99, "depth": 1} if obj[7]>0: # {"feature": "Age", "instances": 25, "metric_value": 0.9896, "depth": 2} if obj[6]<=5: # {"feature": "Time", "instances": 21, "metric_value": 0.9984, "depth": 3} if obj[2]<=1: # {"feature": "Occupation", "instances": 13, "metric_value": 0.8905, "depth": 4} if obj[10]<=13: # {"feature": "Coupon", "instances": 11, "metric_value": 0.684, "depth": 5} if obj[3]>0: # {"feature": "Distance", "instances": 10, "metric_value": 0.469, "depth": 6} if obj[16]<=2: return 'False' elif obj[16]>2: # {"feature": "Coupon_validity", "instances": 2, "metric_value": 1.0, "depth": 7} if obj[4]<=0: return 'True' elif obj[4]>0: return 'False' else: return 'False' else: return 'True' elif obj[3]<=0: return 'True' else: return 'True' elif obj[10]>13: return 'True' else: return 'True' elif obj[2]>1: # {"feature": "Occupation", "instances": 8, "metric_value": 0.8113, "depth": 4} if obj[10]<=7: return 'True' elif obj[10]>7: # {"feature": "Weather", "instances": 3, "metric_value": 0.9183, "depth": 5} if obj[1]<=0: return 'False' elif obj[1]>0: return 'True' else: return 'True' else: return 'False' else: return 'True' elif obj[6]>5: return 'True' else: return 'True' elif obj[7]<=0: # {"feature": "Age", "instances": 9, "metric_value": 0.5033, "depth": 2} if obj[6]>0: return 'False' elif obj[6]<=0: return 'True' else: return 'True' else: return 'False'
def find_decision(obj): if obj[7] > 0: if obj[6] <= 5: if obj[2] <= 1: if obj[10] <= 13: if obj[3] > 0: if obj[16] <= 2: return 'False' elif obj[16] > 2: if obj[4] <= 0: return 'True' elif obj[4] > 0: return 'False' else: return 'False' else: return 'True' elif obj[3] <= 0: return 'True' else: return 'True' elif obj[10] > 13: return 'True' else: return 'True' elif obj[2] > 1: if obj[10] <= 7: return 'True' elif obj[10] > 7: if obj[1] <= 0: return 'False' elif obj[1] > 0: return 'True' else: return 'True' else: return 'False' else: return 'True' elif obj[6] > 5: return 'True' else: return 'True' elif obj[7] <= 0: if obj[6] > 0: return 'False' elif obj[6] <= 0: return 'True' else: return 'True' else: return 'False'
macs_response = '''<?xml version="1.0"?><s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:wxf="http://schemas.xmlsoap.org/ws/2004/09/transfer"><s:Header><wsa:To>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</wsa:To><wsa:Action>http://www.ibm.com/iBMC/sp/Monitors/GetHostMacAddressesResponse</wsa:Action><wsa:RelatesTo>dt:1348742659504</wsa:RelatesTo><wsa:From><wsa:Address>http://10.10.10.10/wsman</wsa:Address></wsa:From><wsa:MessageID>uuid:111efb9a-f7d8-4977-8472-bcad40212a71</wsa:MessageID></s:Header><s:Body><GetHostMacAddressesResponse><HostMACaddress><HostMaddr><Description>Host Ethernet MAC Address 1</Description><Address>6E:F3:DD:E5:96:40</Address></HostMaddr><HostMaddr><Description>Host Ethernet MAC Address 2</Description><Address>6E:F3:DD:E5:96:42</Address></HostMaddr></HostMACaddress></GetHostMacAddressesResponse></s:Body></s:Envelope> ''' memory_response = '''<?xml version="1.0"?><s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:wxf="http://schemas.xmlsoap.org/ws/2004/09/transfer"><s:Header><wsa:To>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</wsa:To><wsa:Action>http://www.ibm.com/iBMC/sp/Monitors/GetMemoryInfoResponse</wsa:Action><wsa:RelatesTo>dt:1348742659500</wsa:RelatesTo><wsa:From><wsa:Address>http://10.10.10.10/wsman</wsa:Address></wsa:From><wsa:MessageID>uuid:dc560696-2ba4-4917-b7e7-1aac1983b727</wsa:MessageID></s:Header><s:Body><GetMemoryInfoResponse><Memory><MemoryInfo><Description>DIMM 2</Description><PartNumber>HMT351R7BFR4A-H9</PartNumber><SerialNumber>33b8a62f</SerialNumber><ManufactureDate>4511</ManufactureDate><Type>DDR3</Type><Size>4</Size></MemoryInfo><MemoryInfo><Description>DIMM 3</Description><PartNumber>M393B1K70CH0-YH9</PartNumber><SerialNumber>b38aa385</SerialNumber><ManufactureDate>2211</ManufactureDate><Type>DDR3</Type><Size>8</Size></MemoryInfo><MemoryInfo><Description>DIMM 6</Description><PartNumber>M393B1K70CH0-YH9</PartNumber><SerialNumber>a78aa385</SerialNumber><ManufactureDate>2211</ManufactureDate><Type>DDR3</Type><Size>8</Size></MemoryInfo><MemoryInfo><Description>DIMM 9</Description><PartNumber>EBJ40RF4ECFA-DJ-F</PartNumber><SerialNumber>b524042b</SerialNumber><ManufactureDate>4711</ManufactureDate><Type>DDR3</Type><Size>4</Size></MemoryInfo><MemoryInfo><Description>DIMM 11</Description><PartNumber>EBJ40RF4ECFA-DJ-F</PartNumber><SerialNumber>ba24042b</SerialNumber><ManufactureDate>4711</ManufactureDate><Type>DDR3</Type><Size>4</Size></MemoryInfo><MemoryInfo><Description>DIMM 12</Description><PartNumber>M393B1K70CH0-YH9</PartNumber><SerialNumber>8e8aa385</SerialNumber><ManufactureDate>2211</ManufactureDate><Type>DDR3</Type><Size>8</Size></MemoryInfo><MemoryInfo><Description>DIMM 15</Description><PartNumber>M393B1K70CH0-YH9</PartNumber><SerialNumber>7feda482</SerialNumber><ManufactureDate>2211</ManufactureDate><Type>DDR3</Type><Size>8</Size></MemoryInfo><MemoryInfo><Description>DIMM 18</Description><PartNumber>EBJ40RF4ECFA-DJ-F</PartNumber><SerialNumber>d924042b</SerialNumber><ManufactureDate>4711</ManufactureDate><Type>DDR3</Type><Size>4</Size></MemoryInfo></Memory></GetMemoryInfoResponse></s:Body></s:Envelope> ''' generic_data_response = '''<?xml version="1.0"?><s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:wxf="http://schemas.xmlsoap.org/ws/2004/09/transfer"><s:Header><wsa:To>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</wsa:To><wsa:Action>http://www.ibm.com/iBMC/sp/Monitors/GetVitalProductDataResponse</wsa:Action><wsa:RelatesTo>dt:1348742659499</wsa:RelatesTo><wsa:From><wsa:Address>http://10.10.10.10/wsman</wsa:Address></wsa:From><wsa:MessageID>uuid:e6829941-2510-4b3d-b9f3-61c7be372dfd</wsa:MessageID></s:Header><s:Body><GetVitalProductDataResponse><GetVitalProductDataResponse><MachineLevelVPD><ProductName>System x3550 M3</ProductName><MachineTypeAndModel>794452G</MachineTypeAndModel><SerialNumber>KD55ARA</SerialNumber><UUID>99A4E4A303023961B8E1561E33328996</UUID></MachineLevelVPD><ComponentLevelVPD><FRUNumber>59Y3915</FRUNumber><FRUName>DASD Backplane 1</FRUName><SerialNumber>Y010RW1AR1Y0</SerialNumber><MfgID>USIS</MfgID></ComponentLevelVPD><ComponentLevelVPD><FRUNumber>39Y7229</FRUNumber><FRUName>Power Supply 1</FRUName><SerialNumber>K1411183222</SerialNumber><MfgID>ACBE</MfgID></ComponentLevelVPD><ComponentLevelVPD><FRUNumber>39Y7229</FRUNumber><FRUName>Power Supply 2</FRUName><SerialNumber>K141115Y2BK</SerialNumber><MfgID>ACBE</MfgID></ComponentLevelVPD><ComponentActivityLog><FRUNumber>39Y7229</FRUNumber><FRUName>Power Supply 1</FRUName><SerialNumber>K1411183222</SerialNumber><MfgID>ACBE</MfgID><Action>Added</Action><TimeStamp>11/25/2011:13:53:13</TimeStamp></ComponentActivityLog><ComponentActivityLog><FRUNumber>59Y3915</FRUNumber><FRUName>DASD Backplane 1</FRUName><SerialNumber>Y010RW1AR1Y0</SerialNumber><MfgID>USIS</MfgID><Action>Added</Action><TimeStamp>11/25/2011:13:53:13</TimeStamp></ComponentActivityLog><ComponentActivityLog><FRUNumber>39Y7229</FRUNumber><FRUName>Power Supply 2</FRUName><SerialNumber>K141115Y2BK</SerialNumber><MfgID>ACBE</MfgID><Action>Added</Action><TimeStamp>01/27/2012:10:28:39</TimeStamp></ComponentActivityLog><VPD><FirmwareName>IMM</FirmwareName><VersionString>YUOOC7E</VersionString><ReleaseDate>09/30/2011</ReleaseDate></VPD><VPD><FirmwareName>UEFI</FirmwareName><VersionString>D6E154A</VersionString><ReleaseDate>09/23/2011</ReleaseDate></VPD><VPD><FirmwareName>DSA</FirmwareName><VersionString>DSYT89P </VersionString><ReleaseDate>10/28/2011</ReleaseDate></VPD></GetVitalProductDataResponse></GetVitalProductDataResponse></s:Body></s:Envelope> ''' sn_response = '''<?xml version="1.0"?><s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:wxf="http://schemas.xmlsoap.org/ws/2004/09/transfer"><s:Header><wsa:To>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</wsa:To><wsa:Action>http://www.ibm.com/iBMC/sp/iBMCControl/GetSPNameSettingsResponse</wsa:Action><wsa:RelatesTo>dt:1348742647137</wsa:RelatesTo><wsa:From><wsa:Address>http://10.10.10.10/wsman</wsa:Address></wsa:From><wsa:MessageID>uuid:d2ac4b59-9f60-456e-a182-6a077557e4c1</wsa:MessageID></s:Header><s:Body><GetSPNameSettingsResponse><SPName>SN# KD55ARA</SPName></GetSPNameSettingsResponse></s:Body></s:Envelope> ''' processors_response = '''<?xml version="1.0"?><s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:wxf="http://schemas.xmlsoap.org/ws/2004/09/transfer"><s:Header><wsa:To>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</wsa:To><wsa:Action>http://www.ibm.com/iBMC/sp/Monitors/GetProcessorInfoResponse</wsa:Action><wsa:RelatesTo>dt:1348757382511</wsa:RelatesTo><wsa:From><wsa:Address>http://rack-605-12-mgmt.dc2/wsman</wsa:Address></wsa:From><wsa:MessageID>uuid:9e5ec08d-0fac-449a-80fa-37cc78290a21</wsa:MessageID></s:Header><s:Body><GetProcessorInfoResponse><Processor><ProcessorInfo><Description>Processor 1</Description><Speed>2666</Speed><Identifier>3030363735304141</Identifier><Type>Central</Type><Family>Intel Xeon</Family><Cores>8</Cores><Threads>1</Threads><Voltage>1.087000</Voltage><Datawidth>64</Datawidth></ProcessorInfo><ProcessorInfo><Description>Processor 2</Description><Speed>2666</Speed><Identifier>3030363735304141</Identifier><Type>Central</Type><Family>Intel Xeon</Family><Cores>8</Cores><Threads>1</Threads><Voltage>1.087000</Voltage><Datawidth>64</Datawidth></ProcessorInfo></Processor></GetProcessorInfoResponse></s:Body></s:Envelope> '''
macs_response = '<?xml version="1.0"?><s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:wxf="http://schemas.xmlsoap.org/ws/2004/09/transfer"><s:Header><wsa:To>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</wsa:To><wsa:Action>http://www.ibm.com/iBMC/sp/Monitors/GetHostMacAddressesResponse</wsa:Action><wsa:RelatesTo>dt:1348742659504</wsa:RelatesTo><wsa:From><wsa:Address>http://10.10.10.10/wsman</wsa:Address></wsa:From><wsa:MessageID>uuid:111efb9a-f7d8-4977-8472-bcad40212a71</wsa:MessageID></s:Header><s:Body><GetHostMacAddressesResponse><HostMACaddress><HostMaddr><Description>Host Ethernet MAC Address 1</Description><Address>6E:F3:DD:E5:96:40</Address></HostMaddr><HostMaddr><Description>Host Ethernet MAC Address 2</Description><Address>6E:F3:DD:E5:96:42</Address></HostMaddr></HostMACaddress></GetHostMacAddressesResponse></s:Body></s:Envelope>\n' memory_response = '<?xml version="1.0"?><s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:wxf="http://schemas.xmlsoap.org/ws/2004/09/transfer"><s:Header><wsa:To>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</wsa:To><wsa:Action>http://www.ibm.com/iBMC/sp/Monitors/GetMemoryInfoResponse</wsa:Action><wsa:RelatesTo>dt:1348742659500</wsa:RelatesTo><wsa:From><wsa:Address>http://10.10.10.10/wsman</wsa:Address></wsa:From><wsa:MessageID>uuid:dc560696-2ba4-4917-b7e7-1aac1983b727</wsa:MessageID></s:Header><s:Body><GetMemoryInfoResponse><Memory><MemoryInfo><Description>DIMM 2</Description><PartNumber>HMT351R7BFR4A-H9</PartNumber><SerialNumber>33b8a62f</SerialNumber><ManufactureDate>4511</ManufactureDate><Type>DDR3</Type><Size>4</Size></MemoryInfo><MemoryInfo><Description>DIMM 3</Description><PartNumber>M393B1K70CH0-YH9</PartNumber><SerialNumber>b38aa385</SerialNumber><ManufactureDate>2211</ManufactureDate><Type>DDR3</Type><Size>8</Size></MemoryInfo><MemoryInfo><Description>DIMM 6</Description><PartNumber>M393B1K70CH0-YH9</PartNumber><SerialNumber>a78aa385</SerialNumber><ManufactureDate>2211</ManufactureDate><Type>DDR3</Type><Size>8</Size></MemoryInfo><MemoryInfo><Description>DIMM 9</Description><PartNumber>EBJ40RF4ECFA-DJ-F</PartNumber><SerialNumber>b524042b</SerialNumber><ManufactureDate>4711</ManufactureDate><Type>DDR3</Type><Size>4</Size></MemoryInfo><MemoryInfo><Description>DIMM 11</Description><PartNumber>EBJ40RF4ECFA-DJ-F</PartNumber><SerialNumber>ba24042b</SerialNumber><ManufactureDate>4711</ManufactureDate><Type>DDR3</Type><Size>4</Size></MemoryInfo><MemoryInfo><Description>DIMM 12</Description><PartNumber>M393B1K70CH0-YH9</PartNumber><SerialNumber>8e8aa385</SerialNumber><ManufactureDate>2211</ManufactureDate><Type>DDR3</Type><Size>8</Size></MemoryInfo><MemoryInfo><Description>DIMM 15</Description><PartNumber>M393B1K70CH0-YH9</PartNumber><SerialNumber>7feda482</SerialNumber><ManufactureDate>2211</ManufactureDate><Type>DDR3</Type><Size>8</Size></MemoryInfo><MemoryInfo><Description>DIMM 18</Description><PartNumber>EBJ40RF4ECFA-DJ-F</PartNumber><SerialNumber>d924042b</SerialNumber><ManufactureDate>4711</ManufactureDate><Type>DDR3</Type><Size>4</Size></MemoryInfo></Memory></GetMemoryInfoResponse></s:Body></s:Envelope>\n' generic_data_response = '<?xml version="1.0"?><s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:wxf="http://schemas.xmlsoap.org/ws/2004/09/transfer"><s:Header><wsa:To>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</wsa:To><wsa:Action>http://www.ibm.com/iBMC/sp/Monitors/GetVitalProductDataResponse</wsa:Action><wsa:RelatesTo>dt:1348742659499</wsa:RelatesTo><wsa:From><wsa:Address>http://10.10.10.10/wsman</wsa:Address></wsa:From><wsa:MessageID>uuid:e6829941-2510-4b3d-b9f3-61c7be372dfd</wsa:MessageID></s:Header><s:Body><GetVitalProductDataResponse><GetVitalProductDataResponse><MachineLevelVPD><ProductName>System x3550 M3</ProductName><MachineTypeAndModel>794452G</MachineTypeAndModel><SerialNumber>KD55ARA</SerialNumber><UUID>99A4E4A303023961B8E1561E33328996</UUID></MachineLevelVPD><ComponentLevelVPD><FRUNumber>59Y3915</FRUNumber><FRUName>DASD Backplane 1</FRUName><SerialNumber>Y010RW1AR1Y0</SerialNumber><MfgID>USIS</MfgID></ComponentLevelVPD><ComponentLevelVPD><FRUNumber>39Y7229</FRUNumber><FRUName>Power Supply 1</FRUName><SerialNumber>K1411183222</SerialNumber><MfgID>ACBE</MfgID></ComponentLevelVPD><ComponentLevelVPD><FRUNumber>39Y7229</FRUNumber><FRUName>Power Supply 2</FRUName><SerialNumber>K141115Y2BK</SerialNumber><MfgID>ACBE</MfgID></ComponentLevelVPD><ComponentActivityLog><FRUNumber>39Y7229</FRUNumber><FRUName>Power Supply 1</FRUName><SerialNumber>K1411183222</SerialNumber><MfgID>ACBE</MfgID><Action>Added</Action><TimeStamp>11/25/2011:13:53:13</TimeStamp></ComponentActivityLog><ComponentActivityLog><FRUNumber>59Y3915</FRUNumber><FRUName>DASD Backplane 1</FRUName><SerialNumber>Y010RW1AR1Y0</SerialNumber><MfgID>USIS</MfgID><Action>Added</Action><TimeStamp>11/25/2011:13:53:13</TimeStamp></ComponentActivityLog><ComponentActivityLog><FRUNumber>39Y7229</FRUNumber><FRUName>Power Supply 2</FRUName><SerialNumber>K141115Y2BK</SerialNumber><MfgID>ACBE</MfgID><Action>Added</Action><TimeStamp>01/27/2012:10:28:39</TimeStamp></ComponentActivityLog><VPD><FirmwareName>IMM</FirmwareName><VersionString>YUOOC7E</VersionString><ReleaseDate>09/30/2011</ReleaseDate></VPD><VPD><FirmwareName>UEFI</FirmwareName><VersionString>D6E154A</VersionString><ReleaseDate>09/23/2011</ReleaseDate></VPD><VPD><FirmwareName>DSA</FirmwareName><VersionString>DSYT89P </VersionString><ReleaseDate>10/28/2011</ReleaseDate></VPD></GetVitalProductDataResponse></GetVitalProductDataResponse></s:Body></s:Envelope>\n' sn_response = '<?xml version="1.0"?><s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:wxf="http://schemas.xmlsoap.org/ws/2004/09/transfer"><s:Header><wsa:To>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</wsa:To><wsa:Action>http://www.ibm.com/iBMC/sp/iBMCControl/GetSPNameSettingsResponse</wsa:Action><wsa:RelatesTo>dt:1348742647137</wsa:RelatesTo><wsa:From><wsa:Address>http://10.10.10.10/wsman</wsa:Address></wsa:From><wsa:MessageID>uuid:d2ac4b59-9f60-456e-a182-6a077557e4c1</wsa:MessageID></s:Header><s:Body><GetSPNameSettingsResponse><SPName>SN# KD55ARA</SPName></GetSPNameSettingsResponse></s:Body></s:Envelope>\n' processors_response = '<?xml version="1.0"?><s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:wxf="http://schemas.xmlsoap.org/ws/2004/09/transfer"><s:Header><wsa:To>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</wsa:To><wsa:Action>http://www.ibm.com/iBMC/sp/Monitors/GetProcessorInfoResponse</wsa:Action><wsa:RelatesTo>dt:1348757382511</wsa:RelatesTo><wsa:From><wsa:Address>http://rack-605-12-mgmt.dc2/wsman</wsa:Address></wsa:From><wsa:MessageID>uuid:9e5ec08d-0fac-449a-80fa-37cc78290a21</wsa:MessageID></s:Header><s:Body><GetProcessorInfoResponse><Processor><ProcessorInfo><Description>Processor 1</Description><Speed>2666</Speed><Identifier>3030363735304141</Identifier><Type>Central</Type><Family>Intel Xeon</Family><Cores>8</Cores><Threads>1</Threads><Voltage>1.087000</Voltage><Datawidth>64</Datawidth></ProcessorInfo><ProcessorInfo><Description>Processor 2</Description><Speed>2666</Speed><Identifier>3030363735304141</Identifier><Type>Central</Type><Family>Intel Xeon</Family><Cores>8</Cores><Threads>1</Threads><Voltage>1.087000</Voltage><Datawidth>64</Datawidth></ProcessorInfo></Processor></GetProcessorInfoResponse></s:Body></s:Envelope>\n'
# Copyright (C) 2021 Intel Corporation # SPDX-License-Identifier: Apache-2.0 VERIFIED_OP_REFERENCES = [ 'Abs-1', 'Acos-1', 'Add-1', 'Asin-1', 'Asinh-3', 'Assign-6', 'AvgPool-1', 'BatchNormInference-5', 'BatchToSpace-2', 'BinaryConvolution-1', 'Broadcast-1', 'Broadcast-3', 'Bucketize-3', 'Ceiling-1', 'CTCGreedyDecoder-1', 'CTCGreedyDecoderSeqLen-6', 'Concat-1', 'Convert-1', 'ConvertLike-1', 'Convolution-1', 'Constant-1', 'Cos-1', 'Cosh-1', 'DeformableConvolution-1', 'DeformablePSROIPooling-1', 'DepthToSpace-1', 'DetectionOutput-1', 'Divide-1', 'ExperimentalDetectronDetectionOutput-6', 'ExperimentalDetectronGenerateProposalsSingleImage-6', 'ExperimentalDetectronPriorGridGenerator-6', 'ExperimentalDetectronROIFeatureExtractor-6', 'ExperimentalDetectronTopKROIs-6', 'FakeQuantize-1', 'Floor-1' 'FloorMod-1' 'GRUSequence-5', 'Gather-1', 'GatherElements-6', 'GatherND-5', 'Gelu-7', 'GRN-1', 'GroupConvolution-1', 'GroupConvolutionBackpropData-1', 'GRUSequence-5', 'HSigmoid-5', 'HSwish-4', 'HardSigmoid-1', 'Interpolate-4', 'LRN-1', 'LSTMCell-4', 'LSTMSequence-5', 'LogSoftmax-5', 'Loop-5', 'MVN-6', 'Maximum-1', 'MaxPool-1', 'Mish-4', 'Multiply-1', 'Negative-1', 'NonMaxSuppression-4', 'NonMaxSuppression-5', 'NonZero-3', 'NormalizeL2-1', 'PriorBox-1', 'PriorBoxClustered-1', 'Proposal-1', 'Proposal-4', 'PSROIPooling-1', 'RNNSequence-5', 'ROIAlign-3', 'ROIPooling-2', 'Range-1', 'Range-4', 'ReadValue-6', 'ReduceL1-4', 'ReduceL2-4', 'ReduceLogicalAnd-1', 'ReduceLogicalOr-1', 'ReduceMax-1', 'ReduceMean-1', 'ReduceMin-1', 'ReduceProd-1', 'ReduceSum-1', 'RegionYOLO-1', 'Relu-1', 'ReorgYOLO-2', 'Result-1' 'Round-5', 'SpaceToDepth-1', 'ScatterNDUpdate-4', 'Select-1', 'ShapeOf-1', 'ShapeOf-3', 'ShuffleChannels-1', 'Sigmoid-1', 'Sign-1', 'Sin-1', 'Sinh-1' 'SoftPlus-4', 'Softmax-1', 'Split-1', 'Squeeze-1', 'StridedSlice-1', 'Subtract-1', 'Swish-4', 'Tile-1', 'TopK-1', 'TopK-3', 'Transpose-1', 'Unsqueeze-1', 'VariadicSplit-1', ]
verified_op_references = ['Abs-1', 'Acos-1', 'Add-1', 'Asin-1', 'Asinh-3', 'Assign-6', 'AvgPool-1', 'BatchNormInference-5', 'BatchToSpace-2', 'BinaryConvolution-1', 'Broadcast-1', 'Broadcast-3', 'Bucketize-3', 'Ceiling-1', 'CTCGreedyDecoder-1', 'CTCGreedyDecoderSeqLen-6', 'Concat-1', 'Convert-1', 'ConvertLike-1', 'Convolution-1', 'Constant-1', 'Cos-1', 'Cosh-1', 'DeformableConvolution-1', 'DeformablePSROIPooling-1', 'DepthToSpace-1', 'DetectionOutput-1', 'Divide-1', 'ExperimentalDetectronDetectionOutput-6', 'ExperimentalDetectronGenerateProposalsSingleImage-6', 'ExperimentalDetectronPriorGridGenerator-6', 'ExperimentalDetectronROIFeatureExtractor-6', 'ExperimentalDetectronTopKROIs-6', 'FakeQuantize-1', 'Floor-1FloorMod-1GRUSequence-5', 'Gather-1', 'GatherElements-6', 'GatherND-5', 'Gelu-7', 'GRN-1', 'GroupConvolution-1', 'GroupConvolutionBackpropData-1', 'GRUSequence-5', 'HSigmoid-5', 'HSwish-4', 'HardSigmoid-1', 'Interpolate-4', 'LRN-1', 'LSTMCell-4', 'LSTMSequence-5', 'LogSoftmax-5', 'Loop-5', 'MVN-6', 'Maximum-1', 'MaxPool-1', 'Mish-4', 'Multiply-1', 'Negative-1', 'NonMaxSuppression-4', 'NonMaxSuppression-5', 'NonZero-3', 'NormalizeL2-1', 'PriorBox-1', 'PriorBoxClustered-1', 'Proposal-1', 'Proposal-4', 'PSROIPooling-1', 'RNNSequence-5', 'ROIAlign-3', 'ROIPooling-2', 'Range-1', 'Range-4', 'ReadValue-6', 'ReduceL1-4', 'ReduceL2-4', 'ReduceLogicalAnd-1', 'ReduceLogicalOr-1', 'ReduceMax-1', 'ReduceMean-1', 'ReduceMin-1', 'ReduceProd-1', 'ReduceSum-1', 'RegionYOLO-1', 'Relu-1', 'ReorgYOLO-2', 'Result-1Round-5', 'SpaceToDepth-1', 'ScatterNDUpdate-4', 'Select-1', 'ShapeOf-1', 'ShapeOf-3', 'ShuffleChannels-1', 'Sigmoid-1', 'Sign-1', 'Sin-1', 'Sinh-1SoftPlus-4', 'Softmax-1', 'Split-1', 'Squeeze-1', 'StridedSlice-1', 'Subtract-1', 'Swish-4', 'Tile-1', 'TopK-1', 'TopK-3', 'Transpose-1', 'Unsqueeze-1', 'VariadicSplit-1']
# Copyright 2015 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. # This dictionary of GPU information was captured from a run of # Telemetry on a Linux workstation with NVIDIA GPU. It helps test # telemetry.internal.platform's GPUInfo class, and specifically the # attributes it expects to find in the dictionary; if the code changes # in an incompatible way, tests using this fake GPU info will begin # failing, indicating this fake data must be updated. # # To regenerate it, import pdb in # telemetry/internal/platform/gpu_info.py and add a call to # pdb.set_trace() in GPUInfo.FromDict before the return statement. # Print the attrs dictionary in the debugger and copy/paste the result # on the right-hand side of this assignment. Then run: # # pyformat [this file name] | sed -e "s/'/'/g" # # and put the output into this file. FAKE_GPU_INFO = { 'feature_status': { 'flash_stage3d': 'enabled', 'gpu_compositing': 'enabled', 'video_decode': 'unavailable_software', 'flash_3d': 'enabled', 'webgl': 'enabled', 'video_encode': 'enabled', 'multiple_raster_threads': 'enabled_on', '2d_canvas': 'unavailable_software', 'rasterization': 'disabled_software', 'flash_stage3d_baseline': 'enabled' }, 'aux_attributes': { 'optimus': False, 'sandboxed': True, 'basic_info_state': 1, 'adapter_luid': 0.0, 'driver_version': '331.79', 'direct_rendering': True, 'amd_switchable': False, 'context_info_state': 1, 'process_crash_count': 0, 'pixel_shader_version': '4.40', 'gl_ws_version': '1.4', 'can_lose_context': False, 'driver_vendor': 'NVIDIA', 'max_msaa_samples': '64', 'software_rendering': False, 'gl_version': '4.4.0 NVIDIA 331.79', 'gl_ws_vendor': 'NVIDIA Corporation', 'vertex_shader_version': '4.40', 'initialization_time': 1.284043, 'gl_reset_notification_strategy': 33362, 'gl_ws_extensions': 'GLX_EXT_visual_info GLX_EXT_visual_rating GLX_SGIX_fbconfig ' 'GLX_SGIX_pbuffer GLX_SGI_video_sync GLX_SGI_swap_control ' 'GLX_EXT_swap_control GLX_EXT_swap_control_tear ' 'GLX_EXT_texture_from_pixmap GLX_EXT_buffer_age ' 'GLX_ARB_create_context GLX_ARB_create_context_profile ' 'GLX_EXT_create_context_es_profile ' 'GLX_EXT_create_context_es2_profile ' 'GLX_ARB_create_context_robustness GLX_ARB_multisample ' 'GLX_NV_float_buffer GLX_ARB_fbconfig_float GLX_NV_swap_group' ' GLX_EXT_framebuffer_sRGB GLX_NV_multisample_coverage ' 'GLX_NV_copy_image GLX_NV_video_capture ', 'gl_renderer': 'Quadro 600/PCIe/SSE2', 'driver_date': '', 'gl_vendor': 'NVIDIA Corporation', 'gl_extensions': 'GL_AMD_multi_draw_indirect GL_ARB_arrays_of_arrays ' 'GL_ARB_base_instance GL_ARB_blend_func_extended ' 'GL_ARB_buffer_storage GL_ARB_clear_buffer_object ' 'GL_ARB_clear_texture GL_ARB_color_buffer_float ' 'GL_ARB_compatibility GL_ARB_compressed_texture_pixel_storage' ' GL_ARB_conservative_depth GL_ARB_compute_shader ' 'GL_ARB_compute_variable_group_size GL_ARB_copy_buffer ' 'GL_ARB_copy_image GL_ARB_debug_output ' 'GL_ARB_depth_buffer_float GL_ARB_depth_clamp ' 'GL_ARB_depth_texture GL_ARB_draw_buffers ' 'GL_ARB_draw_buffers_blend GL_ARB_draw_indirect ' 'GL_ARB_draw_elements_base_vertex GL_ARB_draw_instanced ' 'GL_ARB_enhanced_layouts GL_ARB_ES2_compatibility ' 'GL_ARB_ES3_compatibility GL_ARB_explicit_attrib_location ' 'GL_ARB_explicit_uniform_location ' 'GL_ARB_fragment_coord_conventions ' 'GL_ARB_fragment_layer_viewport GL_ARB_fragment_program ' 'GL_ARB_fragment_program_shadow GL_ARB_fragment_shader ' 'GL_ARB_framebuffer_no_attachments GL_ARB_framebuffer_object ' 'GL_ARB_framebuffer_sRGB GL_ARB_geometry_shader4 ' 'GL_ARB_get_program_binary GL_ARB_gpu_shader5 ' 'GL_ARB_gpu_shader_fp64 GL_ARB_half_float_pixel ' 'GL_ARB_half_float_vertex GL_ARB_imaging ' 'GL_ARB_indirect_parameters GL_ARB_instanced_arrays ' 'GL_ARB_internalformat_query GL_ARB_internalformat_query2 ' 'GL_ARB_invalidate_subdata GL_ARB_map_buffer_alignment ' 'GL_ARB_map_buffer_range GL_ARB_multi_bind ' 'GL_ARB_multi_draw_indirect GL_ARB_multisample ' 'GL_ARB_multitexture GL_ARB_occlusion_query ' 'GL_ARB_occlusion_query2 GL_ARB_pixel_buffer_object ' 'GL_ARB_point_parameters GL_ARB_point_sprite ' 'GL_ARB_program_interface_query GL_ARB_provoking_vertex ' 'GL_ARB_robust_buffer_access_behavior GL_ARB_robustness ' 'GL_ARB_sample_shading GL_ARB_sampler_objects ' 'GL_ARB_seamless_cube_map GL_ARB_separate_shader_objects ' 'GL_ARB_shader_atomic_counters GL_ARB_shader_bit_encoding ' 'GL_ARB_shader_draw_parameters GL_ARB_shader_group_vote ' 'GL_ARB_shader_image_load_store GL_ARB_shader_image_size ' 'GL_ARB_shader_objects GL_ARB_shader_precision ' 'GL_ARB_query_buffer_object ' 'GL_ARB_shader_storage_buffer_object GL_ARB_shader_subroutine' ' GL_ARB_shader_texture_lod GL_ARB_shading_language_100 ' 'GL_ARB_shading_language_420pack ' 'GL_ARB_shading_language_include ' 'GL_ARB_shading_language_packing GL_ARB_shadow ' 'GL_ARB_stencil_texturing GL_ARB_sync ' 'GL_ARB_tessellation_shader GL_ARB_texture_border_clamp ' 'GL_ARB_texture_buffer_object ' 'GL_ARB_texture_buffer_object_rgb32 ' 'GL_ARB_texture_buffer_range GL_ARB_texture_compression ' 'GL_ARB_texture_compression_bptc ' 'GL_ARB_texture_compression_rgtc GL_ARB_texture_cube_map ' 'GL_ARB_texture_cube_map_array GL_ARB_texture_env_add ' 'GL_ARB_texture_env_combine GL_ARB_texture_env_crossbar ' 'GL_ARB_texture_env_dot3 GL_ARB_texture_float ' 'GL_ARB_texture_gather GL_ARB_texture_mirror_clamp_to_edge ' 'GL_ARB_texture_mirrored_repeat GL_ARB_texture_multisample ' 'GL_ARB_texture_non_power_of_two GL_ARB_texture_query_levels ' 'GL_ARB_texture_query_lod GL_ARB_texture_rectangle ' 'GL_ARB_texture_rg GL_ARB_texture_rgb10_a2ui ' 'GL_ARB_texture_stencil8 GL_ARB_texture_storage ' 'GL_ARB_texture_storage_multisample GL_ARB_texture_swizzle ' 'GL_ARB_texture_view GL_ARB_timer_query ' 'GL_ARB_transform_feedback2 GL_ARB_transform_feedback3 ' 'GL_ARB_transform_feedback_instanced GL_ARB_transpose_matrix ' 'GL_ARB_uniform_buffer_object GL_ARB_vertex_array_bgra ' 'GL_ARB_vertex_array_object GL_ARB_vertex_attrib_64bit ' 'GL_ARB_vertex_attrib_binding GL_ARB_vertex_buffer_object ' 'GL_ARB_vertex_program GL_ARB_vertex_shader ' 'GL_ARB_vertex_type_10f_11f_11f_rev ' 'GL_ARB_vertex_type_2_10_10_10_rev GL_ARB_viewport_array ' 'GL_ARB_window_pos GL_ATI_draw_buffers GL_ATI_texture_float ' 'GL_ATI_texture_mirror_once GL_S3_s3tc GL_EXT_texture_env_add' ' GL_EXT_abgr GL_EXT_bgra GL_EXT_bindable_uniform ' 'GL_EXT_blend_color GL_EXT_blend_equation_separate ' 'GL_EXT_blend_func_separate GL_EXT_blend_minmax ' 'GL_EXT_blend_subtract GL_EXT_compiled_vertex_array ' 'GL_EXT_Cg_shader GL_EXT_depth_bounds_test ' 'GL_EXT_direct_state_access GL_EXT_draw_buffers2 ' 'GL_EXT_draw_instanced GL_EXT_draw_range_elements ' 'GL_EXT_fog_coord GL_EXT_framebuffer_blit ' 'GL_EXT_framebuffer_multisample ' 'GL_EXTX_framebuffer_mixed_formats ' 'GL_EXT_framebuffer_multisample_blit_scaled ' 'GL_EXT_framebuffer_object GL_EXT_framebuffer_sRGB ' 'GL_EXT_geometry_shader4 GL_EXT_gpu_program_parameters ' 'GL_EXT_gpu_shader4 GL_EXT_multi_draw_arrays ' 'GL_EXT_packed_depth_stencil GL_EXT_packed_float ' 'GL_EXT_packed_pixels GL_EXT_pixel_buffer_object ' 'GL_EXT_point_parameters GL_EXT_provoking_vertex ' 'GL_EXT_rescale_normal GL_EXT_secondary_color ' 'GL_EXT_separate_shader_objects ' 'GL_EXT_separate_specular_color ' 'GL_EXT_shader_image_load_store GL_EXT_shadow_funcs ' 'GL_EXT_stencil_two_side GL_EXT_stencil_wrap GL_EXT_texture3D' ' GL_EXT_texture_array GL_EXT_texture_buffer_object ' 'GL_EXT_texture_compression_dxt1 ' 'GL_EXT_texture_compression_latc ' 'GL_EXT_texture_compression_rgtc ' 'GL_EXT_texture_compression_s3tc GL_EXT_texture_cube_map ' 'GL_EXT_texture_edge_clamp GL_EXT_texture_env_combine ' 'GL_EXT_texture_env_dot3 GL_EXT_texture_filter_anisotropic ' 'GL_EXT_texture_integer GL_EXT_texture_lod ' 'GL_EXT_texture_lod_bias GL_EXT_texture_mirror_clamp ' 'GL_EXT_texture_object GL_EXT_texture_shared_exponent ' 'GL_EXT_texture_sRGB GL_EXT_texture_sRGB_decode ' 'GL_EXT_texture_storage GL_EXT_texture_swizzle ' 'GL_EXT_timer_query GL_EXT_transform_feedback2 ' 'GL_EXT_vertex_array GL_EXT_vertex_array_bgra ' 'GL_EXT_vertex_attrib_64bit GL_EXT_x11_sync_object ' 'GL_EXT_import_sync_object GL_IBM_rasterpos_clip ' 'GL_IBM_texture_mirrored_repeat GL_KHR_debug ' 'GL_KTX_buffer_region GL_NV_bindless_multi_draw_indirect ' 'GL_NV_blend_equation_advanced GL_NV_blend_square ' 'GL_NV_compute_program5 GL_NV_conditional_render ' 'GL_NV_copy_depth_to_color GL_NV_copy_image ' 'GL_NV_depth_buffer_float GL_NV_depth_clamp ' 'GL_NV_draw_texture GL_NV_ES1_1_compatibility ' 'GL_NV_explicit_multisample GL_NV_fence GL_NV_float_buffer ' 'GL_NV_fog_distance GL_NV_fragment_program ' 'GL_NV_fragment_program_option GL_NV_fragment_program2 ' 'GL_NV_framebuffer_multisample_coverage ' 'GL_NV_geometry_shader4 GL_NV_gpu_program4 ' 'GL_NV_gpu_program4_1 GL_NV_gpu_program5 ' 'GL_NV_gpu_program5_mem_extended GL_NV_gpu_program_fp64 ' 'GL_NV_gpu_shader5 GL_NV_half_float GL_NV_light_max_exponent ' 'GL_NV_multisample_coverage GL_NV_multisample_filter_hint ' 'GL_NV_occlusion_query GL_NV_packed_depth_stencil ' 'GL_NV_parameter_buffer_object GL_NV_parameter_buffer_object2' ' GL_NV_path_rendering GL_NV_pixel_data_range ' 'GL_NV_point_sprite GL_NV_primitive_restart ' 'GL_NV_register_combiners GL_NV_register_combiners2 ' 'GL_NV_shader_atomic_counters GL_NV_shader_atomic_float ' 'GL_NV_shader_buffer_load GL_NV_shader_storage_buffer_object ' 'GL_ARB_sparse_texture GL_NV_texgen_reflection ' 'GL_NV_texture_barrier GL_NV_texture_compression_vtc ' 'GL_NV_texture_env_combine4 GL_NV_texture_expand_normal ' 'GL_NV_texture_multisample GL_NV_texture_rectangle ' 'GL_NV_texture_shader GL_NV_texture_shader2 ' 'GL_NV_texture_shader3 GL_NV_transform_feedback ' 'GL_NV_transform_feedback2 GL_NV_vdpau_interop ' 'GL_NV_vertex_array_range GL_NV_vertex_array_range2 ' 'GL_NV_vertex_attrib_integer_64bit ' 'GL_NV_vertex_buffer_unified_memory GL_NV_vertex_program ' 'GL_NV_vertex_program1_1 GL_NV_vertex_program2 ' 'GL_NV_vertex_program2_option GL_NV_vertex_program3 ' 'GL_NVX_conditional_render GL_NVX_gpu_memory_info ' 'GL_SGIS_generate_mipmap GL_SGIS_texture_lod ' 'GL_SGIX_depth_texture GL_SGIX_shadow GL_SUN_slice_accum ' }, 'devices': [ { 'device_string': '', 'vendor_id': 4318.0, 'device_id': 3576.0, 'vendor_string': '' }], 'driver_bug_workarounds': ['clear_uniforms_before_first_program_use', 'disable_gl_path_rendering', 'init_gl_position_in_vertex_shader', 'init_vertex_attributes', 'remove_pow_with_constant_exponent', 'scalarize_vec_and_mat_constructor_args', 'use_current_program_after_successful_link', 'use_virtualized_gl_contexts'] }
fake_gpu_info = {'feature_status': {'flash_stage3d': 'enabled', 'gpu_compositing': 'enabled', 'video_decode': 'unavailable_software', 'flash_3d': 'enabled', 'webgl': 'enabled', 'video_encode': 'enabled', 'multiple_raster_threads': 'enabled_on', '2d_canvas': 'unavailable_software', 'rasterization': 'disabled_software', 'flash_stage3d_baseline': 'enabled'}, 'aux_attributes': {'optimus': False, 'sandboxed': True, 'basic_info_state': 1, 'adapter_luid': 0.0, 'driver_version': '331.79', 'direct_rendering': True, 'amd_switchable': False, 'context_info_state': 1, 'process_crash_count': 0, 'pixel_shader_version': '4.40', 'gl_ws_version': '1.4', 'can_lose_context': False, 'driver_vendor': 'NVIDIA', 'max_msaa_samples': '64', 'software_rendering': False, 'gl_version': '4.4.0 NVIDIA 331.79', 'gl_ws_vendor': 'NVIDIA Corporation', 'vertex_shader_version': '4.40', 'initialization_time': 1.284043, 'gl_reset_notification_strategy': 33362, 'gl_ws_extensions': 'GLX_EXT_visual_info GLX_EXT_visual_rating GLX_SGIX_fbconfig GLX_SGIX_pbuffer GLX_SGI_video_sync GLX_SGI_swap_control GLX_EXT_swap_control GLX_EXT_swap_control_tear GLX_EXT_texture_from_pixmap GLX_EXT_buffer_age GLX_ARB_create_context GLX_ARB_create_context_profile GLX_EXT_create_context_es_profile GLX_EXT_create_context_es2_profile GLX_ARB_create_context_robustness GLX_ARB_multisample GLX_NV_float_buffer GLX_ARB_fbconfig_float GLX_NV_swap_group GLX_EXT_framebuffer_sRGB GLX_NV_multisample_coverage GLX_NV_copy_image GLX_NV_video_capture ', 'gl_renderer': 'Quadro 600/PCIe/SSE2', 'driver_date': '', 'gl_vendor': 'NVIDIA Corporation', 'gl_extensions': 'GL_AMD_multi_draw_indirect GL_ARB_arrays_of_arrays GL_ARB_base_instance GL_ARB_blend_func_extended GL_ARB_buffer_storage GL_ARB_clear_buffer_object GL_ARB_clear_texture GL_ARB_color_buffer_float GL_ARB_compatibility GL_ARB_compressed_texture_pixel_storage GL_ARB_conservative_depth GL_ARB_compute_shader GL_ARB_compute_variable_group_size GL_ARB_copy_buffer GL_ARB_copy_image GL_ARB_debug_output GL_ARB_depth_buffer_float GL_ARB_depth_clamp GL_ARB_depth_texture GL_ARB_draw_buffers GL_ARB_draw_buffers_blend GL_ARB_draw_indirect GL_ARB_draw_elements_base_vertex GL_ARB_draw_instanced GL_ARB_enhanced_layouts GL_ARB_ES2_compatibility GL_ARB_ES3_compatibility GL_ARB_explicit_attrib_location GL_ARB_explicit_uniform_location GL_ARB_fragment_coord_conventions GL_ARB_fragment_layer_viewport GL_ARB_fragment_program GL_ARB_fragment_program_shadow GL_ARB_fragment_shader GL_ARB_framebuffer_no_attachments GL_ARB_framebuffer_object GL_ARB_framebuffer_sRGB GL_ARB_geometry_shader4 GL_ARB_get_program_binary GL_ARB_gpu_shader5 GL_ARB_gpu_shader_fp64 GL_ARB_half_float_pixel GL_ARB_half_float_vertex GL_ARB_imaging GL_ARB_indirect_parameters GL_ARB_instanced_arrays GL_ARB_internalformat_query GL_ARB_internalformat_query2 GL_ARB_invalidate_subdata GL_ARB_map_buffer_alignment GL_ARB_map_buffer_range GL_ARB_multi_bind GL_ARB_multi_draw_indirect GL_ARB_multisample GL_ARB_multitexture GL_ARB_occlusion_query GL_ARB_occlusion_query2 GL_ARB_pixel_buffer_object GL_ARB_point_parameters GL_ARB_point_sprite GL_ARB_program_interface_query GL_ARB_provoking_vertex GL_ARB_robust_buffer_access_behavior GL_ARB_robustness GL_ARB_sample_shading GL_ARB_sampler_objects GL_ARB_seamless_cube_map GL_ARB_separate_shader_objects GL_ARB_shader_atomic_counters GL_ARB_shader_bit_encoding GL_ARB_shader_draw_parameters GL_ARB_shader_group_vote GL_ARB_shader_image_load_store GL_ARB_shader_image_size GL_ARB_shader_objects GL_ARB_shader_precision GL_ARB_query_buffer_object GL_ARB_shader_storage_buffer_object GL_ARB_shader_subroutine GL_ARB_shader_texture_lod GL_ARB_shading_language_100 GL_ARB_shading_language_420pack GL_ARB_shading_language_include GL_ARB_shading_language_packing GL_ARB_shadow GL_ARB_stencil_texturing GL_ARB_sync GL_ARB_tessellation_shader GL_ARB_texture_border_clamp GL_ARB_texture_buffer_object GL_ARB_texture_buffer_object_rgb32 GL_ARB_texture_buffer_range GL_ARB_texture_compression GL_ARB_texture_compression_bptc GL_ARB_texture_compression_rgtc GL_ARB_texture_cube_map GL_ARB_texture_cube_map_array GL_ARB_texture_env_add GL_ARB_texture_env_combine GL_ARB_texture_env_crossbar GL_ARB_texture_env_dot3 GL_ARB_texture_float GL_ARB_texture_gather GL_ARB_texture_mirror_clamp_to_edge GL_ARB_texture_mirrored_repeat GL_ARB_texture_multisample GL_ARB_texture_non_power_of_two GL_ARB_texture_query_levels GL_ARB_texture_query_lod GL_ARB_texture_rectangle GL_ARB_texture_rg GL_ARB_texture_rgb10_a2ui GL_ARB_texture_stencil8 GL_ARB_texture_storage GL_ARB_texture_storage_multisample GL_ARB_texture_swizzle GL_ARB_texture_view GL_ARB_timer_query GL_ARB_transform_feedback2 GL_ARB_transform_feedback3 GL_ARB_transform_feedback_instanced GL_ARB_transpose_matrix GL_ARB_uniform_buffer_object GL_ARB_vertex_array_bgra GL_ARB_vertex_array_object GL_ARB_vertex_attrib_64bit GL_ARB_vertex_attrib_binding GL_ARB_vertex_buffer_object GL_ARB_vertex_program GL_ARB_vertex_shader GL_ARB_vertex_type_10f_11f_11f_rev GL_ARB_vertex_type_2_10_10_10_rev GL_ARB_viewport_array GL_ARB_window_pos GL_ATI_draw_buffers GL_ATI_texture_float GL_ATI_texture_mirror_once GL_S3_s3tc GL_EXT_texture_env_add GL_EXT_abgr GL_EXT_bgra GL_EXT_bindable_uniform GL_EXT_blend_color GL_EXT_blend_equation_separate GL_EXT_blend_func_separate GL_EXT_blend_minmax GL_EXT_blend_subtract GL_EXT_compiled_vertex_array GL_EXT_Cg_shader GL_EXT_depth_bounds_test GL_EXT_direct_state_access GL_EXT_draw_buffers2 GL_EXT_draw_instanced GL_EXT_draw_range_elements GL_EXT_fog_coord GL_EXT_framebuffer_blit GL_EXT_framebuffer_multisample GL_EXTX_framebuffer_mixed_formats GL_EXT_framebuffer_multisample_blit_scaled GL_EXT_framebuffer_object GL_EXT_framebuffer_sRGB GL_EXT_geometry_shader4 GL_EXT_gpu_program_parameters GL_EXT_gpu_shader4 GL_EXT_multi_draw_arrays GL_EXT_packed_depth_stencil GL_EXT_packed_float GL_EXT_packed_pixels GL_EXT_pixel_buffer_object GL_EXT_point_parameters GL_EXT_provoking_vertex GL_EXT_rescale_normal GL_EXT_secondary_color GL_EXT_separate_shader_objects GL_EXT_separate_specular_color GL_EXT_shader_image_load_store GL_EXT_shadow_funcs GL_EXT_stencil_two_side GL_EXT_stencil_wrap GL_EXT_texture3D GL_EXT_texture_array GL_EXT_texture_buffer_object GL_EXT_texture_compression_dxt1 GL_EXT_texture_compression_latc GL_EXT_texture_compression_rgtc GL_EXT_texture_compression_s3tc GL_EXT_texture_cube_map GL_EXT_texture_edge_clamp GL_EXT_texture_env_combine GL_EXT_texture_env_dot3 GL_EXT_texture_filter_anisotropic GL_EXT_texture_integer GL_EXT_texture_lod GL_EXT_texture_lod_bias GL_EXT_texture_mirror_clamp GL_EXT_texture_object GL_EXT_texture_shared_exponent GL_EXT_texture_sRGB GL_EXT_texture_sRGB_decode GL_EXT_texture_storage GL_EXT_texture_swizzle GL_EXT_timer_query GL_EXT_transform_feedback2 GL_EXT_vertex_array GL_EXT_vertex_array_bgra GL_EXT_vertex_attrib_64bit GL_EXT_x11_sync_object GL_EXT_import_sync_object GL_IBM_rasterpos_clip GL_IBM_texture_mirrored_repeat GL_KHR_debug GL_KTX_buffer_region GL_NV_bindless_multi_draw_indirect GL_NV_blend_equation_advanced GL_NV_blend_square GL_NV_compute_program5 GL_NV_conditional_render GL_NV_copy_depth_to_color GL_NV_copy_image GL_NV_depth_buffer_float GL_NV_depth_clamp GL_NV_draw_texture GL_NV_ES1_1_compatibility GL_NV_explicit_multisample GL_NV_fence GL_NV_float_buffer GL_NV_fog_distance GL_NV_fragment_program GL_NV_fragment_program_option GL_NV_fragment_program2 GL_NV_framebuffer_multisample_coverage GL_NV_geometry_shader4 GL_NV_gpu_program4 GL_NV_gpu_program4_1 GL_NV_gpu_program5 GL_NV_gpu_program5_mem_extended GL_NV_gpu_program_fp64 GL_NV_gpu_shader5 GL_NV_half_float GL_NV_light_max_exponent GL_NV_multisample_coverage GL_NV_multisample_filter_hint GL_NV_occlusion_query GL_NV_packed_depth_stencil GL_NV_parameter_buffer_object GL_NV_parameter_buffer_object2 GL_NV_path_rendering GL_NV_pixel_data_range GL_NV_point_sprite GL_NV_primitive_restart GL_NV_register_combiners GL_NV_register_combiners2 GL_NV_shader_atomic_counters GL_NV_shader_atomic_float GL_NV_shader_buffer_load GL_NV_shader_storage_buffer_object GL_ARB_sparse_texture GL_NV_texgen_reflection GL_NV_texture_barrier GL_NV_texture_compression_vtc GL_NV_texture_env_combine4 GL_NV_texture_expand_normal GL_NV_texture_multisample GL_NV_texture_rectangle GL_NV_texture_shader GL_NV_texture_shader2 GL_NV_texture_shader3 GL_NV_transform_feedback GL_NV_transform_feedback2 GL_NV_vdpau_interop GL_NV_vertex_array_range GL_NV_vertex_array_range2 GL_NV_vertex_attrib_integer_64bit GL_NV_vertex_buffer_unified_memory GL_NV_vertex_program GL_NV_vertex_program1_1 GL_NV_vertex_program2 GL_NV_vertex_program2_option GL_NV_vertex_program3 GL_NVX_conditional_render GL_NVX_gpu_memory_info GL_SGIS_generate_mipmap GL_SGIS_texture_lod GL_SGIX_depth_texture GL_SGIX_shadow GL_SUN_slice_accum '}, 'devices': [{'device_string': '', 'vendor_id': 4318.0, 'device_id': 3576.0, 'vendor_string': ''}], 'driver_bug_workarounds': ['clear_uniforms_before_first_program_use', 'disable_gl_path_rendering', 'init_gl_position_in_vertex_shader', 'init_vertex_attributes', 'remove_pow_with_constant_exponent', 'scalarize_vec_and_mat_constructor_args', 'use_current_program_after_successful_link', 'use_virtualized_gl_contexts']}
for i in range(int(input())): number_of_candies = int(input()) candies_weights = list(map(int, input().split())) bob_pos = number_of_candies - 1 alice_pos = 0 bob_current_weight = 0 alice_current_weight = 0 last_equal_candies_total_number = 0 while alice_pos <= bob_pos: if alice_current_weight <= bob_current_weight: alice_current_weight += candies_weights[alice_pos] alice_pos += 1 else: bob_current_weight += candies_weights[bob_pos] bob_pos -= 1 if alice_current_weight == bob_current_weight: last_equal_candies_total_number = alice_pos + (number_of_candies - bob_pos - 1) print(last_equal_candies_total_number)
for i in range(int(input())): number_of_candies = int(input()) candies_weights = list(map(int, input().split())) bob_pos = number_of_candies - 1 alice_pos = 0 bob_current_weight = 0 alice_current_weight = 0 last_equal_candies_total_number = 0 while alice_pos <= bob_pos: if alice_current_weight <= bob_current_weight: alice_current_weight += candies_weights[alice_pos] alice_pos += 1 else: bob_current_weight += candies_weights[bob_pos] bob_pos -= 1 if alice_current_weight == bob_current_weight: last_equal_candies_total_number = alice_pos + (number_of_candies - bob_pos - 1) print(last_equal_candies_total_number)
# -------------- # Code starts here # Create the lists class_1 = ['geoffrey hinton', 'andrew ng', 'sebastian raschka', 'yoshu bengio'] class_2 = ['hilary mason', 'carla gentry', 'corinna cortes'] # Concatenate both the strings new_class = class_1+class_2 print(new_class) # Append the list new_class.append('peter warden') # Print updated list print(new_class) # Remove the element from the list new_class.remove('carla gentry') # Print the list print(new_class) # Create the Dictionary courses = {"math": 65, "english": 70, "history": 80, "french": 70, "science":60} # Slice the dict and stores the all subjects marks in variable total = 65+70+80+70+60 print(total) # Store the all the subject in one variable `Total` # Print the total # Insert percentage formula percentage =float(total)*(100/500) # Print the percentage print(percentage) # Create the Dictionary mathematics = {"geoffery hinton" :78, "andrew ng" :95, "sebastian raschka" :65, "yoshua benjio" :50, "hilary mason" :70, "corinna cortes" :66, "peter warden" :75} topper = max(mathematics,key = mathematics.get) print(topper) # Given string print(topper.split()) # Create variable first_name first_name = 'andrew' # Create variable Last_name and store last two element in the list Last_name ='ng' # Concatenate the string full_name = Last_name+' '+first_name # print the full_name print(full_name) # print the name in upper case certificate_name = full_name.upper() print(certificate_name) # Code ends here
class_1 = ['geoffrey hinton', 'andrew ng', 'sebastian raschka', 'yoshu bengio'] class_2 = ['hilary mason', 'carla gentry', 'corinna cortes'] new_class = class_1 + class_2 print(new_class) new_class.append('peter warden') print(new_class) new_class.remove('carla gentry') print(new_class) courses = {'math': 65, 'english': 70, 'history': 80, 'french': 70, 'science': 60} total = 65 + 70 + 80 + 70 + 60 print(total) percentage = float(total) * (100 / 500) print(percentage) mathematics = {'geoffery hinton': 78, 'andrew ng': 95, 'sebastian raschka': 65, 'yoshua benjio': 50, 'hilary mason': 70, 'corinna cortes': 66, 'peter warden': 75} topper = max(mathematics, key=mathematics.get) print(topper) print(topper.split()) first_name = 'andrew' last_name = 'ng' full_name = Last_name + ' ' + first_name print(full_name) certificate_name = full_name.upper() print(certificate_name)
# # PySNMP MIB module Nortel-MsCarrier-MscPassport-SubnetInterfaceMIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/Nortel-MsCarrier-MscPassport-SubnetInterfaceMIB # Produced by pysmi-0.3.4 at Wed May 1 14:31:21 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") ConstraintsUnion, ConstraintsIntersection, SingleValueConstraint, ValueRangeConstraint, ValueSizeConstraint = mibBuilder.importSymbols("ASN1-REFINEMENT", "ConstraintsUnion", "ConstraintsIntersection", "SingleValueConstraint", "ValueRangeConstraint", "ValueSizeConstraint") mscMod, mscModIndex = mibBuilder.importSymbols("Nortel-MsCarrier-MscPassport-BaseShelfMIB", "mscMod", "mscModIndex") DisplayString, RowStatus, StorageType, Unsigned32, Integer32 = mibBuilder.importSymbols("Nortel-MsCarrier-MscPassport-StandardTextualConventionsMIB", "DisplayString", "RowStatus", "StorageType", "Unsigned32", "Integer32") DigitString, NonReplicated = mibBuilder.importSymbols("Nortel-MsCarrier-MscPassport-TextualConventionsMIB", "DigitString", "NonReplicated") mscPassportMIBs, = mibBuilder.importSymbols("Nortel-MsCarrier-MscPassport-UsefulDefinitionsMIB", "mscPassportMIBs") ModuleCompliance, NotificationGroup = mibBuilder.importSymbols("SNMPv2-CONF", "ModuleCompliance", "NotificationGroup") Counter32, Counter64, IpAddress, ObjectIdentity, Bits, iso, Unsigned32, Gauge32, MibIdentifier, MibScalar, MibTable, MibTableRow, MibTableColumn, NotificationType, Integer32, TimeTicks, ModuleIdentity = mibBuilder.importSymbols("SNMPv2-SMI", "Counter32", "Counter64", "IpAddress", "ObjectIdentity", "Bits", "iso", "Unsigned32", "Gauge32", "MibIdentifier", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "NotificationType", "Integer32", "TimeTicks", "ModuleIdentity") DisplayString, TextualConvention = mibBuilder.importSymbols("SNMPv2-TC", "DisplayString", "TextualConvention") subnetInterfaceMIB = MibIdentifier((1, 3, 6, 1, 4, 1, 562, 36, 2, 2, 45)) mscModVcs = MibIdentifier((1, 3, 6, 1, 4, 1, 562, 36, 2, 1, 16, 2)) mscModVcsRowStatusTable = MibTable((1, 3, 6, 1, 4, 1, 562, 36, 2, 1, 16, 2, 1), ) if mibBuilder.loadTexts: mscModVcsRowStatusTable.setStatus('mandatory') if mibBuilder.loadTexts: mscModVcsRowStatusTable.setDescription('This entry controls the addition and deletion of mscModVcs components.') mscModVcsRowStatusEntry = MibTableRow((1, 3, 6, 1, 4, 1, 562, 36, 2, 1, 16, 2, 1, 1), ).setIndexNames((0, "Nortel-MsCarrier-MscPassport-BaseShelfMIB", "mscModIndex"), (0, "Nortel-MsCarrier-MscPassport-SubnetInterfaceMIB", "mscModVcsIndex")) if mibBuilder.loadTexts: mscModVcsRowStatusEntry.setStatus('mandatory') if mibBuilder.loadTexts: mscModVcsRowStatusEntry.setDescription('A single entry in the table represents a single mscModVcs component.') mscModVcsRowStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 36, 2, 1, 16, 2, 1, 1, 1), RowStatus()).setMaxAccess("readwrite") if mibBuilder.loadTexts: mscModVcsRowStatus.setStatus('mandatory') if mibBuilder.loadTexts: mscModVcsRowStatus.setDescription('This variable is used as the basis for SNMP naming of mscModVcs components. These components can be added and deleted.') mscModVcsComponentName = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 36, 2, 1, 16, 2, 1, 1, 2), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: mscModVcsComponentName.setStatus('mandatory') if mibBuilder.loadTexts: mscModVcsComponentName.setDescription("This variable provides the component's string name for use with the ASCII Console Interface") mscModVcsStorageType = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 36, 2, 1, 16, 2, 1, 1, 4), StorageType()).setMaxAccess("readonly") if mibBuilder.loadTexts: mscModVcsStorageType.setStatus('mandatory') if mibBuilder.loadTexts: mscModVcsStorageType.setDescription('This variable represents the storage type value for the mscModVcs tables.') mscModVcsIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 36, 2, 1, 16, 2, 1, 1, 10), NonReplicated()) if mibBuilder.loadTexts: mscModVcsIndex.setStatus('mandatory') if mibBuilder.loadTexts: mscModVcsIndex.setDescription('This variable represents the index for the mscModVcs tables.') mscModVcsAccOptTable = MibTable((1, 3, 6, 1, 4, 1, 562, 36, 2, 1, 16, 2, 10), ) if mibBuilder.loadTexts: mscModVcsAccOptTable.setStatus('mandatory') if mibBuilder.loadTexts: mscModVcsAccOptTable.setDescription("Accounting information is owned by the Vc System; it is stored in the Vc Accounting component, which itself is considered to be a component on the switch. The Accounting Component contains a bit map indicating which of the accounting facilities are to be spooled in the accounting record - for example, bit '0' if set indicates that the accounting facility with facility code H.00 should be spooled if present in the Vc for accounting purposes. The data contained in the Vc Accounting must be identical network wide even though the component can be changed and upgraded on a module by module basis.") mscModVcsAccOptEntry = MibTableRow((1, 3, 6, 1, 4, 1, 562, 36, 2, 1, 16, 2, 10, 1), ).setIndexNames((0, "Nortel-MsCarrier-MscPassport-BaseShelfMIB", "mscModIndex"), (0, "Nortel-MsCarrier-MscPassport-SubnetInterfaceMIB", "mscModVcsIndex")) if mibBuilder.loadTexts: mscModVcsAccOptEntry.setStatus('mandatory') if mibBuilder.loadTexts: mscModVcsAccOptEntry.setDescription('An entry in the mscModVcsAccOptTable.') mscModVcsSegmentSize = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 36, 2, 1, 16, 2, 10, 1, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12))).clone(namedValues=NamedValues(("n1", 0), ("n2", 1), ("n4", 2), ("n8", 3), ("n16", 4), ("n32", 5), ("n64", 6), ("n128", 7), ("n256", 8), ("n512", 9), ("n1024", 10), ("n2048", 11), ("n4096", 12))).clone('n128')).setMaxAccess("readwrite") if mibBuilder.loadTexts: mscModVcsSegmentSize.setStatus('mandatory') if mibBuilder.loadTexts: mscModVcsSegmentSize.setDescription('This attribute specifies the segment size for accounting of national calls. Minimum allowed segment size is 1. If data segment is sent which is less than segmentSize it is still counted as one segment.') mscModVcsUnitsCounted = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 36, 2, 1, 16, 2, 10, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1))).clone(namedValues=NamedValues(("segments", 0), ("frames", 1))).clone('segments')).setMaxAccess("readwrite") if mibBuilder.loadTexts: mscModVcsUnitsCounted.setStatus('mandatory') if mibBuilder.loadTexts: mscModVcsUnitsCounted.setDescription('This attribute specifies what is counted by frame services. If set to frames, frames are counted, else segments are counted.') mscModVcsAccountingFax = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 36, 2, 1, 16, 2, 10, 1, 3), OctetString().subtype(subtypeSpec=ValueSizeConstraint(1, 1)).setFixedLength(1).clone(hexValue="20")).setMaxAccess("readwrite") if mibBuilder.loadTexts: mscModVcsAccountingFax.setStatus('mandatory') if mibBuilder.loadTexts: mscModVcsAccountingFax.setDescription('Each value corresponds to an accounting facility code, of which there are currently 10 facility codes defined with codes H.00 to H.09, and corresponding to the above 10 facilities. Each of the above facilities may or may not be present and stored in the Vc for accounting purposes, depending on the nature of the call. For example, only those Vcs where a NUI (Network User Identifier) is used for charging or identification purposes will have a NUI stored in the Vc. Description of bits: notused0(0) notused1(1) originalCalledAddressFax(2)') mscModVcsGenerationMode = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 36, 2, 1, 16, 2, 10, 1, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1))).clone(namedValues=NamedValues(("bothEnds", 0), ("singleEnd", 1))).clone('singleEnd')).setMaxAccess("readwrite") if mibBuilder.loadTexts: mscModVcsGenerationMode.setStatus('mandatory') if mibBuilder.loadTexts: mscModVcsGenerationMode.setDescription('This attribute specifies part of the rules by which the network generates accounting records. If set to bothEnds, then both ends of the Vc generate accounting records. If set to singleEnd, then the charged end of the Vc generates accounting records. In single end generation mode, if the call does not clear gracefully, both ends of the Vc will generate accounting record.') mscModVcsAddOptTable = MibTable((1, 3, 6, 1, 4, 1, 562, 36, 2, 1, 16, 2, 12), ) if mibBuilder.loadTexts: mscModVcsAddOptTable.setStatus('mandatory') if mibBuilder.loadTexts: mscModVcsAddOptTable.setDescription('The Vc AddressingOptions group describes the addressing parameters. It is currently owned by the Vc. Most of the data contained in the Vc AddressingOptions group is identical network wide even though the group can be changed and upgraded on a module by module basis.') mscModVcsAddOptEntry = MibTableRow((1, 3, 6, 1, 4, 1, 562, 36, 2, 1, 16, 2, 12, 1), ).setIndexNames((0, "Nortel-MsCarrier-MscPassport-BaseShelfMIB", "mscModIndex"), (0, "Nortel-MsCarrier-MscPassport-SubnetInterfaceMIB", "mscModVcsIndex")) if mibBuilder.loadTexts: mscModVcsAddOptEntry.setStatus('mandatory') if mibBuilder.loadTexts: mscModVcsAddOptEntry.setDescription('An entry in the mscModVcsAddOptTable.') mscModVcsDefaultNumberingPlan = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 36, 2, 1, 16, 2, 12, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1))).clone(namedValues=NamedValues(("x121", 0), ("e164", 1))).clone('x121')).setMaxAccess("readwrite") if mibBuilder.loadTexts: mscModVcsDefaultNumberingPlan.setStatus('mandatory') if mibBuilder.loadTexts: mscModVcsDefaultNumberingPlan.setDescription('This attribute specifies the numbering plan used which determines the address format: X.121-- the international numbering plan for public packet switched data networks or E.164-- the international numbering plan for ISDN and PSTN. The default numbering plan does not need to be consistent across all of the nodes in the network.') mscModVcsNetworkIdType = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 36, 2, 1, 16, 2, 12, 1, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1))).clone(namedValues=NamedValues(("dnic", 0), ("inic", 1))).clone('dnic')).setMaxAccess("readonly") if mibBuilder.loadTexts: mscModVcsNetworkIdType.setStatus('mandatory') if mibBuilder.loadTexts: mscModVcsNetworkIdType.setDescription('This attribute specifies whether the network uses a DNIC or INIC. It is used by X.75 Gateways to indicate whether in network the DNIC or INIC is used in various utilities. If it is DNIC it can be DNIC or DCC type. If it is INIC it can be 4 digits only.') mscModVcsX121Type = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 36, 2, 1, 16, 2, 12, 1, 5), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1))).clone(namedValues=NamedValues(("dnic", 0), ("dcc", 1))).clone('dnic')).setMaxAccess("readwrite") if mibBuilder.loadTexts: mscModVcsX121Type.setStatus('mandatory') if mibBuilder.loadTexts: mscModVcsX121Type.setDescription('This attribute specifies whether DNIC mode or DCC mode is used in X.121 address of international calls. If DCC is specified, then the first 3 digits of each DNA must be the Network ID Code. If this attribute is changed all Dnas in the network must start with this code. Numbering plan is affected by the change.') mscModVcsNetworkIdCode = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 36, 2, 1, 16, 2, 12, 1, 6), DigitString().subtype(subtypeSpec=ValueSizeConstraint(3, 4))).setMaxAccess("readwrite") if mibBuilder.loadTexts: mscModVcsNetworkIdCode.setStatus('mandatory') if mibBuilder.loadTexts: mscModVcsNetworkIdCode.setDescription('This attribute specifies the DNIC (Data Network ID Code) of the network or DCC code.') mscModVcsX121IntlAddresses = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 36, 2, 1, 16, 2, 12, 1, 7), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1))).clone(namedValues=NamedValues(("disallowed", 0), ("allowed", 1))).clone('allowed')).setMaxAccess("readwrite") if mibBuilder.loadTexts: mscModVcsX121IntlAddresses.setStatus('mandatory') if mibBuilder.loadTexts: mscModVcsX121IntlAddresses.setDescription('This attribute indicates if any DTE is allowed to signal international addresses.') mscModVcsX121IntllPrefixDigit = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 36, 2, 1, 16, 2, 12, 1, 8), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(0, 9)).clone(9)).setMaxAccess("readwrite") if mibBuilder.loadTexts: mscModVcsX121IntllPrefixDigit.setStatus('mandatory') if mibBuilder.loadTexts: mscModVcsX121IntllPrefixDigit.setDescription('This attribute indicates the prefix digit to be used for X.121 international calls. When this digit is provided the call will have full international address.') mscModVcsX121MinAddressLength = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 36, 2, 1, 16, 2, 12, 1, 11), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(1, 16)).clone(1)).setMaxAccess("readwrite") if mibBuilder.loadTexts: mscModVcsX121MinAddressLength.setStatus('mandatory') if mibBuilder.loadTexts: mscModVcsX121MinAddressLength.setDescription('This attribute indicates minimum length of x121 address.') mscModVcsX121MaxAddressLength = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 36, 2, 1, 16, 2, 12, 1, 12), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(1, 16)).clone(15)).setMaxAccess("readwrite") if mibBuilder.loadTexts: mscModVcsX121MaxAddressLength.setStatus('mandatory') if mibBuilder.loadTexts: mscModVcsX121MaxAddressLength.setDescription('This attribute indicates maximum length of x121 address.') mscModVcsX121ToE164EscapeSignificance = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 36, 2, 1, 16, 2, 12, 1, 13), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1))).clone(namedValues=NamedValues(("no", 0), ("yes", 1))).clone('no')).setMaxAccess("readwrite") if mibBuilder.loadTexts: mscModVcsX121ToE164EscapeSignificance.setStatus('mandatory') if mibBuilder.loadTexts: mscModVcsX121ToE164EscapeSignificance.setDescription('This attribute specifies whether an X.121 to E.164 escape digit has significance in selecting an X.32 (analog) or an ISDN switched path. If two values are significant (the value 0 or the value 9) then yes is set to this attribute. If the value of the originally entered escape digit is not significant in routing the call then value of no is assigned to this attribute.') mscModVcsE164IntlFormatAllowed = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 36, 2, 1, 16, 2, 12, 1, 14), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1))).clone(namedValues=NamedValues(("disallowed", 0), ("allowed", 1))).clone('allowed')).setMaxAccess("readwrite") if mibBuilder.loadTexts: mscModVcsE164IntlFormatAllowed.setStatus('mandatory') if mibBuilder.loadTexts: mscModVcsE164IntlFormatAllowed.setDescription("This attribute indicates whether or not to allow national format E.164 addresses. If this attribute is set to a value of Yes (=1) then national format E.164 addresses are not allowed and international format addresses only are allowed. If this attribute is set to a value of No (=0), then national format E.164 addresses are allowed. If only international format E.164 addresses are allowed, then the 'e164NatlPrefixDigit' attribute is not required, nor is the 'e164IntlPrefixDigits' required.") mscModVcsE164IntlPrefixDigits = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 36, 2, 1, 16, 2, 12, 1, 15), DigitString().subtype(subtypeSpec=ValueSizeConstraint(0, 3)).clone(hexValue="30")).setMaxAccess("readwrite") if mibBuilder.loadTexts: mscModVcsE164IntlPrefixDigits.setStatus('mandatory') if mibBuilder.loadTexts: mscModVcsE164IntlPrefixDigits.setDescription("This attribute specifies the E.164 international prefix digits. If applicable, it is specified as 1 to 3 BCD digits. The 3 BCD digits are stored with the length of the international prefix in the low order nibble, nibble [0] followed by the most significant digit of the international prefix in the next low order nibble, nibble [1], etc. This attribute is not required if the corresponding attribute, 'e164IntlFormatOnly' is set to a value of Yes (=1).") mscModVcsE164NatlPrefixDigit = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 36, 2, 1, 16, 2, 12, 1, 16), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(0, 9)).clone(1)).setMaxAccess("readwrite") if mibBuilder.loadTexts: mscModVcsE164NatlPrefixDigit.setStatus('mandatory') if mibBuilder.loadTexts: mscModVcsE164NatlPrefixDigit.setDescription('This attribute contains the E.164 national prefix which may be added in front of E.164 local or national call. If e164IntlFormatOnly is set to 1, this attribute is not needed.') mscModVcsE164LocalAddressLength = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 36, 2, 1, 16, 2, 12, 1, 17), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(4, 15)).clone(7)).setMaxAccess("readwrite") if mibBuilder.loadTexts: mscModVcsE164LocalAddressLength.setStatus('mandatory') if mibBuilder.loadTexts: mscModVcsE164LocalAddressLength.setDescription('This attribute indicates the length of a local E.164 DNA on this module. This attribute is not required if the corresponding attribute, e164IntlFormatOnly is set to a value of yes. This attribute does not need to be consistent across all of the nodes in the network.') mscModVcsE164TeleCountryCode = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 36, 2, 1, 16, 2, 12, 1, 18), DigitString().subtype(subtypeSpec=ValueSizeConstraint(1, 4)).clone(hexValue="31")).setMaxAccess("readwrite") if mibBuilder.loadTexts: mscModVcsE164TeleCountryCode.setStatus('mandatory') if mibBuilder.loadTexts: mscModVcsE164TeleCountryCode.setDescription('This attribute specifies the E.164 Telephone Country Code (TCC) for the country in which the network resides. If applicable, it is specified as 1 to 3 BCD digits. The 3 BCD digits are stored with the length of the TCC in the low order nibble, nibble [0] followed by the most significant digit of the TCC in the next low order nibble, nibble [1], etc.') mscModVcsE164NatlMinAddressLength = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 36, 2, 1, 16, 2, 12, 1, 20), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(1, 16)).clone(1)).setMaxAccess("readwrite") if mibBuilder.loadTexts: mscModVcsE164NatlMinAddressLength.setStatus('mandatory') if mibBuilder.loadTexts: mscModVcsE164NatlMinAddressLength.setDescription('This attribute indicates minimum length of e164 national address.') mscModVcsE164NatlMaxAddressLength = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 36, 2, 1, 16, 2, 12, 1, 21), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(1, 16)).clone(15)).setMaxAccess("readwrite") if mibBuilder.loadTexts: mscModVcsE164NatlMaxAddressLength.setStatus('mandatory') if mibBuilder.loadTexts: mscModVcsE164NatlMaxAddressLength.setDescription('This attribute indicates maximum length of e164 national address.') mscModVcsE164IntlMinAddressLength = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 36, 2, 1, 16, 2, 12, 1, 22), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(1, 16)).clone(1)).setMaxAccess("readwrite") if mibBuilder.loadTexts: mscModVcsE164IntlMinAddressLength.setStatus('mandatory') if mibBuilder.loadTexts: mscModVcsE164IntlMinAddressLength.setDescription('This attribute indicates minimum length of e164 international address.') mscModVcsE164IntlMaxAddressLength = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 36, 2, 1, 16, 2, 12, 1, 23), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(1, 16)).clone(15)).setMaxAccess("readwrite") if mibBuilder.loadTexts: mscModVcsE164IntlMaxAddressLength.setStatus('mandatory') if mibBuilder.loadTexts: mscModVcsE164IntlMaxAddressLength.setDescription('This attribute indicates maximum length of e164 international address.') mscModVcsE164LocalMinAddressLength = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 36, 2, 1, 16, 2, 12, 1, 24), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(1, 16)).clone(1)).setMaxAccess("readwrite") if mibBuilder.loadTexts: mscModVcsE164LocalMinAddressLength.setStatus('mandatory') if mibBuilder.loadTexts: mscModVcsE164LocalMinAddressLength.setDescription('This attribute indicates minimum length of e164 local address.') mscModVcsE164LocalMaxAddressLength = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 36, 2, 1, 16, 2, 12, 1, 25), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(1, 16)).clone(15)).setMaxAccess("readwrite") if mibBuilder.loadTexts: mscModVcsE164LocalMaxAddressLength.setStatus('mandatory') if mibBuilder.loadTexts: mscModVcsE164LocalMaxAddressLength.setDescription('This attribute indicates maximum length of e164 local address.') mscModVcsIntOptTable = MibTable((1, 3, 6, 1, 4, 1, 562, 36, 2, 1, 16, 2, 13), ) if mibBuilder.loadTexts: mscModVcsIntOptTable.setStatus('mandatory') if mibBuilder.loadTexts: mscModVcsIntOptTable.setDescription('The Vc InterfaceOptions group defines Vc system parameters common in the network. It is owned by the Vc and is considered to be a module wide component on the switch. The data contained in the Vc InterfaceOptions group must be identical network wide even though this group can be changed and upgraded on a module by module basis.') mscModVcsIntOptEntry = MibTableRow((1, 3, 6, 1, 4, 1, 562, 36, 2, 1, 16, 2, 13, 1), ).setIndexNames((0, "Nortel-MsCarrier-MscPassport-BaseShelfMIB", "mscModIndex"), (0, "Nortel-MsCarrier-MscPassport-SubnetInterfaceMIB", "mscModVcsIndex")) if mibBuilder.loadTexts: mscModVcsIntOptEntry.setStatus('mandatory') if mibBuilder.loadTexts: mscModVcsIntOptEntry.setDescription('An entry in the mscModVcsIntOptTable.') mscModVcsHighPriorityPacketSizes = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 36, 2, 1, 16, 2, 13, 1, 1), OctetString().subtype(subtypeSpec=ValueSizeConstraint(2, 2)).setFixedLength(2).clone(hexValue="ff80")).setMaxAccess("readonly") if mibBuilder.loadTexts: mscModVcsHighPriorityPacketSizes.setStatus('mandatory') if mibBuilder.loadTexts: mscModVcsHighPriorityPacketSizes.setDescription('This attribute indicates which packet sizes are supported for high priority calls within the network. Description of bits: n16(0) n32(1) n64(2) n128(3) n256(4) n512(5) n1024(6) n2048(7) n4096(8)') mscModVcsMaxSubnetPacketSize = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 36, 2, 1, 16, 2, 13, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(4, 5, 6, 7, 8, 9, 10, 11, 12))).clone(namedValues=NamedValues(("n16", 4), ("n32", 5), ("n64", 6), ("n128", 7), ("n256", 8), ("n512", 9), ("n1024", 10), ("n2048", 11), ("n4096", 12))).clone('n512')).setMaxAccess("readwrite") if mibBuilder.loadTexts: mscModVcsMaxSubnetPacketSize.setStatus('mandatory') if mibBuilder.loadTexts: mscModVcsMaxSubnetPacketSize.setDescription('This attribute specifies the maximum subnet packet size used for the connections originating or terminating on this module. All modules in the same network should have the same maxSubnetPacketSize. If this value is not identical throughout the network, the following points need to be considered: a) When Passport and DPN switches are connected in the same network, the maxSubnetPacketSize on a DPN switch can be at most 2048 and the DPN part of the network must be configured with hardware which supports this size: - Dedicated PE386 Network link/Trunk - Minimum measured link speed of 256Kbits/sec This hardware has to be present on every potential data path between connecting end points! b) The calling end of the connection signals the maxSubnetPacketSize value to the called end. The called end then compares this value to its own provisioned value and selects the smaller value. Note that this smaller value is not signalled back to the calling end. The calling and called ends can therefore have different maxSubnetPacketSize values.') mscModVcsCallSetupTimer = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 36, 2, 1, 16, 2, 13, 1, 3), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(5, 100)).clone(5)).setMaxAccess("readwrite") if mibBuilder.loadTexts: mscModVcsCallSetupTimer.setStatus('mandatory') if mibBuilder.loadTexts: mscModVcsCallSetupTimer.setDescription('This attribute specifies the Vc callSetupTimer in units of 1 second ticks. This timer specifies how long the Vc will wait, after sending a subnet Call Request packet into the network, for a response from the remote end of the Vc (in the form of a subnet Raccept packet). If, after sending a subnet Call packet into the network, a response is not received within this time period, the Vc will time out, clearing the call in the assumption that the remote end is unreachable. This timer must be long enough to take into account the time required for routing the subnet Call Request through the Source Call Routing and the Destination Call Routing systems in order to be delivered to the final destination.') mscModVcsCallRetryTimer = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 36, 2, 1, 16, 2, 13, 1, 4), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(30, 300)).clone(60)).setMaxAccess("readwrite") if mibBuilder.loadTexts: mscModVcsCallRetryTimer.setStatus('mandatory') if mibBuilder.loadTexts: mscModVcsCallRetryTimer.setDescription('This attribute specifies, for Vc implementing Direct Calls with the auto-call retry feature (including PVCs), the Vc callRetryTimer in units of 1 second ticks. This timer specifies how long the Vc will wait between unsuccessful call attempts.') mscModVcsDelaySubnetAcks = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 36, 2, 1, 16, 2, 13, 1, 5), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1))).clone(namedValues=NamedValues(("no", 0), ("yes", 1))).clone('no')).setMaxAccess("readwrite") if mibBuilder.loadTexts: mscModVcsDelaySubnetAcks.setStatus('mandatory') if mibBuilder.loadTexts: mscModVcsDelaySubnetAcks.setDescription('This attribute specifies delay acknowledgment timer mechanism. If this attribute is set to no, then the Vc will automatically return acknowledgment packets without delay. If this attribute is set to yes, then the Vc will wait for one second in an attempt to piggyback the acknowledgment packet on another credit or data packet. If the Vc cannot piggyback the acknowledgment packet within this time, then the packet is returned without piggybacking.') mscModVcsWinsTable = MibTable((1, 3, 6, 1, 4, 1, 562, 36, 2, 1, 16, 2, 213), ) if mibBuilder.loadTexts: mscModVcsWinsTable.setStatus('mandatory') if mibBuilder.loadTexts: mscModVcsWinsTable.setDescription('This is the windowSize corresponding to the given packet size and throughput class. All Vcs using the windowSize matrix support large Vc windows on both ends of the Vc, and support the signalling of the chosen Vc window size from the destination (called) end to the source (calling) end. This is the only matrix supported. The windowSize should be configured in the same way network wide, though it can be upgraded on a module by module basis. Vcs using the windowSize matrix will run properly if the matrices on different nodes differ since the Vc window is selected by the destination (called) side of the Vc.') mscModVcsWinsEntry = MibTableRow((1, 3, 6, 1, 4, 1, 562, 36, 2, 1, 16, 2, 213, 1), ).setIndexNames((0, "Nortel-MsCarrier-MscPassport-BaseShelfMIB", "mscModIndex"), (0, "Nortel-MsCarrier-MscPassport-SubnetInterfaceMIB", "mscModVcsIndex"), (0, "Nortel-MsCarrier-MscPassport-SubnetInterfaceMIB", "mscModVcsWinsPktIndex"), (0, "Nortel-MsCarrier-MscPassport-SubnetInterfaceMIB", "mscModVcsWinsTptIndex")) if mibBuilder.loadTexts: mscModVcsWinsEntry.setStatus('mandatory') if mibBuilder.loadTexts: mscModVcsWinsEntry.setDescription('An entry in the mscModVcsWinsTable.') mscModVcsWinsPktIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 36, 2, 1, 16, 2, 213, 1, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11))).clone(namedValues=NamedValues(("n16", 0), ("n32", 1), ("n64", 2), ("n128", 3), ("n256", 4), ("n512", 5), ("n1024", 6), ("n2048", 7), ("n4096", 8), ("n8192", 9), ("n32768", 10), ("n65535", 11)))) if mibBuilder.loadTexts: mscModVcsWinsPktIndex.setStatus('mandatory') if mibBuilder.loadTexts: mscModVcsWinsPktIndex.setDescription('This variable represents the next to last index for the mscModVcsWinsTable.') mscModVcsWinsTptIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 36, 2, 1, 16, 2, 213, 1, 2), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 15))) if mibBuilder.loadTexts: mscModVcsWinsTptIndex.setStatus('mandatory') if mibBuilder.loadTexts: mscModVcsWinsTptIndex.setDescription('This variable represents the final index for the mscModVcsWinsTable.') mscModVcsWinsValue = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 36, 2, 1, 16, 2, 213, 1, 3), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(1, 63))).setMaxAccess("readwrite") if mibBuilder.loadTexts: mscModVcsWinsValue.setStatus('mandatory') if mibBuilder.loadTexts: mscModVcsWinsValue.setDescription('This variable represents an individual value for the mscModVcsWinsTable.') subnetInterfaceGroup = MibIdentifier((1, 3, 6, 1, 4, 1, 562, 36, 2, 2, 45, 1)) subnetInterfaceGroupCA = MibIdentifier((1, 3, 6, 1, 4, 1, 562, 36, 2, 2, 45, 1, 1)) subnetInterfaceGroupCA02 = MibIdentifier((1, 3, 6, 1, 4, 1, 562, 36, 2, 2, 45, 1, 1, 3)) subnetInterfaceGroupCA02A = MibIdentifier((1, 3, 6, 1, 4, 1, 562, 36, 2, 2, 45, 1, 1, 3, 2)) subnetInterfaceCapabilities = MibIdentifier((1, 3, 6, 1, 4, 1, 562, 36, 2, 2, 45, 3)) subnetInterfaceCapabilitiesCA = MibIdentifier((1, 3, 6, 1, 4, 1, 562, 36, 2, 2, 45, 3, 1)) subnetInterfaceCapabilitiesCA02 = MibIdentifier((1, 3, 6, 1, 4, 1, 562, 36, 2, 2, 45, 3, 1, 3)) subnetInterfaceCapabilitiesCA02A = MibIdentifier((1, 3, 6, 1, 4, 1, 562, 36, 2, 2, 45, 3, 1, 3, 2)) mibBuilder.exportSymbols("Nortel-MsCarrier-MscPassport-SubnetInterfaceMIB", mscModVcsStorageType=mscModVcsStorageType, mscModVcs=mscModVcs, mscModVcsRowStatusEntry=mscModVcsRowStatusEntry, mscModVcsX121MinAddressLength=mscModVcsX121MinAddressLength, mscModVcsRowStatus=mscModVcsRowStatus, mscModVcsE164NatlMinAddressLength=mscModVcsE164NatlMinAddressLength, mscModVcsAccOptTable=mscModVcsAccOptTable, mscModVcsE164LocalAddressLength=mscModVcsE164LocalAddressLength, mscModVcsE164IntlMinAddressLength=mscModVcsE164IntlMinAddressLength, mscModVcsE164IntlMaxAddressLength=mscModVcsE164IntlMaxAddressLength, mscModVcsE164LocalMaxAddressLength=mscModVcsE164LocalMaxAddressLength, mscModVcsWinsTptIndex=mscModVcsWinsTptIndex, mscModVcsE164IntlPrefixDigits=mscModVcsE164IntlPrefixDigits, mscModVcsComponentName=mscModVcsComponentName, mscModVcsIndex=mscModVcsIndex, subnetInterfaceGroupCA=subnetInterfaceGroupCA, mscModVcsX121IntllPrefixDigit=mscModVcsX121IntllPrefixDigit, mscModVcsDelaySubnetAcks=mscModVcsDelaySubnetAcks, mscModVcsX121Type=mscModVcsX121Type, mscModVcsWinsTable=mscModVcsWinsTable, mscModVcsE164NatlPrefixDigit=mscModVcsE164NatlPrefixDigit, subnetInterfaceMIB=subnetInterfaceMIB, mscModVcsAccountingFax=mscModVcsAccountingFax, mscModVcsMaxSubnetPacketSize=mscModVcsMaxSubnetPacketSize, mscModVcsAddOptTable=mscModVcsAddOptTable, mscModVcsWinsValue=mscModVcsWinsValue, subnetInterfaceCapabilitiesCA02A=subnetInterfaceCapabilitiesCA02A, subnetInterfaceCapabilities=subnetInterfaceCapabilities, subnetInterfaceGroupCA02=subnetInterfaceGroupCA02, subnetInterfaceCapabilitiesCA=subnetInterfaceCapabilitiesCA, mscModVcsX121MaxAddressLength=mscModVcsX121MaxAddressLength, mscModVcsE164IntlFormatAllowed=mscModVcsE164IntlFormatAllowed, subnetInterfaceGroup=subnetInterfaceGroup, mscModVcsSegmentSize=mscModVcsSegmentSize, mscModVcsX121IntlAddresses=mscModVcsX121IntlAddresses, mscModVcsGenerationMode=mscModVcsGenerationMode, mscModVcsWinsEntry=mscModVcsWinsEntry, mscModVcsUnitsCounted=mscModVcsUnitsCounted, mscModVcsNetworkIdType=mscModVcsNetworkIdType, mscModVcsAccOptEntry=mscModVcsAccOptEntry, mscModVcsAddOptEntry=mscModVcsAddOptEntry, mscModVcsX121ToE164EscapeSignificance=mscModVcsX121ToE164EscapeSignificance, mscModVcsDefaultNumberingPlan=mscModVcsDefaultNumberingPlan, mscModVcsIntOptTable=mscModVcsIntOptTable, mscModVcsCallRetryTimer=mscModVcsCallRetryTimer, mscModVcsWinsPktIndex=mscModVcsWinsPktIndex, mscModVcsCallSetupTimer=mscModVcsCallSetupTimer, mscModVcsE164NatlMaxAddressLength=mscModVcsE164NatlMaxAddressLength, subnetInterfaceGroupCA02A=subnetInterfaceGroupCA02A, mscModVcsNetworkIdCode=mscModVcsNetworkIdCode, mscModVcsE164TeleCountryCode=mscModVcsE164TeleCountryCode, mscModVcsIntOptEntry=mscModVcsIntOptEntry, subnetInterfaceCapabilitiesCA02=subnetInterfaceCapabilitiesCA02, mscModVcsE164LocalMinAddressLength=mscModVcsE164LocalMinAddressLength, mscModVcsRowStatusTable=mscModVcsRowStatusTable, mscModVcsHighPriorityPacketSizes=mscModVcsHighPriorityPacketSizes)
(object_identifier, octet_string, integer) = mibBuilder.importSymbols('ASN1', 'ObjectIdentifier', 'OctetString', 'Integer') (named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues') (constraints_union, constraints_intersection, single_value_constraint, value_range_constraint, value_size_constraint) = mibBuilder.importSymbols('ASN1-REFINEMENT', 'ConstraintsUnion', 'ConstraintsIntersection', 'SingleValueConstraint', 'ValueRangeConstraint', 'ValueSizeConstraint') (msc_mod, msc_mod_index) = mibBuilder.importSymbols('Nortel-MsCarrier-MscPassport-BaseShelfMIB', 'mscMod', 'mscModIndex') (display_string, row_status, storage_type, unsigned32, integer32) = mibBuilder.importSymbols('Nortel-MsCarrier-MscPassport-StandardTextualConventionsMIB', 'DisplayString', 'RowStatus', 'StorageType', 'Unsigned32', 'Integer32') (digit_string, non_replicated) = mibBuilder.importSymbols('Nortel-MsCarrier-MscPassport-TextualConventionsMIB', 'DigitString', 'NonReplicated') (msc_passport_mi_bs,) = mibBuilder.importSymbols('Nortel-MsCarrier-MscPassport-UsefulDefinitionsMIB', 'mscPassportMIBs') (module_compliance, notification_group) = mibBuilder.importSymbols('SNMPv2-CONF', 'ModuleCompliance', 'NotificationGroup') (counter32, counter64, ip_address, object_identity, bits, iso, unsigned32, gauge32, mib_identifier, mib_scalar, mib_table, mib_table_row, mib_table_column, notification_type, integer32, time_ticks, module_identity) = mibBuilder.importSymbols('SNMPv2-SMI', 'Counter32', 'Counter64', 'IpAddress', 'ObjectIdentity', 'Bits', 'iso', 'Unsigned32', 'Gauge32', 'MibIdentifier', 'MibScalar', 'MibTable', 'MibTableRow', 'MibTableColumn', 'NotificationType', 'Integer32', 'TimeTicks', 'ModuleIdentity') (display_string, textual_convention) = mibBuilder.importSymbols('SNMPv2-TC', 'DisplayString', 'TextualConvention') subnet_interface_mib = mib_identifier((1, 3, 6, 1, 4, 1, 562, 36, 2, 2, 45)) msc_mod_vcs = mib_identifier((1, 3, 6, 1, 4, 1, 562, 36, 2, 1, 16, 2)) msc_mod_vcs_row_status_table = mib_table((1, 3, 6, 1, 4, 1, 562, 36, 2, 1, 16, 2, 1)) if mibBuilder.loadTexts: mscModVcsRowStatusTable.setStatus('mandatory') if mibBuilder.loadTexts: mscModVcsRowStatusTable.setDescription('This entry controls the addition and deletion of mscModVcs components.') msc_mod_vcs_row_status_entry = mib_table_row((1, 3, 6, 1, 4, 1, 562, 36, 2, 1, 16, 2, 1, 1)).setIndexNames((0, 'Nortel-MsCarrier-MscPassport-BaseShelfMIB', 'mscModIndex'), (0, 'Nortel-MsCarrier-MscPassport-SubnetInterfaceMIB', 'mscModVcsIndex')) if mibBuilder.loadTexts: mscModVcsRowStatusEntry.setStatus('mandatory') if mibBuilder.loadTexts: mscModVcsRowStatusEntry.setDescription('A single entry in the table represents a single mscModVcs component.') msc_mod_vcs_row_status = mib_table_column((1, 3, 6, 1, 4, 1, 562, 36, 2, 1, 16, 2, 1, 1, 1), row_status()).setMaxAccess('readwrite') if mibBuilder.loadTexts: mscModVcsRowStatus.setStatus('mandatory') if mibBuilder.loadTexts: mscModVcsRowStatus.setDescription('This variable is used as the basis for SNMP naming of mscModVcs components. These components can be added and deleted.') msc_mod_vcs_component_name = mib_table_column((1, 3, 6, 1, 4, 1, 562, 36, 2, 1, 16, 2, 1, 1, 2), display_string()).setMaxAccess('readonly') if mibBuilder.loadTexts: mscModVcsComponentName.setStatus('mandatory') if mibBuilder.loadTexts: mscModVcsComponentName.setDescription("This variable provides the component's string name for use with the ASCII Console Interface") msc_mod_vcs_storage_type = mib_table_column((1, 3, 6, 1, 4, 1, 562, 36, 2, 1, 16, 2, 1, 1, 4), storage_type()).setMaxAccess('readonly') if mibBuilder.loadTexts: mscModVcsStorageType.setStatus('mandatory') if mibBuilder.loadTexts: mscModVcsStorageType.setDescription('This variable represents the storage type value for the mscModVcs tables.') msc_mod_vcs_index = mib_table_column((1, 3, 6, 1, 4, 1, 562, 36, 2, 1, 16, 2, 1, 1, 10), non_replicated()) if mibBuilder.loadTexts: mscModVcsIndex.setStatus('mandatory') if mibBuilder.loadTexts: mscModVcsIndex.setDescription('This variable represents the index for the mscModVcs tables.') msc_mod_vcs_acc_opt_table = mib_table((1, 3, 6, 1, 4, 1, 562, 36, 2, 1, 16, 2, 10)) if mibBuilder.loadTexts: mscModVcsAccOptTable.setStatus('mandatory') if mibBuilder.loadTexts: mscModVcsAccOptTable.setDescription("Accounting information is owned by the Vc System; it is stored in the Vc Accounting component, which itself is considered to be a component on the switch. The Accounting Component contains a bit map indicating which of the accounting facilities are to be spooled in the accounting record - for example, bit '0' if set indicates that the accounting facility with facility code H.00 should be spooled if present in the Vc for accounting purposes. The data contained in the Vc Accounting must be identical network wide even though the component can be changed and upgraded on a module by module basis.") msc_mod_vcs_acc_opt_entry = mib_table_row((1, 3, 6, 1, 4, 1, 562, 36, 2, 1, 16, 2, 10, 1)).setIndexNames((0, 'Nortel-MsCarrier-MscPassport-BaseShelfMIB', 'mscModIndex'), (0, 'Nortel-MsCarrier-MscPassport-SubnetInterfaceMIB', 'mscModVcsIndex')) if mibBuilder.loadTexts: mscModVcsAccOptEntry.setStatus('mandatory') if mibBuilder.loadTexts: mscModVcsAccOptEntry.setDescription('An entry in the mscModVcsAccOptTable.') msc_mod_vcs_segment_size = mib_table_column((1, 3, 6, 1, 4, 1, 562, 36, 2, 1, 16, 2, 10, 1, 1), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12))).clone(namedValues=named_values(('n1', 0), ('n2', 1), ('n4', 2), ('n8', 3), ('n16', 4), ('n32', 5), ('n64', 6), ('n128', 7), ('n256', 8), ('n512', 9), ('n1024', 10), ('n2048', 11), ('n4096', 12))).clone('n128')).setMaxAccess('readwrite') if mibBuilder.loadTexts: mscModVcsSegmentSize.setStatus('mandatory') if mibBuilder.loadTexts: mscModVcsSegmentSize.setDescription('This attribute specifies the segment size for accounting of national calls. Minimum allowed segment size is 1. If data segment is sent which is less than segmentSize it is still counted as one segment.') msc_mod_vcs_units_counted = mib_table_column((1, 3, 6, 1, 4, 1, 562, 36, 2, 1, 16, 2, 10, 1, 2), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(0, 1))).clone(namedValues=named_values(('segments', 0), ('frames', 1))).clone('segments')).setMaxAccess('readwrite') if mibBuilder.loadTexts: mscModVcsUnitsCounted.setStatus('mandatory') if mibBuilder.loadTexts: mscModVcsUnitsCounted.setDescription('This attribute specifies what is counted by frame services. If set to frames, frames are counted, else segments are counted.') msc_mod_vcs_accounting_fax = mib_table_column((1, 3, 6, 1, 4, 1, 562, 36, 2, 1, 16, 2, 10, 1, 3), octet_string().subtype(subtypeSpec=value_size_constraint(1, 1)).setFixedLength(1).clone(hexValue='20')).setMaxAccess('readwrite') if mibBuilder.loadTexts: mscModVcsAccountingFax.setStatus('mandatory') if mibBuilder.loadTexts: mscModVcsAccountingFax.setDescription('Each value corresponds to an accounting facility code, of which there are currently 10 facility codes defined with codes H.00 to H.09, and corresponding to the above 10 facilities. Each of the above facilities may or may not be present and stored in the Vc for accounting purposes, depending on the nature of the call. For example, only those Vcs where a NUI (Network User Identifier) is used for charging or identification purposes will have a NUI stored in the Vc. Description of bits: notused0(0) notused1(1) originalCalledAddressFax(2)') msc_mod_vcs_generation_mode = mib_table_column((1, 3, 6, 1, 4, 1, 562, 36, 2, 1, 16, 2, 10, 1, 4), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(0, 1))).clone(namedValues=named_values(('bothEnds', 0), ('singleEnd', 1))).clone('singleEnd')).setMaxAccess('readwrite') if mibBuilder.loadTexts: mscModVcsGenerationMode.setStatus('mandatory') if mibBuilder.loadTexts: mscModVcsGenerationMode.setDescription('This attribute specifies part of the rules by which the network generates accounting records. If set to bothEnds, then both ends of the Vc generate accounting records. If set to singleEnd, then the charged end of the Vc generates accounting records. In single end generation mode, if the call does not clear gracefully, both ends of the Vc will generate accounting record.') msc_mod_vcs_add_opt_table = mib_table((1, 3, 6, 1, 4, 1, 562, 36, 2, 1, 16, 2, 12)) if mibBuilder.loadTexts: mscModVcsAddOptTable.setStatus('mandatory') if mibBuilder.loadTexts: mscModVcsAddOptTable.setDescription('The Vc AddressingOptions group describes the addressing parameters. It is currently owned by the Vc. Most of the data contained in the Vc AddressingOptions group is identical network wide even though the group can be changed and upgraded on a module by module basis.') msc_mod_vcs_add_opt_entry = mib_table_row((1, 3, 6, 1, 4, 1, 562, 36, 2, 1, 16, 2, 12, 1)).setIndexNames((0, 'Nortel-MsCarrier-MscPassport-BaseShelfMIB', 'mscModIndex'), (0, 'Nortel-MsCarrier-MscPassport-SubnetInterfaceMIB', 'mscModVcsIndex')) if mibBuilder.loadTexts: mscModVcsAddOptEntry.setStatus('mandatory') if mibBuilder.loadTexts: mscModVcsAddOptEntry.setDescription('An entry in the mscModVcsAddOptTable.') msc_mod_vcs_default_numbering_plan = mib_table_column((1, 3, 6, 1, 4, 1, 562, 36, 2, 1, 16, 2, 12, 1, 3), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(0, 1))).clone(namedValues=named_values(('x121', 0), ('e164', 1))).clone('x121')).setMaxAccess('readwrite') if mibBuilder.loadTexts: mscModVcsDefaultNumberingPlan.setStatus('mandatory') if mibBuilder.loadTexts: mscModVcsDefaultNumberingPlan.setDescription('This attribute specifies the numbering plan used which determines the address format: X.121-- the international numbering plan for public packet switched data networks or E.164-- the international numbering plan for ISDN and PSTN. The default numbering plan does not need to be consistent across all of the nodes in the network.') msc_mod_vcs_network_id_type = mib_table_column((1, 3, 6, 1, 4, 1, 562, 36, 2, 1, 16, 2, 12, 1, 4), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(0, 1))).clone(namedValues=named_values(('dnic', 0), ('inic', 1))).clone('dnic')).setMaxAccess('readonly') if mibBuilder.loadTexts: mscModVcsNetworkIdType.setStatus('mandatory') if mibBuilder.loadTexts: mscModVcsNetworkIdType.setDescription('This attribute specifies whether the network uses a DNIC or INIC. It is used by X.75 Gateways to indicate whether in network the DNIC or INIC is used in various utilities. If it is DNIC it can be DNIC or DCC type. If it is INIC it can be 4 digits only.') msc_mod_vcs_x121_type = mib_table_column((1, 3, 6, 1, 4, 1, 562, 36, 2, 1, 16, 2, 12, 1, 5), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(0, 1))).clone(namedValues=named_values(('dnic', 0), ('dcc', 1))).clone('dnic')).setMaxAccess('readwrite') if mibBuilder.loadTexts: mscModVcsX121Type.setStatus('mandatory') if mibBuilder.loadTexts: mscModVcsX121Type.setDescription('This attribute specifies whether DNIC mode or DCC mode is used in X.121 address of international calls. If DCC is specified, then the first 3 digits of each DNA must be the Network ID Code. If this attribute is changed all Dnas in the network must start with this code. Numbering plan is affected by the change.') msc_mod_vcs_network_id_code = mib_table_column((1, 3, 6, 1, 4, 1, 562, 36, 2, 1, 16, 2, 12, 1, 6), digit_string().subtype(subtypeSpec=value_size_constraint(3, 4))).setMaxAccess('readwrite') if mibBuilder.loadTexts: mscModVcsNetworkIdCode.setStatus('mandatory') if mibBuilder.loadTexts: mscModVcsNetworkIdCode.setDescription('This attribute specifies the DNIC (Data Network ID Code) of the network or DCC code.') msc_mod_vcs_x121_intl_addresses = mib_table_column((1, 3, 6, 1, 4, 1, 562, 36, 2, 1, 16, 2, 12, 1, 7), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(0, 1))).clone(namedValues=named_values(('disallowed', 0), ('allowed', 1))).clone('allowed')).setMaxAccess('readwrite') if mibBuilder.loadTexts: mscModVcsX121IntlAddresses.setStatus('mandatory') if mibBuilder.loadTexts: mscModVcsX121IntlAddresses.setDescription('This attribute indicates if any DTE is allowed to signal international addresses.') msc_mod_vcs_x121_intll_prefix_digit = mib_table_column((1, 3, 6, 1, 4, 1, 562, 36, 2, 1, 16, 2, 12, 1, 8), unsigned32().subtype(subtypeSpec=value_range_constraint(0, 9)).clone(9)).setMaxAccess('readwrite') if mibBuilder.loadTexts: mscModVcsX121IntllPrefixDigit.setStatus('mandatory') if mibBuilder.loadTexts: mscModVcsX121IntllPrefixDigit.setDescription('This attribute indicates the prefix digit to be used for X.121 international calls. When this digit is provided the call will have full international address.') msc_mod_vcs_x121_min_address_length = mib_table_column((1, 3, 6, 1, 4, 1, 562, 36, 2, 1, 16, 2, 12, 1, 11), unsigned32().subtype(subtypeSpec=value_range_constraint(1, 16)).clone(1)).setMaxAccess('readwrite') if mibBuilder.loadTexts: mscModVcsX121MinAddressLength.setStatus('mandatory') if mibBuilder.loadTexts: mscModVcsX121MinAddressLength.setDescription('This attribute indicates minimum length of x121 address.') msc_mod_vcs_x121_max_address_length = mib_table_column((1, 3, 6, 1, 4, 1, 562, 36, 2, 1, 16, 2, 12, 1, 12), unsigned32().subtype(subtypeSpec=value_range_constraint(1, 16)).clone(15)).setMaxAccess('readwrite') if mibBuilder.loadTexts: mscModVcsX121MaxAddressLength.setStatus('mandatory') if mibBuilder.loadTexts: mscModVcsX121MaxAddressLength.setDescription('This attribute indicates maximum length of x121 address.') msc_mod_vcs_x121_to_e164_escape_significance = mib_table_column((1, 3, 6, 1, 4, 1, 562, 36, 2, 1, 16, 2, 12, 1, 13), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(0, 1))).clone(namedValues=named_values(('no', 0), ('yes', 1))).clone('no')).setMaxAccess('readwrite') if mibBuilder.loadTexts: mscModVcsX121ToE164EscapeSignificance.setStatus('mandatory') if mibBuilder.loadTexts: mscModVcsX121ToE164EscapeSignificance.setDescription('This attribute specifies whether an X.121 to E.164 escape digit has significance in selecting an X.32 (analog) or an ISDN switched path. If two values are significant (the value 0 or the value 9) then yes is set to this attribute. If the value of the originally entered escape digit is not significant in routing the call then value of no is assigned to this attribute.') msc_mod_vcs_e164_intl_format_allowed = mib_table_column((1, 3, 6, 1, 4, 1, 562, 36, 2, 1, 16, 2, 12, 1, 14), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(0, 1))).clone(namedValues=named_values(('disallowed', 0), ('allowed', 1))).clone('allowed')).setMaxAccess('readwrite') if mibBuilder.loadTexts: mscModVcsE164IntlFormatAllowed.setStatus('mandatory') if mibBuilder.loadTexts: mscModVcsE164IntlFormatAllowed.setDescription("This attribute indicates whether or not to allow national format E.164 addresses. If this attribute is set to a value of Yes (=1) then national format E.164 addresses are not allowed and international format addresses only are allowed. If this attribute is set to a value of No (=0), then national format E.164 addresses are allowed. If only international format E.164 addresses are allowed, then the 'e164NatlPrefixDigit' attribute is not required, nor is the 'e164IntlPrefixDigits' required.") msc_mod_vcs_e164_intl_prefix_digits = mib_table_column((1, 3, 6, 1, 4, 1, 562, 36, 2, 1, 16, 2, 12, 1, 15), digit_string().subtype(subtypeSpec=value_size_constraint(0, 3)).clone(hexValue='30')).setMaxAccess('readwrite') if mibBuilder.loadTexts: mscModVcsE164IntlPrefixDigits.setStatus('mandatory') if mibBuilder.loadTexts: mscModVcsE164IntlPrefixDigits.setDescription("This attribute specifies the E.164 international prefix digits. If applicable, it is specified as 1 to 3 BCD digits. The 3 BCD digits are stored with the length of the international prefix in the low order nibble, nibble [0] followed by the most significant digit of the international prefix in the next low order nibble, nibble [1], etc. This attribute is not required if the corresponding attribute, 'e164IntlFormatOnly' is set to a value of Yes (=1).") msc_mod_vcs_e164_natl_prefix_digit = mib_table_column((1, 3, 6, 1, 4, 1, 562, 36, 2, 1, 16, 2, 12, 1, 16), unsigned32().subtype(subtypeSpec=value_range_constraint(0, 9)).clone(1)).setMaxAccess('readwrite') if mibBuilder.loadTexts: mscModVcsE164NatlPrefixDigit.setStatus('mandatory') if mibBuilder.loadTexts: mscModVcsE164NatlPrefixDigit.setDescription('This attribute contains the E.164 national prefix which may be added in front of E.164 local or national call. If e164IntlFormatOnly is set to 1, this attribute is not needed.') msc_mod_vcs_e164_local_address_length = mib_table_column((1, 3, 6, 1, 4, 1, 562, 36, 2, 1, 16, 2, 12, 1, 17), unsigned32().subtype(subtypeSpec=value_range_constraint(4, 15)).clone(7)).setMaxAccess('readwrite') if mibBuilder.loadTexts: mscModVcsE164LocalAddressLength.setStatus('mandatory') if mibBuilder.loadTexts: mscModVcsE164LocalAddressLength.setDescription('This attribute indicates the length of a local E.164 DNA on this module. This attribute is not required if the corresponding attribute, e164IntlFormatOnly is set to a value of yes. This attribute does not need to be consistent across all of the nodes in the network.') msc_mod_vcs_e164_tele_country_code = mib_table_column((1, 3, 6, 1, 4, 1, 562, 36, 2, 1, 16, 2, 12, 1, 18), digit_string().subtype(subtypeSpec=value_size_constraint(1, 4)).clone(hexValue='31')).setMaxAccess('readwrite') if mibBuilder.loadTexts: mscModVcsE164TeleCountryCode.setStatus('mandatory') if mibBuilder.loadTexts: mscModVcsE164TeleCountryCode.setDescription('This attribute specifies the E.164 Telephone Country Code (TCC) for the country in which the network resides. If applicable, it is specified as 1 to 3 BCD digits. The 3 BCD digits are stored with the length of the TCC in the low order nibble, nibble [0] followed by the most significant digit of the TCC in the next low order nibble, nibble [1], etc.') msc_mod_vcs_e164_natl_min_address_length = mib_table_column((1, 3, 6, 1, 4, 1, 562, 36, 2, 1, 16, 2, 12, 1, 20), unsigned32().subtype(subtypeSpec=value_range_constraint(1, 16)).clone(1)).setMaxAccess('readwrite') if mibBuilder.loadTexts: mscModVcsE164NatlMinAddressLength.setStatus('mandatory') if mibBuilder.loadTexts: mscModVcsE164NatlMinAddressLength.setDescription('This attribute indicates minimum length of e164 national address.') msc_mod_vcs_e164_natl_max_address_length = mib_table_column((1, 3, 6, 1, 4, 1, 562, 36, 2, 1, 16, 2, 12, 1, 21), unsigned32().subtype(subtypeSpec=value_range_constraint(1, 16)).clone(15)).setMaxAccess('readwrite') if mibBuilder.loadTexts: mscModVcsE164NatlMaxAddressLength.setStatus('mandatory') if mibBuilder.loadTexts: mscModVcsE164NatlMaxAddressLength.setDescription('This attribute indicates maximum length of e164 national address.') msc_mod_vcs_e164_intl_min_address_length = mib_table_column((1, 3, 6, 1, 4, 1, 562, 36, 2, 1, 16, 2, 12, 1, 22), unsigned32().subtype(subtypeSpec=value_range_constraint(1, 16)).clone(1)).setMaxAccess('readwrite') if mibBuilder.loadTexts: mscModVcsE164IntlMinAddressLength.setStatus('mandatory') if mibBuilder.loadTexts: mscModVcsE164IntlMinAddressLength.setDescription('This attribute indicates minimum length of e164 international address.') msc_mod_vcs_e164_intl_max_address_length = mib_table_column((1, 3, 6, 1, 4, 1, 562, 36, 2, 1, 16, 2, 12, 1, 23), unsigned32().subtype(subtypeSpec=value_range_constraint(1, 16)).clone(15)).setMaxAccess('readwrite') if mibBuilder.loadTexts: mscModVcsE164IntlMaxAddressLength.setStatus('mandatory') if mibBuilder.loadTexts: mscModVcsE164IntlMaxAddressLength.setDescription('This attribute indicates maximum length of e164 international address.') msc_mod_vcs_e164_local_min_address_length = mib_table_column((1, 3, 6, 1, 4, 1, 562, 36, 2, 1, 16, 2, 12, 1, 24), unsigned32().subtype(subtypeSpec=value_range_constraint(1, 16)).clone(1)).setMaxAccess('readwrite') if mibBuilder.loadTexts: mscModVcsE164LocalMinAddressLength.setStatus('mandatory') if mibBuilder.loadTexts: mscModVcsE164LocalMinAddressLength.setDescription('This attribute indicates minimum length of e164 local address.') msc_mod_vcs_e164_local_max_address_length = mib_table_column((1, 3, 6, 1, 4, 1, 562, 36, 2, 1, 16, 2, 12, 1, 25), unsigned32().subtype(subtypeSpec=value_range_constraint(1, 16)).clone(15)).setMaxAccess('readwrite') if mibBuilder.loadTexts: mscModVcsE164LocalMaxAddressLength.setStatus('mandatory') if mibBuilder.loadTexts: mscModVcsE164LocalMaxAddressLength.setDescription('This attribute indicates maximum length of e164 local address.') msc_mod_vcs_int_opt_table = mib_table((1, 3, 6, 1, 4, 1, 562, 36, 2, 1, 16, 2, 13)) if mibBuilder.loadTexts: mscModVcsIntOptTable.setStatus('mandatory') if mibBuilder.loadTexts: mscModVcsIntOptTable.setDescription('The Vc InterfaceOptions group defines Vc system parameters common in the network. It is owned by the Vc and is considered to be a module wide component on the switch. The data contained in the Vc InterfaceOptions group must be identical network wide even though this group can be changed and upgraded on a module by module basis.') msc_mod_vcs_int_opt_entry = mib_table_row((1, 3, 6, 1, 4, 1, 562, 36, 2, 1, 16, 2, 13, 1)).setIndexNames((0, 'Nortel-MsCarrier-MscPassport-BaseShelfMIB', 'mscModIndex'), (0, 'Nortel-MsCarrier-MscPassport-SubnetInterfaceMIB', 'mscModVcsIndex')) if mibBuilder.loadTexts: mscModVcsIntOptEntry.setStatus('mandatory') if mibBuilder.loadTexts: mscModVcsIntOptEntry.setDescription('An entry in the mscModVcsIntOptTable.') msc_mod_vcs_high_priority_packet_sizes = mib_table_column((1, 3, 6, 1, 4, 1, 562, 36, 2, 1, 16, 2, 13, 1, 1), octet_string().subtype(subtypeSpec=value_size_constraint(2, 2)).setFixedLength(2).clone(hexValue='ff80')).setMaxAccess('readonly') if mibBuilder.loadTexts: mscModVcsHighPriorityPacketSizes.setStatus('mandatory') if mibBuilder.loadTexts: mscModVcsHighPriorityPacketSizes.setDescription('This attribute indicates which packet sizes are supported for high priority calls within the network. Description of bits: n16(0) n32(1) n64(2) n128(3) n256(4) n512(5) n1024(6) n2048(7) n4096(8)') msc_mod_vcs_max_subnet_packet_size = mib_table_column((1, 3, 6, 1, 4, 1, 562, 36, 2, 1, 16, 2, 13, 1, 2), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(4, 5, 6, 7, 8, 9, 10, 11, 12))).clone(namedValues=named_values(('n16', 4), ('n32', 5), ('n64', 6), ('n128', 7), ('n256', 8), ('n512', 9), ('n1024', 10), ('n2048', 11), ('n4096', 12))).clone('n512')).setMaxAccess('readwrite') if mibBuilder.loadTexts: mscModVcsMaxSubnetPacketSize.setStatus('mandatory') if mibBuilder.loadTexts: mscModVcsMaxSubnetPacketSize.setDescription('This attribute specifies the maximum subnet packet size used for the connections originating or terminating on this module. All modules in the same network should have the same maxSubnetPacketSize. If this value is not identical throughout the network, the following points need to be considered: a) When Passport and DPN switches are connected in the same network, the maxSubnetPacketSize on a DPN switch can be at most 2048 and the DPN part of the network must be configured with hardware which supports this size: - Dedicated PE386 Network link/Trunk - Minimum measured link speed of 256Kbits/sec This hardware has to be present on every potential data path between connecting end points! b) The calling end of the connection signals the maxSubnetPacketSize value to the called end. The called end then compares this value to its own provisioned value and selects the smaller value. Note that this smaller value is not signalled back to the calling end. The calling and called ends can therefore have different maxSubnetPacketSize values.') msc_mod_vcs_call_setup_timer = mib_table_column((1, 3, 6, 1, 4, 1, 562, 36, 2, 1, 16, 2, 13, 1, 3), unsigned32().subtype(subtypeSpec=value_range_constraint(5, 100)).clone(5)).setMaxAccess('readwrite') if mibBuilder.loadTexts: mscModVcsCallSetupTimer.setStatus('mandatory') if mibBuilder.loadTexts: mscModVcsCallSetupTimer.setDescription('This attribute specifies the Vc callSetupTimer in units of 1 second ticks. This timer specifies how long the Vc will wait, after sending a subnet Call Request packet into the network, for a response from the remote end of the Vc (in the form of a subnet Raccept packet). If, after sending a subnet Call packet into the network, a response is not received within this time period, the Vc will time out, clearing the call in the assumption that the remote end is unreachable. This timer must be long enough to take into account the time required for routing the subnet Call Request through the Source Call Routing and the Destination Call Routing systems in order to be delivered to the final destination.') msc_mod_vcs_call_retry_timer = mib_table_column((1, 3, 6, 1, 4, 1, 562, 36, 2, 1, 16, 2, 13, 1, 4), unsigned32().subtype(subtypeSpec=value_range_constraint(30, 300)).clone(60)).setMaxAccess('readwrite') if mibBuilder.loadTexts: mscModVcsCallRetryTimer.setStatus('mandatory') if mibBuilder.loadTexts: mscModVcsCallRetryTimer.setDescription('This attribute specifies, for Vc implementing Direct Calls with the auto-call retry feature (including PVCs), the Vc callRetryTimer in units of 1 second ticks. This timer specifies how long the Vc will wait between unsuccessful call attempts.') msc_mod_vcs_delay_subnet_acks = mib_table_column((1, 3, 6, 1, 4, 1, 562, 36, 2, 1, 16, 2, 13, 1, 5), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(0, 1))).clone(namedValues=named_values(('no', 0), ('yes', 1))).clone('no')).setMaxAccess('readwrite') if mibBuilder.loadTexts: mscModVcsDelaySubnetAcks.setStatus('mandatory') if mibBuilder.loadTexts: mscModVcsDelaySubnetAcks.setDescription('This attribute specifies delay acknowledgment timer mechanism. If this attribute is set to no, then the Vc will automatically return acknowledgment packets without delay. If this attribute is set to yes, then the Vc will wait for one second in an attempt to piggyback the acknowledgment packet on another credit or data packet. If the Vc cannot piggyback the acknowledgment packet within this time, then the packet is returned without piggybacking.') msc_mod_vcs_wins_table = mib_table((1, 3, 6, 1, 4, 1, 562, 36, 2, 1, 16, 2, 213)) if mibBuilder.loadTexts: mscModVcsWinsTable.setStatus('mandatory') if mibBuilder.loadTexts: mscModVcsWinsTable.setDescription('This is the windowSize corresponding to the given packet size and throughput class. All Vcs using the windowSize matrix support large Vc windows on both ends of the Vc, and support the signalling of the chosen Vc window size from the destination (called) end to the source (calling) end. This is the only matrix supported. The windowSize should be configured in the same way network wide, though it can be upgraded on a module by module basis. Vcs using the windowSize matrix will run properly if the matrices on different nodes differ since the Vc window is selected by the destination (called) side of the Vc.') msc_mod_vcs_wins_entry = mib_table_row((1, 3, 6, 1, 4, 1, 562, 36, 2, 1, 16, 2, 213, 1)).setIndexNames((0, 'Nortel-MsCarrier-MscPassport-BaseShelfMIB', 'mscModIndex'), (0, 'Nortel-MsCarrier-MscPassport-SubnetInterfaceMIB', 'mscModVcsIndex'), (0, 'Nortel-MsCarrier-MscPassport-SubnetInterfaceMIB', 'mscModVcsWinsPktIndex'), (0, 'Nortel-MsCarrier-MscPassport-SubnetInterfaceMIB', 'mscModVcsWinsTptIndex')) if mibBuilder.loadTexts: mscModVcsWinsEntry.setStatus('mandatory') if mibBuilder.loadTexts: mscModVcsWinsEntry.setDescription('An entry in the mscModVcsWinsTable.') msc_mod_vcs_wins_pkt_index = mib_table_column((1, 3, 6, 1, 4, 1, 562, 36, 2, 1, 16, 2, 213, 1, 1), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11))).clone(namedValues=named_values(('n16', 0), ('n32', 1), ('n64', 2), ('n128', 3), ('n256', 4), ('n512', 5), ('n1024', 6), ('n2048', 7), ('n4096', 8), ('n8192', 9), ('n32768', 10), ('n65535', 11)))) if mibBuilder.loadTexts: mscModVcsWinsPktIndex.setStatus('mandatory') if mibBuilder.loadTexts: mscModVcsWinsPktIndex.setDescription('This variable represents the next to last index for the mscModVcsWinsTable.') msc_mod_vcs_wins_tpt_index = mib_table_column((1, 3, 6, 1, 4, 1, 562, 36, 2, 1, 16, 2, 213, 1, 2), integer32().subtype(subtypeSpec=value_range_constraint(0, 15))) if mibBuilder.loadTexts: mscModVcsWinsTptIndex.setStatus('mandatory') if mibBuilder.loadTexts: mscModVcsWinsTptIndex.setDescription('This variable represents the final index for the mscModVcsWinsTable.') msc_mod_vcs_wins_value = mib_table_column((1, 3, 6, 1, 4, 1, 562, 36, 2, 1, 16, 2, 213, 1, 3), unsigned32().subtype(subtypeSpec=value_range_constraint(1, 63))).setMaxAccess('readwrite') if mibBuilder.loadTexts: mscModVcsWinsValue.setStatus('mandatory') if mibBuilder.loadTexts: mscModVcsWinsValue.setDescription('This variable represents an individual value for the mscModVcsWinsTable.') subnet_interface_group = mib_identifier((1, 3, 6, 1, 4, 1, 562, 36, 2, 2, 45, 1)) subnet_interface_group_ca = mib_identifier((1, 3, 6, 1, 4, 1, 562, 36, 2, 2, 45, 1, 1)) subnet_interface_group_ca02 = mib_identifier((1, 3, 6, 1, 4, 1, 562, 36, 2, 2, 45, 1, 1, 3)) subnet_interface_group_ca02_a = mib_identifier((1, 3, 6, 1, 4, 1, 562, 36, 2, 2, 45, 1, 1, 3, 2)) subnet_interface_capabilities = mib_identifier((1, 3, 6, 1, 4, 1, 562, 36, 2, 2, 45, 3)) subnet_interface_capabilities_ca = mib_identifier((1, 3, 6, 1, 4, 1, 562, 36, 2, 2, 45, 3, 1)) subnet_interface_capabilities_ca02 = mib_identifier((1, 3, 6, 1, 4, 1, 562, 36, 2, 2, 45, 3, 1, 3)) subnet_interface_capabilities_ca02_a = mib_identifier((1, 3, 6, 1, 4, 1, 562, 36, 2, 2, 45, 3, 1, 3, 2)) mibBuilder.exportSymbols('Nortel-MsCarrier-MscPassport-SubnetInterfaceMIB', mscModVcsStorageType=mscModVcsStorageType, mscModVcs=mscModVcs, mscModVcsRowStatusEntry=mscModVcsRowStatusEntry, mscModVcsX121MinAddressLength=mscModVcsX121MinAddressLength, mscModVcsRowStatus=mscModVcsRowStatus, mscModVcsE164NatlMinAddressLength=mscModVcsE164NatlMinAddressLength, mscModVcsAccOptTable=mscModVcsAccOptTable, mscModVcsE164LocalAddressLength=mscModVcsE164LocalAddressLength, mscModVcsE164IntlMinAddressLength=mscModVcsE164IntlMinAddressLength, mscModVcsE164IntlMaxAddressLength=mscModVcsE164IntlMaxAddressLength, mscModVcsE164LocalMaxAddressLength=mscModVcsE164LocalMaxAddressLength, mscModVcsWinsTptIndex=mscModVcsWinsTptIndex, mscModVcsE164IntlPrefixDigits=mscModVcsE164IntlPrefixDigits, mscModVcsComponentName=mscModVcsComponentName, mscModVcsIndex=mscModVcsIndex, subnetInterfaceGroupCA=subnetInterfaceGroupCA, mscModVcsX121IntllPrefixDigit=mscModVcsX121IntllPrefixDigit, mscModVcsDelaySubnetAcks=mscModVcsDelaySubnetAcks, mscModVcsX121Type=mscModVcsX121Type, mscModVcsWinsTable=mscModVcsWinsTable, mscModVcsE164NatlPrefixDigit=mscModVcsE164NatlPrefixDigit, subnetInterfaceMIB=subnetInterfaceMIB, mscModVcsAccountingFax=mscModVcsAccountingFax, mscModVcsMaxSubnetPacketSize=mscModVcsMaxSubnetPacketSize, mscModVcsAddOptTable=mscModVcsAddOptTable, mscModVcsWinsValue=mscModVcsWinsValue, subnetInterfaceCapabilitiesCA02A=subnetInterfaceCapabilitiesCA02A, subnetInterfaceCapabilities=subnetInterfaceCapabilities, subnetInterfaceGroupCA02=subnetInterfaceGroupCA02, subnetInterfaceCapabilitiesCA=subnetInterfaceCapabilitiesCA, mscModVcsX121MaxAddressLength=mscModVcsX121MaxAddressLength, mscModVcsE164IntlFormatAllowed=mscModVcsE164IntlFormatAllowed, subnetInterfaceGroup=subnetInterfaceGroup, mscModVcsSegmentSize=mscModVcsSegmentSize, mscModVcsX121IntlAddresses=mscModVcsX121IntlAddresses, mscModVcsGenerationMode=mscModVcsGenerationMode, mscModVcsWinsEntry=mscModVcsWinsEntry, mscModVcsUnitsCounted=mscModVcsUnitsCounted, mscModVcsNetworkIdType=mscModVcsNetworkIdType, mscModVcsAccOptEntry=mscModVcsAccOptEntry, mscModVcsAddOptEntry=mscModVcsAddOptEntry, mscModVcsX121ToE164EscapeSignificance=mscModVcsX121ToE164EscapeSignificance, mscModVcsDefaultNumberingPlan=mscModVcsDefaultNumberingPlan, mscModVcsIntOptTable=mscModVcsIntOptTable, mscModVcsCallRetryTimer=mscModVcsCallRetryTimer, mscModVcsWinsPktIndex=mscModVcsWinsPktIndex, mscModVcsCallSetupTimer=mscModVcsCallSetupTimer, mscModVcsE164NatlMaxAddressLength=mscModVcsE164NatlMaxAddressLength, subnetInterfaceGroupCA02A=subnetInterfaceGroupCA02A, mscModVcsNetworkIdCode=mscModVcsNetworkIdCode, mscModVcsE164TeleCountryCode=mscModVcsE164TeleCountryCode, mscModVcsIntOptEntry=mscModVcsIntOptEntry, subnetInterfaceCapabilitiesCA02=subnetInterfaceCapabilitiesCA02, mscModVcsE164LocalMinAddressLength=mscModVcsE164LocalMinAddressLength, mscModVcsRowStatusTable=mscModVcsRowStatusTable, mscModVcsHighPriorityPacketSizes=mscModVcsHighPriorityPacketSizes)
samples = { "2_brother_plays": { "question_parts": [range(1, 13), range(13, 17)], "sp_parts": [range(20, 43), range(50, 60)] } }
samples = {'2_brother_plays': {'question_parts': [range(1, 13), range(13, 17)], 'sp_parts': [range(20, 43), range(50, 60)]}}
# coding = utf-8 # Create date: 2018-11-05 # Author :Hailong def test_sysctl(ros_kvm_with_paramiko, cloud_config_url): command = 'sudo cat /proc/sys/kernel/domainname' feed_back = 'test' client = ros_kvm_with_paramiko(cloud_config='{url}/test_sysctl.yml'.format(url=cloud_config_url)) stdin, stdout, stderr = client.exec_command(command, timeout=10) output = stdout.read().decode('utf-8').replace('\n', '') assert (feed_back == output) command_b = 'sudo cat /proc/sys/dev/cdrom/debug' feed_back_b = '1' stdin, stdout, stderr = client.exec_command(command_b, timeout=10) output_b = stdout.read().decode('utf-8').replace('\n', '') client.close() assert (feed_back_b == output_b)
def test_sysctl(ros_kvm_with_paramiko, cloud_config_url): command = 'sudo cat /proc/sys/kernel/domainname' feed_back = 'test' client = ros_kvm_with_paramiko(cloud_config='{url}/test_sysctl.yml'.format(url=cloud_config_url)) (stdin, stdout, stderr) = client.exec_command(command, timeout=10) output = stdout.read().decode('utf-8').replace('\n', '') assert feed_back == output command_b = 'sudo cat /proc/sys/dev/cdrom/debug' feed_back_b = '1' (stdin, stdout, stderr) = client.exec_command(command_b, timeout=10) output_b = stdout.read().decode('utf-8').replace('\n', '') client.close() assert feed_back_b == output_b
#Datos de entrada num=int(input("Ingrese un numero: ")) # Proceso if num==10: print("Calificacion: A") elif num==9: print("Calificacion: B") elif num==8: print("Calificacion: C") elif num==7 and num==6: print("Calificacion: D") elif num<=5 and num>=0: print("Calificacion: F")
num = int(input('Ingrese un numero: ')) if num == 10: print('Calificacion: A') elif num == 9: print('Calificacion: B') elif num == 8: print('Calificacion: C') elif num == 7 and num == 6: print('Calificacion: D') elif num <= 5 and num >= 0: print('Calificacion: F')
ribbon_needed = 0 with open("input.txt", "r") as puzzle_input: for line in puzzle_input: length, width, height = [int(item) for item in line.split("x")] dimensions = [length, width, height] smallest_side = min(dimensions) dimensions.remove(smallest_side) second_smallest_side = min(dimensions) ribbon_needed += 2*smallest_side + 2*second_smallest_side + length*width*height print(ribbon_needed)
ribbon_needed = 0 with open('input.txt', 'r') as puzzle_input: for line in puzzle_input: (length, width, height) = [int(item) for item in line.split('x')] dimensions = [length, width, height] smallest_side = min(dimensions) dimensions.remove(smallest_side) second_smallest_side = min(dimensions) ribbon_needed += 2 * smallest_side + 2 * second_smallest_side + length * width * height print(ribbon_needed)
class Solution: def hammingDistance(self, x: int, y: int) -> int: xor = x ^ y distance = 0 while xor: if xor & 1: distance += 1 xor = xor >> 1 return distance class Solution: def hammingDistance(self, x: int, y: int) -> int: xor = x ^ y distance = 0 while xor: distance += 1 xor = xor & (xor-1) return distance
class Solution: def hamming_distance(self, x: int, y: int) -> int: xor = x ^ y distance = 0 while xor: if xor & 1: distance += 1 xor = xor >> 1 return distance class Solution: def hamming_distance(self, x: int, y: int) -> int: xor = x ^ y distance = 0 while xor: distance += 1 xor = xor & xor - 1 return distance
def setIntersectionCount(group): return len(set.intersection(*group)) groupList = [] tempGroup = [] with open("./6/input.txt") as inputFile: for line in inputFile: line = line.replace("\n","") if len(line) > 0: tempGroup.append(set(line)) else: groupList.append(tempGroup) tempGroup = [] if len(tempGroup) > 0: groupList.append(tempGroup) groupList = list(map(setIntersectionCount,groupList)) print("{} common options in groups".format(sum(groupList)))
def set_intersection_count(group): return len(set.intersection(*group)) group_list = [] temp_group = [] with open('./6/input.txt') as input_file: for line in inputFile: line = line.replace('\n', '') if len(line) > 0: tempGroup.append(set(line)) else: groupList.append(tempGroup) temp_group = [] if len(tempGroup) > 0: groupList.append(tempGroup) group_list = list(map(setIntersectionCount, groupList)) print('{} common options in groups'.format(sum(groupList)))
# If you're new to file handling, be sure to check out with_open.py first! # You'll also want to check out read_text.py before this example. This one is a bit more advanced. with open('read_csv.csv', 'r') as states_file: # Instead of leaving the file contents as a string, we're splitting the file into a list at every new line, and we save that list into the variable states states = states_file.read().split("\n") # Since this is a spreadsheet in comma separated values (CSV) format, we can think of states as a list of rows. # But we'll need to split the columns into a list as well! for index, state in enumerate(states): states[index] = state.split(",") # Now we have a nested list with all of the information! # Our file looks like this: # State, Population Estimate, Percent of Total population # California, 38332521, 11.91% # Texas, 26448193, 8.04% # ... # Our header row is at state[0], so we can use that to display the information in a prettier way. for state in states[1:]: # We use [1:] so we skip the header row. # state[0] is the first column in the row, which contains the name of the state. print("\n---{0}---".format(state[0])) for index, info in enumerate(state[1:]): # We use [1:] so we don't repeat the state name. print("{0}:\t{1}".format(states[0][index+1], info)) # states is the full list of all of the states. It's a nested list. The outer list contains the rows, each inner list contains the columns in that row. # states[0] refers to the header row of the list # So states[0][0] would refer to "State", states[0][1] would refer to "Population Estimate", and states[0][2] would refer to "Percent of total population" # state is one state within states. state is also a list, containing the name, population, and percentage of that particular state. # So the first time through the loop, state[0] would refer to "California", state[1] would refer to 38332521, and state[2] would refer to 11.91% # Since state is being create by the for loop in line 24, it gets a new value each time through. # We're using enumerate to get the index (slicing number) of the column we're on, along with the information. # That way we can pair the column name with the information, as shown in line 30. # NOTE: Since we're slicing from [1:] in line 29, we need to increase the index by + 1, otherwise our headers will be off by one. # Sample output: # ---"California"--- # "Population Estimate": 38332521 # "Percent of Total population": "11.91%" # ---"Texas"--- # "Population Estimate": 26448193 # "Percent of Total population": "8.04%" # ---"New York"--- # "Population Estimate": 19651127 # "Percent of Total population": "6.19%"
with open('read_csv.csv', 'r') as states_file: states = states_file.read().split('\n') for (index, state) in enumerate(states): states[index] = state.split(',') for state in states[1:]: print('\n---{0}---'.format(state[0])) for (index, info) in enumerate(state[1:]): print('{0}:\t{1}'.format(states[0][index + 1], info))
class Student: studentLevel = 'first year computer science 2020/2021 session' studentCounter = 0 registeredCourse='csc102' def __init__(self, thename, thematricno, thesex,thehostelname,theage,thecsc102examscore): self.name = thename self.matricno = thematricno self.sex = thesex self.hostelname =thehostelname self.age=theage self.csc102examscore=thecsc102examscore Student.studentCounter = Student.studentCounter + 1 def getName(self): return self.name def setName(self, thenewName): self.name = thenewName def agedeterminer(self): if self.age>16: print('Student is above 16') def finalscore(self): if self.csc102examscore < 45: print('You will carryover this course, sorry') else: print('You have passed') @classmethod def course(): print(f'Students registered course is {Student.registeredCourse}') @staticmethod def PAUNanthem(): print('Pau, here we come, Pau, here we come ') @staticmethod def ODDorEVEN(num): if num % 2==0: print('Number is even') else: print('Number is odd') @classmethod def studentnum(cls): print(Student.studentCounter) studendt1 = Student('James Kaka', '021074', 'M','Amethyst','16', '49') print(studendt1.getName()) studendt1.setName('James Gaga') print(studendt1.getName()) Student.PAUNanthem()
class Student: student_level = 'first year computer science 2020/2021 session' student_counter = 0 registered_course = 'csc102' def __init__(self, thename, thematricno, thesex, thehostelname, theage, thecsc102examscore): self.name = thename self.matricno = thematricno self.sex = thesex self.hostelname = thehostelname self.age = theage self.csc102examscore = thecsc102examscore Student.studentCounter = Student.studentCounter + 1 def get_name(self): return self.name def set_name(self, thenewName): self.name = thenewName def agedeterminer(self): if self.age > 16: print('Student is above 16') def finalscore(self): if self.csc102examscore < 45: print('You will carryover this course, sorry') else: print('You have passed') @classmethod def course(): print(f'Students registered course is {Student.registeredCourse}') @staticmethod def pau_nanthem(): print('Pau, here we come, Pau, here we come ') @staticmethod def od_dor_even(num): if num % 2 == 0: print('Number is even') else: print('Number is odd') @classmethod def studentnum(cls): print(Student.studentCounter) studendt1 = student('James Kaka', '021074', 'M', 'Amethyst', '16', '49') print(studendt1.getName()) studendt1.setName('James Gaga') print(studendt1.getName()) Student.PAUNanthem()
def say_hi(name,age): print("Hello " + name + ", you are " + age) say_hi("Mike", "35") def cube(num): # function return num*num*num result = cube(4) # variable print(result)
def say_hi(name, age): print('Hello ' + name + ', you are ' + age) say_hi('Mike', '35') def cube(num): return num * num * num result = cube(4) print(result)
# # PySNMP MIB module CXConsoleDriver-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/CXConsoleDriver-MIB # Produced by pysmi-0.3.4 at Wed May 1 12:32:28 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) # Integer, OctetString, ObjectIdentifier = mibBuilder.importSymbols("ASN1", "Integer", "OctetString", "ObjectIdentifier") NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues") ValueSizeConstraint, ValueRangeConstraint, SingleValueConstraint, ConstraintsIntersection, ConstraintsUnion = mibBuilder.importSymbols("ASN1-REFINEMENT", "ValueSizeConstraint", "ValueRangeConstraint", "SingleValueConstraint", "ConstraintsIntersection", "ConstraintsUnion") cxConsoleDriver, = mibBuilder.importSymbols("CXProduct-SMI", "cxConsoleDriver") NotificationGroup, ModuleCompliance = mibBuilder.importSymbols("SNMPv2-CONF", "NotificationGroup", "ModuleCompliance") Counter64, Gauge32, TimeTicks, MibScalar, MibTable, MibTableRow, MibTableColumn, IpAddress, Unsigned32, Integer32, ModuleIdentity, NotificationType, ObjectIdentity, MibIdentifier, Counter32, iso, Bits = mibBuilder.importSymbols("SNMPv2-SMI", "Counter64", "Gauge32", "TimeTicks", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "IpAddress", "Unsigned32", "Integer32", "ModuleIdentity", "NotificationType", "ObjectIdentity", "MibIdentifier", "Counter32", "iso", "Bits") TextualConvention, DisplayString = mibBuilder.importSymbols("SNMPv2-TC", "TextualConvention", "DisplayString") cxCdBaudRate = MibScalar((1, 3, 6, 1, 4, 1, 495, 2, 1, 5, 6, 1), Integer32().clone(9600)).setMaxAccess("readwrite") if mibBuilder.loadTexts: cxCdBaudRate.setStatus('mandatory') if mibBuilder.loadTexts: cxCdBaudRate.setDescription('Determines the baud rate of the console port. The setting of this object is dynamic. The console port immediately implements the option you enter. Options: 9600 19200 38400 115200 Default Value: 9600 Configuration Changed: operative') cxCdCharSize = MibScalar((1, 3, 6, 1, 4, 1, 495, 2, 1, 5, 6, 2), Integer32().subtype(subtypeSpec=ValueRangeConstraint(7, 8)).clone(8)).setMaxAccess("readwrite") if mibBuilder.loadTexts: cxCdCharSize.setStatus('mandatory') if mibBuilder.loadTexts: cxCdCharSize.setDescription('Determines how many bits constitute a character for the console port. Options: none - the value is fixed at 8 Default Value: 8 Configuration Changed: none ') cxCdParity = MibScalar((1, 3, 6, 1, 4, 1, 495, 2, 1, 5, 6, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("noParity", 1), ("evenParity", 2), ("oddParity", 3))).clone('noParity')).setMaxAccess("readwrite") if mibBuilder.loadTexts: cxCdParity.setStatus('mandatory') if mibBuilder.loadTexts: cxCdParity.setDescription('Determines the parity scheme the CPU uses to validate the characters it receives through the console port. Options: none - the value is fixed at noParity Default Value: noParity Configuration Changed: none ') cxCdStopBit = MibScalar((1, 3, 6, 1, 4, 1, 495, 2, 1, 5, 6, 4), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 2)).clone(1)).setMaxAccess("readwrite") if mibBuilder.loadTexts: cxCdStopBit.setStatus('mandatory') if mibBuilder.loadTexts: cxCdStopBit.setDescription('Determines how many stop bits are at the end of each character the console port receives. Options: none - the value is fixed at 1 Default Value: 1 Configuration Changed: none ') cxCdProtocol = MibScalar((1, 3, 6, 1, 4, 1, 495, 2, 1, 5, 6, 5), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("localConsole", 1), ("ppp", 2))).clone('localConsole')).setMaxAccess("readwrite") if mibBuilder.loadTexts: cxCdProtocol.setStatus('mandatory') if mibBuilder.loadTexts: cxCdProtocol.setDescription('Determines the protocol (configuration method) for the console port. The setting of this object is dynamic. The console port immediately implements the option you enter. However, if you change the protocol you are currently using to configure the port your connection will be lost. Options: localConsole (1): you use this protocol when you attach a TTY terminal directly to the console port. This protocol requires you to use command line configuration. You also must enter a password to gain access to the configuration tables. You can define the password using the object uiPassword of the CXUserInterface Table. ppp (2): you use this protocol when you are configuring via a windows-based application such as HP/OV (Hewlett Packard-OpenView). Default Value: ppp (2) Configuration Changed: operative') mibBuilder.exportSymbols("CXConsoleDriver-MIB", cxCdParity=cxCdParity, cxCdProtocol=cxCdProtocol, cxCdBaudRate=cxCdBaudRate, cxCdStopBit=cxCdStopBit, cxCdCharSize=cxCdCharSize)
(integer, octet_string, object_identifier) = mibBuilder.importSymbols('ASN1', 'Integer', 'OctetString', 'ObjectIdentifier') (named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues') (value_size_constraint, value_range_constraint, single_value_constraint, constraints_intersection, constraints_union) = mibBuilder.importSymbols('ASN1-REFINEMENT', 'ValueSizeConstraint', 'ValueRangeConstraint', 'SingleValueConstraint', 'ConstraintsIntersection', 'ConstraintsUnion') (cx_console_driver,) = mibBuilder.importSymbols('CXProduct-SMI', 'cxConsoleDriver') (notification_group, module_compliance) = mibBuilder.importSymbols('SNMPv2-CONF', 'NotificationGroup', 'ModuleCompliance') (counter64, gauge32, time_ticks, mib_scalar, mib_table, mib_table_row, mib_table_column, ip_address, unsigned32, integer32, module_identity, notification_type, object_identity, mib_identifier, counter32, iso, bits) = mibBuilder.importSymbols('SNMPv2-SMI', 'Counter64', 'Gauge32', 'TimeTicks', 'MibScalar', 'MibTable', 'MibTableRow', 'MibTableColumn', 'IpAddress', 'Unsigned32', 'Integer32', 'ModuleIdentity', 'NotificationType', 'ObjectIdentity', 'MibIdentifier', 'Counter32', 'iso', 'Bits') (textual_convention, display_string) = mibBuilder.importSymbols('SNMPv2-TC', 'TextualConvention', 'DisplayString') cx_cd_baud_rate = mib_scalar((1, 3, 6, 1, 4, 1, 495, 2, 1, 5, 6, 1), integer32().clone(9600)).setMaxAccess('readwrite') if mibBuilder.loadTexts: cxCdBaudRate.setStatus('mandatory') if mibBuilder.loadTexts: cxCdBaudRate.setDescription('Determines the baud rate of the console port. The setting of this object is dynamic. The console port immediately implements the option you enter. Options: 9600 19200 38400 115200 Default Value: 9600 Configuration Changed: operative') cx_cd_char_size = mib_scalar((1, 3, 6, 1, 4, 1, 495, 2, 1, 5, 6, 2), integer32().subtype(subtypeSpec=value_range_constraint(7, 8)).clone(8)).setMaxAccess('readwrite') if mibBuilder.loadTexts: cxCdCharSize.setStatus('mandatory') if mibBuilder.loadTexts: cxCdCharSize.setDescription('Determines how many bits constitute a character for the console port. Options: none - the value is fixed at 8 Default Value: 8 Configuration Changed: none ') cx_cd_parity = mib_scalar((1, 3, 6, 1, 4, 1, 495, 2, 1, 5, 6, 3), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3))).clone(namedValues=named_values(('noParity', 1), ('evenParity', 2), ('oddParity', 3))).clone('noParity')).setMaxAccess('readwrite') if mibBuilder.loadTexts: cxCdParity.setStatus('mandatory') if mibBuilder.loadTexts: cxCdParity.setDescription('Determines the parity scheme the CPU uses to validate the characters it receives through the console port. Options: none - the value is fixed at noParity Default Value: noParity Configuration Changed: none ') cx_cd_stop_bit = mib_scalar((1, 3, 6, 1, 4, 1, 495, 2, 1, 5, 6, 4), integer32().subtype(subtypeSpec=value_range_constraint(1, 2)).clone(1)).setMaxAccess('readwrite') if mibBuilder.loadTexts: cxCdStopBit.setStatus('mandatory') if mibBuilder.loadTexts: cxCdStopBit.setDescription('Determines how many stop bits are at the end of each character the console port receives. Options: none - the value is fixed at 1 Default Value: 1 Configuration Changed: none ') cx_cd_protocol = mib_scalar((1, 3, 6, 1, 4, 1, 495, 2, 1, 5, 6, 5), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('localConsole', 1), ('ppp', 2))).clone('localConsole')).setMaxAccess('readwrite') if mibBuilder.loadTexts: cxCdProtocol.setStatus('mandatory') if mibBuilder.loadTexts: cxCdProtocol.setDescription('Determines the protocol (configuration method) for the console port. The setting of this object is dynamic. The console port immediately implements the option you enter. However, if you change the protocol you are currently using to configure the port your connection will be lost. Options: localConsole (1): you use this protocol when you attach a TTY terminal directly to the console port. This protocol requires you to use command line configuration. You also must enter a password to gain access to the configuration tables. You can define the password using the object uiPassword of the CXUserInterface Table. ppp (2): you use this protocol when you are configuring via a windows-based application such as HP/OV (Hewlett Packard-OpenView). Default Value: ppp (2) Configuration Changed: operative') mibBuilder.exportSymbols('CXConsoleDriver-MIB', cxCdParity=cxCdParity, cxCdProtocol=cxCdProtocol, cxCdBaudRate=cxCdBaudRate, cxCdStopBit=cxCdStopBit, cxCdCharSize=cxCdCharSize)
# written by abraham on aug 24 def dyear2date(dyear): year = int(dyear) month_lengths = [31,28,31,30,31,30,31,31,30,31,30,31] days_before_months = [0,31,59,90,120,151,181,212,243,273,304,334] days_into_year_f = (dyear-year)*365 days_into_year_i = int(days_into_year_f) for i in range(12): if days_before_months[i] < days_into_year_f < (days_before_months[i]+month_lengths[i]): month = i+1 break date = days_into_year_i - days_before_months[month-1] hours_f = (days_into_year_f-days_into_year_i)*24 hours_i = int(hours_f) minutes_f = (hours_f-hours_i)*60 minutes_i = int(minutes_f) seconds_i = int((minutes_f-minutes_i)*60) return "%02d/%02d/%d %02d:%02d:%02d" % (month,date,year,hours_i,minutes_i,seconds_i)
def dyear2date(dyear): year = int(dyear) month_lengths = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31] days_before_months = [0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334] days_into_year_f = (dyear - year) * 365 days_into_year_i = int(days_into_year_f) for i in range(12): if days_before_months[i] < days_into_year_f < days_before_months[i] + month_lengths[i]: month = i + 1 break date = days_into_year_i - days_before_months[month - 1] hours_f = (days_into_year_f - days_into_year_i) * 24 hours_i = int(hours_f) minutes_f = (hours_f - hours_i) * 60 minutes_i = int(minutes_f) seconds_i = int((minutes_f - minutes_i) * 60) return '%02d/%02d/%d %02d:%02d:%02d' % (month, date, year, hours_i, minutes_i, seconds_i)
# file = open('C:\\Users\\dks10\\OneDrive\\Desktop\\Projects\\Code\\Python\\PythonCrypto\\Module_3\\eye.png', 'rb') file = open('encrypt_eye.png', 'rb') image = file.read() file.close() image = bytearray(image) key = 48 for index, value in enumerate(image): image[index] = value^key file = open('2eye.png','wb') file.write(image) file.close()
file = open('encrypt_eye.png', 'rb') image = file.read() file.close() image = bytearray(image) key = 48 for (index, value) in enumerate(image): image[index] = value ^ key file = open('2eye.png', 'wb') file.write(image) file.close()
n=int(input()) c = 1 while c**2 < n: print(c**2) c += 1
n = int(input()) c = 1 while c ** 2 < n: print(c ** 2) c += 1
# CPU: 0.06 s possessed, found, condition = map(int, input().split()) possessed += found count = 0 while possessed >= condition: div, mod = divmod(possessed, condition) count += div possessed = div + mod print(count)
(possessed, found, condition) = map(int, input().split()) possessed += found count = 0 while possessed >= condition: (div, mod) = divmod(possessed, condition) count += div possessed = div + mod print(count)
print(18 * 1234) print(18 * 1234 * 2) print(0 * 1) print(1 * 0) print(0.0 * 1.0) print(1.0 * 0.0)
print(18 * 1234) print(18 * 1234 * 2) print(0 * 1) print(1 * 0) print(0.0 * 1.0) print(1.0 * 0.0)
class Dummy(): def __init__(self, data): self.name = data['name'] self.age = data['age'] self.city = data['city'] class DummyData(): def __init__(self): self.results = [ Dummy({ 'name': 'PA', 'age': 29, 'city': 'Paris' }), Dummy({ 'name': 'Cairo', 'age': 0, 'city': 'Muizenberg' }), Dummy({ 'name': 'Carina', 'age': 26, 'city': 'Windhoek' }) ] def write_name(self, instance, kwargs={}): return instance.name def write_age(self, instance, kwargs={}): return instance.age def write_city(self, instance, kwargs={}): return instance.city def get_age_list(self): return [i for i in range(0, 99)] def get_city_list(self): return [ 'Paris', 'Muizenberg', 'Windhoek', 'Saint-Dizier' ] def write_get_repeat_func(self): return len(self.results) def write_get_name_func(self, instance, kwargs={}): return self.results[kwargs['index']].name
class Dummy: def __init__(self, data): self.name = data['name'] self.age = data['age'] self.city = data['city'] class Dummydata: def __init__(self): self.results = [dummy({'name': 'PA', 'age': 29, 'city': 'Paris'}), dummy({'name': 'Cairo', 'age': 0, 'city': 'Muizenberg'}), dummy({'name': 'Carina', 'age': 26, 'city': 'Windhoek'})] def write_name(self, instance, kwargs={}): return instance.name def write_age(self, instance, kwargs={}): return instance.age def write_city(self, instance, kwargs={}): return instance.city def get_age_list(self): return [i for i in range(0, 99)] def get_city_list(self): return ['Paris', 'Muizenberg', 'Windhoek', 'Saint-Dizier'] def write_get_repeat_func(self): return len(self.results) def write_get_name_func(self, instance, kwargs={}): return self.results[kwargs['index']].name
array = [] for _ in range(int(input())): command = input().strip().split(" ") cmd_type = command[0] if (cmd_type == "print"): print(array) elif (cmd_type == "sort"): array.sort() elif (cmd_type == "reverse"): array.reverse() elif (cmd_type == "pop"): array.pop() elif (cmd_type == "remove"): array.remove(int(command[1])) elif (cmd_type == "append"): array.append(int(command[1])) elif (cmd_type == "insert"): array.insert(int(command[1]), int(command[2]))
array = [] for _ in range(int(input())): command = input().strip().split(' ') cmd_type = command[0] if cmd_type == 'print': print(array) elif cmd_type == 'sort': array.sort() elif cmd_type == 'reverse': array.reverse() elif cmd_type == 'pop': array.pop() elif cmd_type == 'remove': array.remove(int(command[1])) elif cmd_type == 'append': array.append(int(command[1])) elif cmd_type == 'insert': array.insert(int(command[1]), int(command[2]))
class AuthError(Exception): pass class JsonError(Exception): pass
class Autherror(Exception): pass class Jsonerror(Exception): pass
# 3. Define a function to check whether a number is even def even(num): if num%2 == 0: return True else: return False print(even(4)) print(even(-5))
def even(num): if num % 2 == 0: return True else: return False print(even(4)) print(even(-5))
class OverlapResult: def __init__(self, overlap_map: dict[tuple[float, float], int]): self._overlap_map = overlap_map self._overlaps = overlap_map_to_overlaps(overlap_map) @property def overlaps(self) -> int: return self._overlaps @property def overlap_map(self) -> dict[tuple[float, float], int]: return self._overlap_map def overlap_map_to_overlaps(overlap_map: dict[tuple[float, float], int], minimal_overlap=2) -> int: return len(list(filter(lambda val: val >= minimal_overlap, overlap_map.values())))
class Overlapresult: def __init__(self, overlap_map: dict[tuple[float, float], int]): self._overlap_map = overlap_map self._overlaps = overlap_map_to_overlaps(overlap_map) @property def overlaps(self) -> int: return self._overlaps @property def overlap_map(self) -> dict[tuple[float, float], int]: return self._overlap_map def overlap_map_to_overlaps(overlap_map: dict[tuple[float, float], int], minimal_overlap=2) -> int: return len(list(filter(lambda val: val >= minimal_overlap, overlap_map.values())))
class Config: def __init__(self, config_file_name): self.config_file_name = config_file_name
class Config: def __init__(self, config_file_name): self.config_file_name = config_file_name
# @AUTHOR : lonsty # @DATE : 2020/3/28 18:01 class CookiesExpiredException(Exception): pass class NoImagesException(Exception): pass class ContentParserError(Exception): pass class UserNotFound(Exception): pass
class Cookiesexpiredexception(Exception): pass class Noimagesexception(Exception): pass class Contentparsererror(Exception): pass class Usernotfound(Exception): pass
def can_build(env, platform): return True def configure(env): pass def get_doc_classes(): return [ "WorldArea", "VoxelLight", "VoxelLightNode", "VoxelLevelGenerator", "VoxelLevelGeneratorFlat", "VoxelSurfaceMerger", "VoxelSurfaceSimple", "VoxelSurface", "VoxelLibraryMerger", "VoxelLibrarySimple", "VoxelLibrary", "VoxelLibraryMergerPCM", "VoxelMaterialCache", "VoxelMaterialCachePCM", "VoxelCubePoints", "VoxelMesherCubic", "VoxelMeshData", "MarchingCubesCellData", "VoxelMesherMarchingCubes", "VoxelMesher", "EnvironmentData", "VoxelChunk", "VoxelChunkDefault", "VoxelStructure", "BlockVoxelStructure", "VoxelWorld", "VoxelMesherBlocky", "VoxelWorldBlocky", "VoxelChunkBlocky", "VoxelMesherLiquidBlocky", "VoxelWorldMarchingCubes", "VoxelChunkMarchingCubes", "VoxelMesherCubic", "VoxelWorldCubic", "VoxelChunkCubic", "VoxelMesherDefault", "VoxelWorldDefault", "VoxelJob", "VoxelTerrainJob", "VoxelLightJob", "VoxelPropJob", "VoxelMesherJobStep", ] def get_doc_path(): return "doc_classes"
def can_build(env, platform): return True def configure(env): pass def get_doc_classes(): return ['WorldArea', 'VoxelLight', 'VoxelLightNode', 'VoxelLevelGenerator', 'VoxelLevelGeneratorFlat', 'VoxelSurfaceMerger', 'VoxelSurfaceSimple', 'VoxelSurface', 'VoxelLibraryMerger', 'VoxelLibrarySimple', 'VoxelLibrary', 'VoxelLibraryMergerPCM', 'VoxelMaterialCache', 'VoxelMaterialCachePCM', 'VoxelCubePoints', 'VoxelMesherCubic', 'VoxelMeshData', 'MarchingCubesCellData', 'VoxelMesherMarchingCubes', 'VoxelMesher', 'EnvironmentData', 'VoxelChunk', 'VoxelChunkDefault', 'VoxelStructure', 'BlockVoxelStructure', 'VoxelWorld', 'VoxelMesherBlocky', 'VoxelWorldBlocky', 'VoxelChunkBlocky', 'VoxelMesherLiquidBlocky', 'VoxelWorldMarchingCubes', 'VoxelChunkMarchingCubes', 'VoxelMesherCubic', 'VoxelWorldCubic', 'VoxelChunkCubic', 'VoxelMesherDefault', 'VoxelWorldDefault', 'VoxelJob', 'VoxelTerrainJob', 'VoxelLightJob', 'VoxelPropJob', 'VoxelMesherJobStep'] def get_doc_path(): return 'doc_classes'
# The Pokemon class should receive a name (string) and health (int) upon initialization. # It should also have a method called pokemon_details that returns the information about the pokemon: # "{pokemon_name} with health {pokemon_health}" class Pokemon: def __init__(self, name: str, health: int) -> None: self.name = name self.health = health def pokemon_details(self) -> str: return f"{self.name} with health {self.health}"
class Pokemon: def __init__(self, name: str, health: int) -> None: self.name = name self.health = health def pokemon_details(self) -> str: return f'{self.name} with health {self.health}'
{ "includes": [ "../common.gypi" ], "targets": [ { "target_name": "libgdal_ogr_mem_frmt", "type": "static_library", "sources": [ "../gdal/ogr/ogrsf_frmts/mem/ogrmemdatasource.cpp", "../gdal/ogr/ogrsf_frmts/mem/ogrmemlayer.cpp", "../gdal/ogr/ogrsf_frmts/mem/ogrmemdriver.cpp" ], "include_dirs": [ "../gdal/ogr/ogrsf_frmts/mem" ] } ] }
{'includes': ['../common.gypi'], 'targets': [{'target_name': 'libgdal_ogr_mem_frmt', 'type': 'static_library', 'sources': ['../gdal/ogr/ogrsf_frmts/mem/ogrmemdatasource.cpp', '../gdal/ogr/ogrsf_frmts/mem/ogrmemlayer.cpp', '../gdal/ogr/ogrsf_frmts/mem/ogrmemdriver.cpp'], 'include_dirs': ['../gdal/ogr/ogrsf_frmts/mem']}]}
_base_ = ['./tracktor_faster-rcnn_r50_fpn_4e_mot17-public-half.py'] model = dict( pretrains=dict( detector= # noqa: E251 'https://download.openmmlab.com/mmtracking/mot/faster_rcnn/faster-rcnn_r50_fpn_4e_mot17-ffa52ae7.pth' # noqa: E501 )) data_root = 'data/MOT17/' test_set = 'test' data = dict( train=dict(ann_file=data_root + 'annotations/train_cocoformat.json'), val=dict( ann_file=data_root + 'annotations/train_cocoformat.json', detection_file=data_root + 'annotations/train_detections.pkl'), test=dict( ann_file=data_root + f'annotations/{test_set}_cocoformat.json', img_prefix=data_root + test_set, detection_file=data_root + f'annotations/{test_set}_detections.pkl'))
_base_ = ['./tracktor_faster-rcnn_r50_fpn_4e_mot17-public-half.py'] model = dict(pretrains=dict(detector='https://download.openmmlab.com/mmtracking/mot/faster_rcnn/faster-rcnn_r50_fpn_4e_mot17-ffa52ae7.pth')) data_root = 'data/MOT17/' test_set = 'test' data = dict(train=dict(ann_file=data_root + 'annotations/train_cocoformat.json'), val=dict(ann_file=data_root + 'annotations/train_cocoformat.json', detection_file=data_root + 'annotations/train_detections.pkl'), test=dict(ann_file=data_root + f'annotations/{test_set}_cocoformat.json', img_prefix=data_root + test_set, detection_file=data_root + f'annotations/{test_set}_detections.pkl'))
# This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Ansible is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with Ansible. If not, see <http://www.gnu.org/licenses/>. # class ModuleDocFragment(object): # Docker doc fragment DOCUMENTATION = ''' options: docker_host: description: - "The URL or Unix socket path used to connect to the Docker API. To connect to a remote host, provide the TCP connection string. For example, 'tcp://192.0.2.23:2376'. If TLS is used to encrypt the connection, the module will automatically replace 'tcp' in the connection URL with 'https'." required: false default: "unix://var/run/docker.sock" aliases: - docker_url tls_hostname: description: - When verifying the authenticity of the Docker Host server, provide the expected name of the server. default: localhost required: false api_version: description: - The version of the Docker API running on the Docker Host. Defaults to the latest version of the API supported by docker-py. required: false default: default provided by docker-py aliases: - docker_api_version timeout: description: - The maximum amount of time in seconds to wait on a response from the API. required: false default: 60 cacert_path: description: - Use a CA certificate when performing server verification by providing the path to a CA certificate file. required: false default: null aliases: - tls_ca_cert cert_path: description: - Path to the client's TLS certificate file. required: false default: null aliases: - tls_client_cert key_path: description: - Path to the client's TLS key file. required: false default: null aliases: - tls_client_key ssl_version: description: - Provide a valid SSL version number. Default value determined by docker-py, currently 1.0. required: false default: "1.0" tls: description: - Secure the connection to the API by using TLS without verifying the authenticity of the Docker host server. default: false tls_verify: description: - Secure the connection to the API by using TLS and verifying the authenticity of the Docker host server. default: false notes: - Connect to the Docker daemon by providing parameters with each task or by defining environment variables. You can define DOCKER_HOST, DOCKER_TLS_HOSTNAME, DOCKER_API_VERSION, DOCKER_CERT_PATH, DOCKER_SSL_VERSION, DOCKER_TLS, DOCKER_TLS_VERIFY and DOCKER_TIMEOUT. If you are using docker machine, run the script shipped with the product that sets up the environment. It will set these variables for you. See https://docker-py.readthedocs.org/en/stable/machine/ for more details. '''
class Moduledocfragment(object): documentation = '\n\noptions:\n docker_host:\n description:\n - "The URL or Unix socket path used to connect to the Docker API. To connect to a remote host, provide the\n TCP connection string. For example, \'tcp://192.0.2.23:2376\'. If TLS is used to encrypt the connection,\n the module will automatically replace \'tcp\' in the connection URL with \'https\'."\n required: false\n default: "unix://var/run/docker.sock"\n aliases:\n - docker_url\n tls_hostname:\n description:\n - When verifying the authenticity of the Docker Host server, provide the expected name of the server.\n default: localhost\n required: false\n api_version:\n description:\n - The version of the Docker API running on the Docker Host. Defaults to the latest version of the API\n supported by docker-py.\n required: false\n default: default provided by docker-py\n aliases:\n - docker_api_version\n timeout:\n description:\n - The maximum amount of time in seconds to wait on a response from the API.\n required: false\n default: 60\n cacert_path:\n description:\n - Use a CA certificate when performing server verification by providing the path to a CA certificate file.\n required: false\n default: null\n aliases:\n - tls_ca_cert\n cert_path:\n description:\n - Path to the client\'s TLS certificate file.\n required: false\n default: null\n aliases:\n - tls_client_cert\n key_path:\n description:\n - Path to the client\'s TLS key file.\n required: false\n default: null\n aliases:\n - tls_client_key\n ssl_version:\n description:\n - Provide a valid SSL version number. Default value determined by docker-py, currently 1.0.\n required: false\n default: "1.0"\n tls:\n description:\n - Secure the connection to the API by using TLS without verifying the authenticity of the Docker host\n server.\n default: false\n tls_verify:\n description:\n - Secure the connection to the API by using TLS and verifying the authenticity of the Docker host server.\n default: false\n\nnotes:\n - Connect to the Docker daemon by providing parameters with each task or by defining environment variables.\n You can define DOCKER_HOST, DOCKER_TLS_HOSTNAME, DOCKER_API_VERSION, DOCKER_CERT_PATH, DOCKER_SSL_VERSION,\n DOCKER_TLS, DOCKER_TLS_VERIFY and DOCKER_TIMEOUT. If you are using docker machine, run the script shipped\n with the product that sets up the environment. It will set these variables for you. See\n https://docker-py.readthedocs.org/en/stable/machine/ for more details.\n'
DEFAULT_MIRRORS = { "bitbucket": [ "https://bitbucket.org/{repository}/get/{commit}.tar.gz", ], "buildifier": [ "https://github.com/bazelbuild/buildtools/releases/download/{version}/{filename}", ], "github": [ "https://github.com/{repository}/archive/{commit}.tar.gz", ], "pypi": [ "https://files.pythonhosted.org/packages/source/{p}/{package}/{package}-{version}.tar.gz", ], }
default_mirrors = {'bitbucket': ['https://bitbucket.org/{repository}/get/{commit}.tar.gz'], 'buildifier': ['https://github.com/bazelbuild/buildtools/releases/download/{version}/{filename}'], 'github': ['https://github.com/{repository}/archive/{commit}.tar.gz'], 'pypi': ['https://files.pythonhosted.org/packages/source/{p}/{package}/{package}-{version}.tar.gz']}
class Animal(): edad:int patas:int ruido:str nombre: str kgComida: float = 0 def __init__(self, edad, patas, ruido, nombre): self.edad =edad self.patas = patas self.ruido = ruido self.nombre = nombre def comer(self, alimento): self.kgComida += alimento print('Hola,', self.nombre, 'comes', self.kgComida) def hacerRuido(self): print('Hola', self.nombre, 'haces' , self.ruido)
class Animal: edad: int patas: int ruido: str nombre: str kg_comida: float = 0 def __init__(self, edad, patas, ruido, nombre): self.edad = edad self.patas = patas self.ruido = ruido self.nombre = nombre def comer(self, alimento): self.kgComida += alimento print('Hola,', self.nombre, 'comes', self.kgComida) def hacer_ruido(self): print('Hola', self.nombre, 'haces', self.ruido)
maxWeight = 30 value = [15, 7, 10, 5, 8, 17] weight = [15, 3, 2, 5, 9, 20] def bag(pos, selected): # calcula o total totalValue = 0 pesoTotal = 0 for i in selected: totalValue += value[i] pesoTotal += weight[i] if pesoTotal > maxWeight: return (0,0) if pos >= len(weight): return (totalValue, pesoTotal) answer1 = bag(pos + 1, selected + [pos]) answer2 = bag(pos + 1, list(selected)) if answer1[0] > answer2[0]: return answer1 else: return answer2 bestAnswer = bag(0, []) print(bestAnswer)
max_weight = 30 value = [15, 7, 10, 5, 8, 17] weight = [15, 3, 2, 5, 9, 20] def bag(pos, selected): total_value = 0 peso_total = 0 for i in selected: total_value += value[i] peso_total += weight[i] if pesoTotal > maxWeight: return (0, 0) if pos >= len(weight): return (totalValue, pesoTotal) answer1 = bag(pos + 1, selected + [pos]) answer2 = bag(pos + 1, list(selected)) if answer1[0] > answer2[0]: return answer1 else: return answer2 best_answer = bag(0, []) print(bestAnswer)
ADDED_KARMA_TO_MEMBER = "Gave {} karma to {}, their karma is now at {}." REMOVED_KARMA_FROM_MEMBER = "Removed {} karma from {}, their karma is now at {}." LIST_KARMA_OWN = "You currently have {} karma." LIST_KARMA_OBJECT = "\"{}\" currently has {} karma." LIST_KARMA_MEMBER = "{} currently has {} karma." KARMA_TOP_START = "Top karma in server:\n" KARMA_TOP_FORMAT = "{}. {} \\| {}\n"
added_karma_to_member = 'Gave {} karma to {}, their karma is now at {}.' removed_karma_from_member = 'Removed {} karma from {}, their karma is now at {}.' list_karma_own = 'You currently have {} karma.' list_karma_object = '"{}" currently has {} karma.' list_karma_member = '{} currently has {} karma.' karma_top_start = 'Top karma in server:\n' karma_top_format = '{}. {} \\| {}\n'
# simple test function that uses python 3 features (e.g., f-strings) # see https://github.com/localstack/localstack/issues/264 def handler(event, context): # the following line is Python 3.6+ specific msg = f"Successfully processed {event}" # noqa This code is Python 3.6+ only return event
def handler(event, context): msg = f'Successfully processed {event}' return event
def deco1(func): print("before myfunc() called.") func() print("after myfunc() called.") def myfunc(): print("myfunc() called.") deco1(myfunc)
def deco1(func): print('before myfunc() called.') func() print('after myfunc() called.') def myfunc(): print('myfunc() called.') deco1(myfunc)
class ShoppingCart(object): def __init__(self): self.total = 0 self.items = dict() def add_item(self, item_name, quantity, price): if item_name != None and quantity >= 1: self.items.update({item_name: quantity}) if quantity and price >= 1: self.total += (quantity * price) def remove_item(self, item_name, quantity, price): if item_name in self.items: if quantity < self.items[item_name] and quantity > 0: self.items[item_name] -= quantity self.total -= price*quantity def checkout(self, cash_paid): balance = 0 if cash_paid < self.total: return "Cash paid not enough" balance = cash_paid - self.total return balance class Shop(ShoppingCart): def __init__(self): self.quantity = 100 def remove_item(self): self.quantity -= 1
class Shoppingcart(object): def __init__(self): self.total = 0 self.items = dict() def add_item(self, item_name, quantity, price): if item_name != None and quantity >= 1: self.items.update({item_name: quantity}) if quantity and price >= 1: self.total += quantity * price def remove_item(self, item_name, quantity, price): if item_name in self.items: if quantity < self.items[item_name] and quantity > 0: self.items[item_name] -= quantity self.total -= price * quantity def checkout(self, cash_paid): balance = 0 if cash_paid < self.total: return 'Cash paid not enough' balance = cash_paid - self.total return balance class Shop(ShoppingCart): def __init__(self): self.quantity = 100 def remove_item(self): self.quantity -= 1
def solution(bridge_length, weight, truck_weights): answer = 0 # { weight, time } wait = truck_weights[:] bridge = [] passed = 0 currWeight = 0 while True: if passed == len(truck_weights) and len(wait) == 0: return answer answer += 1 # sth needs to be passed if bridge: if bridge[0]['t'] + bridge_length == answer: front = bridge.pop(0) currWeight -= front['w'] passed += 1 # add new truck if wait: if currWeight + wait[0] <= weight: bridge.append({ 'w' : wait[0], 't' : answer }) currWeight += wait[0] wait.pop(0) # print(solution(2, 10, [7, 4, 5, 6])) print(solution(100, 100, [10]))
def solution(bridge_length, weight, truck_weights): answer = 0 wait = truck_weights[:] bridge = [] passed = 0 curr_weight = 0 while True: if passed == len(truck_weights) and len(wait) == 0: return answer answer += 1 if bridge: if bridge[0]['t'] + bridge_length == answer: front = bridge.pop(0) curr_weight -= front['w'] passed += 1 if wait: if currWeight + wait[0] <= weight: bridge.append({'w': wait[0], 't': answer}) curr_weight += wait[0] wait.pop(0) print(solution(100, 100, [10]))
def check_difference(): pass def update_benchmark(): pass
def check_difference(): pass def update_benchmark(): pass
# while True: # # ejecuta esto # print("Hola") real = 7 print("Entre un numero entre el 1 y el 10") guess = int(input()) # =/= while guess != real: print("Ese no es el numero") print("Entre un numero entre el 1 y el 10") guess = int(input()) # el resto print("Yay! Lo sacastes!")
real = 7 print('Entre un numero entre el 1 y el 10') guess = int(input()) while guess != real: print('Ese no es el numero') print('Entre un numero entre el 1 y el 10') guess = int(input()) print('Yay! Lo sacastes!')
class Foo: def bar(self): return "a" if __name__ == "__main__": f = Foo() b = f.bar() print(b)
class Foo: def bar(self): return 'a' if __name__ == '__main__': f = foo() b = f.bar() print(b)
''' Speed: 95.97% Memory: 24.96% Time complexity: O(n) Space complexity: O(n) ''' class Solution(object): def longestValidParentheses(self, s): ans=0 stack=[-1] for i in range(len(s)): if(s[i]=='('): stack.append(i) else: stack.pop() if(len(stack)==0): stack.append(i) else: ans=max(ans,i-stack[-1]) return ans
""" Speed: 95.97% Memory: 24.96% Time complexity: O(n) Space complexity: O(n) """ class Solution(object): def longest_valid_parentheses(self, s): ans = 0 stack = [-1] for i in range(len(s)): if s[i] == '(': stack.append(i) else: stack.pop() if len(stack) == 0: stack.append(i) else: ans = max(ans, i - stack[-1]) return ans
def greet(): print("Hi") def greet_again(message): print(message) def greet_again_with_type(message): print(type(message)) print(message) greet() greet_again("Hello Again") greet_again_with_type("One Last Time") greet_again_with_type(1234) # multiple types def multiple_types(x): if x < 0: return -1 else: return "Returning Hello" print(multiple_types(-2)) print(multiple_types(10)) # variable arguments def var_arguments(*args): # args will be tuples containing all the values for value in args: print(value) var_arguments(1, 2, 3) a = [1, 2, 3] var_arguments(a) var_arguments(*a) # expanding def key_arg(**kwargs): for key,value in kwargs.items(): print(key, value) v b = {"first" : "python", "second" : "python again"} key_arg(b)
def greet(): print('Hi') def greet_again(message): print(message) def greet_again_with_type(message): print(type(message)) print(message) greet() greet_again('Hello Again') greet_again_with_type('One Last Time') greet_again_with_type(1234) def multiple_types(x): if x < 0: return -1 else: return 'Returning Hello' print(multiple_types(-2)) print(multiple_types(10)) def var_arguments(*args): for value in args: print(value) var_arguments(1, 2, 3) a = [1, 2, 3] var_arguments(a) var_arguments(*a) def key_arg(**kwargs): for (key, value) in kwargs.items(): print(key, value) v b = {'first': 'python', 'second': 'python again'} key_arg(b)
# Authentication & API Keys # Many APIs require an API key. Just as a real-world key allows you to access something, an API key grants you access to a particular API. Moreover, an API key identifies you to the API, which helps the API provider keep track of how their service is used and prevent unauthorized or malicious activity. # # Some APIs require authentication using a protocol called OAuth. We won't get into the details, but if you've ever been redirected to a page asking for permission to link an application with your account, you've probably used OAuth. # # API keys are often long alphanumeric strings. We've made one up in the editor to the right! (It won't actually work on anything, but when you receive your own API keys in future projects, they'll look a lot like this.) api_key = "string"
api_key = 'string'
class Solution: def findDuplicate(self, nums: List[int]) -> int: p1, p2 = nums[0], nums[nums[0]] while nums[p1] != nums[p2]: p1 = nums[p1] p2 = nums[nums[p2]] p2 = 0 while nums[p1] != nums[p2]: p1 = nums[p1] p2 = nums[p2] return nums[p1]
class Solution: def find_duplicate(self, nums: List[int]) -> int: (p1, p2) = (nums[0], nums[nums[0]]) while nums[p1] != nums[p2]: p1 = nums[p1] p2 = nums[nums[p2]] p2 = 0 while nums[p1] != nums[p2]: p1 = nums[p1] p2 = nums[p2] return nums[p1]
class A: def a(self): return 'a' class B(A, object): def b(self): return 'b' class Inherit(A): def a(self): return 'c'
class A: def a(self): return 'a' class B(A, object): def b(self): return 'b' class Inherit(A): def a(self): return 'c'
def sum_of_squares(n): return sum(i ** 2 for i in range(1, n+1)) def square_of_sum(n): return sum(range(1, n+1)) ** 2
def sum_of_squares(n): return sum((i ** 2 for i in range(1, n + 1))) def square_of_sum(n): return sum(range(1, n + 1)) ** 2
Credits = [ ('Bootstrap', 'https://getbootstrap.com', 'The Bootstrap team', 'MIT'), ('Bottle', 'http://bottlepy.org', 'Marcel Hellkamp', 'MIT'), ('Cheroot', 'https://github.com/cherrypy/cheroot', 'CherryPy Team', 'BSD 3-Clause "New" or "Revised" License'), ('Click', 'https://github.com/pallets/click', 'Pallets', 'BSD 3-Clause "New" or "Revised" License'), ('ConfigUpdater', 'https://github.com/pyscaffold/configupdater', 'Florian Wilhelm', 'MIT'), ('Glide', 'https://github.com/glidejs/glide', '@jedrzejchalubek', 'MIT'), ('JQuery', 'https://jquery.com', 'The jQuery Foundation', 'MIT'), ('jquery.pep.js', 'http://pep.briangonzalez.org', '@briangonzalez', 'MIT'), ('js-md5', 'https://github.com/emn178/js-md5', '@emn178', 'MIT'), ('PySocks', 'https://github.com/Anorov/PySocks', '@Anorov', 'Custom DAN HAIM'), ('RapydScript-NG', 'https://github.com/kovidgoyal/rapydscript-ng', '@kovidgoyal', 'BSD 2-Clause "Simplified" License'), ('Requests', 'https://requests.kennethreitz.org', 'Kenneth Reitz', 'Apache License, Version 2.0'), ('scrollMonitor', 'https://github.com/stutrek/scrollmonitor', '@stutrek', 'MIT'), ('Smoothie Charts', 'https://github.com/joewalnes/smoothie', '@drewnoakes', 'MIT'), ('stem', 'https://stem.torproject.org', 'Damian Johnson and The Tor Project', 'GNU LESSER GENERAL PUBLIC LICENSE') ]
credits = [('Bootstrap', 'https://getbootstrap.com', 'The Bootstrap team', 'MIT'), ('Bottle', 'http://bottlepy.org', 'Marcel Hellkamp', 'MIT'), ('Cheroot', 'https://github.com/cherrypy/cheroot', 'CherryPy Team', 'BSD 3-Clause "New" or "Revised" License'), ('Click', 'https://github.com/pallets/click', 'Pallets', 'BSD 3-Clause "New" or "Revised" License'), ('ConfigUpdater', 'https://github.com/pyscaffold/configupdater', 'Florian Wilhelm', 'MIT'), ('Glide', 'https://github.com/glidejs/glide', '@jedrzejchalubek', 'MIT'), ('JQuery', 'https://jquery.com', 'The jQuery Foundation', 'MIT'), ('jquery.pep.js', 'http://pep.briangonzalez.org', '@briangonzalez', 'MIT'), ('js-md5', 'https://github.com/emn178/js-md5', '@emn178', 'MIT'), ('PySocks', 'https://github.com/Anorov/PySocks', '@Anorov', 'Custom DAN HAIM'), ('RapydScript-NG', 'https://github.com/kovidgoyal/rapydscript-ng', '@kovidgoyal', 'BSD 2-Clause "Simplified" License'), ('Requests', 'https://requests.kennethreitz.org', 'Kenneth Reitz', 'Apache License, Version 2.0'), ('scrollMonitor', 'https://github.com/stutrek/scrollmonitor', '@stutrek', 'MIT'), ('Smoothie Charts', 'https://github.com/joewalnes/smoothie', '@drewnoakes', 'MIT'), ('stem', 'https://stem.torproject.org', 'Damian Johnson and The Tor Project', 'GNU LESSER GENERAL PUBLIC LICENSE')]
def repleace_pattern(t,s,r): assert len(t) > 0 assert len(s) > 0 assert len(r) > 0 assert len(t) >= len(s) n = len(t) m = len(s) k = len(r) idx = -1 for i in range(0, n): if t[i] == s[0]: pattern = True for j in range(1,m): if t[i+j] != s[j]: pattern = False break if(pattern): idx=i break result = t print(idx) if(idx!=-1): result = [*t[0:idx],*r,*t[idx+m:n]] return result print (repleace_pattern([1,2,3,1,2,3,4],[1,2,3,4],[9,0]))
def repleace_pattern(t, s, r): assert len(t) > 0 assert len(s) > 0 assert len(r) > 0 assert len(t) >= len(s) n = len(t) m = len(s) k = len(r) idx = -1 for i in range(0, n): if t[i] == s[0]: pattern = True for j in range(1, m): if t[i + j] != s[j]: pattern = False break if pattern: idx = i break result = t print(idx) if idx != -1: result = [*t[0:idx], *r, *t[idx + m:n]] return result print(repleace_pattern([1, 2, 3, 1, 2, 3, 4], [1, 2, 3, 4], [9, 0]))
# Definition for a binary tree node. # class TreeNode: # def __init__(self, val=0, left=None, right=None): # self.val = val # self.left = left # self.right = right class Solution: def isCousins(self, root: TreeNode, x: int, y: int) -> bool: x_depth = None x_parent = None x_found = 0 y_depth = None y_parent = None y_found = 0 def dfs(node, parent, depth): nonlocal x_depth, x_parent, x_found, y_depth, y_found, y_parent if not node: return if node.val == x: x_depth = depth x_parent = parent x_found = 1 elif node.val == y: y_depth = depth y_parent = parent y_found = 1 if x_found and y_found: return dfs(node.left, node, depth+1) if x_found and y_found: return dfs(node.right, node, depth+1) dfs(root, None, 0) return x_depth == y_depth and x_parent != y_parent
class Solution: def is_cousins(self, root: TreeNode, x: int, y: int) -> bool: x_depth = None x_parent = None x_found = 0 y_depth = None y_parent = None y_found = 0 def dfs(node, parent, depth): nonlocal x_depth, x_parent, x_found, y_depth, y_found, y_parent if not node: return if node.val == x: x_depth = depth x_parent = parent x_found = 1 elif node.val == y: y_depth = depth y_parent = parent y_found = 1 if x_found and y_found: return dfs(node.left, node, depth + 1) if x_found and y_found: return dfs(node.right, node, depth + 1) dfs(root, None, 0) return x_depth == y_depth and x_parent != y_parent
# # Copyright (C) 2009 Mendix. All rights reserved. # SUCCESS = 0 # Starting the Mendix Runtime can fail in both a temporary or permanent way. # Some of the errors can be fixed with some help of the user. # # The default m2ee cli program will only handle a few of these cases, by # providing additional hints or interactive choices to fix the situation and # will default to echoing back the error message received from the runtime. # Database to be used does not exist start_NO_EXISTING_DB = 2 # Database structure is out of sync with the application domain model, DDL # commands need to be run to synchronize the database. start_INVALID_DB_STRUCTURE = 3 # Constant definitions used in the application model are missing from the # configuration. start_MISSING_MF_CONSTANT = 4 # In the application database, a user account was detected which has the # administrative role (as specified in the modeler) and has password '1'. start_ADMIN_1 = 5 # ... start_INVALID_STATE = 6 start_MISSING_DTAP = 7 start_MISSING_BASEPATH = 8 start_MISSING_RUNTIMEPATH = 9 start_INVALID_LICENSE = 10 start_SECURITY_DISABLED = 11 start_STARTUP_ACTION_FAILED = 12 start_NO_MOBILE_IN_LICENSE = 13 check_health_INVALID_STATE = 2
success = 0 start_no_existing_db = 2 start_invalid_db_structure = 3 start_missing_mf_constant = 4 start_admin_1 = 5 start_invalid_state = 6 start_missing_dtap = 7 start_missing_basepath = 8 start_missing_runtimepath = 9 start_invalid_license = 10 start_security_disabled = 11 start_startup_action_failed = 12 start_no_mobile_in_license = 13 check_health_invalid_state = 2
def count_words(sentence): sentence = sentence.lower() words = {} shit = ',\n:!&@$%^&._' for s in shit: sentence = sentence.replace(s, ' ') for w in sentence.split(): if w.endswith('\''): w = w[:-1] if w.startswith('\''): w = w[1:] words[w] = words.get(w, 0) + 1 return words
def count_words(sentence): sentence = sentence.lower() words = {} shit = ',\n:!&@$%^&._' for s in shit: sentence = sentence.replace(s, ' ') for w in sentence.split(): if w.endswith("'"): w = w[:-1] if w.startswith("'"): w = w[1:] words[w] = words.get(w, 0) + 1 return words
ID = {"Worldwide":0, "AF": 1, "AL": 2, "DZ": 3, "AD": 5, "AO": 6, "AI": 7, "AG": 9, "AR": 10, "AM": 11, "AW": 12, "AT": 14, "AZ": 15, "BS": 16, "BH": 17, "BD": 18, "BB": 19, "BY": 20, "BZ": 22, "BJ": 23, "BM": 24, "BO": 26, "BA": 27, "BW": 28, "BV": 29, "BR": 30, "BN": 31, "BG": 32, "BF": 33, "BI": 34, "KH": 35, "CM": 36, "CV": 38, "KY": 39, "TD": 41, "CL": 42, "CN": 43, "CC": 45, "CO": 46, "KM": 47, "CG": 48, "CK": 49, "CR": 50, "CI": 51, "HR": 52, "CU": 53, "CY": 54, "CZ": 55, "DK": 56, "DJ": 57, "DM": 58, "DO": 59, "TL": 60, "EC": 61, "EG": 62, "SV": 63, "EE": 66, "ET": 67, "FO": 69, "FJ": 70, "FI": 71, "FR": 72, "GF": 73, "PF": 74, "GA": 75, "GM": 76, "GE": 77, "DE": 78, "GH": 79, "GR": 81, "GD": 83, "GP": 84, "GT": 86, "GN": 87, "GY": 88, "HT": 89, "HN": 90, "HK": 91, "HU": 92, "IS": 93, "ID": 94, "IQ": 95, "IE": 96, "IT": 97, "JM": 98, "JO": 100, "KZ": 101, "KE": 102, "KI": 103, "KW": 104, "KG": 105, "LA": 106, "LV": 107, "LB": 108, "LS": 109, "LR": 110, "LY": 111, "LT": 113, "LU": 114, "MO": 115, "MK": 116, "MG": 117, "MW": 118, "MY": 119, "MV": 120, "ML": 121, "MT": 122, "MQ": 124, "MR": 125, "MU": 126, "MX": 128, "FM": 129, "MD": 130, "MC": 131, "MN": 132, "MA": 134, "MZ": 135, "MM": 136, "NA": 137, "NP": 139, "NL": 140, "AN": 141, "NC": 142, "NZ": 143, "NI": 144, "NE": 145, "NG": 146, "NO": 149, "OM": 150, "PK": 151, "PW": 152, "PA": 153, "PG": 154, "PY": 155, "PE": 156, "PH": 157, "PL": 159, "PT": 160, "QA": 162, "RE": 163, "RO": 164, "RW": 166, "KN": 167, "LC": 168, "SA": 171, "SN": 172, "SC": 173, "SG": 175, "SK": 176, "SI": 177, "SO": 179, "ZA": 180, "KR": 181, "ES": 182, "LK": 183, "SH": 184, "SR": 186, "SZ": 187, "SE": 188, "CH": 189, "TW": 191, "TJ": 192, "TZ": 193, "TH": 194, "TG": 195, "TT": 198, "TN": 199, "TR": 200, "TM": 201, "UG": 203, "UA": 204, "AE": 205, "GB": 206, "UY": 207, "UZ": 208, "VE": 211, "VN": 212, "VG": 213, "YE": 216, "ZM": 218, "ZW": 219, "RS": 220, "ME": 221, "IN": 225, "TC": 234, "CD": 235, "GG": 236, "IM": 237, "JE": 239, "CW": 246, }
id = {'Worldwide': 0, 'AF': 1, 'AL': 2, 'DZ': 3, 'AD': 5, 'AO': 6, 'AI': 7, 'AG': 9, 'AR': 10, 'AM': 11, 'AW': 12, 'AT': 14, 'AZ': 15, 'BS': 16, 'BH': 17, 'BD': 18, 'BB': 19, 'BY': 20, 'BZ': 22, 'BJ': 23, 'BM': 24, 'BO': 26, 'BA': 27, 'BW': 28, 'BV': 29, 'BR': 30, 'BN': 31, 'BG': 32, 'BF': 33, 'BI': 34, 'KH': 35, 'CM': 36, 'CV': 38, 'KY': 39, 'TD': 41, 'CL': 42, 'CN': 43, 'CC': 45, 'CO': 46, 'KM': 47, 'CG': 48, 'CK': 49, 'CR': 50, 'CI': 51, 'HR': 52, 'CU': 53, 'CY': 54, 'CZ': 55, 'DK': 56, 'DJ': 57, 'DM': 58, 'DO': 59, 'TL': 60, 'EC': 61, 'EG': 62, 'SV': 63, 'EE': 66, 'ET': 67, 'FO': 69, 'FJ': 70, 'FI': 71, 'FR': 72, 'GF': 73, 'PF': 74, 'GA': 75, 'GM': 76, 'GE': 77, 'DE': 78, 'GH': 79, 'GR': 81, 'GD': 83, 'GP': 84, 'GT': 86, 'GN': 87, 'GY': 88, 'HT': 89, 'HN': 90, 'HK': 91, 'HU': 92, 'IS': 93, 'ID': 94, 'IQ': 95, 'IE': 96, 'IT': 97, 'JM': 98, 'JO': 100, 'KZ': 101, 'KE': 102, 'KI': 103, 'KW': 104, 'KG': 105, 'LA': 106, 'LV': 107, 'LB': 108, 'LS': 109, 'LR': 110, 'LY': 111, 'LT': 113, 'LU': 114, 'MO': 115, 'MK': 116, 'MG': 117, 'MW': 118, 'MY': 119, 'MV': 120, 'ML': 121, 'MT': 122, 'MQ': 124, 'MR': 125, 'MU': 126, 'MX': 128, 'FM': 129, 'MD': 130, 'MC': 131, 'MN': 132, 'MA': 134, 'MZ': 135, 'MM': 136, 'NA': 137, 'NP': 139, 'NL': 140, 'AN': 141, 'NC': 142, 'NZ': 143, 'NI': 144, 'NE': 145, 'NG': 146, 'NO': 149, 'OM': 150, 'PK': 151, 'PW': 152, 'PA': 153, 'PG': 154, 'PY': 155, 'PE': 156, 'PH': 157, 'PL': 159, 'PT': 160, 'QA': 162, 'RE': 163, 'RO': 164, 'RW': 166, 'KN': 167, 'LC': 168, 'SA': 171, 'SN': 172, 'SC': 173, 'SG': 175, 'SK': 176, 'SI': 177, 'SO': 179, 'ZA': 180, 'KR': 181, 'ES': 182, 'LK': 183, 'SH': 184, 'SR': 186, 'SZ': 187, 'SE': 188, 'CH': 189, 'TW': 191, 'TJ': 192, 'TZ': 193, 'TH': 194, 'TG': 195, 'TT': 198, 'TN': 199, 'TR': 200, 'TM': 201, 'UG': 203, 'UA': 204, 'AE': 205, 'GB': 206, 'UY': 207, 'UZ': 208, 'VE': 211, 'VN': 212, 'VG': 213, 'YE': 216, 'ZM': 218, 'ZW': 219, 'RS': 220, 'ME': 221, 'IN': 225, 'TC': 234, 'CD': 235, 'GG': 236, 'IM': 237, 'JE': 239, 'CW': 246}
# In Search for the Lost Memory [Explorer Thief] (3526) # To be replaced with GMS's exact dialogue. # Following dialogue has been edited from DeepL on JMS's dialogue transcript (no KMS footage anywhere): # https://kaengouraiu2.blog.fc2.com/blog-entry-46.html recoveredMemory = 7081 darkLord = 1052001 sm.setSpeakerID(darkLord) sm.sendNext("The way you moved without a trace...you must have exceptional talent. " "Long time no see, #h #.") sm.sendSay("Since when did you grow up to this point? You're no less inferior to any Dark Lord. " "You were just a greenhorn that couldn't even hide their presence...Hmph, well, it's been a while since then. " "Still, it feels weird to see you become so strong. I guess this is how it feels to be proud.") sm.sendSay("But don't let your guard down. Know that there's still more progress to be made. " "As the one who has made you into a thief, I know you that you can be even stronger...!") sm.startQuest(parentID) sm.completeQuest(parentID) sm.startQuest(recoveredMemory) sm.setQRValue(recoveredMemory, "1", False)
recovered_memory = 7081 dark_lord = 1052001 sm.setSpeakerID(darkLord) sm.sendNext('The way you moved without a trace...you must have exceptional talent. Long time no see, #h #.') sm.sendSay("Since when did you grow up to this point? You're no less inferior to any Dark Lord. You were just a greenhorn that couldn't even hide their presence...Hmph, well, it's been a while since then. Still, it feels weird to see you become so strong. I guess this is how it feels to be proud.") sm.sendSay("But don't let your guard down. Know that there's still more progress to be made. As the one who has made you into a thief, I know you that you can be even stronger...!") sm.startQuest(parentID) sm.completeQuest(parentID) sm.startQuest(recoveredMemory) sm.setQRValue(recoveredMemory, '1', False)
def f(): print('f from module 2') if __name__ == '__main__': print('Module 2')
def f(): print('f from module 2') if __name__ == '__main__': print('Module 2')
def contains_word(first_word, second_word, bibliographic_entry): contains_first_word = first_word in bibliographic_entry contains_second_word = second_word in bibliographic_entry if contains_first_word and contains_second_word: return 2 elif contains_first_word or contains_second_word: return 1 else: return 0 if __name__ == "__main__": bibliographic_entry = "Peroni, S., Osborne, F., Di Iorio, A., Nuzzolese, A. G., Poggi, F., Vitali, F., " \ "Motta, E. (2017). Research Articles in Simplified HTML: a Web-first format for " \ "HTML-based scholarly articles. PeerJ Computer Science 3: e132. e2513. " \ "DOI: https://doi.org/10.7717/peerj-cs.132" print(contains_word("Peroni", "Osborne", bibliographic_entry)) print(contains_word("Peroni", "Asprino", bibliographic_entry)) print(contains_word("Reforgiato", "Osborne", bibliographic_entry)) print(contains_word("Reforgiato", "Asprino", bibliographic_entry))
def contains_word(first_word, second_word, bibliographic_entry): contains_first_word = first_word in bibliographic_entry contains_second_word = second_word in bibliographic_entry if contains_first_word and contains_second_word: return 2 elif contains_first_word or contains_second_word: return 1 else: return 0 if __name__ == '__main__': bibliographic_entry = 'Peroni, S., Osborne, F., Di Iorio, A., Nuzzolese, A. G., Poggi, F., Vitali, F., Motta, E. (2017). Research Articles in Simplified HTML: a Web-first format for HTML-based scholarly articles. PeerJ Computer Science 3: e132. e2513. DOI: https://doi.org/10.7717/peerj-cs.132' print(contains_word('Peroni', 'Osborne', bibliographic_entry)) print(contains_word('Peroni', 'Asprino', bibliographic_entry)) print(contains_word('Reforgiato', 'Osborne', bibliographic_entry)) print(contains_word('Reforgiato', 'Asprino', bibliographic_entry))
#!/usr/bin/env python # -*- coding: utf-8 -*- VALID_HISTORY_FIELDS = [ 'datetime', 'open', 'close', 'high', 'low', 'total_turnover', 'volume', 'acc_net_value', 'discount_rate', 'unit_net_value', 'limit_up', 'limit_down', 'open_interest', 'basis_spread', 'settlement', 'prev_settlement' ] VALID_GET_PRICE_FIELDS = [ 'OpeningPx', 'ClosingPx', 'HighPx', 'LowPx', 'TotalTurnover', 'TotalVolumeTraded', 'AccNetValue', 'UnitNetValue', 'DiscountRate', 'SettlPx', 'PrevSettlPx', 'OpenInterest', 'BasisSpread', 'HighLimitPx', 'LowLimitPx' ] VALID_TENORS = [ '0S', '1M', '2M', '3M', '6M', '9M', '1Y', '2Y', '3Y', '4Y', '5Y', '6Y', '7Y', '8Y', '9Y', '10Y', '15Y', '20Y', '30Y', '40Y', '50Y' ] VALID_INSTRUMENT_TYPES = [ 'CS', 'Future', 'INDX', 'ETF', 'LOF', 'SF', 'FenjiA', 'FenjiB', 'FenjiMu', 'Stock', 'Fund', 'Index' ] VALID_XUEQIU_FIELDS = [ 'new_comments', 'total_comments', 'new_followers', 'total_followers', 'sell_actions', 'buy_actions', ] VALID_MARGIN_FIELDS = [ 'margin_balance', 'buy_on_margin_value', 'short_sell_quantity', 'margin_repayment', 'short_balance_quantity', 'short_repayment_quantity', 'short_balance', 'total_balance' ] VALID_SHARE_FIELDS = [ 'total', 'circulation_a', 'management_circulation', 'non_circulation_a', 'total_a' ] VALID_TURNOVER_FIELDS = ( 'today', 'week', 'month', 'three_month', 'six_month', 'year', 'current_year', 'total', )
valid_history_fields = ['datetime', 'open', 'close', 'high', 'low', 'total_turnover', 'volume', 'acc_net_value', 'discount_rate', 'unit_net_value', 'limit_up', 'limit_down', 'open_interest', 'basis_spread', 'settlement', 'prev_settlement'] valid_get_price_fields = ['OpeningPx', 'ClosingPx', 'HighPx', 'LowPx', 'TotalTurnover', 'TotalVolumeTraded', 'AccNetValue', 'UnitNetValue', 'DiscountRate', 'SettlPx', 'PrevSettlPx', 'OpenInterest', 'BasisSpread', 'HighLimitPx', 'LowLimitPx'] valid_tenors = ['0S', '1M', '2M', '3M', '6M', '9M', '1Y', '2Y', '3Y', '4Y', '5Y', '6Y', '7Y', '8Y', '9Y', '10Y', '15Y', '20Y', '30Y', '40Y', '50Y'] valid_instrument_types = ['CS', 'Future', 'INDX', 'ETF', 'LOF', 'SF', 'FenjiA', 'FenjiB', 'FenjiMu', 'Stock', 'Fund', 'Index'] valid_xueqiu_fields = ['new_comments', 'total_comments', 'new_followers', 'total_followers', 'sell_actions', 'buy_actions'] valid_margin_fields = ['margin_balance', 'buy_on_margin_value', 'short_sell_quantity', 'margin_repayment', 'short_balance_quantity', 'short_repayment_quantity', 'short_balance', 'total_balance'] valid_share_fields = ['total', 'circulation_a', 'management_circulation', 'non_circulation_a', 'total_a'] valid_turnover_fields = ('today', 'week', 'month', 'three_month', 'six_month', 'year', 'current_year', 'total')
# unicode digit emojis # digits from '0' to '9' zero_digit_code = zd = 48 # excluded digits excl_digits = [2, 4, 5, 7] # unicode digit keycap udkc = '\U0000fe0f\U000020e3' hours_0_9 = [chr(i) + udkc for i in range(zd, zd + 10) if i - zd not in excl_digits] # number '10' emoji hours_0_9.append('\U0001f51f') # custom emojis from '11' to '23' hours_11_23 = [str(i) for i in range(11, 24)] vote = ('PLUS', 'MINUS') edit = '\U0001F4DD'
zero_digit_code = zd = 48 excl_digits = [2, 4, 5, 7] udkc = '️⃣' hours_0_9 = [chr(i) + udkc for i in range(zd, zd + 10) if i - zd not in excl_digits] hours_0_9.append('🔟') hours_11_23 = [str(i) for i in range(11, 24)] vote = ('PLUS', 'MINUS') edit = '📝'
class Solution: def maximalSquare(self, matrix: List[List[str]]) -> int: if not matrix: return 0 m, n = len(matrix), len(matrix[0]) dp = [[0]*n for _ in range(m)] res = 0 for i in range(m): dp[i][0] = int(matrix[i][0]) for j in range(n): dp[0][j] = int(matrix[0][j]) for i in range(1, m): for j in range(1, n): if matrix[i][j] == '1': dp[i][j] = min(dp[i-1][j],dp[i-1][j-1],dp[i][j-1])+1 res = max(res, dp[i][j]) return res**2
class Solution: def maximal_square(self, matrix: List[List[str]]) -> int: if not matrix: return 0 (m, n) = (len(matrix), len(matrix[0])) dp = [[0] * n for _ in range(m)] res = 0 for i in range(m): dp[i][0] = int(matrix[i][0]) for j in range(n): dp[0][j] = int(matrix[0][j]) for i in range(1, m): for j in range(1, n): if matrix[i][j] == '1': dp[i][j] = min(dp[i - 1][j], dp[i - 1][j - 1], dp[i][j - 1]) + 1 res = max(res, dp[i][j]) return res ** 2
class term(object): # Dados de cadastro das usinas termeletrica (presentes no TERM.DAT) Codigo = None Nome = None Potencia = None FCMax = None TEIF = None IP = None GTMin = None # Dados Adicionais Especificados no arquivo de configuracao termica (CONFT) Sist = None Status = None Classe = None # Dados Adicionais Especificados no arquivo de classe termica (CLAST) Custo = None NomeClasse = None TipoComb = None def insere(self, custo, gmax): self.custo = custo self.gmax = gmax
class Term(object): codigo = None nome = None potencia = None fc_max = None teif = None ip = None gt_min = None sist = None status = None classe = None custo = None nome_classe = None tipo_comb = None def insere(self, custo, gmax): self.custo = custo self.gmax = gmax
# This is a simple program to find the last three digits of 11 raised to any given number. # The main algorithm that does the work is on line 10 def trim_num(num): if len(str(num)) > 3: # no need to trim if the number is 3 or less digits long return str(num)[(len(str(num)) - 3):] # trims the number return num def main(exp): init_val = str((((exp-1) * (exp))/2) % 10 + (exp % 100) / 10) + str(exp % 10) + "1" # The main algorithm which needs to be cleaned (only the last three digits should be shown) return "{}".format(trim_num(init_val)) # To use it, simply copy the code and run the function
def trim_num(num): if len(str(num)) > 3: return str(num)[len(str(num)) - 3:] return num def main(exp): init_val = str((exp - 1) * exp / 2 % 10 + exp % 100 / 10) + str(exp % 10) + '1' return '{}'.format(trim_num(init_val))
# Copyright (c) Microsoft Corporation. # Licensed under the MIT license. ### CONTROLS (non-tunable) ### # general TYPE_OF_RUN = test_episodes # train, test, test_episodes, render NUM_EPISODES_TO_TEST = 1000 MIN_FINAL_REWARD_FOR_SUCCESS = 1.0 LOAD_MODEL_FROM = models/gru_flat_babyai.pth SAVE_MODELS_TO = None # worker.py ENV = BabyAI_Env ENV_RANDOM_SEED = 1 AGENT_RANDOM_SEED = 1 REPORTING_INTERVAL = 1 TOTAL_STEPS = 1 ANNEAL_LR = False # A3cAgent AGENT_NET = GRU_Network # BabyAI_Env BABYAI_ENV_LEVEL = BabyAI-GoToLocal-v0 USE_SUCCESS_RATE = True SUCCESS_RATE_THRESHOLD = 0.99 HELDOUT_TESTING = False NUM_TEST_EPISODES = 10000 OBS_ENCODER = Flat BINARY_REWARD = True ### HYPERPARAMETERS (tunable) ### # A3cAgent A3C_T_MAX = 4 LEARNING_RATE = 4e-05 DISCOUNT_FACTOR = 0.9 GRADIENT_CLIP = 512.0 ENTROPY_TERM_STRENGTH = 0.02 ADAM_EPS = 1e-12 REWARD_SCALE = 2.0 WEIGHT_DECAY = 0. # RNNs NUM_RNN_UNITS = 96 OBS_EMBED_SIZE = 512 AC_HIDDEN_LAYER_SIZE = 4096
type_of_run = test_episodes num_episodes_to_test = 1000 min_final_reward_for_success = 1.0 load_model_from = models / gru_flat_babyai.pth save_models_to = None env = BabyAI_Env env_random_seed = 1 agent_random_seed = 1 reporting_interval = 1 total_steps = 1 anneal_lr = False agent_net = GRU_Network babyai_env_level = BabyAI - GoToLocal - v0 use_success_rate = True success_rate_threshold = 0.99 heldout_testing = False num_test_episodes = 10000 obs_encoder = Flat binary_reward = True a3_c_t_max = 4 learning_rate = 4e-05 discount_factor = 0.9 gradient_clip = 512.0 entropy_term_strength = 0.02 adam_eps = 1e-12 reward_scale = 2.0 weight_decay = 0.0 num_rnn_units = 96 obs_embed_size = 512 ac_hidden_layer_size = 4096
ezan = { 'name': 'ezan', 'age': 18, 'hair': 'brown', 'cool': True , } print(ezan) class Person(object): #use class to make object def __init__( self, name, age ,hair, color, hungry) : #initialize #first object inside of a class is self self.name = 'ezan' self.age = 18 self.hair = 'brown' self.cool = True def eat(self,food): print("EAT {f}".format(f = food)) self.hungry = food def play(self, game): print("Play {p}".format(p = game)) self.play = game def birth(self,person): kids = Person(name = " lail", age = 18, hair = 'black', color = 'blue', hungry = True) ezan = Person( name = "ezan", age = 18, hair = "black", cool = True, hungry = False) print(ezan.name) print('I am hungry') Austin = Person(name = 'austin', age = 18, hair = "Shrek", cool = False, hungry = True)
ezan = {'name': 'ezan', 'age': 18, 'hair': 'brown', 'cool': True} print(ezan) class Person(object): def __init__(self, name, age, hair, color, hungry): self.name = 'ezan' self.age = 18 self.hair = 'brown' self.cool = True def eat(self, food): print('EAT {f}'.format(f=food)) self.hungry = food def play(self, game): print('Play {p}'.format(p=game)) self.play = game def birth(self, person): kids = person(name=' lail', age=18, hair='black', color='blue', hungry=True) ezan = person(name='ezan', age=18, hair='black', cool=True, hungry=False) print(ezan.name) print('I am hungry') austin = person(name='austin', age=18, hair='Shrek', cool=False, hungry=True)
# # Simple Tuple # fruits = ('Apple', 'Orange', 'Mango') # # Using Constructor # fruits = tuple(('Apple', 'Orange', 'Mango')) # # Getting a Single Value # print(fruits[1]) # Trying to change based on position # fruits[1] = 'Grape' # Tuples with one value should have trailing comma # fruits = ('Apple') # fruits = ('Apple',) # # Getting length of a tupel # print(len(fruits)) # ## Set fruits = {'Apple', 'Orange', 'Mango', 'Apple'} # Checking if in Set print('Apple' in fruits) # Add to Set fruits.add('Grape') # Removing from Set fruits.remove('Grape') # Clearing Set fruits.clear() # Delete set del fruits print(fruits)
fruits = {'Apple', 'Orange', 'Mango', 'Apple'} print('Apple' in fruits) fruits.add('Grape') fruits.remove('Grape') fruits.clear() del fruits print(fruits)
description = 'Mezei spin flipper using TTI power supply' group = 'optional' tango_base = 'tango://miractrl.mira.frm2:10000/mira/' devices = dict( dct1 = device('nicos.devices.entangle.PowerSupply', description = 'current in first channel of supply (flipper current)', tangodevice = tango_base + 'tti1/out1', timeout = 1, precision = 0.01, ), dct2 = device('nicos.devices.entangle.PowerSupply', description = 'current in second channel of supply (compensation current)', tangodevice = tango_base + 'tti1/out2', timeout = 1, precision = 0.01, ), flip = device('nicos.devices.polarized.MezeiFlipper', description = 'Mezei flipper before sample (in shielding table)', flip = 'dct1', corr = 'dct2', ), )
description = 'Mezei spin flipper using TTI power supply' group = 'optional' tango_base = 'tango://miractrl.mira.frm2:10000/mira/' devices = dict(dct1=device('nicos.devices.entangle.PowerSupply', description='current in first channel of supply (flipper current)', tangodevice=tango_base + 'tti1/out1', timeout=1, precision=0.01), dct2=device('nicos.devices.entangle.PowerSupply', description='current in second channel of supply (compensation current)', tangodevice=tango_base + 'tti1/out2', timeout=1, precision=0.01), flip=device('nicos.devices.polarized.MezeiFlipper', description='Mezei flipper before sample (in shielding table)', flip='dct1', corr='dct2'))
class Stack: def __init__(self): self.stack = [] self.minMaxStack = [] # O(1) time | O(1) space def peek(self): if (len(self.stack)): return self.stack[-1] return None # O(1) time | O(1) space def pop(self): if (len(self.stack)): self.minMaxStack.pop() return self.stack.pop() return None # Procedure # O(1) time | O(1) space def push(self, value): minNumber = value maxNumber = value if (len(self.minMaxStack)): lastMinMax = self.minMaxStack[-1] minNumber = min(lastMinMax[0], minNumber) maxNumber = max(lastMinMax[1], maxNumber) self.stack.append(value) self.minMaxStack.append((minNumber, maxNumber)) print(self.stack) print(self.minMaxStack) # O(1) time | O(1) space def getMin(self): if (len(self.minMaxStack)): return self.minMaxStack[-1][0] return None # O(1) time | O(1) space def getMax(self): if (len(self.minMaxStack)): return self.minMaxStack[-1][1] return None
class Stack: def __init__(self): self.stack = [] self.minMaxStack = [] def peek(self): if len(self.stack): return self.stack[-1] return None def pop(self): if len(self.stack): self.minMaxStack.pop() return self.stack.pop() return None def push(self, value): min_number = value max_number = value if len(self.minMaxStack): last_min_max = self.minMaxStack[-1] min_number = min(lastMinMax[0], minNumber) max_number = max(lastMinMax[1], maxNumber) self.stack.append(value) self.minMaxStack.append((minNumber, maxNumber)) print(self.stack) print(self.minMaxStack) def get_min(self): if len(self.minMaxStack): return self.minMaxStack[-1][0] return None def get_max(self): if len(self.minMaxStack): return self.minMaxStack[-1][1] return None
BIG_CONSTANT = "YES" def group_by(xs, grouper): groups = {} for x in xs: group = grouper(x) if group not in groups: groups[group] = [] groups[group].append(x) return groups print(group_by([1, 2, 3, 4, 5, 6], lambda x: "even" if x % 2 == 0 else "odd"))
big_constant = 'YES' def group_by(xs, grouper): groups = {} for x in xs: group = grouper(x) if group not in groups: groups[group] = [] groups[group].append(x) return groups print(group_by([1, 2, 3, 4, 5, 6], lambda x: 'even' if x % 2 == 0 else 'odd'))