content
stringlengths 7
1.05M
| fixed_cases
stringlengths 1
1.28M
|
|---|---|
DATA_TYPES = {
'AutoField': 'int IDENTITY (1, 1)',
'BooleanField': 'bit',
'CharField': 'varchar(%(maxlength)s)',
'CommaSeparatedIntegerField': 'varchar(%(maxlength)s)',
'DateField': 'smalldatetime',
'DateTimeField': 'smalldatetime',
'DecimalField': 'numeric(%(max_digits)s, %(decimal_places)s)',
'FileField': 'varchar(100)',
'FilePathField': 'varchar(100)',
'FloatField': 'double precision',
'ImageField': 'varchar(100)',
'IntegerField': 'int',
'IPAddressField': 'char(15)',
'ManyToManyField': None,
'NullBooleanField': 'bit',
'OneToOneField': 'int',
'PhoneNumberField': 'varchar(20)',
'PositiveIntegerField': 'int CONSTRAINT [CK_int_pos_%(column)s] CHECK ([%(column)s] > 0)',
'PositiveSmallIntegerField': 'smallint CONSTRAINT [CK_smallint_pos_%(column)s] CHECK ([%(column)s] > 0)',
'SlugField': 'varchar(%(maxlength)s)',
'SmallIntegerField': 'smallint',
'TextField': 'text',
'TimeField': 'time',
'USStateField': 'varchar(2)',
}
|
data_types = {'AutoField': 'int IDENTITY (1, 1)', 'BooleanField': 'bit', 'CharField': 'varchar(%(maxlength)s)', 'CommaSeparatedIntegerField': 'varchar(%(maxlength)s)', 'DateField': 'smalldatetime', 'DateTimeField': 'smalldatetime', 'DecimalField': 'numeric(%(max_digits)s, %(decimal_places)s)', 'FileField': 'varchar(100)', 'FilePathField': 'varchar(100)', 'FloatField': 'double precision', 'ImageField': 'varchar(100)', 'IntegerField': 'int', 'IPAddressField': 'char(15)', 'ManyToManyField': None, 'NullBooleanField': 'bit', 'OneToOneField': 'int', 'PhoneNumberField': 'varchar(20)', 'PositiveIntegerField': 'int CONSTRAINT [CK_int_pos_%(column)s] CHECK ([%(column)s] > 0)', 'PositiveSmallIntegerField': 'smallint CONSTRAINT [CK_smallint_pos_%(column)s] CHECK ([%(column)s] > 0)', 'SlugField': 'varchar(%(maxlength)s)', 'SmallIntegerField': 'smallint', 'TextField': 'text', 'TimeField': 'time', 'USStateField': 'varchar(2)'}
|
'''Define terminal escape sequences for color codes.
<ESC>[{attr1};...;{attrn}m
0 Reset all attributes
1 Bright
2 Dim
4 Underscore
5 Blink
7 Reverse
8 Hidden
Foreground Colours
------------------
30 Black
31 Red
32 Green
33 Yellow
34 Blue
35 Magenta
36 Cyan
37 White
Background Colours
------------------
40 Black
41 Red
42 Green
43 Yellow
44 Blue
45 Magenta
46 Cyan
47 White
'''
rt = '\x1b[0m'
bk = '\x1b[30m'
rd = '\x1b[31m'
gr = '\x1b[32m'
yl = '\x1b[33m'
mg = '\x1b[34m'
cy = '\x1b[36m'
wh = '\x1b[37m'
|
"""Define terminal escape sequences for color codes.
<ESC>[{attr1};...;{attrn}m
0 Reset all attributes
1 Bright
2 Dim
4 Underscore
5 Blink
7 Reverse
8 Hidden
Foreground Colours
------------------
30 Black
31 Red
32 Green
33 Yellow
34 Blue
35 Magenta
36 Cyan
37 White
Background Colours
------------------
40 Black
41 Red
42 Green
43 Yellow
44 Blue
45 Magenta
46 Cyan
47 White
"""
rt = '\x1b[0m'
bk = '\x1b[30m'
rd = '\x1b[31m'
gr = '\x1b[32m'
yl = '\x1b[33m'
mg = '\x1b[34m'
cy = '\x1b[36m'
wh = '\x1b[37m'
|
JOINTS = {
"HipCenter": 0,
"RHip": 1,
"RKnee": 2,
"RFoot": 3,
"LHip": 4,
"LKnee": 5,
"LFoot": 6,
"Spine": 7,
"Thorax": 8,
"Neck/Nose": 9,
"Head": 10,
"LShoulder": 11,
"LElbow": 12,
"LWrist": 13,
"RShoulder": 14,
"RElbow": 15,
"RWrist": 16,
}
EDGES = (
(0, 1),
(1, 2),
(2, 3),
(0, 4),
(4, 5),
(5, 6),
(0, 7),
(7, 8),
(8, 9),
(9, 10),
(8, 11),
(11, 12),
(12, 13),
(8, 14),
(14, 15),
(15, 16),
)
|
joints = {'HipCenter': 0, 'RHip': 1, 'RKnee': 2, 'RFoot': 3, 'LHip': 4, 'LKnee': 5, 'LFoot': 6, 'Spine': 7, 'Thorax': 8, 'Neck/Nose': 9, 'Head': 10, 'LShoulder': 11, 'LElbow': 12, 'LWrist': 13, 'RShoulder': 14, 'RElbow': 15, 'RWrist': 16}
edges = ((0, 1), (1, 2), (2, 3), (0, 4), (4, 5), (5, 6), (0, 7), (7, 8), (8, 9), (9, 10), (8, 11), (11, 12), (12, 13), (8, 14), (14, 15), (15, 16))
|
#!/usr/bin/env python3
# The missing value is always in range 1...len(nums)+1
# linear space and time
def find_first_missing(nums):
seen = [False] * len(nums)
for n in nums:
if n >= 1 and n <= len(nums):
seen[n-1] = True
for i in range(len(nums)):
if not seen[i]:
return i + 1
return len(nums) + 1
def find_first_missing_opt(nums):
# get rid of negatives and values outside the expected range for the missing value
for i in range(len(nums)):
if nums[i] <= 0 or nums[i] > len(nums):
nums[i] = len(nums) + 1
# use the array itself as a hash for the seen numbers
for n in nums:
n = abs(n)
if n <= len(nums) and nums[n-1] > 0:
nums[n-1] *= -1
# loop through range 1...len(nums) and see if we've seen all of it
for i in range(len(nums)):
if nums[i] > 0:
return i + 1
# if we've seen all of 1...len(nums), that means len(nums) + 1 is next missing value
return len(nums) + 1
assert find_first_missing([1,2,0]) == 3
assert find_first_missing([3,4,-1,1]) == 2
assert find_first_missing([7,8,9,11,12]) == 1
assert find_first_missing_opt([1,2,0]) == 3
assert find_first_missing_opt([3,4,-1,1]) == 2
assert find_first_missing_opt([7,8,9,11,12]) == 1
|
def find_first_missing(nums):
seen = [False] * len(nums)
for n in nums:
if n >= 1 and n <= len(nums):
seen[n - 1] = True
for i in range(len(nums)):
if not seen[i]:
return i + 1
return len(nums) + 1
def find_first_missing_opt(nums):
for i in range(len(nums)):
if nums[i] <= 0 or nums[i] > len(nums):
nums[i] = len(nums) + 1
for n in nums:
n = abs(n)
if n <= len(nums) and nums[n - 1] > 0:
nums[n - 1] *= -1
for i in range(len(nums)):
if nums[i] > 0:
return i + 1
return len(nums) + 1
assert find_first_missing([1, 2, 0]) == 3
assert find_first_missing([3, 4, -1, 1]) == 2
assert find_first_missing([7, 8, 9, 11, 12]) == 1
assert find_first_missing_opt([1, 2, 0]) == 3
assert find_first_missing_opt([3, 4, -1, 1]) == 2
assert find_first_missing_opt([7, 8, 9, 11, 12]) == 1
|
#!/usr/bin/python3
class MyError(Exception):
def __init__(self, value):
self.value = value
def __str__(self):
return repr(self.value)
try:
raise MyError(2 * 2)
except MyError as err:
print('My Exception occurred, value: ', err.value)
|
class Myerror(Exception):
def __init__(self, value):
self.value = value
def __str__(self):
return repr(self.value)
try:
raise my_error(2 * 2)
except MyError as err:
print('My Exception occurred, value: ', err.value)
|
"""Visit computation pure python version."""
START_EVENT = 1
END_EVENT = 0
def padd(p, q):
"""Add the probabilities."""
return 1.0 - (1.0 - p) * (1.0 - q)
def pmul(p, n):
"""Return the multiple of the given probabilty."""
return 1.0 - (1.0 - p) ** n
def compute_visit_output_py(
transmission_prob,
succeptibility,
infectivity,
unit_time,
e_indices_sorted,
e_event_visit,
e_event_time,
e_event_type,
v_state,
v_group,
v_behavior,
v_attributes,
vo_inf_prob,
vo_n_contacts,
vo_attributes,
):
"""Compute the visit results."""
n_events = e_indices_sorted.shape[0]
assert n_events > 0
assert e_event_visit.shape[0] == n_events
assert e_event_time.shape[0] == n_events
assert e_event_type.shape[0] == n_events
n_visits = v_state.shape[0]
assert n_visits > 0
assert v_group.shape[0] == n_visits
assert v_behavior.shape[0] == n_visits
assert v_attributes.shape[1] == n_visits
assert vo_inf_prob.shape[0] == n_visits
assert vo_n_contacts.shape[0] == n_visits
assert vo_attributes.shape[1] == n_visits
n_attributes = v_attributes.shape[0]
assert n_attributes > 0
assert vo_attributes.shape[0] == n_attributes
assert unit_time > 0
cur_occupancy = 0
prev_time = -1
cur_all_indices = set()
cur_succ_indices = set()
cur_infc_indices = set()
cur_attr_count = [0] * n_attributes
for i_event_sorted in range(n_events):
i_event = e_indices_sorted[i_event_sorted]
i_visit = e_event_visit[i_event]
cur_time = e_event_time[i_event]
event_type = e_event_type[i_event]
# Update the infection probabilities
if prev_time != -1:
duration = cur_time - prev_time
if duration > 0.0 and cur_succ_indices and cur_infc_indices:
duration = float(duration) / unit_time
for i_succ in cur_succ_indices:
ss = v_state[i_succ]
sg = v_group[i_succ]
sb = v_behavior[i_succ]
for i_infc in cur_infc_indices:
is_ = v_state[i_infc]
ig = v_group[i_infc]
ib = v_behavior[i_infc]
prob = transmission_prob[ss, sg, sb, is_, ig, ib]
prob = pmul(prob, duration)
vo_inf_prob[i_succ] = padd(vo_inf_prob[i_succ], prob)
# Update visual attribute accounting
if event_type == START_EVENT:
# The incoming agent sees everyone
for i_attr in range(n_attributes):
vo_attributes[i_attr, i_visit] = cur_attr_count[i_attr]
vo_n_contacts[i_visit] = cur_occupancy
# Every present agent sees incoming agent
for i_attr in range(n_attributes):
if v_attributes[i_attr, i_visit]:
for i_present in cur_all_indices:
vo_attributes[i_attr, i_present] += 1
for i_present in cur_all_indices:
vo_n_contacts[i_present] += 1
# Update the visual attribute count
for i_attr in range(n_attributes):
if vo_attributes[i_attr, i_visit]:
cur_attr_count[i_attr] += 1
cur_occupancy += 1
else: # event_type == END_EVENT
for i_attr in range(n_attributes):
if v_attributes[i_attr, i_visit]:
cur_attr_count[i_attr] -= 1
cur_occupancy -= 1
# Update the succeptible, infectious user accounting
vs = v_state[i_visit]
vg = v_group[i_visit]
if event_type == START_EVENT:
cur_all_indices.add(i_visit)
if succeptibility[vs, vg] > 0.0:
cur_succ_indices.add(i_visit)
if infectivity[vs, vg] > 0.0:
cur_infc_indices.add(i_visit)
else: # event_type == END_EVENT
cur_all_indices.remove(i_visit)
if succeptibility[vs, vg] > 0.0:
cur_succ_indices.remove(i_visit)
if infectivity[vs, vg] > 0.0:
cur_infc_indices.remove(i_visit)
prev_time = cur_time
|
"""Visit computation pure python version."""
start_event = 1
end_event = 0
def padd(p, q):
"""Add the probabilities."""
return 1.0 - (1.0 - p) * (1.0 - q)
def pmul(p, n):
"""Return the multiple of the given probabilty."""
return 1.0 - (1.0 - p) ** n
def compute_visit_output_py(transmission_prob, succeptibility, infectivity, unit_time, e_indices_sorted, e_event_visit, e_event_time, e_event_type, v_state, v_group, v_behavior, v_attributes, vo_inf_prob, vo_n_contacts, vo_attributes):
"""Compute the visit results."""
n_events = e_indices_sorted.shape[0]
assert n_events > 0
assert e_event_visit.shape[0] == n_events
assert e_event_time.shape[0] == n_events
assert e_event_type.shape[0] == n_events
n_visits = v_state.shape[0]
assert n_visits > 0
assert v_group.shape[0] == n_visits
assert v_behavior.shape[0] == n_visits
assert v_attributes.shape[1] == n_visits
assert vo_inf_prob.shape[0] == n_visits
assert vo_n_contacts.shape[0] == n_visits
assert vo_attributes.shape[1] == n_visits
n_attributes = v_attributes.shape[0]
assert n_attributes > 0
assert vo_attributes.shape[0] == n_attributes
assert unit_time > 0
cur_occupancy = 0
prev_time = -1
cur_all_indices = set()
cur_succ_indices = set()
cur_infc_indices = set()
cur_attr_count = [0] * n_attributes
for i_event_sorted in range(n_events):
i_event = e_indices_sorted[i_event_sorted]
i_visit = e_event_visit[i_event]
cur_time = e_event_time[i_event]
event_type = e_event_type[i_event]
if prev_time != -1:
duration = cur_time - prev_time
if duration > 0.0 and cur_succ_indices and cur_infc_indices:
duration = float(duration) / unit_time
for i_succ in cur_succ_indices:
ss = v_state[i_succ]
sg = v_group[i_succ]
sb = v_behavior[i_succ]
for i_infc in cur_infc_indices:
is_ = v_state[i_infc]
ig = v_group[i_infc]
ib = v_behavior[i_infc]
prob = transmission_prob[ss, sg, sb, is_, ig, ib]
prob = pmul(prob, duration)
vo_inf_prob[i_succ] = padd(vo_inf_prob[i_succ], prob)
if event_type == START_EVENT:
for i_attr in range(n_attributes):
vo_attributes[i_attr, i_visit] = cur_attr_count[i_attr]
vo_n_contacts[i_visit] = cur_occupancy
for i_attr in range(n_attributes):
if v_attributes[i_attr, i_visit]:
for i_present in cur_all_indices:
vo_attributes[i_attr, i_present] += 1
for i_present in cur_all_indices:
vo_n_contacts[i_present] += 1
for i_attr in range(n_attributes):
if vo_attributes[i_attr, i_visit]:
cur_attr_count[i_attr] += 1
cur_occupancy += 1
else:
for i_attr in range(n_attributes):
if v_attributes[i_attr, i_visit]:
cur_attr_count[i_attr] -= 1
cur_occupancy -= 1
vs = v_state[i_visit]
vg = v_group[i_visit]
if event_type == START_EVENT:
cur_all_indices.add(i_visit)
if succeptibility[vs, vg] > 0.0:
cur_succ_indices.add(i_visit)
if infectivity[vs, vg] > 0.0:
cur_infc_indices.add(i_visit)
else:
cur_all_indices.remove(i_visit)
if succeptibility[vs, vg] > 0.0:
cur_succ_indices.remove(i_visit)
if infectivity[vs, vg] > 0.0:
cur_infc_indices.remove(i_visit)
prev_time = cur_time
|
#!/usr/bin/env python3
# Strings are used to display message's on the screen or to convey instruction to users
test = 'This is a testing.'
print(test)
# Now say for example you want to print 'You're having it' if we write in single quotes then it will show us error
# test1 = 'You're having it' # uncomment the line to see error on this line
# print(test1)
# so for this error we can use double quotes to solve this error
test2 = "You're having it" # so as you can see in test1 we are getting error but now if you print it. it will work.
print(test2)
# now these are few examples of single and double quotes
print('Python Tutorial "Beginners"')
print("Python Tutorial Beginner's")
# we can use it in variables also.
python = "Python Tutorial's for beginner's"
print(python)
# as we have seen that while using single quotes or double quotes we can write it in single line only.
# what if i can tell you that you can write it in multiple line also be using 3 quotes at start or at end.
multiple_line = """
This is first line.
This is second line.
This is third line.
"""
print(multiple_line)
# its really helpful while writing a paragraph or some instructions.
|
test = 'This is a testing.'
print(test)
test2 = "You're having it"
print(test2)
print('Python Tutorial "Beginners"')
print("Python Tutorial Beginner's")
python = "Python Tutorial's for beginner's"
print(python)
multiple_line = '\nThis is first line.\nThis is second line.\nThis is third line.\n'
print(multiple_line)
|
class Laptop:
def getTime(self):
pass
def playWavFile(self, file):
pass
def wavWasPlayed(self, file):
pass
def resetWav(self, file):
pass
|
class Laptop:
def get_time(self):
pass
def play_wav_file(self, file):
pass
def wav_was_played(self, file):
pass
def reset_wav(self, file):
pass
|
def rowapplymods(transactionrow):
value = transactionrow.prevalue
for mod in transactionrow.includes_mods:
value = mod.apply(transactionrow.amount, value)[0]
transactionrow.value = value
|
def rowapplymods(transactionrow):
value = transactionrow.prevalue
for mod in transactionrow.includes_mods:
value = mod.apply(transactionrow.amount, value)[0]
transactionrow.value = value
|
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
load("@npm//@bazel/protractor:package.bzl", "npm_bazel_protractor_dependencies")
load("@npm//@bazel/karma:package.bzl", "npm_bazel_karma_dependencies")
load("@io_bazel_rules_webtesting//web:repositories.bzl", "web_test_repositories")
load("@io_bazel_rules_webtesting//web/versioned:browsers-0.3.2.bzl", "browser_repositories")
load("@io_bazel_rules_sass//sass:sass_repositories.bzl", "sass_repositories")
def load_angular():
npm_bazel_protractor_dependencies()
npm_bazel_karma_dependencies()
web_test_repositories()
browser_repositories(
chromium = True,
firefox = True,
)
sass_repositories()
|
load('@bazel_tools//tools/build_defs/repo:http.bzl', 'http_archive')
load('@npm//@bazel/protractor:package.bzl', 'npm_bazel_protractor_dependencies')
load('@npm//@bazel/karma:package.bzl', 'npm_bazel_karma_dependencies')
load('@io_bazel_rules_webtesting//web:repositories.bzl', 'web_test_repositories')
load('@io_bazel_rules_webtesting//web/versioned:browsers-0.3.2.bzl', 'browser_repositories')
load('@io_bazel_rules_sass//sass:sass_repositories.bzl', 'sass_repositories')
def load_angular():
npm_bazel_protractor_dependencies()
npm_bazel_karma_dependencies()
web_test_repositories()
browser_repositories(chromium=True, firefox=True)
sass_repositories()
|
pares = open('pares.txt', 'w')
impares = open('impares.txt', 'w')
for t in range(0, 1000):
if t % 2 == 0:
pares.write(f"{t}\n")
else:
impares.write(f"{t}\n")
pares.close()
impares.close()
|
pares = open('pares.txt', 'w')
impares = open('impares.txt', 'w')
for t in range(0, 1000):
if t % 2 == 0:
pares.write(f'{t}\n')
else:
impares.write(f'{t}\n')
pares.close()
impares.close()
|
"""The ywcnvlib package - Link yw-cnv to the UNO API.
Modules:
yw_cnv_uno -- Provide a converter class for universal import and export.
ui_uno -- Provide a UNO user interface facade class.
uno_tools -- Provide Python wrappers for UNO widgets.
Copyright (c) 2022 Peter Triesberger
For further information see https://github.com/peter88213/yw-cnv
Published under the MIT License (https://opensource.org/licenses/mit-license.php)
"""
|
"""The ywcnvlib package - Link yw-cnv to the UNO API.
Modules:
yw_cnv_uno -- Provide a converter class for universal import and export.
ui_uno -- Provide a UNO user interface facade class.
uno_tools -- Provide Python wrappers for UNO widgets.
Copyright (c) 2022 Peter Triesberger
For further information see https://github.com/peter88213/yw-cnv
Published under the MIT License (https://opensource.org/licenses/mit-license.php)
"""
|
"""Args defining output and networks"""
def add_args(parser):
parser.add_argument('--log_interval', type=int, default=100, metavar='N',
help='how many batches to wait before logging training status')
parser.add_argument('--input_size', type=int, default=16,
help='input size')
parser.add_argument('--train_portion', type=float, default=0.9,
help='train and test split portion for train')
parser.add_argument('--epochs', type=int, default=10000, metavar='N',
help='number of epochs to train')
# Linear trainer use 512
parser.add_argument('--batch_size', type=int, default=32, metavar='N',
help='input batch size for training')
parser.add_argument('--lr', type=float, default=1e-3,
help='learning rate')
|
"""Args defining output and networks"""
def add_args(parser):
parser.add_argument('--log_interval', type=int, default=100, metavar='N', help='how many batches to wait before logging training status')
parser.add_argument('--input_size', type=int, default=16, help='input size')
parser.add_argument('--train_portion', type=float, default=0.9, help='train and test split portion for train')
parser.add_argument('--epochs', type=int, default=10000, metavar='N', help='number of epochs to train')
parser.add_argument('--batch_size', type=int, default=32, metavar='N', help='input batch size for training')
parser.add_argument('--lr', type=float, default=0.001, help='learning rate')
|
def luasSegitiga2(a,t):
luas = a * t / 2
print('Luas segitiga dengan alas ',alas,'dan tinggi ',tinggi,' adalah ',luas)
alas=10
tinggi=20
luasSegitiga2(alas,tinggi)
|
def luas_segitiga2(a, t):
luas = a * t / 2
print('Luas segitiga dengan alas ', alas, 'dan tinggi ', tinggi, ' adalah ', luas)
alas = 10
tinggi = 20
luas_segitiga2(alas, tinggi)
|
CONFIGURATION = "css"
WIDTH = 30
HEIGHT = 30
|
configuration = 'css'
width = 30
height = 30
|
#!/usr/bin/env python
def solution(S):
stack = []
for char in S:
if char == ')':
if len(stack) > 0:
stack.pop()
else:
return 0
if char == '(':
stack.append(char)
if len(stack) != 0:
return 0
return 1
def test():
s = '(()(())())'
assert solution(s) == 1
s = '())'
assert solution(s) == 0
if __name__ == '__main__':
test()
|
def solution(S):
stack = []
for char in S:
if char == ')':
if len(stack) > 0:
stack.pop()
else:
return 0
if char == '(':
stack.append(char)
if len(stack) != 0:
return 0
return 1
def test():
s = '(()(())())'
assert solution(s) == 1
s = '())'
assert solution(s) == 0
if __name__ == '__main__':
test()
|
'''
https://www.codingame.com/training/easy/equivalent-resistance-circuit-building
'''
# Dictionary that stores the value of each resistance name
ohms = {}
# Read the inputs
n = int(input())
for i in range(n):
inputs = input().split()
name = inputs[0]
value = int(inputs[1])
# Populate the ohms dictionary
ohms[name] = value
# Construct the circuit and replace the names with their resistance values
circuit = [ohms[e] if e in ohms else e for e in input().split()]
# Constants
OPENING_CHARACTERS = ['[', '(']
CLOSING_CHARACTERS = [']', ')']
while len(circuit) > 1:
for i, e in enumerate(circuit):
if e in OPENING_CHARACTERS:
start = i
resistances = []
connection_is_serial = e == '('
value = None
elif e in CLOSING_CHARACTERS:
end = i
# Calculate the value depending on the circuite type
if connection_is_serial:
value = sum(resistances)
else:
value = 1 / (sum([(1 / r) for r in resistances]))
break
else:
resistances.append(e)
# Update the circuit replacing the branch with its value
if value:
circuit = circuit[:start] + [value] + circuit[end+1:]
else:
circuit = circuit[:start] + circuit[end+1:]
# Output
print(round(float(value), 1))
|
"""
https://www.codingame.com/training/easy/equivalent-resistance-circuit-building
"""
ohms = {}
n = int(input())
for i in range(n):
inputs = input().split()
name = inputs[0]
value = int(inputs[1])
ohms[name] = value
circuit = [ohms[e] if e in ohms else e for e in input().split()]
opening_characters = ['[', '(']
closing_characters = [']', ')']
while len(circuit) > 1:
for (i, e) in enumerate(circuit):
if e in OPENING_CHARACTERS:
start = i
resistances = []
connection_is_serial = e == '('
value = None
elif e in CLOSING_CHARACTERS:
end = i
if connection_is_serial:
value = sum(resistances)
else:
value = 1 / sum([1 / r for r in resistances])
break
else:
resistances.append(e)
if value:
circuit = circuit[:start] + [value] + circuit[end + 1:]
else:
circuit = circuit[:start] + circuit[end + 1:]
print(round(float(value), 1))
|
class Error(Exception):
pass
class NotFound(Error):
pass
class Corruption(Error):
pass
class NotSupported(Error):
pass
class InvalidArgument(Error):
pass
class RocksIOError(Error):
pass
class MergeInProgress(Error):
pass
class Incomplete(Error):
pass
|
class Error(Exception):
pass
class Notfound(Error):
pass
class Corruption(Error):
pass
class Notsupported(Error):
pass
class Invalidargument(Error):
pass
class Rocksioerror(Error):
pass
class Mergeinprogress(Error):
pass
class Incomplete(Error):
pass
|
test = { 'name': 'q0_3',
'points': 1,
'suites': [ { 'cases': [{'code': '>>> np.all(flavor_ratings_sorted.take(0).column("Rating list") == [1, 2, 4, 5]) == True\nTrue', 'hidden': False, 'locked': False}],
'scored': True,
'setup': '',
'teardown': '',
'type': 'doctest'}]}
|
test = {'name': 'q0_3', 'points': 1, 'suites': [{'cases': [{'code': '>>> np.all(flavor_ratings_sorted.take(0).column("Rating list") == [1, 2, 4, 5]) == True\nTrue', 'hidden': False, 'locked': False}], 'scored': True, 'setup': '', 'teardown': '', 'type': 'doctest'}]}
|
num_waves = 2
num_eqn = 4
num_aux = 2
# Conserved quantities
pressure = 0
x_velocity = 1
y_velocity = 2
z_velocity = 3
# Auxiliary variables
impedance = 0
sound_speed = 1
|
num_waves = 2
num_eqn = 4
num_aux = 2
pressure = 0
x_velocity = 1
y_velocity = 2
z_velocity = 3
impedance = 0
sound_speed = 1
|
# reverse given string
# Sample output:
# string this reverse
def reverse_sentence(sentence):
words = sentence.split(" ")
reverse = ' '.join(reversed(words))
return reverse
sentence = "reverse this string"
print (reverse_sentence(sentence))
|
def reverse_sentence(sentence):
words = sentence.split(' ')
reverse = ' '.join(reversed(words))
return reverse
sentence = 'reverse this string'
print(reverse_sentence(sentence))
|
class HashTable(object):
def __init__(self,size):
self.size = size
self.slots = [None] * self.size
self.data = [None] * self.size
def put(self,key,data):
hashValue = self.hashFunc(key,len(self.slots))
if self.slots[hashValue] == None:
self.slots[hashValue] = key
self.data[hashValue] = data
else:
if self.slots[hashValue] == key:
self.data[hashValue] = data
else:
newHash = reHash(hashValue,len(self.slots))
while self.slots[newHash] != None and self.slots[newHash] != key:
newHash = self.reHash(newHash,len(self.slots))
if self.slots[newHash] == None:
self.slots[newHash] = key
self.data[newHash] = data
else:
self.data[newHash] = data
def get(self,key):
startHash = self.hashFunc(key,len(self.slots))
position = startHash
while self.slots[position] != None:
if self.slots[position] == key:
return self.data[position]
else:
position = self.reHash(position,len(self.slots))
if position == startHash:
return None
def hashFunc(self,key,size):
return key%size
def reHash(self,oldHash,size):
return (oldHash+1)%size
def __getitem__(self,key):
return self.get(key)
def __setitem__(self,key,data):
self.put(key,data)
h = HashTable(5)
h[1] = "harsh"
h[2] = "raj"
h[3] = "mahesh"
print(h[1])
print(h[2])
print(h[3])
h.put(3,"qwerty")
print(h[1])
print(h[2])
print(h[3])
|
class Hashtable(object):
def __init__(self, size):
self.size = size
self.slots = [None] * self.size
self.data = [None] * self.size
def put(self, key, data):
hash_value = self.hashFunc(key, len(self.slots))
if self.slots[hashValue] == None:
self.slots[hashValue] = key
self.data[hashValue] = data
elif self.slots[hashValue] == key:
self.data[hashValue] = data
else:
new_hash = re_hash(hashValue, len(self.slots))
while self.slots[newHash] != None and self.slots[newHash] != key:
new_hash = self.reHash(newHash, len(self.slots))
if self.slots[newHash] == None:
self.slots[newHash] = key
self.data[newHash] = data
else:
self.data[newHash] = data
def get(self, key):
start_hash = self.hashFunc(key, len(self.slots))
position = startHash
while self.slots[position] != None:
if self.slots[position] == key:
return self.data[position]
else:
position = self.reHash(position, len(self.slots))
if position == startHash:
return None
def hash_func(self, key, size):
return key % size
def re_hash(self, oldHash, size):
return (oldHash + 1) % size
def __getitem__(self, key):
return self.get(key)
def __setitem__(self, key, data):
self.put(key, data)
h = hash_table(5)
h[1] = 'harsh'
h[2] = 'raj'
h[3] = 'mahesh'
print(h[1])
print(h[2])
print(h[3])
h.put(3, 'qwerty')
print(h[1])
print(h[2])
print(h[3])
|
class PriorityQueue(object):
def __init__(self):
self.qlist = []
def isEmpty(self):
return len(self) == 0
def __len__(self):
return len(self.qlist)
def enqueue(self, data, priority):
entry = _PriorityQEntry(data, priority)
self.qlist.append(entry)
def dequeue(self):
max = 0
for i in range(len(self.qlist)):
x = self.qlist[max].priority
if self.qlist[i].priority < max:
max = self.qlist[i].priority
item = self.qlist[max]
del self.qlist[max]
return item
def getFrontMost(self):
return self.qlist[0]
def getRearMost(self):
return self.qlist[-1]
class _PriorityQEntry(object):
def __init__(self, data, priority):
self.data = data
self.priority = priority
S = PriorityQueue()
S.enqueue("Jeruk", 4)
S.enqueue("Tomat", 2)
S.enqueue("Mangga", 0)
S.enqueue("Duku", 5)
S.enqueue("Pepaya", 2)
|
class Priorityqueue(object):
def __init__(self):
self.qlist = []
def is_empty(self):
return len(self) == 0
def __len__(self):
return len(self.qlist)
def enqueue(self, data, priority):
entry = __priority_q_entry(data, priority)
self.qlist.append(entry)
def dequeue(self):
max = 0
for i in range(len(self.qlist)):
x = self.qlist[max].priority
if self.qlist[i].priority < max:
max = self.qlist[i].priority
item = self.qlist[max]
del self.qlist[max]
return item
def get_front_most(self):
return self.qlist[0]
def get_rear_most(self):
return self.qlist[-1]
class _Priorityqentry(object):
def __init__(self, data, priority):
self.data = data
self.priority = priority
s = priority_queue()
S.enqueue('Jeruk', 4)
S.enqueue('Tomat', 2)
S.enqueue('Mangga', 0)
S.enqueue('Duku', 5)
S.enqueue('Pepaya', 2)
|
if __name__ == '__main__':
n = int(input())
arr = map(int, input().split())
total = list()
[total.append(i) for i in arr if i not in total]
total.sort()
print(total[-2])
|
if __name__ == '__main__':
n = int(input())
arr = map(int, input().split())
total = list()
[total.append(i) for i in arr if i not in total]
total.sort()
print(total[-2])
|
# #Given an array nums containing n + 1 integers where each integer is between 1 and n (inclusive), prove that at least one duplicate number must exist. Assume that there is only one duplicate number, find the duplicate one.
# #Note:
# #You must not modify the array (assume the array is read only).
# #You must use only constant, O(1) extra space.
# #Your runtime complexity should be less than O(n2).
# #There is only one duplicate number in the array, but it could be repeated more than once.
# #Your runtime beats 73.24 % of python submissions.
class Solution(object):
def findDuplicate(self, nums):
"""
:type nums: List[int]
:rtype: int
"""
#Method 1: Naive Solution
for i in range(0, len(nums)):
for j in range(i+1, len(nums)):
if nums[i] == nums[j]:
return nums[j]
# #Method 2: Sorting
nums.sort()
for i in range(1, len(nums)):
if nums[i] == nums[i-1]:
return nums[i]
d = {}
for i in range(0, len(nums)):
if nums[i] in d:
return nums[i]
else:
d[nums[i]] = i
|
class Solution(object):
def find_duplicate(self, nums):
"""
:type nums: List[int]
:rtype: int
"""
for i in range(0, len(nums)):
for j in range(i + 1, len(nums)):
if nums[i] == nums[j]:
return nums[j]
nums.sort()
for i in range(1, len(nums)):
if nums[i] == nums[i - 1]:
return nums[i]
d = {}
for i in range(0, len(nums)):
if nums[i] in d:
return nums[i]
else:
d[nums[i]] = i
|
"""
We copy some functions from the Python 2.7.3 socket module.
http://hg.python.org/releasing/2.7.3/file/7bb96963d067/Lib/socket.py
"""
_GLOBAL_DEFAULT_TIMEOUT = object()
def create_connection(address, timeout=_GLOBAL_DEFAULT_TIMEOUT,
source_address=None):
"""Connect to *address* and return the socket object.
Convenience function. Connect to *address* (a 2-tuple ``(host,
port)``) and return the socket object. Passing the optional
*timeout* parameter will set the timeout on the socket instance
before attempting to connect. If no *timeout* is supplied, the
global default timeout setting returned by :func:`getdefaulttimeout`
is used. If *source_address* is set it must be a tuple of (host, port)
for the socket to bind as a source address before making the connection.
An host of '' or port 0 tells the OS to use the default.
"""
host, port = address
err = None
for res in getaddrinfo(host, port, 0, SOCK_STREAM):
af, socktype, proto, canonname, sa = res
sock = None
try:
sock = socket(af, socktype, proto)
if timeout is not _GLOBAL_DEFAULT_TIMEOUT:
sock.settimeout(timeout)
if source_address:
sock.bind(source_address)
sock.connect(sa)
return sock
except error as _:
err = _
if sock is not None:
sock.close()
if err is not None:
raise err
else:
raise error("getaddrinfo returns an empty list")
|
"""
We copy some functions from the Python 2.7.3 socket module.
http://hg.python.org/releasing/2.7.3/file/7bb96963d067/Lib/socket.py
"""
_global_default_timeout = object()
def create_connection(address, timeout=_GLOBAL_DEFAULT_TIMEOUT, source_address=None):
"""Connect to *address* and return the socket object.
Convenience function. Connect to *address* (a 2-tuple ``(host,
port)``) and return the socket object. Passing the optional
*timeout* parameter will set the timeout on the socket instance
before attempting to connect. If no *timeout* is supplied, the
global default timeout setting returned by :func:`getdefaulttimeout`
is used. If *source_address* is set it must be a tuple of (host, port)
for the socket to bind as a source address before making the connection.
An host of '' or port 0 tells the OS to use the default.
"""
(host, port) = address
err = None
for res in getaddrinfo(host, port, 0, SOCK_STREAM):
(af, socktype, proto, canonname, sa) = res
sock = None
try:
sock = socket(af, socktype, proto)
if timeout is not _GLOBAL_DEFAULT_TIMEOUT:
sock.settimeout(timeout)
if source_address:
sock.bind(source_address)
sock.connect(sa)
return sock
except error as _:
err = _
if sock is not None:
sock.close()
if err is not None:
raise err
else:
raise error('getaddrinfo returns an empty list')
|
"""
__author__ = "Patrick Doyle"
__license__ = "The Unlicense"
__email__ = "me@pcdoyle.com"
r/dailyprogrammer:
Get the day of the week from a date entered as "YYYY MM DD" (EX: 2017 10 30)
https://www.reddit.com/r/dailyprogrammer/comments/79npf9/20171030_challenge_338_easy_what_day_was_it_again/
To solve this I'll be using Zeller's congruence.
https://en.wikipedia.org/wiki/Zeller's_congruence
"""
WEEKDAY = ('Saturday',
'Sunday',
'Monday',
'Tuesday',
'Wednesday',
'Thursday',
'Friday')
def getDate():
'''
Main function, gets the date from the user then prints the output.
'''
print('What date do you want to check? Type in "Y M D" format:')
date = input().split(' ')
try:
date = list(map(int, date))
if len(date) == 3:
dayNumber = calculateDate(date[0], date[1], date[2])
print('{0}/{1}/{2} is a {3}'.format(date[0], date[1], date[2], WEEKDAY[dayNumber]))
else:
print('Please enter the date in "Y M D" format!')
except ValueError:
print('Please only enter integers!')
def calculateDate(year, month, day):
'''
Calculates the date and returns the week number.
Zeller's Congruence formula for the Gregorian Calendar:
h = (q+13(m+1)/5+K+k/4+J/4-2J) mod 7
'''
if month < 3:
year -= 1
month += 12
yearCentury = year % 100
zeroCentury = year // 100
dayNumber = (day + 13 * (month + 1) // 5 + yearCentury + yearCentury // 4 + zeroCentury // 4 - 2 * zeroCentury) % 7
return(dayNumber)
if __name__ == "__main__":
getDate() # Start Program
|
"""
__author__ = "Patrick Doyle"
__license__ = "The Unlicense"
__email__ = "me@pcdoyle.com"
r/dailyprogrammer:
Get the day of the week from a date entered as "YYYY MM DD" (EX: 2017 10 30)
https://www.reddit.com/r/dailyprogrammer/comments/79npf9/20171030_challenge_338_easy_what_day_was_it_again/
To solve this I'll be using Zeller's congruence.
https://en.wikipedia.org/wiki/Zeller's_congruence
"""
weekday = ('Saturday', 'Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday')
def get_date():
"""
Main function, gets the date from the user then prints the output.
"""
print('What date do you want to check? Type in "Y M D" format:')
date = input().split(' ')
try:
date = list(map(int, date))
if len(date) == 3:
day_number = calculate_date(date[0], date[1], date[2])
print('{0}/{1}/{2} is a {3}'.format(date[0], date[1], date[2], WEEKDAY[dayNumber]))
else:
print('Please enter the date in "Y M D" format!')
except ValueError:
print('Please only enter integers!')
def calculate_date(year, month, day):
"""
Calculates the date and returns the week number.
Zeller's Congruence formula for the Gregorian Calendar:
h = (q+13(m+1)/5+K+k/4+J/4-2J) mod 7
"""
if month < 3:
year -= 1
month += 12
year_century = year % 100
zero_century = year // 100
day_number = (day + 13 * (month + 1) // 5 + yearCentury + yearCentury // 4 + zeroCentury // 4 - 2 * zeroCentury) % 7
return dayNumber
if __name__ == '__main__':
get_date()
|
# %% [markdown]
'''
Logistic Regression Classifier
Random forest Classifier
Decision Tree Classifier
PCA
Logistic Regression Classifier
Random forest Classifier
Decision Tree Classifier
Normalization
Modeling
With PCA
Without PCA
'''
all_metrics.append(["Logistic Regression", round(sensitivity, 2), round(specificity, 2), round(roc_auc_score(y_test, y_pred_prob), 2)])
# %%
total_rech_amts = ['total_rech_amt_6', 'total_rech_amt_7', 'total_rech_amt_8', 'total_rech_amt_9']
av_rech_amts = ['av_rech_amt_data_6', 'av_rech_amt_data_7', 'av_rech_amt_data_8', 'av_rech_amt_data_9']
percentiles = [0.1, 0.25, 0.5, 0.6, 0.7, 0.75, 0.85, 0.9, 0.95, 0.97, 0.99]
# %%
churn_data[av_rech_amts].describe(percentiles=percentiles).T
# %%
churn_data[total_rech_amts].describe(percentiles=percentiles).T
# %%
["mobile_number", "circle_id", "loc_og_t2o_mou", "std_og_t2o_mou", "loc_ic_t2o_mou", "last_date_of_month_6", "arpu_6", "onnet_mou_6", "offnet_mou_6", "roam_ic_mou_6", "roam_og_mou_6", "loc_og_t2t_mou_6", "loc_og_t2m_mou_6", "loc_og_t2f_mou_6", "loc_og_t2c_mou_6", "loc_og_mou_6", "std_og_t2t_mou_6", "std_og_t2m_mou_6", "std_og_t2f_mou_6", "std_og_t2c_mou_6", "std_og_mou_6", "isd_og_mou_6", "spl_og_mou_6", "og_others_6", "total_og_mou_6", "loc_ic_t2t_mou_6", "loc_ic_t2m_mou_6", "loc_ic_t2f_mou_6", "loc_ic_mou_6", "std_ic_t2t_mou_6",
"std_ic_t2m_mou_6", "std_ic_t2f_mou_6", "std_ic_t2o_mou_6", "std_ic_mou_6", "total_ic_mou_6", "spl_ic_mou_6", "isd_ic_mou_6", "ic_others_6", "total_rech_num_6", "total_rech_amt_6", "max_rech_amt_6", "date_of_last_rech_6", "last_day_rch_amt_6", "date_of_last_rech_data_6", "total_rech_data_6", "max_rech_data_6", "count_rech_2g_6", "count_rech_3g_6", "av_rech_amt_data_6", "vol_2g_mb_6", "vol_3g_mb_6", "arpu_3g_6", "arpu_2g_6", "night_pck_user_6", "monthly_2g_6", "sachet_2g_6", "monthly_3g_6", "sachet_3g_6", "fb_user_6", "aon", "jun_vbc_3g"]
# 'loc_og_t2o_mou':0, 'std_og_t2o_mou':
# %% [markdown]
'''
- High level data
1. Call Usage
2. Money Generate
3. Recharge Details
4. Internet Data Usage
5.
'''
# %% [markdown]
'''
- Feature extraction
1. Ratios
2. Standardized Sum of features, OR Cumulative Sum/Ratio
3. First or second part of month
4. Month length influence the total recharge
5. Revenue based churn- Low Revenue and High incoming calls
6. (Data usage amount/ Total Usage)*100
*All above analysis will be based on buckets*
'''
# %%
churn_data.shape
# %%
# churn selection column
ch_cols = ['total_ic_mou_9', 'total_og_mou_9', 'vol_2g_mb_9', 'vol_3g_mb_9']
churn_data[ch_cols].isnull().sum()
# %%
# total_rech_amt_6 + total_data_rech_6
# total_rech_amt_7 + total_data_rech_7
# AVG,Quantile
# Impute then filter
# Load ==> impute ==> Filter ==> Feature Extraction
# %%
['arpu_', 'onnet_mou_', 'offnet_mou_', 'roam_ic_mou_', 'roam_og_mou_', 'loc_og_t2t_mou_', 'loc_og_t2m_mou_', 'loc_og_t2f_mou_', 'loc_og_t2c_mou_', 'loc_og_mou_', 'std_og_t2t_mou_', 'std_og_t2m_mou_', 'std_og_t2f_mou_', 'std_og_mou_', 'isd_og_mou_', 'spl_og_mou_', 'og_others_', 'total_og_mou_', 'loc_ic_t2t_mou_', 'loc_ic_t2m_mou_', 'loc_ic_t2f_mou_', 'loc_ic_mou_',
'std_ic_t2t_mou_', 'std_ic_t2m_mou_', 'std_ic_t2f_mou_', 'std_ic_mou_', 'total_ic_mou_', 'spl_ic_mou_', 'isd_ic_mou_', 'ic_others_', 'total_rech_num_', 'total_rech_amt_', 'max_rech_amt_', 'last_day_rch_amt_', 'total_rech_data_', 'max_rech_data_', 'av_rech_amt_data_', 'vol_2g_mb_', 'vol_3g_mb_', 'monthly_2g_', 'sachet_2g_', 'monthly_3g_', 'sachet_3g_', 'vbc_3g_']
# aon
|
"""
Logistic Regression Classifier
Random forest Classifier
Decision Tree Classifier
PCA
Logistic Regression Classifier
Random forest Classifier
Decision Tree Classifier
Normalization
Modeling
With PCA
Without PCA
"""
all_metrics.append(['Logistic Regression', round(sensitivity, 2), round(specificity, 2), round(roc_auc_score(y_test, y_pred_prob), 2)])
total_rech_amts = ['total_rech_amt_6', 'total_rech_amt_7', 'total_rech_amt_8', 'total_rech_amt_9']
av_rech_amts = ['av_rech_amt_data_6', 'av_rech_amt_data_7', 'av_rech_amt_data_8', 'av_rech_amt_data_9']
percentiles = [0.1, 0.25, 0.5, 0.6, 0.7, 0.75, 0.85, 0.9, 0.95, 0.97, 0.99]
churn_data[av_rech_amts].describe(percentiles=percentiles).T
churn_data[total_rech_amts].describe(percentiles=percentiles).T
['mobile_number', 'circle_id', 'loc_og_t2o_mou', 'std_og_t2o_mou', 'loc_ic_t2o_mou', 'last_date_of_month_6', 'arpu_6', 'onnet_mou_6', 'offnet_mou_6', 'roam_ic_mou_6', 'roam_og_mou_6', 'loc_og_t2t_mou_6', 'loc_og_t2m_mou_6', 'loc_og_t2f_mou_6', 'loc_og_t2c_mou_6', 'loc_og_mou_6', 'std_og_t2t_mou_6', 'std_og_t2m_mou_6', 'std_og_t2f_mou_6', 'std_og_t2c_mou_6', 'std_og_mou_6', 'isd_og_mou_6', 'spl_og_mou_6', 'og_others_6', 'total_og_mou_6', 'loc_ic_t2t_mou_6', 'loc_ic_t2m_mou_6', 'loc_ic_t2f_mou_6', 'loc_ic_mou_6', 'std_ic_t2t_mou_6', 'std_ic_t2m_mou_6', 'std_ic_t2f_mou_6', 'std_ic_t2o_mou_6', 'std_ic_mou_6', 'total_ic_mou_6', 'spl_ic_mou_6', 'isd_ic_mou_6', 'ic_others_6', 'total_rech_num_6', 'total_rech_amt_6', 'max_rech_amt_6', 'date_of_last_rech_6', 'last_day_rch_amt_6', 'date_of_last_rech_data_6', 'total_rech_data_6', 'max_rech_data_6', 'count_rech_2g_6', 'count_rech_3g_6', 'av_rech_amt_data_6', 'vol_2g_mb_6', 'vol_3g_mb_6', 'arpu_3g_6', 'arpu_2g_6', 'night_pck_user_6', 'monthly_2g_6', 'sachet_2g_6', 'monthly_3g_6', 'sachet_3g_6', 'fb_user_6', 'aon', 'jun_vbc_3g']
'\n\n - High level data\n 1. Call Usage\n 2. Money Generate\n 3. Recharge Details\n 4. Internet Data Usage\n 5.\n'
'\n\n - Feature extraction\n 1. Ratios\n 2. Standardized Sum of features, OR Cumulative Sum/Ratio\n 3. First or second part of month\n 4. Month length influence the total recharge\n 5. Revenue based churn- Low Revenue and High incoming calls\n 6. (Data usage amount/ Total Usage)*100\n\n*All above analysis will be based on buckets*\n'
churn_data.shape
ch_cols = ['total_ic_mou_9', 'total_og_mou_9', 'vol_2g_mb_9', 'vol_3g_mb_9']
churn_data[ch_cols].isnull().sum()
['arpu_', 'onnet_mou_', 'offnet_mou_', 'roam_ic_mou_', 'roam_og_mou_', 'loc_og_t2t_mou_', 'loc_og_t2m_mou_', 'loc_og_t2f_mou_', 'loc_og_t2c_mou_', 'loc_og_mou_', 'std_og_t2t_mou_', 'std_og_t2m_mou_', 'std_og_t2f_mou_', 'std_og_mou_', 'isd_og_mou_', 'spl_og_mou_', 'og_others_', 'total_og_mou_', 'loc_ic_t2t_mou_', 'loc_ic_t2m_mou_', 'loc_ic_t2f_mou_', 'loc_ic_mou_', 'std_ic_t2t_mou_', 'std_ic_t2m_mou_', 'std_ic_t2f_mou_', 'std_ic_mou_', 'total_ic_mou_', 'spl_ic_mou_', 'isd_ic_mou_', 'ic_others_', 'total_rech_num_', 'total_rech_amt_', 'max_rech_amt_', 'last_day_rch_amt_', 'total_rech_data_', 'max_rech_data_', 'av_rech_amt_data_', 'vol_2g_mb_', 'vol_3g_mb_', 'monthly_2g_', 'sachet_2g_', 'monthly_3g_', 'sachet_3g_', 'vbc_3g_']
|
# ldap/util.py
# Written by Jeff Kaleshi
def get_permissions(query):
permissions = []
for item in query:
permission = item[3:item.find(',')]
if permission != 'ACMPaid' and permission != 'ACMNotPaid':
permissions.append(permission)
return permissions
def get_paid_status(query):
result = False
permissions = get_permissions(query)
if 'ACMPaid' in permissions:
result = True
return result
def generate_user_data(query):
user_data = {
'id': None if str(query.uidNumber) == '[]' else int(str(query.uidNumber)),
'username': None if str(query.sAMAccountName) == '[]' else str(query.sAMAccountName),
'full_name': None if str(query.name) == '[]' else str(query.name),
'display_name': None if str(query.displayName) == '[]' else str(query.displayName),
'personal_email': None if str(query.mail) == '[]' else str(query.mail),
'acm_email': None if str(query.sAMAccountName) == '[]' else str(query.sAMAccountName) + '@acm.cs.uic.edu',
'permissions': get_permissions(query.memberOf),
'is_paid': get_paid_status(query.memberOf),
}
return user_data
|
def get_permissions(query):
permissions = []
for item in query:
permission = item[3:item.find(',')]
if permission != 'ACMPaid' and permission != 'ACMNotPaid':
permissions.append(permission)
return permissions
def get_paid_status(query):
result = False
permissions = get_permissions(query)
if 'ACMPaid' in permissions:
result = True
return result
def generate_user_data(query):
user_data = {'id': None if str(query.uidNumber) == '[]' else int(str(query.uidNumber)), 'username': None if str(query.sAMAccountName) == '[]' else str(query.sAMAccountName), 'full_name': None if str(query.name) == '[]' else str(query.name), 'display_name': None if str(query.displayName) == '[]' else str(query.displayName), 'personal_email': None if str(query.mail) == '[]' else str(query.mail), 'acm_email': None if str(query.sAMAccountName) == '[]' else str(query.sAMAccountName) + '@acm.cs.uic.edu', 'permissions': get_permissions(query.memberOf), 'is_paid': get_paid_status(query.memberOf)}
return user_data
|
NAME = 'Jane P. Roult'
# Communication Definitions
BAUDRATE = 115200
COMMAND_COMM_LOCATION = "/dev/robot/arduino" # For sending commands
SENSORS_COMM_LOCATION = "/dev/robot/sensors" # For receiving sensor telemetry
# Physical Definitions
WHEEL_BASE_MM = 153.0
# Blue Wheels with geared steppers:
STEPS_PER_CM = 132.0
# Blue Wheels with wimpy-ass steppers:
# STEPS_PER_CM = 26
# Green Wheels with wimpy-ass steppers:
# STEPS_PER_CM = 35
# Green Wheels with gears steppers:
# STEPS_PER_CM = 182
STEPS_PER_MM = STEPS_PER_CM / 10.0
|
name = 'Jane P. Roult'
baudrate = 115200
command_comm_location = '/dev/robot/arduino'
sensors_comm_location = '/dev/robot/sensors'
wheel_base_mm = 153.0
steps_per_cm = 132.0
steps_per_mm = STEPS_PER_CM / 10.0
|
# -*- coding: utf-8 -*-
"""
Created on Wed Jan 16 09:07:36 2019
@author: Dell
"""
#to find th largest and second largest number on the list(sort and second last)
L=[]
s=int(input("How many numbers you want to add in the list? "))
for i in range(s):
x=int(input("Enter element of list: "))
L.append(x)
print(L)
maxim=L[0]
for i in range(len(L)):
if L[i]>maxim:
maxim=L[i]
print("Your Largest Number is= ",maxim)
for i in range(len(L)):
if L[i-1]==maxim:
del(L[i-1])
print(L)
second=L[0]
for i in range(len(L)):
if L[i]>second:
second=L[i]
print("Your Second Largest Number is=",second)
|
"""
Created on Wed Jan 16 09:07:36 2019
@author: Dell
"""
l = []
s = int(input('How many numbers you want to add in the list? '))
for i in range(s):
x = int(input('Enter element of list: '))
L.append(x)
print(L)
maxim = L[0]
for i in range(len(L)):
if L[i] > maxim:
maxim = L[i]
print('Your Largest Number is= ', maxim)
for i in range(len(L)):
if L[i - 1] == maxim:
del L[i - 1]
print(L)
second = L[0]
for i in range(len(L)):
if L[i] > second:
second = L[i]
print('Your Second Largest Number is=', second)
|
# -*- coding: utf-8 -*-
""" Module that keeps track of library management like version control, release dates etc. """
__version__ = '0.0.2'
__release_date__ = '2019-02-10'
|
""" Module that keeps track of library management like version control, release dates etc. """
__version__ = '0.0.2'
__release_date__ = '2019-02-10'
|
def calculate( time, realtime ):
starting = time[6]
hhs = int(time[:2])
mms = int(time[3:5])
ending = time[15]
hhe = int(time[9:11])
mme = int(time[12:15])
if time[6]== 'A':
if time[15] == 'A':
if hhs!=12:
sum=0
sum = sum + (hh*60)+mm
return sum
else:
sum=0
sum = sum + mm
return sum
elif time[15] == 'P':
if hh!=12:
sum=720
sum = sum + (hh*60)+mm
return sum
else:
sum=720
sum = sum + mm
return sum
elif time[6]=='P':
if hh!=12:
sum=720
sum = sum + (hh*60)+mm
return sum
else:
sum=720
sum = sum + mm
return sum
def main(t):
for i in range(t):
realtime = input()
realtimevalue = calculate(realtime)
num = input()
num = int(num)
for x in range(num):
starttime = input()
starttimevalue = calculate(starttime,realtimevalue)
print(starttimevalue)
# t = input()
# t = int(t)
# main(t)
num = input()
print(calculate(num))
num = input()
print(calculate(num))
num = input()
print(calculate(num))
num = input()
print(calculate(num))
num = input()
print(calculate(num))
|
def calculate(time, realtime):
starting = time[6]
hhs = int(time[:2])
mms = int(time[3:5])
ending = time[15]
hhe = int(time[9:11])
mme = int(time[12:15])
if time[6] == 'A':
if time[15] == 'A':
if hhs != 12:
sum = 0
sum = sum + hh * 60 + mm
return sum
else:
sum = 0
sum = sum + mm
return sum
elif time[15] == 'P':
if hh != 12:
sum = 720
sum = sum + hh * 60 + mm
return sum
else:
sum = 720
sum = sum + mm
return sum
elif time[6] == 'P':
if hh != 12:
sum = 720
sum = sum + hh * 60 + mm
return sum
else:
sum = 720
sum = sum + mm
return sum
def main(t):
for i in range(t):
realtime = input()
realtimevalue = calculate(realtime)
num = input()
num = int(num)
for x in range(num):
starttime = input()
starttimevalue = calculate(starttime, realtimevalue)
print(starttimevalue)
num = input()
print(calculate(num))
num = input()
print(calculate(num))
num = input()
print(calculate(num))
num = input()
print(calculate(num))
num = input()
print(calculate(num))
|
__author__ = 'DWI'
class TemplateActionReader(object):
def __init__(self, template_action_builder):
self.action_builder = template_action_builder
def read(self, file_name):
"""
Reads the given file and returns a template object
:param file_name: name of the template file
:return: the template that was created
"""
with open(file_name, 'r') as file:
data = self._load_data(file)
return self._build_action_list(data)
def _build_action_list(self, data):
pass
def _load_data(self, file):
pass
|
__author__ = 'DWI'
class Templateactionreader(object):
def __init__(self, template_action_builder):
self.action_builder = template_action_builder
def read(self, file_name):
"""
Reads the given file and returns a template object
:param file_name: name of the template file
:return: the template that was created
"""
with open(file_name, 'r') as file:
data = self._load_data(file)
return self._build_action_list(data)
def _build_action_list(self, data):
pass
def _load_data(self, file):
pass
|
"""
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
"""
class AccountStoreSettings:
def __init__(self, settings):
try:
self.account_store_config = settings.ALCHEMY_STORE
self.engine_config = self.account_store_config['engine_config']
self.dialect = self.engine_config['dialect']
self.path = self.engine_config['path']
self.userid = self.engine_config.get('userid')
self.password = self.engine_config.get('password')
self.hostname = self.engine_config.get('hostname')
self.port = self.engine_config.get('port')
self.db = self.engine_config.get('db')
self.echo = self.engine_config.get('echo', False)
except (AttributeError, TypeError) as exc:
msg = ('yosai_alchemystore AlchemyStoreSettings requires a LazySettings instance '
'with complete ALCHEMY_STORE settings')
raise exc.__class__(msg)
@property
def url(self):
return ("{dialect}:{path}{userid}{idpasspath}{password}{hostnamepath}"
"{hostname}{portpath}{port}{dbpath}{db}".
format(dialect=self.dialect,
path=self.path,
userid=self.userid if self.userid is not None else '',
idpasspath=':' if self.userid and self.password else '',
password=self.password if self.password is not None else '',
hostnamepath='@' if self.hostname is not None else '',
hostname=self.hostname if self.hostname is not None else '',
portpath=':' if self.port is not None else '',
port=self.port if self.port is not None else '',
dbpath='/' if self.db else '',
db=self.db if self.db is not None else ''))
|
"""
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
"""
class Accountstoresettings:
def __init__(self, settings):
try:
self.account_store_config = settings.ALCHEMY_STORE
self.engine_config = self.account_store_config['engine_config']
self.dialect = self.engine_config['dialect']
self.path = self.engine_config['path']
self.userid = self.engine_config.get('userid')
self.password = self.engine_config.get('password')
self.hostname = self.engine_config.get('hostname')
self.port = self.engine_config.get('port')
self.db = self.engine_config.get('db')
self.echo = self.engine_config.get('echo', False)
except (AttributeError, TypeError) as exc:
msg = 'yosai_alchemystore AlchemyStoreSettings requires a LazySettings instance with complete ALCHEMY_STORE settings'
raise exc.__class__(msg)
@property
def url(self):
return '{dialect}:{path}{userid}{idpasspath}{password}{hostnamepath}{hostname}{portpath}{port}{dbpath}{db}'.format(dialect=self.dialect, path=self.path, userid=self.userid if self.userid is not None else '', idpasspath=':' if self.userid and self.password else '', password=self.password if self.password is not None else '', hostnamepath='@' if self.hostname is not None else '', hostname=self.hostname if self.hostname is not None else '', portpath=':' if self.port is not None else '', port=self.port if self.port is not None else '', dbpath='/' if self.db else '', db=self.db if self.db is not None else '')
|
# Definition for a binary tree node.
# class TreeNode:
# def __init__(self, val=0, left=None, right=None):
# self.val = val
# self.left = left
# self.right = right
class Solution:
def findLeaves(self, root: TreeNode) -> List[List[int]]:
if not root:
return []
res = []
while not self.isLeaf(root):
res.append(self.getNextLeaves(root))
res.append([root.val])
return res
def isLeaf(self, root) -> bool:
return root and not root.left and not root.right
def getNextLeaves(self, root) -> List[int]:
if not root:
return []
q = [(root, -1)]
leaf = []
while q:
node, parent = q.pop(0)
if not self.isLeaf(node):
if node.left:
q.append((node.left, node))
if node.right:
q.append((node.right, node))
else:
leaf.append(node.val)
if node == parent.left:
parent.left = None
else:
parent.right = None
return leaf
|
class Solution:
def find_leaves(self, root: TreeNode) -> List[List[int]]:
if not root:
return []
res = []
while not self.isLeaf(root):
res.append(self.getNextLeaves(root))
res.append([root.val])
return res
def is_leaf(self, root) -> bool:
return root and (not root.left) and (not root.right)
def get_next_leaves(self, root) -> List[int]:
if not root:
return []
q = [(root, -1)]
leaf = []
while q:
(node, parent) = q.pop(0)
if not self.isLeaf(node):
if node.left:
q.append((node.left, node))
if node.right:
q.append((node.right, node))
else:
leaf.append(node.val)
if node == parent.left:
parent.left = None
else:
parent.right = None
return leaf
|
sheep_size = [5,7,300,90,24,50,75]
print("Hello, my name is Duy Anh and these are my sheep sizes")
print(sheep_size)
biggest_sheep = max(sheep_size)
print()
print("Now my biggest sheep has size",biggest_sheep,"let's shear it")
|
sheep_size = [5, 7, 300, 90, 24, 50, 75]
print('Hello, my name is Duy Anh and these are my sheep sizes')
print(sheep_size)
biggest_sheep = max(sheep_size)
print()
print('Now my biggest sheep has size', biggest_sheep, "let's shear it")
|
input = """
true.
a | b :- true, 1 < 2.
:- a.
"""
output = """
true.
a | b :- true, 1 < 2.
:- a.
"""
|
input = '\ntrue.\na | b :- true, 1 < 2.\n:- a.\n'
output = '\ntrue.\na | b :- true, 1 < 2.\n:- a.\n'
|
# https://app.codesignal.com/arcade/code-arcade/loop-tunnel/7BFPq6TpsNjzgcpXy/
def leastFactorial(n):
# What's the highest factorial number that is bigger than n?
i, fact = (1, 1)
# Keep increasing a cumulative factorial until n can't no longer contain
# it. If n becomes 1, then n was a factorial, if n becomes 0, then the
# next factorial is above n.
while(n/fact > 1):
fact *= i
i += 1
return fact
|
def least_factorial(n):
(i, fact) = (1, 1)
while n / fact > 1:
fact *= i
i += 1
return fact
|
class TreeNode:
def __init__(self, x):
self.val = x
self.left = None
self.right = None
class Solution:
node = parent = None
def deleteNode(self, root: TreeNode, key: int) -> TreeNode:
# search for the node and its parent
self.findNodeAndParent(root, key)
if self.node == root and not root.left and not root.right:
return None
if self.node:
self.deleteNodeHelper(self.node, self.parent)
return root
def deleteNodeHelper(self, node, parent):
# if node is a leaf
if not node.left and not node.right:
if parent:
if parent.left == node:
parent.left = None
else:
parent.right = None
return
# if node has only one child
if not node.left or not node.right:
child = node.left if not node.right else node.right
node.val = child.val
node.left = child.left
node.right = child.right
return
# node has two children
successor, succesorParent = self.getNodeSuccessor(node)
node.val = successor.val
self.deleteNodeHelper(successor, succesorParent)
def getNodeSuccessor(self, node):
succesorParent = node
successor = node.right
while successor.left:
succesorParent = successor
successor = successor.left
return successor, succesorParent
def findNodeAndParent(self, root, key):
if not root:
return
if root.val == key:
self.node = root
return
self.parent = root
if key < root.val:
self.findNodeAndParent(root.left, key)
else:
self.findNodeAndParent(root.right, key)
root = TreeNode(10)
root.left = TreeNode(3)
root.left.left = TreeNode(2)
root.left.right = TreeNode(8)
root.left.right.left = TreeNode(7)
root.left.right.right = TreeNode(9)
root.right = TreeNode(15)
root.right.left = TreeNode(13)
root.right.right = TreeNode(17)
root.right.right.right = TreeNode(19)
ob = Solution()
root = TreeNode(50)
root = ob.deleteNode(root, 50)
print(root)
|
class Treenode:
def __init__(self, x):
self.val = x
self.left = None
self.right = None
class Solution:
node = parent = None
def delete_node(self, root: TreeNode, key: int) -> TreeNode:
self.findNodeAndParent(root, key)
if self.node == root and (not root.left) and (not root.right):
return None
if self.node:
self.deleteNodeHelper(self.node, self.parent)
return root
def delete_node_helper(self, node, parent):
if not node.left and (not node.right):
if parent:
if parent.left == node:
parent.left = None
else:
parent.right = None
return
if not node.left or not node.right:
child = node.left if not node.right else node.right
node.val = child.val
node.left = child.left
node.right = child.right
return
(successor, succesor_parent) = self.getNodeSuccessor(node)
node.val = successor.val
self.deleteNodeHelper(successor, succesorParent)
def get_node_successor(self, node):
succesor_parent = node
successor = node.right
while successor.left:
succesor_parent = successor
successor = successor.left
return (successor, succesorParent)
def find_node_and_parent(self, root, key):
if not root:
return
if root.val == key:
self.node = root
return
self.parent = root
if key < root.val:
self.findNodeAndParent(root.left, key)
else:
self.findNodeAndParent(root.right, key)
root = tree_node(10)
root.left = tree_node(3)
root.left.left = tree_node(2)
root.left.right = tree_node(8)
root.left.right.left = tree_node(7)
root.left.right.right = tree_node(9)
root.right = tree_node(15)
root.right.left = tree_node(13)
root.right.right = tree_node(17)
root.right.right.right = tree_node(19)
ob = solution()
root = tree_node(50)
root = ob.deleteNode(root, 50)
print(root)
|
class ResponseFunctionInterface(object):
"""
This response function interface provides a unique interface for all possible ways
to calculate the value and gradient of a response.
The interface is designed to be used in e.g. optimization, where the value and gradient
of a response is required, however the exact method of gradient calculation is of
secondary importance.
This might be done using e.g. adjoint sensitivity analysis capabilities of Kratos,
or even a simple finite differencing method.
(Do not confuse this class with the kratos/response_functions/adjoint_response_function.h,
which is an implementation detail for the adjoint sensitivity analysis in Kratos)
"""
def RunCalculation(self, calculate_gradient):
self.Initialize()
self.InitializeSolutionStep()
self.CalculateValue()
if calculate_gradient:
self.CalculateGradient()
self.FinalizeSolutionStep()
self.Finalize()
def Initialize(self):
pass
def UpdateDesign(self, updated_model_part, variable):
pass
def InitializeSolutionStep(self):
pass
def CalculateValue(self):
raise NotImplementedError("CalculateValue needs to be implemented by the derived class")
def CalculateGradient(self):
raise NotImplementedError("CalculateGradient needs to be implemented by the derived class")
def FinalizeSolutionStep(self):
pass
def Finalize(self):
pass
def GetValue(self):
raise NotImplementedError("GetValue needs to be implemented by the derived class")
def GetNodalGradient(self, variable):
raise NotImplementedError("GetNodalGradient needs to be implemented by the derived class")
def GetElementalGradient(self, variable):
raise NotImplementedError("GetElementalGradient needs to be implemented by the derived class")
def GetConditionalGradient(self, variable):
raise NotImplementedError("GetConditionalGradient needs to be implemented by the derived class")
def IsEvaluatedInFolder(self):
return False
|
class Responsefunctioninterface(object):
"""
This response function interface provides a unique interface for all possible ways
to calculate the value and gradient of a response.
The interface is designed to be used in e.g. optimization, where the value and gradient
of a response is required, however the exact method of gradient calculation is of
secondary importance.
This might be done using e.g. adjoint sensitivity analysis capabilities of Kratos,
or even a simple finite differencing method.
(Do not confuse this class with the kratos/response_functions/adjoint_response_function.h,
which is an implementation detail for the adjoint sensitivity analysis in Kratos)
"""
def run_calculation(self, calculate_gradient):
self.Initialize()
self.InitializeSolutionStep()
self.CalculateValue()
if calculate_gradient:
self.CalculateGradient()
self.FinalizeSolutionStep()
self.Finalize()
def initialize(self):
pass
def update_design(self, updated_model_part, variable):
pass
def initialize_solution_step(self):
pass
def calculate_value(self):
raise not_implemented_error('CalculateValue needs to be implemented by the derived class')
def calculate_gradient(self):
raise not_implemented_error('CalculateGradient needs to be implemented by the derived class')
def finalize_solution_step(self):
pass
def finalize(self):
pass
def get_value(self):
raise not_implemented_error('GetValue needs to be implemented by the derived class')
def get_nodal_gradient(self, variable):
raise not_implemented_error('GetNodalGradient needs to be implemented by the derived class')
def get_elemental_gradient(self, variable):
raise not_implemented_error('GetElementalGradient needs to be implemented by the derived class')
def get_conditional_gradient(self, variable):
raise not_implemented_error('GetConditionalGradient needs to be implemented by the derived class')
def is_evaluated_in_folder(self):
return False
|
student = {
"firstName": "Prasad",
"lastName": "Honrao",
"age": 37
}
try:
#try to get wrong value from dictionary
last_name = student["last_name"]
except KeyError as error:
print("Exception thrown!")
print(error)
print("Done!")
|
student = {'firstName': 'Prasad', 'lastName': 'Honrao', 'age': 37}
try:
last_name = student['last_name']
except KeyError as error:
print('Exception thrown!')
print(error)
print('Done!')
|
class Fibonacci(object):
"""Generate Fibonacci Numbers"""
def __init__(self, length, first=0, second=1):
"""Set length and initials for the series"""
if not isinstance(length, int):
raise TypeError("Expected length to be 'int' got '%s'" % (length.__class__.__name__, ))
if length < 2:
raise ValueError("Expected length to be greater than 1")
if not isinstance(first, int):
raise TypeError("Expected first to be 'int' got '%s'" % (first.__class__.__name__, ))
if not isinstance(second, int):
raise TypeError("Expected second to be 'int' got '%s'" % (second.__class__.__name__, ))
self.length = length
self.first = first
self.second = second
def __iter__(self):
"""Iterate to generate numbers until length reduces down to 0"""
length, first, second = self.length, self.first, self.second
while length:
yield first
first, second = second, first + second
length -= 1
|
class Fibonacci(object):
"""Generate Fibonacci Numbers"""
def __init__(self, length, first=0, second=1):
"""Set length and initials for the series"""
if not isinstance(length, int):
raise type_error("Expected length to be 'int' got '%s'" % (length.__class__.__name__,))
if length < 2:
raise value_error('Expected length to be greater than 1')
if not isinstance(first, int):
raise type_error("Expected first to be 'int' got '%s'" % (first.__class__.__name__,))
if not isinstance(second, int):
raise type_error("Expected second to be 'int' got '%s'" % (second.__class__.__name__,))
self.length = length
self.first = first
self.second = second
def __iter__(self):
"""Iterate to generate numbers until length reduces down to 0"""
(length, first, second) = (self.length, self.first, self.second)
while length:
yield first
(first, second) = (second, first + second)
length -= 1
|
class BaseAbort(object):
def __init__(self, reason):
self.reason = reason
class PythonAbort(BaseAbort):
def __init__(self, reason, pycode, lineno):
super(PythonAbort, self).__init__(reason)
self.pycode = pycode
self.lineno = lineno
def visit(self, visitor):
return visitor.visit_python_abort(self)
|
class Baseabort(object):
def __init__(self, reason):
self.reason = reason
class Pythonabort(BaseAbort):
def __init__(self, reason, pycode, lineno):
super(PythonAbort, self).__init__(reason)
self.pycode = pycode
self.lineno = lineno
def visit(self, visitor):
return visitor.visit_python_abort(self)
|
coco_file = 'yolo/darknet/coco.names'
yolo_cfg_file = 'yolo/darknet/yolov3-tiny.cfg'
yolo_weights_file = 'yolo/darknet/yolov3-tiny.weights'
img_size = (320,320)
conf_threshold = 0.5
nms_threshold = 0.3
|
coco_file = 'yolo/darknet/coco.names'
yolo_cfg_file = 'yolo/darknet/yolov3-tiny.cfg'
yolo_weights_file = 'yolo/darknet/yolov3-tiny.weights'
img_size = (320, 320)
conf_threshold = 0.5
nms_threshold = 0.3
|
with open("log.txt", "r") as f:
line = f.read()
count = int(line) + 1
with open("log.txt", "w") as f:
f.write(str(count))
|
with open('log.txt', 'r') as f:
line = f.read()
count = int(line) + 1
with open('log.txt', 'w') as f:
f.write(str(count))
|
__title__ = 'grabstats'
__description__ = 'Scrape NBA stats from Basketball-Reference'
__url__ = 'https://github.com/kndo/grabstats'
__version__ = '0.1.0'
__author__ = 'Khanh Do'
__author_email__ = 'dokhanh@gmail.com'
__license__ = 'MIT License'
|
__title__ = 'grabstats'
__description__ = 'Scrape NBA stats from Basketball-Reference'
__url__ = 'https://github.com/kndo/grabstats'
__version__ = '0.1.0'
__author__ = 'Khanh Do'
__author_email__ = 'dokhanh@gmail.com'
__license__ = 'MIT License'
|
# Definition for singly-linked list.
class ListNode:
def __init__(self, x):
self.val = x
self.next = None
class Solution:
def middleNode(self, head):
"""
:type head: ListNode
:rtype: ListNode
"""
count = 0
tmp = head
while tmp is not None:
tmp = tmp.next
count += 1
for i in range(count // 2):
head = head.next
return head
if __name__ == '__main__':
solution = Solution()
head = ListNode(1)
head.next = ListNode(2)
head.next.next = ListNode(3)
head.next.next.next = ListNode(4)
head.next.next.next.next = ListNode(5)
print(solution.middleNode(head))
head.next.next.next.next.next = ListNode(6)
print(solution.middleNode(head))
else:
pass
|
class Listnode:
def __init__(self, x):
self.val = x
self.next = None
class Solution:
def middle_node(self, head):
"""
:type head: ListNode
:rtype: ListNode
"""
count = 0
tmp = head
while tmp is not None:
tmp = tmp.next
count += 1
for i in range(count // 2):
head = head.next
return head
if __name__ == '__main__':
solution = solution()
head = list_node(1)
head.next = list_node(2)
head.next.next = list_node(3)
head.next.next.next = list_node(4)
head.next.next.next.next = list_node(5)
print(solution.middleNode(head))
head.next.next.next.next.next = list_node(6)
print(solution.middleNode(head))
else:
pass
|
class Heap():
"""
Min. Heap Class.
PARAMETERS
==========
arr: list
heap array
METHODS
=======
parent(n):
PARAMETERS
==========
n: int
index position of the child.
RETURNS
=======
int
parent index position.
to find the parent index position.
push(n):
PARAMETERS
==========
n: int
data to be pushed.
RETURNS
=======
None
to append a data point to the
heap list.
pop():
PARAMETERS
==========
RETURNS
=======
heapify():
swap():
heap_append():
climb():
"""
def __init__(self, arr=[]):
self.arr = arr
def push(self,n):
self.arr.append(n)
def pop(self):
var = self.arr[-1]
del self.arr[-1]
return var
def parent(self,n):
if n%2 !=0:
return (n-1)/2
else: return (n-2)/2
def swap(self,a,b):
temp = self.arr[b]
self.arr[b] = self.arr[a]
self.arr[a] = temp
def parent(self,n):
if n%2 !=0:
return (n-1)//2
else: return (n-2)//2
def climb(self, k):
curr = self.arr[k]
par = self.parent(k)
if par<0:
return
if self.arr[par] > curr:
self.swap(par, k)
self.climb(par)
def heap_append(self, n):
self.push(n)
last = len(self.arr) -1
self.climb(last)
def heapify(self):
temp = Heap()
while(not len(self.arr)==0):
var = self.pop()
temp.heap_append(var)
self.arr = temp.arr
|
class Heap:
"""
Min. Heap Class.
PARAMETERS
==========
arr: list
heap array
METHODS
=======
parent(n):
PARAMETERS
==========
n: int
index position of the child.
RETURNS
=======
int
parent index position.
to find the parent index position.
push(n):
PARAMETERS
==========
n: int
data to be pushed.
RETURNS
=======
None
to append a data point to the
heap list.
pop():
PARAMETERS
==========
RETURNS
=======
heapify():
swap():
heap_append():
climb():
"""
def __init__(self, arr=[]):
self.arr = arr
def push(self, n):
self.arr.append(n)
def pop(self):
var = self.arr[-1]
del self.arr[-1]
return var
def parent(self, n):
if n % 2 != 0:
return (n - 1) / 2
else:
return (n - 2) / 2
def swap(self, a, b):
temp = self.arr[b]
self.arr[b] = self.arr[a]
self.arr[a] = temp
def parent(self, n):
if n % 2 != 0:
return (n - 1) // 2
else:
return (n - 2) // 2
def climb(self, k):
curr = self.arr[k]
par = self.parent(k)
if par < 0:
return
if self.arr[par] > curr:
self.swap(par, k)
self.climb(par)
def heap_append(self, n):
self.push(n)
last = len(self.arr) - 1
self.climb(last)
def heapify(self):
temp = heap()
while not len(self.arr) == 0:
var = self.pop()
temp.heap_append(var)
self.arr = temp.arr
|
expected_output = {
"ping": {
"address": "2001:db8:223c:2c16::2",
"data-bytes": 56,
"result": [
{
"bytes": 16,
"from": "2001:db8:223c:2c16::2",
"hlim": 64,
"icmp-seq": 0,
"time": "973.514",
},
{
"bytes": 16,
"from": "2001:db8:223c:2c16::2",
"hlim": 64,
"icmp-seq": 1,
"time": "0.993",
},
{
"bytes": 16,
"from": "2001:db8:223c:2c16::2",
"hlim": 64,
"icmp-seq": 2,
"time": "1.170",
},
{
"bytes": 16,
"from": "2001:db8:223c:2c16::2",
"hlim": 64,
"icmp-seq": 3,
"time": "0.677",
},
{
"bytes": 16,
"from": "2001:db8:223c:2c16::2",
"hlim": 64,
"icmp-seq": 4,
"time": "0.914",
},
{
"bytes": 16,
"from": "2001:db8:223c:2c16::2",
"hlim": 64,
"icmp-seq": 5,
"time": "0.814",
},
{
"bytes": 16,
"from": "2001:db8:223c:2c16::2",
"hlim": 64,
"icmp-seq": 6,
"time": "0.953",
},
{
"bytes": 16,
"from": "2001:db8:223c:2c16::2",
"hlim": 64,
"icmp-seq": 7,
"time": "1.140",
},
{
"bytes": 16,
"from": "2001:db8:223c:2c16::2",
"hlim": 64,
"icmp-seq": 8,
"time": "0.800",
},
{
"bytes": 16,
"from": "2001:db8:223c:2c16::2",
"hlim": 64,
"icmp-seq": 9,
"time": "0.881",
},
],
"source": "2001:db8:223c:2c16::1",
"statistics": {
"loss-rate": 0,
"received": 10,
"round-trip": {
"avg": "98.186",
"max": "973.514",
"min": "0.677",
"stddev": "291.776",
},
"send": 10,
},
}
}
|
expected_output = {'ping': {'address': '2001:db8:223c:2c16::2', 'data-bytes': 56, 'result': [{'bytes': 16, 'from': '2001:db8:223c:2c16::2', 'hlim': 64, 'icmp-seq': 0, 'time': '973.514'}, {'bytes': 16, 'from': '2001:db8:223c:2c16::2', 'hlim': 64, 'icmp-seq': 1, 'time': '0.993'}, {'bytes': 16, 'from': '2001:db8:223c:2c16::2', 'hlim': 64, 'icmp-seq': 2, 'time': '1.170'}, {'bytes': 16, 'from': '2001:db8:223c:2c16::2', 'hlim': 64, 'icmp-seq': 3, 'time': '0.677'}, {'bytes': 16, 'from': '2001:db8:223c:2c16::2', 'hlim': 64, 'icmp-seq': 4, 'time': '0.914'}, {'bytes': 16, 'from': '2001:db8:223c:2c16::2', 'hlim': 64, 'icmp-seq': 5, 'time': '0.814'}, {'bytes': 16, 'from': '2001:db8:223c:2c16::2', 'hlim': 64, 'icmp-seq': 6, 'time': '0.953'}, {'bytes': 16, 'from': '2001:db8:223c:2c16::2', 'hlim': 64, 'icmp-seq': 7, 'time': '1.140'}, {'bytes': 16, 'from': '2001:db8:223c:2c16::2', 'hlim': 64, 'icmp-seq': 8, 'time': '0.800'}, {'bytes': 16, 'from': '2001:db8:223c:2c16::2', 'hlim': 64, 'icmp-seq': 9, 'time': '0.881'}], 'source': '2001:db8:223c:2c16::1', 'statistics': {'loss-rate': 0, 'received': 10, 'round-trip': {'avg': '98.186', 'max': '973.514', 'min': '0.677', 'stddev': '291.776'}, 'send': 10}}}
|
#player class
#constructor: player = white or black
class Player:
def __init__(self, player, username):
self.player = player
self.username = username
def move(self, move):
return
def print(self):
print(self.player)
print(self.username)
if __name__ == "__main__":
a = Player('white', 'adarsh')
a.print()
|
class Player:
def __init__(self, player, username):
self.player = player
self.username = username
def move(self, move):
return
def print(self):
print(self.player)
print(self.username)
if __name__ == '__main__':
a = player('white', 'adarsh')
a.print()
|
"""
This class is an unmodified copy of one from a blog post written by Lennart Regebro at:
http://regebro.wordpress.com/2010/12/13/python-implementing-rich-comparison-the-correct-way/
No license terms were specified in the blog post.
It has been included as a minor convenience.
If we ever need to purge our code of external contributions, replacement should be fairly trivial.
"""
class Comparable(object):
def _compare(self, other, method):
try:
return method(self._cmpkey(), other._cmpkey())
except (AttributeError, TypeError):
# _cmpkey not implemented, or return different type,
# so I can't compare with "other".
return NotImplemented
def __lt__(self, other):
return self._compare(other, lambda s,o: s < o)
def __le__(self, other):
return self._compare(other, lambda s,o: s <= o)
def __eq__(self, other):
return self._compare(other, lambda s,o: s == o)
def __ge__(self, other):
return self._compare(other, lambda s,o: s >= o)
def __gt__(self, other):
return self._compare(other, lambda s,o: s > o)
def __ne__(self, other):
return self._compare(other, lambda s,o: s != o)
|
"""
This class is an unmodified copy of one from a blog post written by Lennart Regebro at:
http://regebro.wordpress.com/2010/12/13/python-implementing-rich-comparison-the-correct-way/
No license terms were specified in the blog post.
It has been included as a minor convenience.
If we ever need to purge our code of external contributions, replacement should be fairly trivial.
"""
class Comparable(object):
def _compare(self, other, method):
try:
return method(self._cmpkey(), other._cmpkey())
except (AttributeError, TypeError):
return NotImplemented
def __lt__(self, other):
return self._compare(other, lambda s, o: s < o)
def __le__(self, other):
return self._compare(other, lambda s, o: s <= o)
def __eq__(self, other):
return self._compare(other, lambda s, o: s == o)
def __ge__(self, other):
return self._compare(other, lambda s, o: s >= o)
def __gt__(self, other):
return self._compare(other, lambda s, o: s > o)
def __ne__(self, other):
return self._compare(other, lambda s, o: s != o)
|
def joke():
return (u'Wenn ist das Nunst\u00fcck git und Slotermeyer? Ja! ... '
u'Beiherhund das Oder die Flipperwaldt gersput.')
|
def joke():
return u'Wenn ist das Nunstück git und Slotermeyer? Ja! ... Beiherhund das Oder die Flipperwaldt gersput.'
|
class HashSetString:
_ARR_DEFAULT_LENGTH = 211
def __init__(self, arr_len=_ARR_DEFAULT_LENGTH):
self._arr = [None,] * arr_len
self._count = 0
def _hash_str_00(self, value):
hashv = 0
for c in value:
hashv = (hashv * 27 + ord(c)) % len(self._arr)
return hashv
hashf = _hash_str_00
def __contains__(self, value):
return self._arr[self.hashf(value)]
def __iter__(self):
return self._iterator()
def __len__(self):
return self._count
def _iterator(self):
return (val for val in self._arr if val)
def add(self, value):
index = self.hashf(value)
if not self._arr[index]:
self._arr[index] = value
self._count += 1
def remove(self, value):
index = self.hashf(value)
if self._arr[index]:
self._arr[index] = None
self._count -= 1
else:
raise KeyError
|
class Hashsetstring:
_arr_default_length = 211
def __init__(self, arr_len=_ARR_DEFAULT_LENGTH):
self._arr = [None] * arr_len
self._count = 0
def _hash_str_00(self, value):
hashv = 0
for c in value:
hashv = (hashv * 27 + ord(c)) % len(self._arr)
return hashv
hashf = _hash_str_00
def __contains__(self, value):
return self._arr[self.hashf(value)]
def __iter__(self):
return self._iterator()
def __len__(self):
return self._count
def _iterator(self):
return (val for val in self._arr if val)
def add(self, value):
index = self.hashf(value)
if not self._arr[index]:
self._arr[index] = value
self._count += 1
def remove(self, value):
index = self.hashf(value)
if self._arr[index]:
self._arr[index] = None
self._count -= 1
else:
raise KeyError
|
class Solution:
def validIPAddress(self, IP: str) -> str:
res = 'Neither'
if IP.count(".") == 3:
for value in IP.split("."):
temp_value = re.sub(r'[^0-9]', '', value)
if not temp_value or not str(int(temp_value)) == value or int(temp_value) < 0 or int(temp_value) > 255:
return res
res = 'IPv4'
if IP.count(":") == 7:
for value in IP.split(":"):
temp_value = re.sub(r'[^a-fA-F0-9]', '', value)
if not temp_value or not temp_value == value or len(temp_value) > 4 or int(temp_value, 16) < 0:
return res
res = 'IPv6'
return res
|
class Solution:
def valid_ip_address(self, IP: str) -> str:
res = 'Neither'
if IP.count('.') == 3:
for value in IP.split('.'):
temp_value = re.sub('[^0-9]', '', value)
if not temp_value or not str(int(temp_value)) == value or int(temp_value) < 0 or (int(temp_value) > 255):
return res
res = 'IPv4'
if IP.count(':') == 7:
for value in IP.split(':'):
temp_value = re.sub('[^a-fA-F0-9]', '', value)
if not temp_value or not temp_value == value or len(temp_value) > 4 or (int(temp_value, 16) < 0):
return res
res = 'IPv6'
return res
|
# Escape the ' caracter
story_description = 'It\'s a touching story'
print(story_description)
# Escape the \ caracter
story_description = "It\\'s a touching story"
print(story_description)
# Break Line
story_description = 'It\'s a \n touching \n story'
|
story_description = "It's a touching story"
print(story_description)
story_description = "It\\'s a touching story"
print(story_description)
story_description = "It's a \n touching \n story"
|
class IAsyncResult:
""" Represents the status of an asynchronous operation. """
def __init__(self,*args):
""" x.__init__(...) initializes x; see x.__class__.__doc__ for signaturex.__init__(...) initializes x; see x.__class__.__doc__ for signature """
pass
AsyncState=property(lambda self: object(),lambda self,v: None,lambda self: None)
"""Gets a user-defined object that qualifies or contains information about an asynchronous operation.
Get: AsyncState(self: IAsyncResult) -> object
"""
AsyncWaitHandle=property(lambda self: object(),lambda self,v: None,lambda self: None)
"""Gets a System.Threading.WaitHandle that is used to wait for an asynchronous operation to complete.
Get: AsyncWaitHandle(self: IAsyncResult) -> WaitHandle
"""
CompletedSynchronously=property(lambda self: object(),lambda self,v: None,lambda self: None)
"""Gets a value that indicates whether the asynchronous operation completed synchronously.
Get: CompletedSynchronously(self: IAsyncResult) -> bool
"""
IsCompleted=property(lambda self: object(),lambda self,v: None,lambda self: None)
"""Gets a value that indicates whether the asynchronous operation has completed.
Get: IsCompleted(self: IAsyncResult) -> bool
"""
|
class Iasyncresult:
""" Represents the status of an asynchronous operation. """
def __init__(self, *args):
""" x.__init__(...) initializes x; see x.__class__.__doc__ for signaturex.__init__(...) initializes x; see x.__class__.__doc__ for signature """
pass
async_state = property(lambda self: object(), lambda self, v: None, lambda self: None)
'Gets a user-defined object that qualifies or contains information about an asynchronous operation.\n\n\n\nGet: AsyncState(self: IAsyncResult) -> object\n\n\n\n'
async_wait_handle = property(lambda self: object(), lambda self, v: None, lambda self: None)
'Gets a System.Threading.WaitHandle that is used to wait for an asynchronous operation to complete.\n\n\n\nGet: AsyncWaitHandle(self: IAsyncResult) -> WaitHandle\n\n\n\n'
completed_synchronously = property(lambda self: object(), lambda self, v: None, lambda self: None)
'Gets a value that indicates whether the asynchronous operation completed synchronously.\n\n\n\nGet: CompletedSynchronously(self: IAsyncResult) -> bool\n\n\n\n'
is_completed = property(lambda self: object(), lambda self, v: None, lambda self: None)
'Gets a value that indicates whether the asynchronous operation has completed.\n\n\n\nGet: IsCompleted(self: IAsyncResult) -> bool\n\n\n\n'
|
a = source()
b = k
if(a == w):
b = c
elif(a==y):
b = d
sink(b)
|
a = source()
b = k
if a == w:
b = c
elif a == y:
b = d
sink(b)
|
FORMER_TEAM_NAME_MAP = {
'AFC Bournemouth': 'AFC Bournemouth',
'Accrington FC': 'Accrington FC',
'Arsenal FC': 'Arsenal FC',
'Aston Villa': 'Aston Villa',
'Barnsley FC': 'Barnsley FC',
'Birmingham City': 'Birmingham City',
'Birmingham FC': 'Birmingham City',
'Blackburn Rovers': 'Blackburn Rovers',
'Blackpool FC': 'Blackpool FC',
'Bolton Wanderers': 'Bolton Wanderers',
'Bradford City': 'Bradford City',
'Bradford Park Avenue': 'Bradford Park Avenue',
'Brentford FC': 'Brentford FC',
'Brighton & Hove Albion': 'Brighton & Hove Albion',
'Bristol City': 'Bristol City',
'Burnley FC': 'Burnley FC',
'Bury FC': 'Bury FC',
'Cardiff City': 'Cardiff City',
'Riverside A.F.C.': 'Cardiff City',
'Carlisle United': 'Carlisle United',
'Charlton Athletic': 'Charlton Athletic',
'Chelsea FC': 'Chelsea FC',
'Coventry City': 'Coventry City',
'Singers F.C.': 'Coventry City',
'Crystal Palace': 'Crystal Palace',
'Darwen': 'Darwen',
'Derby County': 'Derby County',
'Everton FC': 'Everton FC',
'St. Domingo FC': 'Everton FC',
'Fulham FC': 'Fulham FC',
'Glossop North End': 'Glossop North End',
'Grimsby Town': 'Grimsby Town',
'Huddersfield Town': 'Huddersfield Town',
'Hull City': 'Hull City',
'Ipswich Town': 'Ipswich Town',
'Leeds United': 'Leeds United',
'Leicester City': 'Leicester City',
'Leicester Fosse': 'Leicester City',
'Leyton Orient': 'Leyton Orient',
'Clapton Orient': 'Leyton Orient',
'Liverpool FC': 'Liverpool FC',
'Luton Town': 'Luton Town',
'Manchester City': 'Manchester City',
'St. Marks': 'Manchester City',
'Ardwick A.F.C.': 'Manchester City',
'Manchester United': 'Manchester United',
'Middlesbrough FC': 'Middlesbrough FC',
'Millwall FC': 'Millwall FC',
'Millwall Rovers': 'Millwall FC',
'Millwall Athletic': 'Millwall FC',
'Newcastle United': 'Newcastle United',
'Newcastle East End F.C.': 'Newcastle United',
'Newton Heath FC': 'Manchester United',
'Northampton Town': 'Northampton Town',
'Norwich City': 'Norwich City',
'Nottingham Forest': 'Nottingham Forest',
'Notts County': 'Notts County',
'Oldham Athletic': 'Oldham Athletic',
'Pine Villa F.C.': 'Oldham Athletic',
'Oxford United': 'Oxford United',
'Headington United': 'Oxford United',
'Portsmouth FC': 'Portsmouth FC',
'Portsmouth Royal Navy': 'Portsmouth FC',
'Preston North End': 'Preston North End',
'Queens Park Rangers': 'Queens Park Rangers',
'Reading FC': 'Reading FC',
'Sheffield United': 'Sheffield United',
'Sheffield Wednesday': 'Sheffield Wednesday',
'Wednesday Football Club': 'Sheffield Wednesday',
'Small Heath Birmingham': 'Birmingham City',
'Southampton FC': 'Southampton FC',
"St. Mary's F.C": 'Southampton FC',
"Southampton St. Mary's": 'Southampton FC',
'Stoke City': 'Stoke City',
'Stoke Ramblers': 'Stoke City',
'Stoke F.C.': 'Stoke City',
'Sunderland AFC': 'Sunderland AFC',
'Sunderland and District Teachers AFC': 'Sunderland AFC',
'Swansea City': 'Swansea City',
'Swansea Town': 'Swansea City',
'Swindon Town': 'Swindon Town',
'Tottenham Hotspur': 'Tottenham Hotspur',
'Hotspur FC': 'Tottenham Hotspur',
'Watford FC': 'Watford FC',
'Watford Rovers': 'Watford FC',
'West Hertfordshire': 'Watford FC',
'West Bromwich Albion': 'West Bromwich Albion',
'West Bromwich Strollers': 'West Bromwich Albion',
'West Ham United': 'West Ham United',
'Thames Ironworks F.C.': 'West Ham United',
'Wigan Athletic': 'Wigan Athletic',
'Wimbledon FC': 'Wimbledon FC',
'Wolverhampton Wanderers': 'Wolverhampton Wanderers',
"St Luke's F.C": 'Wolverhampton Wanderers',
'Woolwich Arsenal': 'Arsenal FC'
}
|
former_team_name_map = {'AFC Bournemouth': 'AFC Bournemouth', 'Accrington FC': 'Accrington FC', 'Arsenal FC': 'Arsenal FC', 'Aston Villa': 'Aston Villa', 'Barnsley FC': 'Barnsley FC', 'Birmingham City': 'Birmingham City', 'Birmingham FC': 'Birmingham City', 'Blackburn Rovers': 'Blackburn Rovers', 'Blackpool FC': 'Blackpool FC', 'Bolton Wanderers': 'Bolton Wanderers', 'Bradford City': 'Bradford City', 'Bradford Park Avenue': 'Bradford Park Avenue', 'Brentford FC': 'Brentford FC', 'Brighton & Hove Albion': 'Brighton & Hove Albion', 'Bristol City': 'Bristol City', 'Burnley FC': 'Burnley FC', 'Bury FC': 'Bury FC', 'Cardiff City': 'Cardiff City', 'Riverside A.F.C.': 'Cardiff City', 'Carlisle United': 'Carlisle United', 'Charlton Athletic': 'Charlton Athletic', 'Chelsea FC': 'Chelsea FC', 'Coventry City': 'Coventry City', 'Singers F.C.': 'Coventry City', 'Crystal Palace': 'Crystal Palace', 'Darwen': 'Darwen', 'Derby County': 'Derby County', 'Everton FC': 'Everton FC', 'St. Domingo FC': 'Everton FC', 'Fulham FC': 'Fulham FC', 'Glossop North End': 'Glossop North End', 'Grimsby Town': 'Grimsby Town', 'Huddersfield Town': 'Huddersfield Town', 'Hull City': 'Hull City', 'Ipswich Town': 'Ipswich Town', 'Leeds United': 'Leeds United', 'Leicester City': 'Leicester City', 'Leicester Fosse': 'Leicester City', 'Leyton Orient': 'Leyton Orient', 'Clapton Orient': 'Leyton Orient', 'Liverpool FC': 'Liverpool FC', 'Luton Town': 'Luton Town', 'Manchester City': 'Manchester City', 'St. Marks': 'Manchester City', 'Ardwick A.F.C.': 'Manchester City', 'Manchester United': 'Manchester United', 'Middlesbrough FC': 'Middlesbrough FC', 'Millwall FC': 'Millwall FC', 'Millwall Rovers': 'Millwall FC', 'Millwall Athletic': 'Millwall FC', 'Newcastle United': 'Newcastle United', 'Newcastle East End F.C.': 'Newcastle United', 'Newton Heath FC': 'Manchester United', 'Northampton Town': 'Northampton Town', 'Norwich City': 'Norwich City', 'Nottingham Forest': 'Nottingham Forest', 'Notts County': 'Notts County', 'Oldham Athletic': 'Oldham Athletic', 'Pine Villa F.C.': 'Oldham Athletic', 'Oxford United': 'Oxford United', 'Headington United': 'Oxford United', 'Portsmouth FC': 'Portsmouth FC', 'Portsmouth Royal Navy': 'Portsmouth FC', 'Preston North End': 'Preston North End', 'Queens Park Rangers': 'Queens Park Rangers', 'Reading FC': 'Reading FC', 'Sheffield United': 'Sheffield United', 'Sheffield Wednesday': 'Sheffield Wednesday', 'Wednesday Football Club': 'Sheffield Wednesday', 'Small Heath Birmingham': 'Birmingham City', 'Southampton FC': 'Southampton FC', "St. Mary's F.C": 'Southampton FC', "Southampton St. Mary's": 'Southampton FC', 'Stoke City': 'Stoke City', 'Stoke Ramblers': 'Stoke City', 'Stoke F.C.': 'Stoke City', 'Sunderland AFC': 'Sunderland AFC', 'Sunderland and District Teachers AFC': 'Sunderland AFC', 'Swansea City': 'Swansea City', 'Swansea Town': 'Swansea City', 'Swindon Town': 'Swindon Town', 'Tottenham Hotspur': 'Tottenham Hotspur', 'Hotspur FC': 'Tottenham Hotspur', 'Watford FC': 'Watford FC', 'Watford Rovers': 'Watford FC', 'West Hertfordshire': 'Watford FC', 'West Bromwich Albion': 'West Bromwich Albion', 'West Bromwich Strollers': 'West Bromwich Albion', 'West Ham United': 'West Ham United', 'Thames Ironworks F.C.': 'West Ham United', 'Wigan Athletic': 'Wigan Athletic', 'Wimbledon FC': 'Wimbledon FC', 'Wolverhampton Wanderers': 'Wolverhampton Wanderers', "St Luke's F.C": 'Wolverhampton Wanderers', 'Woolwich Arsenal': 'Arsenal FC'}
|
class RouteWithTooSmallCapacity(Exception):
pass
class RebalanceFailure(Exception):
pass
class NoRouteError(Exception):
pass
class DryRunException(Exception):
pass
class PaymentTimeOut(Exception):
pass
class TooExpensive(Exception):
pass
|
class Routewithtoosmallcapacity(Exception):
pass
class Rebalancefailure(Exception):
pass
class Norouteerror(Exception):
pass
class Dryrunexception(Exception):
pass
class Paymenttimeout(Exception):
pass
class Tooexpensive(Exception):
pass
|
"""Meta data for HTTPie options."""
FLAG_OPTIONS = [
('--body', 'Print only response body'),
('--check-status', 'Check HTTP status code'),
('--continue', 'Resume an interrupted download'),
('--debug', 'Print debug information'),
('--download', 'Download as a file'),
('--follow', 'Allow full redirects'),
('--form', 'Send as form fields'),
('--headers', 'Print only response headers'),
('--help', 'Show tool (HTTPie, cURL) help message'),
('--ignore-stdin', 'Do not read stdin'),
('--json', 'Send as a JSON object (default)'),
('--stream', 'Stream the output'),
('--traceback', 'Print exception traceback'),
('--verbose', 'Print the whole request and response'),
('--version', 'Show version'),
('-b', 'Shorthand for --body'),
('-c', 'Shorthand for --continue'),
('-d', 'Shorthand for --download'),
('-f', 'Shorthand for --form'),
('-h', 'Shorthand for --headers'),
('-j', 'Shorthand for --json'),
('-S', 'Shorthand for --stream'),
('-v', 'Shorthand for --verbose'),
]
VALUE_OPTIONS = [
('--auth', 'Do authentication'),
('--auth-type', 'Authentication mechanism to be used'),
('--cert', 'Specify client SSL certificate'),
('--cert-key', 'The private key to use with SSL'),
('--output', 'Save output to a file'),
('--pretty', 'Control output processing'),
('--print', 'Specify what output should contain'),
('--proxy', 'Specify proxy URL'),
('--raw', 'Pass raw request data without extra processing'),
('--session', 'Create, or reuse and update a session'),
('--session-read-only', 'Create or read a session'),
('--style', 'Output coloring style'),
('--timeout', 'Connection timeout in seconds'),
('--verify', 'Set to "no" to skip SSL certificate checking'),
('-a', 'Shorthand for --auth'),
('-o', 'Shorthand for --output'),
('-p', 'Shorthand for --print'),
('-s', 'Shorthand for --style'),
]
PRETTY_CHOICES = ('all', 'colors', 'format', 'none')
STYLE_CHOICES = ('algol', 'algol_nu', 'autumn', 'borland', 'bw', 'colorful',
'default', 'emacs', 'friendly', 'fruity', 'igor', 'lovelace',
'manni', 'monokai', 'murphy', 'native', 'paraiso-dark',
'paraiso-light', 'pastie', 'perldoc', 'rrt', 'solarized',
'tango', 'trac', 'vim', 'vs', 'xcode')
AUTH_TYPE_CHOICES = ('basic', 'digest')
VERIFY_CHOICES = ('no', 'yes')
OPTION_VALUE_CHOICES = {
'--auth-type': AUTH_TYPE_CHOICES,
'--pretty': PRETTY_CHOICES,
'--style': STYLE_CHOICES,
'--verify': VERIFY_CHOICES,
'-p': PRETTY_CHOICES,
'-s': STYLE_CHOICES,
}
|
"""Meta data for HTTPie options."""
flag_options = [('--body', 'Print only response body'), ('--check-status', 'Check HTTP status code'), ('--continue', 'Resume an interrupted download'), ('--debug', 'Print debug information'), ('--download', 'Download as a file'), ('--follow', 'Allow full redirects'), ('--form', 'Send as form fields'), ('--headers', 'Print only response headers'), ('--help', 'Show tool (HTTPie, cURL) help message'), ('--ignore-stdin', 'Do not read stdin'), ('--json', 'Send as a JSON object (default)'), ('--stream', 'Stream the output'), ('--traceback', 'Print exception traceback'), ('--verbose', 'Print the whole request and response'), ('--version', 'Show version'), ('-b', 'Shorthand for --body'), ('-c', 'Shorthand for --continue'), ('-d', 'Shorthand for --download'), ('-f', 'Shorthand for --form'), ('-h', 'Shorthand for --headers'), ('-j', 'Shorthand for --json'), ('-S', 'Shorthand for --stream'), ('-v', 'Shorthand for --verbose')]
value_options = [('--auth', 'Do authentication'), ('--auth-type', 'Authentication mechanism to be used'), ('--cert', 'Specify client SSL certificate'), ('--cert-key', 'The private key to use with SSL'), ('--output', 'Save output to a file'), ('--pretty', 'Control output processing'), ('--print', 'Specify what output should contain'), ('--proxy', 'Specify proxy URL'), ('--raw', 'Pass raw request data without extra processing'), ('--session', 'Create, or reuse and update a session'), ('--session-read-only', 'Create or read a session'), ('--style', 'Output coloring style'), ('--timeout', 'Connection timeout in seconds'), ('--verify', 'Set to "no" to skip SSL certificate checking'), ('-a', 'Shorthand for --auth'), ('-o', 'Shorthand for --output'), ('-p', 'Shorthand for --print'), ('-s', 'Shorthand for --style')]
pretty_choices = ('all', 'colors', 'format', 'none')
style_choices = ('algol', 'algol_nu', 'autumn', 'borland', 'bw', 'colorful', 'default', 'emacs', 'friendly', 'fruity', 'igor', 'lovelace', 'manni', 'monokai', 'murphy', 'native', 'paraiso-dark', 'paraiso-light', 'pastie', 'perldoc', 'rrt', 'solarized', 'tango', 'trac', 'vim', 'vs', 'xcode')
auth_type_choices = ('basic', 'digest')
verify_choices = ('no', 'yes')
option_value_choices = {'--auth-type': AUTH_TYPE_CHOICES, '--pretty': PRETTY_CHOICES, '--style': STYLE_CHOICES, '--verify': VERIFY_CHOICES, '-p': PRETTY_CHOICES, '-s': STYLE_CHOICES}
|
QWORD = 8
DWORD = 4
WORD = 2
BYTE = 1
|
qword = 8
dword = 4
word = 2
byte = 1
|
# -*- coding: utf-8 -*-
#
# IceCream - Never use print() to debug again
#
# Ansgar Grunseid
# grunseid.com
# grunseid@gmail.com
#
# License: MIT
#
__title__ = 'icecream'
__license__ = 'MIT'
__version__ = '2.1.1'
__author__ = 'Ansgar Grunseid'
__contact__ = 'grunseid@gmail.com'
__url__ = 'https://github.com/gruns/icecream'
__description__ = (
'Never use print() to debug again; inspect variables, expressions, and '
'program execution with a single, simple function call.')
|
__title__ = 'icecream'
__license__ = 'MIT'
__version__ = '2.1.1'
__author__ = 'Ansgar Grunseid'
__contact__ = 'grunseid@gmail.com'
__url__ = 'https://github.com/gruns/icecream'
__description__ = 'Never use print() to debug again; inspect variables, expressions, and program execution with a single, simple function call.'
|
all_datasets = {
'macdebug': 'macdebug',
'128leftonly': 'ords062',
'128w': 'ords064sc9',
'128valsame': 'ords064sc9',
}
|
all_datasets = {'macdebug': 'macdebug', '128leftonly': 'ords062', '128w': 'ords064sc9', '128valsame': 'ords064sc9'}
|
ternary = [0, 1, 2]
ternary[0] = "true"
ternary[1] = "maybe"
ternary[2] = "false"
x = 34
y = 34
if x > y:
print(ternary[0])
elif x < y:
print(ternary[2])
else:
print(ternary[1])
|
ternary = [0, 1, 2]
ternary[0] = 'true'
ternary[1] = 'maybe'
ternary[2] = 'false'
x = 34
y = 34
if x > y:
print(ternary[0])
elif x < y:
print(ternary[2])
else:
print(ternary[1])
|
#
# PySNMP MIB module FDDI-SMT73-MIB (http://pysnmp.sf.net)
# ASN.1 source http://mibs.snmplabs.com:80/asn1/FDDI-SMT73-MIB
# Produced by pysmi-0.0.7 at Sun Feb 14 00:12:32 2016
# On host bldfarm platform Linux version 4.1.13-100.fc21.x86_64 by user goose
# Using Python version 3.5.0 (default, Jan 5 2016, 17:11:52)
#
( OctetString, Integer, ObjectIdentifier, ) = mibBuilder.importSymbols("ASN1", "OctetString", "Integer", "ObjectIdentifier")
( NamedValues, ) = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues")
( ValueSizeConstraint, ConstraintsIntersection, ValueRangeConstraint, SingleValueConstraint, ConstraintsUnion, ) = mibBuilder.importSymbols("ASN1-REFINEMENT", "ValueSizeConstraint", "ConstraintsIntersection", "ValueRangeConstraint", "SingleValueConstraint", "ConstraintsUnion")
( NotificationGroup, ModuleCompliance, ) = mibBuilder.importSymbols("SNMPv2-CONF", "NotificationGroup", "ModuleCompliance")
( MibScalar, MibTable, MibTableRow, MibTableColumn, Integer32, Gauge32, Bits, Unsigned32, Counter64, TimeTicks, NotificationType, ModuleIdentity, ObjectIdentity, mib_2, MibIdentifier, iso, Counter32, IpAddress, ) = mibBuilder.importSymbols("SNMPv2-SMI", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "Integer32", "Gauge32", "Bits", "Unsigned32", "Counter64", "TimeTicks", "NotificationType", "ModuleIdentity", "ObjectIdentity", "mib-2", "MibIdentifier", "iso", "Counter32", "IpAddress")
( DisplayString, TextualConvention, ) = mibBuilder.importSymbols("SNMPv2-TC", "DisplayString", "TextualConvention")
transmission = MibIdentifier((1, 3, 6, 1, 2, 1, 10))
fddi = MibIdentifier((1, 3, 6, 1, 2, 1, 10, 15))
fddimib = MibIdentifier((1, 3, 6, 1, 2, 1, 10, 15, 73))
class FddiTimeNano(Integer32):
subtypeSpec = Integer32.subtypeSpec+ValueRangeConstraint(0,2147483647)
class FddiTimeMilli(Integer32):
subtypeSpec = Integer32.subtypeSpec+ValueRangeConstraint(0,2147483647)
class FddiResourceId(Integer32):
subtypeSpec = Integer32.subtypeSpec+ValueRangeConstraint(0,65535)
class FddiSMTStationIdType(OctetString):
subtypeSpec = OctetString.subtypeSpec+ValueSizeConstraint(8,8)
fixedLength = 8
class FddiMACLongAddressType(OctetString):
subtypeSpec = OctetString.subtypeSpec+ValueSizeConstraint(6,6)
fixedLength = 6
fddimibSMT = MibIdentifier((1, 3, 6, 1, 2, 1, 10, 15, 73, 1))
fddimibMAC = MibIdentifier((1, 3, 6, 1, 2, 1, 10, 15, 73, 2))
fddimibMACCounters = MibIdentifier((1, 3, 6, 1, 2, 1, 10, 15, 73, 3))
fddimibPATH = MibIdentifier((1, 3, 6, 1, 2, 1, 10, 15, 73, 4))
fddimibPORT = MibIdentifier((1, 3, 6, 1, 2, 1, 10, 15, 73, 5))
fddimibSMTNumber = MibScalar((1, 3, 6, 1, 2, 1, 10, 15, 73, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0,65535))).setMaxAccess("readonly")
if mibBuilder.loadTexts: fddimibSMTNumber.setDescription("The number of SMT implementations (regardless of \n their current state) on this network management \n application entity. The value for this variable \n must remain constant at least from one re- \n initialization of the entity's network management \n system to the next re-initialization.")
fddimibSMTTable = MibTable((1, 3, 6, 1, 2, 1, 10, 15, 73, 1, 2), )
if mibBuilder.loadTexts: fddimibSMTTable.setDescription('A list of SMT entries. The number of entries \n shall not exceed the value of fddimibSMTNumber.')
fddimibSMTEntry = MibTableRow((1, 3, 6, 1, 2, 1, 10, 15, 73, 1, 2, 1), ).setIndexNames((0, "FDDI-SMT73-MIB", "fddimibSMTIndex"))
if mibBuilder.loadTexts: fddimibSMTEntry.setDescription('An SMT entry containing information common to a \n given SMT.')
fddimibSMTIndex = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 1, 2, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1,65535))).setMaxAccess("readonly")
if mibBuilder.loadTexts: fddimibSMTIndex.setDescription("A unique value for each SMT. The value for each \n SMT must remain constant at least from one re- \n initialization of the entity's network management \n system to the next re-initialization.")
fddimibSMTStationId = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 1, 2, 1, 2), FddiSMTStationIdType()).setMaxAccess("readonly")
if mibBuilder.loadTexts: fddimibSMTStationId.setDescription('Used to uniquely identify an FDDI station.')
fddimibSMTOpVersionId = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 1, 2, 1, 3), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1,65535))).setMaxAccess("readonly")
if mibBuilder.loadTexts: fddimibSMTOpVersionId.setDescription('The version that this station is using for its \n operation (refer to ANSI 7.1.2.2). The value of \n this variable is 2 for this SMT revision.')
fddimibSMTHiVersionId = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 1, 2, 1, 4), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1,65535))).setMaxAccess("readonly")
if mibBuilder.loadTexts: fddimibSMTHiVersionId.setDescription('The highest version of SMT that this station \n supports (refer to ANSI 7.1.2.2).')
fddimibSMTLoVersionId = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 1, 2, 1, 5), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1,65535))).setMaxAccess("readonly")
if mibBuilder.loadTexts: fddimibSMTLoVersionId.setDescription('The lowest version of SMT that this station \n supports (refer to ANSI 7.1.2.2).')
fddimibSMTUserData = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 1, 2, 1, 6), OctetString().subtype(subtypeSpec=ValueSizeConstraint(32,32)).setFixedLength(32)).setMaxAccess("readwrite")
if mibBuilder.loadTexts: fddimibSMTUserData.setDescription('This variable contains 32 octets of user defined \n information. The information shall be an ASCII \n string.')
fddimibSMTMIBVersionId = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 1, 2, 1, 7), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0,65535))).setMaxAccess("readonly")
if mibBuilder.loadTexts: fddimibSMTMIBVersionId.setDescription('The version of the FDDI MIB of this station. The \n value of this variable is 1 for this SMT \n revision.')
fddimibSMTMACCts = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 1, 2, 1, 8), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0,255))).setMaxAccess("readonly")
if mibBuilder.loadTexts: fddimibSMTMACCts.setDescription('The number of MACs in this station or \n concentrator.')
fddimibSMTNonMasterCts = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 1, 2, 1, 9), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0,2))).setMaxAccess("readonly")
if mibBuilder.loadTexts: fddimibSMTNonMasterCts.setDescription('The value of this variable is the number of A, B, \n and S ports in this station or concentrator.')
fddimibSMTMasterCts = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 1, 2, 1, 10), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0,255))).setMaxAccess("readonly")
if mibBuilder.loadTexts: fddimibSMTMasterCts.setDescription('The number of M Ports in a node. If the node is \n not a concentrator, the value of the variable is \n zero.')
fddimibSMTAvailablePaths = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 1, 2, 1, 11), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0,7))).setMaxAccess("readonly")
if mibBuilder.loadTexts: fddimibSMTAvailablePaths.setDescription('A value that indicates the PATH types available \n in the station. \n \n The value is a sum. This value initially takes \n the value zero, then for each type of PATH that \n this node has available, 2 raised to a power is \n added to the sum. The powers are according to the \n following table: \n \n Path Power \n Primary 0 \n Secondary 1 \n Local 2 \n \n For example, a station having Primary and Local \n PATHs available would have a value of 5 (2**0 + \n 2**2).')
fddimibSMTConfigCapabilities = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 1, 2, 1, 12), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0,3))).setMaxAccess("readonly")
if mibBuilder.loadTexts: fddimibSMTConfigCapabilities.setDescription("A value that indicates the configuration \n capabilities of a node. The 'Hold Available' bit \n indicates the support of the optional Hold \n Function, which is controlled by \n fddiSMTConfigPolicy. The 'CF-Wrap-AB' bit \n indicates that the station has the capability of \n performing a wrap_ab (refer to ANSI SMT 9.7.2.2). \n \n The value is a sum. This value initially takes \n the value zero, then for each of the configuration \n policies currently enforced on the node, 2 raised \n to a power is added to the sum. The powers are \n according to the following table: \n \n Policy Power \n holdAvailable 0 \n CF-Wrap-AB 1 ")
fddimibSMTConfigPolicy = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 1, 2, 1, 13), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0,1))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: fddimibSMTConfigPolicy.setDescription("A value that indicates the configuration policies \n currently desired in a node. 'Hold' is one of the \n terms used for the Hold Flag, an optional ECM flag \n used to enable the optional Hold policy. \n \n The value is a sum. This value initially takes \n the value zero, then for each of the configuration \n policies currently enforced on the node, 2 raised \n to a power is added to the sum. The powers are \n according to the following table: \n \n Policy Power \n configurationhold 0 ")
fddimibSMTConnectionPolicy = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 1, 2, 1, 14), Integer32().subtype(subtypeSpec=ValueRangeConstraint(32768,65535))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: fddimibSMTConnectionPolicy.setDescription("A value representing the connection policies in \n effect in a node. A station sets the corresponding \n bit for each of the connection types that it \n rejects. The letter designations, X and Y, in the \n 'rejectX-Y' names have the following significance: \n X represents the PC-Type of the local PORT and Y \n represents the PC_Type of the adjacent PORT \n (PC_Neighbor). The evaluation of Connection- \n Policy (PC-Type, PC-Neighbor) is done to determine \n the setting of T- Val(3) in the PC-Signalling \n sequence (refer to ANSI 9.6.3). Note that Bit 15, \n (rejectM-M), is always set and cannot be cleared. \n \n The value is a sum. This value initially takes \n the value zero, then for each of the connection \n policies currently enforced on the node, 2 raised \n to a power is added to the sum. The powers are \n according to the following table: \n \n Policy Power \n rejectA-A 0 \n rejectA-B 1 \n rejectA-S 2 \n rejectA-M 3 \n rejectB-A 4 \n rejectB-B 5 \n rejectB-S 6 \n rejectB-M 7 \n rejectS-A 8 \n rejectS-B 9 \n rejectS-S 10 \n rejectS-M 11 \n rejectM-A 12 \n rejectM-B 13 \n rejectM-S 14 \n rejectM-M 15 ")
fddimibSMTTNotify = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 1, 2, 1, 15), Integer32().subtype(subtypeSpec=ValueRangeConstraint(2,30))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: fddimibSMTTNotify.setDescription('The timer, expressed in seconds, used in the \n Neighbor Notification protocol. It has a range of \n 2 seconds to 30 seconds, and its default value is \n 30 seconds (refer to ANSI SMT 8.2).')
fddimibSMTStatRptPolicy = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 1, 2, 1, 16), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2,))).clone(namedValues=NamedValues(("true", 1), ("false", 2),))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: fddimibSMTStatRptPolicy.setDescription('If true, indicates that the node will generate \n Status Reporting Frames for its implemented events \n and conditions. It has an initial value of true. \n This variable determines the value of the \n SR_Enable Flag (refer to ANSI SMT 8.3.2.1).')
fddimibSMTTraceMaxExpiration = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 1, 2, 1, 17), FddiTimeMilli()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: fddimibSMTTraceMaxExpiration.setDescription('Reference Trace_Max (refer to ANSI SMT \n 9.4.4.2.2).')
fddimibSMTBypassPresent = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 1, 2, 1, 18), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2,))).clone(namedValues=NamedValues(("true", 1), ("false", 2),))).setMaxAccess("readonly")
if mibBuilder.loadTexts: fddimibSMTBypassPresent.setDescription('A flag indicating if the station has a bypass on \n its AB port pair.')
fddimibSMTECMState = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 1, 2, 1, 19), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6, 7, 8,))).clone(namedValues=NamedValues(("ec0", 1), ("ec1", 2), ("ec2", 3), ("ec3", 4), ("ec4", 5), ("ec5", 6), ("ec6", 7), ("ec7", 8),))).setMaxAccess("readonly")
if mibBuilder.loadTexts: fddimibSMTECMState.setDescription('Indicates the current state of the ECM state \n machine (refer to ANSI SMT 9.5.2).')
fddimibSMTCFState = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 1, 2, 1, 20), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13,))).clone(namedValues=NamedValues(("cf0", 1), ("cf1", 2), ("cf2", 3), ("cf3", 4), ("cf4", 5), ("cf5", 6), ("cf6", 7), ("cf7", 8), ("cf8", 9), ("cf9", 10), ("cf10", 11), ("cf11", 12), ("cf12", 13),))).setMaxAccess("readonly")
if mibBuilder.loadTexts: fddimibSMTCFState.setDescription('The attachment configuration for the station or \n concentrator (refer to ANSI SMT 9.7.2.2).')
fddimibSMTRemoteDisconnectFlag = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 1, 2, 1, 21), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2,))).clone(namedValues=NamedValues(("true", 1), ("false", 2),))).setMaxAccess("readonly")
if mibBuilder.loadTexts: fddimibSMTRemoteDisconnectFlag.setDescription('A flag indicating that the station was remotely \n disconnected from the network as a result of \n receiving an fddiSMTAction, disconnect (refer to \n ANSI SMT 6.4.5.3) in a Parameter Management Frame. \n A station requires a Connect Action to rejoin and \n clear the flag (refer to ANSI SMT 6.4.5.2).')
fddimibSMTStationStatus = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 1, 2, 1, 22), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3,))).clone(namedValues=NamedValues(("concatenated", 1), ("separated", 2), ("thru", 3),))).setMaxAccess("readonly")
if mibBuilder.loadTexts: fddimibSMTStationStatus.setDescription('The current status of the primary and secondary \n paths within this station.')
fddimibSMTPeerWrapFlag = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 1, 2, 1, 23), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2,))).clone(namedValues=NamedValues(("true", 1), ("false", 2),))).setMaxAccess("readonly")
if mibBuilder.loadTexts: fddimibSMTPeerWrapFlag.setDescription('This variable assumes the value of the \n PeerWrapFlag in CFM (refer to ANSI SMT \n 9.7.2.4.4).')
fddimibSMTTimeStamp = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 1, 2, 1, 24), FddiTimeMilli()).setMaxAccess("readonly")
if mibBuilder.loadTexts: fddimibSMTTimeStamp.setDescription('This variable assumes the value of TimeStamp \n (refer to ANSI SMT 8.3.2.1).')
fddimibSMTTransitionTimeStamp = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 1, 2, 1, 25), FddiTimeMilli()).setMaxAccess("readonly")
if mibBuilder.loadTexts: fddimibSMTTransitionTimeStamp.setDescription('This variable assumes the value of \n TransitionTimeStamp (refer to ANSI SMT 8.3.2.1).')
fddimibSMTStationAction = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 1, 2, 1, 26), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6, 7, 8,))).clone(namedValues=NamedValues(("other", 1), ("connect", 2), ("disconnect", 3), ("path-Test", 4), ("self-Test", 5), ("disable-a", 6), ("disable-b", 7), ("disable-m", 8),))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: fddimibSMTStationAction.setDescription("This object, when read, always returns a value of \n other(1). The behavior of setting this variable \n to each of the acceptable values is as follows: \n \n other(1): Results in an appropriate error. \n connect(2): Generates a Connect signal to ECM \n to begin a connection sequence. See ANSI \n Ref 9.4.2. \n disconnect(3): Generates a Disconnect signal \n to ECM. see ANSI Ref 9.4.2. \n path-Test(4): Initiates a station Path_Test. \n The Path_Test variable (see ANSI Ref \n 9.4.1) is set to 'Testing'. The results \n of this action are not specified in this \n standard. \n self-Test(5): Initiates a station Self_Test. \n The results of this action are not \n specified in this standard. \n disable-a(6): Causes a PC_Disable on the A \n port if the A port mode is peer. \n disable-b(7): Causes a PC_Disable on the B \n port if the B port mode is peer. \n disable-m(8): Causes a PC_Disable on all M \n ports. \n \n Attempts to set this object to all other values \n results in an appropriate error. The result of \n setting this variable to path-Test(4) or self- \n Test(5) is implementation-specific.")
fddimibMACNumber = MibScalar((1, 3, 6, 1, 2, 1, 10, 15, 73, 2, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0,65535))).setMaxAccess("readonly")
if mibBuilder.loadTexts: fddimibMACNumber.setDescription("The total number of MAC implementations (across \n all SMTs) on this network management application \n entity. The value for this variable must remain \n constant at least from one re-initialization of \n the entity's network management system to the next \n re-initialization.")
fddimibMACTable = MibTable((1, 3, 6, 1, 2, 1, 10, 15, 73, 2, 2), )
if mibBuilder.loadTexts: fddimibMACTable.setDescription('A list of MAC entries. The number of entries \n shall not exceed the value of fddimibMACNumber.')
fddimibMACEntry = MibTableRow((1, 3, 6, 1, 2, 1, 10, 15, 73, 2, 2, 1), ).setIndexNames((0, "FDDI-SMT73-MIB", "fddimibMACSMTIndex"), (0, "FDDI-SMT73-MIB", "fddimibMACIndex"))
if mibBuilder.loadTexts: fddimibMACEntry.setDescription('A MAC entry containing information common to a \n given MAC.')
fddimibMACSMTIndex = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 2, 2, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1,65535))).setMaxAccess("readonly")
if mibBuilder.loadTexts: fddimibMACSMTIndex.setDescription('The value of the SMT index associated with this \n MAC.')
fddimibMACIndex = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 2, 2, 1, 2), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1,65535))).setMaxAccess("readonly")
if mibBuilder.loadTexts: fddimibMACIndex.setDescription('Index variable for uniquely identifying the MAC \n object instances, which is the same as the \n corresponding resource index in SMT.')
fddimibMACIfIndex = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 2, 2, 1, 3), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1,65535))).setMaxAccess("readonly")
if mibBuilder.loadTexts: fddimibMACIfIndex.setDescription('The value of the MIB-II ifIndex corresponding to \n this MAC. If none is applicable, 0 is returned.')
fddimibMACFrameStatusFunctions = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 2, 2, 1, 4), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0,7))).setMaxAccess("readonly")
if mibBuilder.loadTexts: fddimibMACFrameStatusFunctions.setDescription("Indicates the MAC's optional Frame Status \n processing functions. \n \n The value is a sum. This value initially takes \n the value zero, then for each function present, 2 \n raised to a power is added to the sum. The powers \n are according to the following table: \n \n function Power \n fs-repeating 0 \n fs-setting 1 \n fs-clearing 2 ")
fddimibMACTMaxCapability = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 2, 2, 1, 5), FddiTimeNano()).setMaxAccess("readonly")
if mibBuilder.loadTexts: fddimibMACTMaxCapability.setDescription('Indicates the maximum time value of fddiMACTMax \n that this MAC can support.')
fddimibMACTVXCapability = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 2, 2, 1, 6), FddiTimeNano()).setMaxAccess("readonly")
if mibBuilder.loadTexts: fddimibMACTVXCapability.setDescription('Indicates the maximum time value of \n fddiMACTvxValue that this MAC can support.')
fddimibMACAvailablePaths = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 2, 2, 1, 7), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0,7))).setMaxAccess("readonly")
if mibBuilder.loadTexts: fddimibMACAvailablePaths.setDescription('Indicates the paths available for this MAC (refer \n to ANSI SMT 9.7.7). \n \n The value is a sum. This value initially takes \n the value zero, then for each type of PATH that \n this MAC has available, 2 raised to a power is \n added to the sum. The powers are according to the \n following table: \n \n Path Power \n Primary 0 \n Secondary 1 \n Local 2 ')
fddimibMACCurrentPath = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 2, 2, 1, 8), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6,))).clone(namedValues=NamedValues(("isolated", 1), ("local", 2), ("secondary", 3), ("primary", 4), ("concatenated", 5), ("thru", 6),))).setMaxAccess("readonly")
if mibBuilder.loadTexts: fddimibMACCurrentPath.setDescription('Indicates the Path into which this MAC is \n currently inserted (refer to ANSI 9.7.7).')
fddimibMACUpstreamNbr = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 2, 2, 1, 9), FddiMACLongAddressType()).setMaxAccess("readonly")
if mibBuilder.loadTexts: fddimibMACUpstreamNbr.setDescription("The MAC's upstream neighbor's long individual MAC \n address. It has an initial value of the SMT- \n Unknown-MAC Address and is only modified as \n specified by the Neighbor Information Frame \n protocol (refer to ANSI SMT 7.2.1 and 8.2).")
fddimibMACDownstreamNbr = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 2, 2, 1, 10), FddiMACLongAddressType()).setMaxAccess("readonly")
if mibBuilder.loadTexts: fddimibMACDownstreamNbr.setDescription("The MAC's downstream neighbor's long individual \n MAC address. It has an initial value of the SMT- \n Unknown-MAC Address and is only modified as \n specified by the Neighbor Information Frame \n protocol (refer to ANSI SMT 7.2.1 and 8.2).")
fddimibMACOldUpstreamNbr = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 2, 2, 1, 11), FddiMACLongAddressType()).setMaxAccess("readonly")
if mibBuilder.loadTexts: fddimibMACOldUpstreamNbr.setDescription("The previous value of the MAC's upstream \n neighbor's long individual MAC address. It has an \n initial value of the SMT-Unknown- MAC Address and \n is only modified as specified by the Neighbor \n Information Frame protocol (refer to ANSI SMT \n 7.2.1 and 8.2).")
fddimibMACOldDownstreamNbr = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 2, 2, 1, 12), FddiMACLongAddressType()).setMaxAccess("readonly")
if mibBuilder.loadTexts: fddimibMACOldDownstreamNbr.setDescription("The previous value of the MAC's downstream \n neighbor's long individual MAC address. It has an \n initial value of the SMT- Unknown-MAC Address and \n is only modified as specified by the Neighbor \n Information Frame protocol (refer to ANSI SMT \n 7.2.1 and 8.2).")
fddimibMACDupAddressTest = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 2, 2, 1, 13), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3,))).clone(namedValues=NamedValues(("none", 1), ("pass", 2), ("fail", 3),))).setMaxAccess("readonly")
if mibBuilder.loadTexts: fddimibMACDupAddressTest.setDescription('The Duplicate Address Test flag, Dup_Addr_Test \n (refer to ANSI 8.2).')
fddimibMACRequestedPaths = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 2, 2, 1, 14), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0,255))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: fddimibMACRequestedPaths.setDescription('List of permitted Paths which specifies the \n Path(s) into which the MAC may be inserted (refer \n to ansi SMT 9.7). \n \n The value is a sum which represents the individual \n paths that are desired. This value initially \n takes the value zero, then for each type of PATH \n that this node is, 2 raised to a power is added to \n the sum. The powers are according to the \n following table: \n \n Path Power \n local 0 \n secondary-alternate 1 \n primary-alternate 2 \n concatenated-alternate 3 \n secondary-preferred 4 \n primary-preferred 5 \n concatenated-preferred 6 \n thru 7 ')
fddimibMACDownstreamPORTType = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 2, 2, 1, 15), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5,))).clone(namedValues=NamedValues(("a", 1), ("b", 2), ("s", 3), ("m", 4), ("none", 5),))).setMaxAccess("readonly")
if mibBuilder.loadTexts: fddimibMACDownstreamPORTType.setDescription('Indicates the PC-Type of the first port that is \n downstream of this MAC (the exit port).')
fddimibMACSMTAddress = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 2, 2, 1, 16), FddiMACLongAddressType()).setMaxAccess("readonly")
if mibBuilder.loadTexts: fddimibMACSMTAddress.setDescription('The 48-bit individual address of the MAC used for \n SMT frames.')
fddimibMACTReq = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 2, 2, 1, 17), FddiTimeNano()).setMaxAccess("readonly")
if mibBuilder.loadTexts: fddimibMACTReq.setDescription('This variable is the T_Req_value passed to the \n MAC. Without having detected a duplicate, the \n time value of this variable shall assume the \n maximum supported time value which is less than or \n equal to the time value of fddiPATHMaxT-Req. When \n a MAC has an address detected as a duplicate, it \n may use a time value for this variable greater \n than the time value of fddiPATHTMaxLowerBound. A \n station shall cause claim when the new T_Req may \n cause the value of T_Neg to change in the claim \n process, (i.e., time value new T_Req < T_Neg, or \n old T_Req = T_Neg).')
fddimibMACTNeg = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 2, 2, 1, 18), FddiTimeNano()).setMaxAccess("readonly")
if mibBuilder.loadTexts: fddimibMACTNeg.setDescription('It is reported as a FddiTimeNano number.')
fddimibMACTMax = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 2, 2, 1, 19), FddiTimeNano()).setMaxAccess("readonly")
if mibBuilder.loadTexts: fddimibMACTMax.setDescription('This variable is the T_Max_value passed to the \n MAC. The time value of this variable shall assume \n the minimum suported time value which is greater \n than or equal to the time value of fddiPATHT- \n MaxLowerBound')
fddimibMACTvxValue = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 2, 2, 1, 20), FddiTimeNano()).setMaxAccess("readonly")
if mibBuilder.loadTexts: fddimibMACTvxValue.setDescription('This variable is the TVX_value passed to the MAC. \n The time value of this variable shall assume the \n minimum suported time value which is greater than \n or equal to the time value of \n fddiPATHTVXLowerBound.')
fddimibMACFrameCts = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 2, 2, 1, 21), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: fddimibMACFrameCts.setDescription('A count of the number of frames received by this \n MAC (refer to ANSI MAC 7.5.1).')
fddimibMACCopiedCts = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 2, 2, 1, 22), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: fddimibMACCopiedCts.setDescription("A count that should as closely as possible match \n the number of frames addressed to (A bit set) and \n successfully copied into the station's receive \n buffers (C bit set) by this MAC (refer to ANSI MAC \n 7.5). Note that this count does not include MAC \n frames.")
fddimibMACTransmitCts = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 2, 2, 1, 23), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: fddimibMACTransmitCts.setDescription('A count that should as closely as possible match \n the number of frames transmitted by this MAC \n (refer to ANSI MAC 7.5). Note that this count \n does not include MAC frames.')
fddimibMACErrorCts = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 2, 2, 1, 24), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: fddimibMACErrorCts.setDescription('A count of the number of frames that were \n detected in error by this MAC that had not been \n detected in error by another MAC (refer to ANSI \n MAC 7.5.2).')
fddimibMACLostCts = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 2, 2, 1, 25), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: fddimibMACLostCts.setDescription('A count of the number of instances that this MAC \n detected a format error during frame reception \n such that the frame was stripped (refer to ANSI \n MAC 7.5.3).')
fddimibMACFrameErrorThreshold = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 2, 2, 1, 26), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0,65535))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: fddimibMACFrameErrorThreshold.setDescription('A threshold for determining when a MAC Condition \n report (see ANSI 8.3.1.1) shall be generated. \n Stations not supporting variable thresholds shall \n have a value of 0 and a range of (0..0).')
fddimibMACFrameErrorRatio = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 2, 2, 1, 27), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0,65535))).setMaxAccess("readonly")
if mibBuilder.loadTexts: fddimibMACFrameErrorRatio.setDescription('This variable is the value of the ratio, \n \n ((delta fddiMACLostCts + delta fddiMACErrorCts) / \n (delta fddiMACFrameCts + delta fddiMACLostCts )) \n * 2**16 ')
fddimibMACRMTState = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 2, 2, 1, 28), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6, 7, 8,))).clone(namedValues=NamedValues(("rm0", 1), ("rm1", 2), ("rm2", 3), ("rm3", 4), ("rm4", 5), ("rm5", 6), ("rm6", 7), ("rm7", 8),))).setMaxAccess("readonly")
if mibBuilder.loadTexts: fddimibMACRMTState.setDescription('Indicates the current state of the RMT State \n Machine (refer to ANSI 10.3.2).')
fddimibMACDaFlag = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 2, 2, 1, 29), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2,))).clone(namedValues=NamedValues(("true", 1), ("false", 2),))).setMaxAccess("readonly")
if mibBuilder.loadTexts: fddimibMACDaFlag.setDescription('The RMT flag Duplicate Address Flag, DA_Flag \n (refer to ANSI 10.2.1.2).')
fddimibMACUnaDaFlag = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 2, 2, 1, 30), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2,))).clone(namedValues=NamedValues(("true", 1), ("false", 2),))).setMaxAccess("readonly")
if mibBuilder.loadTexts: fddimibMACUnaDaFlag.setDescription('A flag, UNDA_Flag (refer to ANSI 8.2.2.1), set \n when the upstream neighbor reports a duplicate \n address condition. Cleared when the condition \n clears.')
fddimibMACFrameErrorFlag = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 2, 2, 1, 31), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2,))).clone(namedValues=NamedValues(("true", 1), ("false", 2),))).setMaxAccess("readonly")
if mibBuilder.loadTexts: fddimibMACFrameErrorFlag.setDescription('Indicates the MAC Frame Error Condition is \n present when set. Cleared when the condition \n clears and on station initialization.')
fddimibMACMAUnitdataAvailable = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 2, 2, 1, 32), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2,))).clone(namedValues=NamedValues(("true", 1), ("false", 2),))).setMaxAccess("readonly")
if mibBuilder.loadTexts: fddimibMACMAUnitdataAvailable.setDescription('This variable shall take on the value of the \n MAC_Avail flag defined in RMT.')
fddimibMACHardwarePresent = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 2, 2, 1, 33), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2,))).clone(namedValues=NamedValues(("true", 1), ("false", 2),))).setMaxAccess("readonly")
if mibBuilder.loadTexts: fddimibMACHardwarePresent.setDescription('This variable indicates the presence of \n underlying hardware support for this MAC object. \n If the value of this object is false(2), the \n reporting of the objects in this entry may be \n handled in an implementation-specific manner.')
fddimibMACMAUnitdataEnable = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 2, 2, 1, 34), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2,))).clone(namedValues=NamedValues(("true", 1), ("false", 2),))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: fddimibMACMAUnitdataEnable.setDescription('This variable determines the value of the \n MA_UNITDATA_Enable flag in RMT. The default and \n initial value of this flag is true(1).')
fddimibMACCountersTable = MibTable((1, 3, 6, 1, 2, 1, 10, 15, 73, 3, 1), )
if mibBuilder.loadTexts: fddimibMACCountersTable.setDescription('A list of MAC Counters entries. The number of \n entries shall not exceed the value of \n fddimibMACNumber.')
fddimibMACCountersEntry = MibTableRow((1, 3, 6, 1, 2, 1, 10, 15, 73, 3, 1, 1), ).setIndexNames((0, "FDDI-SMT73-MIB", "fddimibMACSMTIndex"), (0, "FDDI-SMT73-MIB", "fddimibMACIndex"))
if mibBuilder.loadTexts: fddimibMACCountersEntry.setDescription('A MAC Counters entry containing information \n common to a given MAC.')
fddimibMACTokenCts = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 3, 1, 1, 1), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: fddimibMACTokenCts.setDescription('A count that should as closely as possible match \n the number of times the station has received a \n token (total of non-restricted and restricted) on \n this MAC (see ANSI MAC 7.4). This count is \n valuable for determination of network load.')
fddimibMACTvxExpiredCts = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 3, 1, 1, 2), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: fddimibMACTvxExpiredCts.setDescription('A count that should as closely as possible match \n the number of times that TVX has expired.')
fddimibMACNotCopiedCts = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 3, 1, 1, 3), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: fddimibMACNotCopiedCts.setDescription('A count that should as closely as possible match \n the number of frames that were addressed to this \n MAC but were not copied into its receive buffers \n (see ANSI MAC 7.5). For example, this might occur \n due to local buffer congestion. Because of \n implementation considerations, this count may not \n match the actual number of frames not copied. It \n is not a requirement that this count be exact. \n Note that this count does not include MAC frames.')
fddimibMACLateCts = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 3, 1, 1, 4), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: fddimibMACLateCts.setDescription('A count that should as closely as possible match \n the number of TRT expirations since this MAC was \n reset or a token was received (refer to ANSI MAC \n 7.4.5).')
fddimibMACRingOpCts = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 3, 1, 1, 5), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: fddimibMACRingOpCts.setDescription("The count of the number of times the ring has \n entered the 'Ring_Operational' state from the \n 'Ring Not Operational' state. This count is \n updated when a SM_MA_STATUS.Indication of a change \n in the Ring_Operational status occurs (refer to \n ANSI 6.1.4). Because of implementation \n considerations, this count may be less than the \n actual RingOp_Ct. It is not a requirement that \n this count be exact.")
fddimibMACNotCopiedRatio = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 3, 1, 1, 6), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0,65535))).setMaxAccess("readonly")
if mibBuilder.loadTexts: fddimibMACNotCopiedRatio.setDescription('This variable is the value of the ratio: \n \n (delta fddiMACNotCopiedCts / \n (delta fddiMACCopiedCts + \n delta fddiMACNotCopiedCts )) * 2**16 ')
fddimibMACNotCopiedFlag = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 3, 1, 1, 7), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2,))).clone(namedValues=NamedValues(("true", 1), ("false", 2),))).setMaxAccess("readonly")
if mibBuilder.loadTexts: fddimibMACNotCopiedFlag.setDescription('Indicates that the Not Copied condition is \n present when read as true(1). Set to false(2) \n when the condition clears and on station \n initialization.')
fddimibMACNotCopiedThreshold = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 3, 1, 1, 8), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0,65535))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: fddimibMACNotCopiedThreshold.setDescription('A threshold for determining when a MAC condition \n report shall be generated. Stations not \n supporting variable thresholds shall have a value \n of 0 and a range of (0..0).')
fddimibPATHNumber = MibScalar((1, 3, 6, 1, 2, 1, 10, 15, 73, 4, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0,65535))).setMaxAccess("readonly")
if mibBuilder.loadTexts: fddimibPATHNumber.setDescription("The total number of PATHs possible (across all \n SMTs) on this network management application \n entity. The value for this variable must remain \n constant at least from one re-initialization of \n the entity's network management system to the next \n re-initialization.")
fddimibPATHTable = MibTable((1, 3, 6, 1, 2, 1, 10, 15, 73, 4, 2), )
if mibBuilder.loadTexts: fddimibPATHTable.setDescription('A list of PATH entries. The number of entries \n shall not exceed the value of fddimibPATHNumber.')
fddimibPATHEntry = MibTableRow((1, 3, 6, 1, 2, 1, 10, 15, 73, 4, 2, 1), ).setIndexNames((0, "FDDI-SMT73-MIB", "fddimibPATHSMTIndex"), (0, "FDDI-SMT73-MIB", "fddimibPATHIndex"))
if mibBuilder.loadTexts: fddimibPATHEntry.setDescription('A PATH entry containing information common to a \n given PATH.')
fddimibPATHSMTIndex = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 4, 2, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1,65535))).setMaxAccess("readonly")
if mibBuilder.loadTexts: fddimibPATHSMTIndex.setDescription('The value of the SMT index associated with this \n PATH.')
fddimibPATHIndex = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 4, 2, 1, 2), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0,65535))).setMaxAccess("readonly")
if mibBuilder.loadTexts: fddimibPATHIndex.setDescription('Index variable for uniquely identifying the \n primary, secondary and local PATH object \n instances. Local PATH object instances are \n represented with integer values 3 to 255.')
fddimibPATHTVXLowerBound = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 4, 2, 1, 3), FddiTimeNano()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: fddimibPATHTVXLowerBound.setDescription('Specifies the minimum time value of \n fddiMACTvxValue that shall be used by any MAC that \n is configured in this path. The operational value \n of fddiMACTvxValue is managed by settting this \n variable. This variable has the time value range \n of: \n \n 0 < fddimibPATHTVXLowerBound < fddimibPATHMaxTReq \n Changes to this variable shall either satisfy the \n time value relationship: \n \n fddimibPATHTVXLowerBound <= \n fddimibMACTVXCapability \n \n of each of the MACs currently on the path, or be \n considered out of range. The initial value of \n fddimibPATHTVXLowerBound shall be 2500 nsec (2.5 \n ms).')
fddimibPATHTMaxLowerBound = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 4, 2, 1, 4), FddiTimeNano()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: fddimibPATHTMaxLowerBound.setDescription('Specifies the minimum time value of fddiMACTMax \n that shall be used by any MAC that is configured \n in this path. The operational value of \n fddiMACTMax is managed by setting this variable. \n This variable has the time value range of: \n \n fddimibPATHMaxTReq <= fddimibPATHTMaxLowerBound \n \n and an absolute time value range of: \n \n 10000nsec (10 msec) <= fddimibPATHTMaxLowerBound \n \n Changes to this variable shall either satisfy the \n time value relationship: \n \n fddimibPATHTMaxLowerBound < \n fddimibMACTMaxCapability \n \n of each of the MACs currently on the path, or be \n considered out of range. The initial value of \n fddimibPATHTMaxLowerBound shall be 165000 nsec \n (165 msec).')
fddimibPATHMaxTReq = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 4, 2, 1, 5), FddiTimeNano()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: fddimibPATHMaxTReq.setDescription('Specifies the maximum time value of fddiMACT-Req \n that shall be used by any MAC that is configured \n in this path. The operational value of fddiMACT- \n Req is managed by setting this variable. This \n variable has the time value range of: \n \n fddimibPATHTVXLowerBound < fddimibPATHMaxTReq <= \n fddimibPATHTMaxLowerBound. \n \n The default value of fddimibPATHMaxTReq is 165000 \n nsec (165 msec).')
fddimibPATHConfigTable = MibTable((1, 3, 6, 1, 2, 1, 10, 15, 73, 4, 3), )
if mibBuilder.loadTexts: fddimibPATHConfigTable.setDescription('A table of Path configuration entries. This \n table lists all the resources that may be in this \n Path.')
fddimibPATHConfigEntry = MibTableRow((1, 3, 6, 1, 2, 1, 10, 15, 73, 4, 3, 1), ).setIndexNames((0, "FDDI-SMT73-MIB", "fddimibPATHConfigSMTIndex"), (0, "FDDI-SMT73-MIB", "fddimibPATHConfigPATHIndex"), (0, "FDDI-SMT73-MIB", "fddimibPATHConfigTokenOrder"))
if mibBuilder.loadTexts: fddimibPATHConfigEntry.setDescription('A collection of objects containing information \n for a given PATH Configuration entry.')
fddimibPATHConfigSMTIndex = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 4, 3, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1,65535))).setMaxAccess("readonly")
if mibBuilder.loadTexts: fddimibPATHConfigSMTIndex.setDescription('The value of the SMT index associated with this \n configuration entry.')
fddimibPATHConfigPATHIndex = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 4, 3, 1, 2), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1,65535))).setMaxAccess("readonly")
if mibBuilder.loadTexts: fddimibPATHConfigPATHIndex.setDescription('The value of the PATH resource index associated \n with this configuration entry.')
fddimibPATHConfigTokenOrder = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 4, 3, 1, 3), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1,65535))).setMaxAccess("readonly")
if mibBuilder.loadTexts: fddimibPATHConfigTokenOrder.setDescription('An object associated with Token order for this \n entry. Thus if the token passes resources a, b, c \n and d, in that order, then the value of this \n object for these resources would be 1, 2, 3 and 4 \n respectively.')
fddimibPATHConfigResourceType = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 4, 3, 1, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(2, 4,))).clone(namedValues=NamedValues(("mac", 2), ("port", 4),))).setMaxAccess("readonly")
if mibBuilder.loadTexts: fddimibPATHConfigResourceType.setDescription('The type of resource associated with this \n configuration entry.')
fddimibPATHConfigResourceIndex = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 4, 3, 1, 5), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1,65535))).setMaxAccess("readonly")
if mibBuilder.loadTexts: fddimibPATHConfigResourceIndex.setDescription('The value of the SMT resource index used to refer \n to the instance of this MAC or Port resource.')
fddimibPATHConfigCurrentPath = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 4, 3, 1, 6), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6,))).clone(namedValues=NamedValues(("isolated", 1), ("local", 2), ("secondary", 3), ("primary", 4), ("concatenated", 5), ("thru", 6),))).setMaxAccess("readonly")
if mibBuilder.loadTexts: fddimibPATHConfigCurrentPath.setDescription('The current insertion status for this resource on \n this Path.')
fddimibPORTNumber = MibScalar((1, 3, 6, 1, 2, 1, 10, 15, 73, 5, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0,65535))).setMaxAccess("readonly")
if mibBuilder.loadTexts: fddimibPORTNumber.setDescription("The total number of PORT implementations (across \n all SMTs) on this network management application \n entity. The value for this variable must remain \n constant at least from one re-initialization of \n the entity's network management system to the next \n re-initialization.")
fddimibPORTTable = MibTable((1, 3, 6, 1, 2, 1, 10, 15, 73, 5, 2), )
if mibBuilder.loadTexts: fddimibPORTTable.setDescription('A list of PORT entries. The number of entries \n shall not exceed the value of fddimibPORTNumber.')
fddimibPORTEntry = MibTableRow((1, 3, 6, 1, 2, 1, 10, 15, 73, 5, 2, 1), ).setIndexNames((0, "FDDI-SMT73-MIB", "fddimibPORTSMTIndex"), (0, "FDDI-SMT73-MIB", "fddimibPORTIndex"))
if mibBuilder.loadTexts: fddimibPORTEntry.setDescription('A PORT entry containing information common to a \n given PORT.')
fddimibPORTSMTIndex = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 5, 2, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1,65535))).setMaxAccess("readonly")
if mibBuilder.loadTexts: fddimibPORTSMTIndex.setDescription('The value of the SMT index associated with this \n PORT.')
fddimibPORTIndex = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 5, 2, 1, 2), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1,65535))).setMaxAccess("readonly")
if mibBuilder.loadTexts: fddimibPORTIndex.setDescription("A unique value for each PORT within a given SMT, \n which is the same as the corresponding resource \n index in SMT. The value for each PORT must remain \n constant at least from one re-initialization of \n the entity's network management system to the next \n re-initialization.")
fddimibPORTMyType = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 5, 2, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5,))).clone(namedValues=NamedValues(("a", 1), ("b", 2), ("s", 3), ("m", 4), ("none", 5),))).setMaxAccess("readonly")
if mibBuilder.loadTexts: fddimibPORTMyType.setDescription("The value of the PORT's PC_Type (refer to ANSI \n 9.4.1, and 9.6.3.2).")
fddimibPORTNeighborType = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 5, 2, 1, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5,))).clone(namedValues=NamedValues(("a", 1), ("b", 2), ("s", 3), ("m", 4), ("none", 5),))).setMaxAccess("readonly")
if mibBuilder.loadTexts: fddimibPORTNeighborType.setDescription('The type of the remote PORT as determined in PCM. \n This variable has an initial value of none, and is \n only modified in PC_RCode(3)_Actions (refer to \n ANSI SMT 9.6.3.2).')
fddimibPORTConnectionPolicies = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 5, 2, 1, 5), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0,3))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: fddimibPORTConnectionPolicies.setDescription("A value representing the PORT's connection \n policies desired in the node. The value of pc- \n mac-lct is a term used in the PC_MAC_LCT Flag (see \n 9.4.3.2). The value of pc-mac-loop is a term used \n in the PC_MAC_Loop Flag. \n \n The value is a sum. This value initially takes \n the value zero, then for each PORT policy, 2 \n raised to a power is added to the sum. The powers \n are according to the following table: \n \n Policy Power \n pc-mac-lct 0 \n pc-mac-loop 1 ")
fddimibPORTMACIndicated = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 5, 2, 1, 6), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4,))).clone(namedValues=NamedValues(("tVal9FalseRVal9False", 1), ("tVal9FalseRVal9True", 2), ("tVal9TrueRVal9False", 3), ("tVal9TrueRVal9True", 4),))).setMaxAccess("readonly")
if mibBuilder.loadTexts: fddimibPORTMACIndicated.setDescription('The indications (T_Val(9), R_Val(9)) in PC- \n Signalling, of the intent to place a MAC in the \n output token path to a PORT (refer to ANSI SMT \n 9.6.3.2.).')
fddimibPORTCurrentPath = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 5, 2, 1, 7), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6,))).clone(namedValues=NamedValues(("ce0", 1), ("ce1", 2), ("ce2", 3), ("ce3", 4), ("ce4", 5), ("ce5", 6),))).setMaxAccess("readonly")
if mibBuilder.loadTexts: fddimibPORTCurrentPath.setDescription('Indicates the Path(s) into which this PORT is \n currently inserted.')
fddimibPORTRequestedPaths = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 5, 2, 1, 8), OctetString().subtype(subtypeSpec=ValueSizeConstraint(3,3)).setFixedLength(3)).setMaxAccess("readwrite")
if mibBuilder.loadTexts: fddimibPORTRequestedPaths.setDescription("This variable is a list of permitted Paths where \n each list element defines the Port's permitted \n Paths. The first octet corresponds to 'none', the \n second octet to 'tree', and the third octet to \n 'peer'.")
fddimibPORTMACPlacement = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 5, 2, 1, 9), FddiResourceId()).setMaxAccess("readonly")
if mibBuilder.loadTexts: fddimibPORTMACPlacement.setDescription('Indicates the MAC, if any, whose transmit path \n exits the station via this PORT. The value shall \n be zero if there is no MAC associated with the \n PORT. Otherwise, the MACIndex of the MAC will be \n the value of the variable.')
fddimibPORTAvailablePaths = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 5, 2, 1, 10), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0,7))).setMaxAccess("readonly")
if mibBuilder.loadTexts: fddimibPORTAvailablePaths.setDescription('Indicates the Paths which are available to this \n Port. In the absence of faults, the A and B Ports \n will always have both the Primary and Secondary \n Paths available. \n \n The value is a sum. This value initially takes \n the value zero, then for each type of PATH that \n this port has available, 2 raised to a power is \n added to the sum. The powers are according to the \n following table: \n \n Path Power \n Primary 0 \n Secondary 1 \n Local 2 ')
fddimibPORTPMDClass = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 5, 2, 1, 11), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6, 7, 8,))).clone(namedValues=NamedValues(("multimode", 1), ("single-mode1", 2), ("single-mode2", 3), ("sonet", 4), ("low-cost-fiber", 5), ("twisted-pair", 6), ("unknown", 7), ("unspecified", 8),))).setMaxAccess("readonly")
if mibBuilder.loadTexts: fddimibPORTPMDClass.setDescription('This variable indicates the type of PMD entity \n associated with this port.')
fddimibPORTConnectionCapabilities = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 5, 2, 1, 12), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0,3))).setMaxAccess("readonly")
if mibBuilder.loadTexts: fddimibPORTConnectionCapabilities.setDescription('A value that indicates the connection \n capabilities of the port. The pc-mac-lct bit \n indicates that the station has the capability of \n setting the PC_MAC_LCT Flag. The pc-mac-loop bit \n indicates that the station has the capability of \n setting the PC_MAC_Loop Flag (refer to ANSI \n 9.4.3.2). \n \n The value is a sum. This value initially takes \n the value zero, then for each capability that this \n port has, 2 raised to a power is added to the sum. \n The powers are according to the following table: \n \n capability Power \n pc-mac-lct 0 \n pc-mac-loop 1 ')
fddimibPORTBSFlag = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 5, 2, 1, 13), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2,))).clone(namedValues=NamedValues(("true", 1), ("false", 2),))).setMaxAccess("readonly")
if mibBuilder.loadTexts: fddimibPORTBSFlag.setDescription('This variable assumes the value of the BS_Flag \n (refer to ANSI SMT 9.4.3.3).')
fddimibPORTLCTFailCts = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 5, 2, 1, 14), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: fddimibPORTLCTFailCts.setDescription('The count of the consecutive times the link \n confidence test (LCT) has failed during connection \n management (refer to ANSI 9.4.1).')
fddimibPORTLerEstimate = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 5, 2, 1, 15), Integer32().subtype(subtypeSpec=ValueRangeConstraint(4,15))).setMaxAccess("readonly")
if mibBuilder.loadTexts: fddimibPORTLerEstimate.setDescription('A long term average link error rate. It ranges \n from 10**-4 to 10**-15 and is reported as the \n absolute value of the base 10 logarithm (refer to \n ANSI SMT 9.4.7.5.).')
fddimibPORTLemRejectCts = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 5, 2, 1, 16), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: fddimibPORTLemRejectCts.setDescription('A link error monitoring count of the times that a \n link has been rejected.')
fddimibPORTLemCts = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 5, 2, 1, 17), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: fddimibPORTLemCts.setDescription('The aggregate link error monitor error count, set \n to zero only on station initialization.')
fddimibPORTLerCutoff = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 5, 2, 1, 18), Integer32().subtype(subtypeSpec=ValueRangeConstraint(4,15))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: fddimibPORTLerCutoff.setDescription('The link error rate estimate at which a link \n connection will be broken. It ranges from 10**-4 \n to 10**-15 and is reported as the absolute value \n of the base 10 logarithm (default of 7).')
fddimibPORTLerAlarm = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 5, 2, 1, 19), Integer32().subtype(subtypeSpec=ValueRangeConstraint(4,15))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: fddimibPORTLerAlarm.setDescription('The link error rate estimate at which a link \n connection will generate an alarm. It ranges from \n 10**-4 to 10**-15 and is reported as the absolute \n value of the base 10 logarithm of the estimate \n (default of 8).')
fddimibPORTConnectState = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 5, 2, 1, 20), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4,))).clone(namedValues=NamedValues(("disabled", 1), ("connecting", 2), ("standby", 3), ("active", 4),))).setMaxAccess("readonly")
if mibBuilder.loadTexts: fddimibPORTConnectState.setDescription('An indication of the connect state of this PORT \n and is equal to the value of Connect_State (refer \n to ANSI 9.4.1)')
fddimibPORTPCMState = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 5, 2, 1, 21), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6, 7, 8, 9, 10,))).clone(namedValues=NamedValues(("pc0", 1), ("pc1", 2), ("pc2", 3), ("pc3", 4), ("pc4", 5), ("pc5", 6), ("pc6", 7), ("pc7", 8), ("pc8", 9), ("pc9", 10),))).setMaxAccess("readonly")
if mibBuilder.loadTexts: fddimibPORTPCMState.setDescription("The state of this Port's PCM state machine refer \n to ANSI SMT 9.6.2).")
fddimibPORTPCWithhold = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 5, 2, 1, 22), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4,))).clone(namedValues=NamedValues(("none", 1), ("m-m", 2), ("otherincompatible", 3), ("pathnotavailable", 4),))).setMaxAccess("readonly")
if mibBuilder.loadTexts: fddimibPORTPCWithhold.setDescription('The value of PC_Withhold (refer to ANSI SMT \n 9.4.1).')
fddimibPORTLerFlag = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 5, 2, 1, 23), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2,))).clone(namedValues=NamedValues(("true", 1), ("false", 2),))).setMaxAccess("readonly")
if mibBuilder.loadTexts: fddimibPORTLerFlag.setDescription('The condition becomes active when the value of \n fddiPORTLerEstimate is less than or equal to \n fddiPORTLerAlarm. This will be reported with the \n Status Report Frames (SRF) (refer to ANSI SMT \n 7.2.7 and 8.3).')
fddimibPORTHardwarePresent = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 5, 2, 1, 24), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2,))).clone(namedValues=NamedValues(("true", 1), ("false", 2),))).setMaxAccess("readonly")
if mibBuilder.loadTexts: fddimibPORTHardwarePresent.setDescription('This variable indicates the presence of \n underlying hardware support for this Port object. \n If the value of this object is false(2), the \n reporting of the objects in this entry may be \n handled in an implementation-specific manner.')
fddimibPORTAction = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 5, 2, 1, 25), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6,))).clone(namedValues=NamedValues(("other", 1), ("maintPORT", 2), ("enablePORT", 3), ("disablePORT", 4), ("startPORT", 5), ("stopPORT", 6),))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: fddimibPORTAction.setDescription("Causes a Control signal to be generated with a \n control_action of 'Signal' and the 'variable' \n parameter set with the appropriate value (i.e., \n PC_Maint, PC_Enable, PC_Disable, PC_Start, or \n PC_Stop) (refer to ANSI 9.4.2).")
mibBuilder.exportSymbols("FDDI-SMT73-MIB", fddimibPATHConfigSMTIndex=fddimibPATHConfigSMTIndex, fddimibMACAvailablePaths=fddimibMACAvailablePaths, fddimibSMTTransitionTimeStamp=fddimibSMTTransitionTimeStamp, fddimibPORTHardwarePresent=fddimibPORTHardwarePresent, fddimibMACRequestedPaths=fddimibMACRequestedPaths, fddimibPATHConfigTable=fddimibPATHConfigTable, fddimibMACMAUnitdataAvailable=fddimibMACMAUnitdataAvailable, fddimibMACFrameStatusFunctions=fddimibMACFrameStatusFunctions, fddimibSMTConfigCapabilities=fddimibSMTConfigCapabilities, fddimibMACNumber=fddimibMACNumber, fddimibMACSMTIndex=fddimibMACSMTIndex, fddimibSMTECMState=fddimibSMTECMState, FddiResourceId=FddiResourceId, fddimibPATHSMTIndex=fddimibPATHSMTIndex, fddimibMACTMaxCapability=fddimibMACTMaxCapability, fddimibMAC=fddimibMAC, fddimibPORTLemRejectCts=fddimibPORTLemRejectCts, fddimibMACSMTAddress=fddimibMACSMTAddress, fddimibMACRMTState=fddimibMACRMTState, fddimibPORTEntry=fddimibPORTEntry, fddimibSMTTNotify=fddimibSMTTNotify, fddimibPORTLerAlarm=fddimibPORTLerAlarm, FddiTimeNano=FddiTimeNano, fddimibMACFrameErrorRatio=fddimibMACFrameErrorRatio, fddimibPORTSMTIndex=fddimibPORTSMTIndex, fddimibSMTStationAction=fddimibSMTStationAction, fddimibMACCopiedCts=fddimibMACCopiedCts, fddimibSMTNumber=fddimibSMTNumber, fddimib=fddimib, FddiMACLongAddressType=FddiMACLongAddressType, fddimibSMTLoVersionId=fddimibSMTLoVersionId, fddimibMACTransmitCts=fddimibMACTransmitCts, fddimibMACHardwarePresent=fddimibMACHardwarePresent, fddimibSMTBypassPresent=fddimibSMTBypassPresent, fddimibPORTIndex=fddimibPORTIndex, fddimibSMTTable=fddimibSMTTable, fddimibMACDownstreamNbr=fddimibMACDownstreamNbr, fddimibSMTOpVersionId=fddimibSMTOpVersionId, fddimibPORTConnectionCapabilities=fddimibPORTConnectionCapabilities, fddimibPATHConfigResourceIndex=fddimibPATHConfigResourceIndex, fddimibPORTCurrentPath=fddimibPORTCurrentPath, fddimibMACIndex=fddimibMACIndex, fddimibMACOldDownstreamNbr=fddimibMACOldDownstreamNbr, fddimibSMTTraceMaxExpiration=fddimibSMTTraceMaxExpiration, fddimibPORTPCWithhold=fddimibPORTPCWithhold, fddimibPORTTable=fddimibPORTTable, fddimibMACNotCopiedFlag=fddimibMACNotCopiedFlag, FddiSMTStationIdType=FddiSMTStationIdType, fddimibMACTvxValue=fddimibMACTvxValue, fddimibSMTRemoteDisconnectFlag=fddimibSMTRemoteDisconnectFlag, fddimibMACTokenCts=fddimibMACTokenCts, fddimibMACCountersTable=fddimibMACCountersTable, fddimibPORTNumber=fddimibPORTNumber, fddimibMACNotCopiedCts=fddimibMACNotCopiedCts, fddimibPORTConnectState=fddimibPORTConnectState, fddimibPORTAction=fddimibPORTAction, fddimibSMTStationStatus=fddimibSMTStationStatus, fddimibPORTNeighborType=fddimibPORTNeighborType, fddimibPORTLerEstimate=fddimibPORTLerEstimate, fddimibPORTPMDClass=fddimibPORTPMDClass, fddimibMACTVXCapability=fddimibMACTVXCapability, FddiTimeMilli=FddiTimeMilli, fddimibPATHTVXLowerBound=fddimibPATHTVXLowerBound, fddimibSMTHiVersionId=fddimibSMTHiVersionId, fddimibMACTReq=fddimibMACTReq, fddimibPATHNumber=fddimibPATHNumber, fddimibSMTUserData=fddimibSMTUserData, fddimibMACFrameCts=fddimibMACFrameCts, fddimibPATHConfigTokenOrder=fddimibPATHConfigTokenOrder, transmission=transmission, fddimibMACLostCts=fddimibMACLostCts, fddimibMACFrameErrorThreshold=fddimibMACFrameErrorThreshold, fddimibSMTConnectionPolicy=fddimibSMTConnectionPolicy, fddimibMACErrorCts=fddimibMACErrorCts, fddimibPORT=fddimibPORT, fddimibPORTLCTFailCts=fddimibPORTLCTFailCts, fddi=fddi, fddimibPORTMACPlacement=fddimibPORTMACPlacement, fddimibSMTEntry=fddimibSMTEntry, fddimibPORTLerFlag=fddimibPORTLerFlag, fddimibPORTLemCts=fddimibPORTLemCts, fddimibMACIfIndex=fddimibMACIfIndex, fddimibSMTCFState=fddimibSMTCFState, fddimibPATHConfigEntry=fddimibPATHConfigEntry, fddimibPORTAvailablePaths=fddimibPORTAvailablePaths, fddimibPATHTMaxLowerBound=fddimibPATHTMaxLowerBound, fddimibPORTMyType=fddimibPORTMyType, fddimibMACTvxExpiredCts=fddimibMACTvxExpiredCts, fddimibPATHConfigCurrentPath=fddimibPATHConfigCurrentPath, fddimibSMTIndex=fddimibSMTIndex, fddimibPATHConfigResourceType=fddimibPATHConfigResourceType, fddimibSMTPeerWrapFlag=fddimibSMTPeerWrapFlag, fddimibSMTStationId=fddimibSMTStationId, fddimibPATH=fddimibPATH, fddimibMACDownstreamPORTType=fddimibMACDownstreamPORTType, fddimibMACOldUpstreamNbr=fddimibMACOldUpstreamNbr, fddimibPORTRequestedPaths=fddimibPORTRequestedPaths, fddimibSMT=fddimibSMT, fddimibMACFrameErrorFlag=fddimibMACFrameErrorFlag, fddimibPATHConfigPATHIndex=fddimibPATHConfigPATHIndex, fddimibPATHMaxTReq=fddimibPATHMaxTReq, fddimibMACUnaDaFlag=fddimibMACUnaDaFlag, fddimibPORTBSFlag=fddimibPORTBSFlag, fddimibPORTConnectionPolicies=fddimibPORTConnectionPolicies, fddimibMACCurrentPath=fddimibMACCurrentPath, fddimibMACRingOpCts=fddimibMACRingOpCts, fddimibSMTMACCts=fddimibSMTMACCts, fddimibSMTTimeStamp=fddimibSMTTimeStamp, fddimibMACNotCopiedRatio=fddimibMACNotCopiedRatio, fddimibMACDupAddressTest=fddimibMACDupAddressTest, fddimibPORTLerCutoff=fddimibPORTLerCutoff, fddimibSMTConfigPolicy=fddimibSMTConfigPolicy, fddimibMACTMax=fddimibMACTMax, fddimibPATHIndex=fddimibPATHIndex, fddimibMACLateCts=fddimibMACLateCts, fddimibSMTNonMasterCts=fddimibSMTNonMasterCts, fddimibMACCountersEntry=fddimibMACCountersEntry, fddimibMACUpstreamNbr=fddimibMACUpstreamNbr, fddimibPATHEntry=fddimibPATHEntry, fddimibPATHTable=fddimibPATHTable, fddimibMACMAUnitdataEnable=fddimibMACMAUnitdataEnable, fddimibPORTPCMState=fddimibPORTPCMState, fddimibMACTNeg=fddimibMACTNeg, fddimibSMTMIBVersionId=fddimibSMTMIBVersionId, fddimibSMTMasterCts=fddimibSMTMasterCts, fddimibSMTStatRptPolicy=fddimibSMTStatRptPolicy, fddimibPORTMACIndicated=fddimibPORTMACIndicated, fddimibMACNotCopiedThreshold=fddimibMACNotCopiedThreshold, fddimibMACCounters=fddimibMACCounters, fddimibSMTAvailablePaths=fddimibSMTAvailablePaths, fddimibMACEntry=fddimibMACEntry, fddimibMACDaFlag=fddimibMACDaFlag, fddimibMACTable=fddimibMACTable)
|
(octet_string, integer, object_identifier) = mibBuilder.importSymbols('ASN1', 'OctetString', 'Integer', 'ObjectIdentifier')
(named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues')
(value_size_constraint, constraints_intersection, value_range_constraint, single_value_constraint, constraints_union) = mibBuilder.importSymbols('ASN1-REFINEMENT', 'ValueSizeConstraint', 'ConstraintsIntersection', 'ValueRangeConstraint', 'SingleValueConstraint', 'ConstraintsUnion')
(notification_group, module_compliance) = mibBuilder.importSymbols('SNMPv2-CONF', 'NotificationGroup', 'ModuleCompliance')
(mib_scalar, mib_table, mib_table_row, mib_table_column, integer32, gauge32, bits, unsigned32, counter64, time_ticks, notification_type, module_identity, object_identity, mib_2, mib_identifier, iso, counter32, ip_address) = mibBuilder.importSymbols('SNMPv2-SMI', 'MibScalar', 'MibTable', 'MibTableRow', 'MibTableColumn', 'Integer32', 'Gauge32', 'Bits', 'Unsigned32', 'Counter64', 'TimeTicks', 'NotificationType', 'ModuleIdentity', 'ObjectIdentity', 'mib-2', 'MibIdentifier', 'iso', 'Counter32', 'IpAddress')
(display_string, textual_convention) = mibBuilder.importSymbols('SNMPv2-TC', 'DisplayString', 'TextualConvention')
transmission = mib_identifier((1, 3, 6, 1, 2, 1, 10))
fddi = mib_identifier((1, 3, 6, 1, 2, 1, 10, 15))
fddimib = mib_identifier((1, 3, 6, 1, 2, 1, 10, 15, 73))
class Fdditimenano(Integer32):
subtype_spec = Integer32.subtypeSpec + value_range_constraint(0, 2147483647)
class Fdditimemilli(Integer32):
subtype_spec = Integer32.subtypeSpec + value_range_constraint(0, 2147483647)
class Fddiresourceid(Integer32):
subtype_spec = Integer32.subtypeSpec + value_range_constraint(0, 65535)
class Fddismtstationidtype(OctetString):
subtype_spec = OctetString.subtypeSpec + value_size_constraint(8, 8)
fixed_length = 8
class Fddimaclongaddresstype(OctetString):
subtype_spec = OctetString.subtypeSpec + value_size_constraint(6, 6)
fixed_length = 6
fddimib_smt = mib_identifier((1, 3, 6, 1, 2, 1, 10, 15, 73, 1))
fddimib_mac = mib_identifier((1, 3, 6, 1, 2, 1, 10, 15, 73, 2))
fddimib_mac_counters = mib_identifier((1, 3, 6, 1, 2, 1, 10, 15, 73, 3))
fddimib_path = mib_identifier((1, 3, 6, 1, 2, 1, 10, 15, 73, 4))
fddimib_port = mib_identifier((1, 3, 6, 1, 2, 1, 10, 15, 73, 5))
fddimib_smt_number = mib_scalar((1, 3, 6, 1, 2, 1, 10, 15, 73, 1, 1), integer32().subtype(subtypeSpec=value_range_constraint(0, 65535))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
fddimibSMTNumber.setDescription("The number of SMT implementations (regardless of \n their current state) on this network management \n application entity. The value for this variable \n must remain constant at least from one re- \n initialization of the entity's network management \n system to the next re-initialization.")
fddimib_smt_table = mib_table((1, 3, 6, 1, 2, 1, 10, 15, 73, 1, 2))
if mibBuilder.loadTexts:
fddimibSMTTable.setDescription('A list of SMT entries. The number of entries \n shall not exceed the value of fddimibSMTNumber.')
fddimib_smt_entry = mib_table_row((1, 3, 6, 1, 2, 1, 10, 15, 73, 1, 2, 1)).setIndexNames((0, 'FDDI-SMT73-MIB', 'fddimibSMTIndex'))
if mibBuilder.loadTexts:
fddimibSMTEntry.setDescription('An SMT entry containing information common to a \n given SMT.')
fddimib_smt_index = mib_table_column((1, 3, 6, 1, 2, 1, 10, 15, 73, 1, 2, 1, 1), integer32().subtype(subtypeSpec=value_range_constraint(1, 65535))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
fddimibSMTIndex.setDescription("A unique value for each SMT. The value for each \n SMT must remain constant at least from one re- \n initialization of the entity's network management \n system to the next re-initialization.")
fddimib_smt_station_id = mib_table_column((1, 3, 6, 1, 2, 1, 10, 15, 73, 1, 2, 1, 2), fddi_smt_station_id_type()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
fddimibSMTStationId.setDescription('Used to uniquely identify an FDDI station.')
fddimib_smt_op_version_id = mib_table_column((1, 3, 6, 1, 2, 1, 10, 15, 73, 1, 2, 1, 3), integer32().subtype(subtypeSpec=value_range_constraint(1, 65535))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
fddimibSMTOpVersionId.setDescription('The version that this station is using for its \n operation (refer to ANSI 7.1.2.2). The value of \n this variable is 2 for this SMT revision.')
fddimib_smt_hi_version_id = mib_table_column((1, 3, 6, 1, 2, 1, 10, 15, 73, 1, 2, 1, 4), integer32().subtype(subtypeSpec=value_range_constraint(1, 65535))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
fddimibSMTHiVersionId.setDescription('The highest version of SMT that this station \n supports (refer to ANSI 7.1.2.2).')
fddimib_smt_lo_version_id = mib_table_column((1, 3, 6, 1, 2, 1, 10, 15, 73, 1, 2, 1, 5), integer32().subtype(subtypeSpec=value_range_constraint(1, 65535))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
fddimibSMTLoVersionId.setDescription('The lowest version of SMT that this station \n supports (refer to ANSI 7.1.2.2).')
fddimib_smt_user_data = mib_table_column((1, 3, 6, 1, 2, 1, 10, 15, 73, 1, 2, 1, 6), octet_string().subtype(subtypeSpec=value_size_constraint(32, 32)).setFixedLength(32)).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
fddimibSMTUserData.setDescription('This variable contains 32 octets of user defined \n information. The information shall be an ASCII \n string.')
fddimib_smtmib_version_id = mib_table_column((1, 3, 6, 1, 2, 1, 10, 15, 73, 1, 2, 1, 7), integer32().subtype(subtypeSpec=value_range_constraint(0, 65535))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
fddimibSMTMIBVersionId.setDescription('The version of the FDDI MIB of this station. The \n value of this variable is 1 for this SMT \n revision.')
fddimib_smtmac_cts = mib_table_column((1, 3, 6, 1, 2, 1, 10, 15, 73, 1, 2, 1, 8), integer32().subtype(subtypeSpec=value_range_constraint(0, 255))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
fddimibSMTMACCts.setDescription('The number of MACs in this station or \n concentrator.')
fddimib_smt_non_master_cts = mib_table_column((1, 3, 6, 1, 2, 1, 10, 15, 73, 1, 2, 1, 9), integer32().subtype(subtypeSpec=value_range_constraint(0, 2))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
fddimibSMTNonMasterCts.setDescription('The value of this variable is the number of A, B, \n and S ports in this station or concentrator.')
fddimib_smt_master_cts = mib_table_column((1, 3, 6, 1, 2, 1, 10, 15, 73, 1, 2, 1, 10), integer32().subtype(subtypeSpec=value_range_constraint(0, 255))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
fddimibSMTMasterCts.setDescription('The number of M Ports in a node. If the node is \n not a concentrator, the value of the variable is \n zero.')
fddimib_smt_available_paths = mib_table_column((1, 3, 6, 1, 2, 1, 10, 15, 73, 1, 2, 1, 11), integer32().subtype(subtypeSpec=value_range_constraint(0, 7))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
fddimibSMTAvailablePaths.setDescription('A value that indicates the PATH types available \n in the station. \n \n The value is a sum. This value initially takes \n the value zero, then for each type of PATH that \n this node has available, 2 raised to a power is \n added to the sum. The powers are according to the \n following table: \n \n Path Power \n Primary 0 \n Secondary 1 \n Local 2 \n \n For example, a station having Primary and Local \n PATHs available would have a value of 5 (2**0 + \n 2**2).')
fddimib_smt_config_capabilities = mib_table_column((1, 3, 6, 1, 2, 1, 10, 15, 73, 1, 2, 1, 12), integer32().subtype(subtypeSpec=value_range_constraint(0, 3))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
fddimibSMTConfigCapabilities.setDescription("A value that indicates the configuration \n capabilities of a node. The 'Hold Available' bit \n indicates the support of the optional Hold \n Function, which is controlled by \n fddiSMTConfigPolicy. The 'CF-Wrap-AB' bit \n indicates that the station has the capability of \n performing a wrap_ab (refer to ANSI SMT 9.7.2.2). \n \n The value is a sum. This value initially takes \n the value zero, then for each of the configuration \n policies currently enforced on the node, 2 raised \n to a power is added to the sum. The powers are \n according to the following table: \n \n Policy Power \n holdAvailable 0 \n CF-Wrap-AB 1 ")
fddimib_smt_config_policy = mib_table_column((1, 3, 6, 1, 2, 1, 10, 15, 73, 1, 2, 1, 13), integer32().subtype(subtypeSpec=value_range_constraint(0, 1))).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
fddimibSMTConfigPolicy.setDescription("A value that indicates the configuration policies \n currently desired in a node. 'Hold' is one of the \n terms used for the Hold Flag, an optional ECM flag \n used to enable the optional Hold policy. \n \n The value is a sum. This value initially takes \n the value zero, then for each of the configuration \n policies currently enforced on the node, 2 raised \n to a power is added to the sum. The powers are \n according to the following table: \n \n Policy Power \n configurationhold 0 ")
fddimib_smt_connection_policy = mib_table_column((1, 3, 6, 1, 2, 1, 10, 15, 73, 1, 2, 1, 14), integer32().subtype(subtypeSpec=value_range_constraint(32768, 65535))).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
fddimibSMTConnectionPolicy.setDescription("A value representing the connection policies in \n effect in a node. A station sets the corresponding \n bit for each of the connection types that it \n rejects. The letter designations, X and Y, in the \n 'rejectX-Y' names have the following significance: \n X represents the PC-Type of the local PORT and Y \n represents the PC_Type of the adjacent PORT \n (PC_Neighbor). The evaluation of Connection- \n Policy (PC-Type, PC-Neighbor) is done to determine \n the setting of T- Val(3) in the PC-Signalling \n sequence (refer to ANSI 9.6.3). Note that Bit 15, \n (rejectM-M), is always set and cannot be cleared. \n \n The value is a sum. This value initially takes \n the value zero, then for each of the connection \n policies currently enforced on the node, 2 raised \n to a power is added to the sum. The powers are \n according to the following table: \n \n Policy Power \n rejectA-A 0 \n rejectA-B 1 \n rejectA-S 2 \n rejectA-M 3 \n rejectB-A 4 \n rejectB-B 5 \n rejectB-S 6 \n rejectB-M 7 \n rejectS-A 8 \n rejectS-B 9 \n rejectS-S 10 \n rejectS-M 11 \n rejectM-A 12 \n rejectM-B 13 \n rejectM-S 14 \n rejectM-M 15 ")
fddimib_smtt_notify = mib_table_column((1, 3, 6, 1, 2, 1, 10, 15, 73, 1, 2, 1, 15), integer32().subtype(subtypeSpec=value_range_constraint(2, 30))).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
fddimibSMTTNotify.setDescription('The timer, expressed in seconds, used in the \n Neighbor Notification protocol. It has a range of \n 2 seconds to 30 seconds, and its default value is \n 30 seconds (refer to ANSI SMT 8.2).')
fddimib_smt_stat_rpt_policy = mib_table_column((1, 3, 6, 1, 2, 1, 10, 15, 73, 1, 2, 1, 16), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('true', 1), ('false', 2)))).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
fddimibSMTStatRptPolicy.setDescription('If true, indicates that the node will generate \n Status Reporting Frames for its implemented events \n and conditions. It has an initial value of true. \n This variable determines the value of the \n SR_Enable Flag (refer to ANSI SMT 8.3.2.1).')
fddimib_smt_trace_max_expiration = mib_table_column((1, 3, 6, 1, 2, 1, 10, 15, 73, 1, 2, 1, 17), fddi_time_milli()).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
fddimibSMTTraceMaxExpiration.setDescription('Reference Trace_Max (refer to ANSI SMT \n 9.4.4.2.2).')
fddimib_smt_bypass_present = mib_table_column((1, 3, 6, 1, 2, 1, 10, 15, 73, 1, 2, 1, 18), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('true', 1), ('false', 2)))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
fddimibSMTBypassPresent.setDescription('A flag indicating if the station has a bypass on \n its AB port pair.')
fddimib_smtecm_state = mib_table_column((1, 3, 6, 1, 2, 1, 10, 15, 73, 1, 2, 1, 19), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3, 4, 5, 6, 7, 8))).clone(namedValues=named_values(('ec0', 1), ('ec1', 2), ('ec2', 3), ('ec3', 4), ('ec4', 5), ('ec5', 6), ('ec6', 7), ('ec7', 8)))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
fddimibSMTECMState.setDescription('Indicates the current state of the ECM state \n machine (refer to ANSI SMT 9.5.2).')
fddimib_smtcf_state = mib_table_column((1, 3, 6, 1, 2, 1, 10, 15, 73, 1, 2, 1, 20), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13))).clone(namedValues=named_values(('cf0', 1), ('cf1', 2), ('cf2', 3), ('cf3', 4), ('cf4', 5), ('cf5', 6), ('cf6', 7), ('cf7', 8), ('cf8', 9), ('cf9', 10), ('cf10', 11), ('cf11', 12), ('cf12', 13)))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
fddimibSMTCFState.setDescription('The attachment configuration for the station or \n concentrator (refer to ANSI SMT 9.7.2.2).')
fddimib_smt_remote_disconnect_flag = mib_table_column((1, 3, 6, 1, 2, 1, 10, 15, 73, 1, 2, 1, 21), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('true', 1), ('false', 2)))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
fddimibSMTRemoteDisconnectFlag.setDescription('A flag indicating that the station was remotely \n disconnected from the network as a result of \n receiving an fddiSMTAction, disconnect (refer to \n ANSI SMT 6.4.5.3) in a Parameter Management Frame. \n A station requires a Connect Action to rejoin and \n clear the flag (refer to ANSI SMT 6.4.5.2).')
fddimib_smt_station_status = mib_table_column((1, 3, 6, 1, 2, 1, 10, 15, 73, 1, 2, 1, 22), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3))).clone(namedValues=named_values(('concatenated', 1), ('separated', 2), ('thru', 3)))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
fddimibSMTStationStatus.setDescription('The current status of the primary and secondary \n paths within this station.')
fddimib_smt_peer_wrap_flag = mib_table_column((1, 3, 6, 1, 2, 1, 10, 15, 73, 1, 2, 1, 23), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('true', 1), ('false', 2)))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
fddimibSMTPeerWrapFlag.setDescription('This variable assumes the value of the \n PeerWrapFlag in CFM (refer to ANSI SMT \n 9.7.2.4.4).')
fddimib_smt_time_stamp = mib_table_column((1, 3, 6, 1, 2, 1, 10, 15, 73, 1, 2, 1, 24), fddi_time_milli()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
fddimibSMTTimeStamp.setDescription('This variable assumes the value of TimeStamp \n (refer to ANSI SMT 8.3.2.1).')
fddimib_smt_transition_time_stamp = mib_table_column((1, 3, 6, 1, 2, 1, 10, 15, 73, 1, 2, 1, 25), fddi_time_milli()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
fddimibSMTTransitionTimeStamp.setDescription('This variable assumes the value of \n TransitionTimeStamp (refer to ANSI SMT 8.3.2.1).')
fddimib_smt_station_action = mib_table_column((1, 3, 6, 1, 2, 1, 10, 15, 73, 1, 2, 1, 26), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3, 4, 5, 6, 7, 8))).clone(namedValues=named_values(('other', 1), ('connect', 2), ('disconnect', 3), ('path-Test', 4), ('self-Test', 5), ('disable-a', 6), ('disable-b', 7), ('disable-m', 8)))).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
fddimibSMTStationAction.setDescription("This object, when read, always returns a value of \n other(1). The behavior of setting this variable \n to each of the acceptable values is as follows: \n \n other(1): Results in an appropriate error. \n connect(2): Generates a Connect signal to ECM \n to begin a connection sequence. See ANSI \n Ref 9.4.2. \n disconnect(3): Generates a Disconnect signal \n to ECM. see ANSI Ref 9.4.2. \n path-Test(4): Initiates a station Path_Test. \n The Path_Test variable (see ANSI Ref \n 9.4.1) is set to 'Testing'. The results \n of this action are not specified in this \n standard. \n self-Test(5): Initiates a station Self_Test. \n The results of this action are not \n specified in this standard. \n disable-a(6): Causes a PC_Disable on the A \n port if the A port mode is peer. \n disable-b(7): Causes a PC_Disable on the B \n port if the B port mode is peer. \n disable-m(8): Causes a PC_Disable on all M \n ports. \n \n Attempts to set this object to all other values \n results in an appropriate error. The result of \n setting this variable to path-Test(4) or self- \n Test(5) is implementation-specific.")
fddimib_mac_number = mib_scalar((1, 3, 6, 1, 2, 1, 10, 15, 73, 2, 1), integer32().subtype(subtypeSpec=value_range_constraint(0, 65535))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
fddimibMACNumber.setDescription("The total number of MAC implementations (across \n all SMTs) on this network management application \n entity. The value for this variable must remain \n constant at least from one re-initialization of \n the entity's network management system to the next \n re-initialization.")
fddimib_mac_table = mib_table((1, 3, 6, 1, 2, 1, 10, 15, 73, 2, 2))
if mibBuilder.loadTexts:
fddimibMACTable.setDescription('A list of MAC entries. The number of entries \n shall not exceed the value of fddimibMACNumber.')
fddimib_mac_entry = mib_table_row((1, 3, 6, 1, 2, 1, 10, 15, 73, 2, 2, 1)).setIndexNames((0, 'FDDI-SMT73-MIB', 'fddimibMACSMTIndex'), (0, 'FDDI-SMT73-MIB', 'fddimibMACIndex'))
if mibBuilder.loadTexts:
fddimibMACEntry.setDescription('A MAC entry containing information common to a \n given MAC.')
fddimib_macsmt_index = mib_table_column((1, 3, 6, 1, 2, 1, 10, 15, 73, 2, 2, 1, 1), integer32().subtype(subtypeSpec=value_range_constraint(1, 65535))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
fddimibMACSMTIndex.setDescription('The value of the SMT index associated with this \n MAC.')
fddimib_mac_index = mib_table_column((1, 3, 6, 1, 2, 1, 10, 15, 73, 2, 2, 1, 2), integer32().subtype(subtypeSpec=value_range_constraint(1, 65535))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
fddimibMACIndex.setDescription('Index variable for uniquely identifying the MAC \n object instances, which is the same as the \n corresponding resource index in SMT.')
fddimib_mac_if_index = mib_table_column((1, 3, 6, 1, 2, 1, 10, 15, 73, 2, 2, 1, 3), integer32().subtype(subtypeSpec=value_range_constraint(1, 65535))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
fddimibMACIfIndex.setDescription('The value of the MIB-II ifIndex corresponding to \n this MAC. If none is applicable, 0 is returned.')
fddimib_mac_frame_status_functions = mib_table_column((1, 3, 6, 1, 2, 1, 10, 15, 73, 2, 2, 1, 4), integer32().subtype(subtypeSpec=value_range_constraint(0, 7))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
fddimibMACFrameStatusFunctions.setDescription("Indicates the MAC's optional Frame Status \n processing functions. \n \n The value is a sum. This value initially takes \n the value zero, then for each function present, 2 \n raised to a power is added to the sum. The powers \n are according to the following table: \n \n function Power \n fs-repeating 0 \n fs-setting 1 \n fs-clearing 2 ")
fddimib_mact_max_capability = mib_table_column((1, 3, 6, 1, 2, 1, 10, 15, 73, 2, 2, 1, 5), fddi_time_nano()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
fddimibMACTMaxCapability.setDescription('Indicates the maximum time value of fddiMACTMax \n that this MAC can support.')
fddimib_mactvx_capability = mib_table_column((1, 3, 6, 1, 2, 1, 10, 15, 73, 2, 2, 1, 6), fddi_time_nano()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
fddimibMACTVXCapability.setDescription('Indicates the maximum time value of \n fddiMACTvxValue that this MAC can support.')
fddimib_mac_available_paths = mib_table_column((1, 3, 6, 1, 2, 1, 10, 15, 73, 2, 2, 1, 7), integer32().subtype(subtypeSpec=value_range_constraint(0, 7))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
fddimibMACAvailablePaths.setDescription('Indicates the paths available for this MAC (refer \n to ANSI SMT 9.7.7). \n \n The value is a sum. This value initially takes \n the value zero, then for each type of PATH that \n this MAC has available, 2 raised to a power is \n added to the sum. The powers are according to the \n following table: \n \n Path Power \n Primary 0 \n Secondary 1 \n Local 2 ')
fddimib_mac_current_path = mib_table_column((1, 3, 6, 1, 2, 1, 10, 15, 73, 2, 2, 1, 8), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3, 4, 5, 6))).clone(namedValues=named_values(('isolated', 1), ('local', 2), ('secondary', 3), ('primary', 4), ('concatenated', 5), ('thru', 6)))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
fddimibMACCurrentPath.setDescription('Indicates the Path into which this MAC is \n currently inserted (refer to ANSI 9.7.7).')
fddimib_mac_upstream_nbr = mib_table_column((1, 3, 6, 1, 2, 1, 10, 15, 73, 2, 2, 1, 9), fddi_mac_long_address_type()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
fddimibMACUpstreamNbr.setDescription("The MAC's upstream neighbor's long individual MAC \n address. It has an initial value of the SMT- \n Unknown-MAC Address and is only modified as \n specified by the Neighbor Information Frame \n protocol (refer to ANSI SMT 7.2.1 and 8.2).")
fddimib_mac_downstream_nbr = mib_table_column((1, 3, 6, 1, 2, 1, 10, 15, 73, 2, 2, 1, 10), fddi_mac_long_address_type()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
fddimibMACDownstreamNbr.setDescription("The MAC's downstream neighbor's long individual \n MAC address. It has an initial value of the SMT- \n Unknown-MAC Address and is only modified as \n specified by the Neighbor Information Frame \n protocol (refer to ANSI SMT 7.2.1 and 8.2).")
fddimib_mac_old_upstream_nbr = mib_table_column((1, 3, 6, 1, 2, 1, 10, 15, 73, 2, 2, 1, 11), fddi_mac_long_address_type()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
fddimibMACOldUpstreamNbr.setDescription("The previous value of the MAC's upstream \n neighbor's long individual MAC address. It has an \n initial value of the SMT-Unknown- MAC Address and \n is only modified as specified by the Neighbor \n Information Frame protocol (refer to ANSI SMT \n 7.2.1 and 8.2).")
fddimib_mac_old_downstream_nbr = mib_table_column((1, 3, 6, 1, 2, 1, 10, 15, 73, 2, 2, 1, 12), fddi_mac_long_address_type()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
fddimibMACOldDownstreamNbr.setDescription("The previous value of the MAC's downstream \n neighbor's long individual MAC address. It has an \n initial value of the SMT- Unknown-MAC Address and \n is only modified as specified by the Neighbor \n Information Frame protocol (refer to ANSI SMT \n 7.2.1 and 8.2).")
fddimib_mac_dup_address_test = mib_table_column((1, 3, 6, 1, 2, 1, 10, 15, 73, 2, 2, 1, 13), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3))).clone(namedValues=named_values(('none', 1), ('pass', 2), ('fail', 3)))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
fddimibMACDupAddressTest.setDescription('The Duplicate Address Test flag, Dup_Addr_Test \n (refer to ANSI 8.2).')
fddimib_mac_requested_paths = mib_table_column((1, 3, 6, 1, 2, 1, 10, 15, 73, 2, 2, 1, 14), integer32().subtype(subtypeSpec=value_range_constraint(0, 255))).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
fddimibMACRequestedPaths.setDescription('List of permitted Paths which specifies the \n Path(s) into which the MAC may be inserted (refer \n to ansi SMT 9.7). \n \n The value is a sum which represents the individual \n paths that are desired. This value initially \n takes the value zero, then for each type of PATH \n that this node is, 2 raised to a power is added to \n the sum. The powers are according to the \n following table: \n \n Path Power \n local 0 \n secondary-alternate 1 \n primary-alternate 2 \n concatenated-alternate 3 \n secondary-preferred 4 \n primary-preferred 5 \n concatenated-preferred 6 \n thru 7 ')
fddimib_mac_downstream_port_type = mib_table_column((1, 3, 6, 1, 2, 1, 10, 15, 73, 2, 2, 1, 15), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3, 4, 5))).clone(namedValues=named_values(('a', 1), ('b', 2), ('s', 3), ('m', 4), ('none', 5)))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
fddimibMACDownstreamPORTType.setDescription('Indicates the PC-Type of the first port that is \n downstream of this MAC (the exit port).')
fddimib_macsmt_address = mib_table_column((1, 3, 6, 1, 2, 1, 10, 15, 73, 2, 2, 1, 16), fddi_mac_long_address_type()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
fddimibMACSMTAddress.setDescription('The 48-bit individual address of the MAC used for \n SMT frames.')
fddimib_mact_req = mib_table_column((1, 3, 6, 1, 2, 1, 10, 15, 73, 2, 2, 1, 17), fddi_time_nano()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
fddimibMACTReq.setDescription('This variable is the T_Req_value passed to the \n MAC. Without having detected a duplicate, the \n time value of this variable shall assume the \n maximum supported time value which is less than or \n equal to the time value of fddiPATHMaxT-Req. When \n a MAC has an address detected as a duplicate, it \n may use a time value for this variable greater \n than the time value of fddiPATHTMaxLowerBound. A \n station shall cause claim when the new T_Req may \n cause the value of T_Neg to change in the claim \n process, (i.e., time value new T_Req < T_Neg, or \n old T_Req = T_Neg).')
fddimib_mact_neg = mib_table_column((1, 3, 6, 1, 2, 1, 10, 15, 73, 2, 2, 1, 18), fddi_time_nano()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
fddimibMACTNeg.setDescription('It is reported as a FddiTimeNano number.')
fddimib_mact_max = mib_table_column((1, 3, 6, 1, 2, 1, 10, 15, 73, 2, 2, 1, 19), fddi_time_nano()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
fddimibMACTMax.setDescription('This variable is the T_Max_value passed to the \n MAC. The time value of this variable shall assume \n the minimum suported time value which is greater \n than or equal to the time value of fddiPATHT- \n MaxLowerBound')
fddimib_mac_tvx_value = mib_table_column((1, 3, 6, 1, 2, 1, 10, 15, 73, 2, 2, 1, 20), fddi_time_nano()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
fddimibMACTvxValue.setDescription('This variable is the TVX_value passed to the MAC. \n The time value of this variable shall assume the \n minimum suported time value which is greater than \n or equal to the time value of \n fddiPATHTVXLowerBound.')
fddimib_mac_frame_cts = mib_table_column((1, 3, 6, 1, 2, 1, 10, 15, 73, 2, 2, 1, 21), counter32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
fddimibMACFrameCts.setDescription('A count of the number of frames received by this \n MAC (refer to ANSI MAC 7.5.1).')
fddimib_mac_copied_cts = mib_table_column((1, 3, 6, 1, 2, 1, 10, 15, 73, 2, 2, 1, 22), counter32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
fddimibMACCopiedCts.setDescription("A count that should as closely as possible match \n the number of frames addressed to (A bit set) and \n successfully copied into the station's receive \n buffers (C bit set) by this MAC (refer to ANSI MAC \n 7.5). Note that this count does not include MAC \n frames.")
fddimib_mac_transmit_cts = mib_table_column((1, 3, 6, 1, 2, 1, 10, 15, 73, 2, 2, 1, 23), counter32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
fddimibMACTransmitCts.setDescription('A count that should as closely as possible match \n the number of frames transmitted by this MAC \n (refer to ANSI MAC 7.5). Note that this count \n does not include MAC frames.')
fddimib_mac_error_cts = mib_table_column((1, 3, 6, 1, 2, 1, 10, 15, 73, 2, 2, 1, 24), counter32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
fddimibMACErrorCts.setDescription('A count of the number of frames that were \n detected in error by this MAC that had not been \n detected in error by another MAC (refer to ANSI \n MAC 7.5.2).')
fddimib_mac_lost_cts = mib_table_column((1, 3, 6, 1, 2, 1, 10, 15, 73, 2, 2, 1, 25), counter32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
fddimibMACLostCts.setDescription('A count of the number of instances that this MAC \n detected a format error during frame reception \n such that the frame was stripped (refer to ANSI \n MAC 7.5.3).')
fddimib_mac_frame_error_threshold = mib_table_column((1, 3, 6, 1, 2, 1, 10, 15, 73, 2, 2, 1, 26), integer32().subtype(subtypeSpec=value_range_constraint(0, 65535))).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
fddimibMACFrameErrorThreshold.setDescription('A threshold for determining when a MAC Condition \n report (see ANSI 8.3.1.1) shall be generated. \n Stations not supporting variable thresholds shall \n have a value of 0 and a range of (0..0).')
fddimib_mac_frame_error_ratio = mib_table_column((1, 3, 6, 1, 2, 1, 10, 15, 73, 2, 2, 1, 27), integer32().subtype(subtypeSpec=value_range_constraint(0, 65535))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
fddimibMACFrameErrorRatio.setDescription('This variable is the value of the ratio, \n \n ((delta fddiMACLostCts + delta fddiMACErrorCts) / \n (delta fddiMACFrameCts + delta fddiMACLostCts )) \n * 2**16 ')
fddimib_macrmt_state = mib_table_column((1, 3, 6, 1, 2, 1, 10, 15, 73, 2, 2, 1, 28), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3, 4, 5, 6, 7, 8))).clone(namedValues=named_values(('rm0', 1), ('rm1', 2), ('rm2', 3), ('rm3', 4), ('rm4', 5), ('rm5', 6), ('rm6', 7), ('rm7', 8)))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
fddimibMACRMTState.setDescription('Indicates the current state of the RMT State \n Machine (refer to ANSI 10.3.2).')
fddimib_mac_da_flag = mib_table_column((1, 3, 6, 1, 2, 1, 10, 15, 73, 2, 2, 1, 29), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('true', 1), ('false', 2)))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
fddimibMACDaFlag.setDescription('The RMT flag Duplicate Address Flag, DA_Flag \n (refer to ANSI 10.2.1.2).')
fddimib_mac_una_da_flag = mib_table_column((1, 3, 6, 1, 2, 1, 10, 15, 73, 2, 2, 1, 30), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('true', 1), ('false', 2)))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
fddimibMACUnaDaFlag.setDescription('A flag, UNDA_Flag (refer to ANSI 8.2.2.1), set \n when the upstream neighbor reports a duplicate \n address condition. Cleared when the condition \n clears.')
fddimib_mac_frame_error_flag = mib_table_column((1, 3, 6, 1, 2, 1, 10, 15, 73, 2, 2, 1, 31), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('true', 1), ('false', 2)))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
fddimibMACFrameErrorFlag.setDescription('Indicates the MAC Frame Error Condition is \n present when set. Cleared when the condition \n clears and on station initialization.')
fddimib_macma_unitdata_available = mib_table_column((1, 3, 6, 1, 2, 1, 10, 15, 73, 2, 2, 1, 32), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('true', 1), ('false', 2)))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
fddimibMACMAUnitdataAvailable.setDescription('This variable shall take on the value of the \n MAC_Avail flag defined in RMT.')
fddimib_mac_hardware_present = mib_table_column((1, 3, 6, 1, 2, 1, 10, 15, 73, 2, 2, 1, 33), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('true', 1), ('false', 2)))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
fddimibMACHardwarePresent.setDescription('This variable indicates the presence of \n underlying hardware support for this MAC object. \n If the value of this object is false(2), the \n reporting of the objects in this entry may be \n handled in an implementation-specific manner.')
fddimib_macma_unitdata_enable = mib_table_column((1, 3, 6, 1, 2, 1, 10, 15, 73, 2, 2, 1, 34), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('true', 1), ('false', 2)))).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
fddimibMACMAUnitdataEnable.setDescription('This variable determines the value of the \n MA_UNITDATA_Enable flag in RMT. The default and \n initial value of this flag is true(1).')
fddimib_mac_counters_table = mib_table((1, 3, 6, 1, 2, 1, 10, 15, 73, 3, 1))
if mibBuilder.loadTexts:
fddimibMACCountersTable.setDescription('A list of MAC Counters entries. The number of \n entries shall not exceed the value of \n fddimibMACNumber.')
fddimib_mac_counters_entry = mib_table_row((1, 3, 6, 1, 2, 1, 10, 15, 73, 3, 1, 1)).setIndexNames((0, 'FDDI-SMT73-MIB', 'fddimibMACSMTIndex'), (0, 'FDDI-SMT73-MIB', 'fddimibMACIndex'))
if mibBuilder.loadTexts:
fddimibMACCountersEntry.setDescription('A MAC Counters entry containing information \n common to a given MAC.')
fddimib_mac_token_cts = mib_table_column((1, 3, 6, 1, 2, 1, 10, 15, 73, 3, 1, 1, 1), counter32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
fddimibMACTokenCts.setDescription('A count that should as closely as possible match \n the number of times the station has received a \n token (total of non-restricted and restricted) on \n this MAC (see ANSI MAC 7.4). This count is \n valuable for determination of network load.')
fddimib_mac_tvx_expired_cts = mib_table_column((1, 3, 6, 1, 2, 1, 10, 15, 73, 3, 1, 1, 2), counter32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
fddimibMACTvxExpiredCts.setDescription('A count that should as closely as possible match \n the number of times that TVX has expired.')
fddimib_mac_not_copied_cts = mib_table_column((1, 3, 6, 1, 2, 1, 10, 15, 73, 3, 1, 1, 3), counter32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
fddimibMACNotCopiedCts.setDescription('A count that should as closely as possible match \n the number of frames that were addressed to this \n MAC but were not copied into its receive buffers \n (see ANSI MAC 7.5). For example, this might occur \n due to local buffer congestion. Because of \n implementation considerations, this count may not \n match the actual number of frames not copied. It \n is not a requirement that this count be exact. \n Note that this count does not include MAC frames.')
fddimib_mac_late_cts = mib_table_column((1, 3, 6, 1, 2, 1, 10, 15, 73, 3, 1, 1, 4), counter32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
fddimibMACLateCts.setDescription('A count that should as closely as possible match \n the number of TRT expirations since this MAC was \n reset or a token was received (refer to ANSI MAC \n 7.4.5).')
fddimib_mac_ring_op_cts = mib_table_column((1, 3, 6, 1, 2, 1, 10, 15, 73, 3, 1, 1, 5), counter32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
fddimibMACRingOpCts.setDescription("The count of the number of times the ring has \n entered the 'Ring_Operational' state from the \n 'Ring Not Operational' state. This count is \n updated when a SM_MA_STATUS.Indication of a change \n in the Ring_Operational status occurs (refer to \n ANSI 6.1.4). Because of implementation \n considerations, this count may be less than the \n actual RingOp_Ct. It is not a requirement that \n this count be exact.")
fddimib_mac_not_copied_ratio = mib_table_column((1, 3, 6, 1, 2, 1, 10, 15, 73, 3, 1, 1, 6), integer32().subtype(subtypeSpec=value_range_constraint(0, 65535))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
fddimibMACNotCopiedRatio.setDescription('This variable is the value of the ratio: \n \n (delta fddiMACNotCopiedCts / \n (delta fddiMACCopiedCts + \n delta fddiMACNotCopiedCts )) * 2**16 ')
fddimib_mac_not_copied_flag = mib_table_column((1, 3, 6, 1, 2, 1, 10, 15, 73, 3, 1, 1, 7), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('true', 1), ('false', 2)))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
fddimibMACNotCopiedFlag.setDescription('Indicates that the Not Copied condition is \n present when read as true(1). Set to false(2) \n when the condition clears and on station \n initialization.')
fddimib_mac_not_copied_threshold = mib_table_column((1, 3, 6, 1, 2, 1, 10, 15, 73, 3, 1, 1, 8), integer32().subtype(subtypeSpec=value_range_constraint(0, 65535))).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
fddimibMACNotCopiedThreshold.setDescription('A threshold for determining when a MAC condition \n report shall be generated. Stations not \n supporting variable thresholds shall have a value \n of 0 and a range of (0..0).')
fddimib_path_number = mib_scalar((1, 3, 6, 1, 2, 1, 10, 15, 73, 4, 1), integer32().subtype(subtypeSpec=value_range_constraint(0, 65535))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
fddimibPATHNumber.setDescription("The total number of PATHs possible (across all \n SMTs) on this network management application \n entity. The value for this variable must remain \n constant at least from one re-initialization of \n the entity's network management system to the next \n re-initialization.")
fddimib_path_table = mib_table((1, 3, 6, 1, 2, 1, 10, 15, 73, 4, 2))
if mibBuilder.loadTexts:
fddimibPATHTable.setDescription('A list of PATH entries. The number of entries \n shall not exceed the value of fddimibPATHNumber.')
fddimib_path_entry = mib_table_row((1, 3, 6, 1, 2, 1, 10, 15, 73, 4, 2, 1)).setIndexNames((0, 'FDDI-SMT73-MIB', 'fddimibPATHSMTIndex'), (0, 'FDDI-SMT73-MIB', 'fddimibPATHIndex'))
if mibBuilder.loadTexts:
fddimibPATHEntry.setDescription('A PATH entry containing information common to a \n given PATH.')
fddimib_pathsmt_index = mib_table_column((1, 3, 6, 1, 2, 1, 10, 15, 73, 4, 2, 1, 1), integer32().subtype(subtypeSpec=value_range_constraint(1, 65535))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
fddimibPATHSMTIndex.setDescription('The value of the SMT index associated with this \n PATH.')
fddimib_path_index = mib_table_column((1, 3, 6, 1, 2, 1, 10, 15, 73, 4, 2, 1, 2), integer32().subtype(subtypeSpec=value_range_constraint(0, 65535))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
fddimibPATHIndex.setDescription('Index variable for uniquely identifying the \n primary, secondary and local PATH object \n instances. Local PATH object instances are \n represented with integer values 3 to 255.')
fddimib_pathtvx_lower_bound = mib_table_column((1, 3, 6, 1, 2, 1, 10, 15, 73, 4, 2, 1, 3), fddi_time_nano()).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
fddimibPATHTVXLowerBound.setDescription('Specifies the minimum time value of \n fddiMACTvxValue that shall be used by any MAC that \n is configured in this path. The operational value \n of fddiMACTvxValue is managed by settting this \n variable. This variable has the time value range \n of: \n \n 0 < fddimibPATHTVXLowerBound < fddimibPATHMaxTReq \n Changes to this variable shall either satisfy the \n time value relationship: \n \n fddimibPATHTVXLowerBound <= \n fddimibMACTVXCapability \n \n of each of the MACs currently on the path, or be \n considered out of range. The initial value of \n fddimibPATHTVXLowerBound shall be 2500 nsec (2.5 \n ms).')
fddimib_patht_max_lower_bound = mib_table_column((1, 3, 6, 1, 2, 1, 10, 15, 73, 4, 2, 1, 4), fddi_time_nano()).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
fddimibPATHTMaxLowerBound.setDescription('Specifies the minimum time value of fddiMACTMax \n that shall be used by any MAC that is configured \n in this path. The operational value of \n fddiMACTMax is managed by setting this variable. \n This variable has the time value range of: \n \n fddimibPATHMaxTReq <= fddimibPATHTMaxLowerBound \n \n and an absolute time value range of: \n \n 10000nsec (10 msec) <= fddimibPATHTMaxLowerBound \n \n Changes to this variable shall either satisfy the \n time value relationship: \n \n fddimibPATHTMaxLowerBound < \n fddimibMACTMaxCapability \n \n of each of the MACs currently on the path, or be \n considered out of range. The initial value of \n fddimibPATHTMaxLowerBound shall be 165000 nsec \n (165 msec).')
fddimib_path_max_t_req = mib_table_column((1, 3, 6, 1, 2, 1, 10, 15, 73, 4, 2, 1, 5), fddi_time_nano()).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
fddimibPATHMaxTReq.setDescription('Specifies the maximum time value of fddiMACT-Req \n that shall be used by any MAC that is configured \n in this path. The operational value of fddiMACT- \n Req is managed by setting this variable. This \n variable has the time value range of: \n \n fddimibPATHTVXLowerBound < fddimibPATHMaxTReq <= \n fddimibPATHTMaxLowerBound. \n \n The default value of fddimibPATHMaxTReq is 165000 \n nsec (165 msec).')
fddimib_path_config_table = mib_table((1, 3, 6, 1, 2, 1, 10, 15, 73, 4, 3))
if mibBuilder.loadTexts:
fddimibPATHConfigTable.setDescription('A table of Path configuration entries. This \n table lists all the resources that may be in this \n Path.')
fddimib_path_config_entry = mib_table_row((1, 3, 6, 1, 2, 1, 10, 15, 73, 4, 3, 1)).setIndexNames((0, 'FDDI-SMT73-MIB', 'fddimibPATHConfigSMTIndex'), (0, 'FDDI-SMT73-MIB', 'fddimibPATHConfigPATHIndex'), (0, 'FDDI-SMT73-MIB', 'fddimibPATHConfigTokenOrder'))
if mibBuilder.loadTexts:
fddimibPATHConfigEntry.setDescription('A collection of objects containing information \n for a given PATH Configuration entry.')
fddimib_path_config_smt_index = mib_table_column((1, 3, 6, 1, 2, 1, 10, 15, 73, 4, 3, 1, 1), integer32().subtype(subtypeSpec=value_range_constraint(1, 65535))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
fddimibPATHConfigSMTIndex.setDescription('The value of the SMT index associated with this \n configuration entry.')
fddimib_path_config_path_index = mib_table_column((1, 3, 6, 1, 2, 1, 10, 15, 73, 4, 3, 1, 2), integer32().subtype(subtypeSpec=value_range_constraint(1, 65535))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
fddimibPATHConfigPATHIndex.setDescription('The value of the PATH resource index associated \n with this configuration entry.')
fddimib_path_config_token_order = mib_table_column((1, 3, 6, 1, 2, 1, 10, 15, 73, 4, 3, 1, 3), integer32().subtype(subtypeSpec=value_range_constraint(1, 65535))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
fddimibPATHConfigTokenOrder.setDescription('An object associated with Token order for this \n entry. Thus if the token passes resources a, b, c \n and d, in that order, then the value of this \n object for these resources would be 1, 2, 3 and 4 \n respectively.')
fddimib_path_config_resource_type = mib_table_column((1, 3, 6, 1, 2, 1, 10, 15, 73, 4, 3, 1, 4), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(2, 4))).clone(namedValues=named_values(('mac', 2), ('port', 4)))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
fddimibPATHConfigResourceType.setDescription('The type of resource associated with this \n configuration entry.')
fddimib_path_config_resource_index = mib_table_column((1, 3, 6, 1, 2, 1, 10, 15, 73, 4, 3, 1, 5), integer32().subtype(subtypeSpec=value_range_constraint(1, 65535))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
fddimibPATHConfigResourceIndex.setDescription('The value of the SMT resource index used to refer \n to the instance of this MAC or Port resource.')
fddimib_path_config_current_path = mib_table_column((1, 3, 6, 1, 2, 1, 10, 15, 73, 4, 3, 1, 6), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3, 4, 5, 6))).clone(namedValues=named_values(('isolated', 1), ('local', 2), ('secondary', 3), ('primary', 4), ('concatenated', 5), ('thru', 6)))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
fddimibPATHConfigCurrentPath.setDescription('The current insertion status for this resource on \n this Path.')
fddimib_port_number = mib_scalar((1, 3, 6, 1, 2, 1, 10, 15, 73, 5, 1), integer32().subtype(subtypeSpec=value_range_constraint(0, 65535))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
fddimibPORTNumber.setDescription("The total number of PORT implementations (across \n all SMTs) on this network management application \n entity. The value for this variable must remain \n constant at least from one re-initialization of \n the entity's network management system to the next \n re-initialization.")
fddimib_port_table = mib_table((1, 3, 6, 1, 2, 1, 10, 15, 73, 5, 2))
if mibBuilder.loadTexts:
fddimibPORTTable.setDescription('A list of PORT entries. The number of entries \n shall not exceed the value of fddimibPORTNumber.')
fddimib_port_entry = mib_table_row((1, 3, 6, 1, 2, 1, 10, 15, 73, 5, 2, 1)).setIndexNames((0, 'FDDI-SMT73-MIB', 'fddimibPORTSMTIndex'), (0, 'FDDI-SMT73-MIB', 'fddimibPORTIndex'))
if mibBuilder.loadTexts:
fddimibPORTEntry.setDescription('A PORT entry containing information common to a \n given PORT.')
fddimib_portsmt_index = mib_table_column((1, 3, 6, 1, 2, 1, 10, 15, 73, 5, 2, 1, 1), integer32().subtype(subtypeSpec=value_range_constraint(1, 65535))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
fddimibPORTSMTIndex.setDescription('The value of the SMT index associated with this \n PORT.')
fddimib_port_index = mib_table_column((1, 3, 6, 1, 2, 1, 10, 15, 73, 5, 2, 1, 2), integer32().subtype(subtypeSpec=value_range_constraint(1, 65535))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
fddimibPORTIndex.setDescription("A unique value for each PORT within a given SMT, \n which is the same as the corresponding resource \n index in SMT. The value for each PORT must remain \n constant at least from one re-initialization of \n the entity's network management system to the next \n re-initialization.")
fddimib_port_my_type = mib_table_column((1, 3, 6, 1, 2, 1, 10, 15, 73, 5, 2, 1, 3), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3, 4, 5))).clone(namedValues=named_values(('a', 1), ('b', 2), ('s', 3), ('m', 4), ('none', 5)))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
fddimibPORTMyType.setDescription("The value of the PORT's PC_Type (refer to ANSI \n 9.4.1, and 9.6.3.2).")
fddimib_port_neighbor_type = mib_table_column((1, 3, 6, 1, 2, 1, 10, 15, 73, 5, 2, 1, 4), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3, 4, 5))).clone(namedValues=named_values(('a', 1), ('b', 2), ('s', 3), ('m', 4), ('none', 5)))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
fddimibPORTNeighborType.setDescription('The type of the remote PORT as determined in PCM. \n This variable has an initial value of none, and is \n only modified in PC_RCode(3)_Actions (refer to \n ANSI SMT 9.6.3.2).')
fddimib_port_connection_policies = mib_table_column((1, 3, 6, 1, 2, 1, 10, 15, 73, 5, 2, 1, 5), integer32().subtype(subtypeSpec=value_range_constraint(0, 3))).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
fddimibPORTConnectionPolicies.setDescription("A value representing the PORT's connection \n policies desired in the node. The value of pc- \n mac-lct is a term used in the PC_MAC_LCT Flag (see \n 9.4.3.2). The value of pc-mac-loop is a term used \n in the PC_MAC_Loop Flag. \n \n The value is a sum. This value initially takes \n the value zero, then for each PORT policy, 2 \n raised to a power is added to the sum. The powers \n are according to the following table: \n \n Policy Power \n pc-mac-lct 0 \n pc-mac-loop 1 ")
fddimib_portmac_indicated = mib_table_column((1, 3, 6, 1, 2, 1, 10, 15, 73, 5, 2, 1, 6), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3, 4))).clone(namedValues=named_values(('tVal9FalseRVal9False', 1), ('tVal9FalseRVal9True', 2), ('tVal9TrueRVal9False', 3), ('tVal9TrueRVal9True', 4)))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
fddimibPORTMACIndicated.setDescription('The indications (T_Val(9), R_Val(9)) in PC- \n Signalling, of the intent to place a MAC in the \n output token path to a PORT (refer to ANSI SMT \n 9.6.3.2.).')
fddimib_port_current_path = mib_table_column((1, 3, 6, 1, 2, 1, 10, 15, 73, 5, 2, 1, 7), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3, 4, 5, 6))).clone(namedValues=named_values(('ce0', 1), ('ce1', 2), ('ce2', 3), ('ce3', 4), ('ce4', 5), ('ce5', 6)))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
fddimibPORTCurrentPath.setDescription('Indicates the Path(s) into which this PORT is \n currently inserted.')
fddimib_port_requested_paths = mib_table_column((1, 3, 6, 1, 2, 1, 10, 15, 73, 5, 2, 1, 8), octet_string().subtype(subtypeSpec=value_size_constraint(3, 3)).setFixedLength(3)).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
fddimibPORTRequestedPaths.setDescription("This variable is a list of permitted Paths where \n each list element defines the Port's permitted \n Paths. The first octet corresponds to 'none', the \n second octet to 'tree', and the third octet to \n 'peer'.")
fddimib_portmac_placement = mib_table_column((1, 3, 6, 1, 2, 1, 10, 15, 73, 5, 2, 1, 9), fddi_resource_id()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
fddimibPORTMACPlacement.setDescription('Indicates the MAC, if any, whose transmit path \n exits the station via this PORT. The value shall \n be zero if there is no MAC associated with the \n PORT. Otherwise, the MACIndex of the MAC will be \n the value of the variable.')
fddimib_port_available_paths = mib_table_column((1, 3, 6, 1, 2, 1, 10, 15, 73, 5, 2, 1, 10), integer32().subtype(subtypeSpec=value_range_constraint(0, 7))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
fddimibPORTAvailablePaths.setDescription('Indicates the Paths which are available to this \n Port. In the absence of faults, the A and B Ports \n will always have both the Primary and Secondary \n Paths available. \n \n The value is a sum. This value initially takes \n the value zero, then for each type of PATH that \n this port has available, 2 raised to a power is \n added to the sum. The powers are according to the \n following table: \n \n Path Power \n Primary 0 \n Secondary 1 \n Local 2 ')
fddimib_portpmd_class = mib_table_column((1, 3, 6, 1, 2, 1, 10, 15, 73, 5, 2, 1, 11), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3, 4, 5, 6, 7, 8))).clone(namedValues=named_values(('multimode', 1), ('single-mode1', 2), ('single-mode2', 3), ('sonet', 4), ('low-cost-fiber', 5), ('twisted-pair', 6), ('unknown', 7), ('unspecified', 8)))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
fddimibPORTPMDClass.setDescription('This variable indicates the type of PMD entity \n associated with this port.')
fddimib_port_connection_capabilities = mib_table_column((1, 3, 6, 1, 2, 1, 10, 15, 73, 5, 2, 1, 12), integer32().subtype(subtypeSpec=value_range_constraint(0, 3))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
fddimibPORTConnectionCapabilities.setDescription('A value that indicates the connection \n capabilities of the port. The pc-mac-lct bit \n indicates that the station has the capability of \n setting the PC_MAC_LCT Flag. The pc-mac-loop bit \n indicates that the station has the capability of \n setting the PC_MAC_Loop Flag (refer to ANSI \n 9.4.3.2). \n \n The value is a sum. This value initially takes \n the value zero, then for each capability that this \n port has, 2 raised to a power is added to the sum. \n The powers are according to the following table: \n \n capability Power \n pc-mac-lct 0 \n pc-mac-loop 1 ')
fddimib_portbs_flag = mib_table_column((1, 3, 6, 1, 2, 1, 10, 15, 73, 5, 2, 1, 13), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('true', 1), ('false', 2)))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
fddimibPORTBSFlag.setDescription('This variable assumes the value of the BS_Flag \n (refer to ANSI SMT 9.4.3.3).')
fddimib_portlct_fail_cts = mib_table_column((1, 3, 6, 1, 2, 1, 10, 15, 73, 5, 2, 1, 14), counter32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
fddimibPORTLCTFailCts.setDescription('The count of the consecutive times the link \n confidence test (LCT) has failed during connection \n management (refer to ANSI 9.4.1).')
fddimib_port_ler_estimate = mib_table_column((1, 3, 6, 1, 2, 1, 10, 15, 73, 5, 2, 1, 15), integer32().subtype(subtypeSpec=value_range_constraint(4, 15))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
fddimibPORTLerEstimate.setDescription('A long term average link error rate. It ranges \n from 10**-4 to 10**-15 and is reported as the \n absolute value of the base 10 logarithm (refer to \n ANSI SMT 9.4.7.5.).')
fddimib_port_lem_reject_cts = mib_table_column((1, 3, 6, 1, 2, 1, 10, 15, 73, 5, 2, 1, 16), counter32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
fddimibPORTLemRejectCts.setDescription('A link error monitoring count of the times that a \n link has been rejected.')
fddimib_port_lem_cts = mib_table_column((1, 3, 6, 1, 2, 1, 10, 15, 73, 5, 2, 1, 17), counter32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
fddimibPORTLemCts.setDescription('The aggregate link error monitor error count, set \n to zero only on station initialization.')
fddimib_port_ler_cutoff = mib_table_column((1, 3, 6, 1, 2, 1, 10, 15, 73, 5, 2, 1, 18), integer32().subtype(subtypeSpec=value_range_constraint(4, 15))).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
fddimibPORTLerCutoff.setDescription('The link error rate estimate at which a link \n connection will be broken. It ranges from 10**-4 \n to 10**-15 and is reported as the absolute value \n of the base 10 logarithm (default of 7).')
fddimib_port_ler_alarm = mib_table_column((1, 3, 6, 1, 2, 1, 10, 15, 73, 5, 2, 1, 19), integer32().subtype(subtypeSpec=value_range_constraint(4, 15))).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
fddimibPORTLerAlarm.setDescription('The link error rate estimate at which a link \n connection will generate an alarm. It ranges from \n 10**-4 to 10**-15 and is reported as the absolute \n value of the base 10 logarithm of the estimate \n (default of 8).')
fddimib_port_connect_state = mib_table_column((1, 3, 6, 1, 2, 1, 10, 15, 73, 5, 2, 1, 20), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3, 4))).clone(namedValues=named_values(('disabled', 1), ('connecting', 2), ('standby', 3), ('active', 4)))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
fddimibPORTConnectState.setDescription('An indication of the connect state of this PORT \n and is equal to the value of Connect_State (refer \n to ANSI 9.4.1)')
fddimib_portpcm_state = mib_table_column((1, 3, 6, 1, 2, 1, 10, 15, 73, 5, 2, 1, 21), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3, 4, 5, 6, 7, 8, 9, 10))).clone(namedValues=named_values(('pc0', 1), ('pc1', 2), ('pc2', 3), ('pc3', 4), ('pc4', 5), ('pc5', 6), ('pc6', 7), ('pc7', 8), ('pc8', 9), ('pc9', 10)))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
fddimibPORTPCMState.setDescription("The state of this Port's PCM state machine refer \n to ANSI SMT 9.6.2).")
fddimib_portpc_withhold = mib_table_column((1, 3, 6, 1, 2, 1, 10, 15, 73, 5, 2, 1, 22), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3, 4))).clone(namedValues=named_values(('none', 1), ('m-m', 2), ('otherincompatible', 3), ('pathnotavailable', 4)))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
fddimibPORTPCWithhold.setDescription('The value of PC_Withhold (refer to ANSI SMT \n 9.4.1).')
fddimib_port_ler_flag = mib_table_column((1, 3, 6, 1, 2, 1, 10, 15, 73, 5, 2, 1, 23), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('true', 1), ('false', 2)))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
fddimibPORTLerFlag.setDescription('The condition becomes active when the value of \n fddiPORTLerEstimate is less than or equal to \n fddiPORTLerAlarm. This will be reported with the \n Status Report Frames (SRF) (refer to ANSI SMT \n 7.2.7 and 8.3).')
fddimib_port_hardware_present = mib_table_column((1, 3, 6, 1, 2, 1, 10, 15, 73, 5, 2, 1, 24), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('true', 1), ('false', 2)))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
fddimibPORTHardwarePresent.setDescription('This variable indicates the presence of \n underlying hardware support for this Port object. \n If the value of this object is false(2), the \n reporting of the objects in this entry may be \n handled in an implementation-specific manner.')
fddimib_port_action = mib_table_column((1, 3, 6, 1, 2, 1, 10, 15, 73, 5, 2, 1, 25), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3, 4, 5, 6))).clone(namedValues=named_values(('other', 1), ('maintPORT', 2), ('enablePORT', 3), ('disablePORT', 4), ('startPORT', 5), ('stopPORT', 6)))).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
fddimibPORTAction.setDescription("Causes a Control signal to be generated with a \n control_action of 'Signal' and the 'variable' \n parameter set with the appropriate value (i.e., \n PC_Maint, PC_Enable, PC_Disable, PC_Start, or \n PC_Stop) (refer to ANSI 9.4.2).")
mibBuilder.exportSymbols('FDDI-SMT73-MIB', fddimibPATHConfigSMTIndex=fddimibPATHConfigSMTIndex, fddimibMACAvailablePaths=fddimibMACAvailablePaths, fddimibSMTTransitionTimeStamp=fddimibSMTTransitionTimeStamp, fddimibPORTHardwarePresent=fddimibPORTHardwarePresent, fddimibMACRequestedPaths=fddimibMACRequestedPaths, fddimibPATHConfigTable=fddimibPATHConfigTable, fddimibMACMAUnitdataAvailable=fddimibMACMAUnitdataAvailable, fddimibMACFrameStatusFunctions=fddimibMACFrameStatusFunctions, fddimibSMTConfigCapabilities=fddimibSMTConfigCapabilities, fddimibMACNumber=fddimibMACNumber, fddimibMACSMTIndex=fddimibMACSMTIndex, fddimibSMTECMState=fddimibSMTECMState, FddiResourceId=FddiResourceId, fddimibPATHSMTIndex=fddimibPATHSMTIndex, fddimibMACTMaxCapability=fddimibMACTMaxCapability, fddimibMAC=fddimibMAC, fddimibPORTLemRejectCts=fddimibPORTLemRejectCts, fddimibMACSMTAddress=fddimibMACSMTAddress, fddimibMACRMTState=fddimibMACRMTState, fddimibPORTEntry=fddimibPORTEntry, fddimibSMTTNotify=fddimibSMTTNotify, fddimibPORTLerAlarm=fddimibPORTLerAlarm, FddiTimeNano=FddiTimeNano, fddimibMACFrameErrorRatio=fddimibMACFrameErrorRatio, fddimibPORTSMTIndex=fddimibPORTSMTIndex, fddimibSMTStationAction=fddimibSMTStationAction, fddimibMACCopiedCts=fddimibMACCopiedCts, fddimibSMTNumber=fddimibSMTNumber, fddimib=fddimib, FddiMACLongAddressType=FddiMACLongAddressType, fddimibSMTLoVersionId=fddimibSMTLoVersionId, fddimibMACTransmitCts=fddimibMACTransmitCts, fddimibMACHardwarePresent=fddimibMACHardwarePresent, fddimibSMTBypassPresent=fddimibSMTBypassPresent, fddimibPORTIndex=fddimibPORTIndex, fddimibSMTTable=fddimibSMTTable, fddimibMACDownstreamNbr=fddimibMACDownstreamNbr, fddimibSMTOpVersionId=fddimibSMTOpVersionId, fddimibPORTConnectionCapabilities=fddimibPORTConnectionCapabilities, fddimibPATHConfigResourceIndex=fddimibPATHConfigResourceIndex, fddimibPORTCurrentPath=fddimibPORTCurrentPath, fddimibMACIndex=fddimibMACIndex, fddimibMACOldDownstreamNbr=fddimibMACOldDownstreamNbr, fddimibSMTTraceMaxExpiration=fddimibSMTTraceMaxExpiration, fddimibPORTPCWithhold=fddimibPORTPCWithhold, fddimibPORTTable=fddimibPORTTable, fddimibMACNotCopiedFlag=fddimibMACNotCopiedFlag, FddiSMTStationIdType=FddiSMTStationIdType, fddimibMACTvxValue=fddimibMACTvxValue, fddimibSMTRemoteDisconnectFlag=fddimibSMTRemoteDisconnectFlag, fddimibMACTokenCts=fddimibMACTokenCts, fddimibMACCountersTable=fddimibMACCountersTable, fddimibPORTNumber=fddimibPORTNumber, fddimibMACNotCopiedCts=fddimibMACNotCopiedCts, fddimibPORTConnectState=fddimibPORTConnectState, fddimibPORTAction=fddimibPORTAction, fddimibSMTStationStatus=fddimibSMTStationStatus, fddimibPORTNeighborType=fddimibPORTNeighborType, fddimibPORTLerEstimate=fddimibPORTLerEstimate, fddimibPORTPMDClass=fddimibPORTPMDClass, fddimibMACTVXCapability=fddimibMACTVXCapability, FddiTimeMilli=FddiTimeMilli, fddimibPATHTVXLowerBound=fddimibPATHTVXLowerBound, fddimibSMTHiVersionId=fddimibSMTHiVersionId, fddimibMACTReq=fddimibMACTReq, fddimibPATHNumber=fddimibPATHNumber, fddimibSMTUserData=fddimibSMTUserData, fddimibMACFrameCts=fddimibMACFrameCts, fddimibPATHConfigTokenOrder=fddimibPATHConfigTokenOrder, transmission=transmission, fddimibMACLostCts=fddimibMACLostCts, fddimibMACFrameErrorThreshold=fddimibMACFrameErrorThreshold, fddimibSMTConnectionPolicy=fddimibSMTConnectionPolicy, fddimibMACErrorCts=fddimibMACErrorCts, fddimibPORT=fddimibPORT, fddimibPORTLCTFailCts=fddimibPORTLCTFailCts, fddi=fddi, fddimibPORTMACPlacement=fddimibPORTMACPlacement, fddimibSMTEntry=fddimibSMTEntry, fddimibPORTLerFlag=fddimibPORTLerFlag, fddimibPORTLemCts=fddimibPORTLemCts, fddimibMACIfIndex=fddimibMACIfIndex, fddimibSMTCFState=fddimibSMTCFState, fddimibPATHConfigEntry=fddimibPATHConfigEntry, fddimibPORTAvailablePaths=fddimibPORTAvailablePaths, fddimibPATHTMaxLowerBound=fddimibPATHTMaxLowerBound, fddimibPORTMyType=fddimibPORTMyType, fddimibMACTvxExpiredCts=fddimibMACTvxExpiredCts, fddimibPATHConfigCurrentPath=fddimibPATHConfigCurrentPath, fddimibSMTIndex=fddimibSMTIndex, fddimibPATHConfigResourceType=fddimibPATHConfigResourceType, fddimibSMTPeerWrapFlag=fddimibSMTPeerWrapFlag, fddimibSMTStationId=fddimibSMTStationId, fddimibPATH=fddimibPATH, fddimibMACDownstreamPORTType=fddimibMACDownstreamPORTType, fddimibMACOldUpstreamNbr=fddimibMACOldUpstreamNbr, fddimibPORTRequestedPaths=fddimibPORTRequestedPaths, fddimibSMT=fddimibSMT, fddimibMACFrameErrorFlag=fddimibMACFrameErrorFlag, fddimibPATHConfigPATHIndex=fddimibPATHConfigPATHIndex, fddimibPATHMaxTReq=fddimibPATHMaxTReq, fddimibMACUnaDaFlag=fddimibMACUnaDaFlag, fddimibPORTBSFlag=fddimibPORTBSFlag, fddimibPORTConnectionPolicies=fddimibPORTConnectionPolicies, fddimibMACCurrentPath=fddimibMACCurrentPath, fddimibMACRingOpCts=fddimibMACRingOpCts, fddimibSMTMACCts=fddimibSMTMACCts, fddimibSMTTimeStamp=fddimibSMTTimeStamp, fddimibMACNotCopiedRatio=fddimibMACNotCopiedRatio, fddimibMACDupAddressTest=fddimibMACDupAddressTest, fddimibPORTLerCutoff=fddimibPORTLerCutoff, fddimibSMTConfigPolicy=fddimibSMTConfigPolicy, fddimibMACTMax=fddimibMACTMax, fddimibPATHIndex=fddimibPATHIndex, fddimibMACLateCts=fddimibMACLateCts, fddimibSMTNonMasterCts=fddimibSMTNonMasterCts, fddimibMACCountersEntry=fddimibMACCountersEntry, fddimibMACUpstreamNbr=fddimibMACUpstreamNbr, fddimibPATHEntry=fddimibPATHEntry, fddimibPATHTable=fddimibPATHTable, fddimibMACMAUnitdataEnable=fddimibMACMAUnitdataEnable, fddimibPORTPCMState=fddimibPORTPCMState, fddimibMACTNeg=fddimibMACTNeg, fddimibSMTMIBVersionId=fddimibSMTMIBVersionId, fddimibSMTMasterCts=fddimibSMTMasterCts, fddimibSMTStatRptPolicy=fddimibSMTStatRptPolicy, fddimibPORTMACIndicated=fddimibPORTMACIndicated, fddimibMACNotCopiedThreshold=fddimibMACNotCopiedThreshold, fddimibMACCounters=fddimibMACCounters, fddimibSMTAvailablePaths=fddimibSMTAvailablePaths, fddimibMACEntry=fddimibMACEntry, fddimibMACDaFlag=fddimibMACDaFlag, fddimibMACTable=fddimibMACTable)
|
#/usr/bin/env python
"""
globifest/globitest/__init__.py - globifest Library Package
Copyright 2018, Daniel Kristensen, Garmin Ltd, or its subsidiaries.
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
* Neither the name of the copyright holder nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
"""
__author__ = "Daniel Kristensen"
__license__ = "BSD"
__copyright__ = "Copyright 2018 Daniel Kristensen, Garmin Ltd. or its subsidiaries."
__all__ = [
"BoundedStatefulParser",
"Builder",
"Config",
"ConfigParser",
"DefinitionParser",
"DefTree",
"Generators",
"Importer",
"LineInfo",
"LineReader",
"Log",
"Manifest",
"ManifestParser",
"Matcher",
"ProjectParser",
"Project",
"Settings",
"StatefulParser",
"StateMachine",
"Util"
]
|
"""
globifest/globitest/__init__.py - globifest Library Package
Copyright 2018, Daniel Kristensen, Garmin Ltd, or its subsidiaries.
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
* Neither the name of the copyright holder nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
"""
__author__ = 'Daniel Kristensen'
__license__ = 'BSD'
__copyright__ = 'Copyright 2018 Daniel Kristensen, Garmin Ltd. or its subsidiaries.'
__all__ = ['BoundedStatefulParser', 'Builder', 'Config', 'ConfigParser', 'DefinitionParser', 'DefTree', 'Generators', 'Importer', 'LineInfo', 'LineReader', 'Log', 'Manifest', 'ManifestParser', 'Matcher', 'ProjectParser', 'Project', 'Settings', 'StatefulParser', 'StateMachine', 'Util']
|
# Division
print(5 / 8)
# Addition
print(7 + 10)
|
print(5 / 8)
print(7 + 10)
|
# import os
# import pytest
def pytest_runtest_setup(item):
pass
"""
if "1" != os.environ.get("PKG_NSF_FACTORY_INSTALL_IN_ENV"):
pytest.skip(
"Should be run only from build environement. "
"See `PKG_NSF_FACTORY_INSTALL_IN_ENV`.")
"""
|
def pytest_runtest_setup(item):
pass
'\n if "1" != os.environ.get("PKG_NSF_FACTORY_INSTALL_IN_ENV"):\n pytest.skip(\n "Should be run only from build environement. "\n "See `PKG_NSF_FACTORY_INSTALL_IN_ENV`.")\n '
|
# Password validation
# https://docs.djangoproject.com/en/2.0/ref/settings/#auth-password-validators
AUTH_USER_MODEL = 'users.User'
AUTHENTICATION_BACKENDS = [
'pg_rest_api.backends.PGBackend',
'django.contrib.auth.backends.ModelBackend'
]
AUTH_PASSWORD_VALIDATORS = [
{
'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
},
]
|
auth_user_model = 'users.User'
authentication_backends = ['pg_rest_api.backends.PGBackend', 'django.contrib.auth.backends.ModelBackend']
auth_password_validators = [{'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator'}, {'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator'}, {'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator'}, {'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator'}]
|
def get_fp_addsub(f):
return f["addpd"] + f["addsd"] + f["addss"] + f["addps"] + f["subpd"] + f["subsd"] + f["subss"] + f["subps"]
def get_fp_muldiv(f):
return f["mulpd"] + f["mulsd"] + f["mulss"] + f["mulps"] + f["divpd"] + f["divsd"] + f["divss"] + f["divps"]
|
def get_fp_addsub(f):
return f['addpd'] + f['addsd'] + f['addss'] + f['addps'] + f['subpd'] + f['subsd'] + f['subss'] + f['subps']
def get_fp_muldiv(f):
return f['mulpd'] + f['mulsd'] + f['mulss'] + f['mulps'] + f['divpd'] + f['divsd'] + f['divss'] + f['divps']
|
#!/usr/bin/python3
## author: jinchoiseoul@gmail.com
def parse_io(inp, out):
''' io means input/output for testcases;
It splitlines them and strip the elements
@param inp: multi-lined str
@param out: multi-lined str
@return (inp::[str], out::[str]) '''
inp = [i.strip() for i in inp.splitlines() if i.strip()]
out = [o.strip() for o in out.splitlines() if o.strip()]
return inp, out
def joiner(iterable, sep=' '):
''' @return e.g. [1, 2] -> "1 2" '''
return sep.join(map(str, iterable))
def strips(doc):
''' @return strip each line of doc '''
return '\n'.join(line.strip() for line in doc.splitlines())
def lstrips(doc):
''' @return lstrip each line of doc '''
return '\n'.join(line.lstrip() for line in doc.splitlines())
def rstrips(doc):
''' @return rstrip each line of doc '''
return '\n'.join(line.rstrip() for line in doc.splitlines())
|
def parse_io(inp, out):
""" io means input/output for testcases;
It splitlines them and strip the elements
@param inp: multi-lined str
@param out: multi-lined str
@return (inp::[str], out::[str]) """
inp = [i.strip() for i in inp.splitlines() if i.strip()]
out = [o.strip() for o in out.splitlines() if o.strip()]
return (inp, out)
def joiner(iterable, sep=' '):
""" @return e.g. [1, 2] -> "1 2" """
return sep.join(map(str, iterable))
def strips(doc):
""" @return strip each line of doc """
return '\n'.join((line.strip() for line in doc.splitlines()))
def lstrips(doc):
""" @return lstrip each line of doc """
return '\n'.join((line.lstrip() for line in doc.splitlines()))
def rstrips(doc):
""" @return rstrip each line of doc """
return '\n'.join((line.rstrip() for line in doc.splitlines()))
|
N = int(input())
A = [0]*N
for i in N:
A[i] = int(input())
|
n = int(input())
a = [0] * N
for i in N:
A[i] = int(input())
|
class BaseMeta(type):
def __new__(cls, name, bases, namespace):
return super().__new__(cls, name, bases, namespace)
class MyMeta(BaseMeta):
def __new__(cls, name, bases, namespace):
return super().__new__(cls, name, bases, namespace)
|
class Basemeta(type):
def __new__(cls, name, bases, namespace):
return super().__new__(cls, name, bases, namespace)
class Mymeta(BaseMeta):
def __new__(cls, name, bases, namespace):
return super().__new__(cls, name, bases, namespace)
|
f = open("Writetofile.txt", "a")
f.write("Lipika\n")
f.write("Ugain\n")
f.write("Shivam\n")
f.write("Sanjeev\n")
print("Data written to the file using append mode")
f.close()
|
f = open('Writetofile.txt', 'a')
f.write('Lipika\n')
f.write('Ugain\n')
f.write('Shivam\n')
f.write('Sanjeev\n')
print('Data written to the file using append mode')
f.close()
|
class Solution:
def findMaxConsecutiveOnes(self, nums):
"""
:type nums: List[int]
:rtype: int
"""
p1 = 0
p2 = 0
cnt = 0
ret = 0
zeros = 0
while p1 <= p2 and p1 < len(nums) and p2 < len(nums):
while zeros < 2 and p2 < len(nums):
if nums[p2] == 0:
zeros += 1
p2 += 1
if p2 >= len(nums):
if zeros == 2:
cnt = p2 - p1 - 1
else:
cnt = p2 - p1
ret = max(cnt, ret)
break
cnt = p2 - p1 - 1
ret = max(cnt, ret)
while zeros == 2:
if nums[p1] == 0:
zeros -= 1
p1 += 1
return ret
# last_zero = -1
# cur = 0
# ret = 0
# for i in range(len(nums)):
# if nums[i] == 1:
# cur += 1
# else:
# ret = max(ret, cur)
# cur = i - last_zero
# last_zero = i
# return max(ret, cur)
|
class Solution:
def find_max_consecutive_ones(self, nums):
"""
:type nums: List[int]
:rtype: int
"""
p1 = 0
p2 = 0
cnt = 0
ret = 0
zeros = 0
while p1 <= p2 and p1 < len(nums) and (p2 < len(nums)):
while zeros < 2 and p2 < len(nums):
if nums[p2] == 0:
zeros += 1
p2 += 1
if p2 >= len(nums):
if zeros == 2:
cnt = p2 - p1 - 1
else:
cnt = p2 - p1
ret = max(cnt, ret)
break
cnt = p2 - p1 - 1
ret = max(cnt, ret)
while zeros == 2:
if nums[p1] == 0:
zeros -= 1
p1 += 1
return ret
|
T = int(input())
def calc_op(l):
cnt = 0
for i in range(len(l)):
if l[i] % 2 == 0:
cnt += l[i]//2
else:
cnt += l[i]//2+1
return cnt
for _ in range(T):
N = int(input())
l = list(map(int, input().split()))[1:-1]
if len(l) == 1:
if l[0]%2 == 0:
print(calc_op(l))
else:
print(-1)
else:
is_2_over_exists = False
for i in l:
if i >= 2:
is_2_over_exists = True
break
if is_2_over_exists:
print(calc_op(l))
else:
print(-1)
|
t = int(input())
def calc_op(l):
cnt = 0
for i in range(len(l)):
if l[i] % 2 == 0:
cnt += l[i] // 2
else:
cnt += l[i] // 2 + 1
return cnt
for _ in range(T):
n = int(input())
l = list(map(int, input().split()))[1:-1]
if len(l) == 1:
if l[0] % 2 == 0:
print(calc_op(l))
else:
print(-1)
else:
is_2_over_exists = False
for i in l:
if i >= 2:
is_2_over_exists = True
break
if is_2_over_exists:
print(calc_op(l))
else:
print(-1)
|
'''
Represents a single filter on a column.
'''
class DrawRequestColumnFilter:
'''
Initialize the filter with the column name, filter text,
and operation (must be "=", "<=", ">=", "<", ">", or "!=").
'''
def __init__(self, column_name, filter_text, operation):
self.name = column_name
self.text = filter_text
self.operation = operation
def __repr__(self):
return "ColFilter(name=%s, text=%s, op=%s)" % (self.name, self.text, self.operation)
__str__ = __repr__
|
"""
Represents a single filter on a column.
"""
class Drawrequestcolumnfilter:
"""
Initialize the filter with the column name, filter text,
and operation (must be "=", "<=", ">=", "<", ">", or "!=").
"""
def __init__(self, column_name, filter_text, operation):
self.name = column_name
self.text = filter_text
self.operation = operation
def __repr__(self):
return 'ColFilter(name=%s, text=%s, op=%s)' % (self.name, self.text, self.operation)
__str__ = __repr__
|
# -*- coding: utf-8 -*-
__author__ = 'Jonathan Moore'
__email__ = 'firstnamelastnamephd@gmail.com'
__version__ = '0.1.0'
|
__author__ = 'Jonathan Moore'
__email__ = 'firstnamelastnamephd@gmail.com'
__version__ = '0.1.0'
|
# md5 : b27c56d844ab064547d40bf4f0a96eae
# sha1 : c314e447018b0d8711347ee26a5795480837b2d3
# sha256 : c045615fe1b44a6409610e4e94e70f1559325eb55ab1f805b0452e852771c0ae
ord_names = {
1: b'SQLAllocConnect',
2: b'SQLAllocEnv',
3: b'SQLAllocStmt',
4: b'SQLBindCol',
5: b'SQLCancel',
6: b'SQLColAttributes',
7: b'SQLConnect',
8: b'SQLDescribeCol',
9: b'SQLDisconnect',
10: b'SQLError',
11: b'SQLExecDirect',
12: b'SQLExecute',
13: b'SQLFetch',
14: b'SQLFreeConnect',
15: b'SQLFreeEnv',
16: b'SQLFreeStmt',
17: b'SQLGetCursorName',
18: b'SQLNumResultCols',
19: b'SQLPrepare',
20: b'SQLRowCount',
21: b'SQLSetCursorName',
22: b'SQLSetParam',
23: b'SQLTransact',
24: b'SQLAllocHandle',
25: b'SQLBindParam',
26: b'SQLCloseCursor',
27: b'SQLColAttribute',
28: b'SQLCopyDesc',
29: b'SQLEndTran',
30: b'SQLFetchScroll',
31: b'SQLFreeHandle',
32: b'SQLGetConnectAttr',
33: b'SQLGetDescField',
34: b'SQLGetDescRec',
35: b'SQLGetDiagField',
36: b'SQLGetDiagRec',
37: b'SQLGetEnvAttr',
38: b'SQLGetStmtAttr',
39: b'SQLSetConnectAttr',
40: b'SQLColumns',
41: b'SQLDriverConnect',
42: b'SQLGetConnectOption',
43: b'SQLGetData',
44: b'SQLGetFunctions',
45: b'SQLGetInfo',
46: b'SQLGetStmtOption',
47: b'SQLGetTypeInfo',
48: b'SQLParamData',
49: b'SQLPutData',
50: b'SQLSetConnectOption',
51: b'SQLSetStmtOption',
52: b'SQLSpecialColumns',
53: b'SQLStatistics',
54: b'SQLTables',
55: b'SQLBrowseConnect',
56: b'SQLColumnPrivileges',
57: b'SQLDataSources',
58: b'SQLDescribeParam',
59: b'SQLExtendedFetch',
60: b'SQLForeignKeys',
61: b'SQLMoreResults',
62: b'SQLNativeSql',
63: b'SQLNumParams',
64: b'SQLParamOptions',
65: b'SQLPrimaryKeys',
66: b'SQLProcedureColumns',
67: b'SQLProcedures',
68: b'SQLSetPos',
69: b'SQLSetScrollOptions',
70: b'SQLTablePrivileges',
71: b'SQLDrivers',
72: b'SQLBindParameter',
73: b'SQLSetDescField',
74: b'SQLSetDescRec',
75: b'SQLSetEnvAttr',
76: b'SQLSetStmtAttr',
77: b'SQLAllocHandleStd',
78: b'SQLBulkOperations',
79: b'CloseODBCPerfData',
80: b'CollectODBCPerfData',
81: b'CursorLibLockDbc',
82: b'CursorLibLockDesc',
83: b'CursorLibLockStmt',
84: b'ODBCGetTryWaitValue',
85: b'CursorLibTransact',
86: b'ODBCSetTryWaitValue',
87: b'DllBidEntryPoint',
88: b'GetODBCSharedData',
89: b'LockHandle',
90: b'ODBCInternalConnectW',
91: b'OpenODBCPerfData',
92: b'PostComponentError',
93: b'PostODBCComponentError',
94: b'PostODBCError',
95: b'SQLCancelHandle',
96: b'SQLCompleteAsync',
97: b'SearchStatusCode',
98: b'VFreeErrors',
99: b'VRetrieveDriverErrorsRowCol',
100: b'ValidateErrorQueue',
101: b'g_hHeapMalloc',
106: b'SQLColAttributesW',
107: b'SQLConnectW',
108: b'SQLDescribeColW',
110: b'SQLErrorW',
111: b'SQLExecDirectW',
117: b'SQLGetCursorNameW',
119: b'SQLPrepareW',
121: b'SQLSetCursorNameW',
127: b'SQLColAttributeW',
132: b'SQLGetConnectAttrW',
133: b'SQLGetDescFieldW',
134: b'SQLGetDescRecW',
135: b'SQLGetDiagFieldW',
136: b'SQLGetDiagRecW',
138: b'SQLGetStmtAttrW',
139: b'SQLSetConnectAttrW',
140: b'SQLColumnsW',
141: b'SQLDriverConnectW',
142: b'SQLGetConnectOptionW',
145: b'SQLGetInfoW',
147: b'SQLGetTypeInfoW',
150: b'SQLSetConnectOptionW',
152: b'SQLSpecialColumnsW',
153: b'SQLStatisticsW',
154: b'SQLTablesW',
155: b'SQLBrowseConnectW',
156: b'SQLColumnPrivilegesW',
157: b'SQLDataSourcesW',
160: b'SQLForeignKeysW',
162: b'SQLNativeSqlW',
165: b'SQLPrimaryKeysW',
166: b'SQLProcedureColumnsW',
167: b'SQLProceduresW',
170: b'SQLTablePrivilegesW',
171: b'SQLDriversW',
173: b'SQLSetDescFieldW',
176: b'SQLSetStmtAttrW',
206: b'SQLColAttributesA',
207: b'SQLConnectA',
208: b'SQLDescribeColA',
210: b'SQLErrorA',
211: b'SQLExecDirectA',
217: b'SQLGetCursorNameA',
219: b'SQLPrepareA',
221: b'SQLSetCursorNameA',
227: b'SQLColAttributeA',
232: b'SQLGetConnectAttrA',
233: b'SQLGetDescFieldA',
234: b'SQLGetDescRecA',
235: b'SQLGetDiagFieldA',
236: b'SQLGetDiagRecA',
238: b'SQLGetStmtAttrA',
239: b'SQLSetConnectAttrA',
240: b'SQLColumnsA',
241: b'SQLDriverConnectA',
242: b'SQLGetConnectOptionA',
245: b'SQLGetInfoA',
247: b'SQLGetTypeInfoA',
250: b'SQLSetConnectOptionA',
252: b'SQLSpecialColumnsA',
253: b'SQLStatisticsA',
254: b'SQLTablesA',
255: b'SQLBrowseConnectA',
256: b'SQLColumnPrivilegesA',
257: b'SQLDataSourcesA',
260: b'SQLForeignKeysA',
262: b'SQLNativeSqlA',
265: b'SQLPrimaryKeysA',
266: b'SQLProcedureColumnsA',
267: b'SQLProceduresA',
270: b'SQLTablePrivilegesA',
271: b'SQLDriversA',
273: b'SQLSetDescFieldA',
276: b'SQLSetStmtAttrA',
301: b'ODBCQualifyFileDSNW',
}
|
ord_names = {1: b'SQLAllocConnect', 2: b'SQLAllocEnv', 3: b'SQLAllocStmt', 4: b'SQLBindCol', 5: b'SQLCancel', 6: b'SQLColAttributes', 7: b'SQLConnect', 8: b'SQLDescribeCol', 9: b'SQLDisconnect', 10: b'SQLError', 11: b'SQLExecDirect', 12: b'SQLExecute', 13: b'SQLFetch', 14: b'SQLFreeConnect', 15: b'SQLFreeEnv', 16: b'SQLFreeStmt', 17: b'SQLGetCursorName', 18: b'SQLNumResultCols', 19: b'SQLPrepare', 20: b'SQLRowCount', 21: b'SQLSetCursorName', 22: b'SQLSetParam', 23: b'SQLTransact', 24: b'SQLAllocHandle', 25: b'SQLBindParam', 26: b'SQLCloseCursor', 27: b'SQLColAttribute', 28: b'SQLCopyDesc', 29: b'SQLEndTran', 30: b'SQLFetchScroll', 31: b'SQLFreeHandle', 32: b'SQLGetConnectAttr', 33: b'SQLGetDescField', 34: b'SQLGetDescRec', 35: b'SQLGetDiagField', 36: b'SQLGetDiagRec', 37: b'SQLGetEnvAttr', 38: b'SQLGetStmtAttr', 39: b'SQLSetConnectAttr', 40: b'SQLColumns', 41: b'SQLDriverConnect', 42: b'SQLGetConnectOption', 43: b'SQLGetData', 44: b'SQLGetFunctions', 45: b'SQLGetInfo', 46: b'SQLGetStmtOption', 47: b'SQLGetTypeInfo', 48: b'SQLParamData', 49: b'SQLPutData', 50: b'SQLSetConnectOption', 51: b'SQLSetStmtOption', 52: b'SQLSpecialColumns', 53: b'SQLStatistics', 54: b'SQLTables', 55: b'SQLBrowseConnect', 56: b'SQLColumnPrivileges', 57: b'SQLDataSources', 58: b'SQLDescribeParam', 59: b'SQLExtendedFetch', 60: b'SQLForeignKeys', 61: b'SQLMoreResults', 62: b'SQLNativeSql', 63: b'SQLNumParams', 64: b'SQLParamOptions', 65: b'SQLPrimaryKeys', 66: b'SQLProcedureColumns', 67: b'SQLProcedures', 68: b'SQLSetPos', 69: b'SQLSetScrollOptions', 70: b'SQLTablePrivileges', 71: b'SQLDrivers', 72: b'SQLBindParameter', 73: b'SQLSetDescField', 74: b'SQLSetDescRec', 75: b'SQLSetEnvAttr', 76: b'SQLSetStmtAttr', 77: b'SQLAllocHandleStd', 78: b'SQLBulkOperations', 79: b'CloseODBCPerfData', 80: b'CollectODBCPerfData', 81: b'CursorLibLockDbc', 82: b'CursorLibLockDesc', 83: b'CursorLibLockStmt', 84: b'ODBCGetTryWaitValue', 85: b'CursorLibTransact', 86: b'ODBCSetTryWaitValue', 87: b'DllBidEntryPoint', 88: b'GetODBCSharedData', 89: b'LockHandle', 90: b'ODBCInternalConnectW', 91: b'OpenODBCPerfData', 92: b'PostComponentError', 93: b'PostODBCComponentError', 94: b'PostODBCError', 95: b'SQLCancelHandle', 96: b'SQLCompleteAsync', 97: b'SearchStatusCode', 98: b'VFreeErrors', 99: b'VRetrieveDriverErrorsRowCol', 100: b'ValidateErrorQueue', 101: b'g_hHeapMalloc', 106: b'SQLColAttributesW', 107: b'SQLConnectW', 108: b'SQLDescribeColW', 110: b'SQLErrorW', 111: b'SQLExecDirectW', 117: b'SQLGetCursorNameW', 119: b'SQLPrepareW', 121: b'SQLSetCursorNameW', 127: b'SQLColAttributeW', 132: b'SQLGetConnectAttrW', 133: b'SQLGetDescFieldW', 134: b'SQLGetDescRecW', 135: b'SQLGetDiagFieldW', 136: b'SQLGetDiagRecW', 138: b'SQLGetStmtAttrW', 139: b'SQLSetConnectAttrW', 140: b'SQLColumnsW', 141: b'SQLDriverConnectW', 142: b'SQLGetConnectOptionW', 145: b'SQLGetInfoW', 147: b'SQLGetTypeInfoW', 150: b'SQLSetConnectOptionW', 152: b'SQLSpecialColumnsW', 153: b'SQLStatisticsW', 154: b'SQLTablesW', 155: b'SQLBrowseConnectW', 156: b'SQLColumnPrivilegesW', 157: b'SQLDataSourcesW', 160: b'SQLForeignKeysW', 162: b'SQLNativeSqlW', 165: b'SQLPrimaryKeysW', 166: b'SQLProcedureColumnsW', 167: b'SQLProceduresW', 170: b'SQLTablePrivilegesW', 171: b'SQLDriversW', 173: b'SQLSetDescFieldW', 176: b'SQLSetStmtAttrW', 206: b'SQLColAttributesA', 207: b'SQLConnectA', 208: b'SQLDescribeColA', 210: b'SQLErrorA', 211: b'SQLExecDirectA', 217: b'SQLGetCursorNameA', 219: b'SQLPrepareA', 221: b'SQLSetCursorNameA', 227: b'SQLColAttributeA', 232: b'SQLGetConnectAttrA', 233: b'SQLGetDescFieldA', 234: b'SQLGetDescRecA', 235: b'SQLGetDiagFieldA', 236: b'SQLGetDiagRecA', 238: b'SQLGetStmtAttrA', 239: b'SQLSetConnectAttrA', 240: b'SQLColumnsA', 241: b'SQLDriverConnectA', 242: b'SQLGetConnectOptionA', 245: b'SQLGetInfoA', 247: b'SQLGetTypeInfoA', 250: b'SQLSetConnectOptionA', 252: b'SQLSpecialColumnsA', 253: b'SQLStatisticsA', 254: b'SQLTablesA', 255: b'SQLBrowseConnectA', 256: b'SQLColumnPrivilegesA', 257: b'SQLDataSourcesA', 260: b'SQLForeignKeysA', 262: b'SQLNativeSqlA', 265: b'SQLPrimaryKeysA', 266: b'SQLProcedureColumnsA', 267: b'SQLProceduresA', 270: b'SQLTablePrivilegesA', 271: b'SQLDriversA', 273: b'SQLSetDescFieldA', 276: b'SQLSetStmtAttrA', 301: b'ODBCQualifyFileDSNW'}
|
"""Constants for Cloudflare."""
DOMAIN = "cloudflare"
# Config
CONF_RECORDS = "records"
# Defaults
DEFAULT_UPDATE_INTERVAL = 60 # in minutes
# Services
SERVICE_UPDATE_RECORDS = "update_records"
|
"""Constants for Cloudflare."""
domain = 'cloudflare'
conf_records = 'records'
default_update_interval = 60
service_update_records = 'update_records'
|
# part 1
def check_numbers(a,b):
print (a+b)
check_numbers(2,6)
# part 2
def check_numbers_list(a,b):
i=0
if len(a)==len(b):
while i<len(a):
check_numbers(a[i],b[i])
i +=1
else:
print ("lists ki len barabar nahi hai")
check_numbers_list([10,30,40],[40,20,21])
|
def check_numbers(a, b):
print(a + b)
check_numbers(2, 6)
def check_numbers_list(a, b):
i = 0
if len(a) == len(b):
while i < len(a):
check_numbers(a[i], b[i])
i += 1
else:
print('lists ki len barabar nahi hai')
check_numbers_list([10, 30, 40], [40, 20, 21])
|
num = int(input())
soma2 = 0
soma3 = 0
soma4 = 0
soma5 = 0
lista = [int(i) for i in input().split()]
for i in range(num):
if(lista[i] % 2 == 0):
soma2 = soma2 + 1
if(lista[i] % 3 == 0):
soma3 = soma3 + 1
if(lista[i] % 4 == 0):
soma4 = soma4 + 1
if(lista[i] % 5 == 0):
soma5 = soma5 + 1
print("{} Multiplo(s) de 2".format(soma2))
print("{} Multiplo(s) de 3".format(soma3))
print("{} Multiplo(s) de 4".format(soma4))
print("{} Multiplo(s) de 5".format(soma5))
|
num = int(input())
soma2 = 0
soma3 = 0
soma4 = 0
soma5 = 0
lista = [int(i) for i in input().split()]
for i in range(num):
if lista[i] % 2 == 0:
soma2 = soma2 + 1
if lista[i] % 3 == 0:
soma3 = soma3 + 1
if lista[i] % 4 == 0:
soma4 = soma4 + 1
if lista[i] % 5 == 0:
soma5 = soma5 + 1
print('{} Multiplo(s) de 2'.format(soma2))
print('{} Multiplo(s) de 3'.format(soma3))
print('{} Multiplo(s) de 4'.format(soma4))
print('{} Multiplo(s) de 5'.format(soma5))
|
def lambda_handler(event, context):
name = event.get("name")
if not name:
name = "person who does not want to give their name"
return { "hello": f"hello {name}"}
|
def lambda_handler(event, context):
name = event.get('name')
if not name:
name = 'person who does not want to give their name'
return {'hello': f'hello {name}'}
|
# print_squares_upto_limit(30)
# //For limit = 30, output would be 1 4 9 16 25
#
# print_cubes_upto_limit(30)
# //For limit = 30, output would be 1 8 27
def print_squares_upto_limit(limit):
i = 1
while i * i < limit:
print(i*i, end = " ")
i = i + 1
def print_cubes_upto_limit(limit):
i = 1
while i * i * i < limit:
print(i*i*i, end = " ")
i = i + 1
print_cubes_upto_limit(80)
|
def print_squares_upto_limit(limit):
i = 1
while i * i < limit:
print(i * i, end=' ')
i = i + 1
def print_cubes_upto_limit(limit):
i = 1
while i * i * i < limit:
print(i * i * i, end=' ')
i = i + 1
print_cubes_upto_limit(80)
|
#!/usr/bin/env python
print("test1 -- > 1")
print("test1 -- > 2")
print("test1 -- > 3")
|
print('test1 -- > 1')
print('test1 -- > 2')
print('test1 -- > 3')
|
MX_ROBOT_MAX_NB_ACCELEROMETERS = 1
MX_DEFAULT_ROBOT_IP = "192.168.0.100"
MX_ROBOT_TCP_PORT_CONTROL = 10000
MX_ROBOT_TCP_PORT_FEED = 10001
MX_ROBOT_UDP_PORT_TRACE = 10002
MX_ROBOT_UDP_PORT_RT_CTRL = 10003
MX_CHECKPOINT_ID_MIN = 1
MX_CHECKPOINT_ID_MAX = 8000
MX_ACCELEROMETER_UNIT_PER_G = 16000
MX_GRAVITY_MPS2 = 9.8067
MX_ACCELEROMETER_JOINT_M500 = 5
MX_EXT_TOOL_MPM500_NB_VALVES = 2
MX_EXT_TOOL_VBOX_MAX_VALVES = 6
MX_EIP_MAJOR_VERSION = 2
MX_EIP_MINOR_VERSION = 1
MX_NB_DYNAMIC_PDOS = 4
MX_ROBOT_MODEL_UNKNOWN = 0
MX_ROBOT_MODEL_M500_R1 = 1
MX_ROBOT_MODEL_M500_R2 = 2
MX_ROBOT_MODEL_M500_R3 = 3
MX_ROBOT_MODEL_M1000_R1 = 10
MX_ROBOT_MODEL_SCARA_R1 = 20
MX_EXT_TOOL_NONE = 0
MX_EXT_TOOL_MEGP25_SHORT = 1
MX_EXT_TOOL_MEGP25_LONG = 2
MX_EXT_TOOL_VBOX_2VALVES = 3
MX_EXT_TOOL_TYPE_INVALID = 0xFFFFFFFF
MX_EXT_TOOL_COMPLEMENTARY = 0
MX_EXT_TOOL_INDEPENDENT = 1
MX_EXT_TOOL_POSITION = 2
MX_EXT_TOOL_MODE_INVALID = 0xFFFFFFFF
MX_VALVE_STATE_STAY = -1
MX_VALVE_STATE_CLOSE = 0
MX_VALVE_STATE_OPEN = 1
MX_EVENT_SEVERITY_SILENT = 0
MX_EVENT_SEVERITY_WARNING = 1
MX_EVENT_SEVERITY_PAUSE_MOTION = 2
MX_EVENT_SEVERITY_CLEAR_MOTION = 3
MX_EVENT_SEVERITY_ERROR = 4
MX_EVENT_SEVERITY_INVALID = 0xFFFFFFFF
MX_TORQUE_LIMITS_DETECT_ALL = 0
MX_TORQUE_LIMITS_DETECT_SKIP_ACCEL = 1
MX_TORQUE_LIMITS_INVALID = 0xFFFFFFFF
MX_MOTION_CMD_TYPE_NO_MOVE = 0
MX_MOTION_CMD_TYPE_MOVEJOINTS = 1
MX_MOTION_CMD_TYPE_MOVEPOSE = 2
MX_MOTION_CMD_TYPE_MOVELIN = 3
MX_MOTION_CMD_TYPE_MOVELINRELTRF = 4
MX_MOTION_CMD_TYPE_MOVELINRELWRF = 5
MX_MOTION_CMD_TYPE_DELAY = 6
MX_MOTION_CMD_TYPE_SETBLENDING = 7
MX_MOTION_CMD_TYPE_SETJOINTVEL = 8
MX_MOTION_CMD_TYPE_SETJOINTACC = 9
MX_MOTION_CMD_TYPE_SETCARTANGVEL = 10
MX_MOTION_CMD_TYPE_SETCARTLINVEL = 11
MX_MOTION_CMD_TYPE_SETCARTACC = 12
MX_MOTION_CMD_TYPE_SETTRF = 13
MX_MOTION_CMD_TYPE_SETWRF = 14
MX_MOTION_CMD_TYPE_SETCONF = 15
MX_MOTION_CMD_TYPE_SETAUTOCONF = 16
MX_MOTION_CMD_TYPE_SETCHECKPOINT = 17
MX_MOTION_CMD_TYPE_GRIPPER = 18
MX_MOTION_CMD_TYPE_GRIPPERVEL = 19
MX_MOTION_CMD_TYPE_GRIPPERFORCE = 20
MX_MOTION_CMD_TYPE_MOVEJOINTSVEL = 21
MX_MOTION_CMD_TYPE_MOVELINVELWRF = 22
MX_MOTION_CMD_TYPE_MOVELINVELTRF = 23
MX_MOTION_CMD_TYPE_VELCTRLTIMEOUT = 24
MX_MOTION_CMD_TYPE_SETCONFTURN = 25
MX_MOTION_CMD_TYPE_SETAUTOCONFTURN = 26
MX_MOTION_CMD_TYPE_SETTORQUELIMITS = 27
MX_MOTION_CMD_TYPE_SETTORQUELIMITSCFG = 28
MX_MOTION_CMD_TYPE_MOVEJOINTSREL = 29
MX_MOTION_CMD_TYPE_SETVALVESTATE = 30
MX_MOTION_CMD_TYPE_START_OFFLINE_PROGRAM = 100
MX_MOTION_CMD_TYPE_SETDBG = 1000
MX_EIP_DYNAMIC_AUTO = 0
MX_EIP_DYNAMIC_CFG_FW_VERSION = 1
MX_EIP_DYNAMIC_CFG_PRODUCT_TYPE = 2
MX_EIP_DYNAMIC_CFG_ROBOT_SERIAL = 3
MX_EIP_DYNAMIC_CFG_JOINT_OFFSET = 4
MX_EIP_DYNAMIC_CFG_ROBOT_DH_MODEL_1 = 5
MX_EIP_DYNAMIC_CFG_ROBOT_DH_MODEL_2 = 6
MX_EIP_DYNAMIC_CFG_ROBOT_DH_MODEL_3 = 7
MX_EIP_DYNAMIC_CFG_ROBOT_DH_MODEL_4 = 8
MX_EIP_DYNAMIC_CFG_ROBOT_DH_MODEL_5 = 9
MX_EIP_DYNAMIC_CFG_ROBOT_DH_MODEL_6 = 10
MX_EIP_DYNAMIC_CFG_JOINT_LIMITS_CFG = 11
MX_EIP_DYNAMIC_CFG_MODEL_JOINT_LIMITS_1_2_3 = 12
MX_EIP_DYNAMIC_CFG_MODEL_JOINT_LIMITS_4_5_6 = 13
MX_EIP_DYNAMIC_CFG_JOINT_LIMITS_1_2_3 = 14
MX_EIP_DYNAMIC_CFG_JOINT_LIMITS_4_5_6 = 15
MX_EIP_DYNAMIC_MQ_CONF = 20
MX_EIP_DYNAMIC_MQ_PARAMS = 21
MX_EIP_DYNAMIC_MQ_VEL_ACCEL = 22
MX_EIP_DYNAMIC_MQ_GRIPPER_CFG = 23
MX_EIP_DYNAMIC_MQ_TORQUE_LIMITS_CFG = 24
MX_EIP_DYNAMIC_MQ_TORQUE_LIMITS = 25
MX_EIP_DYNAMIC_RT_TARGET_JOINT_POS = 30
MX_EIP_DYNAMIC_RT_TARGET_CART_POS = 31
MX_EIP_DYNAMIC_RT_TARGET_JOINT_VEL = 32
MX_EIP_DYNAMIC_RT_TARGET_JOINT_TORQ = 33
MX_EIP_DYNAMIC_RT_TARGET_CART_VEL = 34
MX_EIP_DYNAMIC_RT_TARGET_CONF = 35
MX_EIP_DYNAMIC_RT_JOINT_POS = 40
MX_EIP_DYNAMIC_RT_CART_POS = 41
MX_EIP_DYNAMIC_RT_JOINT_VEL = 42
MX_EIP_DYNAMIC_RT_JOINT_TORQ = 43
MX_EIP_DYNAMIC_RT_CART_VEL = 44
MX_EIP_DYNAMIC_RT_CONF = 45
MX_EIP_DYNAMIC_RT_ACCELEROMETER_5 = 46
MX_EIP_DYNAMIC_RT_WRF = 50
MX_EIP_DYNAMIC_RT_TRF = 51
MX_EIP_DYNAMIC_RT_EXTTOOL_STATUS = 52
MX_EIP_DYNAMIC_RT_GRIPPER_VALVE_STATE = 53
MX_EIP_DYNAMIC_FORCE_32_BITS = 0xFFFFFFFF
MX_ST_BUFFER_FULL = 1000
MX_ST_UNKNOWN_CMD = 1001
MX_ST_SYNTAX_ERR = 1002
MX_ST_ARG_ERR = 1003
MX_ST_NOT_ACTIVATED = 1005
MX_ST_NOT_HOMED = 1006
MX_ST_JOINT_OVER_LIMIT = 1007
MX_ST_VEL_OVER_LIMIT = 1008
MX_ST_ACCEL_OVER_LIMIT = 1009
MX_ST_BLOCKED_BY_180_DEG_PROT = 1010
MX_ST_ALREADY_ERR = 1011
MX_ST_SINGULARITY_ERR = 1012
MX_ST_ACTIVATION_ERR = 1013
MX_ST_HOMING_ERR = 1014
MX_ST_MASTER_ERR = 1015
MX_ST_OUT_OF_REACH = 1016
MX_ST_COMM_ERR = 1017
MX_ST_EOS_MISSING = 1018
MX_ST_ROBOT_NOT_LEVELED = 1019
MX_ST_BRAKES_ERR = 1020
MX_ST_DEACTIVATION_ERR = 1021
MX_ST_OFFLINE_SAVE_ERR = 1022
MX_ST_IGNORE_CMD_OFFLINE = 1023
MX_ST_MASTERING_NEEDED = 1024
MX_ST_IMPOSSIBLE_RESET_ERR = 1025
MX_ST_MUST_BE_DEACTIVATED = 1026
MX_ST_SIM_MUST_DEACTIVATED = 1027
MX_ST_NETWORK_ERR = 1028
MX_ST_OFFLINE_FULL = 1029
MX_ST_ALREADY_SAVING = 1030
MX_ST_ILLEGAL_WHILE_SAVING = 1031
MX_ST_GRIPPER_FORCE_OVER_LIMIT = 1035
MX_ST_GRIPPER_VEL_OVER_LIMIT = 1036
MX_ST_GRIPPER_RANGE_OVER_LIMIT = 1037
MX_ST_NO_GRIPPER = 1038
MX_ST_GRIPPER_TEMP_OVER_LIMIT = 1039
MX_ST_CMD_FAILED = 1040
MX_ST_NO_VBOX = 1041
MX_ST_ACTIVATED = 2000
MX_ST_ALREADY_ACTIVATED = 2001
MX_ST_HOME_DONE = 2002
MX_ST_HOME_ALREADY = 2003
MX_ST_DEACTIVATED = 2004
MX_ST_ERROR_RESET = 2005
MX_ST_NO_ERROR_RESET = 2006
MX_ST_GET_STATUS_ROBOT = 2007
MX_ST_BRAKES_OFF = 2008
MX_ST_MASTER_DONE = 2009
MX_ST_BRAKES_ON = 2010
MX_ST_GET_WRF = 2013
MX_ST_GET_TRF = 2014
MX_ST_SET_CART_VEL = 2020
MX_ST_SET_CART_ACC = 2021
MX_ST_SET_JOINT_VEL = 2022
MX_ST_SET_JOINT_ACC = 2023
MX_ST_SET_TOOL_DEF = 2024
MX_ST_SET_WRF = 2025
MX_ST_GET_JOINTS = 2026
MX_ST_GET_POSE = 2027
MX_ST_GET_AUTO_CONF = 2028
MX_ST_GET_CONF = 2029
MX_ST_GET_PHYS_CONF = 2030
MX_ST_GET_AUTO_CONF_TURN = 2031
MX_ST_SET_CORNERING = 2032
MX_ST_CLR_CORNERING = 2033
MX_ST_AUTOCONF_ON = 2034
MX_ST_AUTOCONF_OFF = 2035
MX_ST_GET_CONF_TURN = 2036
MX_ST_ACT_POS_FEED = 2038
MX_ST_DEACT_POS_FEED = 2039
MX_ST_ACT_JOINTS_FEED = 2040
MX_ST_DEACT_JOINTS_FEED = 2041
MX_ST_PAUSE_MOTION = 2042
MX_ST_RESUME_MOTION = 2043
MX_ST_CLEAR_MOTION = 2044
MX_ST_SIM_ON = 2045
MX_ST_SIM_OFF = 2046
MX_ST_EXTTOOL_SIM = 2047
MX_ST_EXTTOOL_SIM_OFF = 2048
MX_ST_RECOVERY_MODE_ON = 2049
MX_ST_RECOVERY_MODE_OFF = 2050
MX_ST_RECOVERY_VEL_CAP = 2051
MX_ST_EOM_ON = 2052
MX_ST_EOM_OFF = 2053
MX_ST_EOB_ON = 2054
MX_ST_EOB_OFF = 2055
MX_ST_START_SAVING = 2060
MX_ST_N_CMD_SAVED = 2061
MX_ST_OFFLINE_ALREADY_SAVING = 2062
MX_ST_OFFLINE_START = 2063
MX_ST_OFFLINE_LOOP_ON = 2064
MX_ST_OFFLINE_LOOP_OFF = 2065
MX_ST_START_PROGRAM_ARDY = 2066
MX_ST_SET_CART_DELTAREF_WRF = 2067
MX_ST_SET_CART_DELTAREF_TRF = 2068
MX_ST_ACTIVATION_IN_PROGRESS = 2070
MX_ST_HOMING_IN_PROGRESS = 2071
MX_ST_MASTER_IN_PROGRESS = 2072
MX_ST_GRIP_HOME = 2075
MX_ST_GRIP_ARD_HOME = 2076
MX_ST_SET_GRIP_FORCE = 2077
MX_ST_SET_GRIP_VEL = 2078
MX_ST_GET_STATUS_GRIPPER = 2079
MX_ST_GET_CMD_PENDING_COUNT = 2080
MX_ST_GET_FW_VERSION = 2081
MX_ST_GET_FW_VERSION_FULL = 2082
MX_ST_GET_ROBOT_SERIAL = 2083
MX_ST_GET_PRODUCT_TYPE = 2084
MX_ST_CMD_SUCCESSFUL = 2085
MX_ST_GET_JOINT_LIMITS = 2090
MX_ST_SET_JOINT_LIMITS = 2092
MX_ST_SET_JOINT_LIMITS_CFG = 2093
MX_ST_GET_JOINT_LIMITS_CFG = 2094
MX_ST_GET_ROBOT_NAME = 2095
MX_ST_SET_CTRL_PORT_MONIT = 2096
MX_ST_SYNC_CMD_QUEUE = 2097
MX_ST_JOINT_TORQUE = 2100
MX_ST_JOINT_SPEED = 2101
MX_ST_JOINT_POS = 2102
MX_ST_CART_POSE = 2103
MX_ST_TEMPERATURE = 2104
MX_ST_GET_ROBOT_KIN_MODEL = 2110
MX_ST_GET_ROBOT_DH_MODEL = 2111
MX_ST_GET_JOINT_OFFSET = 2112
MX_ST_GET_MODEL_JOINT_LIMITS = 2113
MX_ST_GET_MOTION_OPTIONS = 2115
MX_ST_GET_MONITORING_INTERVAL = 2116
MX_ST_GET_REAL_TIME_MONITORING = 2117
MX_ST_GET_STATUS_EVENTS = 2118
MX_ST_GET_NETWORK_OPTIONS = 2119
MX_ST_GET_RTC = 2140
MX_ST_GET_BLENDING = 2150
MX_ST_GET_VEL_TIMEOUT = 2151
MX_ST_GET_JOINT_VEL = 2152
MX_ST_GET_JOINT_ACC = 2153
MX_ST_GET_CART_LIN_VEL = 2154
MX_ST_GET_CART_ANG_VEL = 2155
MX_ST_GET_CART_ACC = 2156
MX_ST_GET_CHECKPOINT = 2157
MX_ST_GET_GRIPPER_FORCE = 2158
MX_ST_GET_GRIPPER_VEL = 2159
MX_ST_GET_TORQUE_LIMITS_CFG = 2160
MX_ST_GET_TORQUE_LIMITS = 2161
MX_ST_RT_TARGET_JOINT_POS = 2200
MX_ST_RT_TARGET_CART_POS = 2201
MX_ST_RT_TARGET_JOINT_VEL = 2202
MX_ST_RT_TARGET_JOINT_TORQ = 2203
MX_ST_RT_TARGET_CART_VEL = 2204
MX_ST_RT_TARGET_CONF = 2208
MX_ST_RT_TARGET_CONF_TURN = 2209
MX_ST_RT_JOINT_POS = 2210
MX_ST_RT_CART_POS = 2211
MX_ST_RT_JOINT_VEL = 2212
MX_ST_RT_JOINT_TORQ = 2213
MX_ST_RT_CART_VEL = 2214
MX_ST_RT_CONF = 2218
MX_ST_RT_CONF_TURN = 2219
MX_ST_RT_ACCELEROMETER = 2220
MX_ST_RT_CHECKPOINT = 2227
MX_ST_RT_WRF = 2228
MX_ST_RT_TRF = 2229
MX_ST_RT_CYCLE_END = 2230
MX_ST_RT_EXTTOOL_STATUS = 2300
MX_ST_RT_VALVE_STATE = 2310
MX_ST_RT_GRIPPER_STATE = 2320
MX_ST_RT_GRIPPER_FORCE = 2321
MX_ST_RT_GRIPPER_POS = 2322
MX_ST_CONNECTED = 3000
MX_ST_USER_ALREADY = 3001
MX_ST_UPGRADE_IN_PROGRESS = 3002
MX_ST_CMD_TOO_LONG = 3003
MX_ST_EOM = 3004
MX_ST_ERROR_MOTION = 3005
MX_ST_SEND_JOINT_RT = 3007
MX_ST_COLLISION = 3008
MX_ST_INIT_FAILED = 3009
MX_ST_SEND_POS_RT = 3010
MX_ST_CANNOT_MOVE = 3011
MX_ST_EOB = 3012
MX_ST_END_OFFLINE = 3013
MX_ST_CANT_SAVE_OFFLINE = 3014
MX_ST_OFFLINE_TIMEOUT = 3015
MX_ST_IGNORING_CMD = 3016
MX_ST_NO_OFFLINE_SAVED = 3017
MX_ST_OFFLINE_LOOP = 3018
MX_ST_JOGGING_STOPPED = 3019
MX_ST_ERROR_GRIPPER = 3025
MX_ST_MAINTENANCE_CHECK = 3026
MX_ST_INTERNAL_ERROR = 3027
MX_ST_EXCESSIVE_TRQ = 3028
MX_ST_CHECKPOINT_REACHED = 3030
MX_ST_TEXT_API_ERROR = 3031
MX_ST_PSTOP = 3032
MX_ST_NO_VALID_CFG = 3033
MX_ST_TRACE_LVL_CHANGED = 3034
MX_ST_TCP_DUMP_STARTED = 3035
MX_ST_TCP_DUMP_DONE = 3036
MX_ST_ERROR_VBOX = 3037
MX_ST_INVALID = 0xFFFFFFFF
class RobotStatusCodeInfo:
def __init__(self, code, name, is_error):
"""This class contains information bout a robot status codes above (ex: MX_ST_BUFFER_FULL)
Parameters
----------
code : integer
The integer value (ex: 1001)
name : string
The code name (ex: "MX_ST_BUFFER_FULL"
is_error : bool
True if this is an error code
"""
self.code = code
self.name = name
self.is_error = is_error
robot_status_code_info = {
MX_ST_BUFFER_FULL:
RobotStatusCodeInfo(MX_ST_BUFFER_FULL, "MX_ST_BUFFER_FULL", is_error=True),
MX_ST_UNKNOWN_CMD:
RobotStatusCodeInfo(MX_ST_UNKNOWN_CMD, "MX_ST_UNKNOWN_CMD", is_error=True),
MX_ST_SYNTAX_ERR:
RobotStatusCodeInfo(MX_ST_SYNTAX_ERR, "MX_ST_SYNTAX_ERR", is_error=True),
MX_ST_ARG_ERR:
RobotStatusCodeInfo(MX_ST_ARG_ERR, "MX_ST_ARG_ERR", is_error=True),
MX_ST_NOT_ACTIVATED:
RobotStatusCodeInfo(MX_ST_NOT_ACTIVATED, "MX_ST_NOT_ACTIVATED", is_error=True),
MX_ST_NOT_HOMED:
RobotStatusCodeInfo(MX_ST_NOT_HOMED, "MX_ST_NOT_HOMED", is_error=True),
MX_ST_JOINT_OVER_LIMIT:
RobotStatusCodeInfo(MX_ST_JOINT_OVER_LIMIT, "MX_ST_JOINT_OVER_LIMIT", is_error=True),
MX_ST_BLOCKED_BY_180_DEG_PROT:
RobotStatusCodeInfo(MX_ST_BLOCKED_BY_180_DEG_PROT, "MX_ST_BLOCKED_BY_180_DEG_PROT", is_error=True),
MX_ST_ALREADY_ERR:
RobotStatusCodeInfo(MX_ST_ALREADY_ERR, "MX_ST_ALREADY_ERR", is_error=True),
MX_ST_SINGULARITY_ERR:
RobotStatusCodeInfo(MX_ST_SINGULARITY_ERR, "MX_ST_SINGULARITY_ERR", is_error=True),
MX_ST_ACTIVATION_ERR:
RobotStatusCodeInfo(MX_ST_ACTIVATION_ERR, "MX_ST_ACTIVATION_ERR", is_error=True),
MX_ST_HOMING_ERR:
RobotStatusCodeInfo(MX_ST_HOMING_ERR, "MX_ST_HOMING_ERR", is_error=True),
MX_ST_MASTER_ERR:
RobotStatusCodeInfo(MX_ST_MASTER_ERR, "MX_ST_MASTER_ERR", is_error=True),
MX_ST_OUT_OF_REACH:
RobotStatusCodeInfo(MX_ST_OUT_OF_REACH, "MX_ST_OUT_OF_REACH", is_error=True),
MX_ST_OFFLINE_SAVE_ERR:
RobotStatusCodeInfo(MX_ST_OFFLINE_SAVE_ERR, "MX_ST_OFFLINE_SAVE_ERR", is_error=True),
MX_ST_IGNORE_CMD_OFFLINE:
RobotStatusCodeInfo(MX_ST_IGNORE_CMD_OFFLINE, "MX_ST_IGNORE_CMD_OFFLINE", is_error=True),
MX_ST_MASTERING_NEEDED:
RobotStatusCodeInfo(MX_ST_MASTERING_NEEDED, "MX_ST_MASTERING_NEEDED", is_error=True),
MX_ST_IMPOSSIBLE_RESET_ERR:
RobotStatusCodeInfo(MX_ST_IMPOSSIBLE_RESET_ERR, "MX_ST_IMPOSSIBLE_RESET_ERR", is_error=True),
MX_ST_MUST_BE_DEACTIVATED:
RobotStatusCodeInfo(MX_ST_MUST_BE_DEACTIVATED, "MX_ST_MUST_BE_DEACTIVATED", is_error=True),
MX_ST_SIM_MUST_DEACTIVATED:
RobotStatusCodeInfo(MX_ST_SIM_MUST_DEACTIVATED, "MX_ST_SIM_MUST_DEACTIVATED", is_error=True),
MX_ST_OFFLINE_FULL:
RobotStatusCodeInfo(MX_ST_OFFLINE_FULL, "MX_ST_OFFLINE_FULL", is_error=True),
MX_ST_ALREADY_SAVING:
RobotStatusCodeInfo(MX_ST_ALREADY_SAVING, "MX_ST_ALREADY_SAVING", is_error=True),
MX_ST_ILLEGAL_WHILE_SAVING:
RobotStatusCodeInfo(MX_ST_ILLEGAL_WHILE_SAVING, "MX_ST_ILLEGAL_WHILE_SAVING", is_error=True),
MX_ST_NO_GRIPPER:
RobotStatusCodeInfo(MX_ST_NO_GRIPPER, "MX_ST_NO_GRIPPER", is_error=True),
MX_ST_NO_VBOX:
RobotStatusCodeInfo(MX_ST_NO_VBOX, "MX_ST_NO_VBOX", is_error=True),
MX_ST_CMD_FAILED:
RobotStatusCodeInfo(MX_ST_CMD_FAILED, "MX_ST_CMD_FAILED", is_error=True),
MX_ST_ACTIVATED:
RobotStatusCodeInfo(MX_ST_ACTIVATED, "MX_ST_ACTIVATED", is_error=False),
MX_ST_ALREADY_ACTIVATED:
RobotStatusCodeInfo(MX_ST_ALREADY_ACTIVATED, "MX_ST_ALREADY_ACTIVATED", is_error=False),
MX_ST_HOME_DONE:
RobotStatusCodeInfo(MX_ST_HOME_DONE, "MX_ST_HOME_DONE", is_error=False),
MX_ST_HOME_ALREADY:
RobotStatusCodeInfo(MX_ST_HOME_ALREADY, "MX_ST_HOME_ALREADY", is_error=False),
MX_ST_DEACTIVATED:
RobotStatusCodeInfo(MX_ST_DEACTIVATED, "MX_ST_DEACTIVATED", is_error=False),
MX_ST_ERROR_RESET:
RobotStatusCodeInfo(MX_ST_ERROR_RESET, "MX_ST_ERROR_RESET", is_error=False),
MX_ST_NO_ERROR_RESET:
RobotStatusCodeInfo(MX_ST_NO_ERROR_RESET, "MX_ST_NO_ERROR_RESET", is_error=False),
MX_ST_GET_STATUS_ROBOT:
RobotStatusCodeInfo(MX_ST_GET_STATUS_ROBOT, "MX_ST_GET_STATUS_ROBOT", is_error=False),
MX_ST_BRAKES_OFF:
RobotStatusCodeInfo(MX_ST_BRAKES_OFF, "MX_ST_BRAKES_OFF", is_error=False),
MX_ST_MASTER_DONE:
RobotStatusCodeInfo(MX_ST_MASTER_DONE, "MX_ST_MASTER_DONE", is_error=False),
MX_ST_BRAKES_ON:
RobotStatusCodeInfo(MX_ST_BRAKES_ON, "MX_ST_BRAKES_ON", is_error=False),
MX_ST_GET_WRF:
RobotStatusCodeInfo(MX_ST_GET_WRF, "MX_ST_GET_WRF", is_error=False),
MX_ST_GET_TRF:
RobotStatusCodeInfo(MX_ST_GET_TRF, "MX_ST_GET_TRF", is_error=False),
MX_ST_GET_JOINTS:
RobotStatusCodeInfo(MX_ST_GET_JOINTS, "MX_ST_GET_JOINTS", is_error=False),
MX_ST_GET_POSE:
RobotStatusCodeInfo(MX_ST_GET_POSE, "MX_ST_GET_POSE", is_error=False),
MX_ST_GET_AUTO_CONF:
RobotStatusCodeInfo(MX_ST_GET_AUTO_CONF, "MX_ST_GET_AUTO_CONF", is_error=False),
MX_ST_GET_CONF:
RobotStatusCodeInfo(MX_ST_GET_CONF, "MX_ST_GET_CONF", is_error=False),
MX_ST_GET_AUTO_CONF_TURN:
RobotStatusCodeInfo(MX_ST_GET_AUTO_CONF_TURN, "MX_ST_GET_AUTO_CONF_TURN", is_error=False),
MX_ST_GET_CONF_TURN:
RobotStatusCodeInfo(MX_ST_GET_CONF_TURN, "MX_ST_GET_CONF_TURN", is_error=False),
MX_ST_PAUSE_MOTION:
RobotStatusCodeInfo(MX_ST_PAUSE_MOTION, "MX_ST_PAUSE_MOTION", is_error=False),
MX_ST_RESUME_MOTION:
RobotStatusCodeInfo(MX_ST_RESUME_MOTION, "MX_ST_RESUME_MOTION", is_error=False),
MX_ST_CLEAR_MOTION:
RobotStatusCodeInfo(MX_ST_CLEAR_MOTION, "MX_ST_CLEAR_MOTION", is_error=False),
MX_ST_SIM_ON:
RobotStatusCodeInfo(MX_ST_SIM_ON, "MX_ST_SIM_ON", is_error=False),
MX_ST_SIM_OFF:
RobotStatusCodeInfo(MX_ST_SIM_OFF, "MX_ST_SIM_OFF", is_error=False),
MX_ST_EXTTOOL_SIM:
RobotStatusCodeInfo(MX_ST_EXTTOOL_SIM, "MX_ST_EXTTOOL_SIM", is_error=False),
MX_ST_EOM_ON:
RobotStatusCodeInfo(MX_ST_EOM_ON, "MX_ST_EOM_ON", is_error=False),
MX_ST_EOM_OFF:
RobotStatusCodeInfo(MX_ST_EOM_OFF, "MX_ST_EOM_OFF", is_error=False),
MX_ST_EOB_ON:
RobotStatusCodeInfo(MX_ST_EOB_ON, "MX_ST_EOB_ON", is_error=False),
MX_ST_EOB_OFF:
RobotStatusCodeInfo(MX_ST_EOB_OFF, "MX_ST_EOB_OFF", is_error=False),
MX_ST_START_SAVING:
RobotStatusCodeInfo(MX_ST_START_SAVING, "MX_ST_START_SAVING", is_error=False),
MX_ST_N_CMD_SAVED:
RobotStatusCodeInfo(MX_ST_N_CMD_SAVED, "MX_ST_N_CMD_SAVED", is_error=False),
MX_ST_OFFLINE_START:
RobotStatusCodeInfo(MX_ST_OFFLINE_START, "MX_ST_OFFLINE_START", is_error=False),
MX_ST_OFFLINE_LOOP_ON:
RobotStatusCodeInfo(MX_ST_OFFLINE_LOOP_ON, "MX_ST_OFFLINE_LOOP_ON", is_error=False),
MX_ST_OFFLINE_LOOP_OFF:
RobotStatusCodeInfo(MX_ST_OFFLINE_LOOP_OFF, "MX_ST_OFFLINE_LOOP_OFF", is_error=False),
MX_ST_GET_STATUS_GRIPPER:
RobotStatusCodeInfo(MX_ST_GET_STATUS_GRIPPER, "MX_ST_GET_STATUS_GRIPPER", is_error=False),
MX_ST_GET_CMD_PENDING_COUNT:
RobotStatusCodeInfo(MX_ST_GET_CMD_PENDING_COUNT, "MX_ST_GET_CMD_PENDING_COUNT", is_error=False),
MX_ST_GET_FW_VERSION:
RobotStatusCodeInfo(MX_ST_GET_FW_VERSION, "MX_ST_GET_FW_VERSION", is_error=False),
MX_ST_GET_FW_VERSION_FULL:
RobotStatusCodeInfo(MX_ST_GET_FW_VERSION_FULL, "MX_ST_GET_FW_VERSION_FULL", is_error=False),
MX_ST_GET_ROBOT_SERIAL:
RobotStatusCodeInfo(MX_ST_GET_ROBOT_SERIAL, "MX_ST_GET_ROBOT_SERIAL", is_error=False),
MX_ST_GET_PRODUCT_TYPE:
RobotStatusCodeInfo(MX_ST_GET_PRODUCT_TYPE, "MX_ST_GET_PRODUCT_TYPE", is_error=False),
MX_ST_CMD_SUCCESSFUL:
RobotStatusCodeInfo(MX_ST_CMD_SUCCESSFUL, "MX_ST_CMD_SUCCESSFUL", is_error=False),
MX_ST_SET_CTRL_PORT_MONIT:
RobotStatusCodeInfo(MX_ST_SET_CTRL_PORT_MONIT, "MX_ST_SET_CTRL_PORT_MONIT", is_error=False),
MX_ST_SYNC_CMD_QUEUE:
RobotStatusCodeInfo(MX_ST_SYNC_CMD_QUEUE, "MX_ST_SYNC_CMD_QUEUE", is_error=False),
MX_ST_GET_JOINT_LIMITS:
RobotStatusCodeInfo(MX_ST_GET_JOINT_LIMITS, "MX_ST_GET_JOINT_LIMITS", is_error=False),
MX_ST_SET_JOINT_LIMITS:
RobotStatusCodeInfo(MX_ST_SET_JOINT_LIMITS, "MX_ST_SET_JOINT_LIMITS", is_error=False),
MX_ST_SET_JOINT_LIMITS_CFG:
RobotStatusCodeInfo(MX_ST_SET_JOINT_LIMITS_CFG, "MX_ST_SET_JOINT_LIMITS_CFG", is_error=False),
MX_ST_GET_JOINT_LIMITS_CFG:
RobotStatusCodeInfo(MX_ST_GET_JOINT_LIMITS_CFG, "MX_ST_GET_JOINT_LIMITS_CFG", is_error=False),
MX_ST_GET_ROBOT_NAME:
RobotStatusCodeInfo(MX_ST_GET_ROBOT_NAME, "MX_ST_GET_ROBOT_NAME", is_error=False),
MX_ST_GET_ROBOT_KIN_MODEL:
RobotStatusCodeInfo(MX_ST_GET_ROBOT_KIN_MODEL, "MX_ST_GET_ROBOT_KIN_MODEL", is_error=False),
MX_ST_GET_ROBOT_DH_MODEL:
RobotStatusCodeInfo(MX_ST_GET_ROBOT_DH_MODEL, "MX_ST_GET_ROBOT_DH_MODEL", is_error=False),
MX_ST_GET_JOINT_OFFSET:
RobotStatusCodeInfo(MX_ST_GET_JOINT_OFFSET, "MX_ST_GET_JOINT_OFFSET", is_error=False),
MX_ST_GET_MODEL_JOINT_LIMITS:
RobotStatusCodeInfo(MX_ST_GET_MODEL_JOINT_LIMITS, "MX_ST_GET_MODEL_JOINT_LIMITS", is_error=False),
MX_ST_GET_MOTION_OPTIONS:
RobotStatusCodeInfo(MX_ST_GET_MOTION_OPTIONS, "MX_ST_GET_MOTION_OPTIONS", is_error=False),
MX_ST_GET_MONITORING_INTERVAL:
RobotStatusCodeInfo(MX_ST_GET_MONITORING_INTERVAL, "MX_ST_GET_MONITORING_INTERVAL", is_error=False),
MX_ST_GET_REAL_TIME_MONITORING:
RobotStatusCodeInfo(MX_ST_GET_REAL_TIME_MONITORING, "MX_ST_GET_REAL_TIME_MONITORING", is_error=False),
MX_ST_GET_STATUS_EVENTS:
RobotStatusCodeInfo(MX_ST_GET_STATUS_EVENTS, "MX_ST_GET_STATUS_EVENTS", is_error=False),
MX_ST_GET_NETWORK_OPTIONS:
RobotStatusCodeInfo(MX_ST_GET_NETWORK_OPTIONS, "MX_ST_GET_NETWORK_OPTIONS", is_error=False),
MX_ST_GET_RTC:
RobotStatusCodeInfo(MX_ST_GET_RTC, "MX_ST_GET_RTC", is_error=False),
MX_ST_GET_BLENDING:
RobotStatusCodeInfo(MX_ST_GET_BLENDING, "MX_ST_GET_BLENDING", is_error=False),
MX_ST_GET_VEL_TIMEOUT:
RobotStatusCodeInfo(MX_ST_GET_VEL_TIMEOUT, "MX_ST_GET_VEL_TIMEOUT", is_error=False),
MX_ST_GET_JOINT_VEL:
RobotStatusCodeInfo(MX_ST_GET_JOINT_VEL, "MX_ST_GET_JOINT_VEL", is_error=False),
MX_ST_GET_JOINT_ACC:
RobotStatusCodeInfo(MX_ST_GET_JOINT_ACC, "MX_ST_GET_JOINT_ACC", is_error=False),
MX_ST_GET_CART_LIN_VEL:
RobotStatusCodeInfo(MX_ST_GET_CART_LIN_VEL, "MX_ST_GET_CART_LIN_VEL", is_error=False),
MX_ST_GET_CART_ANG_VEL:
RobotStatusCodeInfo(MX_ST_GET_CART_ANG_VEL, "MX_ST_GET_CART_ANG_VEL", is_error=False),
MX_ST_GET_CART_ACC:
RobotStatusCodeInfo(MX_ST_GET_CART_ACC, "MX_ST_GET_CART_ACC", is_error=False),
MX_ST_GET_CHECKPOINT:
RobotStatusCodeInfo(MX_ST_GET_CHECKPOINT, "MX_ST_GET_CHECKPOINT", is_error=False),
MX_ST_GET_GRIPPER_FORCE:
RobotStatusCodeInfo(MX_ST_GET_GRIPPER_FORCE, "MX_ST_GET_GRIPPER_FORCE", is_error=False),
MX_ST_GET_GRIPPER_VEL:
RobotStatusCodeInfo(MX_ST_GET_GRIPPER_VEL, "MX_ST_GET_GRIPPER_VEL", is_error=False),
MX_ST_GET_TORQUE_LIMITS_CFG:
RobotStatusCodeInfo(MX_ST_GET_TORQUE_LIMITS_CFG, "MX_ST_GET_TORQUE_LIMITS_CFG", is_error=False),
MX_ST_GET_TORQUE_LIMITS:
RobotStatusCodeInfo(MX_ST_GET_TORQUE_LIMITS, "MX_ST_GET_TORQUE_LIMITS", is_error=False),
MX_ST_RT_TARGET_JOINT_POS:
RobotStatusCodeInfo(MX_ST_RT_TARGET_JOINT_POS, "MX_ST_RT_TARGET_JOINT_POS", is_error=False),
MX_ST_RT_TARGET_CART_POS:
RobotStatusCodeInfo(MX_ST_RT_TARGET_CART_POS, "MX_ST_RT_TARGET_CART_POS", is_error=False),
MX_ST_RT_TARGET_JOINT_VEL:
RobotStatusCodeInfo(MX_ST_RT_TARGET_JOINT_VEL, "MX_ST_RT_TARGET_JOINT_VEL", is_error=False),
MX_ST_RT_TARGET_JOINT_TORQ:
RobotStatusCodeInfo(MX_ST_RT_TARGET_JOINT_TORQ, "MX_ST_RT_TARGET_JOINT_TORQ", is_error=False),
MX_ST_RT_TARGET_CART_VEL:
RobotStatusCodeInfo(MX_ST_RT_TARGET_CART_VEL, "MX_ST_RT_TARGET_CART_VEL", is_error=False),
MX_ST_RT_TARGET_CONF:
RobotStatusCodeInfo(MX_ST_RT_TARGET_CONF, "MX_ST_RT_TARGET_CONF", is_error=False),
MX_ST_RT_TARGET_CONF_TURN:
RobotStatusCodeInfo(MX_ST_RT_TARGET_CONF_TURN, "MX_ST_RT_TARGET_CONF_TURN", is_error=False),
MX_ST_RT_JOINT_POS:
RobotStatusCodeInfo(MX_ST_RT_JOINT_POS, "MX_ST_RT_JOINT_POS", is_error=False),
MX_ST_RT_CART_POS:
RobotStatusCodeInfo(MX_ST_RT_CART_POS, "MX_ST_RT_CART_POS", is_error=False),
MX_ST_RT_JOINT_VEL:
RobotStatusCodeInfo(MX_ST_RT_JOINT_VEL, "MX_ST_RT_JOINT_VEL", is_error=False),
MX_ST_RT_JOINT_TORQ:
RobotStatusCodeInfo(MX_ST_RT_JOINT_TORQ, "MX_ST_RT_JOINT_TORQ", is_error=False),
MX_ST_RT_CART_VEL:
RobotStatusCodeInfo(MX_ST_RT_CART_VEL, "MX_ST_RT_CART_VEL", is_error=False),
MX_ST_RT_CONF:
RobotStatusCodeInfo(MX_ST_RT_CONF, "MX_ST_RT_CONF", is_error=False),
MX_ST_RT_CONF_TURN:
RobotStatusCodeInfo(MX_ST_RT_CONF_TURN, "MX_ST_RT_CONF_TURN", is_error=False),
MX_ST_RT_ACCELEROMETER:
RobotStatusCodeInfo(MX_ST_RT_ACCELEROMETER, "MX_ST_RT_ACCELEROMETER", is_error=False),
MX_ST_RT_GRIPPER_FORCE:
RobotStatusCodeInfo(MX_ST_RT_GRIPPER_FORCE, "MX_ST_RT_GRIPPER_FORCE", is_error=False),
MX_ST_RT_EXTTOOL_STATUS:
RobotStatusCodeInfo(MX_ST_RT_EXTTOOL_STATUS, "MX_ST_RT_EXTTOOL_STATUS", is_error=False),
MX_ST_RT_GRIPPER_STATE:
RobotStatusCodeInfo(MX_ST_RT_GRIPPER_STATE, "MX_ST_RT_GRIPPER_STATE", is_error=False),
MX_ST_RT_VALVE_STATE:
RobotStatusCodeInfo(MX_ST_RT_VALVE_STATE, "MX_ST_RT_VALVE_STATE", is_error=False),
MX_ST_RT_CHECKPOINT:
RobotStatusCodeInfo(MX_ST_RT_CHECKPOINT, "MX_ST_RT_CHECKPOINT", is_error=False),
MX_ST_RT_WRF:
RobotStatusCodeInfo(MX_ST_RT_WRF, "MX_ST_RT_WRF", is_error=False),
MX_ST_RT_TRF:
RobotStatusCodeInfo(MX_ST_RT_TRF, "MX_ST_RT_TRF", is_error=False),
MX_ST_RT_CYCLE_END:
RobotStatusCodeInfo(MX_ST_RT_CYCLE_END, "MX_ST_RT_CYCLE_END", is_error=False),
MX_ST_CONNECTED:
RobotStatusCodeInfo(MX_ST_CONNECTED, "MX_ST_CONNECTED", is_error=False),
MX_ST_USER_ALREADY:
RobotStatusCodeInfo(MX_ST_USER_ALREADY, "MX_ST_USER_ALREADY", is_error=True),
MX_ST_UPGRADE_IN_PROGRESS:
RobotStatusCodeInfo(MX_ST_UPGRADE_IN_PROGRESS, "MX_ST_UPGRADE_IN_PROGRESS", is_error=False),
MX_ST_CMD_TOO_LONG:
RobotStatusCodeInfo(MX_ST_CMD_TOO_LONG, "MX_ST_CMD_TOO_LONG", is_error=True),
MX_ST_EOM:
RobotStatusCodeInfo(MX_ST_EOM, "MX_ST_EOM", is_error=False),
MX_ST_ERROR_MOTION:
RobotStatusCodeInfo(MX_ST_ERROR_MOTION, "MX_ST_ERROR_MOTION", is_error=True),
MX_ST_INIT_FAILED:
RobotStatusCodeInfo(MX_ST_INIT_FAILED, "MX_ST_INIT_FAILED", is_error=True),
MX_ST_EOB:
RobotStatusCodeInfo(MX_ST_EOB, "MX_ST_EOB", is_error=False),
MX_ST_END_OFFLINE:
RobotStatusCodeInfo(MX_ST_END_OFFLINE, "MX_ST_END_OFFLINE", is_error=False),
MX_ST_CANT_SAVE_OFFLINE:
RobotStatusCodeInfo(MX_ST_CANT_SAVE_OFFLINE, "MX_ST_CANT_SAVE_OFFLINE", is_error=True),
MX_ST_IGNORING_CMD:
RobotStatusCodeInfo(MX_ST_IGNORING_CMD, "MX_ST_IGNORING_CMD", is_error=True),
MX_ST_NO_OFFLINE_SAVED:
RobotStatusCodeInfo(MX_ST_NO_OFFLINE_SAVED, "MX_ST_NO_OFFLINE_SAVED", is_error=True),
MX_ST_OFFLINE_LOOP:
RobotStatusCodeInfo(MX_ST_OFFLINE_LOOP, "MX_ST_OFFLINE_LOOP", is_error=False),
MX_ST_ERROR_GRIPPER:
RobotStatusCodeInfo(MX_ST_ERROR_GRIPPER, "MX_ST_ERROR_GRIPPER", is_error=True),
MX_ST_ERROR_VBOX:
RobotStatusCodeInfo(MX_ST_ERROR_VBOX, "MX_ST_ERROR_VBOX", is_error=True),
MX_ST_MAINTENANCE_CHECK:
RobotStatusCodeInfo(MX_ST_MAINTENANCE_CHECK, "MX_ST_MAINTENANCE_CHECK", is_error=True),
MX_ST_INTERNAL_ERROR:
RobotStatusCodeInfo(MX_ST_INTERNAL_ERROR, "MX_ST_INTERNAL_ERROR", is_error=True),
MX_ST_EXCESSIVE_TRQ:
RobotStatusCodeInfo(MX_ST_EXCESSIVE_TRQ, "MX_ST_EXCESSIVE_TRQ", is_error=True),
MX_ST_CHECKPOINT_REACHED:
RobotStatusCodeInfo(MX_ST_CHECKPOINT_REACHED, "MX_ST_CHECKPOINT_REACHED", is_error=False),
MX_ST_TEXT_API_ERROR:
RobotStatusCodeInfo(MX_ST_TEXT_API_ERROR, "MX_ST_TEXT_API_ERROR", is_error=True),
MX_ST_PSTOP:
RobotStatusCodeInfo(MX_ST_PSTOP, "MX_ST_PSTOP", is_error=True),
MX_ST_NO_VALID_CFG:
RobotStatusCodeInfo(MX_ST_NO_VALID_CFG, "MX_ST_NO_VALID_CFG", is_error=True),
MX_ST_TRACE_LVL_CHANGED:
RobotStatusCodeInfo(MX_ST_TRACE_LVL_CHANGED, "MX_ST_TRACE_LVL_CHANGED", is_error=False),
MX_ST_TCP_DUMP_STARTED:
RobotStatusCodeInfo(MX_ST_TCP_DUMP_STARTED, "MX_ST_TCP_DUMP_STARTED", is_error=False),
MX_ST_TCP_DUMP_DONE:
RobotStatusCodeInfo(MX_ST_TCP_DUMP_DONE, "MX_ST_TCP_DUMP_DONE", is_error=False),
}
|
mx_robot_max_nb_accelerometers = 1
mx_default_robot_ip = '192.168.0.100'
mx_robot_tcp_port_control = 10000
mx_robot_tcp_port_feed = 10001
mx_robot_udp_port_trace = 10002
mx_robot_udp_port_rt_ctrl = 10003
mx_checkpoint_id_min = 1
mx_checkpoint_id_max = 8000
mx_accelerometer_unit_per_g = 16000
mx_gravity_mps2 = 9.8067
mx_accelerometer_joint_m500 = 5
mx_ext_tool_mpm500_nb_valves = 2
mx_ext_tool_vbox_max_valves = 6
mx_eip_major_version = 2
mx_eip_minor_version = 1
mx_nb_dynamic_pdos = 4
mx_robot_model_unknown = 0
mx_robot_model_m500_r1 = 1
mx_robot_model_m500_r2 = 2
mx_robot_model_m500_r3 = 3
mx_robot_model_m1000_r1 = 10
mx_robot_model_scara_r1 = 20
mx_ext_tool_none = 0
mx_ext_tool_megp25_short = 1
mx_ext_tool_megp25_long = 2
mx_ext_tool_vbox_2_valves = 3
mx_ext_tool_type_invalid = 4294967295
mx_ext_tool_complementary = 0
mx_ext_tool_independent = 1
mx_ext_tool_position = 2
mx_ext_tool_mode_invalid = 4294967295
mx_valve_state_stay = -1
mx_valve_state_close = 0
mx_valve_state_open = 1
mx_event_severity_silent = 0
mx_event_severity_warning = 1
mx_event_severity_pause_motion = 2
mx_event_severity_clear_motion = 3
mx_event_severity_error = 4
mx_event_severity_invalid = 4294967295
mx_torque_limits_detect_all = 0
mx_torque_limits_detect_skip_accel = 1
mx_torque_limits_invalid = 4294967295
mx_motion_cmd_type_no_move = 0
mx_motion_cmd_type_movejoints = 1
mx_motion_cmd_type_movepose = 2
mx_motion_cmd_type_movelin = 3
mx_motion_cmd_type_movelinreltrf = 4
mx_motion_cmd_type_movelinrelwrf = 5
mx_motion_cmd_type_delay = 6
mx_motion_cmd_type_setblending = 7
mx_motion_cmd_type_setjointvel = 8
mx_motion_cmd_type_setjointacc = 9
mx_motion_cmd_type_setcartangvel = 10
mx_motion_cmd_type_setcartlinvel = 11
mx_motion_cmd_type_setcartacc = 12
mx_motion_cmd_type_settrf = 13
mx_motion_cmd_type_setwrf = 14
mx_motion_cmd_type_setconf = 15
mx_motion_cmd_type_setautoconf = 16
mx_motion_cmd_type_setcheckpoint = 17
mx_motion_cmd_type_gripper = 18
mx_motion_cmd_type_grippervel = 19
mx_motion_cmd_type_gripperforce = 20
mx_motion_cmd_type_movejointsvel = 21
mx_motion_cmd_type_movelinvelwrf = 22
mx_motion_cmd_type_movelinveltrf = 23
mx_motion_cmd_type_velctrltimeout = 24
mx_motion_cmd_type_setconfturn = 25
mx_motion_cmd_type_setautoconfturn = 26
mx_motion_cmd_type_settorquelimits = 27
mx_motion_cmd_type_settorquelimitscfg = 28
mx_motion_cmd_type_movejointsrel = 29
mx_motion_cmd_type_setvalvestate = 30
mx_motion_cmd_type_start_offline_program = 100
mx_motion_cmd_type_setdbg = 1000
mx_eip_dynamic_auto = 0
mx_eip_dynamic_cfg_fw_version = 1
mx_eip_dynamic_cfg_product_type = 2
mx_eip_dynamic_cfg_robot_serial = 3
mx_eip_dynamic_cfg_joint_offset = 4
mx_eip_dynamic_cfg_robot_dh_model_1 = 5
mx_eip_dynamic_cfg_robot_dh_model_2 = 6
mx_eip_dynamic_cfg_robot_dh_model_3 = 7
mx_eip_dynamic_cfg_robot_dh_model_4 = 8
mx_eip_dynamic_cfg_robot_dh_model_5 = 9
mx_eip_dynamic_cfg_robot_dh_model_6 = 10
mx_eip_dynamic_cfg_joint_limits_cfg = 11
mx_eip_dynamic_cfg_model_joint_limits_1_2_3 = 12
mx_eip_dynamic_cfg_model_joint_limits_4_5_6 = 13
mx_eip_dynamic_cfg_joint_limits_1_2_3 = 14
mx_eip_dynamic_cfg_joint_limits_4_5_6 = 15
mx_eip_dynamic_mq_conf = 20
mx_eip_dynamic_mq_params = 21
mx_eip_dynamic_mq_vel_accel = 22
mx_eip_dynamic_mq_gripper_cfg = 23
mx_eip_dynamic_mq_torque_limits_cfg = 24
mx_eip_dynamic_mq_torque_limits = 25
mx_eip_dynamic_rt_target_joint_pos = 30
mx_eip_dynamic_rt_target_cart_pos = 31
mx_eip_dynamic_rt_target_joint_vel = 32
mx_eip_dynamic_rt_target_joint_torq = 33
mx_eip_dynamic_rt_target_cart_vel = 34
mx_eip_dynamic_rt_target_conf = 35
mx_eip_dynamic_rt_joint_pos = 40
mx_eip_dynamic_rt_cart_pos = 41
mx_eip_dynamic_rt_joint_vel = 42
mx_eip_dynamic_rt_joint_torq = 43
mx_eip_dynamic_rt_cart_vel = 44
mx_eip_dynamic_rt_conf = 45
mx_eip_dynamic_rt_accelerometer_5 = 46
mx_eip_dynamic_rt_wrf = 50
mx_eip_dynamic_rt_trf = 51
mx_eip_dynamic_rt_exttool_status = 52
mx_eip_dynamic_rt_gripper_valve_state = 53
mx_eip_dynamic_force_32_bits = 4294967295
mx_st_buffer_full = 1000
mx_st_unknown_cmd = 1001
mx_st_syntax_err = 1002
mx_st_arg_err = 1003
mx_st_not_activated = 1005
mx_st_not_homed = 1006
mx_st_joint_over_limit = 1007
mx_st_vel_over_limit = 1008
mx_st_accel_over_limit = 1009
mx_st_blocked_by_180_deg_prot = 1010
mx_st_already_err = 1011
mx_st_singularity_err = 1012
mx_st_activation_err = 1013
mx_st_homing_err = 1014
mx_st_master_err = 1015
mx_st_out_of_reach = 1016
mx_st_comm_err = 1017
mx_st_eos_missing = 1018
mx_st_robot_not_leveled = 1019
mx_st_brakes_err = 1020
mx_st_deactivation_err = 1021
mx_st_offline_save_err = 1022
mx_st_ignore_cmd_offline = 1023
mx_st_mastering_needed = 1024
mx_st_impossible_reset_err = 1025
mx_st_must_be_deactivated = 1026
mx_st_sim_must_deactivated = 1027
mx_st_network_err = 1028
mx_st_offline_full = 1029
mx_st_already_saving = 1030
mx_st_illegal_while_saving = 1031
mx_st_gripper_force_over_limit = 1035
mx_st_gripper_vel_over_limit = 1036
mx_st_gripper_range_over_limit = 1037
mx_st_no_gripper = 1038
mx_st_gripper_temp_over_limit = 1039
mx_st_cmd_failed = 1040
mx_st_no_vbox = 1041
mx_st_activated = 2000
mx_st_already_activated = 2001
mx_st_home_done = 2002
mx_st_home_already = 2003
mx_st_deactivated = 2004
mx_st_error_reset = 2005
mx_st_no_error_reset = 2006
mx_st_get_status_robot = 2007
mx_st_brakes_off = 2008
mx_st_master_done = 2009
mx_st_brakes_on = 2010
mx_st_get_wrf = 2013
mx_st_get_trf = 2014
mx_st_set_cart_vel = 2020
mx_st_set_cart_acc = 2021
mx_st_set_joint_vel = 2022
mx_st_set_joint_acc = 2023
mx_st_set_tool_def = 2024
mx_st_set_wrf = 2025
mx_st_get_joints = 2026
mx_st_get_pose = 2027
mx_st_get_auto_conf = 2028
mx_st_get_conf = 2029
mx_st_get_phys_conf = 2030
mx_st_get_auto_conf_turn = 2031
mx_st_set_cornering = 2032
mx_st_clr_cornering = 2033
mx_st_autoconf_on = 2034
mx_st_autoconf_off = 2035
mx_st_get_conf_turn = 2036
mx_st_act_pos_feed = 2038
mx_st_deact_pos_feed = 2039
mx_st_act_joints_feed = 2040
mx_st_deact_joints_feed = 2041
mx_st_pause_motion = 2042
mx_st_resume_motion = 2043
mx_st_clear_motion = 2044
mx_st_sim_on = 2045
mx_st_sim_off = 2046
mx_st_exttool_sim = 2047
mx_st_exttool_sim_off = 2048
mx_st_recovery_mode_on = 2049
mx_st_recovery_mode_off = 2050
mx_st_recovery_vel_cap = 2051
mx_st_eom_on = 2052
mx_st_eom_off = 2053
mx_st_eob_on = 2054
mx_st_eob_off = 2055
mx_st_start_saving = 2060
mx_st_n_cmd_saved = 2061
mx_st_offline_already_saving = 2062
mx_st_offline_start = 2063
mx_st_offline_loop_on = 2064
mx_st_offline_loop_off = 2065
mx_st_start_program_ardy = 2066
mx_st_set_cart_deltaref_wrf = 2067
mx_st_set_cart_deltaref_trf = 2068
mx_st_activation_in_progress = 2070
mx_st_homing_in_progress = 2071
mx_st_master_in_progress = 2072
mx_st_grip_home = 2075
mx_st_grip_ard_home = 2076
mx_st_set_grip_force = 2077
mx_st_set_grip_vel = 2078
mx_st_get_status_gripper = 2079
mx_st_get_cmd_pending_count = 2080
mx_st_get_fw_version = 2081
mx_st_get_fw_version_full = 2082
mx_st_get_robot_serial = 2083
mx_st_get_product_type = 2084
mx_st_cmd_successful = 2085
mx_st_get_joint_limits = 2090
mx_st_set_joint_limits = 2092
mx_st_set_joint_limits_cfg = 2093
mx_st_get_joint_limits_cfg = 2094
mx_st_get_robot_name = 2095
mx_st_set_ctrl_port_monit = 2096
mx_st_sync_cmd_queue = 2097
mx_st_joint_torque = 2100
mx_st_joint_speed = 2101
mx_st_joint_pos = 2102
mx_st_cart_pose = 2103
mx_st_temperature = 2104
mx_st_get_robot_kin_model = 2110
mx_st_get_robot_dh_model = 2111
mx_st_get_joint_offset = 2112
mx_st_get_model_joint_limits = 2113
mx_st_get_motion_options = 2115
mx_st_get_monitoring_interval = 2116
mx_st_get_real_time_monitoring = 2117
mx_st_get_status_events = 2118
mx_st_get_network_options = 2119
mx_st_get_rtc = 2140
mx_st_get_blending = 2150
mx_st_get_vel_timeout = 2151
mx_st_get_joint_vel = 2152
mx_st_get_joint_acc = 2153
mx_st_get_cart_lin_vel = 2154
mx_st_get_cart_ang_vel = 2155
mx_st_get_cart_acc = 2156
mx_st_get_checkpoint = 2157
mx_st_get_gripper_force = 2158
mx_st_get_gripper_vel = 2159
mx_st_get_torque_limits_cfg = 2160
mx_st_get_torque_limits = 2161
mx_st_rt_target_joint_pos = 2200
mx_st_rt_target_cart_pos = 2201
mx_st_rt_target_joint_vel = 2202
mx_st_rt_target_joint_torq = 2203
mx_st_rt_target_cart_vel = 2204
mx_st_rt_target_conf = 2208
mx_st_rt_target_conf_turn = 2209
mx_st_rt_joint_pos = 2210
mx_st_rt_cart_pos = 2211
mx_st_rt_joint_vel = 2212
mx_st_rt_joint_torq = 2213
mx_st_rt_cart_vel = 2214
mx_st_rt_conf = 2218
mx_st_rt_conf_turn = 2219
mx_st_rt_accelerometer = 2220
mx_st_rt_checkpoint = 2227
mx_st_rt_wrf = 2228
mx_st_rt_trf = 2229
mx_st_rt_cycle_end = 2230
mx_st_rt_exttool_status = 2300
mx_st_rt_valve_state = 2310
mx_st_rt_gripper_state = 2320
mx_st_rt_gripper_force = 2321
mx_st_rt_gripper_pos = 2322
mx_st_connected = 3000
mx_st_user_already = 3001
mx_st_upgrade_in_progress = 3002
mx_st_cmd_too_long = 3003
mx_st_eom = 3004
mx_st_error_motion = 3005
mx_st_send_joint_rt = 3007
mx_st_collision = 3008
mx_st_init_failed = 3009
mx_st_send_pos_rt = 3010
mx_st_cannot_move = 3011
mx_st_eob = 3012
mx_st_end_offline = 3013
mx_st_cant_save_offline = 3014
mx_st_offline_timeout = 3015
mx_st_ignoring_cmd = 3016
mx_st_no_offline_saved = 3017
mx_st_offline_loop = 3018
mx_st_jogging_stopped = 3019
mx_st_error_gripper = 3025
mx_st_maintenance_check = 3026
mx_st_internal_error = 3027
mx_st_excessive_trq = 3028
mx_st_checkpoint_reached = 3030
mx_st_text_api_error = 3031
mx_st_pstop = 3032
mx_st_no_valid_cfg = 3033
mx_st_trace_lvl_changed = 3034
mx_st_tcp_dump_started = 3035
mx_st_tcp_dump_done = 3036
mx_st_error_vbox = 3037
mx_st_invalid = 4294967295
class Robotstatuscodeinfo:
def __init__(self, code, name, is_error):
"""This class contains information bout a robot status codes above (ex: MX_ST_BUFFER_FULL)
Parameters
----------
code : integer
The integer value (ex: 1001)
name : string
The code name (ex: "MX_ST_BUFFER_FULL"
is_error : bool
True if this is an error code
"""
self.code = code
self.name = name
self.is_error = is_error
robot_status_code_info = {MX_ST_BUFFER_FULL: robot_status_code_info(MX_ST_BUFFER_FULL, 'MX_ST_BUFFER_FULL', is_error=True), MX_ST_UNKNOWN_CMD: robot_status_code_info(MX_ST_UNKNOWN_CMD, 'MX_ST_UNKNOWN_CMD', is_error=True), MX_ST_SYNTAX_ERR: robot_status_code_info(MX_ST_SYNTAX_ERR, 'MX_ST_SYNTAX_ERR', is_error=True), MX_ST_ARG_ERR: robot_status_code_info(MX_ST_ARG_ERR, 'MX_ST_ARG_ERR', is_error=True), MX_ST_NOT_ACTIVATED: robot_status_code_info(MX_ST_NOT_ACTIVATED, 'MX_ST_NOT_ACTIVATED', is_error=True), MX_ST_NOT_HOMED: robot_status_code_info(MX_ST_NOT_HOMED, 'MX_ST_NOT_HOMED', is_error=True), MX_ST_JOINT_OVER_LIMIT: robot_status_code_info(MX_ST_JOINT_OVER_LIMIT, 'MX_ST_JOINT_OVER_LIMIT', is_error=True), MX_ST_BLOCKED_BY_180_DEG_PROT: robot_status_code_info(MX_ST_BLOCKED_BY_180_DEG_PROT, 'MX_ST_BLOCKED_BY_180_DEG_PROT', is_error=True), MX_ST_ALREADY_ERR: robot_status_code_info(MX_ST_ALREADY_ERR, 'MX_ST_ALREADY_ERR', is_error=True), MX_ST_SINGULARITY_ERR: robot_status_code_info(MX_ST_SINGULARITY_ERR, 'MX_ST_SINGULARITY_ERR', is_error=True), MX_ST_ACTIVATION_ERR: robot_status_code_info(MX_ST_ACTIVATION_ERR, 'MX_ST_ACTIVATION_ERR', is_error=True), MX_ST_HOMING_ERR: robot_status_code_info(MX_ST_HOMING_ERR, 'MX_ST_HOMING_ERR', is_error=True), MX_ST_MASTER_ERR: robot_status_code_info(MX_ST_MASTER_ERR, 'MX_ST_MASTER_ERR', is_error=True), MX_ST_OUT_OF_REACH: robot_status_code_info(MX_ST_OUT_OF_REACH, 'MX_ST_OUT_OF_REACH', is_error=True), MX_ST_OFFLINE_SAVE_ERR: robot_status_code_info(MX_ST_OFFLINE_SAVE_ERR, 'MX_ST_OFFLINE_SAVE_ERR', is_error=True), MX_ST_IGNORE_CMD_OFFLINE: robot_status_code_info(MX_ST_IGNORE_CMD_OFFLINE, 'MX_ST_IGNORE_CMD_OFFLINE', is_error=True), MX_ST_MASTERING_NEEDED: robot_status_code_info(MX_ST_MASTERING_NEEDED, 'MX_ST_MASTERING_NEEDED', is_error=True), MX_ST_IMPOSSIBLE_RESET_ERR: robot_status_code_info(MX_ST_IMPOSSIBLE_RESET_ERR, 'MX_ST_IMPOSSIBLE_RESET_ERR', is_error=True), MX_ST_MUST_BE_DEACTIVATED: robot_status_code_info(MX_ST_MUST_BE_DEACTIVATED, 'MX_ST_MUST_BE_DEACTIVATED', is_error=True), MX_ST_SIM_MUST_DEACTIVATED: robot_status_code_info(MX_ST_SIM_MUST_DEACTIVATED, 'MX_ST_SIM_MUST_DEACTIVATED', is_error=True), MX_ST_OFFLINE_FULL: robot_status_code_info(MX_ST_OFFLINE_FULL, 'MX_ST_OFFLINE_FULL', is_error=True), MX_ST_ALREADY_SAVING: robot_status_code_info(MX_ST_ALREADY_SAVING, 'MX_ST_ALREADY_SAVING', is_error=True), MX_ST_ILLEGAL_WHILE_SAVING: robot_status_code_info(MX_ST_ILLEGAL_WHILE_SAVING, 'MX_ST_ILLEGAL_WHILE_SAVING', is_error=True), MX_ST_NO_GRIPPER: robot_status_code_info(MX_ST_NO_GRIPPER, 'MX_ST_NO_GRIPPER', is_error=True), MX_ST_NO_VBOX: robot_status_code_info(MX_ST_NO_VBOX, 'MX_ST_NO_VBOX', is_error=True), MX_ST_CMD_FAILED: robot_status_code_info(MX_ST_CMD_FAILED, 'MX_ST_CMD_FAILED', is_error=True), MX_ST_ACTIVATED: robot_status_code_info(MX_ST_ACTIVATED, 'MX_ST_ACTIVATED', is_error=False), MX_ST_ALREADY_ACTIVATED: robot_status_code_info(MX_ST_ALREADY_ACTIVATED, 'MX_ST_ALREADY_ACTIVATED', is_error=False), MX_ST_HOME_DONE: robot_status_code_info(MX_ST_HOME_DONE, 'MX_ST_HOME_DONE', is_error=False), MX_ST_HOME_ALREADY: robot_status_code_info(MX_ST_HOME_ALREADY, 'MX_ST_HOME_ALREADY', is_error=False), MX_ST_DEACTIVATED: robot_status_code_info(MX_ST_DEACTIVATED, 'MX_ST_DEACTIVATED', is_error=False), MX_ST_ERROR_RESET: robot_status_code_info(MX_ST_ERROR_RESET, 'MX_ST_ERROR_RESET', is_error=False), MX_ST_NO_ERROR_RESET: robot_status_code_info(MX_ST_NO_ERROR_RESET, 'MX_ST_NO_ERROR_RESET', is_error=False), MX_ST_GET_STATUS_ROBOT: robot_status_code_info(MX_ST_GET_STATUS_ROBOT, 'MX_ST_GET_STATUS_ROBOT', is_error=False), MX_ST_BRAKES_OFF: robot_status_code_info(MX_ST_BRAKES_OFF, 'MX_ST_BRAKES_OFF', is_error=False), MX_ST_MASTER_DONE: robot_status_code_info(MX_ST_MASTER_DONE, 'MX_ST_MASTER_DONE', is_error=False), MX_ST_BRAKES_ON: robot_status_code_info(MX_ST_BRAKES_ON, 'MX_ST_BRAKES_ON', is_error=False), MX_ST_GET_WRF: robot_status_code_info(MX_ST_GET_WRF, 'MX_ST_GET_WRF', is_error=False), MX_ST_GET_TRF: robot_status_code_info(MX_ST_GET_TRF, 'MX_ST_GET_TRF', is_error=False), MX_ST_GET_JOINTS: robot_status_code_info(MX_ST_GET_JOINTS, 'MX_ST_GET_JOINTS', is_error=False), MX_ST_GET_POSE: robot_status_code_info(MX_ST_GET_POSE, 'MX_ST_GET_POSE', is_error=False), MX_ST_GET_AUTO_CONF: robot_status_code_info(MX_ST_GET_AUTO_CONF, 'MX_ST_GET_AUTO_CONF', is_error=False), MX_ST_GET_CONF: robot_status_code_info(MX_ST_GET_CONF, 'MX_ST_GET_CONF', is_error=False), MX_ST_GET_AUTO_CONF_TURN: robot_status_code_info(MX_ST_GET_AUTO_CONF_TURN, 'MX_ST_GET_AUTO_CONF_TURN', is_error=False), MX_ST_GET_CONF_TURN: robot_status_code_info(MX_ST_GET_CONF_TURN, 'MX_ST_GET_CONF_TURN', is_error=False), MX_ST_PAUSE_MOTION: robot_status_code_info(MX_ST_PAUSE_MOTION, 'MX_ST_PAUSE_MOTION', is_error=False), MX_ST_RESUME_MOTION: robot_status_code_info(MX_ST_RESUME_MOTION, 'MX_ST_RESUME_MOTION', is_error=False), MX_ST_CLEAR_MOTION: robot_status_code_info(MX_ST_CLEAR_MOTION, 'MX_ST_CLEAR_MOTION', is_error=False), MX_ST_SIM_ON: robot_status_code_info(MX_ST_SIM_ON, 'MX_ST_SIM_ON', is_error=False), MX_ST_SIM_OFF: robot_status_code_info(MX_ST_SIM_OFF, 'MX_ST_SIM_OFF', is_error=False), MX_ST_EXTTOOL_SIM: robot_status_code_info(MX_ST_EXTTOOL_SIM, 'MX_ST_EXTTOOL_SIM', is_error=False), MX_ST_EOM_ON: robot_status_code_info(MX_ST_EOM_ON, 'MX_ST_EOM_ON', is_error=False), MX_ST_EOM_OFF: robot_status_code_info(MX_ST_EOM_OFF, 'MX_ST_EOM_OFF', is_error=False), MX_ST_EOB_ON: robot_status_code_info(MX_ST_EOB_ON, 'MX_ST_EOB_ON', is_error=False), MX_ST_EOB_OFF: robot_status_code_info(MX_ST_EOB_OFF, 'MX_ST_EOB_OFF', is_error=False), MX_ST_START_SAVING: robot_status_code_info(MX_ST_START_SAVING, 'MX_ST_START_SAVING', is_error=False), MX_ST_N_CMD_SAVED: robot_status_code_info(MX_ST_N_CMD_SAVED, 'MX_ST_N_CMD_SAVED', is_error=False), MX_ST_OFFLINE_START: robot_status_code_info(MX_ST_OFFLINE_START, 'MX_ST_OFFLINE_START', is_error=False), MX_ST_OFFLINE_LOOP_ON: robot_status_code_info(MX_ST_OFFLINE_LOOP_ON, 'MX_ST_OFFLINE_LOOP_ON', is_error=False), MX_ST_OFFLINE_LOOP_OFF: robot_status_code_info(MX_ST_OFFLINE_LOOP_OFF, 'MX_ST_OFFLINE_LOOP_OFF', is_error=False), MX_ST_GET_STATUS_GRIPPER: robot_status_code_info(MX_ST_GET_STATUS_GRIPPER, 'MX_ST_GET_STATUS_GRIPPER', is_error=False), MX_ST_GET_CMD_PENDING_COUNT: robot_status_code_info(MX_ST_GET_CMD_PENDING_COUNT, 'MX_ST_GET_CMD_PENDING_COUNT', is_error=False), MX_ST_GET_FW_VERSION: robot_status_code_info(MX_ST_GET_FW_VERSION, 'MX_ST_GET_FW_VERSION', is_error=False), MX_ST_GET_FW_VERSION_FULL: robot_status_code_info(MX_ST_GET_FW_VERSION_FULL, 'MX_ST_GET_FW_VERSION_FULL', is_error=False), MX_ST_GET_ROBOT_SERIAL: robot_status_code_info(MX_ST_GET_ROBOT_SERIAL, 'MX_ST_GET_ROBOT_SERIAL', is_error=False), MX_ST_GET_PRODUCT_TYPE: robot_status_code_info(MX_ST_GET_PRODUCT_TYPE, 'MX_ST_GET_PRODUCT_TYPE', is_error=False), MX_ST_CMD_SUCCESSFUL: robot_status_code_info(MX_ST_CMD_SUCCESSFUL, 'MX_ST_CMD_SUCCESSFUL', is_error=False), MX_ST_SET_CTRL_PORT_MONIT: robot_status_code_info(MX_ST_SET_CTRL_PORT_MONIT, 'MX_ST_SET_CTRL_PORT_MONIT', is_error=False), MX_ST_SYNC_CMD_QUEUE: robot_status_code_info(MX_ST_SYNC_CMD_QUEUE, 'MX_ST_SYNC_CMD_QUEUE', is_error=False), MX_ST_GET_JOINT_LIMITS: robot_status_code_info(MX_ST_GET_JOINT_LIMITS, 'MX_ST_GET_JOINT_LIMITS', is_error=False), MX_ST_SET_JOINT_LIMITS: robot_status_code_info(MX_ST_SET_JOINT_LIMITS, 'MX_ST_SET_JOINT_LIMITS', is_error=False), MX_ST_SET_JOINT_LIMITS_CFG: robot_status_code_info(MX_ST_SET_JOINT_LIMITS_CFG, 'MX_ST_SET_JOINT_LIMITS_CFG', is_error=False), MX_ST_GET_JOINT_LIMITS_CFG: robot_status_code_info(MX_ST_GET_JOINT_LIMITS_CFG, 'MX_ST_GET_JOINT_LIMITS_CFG', is_error=False), MX_ST_GET_ROBOT_NAME: robot_status_code_info(MX_ST_GET_ROBOT_NAME, 'MX_ST_GET_ROBOT_NAME', is_error=False), MX_ST_GET_ROBOT_KIN_MODEL: robot_status_code_info(MX_ST_GET_ROBOT_KIN_MODEL, 'MX_ST_GET_ROBOT_KIN_MODEL', is_error=False), MX_ST_GET_ROBOT_DH_MODEL: robot_status_code_info(MX_ST_GET_ROBOT_DH_MODEL, 'MX_ST_GET_ROBOT_DH_MODEL', is_error=False), MX_ST_GET_JOINT_OFFSET: robot_status_code_info(MX_ST_GET_JOINT_OFFSET, 'MX_ST_GET_JOINT_OFFSET', is_error=False), MX_ST_GET_MODEL_JOINT_LIMITS: robot_status_code_info(MX_ST_GET_MODEL_JOINT_LIMITS, 'MX_ST_GET_MODEL_JOINT_LIMITS', is_error=False), MX_ST_GET_MOTION_OPTIONS: robot_status_code_info(MX_ST_GET_MOTION_OPTIONS, 'MX_ST_GET_MOTION_OPTIONS', is_error=False), MX_ST_GET_MONITORING_INTERVAL: robot_status_code_info(MX_ST_GET_MONITORING_INTERVAL, 'MX_ST_GET_MONITORING_INTERVAL', is_error=False), MX_ST_GET_REAL_TIME_MONITORING: robot_status_code_info(MX_ST_GET_REAL_TIME_MONITORING, 'MX_ST_GET_REAL_TIME_MONITORING', is_error=False), MX_ST_GET_STATUS_EVENTS: robot_status_code_info(MX_ST_GET_STATUS_EVENTS, 'MX_ST_GET_STATUS_EVENTS', is_error=False), MX_ST_GET_NETWORK_OPTIONS: robot_status_code_info(MX_ST_GET_NETWORK_OPTIONS, 'MX_ST_GET_NETWORK_OPTIONS', is_error=False), MX_ST_GET_RTC: robot_status_code_info(MX_ST_GET_RTC, 'MX_ST_GET_RTC', is_error=False), MX_ST_GET_BLENDING: robot_status_code_info(MX_ST_GET_BLENDING, 'MX_ST_GET_BLENDING', is_error=False), MX_ST_GET_VEL_TIMEOUT: robot_status_code_info(MX_ST_GET_VEL_TIMEOUT, 'MX_ST_GET_VEL_TIMEOUT', is_error=False), MX_ST_GET_JOINT_VEL: robot_status_code_info(MX_ST_GET_JOINT_VEL, 'MX_ST_GET_JOINT_VEL', is_error=False), MX_ST_GET_JOINT_ACC: robot_status_code_info(MX_ST_GET_JOINT_ACC, 'MX_ST_GET_JOINT_ACC', is_error=False), MX_ST_GET_CART_LIN_VEL: robot_status_code_info(MX_ST_GET_CART_LIN_VEL, 'MX_ST_GET_CART_LIN_VEL', is_error=False), MX_ST_GET_CART_ANG_VEL: robot_status_code_info(MX_ST_GET_CART_ANG_VEL, 'MX_ST_GET_CART_ANG_VEL', is_error=False), MX_ST_GET_CART_ACC: robot_status_code_info(MX_ST_GET_CART_ACC, 'MX_ST_GET_CART_ACC', is_error=False), MX_ST_GET_CHECKPOINT: robot_status_code_info(MX_ST_GET_CHECKPOINT, 'MX_ST_GET_CHECKPOINT', is_error=False), MX_ST_GET_GRIPPER_FORCE: robot_status_code_info(MX_ST_GET_GRIPPER_FORCE, 'MX_ST_GET_GRIPPER_FORCE', is_error=False), MX_ST_GET_GRIPPER_VEL: robot_status_code_info(MX_ST_GET_GRIPPER_VEL, 'MX_ST_GET_GRIPPER_VEL', is_error=False), MX_ST_GET_TORQUE_LIMITS_CFG: robot_status_code_info(MX_ST_GET_TORQUE_LIMITS_CFG, 'MX_ST_GET_TORQUE_LIMITS_CFG', is_error=False), MX_ST_GET_TORQUE_LIMITS: robot_status_code_info(MX_ST_GET_TORQUE_LIMITS, 'MX_ST_GET_TORQUE_LIMITS', is_error=False), MX_ST_RT_TARGET_JOINT_POS: robot_status_code_info(MX_ST_RT_TARGET_JOINT_POS, 'MX_ST_RT_TARGET_JOINT_POS', is_error=False), MX_ST_RT_TARGET_CART_POS: robot_status_code_info(MX_ST_RT_TARGET_CART_POS, 'MX_ST_RT_TARGET_CART_POS', is_error=False), MX_ST_RT_TARGET_JOINT_VEL: robot_status_code_info(MX_ST_RT_TARGET_JOINT_VEL, 'MX_ST_RT_TARGET_JOINT_VEL', is_error=False), MX_ST_RT_TARGET_JOINT_TORQ: robot_status_code_info(MX_ST_RT_TARGET_JOINT_TORQ, 'MX_ST_RT_TARGET_JOINT_TORQ', is_error=False), MX_ST_RT_TARGET_CART_VEL: robot_status_code_info(MX_ST_RT_TARGET_CART_VEL, 'MX_ST_RT_TARGET_CART_VEL', is_error=False), MX_ST_RT_TARGET_CONF: robot_status_code_info(MX_ST_RT_TARGET_CONF, 'MX_ST_RT_TARGET_CONF', is_error=False), MX_ST_RT_TARGET_CONF_TURN: robot_status_code_info(MX_ST_RT_TARGET_CONF_TURN, 'MX_ST_RT_TARGET_CONF_TURN', is_error=False), MX_ST_RT_JOINT_POS: robot_status_code_info(MX_ST_RT_JOINT_POS, 'MX_ST_RT_JOINT_POS', is_error=False), MX_ST_RT_CART_POS: robot_status_code_info(MX_ST_RT_CART_POS, 'MX_ST_RT_CART_POS', is_error=False), MX_ST_RT_JOINT_VEL: robot_status_code_info(MX_ST_RT_JOINT_VEL, 'MX_ST_RT_JOINT_VEL', is_error=False), MX_ST_RT_JOINT_TORQ: robot_status_code_info(MX_ST_RT_JOINT_TORQ, 'MX_ST_RT_JOINT_TORQ', is_error=False), MX_ST_RT_CART_VEL: robot_status_code_info(MX_ST_RT_CART_VEL, 'MX_ST_RT_CART_VEL', is_error=False), MX_ST_RT_CONF: robot_status_code_info(MX_ST_RT_CONF, 'MX_ST_RT_CONF', is_error=False), MX_ST_RT_CONF_TURN: robot_status_code_info(MX_ST_RT_CONF_TURN, 'MX_ST_RT_CONF_TURN', is_error=False), MX_ST_RT_ACCELEROMETER: robot_status_code_info(MX_ST_RT_ACCELEROMETER, 'MX_ST_RT_ACCELEROMETER', is_error=False), MX_ST_RT_GRIPPER_FORCE: robot_status_code_info(MX_ST_RT_GRIPPER_FORCE, 'MX_ST_RT_GRIPPER_FORCE', is_error=False), MX_ST_RT_EXTTOOL_STATUS: robot_status_code_info(MX_ST_RT_EXTTOOL_STATUS, 'MX_ST_RT_EXTTOOL_STATUS', is_error=False), MX_ST_RT_GRIPPER_STATE: robot_status_code_info(MX_ST_RT_GRIPPER_STATE, 'MX_ST_RT_GRIPPER_STATE', is_error=False), MX_ST_RT_VALVE_STATE: robot_status_code_info(MX_ST_RT_VALVE_STATE, 'MX_ST_RT_VALVE_STATE', is_error=False), MX_ST_RT_CHECKPOINT: robot_status_code_info(MX_ST_RT_CHECKPOINT, 'MX_ST_RT_CHECKPOINT', is_error=False), MX_ST_RT_WRF: robot_status_code_info(MX_ST_RT_WRF, 'MX_ST_RT_WRF', is_error=False), MX_ST_RT_TRF: robot_status_code_info(MX_ST_RT_TRF, 'MX_ST_RT_TRF', is_error=False), MX_ST_RT_CYCLE_END: robot_status_code_info(MX_ST_RT_CYCLE_END, 'MX_ST_RT_CYCLE_END', is_error=False), MX_ST_CONNECTED: robot_status_code_info(MX_ST_CONNECTED, 'MX_ST_CONNECTED', is_error=False), MX_ST_USER_ALREADY: robot_status_code_info(MX_ST_USER_ALREADY, 'MX_ST_USER_ALREADY', is_error=True), MX_ST_UPGRADE_IN_PROGRESS: robot_status_code_info(MX_ST_UPGRADE_IN_PROGRESS, 'MX_ST_UPGRADE_IN_PROGRESS', is_error=False), MX_ST_CMD_TOO_LONG: robot_status_code_info(MX_ST_CMD_TOO_LONG, 'MX_ST_CMD_TOO_LONG', is_error=True), MX_ST_EOM: robot_status_code_info(MX_ST_EOM, 'MX_ST_EOM', is_error=False), MX_ST_ERROR_MOTION: robot_status_code_info(MX_ST_ERROR_MOTION, 'MX_ST_ERROR_MOTION', is_error=True), MX_ST_INIT_FAILED: robot_status_code_info(MX_ST_INIT_FAILED, 'MX_ST_INIT_FAILED', is_error=True), MX_ST_EOB: robot_status_code_info(MX_ST_EOB, 'MX_ST_EOB', is_error=False), MX_ST_END_OFFLINE: robot_status_code_info(MX_ST_END_OFFLINE, 'MX_ST_END_OFFLINE', is_error=False), MX_ST_CANT_SAVE_OFFLINE: robot_status_code_info(MX_ST_CANT_SAVE_OFFLINE, 'MX_ST_CANT_SAVE_OFFLINE', is_error=True), MX_ST_IGNORING_CMD: robot_status_code_info(MX_ST_IGNORING_CMD, 'MX_ST_IGNORING_CMD', is_error=True), MX_ST_NO_OFFLINE_SAVED: robot_status_code_info(MX_ST_NO_OFFLINE_SAVED, 'MX_ST_NO_OFFLINE_SAVED', is_error=True), MX_ST_OFFLINE_LOOP: robot_status_code_info(MX_ST_OFFLINE_LOOP, 'MX_ST_OFFLINE_LOOP', is_error=False), MX_ST_ERROR_GRIPPER: robot_status_code_info(MX_ST_ERROR_GRIPPER, 'MX_ST_ERROR_GRIPPER', is_error=True), MX_ST_ERROR_VBOX: robot_status_code_info(MX_ST_ERROR_VBOX, 'MX_ST_ERROR_VBOX', is_error=True), MX_ST_MAINTENANCE_CHECK: robot_status_code_info(MX_ST_MAINTENANCE_CHECK, 'MX_ST_MAINTENANCE_CHECK', is_error=True), MX_ST_INTERNAL_ERROR: robot_status_code_info(MX_ST_INTERNAL_ERROR, 'MX_ST_INTERNAL_ERROR', is_error=True), MX_ST_EXCESSIVE_TRQ: robot_status_code_info(MX_ST_EXCESSIVE_TRQ, 'MX_ST_EXCESSIVE_TRQ', is_error=True), MX_ST_CHECKPOINT_REACHED: robot_status_code_info(MX_ST_CHECKPOINT_REACHED, 'MX_ST_CHECKPOINT_REACHED', is_error=False), MX_ST_TEXT_API_ERROR: robot_status_code_info(MX_ST_TEXT_API_ERROR, 'MX_ST_TEXT_API_ERROR', is_error=True), MX_ST_PSTOP: robot_status_code_info(MX_ST_PSTOP, 'MX_ST_PSTOP', is_error=True), MX_ST_NO_VALID_CFG: robot_status_code_info(MX_ST_NO_VALID_CFG, 'MX_ST_NO_VALID_CFG', is_error=True), MX_ST_TRACE_LVL_CHANGED: robot_status_code_info(MX_ST_TRACE_LVL_CHANGED, 'MX_ST_TRACE_LVL_CHANGED', is_error=False), MX_ST_TCP_DUMP_STARTED: robot_status_code_info(MX_ST_TCP_DUMP_STARTED, 'MX_ST_TCP_DUMP_STARTED', is_error=False), MX_ST_TCP_DUMP_DONE: robot_status_code_info(MX_ST_TCP_DUMP_DONE, 'MX_ST_TCP_DUMP_DONE', is_error=False)}
|
flowers = input()
qty = int(input())
budget = int(input())
price = 0
Roses = 5
Dahlias = 3.8
Tulips = 2.8
Narcissus = 3
Gladiolus = 2.5
if flowers == "Roses":
if qty > 80:
price = Roses * qty * 0.9
else:
price = Roses * qty
elif flowers == "Dahlias":
if qty > 90:
price = Dahlias * qty * 0.85
else:
price = Dahlias * qty
elif flowers == "Tulips":
if qty > 80:
price = Tulips * qty * 0.85
else:
price = Tulips * qty
elif flowers == "Narcissus":
if qty < 120:
price = Narcissus * qty * 1.15
else:
price = Narcissus * qty
elif flowers == "Gladiolus":
if qty < 80:
price = Gladiolus * qty * 1.2
else:
price = Gladiolus * qty
if price > budget:
print(f'Not enough money, you need {price - budget:.2f} leva more.')
else:
print(f'Hey, you have a great garden with {qty} {flowers} and {budget - price:.2f} leva left.')
|
flowers = input()
qty = int(input())
budget = int(input())
price = 0
roses = 5
dahlias = 3.8
tulips = 2.8
narcissus = 3
gladiolus = 2.5
if flowers == 'Roses':
if qty > 80:
price = Roses * qty * 0.9
else:
price = Roses * qty
elif flowers == 'Dahlias':
if qty > 90:
price = Dahlias * qty * 0.85
else:
price = Dahlias * qty
elif flowers == 'Tulips':
if qty > 80:
price = Tulips * qty * 0.85
else:
price = Tulips * qty
elif flowers == 'Narcissus':
if qty < 120:
price = Narcissus * qty * 1.15
else:
price = Narcissus * qty
elif flowers == 'Gladiolus':
if qty < 80:
price = Gladiolus * qty * 1.2
else:
price = Gladiolus * qty
if price > budget:
print(f'Not enough money, you need {price - budget:.2f} leva more.')
else:
print(f'Hey, you have a great garden with {qty} {flowers} and {budget - price:.2f} leva left.')
|
def get_divisors(n):
sum = 1
for i in range(2, int(n ** 0.5 + 1)):
if n % i == 0:
sum += i
sum += n / i
return sum
def find_amicable_pair():
total = 0
for x in range(1, 10001):
a = get_divisors(x)
b = get_divisors(a)
if b == x and x != a:
total += x
return total
print(find_amicable_pair())
|
def get_divisors(n):
sum = 1
for i in range(2, int(n ** 0.5 + 1)):
if n % i == 0:
sum += i
sum += n / i
return sum
def find_amicable_pair():
total = 0
for x in range(1, 10001):
a = get_divisors(x)
b = get_divisors(a)
if b == x and x != a:
total += x
return total
print(find_amicable_pair())
|
#sandwiches:
def orderedsandwich(items):
list_of_items = []
for item in items:
list_of_items.append(item)
print("This is items you ordered in your sandwich:")
for item in list_of_items:
print(item)
orderedsandwich(['kela','aloo'])
orderedsandwich(['cheese','poteto'])
orderedsandwich(['uiyer'])
|
def orderedsandwich(items):
list_of_items = []
for item in items:
list_of_items.append(item)
print('This is items you ordered in your sandwich:')
for item in list_of_items:
print(item)
orderedsandwich(['kela', 'aloo'])
orderedsandwich(['cheese', 'poteto'])
orderedsandwich(['uiyer'])
|
class Player:
name: str
hp: int
mp: int
skills: dict
def __init__(self, name: str, hp: int, mp: int):
self.name = name
self.hp = hp
self.mp = mp
self.skills = {}
self.guild = 'Unaffiliated'
def add_skill(self, skill_name, mana_cost):
skills = [x for x in self.skills.keys()]
if skill_name not in skills:
self.skills[skill_name] = mana_cost
return f'Skill {skill_name} added to the collection of the player {self.name}'
return f'Skill already added'
def player_info(self):
data = f'Name: {self.name}\nGuild: {self.guild}\nHP: {self.hp}\nMP: {self.mp}\n'
for (k, v) in self.skills.items():
data += f'==={k} - {v}\n'
return data
|
class Player:
name: str
hp: int
mp: int
skills: dict
def __init__(self, name: str, hp: int, mp: int):
self.name = name
self.hp = hp
self.mp = mp
self.skills = {}
self.guild = 'Unaffiliated'
def add_skill(self, skill_name, mana_cost):
skills = [x for x in self.skills.keys()]
if skill_name not in skills:
self.skills[skill_name] = mana_cost
return f'Skill {skill_name} added to the collection of the player {self.name}'
return f'Skill already added'
def player_info(self):
data = f'Name: {self.name}\nGuild: {self.guild}\nHP: {self.hp}\nMP: {self.mp}\n'
for (k, v) in self.skills.items():
data += f'==={k} - {v}\n'
return data
|
students_number=int(input("Enter number of Students :"))
per_student_kharcha=int(input("Enter per student expense :"))
total_kharcha=students_number*per_student_kharcha
if total_kharcha<50000:
print ("Ham kharche ke andar hai ")
else:
print ("kharche se bahar hai ")
|
students_number = int(input('Enter number of Students :'))
per_student_kharcha = int(input('Enter per student expense :'))
total_kharcha = students_number * per_student_kharcha
if total_kharcha < 50000:
print('Ham kharche ke andar hai ')
else:
print('kharche se bahar hai ')
|
#
# Language constants
#
WELCOME = " Welcome to arpspoofKicker!"
#
# Universal
#
SELECT_AN_OPTION = "Select an option"
#
# main
#
MENU = "\n1. ARPSpoof a single device\n" \
"2. ARPSpoof a multiple devices\n" \
"E. Exit"
MENU_1 = "\n1. ARPSpoof a single device\n" \
"2. ARPSpoof a multiple devices\n" \
"3. Run thread(s) in queue\n" \
"4. Stop running thread(s)\n" \
"5. Print thread(s) status\n" \
"E. Stop all threads and exit"
#
# Thread manager
#
THREAD_ENDED_UNEXPECTEDLY = "Thread %a ended unexpectedly"
NO_INTERFACES_WERE_FOUND = "No interfaces were found, check your network configuration, press enter to exit "
FOR_ARPSPOOF_CHECK_THIS = "To install 'arpspoof' check %a"
UPDATE_CONNECTED_USERS = "Re-scan"
THREAD_IS_NOT_RUNNING = "Thread %a is not running"
SELECT_AN_INTERFACE = "Select your network interface"
DISCOVERING_DEVICES = "\nRunning arp -a [Discovering devices]..."
SELECT_THE_GATEWAY = "Select a GATEWAY [Host]"
CONFIRM_INTERFACE = "Is %a your currently network interface?\n1. Yes\n2. No"
THREAD_IS_RUNNING = "Thread %a is running"
DUPLICATED_VICTIM = "A thread is already targeting %a"
SELECT_A_VICTIM = "Select a victim"
THREAD_CREATED = "A thread was created successfully"
SELECT_OPTIONS = "Select an option [ Selected %a of %a ]"
VIEW_AS_MAC = "View as MAC address"
VIEW_AS_IP = "View as IPv4 address"
THREAD_V_G = " thread for victim %a and gateway %a"
STARTING = "Starting"
STOPPING = "Stopping"
DELETING = "Deleting"
#
# Util
#
IPCONFIG_COMMAND_NOT_FOUND = "ip or ifconfig command not found"
ARPSPOOF_PERMISSION_DENIED = "You need root permissions to run 'arpspoof'\n Run with: sudo python3 main.py"
ARPSPOOF_COMMAND_NOT_FOUND = "'arpspoof' is not installed"
OPTION_IS_NOT_IN_LIST = "Your option is not in list, try any of these %a"
ARP_COMMAND_NOT_FOUND = "Somehow 'arp' command were not found (Likely you're using linux, install net-tools)"
STOPPING_ARPSPOOF = "Stopping arpspoof..."
INCOMPLETE_DATA = "Some devices were not detected as incomplete, consider re-scan for devices"
SELECT_ALL = "Select all"
FINISH = "Finish"
|
welcome = ' Welcome to arpspoofKicker!'
select_an_option = 'Select an option'
menu = '\n1. ARPSpoof a single device\n2. ARPSpoof a multiple devices\nE. Exit'
menu_1 = '\n1. ARPSpoof a single device\n2. ARPSpoof a multiple devices\n3. Run thread(s) in queue\n4. Stop running thread(s)\n5. Print thread(s) status\nE. Stop all threads and exit'
thread_ended_unexpectedly = 'Thread %a ended unexpectedly'
no_interfaces_were_found = 'No interfaces were found, check your network configuration, press enter to exit '
for_arpspoof_check_this = "To install 'arpspoof' check %a"
update_connected_users = 'Re-scan'
thread_is_not_running = 'Thread %a is not running'
select_an_interface = 'Select your network interface'
discovering_devices = '\nRunning arp -a [Discovering devices]...'
select_the_gateway = 'Select a GATEWAY [Host]'
confirm_interface = 'Is %a your currently network interface?\n1. Yes\n2. No'
thread_is_running = 'Thread %a is running'
duplicated_victim = 'A thread is already targeting %a'
select_a_victim = 'Select a victim'
thread_created = 'A thread was created successfully'
select_options = 'Select an option [ Selected %a of %a ]'
view_as_mac = 'View as MAC address'
view_as_ip = 'View as IPv4 address'
thread_v_g = ' thread for victim %a and gateway %a'
starting = 'Starting'
stopping = 'Stopping'
deleting = 'Deleting'
ipconfig_command_not_found = 'ip or ifconfig command not found'
arpspoof_permission_denied = "You need root permissions to run 'arpspoof'\n Run with: sudo python3 main.py"
arpspoof_command_not_found = "'arpspoof' is not installed"
option_is_not_in_list = 'Your option is not in list, try any of these %a'
arp_command_not_found = "Somehow 'arp' command were not found (Likely you're using linux, install net-tools)"
stopping_arpspoof = 'Stopping arpspoof...'
incomplete_data = 'Some devices were not detected as incomplete, consider re-scan for devices'
select_all = 'Select all'
finish = 'Finish'
|
class JackTokenizer:
def __init__(self, src_file_name):
self._line_index = 0
self._line_index = 0
self._lines = []
f = open(src_file_name)
# First assesment of the Assembler
for line in f.readlines():
strip_line = line.lstrip()
# Skipping none relevant
if len(strip_line) == 0 or strip_line[0:2] == '//':
continue
#l = strip_line.replace(' ', '') # Removing whitespace
l = strip_line.replace('\n', '') # Removing new line
l = l.replace('\t', '') # Removing tabs
l = l.split('/')[0] # Removing comments
self._lines.append(l)
f.close()
def current_token(self):
curr_line = self._lines[self._line_index]
return ""
def advance(self):
self._line_index+=1
def has_more_command(self):
return len(self._lines) > self._line_index
def token_type(self):
pass
|
class Jacktokenizer:
def __init__(self, src_file_name):
self._line_index = 0
self._line_index = 0
self._lines = []
f = open(src_file_name)
for line in f.readlines():
strip_line = line.lstrip()
if len(strip_line) == 0 or strip_line[0:2] == '//':
continue
l = strip_line.replace('\n', '')
l = l.replace('\t', '')
l = l.split('/')[0]
self._lines.append(l)
f.close()
def current_token(self):
curr_line = self._lines[self._line_index]
return ''
def advance(self):
self._line_index += 1
def has_more_command(self):
return len(self._lines) > self._line_index
def token_type(self):
pass
|
jolts = [0]
while True:
try:
a = int(input())
jolts.append(a)
except:
break
jolts.sort()
jolts.append(jolts[-1] + 3)
diffs = [0, 0]
for i in range(1,len(jolts)):
if jolts[i] - jolts[i-1] == 1:
diffs[0] += 1
elif jolts[i] - jolts[i-1] == 3:
diffs[1] += 1
print(diffs[0]*diffs[1])
#part 2
paths = [0 for _ in range(len(jolts))]
paths[-1] = 1
for i in range(len(jolts)-2, -1,-1):
from_here = 0
for j in range(1, 4):
try:
if jolts[i+j] - jolts[i] < 4:
from_here += paths[i+j]
except:
pass
paths[i] = from_here
print(paths[0])
|
jolts = [0]
while True:
try:
a = int(input())
jolts.append(a)
except:
break
jolts.sort()
jolts.append(jolts[-1] + 3)
diffs = [0, 0]
for i in range(1, len(jolts)):
if jolts[i] - jolts[i - 1] == 1:
diffs[0] += 1
elif jolts[i] - jolts[i - 1] == 3:
diffs[1] += 1
print(diffs[0] * diffs[1])
paths = [0 for _ in range(len(jolts))]
paths[-1] = 1
for i in range(len(jolts) - 2, -1, -1):
from_here = 0
for j in range(1, 4):
try:
if jolts[i + j] - jolts[i] < 4:
from_here += paths[i + j]
except:
pass
paths[i] = from_here
print(paths[0])
|
def gen_serial(username):
log_10 = 0
log_14 = 0
log_15 = 0
eax = ''
edx = ''
ecx = ''
for c in username:
hex_symbol = hex(ord(c))
eax = hex_symbol
eax = log_15
eax = eax << 2
log_10 = log_10 + eax
eax = hex_symbol
edx = log_10
edx = edx - int(eax, 16)
eax = 0x0fa
eax = eax ^ edx
log_10 = eax
eax = log_15
eax = eax << 3
log_14 = log_14 + eax
eax = hex_symbol
edx = log_14
edx = edx - int(eax, 16)
eax = 0x11
eax = eax ^ edx
log_10 = eax
log_15 = int(hex_symbol, 16)
eax = log_14
eax = eax >> 0x1f
edx = eax
edx = edx ^ log_14
edx = edx - eax
eax = log_10
eax = eax >> 0x1f
ecx = eax
eax = ecx
eax = eax ^ log_10
eax = eax - ecx
return [eax, edx]
if __name__ == "__main__":
username = input('Enter Username: ')
code = gen_serial(username)
print('Code: ' + '{}-{}'.format(code[0], code[1]))
|
def gen_serial(username):
log_10 = 0
log_14 = 0
log_15 = 0
eax = ''
edx = ''
ecx = ''
for c in username:
hex_symbol = hex(ord(c))
eax = hex_symbol
eax = log_15
eax = eax << 2
log_10 = log_10 + eax
eax = hex_symbol
edx = log_10
edx = edx - int(eax, 16)
eax = 250
eax = eax ^ edx
log_10 = eax
eax = log_15
eax = eax << 3
log_14 = log_14 + eax
eax = hex_symbol
edx = log_14
edx = edx - int(eax, 16)
eax = 17
eax = eax ^ edx
log_10 = eax
log_15 = int(hex_symbol, 16)
eax = log_14
eax = eax >> 31
edx = eax
edx = edx ^ log_14
edx = edx - eax
eax = log_10
eax = eax >> 31
ecx = eax
eax = ecx
eax = eax ^ log_10
eax = eax - ecx
return [eax, edx]
if __name__ == '__main__':
username = input('Enter Username: ')
code = gen_serial(username)
print('Code: ' + '{}-{}'.format(code[0], code[1]))
|
def clean_t (data):
# Select columns to clean
df = data
# Create dummies using the items in the list of 'safety&security' column
ss = df['safety_security'].dropna()
df_new = df.join(ss.str.join('|').str.get_dummies().add_prefix('ss_'))
# Drop 'safety_security' column
df_new.drop('safety_security', axis=1, inplace=True)
# Clean the model column
df_new['model'] = df.model.apply(lambda x: x[1])
# Strip "\n"s from the 'make' column
df_new['make'] = df.make.str.strip("\n")
# Drop unnecesary column 'make_model'
df_new.drop(columns = "make_model", inplace = True)
# Clean 'model_code' column
df_new.loc[df_new.model_code.notnull(), "model_code"] = df.model_code[df.model_code.notnull()].apply(lambda x: str(x)[4:-4])
# Clean 'country_version' column
df_new.loc[df_new.country_version.notnull(), "country_version"] = df.country_version[df.country_version.notnull()].apply(lambda x: str(x)[4:-4])
# Clean 'co2_emission' column
df_new['co2_emission'] = df.co2_emission.str[0].str.extract(r'(\d+)')
# Change the 'co2' columns data type to numeric
df_new['co2_emission'] = pd.to_numeric(df_new.co2_emission)
# Clean 'cylinders' column
df_new['cylinders'] = df.cylinders.str[0].str.extract(r'(\d+)')
# Change the 'cylinders' columns data type to numeric
df_new['cylinders'] = pd.to_numeric(df_new['cylinders'])
# Extract displacement values (and remove commas)
df_new['displacement'] = df.displacement.str[0].str.replace(",","").str.extract(r'(\d+)')
# Change the type of displacement from object to numeric
df_new['displacement'] = pd.to_numeric(df_new['displacement'])
# Extract 'next_inspection' values
df_new.next_inspection = df.next_inspection.str[0].str.strip("\n")
# Create a boolean column from `next_inspection`
df_new['next_inspection_bool'] = df_new.next_inspection.notnull()
# Drop 'non-smoking_vehicle' column
df_new.drop("non_smoking_vehicle", axis=1, inplace=True)
# Extract hp from 'hp' column
df_new['hp'] = df.hp.str.extract(r'(\d+)')
# Change datatype to numeric
df_new['hp'] = pd.to_numeric(df_new['hp'])
# Drop 'kw' column
df_new.drop('kw', axis=1, inplace=True)
# Clean 'km' column
df_new['km'] = df.km.str.replace(",", "").str.extract(r'(\d+)')
# Clean "offer_number' column
df_new['offer_number'] = df.offer_number.str[0].str.replace("\n","")
# Create a boolean for checking "combined" consumption
comb_bool = df.consumption.str[0].str[0].str.contains("comb", na=False)
# Create a new column for 'consumption_comb'
df_new['consumption_comb'] = df[comb_bool].consumption.str[0].str[0].str.extract(r'(\d.\d|\d)')
# Drop 'consumption' column
df_new.drop('consumption', axis=1, inplace=True)
# Tidy column names
df_new.columns = name_columns(df_new)
# Change description from list to string
df_new['description'] = df['description'].str.join('').str.strip("\n")[0]
return df_new
def clean_m(data):
df=data
#cleaning registration column and convertinf it to age column
reg_new = df.registration[~df.registration.str.contains("-")]
reg_new = pd.to_datetime(reg_new, format='%m/%Y')
reg_year = reg_new.apply(lambda x: x.year)
df['age'] = 2019 - reg_year
df['gearing_type'] = df['gearing_type'].apply(lambda x:x[1])
df.loc[df['body'].notnull(), 'body'] = df.loc[df['body'].notnull(), 'body'].apply(lambda x: x[1])
df.loc[df['body_color'].notnull(), 'body_color'] = df.loc[df['body_color'].notnull(), 'body_color'].apply(lambda x: x[1])
ent=df[['entertainment_media']].dropna()
df=df.join(ent['entertainment_media'].str.join('|').str.get_dummies().add_prefix('ent_media_'))
df['gears']=df.gears.str[0].str.replace("\n", "")
df['gears'] = pd.to_numeric(df.gears)
df['paint_type']=df.paint_type.str[0].str.replace("\n", "")
# converting inspection_new column to 1 if it contains Yes expression, else: 0
df["inspection_new"] = df.inspection_new.str[0].str.contains("Yes", na=False)*1
# extracting the number of days in availabiltiy column and converting column name to available_after_days
df['availability'] = df.availability.str.extract(r'(\d+)')
df['available_after_days'] = df.availability.apply(pd.to_numeric)
# finding right pattern for date in a mixed column: 2 digits/4 digits to extract the date
df['last_service_date'] = df.last_service_date.str[0].str.extract(r'(\d{2}\/\d{4})')
# converting to datetime object
df['last_service_date'] = pd.to_datetime(df['last_service_date'], format='%m/%Y')
#cleaning the available_from column and converting to datetime
df['available_from'] = df.available_from.str.strip("\n")
df['available_from'] = pd.to_datetime(df['available_from'])
name_columns(df)
drop_list=['entertainment_media', 'availability', 'body_color_original', 'full_service',
'last_timing_belt_service_date', 'null', 'registration']
df.drop(drop_list, axis=1, inplace=True)
return df
def clean_update(data):
'''Additional cleaning after performing EDA'''
df = data
# Change wrong data types to numeric
df['km'] = pd.to_numeric(df['km'])
df['consumption_comb'] = pd.to_numeric(df['consumption_comb'])
df['nr_of_doors'] = pd.to_numeric(df['nr_of_doors'])
df['nr_of_seats'] = pd.to_numeric(df['nr_of_seats'])
df['previous_owners'] = pd.to_numeric(df['previous_owners'])
df['weight_kg'] = pd.to_numeric(df['weight_kg'])
#df['gears'] = pd.to_numeric(df['gears']) # clean_m updated
# Change wrong data type to date_time
df['first_registration'] = pd.to_datetime(df.first_registration, format='%Y')
# Replace " " with NaNs
df.loc[df.next_inspection == "",'next_inspection'] = np.nan
# Drop 'prev_owner' column
df.drop('prev_owner', axis=1, inplace = True)
# Drop 'body_type' column (duplicate of 'body')
df.drop('body_type', axis=1, inplace = True)
# Drop 'next_inspection' column (created a new column 'next_inspection_bool')
df.drop('next_inspection', axis=1, inplace = True)
return df
|
def clean_t(data):
df = data
ss = df['safety_security'].dropna()
df_new = df.join(ss.str.join('|').str.get_dummies().add_prefix('ss_'))
df_new.drop('safety_security', axis=1, inplace=True)
df_new['model'] = df.model.apply(lambda x: x[1])
df_new['make'] = df.make.str.strip('\n')
df_new.drop(columns='make_model', inplace=True)
df_new.loc[df_new.model_code.notnull(), 'model_code'] = df.model_code[df.model_code.notnull()].apply(lambda x: str(x)[4:-4])
df_new.loc[df_new.country_version.notnull(), 'country_version'] = df.country_version[df.country_version.notnull()].apply(lambda x: str(x)[4:-4])
df_new['co2_emission'] = df.co2_emission.str[0].str.extract('(\\d+)')
df_new['co2_emission'] = pd.to_numeric(df_new.co2_emission)
df_new['cylinders'] = df.cylinders.str[0].str.extract('(\\d+)')
df_new['cylinders'] = pd.to_numeric(df_new['cylinders'])
df_new['displacement'] = df.displacement.str[0].str.replace(',', '').str.extract('(\\d+)')
df_new['displacement'] = pd.to_numeric(df_new['displacement'])
df_new.next_inspection = df.next_inspection.str[0].str.strip('\n')
df_new['next_inspection_bool'] = df_new.next_inspection.notnull()
df_new.drop('non_smoking_vehicle', axis=1, inplace=True)
df_new['hp'] = df.hp.str.extract('(\\d+)')
df_new['hp'] = pd.to_numeric(df_new['hp'])
df_new.drop('kw', axis=1, inplace=True)
df_new['km'] = df.km.str.replace(',', '').str.extract('(\\d+)')
df_new['offer_number'] = df.offer_number.str[0].str.replace('\n', '')
comb_bool = df.consumption.str[0].str[0].str.contains('comb', na=False)
df_new['consumption_comb'] = df[comb_bool].consumption.str[0].str[0].str.extract('(\\d.\\d|\\d)')
df_new.drop('consumption', axis=1, inplace=True)
df_new.columns = name_columns(df_new)
df_new['description'] = df['description'].str.join('').str.strip('\n')[0]
return df_new
def clean_m(data):
df = data
reg_new = df.registration[~df.registration.str.contains('-')]
reg_new = pd.to_datetime(reg_new, format='%m/%Y')
reg_year = reg_new.apply(lambda x: x.year)
df['age'] = 2019 - reg_year
df['gearing_type'] = df['gearing_type'].apply(lambda x: x[1])
df.loc[df['body'].notnull(), 'body'] = df.loc[df['body'].notnull(), 'body'].apply(lambda x: x[1])
df.loc[df['body_color'].notnull(), 'body_color'] = df.loc[df['body_color'].notnull(), 'body_color'].apply(lambda x: x[1])
ent = df[['entertainment_media']].dropna()
df = df.join(ent['entertainment_media'].str.join('|').str.get_dummies().add_prefix('ent_media_'))
df['gears'] = df.gears.str[0].str.replace('\n', '')
df['gears'] = pd.to_numeric(df.gears)
df['paint_type'] = df.paint_type.str[0].str.replace('\n', '')
df['inspection_new'] = df.inspection_new.str[0].str.contains('Yes', na=False) * 1
df['availability'] = df.availability.str.extract('(\\d+)')
df['available_after_days'] = df.availability.apply(pd.to_numeric)
df['last_service_date'] = df.last_service_date.str[0].str.extract('(\\d{2}\\/\\d{4})')
df['last_service_date'] = pd.to_datetime(df['last_service_date'], format='%m/%Y')
df['available_from'] = df.available_from.str.strip('\n')
df['available_from'] = pd.to_datetime(df['available_from'])
name_columns(df)
drop_list = ['entertainment_media', 'availability', 'body_color_original', 'full_service', 'last_timing_belt_service_date', 'null', 'registration']
df.drop(drop_list, axis=1, inplace=True)
return df
def clean_update(data):
"""Additional cleaning after performing EDA"""
df = data
df['km'] = pd.to_numeric(df['km'])
df['consumption_comb'] = pd.to_numeric(df['consumption_comb'])
df['nr_of_doors'] = pd.to_numeric(df['nr_of_doors'])
df['nr_of_seats'] = pd.to_numeric(df['nr_of_seats'])
df['previous_owners'] = pd.to_numeric(df['previous_owners'])
df['weight_kg'] = pd.to_numeric(df['weight_kg'])
df['first_registration'] = pd.to_datetime(df.first_registration, format='%Y')
df.loc[df.next_inspection == '', 'next_inspection'] = np.nan
df.drop('prev_owner', axis=1, inplace=True)
df.drop('body_type', axis=1, inplace=True)
df.drop('next_inspection', axis=1, inplace=True)
return df
|
def extractDustToRust(item):
"""
Parser for 'Dust to Rust'
"""
vol, chp, frag, postfix = extractVolChapterFragmentPostfix(item['title'])
if not (chp or vol) or 'preview' in item['title'].lower():
return None
if 'Kyuuketsu Hime' in item['tags']:
return buildReleaseMessageWithType(item, 'Kyuuketsu Hime wa Barairo no Yume o Miru', vol, chp, frag=frag, postfix=postfix)
if 'Vampire Princess' in item['tags']:
return buildReleaseMessageWithType(item, 'Kyuuketsu Hime wa Barairo no Yume o Miru', vol, chp, frag=frag, postfix=postfix)
if 'Reincarnate into a Slime' in item['tags']:
return buildReleaseMessageWithType(item, 'Tensei Shitara Slime Datta Ken', vol, chp, frag=frag, postfix=postfix)
if 'Slime' in item['tags']:
return buildReleaseMessageWithType(item, 'Tensei Shitara Slime Datta Ken', vol, chp, frag=frag, postfix=postfix)
return False
|
def extract_dust_to_rust(item):
"""
Parser for 'Dust to Rust'
"""
(vol, chp, frag, postfix) = extract_vol_chapter_fragment_postfix(item['title'])
if not (chp or vol) or 'preview' in item['title'].lower():
return None
if 'Kyuuketsu Hime' in item['tags']:
return build_release_message_with_type(item, 'Kyuuketsu Hime wa Barairo no Yume o Miru', vol, chp, frag=frag, postfix=postfix)
if 'Vampire Princess' in item['tags']:
return build_release_message_with_type(item, 'Kyuuketsu Hime wa Barairo no Yume o Miru', vol, chp, frag=frag, postfix=postfix)
if 'Reincarnate into a Slime' in item['tags']:
return build_release_message_with_type(item, 'Tensei Shitara Slime Datta Ken', vol, chp, frag=frag, postfix=postfix)
if 'Slime' in item['tags']:
return build_release_message_with_type(item, 'Tensei Shitara Slime Datta Ken', vol, chp, frag=frag, postfix=postfix)
return False
|
#encoding=utf-8
#Manacher is to find the longest Palindrome substring
#normally, the time complexity is O(n2)
#In order to reduce the time complexity
#It tries to use the previous palindrome data
#to reduce the time complexsity to O(n)
def FindLongestPalindrome(str_line):
p = [1]* len(str_line)
mx = 1
id = 0
for i in range(1, len(str_line)):
if mx > i:
p[i] = min(p[2 * id - i], mx - i)
#update id and mx
idx = p[i]
while (i+idx) < len(str_line) and str_line[i - idx] == str_line[i + idx]:
p[i] = p[i] + 1
idx = idx + 1
if p[i] + i > mx:
mx = p[i] + i -1
id = i
print(max(p)*2-1)
print(str_line[id - max(p)+1:id + max(p)])
def main():
str_line = '12212321'
FindLongestPalindrome(str_line)
if __name__ == '__main__':
main()
|
def find_longest_palindrome(str_line):
p = [1] * len(str_line)
mx = 1
id = 0
for i in range(1, len(str_line)):
if mx > i:
p[i] = min(p[2 * id - i], mx - i)
idx = p[i]
while i + idx < len(str_line) and str_line[i - idx] == str_line[i + idx]:
p[i] = p[i] + 1
idx = idx + 1
if p[i] + i > mx:
mx = p[i] + i - 1
id = i
print(max(p) * 2 - 1)
print(str_line[id - max(p) + 1:id + max(p)])
def main():
str_line = '12212321'
find_longest_palindrome(str_line)
if __name__ == '__main__':
main()
|
# gunicorn config file
access_log_format = '%(h)s %(l)s %(u)s %(t)s "%(r)s" %(s)s %(b)s "%(f)s" "%(a)s" "pid=%(p)s"'
raw_env = [
'FLASK_APP=webhook',
]
bind="0.0.0.0:5000"
workers=5
accesslog="-"
|
access_log_format = '%(h)s %(l)s %(u)s %(t)s "%(r)s" %(s)s %(b)s "%(f)s" "%(a)s" "pid=%(p)s"'
raw_env = ['FLASK_APP=webhook']
bind = '0.0.0.0:5000'
workers = 5
accesslog = '-'
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.