content stringlengths 7 1.05M | fixed_cases stringlengths 1 1.28M |
|---|---|
def read_groups(full_text: str) -> []:
"Separate groups from newlines and join answers."
lines = full_text.splitlines()
groups = []
group = []
for line in lines:
line = line.strip()
if line != '':
group += [line]
else:
groups.append(group)
group = []
groups.append(group)
return groups
def union_answers(group: list) -> int:
answers = set()
for person in group:
person_answers = set(person)
answers.update(person_answers)
return len(answers)
def intersection_answers(group: list) -> int:
answers = set(group[0])
for person in group[1:]:
person_answers = set(person)
answers.intersection_update(person_answers)
return len(answers)
def main():
with open('answers.txt') as ifh:
full_text = ifh.read()
groups = read_groups(full_text)
total_answers = 0
for group in groups:
total_answers += union_answers(group)
total_answers2 = 0
for group in groups:
total_answers2 += intersection_answers(group)
print(total_answers)
print(f'answer 6b, {total_answers2}')
if __name__ == '__main__':
main()
| def read_groups(full_text: str) -> []:
"""Separate groups from newlines and join answers."""
lines = full_text.splitlines()
groups = []
group = []
for line in lines:
line = line.strip()
if line != '':
group += [line]
else:
groups.append(group)
group = []
groups.append(group)
return groups
def union_answers(group: list) -> int:
answers = set()
for person in group:
person_answers = set(person)
answers.update(person_answers)
return len(answers)
def intersection_answers(group: list) -> int:
answers = set(group[0])
for person in group[1:]:
person_answers = set(person)
answers.intersection_update(person_answers)
return len(answers)
def main():
with open('answers.txt') as ifh:
full_text = ifh.read()
groups = read_groups(full_text)
total_answers = 0
for group in groups:
total_answers += union_answers(group)
total_answers2 = 0
for group in groups:
total_answers2 += intersection_answers(group)
print(total_answers)
print(f'answer 6b, {total_answers2}')
if __name__ == '__main__':
main() |
X, N = [int(x) for x in input().split()]
PS = [int(x) for x in input().split()]
mindist = 1e+99
for p in PS:
dist = abs(X - p)
if dist < mindist:
mindist = dist
answer = p
elif dist == mindist:
if p < answer:
ansewr = p
print(answer)
| (x, n) = [int(x) for x in input().split()]
ps = [int(x) for x in input().split()]
mindist = 1e+99
for p in PS:
dist = abs(X - p)
if dist < mindist:
mindist = dist
answer = p
elif dist == mindist:
if p < answer:
ansewr = p
print(answer) |
N = int(input())
A = list(map(int, input().split()))
result = []
for i in range(N):
x = i
j = 1
x = A[x] - 1
while x != i:
x = A[x] - 1
j += 1
result.append(j)
print(*result)
| n = int(input())
a = list(map(int, input().split()))
result = []
for i in range(N):
x = i
j = 1
x = A[x] - 1
while x != i:
x = A[x] - 1
j += 1
result.append(j)
print(*result) |
def increasing_or_decreasing(seq):
is_up = False
is_down = False
length = len(seq)
if length == 1:
return False
if seq[0] > seq[1]:
is_down = True
elif seq[0] < seq[1]:
is_up = True
for i in range(1, length - 1):
if(seq[i] > seq[i + 1] and is_up) or \
(seq[i] < seq[i + 1] and is_down) or \
(seq[i] == seq[i + 1]):
return False
if is_up:
return 'Up!'
if is_down:
return 'Down!'
def main():
print(increasing_or_decreasing([1,2,3,4,5]))
# Expected output : Up!
print(increasing_or_decreasing([5,6,-10]))
# Expected output : False
print(increasing_or_decreasing([1,1,1,1]))
# Expected output : False
print(increasing_or_decreasing([9,8,7,6]))
# Expected output : Down!
if __name__ == '__main__':
main() | def increasing_or_decreasing(seq):
is_up = False
is_down = False
length = len(seq)
if length == 1:
return False
if seq[0] > seq[1]:
is_down = True
elif seq[0] < seq[1]:
is_up = True
for i in range(1, length - 1):
if seq[i] > seq[i + 1] and is_up or (seq[i] < seq[i + 1] and is_down) or seq[i] == seq[i + 1]:
return False
if is_up:
return 'Up!'
if is_down:
return 'Down!'
def main():
print(increasing_or_decreasing([1, 2, 3, 4, 5]))
print(increasing_or_decreasing([5, 6, -10]))
print(increasing_or_decreasing([1, 1, 1, 1]))
print(increasing_or_decreasing([9, 8, 7, 6]))
if __name__ == '__main__':
main() |
# errors from Transition function
TransitionComplete = 10
TransitionDbConnectionFailed = 11
TransitionDbRetrieveFailed = 12
TransitionFunctionException = 13
# errors from JobStatusReceiver
JobStatusReceiverRetrieveArgoSubJobFailed = 21
JobStatusReceiverRetrieveArgoJobFailed = 22
JobStatusReceiverBalsamStateMapFailure = 23
JobStatusReceiverCompleted = 24
JobStatusReceiverMessageNoBody = 25
JobStatusReceiverFailed = 26
msg_codes = {
0:'NoMessageCode',
TransitionComplete:'TransitionComplete',
TransitionDbConnectionFailed:'TransitionDbConnectionFailed',
TransitionDbRetrieveFailed:'TransitionDbRetrieveFailed',
TransitionFunctionException:'TransitionFunctionException',
JobStatusReceiverRetrieveArgoSubJobFailed:'JobStatusReceiverRetrieveArgoSubJobFailed',
JobStatusReceiverRetrieveArgoJobFailed:'JobStatusReceiverRetrieveArgoJobFailed',
JobStatusReceiverBalsamStateMapFailure:'JobStatusReceiverBalsamStateMapFailure',
JobStatusReceiverCompleted:'JobStatusReceiverCompleted',
JobStatusReceiverMessageNoBody:'JobStatusReceiverMessageNoBody',
JobStatusReceiverFailed:'JobStatusReceiverFailed',
}
class QueueMessage:
''' a message used to communicate with the balsam_service main loop '''
def __init__(self,pk=0,code=0,message=''):
self.pk = pk
self.code = code
self.message = message
def __str__(self):
s = ''
s = '%i:%s:%s' % (self.pk,self.msg_codes[self.msg_code],self.message)
return s | transition_complete = 10
transition_db_connection_failed = 11
transition_db_retrieve_failed = 12
transition_function_exception = 13
job_status_receiver_retrieve_argo_sub_job_failed = 21
job_status_receiver_retrieve_argo_job_failed = 22
job_status_receiver_balsam_state_map_failure = 23
job_status_receiver_completed = 24
job_status_receiver_message_no_body = 25
job_status_receiver_failed = 26
msg_codes = {0: 'NoMessageCode', TransitionComplete: 'TransitionComplete', TransitionDbConnectionFailed: 'TransitionDbConnectionFailed', TransitionDbRetrieveFailed: 'TransitionDbRetrieveFailed', TransitionFunctionException: 'TransitionFunctionException', JobStatusReceiverRetrieveArgoSubJobFailed: 'JobStatusReceiverRetrieveArgoSubJobFailed', JobStatusReceiverRetrieveArgoJobFailed: 'JobStatusReceiverRetrieveArgoJobFailed', JobStatusReceiverBalsamStateMapFailure: 'JobStatusReceiverBalsamStateMapFailure', JobStatusReceiverCompleted: 'JobStatusReceiverCompleted', JobStatusReceiverMessageNoBody: 'JobStatusReceiverMessageNoBody', JobStatusReceiverFailed: 'JobStatusReceiverFailed'}
class Queuemessage:
""" a message used to communicate with the balsam_service main loop """
def __init__(self, pk=0, code=0, message=''):
self.pk = pk
self.code = code
self.message = message
def __str__(self):
s = ''
s = '%i:%s:%s' % (self.pk, self.msg_codes[self.msg_code], self.message)
return s |
# -*- coding: utf-8 -*-
DATA_SET = [
(
[u"123", u"12345"],
[1, 3],
([3, 5], [3, 5])
),
(
[u"123", u"12345"],
[4, 3],
([3, 5], [4, 5])
),
(
[u"123", u"12345"],
[5, 8],
([3, 5], [5, 8])
),
(
[u"123", u"12345", u"lorem ipsum"],
[5, 3, 4],
([3, 5, 11], [5, 5, 11])
),
]
| data_set = [([u'123', u'12345'], [1, 3], ([3, 5], [3, 5])), ([u'123', u'12345'], [4, 3], ([3, 5], [4, 5])), ([u'123', u'12345'], [5, 8], ([3, 5], [5, 8])), ([u'123', u'12345', u'lorem ipsum'], [5, 3, 4], ([3, 5, 11], [5, 5, 11]))] |
def cep(*args):
try:
telaPrincipal = args[0]
telaErro = args[1]
pycep_correios = args[2]
cep = telaPrincipal.cep.text()
end = pycep_correios.get_address_from_cep(cep)
telaPrincipal.end.setText(end['logradouro'])
telaPrincipal.bairro.setText(end['bairro'])
except:
telaErro.show()
telaErro.label.setText(" CEP invalido, verifique por favor") | def cep(*args):
try:
tela_principal = args[0]
tela_erro = args[1]
pycep_correios = args[2]
cep = telaPrincipal.cep.text()
end = pycep_correios.get_address_from_cep(cep)
telaPrincipal.end.setText(end['logradouro'])
telaPrincipal.bairro.setText(end['bairro'])
except:
telaErro.show()
telaErro.label.setText(' CEP invalido, verifique por favor') |
class Solution:
def maximumProduct(self, nums: List[int]) -> int:
min1 = min2 = inf
max1 = max2 = max3 = -inf
for n in nums:
if n < min1:
min2, min1 = min1, n
elif n < min2:
min2 = n
if n > max1:
max3, max2, max1 = max2, max1, n
elif n > max2:
max3, max2 = max2, n
elif n > max3:
max3 = n
return max(min1 * min2 * max1, max1 * max2 * max3)
| class Solution:
def maximum_product(self, nums: List[int]) -> int:
min1 = min2 = inf
max1 = max2 = max3 = -inf
for n in nums:
if n < min1:
(min2, min1) = (min1, n)
elif n < min2:
min2 = n
if n > max1:
(max3, max2, max1) = (max2, max1, n)
elif n > max2:
(max3, max2) = (max2, n)
elif n > max3:
max3 = n
return max(min1 * min2 * max1, max1 * max2 * max3) |
OUTCOMES = [
[None, "Buzz"],
["Fizz", "FizzBuzz"],
]
def fizzbuzz(number: int) -> str:
mod3 = number % 3 == 0
mod5 = number % 5 == 0
outcome = OUTCOMES[mod3][mod5]
return outcome or str(number)
def main():
for i in range(101):
fbi = fizzbuzz(i)
print(fbi)
if __name__ == "__main__":
main()
| outcomes = [[None, 'Buzz'], ['Fizz', 'FizzBuzz']]
def fizzbuzz(number: int) -> str:
mod3 = number % 3 == 0
mod5 = number % 5 == 0
outcome = OUTCOMES[mod3][mod5]
return outcome or str(number)
def main():
for i in range(101):
fbi = fizzbuzz(i)
print(fbi)
if __name__ == '__main__':
main() |
_.targets # unused attribute (packages/cli/odahuflow/cli/parsers/local/packaging.py:118)
build_client # unused function (packages/sdk/odahuflow/sdk/clients/api_aggregated.py:88)
ConfigurationClient # unused class (packages/sdk/odahuflow/sdk/clients/configuration.py:28)
AsyncConfigurationClient # unused class (packages/sdk/odahuflow/sdk/clients/configuration.py:51)
PROCESSING_STATE # unused variable (packages/sdk/odahuflow/sdk/clients/deployment.py:30)
log_message # unused function (packages/sdk/odahuflow/sdk/clients/oauth_handler.py:251)
do_GET # unused function (packages/sdk/odahuflow/sdk/clients/oauth_handler.py:280)
SCHEDULING_STATE # unused variable (packages/sdk/odahuflow/sdk/clients/packaging.py:26)
RUNNING_STATE # unused variable (packages/sdk/odahuflow/sdk/clients/packaging.py:27)
UNKNOWN_STATE # unused variable (packages/sdk/odahuflow/sdk/clients/packaging.py:30)
PROCESSING_STATE # unused variable (packages/sdk/odahuflow/sdk/clients/route.py:29)
reset_context # unused function (packages/sdk/odahuflow/sdk/config.py:35)
get_config_file_section # unused function (packages/sdk/odahuflow/sdk/config.py:91)
ODAHUFLOWCTL_OAUTH_AUTH_URL # unused variable (packages/sdk/odahuflow/sdk/config.py:398)
JUPYTER_REDIRECT_URL # unused variable (packages/sdk/odahuflow/sdk/config.py:404)
REQUEST_ID # unused variable (packages/sdk/odahuflow/sdk/containers/headers.py:20)
MODEL_REQUEST_ID # unused variable (packages/sdk/odahuflow/sdk/containers/headers.py:21)
MODEL_NAME # unused variable (packages/sdk/odahuflow/sdk/containers/headers.py:22)
MODEL_VERSION # unused variable (packages/sdk/odahuflow/sdk/containers/headers.py:23)
get_model_output_sample # unused function (packages/sdk/odahuflow/sdk/gppi/entrypoint_invoke.py:176)
args_ # unused variable (packages/sdk/odahuflow/sdk/gppi/entrypoint_invoke.py:273)
| _.targets
build_client
ConfigurationClient
AsyncConfigurationClient
PROCESSING_STATE
log_message
do_GET
SCHEDULING_STATE
RUNNING_STATE
UNKNOWN_STATE
PROCESSING_STATE
reset_context
get_config_file_section
ODAHUFLOWCTL_OAUTH_AUTH_URL
JUPYTER_REDIRECT_URL
REQUEST_ID
MODEL_REQUEST_ID
MODEL_NAME
MODEL_VERSION
get_model_output_sample
args_ |
class Schema(object):
def __init__(self, name, tag_name, tag_case_sensitive, model, validators, attributes, children, content):
self.name = name
self.tag_name = tag_name
self.tag_case_sensitive = tag_case_sensitive
self.model = model
self.validators = validators
self.attributes = attributes
self.children = children
self.content = content
def compare_tag_name(self, other_name):
tag_name = self.tag_name
if not self.tag_case_sensitive:
tag_name = tag_name.lower()
other_name = other_name.lower()
return tag_name == other_name
| class Schema(object):
def __init__(self, name, tag_name, tag_case_sensitive, model, validators, attributes, children, content):
self.name = name
self.tag_name = tag_name
self.tag_case_sensitive = tag_case_sensitive
self.model = model
self.validators = validators
self.attributes = attributes
self.children = children
self.content = content
def compare_tag_name(self, other_name):
tag_name = self.tag_name
if not self.tag_case_sensitive:
tag_name = tag_name.lower()
other_name = other_name.lower()
return tag_name == other_name |
{
'variables': {
'linear_sample_parent_path': '/',
},
'targets': [
{
'target_name': 'tcp_client_sample',
'type': 'executable',
'sources': [
'tcp_client_sample.cpp',
],
},
{
'target_name': 'tcp_server_sample',
'type': 'executable',
'sources': [
'tcp_server_sample.cpp',
],
},
{
'target_name': 'ws_client_sample',
'type': 'executable',
'sources': [
'ws_client_sample.cpp',
],
},
{
'target_name': 'ws_server_sample',
'type': 'executable',
'sources': [
'ws_server_sample.cpp',
],
},
],
'conditions': [
[ 'with_ssl != "false"', {
'targets': [
{
'target_name': 'ssl_client_sample',
'type': 'executable',
'sources': [
'ssl_client_sample.cpp',
],
},
{
'target_name': 'ssl_server_sample',
'type': 'executable',
'sources': [
'ssl_server_sample.cpp',
],
},
{
'target_name': 'wss_client_sample',
'type': 'executable',
'sources': [
'wss_client_sample.cpp',
],
},
{
'target_name': 'wss_server_sample',
'type': 'executable',
'sources': [
'wss_server_sample.cpp',
],
},
],
}],
],
}
| {'variables': {'linear_sample_parent_path': '/'}, 'targets': [{'target_name': 'tcp_client_sample', 'type': 'executable', 'sources': ['tcp_client_sample.cpp']}, {'target_name': 'tcp_server_sample', 'type': 'executable', 'sources': ['tcp_server_sample.cpp']}, {'target_name': 'ws_client_sample', 'type': 'executable', 'sources': ['ws_client_sample.cpp']}, {'target_name': 'ws_server_sample', 'type': 'executable', 'sources': ['ws_server_sample.cpp']}], 'conditions': [['with_ssl != "false"', {'targets': [{'target_name': 'ssl_client_sample', 'type': 'executable', 'sources': ['ssl_client_sample.cpp']}, {'target_name': 'ssl_server_sample', 'type': 'executable', 'sources': ['ssl_server_sample.cpp']}, {'target_name': 'wss_client_sample', 'type': 'executable', 'sources': ['wss_client_sample.cpp']}, {'target_name': 'wss_server_sample', 'type': 'executable', 'sources': ['wss_server_sample.cpp']}]}]]} |
def rna_to_protein(rna):
'''
Takes a string and returns a protein sequence WIHOUT
using biopython
Input params:
rna = rna string
Output params:
protein = protein sequence
'''
codon = []
protein = []
while rna:
codon.append(rna[:3])
rna = rna[3:]
for triplet in codon:
if triplet == 'AUG':
protein.append('M')
elif triplet == 'GCC' or triplet == 'GCG' or triplet == 'GCU' or triplet == 'GCA':
protein.append('A')
elif triplet == 'UUU' or triplet == 'UUC':
protein.append('F')
elif triplet == 'UUA' or triplet == 'UUG':
protein.append('L')
elif triplet == 'UCU' or triplet == 'UCC' or triplet == 'UCA' or triplet == 'UCG':
protein.append('S')
elif triplet == 'UAU' or triplet == 'UAC':
protein.append('Y')
elif triplet == 'UAA' or triplet == 'UGA':
break #stop codon
elif triplet == 'UGU' or triplet == 'UGC':
protein.append('C')
elif triplet == 'UGG':
protein.append('W')
elif triplet == 'CUU' or triplet == 'CUC' or triplet == 'CUA' or triplet == 'CUG':
protein.append('L')
elif triplet == 'CCU' or triplet == 'CCC' or triplet == 'CCA' or triplet == 'CCG':
protein.append('P')
elif triplet == 'CAU' or triplet == 'CAC':
protein.append('H')
elif triplet == 'CAA' or triplet == 'CAG':
protein.append('Q')
elif triplet == 'CGU' or triplet == 'CGC' or triplet == 'CGA' or triplet == 'CGG':
protein.append('R')
elif triplet == 'AUU' or triplet == 'AUC' or triplet == 'AUA':
protein.append('I')
elif triplet == 'ACU' or triplet == 'ACC' or triplet == 'ACA' or triplet == 'ACG':
protein.append('T')
elif triplet == 'AAU' or triplet == 'AAC':
protein.append('N')
elif triplet == 'AAA' or triplet == 'AAG':
protein.append('K')
elif triplet == 'AGU' or triplet == 'AGC':
protein.append('S')
elif triplet == 'AGA' or triplet == 'AGG':
protein.append('R')
elif triplet == 'GUU' or triplet == 'GUC' or triplet == 'GUA' or triplet == 'GUG':
protein.append('V')
elif triplet == 'GAU' or triplet == 'GAC':
protein.append('D')
elif triplet == 'GAA' or triplet == 'GAG':
protein.append('E')
elif triplet == 'GGU' or triplet == 'GGC' or triplet == 'GGA' or triplet == 'GGG':
protein.append('G')
protein = ''.join(protein)
return protein
rna = 'AUGAGUUGCCCGACCCUCCGUAUCUCAAAAAUUUUUGUACGAUCAACAUACAAAAAUCCUGCCAUUAACAUCUGGAUGCGCAGCUUUGCCUUAUGUGGAAGGUAUCGGGAGGCACAGGAUCUGUCUGAGGGAAGAAGGGAUUUAAACCUAUGUGCCAUUUCGUUUGGUAACAUUCCGUUCGGACCGUUGCGCUUAUCAACGUGCGUACUCACACCAAACAAAUCCAUACCUCUGAUAGUAAGCCUCAAUUAUCGCCAUCUCGUAUGUUCAGGCUUCGUGUCAGUCUGUUGGAUUUGCGUGAUUGUACUAUCUCCACCCCGCCGGAAUGUUCAAAGCCUCCAAUACGAACAUAAACUCCGAUGCGUUACAAACUACCGACAAGGCCCAUCCGAGUCAUGGAUCCUAAUACACGUAAUUAGUGGUAACGCCGGAAAGCUUCGUAGGGAGUACUUCAACACUCGAGAAGCGCUCUUUCCUAUAUCCUGUCAGUCAGAUGGCGGCCGGCGAACUAGUCUAAUGGUGGACGUUUGUGUAAUAUCCUAUACUUGGAACUUCUUCACUAUUCAUGGGCCCCUUCUAUUAGGCGGUAGCGUUUACAAGUUAUGGCCUGUCGUCGAGUCCUUGCCGUCCAGUUUAUCUGAUAACCUUCGGCCGUACCAGGUGAAGGGGGUCCUUCUCUCCUUUUGUAGGAUUUCCCCUUCAUUGUGCGCGGGACUAUUUAGCCCACGCAAGGGAUUGCAUUAUUCUGAGGCGUCUAGUGCUAGACAAUCGUCUGUCGCACCGUACGCUGGGGGUUUAACUACUCGAACCCGAGCCUUAACUGGGUGCCAGAGCAUACUCCAACGCGAAGAGGGUAGCGUGCGAAUAAAAAUCCUUCCUACUAGCGACACGCUUAUCCAUGAUGGGAAGAGCCGAACGCCCCAGCACGGAGAUCCCUCACCGACAGUGACAUGGCUUGAUCUGUUACGUAUUACUUUCAUCCUACCCAUGCGCGGACAUGUCGAGGGCCGACAGAAUAACUUGUCCAUGAUGUCGCUUUCGUGCGGGGUGUGGCUCGGGGCAGAAGCGUCCUUACCGGGACAGGUACUAUUUAUAUAUGGAUCAUCGUCUAAGAUUUCACCCUCGUACAAAGCGGAGGCCAGACCGCAUAGUCGACGUUGCGGAAUGCCUCCUGACGACGUCUAUCACGGUACUGCUUCGUUGGAUGGUGAGGGCCUCGCAUUUGCGUGCUUACCAGGGCUGAUUUCAUUCAGGCCUGGUACCGACGAAAGAUAUCAUCGUGAGUCUAUGACCCGCGCCUUCGAGGAAUGCUGUGCUUAUGACCCACGACUAGUUGUCACGCUACAGCAAGGGCCGCAGCGCUGUAGGUACGCAUAUAUUCUCCGGAAACCAUCACAAAGUCUCCGCCCCGCUGCCGAUGUGAACGACACUAACAAAGAACUUUCAGAUCCGUGCGUUCCGCUACUAACAUUCCGAUCCUGUAUGGGUUUCUGCUUGCGUCGAAUCACAACGACGAUAAGGGCCAAUCCUUCUAAAGUGACCGGGCACGUGAUAUUACAUCUGGGUGUUCUGGCGGCUAAGGACAAUGCCGGCGCAUUGGAAUACCGUACCGGGUCUCUUGGAGUCCAAUACGCCUGGGCUCAUUACCAUCAUCGAACUUACGUCUACUCCCAUGCAACCACGGGAUUAGAUACAAAGGGGUCCUACUCCCGCCGUUCCGAGAUCUGUCAAAUAAAGCAGUUUCGCGACACGUCGCAUGAUGGCGUAUGCGAUUACUUGUAUUUUGAAAAUACGCUUGCUCGAACGAGUGUGCCCCAAAUAAUACAUAUCGCUUUAUCAAACUUCACCGAGUACGGAUGCGUAGGACGAUCGCUUCGUGCCCAGUCAAGGUACAUCUACCCGGAUGGCGUACUAUACCGCGAAGGUAGAGGUAGGAGUUUAGCCAUUUUGGCUCGGGGGUGUGCGCUUGAAUUACACCGUGGGUCUCUGCGUGGGAACUCUGGCGCUAACACUAGGCUCGCUGGGCUUGGCAUAGCCGACCAUAGGUCUCAACGACGAUGCCUUUACGGCAUUGAAAGUCUGGUGGUGGUAGUGUCUAAAGGUCGAUUGGUAUGUCACUGGAUGAACGUUCCACAUCUCACUCCCCUAUACGCAUAUGCUACAAUAGAGCAUAACUCUUUCGGCCAAGUCUGUGGCGAAUUCCGAGGCAUGACCCCACUGCAGUCGGCAAUACAAGCCGAGCAAGAUUGGGUUUUUGCAUCUGAAGUCUUCGUUGGCACGACCGGCAUACAUCAGCAUCAGGCACAGGACUCGCAAUUUUUGCGGGCAGUUAUGUGUACACCAGUUCUAUCUGGCGCCGGUAGUCUUCAAAAUCUUGGCCUGCUUCGAAUUGCAAAGCUAUGGGGCUUUUCGUAUACAGCCCUUAAAGCCUGGUACCUCGUACGAUGGCGCAGGUUACUCCGAUUUCCAUCAAAAAAUAGGACCGCGGCACACCAUGUAGCAGGUCGGAAUGCCUUGGUCUGUAGAUCCGGAAUUGCUACCCCUUACGCGCGGUUUAGCGGCGCCCCAAACGGGGGCAGCAUUUCAGUCUCAUCUUCCGUUAGUGUUUUCCACACGCCCGGCAAGCUAAGGCCCGAACUGCACGCUCGCCCGACCCUUGCGCCCAAAGCGACGAGACAAGACAAACUCAACAGGACGAGCUGCAUUGUCGGGCGCAUCUACGCCUGCAGCAUGAUUAAUCGCCAUAAGCCCAUGAAGCAACCUUUGGGCACAUCUGCCGCCUGGGUUCUGCGUCAAACGCCGUUGACAUGUUGUUCUGGAGAAUCUAACGAGCCUAUCGUAAACGUACGCAUAGGUCAGGAUGAUGCGGUGGAAUCCCUCAAAUCCAAGGAGUGCCCUCCAUAUCUAACCUAUAAAGUCCAUGCCAGGCUGAGCGCAUACGUCAAGCGAUUCUGCCAUCGGCACACAGGCCCAUAUGCCUCAGCUGAUAGUGAACCUGAUGCGGACGCCGAUUUAGGUUUACGUUCACUUGUCCCUCAGCAAGAGACGAGUGAUGCUUCGCUAAAAGGGCGGCACCAGGGCUACAUCUUUCAUAUCAGAGAAGUAACGUUUUGUGCGAUUCGUGUCGAGUUUCCAUUUGGUGGUGACUGUCGAGUCUGUCCCUGUGGUUCACCUGGACCCUUAGCAACGGAGAUUGUAUUCCUAGCCUGGACCGGCCCCCAGCUACAUCUUGAUCGCAUAUCAACCCCCUAUAUAGUCGGGGGUUUCUUUAAACGGGGACCGCUUCCUACAGCCACUUCUUUUAAACGUCACACGCAGGAAGAGGCAGCCUUUUCGUCCCUGUCCGAACGCCAAGUGCAAGGUCUUGCACAUCCACGAGGAGGCUAUAGUUGCUCGAUACUUGAAAAAUAUGCAACGCAACAUUCGUCCGAAGUACACCAAGGUAGUCGAGUCAACGCCCGACGAGUUCUUUGGACUUCCAUUACAUUUACGGAGCAGGUGCAAGCGACUACGGUUUUGGGCCGAUUUCAUUCUAGUCGCCUUCGGUCCGUCCCUUGUACGGUCGGGGCUCAGAUCAGCCUGUAUUGUUCUAAAAGUACUAGUAUAAGGACUAGACCUCUGCUGUCCGUUGAUCUGGUAAAUUGCCGUGCGAAUUUGCUUGCAGCGUCAAGAAACAUCGGGACGGAGUUAUUGGAUGAAUGGCAUCAGGAUGCAGGGACAAACGGGCCUCUCGGCUGCUCGUAUUUAGCGUGCCUCGCUGGAAUAUGUCUAAUUACGUGUACAACGCACCUAAACCACGCUGCGCACGGACAACAUCUUUUACUCCCGCUGGCCGGGUCUACGUCGCCGGUCCUUGACAGGGGGGAUCUAUGCCCGGGCGAUUCGGCUCUUCGUCGGACUGGACAGGGGAAAGCAUAUUCUAGAUUUGAGGUUUUCAGUCAGCGGAUGUGUUUUUCAAUACCGCGGAAGGUCAGCCAUACACUCCAGAUCCCGGGCACGCUGCUAAUCUAUCAAGGGGGACUGAUUUUAUACUGCCGGACCCAUUGUAUCACUUUUUCAAGCAGCGACGUGGCCCGUGCUGUUACCGCACUCGCACAAAGCUCGCGUAUUCGGAGACGUUCGGACCCUCACCUGGGAGCACGGAACCGCCGCGAAGCGAGCGUGGAUGACCGUGCGCUACUCCUGCGUCAACGUUGGUGGGAUAUCCCACCGAUACCAGAGUCUUCUGUAUCCACCACGACUAUGUUCGCGCACCCCUACUUGAGGAGACGACUUGCACAAGGUUGGGAAAACAUAAUCCAGCCUCGUCAACUUGUCGCCAACUUCGCGAUUUUGCACUUUCGCGCAACCCCCCAAAGUGUACCUGGAGAAACCAACAAAAGUGGUGUAGCCGUCAGAAAUGUGAGGGGGGUCCGGUUUUAUGCAAGGUUGAGAGUAGGCGAGGUACAUGGUGCCACGGGGAGGCUCGAAGCCUGGCCGUCCUUGGAGAUCACUGGGCUGCUGGAUACGCCAGUGUUAUCGCAAGGACAUCUCCAACGGGUUCGCUCACACCCCAAUCAUCGAUCGGUGCGAAAUGCCAAUUGGGAACACGGACCGAAACACAUCGAUAGACUAAGUUCGGGAUUCCUUUGUGCUCGGCCCGUGCUGGUUGAACUCCAUCAAGUGCUCAGCACUGUGACACGGGAUUCGGGAGCGCAAUCGAGCGGGGGAGAAAUUUACGCAUGUGGUUCGCGCAACUAUGUUUUACAAGAGGCUAUGAGGCCCACUCAUGCUAUGCCUACGGUUCCCAUAGCUAAAACACCAUACGGAACGCUACGUCACCGGGCUAGAGGACCCAGCUUGAGCACAACUCAUAUAGAUUCACCCGUACCGCGCAAGUCACGAAGUAGGUCAAUCAUGCGGUGUCAGUCCUAUUCGACGCACCUCCUGCAGCCGACGGUCAACCGCAUGCUGGAAAGCUAUUCCGCAAACGUAAACACUUGUUUCUUUUCGGCAAACCGUAUAAGUCGCCUGCCCAUUGAAGACUCUAAUCUAAACAGUUCAAUUGAGAUACAUCGGCGGGCAUGCACCAGGAAUCUAUUGAACAACCAUUCAAUAAGGGAAGUAUGCAACGAGCUAGAUUGGGCCGCGGCGCAGAGUAUCUCAUCUUAUAGUUCACCUACGCUUGUUAGGAAUCUGUGCAACGUUUACAGUACACAACAGGGAAAGUCCGACGAGAUAGGGGAGAGGCAGGUACGGUGUUCGUACAAGCCUUCGGUUCUGGUCAAUUUGUCUGUGCCUUGGAAAUACAUCAGGCGGUCGAUAGACCGACCCCUAAAGUGCCCGUGCAGGCUGCUUCUUCAAGGCUCGUGUGGAACGAAAUUACCUUCUUUAUAUCUUGUUACGGUAGCCUUCUCAGGGCAACAUGGCGGCAUUGCCUCUGGCCGAUUAGUGCGCAGCCGCGAAGGGUGUUUAGUACAUCAAUACGGGGGUGAUACCCGAAAUUCCUUAUAUGCAAAUGAAGCGGGUGCGAGUGGGCUAAGUUCAUACCGAACUGUGGGAGGCGCGAUUGCUCUGCACCCCGCAAAAGUGAUCCUCCAUGGUCUCCAUGCGAACCUUACUUUACUGGGAAUGGUCCGACGGUUAGCUUAUACAUAUAACUUGGCAGGGAGGAAGAUGCUUCAUUAUGUUAUUGCGUAUAAUUGUAGAUUGAGACACGCGGUAAUAGUACAUCAGAGCCGUCGAGACCUCUGUCCCUCCAGACUCGUACCAGGGUCUCUAUUUCAUUUACAAGAUGUGUUAGGGGUGACAUGGGGGAACGUAUCAGAGACUCCUAGUUGGUACAGGAGCGAAUAUCAGCCAGCAUUCCUAACGACGGGUACGCUUAAUGCGCCACGCUUCUGCAAGGGUAAGCUCAAACUACAGGACUUGAAACAUCCCCAUUAUCAGUGUAUCCGCCAUUCCUUCAGACAGACAUUAUCCGUGUACCGACCCGGUCCGAGUAUCGGCAUAGCGUUAAAUCGAGUAAAACUUUUAGAGAUGAAUUGUGUACCCGAGAUGCGCUAUGUCUACAGGAAAAAGAGCAGUGCAAUUCCAAUUGUGUCAGGUUUGUUAGUGCGUACGGAGAAUUUAGCCAUUACAAUGCGGGGCCGAUCGUAUGGGCAGGGCUGCCAUUCAUUUACGCAAACUAUAUUGCGGCAUGAAAUGGGAAUUUUCUCGCUGCCCGCGGCCGCCGCUCCCUACGUUCAAGUGACUCGAUCCGGUUCUCCGUCGUCCAACGUGCUAGAAACAGUUGAGUCGAAUCGAUUCCGUAACAAACGCGUGGUGUUUUACCAUACAUCCACGCAGAGCCGUGUCGCCCUUCGGUUGCUAGCCGCCUCGUCAAUUCAGGGCUCGACGACACGGCAGCCUACGCAAGAAUUCACGCAGCCAAGUAGUGUUACUUGGGUCUGGAGUUACCGCAUACCUGAAGACGCAUCGGCUAUCACCUUCUCCAUCGUGUCUGUGUCGGAAUGGUGCUUUAACACCAAACUGGAAAGAUACUGCAAUUGGGUGAUAUGUCCAUUGCAUUUGUUCAGCGCCAUCCCCACGUUAAUGGCGAGCCAAGAAGAACAUCGACCGCCUGCUUCCGACUGCGCGAGGAUGGUAGCCCCUCGUUACGCACCAUUCUACCCAGAUUGUAGCGAAGUUUGGCCGGUGUGGCCACUCCAUAUGAGUGUCGGGGAAGUGAGUAGAAAGCGCCCUUUCGACAGUGUGACUAAAGCGUGUUGUGAAACUCCCGCGCGUAAGCUGUCUGAGUAUUCAGCACGUACGGGCUUCGUGUCAAUGCUGGACGCAACAAGAAGAGGAUAUGUCUGUUCAAUGUCGGACAUUGAGGACUACCCUGUAGAUUUGGUCCAGGUCUCCGAUCGGUGUUUCUGGGUCAACUUACUAUCUCUCCCGUAUCACGCCAGGUGGGCUAUUUCACGGCAACCCUCCAUUGCGCUAUUAAGUCGCCCCAUGCGGAUGUUAGUUAACAGAGGCACAUUGGUCCUUACUACCGCGACAAUACGGUCGGAAGCACCAUUUUUUGAAAGCCGUUCCUCAGGAGUGUCGAUUACGUGUGUCAAGUCCUUAGUAUCUAUCGAAGUCGACUUACUUGUGCCGCCCUGCCUGAGAUGUCGCCUAAGUAAAGGCAGGCAUCGCAGCCACACCGUUAUAGCAUUGGUACUGCAAUACCUCAUCCUUAAGAUACACAUUCUUGGAGUAGGCGGCUUUACUGGGCGAACUCUACACCAUACAUUUAGAACAGACUCAUGGGCAUACGUAUGGUGUCCAAAUCCCAUCAUUUUACUUUUGGUUGACUGCUCUCUAGAACGUUCGUCCGCAAACUACUCGCUGACAUCAAGGGCUUGGACGCGGCAAAAAGGGACUAUAGGCAUUAUCCAUUACGGGACUGACAGAAAUGGCCCUCCAGAGAUCAGCCCUGUACUGAUCGCUACUUUUAAAGCUACCUUCAGGAGUCCAUUAAAGCUUACGUUCCACUACUCCAAAGUACGUGUUCCCCCUGAUAGUGCUAUAGACAGGGAGUCAGCAUACCUCGGGUCCUUGGUUCACCUACGCAAAAAUCGAGGGGCUCUUGCGGGCUCUCGCAUGUACCGCAACAUUGGCCAACUAACUGCCCCCUUGCCAGGCCUAACACACAAUCUCAUUUUCCACACCUACACCGAUGAAGCUUCCGUGCAAAACUGGACGCGGCCCUUCUCCCUAGAUAAAAUCGCGGCGGGCGUAGCGUCACUAGCCCCUAGAGGAGUCGGGCACAGGCCGGUCUUCGCUAUUACUCGUAGGGUACUAAGGGGGGGCGGACGGAAUUCUGGUCGCUCUAUGGCUCACAUUAGGCAUACACCCACCAUAGGCUGCAGCCAGGUUCAAAUUCUCUCUUUGACCACGAUAAUUAUCUGCCGAAGGCUUUCUGACCAGGCGCCACCGUUGGGGAAAAGGUCUCAUCGCCUGCGGGCUCUCGGCAACAACGUCCUACCAGGCAGUUGGCGUUAUGAUCAACGAAAUGAAACGACUGGGUGUUUUUUUCGGAUGAGGUGGAUGAAAGGAACGGCAGUAGCCCCUAACCCCCCUCAUGACAAGAUAUCAUCUAAUCUCAACACGAUCCCUGUGGCAAGCAGUGAGUCGCCCUUUCCGAGGUUAGAAAGUCUACCCGGAUUAUAUCCGCGCCCAGGAAGGAGCGUCAUACAUGCUGCAAAUGCUGCUACAGCGAGAACAGUGUGUUGUUACCAAGUCGUGAGAGGCUCAUCUCACCGUAGGCGUACUGAAUUCUUCGAGGUGCGUUUAGACGGUGAUCGAGGCGCCCAAGUCCUUGGGACACGAAAAGCCGUAUCGAGCGCAACGAAUUCGGGCAGGUUAUACACUCAGCUUACAUUUGUAGUCAUAUAUCGGCUGGUAACUGCGGCGCCUACAUUCAAGUCUUCACCGAAAGCCUAUUGCCAAACCGCCGACGAAGACAACUCGUCUGGUAUAUGUGUCAUAGAAGCAGUACUGAAGCUGCUUCCUGCUACGAUGCCCACUAAGCCCUUCGCCACGUGGGCCUCACUACACAUAAGAGCGCCGCGACAUGGAAGCGUUGGACAAUAUUGGAUACUCGGUCCAAGCGGUGGAAAGAUUACUUCUUCACCGCUCUCGAAGCACCGGCAGAACGGGAGUUCUGGGACCAAAUCGUCGAUUGCCGACGAAAUAUUAGGCUUGUUGGCGUUCAGUACAUCUCCCACUAUUACUAUGCGACAAGGGCCUACUGCCGCGAUUUUCACCAAUGGCAACGGGGUAAUGCCCCGGCGCUGGACACAAUGGCGUAGCCCUUACGCUAUACCCCGCGCACCCUCGGCAGGUCACUACCCAACUGUUGUGUCAAGUAAAAAGAUCGGGUGGAUGUCCAACACCAGUCGAAUGGCUUCAAAGGAUGGUCUCCUGCUACGCCUUGUGAAGGUUCCCGAACGCUUUAAGCGGAGCAUACAGGGGCCCGAAAGUUCCUGGCCCAAGUUUGCACGGUACGCGUAUGCGCCUAUACCUCAAACGUAUUUUUCUUUGCCGCAGCGGUAUUGCAUACAUCGUUUCGGUUUAUUUAGCACGCUCCCUCGUAAGCUUUAUCGAGGUCACGAGAAAAAUCUCUGGAAUUUGCAGCCAUGUGGUUACCACACCACUCUGCGAAGAACCUCGGCCGACGCACGGGCAUCACGCAUAGUUGGUACUUCGGAGGAGUGGGUCAGAGAGCUAGGGCCAGGUGAGGCGAGCAGCAUCGCGGGGAGUGGUGCUUCUCUGAGCAGUUGUUCUUCGAGUGUCUUCAGGGGGCAGCGUGAGAGGCUAUCACACAUUACAAAUUCGUCCAUGCUCCGCUCUUAUCUGUCGCCACUGUACUGUCAGGUACCUUAG'
print(rna_to_protein(rna)) | def rna_to_protein(rna):
"""
Takes a string and returns a protein sequence WIHOUT
using biopython
Input params:
rna = rna string
Output params:
protein = protein sequence
"""
codon = []
protein = []
while rna:
codon.append(rna[:3])
rna = rna[3:]
for triplet in codon:
if triplet == 'AUG':
protein.append('M')
elif triplet == 'GCC' or triplet == 'GCG' or triplet == 'GCU' or (triplet == 'GCA'):
protein.append('A')
elif triplet == 'UUU' or triplet == 'UUC':
protein.append('F')
elif triplet == 'UUA' or triplet == 'UUG':
protein.append('L')
elif triplet == 'UCU' or triplet == 'UCC' or triplet == 'UCA' or (triplet == 'UCG'):
protein.append('S')
elif triplet == 'UAU' or triplet == 'UAC':
protein.append('Y')
elif triplet == 'UAA' or triplet == 'UGA':
break
elif triplet == 'UGU' or triplet == 'UGC':
protein.append('C')
elif triplet == 'UGG':
protein.append('W')
elif triplet == 'CUU' or triplet == 'CUC' or triplet == 'CUA' or (triplet == 'CUG'):
protein.append('L')
elif triplet == 'CCU' or triplet == 'CCC' or triplet == 'CCA' or (triplet == 'CCG'):
protein.append('P')
elif triplet == 'CAU' or triplet == 'CAC':
protein.append('H')
elif triplet == 'CAA' or triplet == 'CAG':
protein.append('Q')
elif triplet == 'CGU' or triplet == 'CGC' or triplet == 'CGA' or (triplet == 'CGG'):
protein.append('R')
elif triplet == 'AUU' or triplet == 'AUC' or triplet == 'AUA':
protein.append('I')
elif triplet == 'ACU' or triplet == 'ACC' or triplet == 'ACA' or (triplet == 'ACG'):
protein.append('T')
elif triplet == 'AAU' or triplet == 'AAC':
protein.append('N')
elif triplet == 'AAA' or triplet == 'AAG':
protein.append('K')
elif triplet == 'AGU' or triplet == 'AGC':
protein.append('S')
elif triplet == 'AGA' or triplet == 'AGG':
protein.append('R')
elif triplet == 'GUU' or triplet == 'GUC' or triplet == 'GUA' or (triplet == 'GUG'):
protein.append('V')
elif triplet == 'GAU' or triplet == 'GAC':
protein.append('D')
elif triplet == 'GAA' or triplet == 'GAG':
protein.append('E')
elif triplet == 'GGU' or triplet == 'GGC' or triplet == 'GGA' or (triplet == 'GGG'):
protein.append('G')
protein = ''.join(protein)
return protein
rna = 'AUGAGUUGCCCGACCCUCCGUAUCUCAAAAAUUUUUGUACGAUCAACAUACAAAAAUCCUGCCAUUAACAUCUGGAUGCGCAGCUUUGCCUUAUGUGGAAGGUAUCGGGAGGCACAGGAUCUGUCUGAGGGAAGAAGGGAUUUAAACCUAUGUGCCAUUUCGUUUGGUAACAUUCCGUUCGGACCGUUGCGCUUAUCAACGUGCGUACUCACACCAAACAAAUCCAUACCUCUGAUAGUAAGCCUCAAUUAUCGCCAUCUCGUAUGUUCAGGCUUCGUGUCAGUCUGUUGGAUUUGCGUGAUUGUACUAUCUCCACCCCGCCGGAAUGUUCAAAGCCUCCAAUACGAACAUAAACUCCGAUGCGUUACAAACUACCGACAAGGCCCAUCCGAGUCAUGGAUCCUAAUACACGUAAUUAGUGGUAACGCCGGAAAGCUUCGUAGGGAGUACUUCAACACUCGAGAAGCGCUCUUUCCUAUAUCCUGUCAGUCAGAUGGCGGCCGGCGAACUAGUCUAAUGGUGGACGUUUGUGUAAUAUCCUAUACUUGGAACUUCUUCACUAUUCAUGGGCCCCUUCUAUUAGGCGGUAGCGUUUACAAGUUAUGGCCUGUCGUCGAGUCCUUGCCGUCCAGUUUAUCUGAUAACCUUCGGCCGUACCAGGUGAAGGGGGUCCUUCUCUCCUUUUGUAGGAUUUCCCCUUCAUUGUGCGCGGGACUAUUUAGCCCACGCAAGGGAUUGCAUUAUUCUGAGGCGUCUAGUGCUAGACAAUCGUCUGUCGCACCGUACGCUGGGGGUUUAACUACUCGAACCCGAGCCUUAACUGGGUGCCAGAGCAUACUCCAACGCGAAGAGGGUAGCGUGCGAAUAAAAAUCCUUCCUACUAGCGACACGCUUAUCCAUGAUGGGAAGAGCCGAACGCCCCAGCACGGAGAUCCCUCACCGACAGUGACAUGGCUUGAUCUGUUACGUAUUACUUUCAUCCUACCCAUGCGCGGACAUGUCGAGGGCCGACAGAAUAACUUGUCCAUGAUGUCGCUUUCGUGCGGGGUGUGGCUCGGGGCAGAAGCGUCCUUACCGGGACAGGUACUAUUUAUAUAUGGAUCAUCGUCUAAGAUUUCACCCUCGUACAAAGCGGAGGCCAGACCGCAUAGUCGACGUUGCGGAAUGCCUCCUGACGACGUCUAUCACGGUACUGCUUCGUUGGAUGGUGAGGGCCUCGCAUUUGCGUGCUUACCAGGGCUGAUUUCAUUCAGGCCUGGUACCGACGAAAGAUAUCAUCGUGAGUCUAUGACCCGCGCCUUCGAGGAAUGCUGUGCUUAUGACCCACGACUAGUUGUCACGCUACAGCAAGGGCCGCAGCGCUGUAGGUACGCAUAUAUUCUCCGGAAACCAUCACAAAGUCUCCGCCCCGCUGCCGAUGUGAACGACACUAACAAAGAACUUUCAGAUCCGUGCGUUCCGCUACUAACAUUCCGAUCCUGUAUGGGUUUCUGCUUGCGUCGAAUCACAACGACGAUAAGGGCCAAUCCUUCUAAAGUGACCGGGCACGUGAUAUUACAUCUGGGUGUUCUGGCGGCUAAGGACAAUGCCGGCGCAUUGGAAUACCGUACCGGGUCUCUUGGAGUCCAAUACGCCUGGGCUCAUUACCAUCAUCGAACUUACGUCUACUCCCAUGCAACCACGGGAUUAGAUACAAAGGGGUCCUACUCCCGCCGUUCCGAGAUCUGUCAAAUAAAGCAGUUUCGCGACACGUCGCAUGAUGGCGUAUGCGAUUACUUGUAUUUUGAAAAUACGCUUGCUCGAACGAGUGUGCCCCAAAUAAUACAUAUCGCUUUAUCAAACUUCACCGAGUACGGAUGCGUAGGACGAUCGCUUCGUGCCCAGUCAAGGUACAUCUACCCGGAUGGCGUACUAUACCGCGAAGGUAGAGGUAGGAGUUUAGCCAUUUUGGCUCGGGGGUGUGCGCUUGAAUUACACCGUGGGUCUCUGCGUGGGAACUCUGGCGCUAACACUAGGCUCGCUGGGCUUGGCAUAGCCGACCAUAGGUCUCAACGACGAUGCCUUUACGGCAUUGAAAGUCUGGUGGUGGUAGUGUCUAAAGGUCGAUUGGUAUGUCACUGGAUGAACGUUCCACAUCUCACUCCCCUAUACGCAUAUGCUACAAUAGAGCAUAACUCUUUCGGCCAAGUCUGUGGCGAAUUCCGAGGCAUGACCCCACUGCAGUCGGCAAUACAAGCCGAGCAAGAUUGGGUUUUUGCAUCUGAAGUCUUCGUUGGCACGACCGGCAUACAUCAGCAUCAGGCACAGGACUCGCAAUUUUUGCGGGCAGUUAUGUGUACACCAGUUCUAUCUGGCGCCGGUAGUCUUCAAAAUCUUGGCCUGCUUCGAAUUGCAAAGCUAUGGGGCUUUUCGUAUACAGCCCUUAAAGCCUGGUACCUCGUACGAUGGCGCAGGUUACUCCGAUUUCCAUCAAAAAAUAGGACCGCGGCACACCAUGUAGCAGGUCGGAAUGCCUUGGUCUGUAGAUCCGGAAUUGCUACCCCUUACGCGCGGUUUAGCGGCGCCCCAAACGGGGGCAGCAUUUCAGUCUCAUCUUCCGUUAGUGUUUUCCACACGCCCGGCAAGCUAAGGCCCGAACUGCACGCUCGCCCGACCCUUGCGCCCAAAGCGACGAGACAAGACAAACUCAACAGGACGAGCUGCAUUGUCGGGCGCAUCUACGCCUGCAGCAUGAUUAAUCGCCAUAAGCCCAUGAAGCAACCUUUGGGCACAUCUGCCGCCUGGGUUCUGCGUCAAACGCCGUUGACAUGUUGUUCUGGAGAAUCUAACGAGCCUAUCGUAAACGUACGCAUAGGUCAGGAUGAUGCGGUGGAAUCCCUCAAAUCCAAGGAGUGCCCUCCAUAUCUAACCUAUAAAGUCCAUGCCAGGCUGAGCGCAUACGUCAAGCGAUUCUGCCAUCGGCACACAGGCCCAUAUGCCUCAGCUGAUAGUGAACCUGAUGCGGACGCCGAUUUAGGUUUACGUUCACUUGUCCCUCAGCAAGAGACGAGUGAUGCUUCGCUAAAAGGGCGGCACCAGGGCUACAUCUUUCAUAUCAGAGAAGUAACGUUUUGUGCGAUUCGUGUCGAGUUUCCAUUUGGUGGUGACUGUCGAGUCUGUCCCUGUGGUUCACCUGGACCCUUAGCAACGGAGAUUGUAUUCCUAGCCUGGACCGGCCCCCAGCUACAUCUUGAUCGCAUAUCAACCCCCUAUAUAGUCGGGGGUUUCUUUAAACGGGGACCGCUUCCUACAGCCACUUCUUUUAAACGUCACACGCAGGAAGAGGCAGCCUUUUCGUCCCUGUCCGAACGCCAAGUGCAAGGUCUUGCACAUCCACGAGGAGGCUAUAGUUGCUCGAUACUUGAAAAAUAUGCAACGCAACAUUCGUCCGAAGUACACCAAGGUAGUCGAGUCAACGCCCGACGAGUUCUUUGGACUUCCAUUACAUUUACGGAGCAGGUGCAAGCGACUACGGUUUUGGGCCGAUUUCAUUCUAGUCGCCUUCGGUCCGUCCCUUGUACGGUCGGGGCUCAGAUCAGCCUGUAUUGUUCUAAAAGUACUAGUAUAAGGACUAGACCUCUGCUGUCCGUUGAUCUGGUAAAUUGCCGUGCGAAUUUGCUUGCAGCGUCAAGAAACAUCGGGACGGAGUUAUUGGAUGAAUGGCAUCAGGAUGCAGGGACAAACGGGCCUCUCGGCUGCUCGUAUUUAGCGUGCCUCGCUGGAAUAUGUCUAAUUACGUGUACAACGCACCUAAACCACGCUGCGCACGGACAACAUCUUUUACUCCCGCUGGCCGGGUCUACGUCGCCGGUCCUUGACAGGGGGGAUCUAUGCCCGGGCGAUUCGGCUCUUCGUCGGACUGGACAGGGGAAAGCAUAUUCUAGAUUUGAGGUUUUCAGUCAGCGGAUGUGUUUUUCAAUACCGCGGAAGGUCAGCCAUACACUCCAGAUCCCGGGCACGCUGCUAAUCUAUCAAGGGGGACUGAUUUUAUACUGCCGGACCCAUUGUAUCACUUUUUCAAGCAGCGACGUGGCCCGUGCUGUUACCGCACUCGCACAAAGCUCGCGUAUUCGGAGACGUUCGGACCCUCACCUGGGAGCACGGAACCGCCGCGAAGCGAGCGUGGAUGACCGUGCGCUACUCCUGCGUCAACGUUGGUGGGAUAUCCCACCGAUACCAGAGUCUUCUGUAUCCACCACGACUAUGUUCGCGCACCCCUACUUGAGGAGACGACUUGCACAAGGUUGGGAAAACAUAAUCCAGCCUCGUCAACUUGUCGCCAACUUCGCGAUUUUGCACUUUCGCGCAACCCCCCAAAGUGUACCUGGAGAAACCAACAAAAGUGGUGUAGCCGUCAGAAAUGUGAGGGGGGUCCGGUUUUAUGCAAGGUUGAGAGUAGGCGAGGUACAUGGUGCCACGGGGAGGCUCGAAGCCUGGCCGUCCUUGGAGAUCACUGGGCUGCUGGAUACGCCAGUGUUAUCGCAAGGACAUCUCCAACGGGUUCGCUCACACCCCAAUCAUCGAUCGGUGCGAAAUGCCAAUUGGGAACACGGACCGAAACACAUCGAUAGACUAAGUUCGGGAUUCCUUUGUGCUCGGCCCGUGCUGGUUGAACUCCAUCAAGUGCUCAGCACUGUGACACGGGAUUCGGGAGCGCAAUCGAGCGGGGGAGAAAUUUACGCAUGUGGUUCGCGCAACUAUGUUUUACAAGAGGCUAUGAGGCCCACUCAUGCUAUGCCUACGGUUCCCAUAGCUAAAACACCAUACGGAACGCUACGUCACCGGGCUAGAGGACCCAGCUUGAGCACAACUCAUAUAGAUUCACCCGUACCGCGCAAGUCACGAAGUAGGUCAAUCAUGCGGUGUCAGUCCUAUUCGACGCACCUCCUGCAGCCGACGGUCAACCGCAUGCUGGAAAGCUAUUCCGCAAACGUAAACACUUGUUUCUUUUCGGCAAACCGUAUAAGUCGCCUGCCCAUUGAAGACUCUAAUCUAAACAGUUCAAUUGAGAUACAUCGGCGGGCAUGCACCAGGAAUCUAUUGAACAACCAUUCAAUAAGGGAAGUAUGCAACGAGCUAGAUUGGGCCGCGGCGCAGAGUAUCUCAUCUUAUAGUUCACCUACGCUUGUUAGGAAUCUGUGCAACGUUUACAGUACACAACAGGGAAAGUCCGACGAGAUAGGGGAGAGGCAGGUACGGUGUUCGUACAAGCCUUCGGUUCUGGUCAAUUUGUCUGUGCCUUGGAAAUACAUCAGGCGGUCGAUAGACCGACCCCUAAAGUGCCCGUGCAGGCUGCUUCUUCAAGGCUCGUGUGGAACGAAAUUACCUUCUUUAUAUCUUGUUACGGUAGCCUUCUCAGGGCAACAUGGCGGCAUUGCCUCUGGCCGAUUAGUGCGCAGCCGCGAAGGGUGUUUAGUACAUCAAUACGGGGGUGAUACCCGAAAUUCCUUAUAUGCAAAUGAAGCGGGUGCGAGUGGGCUAAGUUCAUACCGAACUGUGGGAGGCGCGAUUGCUCUGCACCCCGCAAAAGUGAUCCUCCAUGGUCUCCAUGCGAACCUUACUUUACUGGGAAUGGUCCGACGGUUAGCUUAUACAUAUAACUUGGCAGGGAGGAAGAUGCUUCAUUAUGUUAUUGCGUAUAAUUGUAGAUUGAGACACGCGGUAAUAGUACAUCAGAGCCGUCGAGACCUCUGUCCCUCCAGACUCGUACCAGGGUCUCUAUUUCAUUUACAAGAUGUGUUAGGGGUGACAUGGGGGAACGUAUCAGAGACUCCUAGUUGGUACAGGAGCGAAUAUCAGCCAGCAUUCCUAACGACGGGUACGCUUAAUGCGCCACGCUUCUGCAAGGGUAAGCUCAAACUACAGGACUUGAAACAUCCCCAUUAUCAGUGUAUCCGCCAUUCCUUCAGACAGACAUUAUCCGUGUACCGACCCGGUCCGAGUAUCGGCAUAGCGUUAAAUCGAGUAAAACUUUUAGAGAUGAAUUGUGUACCCGAGAUGCGCUAUGUCUACAGGAAAAAGAGCAGUGCAAUUCCAAUUGUGUCAGGUUUGUUAGUGCGUACGGAGAAUUUAGCCAUUACAAUGCGGGGCCGAUCGUAUGGGCAGGGCUGCCAUUCAUUUACGCAAACUAUAUUGCGGCAUGAAAUGGGAAUUUUCUCGCUGCCCGCGGCCGCCGCUCCCUACGUUCAAGUGACUCGAUCCGGUUCUCCGUCGUCCAACGUGCUAGAAACAGUUGAGUCGAAUCGAUUCCGUAACAAACGCGUGGUGUUUUACCAUACAUCCACGCAGAGCCGUGUCGCCCUUCGGUUGCUAGCCGCCUCGUCAAUUCAGGGCUCGACGACACGGCAGCCUACGCAAGAAUUCACGCAGCCAAGUAGUGUUACUUGGGUCUGGAGUUACCGCAUACCUGAAGACGCAUCGGCUAUCACCUUCUCCAUCGUGUCUGUGUCGGAAUGGUGCUUUAACACCAAACUGGAAAGAUACUGCAAUUGGGUGAUAUGUCCAUUGCAUUUGUUCAGCGCCAUCCCCACGUUAAUGGCGAGCCAAGAAGAACAUCGACCGCCUGCUUCCGACUGCGCGAGGAUGGUAGCCCCUCGUUACGCACCAUUCUACCCAGAUUGUAGCGAAGUUUGGCCGGUGUGGCCACUCCAUAUGAGUGUCGGGGAAGUGAGUAGAAAGCGCCCUUUCGACAGUGUGACUAAAGCGUGUUGUGAAACUCCCGCGCGUAAGCUGUCUGAGUAUUCAGCACGUACGGGCUUCGUGUCAAUGCUGGACGCAACAAGAAGAGGAUAUGUCUGUUCAAUGUCGGACAUUGAGGACUACCCUGUAGAUUUGGUCCAGGUCUCCGAUCGGUGUUUCUGGGUCAACUUACUAUCUCUCCCGUAUCACGCCAGGUGGGCUAUUUCACGGCAACCCUCCAUUGCGCUAUUAAGUCGCCCCAUGCGGAUGUUAGUUAACAGAGGCACAUUGGUCCUUACUACCGCGACAAUACGGUCGGAAGCACCAUUUUUUGAAAGCCGUUCCUCAGGAGUGUCGAUUACGUGUGUCAAGUCCUUAGUAUCUAUCGAAGUCGACUUACUUGUGCCGCCCUGCCUGAGAUGUCGCCUAAGUAAAGGCAGGCAUCGCAGCCACACCGUUAUAGCAUUGGUACUGCAAUACCUCAUCCUUAAGAUACACAUUCUUGGAGUAGGCGGCUUUACUGGGCGAACUCUACACCAUACAUUUAGAACAGACUCAUGGGCAUACGUAUGGUGUCCAAAUCCCAUCAUUUUACUUUUGGUUGACUGCUCUCUAGAACGUUCGUCCGCAAACUACUCGCUGACAUCAAGGGCUUGGACGCGGCAAAAAGGGACUAUAGGCAUUAUCCAUUACGGGACUGACAGAAAUGGCCCUCCAGAGAUCAGCCCUGUACUGAUCGCUACUUUUAAAGCUACCUUCAGGAGUCCAUUAAAGCUUACGUUCCACUACUCCAAAGUACGUGUUCCCCCUGAUAGUGCUAUAGACAGGGAGUCAGCAUACCUCGGGUCCUUGGUUCACCUACGCAAAAAUCGAGGGGCUCUUGCGGGCUCUCGCAUGUACCGCAACAUUGGCCAACUAACUGCCCCCUUGCCAGGCCUAACACACAAUCUCAUUUUCCACACCUACACCGAUGAAGCUUCCGUGCAAAACUGGACGCGGCCCUUCUCCCUAGAUAAAAUCGCGGCGGGCGUAGCGUCACUAGCCCCUAGAGGAGUCGGGCACAGGCCGGUCUUCGCUAUUACUCGUAGGGUACUAAGGGGGGGCGGACGGAAUUCUGGUCGCUCUAUGGCUCACAUUAGGCAUACACCCACCAUAGGCUGCAGCCAGGUUCAAAUUCUCUCUUUGACCACGAUAAUUAUCUGCCGAAGGCUUUCUGACCAGGCGCCACCGUUGGGGAAAAGGUCUCAUCGCCUGCGGGCUCUCGGCAACAACGUCCUACCAGGCAGUUGGCGUUAUGAUCAACGAAAUGAAACGACUGGGUGUUUUUUUCGGAUGAGGUGGAUGAAAGGAACGGCAGUAGCCCCUAACCCCCCUCAUGACAAGAUAUCAUCUAAUCUCAACACGAUCCCUGUGGCAAGCAGUGAGUCGCCCUUUCCGAGGUUAGAAAGUCUACCCGGAUUAUAUCCGCGCCCAGGAAGGAGCGUCAUACAUGCUGCAAAUGCUGCUACAGCGAGAACAGUGUGUUGUUACCAAGUCGUGAGAGGCUCAUCUCACCGUAGGCGUACUGAAUUCUUCGAGGUGCGUUUAGACGGUGAUCGAGGCGCCCAAGUCCUUGGGACACGAAAAGCCGUAUCGAGCGCAACGAAUUCGGGCAGGUUAUACACUCAGCUUACAUUUGUAGUCAUAUAUCGGCUGGUAACUGCGGCGCCUACAUUCAAGUCUUCACCGAAAGCCUAUUGCCAAACCGCCGACGAAGACAACUCGUCUGGUAUAUGUGUCAUAGAAGCAGUACUGAAGCUGCUUCCUGCUACGAUGCCCACUAAGCCCUUCGCCACGUGGGCCUCACUACACAUAAGAGCGCCGCGACAUGGAAGCGUUGGACAAUAUUGGAUACUCGGUCCAAGCGGUGGAAAGAUUACUUCUUCACCGCUCUCGAAGCACCGGCAGAACGGGAGUUCUGGGACCAAAUCGUCGAUUGCCGACGAAAUAUUAGGCUUGUUGGCGUUCAGUACAUCUCCCACUAUUACUAUGCGACAAGGGCCUACUGCCGCGAUUUUCACCAAUGGCAACGGGGUAAUGCCCCGGCGCUGGACACAAUGGCGUAGCCCUUACGCUAUACCCCGCGCACCCUCGGCAGGUCACUACCCAACUGUUGUGUCAAGUAAAAAGAUCGGGUGGAUGUCCAACACCAGUCGAAUGGCUUCAAAGGAUGGUCUCCUGCUACGCCUUGUGAAGGUUCCCGAACGCUUUAAGCGGAGCAUACAGGGGCCCGAAAGUUCCUGGCCCAAGUUUGCACGGUACGCGUAUGCGCCUAUACCUCAAACGUAUUUUUCUUUGCCGCAGCGGUAUUGCAUACAUCGUUUCGGUUUAUUUAGCACGCUCCCUCGUAAGCUUUAUCGAGGUCACGAGAAAAAUCUCUGGAAUUUGCAGCCAUGUGGUUACCACACCACUCUGCGAAGAACCUCGGCCGACGCACGGGCAUCACGCAUAGUUGGUACUUCGGAGGAGUGGGUCAGAGAGCUAGGGCCAGGUGAGGCGAGCAGCAUCGCGGGGAGUGGUGCUUCUCUGAGCAGUUGUUCUUCGAGUGUCUUCAGGGGGCAGCGUGAGAGGCUAUCACACAUUACAAAUUCGUCCAUGCUCCGCUCUUAUCUGUCGCCACUGUACUGUCAGGUACCUUAG'
print(rna_to_protein(rna)) |
class Solution:
def isTransformable(self, s: str, t: str) -> bool:
positions = defaultdict(list)
for i in reversed(range(len(s))):
positions[int(s[i])].append(i)
for char in t:
num = int(char)
if not positions[num]:
return False
i = positions[num][-1]
for j in range(num):
if positions[j] and positions[j][-1] < i:
return False
positions[num].pop()
return True | class Solution:
def is_transformable(self, s: str, t: str) -> bool:
positions = defaultdict(list)
for i in reversed(range(len(s))):
positions[int(s[i])].append(i)
for char in t:
num = int(char)
if not positions[num]:
return False
i = positions[num][-1]
for j in range(num):
if positions[j] and positions[j][-1] < i:
return False
positions[num].pop()
return True |
class Solution:
def solve(self, intervals, types):
sorted_endpoints = sorted(list({end for interval in intervals for end in interval}))
counts = defaultdict(int)
for start, end in intervals:
counts[start] += 1
counts[end] -= 1
counts = dict(zip(sorted_endpoints, accumulate(x[1] for x in sorted(counts.items()))))
ans = []
cur_count = 0
for end in sorted_endpoints:
if cur_count != 0: ans[-1][1] = end
cur_count = counts[end]
if cur_count != 0: ans.append([end, None, cur_count])
return ans
| class Solution:
def solve(self, intervals, types):
sorted_endpoints = sorted(list({end for interval in intervals for end in interval}))
counts = defaultdict(int)
for (start, end) in intervals:
counts[start] += 1
counts[end] -= 1
counts = dict(zip(sorted_endpoints, accumulate((x[1] for x in sorted(counts.items())))))
ans = []
cur_count = 0
for end in sorted_endpoints:
if cur_count != 0:
ans[-1][1] = end
cur_count = counts[end]
if cur_count != 0:
ans.append([end, None, cur_count])
return ans |
def add_data_opts(parser):
data_opts = parser.add_argument_group("General Data Options")
data_opts.add_argument('--manifest-dir', default='./', type=str,
help='Output directory for manifests')
data_opts.add_argument('--min-duration', default=1, type=int,
help='Prunes training samples shorter than the min duration (given in seconds, default 1)')
data_opts.add_argument('--max-duration', default=15, type=int,
help='Prunes training samples longer than the max duration (given in seconds, default 15)')
parser.add_argument('--num-workers', default=4, type=int, help='Number of workers for processing data.')
parser.add_argument('--sample-rate', default=16000, type=int, help='Sample rate')
return parser
| def add_data_opts(parser):
data_opts = parser.add_argument_group('General Data Options')
data_opts.add_argument('--manifest-dir', default='./', type=str, help='Output directory for manifests')
data_opts.add_argument('--min-duration', default=1, type=int, help='Prunes training samples shorter than the min duration (given in seconds, default 1)')
data_opts.add_argument('--max-duration', default=15, type=int, help='Prunes training samples longer than the max duration (given in seconds, default 15)')
parser.add_argument('--num-workers', default=4, type=int, help='Number of workers for processing data.')
parser.add_argument('--sample-rate', default=16000, type=int, help='Sample rate')
return parser |
class object_ustr(object):
def __unicode__(self):
'''This should really be overriden in subclasses'''
class_name = self.__class__.__name__
attr_pairs = ('%s=%s' % (key, val) for key, val in self.__dict__.items())
return u'<%s %s>' % (class_name, ' '.join(attr_pairs))
def __str__(self):
'''This won't usually be overridden in subclasses'''
return unicode(self).encode('utf8')
def __repr__(self):
return str(self)
| class Object_Ustr(object):
def __unicode__(self):
"""This should really be overriden in subclasses"""
class_name = self.__class__.__name__
attr_pairs = ('%s=%s' % (key, val) for (key, val) in self.__dict__.items())
return u'<%s %s>' % (class_name, ' '.join(attr_pairs))
def __str__(self):
"""This won't usually be overridden in subclasses"""
return unicode(self).encode('utf8')
def __repr__(self):
return str(self) |
# The gameboy color has no cpu opcodes for multiplication. I could write some
# complicated algorithm to do this stuff on the gameboy's cpu, but I'm going to
# cheat and just use canned data. If you feed the assembly code for a color
# palette into this script, it will output a canned fade animation, 32 steps in
# size.
#
# e.g. of input data:
# DB $00,$00, $69,$72, $1A,$20, $03,$00,
# DB $00,$00, $FF,$7F, $F8,$37, $5F,$19,
# DB $00,$00, $54,$62, $F8,$37, $1A,$20,
# DB $00,$00, $00,$00, $00,$00, $00,$00,
# DB $00,$00, $00,$00, $00,$00, $00,$00,
# DB $00,$00, $00,$00, $00,$00, $00,$00,
# DB $00,$00, $00,$00, $00,$00, $00,$00,
# DB $00,$00, $00,$00, $00,$00, $00,$00,
#
def get_rgb(bgr_555):
r = 0x1F & bgr_555
g = (0x3E0 & bgr_555) >> 5
b = (0x7C00 & bgr_555) >> 10
return (r, g, b)
lines = []
with open('palette_data.txt') as data:
for line in data:
vector = []
parsed = line[3:].split(',')
parity = False
coll = ""
for elem in parsed:
p = elem.strip()
p = p.strip("$")
if parity:
# Add strs in this order intentionally, to unswap the byteorder.
coll = p + coll
coll.strip()
parity = False
vector.append(get_rgb(int(coll, 16)))
coll = ""
else:
coll = p + coll
parity = True
lines.append(vector)
def lerp(a, b, t):
return a * t + (1 - t) * b
def blend(lhs, rhs, amount):
return (int(lerp(lhs[0], rhs[0], amount)),
int(lerp(lhs[1], rhs[1], amount)),
int(lerp(lhs[2], rhs[2], amount)))
black = (0, 0, 1)
tan = (27, 24, 18)
white = (31, 31, 31)
def to_gbc_color(c):
fmt = '{0:0{1}X}'.format(((c[0]) + ((c[1]) << 5) + ((c[2]) << 10)), 4)
# The byte order is swapped on the gbc
print("$" + fmt[2:4] + ",$" + fmt[0:2], end = ", ")
print("black::")
for i in range(0, 32):
print(".blend_" + str(i) + "::")
for line in lines:
print("DB ", end="")
for elem in line:
to_gbc_color(blend(black, elem, i / 31))
print("")
print(".blend_" + str(i) + "_end::")
print("tan::")
for i in range(0, 32):
print(".blend_" + str(i) + "::")
for line in lines:
print("DB ", end="")
for elem in line:
to_gbc_color(blend(tan, elem, i / 31))
print("")
print(".blend_" + str(i) + "_end::")
print("white::")
for i in range(0, 32):
print(".blend_" + str(i) + "::")
for line in lines:
print("DB ", end="")
for elem in line:
to_gbc_color(blend(white, elem, i / 31))
print("")
print(".blend_" + str(i) + "_end::")
| def get_rgb(bgr_555):
r = 31 & bgr_555
g = (992 & bgr_555) >> 5
b = (31744 & bgr_555) >> 10
return (r, g, b)
lines = []
with open('palette_data.txt') as data:
for line in data:
vector = []
parsed = line[3:].split(',')
parity = False
coll = ''
for elem in parsed:
p = elem.strip()
p = p.strip('$')
if parity:
coll = p + coll
coll.strip()
parity = False
vector.append(get_rgb(int(coll, 16)))
coll = ''
else:
coll = p + coll
parity = True
lines.append(vector)
def lerp(a, b, t):
return a * t + (1 - t) * b
def blend(lhs, rhs, amount):
return (int(lerp(lhs[0], rhs[0], amount)), int(lerp(lhs[1], rhs[1], amount)), int(lerp(lhs[2], rhs[2], amount)))
black = (0, 0, 1)
tan = (27, 24, 18)
white = (31, 31, 31)
def to_gbc_color(c):
fmt = '{0:0{1}X}'.format(c[0] + (c[1] << 5) + (c[2] << 10), 4)
print('$' + fmt[2:4] + ',$' + fmt[0:2], end=', ')
print('black::')
for i in range(0, 32):
print('.blend_' + str(i) + '::')
for line in lines:
print('DB ', end='')
for elem in line:
to_gbc_color(blend(black, elem, i / 31))
print('')
print('.blend_' + str(i) + '_end::')
print('tan::')
for i in range(0, 32):
print('.blend_' + str(i) + '::')
for line in lines:
print('DB ', end='')
for elem in line:
to_gbc_color(blend(tan, elem, i / 31))
print('')
print('.blend_' + str(i) + '_end::')
print('white::')
for i in range(0, 32):
print('.blend_' + str(i) + '::')
for line in lines:
print('DB ', end='')
for elem in line:
to_gbc_color(blend(white, elem, i / 31))
print('')
print('.blend_' + str(i) + '_end::') |
#
# PySNMP MIB module IEEE8021-CFM-V2-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/IEEE8021-CFM-V2-MIB
# Produced by pysmi-0.3.4 at Mon Apr 29 19:40:39 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)
#
OctetString, ObjectIdentifier, Integer = mibBuilder.importSymbols("ASN1", "OctetString", "ObjectIdentifier", "Integer")
NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues")
SingleValueConstraint, ConstraintsUnion, ValueSizeConstraint, ConstraintsIntersection, ValueRangeConstraint = mibBuilder.importSymbols("ASN1-REFINEMENT", "SingleValueConstraint", "ConstraintsUnion", "ValueSizeConstraint", "ConstraintsIntersection", "ValueRangeConstraint")
Dot1agCfmIdPermission, dot1agCfmMaIndex, dot1agCfmConfigErrorList, Dot1agCfmMDLevel, ieee8021CfmMaNetGroup, dot1agCfmNotificationsGroup, dot1agCfmMepGroup, Dot1agCfmMepIdOrZero, dot1agCfmCompliances, dot1agCfmMa, dot1agCfmMepLbrBadMsdu, dot1agCfmGroups, ieee8021CfmDefaultMdDefGroup, dot1agCfmVlan, ieee8021CfmPbbTeExtensionGroup, Dot1agCfmMpDirection, dot1agCfmMepRowStatus, dot1agCfmMdIndex, dot1agCfmStack, ieee8021CfmPbbTeTrafficBitGroup, Dot1agCfmMDLevelOrNone, dot1agCfmMdRowStatus, dot1agCfmMepDbGroup, dot1agCfmMdGroup, Dot1agCfmMhfCreation, dot1agCfmMaNetRowStatus, dot1agCfmDefaultMd, Dot1agCfmConfigErrors, dot1agCfmMaMepListRowStatus = mibBuilder.importSymbols("IEEE8021-CFM-MIB", "Dot1agCfmIdPermission", "dot1agCfmMaIndex", "dot1agCfmConfigErrorList", "Dot1agCfmMDLevel", "ieee8021CfmMaNetGroup", "dot1agCfmNotificationsGroup", "dot1agCfmMepGroup", "Dot1agCfmMepIdOrZero", "dot1agCfmCompliances", "dot1agCfmMa", "dot1agCfmMepLbrBadMsdu", "dot1agCfmGroups", "ieee8021CfmDefaultMdDefGroup", "dot1agCfmVlan", "ieee8021CfmPbbTeExtensionGroup", "Dot1agCfmMpDirection", "dot1agCfmMepRowStatus", "dot1agCfmMdIndex", "dot1agCfmStack", "ieee8021CfmPbbTeTrafficBitGroup", "Dot1agCfmMDLevelOrNone", "dot1agCfmMdRowStatus", "dot1agCfmMepDbGroup", "dot1agCfmMdGroup", "Dot1agCfmMhfCreation", "dot1agCfmMaNetRowStatus", "dot1agCfmDefaultMd", "Dot1agCfmConfigErrors", "dot1agCfmMaMepListRowStatus")
IEEE8021ServiceSelectorValue, IEEE8021ServiceSelectorType, IEEE8021ServiceSelectorValueOrNone, IEEE8021PbbComponentIdentifier, ieee802dot1mibs = mibBuilder.importSymbols("IEEE8021-TC-MIB", "IEEE8021ServiceSelectorValue", "IEEE8021ServiceSelectorType", "IEEE8021ServiceSelectorValueOrNone", "IEEE8021PbbComponentIdentifier", "ieee802dot1mibs")
InterfaceIndex, = mibBuilder.importSymbols("IF-MIB", "InterfaceIndex")
NotificationGroup, ModuleCompliance, ObjectGroup = mibBuilder.importSymbols("SNMPv2-CONF", "NotificationGroup", "ModuleCompliance", "ObjectGroup")
ObjectIdentity, Counter32, Bits, IpAddress, TimeTicks, NotificationType, MibScalar, MibTable, MibTableRow, MibTableColumn, ModuleIdentity, MibIdentifier, Counter64, Gauge32, Unsigned32, iso, Integer32 = mibBuilder.importSymbols("SNMPv2-SMI", "ObjectIdentity", "Counter32", "Bits", "IpAddress", "TimeTicks", "NotificationType", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "ModuleIdentity", "MibIdentifier", "Counter64", "Gauge32", "Unsigned32", "iso", "Integer32")
MacAddress, RowStatus, TextualConvention, TruthValue, DisplayString = mibBuilder.importSymbols("SNMPv2-TC", "MacAddress", "RowStatus", "TextualConvention", "TruthValue", "DisplayString")
ieee8021CfmV2Mib = ModuleIdentity((1, 3, 111, 2, 802, 1, 1, 7))
ieee8021CfmV2Mib.setRevisions(('2014-12-15 00:00', '2011-02-27 00:00', '2008-11-18 00:00', '2008-10-15 00:00',))
if mibBuilder.loadTexts: ieee8021CfmV2Mib.setLastUpdated('201412150000Z')
if mibBuilder.loadTexts: ieee8021CfmV2Mib.setOrganization('IEEE 802.1 Working Group')
ieee8021CfmStackTable = MibTable((1, 3, 111, 2, 802, 1, 1, 8, 1, 1, 2), )
if mibBuilder.loadTexts: ieee8021CfmStackTable.setStatus('current')
ieee8021CfmStackEntry = MibTableRow((1, 3, 111, 2, 802, 1, 1, 8, 1, 1, 2, 1), ).setIndexNames((0, "IEEE8021-CFM-V2-MIB", "ieee8021CfmStackifIndex"), (0, "IEEE8021-CFM-V2-MIB", "ieee8021CfmStackServiceSelectorType"), (0, "IEEE8021-CFM-V2-MIB", "ieee8021CfmStackServiceSelectorOrNone"), (0, "IEEE8021-CFM-V2-MIB", "ieee8021CfmStackMdLevel"), (0, "IEEE8021-CFM-V2-MIB", "ieee8021CfmStackDirection"))
if mibBuilder.loadTexts: ieee8021CfmStackEntry.setStatus('current')
ieee8021CfmStackifIndex = MibTableColumn((1, 3, 111, 2, 802, 1, 1, 8, 1, 1, 2, 1, 1), InterfaceIndex())
if mibBuilder.loadTexts: ieee8021CfmStackifIndex.setStatus('current')
ieee8021CfmStackServiceSelectorType = MibTableColumn((1, 3, 111, 2, 802, 1, 1, 8, 1, 1, 2, 1, 2), IEEE8021ServiceSelectorType())
if mibBuilder.loadTexts: ieee8021CfmStackServiceSelectorType.setStatus('current')
ieee8021CfmStackServiceSelectorOrNone = MibTableColumn((1, 3, 111, 2, 802, 1, 1, 8, 1, 1, 2, 1, 3), IEEE8021ServiceSelectorValueOrNone())
if mibBuilder.loadTexts: ieee8021CfmStackServiceSelectorOrNone.setStatus('current')
ieee8021CfmStackMdLevel = MibTableColumn((1, 3, 111, 2, 802, 1, 1, 8, 1, 1, 2, 1, 4), Dot1agCfmMDLevel())
if mibBuilder.loadTexts: ieee8021CfmStackMdLevel.setStatus('current')
ieee8021CfmStackDirection = MibTableColumn((1, 3, 111, 2, 802, 1, 1, 8, 1, 1, 2, 1, 5), Dot1agCfmMpDirection())
if mibBuilder.loadTexts: ieee8021CfmStackDirection.setStatus('current')
ieee8021CfmStackMdIndex = MibTableColumn((1, 3, 111, 2, 802, 1, 1, 8, 1, 1, 2, 1, 6), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ieee8021CfmStackMdIndex.setStatus('current')
ieee8021CfmStackMaIndex = MibTableColumn((1, 3, 111, 2, 802, 1, 1, 8, 1, 1, 2, 1, 7), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ieee8021CfmStackMaIndex.setStatus('current')
ieee8021CfmStackMepId = MibTableColumn((1, 3, 111, 2, 802, 1, 1, 8, 1, 1, 2, 1, 8), Dot1agCfmMepIdOrZero()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ieee8021CfmStackMepId.setStatus('current')
ieee8021CfmStackMacAddress = MibTableColumn((1, 3, 111, 2, 802, 1, 1, 8, 1, 1, 2, 1, 9), MacAddress()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ieee8021CfmStackMacAddress.setStatus('current')
ieee8021CfmVlanTable = MibTable((1, 3, 111, 2, 802, 1, 1, 8, 1, 3, 2), )
if mibBuilder.loadTexts: ieee8021CfmVlanTable.setStatus('current')
ieee8021CfmVlanEntry = MibTableRow((1, 3, 111, 2, 802, 1, 1, 8, 1, 3, 2, 1), ).setIndexNames((0, "IEEE8021-CFM-V2-MIB", "ieee8021CfmVlanComponentId"), (0, "IEEE8021-CFM-V2-MIB", "ieee8021CfmVlanSelector"))
if mibBuilder.loadTexts: ieee8021CfmVlanEntry.setStatus('current')
ieee8021CfmVlanComponentId = MibTableColumn((1, 3, 111, 2, 802, 1, 1, 8, 1, 3, 2, 1, 1), IEEE8021PbbComponentIdentifier())
if mibBuilder.loadTexts: ieee8021CfmVlanComponentId.setStatus('current')
ieee8021CfmVlanSelector = MibTableColumn((1, 3, 111, 2, 802, 1, 1, 8, 1, 3, 2, 1, 3), IEEE8021ServiceSelectorValue())
if mibBuilder.loadTexts: ieee8021CfmVlanSelector.setStatus('current')
ieee8021CfmVlanPrimarySelector = MibTableColumn((1, 3, 111, 2, 802, 1, 1, 8, 1, 3, 2, 1, 5), IEEE8021ServiceSelectorValue()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: ieee8021CfmVlanPrimarySelector.setStatus('current')
ieee8021CfmVlanRowStatus = MibTableColumn((1, 3, 111, 2, 802, 1, 1, 8, 1, 3, 2, 1, 6), RowStatus()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: ieee8021CfmVlanRowStatus.setStatus('current')
ieee8021CfmDefaultMdTable = MibTable((1, 3, 111, 2, 802, 1, 1, 8, 1, 2, 5), )
if mibBuilder.loadTexts: ieee8021CfmDefaultMdTable.setStatus('current')
ieee8021CfmDefaultMdEntry = MibTableRow((1, 3, 111, 2, 802, 1, 1, 8, 1, 2, 5, 1), ).setIndexNames((0, "IEEE8021-CFM-V2-MIB", "ieee8021CfmDefaultMdComponentId"), (0, "IEEE8021-CFM-V2-MIB", "ieee8021CfmDefaultMdPrimarySelectorType"), (0, "IEEE8021-CFM-V2-MIB", "ieee8021CfmDefaultMdPrimarySelector"))
if mibBuilder.loadTexts: ieee8021CfmDefaultMdEntry.setStatus('current')
ieee8021CfmDefaultMdComponentId = MibTableColumn((1, 3, 111, 2, 802, 1, 1, 8, 1, 2, 5, 1, 1), IEEE8021PbbComponentIdentifier())
if mibBuilder.loadTexts: ieee8021CfmDefaultMdComponentId.setStatus('current')
ieee8021CfmDefaultMdPrimarySelectorType = MibTableColumn((1, 3, 111, 2, 802, 1, 1, 8, 1, 2, 5, 1, 2), IEEE8021ServiceSelectorType())
if mibBuilder.loadTexts: ieee8021CfmDefaultMdPrimarySelectorType.setStatus('current')
ieee8021CfmDefaultMdPrimarySelector = MibTableColumn((1, 3, 111, 2, 802, 1, 1, 8, 1, 2, 5, 1, 3), IEEE8021ServiceSelectorValue())
if mibBuilder.loadTexts: ieee8021CfmDefaultMdPrimarySelector.setStatus('current')
ieee8021CfmDefaultMdStatus = MibTableColumn((1, 3, 111, 2, 802, 1, 1, 8, 1, 2, 5, 1, 4), TruthValue()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ieee8021CfmDefaultMdStatus.setStatus('current')
ieee8021CfmDefaultMdLevel = MibTableColumn((1, 3, 111, 2, 802, 1, 1, 8, 1, 2, 5, 1, 5), Dot1agCfmMDLevelOrNone().clone(-1)).setMaxAccess("readwrite")
if mibBuilder.loadTexts: ieee8021CfmDefaultMdLevel.setStatus('current')
ieee8021CfmDefaultMdMhfCreation = MibTableColumn((1, 3, 111, 2, 802, 1, 1, 8, 1, 2, 5, 1, 6), Dot1agCfmMhfCreation().clone('defMHFdefer')).setMaxAccess("readwrite")
if mibBuilder.loadTexts: ieee8021CfmDefaultMdMhfCreation.setStatus('current')
ieee8021CfmDefaultMdIdPermission = MibTableColumn((1, 3, 111, 2, 802, 1, 1, 8, 1, 2, 5, 1, 7), Dot1agCfmIdPermission().clone('sendIdDefer')).setMaxAccess("readwrite")
if mibBuilder.loadTexts: ieee8021CfmDefaultMdIdPermission.setStatus('current')
ieee8021CfmConfigErrorListTable = MibTable((1, 3, 111, 2, 802, 1, 1, 8, 1, 4, 2), )
if mibBuilder.loadTexts: ieee8021CfmConfigErrorListTable.setStatus('current')
ieee8021CfmConfigErrorListEntry = MibTableRow((1, 3, 111, 2, 802, 1, 1, 8, 1, 4, 2, 1), ).setIndexNames((0, "IEEE8021-CFM-V2-MIB", "ieee8021CfmConfigErrorListSelectorType"), (0, "IEEE8021-CFM-V2-MIB", "ieee8021CfmConfigErrorListSelector"), (0, "IEEE8021-CFM-V2-MIB", "ieee8021CfmConfigErrorListIfIndex"))
if mibBuilder.loadTexts: ieee8021CfmConfigErrorListEntry.setStatus('current')
ieee8021CfmConfigErrorListSelectorType = MibTableColumn((1, 3, 111, 2, 802, 1, 1, 8, 1, 4, 2, 1, 1), IEEE8021ServiceSelectorType())
if mibBuilder.loadTexts: ieee8021CfmConfigErrorListSelectorType.setStatus('current')
ieee8021CfmConfigErrorListSelector = MibTableColumn((1, 3, 111, 2, 802, 1, 1, 8, 1, 4, 2, 1, 2), IEEE8021ServiceSelectorValue())
if mibBuilder.loadTexts: ieee8021CfmConfigErrorListSelector.setStatus('current')
ieee8021CfmConfigErrorListIfIndex = MibTableColumn((1, 3, 111, 2, 802, 1, 1, 8, 1, 4, 2, 1, 3), InterfaceIndex())
if mibBuilder.loadTexts: ieee8021CfmConfigErrorListIfIndex.setStatus('current')
ieee8021CfmConfigErrorListErrorType = MibTableColumn((1, 3, 111, 2, 802, 1, 1, 8, 1, 4, 2, 1, 4), Dot1agCfmConfigErrors()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ieee8021CfmConfigErrorListErrorType.setStatus('current')
ieee8021CfmMaCompTable = MibTable((1, 3, 111, 2, 802, 1, 1, 8, 1, 6, 4), )
if mibBuilder.loadTexts: ieee8021CfmMaCompTable.setStatus('current')
ieee8021CfmMaCompEntry = MibTableRow((1, 3, 111, 2, 802, 1, 1, 8, 1, 6, 4, 1), ).setIndexNames((0, "IEEE8021-CFM-V2-MIB", "ieee8021CfmMaComponentId"), (0, "IEEE8021-CFM-MIB", "dot1agCfmMdIndex"), (0, "IEEE8021-CFM-MIB", "dot1agCfmMaIndex"))
if mibBuilder.loadTexts: ieee8021CfmMaCompEntry.setStatus('current')
ieee8021CfmMaComponentId = MibTableColumn((1, 3, 111, 2, 802, 1, 1, 8, 1, 6, 4, 1, 1), IEEE8021PbbComponentIdentifier())
if mibBuilder.loadTexts: ieee8021CfmMaComponentId.setStatus('current')
ieee8021CfmMaCompPrimarySelectorType = MibTableColumn((1, 3, 111, 2, 802, 1, 1, 8, 1, 6, 4, 1, 2), IEEE8021ServiceSelectorType()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: ieee8021CfmMaCompPrimarySelectorType.setStatus('current')
ieee8021CfmMaCompPrimarySelectorOrNone = MibTableColumn((1, 3, 111, 2, 802, 1, 1, 8, 1, 6, 4, 1, 3), IEEE8021ServiceSelectorValueOrNone()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: ieee8021CfmMaCompPrimarySelectorOrNone.setStatus('current')
ieee8021CfmMaCompMhfCreation = MibTableColumn((1, 3, 111, 2, 802, 1, 1, 8, 1, 6, 4, 1, 4), Dot1agCfmMhfCreation().clone('defMHFdefer')).setMaxAccess("readcreate")
if mibBuilder.loadTexts: ieee8021CfmMaCompMhfCreation.setStatus('current')
ieee8021CfmMaCompIdPermission = MibTableColumn((1, 3, 111, 2, 802, 1, 1, 8, 1, 6, 4, 1, 5), Dot1agCfmIdPermission().clone('sendIdDefer')).setMaxAccess("readcreate")
if mibBuilder.loadTexts: ieee8021CfmMaCompIdPermission.setStatus('current')
ieee8021CfmMaCompNumberOfVids = MibTableColumn((1, 3, 111, 2, 802, 1, 1, 8, 1, 6, 4, 1, 6), Unsigned32()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: ieee8021CfmMaCompNumberOfVids.setStatus('current')
ieee8021CfmMaCompRowStatus = MibTableColumn((1, 3, 111, 2, 802, 1, 1, 8, 1, 6, 4, 1, 7), RowStatus()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: ieee8021CfmMaCompRowStatus.setStatus('current')
ieee8021CfmStackGroup = ObjectGroup((1, 3, 111, 2, 802, 1, 1, 8, 2, 2, 12)).setObjects(("IEEE8021-CFM-V2-MIB", "ieee8021CfmStackMdIndex"), ("IEEE8021-CFM-V2-MIB", "ieee8021CfmStackMaIndex"), ("IEEE8021-CFM-V2-MIB", "ieee8021CfmStackMepId"), ("IEEE8021-CFM-V2-MIB", "ieee8021CfmStackMacAddress"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ieee8021CfmStackGroup = ieee8021CfmStackGroup.setStatus('current')
ieee8021CfmMaGroup = ObjectGroup((1, 3, 111, 2, 802, 1, 1, 8, 2, 2, 13)).setObjects(("IEEE8021-CFM-V2-MIB", "ieee8021CfmMaCompPrimarySelectorType"), ("IEEE8021-CFM-V2-MIB", "ieee8021CfmMaCompPrimarySelectorOrNone"), ("IEEE8021-CFM-V2-MIB", "ieee8021CfmMaCompMhfCreation"), ("IEEE8021-CFM-V2-MIB", "ieee8021CfmMaCompIdPermission"), ("IEEE8021-CFM-V2-MIB", "ieee8021CfmMaCompRowStatus"), ("IEEE8021-CFM-V2-MIB", "ieee8021CfmMaCompNumberOfVids"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ieee8021CfmMaGroup = ieee8021CfmMaGroup.setStatus('current')
ieee8021CfmDefaultMdGroup = ObjectGroup((1, 3, 111, 2, 802, 1, 1, 8, 2, 2, 14)).setObjects(("IEEE8021-CFM-V2-MIB", "ieee8021CfmDefaultMdStatus"), ("IEEE8021-CFM-V2-MIB", "ieee8021CfmDefaultMdLevel"), ("IEEE8021-CFM-V2-MIB", "ieee8021CfmDefaultMdMhfCreation"), ("IEEE8021-CFM-V2-MIB", "ieee8021CfmDefaultMdIdPermission"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ieee8021CfmDefaultMdGroup = ieee8021CfmDefaultMdGroup.setStatus('current')
ieee8021CfmVlanIdGroup = ObjectGroup((1, 3, 111, 2, 802, 1, 1, 8, 2, 2, 15)).setObjects(("IEEE8021-CFM-V2-MIB", "ieee8021CfmVlanPrimarySelector"), ("IEEE8021-CFM-V2-MIB", "ieee8021CfmVlanRowStatus"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ieee8021CfmVlanIdGroup = ieee8021CfmVlanIdGroup.setStatus('current')
ieee8021CfmConfigErrorListGroup = ObjectGroup((1, 3, 111, 2, 802, 1, 1, 8, 2, 2, 16)).setObjects(("IEEE8021-CFM-V2-MIB", "ieee8021CfmConfigErrorListErrorType"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ieee8021CfmConfigErrorListGroup = ieee8021CfmConfigErrorListGroup.setStatus('current')
ieee8021CfmComplianceV2 = ModuleCompliance((1, 3, 111, 2, 802, 1, 1, 8, 2, 1, 2)).setObjects(("IEEE8021-CFM-V2-MIB", "ieee8021CfmStackGroup"), ("IEEE8021-CFM-V2-MIB", "ieee8021CfmMaGroup"), ("IEEE8021-CFM-V2-MIB", "ieee8021CfmDefaultMdGroup"), ("IEEE8021-CFM-V2-MIB", "ieee8021CfmConfigErrorListGroup"), ("IEEE8021-CFM-V2-MIB", "ieee8021CfmVlanIdGroup"), ("IEEE8021-CFM-MIB", "dot1agCfmMdGroup"), ("IEEE8021-CFM-MIB", "dot1agCfmMepGroup"), ("IEEE8021-CFM-MIB", "dot1agCfmMepDbGroup"), ("IEEE8021-CFM-MIB", "dot1agCfmNotificationsGroup"), ("IEEE8021-CFM-MIB", "ieee8021CfmDefaultMdDefGroup"), ("IEEE8021-CFM-MIB", "ieee8021CfmMaNetGroup"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ieee8021CfmComplianceV2 = ieee8021CfmComplianceV2.setStatus('current')
dot1agCfmWithPbbTeCompliance = ModuleCompliance((1, 3, 111, 2, 802, 1, 1, 8, 2, 1, 3)).setObjects(("IEEE8021-CFM-V2-MIB", "ieee8021CfmStackGroup"), ("IEEE8021-CFM-V2-MIB", "ieee8021CfmMaGroup"), ("IEEE8021-CFM-V2-MIB", "ieee8021CfmDefaultMdGroup"), ("IEEE8021-CFM-V2-MIB", "ieee8021CfmConfigErrorListGroup"), ("IEEE8021-CFM-V2-MIB", "ieee8021CfmVlanIdGroup"), ("IEEE8021-CFM-MIB", "dot1agCfmMdGroup"), ("IEEE8021-CFM-MIB", "dot1agCfmMepGroup"), ("IEEE8021-CFM-MIB", "dot1agCfmMepDbGroup"), ("IEEE8021-CFM-MIB", "dot1agCfmNotificationsGroup"), ("IEEE8021-CFM-MIB", "ieee8021CfmDefaultMdDefGroup"), ("IEEE8021-CFM-MIB", "ieee8021CfmMaNetGroup"), ("IEEE8021-CFM-MIB", "ieee8021CfmPbbTeExtensionGroup"), ("IEEE8021-CFM-MIB", "ieee8021CfmPbbTeTrafficBitGroup"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
dot1agCfmWithPbbTeCompliance = dot1agCfmWithPbbTeCompliance.setStatus('current')
mibBuilder.exportSymbols("IEEE8021-CFM-V2-MIB", ieee8021CfmDefaultMdStatus=ieee8021CfmDefaultMdStatus, ieee8021CfmDefaultMdComponentId=ieee8021CfmDefaultMdComponentId, ieee8021CfmStackServiceSelectorType=ieee8021CfmStackServiceSelectorType, ieee8021CfmMaCompRowStatus=ieee8021CfmMaCompRowStatus, ieee8021CfmDefaultMdPrimarySelectorType=ieee8021CfmDefaultMdPrimarySelectorType, ieee8021CfmConfigErrorListErrorType=ieee8021CfmConfigErrorListErrorType, ieee8021CfmStackGroup=ieee8021CfmStackGroup, ieee8021CfmVlanEntry=ieee8021CfmVlanEntry, ieee8021CfmDefaultMdMhfCreation=ieee8021CfmDefaultMdMhfCreation, ieee8021CfmConfigErrorListTable=ieee8021CfmConfigErrorListTable, ieee8021CfmMaCompEntry=ieee8021CfmMaCompEntry, ieee8021CfmVlanIdGroup=ieee8021CfmVlanIdGroup, ieee8021CfmConfigErrorListSelectorType=ieee8021CfmConfigErrorListSelectorType, ieee8021CfmMaCompTable=ieee8021CfmMaCompTable, dot1agCfmWithPbbTeCompliance=dot1agCfmWithPbbTeCompliance, ieee8021CfmMaCompMhfCreation=ieee8021CfmMaCompMhfCreation, ieee8021CfmDefaultMdEntry=ieee8021CfmDefaultMdEntry, ieee8021CfmDefaultMdTable=ieee8021CfmDefaultMdTable, ieee8021CfmComplianceV2=ieee8021CfmComplianceV2, ieee8021CfmDefaultMdGroup=ieee8021CfmDefaultMdGroup, ieee8021CfmStackTable=ieee8021CfmStackTable, ieee8021CfmMaComponentId=ieee8021CfmMaComponentId, ieee8021CfmMaCompPrimarySelectorOrNone=ieee8021CfmMaCompPrimarySelectorOrNone, ieee8021CfmStackMepId=ieee8021CfmStackMepId, ieee8021CfmDefaultMdLevel=ieee8021CfmDefaultMdLevel, ieee8021CfmStackMdLevel=ieee8021CfmStackMdLevel, ieee8021CfmConfigErrorListGroup=ieee8021CfmConfigErrorListGroup, ieee8021CfmStackDirection=ieee8021CfmStackDirection, PYSNMP_MODULE_ID=ieee8021CfmV2Mib, ieee8021CfmDefaultMdPrimarySelector=ieee8021CfmDefaultMdPrimarySelector, ieee8021CfmStackServiceSelectorOrNone=ieee8021CfmStackServiceSelectorOrNone, ieee8021CfmMaCompPrimarySelectorType=ieee8021CfmMaCompPrimarySelectorType, ieee8021CfmVlanPrimarySelector=ieee8021CfmVlanPrimarySelector, ieee8021CfmV2Mib=ieee8021CfmV2Mib, ieee8021CfmMaCompIdPermission=ieee8021CfmMaCompIdPermission, ieee8021CfmVlanTable=ieee8021CfmVlanTable, ieee8021CfmConfigErrorListSelector=ieee8021CfmConfigErrorListSelector, ieee8021CfmMaGroup=ieee8021CfmMaGroup, ieee8021CfmVlanSelector=ieee8021CfmVlanSelector, ieee8021CfmStackMacAddress=ieee8021CfmStackMacAddress, ieee8021CfmConfigErrorListEntry=ieee8021CfmConfigErrorListEntry, ieee8021CfmConfigErrorListIfIndex=ieee8021CfmConfigErrorListIfIndex, ieee8021CfmMaCompNumberOfVids=ieee8021CfmMaCompNumberOfVids, ieee8021CfmVlanComponentId=ieee8021CfmVlanComponentId, ieee8021CfmVlanRowStatus=ieee8021CfmVlanRowStatus, ieee8021CfmStackMaIndex=ieee8021CfmStackMaIndex, ieee8021CfmStackMdIndex=ieee8021CfmStackMdIndex, ieee8021CfmStackEntry=ieee8021CfmStackEntry, ieee8021CfmDefaultMdIdPermission=ieee8021CfmDefaultMdIdPermission, ieee8021CfmStackifIndex=ieee8021CfmStackifIndex)
| (octet_string, object_identifier, integer) = mibBuilder.importSymbols('ASN1', 'OctetString', 'ObjectIdentifier', 'Integer')
(named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues')
(single_value_constraint, constraints_union, value_size_constraint, constraints_intersection, value_range_constraint) = mibBuilder.importSymbols('ASN1-REFINEMENT', 'SingleValueConstraint', 'ConstraintsUnion', 'ValueSizeConstraint', 'ConstraintsIntersection', 'ValueRangeConstraint')
(dot1ag_cfm_id_permission, dot1ag_cfm_ma_index, dot1ag_cfm_config_error_list, dot1ag_cfm_md_level, ieee8021_cfm_ma_net_group, dot1ag_cfm_notifications_group, dot1ag_cfm_mep_group, dot1ag_cfm_mep_id_or_zero, dot1ag_cfm_compliances, dot1ag_cfm_ma, dot1ag_cfm_mep_lbr_bad_msdu, dot1ag_cfm_groups, ieee8021_cfm_default_md_def_group, dot1ag_cfm_vlan, ieee8021_cfm_pbb_te_extension_group, dot1ag_cfm_mp_direction, dot1ag_cfm_mep_row_status, dot1ag_cfm_md_index, dot1ag_cfm_stack, ieee8021_cfm_pbb_te_traffic_bit_group, dot1ag_cfm_md_level_or_none, dot1ag_cfm_md_row_status, dot1ag_cfm_mep_db_group, dot1ag_cfm_md_group, dot1ag_cfm_mhf_creation, dot1ag_cfm_ma_net_row_status, dot1ag_cfm_default_md, dot1ag_cfm_config_errors, dot1ag_cfm_ma_mep_list_row_status) = mibBuilder.importSymbols('IEEE8021-CFM-MIB', 'Dot1agCfmIdPermission', 'dot1agCfmMaIndex', 'dot1agCfmConfigErrorList', 'Dot1agCfmMDLevel', 'ieee8021CfmMaNetGroup', 'dot1agCfmNotificationsGroup', 'dot1agCfmMepGroup', 'Dot1agCfmMepIdOrZero', 'dot1agCfmCompliances', 'dot1agCfmMa', 'dot1agCfmMepLbrBadMsdu', 'dot1agCfmGroups', 'ieee8021CfmDefaultMdDefGroup', 'dot1agCfmVlan', 'ieee8021CfmPbbTeExtensionGroup', 'Dot1agCfmMpDirection', 'dot1agCfmMepRowStatus', 'dot1agCfmMdIndex', 'dot1agCfmStack', 'ieee8021CfmPbbTeTrafficBitGroup', 'Dot1agCfmMDLevelOrNone', 'dot1agCfmMdRowStatus', 'dot1agCfmMepDbGroup', 'dot1agCfmMdGroup', 'Dot1agCfmMhfCreation', 'dot1agCfmMaNetRowStatus', 'dot1agCfmDefaultMd', 'Dot1agCfmConfigErrors', 'dot1agCfmMaMepListRowStatus')
(ieee8021_service_selector_value, ieee8021_service_selector_type, ieee8021_service_selector_value_or_none, ieee8021_pbb_component_identifier, ieee802dot1mibs) = mibBuilder.importSymbols('IEEE8021-TC-MIB', 'IEEE8021ServiceSelectorValue', 'IEEE8021ServiceSelectorType', 'IEEE8021ServiceSelectorValueOrNone', 'IEEE8021PbbComponentIdentifier', 'ieee802dot1mibs')
(interface_index,) = mibBuilder.importSymbols('IF-MIB', 'InterfaceIndex')
(notification_group, module_compliance, object_group) = mibBuilder.importSymbols('SNMPv2-CONF', 'NotificationGroup', 'ModuleCompliance', 'ObjectGroup')
(object_identity, counter32, bits, ip_address, time_ticks, notification_type, mib_scalar, mib_table, mib_table_row, mib_table_column, module_identity, mib_identifier, counter64, gauge32, unsigned32, iso, integer32) = mibBuilder.importSymbols('SNMPv2-SMI', 'ObjectIdentity', 'Counter32', 'Bits', 'IpAddress', 'TimeTicks', 'NotificationType', 'MibScalar', 'MibTable', 'MibTableRow', 'MibTableColumn', 'ModuleIdentity', 'MibIdentifier', 'Counter64', 'Gauge32', 'Unsigned32', 'iso', 'Integer32')
(mac_address, row_status, textual_convention, truth_value, display_string) = mibBuilder.importSymbols('SNMPv2-TC', 'MacAddress', 'RowStatus', 'TextualConvention', 'TruthValue', 'DisplayString')
ieee8021_cfm_v2_mib = module_identity((1, 3, 111, 2, 802, 1, 1, 7))
ieee8021CfmV2Mib.setRevisions(('2014-12-15 00:00', '2011-02-27 00:00', '2008-11-18 00:00', '2008-10-15 00:00'))
if mibBuilder.loadTexts:
ieee8021CfmV2Mib.setLastUpdated('201412150000Z')
if mibBuilder.loadTexts:
ieee8021CfmV2Mib.setOrganization('IEEE 802.1 Working Group')
ieee8021_cfm_stack_table = mib_table((1, 3, 111, 2, 802, 1, 1, 8, 1, 1, 2))
if mibBuilder.loadTexts:
ieee8021CfmStackTable.setStatus('current')
ieee8021_cfm_stack_entry = mib_table_row((1, 3, 111, 2, 802, 1, 1, 8, 1, 1, 2, 1)).setIndexNames((0, 'IEEE8021-CFM-V2-MIB', 'ieee8021CfmStackifIndex'), (0, 'IEEE8021-CFM-V2-MIB', 'ieee8021CfmStackServiceSelectorType'), (0, 'IEEE8021-CFM-V2-MIB', 'ieee8021CfmStackServiceSelectorOrNone'), (0, 'IEEE8021-CFM-V2-MIB', 'ieee8021CfmStackMdLevel'), (0, 'IEEE8021-CFM-V2-MIB', 'ieee8021CfmStackDirection'))
if mibBuilder.loadTexts:
ieee8021CfmStackEntry.setStatus('current')
ieee8021_cfm_stackif_index = mib_table_column((1, 3, 111, 2, 802, 1, 1, 8, 1, 1, 2, 1, 1), interface_index())
if mibBuilder.loadTexts:
ieee8021CfmStackifIndex.setStatus('current')
ieee8021_cfm_stack_service_selector_type = mib_table_column((1, 3, 111, 2, 802, 1, 1, 8, 1, 1, 2, 1, 2), ieee8021_service_selector_type())
if mibBuilder.loadTexts:
ieee8021CfmStackServiceSelectorType.setStatus('current')
ieee8021_cfm_stack_service_selector_or_none = mib_table_column((1, 3, 111, 2, 802, 1, 1, 8, 1, 1, 2, 1, 3), ieee8021_service_selector_value_or_none())
if mibBuilder.loadTexts:
ieee8021CfmStackServiceSelectorOrNone.setStatus('current')
ieee8021_cfm_stack_md_level = mib_table_column((1, 3, 111, 2, 802, 1, 1, 8, 1, 1, 2, 1, 4), dot1ag_cfm_md_level())
if mibBuilder.loadTexts:
ieee8021CfmStackMdLevel.setStatus('current')
ieee8021_cfm_stack_direction = mib_table_column((1, 3, 111, 2, 802, 1, 1, 8, 1, 1, 2, 1, 5), dot1ag_cfm_mp_direction())
if mibBuilder.loadTexts:
ieee8021CfmStackDirection.setStatus('current')
ieee8021_cfm_stack_md_index = mib_table_column((1, 3, 111, 2, 802, 1, 1, 8, 1, 1, 2, 1, 6), unsigned32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
ieee8021CfmStackMdIndex.setStatus('current')
ieee8021_cfm_stack_ma_index = mib_table_column((1, 3, 111, 2, 802, 1, 1, 8, 1, 1, 2, 1, 7), unsigned32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
ieee8021CfmStackMaIndex.setStatus('current')
ieee8021_cfm_stack_mep_id = mib_table_column((1, 3, 111, 2, 802, 1, 1, 8, 1, 1, 2, 1, 8), dot1ag_cfm_mep_id_or_zero()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
ieee8021CfmStackMepId.setStatus('current')
ieee8021_cfm_stack_mac_address = mib_table_column((1, 3, 111, 2, 802, 1, 1, 8, 1, 1, 2, 1, 9), mac_address()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
ieee8021CfmStackMacAddress.setStatus('current')
ieee8021_cfm_vlan_table = mib_table((1, 3, 111, 2, 802, 1, 1, 8, 1, 3, 2))
if mibBuilder.loadTexts:
ieee8021CfmVlanTable.setStatus('current')
ieee8021_cfm_vlan_entry = mib_table_row((1, 3, 111, 2, 802, 1, 1, 8, 1, 3, 2, 1)).setIndexNames((0, 'IEEE8021-CFM-V2-MIB', 'ieee8021CfmVlanComponentId'), (0, 'IEEE8021-CFM-V2-MIB', 'ieee8021CfmVlanSelector'))
if mibBuilder.loadTexts:
ieee8021CfmVlanEntry.setStatus('current')
ieee8021_cfm_vlan_component_id = mib_table_column((1, 3, 111, 2, 802, 1, 1, 8, 1, 3, 2, 1, 1), ieee8021_pbb_component_identifier())
if mibBuilder.loadTexts:
ieee8021CfmVlanComponentId.setStatus('current')
ieee8021_cfm_vlan_selector = mib_table_column((1, 3, 111, 2, 802, 1, 1, 8, 1, 3, 2, 1, 3), ieee8021_service_selector_value())
if mibBuilder.loadTexts:
ieee8021CfmVlanSelector.setStatus('current')
ieee8021_cfm_vlan_primary_selector = mib_table_column((1, 3, 111, 2, 802, 1, 1, 8, 1, 3, 2, 1, 5), ieee8021_service_selector_value()).setMaxAccess('readcreate')
if mibBuilder.loadTexts:
ieee8021CfmVlanPrimarySelector.setStatus('current')
ieee8021_cfm_vlan_row_status = mib_table_column((1, 3, 111, 2, 802, 1, 1, 8, 1, 3, 2, 1, 6), row_status()).setMaxAccess('readcreate')
if mibBuilder.loadTexts:
ieee8021CfmVlanRowStatus.setStatus('current')
ieee8021_cfm_default_md_table = mib_table((1, 3, 111, 2, 802, 1, 1, 8, 1, 2, 5))
if mibBuilder.loadTexts:
ieee8021CfmDefaultMdTable.setStatus('current')
ieee8021_cfm_default_md_entry = mib_table_row((1, 3, 111, 2, 802, 1, 1, 8, 1, 2, 5, 1)).setIndexNames((0, 'IEEE8021-CFM-V2-MIB', 'ieee8021CfmDefaultMdComponentId'), (0, 'IEEE8021-CFM-V2-MIB', 'ieee8021CfmDefaultMdPrimarySelectorType'), (0, 'IEEE8021-CFM-V2-MIB', 'ieee8021CfmDefaultMdPrimarySelector'))
if mibBuilder.loadTexts:
ieee8021CfmDefaultMdEntry.setStatus('current')
ieee8021_cfm_default_md_component_id = mib_table_column((1, 3, 111, 2, 802, 1, 1, 8, 1, 2, 5, 1, 1), ieee8021_pbb_component_identifier())
if mibBuilder.loadTexts:
ieee8021CfmDefaultMdComponentId.setStatus('current')
ieee8021_cfm_default_md_primary_selector_type = mib_table_column((1, 3, 111, 2, 802, 1, 1, 8, 1, 2, 5, 1, 2), ieee8021_service_selector_type())
if mibBuilder.loadTexts:
ieee8021CfmDefaultMdPrimarySelectorType.setStatus('current')
ieee8021_cfm_default_md_primary_selector = mib_table_column((1, 3, 111, 2, 802, 1, 1, 8, 1, 2, 5, 1, 3), ieee8021_service_selector_value())
if mibBuilder.loadTexts:
ieee8021CfmDefaultMdPrimarySelector.setStatus('current')
ieee8021_cfm_default_md_status = mib_table_column((1, 3, 111, 2, 802, 1, 1, 8, 1, 2, 5, 1, 4), truth_value()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
ieee8021CfmDefaultMdStatus.setStatus('current')
ieee8021_cfm_default_md_level = mib_table_column((1, 3, 111, 2, 802, 1, 1, 8, 1, 2, 5, 1, 5), dot1ag_cfm_md_level_or_none().clone(-1)).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
ieee8021CfmDefaultMdLevel.setStatus('current')
ieee8021_cfm_default_md_mhf_creation = mib_table_column((1, 3, 111, 2, 802, 1, 1, 8, 1, 2, 5, 1, 6), dot1ag_cfm_mhf_creation().clone('defMHFdefer')).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
ieee8021CfmDefaultMdMhfCreation.setStatus('current')
ieee8021_cfm_default_md_id_permission = mib_table_column((1, 3, 111, 2, 802, 1, 1, 8, 1, 2, 5, 1, 7), dot1ag_cfm_id_permission().clone('sendIdDefer')).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
ieee8021CfmDefaultMdIdPermission.setStatus('current')
ieee8021_cfm_config_error_list_table = mib_table((1, 3, 111, 2, 802, 1, 1, 8, 1, 4, 2))
if mibBuilder.loadTexts:
ieee8021CfmConfigErrorListTable.setStatus('current')
ieee8021_cfm_config_error_list_entry = mib_table_row((1, 3, 111, 2, 802, 1, 1, 8, 1, 4, 2, 1)).setIndexNames((0, 'IEEE8021-CFM-V2-MIB', 'ieee8021CfmConfigErrorListSelectorType'), (0, 'IEEE8021-CFM-V2-MIB', 'ieee8021CfmConfigErrorListSelector'), (0, 'IEEE8021-CFM-V2-MIB', 'ieee8021CfmConfigErrorListIfIndex'))
if mibBuilder.loadTexts:
ieee8021CfmConfigErrorListEntry.setStatus('current')
ieee8021_cfm_config_error_list_selector_type = mib_table_column((1, 3, 111, 2, 802, 1, 1, 8, 1, 4, 2, 1, 1), ieee8021_service_selector_type())
if mibBuilder.loadTexts:
ieee8021CfmConfigErrorListSelectorType.setStatus('current')
ieee8021_cfm_config_error_list_selector = mib_table_column((1, 3, 111, 2, 802, 1, 1, 8, 1, 4, 2, 1, 2), ieee8021_service_selector_value())
if mibBuilder.loadTexts:
ieee8021CfmConfigErrorListSelector.setStatus('current')
ieee8021_cfm_config_error_list_if_index = mib_table_column((1, 3, 111, 2, 802, 1, 1, 8, 1, 4, 2, 1, 3), interface_index())
if mibBuilder.loadTexts:
ieee8021CfmConfigErrorListIfIndex.setStatus('current')
ieee8021_cfm_config_error_list_error_type = mib_table_column((1, 3, 111, 2, 802, 1, 1, 8, 1, 4, 2, 1, 4), dot1ag_cfm_config_errors()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
ieee8021CfmConfigErrorListErrorType.setStatus('current')
ieee8021_cfm_ma_comp_table = mib_table((1, 3, 111, 2, 802, 1, 1, 8, 1, 6, 4))
if mibBuilder.loadTexts:
ieee8021CfmMaCompTable.setStatus('current')
ieee8021_cfm_ma_comp_entry = mib_table_row((1, 3, 111, 2, 802, 1, 1, 8, 1, 6, 4, 1)).setIndexNames((0, 'IEEE8021-CFM-V2-MIB', 'ieee8021CfmMaComponentId'), (0, 'IEEE8021-CFM-MIB', 'dot1agCfmMdIndex'), (0, 'IEEE8021-CFM-MIB', 'dot1agCfmMaIndex'))
if mibBuilder.loadTexts:
ieee8021CfmMaCompEntry.setStatus('current')
ieee8021_cfm_ma_component_id = mib_table_column((1, 3, 111, 2, 802, 1, 1, 8, 1, 6, 4, 1, 1), ieee8021_pbb_component_identifier())
if mibBuilder.loadTexts:
ieee8021CfmMaComponentId.setStatus('current')
ieee8021_cfm_ma_comp_primary_selector_type = mib_table_column((1, 3, 111, 2, 802, 1, 1, 8, 1, 6, 4, 1, 2), ieee8021_service_selector_type()).setMaxAccess('readcreate')
if mibBuilder.loadTexts:
ieee8021CfmMaCompPrimarySelectorType.setStatus('current')
ieee8021_cfm_ma_comp_primary_selector_or_none = mib_table_column((1, 3, 111, 2, 802, 1, 1, 8, 1, 6, 4, 1, 3), ieee8021_service_selector_value_or_none()).setMaxAccess('readcreate')
if mibBuilder.loadTexts:
ieee8021CfmMaCompPrimarySelectorOrNone.setStatus('current')
ieee8021_cfm_ma_comp_mhf_creation = mib_table_column((1, 3, 111, 2, 802, 1, 1, 8, 1, 6, 4, 1, 4), dot1ag_cfm_mhf_creation().clone('defMHFdefer')).setMaxAccess('readcreate')
if mibBuilder.loadTexts:
ieee8021CfmMaCompMhfCreation.setStatus('current')
ieee8021_cfm_ma_comp_id_permission = mib_table_column((1, 3, 111, 2, 802, 1, 1, 8, 1, 6, 4, 1, 5), dot1ag_cfm_id_permission().clone('sendIdDefer')).setMaxAccess('readcreate')
if mibBuilder.loadTexts:
ieee8021CfmMaCompIdPermission.setStatus('current')
ieee8021_cfm_ma_comp_number_of_vids = mib_table_column((1, 3, 111, 2, 802, 1, 1, 8, 1, 6, 4, 1, 6), unsigned32()).setMaxAccess('readcreate')
if mibBuilder.loadTexts:
ieee8021CfmMaCompNumberOfVids.setStatus('current')
ieee8021_cfm_ma_comp_row_status = mib_table_column((1, 3, 111, 2, 802, 1, 1, 8, 1, 6, 4, 1, 7), row_status()).setMaxAccess('readcreate')
if mibBuilder.loadTexts:
ieee8021CfmMaCompRowStatus.setStatus('current')
ieee8021_cfm_stack_group = object_group((1, 3, 111, 2, 802, 1, 1, 8, 2, 2, 12)).setObjects(('IEEE8021-CFM-V2-MIB', 'ieee8021CfmStackMdIndex'), ('IEEE8021-CFM-V2-MIB', 'ieee8021CfmStackMaIndex'), ('IEEE8021-CFM-V2-MIB', 'ieee8021CfmStackMepId'), ('IEEE8021-CFM-V2-MIB', 'ieee8021CfmStackMacAddress'))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ieee8021_cfm_stack_group = ieee8021CfmStackGroup.setStatus('current')
ieee8021_cfm_ma_group = object_group((1, 3, 111, 2, 802, 1, 1, 8, 2, 2, 13)).setObjects(('IEEE8021-CFM-V2-MIB', 'ieee8021CfmMaCompPrimarySelectorType'), ('IEEE8021-CFM-V2-MIB', 'ieee8021CfmMaCompPrimarySelectorOrNone'), ('IEEE8021-CFM-V2-MIB', 'ieee8021CfmMaCompMhfCreation'), ('IEEE8021-CFM-V2-MIB', 'ieee8021CfmMaCompIdPermission'), ('IEEE8021-CFM-V2-MIB', 'ieee8021CfmMaCompRowStatus'), ('IEEE8021-CFM-V2-MIB', 'ieee8021CfmMaCompNumberOfVids'))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ieee8021_cfm_ma_group = ieee8021CfmMaGroup.setStatus('current')
ieee8021_cfm_default_md_group = object_group((1, 3, 111, 2, 802, 1, 1, 8, 2, 2, 14)).setObjects(('IEEE8021-CFM-V2-MIB', 'ieee8021CfmDefaultMdStatus'), ('IEEE8021-CFM-V2-MIB', 'ieee8021CfmDefaultMdLevel'), ('IEEE8021-CFM-V2-MIB', 'ieee8021CfmDefaultMdMhfCreation'), ('IEEE8021-CFM-V2-MIB', 'ieee8021CfmDefaultMdIdPermission'))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ieee8021_cfm_default_md_group = ieee8021CfmDefaultMdGroup.setStatus('current')
ieee8021_cfm_vlan_id_group = object_group((1, 3, 111, 2, 802, 1, 1, 8, 2, 2, 15)).setObjects(('IEEE8021-CFM-V2-MIB', 'ieee8021CfmVlanPrimarySelector'), ('IEEE8021-CFM-V2-MIB', 'ieee8021CfmVlanRowStatus'))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ieee8021_cfm_vlan_id_group = ieee8021CfmVlanIdGroup.setStatus('current')
ieee8021_cfm_config_error_list_group = object_group((1, 3, 111, 2, 802, 1, 1, 8, 2, 2, 16)).setObjects(('IEEE8021-CFM-V2-MIB', 'ieee8021CfmConfigErrorListErrorType'))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ieee8021_cfm_config_error_list_group = ieee8021CfmConfigErrorListGroup.setStatus('current')
ieee8021_cfm_compliance_v2 = module_compliance((1, 3, 111, 2, 802, 1, 1, 8, 2, 1, 2)).setObjects(('IEEE8021-CFM-V2-MIB', 'ieee8021CfmStackGroup'), ('IEEE8021-CFM-V2-MIB', 'ieee8021CfmMaGroup'), ('IEEE8021-CFM-V2-MIB', 'ieee8021CfmDefaultMdGroup'), ('IEEE8021-CFM-V2-MIB', 'ieee8021CfmConfigErrorListGroup'), ('IEEE8021-CFM-V2-MIB', 'ieee8021CfmVlanIdGroup'), ('IEEE8021-CFM-MIB', 'dot1agCfmMdGroup'), ('IEEE8021-CFM-MIB', 'dot1agCfmMepGroup'), ('IEEE8021-CFM-MIB', 'dot1agCfmMepDbGroup'), ('IEEE8021-CFM-MIB', 'dot1agCfmNotificationsGroup'), ('IEEE8021-CFM-MIB', 'ieee8021CfmDefaultMdDefGroup'), ('IEEE8021-CFM-MIB', 'ieee8021CfmMaNetGroup'))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ieee8021_cfm_compliance_v2 = ieee8021CfmComplianceV2.setStatus('current')
dot1ag_cfm_with_pbb_te_compliance = module_compliance((1, 3, 111, 2, 802, 1, 1, 8, 2, 1, 3)).setObjects(('IEEE8021-CFM-V2-MIB', 'ieee8021CfmStackGroup'), ('IEEE8021-CFM-V2-MIB', 'ieee8021CfmMaGroup'), ('IEEE8021-CFM-V2-MIB', 'ieee8021CfmDefaultMdGroup'), ('IEEE8021-CFM-V2-MIB', 'ieee8021CfmConfigErrorListGroup'), ('IEEE8021-CFM-V2-MIB', 'ieee8021CfmVlanIdGroup'), ('IEEE8021-CFM-MIB', 'dot1agCfmMdGroup'), ('IEEE8021-CFM-MIB', 'dot1agCfmMepGroup'), ('IEEE8021-CFM-MIB', 'dot1agCfmMepDbGroup'), ('IEEE8021-CFM-MIB', 'dot1agCfmNotificationsGroup'), ('IEEE8021-CFM-MIB', 'ieee8021CfmDefaultMdDefGroup'), ('IEEE8021-CFM-MIB', 'ieee8021CfmMaNetGroup'), ('IEEE8021-CFM-MIB', 'ieee8021CfmPbbTeExtensionGroup'), ('IEEE8021-CFM-MIB', 'ieee8021CfmPbbTeTrafficBitGroup'))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
dot1ag_cfm_with_pbb_te_compliance = dot1agCfmWithPbbTeCompliance.setStatus('current')
mibBuilder.exportSymbols('IEEE8021-CFM-V2-MIB', ieee8021CfmDefaultMdStatus=ieee8021CfmDefaultMdStatus, ieee8021CfmDefaultMdComponentId=ieee8021CfmDefaultMdComponentId, ieee8021CfmStackServiceSelectorType=ieee8021CfmStackServiceSelectorType, ieee8021CfmMaCompRowStatus=ieee8021CfmMaCompRowStatus, ieee8021CfmDefaultMdPrimarySelectorType=ieee8021CfmDefaultMdPrimarySelectorType, ieee8021CfmConfigErrorListErrorType=ieee8021CfmConfigErrorListErrorType, ieee8021CfmStackGroup=ieee8021CfmStackGroup, ieee8021CfmVlanEntry=ieee8021CfmVlanEntry, ieee8021CfmDefaultMdMhfCreation=ieee8021CfmDefaultMdMhfCreation, ieee8021CfmConfigErrorListTable=ieee8021CfmConfigErrorListTable, ieee8021CfmMaCompEntry=ieee8021CfmMaCompEntry, ieee8021CfmVlanIdGroup=ieee8021CfmVlanIdGroup, ieee8021CfmConfigErrorListSelectorType=ieee8021CfmConfigErrorListSelectorType, ieee8021CfmMaCompTable=ieee8021CfmMaCompTable, dot1agCfmWithPbbTeCompliance=dot1agCfmWithPbbTeCompliance, ieee8021CfmMaCompMhfCreation=ieee8021CfmMaCompMhfCreation, ieee8021CfmDefaultMdEntry=ieee8021CfmDefaultMdEntry, ieee8021CfmDefaultMdTable=ieee8021CfmDefaultMdTable, ieee8021CfmComplianceV2=ieee8021CfmComplianceV2, ieee8021CfmDefaultMdGroup=ieee8021CfmDefaultMdGroup, ieee8021CfmStackTable=ieee8021CfmStackTable, ieee8021CfmMaComponentId=ieee8021CfmMaComponentId, ieee8021CfmMaCompPrimarySelectorOrNone=ieee8021CfmMaCompPrimarySelectorOrNone, ieee8021CfmStackMepId=ieee8021CfmStackMepId, ieee8021CfmDefaultMdLevel=ieee8021CfmDefaultMdLevel, ieee8021CfmStackMdLevel=ieee8021CfmStackMdLevel, ieee8021CfmConfigErrorListGroup=ieee8021CfmConfigErrorListGroup, ieee8021CfmStackDirection=ieee8021CfmStackDirection, PYSNMP_MODULE_ID=ieee8021CfmV2Mib, ieee8021CfmDefaultMdPrimarySelector=ieee8021CfmDefaultMdPrimarySelector, ieee8021CfmStackServiceSelectorOrNone=ieee8021CfmStackServiceSelectorOrNone, ieee8021CfmMaCompPrimarySelectorType=ieee8021CfmMaCompPrimarySelectorType, ieee8021CfmVlanPrimarySelector=ieee8021CfmVlanPrimarySelector, ieee8021CfmV2Mib=ieee8021CfmV2Mib, ieee8021CfmMaCompIdPermission=ieee8021CfmMaCompIdPermission, ieee8021CfmVlanTable=ieee8021CfmVlanTable, ieee8021CfmConfigErrorListSelector=ieee8021CfmConfigErrorListSelector, ieee8021CfmMaGroup=ieee8021CfmMaGroup, ieee8021CfmVlanSelector=ieee8021CfmVlanSelector, ieee8021CfmStackMacAddress=ieee8021CfmStackMacAddress, ieee8021CfmConfigErrorListEntry=ieee8021CfmConfigErrorListEntry, ieee8021CfmConfigErrorListIfIndex=ieee8021CfmConfigErrorListIfIndex, ieee8021CfmMaCompNumberOfVids=ieee8021CfmMaCompNumberOfVids, ieee8021CfmVlanComponentId=ieee8021CfmVlanComponentId, ieee8021CfmVlanRowStatus=ieee8021CfmVlanRowStatus, ieee8021CfmStackMaIndex=ieee8021CfmStackMaIndex, ieee8021CfmStackMdIndex=ieee8021CfmStackMdIndex, ieee8021CfmStackEntry=ieee8021CfmStackEntry, ieee8021CfmDefaultMdIdPermission=ieee8021CfmDefaultMdIdPermission, ieee8021CfmStackifIndex=ieee8021CfmStackifIndex) |
SPEC = \
{
"input": [
{
"name": "first number",
"type": "int"
},
{
"name": "second number",
"type": "int"
}
],
"output": [
{
"name": "number sum",
"type": "int"
}
],
"package": {
"author": "Stefan Maetschke",
"author_email": "stefan.maetschke@gmail.com",
"description": "Adds two numbers",
"type": "Adder",
"version": "1.0.0"
},
} | spec = {'input': [{'name': 'first number', 'type': 'int'}, {'name': 'second number', 'type': 'int'}], 'output': [{'name': 'number sum', 'type': 'int'}], 'package': {'author': 'Stefan Maetschke', 'author_email': 'stefan.maetschke@gmail.com', 'description': 'Adds two numbers', 'type': 'Adder', 'version': '1.0.0'}} |
class Solution:
# my solution
def removeDuplicates(self, nums: List[int]) -> int:
i = 1
# while i < len(nums):
for j in range(len(nums)-1):
if nums[j] != nums[j+1]:
nums[i] = nums[j+1]
i += 1
return i | class Solution:
def remove_duplicates(self, nums: List[int]) -> int:
i = 1
for j in range(len(nums) - 1):
if nums[j] != nums[j + 1]:
nums[i] = nums[j + 1]
i += 1
return i |
load("@io_bazel_rules_docker//container:providers.bzl", "PushInfo")
def _run_deployment_impl(ctx):
registry = ctx.attr.image_push[PushInfo].registry
repository = ctx.attr.image_push[PushInfo].repository
image = "%s/%s" % (registry, repository)
deploy_deps_string = "\n".join([
label[DefaultInfo].files_to_run.executable.short_path + " " + name
for label, name in ctx.attr.deps.items()
])
env_vars_string = ",".join(["%s=%s" % (k, v) for k, v in ctx.attr.env.items()])
service_name_prefix = ctx.label.name.replace("_", "-")
if service_name_prefix.startswith("deploy-"):
service_name_prefix = service_name_prefix[len("deploy-"):][0:30]
ctx.actions.expand_template(
template = ctx.file._deploy_template,
output = ctx.outputs.deploy_script,
substitutions = {
"{DEPLOY_BIN}": ctx.attr._deploy[DefaultInfo].files_to_run.executable.short_path,
"{DEPLOY_DEPS}": deploy_deps_string,
"{PUSH_IMAGE}": ctx.attr.image_push[DefaultInfo].files_to_run.executable.short_path,
"{IMAGE}": image,
"{ENV_VARS}": env_vars_string,
"{CONCURRENCY}": str(ctx.attr.concurrency),
"{REGION}": ctx.attr.region,
"{MEMORY}": ctx.attr.memory,
"{PROJECT_ID}": ctx.attr.project_id,
"{SERVICE_NAME_PREFIX}": service_name_prefix,
"{GENERATE_UNIQUE_NAME}": str(ctx.attr.generate_unique_name),
},
is_executable = False,
)
runfiles = ctx.runfiles(
files = [
ctx.attr.image_push[PushInfo].digest,
] + ctx.attr.image_push[DefaultInfo].files.to_list(),
)
runfiles = runfiles.merge(ctx.attr.image_push[DefaultInfo].default_runfiles)
runfiles = runfiles.merge(ctx.attr._deploy[DefaultInfo].default_runfiles)
for label in ctx.attr.deps:
runfiles = runfiles.merge(label[DefaultInfo].default_runfiles)
return [
DefaultInfo(
executable = ctx.outputs.deploy_script,
runfiles = runfiles,
),
]
run_deployment = rule(
implementation = _run_deployment_impl,
attrs = {
"env": attr.string_dict(),
"image_push": attr.label(
mandatory = True,
providers = [PushInfo, DefaultInfo],
),
"concurrency": attr.int(
default = 80,
),
"memory": attr.string(
default = "512Mi",
),
"region": attr.string(
default = "europe-west1",
),
"project_id": attr.string(
mandatory = True,
),
"deps": attr.label_keyed_string_dict(),
"generate_unique_name": attr.bool(
default = True,
),
"_deploy_template": attr.label(
default = Label("//run:deploy.sh"),
allow_single_file = True,
),
"_deploy": attr.label(
default = Label("//run/src/main/java/com/github/iljakroonen/rules/run:Deploy"),
),
},
outputs = {
"deploy_script": "%{name}.sh",
},
executable = True,
)
| load('@io_bazel_rules_docker//container:providers.bzl', 'PushInfo')
def _run_deployment_impl(ctx):
registry = ctx.attr.image_push[PushInfo].registry
repository = ctx.attr.image_push[PushInfo].repository
image = '%s/%s' % (registry, repository)
deploy_deps_string = '\n'.join([label[DefaultInfo].files_to_run.executable.short_path + ' ' + name for (label, name) in ctx.attr.deps.items()])
env_vars_string = ','.join(['%s=%s' % (k, v) for (k, v) in ctx.attr.env.items()])
service_name_prefix = ctx.label.name.replace('_', '-')
if service_name_prefix.startswith('deploy-'):
service_name_prefix = service_name_prefix[len('deploy-'):][0:30]
ctx.actions.expand_template(template=ctx.file._deploy_template, output=ctx.outputs.deploy_script, substitutions={'{DEPLOY_BIN}': ctx.attr._deploy[DefaultInfo].files_to_run.executable.short_path, '{DEPLOY_DEPS}': deploy_deps_string, '{PUSH_IMAGE}': ctx.attr.image_push[DefaultInfo].files_to_run.executable.short_path, '{IMAGE}': image, '{ENV_VARS}': env_vars_string, '{CONCURRENCY}': str(ctx.attr.concurrency), '{REGION}': ctx.attr.region, '{MEMORY}': ctx.attr.memory, '{PROJECT_ID}': ctx.attr.project_id, '{SERVICE_NAME_PREFIX}': service_name_prefix, '{GENERATE_UNIQUE_NAME}': str(ctx.attr.generate_unique_name)}, is_executable=False)
runfiles = ctx.runfiles(files=[ctx.attr.image_push[PushInfo].digest] + ctx.attr.image_push[DefaultInfo].files.to_list())
runfiles = runfiles.merge(ctx.attr.image_push[DefaultInfo].default_runfiles)
runfiles = runfiles.merge(ctx.attr._deploy[DefaultInfo].default_runfiles)
for label in ctx.attr.deps:
runfiles = runfiles.merge(label[DefaultInfo].default_runfiles)
return [default_info(executable=ctx.outputs.deploy_script, runfiles=runfiles)]
run_deployment = rule(implementation=_run_deployment_impl, attrs={'env': attr.string_dict(), 'image_push': attr.label(mandatory=True, providers=[PushInfo, DefaultInfo]), 'concurrency': attr.int(default=80), 'memory': attr.string(default='512Mi'), 'region': attr.string(default='europe-west1'), 'project_id': attr.string(mandatory=True), 'deps': attr.label_keyed_string_dict(), 'generate_unique_name': attr.bool(default=True), '_deploy_template': attr.label(default=label('//run:deploy.sh'), allow_single_file=True), '_deploy': attr.label(default=label('//run/src/main/java/com/github/iljakroonen/rules/run:Deploy'))}, outputs={'deploy_script': '%{name}.sh'}, executable=True) |
class Solution:
def trap(self, height: List[int]) -> int:
if not height: return 0
s = []
result = 0
for i in range(len(height)):
while s and height[i] > height[s[-1]]:
top = s.pop()
if not s: break
distance = i - s[-1] - 1
bounded_height = min(height[i], height[s[-1]]) - height[top]
result += distance * bounded_height
s.append(i)
return result
| class Solution:
def trap(self, height: List[int]) -> int:
if not height:
return 0
s = []
result = 0
for i in range(len(height)):
while s and height[i] > height[s[-1]]:
top = s.pop()
if not s:
break
distance = i - s[-1] - 1
bounded_height = min(height[i], height[s[-1]]) - height[top]
result += distance * bounded_height
s.append(i)
return result |
def test_i8():
i: i8
i = 5
print(i)
def test_i16():
i: i16
i = 4
print(i)
def test_i32():
i: i32
i = 3
print(i)
def test_i64():
i: i64
i = 2
print(i)
| def test_i8():
i: i8
i = 5
print(i)
def test_i16():
i: i16
i = 4
print(i)
def test_i32():
i: i32
i = 3
print(i)
def test_i64():
i: i64
i = 2
print(i) |
class MyQueue:
def __init__(self):
self.queue = []
self.behind = -1
self.front = -1
def push(self, x: int) -> None:
self.queue.append(x)
self.behind = self.behind + 1
def pop(self) -> int:
popResult = self.queue.pop(0)
self.front = self.front + 1
return popResult
def peek(self) -> int:
peekResult = self.queue[0]
return peekResult
def empty(self) -> bool:
if self.behind == self.front:
return True
return False
# Your MyQueue object will be instantiated and called as such:
# obj = MyQueue()
# obj.push(x)
# param_2 = obj.pop()
# param_3 = obj.peek()
# param_4 = obj.empty() | class Myqueue:
def __init__(self):
self.queue = []
self.behind = -1
self.front = -1
def push(self, x: int) -> None:
self.queue.append(x)
self.behind = self.behind + 1
def pop(self) -> int:
pop_result = self.queue.pop(0)
self.front = self.front + 1
return popResult
def peek(self) -> int:
peek_result = self.queue[0]
return peekResult
def empty(self) -> bool:
if self.behind == self.front:
return True
return False |
def age_assignment(*args, **kwargs):
result = {}
for n in args:
result[n] = kwargs[n[0]]
return result
| def age_assignment(*args, **kwargs):
result = {}
for n in args:
result[n] = kwargs[n[0]]
return result |
hrs = input("Enter Hours:")
h = float(hrs)
rate = input("Enter rate: ")
r = float(rate)
if h <= 40:
pay = h * r
else:
pay = r * 40 + (r * 1.5) * (h - 40)
print(pay)
| hrs = input('Enter Hours:')
h = float(hrs)
rate = input('Enter rate: ')
r = float(rate)
if h <= 40:
pay = h * r
else:
pay = r * 40 + r * 1.5 * (h - 40)
print(pay) |
f = open("/home/gangserver/dev/data/new.txt", 'r')
while True:
line = f.readline()
if not line: break
print(line)
f.close()
print("*" * 30)
f = open("/home/gangserver/dev/data/new.txt", 'r')
lines = f.readlines()
for line in lines:
print(line)
f.close()
print("*" * 30)
f = open("/home/gangserver/dev/data/new.txt", 'r')
data = f.read()
print(data)
f.close()
| f = open('/home/gangserver/dev/data/new.txt', 'r')
while True:
line = f.readline()
if not line:
break
print(line)
f.close()
print('*' * 30)
f = open('/home/gangserver/dev/data/new.txt', 'r')
lines = f.readlines()
for line in lines:
print(line)
f.close()
print('*' * 30)
f = open('/home/gangserver/dev/data/new.txt', 'r')
data = f.read()
print(data)
f.close() |
s = input()
answer = []
for e in s:
if not e in ["a", "i", "u", "e", "o"]:
answer.append(e)
print("".join(answer)) | s = input()
answer = []
for e in s:
if not e in ['a', 'i', 'u', 'e', 'o']:
answer.append(e)
print(''.join(answer)) |
#inheritance
class Employee:
def __init__(self):
self.__id=10
self._name="ABC"
self.salary=100
class Student(Employee):
def Display(self):
#print(self.__id) unavailable to object
print(self._name)
print(self.salary)
ob=Student()
ob.Display()
print(ob._name,ob.salary)#both unavailable to object
| class Employee:
def __init__(self):
self.__id = 10
self._name = 'ABC'
self.salary = 100
class Student(Employee):
def display(self):
print(self._name)
print(self.salary)
ob = student()
ob.Display()
print(ob._name, ob.salary) |
def normalize(state):
temp_state = []
temp_state.append(0.001*state[0])
temp_state.append((state[1]-2478330.0752)/188151.0787)
temp_state.append((state[2]-9696.347622)/14234.47008)
temp_state.append((state[3]-2515.821571)/2615.29795)
temp_state.append(0.01*state[4])
temp_state.append(0.01*state[5])
temp_state.append(0.01*state[6])
temp_state.append((state[7]-5177.579363)/16123.41258)
temp_state.append((state[8]-270.7733533)/1248.568074)
temp_state.append((state[9]-35.71445465)/269.3077132)
temp_state.append((state[10]-54.79755959)/10.66533212)
temp_state.append((state[11]-52.87394922)/11.70261057)
temp_state.append((state[12]-52.65588396)/8.861974927)
temp_state.append((state[13]-33.72752522)/120.876015)
temp_state.append((state[14]-25.8489596)/122.6781467)
temp_state.append((state[15]-25.2647541)/119.2325979)
temp_state.append((state[16]-29.77151467)/21.96257966)
temp_state.append((state[17]-30.84369715)/21.36197042)
temp_state.append((state[18]-27.72517914)/20.37034246)
return temp_state
| def normalize(state):
temp_state = []
temp_state.append(0.001 * state[0])
temp_state.append((state[1] - 2478330.0752) / 188151.0787)
temp_state.append((state[2] - 9696.347622) / 14234.47008)
temp_state.append((state[3] - 2515.821571) / 2615.29795)
temp_state.append(0.01 * state[4])
temp_state.append(0.01 * state[5])
temp_state.append(0.01 * state[6])
temp_state.append((state[7] - 5177.579363) / 16123.41258)
temp_state.append((state[8] - 270.7733533) / 1248.568074)
temp_state.append((state[9] - 35.71445465) / 269.3077132)
temp_state.append((state[10] - 54.79755959) / 10.66533212)
temp_state.append((state[11] - 52.87394922) / 11.70261057)
temp_state.append((state[12] - 52.65588396) / 8.861974927)
temp_state.append((state[13] - 33.72752522) / 120.876015)
temp_state.append((state[14] - 25.8489596) / 122.6781467)
temp_state.append((state[15] - 25.2647541) / 119.2325979)
temp_state.append((state[16] - 29.77151467) / 21.96257966)
temp_state.append((state[17] - 30.84369715) / 21.36197042)
temp_state.append((state[18] - 27.72517914) / 20.37034246)
return temp_state |
#!/usr/bin/env python3
inp = "(((())))()((((((((())()(()))(()((((()(()(((()((()((()(()()()()()))(((()(()((((((((((())(()()((())()(((())))()(()(()((()(()))(()()()()((()((()(((()()(((((((()()())()((((()()(((((()(())()(())((())()()))()(((((((())(()())(()(((())(()))((())))(()((()())))()())((((())))(()(((((()(())(((()()((()((()((((((((((())(()())))))()))())()()((((()()()()()()((((((())())(((()())()((()()(((()()()))(((((()))(((()(()()()(()(()(((())()))(()(((()((())()(()())())))((()()()(()()(((()))(((()((((()(((((()()(()())((()())())(()((((((()(()()))((((()))))())((())()()((()(()))))((((((((()))(()()(((())())(())()((()()()()((()((()((()()(((())))(()((())()((((((((()((()(()()(((())())())))(())())))()((((()))))))())))()()))()())((()())()((()()()))(()()(((()(())((((())())((((((((()()()()())))()()()((((()()))))))()((((()(((()))(()()())))((()()(((()))()()())())(((())((()()(())()()()(((())))))()())((()))()))((())()()())()())()()(()))())))())()))(())((()(())))(()(())(()))))(()(())())(()(())(()(()))))((()())()))()((((()()))))())))()()())((())()((()()()))()(((()(()))))(())()()))(((()())))))))))(((())))()))())()))))()()(((())))))))()(()()(()))((()))))((())))((()((())))())))()()(()))())()(()((()())(()(()()())())(()()))()))))(()())()()))()()()()))(()(()(()))))))()(()))()))()()(()((())(()(())))()(((())(())())))))()(()(()))))()))(()()()(())()(()(())))()))))()()(((((())))))())()())())())()())()))))()))))))))())()()()()()()())))()))((())()))())))()((())()))))()))())))))))())()()()))()()(()((((()(((((((()(())((()())((()()))()))))(())))()()()(())((())()())))(())))(())))(((()()))()(())(((()(()))((())))())()))((((()))())()))))))))()(())())))(()))()(()()))())()()(())())))())()()(()())))()((()())(()(())(())))))))))))))(()))))()))))))()()())(()(((((()(()())))())()))(()))()))(()()))()())(()))())()(())((()()))))))())))())()(((())))(()(()))()()))()(()))))))((()())(()))))))()())))()()))))))))((((((((()()()(()))))))()())))())))()()((())()))((())(())))())())))()()()((()((()(())))())()(())))))))))()())))()()()()()()))()))((())())(()(()))))))(()()))()))(())))()))))))))))))(()))))))))()))))()))()())()))()()))))))()))))((()))))(()))())()(())))(()())((((()())))()))))(()))()(()()(())))))())))))()))))))())))())))))())))())())))())(()))))(())()(())))())()))((()()))))))())))((())))))))())))(())))))()()())))))())))))()))))))()))()()()(()(((()())())())(()))())))))((()(())(()))))))))(())))()()()())())(()))))()()()))()))())())())()(())))()(((()((((())))))))()))))))))))))))))))))((())()())(()))))()()))))))(()()(())())))())))((())))((())))))))))))))()))))()(()))))))())))))()))(()()())(()())))))))))()))))))(())))))()()))()())(((())))()))(()))))))))(())())))())))())())())()()))((())()(())()())()))()())(())(()))))()())))(()(((()))))))()(()())()()()))()))))))))()()()(())()())()(((((()))()())())(()))))()()()(())))())))()((()())))(()))())()(()())())(()))()()))((()()))((()()()()())))(())()))(()(())))((()()))))))))())))))))())()()))))))))))))))))(())()(())(())()())())()))()(()))))())())))))()())()(()))()()(())))(())())))))(()))))))))))))))())())(())(())))(((()))()))))())((())(()))())))))))())))))())))()))()))))))))))))())()))))()))))((()))(())))()(())))(())()))()))())))())))))))()(()())())))()()())))(())))))(()))))))))))))(()))()))()))())))(((()()()(())((()())))()())(((()))(())()))((()()()())))())(())(()))))()(((((())))(()))())())))))))((((()()()))())())()(()(()())))))))))()())())))(())))()())(((()(())())()()))())())))))))((()())((()()(()))(()(())))()))()))(()))(()))()()(()(((())((((()))()(()))((())()(()(()())()(()))()())))))(()))()))())()())))())))(())))((())(()())))))()))(())(()))()())()(()()((()(()))))))()(())(()())(())()))(((())()))(()()(()()()))))(()(())))()))))())))))())(()()()()()()(((())))(()()))()((())(((((()()())))(()))(()))()()))(((())())()(((()()()()))))(()))(())())))()())(()()())())))))))()))))((())))()())(()))(()(()))())))))())(())))))()()())())()))()()(())))(()))(())((((((())(()))(()))())()))(()()(())))()))(()()))()))()(())))(())))((()(()))(())()()())())))(((()()())(())()))))))()(((()(((((()()(((())(())))())()((()))))((()())()(())(((())))(((()((()(()(()))(()()))())(()))(())(())))()))))))((((()))()((((()(()))()))()()))))()(()(()))()(()((()(((()(()()(((()))))()(((()(()(()(((()(()())())()()(()(()())())(()((((())(()))()))(((((()()())(())()((()()())))()()(((()()))()((((((((()(())))())((()))))(())))(()))))((()((((()()(())(((((()))(((((((((((((()())))((((()(((()((())())()))((()))()(()()((()()()()(()()(()(()(((())()(()((((((()((()()((())()((((()((()()(()()())((()()()((()((())()(()(((()((())((((())(()))((()(()))(()())()((((((((()(((((((((((()))(()(((()(()()()((((())((())()())()))(())((())(()))(((()((()(())))(()))))((()()))))((((()(()(()())(()(())((((((((()((((()((()(((((()))())()(()))(()()((()(())(((((()(())()(((((()()))))))()(((())()(()()((((())()((())((()(((())(((()))((()()((((()(())))))((()((((()((()((()(((())((()))(((((((()(((()((((((((())()))((((())(((((()((((((((()(((()((()(((()()(((()((((((()()(()((((((((()()(()(()(())((((()())()))))(((()))((((())((((()())((()(())()((()((((((()((((((()(())))()())(((())())())()(())()(()())((()()((((())((((((())(()(((((()((((())()((((()(()(())(()())(((())()((())((((()))()((((((())(()(((()(((()((((((()(((()))(()()())())((()((()())()((((())(((()(()(((((((((())(())))()((()()()()(())((()))(((((((()(((((((((()(()))))(()((((((((()((((()((()()((((((()()(((((((()(()(())()(())((()()()((()(((((()())()(((((()())()()((()(()())(()()()(((()()(((((()((((((()()((()(()()()((((((((((((()((((((((()()(((()())))()(((()()(())())((((()((((()((((()()()(())(())((()(()(((((((((((((((()(())(())))))()()))((()(((()(())((()(((()(()()((((()()(((()(((()(((((()()((()(()(((()))((((((()((((((((()((()((())(((((()(((())(())())((()()))((((())()()((()(((()(((((()()(((()))(((()(()(((((((((((((()))((((((((()(((()))))())((((((((((((())((())((()())(((())((())(()((((((((((()(((())((()()(()((())(((((((((((()))((((((((((((()(()())((()((()((()(()(((()((((((((()()(()((()(()(((()))((()))(((((((((((((()(())((((((())(((()(())(()(()(()((()()))((((()((((()((((())))())((((()((((()))((((((()((((((()((()(((())))((())(()))(()((()((((()((()(((()()))((((()()()(((((((())(((())(()))())((((()())(((()(((((((((((()(()(()((()(((((((((((((((()()((((()((((((((()(((()()((()((((()))(((()(())((((((()((((())()((((()((()))(())()(()(((()((())())((((((()(()(())())(((())(()(()())(((((()((()((())()())(())))(((()(())))))))(((()(((()))()((()(((()()((()())()()))())))(((()))(()(((()(((((((((()(()(((((()()(((()())()()))))()(((()))(((()(()(()(()(()))()(())()))(()(((())))(()))))))))))(())((()((())((()(())()(())((()()((((()()((()()))((())(((()((()(())(())))()(()(((((()((()))())()(((((()()(((()(()((((((())(()))(())()))((()(()()))(())())()))(((())))(()((()(((())(())())))((()()((((((((((((((()((()(()()(()(((()))())()()((()()()(())(()))(()())(((())((())()(())()()(()()(())))((()(((()))))(((()()(()()))())((()((())()))((((()()()())((())))(((()(())(((((()(((((()((()(()((((()()(((()()()(((()())(((()()((((())(()))(((()))(())())((()))(((()((()))(((()()((())((()(((((()((((()()())((()))()((((()((()(()()()("
def part1():
result = inp.count("(") - inp.count(")")
print("Final floor: {}".format(result))
def part2():
floor = 0
for i in range(len(inp)):
x = inp[i]
if x == "(":
floor += 1
elif x == ")":
floor -= 1
if floor < 0:
print("Reaches basement at position {}".format(i + 1))
return
print("Santa never reached the basement")
part1()
part2()
| inp = '(((())))()((((((((())()(()))(()((((()(()(((()((()((()(()()()()()))(((()(()((((((((((())(()()((())()(((())))()(()(()((()(()))(()()()()((()((()(((()()(((((((()()())()((((()()(((((()(())()(())((())()()))()(((((((())(()())(()(((())(()))((())))(()((()())))()())((((())))(()(((((()(())(((()()((()((()((((((((((())(()())))))()))())()()((((()()()()()()((((((())())(((()())()((()()(((()()()))(((((()))(((()(()()()(()(()(((())()))(()(((()((())()(()())())))((()()()(()()(((()))(((()((((()(((((()()(()())((()())())(()((((((()(()()))((((()))))())((())()()((()(()))))((((((((()))(()()(((())())(())()((()()()()((()((()((()()(((())))(()((())()((((((((()((()(()()(((())())())))(())())))()((((()))))))())))()()))()())((()())()((()()()))(()()(((()(())((((())())((((((((()()()()())))()()()((((()()))))))()((((()(((()))(()()())))((()()(((()))()()())())(((())((()()(())()()()(((())))))()())((()))()))((())()()())()())()()(()))())))())()))(())((()(())))(()(())(()))))(()(())())(()(())(()(()))))((()())()))()((((()()))))())))()()())((())()((()()()))()(((()(()))))(())()()))(((()())))))))))(((())))()))())()))))()()(((())))))))()(()()(()))((()))))((())))((()((())))())))()()(()))())()(()((()())(()(()()())())(()()))()))))(()())()()))()()()()))(()(()(()))))))()(()))()))()()(()((())(()(())))()(((())(())())))))()(()(()))))()))(()()()(())()(()(())))()))))()()(((((())))))())()())())())()())()))))()))))))))())()()()()()()())))()))((())()))())))()((())()))))()))())))))))())()()()))()()(()((((()(((((((()(())((()())((()()))()))))(())))()()()(())((())()())))(())))(())))(((()()))()(())(((()(()))((())))())()))((((()))())()))))))))()(())())))(()))()(()()))())()()(())())))())()()(()())))()((()())(()(())(())))))))))))))(()))))()))))))()()())(()(((((()(()())))())()))(()))()))(()()))()())(()))())()(())((()()))))))())))())()(((())))(()(()))()()))()(()))))))((()())(()))))))()())))()()))))))))((((((((()()()(()))))))()())))())))()()((())()))((())(())))())())))()()()((()((()(())))())()(())))))))))()())))()()()()()()))()))((())())(()(()))))))(()()))()))(())))()))))))))))))(()))))))))()))))()))()())()))()()))))))()))))((()))))(()))())()(())))(()())((((()())))()))))(()))()(()()(())))))())))))()))))))())))())))))())))())())))())(()))))(())()(())))())()))((()()))))))())))((())))))))())))(())))))()()())))))())))))()))))))()))()()()(()(((()())())())(()))())))))((()(())(()))))))))(())))()()()())())(()))))()()()))()))())())())()(())))()(((()((((())))))))()))))))))))))))))))))((())()())(()))))()()))))))(()()(())())))())))((())))((())))))))))))))()))))()(()))))))())))))()))(()()())(()())))))))))()))))))(())))))()()))()())(((())))()))(()))))))))(())())))())))())())())()()))((())()(())()())()))()())(())(()))))()())))(()(((()))))))()(()())()()()))()))))))))()()()(())()())()(((((()))()())())(()))))()()()(())))())))()((()())))(()))())()(()())())(()))()()))((()()))((()()()()())))(())()))(()(())))((()()))))))))())))))))())()()))))))))))))))))(())()(())(())()())())()))()(()))))())())))))()())()(()))()()(())))(())())))))(()))))))))))))))())())(())(())))(((()))()))))())((())(()))())))))))())))))())))()))()))))))))))))())()))))()))))((()))(())))()(())))(())()))()))())))())))))))()(()())())))()()())))(())))))(()))))))))))))(()))()))()))())))(((()()()(())((()())))()())(((()))(())()))((()()()())))())(())(()))))()(((((())))(()))())())))))))((((()()()))())())()(()(()())))))))))()())())))(())))()())(((()(())())()()))())())))))))((()())((()()(()))(()(())))()))()))(()))(()))()()(()(((())((((()))()(()))((())()(()(()())()(()))()())))))(()))()))())()())))())))(())))((())(()())))))()))(())(()))()())()(()()((()(()))))))()(())(()())(())()))(((())()))(()()(()()()))))(()(())))()))))())))))())(()()()()()()(((())))(()()))()((())(((((()()())))(()))(()))()()))(((())())()(((()()()()))))(()))(())())))()())(()()())())))))))()))))((())))()())(()))(()(()))())))))())(())))))()()())())()))()()(())))(()))(())((((((())(()))(()))())()))(()()(())))()))(()()))()))()(())))(())))((()(()))(())()()())())))(((()()())(())()))))))()(((()(((((()()(((())(())))())()((()))))((()())()(())(((())))(((()((()(()(()))(()()))())(()))(())(())))()))))))((((()))()((((()(()))()))()()))))()(()(()))()(()((()(((()(()()(((()))))()(((()(()(()(((()(()())())()()(()(()())())(()((((())(()))()))(((((()()())(())()((()()())))()()(((()()))()((((((((()(())))())((()))))(())))(()))))((()((((()()(())(((((()))(((((((((((((()())))((((()(((()((())())()))((()))()(()()((()()()()(()()(()(()(((())()(()((((((()((()()((())()((((()((()()(()()())((()()()((()((())()(()(((()((())((((())(()))((()(()))(()())()((((((((()(((((((((((()))(()(((()(()()()((((())((())()())()))(())((())(()))(((()((()(())))(()))))((()()))))((((()(()(()())(()(())((((((((()((((()((()(((((()))())()(()))(()()((()(())(((((()(())()(((((()()))))))()(((())()(()()((((())()((())((()(((())(((()))((()()((((()(())))))((()((((()((()((()(((())((()))(((((((()(((()((((((((())()))((((())(((((()((((((((()(((()((()(((()()(((()((((((()()(()((((((((()()(()(()(())((((()())()))))(((()))((((())((((()())((()(())()((()((((((()((((((()(())))()())(((())())())()(())()(()())((()()((((())((((((())(()(((((()((((())()((((()(()(())(()())(((())()((())((((()))()((((((())(()(((()(((()((((((()(((()))(()()())())((()((()())()((((())(((()(()(((((((((())(())))()((()()()()(())((()))(((((((()(((((((((()(()))))(()((((((((()((((()((()()((((((()()(((((((()(()(())()(())((()()()((()(((((()())()(((((()())()()((()(()())(()()()(((()()(((((()((((((()()((()(()()()((((((((((((()((((((((()()(((()())))()(((()()(())())((((()((((()((((()()()(())(())((()(()(((((((((((((((()(())(())))))()()))((()(((()(())((()(((()(()()((((()()(((()(((()(((((()()((()(()(((()))((((((()((((((((()((()((())(((((()(((())(())())((()()))((((())()()((()(((()(((((()()(((()))(((()(()(((((((((((((()))((((((((()(((()))))())((((((((((((())((())((()())(((())((())(()((((((((((()(((())((()()(()((())(((((((((((()))((((((((((((()(()())((()((()((()(()(((()((((((((()()(()((()(()(((()))((()))(((((((((((((()(())((((((())(((()(())(()(()(()((()()))((((()((((()((((())))())((((()((((()))((((((()((((((()((()(((())))((())(()))(()((()((((()((()(((()()))((((()()()(((((((())(((())(()))())((((()())(((()(((((((((((()(()(()((()(((((((((((((((()()((((()((((((((()(((()()((()((((()))(((()(())((((((()((((())()((((()((()))(())()(()(((()((())())((((((()(()(())())(((())(()(()())(((((()((()((())()())(())))(((()(())))))))(((()(((()))()((()(((()()((()())()()))())))(((()))(()(((()(((((((((()(()(((((()()(((()())()()))))()(((()))(((()(()(()(()(()))()(())()))(()(((())))(()))))))))))(())((()((())((()(())()(())((()()((((()()((()()))((())(((()((()(())(())))()(()(((((()((()))())()(((((()()(((()(()((((((())(()))(())()))((()(()()))(())())()))(((())))(()((()(((())(())())))((()()((((((((((((((()((()(()()(()(((()))())()()((()()()(())(()))(()())(((())((())()(())()()(()()(())))((()(((()))))(((()()(()()))())((()((())()))((((()()()())((())))(((()(())(((((()(((((()((()(()((((()()(((()()()(((()())(((()()((((())(()))(((()))(())())((()))(((()((()))(((()()((())((()(((((()((((()()())((()))()((((()((()(()()()('
def part1():
result = inp.count('(') - inp.count(')')
print('Final floor: {}'.format(result))
def part2():
floor = 0
for i in range(len(inp)):
x = inp[i]
if x == '(':
floor += 1
elif x == ')':
floor -= 1
if floor < 0:
print('Reaches basement at position {}'.format(i + 1))
return
print('Santa never reached the basement')
part1()
part2() |
INPUT_DIR = "/mnt/input"
OUTPUT_DIR = "/mnt/output"
CONFIG_FILE_NAME = 'config.yml'
CONFIG_SECTION = 'fc_survival_svm'
| input_dir = '/mnt/input'
output_dir = '/mnt/output'
config_file_name = 'config.yml'
config_section = 'fc_survival_svm' |
if __name__ == '__main__':
for _ in range(int(input())):
a = int(input())
A = set(map(int,input().split()))
b = int(input())
B = set(map(int,input().split()))
# if len(A-B) == 0:
# print(True)
# else:
# print(False)
# print(not bool(A.difference(B)))
# print( A.intersection(B) == A)
print(A.issubset(B))
# for _ in range(int(input())):
# x, a, z, b = input(), set(input().split()), input(), set(input().split())
# print(a.issubset(b))
# for i in range(int(input())):
# input()
# A = set(input().split())
# input()
# B = set(input().split())
# print(A <= B)
| if __name__ == '__main__':
for _ in range(int(input())):
a = int(input())
a = set(map(int, input().split()))
b = int(input())
b = set(map(int, input().split()))
print(A.issubset(B)) |
class Node:
def __init__(self, val):
self.val = val
self.next = None
class SinglyLinkedList:
def __init__(self):
self.head = None
def add(self, val):
curNode = self.head
while(curNode.next != None):
curNode = curNode.next
curNode.next = Node(val)
def printLinkedList(self):
curNode = self.head
while(curNode != None):
print(curNode.val)
curNode = curNode.next
list1 = SinglyLinkedList()
list1.head = Node(2)
print(list1.head.val)
| class Node:
def __init__(self, val):
self.val = val
self.next = None
class Singlylinkedlist:
def __init__(self):
self.head = None
def add(self, val):
cur_node = self.head
while curNode.next != None:
cur_node = curNode.next
curNode.next = node(val)
def print_linked_list(self):
cur_node = self.head
while curNode != None:
print(curNode.val)
cur_node = curNode.next
list1 = singly_linked_list()
list1.head = node(2)
print(list1.head.val) |
# Reversing linked list.
class Node:
def __init__(self, cargo=None, next=None):
self.cargo = cargo
self.next = next
def __str__(self):
return str(self.cargo)
class SimpleLinkedList:
def __init__(self, init_values=[]):
self.length = 0
self.head = None
if len(init_values) > 0:
for value in init_values:
self.insert(value)
def is_empty(self):
return self.head == 0
def insert(self, cargo):
node = Node(cargo)
if self.head is None:
self.head = node
else:
curr = self.head
while curr.next:
curr = curr.next
curr.next = node
self.length += 1
def remove(self):
if self.head is None:
return None
else:
top = self.head
self.head = self.head.next
self.length -= 1
return top
def reverse(self):
previous = None
current = self.head
if self.head is None:
return None
while current.next:
next = current.next
current.next = previous
previous = current
current = next
current.next = previous
self.head = current
linked_list = SimpleLinkedList(init_values=[1, 2, 3, 4, 5])
linked_list.reverse()
| class Node:
def __init__(self, cargo=None, next=None):
self.cargo = cargo
self.next = next
def __str__(self):
return str(self.cargo)
class Simplelinkedlist:
def __init__(self, init_values=[]):
self.length = 0
self.head = None
if len(init_values) > 0:
for value in init_values:
self.insert(value)
def is_empty(self):
return self.head == 0
def insert(self, cargo):
node = node(cargo)
if self.head is None:
self.head = node
else:
curr = self.head
while curr.next:
curr = curr.next
curr.next = node
self.length += 1
def remove(self):
if self.head is None:
return None
else:
top = self.head
self.head = self.head.next
self.length -= 1
return top
def reverse(self):
previous = None
current = self.head
if self.head is None:
return None
while current.next:
next = current.next
current.next = previous
previous = current
current = next
current.next = previous
self.head = current
linked_list = simple_linked_list(init_values=[1, 2, 3, 4, 5])
linked_list.reverse() |
'''
Facebook error classes also see
http://fbdevwiki.com/wiki/Error_codes#User_Permission_Errors
'''
class OpenFacebookException(Exception):
'''
BaseClass for all open facebook errors
'''
@classmethod
def codes_list(cls):
'''
Returns the codes as a list of instructions
'''
if hasattr(cls, 'codes'):
codes_list = [cls.codes]
if isinstance(cls.codes, list):
codes_list = cls.codes
return codes_list
@classmethod
def range(cls):
'''
Returns for how many codes this Exception, matches with the eventual
goal of matching an error to the most specific error class
'''
range = 0
codes_list = cls.codes_list()
for c in codes_list:
if isinstance(c, tuple):
start, stop = c
range += stop - start + 1
else:
range += 1
#make sure none specific exceptions are last in the order
if not range:
range = 1000
return range
class ParameterException(OpenFacebookException):
'''
100-200
'''
codes = (100, 199)
class UnknownException(OpenFacebookException):
'''
Raised when facebook themselves don't know what went wrong
'''
codes = 1
class OAuthException(OpenFacebookException):
pass
class PermissionException(OAuthException):
'''
200-300
'''
codes = [3, (200, 299)]
class UserPermissionException(PermissionException):
codes = (300, 399)
class FeedActionLimit(UserPermissionException):
'''
When you posted too many times from one user acount
'''
codes = 341
class DuplicateStatusMessage(OpenFacebookException):
codes = 506
class MissingParameter(OpenFacebookException):
pass
class AliasException(OpenFacebookException):
'''
When you send a request to a non existant url facebook gives this error
instead of a 404....
'''
codes = 803
| """
Facebook error classes also see
http://fbdevwiki.com/wiki/Error_codes#User_Permission_Errors
"""
class Openfacebookexception(Exception):
"""
BaseClass for all open facebook errors
"""
@classmethod
def codes_list(cls):
"""
Returns the codes as a list of instructions
"""
if hasattr(cls, 'codes'):
codes_list = [cls.codes]
if isinstance(cls.codes, list):
codes_list = cls.codes
return codes_list
@classmethod
def range(cls):
"""
Returns for how many codes this Exception, matches with the eventual
goal of matching an error to the most specific error class
"""
range = 0
codes_list = cls.codes_list()
for c in codes_list:
if isinstance(c, tuple):
(start, stop) = c
range += stop - start + 1
else:
range += 1
if not range:
range = 1000
return range
class Parameterexception(OpenFacebookException):
"""
100-200
"""
codes = (100, 199)
class Unknownexception(OpenFacebookException):
"""
Raised when facebook themselves don't know what went wrong
"""
codes = 1
class Oauthexception(OpenFacebookException):
pass
class Permissionexception(OAuthException):
"""
200-300
"""
codes = [3, (200, 299)]
class Userpermissionexception(PermissionException):
codes = (300, 399)
class Feedactionlimit(UserPermissionException):
"""
When you posted too many times from one user acount
"""
codes = 341
class Duplicatestatusmessage(OpenFacebookException):
codes = 506
class Missingparameter(OpenFacebookException):
pass
class Aliasexception(OpenFacebookException):
"""
When you send a request to a non existant url facebook gives this error
instead of a 404....
"""
codes = 803 |
def add_native_methods(clazz):
def SCardEstablishContext__int__(a0):
raise NotImplementedError()
def SCardListReaders__long__(a0):
raise NotImplementedError()
def SCardConnect__long__java_lang_String__int__int__(a0, a1, a2, a3):
raise NotImplementedError()
def SCardTransmit__long__int__byte____int__int__(a0, a1, a2, a3, a4):
raise NotImplementedError()
def SCardStatus__long__byte____(a0, a1):
raise NotImplementedError()
def SCardDisconnect__long__int__(a0, a1):
raise NotImplementedError()
def SCardGetStatusChange__long__long__int____java_lang_String____(a0, a1, a2, a3):
raise NotImplementedError()
def SCardBeginTransaction__long__(a0):
raise NotImplementedError()
def SCardEndTransaction__long__int__(a0, a1):
raise NotImplementedError()
def SCardControl__long__int__byte____(a0, a1, a2):
raise NotImplementedError()
clazz.SCardEstablishContext__int__ = staticmethod(SCardEstablishContext__int__)
clazz.SCardListReaders__long__ = staticmethod(SCardListReaders__long__)
clazz.SCardConnect__long__java_lang_String__int__int__ = staticmethod(SCardConnect__long__java_lang_String__int__int__)
clazz.SCardTransmit__long__int__byte____int__int__ = staticmethod(SCardTransmit__long__int__byte____int__int__)
clazz.SCardStatus__long__byte____ = staticmethod(SCardStatus__long__byte____)
clazz.SCardDisconnect__long__int__ = staticmethod(SCardDisconnect__long__int__)
clazz.SCardGetStatusChange__long__long__int____java_lang_String____ = staticmethod(SCardGetStatusChange__long__long__int____java_lang_String____)
clazz.SCardBeginTransaction__long__ = staticmethod(SCardBeginTransaction__long__)
clazz.SCardEndTransaction__long__int__ = staticmethod(SCardEndTransaction__long__int__)
clazz.SCardControl__long__int__byte____ = staticmethod(SCardControl__long__int__byte____)
| def add_native_methods(clazz):
def s_card_establish_context__int__(a0):
raise not_implemented_error()
def s_card_list_readers__long__(a0):
raise not_implemented_error()
def s_card_connect__long__java_lang__string__int__int__(a0, a1, a2, a3):
raise not_implemented_error()
def s_card_transmit__long__int__byte____int__int__(a0, a1, a2, a3, a4):
raise not_implemented_error()
def s_card_status__long__byte____(a0, a1):
raise not_implemented_error()
def s_card_disconnect__long__int__(a0, a1):
raise not_implemented_error()
def s_card_get_status_change__long__long__int____java_lang__string____(a0, a1, a2, a3):
raise not_implemented_error()
def s_card_begin_transaction__long__(a0):
raise not_implemented_error()
def s_card_end_transaction__long__int__(a0, a1):
raise not_implemented_error()
def s_card_control__long__int__byte____(a0, a1, a2):
raise not_implemented_error()
clazz.SCardEstablishContext__int__ = staticmethod(SCardEstablishContext__int__)
clazz.SCardListReaders__long__ = staticmethod(SCardListReaders__long__)
clazz.SCardConnect__long__java_lang_String__int__int__ = staticmethod(SCardConnect__long__java_lang_String__int__int__)
clazz.SCardTransmit__long__int__byte____int__int__ = staticmethod(SCardTransmit__long__int__byte____int__int__)
clazz.SCardStatus__long__byte____ = staticmethod(SCardStatus__long__byte____)
clazz.SCardDisconnect__long__int__ = staticmethod(SCardDisconnect__long__int__)
clazz.SCardGetStatusChange__long__long__int____java_lang_String____ = staticmethod(SCardGetStatusChange__long__long__int____java_lang_String____)
clazz.SCardBeginTransaction__long__ = staticmethod(SCardBeginTransaction__long__)
clazz.SCardEndTransaction__long__int__ = staticmethod(SCardEndTransaction__long__int__)
clazz.SCardControl__long__int__byte____ = staticmethod(SCardControl__long__int__byte____) |
def check_ticket(char, string, integer):
if integer == 20:
print(f'ticket "{string}" - {integer/2:.0f}{char} Jackpot!')
return True
left_part = string[:10]
right_part = string[10:]
is_found = False
left_counter = 0
right_counter = 0
for el in left_part: # 2 "for" cycles to count the symbols in each parts
if el == char:
left_counter += 1
is_found = True
else:
if is_found:
break
is_found = False
for el in right_part:
if el == char:
right_counter += 1
is_found = True
else:
if is_found:
break
mina = min(left_counter, right_counter)
if left_counter in range(6, 11) and right_counter in range(6, 11):
print(f'ticket "{string}" - {mina}{char}')
return True
return False
tickets = [el.strip() for el in input().split(", ")]
symbol = ''
for el in tickets:
result = False
len_el = len(el)
if len_el == 20:
kliomba = el.count("@")
dollar = el.count("$")
ogradka = el.count("#")
kyshta = el.count("^")
digit = max(kliomba, dollar, ogradka, kyshta)
if kliomba in range(12, 21):
symbol = "@"
result = check_ticket(symbol, el, digit)
elif dollar in range(12, 21):
symbol = "$"
result = check_ticket(symbol, el, digit)
elif ogradka in range(12, 21):
symbol = "#"
result = check_ticket(symbol, el, digit)
elif kyshta in range(12, 21):
symbol = "^"
result = check_ticket(symbol, el, digit)
if not result:
print(f'ticket "{el}" - no match')
else:
print("invalid ticket") | def check_ticket(char, string, integer):
if integer == 20:
print(f'ticket "{string}" - {integer / 2:.0f}{char} Jackpot!')
return True
left_part = string[:10]
right_part = string[10:]
is_found = False
left_counter = 0
right_counter = 0
for el in left_part:
if el == char:
left_counter += 1
is_found = True
elif is_found:
break
is_found = False
for el in right_part:
if el == char:
right_counter += 1
is_found = True
elif is_found:
break
mina = min(left_counter, right_counter)
if left_counter in range(6, 11) and right_counter in range(6, 11):
print(f'ticket "{string}" - {mina}{char}')
return True
return False
tickets = [el.strip() for el in input().split(', ')]
symbol = ''
for el in tickets:
result = False
len_el = len(el)
if len_el == 20:
kliomba = el.count('@')
dollar = el.count('$')
ogradka = el.count('#')
kyshta = el.count('^')
digit = max(kliomba, dollar, ogradka, kyshta)
if kliomba in range(12, 21):
symbol = '@'
result = check_ticket(symbol, el, digit)
elif dollar in range(12, 21):
symbol = '$'
result = check_ticket(symbol, el, digit)
elif ogradka in range(12, 21):
symbol = '#'
result = check_ticket(symbol, el, digit)
elif kyshta in range(12, 21):
symbol = '^'
result = check_ticket(symbol, el, digit)
if not result:
print(f'ticket "{el}" - no match')
else:
print('invalid ticket') |
class BaseModelConfig(object):
scheduler: dict
concurrency_limiter: dict
early_stopping: dict
score_function: dict
reporter: dict
tune_best_trial: dict
stopper: dict
tune_run: dict
optuna_search: dict = {}
# used for creating groups during train/val split in hp optimization
essential_properties: list
# default model setup
model_setup: dict
# transformer specs
transformer_specs: list
| class Basemodelconfig(object):
scheduler: dict
concurrency_limiter: dict
early_stopping: dict
score_function: dict
reporter: dict
tune_best_trial: dict
stopper: dict
tune_run: dict
optuna_search: dict = {}
essential_properties: list
model_setup: dict
transformer_specs: list |
name = input()
def foo(name):
print("Hello, world! Hello, "+name)
foo(name) | name = input()
def foo(name):
print('Hello, world! Hello, ' + name)
foo(name) |
n = int(input())
flag = True
if n == 1 or n == 2:
flag = True
if n % 2 == 0:
flag = False
else:
i = 3
while i*i <= n:
if n % i == 0:
flag = False
break
i += 2
if flag == True:
print("N")
else:
print("S") | n = int(input())
flag = True
if n == 1 or n == 2:
flag = True
if n % 2 == 0:
flag = False
else:
i = 3
while i * i <= n:
if n % i == 0:
flag = False
break
i += 2
if flag == True:
print('N')
else:
print('S') |
def greet(val):
return 'Hello, ' + val + '!'
print(greet('pah'))
| def greet(val):
return 'Hello, ' + val + '!'
print(greet('pah')) |
class Events:
ALWAYS = "ALWAYS"
ON_LOGIN = "ON_LOGIN"
ON_ITEM_DONE = "ON_ITEM_DONE"
| class Events:
always = 'ALWAYS'
on_login = 'ON_LOGIN'
on_item_done = 'ON_ITEM_DONE' |
#
# PySNMP MIB module HM2-DNS-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/HM2-DNS-MIB
# Produced by pysmi-0.3.4 at Mon Apr 29 19:18:37 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")
ValueRangeConstraint, ValueSizeConstraint, ConstraintsIntersection, SingleValueConstraint, ConstraintsUnion = mibBuilder.importSymbols("ASN1-REFINEMENT", "ValueRangeConstraint", "ValueSizeConstraint", "ConstraintsIntersection", "SingleValueConstraint", "ConstraintsUnion")
HmActionValue, hm2ConfigurationMibs, HmEnabledStatus = mibBuilder.importSymbols("HM2-TC-MIB", "HmActionValue", "hm2ConfigurationMibs", "HmEnabledStatus")
InetAddressType, InetAddress = mibBuilder.importSymbols("INET-ADDRESS-MIB", "InetAddressType", "InetAddress")
SnmpAdminString, = mibBuilder.importSymbols("SNMP-FRAMEWORK-MIB", "SnmpAdminString")
ModuleCompliance, NotificationGroup = mibBuilder.importSymbols("SNMPv2-CONF", "ModuleCompliance", "NotificationGroup")
TimeTicks, Unsigned32, MibIdentifier, Counter32, ModuleIdentity, Bits, NotificationType, ObjectIdentity, IpAddress, MibScalar, MibTable, MibTableRow, MibTableColumn, Counter64, iso, Gauge32, Integer32 = mibBuilder.importSymbols("SNMPv2-SMI", "TimeTicks", "Unsigned32", "MibIdentifier", "Counter32", "ModuleIdentity", "Bits", "NotificationType", "ObjectIdentity", "IpAddress", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "Counter64", "iso", "Gauge32", "Integer32")
TextualConvention, DisplayString, RowStatus = mibBuilder.importSymbols("SNMPv2-TC", "TextualConvention", "DisplayString", "RowStatus")
hm2DnsMib = ModuleIdentity((1, 3, 6, 1, 4, 1, 248, 11, 90))
hm2DnsMib.setRevisions(('2011-06-17 00:00',))
if mibBuilder.loadTexts: hm2DnsMib.setLastUpdated('201106170000Z')
if mibBuilder.loadTexts: hm2DnsMib.setOrganization('Hirschmann Automation and Control GmbH')
hm2DnsMibNotifications = MibIdentifier((1, 3, 6, 1, 4, 1, 248, 11, 90, 0))
hm2DnsMibObjects = MibIdentifier((1, 3, 6, 1, 4, 1, 248, 11, 90, 1))
hm2DnsMibSNMPExtensionGroup = MibIdentifier((1, 3, 6, 1, 4, 1, 248, 11, 90, 3))
hm2DnsClientGroup = MibIdentifier((1, 3, 6, 1, 4, 1, 248, 11, 90, 1, 1))
hm2DnsCacheGroup = MibIdentifier((1, 3, 6, 1, 4, 1, 248, 11, 90, 1, 2))
hm2DnsCachingServerGroup = MibIdentifier((1, 3, 6, 1, 4, 1, 248, 11, 90, 1, 3))
hm2DnsClientAdminState = MibScalar((1, 3, 6, 1, 4, 1, 248, 11, 90, 1, 1, 1), HmEnabledStatus().clone('disable')).setMaxAccess("readwrite")
if mibBuilder.loadTexts: hm2DnsClientAdminState.setStatus('current')
hm2DnsClientConfigSource = MibScalar((1, 3, 6, 1, 4, 1, 248, 11, 90, 1, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("user", 1), ("mgmt-dhcp", 2), ("provider", 3))).clone('mgmt-dhcp')).setMaxAccess("readwrite")
if mibBuilder.loadTexts: hm2DnsClientConfigSource.setStatus('current')
hm2DnsClientServerCfgTable = MibTable((1, 3, 6, 1, 4, 1, 248, 11, 90, 1, 1, 3), )
if mibBuilder.loadTexts: hm2DnsClientServerCfgTable.setStatus('current')
hm2DnsClientServerCfgEntry = MibTableRow((1, 3, 6, 1, 4, 1, 248, 11, 90, 1, 1, 3, 1), ).setIndexNames((0, "HM2-DNS-MIB", "hm2DnsClientServerIndex"))
if mibBuilder.loadTexts: hm2DnsClientServerCfgEntry.setStatus('current')
hm2DnsClientServerIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 248, 11, 90, 1, 1, 3, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 4)))
if mibBuilder.loadTexts: hm2DnsClientServerIndex.setStatus('current')
hm2DnsClientServerAddressType = MibTableColumn((1, 3, 6, 1, 4, 1, 248, 11, 90, 1, 1, 3, 1, 2), InetAddressType().clone('ipv4')).setMaxAccess("readwrite")
if mibBuilder.loadTexts: hm2DnsClientServerAddressType.setStatus('current')
hm2DnsClientServerAddress = MibTableColumn((1, 3, 6, 1, 4, 1, 248, 11, 90, 1, 1, 3, 1, 3), InetAddress().clone(hexValue="00000000")).setMaxAccess("readwrite")
if mibBuilder.loadTexts: hm2DnsClientServerAddress.setStatus('current')
hm2DnsClientServerRowStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 248, 11, 90, 1, 1, 3, 1, 4), RowStatus()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: hm2DnsClientServerRowStatus.setStatus('current')
hm2DnsClientServerDiagTable = MibTable((1, 3, 6, 1, 4, 1, 248, 11, 90, 1, 1, 4), )
if mibBuilder.loadTexts: hm2DnsClientServerDiagTable.setStatus('current')
hm2DnsClientServerDiagEntry = MibTableRow((1, 3, 6, 1, 4, 1, 248, 11, 90, 1, 1, 4, 1), ).setIndexNames((0, "HM2-DNS-MIB", "hm2DnsClientServerDiagIndex"))
if mibBuilder.loadTexts: hm2DnsClientServerDiagEntry.setStatus('current')
hm2DnsClientServerDiagIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 248, 11, 90, 1, 1, 4, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 4)))
if mibBuilder.loadTexts: hm2DnsClientServerDiagIndex.setStatus('current')
hm2DnsClientServerDiagAddressType = MibTableColumn((1, 3, 6, 1, 4, 1, 248, 11, 90, 1, 1, 4, 1, 2), InetAddressType()).setMaxAccess("readonly")
if mibBuilder.loadTexts: hm2DnsClientServerDiagAddressType.setStatus('current')
hm2DnsClientServerDiagAddress = MibTableColumn((1, 3, 6, 1, 4, 1, 248, 11, 90, 1, 1, 4, 1, 3), InetAddress()).setMaxAccess("readonly")
if mibBuilder.loadTexts: hm2DnsClientServerDiagAddress.setStatus('current')
hm2DnsClientGlobalGroup = MibIdentifier((1, 3, 6, 1, 4, 1, 248, 11, 90, 1, 1, 5))
hm2DnsClientDefaultDomainName = MibScalar((1, 3, 6, 1, 4, 1, 248, 11, 90, 1, 1, 5, 1), SnmpAdminString().subtype(subtypeSpec=ValueSizeConstraint(0, 255))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: hm2DnsClientDefaultDomainName.setStatus('current')
hm2DnsClientRequestTimeout = MibScalar((1, 3, 6, 1, 4, 1, 248, 11, 90, 1, 1, 5, 2), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 3600)).clone(3)).setMaxAccess("readwrite")
if mibBuilder.loadTexts: hm2DnsClientRequestTimeout.setStatus('current')
hm2DnsClientRequestRetransmits = MibScalar((1, 3, 6, 1, 4, 1, 248, 11, 90, 1, 1, 5, 3), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 100)).clone(2)).setMaxAccess("readwrite")
if mibBuilder.loadTexts: hm2DnsClientRequestRetransmits.setStatus('current')
hm2DnsClientCacheAdminState = MibScalar((1, 3, 6, 1, 4, 1, 248, 11, 90, 1, 1, 5, 4), HmEnabledStatus().clone('enable')).setMaxAccess("readwrite")
if mibBuilder.loadTexts: hm2DnsClientCacheAdminState.setStatus('current')
hm2DnsClientStaticHostConfigTable = MibTable((1, 3, 6, 1, 4, 1, 248, 11, 90, 1, 1, 6), )
if mibBuilder.loadTexts: hm2DnsClientStaticHostConfigTable.setStatus('current')
hm2DnsClientStaticHostConfigEntry = MibTableRow((1, 3, 6, 1, 4, 1, 248, 11, 90, 1, 1, 6, 1), ).setIndexNames((0, "HM2-DNS-MIB", "hm2DnsClientStaticIndex"))
if mibBuilder.loadTexts: hm2DnsClientStaticHostConfigEntry.setStatus('current')
hm2DnsClientStaticIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 248, 11, 90, 1, 1, 6, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 64)))
if mibBuilder.loadTexts: hm2DnsClientStaticIndex.setStatus('current')
hm2DnsClientStaticHostName = MibTableColumn((1, 3, 6, 1, 4, 1, 248, 11, 90, 1, 1, 6, 1, 2), SnmpAdminString().subtype(subtypeSpec=ValueSizeConstraint(0, 255))).setMaxAccess("readcreate")
if mibBuilder.loadTexts: hm2DnsClientStaticHostName.setStatus('current')
hm2DnsClientStaticHostAddressType = MibTableColumn((1, 3, 6, 1, 4, 1, 248, 11, 90, 1, 1, 6, 1, 3), InetAddressType()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: hm2DnsClientStaticHostAddressType.setStatus('current')
hm2DnsClientStaticHostIPAddress = MibTableColumn((1, 3, 6, 1, 4, 1, 248, 11, 90, 1, 1, 6, 1, 4), InetAddress()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: hm2DnsClientStaticHostIPAddress.setStatus('current')
hm2DnsClientStaticHostStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 248, 11, 90, 1, 1, 6, 1, 5), RowStatus()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: hm2DnsClientStaticHostStatus.setStatus('current')
hm2DnsCachingServerGlobalGroup = MibIdentifier((1, 3, 6, 1, 4, 1, 248, 11, 90, 1, 3, 1))
hm2DnsCachingServerAdminState = MibScalar((1, 3, 6, 1, 4, 1, 248, 11, 90, 1, 3, 1, 1), HmEnabledStatus().clone('enable')).setMaxAccess("readwrite")
if mibBuilder.loadTexts: hm2DnsCachingServerAdminState.setStatus('current')
hm2DnsCacheAdminState = MibScalar((1, 3, 6, 1, 4, 1, 248, 11, 90, 1, 2, 1), HmEnabledStatus().clone('enable')).setMaxAccess("readwrite")
if mibBuilder.loadTexts: hm2DnsCacheAdminState.setStatus('deprecated')
hm2DnsCacheFlushAction = MibScalar((1, 3, 6, 1, 4, 1, 248, 11, 90, 1, 2, 2), HmActionValue().clone('noop')).setMaxAccess("readwrite")
if mibBuilder.loadTexts: hm2DnsCacheFlushAction.setStatus('deprecated')
hm2DnsCHHostNameAlreadyExistsSESError = ObjectIdentity((1, 3, 6, 1, 4, 1, 248, 11, 90, 3, 1))
if mibBuilder.loadTexts: hm2DnsCHHostNameAlreadyExistsSESError.setStatus('current')
hm2DnsCHBadIpNotAcceptedSESError = ObjectIdentity((1, 3, 6, 1, 4, 1, 248, 11, 90, 3, 2))
if mibBuilder.loadTexts: hm2DnsCHBadIpNotAcceptedSESError.setStatus('current')
hm2DnsCHBadRowCannotBeActivatedSESError = ObjectIdentity((1, 3, 6, 1, 4, 1, 248, 11, 90, 3, 3))
if mibBuilder.loadTexts: hm2DnsCHBadRowCannotBeActivatedSESError.setStatus('current')
mibBuilder.exportSymbols("HM2-DNS-MIB", hm2DnsClientServerDiagTable=hm2DnsClientServerDiagTable, hm2DnsCacheFlushAction=hm2DnsCacheFlushAction, hm2DnsCacheAdminState=hm2DnsCacheAdminState, hm2DnsClientServerDiagEntry=hm2DnsClientServerDiagEntry, hm2DnsClientStaticHostAddressType=hm2DnsClientStaticHostAddressType, hm2DnsCacheGroup=hm2DnsCacheGroup, hm2DnsClientServerRowStatus=hm2DnsClientServerRowStatus, hm2DnsCachingServerGlobalGroup=hm2DnsCachingServerGlobalGroup, hm2DnsClientGlobalGroup=hm2DnsClientGlobalGroup, hm2DnsClientServerCfgEntry=hm2DnsClientServerCfgEntry, PYSNMP_MODULE_ID=hm2DnsMib, hm2DnsCHBadRowCannotBeActivatedSESError=hm2DnsCHBadRowCannotBeActivatedSESError, hm2DnsClientStaticHostIPAddress=hm2DnsClientStaticHostIPAddress, hm2DnsMibObjects=hm2DnsMibObjects, hm2DnsCHHostNameAlreadyExistsSESError=hm2DnsCHHostNameAlreadyExistsSESError, hm2DnsClientServerCfgTable=hm2DnsClientServerCfgTable, hm2DnsClientStaticHostStatus=hm2DnsClientStaticHostStatus, hm2DnsClientServerDiagAddress=hm2DnsClientServerDiagAddress, hm2DnsClientCacheAdminState=hm2DnsClientCacheAdminState, hm2DnsCachingServerGroup=hm2DnsCachingServerGroup, hm2DnsMibSNMPExtensionGroup=hm2DnsMibSNMPExtensionGroup, hm2DnsClientRequestTimeout=hm2DnsClientRequestTimeout, hm2DnsClientRequestRetransmits=hm2DnsClientRequestRetransmits, hm2DnsCachingServerAdminState=hm2DnsCachingServerAdminState, hm2DnsClientGroup=hm2DnsClientGroup, hm2DnsMib=hm2DnsMib, hm2DnsMibNotifications=hm2DnsMibNotifications, hm2DnsClientServerAddress=hm2DnsClientServerAddress, hm2DnsClientServerIndex=hm2DnsClientServerIndex, hm2DnsClientServerAddressType=hm2DnsClientServerAddressType, hm2DnsClientAdminState=hm2DnsClientAdminState, hm2DnsClientStaticHostName=hm2DnsClientStaticHostName, hm2DnsCHBadIpNotAcceptedSESError=hm2DnsCHBadIpNotAcceptedSESError, hm2DnsClientServerDiagAddressType=hm2DnsClientServerDiagAddressType, hm2DnsClientStaticHostConfigEntry=hm2DnsClientStaticHostConfigEntry, hm2DnsClientDefaultDomainName=hm2DnsClientDefaultDomainName, hm2DnsClientStaticIndex=hm2DnsClientStaticIndex, hm2DnsClientStaticHostConfigTable=hm2DnsClientStaticHostConfigTable, hm2DnsClientServerDiagIndex=hm2DnsClientServerDiagIndex, hm2DnsClientConfigSource=hm2DnsClientConfigSource)
| (integer, octet_string, object_identifier) = mibBuilder.importSymbols('ASN1', 'Integer', 'OctetString', 'ObjectIdentifier')
(named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues')
(value_range_constraint, value_size_constraint, constraints_intersection, single_value_constraint, constraints_union) = mibBuilder.importSymbols('ASN1-REFINEMENT', 'ValueRangeConstraint', 'ValueSizeConstraint', 'ConstraintsIntersection', 'SingleValueConstraint', 'ConstraintsUnion')
(hm_action_value, hm2_configuration_mibs, hm_enabled_status) = mibBuilder.importSymbols('HM2-TC-MIB', 'HmActionValue', 'hm2ConfigurationMibs', 'HmEnabledStatus')
(inet_address_type, inet_address) = mibBuilder.importSymbols('INET-ADDRESS-MIB', 'InetAddressType', 'InetAddress')
(snmp_admin_string,) = mibBuilder.importSymbols('SNMP-FRAMEWORK-MIB', 'SnmpAdminString')
(module_compliance, notification_group) = mibBuilder.importSymbols('SNMPv2-CONF', 'ModuleCompliance', 'NotificationGroup')
(time_ticks, unsigned32, mib_identifier, counter32, module_identity, bits, notification_type, object_identity, ip_address, mib_scalar, mib_table, mib_table_row, mib_table_column, counter64, iso, gauge32, integer32) = mibBuilder.importSymbols('SNMPv2-SMI', 'TimeTicks', 'Unsigned32', 'MibIdentifier', 'Counter32', 'ModuleIdentity', 'Bits', 'NotificationType', 'ObjectIdentity', 'IpAddress', 'MibScalar', 'MibTable', 'MibTableRow', 'MibTableColumn', 'Counter64', 'iso', 'Gauge32', 'Integer32')
(textual_convention, display_string, row_status) = mibBuilder.importSymbols('SNMPv2-TC', 'TextualConvention', 'DisplayString', 'RowStatus')
hm2_dns_mib = module_identity((1, 3, 6, 1, 4, 1, 248, 11, 90))
hm2DnsMib.setRevisions(('2011-06-17 00:00',))
if mibBuilder.loadTexts:
hm2DnsMib.setLastUpdated('201106170000Z')
if mibBuilder.loadTexts:
hm2DnsMib.setOrganization('Hirschmann Automation and Control GmbH')
hm2_dns_mib_notifications = mib_identifier((1, 3, 6, 1, 4, 1, 248, 11, 90, 0))
hm2_dns_mib_objects = mib_identifier((1, 3, 6, 1, 4, 1, 248, 11, 90, 1))
hm2_dns_mib_snmp_extension_group = mib_identifier((1, 3, 6, 1, 4, 1, 248, 11, 90, 3))
hm2_dns_client_group = mib_identifier((1, 3, 6, 1, 4, 1, 248, 11, 90, 1, 1))
hm2_dns_cache_group = mib_identifier((1, 3, 6, 1, 4, 1, 248, 11, 90, 1, 2))
hm2_dns_caching_server_group = mib_identifier((1, 3, 6, 1, 4, 1, 248, 11, 90, 1, 3))
hm2_dns_client_admin_state = mib_scalar((1, 3, 6, 1, 4, 1, 248, 11, 90, 1, 1, 1), hm_enabled_status().clone('disable')).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
hm2DnsClientAdminState.setStatus('current')
hm2_dns_client_config_source = mib_scalar((1, 3, 6, 1, 4, 1, 248, 11, 90, 1, 1, 2), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3))).clone(namedValues=named_values(('user', 1), ('mgmt-dhcp', 2), ('provider', 3))).clone('mgmt-dhcp')).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
hm2DnsClientConfigSource.setStatus('current')
hm2_dns_client_server_cfg_table = mib_table((1, 3, 6, 1, 4, 1, 248, 11, 90, 1, 1, 3))
if mibBuilder.loadTexts:
hm2DnsClientServerCfgTable.setStatus('current')
hm2_dns_client_server_cfg_entry = mib_table_row((1, 3, 6, 1, 4, 1, 248, 11, 90, 1, 1, 3, 1)).setIndexNames((0, 'HM2-DNS-MIB', 'hm2DnsClientServerIndex'))
if mibBuilder.loadTexts:
hm2DnsClientServerCfgEntry.setStatus('current')
hm2_dns_client_server_index = mib_table_column((1, 3, 6, 1, 4, 1, 248, 11, 90, 1, 1, 3, 1, 1), integer32().subtype(subtypeSpec=value_range_constraint(1, 4)))
if mibBuilder.loadTexts:
hm2DnsClientServerIndex.setStatus('current')
hm2_dns_client_server_address_type = mib_table_column((1, 3, 6, 1, 4, 1, 248, 11, 90, 1, 1, 3, 1, 2), inet_address_type().clone('ipv4')).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
hm2DnsClientServerAddressType.setStatus('current')
hm2_dns_client_server_address = mib_table_column((1, 3, 6, 1, 4, 1, 248, 11, 90, 1, 1, 3, 1, 3), inet_address().clone(hexValue='00000000')).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
hm2DnsClientServerAddress.setStatus('current')
hm2_dns_client_server_row_status = mib_table_column((1, 3, 6, 1, 4, 1, 248, 11, 90, 1, 1, 3, 1, 4), row_status()).setMaxAccess('readcreate')
if mibBuilder.loadTexts:
hm2DnsClientServerRowStatus.setStatus('current')
hm2_dns_client_server_diag_table = mib_table((1, 3, 6, 1, 4, 1, 248, 11, 90, 1, 1, 4))
if mibBuilder.loadTexts:
hm2DnsClientServerDiagTable.setStatus('current')
hm2_dns_client_server_diag_entry = mib_table_row((1, 3, 6, 1, 4, 1, 248, 11, 90, 1, 1, 4, 1)).setIndexNames((0, 'HM2-DNS-MIB', 'hm2DnsClientServerDiagIndex'))
if mibBuilder.loadTexts:
hm2DnsClientServerDiagEntry.setStatus('current')
hm2_dns_client_server_diag_index = mib_table_column((1, 3, 6, 1, 4, 1, 248, 11, 90, 1, 1, 4, 1, 1), integer32().subtype(subtypeSpec=value_range_constraint(1, 4)))
if mibBuilder.loadTexts:
hm2DnsClientServerDiagIndex.setStatus('current')
hm2_dns_client_server_diag_address_type = mib_table_column((1, 3, 6, 1, 4, 1, 248, 11, 90, 1, 1, 4, 1, 2), inet_address_type()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
hm2DnsClientServerDiagAddressType.setStatus('current')
hm2_dns_client_server_diag_address = mib_table_column((1, 3, 6, 1, 4, 1, 248, 11, 90, 1, 1, 4, 1, 3), inet_address()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
hm2DnsClientServerDiagAddress.setStatus('current')
hm2_dns_client_global_group = mib_identifier((1, 3, 6, 1, 4, 1, 248, 11, 90, 1, 1, 5))
hm2_dns_client_default_domain_name = mib_scalar((1, 3, 6, 1, 4, 1, 248, 11, 90, 1, 1, 5, 1), snmp_admin_string().subtype(subtypeSpec=value_size_constraint(0, 255))).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
hm2DnsClientDefaultDomainName.setStatus('current')
hm2_dns_client_request_timeout = mib_scalar((1, 3, 6, 1, 4, 1, 248, 11, 90, 1, 1, 5, 2), integer32().subtype(subtypeSpec=value_range_constraint(0, 3600)).clone(3)).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
hm2DnsClientRequestTimeout.setStatus('current')
hm2_dns_client_request_retransmits = mib_scalar((1, 3, 6, 1, 4, 1, 248, 11, 90, 1, 1, 5, 3), integer32().subtype(subtypeSpec=value_range_constraint(0, 100)).clone(2)).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
hm2DnsClientRequestRetransmits.setStatus('current')
hm2_dns_client_cache_admin_state = mib_scalar((1, 3, 6, 1, 4, 1, 248, 11, 90, 1, 1, 5, 4), hm_enabled_status().clone('enable')).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
hm2DnsClientCacheAdminState.setStatus('current')
hm2_dns_client_static_host_config_table = mib_table((1, 3, 6, 1, 4, 1, 248, 11, 90, 1, 1, 6))
if mibBuilder.loadTexts:
hm2DnsClientStaticHostConfigTable.setStatus('current')
hm2_dns_client_static_host_config_entry = mib_table_row((1, 3, 6, 1, 4, 1, 248, 11, 90, 1, 1, 6, 1)).setIndexNames((0, 'HM2-DNS-MIB', 'hm2DnsClientStaticIndex'))
if mibBuilder.loadTexts:
hm2DnsClientStaticHostConfigEntry.setStatus('current')
hm2_dns_client_static_index = mib_table_column((1, 3, 6, 1, 4, 1, 248, 11, 90, 1, 1, 6, 1, 1), integer32().subtype(subtypeSpec=value_range_constraint(1, 64)))
if mibBuilder.loadTexts:
hm2DnsClientStaticIndex.setStatus('current')
hm2_dns_client_static_host_name = mib_table_column((1, 3, 6, 1, 4, 1, 248, 11, 90, 1, 1, 6, 1, 2), snmp_admin_string().subtype(subtypeSpec=value_size_constraint(0, 255))).setMaxAccess('readcreate')
if mibBuilder.loadTexts:
hm2DnsClientStaticHostName.setStatus('current')
hm2_dns_client_static_host_address_type = mib_table_column((1, 3, 6, 1, 4, 1, 248, 11, 90, 1, 1, 6, 1, 3), inet_address_type()).setMaxAccess('readcreate')
if mibBuilder.loadTexts:
hm2DnsClientStaticHostAddressType.setStatus('current')
hm2_dns_client_static_host_ip_address = mib_table_column((1, 3, 6, 1, 4, 1, 248, 11, 90, 1, 1, 6, 1, 4), inet_address()).setMaxAccess('readcreate')
if mibBuilder.loadTexts:
hm2DnsClientStaticHostIPAddress.setStatus('current')
hm2_dns_client_static_host_status = mib_table_column((1, 3, 6, 1, 4, 1, 248, 11, 90, 1, 1, 6, 1, 5), row_status()).setMaxAccess('readcreate')
if mibBuilder.loadTexts:
hm2DnsClientStaticHostStatus.setStatus('current')
hm2_dns_caching_server_global_group = mib_identifier((1, 3, 6, 1, 4, 1, 248, 11, 90, 1, 3, 1))
hm2_dns_caching_server_admin_state = mib_scalar((1, 3, 6, 1, 4, 1, 248, 11, 90, 1, 3, 1, 1), hm_enabled_status().clone('enable')).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
hm2DnsCachingServerAdminState.setStatus('current')
hm2_dns_cache_admin_state = mib_scalar((1, 3, 6, 1, 4, 1, 248, 11, 90, 1, 2, 1), hm_enabled_status().clone('enable')).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
hm2DnsCacheAdminState.setStatus('deprecated')
hm2_dns_cache_flush_action = mib_scalar((1, 3, 6, 1, 4, 1, 248, 11, 90, 1, 2, 2), hm_action_value().clone('noop')).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
hm2DnsCacheFlushAction.setStatus('deprecated')
hm2_dns_ch_host_name_already_exists_ses_error = object_identity((1, 3, 6, 1, 4, 1, 248, 11, 90, 3, 1))
if mibBuilder.loadTexts:
hm2DnsCHHostNameAlreadyExistsSESError.setStatus('current')
hm2_dns_ch_bad_ip_not_accepted_ses_error = object_identity((1, 3, 6, 1, 4, 1, 248, 11, 90, 3, 2))
if mibBuilder.loadTexts:
hm2DnsCHBadIpNotAcceptedSESError.setStatus('current')
hm2_dns_ch_bad_row_cannot_be_activated_ses_error = object_identity((1, 3, 6, 1, 4, 1, 248, 11, 90, 3, 3))
if mibBuilder.loadTexts:
hm2DnsCHBadRowCannotBeActivatedSESError.setStatus('current')
mibBuilder.exportSymbols('HM2-DNS-MIB', hm2DnsClientServerDiagTable=hm2DnsClientServerDiagTable, hm2DnsCacheFlushAction=hm2DnsCacheFlushAction, hm2DnsCacheAdminState=hm2DnsCacheAdminState, hm2DnsClientServerDiagEntry=hm2DnsClientServerDiagEntry, hm2DnsClientStaticHostAddressType=hm2DnsClientStaticHostAddressType, hm2DnsCacheGroup=hm2DnsCacheGroup, hm2DnsClientServerRowStatus=hm2DnsClientServerRowStatus, hm2DnsCachingServerGlobalGroup=hm2DnsCachingServerGlobalGroup, hm2DnsClientGlobalGroup=hm2DnsClientGlobalGroup, hm2DnsClientServerCfgEntry=hm2DnsClientServerCfgEntry, PYSNMP_MODULE_ID=hm2DnsMib, hm2DnsCHBadRowCannotBeActivatedSESError=hm2DnsCHBadRowCannotBeActivatedSESError, hm2DnsClientStaticHostIPAddress=hm2DnsClientStaticHostIPAddress, hm2DnsMibObjects=hm2DnsMibObjects, hm2DnsCHHostNameAlreadyExistsSESError=hm2DnsCHHostNameAlreadyExistsSESError, hm2DnsClientServerCfgTable=hm2DnsClientServerCfgTable, hm2DnsClientStaticHostStatus=hm2DnsClientStaticHostStatus, hm2DnsClientServerDiagAddress=hm2DnsClientServerDiagAddress, hm2DnsClientCacheAdminState=hm2DnsClientCacheAdminState, hm2DnsCachingServerGroup=hm2DnsCachingServerGroup, hm2DnsMibSNMPExtensionGroup=hm2DnsMibSNMPExtensionGroup, hm2DnsClientRequestTimeout=hm2DnsClientRequestTimeout, hm2DnsClientRequestRetransmits=hm2DnsClientRequestRetransmits, hm2DnsCachingServerAdminState=hm2DnsCachingServerAdminState, hm2DnsClientGroup=hm2DnsClientGroup, hm2DnsMib=hm2DnsMib, hm2DnsMibNotifications=hm2DnsMibNotifications, hm2DnsClientServerAddress=hm2DnsClientServerAddress, hm2DnsClientServerIndex=hm2DnsClientServerIndex, hm2DnsClientServerAddressType=hm2DnsClientServerAddressType, hm2DnsClientAdminState=hm2DnsClientAdminState, hm2DnsClientStaticHostName=hm2DnsClientStaticHostName, hm2DnsCHBadIpNotAcceptedSESError=hm2DnsCHBadIpNotAcceptedSESError, hm2DnsClientServerDiagAddressType=hm2DnsClientServerDiagAddressType, hm2DnsClientStaticHostConfigEntry=hm2DnsClientStaticHostConfigEntry, hm2DnsClientDefaultDomainName=hm2DnsClientDefaultDomainName, hm2DnsClientStaticIndex=hm2DnsClientStaticIndex, hm2DnsClientStaticHostConfigTable=hm2DnsClientStaticHostConfigTable, hm2DnsClientServerDiagIndex=hm2DnsClientServerDiagIndex, hm2DnsClientConfigSource=hm2DnsClientConfigSource) |
class Node:
def __init__(self,key):
self.key = key
self.parent = None
self.right = None
self.left = None
class Tree:
def __init__(self):
self.root = None
self.node = Node(self.root)
self.find_node = None
def add(self,key):
if (self.root == None):
self.root = Node(key)
else:
self._add(key,self.root)
def _add(self,key,node ):
if key> node.key:
if node.left != None:
self._add(key,node.left)
else:
node.left = Node(key)
node.left.parent = node
else:
if node.right != None:
self._add(key,node.right)
else:
node.right = Node(key)
node.right.parent = node
def search (self,key):
if self.root == None:
print ("This tree is empty, so there is any " + str(key)+ " !")
return
else:
self._search(key,self.root)
def _search(self,key,node):
if node == None:
print ("There is no " + str(key))
return
elif key> node.key:
self._search(key,node.left)
elif key< node.key:
self._search(key,node.right)
else:
print ( "Here its --->" + str(node))
self.find_node = node
return node
def del_node(self,key):
self.search(key)
node = self.find_node
if ( node.right == None and node.left == None):
print (str (node.key) )
print (node.parent.key)
if (node.parent.key > node.key):
node.parent.right = None
else:
node.parent.left = None
elif ( node.right != None and node.left == None):
x=node.right
y=node.parent
print (str (node.key) )
if (node.parent.key > node.key):
node.parent.right = None
else:
node.parent.left = None
if y.key > x.key:
y.right = x
else:
y.left = x
elif (node.right == None and node.left != None):
x = node.left
y = node.parent
print (str (node.key) )
if (node.parent.key > node.key):
node.parent.right = None
else:
node.parent.left = None
if y.key > x.key:
y.right = x
else:
y.left = x
else:
x = node.left
while x.right != None:
print (x.key)
x = x.right
y=node.parent
print (str (node.key))
if (node.parent.key > node.key):
node.parent.right = None
else:
node.parent.left = None
if y.key > x.key:
y.right = x
else:
y.left = x
def print_tree(self):
if(self.root != None):
self._print_tree(self.root)
def _print_tree(self,node):
if(node != None):
self._print_tree(node.left)
print (node.key)
self._print_tree(node.right)
def get_parent(self,key):
self.search(key)
x = self.find_node.parent
if x is not None:
x = x.key
return x
def get_child(self,key):
self.search(key)
x,y = self.find_node.right,self.find_node.left
if x is not None:
x = x.key
if y is not None:
y = y.key
return x,y
def main():
Binary_tree = Tree()
Binary_tree.add(5)
Binary_tree.add(4)
Binary_tree.add(8)
Binary_tree.add(9)
Binary_tree.add(3)
Binary_tree.add(0)
Binary_tree.add(7)
Binary_tree.add(6)
Binary_tree.add(2)
Binary_tree.add(1)
Binary_tree.print_tree()
Binary_tree.search(2)
Binary_tree.print_tree()
Binary_tree.del_node(8)
Binary_tree.print_tree()
Binary_tree.search(8)
Binary_tree.print_tree()
if __name__ == "__main__":
main()
| class Node:
def __init__(self, key):
self.key = key
self.parent = None
self.right = None
self.left = None
class Tree:
def __init__(self):
self.root = None
self.node = node(self.root)
self.find_node = None
def add(self, key):
if self.root == None:
self.root = node(key)
else:
self._add(key, self.root)
def _add(self, key, node):
if key > node.key:
if node.left != None:
self._add(key, node.left)
else:
node.left = node(key)
node.left.parent = node
elif node.right != None:
self._add(key, node.right)
else:
node.right = node(key)
node.right.parent = node
def search(self, key):
if self.root == None:
print('This tree is empty, so there is any ' + str(key) + ' !')
return
else:
self._search(key, self.root)
def _search(self, key, node):
if node == None:
print('There is no ' + str(key))
return
elif key > node.key:
self._search(key, node.left)
elif key < node.key:
self._search(key, node.right)
else:
print('Here its --->' + str(node))
self.find_node = node
return node
def del_node(self, key):
self.search(key)
node = self.find_node
if node.right == None and node.left == None:
print(str(node.key))
print(node.parent.key)
if node.parent.key > node.key:
node.parent.right = None
else:
node.parent.left = None
elif node.right != None and node.left == None:
x = node.right
y = node.parent
print(str(node.key))
if node.parent.key > node.key:
node.parent.right = None
else:
node.parent.left = None
if y.key > x.key:
y.right = x
else:
y.left = x
elif node.right == None and node.left != None:
x = node.left
y = node.parent
print(str(node.key))
if node.parent.key > node.key:
node.parent.right = None
else:
node.parent.left = None
if y.key > x.key:
y.right = x
else:
y.left = x
else:
x = node.left
while x.right != None:
print(x.key)
x = x.right
y = node.parent
print(str(node.key))
if node.parent.key > node.key:
node.parent.right = None
else:
node.parent.left = None
if y.key > x.key:
y.right = x
else:
y.left = x
def print_tree(self):
if self.root != None:
self._print_tree(self.root)
def _print_tree(self, node):
if node != None:
self._print_tree(node.left)
print(node.key)
self._print_tree(node.right)
def get_parent(self, key):
self.search(key)
x = self.find_node.parent
if x is not None:
x = x.key
return x
def get_child(self, key):
self.search(key)
(x, y) = (self.find_node.right, self.find_node.left)
if x is not None:
x = x.key
if y is not None:
y = y.key
return (x, y)
def main():
binary_tree = tree()
Binary_tree.add(5)
Binary_tree.add(4)
Binary_tree.add(8)
Binary_tree.add(9)
Binary_tree.add(3)
Binary_tree.add(0)
Binary_tree.add(7)
Binary_tree.add(6)
Binary_tree.add(2)
Binary_tree.add(1)
Binary_tree.print_tree()
Binary_tree.search(2)
Binary_tree.print_tree()
Binary_tree.del_node(8)
Binary_tree.print_tree()
Binary_tree.search(8)
Binary_tree.print_tree()
if __name__ == '__main__':
main() |
if __name__ == '__main__':
with open('train.csv', 'w') as f:
for i in range(1, 451):
f.write(f'/workspace/data/VCTK-Corpus/wav48/p239/p239_{i:03d}.wav,/workspace/data/VCTK-Corpus/txt/p239/p239_{i:03d}.txt\n')
with open('val.csv', 'w') as f:
for i in range(451, 476):
f.write(f'/workspace/data/VCTK-Corpus/wav48/p239/p239_{i:03d}.wav,/workspace/data/VCTK-Corpus/txt/p239/p239_{i:03d}.txt\n')
with open('test.csv', 'w') as f:
for i in range(476, 504):
f.write(f'/workspace/data/VCTK-Corpus/wav48/p239/p239_{i:03d}.wav,/workspace/data/VCTK-Corpus/txt/p239/p239_{i:03d}.txt\n')
| if __name__ == '__main__':
with open('train.csv', 'w') as f:
for i in range(1, 451):
f.write(f'/workspace/data/VCTK-Corpus/wav48/p239/p239_{i:03d}.wav,/workspace/data/VCTK-Corpus/txt/p239/p239_{i:03d}.txt\n')
with open('val.csv', 'w') as f:
for i in range(451, 476):
f.write(f'/workspace/data/VCTK-Corpus/wav48/p239/p239_{i:03d}.wav,/workspace/data/VCTK-Corpus/txt/p239/p239_{i:03d}.txt\n')
with open('test.csv', 'w') as f:
for i in range(476, 504):
f.write(f'/workspace/data/VCTK-Corpus/wav48/p239/p239_{i:03d}.wav,/workspace/data/VCTK-Corpus/txt/p239/p239_{i:03d}.txt\n') |
number = int(input())
for a in range(1, 9 + 1):
for b in range(1, 9 + 1):
for c in range(1, 9 + 1):
for d in range(1, 9 + 1):
if a + b == c + d and number % (a +b) == 0:
print('{0}{1}{2}{3}'.format(a, b, c, d), end=" ")
| number = int(input())
for a in range(1, 9 + 1):
for b in range(1, 9 + 1):
for c in range(1, 9 + 1):
for d in range(1, 9 + 1):
if a + b == c + d and number % (a + b) == 0:
print('{0}{1}{2}{3}'.format(a, b, c, d), end=' ') |
class DataProcessor(object):
def get_train_examples(self, data_dir):
raise NotImplementedError()
def get_dev_examples(self, data_dir):
raise NotImplementedError()
def get_test_examples(self, data_dir, data_file_name):
raise NotImplementedError()
def get_labels(self):
raise NotImplementedError()
| class Dataprocessor(object):
def get_train_examples(self, data_dir):
raise not_implemented_error()
def get_dev_examples(self, data_dir):
raise not_implemented_error()
def get_test_examples(self, data_dir, data_file_name):
raise not_implemented_error()
def get_labels(self):
raise not_implemented_error() |
def my_func(name):
print(f"this function is {name}")
return "ha ha ha"
my_func("Carlos's")
the_input = int(input("Tell me something: "))
print(the_input + 2)
| def my_func(name):
print(f'this function is {name}')
return 'ha ha ha'
my_func("Carlos's")
the_input = int(input('Tell me something: '))
print(the_input + 2) |
def get_item_by_name(self, item_name):
for item in self.items:
if item.item_name == item_name:
return item
return None
def get_item_list_by_name(self, item_name):
for item_list in self.item_lists:
if item_list.item_name == item_name:
return item_list
return None
| def get_item_by_name(self, item_name):
for item in self.items:
if item.item_name == item_name:
return item
return None
def get_item_list_by_name(self, item_name):
for item_list in self.item_lists:
if item_list.item_name == item_name:
return item_list
return None |
#characterization of a linguistic value
#it has a belonging function and possibly its inverse function
class fuzzy_linguistic_value:
#builder (belonging function and its inverse)
def __init__(self, function, inverse_function = None):
self.function = function
self.inverse_function = inverse_function
#return the minimum between the threshold and the value x evaluated in function
def defuzzy_function(function, maximum, x):
return min(maximum, function(x))
#definition of a fuzzy variable(value, domain, agregation, defuzzyfication methods)
class fuzzy_variable:
#builder (initial value and the domain)
def __init__(self, initial_value, domain):
self.domain = domain
self.value = initial_value
self.agregation = {}
#change the value of the variable to "new_value"
def change_value(self, new_value):
self.value = new_value
#get belonging value associated with the state "state"
def get_value(self, state):
return self.domain[state].function(self.value)
#reset current agregation
def clear_agregation(self):
self.agregation = {}
#add more outputs to the agregation
def agregate(self, pairs):
for p in pairs:
#if this value was already part of the agregation we take the minimum of the 2 values
if p[0] in self.agregation.keys():
self.agregation[p[0]] = (self.domain[p[0]].function, min(p[1], self.agregation[p[0]][1]))
else: #if not, we add it to the agregation
self.agregation[p[0]] = (self.domain[p[0]].function, p[1])
#defuzzyfication methods
#centroid
def defuzzyfication_centroid(self, low = int(-1e5), high = int(1e5), delta = 1):
a, b = 0, 0
for x in range(low, high, delta):
eval = -1e15
for k in self.agregation.keys():
eval = max(eval, defuzzy_function(self.agregation[k][0], self.agregation[k][1], x))
a += 1.0 * x * eval
b += eval
if b == 0:
return 0.0
else:
return a / b
#maximum
def defuzzyfication_max(self):
fuzzy, maximum = None, -1e15
for k in self.agregation.keys():
if self.agregation[k][1] > maximum:
fuzzy, maximum = k, self.agregation[k][1]
if fuzzy == None:
raise RuntimeError('Agregation function not defined')
return self.domain[fuzzy].inverse_function(maximum)
#bisection
def defuzzyfication_bisection(self, low = int(-1e5), high = int(1e5), delta = 1):
first, last = 0, 0
for x in range(low, high, delta):
first = x
eval = -1e15
for k in self.agregation.keys():
eval = max(eval, defuzzy_function(self.agregation[k][0], self.agregation[k][1], x))
if eval > 0 and first == 0:
break
for x in range(high, low, -delta):
last = x
eval = -1e15
for k in self.agregation.keys():
eval = max(eval, defuzzy_function(self.agregation[k][0], self.agregation[k][1], x))
if eval > 0 and last == 0:
break
return (low + first) / 2.0
| class Fuzzy_Linguistic_Value:
def __init__(self, function, inverse_function=None):
self.function = function
self.inverse_function = inverse_function
def defuzzy_function(function, maximum, x):
return min(maximum, function(x))
class Fuzzy_Variable:
def __init__(self, initial_value, domain):
self.domain = domain
self.value = initial_value
self.agregation = {}
def change_value(self, new_value):
self.value = new_value
def get_value(self, state):
return self.domain[state].function(self.value)
def clear_agregation(self):
self.agregation = {}
def agregate(self, pairs):
for p in pairs:
if p[0] in self.agregation.keys():
self.agregation[p[0]] = (self.domain[p[0]].function, min(p[1], self.agregation[p[0]][1]))
else:
self.agregation[p[0]] = (self.domain[p[0]].function, p[1])
def defuzzyfication_centroid(self, low=int(-100000.0), high=int(100000.0), delta=1):
(a, b) = (0, 0)
for x in range(low, high, delta):
eval = -1000000000000000.0
for k in self.agregation.keys():
eval = max(eval, defuzzy_function(self.agregation[k][0], self.agregation[k][1], x))
a += 1.0 * x * eval
b += eval
if b == 0:
return 0.0
else:
return a / b
def defuzzyfication_max(self):
(fuzzy, maximum) = (None, -1000000000000000.0)
for k in self.agregation.keys():
if self.agregation[k][1] > maximum:
(fuzzy, maximum) = (k, self.agregation[k][1])
if fuzzy == None:
raise runtime_error('Agregation function not defined')
return self.domain[fuzzy].inverse_function(maximum)
def defuzzyfication_bisection(self, low=int(-100000.0), high=int(100000.0), delta=1):
(first, last) = (0, 0)
for x in range(low, high, delta):
first = x
eval = -1000000000000000.0
for k in self.agregation.keys():
eval = max(eval, defuzzy_function(self.agregation[k][0], self.agregation[k][1], x))
if eval > 0 and first == 0:
break
for x in range(high, low, -delta):
last = x
eval = -1000000000000000.0
for k in self.agregation.keys():
eval = max(eval, defuzzy_function(self.agregation[k][0], self.agregation[k][1], x))
if eval > 0 and last == 0:
break
return (low + first) / 2.0 |
s = input()
ans = 0
for i in range(len(s) // 2):
if s[i] != s[len(s) - 1 - i]:
ans += 1
print(ans)
| s = input()
ans = 0
for i in range(len(s) // 2):
if s[i] != s[len(s) - 1 - i]:
ans += 1
print(ans) |
# test basic await expression
# adapted from PEP0492
async def abinary(n):
print(n)
if n <= 0:
return 1
l = await abinary(n - 1)
r = await abinary(n - 1)
return l + 1 + r
o = abinary(4)
try:
while True:
o.send(None)
except StopIteration:
print('finished')
| async def abinary(n):
print(n)
if n <= 0:
return 1
l = await abinary(n - 1)
r = await abinary(n - 1)
return l + 1 + r
o = abinary(4)
try:
while True:
o.send(None)
except StopIteration:
print('finished') |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
print('[+] First Read')
with open('file.txt', 'r') as file:
print(file.read())
print('\n[+] Second Read')
with open('file.txt', 'r') as file:
while True:
line = file.readline()
print(line, end='')
if not line:
break
print('\n\n[+] Third Read')
with open('file.txt', 'r') as file:
for line in file:
print(line, end='')
print('\n\n[+] First Writing')
with open('file_output.txt', 'w') as file_output:
data_to_write = 'Some text\n' * 100
file_output.write(data_to_write)
print('\t[|] Done writing file!')
data = {'ip': '127.0.0.1'}
print('\n\n[+] Second Writing')
with open('file_output_dict.txt', 'w') as file_output_dict:
file_output_dict.write(str(data))
print('\t[|] Done writing dict to a file!')
print('\n\n[+] Reading and Writing')
with open('file.txt', 'r') as file_input, open('file_output_2.txt', 'w') as file_output:
file_output.write(file_input.read())
print('\t[|] Done copying files!') | print('[+] First Read')
with open('file.txt', 'r') as file:
print(file.read())
print('\n[+] Second Read')
with open('file.txt', 'r') as file:
while True:
line = file.readline()
print(line, end='')
if not line:
break
print('\n\n[+] Third Read')
with open('file.txt', 'r') as file:
for line in file:
print(line, end='')
print('\n\n[+] First Writing')
with open('file_output.txt', 'w') as file_output:
data_to_write = 'Some text\n' * 100
file_output.write(data_to_write)
print('\t[|] Done writing file!')
data = {'ip': '127.0.0.1'}
print('\n\n[+] Second Writing')
with open('file_output_dict.txt', 'w') as file_output_dict:
file_output_dict.write(str(data))
print('\t[|] Done writing dict to a file!')
print('\n\n[+] Reading and Writing')
with open('file.txt', 'r') as file_input, open('file_output_2.txt', 'w') as file_output:
file_output.write(file_input.read())
print('\t[|] Done copying files!') |
rows =13
mid=int(rows/2)
for row in range(rows):
if row <=mid:
for blank in range(mid-row):
print(" ",end="")
for star in range(2*row+1):
print("*",end="")
else:
for blank in range(row-mid):
print(" ",end="")
for star in range(rows-2*(row-mid)):
print("*",end="")
print("")
| rows = 13
mid = int(rows / 2)
for row in range(rows):
if row <= mid:
for blank in range(mid - row):
print(' ', end='')
for star in range(2 * row + 1):
print('*', end='')
else:
for blank in range(row - mid):
print(' ', end='')
for star in range(rows - 2 * (row - mid)):
print('*', end='')
print('') |
#!/usr/bin/env python
#
# Cloudlet Infrastructure for Mobile Computing
#
# Author: Kiryong Ha <krha@cmu.edu>
# Zhuo Chen <zhuoc@cs.cmu.edu>
#
# Copyright (C) 2011-2013 Carnegie Mellon University
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
class Protocol_client(object):
JSON_KEY_CONTROL_MESSAGE = "control"
JSON_KEY_RESULT_MESSAGE = "result"
JSON_KEY_FRAME_ID = "frame_id"
JSON_KEY_ENGINE_ID = "engine_id"
JSON_KEY_TOKEN_INJECT = "token_inject"
JSON_KEY_TRAIN = "training"
JSON_KEY_ADD_PERSON = "add_person"
JSON_KEY_RM_PERSON = "remove_person"
JSON_KEY_SET_WHITELIST = "set_whitelist"
class AppDataProtocol():
TYPE_add_person = "add_person"
TYPE_get_person = "get_person"
TYPE_train = "train"
TYPE_detect = "detect"
TYPE_get_state = "get_state"
TYPE_load_state = "load_state"
TYPE_reset = "reset"
TYPE_remove_person = "remove_person"
class Protocol_application(object):
JSON_KEY_SENSOR_TYPE = "sensor_type"
JSON_VALUE_SENSOR_TYPE_JPEG = "mjepg"
JSON_VALUE_SENSOR_TYPE_ACC = "acc"
JSON_VALUE_SENSOR_TYPE_GPS = "gps"
JSON_VALUE_SENSOR_TYPE_AUDIO = "audio"
class Protocol_measurement(object):
JSON_KEY_CONTROL_RECV_FROM_MOBILE_TIME = "control_recv_from_mobile_time"
JSON_KEY_APP_RECV_TIME = "app_recv_time"
JSON_KEY_APP_SYMBOLIC_TIME = "app_symbolic_time"
JSON_KEY_APP_SENT_TIME = "app_sent_time"
JSON_KEY_UCOMM_RECV_TIME = "ucomm_recv_time"
JSON_KEY_UCOMM_SENT_TIME = "ucomm_sent_time"
JSON_KEY_CONTROL_SENT_TO_MOBILE_TIME = "control_sent_to_mobile_time"
class Protocol_result(object):
JSON_KEY_STATUS = "status"
JSON_KEY_IMAGE = "image"
JSON_KEY_SPEECH = "speech"
JSON_KEY_IMAGES_ANIMATION = "animation"
JSON_KEY_VIDEO = "video"
| class Protocol_Client(object):
json_key_control_message = 'control'
json_key_result_message = 'result'
json_key_frame_id = 'frame_id'
json_key_engine_id = 'engine_id'
json_key_token_inject = 'token_inject'
json_key_train = 'training'
json_key_add_person = 'add_person'
json_key_rm_person = 'remove_person'
json_key_set_whitelist = 'set_whitelist'
class Appdataprotocol:
type_add_person = 'add_person'
type_get_person = 'get_person'
type_train = 'train'
type_detect = 'detect'
type_get_state = 'get_state'
type_load_state = 'load_state'
type_reset = 'reset'
type_remove_person = 'remove_person'
class Protocol_Application(object):
json_key_sensor_type = 'sensor_type'
json_value_sensor_type_jpeg = 'mjepg'
json_value_sensor_type_acc = 'acc'
json_value_sensor_type_gps = 'gps'
json_value_sensor_type_audio = 'audio'
class Protocol_Measurement(object):
json_key_control_recv_from_mobile_time = 'control_recv_from_mobile_time'
json_key_app_recv_time = 'app_recv_time'
json_key_app_symbolic_time = 'app_symbolic_time'
json_key_app_sent_time = 'app_sent_time'
json_key_ucomm_recv_time = 'ucomm_recv_time'
json_key_ucomm_sent_time = 'ucomm_sent_time'
json_key_control_sent_to_mobile_time = 'control_sent_to_mobile_time'
class Protocol_Result(object):
json_key_status = 'status'
json_key_image = 'image'
json_key_speech = 'speech'
json_key_images_animation = 'animation'
json_key_video = 'video' |
# -*- coding: utf-8 -*-
z = 'watevah'
def blah(a,k='b'):
def blorp(b):
print(b) #3
print(a) #4
print(z) #5
print(__name__) #6
l = lambda x: x
#def l(x): return x
print(l("zoom!")) #1
print(a,k) #2
blorp("boom")
blah("floom")
| z = 'watevah'
def blah(a, k='b'):
def blorp(b):
print(b)
print(a)
print(z)
print(__name__)
l = lambda x: x
print(l('zoom!'))
print(a, k)
blorp('boom')
blah('floom') |
#max(x,y) = (x+y+|x-y|)/2
#max(x,y,z) = max(x,max(y,z))
def AlgebraicallyFindMaxTwo(x,y):
return(x+y+abs(x-y))/2
AlgebraicallyFindMaxTwo(3,4)
def AlgebraicallyFindMaxThree(x,y,z):
print (AlgebraicallyFindMaxTwo(AlgebraicallyFindMaxTwo(x,y), z))
AlgebraicallyFindMaxThree(3,4,5)
| def algebraically_find_max_two(x, y):
return (x + y + abs(x - y)) / 2
algebraically_find_max_two(3, 4)
def algebraically_find_max_three(x, y, z):
print(algebraically_find_max_two(algebraically_find_max_two(x, y), z))
algebraically_find_max_three(3, 4, 5) |
# common values for app boards
MESSAGE_FIELD_SIZE = 8000
BOARD_NAME_SIZE = 30
DESCRIPTION_SIZE = 100
TOPIC_SUBJECT_SIZE = 255
POSTS_PER_PAGE = 2
TOPICS_PER_PAGE = 10
HAS_MANY_PAGES_LIMIT = 3
POST_SUBJECT_SIZE = 255
EXCLUDE_USERS = ['default_user', 'moderator']
MAX_SYMBOLS_ALLOWED = 20
# common values for app newsfeed
DELAY_FACTOR = 35
MIN_CHARS = 350
BANNER_LENGTH = 150
HELP_ARROWS = 'Use left/ right arrow to toggle news items. '
HELP_BANNER = 'Press Banner to toggle banner on/ off. '
IMG_WIDTH_PX = 900
IMG_WIDTH_PERC = '100%'
RIGHT_ARROW = '\u25B6'
LEFT_ARROW = '\u25C0'
# common values for app stock
BASE_CURRENCIES = [('EUR', 'EUR'), ('USD', 'USD')]
CARET_UP = '\u25B2' # up triangle
CARET_DOWN = '\u25BC' # down triangle
CARET_NO_CHANGE = '\u25AC' # rectangle
| message_field_size = 8000
board_name_size = 30
description_size = 100
topic_subject_size = 255
posts_per_page = 2
topics_per_page = 10
has_many_pages_limit = 3
post_subject_size = 255
exclude_users = ['default_user', 'moderator']
max_symbols_allowed = 20
delay_factor = 35
min_chars = 350
banner_length = 150
help_arrows = 'Use left/ right arrow to toggle news items. '
help_banner = 'Press Banner to toggle banner on/ off. '
img_width_px = 900
img_width_perc = '100%'
right_arrow = '▶'
left_arrow = '◀'
base_currencies = [('EUR', 'EUR'), ('USD', 'USD')]
caret_up = '▲'
caret_down = '▼'
caret_no_change = '▬' |
#
# PySNMP MIB module ADTRAN-AOS-MEDIAGATEWAY-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/ADTRAN-AOS-MEDIAGATEWAY-MIB
# Produced by pysmi-0.3.4 at Wed May 1 11:14:04 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)
#
adGenAOSVoice, = mibBuilder.importSymbols("ADTRAN-AOS", "adGenAOSVoice")
adIdentity, adShared = mibBuilder.importSymbols("ADTRAN-MIB", "adIdentity", "adShared")
ObjectIdentifier, OctetString, Integer = mibBuilder.importSymbols("ASN1", "ObjectIdentifier", "OctetString", "Integer")
NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues")
SingleValueConstraint, ValueRangeConstraint, ConstraintsIntersection, ConstraintsUnion, ValueSizeConstraint = mibBuilder.importSymbols("ASN1-REFINEMENT", "SingleValueConstraint", "ValueRangeConstraint", "ConstraintsIntersection", "ConstraintsUnion", "ValueSizeConstraint")
ObjectGroup, ModuleCompliance, NotificationGroup = mibBuilder.importSymbols("SNMPv2-CONF", "ObjectGroup", "ModuleCompliance", "NotificationGroup")
ObjectIdentity, Counter64, iso, NotificationType, TimeTicks, ModuleIdentity, Bits, IpAddress, Integer32, MibScalar, MibTable, MibTableRow, MibTableColumn, Counter32, Unsigned32, MibIdentifier, Gauge32 = mibBuilder.importSymbols("SNMPv2-SMI", "ObjectIdentity", "Counter64", "iso", "NotificationType", "TimeTicks", "ModuleIdentity", "Bits", "IpAddress", "Integer32", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "Counter32", "Unsigned32", "MibIdentifier", "Gauge32")
DisplayString, TextualConvention = mibBuilder.importSymbols("SNMPv2-TC", "DisplayString", "TextualConvention")
adGenAOSMediaGatewayMIB = ModuleIdentity((1, 3, 6, 1, 4, 1, 664, 6, 10000, 53, 5, 2))
adGenAOSMediaGatewayMIB.setRevisions(('2012-08-22 00:00',))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
if mibBuilder.loadTexts: adGenAOSMediaGatewayMIB.setRevisionsDescriptions(('The following OIDs have been obsoleted and will no longer be supported. adGenAOSRtpSessionRxPacketsLost, adGenAOSRtpSessionRxFrameLateDiscards, adGenAOSRtpSessionRxFrameOverflows, adGenAOSRtpSessionTotalsRxPacketsLost, adGenAOSRtpSessionTotalsRxFrameLateDiscards, adGenAOSRtpSessionTotalsRxFrameOverflows, adGenAOSRtpChannelTotalRxPacketsLost, adGenAOSRtpChannelTotalRxMaxDepth, adGenAOSRtpChannelTotalRxFrameLateDiscards, adGenAOSRtpChannelTotalRxFrameOverflows',))
if mibBuilder.loadTexts: adGenAOSMediaGatewayMIB.setLastUpdated('200504190000Z')
if mibBuilder.loadTexts: adGenAOSMediaGatewayMIB.setOrganization('ADTRAN, Inc.')
if mibBuilder.loadTexts: adGenAOSMediaGatewayMIB.setContactInfo(' Technical Support Dept. Postal: ADTRAN, Inc. 901 Explorer Blvd. Huntsville, AL 35806 Tel: +1 800 923 8726 Fax: +1 256 963 6217 E-mail: support@adtran.com')
if mibBuilder.loadTexts: adGenAOSMediaGatewayMIB.setDescription('The MIB module for AdtranOS Media-gateway statistics.')
adGenAOSMediaGateway = MibIdentifier((1, 3, 6, 1, 4, 1, 664, 5, 53, 5, 2))
adGenAOSMediaGatewayObjects = MibIdentifier((1, 3, 6, 1, 4, 1, 664, 5, 53, 5, 2, 1))
adGenAOSMediaGatewayConformance = MibIdentifier((1, 3, 6, 1, 4, 1, 664, 5, 53, 5, 2, 99))
adGenAOSMediaGatewayCompliances = MibIdentifier((1, 3, 6, 1, 4, 1, 664, 5, 53, 5, 2, 99, 1))
adGenAOSMediaGatewayMIBGroups = MibIdentifier((1, 3, 6, 1, 4, 1, 664, 5, 53, 5, 2, 99, 2))
adGenAOSRtpSessionTable = MibTable((1, 3, 6, 1, 4, 1, 664, 5, 53, 5, 2, 1, 1), )
if mibBuilder.loadTexts: adGenAOSRtpSessionTable.setStatus('current')
if mibBuilder.loadTexts: adGenAOSRtpSessionTable.setDescription('The AdtranOS RTP session table.')
adGenAOSRtpSessionEntry = MibTableRow((1, 3, 6, 1, 4, 1, 664, 5, 53, 5, 2, 1, 1, 1), ).setIndexNames((0, "ADTRAN-AOS-MEDIAGATEWAY-MIB", "adGenAOSRtpSessionChannelId"))
if mibBuilder.loadTexts: adGenAOSRtpSessionEntry.setStatus('current')
if mibBuilder.loadTexts: adGenAOSRtpSessionEntry.setDescription('An entry in the AdtranOS RTP session table.')
adGenAOSRtpSessionChannelId = MibTableColumn((1, 3, 6, 1, 4, 1, 664, 5, 53, 5, 2, 1, 1, 1, 1), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: adGenAOSRtpSessionChannelId.setStatus('current')
if mibBuilder.loadTexts: adGenAOSRtpSessionChannelId.setDescription('Identifier value for the media-gateway channel used by this RTP session.')
adGenAOSRtpSessionChannelIdName = MibTableColumn((1, 3, 6, 1, 4, 1, 664, 5, 53, 5, 2, 1, 1, 1, 2), DisplayString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: adGenAOSRtpSessionChannelIdName.setStatus('current')
if mibBuilder.loadTexts: adGenAOSRtpSessionChannelIdName.setDescription('Identifier name of the media-gateway channel used by this RTP session.')
adGenAOSRtpSessionStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 664, 5, 53, 5, 2, 1, 1, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3))).clone(namedValues=NamedValues(("unavailable", 0), ("available", 1), ("allocated", 2), ("active", 3)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: adGenAOSRtpSessionStatus.setStatus('current')
if mibBuilder.loadTexts: adGenAOSRtpSessionStatus.setDescription('Current status of the RTP session.')
adGenAOSRtpSessionStartTime = MibTableColumn((1, 3, 6, 1, 4, 1, 664, 5, 53, 5, 2, 1, 1, 1, 4), DisplayString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: adGenAOSRtpSessionStartTime.setStatus('current')
if mibBuilder.loadTexts: adGenAOSRtpSessionStartTime.setDescription('Start time of the current RTP session.')
adGenAOSRtpSessionDuration = MibTableColumn((1, 3, 6, 1, 4, 1, 664, 5, 53, 5, 2, 1, 1, 1, 5), DisplayString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: adGenAOSRtpSessionDuration.setStatus('current')
if mibBuilder.loadTexts: adGenAOSRtpSessionDuration.setDescription('Duration of the current RTP session.')
adGenAOSRtpSessionVocoder = MibTableColumn((1, 3, 6, 1, 4, 1, 664, 5, 53, 5, 2, 1, 1, 1, 6), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39))).clone(namedValues=NamedValues(("none", 0), ("g711ulaw", 1), ("gsm", 2), ("g723", 3), ("g711alaw", 4), ("g722", 5), ("g728", 6), ("g729a", 7), ("dynamic96", 8), ("dynamic97", 9), ("dynamic98", 10), ("dynamic99", 11), ("dynamic100", 12), ("dynamic101", 13), ("dynamic102", 14), ("dynamic103", 15), ("dynamic104", 16), ("dynamic105", 17), ("dynamic106", 18), ("dynamic107", 19), ("dynamic108", 20), ("dynamic109", 21), ("dynamic110", 22), ("dynamic111", 23), ("dynamic112", 24), ("dynamic113", 25), ("dynamic114", 26), ("dynamic115", 27), ("dynamic116", 28), ("dynamic117", 29), ("dynamic118", 30), ("dynamic119", 31), ("dynamic120", 32), ("dynamic121", 33), ("dynamic122", 34), ("dynamic123", 35), ("dynamic124", 36), ("dynamic125", 37), ("dynamic126", 38), ("dynamic127", 39)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: adGenAOSRtpSessionVocoder.setStatus('current')
if mibBuilder.loadTexts: adGenAOSRtpSessionVocoder.setDescription('Vocoder used in the current RTP session.')
adGenAOSRtpSessionVAD = MibTableColumn((1, 3, 6, 1, 4, 1, 664, 5, 53, 5, 2, 1, 1, 1, 7), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1))).clone(namedValues=NamedValues(("disabled", 0), ("enabled", 1)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: adGenAOSRtpSessionVAD.setStatus('current')
if mibBuilder.loadTexts: adGenAOSRtpSessionVAD.setDescription('Current status of the voice activity detector.')
adGenAOSRtpSessionTdmPortDescription = MibTableColumn((1, 3, 6, 1, 4, 1, 664, 5, 53, 5, 2, 1, 1, 1, 8), DisplayString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: adGenAOSRtpSessionTdmPortDescription.setStatus('current')
if mibBuilder.loadTexts: adGenAOSRtpSessionTdmPortDescription.setDescription('Description of the timed-division-multiplex resource associated with this RTP session.')
adGenAOSRtpSessionLocalIPAddress = MibTableColumn((1, 3, 6, 1, 4, 1, 664, 5, 53, 5, 2, 1, 1, 1, 9), IpAddress()).setMaxAccess("readonly")
if mibBuilder.loadTexts: adGenAOSRtpSessionLocalIPAddress.setStatus('current')
if mibBuilder.loadTexts: adGenAOSRtpSessionLocalIPAddress.setDescription('Local Internet Protocol address used in current RTP session.')
adGenAOSRtpSessionLocalUdpPort = MibTableColumn((1, 3, 6, 1, 4, 1, 664, 5, 53, 5, 2, 1, 1, 1, 10), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: adGenAOSRtpSessionLocalUdpPort.setStatus('current')
if mibBuilder.loadTexts: adGenAOSRtpSessionLocalUdpPort.setDescription('Local UDP address used in current RTP session.')
adGenAOSRtpSessionSIPPortDescription = MibTableColumn((1, 3, 6, 1, 4, 1, 664, 5, 53, 5, 2, 1, 1, 1, 11), DisplayString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: adGenAOSRtpSessionSIPPortDescription.setStatus('current')
if mibBuilder.loadTexts: adGenAOSRtpSessionSIPPortDescription.setDescription('Description String of the SIP resource associated with this RTP session.')
adGenAOSRtpSessionRemoteIPAddress = MibTableColumn((1, 3, 6, 1, 4, 1, 664, 5, 53, 5, 2, 1, 1, 1, 12), IpAddress()).setMaxAccess("readonly")
if mibBuilder.loadTexts: adGenAOSRtpSessionRemoteIPAddress.setStatus('current')
if mibBuilder.loadTexts: adGenAOSRtpSessionRemoteIPAddress.setDescription('Remote Internet Protocol address used in current RTP session.')
adGenAOSRtpSessionRemoteUdpPort = MibTableColumn((1, 3, 6, 1, 4, 1, 664, 5, 53, 5, 2, 1, 1, 1, 13), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: adGenAOSRtpSessionRemoteUdpPort.setStatus('current')
if mibBuilder.loadTexts: adGenAOSRtpSessionRemoteUdpPort.setDescription('Remote UDP address used in current RTP session.')
adGenAOSRtpSessionTxFramesPerPacket = MibTableColumn((1, 3, 6, 1, 4, 1, 664, 5, 53, 5, 2, 1, 1, 1, 14), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: adGenAOSRtpSessionTxFramesPerPacket.setStatus('current')
if mibBuilder.loadTexts: adGenAOSRtpSessionTxFramesPerPacket.setDescription('Number of sample frames packed into a given RTP packet.')
adGenAOSRtpSessionEchoCancellerEnabled = MibTableColumn((1, 3, 6, 1, 4, 1, 664, 5, 53, 5, 2, 1, 1, 1, 15), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1))).clone(namedValues=NamedValues(("disabled", 0), ("enabled", 1)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: adGenAOSRtpSessionEchoCancellerEnabled.setStatus('current')
if mibBuilder.loadTexts: adGenAOSRtpSessionEchoCancellerEnabled.setDescription('State (enable or disabled) of the echo-canceller.')
adGenAOSRtpSessionRxPackets = MibTableColumn((1, 3, 6, 1, 4, 1, 664, 5, 53, 5, 2, 1, 1, 1, 22), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: adGenAOSRtpSessionRxPackets.setStatus('current')
if mibBuilder.loadTexts: adGenAOSRtpSessionRxPackets.setDescription('Number of packets received in the current RTP session.')
adGenAOSRtpSessionRxOctets = MibTableColumn((1, 3, 6, 1, 4, 1, 664, 5, 53, 5, 2, 1, 1, 1, 23), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: adGenAOSRtpSessionRxOctets.setStatus('current')
if mibBuilder.loadTexts: adGenAOSRtpSessionRxOctets.setDescription('Number of bytes received in the current RTP session.')
adGenAOSRtpSessionRxPacketsLost = MibTableColumn((1, 3, 6, 1, 4, 1, 664, 5, 53, 5, 2, 1, 1, 1, 24), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: adGenAOSRtpSessionRxPacketsLost.setStatus('obsolete')
if mibBuilder.loadTexts: adGenAOSRtpSessionRxPacketsLost.setDescription('Number of packets lost in the current RTP session as determined by missing sequence numbers.')
adGenAOSRtpSessionRxPacketsUnknown = MibTableColumn((1, 3, 6, 1, 4, 1, 664, 5, 53, 5, 2, 1, 1, 1, 25), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: adGenAOSRtpSessionRxPacketsUnknown.setStatus('current')
if mibBuilder.loadTexts: adGenAOSRtpSessionRxPacketsUnknown.setDescription('Number of received packets with unknown payload type.')
adGenAOSRtpSessionRxJitterBufferDepth = MibTableColumn((1, 3, 6, 1, 4, 1, 664, 5, 53, 5, 2, 1, 1, 1, 26), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: adGenAOSRtpSessionRxJitterBufferDepth.setStatus('current')
if mibBuilder.loadTexts: adGenAOSRtpSessionRxJitterBufferDepth.setDescription('Current depth of jitter buffer in packets for this RTP session.')
adGenAOSRtpSessionRxMaxJitterBufferDepth = MibTableColumn((1, 3, 6, 1, 4, 1, 664, 5, 53, 5, 2, 1, 1, 1, 27), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: adGenAOSRtpSessionRxMaxJitterBufferDepth.setStatus('current')
if mibBuilder.loadTexts: adGenAOSRtpSessionRxMaxJitterBufferDepth.setDescription('Maximum depth of jitter buffer in packets for this RTP session.')
adGenAOSRtpSessionRxFrameLateDiscards = MibTableColumn((1, 3, 6, 1, 4, 1, 664, 5, 53, 5, 2, 1, 1, 1, 30), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: adGenAOSRtpSessionRxFrameLateDiscards.setStatus('obsolete')
if mibBuilder.loadTexts: adGenAOSRtpSessionRxFrameLateDiscards.setDescription('Number of received frames that have been discarded by the jitter buffer for being late.')
adGenAOSRtpSessionRxFrameOverflows = MibTableColumn((1, 3, 6, 1, 4, 1, 664, 5, 53, 5, 2, 1, 1, 1, 31), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: adGenAOSRtpSessionRxFrameOverflows.setStatus('obsolete')
if mibBuilder.loadTexts: adGenAOSRtpSessionRxFrameOverflows.setDescription('Number of received frames that overflow jitter buffer.')
adGenAOSRtpSessionRxFrameOutOfOrders = MibTableColumn((1, 3, 6, 1, 4, 1, 664, 5, 53, 5, 2, 1, 1, 1, 33), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: adGenAOSRtpSessionRxFrameOutOfOrders.setStatus('current')
if mibBuilder.loadTexts: adGenAOSRtpSessionRxFrameOutOfOrders.setDescription('Number of received frames that are out of order.')
adGenAOSRtpSessionRxSyncSource = MibTableColumn((1, 3, 6, 1, 4, 1, 664, 5, 53, 5, 2, 1, 1, 1, 34), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: adGenAOSRtpSessionRxSyncSource.setStatus('current')
if mibBuilder.loadTexts: adGenAOSRtpSessionRxSyncSource.setDescription('Sync source of the receiver.')
adGenAOSRtpSessionTxPackets = MibTableColumn((1, 3, 6, 1, 4, 1, 664, 5, 53, 5, 2, 1, 1, 1, 35), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: adGenAOSRtpSessionTxPackets.setStatus('current')
if mibBuilder.loadTexts: adGenAOSRtpSessionTxPackets.setDescription('Number of packets transmitted in the current RTP session.')
adGenAOSRtpSessionTxOctets = MibTableColumn((1, 3, 6, 1, 4, 1, 664, 5, 53, 5, 2, 1, 1, 1, 36), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: adGenAOSRtpSessionTxOctets.setStatus('current')
if mibBuilder.loadTexts: adGenAOSRtpSessionTxOctets.setDescription('Number of bytes transmitted in the current RTP session.')
adGenAOSRtpSessionTxSyncSource = MibTableColumn((1, 3, 6, 1, 4, 1, 664, 5, 53, 5, 2, 1, 1, 1, 37), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: adGenAOSRtpSessionTxSyncSource.setStatus('current')
if mibBuilder.loadTexts: adGenAOSRtpSessionTxSyncSource.setDescription('Sync source of the sender.')
adGenAOSRtpSessionTotalsTable = MibTable((1, 3, 6, 1, 4, 1, 664, 5, 53, 5, 2, 1, 2), )
if mibBuilder.loadTexts: adGenAOSRtpSessionTotalsTable.setStatus('current')
if mibBuilder.loadTexts: adGenAOSRtpSessionTotalsTable.setDescription('The AdtranOS RTP session totals table.')
adGenAOSRtpSessionTotalsEntry = MibTableRow((1, 3, 6, 1, 4, 1, 664, 5, 53, 5, 2, 1, 2, 1), ).setIndexNames((0, "ADTRAN-AOS-MEDIAGATEWAY-MIB", "adGenAOSRtpSessionTotalsSessions"))
if mibBuilder.loadTexts: adGenAOSRtpSessionTotalsEntry.setStatus('current')
if mibBuilder.loadTexts: adGenAOSRtpSessionTotalsEntry.setDescription('An entry in the AdtranOS RTP session totals table.')
adGenAOSRtpSessionTotalsSessions = MibTableColumn((1, 3, 6, 1, 4, 1, 664, 5, 53, 5, 2, 1, 2, 1, 1), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: adGenAOSRtpSessionTotalsSessions.setStatus('current')
if mibBuilder.loadTexts: adGenAOSRtpSessionTotalsSessions.setDescription('The totals number RTP sessions that have occured including sessions still currently active.')
adGenAOSRtpSessionTotalsSessionDuration = MibTableColumn((1, 3, 6, 1, 4, 1, 664, 5, 53, 5, 2, 1, 2, 1, 2), DisplayString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: adGenAOSRtpSessionTotalsSessionDuration.setStatus('current')
if mibBuilder.loadTexts: adGenAOSRtpSessionTotalsSessionDuration.setDescription('Total duration for all RTP sessions.')
adGenAOSRtpSessionTotalsRxPackets = MibTableColumn((1, 3, 6, 1, 4, 1, 664, 5, 53, 5, 2, 1, 2, 1, 3), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: adGenAOSRtpSessionTotalsRxPackets.setStatus('current')
if mibBuilder.loadTexts: adGenAOSRtpSessionTotalsRxPackets.setDescription('Number of packets recieved for all sessions.')
adGenAOSRtpSessionTotalsRxOctets = MibTableColumn((1, 3, 6, 1, 4, 1, 664, 5, 53, 5, 2, 1, 2, 1, 4), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: adGenAOSRtpSessionTotalsRxOctets.setStatus('current')
if mibBuilder.loadTexts: adGenAOSRtpSessionTotalsRxOctets.setDescription('Number of octets recieved for all sessions.')
adGenAOSRtpSessionTotalsRxPacketsLost = MibTableColumn((1, 3, 6, 1, 4, 1, 664, 5, 53, 5, 2, 1, 2, 1, 5), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: adGenAOSRtpSessionTotalsRxPacketsLost.setStatus('obsolete')
if mibBuilder.loadTexts: adGenAOSRtpSessionTotalsRxPacketsLost.setDescription('Number of recieve packets lost for all sessions.')
adGenAOSRtpSessionTotalsRxPacketsUnknown = MibTableColumn((1, 3, 6, 1, 4, 1, 664, 5, 53, 5, 2, 1, 2, 1, 6), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: adGenAOSRtpSessionTotalsRxPacketsUnknown.setStatus('current')
if mibBuilder.loadTexts: adGenAOSRtpSessionTotalsRxPacketsUnknown.setDescription('Number of received packets with unknown payload type during all sessions.')
adGenAOSRtpSessionTotalsTxPackets = MibTableColumn((1, 3, 6, 1, 4, 1, 664, 5, 53, 5, 2, 1, 2, 1, 7), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: adGenAOSRtpSessionTotalsTxPackets.setStatus('current')
if mibBuilder.loadTexts: adGenAOSRtpSessionTotalsTxPackets.setDescription('Number of packets transmited for all sessions.')
adGenAOSRtpSessionTotalsTxOctets = MibTableColumn((1, 3, 6, 1, 4, 1, 664, 5, 53, 5, 2, 1, 2, 1, 8), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: adGenAOSRtpSessionTotalsTxOctets.setStatus('current')
if mibBuilder.loadTexts: adGenAOSRtpSessionTotalsTxOctets.setDescription('Number of octets transmited for all sessions.')
adGenAOSRtpSessionTotalsRxFrameLateDiscards = MibTableColumn((1, 3, 6, 1, 4, 1, 664, 5, 53, 5, 2, 1, 2, 1, 9), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: adGenAOSRtpSessionTotalsRxFrameLateDiscards.setStatus('obsolete')
if mibBuilder.loadTexts: adGenAOSRtpSessionTotalsRxFrameLateDiscards.setDescription('Number of frames received late and discarded by the jitter buffer.')
adGenAOSRtpSessionTotalsRxFrameOverflows = MibTableColumn((1, 3, 6, 1, 4, 1, 664, 5, 53, 5, 2, 1, 2, 1, 11), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: adGenAOSRtpSessionTotalsRxFrameOverflows.setStatus('obsolete')
if mibBuilder.loadTexts: adGenAOSRtpSessionTotalsRxFrameOverflows.setDescription('Number of received frames that overflow the jitter buffer.')
adGenAOSRtpSessionTotalsRxFrameOutOfOrders = MibTableColumn((1, 3, 6, 1, 4, 1, 664, 5, 53, 5, 2, 1, 2, 1, 12), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: adGenAOSRtpSessionTotalsRxFrameOutOfOrders.setStatus('current')
if mibBuilder.loadTexts: adGenAOSRtpSessionTotalsRxFrameOutOfOrders.setDescription('Number of received frames that are declared out-of-order by the jitter buffer.')
adGenAOSRtpSessionTotalsClearCounters = MibTableColumn((1, 3, 6, 1, 4, 1, 664, 5, 53, 5, 2, 1, 2, 1, 13), Integer32()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: adGenAOSRtpSessionTotalsClearCounters.setStatus('current')
if mibBuilder.loadTexts: adGenAOSRtpSessionTotalsClearCounters.setDescription('Clear the accumulated totals for all RTP sessions.')
adGenAOSRtpSessionTotalsTimeSinceLastClearCounters = MibTableColumn((1, 3, 6, 1, 4, 1, 664, 5, 53, 5, 2, 1, 2, 1, 14), DisplayString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: adGenAOSRtpSessionTotalsTimeSinceLastClearCounters.setStatus('current')
if mibBuilder.loadTexts: adGenAOSRtpSessionTotalsTimeSinceLastClearCounters.setDescription('Time elapsed since last clear counters for RTP session totals.')
adGenAOSMediaGatewayInfoTable = MibTable((1, 3, 6, 1, 4, 1, 664, 5, 53, 5, 2, 1, 3), )
if mibBuilder.loadTexts: adGenAOSMediaGatewayInfoTable.setStatus('current')
if mibBuilder.loadTexts: adGenAOSMediaGatewayInfoTable.setDescription('The AdtranOS media-gateway processor information table.')
adGenAOSMediaGatewayInfoEntry = MibTableRow((1, 3, 6, 1, 4, 1, 664, 5, 53, 5, 2, 1, 3, 1), ).setIndexNames((0, "ADTRAN-AOS-MEDIAGATEWAY-MIB", "adGenAOSMediaGatewayInfoIdentifier"))
if mibBuilder.loadTexts: adGenAOSMediaGatewayInfoEntry.setStatus('current')
if mibBuilder.loadTexts: adGenAOSMediaGatewayInfoEntry.setDescription('An entry in the AdtranOS RTP session table.')
adGenAOSMediaGatewayInfoIdentifier = MibTableColumn((1, 3, 6, 1, 4, 1, 664, 5, 53, 5, 2, 1, 3, 1, 1), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: adGenAOSMediaGatewayInfoIdentifier.setStatus('current')
if mibBuilder.loadTexts: adGenAOSMediaGatewayInfoIdentifier.setDescription('The indentifier of the media-gateway processor.')
adGenAOSMediaGatewayInfoSoftwareVersion = MibTableColumn((1, 3, 6, 1, 4, 1, 664, 5, 53, 5, 2, 1, 3, 1, 2), DisplayString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: adGenAOSMediaGatewayInfoSoftwareVersion.setStatus('current')
if mibBuilder.loadTexts: adGenAOSMediaGatewayInfoSoftwareVersion.setDescription('The software version running on the media-gateway processor.')
adGenAOSMediaGatewayInfoUtilization = MibTableColumn((1, 3, 6, 1, 4, 1, 664, 5, 53, 5, 2, 1, 3, 1, 3), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: adGenAOSMediaGatewayInfoUtilization.setStatus('current')
if mibBuilder.loadTexts: adGenAOSMediaGatewayInfoUtilization.setDescription('Current processor utilization of the media-gateway processor.')
adGenAOSMediaGatewayInfoUtilizationMaximum = MibTableColumn((1, 3, 6, 1, 4, 1, 664, 5, 53, 5, 2, 1, 3, 1, 4), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: adGenAOSMediaGatewayInfoUtilizationMaximum.setStatus('current')
if mibBuilder.loadTexts: adGenAOSMediaGatewayInfoUtilizationMaximum.setDescription('Current processor utilization of the media-gateway processor.')
adGenAOSMediaGatewayInfoFreePacketBuffers = MibTableColumn((1, 3, 6, 1, 4, 1, 664, 5, 53, 5, 2, 1, 3, 1, 5), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: adGenAOSMediaGatewayInfoFreePacketBuffers.setStatus('current')
if mibBuilder.loadTexts: adGenAOSMediaGatewayInfoFreePacketBuffers.setDescription('Current number of free packet buffers on the media-gateway processor.')
adGenAOSMediaGatewayInfoUptime = MibTableColumn((1, 3, 6, 1, 4, 1, 664, 5, 53, 5, 2, 1, 3, 1, 6), DisplayString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: adGenAOSMediaGatewayInfoUptime.setStatus('current')
if mibBuilder.loadTexts: adGenAOSMediaGatewayInfoUptime.setDescription('Current uptime of the media-gateway processor.')
adGenAOSRtpChannelTotalTable = MibTable((1, 3, 6, 1, 4, 1, 664, 5, 53, 5, 2, 1, 4), )
if mibBuilder.loadTexts: adGenAOSRtpChannelTotalTable.setStatus('current')
if mibBuilder.loadTexts: adGenAOSRtpChannelTotalTable.setDescription('The AdtranOS Media-gateway channel totals table.')
adGenAOSRtpChannelTotalEntry = MibTableRow((1, 3, 6, 1, 4, 1, 664, 5, 53, 5, 2, 1, 4, 1), ).setIndexNames((0, "ADTRAN-AOS-MEDIAGATEWAY-MIB", "adGenAOSRtpChannelTotalId"))
if mibBuilder.loadTexts: adGenAOSRtpChannelTotalEntry.setStatus('current')
if mibBuilder.loadTexts: adGenAOSRtpChannelTotalEntry.setDescription('An entry in the AdtranOS RTP session table.')
adGenAOSRtpChannelTotalId = MibTableColumn((1, 3, 6, 1, 4, 1, 664, 5, 53, 5, 2, 1, 4, 1, 1), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: adGenAOSRtpChannelTotalId.setStatus('current')
if mibBuilder.loadTexts: adGenAOSRtpChannelTotalId.setDescription('Identifier value for the channel on the media-gateway processor.')
adGenAOSRtpChannelTotalIdName = MibTableColumn((1, 3, 6, 1, 4, 1, 664, 5, 53, 5, 2, 1, 4, 1, 2), DisplayString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: adGenAOSRtpChannelTotalIdName.setStatus('current')
if mibBuilder.loadTexts: adGenAOSRtpChannelTotalIdName.setDescription('Identifier name of the channel on the media-gateway processor.')
adGenAOSRtpChannelTotalSessions = MibTableColumn((1, 3, 6, 1, 4, 1, 664, 5, 53, 5, 2, 1, 4, 1, 3), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: adGenAOSRtpChannelTotalSessions.setStatus('current')
if mibBuilder.loadTexts: adGenAOSRtpChannelTotalSessions.setDescription('Number of RTP sessions that have transpired on a given media-gateway channel.')
adGenAOSRtpChannelTotalSessionDuration = MibTableColumn((1, 3, 6, 1, 4, 1, 664, 5, 53, 5, 2, 1, 4, 1, 4), DisplayString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: adGenAOSRtpChannelTotalSessionDuration.setStatus('current')
if mibBuilder.loadTexts: adGenAOSRtpChannelTotalSessionDuration.setDescription('Duration of all RTP sessions for a given media-gateway channel.')
adGenAOSRtpChannelTotalRxPackets = MibTableColumn((1, 3, 6, 1, 4, 1, 664, 5, 53, 5, 2, 1, 4, 1, 5), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: adGenAOSRtpChannelTotalRxPackets.setStatus('current')
if mibBuilder.loadTexts: adGenAOSRtpChannelTotalRxPackets.setDescription('Number of received packets for all RTP sessions for a given media-gateway channel.')
adGenAOSRtpChannelTotalRxOctets = MibTableColumn((1, 3, 6, 1, 4, 1, 664, 5, 53, 5, 2, 1, 4, 1, 6), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: adGenAOSRtpChannelTotalRxOctets.setStatus('current')
if mibBuilder.loadTexts: adGenAOSRtpChannelTotalRxOctets.setDescription('Number of received octets for all RTP sessions for a given media-gateway channel.')
adGenAOSRtpChannelTotalRxPacketsLost = MibTableColumn((1, 3, 6, 1, 4, 1, 664, 5, 53, 5, 2, 1, 4, 1, 7), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: adGenAOSRtpChannelTotalRxPacketsLost.setStatus('obsolete')
if mibBuilder.loadTexts: adGenAOSRtpChannelTotalRxPacketsLost.setDescription('Number of receive packets declared lost for all RTP sessions for a given media-gateway channel.')
adGenAOSRtpChannelTotalRxPacketsUnknown = MibTableColumn((1, 3, 6, 1, 4, 1, 664, 5, 53, 5, 2, 1, 4, 1, 8), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: adGenAOSRtpChannelTotalRxPacketsUnknown.setStatus('current')
if mibBuilder.loadTexts: adGenAOSRtpChannelTotalRxPacketsUnknown.setDescription('Number of receive packets declared unknown for all RTP sessions for a given media-gateway channel.')
adGenAOSRtpChannelTotalTxPackets = MibTableColumn((1, 3, 6, 1, 4, 1, 664, 5, 53, 5, 2, 1, 4, 1, 9), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: adGenAOSRtpChannelTotalTxPackets.setStatus('current')
if mibBuilder.loadTexts: adGenAOSRtpChannelTotalTxPackets.setDescription('Number of transmitted packets for all RTP sessions for a given media-gateway channel.')
adGenAOSRtpChannelTotalTxOctets = MibTableColumn((1, 3, 6, 1, 4, 1, 664, 5, 53, 5, 2, 1, 4, 1, 10), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: adGenAOSRtpChannelTotalTxOctets.setStatus('current')
if mibBuilder.loadTexts: adGenAOSRtpChannelTotalTxOctets.setDescription('The duration of all RTP sessions for a given media-gateway channel.')
adGenAOSRtpChannelTotalRxMaxDepth = MibTableColumn((1, 3, 6, 1, 4, 1, 664, 5, 53, 5, 2, 1, 4, 1, 11), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: adGenAOSRtpChannelTotalRxMaxDepth.setStatus('obsolete')
if mibBuilder.loadTexts: adGenAOSRtpChannelTotalRxMaxDepth.setDescription('Maximum depth fo jitter buffer in packets for this RTP session.')
adGenAOSRtpChannelTotalRxFrameLateDiscards = MibTableColumn((1, 3, 6, 1, 4, 1, 664, 5, 53, 5, 2, 1, 4, 1, 12), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: adGenAOSRtpChannelTotalRxFrameLateDiscards.setStatus('obsolete')
if mibBuilder.loadTexts: adGenAOSRtpChannelTotalRxFrameLateDiscards.setDescription('Number of late frames discarded for all RTP sessions for a given media-gateway channel.')
adGenAOSRtpChannelTotalRxFrameOverflows = MibTableColumn((1, 3, 6, 1, 4, 1, 664, 5, 53, 5, 2, 1, 4, 1, 14), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: adGenAOSRtpChannelTotalRxFrameOverflows.setStatus('obsolete')
if mibBuilder.loadTexts: adGenAOSRtpChannelTotalRxFrameOverflows.setDescription('Number of received frames that overflow the jitter buffer for all RTP sessions for a given media-gateway channel.')
adGenAOSRtpChannelTotalRxFrameOutOfOrders = MibTableColumn((1, 3, 6, 1, 4, 1, 664, 5, 53, 5, 2, 1, 4, 1, 15), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: adGenAOSRtpChannelTotalRxFrameOutOfOrders.setStatus('current')
if mibBuilder.loadTexts: adGenAOSRtpChannelTotalRxFrameOutOfOrders.setDescription('Number of received frames that are declared out-of-order by the jitter buffer for all RTP sessions for a given media-gateway channel.')
adGenAOSRtpChannelClearCounters = MibTableColumn((1, 3, 6, 1, 4, 1, 664, 5, 53, 5, 2, 1, 4, 1, 16), Integer32()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: adGenAOSRtpChannelClearCounters.setStatus('current')
if mibBuilder.loadTexts: adGenAOSRtpChannelClearCounters.setDescription('Clear the accumulated channel totals for all RTP sessions.')
adGenAOSRtpChannelTimeSinceLastClearCounters = MibTableColumn((1, 3, 6, 1, 4, 1, 664, 5, 53, 5, 2, 1, 4, 1, 17), DisplayString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: adGenAOSRtpChannelTimeSinceLastClearCounters.setStatus('current')
if mibBuilder.loadTexts: adGenAOSRtpChannelTimeSinceLastClearCounters.setDescription('Time elapsed since last clear counters for RTP session totals.')
adGenAOSMediaGatewayCompliance = ModuleCompliance((1, 3, 6, 1, 4, 1, 664, 5, 53, 5, 2, 99, 1, 1)).setObjects(("ADTRAN-AOS-MEDIAGATEWAY-MIB", "adGenAOSMediaGatewayRtpSessionGroup"), ("ADTRAN-AOS-MEDIAGATEWAY-MIB", "adGenAOSMediaGatewayRtpSessionTotalsGroup"), ("ADTRAN-AOS-MEDIAGATEWAY-MIB", "adGenAOSMediaGatewayInfoGroup"), ("ADTRAN-AOS-MEDIAGATEWAY-MIB", "adGenAOSMediaGatewayRtpChannelTotalsGroup"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
adGenAOSMediaGatewayCompliance = adGenAOSMediaGatewayCompliance.setStatus('current')
if mibBuilder.loadTexts: adGenAOSMediaGatewayCompliance.setDescription('The compliance statement for SNMPv2 entities which implement the adGenAOSMediaGateway MIB.')
adGenAOSMediaGatewayRtpSessionGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 664, 5, 53, 5, 2, 99, 2, 1)).setObjects(("ADTRAN-AOS-MEDIAGATEWAY-MIB", "adGenAOSRtpSessionChannelId"), ("ADTRAN-AOS-MEDIAGATEWAY-MIB", "adGenAOSRtpSessionChannelIdName"), ("ADTRAN-AOS-MEDIAGATEWAY-MIB", "adGenAOSRtpSessionStatus"), ("ADTRAN-AOS-MEDIAGATEWAY-MIB", "adGenAOSRtpSessionStartTime"), ("ADTRAN-AOS-MEDIAGATEWAY-MIB", "adGenAOSRtpSessionDuration"), ("ADTRAN-AOS-MEDIAGATEWAY-MIB", "adGenAOSRtpSessionVocoder"), ("ADTRAN-AOS-MEDIAGATEWAY-MIB", "adGenAOSRtpSessionVAD"), ("ADTRAN-AOS-MEDIAGATEWAY-MIB", "adGenAOSRtpSessionTdmPortDescription"), ("ADTRAN-AOS-MEDIAGATEWAY-MIB", "adGenAOSRtpSessionLocalIPAddress"), ("ADTRAN-AOS-MEDIAGATEWAY-MIB", "adGenAOSRtpSessionLocalUdpPort"), ("ADTRAN-AOS-MEDIAGATEWAY-MIB", "adGenAOSRtpSessionSIPPortDescription"), ("ADTRAN-AOS-MEDIAGATEWAY-MIB", "adGenAOSRtpSessionRemoteIPAddress"), ("ADTRAN-AOS-MEDIAGATEWAY-MIB", "adGenAOSRtpSessionRemoteUdpPort"), ("ADTRAN-AOS-MEDIAGATEWAY-MIB", "adGenAOSRtpSessionTxFramesPerPacket"), ("ADTRAN-AOS-MEDIAGATEWAY-MIB", "adGenAOSRtpSessionEchoCancellerEnabled"), ("ADTRAN-AOS-MEDIAGATEWAY-MIB", "adGenAOSRtpSessionRxPackets"), ("ADTRAN-AOS-MEDIAGATEWAY-MIB", "adGenAOSRtpSessionRxOctets"), ("ADTRAN-AOS-MEDIAGATEWAY-MIB", "adGenAOSRtpSessionRxPacketsLost"), ("ADTRAN-AOS-MEDIAGATEWAY-MIB", "adGenAOSRtpSessionRxPacketsUnknown"), ("ADTRAN-AOS-MEDIAGATEWAY-MIB", "adGenAOSRtpSessionRxJitterBufferDepth"), ("ADTRAN-AOS-MEDIAGATEWAY-MIB", "adGenAOSRtpSessionRxMaxJitterBufferDepth"), ("ADTRAN-AOS-MEDIAGATEWAY-MIB", "adGenAOSRtpSessionRxFrameLateDiscards"), ("ADTRAN-AOS-MEDIAGATEWAY-MIB", "adGenAOSRtpSessionRxFrameOverflows"), ("ADTRAN-AOS-MEDIAGATEWAY-MIB", "adGenAOSRtpSessionRxFrameOutOfOrders"), ("ADTRAN-AOS-MEDIAGATEWAY-MIB", "adGenAOSRtpSessionRxSyncSource"), ("ADTRAN-AOS-MEDIAGATEWAY-MIB", "adGenAOSRtpSessionTxPackets"), ("ADTRAN-AOS-MEDIAGATEWAY-MIB", "adGenAOSRtpSessionTxOctets"), ("ADTRAN-AOS-MEDIAGATEWAY-MIB", "adGenAOSRtpSessionTxSyncSource"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
adGenAOSMediaGatewayRtpSessionGroup = adGenAOSMediaGatewayRtpSessionGroup.setStatus('current')
if mibBuilder.loadTexts: adGenAOSMediaGatewayRtpSessionGroup.setDescription('The Media-Gateway Real-Time Protocol Session Group.')
adGenAOSMediaGatewayRtpSessionTotalsGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 664, 5, 53, 5, 2, 99, 2, 2)).setObjects(("ADTRAN-AOS-MEDIAGATEWAY-MIB", "adGenAOSRtpSessionTotalsSessions"), ("ADTRAN-AOS-MEDIAGATEWAY-MIB", "adGenAOSRtpSessionTotalsSessionDuration"), ("ADTRAN-AOS-MEDIAGATEWAY-MIB", "adGenAOSRtpSessionTotalsRxPackets"), ("ADTRAN-AOS-MEDIAGATEWAY-MIB", "adGenAOSRtpSessionTotalsRxOctets"), ("ADTRAN-AOS-MEDIAGATEWAY-MIB", "adGenAOSRtpSessionTotalsRxPacketsLost"), ("ADTRAN-AOS-MEDIAGATEWAY-MIB", "adGenAOSRtpSessionTotalsRxPacketsUnknown"), ("ADTRAN-AOS-MEDIAGATEWAY-MIB", "adGenAOSRtpSessionTotalsTxPackets"), ("ADTRAN-AOS-MEDIAGATEWAY-MIB", "adGenAOSRtpSessionTotalsTxOctets"), ("ADTRAN-AOS-MEDIAGATEWAY-MIB", "adGenAOSRtpSessionTotalsRxFrameLateDiscards"), ("ADTRAN-AOS-MEDIAGATEWAY-MIB", "adGenAOSRtpSessionTotalsRxFrameOverflows"), ("ADTRAN-AOS-MEDIAGATEWAY-MIB", "adGenAOSRtpSessionTotalsRxFrameOutOfOrders"), ("ADTRAN-AOS-MEDIAGATEWAY-MIB", "adGenAOSRtpSessionTotalsClearCounters"), ("ADTRAN-AOS-MEDIAGATEWAY-MIB", "adGenAOSRtpSessionTotalsTimeSinceLastClearCounters"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
adGenAOSMediaGatewayRtpSessionTotalsGroup = adGenAOSMediaGatewayRtpSessionTotalsGroup.setStatus('current')
if mibBuilder.loadTexts: adGenAOSMediaGatewayRtpSessionTotalsGroup.setDescription('The Media-Gateway Real-Time Protocol Session Totals Group.')
adGenAOSMediaGatewayInfoGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 664, 5, 53, 5, 2, 99, 2, 3)).setObjects(("ADTRAN-AOS-MEDIAGATEWAY-MIB", "adGenAOSMediaGatewayInfoIdentifier"), ("ADTRAN-AOS-MEDIAGATEWAY-MIB", "adGenAOSMediaGatewayInfoSoftwareVersion"), ("ADTRAN-AOS-MEDIAGATEWAY-MIB", "adGenAOSMediaGatewayInfoUtilization"), ("ADTRAN-AOS-MEDIAGATEWAY-MIB", "adGenAOSMediaGatewayInfoUtilizationMaximum"), ("ADTRAN-AOS-MEDIAGATEWAY-MIB", "adGenAOSMediaGatewayInfoFreePacketBuffers"), ("ADTRAN-AOS-MEDIAGATEWAY-MIB", "adGenAOSMediaGatewayInfoUptime"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
adGenAOSMediaGatewayInfoGroup = adGenAOSMediaGatewayInfoGroup.setStatus('current')
if mibBuilder.loadTexts: adGenAOSMediaGatewayInfoGroup.setDescription('The Media-Gateway Information Group.')
adGenAOSMediaGatewayRtpChannelTotalsGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 664, 5, 53, 5, 2, 99, 2, 4)).setObjects(("ADTRAN-AOS-MEDIAGATEWAY-MIB", "adGenAOSRtpChannelTotalId"), ("ADTRAN-AOS-MEDIAGATEWAY-MIB", "adGenAOSRtpChannelTotalIdName"), ("ADTRAN-AOS-MEDIAGATEWAY-MIB", "adGenAOSRtpChannelTotalSessions"), ("ADTRAN-AOS-MEDIAGATEWAY-MIB", "adGenAOSRtpChannelTotalSessionDuration"), ("ADTRAN-AOS-MEDIAGATEWAY-MIB", "adGenAOSRtpChannelTotalRxPackets"), ("ADTRAN-AOS-MEDIAGATEWAY-MIB", "adGenAOSRtpChannelTotalRxOctets"), ("ADTRAN-AOS-MEDIAGATEWAY-MIB", "adGenAOSRtpChannelTotalRxPacketsLost"), ("ADTRAN-AOS-MEDIAGATEWAY-MIB", "adGenAOSRtpChannelTotalRxPacketsUnknown"), ("ADTRAN-AOS-MEDIAGATEWAY-MIB", "adGenAOSRtpChannelTotalTxPackets"), ("ADTRAN-AOS-MEDIAGATEWAY-MIB", "adGenAOSRtpChannelTotalTxOctets"), ("ADTRAN-AOS-MEDIAGATEWAY-MIB", "adGenAOSRtpChannelTotalRxMaxDepth"), ("ADTRAN-AOS-MEDIAGATEWAY-MIB", "adGenAOSRtpChannelTotalRxFrameLateDiscards"), ("ADTRAN-AOS-MEDIAGATEWAY-MIB", "adGenAOSRtpChannelTotalRxFrameOverflows"), ("ADTRAN-AOS-MEDIAGATEWAY-MIB", "adGenAOSRtpChannelTotalRxFrameOutOfOrders"), ("ADTRAN-AOS-MEDIAGATEWAY-MIB", "adGenAOSRtpChannelClearCounters"), ("ADTRAN-AOS-MEDIAGATEWAY-MIB", "adGenAOSRtpChannelTimeSinceLastClearCounters"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
adGenAOSMediaGatewayRtpChannelTotalsGroup = adGenAOSMediaGatewayRtpChannelTotalsGroup.setStatus('current')
if mibBuilder.loadTexts: adGenAOSMediaGatewayRtpChannelTotalsGroup.setDescription('The Media-Gateway Real-Time Protocol Channel Totals Group.')
mibBuilder.exportSymbols("ADTRAN-AOS-MEDIAGATEWAY-MIB", adGenAOSMediaGatewayConformance=adGenAOSMediaGatewayConformance, PYSNMP_MODULE_ID=adGenAOSMediaGatewayMIB, adGenAOSRtpSessionTxFramesPerPacket=adGenAOSRtpSessionTxFramesPerPacket, adGenAOSRtpChannelTotalSessionDuration=adGenAOSRtpChannelTotalSessionDuration, adGenAOSRtpSessionTotalsTxOctets=adGenAOSRtpSessionTotalsTxOctets, adGenAOSRtpSessionTotalsTimeSinceLastClearCounters=adGenAOSRtpSessionTotalsTimeSinceLastClearCounters, adGenAOSMediaGatewayCompliance=adGenAOSMediaGatewayCompliance, adGenAOSRtpSessionTotalsRxFrameLateDiscards=adGenAOSRtpSessionTotalsRxFrameLateDiscards, adGenAOSRtpSessionDuration=adGenAOSRtpSessionDuration, adGenAOSRtpSessionEchoCancellerEnabled=adGenAOSRtpSessionEchoCancellerEnabled, adGenAOSMediaGatewayMIB=adGenAOSMediaGatewayMIB, adGenAOSRtpSessionTotalsRxFrameOverflows=adGenAOSRtpSessionTotalsRxFrameOverflows, adGenAOSRtpSessionSIPPortDescription=adGenAOSRtpSessionSIPPortDescription, adGenAOSRtpSessionRxFrameOutOfOrders=adGenAOSRtpSessionRxFrameOutOfOrders, adGenAOSMediaGateway=adGenAOSMediaGateway, adGenAOSMediaGatewayInfoIdentifier=adGenAOSMediaGatewayInfoIdentifier, adGenAOSRtpSessionTotalsTxPackets=adGenAOSRtpSessionTotalsTxPackets, adGenAOSRtpSessionTotalsClearCounters=adGenAOSRtpSessionTotalsClearCounters, adGenAOSMediaGatewayObjects=adGenAOSMediaGatewayObjects, adGenAOSRtpSessionRxOctets=adGenAOSRtpSessionRxOctets, adGenAOSMediaGatewayInfoFreePacketBuffers=adGenAOSMediaGatewayInfoFreePacketBuffers, adGenAOSMediaGatewayInfoUtilization=adGenAOSMediaGatewayInfoUtilization, adGenAOSRtpSessionTotalsRxFrameOutOfOrders=adGenAOSRtpSessionTotalsRxFrameOutOfOrders, adGenAOSMediaGatewayRtpChannelTotalsGroup=adGenAOSMediaGatewayRtpChannelTotalsGroup, adGenAOSRtpSessionTotalsRxOctets=adGenAOSRtpSessionTotalsRxOctets, adGenAOSRtpChannelTotalRxFrameOverflows=adGenAOSRtpChannelTotalRxFrameOverflows, adGenAOSMediaGatewayMIBGroups=adGenAOSMediaGatewayMIBGroups, adGenAOSRtpSessionRemoteIPAddress=adGenAOSRtpSessionRemoteIPAddress, adGenAOSMediaGatewayInfoTable=adGenAOSMediaGatewayInfoTable, adGenAOSMediaGatewayInfoUtilizationMaximum=adGenAOSMediaGatewayInfoUtilizationMaximum, adGenAOSRtpChannelTotalId=adGenAOSRtpChannelTotalId, adGenAOSRtpChannelTotalRxPacketsLost=adGenAOSRtpChannelTotalRxPacketsLost, adGenAOSRtpSessionTotalsSessionDuration=adGenAOSRtpSessionTotalsSessionDuration, adGenAOSRtpSessionRxJitterBufferDepth=adGenAOSRtpSessionRxJitterBufferDepth, adGenAOSMediaGatewayInfoUptime=adGenAOSMediaGatewayInfoUptime, adGenAOSRtpChannelTotalSessions=adGenAOSRtpChannelTotalSessions, adGenAOSRtpSessionTxSyncSource=adGenAOSRtpSessionTxSyncSource, adGenAOSRtpSessionEntry=adGenAOSRtpSessionEntry, adGenAOSRtpChannelTotalRxPackets=adGenAOSRtpChannelTotalRxPackets, adGenAOSRtpSessionRxFrameLateDiscards=adGenAOSRtpSessionRxFrameLateDiscards, adGenAOSRtpSessionRxPackets=adGenAOSRtpSessionRxPackets, adGenAOSRtpSessionChannelIdName=adGenAOSRtpSessionChannelIdName, adGenAOSRtpSessionTotalsEntry=adGenAOSRtpSessionTotalsEntry, adGenAOSRtpSessionLocalUdpPort=adGenAOSRtpSessionLocalUdpPort, adGenAOSRtpChannelTotalTxPackets=adGenAOSRtpChannelTotalTxPackets, adGenAOSRtpSessionVAD=adGenAOSRtpSessionVAD, adGenAOSRtpChannelTotalIdName=adGenAOSRtpChannelTotalIdName, adGenAOSRtpSessionTxPackets=adGenAOSRtpSessionTxPackets, adGenAOSMediaGatewayRtpSessionTotalsGroup=adGenAOSMediaGatewayRtpSessionTotalsGroup, adGenAOSRtpSessionStatus=adGenAOSRtpSessionStatus, adGenAOSRtpChannelTotalEntry=adGenAOSRtpChannelTotalEntry, adGenAOSRtpSessionRxSyncSource=adGenAOSRtpSessionRxSyncSource, adGenAOSRtpSessionRxPacketsLost=adGenAOSRtpSessionRxPacketsLost, adGenAOSRtpSessionRxMaxJitterBufferDepth=adGenAOSRtpSessionRxMaxJitterBufferDepth, adGenAOSRtpChannelTotalRxMaxDepth=adGenAOSRtpChannelTotalRxMaxDepth, adGenAOSRtpSessionTotalsRxPacketsUnknown=adGenAOSRtpSessionTotalsRxPacketsUnknown, adGenAOSMediaGatewayInfoEntry=adGenAOSMediaGatewayInfoEntry, adGenAOSRtpSessionTable=adGenAOSRtpSessionTable, adGenAOSRtpChannelClearCounters=adGenAOSRtpChannelClearCounters, adGenAOSRtpChannelTotalRxFrameOutOfOrders=adGenAOSRtpChannelTotalRxFrameOutOfOrders, adGenAOSRtpSessionVocoder=adGenAOSRtpSessionVocoder, adGenAOSMediaGatewayCompliances=adGenAOSMediaGatewayCompliances, adGenAOSRtpSessionTotalsTable=adGenAOSRtpSessionTotalsTable, adGenAOSMediaGatewayInfoSoftwareVersion=adGenAOSMediaGatewayInfoSoftwareVersion, adGenAOSRtpSessionTotalsSessions=adGenAOSRtpSessionTotalsSessions, adGenAOSRtpChannelTotalRxPacketsUnknown=adGenAOSRtpChannelTotalRxPacketsUnknown, adGenAOSRtpSessionRemoteUdpPort=adGenAOSRtpSessionRemoteUdpPort, adGenAOSRtpChannelTotalRxFrameLateDiscards=adGenAOSRtpChannelTotalRxFrameLateDiscards, adGenAOSRtpSessionTotalsRxPackets=adGenAOSRtpSessionTotalsRxPackets, adGenAOSRtpSessionTdmPortDescription=adGenAOSRtpSessionTdmPortDescription, adGenAOSRtpSessionTxOctets=adGenAOSRtpSessionTxOctets, adGenAOSRtpSessionTotalsRxPacketsLost=adGenAOSRtpSessionTotalsRxPacketsLost, adGenAOSMediaGatewayRtpSessionGroup=adGenAOSMediaGatewayRtpSessionGroup, adGenAOSRtpSessionLocalIPAddress=adGenAOSRtpSessionLocalIPAddress, adGenAOSRtpChannelTotalRxOctets=adGenAOSRtpChannelTotalRxOctets, adGenAOSMediaGatewayInfoGroup=adGenAOSMediaGatewayInfoGroup, adGenAOSRtpSessionRxFrameOverflows=adGenAOSRtpSessionRxFrameOverflows, adGenAOSRtpSessionChannelId=adGenAOSRtpSessionChannelId, adGenAOSRtpSessionStartTime=adGenAOSRtpSessionStartTime, adGenAOSRtpSessionRxPacketsUnknown=adGenAOSRtpSessionRxPacketsUnknown, adGenAOSRtpChannelTotalTable=adGenAOSRtpChannelTotalTable, adGenAOSRtpChannelTotalTxOctets=adGenAOSRtpChannelTotalTxOctets, adGenAOSRtpChannelTimeSinceLastClearCounters=adGenAOSRtpChannelTimeSinceLastClearCounters)
| (ad_gen_aos_voice,) = mibBuilder.importSymbols('ADTRAN-AOS', 'adGenAOSVoice')
(ad_identity, ad_shared) = mibBuilder.importSymbols('ADTRAN-MIB', 'adIdentity', 'adShared')
(object_identifier, octet_string, integer) = mibBuilder.importSymbols('ASN1', 'ObjectIdentifier', 'OctetString', 'Integer')
(named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues')
(single_value_constraint, value_range_constraint, constraints_intersection, constraints_union, value_size_constraint) = mibBuilder.importSymbols('ASN1-REFINEMENT', 'SingleValueConstraint', 'ValueRangeConstraint', 'ConstraintsIntersection', 'ConstraintsUnion', 'ValueSizeConstraint')
(object_group, module_compliance, notification_group) = mibBuilder.importSymbols('SNMPv2-CONF', 'ObjectGroup', 'ModuleCompliance', 'NotificationGroup')
(object_identity, counter64, iso, notification_type, time_ticks, module_identity, bits, ip_address, integer32, mib_scalar, mib_table, mib_table_row, mib_table_column, counter32, unsigned32, mib_identifier, gauge32) = mibBuilder.importSymbols('SNMPv2-SMI', 'ObjectIdentity', 'Counter64', 'iso', 'NotificationType', 'TimeTicks', 'ModuleIdentity', 'Bits', 'IpAddress', 'Integer32', 'MibScalar', 'MibTable', 'MibTableRow', 'MibTableColumn', 'Counter32', 'Unsigned32', 'MibIdentifier', 'Gauge32')
(display_string, textual_convention) = mibBuilder.importSymbols('SNMPv2-TC', 'DisplayString', 'TextualConvention')
ad_gen_aos_media_gateway_mib = module_identity((1, 3, 6, 1, 4, 1, 664, 6, 10000, 53, 5, 2))
adGenAOSMediaGatewayMIB.setRevisions(('2012-08-22 00:00',))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
if mibBuilder.loadTexts:
adGenAOSMediaGatewayMIB.setRevisionsDescriptions(('The following OIDs have been obsoleted and will no longer be supported. adGenAOSRtpSessionRxPacketsLost, adGenAOSRtpSessionRxFrameLateDiscards, adGenAOSRtpSessionRxFrameOverflows, adGenAOSRtpSessionTotalsRxPacketsLost, adGenAOSRtpSessionTotalsRxFrameLateDiscards, adGenAOSRtpSessionTotalsRxFrameOverflows, adGenAOSRtpChannelTotalRxPacketsLost, adGenAOSRtpChannelTotalRxMaxDepth, adGenAOSRtpChannelTotalRxFrameLateDiscards, adGenAOSRtpChannelTotalRxFrameOverflows',))
if mibBuilder.loadTexts:
adGenAOSMediaGatewayMIB.setLastUpdated('200504190000Z')
if mibBuilder.loadTexts:
adGenAOSMediaGatewayMIB.setOrganization('ADTRAN, Inc.')
if mibBuilder.loadTexts:
adGenAOSMediaGatewayMIB.setContactInfo(' Technical Support Dept. Postal: ADTRAN, Inc. 901 Explorer Blvd. Huntsville, AL 35806 Tel: +1 800 923 8726 Fax: +1 256 963 6217 E-mail: support@adtran.com')
if mibBuilder.loadTexts:
adGenAOSMediaGatewayMIB.setDescription('The MIB module for AdtranOS Media-gateway statistics.')
ad_gen_aos_media_gateway = mib_identifier((1, 3, 6, 1, 4, 1, 664, 5, 53, 5, 2))
ad_gen_aos_media_gateway_objects = mib_identifier((1, 3, 6, 1, 4, 1, 664, 5, 53, 5, 2, 1))
ad_gen_aos_media_gateway_conformance = mib_identifier((1, 3, 6, 1, 4, 1, 664, 5, 53, 5, 2, 99))
ad_gen_aos_media_gateway_compliances = mib_identifier((1, 3, 6, 1, 4, 1, 664, 5, 53, 5, 2, 99, 1))
ad_gen_aos_media_gateway_mib_groups = mib_identifier((1, 3, 6, 1, 4, 1, 664, 5, 53, 5, 2, 99, 2))
ad_gen_aos_rtp_session_table = mib_table((1, 3, 6, 1, 4, 1, 664, 5, 53, 5, 2, 1, 1))
if mibBuilder.loadTexts:
adGenAOSRtpSessionTable.setStatus('current')
if mibBuilder.loadTexts:
adGenAOSRtpSessionTable.setDescription('The AdtranOS RTP session table.')
ad_gen_aos_rtp_session_entry = mib_table_row((1, 3, 6, 1, 4, 1, 664, 5, 53, 5, 2, 1, 1, 1)).setIndexNames((0, 'ADTRAN-AOS-MEDIAGATEWAY-MIB', 'adGenAOSRtpSessionChannelId'))
if mibBuilder.loadTexts:
adGenAOSRtpSessionEntry.setStatus('current')
if mibBuilder.loadTexts:
adGenAOSRtpSessionEntry.setDescription('An entry in the AdtranOS RTP session table.')
ad_gen_aos_rtp_session_channel_id = mib_table_column((1, 3, 6, 1, 4, 1, 664, 5, 53, 5, 2, 1, 1, 1, 1), integer32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
adGenAOSRtpSessionChannelId.setStatus('current')
if mibBuilder.loadTexts:
adGenAOSRtpSessionChannelId.setDescription('Identifier value for the media-gateway channel used by this RTP session.')
ad_gen_aos_rtp_session_channel_id_name = mib_table_column((1, 3, 6, 1, 4, 1, 664, 5, 53, 5, 2, 1, 1, 1, 2), display_string()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
adGenAOSRtpSessionChannelIdName.setStatus('current')
if mibBuilder.loadTexts:
adGenAOSRtpSessionChannelIdName.setDescription('Identifier name of the media-gateway channel used by this RTP session.')
ad_gen_aos_rtp_session_status = mib_table_column((1, 3, 6, 1, 4, 1, 664, 5, 53, 5, 2, 1, 1, 1, 3), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(0, 1, 2, 3))).clone(namedValues=named_values(('unavailable', 0), ('available', 1), ('allocated', 2), ('active', 3)))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
adGenAOSRtpSessionStatus.setStatus('current')
if mibBuilder.loadTexts:
adGenAOSRtpSessionStatus.setDescription('Current status of the RTP session.')
ad_gen_aos_rtp_session_start_time = mib_table_column((1, 3, 6, 1, 4, 1, 664, 5, 53, 5, 2, 1, 1, 1, 4), display_string()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
adGenAOSRtpSessionStartTime.setStatus('current')
if mibBuilder.loadTexts:
adGenAOSRtpSessionStartTime.setDescription('Start time of the current RTP session.')
ad_gen_aos_rtp_session_duration = mib_table_column((1, 3, 6, 1, 4, 1, 664, 5, 53, 5, 2, 1, 1, 1, 5), display_string()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
adGenAOSRtpSessionDuration.setStatus('current')
if mibBuilder.loadTexts:
adGenAOSRtpSessionDuration.setDescription('Duration of the current RTP session.')
ad_gen_aos_rtp_session_vocoder = mib_table_column((1, 3, 6, 1, 4, 1, 664, 5, 53, 5, 2, 1, 1, 1, 6), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39))).clone(namedValues=named_values(('none', 0), ('g711ulaw', 1), ('gsm', 2), ('g723', 3), ('g711alaw', 4), ('g722', 5), ('g728', 6), ('g729a', 7), ('dynamic96', 8), ('dynamic97', 9), ('dynamic98', 10), ('dynamic99', 11), ('dynamic100', 12), ('dynamic101', 13), ('dynamic102', 14), ('dynamic103', 15), ('dynamic104', 16), ('dynamic105', 17), ('dynamic106', 18), ('dynamic107', 19), ('dynamic108', 20), ('dynamic109', 21), ('dynamic110', 22), ('dynamic111', 23), ('dynamic112', 24), ('dynamic113', 25), ('dynamic114', 26), ('dynamic115', 27), ('dynamic116', 28), ('dynamic117', 29), ('dynamic118', 30), ('dynamic119', 31), ('dynamic120', 32), ('dynamic121', 33), ('dynamic122', 34), ('dynamic123', 35), ('dynamic124', 36), ('dynamic125', 37), ('dynamic126', 38), ('dynamic127', 39)))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
adGenAOSRtpSessionVocoder.setStatus('current')
if mibBuilder.loadTexts:
adGenAOSRtpSessionVocoder.setDescription('Vocoder used in the current RTP session.')
ad_gen_aos_rtp_session_vad = mib_table_column((1, 3, 6, 1, 4, 1, 664, 5, 53, 5, 2, 1, 1, 1, 7), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(0, 1))).clone(namedValues=named_values(('disabled', 0), ('enabled', 1)))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
adGenAOSRtpSessionVAD.setStatus('current')
if mibBuilder.loadTexts:
adGenAOSRtpSessionVAD.setDescription('Current status of the voice activity detector.')
ad_gen_aos_rtp_session_tdm_port_description = mib_table_column((1, 3, 6, 1, 4, 1, 664, 5, 53, 5, 2, 1, 1, 1, 8), display_string()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
adGenAOSRtpSessionTdmPortDescription.setStatus('current')
if mibBuilder.loadTexts:
adGenAOSRtpSessionTdmPortDescription.setDescription('Description of the timed-division-multiplex resource associated with this RTP session.')
ad_gen_aos_rtp_session_local_ip_address = mib_table_column((1, 3, 6, 1, 4, 1, 664, 5, 53, 5, 2, 1, 1, 1, 9), ip_address()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
adGenAOSRtpSessionLocalIPAddress.setStatus('current')
if mibBuilder.loadTexts:
adGenAOSRtpSessionLocalIPAddress.setDescription('Local Internet Protocol address used in current RTP session.')
ad_gen_aos_rtp_session_local_udp_port = mib_table_column((1, 3, 6, 1, 4, 1, 664, 5, 53, 5, 2, 1, 1, 1, 10), integer32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
adGenAOSRtpSessionLocalUdpPort.setStatus('current')
if mibBuilder.loadTexts:
adGenAOSRtpSessionLocalUdpPort.setDescription('Local UDP address used in current RTP session.')
ad_gen_aos_rtp_session_sip_port_description = mib_table_column((1, 3, 6, 1, 4, 1, 664, 5, 53, 5, 2, 1, 1, 1, 11), display_string()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
adGenAOSRtpSessionSIPPortDescription.setStatus('current')
if mibBuilder.loadTexts:
adGenAOSRtpSessionSIPPortDescription.setDescription('Description String of the SIP resource associated with this RTP session.')
ad_gen_aos_rtp_session_remote_ip_address = mib_table_column((1, 3, 6, 1, 4, 1, 664, 5, 53, 5, 2, 1, 1, 1, 12), ip_address()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
adGenAOSRtpSessionRemoteIPAddress.setStatus('current')
if mibBuilder.loadTexts:
adGenAOSRtpSessionRemoteIPAddress.setDescription('Remote Internet Protocol address used in current RTP session.')
ad_gen_aos_rtp_session_remote_udp_port = mib_table_column((1, 3, 6, 1, 4, 1, 664, 5, 53, 5, 2, 1, 1, 1, 13), integer32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
adGenAOSRtpSessionRemoteUdpPort.setStatus('current')
if mibBuilder.loadTexts:
adGenAOSRtpSessionRemoteUdpPort.setDescription('Remote UDP address used in current RTP session.')
ad_gen_aos_rtp_session_tx_frames_per_packet = mib_table_column((1, 3, 6, 1, 4, 1, 664, 5, 53, 5, 2, 1, 1, 1, 14), integer32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
adGenAOSRtpSessionTxFramesPerPacket.setStatus('current')
if mibBuilder.loadTexts:
adGenAOSRtpSessionTxFramesPerPacket.setDescription('Number of sample frames packed into a given RTP packet.')
ad_gen_aos_rtp_session_echo_canceller_enabled = mib_table_column((1, 3, 6, 1, 4, 1, 664, 5, 53, 5, 2, 1, 1, 1, 15), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(0, 1))).clone(namedValues=named_values(('disabled', 0), ('enabled', 1)))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
adGenAOSRtpSessionEchoCancellerEnabled.setStatus('current')
if mibBuilder.loadTexts:
adGenAOSRtpSessionEchoCancellerEnabled.setDescription('State (enable or disabled) of the echo-canceller.')
ad_gen_aos_rtp_session_rx_packets = mib_table_column((1, 3, 6, 1, 4, 1, 664, 5, 53, 5, 2, 1, 1, 1, 22), integer32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
adGenAOSRtpSessionRxPackets.setStatus('current')
if mibBuilder.loadTexts:
adGenAOSRtpSessionRxPackets.setDescription('Number of packets received in the current RTP session.')
ad_gen_aos_rtp_session_rx_octets = mib_table_column((1, 3, 6, 1, 4, 1, 664, 5, 53, 5, 2, 1, 1, 1, 23), integer32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
adGenAOSRtpSessionRxOctets.setStatus('current')
if mibBuilder.loadTexts:
adGenAOSRtpSessionRxOctets.setDescription('Number of bytes received in the current RTP session.')
ad_gen_aos_rtp_session_rx_packets_lost = mib_table_column((1, 3, 6, 1, 4, 1, 664, 5, 53, 5, 2, 1, 1, 1, 24), integer32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
adGenAOSRtpSessionRxPacketsLost.setStatus('obsolete')
if mibBuilder.loadTexts:
adGenAOSRtpSessionRxPacketsLost.setDescription('Number of packets lost in the current RTP session as determined by missing sequence numbers.')
ad_gen_aos_rtp_session_rx_packets_unknown = mib_table_column((1, 3, 6, 1, 4, 1, 664, 5, 53, 5, 2, 1, 1, 1, 25), integer32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
adGenAOSRtpSessionRxPacketsUnknown.setStatus('current')
if mibBuilder.loadTexts:
adGenAOSRtpSessionRxPacketsUnknown.setDescription('Number of received packets with unknown payload type.')
ad_gen_aos_rtp_session_rx_jitter_buffer_depth = mib_table_column((1, 3, 6, 1, 4, 1, 664, 5, 53, 5, 2, 1, 1, 1, 26), integer32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
adGenAOSRtpSessionRxJitterBufferDepth.setStatus('current')
if mibBuilder.loadTexts:
adGenAOSRtpSessionRxJitterBufferDepth.setDescription('Current depth of jitter buffer in packets for this RTP session.')
ad_gen_aos_rtp_session_rx_max_jitter_buffer_depth = mib_table_column((1, 3, 6, 1, 4, 1, 664, 5, 53, 5, 2, 1, 1, 1, 27), integer32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
adGenAOSRtpSessionRxMaxJitterBufferDepth.setStatus('current')
if mibBuilder.loadTexts:
adGenAOSRtpSessionRxMaxJitterBufferDepth.setDescription('Maximum depth of jitter buffer in packets for this RTP session.')
ad_gen_aos_rtp_session_rx_frame_late_discards = mib_table_column((1, 3, 6, 1, 4, 1, 664, 5, 53, 5, 2, 1, 1, 1, 30), integer32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
adGenAOSRtpSessionRxFrameLateDiscards.setStatus('obsolete')
if mibBuilder.loadTexts:
adGenAOSRtpSessionRxFrameLateDiscards.setDescription('Number of received frames that have been discarded by the jitter buffer for being late.')
ad_gen_aos_rtp_session_rx_frame_overflows = mib_table_column((1, 3, 6, 1, 4, 1, 664, 5, 53, 5, 2, 1, 1, 1, 31), integer32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
adGenAOSRtpSessionRxFrameOverflows.setStatus('obsolete')
if mibBuilder.loadTexts:
adGenAOSRtpSessionRxFrameOverflows.setDescription('Number of received frames that overflow jitter buffer.')
ad_gen_aos_rtp_session_rx_frame_out_of_orders = mib_table_column((1, 3, 6, 1, 4, 1, 664, 5, 53, 5, 2, 1, 1, 1, 33), integer32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
adGenAOSRtpSessionRxFrameOutOfOrders.setStatus('current')
if mibBuilder.loadTexts:
adGenAOSRtpSessionRxFrameOutOfOrders.setDescription('Number of received frames that are out of order.')
ad_gen_aos_rtp_session_rx_sync_source = mib_table_column((1, 3, 6, 1, 4, 1, 664, 5, 53, 5, 2, 1, 1, 1, 34), integer32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
adGenAOSRtpSessionRxSyncSource.setStatus('current')
if mibBuilder.loadTexts:
adGenAOSRtpSessionRxSyncSource.setDescription('Sync source of the receiver.')
ad_gen_aos_rtp_session_tx_packets = mib_table_column((1, 3, 6, 1, 4, 1, 664, 5, 53, 5, 2, 1, 1, 1, 35), integer32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
adGenAOSRtpSessionTxPackets.setStatus('current')
if mibBuilder.loadTexts:
adGenAOSRtpSessionTxPackets.setDescription('Number of packets transmitted in the current RTP session.')
ad_gen_aos_rtp_session_tx_octets = mib_table_column((1, 3, 6, 1, 4, 1, 664, 5, 53, 5, 2, 1, 1, 1, 36), integer32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
adGenAOSRtpSessionTxOctets.setStatus('current')
if mibBuilder.loadTexts:
adGenAOSRtpSessionTxOctets.setDescription('Number of bytes transmitted in the current RTP session.')
ad_gen_aos_rtp_session_tx_sync_source = mib_table_column((1, 3, 6, 1, 4, 1, 664, 5, 53, 5, 2, 1, 1, 1, 37), integer32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
adGenAOSRtpSessionTxSyncSource.setStatus('current')
if mibBuilder.loadTexts:
adGenAOSRtpSessionTxSyncSource.setDescription('Sync source of the sender.')
ad_gen_aos_rtp_session_totals_table = mib_table((1, 3, 6, 1, 4, 1, 664, 5, 53, 5, 2, 1, 2))
if mibBuilder.loadTexts:
adGenAOSRtpSessionTotalsTable.setStatus('current')
if mibBuilder.loadTexts:
adGenAOSRtpSessionTotalsTable.setDescription('The AdtranOS RTP session totals table.')
ad_gen_aos_rtp_session_totals_entry = mib_table_row((1, 3, 6, 1, 4, 1, 664, 5, 53, 5, 2, 1, 2, 1)).setIndexNames((0, 'ADTRAN-AOS-MEDIAGATEWAY-MIB', 'adGenAOSRtpSessionTotalsSessions'))
if mibBuilder.loadTexts:
adGenAOSRtpSessionTotalsEntry.setStatus('current')
if mibBuilder.loadTexts:
adGenAOSRtpSessionTotalsEntry.setDescription('An entry in the AdtranOS RTP session totals table.')
ad_gen_aos_rtp_session_totals_sessions = mib_table_column((1, 3, 6, 1, 4, 1, 664, 5, 53, 5, 2, 1, 2, 1, 1), integer32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
adGenAOSRtpSessionTotalsSessions.setStatus('current')
if mibBuilder.loadTexts:
adGenAOSRtpSessionTotalsSessions.setDescription('The totals number RTP sessions that have occured including sessions still currently active.')
ad_gen_aos_rtp_session_totals_session_duration = mib_table_column((1, 3, 6, 1, 4, 1, 664, 5, 53, 5, 2, 1, 2, 1, 2), display_string()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
adGenAOSRtpSessionTotalsSessionDuration.setStatus('current')
if mibBuilder.loadTexts:
adGenAOSRtpSessionTotalsSessionDuration.setDescription('Total duration for all RTP sessions.')
ad_gen_aos_rtp_session_totals_rx_packets = mib_table_column((1, 3, 6, 1, 4, 1, 664, 5, 53, 5, 2, 1, 2, 1, 3), integer32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
adGenAOSRtpSessionTotalsRxPackets.setStatus('current')
if mibBuilder.loadTexts:
adGenAOSRtpSessionTotalsRxPackets.setDescription('Number of packets recieved for all sessions.')
ad_gen_aos_rtp_session_totals_rx_octets = mib_table_column((1, 3, 6, 1, 4, 1, 664, 5, 53, 5, 2, 1, 2, 1, 4), integer32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
adGenAOSRtpSessionTotalsRxOctets.setStatus('current')
if mibBuilder.loadTexts:
adGenAOSRtpSessionTotalsRxOctets.setDescription('Number of octets recieved for all sessions.')
ad_gen_aos_rtp_session_totals_rx_packets_lost = mib_table_column((1, 3, 6, 1, 4, 1, 664, 5, 53, 5, 2, 1, 2, 1, 5), integer32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
adGenAOSRtpSessionTotalsRxPacketsLost.setStatus('obsolete')
if mibBuilder.loadTexts:
adGenAOSRtpSessionTotalsRxPacketsLost.setDescription('Number of recieve packets lost for all sessions.')
ad_gen_aos_rtp_session_totals_rx_packets_unknown = mib_table_column((1, 3, 6, 1, 4, 1, 664, 5, 53, 5, 2, 1, 2, 1, 6), integer32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
adGenAOSRtpSessionTotalsRxPacketsUnknown.setStatus('current')
if mibBuilder.loadTexts:
adGenAOSRtpSessionTotalsRxPacketsUnknown.setDescription('Number of received packets with unknown payload type during all sessions.')
ad_gen_aos_rtp_session_totals_tx_packets = mib_table_column((1, 3, 6, 1, 4, 1, 664, 5, 53, 5, 2, 1, 2, 1, 7), integer32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
adGenAOSRtpSessionTotalsTxPackets.setStatus('current')
if mibBuilder.loadTexts:
adGenAOSRtpSessionTotalsTxPackets.setDescription('Number of packets transmited for all sessions.')
ad_gen_aos_rtp_session_totals_tx_octets = mib_table_column((1, 3, 6, 1, 4, 1, 664, 5, 53, 5, 2, 1, 2, 1, 8), integer32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
adGenAOSRtpSessionTotalsTxOctets.setStatus('current')
if mibBuilder.loadTexts:
adGenAOSRtpSessionTotalsTxOctets.setDescription('Number of octets transmited for all sessions.')
ad_gen_aos_rtp_session_totals_rx_frame_late_discards = mib_table_column((1, 3, 6, 1, 4, 1, 664, 5, 53, 5, 2, 1, 2, 1, 9), integer32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
adGenAOSRtpSessionTotalsRxFrameLateDiscards.setStatus('obsolete')
if mibBuilder.loadTexts:
adGenAOSRtpSessionTotalsRxFrameLateDiscards.setDescription('Number of frames received late and discarded by the jitter buffer.')
ad_gen_aos_rtp_session_totals_rx_frame_overflows = mib_table_column((1, 3, 6, 1, 4, 1, 664, 5, 53, 5, 2, 1, 2, 1, 11), integer32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
adGenAOSRtpSessionTotalsRxFrameOverflows.setStatus('obsolete')
if mibBuilder.loadTexts:
adGenAOSRtpSessionTotalsRxFrameOverflows.setDescription('Number of received frames that overflow the jitter buffer.')
ad_gen_aos_rtp_session_totals_rx_frame_out_of_orders = mib_table_column((1, 3, 6, 1, 4, 1, 664, 5, 53, 5, 2, 1, 2, 1, 12), integer32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
adGenAOSRtpSessionTotalsRxFrameOutOfOrders.setStatus('current')
if mibBuilder.loadTexts:
adGenAOSRtpSessionTotalsRxFrameOutOfOrders.setDescription('Number of received frames that are declared out-of-order by the jitter buffer.')
ad_gen_aos_rtp_session_totals_clear_counters = mib_table_column((1, 3, 6, 1, 4, 1, 664, 5, 53, 5, 2, 1, 2, 1, 13), integer32()).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
adGenAOSRtpSessionTotalsClearCounters.setStatus('current')
if mibBuilder.loadTexts:
adGenAOSRtpSessionTotalsClearCounters.setDescription('Clear the accumulated totals for all RTP sessions.')
ad_gen_aos_rtp_session_totals_time_since_last_clear_counters = mib_table_column((1, 3, 6, 1, 4, 1, 664, 5, 53, 5, 2, 1, 2, 1, 14), display_string()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
adGenAOSRtpSessionTotalsTimeSinceLastClearCounters.setStatus('current')
if mibBuilder.loadTexts:
adGenAOSRtpSessionTotalsTimeSinceLastClearCounters.setDescription('Time elapsed since last clear counters for RTP session totals.')
ad_gen_aos_media_gateway_info_table = mib_table((1, 3, 6, 1, 4, 1, 664, 5, 53, 5, 2, 1, 3))
if mibBuilder.loadTexts:
adGenAOSMediaGatewayInfoTable.setStatus('current')
if mibBuilder.loadTexts:
adGenAOSMediaGatewayInfoTable.setDescription('The AdtranOS media-gateway processor information table.')
ad_gen_aos_media_gateway_info_entry = mib_table_row((1, 3, 6, 1, 4, 1, 664, 5, 53, 5, 2, 1, 3, 1)).setIndexNames((0, 'ADTRAN-AOS-MEDIAGATEWAY-MIB', 'adGenAOSMediaGatewayInfoIdentifier'))
if mibBuilder.loadTexts:
adGenAOSMediaGatewayInfoEntry.setStatus('current')
if mibBuilder.loadTexts:
adGenAOSMediaGatewayInfoEntry.setDescription('An entry in the AdtranOS RTP session table.')
ad_gen_aos_media_gateway_info_identifier = mib_table_column((1, 3, 6, 1, 4, 1, 664, 5, 53, 5, 2, 1, 3, 1, 1), integer32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
adGenAOSMediaGatewayInfoIdentifier.setStatus('current')
if mibBuilder.loadTexts:
adGenAOSMediaGatewayInfoIdentifier.setDescription('The indentifier of the media-gateway processor.')
ad_gen_aos_media_gateway_info_software_version = mib_table_column((1, 3, 6, 1, 4, 1, 664, 5, 53, 5, 2, 1, 3, 1, 2), display_string()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
adGenAOSMediaGatewayInfoSoftwareVersion.setStatus('current')
if mibBuilder.loadTexts:
adGenAOSMediaGatewayInfoSoftwareVersion.setDescription('The software version running on the media-gateway processor.')
ad_gen_aos_media_gateway_info_utilization = mib_table_column((1, 3, 6, 1, 4, 1, 664, 5, 53, 5, 2, 1, 3, 1, 3), integer32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
adGenAOSMediaGatewayInfoUtilization.setStatus('current')
if mibBuilder.loadTexts:
adGenAOSMediaGatewayInfoUtilization.setDescription('Current processor utilization of the media-gateway processor.')
ad_gen_aos_media_gateway_info_utilization_maximum = mib_table_column((1, 3, 6, 1, 4, 1, 664, 5, 53, 5, 2, 1, 3, 1, 4), integer32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
adGenAOSMediaGatewayInfoUtilizationMaximum.setStatus('current')
if mibBuilder.loadTexts:
adGenAOSMediaGatewayInfoUtilizationMaximum.setDescription('Current processor utilization of the media-gateway processor.')
ad_gen_aos_media_gateway_info_free_packet_buffers = mib_table_column((1, 3, 6, 1, 4, 1, 664, 5, 53, 5, 2, 1, 3, 1, 5), integer32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
adGenAOSMediaGatewayInfoFreePacketBuffers.setStatus('current')
if mibBuilder.loadTexts:
adGenAOSMediaGatewayInfoFreePacketBuffers.setDescription('Current number of free packet buffers on the media-gateway processor.')
ad_gen_aos_media_gateway_info_uptime = mib_table_column((1, 3, 6, 1, 4, 1, 664, 5, 53, 5, 2, 1, 3, 1, 6), display_string()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
adGenAOSMediaGatewayInfoUptime.setStatus('current')
if mibBuilder.loadTexts:
adGenAOSMediaGatewayInfoUptime.setDescription('Current uptime of the media-gateway processor.')
ad_gen_aos_rtp_channel_total_table = mib_table((1, 3, 6, 1, 4, 1, 664, 5, 53, 5, 2, 1, 4))
if mibBuilder.loadTexts:
adGenAOSRtpChannelTotalTable.setStatus('current')
if mibBuilder.loadTexts:
adGenAOSRtpChannelTotalTable.setDescription('The AdtranOS Media-gateway channel totals table.')
ad_gen_aos_rtp_channel_total_entry = mib_table_row((1, 3, 6, 1, 4, 1, 664, 5, 53, 5, 2, 1, 4, 1)).setIndexNames((0, 'ADTRAN-AOS-MEDIAGATEWAY-MIB', 'adGenAOSRtpChannelTotalId'))
if mibBuilder.loadTexts:
adGenAOSRtpChannelTotalEntry.setStatus('current')
if mibBuilder.loadTexts:
adGenAOSRtpChannelTotalEntry.setDescription('An entry in the AdtranOS RTP session table.')
ad_gen_aos_rtp_channel_total_id = mib_table_column((1, 3, 6, 1, 4, 1, 664, 5, 53, 5, 2, 1, 4, 1, 1), integer32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
adGenAOSRtpChannelTotalId.setStatus('current')
if mibBuilder.loadTexts:
adGenAOSRtpChannelTotalId.setDescription('Identifier value for the channel on the media-gateway processor.')
ad_gen_aos_rtp_channel_total_id_name = mib_table_column((1, 3, 6, 1, 4, 1, 664, 5, 53, 5, 2, 1, 4, 1, 2), display_string()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
adGenAOSRtpChannelTotalIdName.setStatus('current')
if mibBuilder.loadTexts:
adGenAOSRtpChannelTotalIdName.setDescription('Identifier name of the channel on the media-gateway processor.')
ad_gen_aos_rtp_channel_total_sessions = mib_table_column((1, 3, 6, 1, 4, 1, 664, 5, 53, 5, 2, 1, 4, 1, 3), integer32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
adGenAOSRtpChannelTotalSessions.setStatus('current')
if mibBuilder.loadTexts:
adGenAOSRtpChannelTotalSessions.setDescription('Number of RTP sessions that have transpired on a given media-gateway channel.')
ad_gen_aos_rtp_channel_total_session_duration = mib_table_column((1, 3, 6, 1, 4, 1, 664, 5, 53, 5, 2, 1, 4, 1, 4), display_string()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
adGenAOSRtpChannelTotalSessionDuration.setStatus('current')
if mibBuilder.loadTexts:
adGenAOSRtpChannelTotalSessionDuration.setDescription('Duration of all RTP sessions for a given media-gateway channel.')
ad_gen_aos_rtp_channel_total_rx_packets = mib_table_column((1, 3, 6, 1, 4, 1, 664, 5, 53, 5, 2, 1, 4, 1, 5), integer32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
adGenAOSRtpChannelTotalRxPackets.setStatus('current')
if mibBuilder.loadTexts:
adGenAOSRtpChannelTotalRxPackets.setDescription('Number of received packets for all RTP sessions for a given media-gateway channel.')
ad_gen_aos_rtp_channel_total_rx_octets = mib_table_column((1, 3, 6, 1, 4, 1, 664, 5, 53, 5, 2, 1, 4, 1, 6), integer32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
adGenAOSRtpChannelTotalRxOctets.setStatus('current')
if mibBuilder.loadTexts:
adGenAOSRtpChannelTotalRxOctets.setDescription('Number of received octets for all RTP sessions for a given media-gateway channel.')
ad_gen_aos_rtp_channel_total_rx_packets_lost = mib_table_column((1, 3, 6, 1, 4, 1, 664, 5, 53, 5, 2, 1, 4, 1, 7), integer32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
adGenAOSRtpChannelTotalRxPacketsLost.setStatus('obsolete')
if mibBuilder.loadTexts:
adGenAOSRtpChannelTotalRxPacketsLost.setDescription('Number of receive packets declared lost for all RTP sessions for a given media-gateway channel.')
ad_gen_aos_rtp_channel_total_rx_packets_unknown = mib_table_column((1, 3, 6, 1, 4, 1, 664, 5, 53, 5, 2, 1, 4, 1, 8), integer32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
adGenAOSRtpChannelTotalRxPacketsUnknown.setStatus('current')
if mibBuilder.loadTexts:
adGenAOSRtpChannelTotalRxPacketsUnknown.setDescription('Number of receive packets declared unknown for all RTP sessions for a given media-gateway channel.')
ad_gen_aos_rtp_channel_total_tx_packets = mib_table_column((1, 3, 6, 1, 4, 1, 664, 5, 53, 5, 2, 1, 4, 1, 9), integer32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
adGenAOSRtpChannelTotalTxPackets.setStatus('current')
if mibBuilder.loadTexts:
adGenAOSRtpChannelTotalTxPackets.setDescription('Number of transmitted packets for all RTP sessions for a given media-gateway channel.')
ad_gen_aos_rtp_channel_total_tx_octets = mib_table_column((1, 3, 6, 1, 4, 1, 664, 5, 53, 5, 2, 1, 4, 1, 10), integer32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
adGenAOSRtpChannelTotalTxOctets.setStatus('current')
if mibBuilder.loadTexts:
adGenAOSRtpChannelTotalTxOctets.setDescription('The duration of all RTP sessions for a given media-gateway channel.')
ad_gen_aos_rtp_channel_total_rx_max_depth = mib_table_column((1, 3, 6, 1, 4, 1, 664, 5, 53, 5, 2, 1, 4, 1, 11), integer32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
adGenAOSRtpChannelTotalRxMaxDepth.setStatus('obsolete')
if mibBuilder.loadTexts:
adGenAOSRtpChannelTotalRxMaxDepth.setDescription('Maximum depth fo jitter buffer in packets for this RTP session.')
ad_gen_aos_rtp_channel_total_rx_frame_late_discards = mib_table_column((1, 3, 6, 1, 4, 1, 664, 5, 53, 5, 2, 1, 4, 1, 12), integer32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
adGenAOSRtpChannelTotalRxFrameLateDiscards.setStatus('obsolete')
if mibBuilder.loadTexts:
adGenAOSRtpChannelTotalRxFrameLateDiscards.setDescription('Number of late frames discarded for all RTP sessions for a given media-gateway channel.')
ad_gen_aos_rtp_channel_total_rx_frame_overflows = mib_table_column((1, 3, 6, 1, 4, 1, 664, 5, 53, 5, 2, 1, 4, 1, 14), integer32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
adGenAOSRtpChannelTotalRxFrameOverflows.setStatus('obsolete')
if mibBuilder.loadTexts:
adGenAOSRtpChannelTotalRxFrameOverflows.setDescription('Number of received frames that overflow the jitter buffer for all RTP sessions for a given media-gateway channel.')
ad_gen_aos_rtp_channel_total_rx_frame_out_of_orders = mib_table_column((1, 3, 6, 1, 4, 1, 664, 5, 53, 5, 2, 1, 4, 1, 15), integer32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
adGenAOSRtpChannelTotalRxFrameOutOfOrders.setStatus('current')
if mibBuilder.loadTexts:
adGenAOSRtpChannelTotalRxFrameOutOfOrders.setDescription('Number of received frames that are declared out-of-order by the jitter buffer for all RTP sessions for a given media-gateway channel.')
ad_gen_aos_rtp_channel_clear_counters = mib_table_column((1, 3, 6, 1, 4, 1, 664, 5, 53, 5, 2, 1, 4, 1, 16), integer32()).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
adGenAOSRtpChannelClearCounters.setStatus('current')
if mibBuilder.loadTexts:
adGenAOSRtpChannelClearCounters.setDescription('Clear the accumulated channel totals for all RTP sessions.')
ad_gen_aos_rtp_channel_time_since_last_clear_counters = mib_table_column((1, 3, 6, 1, 4, 1, 664, 5, 53, 5, 2, 1, 4, 1, 17), display_string()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
adGenAOSRtpChannelTimeSinceLastClearCounters.setStatus('current')
if mibBuilder.loadTexts:
adGenAOSRtpChannelTimeSinceLastClearCounters.setDescription('Time elapsed since last clear counters for RTP session totals.')
ad_gen_aos_media_gateway_compliance = module_compliance((1, 3, 6, 1, 4, 1, 664, 5, 53, 5, 2, 99, 1, 1)).setObjects(('ADTRAN-AOS-MEDIAGATEWAY-MIB', 'adGenAOSMediaGatewayRtpSessionGroup'), ('ADTRAN-AOS-MEDIAGATEWAY-MIB', 'adGenAOSMediaGatewayRtpSessionTotalsGroup'), ('ADTRAN-AOS-MEDIAGATEWAY-MIB', 'adGenAOSMediaGatewayInfoGroup'), ('ADTRAN-AOS-MEDIAGATEWAY-MIB', 'adGenAOSMediaGatewayRtpChannelTotalsGroup'))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ad_gen_aos_media_gateway_compliance = adGenAOSMediaGatewayCompliance.setStatus('current')
if mibBuilder.loadTexts:
adGenAOSMediaGatewayCompliance.setDescription('The compliance statement for SNMPv2 entities which implement the adGenAOSMediaGateway MIB.')
ad_gen_aos_media_gateway_rtp_session_group = object_group((1, 3, 6, 1, 4, 1, 664, 5, 53, 5, 2, 99, 2, 1)).setObjects(('ADTRAN-AOS-MEDIAGATEWAY-MIB', 'adGenAOSRtpSessionChannelId'), ('ADTRAN-AOS-MEDIAGATEWAY-MIB', 'adGenAOSRtpSessionChannelIdName'), ('ADTRAN-AOS-MEDIAGATEWAY-MIB', 'adGenAOSRtpSessionStatus'), ('ADTRAN-AOS-MEDIAGATEWAY-MIB', 'adGenAOSRtpSessionStartTime'), ('ADTRAN-AOS-MEDIAGATEWAY-MIB', 'adGenAOSRtpSessionDuration'), ('ADTRAN-AOS-MEDIAGATEWAY-MIB', 'adGenAOSRtpSessionVocoder'), ('ADTRAN-AOS-MEDIAGATEWAY-MIB', 'adGenAOSRtpSessionVAD'), ('ADTRAN-AOS-MEDIAGATEWAY-MIB', 'adGenAOSRtpSessionTdmPortDescription'), ('ADTRAN-AOS-MEDIAGATEWAY-MIB', 'adGenAOSRtpSessionLocalIPAddress'), ('ADTRAN-AOS-MEDIAGATEWAY-MIB', 'adGenAOSRtpSessionLocalUdpPort'), ('ADTRAN-AOS-MEDIAGATEWAY-MIB', 'adGenAOSRtpSessionSIPPortDescription'), ('ADTRAN-AOS-MEDIAGATEWAY-MIB', 'adGenAOSRtpSessionRemoteIPAddress'), ('ADTRAN-AOS-MEDIAGATEWAY-MIB', 'adGenAOSRtpSessionRemoteUdpPort'), ('ADTRAN-AOS-MEDIAGATEWAY-MIB', 'adGenAOSRtpSessionTxFramesPerPacket'), ('ADTRAN-AOS-MEDIAGATEWAY-MIB', 'adGenAOSRtpSessionEchoCancellerEnabled'), ('ADTRAN-AOS-MEDIAGATEWAY-MIB', 'adGenAOSRtpSessionRxPackets'), ('ADTRAN-AOS-MEDIAGATEWAY-MIB', 'adGenAOSRtpSessionRxOctets'), ('ADTRAN-AOS-MEDIAGATEWAY-MIB', 'adGenAOSRtpSessionRxPacketsLost'), ('ADTRAN-AOS-MEDIAGATEWAY-MIB', 'adGenAOSRtpSessionRxPacketsUnknown'), ('ADTRAN-AOS-MEDIAGATEWAY-MIB', 'adGenAOSRtpSessionRxJitterBufferDepth'), ('ADTRAN-AOS-MEDIAGATEWAY-MIB', 'adGenAOSRtpSessionRxMaxJitterBufferDepth'), ('ADTRAN-AOS-MEDIAGATEWAY-MIB', 'adGenAOSRtpSessionRxFrameLateDiscards'), ('ADTRAN-AOS-MEDIAGATEWAY-MIB', 'adGenAOSRtpSessionRxFrameOverflows'), ('ADTRAN-AOS-MEDIAGATEWAY-MIB', 'adGenAOSRtpSessionRxFrameOutOfOrders'), ('ADTRAN-AOS-MEDIAGATEWAY-MIB', 'adGenAOSRtpSessionRxSyncSource'), ('ADTRAN-AOS-MEDIAGATEWAY-MIB', 'adGenAOSRtpSessionTxPackets'), ('ADTRAN-AOS-MEDIAGATEWAY-MIB', 'adGenAOSRtpSessionTxOctets'), ('ADTRAN-AOS-MEDIAGATEWAY-MIB', 'adGenAOSRtpSessionTxSyncSource'))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ad_gen_aos_media_gateway_rtp_session_group = adGenAOSMediaGatewayRtpSessionGroup.setStatus('current')
if mibBuilder.loadTexts:
adGenAOSMediaGatewayRtpSessionGroup.setDescription('The Media-Gateway Real-Time Protocol Session Group.')
ad_gen_aos_media_gateway_rtp_session_totals_group = object_group((1, 3, 6, 1, 4, 1, 664, 5, 53, 5, 2, 99, 2, 2)).setObjects(('ADTRAN-AOS-MEDIAGATEWAY-MIB', 'adGenAOSRtpSessionTotalsSessions'), ('ADTRAN-AOS-MEDIAGATEWAY-MIB', 'adGenAOSRtpSessionTotalsSessionDuration'), ('ADTRAN-AOS-MEDIAGATEWAY-MIB', 'adGenAOSRtpSessionTotalsRxPackets'), ('ADTRAN-AOS-MEDIAGATEWAY-MIB', 'adGenAOSRtpSessionTotalsRxOctets'), ('ADTRAN-AOS-MEDIAGATEWAY-MIB', 'adGenAOSRtpSessionTotalsRxPacketsLost'), ('ADTRAN-AOS-MEDIAGATEWAY-MIB', 'adGenAOSRtpSessionTotalsRxPacketsUnknown'), ('ADTRAN-AOS-MEDIAGATEWAY-MIB', 'adGenAOSRtpSessionTotalsTxPackets'), ('ADTRAN-AOS-MEDIAGATEWAY-MIB', 'adGenAOSRtpSessionTotalsTxOctets'), ('ADTRAN-AOS-MEDIAGATEWAY-MIB', 'adGenAOSRtpSessionTotalsRxFrameLateDiscards'), ('ADTRAN-AOS-MEDIAGATEWAY-MIB', 'adGenAOSRtpSessionTotalsRxFrameOverflows'), ('ADTRAN-AOS-MEDIAGATEWAY-MIB', 'adGenAOSRtpSessionTotalsRxFrameOutOfOrders'), ('ADTRAN-AOS-MEDIAGATEWAY-MIB', 'adGenAOSRtpSessionTotalsClearCounters'), ('ADTRAN-AOS-MEDIAGATEWAY-MIB', 'adGenAOSRtpSessionTotalsTimeSinceLastClearCounters'))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ad_gen_aos_media_gateway_rtp_session_totals_group = adGenAOSMediaGatewayRtpSessionTotalsGroup.setStatus('current')
if mibBuilder.loadTexts:
adGenAOSMediaGatewayRtpSessionTotalsGroup.setDescription('The Media-Gateway Real-Time Protocol Session Totals Group.')
ad_gen_aos_media_gateway_info_group = object_group((1, 3, 6, 1, 4, 1, 664, 5, 53, 5, 2, 99, 2, 3)).setObjects(('ADTRAN-AOS-MEDIAGATEWAY-MIB', 'adGenAOSMediaGatewayInfoIdentifier'), ('ADTRAN-AOS-MEDIAGATEWAY-MIB', 'adGenAOSMediaGatewayInfoSoftwareVersion'), ('ADTRAN-AOS-MEDIAGATEWAY-MIB', 'adGenAOSMediaGatewayInfoUtilization'), ('ADTRAN-AOS-MEDIAGATEWAY-MIB', 'adGenAOSMediaGatewayInfoUtilizationMaximum'), ('ADTRAN-AOS-MEDIAGATEWAY-MIB', 'adGenAOSMediaGatewayInfoFreePacketBuffers'), ('ADTRAN-AOS-MEDIAGATEWAY-MIB', 'adGenAOSMediaGatewayInfoUptime'))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ad_gen_aos_media_gateway_info_group = adGenAOSMediaGatewayInfoGroup.setStatus('current')
if mibBuilder.loadTexts:
adGenAOSMediaGatewayInfoGroup.setDescription('The Media-Gateway Information Group.')
ad_gen_aos_media_gateway_rtp_channel_totals_group = object_group((1, 3, 6, 1, 4, 1, 664, 5, 53, 5, 2, 99, 2, 4)).setObjects(('ADTRAN-AOS-MEDIAGATEWAY-MIB', 'adGenAOSRtpChannelTotalId'), ('ADTRAN-AOS-MEDIAGATEWAY-MIB', 'adGenAOSRtpChannelTotalIdName'), ('ADTRAN-AOS-MEDIAGATEWAY-MIB', 'adGenAOSRtpChannelTotalSessions'), ('ADTRAN-AOS-MEDIAGATEWAY-MIB', 'adGenAOSRtpChannelTotalSessionDuration'), ('ADTRAN-AOS-MEDIAGATEWAY-MIB', 'adGenAOSRtpChannelTotalRxPackets'), ('ADTRAN-AOS-MEDIAGATEWAY-MIB', 'adGenAOSRtpChannelTotalRxOctets'), ('ADTRAN-AOS-MEDIAGATEWAY-MIB', 'adGenAOSRtpChannelTotalRxPacketsLost'), ('ADTRAN-AOS-MEDIAGATEWAY-MIB', 'adGenAOSRtpChannelTotalRxPacketsUnknown'), ('ADTRAN-AOS-MEDIAGATEWAY-MIB', 'adGenAOSRtpChannelTotalTxPackets'), ('ADTRAN-AOS-MEDIAGATEWAY-MIB', 'adGenAOSRtpChannelTotalTxOctets'), ('ADTRAN-AOS-MEDIAGATEWAY-MIB', 'adGenAOSRtpChannelTotalRxMaxDepth'), ('ADTRAN-AOS-MEDIAGATEWAY-MIB', 'adGenAOSRtpChannelTotalRxFrameLateDiscards'), ('ADTRAN-AOS-MEDIAGATEWAY-MIB', 'adGenAOSRtpChannelTotalRxFrameOverflows'), ('ADTRAN-AOS-MEDIAGATEWAY-MIB', 'adGenAOSRtpChannelTotalRxFrameOutOfOrders'), ('ADTRAN-AOS-MEDIAGATEWAY-MIB', 'adGenAOSRtpChannelClearCounters'), ('ADTRAN-AOS-MEDIAGATEWAY-MIB', 'adGenAOSRtpChannelTimeSinceLastClearCounters'))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ad_gen_aos_media_gateway_rtp_channel_totals_group = adGenAOSMediaGatewayRtpChannelTotalsGroup.setStatus('current')
if mibBuilder.loadTexts:
adGenAOSMediaGatewayRtpChannelTotalsGroup.setDescription('The Media-Gateway Real-Time Protocol Channel Totals Group.')
mibBuilder.exportSymbols('ADTRAN-AOS-MEDIAGATEWAY-MIB', adGenAOSMediaGatewayConformance=adGenAOSMediaGatewayConformance, PYSNMP_MODULE_ID=adGenAOSMediaGatewayMIB, adGenAOSRtpSessionTxFramesPerPacket=adGenAOSRtpSessionTxFramesPerPacket, adGenAOSRtpChannelTotalSessionDuration=adGenAOSRtpChannelTotalSessionDuration, adGenAOSRtpSessionTotalsTxOctets=adGenAOSRtpSessionTotalsTxOctets, adGenAOSRtpSessionTotalsTimeSinceLastClearCounters=adGenAOSRtpSessionTotalsTimeSinceLastClearCounters, adGenAOSMediaGatewayCompliance=adGenAOSMediaGatewayCompliance, adGenAOSRtpSessionTotalsRxFrameLateDiscards=adGenAOSRtpSessionTotalsRxFrameLateDiscards, adGenAOSRtpSessionDuration=adGenAOSRtpSessionDuration, adGenAOSRtpSessionEchoCancellerEnabled=adGenAOSRtpSessionEchoCancellerEnabled, adGenAOSMediaGatewayMIB=adGenAOSMediaGatewayMIB, adGenAOSRtpSessionTotalsRxFrameOverflows=adGenAOSRtpSessionTotalsRxFrameOverflows, adGenAOSRtpSessionSIPPortDescription=adGenAOSRtpSessionSIPPortDescription, adGenAOSRtpSessionRxFrameOutOfOrders=adGenAOSRtpSessionRxFrameOutOfOrders, adGenAOSMediaGateway=adGenAOSMediaGateway, adGenAOSMediaGatewayInfoIdentifier=adGenAOSMediaGatewayInfoIdentifier, adGenAOSRtpSessionTotalsTxPackets=adGenAOSRtpSessionTotalsTxPackets, adGenAOSRtpSessionTotalsClearCounters=adGenAOSRtpSessionTotalsClearCounters, adGenAOSMediaGatewayObjects=adGenAOSMediaGatewayObjects, adGenAOSRtpSessionRxOctets=adGenAOSRtpSessionRxOctets, adGenAOSMediaGatewayInfoFreePacketBuffers=adGenAOSMediaGatewayInfoFreePacketBuffers, adGenAOSMediaGatewayInfoUtilization=adGenAOSMediaGatewayInfoUtilization, adGenAOSRtpSessionTotalsRxFrameOutOfOrders=adGenAOSRtpSessionTotalsRxFrameOutOfOrders, adGenAOSMediaGatewayRtpChannelTotalsGroup=adGenAOSMediaGatewayRtpChannelTotalsGroup, adGenAOSRtpSessionTotalsRxOctets=adGenAOSRtpSessionTotalsRxOctets, adGenAOSRtpChannelTotalRxFrameOverflows=adGenAOSRtpChannelTotalRxFrameOverflows, adGenAOSMediaGatewayMIBGroups=adGenAOSMediaGatewayMIBGroups, adGenAOSRtpSessionRemoteIPAddress=adGenAOSRtpSessionRemoteIPAddress, adGenAOSMediaGatewayInfoTable=adGenAOSMediaGatewayInfoTable, adGenAOSMediaGatewayInfoUtilizationMaximum=adGenAOSMediaGatewayInfoUtilizationMaximum, adGenAOSRtpChannelTotalId=adGenAOSRtpChannelTotalId, adGenAOSRtpChannelTotalRxPacketsLost=adGenAOSRtpChannelTotalRxPacketsLost, adGenAOSRtpSessionTotalsSessionDuration=adGenAOSRtpSessionTotalsSessionDuration, adGenAOSRtpSessionRxJitterBufferDepth=adGenAOSRtpSessionRxJitterBufferDepth, adGenAOSMediaGatewayInfoUptime=adGenAOSMediaGatewayInfoUptime, adGenAOSRtpChannelTotalSessions=adGenAOSRtpChannelTotalSessions, adGenAOSRtpSessionTxSyncSource=adGenAOSRtpSessionTxSyncSource, adGenAOSRtpSessionEntry=adGenAOSRtpSessionEntry, adGenAOSRtpChannelTotalRxPackets=adGenAOSRtpChannelTotalRxPackets, adGenAOSRtpSessionRxFrameLateDiscards=adGenAOSRtpSessionRxFrameLateDiscards, adGenAOSRtpSessionRxPackets=adGenAOSRtpSessionRxPackets, adGenAOSRtpSessionChannelIdName=adGenAOSRtpSessionChannelIdName, adGenAOSRtpSessionTotalsEntry=adGenAOSRtpSessionTotalsEntry, adGenAOSRtpSessionLocalUdpPort=adGenAOSRtpSessionLocalUdpPort, adGenAOSRtpChannelTotalTxPackets=adGenAOSRtpChannelTotalTxPackets, adGenAOSRtpSessionVAD=adGenAOSRtpSessionVAD, adGenAOSRtpChannelTotalIdName=adGenAOSRtpChannelTotalIdName, adGenAOSRtpSessionTxPackets=adGenAOSRtpSessionTxPackets, adGenAOSMediaGatewayRtpSessionTotalsGroup=adGenAOSMediaGatewayRtpSessionTotalsGroup, adGenAOSRtpSessionStatus=adGenAOSRtpSessionStatus, adGenAOSRtpChannelTotalEntry=adGenAOSRtpChannelTotalEntry, adGenAOSRtpSessionRxSyncSource=adGenAOSRtpSessionRxSyncSource, adGenAOSRtpSessionRxPacketsLost=adGenAOSRtpSessionRxPacketsLost, adGenAOSRtpSessionRxMaxJitterBufferDepth=adGenAOSRtpSessionRxMaxJitterBufferDepth, adGenAOSRtpChannelTotalRxMaxDepth=adGenAOSRtpChannelTotalRxMaxDepth, adGenAOSRtpSessionTotalsRxPacketsUnknown=adGenAOSRtpSessionTotalsRxPacketsUnknown, adGenAOSMediaGatewayInfoEntry=adGenAOSMediaGatewayInfoEntry, adGenAOSRtpSessionTable=adGenAOSRtpSessionTable, adGenAOSRtpChannelClearCounters=adGenAOSRtpChannelClearCounters, adGenAOSRtpChannelTotalRxFrameOutOfOrders=adGenAOSRtpChannelTotalRxFrameOutOfOrders, adGenAOSRtpSessionVocoder=adGenAOSRtpSessionVocoder, adGenAOSMediaGatewayCompliances=adGenAOSMediaGatewayCompliances, adGenAOSRtpSessionTotalsTable=adGenAOSRtpSessionTotalsTable, adGenAOSMediaGatewayInfoSoftwareVersion=adGenAOSMediaGatewayInfoSoftwareVersion, adGenAOSRtpSessionTotalsSessions=adGenAOSRtpSessionTotalsSessions, adGenAOSRtpChannelTotalRxPacketsUnknown=adGenAOSRtpChannelTotalRxPacketsUnknown, adGenAOSRtpSessionRemoteUdpPort=adGenAOSRtpSessionRemoteUdpPort, adGenAOSRtpChannelTotalRxFrameLateDiscards=adGenAOSRtpChannelTotalRxFrameLateDiscards, adGenAOSRtpSessionTotalsRxPackets=adGenAOSRtpSessionTotalsRxPackets, adGenAOSRtpSessionTdmPortDescription=adGenAOSRtpSessionTdmPortDescription, adGenAOSRtpSessionTxOctets=adGenAOSRtpSessionTxOctets, adGenAOSRtpSessionTotalsRxPacketsLost=adGenAOSRtpSessionTotalsRxPacketsLost, adGenAOSMediaGatewayRtpSessionGroup=adGenAOSMediaGatewayRtpSessionGroup, adGenAOSRtpSessionLocalIPAddress=adGenAOSRtpSessionLocalIPAddress, adGenAOSRtpChannelTotalRxOctets=adGenAOSRtpChannelTotalRxOctets, adGenAOSMediaGatewayInfoGroup=adGenAOSMediaGatewayInfoGroup, adGenAOSRtpSessionRxFrameOverflows=adGenAOSRtpSessionRxFrameOverflows, adGenAOSRtpSessionChannelId=adGenAOSRtpSessionChannelId, adGenAOSRtpSessionStartTime=adGenAOSRtpSessionStartTime, adGenAOSRtpSessionRxPacketsUnknown=adGenAOSRtpSessionRxPacketsUnknown, adGenAOSRtpChannelTotalTable=adGenAOSRtpChannelTotalTable, adGenAOSRtpChannelTotalTxOctets=adGenAOSRtpChannelTotalTxOctets, adGenAOSRtpChannelTimeSinceLastClearCounters=adGenAOSRtpChannelTimeSinceLastClearCounters) |
# -*- coding: utf-8 -*-
def find_floor(string: str) -> int:
floor = 0
for direction in string:
if direction == '(':
floor += 1
else:
floor -= 1
return floor
def find_position(string: str) -> int:
floor = 0
for i, s in enumerate(string):
floor = floor + find_floor(s)
if floor == -1:
break
return i+1
if __name__ == '__main__':
floors = []
for string in [
'(())',
'()()',
'(((',
'(()(()(',
'))(((((',
'())',
'))(',
')))',
')())())'
]:
floors.append(find_floor(string))
print(floors == [0, 0, 3, 3, 3, -1, -1, -3, -3])
d = '()()(()()()(()()((()((()))((()((((()()((((()))()((((())(((((((()(((((((((()(((())(()()(()((()()(()(())(()((((()((()()()((((())((((((()(()(((()())(()((((()))())(())(()(()()))))))))((((((((((((()())()())())(())))(((()()()((((()(((()(()(()()(()(()()(()(((((((())(())(())())))((()())()((((()()((()))(((()()()())))(())))((((())(((()())(())(()))(()((((()())))())((()(())(((()((((()((()(())())))((()))()()(()(()))))((((((((()())((((()()((((()(()())(((((()(()())()))())(((()))()(()(()(()((((()(())(()))(((((()()(()()()(()(((())())(((()()(()()))(((()()(((())())(()(())())()()(())()()()((()(((()(())((()()((())()))((()()))((()()())((((()(()()(()(((()))()(()))))((()(((()()()))(()(((())()(()((()())(()(()()(()())(())()(((()(()())()((((()((()))))())()))((()()()()(())()())()()()((((()))))(()(((()()(((((((())()))()((((()((())()(()())(())()))(()(()())(((((((())))(((()))())))))()))())((())(()()((())()())()))))()((()()())(())((())((((()())())()()()(((()))())))()()))())(()()()(()((((((()()))())()))()(((()(((())((((()()()(()))())()()))))())()))())((())()())(((((())())((())())))(((())(((())(((((()(((((())(()(()())())(()(())(()))(()((((()))())()))))())))((()(()))))())))(((((())()))())()))))()))))(((()))()))))((()))((()((()(()(())()())))(()()()(())()))()((((())))))))(())(()((()()))(()))(()))(()((()))))))()()((((()()))()())()))))))()()()))(()((())(()))((()()()())()(((()((((())())))()((((()(()))))))())))()()())()))(()))))(()())()))))))((())))))))())()))()((())())))(()((()))()))(())))))(()))()())()()))((()(()))()()()()))))())()()))())(())()()))()))((()))))()()(()())))))()()()))((((()))()))))(()(())))(()())))((())())(()))()))))()())))()())()())))))))))()()))))())))((())((()))))())))(((()())))))))(()))()()))(()))()))))()())))))())((((()())))))))())))()()))))))))()))()))))()))))))(())))))))))())))))))))))))))())())((())))))))))()))((())))()))))))))())()(()))))))())))))()()()())()(()()()(()())(()))()()()(()())))())())))()))))())))))))()()()()())(())())()())()))))(()()()()()))))()))())())))((()())()())))()))()))))(()())))()))))))))(((()))()()))))))))))))))))))))(()))(()((()))())))())(()))(()(()(())))))()(()))()))()()))))))))))))()((()())(())())()(())))))())()())((()()))))(()()))))())()(())()))))))))))))))))))))()))(()(()())))))))()()((()))()))))))((())))()))))))))((()))())()()))())()()))((()))())))))))))))(()())()))(())((()(()()))(()())(())))()())(()(())()()))))()))()(()))))))(()))))))))))(()))())))))))))())))))())))(())))))()))))(())())))))))))()(()))))()())))())(()))()())))))))))))))())()()))))()))))))())))))()))))(())(()()()()((())()))())(()))((())()))())())(())(()()))))()))(())()()((())(())))(())))()))())))))))))()(((((())())))(())()))))(())))((()))()(((((((()))))()()))(())))))()(()))))(()()))()))())))))))(()())()))))))))())))(()))())()))(())()((())())()())())(()(()))))()))))))((()())(())()()(()())))()()))(())(())(()))())))()))(()))()()))((((()))))()))((()()()))))()))()))())))(()))()))))(())))()))())()(()))()())))())))))))())))())))()()))))))(()))())())))()))()()())())))))))))))))())))()))(()()))))())))())()(())))())))))))))))))))))()()())())))))()()()((()(()))()()(())()())()))()))))()()()))))))((()))))))))()(()(()((((((()()((()())))))))))))()))())))))((())())(()))())))())))))())()()())(())))())))()())())(())))))))()()(())))()))())))())())())()))))))))()))(()()()())())())))(())())))))))()()())()))))())))())()(())())))))))()())()))(()()(())())))()(()((()()((()()(((((())(()())()))(())()))(())))(())))))))()))()))((()))()))()))))))))()))))))))((()()())(()))(((()))(())))()))((())(((())))()())))())))))((())))))(())())((((((())())()(()))()(()((()())))((())()(()(()))))(())(()()())(())))())((()(((())())))(((()())())))())()(())())((((()()))))())((()))()()()()(())(((((((()()()((()))())(()())))(())())((((()()(()))))()((())))((())()))()(((()))())))()))((()(()))(())(()((((())((((()()(()()))(((())(()))))((((()(()))(())))))((()))(()))((()(((()(()))(()(()((()(())(()(()(()(()()((()))())(((())(()(()))))(()))()()))(())))(())()(((())(()))()((((()()))))())(()))))((())()((((()(((()))())())(((()))()())((())(())())(())()(())()(()()((((((()()))))()()(((()()))))()())()(((()(()))(()(()())(()(()))))(((((()(((())())))))(((((()((()()((())())((((((()(())(()()((()()()()()()()(()()))()(((()))()))(((((((())(((()((()())()((((())(((()(())))()((()(()()()((())((()())()))()))())))())((((((()))(()(()()()))(()((()(()(()))()((()(((()()()((())(((((())()(()))())())((()(())))(()(()())(())((())())())(((()()()(())))))())(()))))))()))))))())((()()()))((()((((((()))(((()((((()()()(((()))())()(()()(((()((()()()()())()()))()()()(()(())((()))))(()))())))))))()(()()(((((())()(()(((((()((()(()()())(()((((((((()((((((())()((((()()()((()((()((((((()))((())))))))())()))((()(()))()(()()(()((())((()()((((((((((((()())(()()()))((((()((((((())(()))())(()()((()()))()(((((((()((()()((((((()(((())))((())))((((((((()()(((((((())(((((()())(((())((())()((((()(((((((()(()(((()((((((()(((()(((((((((((()()((()()(()))((()()(((()(((())))((((())()(()(((())()(()(((())(((((((((((()))())))((((((())((()()((((()())())((((()()))((())(((((()(()()(()()()((())(()((()()((((()(((((()((()(()((((()())((((((()(((((()()(()(()((((())))(())(())(())((((()(()()((((()((((()()((()((((((())))(((((()))))()))(()((((((((()(((())())(((())))(()(()((())(((()((()()(((((()((()()(((())()(()))(((((((())(()(((((()))((()((()((()))(())())((((()((((())()(()))(((()(((((((((((((((())(((((((((()))(((()(()()()()((((((()((())()((((((((()(())(((((((((((()(()((())()((()()(()(()()((((()()((())(()((()()(()()((((()(((((((())))((((())(())()(((()()((()()((((()((()(((()((())(((()()()((((()((((()()(()(()((((((((())(()(((((())(()())(((((((()())()(()((((()((())(()()())((((()()(((()((((())(())(()()(((((((((()()))()(((())(()(()((((((())(()()())(()))()()(((()(((()((())(()(((((((()(()(()((()(((((()(()((()(()((((((()((((()()((((()(((()((())(()(()((()()((((()()(())()(())(((())(()((((((((()())(((((((((()(())()((((())))()))()()(((((()()((((((())(()()(((()(()(((((((()(()(((((((())(())((((()((()(())))((((()()())(()))((()())((((()(((((()(()(())(()(()()())(((((()(((((()((((()()((((((((()()))(()((((((())((((())()(()(((()()()(((()(()(())(())(((((()(())())((((())(())(()(((()(((((())((((())())((()(((((((()(((())(()(()))(((((((((()((()((()()(()((((())(((()((())((((())(()(((()(((()(()((((()(((())(()(((()(()()(()(()((()()(()())(())())((()(()(((()(((()(((()()(((((((((()(((((((((()()(((()(((()())((((()(()(((()()()((())((((((((((())(()(((()((((()())((((()((()))(((()()()(((((()(((((((())((()())(()((((())((((((((())(()((()((((((((((()()((()((()()))(((()())()())()(((()())()()(()(()(((((((())()))(())()))())()()((())()((()((((()((()((())(((((()((((((()(())))(()))())(((()))((()()(()(((()))((((())()(((()))))()(()(())()(((((())(()(()(())(())()((()()()((((()(())((()())(()(()))(()(()(()()(())()()(()((())()((()))))()))((()(()()()()((()())(()))())()(()(((((((((())())((()((()((((((())()((((())(((())((()(()()()((())(()((())(((()((((()()((()(()(((((())()))()((((((()))((())(((()()))(((())(())()))(((((((())(())())()(())(((((()))()((()))()(()()((()()()()()())(((((((' # noqa
pos = find_position(d)
print(pos)
| def find_floor(string: str) -> int:
floor = 0
for direction in string:
if direction == '(':
floor += 1
else:
floor -= 1
return floor
def find_position(string: str) -> int:
floor = 0
for (i, s) in enumerate(string):
floor = floor + find_floor(s)
if floor == -1:
break
return i + 1
if __name__ == '__main__':
floors = []
for string in ['(())', '()()', '(((', '(()(()(', '))(((((', '())', '))(', ')))', ')())())']:
floors.append(find_floor(string))
print(floors == [0, 0, 3, 3, 3, -1, -1, -3, -3])
d = '()()(()()()(()()((()((()))((()((((()()((((()))()((((())(((((((()(((((((((()(((())(()()(()((()()(()(())(()((((()((()()()((((())((((((()(()(((()())(()((((()))())(())(()(()()))))))))((((((((((((()())()())())(())))(((()()()((((()(((()(()(()()(()(()()(()(((((((())(())(())())))((()())()((((()()((()))(((()()()())))(())))((((())(((()())(())(()))(()((((()())))())((()(())(((()((((()((()(())())))((()))()()(()(()))))((((((((()())((((()()((((()(()())(((((()(()())()))())(((()))()(()(()(()((((()(())(()))(((((()()(()()()(()(((())())(((()()(()()))(((()()(((())())(()(())())()()(())()()()((()(((()(())((()()((())()))((()()))((()()())((((()(()()(()(((()))()(()))))((()(((()()()))(()(((())()(()((()())(()(()()(()())(())()(((()(()())()((((()((()))))())()))((()()()()(())()())()()()((((()))))(()(((()()(((((((())()))()((((()((())()(()())(())()))(()(()())(((((((())))(((()))())))))()))())((())(()()((())()())()))))()((()()())(())((())((((()())())()()()(((()))())))()()))())(()()()(()((((((()()))())()))()(((()(((())((((()()()(()))())()()))))())()))())((())()())(((((())())((())())))(((())(((())(((((()(((((())(()(()())())(()(())(()))(()((((()))())()))))())))((()(()))))())))(((((())()))())()))))()))))(((()))()))))((()))((()((()(()(())()())))(()()()(())()))()((((())))))))(())(()((()()))(()))(()))(()((()))))))()()((((()()))()())()))))))()()()))(()((())(()))((()()()())()(((()((((())())))()((((()(()))))))())))()()())()))(()))))(()())()))))))((())))))))())()))()((())())))(()((()))()))(())))))(()))()())()()))((()(()))()()()()))))())()()))())(())()()))()))((()))))()()(()())))))()()()))((((()))()))))(()(())))(()())))((())())(()))()))))()())))()())()())))))))))()()))))())))((())((()))))())))(((()())))))))(()))()()))(()))()))))()())))))())((((()())))))))())))()()))))))))()))()))))()))))))(())))))))))())))))))))))))))())())((())))))))))()))((())))()))))))))())()(()))))))())))))()()()())()(()()()(()())(()))()()()(()())))())())))()))))())))))))()()()()())(())())()())()))))(()()()()()))))()))())())))((()())()())))()))()))))(()())))()))))))))(((()))()()))))))))))))))))))))(()))(()((()))())))())(()))(()(()(())))))()(()))()))()()))))))))))))()((()())(())())()(())))))())()())((()()))))(()()))))())()(())()))))))))))))))))))))()))(()(()())))))))()()((()))()))))))((())))()))))))))((()))())()()))())()()))((()))())))))))))))(()())()))(())((()(()()))(()())(())))()())(()(())()()))))()))()(()))))))(()))))))))))(()))())))))))))())))))())))(())))))()))))(())())))))))))()(()))))()())))())(()))()())))))))))))))())()()))))()))))))())))))()))))(())(()()()()((())()))())(()))((())()))())())(())(()()))))()))(())()()((())(())))(())))()))())))))))))()(((((())())))(())()))))(())))((()))()(((((((()))))()()))(())))))()(()))))(()()))()))())))))))(()())()))))))))())))(()))())()))(())()((())())()())())(()(()))))()))))))((()())(())()()(()())))()()))(())(())(()))())))()))(()))()()))((((()))))()))((()()()))))()))()))())))(()))()))))(())))()))())()(()))()())))())))))))())))())))()()))))))(()))())())))()))()()())())))))))))))))())))()))(()()))))())))())()(())))())))))))))))))))))()()())())))))()()()((()(()))()()(())()())()))()))))()()()))))))((()))))))))()(()(()((((((()()((()())))))))))))()))())))))((())())(()))())))())))))())()()())(())))())))()())())(())))))))()()(())))()))())))())())())()))))))))()))(()()()())())())))(())())))))))()()())()))))())))())()(())())))))))()())()))(()()(())())))()(()((()()((()()(((((())(()())()))(())()))(())))(())))))))()))()))((()))()))()))))))))()))))))))((()()())(()))(((()))(())))()))((())(((())))()())))())))))((())))))(())())((((((())())()(()))()(()((()())))((())()(()(()))))(())(()()())(())))())((()(((())())))(((()())())))())()(())())((((()()))))())((()))()()()()(())(((((((()()()((()))())(()())))(())())((((()()(()))))()((())))((())()))()(((()))())))()))((()(()))(())(()((((())((((()()(()()))(((())(()))))((((()(()))(())))))((()))(()))((()(((()(()))(()(()((()(())(()(()(()(()()((()))())(((())(()(()))))(()))()()))(())))(())()(((())(()))()((((()()))))())(()))))((())()((((()(((()))())())(((()))()())((())(())())(())()(())()(()()((((((()()))))()()(((()()))))()())()(((()(()))(()(()())(()(()))))(((((()(((())())))))(((((()((()()((())())((((((()(())(()()((()()()()()()()(()()))()(((()))()))(((((((())(((()((()())()((((())(((()(())))()((()(()()()((())((()())()))()))())))())((((((()))(()(()()()))(()((()(()(()))()((()(((()()()((())(((((())()(()))())())((()(())))(()(()())(())((())())())(((()()()(())))))())(()))))))()))))))())((()()()))((()((((((()))(((()((((()()()(((()))())()(()()(((()((()()()()())()()))()()()(()(())((()))))(()))())))))))()(()()(((((())()(()(((((()((()(()()())(()((((((((()((((((())()((((()()()((()((()((((((()))((())))))))())()))((()(()))()(()()(()((())((()()((((((((((((()())(()()()))((((()((((((())(()))())(()()((()()))()(((((((()((()()((((((()(((())))((())))((((((((()()(((((((())(((((()())(((())((())()((((()(((((((()(()(((()((((((()(((()(((((((((((()()((()()(()))((()()(((()(((())))((((())()(()(((())()(()(((())(((((((((((()))())))((((((())((()()((((()())())((((()()))((())(((((()(()()(()()()((())(()((()()((((()(((((()((()(()((((()())((((((()(((((()()(()(()((((())))(())(())(())((((()(()()((((()((((()()((()((((((())))(((((()))))()))(()((((((((()(((())())(((())))(()(()((())(((()((()()(((((()((()()(((())()(()))(((((((())(()(((((()))((()((()((()))(())())((((()((((())()(()))(((()(((((((((((((((())(((((((((()))(((()(()()()()((((((()((())()((((((((()(())(((((((((((()(()((())()((()()(()(()()((((()()((())(()((()()(()()((((()(((((((())))((((())(())()(((()()((()()((((()((()(((()((())(((()()()((((()((((()()(()(()((((((((())(()(((((())(()())(((((((()())()(()((((()((())(()()())((((()()(((()((((())(())(()()(((((((((()()))()(((())(()(()((((((())(()()())(()))()()(((()(((()((())(()(((((((()(()(()((()(((((()(()((()(()((((((()((((()()((((()(((()((())(()(()((()()((((()()(())()(())(((())(()((((((((()())(((((((((()(())()((((())))()))()()(((((()()((((((())(()()(((()(()(((((((()(()(((((((())(())((((()((()(())))((((()()())(()))((()())((((()(((((()(()(())(()(()()())(((((()(((((()((((()()((((((((()()))(()((((((())((((())()(()(((()()()(((()(()(())(())(((((()(())())((((())(())(()(((()(((((())((((())())((()(((((((()(((())(()(()))(((((((((()((()((()()(()((((())(((()((())((((())(()(((()(((()(()((((()(((())(()(((()(()()(()(()((()()(()())(())())((()(()(((()(((()(((()()(((((((((()(((((((((()()(((()(((()())((((()(()(((()()()((())((((((((((())(()(((()((((()())((((()((()))(((()()()(((((()(((((((())((()())(()((((())((((((((())(()((()((((((((((()()((()((()()))(((()())()())()(((()())()()(()(()(((((((())()))(())()))())()()((())()((()((((()((()((())(((((()((((((()(())))(()))())(((()))((()()(()(((()))((((())()(((()))))()(()(())()(((((())(()(()(())(())()((()()()((((()(())((()())(()(()))(()(()(()()(())()()(()((())()((()))))()))((()(()()()()((()())(()))())()(()(((((((((())())((()((()((((((())()((((())(((())((()(()()()((())(()((())(((()((((()()((()(()(((((())()))()((((((()))((())(((()()))(((())(())()))(((((((())(())())()(())(((((()))()((()))()(()()((()()()()()())((((((('
pos = find_position(d)
print(pos) |
def get_input():
with open("input.txt") as f:
lines = f.read().splitlines()
food_list = []
for line in lines:
split = line.split("(")
ingredients = set(split[0].split())
allergens = set(split[1][9:-1].split(", "))
food_list.append((ingredients, allergens))
return food_list
def get_allergen_dict(food_list):
algn2ingrdnt = {}
for ingredients, allergens in food_list:
for a in allergens:
if not a in algn2ingrdnt.keys():
algn2ingrdnt[a] = ingredients
else:
algn2ingrdnt[a] = algn2ingrdnt[a].intersection(ingredients)
return algn2ingrdnt
| def get_input():
with open('input.txt') as f:
lines = f.read().splitlines()
food_list = []
for line in lines:
split = line.split('(')
ingredients = set(split[0].split())
allergens = set(split[1][9:-1].split(', '))
food_list.append((ingredients, allergens))
return food_list
def get_allergen_dict(food_list):
algn2ingrdnt = {}
for (ingredients, allergens) in food_list:
for a in allergens:
if not a in algn2ingrdnt.keys():
algn2ingrdnt[a] = ingredients
else:
algn2ingrdnt[a] = algn2ingrdnt[a].intersection(ingredients)
return algn2ingrdnt |
a = int(input())
b = 1
for i in range(1, a + 1):
b *= i
print(b) | a = int(input())
b = 1
for i in range(1, a + 1):
b *= i
print(b) |
# wczytanie slow
with open('../dane/dane.txt') as f:
data = []
for line in f.readlines():
data.append(line[:-1])
# licznik liczb parzystych
even = 0
for word in data:
# zamieniam na male litery, potem na system dziesietny
# i wtedy sprawdzam czy jest podzielne przez 2
if int(word.lower(), base=16) % 2 == 0:
even += 1
# wyswietlenie odpowiedzi
answer = f'6 b) Ilosc parzystych liczb: {even}'
print(answer)
| with open('../dane/dane.txt') as f:
data = []
for line in f.readlines():
data.append(line[:-1])
even = 0
for word in data:
if int(word.lower(), base=16) % 2 == 0:
even += 1
answer = f'6 b) Ilosc parzystych liczb: {even}'
print(answer) |
range_start = 367479
range_stop = 893698
def isvalid(n):
ns = str(n)
if not len(ns) == 6:
return False
has_same = False
for pos in range(len(ns) - 1):
if ns[pos] > ns[pos + 1]:
return False
if ns[pos] == ns[pos + 1]:
has_same = True
return has_same
counter = 0
for i in range(range_start, range_stop + 1):
if isvalid(i):
counter += 1
print(counter)
| range_start = 367479
range_stop = 893698
def isvalid(n):
ns = str(n)
if not len(ns) == 6:
return False
has_same = False
for pos in range(len(ns) - 1):
if ns[pos] > ns[pos + 1]:
return False
if ns[pos] == ns[pos + 1]:
has_same = True
return has_same
counter = 0
for i in range(range_start, range_stop + 1):
if isvalid(i):
counter += 1
print(counter) |
x = f"There are {10} types of people."
binary = 'binary'
do_not = "don't"
y = "Those who know {binary} adn those who {do_not}."
print(x)
print(y)
print('I said: {x}.')
print('I also said: {y}')
hilarious = False
joke_evaluation = f"Isn't that joke so funny?! {hilarious}"
print(joke_evaluation)
w = "This is the left side of ..."
e = "a string with a right side."
print(w + e) | x = f'There are {10} types of people.'
binary = 'binary'
do_not = "don't"
y = 'Those who know {binary} adn those who {do_not}.'
print(x)
print(y)
print('I said: {x}.')
print('I also said: {y}')
hilarious = False
joke_evaluation = f"Isn't that joke so funny?! {hilarious}"
print(joke_evaluation)
w = 'This is the left side of ...'
e = 'a string with a right side.'
print(w + e) |
def romanToInt(s):
roman_val = {'I' : 1, 'V': 5, 'X':10, 'L':50, 'C':100, 'D':500, 'M':1000}
int_val = 0
for i in range(len(s)):
print(s, i, s[i], roman_val[s[i]], roman_val[s[i - 1]])
if i > 0 and roman_val[s[i]] > roman_val[s[i - 1]]:
int_val += roman_val[s[i]] - 2 * roman_val[s[i - 1]]
print(roman_val[s[i]], 2 * roman_val[s[i - 1]])
else:
int_val += roman_val[s[i]]
print (roman_val[s[i]])
return int_val
print(romanToInt('MCMXCIV')) | def roman_to_int(s):
roman_val = {'I': 1, 'V': 5, 'X': 10, 'L': 50, 'C': 100, 'D': 500, 'M': 1000}
int_val = 0
for i in range(len(s)):
print(s, i, s[i], roman_val[s[i]], roman_val[s[i - 1]])
if i > 0 and roman_val[s[i]] > roman_val[s[i - 1]]:
int_val += roman_val[s[i]] - 2 * roman_val[s[i - 1]]
print(roman_val[s[i]], 2 * roman_val[s[i - 1]])
else:
int_val += roman_val[s[i]]
print(roman_val[s[i]])
return int_val
print(roman_to_int('MCMXCIV')) |
class Loan:
'Base class for all loans.'
LoanCount = 0
def __init__(self, m, y, v, r, score, term):
LoanCount += 1
self.PolicyNumber = LoanCount
self.OriginMonth = m
self.OriginYear = y
self.OriginValue = v
self.PrincipalValue = v
self.Balance = v
self.APR = r
self.CreditScore = score
self.Term = term
self.TermsPassed = 0
self.ScheduledPayment =(self.OriginValue/((((1+(self.APR/100/12))^self.Term)-1)/((self.APR/100/12)*(1+(self.APR/100/12))^self.Term)))
self.MissedPayments = 0
def TakePayment():
if self.ScheduledPayment > self.Balance:
self.ScheduledPayment = self.Balance
self.Balance -= self.ScheduledPayment
def ApplyInterest():
self.Balance += (self.Balalnce * (self.APR / 12))
def Term():
ApplyInterest()
TakePayment()
TermsPassed += 1
| class Loan:
"""Base class for all loans."""
loan_count = 0
def __init__(self, m, y, v, r, score, term):
loan_count += 1
self.PolicyNumber = LoanCount
self.OriginMonth = m
self.OriginYear = y
self.OriginValue = v
self.PrincipalValue = v
self.Balance = v
self.APR = r
self.CreditScore = score
self.Term = term
self.TermsPassed = 0
self.ScheduledPayment = self.OriginValue / (((1 + self.APR / 100 / 12 ^ self.Term) - 1) / (self.APR / 100 / 12 * (1 + self.APR / 100 / 12) ^ self.Term))
self.MissedPayments = 0
def take_payment():
if self.ScheduledPayment > self.Balance:
self.ScheduledPayment = self.Balance
self.Balance -= self.ScheduledPayment
def apply_interest():
self.Balance += self.Balalnce * (self.APR / 12)
def term():
apply_interest()
take_payment()
terms_passed += 1 |
# 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 isSymmetric(self, root: TreeNode) -> bool:
def find(r,l):
if(r == None and l==None):
return True
if(r!=None and l!=None and r.val==l.val):
return find(r.right,l.left) and find(r.left,l.right)
return find(root.right,root.left)
| class Solution:
def is_symmetric(self, root: TreeNode) -> bool:
def find(r, l):
if r == None and l == None:
return True
if r != None and l != None and (r.val == l.val):
return find(r.right, l.left) and find(r.left, l.right)
return find(root.right, root.left) |
def pattern_elevan(strings):
'''Pattern elevan
K A T H M A N D U
A T H M A N D U
T H M A N D U
H M A N D U
M A N D U
A N D U
N D U
D U
U
'''
if not str(strings).isalpha():
strings = str(strings) # If provided is integer then converting to string
for x in range(len(strings)):
get_string = ' '.join(strings[x:])
print(get_string)
if __name__ == '__main__':
try:
pattern_elevan('KATHMANDU')
except NameError:
print('String or Integer was expected')
| def pattern_elevan(strings):
"""Pattern elevan
K A T H M A N D U
A T H M A N D U
T H M A N D U
H M A N D U
M A N D U
A N D U
N D U
D U
U
"""
if not str(strings).isalpha():
strings = str(strings)
for x in range(len(strings)):
get_string = ' '.join(strings[x:])
print(get_string)
if __name__ == '__main__':
try:
pattern_elevan('KATHMANDU')
except NameError:
print('String or Integer was expected') |
class Solution:
def solve(self, lst1, lst2):
lst1.sort()
lst2.sort()
n = len(lst1)-1
m = len(lst2)-1
i = 0
j = 0
ans = float('inf')
while i <= n and j <= m:
ans = min(abs(lst1[i]-lst2[j]),ans)
if lst1[i] < lst2[j]:
i += 1
elif lst1[i] > lst2[j]:
j += 1
else:
return ans
return ans
| class Solution:
def solve(self, lst1, lst2):
lst1.sort()
lst2.sort()
n = len(lst1) - 1
m = len(lst2) - 1
i = 0
j = 0
ans = float('inf')
while i <= n and j <= m:
ans = min(abs(lst1[i] - lst2[j]), ans)
if lst1[i] < lst2[j]:
i += 1
elif lst1[i] > lst2[j]:
j += 1
else:
return ans
return ans |
n = int(input())
arr = list(map(int, input().split()))
b=max(arr)
while max(arr)==b:
arr.remove(max(arr))
print(max(arr))
| n = int(input())
arr = list(map(int, input().split()))
b = max(arr)
while max(arr) == b:
arr.remove(max(arr))
print(max(arr)) |
# https://docs.python.org/3/library/__main__.html
if __name__ == "__main__":
pass
| if __name__ == '__main__':
pass |
print('Enter the three sides of the triangle')
a = float(input('Enter first side: '))
b = float(input('Enter second side: '))
c = float(input('Enter third side: '))
s = (a + b + c) / 2
area = (s*(s-a)*(s-b)*(s-c)) ** 0.5
print('Area of the triangle = %0.3f' %area) | print('Enter the three sides of the triangle')
a = float(input('Enter first side: '))
b = float(input('Enter second side: '))
c = float(input('Enter third side: '))
s = (a + b + c) / 2
area = (s * (s - a) * (s - b) * (s - c)) ** 0.5
print('Area of the triangle = %0.3f' % area) |
def transform_test_oa18_to_oa11_kinetics(oa18_test_stacks, oa11_kinetics_test_stacks):
cls_to_new_class = {2:1, 3:2, 4:3,
5:4, 7:5, 9:6,
11:7, 13:8, 15:9,
17:10, 18:11}
lines = []
with open(oa18_test_stacks) as fr:
for line in fr:
fname, starting, cls = line.split()
if int(cls.strip()) in cls_to_new_class:
cls = str(cls_to_new_class[int(cls.strip())])
lines.append(fname + " " + starting + " " + cls + "\n")
with open(oa11_kinetics_test_stacks, "w") as fw:
fw.writelines(lines)
transform_test_oa18_to_oa11_kinetics("/home/bassel/data/office-actions/office_actions_19/short_clips/labels/test_stack_list.txt",
"/home/bassel/data/oa_kinetics/lbls/oa18_test_stack_mapped_oa11_kinetics.txt") | def transform_test_oa18_to_oa11_kinetics(oa18_test_stacks, oa11_kinetics_test_stacks):
cls_to_new_class = {2: 1, 3: 2, 4: 3, 5: 4, 7: 5, 9: 6, 11: 7, 13: 8, 15: 9, 17: 10, 18: 11}
lines = []
with open(oa18_test_stacks) as fr:
for line in fr:
(fname, starting, cls) = line.split()
if int(cls.strip()) in cls_to_new_class:
cls = str(cls_to_new_class[int(cls.strip())])
lines.append(fname + ' ' + starting + ' ' + cls + '\n')
with open(oa11_kinetics_test_stacks, 'w') as fw:
fw.writelines(lines)
transform_test_oa18_to_oa11_kinetics('/home/bassel/data/office-actions/office_actions_19/short_clips/labels/test_stack_list.txt', '/home/bassel/data/oa_kinetics/lbls/oa18_test_stack_mapped_oa11_kinetics.txt') |
n, l = map(int, input().split())
list = [str(input()) for i in range(n)]
list.sort()
s = ''.join(list)
print(s)
| (n, l) = map(int, input().split())
list = [str(input()) for i in range(n)]
list.sort()
s = ''.join(list)
print(s) |
def lcs(s1,s2):
l1 = len(s1)
l2 = len(s2)
memo = [[-1] * (l1+1) for x in range(l2+1)]
sol = [[None for x in range(l1+1)] for x in range(l2+1)]
for i in range(l1):
for j in range(l2):
if i == 0 or j == 0:
q = 0
memo[i][j] = 0
sol[i][j] = 0
elif s1[i-1] == s2[j-1]:
memo[i][j] = memo[i-1][j-1] + 1
sol[i][j] = 'd'
elif memo[i-1][j] >= memo[i][j-1]:
memo[i][j] = memo[i-1][j]
sol[i][j] = 'l'
else:
memo[i][j] = memo[i][j-1]
sol[i][j] = 'u'
a=[]
a.append(memo)
a.append(sol)
return a
def print_lcs(s1,b,i,j):
l1 = len(s1)
if i == 0 or j == 0:
return
if b[i][j] == 'd':
print_lcs(s1,b,i-1,j-1)
print(b[i])
elif b[i][j] == 'u':
print_lcs(s1,b,i,j-1)
else:
print_lcs(s1,b,i-1,j)
s1 = "hey im good"
s2 = "howdy yall"
a = lcs(s1,s2)
print_lcs(s1,a[1],len(s1),len(s2))
| def lcs(s1, s2):
l1 = len(s1)
l2 = len(s2)
memo = [[-1] * (l1 + 1) for x in range(l2 + 1)]
sol = [[None for x in range(l1 + 1)] for x in range(l2 + 1)]
for i in range(l1):
for j in range(l2):
if i == 0 or j == 0:
q = 0
memo[i][j] = 0
sol[i][j] = 0
elif s1[i - 1] == s2[j - 1]:
memo[i][j] = memo[i - 1][j - 1] + 1
sol[i][j] = 'd'
elif memo[i - 1][j] >= memo[i][j - 1]:
memo[i][j] = memo[i - 1][j]
sol[i][j] = 'l'
else:
memo[i][j] = memo[i][j - 1]
sol[i][j] = 'u'
a = []
a.append(memo)
a.append(sol)
return a
def print_lcs(s1, b, i, j):
l1 = len(s1)
if i == 0 or j == 0:
return
if b[i][j] == 'd':
print_lcs(s1, b, i - 1, j - 1)
print(b[i])
elif b[i][j] == 'u':
print_lcs(s1, b, i, j - 1)
else:
print_lcs(s1, b, i - 1, j)
s1 = 'hey im good'
s2 = 'howdy yall'
a = lcs(s1, s2)
print_lcs(s1, a[1], len(s1), len(s2)) |
class Tile:
def __init__(self, tile_type):
self.tyle_type = tile_type
| class Tile:
def __init__(self, tile_type):
self.tyle_type = tile_type |
# Copyright (c) 2021.
# The copyright lies with Timo Hirsch-Hoffmann, the further use is only permitted with reference to source
class ChampionMastery:
champion_id: int
champion_level: int
champion_points: int
last_play_time: int
champion_points_since_last_level: int
champion_points_until_next_level: int
chest_granted: bool
tokens_earned: int
summoner_id: str
def __init__(self, champion_id: int, champion_level: int, champion_points: int, last_play_time: int,
champion_points_since_last_level: int, champion_points_until_next_level: int, chest_granted: bool,
tokens_earned: int, summoner_id: str) -> None:
self.champion_id = champion_id
self.champion_level = champion_level
self.champion_points = champion_points
self.last_play_time = last_play_time
self.champion_points_since_last_level = champion_points_since_last_level
self.champion_points_until_next_level = champion_points_until_next_level
self.chest_granted = chest_granted
self.tokens_earned = tokens_earned
self.summoner_id = summoner_id
| class Championmastery:
champion_id: int
champion_level: int
champion_points: int
last_play_time: int
champion_points_since_last_level: int
champion_points_until_next_level: int
chest_granted: bool
tokens_earned: int
summoner_id: str
def __init__(self, champion_id: int, champion_level: int, champion_points: int, last_play_time: int, champion_points_since_last_level: int, champion_points_until_next_level: int, chest_granted: bool, tokens_earned: int, summoner_id: str) -> None:
self.champion_id = champion_id
self.champion_level = champion_level
self.champion_points = champion_points
self.last_play_time = last_play_time
self.champion_points_since_last_level = champion_points_since_last_level
self.champion_points_until_next_level = champion_points_until_next_level
self.chest_granted = chest_granted
self.tokens_earned = tokens_earned
self.summoner_id = summoner_id |
def mode():
tally = {}
M = nums[0]
for x in nums:
tally[x] = tally.get(x, 0) + 1
if tally[x] > tally[M]:
M = x
return M
def max(nums):
M = nums[0]
for x in nums:
if x > M:
M = x
return M
def min(nums):
M = nums[0]
for x in nums:
if x < M:
M =x
return M
def mean(nums):
if len(nums) == 0:
return None
M = 0
for x in nums:
M += x
M /= len(nums)
return M
def median(nums):
temp = sorted(nums)
if len(temp) % 2 == 0:
mid1 = int(len(temp)/2) - 1
mid2 = int(len(temp)/2)
return (temp[mid1] + temp[mid2])/2
else:
mid = int(len(temp)/2)
return temp[mid]
| def mode():
tally = {}
m = nums[0]
for x in nums:
tally[x] = tally.get(x, 0) + 1
if tally[x] > tally[M]:
m = x
return M
def max(nums):
m = nums[0]
for x in nums:
if x > M:
m = x
return M
def min(nums):
m = nums[0]
for x in nums:
if x < M:
m = x
return M
def mean(nums):
if len(nums) == 0:
return None
m = 0
for x in nums:
m += x
m /= len(nums)
return M
def median(nums):
temp = sorted(nums)
if len(temp) % 2 == 0:
mid1 = int(len(temp) / 2) - 1
mid2 = int(len(temp) / 2)
return (temp[mid1] + temp[mid2]) / 2
else:
mid = int(len(temp) / 2)
return temp[mid] |
NODE_SIGNING_KEY = NotImplemented
SENTRY_DSN = None
SENTRY_EVENT_LEVEL = 'WARNING'
NODE_NETWORK_ADDRESSES: list[str] = []
NODE_PORT = 8555
APPEND_AUTO_DETECTED_NETWORK_ADDRESS = True
NODE_FEE = 4
IN_DOCKER = False
NODE_LIST_JSON_PATH = None
SYNC_BATCH_SIZE = 10
SCHEDULE_CAPACITY = 20
SUPPRESS_WARNINGS_TB = True
LOCK_DEFAULT_TIMEOUT_SECONDS = 1
USE_ON_COMMIT_HOOK = False
| node_signing_key = NotImplemented
sentry_dsn = None
sentry_event_level = 'WARNING'
node_network_addresses: list[str] = []
node_port = 8555
append_auto_detected_network_address = True
node_fee = 4
in_docker = False
node_list_json_path = None
sync_batch_size = 10
schedule_capacity = 20
suppress_warnings_tb = True
lock_default_timeout_seconds = 1
use_on_commit_hook = False |
# Definition for singly-linked list.
# class ListNode:
# def __init__(self, val=0, next=None):
# self.val = val
# self.next = next
#Approach :
'''
Put Node2.next which is n3->n4->...nn into Node1.next
Now put entire Node1 which is n1-n3-n4... into Node2.next . with this step n1 and n2 are swapped.
In the first iteration save the pointer of new 2nd node which is node1. This pointer node keeps the link between Pari1..Pari2...Pair3....etc.
From the second iteration onwards, swap and link the first node from the pair to the second node from last iteration.
Move the pointer 2nd node of the pair.
'''
class Solution(object):
def swapPairs(self, head: ListNode) -> ListNode:
tempNode = head
if tempNode is None: return None
if tempNode.next is not None:
newheadNode= tempNode.next
else:
return head
pointerNode = ListNode()
first=0
while tempNode is not None and tempNode.next is not None:
Node1 = tempNode
Node2 = tempNode.next
tempNode= tempNode.next.next
Node1.next=Node2.next
Node2.next=Node1
if first==0:
pointerNode= Node1
first=1
else:
pointerNode.next=Node2
pointerNode=Node1
return newheadNode
| """
Put Node2.next which is n3->n4->...nn into Node1.next
Now put entire Node1 which is n1-n3-n4... into Node2.next . with this step n1 and n2 are swapped.
In the first iteration save the pointer of new 2nd node which is node1. This pointer node keeps the link between Pari1..Pari2...Pair3....etc.
From the second iteration onwards, swap and link the first node from the pair to the second node from last iteration.
Move the pointer 2nd node of the pair.
"""
class Solution(object):
def swap_pairs(self, head: ListNode) -> ListNode:
temp_node = head
if tempNode is None:
return None
if tempNode.next is not None:
newhead_node = tempNode.next
else:
return head
pointer_node = list_node()
first = 0
while tempNode is not None and tempNode.next is not None:
node1 = tempNode
node2 = tempNode.next
temp_node = tempNode.next.next
Node1.next = Node2.next
Node2.next = Node1
if first == 0:
pointer_node = Node1
first = 1
else:
pointerNode.next = Node2
pointer_node = Node1
return newheadNode |
for t in range(int(input())):
wordList=(" ".join(input())).split(" ")
numOfHy=int(input())
locOfHy=list(map(int,input().split()))
numOfHyEachLoc=[0 for i in range(len(wordList)+1)]
for i in locOfHy:
numOfHyEachLoc[i]+=1
print(f"#{t+1}",numOfHyEachLoc[0]*"-",end="")
for i in range(len(wordList)):
print(wordList[i]+numOfHyEachLoc[i+1]*"-",end="") | for t in range(int(input())):
word_list = ' '.join(input()).split(' ')
num_of_hy = int(input())
loc_of_hy = list(map(int, input().split()))
num_of_hy_each_loc = [0 for i in range(len(wordList) + 1)]
for i in locOfHy:
numOfHyEachLoc[i] += 1
print(f'#{t + 1}', numOfHyEachLoc[0] * '-', end='')
for i in range(len(wordList)):
print(wordList[i] + numOfHyEachLoc[i + 1] * '-', end='') |
# -*- coding: utf-8 -*-
class NotRecognizeCommandException(Exception):
pass
class NotRecognizeProtocolException(Exception):
pass
| class Notrecognizecommandexception(Exception):
pass
class Notrecognizeprotocolexception(Exception):
pass |
#
# @lc app=leetcode id=765 lang=python3
#
# [765] Couples Holding Hands
#
# @lc code=start
class Solution:
def minSwapsCouples(self, row: List[int]) -> int:
d, swap={}, 0
for i, x in enumerate(row):
d[x]=i
for i in range(0, len(row), 2):
partner=row[i]+1 if row[i]%2==0 else row[i]-1
j=d[partner]
if j-i!=1:
row[i+1], row[j]=row[j], row[i+1]
d[row[j]]=j
swap+=1
return swap
# @lc code=end
| class Solution:
def min_swaps_couples(self, row: List[int]) -> int:
(d, swap) = ({}, 0)
for (i, x) in enumerate(row):
d[x] = i
for i in range(0, len(row), 2):
partner = row[i] + 1 if row[i] % 2 == 0 else row[i] - 1
j = d[partner]
if j - i != 1:
(row[i + 1], row[j]) = (row[j], row[i + 1])
d[row[j]] = j
swap += 1
return swap |
# -*- coding: utf-8 -*-
'''package requirements are checked at runtime and installation time'''
#-----------------------------------------------------------------------------
# Copyright (c) 2013-2020, NeXpy Development Team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file COPYING, distributed with this software.
#-----------------------------------------------------------------------------
pkg_requirements = [
'numpy>=1.16',
'scipy',
'h5py',
'versioneer'
]
| """package requirements are checked at runtime and installation time"""
pkg_requirements = ['numpy>=1.16', 'scipy', 'h5py', 'versioneer'] |
# multiple.py
def fail(exception_cls):
raise exception_cls("Ooops")
try:
fail(ValueError)
except Exception as exc:
print("Can catch ValueError as Exception.")
print(exc.__class__)
except ValueError as exc:
print("Can catch ValueError as ValueError.")
print(exc.__class__)
try:
fail(ValueError)
except ValueError as exc:
print("Can catch ValueError as ValueError.")
print(exc.__class__)
except Exception as exc:
print("Can catch ValueError as Exception.")
print(exc.__class__)
try:
fail(ValueError)
except (ValueError, Exception) as exc:
print("Can catch multiple exceptions in a single except block")
print(exc.__class__)
| def fail(exception_cls):
raise exception_cls('Ooops')
try:
fail(ValueError)
except Exception as exc:
print('Can catch ValueError as Exception.')
print(exc.__class__)
except ValueError as exc:
print('Can catch ValueError as ValueError.')
print(exc.__class__)
try:
fail(ValueError)
except ValueError as exc:
print('Can catch ValueError as ValueError.')
print(exc.__class__)
except Exception as exc:
print('Can catch ValueError as Exception.')
print(exc.__class__)
try:
fail(ValueError)
except (ValueError, Exception) as exc:
print('Can catch multiple exceptions in a single except block')
print(exc.__class__) |
# https://www.hackerrank.com/challenges/python-string-formatting/problem
def print_formatted(number):
for i in range(1, number + 1):
pad = number.bit_length()
print(f"{i:{pad}d} {i:{pad}o} {i:{pad}X} {i:{pad}b}")
| def print_formatted(number):
for i in range(1, number + 1):
pad = number.bit_length()
print(f'{i:{pad}d} {i:{pad}o} {i:{pad}X} {i:{pad}b}') |
# Generic
CPREF_COMPONENT = "([0-9A-Z-]|%2F|%23)+"
NUMERIC_COMPONENT = "(0|[1-9]\d*)"
GS3A3_CHAR = "((%[0-9a-fA-F])|([a-zA-Z0-9!'()*+,-.:;=_]))"
GS3A3_COMPONENT = f"{GS3A3_CHAR}+"
PADDED_NUMERIC_COMPONENT = "\d+"
PADDED_NUMERIC_COMPONENT_OR_EMPTY = "\d*"
VERIFY_GS3A3_CHARS = "[a-zA-Z0-9!'()*+,-.:;=_\"%&/<>?]+"
GS1_ELEM_CHARS = "[a-zA-Z0-9!'()*+,-.:;=_\"%&/<>?]"
GS1_ELEM_CHARS_CPI = "[0-9A-Z\/\-\#]"
DIGIT = "\d"
FOUR_PADDED_NUMERIC_COMPONENTS = f"{PADDED_NUMERIC_COMPONENT}\.{PADDED_NUMERIC_COMPONENT}\.{PADDED_NUMERIC_COMPONENT}\.{PADDED_NUMERIC_COMPONENT}"
# EPC Pure Identity URIs
SGTIN_URI_BODY = (
f"{PADDED_NUMERIC_COMPONENT}\.{PADDED_NUMERIC_COMPONENT}\.{GS3A3_COMPONENT}"
)
SGTIN_URI = f"urn:epc:id:sgtin:{SGTIN_URI_BODY}"
SSCC_URI_BODY = f"{PADDED_NUMERIC_COMPONENT}\.{PADDED_NUMERIC_COMPONENT}"
SSCC_URI = f"urn:epc:id:sscc:{SSCC_URI_BODY}"
SGLN_URI_BODY = f"{PADDED_NUMERIC_COMPONENT}\.{PADDED_NUMERIC_COMPONENT_OR_EMPTY}\.{GS3A3_COMPONENT}"
SGLN_URI = f"urn:epc:id:sgln:{SGLN_URI_BODY}"
GRAI_URI_BODY = f"{PADDED_NUMERIC_COMPONENT}\.{PADDED_NUMERIC_COMPONENT_OR_EMPTY}\.{GS3A3_COMPONENT}"
GRAI_URI = f"urn:epc:id:grai:{GRAI_URI_BODY}"
GIAI_URI_BODY = f"{PADDED_NUMERIC_COMPONENT}\.{GS3A3_COMPONENT}"
GIAI_URI = f"urn:epc:id:giai:{GIAI_URI_BODY}"
GSRN_URI_BODY = f"{PADDED_NUMERIC_COMPONENT}\.{PADDED_NUMERIC_COMPONENT}"
GSRN_URI = f"urn:epc:id:gsrn:{GSRN_URI_BODY}"
GSRNP_URI_BODY = f"{PADDED_NUMERIC_COMPONENT}\.{PADDED_NUMERIC_COMPONENT}"
GSRNP_URI = f"urn:epc:id:gsrnp:{GSRN_URI_BODY}"
GDTI_URI_BODY = f"{PADDED_NUMERIC_COMPONENT}\.{PADDED_NUMERIC_COMPONENT_OR_EMPTY}\.{GS3A3_COMPONENT}"
GDTI_URI = f"urn:epc:id:gdti:{GDTI_URI_BODY}"
CPI_URI_BODY = f"{PADDED_NUMERIC_COMPONENT}\.{CPREF_COMPONENT}\.{NUMERIC_COMPONENT}"
CPI_URI = f"urn:epc:id:cpi:{CPI_URI_BODY}"
SGCN_URI_BODY = f"{PADDED_NUMERIC_COMPONENT}\.{PADDED_NUMERIC_COMPONENT_OR_EMPTY}\.{PADDED_NUMERIC_COMPONENT}"
SGCN_URI = f"urn:epc:id:sgcn:{SGCN_URI_BODY}"
GINC_URI_BODY = f"{PADDED_NUMERIC_COMPONENT}\.{GS3A3_COMPONENT}"
GINC_URI = f"urn:epc:id:ginc:{GINC_URI_BODY}"
GSIN_URI_BODY = f"{PADDED_NUMERIC_COMPONENT}\.{PADDED_NUMERIC_COMPONENT}"
GSIN_URI = f"urn:epc:id:gsin:{GSIN_URI_BODY}"
ITIP_URI_BODY = f"{FOUR_PADDED_NUMERIC_COMPONENTS}\.{GS3A3_COMPONENT}"
ITIP_URI = f"urn:epc:id:itip:{ITIP_URI_BODY}"
UPUI_URI_BODY = f"{PADDED_NUMERIC_COMPONENT}\.{PADDED_NUMERIC_COMPONENT_OR_EMPTY}\.{GS3A3_COMPONENT}"
UPUI_URI = f"urn:epc:id:upui:{UPUI_URI_BODY}"
PGLN_URI_BODY = f"{PADDED_NUMERIC_COMPONENT}\.{PADDED_NUMERIC_COMPONENT_OR_EMPTY}"
PGLN_URI = f"urn:epc:id:pgln:{PGLN_URI_BODY}"
GID_URI_BODY = f"{NUMERIC_COMPONENT}\.{NUMERIC_COMPONENT}\.{NUMERIC_COMPONENT}"
GID_URI = f"urn:epc:id:gid:{GID_URI_BODY}"
CAGE_CODE_OR_DODAAC = "([0-9A-HJ-NP-Z]){5,6}"
USDOD_URI_BODY = f"{CAGE_CODE_OR_DODAAC}\.{NUMERIC_COMPONENT}"
USDOD_URI = f"urn:epc:id:usdod:{USDOD_URI_BODY}"
ADI_CHAR = "([A-Z0-9-]|(%2F))"
ADI_URI_BODY = f"{CAGE_CODE_OR_DODAAC}\.{ADI_CHAR}*\.(%23)?{ADI_CHAR}+"
ADI_URI = f"urn:epc:id:adi:{ADI_URI_BODY}"
BIC_URI_BODY = "[A-HJ-NP-Z]{3}[JUZ][0-9]{7}"
BIC_URI = f"urn:epc:id:bic:{BIC_URI_BODY}"
IMOVN_URI_BODY = "[0-9]{7}"
IMOVN_URI = f"urn:epc:id:imovn:{IMOVN_URI_BODY}"
LGTIN_CLASS = f"urn:epc:class:lgtin:{PADDED_NUMERIC_COMPONENT}\.{PADDED_NUMERIC_COMPONENT}\.{GS3A3_COMPONENT}"
EPC_URI = (
f"({SGTIN_URI}|{SSCC_URI}|{SGLN_URI}|{GRAI_URI}|{GIAI_URI}|{GSRN_URI}|{GSRNP_URI}|{GDTI_URI}"
f"|{CPI_URI}|{SGCN_URI}|{GINC_URI}|{GSIN_URI}|{ITIP_URI}|{UPUI_URI}|{PGLN_URI}|{GID_URI}"
f"|{USDOD_URI}|{ADI_URI}|{BIC_URI}|{IMOVN_URI}|{LGTIN_CLASS})"
)
# EPC IDPAT URIs
SGTIN_IDPAT_URI_BODY = f"sgtin:({PADDED_NUMERIC_COMPONENT}\.{PADDED_NUMERIC_COMPONENT}\.{GS3A3_COMPONENT}|{PADDED_NUMERIC_COMPONENT}\.{PADDED_NUMERIC_COMPONENT}\.\*|{PADDED_NUMERIC_COMPONENT}\.\*\.\*|\*\.\*\.\*)"
SSCC_IDPAT_URI_BODY = f"sscc:({PADDED_NUMERIC_COMPONENT}\.{PADDED_NUMERIC_COMPONENT}|{PADDED_NUMERIC_COMPONENT}\.\*|\*\.\*)"
SGLN_GRAI_IDPAT_URI_BODY_MAIN = f"({PADDED_NUMERIC_COMPONENT}\.{PADDED_NUMERIC_COMPONENT_OR_EMPTY}\.{GS3A3_COMPONENT}|{PADDED_NUMERIC_COMPONENT}\.{PADDED_NUMERIC_COMPONENT_OR_EMPTY}\.\*|{PADDED_NUMERIC_COMPONENT}\.\*\.\*|\*\.\*\.\*)"
SGLN_IDPAT_URI_BODY = f"sgln:{SGLN_GRAI_IDPAT_URI_BODY_MAIN}"
GRAI_IDPAT_URI_BODY = f"grai:{SGLN_GRAI_IDPAT_URI_BODY_MAIN}"
GIAI_IDPAT_URI_BODY = f"giai:({PADDED_NUMERIC_COMPONENT}\.{GS3A3_COMPONENT}|{PADDED_NUMERIC_COMPONENT}\.\*|\*\.\*)"
GSRN_IDPAT_URI_BODY = f"gsrn:({PADDED_NUMERIC_COMPONENT}\.{PADDED_NUMERIC_COMPONENT}|{PADDED_NUMERIC_COMPONENT}\.\*|\*\.\*)"
GSRNP_IDPAT_URI_BODY = f"gsrnp:({PADDED_NUMERIC_COMPONENT}\.{PADDED_NUMERIC_COMPONENT}|{PADDED_NUMERIC_COMPONENT}\.\*|\*\.\*)"
GDTI_IDPAT_URI_BODY = f"gdti:({PADDED_NUMERIC_COMPONENT}\.{PADDED_NUMERIC_COMPONENT_OR_EMPTY}\.{GS3A3_COMPONENT}|{PADDED_NUMERIC_COMPONENT}\.{PADDED_NUMERIC_COMPONENT_OR_EMPTY}\.\*|{PADDED_NUMERIC_COMPONENT}\.\*\.\*|\*\.\*\.\*)"
CPI_IDPAT_URI_BODY = f"cpi:({PADDED_NUMERIC_COMPONENT}\.{CPREF_COMPONENT}\.{NUMERIC_COMPONENT}|{PADDED_NUMERIC_COMPONENT}\.{CPREF_COMPONENT}\.\*|{PADDED_NUMERIC_COMPONENT}\.\*\.\*|\*\.\*\.\*)"
SGCN_IDPAT_URI_BODY = f"sgcn:({PADDED_NUMERIC_COMPONENT}\.{PADDED_NUMERIC_COMPONENT_OR_EMPTY}\.{PADDED_NUMERIC_COMPONENT}|{PADDED_NUMERIC_COMPONENT}\.{PADDED_NUMERIC_COMPONENT_OR_EMPTY}\.\*|{PADDED_NUMERIC_COMPONENT}\.\*\.\*|\*\.\*\.\*)"
GINC_IDPAT_URI_BODY = f"ginc:({PADDED_NUMERIC_COMPONENT}\.{GS3A3_COMPONENT}|{PADDED_NUMERIC_COMPONENT}\.\*|\*\.\*)"
GSIN_IDPAT_URI_BODY = f"gsin:({PADDED_NUMERIC_COMPONENT}\.{PADDED_NUMERIC_COMPONENT}|{PADDED_NUMERIC_COMPONENT}\.\*|\*\.\*)"
ITIP_IDPAT_URI_BODY = f"itip:({FOUR_PADDED_NUMERIC_COMPONENTS}\.{GS3A3_COMPONENT}|{FOUR_PADDED_NUMERIC_COMPONENTS}\.\*|{PADDED_NUMERIC_COMPONENT}\.{PADDED_NUMERIC_COMPONENT}\.\*\.\*\.\*|{PADDED_NUMERIC_COMPONENT}\.\*\.\*\.\*\.\*|\*\.\*\*\.\*\.\*)"
UPUI_IDPAT_URI_BODY = f"upui:({PADDED_NUMERIC_COMPONENT}\.{PADDED_NUMERIC_COMPONENT}\.{GS3A3_COMPONENT}|{PADDED_NUMERIC_COMPONENT}\.{PADDED_NUMERIC_COMPONENT}\.\*|{PADDED_NUMERIC_COMPONENT}\.\*\.\*|\*\.\*\.\*)"
PGLN_IDPAT_URI_BODY = f"pgln:({PADDED_NUMERIC_COMPONENT}\.{PADDED_NUMERIC_COMPONENT_OR_EMPTY}|{PADDED_NUMERIC_COMPONENT}\.\*|\*\.\*)"
GID_IDPAT_URI_BODY = f"gid:({NUMERIC_COMPONENT}\.{NUMERIC_COMPONENT}\.{NUMERIC_COMPONENT}|{NUMERIC_COMPONENT}\.{NUMERIC_COMPONENT}\.\*|{NUMERIC_COMPONENT}\.\*\.\*|\*\.\*\.\*)"
USDOD_IDPAT_URI_BODY = f"usdod:({CAGE_CODE_OR_DODAAC}\.{NUMERIC_COMPONENT}|{CAGE_CODE_OR_DODAAC}\.\*|\*\.\*)"
ADI_IDPAT_URI_BODY = f"adi:({CAGE_CODE_OR_DODAAC}\.{ADI_CHAR}*\.(%23)?{ADI_CHAR}+|{CAGE_CODE_OR_DODAAC}\.{ADI_CHAR}*\.\*|{CAGE_CODE_OR_DODAAC}\.\*\.\*|\*\.\*\.\*)"
IDPAT_BODY = (
f"({SGTIN_IDPAT_URI_BODY}|{SSCC_IDPAT_URI_BODY}|{SGLN_IDPAT_URI_BODY}|{GRAI_IDPAT_URI_BODY}"
f"|{GIAI_IDPAT_URI_BODY}|{GSRN_IDPAT_URI_BODY}|{GSRNP_IDPAT_URI_BODY}|{GDTI_IDPAT_URI_BODY}"
f"|{CPI_IDPAT_URI_BODY}|{SGCN_IDPAT_URI_BODY}|{GINC_IDPAT_URI_BODY}|{GSIN_IDPAT_URI_BODY}"
f"|{ITIP_IDPAT_URI_BODY}|{UPUI_IDPAT_URI_BODY}|{PGLN_IDPAT_URI_BODY}|{GID_IDPAT_URI_BODY}"
f"|{USDOD_IDPAT_URI_BODY}|{ADI_IDPAT_URI_BODY})"
)
IDPAT_URI = f"urn:epc:idpat:{IDPAT_BODY}"
# EPC Tag URIs
SGTIN_TAG_URI_BODY = f"(sgtin-96|sgtin-198):{NUMERIC_COMPONENT}\.{SGTIN_URI_BODY}"
SSCC_TAG_URI_BODY = f"sscc-96:{NUMERIC_COMPONENT}\.{SSCC_URI_BODY}"
SGLN_TAG_URI_BODY = f"(sgln-96|sgln-195):{NUMERIC_COMPONENT}\.{SGLN_URI_BODY}"
GRAI_TAG_URI_BODY = f"(grai-96|grai-170):{NUMERIC_COMPONENT}\.{GRAI_URI_BODY}"
GIAI_TAG_URI_BODY = f"(giai-96|giai-202):{NUMERIC_COMPONENT}\.{GIAI_URI_BODY}"
GSRN_TAG_URI_BODY = f"gsrn-96:{NUMERIC_COMPONENT}\.{GSRN_URI_BODY}"
GSRNP_TAG_URI_BODY = f"gsrnp-96:{NUMERIC_COMPONENT}\.{GSRNP_URI_BODY}"
GDTI_TAG_URI_BODY = f"(gdti-96|gdti-174):{NUMERIC_COMPONENT}\.{GDTI_URI_BODY}"
CPI_TAG_URI_BODY = f"(cpi-96|cpi-var):{NUMERIC_COMPONENT}\.{CPI_URI_BODY}"
SGCN_TAG_URI_BODY = f"sgcn-96:{NUMERIC_COMPONENT}\.{SGCN_URI_BODY}"
ITIP_TAG_URI_BODY = f"(itip-110|itip-212):{NUMERIC_COMPONENT}\.{ITIP_URI_BODY}"
GID_TAG_URI_BODY = f"gid-96:{GID_URI_BODY}"
USDOD_TAG_URI_BODY = f"usdod-96:{NUMERIC_COMPONENT}\.{USDOD_URI_BODY}"
ADI_TAG_URI_BODY = f"adi-var:{NUMERIC_COMPONENT}\.{ADI_URI_BODY}"
TAG_URI_BODY = (
f"({SGTIN_TAG_URI_BODY}|{SSCC_TAG_URI_BODY}|{SGLN_TAG_URI_BODY}|{GRAI_TAG_URI_BODY}"
f"|{GIAI_TAG_URI_BODY}|{GSRN_TAG_URI_BODY}|{GSRNP_TAG_URI_BODY}|{GDTI_TAG_URI_BODY}"
f"|{CPI_TAG_URI_BODY}|{SGCN_TAG_URI_BODY}|{ITIP_TAG_URI_BODY}|{GID_TAG_URI_BODY}"
f"|{USDOD_TAG_URI_BODY}|{ADI_TAG_URI_BODY})"
)
TAG_URI = f"urn:epc:tag:{TAG_URI_BODY}"
# GS1 element strings
SGTIN_GS1_ELEMENT_STRING = f"\(01\){DIGIT}{{14}}\(21\){GS1_ELEM_CHARS}{{1,20}}"
SSCC_GS1_ELEMENT_STRING = f"\(00\){DIGIT}{{18}}"
SGLN_GS1_ELEMENT_STRING = f"\(414\){DIGIT}{{13}}\(254\){GS1_ELEM_CHARS}{{1,20}}"
GRAI_GS1_ELEMENT_STRING = f"\(8003\)0{DIGIT}{{13}}{GS1_ELEM_CHARS}{{1,16}}"
GIAI_GS1_ELEMENT_STRING = f"\(8004\){DIGIT}{{6,12}}{GS1_ELEM_CHARS}{{1,24}}"
GSRN_GS1_ELEMENT_STRING = f"\(8018\){DIGIT}{{18}}"
GSRNP_GS1_ELEMENT_STRING = f"\(8017\){DIGIT}{{18}}"
GDTI_GS1_ELEMENT_STRING = f"\(253\){DIGIT}{{13}}{GS1_ELEM_CHARS}{{1,17}}"
CPI_GS1_ELEMENT_STRING = (
f"\(8010\){DIGIT}{{6,12}}{GS1_ELEM_CHARS_CPI}{{,24}}\(8011\){DIGIT}{{1,12}}"
)
SGCN_GS1_ELEMENT_STRING = f"\(255\){DIGIT}{{13}}{GS1_ELEM_CHARS}{{1,12}}"
GINC_GS1_ELEMENT_STRING = f"\(401\){DIGIT}{{6,12}}{GS1_ELEM_CHARS}{{1,24}}"
GSIN_GS1_ELEMENT_STRING = f"\(402\){DIGIT}{{17}}"
ITIP_GS1_ELEMENT_STRING = f"\(8006\){DIGIT}{{18}}\(21\){GS1_ELEM_CHARS}{{1,20}}"
UPUI_GS1_ELEMENT_STRING = f"\(01\){DIGIT}{{14}}\(235\){GS1_ELEM_CHARS}{{1,28}}"
PGLN_GS1_ELEMENT_STRING = f"\(417\){DIGIT}{{13}}"
LGTIN_GS1_ELEMENT_STRING = f"\(01\){DIGIT}{{14}}\(10\){GS1_ELEM_CHARS}{{1,20}}"
GS1_ELEMENT_STRING = (
f"({SGTIN_GS1_ELEMENT_STRING}|{SSCC_GS1_ELEMENT_STRING}|{SGLN_GS1_ELEMENT_STRING}"
f"|{GRAI_GS1_ELEMENT_STRING}|{GIAI_GS1_ELEMENT_STRING}|{GSRN_GS1_ELEMENT_STRING}"
f"|{GSRNP_GS1_ELEMENT_STRING}|{GDTI_GS1_ELEMENT_STRING}|{CPI_GS1_ELEMENT_STRING}"
f"|{SGCN_GS1_ELEMENT_STRING}|{GINC_GS1_ELEMENT_STRING}|{GSIN_GS1_ELEMENT_STRING}"
f"|{ITIP_GS1_ELEMENT_STRING}|{UPUI_GS1_ELEMENT_STRING}|{PGLN_GS1_ELEMENT_STRING}"
f"|{LGTIN_GS1_ELEMENT_STRING})"
)
| cpref_component = '([0-9A-Z-]|%2F|%23)+'
numeric_component = '(0|[1-9]\\d*)'
gs3_a3_char = "((%[0-9a-fA-F])|([a-zA-Z0-9!'()*+,-.:;=_]))"
gs3_a3_component = f'{GS3A3_CHAR}+'
padded_numeric_component = '\\d+'
padded_numeric_component_or_empty = '\\d*'
verify_gs3_a3_chars = '[a-zA-Z0-9!\'()*+,-.:;=_"%&/<>?]+'
gs1_elem_chars = '[a-zA-Z0-9!\'()*+,-.:;=_"%&/<>?]'
gs1_elem_chars_cpi = '[0-9A-Z\\/\\-\\#]'
digit = '\\d'
four_padded_numeric_components = f'{PADDED_NUMERIC_COMPONENT}\\.{PADDED_NUMERIC_COMPONENT}\\.{PADDED_NUMERIC_COMPONENT}\\.{PADDED_NUMERIC_COMPONENT}'
sgtin_uri_body = f'{PADDED_NUMERIC_COMPONENT}\\.{PADDED_NUMERIC_COMPONENT}\\.{GS3A3_COMPONENT}'
sgtin_uri = f'urn:epc:id:sgtin:{SGTIN_URI_BODY}'
sscc_uri_body = f'{PADDED_NUMERIC_COMPONENT}\\.{PADDED_NUMERIC_COMPONENT}'
sscc_uri = f'urn:epc:id:sscc:{SSCC_URI_BODY}'
sgln_uri_body = f'{PADDED_NUMERIC_COMPONENT}\\.{PADDED_NUMERIC_COMPONENT_OR_EMPTY}\\.{GS3A3_COMPONENT}'
sgln_uri = f'urn:epc:id:sgln:{SGLN_URI_BODY}'
grai_uri_body = f'{PADDED_NUMERIC_COMPONENT}\\.{PADDED_NUMERIC_COMPONENT_OR_EMPTY}\\.{GS3A3_COMPONENT}'
grai_uri = f'urn:epc:id:grai:{GRAI_URI_BODY}'
giai_uri_body = f'{PADDED_NUMERIC_COMPONENT}\\.{GS3A3_COMPONENT}'
giai_uri = f'urn:epc:id:giai:{GIAI_URI_BODY}'
gsrn_uri_body = f'{PADDED_NUMERIC_COMPONENT}\\.{PADDED_NUMERIC_COMPONENT}'
gsrn_uri = f'urn:epc:id:gsrn:{GSRN_URI_BODY}'
gsrnp_uri_body = f'{PADDED_NUMERIC_COMPONENT}\\.{PADDED_NUMERIC_COMPONENT}'
gsrnp_uri = f'urn:epc:id:gsrnp:{GSRN_URI_BODY}'
gdti_uri_body = f'{PADDED_NUMERIC_COMPONENT}\\.{PADDED_NUMERIC_COMPONENT_OR_EMPTY}\\.{GS3A3_COMPONENT}'
gdti_uri = f'urn:epc:id:gdti:{GDTI_URI_BODY}'
cpi_uri_body = f'{PADDED_NUMERIC_COMPONENT}\\.{CPREF_COMPONENT}\\.{NUMERIC_COMPONENT}'
cpi_uri = f'urn:epc:id:cpi:{CPI_URI_BODY}'
sgcn_uri_body = f'{PADDED_NUMERIC_COMPONENT}\\.{PADDED_NUMERIC_COMPONENT_OR_EMPTY}\\.{PADDED_NUMERIC_COMPONENT}'
sgcn_uri = f'urn:epc:id:sgcn:{SGCN_URI_BODY}'
ginc_uri_body = f'{PADDED_NUMERIC_COMPONENT}\\.{GS3A3_COMPONENT}'
ginc_uri = f'urn:epc:id:ginc:{GINC_URI_BODY}'
gsin_uri_body = f'{PADDED_NUMERIC_COMPONENT}\\.{PADDED_NUMERIC_COMPONENT}'
gsin_uri = f'urn:epc:id:gsin:{GSIN_URI_BODY}'
itip_uri_body = f'{FOUR_PADDED_NUMERIC_COMPONENTS}\\.{GS3A3_COMPONENT}'
itip_uri = f'urn:epc:id:itip:{ITIP_URI_BODY}'
upui_uri_body = f'{PADDED_NUMERIC_COMPONENT}\\.{PADDED_NUMERIC_COMPONENT_OR_EMPTY}\\.{GS3A3_COMPONENT}'
upui_uri = f'urn:epc:id:upui:{UPUI_URI_BODY}'
pgln_uri_body = f'{PADDED_NUMERIC_COMPONENT}\\.{PADDED_NUMERIC_COMPONENT_OR_EMPTY}'
pgln_uri = f'urn:epc:id:pgln:{PGLN_URI_BODY}'
gid_uri_body = f'{NUMERIC_COMPONENT}\\.{NUMERIC_COMPONENT}\\.{NUMERIC_COMPONENT}'
gid_uri = f'urn:epc:id:gid:{GID_URI_BODY}'
cage_code_or_dodaac = '([0-9A-HJ-NP-Z]){5,6}'
usdod_uri_body = f'{CAGE_CODE_OR_DODAAC}\\.{NUMERIC_COMPONENT}'
usdod_uri = f'urn:epc:id:usdod:{USDOD_URI_BODY}'
adi_char = '([A-Z0-9-]|(%2F))'
adi_uri_body = f'{CAGE_CODE_OR_DODAAC}\\.{ADI_CHAR}*\\.(%23)?{ADI_CHAR}+'
adi_uri = f'urn:epc:id:adi:{ADI_URI_BODY}'
bic_uri_body = '[A-HJ-NP-Z]{3}[JUZ][0-9]{7}'
bic_uri = f'urn:epc:id:bic:{BIC_URI_BODY}'
imovn_uri_body = '[0-9]{7}'
imovn_uri = f'urn:epc:id:imovn:{IMOVN_URI_BODY}'
lgtin_class = f'urn:epc:class:lgtin:{PADDED_NUMERIC_COMPONENT}\\.{PADDED_NUMERIC_COMPONENT}\\.{GS3A3_COMPONENT}'
epc_uri = f'({SGTIN_URI}|{SSCC_URI}|{SGLN_URI}|{GRAI_URI}|{GIAI_URI}|{GSRN_URI}|{GSRNP_URI}|{GDTI_URI}|{CPI_URI}|{SGCN_URI}|{GINC_URI}|{GSIN_URI}|{ITIP_URI}|{UPUI_URI}|{PGLN_URI}|{GID_URI}|{USDOD_URI}|{ADI_URI}|{BIC_URI}|{IMOVN_URI}|{LGTIN_CLASS})'
sgtin_idpat_uri_body = f'sgtin:({PADDED_NUMERIC_COMPONENT}\\.{PADDED_NUMERIC_COMPONENT}\\.{GS3A3_COMPONENT}|{PADDED_NUMERIC_COMPONENT}\\.{PADDED_NUMERIC_COMPONENT}\\.\\*|{PADDED_NUMERIC_COMPONENT}\\.\\*\\.\\*|\\*\\.\\*\\.\\*)'
sscc_idpat_uri_body = f'sscc:({PADDED_NUMERIC_COMPONENT}\\.{PADDED_NUMERIC_COMPONENT}|{PADDED_NUMERIC_COMPONENT}\\.\\*|\\*\\.\\*)'
sgln_grai_idpat_uri_body_main = f'({PADDED_NUMERIC_COMPONENT}\\.{PADDED_NUMERIC_COMPONENT_OR_EMPTY}\\.{GS3A3_COMPONENT}|{PADDED_NUMERIC_COMPONENT}\\.{PADDED_NUMERIC_COMPONENT_OR_EMPTY}\\.\\*|{PADDED_NUMERIC_COMPONENT}\\.\\*\\.\\*|\\*\\.\\*\\.\\*)'
sgln_idpat_uri_body = f'sgln:{SGLN_GRAI_IDPAT_URI_BODY_MAIN}'
grai_idpat_uri_body = f'grai:{SGLN_GRAI_IDPAT_URI_BODY_MAIN}'
giai_idpat_uri_body = f'giai:({PADDED_NUMERIC_COMPONENT}\\.{GS3A3_COMPONENT}|{PADDED_NUMERIC_COMPONENT}\\.\\*|\\*\\.\\*)'
gsrn_idpat_uri_body = f'gsrn:({PADDED_NUMERIC_COMPONENT}\\.{PADDED_NUMERIC_COMPONENT}|{PADDED_NUMERIC_COMPONENT}\\.\\*|\\*\\.\\*)'
gsrnp_idpat_uri_body = f'gsrnp:({PADDED_NUMERIC_COMPONENT}\\.{PADDED_NUMERIC_COMPONENT}|{PADDED_NUMERIC_COMPONENT}\\.\\*|\\*\\.\\*)'
gdti_idpat_uri_body = f'gdti:({PADDED_NUMERIC_COMPONENT}\\.{PADDED_NUMERIC_COMPONENT_OR_EMPTY}\\.{GS3A3_COMPONENT}|{PADDED_NUMERIC_COMPONENT}\\.{PADDED_NUMERIC_COMPONENT_OR_EMPTY}\\.\\*|{PADDED_NUMERIC_COMPONENT}\\.\\*\\.\\*|\\*\\.\\*\\.\\*)'
cpi_idpat_uri_body = f'cpi:({PADDED_NUMERIC_COMPONENT}\\.{CPREF_COMPONENT}\\.{NUMERIC_COMPONENT}|{PADDED_NUMERIC_COMPONENT}\\.{CPREF_COMPONENT}\\.\\*|{PADDED_NUMERIC_COMPONENT}\\.\\*\\.\\*|\\*\\.\\*\\.\\*)'
sgcn_idpat_uri_body = f'sgcn:({PADDED_NUMERIC_COMPONENT}\\.{PADDED_NUMERIC_COMPONENT_OR_EMPTY}\\.{PADDED_NUMERIC_COMPONENT}|{PADDED_NUMERIC_COMPONENT}\\.{PADDED_NUMERIC_COMPONENT_OR_EMPTY}\\.\\*|{PADDED_NUMERIC_COMPONENT}\\.\\*\\.\\*|\\*\\.\\*\\.\\*)'
ginc_idpat_uri_body = f'ginc:({PADDED_NUMERIC_COMPONENT}\\.{GS3A3_COMPONENT}|{PADDED_NUMERIC_COMPONENT}\\.\\*|\\*\\.\\*)'
gsin_idpat_uri_body = f'gsin:({PADDED_NUMERIC_COMPONENT}\\.{PADDED_NUMERIC_COMPONENT}|{PADDED_NUMERIC_COMPONENT}\\.\\*|\\*\\.\\*)'
itip_idpat_uri_body = f'itip:({FOUR_PADDED_NUMERIC_COMPONENTS}\\.{GS3A3_COMPONENT}|{FOUR_PADDED_NUMERIC_COMPONENTS}\\.\\*|{PADDED_NUMERIC_COMPONENT}\\.{PADDED_NUMERIC_COMPONENT}\\.\\*\\.\\*\\.\\*|{PADDED_NUMERIC_COMPONENT}\\.\\*\\.\\*\\.\\*\\.\\*|\\*\\.\\*\\*\\.\\*\\.\\*)'
upui_idpat_uri_body = f'upui:({PADDED_NUMERIC_COMPONENT}\\.{PADDED_NUMERIC_COMPONENT}\\.{GS3A3_COMPONENT}|{PADDED_NUMERIC_COMPONENT}\\.{PADDED_NUMERIC_COMPONENT}\\.\\*|{PADDED_NUMERIC_COMPONENT}\\.\\*\\.\\*|\\*\\.\\*\\.\\*)'
pgln_idpat_uri_body = f'pgln:({PADDED_NUMERIC_COMPONENT}\\.{PADDED_NUMERIC_COMPONENT_OR_EMPTY}|{PADDED_NUMERIC_COMPONENT}\\.\\*|\\*\\.\\*)'
gid_idpat_uri_body = f'gid:({NUMERIC_COMPONENT}\\.{NUMERIC_COMPONENT}\\.{NUMERIC_COMPONENT}|{NUMERIC_COMPONENT}\\.{NUMERIC_COMPONENT}\\.\\*|{NUMERIC_COMPONENT}\\.\\*\\.\\*|\\*\\.\\*\\.\\*)'
usdod_idpat_uri_body = f'usdod:({CAGE_CODE_OR_DODAAC}\\.{NUMERIC_COMPONENT}|{CAGE_CODE_OR_DODAAC}\\.\\*|\\*\\.\\*)'
adi_idpat_uri_body = f'adi:({CAGE_CODE_OR_DODAAC}\\.{ADI_CHAR}*\\.(%23)?{ADI_CHAR}+|{CAGE_CODE_OR_DODAAC}\\.{ADI_CHAR}*\\.\\*|{CAGE_CODE_OR_DODAAC}\\.\\*\\.\\*|\\*\\.\\*\\.\\*)'
idpat_body = f'({SGTIN_IDPAT_URI_BODY}|{SSCC_IDPAT_URI_BODY}|{SGLN_IDPAT_URI_BODY}|{GRAI_IDPAT_URI_BODY}|{GIAI_IDPAT_URI_BODY}|{GSRN_IDPAT_URI_BODY}|{GSRNP_IDPAT_URI_BODY}|{GDTI_IDPAT_URI_BODY}|{CPI_IDPAT_URI_BODY}|{SGCN_IDPAT_URI_BODY}|{GINC_IDPAT_URI_BODY}|{GSIN_IDPAT_URI_BODY}|{ITIP_IDPAT_URI_BODY}|{UPUI_IDPAT_URI_BODY}|{PGLN_IDPAT_URI_BODY}|{GID_IDPAT_URI_BODY}|{USDOD_IDPAT_URI_BODY}|{ADI_IDPAT_URI_BODY})'
idpat_uri = f'urn:epc:idpat:{IDPAT_BODY}'
sgtin_tag_uri_body = f'(sgtin-96|sgtin-198):{NUMERIC_COMPONENT}\\.{SGTIN_URI_BODY}'
sscc_tag_uri_body = f'sscc-96:{NUMERIC_COMPONENT}\\.{SSCC_URI_BODY}'
sgln_tag_uri_body = f'(sgln-96|sgln-195):{NUMERIC_COMPONENT}\\.{SGLN_URI_BODY}'
grai_tag_uri_body = f'(grai-96|grai-170):{NUMERIC_COMPONENT}\\.{GRAI_URI_BODY}'
giai_tag_uri_body = f'(giai-96|giai-202):{NUMERIC_COMPONENT}\\.{GIAI_URI_BODY}'
gsrn_tag_uri_body = f'gsrn-96:{NUMERIC_COMPONENT}\\.{GSRN_URI_BODY}'
gsrnp_tag_uri_body = f'gsrnp-96:{NUMERIC_COMPONENT}\\.{GSRNP_URI_BODY}'
gdti_tag_uri_body = f'(gdti-96|gdti-174):{NUMERIC_COMPONENT}\\.{GDTI_URI_BODY}'
cpi_tag_uri_body = f'(cpi-96|cpi-var):{NUMERIC_COMPONENT}\\.{CPI_URI_BODY}'
sgcn_tag_uri_body = f'sgcn-96:{NUMERIC_COMPONENT}\\.{SGCN_URI_BODY}'
itip_tag_uri_body = f'(itip-110|itip-212):{NUMERIC_COMPONENT}\\.{ITIP_URI_BODY}'
gid_tag_uri_body = f'gid-96:{GID_URI_BODY}'
usdod_tag_uri_body = f'usdod-96:{NUMERIC_COMPONENT}\\.{USDOD_URI_BODY}'
adi_tag_uri_body = f'adi-var:{NUMERIC_COMPONENT}\\.{ADI_URI_BODY}'
tag_uri_body = f'({SGTIN_TAG_URI_BODY}|{SSCC_TAG_URI_BODY}|{SGLN_TAG_URI_BODY}|{GRAI_TAG_URI_BODY}|{GIAI_TAG_URI_BODY}|{GSRN_TAG_URI_BODY}|{GSRNP_TAG_URI_BODY}|{GDTI_TAG_URI_BODY}|{CPI_TAG_URI_BODY}|{SGCN_TAG_URI_BODY}|{ITIP_TAG_URI_BODY}|{GID_TAG_URI_BODY}|{USDOD_TAG_URI_BODY}|{ADI_TAG_URI_BODY})'
tag_uri = f'urn:epc:tag:{TAG_URI_BODY}'
sgtin_gs1_element_string = f'\\(01\\){DIGIT}{{14}}\\(21\\){GS1_ELEM_CHARS}{{1,20}}'
sscc_gs1_element_string = f'\\(00\\){DIGIT}{{18}}'
sgln_gs1_element_string = f'\\(414\\){DIGIT}{{13}}\\(254\\){GS1_ELEM_CHARS}{{1,20}}'
grai_gs1_element_string = f'\\(8003\\)0{DIGIT}{{13}}{GS1_ELEM_CHARS}{{1,16}}'
giai_gs1_element_string = f'\\(8004\\){DIGIT}{{6,12}}{GS1_ELEM_CHARS}{{1,24}}'
gsrn_gs1_element_string = f'\\(8018\\){DIGIT}{{18}}'
gsrnp_gs1_element_string = f'\\(8017\\){DIGIT}{{18}}'
gdti_gs1_element_string = f'\\(253\\){DIGIT}{{13}}{GS1_ELEM_CHARS}{{1,17}}'
cpi_gs1_element_string = f'\\(8010\\){DIGIT}{{6,12}}{GS1_ELEM_CHARS_CPI}{{,24}}\\(8011\\){DIGIT}{{1,12}}'
sgcn_gs1_element_string = f'\\(255\\){DIGIT}{{13}}{GS1_ELEM_CHARS}{{1,12}}'
ginc_gs1_element_string = f'\\(401\\){DIGIT}{{6,12}}{GS1_ELEM_CHARS}{{1,24}}'
gsin_gs1_element_string = f'\\(402\\){DIGIT}{{17}}'
itip_gs1_element_string = f'\\(8006\\){DIGIT}{{18}}\\(21\\){GS1_ELEM_CHARS}{{1,20}}'
upui_gs1_element_string = f'\\(01\\){DIGIT}{{14}}\\(235\\){GS1_ELEM_CHARS}{{1,28}}'
pgln_gs1_element_string = f'\\(417\\){DIGIT}{{13}}'
lgtin_gs1_element_string = f'\\(01\\){DIGIT}{{14}}\\(10\\){GS1_ELEM_CHARS}{{1,20}}'
gs1_element_string = f'({SGTIN_GS1_ELEMENT_STRING}|{SSCC_GS1_ELEMENT_STRING}|{SGLN_GS1_ELEMENT_STRING}|{GRAI_GS1_ELEMENT_STRING}|{GIAI_GS1_ELEMENT_STRING}|{GSRN_GS1_ELEMENT_STRING}|{GSRNP_GS1_ELEMENT_STRING}|{GDTI_GS1_ELEMENT_STRING}|{CPI_GS1_ELEMENT_STRING}|{SGCN_GS1_ELEMENT_STRING}|{GINC_GS1_ELEMENT_STRING}|{GSIN_GS1_ELEMENT_STRING}|{ITIP_GS1_ELEMENT_STRING}|{UPUI_GS1_ELEMENT_STRING}|{PGLN_GS1_ELEMENT_STRING}|{LGTIN_GS1_ELEMENT_STRING})' |
#Code to check a string has unique charecters
#using hash_map
def is_unique(inp_str):
c_dict = {}
for c in inp_str:
if c in inp_str:
return False
else:
c_dict[c]=1
return True
#no data structure , bruteforce
def is_unique_bf(inp_str):
for i in range(len(inp_str)-1):
for j in range(i+1,len(inp_str)):
if inp_str[i] == inp_str[j]:
return False
return True
#no data structure , sorting
def is_unique_sort(inp_str):
inp_str =sorted(inp_str)
for i in range(1,len(inp_str)):
if inp_str[i]==inp_str[i-1]:
return False
return True | def is_unique(inp_str):
c_dict = {}
for c in inp_str:
if c in inp_str:
return False
else:
c_dict[c] = 1
return True
def is_unique_bf(inp_str):
for i in range(len(inp_str) - 1):
for j in range(i + 1, len(inp_str)):
if inp_str[i] == inp_str[j]:
return False
return True
def is_unique_sort(inp_str):
inp_str = sorted(inp_str)
for i in range(1, len(inp_str)):
if inp_str[i] == inp_str[i - 1]:
return False
return True |
string = 'afassdfasdfa'
start = maxLength = 0
mydict = {}
for i, c in enumerate(string):
if c in mydict and start <= mydict[c]:
start = mydict[c] + 1
else:
maxLength = max(maxLength, i-start+1)
mydict[c] = i
print(mydict)
print(maxLength, mydict )
| string = 'afassdfasdfa'
start = max_length = 0
mydict = {}
for (i, c) in enumerate(string):
if c in mydict and start <= mydict[c]:
start = mydict[c] + 1
else:
max_length = max(maxLength, i - start + 1)
mydict[c] = i
print(mydict)
print(maxLength, mydict) |
{
"targets": [
{
"target_name": "addon",
"sources": [
"SensorFusion_Addon.cpp", "SensorFusion.cpp", "Vector3D.cpp"
],
"include_dirs": [
"/usr/include/upm/","/usr/include/mraa/"
],
"libraries": [
"/usr/lib/libupm-lsm9ds0.so"
],
"cflags": [ "-fexceptions" ],
"cflags_cc": [ "-fexceptions" ]
}
]
}
| {'targets': [{'target_name': 'addon', 'sources': ['SensorFusion_Addon.cpp', 'SensorFusion.cpp', 'Vector3D.cpp'], 'include_dirs': ['/usr/include/upm/', '/usr/include/mraa/'], 'libraries': ['/usr/lib/libupm-lsm9ds0.so'], 'cflags': ['-fexceptions'], 'cflags_cc': ['-fexceptions']}]} |
def update_session_credentials(config, session_credentials, profile):
if not config.has_section(profile):
config.add_section(profile)
config.set(profile, "aws_access_key_id", session_credentials.access_key)
config.set(profile, "aws_secret_access_key", session_credentials.secret_key)
config.set(profile, "aws_session_token", session_credentials.token)
return config
def write_session_credentials(config, credentials_path):
with open(credentials_path, "w") as configfile:
config.write(configfile)
def export_session_credentials(session_credentials, profile):
print(f"export AWS_ACCESS_KEY_ID={session_credentials.access_key}")
print(f"export AWS_SECRET_ACCESS_KEY={session_credentials.secret_key}")
print(f"export AWS_SESSION_TOKEN={session_credentials.token}")
print(f"export AWS_PROFILE={profile}")
| def update_session_credentials(config, session_credentials, profile):
if not config.has_section(profile):
config.add_section(profile)
config.set(profile, 'aws_access_key_id', session_credentials.access_key)
config.set(profile, 'aws_secret_access_key', session_credentials.secret_key)
config.set(profile, 'aws_session_token', session_credentials.token)
return config
def write_session_credentials(config, credentials_path):
with open(credentials_path, 'w') as configfile:
config.write(configfile)
def export_session_credentials(session_credentials, profile):
print(f'export AWS_ACCESS_KEY_ID={session_credentials.access_key}')
print(f'export AWS_SECRET_ACCESS_KEY={session_credentials.secret_key}')
print(f'export AWS_SESSION_TOKEN={session_credentials.token}')
print(f'export AWS_PROFILE={profile}') |
student = {
"Name": "Shantanu",
"Age": 21,
"feedback": None
}
student["lastName"] = "Kamath"
try:
lastName = student["lastName"]
new_var = 3 + student["lastName"]
except KeyError:
print("Error finding last name")
except TypeError as error:
print("Cant add these two together", error)
except Exception:
print("Unknown exception")
print("This code executes") | student = {'Name': 'Shantanu', 'Age': 21, 'feedback': None}
student['lastName'] = 'Kamath'
try:
last_name = student['lastName']
new_var = 3 + student['lastName']
except KeyError:
print('Error finding last name')
except TypeError as error:
print('Cant add these two together', error)
except Exception:
print('Unknown exception')
print('This code executes') |
#PRIME OR NOT
num=int(input('Enter a number'))
if num<=1:
print('Please enter a valid number')
for i in range(2,num):
if(num % i == 0):
print("The number is not prime number")
break
else:
print('The number is a prime number') | num = int(input('Enter a number'))
if num <= 1:
print('Please enter a valid number')
for i in range(2, num):
if num % i == 0:
print('The number is not prime number')
break
else:
print('The number is a prime number') |
def serialize_suggestions_values_response(result):
try:
field_values = result["aggregations"]["values"]["buckets"]
except KeyError:
field_values = []
return field_values
def serialize_mappings(mappings):
result = []
for field in mappings:
result.append({"name": field.name, "type": field.elastic_field_type})
return result
| def serialize_suggestions_values_response(result):
try:
field_values = result['aggregations']['values']['buckets']
except KeyError:
field_values = []
return field_values
def serialize_mappings(mappings):
result = []
for field in mappings:
result.append({'name': field.name, 'type': field.elastic_field_type})
return result |
with open('02.txt', 'r') as f:
data = f.read()
player_1_data, player_2_data = data.split('\n\n')
player_1_cards = list(map(int, player_1_data.split(':')[1].split()))
player_2_cards = list(map(int, player_2_data.split(':')[1].split()))
while player_1_cards and player_2_cards:
card_1 = player_1_cards.pop(0)
card_2 = player_2_cards.pop(0)
if card_1 > card_2:
player_1_cards.extend([card_1, card_2])
elif card_2 > card_1:
player_2_cards.extend([card_2, card_1])
if player_1_cards:
winner = player_1_cards
else:
winner = player_2_cards
total = 0
winner.reverse()
for m, c in enumerate(winner):
total += (m+1) * c
print('Part 1:', total)
player_1_cards = list(map(int, player_1_data.split(':')[1].split()))
player_2_cards = list(map(int, player_2_data.split(':')[1].split()))
def game(p1_cards, p2_cards):
games = set()
while p1_cards and p2_cards:
if (game_state := tuple(p1_cards + ['+'] + p2_cards)) in games:
return [1], []
else:
games.add(game_state)
c1 = p1_cards.pop(0)
c2 = p2_cards.pop(0)
if len(p1_cards) >= c1 and len(p2_cards) >= c2:
sub1_cards, sub2_cards = game(p1_cards[:c1], p2_cards[:c2])
if sub1_cards:
p1_cards.extend([c1, c2])
else:
p2_cards.extend([c2, c1])
elif c1 > c2:
p1_cards.extend([c1, c2])
elif c2 > c1:
p2_cards.extend([c2, c1])
return p1_cards, p2_cards
player_1_cards, player_2_cards = game(player_1_cards, player_2_cards)
if player_1_cards:
winner = player_1_cards
else:
winner = player_2_cards
total = 0
winner.reverse()
for m, c in enumerate(winner):
total += (m+1) * c
print('Part 2:', total) | with open('02.txt', 'r') as f:
data = f.read()
(player_1_data, player_2_data) = data.split('\n\n')
player_1_cards = list(map(int, player_1_data.split(':')[1].split()))
player_2_cards = list(map(int, player_2_data.split(':')[1].split()))
while player_1_cards and player_2_cards:
card_1 = player_1_cards.pop(0)
card_2 = player_2_cards.pop(0)
if card_1 > card_2:
player_1_cards.extend([card_1, card_2])
elif card_2 > card_1:
player_2_cards.extend([card_2, card_1])
if player_1_cards:
winner = player_1_cards
else:
winner = player_2_cards
total = 0
winner.reverse()
for (m, c) in enumerate(winner):
total += (m + 1) * c
print('Part 1:', total)
player_1_cards = list(map(int, player_1_data.split(':')[1].split()))
player_2_cards = list(map(int, player_2_data.split(':')[1].split()))
def game(p1_cards, p2_cards):
games = set()
while p1_cards and p2_cards:
if (game_state := tuple(p1_cards + ['+'] + p2_cards)) in games:
return ([1], [])
else:
games.add(game_state)
c1 = p1_cards.pop(0)
c2 = p2_cards.pop(0)
if len(p1_cards) >= c1 and len(p2_cards) >= c2:
(sub1_cards, sub2_cards) = game(p1_cards[:c1], p2_cards[:c2])
if sub1_cards:
p1_cards.extend([c1, c2])
else:
p2_cards.extend([c2, c1])
elif c1 > c2:
p1_cards.extend([c1, c2])
elif c2 > c1:
p2_cards.extend([c2, c1])
return (p1_cards, p2_cards)
(player_1_cards, player_2_cards) = game(player_1_cards, player_2_cards)
if player_1_cards:
winner = player_1_cards
else:
winner = player_2_cards
total = 0
winner.reverse()
for (m, c) in enumerate(winner):
total += (m + 1) * c
print('Part 2:', total) |
# -*- coding: utf-8 -*-
# file: TextProcessor.py
# date: 2022-03-08
class TextProcessor(object):
def __init__(self):
pass
| class Textprocessor(object):
def __init__(self):
pass |
class Solution:
# @param s, a string
# @param wordDict, a set<string>
# @return a boolean
def wordBreak(self, s, wordDict):
dym = [True]
for i in range(1, len(s)+1):
dym.append(False)
for word in wordDict:
l = len(word)
if l <= i and dym[i-l] and s.find(word, i-l, i) >= 0:
dym[-1] = True
break
return dym[-1]
| class Solution:
def word_break(self, s, wordDict):
dym = [True]
for i in range(1, len(s) + 1):
dym.append(False)
for word in wordDict:
l = len(word)
if l <= i and dym[i - l] and (s.find(word, i - l, i) >= 0):
dym[-1] = True
break
return dym[-1] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.