content stringlengths 7 1.05M | fixed_cases stringlengths 1 1.28M |
|---|---|
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() |
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]) |
# %% [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 |
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)) |
# 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") |
# 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) |
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 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' |
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() |
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" |
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 |
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) |
# Division
print(5 / 8)
# Addition
print(7 + 10)
| print(5 / 8)
print(7 + 10) |
# 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() |
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'} |
# 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') |
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 |
#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 = '-' |
# coding=utf-8
class NodeType:
select = 'SELECT'
insert = 'INSERT'
delete = 'DELETE'
update = 'UPDATE'
train = 'TRAIN'
register = 'REGISTER'
load = 'LOAD'
save = 'SAVE'
connect = 'CONNECT'
set = 'SET'
alert = 'ALERT'
create_table = 'CREATETABLE'
drop_table = 'DROPTABLE'
create_index = 'CREATEINDEX'
drop_index = 'DROPINDEX'
create_user = 'CREATEUSER'
exit = 'EXIT'
print_table = 'PRINT'
show_tables = 'SHOW'
value = 'VALUE'
condition = 'CONDITION'
relation_attr = 'RELATTR'
grant_user = 'GRANTUSER'
revoke_user = 'REVOKEUSER'
attr_type = "ATTRTYPE"
class QueryNode:
def __init__(self, select_list, from_list, where_list, limit_num, as_table):
self.type = NodeType.select
self.select_list = select_list
self.from_list = from_list
self.where_list = where_list
self.limit_num = limit_num
self.as_table = as_table
class LoadNode:
def __init__(self, where_list, table_id):
self.type = NodeType.load
self.where_list = where_list
self.table_id = table_id
class SaveNode:
def __init__(self, table_id):
self.type = NodeType.save
self.table_id = table_id
class ConnectNode:
def __init__(self, table_id):
self.type = NodeType.connect
self.table_id = table_id
class SetNode:
def __init__(self, where_list, table_id):
self.type = NodeType.set
self.where_list = where_list
self.table_id = table_id
class InsertNode:
def __init__(self, table_name, value_list):
self.type = NodeType.insert
self.table_name = table_name
self.value_list = value_list
class DeleteNode:
def __init__(self, table_name, where_list):
self.type = NodeType.delete
self.table_name = table_name
self.where_list = where_list
class UpdateNode:
def __init__(self, table_name, set_list, where_list):
self.type = NodeType.update
self.table_name = table_name
self.set_list = set_list
self.where_list = where_list
class TrainNode:
def __init__(self, set_list, where_list):
self.type = NodeType.train
self.set_list = set_list
self.where_list = where_list
class RegisterNode:
def __init__(self, set_list, where_list):
self.type = NodeType.register
self.set_list = set_list
self.where_list = where_list
class AlertNode:
def __init__(self, table_name, op, attr_list):
self.type = NodeType.alert
self.table_name = table_name
self.op = op
self.attr_list = attr_list
class CreateTableNode:
def __init__(self, table_name, attr_list):
self.type = NodeType.create_table
self.table_name = table_name
self.attr_list = attr_list
class DropTableNode:
def __init__(self, table_name):
self.type = NodeType.drop_table
self.table_name = table_name
class CreateIndexNode:
def __init__(self, table_name, attr_name):
self.type = NodeType.create_index
self.table_name = table_name
self.attr_name = attr_name
class DropIndexNode:
def __init__(self, table_name, attr_name):
self.type = NodeType.drop_index
self.table_name = table_name
self.attr_name = attr_name
class CreateUserNode:
def __init__(self, user_id, password):
self.type = NodeType.create_user
self.user_id = user_id
self.password = password
class GrantUserNode:
def __init__(self, power_list, table_list, user_list):
self.type = NodeType.grant_user
self.power_list = power_list
self.table_list = table_list
self.user_list = user_list
class RevokeUserNode:
def __init__(self, power_list, table_list, user_list):
self.type = NodeType.revoke_user
self.power_list = power_list
self.table_list = table_list
self.user_list = user_list
class Exit:
def __init__(self):
self.type = NodeType.exit
class PrintTable:
def __init__(self, table_name):
self.type = NodeType.print_table
self.table_name = table_name
class ShowTables:
def __init__(self):
self.type = NodeType.show_tables
class Value:
def __init__(self, value_type, value):
self.type = NodeType.value
self.value_type = value_type
self.value = value
def __str__(self):
return str(self.value) + '[' + self.value_type + ']'
class RelAttr:
def __init__(self, attr_name, table_name=None):
self.type = NodeType.relation_attr
self.table_name = table_name
self.attr_name = attr_name
def __str__(self):
if self.table_name:
return self.table_name + '.' + self.attr_name
else:
return self.attr_name
class Cond:
def __init__(self, left, op, right):
self.type = NodeType.condition
self.op = op.upper()
self.left = left
self.right = right
def __str__(self):
return '(' + str(self.left) + ', ' + str(
self.right) + ', ' + self.op + ')'
class AttrType:
def __init__(self, attr_name, attr_type, type_len=1):
self.type = NodeType.attr_type
self.attr_type = attr_type
self.type_len = type_len
self.attr_name = attr_name
def __str__(self):
return self.attr_name + " " + self.attr_type + " " + str(self.type_len)
if __name__ == '__main__':
pass
| class Nodetype:
select = 'SELECT'
insert = 'INSERT'
delete = 'DELETE'
update = 'UPDATE'
train = 'TRAIN'
register = 'REGISTER'
load = 'LOAD'
save = 'SAVE'
connect = 'CONNECT'
set = 'SET'
alert = 'ALERT'
create_table = 'CREATETABLE'
drop_table = 'DROPTABLE'
create_index = 'CREATEINDEX'
drop_index = 'DROPINDEX'
create_user = 'CREATEUSER'
exit = 'EXIT'
print_table = 'PRINT'
show_tables = 'SHOW'
value = 'VALUE'
condition = 'CONDITION'
relation_attr = 'RELATTR'
grant_user = 'GRANTUSER'
revoke_user = 'REVOKEUSER'
attr_type = 'ATTRTYPE'
class Querynode:
def __init__(self, select_list, from_list, where_list, limit_num, as_table):
self.type = NodeType.select
self.select_list = select_list
self.from_list = from_list
self.where_list = where_list
self.limit_num = limit_num
self.as_table = as_table
class Loadnode:
def __init__(self, where_list, table_id):
self.type = NodeType.load
self.where_list = where_list
self.table_id = table_id
class Savenode:
def __init__(self, table_id):
self.type = NodeType.save
self.table_id = table_id
class Connectnode:
def __init__(self, table_id):
self.type = NodeType.connect
self.table_id = table_id
class Setnode:
def __init__(self, where_list, table_id):
self.type = NodeType.set
self.where_list = where_list
self.table_id = table_id
class Insertnode:
def __init__(self, table_name, value_list):
self.type = NodeType.insert
self.table_name = table_name
self.value_list = value_list
class Deletenode:
def __init__(self, table_name, where_list):
self.type = NodeType.delete
self.table_name = table_name
self.where_list = where_list
class Updatenode:
def __init__(self, table_name, set_list, where_list):
self.type = NodeType.update
self.table_name = table_name
self.set_list = set_list
self.where_list = where_list
class Trainnode:
def __init__(self, set_list, where_list):
self.type = NodeType.train
self.set_list = set_list
self.where_list = where_list
class Registernode:
def __init__(self, set_list, where_list):
self.type = NodeType.register
self.set_list = set_list
self.where_list = where_list
class Alertnode:
def __init__(self, table_name, op, attr_list):
self.type = NodeType.alert
self.table_name = table_name
self.op = op
self.attr_list = attr_list
class Createtablenode:
def __init__(self, table_name, attr_list):
self.type = NodeType.create_table
self.table_name = table_name
self.attr_list = attr_list
class Droptablenode:
def __init__(self, table_name):
self.type = NodeType.drop_table
self.table_name = table_name
class Createindexnode:
def __init__(self, table_name, attr_name):
self.type = NodeType.create_index
self.table_name = table_name
self.attr_name = attr_name
class Dropindexnode:
def __init__(self, table_name, attr_name):
self.type = NodeType.drop_index
self.table_name = table_name
self.attr_name = attr_name
class Createusernode:
def __init__(self, user_id, password):
self.type = NodeType.create_user
self.user_id = user_id
self.password = password
class Grantusernode:
def __init__(self, power_list, table_list, user_list):
self.type = NodeType.grant_user
self.power_list = power_list
self.table_list = table_list
self.user_list = user_list
class Revokeusernode:
def __init__(self, power_list, table_list, user_list):
self.type = NodeType.revoke_user
self.power_list = power_list
self.table_list = table_list
self.user_list = user_list
class Exit:
def __init__(self):
self.type = NodeType.exit
class Printtable:
def __init__(self, table_name):
self.type = NodeType.print_table
self.table_name = table_name
class Showtables:
def __init__(self):
self.type = NodeType.show_tables
class Value:
def __init__(self, value_type, value):
self.type = NodeType.value
self.value_type = value_type
self.value = value
def __str__(self):
return str(self.value) + '[' + self.value_type + ']'
class Relattr:
def __init__(self, attr_name, table_name=None):
self.type = NodeType.relation_attr
self.table_name = table_name
self.attr_name = attr_name
def __str__(self):
if self.table_name:
return self.table_name + '.' + self.attr_name
else:
return self.attr_name
class Cond:
def __init__(self, left, op, right):
self.type = NodeType.condition
self.op = op.upper()
self.left = left
self.right = right
def __str__(self):
return '(' + str(self.left) + ', ' + str(self.right) + ', ' + self.op + ')'
class Attrtype:
def __init__(self, attr_name, attr_type, type_len=1):
self.type = NodeType.attr_type
self.attr_type = attr_type
self.type_len = type_len
self.attr_name = attr_name
def __str__(self):
return self.attr_name + ' ' + self.attr_type + ' ' + str(self.type_len)
if __name__ == '__main__':
pass |
sentence='I am interested in {num}'
pi=3.14
print(sentence.format(num=pi))
e=2.712
print(sentence.format(num=e)) | sentence = 'I am interested in {num}'
pi = 3.14
print(sentence.format(num=pi))
e = 2.712
print(sentence.format(num=e)) |
l = [int(i) for i in input().split()]
print("largest - ", max(l))
print('smallest - ', min(l))
print('2nd largest - ', sorted(l)[-2])
print('2nd smallest - ', sorted(l)[1]) | l = [int(i) for i in input().split()]
print('largest - ', max(l))
print('smallest - ', min(l))
print('2nd largest - ', sorted(l)[-2])
print('2nd smallest - ', sorted(l)[1]) |
N, M = list(map(int, input().split()))
# N, M = (2, 3)
def simple_add(n, m):
if m == 0:
return n
elif m > 0:
return simple_add(n + m, 0)
else:
return simple_add(n + m, 0)
print(simple_add(N, M))
| (n, m) = list(map(int, input().split()))
def simple_add(n, m):
if m == 0:
return n
elif m > 0:
return simple_add(n + m, 0)
else:
return simple_add(n + m, 0)
print(simple_add(N, M)) |
qtd=int(input())
if qtd>=0 and qtd<=1000:
lista=[]
for a in range(0,qtd):
A=int(input())
while A<0 or A>10**6:
A=int(input())
lista.append(A)
acessos=0
dias=0
for a in lista:
acessos+=a
print(a, acessos)
if acessos+a<10**6:
dias+=1
print(dias+1)
| qtd = int(input())
if qtd >= 0 and qtd <= 1000:
lista = []
for a in range(0, qtd):
a = int(input())
while A < 0 or A > 10 ** 6:
a = int(input())
lista.append(A)
acessos = 0
dias = 0
for a in lista:
acessos += a
print(a, acessos)
if acessos + a < 10 ** 6:
dias += 1
print(dias + 1) |
class person:
count=0 #class attribute
def __init__(self,name="bol",age=23): #constructor
self.__name=name #instance attribute
self.__age=age #instance attribute
person.count=person.count+1
def setname(self,name):
self.__name=name
def getname(self):
return self.__name
def displayInfo(self): #method
print(self.name, self.age)
name=property(getname,setname)
def display(str):
print(str)
def displaydecorator(fn):
def display_wrapper(str):
print('Output:', end=" ")
fn(str)
return display_wrapper
| class Person:
count = 0
def __init__(self, name='bol', age=23):
self.__name = name
self.__age = age
person.count = person.count + 1
def setname(self, name):
self.__name = name
def getname(self):
return self.__name
def display_info(self):
print(self.name, self.age)
name = property(getname, setname)
def display(str):
print(str)
def displaydecorator(fn):
def display_wrapper(str):
print('Output:', end=' ')
fn(str)
return display_wrapper |
#
# PySNMP MIB module ELTEX-IP-OSPF-IF-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/ELTEX-IP-OSPF-IF-MIB
# Produced by pysmi-0.3.4 at Mon Apr 29 18:45:50 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 (default, Mar 27 2019, 09:23:15)
#
ObjectIdentifier, OctetString, Integer = mibBuilder.importSymbols("ASN1", "ObjectIdentifier", "OctetString", "Integer")
NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues")
SingleValueConstraint, ConstraintsUnion, ConstraintsIntersection, ValueRangeConstraint, ValueSizeConstraint = mibBuilder.importSymbols("ASN1-REFINEMENT", "SingleValueConstraint", "ConstraintsUnion", "ConstraintsIntersection", "ValueRangeConstraint", "ValueSizeConstraint")
eltMes, = mibBuilder.importSymbols("ELTEX-MES", "eltMes")
eltMesOspf, = mibBuilder.importSymbols("ELTEX-MES-IP", "eltMesOspf")
PortList, = mibBuilder.importSymbols("Q-BRIDGE-MIB", "PortList")
NotificationGroup, ModuleCompliance = mibBuilder.importSymbols("SNMPv2-CONF", "NotificationGroup", "ModuleCompliance")
TimeTicks, Gauge32, ObjectIdentity, Counter32, Unsigned32, MibIdentifier, Counter64, NotificationType, ModuleIdentity, Integer32, MibScalar, MibTable, MibTableRow, MibTableColumn, Bits, iso, IpAddress = mibBuilder.importSymbols("SNMPv2-SMI", "TimeTicks", "Gauge32", "ObjectIdentity", "Counter32", "Unsigned32", "MibIdentifier", "Counter64", "NotificationType", "ModuleIdentity", "Integer32", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "Bits", "iso", "IpAddress")
TextualConvention, DisplayString, RowStatus, TruthValue = mibBuilder.importSymbols("SNMPv2-TC", "TextualConvention", "DisplayString", "RowStatus", "TruthValue")
eltIpOspfIfTable = MibTable((1, 3, 6, 1, 4, 1, 35265, 1, 23, 91, 1, 2), )
if mibBuilder.loadTexts: eltIpOspfIfTable.setStatus('current')
eltIpOspfIfEntry = MibTableRow((1, 3, 6, 1, 4, 1, 35265, 1, 23, 91, 1, 2, 1), ).setIndexNames((0, "ELTEX-IP-OSPF-IF-MIB", "eltOspfIfAddress"))
if mibBuilder.loadTexts: eltIpOspfIfEntry.setStatus('current')
eltOspfIfAddress = MibTableColumn((1, 3, 6, 1, 4, 1, 35265, 1, 23, 91, 1, 2, 1, 1), IpAddress()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: eltOspfIfAddress.setStatus('current')
eltOspfIfPassiveDefault = MibTableColumn((1, 3, 6, 1, 4, 1, 35265, 1, 23, 91, 1, 2, 1, 2), TruthValue().clone('false')).setMaxAccess("readwrite")
if mibBuilder.loadTexts: eltOspfIfPassiveDefault.setStatus('current')
eltOspfIfPassiveList = MibTableColumn((1, 3, 6, 1, 4, 1, 35265, 1, 23, 91, 1, 2, 1, 3), PortList()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: eltOspfIfPassiveList.setStatus('current')
eltOspfIfStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 35265, 1, 23, 91, 1, 2, 1, 4), RowStatus()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: eltOspfIfStatus.setStatus('current')
mibBuilder.exportSymbols("ELTEX-IP-OSPF-IF-MIB", eltOspfIfAddress=eltOspfIfAddress, eltOspfIfPassiveDefault=eltOspfIfPassiveDefault, eltIpOspfIfTable=eltIpOspfIfTable, eltOspfIfStatus=eltOspfIfStatus, eltIpOspfIfEntry=eltIpOspfIfEntry, eltOspfIfPassiveList=eltOspfIfPassiveList)
| (object_identifier, octet_string, integer) = mibBuilder.importSymbols('ASN1', 'ObjectIdentifier', 'OctetString', 'Integer')
(named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues')
(single_value_constraint, constraints_union, constraints_intersection, value_range_constraint, value_size_constraint) = mibBuilder.importSymbols('ASN1-REFINEMENT', 'SingleValueConstraint', 'ConstraintsUnion', 'ConstraintsIntersection', 'ValueRangeConstraint', 'ValueSizeConstraint')
(elt_mes,) = mibBuilder.importSymbols('ELTEX-MES', 'eltMes')
(elt_mes_ospf,) = mibBuilder.importSymbols('ELTEX-MES-IP', 'eltMesOspf')
(port_list,) = mibBuilder.importSymbols('Q-BRIDGE-MIB', 'PortList')
(notification_group, module_compliance) = mibBuilder.importSymbols('SNMPv2-CONF', 'NotificationGroup', 'ModuleCompliance')
(time_ticks, gauge32, object_identity, counter32, unsigned32, mib_identifier, counter64, notification_type, module_identity, integer32, mib_scalar, mib_table, mib_table_row, mib_table_column, bits, iso, ip_address) = mibBuilder.importSymbols('SNMPv2-SMI', 'TimeTicks', 'Gauge32', 'ObjectIdentity', 'Counter32', 'Unsigned32', 'MibIdentifier', 'Counter64', 'NotificationType', 'ModuleIdentity', 'Integer32', 'MibScalar', 'MibTable', 'MibTableRow', 'MibTableColumn', 'Bits', 'iso', 'IpAddress')
(textual_convention, display_string, row_status, truth_value) = mibBuilder.importSymbols('SNMPv2-TC', 'TextualConvention', 'DisplayString', 'RowStatus', 'TruthValue')
elt_ip_ospf_if_table = mib_table((1, 3, 6, 1, 4, 1, 35265, 1, 23, 91, 1, 2))
if mibBuilder.loadTexts:
eltIpOspfIfTable.setStatus('current')
elt_ip_ospf_if_entry = mib_table_row((1, 3, 6, 1, 4, 1, 35265, 1, 23, 91, 1, 2, 1)).setIndexNames((0, 'ELTEX-IP-OSPF-IF-MIB', 'eltOspfIfAddress'))
if mibBuilder.loadTexts:
eltIpOspfIfEntry.setStatus('current')
elt_ospf_if_address = mib_table_column((1, 3, 6, 1, 4, 1, 35265, 1, 23, 91, 1, 2, 1, 1), ip_address()).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
eltOspfIfAddress.setStatus('current')
elt_ospf_if_passive_default = mib_table_column((1, 3, 6, 1, 4, 1, 35265, 1, 23, 91, 1, 2, 1, 2), truth_value().clone('false')).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
eltOspfIfPassiveDefault.setStatus('current')
elt_ospf_if_passive_list = mib_table_column((1, 3, 6, 1, 4, 1, 35265, 1, 23, 91, 1, 2, 1, 3), port_list()).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
eltOspfIfPassiveList.setStatus('current')
elt_ospf_if_status = mib_table_column((1, 3, 6, 1, 4, 1, 35265, 1, 23, 91, 1, 2, 1, 4), row_status()).setMaxAccess('readcreate')
if mibBuilder.loadTexts:
eltOspfIfStatus.setStatus('current')
mibBuilder.exportSymbols('ELTEX-IP-OSPF-IF-MIB', eltOspfIfAddress=eltOspfIfAddress, eltOspfIfPassiveDefault=eltOspfIfPassiveDefault, eltIpOspfIfTable=eltIpOspfIfTable, eltOspfIfStatus=eltOspfIfStatus, eltIpOspfIfEntry=eltIpOspfIfEntry, eltOspfIfPassiveList=eltOspfIfPassiveList) |
# -*- coding: utf-8 -*-
def main():
s = input().split()
ans = list()
for si in s:
if '@' in si:
is_at = False
string = ''
for sii in si:
if sii == '@':
if string != '':
ans.append(string)
string = ''
is_at = True
elif is_at and sii != '@':
string += sii
if string != '':
ans.append(string)
print('\n'.join(map(str, sorted(set(ans)))))
if __name__ == '__main__':
main()
| def main():
s = input().split()
ans = list()
for si in s:
if '@' in si:
is_at = False
string = ''
for sii in si:
if sii == '@':
if string != '':
ans.append(string)
string = ''
is_at = True
elif is_at and sii != '@':
string += sii
if string != '':
ans.append(string)
print('\n'.join(map(str, sorted(set(ans)))))
if __name__ == '__main__':
main() |
# move.py
# handles movement in the world
def toRoom(server, player, command):
'''
moves player from their currentRoom to newRoom
'''
newRoom = None
#print "cmd:" + str(command)
#print "cmd0:" + str(command[0])
#print str(player.currentRoom.orderedExits)
# args = <some int>
if int(command[0]) <= len(player.currentRoom.orderedExits):
#print player.currentRoom.orderedExits
#print player.currentRoom.orderedExits[int(command[0])-1]
targetRoom = player.currentRoom.orderedExits[int(command[0])-1][0]
#print "tg:" + str(targetRoom)
for room in server.structureManager.masterRooms:
#print room.name, room.exits
if room.ID == targetRoom:
#print room.ID, room.exits
newRoom = room
#print 'nr:' + str(newRoom) + str(newRoom.exits)
elif int(command[0]) > len(player.currentRoom.orderedExits):
player.connection.send_cc("^! There are only " + str(len(player.currentRoom.orderedExits)) + " exits!^~\n")
return
# args = <exit description text>
cmdStr = " ".join(command)
#print "cmdStr:" + cmdStr
for exit in player.currentRoom.orderedExits:
if cmdStr == exit[1]:
newRoom = exit[0]
if newRoom != None:
#print player.currentRoom.players
player.currentRoom.players.remove(player)
#print player.currentRoom.players
#print player
for plyr in player.currentRoom.players:
plyr.connection.send_cc(player.name + " left.\n")
for room in server.structureManager.masterRooms:
if room.ID == newRoom:
newRoom = room
player.currentRoom = newRoom
server.Renderer.roomDisplay(player.connection, player.currentRoom)
for plyr in player.currentRoom.players:
plyr.connection.send_cc(player.name + " entered.\n")
player.currentRoom.players.append(player)
else:
# args does not point to an exit
player.connection.send_cc("^!I am not sure where I want to go!^~\n")
| def to_room(server, player, command):
"""
moves player from their currentRoom to newRoom
"""
new_room = None
if int(command[0]) <= len(player.currentRoom.orderedExits):
target_room = player.currentRoom.orderedExits[int(command[0]) - 1][0]
for room in server.structureManager.masterRooms:
if room.ID == targetRoom:
new_room = room
elif int(command[0]) > len(player.currentRoom.orderedExits):
player.connection.send_cc('^! There are only ' + str(len(player.currentRoom.orderedExits)) + ' exits!^~\n')
return
cmd_str = ' '.join(command)
for exit in player.currentRoom.orderedExits:
if cmdStr == exit[1]:
new_room = exit[0]
if newRoom != None:
player.currentRoom.players.remove(player)
for plyr in player.currentRoom.players:
plyr.connection.send_cc(player.name + ' left.\n')
for room in server.structureManager.masterRooms:
if room.ID == newRoom:
new_room = room
player.currentRoom = newRoom
server.Renderer.roomDisplay(player.connection, player.currentRoom)
for plyr in player.currentRoom.players:
plyr.connection.send_cc(player.name + ' entered.\n')
player.currentRoom.players.append(player)
else:
player.connection.send_cc('^!I am not sure where I want to go!^~\n') |
#!/usr/bin/env python3
# Testing apostraphes' in single quotes
# if I were to: print('he's done')
# error: compiler thinks the statement
# is ended at the apostraphe after 'he'.
# In order to print apostraphes and other
# characters like it, escape them:
print('he\'s done')
| print("he's done") |
# Given: A protein string P of length at most 1000 aa.
#
# Return: The total weight of P. Consult the monoisotopic mass table.
table = {}
tableFile = open("mass table.txt","r")
for line in tableFile:
table[line[0]]=float(line[4::].strip())
aaFile = open("input.txt","r")
total = float(0)
for aa in aaFile.read().replace("\n",""):
total += table[aa]
print("%.3f"%total)
| table = {}
table_file = open('mass table.txt', 'r')
for line in tableFile:
table[line[0]] = float(line[4:].strip())
aa_file = open('input.txt', 'r')
total = float(0)
for aa in aaFile.read().replace('\n', ''):
total += table[aa]
print('%.3f' % total) |
__author__ = "xTrinch"
__email__ = "mojca.rojko@gmail.com"
__version__ = "0.2.21"
class NotificationError(Exception):
pass
default_app_config = 'fcm_django.apps.FcmDjangoConfig'
| __author__ = 'xTrinch'
__email__ = 'mojca.rojko@gmail.com'
__version__ = '0.2.21'
class Notificationerror(Exception):
pass
default_app_config = 'fcm_django.apps.FcmDjangoConfig' |
'''
Intuition
Imagine you are writing a small compiler for your college project and one of the tasks (or say sub-tasks) for the compiler would be to detect if the parenthesis are in place or not.
The algorithm we will look at in this article can be then used to process all the parenthesis in the program your compiler is compiling and checking if all the parenthesis are in place. This makes checking if a given string of parenthesis is valid or not, an important programming problem.
The expressions that we will deal with in this problem can consist of three different type of parenthesis:
(),
{} and
[]
Before looking at how we can check if a given expression consisting of these parenthesis is valid or not, let us look at a simpler version of the problem that consists of just one type of parenthesis. So, the expressions we can encounter in this simplified version of the problem are e.g.
https://leetcode.com/problems/valid-parentheses/solution/
'''
class Solution:
def __init__(self):
self.stack = []
def isValid(self, s):
for i, el in enumerate(s):
if el == "(" or el == "{" or el == "[":
self.stack.append(el)
elif el == ")" or el == "}" or el == "]":
if len(self.stack) == 0:
return False
lastEl = self.stack[-1]
if el == ")" and lastEl != "(":
return False
if el == "}" and lastEl != "{":
return False
if el == "]" and lastEl != "[":
return False
self.stack.pop()
return len(self.stack) == 0
class Solution2(object):
def isValid(self, s):
while "()" in s or "{}" in s or '[]' in s:
s = s.replace("()", "").replace('{}', "").replace('[]', "")
return s == ''
| """
Intuition
Imagine you are writing a small compiler for your college project and one of the tasks (or say sub-tasks) for the compiler would be to detect if the parenthesis are in place or not.
The algorithm we will look at in this article can be then used to process all the parenthesis in the program your compiler is compiling and checking if all the parenthesis are in place. This makes checking if a given string of parenthesis is valid or not, an important programming problem.
The expressions that we will deal with in this problem can consist of three different type of parenthesis:
(),
{} and
[]
Before looking at how we can check if a given expression consisting of these parenthesis is valid or not, let us look at a simpler version of the problem that consists of just one type of parenthesis. So, the expressions we can encounter in this simplified version of the problem are e.g.
https://leetcode.com/problems/valid-parentheses/solution/
"""
class Solution:
def __init__(self):
self.stack = []
def is_valid(self, s):
for (i, el) in enumerate(s):
if el == '(' or el == '{' or el == '[':
self.stack.append(el)
elif el == ')' or el == '}' or el == ']':
if len(self.stack) == 0:
return False
last_el = self.stack[-1]
if el == ')' and lastEl != '(':
return False
if el == '}' and lastEl != '{':
return False
if el == ']' and lastEl != '[':
return False
self.stack.pop()
return len(self.stack) == 0
class Solution2(object):
def is_valid(self, s):
while '()' in s or '{}' in s or '[]' in s:
s = s.replace('()', '').replace('{}', '').replace('[]', '')
return s == '' |
kDragAttributeFromAE = []
kIncompatibleAttribute = []
kInvalidAttribute = []
kLayer = []
| k_drag_attribute_from_ae = []
k_incompatible_attribute = []
k_invalid_attribute = []
k_layer = [] |
DOTNETIMPL = {
"mono": None,
"core": None,
"net": None,
}
DOTNETOS = {
"darwin": "@bazel_tools//platforms:osx",
"linux": "@bazel_tools//platforms:linux",
"windows": "@bazel_tools//platforms:windows",
}
DOTNETARCH = {
"amd64": "@bazel_tools//platforms:x86_64",
}
DOTNETIMPL_OS_ARCH = (
("mono", "darwin", "amd64"),
("mono", "linux", "amd64"),
("mono", "windows", "amd64"),
("core", "darwin", "amd64"),
("core", "linux", "amd64"),
("core", "windows", "amd64"),
("net", "windows", "amd64"),
)
def declare_config_settings():
for impl in DOTNETIMPL:
native.config_setting(
name = impl,
#constraint_values = ["//dotnet/toolchain:" + impl],
values = {
"compilation_mode": impl
}
)
for os in DOTNETOS:
native.config_setting(
name = os,
constraint_values = ["//dotnet/toolchain:" + os],
)
for arch in DOTNETARCH:
native.config_setting(
name = arch,
constraint_values = ["//dotnet/toolchain:" + arch],
)
for impl, os, arch in DOTNETIMPL_OS_ARCH:
native.config_setting(
name = impl + "_" + os + "_" + arch,
constraint_values = [
"//dotnet/toolchain:" + os,
"//dotnet/toolchain:" + arch,
"//dotnet/toolchain:" + impl,
],
)
| dotnetimpl = {'mono': None, 'core': None, 'net': None}
dotnetos = {'darwin': '@bazel_tools//platforms:osx', 'linux': '@bazel_tools//platforms:linux', 'windows': '@bazel_tools//platforms:windows'}
dotnetarch = {'amd64': '@bazel_tools//platforms:x86_64'}
dotnetimpl_os_arch = (('mono', 'darwin', 'amd64'), ('mono', 'linux', 'amd64'), ('mono', 'windows', 'amd64'), ('core', 'darwin', 'amd64'), ('core', 'linux', 'amd64'), ('core', 'windows', 'amd64'), ('net', 'windows', 'amd64'))
def declare_config_settings():
for impl in DOTNETIMPL:
native.config_setting(name=impl, values={'compilation_mode': impl})
for os in DOTNETOS:
native.config_setting(name=os, constraint_values=['//dotnet/toolchain:' + os])
for arch in DOTNETARCH:
native.config_setting(name=arch, constraint_values=['//dotnet/toolchain:' + arch])
for (impl, os, arch) in DOTNETIMPL_OS_ARCH:
native.config_setting(name=impl + '_' + os + '_' + arch, constraint_values=['//dotnet/toolchain:' + os, '//dotnet/toolchain:' + arch, '//dotnet/toolchain:' + impl]) |
def cheese_and_crackers(cheese_count, boxes_of_crackers):
print("You have ", cheese_count, "cheese!")
print("you have ", boxes_of_crackers," boxes of crackers!")
print("Man that's enough for a party!")
print("Get a blamnket.\n")
print("We can just give the function numbers directly:")
cheese_and_crackers(20,30)
print("Or we can use variables from our script :")
amount_of_cheese = 10
amount_of_crackers = 50
cheese_and_crackers(amount_of_cheese, amount_of_crackers)
print("we can even do match inside too:")
cheese_and_crackers(10 + 20 , 5 + 6)
print("And we can combine the two ,variables and match:")
cheese_and_crackers(amount_of_cheese + 100 , amount_of_crackers - 1000)
| def cheese_and_crackers(cheese_count, boxes_of_crackers):
print('You have ', cheese_count, 'cheese!')
print('you have ', boxes_of_crackers, ' boxes of crackers!')
print("Man that's enough for a party!")
print('Get a blamnket.\n')
print('We can just give the function numbers directly:')
cheese_and_crackers(20, 30)
print('Or we can use variables from our script :')
amount_of_cheese = 10
amount_of_crackers = 50
cheese_and_crackers(amount_of_cheese, amount_of_crackers)
print('we can even do match inside too:')
cheese_and_crackers(10 + 20, 5 + 6)
print('And we can combine the two ,variables and match:')
cheese_and_crackers(amount_of_cheese + 100, amount_of_crackers - 1000) |
x=100
text="python tutorial"
print(x)
print(text)
# Assign values to multiple variables
x,y,z=10,20,30
print(x)
print(y)
print(z) | x = 100
text = 'python tutorial'
print(x)
print(text)
(x, y, z) = (10, 20, 30)
print(x)
print(y)
print(z) |
p = [0, 4, 8, 6, 2, 10, 100000000]
s=[]
d = {}
rem=10
for i in p:
if i in d:
d[i] += 1
else:
d[i] = 1
for i in range(0,rem/2+1):
if i in d:
pair = [i, rem-i]
if pair[0]==pair[1] and d[i]>=2:
s.append(pair)
elif pair[1] in d:
s.append(pair)
print(s)
#######################################################################################
#######################################################################################
rem55 = set()
golden_val = 10 # The diff we want
result = set()
for ele in p:
if ele in rem55:
result.add((ele, golden_val-ele))
rem55.add(golden_val-ele)
print(result)
| p = [0, 4, 8, 6, 2, 10, 100000000]
s = []
d = {}
rem = 10
for i in p:
if i in d:
d[i] += 1
else:
d[i] = 1
for i in range(0, rem / 2 + 1):
if i in d:
pair = [i, rem - i]
if pair[0] == pair[1] and d[i] >= 2:
s.append(pair)
elif pair[1] in d:
s.append(pair)
print(s)
rem55 = set()
golden_val = 10
result = set()
for ele in p:
if ele in rem55:
result.add((ele, golden_val - ele))
rem55.add(golden_val - ele)
print(result) |
class Solution(object):
def wordPattern(self, pattern, str):
dic = {}
dic2 = {}
words = str.split(" ")
if len(pattern) != len(words):
return False
i = 0
for cha in pattern:
if cha in dic.keys():
if dic[cha] != words[i]:
return False
else:
dic[cha] = words[i]
i += 1
i = 0
for word in words:
if word in dic2.keys():
if dic2[word] != pattern[i]:
return False
else:
dic2[word] = pattern[i]
i += 1
return True
solution = Solution()
print(solution.wordPattern("abba", "dog cat cat dog"))
print(solution.wordPattern("abba", "dog cat cat fish"))
print(solution.wordPattern("aaaa", "dog cat cat dog"))
print(solution.wordPattern("abba", "dog dog dog dog")) | class Solution(object):
def word_pattern(self, pattern, str):
dic = {}
dic2 = {}
words = str.split(' ')
if len(pattern) != len(words):
return False
i = 0
for cha in pattern:
if cha in dic.keys():
if dic[cha] != words[i]:
return False
else:
dic[cha] = words[i]
i += 1
i = 0
for word in words:
if word in dic2.keys():
if dic2[word] != pattern[i]:
return False
else:
dic2[word] = pattern[i]
i += 1
return True
solution = solution()
print(solution.wordPattern('abba', 'dog cat cat dog'))
print(solution.wordPattern('abba', 'dog cat cat fish'))
print(solution.wordPattern('aaaa', 'dog cat cat dog'))
print(solution.wordPattern('abba', 'dog dog dog dog')) |
class Solution:
def lastStoneWeight(self, stones: List[int]) -> int:
while len(stones) > 1:
stones.sort()
a = stones.pop()
b = stones.pop()
last = a - b
if last:
stones.append(last)
return stones[0] if stones else 0 | class Solution:
def last_stone_weight(self, stones: List[int]) -> int:
while len(stones) > 1:
stones.sort()
a = stones.pop()
b = stones.pop()
last = a - b
if last:
stones.append(last)
return stones[0] if stones else 0 |
class MyHashSet:
def __init__(self):
self.buckets = []
def hash(self, key: int) -> str:
return chr(key)
def add(self, key: int) -> None:
val = self.hash(key)
if val not in self.buckets:
self.buckets.append(val)
def remove(self, key: int) -> None:
val = self.hash(key)
if val in self.buckets:
self.buckets.remove(val)
def contains(self, key: int) -> bool:
return self.hash(key) in self.buckets
class MyHashMap:
def __init__(self):
self.buckets = []
@property
def keys(self) -> list:
return [x[0] for x in self.buckets]
def put(self, key: int, value: int) -> None:
if key in self.keys:
index = 0
for bucket in self.buckets:
if bucket[0] == key:
self.buckets[index] = (key, value)
break
index += 1
else:
self.buckets.append((key, value))
def get(self, key: int) -> int:
if key in self.keys:
for bucket in self.buckets:
if bucket[0] == key:
return bucket[1]
else:
return -1
def remove(self, key: int) -> None:
if key in self.keys:
for bucket in self.buckets:
if bucket[0] == key:
val = (bucket[0], bucket[1])
break
self.buckets.remove(val) | class Myhashset:
def __init__(self):
self.buckets = []
def hash(self, key: int) -> str:
return chr(key)
def add(self, key: int) -> None:
val = self.hash(key)
if val not in self.buckets:
self.buckets.append(val)
def remove(self, key: int) -> None:
val = self.hash(key)
if val in self.buckets:
self.buckets.remove(val)
def contains(self, key: int) -> bool:
return self.hash(key) in self.buckets
class Myhashmap:
def __init__(self):
self.buckets = []
@property
def keys(self) -> list:
return [x[0] for x in self.buckets]
def put(self, key: int, value: int) -> None:
if key in self.keys:
index = 0
for bucket in self.buckets:
if bucket[0] == key:
self.buckets[index] = (key, value)
break
index += 1
else:
self.buckets.append((key, value))
def get(self, key: int) -> int:
if key in self.keys:
for bucket in self.buckets:
if bucket[0] == key:
return bucket[1]
else:
return -1
def remove(self, key: int) -> None:
if key in self.keys:
for bucket in self.buckets:
if bucket[0] == key:
val = (bucket[0], bucket[1])
break
self.buckets.remove(val) |
def min_number(num_list):
min_num = None
for num in num_list:
if min_num is None or min_num > num:
min_num = num
return min_num
| def min_number(num_list):
min_num = None
for num in num_list:
if min_num is None or min_num > num:
min_num = num
return min_num |
def pytest_addoption(parser):
group = parser.getgroup("pypyjit options")
group.addoption("--pypy", action="store", default=None, dest="pypy_c",
help="the location of the JIT enabled pypy-c")
| def pytest_addoption(parser):
group = parser.getgroup('pypyjit options')
group.addoption('--pypy', action='store', default=None, dest='pypy_c', help='the location of the JIT enabled pypy-c') |
expected_output = {
"interfaces": {
"Port-channel20": {
"description": "distacc Te1/1/1, Te2/1/1",
"switchport_trunk_vlans": "9,51",
"switchport_mode": "trunk",
"ip_arp_inspection_trust": True,
"ip_dhcp_snooping_trust": True,
},
"GigabitEthernet0/0": {
"vrf": "Mgmt-vrf",
"shutdown": True,
"negotiation_auto": True,
},
"GigabitEthernet1/0/1": {
"description": "unknown DA",
"switchport_access_vlan": "51",
"switchport_mode": "access",
"spanning_tree_portfast": True,
"ip_dhcp_snooping_limit_rate": "10",
},
"GigabitEthernet1/0/2": {
"description": "DA1202B_21_13 ap-100",
"switchport_access_vlan": "51",
"switchport_mode": "access",
"spanning_tree_portfast": True,
"ip_dhcp_snooping_limit_rate": "10",
},
}
}
| expected_output = {'interfaces': {'Port-channel20': {'description': 'distacc Te1/1/1, Te2/1/1', 'switchport_trunk_vlans': '9,51', 'switchport_mode': 'trunk', 'ip_arp_inspection_trust': True, 'ip_dhcp_snooping_trust': True}, 'GigabitEthernet0/0': {'vrf': 'Mgmt-vrf', 'shutdown': True, 'negotiation_auto': True}, 'GigabitEthernet1/0/1': {'description': 'unknown DA', 'switchport_access_vlan': '51', 'switchport_mode': 'access', 'spanning_tree_portfast': True, 'ip_dhcp_snooping_limit_rate': '10'}, 'GigabitEthernet1/0/2': {'description': 'DA1202B_21_13 ap-100', 'switchport_access_vlan': '51', 'switchport_mode': 'access', 'spanning_tree_portfast': True, 'ip_dhcp_snooping_limit_rate': '10'}}} |
#SKill : array iteration
#A UTF-8 character encoding is a variable width character encoding
# that can vary from 1 to 4 bytes depending on the character. The structure of the encoding is as follows:
#1 byte: 0xxxxxxx
#2 bytes: 110xxxxx 10xxxxxx
#3 bytes: 1110xxxx 10xxxxxx 10xxxxxx
#4 bytes: 11110xxx 10xxxxxx 10xxxxxx 10xxxxxx
#For more information, you can read up on the Wikipedia Page.
#Given a list of integers where each integer represents 1 byte, return whether or not the list of integers is a valid UTF-8 encoding.
#Analysis
# State machine
# check pattern in sequence
# from 4 byte to 1 byte pattern
# For first byte, XOR(first byte, 4 byte mask) = value....
# if value <= 1<<3, match, otherwise, not match and try 3 byte to 1 byte mask
# if it is N byte, check consecutive N-1 byte , if match XOR (byte, b10000000), if value < 1<<6, match... otherwise not match
BYTE_MASKS = [
None,
0b10000000,
0b11100000,
0b11110000,
0b11111000,
]
BYTE_EQUAL = [
None,
0b00000000,
0b11000000,
0b11100000,
0b11110000,
]
def utf8_validator(bytes):
numOfBytes = 4
cnt=0
while cnt < len(bytes):
while numOfBytes>0:
value = bytes[cnt] & BYTE_MASKS[numOfBytes]
if value == BYTE_EQUAL[numOfBytes]:
break
else:
numOfBytes -= 1
i = 0
if numOfBytes < 1:
return False
if numOfBytes + cnt > len(bytes):
return False
cnt += 1
while i < numOfBytes-1:
value = bytes[cnt + i] ^ 0b10000000
if value < 1<<6:
i +=1
else:
return False
cnt += (numOfBytes-1)
numOfBytes = 4
return True
if __name__ == "__main__":
print(utf8_validator([0b11000000, 0b10000000, 0b00000000]))
# True
print(utf8_validator([0b11000000, 0b00000000]))
# False
print (utf8_validator([0b11000000, 0b10000000]))
# True
print (utf8_validator([0b00000000]))
# True
print (utf8_validator([0b00000000, 0b10000000]))
# False
| byte_masks = [None, 128, 224, 240, 248]
byte_equal = [None, 0, 192, 224, 240]
def utf8_validator(bytes):
num_of_bytes = 4
cnt = 0
while cnt < len(bytes):
while numOfBytes > 0:
value = bytes[cnt] & BYTE_MASKS[numOfBytes]
if value == BYTE_EQUAL[numOfBytes]:
break
else:
num_of_bytes -= 1
i = 0
if numOfBytes < 1:
return False
if numOfBytes + cnt > len(bytes):
return False
cnt += 1
while i < numOfBytes - 1:
value = bytes[cnt + i] ^ 128
if value < 1 << 6:
i += 1
else:
return False
cnt += numOfBytes - 1
num_of_bytes = 4
return True
if __name__ == '__main__':
print(utf8_validator([192, 128, 0]))
print(utf8_validator([192, 0]))
print(utf8_validator([192, 128]))
print(utf8_validator([0]))
print(utf8_validator([0, 128])) |
ES_HOST = 'localhost'
ES_PORT = 9200
BULK_MAX_OPS_CNT = 1000
INDEX_NAME = 'cosc488'
INDEX_SETTINGS_FP = 'properties/index_settings.json'
DATA_DIR = 'data/docs'
QUERIES_FP = 'data/queryfile.txt'
QRELS_FP = 'data/qrel.txt'
TRECEVAL_FP = 'bin/trec_eval'
| es_host = 'localhost'
es_port = 9200
bulk_max_ops_cnt = 1000
index_name = 'cosc488'
index_settings_fp = 'properties/index_settings.json'
data_dir = 'data/docs'
queries_fp = 'data/queryfile.txt'
qrels_fp = 'data/qrel.txt'
treceval_fp = 'bin/trec_eval' |
prev = None
def check_bst(root):
if not root:
return True
ans = check_bst(root.left)
if ans == False:
return False
if prev and root.value < prev:
return False
global prev
prev = root
return check_bst(root.right)
| prev = None
def check_bst(root):
if not root:
return True
ans = check_bst(root.left)
if ans == False:
return False
if prev and root.value < prev:
return False
global prev
prev = root
return check_bst(root.right) |
#!/usr/bin/python3.5
class MyClass:
"This is a class"
a = 10;
def func(self):
print('Hello World');
return 3;
def my_function(a: MyClass):
return a.func();
def other_function(b: my_function):
a = MyClass();
return my_function(a);
def object_function(obj: object):
return 3;
| class Myclass:
"""This is a class"""
a = 10
def func(self):
print('Hello World')
return 3
def my_function(a: MyClass):
return a.func()
def other_function(b: my_function):
a = my_class()
return my_function(a)
def object_function(obj: object):
return 3 |
### PROBLEM 1
def main():
print("Name: Shaymae Senhaji")
print("Favorite Food: Brie Cheese")
print("Favorite Color: Red")
print("Favorite Hobby: Traveling")
if __name__ == "__main__":
main()
#Name: Shaymae Senhaji
#Favorite Food: Brie Cheese
#Favorite Color: Red
#Favorite Hobby: Traveling
| def main():
print('Name: Shaymae Senhaji')
print('Favorite Food: Brie Cheese')
print('Favorite Color: Red')
print('Favorite Hobby: Traveling')
if __name__ == '__main__':
main() |
## Does my number look big in this?
## 6 kyu
## https://www.codewars.com/kata/5287e858c6b5a9678200083c
def narcissistic(value):
total = 0
for digit in str(value):
total += int(digit) ** len(str(value))
return value == total | def narcissistic(value):
total = 0
for digit in str(value):
total += int(digit) ** len(str(value))
return value == total |
# This is the ball class that handles everything related to Balls
class Ball:
# The __init__ method is used to initialize class variables
def __init__(self, position, velocity, acceleration):
# Each ball has a position, velocity and acceleration
self.position = position
self.velocity = velocity
self.acceleration = acceleration
# The display method handles drawing the ball
def display(self):
noStroke()
fill(255, 0, 0)
ellipse(self.position.x, self.position.y, 50, 50)
# The move method handles moving the Ball
def move(self):
# Velocity changes according to acceleration
self.velocity.add(self.acceleration)
# Position changes according to velocity
self.position.add(self.velocity)
# Reset acceleration
self.acceleration.mult(0)
# The add_force method adds a force to the acceleration of the Ball
def add_force(self, force):
self.acceleration.add(force)
# check_ground checks if the ball falls off the bottom of the screen.
# if it is off the screen, the ball bounces up
def check_ground(self):
if self.position.y > height:
self.velocity.y *= -1
self.position.y = height
gravity = PVector(0, 1)
# creating a new ball at position 250, 250 with velocity and acceleration 0
b = Ball(PVector(250, 250), PVector(0, 0), PVector(0, 0))
def setup():
size(500, 500)
def draw():
background(0)
b.display()
b.move()
b.add_force(gravity)
b.check_ground()
| class Ball:
def __init__(self, position, velocity, acceleration):
self.position = position
self.velocity = velocity
self.acceleration = acceleration
def display(self):
no_stroke()
fill(255, 0, 0)
ellipse(self.position.x, self.position.y, 50, 50)
def move(self):
self.velocity.add(self.acceleration)
self.position.add(self.velocity)
self.acceleration.mult(0)
def add_force(self, force):
self.acceleration.add(force)
def check_ground(self):
if self.position.y > height:
self.velocity.y *= -1
self.position.y = height
gravity = p_vector(0, 1)
b = ball(p_vector(250, 250), p_vector(0, 0), p_vector(0, 0))
def setup():
size(500, 500)
def draw():
background(0)
b.display()
b.move()
b.add_force(gravity)
b.check_ground() |
def hashfunction(key):
sum=0
for i in key:
sum+=ord(i)
return sum%100
hashtable=[]
def insertkey(key,value):
hashkey=hashfunction(key)
return hashtable[hashkey].append(value)
| def hashfunction(key):
sum = 0
for i in key:
sum += ord(i)
return sum % 100
hashtable = []
def insertkey(key, value):
hashkey = hashfunction(key)
return hashtable[hashkey].append(value) |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.