content stringlengths 7 1.05M | fixed_cases stringlengths 1 1.28M |
|---|---|
class Proxy(object):
def __init__(self, inner):
object.__setattr__(
self,
"_obj",
inner
)
#
# proxying (special cases)
#
def __getattribute__(self, name):
value = getattr(object.__getattribute__(self, "_obj"), name)
if callable(value):
fn = value.__func__
value = lambda *args,**kwargs: fn(self, *args, **kwargs)
return value
def __delattr__(self, name):
delattr(object.__getattribute__(self, "_obj"), name)
def __setattr__(self, name, value):
setattr(object.__getattribute__(self, "_obj"), name, value)
def __nonzero__(self):
return bool(object.__getattribute__(self, "_obj"))
def __str__(self):
return str(object.__getattribute__(self, "_obj"))
def __repr__(self):
return repr(object.__getattribute__(self, "_obj"))
def __hash__(self):
return hash(object.__getattribute__(self, "_obj")) | class Proxy(object):
def __init__(self, inner):
object.__setattr__(self, '_obj', inner)
def __getattribute__(self, name):
value = getattr(object.__getattribute__(self, '_obj'), name)
if callable(value):
fn = value.__func__
value = lambda *args, **kwargs: fn(self, *args, **kwargs)
return value
def __delattr__(self, name):
delattr(object.__getattribute__(self, '_obj'), name)
def __setattr__(self, name, value):
setattr(object.__getattribute__(self, '_obj'), name, value)
def __nonzero__(self):
return bool(object.__getattribute__(self, '_obj'))
def __str__(self):
return str(object.__getattribute__(self, '_obj'))
def __repr__(self):
return repr(object.__getattribute__(self, '_obj'))
def __hash__(self):
return hash(object.__getattribute__(self, '_obj')) |
b={}
m={}
d=n=x=y=t=0
s=open(0)
while 1:
if t:x,y,n,t=b[d]
n=m[x,y]=min(m.get((x,y),9e9),n);c=s.read(1)
if c=='$':break
if c=='(':d+=1;b[d]=x,y,n,0
d-=c==')';t=c=='|';y+={'N':1,'S':-1}.get(c,0);x+={'E':1,'W':-1}.get(c,0);n+=1
p=print
v=m.values()
p(max(v))
p(sum(x>999 for x in v))
| b = {}
m = {}
d = n = x = y = t = 0
s = open(0)
while 1:
if t:
(x, y, n, t) = b[d]
n = m[x, y] = min(m.get((x, y), 9000000000.0), n)
c = s.read(1)
if c == '$':
break
if c == '(':
d += 1
b[d] = (x, y, n, 0)
d -= c == ')'
t = c == '|'
y += {'N': 1, 'S': -1}.get(c, 0)
x += {'E': 1, 'W': -1}.get(c, 0)
n += 1
p = print
v = m.values()
p(max(v))
p(sum((x > 999 for x in v))) |
class Node:
def __init__(self, name):
self.name = name
self.triggered = False
self.parents = []
self.child_nodes = []
def add_child(self, child):
if child in self.child_nodes:
return
child.add_parent(self)
self.child_nodes.append(child)
self.child_nodes.sort(key=lambda n: n.name)
def add_parent(self, parent):
if parent in self.parents:
return
self.parents.append(parent)
def can_trigger(self):
for parent in self.parents:
if not parent.triggered:
return False
return True
def is_root(self):
if len(self.parents) == 0:
return True
return False
| class Node:
def __init__(self, name):
self.name = name
self.triggered = False
self.parents = []
self.child_nodes = []
def add_child(self, child):
if child in self.child_nodes:
return
child.add_parent(self)
self.child_nodes.append(child)
self.child_nodes.sort(key=lambda n: n.name)
def add_parent(self, parent):
if parent in self.parents:
return
self.parents.append(parent)
def can_trigger(self):
for parent in self.parents:
if not parent.triggered:
return False
return True
def is_root(self):
if len(self.parents) == 0:
return True
return False |
__log_debug__ = True
def debug(obj):
if __log_debug__:
print(obj)
| __log_debug__ = True
def debug(obj):
if __log_debug__:
print(obj) |
class Solution:
def isValid(self, s: str) -> bool:
replace = True
while replace:
start_len = len(s)
for inner in ['{}', '()', '[]']:
s = s.replace(inner, '')
if start_len == len(s):
replace = False
return s == '' | class Solution:
def is_valid(self, s: str) -> bool:
replace = True
while replace:
start_len = len(s)
for inner in ['{}', '()', '[]']:
s = s.replace(inner, '')
if start_len == len(s):
replace = False
return s == '' |
"""
WITH summary AS (
SELECT
node_id,
title,
ctype,
page_num,
page_rank,
page_highlight,
ROW_NUMBER() OVER(
PARTITION BY
subq.node_id ORDER BY subq.page_rank DESC,
subq.page_num
) AS rk
FROM (
SELECT
node.id AS node_id,
node.title AS title,
node.polymorphic_ctype_id AS ctype,
page.number AS page_num,
ts_rank_cd(
(
// var language
COALESCE(node.title_deu, '') ||
COALESCE(node.ancestors_deu, '') ||
COALESCE(page.text_deu, '')
),
websearch_to_tsquery(
'german'::regconfig, // var language
'Oracle or exit'
),
32
) AS page_rank,
ts_headline(
'german',
page.text,
plainto_tsquery(
'german'::regconfig, // var language
'Oracle or exit'
),
'MaxWords = 30, MinWords = 15, MaxFragments = 1'
) AS page_highlight
FROM core_basetreenode node
LEFT OUTER JOIN core_document doc ON (
doc.basetreenode_ptr_id = node.id
)
LEFT OUTER JOIN core_page page ON (
page.document_id = doc.basetreenode_ptr_id
)
WHERE node.id IN (1, 2, 3) // may or may not be present
) subq
)
SELECT
s.node_id as id,
s.page_highlight as page_highlight
FROM summary s
WHERE s.rk = 1 and page_rank > 0.1
ORDER BY s.ctype desc, s.page_rank DESC
"""
def get_search_sql(lang, desc_filter=[]):
title = {
'deu': 'title_deu',
'eng': 'title_eng'
}
ancestors = {
'deu': 'ancestors_deu',
'eng': 'ancestors_eng'
}
text = {
'deu': 'text_deu',
'eng': 'text_eng',
}
language = {
'deu': 'german',
'eng': 'english'
}
ts_rank_cd = f"""
(
COALESCE(node.{title[lang]}, '') ||
COALESCE(node.{ancestors[lang]}, '') ||
COALESCE(page.{text[lang]}, '')
),
websearch_to_tsquery(
'{language[lang]}'::regconfig,
%(search_term)s
),
32
"""
ts_headline = f"""
'{language[lang]}',
page.text,
plainto_tsquery(
'{language[lang]}'::regconfig,
%(search_term)s
),
'MaxWords = 20, MinWords = 15, MaxFragments = 2'
"""
optional_where = ""
if len(desc_filter) > 0:
optional_where = f"""
WHERE node.id IN ({','.join(desc_filter)})
"""
sql = f"""
WITH summary AS (
SELECT
node_id,
title,
model_ctype,
page_num,
page_rank,
page_highlight,
ROW_NUMBER() OVER(
PARTITION BY
subq.node_id ORDER BY subq.page_rank DESC,
subq.page_num
) AS rk
FROM (
SELECT
node.id AS node_id,
node.title AS title,
ctype.model AS model_ctype,
page.number AS page_num,
ts_rank_cd (
{ts_rank_cd}
) AS page_rank,
ts_headline(
{ts_headline}
) AS page_highlight
FROM core_basetreenode node
LEFT OUTER JOIN core_document doc ON (
doc.basetreenode_ptr_id = node.id
)
LEFT OUTER JOIN core_page page ON (
page.document_id = doc.basetreenode_ptr_id
)
LEFT OUTER JOIN django_content_type ctype ON (
node.polymorphic_ctype_id = ctype.id
)
{optional_where}
) subq
)
SELECT
s.node_id as id,
s.page_highlight as page_highlight,
s.model_ctype as model_ctype
FROM summary s
WHERE s.rk = 1 and page_rank > 0.001
ORDER BY s.model_ctype desc, s.page_rank DESC
"""
return sql
| """
WITH summary AS (
SELECT
node_id,
title,
ctype,
page_num,
page_rank,
page_highlight,
ROW_NUMBER() OVER(
PARTITION BY
subq.node_id ORDER BY subq.page_rank DESC,
subq.page_num
) AS rk
FROM (
SELECT
node.id AS node_id,
node.title AS title,
node.polymorphic_ctype_id AS ctype,
page.number AS page_num,
ts_rank_cd(
(
// var language
COALESCE(node.title_deu, '') ||
COALESCE(node.ancestors_deu, '') ||
COALESCE(page.text_deu, '')
),
websearch_to_tsquery(
'german'::regconfig, // var language
'Oracle or exit'
),
32
) AS page_rank,
ts_headline(
'german',
page.text,
plainto_tsquery(
'german'::regconfig, // var language
'Oracle or exit'
),
'MaxWords = 30, MinWords = 15, MaxFragments = 1'
) AS page_highlight
FROM core_basetreenode node
LEFT OUTER JOIN core_document doc ON (
doc.basetreenode_ptr_id = node.id
)
LEFT OUTER JOIN core_page page ON (
page.document_id = doc.basetreenode_ptr_id
)
WHERE node.id IN (1, 2, 3) // may or may not be present
) subq
)
SELECT
s.node_id as id,
s.page_highlight as page_highlight
FROM summary s
WHERE s.rk = 1 and page_rank > 0.1
ORDER BY s.ctype desc, s.page_rank DESC
"""
def get_search_sql(lang, desc_filter=[]):
title = {'deu': 'title_deu', 'eng': 'title_eng'}
ancestors = {'deu': 'ancestors_deu', 'eng': 'ancestors_eng'}
text = {'deu': 'text_deu', 'eng': 'text_eng'}
language = {'deu': 'german', 'eng': 'english'}
ts_rank_cd = f"\n (\n COALESCE(node.{title[lang]}, '') ||\n COALESCE(node.{ancestors[lang]}, '') ||\n COALESCE(page.{text[lang]}, '')\n ),\n websearch_to_tsquery(\n '{language[lang]}'::regconfig,\n %(search_term)s\n ),\n 32\n "
ts_headline = f"\n '{language[lang]}',\n page.text,\n plainto_tsquery(\n '{language[lang]}'::regconfig,\n %(search_term)s\n ),\n 'MaxWords = 20, MinWords = 15, MaxFragments = 2'\n "
optional_where = ''
if len(desc_filter) > 0:
optional_where = f"\n WHERE node.id IN ({','.join(desc_filter)})\n "
sql = f'\n WITH summary AS (\n SELECT\n node_id,\n title,\n model_ctype,\n page_num,\n page_rank,\n page_highlight,\n ROW_NUMBER() OVER(\n PARTITION BY\n subq.node_id ORDER BY subq.page_rank DESC,\n subq.page_num\n ) AS rk\n FROM (\n SELECT\n node.id AS node_id,\n node.title AS title,\n ctype.model AS model_ctype,\n page.number AS page_num,\n ts_rank_cd (\n {ts_rank_cd}\n ) AS page_rank,\n ts_headline(\n {ts_headline}\n ) AS page_highlight\n FROM core_basetreenode node\n LEFT OUTER JOIN core_document doc ON (\n doc.basetreenode_ptr_id = node.id\n )\n LEFT OUTER JOIN core_page page ON (\n page.document_id = doc.basetreenode_ptr_id\n )\n LEFT OUTER JOIN django_content_type ctype ON (\n node.polymorphic_ctype_id = ctype.id\n )\n {optional_where}\n ) subq\n )\n SELECT\n s.node_id as id,\n s.page_highlight as page_highlight,\n s.model_ctype as model_ctype\n FROM summary s\n WHERE s.rk = 1 and page_rank > 0.001\n ORDER BY s.model_ctype desc, s.page_rank DESC\n '
return sql |
length1 = int(input("Enter the length of room1: "))
width1 = int(input("Enter the width of room1: "))
length2 = int(input("Enter the length of room2: "))
width2 = int(input("Enter the width of room2: "))
area1 = width1*length1
area2 = width2*length2
total = area1 + area2
print("The total area of two rooms is: ", total)
(width1*length1) + (width2 * length2)
| length1 = int(input('Enter the length of room1: '))
width1 = int(input('Enter the width of room1: '))
length2 = int(input('Enter the length of room2: '))
width2 = int(input('Enter the width of room2: '))
area1 = width1 * length1
area2 = width2 * length2
total = area1 + area2
print('The total area of two rooms is: ', total)
width1 * length1 + width2 * length2 |
def test_sync_host_network_backend_without_ifaces(host, add_host, revert_etc):
# test should pass as sync host network ignores backends without networking
result = host.run('stack sync host network')
assert result.rc == 0
def test_sync_host_network_frontend_only(host, revert_etc):
result = host.run('stack sync host network localhost')
assert result.rc == 0
def test_sync_host_network_resolv(host, revert_etc):
''' sync host network should rewrite resolv.conf '''
# RHEL (and possibly others) writes garbage to /etc/resolv.conf
# Since the FE has the same data, just call `sync host network localhost`
# this changes the original file, but the purpose of the test is to verify
# that we will overwrite resolv.conf
# call sync host network
result = host.run('stack sync host network localhost')
assert result.rc == 0
# write garbage to it
with open('/etc/resolv.conf', 'a+') as fi:
fi.seek(0)
og_resolv_data = fi.read()
fi.write('# curatorial nonsense garbage')
fi.seek(0)
garbagedata = fi.read()
assert garbagedata != og_resolv_data
# call sync host network
result = host.run('stack sync host network localhost')
assert result.rc == 0
# verify we actually do rewrite resolv.conf
with open('/etc/resolv.conf') as fi:
assert og_resolv_data == fi.read()
def test_ensure_hostfile_matches_database(host, revert_etc):
# ensure starting hostfile is what the FE would write
# get the og hostfile
with open('/etc/hosts') as fi:
og_hostsfiledata = fi.read()
# this command will always overwrite /etc/hosts
result = host.run('stack sync host')
assert result.rc == 0
with open('/etc/hosts') as fi:
hostsfiledata = fi.read()
assert og_hostsfiledata == hostsfiledata
| def test_sync_host_network_backend_without_ifaces(host, add_host, revert_etc):
result = host.run('stack sync host network')
assert result.rc == 0
def test_sync_host_network_frontend_only(host, revert_etc):
result = host.run('stack sync host network localhost')
assert result.rc == 0
def test_sync_host_network_resolv(host, revert_etc):
""" sync host network should rewrite resolv.conf """
result = host.run('stack sync host network localhost')
assert result.rc == 0
with open('/etc/resolv.conf', 'a+') as fi:
fi.seek(0)
og_resolv_data = fi.read()
fi.write('# curatorial nonsense garbage')
fi.seek(0)
garbagedata = fi.read()
assert garbagedata != og_resolv_data
result = host.run('stack sync host network localhost')
assert result.rc == 0
with open('/etc/resolv.conf') as fi:
assert og_resolv_data == fi.read()
def test_ensure_hostfile_matches_database(host, revert_etc):
with open('/etc/hosts') as fi:
og_hostsfiledata = fi.read()
result = host.run('stack sync host')
assert result.rc == 0
with open('/etc/hosts') as fi:
hostsfiledata = fi.read()
assert og_hostsfiledata == hostsfiledata |
class Event:
def __init__(self, event_type, target, source, **kwargs):
self._type = event_type
self._target = target
self._source = source
self._kwargs = kwargs
@property
def kwargs(self):
return self._kwargs
@property
def source(self):
return self._source
@property
def target(self):
return self._target
@property
def type(self):
return self._type
# event.py
| class Event:
def __init__(self, event_type, target, source, **kwargs):
self._type = event_type
self._target = target
self._source = source
self._kwargs = kwargs
@property
def kwargs(self):
return self._kwargs
@property
def source(self):
return self._source
@property
def target(self):
return self._target
@property
def type(self):
return self._type |
"""
File: anagram.py
Name: Albert
----------------------------------
This program recursively finds all the anagram(s)
for the word input by user and terminates when the
input string matches the EXIT constant defined
at line 19
If you correctly implement this program, you should see the
number of anagrams for each word listed below:
* arm -> 3 anagrams
* contains -> 5 anagrams
* stop -> 6 anagrams
* tesla -> 10 anagrams
* spear -> 12 anagrams
"""
# Constants
FILE = 'dictionary.txt' # This is the filename of an English dictionary
EXIT = '-1' # Controls when to stop the loop
lst = []
num_run = 0
num_words = 0
d = {} # Dict which count each alphabet in a word, e.g : apple ->
# d = {'a': 1, 'p':2, 'l':1, 'e':1}
def main():
global d, num_words, num_run
read_dictionary()
print('Welcome to stanCode \"Anagram Generator\"(or -1 to quit)')
while True:
search = input('Find anagrams for: ')
if search == EXIT:
break
else:
search = search.lower() # case insensitive
d = duplicate(search)
test = find_anagrams(search)
print(f'{num_words} anagrams: {test}')
print(f'Number of runs: {num_run}')
num_words = 0 # count how many anagrams
num_run = 0 # count the recursion times
def read_dictionary():
global lst
with open(FILE, 'r') as f:
for line in f:
line = line.split()
lst += line
def find_anagrams(s):
"""
:param s: search str
:return: a list of anagrams
"""
print('Searching...')
return find_anagrams_helper(s, '', [])
def find_anagrams_helper(s, ans, ans_lst):
global lst, num_run, num_words, d
num_run += 1
if len(s) == len(ans):
# Base case
if ans in lst:
# If ans is a word in lst
if ans not in ans_lst:
print(f'Found: {ans}')
print('Searching...')
ans_lst.append(ans)
num_words += 1
return ans_lst
else:
for word in d:
if d[word] > 0:
# choose
ans += word
d[word] -= 1
# explore
if has_prefix(ans):
find_anagrams_helper(s, ans, ans_lst)
# un-choose
ans = ans[:len(ans)-1]
d[word] += 1
return ans_lst
def has_prefix(sub_s):
"""
:param sub_s: str
:return: bool
To check whether sub_sting has prefix in lst (Words-Dictionary)
"""
global lst
for word in lst:
if word.startswith(sub_s):
return True
return False
def duplicate(s):
"""
:param s: search word
:return: Dict
This is the fxn to count each alphabet in a word
"""
d_check = {}
for i in range(len(s)):
if s[i] in d_check:
d_check[s[i]] += 1
else:
d_check[s[i]] = 1
return d_check
if __name__ == '__main__':
main()
| """
File: anagram.py
Name: Albert
----------------------------------
This program recursively finds all the anagram(s)
for the word input by user and terminates when the
input string matches the EXIT constant defined
at line 19
If you correctly implement this program, you should see the
number of anagrams for each word listed below:
* arm -> 3 anagrams
* contains -> 5 anagrams
* stop -> 6 anagrams
* tesla -> 10 anagrams
* spear -> 12 anagrams
"""
file = 'dictionary.txt'
exit = '-1'
lst = []
num_run = 0
num_words = 0
d = {}
def main():
global d, num_words, num_run
read_dictionary()
print('Welcome to stanCode "Anagram Generator"(or -1 to quit)')
while True:
search = input('Find anagrams for: ')
if search == EXIT:
break
else:
search = search.lower()
d = duplicate(search)
test = find_anagrams(search)
print(f'{num_words} anagrams: {test}')
print(f'Number of runs: {num_run}')
num_words = 0
num_run = 0
def read_dictionary():
global lst
with open(FILE, 'r') as f:
for line in f:
line = line.split()
lst += line
def find_anagrams(s):
"""
:param s: search str
:return: a list of anagrams
"""
print('Searching...')
return find_anagrams_helper(s, '', [])
def find_anagrams_helper(s, ans, ans_lst):
global lst, num_run, num_words, d
num_run += 1
if len(s) == len(ans):
if ans in lst:
if ans not in ans_lst:
print(f'Found: {ans}')
print('Searching...')
ans_lst.append(ans)
num_words += 1
return ans_lst
else:
for word in d:
if d[word] > 0:
ans += word
d[word] -= 1
if has_prefix(ans):
find_anagrams_helper(s, ans, ans_lst)
ans = ans[:len(ans) - 1]
d[word] += 1
return ans_lst
def has_prefix(sub_s):
"""
:param sub_s: str
:return: bool
To check whether sub_sting has prefix in lst (Words-Dictionary)
"""
global lst
for word in lst:
if word.startswith(sub_s):
return True
return False
def duplicate(s):
"""
:param s: search word
:return: Dict
This is the fxn to count each alphabet in a word
"""
d_check = {}
for i in range(len(s)):
if s[i] in d_check:
d_check[s[i]] += 1
else:
d_check[s[i]] = 1
return d_check
if __name__ == '__main__':
main() |
"""
Recently I had a visit with my mom and we realized that the two digits that make up my
age when reversed resulted in her age. For example, if she's 73, I'm 37. We wondered how
often this has happened over the years but we got sidetracked with other topics and we
never came up with an answer.
When I got home I figured out that the digits of our ages have been reversible six times
so far. I also figured out that if we're lucky it would happen again in a few years, and
if we're really lucky it would happen one more time after that. In other words, it would
have happened 8 times over all. So the question is, how old am I now?
Write a Python program that searches for solutions to this Puzzler.
Hint: you might find the string method zfill useful.
"""
def reverse_number(number: int) -> int:
"""Takes an integer and returns the reverse of this integer."""
number = str(number).zfill(2)
reversed = int(number[::-1])
return reversed
def are_reversed(number1: int, number2: int) -> bool:
"""Check if two integers are the reverse of each other"""
if number1 == number2:
return False
number1 = str(number1).zfill(2)
number2 = str(number2).zfill(2)
if number1 == number2[::-1]:
return True
else:
return False
def number_ocurrences(diff: int) -> list: #TODO: Fix this function
kid = 0
parent = kid + diff
matches = []
while True:
if parent > 100:
break
#elif reverse_number(kid) > parent:
# print("break2")
# break
if are_reversed(kid, parent) or are_reversed(kid, parent + 1):
print("appending")
matches.append((kid, parent))
kid += 1
parent = kid + diff
return matches
print(number_ocurrences(10))
| """
Recently I had a visit with my mom and we realized that the two digits that make up my
age when reversed resulted in her age. For example, if she's 73, I'm 37. We wondered how
often this has happened over the years but we got sidetracked with other topics and we
never came up with an answer.
When I got home I figured out that the digits of our ages have been reversible six times
so far. I also figured out that if we're lucky it would happen again in a few years, and
if we're really lucky it would happen one more time after that. In other words, it would
have happened 8 times over all. So the question is, how old am I now?
Write a Python program that searches for solutions to this Puzzler.
Hint: you might find the string method zfill useful.
"""
def reverse_number(number: int) -> int:
"""Takes an integer and returns the reverse of this integer."""
number = str(number).zfill(2)
reversed = int(number[::-1])
return reversed
def are_reversed(number1: int, number2: int) -> bool:
"""Check if two integers are the reverse of each other"""
if number1 == number2:
return False
number1 = str(number1).zfill(2)
number2 = str(number2).zfill(2)
if number1 == number2[::-1]:
return True
else:
return False
def number_ocurrences(diff: int) -> list:
kid = 0
parent = kid + diff
matches = []
while True:
if parent > 100:
break
if are_reversed(kid, parent) or are_reversed(kid, parent + 1):
print('appending')
matches.append((kid, parent))
kid += 1
parent = kid + diff
return matches
print(number_ocurrences(10)) |
symbolMap = {"crypto": [
{"symbol": "BTC", "name": "bitcoin", "id": "bitcoin"},
{"symbol": "ETH", "name": "ethereum", "id": "ethereum"},
{"symbol": "ADA", "name": "cardano", "id": "cardano"}
],
"fiat": [
{"symbol": "USDT", "name": "us dollars", "id": "tether"}
]}
| symbol_map = {'crypto': [{'symbol': 'BTC', 'name': 'bitcoin', 'id': 'bitcoin'}, {'symbol': 'ETH', 'name': 'ethereum', 'id': 'ethereum'}, {'symbol': 'ADA', 'name': 'cardano', 'id': 'cardano'}], 'fiat': [{'symbol': 'USDT', 'name': 'us dollars', 'id': 'tether'}]} |
def hello():
print("Hello world ")
return "Hello world"
hello()
| def hello():
print('Hello world ')
return 'Hello world'
hello() |
# Flask
DEBUG = True
# Change this when not testing >.> You know how.
SECRET_KEY = "Aaxus"
SECRET_KEY = "AaxusJWT"
SECURITY_PASSWORD_SALT = "I_Love_Candy"
# Database
# MONGODB_DB = 'aaxusdb'
# MONGODB_HOST = 'localhost'
# MONGODB_PORT = 27017
# MONGODB_USER = 'aaxus'
# MONGODB_PASSWORD = 'aaxus'
# Database Mock
MONGODB_DB = 'aaxusdb'
MONGODB_HOST = 'mongomock://localhost'
MONGODB_PORT = 27017
MONGODB_USER= 'aaxus'
MONGODB_PASSWORD = 'aaxus'
# Vulnerabilities
| debug = True
secret_key = 'Aaxus'
secret_key = 'AaxusJWT'
security_password_salt = 'I_Love_Candy'
mongodb_db = 'aaxusdb'
mongodb_host = 'mongomock://localhost'
mongodb_port = 27017
mongodb_user = 'aaxus'
mongodb_password = 'aaxus' |
class Date:
def __init__(self, strDate):
strDate = strDate.split('.')
self.day = strDate[0]
self.month = strDate[1]
self.year = strDate[2]
| class Date:
def __init__(self, strDate):
str_date = strDate.split('.')
self.day = strDate[0]
self.month = strDate[1]
self.year = strDate[2] |
"""
Problem Statement:
Given an array of integers nums and an integer target, return indices of the two numbers such that they add up to target.
You may assume that each input would have exactly one solution, and you may not use the same element twice.
You can return the answer in any order.
"""
class TwoSum(object):
def bruteForceTwoSum(self, nums, target):
"""
:type nums: List[int]
:type target: int
:rtype: List[int]
"""
resultPair = []
# Loop over the nums array and add each item to see if their sum is target
i = 0
while i < len(nums):
j = 0
while j < len(nums):
if j != i:
if nums[i] + nums[j] == target:
resultPair.append(i)
resultPair.append(j)
return resultPair
else:
j += 1
else:
j += 1
i += 1
def onePassTwoSum(self, nums, target):
resultPair = {}
for i, num in enumerate(nums):
diff = target - num
if diff not in resultPair:
resultPair[num] = i
else:
return [resultPair[diff], i]
| """
Problem Statement:
Given an array of integers nums and an integer target, return indices of the two numbers such that they add up to target.
You may assume that each input would have exactly one solution, and you may not use the same element twice.
You can return the answer in any order.
"""
class Twosum(object):
def brute_force_two_sum(self, nums, target):
"""
:type nums: List[int]
:type target: int
:rtype: List[int]
"""
result_pair = []
i = 0
while i < len(nums):
j = 0
while j < len(nums):
if j != i:
if nums[i] + nums[j] == target:
resultPair.append(i)
resultPair.append(j)
return resultPair
else:
j += 1
else:
j += 1
i += 1
def one_pass_two_sum(self, nums, target):
result_pair = {}
for (i, num) in enumerate(nums):
diff = target - num
if diff not in resultPair:
resultPair[num] = i
else:
return [resultPair[diff], i] |
class Rotation(object):
def __init__(self,yaw=0,roll=0,pitch=0):
self.yaw = yaw
self.roll = roll
self.pitch = pitch
class Location(object):
def __init__(self,x,y,z):
self.x = x
self.y = y
self.z = z
class Transform(object):
def __init__(self,rotation,location):
self.rotation = rotation
self.location = location
| class Rotation(object):
def __init__(self, yaw=0, roll=0, pitch=0):
self.yaw = yaw
self.roll = roll
self.pitch = pitch
class Location(object):
def __init__(self, x, y, z):
self.x = x
self.y = y
self.z = z
class Transform(object):
def __init__(self, rotation, location):
self.rotation = rotation
self.location = location |
a=int(input())
for i in range(a):
b=list(map(int,input().split(" ")))
c=0
x=abs(b[c]-b[c+2])
y=abs(b[c+1]-b[c+2])
if(x>y):
print("Police2")
if(x<y):
print("police1")
if(x==y):
print("Both")
| a = int(input())
for i in range(a):
b = list(map(int, input().split(' ')))
c = 0
x = abs(b[c] - b[c + 2])
y = abs(b[c + 1] - b[c + 2])
if x > y:
print('Police2')
if x < y:
print('police1')
if x == y:
print('Both') |
def swap(arr, index_1, index_2):
temp = arr[index_1]
arr[index_1] = arr[index_2]
arr[index_2] = temp
def bubble_sort_unoptimized(arr):
for el in arr:
for index in range(len(arr) - 1):
if arr[index] > arr[index + 1]:
swap(arr, index, index + 1)
def bubble_sort_optimized(arr):
for i in range(len(arr)):
for idx in range(len(arr) - i - 1):
if arr[idx] > arr[idx + 1]:
arr[idx], arr[idx + 1] = arr[idx + 1], arr[idx]
my_nums = [7, 3, 4, 2]
answer = bubble_sort_unoptimized(my_nums)
answer_optimized = bubble_sort_optimized(my_nums)
print(my_nums)
print(answer) | def swap(arr, index_1, index_2):
temp = arr[index_1]
arr[index_1] = arr[index_2]
arr[index_2] = temp
def bubble_sort_unoptimized(arr):
for el in arr:
for index in range(len(arr) - 1):
if arr[index] > arr[index + 1]:
swap(arr, index, index + 1)
def bubble_sort_optimized(arr):
for i in range(len(arr)):
for idx in range(len(arr) - i - 1):
if arr[idx] > arr[idx + 1]:
(arr[idx], arr[idx + 1]) = (arr[idx + 1], arr[idx])
my_nums = [7, 3, 4, 2]
answer = bubble_sort_unoptimized(my_nums)
answer_optimized = bubble_sort_optimized(my_nums)
print(my_nums)
print(answer) |
class UnauthorizedException(Exception):
pass
class BadRequestException(Exception):
pass
class NotFoundException(Exception):
pass
class RedirectException(Exception):
pass
class ServerErrorException(Exception):
pass
class UnexpectedException(Exception):
pass
class LocationHeaderNotFoundException(Exception):
pass | class Unauthorizedexception(Exception):
pass
class Badrequestexception(Exception):
pass
class Notfoundexception(Exception):
pass
class Redirectexception(Exception):
pass
class Servererrorexception(Exception):
pass
class Unexpectedexception(Exception):
pass
class Locationheadernotfoundexception(Exception):
pass |
#
# PySNMP MIB module HPN-ICF-CATV-TRANSCEIVER-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/HPN-ICF-CATV-TRANSCEIVER-MIB
# Produced by pysmi-0.3.4 at Mon Apr 29 19:25:13 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, Integer, ObjectIdentifier = mibBuilder.importSymbols("ASN1", "OctetString", "Integer", "ObjectIdentifier")
NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues")
ConstraintsIntersection, ValueRangeConstraint, ConstraintsUnion, SingleValueConstraint, ValueSizeConstraint = mibBuilder.importSymbols("ASN1-REFINEMENT", "ConstraintsIntersection", "ValueRangeConstraint", "ConstraintsUnion", "SingleValueConstraint", "ValueSizeConstraint")
hpnicfCommon, = mibBuilder.importSymbols("HPN-ICF-OID-MIB", "hpnicfCommon")
ModuleCompliance, NotificationGroup = mibBuilder.importSymbols("SNMPv2-CONF", "ModuleCompliance", "NotificationGroup")
MibIdentifier, ModuleIdentity, MibScalar, MibTable, MibTableRow, MibTableColumn, Bits, iso, Gauge32, ObjectIdentity, Integer32, Counter32, TimeTicks, Unsigned32, Counter64, NotificationType, IpAddress = mibBuilder.importSymbols("SNMPv2-SMI", "MibIdentifier", "ModuleIdentity", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "Bits", "iso", "Gauge32", "ObjectIdentity", "Integer32", "Counter32", "TimeTicks", "Unsigned32", "Counter64", "NotificationType", "IpAddress")
TextualConvention, DisplayString = mibBuilder.importSymbols("SNMPv2-TC", "TextualConvention", "DisplayString")
hpnicfCATVTransceiver = ModuleIdentity((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 94))
if mibBuilder.loadTexts: hpnicfCATVTransceiver.setLastUpdated('200807251008Z')
if mibBuilder.loadTexts: hpnicfCATVTransceiver.setOrganization('')
hpnicfCATVTransStatus = MibIdentifier((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 94, 1))
hpnicfCATVTransStatusScalarObjects = MibIdentifier((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 94, 1, 1))
hpnicfCATVTransState = MibScalar((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 94, 1, 1, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("on", 1), ("off", 2)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: hpnicfCATVTransState.setStatus('current')
hpnicfCATVTransInputPwr = MibScalar((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 94, 1, 1, 2), Integer32()).setUnits('dbm').setMaxAccess("readonly")
if mibBuilder.loadTexts: hpnicfCATVTransInputPwr.setStatus('current')
hpnicfCATVTransOutputLevel = MibScalar((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 94, 1, 1, 3), Integer32()).setUnits('dbuv').setMaxAccess("readonly")
if mibBuilder.loadTexts: hpnicfCATVTransOutputLevel.setStatus('current')
hpnicfCATVTransTemperature = MibScalar((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 94, 1, 1, 4), Integer32()).setUnits('centigrade').setMaxAccess("readonly")
if mibBuilder.loadTexts: hpnicfCATVTransTemperature.setStatus('current')
hpnicfCATVTransceiverMan = MibIdentifier((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 94, 2))
hpnicfCATVTransCtrlScalarObjects = MibIdentifier((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 94, 2, 1))
hpnicfCATVTransInputPwrLowerThr = MibScalar((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 94, 2, 1, 1), Integer32()).setUnits('dbm').setMaxAccess("readwrite")
if mibBuilder.loadTexts: hpnicfCATVTransInputPwrLowerThr.setStatus('current')
hpnicfCATVTransOutputLvlLowerThr = MibScalar((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 94, 2, 1, 2), Integer32()).setUnits('dbuv').setMaxAccess("readwrite")
if mibBuilder.loadTexts: hpnicfCATVTransOutputLvlLowerThr.setStatus('current')
hpnicfCATVTransTempratureUpperThr = MibScalar((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 94, 2, 1, 3), Integer32()).setUnits('').setMaxAccess("readwrite")
if mibBuilder.loadTexts: hpnicfCATVTransTempratureUpperThr.setStatus('current')
hpnicfCATVTansTrap = MibIdentifier((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 94, 3))
hpnicfCATVTransTrapPrefix = MibIdentifier((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 94, 3, 0))
hpnicfCATVTransInputPwrTrap = NotificationType((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 94, 3, 0, 1)).setObjects(("HPN-ICF-CATV-TRANSCEIVER-MIB", "hpnicfCATVTransInputPwr"))
if mibBuilder.loadTexts: hpnicfCATVTransInputPwrTrap.setStatus('current')
hpnicfCATVTransInputPwrReTrap = NotificationType((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 94, 3, 0, 2)).setObjects(("HPN-ICF-CATV-TRANSCEIVER-MIB", "hpnicfCATVTransInputPwr"))
if mibBuilder.loadTexts: hpnicfCATVTransInputPwrReTrap.setStatus('current')
hpnicfCATVTransOutputLvlTrap = NotificationType((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 94, 3, 0, 3)).setObjects(("HPN-ICF-CATV-TRANSCEIVER-MIB", "hpnicfCATVTransOutputLevel"))
if mibBuilder.loadTexts: hpnicfCATVTransOutputLvlTrap.setStatus('current')
hpnicfCATVTransOutputLvlReTrap = NotificationType((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 94, 3, 0, 4)).setObjects(("HPN-ICF-CATV-TRANSCEIVER-MIB", "hpnicfCATVTransOutputLevel"))
if mibBuilder.loadTexts: hpnicfCATVTransOutputLvlReTrap.setStatus('current')
hpnicfCATVTransTemperatureTrap = NotificationType((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 94, 3, 0, 5)).setObjects(("HPN-ICF-CATV-TRANSCEIVER-MIB", "hpnicfCATVTransTemperature"))
if mibBuilder.loadTexts: hpnicfCATVTransTemperatureTrap.setStatus('current')
hpnicfCATVTransTemperatureReTrap = NotificationType((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 94, 3, 0, 6)).setObjects(("HPN-ICF-CATV-TRANSCEIVER-MIB", "hpnicfCATVTransTemperature"))
if mibBuilder.loadTexts: hpnicfCATVTransTemperatureReTrap.setStatus('current')
mibBuilder.exportSymbols("HPN-ICF-CATV-TRANSCEIVER-MIB", hpnicfCATVTransTemperatureReTrap=hpnicfCATVTransTemperatureReTrap, hpnicfCATVTransCtrlScalarObjects=hpnicfCATVTransCtrlScalarObjects, hpnicfCATVTansTrap=hpnicfCATVTansTrap, hpnicfCATVTransInputPwrTrap=hpnicfCATVTransInputPwrTrap, hpnicfCATVTransStatus=hpnicfCATVTransStatus, hpnicfCATVTransTemperature=hpnicfCATVTransTemperature, hpnicfCATVTransInputPwrReTrap=hpnicfCATVTransInputPwrReTrap, hpnicfCATVTransInputPwr=hpnicfCATVTransInputPwr, PYSNMP_MODULE_ID=hpnicfCATVTransceiver, hpnicfCATVTransOutputLevel=hpnicfCATVTransOutputLevel, hpnicfCATVTransOutputLvlTrap=hpnicfCATVTransOutputLvlTrap, hpnicfCATVTransceiver=hpnicfCATVTransceiver, hpnicfCATVTransOutputLvlReTrap=hpnicfCATVTransOutputLvlReTrap, hpnicfCATVTransTrapPrefix=hpnicfCATVTransTrapPrefix, hpnicfCATVTransInputPwrLowerThr=hpnicfCATVTransInputPwrLowerThr, hpnicfCATVTransceiverMan=hpnicfCATVTransceiverMan, hpnicfCATVTransTemperatureTrap=hpnicfCATVTransTemperatureTrap, hpnicfCATVTransState=hpnicfCATVTransState, hpnicfCATVTransOutputLvlLowerThr=hpnicfCATVTransOutputLvlLowerThr, hpnicfCATVTransTempratureUpperThr=hpnicfCATVTransTempratureUpperThr, hpnicfCATVTransStatusScalarObjects=hpnicfCATVTransStatusScalarObjects)
| (octet_string, integer, object_identifier) = mibBuilder.importSymbols('ASN1', 'OctetString', 'Integer', 'ObjectIdentifier')
(named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues')
(constraints_intersection, value_range_constraint, constraints_union, single_value_constraint, value_size_constraint) = mibBuilder.importSymbols('ASN1-REFINEMENT', 'ConstraintsIntersection', 'ValueRangeConstraint', 'ConstraintsUnion', 'SingleValueConstraint', 'ValueSizeConstraint')
(hpnicf_common,) = mibBuilder.importSymbols('HPN-ICF-OID-MIB', 'hpnicfCommon')
(module_compliance, notification_group) = mibBuilder.importSymbols('SNMPv2-CONF', 'ModuleCompliance', 'NotificationGroup')
(mib_identifier, module_identity, mib_scalar, mib_table, mib_table_row, mib_table_column, bits, iso, gauge32, object_identity, integer32, counter32, time_ticks, unsigned32, counter64, notification_type, ip_address) = mibBuilder.importSymbols('SNMPv2-SMI', 'MibIdentifier', 'ModuleIdentity', 'MibScalar', 'MibTable', 'MibTableRow', 'MibTableColumn', 'Bits', 'iso', 'Gauge32', 'ObjectIdentity', 'Integer32', 'Counter32', 'TimeTicks', 'Unsigned32', 'Counter64', 'NotificationType', 'IpAddress')
(textual_convention, display_string) = mibBuilder.importSymbols('SNMPv2-TC', 'TextualConvention', 'DisplayString')
hpnicf_catv_transceiver = module_identity((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 94))
if mibBuilder.loadTexts:
hpnicfCATVTransceiver.setLastUpdated('200807251008Z')
if mibBuilder.loadTexts:
hpnicfCATVTransceiver.setOrganization('')
hpnicf_catv_trans_status = mib_identifier((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 94, 1))
hpnicf_catv_trans_status_scalar_objects = mib_identifier((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 94, 1, 1))
hpnicf_catv_trans_state = mib_scalar((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 94, 1, 1, 1), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('on', 1), ('off', 2)))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
hpnicfCATVTransState.setStatus('current')
hpnicf_catv_trans_input_pwr = mib_scalar((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 94, 1, 1, 2), integer32()).setUnits('dbm').setMaxAccess('readonly')
if mibBuilder.loadTexts:
hpnicfCATVTransInputPwr.setStatus('current')
hpnicf_catv_trans_output_level = mib_scalar((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 94, 1, 1, 3), integer32()).setUnits('dbuv').setMaxAccess('readonly')
if mibBuilder.loadTexts:
hpnicfCATVTransOutputLevel.setStatus('current')
hpnicf_catv_trans_temperature = mib_scalar((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 94, 1, 1, 4), integer32()).setUnits('centigrade').setMaxAccess('readonly')
if mibBuilder.loadTexts:
hpnicfCATVTransTemperature.setStatus('current')
hpnicf_catv_transceiver_man = mib_identifier((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 94, 2))
hpnicf_catv_trans_ctrl_scalar_objects = mib_identifier((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 94, 2, 1))
hpnicf_catv_trans_input_pwr_lower_thr = mib_scalar((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 94, 2, 1, 1), integer32()).setUnits('dbm').setMaxAccess('readwrite')
if mibBuilder.loadTexts:
hpnicfCATVTransInputPwrLowerThr.setStatus('current')
hpnicf_catv_trans_output_lvl_lower_thr = mib_scalar((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 94, 2, 1, 2), integer32()).setUnits('dbuv').setMaxAccess('readwrite')
if mibBuilder.loadTexts:
hpnicfCATVTransOutputLvlLowerThr.setStatus('current')
hpnicf_catv_trans_temprature_upper_thr = mib_scalar((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 94, 2, 1, 3), integer32()).setUnits('').setMaxAccess('readwrite')
if mibBuilder.loadTexts:
hpnicfCATVTransTempratureUpperThr.setStatus('current')
hpnicf_catv_tans_trap = mib_identifier((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 94, 3))
hpnicf_catv_trans_trap_prefix = mib_identifier((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 94, 3, 0))
hpnicf_catv_trans_input_pwr_trap = notification_type((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 94, 3, 0, 1)).setObjects(('HPN-ICF-CATV-TRANSCEIVER-MIB', 'hpnicfCATVTransInputPwr'))
if mibBuilder.loadTexts:
hpnicfCATVTransInputPwrTrap.setStatus('current')
hpnicf_catv_trans_input_pwr_re_trap = notification_type((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 94, 3, 0, 2)).setObjects(('HPN-ICF-CATV-TRANSCEIVER-MIB', 'hpnicfCATVTransInputPwr'))
if mibBuilder.loadTexts:
hpnicfCATVTransInputPwrReTrap.setStatus('current')
hpnicf_catv_trans_output_lvl_trap = notification_type((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 94, 3, 0, 3)).setObjects(('HPN-ICF-CATV-TRANSCEIVER-MIB', 'hpnicfCATVTransOutputLevel'))
if mibBuilder.loadTexts:
hpnicfCATVTransOutputLvlTrap.setStatus('current')
hpnicf_catv_trans_output_lvl_re_trap = notification_type((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 94, 3, 0, 4)).setObjects(('HPN-ICF-CATV-TRANSCEIVER-MIB', 'hpnicfCATVTransOutputLevel'))
if mibBuilder.loadTexts:
hpnicfCATVTransOutputLvlReTrap.setStatus('current')
hpnicf_catv_trans_temperature_trap = notification_type((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 94, 3, 0, 5)).setObjects(('HPN-ICF-CATV-TRANSCEIVER-MIB', 'hpnicfCATVTransTemperature'))
if mibBuilder.loadTexts:
hpnicfCATVTransTemperatureTrap.setStatus('current')
hpnicf_catv_trans_temperature_re_trap = notification_type((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 94, 3, 0, 6)).setObjects(('HPN-ICF-CATV-TRANSCEIVER-MIB', 'hpnicfCATVTransTemperature'))
if mibBuilder.loadTexts:
hpnicfCATVTransTemperatureReTrap.setStatus('current')
mibBuilder.exportSymbols('HPN-ICF-CATV-TRANSCEIVER-MIB', hpnicfCATVTransTemperatureReTrap=hpnicfCATVTransTemperatureReTrap, hpnicfCATVTransCtrlScalarObjects=hpnicfCATVTransCtrlScalarObjects, hpnicfCATVTansTrap=hpnicfCATVTansTrap, hpnicfCATVTransInputPwrTrap=hpnicfCATVTransInputPwrTrap, hpnicfCATVTransStatus=hpnicfCATVTransStatus, hpnicfCATVTransTemperature=hpnicfCATVTransTemperature, hpnicfCATVTransInputPwrReTrap=hpnicfCATVTransInputPwrReTrap, hpnicfCATVTransInputPwr=hpnicfCATVTransInputPwr, PYSNMP_MODULE_ID=hpnicfCATVTransceiver, hpnicfCATVTransOutputLevel=hpnicfCATVTransOutputLevel, hpnicfCATVTransOutputLvlTrap=hpnicfCATVTransOutputLvlTrap, hpnicfCATVTransceiver=hpnicfCATVTransceiver, hpnicfCATVTransOutputLvlReTrap=hpnicfCATVTransOutputLvlReTrap, hpnicfCATVTransTrapPrefix=hpnicfCATVTransTrapPrefix, hpnicfCATVTransInputPwrLowerThr=hpnicfCATVTransInputPwrLowerThr, hpnicfCATVTransceiverMan=hpnicfCATVTransceiverMan, hpnicfCATVTransTemperatureTrap=hpnicfCATVTransTemperatureTrap, hpnicfCATVTransState=hpnicfCATVTransState, hpnicfCATVTransOutputLvlLowerThr=hpnicfCATVTransOutputLvlLowerThr, hpnicfCATVTransTempratureUpperThr=hpnicfCATVTransTempratureUpperThr, hpnicfCATVTransStatusScalarObjects=hpnicfCATVTransStatusScalarObjects) |
'''
Defines quality control settings for different variables
- Section 1 defines ranges for different variables
- Section 2 associated a name with the range
'''
#-------------- Section 1 -------------#
#Test ranges
#Units - N/A
#Ref - XXXX
testVar = {
'good':{
'range':[(0,5),(14,16)],
'rate':[(0,1.4)],
'flat':[(0,15)]
},
'suspicious':{
'range':[(11,13)],
'rate':[(1.4,2)],
'flat':[(15,30)]
},
'ignore_vals':{
'range':[],
'rate':[],
'flat':[]
}
}
#2m air temperature
#Units - C, C/min, minutes
#Ref - XXXX
airT = {
'good':{
'range':[(-30,45)],
'rate':[(-1.4,1.4)],
'flat':[(0,20)]
},
'suspicious':{
'range':[(-40,-30),(45,50)],
'rate':[(1.4,2),(-2,-1.4)],
'flat':[(20,35)]
},
'ignore_vals':{
'range':[],
'rate':[],
'flat':[]
}
}
#2m humidity in open air
#Units - %, %/min, minutes
#Ref - XXXX
rh = {
'good':{
'range':[(5,100)],
'rate':[(-4.4,4.4)],
'flat':[(0,15)]
},
'suspicious':{
'range':[(0,5),(100,105)],
'rate':[(4.4,5),(-5,-4.4)],
'flat':[(15,30)]
},
'ignore_vals':{
'range':[],
'rate':[],
'flat':[0,100]
}
}
#2m barometric pressure in open air
#This could potentially be a function of elevation
#Units - mb, mb/min, minutes
#Ref - XXXX
bp = {
'good':{
'range':[(700,1050)],
'rate':[(-1,1)],
'flat':[(0,40)]
},
'suspicious':{
'range':[],
'rate':[],
'flat':[(40,60)]
},
'ignore_vals':{
'range':[],
'rate':[],
'flat':[0]
}
}
#Wind Speed
#Units - m/s, m/s per min, minutes
#Ref - XXXX
ws = {
'good':{
'range':[(0,40)],
'rate':[(-6,6)],
'flat':[(0,60)]
},
'suspicious':{
'range':[],
'rate':[],
'flat':[(60,90)]
},
'ignore_vals':{
'range':[],
'rate':[],
'flat':[0]
}
}
#Wind Gust
#Units - m/s, m/s per min, minutes
#Ref - XXXX
wg = {
'good':{
'range':[(10,60)],
'rate':[(-10,10)],
'flat':[] #Two days without a gust OK
},
'suspicious':{
'range':[],
'rate':[],
'flat':[]
},
'ignore_vals':{
'range':[],
'rate':[],
'flat':[0]
}
}
#Wind Direction
#Units - mb, mb/min, minutes
#Ref - XXXX
wd = {
'good':{
'range':[(0,360)],
'rate':[(-360,360)],
'flat':[(0,15)]
},
'suspicious':{
'range':[],
'rate':[],
'flat':[(15,30)]
},
'ignore_vals':{
'range':[],
'rate':[],
'flat':[]
}
}
#Solar Radiation
#Units - W/m2, W/m2 per min, minutes
#Ref - XXXX
swrad = {
'good':{
'range':[(0,1500)],
'rate':[(-160,160)],
'flat':[(0,15)]
},
'suspicious':{
'range':[],
'rate':[],
'flat':[(15,30)]
},
'ignore_vals':{
'range':[],
'rate':[],
'flat':[0]
}
}
#Precipitation rate
#Units - in/hr, none, minutes
#Ref - Fiebrich et al. 2010 for the most part
precip = {
'good':{
'range':[(0,6)],
'rate':[(-0.6,0.6)],
'flat':[(0,60)]
},
'suspicious':{
'range':[(6,24)],
'rate':[],
'flat':[(60,90)]
},
'ignore_vals':{
'range':[],
'rate':[],
'flat':[0]
}
}
#---------------- Section 2 ----------------
qcsettings = {
'testVar':testVar,
'air_temperature':airT,
'humidity':rh,
'air_pressure':bp,
'wind_speed':ws,
'wind_direction':wd,
'solar_radiation':swrad,
'precipitation':precip
} | """
Defines quality control settings for different variables
- Section 1 defines ranges for different variables
- Section 2 associated a name with the range
"""
test_var = {'good': {'range': [(0, 5), (14, 16)], 'rate': [(0, 1.4)], 'flat': [(0, 15)]}, 'suspicious': {'range': [(11, 13)], 'rate': [(1.4, 2)], 'flat': [(15, 30)]}, 'ignore_vals': {'range': [], 'rate': [], 'flat': []}}
air_t = {'good': {'range': [(-30, 45)], 'rate': [(-1.4, 1.4)], 'flat': [(0, 20)]}, 'suspicious': {'range': [(-40, -30), (45, 50)], 'rate': [(1.4, 2), (-2, -1.4)], 'flat': [(20, 35)]}, 'ignore_vals': {'range': [], 'rate': [], 'flat': []}}
rh = {'good': {'range': [(5, 100)], 'rate': [(-4.4, 4.4)], 'flat': [(0, 15)]}, 'suspicious': {'range': [(0, 5), (100, 105)], 'rate': [(4.4, 5), (-5, -4.4)], 'flat': [(15, 30)]}, 'ignore_vals': {'range': [], 'rate': [], 'flat': [0, 100]}}
bp = {'good': {'range': [(700, 1050)], 'rate': [(-1, 1)], 'flat': [(0, 40)]}, 'suspicious': {'range': [], 'rate': [], 'flat': [(40, 60)]}, 'ignore_vals': {'range': [], 'rate': [], 'flat': [0]}}
ws = {'good': {'range': [(0, 40)], 'rate': [(-6, 6)], 'flat': [(0, 60)]}, 'suspicious': {'range': [], 'rate': [], 'flat': [(60, 90)]}, 'ignore_vals': {'range': [], 'rate': [], 'flat': [0]}}
wg = {'good': {'range': [(10, 60)], 'rate': [(-10, 10)], 'flat': []}, 'suspicious': {'range': [], 'rate': [], 'flat': []}, 'ignore_vals': {'range': [], 'rate': [], 'flat': [0]}}
wd = {'good': {'range': [(0, 360)], 'rate': [(-360, 360)], 'flat': [(0, 15)]}, 'suspicious': {'range': [], 'rate': [], 'flat': [(15, 30)]}, 'ignore_vals': {'range': [], 'rate': [], 'flat': []}}
swrad = {'good': {'range': [(0, 1500)], 'rate': [(-160, 160)], 'flat': [(0, 15)]}, 'suspicious': {'range': [], 'rate': [], 'flat': [(15, 30)]}, 'ignore_vals': {'range': [], 'rate': [], 'flat': [0]}}
precip = {'good': {'range': [(0, 6)], 'rate': [(-0.6, 0.6)], 'flat': [(0, 60)]}, 'suspicious': {'range': [(6, 24)], 'rate': [], 'flat': [(60, 90)]}, 'ignore_vals': {'range': [], 'rate': [], 'flat': [0]}}
qcsettings = {'testVar': testVar, 'air_temperature': airT, 'humidity': rh, 'air_pressure': bp, 'wind_speed': ws, 'wind_direction': wd, 'solar_radiation': swrad, 'precipitation': precip} |
'''doctest looks for lines beginning with
the interpreter prompt, >>>, to find the beginning of a test case
'''
#python -m doctest -v example7-doctest.py
def my_function(a, b):
"""
>>> my_function(2, 3)
6
>>> my_function('a', 3)
'aaa'
"""
return a * b | """doctest looks for lines beginning with
the interpreter prompt, >>>, to find the beginning of a test case
"""
def my_function(a, b):
"""
>>> my_function(2, 3)
6
>>> my_function('a', 3)
'aaa'
"""
return a * b |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
LABEL_DIRECTORY = 'label' # 'relabel'
IMAGE_DIRECTORY = '.*wsi.*'
LABEL_DIRECTORIES = [
'label',
'relabel',
]
LABEL_FILENAME = 'label.tiff'
MASKED_IMAGE_FILENAME = 'masked.tiff'
# Constants representing the setting keys for this plugin
class PluginSettings(object):
RNASCOPE_PIXELS_PER_VIRION = 'RNAScope.pixels_per_virion'
RNASCOPE_PIXEL_THRESHOLD = 'RNAScope.pixel_threshold'
RNASCOPE_ROUNDNESS_THRESHOLD = 'RNAScope.roundness_threshold'
RNASCOPE_SINGLE_VIRION_COLOR = 'RNAScope.single_virion.color'
RNASCOPE_PRODUCTIVE_INFECTION_COLOR = 'RNAScope.productive_infection.color'
RNASCOPE_AGGREGATE_VIRIONS_COLOR = 'RNAScope.aggregate_virions.color'
| label_directory = 'label'
image_directory = '.*wsi.*'
label_directories = ['label', 'relabel']
label_filename = 'label.tiff'
masked_image_filename = 'masked.tiff'
class Pluginsettings(object):
rnascope_pixels_per_virion = 'RNAScope.pixels_per_virion'
rnascope_pixel_threshold = 'RNAScope.pixel_threshold'
rnascope_roundness_threshold = 'RNAScope.roundness_threshold'
rnascope_single_virion_color = 'RNAScope.single_virion.color'
rnascope_productive_infection_color = 'RNAScope.productive_infection.color'
rnascope_aggregate_virions_color = 'RNAScope.aggregate_virions.color' |
def set_referenced_values(self,jc):
print('--tablename>',self.name,self.referencing_columns)
# if self.name == 'lic__products':
# tbl_idx= next((i for i, item in enumerate(jc.tables) if item.name == "prod__packs"), -1)
# print('-->',jc.tables[tbl_idx].current_row)
#print(self.name,self.referencing_columns)
pathids = self.gen_pathids_fullpath()
# print('????????')
# print(self.referencing_columns)
# update tab.current_row
rc_with_values = copy.deepcopy(self.referencing_columns)
# for dc in self.current_row:
# print(dc)
# quit()
for rc in rc_with_values:
for _datacell in self.current_row:
if rc["referenced_columnname"] == _datacell.column_name:
rc["referenced_value"] = _datacell.value
# prefix @ for the source of colmap
rc["referenced_columnname"] = '@' + _datacell.column_name
break
print("!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!")
print('rc_with_values:',rc_with_values)
# quit()
# example of content for rc_with_values:
# [{'referencing_tablename': 'Manufacturers', 'referenced_tablename': 'artg_entry', 'referenced_columnname': 'LicenceId', 'referenced_value': '92017'}
# ,{'referencing_tablename': 'Manufacturers', 'referenced_tablename': 'artg_entry', 'referenced_columnname': 'LicenceClass', 'referenced_value': 'CLAS1'}]
# distribute to any referencing tables:
for _rcv in rc_with_values:
tbl_idx= next((i for i, item in enumerate(jc.tables) if item.name == _rcv["referencing_tablename"]), -1)
for rowid in range(jc.tables[tbl_idx].last_ref_updates_rowid,len(jc.tables[tbl_idx].rows)):
#print('----counter--->',self.name,rowid,jc.tables[tbl_idx].last_ref_updates_rowid)
row = jc.tables[tbl_idx].rows[rowid]
#for rowid,row in jc.tables[tbl_idx].rows.items():
# print('row---->',rowid,row.print_kv())
# check if the row contains the same pathid
matches = 0
for p in pathids:
#print('--->p',p)
for k,v in p.items():
for dc in row.datarow:
# if this dc is a referenced table
if dc.data_source != dc.table_name:
# then match the data_source and value
# print(dc)
if k == dc.data_source and v == dc.value:
# # print('-->match',dc)
matches += 1
if matches == len(pathids):
#print('!!!! matched')
dc = Data_Cell(self.name,self.name,_rcv["referenced_columnname"],_rcv["referenced_value"])
row.datarow.append(dc)
self.counter += 1
if self.is_primary:
jc.tables[tbl_idx].last_ref_updates_rowid = rowid
# tag row that is already process, so the loop is shorter when it repeats
#update the current_row
cr_matches = 0
for p in pathids:
#print('--->p',p)
for k,v in p.items():
for dc in jc.tables[tbl_idx].current_row:
# if this dc is a referenced table
if dc.data_source != dc.table_name:
if k == dc.data_source and v == dc.value:
# then match the data_source and value
#print('------match-----',dc)
cr_matches += 1
if cr_matches == len(pathids):
dc = Data_Cell(self.name,self.name,_rcv["referenced_columnname"],_rcv["referenced_value"])
jc.tables[tbl_idx].current_row.append(dc)
self.counter += 1
def gen_pathids(self):
#example of datapath_list ['Results', 0, 'Manufacturers', 1, 'Address', 'AddressLine1']
#example of base_path ['Results', '#', 'Manufacturers', '#']
#example of return [{Result=0},{Manufacturers=1}]
pathids = []
for i,p in enumerate(self.base_path_list):
if p != "#":
_pdict = {p:self.current_datapath[i+1]}
pathids.append(_pdict)
return pathids
# pathids = []
# base_path_length = int(len(self.base_path_list)/2)
# for i in range (base_path_length):
# print(i)
# print(pathids)
# quit()
# return pathids
def set_intertables_column_copies(self):
for tab in self.tables:
if len(tab.columns_tocopy) > 0:
#print(tab.name,tab.columns_tocopy)
for ctc in tab.columns_tocopy:
_rel_dict = {}
_rel_dict["referencing_tablename"] = tab.name
_rel_dict["referenced_tablename"] = ctc["tablename"]
_rel_dict["referenced_columnname"] = ctc["columnname"]
self.intertables_column_copies.append(_rel_dict)
def allocate_referencing_columns(self):
for tab in self.tables:
_referencing_columns = []
for ic in self.intertables_column_copies:
if tab.name == ic["referenced_tablename"]:
tab.referencing_columns.append(ic)
def allocate_referencing_tables(self):
# use the list in referencing tables and populate`
# the tables
for tab in self.tables:
_referencing_tables = []
for rc in tab.referencing_columns:
#print(' rc:',rc)
_referencing_tables.append(rc["referencing_tablename"])
if len(_referencing_tables) > 0:
_referencing_tables_unique = set(_referencing_tables)
for _rt in _referencing_tables_unique:
tab.referencing_tables.append(_rt)
# for tab in jc.tables:
# if len(tab.columns_tocopy) > 0:
# #for coltc in jt.tables[1].columns_tocopy:
# for coltc in tab.columns_tocopy:
# #print(tab.name,'columns tocopy',coltc)
# #loop through target and source table and do the matching
# tbl_idx_s= next((i for i, item in enumerate(jc.tables) if item.name == coltc["tablename"]), -1)
# # print(tbl_idx_s)
# # quit()
# jc.tables[tbl_idx_s].last_ref_updates_rowid = 0
# ########## target table ##########
# #for idx_t, row_t in jt.tables[1].rows.items():
# for idx_t, row_t in tab.rows.items():
# #print(' prod',idx,row.print_kv())
# ########## source table ##########
# # for idx_s, row_s in jt.tables[tbl_idx_s].rows.items():
# for idx_s in range(jc.tables[tbl_idx_s].last_ref_updates_rowid,len(jc.tables[tbl_idx_s].rows)):
# # match the target and the source based upon provided keys
# row_s = jc.tables[tbl_idx_s].rows[idx_s]
# matches = 0
# for k in coltc["keys"]:
# # print('key ',k)
# if row_t.get_value(k) == row_s.get_value(k):
# matches += 1
# # print('! matching...')
# if matches == len(coltc["keys"]):
# # this is a match! so make a copy
# # print('!!!! a match')
# colname_toadd = '@' + coltc["columnname"] #prefix with @ to differentiate with jsonpath
# dc = jsontabs.Data_Cell(jt.tables[tbl_idx_s].name,tab.name,colname_toadd,row_s.get_value(coltc["columnname"]))
# row_t.add_dc(dc)
#
# #flag last row
# jc.tables[tbl_idx_s].last_ref_updates_rowid = idx_s
| def set_referenced_values(self, jc):
print('--tablename>', self.name, self.referencing_columns)
pathids = self.gen_pathids_fullpath()
rc_with_values = copy.deepcopy(self.referencing_columns)
for rc in rc_with_values:
for _datacell in self.current_row:
if rc['referenced_columnname'] == _datacell.column_name:
rc['referenced_value'] = _datacell.value
rc['referenced_columnname'] = '@' + _datacell.column_name
break
print('!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!')
print('rc_with_values:', rc_with_values)
for _rcv in rc_with_values:
tbl_idx = next((i for (i, item) in enumerate(jc.tables) if item.name == _rcv['referencing_tablename']), -1)
for rowid in range(jc.tables[tbl_idx].last_ref_updates_rowid, len(jc.tables[tbl_idx].rows)):
row = jc.tables[tbl_idx].rows[rowid]
matches = 0
for p in pathids:
for (k, v) in p.items():
for dc in row.datarow:
if dc.data_source != dc.table_name:
if k == dc.data_source and v == dc.value:
matches += 1
if matches == len(pathids):
dc = data__cell(self.name, self.name, _rcv['referenced_columnname'], _rcv['referenced_value'])
row.datarow.append(dc)
self.counter += 1
if self.is_primary:
jc.tables[tbl_idx].last_ref_updates_rowid = rowid
cr_matches = 0
for p in pathids:
for (k, v) in p.items():
for dc in jc.tables[tbl_idx].current_row:
if dc.data_source != dc.table_name:
if k == dc.data_source and v == dc.value:
cr_matches += 1
if cr_matches == len(pathids):
dc = data__cell(self.name, self.name, _rcv['referenced_columnname'], _rcv['referenced_value'])
jc.tables[tbl_idx].current_row.append(dc)
self.counter += 1
def gen_pathids(self):
pathids = []
for (i, p) in enumerate(self.base_path_list):
if p != '#':
_pdict = {p: self.current_datapath[i + 1]}
pathids.append(_pdict)
return pathids
def set_intertables_column_copies(self):
for tab in self.tables:
if len(tab.columns_tocopy) > 0:
for ctc in tab.columns_tocopy:
_rel_dict = {}
_rel_dict['referencing_tablename'] = tab.name
_rel_dict['referenced_tablename'] = ctc['tablename']
_rel_dict['referenced_columnname'] = ctc['columnname']
self.intertables_column_copies.append(_rel_dict)
def allocate_referencing_columns(self):
for tab in self.tables:
_referencing_columns = []
for ic in self.intertables_column_copies:
if tab.name == ic['referenced_tablename']:
tab.referencing_columns.append(ic)
def allocate_referencing_tables(self):
for tab in self.tables:
_referencing_tables = []
for rc in tab.referencing_columns:
_referencing_tables.append(rc['referencing_tablename'])
if len(_referencing_tables) > 0:
_referencing_tables_unique = set(_referencing_tables)
for _rt in _referencing_tables_unique:
tab.referencing_tables.append(_rt) |
#!/usr/bin/env python
u"""
TRIAL.py
Written Chia-Chun Liang (11/2021)
"""
| u"""
TRIAL.py
Written Chia-Chun Liang (11/2021)
""" |
# --
# Copyright (c) 2008-2021 Net-ng.
# All rights reserved.
#
# This software is licensed under the BSD License, as described in
# the file LICENSE.txt, which you should have received as part of
# this distribution.
# --
"""Variables with a functional interface:
- ``v()`` -- return the value of ``v``
- ``v(x)`` -- set the value of ``v`` to ``x``
For example:
``v = v + 1`` becomes ``v(v()+1)``
Handy into the lambda expressions
"""
_marker = object()
class Var(object):
"""Functional variables
"""
def __init__(self, v=None):
"""Initialisation
In:
- ``v`` -- initial value
"""
self.input = v
def get(self):
"""Return the value
Return:
- the value
"""
return self.input
def set(self, v):
"""Set the value
Return:
- the value
"""
self.input = v
def __call__(self, v=_marker):
"""Return or set the value
In:
- ``v`` -- if given, ``v`` becomes the new value
Return:
- the variable value
"""
if id(v) != id(_marker):
self.set(v)
return self.get()
def render(self, renderer):
"""When directly put into a XML tree, render its value
In:
- ``renderer`` -- the current renderer
Return:
- the variable value
"""
return self.get()
def __bool__(self):
return bool(self.input)
__nonzero__ = __bool__
def __str__(self):
return str(self.get())
def __unicode__(self):
return str(self.get())
| """Variables with a functional interface:
- ``v()`` -- return the value of ``v``
- ``v(x)`` -- set the value of ``v`` to ``x``
For example:
``v = v + 1`` becomes ``v(v()+1)``
Handy into the lambda expressions
"""
_marker = object()
class Var(object):
"""Functional variables
"""
def __init__(self, v=None):
"""Initialisation
In:
- ``v`` -- initial value
"""
self.input = v
def get(self):
"""Return the value
Return:
- the value
"""
return self.input
def set(self, v):
"""Set the value
Return:
- the value
"""
self.input = v
def __call__(self, v=_marker):
"""Return or set the value
In:
- ``v`` -- if given, ``v`` becomes the new value
Return:
- the variable value
"""
if id(v) != id(_marker):
self.set(v)
return self.get()
def render(self, renderer):
"""When directly put into a XML tree, render its value
In:
- ``renderer`` -- the current renderer
Return:
- the variable value
"""
return self.get()
def __bool__(self):
return bool(self.input)
__nonzero__ = __bool__
def __str__(self):
return str(self.get())
def __unicode__(self):
return str(self.get()) |
"""
.. module:: experiment.__init__
:synopsis: This package is intended to contain everything that has to do
with the experimental results.
"""
| """
.. module:: experiment.__init__
:synopsis: This package is intended to contain everything that has to do
with the experimental results.
""" |
# AUTOGENERATED BY NBDEV! DO NOT EDIT!
__all__ = ["index", "modules", "custom_doc_links", "git_url"]
index = {"say_hello": "00_hello.ipynb"}
modules = ["hello.py"]
doc_url = "https://seanczak.github.io/torch_series_blog/"
git_url = "https://github.com/seanczak/torch_series_blog/tree/master/"
def custom_doc_links(name): return None
| __all__ = ['index', 'modules', 'custom_doc_links', 'git_url']
index = {'say_hello': '00_hello.ipynb'}
modules = ['hello.py']
doc_url = 'https://seanczak.github.io/torch_series_blog/'
git_url = 'https://github.com/seanczak/torch_series_blog/tree/master/'
def custom_doc_links(name):
return None |
buf = """const LOGIN_PACKET = 0x8f;
const PLAY_STATUS_PACKET = 0x90;
const DISCONNECT_PACKET = 0x91;
const BATCH_PACKET = 0x92;
const TEXT_PACKET = 0x93;
const SET_TIME_PACKET = 0x94;
const START_GAME_PACKET = 0x95;
const ADD_PLAYER_PACKET = 0x96;
const REMOVE_PLAYER_PACKET = 0x97;
const ADD_ENTITY_PACKET = 0x98;
const REMOVE_ENTITY_PACKET = 0x99;
const ADD_ITEM_ENTITY_PACKET = 0x9a;
const TAKE_ITEM_ENTITY_PACKET = 0x9b;
const MOVE_ENTITY_PACKET = 0x9c;
const MOVE_PLAYER_PACKET = 0x9d;
const REMOVE_BLOCK_PACKET = 0x9e;
const UPDATE_BLOCK_PACKET = 0x9f;
const ADD_PAINTING_PACKET = 0xa0;
const EXPLODE_PACKET = 0xa1;
const LEVEL_EVENT_PACKET = 0xa2;
const TILE_EVENT_PACKET = 0xa3;
const ENTITY_EVENT_PACKET = 0xa4;
const MOB_EFFECT_PACKET = 0xa5;
const UPDATE_ATTRIBUTES_PACKET = 0xa6;
const MOB_EQUIPMENT_PACKET = 0xa7;
const MOB_ARMOR_EQUIPMENT_PACKET = 0xa8;
const INTERACT_PACKET = 0xa9;
const USE_ITEM_PACKET = 0xaa;
const PLAYER_ACTION_PACKET = 0xab;
const HURT_ARMOR_PACKET = 0xac;
const SET_ENTITY_DATA_PACKET = 0xad;
const SET_ENTITY_MOTION_PACKET = 0xae;
const SET_ENTITY_LINK_PACKET = 0xaf;
const SET_HEALTH_PACKET = 0xb0;
const SET_SPAWN_POSITION_PACKET = 0xb1;
const ANIMATE_PACKET = 0xb2;
const RESPAWN_PACKET = 0xb3;
const DROP_ITEM_PACKET = 0xb4;
const CONTAINER_OPEN_PACKET = 0xb5;
const CONTAINER_CLOSE_PACKET = 0xb6;
const CONTAINER_SET_SLOT_PACKET = 0xb7;
const CONTAINER_SET_DATA_PACKET = 0xb8;
const CONTAINER_SET_CONTENT_PACKET = 0xb9;
const CRAFTING_DATA_PACKET = 0xba;
const CRAFTING_EVENT_PACKET = 0xbb;
const ADVENTURE_SETTINGS_PACKET = 0xbc;
const TILE_ENTITY_DATA_PACKET = 0xbd;
//const PLAYER_INPUT_PACKET = 0xbe;
const FULL_CHUNK_DATA_PACKET = 0xbf;
const SET_DIFFICULTY_PACKET = 0xc0;
//const CHANGE_DIMENSION_PACKET = 0xc1;
//const SET_PLAYER_GAMETYPE_PACKET = 0xc2;
const PLAYER_LIST_PACKET = 0xc3;
//const TELEMETRY_EVENT_PACKET = 0xc4;"""
fbuf = """package mcpe
import "bytes"
//%s is a packet implements <TODO>
type %s struct {
*bytes.Buffer
fields map[string]interface{}
}
//Encode encodes the packet
func (pk %s) Encode() error {
return nil
}
//Decode decodes the packet
func (pk %s) Decode() error {
return nil
}
//GetField returns specified field
func (pk %s) GetField(string) interface{} {
return nil
}
//SetField sets specified field
func (pk %s) SetField(string) interface{} {
return nil
}
"""
print("const (")
ss = ""
for line in buf.split("\n"):
line = line.replace("const ", "").replace(" ", "")
line = line.replace("//", "").replace(";", "")
offset = line.find(" = ")
const = ''.join(s[0] + s[1:].lower() for s in line[:offset].split("_"))
line = const + "Head" + line[offset:]
print(" //%sHead is a header constant for %s\n "%(const, const) + line)
with open(const[:len(const) - 6].lower() + ".go", "w") as f:
f.write(fbuf % (const, const, const, const, const, const))
ss += " registerPacket(%sHead, *new(%s))\n" % (const, const)
print(")")
print(" ------------ ")
print(ss)
| buf = 'const LOGIN_PACKET = 0x8f;\n const PLAY_STATUS_PACKET = 0x90;\n const DISCONNECT_PACKET = 0x91;\n const BATCH_PACKET = 0x92;\n const TEXT_PACKET = 0x93;\n const SET_TIME_PACKET = 0x94;\n const START_GAME_PACKET = 0x95;\n const ADD_PLAYER_PACKET = 0x96;\n const REMOVE_PLAYER_PACKET = 0x97;\n const ADD_ENTITY_PACKET = 0x98;\n const REMOVE_ENTITY_PACKET = 0x99;\n const ADD_ITEM_ENTITY_PACKET = 0x9a;\n const TAKE_ITEM_ENTITY_PACKET = 0x9b;\n const MOVE_ENTITY_PACKET = 0x9c;\n const MOVE_PLAYER_PACKET = 0x9d;\n const REMOVE_BLOCK_PACKET = 0x9e;\n const UPDATE_BLOCK_PACKET = 0x9f;\n const ADD_PAINTING_PACKET = 0xa0;\n const EXPLODE_PACKET = 0xa1;\n const LEVEL_EVENT_PACKET = 0xa2;\n const TILE_EVENT_PACKET = 0xa3;\n const ENTITY_EVENT_PACKET = 0xa4;\n const MOB_EFFECT_PACKET = 0xa5;\n const UPDATE_ATTRIBUTES_PACKET = 0xa6;\n const MOB_EQUIPMENT_PACKET = 0xa7;\n const MOB_ARMOR_EQUIPMENT_PACKET = 0xa8;\n const INTERACT_PACKET = 0xa9;\n const USE_ITEM_PACKET = 0xaa;\n const PLAYER_ACTION_PACKET = 0xab;\n const HURT_ARMOR_PACKET = 0xac;\n const SET_ENTITY_DATA_PACKET = 0xad;\n const SET_ENTITY_MOTION_PACKET = 0xae;\n const SET_ENTITY_LINK_PACKET = 0xaf;\n const SET_HEALTH_PACKET = 0xb0;\n const SET_SPAWN_POSITION_PACKET = 0xb1;\n const ANIMATE_PACKET = 0xb2;\n const RESPAWN_PACKET = 0xb3;\n const DROP_ITEM_PACKET = 0xb4;\n const CONTAINER_OPEN_PACKET = 0xb5;\n const CONTAINER_CLOSE_PACKET = 0xb6;\n const CONTAINER_SET_SLOT_PACKET = 0xb7;\n const CONTAINER_SET_DATA_PACKET = 0xb8;\n const CONTAINER_SET_CONTENT_PACKET = 0xb9;\n const CRAFTING_DATA_PACKET = 0xba;\n const CRAFTING_EVENT_PACKET = 0xbb;\n const ADVENTURE_SETTINGS_PACKET = 0xbc;\n const TILE_ENTITY_DATA_PACKET = 0xbd;\n //const PLAYER_INPUT_PACKET = 0xbe;\n const FULL_CHUNK_DATA_PACKET = 0xbf;\n const SET_DIFFICULTY_PACKET = 0xc0;\n //const CHANGE_DIMENSION_PACKET = 0xc1;\n //const SET_PLAYER_GAMETYPE_PACKET = 0xc2;\n const PLAYER_LIST_PACKET = 0xc3;\n //const TELEMETRY_EVENT_PACKET = 0xc4;'
fbuf = 'package mcpe\n\nimport "bytes"\n\n//%s is a packet implements <TODO>\ntype %s struct {\n *bytes.Buffer\n fields map[string]interface{}\n}\n\n//Encode encodes the packet\nfunc (pk %s) Encode() error {\n return nil\n}\n\n//Decode decodes the packet\nfunc (pk %s) Decode() error {\n return nil\n}\n\n//GetField returns specified field\nfunc (pk %s) GetField(string) interface{} {\n return nil\n}\n\n//SetField sets specified field\nfunc (pk %s) SetField(string) interface{} {\n return nil\n}\n'
print('const (')
ss = ''
for line in buf.split('\n'):
line = line.replace('const ', '').replace(' ', '')
line = line.replace('//', '').replace(';', '')
offset = line.find(' = ')
const = ''.join((s[0] + s[1:].lower() for s in line[:offset].split('_')))
line = const + 'Head' + line[offset:]
print(' //%sHead is a header constant for %s\n ' % (const, const) + line)
with open(const[:len(const) - 6].lower() + '.go', 'w') as f:
f.write(fbuf % (const, const, const, const, const, const))
ss += ' registerPacket(%sHead, *new(%s))\n' % (const, const)
print(')')
print(' ------------ ')
print(ss) |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
class SplitSynonymClass():
"""Split Synonym class.
This class is split synonym
"""
def __init__(self, data):
"""
Args:
data (list): input the word net data.
"""
self.__data = data
self.__all_dict = {}
self.__split_dict = {}
def make_dict(self):
"""
split class
"""
data_class = ""
for each_data in self.__data:
data_class = each_data[0]
word = each_data[1]
self.__make_all_split_dict(data_class, word)
def __make_all_split_dict(self, data_class, word):
"""
split class
Args:
word(str): word net word()
data_class(str): word net class
"""
word_list = []
# regist all dict
if word not in self.__all_dict:
self.__all_dict.update({word: data_class})
if data_class not in self.__split_dict:
word_list.append(word)
self.__split_dict.update({data_class: word_list})
else:
word_list = self.__split_dict[data_class]
word_list.append(word)
self.__split_dict.update({data_class: word_list})
def get_all_dict(self):
"""get the all dict"""
return self.__all_dict
def get_split_dict(self):
"""get the split dict"""
return self.__split_dict
| class Splitsynonymclass:
"""Split Synonym class.
This class is split synonym
"""
def __init__(self, data):
"""
Args:
data (list): input the word net data.
"""
self.__data = data
self.__all_dict = {}
self.__split_dict = {}
def make_dict(self):
"""
split class
"""
data_class = ''
for each_data in self.__data:
data_class = each_data[0]
word = each_data[1]
self.__make_all_split_dict(data_class, word)
def __make_all_split_dict(self, data_class, word):
"""
split class
Args:
word(str): word net word()
data_class(str): word net class
"""
word_list = []
if word not in self.__all_dict:
self.__all_dict.update({word: data_class})
if data_class not in self.__split_dict:
word_list.append(word)
self.__split_dict.update({data_class: word_list})
else:
word_list = self.__split_dict[data_class]
word_list.append(word)
self.__split_dict.update({data_class: word_list})
def get_all_dict(self):
"""get the all dict"""
return self.__all_dict
def get_split_dict(self):
"""get the split dict"""
return self.__split_dict |
class Solution:
def findDuplicate(self, nums: List[int]) -> int:
for i in range(0,len(nums)):
if(nums[abs(nums[i])]<0):
return abs(nums[i])
else:
nums[abs(nums[i])] = -nums[abs(nums[i])]
| class Solution:
def find_duplicate(self, nums: List[int]) -> int:
for i in range(0, len(nums)):
if nums[abs(nums[i])] < 0:
return abs(nums[i])
else:
nums[abs(nums[i])] = -nums[abs(nums[i])] |
"""
Protocol-related functions go here
"""
def generate_post_material(
openbp_version,
post_key,
hyperlinks,
hyperlinks_content_size,
hyperlinks_content_type,
hyperlink_content_checksum,
other_post_key,
other_checksum,
**kwargs):
# There are two optional fields, rel and other
post_material = {
'openbp': openbp_version,
'pk': post_key,
'docs': hyperlinks,
'size': hyperlinks_content_size,
'type': hyperlinks_content_type,
'chk': hyperlink_content_checksum,
'other.pk': other_post_key,
'other.chk': other_checksum
}
post_material.update(kwargs)
return post_material
| """
Protocol-related functions go here
"""
def generate_post_material(openbp_version, post_key, hyperlinks, hyperlinks_content_size, hyperlinks_content_type, hyperlink_content_checksum, other_post_key, other_checksum, **kwargs):
post_material = {'openbp': openbp_version, 'pk': post_key, 'docs': hyperlinks, 'size': hyperlinks_content_size, 'type': hyperlinks_content_type, 'chk': hyperlink_content_checksum, 'other.pk': other_post_key, 'other.chk': other_checksum}
post_material.update(kwargs)
return post_material |
'''
XlPy/matched/Proteome_Discoverer
________________________________
Utilities to parse Proteome Discoverer file formats and export formats.
Proteome Discoverer is a trademark of Thermo Scientific and
is not affiliated with nor endorse XL Discoverer.
Their website can be found here:
https://www.thermoscientific.com/en/product/proteome-
discoverer-software.html
:copyright: (c) 2015 The Regents of the University of California.
:license: GNU GPL, see licenses/GNU GPLv3.txt for more details.
'''
__all__ = [
'base', 'core', 'mods', 'pepxml', 'sqlite'
]
| """
XlPy/matched/Proteome_Discoverer
________________________________
Utilities to parse Proteome Discoverer file formats and export formats.
Proteome Discoverer is a trademark of Thermo Scientific and
is not affiliated with nor endorse XL Discoverer.
Their website can be found here:
https://www.thermoscientific.com/en/product/proteome-
discoverer-software.html
:copyright: (c) 2015 The Regents of the University of California.
:license: GNU GPL, see licenses/GNU GPLv3.txt for more details.
"""
__all__ = ['base', 'core', 'mods', 'pepxml', 'sqlite'] |
# --------------------------------------------------------------------------------------------------
# jinja2-live: thin custom filters
#
# To create new custom filters:
# just add the function code and docstring in this file
# parser.py will import this file and add the function names and explanation into the HTML output
# --------------------------------------------------------------------------------------------------
# functions provided :
# - combine: a poor man ansible combine filter replacement
# - flatten: a poor man ansible faltten filter replacement
# - get_keys: filter to get the keys from a dictionary
# - get_values: filter to get the values from a dictionary
# - get_items: filter to get the key/value pairs from a dictionary
def flatten(value):
""" flatten a list """
return [item for sublist in value for item in sublist]
def combine(value, dict):
""" merge two dictionaries """
result = {}
result.update (value)
result.update (dict)
return result
def get_keys(dict):
""" extract the keys from a dictionary """
return dict.keys()
def get_values(dict):
""" extract the values from a dictionary """
return dict.values()
def get_items(dict):
""" extract the key/value pairs from a dictionary """
return zip (dict.keys(), dict.values())
| def flatten(value):
""" flatten a list """
return [item for sublist in value for item in sublist]
def combine(value, dict):
""" merge two dictionaries """
result = {}
result.update(value)
result.update(dict)
return result
def get_keys(dict):
""" extract the keys from a dictionary """
return dict.keys()
def get_values(dict):
""" extract the values from a dictionary """
return dict.values()
def get_items(dict):
""" extract the key/value pairs from a dictionary """
return zip(dict.keys(), dict.values()) |
# Python - 3.6.0
test.assert_equals(len(websites), 1000)
test.assert_equals(type(websites), list)
test.assert_equals(list(set(websites)), ['codewars'])
| test.assert_equals(len(websites), 1000)
test.assert_equals(type(websites), list)
test.assert_equals(list(set(websites)), ['codewars']) |
notes=[0]*10
while True:
command=input()
if command!="End":
tokens=command.split("-")
priority=int(tokens[0])-1
note=tokens[1]
notes.pop(priority)
notes.insert(priority, note)
else:
break
res=[element for element in notes if element != 0]
print(res)
| notes = [0] * 10
while True:
command = input()
if command != 'End':
tokens = command.split('-')
priority = int(tokens[0]) - 1
note = tokens[1]
notes.pop(priority)
notes.insert(priority, note)
else:
break
res = [element for element in notes if element != 0]
print(res) |
class F:
def f(x):
x: int = 42
# EXPECTED:
[
~SETUP_ANNOTATIONS(0),
]
| class F:
def f(x):
x: int = 42
[~setup_annotations(0)] |
class CONST():
Ok = 0
UnKnown = 1000
TimeOutError = 1001
NoUser = 2000
UserRepeat = 2001
AuthenticationField = 2002
UpdateField = 2003
LogField = 2004
NoMore = 2005
FileInvalid = 3000
DeviceError = 4000
def __setattr__(self,*_):
pass
| class Const:
ok = 0
un_known = 1000
time_out_error = 1001
no_user = 2000
user_repeat = 2001
authentication_field = 2002
update_field = 2003
log_field = 2004
no_more = 2005
file_invalid = 3000
device_error = 4000
def __setattr__(self, *_):
pass |
n = int(input())
i = s = 1
while s < n:
s += 6 * i
i += 1
print(i)
| n = int(input())
i = s = 1
while s < n:
s += 6 * i
i += 1
print(i) |
# A program to increment a string by 1
data = "1foobar001"
def increment_string(strng):
strngSplit = list(strng)
for i in range(len(strng)):
if not str.isdigit(strngSplit[i]):
strngSplit.append("1")
return strngSplit
print(increment_string(data))
| data = '1foobar001'
def increment_string(strng):
strng_split = list(strng)
for i in range(len(strng)):
if not str.isdigit(strngSplit[i]):
strngSplit.append('1')
return strngSplit
print(increment_string(data)) |
class TreeNode:
def __init__(self, val=0, left=None, right=None):
self.val = val
self.left = left
self.right = right
class Solution:
def bstToGst(self, root: TreeNode) -> TreeNode:
s = 0
def traverse(node):
nonlocal s
if not node:
return
traverse(node.right)
node.val += s
s = node.val
traverse(node.right)
traverse(root)
return root
| class Treenode:
def __init__(self, val=0, left=None, right=None):
self.val = val
self.left = left
self.right = right
class Solution:
def bst_to_gst(self, root: TreeNode) -> TreeNode:
s = 0
def traverse(node):
nonlocal s
if not node:
return
traverse(node.right)
node.val += s
s = node.val
traverse(node.right)
traverse(root)
return root |
data = (
'Yun ', # 0x00
'Bei ', # 0x01
'Ang ', # 0x02
'Ze ', # 0x03
'Ban ', # 0x04
'Jie ', # 0x05
'Kun ', # 0x06
'Sheng ', # 0x07
'Hu ', # 0x08
'Fang ', # 0x09
'Hao ', # 0x0a
'Gui ', # 0x0b
'Chang ', # 0x0c
'Xuan ', # 0x0d
'Ming ', # 0x0e
'Hun ', # 0x0f
'Fen ', # 0x10
'Qin ', # 0x11
'Hu ', # 0x12
'Yi ', # 0x13
'Xi ', # 0x14
'Xin ', # 0x15
'Yan ', # 0x16
'Ze ', # 0x17
'Fang ', # 0x18
'Tan ', # 0x19
'Shen ', # 0x1a
'Ju ', # 0x1b
'Yang ', # 0x1c
'Zan ', # 0x1d
'Bing ', # 0x1e
'Xing ', # 0x1f
'Ying ', # 0x20
'Xuan ', # 0x21
'Pei ', # 0x22
'Zhen ', # 0x23
'Ling ', # 0x24
'Chun ', # 0x25
'Hao ', # 0x26
'Mei ', # 0x27
'Zuo ', # 0x28
'Mo ', # 0x29
'Bian ', # 0x2a
'Xu ', # 0x2b
'Hun ', # 0x2c
'Zhao ', # 0x2d
'Zong ', # 0x2e
'Shi ', # 0x2f
'Shi ', # 0x30
'Yu ', # 0x31
'Fei ', # 0x32
'Die ', # 0x33
'Mao ', # 0x34
'Ni ', # 0x35
'Chang ', # 0x36
'Wen ', # 0x37
'Dong ', # 0x38
'Ai ', # 0x39
'Bing ', # 0x3a
'Ang ', # 0x3b
'Zhou ', # 0x3c
'Long ', # 0x3d
'Xian ', # 0x3e
'Kuang ', # 0x3f
'Tiao ', # 0x40
'Chao ', # 0x41
'Shi ', # 0x42
'Huang ', # 0x43
'Huang ', # 0x44
'Xuan ', # 0x45
'Kui ', # 0x46
'Xu ', # 0x47
'Jiao ', # 0x48
'Jin ', # 0x49
'Zhi ', # 0x4a
'Jin ', # 0x4b
'Shang ', # 0x4c
'Tong ', # 0x4d
'Hong ', # 0x4e
'Yan ', # 0x4f
'Gai ', # 0x50
'Xiang ', # 0x51
'Shai ', # 0x52
'Xiao ', # 0x53
'Ye ', # 0x54
'Yun ', # 0x55
'Hui ', # 0x56
'Han ', # 0x57
'Han ', # 0x58
'Jun ', # 0x59
'Wan ', # 0x5a
'Xian ', # 0x5b
'Kun ', # 0x5c
'Zhou ', # 0x5d
'Xi ', # 0x5e
'Cheng ', # 0x5f
'Sheng ', # 0x60
'Bu ', # 0x61
'Zhe ', # 0x62
'Zhe ', # 0x63
'Wu ', # 0x64
'Han ', # 0x65
'Hui ', # 0x66
'Hao ', # 0x67
'Chen ', # 0x68
'Wan ', # 0x69
'Tian ', # 0x6a
'Zhuo ', # 0x6b
'Zui ', # 0x6c
'Zhou ', # 0x6d
'Pu ', # 0x6e
'Jing ', # 0x6f
'Xi ', # 0x70
'Shan ', # 0x71
'Yi ', # 0x72
'Xi ', # 0x73
'Qing ', # 0x74
'Qi ', # 0x75
'Jing ', # 0x76
'Gui ', # 0x77
'Zhen ', # 0x78
'Yi ', # 0x79
'Zhi ', # 0x7a
'An ', # 0x7b
'Wan ', # 0x7c
'Lin ', # 0x7d
'Liang ', # 0x7e
'Chang ', # 0x7f
'Wang ', # 0x80
'Xiao ', # 0x81
'Zan ', # 0x82
'Hi ', # 0x83
'Xuan ', # 0x84
'Xuan ', # 0x85
'Yi ', # 0x86
'Xia ', # 0x87
'Yun ', # 0x88
'Hui ', # 0x89
'Fu ', # 0x8a
'Min ', # 0x8b
'Kui ', # 0x8c
'He ', # 0x8d
'Ying ', # 0x8e
'Du ', # 0x8f
'Wei ', # 0x90
'Shu ', # 0x91
'Qing ', # 0x92
'Mao ', # 0x93
'Nan ', # 0x94
'Jian ', # 0x95
'Nuan ', # 0x96
'An ', # 0x97
'Yang ', # 0x98
'Chun ', # 0x99
'Yao ', # 0x9a
'Suo ', # 0x9b
'Jin ', # 0x9c
'Ming ', # 0x9d
'Jiao ', # 0x9e
'Kai ', # 0x9f
'Gao ', # 0xa0
'Weng ', # 0xa1
'Chang ', # 0xa2
'Qi ', # 0xa3
'Hao ', # 0xa4
'Yan ', # 0xa5
'Li ', # 0xa6
'Ai ', # 0xa7
'Ji ', # 0xa8
'Gui ', # 0xa9
'Men ', # 0xaa
'Zan ', # 0xab
'Xie ', # 0xac
'Hao ', # 0xad
'Mu ', # 0xae
'Mo ', # 0xaf
'Cong ', # 0xb0
'Ni ', # 0xb1
'Zhang ', # 0xb2
'Hui ', # 0xb3
'Bao ', # 0xb4
'Han ', # 0xb5
'Xuan ', # 0xb6
'Chuan ', # 0xb7
'Liao ', # 0xb8
'Xian ', # 0xb9
'Dan ', # 0xba
'Jing ', # 0xbb
'Pie ', # 0xbc
'Lin ', # 0xbd
'Tun ', # 0xbe
'Xi ', # 0xbf
'Yi ', # 0xc0
'Ji ', # 0xc1
'Huang ', # 0xc2
'Tai ', # 0xc3
'Ye ', # 0xc4
'Ye ', # 0xc5
'Li ', # 0xc6
'Tan ', # 0xc7
'Tong ', # 0xc8
'Xiao ', # 0xc9
'Fei ', # 0xca
'Qin ', # 0xcb
'Zhao ', # 0xcc
'Hao ', # 0xcd
'Yi ', # 0xce
'Xiang ', # 0xcf
'Xing ', # 0xd0
'Sen ', # 0xd1
'Jiao ', # 0xd2
'Bao ', # 0xd3
'Jing ', # 0xd4
'Yian ', # 0xd5
'Ai ', # 0xd6
'Ye ', # 0xd7
'Ru ', # 0xd8
'Shu ', # 0xd9
'Meng ', # 0xda
'Xun ', # 0xdb
'Yao ', # 0xdc
'Pu ', # 0xdd
'Li ', # 0xde
'Chen ', # 0xdf
'Kuang ', # 0xe0
'Die ', # 0xe1
'[?] ', # 0xe2
'Yan ', # 0xe3
'Huo ', # 0xe4
'Lu ', # 0xe5
'Xi ', # 0xe6
'Rong ', # 0xe7
'Long ', # 0xe8
'Nang ', # 0xe9
'Luo ', # 0xea
'Luan ', # 0xeb
'Shai ', # 0xec
'Tang ', # 0xed
'Yan ', # 0xee
'Chu ', # 0xef
'Yue ', # 0xf0
'Yue ', # 0xf1
'Qu ', # 0xf2
'Yi ', # 0xf3
'Geng ', # 0xf4
'Ye ', # 0xf5
'Hu ', # 0xf6
'He ', # 0xf7
'Shu ', # 0xf8
'Cao ', # 0xf9
'Cao ', # 0xfa
'Noboru ', # 0xfb
'Man ', # 0xfc
'Ceng ', # 0xfd
'Ceng ', # 0xfe
'Ti ', # 0xff
)
| data = ('Yun ', 'Bei ', 'Ang ', 'Ze ', 'Ban ', 'Jie ', 'Kun ', 'Sheng ', 'Hu ', 'Fang ', 'Hao ', 'Gui ', 'Chang ', 'Xuan ', 'Ming ', 'Hun ', 'Fen ', 'Qin ', 'Hu ', 'Yi ', 'Xi ', 'Xin ', 'Yan ', 'Ze ', 'Fang ', 'Tan ', 'Shen ', 'Ju ', 'Yang ', 'Zan ', 'Bing ', 'Xing ', 'Ying ', 'Xuan ', 'Pei ', 'Zhen ', 'Ling ', 'Chun ', 'Hao ', 'Mei ', 'Zuo ', 'Mo ', 'Bian ', 'Xu ', 'Hun ', 'Zhao ', 'Zong ', 'Shi ', 'Shi ', 'Yu ', 'Fei ', 'Die ', 'Mao ', 'Ni ', 'Chang ', 'Wen ', 'Dong ', 'Ai ', 'Bing ', 'Ang ', 'Zhou ', 'Long ', 'Xian ', 'Kuang ', 'Tiao ', 'Chao ', 'Shi ', 'Huang ', 'Huang ', 'Xuan ', 'Kui ', 'Xu ', 'Jiao ', 'Jin ', 'Zhi ', 'Jin ', 'Shang ', 'Tong ', 'Hong ', 'Yan ', 'Gai ', 'Xiang ', 'Shai ', 'Xiao ', 'Ye ', 'Yun ', 'Hui ', 'Han ', 'Han ', 'Jun ', 'Wan ', 'Xian ', 'Kun ', 'Zhou ', 'Xi ', 'Cheng ', 'Sheng ', 'Bu ', 'Zhe ', 'Zhe ', 'Wu ', 'Han ', 'Hui ', 'Hao ', 'Chen ', 'Wan ', 'Tian ', 'Zhuo ', 'Zui ', 'Zhou ', 'Pu ', 'Jing ', 'Xi ', 'Shan ', 'Yi ', 'Xi ', 'Qing ', 'Qi ', 'Jing ', 'Gui ', 'Zhen ', 'Yi ', 'Zhi ', 'An ', 'Wan ', 'Lin ', 'Liang ', 'Chang ', 'Wang ', 'Xiao ', 'Zan ', 'Hi ', 'Xuan ', 'Xuan ', 'Yi ', 'Xia ', 'Yun ', 'Hui ', 'Fu ', 'Min ', 'Kui ', 'He ', 'Ying ', 'Du ', 'Wei ', 'Shu ', 'Qing ', 'Mao ', 'Nan ', 'Jian ', 'Nuan ', 'An ', 'Yang ', 'Chun ', 'Yao ', 'Suo ', 'Jin ', 'Ming ', 'Jiao ', 'Kai ', 'Gao ', 'Weng ', 'Chang ', 'Qi ', 'Hao ', 'Yan ', 'Li ', 'Ai ', 'Ji ', 'Gui ', 'Men ', 'Zan ', 'Xie ', 'Hao ', 'Mu ', 'Mo ', 'Cong ', 'Ni ', 'Zhang ', 'Hui ', 'Bao ', 'Han ', 'Xuan ', 'Chuan ', 'Liao ', 'Xian ', 'Dan ', 'Jing ', 'Pie ', 'Lin ', 'Tun ', 'Xi ', 'Yi ', 'Ji ', 'Huang ', 'Tai ', 'Ye ', 'Ye ', 'Li ', 'Tan ', 'Tong ', 'Xiao ', 'Fei ', 'Qin ', 'Zhao ', 'Hao ', 'Yi ', 'Xiang ', 'Xing ', 'Sen ', 'Jiao ', 'Bao ', 'Jing ', 'Yian ', 'Ai ', 'Ye ', 'Ru ', 'Shu ', 'Meng ', 'Xun ', 'Yao ', 'Pu ', 'Li ', 'Chen ', 'Kuang ', 'Die ', '[?] ', 'Yan ', 'Huo ', 'Lu ', 'Xi ', 'Rong ', 'Long ', 'Nang ', 'Luo ', 'Luan ', 'Shai ', 'Tang ', 'Yan ', 'Chu ', 'Yue ', 'Yue ', 'Qu ', 'Yi ', 'Geng ', 'Ye ', 'Hu ', 'He ', 'Shu ', 'Cao ', 'Cao ', 'Noboru ', 'Man ', 'Ceng ', 'Ceng ', 'Ti ') |
def bool_env(val):
"""Replaces string based environment values with Python booleans"""
return True if os.environ.get(val, False) == 'True' else False
DEBUG = bool_env('DEBUG')
TEMPLATE_DEBUG = DEBUG
| def bool_env(val):
"""Replaces string based environment values with Python booleans"""
return True if os.environ.get(val, False) == 'True' else False
debug = bool_env('DEBUG')
template_debug = DEBUG |
# {{ cookiecutter.project_slug }}/__init__.py
"""
{{ cookiecutter.project_short_description }}
"""
__version__ = "{{ cookiecutter.version }}"
__title__ = "{{ cookiecutter.project_name }}"
__description__ = "{{ cookiecutter.project_short_description }}"
__uri__ = "{{ cookiecutter.project_url }}"
__author__ = "{{ cookiecutter.full_name }}"
__email__ = "{{ cookiecutter.email }}"
__license__ = "MIT or Apache License, Version 2.0"
__copyright__ = "Copyright (c) 2021 {{ cookiecutter.full_name }}"
| """
{{ cookiecutter.project_short_description }}
"""
__version__ = '{{ cookiecutter.version }}'
__title__ = '{{ cookiecutter.project_name }}'
__description__ = '{{ cookiecutter.project_short_description }}'
__uri__ = '{{ cookiecutter.project_url }}'
__author__ = '{{ cookiecutter.full_name }}'
__email__ = '{{ cookiecutter.email }}'
__license__ = 'MIT or Apache License, Version 2.0'
__copyright__ = 'Copyright (c) 2021 {{ cookiecutter.full_name }}' |
def bintang(n):
space = 2*n-1
for i in range(n):
print(('*'*(2*i+1)).center(space))
bintang(7)
| def bintang(n):
space = 2 * n - 1
for i in range(n):
print(('*' * (2 * i + 1)).center(space))
bintang(7) |
'''
Rip Genie Ops Object Outputs for IOSXE.
'''
class RipOutput(object):
ShowVrfDetail = {
"Mgmt-vrf": {
"vrf_id": 1,
"interfaces": [
"GigabitEthernet0/0"
],
"address_family": {
"ipv4 unicast": {
"table_id": "0x1",
"flags": "0x0",
"vrf_label": {
'allocation_mode': 'per-prefix'
}
},
"ipv6 unicast": {
"table_id": "0x1E000001",
"flags": "0x0",
"vrf_label": {
'allocation_mode': 'per-prefix'
}
}
},
"flags": "0x1808"
},
"VRF1": {
"interfaces": [
"GigabitEthernet0/0"
],
"address_family": {
"ipv4 unicast": {
"export_to_global": {
"export_to_global_map": "export_to_global_map",
"prefix_limit": 1000
},
"import_from_global": {
"prefix_limit": 1000,
"import_from_global_map": "import_from_global_map"
},
"table_id": "0x1",
"routing_table_limit": {
"routing_table_limit_action": {
"enable_alert_limit_number": {
"alert_limit_number": 10000
}
}
},
"route_targets": {
"200:1": {
"rt_type": "both",
"route_target": "200:1"
},
"100:1": {
"rt_type": "both",
"route_target": "100:1"
}
},
"flags": "0x2100",
"vrf_label": {
'allocation_mode': 'per-prefix'
}
},
"ipv6 unicast": {
"export_to_global": {
"export_to_global_map": "export_to_global_map",
"prefix_limit": 1000
},
"table_id": "0x1E000001",
"routing_table_limit": {
"routing_table_limit_action": {
"enable_alert_percent": {
"alert_percent_value": 70
},
"enable_alert_limit_number": {
"alert_limit_number": 7000
}
},
"routing_table_limit_number": 10000
},
"route_targets": {
"200:1": {
"rt_type": "import",
"route_target": "200:1"
},
"400:1": {
"rt_type": "import",
"route_target": "400:1"
},
"300:1": {
"rt_type": "export",
"route_target": "300:1"
},
"100:1": {
"rt_type": "export",
"route_target": "100:1"
}
},
"flags": "0x100",
"vrf_label": {
'allocation_mode': 'per-prefix'
}
}
},
"flags": "0x180C",
"route_distinguisher": "100:1",
"vrf_id": 1
}
}
showIpProtocols_default = '''\
R1#show ip protocols | sec rip
Routing Protocol is "rip"
Output delay 50 milliseconds between packets
Outgoing update filter list for all interfaces is not set
Incoming update filter list for all interfaces is not set
Incoming routes will have 10 added to metric if on list 21
Sending updates every 10 seconds, next due in 8 seconds
Invalid after 21 seconds, hold down 22, flushed after 23
Default redistribution metric is 3
Redistributing: connected, static, rip
Neighbor(s):
10.1.2.2
Default version control: send version 2, receive version 2
Interface Send Recv Triggered RIP Key-chain
GigabitEthernet3.100 2 2 No 1
Automatic network summarization is not in effect
Address Summarization:
172.16.0.0/17 for GigabitEthernet3.100
Maximum path: 4
Routing for Networks:
10.0.0.0
Passive Interface(s):
GigabitEthernet2.100
Routing Information Sources:
Gateway Distance Last Update
10.1.3.3 120 00:00:00
10.1.2.2 120 00:00:04
Distance: (default is 120)
'''
showIpProtocols_vrf1 = '''\
R1#show ip protocols vrf VRF1 | sec rip
Routing Protocol is "rip"
Output delay 50 milliseconds between packets
Outgoing update filter list for all interfaces is not set
Incoming update filter list for all interfaces is not set
Sending updates every 30 seconds, next due in 2 seconds
Invalid after 180 seconds, hold down 180, flushed after 240
Redistributing: connected, static, rip
Default version control: send version 2, receive version 2
Interface Send Recv Triggered RIP Key-chain
GigabitEthernet2.200 2 2 No none
GigabitEthernet3.200 2 2 No none
Maximum path: 4
Routing for Networks:
10.0.0.0
10.0.0.0
Routing Information Sources:
Gateway Distance Last Update
10.1.3.3 120 20:33:00
10.1.2.2 120 00:00:21
Distance: (default is 120)
'''
showIpRipDatabase_default = '''\
R1#show ip rip database
0.0.0.0/0 auto-summary
0.0.0.0/0 redistributed
[3] via 172.16.1.254, from 0.0.0.0,
[3] via 172.16.1.254, from 0.0.0.0,
10.0.0.0/8 auto-summary
10.1.2.0/24 directly connected, GigabitEthernet2.100
10.1.3.0/24 directly connected, GigabitEthernet3.100
10.2.3.0/24
[1] via 10.1.3.3, 00:00:05, GigabitEthernet3.100
[1] via 10.1.2.2, 00:00:21, GigabitEthernet2.100
172.16.0.0/16 auto-summary
172.16.0.0/17 int-summary
172.16.0.0/17
[4] via 10.1.2.2, 00:00:00, GigabitEthernet2.100
'''
showIpRipDatabase_vrf1 = '''\
R1#show ip rip database vrf VRF1
10.0.0.0/8 auto-summary
10.1.2.0/24 directly connected, GigabitEthernet2.200
10.1.3.0/24 directly connected, GigabitEthernet3.200
10.2.3.0/24
[1] via 10.1.2.2, 00:00:08, GigabitEthernet2.200
172.16.0.0/16 auto-summary
172.16.11.0/24 redistributed
[15] via 0.0.0.0,
172.16.22.0/24
[15] via 10.1.2.2, 00:00:08, GigabitEthernet2.200
192.168.1.0/24 auto-summary
192.168.1.1/32 redistributed
[1] via 0.0.0.0,
'''
showIpv6Protocols_default = '''\
R1#show ipv6 protocols | sec rip
IPv6 Routing Protocol is "rip ripng"
Interfaces:
GigabitEthernet3.100
GigabitEthernet2.100
Redistribution:
Redistributing protocol static with metric 3
'''
showIpv6Protocols_vrf1 = '''\
R1#show ipv6 protocols vrf VRF1 | sec rip
IPv6 Routing Protocol is "rip ripng"
Interfaces:
GigabitEthernet3.200
GigabitEthernet2.200
Redistribution:
Redistributing protocol connected with transparent metric
Redistributing protocol static with transparent metric route-map static-to-rip
'''
showIpv6RipDatabase_default = '''\
R1#show ipv6 rip database
RIP VRF "Default VRF", local RIB
2001:DB8:1:3::/64, metric 2
GigabitEthernet3.100/FE80::F816:3EFF:FEFF:1E3D, expires in 179 secs
2001:DB8:2:3::/64, metric 2, installed
GigabitEthernet3.100/FE80::F816:3EFF:FEFF:1E3D, expires in 179 secs
2001:DB8:2222:2222::/64, metric 7, installed
GigabitEthernet3.100/FE80::F816:3EFF:FEFF:1E3D, expires in 179 secs
2001:DB8:2223:2223::/64, metric 6, installed
GigabitEthernet2.100/FE80::F816:3EFF:FE7B:437, expires in 173 secs
'''
showIpv6RipDatabase_vrf1 = '''\
R1#show ipv6 rip vrf VRF1 database
RIP VRF "VRF1", local RIB
2001:DB8:1:2::/64, metric 2
GigabitEthernet2.200/FE80::F816:3EFF:FE7B:437, expires in 166 secs
2001:DB8:1:3::/64, metric 2
GigabitEthernet3.200/FE80::F816:3EFF:FEFF:1E3D, expires in 169 secs
2001:DB8:2:3::/64, metric 2, installed
GigabitEthernet3.200/FE80::F816:3EFF:FEFF:1E3D, expires in 169 secs
GigabitEthernet2.200/FE80::F816:3EFF:FE7B:437, expires in 166 secs
'''
showIpv6Rip_default = '''\
R1#show ipv6 rip
RIP VRF "Default VRF", port 521, multicast-group FF02::9, pid 635
Administrative distance is 120. Maximum paths is 16
Updates every 30 seconds, expire after 180
Holddown lasts 0 seconds, garbage collect after 120
Split horizon is on; poison reverse is off
Default routes are not generated
Periodic updates 399, trigger updates 8
Full Advertisement 0, Delayed Events 0
Interfaces:
GigabitEthernet3.100
GigabitEthernet2.100
Redistribution:
Redistributing protocol static with metric 3
'''
showIpv6Rip_vrf1= '''\
R1#show ipv6 rip vrf VRF1
RIP VRF "VRF1", port 521, multicast-group FF02::9, pid 635
Administrative distance is 120. Maximum paths is 16
Updates every 30 seconds, expire after 180
Holddown lasts 0 seconds, garbage collect after 120
Split horizon is on; poison reverse is off
Default routes are generated
Periodic updates 390, trigger updates 3
Full Advertisement 0, Delayed Events 0
Interfaces:
GigabitEthernet3.200
GigabitEthernet2.200
Redistribution:
Redistributing protocol connected with transparent metric
Redistributing protocol static with transparent metric route-map static-to-rip
'''
ripOpsOutput={
"vrf": {
"default": {
"address_family": {
"ipv6": {
"instance": {
"rip ripng": {
"redistribute": {
"static": {
"metric": 3
}
},
"timers": {
"holddown_interval": 0,
"flush_interval": 120,
"update_interval": 30
},
"maximum_paths": 16,
"split_horizon": True,
"routes": {
"2001:DB8:2223:2223::/64": {
"index": {
1: {
"metric": 6,
"expire_time": "173",
"interface": "GigabitEthernet2.100",
"next_hop": "FE80::F816:3EFF:FE7B:437"
}
}
},
"2001:DB8:2:3::/64": {
"index": {
1: {
"metric": 2,
"expire_time": "179",
"interface": "GigabitEthernet3.100",
"next_hop": "FE80::F816:3EFF:FEFF:1E3D"
}
}
},
"2001:DB8:1:3::/64": {
"index": {
1: {
"metric": 2,
"expire_time": "179",
"interface": "GigabitEthernet3.100",
"next_hop": "FE80::F816:3EFF:FEFF:1E3D"
}
}
},
"2001:DB8:2222:2222::/64": {
"index": {
1: {
"metric": 7,
"expire_time": "179",
"interface": "GigabitEthernet3.100",
"next_hop": "FE80::F816:3EFF:FEFF:1E3D"
}
}
}
},
"originate_default_route": {
"enabled": False
},
"distance": 120,
"poison_reverse": False,
"interfaces": {
"GigabitEthernet3.100": {},
"GigabitEthernet2.100": {}
}
}
}
},
"ipv4": {
"instance": {
"rip": {
"distance": 120,
"output_delay": 50,
"maximum_paths": 4,
"default_metric": 3,
"routes": {
"10.2.3.0/24": {
"index": {
1: {
"metric": 1,
"next_hop": "10.1.3.3",
"interface": "GigabitEthernet3.100"
},
2: {
"metric": 1,
"next_hop": "10.1.2.2",
"interface": "GigabitEthernet2.100"
}
}
},
"10.0.0.0/8": {
"index": {
1: {
"summary_type": "auto-summary"
}
}
},
"172.16.0.0/17": {
"index": {
1: {
"summary_type": "int-summary"
},
2: {
"metric": 4,
"next_hop": "10.1.2.2",
"interface": "GigabitEthernet2.100"
}
}
},
"0.0.0.0/0": {
"index": {
1: {
"summary_type": "auto-summary"
},
2: {
"metric": 3,
"next_hop": "172.16.1.254",
"redistributed": True
},
3: {
"metric": 3,
"next_hop": "172.16.1.254",
"redistributed": True
}
}
},
"172.16.0.0/16": {
"index": {
1: {
"summary_type": "auto-summary"
}
}
},
"10.1.2.0/24": {
"index": {
1: {
"route_type": "connected",
"interface": "GigabitEthernet2.100"
}
}
},
"10.1.3.0/24": {
"index": {
1: {
"route_type": "connected",
"interface": "GigabitEthernet3.100"
}
}
}
},
"interfaces": {
"GigabitEthernet3.100": {
"passive": True,
"summary_address": {
"172.16.0.0/17": {}
}
}
},
"redistribute": {
"static": {},
"rip": {},
"connected": {}
}
}
}
}
}
},
"VRF1": {
"address_family": {
"ipv6": {
"instance": {
"rip ripng": {
"redistribute": {
"static": {
"route_policy": "static-to-rip"
},
"connected": {}
},
"timers": {
"update_interval": 30,
"flush_interval": 120,
"holddown_interval": 0
},
"maximum_paths": 16,
"split_horizon": True,
"routes": {
"2001:DB8:2:3::/64": {
"index": {
1: {
"metric": 2,
"expire_time": "169",
"interface": "GigabitEthernet3.200",
"next_hop": "FE80::F816:3EFF:FEFF:1E3D"
},
2: {
"metric": 2,
"expire_time": "166",
"interface": "GigabitEthernet2.200",
"next_hop": "FE80::F816:3EFF:FE7B:437"
}
}
},
"2001:DB8:1:3::/64": {
"index": {
1: {
"metric": 2,
"expire_time": "169",
"interface": "GigabitEthernet3.200",
"next_hop": "FE80::F816:3EFF:FEFF:1E3D"
}
}
},
"2001:DB8:1:2::/64": {
"index": {
1: {
"metric": 2,
"expire_time": "166",
"interface": "GigabitEthernet2.200",
"next_hop": "FE80::F816:3EFF:FE7B:437"
}
}
}
},
"originate_default_route": {
"enabled": True
},
"distance": 120,
"poison_reverse": False,
"interfaces": {
"GigabitEthernet2.200": {},
"GigabitEthernet3.200": {}
}
}
}
},
"ipv4": {
"instance": {
"rip": {
"distance": 120,
"output_delay": 50,
"routes": {
"192.168.1.1/32": {
"index": {
1: {
"metric": 1,
"next_hop": "0.0.0.0",
"redistributed": True
}
}
},
"192.168.1.0/24": {
"index": {
1: {
"summary_type": "auto-summary"
}
}
},
"172.16.22.0/24": {
"index": {
1: {
"metric": 15,
"next_hop": "10.1.2.2",
"interface": "GigabitEthernet2.200"
}
}
},
"10.0.0.0/8": {
"index": {
1: {
"summary_type": "auto-summary"
}
}
},
"10.1.2.0/24": {
"index": {
1: {
"route_type": "connected",
"interface": "GigabitEthernet2.200"
}
}
},
"172.16.0.0/16": {
"index": {
1: {
"summary_type": "auto-summary"
}
}
},
"172.16.11.0/24": {
"index": {
1: {
"metric": 15,
"next_hop": "0.0.0.0",
"redistributed": True
}
}
},
"10.2.3.0/24": {
"index": {
1: {
"metric": 1,
"next_hop": "10.1.2.2",
"interface": "GigabitEthernet2.200"
}
}
},
"10.1.3.0/24": {
"index": {
1: {
"route_type": "connected",
"interface": "GigabitEthernet3.200"
}
}
}
},
"redistribute": {
"static": {},
"rip": {},
"connected": {}
},
"maximum_paths": 4
}
}
}
}
}
}
}
| """
Rip Genie Ops Object Outputs for IOSXE.
"""
class Ripoutput(object):
show_vrf_detail = {'Mgmt-vrf': {'vrf_id': 1, 'interfaces': ['GigabitEthernet0/0'], 'address_family': {'ipv4 unicast': {'table_id': '0x1', 'flags': '0x0', 'vrf_label': {'allocation_mode': 'per-prefix'}}, 'ipv6 unicast': {'table_id': '0x1E000001', 'flags': '0x0', 'vrf_label': {'allocation_mode': 'per-prefix'}}}, 'flags': '0x1808'}, 'VRF1': {'interfaces': ['GigabitEthernet0/0'], 'address_family': {'ipv4 unicast': {'export_to_global': {'export_to_global_map': 'export_to_global_map', 'prefix_limit': 1000}, 'import_from_global': {'prefix_limit': 1000, 'import_from_global_map': 'import_from_global_map'}, 'table_id': '0x1', 'routing_table_limit': {'routing_table_limit_action': {'enable_alert_limit_number': {'alert_limit_number': 10000}}}, 'route_targets': {'200:1': {'rt_type': 'both', 'route_target': '200:1'}, '100:1': {'rt_type': 'both', 'route_target': '100:1'}}, 'flags': '0x2100', 'vrf_label': {'allocation_mode': 'per-prefix'}}, 'ipv6 unicast': {'export_to_global': {'export_to_global_map': 'export_to_global_map', 'prefix_limit': 1000}, 'table_id': '0x1E000001', 'routing_table_limit': {'routing_table_limit_action': {'enable_alert_percent': {'alert_percent_value': 70}, 'enable_alert_limit_number': {'alert_limit_number': 7000}}, 'routing_table_limit_number': 10000}, 'route_targets': {'200:1': {'rt_type': 'import', 'route_target': '200:1'}, '400:1': {'rt_type': 'import', 'route_target': '400:1'}, '300:1': {'rt_type': 'export', 'route_target': '300:1'}, '100:1': {'rt_type': 'export', 'route_target': '100:1'}}, 'flags': '0x100', 'vrf_label': {'allocation_mode': 'per-prefix'}}}, 'flags': '0x180C', 'route_distinguisher': '100:1', 'vrf_id': 1}}
show_ip_protocols_default = ' R1#show ip protocols | sec rip\nRouting Protocol is "rip"\n Output delay 50 milliseconds between packets\n Outgoing update filter list for all interfaces is not set\n Incoming update filter list for all interfaces is not set\n Incoming routes will have 10 added to metric if on list 21\n Sending updates every 10 seconds, next due in 8 seconds\n Invalid after 21 seconds, hold down 22, flushed after 23\n Default redistribution metric is 3\n Redistributing: connected, static, rip\n Neighbor(s):\n 10.1.2.2\n Default version control: send version 2, receive version 2\n Interface Send Recv Triggered RIP Key-chain\n GigabitEthernet3.100 2 2 No 1\n Automatic network summarization is not in effect\n Address Summarization:\n 172.16.0.0/17 for GigabitEthernet3.100\n Maximum path: 4\n Routing for Networks:\n 10.0.0.0\n Passive Interface(s):\n GigabitEthernet2.100\n Routing Information Sources:\n Gateway Distance Last Update\n 10.1.3.3 120 00:00:00\n 10.1.2.2 120 00:00:04\n Distance: (default is 120)\n '
show_ip_protocols_vrf1 = 'R1#show ip protocols vrf VRF1 | sec rip\nRouting Protocol is "rip"\n Output delay 50 milliseconds between packets\n Outgoing update filter list for all interfaces is not set\n Incoming update filter list for all interfaces is not set\n Sending updates every 30 seconds, next due in 2 seconds\n Invalid after 180 seconds, hold down 180, flushed after 240\n Redistributing: connected, static, rip\n Default version control: send version 2, receive version 2\n Interface Send Recv Triggered RIP Key-chain\n GigabitEthernet2.200 2 2 No none\n GigabitEthernet3.200 2 2 No none\n Maximum path: 4\n Routing for Networks:\n 10.0.0.0\n 10.0.0.0\n Routing Information Sources:\n Gateway Distance Last Update\n 10.1.3.3 120 20:33:00\n 10.1.2.2 120 00:00:21\n Distance: (default is 120)\n '
show_ip_rip_database_default = ' R1#show ip rip database\n0.0.0.0/0 auto-summary\n0.0.0.0/0 redistributed\n [3] via 172.16.1.254, from 0.0.0.0,\n [3] via 172.16.1.254, from 0.0.0.0,\n10.0.0.0/8 auto-summary\n10.1.2.0/24 directly connected, GigabitEthernet2.100\n10.1.3.0/24 directly connected, GigabitEthernet3.100\n10.2.3.0/24\n [1] via 10.1.3.3, 00:00:05, GigabitEthernet3.100\n [1] via 10.1.2.2, 00:00:21, GigabitEthernet2.100\n172.16.0.0/16 auto-summary\n172.16.0.0/17 int-summary\n172.16.0.0/17\n [4] via 10.1.2.2, 00:00:00, GigabitEthernet2.100\n\n '
show_ip_rip_database_vrf1 = ' R1#show ip rip database vrf VRF1\n10.0.0.0/8 auto-summary\n10.1.2.0/24 directly connected, GigabitEthernet2.200\n10.1.3.0/24 directly connected, GigabitEthernet3.200\n10.2.3.0/24\n [1] via 10.1.2.2, 00:00:08, GigabitEthernet2.200\n172.16.0.0/16 auto-summary\n172.16.11.0/24 redistributed\n [15] via 0.0.0.0,\n172.16.22.0/24\n [15] via 10.1.2.2, 00:00:08, GigabitEthernet2.200\n192.168.1.0/24 auto-summary\n192.168.1.1/32 redistributed\n [1] via 0.0.0.0,\n '
show_ipv6_protocols_default = ' R1#show ipv6 protocols | sec rip\n IPv6 Routing Protocol is "rip ripng"\n Interfaces:\n GigabitEthernet3.100\n GigabitEthernet2.100\n Redistribution:\n Redistributing protocol static with metric 3\n '
show_ipv6_protocols_vrf1 = ' R1#show ipv6 protocols vrf VRF1 | sec rip\n IPv6 Routing Protocol is "rip ripng"\n Interfaces:\n GigabitEthernet3.200\n GigabitEthernet2.200\n Redistribution:\n Redistributing protocol connected with transparent metric\n Redistributing protocol static with transparent metric route-map static-to-rip\n '
show_ipv6_rip_database_default = ' R1#show ipv6 rip database\n RIP VRF "Default VRF", local RIB\n 2001:DB8:1:3::/64, metric 2\n GigabitEthernet3.100/FE80::F816:3EFF:FEFF:1E3D, expires in 179 secs\n 2001:DB8:2:3::/64, metric 2, installed\n GigabitEthernet3.100/FE80::F816:3EFF:FEFF:1E3D, expires in 179 secs\n 2001:DB8:2222:2222::/64, metric 7, installed\n GigabitEthernet3.100/FE80::F816:3EFF:FEFF:1E3D, expires in 179 secs\n 2001:DB8:2223:2223::/64, metric 6, installed\n GigabitEthernet2.100/FE80::F816:3EFF:FE7B:437, expires in 173 secs\n '
show_ipv6_rip_database_vrf1 = ' R1#show ipv6 rip vrf VRF1 database\nRIP VRF "VRF1", local RIB\n 2001:DB8:1:2::/64, metric 2\n GigabitEthernet2.200/FE80::F816:3EFF:FE7B:437, expires in 166 secs\n 2001:DB8:1:3::/64, metric 2\n GigabitEthernet3.200/FE80::F816:3EFF:FEFF:1E3D, expires in 169 secs\n 2001:DB8:2:3::/64, metric 2, installed\n GigabitEthernet3.200/FE80::F816:3EFF:FEFF:1E3D, expires in 169 secs\n GigabitEthernet2.200/FE80::F816:3EFF:FE7B:437, expires in 166 secs\n '
show_ipv6_rip_default = ' R1#show ipv6 rip\n RIP VRF "Default VRF", port 521, multicast-group FF02::9, pid 635\n Administrative distance is 120. Maximum paths is 16\n Updates every 30 seconds, expire after 180\n Holddown lasts 0 seconds, garbage collect after 120\n Split horizon is on; poison reverse is off\n Default routes are not generated\n Periodic updates 399, trigger updates 8\n Full Advertisement 0, Delayed Events 0\n Interfaces:\n GigabitEthernet3.100\n GigabitEthernet2.100\n Redistribution:\n Redistributing protocol static with metric 3\n '
show_ipv6_rip_vrf1 = ' R1#show ipv6 rip vrf VRF1\n RIP VRF "VRF1", port 521, multicast-group FF02::9, pid 635\n Administrative distance is 120. Maximum paths is 16\n Updates every 30 seconds, expire after 180\n Holddown lasts 0 seconds, garbage collect after 120\n Split horizon is on; poison reverse is off\n Default routes are generated\n Periodic updates 390, trigger updates 3\n Full Advertisement 0, Delayed Events 0\n Interfaces:\n GigabitEthernet3.200\n GigabitEthernet2.200\n Redistribution:\n Redistributing protocol connected with transparent metric\n Redistributing protocol static with transparent metric route-map static-to-rip\n'
rip_ops_output = {'vrf': {'default': {'address_family': {'ipv6': {'instance': {'rip ripng': {'redistribute': {'static': {'metric': 3}}, 'timers': {'holddown_interval': 0, 'flush_interval': 120, 'update_interval': 30}, 'maximum_paths': 16, 'split_horizon': True, 'routes': {'2001:DB8:2223:2223::/64': {'index': {1: {'metric': 6, 'expire_time': '173', 'interface': 'GigabitEthernet2.100', 'next_hop': 'FE80::F816:3EFF:FE7B:437'}}}, '2001:DB8:2:3::/64': {'index': {1: {'metric': 2, 'expire_time': '179', 'interface': 'GigabitEthernet3.100', 'next_hop': 'FE80::F816:3EFF:FEFF:1E3D'}}}, '2001:DB8:1:3::/64': {'index': {1: {'metric': 2, 'expire_time': '179', 'interface': 'GigabitEthernet3.100', 'next_hop': 'FE80::F816:3EFF:FEFF:1E3D'}}}, '2001:DB8:2222:2222::/64': {'index': {1: {'metric': 7, 'expire_time': '179', 'interface': 'GigabitEthernet3.100', 'next_hop': 'FE80::F816:3EFF:FEFF:1E3D'}}}}, 'originate_default_route': {'enabled': False}, 'distance': 120, 'poison_reverse': False, 'interfaces': {'GigabitEthernet3.100': {}, 'GigabitEthernet2.100': {}}}}}, 'ipv4': {'instance': {'rip': {'distance': 120, 'output_delay': 50, 'maximum_paths': 4, 'default_metric': 3, 'routes': {'10.2.3.0/24': {'index': {1: {'metric': 1, 'next_hop': '10.1.3.3', 'interface': 'GigabitEthernet3.100'}, 2: {'metric': 1, 'next_hop': '10.1.2.2', 'interface': 'GigabitEthernet2.100'}}}, '10.0.0.0/8': {'index': {1: {'summary_type': 'auto-summary'}}}, '172.16.0.0/17': {'index': {1: {'summary_type': 'int-summary'}, 2: {'metric': 4, 'next_hop': '10.1.2.2', 'interface': 'GigabitEthernet2.100'}}}, '0.0.0.0/0': {'index': {1: {'summary_type': 'auto-summary'}, 2: {'metric': 3, 'next_hop': '172.16.1.254', 'redistributed': True}, 3: {'metric': 3, 'next_hop': '172.16.1.254', 'redistributed': True}}}, '172.16.0.0/16': {'index': {1: {'summary_type': 'auto-summary'}}}, '10.1.2.0/24': {'index': {1: {'route_type': 'connected', 'interface': 'GigabitEthernet2.100'}}}, '10.1.3.0/24': {'index': {1: {'route_type': 'connected', 'interface': 'GigabitEthernet3.100'}}}}, 'interfaces': {'GigabitEthernet3.100': {'passive': True, 'summary_address': {'172.16.0.0/17': {}}}}, 'redistribute': {'static': {}, 'rip': {}, 'connected': {}}}}}}}, 'VRF1': {'address_family': {'ipv6': {'instance': {'rip ripng': {'redistribute': {'static': {'route_policy': 'static-to-rip'}, 'connected': {}}, 'timers': {'update_interval': 30, 'flush_interval': 120, 'holddown_interval': 0}, 'maximum_paths': 16, 'split_horizon': True, 'routes': {'2001:DB8:2:3::/64': {'index': {1: {'metric': 2, 'expire_time': '169', 'interface': 'GigabitEthernet3.200', 'next_hop': 'FE80::F816:3EFF:FEFF:1E3D'}, 2: {'metric': 2, 'expire_time': '166', 'interface': 'GigabitEthernet2.200', 'next_hop': 'FE80::F816:3EFF:FE7B:437'}}}, '2001:DB8:1:3::/64': {'index': {1: {'metric': 2, 'expire_time': '169', 'interface': 'GigabitEthernet3.200', 'next_hop': 'FE80::F816:3EFF:FEFF:1E3D'}}}, '2001:DB8:1:2::/64': {'index': {1: {'metric': 2, 'expire_time': '166', 'interface': 'GigabitEthernet2.200', 'next_hop': 'FE80::F816:3EFF:FE7B:437'}}}}, 'originate_default_route': {'enabled': True}, 'distance': 120, 'poison_reverse': False, 'interfaces': {'GigabitEthernet2.200': {}, 'GigabitEthernet3.200': {}}}}}, 'ipv4': {'instance': {'rip': {'distance': 120, 'output_delay': 50, 'routes': {'192.168.1.1/32': {'index': {1: {'metric': 1, 'next_hop': '0.0.0.0', 'redistributed': True}}}, '192.168.1.0/24': {'index': {1: {'summary_type': 'auto-summary'}}}, '172.16.22.0/24': {'index': {1: {'metric': 15, 'next_hop': '10.1.2.2', 'interface': 'GigabitEthernet2.200'}}}, '10.0.0.0/8': {'index': {1: {'summary_type': 'auto-summary'}}}, '10.1.2.0/24': {'index': {1: {'route_type': 'connected', 'interface': 'GigabitEthernet2.200'}}}, '172.16.0.0/16': {'index': {1: {'summary_type': 'auto-summary'}}}, '172.16.11.0/24': {'index': {1: {'metric': 15, 'next_hop': '0.0.0.0', 'redistributed': True}}}, '10.2.3.0/24': {'index': {1: {'metric': 1, 'next_hop': '10.1.2.2', 'interface': 'GigabitEthernet2.200'}}}, '10.1.3.0/24': {'index': {1: {'route_type': 'connected', 'interface': 'GigabitEthernet3.200'}}}}, 'redistribute': {'static': {}, 'rip': {}, 'connected': {}}, 'maximum_paths': 4}}}}}}} |
sm.setSpeakerID(1102102)
if sm.sendAskYesNo("Did you enjoy the drink? You better have! It is the special concoction of my people, the Piyo Tribe!\r\nNow... Pop quiz! Do you remember how to fight? Defeat 3 #o9300730# monsters and bring me 3 #t4000489# items!"):
sm.removeEscapeButton()
sm.sendNext("What do you mean, you don't know what to do! Press the Ctrl key to perform a basic attack! What do you mean, I forgot to tell you how to pick up items? Just press the Z key! ")
sm.startQuest(parentID)
for i in range(3):
sm.spawnMob(9300730, -364, -7, False)
sm.playSound("Aran/balloon", 100)
else:
sm.sendNext("What? Your failure is my failure as a teacher, and I never fail!") | sm.setSpeakerID(1102102)
if sm.sendAskYesNo('Did you enjoy the drink? You better have! It is the special concoction of my people, the Piyo Tribe!\r\nNow... Pop quiz! Do you remember how to fight? Defeat 3 #o9300730# monsters and bring me 3 #t4000489# items!'):
sm.removeEscapeButton()
sm.sendNext("What do you mean, you don't know what to do! Press the Ctrl key to perform a basic attack! What do you mean, I forgot to tell you how to pick up items? Just press the Z key! ")
sm.startQuest(parentID)
for i in range(3):
sm.spawnMob(9300730, -364, -7, False)
sm.playSound('Aran/balloon', 100)
else:
sm.sendNext('What? Your failure is my failure as a teacher, and I never fail!') |
first = set([int(x) for x in input().split()])
second = set([int(x) for x in input().split()])
n = int(input())
for _ in range(n):
command = input().split()
cmd = command[0]
sequence = command[1]
if cmd == "Add":
numbers = [int(x) for x in command[2:]]
if sequence == "First":
first.update(numbers)
elif sequence == "Second":
second.update(numbers)
elif cmd == "Remove":
numbers = [int(x) for x in command[2:]]
if sequence == "First":
first.difference_update(numbers)
elif sequence == "Second":
second.difference_update(numbers)
elif cmd == "Check":
if first.issubset(second) or second.issubset(first):
print(True)
else:
print(False)
print(*sorted(first), sep=", ")
print(*sorted(second), sep=", ")
| first = set([int(x) for x in input().split()])
second = set([int(x) for x in input().split()])
n = int(input())
for _ in range(n):
command = input().split()
cmd = command[0]
sequence = command[1]
if cmd == 'Add':
numbers = [int(x) for x in command[2:]]
if sequence == 'First':
first.update(numbers)
elif sequence == 'Second':
second.update(numbers)
elif cmd == 'Remove':
numbers = [int(x) for x in command[2:]]
if sequence == 'First':
first.difference_update(numbers)
elif sequence == 'Second':
second.difference_update(numbers)
elif cmd == 'Check':
if first.issubset(second) or second.issubset(first):
print(True)
else:
print(False)
print(*sorted(first), sep=', ')
print(*sorted(second), sep=', ') |
"""
Version of iaesdk
"""
__version__ = '1.1.1'
| """
Version of iaesdk
"""
__version__ = '1.1.1' |
def binary_search(array: list, elem: object) -> int or None:
"""Binary Search is only used on sorted Array.
If element is present in the list then it will return the index of that element else it will return None
Args:
array (list): list of elements
elem (object): element that we want to search
Returns:
int or None: will return int if elem is present in the list else will return None
"""
low, high = 0, len(array) - 1
while lo <= hi:
mid = low + ((high - low) // 2)
val = array[mid]
if val == elem:
return mid
elif val < elem:
low = mid + 1
else:
high = mid - 1
return None | def binary_search(array: list, elem: object) -> int or None:
"""Binary Search is only used on sorted Array.
If element is present in the list then it will return the index of that element else it will return None
Args:
array (list): list of elements
elem (object): element that we want to search
Returns:
int or None: will return int if elem is present in the list else will return None
"""
(low, high) = (0, len(array) - 1)
while lo <= hi:
mid = low + (high - low) // 2
val = array[mid]
if val == elem:
return mid
elif val < elem:
low = mid + 1
else:
high = mid - 1
return None |
def make_bricks(small, big, goal):
if goal >(small + 5*big):
return False
else:
return ((goal%5)<=small)
| def make_bricks(small, big, goal):
if goal > small + 5 * big:
return False
else:
return goal % 5 <= small |
'''
Determine if a 9 x 9 Sudoku board is valid.
Only the filled cells need to be validated according to the following rules:
Each row must contain the digits 1-9 without repetition.
Each column must contain the digits 1-9 without repetition.
Each of the nine 3 x 3 sub-boxes of the grid must contain the digits 1-9 without repetition.
Note:
A Sudoku board (partially filled) could be valid but is not necessarily solvable.
Only the filled cells need to be validated according to the mentioned rules.
Example 1:
Input: board =
[["5","3",".",".","7",".",".",".","."]
,["6",".",".","1","9","5",".",".","."]
,[".","9","8",".",".",".",".","6","."]
,["8",".",".",".","6",".",".",".","3"]
,["4",".",".","8",".","3",".",".","1"]
,["7",".",".",".","2",".",".",".","6"]
,[".","6",".",".",".",".","2","8","."]
,[".",".",".","4","1","9",".",".","5"]
,[".",".",".",".","8",".",".","7","9"]]
Output: true
Example 2:
Input: board =
[["8","3",".",".","7",".",".",".","."]
,["6",".",".","1","9","5",".",".","."]
,[".","9","8",".",".",".",".","6","."]
,["8",".",".",".","6",".",".",".","3"]
,["4",".",".","8",".","3",".",".","1"]
,["7",".",".",".","2",".",".",".","6"]
,[".","6",".",".",".",".","2","8","."]
,[".",".",".","4","1","9",".",".","5"]
,[".",".",".",".","8",".",".","7","9"]]
Output: false
Explanation: Same as Example 1, except with the 5 in the top left corner being modified to 8. Since there are two 8's in the top left 3x3 sub-box, it is invalid.
board.length == 9
board[i].length == 9
board[i][j] is a digit or '.'.
'''
class Solution:
def isValidSudoku(self, board: List[List[str]]) -> bool:
# checking horizontal rows
valid = True
for row in board:
trimmed_num = [int(num) for num in row if num.isdigit()]
# if any of the digits in the row are > 9
if any((x > 9 for x in trimmed_num)):
valid = False
break
# if the row contains duplicate numbers
if len(set(trimmed_num)) != len(trimmed_num):
valid = False
break
# if above test is pass, checking vertical rows
if valid:
# transpose the matrix
board_t = [[board[j][i] for j in range(len(board))] for i in range(len(board[0]))]
for row in board_t:
trimmed_num = [int(num) for num in row if num.isdigit()]
if any((x > 9 for x in trimmed_num)):
valid = False
break
if len(set(trimmed_num)) != len(trimmed_num):
valid = False
break
# if above test is pass, check for individual 3X3 matrix to be valid
if valid:
for k in range(3):
for i in range(3):
row = []
h_shft = i*3
for j in range(3):
v_shft = j*1 + k*3
row += board[v_shft][h_shft:h_shft+3]
trimmed_num = [int(num) for num in row if num.isdigit()]
if any((x > 9 for x in trimmed_num)):
valid = False
break
if len(set(trimmed_num)) != len(trimmed_num):
valid = False
break
return valid | """
Determine if a 9 x 9 Sudoku board is valid.
Only the filled cells need to be validated according to the following rules:
Each row must contain the digits 1-9 without repetition.
Each column must contain the digits 1-9 without repetition.
Each of the nine 3 x 3 sub-boxes of the grid must contain the digits 1-9 without repetition.
Note:
A Sudoku board (partially filled) could be valid but is not necessarily solvable.
Only the filled cells need to be validated according to the mentioned rules.
Example 1:
Input: board =
[["5","3",".",".","7",".",".",".","."]
,["6",".",".","1","9","5",".",".","."]
,[".","9","8",".",".",".",".","6","."]
,["8",".",".",".","6",".",".",".","3"]
,["4",".",".","8",".","3",".",".","1"]
,["7",".",".",".","2",".",".",".","6"]
,[".","6",".",".",".",".","2","8","."]
,[".",".",".","4","1","9",".",".","5"]
,[".",".",".",".","8",".",".","7","9"]]
Output: true
Example 2:
Input: board =
[["8","3",".",".","7",".",".",".","."]
,["6",".",".","1","9","5",".",".","."]
,[".","9","8",".",".",".",".","6","."]
,["8",".",".",".","6",".",".",".","3"]
,["4",".",".","8",".","3",".",".","1"]
,["7",".",".",".","2",".",".",".","6"]
,[".","6",".",".",".",".","2","8","."]
,[".",".",".","4","1","9",".",".","5"]
,[".",".",".",".","8",".",".","7","9"]]
Output: false
Explanation: Same as Example 1, except with the 5 in the top left corner being modified to 8. Since there are two 8's in the top left 3x3 sub-box, it is invalid.
board.length == 9
board[i].length == 9
board[i][j] is a digit or '.'.
"""
class Solution:
def is_valid_sudoku(self, board: List[List[str]]) -> bool:
valid = True
for row in board:
trimmed_num = [int(num) for num in row if num.isdigit()]
if any((x > 9 for x in trimmed_num)):
valid = False
break
if len(set(trimmed_num)) != len(trimmed_num):
valid = False
break
if valid:
board_t = [[board[j][i] for j in range(len(board))] for i in range(len(board[0]))]
for row in board_t:
trimmed_num = [int(num) for num in row if num.isdigit()]
if any((x > 9 for x in trimmed_num)):
valid = False
break
if len(set(trimmed_num)) != len(trimmed_num):
valid = False
break
if valid:
for k in range(3):
for i in range(3):
row = []
h_shft = i * 3
for j in range(3):
v_shft = j * 1 + k * 3
row += board[v_shft][h_shft:h_shft + 3]
trimmed_num = [int(num) for num in row if num.isdigit()]
if any((x > 9 for x in trimmed_num)):
valid = False
break
if len(set(trimmed_num)) != len(trimmed_num):
valid = False
break
return valid |
class NetApp_OCUM_Settings(object):
"""
Class object for storing API connection settings.
"""
def __init__(self, **kwargs):
self.api_host = kwargs.get('api_host')
self.api_user = kwargs.get('api_user')
self.api_password = kwargs.get('api_password')
self.api_port = kwargs.get('api_port')
self.verify_ssl = kwargs.get('verify_ssl')
| class Netapp_Ocum_Settings(object):
"""
Class object for storing API connection settings.
"""
def __init__(self, **kwargs):
self.api_host = kwargs.get('api_host')
self.api_user = kwargs.get('api_user')
self.api_password = kwargs.get('api_password')
self.api_port = kwargs.get('api_port')
self.verify_ssl = kwargs.get('verify_ssl') |
def foo():
pass
def bar():
a = 'a'
b = 'b'
| def foo():
pass
def bar():
a = 'a'
b = 'b' |
"""
Write a Python program to convert a string in a list.
"""
sample_string = "The quick brown fox jumps over the lazy dog."
list1 = sample_string.split()
print(list1) | """
Write a Python program to convert a string in a list.
"""
sample_string = 'The quick brown fox jumps over the lazy dog.'
list1 = sample_string.split()
print(list1) |
# This file was automatically generated from "alwaysLandLevel.ma"
points = {}
boxes = {}
boxes['areaOfInterestBounds'] = (-1.045859963, 12.67722855, -5.401537075) + (0.0, 0.0, 0.0) + (34.46156851, 20.94044653, 0.6931564611)
points['ffaSpawn1'] = (-9.295167711, 8.010664315, -5.44451005) + (1.555840357, 1.453808816, 0.1165648888)
points['ffaSpawn2'] = (7.484707127, 8.172681752, -5.614479365) + (1.553861796, 1.453808816, 0.04419853907)
points['ffaSpawn3'] = (9.55724115, 11.30789446, -5.614479365) + (1.337925849, 1.453808816, 0.04419853907)
points['ffaSpawn4'] = (-11.55747023, 10.99170684, -5.614479365) + (1.337925849, 1.453808816, 0.04419853907)
points['ffaSpawn5'] = (-1.878892369, 9.46490571, -5.614479365) + (1.337925849, 1.453808816, 0.04419853907)
points['ffaSpawn6'] = (-0.4912812943, 5.077006397, -5.521672101) + (1.878332089, 1.453808816, 0.007578097856)
points['flag1'] = (-11.75152479, 8.057427485, -5.52)
points['flag2'] = (9.840909039, 8.188634282, -5.52)
points['flag3'] = (-0.2195258696, 5.010273907, -5.52)
points['flag4'] = (-0.04605809154, 12.73369108, -5.52)
points['flagDefault'] = (-0.04201942896, 12.72374492, -5.52)
boxes['levelBounds'] = (-0.8748348681, 9.212941713, -5.729538885) + (0.0, 0.0, 0.0) + (36.09666006, 26.19950145, 7.89541168)
points['powerupSpawn1'] = (1.160232442, 6.745963662, -5.469115985)
points['powerupSpawn2'] = (-1.899700206, 10.56447241, -5.505721177)
points['powerupSpawn3'] = (10.56098871, 12.25165669, -5.576232453)
points['powerupSpawn4'] = (-12.33530337, 12.25165669, -5.576232453)
points['spawn1'] = (-9.295167711, 8.010664315, -5.44451005) + (1.555840357, 1.453808816, 0.1165648888)
points['spawn2'] = (7.484707127, 8.172681752, -5.614479365) + (1.553861796, 1.453808816, 0.04419853907)
points['spawnByFlag1'] = (-9.295167711, 8.010664315, -5.44451005) + (1.555840357, 1.453808816, 0.1165648888)
points['spawnByFlag2'] = (7.484707127, 8.172681752, -5.614479365) + (1.553861796, 1.453808816, 0.04419853907)
points['spawnByFlag3'] = (-1.45994593, 5.038762459, -5.535288724) + (0.9516389866, 0.6666414677, 0.08607244075)
points['spawnByFlag4'] = (0.4932087091, 12.74493212, -5.598987003) + (0.5245740665, 0.5245740665, 0.01941146064)
| points = {}
boxes = {}
boxes['areaOfInterestBounds'] = (-1.045859963, 12.67722855, -5.401537075) + (0.0, 0.0, 0.0) + (34.46156851, 20.94044653, 0.6931564611)
points['ffaSpawn1'] = (-9.295167711, 8.010664315, -5.44451005) + (1.555840357, 1.453808816, 0.1165648888)
points['ffaSpawn2'] = (7.484707127, 8.172681752, -5.614479365) + (1.553861796, 1.453808816, 0.04419853907)
points['ffaSpawn3'] = (9.55724115, 11.30789446, -5.614479365) + (1.337925849, 1.453808816, 0.04419853907)
points['ffaSpawn4'] = (-11.55747023, 10.99170684, -5.614479365) + (1.337925849, 1.453808816, 0.04419853907)
points['ffaSpawn5'] = (-1.878892369, 9.46490571, -5.614479365) + (1.337925849, 1.453808816, 0.04419853907)
points['ffaSpawn6'] = (-0.4912812943, 5.077006397, -5.521672101) + (1.878332089, 1.453808816, 0.007578097856)
points['flag1'] = (-11.75152479, 8.057427485, -5.52)
points['flag2'] = (9.840909039, 8.188634282, -5.52)
points['flag3'] = (-0.2195258696, 5.010273907, -5.52)
points['flag4'] = (-0.04605809154, 12.73369108, -5.52)
points['flagDefault'] = (-0.04201942896, 12.72374492, -5.52)
boxes['levelBounds'] = (-0.8748348681, 9.212941713, -5.729538885) + (0.0, 0.0, 0.0) + (36.09666006, 26.19950145, 7.89541168)
points['powerupSpawn1'] = (1.160232442, 6.745963662, -5.469115985)
points['powerupSpawn2'] = (-1.899700206, 10.56447241, -5.505721177)
points['powerupSpawn3'] = (10.56098871, 12.25165669, -5.576232453)
points['powerupSpawn4'] = (-12.33530337, 12.25165669, -5.576232453)
points['spawn1'] = (-9.295167711, 8.010664315, -5.44451005) + (1.555840357, 1.453808816, 0.1165648888)
points['spawn2'] = (7.484707127, 8.172681752, -5.614479365) + (1.553861796, 1.453808816, 0.04419853907)
points['spawnByFlag1'] = (-9.295167711, 8.010664315, -5.44451005) + (1.555840357, 1.453808816, 0.1165648888)
points['spawnByFlag2'] = (7.484707127, 8.172681752, -5.614479365) + (1.553861796, 1.453808816, 0.04419853907)
points['spawnByFlag3'] = (-1.45994593, 5.038762459, -5.535288724) + (0.9516389866, 0.6666414677, 0.08607244075)
points['spawnByFlag4'] = (0.4932087091, 12.74493212, -5.598987003) + (0.5245740665, 0.5245740665, 0.01941146064) |
# https://leetcode.com/problems/counting-bits/
class Solution:
def countBits(self, num: int) -> [int]:
# return self.solution1(num)
return self.solution2(num)
# Time: O(n * sizeOf(int))
def solution1(self, num):
return list(map(lambda i: bin(i).count("1"), range(0, num + 1)))
# Time: O(n)
# even: countBits(i) == countBits(i // 2)
# odd: countBits(i) == countBits(i - 1) + 1 where (i - 1) is even
# 2: 00010
# 4: 00100
# 8: 01000
def solution2(self, num):
res = [0] * (num + 1)
for i in range(num + 1):
# or i >> 1 or i % 2
res[i] = res[i // 2] + (i & 1)
return res
| class Solution:
def count_bits(self, num: int) -> [int]:
return self.solution2(num)
def solution1(self, num):
return list(map(lambda i: bin(i).count('1'), range(0, num + 1)))
def solution2(self, num):
res = [0] * (num + 1)
for i in range(num + 1):
res[i] = res[i // 2] + (i & 1)
return res |
# -*- coding: utf-8 -*-
def main():
t = int(input())
n = int(input())
a = list(map(int, input().split()))
m = int(input())
b = list(map(int, input().split()))
count = 0
i = 0
j = 0
while i < n:
if j >= m:
break
if a[i] <= b[j] <= a[i] + t:
j += 1
count += 1
i += 1
if count >= m:
print('yes')
else:
print('no')
if __name__ == '__main__':
main()
| def main():
t = int(input())
n = int(input())
a = list(map(int, input().split()))
m = int(input())
b = list(map(int, input().split()))
count = 0
i = 0
j = 0
while i < n:
if j >= m:
break
if a[i] <= b[j] <= a[i] + t:
j += 1
count += 1
i += 1
if count >= m:
print('yes')
else:
print('no')
if __name__ == '__main__':
main() |
# Split into all the possible subset of an array can be either number of string
print("----------INPUT----------")
# For arrays
str_arr = input('Enter array of integers: ').split(' ')
arr = [int(num) for num in str_arr]
# For strings
# str_arr = input('Enter array of strings: ')
# arr = str_arr
# print("----------DP----------")
def splitList(arr, ind, mem, all_mem):
if ind < 0:
return all_mem.append(mem)
temp = mem.copy()
mem.append(arr[ind])
splitList(arr, ind - 1, mem, all_mem)
splitList(arr, ind - 1, temp, all_mem)
def toSplitList(arr):
mem = []
all_mem = []
splitList(arr, len(arr) - 1, mem, all_mem)
return all_mem
print("----------OUTPUT----------")
result = toSplitList(arr)
print(result)
print("----------END----------")
| print('----------INPUT----------')
str_arr = input('Enter array of integers: ').split(' ')
arr = [int(num) for num in str_arr]
def split_list(arr, ind, mem, all_mem):
if ind < 0:
return all_mem.append(mem)
temp = mem.copy()
mem.append(arr[ind])
split_list(arr, ind - 1, mem, all_mem)
split_list(arr, ind - 1, temp, all_mem)
def to_split_list(arr):
mem = []
all_mem = []
split_list(arr, len(arr) - 1, mem, all_mem)
return all_mem
print('----------OUTPUT----------')
result = to_split_list(arr)
print(result)
print('----------END----------') |
def fras(f):
tam = len(f)
print("-"*tam)
print(f)
print("-"*tam)
frase = str(input("Digite uma frase: "))
fras(frase)
| def fras(f):
tam = len(f)
print('-' * tam)
print(f)
print('-' * tam)
frase = str(input('Digite uma frase: '))
fras(frase) |
"""
MIT License
Copyright (c) 2021 AWS Cloud Community LPU
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
"""
TITLE_STORE = "titles.txt" # logs titles of news that are already sent
LOG_FILE = "logs.txt" # log file
AWS_FEED_URL = "https://aws.amazon.com/about-aws/whats-new/recent/feed/" # RSS feed URL
| """
MIT License
Copyright (c) 2021 AWS Cloud Community LPU
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
"""
title_store = 'titles.txt'
log_file = 'logs.txt'
aws_feed_url = 'https://aws.amazon.com/about-aws/whats-new/recent/feed/' |
# -*- coding: utf-8 -*-
# Copyright 2019 Cohesity Inc.
class AlertDocument(object):
"""Implementation of the 'AlertDocument' model.
Specifies documentation about the Alert such as name, description, cause
and how to resolve the Alert.
Attributes:
alert_cause (string): Specifies cause of the Alert that is included in
the body of the email or any other type of notification.
alert_description (string): Specifies brief description about the
Alert that is used in the subject line when sending a notification
email for an Alert.
alert_help_text (string): Specifies instructions describing how to
resolve the Alert that is included in the body of the email or any
other type of notification.
alert_name (string): Specifies short name that describes the Alert
type such as DiskBad, HighCpuUsage, FrequentProcessRestarts, etc.
"""
# Create a mapping from Model property names to API property names
_names = {
"alert_cause":'alertCause',
"alert_description":'alertDescription',
"alert_help_text":'alertHelpText',
"alert_name":'alertName'
}
def __init__(self,
alert_cause=None,
alert_description=None,
alert_help_text=None,
alert_name=None):
"""Constructor for the AlertDocument class"""
# Initialize members of the class
self.alert_cause = alert_cause
self.alert_description = alert_description
self.alert_help_text = alert_help_text
self.alert_name = alert_name
@classmethod
def from_dictionary(cls,
dictionary):
"""Creates an instance of this model from a dictionary
Args:
dictionary (dictionary): A dictionary representation of the object as
obtained from the deserialization of the server's response. The keys
MUST match property names in the API description.
Returns:
object: An instance of this structure class.
"""
if dictionary is None:
return None
# Extract variables from the dictionary
alert_cause = dictionary.get('alertCause')
alert_description = dictionary.get('alertDescription')
alert_help_text = dictionary.get('alertHelpText')
alert_name = dictionary.get('alertName')
# Return an object of this model
return cls(alert_cause,
alert_description,
alert_help_text,
alert_name)
| class Alertdocument(object):
"""Implementation of the 'AlertDocument' model.
Specifies documentation about the Alert such as name, description, cause
and how to resolve the Alert.
Attributes:
alert_cause (string): Specifies cause of the Alert that is included in
the body of the email or any other type of notification.
alert_description (string): Specifies brief description about the
Alert that is used in the subject line when sending a notification
email for an Alert.
alert_help_text (string): Specifies instructions describing how to
resolve the Alert that is included in the body of the email or any
other type of notification.
alert_name (string): Specifies short name that describes the Alert
type such as DiskBad, HighCpuUsage, FrequentProcessRestarts, etc.
"""
_names = {'alert_cause': 'alertCause', 'alert_description': 'alertDescription', 'alert_help_text': 'alertHelpText', 'alert_name': 'alertName'}
def __init__(self, alert_cause=None, alert_description=None, alert_help_text=None, alert_name=None):
"""Constructor for the AlertDocument class"""
self.alert_cause = alert_cause
self.alert_description = alert_description
self.alert_help_text = alert_help_text
self.alert_name = alert_name
@classmethod
def from_dictionary(cls, dictionary):
"""Creates an instance of this model from a dictionary
Args:
dictionary (dictionary): A dictionary representation of the object as
obtained from the deserialization of the server's response. The keys
MUST match property names in the API description.
Returns:
object: An instance of this structure class.
"""
if dictionary is None:
return None
alert_cause = dictionary.get('alertCause')
alert_description = dictionary.get('alertDescription')
alert_help_text = dictionary.get('alertHelpText')
alert_name = dictionary.get('alertName')
return cls(alert_cause, alert_description, alert_help_text, alert_name) |
def show_messages(messages):
print("Printing all messages")
for message in messages:
print(message)
def send_messages(messages,sent_messages):
while messages:
removed_messages = messages.pop()
sent_messages.append(removed_messages)
print(sent_messages)
| def show_messages(messages):
print('Printing all messages')
for message in messages:
print(message)
def send_messages(messages, sent_messages):
while messages:
removed_messages = messages.pop()
sent_messages.append(removed_messages)
print(sent_messages) |
ID_PREFIX = "imvdb"
SITE_URL = "https://imvdb.com"
API_URL = "https://imvdb.com/api/v1"
COUNTRIES = {
"United States": "us",
"United Kingdom": "gb",
"Angola": "ao",
"Antigua And Barbuda": "ag",
"Argentina": "ar",
"Aruba": "aw",
"Australia": "au",
"Austria": "at",
"Bahamas": "bs",
"Barbados": "bb",
"Belarus": "by",
"Belgium": "be",
"Bolivia": "bo",
"Bosnia And Herzegowina": "ba",
"Brazil": "br",
"Bulgaria": "bg",
"Canada": "ca",
"Chile": "cl",
"China": "cn",
"Colombia": "co",
"Costa Rica": "cr",
"Croatia (Local Name: Hrvatska)": "hr",
"Cuba": "cu",
"Czech Republic": "cz",
"Denmark": "dk",
"Dominican Republic": "do",
"Ecuador": "ec",
"Egypt": "eg",
"Estonia": "ee",
"Finland": "fi",
"France": "fr",
"France, Metropolitan": "fx",
"French Southern Territories": "tf",
"Georgia": "ge",
"Germany": "de",
"Ghana": "gh",
"Greece": "gr",
"Hong Kong": "hk",
"Hungary": "hu",
"Iceland": "is",
"India": "in",
"Indonesia": "id",
"Iran (Islamic Republic Of)": "ir",
"Ireland": "ie",
"Israel": "il",
"Italy": "it",
"Jamaica": "jm",
"Japan": "jp",
"Kenya": "ke",
"Korea, Republic Of": "kr",
"Latvia": "lv",
"Lebanon": "lb",
"Macau": "mo",
"Macedonia, Former Yugoslav Republic Of": "mk",
"Malaysia": "my",
"Malta": "mt",
"Martinique": "mq",
"Mauritius": "mu",
"Mexico": "mx",
"Monaco": "mc",
"Morocco": "ma",
"Netherlands": "nl",
"Netherlands Antilles": "an",
"New Zealand": "nz",
"Nigeria": "ng",
"Norway": "no",
"Panama": "pa",
"Peru": "pe",
"Philippines": "ph",
"Poland": "pl",
"Portugal": "pt",
"Puerto Rico": "pr",
"Qatar": "qa",
"Romania": "ro",
"Russian Federation": "ru",
"Saint Lucia": "lc",
"Senegal": "sn",
"Serbia": "rs",
"Slovakia (Slovak Republic)": "sk",
"Slovenia": "si",
"South Africa": "za",
"Spain": "es",
"Sri Lanka": "lk",
"Sweden": "se",
"Switzerland": "ch",
"Taiwan": "tw",
"Thailand": "th",
"Trinidad And Tobago": "tt",
"Tunisia": "tn",
"Turkey": "tr",
"Ukraine": "ua",
"United Arab Emirates": "ae",
"Uruguay": "uy",
"Venezuela": "ve",
"Yugoslavia": "yu",
"Zimbabwe": "zw",
}
| id_prefix = 'imvdb'
site_url = 'https://imvdb.com'
api_url = 'https://imvdb.com/api/v1'
countries = {'United States': 'us', 'United Kingdom': 'gb', 'Angola': 'ao', 'Antigua And Barbuda': 'ag', 'Argentina': 'ar', 'Aruba': 'aw', 'Australia': 'au', 'Austria': 'at', 'Bahamas': 'bs', 'Barbados': 'bb', 'Belarus': 'by', 'Belgium': 'be', 'Bolivia': 'bo', 'Bosnia And Herzegowina': 'ba', 'Brazil': 'br', 'Bulgaria': 'bg', 'Canada': 'ca', 'Chile': 'cl', 'China': 'cn', 'Colombia': 'co', 'Costa Rica': 'cr', 'Croatia (Local Name: Hrvatska)': 'hr', 'Cuba': 'cu', 'Czech Republic': 'cz', 'Denmark': 'dk', 'Dominican Republic': 'do', 'Ecuador': 'ec', 'Egypt': 'eg', 'Estonia': 'ee', 'Finland': 'fi', 'France': 'fr', 'France, Metropolitan': 'fx', 'French Southern Territories': 'tf', 'Georgia': 'ge', 'Germany': 'de', 'Ghana': 'gh', 'Greece': 'gr', 'Hong Kong': 'hk', 'Hungary': 'hu', 'Iceland': 'is', 'India': 'in', 'Indonesia': 'id', 'Iran (Islamic Republic Of)': 'ir', 'Ireland': 'ie', 'Israel': 'il', 'Italy': 'it', 'Jamaica': 'jm', 'Japan': 'jp', 'Kenya': 'ke', 'Korea, Republic Of': 'kr', 'Latvia': 'lv', 'Lebanon': 'lb', 'Macau': 'mo', 'Macedonia, Former Yugoslav Republic Of': 'mk', 'Malaysia': 'my', 'Malta': 'mt', 'Martinique': 'mq', 'Mauritius': 'mu', 'Mexico': 'mx', 'Monaco': 'mc', 'Morocco': 'ma', 'Netherlands': 'nl', 'Netherlands Antilles': 'an', 'New Zealand': 'nz', 'Nigeria': 'ng', 'Norway': 'no', 'Panama': 'pa', 'Peru': 'pe', 'Philippines': 'ph', 'Poland': 'pl', 'Portugal': 'pt', 'Puerto Rico': 'pr', 'Qatar': 'qa', 'Romania': 'ro', 'Russian Federation': 'ru', 'Saint Lucia': 'lc', 'Senegal': 'sn', 'Serbia': 'rs', 'Slovakia (Slovak Republic)': 'sk', 'Slovenia': 'si', 'South Africa': 'za', 'Spain': 'es', 'Sri Lanka': 'lk', 'Sweden': 'se', 'Switzerland': 'ch', 'Taiwan': 'tw', 'Thailand': 'th', 'Trinidad And Tobago': 'tt', 'Tunisia': 'tn', 'Turkey': 'tr', 'Ukraine': 'ua', 'United Arab Emirates': 'ae', 'Uruguay': 'uy', 'Venezuela': 've', 'Yugoslavia': 'yu', 'Zimbabwe': 'zw'} |
class Solution:
def longestPalindrome(self, s: str) -> str:
'''
O(n2) solution
'''
def getLength(s, l, r):
while l >= 0 and r < len(s) and s[l] == s[r]:
l -= 1
r += 1
return r - l - 1
max_len = 0
start = 0
for i in range(len(s)):
curr_len = max(getLength(s, i, i), getLength(s, i, i + 1))
if curr_len > max_len:
max_len = curr_len
start = i - (curr_len - 1) // 2
return s[start:start + max_len]
| class Solution:
def longest_palindrome(self, s: str) -> str:
"""
O(n2) solution
"""
def get_length(s, l, r):
while l >= 0 and r < len(s) and (s[l] == s[r]):
l -= 1
r += 1
return r - l - 1
max_len = 0
start = 0
for i in range(len(s)):
curr_len = max(get_length(s, i, i), get_length(s, i, i + 1))
if curr_len > max_len:
max_len = curr_len
start = i - (curr_len - 1) // 2
return s[start:start + max_len] |
'''
Created on Sep 8, 2010
@author: Wilder Rodrigues (wilder.rodrigues@ekholabs.nl)
'''
'''
PBean (what I call Python Bean) Coordinates.
'''
class Coordinates():
def __init__(self, lat, long):
'''
Class constructor.
'''
self.lat = lat
self.long = long
def __str__(self):
'''
Overrides the __str__ function in order to return a formatted string.
'''
return '[latitude: {0}, longitude: {1}]'.format(self.lat, self.long)
| """
Created on Sep 8, 2010
@author: Wilder Rodrigues (wilder.rodrigues@ekholabs.nl)
"""
'\nPBean (what I call Python Bean) Coordinates.\n'
class Coordinates:
def __init__(self, lat, long):
"""
Class constructor.
"""
self.lat = lat
self.long = long
def __str__(self):
"""
Overrides the __str__ function in order to return a formatted string.
"""
return '[latitude: {0}, longitude: {1}]'.format(self.lat, self.long) |
a=int(input("Enter value of a"))
b=int(input("Enter value of b"))
print("Value of a " + str(a))
print("Value of b " + str(b))
temp=a
a=b
b=temp
print("Value of a " + str(a))
print("Value of b " + str(b))
| a = int(input('Enter value of a'))
b = int(input('Enter value of b'))
print('Value of a ' + str(a))
print('Value of b ' + str(b))
temp = a
a = b
b = temp
print('Value of a ' + str(a))
print('Value of b ' + str(b)) |
# Uses python3
def calc_fib_last_digit(n):
fib_nums_last_dig = []
fib_nums_last_dig.append(0)
fib_nums_last_dig.append(1)
for i in range(2, n + 1):
fib_nums_last_dig.append((fib_nums_last_dig[i - 1] + fib_nums_last_dig[i - 2]) % 10)
return fib_nums_last_dig[n]
n = int(input())
print(calc_fib_last_digit(n))
| def calc_fib_last_digit(n):
fib_nums_last_dig = []
fib_nums_last_dig.append(0)
fib_nums_last_dig.append(1)
for i in range(2, n + 1):
fib_nums_last_dig.append((fib_nums_last_dig[i - 1] + fib_nums_last_dig[i - 2]) % 10)
return fib_nums_last_dig[n]
n = int(input())
print(calc_fib_last_digit(n)) |
# Copyright Hybrid Logic Ltd. See LICENSE file for details.
"""
Tests for shared flocker components.
"""
| """
Tests for shared flocker components.
""" |
"""
git status info manipulate
"""
def status_manipulate(msg):
unmerged_files = []
modified_files = []
deleted_files = []
added_files = []
unmerged_tag = "both modified:"
modified_tag = "modified:"
deleted_tag = "deleted:"
added_tag = "Untracked files:"
end_tag = "no changes added"
#msg = msg.replace("\n", "")
msg = msg.replace("\t", " ")
if unmerged_tag in msg:
# collect unmerged files
unm_msg = msg.split(unmerged_tag)
for i in range(len(unm_msg)):
if i != 0 and i != len(unm_msg) - 1:
unmerged_files.append(unm_msg[i].strip())
elif i == len(unm_msg) - 1:
# collect last one
if modified_tag in unm_msg[i]:
unmerged_files.append(unm_msg[i].split(modified_tag)[0].strip())
elif deleted_tag in unm_msg[i]:
unmerged_files.append(unm_msg[i].split(deleted_tag)[0].strip())
elif added_tag in unm_msg[i]:
unmerged_files.append(unm_msg[i].split(added_tag)[0].strip())
else:
unmerged_files.append(unm_msg[i].split(end_tag)[0].strip())
msg = unm_msg[i]
if modified_tag in msg:
# collect modified files
mod_msg = msg.split(modified_tag)
for i in range(len(mod_msg)):
if i != 0 and i != len(mod_msg) - 1:
modified_files.append(mod_msg[i].strip())
elif i == len(mod_msg) - 1:
# collect last one
if deleted_tag in mod_msg[i]:
modified_files.append(mod_msg[i].split(deleted_tag)[0].strip())
elif added_tag in mod_msg[i]:
modified_files.append(mod_msg[i].split(added_tag)[0].strip())
else:
modified_files.append(mod_msg[i].split(end_tag)[0].strip())
msg = mod_msg[i]
if deleted_tag in msg:
# collect deleted files
del_msg = msg.split(deleted_tag)
for i in range(len(del_msg)):
if i != 0 and i != len(del_msg) - 1:
deleted_files.append(del_msg[i])
elif i == len(del_msg) - 1:
# collect last one
if added_tag in del_msg[i]:
deleted_files.append(del_msg[i].split(added_tag)[0].strip())
else:
deleted_files.append(del_msg[i].split(end_tag)[0].strip())
msg = del_msg[i]
if added_tag in msg:
# collect untracked files
add_msg = msg.split(added_tag)[1].split("be committed)")[1].split(end_tag)[0].split("\n")
for i in range(2):
del(add_msg[0])
del(add_msg[len(add_msg)-1])
for j in range(len(add_msg)):
added_files.append(add_msg[j].strip())
return handle_message_dialog(unmerged_files, modified_files, deleted_files, added_files)
def handle_message_dialog(m_unm, m_mod, m_del, m_add):
message = 'Git Status:\n'
is_clean = False
if len(m_unm) != 0:
message = message + "\nunmerged:\n"
for i in range(len(m_unm)):
message = message + '\t' + m_unm[i] + '\n'
if len(m_mod) != 0:
message = message + "\nmodified:\n"
for i in range(len(m_mod)):
message = message + '\t' + m_mod[i] + '\n'
if len(m_del) != 0:
message = message + "\ndeleted:\n"
for i in range(len(m_del)):
message = message + '\t' + m_del[i] + '\n'
if len(m_add) != 0:
message = message + "\nuntracked:\n"
for i in range(len(m_add)):
message = message + '\t' + m_add[i] + '\n'
if len(m_unm) == 0 and len(m_mod) == 0 and len(m_del) == 0 and len(m_add) == 0:
message = message + '\nnothing to commit, working tree clean\n'
is_clean = True
return (message, is_clean)
| """
git status info manipulate
"""
def status_manipulate(msg):
unmerged_files = []
modified_files = []
deleted_files = []
added_files = []
unmerged_tag = 'both modified:'
modified_tag = 'modified:'
deleted_tag = 'deleted:'
added_tag = 'Untracked files:'
end_tag = 'no changes added'
msg = msg.replace('\t', ' ')
if unmerged_tag in msg:
unm_msg = msg.split(unmerged_tag)
for i in range(len(unm_msg)):
if i != 0 and i != len(unm_msg) - 1:
unmerged_files.append(unm_msg[i].strip())
elif i == len(unm_msg) - 1:
if modified_tag in unm_msg[i]:
unmerged_files.append(unm_msg[i].split(modified_tag)[0].strip())
elif deleted_tag in unm_msg[i]:
unmerged_files.append(unm_msg[i].split(deleted_tag)[0].strip())
elif added_tag in unm_msg[i]:
unmerged_files.append(unm_msg[i].split(added_tag)[0].strip())
else:
unmerged_files.append(unm_msg[i].split(end_tag)[0].strip())
msg = unm_msg[i]
if modified_tag in msg:
mod_msg = msg.split(modified_tag)
for i in range(len(mod_msg)):
if i != 0 and i != len(mod_msg) - 1:
modified_files.append(mod_msg[i].strip())
elif i == len(mod_msg) - 1:
if deleted_tag in mod_msg[i]:
modified_files.append(mod_msg[i].split(deleted_tag)[0].strip())
elif added_tag in mod_msg[i]:
modified_files.append(mod_msg[i].split(added_tag)[0].strip())
else:
modified_files.append(mod_msg[i].split(end_tag)[0].strip())
msg = mod_msg[i]
if deleted_tag in msg:
del_msg = msg.split(deleted_tag)
for i in range(len(del_msg)):
if i != 0 and i != len(del_msg) - 1:
deleted_files.append(del_msg[i])
elif i == len(del_msg) - 1:
if added_tag in del_msg[i]:
deleted_files.append(del_msg[i].split(added_tag)[0].strip())
else:
deleted_files.append(del_msg[i].split(end_tag)[0].strip())
msg = del_msg[i]
if added_tag in msg:
add_msg = msg.split(added_tag)[1].split('be committed)')[1].split(end_tag)[0].split('\n')
for i in range(2):
del add_msg[0]
del add_msg[len(add_msg) - 1]
for j in range(len(add_msg)):
added_files.append(add_msg[j].strip())
return handle_message_dialog(unmerged_files, modified_files, deleted_files, added_files)
def handle_message_dialog(m_unm, m_mod, m_del, m_add):
message = 'Git Status:\n'
is_clean = False
if len(m_unm) != 0:
message = message + '\nunmerged:\n'
for i in range(len(m_unm)):
message = message + '\t' + m_unm[i] + '\n'
if len(m_mod) != 0:
message = message + '\nmodified:\n'
for i in range(len(m_mod)):
message = message + '\t' + m_mod[i] + '\n'
if len(m_del) != 0:
message = message + '\ndeleted:\n'
for i in range(len(m_del)):
message = message + '\t' + m_del[i] + '\n'
if len(m_add) != 0:
message = message + '\nuntracked:\n'
for i in range(len(m_add)):
message = message + '\t' + m_add[i] + '\n'
if len(m_unm) == 0 and len(m_mod) == 0 and (len(m_del) == 0) and (len(m_add) == 0):
message = message + '\nnothing to commit, working tree clean\n'
is_clean = True
return (message, is_clean) |
_base_ = "./resnest50d_AugCosyAAEGray_BG05_visib10_mlBCE_DoubleMask_ycbvPbr100e_SO_01_02MasterChefCan.py"
OUTPUT_DIR = (
"output/gdrn/ycbvPbrSO/resnest50d_AugCosyAAEGray_BG05_visib10_mlBCE_DoubleMask_ycbvPbr100e_SO/04_05TomatoSoupCan"
)
DATASETS = dict(TRAIN=("ycbv_005_tomato_soup_can_train_pbr",))
| _base_ = './resnest50d_AugCosyAAEGray_BG05_visib10_mlBCE_DoubleMask_ycbvPbr100e_SO_01_02MasterChefCan.py'
output_dir = 'output/gdrn/ycbvPbrSO/resnest50d_AugCosyAAEGray_BG05_visib10_mlBCE_DoubleMask_ycbvPbr100e_SO/04_05TomatoSoupCan'
datasets = dict(TRAIN=('ycbv_005_tomato_soup_can_train_pbr',)) |
def capitalizeWord(word):
c= word[0].upper()+word[1:]
return c
def capitalizeWord1(word):
return word[0].upper() + word[1:] | def capitalize_word(word):
c = word[0].upper() + word[1:]
return c
def capitalize_word1(word):
return word[0].upper() + word[1:] |
print("Hello! Running this after a connection is stablished.")
## Example: get files generated in remote host during the session:
"""
remote_origin = "/home/vagrant/.xxh/.xxh/shells/xxh-shell-xonsh/build/../../../../.local/share/xonsh/my_data"
local_destination = "/my_directory"
bash_wrap_begin = "bash -c 'shopt -s dotglob && "
bash_wrap_end = "'"
shell_build_dir = self.local_xxh_home / '.xxh/shells' / self.shell / 'build'
copy_method = None
if opt.copy_method:
copy_method = opt.copy_method
if self.local:
copy_method = 'cp'
if copy_method == 'rsync' or (copy_method is None and which('rsync') and host_info['rsync']):
self.eprint('Retrieving remote logs.')
rsync = "rsync {ssh_arg_v} -e \"{sshpass} {ssh} {ssh_arg_v} {ssh_arguments}\" {arg_q} -az {progress} --cvs-exclude --include core ".format(
host_xxh_home=host_xxh_home,
sshpass=A(self.sshpass),
ssh=A(self.ssh_command),
ssh_arg_v=('' if self.ssh_arg_v == [] else '-v'),
ssh_arguments=A(self.ssh_arguments, 0, 3),
arg_q=A(arg_q),
progress=('' if self.quiet or not self.verbose else '--progress')
)
self.S("{bb}{rsync} {host}:{remote_origin} {local_destination} 1>&2{be}".format(
bb=bash_wrap_begin,
be=bash_wrap_end,
rsync=rsync,
host=A(host),
local_destination=local_destination,
remote_origin=remote_origin
))
elif copy_method == 'scp' or (copy_method is None and which('scp') and host_info['scp']):
self.eprint('Retrieving remote logs.')
scp = "{sshpass} {scp_command} {ssh_arg_v} {ssh_arguments} -r -C {arg_q}".format(
sshpass=A(self.sshpass),
scp_command=A(self.scp_command),
ssh_arg_v=A(self.ssh_arg_v),
ssh_arguments=A(self.ssh_arguments, 0, 1),
arg_q=A(arg_q)
)
self.S('{bb}{scp} {host}:{remote_origin} {local_destination} 1>&2{be}'.format(
bb=bash_wrap_begin,
be=bash_wrap_end,
scp=scp,
host=host,
local_destination=local_destination,
remote_origin=remote_origin
))
elif copy_method == 'skip':
if self.verbose:
self.eprint('Skip copying')
else:
self.eprint('Please install rsync or scp!')
""" | print('Hello! Running this after a connection is stablished.')
'\nremote_origin = "/home/vagrant/.xxh/.xxh/shells/xxh-shell-xonsh/build/../../../../.local/share/xonsh/my_data"\nlocal_destination = "/my_directory"\n\nbash_wrap_begin = "bash -c \'shopt -s dotglob && "\nbash_wrap_end = "\'"\n\nshell_build_dir = self.local_xxh_home / \'.xxh/shells\' / self.shell / \'build\'\n\ncopy_method = None\nif opt.copy_method:\n copy_method = opt.copy_method\nif self.local:\n copy_method = \'cp\'\n\nif copy_method == \'rsync\' or (copy_method is None and which(\'rsync\') and host_info[\'rsync\']):\n self.eprint(\'Retrieving remote logs.\')\n\n rsync = "rsync {ssh_arg_v} -e "{sshpass} {ssh} {ssh_arg_v} {ssh_arguments}" {arg_q} -az {progress} --cvs-exclude --include core ".format(\n host_xxh_home=host_xxh_home,\n sshpass=A(self.sshpass),\n ssh=A(self.ssh_command),\n ssh_arg_v=(\'\' if self.ssh_arg_v == [] else \'-v\'),\n ssh_arguments=A(self.ssh_arguments, 0, 3),\n arg_q=A(arg_q),\n progress=(\'\' if self.quiet or not self.verbose else \'--progress\')\n )\n\n self.S("{bb}{rsync} {host}:{remote_origin} {local_destination} 1>&2{be}".format(\n bb=bash_wrap_begin,\n be=bash_wrap_end,\n rsync=rsync,\n host=A(host),\n local_destination=local_destination,\n remote_origin=remote_origin\n ))\nelif copy_method == \'scp\' or (copy_method is None and which(\'scp\') and host_info[\'scp\']):\n self.eprint(\'Retrieving remote logs.\')\n scp = "{sshpass} {scp_command} {ssh_arg_v} {ssh_arguments} -r -C {arg_q}".format(\n sshpass=A(self.sshpass),\n scp_command=A(self.scp_command),\n ssh_arg_v=A(self.ssh_arg_v),\n ssh_arguments=A(self.ssh_arguments, 0, 1),\n arg_q=A(arg_q)\n )\n\n self.S(\'{bb}{scp} {host}:{remote_origin} {local_destination} 1>&2{be}\'.format(\n bb=bash_wrap_begin,\n be=bash_wrap_end,\n scp=scp,\n host=host,\n local_destination=local_destination,\n remote_origin=remote_origin\n ))\nelif copy_method == \'skip\':\n if self.verbose:\n self.eprint(\'Skip copying\')\nelse:\n self.eprint(\'Please install rsync or scp!\')\n ' |
length=int(input())
list1=list(map(int,input().rstrip().split()))
list1=sorted(list1)
list1=list1[::-1]
count=0
for i in range(length):
a=count+(list1[i]*(2**i))
count=a
print(a)
| length = int(input())
list1 = list(map(int, input().rstrip().split()))
list1 = sorted(list1)
list1 = list1[::-1]
count = 0
for i in range(length):
a = count + list1[i] * 2 ** i
count = a
print(a) |
# https://docs.swift.org/swift-book/ReferenceManual/LexicalStructure.html
KEYWORDS = (
# Keywords used in declarations:
'associatedtype', 'class', 'deinit', 'enum', 'extension', 'fileprivate',
'func', 'import', 'init', 'inout', 'internal', 'let', 'open', 'operator',
'private', 'precedencegroup', 'protocol', 'public', 'rethrows', 'static',
'struct', 'subscript', 'typealias', 'var',
# Keywords used in statements:
'break', 'case', 'catch', 'continue', 'default', 'defer', 'do', 'else',
'fallthrough', 'for', 'guard', 'if', 'in', 'repeat', 'return', 'throw',
'switch',
'where', 'while',
# Keywords used in expressions and types:
'Any', 'as', 'catch', 'false', 'is', 'nil', 'rethrows', 'self', 'Self',
'super', 'throw', 'throws', 'true', 'try'
# Keywords used in patterns: _
# We don't care.
# Keywords that begin with a number sign (#):
'#available', '#colorLiteral', '#column', '#dsohandle', '#elseif', '#else',
'#endif', '#error', '#fileID', '#fileLiteral', '#filePath', '#file',
'#function', '#if', '#imageLiteral', '#keyPath', '#line', '#selector',
'#sourceLocation', '#warning',
# Keywords reserved in particular contexts:
'associativity', 'convenience', 'didSet', 'dynamic', 'final', 'get',
'indirect', 'infix', 'lazy', 'left', 'mutating', 'none', 'nonmutating',
'optional', 'override', 'postfix', 'precedence', 'prefix', 'Protocol',
'required', 'right', 'set', 'some', 'Type', 'unowned', 'weak', 'willSet'
)
def is_swift_keyword(s: str) -> bool:
return s in KEYWORDS
def escape_swift_keyword(s: str) -> str:
if is_swift_keyword(s):
return '`' + s + '`'
return s
| keywords = ('associatedtype', 'class', 'deinit', 'enum', 'extension', 'fileprivate', 'func', 'import', 'init', 'inout', 'internal', 'let', 'open', 'operator', 'private', 'precedencegroup', 'protocol', 'public', 'rethrows', 'static', 'struct', 'subscript', 'typealias', 'var', 'break', 'case', 'catch', 'continue', 'default', 'defer', 'do', 'else', 'fallthrough', 'for', 'guard', 'if', 'in', 'repeat', 'return', 'throw', 'switch', 'where', 'while', 'Any', 'as', 'catch', 'false', 'is', 'nil', 'rethrows', 'self', 'Self', 'super', 'throw', 'throws', 'true', 'try#available', '#colorLiteral', '#column', '#dsohandle', '#elseif', '#else', '#endif', '#error', '#fileID', '#fileLiteral', '#filePath', '#file', '#function', '#if', '#imageLiteral', '#keyPath', '#line', '#selector', '#sourceLocation', '#warning', 'associativity', 'convenience', 'didSet', 'dynamic', 'final', 'get', 'indirect', 'infix', 'lazy', 'left', 'mutating', 'none', 'nonmutating', 'optional', 'override', 'postfix', 'precedence', 'prefix', 'Protocol', 'required', 'right', 'set', 'some', 'Type', 'unowned', 'weak', 'willSet')
def is_swift_keyword(s: str) -> bool:
return s in KEYWORDS
def escape_swift_keyword(s: str) -> str:
if is_swift_keyword(s):
return '`' + s + '`'
return s |
header, *data = DATA
result = []
for row in data:
pair = zip(header, row)
result.append(dict(pair))
| (header, *data) = DATA
result = []
for row in data:
pair = zip(header, row)
result.append(dict(pair)) |
#!/usr/bin/python3
# -*- coding: cp949 -*-
def solution(n: int, words: [str]) -> [int]:
ans = [0, 0]
prev = words[0]
history = [words[0]]
pid = 0
turn = 0
for word in words[1:]:
pid = (pid + 1) % n
turn += 1
if prev[-1] != word[0] or word in history:
ans = [pid + 1, int((turn / n) + 1)]
break
prev = word
history.append(word)
return ans
| def solution(n: int, words: [str]) -> [int]:
ans = [0, 0]
prev = words[0]
history = [words[0]]
pid = 0
turn = 0
for word in words[1:]:
pid = (pid + 1) % n
turn += 1
if prev[-1] != word[0] or word in history:
ans = [pid + 1, int(turn / n + 1)]
break
prev = word
history.append(word)
return ans |
# color.py
# string is the original string
# type determines the color/label added
# style can be color or text
class color(object):
GREEN = '\033[92m'
WARNING = '\033[93m'
FAIL = '\033[91m'
ENDC = '\033[0m'
BOLD = '\033[1m'
def format(self, string, type, style='color'):
formatted_string = ''
string = str(string)
if style == 'color':
if type in ('success', 'pass'):
formatted_string += self.GREEN + string + self.ENDC
elif type == 'warning':
formatted_string += self.WARNING + string + self.ENDC
elif type in ('error', 'fail'):
formatted_string += self.FAIL + string + self.ENDC
elif style == 'text':
if type == 'success':
formatted_string += string
elif type == 'warning':
formatted_string += 'WARNING: ' + string
elif type == 'error':
formatted_string += 'ERROR: ' + string
return formatted_string
| class Color(object):
green = '\x1b[92m'
warning = '\x1b[93m'
fail = '\x1b[91m'
endc = '\x1b[0m'
bold = '\x1b[1m'
def format(self, string, type, style='color'):
formatted_string = ''
string = str(string)
if style == 'color':
if type in ('success', 'pass'):
formatted_string += self.GREEN + string + self.ENDC
elif type == 'warning':
formatted_string += self.WARNING + string + self.ENDC
elif type in ('error', 'fail'):
formatted_string += self.FAIL + string + self.ENDC
elif style == 'text':
if type == 'success':
formatted_string += string
elif type == 'warning':
formatted_string += 'WARNING: ' + string
elif type == 'error':
formatted_string += 'ERROR: ' + string
return formatted_string |
"""
Construct removes deletes from a list
"""
def filterList(values, filter):
""""
Returns a new list based on the filter.
:param list values:
:param list-of-bool filter: remove from list if ele is True
:return list:
"""
return [x for (x, b) in zip(values, filter) if not b]
| """
Construct removes deletes from a list
"""
def filter_list(values, filter):
""""
Returns a new list based on the filter.
:param list values:
:param list-of-bool filter: remove from list if ele is True
:return list:
"""
return [x for (x, b) in zip(values, filter) if not b] |
"""Frequently used constants for tokenization."""
# Special tokens.
PAD = "[PAD]"
OOV = "[OOV]"
START = "[START]"
END = "[END]" | """Frequently used constants for tokenization."""
pad = '[PAD]'
oov = '[OOV]'
start = '[START]'
end = '[END]' |
class Query(object):
def __init__(self, session_id, time_passed, query_id, region_id, documents):
self.query_id = query_id
self.session_id = session_id
self.time_passed = time_passed
self.region_id = region_id
self.documents = documents
def add_documents(self, documents):
self.documents.append(documents)
class Click(object):
def __init__(self, session_id, time_passed, document_id):
self.session_id = session_id
self.document_id = document_id
self.time_passed = time_passed
data = []
with open('YandexRelPredChallenge.txt') as f:
for row in f:
row_data = row.split('\t')
row_data = [col.strip() for col in row_data]
if row_data[2] == 'C':
click = Click(session_id=row_data[0], time_passed=row_data[1],
document_id=row_data[3])
data.append((row_data[0], click))
else:
docs = [row_data[i] for i in range(5, len(row_data))]
query = Query(session_id=row_data[0], time_passed=row_data[1],
query_id=row_data[3], region_id=row_data[4], documents=docs)
data.append((row_data[0], query))
# Test to see if in all session where a query id is repeated,
# if the list of document is different, it has to be completely different
# otherwise it has to be completely identical, in which case we simply have a duplicate
# and the user just hit submit again.
# Counter for identical queries
same_documents = 0
same_doc_sessions = {}
# New documents, i.e. pagination
paginated_documents = 0
paginated_sessions = {}
# This should be 0 always, same query in same session
# only some documents different.
problematic_queries = 0
prob_sessions = {}
index = 0
while index < len(data):
element = data[index]
curr_session = element[0]
curr_index = index
queries = []
query_positions = {}
while curr_session == element[0]:
if isinstance(data[curr_index][1], Query):
query = data[curr_index][1]
if query.query_id in query_positions:
# Found a duplicate, it is either the exact same
# query (i.e. same documents), or the next page of
# that query. Test to see which one
current_position = curr_index
last_query, last_position = query_positions[query.query_id]
# Check if all documents are the same
all_same = True
for j in range(10):
if last_query.documents[j] != query.documents[j]:
all_same = False
break
if all_same:
same_documents += 1
same_doc_sessions[curr_session] = True
all_different = True
for j in range(10):
if last_query.documents[j] == query.documents[j]:
all_different = False
break
if all_different:
paginated_documents += 1
paginated_sessions[curr_session] = True
if not all_same and not all_different:
problematic_queries += 1
prob_sessions[curr_session] = True
else:
queries.append(query)
query_positions[query.query_id] = (query, curr_index)
curr_index += 1
if curr_index < len(data):
curr_session = data[curr_index][0]
else:
curr_session = None
index = curr_index | class Query(object):
def __init__(self, session_id, time_passed, query_id, region_id, documents):
self.query_id = query_id
self.session_id = session_id
self.time_passed = time_passed
self.region_id = region_id
self.documents = documents
def add_documents(self, documents):
self.documents.append(documents)
class Click(object):
def __init__(self, session_id, time_passed, document_id):
self.session_id = session_id
self.document_id = document_id
self.time_passed = time_passed
data = []
with open('YandexRelPredChallenge.txt') as f:
for row in f:
row_data = row.split('\t')
row_data = [col.strip() for col in row_data]
if row_data[2] == 'C':
click = click(session_id=row_data[0], time_passed=row_data[1], document_id=row_data[3])
data.append((row_data[0], click))
else:
docs = [row_data[i] for i in range(5, len(row_data))]
query = query(session_id=row_data[0], time_passed=row_data[1], query_id=row_data[3], region_id=row_data[4], documents=docs)
data.append((row_data[0], query))
same_documents = 0
same_doc_sessions = {}
paginated_documents = 0
paginated_sessions = {}
problematic_queries = 0
prob_sessions = {}
index = 0
while index < len(data):
element = data[index]
curr_session = element[0]
curr_index = index
queries = []
query_positions = {}
while curr_session == element[0]:
if isinstance(data[curr_index][1], Query):
query = data[curr_index][1]
if query.query_id in query_positions:
current_position = curr_index
(last_query, last_position) = query_positions[query.query_id]
all_same = True
for j in range(10):
if last_query.documents[j] != query.documents[j]:
all_same = False
break
if all_same:
same_documents += 1
same_doc_sessions[curr_session] = True
all_different = True
for j in range(10):
if last_query.documents[j] == query.documents[j]:
all_different = False
break
if all_different:
paginated_documents += 1
paginated_sessions[curr_session] = True
if not all_same and (not all_different):
problematic_queries += 1
prob_sessions[curr_session] = True
else:
queries.append(query)
query_positions[query.query_id] = (query, curr_index)
curr_index += 1
if curr_index < len(data):
curr_session = data[curr_index][0]
else:
curr_session = None
index = curr_index |
# Definition for singly-linked list.
# class ListNode:
# def __init__(self, val=0, next=None):
# self.val = val
# self.next = next
class Solution:
def splitListToParts(self, head: ListNode, k: int) -> List[ListNode]:
n = 0
newhead = head
while newhead:
newhead = newhead.next
n += 1
lenList = [n // k] * k
for i in range(n % k):
lenList[i] += 1
ans = []
for ll in lenList:
ans.append(head)
while ll:
pre = head
head = head.next
ll -= 1
try:
pre.next = None
except:
pass
return ans
| class Solution:
def split_list_to_parts(self, head: ListNode, k: int) -> List[ListNode]:
n = 0
newhead = head
while newhead:
newhead = newhead.next
n += 1
len_list = [n // k] * k
for i in range(n % k):
lenList[i] += 1
ans = []
for ll in lenList:
ans.append(head)
while ll:
pre = head
head = head.next
ll -= 1
try:
pre.next = None
except:
pass
return ans |
# Sets - A set is an unordered collection of unique and immutable objects.
# Sets are mutable because you add object to it.
# Sample Sets
set_nums = {1, 5, 2, 4, 4, 5}
set_names = {'John', 'Kim', 'Kelly', 'Dora', 'Kim'}
set_cities = set(('Boston', 'Chicago', 'Houston', 'Denver', 'Boston', 'Houston', 'Denver', 'Miami'))
# printing
print(set_nums)
print(set_names)
print(set_cities)
| set_nums = {1, 5, 2, 4, 4, 5}
set_names = {'John', 'Kim', 'Kelly', 'Dora', 'Kim'}
set_cities = set(('Boston', 'Chicago', 'Houston', 'Denver', 'Boston', 'Houston', 'Denver', 'Miami'))
print(set_nums)
print(set_names)
print(set_cities) |
class WaitBot:
def __init__(self):
self.iteration = 0
self.minute = 0
self.do_something_after = 0
| class Waitbot:
def __init__(self):
self.iteration = 0
self.minute = 0
self.do_something_after = 0 |
vendors = ['johnson', 'siemens', 'tridium']
scripts = [{
}]
def get_vendor(vendor_key):
for name in vendors:
if name in vendor_key.lower():
return name
return ''
| vendors = ['johnson', 'siemens', 'tridium']
scripts = [{}]
def get_vendor(vendor_key):
for name in vendors:
if name in vendor_key.lower():
return name
return '' |
#
# PySNMP MIB module IEEE8021-AS-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/IEEE8021-AS-MIB
# Produced by pysmi-0.3.4 at Mon Apr 29 19:40:30 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 (default, Mar 27 2019, 09:23:15)
#
OctetString, Integer, ObjectIdentifier = mibBuilder.importSymbols("ASN1", "OctetString", "Integer", "ObjectIdentifier")
NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues")
ValueSizeConstraint, ConstraintsIntersection, SingleValueConstraint, ValueRangeConstraint, ConstraintsUnion = mibBuilder.importSymbols("ASN1-REFINEMENT", "ValueSizeConstraint", "ConstraintsIntersection", "SingleValueConstraint", "ValueRangeConstraint", "ConstraintsUnion")
IEEE8021BridgePortNumber, = mibBuilder.importSymbols("IEEE8021-TC-MIB", "IEEE8021BridgePortNumber")
ifGeneralInformationGroup, InterfaceIndexOrZero = mibBuilder.importSymbols("IF-MIB", "ifGeneralInformationGroup", "InterfaceIndexOrZero")
ObjectGroup, ModuleCompliance, NotificationGroup = mibBuilder.importSymbols("SNMPv2-CONF", "ObjectGroup", "ModuleCompliance", "NotificationGroup")
MibIdentifier, Gauge32, ObjectIdentity, MibScalar, MibTable, MibTableRow, MibTableColumn, NotificationType, Counter32, Bits, Integer32, ModuleIdentity, iso, TimeTicks, Counter64, IpAddress, Unsigned32 = mibBuilder.importSymbols("SNMPv2-SMI", "MibIdentifier", "Gauge32", "ObjectIdentity", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "NotificationType", "Counter32", "Bits", "Integer32", "ModuleIdentity", "iso", "TimeTicks", "Counter64", "IpAddress", "Unsigned32")
TextualConvention, DisplayString, RowStatus, TimeStamp, TruthValue = mibBuilder.importSymbols("SNMPv2-TC", "TextualConvention", "DisplayString", "RowStatus", "TimeStamp", "TruthValue")
ieee8021AsTimeSyncMib = ModuleIdentity((1, 3, 111, 2, 802, 1, 1, 20))
ieee8021AsTimeSyncMib.setRevisions(('2012-12-12 00:00', '2010-11-11 00:00',))
if mibBuilder.loadTexts: ieee8021AsTimeSyncMib.setLastUpdated('201212120000Z')
if mibBuilder.loadTexts: ieee8021AsTimeSyncMib.setOrganization('IEEE 802.1 Working Group')
ieee8021AsMIBObjects = MibIdentifier((1, 3, 111, 2, 802, 1, 1, 20, 1))
ieee8021AsConformance = MibIdentifier((1, 3, 111, 2, 802, 1, 1, 20, 2))
class ClockIdentity(TextualConvention, OctetString):
reference = '6.3.3.6 and 8.5.2.2.1'
status = 'current'
displayHint = '1x:'
subtypeSpec = OctetString.subtypeSpec + ValueSizeConstraint(8, 8)
fixedLength = 8
class IEEE8021ASClockClassValue(TextualConvention, Integer32):
reference = '14.2.3 and IEEE Std 1588-2008 7.6.2.4'
status = 'current'
subtypeSpec = Integer32.subtypeSpec + ConstraintsUnion(SingleValueConstraint(6, 7, 13, 14, 52, 58, 187, 193, 248, 255))
namedValues = NamedValues(("primarySync", 6), ("primarySyncLost", 7), ("applicationSpecificSync", 13), ("applicationSpecficSyncLost", 14), ("primarySyncAlternativeA", 52), ("applicationSpecificAlternativeA", 58), ("primarySyncAlternativeB", 187), ("applicationSpecficAlternativeB", 193), ("defaultClock", 248), ("slaveOnlyClock", 255))
class IEEE8021ASClockAccuracyValue(TextualConvention, Integer32):
reference = '8.6.2.3'
status = 'current'
subtypeSpec = Integer32.subtypeSpec + ConstraintsUnion(SingleValueConstraint(32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 254))
namedValues = NamedValues(("timeAccurateTo25ns", 32), ("timeAccurateTo100ns", 33), ("timeAccurateTo250ns", 34), ("timeAccurateTo1us", 35), ("timeAccurateTo2dot5us", 36), ("timeAccurateTo10us", 37), ("timeAccurateTo25us", 38), ("timeAccurateTo100us", 39), ("timeAccurateTo250us", 40), ("timeAccurateTo1ms", 41), ("timeAccurateTo2dot5ms", 42), ("timeAccurateTo10ms", 43), ("timeAccurateTo25ms", 44), ("timeAccurateTo100ms", 45), ("timeAccurateTo250ms", 46), ("timeAccurateTo1s", 47), ("timeAccurateTo10s", 48), ("timeAccurateToGT10s", 49), ("timeAccurateToUnknown", 254))
class IEEE8021ASTimeSourceValue(TextualConvention, Integer32):
reference = '8.6.2.7 and Table 8-3'
status = 'current'
subtypeSpec = Integer32.subtypeSpec + ConstraintsUnion(SingleValueConstraint(16, 32, 48, 64, 80, 96, 144, 160))
namedValues = NamedValues(("atomicClock", 16), ("gps", 32), ("terrestrialRadio", 48), ("ptp", 64), ("ntp", 80), ("handSet", 96), ("other", 144), ("internalOscillator", 160))
ieee8021AsDefaultDS = MibIdentifier((1, 3, 111, 2, 802, 1, 1, 20, 1, 1))
ieee8021AsDefaultDSClockIdentity = MibScalar((1, 3, 111, 2, 802, 1, 1, 20, 1, 1, 1), ClockIdentity()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ieee8021AsDefaultDSClockIdentity.setStatus('current')
ieee8021AsDefaultDSNumberPorts = MibScalar((1, 3, 111, 2, 802, 1, 1, 20, 1, 1, 2), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(0, 255))).setMaxAccess("readonly")
if mibBuilder.loadTexts: ieee8021AsDefaultDSNumberPorts.setStatus('current')
ieee8021AsDefaultDSClockClass = MibScalar((1, 3, 111, 2, 802, 1, 1, 20, 1, 1, 3), IEEE8021ASClockClassValue().clone('defaultClock')).setMaxAccess("readonly")
if mibBuilder.loadTexts: ieee8021AsDefaultDSClockClass.setStatus('current')
ieee8021AsDefaultDSClockAccuracy = MibScalar((1, 3, 111, 2, 802, 1, 1, 20, 1, 1, 4), IEEE8021ASClockAccuracyValue()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ieee8021AsDefaultDSClockAccuracy.setStatus('current')
ieee8021AsDefaultDSOffsetScaledLogVariance = MibScalar((1, 3, 111, 2, 802, 1, 1, 20, 1, 1, 5), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(0, 65535))).setMaxAccess("readonly")
if mibBuilder.loadTexts: ieee8021AsDefaultDSOffsetScaledLogVariance.setStatus('current')
ieee8021AsDefaultDSPriority1 = MibScalar((1, 3, 111, 2, 802, 1, 1, 20, 1, 1, 6), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(0, 255))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: ieee8021AsDefaultDSPriority1.setStatus('current')
ieee8021AsDefaultDSPriority2 = MibScalar((1, 3, 111, 2, 802, 1, 1, 20, 1, 1, 7), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(0, 255)).clone(248)).setMaxAccess("readwrite")
if mibBuilder.loadTexts: ieee8021AsDefaultDSPriority2.setStatus('current')
ieee8021AsDefaultDSGmCapable = MibScalar((1, 3, 111, 2, 802, 1, 1, 20, 1, 1, 8), TruthValue()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ieee8021AsDefaultDSGmCapable.setStatus('current')
ieee8021AsDefaultDSCurrentUTCOffset = MibScalar((1, 3, 111, 2, 802, 1, 1, 20, 1, 1, 9), Integer32().subtype(subtypeSpec=ValueRangeConstraint(-32768, 32767))).setUnits('seconds').setMaxAccess("readonly")
if mibBuilder.loadTexts: ieee8021AsDefaultDSCurrentUTCOffset.setStatus('current')
ieee8021AsDefaultDSCurrentUTCOffsetValid = MibScalar((1, 3, 111, 2, 802, 1, 1, 20, 1, 1, 10), TruthValue()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ieee8021AsDefaultDSCurrentUTCOffsetValid.setStatus('current')
ieee8021AsDefaultDSLeap59 = MibScalar((1, 3, 111, 2, 802, 1, 1, 20, 1, 1, 11), TruthValue()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ieee8021AsDefaultDSLeap59.setStatus('current')
ieee8021AsDefaultDSLeap61 = MibScalar((1, 3, 111, 2, 802, 1, 1, 20, 1, 1, 12), TruthValue()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ieee8021AsDefaultDSLeap61.setStatus('current')
ieee8021AsDefaultDSTimeTraceable = MibScalar((1, 3, 111, 2, 802, 1, 1, 20, 1, 1, 13), TruthValue()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ieee8021AsDefaultDSTimeTraceable.setStatus('current')
ieee8021AsDefaultDSFrequencyTraceable = MibScalar((1, 3, 111, 2, 802, 1, 1, 20, 1, 1, 14), TruthValue()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ieee8021AsDefaultDSFrequencyTraceable.setStatus('current')
ieee8021AsDefaultDSTimeSource = MibScalar((1, 3, 111, 2, 802, 1, 1, 20, 1, 1, 15), IEEE8021ASTimeSourceValue()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ieee8021AsDefaultDSTimeSource.setStatus('current')
ieee8021AsCurrentDS = MibIdentifier((1, 3, 111, 2, 802, 1, 1, 20, 1, 2))
ieee8021AsCurrentDSStepsRemoved = MibScalar((1, 3, 111, 2, 802, 1, 1, 20, 1, 2, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(-32768, 32767))).setMaxAccess("readonly")
if mibBuilder.loadTexts: ieee8021AsCurrentDSStepsRemoved.setStatus('current')
ieee8021AsCurrentDSOffsetFromMasterHs = MibScalar((1, 3, 111, 2, 802, 1, 1, 20, 1, 2, 2), Integer32()).setUnits('2**-16 ns * 2**64').setMaxAccess("readonly")
if mibBuilder.loadTexts: ieee8021AsCurrentDSOffsetFromMasterHs.setStatus('current')
ieee8021AsCurrentDSOffsetFromMasterMs = MibScalar((1, 3, 111, 2, 802, 1, 1, 20, 1, 2, 3), Integer32()).setUnits('2**-16 ns * 2**32').setMaxAccess("readonly")
if mibBuilder.loadTexts: ieee8021AsCurrentDSOffsetFromMasterMs.setStatus('current')
ieee8021AsCurrentDSOffsetFromMasterLs = MibScalar((1, 3, 111, 2, 802, 1, 1, 20, 1, 2, 4), Integer32()).setUnits('2**-16 ns').setMaxAccess("readonly")
if mibBuilder.loadTexts: ieee8021AsCurrentDSOffsetFromMasterLs.setStatus('current')
ieee8021AsCurrentDSLastGmPhaseChangeHs = MibScalar((1, 3, 111, 2, 802, 1, 1, 20, 1, 2, 5), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ieee8021AsCurrentDSLastGmPhaseChangeHs.setStatus('current')
ieee8021AsCurrentDSLastGmPhaseChangeMs = MibScalar((1, 3, 111, 2, 802, 1, 1, 20, 1, 2, 6), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ieee8021AsCurrentDSLastGmPhaseChangeMs.setStatus('current')
ieee8021AsCurrentDSLastGmPhaseChangeLs = MibScalar((1, 3, 111, 2, 802, 1, 1, 20, 1, 2, 7), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ieee8021AsCurrentDSLastGmPhaseChangeLs.setStatus('current')
ieee8021AsCurrentDSLastGmFreqChangeMs = MibScalar((1, 3, 111, 2, 802, 1, 1, 20, 1, 2, 8), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ieee8021AsCurrentDSLastGmFreqChangeMs.setStatus('current')
ieee8021AsCurrentDSLastGmFreqChangeLs = MibScalar((1, 3, 111, 2, 802, 1, 1, 20, 1, 2, 9), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ieee8021AsCurrentDSLastGmFreqChangeLs.setStatus('current')
ieee8021AsCurrentDSGmTimebaseIndicator = MibScalar((1, 3, 111, 2, 802, 1, 1, 20, 1, 2, 10), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(0, 65535))).setMaxAccess("readonly")
if mibBuilder.loadTexts: ieee8021AsCurrentDSGmTimebaseIndicator.setStatus('current')
ieee8021AsCurrentDSGmChangeCount = MibScalar((1, 3, 111, 2, 802, 1, 1, 20, 1, 2, 11), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ieee8021AsCurrentDSGmChangeCount.setStatus('current')
ieee8021AsCurrentDSTimeOfLastGmChangeEvent = MibScalar((1, 3, 111, 2, 802, 1, 1, 20, 1, 2, 12), TimeStamp()).setUnits('0.01 seconds').setMaxAccess("readonly")
if mibBuilder.loadTexts: ieee8021AsCurrentDSTimeOfLastGmChangeEvent.setStatus('current')
ieee8021AsCurrentDSTimeOfLastGmFreqChangeEvent = MibScalar((1, 3, 111, 2, 802, 1, 1, 20, 1, 2, 13), TimeStamp()).setUnits('0.01 seconds').setMaxAccess("readonly")
if mibBuilder.loadTexts: ieee8021AsCurrentDSTimeOfLastGmFreqChangeEvent.setStatus('current')
ieee8021AsCurrentDSTimeOfLastGmPhaseChangeEvent = MibScalar((1, 3, 111, 2, 802, 1, 1, 20, 1, 2, 14), TimeStamp()).setUnits('0.01 seconds').setMaxAccess("readonly")
if mibBuilder.loadTexts: ieee8021AsCurrentDSTimeOfLastGmPhaseChangeEvent.setStatus('current')
ieee8021AsParentDS = MibIdentifier((1, 3, 111, 2, 802, 1, 1, 20, 1, 3))
ieee8021AsParentDSParentClockIdentity = MibScalar((1, 3, 111, 2, 802, 1, 1, 20, 1, 3, 1), ClockIdentity()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ieee8021AsParentDSParentClockIdentity.setStatus('current')
ieee8021AsParentDSParentPortNumber = MibScalar((1, 3, 111, 2, 802, 1, 1, 20, 1, 3, 2), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(0, 65535))).setMaxAccess("readonly")
if mibBuilder.loadTexts: ieee8021AsParentDSParentPortNumber.setStatus('current')
ieee8021AsParentDSCumlativeRateRatio = MibScalar((1, 3, 111, 2, 802, 1, 1, 20, 1, 3, 3), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ieee8021AsParentDSCumlativeRateRatio.setStatus('current')
ieee8021AsParentDSGrandmasterIdentity = MibScalar((1, 3, 111, 2, 802, 1, 1, 20, 1, 3, 4), ClockIdentity()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ieee8021AsParentDSGrandmasterIdentity.setStatus('current')
ieee8021AsParentDSGrandmasterClockClass = MibScalar((1, 3, 111, 2, 802, 1, 1, 20, 1, 3, 5), IEEE8021ASClockClassValue()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ieee8021AsParentDSGrandmasterClockClass.setStatus('current')
ieee8021AsParentDSGrandmasterClockAccuracy = MibScalar((1, 3, 111, 2, 802, 1, 1, 20, 1, 3, 6), IEEE8021ASClockAccuracyValue()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ieee8021AsParentDSGrandmasterClockAccuracy.setStatus('current')
ieee8021AsParentDSGrandmasterOffsetScaledLogVariance = MibScalar((1, 3, 111, 2, 802, 1, 1, 20, 1, 3, 7), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(0, 65535))).setMaxAccess("readonly")
if mibBuilder.loadTexts: ieee8021AsParentDSGrandmasterOffsetScaledLogVariance.setStatus('current')
ieee8021AsParentDSGrandmasterPriority1 = MibScalar((1, 3, 111, 2, 802, 1, 1, 20, 1, 3, 8), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(0, 255))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: ieee8021AsParentDSGrandmasterPriority1.setStatus('current')
ieee8021AsParentDSGrandmasterPriority2 = MibScalar((1, 3, 111, 2, 802, 1, 1, 20, 1, 3, 9), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(0, 255))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: ieee8021AsParentDSGrandmasterPriority2.setStatus('current')
ieee8021AsTimePropertiesDS = MibIdentifier((1, 3, 111, 2, 802, 1, 1, 20, 1, 4))
ieee8021AsTimePropertiesDSCurrentUtcOffset = MibScalar((1, 3, 111, 2, 802, 1, 1, 20, 1, 4, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(-32768, 32767))).setUnits('seconds').setMaxAccess("readonly")
if mibBuilder.loadTexts: ieee8021AsTimePropertiesDSCurrentUtcOffset.setStatus('current')
ieee8021AsTimePropertiesDSCurrentUtcOffsetValid = MibScalar((1, 3, 111, 2, 802, 1, 1, 20, 1, 4, 2), TruthValue()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ieee8021AsTimePropertiesDSCurrentUtcOffsetValid.setStatus('current')
ieee8021AsTimePropertiesDSLeap59 = MibScalar((1, 3, 111, 2, 802, 1, 1, 20, 1, 4, 3), TruthValue()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ieee8021AsTimePropertiesDSLeap59.setStatus('current')
ieee8021AsTimePropertiesDSLeap61 = MibScalar((1, 3, 111, 2, 802, 1, 1, 20, 1, 4, 4), TruthValue()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ieee8021AsTimePropertiesDSLeap61.setStatus('current')
ieee8021AsTimePropertiesDSTimeTraceable = MibScalar((1, 3, 111, 2, 802, 1, 1, 20, 1, 4, 5), TruthValue()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ieee8021AsTimePropertiesDSTimeTraceable.setStatus('current')
ieee8021AsTimePropertiesDSFrequencyTraceable = MibScalar((1, 3, 111, 2, 802, 1, 1, 20, 1, 4, 6), TruthValue()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ieee8021AsTimePropertiesDSFrequencyTraceable.setStatus('current')
ieee8021AsTimePropertiesDSTimeSource = MibScalar((1, 3, 111, 2, 802, 1, 1, 20, 1, 4, 7), IEEE8021ASTimeSourceValue()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ieee8021AsTimePropertiesDSTimeSource.setStatus('current')
ieee8021AsPortDSIfTable = MibTable((1, 3, 111, 2, 802, 1, 1, 20, 1, 5), )
if mibBuilder.loadTexts: ieee8021AsPortDSIfTable.setStatus('current')
ieee8021AsPortDSIfEntry = MibTableRow((1, 3, 111, 2, 802, 1, 1, 20, 1, 5, 1), ).setIndexNames((0, "IEEE8021-AS-MIB", "ieee8021AsBridgeBasePort"), (0, "IEEE8021-AS-MIB", "ieee8021AsPortDSAsIfIndex"))
if mibBuilder.loadTexts: ieee8021AsPortDSIfEntry.setStatus('current')
ieee8021AsBridgeBasePort = MibTableColumn((1, 3, 111, 2, 802, 1, 1, 20, 1, 5, 1, 1), IEEE8021BridgePortNumber())
if mibBuilder.loadTexts: ieee8021AsBridgeBasePort.setStatus('current')
ieee8021AsPortDSAsIfIndex = MibTableColumn((1, 3, 111, 2, 802, 1, 1, 20, 1, 5, 1, 2), InterfaceIndexOrZero())
if mibBuilder.loadTexts: ieee8021AsPortDSAsIfIndex.setStatus('current')
ieee8021AsPortDSClockIdentity = MibTableColumn((1, 3, 111, 2, 802, 1, 1, 20, 1, 5, 1, 3), ClockIdentity()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ieee8021AsPortDSClockIdentity.setStatus('current')
ieee8021AsPortDSPortNumber = MibTableColumn((1, 3, 111, 2, 802, 1, 1, 20, 1, 5, 1, 4), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(0, 65535))).setMaxAccess("readonly")
if mibBuilder.loadTexts: ieee8021AsPortDSPortNumber.setStatus('current')
ieee8021AsPortDSPortRole = MibTableColumn((1, 3, 111, 2, 802, 1, 1, 20, 1, 5, 1, 5), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(3, 6, 7, 9))).clone(namedValues=NamedValues(("disabledPort", 3), ("masterPort", 6), ("passivePort", 7), ("slavePort", 9))).clone(3)).setMaxAccess("readonly")
if mibBuilder.loadTexts: ieee8021AsPortDSPortRole.setStatus('current')
ieee8021AsPortDSPttPortEnabled = MibTableColumn((1, 3, 111, 2, 802, 1, 1, 20, 1, 5, 1, 6), TruthValue().clone(1)).setMaxAccess("readwrite")
if mibBuilder.loadTexts: ieee8021AsPortDSPttPortEnabled.setStatus('current')
ieee8021AsPortDSIsMeasuringDelay = MibTableColumn((1, 3, 111, 2, 802, 1, 1, 20, 1, 5, 1, 7), TruthValue().clone(2)).setMaxAccess("readonly")
if mibBuilder.loadTexts: ieee8021AsPortDSIsMeasuringDelay.setStatus('current')
ieee8021AsPortDSAsCapable = MibTableColumn((1, 3, 111, 2, 802, 1, 1, 20, 1, 5, 1, 8), TruthValue()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ieee8021AsPortDSAsCapable.setStatus('current')
ieee8021AsPortDSNeighborPropDelayHs = MibTableColumn((1, 3, 111, 2, 802, 1, 1, 20, 1, 5, 1, 9), Unsigned32()).setUnits('2**-16 ns * 2**64').setMaxAccess("readonly")
if mibBuilder.loadTexts: ieee8021AsPortDSNeighborPropDelayHs.setStatus('current')
ieee8021AsPortDSNeighborPropDelayMs = MibTableColumn((1, 3, 111, 2, 802, 1, 1, 20, 1, 5, 1, 10), Unsigned32()).setUnits('2**-16 ns * 2**32').setMaxAccess("readonly")
if mibBuilder.loadTexts: ieee8021AsPortDSNeighborPropDelayMs.setStatus('current')
ieee8021AsPortDSNeighborPropDelayLs = MibTableColumn((1, 3, 111, 2, 802, 1, 1, 20, 1, 5, 1, 11), Unsigned32()).setUnits('2**-16 ns').setMaxAccess("readonly")
if mibBuilder.loadTexts: ieee8021AsPortDSNeighborPropDelayLs.setStatus('current')
ieee8021AsPortDSNeighborPropDelayThreshHs = MibTableColumn((1, 3, 111, 2, 802, 1, 1, 20, 1, 5, 1, 12), Unsigned32()).setUnits('2**-16 ns * 2 ** 64').setMaxAccess("readwrite")
if mibBuilder.loadTexts: ieee8021AsPortDSNeighborPropDelayThreshHs.setStatus('current')
ieee8021AsPortDSNeighborPropDelayThreshMs = MibTableColumn((1, 3, 111, 2, 802, 1, 1, 20, 1, 5, 1, 13), Unsigned32()).setUnits('2**-16 ns * 2 ** 32').setMaxAccess("readwrite")
if mibBuilder.loadTexts: ieee8021AsPortDSNeighborPropDelayThreshMs.setStatus('current')
ieee8021AsPortDSNeighborPropDelayThreshLs = MibTableColumn((1, 3, 111, 2, 802, 1, 1, 20, 1, 5, 1, 14), Unsigned32()).setUnits('2**-16 ns').setMaxAccess("readwrite")
if mibBuilder.loadTexts: ieee8021AsPortDSNeighborPropDelayThreshLs.setStatus('current')
ieee8021AsPortDSDelayAsymmetryHs = MibTableColumn((1, 3, 111, 2, 802, 1, 1, 20, 1, 5, 1, 15), Integer32()).setUnits('2**-16 ns * 2**64').setMaxAccess("readwrite")
if mibBuilder.loadTexts: ieee8021AsPortDSDelayAsymmetryHs.setStatus('current')
ieee8021AsPortDSDelayAsymmetryMs = MibTableColumn((1, 3, 111, 2, 802, 1, 1, 20, 1, 5, 1, 16), Unsigned32()).setUnits('2**-16 ns * 2**32').setMaxAccess("readwrite")
if mibBuilder.loadTexts: ieee8021AsPortDSDelayAsymmetryMs.setStatus('current')
ieee8021AsPortDSDelayAsymmetryLs = MibTableColumn((1, 3, 111, 2, 802, 1, 1, 20, 1, 5, 1, 17), Unsigned32()).setUnits('2**-16 ns').setMaxAccess("readwrite")
if mibBuilder.loadTexts: ieee8021AsPortDSDelayAsymmetryLs.setStatus('current')
ieee8021AsPortDSNeighborRateRatio = MibTableColumn((1, 3, 111, 2, 802, 1, 1, 20, 1, 5, 1, 18), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ieee8021AsPortDSNeighborRateRatio.setStatus('current')
ieee8021AsPortDSInitialLogAnnounceInterval = MibTableColumn((1, 3, 111, 2, 802, 1, 1, 20, 1, 5, 1, 19), Integer32().subtype(subtypeSpec=ValueRangeConstraint(-128, 127))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: ieee8021AsPortDSInitialLogAnnounceInterval.setStatus('current')
ieee8021AsPortDSCurrentLogAnnounceInterval = MibTableColumn((1, 3, 111, 2, 802, 1, 1, 20, 1, 5, 1, 20), Integer32().subtype(subtypeSpec=ValueRangeConstraint(-128, 127))).setMaxAccess("readonly")
if mibBuilder.loadTexts: ieee8021AsPortDSCurrentLogAnnounceInterval.setStatus('current')
ieee8021AsPortDSAnnounceReceiptTimeout = MibTableColumn((1, 3, 111, 2, 802, 1, 1, 20, 1, 5, 1, 21), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(0, 255)).clone(2)).setMaxAccess("readwrite")
if mibBuilder.loadTexts: ieee8021AsPortDSAnnounceReceiptTimeout.setStatus('current')
ieee8021AsPortDSInitialLogSyncInterval = MibTableColumn((1, 3, 111, 2, 802, 1, 1, 20, 1, 5, 1, 22), Integer32().subtype(subtypeSpec=ValueRangeConstraint(-128, 127)).clone(-3)).setMaxAccess("readwrite")
if mibBuilder.loadTexts: ieee8021AsPortDSInitialLogSyncInterval.setStatus('current')
ieee8021AsPortDSCurrentLogSyncInterval = MibTableColumn((1, 3, 111, 2, 802, 1, 1, 20, 1, 5, 1, 23), Integer32().subtype(subtypeSpec=ValueRangeConstraint(-128, 127)).clone(-3)).setMaxAccess("readonly")
if mibBuilder.loadTexts: ieee8021AsPortDSCurrentLogSyncInterval.setStatus('current')
ieee8021AsPortDSSyncReceiptTimeout = MibTableColumn((1, 3, 111, 2, 802, 1, 1, 20, 1, 5, 1, 24), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(0, 255)).clone(3)).setMaxAccess("readwrite")
if mibBuilder.loadTexts: ieee8021AsPortDSSyncReceiptTimeout.setStatus('current')
ieee8021AsPortDSSyncReceiptTimeoutTimeIntervalHs = MibTableColumn((1, 3, 111, 2, 802, 1, 1, 20, 1, 5, 1, 25), Unsigned32().clone(0)).setUnits('2**-16 ns').setMaxAccess("readonly")
if mibBuilder.loadTexts: ieee8021AsPortDSSyncReceiptTimeoutTimeIntervalHs.setStatus('current')
ieee8021AsPortDSSyncReceiptTimeoutTimeIntervalMs = MibTableColumn((1, 3, 111, 2, 802, 1, 1, 20, 1, 5, 1, 26), Unsigned32().clone(5722)).setUnits('2**-16 ns * 2**32').setMaxAccess("readonly")
if mibBuilder.loadTexts: ieee8021AsPortDSSyncReceiptTimeoutTimeIntervalMs.setStatus('current')
ieee8021AsPortDSSyncReceiptTimeoutTimeIntervalLs = MibTableColumn((1, 3, 111, 2, 802, 1, 1, 20, 1, 5, 1, 27), Unsigned32().clone(197132288)).setUnits('2**-16 ns').setMaxAccess("readonly")
if mibBuilder.loadTexts: ieee8021AsPortDSSyncReceiptTimeoutTimeIntervalLs.setStatus('current')
ieee8021AsPortDSInitialLogPdelayReqInterval = MibTableColumn((1, 3, 111, 2, 802, 1, 1, 20, 1, 5, 1, 28), Integer32().subtype(subtypeSpec=ValueRangeConstraint(-128, 127))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: ieee8021AsPortDSInitialLogPdelayReqInterval.setStatus('current')
ieee8021AsPortDSCurrentLogPdelayReqInterval = MibTableColumn((1, 3, 111, 2, 802, 1, 1, 20, 1, 5, 1, 29), Integer32().subtype(subtypeSpec=ValueRangeConstraint(-128, 127))).setMaxAccess("readonly")
if mibBuilder.loadTexts: ieee8021AsPortDSCurrentLogPdelayReqInterval.setStatus('current')
ieee8021AsPortDSAllowedLostResponses = MibTableColumn((1, 3, 111, 2, 802, 1, 1, 20, 1, 5, 1, 30), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(0, 65535)).clone(3)).setMaxAccess("readwrite")
if mibBuilder.loadTexts: ieee8021AsPortDSAllowedLostResponses.setStatus('current')
ieee8021AsPortDSVersionNumber = MibTableColumn((1, 3, 111, 2, 802, 1, 1, 20, 1, 5, 1, 31), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(0, 63)).clone(2)).setMaxAccess("readonly")
if mibBuilder.loadTexts: ieee8021AsPortDSVersionNumber.setStatus('current')
ieee8021AsPortDSNupMs = MibTableColumn((1, 3, 111, 2, 802, 1, 1, 20, 1, 5, 1, 32), Unsigned32()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: ieee8021AsPortDSNupMs.setStatus('current')
ieee8021AsPortDSNupLs = MibTableColumn((1, 3, 111, 2, 802, 1, 1, 20, 1, 5, 1, 33), Unsigned32()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: ieee8021AsPortDSNupLs.setStatus('current')
ieee8021AsPortDSNdownMs = MibTableColumn((1, 3, 111, 2, 802, 1, 1, 20, 1, 5, 1, 34), Unsigned32()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: ieee8021AsPortDSNdownMs.setStatus('current')
ieee8021AsPortDSNdownLs = MibTableColumn((1, 3, 111, 2, 802, 1, 1, 20, 1, 5, 1, 35), Unsigned32()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: ieee8021AsPortDSNdownLs.setStatus('current')
ieee8021AsPortDSAcceptableMasterTableEnabled = MibTableColumn((1, 3, 111, 2, 802, 1, 1, 20, 1, 5, 1, 36), TruthValue().clone('false')).setMaxAccess("readwrite")
if mibBuilder.loadTexts: ieee8021AsPortDSAcceptableMasterTableEnabled.setStatus('current')
ieee8021AsPortStatIfTable = MibTable((1, 3, 111, 2, 802, 1, 1, 20, 1, 6), )
if mibBuilder.loadTexts: ieee8021AsPortStatIfTable.setStatus('current')
ieee8021AsPortStatIfEntry = MibTableRow((1, 3, 111, 2, 802, 1, 1, 20, 1, 6, 1), ).setIndexNames((0, "IEEE8021-AS-MIB", "ieee8021AsBridgeBasePort"), (0, "IEEE8021-AS-MIB", "ieee8021AsPortDSAsIfIndex"))
if mibBuilder.loadTexts: ieee8021AsPortStatIfEntry.setStatus('current')
ieee8021AsPortStatRxSyncCount = MibTableColumn((1, 3, 111, 2, 802, 1, 1, 20, 1, 6, 1, 1), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ieee8021AsPortStatRxSyncCount.setStatus('current')
ieee8021AsPortStatRxFollowUpCount = MibTableColumn((1, 3, 111, 2, 802, 1, 1, 20, 1, 6, 1, 2), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ieee8021AsPortStatRxFollowUpCount.setStatus('current')
ieee8021AsPortStatRxPdelayRequest = MibTableColumn((1, 3, 111, 2, 802, 1, 1, 20, 1, 6, 1, 3), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ieee8021AsPortStatRxPdelayRequest.setStatus('current')
ieee8021AsPortStatRxPdelayResponse = MibTableColumn((1, 3, 111, 2, 802, 1, 1, 20, 1, 6, 1, 4), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ieee8021AsPortStatRxPdelayResponse.setStatus('current')
ieee8021AsPortStatRxPdelayResponseFollowUp = MibTableColumn((1, 3, 111, 2, 802, 1, 1, 20, 1, 6, 1, 5), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ieee8021AsPortStatRxPdelayResponseFollowUp.setStatus('current')
ieee8021AsPortStatRxAnnounce = MibTableColumn((1, 3, 111, 2, 802, 1, 1, 20, 1, 6, 1, 6), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ieee8021AsPortStatRxAnnounce.setStatus('current')
ieee8021AsPortStatRxPTPPacketDiscard = MibTableColumn((1, 3, 111, 2, 802, 1, 1, 20, 1, 6, 1, 7), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ieee8021AsPortStatRxPTPPacketDiscard.setStatus('current')
ieee8021AsPortStatRxSyncReceiptTimeouts = MibTableColumn((1, 3, 111, 2, 802, 1, 1, 20, 1, 6, 1, 8), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ieee8021AsPortStatRxSyncReceiptTimeouts.setStatus('current')
ieee8021AsPortStatAnnounceReceiptTimeouts = MibTableColumn((1, 3, 111, 2, 802, 1, 1, 20, 1, 6, 1, 9), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ieee8021AsPortStatAnnounceReceiptTimeouts.setStatus('current')
ieee8021AsPortStatPdelayAllowedLostResponsesExceeded = MibTableColumn((1, 3, 111, 2, 802, 1, 1, 20, 1, 6, 1, 10), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ieee8021AsPortStatPdelayAllowedLostResponsesExceeded.setStatus('current')
ieee8021AsPortStatTxSyncCount = MibTableColumn((1, 3, 111, 2, 802, 1, 1, 20, 1, 6, 1, 11), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ieee8021AsPortStatTxSyncCount.setStatus('current')
ieee8021AsPortStatTxFollowUpCount = MibTableColumn((1, 3, 111, 2, 802, 1, 1, 20, 1, 6, 1, 12), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ieee8021AsPortStatTxFollowUpCount.setStatus('current')
ieee8021AsPortStatTxPdelayRequest = MibTableColumn((1, 3, 111, 2, 802, 1, 1, 20, 1, 6, 1, 13), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ieee8021AsPortStatTxPdelayRequest.setStatus('current')
ieee8021AsPortStatTxPdelayResponse = MibTableColumn((1, 3, 111, 2, 802, 1, 1, 20, 1, 6, 1, 14), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ieee8021AsPortStatTxPdelayResponse.setStatus('current')
ieee8021AsPortStatTxPdelayResponseFollowUp = MibTableColumn((1, 3, 111, 2, 802, 1, 1, 20, 1, 6, 1, 15), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ieee8021AsPortStatTxPdelayResponseFollowUp.setStatus('current')
ieee8021AsPortStatTxAnnounce = MibTableColumn((1, 3, 111, 2, 802, 1, 1, 20, 1, 6, 1, 16), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ieee8021AsPortStatTxAnnounce.setStatus('current')
ieee8021AsAcceptableMasterTableDS = MibIdentifier((1, 3, 111, 2, 802, 1, 1, 20, 1, 7))
ieee8021AsAcceptableMasterTableDSBase = MibIdentifier((1, 3, 111, 2, 802, 1, 1, 20, 1, 7, 1))
ieee8021AsAcceptableMasterTableDSMaster = MibIdentifier((1, 3, 111, 2, 802, 1, 1, 20, 1, 7, 2))
ieee8021AsAcceptableMasterTableDSMaxTableSize = MibScalar((1, 3, 111, 2, 802, 1, 1, 20, 1, 7, 1, 1), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(0, 65535))).setMaxAccess("readonly")
if mibBuilder.loadTexts: ieee8021AsAcceptableMasterTableDSMaxTableSize.setStatus('current')
ieee8021AsAcceptableMasterTableDSActualTableSize = MibScalar((1, 3, 111, 2, 802, 1, 1, 20, 1, 7, 1, 2), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(0, 65535))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: ieee8021AsAcceptableMasterTableDSActualTableSize.setStatus('current')
ieee8021AsAcceptableMasterTableDSMasterTable = MibTable((1, 3, 111, 2, 802, 1, 1, 20, 1, 7, 2, 1), )
if mibBuilder.loadTexts: ieee8021AsAcceptableMasterTableDSMasterTable.setStatus('current')
ieee8021AsAcceptableMasterTableDSMasterEntry = MibTableRow((1, 3, 111, 2, 802, 1, 1, 20, 1, 7, 2, 1, 1), ).setIndexNames((0, "IEEE8021-AS-MIB", "ieee8021AsAcceptableMasterTableDSMasterId"))
if mibBuilder.loadTexts: ieee8021AsAcceptableMasterTableDSMasterEntry.setStatus('current')
ieee8021AsAcceptableMasterTableDSMasterId = MibTableColumn((1, 3, 111, 2, 802, 1, 1, 20, 1, 7, 2, 1, 1, 1), Unsigned32())
if mibBuilder.loadTexts: ieee8021AsAcceptableMasterTableDSMasterId.setStatus('current')
ieee8021AsAcceptableMasterClockIdentity = MibTableColumn((1, 3, 111, 2, 802, 1, 1, 20, 1, 7, 2, 1, 1, 2), ClockIdentity()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: ieee8021AsAcceptableMasterClockIdentity.setStatus('current')
ieee8021AsAcceptableMasterPortNumber = MibTableColumn((1, 3, 111, 2, 802, 1, 1, 20, 1, 7, 2, 1, 1, 3), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(0, 65535))).setMaxAccess("readcreate")
if mibBuilder.loadTexts: ieee8021AsAcceptableMasterPortNumber.setStatus('current')
ieee8021AsAcceptableMasterAlternatePriority1 = MibTableColumn((1, 3, 111, 2, 802, 1, 1, 20, 1, 7, 2, 1, 1, 4), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(0, 255)).clone(244)).setMaxAccess("readcreate")
if mibBuilder.loadTexts: ieee8021AsAcceptableMasterAlternatePriority1.setStatus('current')
ieee8021AsAcceptableMasterRowStatus = MibTableColumn((1, 3, 111, 2, 802, 1, 1, 20, 1, 7, 2, 1, 1, 5), RowStatus()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: ieee8021AsAcceptableMasterRowStatus.setStatus('current')
ieee8021AsCompliances = MibIdentifier((1, 3, 111, 2, 802, 1, 1, 20, 2, 1))
ieee8021AsGroups = MibIdentifier((1, 3, 111, 2, 802, 1, 1, 20, 2, 2))
ieee8021AsCompliancesCor1 = MibIdentifier((1, 3, 111, 2, 802, 1, 1, 20, 2, 3))
ieee8021ASSystemDefaultReqdGroup = ObjectGroup((1, 3, 111, 2, 802, 1, 1, 20, 2, 2, 1)).setObjects(("IEEE8021-AS-MIB", "ieee8021AsDefaultDSClockIdentity"), ("IEEE8021-AS-MIB", "ieee8021AsDefaultDSNumberPorts"), ("IEEE8021-AS-MIB", "ieee8021AsDefaultDSClockClass"), ("IEEE8021-AS-MIB", "ieee8021AsDefaultDSClockAccuracy"), ("IEEE8021-AS-MIB", "ieee8021AsDefaultDSOffsetScaledLogVariance"), ("IEEE8021-AS-MIB", "ieee8021AsDefaultDSPriority1"), ("IEEE8021-AS-MIB", "ieee8021AsDefaultDSPriority2"), ("IEEE8021-AS-MIB", "ieee8021AsDefaultDSGmCapable"), ("IEEE8021-AS-MIB", "ieee8021AsDefaultDSCurrentUTCOffset"), ("IEEE8021-AS-MIB", "ieee8021AsDefaultDSCurrentUTCOffsetValid"), ("IEEE8021-AS-MIB", "ieee8021AsDefaultDSLeap59"), ("IEEE8021-AS-MIB", "ieee8021AsDefaultDSLeap61"), ("IEEE8021-AS-MIB", "ieee8021AsDefaultDSTimeTraceable"), ("IEEE8021-AS-MIB", "ieee8021AsDefaultDSFrequencyTraceable"), ("IEEE8021-AS-MIB", "ieee8021AsDefaultDSTimeSource"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ieee8021ASSystemDefaultReqdGroup = ieee8021ASSystemDefaultReqdGroup.setStatus('current')
ieee8021ASSystemCurrentGroup = ObjectGroup((1, 3, 111, 2, 802, 1, 1, 20, 2, 2, 2)).setObjects(("IEEE8021-AS-MIB", "ieee8021AsCurrentDSStepsRemoved"), ("IEEE8021-AS-MIB", "ieee8021AsCurrentDSOffsetFromMasterHs"), ("IEEE8021-AS-MIB", "ieee8021AsCurrentDSOffsetFromMasterMs"), ("IEEE8021-AS-MIB", "ieee8021AsCurrentDSOffsetFromMasterLs"), ("IEEE8021-AS-MIB", "ieee8021AsCurrentDSLastGmPhaseChangeHs"), ("IEEE8021-AS-MIB", "ieee8021AsCurrentDSLastGmPhaseChangeMs"), ("IEEE8021-AS-MIB", "ieee8021AsCurrentDSLastGmPhaseChangeLs"), ("IEEE8021-AS-MIB", "ieee8021AsCurrentDSLastGmFreqChangeMs"), ("IEEE8021-AS-MIB", "ieee8021AsCurrentDSLastGmFreqChangeLs"), ("IEEE8021-AS-MIB", "ieee8021AsCurrentDSGmTimebaseIndicator"), ("IEEE8021-AS-MIB", "ieee8021AsCurrentDSGmChangeCount"), ("IEEE8021-AS-MIB", "ieee8021AsCurrentDSTimeOfLastGmChangeEvent"), ("IEEE8021-AS-MIB", "ieee8021AsCurrentDSTimeOfLastGmPhaseChangeEvent"), ("IEEE8021-AS-MIB", "ieee8021AsCurrentDSTimeOfLastGmFreqChangeEvent"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ieee8021ASSystemCurrentGroup = ieee8021ASSystemCurrentGroup.setStatus('current')
ieee8021AsSystemClockParentGroup = ObjectGroup((1, 3, 111, 2, 802, 1, 1, 20, 2, 2, 3)).setObjects(("IEEE8021-AS-MIB", "ieee8021AsParentDSParentClockIdentity"), ("IEEE8021-AS-MIB", "ieee8021AsParentDSParentPortNumber"), ("IEEE8021-AS-MIB", "ieee8021AsParentDSCumlativeRateRatio"), ("IEEE8021-AS-MIB", "ieee8021AsParentDSGrandmasterIdentity"), ("IEEE8021-AS-MIB", "ieee8021AsParentDSGrandmasterClockClass"), ("IEEE8021-AS-MIB", "ieee8021AsParentDSGrandmasterClockAccuracy"), ("IEEE8021-AS-MIB", "ieee8021AsParentDSGrandmasterOffsetScaledLogVariance"), ("IEEE8021-AS-MIB", "ieee8021AsParentDSGrandmasterPriority1"), ("IEEE8021-AS-MIB", "ieee8021AsParentDSGrandmasterPriority2"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ieee8021AsSystemClockParentGroup = ieee8021AsSystemClockParentGroup.setStatus('current')
ieee8021AsSystemTimePropertiesGroup = ObjectGroup((1, 3, 111, 2, 802, 1, 1, 20, 2, 2, 4)).setObjects(("IEEE8021-AS-MIB", "ieee8021AsTimePropertiesDSCurrentUtcOffset"), ("IEEE8021-AS-MIB", "ieee8021AsTimePropertiesDSCurrentUtcOffsetValid"), ("IEEE8021-AS-MIB", "ieee8021AsTimePropertiesDSLeap59"), ("IEEE8021-AS-MIB", "ieee8021AsTimePropertiesDSLeap61"), ("IEEE8021-AS-MIB", "ieee8021AsTimePropertiesDSTimeTraceable"), ("IEEE8021-AS-MIB", "ieee8021AsTimePropertiesDSFrequencyTraceable"), ("IEEE8021-AS-MIB", "ieee8021AsTimePropertiesDSTimeSource"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ieee8021AsSystemTimePropertiesGroup = ieee8021AsSystemTimePropertiesGroup.setStatus('current')
ieee8021AsPortDataSetGlobalGroup = ObjectGroup((1, 3, 111, 2, 802, 1, 1, 20, 2, 2, 5)).setObjects(("IEEE8021-AS-MIB", "ieee8021AsPortDSClockIdentity"), ("IEEE8021-AS-MIB", "ieee8021AsPortDSPortNumber"), ("IEEE8021-AS-MIB", "ieee8021AsPortDSPortRole"), ("IEEE8021-AS-MIB", "ieee8021AsPortDSPttPortEnabled"), ("IEEE8021-AS-MIB", "ieee8021AsPortDSIsMeasuringDelay"), ("IEEE8021-AS-MIB", "ieee8021AsPortDSAsCapable"), ("IEEE8021-AS-MIB", "ieee8021AsPortDSNeighborPropDelayHs"), ("IEEE8021-AS-MIB", "ieee8021AsPortDSNeighborPropDelayMs"), ("IEEE8021-AS-MIB", "ieee8021AsPortDSNeighborPropDelayLs"), ("IEEE8021-AS-MIB", "ieee8021AsPortDSNeighborPropDelayThreshHs"), ("IEEE8021-AS-MIB", "ieee8021AsPortDSNeighborPropDelayThreshMs"), ("IEEE8021-AS-MIB", "ieee8021AsPortDSNeighborPropDelayThreshLs"), ("IEEE8021-AS-MIB", "ieee8021AsPortDSDelayAsymmetryHs"), ("IEEE8021-AS-MIB", "ieee8021AsPortDSDelayAsymmetryMs"), ("IEEE8021-AS-MIB", "ieee8021AsPortDSDelayAsymmetryLs"), ("IEEE8021-AS-MIB", "ieee8021AsPortDSNeighborRateRatio"), ("IEEE8021-AS-MIB", "ieee8021AsPortDSInitialLogAnnounceInterval"), ("IEEE8021-AS-MIB", "ieee8021AsPortDSCurrentLogAnnounceInterval"), ("IEEE8021-AS-MIB", "ieee8021AsPortDSAnnounceReceiptTimeout"), ("IEEE8021-AS-MIB", "ieee8021AsPortDSInitialLogSyncInterval"), ("IEEE8021-AS-MIB", "ieee8021AsPortDSCurrentLogSyncInterval"), ("IEEE8021-AS-MIB", "ieee8021AsPortDSSyncReceiptTimeout"), ("IEEE8021-AS-MIB", "ieee8021AsPortDSSyncReceiptTimeoutTimeIntervalHs"), ("IEEE8021-AS-MIB", "ieee8021AsPortDSSyncReceiptTimeoutTimeIntervalMs"), ("IEEE8021-AS-MIB", "ieee8021AsPortDSSyncReceiptTimeoutTimeIntervalLs"), ("IEEE8021-AS-MIB", "ieee8021AsPortDSInitialLogPdelayReqInterval"), ("IEEE8021-AS-MIB", "ieee8021AsPortDSCurrentLogPdelayReqInterval"), ("IEEE8021-AS-MIB", "ieee8021AsPortDSAllowedLostResponses"), ("IEEE8021-AS-MIB", "ieee8021AsPortDSVersionNumber"), ("IEEE8021-AS-MIB", "ieee8021AsPortDSNupMs"), ("IEEE8021-AS-MIB", "ieee8021AsPortDSNupLs"), ("IEEE8021-AS-MIB", "ieee8021AsPortDSNdownMs"), ("IEEE8021-AS-MIB", "ieee8021AsPortDSNdownLs"), ("IEEE8021-AS-MIB", "ieee8021AsPortDSAcceptableMasterTableEnabled"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ieee8021AsPortDataSetGlobalGroup = ieee8021AsPortDataSetGlobalGroup.setStatus('current')
ieee8021ASPortStatisticsGlobalGroup = ObjectGroup((1, 3, 111, 2, 802, 1, 1, 20, 2, 2, 6)).setObjects(("IEEE8021-AS-MIB", "ieee8021AsPortStatRxSyncCount"), ("IEEE8021-AS-MIB", "ieee8021AsPortStatRxFollowUpCount"), ("IEEE8021-AS-MIB", "ieee8021AsPortStatRxPdelayRequest"), ("IEEE8021-AS-MIB", "ieee8021AsPortStatRxPdelayResponse"), ("IEEE8021-AS-MIB", "ieee8021AsPortStatRxPdelayResponseFollowUp"), ("IEEE8021-AS-MIB", "ieee8021AsPortStatRxAnnounce"), ("IEEE8021-AS-MIB", "ieee8021AsPortStatRxPTPPacketDiscard"), ("IEEE8021-AS-MIB", "ieee8021AsPortStatRxSyncReceiptTimeouts"), ("IEEE8021-AS-MIB", "ieee8021AsPortStatAnnounceReceiptTimeouts"), ("IEEE8021-AS-MIB", "ieee8021AsPortStatPdelayAllowedLostResponsesExceeded"), ("IEEE8021-AS-MIB", "ieee8021AsPortStatTxSyncCount"), ("IEEE8021-AS-MIB", "ieee8021AsPortStatTxFollowUpCount"), ("IEEE8021-AS-MIB", "ieee8021AsPortStatTxPdelayRequest"), ("IEEE8021-AS-MIB", "ieee8021AsPortStatTxPdelayResponse"), ("IEEE8021-AS-MIB", "ieee8021AsPortStatTxPdelayResponseFollowUp"), ("IEEE8021-AS-MIB", "ieee8021AsPortStatTxAnnounce"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ieee8021ASPortStatisticsGlobalGroup = ieee8021ASPortStatisticsGlobalGroup.setStatus('current')
ieee8021AsAcceptableMasterBaseGroup = ObjectGroup((1, 3, 111, 2, 802, 1, 1, 20, 2, 2, 7)).setObjects(("IEEE8021-AS-MIB", "ieee8021AsAcceptableMasterTableDSMaxTableSize"), ("IEEE8021-AS-MIB", "ieee8021AsAcceptableMasterTableDSActualTableSize"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ieee8021AsAcceptableMasterBaseGroup = ieee8021AsAcceptableMasterBaseGroup.setStatus('current')
ieee8021AsAcceptableMasterTableGroup = ObjectGroup((1, 3, 111, 2, 802, 1, 1, 20, 2, 2, 8)).setObjects(("IEEE8021-AS-MIB", "ieee8021AsAcceptableMasterClockIdentity"), ("IEEE8021-AS-MIB", "ieee8021AsAcceptableMasterPortNumber"), ("IEEE8021-AS-MIB", "ieee8021AsAcceptableMasterAlternatePriority1"), ("IEEE8021-AS-MIB", "ieee8021AsAcceptableMasterRowStatus"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ieee8021AsAcceptableMasterTableGroup = ieee8021AsAcceptableMasterTableGroup.setStatus('current')
ieee8021AsCompliance = ModuleCompliance((1, 3, 111, 2, 802, 1, 1, 20, 2, 1, 1)).setObjects(("SNMPv2-MIB", "systemGroup"), ("IF-MIB", "ifGeneralInformationGroup"), ("IEEE8021-AS-MIB", "ieee8021ASSystemDefaultReqdGroup"), ("IEEE8021-AS-MIB", "ieee8021ASSystemCurrentGroup"), ("IEEE8021-AS-MIB", "ieee8021AsSystemClockParentGroup"), ("IEEE8021-AS-MIB", "ieee8021AsSystemTimePropertiesGroup"), ("IEEE8021-AS-MIB", "ieee8021AsPortDataSetGlobalGroup"), ("IEEE8021-AS-MIB", "ieee8021AsAcceptableMasterBaseGroup"), ("IEEE8021-AS-MIB", "ieee8021AsAcceptableMasterTableGroup"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ieee8021AsCompliance = ieee8021AsCompliance.setStatus('deprecated')
ieee8021AsComplianceCor1 = ModuleCompliance((1, 3, 111, 2, 802, 1, 1, 20, 2, 1, 2)).setObjects(("SNMPv2-MIB", "systemGroup"), ("IF-MIB", "ifGeneralInformationGroup"), ("IEEE8021-AS-MIB", "ieee8021ASSystemDefaultReqdGroup"), ("IEEE8021-AS-MIB", "ieee8021ASSystemCurrentGroup"), ("IEEE8021-AS-MIB", "ieee8021AsSystemClockParentGroup"), ("IEEE8021-AS-MIB", "ieee8021AsSystemTimePropertiesGroup"), ("IEEE8021-AS-MIB", "ieee8021AsPortDataSetGlobalGroup"), ("IEEE8021-AS-MIB", "ieee8021AsAcceptableMasterBaseGroup"), ("IEEE8021-AS-MIB", "ieee8021AsAcceptableMasterTableGroup"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ieee8021AsComplianceCor1 = ieee8021AsComplianceCor1.setStatus('current')
mibBuilder.exportSymbols("IEEE8021-AS-MIB", ieee8021AsSystemClockParentGroup=ieee8021AsSystemClockParentGroup, ieee8021AsTimePropertiesDS=ieee8021AsTimePropertiesDS, ieee8021AsPortStatIfEntry=ieee8021AsPortStatIfEntry, ieee8021AsParentDSParentPortNumber=ieee8021AsParentDSParentPortNumber, ieee8021AsPortDSCurrentLogSyncInterval=ieee8021AsPortDSCurrentLogSyncInterval, ieee8021AsPortStatRxPdelayRequest=ieee8021AsPortStatRxPdelayRequest, ieee8021AsDefaultDSCurrentUTCOffsetValid=ieee8021AsDefaultDSCurrentUTCOffsetValid, ieee8021AsPortDSIfEntry=ieee8021AsPortDSIfEntry, ieee8021AsPortStatRxAnnounce=ieee8021AsPortStatRxAnnounce, ieee8021AsGroups=ieee8021AsGroups, ieee8021AsAcceptableMasterTableGroup=ieee8021AsAcceptableMasterTableGroup, ieee8021AsPortDSCurrentLogAnnounceInterval=ieee8021AsPortDSCurrentLogAnnounceInterval, ieee8021AsMIBObjects=ieee8021AsMIBObjects, IEEE8021ASClockClassValue=IEEE8021ASClockClassValue, ieee8021AsDefaultDSLeap61=ieee8021AsDefaultDSLeap61, ieee8021AsPortDSNeighborPropDelayThreshLs=ieee8021AsPortDSNeighborPropDelayThreshLs, ieee8021AsTimePropertiesDSCurrentUtcOffset=ieee8021AsTimePropertiesDSCurrentUtcOffset, ieee8021AsPortStatRxPTPPacketDiscard=ieee8021AsPortStatRxPTPPacketDiscard, ieee8021AsPortDSNupMs=ieee8021AsPortDSNupMs, ieee8021AsPortDSAcceptableMasterTableEnabled=ieee8021AsPortDSAcceptableMasterTableEnabled, ieee8021AsSystemTimePropertiesGroup=ieee8021AsSystemTimePropertiesGroup, ieee8021AsPortStatRxPdelayResponseFollowUp=ieee8021AsPortStatRxPdelayResponseFollowUp, ieee8021AsCompliances=ieee8021AsCompliances, ieee8021AsComplianceCor1=ieee8021AsComplianceCor1, ieee8021AsPortStatTxPdelayRequest=ieee8021AsPortStatTxPdelayRequest, ieee8021AsBridgeBasePort=ieee8021AsBridgeBasePort, ieee8021AsCurrentDS=ieee8021AsCurrentDS, ieee8021AsParentDSGrandmasterPriority2=ieee8021AsParentDSGrandmasterPriority2, ieee8021AsCurrentDSLastGmPhaseChangeMs=ieee8021AsCurrentDSLastGmPhaseChangeMs, ieee8021AsCompliancesCor1=ieee8021AsCompliancesCor1, ieee8021AsPortDSIsMeasuringDelay=ieee8021AsPortDSIsMeasuringDelay, ieee8021AsPortDSPortNumber=ieee8021AsPortDSPortNumber, ieee8021AsPortDSClockIdentity=ieee8021AsPortDSClockIdentity, ieee8021AsPortStatTxSyncCount=ieee8021AsPortStatTxSyncCount, ieee8021AsParentDSCumlativeRateRatio=ieee8021AsParentDSCumlativeRateRatio, ieee8021AsPortDSPortRole=ieee8021AsPortDSPortRole, ieee8021AsPortDSDelayAsymmetryHs=ieee8021AsPortDSDelayAsymmetryHs, ieee8021AsPortDSSyncReceiptTimeoutTimeIntervalLs=ieee8021AsPortDSSyncReceiptTimeoutTimeIntervalLs, ieee8021AsParentDSParentClockIdentity=ieee8021AsParentDSParentClockIdentity, ieee8021AsPortDSVersionNumber=ieee8021AsPortDSVersionNumber, ieee8021AsPortDataSetGlobalGroup=ieee8021AsPortDataSetGlobalGroup, ieee8021AsCurrentDSLastGmPhaseChangeHs=ieee8021AsCurrentDSLastGmPhaseChangeHs, ieee8021AsDefaultDSTimeSource=ieee8021AsDefaultDSTimeSource, ieee8021AsCompliance=ieee8021AsCompliance, ieee8021AsPortStatRxSyncCount=ieee8021AsPortStatRxSyncCount, ieee8021AsParentDSGrandmasterClockClass=ieee8021AsParentDSGrandmasterClockClass, ieee8021AsDefaultDSLeap59=ieee8021AsDefaultDSLeap59, ieee8021AsParentDSGrandmasterClockAccuracy=ieee8021AsParentDSGrandmasterClockAccuracy, ieee8021AsDefaultDSTimeTraceable=ieee8021AsDefaultDSTimeTraceable, ieee8021AsPortStatRxFollowUpCount=ieee8021AsPortStatRxFollowUpCount, ieee8021AsPortStatRxPdelayResponse=ieee8021AsPortStatRxPdelayResponse, ieee8021AsAcceptableMasterBaseGroup=ieee8021AsAcceptableMasterBaseGroup, PYSNMP_MODULE_ID=ieee8021AsTimeSyncMib, ieee8021AsAcceptableMasterTableDSActualTableSize=ieee8021AsAcceptableMasterTableDSActualTableSize, ieee8021ASSystemCurrentGroup=ieee8021ASSystemCurrentGroup, ieee8021AsDefaultDSNumberPorts=ieee8021AsDefaultDSNumberPorts, ieee8021AsCurrentDSStepsRemoved=ieee8021AsCurrentDSStepsRemoved, ieee8021AsPortStatTxAnnounce=ieee8021AsPortStatTxAnnounce, ieee8021AsCurrentDSLastGmPhaseChangeLs=ieee8021AsCurrentDSLastGmPhaseChangeLs, ieee8021AsPortDSDelayAsymmetryLs=ieee8021AsPortDSDelayAsymmetryLs, ieee8021AsPortDSNeighborRateRatio=ieee8021AsPortDSNeighborRateRatio, ieee8021AsAcceptableMasterTableDS=ieee8021AsAcceptableMasterTableDS, ieee8021AsPortDSIfTable=ieee8021AsPortDSIfTable, ieee8021AsTimePropertiesDSCurrentUtcOffsetValid=ieee8021AsTimePropertiesDSCurrentUtcOffsetValid, ieee8021AsPortDSAllowedLostResponses=ieee8021AsPortDSAllowedLostResponses, ieee8021AsCurrentDSLastGmFreqChangeLs=ieee8021AsCurrentDSLastGmFreqChangeLs, ieee8021AsPortDSNeighborPropDelayMs=ieee8021AsPortDSNeighborPropDelayMs, ieee8021AsPortStatTxPdelayResponseFollowUp=ieee8021AsPortStatTxPdelayResponseFollowUp, ieee8021AsAcceptableMasterTableDSMasterEntry=ieee8021AsAcceptableMasterTableDSMasterEntry, ieee8021AsTimePropertiesDSTimeSource=ieee8021AsTimePropertiesDSTimeSource, ieee8021AsTimePropertiesDSTimeTraceable=ieee8021AsTimePropertiesDSTimeTraceable, ieee8021AsPortDSAsCapable=ieee8021AsPortDSAsCapable, ieee8021AsPortDSNdownLs=ieee8021AsPortDSNdownLs, ieee8021AsParentDSGrandmasterOffsetScaledLogVariance=ieee8021AsParentDSGrandmasterOffsetScaledLogVariance, ieee8021AsPortDSNeighborPropDelayThreshMs=ieee8021AsPortDSNeighborPropDelayThreshMs, ieee8021AsPortDSAsIfIndex=ieee8021AsPortDSAsIfIndex, ieee8021AsPortDSNeighborPropDelayHs=ieee8021AsPortDSNeighborPropDelayHs, ieee8021AsPortDSNeighborPropDelayLs=ieee8021AsPortDSNeighborPropDelayLs, ieee8021AsCurrentDSTimeOfLastGmPhaseChangeEvent=ieee8021AsCurrentDSTimeOfLastGmPhaseChangeEvent, ieee8021AsAcceptableMasterTableDSBase=ieee8021AsAcceptableMasterTableDSBase, ieee8021AsPortStatAnnounceReceiptTimeouts=ieee8021AsPortStatAnnounceReceiptTimeouts, ieee8021ASSystemDefaultReqdGroup=ieee8021ASSystemDefaultReqdGroup, IEEE8021ASClockAccuracyValue=IEEE8021ASClockAccuracyValue, ieee8021AsConformance=ieee8021AsConformance, ieee8021AsCurrentDSOffsetFromMasterHs=ieee8021AsCurrentDSOffsetFromMasterHs, ieee8021AsPortDSAnnounceReceiptTimeout=ieee8021AsPortDSAnnounceReceiptTimeout, ieee8021AsParentDSGrandmasterPriority1=ieee8021AsParentDSGrandmasterPriority1, ieee8021AsCurrentDSOffsetFromMasterMs=ieee8021AsCurrentDSOffsetFromMasterMs, ieee8021AsDefaultDSFrequencyTraceable=ieee8021AsDefaultDSFrequencyTraceable, ieee8021AsPortDSInitialLogPdelayReqInterval=ieee8021AsPortDSInitialLogPdelayReqInterval, ieee8021AsCurrentDSGmChangeCount=ieee8021AsCurrentDSGmChangeCount, ieee8021AsAcceptableMasterPortNumber=ieee8021AsAcceptableMasterPortNumber, ieee8021AsPortDSNdownMs=ieee8021AsPortDSNdownMs, ieee8021AsPortDSCurrentLogPdelayReqInterval=ieee8021AsPortDSCurrentLogPdelayReqInterval, ieee8021AsAcceptableMasterTableDSMaxTableSize=ieee8021AsAcceptableMasterTableDSMaxTableSize, ieee8021AsCurrentDSTimeOfLastGmFreqChangeEvent=ieee8021AsCurrentDSTimeOfLastGmFreqChangeEvent, ieee8021AsDefaultDSOffsetScaledLogVariance=ieee8021AsDefaultDSOffsetScaledLogVariance, ieee8021AsPortStatPdelayAllowedLostResponsesExceeded=ieee8021AsPortStatPdelayAllowedLostResponsesExceeded, ieee8021AsAcceptableMasterTableDSMasterTable=ieee8021AsAcceptableMasterTableDSMasterTable, ieee8021AsAcceptableMasterAlternatePriority1=ieee8021AsAcceptableMasterAlternatePriority1, ieee8021AsPortStatRxSyncReceiptTimeouts=ieee8021AsPortStatRxSyncReceiptTimeouts, ieee8021AsAcceptableMasterClockIdentity=ieee8021AsAcceptableMasterClockIdentity, ieee8021AsDefaultDSCurrentUTCOffset=ieee8021AsDefaultDSCurrentUTCOffset, ieee8021AsPortDSSyncReceiptTimeoutTimeIntervalMs=ieee8021AsPortDSSyncReceiptTimeoutTimeIntervalMs, ieee8021AsCurrentDSGmTimebaseIndicator=ieee8021AsCurrentDSGmTimebaseIndicator, ieee8021AsTimePropertiesDSLeap61=ieee8021AsTimePropertiesDSLeap61, ieee8021AsPortDSSyncReceiptTimeout=ieee8021AsPortDSSyncReceiptTimeout, ieee8021AsDefaultDSClockClass=ieee8021AsDefaultDSClockClass, ieee8021AsPortStatTxPdelayResponse=ieee8021AsPortStatTxPdelayResponse, ieee8021AsCurrentDSOffsetFromMasterLs=ieee8021AsCurrentDSOffsetFromMasterLs, ieee8021AsPortDSDelayAsymmetryMs=ieee8021AsPortDSDelayAsymmetryMs, IEEE8021ASTimeSourceValue=IEEE8021ASTimeSourceValue, ieee8021AsPortStatTxFollowUpCount=ieee8021AsPortStatTxFollowUpCount, ClockIdentity=ClockIdentity, ieee8021AsDefaultDSPriority1=ieee8021AsDefaultDSPriority1, ieee8021AsPortStatIfTable=ieee8021AsPortStatIfTable, ieee8021AsParentDS=ieee8021AsParentDS, ieee8021AsAcceptableMasterRowStatus=ieee8021AsAcceptableMasterRowStatus, ieee8021AsDefaultDSClockAccuracy=ieee8021AsDefaultDSClockAccuracy, ieee8021AsPortDSNupLs=ieee8021AsPortDSNupLs, ieee8021AsAcceptableMasterTableDSMaster=ieee8021AsAcceptableMasterTableDSMaster, ieee8021AsTimePropertiesDSLeap59=ieee8021AsTimePropertiesDSLeap59, ieee8021AsDefaultDSClockIdentity=ieee8021AsDefaultDSClockIdentity, ieee8021AsDefaultDSPriority2=ieee8021AsDefaultDSPriority2, ieee8021AsParentDSGrandmasterIdentity=ieee8021AsParentDSGrandmasterIdentity, ieee8021AsTimeSyncMib=ieee8021AsTimeSyncMib, ieee8021AsCurrentDSLastGmFreqChangeMs=ieee8021AsCurrentDSLastGmFreqChangeMs, ieee8021AsDefaultDS=ieee8021AsDefaultDS, ieee8021AsPortDSInitialLogAnnounceInterval=ieee8021AsPortDSInitialLogAnnounceInterval, ieee8021ASPortStatisticsGlobalGroup=ieee8021ASPortStatisticsGlobalGroup, ieee8021AsPortDSSyncReceiptTimeoutTimeIntervalHs=ieee8021AsPortDSSyncReceiptTimeoutTimeIntervalHs, ieee8021AsPortDSInitialLogSyncInterval=ieee8021AsPortDSInitialLogSyncInterval, ieee8021AsPortDSPttPortEnabled=ieee8021AsPortDSPttPortEnabled, ieee8021AsAcceptableMasterTableDSMasterId=ieee8021AsAcceptableMasterTableDSMasterId, ieee8021AsDefaultDSGmCapable=ieee8021AsDefaultDSGmCapable, ieee8021AsTimePropertiesDSFrequencyTraceable=ieee8021AsTimePropertiesDSFrequencyTraceable, ieee8021AsCurrentDSTimeOfLastGmChangeEvent=ieee8021AsCurrentDSTimeOfLastGmChangeEvent, ieee8021AsPortDSNeighborPropDelayThreshHs=ieee8021AsPortDSNeighborPropDelayThreshHs)
| (octet_string, integer, object_identifier) = mibBuilder.importSymbols('ASN1', 'OctetString', 'Integer', 'ObjectIdentifier')
(named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues')
(value_size_constraint, constraints_intersection, single_value_constraint, value_range_constraint, constraints_union) = mibBuilder.importSymbols('ASN1-REFINEMENT', 'ValueSizeConstraint', 'ConstraintsIntersection', 'SingleValueConstraint', 'ValueRangeConstraint', 'ConstraintsUnion')
(ieee8021_bridge_port_number,) = mibBuilder.importSymbols('IEEE8021-TC-MIB', 'IEEE8021BridgePortNumber')
(if_general_information_group, interface_index_or_zero) = mibBuilder.importSymbols('IF-MIB', 'ifGeneralInformationGroup', 'InterfaceIndexOrZero')
(object_group, module_compliance, notification_group) = mibBuilder.importSymbols('SNMPv2-CONF', 'ObjectGroup', 'ModuleCompliance', 'NotificationGroup')
(mib_identifier, gauge32, object_identity, mib_scalar, mib_table, mib_table_row, mib_table_column, notification_type, counter32, bits, integer32, module_identity, iso, time_ticks, counter64, ip_address, unsigned32) = mibBuilder.importSymbols('SNMPv2-SMI', 'MibIdentifier', 'Gauge32', 'ObjectIdentity', 'MibScalar', 'MibTable', 'MibTableRow', 'MibTableColumn', 'NotificationType', 'Counter32', 'Bits', 'Integer32', 'ModuleIdentity', 'iso', 'TimeTicks', 'Counter64', 'IpAddress', 'Unsigned32')
(textual_convention, display_string, row_status, time_stamp, truth_value) = mibBuilder.importSymbols('SNMPv2-TC', 'TextualConvention', 'DisplayString', 'RowStatus', 'TimeStamp', 'TruthValue')
ieee8021_as_time_sync_mib = module_identity((1, 3, 111, 2, 802, 1, 1, 20))
ieee8021AsTimeSyncMib.setRevisions(('2012-12-12 00:00', '2010-11-11 00:00'))
if mibBuilder.loadTexts:
ieee8021AsTimeSyncMib.setLastUpdated('201212120000Z')
if mibBuilder.loadTexts:
ieee8021AsTimeSyncMib.setOrganization('IEEE 802.1 Working Group')
ieee8021_as_mib_objects = mib_identifier((1, 3, 111, 2, 802, 1, 1, 20, 1))
ieee8021_as_conformance = mib_identifier((1, 3, 111, 2, 802, 1, 1, 20, 2))
class Clockidentity(TextualConvention, OctetString):
reference = '6.3.3.6 and 8.5.2.2.1'
status = 'current'
display_hint = '1x:'
subtype_spec = OctetString.subtypeSpec + value_size_constraint(8, 8)
fixed_length = 8
class Ieee8021Asclockclassvalue(TextualConvention, Integer32):
reference = '14.2.3 and IEEE Std 1588-2008 7.6.2.4'
status = 'current'
subtype_spec = Integer32.subtypeSpec + constraints_union(single_value_constraint(6, 7, 13, 14, 52, 58, 187, 193, 248, 255))
named_values = named_values(('primarySync', 6), ('primarySyncLost', 7), ('applicationSpecificSync', 13), ('applicationSpecficSyncLost', 14), ('primarySyncAlternativeA', 52), ('applicationSpecificAlternativeA', 58), ('primarySyncAlternativeB', 187), ('applicationSpecficAlternativeB', 193), ('defaultClock', 248), ('slaveOnlyClock', 255))
class Ieee8021Asclockaccuracyvalue(TextualConvention, Integer32):
reference = '8.6.2.3'
status = 'current'
subtype_spec = Integer32.subtypeSpec + constraints_union(single_value_constraint(32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 254))
named_values = named_values(('timeAccurateTo25ns', 32), ('timeAccurateTo100ns', 33), ('timeAccurateTo250ns', 34), ('timeAccurateTo1us', 35), ('timeAccurateTo2dot5us', 36), ('timeAccurateTo10us', 37), ('timeAccurateTo25us', 38), ('timeAccurateTo100us', 39), ('timeAccurateTo250us', 40), ('timeAccurateTo1ms', 41), ('timeAccurateTo2dot5ms', 42), ('timeAccurateTo10ms', 43), ('timeAccurateTo25ms', 44), ('timeAccurateTo100ms', 45), ('timeAccurateTo250ms', 46), ('timeAccurateTo1s', 47), ('timeAccurateTo10s', 48), ('timeAccurateToGT10s', 49), ('timeAccurateToUnknown', 254))
class Ieee8021Astimesourcevalue(TextualConvention, Integer32):
reference = '8.6.2.7 and Table 8-3'
status = 'current'
subtype_spec = Integer32.subtypeSpec + constraints_union(single_value_constraint(16, 32, 48, 64, 80, 96, 144, 160))
named_values = named_values(('atomicClock', 16), ('gps', 32), ('terrestrialRadio', 48), ('ptp', 64), ('ntp', 80), ('handSet', 96), ('other', 144), ('internalOscillator', 160))
ieee8021_as_default_ds = mib_identifier((1, 3, 111, 2, 802, 1, 1, 20, 1, 1))
ieee8021_as_default_ds_clock_identity = mib_scalar((1, 3, 111, 2, 802, 1, 1, 20, 1, 1, 1), clock_identity()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
ieee8021AsDefaultDSClockIdentity.setStatus('current')
ieee8021_as_default_ds_number_ports = mib_scalar((1, 3, 111, 2, 802, 1, 1, 20, 1, 1, 2), unsigned32().subtype(subtypeSpec=value_range_constraint(0, 255))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
ieee8021AsDefaultDSNumberPorts.setStatus('current')
ieee8021_as_default_ds_clock_class = mib_scalar((1, 3, 111, 2, 802, 1, 1, 20, 1, 1, 3), ieee8021_as_clock_class_value().clone('defaultClock')).setMaxAccess('readonly')
if mibBuilder.loadTexts:
ieee8021AsDefaultDSClockClass.setStatus('current')
ieee8021_as_default_ds_clock_accuracy = mib_scalar((1, 3, 111, 2, 802, 1, 1, 20, 1, 1, 4), ieee8021_as_clock_accuracy_value()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
ieee8021AsDefaultDSClockAccuracy.setStatus('current')
ieee8021_as_default_ds_offset_scaled_log_variance = mib_scalar((1, 3, 111, 2, 802, 1, 1, 20, 1, 1, 5), unsigned32().subtype(subtypeSpec=value_range_constraint(0, 65535))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
ieee8021AsDefaultDSOffsetScaledLogVariance.setStatus('current')
ieee8021_as_default_ds_priority1 = mib_scalar((1, 3, 111, 2, 802, 1, 1, 20, 1, 1, 6), unsigned32().subtype(subtypeSpec=value_range_constraint(0, 255))).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
ieee8021AsDefaultDSPriority1.setStatus('current')
ieee8021_as_default_ds_priority2 = mib_scalar((1, 3, 111, 2, 802, 1, 1, 20, 1, 1, 7), unsigned32().subtype(subtypeSpec=value_range_constraint(0, 255)).clone(248)).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
ieee8021AsDefaultDSPriority2.setStatus('current')
ieee8021_as_default_ds_gm_capable = mib_scalar((1, 3, 111, 2, 802, 1, 1, 20, 1, 1, 8), truth_value()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
ieee8021AsDefaultDSGmCapable.setStatus('current')
ieee8021_as_default_ds_current_utc_offset = mib_scalar((1, 3, 111, 2, 802, 1, 1, 20, 1, 1, 9), integer32().subtype(subtypeSpec=value_range_constraint(-32768, 32767))).setUnits('seconds').setMaxAccess('readonly')
if mibBuilder.loadTexts:
ieee8021AsDefaultDSCurrentUTCOffset.setStatus('current')
ieee8021_as_default_ds_current_utc_offset_valid = mib_scalar((1, 3, 111, 2, 802, 1, 1, 20, 1, 1, 10), truth_value()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
ieee8021AsDefaultDSCurrentUTCOffsetValid.setStatus('current')
ieee8021_as_default_ds_leap59 = mib_scalar((1, 3, 111, 2, 802, 1, 1, 20, 1, 1, 11), truth_value()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
ieee8021AsDefaultDSLeap59.setStatus('current')
ieee8021_as_default_ds_leap61 = mib_scalar((1, 3, 111, 2, 802, 1, 1, 20, 1, 1, 12), truth_value()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
ieee8021AsDefaultDSLeap61.setStatus('current')
ieee8021_as_default_ds_time_traceable = mib_scalar((1, 3, 111, 2, 802, 1, 1, 20, 1, 1, 13), truth_value()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
ieee8021AsDefaultDSTimeTraceable.setStatus('current')
ieee8021_as_default_ds_frequency_traceable = mib_scalar((1, 3, 111, 2, 802, 1, 1, 20, 1, 1, 14), truth_value()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
ieee8021AsDefaultDSFrequencyTraceable.setStatus('current')
ieee8021_as_default_ds_time_source = mib_scalar((1, 3, 111, 2, 802, 1, 1, 20, 1, 1, 15), ieee8021_as_time_source_value()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
ieee8021AsDefaultDSTimeSource.setStatus('current')
ieee8021_as_current_ds = mib_identifier((1, 3, 111, 2, 802, 1, 1, 20, 1, 2))
ieee8021_as_current_ds_steps_removed = mib_scalar((1, 3, 111, 2, 802, 1, 1, 20, 1, 2, 1), integer32().subtype(subtypeSpec=value_range_constraint(-32768, 32767))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
ieee8021AsCurrentDSStepsRemoved.setStatus('current')
ieee8021_as_current_ds_offset_from_master_hs = mib_scalar((1, 3, 111, 2, 802, 1, 1, 20, 1, 2, 2), integer32()).setUnits('2**-16 ns * 2**64').setMaxAccess('readonly')
if mibBuilder.loadTexts:
ieee8021AsCurrentDSOffsetFromMasterHs.setStatus('current')
ieee8021_as_current_ds_offset_from_master_ms = mib_scalar((1, 3, 111, 2, 802, 1, 1, 20, 1, 2, 3), integer32()).setUnits('2**-16 ns * 2**32').setMaxAccess('readonly')
if mibBuilder.loadTexts:
ieee8021AsCurrentDSOffsetFromMasterMs.setStatus('current')
ieee8021_as_current_ds_offset_from_master_ls = mib_scalar((1, 3, 111, 2, 802, 1, 1, 20, 1, 2, 4), integer32()).setUnits('2**-16 ns').setMaxAccess('readonly')
if mibBuilder.loadTexts:
ieee8021AsCurrentDSOffsetFromMasterLs.setStatus('current')
ieee8021_as_current_ds_last_gm_phase_change_hs = mib_scalar((1, 3, 111, 2, 802, 1, 1, 20, 1, 2, 5), integer32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
ieee8021AsCurrentDSLastGmPhaseChangeHs.setStatus('current')
ieee8021_as_current_ds_last_gm_phase_change_ms = mib_scalar((1, 3, 111, 2, 802, 1, 1, 20, 1, 2, 6), unsigned32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
ieee8021AsCurrentDSLastGmPhaseChangeMs.setStatus('current')
ieee8021_as_current_ds_last_gm_phase_change_ls = mib_scalar((1, 3, 111, 2, 802, 1, 1, 20, 1, 2, 7), unsigned32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
ieee8021AsCurrentDSLastGmPhaseChangeLs.setStatus('current')
ieee8021_as_current_ds_last_gm_freq_change_ms = mib_scalar((1, 3, 111, 2, 802, 1, 1, 20, 1, 2, 8), integer32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
ieee8021AsCurrentDSLastGmFreqChangeMs.setStatus('current')
ieee8021_as_current_ds_last_gm_freq_change_ls = mib_scalar((1, 3, 111, 2, 802, 1, 1, 20, 1, 2, 9), unsigned32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
ieee8021AsCurrentDSLastGmFreqChangeLs.setStatus('current')
ieee8021_as_current_ds_gm_timebase_indicator = mib_scalar((1, 3, 111, 2, 802, 1, 1, 20, 1, 2, 10), unsigned32().subtype(subtypeSpec=value_range_constraint(0, 65535))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
ieee8021AsCurrentDSGmTimebaseIndicator.setStatus('current')
ieee8021_as_current_ds_gm_change_count = mib_scalar((1, 3, 111, 2, 802, 1, 1, 20, 1, 2, 11), counter32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
ieee8021AsCurrentDSGmChangeCount.setStatus('current')
ieee8021_as_current_ds_time_of_last_gm_change_event = mib_scalar((1, 3, 111, 2, 802, 1, 1, 20, 1, 2, 12), time_stamp()).setUnits('0.01 seconds').setMaxAccess('readonly')
if mibBuilder.loadTexts:
ieee8021AsCurrentDSTimeOfLastGmChangeEvent.setStatus('current')
ieee8021_as_current_ds_time_of_last_gm_freq_change_event = mib_scalar((1, 3, 111, 2, 802, 1, 1, 20, 1, 2, 13), time_stamp()).setUnits('0.01 seconds').setMaxAccess('readonly')
if mibBuilder.loadTexts:
ieee8021AsCurrentDSTimeOfLastGmFreqChangeEvent.setStatus('current')
ieee8021_as_current_ds_time_of_last_gm_phase_change_event = mib_scalar((1, 3, 111, 2, 802, 1, 1, 20, 1, 2, 14), time_stamp()).setUnits('0.01 seconds').setMaxAccess('readonly')
if mibBuilder.loadTexts:
ieee8021AsCurrentDSTimeOfLastGmPhaseChangeEvent.setStatus('current')
ieee8021_as_parent_ds = mib_identifier((1, 3, 111, 2, 802, 1, 1, 20, 1, 3))
ieee8021_as_parent_ds_parent_clock_identity = mib_scalar((1, 3, 111, 2, 802, 1, 1, 20, 1, 3, 1), clock_identity()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
ieee8021AsParentDSParentClockIdentity.setStatus('current')
ieee8021_as_parent_ds_parent_port_number = mib_scalar((1, 3, 111, 2, 802, 1, 1, 20, 1, 3, 2), unsigned32().subtype(subtypeSpec=value_range_constraint(0, 65535))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
ieee8021AsParentDSParentPortNumber.setStatus('current')
ieee8021_as_parent_ds_cumlative_rate_ratio = mib_scalar((1, 3, 111, 2, 802, 1, 1, 20, 1, 3, 3), integer32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
ieee8021AsParentDSCumlativeRateRatio.setStatus('current')
ieee8021_as_parent_ds_grandmaster_identity = mib_scalar((1, 3, 111, 2, 802, 1, 1, 20, 1, 3, 4), clock_identity()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
ieee8021AsParentDSGrandmasterIdentity.setStatus('current')
ieee8021_as_parent_ds_grandmaster_clock_class = mib_scalar((1, 3, 111, 2, 802, 1, 1, 20, 1, 3, 5), ieee8021_as_clock_class_value()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
ieee8021AsParentDSGrandmasterClockClass.setStatus('current')
ieee8021_as_parent_ds_grandmaster_clock_accuracy = mib_scalar((1, 3, 111, 2, 802, 1, 1, 20, 1, 3, 6), ieee8021_as_clock_accuracy_value()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
ieee8021AsParentDSGrandmasterClockAccuracy.setStatus('current')
ieee8021_as_parent_ds_grandmaster_offset_scaled_log_variance = mib_scalar((1, 3, 111, 2, 802, 1, 1, 20, 1, 3, 7), unsigned32().subtype(subtypeSpec=value_range_constraint(0, 65535))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
ieee8021AsParentDSGrandmasterOffsetScaledLogVariance.setStatus('current')
ieee8021_as_parent_ds_grandmaster_priority1 = mib_scalar((1, 3, 111, 2, 802, 1, 1, 20, 1, 3, 8), unsigned32().subtype(subtypeSpec=value_range_constraint(0, 255))).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
ieee8021AsParentDSGrandmasterPriority1.setStatus('current')
ieee8021_as_parent_ds_grandmaster_priority2 = mib_scalar((1, 3, 111, 2, 802, 1, 1, 20, 1, 3, 9), unsigned32().subtype(subtypeSpec=value_range_constraint(0, 255))).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
ieee8021AsParentDSGrandmasterPriority2.setStatus('current')
ieee8021_as_time_properties_ds = mib_identifier((1, 3, 111, 2, 802, 1, 1, 20, 1, 4))
ieee8021_as_time_properties_ds_current_utc_offset = mib_scalar((1, 3, 111, 2, 802, 1, 1, 20, 1, 4, 1), integer32().subtype(subtypeSpec=value_range_constraint(-32768, 32767))).setUnits('seconds').setMaxAccess('readonly')
if mibBuilder.loadTexts:
ieee8021AsTimePropertiesDSCurrentUtcOffset.setStatus('current')
ieee8021_as_time_properties_ds_current_utc_offset_valid = mib_scalar((1, 3, 111, 2, 802, 1, 1, 20, 1, 4, 2), truth_value()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
ieee8021AsTimePropertiesDSCurrentUtcOffsetValid.setStatus('current')
ieee8021_as_time_properties_ds_leap59 = mib_scalar((1, 3, 111, 2, 802, 1, 1, 20, 1, 4, 3), truth_value()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
ieee8021AsTimePropertiesDSLeap59.setStatus('current')
ieee8021_as_time_properties_ds_leap61 = mib_scalar((1, 3, 111, 2, 802, 1, 1, 20, 1, 4, 4), truth_value()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
ieee8021AsTimePropertiesDSLeap61.setStatus('current')
ieee8021_as_time_properties_ds_time_traceable = mib_scalar((1, 3, 111, 2, 802, 1, 1, 20, 1, 4, 5), truth_value()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
ieee8021AsTimePropertiesDSTimeTraceable.setStatus('current')
ieee8021_as_time_properties_ds_frequency_traceable = mib_scalar((1, 3, 111, 2, 802, 1, 1, 20, 1, 4, 6), truth_value()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
ieee8021AsTimePropertiesDSFrequencyTraceable.setStatus('current')
ieee8021_as_time_properties_ds_time_source = mib_scalar((1, 3, 111, 2, 802, 1, 1, 20, 1, 4, 7), ieee8021_as_time_source_value()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
ieee8021AsTimePropertiesDSTimeSource.setStatus('current')
ieee8021_as_port_ds_if_table = mib_table((1, 3, 111, 2, 802, 1, 1, 20, 1, 5))
if mibBuilder.loadTexts:
ieee8021AsPortDSIfTable.setStatus('current')
ieee8021_as_port_ds_if_entry = mib_table_row((1, 3, 111, 2, 802, 1, 1, 20, 1, 5, 1)).setIndexNames((0, 'IEEE8021-AS-MIB', 'ieee8021AsBridgeBasePort'), (0, 'IEEE8021-AS-MIB', 'ieee8021AsPortDSAsIfIndex'))
if mibBuilder.loadTexts:
ieee8021AsPortDSIfEntry.setStatus('current')
ieee8021_as_bridge_base_port = mib_table_column((1, 3, 111, 2, 802, 1, 1, 20, 1, 5, 1, 1), ieee8021_bridge_port_number())
if mibBuilder.loadTexts:
ieee8021AsBridgeBasePort.setStatus('current')
ieee8021_as_port_ds_as_if_index = mib_table_column((1, 3, 111, 2, 802, 1, 1, 20, 1, 5, 1, 2), interface_index_or_zero())
if mibBuilder.loadTexts:
ieee8021AsPortDSAsIfIndex.setStatus('current')
ieee8021_as_port_ds_clock_identity = mib_table_column((1, 3, 111, 2, 802, 1, 1, 20, 1, 5, 1, 3), clock_identity()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
ieee8021AsPortDSClockIdentity.setStatus('current')
ieee8021_as_port_ds_port_number = mib_table_column((1, 3, 111, 2, 802, 1, 1, 20, 1, 5, 1, 4), unsigned32().subtype(subtypeSpec=value_range_constraint(0, 65535))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
ieee8021AsPortDSPortNumber.setStatus('current')
ieee8021_as_port_ds_port_role = mib_table_column((1, 3, 111, 2, 802, 1, 1, 20, 1, 5, 1, 5), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(3, 6, 7, 9))).clone(namedValues=named_values(('disabledPort', 3), ('masterPort', 6), ('passivePort', 7), ('slavePort', 9))).clone(3)).setMaxAccess('readonly')
if mibBuilder.loadTexts:
ieee8021AsPortDSPortRole.setStatus('current')
ieee8021_as_port_ds_ptt_port_enabled = mib_table_column((1, 3, 111, 2, 802, 1, 1, 20, 1, 5, 1, 6), truth_value().clone(1)).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
ieee8021AsPortDSPttPortEnabled.setStatus('current')
ieee8021_as_port_ds_is_measuring_delay = mib_table_column((1, 3, 111, 2, 802, 1, 1, 20, 1, 5, 1, 7), truth_value().clone(2)).setMaxAccess('readonly')
if mibBuilder.loadTexts:
ieee8021AsPortDSIsMeasuringDelay.setStatus('current')
ieee8021_as_port_ds_as_capable = mib_table_column((1, 3, 111, 2, 802, 1, 1, 20, 1, 5, 1, 8), truth_value()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
ieee8021AsPortDSAsCapable.setStatus('current')
ieee8021_as_port_ds_neighbor_prop_delay_hs = mib_table_column((1, 3, 111, 2, 802, 1, 1, 20, 1, 5, 1, 9), unsigned32()).setUnits('2**-16 ns * 2**64').setMaxAccess('readonly')
if mibBuilder.loadTexts:
ieee8021AsPortDSNeighborPropDelayHs.setStatus('current')
ieee8021_as_port_ds_neighbor_prop_delay_ms = mib_table_column((1, 3, 111, 2, 802, 1, 1, 20, 1, 5, 1, 10), unsigned32()).setUnits('2**-16 ns * 2**32').setMaxAccess('readonly')
if mibBuilder.loadTexts:
ieee8021AsPortDSNeighborPropDelayMs.setStatus('current')
ieee8021_as_port_ds_neighbor_prop_delay_ls = mib_table_column((1, 3, 111, 2, 802, 1, 1, 20, 1, 5, 1, 11), unsigned32()).setUnits('2**-16 ns').setMaxAccess('readonly')
if mibBuilder.loadTexts:
ieee8021AsPortDSNeighborPropDelayLs.setStatus('current')
ieee8021_as_port_ds_neighbor_prop_delay_thresh_hs = mib_table_column((1, 3, 111, 2, 802, 1, 1, 20, 1, 5, 1, 12), unsigned32()).setUnits('2**-16 ns * 2 ** 64').setMaxAccess('readwrite')
if mibBuilder.loadTexts:
ieee8021AsPortDSNeighborPropDelayThreshHs.setStatus('current')
ieee8021_as_port_ds_neighbor_prop_delay_thresh_ms = mib_table_column((1, 3, 111, 2, 802, 1, 1, 20, 1, 5, 1, 13), unsigned32()).setUnits('2**-16 ns * 2 ** 32').setMaxAccess('readwrite')
if mibBuilder.loadTexts:
ieee8021AsPortDSNeighborPropDelayThreshMs.setStatus('current')
ieee8021_as_port_ds_neighbor_prop_delay_thresh_ls = mib_table_column((1, 3, 111, 2, 802, 1, 1, 20, 1, 5, 1, 14), unsigned32()).setUnits('2**-16 ns').setMaxAccess('readwrite')
if mibBuilder.loadTexts:
ieee8021AsPortDSNeighborPropDelayThreshLs.setStatus('current')
ieee8021_as_port_ds_delay_asymmetry_hs = mib_table_column((1, 3, 111, 2, 802, 1, 1, 20, 1, 5, 1, 15), integer32()).setUnits('2**-16 ns * 2**64').setMaxAccess('readwrite')
if mibBuilder.loadTexts:
ieee8021AsPortDSDelayAsymmetryHs.setStatus('current')
ieee8021_as_port_ds_delay_asymmetry_ms = mib_table_column((1, 3, 111, 2, 802, 1, 1, 20, 1, 5, 1, 16), unsigned32()).setUnits('2**-16 ns * 2**32').setMaxAccess('readwrite')
if mibBuilder.loadTexts:
ieee8021AsPortDSDelayAsymmetryMs.setStatus('current')
ieee8021_as_port_ds_delay_asymmetry_ls = mib_table_column((1, 3, 111, 2, 802, 1, 1, 20, 1, 5, 1, 17), unsigned32()).setUnits('2**-16 ns').setMaxAccess('readwrite')
if mibBuilder.loadTexts:
ieee8021AsPortDSDelayAsymmetryLs.setStatus('current')
ieee8021_as_port_ds_neighbor_rate_ratio = mib_table_column((1, 3, 111, 2, 802, 1, 1, 20, 1, 5, 1, 18), integer32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
ieee8021AsPortDSNeighborRateRatio.setStatus('current')
ieee8021_as_port_ds_initial_log_announce_interval = mib_table_column((1, 3, 111, 2, 802, 1, 1, 20, 1, 5, 1, 19), integer32().subtype(subtypeSpec=value_range_constraint(-128, 127))).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
ieee8021AsPortDSInitialLogAnnounceInterval.setStatus('current')
ieee8021_as_port_ds_current_log_announce_interval = mib_table_column((1, 3, 111, 2, 802, 1, 1, 20, 1, 5, 1, 20), integer32().subtype(subtypeSpec=value_range_constraint(-128, 127))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
ieee8021AsPortDSCurrentLogAnnounceInterval.setStatus('current')
ieee8021_as_port_ds_announce_receipt_timeout = mib_table_column((1, 3, 111, 2, 802, 1, 1, 20, 1, 5, 1, 21), unsigned32().subtype(subtypeSpec=value_range_constraint(0, 255)).clone(2)).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
ieee8021AsPortDSAnnounceReceiptTimeout.setStatus('current')
ieee8021_as_port_ds_initial_log_sync_interval = mib_table_column((1, 3, 111, 2, 802, 1, 1, 20, 1, 5, 1, 22), integer32().subtype(subtypeSpec=value_range_constraint(-128, 127)).clone(-3)).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
ieee8021AsPortDSInitialLogSyncInterval.setStatus('current')
ieee8021_as_port_ds_current_log_sync_interval = mib_table_column((1, 3, 111, 2, 802, 1, 1, 20, 1, 5, 1, 23), integer32().subtype(subtypeSpec=value_range_constraint(-128, 127)).clone(-3)).setMaxAccess('readonly')
if mibBuilder.loadTexts:
ieee8021AsPortDSCurrentLogSyncInterval.setStatus('current')
ieee8021_as_port_ds_sync_receipt_timeout = mib_table_column((1, 3, 111, 2, 802, 1, 1, 20, 1, 5, 1, 24), unsigned32().subtype(subtypeSpec=value_range_constraint(0, 255)).clone(3)).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
ieee8021AsPortDSSyncReceiptTimeout.setStatus('current')
ieee8021_as_port_ds_sync_receipt_timeout_time_interval_hs = mib_table_column((1, 3, 111, 2, 802, 1, 1, 20, 1, 5, 1, 25), unsigned32().clone(0)).setUnits('2**-16 ns').setMaxAccess('readonly')
if mibBuilder.loadTexts:
ieee8021AsPortDSSyncReceiptTimeoutTimeIntervalHs.setStatus('current')
ieee8021_as_port_ds_sync_receipt_timeout_time_interval_ms = mib_table_column((1, 3, 111, 2, 802, 1, 1, 20, 1, 5, 1, 26), unsigned32().clone(5722)).setUnits('2**-16 ns * 2**32').setMaxAccess('readonly')
if mibBuilder.loadTexts:
ieee8021AsPortDSSyncReceiptTimeoutTimeIntervalMs.setStatus('current')
ieee8021_as_port_ds_sync_receipt_timeout_time_interval_ls = mib_table_column((1, 3, 111, 2, 802, 1, 1, 20, 1, 5, 1, 27), unsigned32().clone(197132288)).setUnits('2**-16 ns').setMaxAccess('readonly')
if mibBuilder.loadTexts:
ieee8021AsPortDSSyncReceiptTimeoutTimeIntervalLs.setStatus('current')
ieee8021_as_port_ds_initial_log_pdelay_req_interval = mib_table_column((1, 3, 111, 2, 802, 1, 1, 20, 1, 5, 1, 28), integer32().subtype(subtypeSpec=value_range_constraint(-128, 127))).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
ieee8021AsPortDSInitialLogPdelayReqInterval.setStatus('current')
ieee8021_as_port_ds_current_log_pdelay_req_interval = mib_table_column((1, 3, 111, 2, 802, 1, 1, 20, 1, 5, 1, 29), integer32().subtype(subtypeSpec=value_range_constraint(-128, 127))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
ieee8021AsPortDSCurrentLogPdelayReqInterval.setStatus('current')
ieee8021_as_port_ds_allowed_lost_responses = mib_table_column((1, 3, 111, 2, 802, 1, 1, 20, 1, 5, 1, 30), unsigned32().subtype(subtypeSpec=value_range_constraint(0, 65535)).clone(3)).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
ieee8021AsPortDSAllowedLostResponses.setStatus('current')
ieee8021_as_port_ds_version_number = mib_table_column((1, 3, 111, 2, 802, 1, 1, 20, 1, 5, 1, 31), unsigned32().subtype(subtypeSpec=value_range_constraint(0, 63)).clone(2)).setMaxAccess('readonly')
if mibBuilder.loadTexts:
ieee8021AsPortDSVersionNumber.setStatus('current')
ieee8021_as_port_ds_nup_ms = mib_table_column((1, 3, 111, 2, 802, 1, 1, 20, 1, 5, 1, 32), unsigned32()).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
ieee8021AsPortDSNupMs.setStatus('current')
ieee8021_as_port_ds_nup_ls = mib_table_column((1, 3, 111, 2, 802, 1, 1, 20, 1, 5, 1, 33), unsigned32()).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
ieee8021AsPortDSNupLs.setStatus('current')
ieee8021_as_port_ds_ndown_ms = mib_table_column((1, 3, 111, 2, 802, 1, 1, 20, 1, 5, 1, 34), unsigned32()).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
ieee8021AsPortDSNdownMs.setStatus('current')
ieee8021_as_port_ds_ndown_ls = mib_table_column((1, 3, 111, 2, 802, 1, 1, 20, 1, 5, 1, 35), unsigned32()).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
ieee8021AsPortDSNdownLs.setStatus('current')
ieee8021_as_port_ds_acceptable_master_table_enabled = mib_table_column((1, 3, 111, 2, 802, 1, 1, 20, 1, 5, 1, 36), truth_value().clone('false')).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
ieee8021AsPortDSAcceptableMasterTableEnabled.setStatus('current')
ieee8021_as_port_stat_if_table = mib_table((1, 3, 111, 2, 802, 1, 1, 20, 1, 6))
if mibBuilder.loadTexts:
ieee8021AsPortStatIfTable.setStatus('current')
ieee8021_as_port_stat_if_entry = mib_table_row((1, 3, 111, 2, 802, 1, 1, 20, 1, 6, 1)).setIndexNames((0, 'IEEE8021-AS-MIB', 'ieee8021AsBridgeBasePort'), (0, 'IEEE8021-AS-MIB', 'ieee8021AsPortDSAsIfIndex'))
if mibBuilder.loadTexts:
ieee8021AsPortStatIfEntry.setStatus('current')
ieee8021_as_port_stat_rx_sync_count = mib_table_column((1, 3, 111, 2, 802, 1, 1, 20, 1, 6, 1, 1), counter32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
ieee8021AsPortStatRxSyncCount.setStatus('current')
ieee8021_as_port_stat_rx_follow_up_count = mib_table_column((1, 3, 111, 2, 802, 1, 1, 20, 1, 6, 1, 2), counter32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
ieee8021AsPortStatRxFollowUpCount.setStatus('current')
ieee8021_as_port_stat_rx_pdelay_request = mib_table_column((1, 3, 111, 2, 802, 1, 1, 20, 1, 6, 1, 3), counter32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
ieee8021AsPortStatRxPdelayRequest.setStatus('current')
ieee8021_as_port_stat_rx_pdelay_response = mib_table_column((1, 3, 111, 2, 802, 1, 1, 20, 1, 6, 1, 4), counter32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
ieee8021AsPortStatRxPdelayResponse.setStatus('current')
ieee8021_as_port_stat_rx_pdelay_response_follow_up = mib_table_column((1, 3, 111, 2, 802, 1, 1, 20, 1, 6, 1, 5), counter32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
ieee8021AsPortStatRxPdelayResponseFollowUp.setStatus('current')
ieee8021_as_port_stat_rx_announce = mib_table_column((1, 3, 111, 2, 802, 1, 1, 20, 1, 6, 1, 6), counter32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
ieee8021AsPortStatRxAnnounce.setStatus('current')
ieee8021_as_port_stat_rx_ptp_packet_discard = mib_table_column((1, 3, 111, 2, 802, 1, 1, 20, 1, 6, 1, 7), counter32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
ieee8021AsPortStatRxPTPPacketDiscard.setStatus('current')
ieee8021_as_port_stat_rx_sync_receipt_timeouts = mib_table_column((1, 3, 111, 2, 802, 1, 1, 20, 1, 6, 1, 8), counter32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
ieee8021AsPortStatRxSyncReceiptTimeouts.setStatus('current')
ieee8021_as_port_stat_announce_receipt_timeouts = mib_table_column((1, 3, 111, 2, 802, 1, 1, 20, 1, 6, 1, 9), counter32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
ieee8021AsPortStatAnnounceReceiptTimeouts.setStatus('current')
ieee8021_as_port_stat_pdelay_allowed_lost_responses_exceeded = mib_table_column((1, 3, 111, 2, 802, 1, 1, 20, 1, 6, 1, 10), counter32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
ieee8021AsPortStatPdelayAllowedLostResponsesExceeded.setStatus('current')
ieee8021_as_port_stat_tx_sync_count = mib_table_column((1, 3, 111, 2, 802, 1, 1, 20, 1, 6, 1, 11), counter32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
ieee8021AsPortStatTxSyncCount.setStatus('current')
ieee8021_as_port_stat_tx_follow_up_count = mib_table_column((1, 3, 111, 2, 802, 1, 1, 20, 1, 6, 1, 12), counter32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
ieee8021AsPortStatTxFollowUpCount.setStatus('current')
ieee8021_as_port_stat_tx_pdelay_request = mib_table_column((1, 3, 111, 2, 802, 1, 1, 20, 1, 6, 1, 13), counter32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
ieee8021AsPortStatTxPdelayRequest.setStatus('current')
ieee8021_as_port_stat_tx_pdelay_response = mib_table_column((1, 3, 111, 2, 802, 1, 1, 20, 1, 6, 1, 14), counter32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
ieee8021AsPortStatTxPdelayResponse.setStatus('current')
ieee8021_as_port_stat_tx_pdelay_response_follow_up = mib_table_column((1, 3, 111, 2, 802, 1, 1, 20, 1, 6, 1, 15), counter32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
ieee8021AsPortStatTxPdelayResponseFollowUp.setStatus('current')
ieee8021_as_port_stat_tx_announce = mib_table_column((1, 3, 111, 2, 802, 1, 1, 20, 1, 6, 1, 16), counter32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
ieee8021AsPortStatTxAnnounce.setStatus('current')
ieee8021_as_acceptable_master_table_ds = mib_identifier((1, 3, 111, 2, 802, 1, 1, 20, 1, 7))
ieee8021_as_acceptable_master_table_ds_base = mib_identifier((1, 3, 111, 2, 802, 1, 1, 20, 1, 7, 1))
ieee8021_as_acceptable_master_table_ds_master = mib_identifier((1, 3, 111, 2, 802, 1, 1, 20, 1, 7, 2))
ieee8021_as_acceptable_master_table_ds_max_table_size = mib_scalar((1, 3, 111, 2, 802, 1, 1, 20, 1, 7, 1, 1), unsigned32().subtype(subtypeSpec=value_range_constraint(0, 65535))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
ieee8021AsAcceptableMasterTableDSMaxTableSize.setStatus('current')
ieee8021_as_acceptable_master_table_ds_actual_table_size = mib_scalar((1, 3, 111, 2, 802, 1, 1, 20, 1, 7, 1, 2), unsigned32().subtype(subtypeSpec=value_range_constraint(0, 65535))).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
ieee8021AsAcceptableMasterTableDSActualTableSize.setStatus('current')
ieee8021_as_acceptable_master_table_ds_master_table = mib_table((1, 3, 111, 2, 802, 1, 1, 20, 1, 7, 2, 1))
if mibBuilder.loadTexts:
ieee8021AsAcceptableMasterTableDSMasterTable.setStatus('current')
ieee8021_as_acceptable_master_table_ds_master_entry = mib_table_row((1, 3, 111, 2, 802, 1, 1, 20, 1, 7, 2, 1, 1)).setIndexNames((0, 'IEEE8021-AS-MIB', 'ieee8021AsAcceptableMasterTableDSMasterId'))
if mibBuilder.loadTexts:
ieee8021AsAcceptableMasterTableDSMasterEntry.setStatus('current')
ieee8021_as_acceptable_master_table_ds_master_id = mib_table_column((1, 3, 111, 2, 802, 1, 1, 20, 1, 7, 2, 1, 1, 1), unsigned32())
if mibBuilder.loadTexts:
ieee8021AsAcceptableMasterTableDSMasterId.setStatus('current')
ieee8021_as_acceptable_master_clock_identity = mib_table_column((1, 3, 111, 2, 802, 1, 1, 20, 1, 7, 2, 1, 1, 2), clock_identity()).setMaxAccess('readcreate')
if mibBuilder.loadTexts:
ieee8021AsAcceptableMasterClockIdentity.setStatus('current')
ieee8021_as_acceptable_master_port_number = mib_table_column((1, 3, 111, 2, 802, 1, 1, 20, 1, 7, 2, 1, 1, 3), unsigned32().subtype(subtypeSpec=value_range_constraint(0, 65535))).setMaxAccess('readcreate')
if mibBuilder.loadTexts:
ieee8021AsAcceptableMasterPortNumber.setStatus('current')
ieee8021_as_acceptable_master_alternate_priority1 = mib_table_column((1, 3, 111, 2, 802, 1, 1, 20, 1, 7, 2, 1, 1, 4), unsigned32().subtype(subtypeSpec=value_range_constraint(0, 255)).clone(244)).setMaxAccess('readcreate')
if mibBuilder.loadTexts:
ieee8021AsAcceptableMasterAlternatePriority1.setStatus('current')
ieee8021_as_acceptable_master_row_status = mib_table_column((1, 3, 111, 2, 802, 1, 1, 20, 1, 7, 2, 1, 1, 5), row_status()).setMaxAccess('readcreate')
if mibBuilder.loadTexts:
ieee8021AsAcceptableMasterRowStatus.setStatus('current')
ieee8021_as_compliances = mib_identifier((1, 3, 111, 2, 802, 1, 1, 20, 2, 1))
ieee8021_as_groups = mib_identifier((1, 3, 111, 2, 802, 1, 1, 20, 2, 2))
ieee8021_as_compliances_cor1 = mib_identifier((1, 3, 111, 2, 802, 1, 1, 20, 2, 3))
ieee8021_as_system_default_reqd_group = object_group((1, 3, 111, 2, 802, 1, 1, 20, 2, 2, 1)).setObjects(('IEEE8021-AS-MIB', 'ieee8021AsDefaultDSClockIdentity'), ('IEEE8021-AS-MIB', 'ieee8021AsDefaultDSNumberPorts'), ('IEEE8021-AS-MIB', 'ieee8021AsDefaultDSClockClass'), ('IEEE8021-AS-MIB', 'ieee8021AsDefaultDSClockAccuracy'), ('IEEE8021-AS-MIB', 'ieee8021AsDefaultDSOffsetScaledLogVariance'), ('IEEE8021-AS-MIB', 'ieee8021AsDefaultDSPriority1'), ('IEEE8021-AS-MIB', 'ieee8021AsDefaultDSPriority2'), ('IEEE8021-AS-MIB', 'ieee8021AsDefaultDSGmCapable'), ('IEEE8021-AS-MIB', 'ieee8021AsDefaultDSCurrentUTCOffset'), ('IEEE8021-AS-MIB', 'ieee8021AsDefaultDSCurrentUTCOffsetValid'), ('IEEE8021-AS-MIB', 'ieee8021AsDefaultDSLeap59'), ('IEEE8021-AS-MIB', 'ieee8021AsDefaultDSLeap61'), ('IEEE8021-AS-MIB', 'ieee8021AsDefaultDSTimeTraceable'), ('IEEE8021-AS-MIB', 'ieee8021AsDefaultDSFrequencyTraceable'), ('IEEE8021-AS-MIB', 'ieee8021AsDefaultDSTimeSource'))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ieee8021_as_system_default_reqd_group = ieee8021ASSystemDefaultReqdGroup.setStatus('current')
ieee8021_as_system_current_group = object_group((1, 3, 111, 2, 802, 1, 1, 20, 2, 2, 2)).setObjects(('IEEE8021-AS-MIB', 'ieee8021AsCurrentDSStepsRemoved'), ('IEEE8021-AS-MIB', 'ieee8021AsCurrentDSOffsetFromMasterHs'), ('IEEE8021-AS-MIB', 'ieee8021AsCurrentDSOffsetFromMasterMs'), ('IEEE8021-AS-MIB', 'ieee8021AsCurrentDSOffsetFromMasterLs'), ('IEEE8021-AS-MIB', 'ieee8021AsCurrentDSLastGmPhaseChangeHs'), ('IEEE8021-AS-MIB', 'ieee8021AsCurrentDSLastGmPhaseChangeMs'), ('IEEE8021-AS-MIB', 'ieee8021AsCurrentDSLastGmPhaseChangeLs'), ('IEEE8021-AS-MIB', 'ieee8021AsCurrentDSLastGmFreqChangeMs'), ('IEEE8021-AS-MIB', 'ieee8021AsCurrentDSLastGmFreqChangeLs'), ('IEEE8021-AS-MIB', 'ieee8021AsCurrentDSGmTimebaseIndicator'), ('IEEE8021-AS-MIB', 'ieee8021AsCurrentDSGmChangeCount'), ('IEEE8021-AS-MIB', 'ieee8021AsCurrentDSTimeOfLastGmChangeEvent'), ('IEEE8021-AS-MIB', 'ieee8021AsCurrentDSTimeOfLastGmPhaseChangeEvent'), ('IEEE8021-AS-MIB', 'ieee8021AsCurrentDSTimeOfLastGmFreqChangeEvent'))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ieee8021_as_system_current_group = ieee8021ASSystemCurrentGroup.setStatus('current')
ieee8021_as_system_clock_parent_group = object_group((1, 3, 111, 2, 802, 1, 1, 20, 2, 2, 3)).setObjects(('IEEE8021-AS-MIB', 'ieee8021AsParentDSParentClockIdentity'), ('IEEE8021-AS-MIB', 'ieee8021AsParentDSParentPortNumber'), ('IEEE8021-AS-MIB', 'ieee8021AsParentDSCumlativeRateRatio'), ('IEEE8021-AS-MIB', 'ieee8021AsParentDSGrandmasterIdentity'), ('IEEE8021-AS-MIB', 'ieee8021AsParentDSGrandmasterClockClass'), ('IEEE8021-AS-MIB', 'ieee8021AsParentDSGrandmasterClockAccuracy'), ('IEEE8021-AS-MIB', 'ieee8021AsParentDSGrandmasterOffsetScaledLogVariance'), ('IEEE8021-AS-MIB', 'ieee8021AsParentDSGrandmasterPriority1'), ('IEEE8021-AS-MIB', 'ieee8021AsParentDSGrandmasterPriority2'))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ieee8021_as_system_clock_parent_group = ieee8021AsSystemClockParentGroup.setStatus('current')
ieee8021_as_system_time_properties_group = object_group((1, 3, 111, 2, 802, 1, 1, 20, 2, 2, 4)).setObjects(('IEEE8021-AS-MIB', 'ieee8021AsTimePropertiesDSCurrentUtcOffset'), ('IEEE8021-AS-MIB', 'ieee8021AsTimePropertiesDSCurrentUtcOffsetValid'), ('IEEE8021-AS-MIB', 'ieee8021AsTimePropertiesDSLeap59'), ('IEEE8021-AS-MIB', 'ieee8021AsTimePropertiesDSLeap61'), ('IEEE8021-AS-MIB', 'ieee8021AsTimePropertiesDSTimeTraceable'), ('IEEE8021-AS-MIB', 'ieee8021AsTimePropertiesDSFrequencyTraceable'), ('IEEE8021-AS-MIB', 'ieee8021AsTimePropertiesDSTimeSource'))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ieee8021_as_system_time_properties_group = ieee8021AsSystemTimePropertiesGroup.setStatus('current')
ieee8021_as_port_data_set_global_group = object_group((1, 3, 111, 2, 802, 1, 1, 20, 2, 2, 5)).setObjects(('IEEE8021-AS-MIB', 'ieee8021AsPortDSClockIdentity'), ('IEEE8021-AS-MIB', 'ieee8021AsPortDSPortNumber'), ('IEEE8021-AS-MIB', 'ieee8021AsPortDSPortRole'), ('IEEE8021-AS-MIB', 'ieee8021AsPortDSPttPortEnabled'), ('IEEE8021-AS-MIB', 'ieee8021AsPortDSIsMeasuringDelay'), ('IEEE8021-AS-MIB', 'ieee8021AsPortDSAsCapable'), ('IEEE8021-AS-MIB', 'ieee8021AsPortDSNeighborPropDelayHs'), ('IEEE8021-AS-MIB', 'ieee8021AsPortDSNeighborPropDelayMs'), ('IEEE8021-AS-MIB', 'ieee8021AsPortDSNeighborPropDelayLs'), ('IEEE8021-AS-MIB', 'ieee8021AsPortDSNeighborPropDelayThreshHs'), ('IEEE8021-AS-MIB', 'ieee8021AsPortDSNeighborPropDelayThreshMs'), ('IEEE8021-AS-MIB', 'ieee8021AsPortDSNeighborPropDelayThreshLs'), ('IEEE8021-AS-MIB', 'ieee8021AsPortDSDelayAsymmetryHs'), ('IEEE8021-AS-MIB', 'ieee8021AsPortDSDelayAsymmetryMs'), ('IEEE8021-AS-MIB', 'ieee8021AsPortDSDelayAsymmetryLs'), ('IEEE8021-AS-MIB', 'ieee8021AsPortDSNeighborRateRatio'), ('IEEE8021-AS-MIB', 'ieee8021AsPortDSInitialLogAnnounceInterval'), ('IEEE8021-AS-MIB', 'ieee8021AsPortDSCurrentLogAnnounceInterval'), ('IEEE8021-AS-MIB', 'ieee8021AsPortDSAnnounceReceiptTimeout'), ('IEEE8021-AS-MIB', 'ieee8021AsPortDSInitialLogSyncInterval'), ('IEEE8021-AS-MIB', 'ieee8021AsPortDSCurrentLogSyncInterval'), ('IEEE8021-AS-MIB', 'ieee8021AsPortDSSyncReceiptTimeout'), ('IEEE8021-AS-MIB', 'ieee8021AsPortDSSyncReceiptTimeoutTimeIntervalHs'), ('IEEE8021-AS-MIB', 'ieee8021AsPortDSSyncReceiptTimeoutTimeIntervalMs'), ('IEEE8021-AS-MIB', 'ieee8021AsPortDSSyncReceiptTimeoutTimeIntervalLs'), ('IEEE8021-AS-MIB', 'ieee8021AsPortDSInitialLogPdelayReqInterval'), ('IEEE8021-AS-MIB', 'ieee8021AsPortDSCurrentLogPdelayReqInterval'), ('IEEE8021-AS-MIB', 'ieee8021AsPortDSAllowedLostResponses'), ('IEEE8021-AS-MIB', 'ieee8021AsPortDSVersionNumber'), ('IEEE8021-AS-MIB', 'ieee8021AsPortDSNupMs'), ('IEEE8021-AS-MIB', 'ieee8021AsPortDSNupLs'), ('IEEE8021-AS-MIB', 'ieee8021AsPortDSNdownMs'), ('IEEE8021-AS-MIB', 'ieee8021AsPortDSNdownLs'), ('IEEE8021-AS-MIB', 'ieee8021AsPortDSAcceptableMasterTableEnabled'))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ieee8021_as_port_data_set_global_group = ieee8021AsPortDataSetGlobalGroup.setStatus('current')
ieee8021_as_port_statistics_global_group = object_group((1, 3, 111, 2, 802, 1, 1, 20, 2, 2, 6)).setObjects(('IEEE8021-AS-MIB', 'ieee8021AsPortStatRxSyncCount'), ('IEEE8021-AS-MIB', 'ieee8021AsPortStatRxFollowUpCount'), ('IEEE8021-AS-MIB', 'ieee8021AsPortStatRxPdelayRequest'), ('IEEE8021-AS-MIB', 'ieee8021AsPortStatRxPdelayResponse'), ('IEEE8021-AS-MIB', 'ieee8021AsPortStatRxPdelayResponseFollowUp'), ('IEEE8021-AS-MIB', 'ieee8021AsPortStatRxAnnounce'), ('IEEE8021-AS-MIB', 'ieee8021AsPortStatRxPTPPacketDiscard'), ('IEEE8021-AS-MIB', 'ieee8021AsPortStatRxSyncReceiptTimeouts'), ('IEEE8021-AS-MIB', 'ieee8021AsPortStatAnnounceReceiptTimeouts'), ('IEEE8021-AS-MIB', 'ieee8021AsPortStatPdelayAllowedLostResponsesExceeded'), ('IEEE8021-AS-MIB', 'ieee8021AsPortStatTxSyncCount'), ('IEEE8021-AS-MIB', 'ieee8021AsPortStatTxFollowUpCount'), ('IEEE8021-AS-MIB', 'ieee8021AsPortStatTxPdelayRequest'), ('IEEE8021-AS-MIB', 'ieee8021AsPortStatTxPdelayResponse'), ('IEEE8021-AS-MIB', 'ieee8021AsPortStatTxPdelayResponseFollowUp'), ('IEEE8021-AS-MIB', 'ieee8021AsPortStatTxAnnounce'))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ieee8021_as_port_statistics_global_group = ieee8021ASPortStatisticsGlobalGroup.setStatus('current')
ieee8021_as_acceptable_master_base_group = object_group((1, 3, 111, 2, 802, 1, 1, 20, 2, 2, 7)).setObjects(('IEEE8021-AS-MIB', 'ieee8021AsAcceptableMasterTableDSMaxTableSize'), ('IEEE8021-AS-MIB', 'ieee8021AsAcceptableMasterTableDSActualTableSize'))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ieee8021_as_acceptable_master_base_group = ieee8021AsAcceptableMasterBaseGroup.setStatus('current')
ieee8021_as_acceptable_master_table_group = object_group((1, 3, 111, 2, 802, 1, 1, 20, 2, 2, 8)).setObjects(('IEEE8021-AS-MIB', 'ieee8021AsAcceptableMasterClockIdentity'), ('IEEE8021-AS-MIB', 'ieee8021AsAcceptableMasterPortNumber'), ('IEEE8021-AS-MIB', 'ieee8021AsAcceptableMasterAlternatePriority1'), ('IEEE8021-AS-MIB', 'ieee8021AsAcceptableMasterRowStatus'))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ieee8021_as_acceptable_master_table_group = ieee8021AsAcceptableMasterTableGroup.setStatus('current')
ieee8021_as_compliance = module_compliance((1, 3, 111, 2, 802, 1, 1, 20, 2, 1, 1)).setObjects(('SNMPv2-MIB', 'systemGroup'), ('IF-MIB', 'ifGeneralInformationGroup'), ('IEEE8021-AS-MIB', 'ieee8021ASSystemDefaultReqdGroup'), ('IEEE8021-AS-MIB', 'ieee8021ASSystemCurrentGroup'), ('IEEE8021-AS-MIB', 'ieee8021AsSystemClockParentGroup'), ('IEEE8021-AS-MIB', 'ieee8021AsSystemTimePropertiesGroup'), ('IEEE8021-AS-MIB', 'ieee8021AsPortDataSetGlobalGroup'), ('IEEE8021-AS-MIB', 'ieee8021AsAcceptableMasterBaseGroup'), ('IEEE8021-AS-MIB', 'ieee8021AsAcceptableMasterTableGroup'))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ieee8021_as_compliance = ieee8021AsCompliance.setStatus('deprecated')
ieee8021_as_compliance_cor1 = module_compliance((1, 3, 111, 2, 802, 1, 1, 20, 2, 1, 2)).setObjects(('SNMPv2-MIB', 'systemGroup'), ('IF-MIB', 'ifGeneralInformationGroup'), ('IEEE8021-AS-MIB', 'ieee8021ASSystemDefaultReqdGroup'), ('IEEE8021-AS-MIB', 'ieee8021ASSystemCurrentGroup'), ('IEEE8021-AS-MIB', 'ieee8021AsSystemClockParentGroup'), ('IEEE8021-AS-MIB', 'ieee8021AsSystemTimePropertiesGroup'), ('IEEE8021-AS-MIB', 'ieee8021AsPortDataSetGlobalGroup'), ('IEEE8021-AS-MIB', 'ieee8021AsAcceptableMasterBaseGroup'), ('IEEE8021-AS-MIB', 'ieee8021AsAcceptableMasterTableGroup'))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ieee8021_as_compliance_cor1 = ieee8021AsComplianceCor1.setStatus('current')
mibBuilder.exportSymbols('IEEE8021-AS-MIB', ieee8021AsSystemClockParentGroup=ieee8021AsSystemClockParentGroup, ieee8021AsTimePropertiesDS=ieee8021AsTimePropertiesDS, ieee8021AsPortStatIfEntry=ieee8021AsPortStatIfEntry, ieee8021AsParentDSParentPortNumber=ieee8021AsParentDSParentPortNumber, ieee8021AsPortDSCurrentLogSyncInterval=ieee8021AsPortDSCurrentLogSyncInterval, ieee8021AsPortStatRxPdelayRequest=ieee8021AsPortStatRxPdelayRequest, ieee8021AsDefaultDSCurrentUTCOffsetValid=ieee8021AsDefaultDSCurrentUTCOffsetValid, ieee8021AsPortDSIfEntry=ieee8021AsPortDSIfEntry, ieee8021AsPortStatRxAnnounce=ieee8021AsPortStatRxAnnounce, ieee8021AsGroups=ieee8021AsGroups, ieee8021AsAcceptableMasterTableGroup=ieee8021AsAcceptableMasterTableGroup, ieee8021AsPortDSCurrentLogAnnounceInterval=ieee8021AsPortDSCurrentLogAnnounceInterval, ieee8021AsMIBObjects=ieee8021AsMIBObjects, IEEE8021ASClockClassValue=IEEE8021ASClockClassValue, ieee8021AsDefaultDSLeap61=ieee8021AsDefaultDSLeap61, ieee8021AsPortDSNeighborPropDelayThreshLs=ieee8021AsPortDSNeighborPropDelayThreshLs, ieee8021AsTimePropertiesDSCurrentUtcOffset=ieee8021AsTimePropertiesDSCurrentUtcOffset, ieee8021AsPortStatRxPTPPacketDiscard=ieee8021AsPortStatRxPTPPacketDiscard, ieee8021AsPortDSNupMs=ieee8021AsPortDSNupMs, ieee8021AsPortDSAcceptableMasterTableEnabled=ieee8021AsPortDSAcceptableMasterTableEnabled, ieee8021AsSystemTimePropertiesGroup=ieee8021AsSystemTimePropertiesGroup, ieee8021AsPortStatRxPdelayResponseFollowUp=ieee8021AsPortStatRxPdelayResponseFollowUp, ieee8021AsCompliances=ieee8021AsCompliances, ieee8021AsComplianceCor1=ieee8021AsComplianceCor1, ieee8021AsPortStatTxPdelayRequest=ieee8021AsPortStatTxPdelayRequest, ieee8021AsBridgeBasePort=ieee8021AsBridgeBasePort, ieee8021AsCurrentDS=ieee8021AsCurrentDS, ieee8021AsParentDSGrandmasterPriority2=ieee8021AsParentDSGrandmasterPriority2, ieee8021AsCurrentDSLastGmPhaseChangeMs=ieee8021AsCurrentDSLastGmPhaseChangeMs, ieee8021AsCompliancesCor1=ieee8021AsCompliancesCor1, ieee8021AsPortDSIsMeasuringDelay=ieee8021AsPortDSIsMeasuringDelay, ieee8021AsPortDSPortNumber=ieee8021AsPortDSPortNumber, ieee8021AsPortDSClockIdentity=ieee8021AsPortDSClockIdentity, ieee8021AsPortStatTxSyncCount=ieee8021AsPortStatTxSyncCount, ieee8021AsParentDSCumlativeRateRatio=ieee8021AsParentDSCumlativeRateRatio, ieee8021AsPortDSPortRole=ieee8021AsPortDSPortRole, ieee8021AsPortDSDelayAsymmetryHs=ieee8021AsPortDSDelayAsymmetryHs, ieee8021AsPortDSSyncReceiptTimeoutTimeIntervalLs=ieee8021AsPortDSSyncReceiptTimeoutTimeIntervalLs, ieee8021AsParentDSParentClockIdentity=ieee8021AsParentDSParentClockIdentity, ieee8021AsPortDSVersionNumber=ieee8021AsPortDSVersionNumber, ieee8021AsPortDataSetGlobalGroup=ieee8021AsPortDataSetGlobalGroup, ieee8021AsCurrentDSLastGmPhaseChangeHs=ieee8021AsCurrentDSLastGmPhaseChangeHs, ieee8021AsDefaultDSTimeSource=ieee8021AsDefaultDSTimeSource, ieee8021AsCompliance=ieee8021AsCompliance, ieee8021AsPortStatRxSyncCount=ieee8021AsPortStatRxSyncCount, ieee8021AsParentDSGrandmasterClockClass=ieee8021AsParentDSGrandmasterClockClass, ieee8021AsDefaultDSLeap59=ieee8021AsDefaultDSLeap59, ieee8021AsParentDSGrandmasterClockAccuracy=ieee8021AsParentDSGrandmasterClockAccuracy, ieee8021AsDefaultDSTimeTraceable=ieee8021AsDefaultDSTimeTraceable, ieee8021AsPortStatRxFollowUpCount=ieee8021AsPortStatRxFollowUpCount, ieee8021AsPortStatRxPdelayResponse=ieee8021AsPortStatRxPdelayResponse, ieee8021AsAcceptableMasterBaseGroup=ieee8021AsAcceptableMasterBaseGroup, PYSNMP_MODULE_ID=ieee8021AsTimeSyncMib, ieee8021AsAcceptableMasterTableDSActualTableSize=ieee8021AsAcceptableMasterTableDSActualTableSize, ieee8021ASSystemCurrentGroup=ieee8021ASSystemCurrentGroup, ieee8021AsDefaultDSNumberPorts=ieee8021AsDefaultDSNumberPorts, ieee8021AsCurrentDSStepsRemoved=ieee8021AsCurrentDSStepsRemoved, ieee8021AsPortStatTxAnnounce=ieee8021AsPortStatTxAnnounce, ieee8021AsCurrentDSLastGmPhaseChangeLs=ieee8021AsCurrentDSLastGmPhaseChangeLs, ieee8021AsPortDSDelayAsymmetryLs=ieee8021AsPortDSDelayAsymmetryLs, ieee8021AsPortDSNeighborRateRatio=ieee8021AsPortDSNeighborRateRatio, ieee8021AsAcceptableMasterTableDS=ieee8021AsAcceptableMasterTableDS, ieee8021AsPortDSIfTable=ieee8021AsPortDSIfTable, ieee8021AsTimePropertiesDSCurrentUtcOffsetValid=ieee8021AsTimePropertiesDSCurrentUtcOffsetValid, ieee8021AsPortDSAllowedLostResponses=ieee8021AsPortDSAllowedLostResponses, ieee8021AsCurrentDSLastGmFreqChangeLs=ieee8021AsCurrentDSLastGmFreqChangeLs, ieee8021AsPortDSNeighborPropDelayMs=ieee8021AsPortDSNeighborPropDelayMs, ieee8021AsPortStatTxPdelayResponseFollowUp=ieee8021AsPortStatTxPdelayResponseFollowUp, ieee8021AsAcceptableMasterTableDSMasterEntry=ieee8021AsAcceptableMasterTableDSMasterEntry, ieee8021AsTimePropertiesDSTimeSource=ieee8021AsTimePropertiesDSTimeSource, ieee8021AsTimePropertiesDSTimeTraceable=ieee8021AsTimePropertiesDSTimeTraceable, ieee8021AsPortDSAsCapable=ieee8021AsPortDSAsCapable, ieee8021AsPortDSNdownLs=ieee8021AsPortDSNdownLs, ieee8021AsParentDSGrandmasterOffsetScaledLogVariance=ieee8021AsParentDSGrandmasterOffsetScaledLogVariance, ieee8021AsPortDSNeighborPropDelayThreshMs=ieee8021AsPortDSNeighborPropDelayThreshMs, ieee8021AsPortDSAsIfIndex=ieee8021AsPortDSAsIfIndex, ieee8021AsPortDSNeighborPropDelayHs=ieee8021AsPortDSNeighborPropDelayHs, ieee8021AsPortDSNeighborPropDelayLs=ieee8021AsPortDSNeighborPropDelayLs, ieee8021AsCurrentDSTimeOfLastGmPhaseChangeEvent=ieee8021AsCurrentDSTimeOfLastGmPhaseChangeEvent, ieee8021AsAcceptableMasterTableDSBase=ieee8021AsAcceptableMasterTableDSBase, ieee8021AsPortStatAnnounceReceiptTimeouts=ieee8021AsPortStatAnnounceReceiptTimeouts, ieee8021ASSystemDefaultReqdGroup=ieee8021ASSystemDefaultReqdGroup, IEEE8021ASClockAccuracyValue=IEEE8021ASClockAccuracyValue, ieee8021AsConformance=ieee8021AsConformance, ieee8021AsCurrentDSOffsetFromMasterHs=ieee8021AsCurrentDSOffsetFromMasterHs, ieee8021AsPortDSAnnounceReceiptTimeout=ieee8021AsPortDSAnnounceReceiptTimeout, ieee8021AsParentDSGrandmasterPriority1=ieee8021AsParentDSGrandmasterPriority1, ieee8021AsCurrentDSOffsetFromMasterMs=ieee8021AsCurrentDSOffsetFromMasterMs, ieee8021AsDefaultDSFrequencyTraceable=ieee8021AsDefaultDSFrequencyTraceable, ieee8021AsPortDSInitialLogPdelayReqInterval=ieee8021AsPortDSInitialLogPdelayReqInterval, ieee8021AsCurrentDSGmChangeCount=ieee8021AsCurrentDSGmChangeCount, ieee8021AsAcceptableMasterPortNumber=ieee8021AsAcceptableMasterPortNumber, ieee8021AsPortDSNdownMs=ieee8021AsPortDSNdownMs, ieee8021AsPortDSCurrentLogPdelayReqInterval=ieee8021AsPortDSCurrentLogPdelayReqInterval, ieee8021AsAcceptableMasterTableDSMaxTableSize=ieee8021AsAcceptableMasterTableDSMaxTableSize, ieee8021AsCurrentDSTimeOfLastGmFreqChangeEvent=ieee8021AsCurrentDSTimeOfLastGmFreqChangeEvent, ieee8021AsDefaultDSOffsetScaledLogVariance=ieee8021AsDefaultDSOffsetScaledLogVariance, ieee8021AsPortStatPdelayAllowedLostResponsesExceeded=ieee8021AsPortStatPdelayAllowedLostResponsesExceeded, ieee8021AsAcceptableMasterTableDSMasterTable=ieee8021AsAcceptableMasterTableDSMasterTable, ieee8021AsAcceptableMasterAlternatePriority1=ieee8021AsAcceptableMasterAlternatePriority1, ieee8021AsPortStatRxSyncReceiptTimeouts=ieee8021AsPortStatRxSyncReceiptTimeouts, ieee8021AsAcceptableMasterClockIdentity=ieee8021AsAcceptableMasterClockIdentity, ieee8021AsDefaultDSCurrentUTCOffset=ieee8021AsDefaultDSCurrentUTCOffset, ieee8021AsPortDSSyncReceiptTimeoutTimeIntervalMs=ieee8021AsPortDSSyncReceiptTimeoutTimeIntervalMs, ieee8021AsCurrentDSGmTimebaseIndicator=ieee8021AsCurrentDSGmTimebaseIndicator, ieee8021AsTimePropertiesDSLeap61=ieee8021AsTimePropertiesDSLeap61, ieee8021AsPortDSSyncReceiptTimeout=ieee8021AsPortDSSyncReceiptTimeout, ieee8021AsDefaultDSClockClass=ieee8021AsDefaultDSClockClass, ieee8021AsPortStatTxPdelayResponse=ieee8021AsPortStatTxPdelayResponse, ieee8021AsCurrentDSOffsetFromMasterLs=ieee8021AsCurrentDSOffsetFromMasterLs, ieee8021AsPortDSDelayAsymmetryMs=ieee8021AsPortDSDelayAsymmetryMs, IEEE8021ASTimeSourceValue=IEEE8021ASTimeSourceValue, ieee8021AsPortStatTxFollowUpCount=ieee8021AsPortStatTxFollowUpCount, ClockIdentity=ClockIdentity, ieee8021AsDefaultDSPriority1=ieee8021AsDefaultDSPriority1, ieee8021AsPortStatIfTable=ieee8021AsPortStatIfTable, ieee8021AsParentDS=ieee8021AsParentDS, ieee8021AsAcceptableMasterRowStatus=ieee8021AsAcceptableMasterRowStatus, ieee8021AsDefaultDSClockAccuracy=ieee8021AsDefaultDSClockAccuracy, ieee8021AsPortDSNupLs=ieee8021AsPortDSNupLs, ieee8021AsAcceptableMasterTableDSMaster=ieee8021AsAcceptableMasterTableDSMaster, ieee8021AsTimePropertiesDSLeap59=ieee8021AsTimePropertiesDSLeap59, ieee8021AsDefaultDSClockIdentity=ieee8021AsDefaultDSClockIdentity, ieee8021AsDefaultDSPriority2=ieee8021AsDefaultDSPriority2, ieee8021AsParentDSGrandmasterIdentity=ieee8021AsParentDSGrandmasterIdentity, ieee8021AsTimeSyncMib=ieee8021AsTimeSyncMib, ieee8021AsCurrentDSLastGmFreqChangeMs=ieee8021AsCurrentDSLastGmFreqChangeMs, ieee8021AsDefaultDS=ieee8021AsDefaultDS, ieee8021AsPortDSInitialLogAnnounceInterval=ieee8021AsPortDSInitialLogAnnounceInterval, ieee8021ASPortStatisticsGlobalGroup=ieee8021ASPortStatisticsGlobalGroup, ieee8021AsPortDSSyncReceiptTimeoutTimeIntervalHs=ieee8021AsPortDSSyncReceiptTimeoutTimeIntervalHs, ieee8021AsPortDSInitialLogSyncInterval=ieee8021AsPortDSInitialLogSyncInterval, ieee8021AsPortDSPttPortEnabled=ieee8021AsPortDSPttPortEnabled, ieee8021AsAcceptableMasterTableDSMasterId=ieee8021AsAcceptableMasterTableDSMasterId, ieee8021AsDefaultDSGmCapable=ieee8021AsDefaultDSGmCapable, ieee8021AsTimePropertiesDSFrequencyTraceable=ieee8021AsTimePropertiesDSFrequencyTraceable, ieee8021AsCurrentDSTimeOfLastGmChangeEvent=ieee8021AsCurrentDSTimeOfLastGmChangeEvent, ieee8021AsPortDSNeighborPropDelayThreshHs=ieee8021AsPortDSNeighborPropDelayThreshHs) |
class MyQueue:
def __init__(self):
"""
Initialize your data structure here.
"""
self.push_stack = []
self.pop_stack = []
def push(self, x: int) -> None:
"""
Push element x to the back of queue.
"""
self.push_stack.append(x)
def pop(self) -> int:
"""
Removes the element from in front of queue and returns that element.
"""
if not self.empty():
if not self.pop_stack:
for i in range(len(self.push_stack)):
self.pop_stack.append(self.push_stack.pop())
return self.pop_stack.pop()
def peek(self) -> int:
"""
Get the front element.
"""
if not self.empty():
if not self.pop_stack:
for i in range(len(self.push_stack)):
self.pop_stack.append(self.push_stack.pop())
return self.pop_stack[-1]
def empty(self) -> bool:
"""
Returns whether the queue is empty.
"""
return not self.push_stack and not self.pop_stack
obj = MyQueue()
obj.push(1)
obj.push(2)
print(obj.peek())
print(obj.pop())
print(obj.empty()) | class Myqueue:
def __init__(self):
"""
Initialize your data structure here.
"""
self.push_stack = []
self.pop_stack = []
def push(self, x: int) -> None:
"""
Push element x to the back of queue.
"""
self.push_stack.append(x)
def pop(self) -> int:
"""
Removes the element from in front of queue and returns that element.
"""
if not self.empty():
if not self.pop_stack:
for i in range(len(self.push_stack)):
self.pop_stack.append(self.push_stack.pop())
return self.pop_stack.pop()
def peek(self) -> int:
"""
Get the front element.
"""
if not self.empty():
if not self.pop_stack:
for i in range(len(self.push_stack)):
self.pop_stack.append(self.push_stack.pop())
return self.pop_stack[-1]
def empty(self) -> bool:
"""
Returns whether the queue is empty.
"""
return not self.push_stack and (not self.pop_stack)
obj = my_queue()
obj.push(1)
obj.push(2)
print(obj.peek())
print(obj.pop())
print(obj.empty()) |
name = input()
salary = float(input())
cash = float(input())
print("TOTAL = R$ %.2f" % (salary + (cash * 0.15))) | name = input()
salary = float(input())
cash = float(input())
print('TOTAL = R$ %.2f' % (salary + cash * 0.15)) |
# This file was automatically generated from "zigZagLevel.ma"
points = {}
boxes = {}
boxes['areaOfInterestBounds'] = (-1.807378035, 3.943412768, -1.61304303) + (0.0, 0.0, 0.0) + (23.01413538, 13.27980464, 10.0098376)
points['ffaSpawn1'] = (-9.523537347, 4.645005984, -3.193868606) + (0.8511546708, 1.0, 1.303629055)
points['ffaSpawn2'] = (6.217011718, 4.632396767, -3.190279407) + (0.8844870264, 1.0, 1.303629055)
points['ffaSpawn3'] = (-4.433947713, 3.005988298, -4.908942678) + (1.531254794, 1.0, 0.7550370795)
points['ffaSpawn4'] = (1.457496709, 3.01461103, -4.907036892) + (1.531254794, 1.0, 0.7550370795)
points['flag1'] = (-9.969465388, 4.651689505, -4.965994534)
points['flag2'] = (6.844972512, 4.652142027, -4.951156148)
points['flag3'] = (1.155692239, 2.973774873, -4.890524808)
points['flag4'] = (-4.224099354, 3.006208239, -4.890524808)
points['flagDefault'] = (-1.42651413, 3.018804771, 0.8808626995)
boxes['levelBounds'] = (-1.567840276, 8.764115729, -1.311948055) + (0.0, 0.0, 0.0) + (28.76792809, 17.64963076, 19.52220249)
points['powerupSpawn1'] = (2.55551802, 4.369175386, -4.798598276)
points['powerupSpawn2'] = (-6.02484656, 4.369175386, -4.798598276)
points['powerupSpawn3'] = (5.557525662, 5.378865401, -4.798598276)
points['powerupSpawn4'] = (-8.792856883, 5.378865401, -4.816871147)
points['shadowLowerBottom'] = (-1.42651413, 1.681630068, 4.790029929)
points['shadowLowerTop'] = (-1.42651413, 2.54918356, 4.790029929)
points['shadowUpperBottom'] = (-1.42651413, 6.802574329, 4.790029929)
points['shadowUpperTop'] = (-1.42651413, 8.779767257, 4.790029929)
points['spawn1'] = (-9.523537347, 4.645005984, -3.193868606) + (0.8511546708, 1.0, 1.303629055)
points['spawn2'] = (6.217011718, 4.632396767, -3.190279407) + (0.8844870264, 1.0, 1.303629055)
points['spawnByFlag1'] = (-9.523537347, 4.645005984, -3.193868606) + (0.8511546708, 1.0, 1.303629055)
points['spawnByFlag2'] = (6.217011718, 4.632396767, -3.190279407) + (0.8844870264, 1.0, 1.303629055)
points['spawnByFlag3'] = (1.457496709, 3.01461103, -4.907036892) + (1.531254794, 1.0, 0.7550370795)
points['spawnByFlag4'] = (-4.433947713, 3.005988298, -4.908942678) + (1.531254794, 1.0, 0.7550370795)
points['tnt1'] = (-1.42651413, 4.045239665, 0.04094631341)
| points = {}
boxes = {}
boxes['areaOfInterestBounds'] = (-1.807378035, 3.943412768, -1.61304303) + (0.0, 0.0, 0.0) + (23.01413538, 13.27980464, 10.0098376)
points['ffaSpawn1'] = (-9.523537347, 4.645005984, -3.193868606) + (0.8511546708, 1.0, 1.303629055)
points['ffaSpawn2'] = (6.217011718, 4.632396767, -3.190279407) + (0.8844870264, 1.0, 1.303629055)
points['ffaSpawn3'] = (-4.433947713, 3.005988298, -4.908942678) + (1.531254794, 1.0, 0.7550370795)
points['ffaSpawn4'] = (1.457496709, 3.01461103, -4.907036892) + (1.531254794, 1.0, 0.7550370795)
points['flag1'] = (-9.969465388, 4.651689505, -4.965994534)
points['flag2'] = (6.844972512, 4.652142027, -4.951156148)
points['flag3'] = (1.155692239, 2.973774873, -4.890524808)
points['flag4'] = (-4.224099354, 3.006208239, -4.890524808)
points['flagDefault'] = (-1.42651413, 3.018804771, 0.8808626995)
boxes['levelBounds'] = (-1.567840276, 8.764115729, -1.311948055) + (0.0, 0.0, 0.0) + (28.76792809, 17.64963076, 19.52220249)
points['powerupSpawn1'] = (2.55551802, 4.369175386, -4.798598276)
points['powerupSpawn2'] = (-6.02484656, 4.369175386, -4.798598276)
points['powerupSpawn3'] = (5.557525662, 5.378865401, -4.798598276)
points['powerupSpawn4'] = (-8.792856883, 5.378865401, -4.816871147)
points['shadowLowerBottom'] = (-1.42651413, 1.681630068, 4.790029929)
points['shadowLowerTop'] = (-1.42651413, 2.54918356, 4.790029929)
points['shadowUpperBottom'] = (-1.42651413, 6.802574329, 4.790029929)
points['shadowUpperTop'] = (-1.42651413, 8.779767257, 4.790029929)
points['spawn1'] = (-9.523537347, 4.645005984, -3.193868606) + (0.8511546708, 1.0, 1.303629055)
points['spawn2'] = (6.217011718, 4.632396767, -3.190279407) + (0.8844870264, 1.0, 1.303629055)
points['spawnByFlag1'] = (-9.523537347, 4.645005984, -3.193868606) + (0.8511546708, 1.0, 1.303629055)
points['spawnByFlag2'] = (6.217011718, 4.632396767, -3.190279407) + (0.8844870264, 1.0, 1.303629055)
points['spawnByFlag3'] = (1.457496709, 3.01461103, -4.907036892) + (1.531254794, 1.0, 0.7550370795)
points['spawnByFlag4'] = (-4.433947713, 3.005988298, -4.908942678) + (1.531254794, 1.0, 0.7550370795)
points['tnt1'] = (-1.42651413, 4.045239665, 0.04094631341) |
class Manager(object):
def setup(self):
return
def update(self):
return
def stop(self):
return | class Manager(object):
def setup(self):
return
def update(self):
return
def stop(self):
return |
#py_dict_1.py
mydict={}
mydict['team'] = 'Cubs'
#another way to add elements us via update(). For input, just about
# any iterable that's comprised of 2-element iterables will work.
mydict.update([('town', 'Chicago'), ('rival', 'Cards')])
#we can print it out using the items() method (it returns a tuple)
for key, value in mydict.items():
print("key is {} and value is {}".format(key, value))
print("let's get rid of a rival")
print()
#and evaluates left to right; this protects from crashes if no 'rival'
if "rival" in mydict and mydict['rival'] == 'Cards':
#note that del is NOT a dict method
del(mydict['rival'])
print()
print("by the grace of a top-level function, the Cards are gone:\n")
| mydict = {}
mydict['team'] = 'Cubs'
mydict.update([('town', 'Chicago'), ('rival', 'Cards')])
for (key, value) in mydict.items():
print('key is {} and value is {}'.format(key, value))
print("let's get rid of a rival")
print()
if 'rival' in mydict and mydict['rival'] == 'Cards':
del mydict['rival']
print()
print('by the grace of a top-level function, the Cards are gone:\n') |
days = int(input())
type_room = input()
grade = input()
nights = days - 1
if type_room == 'room for one person' and grade == 'positive':
price = nights * 18
price += price * 0.25
print(f'{price:.2f}')
elif type_room == 'room for one person' and grade =='negative':
price = nights * 18
price -= price * 0.1
print(f'{price:.2f}')
elif type_room == 'apartment' and grade == 'positive':
if nights < 10:
price = nights * 25
price -= price * 0.3
price += price * 0.25
print(f'{price:.2f}')
elif 10 <= nights <= 15:
price = nights * 25
price -= price * 0.35
price += price * 0.25
print(f'{price:.2f}')
elif nights > 15:
price = nights * 25
price -= price * 0.5
price += price * 0.25
print(f'{price:.2f}')
elif type_room == 'apartment' and grade == 'negative':
if nights < 10:
price = nights * 25
price -= price * 0.3
price -= price * 0.1
print(f'{price:.2f}')
elif 10 <= nights <= 15:
price = nights * 25
price -= price * 0.35
price -= price * 0.1
print(f'{price:.2f}')
elif nights > 15:
price = nights * 25
price -= price * 0.5
price -= price * 0.1
print(f'{price:.2f}')
elif type_room == 'president apartment' and grade == 'positive':
if nights < 10:
price = nights * 35
price -= price * 0.1
price += price * 0.25
print(f'{price:.2f}')
elif 10 <= nights <= 15:
price = nights * 25
price -= price * 0.15
price += price * 0.25
print(f'{price:.2f}')
elif nights > 15:
price = nights * 35
price -= price * 0.2
price += price * 0.25
print(f'{price:.2f}')
elif type_room == 'president apartment' and grade == 'negative':
if nights < 10:
price = nights * 35
price -= price * 0.1
price -= price * 0.1
print(f'{price:.2f}')
elif 10 <= nights <= 15:
price = nights * 25
price -= price * 0.15
price -= price * 0.1
print(f'{price:.2f}')
elif nights > 15:
price = nights * 35
price -= price * 0.2
price -= price * 0.1
print(f'{price:.2f}') | days = int(input())
type_room = input()
grade = input()
nights = days - 1
if type_room == 'room for one person' and grade == 'positive':
price = nights * 18
price += price * 0.25
print(f'{price:.2f}')
elif type_room == 'room for one person' and grade == 'negative':
price = nights * 18
price -= price * 0.1
print(f'{price:.2f}')
elif type_room == 'apartment' and grade == 'positive':
if nights < 10:
price = nights * 25
price -= price * 0.3
price += price * 0.25
print(f'{price:.2f}')
elif 10 <= nights <= 15:
price = nights * 25
price -= price * 0.35
price += price * 0.25
print(f'{price:.2f}')
elif nights > 15:
price = nights * 25
price -= price * 0.5
price += price * 0.25
print(f'{price:.2f}')
elif type_room == 'apartment' and grade == 'negative':
if nights < 10:
price = nights * 25
price -= price * 0.3
price -= price * 0.1
print(f'{price:.2f}')
elif 10 <= nights <= 15:
price = nights * 25
price -= price * 0.35
price -= price * 0.1
print(f'{price:.2f}')
elif nights > 15:
price = nights * 25
price -= price * 0.5
price -= price * 0.1
print(f'{price:.2f}')
elif type_room == 'president apartment' and grade == 'positive':
if nights < 10:
price = nights * 35
price -= price * 0.1
price += price * 0.25
print(f'{price:.2f}')
elif 10 <= nights <= 15:
price = nights * 25
price -= price * 0.15
price += price * 0.25
print(f'{price:.2f}')
elif nights > 15:
price = nights * 35
price -= price * 0.2
price += price * 0.25
print(f'{price:.2f}')
elif type_room == 'president apartment' and grade == 'negative':
if nights < 10:
price = nights * 35
price -= price * 0.1
price -= price * 0.1
print(f'{price:.2f}')
elif 10 <= nights <= 15:
price = nights * 25
price -= price * 0.15
price -= price * 0.1
print(f'{price:.2f}')
elif nights > 15:
price = nights * 35
price -= price * 0.2
price -= price * 0.1
print(f'{price:.2f}') |
'''https://github.com/be-unkind/skyscrapers_ucu'''
def read_input(path: str) -> list:
'''
Read game board file from path.
Return list of str.
'''
result = []
with open(path, 'r') as file:
for line in file:
line = line.replace('\n', '')
result.append(line)
return result
# print(read_input("check.txt"))
def left_to_right_check(input_line: str, pivot: int) -> bool:
'''
Check row-wise visibility from left to right.
Return True if number of building from the left-most hint is visible looking to the right,
False otherwise.
input_line - representing board row.
pivot - number on the left-most hint of the input_line.
>>> left_to_right_check("412453*", 4)
True
'''
count = 0
temporary_lst = []
input_lst = list(input_line)
if '*' in input_lst:
input_lst.remove('*')
for element in input_lst:
if int(element) == pivot:
idx_of_element = input_lst.index(element)
for element1 in input_lst[idx_of_element:]:
if len(temporary_lst) == 0:
temporary_lst.append(int(element1))
else:
if int(element1) > temporary_lst[0]:
count+=1
del temporary_lst[0]
if count == pivot:
return True
else:
return False
# print(left_to_right_check("452453*", 5))
def check_not_finished_board(board: list) -> bool:
'''
Check if skyscraper board is not finished, i.e., '?' present on the game board.
Return True if finished, False otherwise.
>>> check_not_finished_board(['***21**', '4?????*', '4?????*', '*?????5', '*?????*', '*?????*', '*2*1***'])
False
'''
check_lst = []
for element in board:
if '?' in element:
check_lst.append('False')
else:
check_lst.append('True')
if 'False' in check_lst:
return False
else:
return True
# print(check_not_finished_board(['***21**', '412453*', '423145*', '*543215', '*35214*', '*41532*', '*2*1***']))
def check_uniqueness_in_rows(board: list) -> bool:
'''
Check buildings of unique height in each row.
Return True if buildings in a row have unique length, False otherwise.
>>> check_uniqueness_in_rows(['***21**', '412453*', '423145*', '*543215', '*35214*', '*41532*', '*2*1***'])
True
'''
temporary_lst = []
for element in board:
element_lst = list(element)
del element_lst[0]
del element_lst[len(element_lst)-1]
for count in range(len(element_lst) + 1):
if '*' in element_lst:
element_lst.remove('*')
if len(element_lst) != len(set(element_lst)):
temporary_lst.append('False')
else:
temporary_lst.append('True')
if 'False' in temporary_lst:
return False
else:
return True
# print(check_uniqueness_in_rows(['***21**', '412453*', '423145*', '*543215', '*35214*', '*41532*', '*2*1***']))
def check_horizontal_visibility(board: list):
'''
Check row-wise visibility (left-right and vice versa)
Return True if all horizontal hints are satisfiable,
i.e., for line 412453* , hint is 4, and 1245 are the four buildings
that could be observed from the hint looking to the right.
>>> check_horizontal_visibility(['***21**', '412453*', '423145*', '*543215', '*35214*', '*41532*', '*2*1***'])
True
'''
res_lst = []
for element in board:
element_lst = list(element)
if (element_lst[0] == '*') and (element_lst[-1] == '*'):
continue
if element_lst[-1] == '*':
if left_to_right_check(element, element_lst[0]) == True:
res_lst.append('True')
else:
res_lst.append('False')
if element_lst[0] == '*':
element_lst.reverse()
if left_to_right_check(element, element_lst[0]) == True:
res_lst.append('True')
else:
res_lst.append('False')
if 'False' in res_lst:
return False
else:
return True
# print(check_horizontal_visibility(['***21**', '412453*', '423145*', '*543215', '*35214*', '*41532*', '*2*1***']))
def check_columns(board: list):
'''
Check column-wise compliance of the board for uniqueness (buildings of unique height) and visibility (top-bottom and vice ve
Same as for horizontal cases, but aggregated in one function for vertical case, i.e. columns.
>>> check_columns(['***21**', '412453*', '423145*', '*543215', '*35214*', '*41532*', '*2*1***'])
True
'''
pass
def check_skyscrapers(input_path: str):
'''
Main function to check the status of skyscraper game board.
Return True if the board status is compliant with the rules,
False otherwise.
'''
pass
# if __name__ == "__main__":
# print(check_skyscrapers("check.txt"))
print(left_to_right_check("132345*", 3))
| """https://github.com/be-unkind/skyscrapers_ucu"""
def read_input(path: str) -> list:
"""
Read game board file from path.
Return list of str.
"""
result = []
with open(path, 'r') as file:
for line in file:
line = line.replace('\n', '')
result.append(line)
return result
def left_to_right_check(input_line: str, pivot: int) -> bool:
"""
Check row-wise visibility from left to right.
Return True if number of building from the left-most hint is visible looking to the right,
False otherwise.
input_line - representing board row.
pivot - number on the left-most hint of the input_line.
>>> left_to_right_check("412453*", 4)
True
"""
count = 0
temporary_lst = []
input_lst = list(input_line)
if '*' in input_lst:
input_lst.remove('*')
for element in input_lst:
if int(element) == pivot:
idx_of_element = input_lst.index(element)
for element1 in input_lst[idx_of_element:]:
if len(temporary_lst) == 0:
temporary_lst.append(int(element1))
elif int(element1) > temporary_lst[0]:
count += 1
del temporary_lst[0]
if count == pivot:
return True
else:
return False
def check_not_finished_board(board: list) -> bool:
"""
Check if skyscraper board is not finished, i.e., '?' present on the game board.
Return True if finished, False otherwise.
>>> check_not_finished_board(['***21**', '4?????*', '4?????*', '*?????5', '*?????*', '*?????*', '*2*1***'])
False
"""
check_lst = []
for element in board:
if '?' in element:
check_lst.append('False')
else:
check_lst.append('True')
if 'False' in check_lst:
return False
else:
return True
def check_uniqueness_in_rows(board: list) -> bool:
"""
Check buildings of unique height in each row.
Return True if buildings in a row have unique length, False otherwise.
>>> check_uniqueness_in_rows(['***21**', '412453*', '423145*', '*543215', '*35214*', '*41532*', '*2*1***'])
True
"""
temporary_lst = []
for element in board:
element_lst = list(element)
del element_lst[0]
del element_lst[len(element_lst) - 1]
for count in range(len(element_lst) + 1):
if '*' in element_lst:
element_lst.remove('*')
if len(element_lst) != len(set(element_lst)):
temporary_lst.append('False')
else:
temporary_lst.append('True')
if 'False' in temporary_lst:
return False
else:
return True
def check_horizontal_visibility(board: list):
"""
Check row-wise visibility (left-right and vice versa)
Return True if all horizontal hints are satisfiable,
i.e., for line 412453* , hint is 4, and 1245 are the four buildings
that could be observed from the hint looking to the right.
>>> check_horizontal_visibility(['***21**', '412453*', '423145*', '*543215', '*35214*', '*41532*', '*2*1***'])
True
"""
res_lst = []
for element in board:
element_lst = list(element)
if element_lst[0] == '*' and element_lst[-1] == '*':
continue
if element_lst[-1] == '*':
if left_to_right_check(element, element_lst[0]) == True:
res_lst.append('True')
else:
res_lst.append('False')
if element_lst[0] == '*':
element_lst.reverse()
if left_to_right_check(element, element_lst[0]) == True:
res_lst.append('True')
else:
res_lst.append('False')
if 'False' in res_lst:
return False
else:
return True
def check_columns(board: list):
"""
Check column-wise compliance of the board for uniqueness (buildings of unique height) and visibility (top-bottom and vice ve
Same as for horizontal cases, but aggregated in one function for vertical case, i.e. columns.
>>> check_columns(['***21**', '412453*', '423145*', '*543215', '*35214*', '*41532*', '*2*1***'])
True
"""
pass
def check_skyscrapers(input_path: str):
"""
Main function to check the status of skyscraper game board.
Return True if the board status is compliant with the rules,
False otherwise.
"""
pass
print(left_to_right_check('132345*', 3)) |
# print("Hello World")
# print("Done")
print("HelloWorld")
print("Done")
| print('HelloWorld')
print('Done') |
# !/usr/bin/env python3
#######################################################################################
# #
# Program purpose: Convert the distance (in feet) to inches, yards, and miles. #
# Program Author : Happi Yvan <ivensteinpoker@gmail.com> #
# Creation Date : August 10, 2019 #
# #
#######################################################################################
def get_inches_yards_and_miles(feet):
return [feet * 12, feet / 3.0, feet / 5280.0]
if __name__ == "__main__":
dist_feet = int(input("Input distance in feet: "))
data = get_inches_yards_and_miles(dist_feet)
print(f"The distance in inches is {data[0]} inches.")
print(f"The distance in yards is {data[1]} yards.")
print(f"The distance in miles is {data[2]} miles.") | def get_inches_yards_and_miles(feet):
return [feet * 12, feet / 3.0, feet / 5280.0]
if __name__ == '__main__':
dist_feet = int(input('Input distance in feet: '))
data = get_inches_yards_and_miles(dist_feet)
print(f'The distance in inches is {data[0]} inches.')
print(f'The distance in yards is {data[1]} yards.')
print(f'The distance in miles is {data[2]} miles.') |
#calcular el numero de vocales de una frase
frase = str(input("Digita la frase: "))
vocales = "aeiouAEIOU"
num = 0
for i in frase:
if i == "a" or i == "e" or i == "i" or i == "o" or i == "u":
num = num + 1
print ("La frase tiene: {} vocales" .format(str(num))) | frase = str(input('Digita la frase: '))
vocales = 'aeiouAEIOU'
num = 0
for i in frase:
if i == 'a' or i == 'e' or i == 'i' or (i == 'o') or (i == 'u'):
num = num + 1
print('La frase tiene: {} vocales'.format(str(num))) |
mark = float(input('mark on test?'))
if mark >= 50:
print('congratulations you passed')
else:
print('sorry you failed')
| mark = float(input('mark on test?'))
if mark >= 50:
print('congratulations you passed')
else:
print('sorry you failed') |
board_width = 4000
board_height = 1600
screen_width = 800
screen_height = 600
| board_width = 4000
board_height = 1600
screen_width = 800
screen_height = 600 |
# This test verifies that calling locals() does not pollute
# the local namespace of the class with free variables. Old
# versions of Python had a bug, where a free variable being
# passed through a class namespace would be inserted into
# locals() by locals() or exec or a trace function.
#
# The real bug lies in frame code that copies variables
# between fast locals and the locals dict, e.g. when executing
# a trace function.
def f(x):
class C:
x = 12
def m(self):
return x
locals()
return C
___assertEqual(f(1).x, 12)
def f(x):
class C:
y = x
def m(self):
return x
z = list(locals())
return C
varnames = f(1).z
___assertNotIn("x", varnames)
___assertIn("y", varnames)
| def f(x):
class C:
x = 12
def m(self):
return x
locals()
return C
___assert_equal(f(1).x, 12)
def f(x):
class C:
y = x
def m(self):
return x
z = list(locals())
return C
varnames = f(1).z
___assert_not_in('x', varnames)
___assert_in('y', varnames) |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.