content
stringlengths 7
1.05M
| fixed_cases
stringlengths 1
1.28M
|
---|---|
# Difficulty: Easy
# Problem Statement: https://leetcode.com/problems/add-binary/
class Solution:
def addBinary(self, a: str, b: str) -> str:
return bin(int(a, 2) + int(b, 2))[2:] | class Solution:
def add_binary(self, a: str, b: str) -> str:
return bin(int(a, 2) + int(b, 2))[2:] |
# Het is so simpel als het toevoegen van een save commando aan het stuk
# code die de chart daadwerkelijk genereert. In bovenstand voorbeeld dus:
alt.vconcat(points, bars,
data=data.seattle_weather.url,
title="Seattle Weather: 2012-2015"
).save('Seattle.html')
# De interactiviteit zit in je html file besloten!
| alt.vconcat(points, bars, data=data.seattle_weather.url, title='Seattle Weather: 2012-2015').save('Seattle.html') |
test = { 'name': 'q5_3',
'points': 1,
'suites': [ { 'cases': [ { 'code': '>>> # The statistic should be between 0 and 13 face cards for a sample size of 13;\n'
'>>> num_face = deck_simulation_and_statistic(13, deck_model_probabilities);\n'
'>>> 0 <= num_face <= 13\n'
'True',
'hidden': False,
'locked': False}],
'scored': True,
'setup': '',
'teardown': '',
'type': 'doctest'}]}
| test = {'name': 'q5_3', 'points': 1, 'suites': [{'cases': [{'code': '>>> # The statistic should be between 0 and 13 face cards for a sample size of 13;\n>>> num_face = deck_simulation_and_statistic(13, deck_model_probabilities);\n>>> 0 <= num_face <= 13\nTrue', 'hidden': False, 'locked': False}], 'scored': True, 'setup': '', 'teardown': '', 'type': 'doctest'}]} |
pkg_dnf = {
'collectd': {},
}
svc_systemd = {
'collectd': {
'needs': ['pkg_dnf:collectd'],
},
}
files = {
'/etc/collectd.conf': {
'mode': '0600',
'content_type': 'mako',
'context': {
'collectd': node.metadata.get('collectd', {}),
},
'needs': ['pkg_dnf:collectd'],
'triggers': ['svc_systemd:collectd:restart'],
},
'/etc/collectd.d/nut.conf': {
'delete': True,
'needs': ['pkg_dnf:collectd'],
},
}
if node.metadata.get('collectd', {}).get('client'):
files['/etc/collectd.d/client.conf'] = {
'mode': '0600',
'content_type': 'mako',
'context': {
'client': node.metadata.get('collectd', {}).get('client', {}),
},
'needs': ['pkg_dnf:collectd'],
'triggers': ['svc_systemd:collectd:restart'],
}
| pkg_dnf = {'collectd': {}}
svc_systemd = {'collectd': {'needs': ['pkg_dnf:collectd']}}
files = {'/etc/collectd.conf': {'mode': '0600', 'content_type': 'mako', 'context': {'collectd': node.metadata.get('collectd', {})}, 'needs': ['pkg_dnf:collectd'], 'triggers': ['svc_systemd:collectd:restart']}, '/etc/collectd.d/nut.conf': {'delete': True, 'needs': ['pkg_dnf:collectd']}}
if node.metadata.get('collectd', {}).get('client'):
files['/etc/collectd.d/client.conf'] = {'mode': '0600', 'content_type': 'mako', 'context': {'client': node.metadata.get('collectd', {}).get('client', {})}, 'needs': ['pkg_dnf:collectd'], 'triggers': ['svc_systemd:collectd:restart']} |
#Fibonacci
Fibonacci.py
# Fibonacci numbers module
#n = int(input('Please enter a number: '))
def fib(n):
a, b = 0, 1
while a < n:
print(a, end=' ')
a, b = b, a+b
print()
# Go to fibonacci Powerpoint
def fib2(n): # return Fibonacci series
result = []
a, b = 0, 1
while a < n:
result.append(a)
a, b = b, a+b
return result
#>>> fib #import
| Fibonacci.py
def fib(n):
(a, b) = (0, 1)
while a < n:
print(a, end=' ')
(a, b) = (b, a + b)
print()
def fib2(n):
result = []
(a, b) = (0, 1)
while a < n:
result.append(a)
(a, b) = (b, a + b)
return result |
#Parameters given at the beginning of the APP
zid_min = 1E06 #1Mohm
zic_min = 10E06 #10Mohm
GM_min = 10 #dB
PM_min = 30 #deg
CL_min = 0 #0uF
CL_max = 1E-06 #1uF
Rl = 10 #10ohm
Fc_low = 0 #DC
Fc_high = 100E03 #100kHz
CMRR_min = 100 #dB
AvCL = 10 #V/V
THD = 0.01 #env. 1% 10kHz & Vout = 10Vcrete
Dyn_range = 10 # V crete
CM_min = -2 # V
CM_max = 2 # V
| zid_min = 1000000.0
zic_min = 10000000.0
gm_min = 10
pm_min = 30
cl_min = 0
cl_max = 1e-06
rl = 10
fc_low = 0
fc_high = 100000.0
cmrr_min = 100
av_cl = 10
thd = 0.01
dyn_range = 10
cm_min = -2
cm_max = 2 |
#
# PySNMP MIB module IPFIX-SELECTOR-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/IPFIX-SELECTOR-MIB
# Produced by pysmi-0.3.4 at Mon Apr 29 19:44:48 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 (default, Mar 27 2019, 09:23:15)
#
OctetString, Integer, ObjectIdentifier = mibBuilder.importSymbols("ASN1", "OctetString", "Integer", "ObjectIdentifier")
NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues")
ValueSizeConstraint, SingleValueConstraint, ValueRangeConstraint, ConstraintsUnion, ConstraintsIntersection = mibBuilder.importSymbols("ASN1-REFINEMENT", "ValueSizeConstraint", "SingleValueConstraint", "ValueRangeConstraint", "ConstraintsUnion", "ConstraintsIntersection")
ModuleCompliance, NotificationGroup, ObjectGroup = mibBuilder.importSymbols("SNMPv2-CONF", "ModuleCompliance", "NotificationGroup", "ObjectGroup")
ObjectIdentity, TimeTicks, MibScalar, MibTable, MibTableRow, MibTableColumn, Unsigned32, Bits, ModuleIdentity, Counter64, Gauge32, MibIdentifier, Integer32, IpAddress, mib_2, Counter32, iso, NotificationType = mibBuilder.importSymbols("SNMPv2-SMI", "ObjectIdentity", "TimeTicks", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "Unsigned32", "Bits", "ModuleIdentity", "Counter64", "Gauge32", "MibIdentifier", "Integer32", "IpAddress", "mib-2", "Counter32", "iso", "NotificationType")
TextualConvention, TruthValue, DisplayString = mibBuilder.importSymbols("SNMPv2-TC", "TextualConvention", "TruthValue", "DisplayString")
ipfixSelectorMIB = ModuleIdentity((1, 3, 6, 1, 2, 1, 194))
ipfixSelectorMIB.setRevisions(('2012-06-11 00:00', '2010-03-15 00:00',))
if mibBuilder.loadTexts: ipfixSelectorMIB.setLastUpdated('201206110000Z')
if mibBuilder.loadTexts: ipfixSelectorMIB.setOrganization('IETF IPFIX Working Group')
ipfixSelectorObjects = MibIdentifier((1, 3, 6, 1, 2, 1, 194, 1))
ipfixSelectorConformance = MibIdentifier((1, 3, 6, 1, 2, 1, 194, 2))
ipfixSelectorFunctions = MibIdentifier((1, 3, 6, 1, 2, 1, 194, 1, 1))
ipfixFuncSelectAll = MibIdentifier((1, 3, 6, 1, 2, 1, 194, 1, 1, 1))
ipfixFuncSelectAllAvail = MibScalar((1, 3, 6, 1, 2, 1, 194, 1, 1, 1, 1), TruthValue()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ipfixFuncSelectAllAvail.setStatus('current')
ipfixSelectorCompliances = MibIdentifier((1, 3, 6, 1, 2, 1, 194, 2, 1))
ipfixSelectorGroups = MibIdentifier((1, 3, 6, 1, 2, 1, 194, 2, 2))
ipfixSelectorBasicCompliance = ModuleCompliance((1, 3, 6, 1, 2, 1, 194, 2, 1, 1)).setObjects(("IPFIX-SELECTOR-MIB", "ipfixSelectorBasicGroup"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ipfixSelectorBasicCompliance = ipfixSelectorBasicCompliance.setStatus('current')
ipfixSelectorBasicGroup = ObjectGroup((1, 3, 6, 1, 2, 1, 194, 2, 2, 1)).setObjects(("IPFIX-SELECTOR-MIB", "ipfixFuncSelectAllAvail"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ipfixSelectorBasicGroup = ipfixSelectorBasicGroup.setStatus('current')
mibBuilder.exportSymbols("IPFIX-SELECTOR-MIB", ipfixFuncSelectAllAvail=ipfixFuncSelectAllAvail, ipfixSelectorBasicCompliance=ipfixSelectorBasicCompliance, ipfixSelectorGroups=ipfixSelectorGroups, ipfixSelectorConformance=ipfixSelectorConformance, PYSNMP_MODULE_ID=ipfixSelectorMIB, ipfixSelectorObjects=ipfixSelectorObjects, ipfixFuncSelectAll=ipfixFuncSelectAll, ipfixSelectorCompliances=ipfixSelectorCompliances, ipfixSelectorMIB=ipfixSelectorMIB, ipfixSelectorBasicGroup=ipfixSelectorBasicGroup, ipfixSelectorFunctions=ipfixSelectorFunctions)
| (octet_string, integer, object_identifier) = mibBuilder.importSymbols('ASN1', 'OctetString', 'Integer', 'ObjectIdentifier')
(named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues')
(value_size_constraint, single_value_constraint, value_range_constraint, constraints_union, constraints_intersection) = mibBuilder.importSymbols('ASN1-REFINEMENT', 'ValueSizeConstraint', 'SingleValueConstraint', 'ValueRangeConstraint', 'ConstraintsUnion', 'ConstraintsIntersection')
(module_compliance, notification_group, object_group) = mibBuilder.importSymbols('SNMPv2-CONF', 'ModuleCompliance', 'NotificationGroup', 'ObjectGroup')
(object_identity, time_ticks, mib_scalar, mib_table, mib_table_row, mib_table_column, unsigned32, bits, module_identity, counter64, gauge32, mib_identifier, integer32, ip_address, mib_2, counter32, iso, notification_type) = mibBuilder.importSymbols('SNMPv2-SMI', 'ObjectIdentity', 'TimeTicks', 'MibScalar', 'MibTable', 'MibTableRow', 'MibTableColumn', 'Unsigned32', 'Bits', 'ModuleIdentity', 'Counter64', 'Gauge32', 'MibIdentifier', 'Integer32', 'IpAddress', 'mib-2', 'Counter32', 'iso', 'NotificationType')
(textual_convention, truth_value, display_string) = mibBuilder.importSymbols('SNMPv2-TC', 'TextualConvention', 'TruthValue', 'DisplayString')
ipfix_selector_mib = module_identity((1, 3, 6, 1, 2, 1, 194))
ipfixSelectorMIB.setRevisions(('2012-06-11 00:00', '2010-03-15 00:00'))
if mibBuilder.loadTexts:
ipfixSelectorMIB.setLastUpdated('201206110000Z')
if mibBuilder.loadTexts:
ipfixSelectorMIB.setOrganization('IETF IPFIX Working Group')
ipfix_selector_objects = mib_identifier((1, 3, 6, 1, 2, 1, 194, 1))
ipfix_selector_conformance = mib_identifier((1, 3, 6, 1, 2, 1, 194, 2))
ipfix_selector_functions = mib_identifier((1, 3, 6, 1, 2, 1, 194, 1, 1))
ipfix_func_select_all = mib_identifier((1, 3, 6, 1, 2, 1, 194, 1, 1, 1))
ipfix_func_select_all_avail = mib_scalar((1, 3, 6, 1, 2, 1, 194, 1, 1, 1, 1), truth_value()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
ipfixFuncSelectAllAvail.setStatus('current')
ipfix_selector_compliances = mib_identifier((1, 3, 6, 1, 2, 1, 194, 2, 1))
ipfix_selector_groups = mib_identifier((1, 3, 6, 1, 2, 1, 194, 2, 2))
ipfix_selector_basic_compliance = module_compliance((1, 3, 6, 1, 2, 1, 194, 2, 1, 1)).setObjects(('IPFIX-SELECTOR-MIB', 'ipfixSelectorBasicGroup'))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ipfix_selector_basic_compliance = ipfixSelectorBasicCompliance.setStatus('current')
ipfix_selector_basic_group = object_group((1, 3, 6, 1, 2, 1, 194, 2, 2, 1)).setObjects(('IPFIX-SELECTOR-MIB', 'ipfixFuncSelectAllAvail'))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ipfix_selector_basic_group = ipfixSelectorBasicGroup.setStatus('current')
mibBuilder.exportSymbols('IPFIX-SELECTOR-MIB', ipfixFuncSelectAllAvail=ipfixFuncSelectAllAvail, ipfixSelectorBasicCompliance=ipfixSelectorBasicCompliance, ipfixSelectorGroups=ipfixSelectorGroups, ipfixSelectorConformance=ipfixSelectorConformance, PYSNMP_MODULE_ID=ipfixSelectorMIB, ipfixSelectorObjects=ipfixSelectorObjects, ipfixFuncSelectAll=ipfixFuncSelectAll, ipfixSelectorCompliances=ipfixSelectorCompliances, ipfixSelectorMIB=ipfixSelectorMIB, ipfixSelectorBasicGroup=ipfixSelectorBasicGroup, ipfixSelectorFunctions=ipfixSelectorFunctions) |
grid_view_field_options_schema = {
'type': 'object',
'description': 'An object containing the field id as key and the '
'properties related to view as value.',
'properties': {
'1': {
'type': 'object',
'description': 'Properties of field with id 1 of the related view.',
'properties': {
'width': {
'type': 'integer',
'example': 200,
'description': 'The width of the table field in the related view.'
},
'hidden': {
'type': 'boolean',
'example': True,
'description': 'Whether or not the field should be hidden in the '
'current view.'
}
}
},
}
}
| grid_view_field_options_schema = {'type': 'object', 'description': 'An object containing the field id as key and the properties related to view as value.', 'properties': {'1': {'type': 'object', 'description': 'Properties of field with id 1 of the related view.', 'properties': {'width': {'type': 'integer', 'example': 200, 'description': 'The width of the table field in the related view.'}, 'hidden': {'type': 'boolean', 'example': True, 'description': 'Whether or not the field should be hidden in the current view.'}}}}} |
#!/usr/bin/env python3
# vim: set ai et ts=4 sw=4:
def gen(arg, begin, pixels, arr):
for i in range(0, int(2**len(arr))):
if i > 0:
print("else");
if i != int(2**len(arr)) - 1:
print("if({} < ({} + ({}/{})*{}))".format(
arg, begin, pixels, int(2**len(arr)), i+1))
print("begin")
for j in range(0, len(arr)):
print((" " * 4) + "{} <= {};".format(
arr[j], "1" if i & (1 << j) else "0"))
print("end")
gen("hctr", "horiz_vis_begin", "horiz_active_pixels",
["r[0]", "r[1]", "r[2]", "g[0]"])
gen("vctr", "vert_vis_begin", "vert_active_pixels",
["g[1]", "g[2]", "b[0]", "b[1]"])
| def gen(arg, begin, pixels, arr):
for i in range(0, int(2 ** len(arr))):
if i > 0:
print('else')
if i != int(2 ** len(arr)) - 1:
print('if({} < ({} + ({}/{})*{}))'.format(arg, begin, pixels, int(2 ** len(arr)), i + 1))
print('begin')
for j in range(0, len(arr)):
print(' ' * 4 + '{} <= {};'.format(arr[j], '1' if i & 1 << j else '0'))
print('end')
gen('hctr', 'horiz_vis_begin', 'horiz_active_pixels', ['r[0]', 'r[1]', 'r[2]', 'g[0]'])
gen('vctr', 'vert_vis_begin', 'vert_active_pixels', ['g[1]', 'g[2]', 'b[0]', 'b[1]']) |
class Song:
def __init__(self, json):
# playlist tracks not queryable over API
if not json:
raise LookupError
self.name = json['name']
self.artists = list(map(lambda artist: artist['name'], json['artists']))
self.album = json['album']['name']
def __str__(self) -> str:
return self.name + ' - ' + ', '.join(self.artists) + ' (' + self.album + ')'
| class Song:
def __init__(self, json):
if not json:
raise LookupError
self.name = json['name']
self.artists = list(map(lambda artist: artist['name'], json['artists']))
self.album = json['album']['name']
def __str__(self) -> str:
return self.name + ' - ' + ', '.join(self.artists) + ' (' + self.album + ')' |
# test with
with open("test.txt") as f:
f.write("hello worlds")
f.read()
| with open('test.txt') as f:
f.write('hello worlds')
f.read() |
class File(object):
def __init__(self):
self.filename = ''
self.server_filename = ''
self.rotate = 0
self.password = None
# file_encryption_key TBD
self.file_encryption_key = None
self.metas = {}
@property
def metas_values(self):
return "Title", "Author", "Subject", "Keywords", "Creator", "Producer", "CreationDate", "ModDate", "Trapped"
def get_file_options(self):
pass
def set_metas(self, key, value):
if key in self.metas_values:
self.metas[key] = value
else:
raise ValueError("'%s' is not a meta tag: %s" % (key, self.metas))
def as_dict(self):
for k in dir(self):
if getattr(self, k) and \
'set_metas' not in k and 'get_file_options' not in k and 'as_dict' not in k \
and '__' not in k and '_values' not in k:
yield(k, getattr(self, k))
| class File(object):
def __init__(self):
self.filename = ''
self.server_filename = ''
self.rotate = 0
self.password = None
self.file_encryption_key = None
self.metas = {}
@property
def metas_values(self):
return ('Title', 'Author', 'Subject', 'Keywords', 'Creator', 'Producer', 'CreationDate', 'ModDate', 'Trapped')
def get_file_options(self):
pass
def set_metas(self, key, value):
if key in self.metas_values:
self.metas[key] = value
else:
raise value_error("'%s' is not a meta tag: %s" % (key, self.metas))
def as_dict(self):
for k in dir(self):
if getattr(self, k) and 'set_metas' not in k and ('get_file_options' not in k) and ('as_dict' not in k) and ('__' not in k) and ('_values' not in k):
yield (k, getattr(self, k)) |
windowWidth = 500
windowHeight = 500
ellipseSize = 200
def setup():
size(windowWidth , windowHeight)
smooth()
background(255)
fill(50, 80)
stroke(100)
strokeWeight(3)
noLoop()
def draw():
ellipse(windowWidth/2, windowHeight/2 - ellipseSize/2,
ellipseSize , ellipseSize);
ellipse(windowWidth/2 - ellipseSize/2, windowHeight/2,
ellipseSize , ellipseSize);
ellipse(windowWidth/2 + ellipseSize/2, windowHeight/2,
ellipseSize , ellipseSize);
ellipse(windowWidth/2, windowHeight/2 + ellipseSize/2,
ellipseSize , ellipseSize);
| window_width = 500
window_height = 500
ellipse_size = 200
def setup():
size(windowWidth, windowHeight)
smooth()
background(255)
fill(50, 80)
stroke(100)
stroke_weight(3)
no_loop()
def draw():
ellipse(windowWidth / 2, windowHeight / 2 - ellipseSize / 2, ellipseSize, ellipseSize)
ellipse(windowWidth / 2 - ellipseSize / 2, windowHeight / 2, ellipseSize, ellipseSize)
ellipse(windowWidth / 2 + ellipseSize / 2, windowHeight / 2, ellipseSize, ellipseSize)
ellipse(windowWidth / 2, windowHeight / 2 + ellipseSize / 2, ellipseSize, ellipseSize) |
# Given an integer n, return the number of structurally unique BST's (binary search trees) which has exactly n nodes of unique values from 1 to n.
# Example 1:
# Input: n = 3
# Output: 5
#FORMULA is 2nCn/ n+1 catelon number
class Solution:
def numTrees(self, n: int) -> int:
res = 1
x = 2*n
for i in range(n):
res = res * (x-1)
res = res // (i+1)
return res // (n+1)
if __name__ == '__main__':
n = 3
print(Solution().numTrees(n))
| class Solution:
def num_trees(self, n: int) -> int:
res = 1
x = 2 * n
for i in range(n):
res = res * (x - 1)
res = res // (i + 1)
return res // (n + 1)
if __name__ == '__main__':
n = 3
print(solution().numTrees(n)) |
'''Constants used by TRender.
:copyright: 2015, Jeroen van der Heijden (Cesbit)
'''
LINE_IF = 1
LINE_ELSE = 2
LINE_ELIF = 4
LINE_END = 8
LINE_MACRO = 16
LINE_COMMENT = 32
LINE_BLOCK = 64
LINE_FOR = 128
LINE_PASTE = 256
LINE_TEXT = 512
LINE_INCLUDE = 1024
LINE_EXTEND = 2048
LINE_EMPTY = 4096
EOF_TEXT = 8192
ALWAYS_ALLOWED = (
LINE_IF |
LINE_MACRO |
LINE_PASTE |
LINE_TEXT |
LINE_COMMENT |
LINE_FOR |
LINE_BLOCK |
LINE_INCLUDE |
LINE_EXTEND |
LINE_EMPTY)
MAP_LINE_TYPE = {
True: LINE_TEXT,
None: LINE_EMPTY,
'if': LINE_IF,
'else': LINE_ELSE,
'elif': LINE_ELIF,
'end': LINE_END,
'for': LINE_FOR,
'macro': LINE_MACRO,
'block': LINE_BLOCK,
'include': LINE_INCLUDE,
'extend': LINE_EXTEND,
'': LINE_COMMENT
}
VAR = 'a-zA-Z0-9_'
VAR_DOTS = VAR + r'\.'
FILENAME = r'a-zA-Z0-9_\-\./'
| """Constants used by TRender.
:copyright: 2015, Jeroen van der Heijden (Cesbit)
"""
line_if = 1
line_else = 2
line_elif = 4
line_end = 8
line_macro = 16
line_comment = 32
line_block = 64
line_for = 128
line_paste = 256
line_text = 512
line_include = 1024
line_extend = 2048
line_empty = 4096
eof_text = 8192
always_allowed = LINE_IF | LINE_MACRO | LINE_PASTE | LINE_TEXT | LINE_COMMENT | LINE_FOR | LINE_BLOCK | LINE_INCLUDE | LINE_EXTEND | LINE_EMPTY
map_line_type = {True: LINE_TEXT, None: LINE_EMPTY, 'if': LINE_IF, 'else': LINE_ELSE, 'elif': LINE_ELIF, 'end': LINE_END, 'for': LINE_FOR, 'macro': LINE_MACRO, 'block': LINE_BLOCK, 'include': LINE_INCLUDE, 'extend': LINE_EXTEND, '': LINE_COMMENT}
var = 'a-zA-Z0-9_'
var_dots = VAR + '\\.'
filename = 'a-zA-Z0-9_\\-\\./' |
test_cases = int(input())
sol = []
for test in range(test_cases):
budget = int(input())
useless = input()
prices = list(map(int,input().split()))
for i in range(len(prices)):
for j in range(i+1,len(prices)):
if prices[i]+prices[j] == budget:
sol.append(str(i+1)+' '+str(j+1))
for ans in sol:
print(ans)
| test_cases = int(input())
sol = []
for test in range(test_cases):
budget = int(input())
useless = input()
prices = list(map(int, input().split()))
for i in range(len(prices)):
for j in range(i + 1, len(prices)):
if prices[i] + prices[j] == budget:
sol.append(str(i + 1) + ' ' + str(j + 1))
for ans in sol:
print(ans) |
n = int(input())
t = 0
a = 0
for _ in range(n):
s = input()
t += s.count('R')
a += s.count('B')
if t > a:
print('TAKAHASHI')
elif a > t:
print('AOKI')
else:
print('DRAW')
| n = int(input())
t = 0
a = 0
for _ in range(n):
s = input()
t += s.count('R')
a += s.count('B')
if t > a:
print('TAKAHASHI')
elif a > t:
print('AOKI')
else:
print('DRAW') |
ledger = {n: idx + 1 for idx, n in enumerate([1, 17, 0, 10, 18, 11, 6])}
spoken_number = list(ledger)[-1]
for turn in range(len(ledger), 30000000):
ledger[spoken_number], spoken_number = turn, turn - ledger.get(spoken_number, turn)
if turn == 2020 - 1:
print(f"Part 1: {spoken_number}") # 595
print(f"Part 2: {spoken_number}") # 1708310
| ledger = {n: idx + 1 for (idx, n) in enumerate([1, 17, 0, 10, 18, 11, 6])}
spoken_number = list(ledger)[-1]
for turn in range(len(ledger), 30000000):
(ledger[spoken_number], spoken_number) = (turn, turn - ledger.get(spoken_number, turn))
if turn == 2020 - 1:
print(f'Part 1: {spoken_number}')
print(f'Part 2: {spoken_number}') |
n = int(input())
arr = map(int, input().split())
list1 = list(arr)
print(list1)
new_list = set(list1)
print(new_list)
new_list.remove(max(new_list))
print(max(new_list))
| n = int(input())
arr = map(int, input().split())
list1 = list(arr)
print(list1)
new_list = set(list1)
print(new_list)
new_list.remove(max(new_list))
print(max(new_list)) |
MODEL_FOLDER_NAME = 'models'
FASTTEXT_MODEL_NAME = 'fasttext.magnitude'
GLOVE_MODEL_NAME = 'glove.magnitude'
WORD2VEC_MODEL_NAME = 'word2vec.magnitude'
ELMO_MODEL_NAME = 'elmo.magnitude'
BERT_MODEL_NAME = ''
FLAIR_MODEL_NAME = 'news-forward'
COVE_MODEL_NAME = ''
UNIVERSAL_SENTENCE_ENCODER_MODEL_NAME = 'https://tfhub.dev/google/universal-sentence-encoder/1'
CLASSIFIER_ALIAS_DICT = dict({'Random Forest': 'randomforest',
'Logistic Regression': 'logitreg',
'AdaBoost':'adaboost',
'GradientBoost':'gradboost',
'Support Vector Machine (Linear Kernel)':'svm',
'Stochastic Gradient Descent': 'svm',
'SGD Classifier': 'svm'})
| model_folder_name = 'models'
fasttext_model_name = 'fasttext.magnitude'
glove_model_name = 'glove.magnitude'
word2_vec_model_name = 'word2vec.magnitude'
elmo_model_name = 'elmo.magnitude'
bert_model_name = ''
flair_model_name = 'news-forward'
cove_model_name = ''
universal_sentence_encoder_model_name = 'https://tfhub.dev/google/universal-sentence-encoder/1'
classifier_alias_dict = dict({'Random Forest': 'randomforest', 'Logistic Regression': 'logitreg', 'AdaBoost': 'adaboost', 'GradientBoost': 'gradboost', 'Support Vector Machine (Linear Kernel)': 'svm', 'Stochastic Gradient Descent': 'svm', 'SGD Classifier': 'svm'}) |
# coding=utf-8
class App:
TESTING = True
HOST_URL = "http://pay.lvye.com"
PAYEE = '169658002'
class PayClientConfig:
CHANNEL_NAME = 'lvye_pay_test'
ROOT_URL = "http://pay.lvye.com/api/__"
CHECKOUT_URL = 'http://pay.lvye.com/__/checkout/{sn}'
| class App:
testing = True
host_url = 'http://pay.lvye.com'
payee = '169658002'
class Payclientconfig:
channel_name = 'lvye_pay_test'
root_url = 'http://pay.lvye.com/api/__'
checkout_url = 'http://pay.lvye.com/__/checkout/{sn}' |
def calc_gc(sequence):
sequence = sequence.upper() # make all chars uppercase
n = sequence.count('T') + sequence.count('A') # count only A, T,
m = sequence.count('G') + sequence.count('C') # C, and G -- nothing else (no Ns, Rs, Ws, etc.)
return float(m) / float(n + m) if n+m else 0
def test_1(): # test handling N
result = round(calc_gc('NATGC'), 2)
assert result == 0.5, result
def test_2(): # test handling lowercase
result = round(calc_gc('natgc'), 2)
assert result == 0.5, result | def calc_gc(sequence):
sequence = sequence.upper()
n = sequence.count('T') + sequence.count('A')
m = sequence.count('G') + sequence.count('C')
return float(m) / float(n + m) if n + m else 0
def test_1():
result = round(calc_gc('NATGC'), 2)
assert result == 0.5, result
def test_2():
result = round(calc_gc('natgc'), 2)
assert result == 0.5, result |
# Use this to take notes on the Edpuzzle video. Try each example rather than just watching it - you will get much more out of it!
#
student = {'name': 'John', 'age': 25, 'courses': ['math', 'CompSci']}
for key, value in student.items():
print(key, value) | student = {'name': 'John', 'age': 25, 'courses': ['math', 'CompSci']}
for (key, value) in student.items():
print(key, value) |
PARSING_SCHEME = {
'name': 'a',
'games_played': 'td[data-stat="g"]:first',
'minutes_played': 'td[data-stat="mp"]:first',
'field_goals': 'td[data-stat="fg"]:first',
'field_goal_attempts': 'td[data-stat="fga"]:first',
'field_goal_percentage': 'td[data-stat="fg_pct"]:first',
'three_point_field_goals': 'td[data-stat="fg3"]:first',
'three_point_field_goal_attempts': 'td[data-stat="fg3a"]:first',
'three_point_field_goal_percentage': 'td[data-stat="fg3_pct"]:first',
'two_point_field_goals': 'td[data-stat="fg2"]:first',
'two_point_field_goal_attempts': 'td[data-stat="fg2a"]:first',
'two_point_field_goal_percentage': 'td[data-stat="fg2_pct"]:first',
'free_throws': 'td[data-stat="ft"]:first',
'free_throw_attempts': 'td[data-stat="fta"]:first',
'free_throw_percentage': 'td[data-stat="ft_pct"]:first',
'offensive_rebounds': 'td[data-stat="orb"]:first',
'defensive_rebounds': 'td[data-stat="drb"]:first',
'total_rebounds': 'td[data-stat="trb"]:first',
'assists': 'td[data-stat="ast"]:first',
'steals': 'td[data-stat="stl"]:first',
'blocks': 'td[data-stat="blk"]:first',
'turnovers': 'td[data-stat="tov"]:first',
'personal_fouls': 'td[data-stat="pf"]:first',
'points': 'td[data-stat="pts"]:first',
'opp_minutes_played': 'td[data-stat="mp"]:first',
'opp_field_goals': 'td[data-stat="opp_fg"]:first',
'opp_field_goal_attempts': 'td[data-stat="opp_fga"]:first',
'opp_field_goal_percentage': 'td[data-stat="opp_fg_pct"]:first',
'opp_three_point_field_goals': 'td[data-stat="opp_fg3"]:first',
'opp_three_point_field_goal_attempts': 'td[data-stat="opp_fg3a"]:first',
'opp_three_point_field_goal_percentage':
'td[data-stat="opp_fg3_pct"]:first',
'opp_two_point_field_goals': 'td[data-stat="opp_fg2"]:first',
'opp_two_point_field_goal_attempts': 'td[data-stat="opp_fg2a"]:first',
'opp_two_point_field_goal_percentage': 'td[data-stat="opp_fg2_pct"]:first',
'opp_free_throws': 'td[data-stat="opp_ft"]:first',
'opp_free_throw_attempts': 'td[data-stat="opp_fta"]:first',
'opp_free_throw_percentage': 'td[data-stat="opp_ft_pct"]:first',
'opp_offensive_rebounds': 'td[data-stat="opp_orb"]:first',
'opp_defensive_rebounds': 'td[data-stat="opp_drb"]:first',
'opp_total_rebounds': 'td[data-stat="opp_trb"]:first',
'opp_assists': 'td[data-stat="opp_ast"]:first',
'opp_steals': 'td[data-stat="opp_stl"]:first',
'opp_blocks': 'td[data-stat="opp_blk"]:first',
'opp_turnovers': 'td[data-stat="opp_tov"]:first',
'opp_personal_fouls': 'td[data-stat="opp_pf"]:first',
'opp_points': 'td[data-stat="opp_pts"]:first'
}
SCHEDULE_SCHEME = {
'game': 'th[data-stat="g"]:first',
'date': 'td[data-stat="date_game"]:first',
'time': 'td[data-stat="game_start_time"]:first',
'boxscore': 'td[data-stat="box_score_text"]:first',
'location': 'td[data-stat="game_location"]:first',
'opponent_abbr': 'td[data-stat="opp_id"]:first',
'opponent_name': 'td[data-stat="opp_name"]:first',
'result': 'td[data-stat="game_result"]:first',
'points_scored': 'td[data-stat="pts"]:first',
'points_allowed': 'td[data-stat="opp_pts"]:first',
'wins': 'td[data-stat="wins"]:first',
'losses': 'td[data-stat="losses"]:first',
'streak': 'td[data-stat="game_streak"]:first'
}
BOXSCORE_SCHEME = {
'date': 'div[class="scorebox_meta"]',
'location': 'div[class="scorebox_meta"]',
'away_name': 'a[itemprop="name"]:first',
'home_name': 'a[itemprop="name"]:last',
'winning_name': '',
'winning_abbr': '',
'losing_name': '',
'losing_abbr': '',
'summary': 'table#line_score',
'pace': 'td[data-stat="pace"]:first',
'away_record': 'div[class="table_wrapper"] h2',
'away_minutes_played': 'tfoot td[data-stat="mp"]',
'away_field_goals': 'tfoot td[data-stat="fg"]',
'away_field_goal_attempts': 'tfoot td[data-stat="fga"]',
'away_field_goal_percentage': 'tfoot td[data-stat="fg_pct"]',
'away_two_point_field_goals': 'tfoot td[data-stat="fg2"]',
'away_two_point_field_goal_attempts': 'tfoot td[data-stat="fg2a"]',
'away_two_point_field_goal_percentage': 'tfoot td[data-stat="fg2_pct"]',
'away_three_point_field_goals': 'tfoot td[data-stat="fg3"]',
'away_three_point_field_goal_attempts': 'tfoot td[data-stat="fg3a"]',
'away_three_point_field_goal_percentage': 'tfoot td[data-stat="fg3_pct"]',
'away_free_throws': 'tfoot td[data-stat="ft"]',
'away_free_throw_attempts': 'tfoot td[data-stat="fta"]',
'away_free_throw_percentage': 'tfoot td[data-stat="ft_pct"]',
'away_offensive_rebounds': 'tfoot td[data-stat="orb"]',
'away_defensive_rebounds': 'tfoot td[data-stat="drb"]',
'away_total_rebounds': 'tfoot td[data-stat="trb"]',
'away_assists': 'tfoot td[data-stat="ast"]',
'away_steals': 'tfoot td[data-stat="stl"]',
'away_blocks': 'tfoot td[data-stat="blk"]',
'away_turnovers': 'tfoot td[data-stat="tov"]',
'away_personal_fouls': 'tfoot td[data-stat="pf"]',
'away_points': 'tfoot td[data-stat="pts"]',
'away_true_shooting_percentage': 'tfoot td[data-stat="ts_pct"]',
'away_effective_field_goal_percentage': 'tfoot td[data-stat="efg_pct"]',
'away_three_point_attempt_rate': 'tfoot td[data-stat="fg3a_per_fga_pct"]',
'away_free_throw_attempt_rate': 'tfoot td[data-stat="fta_per_fga_pct"]',
'away_offensive_rebound_percentage': 'tfoot td[data-stat="orb_pct"]',
'away_defensive_rebound_percentage': 'tfoot td[data-stat="drb_pct"]',
'away_total_rebound_percentage': 'tfoot td[data-stat="trb_pct"]',
'away_assist_percentage': 'tfoot td[data-stat="ast_pct"]',
'away_steal_percentage': 'tfoot td[data-stat="stl_pct"]',
'away_block_percentage': 'tfoot td[data-stat="blk_pct"]',
'away_turnover_percentage': 'tfoot td[data-stat="tov_pct"]',
'away_offensive_rating': 'tfoot td[data-stat="off_rtg"]',
'away_defensive_rating': 'tfoot td[data-stat="def_rtg"]',
'home_record': 'div[class="table_wrapper"] h2',
'home_minutes_played': 'tfoot td[data-stat="mp"]',
'home_field_goals': 'tfoot td[data-stat="fg"]',
'home_field_goal_attempts': 'tfoot td[data-stat="fga"]',
'home_field_goal_percentage': 'tfoot td[data-stat="fg_pct"]',
'home_two_point_field_goals': 'tfoot td[data-stat="fg2"]',
'home_two_point_field_goal_attempts': 'tfoot td[data-stat="fg2a"]',
'home_two_point_field_goal_percentage': 'tfoot td[data-stat="fg2_pct"]',
'home_three_point_field_goals': 'tfoot td[data-stat="fg3"]',
'home_three_point_field_goal_attempts': 'tfoot td[data-stat="fg3a"]',
'home_three_point_field_goal_percentage': 'tfoot td[data-stat="fg3_pct"]',
'home_free_throws': 'tfoot td[data-stat="ft"]',
'home_free_throw_attempts': 'tfoot td[data-stat="fta"]',
'home_free_throw_percentage': 'tfoot td[data-stat="ft_pct"]',
'home_offensive_rebounds': 'tfoot td[data-stat="orb"]',
'home_defensive_rebounds': 'tfoot td[data-stat="drb"]',
'home_total_rebounds': 'tfoot td[data-stat="trb"]',
'home_assists': 'tfoot td[data-stat="ast"]',
'home_steals': 'tfoot td[data-stat="stl"]',
'home_blocks': 'tfoot td[data-stat="blk"]',
'home_turnovers': 'tfoot td[data-stat="tov"]',
'home_personal_fouls': 'tfoot td[data-stat="pf"]',
'home_points': 'div[class="score"]',
'home_true_shooting_percentage': 'tfoot td[data-stat="ts_pct"]',
'home_effective_field_goal_percentage': 'tfoot td[data-stat="efg_pct"]',
'home_three_point_attempt_rate': 'tfoot td[data-stat="fg3a_per_fga_pct"]',
'home_free_throw_attempt_rate': 'tfoot td[data-stat="fta_per_fga_pct"]',
'home_offensive_rebound_percentage': 'tfoot td[data-stat="orb_pct"]',
'home_defensive_rebound_percentage': 'tfoot td[data-stat="drb_pct"]',
'home_total_rebound_percentage': 'tfoot td[data-stat="trb_pct"]',
'home_assist_percentage': 'tfoot td[data-stat="ast_pct"]',
'home_steal_percentage': 'tfoot td[data-stat="stl_pct"]',
'home_block_percentage': 'tfoot td[data-stat="blk_pct"]',
'home_turnover_percentage': 'tfoot td[data-stat="tov_pct"]',
'home_offensive_rating': 'tfoot td[data-stat="off_rtg"]',
'home_defensive_rating': 'tfoot td[data-stat="def_rtg"]'
}
BOXSCORE_ELEMENT_INDEX = {
'date': 0,
'location': 1,
'home_record': -1,
'home_minutes_played': 7,
'home_field_goals': 7,
'home_field_goal_attempts': 7,
'home_field_goal_percentage': 7,
'home_two_point_field_goals': 7,
'home_two_point_field_goal_attempts': 7,
'home_two_point_field_goal_percentage': 7,
'home_three_point_field_goals': 7,
'home_three_point_field_goal_attempts': 7,
'home_three_point_field_goal_percentage': 7,
'home_free_throws': 7,
'home_free_throw_attempts': 7,
'home_free_throw_percentage': 7,
'home_offensive_rebounds': 7,
'home_defensive_rebounds': 7,
'home_total_rebounds': 7,
'home_assists': 7,
'home_steals': 7,
'home_blocks': 7,
'home_turnovers': 7,
'home_personal_fouls': 7,
'home_points': -1,
'home_true_shooting_percentage': 7,
'home_effective_field_goal_percentage': 7,
'home_three_point_attempt_rate': 7,
'home_free_throw_attempt_rate': 7,
'home_offensive_rebound_percentage': 7,
'home_defensive_rebound_percentage': 7,
'home_total_rebound_percentage': 7,
'home_assist_percentage': 7,
'home_steal_percentage': 7,
'home_block_percentage': 7,
'home_turnover_percentage': 7,
'home_offensive_rating': 7,
'home_defensive_rating': 7
}
PLAYER_SCHEME = {
'summary': '[data-template="Partials/Teams/Summary"]',
'season': 'th[data-stat="season"]:first',
'name': 'h1',
'team_abbreviation': 'td[data-stat="team_id"]',
'position': 'td[data-stat="pos"]',
'height': 'span[itemprop="height"]',
'weight': 'span[itemprop="weight"]',
'birth_date': 'td[data-stat=""]',
'nationality': 'td[data-stat=""]',
'age': 'nobr',
'games_played': 'td[data-stat="g"]',
'games_started': 'td[data-stat="gs"]',
'minutes_played': 'td[data-stat="mp"]',
'field_goals': 'td[data-stat="fg"]',
'field_goal_attempts': 'td[data-stat="fga"]',
'field_goal_percentage': 'td[data-stat="fg_pct"]',
'three_pointers': 'td[data-stat="fg3"]',
'three_point_attempts': 'td[data-stat="fg3a"]',
'three_point_percentage': 'td[data-stat="fg3_pct"]',
'two_pointers': 'td[data-stat="fg2"]',
'two_point_attempts': 'td[data-stat="fg2a"]',
'two_point_percentage': 'td[data-stat="fg2_pct"]',
'effective_field_goal_percentage': 'td[data-stat="efg_pct"]',
'free_throws': 'td[data-stat="ft"]',
'free_throw_attempts': 'td[data-stat="fta"]',
'free_throw_percentage': 'td[data-stat="ft_pct"]',
'offensive_rebounds': 'td[data-stat="orb"]',
'defensive_rebounds': 'td[data-stat="drb"]',
'total_rebounds': 'td[data-stat="trb"]',
'assists': 'td[data-stat="ast"]',
'steals': 'td[data-stat="stl"]',
'blocks': 'td[data-stat="blk"]',
'turnovers': 'td[data-stat="tov"]',
'personal_fouls': 'td[data-stat="pf"]',
'points': 'td[data-stat="pts"]',
'player_efficiency_rating': 'td[data-stat="per"]',
'true_shooting_percentage': 'td[data-stat="ts_pct"]',
'three_point_attempt_rate': 'td[data-stat="fg3a_per_fga_pct"]',
'free_throw_attempt_rate': 'td[data-stat="fta_per_fga_pct"]',
'offensive_rebound_percentage': 'td[data-stat="orb_pct"]',
'defensive_rebound_percentage': 'td[data-stat="drb_pct"]',
'total_rebound_percentage': 'td[data-stat="trb_pct"]',
'assist_percentage': 'td[data-stat="ast_pct"]',
'steal_percentage': 'td[data-stat="stl_pct"]',
'block_percentage': 'td[data-stat="blk_pct"]',
'turnover_percentage': 'td[data-stat="tov_pct"]',
'usage_percentage': 'td[data-stat="usg_pct"]',
'offensive_win_shares': 'td[data-stat="ows"]',
'defensive_win_shares': 'td[data-stat="dws"]',
'win_shares': 'td[data-stat="ws"]',
'win_shares_per_48_minutes': 'td[data-stat="ws_per_48"]',
'offensive_box_plus_minus': 'td[data-stat="obpm"]',
'defensive_box_plus_minus': 'td[data-stat="dbpm"]',
'box_plus_minus': 'td[data-stat="bpm"]',
'defensive_rating': 'td[data-stat="def_rtg"]',
'offensive_rating': 'td[data-stat="off_rtg"]',
'boxscore_box_plus_minus': 'td[data-stat="plus_minus"]',
'value_over_replacement_player': 'td[data-stat="vorp"]',
'shooting_distance': 'td[data-stat="avg_dist"]',
'percentage_shots_two_pointers': 'td[data-stat="fg2a_pct_fga"]',
'percentage_zero_to_three_footers': 'td[data-stat="pct_fga_00_03"]',
'percentage_three_to_ten_footers': 'td[data-stat="pct_fga_03_10"]',
'percentage_ten_to_sixteen_footers': 'td[data-stat="pct_fga_10_16"]',
'percentage_sixteen_foot_plus_two_pointers':
'td[data-stat="pct_fga_16_xx"]',
'percentage_shots_three_pointers': 'td[data-stat="fg3a_pct_fga"]',
'field_goal_perc_zero_to_three_feet': 'td[data-stat="fg_pct_00_03"]',
'field_goal_perc_three_to_ten_feet': 'td[data-stat="fg_pct_03_10"]',
'field_goal_perc_ten_to_sixteen_feet': 'td[data-stat="fg_pct_10_16"]',
'field_goal_perc_sixteen_foot_plus_two_pointers':
'td[data-stat="fg_pct_16_xx"]',
'two_pointers_assisted_percentage': 'td[data-stat="fg2_pct_ast"]',
'percentage_field_goals_as_dunks': 'td[data-stat="pct_fg2_dunk"]',
'dunks': 'td[data-stat="fg2_dunk"]',
'three_pointers_assisted_percentage': 'td[data-stat="fg3_pct_ast"]',
'percentage_of_three_pointers_from_corner':
'td[data-stat="pct_fg3a_corner"]',
'three_point_shot_percentage_from_corner':
'td[data-stat="fg3_pct_corner"]',
'half_court_heaves': 'td[data-stat="fg3a_heave"]',
'half_court_heaves_made': 'td[data-stat="fg3_heave"]',
'point_guard_percentage': 'td[data-stat="pct_1"]',
'shooting_guard_percentage': 'td[data-stat="pct_2"]',
'small_forward_percentage': 'td[data-stat="pct_3"]',
'power_forward_percentage': 'td[data-stat="pct_4"]',
'center_percentage': 'td[data-stat="pct_5"]',
'on_court_plus_minus': 'td[data-stat="plus_minus_on"]',
'net_plus_minus': 'td[data-stat="plus_minus_net"]',
'passing_turnovers': 'td[data-stat="tov_bad_pass"]',
'lost_ball_turnovers': 'td[data-stat="tov_lost_ball"]',
'other_turnovers': 'td[data-stat="tov_other"]',
'shooting_fouls': 'td[data-stat="fouls_shooting"]',
'blocking_fouls': 'td[data-stat="fouls_blocking"]',
'offensive_fouls': 'td[data-stat="fouls_offensive"]',
'take_fouls': 'td[data-stat="fouls_take"]',
'points_generated_by_assists': 'td[data-stat="astd_pts"]',
'shooting_fouls_drawn': 'td[data-stat="drawn_shooting"]',
'and_ones': 'td[data-stat="and1s"]',
'shots_blocked': 'td[data-stat="fga_blkd"]',
'salary': 'td[data-stat="salary"]',
'field_goals_per_poss': 'td[data-stat="fg_per_poss"]',
'field_goal_attempts_per_poss': 'td[data-stat="fga_per_poss"]',
'three_pointers_per_poss': 'td[data-stat="fg3_per_poss"]',
'three_point_attempts_per_poss': 'td[data-stat="fg3a_per_poss"]',
'two_pointers_per_poss': 'td[data-stat="fg2_per_poss"]',
'two_point_attempts_per_poss': 'td[data-stat="fg2a_per_poss"]',
'free_throws_per_poss': 'td[data-stat="ft_per_poss"]',
'free_throw_attempts_per_poss': 'td[data-stat="fta_per_poss"]',
'offensive_rebounds_per_poss': 'td[data-stat="orb_per_poss"]',
'defensive_rebounds_per_poss': 'td[data-stat="drb_per_poss"]',
'total_rebounds_per_poss': 'td[data-stat="trb_per_poss"]',
'assists_per_poss': 'td[data-stat="ast_per_poss"]',
'steals_per_poss': 'td[data-stat="stl_per_poss"]',
'blocks_per_poss': 'td[data-stat="blk_per_poss"]',
'turnovers_per_poss': 'td[data-stat="tov_per_poss"]',
'personal_fouls_per_poss': 'td[data-stat="pf_per_poss"]',
'points_per_poss': 'td[data-stat="pts_per_poss"]'
}
NATIONALITY = {
'ao': 'Angola',
'ag': 'Antigua and Barbuda',
'ar': 'Argentina',
'au': 'Australia',
'at': 'Austria',
'bs': 'Bahamas',
'be': 'Belgium',
'ba': 'Bosnia and Herzegovina',
'br': 'Brazil',
'bg': 'Bulgaria',
'cm': 'Cameroon',
'ca': 'Canada',
'td': 'Chad',
'co': 'Colombia',
'cv': 'Cape Verde',
'cn': 'China',
'hr': 'Croatia',
'cu': 'Cuba',
'cz': 'Czech Republic',
'cd': 'Democratic Replubic of Congo',
'dk': 'Denmark',
'dm': 'Dominica',
'do': 'Dominican Replubic',
'eg': 'Egypt',
'ee': 'Estonia',
'fi': 'Finland',
'fr': 'France',
'gf': 'French Guiana',
'ga': 'Gabon',
'ge': 'Georgia',
'de': 'Germany',
'gh': 'Ghana',
'gr': 'Greece',
'gp': 'Guadeloupe',
'gn': 'Guinea',
'gy': 'Guyana',
'ht': 'Haiti',
'hu': 'Hungary',
'is': 'Iceland',
'ie': 'Ireland',
'ir': 'Islamic Replubic of Iran',
'il': 'Israel',
'it': 'Italy',
'jm': 'Jamaica',
'jp': 'Japan',
'lv': 'Latvia',
'lb': 'Lebanon',
'lt': 'Lithuania',
'lu': 'Luxembourg',
'ml': 'Mali',
'mq': 'Martinique',
'mx': 'Mexico',
'me': 'Montenegro',
'ma': 'Morocco',
'nl': 'Netherlands',
'nz': 'New Zealand',
'ng': 'Nigeria',
'no': 'Norway',
'pa': 'Panama',
'pl': 'Poland',
'pr': 'Puerto Rico',
'ke': 'Kenya',
'kr': 'Republic of Korea',
'mk': 'Republic of Macedonia',
'cg': 'Republic of Congo',
'ro': 'Romania',
'ru': 'Russian Federation',
'lc': 'Saint Lucia',
'vc': 'Saint Vincent and the Grenadines',
'sd': 'Sudan',
'sn': 'Senegal',
'rs': 'Serbia',
'sk': 'Slovakia',
'si': 'Slovenia',
'za': 'South Africa',
'ss': 'South Sudan',
'es': 'Spain',
'se': 'Sweden',
'ch': 'Switzerland',
'tw': 'Taiwan',
'tt': 'Trinidad and Tobago',
'tn': 'Tunisia',
'tr': 'Turkey',
'us': 'United States of America',
'vi': 'U.S. Virgin Islands',
'ua': 'Ukraine',
'gb': 'United Kingdom',
'tz': 'United Republic of Tanzania',
'uy': 'Uruguay',
've': 'Venezuela'
}
SEASON_PAGE_URL = 'http://www.basketball-reference.com/leagues/NBA_%s.html'
SCHEDULE_URL = 'http://www.basketball-reference.com/teams/%s/%s_games.html'
BOXSCORE_URL = 'https://www.basketball-reference.com/boxscores/%s.html'
BOXSCORES_URL = ('https://www.basketball-reference.com/boxscores/'
'?month=%s&day=%s&year=%s')
PLAYER_URL = 'https://www.basketball-reference.com/players/%s/%s.html'
ROSTER_URL = 'https://www.basketball-reference.com/teams/%s/%s.html'
| parsing_scheme = {'name': 'a', 'games_played': 'td[data-stat="g"]:first', 'minutes_played': 'td[data-stat="mp"]:first', 'field_goals': 'td[data-stat="fg"]:first', 'field_goal_attempts': 'td[data-stat="fga"]:first', 'field_goal_percentage': 'td[data-stat="fg_pct"]:first', 'three_point_field_goals': 'td[data-stat="fg3"]:first', 'three_point_field_goal_attempts': 'td[data-stat="fg3a"]:first', 'three_point_field_goal_percentage': 'td[data-stat="fg3_pct"]:first', 'two_point_field_goals': 'td[data-stat="fg2"]:first', 'two_point_field_goal_attempts': 'td[data-stat="fg2a"]:first', 'two_point_field_goal_percentage': 'td[data-stat="fg2_pct"]:first', 'free_throws': 'td[data-stat="ft"]:first', 'free_throw_attempts': 'td[data-stat="fta"]:first', 'free_throw_percentage': 'td[data-stat="ft_pct"]:first', 'offensive_rebounds': 'td[data-stat="orb"]:first', 'defensive_rebounds': 'td[data-stat="drb"]:first', 'total_rebounds': 'td[data-stat="trb"]:first', 'assists': 'td[data-stat="ast"]:first', 'steals': 'td[data-stat="stl"]:first', 'blocks': 'td[data-stat="blk"]:first', 'turnovers': 'td[data-stat="tov"]:first', 'personal_fouls': 'td[data-stat="pf"]:first', 'points': 'td[data-stat="pts"]:first', 'opp_minutes_played': 'td[data-stat="mp"]:first', 'opp_field_goals': 'td[data-stat="opp_fg"]:first', 'opp_field_goal_attempts': 'td[data-stat="opp_fga"]:first', 'opp_field_goal_percentage': 'td[data-stat="opp_fg_pct"]:first', 'opp_three_point_field_goals': 'td[data-stat="opp_fg3"]:first', 'opp_three_point_field_goal_attempts': 'td[data-stat="opp_fg3a"]:first', 'opp_three_point_field_goal_percentage': 'td[data-stat="opp_fg3_pct"]:first', 'opp_two_point_field_goals': 'td[data-stat="opp_fg2"]:first', 'opp_two_point_field_goal_attempts': 'td[data-stat="opp_fg2a"]:first', 'opp_two_point_field_goal_percentage': 'td[data-stat="opp_fg2_pct"]:first', 'opp_free_throws': 'td[data-stat="opp_ft"]:first', 'opp_free_throw_attempts': 'td[data-stat="opp_fta"]:first', 'opp_free_throw_percentage': 'td[data-stat="opp_ft_pct"]:first', 'opp_offensive_rebounds': 'td[data-stat="opp_orb"]:first', 'opp_defensive_rebounds': 'td[data-stat="opp_drb"]:first', 'opp_total_rebounds': 'td[data-stat="opp_trb"]:first', 'opp_assists': 'td[data-stat="opp_ast"]:first', 'opp_steals': 'td[data-stat="opp_stl"]:first', 'opp_blocks': 'td[data-stat="opp_blk"]:first', 'opp_turnovers': 'td[data-stat="opp_tov"]:first', 'opp_personal_fouls': 'td[data-stat="opp_pf"]:first', 'opp_points': 'td[data-stat="opp_pts"]:first'}
schedule_scheme = {'game': 'th[data-stat="g"]:first', 'date': 'td[data-stat="date_game"]:first', 'time': 'td[data-stat="game_start_time"]:first', 'boxscore': 'td[data-stat="box_score_text"]:first', 'location': 'td[data-stat="game_location"]:first', 'opponent_abbr': 'td[data-stat="opp_id"]:first', 'opponent_name': 'td[data-stat="opp_name"]:first', 'result': 'td[data-stat="game_result"]:first', 'points_scored': 'td[data-stat="pts"]:first', 'points_allowed': 'td[data-stat="opp_pts"]:first', 'wins': 'td[data-stat="wins"]:first', 'losses': 'td[data-stat="losses"]:first', 'streak': 'td[data-stat="game_streak"]:first'}
boxscore_scheme = {'date': 'div[class="scorebox_meta"]', 'location': 'div[class="scorebox_meta"]', 'away_name': 'a[itemprop="name"]:first', 'home_name': 'a[itemprop="name"]:last', 'winning_name': '', 'winning_abbr': '', 'losing_name': '', 'losing_abbr': '', 'summary': 'table#line_score', 'pace': 'td[data-stat="pace"]:first', 'away_record': 'div[class="table_wrapper"] h2', 'away_minutes_played': 'tfoot td[data-stat="mp"]', 'away_field_goals': 'tfoot td[data-stat="fg"]', 'away_field_goal_attempts': 'tfoot td[data-stat="fga"]', 'away_field_goal_percentage': 'tfoot td[data-stat="fg_pct"]', 'away_two_point_field_goals': 'tfoot td[data-stat="fg2"]', 'away_two_point_field_goal_attempts': 'tfoot td[data-stat="fg2a"]', 'away_two_point_field_goal_percentage': 'tfoot td[data-stat="fg2_pct"]', 'away_three_point_field_goals': 'tfoot td[data-stat="fg3"]', 'away_three_point_field_goal_attempts': 'tfoot td[data-stat="fg3a"]', 'away_three_point_field_goal_percentage': 'tfoot td[data-stat="fg3_pct"]', 'away_free_throws': 'tfoot td[data-stat="ft"]', 'away_free_throw_attempts': 'tfoot td[data-stat="fta"]', 'away_free_throw_percentage': 'tfoot td[data-stat="ft_pct"]', 'away_offensive_rebounds': 'tfoot td[data-stat="orb"]', 'away_defensive_rebounds': 'tfoot td[data-stat="drb"]', 'away_total_rebounds': 'tfoot td[data-stat="trb"]', 'away_assists': 'tfoot td[data-stat="ast"]', 'away_steals': 'tfoot td[data-stat="stl"]', 'away_blocks': 'tfoot td[data-stat="blk"]', 'away_turnovers': 'tfoot td[data-stat="tov"]', 'away_personal_fouls': 'tfoot td[data-stat="pf"]', 'away_points': 'tfoot td[data-stat="pts"]', 'away_true_shooting_percentage': 'tfoot td[data-stat="ts_pct"]', 'away_effective_field_goal_percentage': 'tfoot td[data-stat="efg_pct"]', 'away_three_point_attempt_rate': 'tfoot td[data-stat="fg3a_per_fga_pct"]', 'away_free_throw_attempt_rate': 'tfoot td[data-stat="fta_per_fga_pct"]', 'away_offensive_rebound_percentage': 'tfoot td[data-stat="orb_pct"]', 'away_defensive_rebound_percentage': 'tfoot td[data-stat="drb_pct"]', 'away_total_rebound_percentage': 'tfoot td[data-stat="trb_pct"]', 'away_assist_percentage': 'tfoot td[data-stat="ast_pct"]', 'away_steal_percentage': 'tfoot td[data-stat="stl_pct"]', 'away_block_percentage': 'tfoot td[data-stat="blk_pct"]', 'away_turnover_percentage': 'tfoot td[data-stat="tov_pct"]', 'away_offensive_rating': 'tfoot td[data-stat="off_rtg"]', 'away_defensive_rating': 'tfoot td[data-stat="def_rtg"]', 'home_record': 'div[class="table_wrapper"] h2', 'home_minutes_played': 'tfoot td[data-stat="mp"]', 'home_field_goals': 'tfoot td[data-stat="fg"]', 'home_field_goal_attempts': 'tfoot td[data-stat="fga"]', 'home_field_goal_percentage': 'tfoot td[data-stat="fg_pct"]', 'home_two_point_field_goals': 'tfoot td[data-stat="fg2"]', 'home_two_point_field_goal_attempts': 'tfoot td[data-stat="fg2a"]', 'home_two_point_field_goal_percentage': 'tfoot td[data-stat="fg2_pct"]', 'home_three_point_field_goals': 'tfoot td[data-stat="fg3"]', 'home_three_point_field_goal_attempts': 'tfoot td[data-stat="fg3a"]', 'home_three_point_field_goal_percentage': 'tfoot td[data-stat="fg3_pct"]', 'home_free_throws': 'tfoot td[data-stat="ft"]', 'home_free_throw_attempts': 'tfoot td[data-stat="fta"]', 'home_free_throw_percentage': 'tfoot td[data-stat="ft_pct"]', 'home_offensive_rebounds': 'tfoot td[data-stat="orb"]', 'home_defensive_rebounds': 'tfoot td[data-stat="drb"]', 'home_total_rebounds': 'tfoot td[data-stat="trb"]', 'home_assists': 'tfoot td[data-stat="ast"]', 'home_steals': 'tfoot td[data-stat="stl"]', 'home_blocks': 'tfoot td[data-stat="blk"]', 'home_turnovers': 'tfoot td[data-stat="tov"]', 'home_personal_fouls': 'tfoot td[data-stat="pf"]', 'home_points': 'div[class="score"]', 'home_true_shooting_percentage': 'tfoot td[data-stat="ts_pct"]', 'home_effective_field_goal_percentage': 'tfoot td[data-stat="efg_pct"]', 'home_three_point_attempt_rate': 'tfoot td[data-stat="fg3a_per_fga_pct"]', 'home_free_throw_attempt_rate': 'tfoot td[data-stat="fta_per_fga_pct"]', 'home_offensive_rebound_percentage': 'tfoot td[data-stat="orb_pct"]', 'home_defensive_rebound_percentage': 'tfoot td[data-stat="drb_pct"]', 'home_total_rebound_percentage': 'tfoot td[data-stat="trb_pct"]', 'home_assist_percentage': 'tfoot td[data-stat="ast_pct"]', 'home_steal_percentage': 'tfoot td[data-stat="stl_pct"]', 'home_block_percentage': 'tfoot td[data-stat="blk_pct"]', 'home_turnover_percentage': 'tfoot td[data-stat="tov_pct"]', 'home_offensive_rating': 'tfoot td[data-stat="off_rtg"]', 'home_defensive_rating': 'tfoot td[data-stat="def_rtg"]'}
boxscore_element_index = {'date': 0, 'location': 1, 'home_record': -1, 'home_minutes_played': 7, 'home_field_goals': 7, 'home_field_goal_attempts': 7, 'home_field_goal_percentage': 7, 'home_two_point_field_goals': 7, 'home_two_point_field_goal_attempts': 7, 'home_two_point_field_goal_percentage': 7, 'home_three_point_field_goals': 7, 'home_three_point_field_goal_attempts': 7, 'home_three_point_field_goal_percentage': 7, 'home_free_throws': 7, 'home_free_throw_attempts': 7, 'home_free_throw_percentage': 7, 'home_offensive_rebounds': 7, 'home_defensive_rebounds': 7, 'home_total_rebounds': 7, 'home_assists': 7, 'home_steals': 7, 'home_blocks': 7, 'home_turnovers': 7, 'home_personal_fouls': 7, 'home_points': -1, 'home_true_shooting_percentage': 7, 'home_effective_field_goal_percentage': 7, 'home_three_point_attempt_rate': 7, 'home_free_throw_attempt_rate': 7, 'home_offensive_rebound_percentage': 7, 'home_defensive_rebound_percentage': 7, 'home_total_rebound_percentage': 7, 'home_assist_percentage': 7, 'home_steal_percentage': 7, 'home_block_percentage': 7, 'home_turnover_percentage': 7, 'home_offensive_rating': 7, 'home_defensive_rating': 7}
player_scheme = {'summary': '[data-template="Partials/Teams/Summary"]', 'season': 'th[data-stat="season"]:first', 'name': 'h1', 'team_abbreviation': 'td[data-stat="team_id"]', 'position': 'td[data-stat="pos"]', 'height': 'span[itemprop="height"]', 'weight': 'span[itemprop="weight"]', 'birth_date': 'td[data-stat=""]', 'nationality': 'td[data-stat=""]', 'age': 'nobr', 'games_played': 'td[data-stat="g"]', 'games_started': 'td[data-stat="gs"]', 'minutes_played': 'td[data-stat="mp"]', 'field_goals': 'td[data-stat="fg"]', 'field_goal_attempts': 'td[data-stat="fga"]', 'field_goal_percentage': 'td[data-stat="fg_pct"]', 'three_pointers': 'td[data-stat="fg3"]', 'three_point_attempts': 'td[data-stat="fg3a"]', 'three_point_percentage': 'td[data-stat="fg3_pct"]', 'two_pointers': 'td[data-stat="fg2"]', 'two_point_attempts': 'td[data-stat="fg2a"]', 'two_point_percentage': 'td[data-stat="fg2_pct"]', 'effective_field_goal_percentage': 'td[data-stat="efg_pct"]', 'free_throws': 'td[data-stat="ft"]', 'free_throw_attempts': 'td[data-stat="fta"]', 'free_throw_percentage': 'td[data-stat="ft_pct"]', 'offensive_rebounds': 'td[data-stat="orb"]', 'defensive_rebounds': 'td[data-stat="drb"]', 'total_rebounds': 'td[data-stat="trb"]', 'assists': 'td[data-stat="ast"]', 'steals': 'td[data-stat="stl"]', 'blocks': 'td[data-stat="blk"]', 'turnovers': 'td[data-stat="tov"]', 'personal_fouls': 'td[data-stat="pf"]', 'points': 'td[data-stat="pts"]', 'player_efficiency_rating': 'td[data-stat="per"]', 'true_shooting_percentage': 'td[data-stat="ts_pct"]', 'three_point_attempt_rate': 'td[data-stat="fg3a_per_fga_pct"]', 'free_throw_attempt_rate': 'td[data-stat="fta_per_fga_pct"]', 'offensive_rebound_percentage': 'td[data-stat="orb_pct"]', 'defensive_rebound_percentage': 'td[data-stat="drb_pct"]', 'total_rebound_percentage': 'td[data-stat="trb_pct"]', 'assist_percentage': 'td[data-stat="ast_pct"]', 'steal_percentage': 'td[data-stat="stl_pct"]', 'block_percentage': 'td[data-stat="blk_pct"]', 'turnover_percentage': 'td[data-stat="tov_pct"]', 'usage_percentage': 'td[data-stat="usg_pct"]', 'offensive_win_shares': 'td[data-stat="ows"]', 'defensive_win_shares': 'td[data-stat="dws"]', 'win_shares': 'td[data-stat="ws"]', 'win_shares_per_48_minutes': 'td[data-stat="ws_per_48"]', 'offensive_box_plus_minus': 'td[data-stat="obpm"]', 'defensive_box_plus_minus': 'td[data-stat="dbpm"]', 'box_plus_minus': 'td[data-stat="bpm"]', 'defensive_rating': 'td[data-stat="def_rtg"]', 'offensive_rating': 'td[data-stat="off_rtg"]', 'boxscore_box_plus_minus': 'td[data-stat="plus_minus"]', 'value_over_replacement_player': 'td[data-stat="vorp"]', 'shooting_distance': 'td[data-stat="avg_dist"]', 'percentage_shots_two_pointers': 'td[data-stat="fg2a_pct_fga"]', 'percentage_zero_to_three_footers': 'td[data-stat="pct_fga_00_03"]', 'percentage_three_to_ten_footers': 'td[data-stat="pct_fga_03_10"]', 'percentage_ten_to_sixteen_footers': 'td[data-stat="pct_fga_10_16"]', 'percentage_sixteen_foot_plus_two_pointers': 'td[data-stat="pct_fga_16_xx"]', 'percentage_shots_three_pointers': 'td[data-stat="fg3a_pct_fga"]', 'field_goal_perc_zero_to_three_feet': 'td[data-stat="fg_pct_00_03"]', 'field_goal_perc_three_to_ten_feet': 'td[data-stat="fg_pct_03_10"]', 'field_goal_perc_ten_to_sixteen_feet': 'td[data-stat="fg_pct_10_16"]', 'field_goal_perc_sixteen_foot_plus_two_pointers': 'td[data-stat="fg_pct_16_xx"]', 'two_pointers_assisted_percentage': 'td[data-stat="fg2_pct_ast"]', 'percentage_field_goals_as_dunks': 'td[data-stat="pct_fg2_dunk"]', 'dunks': 'td[data-stat="fg2_dunk"]', 'three_pointers_assisted_percentage': 'td[data-stat="fg3_pct_ast"]', 'percentage_of_three_pointers_from_corner': 'td[data-stat="pct_fg3a_corner"]', 'three_point_shot_percentage_from_corner': 'td[data-stat="fg3_pct_corner"]', 'half_court_heaves': 'td[data-stat="fg3a_heave"]', 'half_court_heaves_made': 'td[data-stat="fg3_heave"]', 'point_guard_percentage': 'td[data-stat="pct_1"]', 'shooting_guard_percentage': 'td[data-stat="pct_2"]', 'small_forward_percentage': 'td[data-stat="pct_3"]', 'power_forward_percentage': 'td[data-stat="pct_4"]', 'center_percentage': 'td[data-stat="pct_5"]', 'on_court_plus_minus': 'td[data-stat="plus_minus_on"]', 'net_plus_minus': 'td[data-stat="plus_minus_net"]', 'passing_turnovers': 'td[data-stat="tov_bad_pass"]', 'lost_ball_turnovers': 'td[data-stat="tov_lost_ball"]', 'other_turnovers': 'td[data-stat="tov_other"]', 'shooting_fouls': 'td[data-stat="fouls_shooting"]', 'blocking_fouls': 'td[data-stat="fouls_blocking"]', 'offensive_fouls': 'td[data-stat="fouls_offensive"]', 'take_fouls': 'td[data-stat="fouls_take"]', 'points_generated_by_assists': 'td[data-stat="astd_pts"]', 'shooting_fouls_drawn': 'td[data-stat="drawn_shooting"]', 'and_ones': 'td[data-stat="and1s"]', 'shots_blocked': 'td[data-stat="fga_blkd"]', 'salary': 'td[data-stat="salary"]', 'field_goals_per_poss': 'td[data-stat="fg_per_poss"]', 'field_goal_attempts_per_poss': 'td[data-stat="fga_per_poss"]', 'three_pointers_per_poss': 'td[data-stat="fg3_per_poss"]', 'three_point_attempts_per_poss': 'td[data-stat="fg3a_per_poss"]', 'two_pointers_per_poss': 'td[data-stat="fg2_per_poss"]', 'two_point_attempts_per_poss': 'td[data-stat="fg2a_per_poss"]', 'free_throws_per_poss': 'td[data-stat="ft_per_poss"]', 'free_throw_attempts_per_poss': 'td[data-stat="fta_per_poss"]', 'offensive_rebounds_per_poss': 'td[data-stat="orb_per_poss"]', 'defensive_rebounds_per_poss': 'td[data-stat="drb_per_poss"]', 'total_rebounds_per_poss': 'td[data-stat="trb_per_poss"]', 'assists_per_poss': 'td[data-stat="ast_per_poss"]', 'steals_per_poss': 'td[data-stat="stl_per_poss"]', 'blocks_per_poss': 'td[data-stat="blk_per_poss"]', 'turnovers_per_poss': 'td[data-stat="tov_per_poss"]', 'personal_fouls_per_poss': 'td[data-stat="pf_per_poss"]', 'points_per_poss': 'td[data-stat="pts_per_poss"]'}
nationality = {'ao': 'Angola', 'ag': 'Antigua and Barbuda', 'ar': 'Argentina', 'au': 'Australia', 'at': 'Austria', 'bs': 'Bahamas', 'be': 'Belgium', 'ba': 'Bosnia and Herzegovina', 'br': 'Brazil', 'bg': 'Bulgaria', 'cm': 'Cameroon', 'ca': 'Canada', 'td': 'Chad', 'co': 'Colombia', 'cv': 'Cape Verde', 'cn': 'China', 'hr': 'Croatia', 'cu': 'Cuba', 'cz': 'Czech Republic', 'cd': 'Democratic Replubic of Congo', 'dk': 'Denmark', 'dm': 'Dominica', 'do': 'Dominican Replubic', 'eg': 'Egypt', 'ee': 'Estonia', 'fi': 'Finland', 'fr': 'France', 'gf': 'French Guiana', 'ga': 'Gabon', 'ge': 'Georgia', 'de': 'Germany', 'gh': 'Ghana', 'gr': 'Greece', 'gp': 'Guadeloupe', 'gn': 'Guinea', 'gy': 'Guyana', 'ht': 'Haiti', 'hu': 'Hungary', 'is': 'Iceland', 'ie': 'Ireland', 'ir': 'Islamic Replubic of Iran', 'il': 'Israel', 'it': 'Italy', 'jm': 'Jamaica', 'jp': 'Japan', 'lv': 'Latvia', 'lb': 'Lebanon', 'lt': 'Lithuania', 'lu': 'Luxembourg', 'ml': 'Mali', 'mq': 'Martinique', 'mx': 'Mexico', 'me': 'Montenegro', 'ma': 'Morocco', 'nl': 'Netherlands', 'nz': 'New Zealand', 'ng': 'Nigeria', 'no': 'Norway', 'pa': 'Panama', 'pl': 'Poland', 'pr': 'Puerto Rico', 'ke': 'Kenya', 'kr': 'Republic of Korea', 'mk': 'Republic of Macedonia', 'cg': 'Republic of Congo', 'ro': 'Romania', 'ru': 'Russian Federation', 'lc': 'Saint Lucia', 'vc': 'Saint Vincent and the Grenadines', 'sd': 'Sudan', 'sn': 'Senegal', 'rs': 'Serbia', 'sk': 'Slovakia', 'si': 'Slovenia', 'za': 'South Africa', 'ss': 'South Sudan', 'es': 'Spain', 'se': 'Sweden', 'ch': 'Switzerland', 'tw': 'Taiwan', 'tt': 'Trinidad and Tobago', 'tn': 'Tunisia', 'tr': 'Turkey', 'us': 'United States of America', 'vi': 'U.S. Virgin Islands', 'ua': 'Ukraine', 'gb': 'United Kingdom', 'tz': 'United Republic of Tanzania', 'uy': 'Uruguay', 've': 'Venezuela'}
season_page_url = 'http://www.basketball-reference.com/leagues/NBA_%s.html'
schedule_url = 'http://www.basketball-reference.com/teams/%s/%s_games.html'
boxscore_url = 'https://www.basketball-reference.com/boxscores/%s.html'
boxscores_url = 'https://www.basketball-reference.com/boxscores/?month=%s&day=%s&year=%s'
player_url = 'https://www.basketball-reference.com/players/%s/%s.html'
roster_url = 'https://www.basketball-reference.com/teams/%s/%s.html' |
class NuGetPackage(GitHubTarballPackage):
def __init__(self):
GitHubTarballPackage.__init__(self,
'mono', 'nuget',
'2.8.5',
'ea1d244b066338c9408646afdcf8acae6299f7fb',
configure = '')
def build(self):
self.sh ('%{make} PREFIX=%{package_prefix}')
def install(self):
self.sh ('%{makeinstall} PREFIX=%{staged_prefix}')
NuGetPackage()
| class Nugetpackage(GitHubTarballPackage):
def __init__(self):
GitHubTarballPackage.__init__(self, 'mono', 'nuget', '2.8.5', 'ea1d244b066338c9408646afdcf8acae6299f7fb', configure='')
def build(self):
self.sh('%{make} PREFIX=%{package_prefix}')
def install(self):
self.sh('%{makeinstall} PREFIX=%{staged_prefix}')
nu_get_package() |
class Cat:
def __init__(self, name, age):
self.name = name
self.age = age
def info(self):
print(f"I am a cat. My name is {self.name}. I am {self.age} years old.")
def make_sound(self):
print("Meow")
class Dog:
def __init__(self, name, age):
self.name = name
self.age = age
def info(self):
print(f"I am a dog. My name is {self.name}. I am {self.age} years old.")
def make_sound(self):
print("Bark")
cat1 = Cat("Kitty", 2.5)
cat2 = Cat("Catty", 3.0)
dog1 = Dog("Fluffy", 4)
dog2 = Dog("Doggy", 4.5)
animals = [cat1, cat2, dog1, dog2]
for animal in animals:
animal.make_sound()
animal.info()
animal.make_sound()
| class Cat:
def __init__(self, name, age):
self.name = name
self.age = age
def info(self):
print(f'I am a cat. My name is {self.name}. I am {self.age} years old.')
def make_sound(self):
print('Meow')
class Dog:
def __init__(self, name, age):
self.name = name
self.age = age
def info(self):
print(f'I am a dog. My name is {self.name}. I am {self.age} years old.')
def make_sound(self):
print('Bark')
cat1 = cat('Kitty', 2.5)
cat2 = cat('Catty', 3.0)
dog1 = dog('Fluffy', 4)
dog2 = dog('Doggy', 4.5)
animals = [cat1, cat2, dog1, dog2]
for animal in animals:
animal.make_sound()
animal.info()
animal.make_sound() |
#!/usr/bin/python
# Copyright 2015 Neuhold Markus and Kleinsasser Mario
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
smsgatewayabspath = None
watchdogThread = None
watchdogThreadNotify = None
# For route-based watchdogs
watchdogRouteThread = {}
watchdogRouteThreadNotify = {}
watchdogRouteThreadQueue = {}
routerThread = None
rdb = None
cleanupseconds = None
wisid = None
wisport = None
wisipaddress = None
pissendtimeout = None
ldapenabled = None
ldapserver = None
ldapbasedn = None
ldapusers = None
sslenabled = None
sslcertificate = None
sslprivatekey = None
sslcertificatechain = None
validusernameregex = None
validusernamelength = None
version = None
| smsgatewayabspath = None
watchdog_thread = None
watchdog_thread_notify = None
watchdog_route_thread = {}
watchdog_route_thread_notify = {}
watchdog_route_thread_queue = {}
router_thread = None
rdb = None
cleanupseconds = None
wisid = None
wisport = None
wisipaddress = None
pissendtimeout = None
ldapenabled = None
ldapserver = None
ldapbasedn = None
ldapusers = None
sslenabled = None
sslcertificate = None
sslprivatekey = None
sslcertificatechain = None
validusernameregex = None
validusernamelength = None
version = None |
class DistributedRouter:
def allow_migrate(self, db, app_label, model_name=None, **hints):
if model_name in ['user', 'settings']:
return db == 'parser'
if model_name in ['search', 'betdata']:
return db == 'betdata'
return True | class Distributedrouter:
def allow_migrate(self, db, app_label, model_name=None, **hints):
if model_name in ['user', 'settings']:
return db == 'parser'
if model_name in ['search', 'betdata']:
return db == 'betdata'
return True |
contador_externo = 0
contador_interno = 0
while contador_externo < 5:
while contador_interno < 6:
print(contador_externo, contador_interno)
contador_interno += 1
contador_externo += 1
contador_interno = 0
| contador_externo = 0
contador_interno = 0
while contador_externo < 5:
while contador_interno < 6:
print(contador_externo, contador_interno)
contador_interno += 1
contador_externo += 1
contador_interno = 0 |
# Python: QuickSort
def quick_sort(arr):
start = 0
end = len(arr) - 1
__quick_sort(arr, start, end)
def __quick_sort(arr, start, end):
if start < end:
pertition_index = __pertition(arr, start, end)
__quick_sort(arr, start, pertition_index - 1)
__quick_sort(arr, pertition_index + 1, end)
def __pertition(arr, start, end):
pivot_elm = arr[end]
pertition_index = start
for i in range(start, end):
if arr[i] <= pivot_elm:
arr[i], arr[pertition_index] = arr[pertition_index], arr[i]
pertition_index += 1
arr[end], arr[pertition_index] = arr[pertition_index], arr[end]
return pertition_index
| def quick_sort(arr):
start = 0
end = len(arr) - 1
__quick_sort(arr, start, end)
def __quick_sort(arr, start, end):
if start < end:
pertition_index = __pertition(arr, start, end)
__quick_sort(arr, start, pertition_index - 1)
__quick_sort(arr, pertition_index + 1, end)
def __pertition(arr, start, end):
pivot_elm = arr[end]
pertition_index = start
for i in range(start, end):
if arr[i] <= pivot_elm:
(arr[i], arr[pertition_index]) = (arr[pertition_index], arr[i])
pertition_index += 1
(arr[end], arr[pertition_index]) = (arr[pertition_index], arr[end])
return pertition_index |
def heapify(array, size, index):
largest = index
left = 2 * index + 1
right = 2 * index + 2
if left < size and array[index] < array[left]:
largest = left
if right < size and array[largest] < array[right]:
largest = right
if largest != index:
array[index], array[largest] = array[largest], array[index]
heapify(array, size, largest)
def heap_sort(array):
size = len(array)
for index in range(size//2 - 1, -1, -1):
heapify(array, size, index)
for index in range(size - 1, 0, -1):
array[index], array[0] = array[0], array[index]
heapify(array, index, 0)
if __name__ == '__main__':
array = [19, 50, 27, 7, 2020, 14, 18, 1, 12, 23, 200, 2201]
heap_sort(array)
print(array)
| def heapify(array, size, index):
largest = index
left = 2 * index + 1
right = 2 * index + 2
if left < size and array[index] < array[left]:
largest = left
if right < size and array[largest] < array[right]:
largest = right
if largest != index:
(array[index], array[largest]) = (array[largest], array[index])
heapify(array, size, largest)
def heap_sort(array):
size = len(array)
for index in range(size // 2 - 1, -1, -1):
heapify(array, size, index)
for index in range(size - 1, 0, -1):
(array[index], array[0]) = (array[0], array[index])
heapify(array, index, 0)
if __name__ == '__main__':
array = [19, 50, 27, 7, 2020, 14, 18, 1, 12, 23, 200, 2201]
heap_sort(array)
print(array) |
'''
Description : Use Of Local Scope
Function Date : 05 Feb 2021
Function Author : Prasad Dangare
Input : Int
Output : Int
'''
x = 50
def func(x):
print ('x is', x)
x = 2
print ('Changed local x to', x)
func(x)
print ('x is still', x) | """
Description : Use Of Local Scope
Function Date : 05 Feb 2021
Function Author : Prasad Dangare
Input : Int
Output : Int
"""
x = 50
def func(x):
print('x is', x)
x = 2
print('Changed local x to', x)
func(x)
print('x is still', x) |
catName1 = input()
print('Enter the name of cat 2:')
catName2 = input()
print('Enter the name of cat 3:')
catName3 = input()
print('Enter the name of cat 4:')
catName4 = input()
print('Enter the name of cat 5:')
catName5 = input()
print('Enter the name of cat 6:')
catName6 = input()
print(catName1 + ' ' + catName2 + ' ' + catName3 + ' ' +
catName4 + ' ' + catName5 + ' ' + catName6)
| cat_name1 = input()
print('Enter the name of cat 2:')
cat_name2 = input()
print('Enter the name of cat 3:')
cat_name3 = input()
print('Enter the name of cat 4:')
cat_name4 = input()
print('Enter the name of cat 5:')
cat_name5 = input()
print('Enter the name of cat 6:')
cat_name6 = input()
print(catName1 + ' ' + catName2 + ' ' + catName3 + ' ' + catName4 + ' ' + catName5 + ' ' + catName6) |
TYPE_NAME = "mock"
def handler(value, **kwargs):
return "mock"
| type_name = 'mock'
def handler(value, **kwargs):
return 'mock' |
# ETA represents the learning rate. Higher values penalize feature weights more strongly
# Create your housing DMatrix: housing_dmatrix
housing_dmatrix = xgb.DMatrix(data=X, label=y)
# Create the parameter dictionary for each tree (boosting round)
params = {"objective":"reg:linear", "max_depth":3}
# Create list of eta values and empty list to store final round rmse per xgboost model
eta_vals = [0.001, 0.01, 0.1]
best_rmse = []
# Systematically vary the eta
for curr_val in eta_vals:
params["eta"] = curr_val
# Perform cross-validation: cv_results
cv_results = xgb.cv(
dtrain=housing_dmatrix, params=params, nfold=3, num_boost_round=10,
early_stopping_rounds=5, metrics="rmse", seed=123, as_pandas=True
)
# Append the final round rmse to best_rmse
best_rmse.append(cv_results["test-rmse-mean"].tail().values[-1])
# Print the resultant DataFrame
print(pd.DataFrame(list(zip(eta_vals, best_rmse)), columns=["eta","best_rmse"]))
| housing_dmatrix = xgb.DMatrix(data=X, label=y)
params = {'objective': 'reg:linear', 'max_depth': 3}
eta_vals = [0.001, 0.01, 0.1]
best_rmse = []
for curr_val in eta_vals:
params['eta'] = curr_val
cv_results = xgb.cv(dtrain=housing_dmatrix, params=params, nfold=3, num_boost_round=10, early_stopping_rounds=5, metrics='rmse', seed=123, as_pandas=True)
best_rmse.append(cv_results['test-rmse-mean'].tail().values[-1])
print(pd.DataFrame(list(zip(eta_vals, best_rmse)), columns=['eta', 'best_rmse'])) |
#
# PySNMP MIB module NBASE-EXP-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/NBASE-EXP-MIB
# Produced by pysmi-0.3.4 at Wed May 1 14:17:07 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")
ValueSizeConstraint, ConstraintsIntersection, ValueRangeConstraint, ConstraintsUnion, SingleValueConstraint = mibBuilder.importSymbols("ASN1-REFINEMENT", "ValueSizeConstraint", "ConstraintsIntersection", "ValueRangeConstraint", "ConstraintsUnion", "SingleValueConstraint")
ModuleCompliance, NotificationGroup = mibBuilder.importSymbols("SNMPv2-CONF", "ModuleCompliance", "NotificationGroup")
ObjectIdentity, enterprises, iso, Integer32, Bits, MibScalar, MibTable, MibTableRow, MibTableColumn, NotificationType, Counter32, TimeTicks, Counter64, Gauge32, ModuleIdentity, Unsigned32, IpAddress, MibIdentifier = mibBuilder.importSymbols("SNMPv2-SMI", "ObjectIdentity", "enterprises", "iso", "Integer32", "Bits", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "NotificationType", "Counter32", "TimeTicks", "Counter64", "Gauge32", "ModuleIdentity", "Unsigned32", "IpAddress", "MibIdentifier")
TextualConvention, DisplayString = mibBuilder.importSymbols("SNMPv2-TC", "TextualConvention", "DisplayString")
nbase = MibIdentifier((1, 3, 6, 1, 4, 1, 629))
nbSwitchG1 = MibIdentifier((1, 3, 6, 1, 4, 1, 629, 1))
nbsMegaMibs = MibIdentifier((1, 3, 6, 1, 4, 1, 629, 1, 16))
nbsExpansionPortMIB = MibIdentifier((1, 3, 6, 1, 4, 1, 629, 1, 16, 1))
nbsAtmLanePortMIB = MibIdentifier((1, 3, 6, 1, 4, 1, 629, 1, 16, 2))
nbsFddiPortMIB = MibIdentifier((1, 3, 6, 1, 4, 1, 629, 1, 16, 3))
nbsExpPortMaxNum = MibScalar((1, 3, 6, 1, 4, 1, 629, 1, 16, 1, 1), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nbsExpPortMaxNum.setStatus('mandatory')
nbsExpPortTable = MibTable((1, 3, 6, 1, 4, 1, 629, 1, 16, 1, 2), )
if mibBuilder.loadTexts: nbsExpPortTable.setStatus('mandatory')
if mibBuilder.loadTexts: nbsExpPortTable.setDescription('A table of Expansion Ports in the devices.')
nbsExpPortEntry = MibTableRow((1, 3, 6, 1, 4, 1, 629, 1, 16, 1, 2, 1), ).setIndexNames((0, "NBASE-EXP-MIB", "nbsExpPortTblPortNumber"))
if mibBuilder.loadTexts: nbsExpPortEntry.setStatus('mandatory')
if mibBuilder.loadTexts: nbsExpPortEntry.setDescription('Contains the features general to NBase Expansion port modules.')
nbsExpPortTblPortNumber = MibTableColumn((1, 3, 6, 1, 4, 1, 629, 1, 16, 1, 2, 1, 1), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nbsExpPortTblPortNumber.setStatus('mandatory')
if mibBuilder.loadTexts: nbsExpPortTblPortNumber.setDescription('The Port Number of the Expansion Port. This port number is the same as the port number used for all other purposes.')
nbsExpPortTblHwType = MibTableColumn((1, 3, 6, 1, 4, 1, 629, 1, 16, 1, 2, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("other", 1), ("cpu-card", 2)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: nbsExpPortTblHwType.setStatus('mandatory')
if mibBuilder.loadTexts: nbsExpPortTblHwType.setDescription('The Hardware Type of the Expansion port.')
nbsExpPortTblSwType = MibTableColumn((1, 3, 6, 1, 4, 1, 629, 1, 16, 1, 2, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5))).clone(namedValues=NamedValues(("other", 1), ("atm-lec", 2), ("atm-mpoa", 3), ("fddi", 4), ("wan-router", 5)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: nbsExpPortTblSwType.setStatus('mandatory')
if mibBuilder.loadTexts: nbsExpPortTblSwType.setDescription('The Software Type of the Expansion port.')
nbsExpPortTblSquall = MibTableColumn((1, 3, 6, 1, 4, 1, 629, 1, 16, 1, 2, 1, 4), DisplayString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nbsExpPortTblSquall.setStatus('mandatory')
if mibBuilder.loadTexts: nbsExpPortTblSquall.setDescription('The Squall Module, if any, attached to this Expansion Port.')
nbsExpPortTblHwVersion = MibTableColumn((1, 3, 6, 1, 4, 1, 629, 1, 16, 1, 2, 1, 5), DisplayString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nbsExpPortTblHwVersion.setStatus('mandatory')
if mibBuilder.loadTexts: nbsExpPortTblHwVersion.setDescription('A description of the Hardware Version of the Expansion Port.')
nbsExpPortTblMCodeVrsn = MibTableColumn((1, 3, 6, 1, 4, 1, 629, 1, 16, 1, 2, 1, 6), DisplayString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nbsExpPortTblMCodeVrsn.setStatus('mandatory')
if mibBuilder.loadTexts: nbsExpPortTblMCodeVrsn.setDescription('A description of the Hardware Version of the Expansion Port.')
nbsExpPortTblSwVersion = MibTableColumn((1, 3, 6, 1, 4, 1, 629, 1, 16, 1, 2, 1, 7), DisplayString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nbsExpPortTblSwVersion.setStatus('mandatory')
if mibBuilder.loadTexts: nbsExpPortTblSwVersion.setDescription('A description of the Software Version of the Expansion Port.')
nbsExpPortTblStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 629, 1, 16, 1, 2, 1, 8), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("other", 1), ("ok", 2), ("error", 3)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: nbsExpPortTblStatus.setStatus('mandatory')
if mibBuilder.loadTexts: nbsExpPortTblStatus.setDescription('The status of the Expansion Port.')
nbsExpPortTftpSwFileName = MibTableColumn((1, 3, 6, 1, 4, 1, 629, 1, 16, 1, 2, 1, 9), DisplayString()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: nbsExpPortTftpSwFileName.setStatus('mandatory')
if mibBuilder.loadTexts: nbsExpPortTftpSwFileName.setDescription('The Software File Name for the Expansion Port. This is the remote file name string provided to the TFTP client application when starting a Firmware Update process. This value is stored in the system NVRAM as well as in the SNMP Agent current configuration.')
nbsExpPortInitDownload = MibTableColumn((1, 3, 6, 1, 4, 1, 629, 1, 16, 1, 2, 1, 10), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("active", 1), ("inactive", 2)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: nbsExpPortInitDownload.setStatus('mandatory')
if mibBuilder.loadTexts: nbsExpPortInitDownload.setDescription('This is used to initiate a download session from the TFTP server. The filename which will be requested my be modified via the nbsExpPortTftpSwFileName object. Note that the only writeable value is active(1), if no session is active at this moment.')
nbsAtmLanePortMaxNum = MibScalar((1, 3, 6, 1, 4, 1, 629, 1, 16, 2, 1), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nbsAtmLanePortMaxNum.setStatus('mandatory')
nbsAtmLanePortTable = MibTable((1, 3, 6, 1, 4, 1, 629, 1, 16, 2, 2), )
if mibBuilder.loadTexts: nbsAtmLanePortTable.setStatus('mandatory')
if mibBuilder.loadTexts: nbsAtmLanePortTable.setDescription('A table of Lan Emulation Clients, indexed by the physical port number.')
nbsAtmLanePortEntry = MibTableRow((1, 3, 6, 1, 4, 1, 629, 1, 16, 2, 2, 1), ).setIndexNames((0, "NBASE-EXP-MIB", "nbsAtmLanePortNumber"))
if mibBuilder.loadTexts: nbsAtmLanePortEntry.setStatus('mandatory')
if mibBuilder.loadTexts: nbsAtmLanePortEntry.setDescription('Contains the features specific to the ATM Lan Emulation Client.')
nbsAtmLanePortNumber = MibTableColumn((1, 3, 6, 1, 4, 1, 629, 1, 16, 2, 2, 1, 1), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nbsAtmLanePortNumber.setStatus('mandatory')
if mibBuilder.loadTexts: nbsAtmLanePortNumber.setDescription('The Port Number of the Lan Emulation Client.')
laneLecsAddress = MibTableColumn((1, 3, 6, 1, 4, 1, 629, 1, 16, 2, 2, 1, 2), OctetString().subtype(subtypeSpec=ValueSizeConstraint(20, 20)).setFixedLength(20)).setMaxAccess("readwrite")
if mibBuilder.loadTexts: laneLecsAddress.setStatus('mandatory')
if mibBuilder.loadTexts: laneLecsAddress.setDescription('The ATM Address (20 Octet string) of the desired Lan Emulation Configuration Server.')
sonetCircuitId = MibTableColumn((1, 3, 6, 1, 4, 1, 629, 1, 16, 2, 2, 1, 3), DisplayString()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: sonetCircuitId.setStatus('mandatory')
if mibBuilder.loadTexts: sonetCircuitId.setDescription('The Circuit Identifier, if any for the SONET interface. This information is typically provided by the owner of the SONET physical line.')
signalingStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 629, 1, 16, 2, 2, 1, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("up", 1), ("down", 2)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: signalingStatus.setStatus('mandatory')
if mibBuilder.loadTexts: signalingStatus.setDescription('The Status of the ATM UNI signaling between the uplink and the ATM switch')
nbsFddiPortMaxNum = MibScalar((1, 3, 6, 1, 4, 1, 629, 1, 16, 3, 1), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nbsFddiPortMaxNum.setStatus('mandatory')
nbsFddiPortTable = MibTable((1, 3, 6, 1, 4, 1, 629, 1, 16, 3, 2), )
if mibBuilder.loadTexts: nbsFddiPortTable.setStatus('mandatory')
if mibBuilder.loadTexts: nbsFddiPortTable.setDescription('A table of FDDI ports, indexed by the physical port number.')
nbsFddiPortEntry = MibTableRow((1, 3, 6, 1, 4, 1, 629, 1, 16, 3, 2, 1), ).setIndexNames((0, "NBASE-EXP-MIB", "nbsFddiPortNumber"))
if mibBuilder.loadTexts: nbsFddiPortEntry.setStatus('mandatory')
if mibBuilder.loadTexts: nbsFddiPortEntry.setDescription('Contains the features specific to the FDDI Port.')
nbsFddiPortNumber = MibTableColumn((1, 3, 6, 1, 4, 1, 629, 1, 16, 3, 2, 1, 1), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nbsFddiPortNumber.setStatus('mandatory')
if mibBuilder.loadTexts: nbsFddiPortNumber.setDescription('The Port Number of the Lan Emulation Client.')
nbsFddiSmtIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 629, 1, 16, 3, 2, 1, 2), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nbsFddiSmtIndex.setStatus('mandatory')
if mibBuilder.loadTexts: nbsFddiSmtIndex.setDescription('The FDDI MIB SMT index number of this port')
mibBuilder.exportSymbols("NBASE-EXP-MIB", nbsFddiPortMIB=nbsFddiPortMIB, nbsFddiPortEntry=nbsFddiPortEntry, laneLecsAddress=laneLecsAddress, nbsExpPortInitDownload=nbsExpPortInitDownload, signalingStatus=signalingStatus, nbsMegaMibs=nbsMegaMibs, nbsAtmLanePortNumber=nbsAtmLanePortNumber, nbsExpPortMaxNum=nbsExpPortMaxNum, nbsAtmLanePortMIB=nbsAtmLanePortMIB, nbsExpPortTftpSwFileName=nbsExpPortTftpSwFileName, nbsFddiPortTable=nbsFddiPortTable, nbsFddiPortNumber=nbsFddiPortNumber, nbSwitchG1=nbSwitchG1, nbsExpPortTable=nbsExpPortTable, nbsExpPortTblStatus=nbsExpPortTblStatus, nbsExpansionPortMIB=nbsExpansionPortMIB, nbsExpPortTblPortNumber=nbsExpPortTblPortNumber, nbsExpPortTblSwType=nbsExpPortTblSwType, nbsExpPortEntry=nbsExpPortEntry, sonetCircuitId=sonetCircuitId, nbase=nbase, nbsAtmLanePortTable=nbsAtmLanePortTable, nbsExpPortTblHwVersion=nbsExpPortTblHwVersion, nbsExpPortTblSquall=nbsExpPortTblSquall, nbsFddiPortMaxNum=nbsFddiPortMaxNum, nbsExpPortTblHwType=nbsExpPortTblHwType, nbsExpPortTblSwVersion=nbsExpPortTblSwVersion, nbsExpPortTblMCodeVrsn=nbsExpPortTblMCodeVrsn, nbsAtmLanePortEntry=nbsAtmLanePortEntry, nbsFddiSmtIndex=nbsFddiSmtIndex, nbsAtmLanePortMaxNum=nbsAtmLanePortMaxNum)
| (object_identifier, octet_string, integer) = mibBuilder.importSymbols('ASN1', 'ObjectIdentifier', 'OctetString', 'Integer')
(named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues')
(value_size_constraint, constraints_intersection, value_range_constraint, constraints_union, single_value_constraint) = mibBuilder.importSymbols('ASN1-REFINEMENT', 'ValueSizeConstraint', 'ConstraintsIntersection', 'ValueRangeConstraint', 'ConstraintsUnion', 'SingleValueConstraint')
(module_compliance, notification_group) = mibBuilder.importSymbols('SNMPv2-CONF', 'ModuleCompliance', 'NotificationGroup')
(object_identity, enterprises, iso, integer32, bits, mib_scalar, mib_table, mib_table_row, mib_table_column, notification_type, counter32, time_ticks, counter64, gauge32, module_identity, unsigned32, ip_address, mib_identifier) = mibBuilder.importSymbols('SNMPv2-SMI', 'ObjectIdentity', 'enterprises', 'iso', 'Integer32', 'Bits', 'MibScalar', 'MibTable', 'MibTableRow', 'MibTableColumn', 'NotificationType', 'Counter32', 'TimeTicks', 'Counter64', 'Gauge32', 'ModuleIdentity', 'Unsigned32', 'IpAddress', 'MibIdentifier')
(textual_convention, display_string) = mibBuilder.importSymbols('SNMPv2-TC', 'TextualConvention', 'DisplayString')
nbase = mib_identifier((1, 3, 6, 1, 4, 1, 629))
nb_switch_g1 = mib_identifier((1, 3, 6, 1, 4, 1, 629, 1))
nbs_mega_mibs = mib_identifier((1, 3, 6, 1, 4, 1, 629, 1, 16))
nbs_expansion_port_mib = mib_identifier((1, 3, 6, 1, 4, 1, 629, 1, 16, 1))
nbs_atm_lane_port_mib = mib_identifier((1, 3, 6, 1, 4, 1, 629, 1, 16, 2))
nbs_fddi_port_mib = mib_identifier((1, 3, 6, 1, 4, 1, 629, 1, 16, 3))
nbs_exp_port_max_num = mib_scalar((1, 3, 6, 1, 4, 1, 629, 1, 16, 1, 1), integer32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
nbsExpPortMaxNum.setStatus('mandatory')
nbs_exp_port_table = mib_table((1, 3, 6, 1, 4, 1, 629, 1, 16, 1, 2))
if mibBuilder.loadTexts:
nbsExpPortTable.setStatus('mandatory')
if mibBuilder.loadTexts:
nbsExpPortTable.setDescription('A table of Expansion Ports in the devices.')
nbs_exp_port_entry = mib_table_row((1, 3, 6, 1, 4, 1, 629, 1, 16, 1, 2, 1)).setIndexNames((0, 'NBASE-EXP-MIB', 'nbsExpPortTblPortNumber'))
if mibBuilder.loadTexts:
nbsExpPortEntry.setStatus('mandatory')
if mibBuilder.loadTexts:
nbsExpPortEntry.setDescription('Contains the features general to NBase Expansion port modules.')
nbs_exp_port_tbl_port_number = mib_table_column((1, 3, 6, 1, 4, 1, 629, 1, 16, 1, 2, 1, 1), integer32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
nbsExpPortTblPortNumber.setStatus('mandatory')
if mibBuilder.loadTexts:
nbsExpPortTblPortNumber.setDescription('The Port Number of the Expansion Port. This port number is the same as the port number used for all other purposes.')
nbs_exp_port_tbl_hw_type = mib_table_column((1, 3, 6, 1, 4, 1, 629, 1, 16, 1, 2, 1, 2), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('other', 1), ('cpu-card', 2)))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
nbsExpPortTblHwType.setStatus('mandatory')
if mibBuilder.loadTexts:
nbsExpPortTblHwType.setDescription('The Hardware Type of the Expansion port.')
nbs_exp_port_tbl_sw_type = mib_table_column((1, 3, 6, 1, 4, 1, 629, 1, 16, 1, 2, 1, 3), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3, 4, 5))).clone(namedValues=named_values(('other', 1), ('atm-lec', 2), ('atm-mpoa', 3), ('fddi', 4), ('wan-router', 5)))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
nbsExpPortTblSwType.setStatus('mandatory')
if mibBuilder.loadTexts:
nbsExpPortTblSwType.setDescription('The Software Type of the Expansion port.')
nbs_exp_port_tbl_squall = mib_table_column((1, 3, 6, 1, 4, 1, 629, 1, 16, 1, 2, 1, 4), display_string()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
nbsExpPortTblSquall.setStatus('mandatory')
if mibBuilder.loadTexts:
nbsExpPortTblSquall.setDescription('The Squall Module, if any, attached to this Expansion Port.')
nbs_exp_port_tbl_hw_version = mib_table_column((1, 3, 6, 1, 4, 1, 629, 1, 16, 1, 2, 1, 5), display_string()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
nbsExpPortTblHwVersion.setStatus('mandatory')
if mibBuilder.loadTexts:
nbsExpPortTblHwVersion.setDescription('A description of the Hardware Version of the Expansion Port.')
nbs_exp_port_tbl_m_code_vrsn = mib_table_column((1, 3, 6, 1, 4, 1, 629, 1, 16, 1, 2, 1, 6), display_string()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
nbsExpPortTblMCodeVrsn.setStatus('mandatory')
if mibBuilder.loadTexts:
nbsExpPortTblMCodeVrsn.setDescription('A description of the Hardware Version of the Expansion Port.')
nbs_exp_port_tbl_sw_version = mib_table_column((1, 3, 6, 1, 4, 1, 629, 1, 16, 1, 2, 1, 7), display_string()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
nbsExpPortTblSwVersion.setStatus('mandatory')
if mibBuilder.loadTexts:
nbsExpPortTblSwVersion.setDescription('A description of the Software Version of the Expansion Port.')
nbs_exp_port_tbl_status = mib_table_column((1, 3, 6, 1, 4, 1, 629, 1, 16, 1, 2, 1, 8), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3))).clone(namedValues=named_values(('other', 1), ('ok', 2), ('error', 3)))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
nbsExpPortTblStatus.setStatus('mandatory')
if mibBuilder.loadTexts:
nbsExpPortTblStatus.setDescription('The status of the Expansion Port.')
nbs_exp_port_tftp_sw_file_name = mib_table_column((1, 3, 6, 1, 4, 1, 629, 1, 16, 1, 2, 1, 9), display_string()).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
nbsExpPortTftpSwFileName.setStatus('mandatory')
if mibBuilder.loadTexts:
nbsExpPortTftpSwFileName.setDescription('The Software File Name for the Expansion Port. This is the remote file name string provided to the TFTP client application when starting a Firmware Update process. This value is stored in the system NVRAM as well as in the SNMP Agent current configuration.')
nbs_exp_port_init_download = mib_table_column((1, 3, 6, 1, 4, 1, 629, 1, 16, 1, 2, 1, 10), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('active', 1), ('inactive', 2)))).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
nbsExpPortInitDownload.setStatus('mandatory')
if mibBuilder.loadTexts:
nbsExpPortInitDownload.setDescription('This is used to initiate a download session from the TFTP server. The filename which will be requested my be modified via the nbsExpPortTftpSwFileName object. Note that the only writeable value is active(1), if no session is active at this moment.')
nbs_atm_lane_port_max_num = mib_scalar((1, 3, 6, 1, 4, 1, 629, 1, 16, 2, 1), integer32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
nbsAtmLanePortMaxNum.setStatus('mandatory')
nbs_atm_lane_port_table = mib_table((1, 3, 6, 1, 4, 1, 629, 1, 16, 2, 2))
if mibBuilder.loadTexts:
nbsAtmLanePortTable.setStatus('mandatory')
if mibBuilder.loadTexts:
nbsAtmLanePortTable.setDescription('A table of Lan Emulation Clients, indexed by the physical port number.')
nbs_atm_lane_port_entry = mib_table_row((1, 3, 6, 1, 4, 1, 629, 1, 16, 2, 2, 1)).setIndexNames((0, 'NBASE-EXP-MIB', 'nbsAtmLanePortNumber'))
if mibBuilder.loadTexts:
nbsAtmLanePortEntry.setStatus('mandatory')
if mibBuilder.loadTexts:
nbsAtmLanePortEntry.setDescription('Contains the features specific to the ATM Lan Emulation Client.')
nbs_atm_lane_port_number = mib_table_column((1, 3, 6, 1, 4, 1, 629, 1, 16, 2, 2, 1, 1), integer32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
nbsAtmLanePortNumber.setStatus('mandatory')
if mibBuilder.loadTexts:
nbsAtmLanePortNumber.setDescription('The Port Number of the Lan Emulation Client.')
lane_lecs_address = mib_table_column((1, 3, 6, 1, 4, 1, 629, 1, 16, 2, 2, 1, 2), octet_string().subtype(subtypeSpec=value_size_constraint(20, 20)).setFixedLength(20)).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
laneLecsAddress.setStatus('mandatory')
if mibBuilder.loadTexts:
laneLecsAddress.setDescription('The ATM Address (20 Octet string) of the desired Lan Emulation Configuration Server.')
sonet_circuit_id = mib_table_column((1, 3, 6, 1, 4, 1, 629, 1, 16, 2, 2, 1, 3), display_string()).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
sonetCircuitId.setStatus('mandatory')
if mibBuilder.loadTexts:
sonetCircuitId.setDescription('The Circuit Identifier, if any for the SONET interface. This information is typically provided by the owner of the SONET physical line.')
signaling_status = mib_table_column((1, 3, 6, 1, 4, 1, 629, 1, 16, 2, 2, 1, 4), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('up', 1), ('down', 2)))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
signalingStatus.setStatus('mandatory')
if mibBuilder.loadTexts:
signalingStatus.setDescription('The Status of the ATM UNI signaling between the uplink and the ATM switch')
nbs_fddi_port_max_num = mib_scalar((1, 3, 6, 1, 4, 1, 629, 1, 16, 3, 1), integer32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
nbsFddiPortMaxNum.setStatus('mandatory')
nbs_fddi_port_table = mib_table((1, 3, 6, 1, 4, 1, 629, 1, 16, 3, 2))
if mibBuilder.loadTexts:
nbsFddiPortTable.setStatus('mandatory')
if mibBuilder.loadTexts:
nbsFddiPortTable.setDescription('A table of FDDI ports, indexed by the physical port number.')
nbs_fddi_port_entry = mib_table_row((1, 3, 6, 1, 4, 1, 629, 1, 16, 3, 2, 1)).setIndexNames((0, 'NBASE-EXP-MIB', 'nbsFddiPortNumber'))
if mibBuilder.loadTexts:
nbsFddiPortEntry.setStatus('mandatory')
if mibBuilder.loadTexts:
nbsFddiPortEntry.setDescription('Contains the features specific to the FDDI Port.')
nbs_fddi_port_number = mib_table_column((1, 3, 6, 1, 4, 1, 629, 1, 16, 3, 2, 1, 1), integer32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
nbsFddiPortNumber.setStatus('mandatory')
if mibBuilder.loadTexts:
nbsFddiPortNumber.setDescription('The Port Number of the Lan Emulation Client.')
nbs_fddi_smt_index = mib_table_column((1, 3, 6, 1, 4, 1, 629, 1, 16, 3, 2, 1, 2), integer32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
nbsFddiSmtIndex.setStatus('mandatory')
if mibBuilder.loadTexts:
nbsFddiSmtIndex.setDescription('The FDDI MIB SMT index number of this port')
mibBuilder.exportSymbols('NBASE-EXP-MIB', nbsFddiPortMIB=nbsFddiPortMIB, nbsFddiPortEntry=nbsFddiPortEntry, laneLecsAddress=laneLecsAddress, nbsExpPortInitDownload=nbsExpPortInitDownload, signalingStatus=signalingStatus, nbsMegaMibs=nbsMegaMibs, nbsAtmLanePortNumber=nbsAtmLanePortNumber, nbsExpPortMaxNum=nbsExpPortMaxNum, nbsAtmLanePortMIB=nbsAtmLanePortMIB, nbsExpPortTftpSwFileName=nbsExpPortTftpSwFileName, nbsFddiPortTable=nbsFddiPortTable, nbsFddiPortNumber=nbsFddiPortNumber, nbSwitchG1=nbSwitchG1, nbsExpPortTable=nbsExpPortTable, nbsExpPortTblStatus=nbsExpPortTblStatus, nbsExpansionPortMIB=nbsExpansionPortMIB, nbsExpPortTblPortNumber=nbsExpPortTblPortNumber, nbsExpPortTblSwType=nbsExpPortTblSwType, nbsExpPortEntry=nbsExpPortEntry, sonetCircuitId=sonetCircuitId, nbase=nbase, nbsAtmLanePortTable=nbsAtmLanePortTable, nbsExpPortTblHwVersion=nbsExpPortTblHwVersion, nbsExpPortTblSquall=nbsExpPortTblSquall, nbsFddiPortMaxNum=nbsFddiPortMaxNum, nbsExpPortTblHwType=nbsExpPortTblHwType, nbsExpPortTblSwVersion=nbsExpPortTblSwVersion, nbsExpPortTblMCodeVrsn=nbsExpPortTblMCodeVrsn, nbsAtmLanePortEntry=nbsAtmLanePortEntry, nbsFddiSmtIndex=nbsFddiSmtIndex, nbsAtmLanePortMaxNum=nbsAtmLanePortMaxNum) |
#
# PySNMP MIB module EXTREME-LACP-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/EXTREME-LACP-MIB
# Produced by pysmi-0.3.4 at Mon Apr 29 18:54:07 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, Integer, OctetString = mibBuilder.importSymbols("ASN1", "ObjectIdentifier", "Integer", "OctetString")
NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues")
ValueSizeConstraint, ValueRangeConstraint, ConstraintsUnion, ConstraintsIntersection, SingleValueConstraint = mibBuilder.importSymbols("ASN1-REFINEMENT", "ValueSizeConstraint", "ValueRangeConstraint", "ConstraintsUnion", "ConstraintsIntersection", "SingleValueConstraint")
extremeAgent, = mibBuilder.importSymbols("EXTREME-BASE-MIB", "extremeAgent")
NotificationGroup, ModuleCompliance = mibBuilder.importSymbols("SNMPv2-CONF", "NotificationGroup", "ModuleCompliance")
Bits, Integer32, Counter64, ObjectIdentity, ModuleIdentity, NotificationType, IpAddress, TimeTicks, Gauge32, Counter32, Unsigned32, MibIdentifier, MibScalar, MibTable, MibTableRow, MibTableColumn, iso = mibBuilder.importSymbols("SNMPv2-SMI", "Bits", "Integer32", "Counter64", "ObjectIdentity", "ModuleIdentity", "NotificationType", "IpAddress", "TimeTicks", "Gauge32", "Counter32", "Unsigned32", "MibIdentifier", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "iso")
TruthValue, RowStatus, DisplayString, TextualConvention = mibBuilder.importSymbols("SNMPv2-TC", "TruthValue", "RowStatus", "DisplayString", "TextualConvention")
extremeLacp = ModuleIdentity((1, 3, 6, 1, 4, 1, 1916, 1, 19))
if mibBuilder.loadTexts: extremeLacp.setLastUpdated('0502151530Z')
if mibBuilder.loadTexts: extremeLacp.setOrganization('Extreme Networks, Inc.')
class LacpGroupId(DisplayString):
status = 'current'
subtypeSpec = DisplayString.subtypeSpec + ValueSizeConstraint(1, 32)
class LacpMemberPort(TextualConvention, Unsigned32):
status = 'current'
subtypeSpec = Unsigned32.subtypeSpec + ValueRangeConstraint(0, 4294967295)
extremeLacpTable = MibTable((1, 3, 6, 1, 4, 1, 1916, 1, 19, 1), )
if mibBuilder.loadTexts: extremeLacpTable.setStatus('current')
extremeLacpEntry = MibTableRow((1, 3, 6, 1, 4, 1, 1916, 1, 19, 1, 1), ).setIndexNames((0, "EXTREME-LACP-MIB", "extremeLacpGroup"), (0, "EXTREME-LACP-MIB", "extremeLacpMemberPort"))
if mibBuilder.loadTexts: extremeLacpEntry.setStatus('current')
extremeLacpGroup = MibTableColumn((1, 3, 6, 1, 4, 1, 1916, 1, 19, 1, 1, 1), LacpGroupId()).setMaxAccess("readonly")
if mibBuilder.loadTexts: extremeLacpGroup.setStatus('current')
extremeLacpMemberPort = MibTableColumn((1, 3, 6, 1, 4, 1, 1916, 1, 19, 1, 1, 2), LacpMemberPort()).setMaxAccess("readonly")
if mibBuilder.loadTexts: extremeLacpMemberPort.setStatus('current')
extremeLacpAggStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 1916, 1, 19, 1, 1, 3), TruthValue()).setMaxAccess("readonly")
if mibBuilder.loadTexts: extremeLacpAggStatus.setStatus('current')
mibBuilder.exportSymbols("EXTREME-LACP-MIB", extremeLacpGroup=extremeLacpGroup, LacpGroupId=LacpGroupId, extremeLacpAggStatus=extremeLacpAggStatus, extremeLacpEntry=extremeLacpEntry, extremeLacpTable=extremeLacpTable, LacpMemberPort=LacpMemberPort, extremeLacpMemberPort=extremeLacpMemberPort, PYSNMP_MODULE_ID=extremeLacp, extremeLacp=extremeLacp)
| (object_identifier, integer, octet_string) = mibBuilder.importSymbols('ASN1', 'ObjectIdentifier', 'Integer', 'OctetString')
(named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues')
(value_size_constraint, value_range_constraint, constraints_union, constraints_intersection, single_value_constraint) = mibBuilder.importSymbols('ASN1-REFINEMENT', 'ValueSizeConstraint', 'ValueRangeConstraint', 'ConstraintsUnion', 'ConstraintsIntersection', 'SingleValueConstraint')
(extreme_agent,) = mibBuilder.importSymbols('EXTREME-BASE-MIB', 'extremeAgent')
(notification_group, module_compliance) = mibBuilder.importSymbols('SNMPv2-CONF', 'NotificationGroup', 'ModuleCompliance')
(bits, integer32, counter64, object_identity, module_identity, notification_type, ip_address, time_ticks, gauge32, counter32, unsigned32, mib_identifier, mib_scalar, mib_table, mib_table_row, mib_table_column, iso) = mibBuilder.importSymbols('SNMPv2-SMI', 'Bits', 'Integer32', 'Counter64', 'ObjectIdentity', 'ModuleIdentity', 'NotificationType', 'IpAddress', 'TimeTicks', 'Gauge32', 'Counter32', 'Unsigned32', 'MibIdentifier', 'MibScalar', 'MibTable', 'MibTableRow', 'MibTableColumn', 'iso')
(truth_value, row_status, display_string, textual_convention) = mibBuilder.importSymbols('SNMPv2-TC', 'TruthValue', 'RowStatus', 'DisplayString', 'TextualConvention')
extreme_lacp = module_identity((1, 3, 6, 1, 4, 1, 1916, 1, 19))
if mibBuilder.loadTexts:
extremeLacp.setLastUpdated('0502151530Z')
if mibBuilder.loadTexts:
extremeLacp.setOrganization('Extreme Networks, Inc.')
class Lacpgroupid(DisplayString):
status = 'current'
subtype_spec = DisplayString.subtypeSpec + value_size_constraint(1, 32)
class Lacpmemberport(TextualConvention, Unsigned32):
status = 'current'
subtype_spec = Unsigned32.subtypeSpec + value_range_constraint(0, 4294967295)
extreme_lacp_table = mib_table((1, 3, 6, 1, 4, 1, 1916, 1, 19, 1))
if mibBuilder.loadTexts:
extremeLacpTable.setStatus('current')
extreme_lacp_entry = mib_table_row((1, 3, 6, 1, 4, 1, 1916, 1, 19, 1, 1)).setIndexNames((0, 'EXTREME-LACP-MIB', 'extremeLacpGroup'), (0, 'EXTREME-LACP-MIB', 'extremeLacpMemberPort'))
if mibBuilder.loadTexts:
extremeLacpEntry.setStatus('current')
extreme_lacp_group = mib_table_column((1, 3, 6, 1, 4, 1, 1916, 1, 19, 1, 1, 1), lacp_group_id()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
extremeLacpGroup.setStatus('current')
extreme_lacp_member_port = mib_table_column((1, 3, 6, 1, 4, 1, 1916, 1, 19, 1, 1, 2), lacp_member_port()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
extremeLacpMemberPort.setStatus('current')
extreme_lacp_agg_status = mib_table_column((1, 3, 6, 1, 4, 1, 1916, 1, 19, 1, 1, 3), truth_value()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
extremeLacpAggStatus.setStatus('current')
mibBuilder.exportSymbols('EXTREME-LACP-MIB', extremeLacpGroup=extremeLacpGroup, LacpGroupId=LacpGroupId, extremeLacpAggStatus=extremeLacpAggStatus, extremeLacpEntry=extremeLacpEntry, extremeLacpTable=extremeLacpTable, LacpMemberPort=LacpMemberPort, extremeLacpMemberPort=extremeLacpMemberPort, PYSNMP_MODULE_ID=extremeLacp, extremeLacp=extremeLacp) |
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# This is used as the top-level gyp file for building WebView in the Android
# tree. It should depend only on native code, as we cannot currently generate
# correct makefiles to build Java code via gyp in the Android tree.
{
'targets': [
{
'target_name': 'All',
'type': 'none',
'dependencies': [
'android_webview.gyp:libwebviewchromium',
# Needed by android_webview_java
'../base/base.gyp:base_java_activity_state',
'../base/base.gyp:base_java_memory_pressure_level_list',
'../content/content.gyp:page_transition_types_java',
'../content/content.gyp:result_codes_java',
'../content/content.gyp:speech_recognition_error_java',
'../net/net.gyp:certificate_mime_types_java',
'../net/net.gyp:cert_verify_result_android_java',
'../net/net.gyp:net_errors_java',
'../net/net.gyp:private_key_types_java',
],
}, # target_name: All
], # targets
}
| {'targets': [{'target_name': 'All', 'type': 'none', 'dependencies': ['android_webview.gyp:libwebviewchromium', '../base/base.gyp:base_java_activity_state', '../base/base.gyp:base_java_memory_pressure_level_list', '../content/content.gyp:page_transition_types_java', '../content/content.gyp:result_codes_java', '../content/content.gyp:speech_recognition_error_java', '../net/net.gyp:certificate_mime_types_java', '../net/net.gyp:cert_verify_result_android_java', '../net/net.gyp:net_errors_java', '../net/net.gyp:private_key_types_java']}]} |
class Solution:
# @param {integer[]} nums
# @return {integer}
def majorityElement(self, nums):
candidate = None
count = 0
for num in nums:
if num == candidate:
count += 1
elif count == 0:
candidate = num
count = 1
else:
count -= 1
return candidate
| class Solution:
def majority_element(self, nums):
candidate = None
count = 0
for num in nums:
if num == candidate:
count += 1
elif count == 0:
candidate = num
count = 1
else:
count -= 1
return candidate |
class Sql:
custlist = "SELECT * FROM cust";
custlistone = "SELECT * FROM cust WHERE id= '%s' ";
custinsert = "INSERT INTO cust VALUES ('%s','%s','%s')";
custdelete = "DELETE FROM cust WHERE id= '%s' ";
custupdate = "UPDATE cust SET pwd='%s',name='%s' WHERE id='%s' ";
itemlist = "SELECT * FROM item";
itemlistone = "SELECT * FROM item WHERE id= %d ";
iteminsert = "INSERT INTO item VALUES (NULL,'%s',%d,'%s',CURRENT_DATE())";
itemdelete = "DELETE FROM item WHERE id= %d ";
itemupdate = "UPDATE item SET name='%s',price=%d, imgname='%s' WHERE id= %d "; | class Sql:
custlist = 'SELECT * FROM cust'
custlistone = "SELECT * FROM cust WHERE id= '%s' "
custinsert = "INSERT INTO cust VALUES ('%s','%s','%s')"
custdelete = "DELETE FROM cust WHERE id= '%s' "
custupdate = "UPDATE cust SET pwd='%s',name='%s' WHERE id='%s' "
itemlist = 'SELECT * FROM item'
itemlistone = 'SELECT * FROM item WHERE id= %d '
iteminsert = "INSERT INTO item VALUES (NULL,'%s',%d,'%s',CURRENT_DATE())"
itemdelete = 'DELETE FROM item WHERE id= %d '
itemupdate = "UPDATE item SET name='%s',price=%d, imgname='%s' WHERE id= %d " |
'''
@author: Tibor Hercz // Tiboonn
@Link: https://github.com/Tiboonn/AWS-DeepRacer
@License: N/D
'''
def reward_function(params):
'''
Example of rewarding the agent to follow center line
'''
# Read input parameters
track_width = params['track_width']
distance_from_center = params['distance_from_center']
all_wheels_on_track = params['all_wheels_on_track']
steering = abs(params['steering_angle'])
speed = params['speed']
is_left_of_center = params['is_left_of_center']
# Calculate 3 markers that are at varying distances away from the center line
marker_1 = 0.1 * track_width
marker_2 = 0.15 * track_width
marker_3 = 0.25 * track_width
marker_4 = 0.5 * track_width
# Give higher reward if the car is closer to center line and vice versa
if not all_wheels_on_track:
reward = 1e-3
return reward
elif distance_from_center <= marker_1:
reward = 1.0 * speed
if is_left_of_center:
reward = reward + 0.1
elif distance_from_center <= marker_2:
reward = 0.8 * speed
if is_left_of_center:
reward = reward + 0.1
elif distance_from_center <= marker_3:
reward = 0.3 * speed
if is_left_of_center:
reward = reward + 0.1
elif distance_from_center <= marker_4:
reward = 0.1 * speed
if is_left_of_center:
reward = reward + 0.1
else:
reward = 1e-3 # likely crashed/ close to off track
ABS_STEERING_THRESHOLD = 15
if steering > ABS_STEERING_THRESHOLD:
reward *= 0.8
return float(reward)
| """
@author: Tibor Hercz // Tiboonn
@Link: https://github.com/Tiboonn/AWS-DeepRacer
@License: N/D
"""
def reward_function(params):
"""
Example of rewarding the agent to follow center line
"""
track_width = params['track_width']
distance_from_center = params['distance_from_center']
all_wheels_on_track = params['all_wheels_on_track']
steering = abs(params['steering_angle'])
speed = params['speed']
is_left_of_center = params['is_left_of_center']
marker_1 = 0.1 * track_width
marker_2 = 0.15 * track_width
marker_3 = 0.25 * track_width
marker_4 = 0.5 * track_width
if not all_wheels_on_track:
reward = 0.001
return reward
elif distance_from_center <= marker_1:
reward = 1.0 * speed
if is_left_of_center:
reward = reward + 0.1
elif distance_from_center <= marker_2:
reward = 0.8 * speed
if is_left_of_center:
reward = reward + 0.1
elif distance_from_center <= marker_3:
reward = 0.3 * speed
if is_left_of_center:
reward = reward + 0.1
elif distance_from_center <= marker_4:
reward = 0.1 * speed
if is_left_of_center:
reward = reward + 0.1
else:
reward = 0.001
abs_steering_threshold = 15
if steering > ABS_STEERING_THRESHOLD:
reward *= 0.8
return float(reward) |
vowels = set(['a', 'e', 'i', 'o', 'u', 'A', 'E', 'I', 'O', 'U'])
punc = set(['.', '!', '?', ' '])
while True:
sIn = input().strip()
lis = []
last = 0
for i, char in enumerate(sIn):
if char in punc:
if i - last > 0:
lis.append(sIn[last: i])
last = i + 1
if sIn[-1] not in punc:
lis.append(sIn[last:])
wordVal = 0
hashOf = 0
for word in lis:
hashOf += wordVal
wordVal = 0
vowelC = 1
for letter in word:
if letter in vowels:
wordVal += vowelC
vowelC += 1
else:
wordVal += ord(letter)
hashOf += wordVal
if sIn[-1] in punc:
hashOf += wordVal
for char in sIn:
if char in punc:
hashOf += ord(char)
print(f'The hash is {hashOf % 100}.')
if input().strip() == 'n': break | vowels = set(['a', 'e', 'i', 'o', 'u', 'A', 'E', 'I', 'O', 'U'])
punc = set(['.', '!', '?', ' '])
while True:
s_in = input().strip()
lis = []
last = 0
for (i, char) in enumerate(sIn):
if char in punc:
if i - last > 0:
lis.append(sIn[last:i])
last = i + 1
if sIn[-1] not in punc:
lis.append(sIn[last:])
word_val = 0
hash_of = 0
for word in lis:
hash_of += wordVal
word_val = 0
vowel_c = 1
for letter in word:
if letter in vowels:
word_val += vowelC
vowel_c += 1
else:
word_val += ord(letter)
hash_of += wordVal
if sIn[-1] in punc:
hash_of += wordVal
for char in sIn:
if char in punc:
hash_of += ord(char)
print(f'The hash is {hashOf % 100}.')
if input().strip() == 'n':
break |
@graph
def context_from_path():
sg = Shotgun()
sgfs = SGFS(root=sandbox, shotgun=sg)
fix = Fixture(sg)
proj = fix.Project('Example Project')
seq = proj.Sequence("AA")
shot = seq.Shot('AA_001')
step = fix.Step('Anm')
task = shot.Task('Do Work', id=123, step=step)
task2 = shot.Task('Do More Work', id=234, step=step)
ctx = sgfs.context_from_entities([task])
yield ctx.dot()
ctx = sgfs.context_from_entities([task, task2])
yield ctx.dot()
| @graph
def context_from_path():
sg = shotgun()
sgfs = sgfs(root=sandbox, shotgun=sg)
fix = fixture(sg)
proj = fix.Project('Example Project')
seq = proj.Sequence('AA')
shot = seq.Shot('AA_001')
step = fix.Step('Anm')
task = shot.Task('Do Work', id=123, step=step)
task2 = shot.Task('Do More Work', id=234, step=step)
ctx = sgfs.context_from_entities([task])
yield ctx.dot()
ctx = sgfs.context_from_entities([task, task2])
yield ctx.dot() |
# -*- coding: utf-8 -*-
def command():
return "create-farm"
def init_argument(parser):
parser.add_argument("--farm-name", required=True)
parser.add_argument("--template-no", required=True)
parser.add_argument("--comment")
def execute(requester, args):
farm_name = args.farm_name
template_no = args.template_no
comment = args.comment
parameters = {}
parameters["FarmName"] = farm_name
parameters["TemplateNo"] = template_no
if (comment != None):
parameters["Comment"] = comment
return requester.execute("/CreateFarm", parameters)
| def command():
return 'create-farm'
def init_argument(parser):
parser.add_argument('--farm-name', required=True)
parser.add_argument('--template-no', required=True)
parser.add_argument('--comment')
def execute(requester, args):
farm_name = args.farm_name
template_no = args.template_no
comment = args.comment
parameters = {}
parameters['FarmName'] = farm_name
parameters['TemplateNo'] = template_no
if comment != None:
parameters['Comment'] = comment
return requester.execute('/CreateFarm', parameters) |
#!/usr/bin/env python
print("This is example file 3")
| print('This is example file 3') |
#!/usr/bin/env python
#####################################
# Installation module for empire
#####################################
# AUTHOR OF MODULE NAME
AUTHOR="Ian Smith"
# DESCRIPTION OF THE MODULE
DESCRIPTION="This module will install/update Empire - post exploitation python/powershell for windows and nix/osx"
# INSTALL TYPE GIT, SVN, FILE DOWNLOAD
# OPTIONS = GIT, SVN, FILE
INSTALL_TYPE="GIT"
# LOCATION OF THE FILE OR GIT/SVN REPOSITORY
REPOSITORY_LOCATION="https://github.com/BC-SECURITY/Empire"
# WHERE DO YOU WANT TO INSTALL IT
INSTALL_LOCATION="empire3"
# DEPENDS FOR DEBIAN INSTALLS
DEBIAN="git"
FEDORA="git"
# COMMANDS TO RUN AFTER
AFTER_COMMANDS='cd {INSTALL_LOCATION},echo -e "\n" | ./setup/install.sh'
# DON'T RUN AFTER COMMANDS ON UPDATE
BYPASS_UPDATE="NO"
# LAUNCHER
LAUNCHER="empire"
| author = 'Ian Smith'
description = 'This module will install/update Empire - post exploitation python/powershell for windows and nix/osx'
install_type = 'GIT'
repository_location = 'https://github.com/BC-SECURITY/Empire'
install_location = 'empire3'
debian = 'git'
fedora = 'git'
after_commands = 'cd {INSTALL_LOCATION},echo -e "\n" | ./setup/install.sh'
bypass_update = 'NO'
launcher = 'empire' |
def imosh_test(
name,
srcs=[],
data=[],
**kargs):
if len(srcs) != 1:
fail("Exactly one source file must be given.")
native.genrule(
name = name + "_genrule_sh",
srcs = ["//bin:imosh_test_generate"],
outs = [name + "_genrule.sh"],
cmd = "$(BINDIR)/bin/imosh_test_generate " +
PACKAGE_NAME + "/" + srcs[0] + " >$@",
)
native.sh_test(
name = name,
srcs = [name + "_genrule.sh"],
data = [":" + srcs[0]] + data + ["//bin:imosh"],
**kargs)
| def imosh_test(name, srcs=[], data=[], **kargs):
if len(srcs) != 1:
fail('Exactly one source file must be given.')
native.genrule(name=name + '_genrule_sh', srcs=['//bin:imosh_test_generate'], outs=[name + '_genrule.sh'], cmd='$(BINDIR)/bin/imosh_test_generate ' + PACKAGE_NAME + '/' + srcs[0] + ' >$@')
native.sh_test(name=name, srcs=[name + '_genrule.sh'], data=[':' + srcs[0]] + data + ['//bin:imosh'], **kargs) |
# -*- coding: utf-8 -*-
name = 'usdview'
version = '20.05'
requires = [
'pyside-1.2',
'usd-20.05',
'ocio_configs',
'turret_usd'
]
def commands():
env.DEFAULT_USD.set('{root}/bin/DefaultUSD.usda')
| name = 'usdview'
version = '20.05'
requires = ['pyside-1.2', 'usd-20.05', 'ocio_configs', 'turret_usd']
def commands():
env.DEFAULT_USD.set('{root}/bin/DefaultUSD.usda') |
def make_ends(nums):
first = nums[0]
last = nums[len(nums)-1]
newArr = []
newArr.append(first)
newArr.append(last)
return newArr
| def make_ends(nums):
first = nums[0]
last = nums[len(nums) - 1]
new_arr = []
newArr.append(first)
newArr.append(last)
return newArr |
# intro to function
def my_function():
print("Hello, this is function")
# calling function
my_function() | def my_function():
print('Hello, this is function')
my_function() |
class Solution:
def numDifferentIntegers(self, word: str) -> int:
stripped = {}
i = 0
for c in word:
if c in {"0":1, "1":1, "2":1, "3":1, "4":1, "5":1, "6":1, "7":1, "8":1, "9":1}:
if i in stripped:
if stripped[i] == "0":
stripped[i] = c
else:
stripped[i] = stripped[i] + c
else:
stripped[i] = c
else:
i = i + 1
counter = {}
for key in stripped:
if stripped[key] not in counter:
counter[stripped[key]] = 1
else:
counter[stripped[key]] = counter[stripped[key]] + 1
return len(counter) | class Solution:
def num_different_integers(self, word: str) -> int:
stripped = {}
i = 0
for c in word:
if c in {'0': 1, '1': 1, '2': 1, '3': 1, '4': 1, '5': 1, '6': 1, '7': 1, '8': 1, '9': 1}:
if i in stripped:
if stripped[i] == '0':
stripped[i] = c
else:
stripped[i] = stripped[i] + c
else:
stripped[i] = c
else:
i = i + 1
counter = {}
for key in stripped:
if stripped[key] not in counter:
counter[stripped[key]] = 1
else:
counter[stripped[key]] = counter[stripped[key]] + 1
return len(counter) |
## @package serde
# Module caffe2.python.predictor.serde
def serialize_protobuf_struct(protobuf_struct):
return protobuf_struct.SerializeToString()
def deserialize_protobuf_struct(serialized_protobuf, struct_type):
deser = struct_type()
deser.ParseFromString(serialized_protobuf)
return deser
| def serialize_protobuf_struct(protobuf_struct):
return protobuf_struct.SerializeToString()
def deserialize_protobuf_struct(serialized_protobuf, struct_type):
deser = struct_type()
deser.ParseFromString(serialized_protobuf)
return deser |
# You can import and use this in a DAG in the parent folder like usual in
# Python, i.e. `import python_callables.compliance`
def check_port_22_open():
pass
| def check_port_22_open():
pass |
#!/usr/bin/python
with open("vita.md") as fp:
lines = fp.readlines()
lines2 = lines[6:]
lines3 = lines[8:]
# print lines2
with open("vita_noyaml.md", "w") as fp:
fp.writelines(lines2)
# print lines3
with open("vita_noyaml_nocvaspdf.md", "w") as fp:
fp.writelines(lines3)
# onepage
with open("vita_onepage.md") as fp:
lines = fp.readlines()
lines2 = lines[5:]
lines3 = lines[7:]
with open("vita_onepage_noyaml.md", "w") as fp:
fp.writelines(lines2)
with open("vita_onepage_nocvaspdf.md", "w") as fp:
fp.writelines(lines3) | with open('vita.md') as fp:
lines = fp.readlines()
lines2 = lines[6:]
lines3 = lines[8:]
with open('vita_noyaml.md', 'w') as fp:
fp.writelines(lines2)
with open('vita_noyaml_nocvaspdf.md', 'w') as fp:
fp.writelines(lines3)
with open('vita_onepage.md') as fp:
lines = fp.readlines()
lines2 = lines[5:]
lines3 = lines[7:]
with open('vita_onepage_noyaml.md', 'w') as fp:
fp.writelines(lines2)
with open('vita_onepage_nocvaspdf.md', 'w') as fp:
fp.writelines(lines3) |
__author__ = 'nikaashpuri'
'''
TCP_SERVER_IP = '162.251.84.104'
SYSTEM_PATH_TO_APPEND = '/public_html/aquabrim_project'
LOG_FILE_LOCATION = '/logs/django_log'
TCP_SERVER_FILE_PATH = '/public_html/aquabrim_project/machine/tcp_ip_server.py'
DATABASE_PATH = '/sites_database/dev.db'
'''
TCP_SERVER_IP = 'localhost'
LOG_FILE_LOCATION = '/Users/nikaashpuri/Documents/alibi_projects/aquabrim_project/logs/django_log'
TCP_SERVER_FILE_PATH = '/Users/nikaashpuri/Documents/alibi_projects/aquabrim_project/machine/tcp_ip_server.py'
SYSTEM_PATH_TO_APPEND = '/Users/nikaashpuri/Documents/alibi_projects/aquabrim_project/'
DATABASE_PATH = 'dev.db'
TCP_SERVER_PORT = 40000
NUMBER_OF_SERVER_START_ATTEMPTS = 5
| __author__ = 'nikaashpuri'
"\nTCP_SERVER_IP = '162.251.84.104'\nSYSTEM_PATH_TO_APPEND = '/public_html/aquabrim_project'\nLOG_FILE_LOCATION = '/logs/django_log'\nTCP_SERVER_FILE_PATH = '/public_html/aquabrim_project/machine/tcp_ip_server.py'\nDATABASE_PATH = '/sites_database/dev.db'\n"
tcp_server_ip = 'localhost'
log_file_location = '/Users/nikaashpuri/Documents/alibi_projects/aquabrim_project/logs/django_log'
tcp_server_file_path = '/Users/nikaashpuri/Documents/alibi_projects/aquabrim_project/machine/tcp_ip_server.py'
system_path_to_append = '/Users/nikaashpuri/Documents/alibi_projects/aquabrim_project/'
database_path = 'dev.db'
tcp_server_port = 40000
number_of_server_start_attempts = 5 |
class Solution:
# @param candidates, a list of integers
# @param target, integer
# @return a list of lists of integers
def combinationSum(self, candidates, target):
if not candidates:
return []
candidates.sort()
n = len(candidates)
res = []
def solve(start, target, tmp):
if target < 0:
return
if target == 0:
res.append(tmp[:])
return
for i in xrange(start, n):
tmp.append(candidates[i])
solve(i, target-candidates[i], tmp)
tmp.pop()
solve(0, target, [])
return res
| class Solution:
def combination_sum(self, candidates, target):
if not candidates:
return []
candidates.sort()
n = len(candidates)
res = []
def solve(start, target, tmp):
if target < 0:
return
if target == 0:
res.append(tmp[:])
return
for i in xrange(start, n):
tmp.append(candidates[i])
solve(i, target - candidates[i], tmp)
tmp.pop()
solve(0, target, [])
return res |
# Unless explicitly stated otherwise all files in this repository are licensed
# under the Apache License Version 2.0.
# This product includes software developed at Datadog (https://www.datadoghq.com/).
# Copyright 2018 Datadog, Inc.
# (C) Datadog, Inc. 2010-2016
# All rights reserved
# Licensed under Simplified BSD License (see LICENSE)
BASIC_METRICS = {
'cpu.extra': {
's_type' : 'delta',
'unit' : 'millisecond',
'rollup' : 'summation',
'entity' : ['VirtualMachine']
},
'cpu.ready': {
's_type' : 'delta',
'unit' : 'millisecond',
'rollup' : 'summation',
'entity' : ['VirtualMachine', 'HostSystem']
},
'cpu.usage': {
's_type' : 'rate',
'unit' : 'percent',
'rollup' : 'average',
'entity' : ['VirtualMachine', 'HostSystem']
},
'cpu.usagemhz': {
's_type' : 'rate',
'unit' : 'megaHertz',
'rollup' : 'average',
'entity' : ['VirtualMachine', 'HostSystem', 'ResourcePool']
},
'disk.commandsAborted': {
's_type' : 'delta',
'unit' : 'number',
'rollup' : 'summation',
'entity' : ['VirtualMachine', 'HostSystem', 'Datastore']
},
'disk.deviceLatency': {
's_type' : 'absolute',
'unit' : 'millisecond',
'rollup' : 'average',
'entity' : ['HostSystem']
},
'disk.deviceReadLatency': {
's_type' : 'absolute',
'unit' : 'millisecond',
'rollup' : 'average',
'entity' : ['HostSystem']
},
'disk.deviceWriteLatency': {
's_type' : 'absolute',
'unit' : 'millisecond',
'rollup' : 'average',
'entity' : ['HostSystem']
},
'disk.queueLatency': {
's_type' : 'absolute',
'unit' : 'millisecond',
'rollup' : 'average',
'entity' : ['HostSystem']
},
'disk.totalLatency': {
's_type' : 'absolute',
'unit' : 'millisecond',
'rollup' : 'average',
'entity' : ['HostSystemDatastore']
},
'mem.active': {
's_type' : 'absolute',
'unit' : 'kiloBytes',
'rollup' : 'average',
'entity' : ['VirtualMachine', 'HostSystem', 'ResourcePool']
},
'mem.compressed': {
's_type' : 'absolute',
'unit' : 'kiloBytes',
'rollup' : 'average',
'entity' : ['VirtualMachine', 'HostSystem', 'ResourcePool']
},
'mem.consumed': {
's_type' : 'absolute',
'unit' : 'kiloBytes',
'rollup' : 'average',
'entity' : ['VirtualMachine', 'HostSystem', 'ResourcePool']
},
'mem.overhead': {
's_type' : 'absolute',
'unit' : 'kiloBytes',
'rollup' : 'average',
'entity' : ['VirtualMachine', 'HostSystem', 'ResourcePool']
},
'mem.vmmemctl': {
's_type' : 'absolute',
'unit' : 'kiloBytes',
'rollup' : 'average',
'entity' : ['VirtualMachine', 'HostSystem', 'ResourcePool']
},
'network.received': {
's_type' : 'rate',
'unit' : 'kiloBytesPerSecond',
'rollup' : 'average',
'entity' : ['VirtualMachine', 'HostSystem']
},
'network.transmitted': {
's_type' : 'rate',
'unit' : 'kiloBytesPerSecond',
'rollup' : 'average',
'entity' : ['VirtualMachine', 'HostSystem']
},
'net.received': {
's_type' : 'rate',
'unit' : 'kiloBytesPerSecond',
'rollup' : 'average',
'entity' : ['VirtualMachine', 'HostSystem']
},
'net.transmitted': {
's_type' : 'rate',
'unit' : 'kiloBytesPerSecond',
'rollup' : 'average',
'entity' : ['VirtualMachine', 'HostSystem']
},
}
| basic_metrics = {'cpu.extra': {'s_type': 'delta', 'unit': 'millisecond', 'rollup': 'summation', 'entity': ['VirtualMachine']}, 'cpu.ready': {'s_type': 'delta', 'unit': 'millisecond', 'rollup': 'summation', 'entity': ['VirtualMachine', 'HostSystem']}, 'cpu.usage': {'s_type': 'rate', 'unit': 'percent', 'rollup': 'average', 'entity': ['VirtualMachine', 'HostSystem']}, 'cpu.usagemhz': {'s_type': 'rate', 'unit': 'megaHertz', 'rollup': 'average', 'entity': ['VirtualMachine', 'HostSystem', 'ResourcePool']}, 'disk.commandsAborted': {'s_type': 'delta', 'unit': 'number', 'rollup': 'summation', 'entity': ['VirtualMachine', 'HostSystem', 'Datastore']}, 'disk.deviceLatency': {'s_type': 'absolute', 'unit': 'millisecond', 'rollup': 'average', 'entity': ['HostSystem']}, 'disk.deviceReadLatency': {'s_type': 'absolute', 'unit': 'millisecond', 'rollup': 'average', 'entity': ['HostSystem']}, 'disk.deviceWriteLatency': {'s_type': 'absolute', 'unit': 'millisecond', 'rollup': 'average', 'entity': ['HostSystem']}, 'disk.queueLatency': {'s_type': 'absolute', 'unit': 'millisecond', 'rollup': 'average', 'entity': ['HostSystem']}, 'disk.totalLatency': {'s_type': 'absolute', 'unit': 'millisecond', 'rollup': 'average', 'entity': ['HostSystemDatastore']}, 'mem.active': {'s_type': 'absolute', 'unit': 'kiloBytes', 'rollup': 'average', 'entity': ['VirtualMachine', 'HostSystem', 'ResourcePool']}, 'mem.compressed': {'s_type': 'absolute', 'unit': 'kiloBytes', 'rollup': 'average', 'entity': ['VirtualMachine', 'HostSystem', 'ResourcePool']}, 'mem.consumed': {'s_type': 'absolute', 'unit': 'kiloBytes', 'rollup': 'average', 'entity': ['VirtualMachine', 'HostSystem', 'ResourcePool']}, 'mem.overhead': {'s_type': 'absolute', 'unit': 'kiloBytes', 'rollup': 'average', 'entity': ['VirtualMachine', 'HostSystem', 'ResourcePool']}, 'mem.vmmemctl': {'s_type': 'absolute', 'unit': 'kiloBytes', 'rollup': 'average', 'entity': ['VirtualMachine', 'HostSystem', 'ResourcePool']}, 'network.received': {'s_type': 'rate', 'unit': 'kiloBytesPerSecond', 'rollup': 'average', 'entity': ['VirtualMachine', 'HostSystem']}, 'network.transmitted': {'s_type': 'rate', 'unit': 'kiloBytesPerSecond', 'rollup': 'average', 'entity': ['VirtualMachine', 'HostSystem']}, 'net.received': {'s_type': 'rate', 'unit': 'kiloBytesPerSecond', 'rollup': 'average', 'entity': ['VirtualMachine', 'HostSystem']}, 'net.transmitted': {'s_type': 'rate', 'unit': 'kiloBytesPerSecond', 'rollup': 'average', 'entity': ['VirtualMachine', 'HostSystem']}} |
# !/usr/bin/env python3
# -*- cosing: utf-8 -*-
fileptr = open("file2.txt", "a")
fileptr.write("Python has an easy syntax and user-friendly interaction.")
fileptr.close() | fileptr = open('file2.txt', 'a')
fileptr.write('Python has an easy syntax and user-friendly interaction.')
fileptr.close() |
main_menu = [
["1", "Spam Tools", "Amino-Tools"],
["2", "Chat Tools"],
["3", "Activity Tools"],
["4", "profile Tools"],
["5", "raid Tools"],
["0", "Exit"]
]
spam_tools_menu = [
["1", "Spam Bot", "Amino-Tools"],
["2", "Wiki Spam Bot"],
["3", "Wall Spam Bot"],
["4", "Blog Spam Bot"]
]
chat_tools_menu = [
["1", "ChatId Finder", "Amino-Tools"],
["2", "Crash Chat Description"],
["3", "Transfer Fake Coins"]
]
activity_tools_menu = [
["1", "Invite Bot", "Amino-Tools"],
["2", "Like Bot"],
["3", "Follow Bot"],
["4", "Unfollow Bot"]
]
profile_tools_menu = [
["1", "Blogs Spam Bot", "Amino-Tools"],
["2", "Wiki Spam Bot"]
]
raid_tools_menu = [
["1", "Spam System Messages", "Amino-Tools"],
["2", "Send System Message"],
["3", "Spam With Join And Leave"],
["4", "Join Active Chats"]
]
chat_id_finder_menu = [
["1", "Get Public Chats ChatId", "Amino-Tools"],
["2", "Get Joined Chats ChatId"]
]
chat_invite_bot_menu = [
["1", "Invite Online Users", "Amino-Tools"],
["2", "Invite Recent Users"]
]
follow_bot_menu = [
["1", "Follow Online Users", "Amino-Tools"],
["2", "Follow Recent Users"]
]
| main_menu = [['1', 'Spam Tools', 'Amino-Tools'], ['2', 'Chat Tools'], ['3', 'Activity Tools'], ['4', 'profile Tools'], ['5', 'raid Tools'], ['0', 'Exit']]
spam_tools_menu = [['1', 'Spam Bot', 'Amino-Tools'], ['2', 'Wiki Spam Bot'], ['3', 'Wall Spam Bot'], ['4', 'Blog Spam Bot']]
chat_tools_menu = [['1', 'ChatId Finder', 'Amino-Tools'], ['2', 'Crash Chat Description'], ['3', 'Transfer Fake Coins']]
activity_tools_menu = [['1', 'Invite Bot', 'Amino-Tools'], ['2', 'Like Bot'], ['3', 'Follow Bot'], ['4', 'Unfollow Bot']]
profile_tools_menu = [['1', 'Blogs Spam Bot', 'Amino-Tools'], ['2', 'Wiki Spam Bot']]
raid_tools_menu = [['1', 'Spam System Messages', 'Amino-Tools'], ['2', 'Send System Message'], ['3', 'Spam With Join And Leave'], ['4', 'Join Active Chats']]
chat_id_finder_menu = [['1', 'Get Public Chats ChatId', 'Amino-Tools'], ['2', 'Get Joined Chats ChatId']]
chat_invite_bot_menu = [['1', 'Invite Online Users', 'Amino-Tools'], ['2', 'Invite Recent Users']]
follow_bot_menu = [['1', 'Follow Online Users', 'Amino-Tools'], ['2', 'Follow Recent Users']] |
# Good morning! Here's your coding interview problem for today.
# This problem was asked by Google.
# A unival tree (which stands for "universal value") is a tree where all nodes under it have the same value.
# Given the root to a binary tree, count the number of unival subtrees.
# For example, the following tree has 5 unival subtrees:
# 0
# / \
# 1 0
# / \
# 1 0
# / \
# 1 1
class node:
def __init__(self,value,left=None,right=None):
self.value = value
self.left = left
self.right = right
def print(self):
print(self.left, '<--',self.value, '-->',self.right)
tree = node(False,node(True),node(False,node(True,node(True),node(True)),node(False)))
count = 0
def unival(tree):
global count
if tree == None:
return True
else :
if unival(tree.left) == unival(tree.right):
count +=1
return tree.value
unival(tree)
print(count) | class Node:
def __init__(self, value, left=None, right=None):
self.value = value
self.left = left
self.right = right
def print(self):
print(self.left, '<--', self.value, '-->', self.right)
tree = node(False, node(True), node(False, node(True, node(True), node(True)), node(False)))
count = 0
def unival(tree):
global count
if tree == None:
return True
else:
if unival(tree.left) == unival(tree.right):
count += 1
return tree.value
unival(tree)
print(count) |
#Declare variables to hold the file name and access mode
fileName = "GuestList.txt"
accessMode = "w"
#Open the file for writing
myFile = open(fileName, accessMode)
#Write the guest names and ages to the file
#I can write an entire record in one write statement
myFile.write("Doyle McCarty,27\n")
myFile.write("Jodi Mills,25\n")
myFile.write("Nicholas Rose,32\n")
#I could write the name and age in separate write statements
myFile.write("Kian Goddard")
myFile.write(",36\n")
myFile.write("Zuha Hanania")
myFile.write(",26\n")
#Close the file
myFile.close()
| file_name = 'GuestList.txt'
access_mode = 'w'
my_file = open(fileName, accessMode)
myFile.write('Doyle McCarty,27\n')
myFile.write('Jodi Mills,25\n')
myFile.write('Nicholas Rose,32\n')
myFile.write('Kian Goddard')
myFile.write(',36\n')
myFile.write('Zuha Hanania')
myFile.write(',26\n')
myFile.close() |
# based on: https://github.com/tigertv/secretpy/blob/master/secretpy/ciphers/autokey.py
class cipher_autokey:
def process(self, alphabet, key, text, isEncrypt):
ans = ""
for i in range(len(text)):
m = text[i]
if i < len(key):
k = key[i]
else:
if isEncrypt == 1:
k = text[i - len(key)]
else:
k = ans[i - len(key)]
try:
alphI = alphabet.index(m)
except ValueError:
wrchar = m.encode('utf-8')
raise Exception("Can't find char '" + wrchar + "' of text in alphabet!")
try:
alphI += isEncrypt * alphabet.index(k)
except ValueError:
wrchar = k.encode('utf-8')
raise Exception("Can't find char '" + wrchar + "' of text in alphabet!")
alphI = alphI % len(alphabet)
enc = alphabet[alphI]
ans += enc
return ans
def encrypt(self, text, key, alphabet=u"abcdefghijklmnopqrstuvwxyz"):
return self.process(alphabet, key, text, 1)
def decrypt(self, text, key, alphabet=u"abcdefghijklmnopqrstuvwxyz"):
return self.process(alphabet, key, text, -1)
| class Cipher_Autokey:
def process(self, alphabet, key, text, isEncrypt):
ans = ''
for i in range(len(text)):
m = text[i]
if i < len(key):
k = key[i]
elif isEncrypt == 1:
k = text[i - len(key)]
else:
k = ans[i - len(key)]
try:
alph_i = alphabet.index(m)
except ValueError:
wrchar = m.encode('utf-8')
raise exception("Can't find char '" + wrchar + "' of text in alphabet!")
try:
alph_i += isEncrypt * alphabet.index(k)
except ValueError:
wrchar = k.encode('utf-8')
raise exception("Can't find char '" + wrchar + "' of text in alphabet!")
alph_i = alphI % len(alphabet)
enc = alphabet[alphI]
ans += enc
return ans
def encrypt(self, text, key, alphabet=u'abcdefghijklmnopqrstuvwxyz'):
return self.process(alphabet, key, text, 1)
def decrypt(self, text, key, alphabet=u'abcdefghijklmnopqrstuvwxyz'):
return self.process(alphabet, key, text, -1) |
class User:
user_list =[]
user_list = []
def __init__(self, user_name, email, password):
'''
saving user credentials into user_list for login
'''
self.user_name = user_name
self.email = email
self.password = password
def save_user(self):
'''
saving a user into our list of users
'''
User.user_list.append(self)
def delete_user(self):
'''
delete a user from our list of users
'''
User.user_list.remove(self)
def check_existing_user(self):
return User.check_existing_user(self)
def display_users(self):
'''
function that saves Users
'''
return User.display_users(self)
@classmethod
def find_by_password(user_name, password):
# '''
# Method that takes in a name and returns a name that matches that user_name.
# Args:
# name: password to search for
# Returns :
# name of person that matches the name.
# '''
for user in cls.user_list:
if user.user_name == User:
return User | class User:
user_list = []
user_list = []
def __init__(self, user_name, email, password):
"""
saving user credentials into user_list for login
"""
self.user_name = user_name
self.email = email
self.password = password
def save_user(self):
"""
saving a user into our list of users
"""
User.user_list.append(self)
def delete_user(self):
"""
delete a user from our list of users
"""
User.user_list.remove(self)
def check_existing_user(self):
return User.check_existing_user(self)
def display_users(self):
"""
function that saves Users
"""
return User.display_users(self)
@classmethod
def find_by_password(user_name, password):
for user in cls.user_list:
if user.user_name == User:
return User |
init_config = {
'username': '[email protected]',
'pwd': 'password',
'mongodb': {
'host': 'mongodb://localhost:27017/'
}
} | init_config = {'username': '[email protected]', 'pwd': 'password', 'mongodb': {'host': 'mongodb://localhost:27017/'}} |
#!/usr/bin/env python
__all__ = ["dendrogram", "dotplot", "drawable", "letter", "logo"]
__copyright__ = "Copyright 2007-2020, The Cogent Project"
__contributors__ = [
"Peter Maxwell",
"Gavin Huttley",
"Rob Knight",
"Zongzhi Liu",
"Matthew Wakefield",
"Stephanie Wilson",
"Rahul Ghangas",
"Sheng Han Moses Koh",
]
__license__ = "BSD-3"
__version__ = "2020.7.2a"
__status__ = "Production"
| __all__ = ['dendrogram', 'dotplot', 'drawable', 'letter', 'logo']
__copyright__ = 'Copyright 2007-2020, The Cogent Project'
__contributors__ = ['Peter Maxwell', 'Gavin Huttley', 'Rob Knight', 'Zongzhi Liu', 'Matthew Wakefield', 'Stephanie Wilson', 'Rahul Ghangas', 'Sheng Han Moses Koh']
__license__ = 'BSD-3'
__version__ = '2020.7.2a'
__status__ = 'Production' |
#
# PySNMP MIB module Dell-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/Dell-MIB
# Produced by pysmi-0.3.4 at Wed May 1 12:55:18 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")
ValueSizeConstraint, ConstraintsUnion, ConstraintsIntersection, SingleValueConstraint, ValueRangeConstraint = mibBuilder.importSymbols("ASN1-REFINEMENT", "ValueSizeConstraint", "ConstraintsUnion", "ConstraintsIntersection", "SingleValueConstraint", "ValueRangeConstraint")
ModuleCompliance, NotificationGroup = mibBuilder.importSymbols("SNMPv2-CONF", "ModuleCompliance", "NotificationGroup")
Bits, TimeTicks, Counter64, NotificationType, ObjectIdentity, MibScalar, MibTable, MibTableRow, MibTableColumn, MibIdentifier, iso, Counter32, enterprises, ModuleIdentity, Unsigned32, Gauge32, IpAddress, Integer32 = mibBuilder.importSymbols("SNMPv2-SMI", "Bits", "TimeTicks", "Counter64", "NotificationType", "ObjectIdentity", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "MibIdentifier", "iso", "Counter32", "enterprises", "ModuleIdentity", "Unsigned32", "Gauge32", "IpAddress", "Integer32")
DisplayString, TextualConvention = mibBuilder.importSymbols("SNMPv2-TC", "DisplayString", "TextualConvention")
class Percents(Integer32):
subtypeSpec = Integer32.subtypeSpec + ValueRangeConstraint(0, 100)
class NetNumber(OctetString):
subtypeSpec = OctetString.subtypeSpec + ValueSizeConstraint(4, 4)
fixedLength = 4
class VlanPriority(Integer32):
subtypeSpec = Integer32.subtypeSpec + ValueRangeConstraint(0, 7)
rnd = ModuleIdentity((1, 3, 6, 1, 4, 1, 89))
rnd.setRevisions(('2007-01-02 00:00',))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
if mibBuilder.loadTexts: rnd.setRevisionsDescriptions(('Initial revision.',))
if mibBuilder.loadTexts: rnd.setLastUpdated('200701020000Z')
if mibBuilder.loadTexts: rnd.setOrganization('Dell')
if mibBuilder.loadTexts: rnd.setContactInfo('www.dell.com')
if mibBuilder.loadTexts: rnd.setDescription('This private MIB module defines Dell private MIBs.')
rndNotifications = ObjectIdentity((1, 3, 6, 1, 4, 1, 89, 0))
if mibBuilder.loadTexts: rndNotifications.setStatus('current')
if mibBuilder.loadTexts: rndNotifications.setDescription(" All the rnd notifications will reside under this branch as specified in RFC2578 'Structure of Management Information Version 2 (SMIv2)' 8.5")
rndMng = MibIdentifier((1, 3, 6, 1, 4, 1, 89, 1))
rndDeviceParams = MibIdentifier((1, 3, 6, 1, 4, 1, 89, 2))
rndBootP = MibIdentifier((1, 3, 6, 1, 4, 1, 89, 24))
ipSpec = MibIdentifier((1, 3, 6, 1, 4, 1, 89, 26))
rsTunning = MibIdentifier((1, 3, 6, 1, 4, 1, 89, 29))
rndApplications = MibIdentifier((1, 3, 6, 1, 4, 1, 89, 35))
rsUDP = MibIdentifier((1, 3, 6, 1, 4, 1, 89, 42))
swInterfaces = MibIdentifier((1, 3, 6, 1, 4, 1, 89, 43))
rlIPmulticast = MibIdentifier((1, 3, 6, 1, 4, 1, 89, 46))
rlFFT = MibIdentifier((1, 3, 6, 1, 4, 1, 89, 47))
vlan = MibIdentifier((1, 3, 6, 1, 4, 1, 89, 48))
rlRmonControl = MibIdentifier((1, 3, 6, 1, 4, 1, 89, 49))
rlBrgMacSwitch = MibIdentifier((1, 3, 6, 1, 4, 1, 89, 50))
rlExperience = MibIdentifier((1, 3, 6, 1, 4, 1, 89, 51))
rlCli = MibIdentifier((1, 3, 6, 1, 4, 1, 89, 52))
rlPhysicalDescription = MibIdentifier((1, 3, 6, 1, 4, 1, 89, 53))
rlIfInterfaces = MibIdentifier((1, 3, 6, 1, 4, 1, 89, 54))
rlMacMulticast = MibIdentifier((1, 3, 6, 1, 4, 1, 89, 55))
rlGalileo = MibIdentifier((1, 3, 6, 1, 4, 1, 89, 56))
rlpBridgeMIBObjects = MibIdentifier((1, 3, 6, 1, 4, 1, 89, 57))
rlTelnet = MibIdentifier((1, 3, 6, 1, 4, 1, 89, 58))
rlPolicy = MibIdentifier((1, 3, 6, 1, 4, 1, 89, 59))
rlArpSpoofing = MibIdentifier((1, 3, 6, 1, 4, 1, 89, 60))
rlMir = MibIdentifier((1, 3, 6, 1, 4, 1, 89, 61))
rlIpMRouteStdMIB = MibIdentifier((1, 3, 6, 1, 4, 1, 89, 62))
rl3sw2swTables = MibIdentifier((1, 3, 6, 1, 4, 1, 89, 63))
rlGvrp = MibIdentifier((1, 3, 6, 1, 4, 1, 89, 64))
rlDot3adAgg = MibIdentifier((1, 3, 6, 1, 4, 1, 89, 65))
rlEmbWeb = MibIdentifier((1, 3, 6, 1, 4, 1, 89, 66))
rlSwPackageVersion = MibIdentifier((1, 3, 6, 1, 4, 1, 89, 67))
rlBroadcom = MibIdentifier((1, 3, 6, 1, 4, 1, 89, 68))
rlMultiSessionTerminal = MibIdentifier((1, 3, 6, 1, 4, 1, 89, 69))
rlRCli = MibIdentifier((1, 3, 6, 1, 4, 1, 89, 70))
rlBgp = MibIdentifier((1, 3, 6, 1, 4, 1, 89, 71))
rlAgentsCapabilitiesGroups = MibIdentifier((1, 3, 6, 1, 4, 1, 89, 72))
rlAggregateVlan = MibIdentifier((1, 3, 6, 1, 4, 1, 89, 73))
rlGmrp = MibIdentifier((1, 3, 6, 1, 4, 1, 89, 75))
rlDhcpCl = MibIdentifier((1, 3, 6, 1, 4, 1, 89, 76))
rlStormCtrl = MibIdentifier((1, 3, 6, 1, 4, 1, 89, 77))
rlSsh = MibIdentifier((1, 3, 6, 1, 4, 1, 89, 78))
rlAAA = MibIdentifier((1, 3, 6, 1, 4, 1, 89, 79))
rlRadius = MibIdentifier((1, 3, 6, 1, 4, 1, 89, 80))
rlTraceRoute = MibIdentifier((1, 3, 6, 1, 4, 1, 89, 81))
rlSyslog = MibIdentifier((1, 3, 6, 1, 4, 1, 89, 82))
rlEnv = MibIdentifier((1, 3, 6, 1, 4, 1, 89, 83))
rlSmon = MibIdentifier((1, 3, 6, 1, 4, 1, 89, 84))
rlSocket = MibIdentifier((1, 3, 6, 1, 4, 1, 89, 85))
rlDigitalKeyManage = MibIdentifier((1, 3, 6, 1, 4, 1, 89, 86))
rlCopy = MibIdentifier((1, 3, 6, 1, 4, 1, 89, 87))
rlQosCliMib = MibIdentifier((1, 3, 6, 1, 4, 1, 89, 88))
rlMngInf = MibIdentifier((1, 3, 6, 1, 4, 1, 89, 89))
rlPhy = MibIdentifier((1, 3, 6, 1, 4, 1, 89, 90))
rlJumboFrames = MibIdentifier((1, 3, 6, 1, 4, 1, 89, 91))
rlTimeSynchronization = MibIdentifier((1, 3, 6, 1, 4, 1, 89, 92))
rlDnsCl = MibIdentifier((1, 3, 6, 1, 4, 1, 89, 93))
rlCDB = MibIdentifier((1, 3, 6, 1, 4, 1, 89, 94))
rldot1x = MibIdentifier((1, 3, 6, 1, 4, 1, 89, 95))
rlFile = MibIdentifier((1, 3, 6, 1, 4, 1, 89, 96))
rlAAAEap = MibIdentifier((1, 3, 6, 1, 4, 1, 89, 97))
rlSNMP = MibIdentifier((1, 3, 6, 1, 4, 1, 89, 98))
rlSsl = MibIdentifier((1, 3, 6, 1, 4, 1, 89, 100))
rlMacBasePrio = MibIdentifier((1, 3, 6, 1, 4, 1, 89, 101))
rlWlanAccessPoint = MibIdentifier((1, 3, 6, 1, 4, 1, 89, 102))
rlLocalization = MibIdentifier((1, 3, 6, 1, 4, 1, 89, 103))
rlRs232 = MibIdentifier((1, 3, 6, 1, 4, 1, 89, 104))
rlNicRedundancy = MibIdentifier((1, 3, 6, 1, 4, 1, 89, 105))
rlAmap = MibIdentifier((1, 3, 6, 1, 4, 1, 89, 106))
rlStack = MibIdentifier((1, 3, 6, 1, 4, 1, 89, 107))
rlPoe = MibIdentifier((1, 3, 6, 1, 4, 1, 89, 108))
rlUPnP = MibIdentifier((1, 3, 6, 1, 4, 1, 89, 109))
rlLldp = MibIdentifier((1, 3, 6, 1, 4, 1, 89, 110))
rlOib = MibIdentifier((1, 3, 6, 1, 4, 1, 89, 111))
rlBridgeSecurity = MibIdentifier((1, 3, 6, 1, 4, 1, 89, 112))
rlDhcpSpoofing = MibIdentifier((1, 3, 6, 1, 4, 1, 89, 113))
rlBonjour = MibIdentifier((1, 3, 6, 1, 4, 1, 89, 114))
rlLinksysSmartMIB = MibIdentifier((1, 3, 6, 1, 4, 1, 89, 115))
rlBrgMulticast = MibIdentifier((1, 3, 6, 1, 4, 1, 89, 116))
rlBrgMcMngr = MibIdentifier((1, 3, 6, 1, 4, 1, 89, 117))
rlGlobalIpAddrTable = MibIdentifier((1, 3, 6, 1, 4, 1, 89, 118))
dlPrivate = MibIdentifier((1, 3, 6, 1, 4, 1, 89, 119))
rlSecuritySuiteMib = MibIdentifier((1, 3, 6, 1, 4, 1, 89, 120))
rlIntel = MibIdentifier((1, 3, 6, 1, 4, 1, 89, 121))
rlTunnel = MibIdentifier((1, 3, 6, 1, 4, 1, 89, 122))
rlAutoUpdate = MibIdentifier((1, 3, 6, 1, 4, 1, 89, 123))
rlCpuCounters = MibIdentifier((1, 3, 6, 1, 4, 1, 89, 124))
rlLbd = MibIdentifier((1, 3, 6, 1, 4, 1, 89, 127))
rlErrdisableRecovery = MibIdentifier((1, 3, 6, 1, 4, 1, 89, 128))
rlIPv6 = MibIdentifier((1, 3, 6, 1, 4, 1, 89, 129))
rlActionAcl = MibIdentifier((1, 3, 6, 1, 4, 1, 89, 130))
rlSafeGuard = MibIdentifier((1, 3, 6, 1, 4, 1, 89, 131))
rlProtectedPorts = MibIdentifier((1, 3, 6, 1, 4, 1, 89, 132))
rlBanner = MibIdentifier((1, 3, 6, 1, 4, 1, 89, 133))
rlGreenEth = MibIdentifier((1, 3, 6, 1, 4, 1, 89, 134))
rlDlf = MibIdentifier((1, 3, 6, 1, 4, 1, 89, 135))
rlVlanTrunking = MibIdentifier((1, 3, 6, 1, 4, 1, 89, 136))
rlCdp = MibIdentifier((1, 3, 6, 1, 4, 1, 89, 137))
rlTrafficSeg = MibIdentifier((1, 3, 6, 1, 4, 1, 89, 138))
rlImpbFeatures = MibIdentifier((1, 3, 6, 1, 4, 1, 89, 139))
rlSmartPorts = MibIdentifier((1, 3, 6, 1, 4, 1, 89, 140))
rlStatistics = MibIdentifier((1, 3, 6, 1, 4, 1, 89, 141))
rlDeleteImg = MibIdentifier((1, 3, 6, 1, 4, 1, 89, 142))
rlCustom1BonjourService = MibIdentifier((1, 3, 6, 1, 4, 1, 89, 143))
rlSpecialBpdu = MibIdentifier((1, 3, 6, 1, 4, 1, 89, 144))
rlTBIMib = MibIdentifier((1, 3, 6, 1, 4, 1, 89, 145))
rlWeightedRandomTailDrop = MibIdentifier((1, 3, 6, 1, 4, 1, 89, 146))
rlsFlowMib = MibIdentifier((1, 3, 6, 1, 4, 1, 89, 147))
rlPfcMib = MibIdentifier((1, 3, 6, 1, 4, 1, 89, 148))
rlEee = MibIdentifier((1, 3, 6, 1, 4, 1, 89, 149))
rlEventsMib = MibIdentifier((1, 3, 6, 1, 4, 1, 89, 150))
rlWlanMIB = MibIdentifier((1, 3, 6, 1, 4, 1, 89, 200))
rlEtsMib = MibIdentifier((1, 3, 6, 1, 4, 1, 89, 201))
rlQcnMib = MibIdentifier((1, 3, 6, 1, 4, 1, 89, 202))
rlSctMib = MibIdentifier((1, 3, 6, 1, 4, 1, 89, 203))
rlSysmngMib = MibIdentifier((1, 3, 6, 1, 4, 1, 89, 204))
rlFip = MibIdentifier((1, 3, 6, 1, 4, 1, 89, 205))
rlDebugCapabilities = MibIdentifier((1, 3, 6, 1, 4, 1, 89, 206))
rlIpStdAcl = MibIdentifier((1, 3, 6, 1, 4, 1, 89, 207))
rlWBA = MibIdentifier((1, 3, 6, 1, 4, 1, 89, 208))
rlSecSd = MibIdentifier((1, 3, 6, 1, 4, 1, 89, 209))
rlOspf = MibIdentifier((1, 3, 6, 1, 4, 1, 89, 210))
rlRtRedist = MibIdentifier((1, 3, 6, 1, 4, 1, 89, 211))
rlIpPrefList = MibIdentifier((1, 3, 6, 1, 4, 1, 89, 212))
rlVoipSnoop = MibIdentifier((1, 3, 6, 1, 4, 1, 89, 213))
rlDhcpv6 = MibIdentifier((1, 3, 6, 1, 4, 1, 89, 214))
rlIpv6Fhs = MibIdentifier((1, 3, 6, 1, 4, 1, 89, 215))
rlInventoryEnt = MibIdentifier((1, 3, 6, 1, 4, 1, 89, 217))
rlUdld = MibIdentifier((1, 3, 6, 1, 4, 1, 89, 218))
rndEndOfMibGroup = MibIdentifier((1, 3, 6, 1, 4, 1, 89, 1000))
mibBuilder.exportSymbols("Dell-MIB", rlTBIMib=rlTBIMib, rlCDB=rlCDB, rndNotifications=rndNotifications, rlExperience=rlExperience, rlRCli=rlRCli, rlSecuritySuiteMib=rlSecuritySuiteMib, rlDhcpCl=rlDhcpCl, rlWeightedRandomTailDrop=rlWeightedRandomTailDrop, rlAgentsCapabilitiesGroups=rlAgentsCapabilitiesGroups, rlPolicy=rlPolicy, rlGvrp=rlGvrp, rlEtsMib=rlEtsMib, rl3sw2swTables=rl3sw2swTables, rlImpbFeatures=rlImpbFeatures, Percents=Percents, rlTunnel=rlTunnel, rlTrafficSeg=rlTrafficSeg, rlIfInterfaces=rlIfInterfaces, rlGreenEth=rlGreenEth, rlDhcpSpoofing=rlDhcpSpoofing, rlRs232=rlRs232, rlPoe=rlPoe, rlFip=rlFip, rlStormCtrl=rlStormCtrl, rlQosCliMib=rlQosCliMib, rlIpv6Fhs=rlIpv6Fhs, rlCli=rlCli, rlSNMP=rlSNMP, rlFile=rlFile, rlRmonControl=rlRmonControl, NetNumber=NetNumber, rlDigitalKeyManage=rlDigitalKeyManage, rlDhcpv6=rlDhcpv6, rlEmbWeb=rlEmbWeb, rndMng=rndMng, rlIPv6=rlIPv6, rlBgp=rlBgp, rlTimeSynchronization=rlTimeSynchronization, rlIpPrefList=rlIpPrefList, rlDot3adAgg=rlDot3adAgg, rlQcnMib=rlQcnMib, rlBroadcom=rlBroadcom, rlNicRedundancy=rlNicRedundancy, rlCopy=rlCopy, rlTelnet=rlTelnet, rlFFT=rlFFT, rlIpStdAcl=rlIpStdAcl, rlLinksysSmartMIB=rlLinksysSmartMIB, rlAAA=rlAAA, rlCpuCounters=rlCpuCounters, rlDebugCapabilities=rlDebugCapabilities, ipSpec=ipSpec, rsTunning=rsTunning, rlGmrp=rlGmrp, rlCustom1BonjourService=rlCustom1BonjourService, PYSNMP_MODULE_ID=rnd, rlUPnP=rlUPnP, rlVoipSnoop=rlVoipSnoop, rlSmon=rlSmon, rlBrgMacSwitch=rlBrgMacSwitch, rlSecSd=rlSecSd, rlSsl=rlSsl, rlSocket=rlSocket, rlLbd=rlLbd, rlBanner=rlBanner, rlPhysicalDescription=rlPhysicalDescription, rlBridgeSecurity=rlBridgeSecurity, rlEee=rlEee, rlLocalization=rlLocalization, rlSysmngMib=rlSysmngMib, rlRtRedist=rlRtRedist, VlanPriority=VlanPriority, rlAutoUpdate=rlAutoUpdate, rlsFlowMib=rlsFlowMib, rlTraceRoute=rlTraceRoute, rlWlanAccessPoint=rlWlanAccessPoint, rlPhy=rlPhy, dlPrivate=dlPrivate, rnd=rnd, rlBrgMcMngr=rlBrgMcMngr, rlAggregateVlan=rlAggregateVlan, rlAAAEap=rlAAAEap, rlJumboFrames=rlJumboFrames, rlMngInf=rlMngInf, rlSmartPorts=rlSmartPorts, vlan=vlan, rlEnv=rlEnv, rlBrgMulticast=rlBrgMulticast, rlCdp=rlCdp, swInterfaces=swInterfaces, rndEndOfMibGroup=rndEndOfMibGroup, rlSctMib=rlSctMib, rlOspf=rlOspf, rndDeviceParams=rndDeviceParams, rlIpMRouteStdMIB=rlIpMRouteStdMIB, rlGlobalIpAddrTable=rlGlobalIpAddrTable, rlMir=rlMir, rndApplications=rndApplications, rlStack=rlStack, rlProtectedPorts=rlProtectedPorts, rlWlanMIB=rlWlanMIB, rlAmap=rlAmap, rlInventoryEnt=rlInventoryEnt, rlPfcMib=rlPfcMib, rlDeleteImg=rlDeleteImg, rlMacMulticast=rlMacMulticast, rlSwPackageVersion=rlSwPackageVersion, rlMultiSessionTerminal=rlMultiSessionTerminal, rsUDP=rsUDP, rlDnsCl=rlDnsCl, rlSyslog=rlSyslog, rlVlanTrunking=rlVlanTrunking, rndBootP=rndBootP, rlOib=rlOib, rlIPmulticast=rlIPmulticast, rlSsh=rlSsh, rlBonjour=rlBonjour, rlActionAcl=rlActionAcl, rlDlf=rlDlf, rldot1x=rldot1x, rlRadius=rlRadius, rlStatistics=rlStatistics, rlpBridgeMIBObjects=rlpBridgeMIBObjects, rlErrdisableRecovery=rlErrdisableRecovery, rlWBA=rlWBA, rlLldp=rlLldp, rlSpecialBpdu=rlSpecialBpdu, rlGalileo=rlGalileo, rlMacBasePrio=rlMacBasePrio, rlIntel=rlIntel, rlUdld=rlUdld, rlArpSpoofing=rlArpSpoofing, rlSafeGuard=rlSafeGuard, rlEventsMib=rlEventsMib)
| (object_identifier, octet_string, integer) = mibBuilder.importSymbols('ASN1', 'ObjectIdentifier', 'OctetString', 'Integer')
(named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues')
(value_size_constraint, constraints_union, constraints_intersection, single_value_constraint, value_range_constraint) = mibBuilder.importSymbols('ASN1-REFINEMENT', 'ValueSizeConstraint', 'ConstraintsUnion', 'ConstraintsIntersection', 'SingleValueConstraint', 'ValueRangeConstraint')
(module_compliance, notification_group) = mibBuilder.importSymbols('SNMPv2-CONF', 'ModuleCompliance', 'NotificationGroup')
(bits, time_ticks, counter64, notification_type, object_identity, mib_scalar, mib_table, mib_table_row, mib_table_column, mib_identifier, iso, counter32, enterprises, module_identity, unsigned32, gauge32, ip_address, integer32) = mibBuilder.importSymbols('SNMPv2-SMI', 'Bits', 'TimeTicks', 'Counter64', 'NotificationType', 'ObjectIdentity', 'MibScalar', 'MibTable', 'MibTableRow', 'MibTableColumn', 'MibIdentifier', 'iso', 'Counter32', 'enterprises', 'ModuleIdentity', 'Unsigned32', 'Gauge32', 'IpAddress', 'Integer32')
(display_string, textual_convention) = mibBuilder.importSymbols('SNMPv2-TC', 'DisplayString', 'TextualConvention')
class Percents(Integer32):
subtype_spec = Integer32.subtypeSpec + value_range_constraint(0, 100)
class Netnumber(OctetString):
subtype_spec = OctetString.subtypeSpec + value_size_constraint(4, 4)
fixed_length = 4
class Vlanpriority(Integer32):
subtype_spec = Integer32.subtypeSpec + value_range_constraint(0, 7)
rnd = module_identity((1, 3, 6, 1, 4, 1, 89))
rnd.setRevisions(('2007-01-02 00:00',))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
if mibBuilder.loadTexts:
rnd.setRevisionsDescriptions(('Initial revision.',))
if mibBuilder.loadTexts:
rnd.setLastUpdated('200701020000Z')
if mibBuilder.loadTexts:
rnd.setOrganization('Dell')
if mibBuilder.loadTexts:
rnd.setContactInfo('www.dell.com')
if mibBuilder.loadTexts:
rnd.setDescription('This private MIB module defines Dell private MIBs.')
rnd_notifications = object_identity((1, 3, 6, 1, 4, 1, 89, 0))
if mibBuilder.loadTexts:
rndNotifications.setStatus('current')
if mibBuilder.loadTexts:
rndNotifications.setDescription(" All the rnd notifications will reside under this branch as specified in RFC2578 'Structure of Management Information Version 2 (SMIv2)' 8.5")
rnd_mng = mib_identifier((1, 3, 6, 1, 4, 1, 89, 1))
rnd_device_params = mib_identifier((1, 3, 6, 1, 4, 1, 89, 2))
rnd_boot_p = mib_identifier((1, 3, 6, 1, 4, 1, 89, 24))
ip_spec = mib_identifier((1, 3, 6, 1, 4, 1, 89, 26))
rs_tunning = mib_identifier((1, 3, 6, 1, 4, 1, 89, 29))
rnd_applications = mib_identifier((1, 3, 6, 1, 4, 1, 89, 35))
rs_udp = mib_identifier((1, 3, 6, 1, 4, 1, 89, 42))
sw_interfaces = mib_identifier((1, 3, 6, 1, 4, 1, 89, 43))
rl_i_pmulticast = mib_identifier((1, 3, 6, 1, 4, 1, 89, 46))
rl_fft = mib_identifier((1, 3, 6, 1, 4, 1, 89, 47))
vlan = mib_identifier((1, 3, 6, 1, 4, 1, 89, 48))
rl_rmon_control = mib_identifier((1, 3, 6, 1, 4, 1, 89, 49))
rl_brg_mac_switch = mib_identifier((1, 3, 6, 1, 4, 1, 89, 50))
rl_experience = mib_identifier((1, 3, 6, 1, 4, 1, 89, 51))
rl_cli = mib_identifier((1, 3, 6, 1, 4, 1, 89, 52))
rl_physical_description = mib_identifier((1, 3, 6, 1, 4, 1, 89, 53))
rl_if_interfaces = mib_identifier((1, 3, 6, 1, 4, 1, 89, 54))
rl_mac_multicast = mib_identifier((1, 3, 6, 1, 4, 1, 89, 55))
rl_galileo = mib_identifier((1, 3, 6, 1, 4, 1, 89, 56))
rlp_bridge_mib_objects = mib_identifier((1, 3, 6, 1, 4, 1, 89, 57))
rl_telnet = mib_identifier((1, 3, 6, 1, 4, 1, 89, 58))
rl_policy = mib_identifier((1, 3, 6, 1, 4, 1, 89, 59))
rl_arp_spoofing = mib_identifier((1, 3, 6, 1, 4, 1, 89, 60))
rl_mir = mib_identifier((1, 3, 6, 1, 4, 1, 89, 61))
rl_ip_m_route_std_mib = mib_identifier((1, 3, 6, 1, 4, 1, 89, 62))
rl3sw2sw_tables = mib_identifier((1, 3, 6, 1, 4, 1, 89, 63))
rl_gvrp = mib_identifier((1, 3, 6, 1, 4, 1, 89, 64))
rl_dot3ad_agg = mib_identifier((1, 3, 6, 1, 4, 1, 89, 65))
rl_emb_web = mib_identifier((1, 3, 6, 1, 4, 1, 89, 66))
rl_sw_package_version = mib_identifier((1, 3, 6, 1, 4, 1, 89, 67))
rl_broadcom = mib_identifier((1, 3, 6, 1, 4, 1, 89, 68))
rl_multi_session_terminal = mib_identifier((1, 3, 6, 1, 4, 1, 89, 69))
rl_r_cli = mib_identifier((1, 3, 6, 1, 4, 1, 89, 70))
rl_bgp = mib_identifier((1, 3, 6, 1, 4, 1, 89, 71))
rl_agents_capabilities_groups = mib_identifier((1, 3, 6, 1, 4, 1, 89, 72))
rl_aggregate_vlan = mib_identifier((1, 3, 6, 1, 4, 1, 89, 73))
rl_gmrp = mib_identifier((1, 3, 6, 1, 4, 1, 89, 75))
rl_dhcp_cl = mib_identifier((1, 3, 6, 1, 4, 1, 89, 76))
rl_storm_ctrl = mib_identifier((1, 3, 6, 1, 4, 1, 89, 77))
rl_ssh = mib_identifier((1, 3, 6, 1, 4, 1, 89, 78))
rl_aaa = mib_identifier((1, 3, 6, 1, 4, 1, 89, 79))
rl_radius = mib_identifier((1, 3, 6, 1, 4, 1, 89, 80))
rl_trace_route = mib_identifier((1, 3, 6, 1, 4, 1, 89, 81))
rl_syslog = mib_identifier((1, 3, 6, 1, 4, 1, 89, 82))
rl_env = mib_identifier((1, 3, 6, 1, 4, 1, 89, 83))
rl_smon = mib_identifier((1, 3, 6, 1, 4, 1, 89, 84))
rl_socket = mib_identifier((1, 3, 6, 1, 4, 1, 89, 85))
rl_digital_key_manage = mib_identifier((1, 3, 6, 1, 4, 1, 89, 86))
rl_copy = mib_identifier((1, 3, 6, 1, 4, 1, 89, 87))
rl_qos_cli_mib = mib_identifier((1, 3, 6, 1, 4, 1, 89, 88))
rl_mng_inf = mib_identifier((1, 3, 6, 1, 4, 1, 89, 89))
rl_phy = mib_identifier((1, 3, 6, 1, 4, 1, 89, 90))
rl_jumbo_frames = mib_identifier((1, 3, 6, 1, 4, 1, 89, 91))
rl_time_synchronization = mib_identifier((1, 3, 6, 1, 4, 1, 89, 92))
rl_dns_cl = mib_identifier((1, 3, 6, 1, 4, 1, 89, 93))
rl_cdb = mib_identifier((1, 3, 6, 1, 4, 1, 89, 94))
rldot1x = mib_identifier((1, 3, 6, 1, 4, 1, 89, 95))
rl_file = mib_identifier((1, 3, 6, 1, 4, 1, 89, 96))
rl_aaa_eap = mib_identifier((1, 3, 6, 1, 4, 1, 89, 97))
rl_snmp = mib_identifier((1, 3, 6, 1, 4, 1, 89, 98))
rl_ssl = mib_identifier((1, 3, 6, 1, 4, 1, 89, 100))
rl_mac_base_prio = mib_identifier((1, 3, 6, 1, 4, 1, 89, 101))
rl_wlan_access_point = mib_identifier((1, 3, 6, 1, 4, 1, 89, 102))
rl_localization = mib_identifier((1, 3, 6, 1, 4, 1, 89, 103))
rl_rs232 = mib_identifier((1, 3, 6, 1, 4, 1, 89, 104))
rl_nic_redundancy = mib_identifier((1, 3, 6, 1, 4, 1, 89, 105))
rl_amap = mib_identifier((1, 3, 6, 1, 4, 1, 89, 106))
rl_stack = mib_identifier((1, 3, 6, 1, 4, 1, 89, 107))
rl_poe = mib_identifier((1, 3, 6, 1, 4, 1, 89, 108))
rl_u_pn_p = mib_identifier((1, 3, 6, 1, 4, 1, 89, 109))
rl_lldp = mib_identifier((1, 3, 6, 1, 4, 1, 89, 110))
rl_oib = mib_identifier((1, 3, 6, 1, 4, 1, 89, 111))
rl_bridge_security = mib_identifier((1, 3, 6, 1, 4, 1, 89, 112))
rl_dhcp_spoofing = mib_identifier((1, 3, 6, 1, 4, 1, 89, 113))
rl_bonjour = mib_identifier((1, 3, 6, 1, 4, 1, 89, 114))
rl_linksys_smart_mib = mib_identifier((1, 3, 6, 1, 4, 1, 89, 115))
rl_brg_multicast = mib_identifier((1, 3, 6, 1, 4, 1, 89, 116))
rl_brg_mc_mngr = mib_identifier((1, 3, 6, 1, 4, 1, 89, 117))
rl_global_ip_addr_table = mib_identifier((1, 3, 6, 1, 4, 1, 89, 118))
dl_private = mib_identifier((1, 3, 6, 1, 4, 1, 89, 119))
rl_security_suite_mib = mib_identifier((1, 3, 6, 1, 4, 1, 89, 120))
rl_intel = mib_identifier((1, 3, 6, 1, 4, 1, 89, 121))
rl_tunnel = mib_identifier((1, 3, 6, 1, 4, 1, 89, 122))
rl_auto_update = mib_identifier((1, 3, 6, 1, 4, 1, 89, 123))
rl_cpu_counters = mib_identifier((1, 3, 6, 1, 4, 1, 89, 124))
rl_lbd = mib_identifier((1, 3, 6, 1, 4, 1, 89, 127))
rl_errdisable_recovery = mib_identifier((1, 3, 6, 1, 4, 1, 89, 128))
rl_i_pv6 = mib_identifier((1, 3, 6, 1, 4, 1, 89, 129))
rl_action_acl = mib_identifier((1, 3, 6, 1, 4, 1, 89, 130))
rl_safe_guard = mib_identifier((1, 3, 6, 1, 4, 1, 89, 131))
rl_protected_ports = mib_identifier((1, 3, 6, 1, 4, 1, 89, 132))
rl_banner = mib_identifier((1, 3, 6, 1, 4, 1, 89, 133))
rl_green_eth = mib_identifier((1, 3, 6, 1, 4, 1, 89, 134))
rl_dlf = mib_identifier((1, 3, 6, 1, 4, 1, 89, 135))
rl_vlan_trunking = mib_identifier((1, 3, 6, 1, 4, 1, 89, 136))
rl_cdp = mib_identifier((1, 3, 6, 1, 4, 1, 89, 137))
rl_traffic_seg = mib_identifier((1, 3, 6, 1, 4, 1, 89, 138))
rl_impb_features = mib_identifier((1, 3, 6, 1, 4, 1, 89, 139))
rl_smart_ports = mib_identifier((1, 3, 6, 1, 4, 1, 89, 140))
rl_statistics = mib_identifier((1, 3, 6, 1, 4, 1, 89, 141))
rl_delete_img = mib_identifier((1, 3, 6, 1, 4, 1, 89, 142))
rl_custom1_bonjour_service = mib_identifier((1, 3, 6, 1, 4, 1, 89, 143))
rl_special_bpdu = mib_identifier((1, 3, 6, 1, 4, 1, 89, 144))
rl_tbi_mib = mib_identifier((1, 3, 6, 1, 4, 1, 89, 145))
rl_weighted_random_tail_drop = mib_identifier((1, 3, 6, 1, 4, 1, 89, 146))
rls_flow_mib = mib_identifier((1, 3, 6, 1, 4, 1, 89, 147))
rl_pfc_mib = mib_identifier((1, 3, 6, 1, 4, 1, 89, 148))
rl_eee = mib_identifier((1, 3, 6, 1, 4, 1, 89, 149))
rl_events_mib = mib_identifier((1, 3, 6, 1, 4, 1, 89, 150))
rl_wlan_mib = mib_identifier((1, 3, 6, 1, 4, 1, 89, 200))
rl_ets_mib = mib_identifier((1, 3, 6, 1, 4, 1, 89, 201))
rl_qcn_mib = mib_identifier((1, 3, 6, 1, 4, 1, 89, 202))
rl_sct_mib = mib_identifier((1, 3, 6, 1, 4, 1, 89, 203))
rl_sysmng_mib = mib_identifier((1, 3, 6, 1, 4, 1, 89, 204))
rl_fip = mib_identifier((1, 3, 6, 1, 4, 1, 89, 205))
rl_debug_capabilities = mib_identifier((1, 3, 6, 1, 4, 1, 89, 206))
rl_ip_std_acl = mib_identifier((1, 3, 6, 1, 4, 1, 89, 207))
rl_wba = mib_identifier((1, 3, 6, 1, 4, 1, 89, 208))
rl_sec_sd = mib_identifier((1, 3, 6, 1, 4, 1, 89, 209))
rl_ospf = mib_identifier((1, 3, 6, 1, 4, 1, 89, 210))
rl_rt_redist = mib_identifier((1, 3, 6, 1, 4, 1, 89, 211))
rl_ip_pref_list = mib_identifier((1, 3, 6, 1, 4, 1, 89, 212))
rl_voip_snoop = mib_identifier((1, 3, 6, 1, 4, 1, 89, 213))
rl_dhcpv6 = mib_identifier((1, 3, 6, 1, 4, 1, 89, 214))
rl_ipv6_fhs = mib_identifier((1, 3, 6, 1, 4, 1, 89, 215))
rl_inventory_ent = mib_identifier((1, 3, 6, 1, 4, 1, 89, 217))
rl_udld = mib_identifier((1, 3, 6, 1, 4, 1, 89, 218))
rnd_end_of_mib_group = mib_identifier((1, 3, 6, 1, 4, 1, 89, 1000))
mibBuilder.exportSymbols('Dell-MIB', rlTBIMib=rlTBIMib, rlCDB=rlCDB, rndNotifications=rndNotifications, rlExperience=rlExperience, rlRCli=rlRCli, rlSecuritySuiteMib=rlSecuritySuiteMib, rlDhcpCl=rlDhcpCl, rlWeightedRandomTailDrop=rlWeightedRandomTailDrop, rlAgentsCapabilitiesGroups=rlAgentsCapabilitiesGroups, rlPolicy=rlPolicy, rlGvrp=rlGvrp, rlEtsMib=rlEtsMib, rl3sw2swTables=rl3sw2swTables, rlImpbFeatures=rlImpbFeatures, Percents=Percents, rlTunnel=rlTunnel, rlTrafficSeg=rlTrafficSeg, rlIfInterfaces=rlIfInterfaces, rlGreenEth=rlGreenEth, rlDhcpSpoofing=rlDhcpSpoofing, rlRs232=rlRs232, rlPoe=rlPoe, rlFip=rlFip, rlStormCtrl=rlStormCtrl, rlQosCliMib=rlQosCliMib, rlIpv6Fhs=rlIpv6Fhs, rlCli=rlCli, rlSNMP=rlSNMP, rlFile=rlFile, rlRmonControl=rlRmonControl, NetNumber=NetNumber, rlDigitalKeyManage=rlDigitalKeyManage, rlDhcpv6=rlDhcpv6, rlEmbWeb=rlEmbWeb, rndMng=rndMng, rlIPv6=rlIPv6, rlBgp=rlBgp, rlTimeSynchronization=rlTimeSynchronization, rlIpPrefList=rlIpPrefList, rlDot3adAgg=rlDot3adAgg, rlQcnMib=rlQcnMib, rlBroadcom=rlBroadcom, rlNicRedundancy=rlNicRedundancy, rlCopy=rlCopy, rlTelnet=rlTelnet, rlFFT=rlFFT, rlIpStdAcl=rlIpStdAcl, rlLinksysSmartMIB=rlLinksysSmartMIB, rlAAA=rlAAA, rlCpuCounters=rlCpuCounters, rlDebugCapabilities=rlDebugCapabilities, ipSpec=ipSpec, rsTunning=rsTunning, rlGmrp=rlGmrp, rlCustom1BonjourService=rlCustom1BonjourService, PYSNMP_MODULE_ID=rnd, rlUPnP=rlUPnP, rlVoipSnoop=rlVoipSnoop, rlSmon=rlSmon, rlBrgMacSwitch=rlBrgMacSwitch, rlSecSd=rlSecSd, rlSsl=rlSsl, rlSocket=rlSocket, rlLbd=rlLbd, rlBanner=rlBanner, rlPhysicalDescription=rlPhysicalDescription, rlBridgeSecurity=rlBridgeSecurity, rlEee=rlEee, rlLocalization=rlLocalization, rlSysmngMib=rlSysmngMib, rlRtRedist=rlRtRedist, VlanPriority=VlanPriority, rlAutoUpdate=rlAutoUpdate, rlsFlowMib=rlsFlowMib, rlTraceRoute=rlTraceRoute, rlWlanAccessPoint=rlWlanAccessPoint, rlPhy=rlPhy, dlPrivate=dlPrivate, rnd=rnd, rlBrgMcMngr=rlBrgMcMngr, rlAggregateVlan=rlAggregateVlan, rlAAAEap=rlAAAEap, rlJumboFrames=rlJumboFrames, rlMngInf=rlMngInf, rlSmartPorts=rlSmartPorts, vlan=vlan, rlEnv=rlEnv, rlBrgMulticast=rlBrgMulticast, rlCdp=rlCdp, swInterfaces=swInterfaces, rndEndOfMibGroup=rndEndOfMibGroup, rlSctMib=rlSctMib, rlOspf=rlOspf, rndDeviceParams=rndDeviceParams, rlIpMRouteStdMIB=rlIpMRouteStdMIB, rlGlobalIpAddrTable=rlGlobalIpAddrTable, rlMir=rlMir, rndApplications=rndApplications, rlStack=rlStack, rlProtectedPorts=rlProtectedPorts, rlWlanMIB=rlWlanMIB, rlAmap=rlAmap, rlInventoryEnt=rlInventoryEnt, rlPfcMib=rlPfcMib, rlDeleteImg=rlDeleteImg, rlMacMulticast=rlMacMulticast, rlSwPackageVersion=rlSwPackageVersion, rlMultiSessionTerminal=rlMultiSessionTerminal, rsUDP=rsUDP, rlDnsCl=rlDnsCl, rlSyslog=rlSyslog, rlVlanTrunking=rlVlanTrunking, rndBootP=rndBootP, rlOib=rlOib, rlIPmulticast=rlIPmulticast, rlSsh=rlSsh, rlBonjour=rlBonjour, rlActionAcl=rlActionAcl, rlDlf=rlDlf, rldot1x=rldot1x, rlRadius=rlRadius, rlStatistics=rlStatistics, rlpBridgeMIBObjects=rlpBridgeMIBObjects, rlErrdisableRecovery=rlErrdisableRecovery, rlWBA=rlWBA, rlLldp=rlLldp, rlSpecialBpdu=rlSpecialBpdu, rlGalileo=rlGalileo, rlMacBasePrio=rlMacBasePrio, rlIntel=rlIntel, rlUdld=rlUdld, rlArpSpoofing=rlArpSpoofing, rlSafeGuard=rlSafeGuard, rlEventsMib=rlEventsMib) |
description = 'setup for the cache server'
group = 'special'
devices = dict(
DB=device('nicos.services.cache.server.FlatfileCacheDatabase',
description='On disk storage for Cache Server',
storepath=configdata('config.DATA_PATH') + 'cache',
loglevel='info', ),
Server=device('nicos.services.cache.server.CacheServer',
db='DB',
server='',
loglevel='info',
),
)
| description = 'setup for the cache server'
group = 'special'
devices = dict(DB=device('nicos.services.cache.server.FlatfileCacheDatabase', description='On disk storage for Cache Server', storepath=configdata('config.DATA_PATH') + 'cache', loglevel='info'), Server=device('nicos.services.cache.server.CacheServer', db='DB', server='', loglevel='info')) |
# 1.5 Find One Missing Number from 1 to 10
def find_missing_number(list_numbers):
list_sum = 0
for number in list_numbers:
list_sum += number
return 55 - list_sum
| def find_missing_number(list_numbers):
list_sum = 0
for number in list_numbers:
list_sum += number
return 55 - list_sum |
## Prime number is divide by 1 and itself
## Display 50 prime numbers in 5 lines, each containing 10 numbers
NUMBER_OF_PRIMES = 50 # Number of primes to display
NUMBER_OF_PRIMES_PER_LINE = 10 # Display 10 per line
count = 0 # Count number of prime numbers
number = 2 # a number to test prime number
while count < NUMBER_OF_PRIMES:
## Check condition to see isPrime = True or False
## Once number % a divisor, isPrime = False immediately and break out of loop; then continue increase number (until number < 50) to check
## If number % a divisor != 0, continue increase divisor (until divisor <= number/2) to check. Until divisor <= number/2 finishes and not break, isPrime = True; and count increases. Then, then continue increase number (until number < 50) to check
isPrime = True
divisor = 2
while divisor <= number / 2:
if number % divisor == 0:
isPrime = False
break
divisor += 1
if isPrime:
count += 1
print(format(number, "2d"), end = ' ')
if count % NUMBER_OF_PRIMES_PER_LINE == 0:
print()
number += 1
| number_of_primes = 50
number_of_primes_per_line = 10
count = 0
number = 2
while count < NUMBER_OF_PRIMES:
is_prime = True
divisor = 2
while divisor <= number / 2:
if number % divisor == 0:
is_prime = False
break
divisor += 1
if isPrime:
count += 1
print(format(number, '2d'), end=' ')
if count % NUMBER_OF_PRIMES_PER_LINE == 0:
print()
number += 1 |
a =[72,73,75,84,85,87,104,105,107,116,117,119]
b =[97,98,99,100,101,102,103]
c =[97,98,99,100,101,103,106]
d =[65,72,74,75,77,79,90,97,104,106,107,109,111,122]
e =[66,67,78,79,84,85,88,89,98,99,110,111,116,117,120,121]
f =[104,105,106,107,108,109,110,111]
g =[112,113,114,117,118,119]
res = [bytearray([a1, b1, c1, d1, e1, f1, g1]) for a1 in a for b1 in b for c1 in c for d1 in d for e1 in e for f1 in f for g1 in g]
enc_bytes = bytearray([13,23,6,25,0,95,27,13,80,16,14,23,5,69,17,8,13,12,13,7,70,6,81,83,9,58,59,51,28,9,82,24,0,92,20,26])
def xor(data, key):
l = len(key)
decoded = bytearray()
for i in range(0, len(data)):
decoded.append(data[i]^key[i % l])
return decoded.decode("ascii")
for key in res:
ka = xor(enc_bytes,key)
if "n00bCTF"in ka:
print(ka)
break
| a = [72, 73, 75, 84, 85, 87, 104, 105, 107, 116, 117, 119]
b = [97, 98, 99, 100, 101, 102, 103]
c = [97, 98, 99, 100, 101, 103, 106]
d = [65, 72, 74, 75, 77, 79, 90, 97, 104, 106, 107, 109, 111, 122]
e = [66, 67, 78, 79, 84, 85, 88, 89, 98, 99, 110, 111, 116, 117, 120, 121]
f = [104, 105, 106, 107, 108, 109, 110, 111]
g = [112, 113, 114, 117, 118, 119]
res = [bytearray([a1, b1, c1, d1, e1, f1, g1]) for a1 in a for b1 in b for c1 in c for d1 in d for e1 in e for f1 in f for g1 in g]
enc_bytes = bytearray([13, 23, 6, 25, 0, 95, 27, 13, 80, 16, 14, 23, 5, 69, 17, 8, 13, 12, 13, 7, 70, 6, 81, 83, 9, 58, 59, 51, 28, 9, 82, 24, 0, 92, 20, 26])
def xor(data, key):
l = len(key)
decoded = bytearray()
for i in range(0, len(data)):
decoded.append(data[i] ^ key[i % l])
return decoded.decode('ascii')
for key in res:
ka = xor(enc_bytes, key)
if 'n00bCTF' in ka:
print(ka)
break |
class AttnDecoderRNN(nn.Module):
def __init__(self, dec_hidden_size, enc_hidden_size, dec_output_size, dropout_p=0):
super(AttnDecoderRNN, self).__init__()
self.hidden_size = dec_hidden_size
self.output_size = dec_output_size
self.dropout_p = dropout_p
self.lin_decoder = nn.Linear(dec_hidden_size, dec_hidden_size) # to convert input
self.lin_encoder = nn.Linear(enc_hidden_size, dec_hidden_size) # to convert encoder_outputs
self.linear_out = nn.Linear(dec_hidden_size + enc_hidden_size , dec_hidden_size, bias=False)
def forward(self, input, hidden, encoder_outputs):
# hidden not a tuple (htx, ctx) -> batch X dec_hid
# encoder_outputs -> batch X seq X enc_hid
# input -> batch x 1 X dec_hid
projected_context = F.tanh(self.lin_encoder(encoder_outputs)) # # batch X seq X enc_hid -> batch X seq X dec_hid
projected_input = F.tanh(self.lin_decoder(input)).unsqueeze(2) # batch X dec_hid X 1
# RAW ATTENTION
attn_dot = torch.bmm(projected_context, projected_input).squeeze(2) # batch X seq X 1 -> batch X seq
attn = F.softmax(attn_dot, dim=1) # NORMALIZED ATTENTION
reshaped_attn = attn.unsqueeze(1) # batch X 1 X seq
weighted_context = torch.bmm(reshaped_attn, encoder_outputs).squeeze(1) # batch X 1 X seq * batch X seq X enc_hid
# -> batch X 1 x enc_hid -> batch X enc_hid
h_tilde = torch.cat((weighted_context, hidden), 1) # -> batch X dec_hid+enc_hid
h_tilde = F.tanh(self.linear_out(h_tilde))
return h_tilde, attn
| class Attndecoderrnn(nn.Module):
def __init__(self, dec_hidden_size, enc_hidden_size, dec_output_size, dropout_p=0):
super(AttnDecoderRNN, self).__init__()
self.hidden_size = dec_hidden_size
self.output_size = dec_output_size
self.dropout_p = dropout_p
self.lin_decoder = nn.Linear(dec_hidden_size, dec_hidden_size)
self.lin_encoder = nn.Linear(enc_hidden_size, dec_hidden_size)
self.linear_out = nn.Linear(dec_hidden_size + enc_hidden_size, dec_hidden_size, bias=False)
def forward(self, input, hidden, encoder_outputs):
projected_context = F.tanh(self.lin_encoder(encoder_outputs))
projected_input = F.tanh(self.lin_decoder(input)).unsqueeze(2)
attn_dot = torch.bmm(projected_context, projected_input).squeeze(2)
attn = F.softmax(attn_dot, dim=1)
reshaped_attn = attn.unsqueeze(1)
weighted_context = torch.bmm(reshaped_attn, encoder_outputs).squeeze(1)
h_tilde = torch.cat((weighted_context, hidden), 1)
h_tilde = F.tanh(self.linear_out(h_tilde))
return (h_tilde, attn) |
_base_ = [
'../_base_/datasets/coco_detection.py',
'../_base_/schedules/schedule_1x.py', '../_base_/default_runtime.py'
]
model = dict(
type='FasterRCNN',
backbone=dict(
type='SwinTransformer',
embed_dims=128,
depths=[2, 2, 18, 2],
num_heads=[4, 8, 16, 32],
window_size=7,
mlp_ratio=4,
qkv_bias=True,
qk_scale=None,
drop_rate=0.,
attn_drop_rate=0.,
drop_path_rate=0.3,
patch_norm=True,
out_indices=(0, 1, 2, 3),
with_cp=True,
init_cfg=dict(type='Pretrained', checkpoint='https://download.openmmlab.com/mmclassification/v0/swin-transformer/convert/swin_base_patch4_window7_224_22kto1k-f967f799.pth')),
neck=dict(
type='FPN',
in_channels=[128, 256, 512, 1024],
out_channels=256,
num_outs=5),
rpn_head=dict(
type='GARPNHead',
in_channels=256,
feat_channels=256,
approx_anchor_generator=dict(
type='AnchorGenerator',
octave_base_scale=8,
scales_per_octave=3,
ratios=[0.5, 51.0, 2.0, 3.0, 4.0, 5.0],
strides=[4, 8, 16, 32, 64]),
square_anchor_generator=dict(
type='AnchorGenerator',
ratios=[1.0],
scales=[8],
strides=[4, 8, 16, 32, 64]),
anchor_coder=dict(
type='DeltaXYWHBBoxCoder',
target_means=[.0, .0, .0, .0],
target_stds=[0.07, 0.07, 0.14, 0.14]),
bbox_coder=dict(
type='DeltaXYWHBBoxCoder',
target_means=[.0, .0, .0, .0],
target_stds=[0.07, 0.07, 0.11, 0.11]),
loc_filter_thr=0.01,
loss_loc=dict(
type='FocalLoss',
use_sigmoid=True,
gamma=2.0,
alpha=0.25,
loss_weight=1.0),
loss_shape=dict(type='BoundedIoULoss', beta=0.2, loss_weight=1.0),
loss_cls=dict(type='CrossEntropyLoss', use_sigmoid=True, loss_weight=1.0),
loss_bbox=dict(type='SmoothL1Loss', beta=1.0, loss_weight=1.0)),
roi_head=dict(
type='StandardRoIHead',
bbox_roi_extractor=dict(
type='SingleRoIExtractor',
roi_layer=dict(type='RoIAlign', output_size=7, sampling_ratio=0),
out_channels=256,
featmap_strides=[4, 8, 16, 32]),
bbox_head=dict(
type='Shared2FCBBoxHead',
in_channels=256,
fc_out_channels=1024,
roi_feat_size=7,
num_classes=34,
bbox_coder=dict(
type='DeltaXYWHBBoxCoder',
target_means=[0., 0., 0., 0.],
target_stds=[0.05, 0.05, 0.1, 0.1]),
reg_class_agnostic=True,
loss_cls=dict(type='CrossEntropyLoss', use_sigmoid=False, loss_weight=1.0),
reg_decoded_bbox=True,
loss_bbox=dict(type='CIoULoss', loss_weight=12.0))),
# model training and testing settings
train_cfg=dict(
rpn=dict(
assigner=dict(
type='MaxIoUAssigner',
pos_iou_thr=0.7,
neg_iou_thr=0.3,
min_pos_iou=0.3,
match_low_quality=True,
ignore_iof_thr=-1),
sampler=dict(
type='RandomSampler',
num=256,
pos_fraction=0.5,
neg_pos_ub=-1,
add_gt_as_proposals=False),
ga_assigner=dict(
type='ApproxMaxIoUAssigner',
pos_iou_thr=0.7,
neg_iou_thr=0.3,
min_pos_iou=0.3,
ignore_iof_thr=-1),
ga_sampler=dict(
type='RandomSampler',
num=256,
pos_fraction=0.5,
neg_pos_ub=-1,
add_gt_as_proposals=False),
allowed_border=-1,
center_ratio=0.2,
ignore_ratio=0.5,
pos_weight=-1,
debug=False),
rpn_proposal=dict(
nms_pre=2000,
nms_post=1000,
max_per_img=300,
nms=dict(type='nms', iou_threshold=0.7),
min_bbox_size=0),
rcnn=dict(
assigner=dict(
type='MaxIoUAssigner',
pos_iou_thr=0.6,
neg_iou_thr=0.6,
min_pos_iou=0.6,
match_low_quality=False,
ignore_iof_thr=-1),
sampler=dict(
type='RandomSampler',
num=256,
pos_fraction=0.25,
neg_pos_ub=-1,
add_gt_as_proposals=True),
pos_weight=-1,
debug=False)),
test_cfg=dict(
rpn=dict(
nms_pre=1000,
nms_post=1000,
max_per_img=300,
nms=dict(type='nms', iou_threshold=0.7),
min_bbox_size=0),
rcnn=dict(
score_thr=0.05,
nms=dict(type='nms', iou_threshold=0.5),
max_per_img=100)))
# data setting
dataset_type = 'CocoDataset'
data_root = '/content/data/'
img_norm_cfg = dict(mean=[123.675, 116.28, 103.53], std=[58.395, 57.12, 57.375], to_rgb=True)
albu_train_transforms = [
dict(type='ShiftScaleRotate', shift_limit=0.0625, scale_limit=0, rotate_limit=0, interpolation=1, p=0.5, border_mode = 0),
dict(type='RandomBrightnessContrast', brightness_limit=0.1, contrast_limit=0.1),
dict(type='RGBShift', r_shift_limit=10, g_shift_limit=10, b_shift_limit=10),
dict(type='HueSaturationValue', hue_shift_limit=20, sat_shift_limit=30, val_shift_limit=20),
dict(type='ChannelShuffle'),
dict(
type='OneOf',
transforms=[
dict(type='Blur', blur_limit=3, p=1.0),
dict(type='MedianBlur', blur_limit=3, p=1.0)
],
p=0.1),
]
train_pipeline = [
dict(type='LoadImageFromFile', to_float32=True),
dict(type='LoadAnnotations', with_bbox=True),
dict(
type='RandomCrop',
crop_type='relative_range',
crop_size=(0.9, 0.9)),
dict(
type='Resize',
img_scale=[(640, 640), (800, 800)],
multiscale_mode='range',
keep_ratio=True),
dict(
type='CutOut',
n_holes=(5, 10),
cutout_shape=[(4, 4), (4, 8), (8, 4), (8, 8),
(16, 8), (8, 16), (16, 16), (16, 32), (32, 16), (32, 32),
(32, 48), (48, 32), (48, 48)]),
dict(type='RandomFlip', flip_ratio=0.5),
dict(
type='Albu',
transforms=albu_train_transforms,
bbox_params=dict(
type='BboxParams',
format='pascal_voc',
label_fields=['gt_labels'],
min_visibility=0.0,
filter_lost_elements=True),
keymap={
'img': 'image',
'gt_bboxes': 'bboxes'
},
update_pad_shape=False,
skip_img_without_anno=True),
dict(type='Pad', size_divisor=800),
dict(type='Normalize', **img_norm_cfg),
dict(type='DefaultFormatBundle'),
dict(type='Collect', keys=['img', 'gt_bboxes', 'gt_labels']),
]
test_pipeline = [
dict(type='LoadImageFromFile'),
dict(
type='MultiScaleFlipAug',
img_scale=(800, 800),
flip=False,
transforms=[
dict(type='Resize', keep_ratio=True),
dict(type='RandomFlip'),
dict(type='Normalize', **img_norm_cfg),
dict(type='Pad', size_divisor=32),
dict(type='DefaultFormatBundle'),
dict(type='Collect', keys=['img']),
])
]
data = dict(
samples_per_gpu=12,
workers_per_gpu=4,
train=dict(type = dataset_type,
ann_file = data_root + '/annotations/instances_train2017.json',
img_prefix = 'train_images/',
pipeline=train_pipeline),
val=dict(type = dataset_type,
ann_file = data_root + '/annotations/instances_val2017.json',
img_prefix = 'val_images/',
pipeline=test_pipeline,
samples_per_gpu = 24),
test=dict(pipeline=test_pipeline))
# optimizer
optimizer = dict(
_delete_ = True,
type='AdamW',
lr=0.0001,
betas=(0.9, 0.999),
weight_decay=0.05,
paramwise_cfg=dict(
custom_keys={
'absolute_pos_embed': dict(decay_mult=0.),
'relative_position_bias_table': dict(decay_mult=0.),
'norm': dict(decay_mult=0.)}))
optimizer_config = dict(grad_clip=None)
log_config = dict(interval = 10)
# learning policy
lr_config = dict(
_delete_ = True,
policy='CosineAnnealing',
min_lr_ratio = 0.12,
warmup='linear',
warmup_iters=500,
warmup_ratio=1.0 / 3,
)
runner = dict(type='IterBasedRunner', max_iters=10000, max_epochs = None)
checkpoint_config = dict(interval = 100)
evaluation = dict(interval = 100, metric = 'bbox')
fp16 = dict(loss_scale = 512.)
# runtime
load_from = None
resume_from = None
workflow = [('train', 1)] | _base_ = ['../_base_/datasets/coco_detection.py', '../_base_/schedules/schedule_1x.py', '../_base_/default_runtime.py']
model = dict(type='FasterRCNN', backbone=dict(type='SwinTransformer', embed_dims=128, depths=[2, 2, 18, 2], num_heads=[4, 8, 16, 32], window_size=7, mlp_ratio=4, qkv_bias=True, qk_scale=None, drop_rate=0.0, attn_drop_rate=0.0, drop_path_rate=0.3, patch_norm=True, out_indices=(0, 1, 2, 3), with_cp=True, init_cfg=dict(type='Pretrained', checkpoint='https://download.openmmlab.com/mmclassification/v0/swin-transformer/convert/swin_base_patch4_window7_224_22kto1k-f967f799.pth')), neck=dict(type='FPN', in_channels=[128, 256, 512, 1024], out_channels=256, num_outs=5), rpn_head=dict(type='GARPNHead', in_channels=256, feat_channels=256, approx_anchor_generator=dict(type='AnchorGenerator', octave_base_scale=8, scales_per_octave=3, ratios=[0.5, 51.0, 2.0, 3.0, 4.0, 5.0], strides=[4, 8, 16, 32, 64]), square_anchor_generator=dict(type='AnchorGenerator', ratios=[1.0], scales=[8], strides=[4, 8, 16, 32, 64]), anchor_coder=dict(type='DeltaXYWHBBoxCoder', target_means=[0.0, 0.0, 0.0, 0.0], target_stds=[0.07, 0.07, 0.14, 0.14]), bbox_coder=dict(type='DeltaXYWHBBoxCoder', target_means=[0.0, 0.0, 0.0, 0.0], target_stds=[0.07, 0.07, 0.11, 0.11]), loc_filter_thr=0.01, loss_loc=dict(type='FocalLoss', use_sigmoid=True, gamma=2.0, alpha=0.25, loss_weight=1.0), loss_shape=dict(type='BoundedIoULoss', beta=0.2, loss_weight=1.0), loss_cls=dict(type='CrossEntropyLoss', use_sigmoid=True, loss_weight=1.0), loss_bbox=dict(type='SmoothL1Loss', beta=1.0, loss_weight=1.0)), roi_head=dict(type='StandardRoIHead', bbox_roi_extractor=dict(type='SingleRoIExtractor', roi_layer=dict(type='RoIAlign', output_size=7, sampling_ratio=0), out_channels=256, featmap_strides=[4, 8, 16, 32]), bbox_head=dict(type='Shared2FCBBoxHead', in_channels=256, fc_out_channels=1024, roi_feat_size=7, num_classes=34, bbox_coder=dict(type='DeltaXYWHBBoxCoder', target_means=[0.0, 0.0, 0.0, 0.0], target_stds=[0.05, 0.05, 0.1, 0.1]), reg_class_agnostic=True, loss_cls=dict(type='CrossEntropyLoss', use_sigmoid=False, loss_weight=1.0), reg_decoded_bbox=True, loss_bbox=dict(type='CIoULoss', loss_weight=12.0))), train_cfg=dict(rpn=dict(assigner=dict(type='MaxIoUAssigner', pos_iou_thr=0.7, neg_iou_thr=0.3, min_pos_iou=0.3, match_low_quality=True, ignore_iof_thr=-1), sampler=dict(type='RandomSampler', num=256, pos_fraction=0.5, neg_pos_ub=-1, add_gt_as_proposals=False), ga_assigner=dict(type='ApproxMaxIoUAssigner', pos_iou_thr=0.7, neg_iou_thr=0.3, min_pos_iou=0.3, ignore_iof_thr=-1), ga_sampler=dict(type='RandomSampler', num=256, pos_fraction=0.5, neg_pos_ub=-1, add_gt_as_proposals=False), allowed_border=-1, center_ratio=0.2, ignore_ratio=0.5, pos_weight=-1, debug=False), rpn_proposal=dict(nms_pre=2000, nms_post=1000, max_per_img=300, nms=dict(type='nms', iou_threshold=0.7), min_bbox_size=0), rcnn=dict(assigner=dict(type='MaxIoUAssigner', pos_iou_thr=0.6, neg_iou_thr=0.6, min_pos_iou=0.6, match_low_quality=False, ignore_iof_thr=-1), sampler=dict(type='RandomSampler', num=256, pos_fraction=0.25, neg_pos_ub=-1, add_gt_as_proposals=True), pos_weight=-1, debug=False)), test_cfg=dict(rpn=dict(nms_pre=1000, nms_post=1000, max_per_img=300, nms=dict(type='nms', iou_threshold=0.7), min_bbox_size=0), rcnn=dict(score_thr=0.05, nms=dict(type='nms', iou_threshold=0.5), max_per_img=100)))
dataset_type = 'CocoDataset'
data_root = '/content/data/'
img_norm_cfg = dict(mean=[123.675, 116.28, 103.53], std=[58.395, 57.12, 57.375], to_rgb=True)
albu_train_transforms = [dict(type='ShiftScaleRotate', shift_limit=0.0625, scale_limit=0, rotate_limit=0, interpolation=1, p=0.5, border_mode=0), dict(type='RandomBrightnessContrast', brightness_limit=0.1, contrast_limit=0.1), dict(type='RGBShift', r_shift_limit=10, g_shift_limit=10, b_shift_limit=10), dict(type='HueSaturationValue', hue_shift_limit=20, sat_shift_limit=30, val_shift_limit=20), dict(type='ChannelShuffle'), dict(type='OneOf', transforms=[dict(type='Blur', blur_limit=3, p=1.0), dict(type='MedianBlur', blur_limit=3, p=1.0)], p=0.1)]
train_pipeline = [dict(type='LoadImageFromFile', to_float32=True), dict(type='LoadAnnotations', with_bbox=True), dict(type='RandomCrop', crop_type='relative_range', crop_size=(0.9, 0.9)), dict(type='Resize', img_scale=[(640, 640), (800, 800)], multiscale_mode='range', keep_ratio=True), dict(type='CutOut', n_holes=(5, 10), cutout_shape=[(4, 4), (4, 8), (8, 4), (8, 8), (16, 8), (8, 16), (16, 16), (16, 32), (32, 16), (32, 32), (32, 48), (48, 32), (48, 48)]), dict(type='RandomFlip', flip_ratio=0.5), dict(type='Albu', transforms=albu_train_transforms, bbox_params=dict(type='BboxParams', format='pascal_voc', label_fields=['gt_labels'], min_visibility=0.0, filter_lost_elements=True), keymap={'img': 'image', 'gt_bboxes': 'bboxes'}, update_pad_shape=False, skip_img_without_anno=True), dict(type='Pad', size_divisor=800), dict(type='Normalize', **img_norm_cfg), dict(type='DefaultFormatBundle'), dict(type='Collect', keys=['img', 'gt_bboxes', 'gt_labels'])]
test_pipeline = [dict(type='LoadImageFromFile'), dict(type='MultiScaleFlipAug', img_scale=(800, 800), flip=False, transforms=[dict(type='Resize', keep_ratio=True), dict(type='RandomFlip'), dict(type='Normalize', **img_norm_cfg), dict(type='Pad', size_divisor=32), dict(type='DefaultFormatBundle'), dict(type='Collect', keys=['img'])])]
data = dict(samples_per_gpu=12, workers_per_gpu=4, train=dict(type=dataset_type, ann_file=data_root + '/annotations/instances_train2017.json', img_prefix='train_images/', pipeline=train_pipeline), val=dict(type=dataset_type, ann_file=data_root + '/annotations/instances_val2017.json', img_prefix='val_images/', pipeline=test_pipeline, samples_per_gpu=24), test=dict(pipeline=test_pipeline))
optimizer = dict(_delete_=True, type='AdamW', lr=0.0001, betas=(0.9, 0.999), weight_decay=0.05, paramwise_cfg=dict(custom_keys={'absolute_pos_embed': dict(decay_mult=0.0), 'relative_position_bias_table': dict(decay_mult=0.0), 'norm': dict(decay_mult=0.0)}))
optimizer_config = dict(grad_clip=None)
log_config = dict(interval=10)
lr_config = dict(_delete_=True, policy='CosineAnnealing', min_lr_ratio=0.12, warmup='linear', warmup_iters=500, warmup_ratio=1.0 / 3)
runner = dict(type='IterBasedRunner', max_iters=10000, max_epochs=None)
checkpoint_config = dict(interval=100)
evaluation = dict(interval=100, metric='bbox')
fp16 = dict(loss_scale=512.0)
load_from = None
resume_from = None
workflow = [('train', 1)] |
#!/usr/bin/env python3
# '+=' for variables, this operator adds a value to,
# then sets variable name to new value.
# this formula shortcut can be used with any
# mathmatical operator.
# string example
y = 'one'
y += 'two' # adding to and equaling
print(y)
# int example
x = 1 # x has value of one
x += 2 # same as x = x+2, now x = 3
print(x)
| y = 'one'
y += 'two'
print(y)
x = 1
x += 2
print(x) |
def execute(fn, *args):
return fn(*args)
def say_hello(name, my_name):
print(f"Hello, {name}, I am {my_name}")
def say_bye(name):
print(f"Bye, {name}")
execute(say_hello, "Peter", "George")
execute(say_bye, "Peter")
| def execute(fn, *args):
return fn(*args)
def say_hello(name, my_name):
print(f'Hello, {name}, I am {my_name}')
def say_bye(name):
print(f'Bye, {name}')
execute(say_hello, 'Peter', 'George')
execute(say_bye, 'Peter') |
#Write a function that finds if a given string argument is Palindrome. A Palindrome string is equal to its reverse, that is its reading is the same backward as forward.
#For example: efe, hannah, ava, anna are palindromes.
#Test your function with above examples and test with at least 3 different
# non-Palindrome examples. nixon, example, xxxzz
#You may use string functions in this function.
def check_palindrome(str_to_test):
reverse_str = str_to_test[::-1]
if reverse_str == str_to_test:
print(f"{str_to_test} is a palindrome")
else:
print(f"{str_to_test} is NOT a palindrome")
check_palindrome("efe")
check_palindrome("hannah")
check_palindrome("ava")
check_palindrome("anna")
check_palindrome("nixon")
check_palindrome( "example")
check_palindrome( "xxxzz")
check_palindrome("xxxzzxxx")
| def check_palindrome(str_to_test):
reverse_str = str_to_test[::-1]
if reverse_str == str_to_test:
print(f'{str_to_test} is a palindrome')
else:
print(f'{str_to_test} is NOT a palindrome')
check_palindrome('efe')
check_palindrome('hannah')
check_palindrome('ava')
check_palindrome('anna')
check_palindrome('nixon')
check_palindrome('example')
check_palindrome('xxxzz')
check_palindrome('xxxzzxxx') |
c_keyword_set = {
'auto',
'break',
'case',
'char',
'const',
'continue',
'default',
'define',
'do',
'double',
'elif',
'else',
'endif',
'enum',
'error',
'extern',
'float',
'for',
'goto',
'if',
'ifdef',
'ifndef',
'include',
'inline',
'int',
'line',
'long',
'noalias',
'pragma',
'register',
'restrict',
'return',
'short',
'signed',
'sizeof',
'static',
'struct',
'switch',
'typedef',
'undef',
'union',
'unsigned',
'void',
'volatile',
'while'
} | c_keyword_set = {'auto', 'break', 'case', 'char', 'const', 'continue', 'default', 'define', 'do', 'double', 'elif', 'else', 'endif', 'enum', 'error', 'extern', 'float', 'for', 'goto', 'if', 'ifdef', 'ifndef', 'include', 'inline', 'int', 'line', 'long', 'noalias', 'pragma', 'register', 'restrict', 'return', 'short', 'signed', 'sizeof', 'static', 'struct', 'switch', 'typedef', 'undef', 'union', 'unsigned', 'void', 'volatile', 'while'} |
__version_tuple__ = (0, 6, 0, 'alpha.5')
__version__ = '0.6.0-alpha.5'
__version_tuple_js__ = (0, 6, 0, 'alpha.4')
__version_js__ = '0.6.0-alpha.4'
# kept for embedding in offline mode, we don't care about the patch version since it should be compatible
__version_threejs__ = '0.97'
| __version_tuple__ = (0, 6, 0, 'alpha.5')
__version__ = '0.6.0-alpha.5'
__version_tuple_js__ = (0, 6, 0, 'alpha.4')
__version_js__ = '0.6.0-alpha.4'
__version_threejs__ = '0.97' |
def read():
for dx in [1, 3, 5, 7]:
x = 0
tree = 0
with open('input.txt') as fh:
first_line = True
for line in fh.readlines():
if first_line:
first_line = False
continue
x = (x + dx) % len(line.strip())
if line[x] == '#':
tree += 1
print(dx, tree)
def read_dy2():
for dx in [1]:
x = 0
tree = 0
with open('input.txt') as fh:
first_line = True
i = 0
for line in fh.readlines():
if first_line:
first_line = False
continue
i += 1
x = (x + dx) % len(line.strip())
if i % 2 == 1:
# "going down 2"
continue
if line[x] == '#':
tree += 1
print("for dy=2")
print(dx, tree)
if __name__ == '__main__':
read()
read_dy2()
print(62*184*80*74*36) | def read():
for dx in [1, 3, 5, 7]:
x = 0
tree = 0
with open('input.txt') as fh:
first_line = True
for line in fh.readlines():
if first_line:
first_line = False
continue
x = (x + dx) % len(line.strip())
if line[x] == '#':
tree += 1
print(dx, tree)
def read_dy2():
for dx in [1]:
x = 0
tree = 0
with open('input.txt') as fh:
first_line = True
i = 0
for line in fh.readlines():
if first_line:
first_line = False
continue
i += 1
x = (x + dx) % len(line.strip())
if i % 2 == 1:
continue
if line[x] == '#':
tree += 1
print('for dy=2')
print(dx, tree)
if __name__ == '__main__':
read()
read_dy2()
print(62 * 184 * 80 * 74 * 36) |
class Solution:
def dfs(self, s):
if(s == len(self.graph) - 1):
self.path.append(len(self.graph)-1)
self.res.append(self.path[::])
self.path.pop()
return;
self.path.append(s)
for i in range(len(self.graph[s])):
self.dfs(self.graph[s][i])
self.path.pop()
def allPathsSourceTarget(self, graph: List[List[int]]) -> List[List[int]]:
self.res = []
self.graph = graph
self.path = []
self.dfs(0)
return self.res
| class Solution:
def dfs(self, s):
if s == len(self.graph) - 1:
self.path.append(len(self.graph) - 1)
self.res.append(self.path[:])
self.path.pop()
return
self.path.append(s)
for i in range(len(self.graph[s])):
self.dfs(self.graph[s][i])
self.path.pop()
def all_paths_source_target(self, graph: List[List[int]]) -> List[List[int]]:
self.res = []
self.graph = graph
self.path = []
self.dfs(0)
return self.res |
#!/usr/bin/env python3
for _ in range(int(input())):
input() # don't need n
try:
print(input().index('1') // 2)
except ValueError:
print(-1)
| for _ in range(int(input())):
input()
try:
print(input().index('1') // 2)
except ValueError:
print(-1) |
def assignments_yield_islice(n_clubs: int) -> Iterator[set]:
# This is almost but not quite accurate
# It's about 15% faster than non-islice, but I can't get the combinators to roll over right
n_block_1 = n_clubs // 3 + ((n_clubs % 3) > 0)
n_block_2 = n_clubs // 3 + ((n_clubs % 3) > 1)
n1 = n_assignments(n_clubs, True)
c2 = C(n_clubs - n_block_1, n_block_2) - ((n_clubs % 3) > 1)
def _get_runs() -> Iterator[tuple]:
if (n_clubs % 3) < 2:
r = (n_clubs // 3) - 1
n = (2 * r) + 1
step = C(n, r)
limit = n_assignments(n_clubs, True)
if not (n_clubs % 3):
limit //= 3
for i in range(0, limit, step * 2):
yield [i + 1, i + step]
else:
# all good run
i = n_assignments(n_clubs - 1, True)
yield [1, i]
i += 1
p_r = n_clubs // 3
p_n = 2 * p_r
dupes = C(p_n, p_r)
goods = C(p_n, p_r + 1)
s_r = n_clubs // 3
s_n = 3 * s_r
sub_runs = C(s_n, s_r)
for _ in range(n_clubs // 3):
# print(f'Now to do {sub_runs} runs of {dupes} dupes to {goods} goods')
# length x period
for __ in range(sub_runs):
i += dupes + goods
yield [i - goods, i - 1]
p_r -= 1
p_n -= 1
change = C(p_n, p_r)
dupes += change
goods -= change
s_n -= 1
sub_runs = C(s_n, s_r)
# rest is all dupes
# for block_1 in combinations(choices, n_block_1):
# rest_2 = choices.difference(block_1)
# for block_2 in combinations(rest_2, n_block_2):
# yield block_1, block_2, rest_2.difference(block_2)
# print('\n\n')
def _advance(i: int, gen: Generator, tab: int=0) -> tuple:
tab_ = ' ' * tab
if i < run[0]:
print(f'{tab_}skip from {i} to {run[0]}')
skip = run[0] - i
return True, skip, islice(gen, skip, None)
elif i <= run[1]:
return True, 0, gen
else:
try:
run[0], run[1] = next(runs)
print(f'{tab_}skip from {i} to {run[0]}')
skip = run[0] - i
return True, skip, islice(gen, skip, None)
except:
return False, None, None
# choices = set(range(n_clubs))
choices = set(CHARSET[:n_clubs]) # TODO temp
runs = _get_runs()
# First run
run = next(runs)
# Get blocks 1 generator
combs_1 = combinations(choices, n_block_1)
i = 1
# Outer block until i is at n_assignments (naive version)
while i <= n1:
print(f'block 1 i: {i}')
# Get next block 1
block_1 = next(combs_1)
print(f'c1 advanced: {block_1}')
# Separate remainder
rest_2 = choices.difference(block_1)
# Get blocks 2 generator
combs_2 = combinations(rest_2, n_block_2)
go_on, skip, combs_2 = _advance(i, combs_2, 1)
if not go_on:
return
i += skip
# Inner block until at most all combinations of rest are tried
n2 = i + c2
while i < n2:
print(f' block 2 i: {i}')
block_2 = next(combs_2)
print(f' c2 advanced: {block_2}')
yield block_1, block_2, rest_2.difference(block_2)
i += 1
print(f' i incremented to {i}')
go_on, skip, combs_2 = _advance(i, combs_2, 1)
if not go_on:
return
i += skip
go_on, skip, combs_1 = _advance(i, combs_1)
if not go_on:
return
i += skip | def assignments_yield_islice(n_clubs: int) -> Iterator[set]:
n_block_1 = n_clubs // 3 + (n_clubs % 3 > 0)
n_block_2 = n_clubs // 3 + (n_clubs % 3 > 1)
n1 = n_assignments(n_clubs, True)
c2 = c(n_clubs - n_block_1, n_block_2) - (n_clubs % 3 > 1)
def _get_runs() -> Iterator[tuple]:
if n_clubs % 3 < 2:
r = n_clubs // 3 - 1
n = 2 * r + 1
step = c(n, r)
limit = n_assignments(n_clubs, True)
if not n_clubs % 3:
limit //= 3
for i in range(0, limit, step * 2):
yield [i + 1, i + step]
else:
i = n_assignments(n_clubs - 1, True)
yield [1, i]
i += 1
p_r = n_clubs // 3
p_n = 2 * p_r
dupes = c(p_n, p_r)
goods = c(p_n, p_r + 1)
s_r = n_clubs // 3
s_n = 3 * s_r
sub_runs = c(s_n, s_r)
for _ in range(n_clubs // 3):
for __ in range(sub_runs):
i += dupes + goods
yield [i - goods, i - 1]
p_r -= 1
p_n -= 1
change = c(p_n, p_r)
dupes += change
goods -= change
s_n -= 1
sub_runs = c(s_n, s_r)
def _advance(i: int, gen: Generator, tab: int=0) -> tuple:
tab_ = ' ' * tab
if i < run[0]:
print(f'{tab_}skip from {i} to {run[0]}')
skip = run[0] - i
return (True, skip, islice(gen, skip, None))
elif i <= run[1]:
return (True, 0, gen)
else:
try:
(run[0], run[1]) = next(runs)
print(f'{tab_}skip from {i} to {run[0]}')
skip = run[0] - i
return (True, skip, islice(gen, skip, None))
except:
return (False, None, None)
choices = set(CHARSET[:n_clubs])
runs = _get_runs()
run = next(runs)
combs_1 = combinations(choices, n_block_1)
i = 1
while i <= n1:
print(f'block 1 i: {i}')
block_1 = next(combs_1)
print(f'c1 advanced: {block_1}')
rest_2 = choices.difference(block_1)
combs_2 = combinations(rest_2, n_block_2)
(go_on, skip, combs_2) = _advance(i, combs_2, 1)
if not go_on:
return
i += skip
n2 = i + c2
while i < n2:
print(f' block 2 i: {i}')
block_2 = next(combs_2)
print(f' c2 advanced: {block_2}')
yield (block_1, block_2, rest_2.difference(block_2))
i += 1
print(f' i incremented to {i}')
(go_on, skip, combs_2) = _advance(i, combs_2, 1)
if not go_on:
return
i += skip
(go_on, skip, combs_1) = _advance(i, combs_1)
if not go_on:
return
i += skip |
def reverse_vowel(s):
vowels = "AEIOUaeiou"
i, j = 0, len(s)-1
s = list(s)
while i < j:
while i < j and s[i] not in vowels:
i += 1
while i < j and s[j] not in vowels:
j -= 1
s[i], s[j] = s[j], s[i]
i, j = i + 1, j - 1
return "".join(s)
| def reverse_vowel(s):
vowels = 'AEIOUaeiou'
(i, j) = (0, len(s) - 1)
s = list(s)
while i < j:
while i < j and s[i] not in vowels:
i += 1
while i < j and s[j] not in vowels:
j -= 1
(s[i], s[j]) = (s[j], s[i])
(i, j) = (i + 1, j - 1)
return ''.join(s) |
ips = ["127.0.0.1", "255.0.0.1", "137.44.1.20", "48.8.9.72", ".".join(str(x) for x in range(256))]
z_a = ord("z") - ord("a") # apparently I find it hard to remember az is 26 letters
for ip in ips:
sip = []
for byte in ip.split("."):
b, s = int(byte), []
if b < ord("a"):
b += ord("a")
if b > ord("z"):
s.append("Z")
b -= z_a
if b > ord("z"):
z, b = divmod(b, z_a)
s.append(str(z))
s.append(chr(b + ord("a")))
else:
s.append(chr(b))
else:
s.append(chr(b).upper())
sip.append("".join(s))
elif b > ord("z"):
z, b = divmod(b, z_a)
s.append(str(z))
s.append(chr(b + ord("a")))
sip.append("".join(s))
else:
sip.append(chr(b))
print(ip, "=", ".".join(sip))
table = {0: 'A', 1: 'B', 2: 'C', 3: 'D', 4: 'E', 5: 'F', 6: 'G', 7: 'H',
8: 'I', 9: 'J', 10: 'K', 11: 'L', 12: 'M', 13: 'N', 14: 'O', 15: 'P',
16: 'Q', 17: 'R', 18: 'S', 19: 'T', 20: 'U', 21: 'V', 22: 'W', 23: 'X',
24: 'Y', 25: 'Z', 26: 'Zb', 27: 'Zc', 28: 'Zd', 29: 'Ze', 30: 'Zf', 31: 'Zg',
32: 'Zh', 33: 'Zi', 34: 'Zj', 35: 'Zk', 36: 'Zl', 37: 'Zm', 38: 'Zn', 39: 'Zo',
40: 'Zp', 41: 'Zq', 42: 'Zr', 43: 'Zs', 44: 'Zt', 45: 'Zu', 46: 'Zv', 47: 'Zw',
48: 'Zx', 49: 'Zy', 50: 'Zz', 51: 'Z4x', 52: 'Z4y', 53: 'Z5a', 54: 'Z5b', 55: 'Z5c',
56: 'Z5d', 57: 'Z5e', 58: 'Z5f', 59: 'Z5g', 60: 'Z5h', 61: 'Z5i', 62: 'Z5j', 63: 'Z5k',
64: 'Z5l', 65: 'Z5m', 66: 'Z5n', 67: 'Z5o', 68: 'Z5p', 69: 'Z5q', 70: 'Z5r', 71: 'Z5s',
72: 'Z5t', 73: 'Z5u', 74: 'Z5v', 75: 'Z5w', 76: 'Z5x', 77: 'Z5y', 78: 'Z6a', 79: 'Z6b',
80: 'Z6c', 81: 'Z6d', 82: 'Z6e', 83: 'Z6f', 84: 'Z6g', 85: 'Z6h', 86: 'Z6i', 87: 'Z6j',
88: 'Z6k', 89: 'Z6l', 90: 'Z6m', 91: 'Z6n', 92: 'Z6o', 93: 'Z6p', 94: 'Z6q', 95: 'Z6r',
96: 'Z6s', 97: 'a', 98: 'b', 99: 'c', 100: 'd', 101: 'e', 102: 'f', 103: 'g',
104: 'h', 105: 'i', 106: 'j', 107: 'k', 108: 'l', 109: 'm', 110: 'n', 111: 'o',
112: 'p', 113: 'q', 114: 'r', 115: 's', 116: 't', 117: 'u', 118: 'v', 119: 'w',
120: 'x', 121: 'y', 122: 'z', 123: '4x', 124: '4y', 125: '5a', 126: '5b', 127: '5c',
128: '5d', 129: '5e', 130: '5f', 131: '5g', 132: '5h', 133: '5i', 134: '5j', 135: '5k',
136: '5l', 137: '5m', 138: '5n', 139: '5o', 140: '5p', 141: '5q', 142: '5r', 143: '5s',
144: '5t', 145: '5u', 146: '5v', 147: '5w', 148: '5x', 149: '5y', 150: '6a', 151: '6b',
152: '6c', 153: '6d', 154: '6e', 155: '6f', 156: '6g', 157: '6h', 158: '6i', 159: '6j',
160: '6k', 161: '6l', 162: '6m', 163: '6n', 164: '6o', 165: '6p', 166: '6q', 167: '6r',
168: '6s', 169: '6t', 170: '6u', 171: '6v', 172: '6w', 173: '6x', 174: '6y', 175: '7a',
176: '7b', 177: '7c', 178: '7d', 179: '7e', 180: '7f', 181: '7g', 182: '7h', 183: '7i',
184: '7j', 185: '7k', 186: '7l', 187: '7m', 188: '7n', 189: '7o', 190: '7p', 191: '7q',
192: '7r', 193: '7s', 194: '7t', 195: '7u', 196: '7v', 197: '7w', 198: '7x', 199: '7y',
200: '8a', 201: '8b', 202: '8c', 203: '8d', 204: '8e', 205: '8f', 206: '8g', 207: '8h',
208: '8i', 209: '8j', 210: '8k', 211: '8l', 212: '8m', 213: '8n', 214: '8o', 215: '8p',
216: '8q', 217: '8r', 218: '8s', 219: '8t', 220: '8u', 221: '8v', 222: '8w', 223: '8x',
224: '8y', 225: '9a', 226: '9b', 227: '9c', 228: '9d', 229: '9e', 230: '9f', 231: '9g',
232: '9h', 233: '9i', 234: '9j', 235: '9k', 236: '9l', 237: '9m', 238: '9n', 239: '9o',
240: '9p', 241: '9q', 242: '9r', 243: '9s', 244: '9t', 245: '9u', 246: '9v', 247: '9w',
248: '9x', 249: '9y', 250: '10a', 251: '10b', 252: '10c', 253: '10d', 254: '10e', 255: '10f'} # yapf: disable
| ips = ['127.0.0.1', '255.0.0.1', '137.44.1.20', '48.8.9.72', '.'.join((str(x) for x in range(256)))]
z_a = ord('z') - ord('a')
for ip in ips:
sip = []
for byte in ip.split('.'):
(b, s) = (int(byte), [])
if b < ord('a'):
b += ord('a')
if b > ord('z'):
s.append('Z')
b -= z_a
if b > ord('z'):
(z, b) = divmod(b, z_a)
s.append(str(z))
s.append(chr(b + ord('a')))
else:
s.append(chr(b))
else:
s.append(chr(b).upper())
sip.append(''.join(s))
elif b > ord('z'):
(z, b) = divmod(b, z_a)
s.append(str(z))
s.append(chr(b + ord('a')))
sip.append(''.join(s))
else:
sip.append(chr(b))
print(ip, '=', '.'.join(sip))
table = {0: 'A', 1: 'B', 2: 'C', 3: 'D', 4: 'E', 5: 'F', 6: 'G', 7: 'H', 8: 'I', 9: 'J', 10: 'K', 11: 'L', 12: 'M', 13: 'N', 14: 'O', 15: 'P', 16: 'Q', 17: 'R', 18: 'S', 19: 'T', 20: 'U', 21: 'V', 22: 'W', 23: 'X', 24: 'Y', 25: 'Z', 26: 'Zb', 27: 'Zc', 28: 'Zd', 29: 'Ze', 30: 'Zf', 31: 'Zg', 32: 'Zh', 33: 'Zi', 34: 'Zj', 35: 'Zk', 36: 'Zl', 37: 'Zm', 38: 'Zn', 39: 'Zo', 40: 'Zp', 41: 'Zq', 42: 'Zr', 43: 'Zs', 44: 'Zt', 45: 'Zu', 46: 'Zv', 47: 'Zw', 48: 'Zx', 49: 'Zy', 50: 'Zz', 51: 'Z4x', 52: 'Z4y', 53: 'Z5a', 54: 'Z5b', 55: 'Z5c', 56: 'Z5d', 57: 'Z5e', 58: 'Z5f', 59: 'Z5g', 60: 'Z5h', 61: 'Z5i', 62: 'Z5j', 63: 'Z5k', 64: 'Z5l', 65: 'Z5m', 66: 'Z5n', 67: 'Z5o', 68: 'Z5p', 69: 'Z5q', 70: 'Z5r', 71: 'Z5s', 72: 'Z5t', 73: 'Z5u', 74: 'Z5v', 75: 'Z5w', 76: 'Z5x', 77: 'Z5y', 78: 'Z6a', 79: 'Z6b', 80: 'Z6c', 81: 'Z6d', 82: 'Z6e', 83: 'Z6f', 84: 'Z6g', 85: 'Z6h', 86: 'Z6i', 87: 'Z6j', 88: 'Z6k', 89: 'Z6l', 90: 'Z6m', 91: 'Z6n', 92: 'Z6o', 93: 'Z6p', 94: 'Z6q', 95: 'Z6r', 96: 'Z6s', 97: 'a', 98: 'b', 99: 'c', 100: 'd', 101: 'e', 102: 'f', 103: 'g', 104: 'h', 105: 'i', 106: 'j', 107: 'k', 108: 'l', 109: 'm', 110: 'n', 111: 'o', 112: 'p', 113: 'q', 114: 'r', 115: 's', 116: 't', 117: 'u', 118: 'v', 119: 'w', 120: 'x', 121: 'y', 122: 'z', 123: '4x', 124: '4y', 125: '5a', 126: '5b', 127: '5c', 128: '5d', 129: '5e', 130: '5f', 131: '5g', 132: '5h', 133: '5i', 134: '5j', 135: '5k', 136: '5l', 137: '5m', 138: '5n', 139: '5o', 140: '5p', 141: '5q', 142: '5r', 143: '5s', 144: '5t', 145: '5u', 146: '5v', 147: '5w', 148: '5x', 149: '5y', 150: '6a', 151: '6b', 152: '6c', 153: '6d', 154: '6e', 155: '6f', 156: '6g', 157: '6h', 158: '6i', 159: '6j', 160: '6k', 161: '6l', 162: '6m', 163: '6n', 164: '6o', 165: '6p', 166: '6q', 167: '6r', 168: '6s', 169: '6t', 170: '6u', 171: '6v', 172: '6w', 173: '6x', 174: '6y', 175: '7a', 176: '7b', 177: '7c', 178: '7d', 179: '7e', 180: '7f', 181: '7g', 182: '7h', 183: '7i', 184: '7j', 185: '7k', 186: '7l', 187: '7m', 188: '7n', 189: '7o', 190: '7p', 191: '7q', 192: '7r', 193: '7s', 194: '7t', 195: '7u', 196: '7v', 197: '7w', 198: '7x', 199: '7y', 200: '8a', 201: '8b', 202: '8c', 203: '8d', 204: '8e', 205: '8f', 206: '8g', 207: '8h', 208: '8i', 209: '8j', 210: '8k', 211: '8l', 212: '8m', 213: '8n', 214: '8o', 215: '8p', 216: '8q', 217: '8r', 218: '8s', 219: '8t', 220: '8u', 221: '8v', 222: '8w', 223: '8x', 224: '8y', 225: '9a', 226: '9b', 227: '9c', 228: '9d', 229: '9e', 230: '9f', 231: '9g', 232: '9h', 233: '9i', 234: '9j', 235: '9k', 236: '9l', 237: '9m', 238: '9n', 239: '9o', 240: '9p', 241: '9q', 242: '9r', 243: '9s', 244: '9t', 245: '9u', 246: '9v', 247: '9w', 248: '9x', 249: '9y', 250: '10a', 251: '10b', 252: '10c', 253: '10d', 254: '10e', 255: '10f'} |
class AI():
def __init__(self, grid):
self.grid = grid
def solve(self):
covered = self.grid.grid.get_covered()
try:
cell = covered[0]
except IndexError:
print("Nothing more to do")
return
self.grid.press(*cell)
print("Press", cell) | class Ai:
def __init__(self, grid):
self.grid = grid
def solve(self):
covered = self.grid.grid.get_covered()
try:
cell = covered[0]
except IndexError:
print('Nothing more to do')
return
self.grid.press(*cell)
print('Press', cell) |
def StringVersion( seq ):
return '.'.join( ['%s'] * len( seq )) % tuple( seq )
def TupleVersion( str ):
return map( int, str.split( '.' ))
| def string_version(seq):
return '.'.join(['%s'] * len(seq)) % tuple(seq)
def tuple_version(str):
return map(int, str.split('.')) |
# responder-brute configuration file
# Path to Responder.db
RESPONDERDB = '../Responder.db'
# Current hash file
CURRENTHASHFILE = 'current.txt'
# Poll for new hashes every N seconds
POLLTIME = 5
# Use 'john' for John The Ripper or 'hashcat' for Hashcat.
MODE = 'john'
if MODE == 'john':
# Command to run. Use "{hashtype}" without quotes where the hash type should be supplied
# and {hash} where the hash file should be supplied
COMMAND = 'john --format={hashtype} --wordlist=dictionary.dic {hash}'
# Hash type format for john
HASHTYPE_NTLMv1 = 'netntlm'
HASHTYPE_NTLMv2 = 'netntlmv2'
# Command to run after COMMAND execution. Not needed for hashcat.
COMMAND_POST = 'john --show {}'
else:
# Command to run. Use "{}" without quotes where the hash file should be supplied
COMMAND = 'hashcat -m {hashtype} -a 0 {hash} dictionary.dic'
# Hash type format for hashcat
HASHTYPE_NTLMv1 = '5500'
HASHTYPE_NTLMv2 = '5600'
# Command to run after COMMAND execution. Not needed for hashcat.
COMMAND_POST = None
# Timeout in seconds after which the COMMAND would be terminated
TIMEOUT = 10*60
| responderdb = '../Responder.db'
currenthashfile = 'current.txt'
polltime = 5
mode = 'john'
if MODE == 'john':
command = 'john --format={hashtype} --wordlist=dictionary.dic {hash}'
hashtype_ntl_mv1 = 'netntlm'
hashtype_ntl_mv2 = 'netntlmv2'
command_post = 'john --show {}'
else:
command = 'hashcat -m {hashtype} -a 0 {hash} dictionary.dic'
hashtype_ntl_mv1 = '5500'
hashtype_ntl_mv2 = '5600'
command_post = None
timeout = 10 * 60 |
# -*- coding: utf-8 -*-
# ----------------------------------------------------------------------
# CISCO-CDP-MIB
# Compiled MIB
# Do not modify this file directly
# Run ./noc mib make_cmib instead
# ----------------------------------------------------------------------
# Copyright (C) 2007-2018 The NOC Project
# See LICENSE for details
# ----------------------------------------------------------------------
# MIB Name
NAME = "CISCO-CDP-MIB"
# Metadata
LAST_UPDATED = "2005-03-21"
COMPILED = "2018-06-09"
# MIB Data: name -> oid
MIB = {
"CISCO-CDP-MIB::ciscoCdpMIB": "1.3.6.1.4.1.9.9.23",
"CISCO-CDP-MIB::ciscoCdpMIBObjects": "1.3.6.1.4.1.9.9.23.1",
"CISCO-CDP-MIB::cdpInterface": "1.3.6.1.4.1.9.9.23.1.1",
"CISCO-CDP-MIB::cdpInterfaceTable": "1.3.6.1.4.1.9.9.23.1.1.1",
"CISCO-CDP-MIB::cdpInterfaceEntry": "1.3.6.1.4.1.9.9.23.1.1.1.1",
"CISCO-CDP-MIB::cdpInterfaceIfIndex": "1.3.6.1.4.1.9.9.23.1.1.1.1.1",
"CISCO-CDP-MIB::cdpInterfaceEnable": "1.3.6.1.4.1.9.9.23.1.1.1.1.2",
"CISCO-CDP-MIB::cdpInterfaceMessageInterval": "1.3.6.1.4.1.9.9.23.1.1.1.1.3",
"CISCO-CDP-MIB::cdpInterfaceGroup": "1.3.6.1.4.1.9.9.23.1.1.1.1.4",
"CISCO-CDP-MIB::cdpInterfacePort": "1.3.6.1.4.1.9.9.23.1.1.1.1.5",
"CISCO-CDP-MIB::cdpInterfaceName": "1.3.6.1.4.1.9.9.23.1.1.1.1.6",
"CISCO-CDP-MIB::cdpInterfaceExtTable": "1.3.6.1.4.1.9.9.23.1.1.2",
"CISCO-CDP-MIB::cdpInterfaceExtEntry": "1.3.6.1.4.1.9.9.23.1.1.2.1",
"CISCO-CDP-MIB::cdpInterfaceExtendedTrust": "1.3.6.1.4.1.9.9.23.1.1.2.1.1",
"CISCO-CDP-MIB::cdpInterfaceCosForUntrustedPort": "1.3.6.1.4.1.9.9.23.1.1.2.1.2",
"CISCO-CDP-MIB::cdpCache": "1.3.6.1.4.1.9.9.23.1.2",
"CISCO-CDP-MIB::cdpCacheTable": "1.3.6.1.4.1.9.9.23.1.2.1",
"CISCO-CDP-MIB::cdpCacheEntry": "1.3.6.1.4.1.9.9.23.1.2.1.1",
"CISCO-CDP-MIB::cdpCacheIfIndex": "1.3.6.1.4.1.9.9.23.1.2.1.1.1",
"CISCO-CDP-MIB::cdpCacheDeviceIndex": "1.3.6.1.4.1.9.9.23.1.2.1.1.2",
"CISCO-CDP-MIB::cdpCacheAddressType": "1.3.6.1.4.1.9.9.23.1.2.1.1.3",
"CISCO-CDP-MIB::cdpCacheAddress": "1.3.6.1.4.1.9.9.23.1.2.1.1.4",
"CISCO-CDP-MIB::cdpCacheVersion": "1.3.6.1.4.1.9.9.23.1.2.1.1.5",
"CISCO-CDP-MIB::cdpCacheDeviceId": "1.3.6.1.4.1.9.9.23.1.2.1.1.6",
"CISCO-CDP-MIB::cdpCacheDevicePort": "1.3.6.1.4.1.9.9.23.1.2.1.1.7",
"CISCO-CDP-MIB::cdpCachePlatform": "1.3.6.1.4.1.9.9.23.1.2.1.1.8",
"CISCO-CDP-MIB::cdpCacheCapabilities": "1.3.6.1.4.1.9.9.23.1.2.1.1.9",
"CISCO-CDP-MIB::cdpCacheVTPMgmtDomain": "1.3.6.1.4.1.9.9.23.1.2.1.1.10",
"CISCO-CDP-MIB::cdpCacheNativeVLAN": "1.3.6.1.4.1.9.9.23.1.2.1.1.11",
"CISCO-CDP-MIB::cdpCacheDuplex": "1.3.6.1.4.1.9.9.23.1.2.1.1.12",
"CISCO-CDP-MIB::cdpCacheApplianceID": "1.3.6.1.4.1.9.9.23.1.2.1.1.13",
"CISCO-CDP-MIB::cdpCacheVlanID": "1.3.6.1.4.1.9.9.23.1.2.1.1.14",
"CISCO-CDP-MIB::cdpCachePowerConsumption": "1.3.6.1.4.1.9.9.23.1.2.1.1.15",
"CISCO-CDP-MIB::cdpCacheMTU": "1.3.6.1.4.1.9.9.23.1.2.1.1.16",
"CISCO-CDP-MIB::cdpCacheSysName": "1.3.6.1.4.1.9.9.23.1.2.1.1.17",
"CISCO-CDP-MIB::cdpCacheSysObjectID": "1.3.6.1.4.1.9.9.23.1.2.1.1.18",
"CISCO-CDP-MIB::cdpCachePrimaryMgmtAddrType": "1.3.6.1.4.1.9.9.23.1.2.1.1.19",
"CISCO-CDP-MIB::cdpCachePrimaryMgmtAddr": "1.3.6.1.4.1.9.9.23.1.2.1.1.20",
"CISCO-CDP-MIB::cdpCacheSecondaryMgmtAddrType": "1.3.6.1.4.1.9.9.23.1.2.1.1.21",
"CISCO-CDP-MIB::cdpCacheSecondaryMgmtAddr": "1.3.6.1.4.1.9.9.23.1.2.1.1.22",
"CISCO-CDP-MIB::cdpCachePhysLocation": "1.3.6.1.4.1.9.9.23.1.2.1.1.23",
"CISCO-CDP-MIB::cdpCacheLastChange": "1.3.6.1.4.1.9.9.23.1.2.1.1.24",
"CISCO-CDP-MIB::cdpCtAddressTable": "1.3.6.1.4.1.9.9.23.1.2.2",
"CISCO-CDP-MIB::cdpCtAddressEntry": "1.3.6.1.4.1.9.9.23.1.2.2.1",
"CISCO-CDP-MIB::cdpCtAddressIndex": "1.3.6.1.4.1.9.9.23.1.2.2.1.3",
"CISCO-CDP-MIB::cdpCtAddressType": "1.3.6.1.4.1.9.9.23.1.2.2.1.4",
"CISCO-CDP-MIB::cdpCtAddress": "1.3.6.1.4.1.9.9.23.1.2.2.1.5",
"CISCO-CDP-MIB::cdpGlobal": "1.3.6.1.4.1.9.9.23.1.3",
"CISCO-CDP-MIB::cdpGlobalRun": "1.3.6.1.4.1.9.9.23.1.3.1",
"CISCO-CDP-MIB::cdpGlobalMessageInterval": "1.3.6.1.4.1.9.9.23.1.3.2",
"CISCO-CDP-MIB::cdpGlobalHoldTime": "1.3.6.1.4.1.9.9.23.1.3.3",
"CISCO-CDP-MIB::cdpGlobalDeviceId": "1.3.6.1.4.1.9.9.23.1.3.4",
"CISCO-CDP-MIB::cdpGlobalLastChange": "1.3.6.1.4.1.9.9.23.1.3.5",
"CISCO-CDP-MIB::cdpGlobalDeviceIdFormatCpb": "1.3.6.1.4.1.9.9.23.1.3.6",
"CISCO-CDP-MIB::cdpGlobalDeviceIdFormat": "1.3.6.1.4.1.9.9.23.1.3.7",
"CISCO-CDP-MIB::ciscoCdpMIBConformance": "1.3.6.1.4.1.9.9.23.2",
"CISCO-CDP-MIB::ciscoCdpMIBCompliances": "1.3.6.1.4.1.9.9.23.2.1",
"CISCO-CDP-MIB::ciscoCdpMIBGroups": "1.3.6.1.4.1.9.9.23.2.2",
}
| name = 'CISCO-CDP-MIB'
last_updated = '2005-03-21'
compiled = '2018-06-09'
mib = {'CISCO-CDP-MIB::ciscoCdpMIB': '1.3.6.1.4.1.9.9.23', 'CISCO-CDP-MIB::ciscoCdpMIBObjects': '1.3.6.1.4.1.9.9.23.1', 'CISCO-CDP-MIB::cdpInterface': '1.3.6.1.4.1.9.9.23.1.1', 'CISCO-CDP-MIB::cdpInterfaceTable': '1.3.6.1.4.1.9.9.23.1.1.1', 'CISCO-CDP-MIB::cdpInterfaceEntry': '1.3.6.1.4.1.9.9.23.1.1.1.1', 'CISCO-CDP-MIB::cdpInterfaceIfIndex': '1.3.6.1.4.1.9.9.23.1.1.1.1.1', 'CISCO-CDP-MIB::cdpInterfaceEnable': '1.3.6.1.4.1.9.9.23.1.1.1.1.2', 'CISCO-CDP-MIB::cdpInterfaceMessageInterval': '1.3.6.1.4.1.9.9.23.1.1.1.1.3', 'CISCO-CDP-MIB::cdpInterfaceGroup': '1.3.6.1.4.1.9.9.23.1.1.1.1.4', 'CISCO-CDP-MIB::cdpInterfacePort': '1.3.6.1.4.1.9.9.23.1.1.1.1.5', 'CISCO-CDP-MIB::cdpInterfaceName': '1.3.6.1.4.1.9.9.23.1.1.1.1.6', 'CISCO-CDP-MIB::cdpInterfaceExtTable': '1.3.6.1.4.1.9.9.23.1.1.2', 'CISCO-CDP-MIB::cdpInterfaceExtEntry': '1.3.6.1.4.1.9.9.23.1.1.2.1', 'CISCO-CDP-MIB::cdpInterfaceExtendedTrust': '1.3.6.1.4.1.9.9.23.1.1.2.1.1', 'CISCO-CDP-MIB::cdpInterfaceCosForUntrustedPort': '1.3.6.1.4.1.9.9.23.1.1.2.1.2', 'CISCO-CDP-MIB::cdpCache': '1.3.6.1.4.1.9.9.23.1.2', 'CISCO-CDP-MIB::cdpCacheTable': '1.3.6.1.4.1.9.9.23.1.2.1', 'CISCO-CDP-MIB::cdpCacheEntry': '1.3.6.1.4.1.9.9.23.1.2.1.1', 'CISCO-CDP-MIB::cdpCacheIfIndex': '1.3.6.1.4.1.9.9.23.1.2.1.1.1', 'CISCO-CDP-MIB::cdpCacheDeviceIndex': '1.3.6.1.4.1.9.9.23.1.2.1.1.2', 'CISCO-CDP-MIB::cdpCacheAddressType': '1.3.6.1.4.1.9.9.23.1.2.1.1.3', 'CISCO-CDP-MIB::cdpCacheAddress': '1.3.6.1.4.1.9.9.23.1.2.1.1.4', 'CISCO-CDP-MIB::cdpCacheVersion': '1.3.6.1.4.1.9.9.23.1.2.1.1.5', 'CISCO-CDP-MIB::cdpCacheDeviceId': '1.3.6.1.4.1.9.9.23.1.2.1.1.6', 'CISCO-CDP-MIB::cdpCacheDevicePort': '1.3.6.1.4.1.9.9.23.1.2.1.1.7', 'CISCO-CDP-MIB::cdpCachePlatform': '1.3.6.1.4.1.9.9.23.1.2.1.1.8', 'CISCO-CDP-MIB::cdpCacheCapabilities': '1.3.6.1.4.1.9.9.23.1.2.1.1.9', 'CISCO-CDP-MIB::cdpCacheVTPMgmtDomain': '1.3.6.1.4.1.9.9.23.1.2.1.1.10', 'CISCO-CDP-MIB::cdpCacheNativeVLAN': '1.3.6.1.4.1.9.9.23.1.2.1.1.11', 'CISCO-CDP-MIB::cdpCacheDuplex': '1.3.6.1.4.1.9.9.23.1.2.1.1.12', 'CISCO-CDP-MIB::cdpCacheApplianceID': '1.3.6.1.4.1.9.9.23.1.2.1.1.13', 'CISCO-CDP-MIB::cdpCacheVlanID': '1.3.6.1.4.1.9.9.23.1.2.1.1.14', 'CISCO-CDP-MIB::cdpCachePowerConsumption': '1.3.6.1.4.1.9.9.23.1.2.1.1.15', 'CISCO-CDP-MIB::cdpCacheMTU': '1.3.6.1.4.1.9.9.23.1.2.1.1.16', 'CISCO-CDP-MIB::cdpCacheSysName': '1.3.6.1.4.1.9.9.23.1.2.1.1.17', 'CISCO-CDP-MIB::cdpCacheSysObjectID': '1.3.6.1.4.1.9.9.23.1.2.1.1.18', 'CISCO-CDP-MIB::cdpCachePrimaryMgmtAddrType': '1.3.6.1.4.1.9.9.23.1.2.1.1.19', 'CISCO-CDP-MIB::cdpCachePrimaryMgmtAddr': '1.3.6.1.4.1.9.9.23.1.2.1.1.20', 'CISCO-CDP-MIB::cdpCacheSecondaryMgmtAddrType': '1.3.6.1.4.1.9.9.23.1.2.1.1.21', 'CISCO-CDP-MIB::cdpCacheSecondaryMgmtAddr': '1.3.6.1.4.1.9.9.23.1.2.1.1.22', 'CISCO-CDP-MIB::cdpCachePhysLocation': '1.3.6.1.4.1.9.9.23.1.2.1.1.23', 'CISCO-CDP-MIB::cdpCacheLastChange': '1.3.6.1.4.1.9.9.23.1.2.1.1.24', 'CISCO-CDP-MIB::cdpCtAddressTable': '1.3.6.1.4.1.9.9.23.1.2.2', 'CISCO-CDP-MIB::cdpCtAddressEntry': '1.3.6.1.4.1.9.9.23.1.2.2.1', 'CISCO-CDP-MIB::cdpCtAddressIndex': '1.3.6.1.4.1.9.9.23.1.2.2.1.3', 'CISCO-CDP-MIB::cdpCtAddressType': '1.3.6.1.4.1.9.9.23.1.2.2.1.4', 'CISCO-CDP-MIB::cdpCtAddress': '1.3.6.1.4.1.9.9.23.1.2.2.1.5', 'CISCO-CDP-MIB::cdpGlobal': '1.3.6.1.4.1.9.9.23.1.3', 'CISCO-CDP-MIB::cdpGlobalRun': '1.3.6.1.4.1.9.9.23.1.3.1', 'CISCO-CDP-MIB::cdpGlobalMessageInterval': '1.3.6.1.4.1.9.9.23.1.3.2', 'CISCO-CDP-MIB::cdpGlobalHoldTime': '1.3.6.1.4.1.9.9.23.1.3.3', 'CISCO-CDP-MIB::cdpGlobalDeviceId': '1.3.6.1.4.1.9.9.23.1.3.4', 'CISCO-CDP-MIB::cdpGlobalLastChange': '1.3.6.1.4.1.9.9.23.1.3.5', 'CISCO-CDP-MIB::cdpGlobalDeviceIdFormatCpb': '1.3.6.1.4.1.9.9.23.1.3.6', 'CISCO-CDP-MIB::cdpGlobalDeviceIdFormat': '1.3.6.1.4.1.9.9.23.1.3.7', 'CISCO-CDP-MIB::ciscoCdpMIBConformance': '1.3.6.1.4.1.9.9.23.2', 'CISCO-CDP-MIB::ciscoCdpMIBCompliances': '1.3.6.1.4.1.9.9.23.2.1', 'CISCO-CDP-MIB::ciscoCdpMIBGroups': '1.3.6.1.4.1.9.9.23.2.2'} |
class Simple(object):
def __init__(self, lines):
self.lines = lines
def __enter__(self):
return self
def __exit__(self, *args):
pass
def path(self):
return None
def get_doc_ids(self):
return list(range(len(self.lines)))
def get_doc_text(self, line):
return self.lines[line]
def close(self):
pass
| class Simple(object):
def __init__(self, lines):
self.lines = lines
def __enter__(self):
return self
def __exit__(self, *args):
pass
def path(self):
return None
def get_doc_ids(self):
return list(range(len(self.lines)))
def get_doc_text(self, line):
return self.lines[line]
def close(self):
pass |
'''
igualad: a == b
desigualad: a != b
a menor que b: a < b
a menor o igual b: a <= b
a mayor que b: a > b
a mayor o igual b: a >= b
'''
# if basico en varias lineas
a = 33
b = 200
if b > a:
print("b es mayor a")
# if anidado en varias lineas
a = 33
b = 33
if b > a:
print("b es mayor a")
elif a == b:
print("a y b son iguales")
# if anidado con else final en varias lineas
if b > a:
print("b es mayor a")
elif a == b:
print("a y b son iguales")
else:
print("a es mayor b")
# if y acciones en una sola linea
if b > a: print("b es mayor a")
elif a == b: print("a y b son iguales")
else: print("a es mayor b")
# if else una linea
print("A") if a > b else print("B")
# 3 condiciones en una linea
print("A") if a > b else print("=") if a == b else print("B")
| """
igualad: a == b
desigualad: a != b
a menor que b: a < b
a menor o igual b: a <= b
a mayor que b: a > b
a mayor o igual b: a >= b
"""
a = 33
b = 200
if b > a:
print('b es mayor a')
a = 33
b = 33
if b > a:
print('b es mayor a')
elif a == b:
print('a y b son iguales')
if b > a:
print('b es mayor a')
elif a == b:
print('a y b son iguales')
else:
print('a es mayor b')
if b > a:
print('b es mayor a')
elif a == b:
print('a y b son iguales')
else:
print('a es mayor b')
print('A') if a > b else print('B')
print('A') if a > b else print('=') if a == b else print('B') |
# 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 inorderTraversal(self, root: TreeNode) -> List[int]:
# res = []
# if not root:
# return res
# def dfs(root):
# if not root:
# return
# left, right = root.left, root.right
# if left:
# dfs(left)
# res.append(root.val)
# if right:
# dfs(right)
# dfs(root)
# return res
# class Solution:
# def inorderTraversal(self, root: TreeNode) -> List[int]:
# res = []
# if not root:
# return res
# stack = []
# p = root
# while(p or stack):
# if p:
# stack.append(p)
# p = p.left
# else:
# p = stack.pop()
# res.append(p.val)
# p = p.right
# return res
class Solution:
def inorderTraversal(self, root: TreeNode) -> List[int]:
res = []
if not root:
return res
stack = [(False, root)]
while stack:
visited, node = stack.pop()
if not node:
continue
if visited:
res.append(node.val)
else:
stack.append((False, node.right))
stack.append((True, node))
stack.append((False, node.left))
return res
| class Solution:
def inorder_traversal(self, root: TreeNode) -> List[int]:
res = []
if not root:
return res
stack = [(False, root)]
while stack:
(visited, node) = stack.pop()
if not node:
continue
if visited:
res.append(node.val)
else:
stack.append((False, node.right))
stack.append((True, node))
stack.append((False, node.left))
return res |
class Fifo(list):
def __init__(self):
self.back = []
self.append = self.back.append
def pop(self):
if not self:
self.back.reverse()
self[:] = self.back
del self.back[:]
return super(Fifo, self).pop()
| class Fifo(list):
def __init__(self):
self.back = []
self.append = self.back.append
def pop(self):
if not self:
self.back.reverse()
self[:] = self.back
del self.back[:]
return super(Fifo, self).pop() |
## Script (Python) "getPautasPautao"
##bind container=container
##bind context=context
##bind namespace=
##bind script=script
##bind subpath=traverse_subpath
##parameters=data='',
##title=Retorna a lista de pautas do pautao
ret = { 'manha': [], 'tarde': [], 'noite': [], 'nota':[], 'programas': [], 'semturno': [] }
if not data:
data = DateTime().Date()
pautas = context.portal_catalog.searchResults(portal_type='Pauta', \
getData=data, \
review_state='Pautao')
programas = ['nbr-entrevista', 'documentacao', 'bomdiaministro', 'cenasdobrasil', 'brasilempauta', 'cafe' ]
for pauta in pautas:
turno = pauta.getTurno
midias = pauta.getMidias
nota = pauta.getNota
if nota:
ret['nota'].append(pauta)
else:
if [x for x in midias for y in programas if x == y]:
ret['programas'].append(pauta)
else:
if not turno:
ret['semturno'].append(pauta)
else:
if 'Manh\xc3\xa3' in turno:
ret['manha'].append(pauta)
if 'Tarde' in turno:
ret['tarde'].append(pauta)
if 'Noite' in turno:
ret['noite'].append(pauta)
return ret
| ret = {'manha': [], 'tarde': [], 'noite': [], 'nota': [], 'programas': [], 'semturno': []}
if not data:
data = date_time().Date()
pautas = context.portal_catalog.searchResults(portal_type='Pauta', getData=data, review_state='Pautao')
programas = ['nbr-entrevista', 'documentacao', 'bomdiaministro', 'cenasdobrasil', 'brasilempauta', 'cafe']
for pauta in pautas:
turno = pauta.getTurno
midias = pauta.getMidias
nota = pauta.getNota
if nota:
ret['nota'].append(pauta)
elif [x for x in midias for y in programas if x == y]:
ret['programas'].append(pauta)
elif not turno:
ret['semturno'].append(pauta)
else:
if 'Manhã' in turno:
ret['manha'].append(pauta)
if 'Tarde' in turno:
ret['tarde'].append(pauta)
if 'Noite' in turno:
ret['noite'].append(pauta)
return ret |
class BaseModule(object):
def __init__(self, connector):
self.connector = connector
def setup(self):
pass
| class Basemodule(object):
def __init__(self, connector):
self.connector = connector
def setup(self):
pass |
'''
Created on 09.03.2019
@author: Nicco
'''
class plan_base(object):
'''
plan base is providing alle the methods to connect to act, perception and the simulator
'''
def __init__(self, params):
'''
Constructor
'''
| """
Created on 09.03.2019
@author: Nicco
"""
class Plan_Base(object):
"""
plan base is providing alle the methods to connect to act, perception and the simulator
"""
def __init__(self, params):
"""
Constructor
""" |
even_set = set()
odd_set = set()
for row in range(int(input())):
name = input()
ascii_letters = [ord(letter) for letter in name]
result = sum(ascii_letters) // (row+1)
if result % 2 == 0:
even_set.add(result)
else:
odd_set.add(result)
if sum(even_set) == sum(odd_set):
[odd_set.add(n) for n in even_set]
elif sum(even_set) < sum(odd_set):
odd_set = odd_set.difference(even_set)
else:
odd_set = odd_set.symmetric_difference(even_set)
print(', '.join([str(n) for n in odd_set]))
| even_set = set()
odd_set = set()
for row in range(int(input())):
name = input()
ascii_letters = [ord(letter) for letter in name]
result = sum(ascii_letters) // (row + 1)
if result % 2 == 0:
even_set.add(result)
else:
odd_set.add(result)
if sum(even_set) == sum(odd_set):
[odd_set.add(n) for n in even_set]
elif sum(even_set) < sum(odd_set):
odd_set = odd_set.difference(even_set)
else:
odd_set = odd_set.symmetric_difference(even_set)
print(', '.join([str(n) for n in odd_set])) |
_base_ = [
'../_base_/models/ocrnet_r50-d8.py', '../_base_/datasets/cityscapes_sccqq.py',
'../_base_/default_runtime.py', '../_base_/schedules/schedule_80k.py'
]
model = dict(pretrained='open-mmlab://resnet101_v1c', backbone=dict(depth=101))
optimizer = dict(lr=0.02)
lr_config = dict(min_lr=2e-4)
data = dict(
samples_per_gpu=1,
workers_per_gpu=4,
) | _base_ = ['../_base_/models/ocrnet_r50-d8.py', '../_base_/datasets/cityscapes_sccqq.py', '../_base_/default_runtime.py', '../_base_/schedules/schedule_80k.py']
model = dict(pretrained='open-mmlab://resnet101_v1c', backbone=dict(depth=101))
optimizer = dict(lr=0.02)
lr_config = dict(min_lr=0.0002)
data = dict(samples_per_gpu=1, workers_per_gpu=4) |
#
# PySNMP MIB module BAY-STACK-PIM-EXT-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/BAY-STACK-PIM-EXT-MIB
# Produced by pysmi-0.3.4 at Wed May 1 11:36:08 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 (default, Mar 27 2019, 09:23:15)
#
OctetString, Integer, ObjectIdentifier = mibBuilder.importSymbols("ASN1", "OctetString", "Integer", "ObjectIdentifier")
NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues")
SingleValueConstraint, ConstraintsUnion, ValueSizeConstraint, ValueRangeConstraint, ConstraintsIntersection = mibBuilder.importSymbols("ASN1-REFINEMENT", "SingleValueConstraint", "ConstraintsUnion", "ValueSizeConstraint", "ValueRangeConstraint", "ConstraintsIntersection")
InterfaceIndex, = mibBuilder.importSymbols("IF-MIB", "InterfaceIndex")
NotificationGroup, ModuleCompliance = mibBuilder.importSymbols("SNMPv2-CONF", "NotificationGroup", "ModuleCompliance")
Bits, MibIdentifier, ModuleIdentity, MibScalar, MibTable, MibTableRow, MibTableColumn, iso, Counter64, ObjectIdentity, TimeTicks, Gauge32, IpAddress, Integer32, Counter32, Unsigned32, NotificationType = mibBuilder.importSymbols("SNMPv2-SMI", "Bits", "MibIdentifier", "ModuleIdentity", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "iso", "Counter64", "ObjectIdentity", "TimeTicks", "Gauge32", "IpAddress", "Integer32", "Counter32", "Unsigned32", "NotificationType")
RowStatus, DisplayString, TextualConvention = mibBuilder.importSymbols("SNMPv2-TC", "RowStatus", "DisplayString", "TextualConvention")
bayStackMibs, = mibBuilder.importSymbols("SYNOPTICS-ROOT-MIB", "bayStackMibs")
bayStackPimExtMib = ModuleIdentity((1, 3, 6, 1, 4, 1, 45, 5, 27))
bayStackPimExtMib.setRevisions(('2009-02-27 00:00', '2009-02-10 00:00', '2007-11-28 00:00',))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
if mibBuilder.loadTexts: bayStackPimExtMib.setRevisionsDescriptions(('v3: Changed bspimNeighborLoss to bspimeNeighborStateChanged.', 'v2: Added bspimNeighborLoss.', 'v1: Initial version.',))
if mibBuilder.loadTexts: bayStackPimExtMib.setLastUpdated('200902270000Z')
if mibBuilder.loadTexts: bayStackPimExtMib.setOrganization('Nortel Networks')
if mibBuilder.loadTexts: bayStackPimExtMib.setContactInfo('Nortel Networks')
if mibBuilder.loadTexts: bayStackPimExtMib.setDescription("Nortel Networks PIM Extension MIB Copyright 2007 Nortel Networks, Inc. All rights reserved. This Nortel Networks SNMP Management Information Base Specification embodies Nortel Networks' confidential and proprietary intellectual property. Nortel Networks retains all title and ownership in the Specification, including any revisions. This Specification is supplied 'AS IS,' and Nortel Networks makes no warranty, either express or implied, as to the use, operation, condition, or performance of the Specification.")
bspimeNotifications = MibIdentifier((1, 3, 6, 1, 4, 1, 45, 5, 27, 0))
bspimeObjects = MibIdentifier((1, 3, 6, 1, 4, 1, 45, 5, 27, 1))
bspimeNotificationObjects = MibIdentifier((1, 3, 6, 1, 4, 1, 45, 5, 27, 2))
bspimeScalars = MibIdentifier((1, 3, 6, 1, 4, 1, 45, 5, 27, 1, 1))
bspimePimVirtualNeighborTable = MibTable((1, 3, 6, 1, 4, 1, 45, 5, 27, 1, 2), )
if mibBuilder.loadTexts: bspimePimVirtualNeighborTable.setStatus('current')
if mibBuilder.loadTexts: bspimePimVirtualNeighborTable.setDescription('PIM Virtual Neighbor table.')
bspimePimVirtualNeighborEntry = MibTableRow((1, 3, 6, 1, 4, 1, 45, 5, 27, 1, 2, 1), ).setIndexNames((0, "BAY-STACK-PIM-EXT-MIB", "bspimePimVirtualNeighborIfIndex"), (0, "BAY-STACK-PIM-EXT-MIB", "bspimePimVirtualNeighborAddress"))
if mibBuilder.loadTexts: bspimePimVirtualNeighborEntry.setStatus('current')
if mibBuilder.loadTexts: bspimePimVirtualNeighborEntry.setDescription('A PIM virtual neighbor.')
bspimePimVirtualNeighborIfIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 45, 5, 27, 1, 2, 1, 1), InterfaceIndex())
if mibBuilder.loadTexts: bspimePimVirtualNeighborIfIndex.setStatus('current')
if mibBuilder.loadTexts: bspimePimVirtualNeighborIfIndex.setDescription('IP address of the interface of the virtual neighbor.')
bspimePimVirtualNeighborAddress = MibTableColumn((1, 3, 6, 1, 4, 1, 45, 5, 27, 1, 2, 1, 2), IpAddress())
if mibBuilder.loadTexts: bspimePimVirtualNeighborAddress.setStatus('current')
if mibBuilder.loadTexts: bspimePimVirtualNeighborAddress.setDescription('IP address of the virtual neighbor.')
bspimePimVirtualNeighborRowStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 45, 5, 27, 1, 2, 1, 3), RowStatus()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: bspimePimVirtualNeighborRowStatus.setStatus('current')
if mibBuilder.loadTexts: bspimePimVirtualNeighborRowStatus.setDescription('Used to create/delete virtual neighbors.')
bspimePimGroupActiveRPMappingTable = MibTable((1, 3, 6, 1, 4, 1, 45, 5, 27, 1, 3), )
if mibBuilder.loadTexts: bspimePimGroupActiveRPMappingTable.setStatus('current')
if mibBuilder.loadTexts: bspimePimGroupActiveRPMappingTable.setDescription('PIM Group -> Active RP Mapping table.')
bspimePimGroupActiveRPMappingEntry = MibTableRow((1, 3, 6, 1, 4, 1, 45, 5, 27, 1, 3, 1), ).setIndexNames((0, "BAY-STACK-PIM-EXT-MIB", "bspimePimGroupActiveRPMappingGroupAddress"), (0, "BAY-STACK-PIM-EXT-MIB", "bspimePimGroupActiveRPMappingGroupMask"), (0, "BAY-STACK-PIM-EXT-MIB", "bspimePimGroupActiveRPMappingActiveRP"))
if mibBuilder.loadTexts: bspimePimGroupActiveRPMappingEntry.setStatus('current')
if mibBuilder.loadTexts: bspimePimGroupActiveRPMappingEntry.setDescription('A mapping of a group to its active RP.')
bspimePimGroupActiveRPMappingGroupAddress = MibTableColumn((1, 3, 6, 1, 4, 1, 45, 5, 27, 1, 3, 1, 1), IpAddress())
if mibBuilder.loadTexts: bspimePimGroupActiveRPMappingGroupAddress.setStatus('current')
if mibBuilder.loadTexts: bspimePimGroupActiveRPMappingGroupAddress.setDescription('Group address.')
bspimePimGroupActiveRPMappingGroupMask = MibTableColumn((1, 3, 6, 1, 4, 1, 45, 5, 27, 1, 3, 1, 2), IpAddress())
if mibBuilder.loadTexts: bspimePimGroupActiveRPMappingGroupMask.setStatus('current')
if mibBuilder.loadTexts: bspimePimGroupActiveRPMappingGroupMask.setDescription('Group mask.')
bspimePimGroupActiveRPMappingActiveRP = MibTableColumn((1, 3, 6, 1, 4, 1, 45, 5, 27, 1, 3, 1, 3), IpAddress())
if mibBuilder.loadTexts: bspimePimGroupActiveRPMappingActiveRP.setStatus('current')
if mibBuilder.loadTexts: bspimePimGroupActiveRPMappingActiveRP.setDescription('IP address of the active RP.')
bspimePimGroupActiveRPMappingPriority = MibTableColumn((1, 3, 6, 1, 4, 1, 45, 5, 27, 1, 3, 1, 4), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 2147483647))).setMaxAccess("readonly")
if mibBuilder.loadTexts: bspimePimGroupActiveRPMappingPriority.setStatus('current')
if mibBuilder.loadTexts: bspimePimGroupActiveRPMappingPriority.setDescription('Priority of the active RP.')
bspimeNotifNeighborStatus = MibScalar((1, 3, 6, 1, 4, 1, 45, 5, 27, 2, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("up", 1), ("down", 2)))).setMaxAccess("accessiblefornotify")
if mibBuilder.loadTexts: bspimeNotifNeighborStatus.setStatus('current')
if mibBuilder.loadTexts: bspimeNotifNeighborStatus.setDescription('When a neighbor PIM interface changes state, this indicates whether the new state is up or down.')
bspimeNeighborStateChanged = NotificationType((1, 3, 6, 1, 4, 1, 45, 5, 27, 0, 1)).setObjects(("BAY-STACK-PIM-EXT-MIB", "rcPimNeighborIfIndex"), ("BAY-STACK-PIM-EXT-MIB", "bspimeNotifNeighborStatus"))
if mibBuilder.loadTexts: bspimeNeighborStateChanged.setStatus('current')
if mibBuilder.loadTexts: bspimeNeighborStateChanged.setDescription("A bspimeNeighborChange notification signifies a change of state of an adjacency with a neighbor. This notification should be generated when the router's PIM interface is disabled or enabled, or when a router's PIM neighbor adjacency expires or is established.")
mibBuilder.exportSymbols("BAY-STACK-PIM-EXT-MIB", bspimePimVirtualNeighborAddress=bspimePimVirtualNeighborAddress, bspimeScalars=bspimeScalars, bspimePimGroupActiveRPMappingPriority=bspimePimGroupActiveRPMappingPriority, bspimeNotificationObjects=bspimeNotificationObjects, bspimePimGroupActiveRPMappingActiveRP=bspimePimGroupActiveRPMappingActiveRP, bspimeNotifNeighborStatus=bspimeNotifNeighborStatus, bspimeNotifications=bspimeNotifications, bspimeNeighborStateChanged=bspimeNeighborStateChanged, bspimePimGroupActiveRPMappingTable=bspimePimGroupActiveRPMappingTable, bayStackPimExtMib=bayStackPimExtMib, bspimePimGroupActiveRPMappingGroupAddress=bspimePimGroupActiveRPMappingGroupAddress, bspimePimVirtualNeighborTable=bspimePimVirtualNeighborTable, bspimePimVirtualNeighborIfIndex=bspimePimVirtualNeighborIfIndex, bspimePimGroupActiveRPMappingEntry=bspimePimGroupActiveRPMappingEntry, PYSNMP_MODULE_ID=bayStackPimExtMib, bspimePimGroupActiveRPMappingGroupMask=bspimePimGroupActiveRPMappingGroupMask, bspimePimVirtualNeighborEntry=bspimePimVirtualNeighborEntry, bspimePimVirtualNeighborRowStatus=bspimePimVirtualNeighborRowStatus, bspimeObjects=bspimeObjects)
| (octet_string, integer, object_identifier) = mibBuilder.importSymbols('ASN1', 'OctetString', 'Integer', 'ObjectIdentifier')
(named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues')
(single_value_constraint, constraints_union, value_size_constraint, value_range_constraint, constraints_intersection) = mibBuilder.importSymbols('ASN1-REFINEMENT', 'SingleValueConstraint', 'ConstraintsUnion', 'ValueSizeConstraint', 'ValueRangeConstraint', 'ConstraintsIntersection')
(interface_index,) = mibBuilder.importSymbols('IF-MIB', 'InterfaceIndex')
(notification_group, module_compliance) = mibBuilder.importSymbols('SNMPv2-CONF', 'NotificationGroup', 'ModuleCompliance')
(bits, mib_identifier, module_identity, mib_scalar, mib_table, mib_table_row, mib_table_column, iso, counter64, object_identity, time_ticks, gauge32, ip_address, integer32, counter32, unsigned32, notification_type) = mibBuilder.importSymbols('SNMPv2-SMI', 'Bits', 'MibIdentifier', 'ModuleIdentity', 'MibScalar', 'MibTable', 'MibTableRow', 'MibTableColumn', 'iso', 'Counter64', 'ObjectIdentity', 'TimeTicks', 'Gauge32', 'IpAddress', 'Integer32', 'Counter32', 'Unsigned32', 'NotificationType')
(row_status, display_string, textual_convention) = mibBuilder.importSymbols('SNMPv2-TC', 'RowStatus', 'DisplayString', 'TextualConvention')
(bay_stack_mibs,) = mibBuilder.importSymbols('SYNOPTICS-ROOT-MIB', 'bayStackMibs')
bay_stack_pim_ext_mib = module_identity((1, 3, 6, 1, 4, 1, 45, 5, 27))
bayStackPimExtMib.setRevisions(('2009-02-27 00:00', '2009-02-10 00:00', '2007-11-28 00:00'))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
if mibBuilder.loadTexts:
bayStackPimExtMib.setRevisionsDescriptions(('v3: Changed bspimNeighborLoss to bspimeNeighborStateChanged.', 'v2: Added bspimNeighborLoss.', 'v1: Initial version.'))
if mibBuilder.loadTexts:
bayStackPimExtMib.setLastUpdated('200902270000Z')
if mibBuilder.loadTexts:
bayStackPimExtMib.setOrganization('Nortel Networks')
if mibBuilder.loadTexts:
bayStackPimExtMib.setContactInfo('Nortel Networks')
if mibBuilder.loadTexts:
bayStackPimExtMib.setDescription("Nortel Networks PIM Extension MIB Copyright 2007 Nortel Networks, Inc. All rights reserved. This Nortel Networks SNMP Management Information Base Specification embodies Nortel Networks' confidential and proprietary intellectual property. Nortel Networks retains all title and ownership in the Specification, including any revisions. This Specification is supplied 'AS IS,' and Nortel Networks makes no warranty, either express or implied, as to the use, operation, condition, or performance of the Specification.")
bspime_notifications = mib_identifier((1, 3, 6, 1, 4, 1, 45, 5, 27, 0))
bspime_objects = mib_identifier((1, 3, 6, 1, 4, 1, 45, 5, 27, 1))
bspime_notification_objects = mib_identifier((1, 3, 6, 1, 4, 1, 45, 5, 27, 2))
bspime_scalars = mib_identifier((1, 3, 6, 1, 4, 1, 45, 5, 27, 1, 1))
bspime_pim_virtual_neighbor_table = mib_table((1, 3, 6, 1, 4, 1, 45, 5, 27, 1, 2))
if mibBuilder.loadTexts:
bspimePimVirtualNeighborTable.setStatus('current')
if mibBuilder.loadTexts:
bspimePimVirtualNeighborTable.setDescription('PIM Virtual Neighbor table.')
bspime_pim_virtual_neighbor_entry = mib_table_row((1, 3, 6, 1, 4, 1, 45, 5, 27, 1, 2, 1)).setIndexNames((0, 'BAY-STACK-PIM-EXT-MIB', 'bspimePimVirtualNeighborIfIndex'), (0, 'BAY-STACK-PIM-EXT-MIB', 'bspimePimVirtualNeighborAddress'))
if mibBuilder.loadTexts:
bspimePimVirtualNeighborEntry.setStatus('current')
if mibBuilder.loadTexts:
bspimePimVirtualNeighborEntry.setDescription('A PIM virtual neighbor.')
bspime_pim_virtual_neighbor_if_index = mib_table_column((1, 3, 6, 1, 4, 1, 45, 5, 27, 1, 2, 1, 1), interface_index())
if mibBuilder.loadTexts:
bspimePimVirtualNeighborIfIndex.setStatus('current')
if mibBuilder.loadTexts:
bspimePimVirtualNeighborIfIndex.setDescription('IP address of the interface of the virtual neighbor.')
bspime_pim_virtual_neighbor_address = mib_table_column((1, 3, 6, 1, 4, 1, 45, 5, 27, 1, 2, 1, 2), ip_address())
if mibBuilder.loadTexts:
bspimePimVirtualNeighborAddress.setStatus('current')
if mibBuilder.loadTexts:
bspimePimVirtualNeighborAddress.setDescription('IP address of the virtual neighbor.')
bspime_pim_virtual_neighbor_row_status = mib_table_column((1, 3, 6, 1, 4, 1, 45, 5, 27, 1, 2, 1, 3), row_status()).setMaxAccess('readcreate')
if mibBuilder.loadTexts:
bspimePimVirtualNeighborRowStatus.setStatus('current')
if mibBuilder.loadTexts:
bspimePimVirtualNeighborRowStatus.setDescription('Used to create/delete virtual neighbors.')
bspime_pim_group_active_rp_mapping_table = mib_table((1, 3, 6, 1, 4, 1, 45, 5, 27, 1, 3))
if mibBuilder.loadTexts:
bspimePimGroupActiveRPMappingTable.setStatus('current')
if mibBuilder.loadTexts:
bspimePimGroupActiveRPMappingTable.setDescription('PIM Group -> Active RP Mapping table.')
bspime_pim_group_active_rp_mapping_entry = mib_table_row((1, 3, 6, 1, 4, 1, 45, 5, 27, 1, 3, 1)).setIndexNames((0, 'BAY-STACK-PIM-EXT-MIB', 'bspimePimGroupActiveRPMappingGroupAddress'), (0, 'BAY-STACK-PIM-EXT-MIB', 'bspimePimGroupActiveRPMappingGroupMask'), (0, 'BAY-STACK-PIM-EXT-MIB', 'bspimePimGroupActiveRPMappingActiveRP'))
if mibBuilder.loadTexts:
bspimePimGroupActiveRPMappingEntry.setStatus('current')
if mibBuilder.loadTexts:
bspimePimGroupActiveRPMappingEntry.setDescription('A mapping of a group to its active RP.')
bspime_pim_group_active_rp_mapping_group_address = mib_table_column((1, 3, 6, 1, 4, 1, 45, 5, 27, 1, 3, 1, 1), ip_address())
if mibBuilder.loadTexts:
bspimePimGroupActiveRPMappingGroupAddress.setStatus('current')
if mibBuilder.loadTexts:
bspimePimGroupActiveRPMappingGroupAddress.setDescription('Group address.')
bspime_pim_group_active_rp_mapping_group_mask = mib_table_column((1, 3, 6, 1, 4, 1, 45, 5, 27, 1, 3, 1, 2), ip_address())
if mibBuilder.loadTexts:
bspimePimGroupActiveRPMappingGroupMask.setStatus('current')
if mibBuilder.loadTexts:
bspimePimGroupActiveRPMappingGroupMask.setDescription('Group mask.')
bspime_pim_group_active_rp_mapping_active_rp = mib_table_column((1, 3, 6, 1, 4, 1, 45, 5, 27, 1, 3, 1, 3), ip_address())
if mibBuilder.loadTexts:
bspimePimGroupActiveRPMappingActiveRP.setStatus('current')
if mibBuilder.loadTexts:
bspimePimGroupActiveRPMappingActiveRP.setDescription('IP address of the active RP.')
bspime_pim_group_active_rp_mapping_priority = mib_table_column((1, 3, 6, 1, 4, 1, 45, 5, 27, 1, 3, 1, 4), integer32().subtype(subtypeSpec=value_range_constraint(0, 2147483647))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
bspimePimGroupActiveRPMappingPriority.setStatus('current')
if mibBuilder.loadTexts:
bspimePimGroupActiveRPMappingPriority.setDescription('Priority of the active RP.')
bspime_notif_neighbor_status = mib_scalar((1, 3, 6, 1, 4, 1, 45, 5, 27, 2, 1), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('up', 1), ('down', 2)))).setMaxAccess('accessiblefornotify')
if mibBuilder.loadTexts:
bspimeNotifNeighborStatus.setStatus('current')
if mibBuilder.loadTexts:
bspimeNotifNeighborStatus.setDescription('When a neighbor PIM interface changes state, this indicates whether the new state is up or down.')
bspime_neighbor_state_changed = notification_type((1, 3, 6, 1, 4, 1, 45, 5, 27, 0, 1)).setObjects(('BAY-STACK-PIM-EXT-MIB', 'rcPimNeighborIfIndex'), ('BAY-STACK-PIM-EXT-MIB', 'bspimeNotifNeighborStatus'))
if mibBuilder.loadTexts:
bspimeNeighborStateChanged.setStatus('current')
if mibBuilder.loadTexts:
bspimeNeighborStateChanged.setDescription("A bspimeNeighborChange notification signifies a change of state of an adjacency with a neighbor. This notification should be generated when the router's PIM interface is disabled or enabled, or when a router's PIM neighbor adjacency expires or is established.")
mibBuilder.exportSymbols('BAY-STACK-PIM-EXT-MIB', bspimePimVirtualNeighborAddress=bspimePimVirtualNeighborAddress, bspimeScalars=bspimeScalars, bspimePimGroupActiveRPMappingPriority=bspimePimGroupActiveRPMappingPriority, bspimeNotificationObjects=bspimeNotificationObjects, bspimePimGroupActiveRPMappingActiveRP=bspimePimGroupActiveRPMappingActiveRP, bspimeNotifNeighborStatus=bspimeNotifNeighborStatus, bspimeNotifications=bspimeNotifications, bspimeNeighborStateChanged=bspimeNeighborStateChanged, bspimePimGroupActiveRPMappingTable=bspimePimGroupActiveRPMappingTable, bayStackPimExtMib=bayStackPimExtMib, bspimePimGroupActiveRPMappingGroupAddress=bspimePimGroupActiveRPMappingGroupAddress, bspimePimVirtualNeighborTable=bspimePimVirtualNeighborTable, bspimePimVirtualNeighborIfIndex=bspimePimVirtualNeighborIfIndex, bspimePimGroupActiveRPMappingEntry=bspimePimGroupActiveRPMappingEntry, PYSNMP_MODULE_ID=bayStackPimExtMib, bspimePimGroupActiveRPMappingGroupMask=bspimePimGroupActiveRPMappingGroupMask, bspimePimVirtualNeighborEntry=bspimePimVirtualNeighborEntry, bspimePimVirtualNeighborRowStatus=bspimePimVirtualNeighborRowStatus, bspimeObjects=bspimeObjects) |
#
# PySNMP MIB module Nortel-Magellan-Passport-FrameRelayUniTraceMIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/Nortel-Magellan-Passport-FrameRelayUniTraceMIB
# Produced by pysmi-0.3.4 at Wed May 1 14:27:22 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 (default, Mar 27 2019, 09:23:15)
#
OctetString, ObjectIdentifier, Integer = mibBuilder.importSymbols("ASN1", "OctetString", "ObjectIdentifier", "Integer")
NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues")
ConstraintsUnion, ConstraintsIntersection, ValueSizeConstraint, SingleValueConstraint, ValueRangeConstraint = mibBuilder.importSymbols("ASN1-REFINEMENT", "ConstraintsUnion", "ConstraintsIntersection", "ValueSizeConstraint", "SingleValueConstraint", "ValueRangeConstraint")
frUniIndex, frUni = mibBuilder.importSymbols("Nortel-Magellan-Passport-FrameRelayUniMIB", "frUniIndex", "frUni")
Unsigned32, StorageType, RowPointer, DisplayString, RowStatus = mibBuilder.importSymbols("Nortel-Magellan-Passport-StandardTextualConventionsMIB", "Unsigned32", "StorageType", "RowPointer", "DisplayString", "RowStatus")
NonReplicated, AsciiString = mibBuilder.importSymbols("Nortel-Magellan-Passport-TextualConventionsMIB", "NonReplicated", "AsciiString")
passportMIBs, = mibBuilder.importSymbols("Nortel-Magellan-Passport-UsefulDefinitionsMIB", "passportMIBs")
ModuleCompliance, NotificationGroup = mibBuilder.importSymbols("SNMPv2-CONF", "ModuleCompliance", "NotificationGroup")
iso, Counter64, Gauge32, Unsigned32, IpAddress, NotificationType, Integer32, MibIdentifier, MibScalar, MibTable, MibTableRow, MibTableColumn, Bits, TimeTicks, ModuleIdentity, Counter32, ObjectIdentity = mibBuilder.importSymbols("SNMPv2-SMI", "iso", "Counter64", "Gauge32", "Unsigned32", "IpAddress", "NotificationType", "Integer32", "MibIdentifier", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "Bits", "TimeTicks", "ModuleIdentity", "Counter32", "ObjectIdentity")
DisplayString, TextualConvention = mibBuilder.importSymbols("SNMPv2-TC", "DisplayString", "TextualConvention")
frameRelayUniTraceMIB = MibIdentifier((1, 3, 6, 1, 4, 1, 562, 2, 4, 2, 105))
frUniTrace = MibIdentifier((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 71, 7))
frUniTraceRowStatusTable = MibTable((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 71, 7, 1), )
if mibBuilder.loadTexts: frUniTraceRowStatusTable.setStatus('mandatory')
if mibBuilder.loadTexts: frUniTraceRowStatusTable.setDescription('This entry controls the addition and deletion of frUniTrace components.')
frUniTraceRowStatusEntry = MibTableRow((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 71, 7, 1, 1), ).setIndexNames((0, "Nortel-Magellan-Passport-FrameRelayUniMIB", "frUniIndex"), (0, "Nortel-Magellan-Passport-FrameRelayUniTraceMIB", "frUniTraceIndex"))
if mibBuilder.loadTexts: frUniTraceRowStatusEntry.setStatus('mandatory')
if mibBuilder.loadTexts: frUniTraceRowStatusEntry.setDescription('A single entry in the table represents a single frUniTrace component.')
frUniTraceRowStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 71, 7, 1, 1, 1), RowStatus()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: frUniTraceRowStatus.setStatus('mandatory')
if mibBuilder.loadTexts: frUniTraceRowStatus.setDescription('This variable is used as the basis for SNMP naming of frUniTrace components. These components can be added and deleted.')
frUniTraceComponentName = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 71, 7, 1, 1, 2), DisplayString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: frUniTraceComponentName.setStatus('mandatory')
if mibBuilder.loadTexts: frUniTraceComponentName.setDescription("This variable provides the component's string name for use with the ASCII Console Interface")
frUniTraceStorageType = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 71, 7, 1, 1, 4), StorageType()).setMaxAccess("readonly")
if mibBuilder.loadTexts: frUniTraceStorageType.setStatus('mandatory')
if mibBuilder.loadTexts: frUniTraceStorageType.setDescription('This variable represents the storage type value for the frUniTrace tables.')
frUniTraceIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 71, 7, 1, 1, 10), NonReplicated())
if mibBuilder.loadTexts: frUniTraceIndex.setStatus('mandatory')
if mibBuilder.loadTexts: frUniTraceIndex.setDescription('This variable represents the index for the frUniTrace tables.')
frUniTraceOperationalTable = MibTable((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 71, 7, 10), )
if mibBuilder.loadTexts: frUniTraceOperationalTable.setStatus('mandatory')
if mibBuilder.loadTexts: frUniTraceOperationalTable.setDescription('This group provides the operational attributes for the Trace component.')
frUniTraceOperationalEntry = MibTableRow((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 71, 7, 10, 1), ).setIndexNames((0, "Nortel-Magellan-Passport-FrameRelayUniMIB", "frUniIndex"), (0, "Nortel-Magellan-Passport-FrameRelayUniTraceMIB", "frUniTraceIndex"))
if mibBuilder.loadTexts: frUniTraceOperationalEntry.setStatus('mandatory')
if mibBuilder.loadTexts: frUniTraceOperationalEntry.setDescription('An entry in the frUniTraceOperationalTable.')
frUniTraceReceiverName = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 71, 7, 10, 1, 2), AsciiString().subtype(subtypeSpec=ValueSizeConstraint(0, 8))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: frUniTraceReceiverName.setStatus('mandatory')
if mibBuilder.loadTexts: frUniTraceReceiverName.setDescription('This attribute should be set to the name of the desired trace receiver before starting a trace session. All available trace receivers are listed under the Trace Rcvr/<string> component. This attribute cannot be set while a trace is active.')
frUniTraceDuration = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 71, 7, 10, 1, 3), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(0, 9999)).clone(60)).setMaxAccess("readwrite")
if mibBuilder.loadTexts: frUniTraceDuration.setStatus('mandatory')
if mibBuilder.loadTexts: frUniTraceDuration.setDescription('This attribute specifies the duration, in minutes, of a trace session. A value of 0 indicates unlimited duration in which case a trace session remains active until a stop command is issued. The default duration is 60 minutes. This attribute cannot be set while a trace is active.')
frUniTraceQueueLimit = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 71, 7, 10, 1, 4), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(1, 100)).clone(20)).setMaxAccess("readwrite")
if mibBuilder.loadTexts: frUniTraceQueueLimit.setStatus('mandatory')
if mibBuilder.loadTexts: frUniTraceQueueLimit.setDescription('This attribute specifies the total number of bytes of traced data which may be queued for transmission to the trace receiver. When this limit is exceeded, incoming traced frames are discarded. This attribute can be set while a trace is active and takes effect immediately.')
frUniTraceSession = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 71, 7, 10, 1, 5), RowPointer()).setMaxAccess("readonly")
if mibBuilder.loadTexts: frUniTraceSession.setStatus('mandatory')
if mibBuilder.loadTexts: frUniTraceSession.setDescription('This attribute is set automatically. It identifies the Trace Session component which is forwarding the trace data. This attribute is empty unless a trace is active.')
frUniTraceFilter = MibIdentifier((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 71, 7, 2))
frUniTraceFilterRowStatusTable = MibTable((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 71, 7, 2, 1), )
if mibBuilder.loadTexts: frUniTraceFilterRowStatusTable.setStatus('mandatory')
if mibBuilder.loadTexts: frUniTraceFilterRowStatusTable.setDescription('This entry controls the addition and deletion of frUniTraceFilter components.')
frUniTraceFilterRowStatusEntry = MibTableRow((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 71, 7, 2, 1, 1), ).setIndexNames((0, "Nortel-Magellan-Passport-FrameRelayUniMIB", "frUniIndex"), (0, "Nortel-Magellan-Passport-FrameRelayUniTraceMIB", "frUniTraceIndex"), (0, "Nortel-Magellan-Passport-FrameRelayUniTraceMIB", "frUniTraceFilterIndex"))
if mibBuilder.loadTexts: frUniTraceFilterRowStatusEntry.setStatus('mandatory')
if mibBuilder.loadTexts: frUniTraceFilterRowStatusEntry.setDescription('A single entry in the table represents a single frUniTraceFilter component.')
frUniTraceFilterRowStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 71, 7, 2, 1, 1, 1), RowStatus()).setMaxAccess("readonly")
if mibBuilder.loadTexts: frUniTraceFilterRowStatus.setStatus('mandatory')
if mibBuilder.loadTexts: frUniTraceFilterRowStatus.setDescription('This variable is used as the basis for SNMP naming of frUniTraceFilter components. These components cannot be added nor deleted.')
frUniTraceFilterComponentName = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 71, 7, 2, 1, 1, 2), DisplayString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: frUniTraceFilterComponentName.setStatus('mandatory')
if mibBuilder.loadTexts: frUniTraceFilterComponentName.setDescription("This variable provides the component's string name for use with the ASCII Console Interface")
frUniTraceFilterStorageType = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 71, 7, 2, 1, 1, 4), StorageType()).setMaxAccess("readonly")
if mibBuilder.loadTexts: frUniTraceFilterStorageType.setStatus('mandatory')
if mibBuilder.loadTexts: frUniTraceFilterStorageType.setDescription('This variable represents the storage type value for the frUniTraceFilter tables.')
frUniTraceFilterIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 71, 7, 2, 1, 1, 10), NonReplicated())
if mibBuilder.loadTexts: frUniTraceFilterIndex.setStatus('mandatory')
if mibBuilder.loadTexts: frUniTraceFilterIndex.setDescription('This variable represents the index for the frUniTraceFilter tables.')
frUniTraceFilterOperationalTable = MibTable((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 71, 7, 2, 10), )
if mibBuilder.loadTexts: frUniTraceFilterOperationalTable.setStatus('mandatory')
if mibBuilder.loadTexts: frUniTraceFilterOperationalTable.setDescription('This group provides the operational attributes for the Frame Relay Trace Filter component.')
frUniTraceFilterOperationalEntry = MibTableRow((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 71, 7, 2, 10, 1), ).setIndexNames((0, "Nortel-Magellan-Passport-FrameRelayUniMIB", "frUniIndex"), (0, "Nortel-Magellan-Passport-FrameRelayUniTraceMIB", "frUniTraceIndex"), (0, "Nortel-Magellan-Passport-FrameRelayUniTraceMIB", "frUniTraceFilterIndex"))
if mibBuilder.loadTexts: frUniTraceFilterOperationalEntry.setStatus('mandatory')
if mibBuilder.loadTexts: frUniTraceFilterOperationalEntry.setDescription('An entry in the frUniTraceFilterOperationalTable.')
frUniTraceFilterTraceType = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 71, 7, 2, 10, 1, 1), OctetString().subtype(subtypeSpec=ValueSizeConstraint(1, 1)).setFixedLength(1).clone(hexValue="e0")).setMaxAccess("readwrite")
if mibBuilder.loadTexts: frUniTraceFilterTraceType.setStatus('mandatory')
if mibBuilder.loadTexts: frUniTraceFilterTraceType.setDescription('This attribute specifies the level of filtering required for this trace session. A value of lmi indicates that Lmi frames are traced. A value of dlci indicates that frames from the Dlci specified by the tracedDlci attribute are traced. A value of badFrames indicates that bad received frames (overruns, CRC errors, aborts) are traced. The default is to trace all frames. This attribute can be set while a trace is active and takes effect immediately. Description of bits: lmi(0) dlci(1) badFrames(2)')
frUniTraceFilterTracedDlci = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 71, 7, 2, 10, 1, 2), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(0, 1007))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: frUniTraceFilterTracedDlci.setStatus('mandatory')
if mibBuilder.loadTexts: frUniTraceFilterTracedDlci.setDescription('This attribute specifies a particular Dlci to trace. A value of zero specifies that all Dlcis are to be traced. This attribute can be set while a trace is active and takes effect immediately.')
frUniTraceFilterDirection = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 71, 7, 2, 10, 1, 3), OctetString().subtype(subtypeSpec=ValueSizeConstraint(1, 1)).setFixedLength(1).clone(hexValue="c0")).setMaxAccess("readwrite")
if mibBuilder.loadTexts: frUniTraceFilterDirection.setStatus('mandatory')
if mibBuilder.loadTexts: frUniTraceFilterDirection.setDescription('This attribute specifies the direction of the data to be traced as viewed by the service. The values can be egress, and/or ingress. An egress value indicates frames outbound from the service. An ingress value indicates frames inbound to the service. This attribute can be set while a trace is active and takes effect immediately. Description of bits: egress(0) ingress(1)')
frUniTraceFilterTracedLength = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 71, 7, 2, 10, 1, 4), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(1, 2000)).clone(2000)).setMaxAccess("readwrite")
if mibBuilder.loadTexts: frUniTraceFilterTracedLength.setStatus('mandatory')
if mibBuilder.loadTexts: frUniTraceFilterTracedLength.setDescription('This attribute specifies the maximum number of bytes to trace per frame starting from the byte following the frame flag. If the frame length is longer than the value specified by this attribute, then the traced frame is truncated. This attribute can be set while a trace is active and takes effect immediately.')
frameRelayUniTraceGroup = MibIdentifier((1, 3, 6, 1, 4, 1, 562, 2, 4, 2, 105, 1))
frameRelayUniTraceGroupBD = MibIdentifier((1, 3, 6, 1, 4, 1, 562, 2, 4, 2, 105, 1, 4))
frameRelayUniTraceGroupBD01 = MibIdentifier((1, 3, 6, 1, 4, 1, 562, 2, 4, 2, 105, 1, 4, 2))
frameRelayUniTraceGroupBD01A = MibIdentifier((1, 3, 6, 1, 4, 1, 562, 2, 4, 2, 105, 1, 4, 2, 2))
frameRelayUniTraceCapabilities = MibIdentifier((1, 3, 6, 1, 4, 1, 562, 2, 4, 2, 105, 3))
frameRelayUniTraceCapabilitiesBD = MibIdentifier((1, 3, 6, 1, 4, 1, 562, 2, 4, 2, 105, 3, 4))
frameRelayUniTraceCapabilitiesBD01 = MibIdentifier((1, 3, 6, 1, 4, 1, 562, 2, 4, 2, 105, 3, 4, 2))
frameRelayUniTraceCapabilitiesBD01A = MibIdentifier((1, 3, 6, 1, 4, 1, 562, 2, 4, 2, 105, 3, 4, 2, 2))
mibBuilder.exportSymbols("Nortel-Magellan-Passport-FrameRelayUniTraceMIB", frUniTraceFilterOperationalTable=frUniTraceFilterOperationalTable, frameRelayUniTraceGroup=frameRelayUniTraceGroup, frameRelayUniTraceCapabilitiesBD01A=frameRelayUniTraceCapabilitiesBD01A, frUniTraceIndex=frUniTraceIndex, frUniTraceRowStatusTable=frUniTraceRowStatusTable, frUniTraceFilterTracedDlci=frUniTraceFilterTracedDlci, frameRelayUniTraceCapabilitiesBD=frameRelayUniTraceCapabilitiesBD, frUniTraceFilterComponentName=frUniTraceFilterComponentName, frUniTraceReceiverName=frUniTraceReceiverName, frUniTraceRowStatusEntry=frUniTraceRowStatusEntry, frameRelayUniTraceCapabilitiesBD01=frameRelayUniTraceCapabilitiesBD01, frUniTraceFilter=frUniTraceFilter, frUniTraceFilterStorageType=frUniTraceFilterStorageType, frUniTraceStorageType=frUniTraceStorageType, frUniTraceFilterRowStatusEntry=frUniTraceFilterRowStatusEntry, frameRelayUniTraceGroupBD01=frameRelayUniTraceGroupBD01, frUniTraceOperationalEntry=frUniTraceOperationalEntry, frUniTraceFilterRowStatusTable=frUniTraceFilterRowStatusTable, frUniTraceOperationalTable=frUniTraceOperationalTable, frameRelayUniTraceGroupBD01A=frameRelayUniTraceGroupBD01A, frUniTraceDuration=frUniTraceDuration, frUniTraceFilterTracedLength=frUniTraceFilterTracedLength, frUniTraceFilterTraceType=frUniTraceFilterTraceType, frameRelayUniTraceCapabilities=frameRelayUniTraceCapabilities, frUniTraceSession=frUniTraceSession, frameRelayUniTraceGroupBD=frameRelayUniTraceGroupBD, frUniTraceFilterIndex=frUniTraceFilterIndex, frameRelayUniTraceMIB=frameRelayUniTraceMIB, frUniTraceComponentName=frUniTraceComponentName, frUniTrace=frUniTrace, frUniTraceQueueLimit=frUniTraceQueueLimit, frUniTraceFilterRowStatus=frUniTraceFilterRowStatus, frUniTraceFilterOperationalEntry=frUniTraceFilterOperationalEntry, frUniTraceRowStatus=frUniTraceRowStatus, frUniTraceFilterDirection=frUniTraceFilterDirection)
| (octet_string, object_identifier, integer) = mibBuilder.importSymbols('ASN1', 'OctetString', 'ObjectIdentifier', 'Integer')
(named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues')
(constraints_union, constraints_intersection, value_size_constraint, single_value_constraint, value_range_constraint) = mibBuilder.importSymbols('ASN1-REFINEMENT', 'ConstraintsUnion', 'ConstraintsIntersection', 'ValueSizeConstraint', 'SingleValueConstraint', 'ValueRangeConstraint')
(fr_uni_index, fr_uni) = mibBuilder.importSymbols('Nortel-Magellan-Passport-FrameRelayUniMIB', 'frUniIndex', 'frUni')
(unsigned32, storage_type, row_pointer, display_string, row_status) = mibBuilder.importSymbols('Nortel-Magellan-Passport-StandardTextualConventionsMIB', 'Unsigned32', 'StorageType', 'RowPointer', 'DisplayString', 'RowStatus')
(non_replicated, ascii_string) = mibBuilder.importSymbols('Nortel-Magellan-Passport-TextualConventionsMIB', 'NonReplicated', 'AsciiString')
(passport_mi_bs,) = mibBuilder.importSymbols('Nortel-Magellan-Passport-UsefulDefinitionsMIB', 'passportMIBs')
(module_compliance, notification_group) = mibBuilder.importSymbols('SNMPv2-CONF', 'ModuleCompliance', 'NotificationGroup')
(iso, counter64, gauge32, unsigned32, ip_address, notification_type, integer32, mib_identifier, mib_scalar, mib_table, mib_table_row, mib_table_column, bits, time_ticks, module_identity, counter32, object_identity) = mibBuilder.importSymbols('SNMPv2-SMI', 'iso', 'Counter64', 'Gauge32', 'Unsigned32', 'IpAddress', 'NotificationType', 'Integer32', 'MibIdentifier', 'MibScalar', 'MibTable', 'MibTableRow', 'MibTableColumn', 'Bits', 'TimeTicks', 'ModuleIdentity', 'Counter32', 'ObjectIdentity')
(display_string, textual_convention) = mibBuilder.importSymbols('SNMPv2-TC', 'DisplayString', 'TextualConvention')
frame_relay_uni_trace_mib = mib_identifier((1, 3, 6, 1, 4, 1, 562, 2, 4, 2, 105))
fr_uni_trace = mib_identifier((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 71, 7))
fr_uni_trace_row_status_table = mib_table((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 71, 7, 1))
if mibBuilder.loadTexts:
frUniTraceRowStatusTable.setStatus('mandatory')
if mibBuilder.loadTexts:
frUniTraceRowStatusTable.setDescription('This entry controls the addition and deletion of frUniTrace components.')
fr_uni_trace_row_status_entry = mib_table_row((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 71, 7, 1, 1)).setIndexNames((0, 'Nortel-Magellan-Passport-FrameRelayUniMIB', 'frUniIndex'), (0, 'Nortel-Magellan-Passport-FrameRelayUniTraceMIB', 'frUniTraceIndex'))
if mibBuilder.loadTexts:
frUniTraceRowStatusEntry.setStatus('mandatory')
if mibBuilder.loadTexts:
frUniTraceRowStatusEntry.setDescription('A single entry in the table represents a single frUniTrace component.')
fr_uni_trace_row_status = mib_table_column((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 71, 7, 1, 1, 1), row_status()).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
frUniTraceRowStatus.setStatus('mandatory')
if mibBuilder.loadTexts:
frUniTraceRowStatus.setDescription('This variable is used as the basis for SNMP naming of frUniTrace components. These components can be added and deleted.')
fr_uni_trace_component_name = mib_table_column((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 71, 7, 1, 1, 2), display_string()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
frUniTraceComponentName.setStatus('mandatory')
if mibBuilder.loadTexts:
frUniTraceComponentName.setDescription("This variable provides the component's string name for use with the ASCII Console Interface")
fr_uni_trace_storage_type = mib_table_column((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 71, 7, 1, 1, 4), storage_type()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
frUniTraceStorageType.setStatus('mandatory')
if mibBuilder.loadTexts:
frUniTraceStorageType.setDescription('This variable represents the storage type value for the frUniTrace tables.')
fr_uni_trace_index = mib_table_column((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 71, 7, 1, 1, 10), non_replicated())
if mibBuilder.loadTexts:
frUniTraceIndex.setStatus('mandatory')
if mibBuilder.loadTexts:
frUniTraceIndex.setDescription('This variable represents the index for the frUniTrace tables.')
fr_uni_trace_operational_table = mib_table((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 71, 7, 10))
if mibBuilder.loadTexts:
frUniTraceOperationalTable.setStatus('mandatory')
if mibBuilder.loadTexts:
frUniTraceOperationalTable.setDescription('This group provides the operational attributes for the Trace component.')
fr_uni_trace_operational_entry = mib_table_row((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 71, 7, 10, 1)).setIndexNames((0, 'Nortel-Magellan-Passport-FrameRelayUniMIB', 'frUniIndex'), (0, 'Nortel-Magellan-Passport-FrameRelayUniTraceMIB', 'frUniTraceIndex'))
if mibBuilder.loadTexts:
frUniTraceOperationalEntry.setStatus('mandatory')
if mibBuilder.loadTexts:
frUniTraceOperationalEntry.setDescription('An entry in the frUniTraceOperationalTable.')
fr_uni_trace_receiver_name = mib_table_column((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 71, 7, 10, 1, 2), ascii_string().subtype(subtypeSpec=value_size_constraint(0, 8))).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
frUniTraceReceiverName.setStatus('mandatory')
if mibBuilder.loadTexts:
frUniTraceReceiverName.setDescription('This attribute should be set to the name of the desired trace receiver before starting a trace session. All available trace receivers are listed under the Trace Rcvr/<string> component. This attribute cannot be set while a trace is active.')
fr_uni_trace_duration = mib_table_column((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 71, 7, 10, 1, 3), unsigned32().subtype(subtypeSpec=value_range_constraint(0, 9999)).clone(60)).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
frUniTraceDuration.setStatus('mandatory')
if mibBuilder.loadTexts:
frUniTraceDuration.setDescription('This attribute specifies the duration, in minutes, of a trace session. A value of 0 indicates unlimited duration in which case a trace session remains active until a stop command is issued. The default duration is 60 minutes. This attribute cannot be set while a trace is active.')
fr_uni_trace_queue_limit = mib_table_column((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 71, 7, 10, 1, 4), unsigned32().subtype(subtypeSpec=value_range_constraint(1, 100)).clone(20)).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
frUniTraceQueueLimit.setStatus('mandatory')
if mibBuilder.loadTexts:
frUniTraceQueueLimit.setDescription('This attribute specifies the total number of bytes of traced data which may be queued for transmission to the trace receiver. When this limit is exceeded, incoming traced frames are discarded. This attribute can be set while a trace is active and takes effect immediately.')
fr_uni_trace_session = mib_table_column((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 71, 7, 10, 1, 5), row_pointer()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
frUniTraceSession.setStatus('mandatory')
if mibBuilder.loadTexts:
frUniTraceSession.setDescription('This attribute is set automatically. It identifies the Trace Session component which is forwarding the trace data. This attribute is empty unless a trace is active.')
fr_uni_trace_filter = mib_identifier((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 71, 7, 2))
fr_uni_trace_filter_row_status_table = mib_table((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 71, 7, 2, 1))
if mibBuilder.loadTexts:
frUniTraceFilterRowStatusTable.setStatus('mandatory')
if mibBuilder.loadTexts:
frUniTraceFilterRowStatusTable.setDescription('This entry controls the addition and deletion of frUniTraceFilter components.')
fr_uni_trace_filter_row_status_entry = mib_table_row((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 71, 7, 2, 1, 1)).setIndexNames((0, 'Nortel-Magellan-Passport-FrameRelayUniMIB', 'frUniIndex'), (0, 'Nortel-Magellan-Passport-FrameRelayUniTraceMIB', 'frUniTraceIndex'), (0, 'Nortel-Magellan-Passport-FrameRelayUniTraceMIB', 'frUniTraceFilterIndex'))
if mibBuilder.loadTexts:
frUniTraceFilterRowStatusEntry.setStatus('mandatory')
if mibBuilder.loadTexts:
frUniTraceFilterRowStatusEntry.setDescription('A single entry in the table represents a single frUniTraceFilter component.')
fr_uni_trace_filter_row_status = mib_table_column((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 71, 7, 2, 1, 1, 1), row_status()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
frUniTraceFilterRowStatus.setStatus('mandatory')
if mibBuilder.loadTexts:
frUniTraceFilterRowStatus.setDescription('This variable is used as the basis for SNMP naming of frUniTraceFilter components. These components cannot be added nor deleted.')
fr_uni_trace_filter_component_name = mib_table_column((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 71, 7, 2, 1, 1, 2), display_string()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
frUniTraceFilterComponentName.setStatus('mandatory')
if mibBuilder.loadTexts:
frUniTraceFilterComponentName.setDescription("This variable provides the component's string name for use with the ASCII Console Interface")
fr_uni_trace_filter_storage_type = mib_table_column((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 71, 7, 2, 1, 1, 4), storage_type()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
frUniTraceFilterStorageType.setStatus('mandatory')
if mibBuilder.loadTexts:
frUniTraceFilterStorageType.setDescription('This variable represents the storage type value for the frUniTraceFilter tables.')
fr_uni_trace_filter_index = mib_table_column((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 71, 7, 2, 1, 1, 10), non_replicated())
if mibBuilder.loadTexts:
frUniTraceFilterIndex.setStatus('mandatory')
if mibBuilder.loadTexts:
frUniTraceFilterIndex.setDescription('This variable represents the index for the frUniTraceFilter tables.')
fr_uni_trace_filter_operational_table = mib_table((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 71, 7, 2, 10))
if mibBuilder.loadTexts:
frUniTraceFilterOperationalTable.setStatus('mandatory')
if mibBuilder.loadTexts:
frUniTraceFilterOperationalTable.setDescription('This group provides the operational attributes for the Frame Relay Trace Filter component.')
fr_uni_trace_filter_operational_entry = mib_table_row((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 71, 7, 2, 10, 1)).setIndexNames((0, 'Nortel-Magellan-Passport-FrameRelayUniMIB', 'frUniIndex'), (0, 'Nortel-Magellan-Passport-FrameRelayUniTraceMIB', 'frUniTraceIndex'), (0, 'Nortel-Magellan-Passport-FrameRelayUniTraceMIB', 'frUniTraceFilterIndex'))
if mibBuilder.loadTexts:
frUniTraceFilterOperationalEntry.setStatus('mandatory')
if mibBuilder.loadTexts:
frUniTraceFilterOperationalEntry.setDescription('An entry in the frUniTraceFilterOperationalTable.')
fr_uni_trace_filter_trace_type = mib_table_column((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 71, 7, 2, 10, 1, 1), octet_string().subtype(subtypeSpec=value_size_constraint(1, 1)).setFixedLength(1).clone(hexValue='e0')).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
frUniTraceFilterTraceType.setStatus('mandatory')
if mibBuilder.loadTexts:
frUniTraceFilterTraceType.setDescription('This attribute specifies the level of filtering required for this trace session. A value of lmi indicates that Lmi frames are traced. A value of dlci indicates that frames from the Dlci specified by the tracedDlci attribute are traced. A value of badFrames indicates that bad received frames (overruns, CRC errors, aborts) are traced. The default is to trace all frames. This attribute can be set while a trace is active and takes effect immediately. Description of bits: lmi(0) dlci(1) badFrames(2)')
fr_uni_trace_filter_traced_dlci = mib_table_column((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 71, 7, 2, 10, 1, 2), unsigned32().subtype(subtypeSpec=value_range_constraint(0, 1007))).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
frUniTraceFilterTracedDlci.setStatus('mandatory')
if mibBuilder.loadTexts:
frUniTraceFilterTracedDlci.setDescription('This attribute specifies a particular Dlci to trace. A value of zero specifies that all Dlcis are to be traced. This attribute can be set while a trace is active and takes effect immediately.')
fr_uni_trace_filter_direction = mib_table_column((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 71, 7, 2, 10, 1, 3), octet_string().subtype(subtypeSpec=value_size_constraint(1, 1)).setFixedLength(1).clone(hexValue='c0')).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
frUniTraceFilterDirection.setStatus('mandatory')
if mibBuilder.loadTexts:
frUniTraceFilterDirection.setDescription('This attribute specifies the direction of the data to be traced as viewed by the service. The values can be egress, and/or ingress. An egress value indicates frames outbound from the service. An ingress value indicates frames inbound to the service. This attribute can be set while a trace is active and takes effect immediately. Description of bits: egress(0) ingress(1)')
fr_uni_trace_filter_traced_length = mib_table_column((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 71, 7, 2, 10, 1, 4), unsigned32().subtype(subtypeSpec=value_range_constraint(1, 2000)).clone(2000)).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
frUniTraceFilterTracedLength.setStatus('mandatory')
if mibBuilder.loadTexts:
frUniTraceFilterTracedLength.setDescription('This attribute specifies the maximum number of bytes to trace per frame starting from the byte following the frame flag. If the frame length is longer than the value specified by this attribute, then the traced frame is truncated. This attribute can be set while a trace is active and takes effect immediately.')
frame_relay_uni_trace_group = mib_identifier((1, 3, 6, 1, 4, 1, 562, 2, 4, 2, 105, 1))
frame_relay_uni_trace_group_bd = mib_identifier((1, 3, 6, 1, 4, 1, 562, 2, 4, 2, 105, 1, 4))
frame_relay_uni_trace_group_bd01 = mib_identifier((1, 3, 6, 1, 4, 1, 562, 2, 4, 2, 105, 1, 4, 2))
frame_relay_uni_trace_group_bd01_a = mib_identifier((1, 3, 6, 1, 4, 1, 562, 2, 4, 2, 105, 1, 4, 2, 2))
frame_relay_uni_trace_capabilities = mib_identifier((1, 3, 6, 1, 4, 1, 562, 2, 4, 2, 105, 3))
frame_relay_uni_trace_capabilities_bd = mib_identifier((1, 3, 6, 1, 4, 1, 562, 2, 4, 2, 105, 3, 4))
frame_relay_uni_trace_capabilities_bd01 = mib_identifier((1, 3, 6, 1, 4, 1, 562, 2, 4, 2, 105, 3, 4, 2))
frame_relay_uni_trace_capabilities_bd01_a = mib_identifier((1, 3, 6, 1, 4, 1, 562, 2, 4, 2, 105, 3, 4, 2, 2))
mibBuilder.exportSymbols('Nortel-Magellan-Passport-FrameRelayUniTraceMIB', frUniTraceFilterOperationalTable=frUniTraceFilterOperationalTable, frameRelayUniTraceGroup=frameRelayUniTraceGroup, frameRelayUniTraceCapabilitiesBD01A=frameRelayUniTraceCapabilitiesBD01A, frUniTraceIndex=frUniTraceIndex, frUniTraceRowStatusTable=frUniTraceRowStatusTable, frUniTraceFilterTracedDlci=frUniTraceFilterTracedDlci, frameRelayUniTraceCapabilitiesBD=frameRelayUniTraceCapabilitiesBD, frUniTraceFilterComponentName=frUniTraceFilterComponentName, frUniTraceReceiverName=frUniTraceReceiverName, frUniTraceRowStatusEntry=frUniTraceRowStatusEntry, frameRelayUniTraceCapabilitiesBD01=frameRelayUniTraceCapabilitiesBD01, frUniTraceFilter=frUniTraceFilter, frUniTraceFilterStorageType=frUniTraceFilterStorageType, frUniTraceStorageType=frUniTraceStorageType, frUniTraceFilterRowStatusEntry=frUniTraceFilterRowStatusEntry, frameRelayUniTraceGroupBD01=frameRelayUniTraceGroupBD01, frUniTraceOperationalEntry=frUniTraceOperationalEntry, frUniTraceFilterRowStatusTable=frUniTraceFilterRowStatusTable, frUniTraceOperationalTable=frUniTraceOperationalTable, frameRelayUniTraceGroupBD01A=frameRelayUniTraceGroupBD01A, frUniTraceDuration=frUniTraceDuration, frUniTraceFilterTracedLength=frUniTraceFilterTracedLength, frUniTraceFilterTraceType=frUniTraceFilterTraceType, frameRelayUniTraceCapabilities=frameRelayUniTraceCapabilities, frUniTraceSession=frUniTraceSession, frameRelayUniTraceGroupBD=frameRelayUniTraceGroupBD, frUniTraceFilterIndex=frUniTraceFilterIndex, frameRelayUniTraceMIB=frameRelayUniTraceMIB, frUniTraceComponentName=frUniTraceComponentName, frUniTrace=frUniTrace, frUniTraceQueueLimit=frUniTraceQueueLimit, frUniTraceFilterRowStatus=frUniTraceFilterRowStatus, frUniTraceFilterOperationalEntry=frUniTraceFilterOperationalEntry, frUniTraceRowStatus=frUniTraceRowStatus, frUniTraceFilterDirection=frUniTraceFilterDirection) |
with open("input.txt") as f:
lines = f.readlines()
split_lines = [x.split() for x in lines]
horiz = map(lambda x: int(x[1]) if x[0][0] == 'f' else -int(x[1]) if x[0][0] == 'b' else 0, split_lines)
vert = map(lambda x: int(x[1]) if x[0][0] == 'd' else -int(x[1]) if x[0][0] == 'u' else 0, split_lines)
print(sum(horiz)*sum(vert))
| with open('input.txt') as f:
lines = f.readlines()
split_lines = [x.split() for x in lines]
horiz = map(lambda x: int(x[1]) if x[0][0] == 'f' else -int(x[1]) if x[0][0] == 'b' else 0, split_lines)
vert = map(lambda x: int(x[1]) if x[0][0] == 'd' else -int(x[1]) if x[0][0] == 'u' else 0, split_lines)
print(sum(horiz) * sum(vert)) |
'''
Use this folder for the development of any
products. All data should be saved to S3.
'''
| """
Use this folder for the development of any
products. All data should be saved to S3.
""" |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.