content stringlengths 7 1.05M | fixed_cases stringlengths 1 1.28M |
|---|---|
"""
Created on 9 Oct 2012
@author: konmik
"""
class Connect(object):
"""represents connect tag"""
def __init__(self, node, converter):
self.gate = node.get("gate")
self.pin = node.get("pin")
self.pad = node.get("pad")
class Technology(object):
"""represents technology tag"""
def __init__(self, node, converter):
self.name = node.get("name")
class Device(object):
"""represents device tag"""
def __init__(self, node, converter):
self.connects = {}
self.name = node.get("name")
self.package = node.get("package")
self.fullName = self.name
self.technologies = []
technologies = node.find("technologies")
if technologies is not None:
for technology in technologies:
t = Technology(technology, converter)
self.technologies.append(t)
connects = node.find("connects")
if connects is not None:
for connect in connects:
c = Connect(connect, converter)
self.connects[c.pin] = c
def setFullName(self, prefix):
if prefix[-1:] == "*": #does set name has *
self.fullName = prefix[:-1] + self.name
else:
self.fullName = prefix + self.name
def getPadByPinName(self, name):
if self.connects.get(name) is not None:
return self.connects.get(name).pad
else:
return "NC"
class Gate(object):
"""represents gate tag, it is used when we may swap patrt o device"""
def __init__(self, node, converter):
self.name = node.get("name")
self.symbol = node.get("symbol")
self.x = node.get("x")
self.y = node.get("y")
#TODO: some attributes are ignored
def getSymbol(self):
return self.symbol
def getName(self):
return self.name
class Deviceset(object):
"""represents deviceset tag, it is used to mutch differnt packages to the same symbol"""
def __init__(self, node, converter):
self.gates = []
self.devices = []
self.name = node.get("name")
self.prefix = node.get("prefix")
gates = node.find("gates")
if gates != None:
for gate in gates:
g = Gate(gate, converter)
self.gates.append(g) # put to the dict. for faster access
devices = node.find("devices")
if devices != None:
for device in devices:
self.devices.append(Device(device, converter))
def isSymbolIncluded(self, symbol):
"""@return true if here is a gate for the symbol"""
return symbol in self.gates
def getDevices(self):
return self.devices
def getGates(self):
return self.gates
| """
Created on 9 Oct 2012
@author: konmik
"""
class Connect(object):
"""represents connect tag"""
def __init__(self, node, converter):
self.gate = node.get('gate')
self.pin = node.get('pin')
self.pad = node.get('pad')
class Technology(object):
"""represents technology tag"""
def __init__(self, node, converter):
self.name = node.get('name')
class Device(object):
"""represents device tag"""
def __init__(self, node, converter):
self.connects = {}
self.name = node.get('name')
self.package = node.get('package')
self.fullName = self.name
self.technologies = []
technologies = node.find('technologies')
if technologies is not None:
for technology in technologies:
t = technology(technology, converter)
self.technologies.append(t)
connects = node.find('connects')
if connects is not None:
for connect in connects:
c = connect(connect, converter)
self.connects[c.pin] = c
def set_full_name(self, prefix):
if prefix[-1:] == '*':
self.fullName = prefix[:-1] + self.name
else:
self.fullName = prefix + self.name
def get_pad_by_pin_name(self, name):
if self.connects.get(name) is not None:
return self.connects.get(name).pad
else:
return 'NC'
class Gate(object):
"""represents gate tag, it is used when we may swap patrt o device"""
def __init__(self, node, converter):
self.name = node.get('name')
self.symbol = node.get('symbol')
self.x = node.get('x')
self.y = node.get('y')
def get_symbol(self):
return self.symbol
def get_name(self):
return self.name
class Deviceset(object):
"""represents deviceset tag, it is used to mutch differnt packages to the same symbol"""
def __init__(self, node, converter):
self.gates = []
self.devices = []
self.name = node.get('name')
self.prefix = node.get('prefix')
gates = node.find('gates')
if gates != None:
for gate in gates:
g = gate(gate, converter)
self.gates.append(g)
devices = node.find('devices')
if devices != None:
for device in devices:
self.devices.append(device(device, converter))
def is_symbol_included(self, symbol):
"""@return true if here is a gate for the symbol"""
return symbol in self.gates
def get_devices(self):
return self.devices
def get_gates(self):
return self.gates |
# -*- coding: utf-8 -*-
"""
Created on Sun Mar 22 20:48:37 2020
@author: Ravi
"""
n,m = map(int,input().split(" "))
arr = [0]*n
for i in range(m):
mx = 0
a,b,k = map(int,input().split(" "))
for i in range(a,b+1):
arr[i-1]+=k
if arr[i-1]>mx:
mx =arr[i-1]
print(arr) | """
Created on Sun Mar 22 20:48:37 2020
@author: Ravi
"""
(n, m) = map(int, input().split(' '))
arr = [0] * n
for i in range(m):
mx = 0
(a, b, k) = map(int, input().split(' '))
for i in range(a, b + 1):
arr[i - 1] += k
if arr[i - 1] > mx:
mx = arr[i - 1]
print(arr) |
class Solution(object):
def superPow(self, a, b):
"""
:type a: int
:type b: List[int]
:rtype: int
"""
MODULI = 1337
if a == 0:
return 0
ans = 1
for n in b:
ans = pow(ans, 10, MODULI)
ans = (ans * pow(a, n, MODULI)) % MODULI
return ans
| class Solution(object):
def super_pow(self, a, b):
"""
:type a: int
:type b: List[int]
:rtype: int
"""
moduli = 1337
if a == 0:
return 0
ans = 1
for n in b:
ans = pow(ans, 10, MODULI)
ans = ans * pow(a, n, MODULI) % MODULI
return ans |
t = int(input())
while t:
t -= 1
c, d = map(int, input().split())
if (26**c) * (10**d) == 1:
print(0)
else:
print((26**c) * (10**d)) | t = int(input())
while t:
t -= 1
(c, d) = map(int, input().split())
if 26 ** c * 10 ** d == 1:
print(0)
else:
print(26 ** c * 10 ** d) |
def longestCommonSubsequence(self, text1: str, text2: str) -> int:
"""
>>> dynammic programming
This question is known as LCS problem and is presented together with
LIS: longest increasing subsequence.
"""
# current solution can be optimized using O(N) space
L1, L2 = len(text1), len(text2)
dp = [[0] * L2 for _ in range(L1)]
# initialization
dp[0][0] = int(text1[0] == text2[0])
for i in range(1, L1):
dp[i][0] = min(dp[i-1][0] + int(text1[i] == text2[0]), 1)
for j in range(1, L2):
dp[0][j] = min(dp[0][j-1] + int(text1[0] == text2[j]), 1)
# dp iteration
for i in range(1, L1):
for j in range(1, L2):
if text1[i] == text2[j]:
dp[i][j] = dp[i-1][j-1] + 1
else:
dp[i][j] = max(dp[i-1][j], dp[i][j-1])
return dp[-1][-1]
| def longest_common_subsequence(self, text1: str, text2: str) -> int:
"""
>>> dynammic programming
This question is known as LCS problem and is presented together with
LIS: longest increasing subsequence.
"""
(l1, l2) = (len(text1), len(text2))
dp = [[0] * L2 for _ in range(L1)]
dp[0][0] = int(text1[0] == text2[0])
for i in range(1, L1):
dp[i][0] = min(dp[i - 1][0] + int(text1[i] == text2[0]), 1)
for j in range(1, L2):
dp[0][j] = min(dp[0][j - 1] + int(text1[0] == text2[j]), 1)
for i in range(1, L1):
for j in range(1, L2):
if text1[i] == text2[j]:
dp[i][j] = dp[i - 1][j - 1] + 1
else:
dp[i][j] = max(dp[i - 1][j], dp[i][j - 1])
return dp[-1][-1] |
def make_shirt(size='large', words='I love the world'):
print("The T-shirt is " + size + " and the words '" + words + "' are on it.")
make_shirt()
make_shirt('middle')
make_shirt(words='I love you')
| def make_shirt(size='large', words='I love the world'):
print('The T-shirt is ' + size + " and the words '" + words + "' are on it.")
make_shirt()
make_shirt('middle')
make_shirt(words='I love you') |
class info:
def __init__(self, L, AE, r):
self.L = L
self.AE = AE
self.r = r
| class Info:
def __init__(self, L, AE, r):
self.L = L
self.AE = AE
self.r = r |
class Node:
def __init__(self, data):
self.data = data
self.next = None
class LinkedList:
def __init__(self):
self.head = None
self.last_node = None
def append(self, data):
if self.last_node is None:
self.head = Node(data)
self.last_node = self.head
else:
self.last_node.next = Node(data)
self.last_node = self.last_node.next
def get_node(self, index):
current = self.head
for i in range(index):
current = current.next
if current is None:
return None
return current
def has_cycle(llist):
slow = llist.head
fast = llist.head
while (fast != None and fast.next != None):
slow = slow.next
fast = fast.next.next
if slow == fast:
return True
return False
a_llist = LinkedList()
data_list = input('Please enter the elements in the linked list: ').split()
for data in data_list:
a_llist.append(int(data))
length = len(data_list)
if length != 0:
values = '0-' + str(length - 1)
last_ptr = input('Enter the index [' + values + '] of the node'
' to which you want the last node to point'
' (enter nothing to make it point to None): ').strip()
if last_ptr == '':
last_ptr = None
else:
last_ptr = a_llist.get_node(int(last_ptr))
a_llist.last_node.next = last_ptr
if has_cycle(a_llist):
print('The linked list has a cycle.')
else:
print('The linked list does not have a cycle.')
| class Node:
def __init__(self, data):
self.data = data
self.next = None
class Linkedlist:
def __init__(self):
self.head = None
self.last_node = None
def append(self, data):
if self.last_node is None:
self.head = node(data)
self.last_node = self.head
else:
self.last_node.next = node(data)
self.last_node = self.last_node.next
def get_node(self, index):
current = self.head
for i in range(index):
current = current.next
if current is None:
return None
return current
def has_cycle(llist):
slow = llist.head
fast = llist.head
while fast != None and fast.next != None:
slow = slow.next
fast = fast.next.next
if slow == fast:
return True
return False
a_llist = linked_list()
data_list = input('Please enter the elements in the linked list: ').split()
for data in data_list:
a_llist.append(int(data))
length = len(data_list)
if length != 0:
values = '0-' + str(length - 1)
last_ptr = input('Enter the index [' + values + '] of the node to which you want the last node to point (enter nothing to make it point to None): ').strip()
if last_ptr == '':
last_ptr = None
else:
last_ptr = a_llist.get_node(int(last_ptr))
a_llist.last_node.next = last_ptr
if has_cycle(a_llist):
print('The linked list has a cycle.')
else:
print('The linked list does not have a cycle.') |
def main(request, response):
try:
code = int(request.GET.first("code", None))
except:
code = None
if request.method == "OPTIONS":
if code:
response.status = code
response.headers.set("Access-Control-Max-Age", 1)
response.headers.set("Access-Control-Allow-Headers", "x-pass")
else:
response.status = 200
response.headers.set("Cache-Control", "no-store")
response.headers.set("Access-Control-Allow-Origin", request.headers.get("origin"))
| def main(request, response):
try:
code = int(request.GET.first('code', None))
except:
code = None
if request.method == 'OPTIONS':
if code:
response.status = code
response.headers.set('Access-Control-Max-Age', 1)
response.headers.set('Access-Control-Allow-Headers', 'x-pass')
else:
response.status = 200
response.headers.set('Cache-Control', 'no-store')
response.headers.set('Access-Control-Allow-Origin', request.headers.get('origin')) |
# ordem de precedencia
# 1 == ()
# 2 == **
# 3 == * , / , // , %
# 4 == + , -
n1 = int(input('Digite um numero: '))
n2 = int(input('Digite outro numero: '))
s = n1 + n2
m = n1 * n2
d = n1 / n2
di = n1 // n2
e = n1 ** n2
print('A soma e: {} o produto e: {} a divisao e: {:.3f}'.format(s, m, d), end=' ')
print('Divisao inteira: {} e potencia {}'.format(di, e))
| n1 = int(input('Digite um numero: '))
n2 = int(input('Digite outro numero: '))
s = n1 + n2
m = n1 * n2
d = n1 / n2
di = n1 // n2
e = n1 ** n2
print('A soma e: {} o produto e: {} a divisao e: {:.3f}'.format(s, m, d), end=' ')
print('Divisao inteira: {} e potencia {}'.format(di, e)) |
NB_KEYS = 42
REGION_ID_CODES = {"alphanum": 0x2a, "enter": 0x0b, "modifiers": 0x18, "numpad": 0x24}
def make_key_colors_packet(region, colors_map):
packet = []
region_hexcode = REGION_ID_CODES[region]
header = [0x0e, 0x00, region_hexcode, 0x00]
packet += header
k = 0
for keycode, rgb in colors_map.items():
key_fragment = rgb + [0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00] + [keycode]
packet += key_fragment
k += 1
while k < NB_KEYS:
packet += ([0x00] * 12)
k += 1
packet += [0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x39]
return packet
def make_refresh_packet():
packet = [0x09] + [0x00] * 63
return packet
| nb_keys = 42
region_id_codes = {'alphanum': 42, 'enter': 11, 'modifiers': 24, 'numpad': 36}
def make_key_colors_packet(region, colors_map):
packet = []
region_hexcode = REGION_ID_CODES[region]
header = [14, 0, region_hexcode, 0]
packet += header
k = 0
for (keycode, rgb) in colors_map.items():
key_fragment = rgb + [0, 0, 0, 0, 0, 0, 1, 0] + [keycode]
packet += key_fragment
k += 1
while k < NB_KEYS:
packet += [0] * 12
k += 1
packet += [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 57]
return packet
def make_refresh_packet():
packet = [9] + [0] * 63
return packet |
# Copyright (c) 2009 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.
{
'includes': [
'../../build/common.gypi',
],
'conditions': [
['OS=="win"', {
'targets': [
{
'target_name': 'cld',
'type': '<(library)',
'dependencies': [
'../../base/base.gyp:base',
],
'msvs_disabled_warnings': [4005, 4006, 4018, 4244, 4309, 4800],
'defines': [
'CLD_WINDOWS',
],
'sources': [
'bar/common/scopedlibrary.h',
'bar/common/scopedptr.h',
'bar/toolbar/cld/i18n/encodings/compact_lang_det/cldutil.cc',
'bar/toolbar/cld/i18n/encodings/compact_lang_det/cldutil.h',
'bar/toolbar/cld/i18n/encodings/compact_lang_det/cldutil_dbg.h',
'bar/toolbar/cld/i18n/encodings/compact_lang_det/cldutil_dbg_empty.cc',
'bar/toolbar/cld/i18n/encodings/compact_lang_det/compact_lang_det.cc',
'bar/toolbar/cld/i18n/encodings/compact_lang_det/compact_lang_det.h',
'bar/toolbar/cld/i18n/encodings/compact_lang_det/compact_lang_det_generated_cjkbis_0.cc',
'bar/toolbar/cld/i18n/encodings/compact_lang_det/compact_lang_det_generated_ctjkvz.cc',
'bar/toolbar/cld/i18n/encodings/compact_lang_det/compact_lang_det_generated_longwords8_0.cc',
'bar/toolbar/cld/i18n/encodings/compact_lang_det/compact_lang_det_generated_meanscore.h',
'bar/toolbar/cld/i18n/encodings/compact_lang_det/compact_lang_det_generated_quads_128.cc',
'bar/toolbar/cld/i18n/encodings/compact_lang_det/compact_lang_det_impl.cc',
'bar/toolbar/cld/i18n/encodings/compact_lang_det/compact_lang_det_impl.h',
'bar/toolbar/cld/i18n/encodings/compact_lang_det/ext_lang_enc.cc',
'bar/toolbar/cld/i18n/encodings/compact_lang_det/ext_lang_enc.h',
'bar/toolbar/cld/i18n/encodings/compact_lang_det/getonescriptspan.cc',
'bar/toolbar/cld/i18n/encodings/compact_lang_det/getonescriptspan.h',
'bar/toolbar/cld/i18n/encodings/compact_lang_det/letterscript_enum.cc',
'bar/toolbar/cld/i18n/encodings/compact_lang_det/letterscript_enum.h',
'bar/toolbar/cld/i18n/encodings/compact_lang_det/subsetsequence.cc',
'bar/toolbar/cld/i18n/encodings/compact_lang_det/subsetsequence.h',
'bar/toolbar/cld/i18n/encodings/compact_lang_det/tote.cc',
'bar/toolbar/cld/i18n/encodings/compact_lang_det/tote.h',
'bar/toolbar/cld/i18n/encodings/compact_lang_det/unittest_data.h',
'bar/toolbar/cld/i18n/encodings/compact_lang_det/utf8propjustletter.h',
'bar/toolbar/cld/i18n/encodings/compact_lang_det/utf8propletterscriptnum.h',
'bar/toolbar/cld/i18n/encodings/compact_lang_det/utf8scannotjustletterspecial.h',
'bar/toolbar/cld/i18n/encodings/compact_lang_det/win/cld_basictypes.h',
'bar/toolbar/cld/i18n/encodings/compact_lang_det/win/cld_commandlineflags.h',
'bar/toolbar/cld/i18n/encodings/compact_lang_det/win/cld_macros.h',
'bar/toolbar/cld/i18n/encodings/compact_lang_det/win/cld_google.h',
'bar/toolbar/cld/i18n/encodings/compact_lang_det/win/cld_htmlutils.h',
'bar/toolbar/cld/i18n/encodings/compact_lang_det/win/cld_htmlutils_windows.cc',
'bar/toolbar/cld/i18n/encodings/compact_lang_det/win/cld_logging.h',
'bar/toolbar/cld/i18n/encodings/compact_lang_det/win/cld_scoped_ptr.h',
'bar/toolbar/cld/i18n/encodings/compact_lang_det/win/cld_scopedptr.h',
'bar/toolbar/cld/i18n/encodings/compact_lang_det/win/cld_strtoint.h',
'bar/toolbar/cld/i18n/encodings/compact_lang_det/win/cld_unicodetext.cc',
'bar/toolbar/cld/i18n/encodings/compact_lang_det/win/cld_unicodetext.h',
'bar/toolbar/cld/i18n/encodings/compact_lang_det/win/cld_unilib.h',
'bar/toolbar/cld/i18n/encodings/compact_lang_det/win/cld_unilib_windows.cc',
'bar/toolbar/cld/i18n/encodings/compact_lang_det/win/cld_utf.h',
'bar/toolbar/cld/i18n/encodings/compact_lang_det/win/cld_utf8statetable.cc',
'bar/toolbar/cld/i18n/encodings/compact_lang_det/win/cld_utf8statetable.h',
'bar/toolbar/cld/i18n/encodings/compact_lang_det/win/cld_utf8utils.h',
'bar/toolbar/cld/i18n/encodings/compact_lang_det/win/cld_utf8utils_windows.cc',
'bar/toolbar/cld/i18n/encodings/compact_lang_det/win/normalizedunicodetext.cc',
'bar/toolbar/cld/i18n/encodings/compact_lang_det/win/normalizedunicodetext.h',
'bar/toolbar/cld/i18n/encodings/internal/encodings.cc',
'bar/toolbar/cld/i18n/encodings/proto/encodings.pb.h',
'bar/toolbar/cld/i18n/encodings/public/encodings.h',
'bar/toolbar/cld/i18n/languages/internal/languages.cc',
'bar/toolbar/cld/i18n/languages/proto/languages.pb.h',
'bar/toolbar/cld/i18n/languages/public/languages.h',
'base/casts.h',
'base/commandlineflags.h',
'base/stl_decl.h',
'base/global_strip_options.h',
'base/logging.h',
'base/macros.h',
'base/crash.h',
'base/dynamic_annotations.h',
'base/scoped_ptr.h',
'base/stl_decl_msvc.h',
'base/log_severity.h',
'base/strtoint.h',
'base/vlog_is_on.h',
'base/type_traits.h',
'base/template_util.h',
],
'direct_dependent_settings': {
'defines': [
'CLD_WINDOWS',
'COMPILER_MSVC',
],
},
},],
},
],
],
}
| {'includes': ['../../build/common.gypi'], 'conditions': [['OS=="win"', {'targets': [{'target_name': 'cld', 'type': '<(library)', 'dependencies': ['../../base/base.gyp:base'], 'msvs_disabled_warnings': [4005, 4006, 4018, 4244, 4309, 4800], 'defines': ['CLD_WINDOWS'], 'sources': ['bar/common/scopedlibrary.h', 'bar/common/scopedptr.h', 'bar/toolbar/cld/i18n/encodings/compact_lang_det/cldutil.cc', 'bar/toolbar/cld/i18n/encodings/compact_lang_det/cldutil.h', 'bar/toolbar/cld/i18n/encodings/compact_lang_det/cldutil_dbg.h', 'bar/toolbar/cld/i18n/encodings/compact_lang_det/cldutil_dbg_empty.cc', 'bar/toolbar/cld/i18n/encodings/compact_lang_det/compact_lang_det.cc', 'bar/toolbar/cld/i18n/encodings/compact_lang_det/compact_lang_det.h', 'bar/toolbar/cld/i18n/encodings/compact_lang_det/compact_lang_det_generated_cjkbis_0.cc', 'bar/toolbar/cld/i18n/encodings/compact_lang_det/compact_lang_det_generated_ctjkvz.cc', 'bar/toolbar/cld/i18n/encodings/compact_lang_det/compact_lang_det_generated_longwords8_0.cc', 'bar/toolbar/cld/i18n/encodings/compact_lang_det/compact_lang_det_generated_meanscore.h', 'bar/toolbar/cld/i18n/encodings/compact_lang_det/compact_lang_det_generated_quads_128.cc', 'bar/toolbar/cld/i18n/encodings/compact_lang_det/compact_lang_det_impl.cc', 'bar/toolbar/cld/i18n/encodings/compact_lang_det/compact_lang_det_impl.h', 'bar/toolbar/cld/i18n/encodings/compact_lang_det/ext_lang_enc.cc', 'bar/toolbar/cld/i18n/encodings/compact_lang_det/ext_lang_enc.h', 'bar/toolbar/cld/i18n/encodings/compact_lang_det/getonescriptspan.cc', 'bar/toolbar/cld/i18n/encodings/compact_lang_det/getonescriptspan.h', 'bar/toolbar/cld/i18n/encodings/compact_lang_det/letterscript_enum.cc', 'bar/toolbar/cld/i18n/encodings/compact_lang_det/letterscript_enum.h', 'bar/toolbar/cld/i18n/encodings/compact_lang_det/subsetsequence.cc', 'bar/toolbar/cld/i18n/encodings/compact_lang_det/subsetsequence.h', 'bar/toolbar/cld/i18n/encodings/compact_lang_det/tote.cc', 'bar/toolbar/cld/i18n/encodings/compact_lang_det/tote.h', 'bar/toolbar/cld/i18n/encodings/compact_lang_det/unittest_data.h', 'bar/toolbar/cld/i18n/encodings/compact_lang_det/utf8propjustletter.h', 'bar/toolbar/cld/i18n/encodings/compact_lang_det/utf8propletterscriptnum.h', 'bar/toolbar/cld/i18n/encodings/compact_lang_det/utf8scannotjustletterspecial.h', 'bar/toolbar/cld/i18n/encodings/compact_lang_det/win/cld_basictypes.h', 'bar/toolbar/cld/i18n/encodings/compact_lang_det/win/cld_commandlineflags.h', 'bar/toolbar/cld/i18n/encodings/compact_lang_det/win/cld_macros.h', 'bar/toolbar/cld/i18n/encodings/compact_lang_det/win/cld_google.h', 'bar/toolbar/cld/i18n/encodings/compact_lang_det/win/cld_htmlutils.h', 'bar/toolbar/cld/i18n/encodings/compact_lang_det/win/cld_htmlutils_windows.cc', 'bar/toolbar/cld/i18n/encodings/compact_lang_det/win/cld_logging.h', 'bar/toolbar/cld/i18n/encodings/compact_lang_det/win/cld_scoped_ptr.h', 'bar/toolbar/cld/i18n/encodings/compact_lang_det/win/cld_scopedptr.h', 'bar/toolbar/cld/i18n/encodings/compact_lang_det/win/cld_strtoint.h', 'bar/toolbar/cld/i18n/encodings/compact_lang_det/win/cld_unicodetext.cc', 'bar/toolbar/cld/i18n/encodings/compact_lang_det/win/cld_unicodetext.h', 'bar/toolbar/cld/i18n/encodings/compact_lang_det/win/cld_unilib.h', 'bar/toolbar/cld/i18n/encodings/compact_lang_det/win/cld_unilib_windows.cc', 'bar/toolbar/cld/i18n/encodings/compact_lang_det/win/cld_utf.h', 'bar/toolbar/cld/i18n/encodings/compact_lang_det/win/cld_utf8statetable.cc', 'bar/toolbar/cld/i18n/encodings/compact_lang_det/win/cld_utf8statetable.h', 'bar/toolbar/cld/i18n/encodings/compact_lang_det/win/cld_utf8utils.h', 'bar/toolbar/cld/i18n/encodings/compact_lang_det/win/cld_utf8utils_windows.cc', 'bar/toolbar/cld/i18n/encodings/compact_lang_det/win/normalizedunicodetext.cc', 'bar/toolbar/cld/i18n/encodings/compact_lang_det/win/normalizedunicodetext.h', 'bar/toolbar/cld/i18n/encodings/internal/encodings.cc', 'bar/toolbar/cld/i18n/encodings/proto/encodings.pb.h', 'bar/toolbar/cld/i18n/encodings/public/encodings.h', 'bar/toolbar/cld/i18n/languages/internal/languages.cc', 'bar/toolbar/cld/i18n/languages/proto/languages.pb.h', 'bar/toolbar/cld/i18n/languages/public/languages.h', 'base/casts.h', 'base/commandlineflags.h', 'base/stl_decl.h', 'base/global_strip_options.h', 'base/logging.h', 'base/macros.h', 'base/crash.h', 'base/dynamic_annotations.h', 'base/scoped_ptr.h', 'base/stl_decl_msvc.h', 'base/log_severity.h', 'base/strtoint.h', 'base/vlog_is_on.h', 'base/type_traits.h', 'base/template_util.h'], 'direct_dependent_settings': {'defines': ['CLD_WINDOWS', 'COMPILER_MSVC']}}]}]]} |
# Frequency Type
MONTHLY = 12
ANNUALLY = 1
FREQUENCY_TYPE = {
MONTHLY: 'Monthly',
ANNUALLY: 'Anually'
}
# Loan Type
CONVENTIONAL = 0
HARD_MONEY = 1
PRIVATE_MONEY = 2
OTHER = 3
LOAN_TYPE = {
CONVENTIONAL: 'Conventional',
HARD_MONEY: 'Hard Money',
PRIVATE_MONEY: 'Private Money',
OTHER: 'Other'
}
| monthly = 12
annually = 1
frequency_type = {MONTHLY: 'Monthly', ANNUALLY: 'Anually'}
conventional = 0
hard_money = 1
private_money = 2
other = 3
loan_type = {CONVENTIONAL: 'Conventional', HARD_MONEY: 'Hard Money', PRIVATE_MONEY: 'Private Money', OTHER: 'Other'} |
"""
Given a string, find out if its characters can be rearranged to form a palindrome.
palindromeRearranging(inputString) = true.
"""
def palindromeRearranging(inputString):
dictionary = {}
for string in inputString:
if string not in dictionary:
dictionary[string] = 1
else:
dictionary[string] += 1
flag = 0
for k in dictionary.values():
if k%2 != 0:
if flag == 1:
return False
flag = 1
return True | """
Given a string, find out if its characters can be rearranged to form a palindrome.
palindromeRearranging(inputString) = true.
"""
def palindrome_rearranging(inputString):
dictionary = {}
for string in inputString:
if string not in dictionary:
dictionary[string] = 1
else:
dictionary[string] += 1
flag = 0
for k in dictionary.values():
if k % 2 != 0:
if flag == 1:
return False
flag = 1
return True |
numbersArray = [12, 23, 5, 12, 92, 5,12, 5, 29, 92, 64,23]
numbersAmount = {}
def analizeArray():
for number in numbersArray:
addNumber(number)
def addNumber(newNumber):
if(newNumber in numbersAmount):
numbersAmount.update({newNumber: numbersAmount[newNumber]+1})
else:
numbersAmount.update({newNumber: 1})
def showDictionary():
print(numbersAmount)
print("Contador de numeros")
print("(Modifica la lista para ver los cambios)")
print("")
analizeArray()
showDictionary()
| numbers_array = [12, 23, 5, 12, 92, 5, 12, 5, 29, 92, 64, 23]
numbers_amount = {}
def analize_array():
for number in numbersArray:
add_number(number)
def add_number(newNumber):
if newNumber in numbersAmount:
numbersAmount.update({newNumber: numbersAmount[newNumber] + 1})
else:
numbersAmount.update({newNumber: 1})
def show_dictionary():
print(numbersAmount)
print('Contador de numeros')
print('(Modifica la lista para ver los cambios)')
print('')
analize_array()
show_dictionary() |
# Finicky Counter
# Demonstrates the break and continue statements
count = 0
while True:
count += 1
# end loop if count greater than 10
if count > 10:
break
# skip 5
if count == 5:
continue
print(count)
input("\n\nPress the enter key to exit.")
| count = 0
while True:
count += 1
if count > 10:
break
if count == 5:
continue
print(count)
input('\n\nPress the enter key to exit.') |
def add(num1, num2):
return num1 + num2
def subtract(num1, num2):
return num1 - num2
def multiply(num1, num2):
return num1 * num2
def divide(num1, num2):
return num1 / num2
select = int(input("Please select operation -\n"
"1. Add\n"
"2. Subtract\n"
"3. Multiply\n"
"4. Divide\n"))
number_1 = int(input("Enter first number: "))
number_2 = int(input("Enter second number: "))
if select == 1:
print(number_1, "+", number_2, "=",
add(number_1, number_2))
elif select == 2:
print(number_1, "-", number_2, "=",
subtract(number_1, number_2))
elif select == 3:
print(number_1, "*", number_2, "=",
multiply(number_1, number_2))
elif select == 4:
print(number_1, "/", number_2, "=",
divide(number_1, number_2))
else:
print("Invalid Selection!") | def add(num1, num2):
return num1 + num2
def subtract(num1, num2):
return num1 - num2
def multiply(num1, num2):
return num1 * num2
def divide(num1, num2):
return num1 / num2
select = int(input('Please select operation -\n1. Add\n2. Subtract\n3. Multiply\n4. Divide\n'))
number_1 = int(input('Enter first number: '))
number_2 = int(input('Enter second number: '))
if select == 1:
print(number_1, '+', number_2, '=', add(number_1, number_2))
elif select == 2:
print(number_1, '-', number_2, '=', subtract(number_1, number_2))
elif select == 3:
print(number_1, '*', number_2, '=', multiply(number_1, number_2))
elif select == 4:
print(number_1, '/', number_2, '=', divide(number_1, number_2))
else:
print('Invalid Selection!') |
pkgname = "gnu-getopt"
pkgver = "0.0.1"
pkgrel = 0
build_style = "makefile"
make_cmd = "gmake"
hostmakedepends = ["gmake"]
pkgdesc = "GNU getopt compatibility package for musl"
maintainer = "roastveg <louis@hamptonsoftworks.com>"
license = "BSD-4-Clause AND ISC"
url = "https://github.com/sabotage-linux/gnu-getopt"
source = f"https://github.com/sabotage-linux/{pkgname}/archive/refs/tags/v{pkgver}.tar.gz"
sha256 = "52eefa6973d05cab92cfc76ab83b3cde4654b91564e97983b26020792694cb5c"
# no check target
options = ["!lto", "!check"]
def do_install(self):
self.install_file("gnu_getopt.h", "usr/include")
self.install_lib("libgnu_getopt.a")
| pkgname = 'gnu-getopt'
pkgver = '0.0.1'
pkgrel = 0
build_style = 'makefile'
make_cmd = 'gmake'
hostmakedepends = ['gmake']
pkgdesc = 'GNU getopt compatibility package for musl'
maintainer = 'roastveg <louis@hamptonsoftworks.com>'
license = 'BSD-4-Clause AND ISC'
url = 'https://github.com/sabotage-linux/gnu-getopt'
source = f'https://github.com/sabotage-linux/{pkgname}/archive/refs/tags/v{pkgver}.tar.gz'
sha256 = '52eefa6973d05cab92cfc76ab83b3cde4654b91564e97983b26020792694cb5c'
options = ['!lto', '!check']
def do_install(self):
self.install_file('gnu_getopt.h', 'usr/include')
self.install_lib('libgnu_getopt.a') |
# -*- coding: utf-8 -*-
"""
Created on Mon Oct 21 09:26:56 2019
@author: prevotge
"""
amqp_url='amqp://qiwsedps:WMXj527zSKlGKFACO2IRj_ZEr4LRU3jg@dove.rmq.cloudamqp.com/qiwsedps'
| """
Created on Mon Oct 21 09:26:56 2019
@author: prevotge
"""
amqp_url = 'amqp://qiwsedps:WMXj527zSKlGKFACO2IRj_ZEr4LRU3jg@dove.rmq.cloudamqp.com/qiwsedps' |
#
# PySNMP MIB module DNOS-LLPF-PRIVATE-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/DNOS-LLPF-PRIVATE-MIB
# Produced by pysmi-0.3.4 at Mon Apr 29 18:36:50 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 (default, Mar 27 2019, 09:23:15)
#
Integer, OctetString, ObjectIdentifier = mibBuilder.importSymbols("ASN1", "Integer", "OctetString", "ObjectIdentifier")
NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues")
ValueSizeConstraint, ConstraintsIntersection, ConstraintsUnion, SingleValueConstraint, ValueRangeConstraint = mibBuilder.importSymbols("ASN1-REFINEMENT", "ValueSizeConstraint", "ConstraintsIntersection", "ConstraintsUnion", "SingleValueConstraint", "ValueRangeConstraint")
dnOS, = mibBuilder.importSymbols("DELL-REF-MIB", "dnOS")
ifIndex, = mibBuilder.importSymbols("IF-MIB", "ifIndex")
ModuleCompliance, NotificationGroup = mibBuilder.importSymbols("SNMPv2-CONF", "ModuleCompliance", "NotificationGroup")
ModuleIdentity, ObjectIdentity, Gauge32, Counter64, MibIdentifier, iso, TimeTicks, Integer32, Unsigned32, Counter32, IpAddress, MibScalar, MibTable, MibTableRow, MibTableColumn, Bits, NotificationType = mibBuilder.importSymbols("SNMPv2-SMI", "ModuleIdentity", "ObjectIdentity", "Gauge32", "Counter64", "MibIdentifier", "iso", "TimeTicks", "Integer32", "Unsigned32", "Counter32", "IpAddress", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "Bits", "NotificationType")
RowStatus, MacAddress, TextualConvention, DisplayString = mibBuilder.importSymbols("SNMPv2-TC", "RowStatus", "MacAddress", "TextualConvention", "DisplayString")
fastPathLlpf = ModuleIdentity((1, 3, 6, 1, 4, 1, 674, 10895, 5000, 2, 6132, 1, 1, 48))
fastPathLlpf.setRevisions(('2011-01-26 00:00', '2009-10-26 00:00',))
if mibBuilder.loadTexts: fastPathLlpf.setLastUpdated('201101260000Z')
if mibBuilder.loadTexts: fastPathLlpf.setOrganization('Dell, Inc.')
agentSwitchLlpfGroup = MibIdentifier((1, 3, 6, 1, 4, 1, 674, 10895, 5000, 2, 6132, 1, 1, 48, 1))
agentSwitchLlpfPortConfigTable = MibTable((1, 3, 6, 1, 4, 1, 674, 10895, 5000, 2, 6132, 1, 1, 48, 1, 1), )
if mibBuilder.loadTexts: agentSwitchLlpfPortConfigTable.setStatus('current')
agentSwitchLlpfPortConfigEntry = MibTableRow((1, 3, 6, 1, 4, 1, 674, 10895, 5000, 2, 6132, 1, 1, 48, 1, 1, 1), ).setIndexNames((0, "IF-MIB", "ifIndex"), (0, "DNOS-LLPF-PRIVATE-MIB", "agentSwitchLlpfProtocolType"))
if mibBuilder.loadTexts: agentSwitchLlpfPortConfigEntry.setStatus('current')
agentSwitchLlpfProtocolType = MibTableColumn((1, 3, 6, 1, 4, 1, 674, 10895, 5000, 2, 6132, 1, 1, 48, 1, 1, 1, 1), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(0, 6)))
if mibBuilder.loadTexts: agentSwitchLlpfProtocolType.setStatus('current')
agentSwitchLlpfPortBlockMode = MibTableColumn((1, 3, 6, 1, 4, 1, 674, 10895, 5000, 2, 6132, 1, 1, 48, 1, 1, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enable", 1), ("disable", 2))).clone('disable')).setMaxAccess("readwrite")
if mibBuilder.loadTexts: agentSwitchLlpfPortBlockMode.setStatus('current')
mibBuilder.exportSymbols("DNOS-LLPF-PRIVATE-MIB", agentSwitchLlpfPortConfigTable=agentSwitchLlpfPortConfigTable, agentSwitchLlpfPortBlockMode=agentSwitchLlpfPortBlockMode, agentSwitchLlpfPortConfigEntry=agentSwitchLlpfPortConfigEntry, agentSwitchLlpfGroup=agentSwitchLlpfGroup, PYSNMP_MODULE_ID=fastPathLlpf, fastPathLlpf=fastPathLlpf, agentSwitchLlpfProtocolType=agentSwitchLlpfProtocolType)
| (integer, octet_string, object_identifier) = mibBuilder.importSymbols('ASN1', 'Integer', 'OctetString', 'ObjectIdentifier')
(named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues')
(value_size_constraint, constraints_intersection, constraints_union, single_value_constraint, value_range_constraint) = mibBuilder.importSymbols('ASN1-REFINEMENT', 'ValueSizeConstraint', 'ConstraintsIntersection', 'ConstraintsUnion', 'SingleValueConstraint', 'ValueRangeConstraint')
(dn_os,) = mibBuilder.importSymbols('DELL-REF-MIB', 'dnOS')
(if_index,) = mibBuilder.importSymbols('IF-MIB', 'ifIndex')
(module_compliance, notification_group) = mibBuilder.importSymbols('SNMPv2-CONF', 'ModuleCompliance', 'NotificationGroup')
(module_identity, object_identity, gauge32, counter64, mib_identifier, iso, time_ticks, integer32, unsigned32, counter32, ip_address, mib_scalar, mib_table, mib_table_row, mib_table_column, bits, notification_type) = mibBuilder.importSymbols('SNMPv2-SMI', 'ModuleIdentity', 'ObjectIdentity', 'Gauge32', 'Counter64', 'MibIdentifier', 'iso', 'TimeTicks', 'Integer32', 'Unsigned32', 'Counter32', 'IpAddress', 'MibScalar', 'MibTable', 'MibTableRow', 'MibTableColumn', 'Bits', 'NotificationType')
(row_status, mac_address, textual_convention, display_string) = mibBuilder.importSymbols('SNMPv2-TC', 'RowStatus', 'MacAddress', 'TextualConvention', 'DisplayString')
fast_path_llpf = module_identity((1, 3, 6, 1, 4, 1, 674, 10895, 5000, 2, 6132, 1, 1, 48))
fastPathLlpf.setRevisions(('2011-01-26 00:00', '2009-10-26 00:00'))
if mibBuilder.loadTexts:
fastPathLlpf.setLastUpdated('201101260000Z')
if mibBuilder.loadTexts:
fastPathLlpf.setOrganization('Dell, Inc.')
agent_switch_llpf_group = mib_identifier((1, 3, 6, 1, 4, 1, 674, 10895, 5000, 2, 6132, 1, 1, 48, 1))
agent_switch_llpf_port_config_table = mib_table((1, 3, 6, 1, 4, 1, 674, 10895, 5000, 2, 6132, 1, 1, 48, 1, 1))
if mibBuilder.loadTexts:
agentSwitchLlpfPortConfigTable.setStatus('current')
agent_switch_llpf_port_config_entry = mib_table_row((1, 3, 6, 1, 4, 1, 674, 10895, 5000, 2, 6132, 1, 1, 48, 1, 1, 1)).setIndexNames((0, 'IF-MIB', 'ifIndex'), (0, 'DNOS-LLPF-PRIVATE-MIB', 'agentSwitchLlpfProtocolType'))
if mibBuilder.loadTexts:
agentSwitchLlpfPortConfigEntry.setStatus('current')
agent_switch_llpf_protocol_type = mib_table_column((1, 3, 6, 1, 4, 1, 674, 10895, 5000, 2, 6132, 1, 1, 48, 1, 1, 1, 1), unsigned32().subtype(subtypeSpec=value_range_constraint(0, 6)))
if mibBuilder.loadTexts:
agentSwitchLlpfProtocolType.setStatus('current')
agent_switch_llpf_port_block_mode = mib_table_column((1, 3, 6, 1, 4, 1, 674, 10895, 5000, 2, 6132, 1, 1, 48, 1, 1, 1, 2), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('enable', 1), ('disable', 2))).clone('disable')).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
agentSwitchLlpfPortBlockMode.setStatus('current')
mibBuilder.exportSymbols('DNOS-LLPF-PRIVATE-MIB', agentSwitchLlpfPortConfigTable=agentSwitchLlpfPortConfigTable, agentSwitchLlpfPortBlockMode=agentSwitchLlpfPortBlockMode, agentSwitchLlpfPortConfigEntry=agentSwitchLlpfPortConfigEntry, agentSwitchLlpfGroup=agentSwitchLlpfGroup, PYSNMP_MODULE_ID=fastPathLlpf, fastPathLlpf=fastPathLlpf, agentSwitchLlpfProtocolType=agentSwitchLlpfProtocolType) |
# Parse different FHIR Profiles
# FHIR Version 3.0.2
# flake8: noqa
OBSERVATION_PROFILE = {"resourceType": "Observation",
"displayFields": ["text",
"subject.display",
"valueQuantity.value",
"valueQuantity.unit",
"status"]}
# {'code': {'coding': [{'code': '9279-1',
# 'display': 'Respiratory Rate',
# 'system': 'http://loinc.org'}],
# 'text': 'Respiratory Rate'},
# 'effectivePeriod': {'start': '2014-12-17T08:03:00+00:00'},
# 'id': '335',
# 'resourceType': 'Observation',
# 'status': 'final',
# 'valueQuantity': {'unit': '/min', 'value': 16}
# }
def get_display_fields(resourceType):
"""
process resource for display
"""
return resourceType
| observation_profile = {'resourceType': 'Observation', 'displayFields': ['text', 'subject.display', 'valueQuantity.value', 'valueQuantity.unit', 'status']}
def get_display_fields(resourceType):
"""
process resource for display
"""
return resourceType |
class Models:
RANDOMFORESTCLASSIFIER = 'RandomForestClassifier'
LOGISTICREGRESSION = 'LogisticRegression'
MULTINOMIALNB = 'MultinomialNB'
MLPCLASSIFIER = 'MLPClassifier'
class Datasets:
ADULT = 'adult'
GERMANCREDIT = 'german_credit'
TWENTYNEWSGROUPS = '20_newsgroups'
BREASTCANCER = 'breast_cancer'
SYNTHETIC = 'synthetic'
COMPAS = 'compas'
COMMUNITY = 'community'
class Explainers:
LIMETABULAR = 'lime_tabular'
LIMETEXT = 'lime_text'
NUMPYTABULAR = 'numpy_tabular'
NUMPYENSEMBLE = 'numpy_ensemble'
NUMPYTEXT = 'numpy_text'
NUMPYROBUSTTABULAR= 'numpy_robust_tabular'
| class Models:
randomforestclassifier = 'RandomForestClassifier'
logisticregression = 'LogisticRegression'
multinomialnb = 'MultinomialNB'
mlpclassifier = 'MLPClassifier'
class Datasets:
adult = 'adult'
germancredit = 'german_credit'
twentynewsgroups = '20_newsgroups'
breastcancer = 'breast_cancer'
synthetic = 'synthetic'
compas = 'compas'
community = 'community'
class Explainers:
limetabular = 'lime_tabular'
limetext = 'lime_text'
numpytabular = 'numpy_tabular'
numpyensemble = 'numpy_ensemble'
numpytext = 'numpy_text'
numpyrobusttabular = 'numpy_robust_tabular' |
class AliasCollector:
def __init__(self):
self.aliases = {}
self.functions = {}
self.commands = {}
self.info_entries = []
def cmd(self, function, alias=None, info=None, name=None):
"""
Registers a command as "turboshell [name]" where name is the name of the function.
@name if provided, sets the name of the command, else name of function is used.
@alias creates an alias for the command.
@info is only used if alias is also provided.
"""
if name is None:
name = function.__name__
self.commands[name] = function
if alias:
self.alias(alias, 'turboshell ' + name)
if info:
self.info(alias, info)
def alias(self, name, command, info=None):
"""Add a single alias"""
self.aliases[name] = command
if info:
self.info(name, info)
def aliases(self, items):
"""Add a list of aliases"""
for entry in items:
self.alias(*entry)
def func(self, name, lines, info=None):
"""Add a single function"""
self.functions[name] = lines
if info:
self.info(name, info)
def info(self, title, text):
"""Add an entry for the info command"""
self.info_entries.append((title, text))
# This is a global object to which all modules add their aliases
ac = AliasCollector()
| class Aliascollector:
def __init__(self):
self.aliases = {}
self.functions = {}
self.commands = {}
self.info_entries = []
def cmd(self, function, alias=None, info=None, name=None):
"""
Registers a command as "turboshell [name]" where name is the name of the function.
@name if provided, sets the name of the command, else name of function is used.
@alias creates an alias for the command.
@info is only used if alias is also provided.
"""
if name is None:
name = function.__name__
self.commands[name] = function
if alias:
self.alias(alias, 'turboshell ' + name)
if info:
self.info(alias, info)
def alias(self, name, command, info=None):
"""Add a single alias"""
self.aliases[name] = command
if info:
self.info(name, info)
def aliases(self, items):
"""Add a list of aliases"""
for entry in items:
self.alias(*entry)
def func(self, name, lines, info=None):
"""Add a single function"""
self.functions[name] = lines
if info:
self.info(name, info)
def info(self, title, text):
"""Add an entry for the info command"""
self.info_entries.append((title, text))
ac = alias_collector() |
class TrainConfig:
def __init__(self):
self.task = 't5_finetune'
self.model_name = 't5-small'
self.outer_lr = 1e-5
self.epochs = 1
self.max_iter = 20000
self.debug = False
self.model_save_pt = 5000
self.write_loc = '..'
self.silent = False
| class Trainconfig:
def __init__(self):
self.task = 't5_finetune'
self.model_name = 't5-small'
self.outer_lr = 1e-05
self.epochs = 1
self.max_iter = 20000
self.debug = False
self.model_save_pt = 5000
self.write_loc = '..'
self.silent = False |
# coding: UTF-8
#A part of NonVisual Desktop Access (NVDA)
#Copyright (C) 2017 Takuya Nishimoto (NVDA Japanese Team)
SRC_FILE = "6ten kanji characters table-UTF8.txt"
with open(SRC_FILE, encoding='utf-8-sig') as f:
for s in f.readlines():
if s and s[0] != '#':
s = s.strip('"\n')
a = s.split("\t")
if len(a) == 2:
print(f"sign \\x{ord(a[0]):x} {a[1]:<20}\t# {a[0]}")
| src_file = '6ten kanji characters table-UTF8.txt'
with open(SRC_FILE, encoding='utf-8-sig') as f:
for s in f.readlines():
if s and s[0] != '#':
s = s.strip('"\n')
a = s.split('\t')
if len(a) == 2:
print(f'sign \\x{ord(a[0]):x} {a[1]:<20}\t# {a[0]}') |
_squares = tuple(x*x for x in range(10))
def _sum_squares_of_digits(n: int) -> int:
s = 0
while n > 0:
s += _squares[n % 10]
n //= 10
return s
def solve():
eighty_nine, limit = 0, 10000000
map_limit = (len(str(limit))) * 81
mapped = [0 for _ in range(map_limit)]
mapped[1], mapped[89] = 1, 89
for c in range(1, limit):
n = _sum_squares_of_digits(c)
if not mapped[n]:
loop = [n]
loop_not_found = True
while loop_not_found:
next_n = _sum_squares_of_digits(n)
if mapped[next_n] or next_n == 1 or next_n == 89:
for num in loop:
mapped[num] = mapped[next_n]
loop_not_found = False
loop.append(next_n)
n = next_n
if mapped[n] == 89:
eighty_nine += 1
print(eighty_nine)
if __name__ == '__main__':
solve()
| _squares = tuple((x * x for x in range(10)))
def _sum_squares_of_digits(n: int) -> int:
s = 0
while n > 0:
s += _squares[n % 10]
n //= 10
return s
def solve():
(eighty_nine, limit) = (0, 10000000)
map_limit = len(str(limit)) * 81
mapped = [0 for _ in range(map_limit)]
(mapped[1], mapped[89]) = (1, 89)
for c in range(1, limit):
n = _sum_squares_of_digits(c)
if not mapped[n]:
loop = [n]
loop_not_found = True
while loop_not_found:
next_n = _sum_squares_of_digits(n)
if mapped[next_n] or next_n == 1 or next_n == 89:
for num in loop:
mapped[num] = mapped[next_n]
loop_not_found = False
loop.append(next_n)
n = next_n
if mapped[n] == 89:
eighty_nine += 1
print(eighty_nine)
if __name__ == '__main__':
solve() |
# -*- coding: utf-8 -*-
MONTH_COLOR = "#c1c1c1"
DAY_COLOR = "#c6c6c6"
TARGET_COLOR = "#212121"
CALENDAR_PUZZLE_COLUMN = 7
class Block(object):
row = 1
col = 1
def __init__(self, row=None, col=None, entity=None, index=None):
if row:
self.row = int(row)
if col:
self.col = int(col)
self.entity = entity
self.index = index
def __repr__(self):
return "Block({}, {})".format(self.row, self.col)
__str__ = __repr__
def __eq__(self, other):
return self.row == other.row and self.col == other.col
def __hash__(self):
return int("{}{}".format(self.row, self.col))
class JAN(Block):
row = 1
col = 1
class FEB(Block):
row = 1
col = 2
class MAR(Block):
row = 1
col = 3
class APR(Block):
row = 1
col = 4
class MAY(Block):
row = 1
col = 5
class JUN(Block):
row = 1
col = 6
class JUL(Block):
row = 2
col = 1
class AUG(Block):
row = 2
col = 2
class SEP(Block):
row = 2
col = 3
class OCT(Block):
row = 2
col = 4
class NOV(Block):
row = 2
col = 5
class DEC(Block):
row = 2
col = 6
total_months = [JAN(), FEB(), MAR(), APR(), MAY(), JUN(), JUL(), AUG(), SEP(), OCT(), NOV(), DEC()]
total_days = [
Block(3 + (i // CALENDAR_PUZZLE_COLUMN), 1 + (i % CALENDAR_PUZZLE_COLUMN), index=i + 1) for i in range(31)
]
| month_color = '#c1c1c1'
day_color = '#c6c6c6'
target_color = '#212121'
calendar_puzzle_column = 7
class Block(object):
row = 1
col = 1
def __init__(self, row=None, col=None, entity=None, index=None):
if row:
self.row = int(row)
if col:
self.col = int(col)
self.entity = entity
self.index = index
def __repr__(self):
return 'Block({}, {})'.format(self.row, self.col)
__str__ = __repr__
def __eq__(self, other):
return self.row == other.row and self.col == other.col
def __hash__(self):
return int('{}{}'.format(self.row, self.col))
class Jan(Block):
row = 1
col = 1
class Feb(Block):
row = 1
col = 2
class Mar(Block):
row = 1
col = 3
class Apr(Block):
row = 1
col = 4
class May(Block):
row = 1
col = 5
class Jun(Block):
row = 1
col = 6
class Jul(Block):
row = 2
col = 1
class Aug(Block):
row = 2
col = 2
class Sep(Block):
row = 2
col = 3
class Oct(Block):
row = 2
col = 4
class Nov(Block):
row = 2
col = 5
class Dec(Block):
row = 2
col = 6
total_months = [jan(), feb(), mar(), apr(), may(), jun(), jul(), aug(), sep(), oct(), nov(), dec()]
total_days = [block(3 + i // CALENDAR_PUZZLE_COLUMN, 1 + i % CALENDAR_PUZZLE_COLUMN, index=i + 1) for i in range(31)] |
Memory = \
{
0: 0,
1: 0,
2: 0,
3: 0,
4: 0,
5: 0,
6: 0,
7: 0,
8: 0,
9: 0,
10: 0,
11: 0,
12: 0,
13: 0,
14: 0,
15: 0,
16: 0,
17: 0,
18: 0,
19: 0,
20: 0,
21: 0,
22: 0,
23: 0,
24: 0,
25: 0,
26: 0,
27: 0,
28: 0,
29: 0,
30: 0,
31: 0,
32: 0,
33: 0,
34: 0,
35: 0,
36: 0,
37: 0,
38: 0,
39: 0,
40: 0
} | memory = {0: 0, 1: 0, 2: 0, 3: 0, 4: 0, 5: 0, 6: 0, 7: 0, 8: 0, 9: 0, 10: 0, 11: 0, 12: 0, 13: 0, 14: 0, 15: 0, 16: 0, 17: 0, 18: 0, 19: 0, 20: 0, 21: 0, 22: 0, 23: 0, 24: 0, 25: 0, 26: 0, 27: 0, 28: 0, 29: 0, 30: 0, 31: 0, 32: 0, 33: 0, 34: 0, 35: 0, 36: 0, 37: 0, 38: 0, 39: 0, 40: 0} |
BLACK = (0, 0, 0)
RED = (255, 0, 0)
GREEN = (0, 255, 0)
YELLOW = (255, 255, 0)
BLUE = (0, 0, 255)
MAGENTA = (255, 0, 255)
CYAN = (0, 255, 255)
WHITE = (255, 255, 255)
| black = (0, 0, 0)
red = (255, 0, 0)
green = (0, 255, 0)
yellow = (255, 255, 0)
blue = (0, 0, 255)
magenta = (255, 0, 255)
cyan = (0, 255, 255)
white = (255, 255, 255) |
class TestingContent:
introduction = (
"Arguably, understanding the current and future state of the COVID-19 "
"pandemic begins with testing. Without testing, we do not understand "
"which counties are managing the spread of this disease effectively "
"and which are simply under-reporting new cases and deaths. In "
"addition to identifying new cases, the percentage of tests that are "
"positive in a particular country helps to answer whether testing is "
"adequate in that country. Currently, the WHO suggests that a "
"percentage of tests that are positive in 10% or less of those who "
"are tested likely indicates that adequate testing is occurring."
)
testing_rate_data = (
"Below is a plot to visualize the percent of COVID-19 tests done in a "
"country that is positive. The desired target is a positive rate of "
"10% or less. Select any number of countries below to compare their "
"respective positive testing rates. Additionally, either the "
"cumulative or the daily (rolling 7 day average) positive testing "
"rates may be selected with the respective radio button choice."
)
testing_volume_data = (
"Below is a plot to visualize the number of daily COVID-19 tests done "
"in selected countries. Select any number of countries to assess "
"their respective daily tests performed. The raw number of daily "
"tests or tests per 1000 residents may be selected with the "
"respective radio button choice."
)
testing_content = TestingContent()
| class Testingcontent:
introduction = 'Arguably, understanding the current and future state of the COVID-19 pandemic begins with testing. Without testing, we do not understand which counties are managing the spread of this disease effectively and which are simply under-reporting new cases and deaths. In addition to identifying new cases, the percentage of tests that are positive in a particular country helps to answer whether testing is adequate in that country. Currently, the WHO suggests that a percentage of tests that are positive in 10% or less of those who are tested likely indicates that adequate testing is occurring.'
testing_rate_data = 'Below is a plot to visualize the percent of COVID-19 tests done in a country that is positive. The desired target is a positive rate of 10% or less. Select any number of countries below to compare their respective positive testing rates. Additionally, either the cumulative or the daily (rolling 7 day average) positive testing rates may be selected with the respective radio button choice.'
testing_volume_data = 'Below is a plot to visualize the number of daily COVID-19 tests done in selected countries. Select any number of countries to assess their respective daily tests performed. The raw number of daily tests or tests per 1000 residents may be selected with the respective radio button choice.'
testing_content = testing_content() |
load("//spm/private/modulemap_parser:declarations.bzl", "declarations")
load(":test_helpers.bzl", "do_failing_parse_test", "do_parse_test")
load("@bazel_skylib//lib:unittest.bzl", "asserts", "unittest")
def _parse_test(ctx):
env = unittest.begin(ctx)
do_parse_test(
env,
"module with umbrella dir",
text = """
module MyModule {
umbrella "path/to/header/files"
}
""",
expected = [
declarations.module(
module_id = "MyModule",
members = [
declarations.umbrella_directory("path/to/header/files"),
],
),
],
)
return unittest.end(env)
parse_test = unittest.make(_parse_test)
def collect_umbrella_dir_declaration_test_suite():
return unittest.suite(
"collect_umbrella_dir_declaration_tests",
parse_test,
)
| load('//spm/private/modulemap_parser:declarations.bzl', 'declarations')
load(':test_helpers.bzl', 'do_failing_parse_test', 'do_parse_test')
load('@bazel_skylib//lib:unittest.bzl', 'asserts', 'unittest')
def _parse_test(ctx):
env = unittest.begin(ctx)
do_parse_test(env, 'module with umbrella dir', text='\n module MyModule {\n umbrella "path/to/header/files"\n }\n ', expected=[declarations.module(module_id='MyModule', members=[declarations.umbrella_directory('path/to/header/files')])])
return unittest.end(env)
parse_test = unittest.make(_parse_test)
def collect_umbrella_dir_declaration_test_suite():
return unittest.suite('collect_umbrella_dir_declaration_tests', parse_test) |
class RenderingImageExposureSettings(object, IDisposable):
""" Represents the exposure settings of rendering. """
def Dispose(self):
""" Dispose(self: RenderingImageExposureSettings) """
pass
def ReleaseUnmanagedResources(self, *args):
""" ReleaseUnmanagedResources(self: RenderingImageExposureSettings,disposing: bool) """
pass
def __enter__(self, *args):
""" __enter__(self: IDisposable) -> object """
pass
def __exit__(self, *args):
""" __exit__(self: IDisposable,exc_type: object,exc_value: object,exc_back: object) """
pass
def __init__(self, *args):
""" x.__init__(...) initializes x; see x.__class__.__doc__ for signaturex.__init__(...) initializes x; see x.__class__.__doc__ for signaturex.__init__(...) initializes x; see x.__class__.__doc__ for signature """
pass
def __repr__(self, *args):
""" __repr__(self: object) -> str """
pass
ExposureValue = property(
lambda self: object(), lambda self, v: None, lambda self: None
)
"""The value of rendering image exposure.
Get: ExposureValue(self: RenderingImageExposureSettings) -> float
Set: ExposureValue(self: RenderingImageExposureSettings)=value
"""
Highlights = property(
lambda self: object(), lambda self, v: None, lambda self: None
)
"""The highlights value.
Get: Highlights(self: RenderingImageExposureSettings) -> float
Set: Highlights(self: RenderingImageExposureSettings)=value
"""
IsValidObject = property(
lambda self: object(), lambda self, v: None, lambda self: None
)
"""Specifies whether the .NET object represents a valid Revit entity.
Get: IsValidObject(self: RenderingImageExposureSettings) -> bool
"""
Saturation = property(
lambda self: object(), lambda self, v: None, lambda self: None
)
"""The value of rendering image saturation.
Get: Saturation(self: RenderingImageExposureSettings) -> float
Set: Saturation(self: RenderingImageExposureSettings)=value
"""
Shadows = property(lambda self: object(), lambda self, v: None, lambda self: None)
"""The shadows value.
Get: Shadows(self: RenderingImageExposureSettings) -> float
Set: Shadows(self: RenderingImageExposureSettings)=value
"""
WhitePoint = property(
lambda self: object(), lambda self, v: None, lambda self: None
)
"""The white point value.
Get: WhitePoint(self: RenderingImageExposureSettings) -> float
Set: WhitePoint(self: RenderingImageExposureSettings)=value
"""
| class Renderingimageexposuresettings(object, IDisposable):
""" Represents the exposure settings of rendering. """
def dispose(self):
""" Dispose(self: RenderingImageExposureSettings) """
pass
def release_unmanaged_resources(self, *args):
""" ReleaseUnmanagedResources(self: RenderingImageExposureSettings,disposing: bool) """
pass
def __enter__(self, *args):
""" __enter__(self: IDisposable) -> object """
pass
def __exit__(self, *args):
""" __exit__(self: IDisposable,exc_type: object,exc_value: object,exc_back: object) """
pass
def __init__(self, *args):
""" x.__init__(...) initializes x; see x.__class__.__doc__ for signaturex.__init__(...) initializes x; see x.__class__.__doc__ for signaturex.__init__(...) initializes x; see x.__class__.__doc__ for signature """
pass
def __repr__(self, *args):
""" __repr__(self: object) -> str """
pass
exposure_value = property(lambda self: object(), lambda self, v: None, lambda self: None)
'The value of rendering image exposure.\n\n\n\nGet: ExposureValue(self: RenderingImageExposureSettings) -> float\n\n\n\nSet: ExposureValue(self: RenderingImageExposureSettings)=value\n\n'
highlights = property(lambda self: object(), lambda self, v: None, lambda self: None)
'The highlights value.\n\n\n\nGet: Highlights(self: RenderingImageExposureSettings) -> float\n\n\n\nSet: Highlights(self: RenderingImageExposureSettings)=value\n\n'
is_valid_object = property(lambda self: object(), lambda self, v: None, lambda self: None)
'Specifies whether the .NET object represents a valid Revit entity.\n\n\n\nGet: IsValidObject(self: RenderingImageExposureSettings) -> bool\n\n\n\n'
saturation = property(lambda self: object(), lambda self, v: None, lambda self: None)
'The value of rendering image saturation.\n\n\n\nGet: Saturation(self: RenderingImageExposureSettings) -> float\n\n\n\nSet: Saturation(self: RenderingImageExposureSettings)=value\n\n'
shadows = property(lambda self: object(), lambda self, v: None, lambda self: None)
'The shadows value.\n\n\n\nGet: Shadows(self: RenderingImageExposureSettings) -> float\n\n\n\nSet: Shadows(self: RenderingImageExposureSettings)=value\n\n'
white_point = property(lambda self: object(), lambda self, v: None, lambda self: None)
'The white point value.\n\n\n\nGet: WhitePoint(self: RenderingImageExposureSettings) -> float\n\n\n\nSet: WhitePoint(self: RenderingImageExposureSettings)=value\n\n' |
input = open("input/input_14.txt").read().split("\n\n")
rules = {element.split(" -> ")[0]: element.split(" -> ")[1] for element in input[1].split("\n")}
str_new = input[0]
for i in range(10):
str_old = str_new
str_new = ""
for char in range(len(str_old)-1):
str_new += str_old[char]
if str_old[char:char+2] in rules.keys():
str_new += rules[str_old[char:char+2]]
str_new += str_old[-1]
occurrences = [str_new.count(a) for a in str_new]
occurrences.sort()
print(str(occurrences[-1]-occurrences[0])) | input = open('input/input_14.txt').read().split('\n\n')
rules = {element.split(' -> ')[0]: element.split(' -> ')[1] for element in input[1].split('\n')}
str_new = input[0]
for i in range(10):
str_old = str_new
str_new = ''
for char in range(len(str_old) - 1):
str_new += str_old[char]
if str_old[char:char + 2] in rules.keys():
str_new += rules[str_old[char:char + 2]]
str_new += str_old[-1]
occurrences = [str_new.count(a) for a in str_new]
occurrences.sort()
print(str(occurrences[-1] - occurrences[0])) |
"""
The field help_text has been renamed into description.
"""
def migrate(data):
if 'version' not in data:
data['version'] = 0
return data
| """
The field help_text has been renamed into description.
"""
def migrate(data):
if 'version' not in data:
data['version'] = 0
return data |
load("@rules_cc//cc:defs.bzl", "cc_binary")
load("@rules_cuda//cuda:defs.bzl", "requires_cuda_enabled", _cuda_library = "cuda_library")
def cuda_library(name, **kwargs):
"""Macro wrapping a cc_library which can contain CUDA device code.
Args:
name: target name.
**kwargs: forwarded to cuda_library rule from rules_cuda
"""
target_compatible_with = kwargs.pop("target_compatible_with", []) + requires_cuda_enabled()
deps = kwargs.pop("deps", []) + ["@local_config_cuda//cuda:cuda_headers"]
_cuda_library(
name = name,
deps = deps,
target_compatible_with = target_compatible_with,
**kwargs
)
def cuda_binary(name, **kwargs):
target_compatible_with = kwargs.pop("target_compatible_with", []) + requires_cuda_enabled()
srcs = kwargs.pop("srcs", None)
if srcs:
virtual_lib = name + "_virtual"
visibility = kwargs.pop("visibility", None)
prev_deps = kwargs.pop("deps", [])
_cuda_library(
name = virtual_lib,
srcs = srcs,
deps = prev_deps + ["@local_config_cuda//cuda:cuda_headers"],
target_compatible_with = target_compatible_with,
visibility = ["//visibility:private"],
**kwargs
)
cc_binary(
name = name,
deps = prev_deps + [virtual_lib],
visibility = visibility, # Restore visibility
target_compatible_with = target_compatible_with,
**kwargs
)
else:
deps = kwargs.pop("deps", []) + ["@rules_cuda//cuda:cuda_runtime"]
cc_binary(name = name, deps = deps, target_compatible_with = target_compatible_with, **kwargs)
| load('@rules_cc//cc:defs.bzl', 'cc_binary')
load('@rules_cuda//cuda:defs.bzl', 'requires_cuda_enabled', _cuda_library='cuda_library')
def cuda_library(name, **kwargs):
"""Macro wrapping a cc_library which can contain CUDA device code.
Args:
name: target name.
**kwargs: forwarded to cuda_library rule from rules_cuda
"""
target_compatible_with = kwargs.pop('target_compatible_with', []) + requires_cuda_enabled()
deps = kwargs.pop('deps', []) + ['@local_config_cuda//cuda:cuda_headers']
_cuda_library(name=name, deps=deps, target_compatible_with=target_compatible_with, **kwargs)
def cuda_binary(name, **kwargs):
target_compatible_with = kwargs.pop('target_compatible_with', []) + requires_cuda_enabled()
srcs = kwargs.pop('srcs', None)
if srcs:
virtual_lib = name + '_virtual'
visibility = kwargs.pop('visibility', None)
prev_deps = kwargs.pop('deps', [])
_cuda_library(name=virtual_lib, srcs=srcs, deps=prev_deps + ['@local_config_cuda//cuda:cuda_headers'], target_compatible_with=target_compatible_with, visibility=['//visibility:private'], **kwargs)
cc_binary(name=name, deps=prev_deps + [virtual_lib], visibility=visibility, target_compatible_with=target_compatible_with, **kwargs)
else:
deps = kwargs.pop('deps', []) + ['@rules_cuda//cuda:cuda_runtime']
cc_binary(name=name, deps=deps, target_compatible_with=target_compatible_with, **kwargs) |
# TODO: Threading / Parallel without blocking the UI
class IncrementalSearch:
"""
Universal incremental search within a list of documents.
"""
def __init__(self, documents, extract_fn):
self.query = ""
self.documents = documents
# Extracted texts related to the documents by index
self.extracts = []
# { "query": [result_idx1, ...], "query a": [result_idx2, ...], ...}
self.cache = {}
self.current_results = list(range(len(documents)))
for doc in self.documents:
extract = extract_fn(doc)
self.extracts.append(extract)
def get_normalized_query(self):
"""
Normalize whitespaces and remove duplicates while preserving order
"""
input_terms = self.query.split()
final_terms = []
for term in input_terms:
# Is the current term a prefix of other already present term?
dups = [t for t in final_terms if t.startswith(term)]
if dups:
# Drop term.
continue
final_terms.append(term)
return " ".join(final_terms)
def get_results(self, max_results=2**32):
return [
self.documents[idx]
for idx in self.current_results[:max_results]
]
def _invalidate_cache(self, query):
"Remove cached results not matching the current query"
# Remove non-prefix cached results
for cached_query in list(self.cache.keys()):
if not query.startswith(cached_query):
del self.cache[cached_query]
# TODO: Maybe keep them if there's less than X entries? Or based on time.
def _find_best_cache(self, query):
"Find best cached results to build next search"
# Find best matching base results
for cut in range(len(query), 0, -1):
part = query[:cut]
if part in self.cache:
return self.cache[part], part
return list(range(len(self.documents))), ""
def search(self, new_query):
"""
Add/remove a character in query - usually at the end.
"""
self.query = new_query
query = self.get_normalized_query()
self._invalidate_cache(query)
cache, cached_query = self._find_best_cache(query)
cached_terms = set(cached_query.split())
query_terms = set(query.split())
new_terms = query_terms - cached_terms
if not new_terms:
self.current_results = cache
return
# Prepare terms
terms_sensitive = set()
terms_insensitive = set()
for term in new_terms:
if term == term.lower():
terms_insensitive.add(term)
else:
terms_sensitive.add(term)
new_results = []
for idx in cache:
extract = self.extracts[idx]
extract_lower = extract.lower()
keep = True
for term in terms_sensitive:
if term not in extract:
keep = False
break
if keep:
for term in terms_insensitive:
if term not in extract_lower:
keep = False
break
if keep:
new_results.append(idx)
# Remember result
self.cache[query] = new_results
self.current_results = new_results
@staticmethod
def recursive_extract_fn(document):
"Extract data from dictionary resursively as string"
parts = []
if isinstance(document, dict):
for key, subvalue in document.items():
parts.append(IncrementalSearch.recursive_extract_fn(subvalue))
elif isinstance(document, (list, set)):
for element in document:
parts.append(IncrementalSearch.recursive_extract_fn(element))
elif isinstance(document, (int, float)):
parts.append(str(document))
elif isinstance(document, str):
parts.append(document)
elif document is None:
return ""
else:
raise Exception(f"Type {type(document)} is unhandled")
return " ".join(parts)
| class Incrementalsearch:
"""
Universal incremental search within a list of documents.
"""
def __init__(self, documents, extract_fn):
self.query = ''
self.documents = documents
self.extracts = []
self.cache = {}
self.current_results = list(range(len(documents)))
for doc in self.documents:
extract = extract_fn(doc)
self.extracts.append(extract)
def get_normalized_query(self):
"""
Normalize whitespaces and remove duplicates while preserving order
"""
input_terms = self.query.split()
final_terms = []
for term in input_terms:
dups = [t for t in final_terms if t.startswith(term)]
if dups:
continue
final_terms.append(term)
return ' '.join(final_terms)
def get_results(self, max_results=2 ** 32):
return [self.documents[idx] for idx in self.current_results[:max_results]]
def _invalidate_cache(self, query):
"""Remove cached results not matching the current query"""
for cached_query in list(self.cache.keys()):
if not query.startswith(cached_query):
del self.cache[cached_query]
def _find_best_cache(self, query):
"""Find best cached results to build next search"""
for cut in range(len(query), 0, -1):
part = query[:cut]
if part in self.cache:
return (self.cache[part], part)
return (list(range(len(self.documents))), '')
def search(self, new_query):
"""
Add/remove a character in query - usually at the end.
"""
self.query = new_query
query = self.get_normalized_query()
self._invalidate_cache(query)
(cache, cached_query) = self._find_best_cache(query)
cached_terms = set(cached_query.split())
query_terms = set(query.split())
new_terms = query_terms - cached_terms
if not new_terms:
self.current_results = cache
return
terms_sensitive = set()
terms_insensitive = set()
for term in new_terms:
if term == term.lower():
terms_insensitive.add(term)
else:
terms_sensitive.add(term)
new_results = []
for idx in cache:
extract = self.extracts[idx]
extract_lower = extract.lower()
keep = True
for term in terms_sensitive:
if term not in extract:
keep = False
break
if keep:
for term in terms_insensitive:
if term not in extract_lower:
keep = False
break
if keep:
new_results.append(idx)
self.cache[query] = new_results
self.current_results = new_results
@staticmethod
def recursive_extract_fn(document):
"""Extract data from dictionary resursively as string"""
parts = []
if isinstance(document, dict):
for (key, subvalue) in document.items():
parts.append(IncrementalSearch.recursive_extract_fn(subvalue))
elif isinstance(document, (list, set)):
for element in document:
parts.append(IncrementalSearch.recursive_extract_fn(element))
elif isinstance(document, (int, float)):
parts.append(str(document))
elif isinstance(document, str):
parts.append(document)
elif document is None:
return ''
else:
raise exception(f'Type {type(document)} is unhandled')
return ' '.join(parts) |
a = 5
b = 10
def zmien(a,b):
c = a
a = b
b = c
print("a:",a)
print("b:",b)
print("a:",a)
print("b:",b)
zmien(a,b) | a = 5
b = 10
def zmien(a, b):
c = a
a = b
b = c
print('a:', a)
print('b:', b)
print('a:', a)
print('b:', b)
zmien(a, b) |
n, k = map(int, input().split())
n_lst = list(map(int, input().split()))
n_lst.sort(reverse=True)
print(sum(n_lst[:k]))
| (n, k) = map(int, input().split())
n_lst = list(map(int, input().split()))
n_lst.sort(reverse=True)
print(sum(n_lst[:k])) |
obj_map = [["glass", 0.015, [0, 0, 0], [0, 0, 0.05510244]], # 0.06
["donut", 0.01, [0, 0, 0], [0, 0, 0.01466367]],
["heart", 0.0006, [0.70738827, -0.70682518, 0], [0, 0, 0.8]],
["airplane", 1, [0, 0, 0], [0, 0, 2.58596408e-02]],
["alarmclock", 1, [0.70738827, -0.70682518, 0], [0, 0, 2.47049890e-02]],
["apple", 1, [0, 0, 0], [0, 0, 0.04999409]],
["banana", 1, [0, 0, 0], [0, 0, 0.02365614]],
["binoculars", 1, [0.70738827, -0.70682518, 0], [0, 0, 0.07999943]],
["body", 0.1, [0, 0, 0], [0, 0, 0.0145278]],
["bowl", 1, [0, 0, 0], [0, 0, 0.03995771]],
["camera", 1, [0, 0, 0], [0, 0, 0.03483407]],
["coffeemug", 1, [0, 0, 0], [0, 0, 0.05387171]],
["cubelarge", 1, [0, 0, 0], [0, 0, 0.06039196]],
["cubemedium", 1, [0, 0, 0], [0, 0, 0.04103902]],
["cubemiddle", 1, [0, 0, 0], [0, 0, 0.04103902]],
["cubesmall", 1, [0, 0, 0], [0, 0, 0.02072159]],
["cup", 1, [0, 0, 0], [0, 0, 0.05127277]],
["cylinderlarge", 1, [0, 0, 0], [0, 0, 0.06135697]],
["cylindermedium", 1, [0, 0, 0], [0, 0, 0.04103905]],
["cylindersmall", 1, [0, 0, 0], [0, 0, 0.02072279]],
["doorknob", 1, [0, 0, 0], [0, 0, 0.0379012]],
["duck", 1, [0, 0, 0], [0, 0, 0.04917608]],
["elephant", 1, [0, 0, 0], [0, 0, 0.05097572]],
["eyeglasses", 1, [0, 0, 0], [0, 0, 0.02300015]],
["flashlight", 1, [0, 0, 0], [0, 0, 0.07037258]],
["flute", 1, [0, 0, 0], [0, 0, 0.0092959]],
["fryingpan", 0.8, [0, 0, 0], [0, 0, 0.01514528]],
["gamecontroller", 1, [0, 0, 0], [0, 0, 0.02604568]],
["hammer", 1, [0, 0, 0], [0, 0, 0.01267463]],
["hand", 1, [0, 0, 0], [0, 0, 0.07001909]],
["headphones", 1, [0, 0, 0], [0, 0, 0.02992321]],
["knife", 1, [0, 0, 0], [0, 0, 0.00824503]],
["lightbulb", 1, [0, 0, 0], [0, 0, 0.03202522]],
["mouse", 1, [0, 0, 0], [0, 0, 0.0201307]],
["mug", 1, [0, 0, 0], [0, 0, 0.05387171]],
["phone", 1, [0, 0, 0], [0, 0, 0.02552063]],
["piggybank", 1, [0, 0, 0], [0, 0, 0.06923257]],
["pyramidlarge", 1, [0, 0, 0], [0, 0, 0.05123203]],
["pyramidmedium", 1, [0, 0, 0], [0, 0, 0.04103812]],
["pyramidsmall", 1, [0, 0, 0], [0, 0, 0.02072198]],
["rubberduck", 1, [0, 0, 0], [0, 0, 0.04917608]],
["scissors", 1, [0, 0, 0], [0, 0, 0.00802606]],
["spherelarge", 1, [0, 0, 0], [0, 0, 0.05382598]],
["spheremedium", 1, [0, 0, 0], [0, 0, 0.03729011]],
["spheresmall", 1, [0, 0, 0], [0, 0, 0.01897534]],
["stamp", 1, [0, 0, 0], [0, 0, 0.0379012]],
["stanfordbunny", 1, [0, 0, 0], [0, 0, 0.06453102]],
["stapler", 1, [0, 0, 0], [0, 0, 0.02116039]],
["table", 5, [0, 0, 0], [0, 0, 0.01403165]],
["teapot", 1, [0, 0, 0], [0, 0, 0.05761634]],
["toothbrush", 1, [0, 0, 0], [0, 0, 0.00701304]],
["toothpaste", 1, [0.50039816, -0.49999984, -0.49960184], [0, 0, 0.02]],
["toruslarge", 1, [0, 0, 0], [0, 0, 0.02080752]],
["torusmedium", 1, [0, 0, 0], [0, 0, 0.01394647]],
["torussmall", 1, [0, 0, 0], [0, 0, 0.00734874]],
["train", 1, [0, 0, 0], [0, 0, 0.04335064]],
["watch", 1, [0, 0, 0], [0, 0, 0.0424445]],
["waterbottle", 1, [0, 0, 0], [0, 0, 0.08697578]],
["wineglass", 1, [0, 0, 0], [0, 0, 0.0424445]],
["wristwatch", 1, [0, 0, 0], [0, 0, 0.06880109]]]
output_map = {}
for obj in obj_map:
output_map[obj[0]] = obj[2]
print(output_map) | obj_map = [['glass', 0.015, [0, 0, 0], [0, 0, 0.05510244]], ['donut', 0.01, [0, 0, 0], [0, 0, 0.01466367]], ['heart', 0.0006, [0.70738827, -0.70682518, 0], [0, 0, 0.8]], ['airplane', 1, [0, 0, 0], [0, 0, 0.0258596408]], ['alarmclock', 1, [0.70738827, -0.70682518, 0], [0, 0, 0.024704989]], ['apple', 1, [0, 0, 0], [0, 0, 0.04999409]], ['banana', 1, [0, 0, 0], [0, 0, 0.02365614]], ['binoculars', 1, [0.70738827, -0.70682518, 0], [0, 0, 0.07999943]], ['body', 0.1, [0, 0, 0], [0, 0, 0.0145278]], ['bowl', 1, [0, 0, 0], [0, 0, 0.03995771]], ['camera', 1, [0, 0, 0], [0, 0, 0.03483407]], ['coffeemug', 1, [0, 0, 0], [0, 0, 0.05387171]], ['cubelarge', 1, [0, 0, 0], [0, 0, 0.06039196]], ['cubemedium', 1, [0, 0, 0], [0, 0, 0.04103902]], ['cubemiddle', 1, [0, 0, 0], [0, 0, 0.04103902]], ['cubesmall', 1, [0, 0, 0], [0, 0, 0.02072159]], ['cup', 1, [0, 0, 0], [0, 0, 0.05127277]], ['cylinderlarge', 1, [0, 0, 0], [0, 0, 0.06135697]], ['cylindermedium', 1, [0, 0, 0], [0, 0, 0.04103905]], ['cylindersmall', 1, [0, 0, 0], [0, 0, 0.02072279]], ['doorknob', 1, [0, 0, 0], [0, 0, 0.0379012]], ['duck', 1, [0, 0, 0], [0, 0, 0.04917608]], ['elephant', 1, [0, 0, 0], [0, 0, 0.05097572]], ['eyeglasses', 1, [0, 0, 0], [0, 0, 0.02300015]], ['flashlight', 1, [0, 0, 0], [0, 0, 0.07037258]], ['flute', 1, [0, 0, 0], [0, 0, 0.0092959]], ['fryingpan', 0.8, [0, 0, 0], [0, 0, 0.01514528]], ['gamecontroller', 1, [0, 0, 0], [0, 0, 0.02604568]], ['hammer', 1, [0, 0, 0], [0, 0, 0.01267463]], ['hand', 1, [0, 0, 0], [0, 0, 0.07001909]], ['headphones', 1, [0, 0, 0], [0, 0, 0.02992321]], ['knife', 1, [0, 0, 0], [0, 0, 0.00824503]], ['lightbulb', 1, [0, 0, 0], [0, 0, 0.03202522]], ['mouse', 1, [0, 0, 0], [0, 0, 0.0201307]], ['mug', 1, [0, 0, 0], [0, 0, 0.05387171]], ['phone', 1, [0, 0, 0], [0, 0, 0.02552063]], ['piggybank', 1, [0, 0, 0], [0, 0, 0.06923257]], ['pyramidlarge', 1, [0, 0, 0], [0, 0, 0.05123203]], ['pyramidmedium', 1, [0, 0, 0], [0, 0, 0.04103812]], ['pyramidsmall', 1, [0, 0, 0], [0, 0, 0.02072198]], ['rubberduck', 1, [0, 0, 0], [0, 0, 0.04917608]], ['scissors', 1, [0, 0, 0], [0, 0, 0.00802606]], ['spherelarge', 1, [0, 0, 0], [0, 0, 0.05382598]], ['spheremedium', 1, [0, 0, 0], [0, 0, 0.03729011]], ['spheresmall', 1, [0, 0, 0], [0, 0, 0.01897534]], ['stamp', 1, [0, 0, 0], [0, 0, 0.0379012]], ['stanfordbunny', 1, [0, 0, 0], [0, 0, 0.06453102]], ['stapler', 1, [0, 0, 0], [0, 0, 0.02116039]], ['table', 5, [0, 0, 0], [0, 0, 0.01403165]], ['teapot', 1, [0, 0, 0], [0, 0, 0.05761634]], ['toothbrush', 1, [0, 0, 0], [0, 0, 0.00701304]], ['toothpaste', 1, [0.50039816, -0.49999984, -0.49960184], [0, 0, 0.02]], ['toruslarge', 1, [0, 0, 0], [0, 0, 0.02080752]], ['torusmedium', 1, [0, 0, 0], [0, 0, 0.01394647]], ['torussmall', 1, [0, 0, 0], [0, 0, 0.00734874]], ['train', 1, [0, 0, 0], [0, 0, 0.04335064]], ['watch', 1, [0, 0, 0], [0, 0, 0.0424445]], ['waterbottle', 1, [0, 0, 0], [0, 0, 0.08697578]], ['wineglass', 1, [0, 0, 0], [0, 0, 0.0424445]], ['wristwatch', 1, [0, 0, 0], [0, 0, 0.06880109]]]
output_map = {}
for obj in obj_map:
output_map[obj[0]] = obj[2]
print(output_map) |
def AddLinear2TreeBranch(G,v1,v2,l):
vert1 = v1
vert2 = v2
for i in range(l):
vnew = max(G.vertices()) + 1
G.add_edges([[vert1, vnew],[vert2,vnew]])
vert1 = vert2
vert2 = vnew
return G
def Pinwheel(n):
G = Graph()
G.add_edges([[0,1],[1,2],[2,0]])
G = AddLinear2TreeBranch(G,0,1,n)
G = AddLinear2TreeBranch(G,1,2,n)
G = AddLinear2TreeBranch(G,2,0,n)
return G
def APinwheel(n):
G = Graph()
G.add_edges([[0,1],[1,2],[2,0]])
G = AddLinear2TreeBranch(G,0,1,n)
G = AddLinear2TreeBranch(G,1,2,n)
G = AddLinear2TreeBranch(G,0,2,n)
return G
| def add_linear2_tree_branch(G, v1, v2, l):
vert1 = v1
vert2 = v2
for i in range(l):
vnew = max(G.vertices()) + 1
G.add_edges([[vert1, vnew], [vert2, vnew]])
vert1 = vert2
vert2 = vnew
return G
def pinwheel(n):
g = graph()
G.add_edges([[0, 1], [1, 2], [2, 0]])
g = add_linear2_tree_branch(G, 0, 1, n)
g = add_linear2_tree_branch(G, 1, 2, n)
g = add_linear2_tree_branch(G, 2, 0, n)
return G
def a_pinwheel(n):
g = graph()
G.add_edges([[0, 1], [1, 2], [2, 0]])
g = add_linear2_tree_branch(G, 0, 1, n)
g = add_linear2_tree_branch(G, 1, 2, n)
g = add_linear2_tree_branch(G, 0, 2, n)
return G |
####################
# POST /account/ #
####################
def test_create_account(flask_client):
shrek = {
"username": "Shrek",
"email": "ceo@swamp.com"
}
res = flask_client.post('/account/', json=shrek)
assert res.status_code == 200
created_user = res.get_json()
# Assert POST requests returns something in JSON
assert created_user is not None
# Assert that the id field is present
assert created_user.get('id') is not None
# Assert data didn't change
assert created_user.get('username') == shrek['username']
assert created_user.get('email') == shrek['email']
def test_create_account_rejects_urlencoded(flask_client):
res = flask_client.post(
'/account/',
data={"username": "Donkey", "email": "donkey@swamp.com"}
)
assert res.status_code == 400
err_data = res.get_json()
assert "error" in err_data
assert "json" in err_data['error'].lower()
assert "supported" in err_data['error'].lower()
def test_create_account_empty_body(flask_client):
res = flask_client.post('/account/')
assert res.status_code == 400
assert "error" in res.get_json()
def test_create_account_no_username(flask_client):
user_no_name = {
"email": "noname@swamp.com"
}
res = flask_client.post('/account/', json=user_no_name)
err_data = res.get_json()
assert res.status_code == 400
assert "error" in err_data
assert "username" in err_data['error']
assert "required" in err_data['error']
def test_create_account_no_email(flask_client):
user_no_email = {
"username": "no-email-man"
}
res = flask_client.post('/account/', json=user_no_email)
err_data = res.get_json()
assert res.status_code == 400
assert "error" in err_data
assert "email" in err_data['error']
assert "required" in err_data['error']
def test_create_account_existing_email(flask_client):
# Create first user with this email
donkey = {
"username": "Donkey",
"email": "donkey@swamp.com"
}
res = flask_client.post('/account/', json=donkey)
assert res.status_code == 200
# Try to create another user with this same email, but another name
donkey["username"] = 'Dankey'
res = flask_client.post('/account/', json=donkey)
assert res.status_code == 409
err_data = res.get_json()
assert "error" in err_data
assert "email" in err_data['error']
assert "exists" in err_data['error']
######################
# GET /account/ #
######################
def test_get_account(flask_client, user_account):
res = flask_client.get('/account/', headers=[user_account.auth_header])
assert res.status_code == 200
data = res.get_json()
assert data is not None
assert "error" not in data
assert data.get('id') == user_account.id
assert data.get('email') == user_account.email
assert data.get('username') == user_account.username
def test_get_nonexistent_account(flask_client):
res = flask_client.get('/account/', headers=[('Authorization', 'Bearer 1337322696969')])
assert res.status_code == 404
data = res.get_json()
assert "error" in data
assert "account" in data['error'].lower()
assert "not found" in data['error']
def test_get_account_no_auth(flask_client):
# Basically check that we didn't forget to add @auth_required
# Headers, error msg, etc. are covered by test_auth tests
res = flask_client.get('/account/')
assert res.status_code == 401
######################
# DELETE /account/ #
######################
def test_delete_account(flask_client, user_account):
res = flask_client.delete('/account/', headers=[user_account.auth_header])
assert res.status_code == 200
get_deleted_user_res = flask_client.get(f'/users/{user_account.id}')
assert get_deleted_user_res.status_code == 404
def test_repeated_delete_account(flask_client, user_account):
res = flask_client.delete('/account/', headers=[user_account.auth_header])
assert res.status_code == 200
del_again_res = flask_client.delete('/account/', headers=[user_account.auth_header])
assert del_again_res.status_code == 404
assert "error" in del_again_res.get_json()
assert "already deleted" in del_again_res.get_json()['error']
def test_delete_account_no_auth(flask_client):
res = flask_client.delete('/account/')
assert res.status_code == 401
| def test_create_account(flask_client):
shrek = {'username': 'Shrek', 'email': 'ceo@swamp.com'}
res = flask_client.post('/account/', json=shrek)
assert res.status_code == 200
created_user = res.get_json()
assert created_user is not None
assert created_user.get('id') is not None
assert created_user.get('username') == shrek['username']
assert created_user.get('email') == shrek['email']
def test_create_account_rejects_urlencoded(flask_client):
res = flask_client.post('/account/', data={'username': 'Donkey', 'email': 'donkey@swamp.com'})
assert res.status_code == 400
err_data = res.get_json()
assert 'error' in err_data
assert 'json' in err_data['error'].lower()
assert 'supported' in err_data['error'].lower()
def test_create_account_empty_body(flask_client):
res = flask_client.post('/account/')
assert res.status_code == 400
assert 'error' in res.get_json()
def test_create_account_no_username(flask_client):
user_no_name = {'email': 'noname@swamp.com'}
res = flask_client.post('/account/', json=user_no_name)
err_data = res.get_json()
assert res.status_code == 400
assert 'error' in err_data
assert 'username' in err_data['error']
assert 'required' in err_data['error']
def test_create_account_no_email(flask_client):
user_no_email = {'username': 'no-email-man'}
res = flask_client.post('/account/', json=user_no_email)
err_data = res.get_json()
assert res.status_code == 400
assert 'error' in err_data
assert 'email' in err_data['error']
assert 'required' in err_data['error']
def test_create_account_existing_email(flask_client):
donkey = {'username': 'Donkey', 'email': 'donkey@swamp.com'}
res = flask_client.post('/account/', json=donkey)
assert res.status_code == 200
donkey['username'] = 'Dankey'
res = flask_client.post('/account/', json=donkey)
assert res.status_code == 409
err_data = res.get_json()
assert 'error' in err_data
assert 'email' in err_data['error']
assert 'exists' in err_data['error']
def test_get_account(flask_client, user_account):
res = flask_client.get('/account/', headers=[user_account.auth_header])
assert res.status_code == 200
data = res.get_json()
assert data is not None
assert 'error' not in data
assert data.get('id') == user_account.id
assert data.get('email') == user_account.email
assert data.get('username') == user_account.username
def test_get_nonexistent_account(flask_client):
res = flask_client.get('/account/', headers=[('Authorization', 'Bearer 1337322696969')])
assert res.status_code == 404
data = res.get_json()
assert 'error' in data
assert 'account' in data['error'].lower()
assert 'not found' in data['error']
def test_get_account_no_auth(flask_client):
res = flask_client.get('/account/')
assert res.status_code == 401
def test_delete_account(flask_client, user_account):
res = flask_client.delete('/account/', headers=[user_account.auth_header])
assert res.status_code == 200
get_deleted_user_res = flask_client.get(f'/users/{user_account.id}')
assert get_deleted_user_res.status_code == 404
def test_repeated_delete_account(flask_client, user_account):
res = flask_client.delete('/account/', headers=[user_account.auth_header])
assert res.status_code == 200
del_again_res = flask_client.delete('/account/', headers=[user_account.auth_header])
assert del_again_res.status_code == 404
assert 'error' in del_again_res.get_json()
assert 'already deleted' in del_again_res.get_json()['error']
def test_delete_account_no_auth(flask_client):
res = flask_client.delete('/account/')
assert res.status_code == 401 |
def autonomous_setup():
pass
def autonomous_main():
print('Running auto main ...')
def teleop_setup():
pass
def teleop_main():
print('Running teleop main ...')
| def autonomous_setup():
pass
def autonomous_main():
print('Running auto main ...')
def teleop_setup():
pass
def teleop_main():
print('Running teleop main ...') |
class APrawcoreException(Exception):
"""Base exception class for exceptions that occur within this package."""
class InvalidInvocation(APrawcoreException):
"""Indicate that the code to execute cannot be completed."""
class RequestException(APrawcoreException):
# yoinked this from praw
def __init__(self, original_exception, request_args, request_kwargs):
self.original_exception = original_exception
self.request_args = request_args
self.request_kwargs = request_kwargs
super(RequestException, self).__init__('error with request {}'
.format(original_exception))
| class Aprawcoreexception(Exception):
"""Base exception class for exceptions that occur within this package."""
class Invalidinvocation(APrawcoreException):
"""Indicate that the code to execute cannot be completed."""
class Requestexception(APrawcoreException):
def __init__(self, original_exception, request_args, request_kwargs):
self.original_exception = original_exception
self.request_args = request_args
self.request_kwargs = request_kwargs
super(RequestException, self).__init__('error with request {}'.format(original_exception)) |
expected_output = {
"active_translations": {"dynamic": 1, "extended": 1, "static": 0, "total": 1},
"cef_punted_pkts": 0,
"cef_translated_pkts": 4,
"dynamic_mappings": {
"inside_source": {
"id": {
3: {
"access_list": "99",
"interface": "Serial0/0",
"match": "access-list 99 interface Serial0/0",
"refcount": 1,
}
}
}
},
"expired_translations": 0,
"hits": 3,
"interfaces": {"inside": ["FastEthernet0/0"], "outside": ["Serial0/0"]},
"misses": 1,
"queued_pkts": 0,
}
| expected_output = {'active_translations': {'dynamic': 1, 'extended': 1, 'static': 0, 'total': 1}, 'cef_punted_pkts': 0, 'cef_translated_pkts': 4, 'dynamic_mappings': {'inside_source': {'id': {3: {'access_list': '99', 'interface': 'Serial0/0', 'match': 'access-list 99 interface Serial0/0', 'refcount': 1}}}}, 'expired_translations': 0, 'hits': 3, 'interfaces': {'inside': ['FastEthernet0/0'], 'outside': ['Serial0/0']}, 'misses': 1, 'queued_pkts': 0} |
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
load("@bazel_tools//tools/build_defs/repo:utils.bzl", "maybe")
load("@bazelrio//:deps_utils.bzl", "cc_library_shared")
def setup_ni_2022_2_3_dependencies():
maybe(
http_archive,
"__bazelrio_edu_wpi_first_ni-libraries_chipobject_linuxathena",
url = "https://frcmaven.wpi.edu/release/edu/wpi/first/ni-libraries/chipobject/2022.2.3/chipobject-2022.2.3-linuxathena.zip",
sha256 = "fdf47ae5ce052edd82ba2b6e007faabf9286f87b079e3789afc3235733d5475c",
build_file_content = cc_library_shared,
)
maybe(
http_archive,
"__bazelrio_edu_wpi_first_ni-libraries_visa_linuxathena",
url = "https://frcmaven.wpi.edu/release/edu/wpi/first/ni-libraries/visa/2022.2.3/visa-2022.2.3-linuxathena.zip",
sha256 = "014fff5a4684f3c443cbed8c52f19687733dd7053a98a1dad89941801e0b7930",
build_file_content = cc_library_shared,
)
maybe(
http_archive,
"__bazelrio_edu_wpi_first_ni-libraries_runtime_linuxathena",
url = "https://frcmaven.wpi.edu/release/edu/wpi/first/ni-libraries/runtime/2022.2.3/runtime-2022.2.3-linuxathena.zip",
sha256 = "186d1b41e96c5d761705221afe0b9f488d1ce86e8149a7b0afdc3abc93097266",
build_file_content = cc_library_shared,
)
maybe(
http_archive,
"__bazelrio_edu_wpi_first_ni-libraries_netcomm_linuxathena",
url = "https://frcmaven.wpi.edu/release/edu/wpi/first/ni-libraries/netcomm/2022.2.3/netcomm-2022.2.3-linuxathena.zip",
sha256 = "f56c2fc0943f27f174642664b37fb4529d6f2b6405fe41a639a4c9f31e175c73",
build_file_content = cc_library_shared,
)
| load('@bazel_tools//tools/build_defs/repo:http.bzl', 'http_archive')
load('@bazel_tools//tools/build_defs/repo:utils.bzl', 'maybe')
load('@bazelrio//:deps_utils.bzl', 'cc_library_shared')
def setup_ni_2022_2_3_dependencies():
maybe(http_archive, '__bazelrio_edu_wpi_first_ni-libraries_chipobject_linuxathena', url='https://frcmaven.wpi.edu/release/edu/wpi/first/ni-libraries/chipobject/2022.2.3/chipobject-2022.2.3-linuxathena.zip', sha256='fdf47ae5ce052edd82ba2b6e007faabf9286f87b079e3789afc3235733d5475c', build_file_content=cc_library_shared)
maybe(http_archive, '__bazelrio_edu_wpi_first_ni-libraries_visa_linuxathena', url='https://frcmaven.wpi.edu/release/edu/wpi/first/ni-libraries/visa/2022.2.3/visa-2022.2.3-linuxathena.zip', sha256='014fff5a4684f3c443cbed8c52f19687733dd7053a98a1dad89941801e0b7930', build_file_content=cc_library_shared)
maybe(http_archive, '__bazelrio_edu_wpi_first_ni-libraries_runtime_linuxathena', url='https://frcmaven.wpi.edu/release/edu/wpi/first/ni-libraries/runtime/2022.2.3/runtime-2022.2.3-linuxathena.zip', sha256='186d1b41e96c5d761705221afe0b9f488d1ce86e8149a7b0afdc3abc93097266', build_file_content=cc_library_shared)
maybe(http_archive, '__bazelrio_edu_wpi_first_ni-libraries_netcomm_linuxathena', url='https://frcmaven.wpi.edu/release/edu/wpi/first/ni-libraries/netcomm/2022.2.3/netcomm-2022.2.3-linuxathena.zip', sha256='f56c2fc0943f27f174642664b37fb4529d6f2b6405fe41a639a4c9f31e175c73', build_file_content=cc_library_shared) |
#
# @lc app=leetcode id=712 lang=python3
#
# [712] Minimum ASCII Delete Sum for Two Strings
#
# @lc code=start
class Solution:
def minimumDeleteSum(self, s1: str, s2: str) -> int:
m, n = len(s1), len(s2)
dp = [[0] * (n + 1) for _ in range(m + 1)]
for i in range(m - 1, -1, -1):
dp[i][n] = dp[i + 1][n] + ord(s1[i])
for j in range(n - 1, -1, -1):
dp[m][j] = dp[m][j + 1] + ord(s2[j])
for i in range(m - 1, -1, -1):
for j in range(n - 1, -1, -1):
if s1[i] == s2[j]:
dp[i][j] = dp[i + 1][j + 1]
else:
dp[i][j] = min(dp[i + 1][j] + ord(s1[i]), dp[i][j + 1] + ord(s2[j]))
return dp[0][0]
# @lc code=end
| class Solution:
def minimum_delete_sum(self, s1: str, s2: str) -> int:
(m, n) = (len(s1), len(s2))
dp = [[0] * (n + 1) for _ in range(m + 1)]
for i in range(m - 1, -1, -1):
dp[i][n] = dp[i + 1][n] + ord(s1[i])
for j in range(n - 1, -1, -1):
dp[m][j] = dp[m][j + 1] + ord(s2[j])
for i in range(m - 1, -1, -1):
for j in range(n - 1, -1, -1):
if s1[i] == s2[j]:
dp[i][j] = dp[i + 1][j + 1]
else:
dp[i][j] = min(dp[i + 1][j] + ord(s1[i]), dp[i][j + 1] + ord(s2[j]))
return dp[0][0] |
"""Provides the log level constants for the dss.pubsub packackage.
"""
EMERG = 80
ALERT = 70
CRITICAL = 60
ERROR = 50
WARNING = 40
NOTICE = 30
INFO = 20
DEBUG = 10
ALL = 0
_level_names = {
EMERG : 'EMERG',
ALERT : 'ALERT',
CRITICAL : 'CRITICAL',
ERROR : 'ERROR',
WARNING : 'WARNING',
NOTICE : 'NOTICE',
INFO : 'INFO',
DEBUG : 'DEBUG',
ALL : 'ALL',
}
# return the string representation of a numeric log level
get_level_name = _level_names.get
| """Provides the log level constants for the dss.pubsub packackage.
"""
emerg = 80
alert = 70
critical = 60
error = 50
warning = 40
notice = 30
info = 20
debug = 10
all = 0
_level_names = {EMERG: 'EMERG', ALERT: 'ALERT', CRITICAL: 'CRITICAL', ERROR: 'ERROR', WARNING: 'WARNING', NOTICE: 'NOTICE', INFO: 'INFO', DEBUG: 'DEBUG', ALL: 'ALL'}
get_level_name = _level_names.get |
"""
Problem Name: Array Rotation
CodeChef Link: https://www.codechef.com/LTIME95C/problems/ARRROT/
Problem Code: ARRROT
"""
n = int(input())
li = list(map(int, input().split()))
q = int(input())
li2 = list(map(int, input().split()))
s = sum(li)
x = 0
for i in li2:
x = (2 * s)
s = x
print(x % (1000000007))
| """
Problem Name: Array Rotation
CodeChef Link: https://www.codechef.com/LTIME95C/problems/ARRROT/
Problem Code: ARRROT
"""
n = int(input())
li = list(map(int, input().split()))
q = int(input())
li2 = list(map(int, input().split()))
s = sum(li)
x = 0
for i in li2:
x = 2 * s
s = x
print(x % 1000000007) |
#!/usr/bin/env python
# coding: utf-8
"""
Critical value polynomials and related quantities for the bounds test of
Pesaran, M. H., Shin, Y., & Smith, R. J. (2001). Bounds testing approaches
to the analysis of level relationships. Journal of applied econometrics,
16(3), 289-326.
These were computed using 32,000,000 simulations for each key using the
methodology of PSS, who only used 40,000. The asymptotic P-value response
functions were computed based on the simulated value. Critical values
are the point estimates for the respective quantiles. The simulation code
is contained in pss.py. The output files from this function are then
transformed using pss-process.py.
The format of the keys are (k, case, I1) where
* k is is the number of x variables included in the model (0 is an ADF)
* case is 1, 2, 3, 4 or 5 and corresponds to the PSS paper
* I1 is True if X contains I1 variables and False if X is stationary
The parameters are for polynomials of order 3 (large) or 2 (small).
stat_star is the value where the switch between large and small occurs.
Stat values less then stat_star use large_p, while values above use
small_p. In all cases the stat is logged prior to computing the p-value
so that the p-value is
1 - Phi(c[0] + c[1] * x + c[2] * x**2 + c[3] * x**3)
where x = np.log(stat) and Phi() is the normal cdf.
When this the models, the polynomial is evaluated at the natural log of the
test statistic and then the normal CDF of this value is computed to produce
the p-value.
"""
__all__ = ["large_p", "small_p", "crit_vals", "crit_percentiles", "stat_star"]
large_p = {
(1, 1, False): [0.2231, 0.91426, 0.10102, 0.00569],
(1, 1, True): [-0.21766, 0.85933, 0.10411, 0.00661],
(1, 2, False): [-0.60796, 1.48713, 0.15076, 0.04453],
(1, 2, True): [-0.96204, 1.52593, 0.15996, 0.04166],
(1, 3, False): [-0.62883, 0.78991, 0.1, 0.00693],
(1, 3, True): [-0.91895, 0.82086, 0.12921, 0.01076],
(1, 4, False): [-1.50546, 1.79052, 0.05488, 0.06801],
(1, 4, True): [-1.79654, 1.8048, 0.06573, 0.06768],
(1, 5, False): [-1.36367, 0.94126, 0.21556, 0.02473],
(1, 5, True): [-1.60554, 0.93305, 0.2422, 0.03241],
(2, 1, False): [0.20576, 1.18914, 0.15731, 0.01144],
(2, 1, True): [-0.49024, 1.16958, 0.20564, 0.02008],
(2, 2, False): [-0.51799, 1.6368, 0.18955, 0.04317],
(2, 2, True): [-1.13394, 1.71056, 0.20442, 0.04195],
(2, 3, False): [-0.51712, 1.12963, 0.18936, 0.01808],
(2, 3, True): [-1.07441, 1.14964, 0.26066, 0.03338],
(2, 4, False): [-1.29895, 1.88501, 0.11734, 0.06615],
(2, 4, True): [-1.82455, 1.92207, 0.13753, 0.06269],
(2, 5, False): [-1.22263, 1.23208, 0.31401, 0.04495],
(2, 5, True): [-1.67689, 1.17567, 0.33606, 0.05898],
(3, 1, False): [0.1826, 1.39275, 0.19774, 0.01647],
(3, 1, True): [-0.71889, 1.39726, 0.29712, 0.03794],
(3, 2, False): [-0.45864, 1.77632, 0.22125, 0.04372],
(3, 2, True): [-1.28619, 1.88107, 0.23969, 0.04414],
(3, 3, False): [-0.45093, 1.38824, 0.26556, 0.03063],
(3, 3, True): [-1.22712, 1.36564, 0.34942, 0.05555],
(3, 4, False): [-1.15886, 1.99182, 0.16358, 0.06392],
(3, 4, True): [-1.88388, 2.05362, 0.18349, 0.06501],
(3, 5, False): [-1.11221, 1.44327, 0.3547, 0.05263],
(3, 5, True): [-1.75354, 1.37461, 0.3882, 0.07239],
(4, 1, False): [0.16431, 1.56391, 0.22944, 0.02067],
(4, 1, True): [-0.90799, 1.56908, 0.34763, 0.04814],
(4, 2, False): [-0.41568, 1.90715, 0.24783, 0.04407],
(4, 2, True): [-1.42373, 2.03902, 0.26907, 0.04755],
(4, 3, False): [-0.41104, 1.5716, 0.3066, 0.03842],
(4, 3, True): [-1.36194, 1.54043, 0.40145, 0.06846],
(4, 4, False): [-1.05651, 2.10007, 0.20201, 0.06129],
(4, 4, True): [-1.95474, 2.18305, 0.22527, 0.06441],
(4, 5, False): [-1.02502, 1.62605, 0.38203, 0.05565],
(4, 5, True): [-1.83458, 1.555, 0.42888, 0.07459],
(5, 1, False): [0.15015, 1.71718, 0.2584, 0.02507],
(5, 1, True): [-1.0707, 1.72829, 0.39037, 0.05468],
(5, 2, False): [-0.38277, 2.02985, 0.27139, 0.04513],
(5, 2, True): [-1.54974, 2.18631, 0.29592, 0.04967],
(5, 3, False): [-0.38023, 1.72586, 0.33033, 0.04188],
(5, 3, True): [-1.48415, 1.70271, 0.44016, 0.07248],
(5, 4, False): [-0.97676, 2.20429, 0.23233, 0.06543],
(5, 4, True): [-2.03144, 2.31343, 0.25394, 0.0675],
(5, 5, False): [-0.95421, 1.78775, 0.40239, 0.05642],
(5, 5, True): [-1.91679, 1.72031, 0.46434, 0.06641],
(6, 1, False): [0.13913, 1.8581, 0.28528, 0.02931],
(6, 1, True): [-1.21438, 1.87638, 0.42416, 0.05485],
(6, 2, False): [-0.35664, 2.14606, 0.29484, 0.04728],
(6, 2, True): [-1.66532, 2.32448, 0.31723, 0.05528],
(6, 3, False): [-0.35498, 1.86634, 0.35087, 0.04455],
(6, 3, True): [-1.59785, 1.85278, 0.47304, 0.07114],
(6, 4, False): [-0.91274, 2.30752, 0.26053, 0.0644],
(6, 4, True): [-2.10956, 2.43721, 0.2852, 0.06694],
(6, 5, False): [-0.89553, 1.9318, 0.41381, 0.05292],
(6, 5, True): [-1.99931, 1.87789, 0.49842, 0.04135],
(7, 1, False): [0.12974, 1.98503, 0.30606, 0.03218],
(7, 1, True): [-1.34555, 2.01647, 0.45456, 0.05018],
(7, 2, False): [-0.33519, 2.25631, 0.31659, 0.05016],
(7, 2, True): [-1.77496, 2.45806, 0.3372, 0.05741],
(7, 3, False): [-0.33377, 1.99554, 0.36742, 0.04624],
(7, 3, True): [-1.70381, 1.99863, 0.49883, 0.05092],
(7, 4, False): [-0.8596, 2.40762, 0.28334, 0.06401],
(7, 4, True): [-2.18704, 2.55828, 0.30627, 0.07091],
(7, 5, False): [-0.84606, 2.06291, 0.42505, 0.05152],
(7, 5, True): [-2.08097, 2.02139, 0.5348, 0.02343],
(8, 1, False): [0.12244, 2.10698, 0.32849, 0.03596],
(8, 1, True): [-1.46632, 2.1505, 0.48168, 0.04116],
(8, 2, False): [-0.31707, 2.36107, 0.33198, 0.04953],
(8, 2, True): [-1.87722, 2.58105, 0.35963, 0.05848],
(8, 3, False): [-0.31629, 2.11679, 0.38514, 0.04868],
(8, 3, True): [-1.80483, 2.13412, 0.52935, 0.03618],
(8, 4, False): [-0.81509, 2.50518, 0.30456, 0.06388],
(8, 4, True): [-2.26501, 2.67227, 0.33843, 0.06554],
(8, 5, False): [-0.80333, 2.18457, 0.42995, 0.0463],
(8, 5, True): [-2.16125, 2.15208, 0.58319, 0.0],
(9, 1, False): [0.11562, 2.22037, 0.34907, 0.03968],
(9, 1, True): [-1.57878, 2.27626, 0.5124, 0.03164],
(9, 2, False): [-0.30188, 2.46235, 0.35132, 0.05209],
(9, 2, True): [-1.97465, 2.70256, 0.37466, 0.06205],
(9, 3, False): [-0.30097, 2.23118, 0.39976, 0.05001],
(9, 3, True): [-1.90164, 2.26261, 0.56431, 0.0175],
(9, 4, False): [-0.77664, 2.59712, 0.32618, 0.06452],
(9, 4, True): [-2.33996, 2.78253, 0.36072, 0.06644],
(9, 5, False): [-0.76631, 2.2987, 0.43834, 0.04274],
(9, 5, True): [-2.23753, 2.27521, 0.60763, 0.0],
(10, 1, False): [0.10995, 2.3278, 0.36567, 0.04153],
(10, 1, True): [-1.6849, 2.39419, 0.5433, 0.02457],
(10, 2, False): [-0.28847, 2.55819, 0.36959, 0.05499],
(10, 2, True): [-2.06725, 2.81756, 0.38761, 0.0676],
(10, 3, False): [-0.28748, 2.33948, 0.41398, 0.05101],
(10, 3, True): [-1.99259, 2.38061, 0.59433, 0.01114],
(10, 4, False): [-0.74317, 2.68624, 0.345, 0.07032],
(10, 4, True): [-2.41409, 2.8931, 0.37487, 0.07102],
(10, 5, False): [-0.73464, 2.40692, 0.45153, 0.0434],
(10, 5, True): [-2.31364, 2.39092, 0.64313, -0.01012],
}
small_p = {
(1, 1, False): [0.2585, 0.92944, 0.25921],
(1, 1, True): [-0.17399, 0.88425, 0.29947],
(1, 2, False): [-0.45787, 1.15813, 0.37268],
(1, 2, True): [-0.76388, 1.13438, 0.39908],
(1, 3, False): [-0.57887, 0.87657, 0.32929],
(1, 3, True): [-0.88284, 0.81513, 0.366],
(1, 4, False): [-1.1926, 1.21061, 0.40386],
(1, 4, True): [-1.42909, 1.16607, 0.42899],
(1, 5, False): [-1.34428, 0.8756, 0.37809],
(1, 5, True): [-1.56285, 0.80464, 0.40703],
(2, 1, False): [0.23004, 1.12045, 0.31791],
(2, 1, True): [-0.45371, 1.06577, 0.38144],
(2, 2, False): [-0.41191, 1.36838, 0.39668],
(2, 2, True): [-0.9488, 1.32707, 0.44808],
(2, 3, False): [-0.49166, 1.11266, 0.36824],
(2, 3, True): [-1.03636, 1.04019, 0.42589],
(2, 4, False): [-1.08188, 1.42797, 0.42653],
(2, 4, True): [-1.52152, 1.36, 0.47256],
(2, 5, False): [-1.12408, 1.0565, 0.43505],
(2, 5, True): [-1.58614, 1.01208, 0.46796],
(3, 1, False): [0.20945, 1.29304, 0.36292],
(3, 1, True): [-0.60112, 1.139, 0.47837],
(3, 2, False): [-0.37491, 1.53959, 0.42397],
(3, 2, True): [-1.11163, 1.50639, 0.48662],
(3, 3, False): [-0.41411, 1.27093, 0.41524],
(3, 3, True): [-1.14285, 1.18673, 0.4906],
(3, 4, False): [-0.9946, 1.60793, 0.44771],
(3, 4, True): [-1.62609, 1.54566, 0.50619],
(3, 5, False): [-1.04988, 1.31372, 0.44802],
(3, 5, True): [-1.68976, 1.25316, 0.49896],
(4, 1, False): [0.18839, 1.46484, 0.39125],
(4, 1, True): [-0.81822, 1.35949, 0.50619],
(4, 2, False): [-0.35123, 1.705, 0.44075],
(4, 2, True): [-1.2591, 1.67286, 0.52021],
(4, 3, False): [-0.34716, 1.39436, 0.46391],
(4, 3, True): [-1.30728, 1.41428, 0.51292],
(4, 4, False): [-0.92783, 1.77056, 0.46587],
(4, 4, True): [-1.71493, 1.69609, 0.54221],
(4, 5, False): [-0.97468, 1.50704, 0.46661],
(4, 5, True): [-1.7783, 1.4453, 0.53112],
(5, 1, False): [0.17584, 1.60806, 0.424],
(5, 1, True): [-1.00705, 1.5668, 0.52487],
(5, 2, False): [-0.32186, 1.82909, 0.47183],
(5, 2, True): [-1.39492, 1.83145, 0.54756],
(5, 3, False): [-0.32204, 1.55407, 0.4884],
(5, 3, True): [-1.43499, 1.58772, 0.54359],
(5, 4, False): [-0.87005, 1.9128, 0.48361],
(5, 4, True): [-1.81929, 1.8594, 0.56629],
(5, 5, False): [-0.91534, 1.6826, 0.47972],
(5, 5, True): [-1.86297, 1.61238, 0.56196],
(6, 1, False): [0.16642, 1.7409, 0.45235],
(6, 1, True): [-1.15641, 1.72534, 0.55469],
(6, 2, False): [-0.31023, 1.97806, 0.47892],
(6, 2, True): [-1.52248, 1.98657, 0.56855],
(6, 3, False): [-0.30333, 1.70462, 0.50703],
(6, 3, True): [-1.5521, 1.74539, 0.57191],
(6, 4, False): [-0.82345, 2.04624, 0.50026],
(6, 4, True): [-1.90659, 1.99476, 0.59394],
(6, 5, False): [-0.85675, 1.81838, 0.50387],
(6, 5, True): [-1.92708, 1.73629, 0.60069],
(7, 1, False): [0.15013, 1.88779, 0.46397],
(7, 1, True): [-1.28169, 1.85521, 0.58877],
(7, 2, False): [-0.2904, 2.09042, 0.50233],
(7, 2, True): [-1.62626, 2.10378, 0.6013],
(7, 3, False): [-0.29138, 1.8506, 0.52083],
(7, 3, True): [-1.64831, 1.87115, 0.60523],
(7, 4, False): [-0.78647, 2.1757, 0.51247],
(7, 4, True): [-1.98344, 2.10977, 0.62411],
(7, 5, False): [-0.81099, 1.95374, 0.51949],
(7, 5, True): [-1.99875, 1.86512, 0.63051],
(8, 1, False): [0.14342, 2.00691, 0.48514],
(8, 1, True): [-1.3933, 1.97361, 0.62074],
(8, 2, False): [-0.27952, 2.20983, 0.51721],
(8, 2, True): [-1.74485, 2.25435, 0.61354],
(8, 3, False): [-0.28049, 1.98611, 0.53286],
(8, 3, True): [-1.74116, 1.99245, 0.63511],
(8, 4, False): [-0.74797, 2.28202, 0.53356],
(8, 4, True): [-2.07764, 2.25027, 0.64023],
(8, 5, False): [-0.76505, 2.06317, 0.54393],
(8, 5, True): [-2.04872, 1.95334, 0.67177],
(9, 1, False): [0.13505, 2.12341, 0.50439],
(9, 1, True): [-1.49339, 2.07805, 0.65464],
(9, 2, False): [-0.26881, 2.32256, 0.53025],
(9, 2, True): [-1.82677, 2.34223, 0.65004],
(9, 3, False): [-0.26657, 2.09906, 0.55384],
(9, 3, True): [-1.80085, 2.06043, 0.68234],
(9, 4, False): [-0.71672, 2.38896, 0.54931],
(9, 4, True): [-2.17306, 2.39146, 0.65252],
(9, 5, False): [-0.70907, 2.13027, 0.58668],
(9, 5, True): [-2.14411, 2.10595, 0.68478],
(10, 1, False): [0.12664, 2.23871, 0.51771],
(10, 1, True): [-1.59784, 2.19509, 0.67874],
(10, 2, False): [-0.25969, 2.4312, 0.54096],
(10, 2, True): [-1.93843, 2.48708, 0.65741],
(10, 3, False): [-0.25694, 2.21617, 0.56619],
(10, 3, True): [-1.89772, 2.1894, 0.70143],
(10, 4, False): [-0.69126, 2.49776, 0.5583],
(10, 4, True): [-2.24685, 2.4968, 0.67598],
(10, 5, False): [-0.6971, 2.28206, 0.57816],
(10, 5, True): [-2.21015, 2.208, 0.71379],
}
stat_star = {
(1, 1, False): 0.855423425047013,
(1, 1, True): 0.9074438436193457,
(1, 2, False): 2.3148213273461034,
(1, 2, True): 2.727010046970744,
(1, 3, False): 0.846390593107207,
(1, 3, True): 1.157556027201022,
(1, 4, False): 3.220377136548005,
(1, 4, True): 3.6108265020012418,
(1, 5, False): 1.7114703606421378,
(1, 5, True): 2.066325210881278,
(2, 1, False): 1.1268996107665314,
(2, 1, True): 1.3332514927355072,
(2, 2, False): 2.0512213167246456,
(2, 2, True): 2.656191837644102,
(2, 3, False): 1.058908331354388,
(2, 3, True): 1.5313322825819844,
(2, 4, False): 2.7213091542989725,
(2, 4, True): 3.2984645209852856,
(2, 5, False): 2.6006009671146497,
(2, 5, True): 2.661856653261213,
(3, 1, False): 1.263159095916295,
(3, 1, True): 2.4151349732452863,
(3, 2, False): 1.8886043232371843,
(3, 2, True): 2.6028096820968405,
(3, 3, False): 1.4879903191884682,
(3, 3, True): 2.2926969339773926,
(3, 4, False): 2.418527659154858,
(3, 4, True): 3.1039322592065988,
(3, 5, False): 1.9523612040944802,
(3, 5, True): 2.2115727453490757,
(4, 1, False): 1.290890114741129,
(4, 1, True): 2.1296963408410905,
(4, 2, False): 1.7770902061605607,
(4, 2, True): 2.5611885327765402,
(4, 3, False): 1.9340163095801728,
(4, 3, True): 1.9141318638062572,
(4, 4, False): 2.2146739201335466,
(4, 4, True): 2.9701790485477932,
(4, 5, False): 1.7408452994169448,
(4, 5, True): 2.1047247176583914,
(5, 1, False): 1.336967174239227,
(5, 1, True): 1.9131415178585627,
(5, 2, False): 1.6953274259688569,
(5, 2, True): 2.52745981091846,
(5, 3, False): 1.8124340908468068,
(5, 3, True): 1.8520883187848405,
(5, 4, False): 2.0675009559739297,
(5, 4, True): 2.8728076833515552,
(5, 5, False): 1.5978968362839456,
(5, 5, True): 2.1017517002543418,
(6, 1, False): 1.3810422398306446,
(6, 1, True): 1.8993612909227247,
(6, 2, False): 1.6324374150719114,
(6, 2, True): 2.498801004400209,
(6, 3, False): 1.72340094901749,
(6, 3, True): 1.8586513178563737,
(6, 4, False): 1.955819927102859,
(6, 4, True): 2.797145060481245,
(6, 5, False): 1.578613967104358,
(6, 5, True): 2.356249534336445,
(7, 1, False): 1.319436681229134,
(7, 1, True): 1.9955849619883248,
(7, 2, False): 1.5822190052675569,
(7, 2, True): 2.4744987764453055,
(7, 3, False): 1.65578510076754,
(7, 3, True): 2.046536484369615,
(7, 4, False): 1.8684573094851133,
(7, 4, True): 2.737241392502754,
(7, 5, False): 1.571855677342554,
(7, 5, True): 2.6006325210258505,
(8, 1, False): 1.3413558170956845,
(8, 1, True): 2.182981174661154,
(8, 2, False): 1.5416965902808288,
(8, 2, True): 2.4538471213095594,
(8, 3, False): 1.6021238307647196,
(8, 3, True): 2.2031866832480778,
(8, 4, False): 1.797595752125897,
(8, 4, True): 2.688099837236925,
(8, 5, False): 1.6561231184668357,
(8, 5, True): 2.883361281576836,
(9, 1, False): 1.3260368480749927,
(9, 1, True): 2.359689612641543,
(9, 2, False): 1.5074890058192492,
(9, 2, True): 2.435592395931648,
(9, 3, False): 1.5584090417965821,
(9, 3, True): 2.586293446202391,
(9, 4, False): 1.7393454428092985,
(9, 4, True): 2.6470908946956655,
(9, 5, False): 1.8180517504983742,
(9, 5, True): 2.818161371392247,
(10, 1, False): 1.3126519241806318,
(10, 1, True): 2.3499432601613885,
(10, 2, False): 1.4785447632683744,
(10, 2, True): 2.4199239298786215,
(10, 3, False): 1.5219767684407846,
(10, 3, True): 2.55484741648857,
(10, 4, False): 1.6902675233415512,
(10, 4, True): 2.6119272436084637,
(10, 5, False): 1.7372865030759366,
(10, 5, True): 2.7644864472524904,
}
crit_percentiles = (90, 95, 99, 99.9)
crit_vals = {
(1, 1, False): [2.4170317, 3.119659, 4.7510799, 7.0838335],
(1, 1, True): [3.2538509, 4.0643748, 5.8825257, 8.4189144],
(1, 2, False): [3.0235968, 3.6115364, 4.9094056, 6.6859696],
(1, 2, True): [3.4943406, 4.1231394, 5.4961076, 7.3531815],
(1, 3, False): [4.044319, 4.9228967, 6.8609106, 9.5203666],
(1, 3, True): [4.7771822, 5.7217442, 7.7821227, 10.557471],
(1, 4, False): [4.0317707, 4.6921341, 6.1259225, 8.0467248],
(1, 4, True): [4.4725009, 5.169214, 6.668854, 8.6632132],
(1, 5, False): [5.5958071, 6.586727, 8.7355157, 11.6171903],
(1, 5, True): [6.2656898, 7.3133165, 9.5652229, 12.5537707],
(2, 1, False): [2.1562308, 2.6846692, 3.8773621, 5.5425892],
(2, 1, True): [3.1684785, 3.8003954, 5.177742, 7.0453814],
(2, 2, False): [2.6273503, 3.0998243, 4.1327001, 5.528847],
(2, 2, True): [3.3084134, 3.8345125, 4.9642009, 6.4657839],
(2, 3, False): [3.1741284, 3.8022629, 5.1722882, 7.0241224],
(2, 3, True): [4.108262, 4.8116858, 6.3220548, 8.322478],
(2, 4, False): [3.3668869, 3.8887628, 5.0115801, 6.5052326],
(2, 4, True): [4.0126604, 4.5835675, 5.7968684, 7.3887863],
(2, 5, False): [4.1863149, 4.8834936, 6.3813095, 8.3781415],
(2, 5, True): [5.053508, 5.8168869, 7.4384998, 9.565425],
(3, 1, False): [1.998571, 2.4316514, 3.3919322, 4.709226],
(3, 1, True): [3.0729965, 3.6016775, 4.7371358, 6.2398661],
(3, 2, False): [2.3813866, 2.7820412, 3.6486786, 4.8089784],
(3, 2, True): [3.1778198, 3.6364094, 4.6114583, 5.8888408],
(3, 3, False): [2.7295224, 3.2290217, 4.3110408, 5.7599206],
(3, 3, True): [3.7471556, 4.3222818, 5.5425521, 7.1435458],
(3, 4, False): [2.9636218, 3.4007434, 4.3358236, 5.5729155],
(3, 4, True): [3.7234883, 4.2135706, 5.247283, 6.5911207],
(3, 5, False): [3.4742551, 4.0219835, 5.1911046, 6.7348191],
(3, 5, True): [4.4323554, 5.0480574, 6.3448127, 8.0277313],
(4, 1, False): [1.8897829, 2.2616928, 3.0771215, 4.1837434],
(4, 1, True): [2.9925753, 3.4545032, 4.4326745, 5.7123835],
(4, 2, False): [2.2123295, 2.5633388, 3.3177874, 4.321218],
(4, 2, True): [3.0796353, 3.4898084, 4.3536497, 5.4747288],
(4, 3, False): [2.4565534, 2.877209, 3.7798528, 4.9852682],
(4, 3, True): [3.516144, 4.0104999, 5.0504684, 6.4022435],
(4, 4, False): [2.6902225, 3.0699099, 3.877333, 4.9405835],
(4, 4, True): [3.5231152, 3.9578931, 4.867071, 6.0403311],
(4, 5, False): [3.0443998, 3.5009718, 4.4707539, 5.7457746],
(4, 5, True): [4.0501255, 4.5739556, 5.6686684, 7.0814031],
(5, 1, False): [1.8104326, 2.1394999, 2.8541086, 3.8114409],
(5, 1, True): [2.9267613, 3.3396521, 4.2078599, 5.3342038],
(5, 2, False): [2.0879588, 2.40264, 3.0748083, 3.9596152],
(5, 2, True): [3.002768, 3.3764374, 4.1585099, 5.1657752],
(5, 3, False): [2.2702787, 2.6369717, 3.4203738, 4.4521021],
(5, 3, True): [3.3535243, 3.7914038, 4.7060983, 5.8841151],
(5, 4, False): [2.4928973, 2.831033, 3.5478855, 4.4836677],
(5, 4, True): [3.3756681, 3.7687148, 4.587147, 5.6351487],
(5, 5, False): [2.7536425, 3.149282, 3.985975, 5.0799181],
(5, 5, True): [3.7890425, 4.2501858, 5.2074857, 6.4355821],
(6, 1, False): [1.7483313, 2.0453753, 2.685931, 3.5375009],
(6, 1, True): [2.8719403, 3.2474515, 4.0322637, 5.0451946],
(6, 2, False): [1.9922451, 2.2792144, 2.8891314, 3.690865],
(6, 2, True): [2.9399824, 3.2851357, 4.0031551, 4.9247226],
(6, 3, False): [2.1343676, 2.4620175, 3.1585901, 4.0720179],
(6, 3, True): [3.2311014, 3.6271964, 4.4502999, 5.5018575],
(6, 4, False): [2.3423792, 2.6488947, 3.2947623, 4.1354724],
(6, 4, True): [3.2610813, 3.6218989, 4.3702232, 5.3232767],
(6, 5, False): [2.5446232, 2.8951601, 3.633989, 4.5935586],
(6, 5, True): [3.5984454, 4.0134462, 4.8709448, 5.9622726],
(7, 1, False): [1.6985327, 1.9707636, 2.5536649, 3.3259272],
(7, 1, True): [2.825928, 3.1725169, 3.8932738, 4.8134085],
(7, 2, False): [1.9155946, 2.1802812, 2.7408759, 3.4710326],
(7, 2, True): [2.8879427, 3.2093335, 3.8753322, 4.724748],
(7, 3, False): [2.0305429, 2.3281704, 2.9569345, 3.7788337],
(7, 3, True): [3.136325, 3.4999128, 4.2519893, 5.2075305],
(7, 4, False): [2.2246175, 2.5055486, 3.0962182, 3.86164],
(7, 4, True): [3.1695552, 3.5051856, 4.1974421, 5.073436],
(7, 5, False): [2.3861201, 2.7031072, 3.3680435, 4.2305443],
(7, 5, True): [3.4533491, 3.8323234, 4.613939, 5.6044399],
(8, 1, False): [1.6569223, 1.9092423, 2.4470718, 3.1537838],
(8, 1, True): [2.7862884, 3.1097259, 3.7785302, 4.6293176],
(8, 2, False): [1.8532862, 2.0996872, 2.6186041, 3.2930359],
(8, 2, True): [2.8435812, 3.1459955, 3.769165, 4.5623681],
(8, 3, False): [1.9480198, 2.2215083, 2.7979659, 3.54771],
(8, 3, True): [3.0595184, 3.3969531, 4.0923089, 4.9739178],
(8, 4, False): [2.1289147, 2.3893773, 2.9340882, 3.6390988],
(8, 4, True): [3.094188, 3.4085297, 4.0545165, 4.8699787],
(8, 5, False): [2.2616596, 2.5515168, 3.1586476, 3.9422645],
(8, 5, True): [3.3374076, 3.6880139, 4.407457, 5.3152095],
(9, 1, False): [1.6224492, 1.8578787, 2.3580077, 3.0112501],
(9, 1, True): [2.7520721, 3.0557346, 3.6811682, 4.4739536],
(9, 2, False): [1.8008993, 2.0320841, 2.5170871, 3.1451424],
(9, 2, True): [2.8053707, 3.091422, 3.6784683, 4.4205306],
(9, 3, False): [1.8811231, 2.1353897, 2.6683796, 3.358463],
(9, 3, True): [2.9957112, 3.3114482, 3.9596061, 4.7754473],
(9, 4, False): [2.0498497, 2.2930641, 2.8018384, 3.4543646],
(9, 4, True): [3.0308611, 3.3269185, 3.9347618, 4.6993614],
(9, 5, False): [2.1610306, 2.4296727, 2.98963, 3.7067719],
(9, 5, True): [3.2429533, 3.5699095, 4.2401975, 5.0823119],
(10, 1, False): [1.5927907, 1.8145253, 2.2828013, 2.8927966],
(10, 1, True): [2.7222721, 3.009471, 3.5990544, 4.3432975],
(10, 2, False): [1.756145, 1.9744492, 2.4313123, 3.0218681],
(10, 2, True): [2.7724339, 3.0440412, 3.6004793, 4.3015151],
(10, 3, False): [1.8248841, 2.0628201, 2.5606728, 3.2029316],
(10, 3, True): [2.9416094, 3.239357, 3.8484916, 4.6144906],
(10, 4, False): [1.9833587, 2.2124939, 2.690228, 3.3020807],
(10, 4, True): [2.9767752, 3.2574924, 3.8317161, 4.5512138],
(10, 5, False): [2.0779589, 2.3285481, 2.8499681, 3.5195753],
(10, 5, True): [3.1649384, 3.4725945, 4.1003673, 4.8879723],
}
| """
Critical value polynomials and related quantities for the bounds test of
Pesaran, M. H., Shin, Y., & Smith, R. J. (2001). Bounds testing approaches
to the analysis of level relationships. Journal of applied econometrics,
16(3), 289-326.
These were computed using 32,000,000 simulations for each key using the
methodology of PSS, who only used 40,000. The asymptotic P-value response
functions were computed based on the simulated value. Critical values
are the point estimates for the respective quantiles. The simulation code
is contained in pss.py. The output files from this function are then
transformed using pss-process.py.
The format of the keys are (k, case, I1) where
* k is is the number of x variables included in the model (0 is an ADF)
* case is 1, 2, 3, 4 or 5 and corresponds to the PSS paper
* I1 is True if X contains I1 variables and False if X is stationary
The parameters are for polynomials of order 3 (large) or 2 (small).
stat_star is the value where the switch between large and small occurs.
Stat values less then stat_star use large_p, while values above use
small_p. In all cases the stat is logged prior to computing the p-value
so that the p-value is
1 - Phi(c[0] + c[1] * x + c[2] * x**2 + c[3] * x**3)
where x = np.log(stat) and Phi() is the normal cdf.
When this the models, the polynomial is evaluated at the natural log of the
test statistic and then the normal CDF of this value is computed to produce
the p-value.
"""
__all__ = ['large_p', 'small_p', 'crit_vals', 'crit_percentiles', 'stat_star']
large_p = {(1, 1, False): [0.2231, 0.91426, 0.10102, 0.00569], (1, 1, True): [-0.21766, 0.85933, 0.10411, 0.00661], (1, 2, False): [-0.60796, 1.48713, 0.15076, 0.04453], (1, 2, True): [-0.96204, 1.52593, 0.15996, 0.04166], (1, 3, False): [-0.62883, 0.78991, 0.1, 0.00693], (1, 3, True): [-0.91895, 0.82086, 0.12921, 0.01076], (1, 4, False): [-1.50546, 1.79052, 0.05488, 0.06801], (1, 4, True): [-1.79654, 1.8048, 0.06573, 0.06768], (1, 5, False): [-1.36367, 0.94126, 0.21556, 0.02473], (1, 5, True): [-1.60554, 0.93305, 0.2422, 0.03241], (2, 1, False): [0.20576, 1.18914, 0.15731, 0.01144], (2, 1, True): [-0.49024, 1.16958, 0.20564, 0.02008], (2, 2, False): [-0.51799, 1.6368, 0.18955, 0.04317], (2, 2, True): [-1.13394, 1.71056, 0.20442, 0.04195], (2, 3, False): [-0.51712, 1.12963, 0.18936, 0.01808], (2, 3, True): [-1.07441, 1.14964, 0.26066, 0.03338], (2, 4, False): [-1.29895, 1.88501, 0.11734, 0.06615], (2, 4, True): [-1.82455, 1.92207, 0.13753, 0.06269], (2, 5, False): [-1.22263, 1.23208, 0.31401, 0.04495], (2, 5, True): [-1.67689, 1.17567, 0.33606, 0.05898], (3, 1, False): [0.1826, 1.39275, 0.19774, 0.01647], (3, 1, True): [-0.71889, 1.39726, 0.29712, 0.03794], (3, 2, False): [-0.45864, 1.77632, 0.22125, 0.04372], (3, 2, True): [-1.28619, 1.88107, 0.23969, 0.04414], (3, 3, False): [-0.45093, 1.38824, 0.26556, 0.03063], (3, 3, True): [-1.22712, 1.36564, 0.34942, 0.05555], (3, 4, False): [-1.15886, 1.99182, 0.16358, 0.06392], (3, 4, True): [-1.88388, 2.05362, 0.18349, 0.06501], (3, 5, False): [-1.11221, 1.44327, 0.3547, 0.05263], (3, 5, True): [-1.75354, 1.37461, 0.3882, 0.07239], (4, 1, False): [0.16431, 1.56391, 0.22944, 0.02067], (4, 1, True): [-0.90799, 1.56908, 0.34763, 0.04814], (4, 2, False): [-0.41568, 1.90715, 0.24783, 0.04407], (4, 2, True): [-1.42373, 2.03902, 0.26907, 0.04755], (4, 3, False): [-0.41104, 1.5716, 0.3066, 0.03842], (4, 3, True): [-1.36194, 1.54043, 0.40145, 0.06846], (4, 4, False): [-1.05651, 2.10007, 0.20201, 0.06129], (4, 4, True): [-1.95474, 2.18305, 0.22527, 0.06441], (4, 5, False): [-1.02502, 1.62605, 0.38203, 0.05565], (4, 5, True): [-1.83458, 1.555, 0.42888, 0.07459], (5, 1, False): [0.15015, 1.71718, 0.2584, 0.02507], (5, 1, True): [-1.0707, 1.72829, 0.39037, 0.05468], (5, 2, False): [-0.38277, 2.02985, 0.27139, 0.04513], (5, 2, True): [-1.54974, 2.18631, 0.29592, 0.04967], (5, 3, False): [-0.38023, 1.72586, 0.33033, 0.04188], (5, 3, True): [-1.48415, 1.70271, 0.44016, 0.07248], (5, 4, False): [-0.97676, 2.20429, 0.23233, 0.06543], (5, 4, True): [-2.03144, 2.31343, 0.25394, 0.0675], (5, 5, False): [-0.95421, 1.78775, 0.40239, 0.05642], (5, 5, True): [-1.91679, 1.72031, 0.46434, 0.06641], (6, 1, False): [0.13913, 1.8581, 0.28528, 0.02931], (6, 1, True): [-1.21438, 1.87638, 0.42416, 0.05485], (6, 2, False): [-0.35664, 2.14606, 0.29484, 0.04728], (6, 2, True): [-1.66532, 2.32448, 0.31723, 0.05528], (6, 3, False): [-0.35498, 1.86634, 0.35087, 0.04455], (6, 3, True): [-1.59785, 1.85278, 0.47304, 0.07114], (6, 4, False): [-0.91274, 2.30752, 0.26053, 0.0644], (6, 4, True): [-2.10956, 2.43721, 0.2852, 0.06694], (6, 5, False): [-0.89553, 1.9318, 0.41381, 0.05292], (6, 5, True): [-1.99931, 1.87789, 0.49842, 0.04135], (7, 1, False): [0.12974, 1.98503, 0.30606, 0.03218], (7, 1, True): [-1.34555, 2.01647, 0.45456, 0.05018], (7, 2, False): [-0.33519, 2.25631, 0.31659, 0.05016], (7, 2, True): [-1.77496, 2.45806, 0.3372, 0.05741], (7, 3, False): [-0.33377, 1.99554, 0.36742, 0.04624], (7, 3, True): [-1.70381, 1.99863, 0.49883, 0.05092], (7, 4, False): [-0.8596, 2.40762, 0.28334, 0.06401], (7, 4, True): [-2.18704, 2.55828, 0.30627, 0.07091], (7, 5, False): [-0.84606, 2.06291, 0.42505, 0.05152], (7, 5, True): [-2.08097, 2.02139, 0.5348, 0.02343], (8, 1, False): [0.12244, 2.10698, 0.32849, 0.03596], (8, 1, True): [-1.46632, 2.1505, 0.48168, 0.04116], (8, 2, False): [-0.31707, 2.36107, 0.33198, 0.04953], (8, 2, True): [-1.87722, 2.58105, 0.35963, 0.05848], (8, 3, False): [-0.31629, 2.11679, 0.38514, 0.04868], (8, 3, True): [-1.80483, 2.13412, 0.52935, 0.03618], (8, 4, False): [-0.81509, 2.50518, 0.30456, 0.06388], (8, 4, True): [-2.26501, 2.67227, 0.33843, 0.06554], (8, 5, False): [-0.80333, 2.18457, 0.42995, 0.0463], (8, 5, True): [-2.16125, 2.15208, 0.58319, 0.0], (9, 1, False): [0.11562, 2.22037, 0.34907, 0.03968], (9, 1, True): [-1.57878, 2.27626, 0.5124, 0.03164], (9, 2, False): [-0.30188, 2.46235, 0.35132, 0.05209], (9, 2, True): [-1.97465, 2.70256, 0.37466, 0.06205], (9, 3, False): [-0.30097, 2.23118, 0.39976, 0.05001], (9, 3, True): [-1.90164, 2.26261, 0.56431, 0.0175], (9, 4, False): [-0.77664, 2.59712, 0.32618, 0.06452], (9, 4, True): [-2.33996, 2.78253, 0.36072, 0.06644], (9, 5, False): [-0.76631, 2.2987, 0.43834, 0.04274], (9, 5, True): [-2.23753, 2.27521, 0.60763, 0.0], (10, 1, False): [0.10995, 2.3278, 0.36567, 0.04153], (10, 1, True): [-1.6849, 2.39419, 0.5433, 0.02457], (10, 2, False): [-0.28847, 2.55819, 0.36959, 0.05499], (10, 2, True): [-2.06725, 2.81756, 0.38761, 0.0676], (10, 3, False): [-0.28748, 2.33948, 0.41398, 0.05101], (10, 3, True): [-1.99259, 2.38061, 0.59433, 0.01114], (10, 4, False): [-0.74317, 2.68624, 0.345, 0.07032], (10, 4, True): [-2.41409, 2.8931, 0.37487, 0.07102], (10, 5, False): [-0.73464, 2.40692, 0.45153, 0.0434], (10, 5, True): [-2.31364, 2.39092, 0.64313, -0.01012]}
small_p = {(1, 1, False): [0.2585, 0.92944, 0.25921], (1, 1, True): [-0.17399, 0.88425, 0.29947], (1, 2, False): [-0.45787, 1.15813, 0.37268], (1, 2, True): [-0.76388, 1.13438, 0.39908], (1, 3, False): [-0.57887, 0.87657, 0.32929], (1, 3, True): [-0.88284, 0.81513, 0.366], (1, 4, False): [-1.1926, 1.21061, 0.40386], (1, 4, True): [-1.42909, 1.16607, 0.42899], (1, 5, False): [-1.34428, 0.8756, 0.37809], (1, 5, True): [-1.56285, 0.80464, 0.40703], (2, 1, False): [0.23004, 1.12045, 0.31791], (2, 1, True): [-0.45371, 1.06577, 0.38144], (2, 2, False): [-0.41191, 1.36838, 0.39668], (2, 2, True): [-0.9488, 1.32707, 0.44808], (2, 3, False): [-0.49166, 1.11266, 0.36824], (2, 3, True): [-1.03636, 1.04019, 0.42589], (2, 4, False): [-1.08188, 1.42797, 0.42653], (2, 4, True): [-1.52152, 1.36, 0.47256], (2, 5, False): [-1.12408, 1.0565, 0.43505], (2, 5, True): [-1.58614, 1.01208, 0.46796], (3, 1, False): [0.20945, 1.29304, 0.36292], (3, 1, True): [-0.60112, 1.139, 0.47837], (3, 2, False): [-0.37491, 1.53959, 0.42397], (3, 2, True): [-1.11163, 1.50639, 0.48662], (3, 3, False): [-0.41411, 1.27093, 0.41524], (3, 3, True): [-1.14285, 1.18673, 0.4906], (3, 4, False): [-0.9946, 1.60793, 0.44771], (3, 4, True): [-1.62609, 1.54566, 0.50619], (3, 5, False): [-1.04988, 1.31372, 0.44802], (3, 5, True): [-1.68976, 1.25316, 0.49896], (4, 1, False): [0.18839, 1.46484, 0.39125], (4, 1, True): [-0.81822, 1.35949, 0.50619], (4, 2, False): [-0.35123, 1.705, 0.44075], (4, 2, True): [-1.2591, 1.67286, 0.52021], (4, 3, False): [-0.34716, 1.39436, 0.46391], (4, 3, True): [-1.30728, 1.41428, 0.51292], (4, 4, False): [-0.92783, 1.77056, 0.46587], (4, 4, True): [-1.71493, 1.69609, 0.54221], (4, 5, False): [-0.97468, 1.50704, 0.46661], (4, 5, True): [-1.7783, 1.4453, 0.53112], (5, 1, False): [0.17584, 1.60806, 0.424], (5, 1, True): [-1.00705, 1.5668, 0.52487], (5, 2, False): [-0.32186, 1.82909, 0.47183], (5, 2, True): [-1.39492, 1.83145, 0.54756], (5, 3, False): [-0.32204, 1.55407, 0.4884], (5, 3, True): [-1.43499, 1.58772, 0.54359], (5, 4, False): [-0.87005, 1.9128, 0.48361], (5, 4, True): [-1.81929, 1.8594, 0.56629], (5, 5, False): [-0.91534, 1.6826, 0.47972], (5, 5, True): [-1.86297, 1.61238, 0.56196], (6, 1, False): [0.16642, 1.7409, 0.45235], (6, 1, True): [-1.15641, 1.72534, 0.55469], (6, 2, False): [-0.31023, 1.97806, 0.47892], (6, 2, True): [-1.52248, 1.98657, 0.56855], (6, 3, False): [-0.30333, 1.70462, 0.50703], (6, 3, True): [-1.5521, 1.74539, 0.57191], (6, 4, False): [-0.82345, 2.04624, 0.50026], (6, 4, True): [-1.90659, 1.99476, 0.59394], (6, 5, False): [-0.85675, 1.81838, 0.50387], (6, 5, True): [-1.92708, 1.73629, 0.60069], (7, 1, False): [0.15013, 1.88779, 0.46397], (7, 1, True): [-1.28169, 1.85521, 0.58877], (7, 2, False): [-0.2904, 2.09042, 0.50233], (7, 2, True): [-1.62626, 2.10378, 0.6013], (7, 3, False): [-0.29138, 1.8506, 0.52083], (7, 3, True): [-1.64831, 1.87115, 0.60523], (7, 4, False): [-0.78647, 2.1757, 0.51247], (7, 4, True): [-1.98344, 2.10977, 0.62411], (7, 5, False): [-0.81099, 1.95374, 0.51949], (7, 5, True): [-1.99875, 1.86512, 0.63051], (8, 1, False): [0.14342, 2.00691, 0.48514], (8, 1, True): [-1.3933, 1.97361, 0.62074], (8, 2, False): [-0.27952, 2.20983, 0.51721], (8, 2, True): [-1.74485, 2.25435, 0.61354], (8, 3, False): [-0.28049, 1.98611, 0.53286], (8, 3, True): [-1.74116, 1.99245, 0.63511], (8, 4, False): [-0.74797, 2.28202, 0.53356], (8, 4, True): [-2.07764, 2.25027, 0.64023], (8, 5, False): [-0.76505, 2.06317, 0.54393], (8, 5, True): [-2.04872, 1.95334, 0.67177], (9, 1, False): [0.13505, 2.12341, 0.50439], (9, 1, True): [-1.49339, 2.07805, 0.65464], (9, 2, False): [-0.26881, 2.32256, 0.53025], (9, 2, True): [-1.82677, 2.34223, 0.65004], (9, 3, False): [-0.26657, 2.09906, 0.55384], (9, 3, True): [-1.80085, 2.06043, 0.68234], (9, 4, False): [-0.71672, 2.38896, 0.54931], (9, 4, True): [-2.17306, 2.39146, 0.65252], (9, 5, False): [-0.70907, 2.13027, 0.58668], (9, 5, True): [-2.14411, 2.10595, 0.68478], (10, 1, False): [0.12664, 2.23871, 0.51771], (10, 1, True): [-1.59784, 2.19509, 0.67874], (10, 2, False): [-0.25969, 2.4312, 0.54096], (10, 2, True): [-1.93843, 2.48708, 0.65741], (10, 3, False): [-0.25694, 2.21617, 0.56619], (10, 3, True): [-1.89772, 2.1894, 0.70143], (10, 4, False): [-0.69126, 2.49776, 0.5583], (10, 4, True): [-2.24685, 2.4968, 0.67598], (10, 5, False): [-0.6971, 2.28206, 0.57816], (10, 5, True): [-2.21015, 2.208, 0.71379]}
stat_star = {(1, 1, False): 0.855423425047013, (1, 1, True): 0.9074438436193457, (1, 2, False): 2.3148213273461034, (1, 2, True): 2.727010046970744, (1, 3, False): 0.846390593107207, (1, 3, True): 1.157556027201022, (1, 4, False): 3.220377136548005, (1, 4, True): 3.6108265020012418, (1, 5, False): 1.7114703606421378, (1, 5, True): 2.066325210881278, (2, 1, False): 1.1268996107665314, (2, 1, True): 1.3332514927355072, (2, 2, False): 2.0512213167246456, (2, 2, True): 2.656191837644102, (2, 3, False): 1.058908331354388, (2, 3, True): 1.5313322825819844, (2, 4, False): 2.7213091542989725, (2, 4, True): 3.2984645209852856, (2, 5, False): 2.6006009671146497, (2, 5, True): 2.661856653261213, (3, 1, False): 1.263159095916295, (3, 1, True): 2.4151349732452863, (3, 2, False): 1.8886043232371843, (3, 2, True): 2.6028096820968405, (3, 3, False): 1.4879903191884682, (3, 3, True): 2.2926969339773926, (3, 4, False): 2.418527659154858, (3, 4, True): 3.1039322592065988, (3, 5, False): 1.9523612040944802, (3, 5, True): 2.2115727453490757, (4, 1, False): 1.290890114741129, (4, 1, True): 2.1296963408410905, (4, 2, False): 1.7770902061605607, (4, 2, True): 2.5611885327765402, (4, 3, False): 1.9340163095801728, (4, 3, True): 1.9141318638062572, (4, 4, False): 2.2146739201335466, (4, 4, True): 2.9701790485477932, (4, 5, False): 1.7408452994169448, (4, 5, True): 2.1047247176583914, (5, 1, False): 1.336967174239227, (5, 1, True): 1.9131415178585627, (5, 2, False): 1.6953274259688569, (5, 2, True): 2.52745981091846, (5, 3, False): 1.8124340908468068, (5, 3, True): 1.8520883187848405, (5, 4, False): 2.0675009559739297, (5, 4, True): 2.8728076833515552, (5, 5, False): 1.5978968362839456, (5, 5, True): 2.1017517002543418, (6, 1, False): 1.3810422398306446, (6, 1, True): 1.8993612909227247, (6, 2, False): 1.6324374150719114, (6, 2, True): 2.498801004400209, (6, 3, False): 1.72340094901749, (6, 3, True): 1.8586513178563737, (6, 4, False): 1.955819927102859, (6, 4, True): 2.797145060481245, (6, 5, False): 1.578613967104358, (6, 5, True): 2.356249534336445, (7, 1, False): 1.319436681229134, (7, 1, True): 1.9955849619883248, (7, 2, False): 1.5822190052675569, (7, 2, True): 2.4744987764453055, (7, 3, False): 1.65578510076754, (7, 3, True): 2.046536484369615, (7, 4, False): 1.8684573094851133, (7, 4, True): 2.737241392502754, (7, 5, False): 1.571855677342554, (7, 5, True): 2.6006325210258505, (8, 1, False): 1.3413558170956845, (8, 1, True): 2.182981174661154, (8, 2, False): 1.5416965902808288, (8, 2, True): 2.4538471213095594, (8, 3, False): 1.6021238307647196, (8, 3, True): 2.2031866832480778, (8, 4, False): 1.797595752125897, (8, 4, True): 2.688099837236925, (8, 5, False): 1.6561231184668357, (8, 5, True): 2.883361281576836, (9, 1, False): 1.3260368480749927, (9, 1, True): 2.359689612641543, (9, 2, False): 1.5074890058192492, (9, 2, True): 2.435592395931648, (9, 3, False): 1.5584090417965821, (9, 3, True): 2.586293446202391, (9, 4, False): 1.7393454428092985, (9, 4, True): 2.6470908946956655, (9, 5, False): 1.8180517504983742, (9, 5, True): 2.818161371392247, (10, 1, False): 1.3126519241806318, (10, 1, True): 2.3499432601613885, (10, 2, False): 1.4785447632683744, (10, 2, True): 2.4199239298786215, (10, 3, False): 1.5219767684407846, (10, 3, True): 2.55484741648857, (10, 4, False): 1.6902675233415512, (10, 4, True): 2.6119272436084637, (10, 5, False): 1.7372865030759366, (10, 5, True): 2.7644864472524904}
crit_percentiles = (90, 95, 99, 99.9)
crit_vals = {(1, 1, False): [2.4170317, 3.119659, 4.7510799, 7.0838335], (1, 1, True): [3.2538509, 4.0643748, 5.8825257, 8.4189144], (1, 2, False): [3.0235968, 3.6115364, 4.9094056, 6.6859696], (1, 2, True): [3.4943406, 4.1231394, 5.4961076, 7.3531815], (1, 3, False): [4.044319, 4.9228967, 6.8609106, 9.5203666], (1, 3, True): [4.7771822, 5.7217442, 7.7821227, 10.557471], (1, 4, False): [4.0317707, 4.6921341, 6.1259225, 8.0467248], (1, 4, True): [4.4725009, 5.169214, 6.668854, 8.6632132], (1, 5, False): [5.5958071, 6.586727, 8.7355157, 11.6171903], (1, 5, True): [6.2656898, 7.3133165, 9.5652229, 12.5537707], (2, 1, False): [2.1562308, 2.6846692, 3.8773621, 5.5425892], (2, 1, True): [3.1684785, 3.8003954, 5.177742, 7.0453814], (2, 2, False): [2.6273503, 3.0998243, 4.1327001, 5.528847], (2, 2, True): [3.3084134, 3.8345125, 4.9642009, 6.4657839], (2, 3, False): [3.1741284, 3.8022629, 5.1722882, 7.0241224], (2, 3, True): [4.108262, 4.8116858, 6.3220548, 8.322478], (2, 4, False): [3.3668869, 3.8887628, 5.0115801, 6.5052326], (2, 4, True): [4.0126604, 4.5835675, 5.7968684, 7.3887863], (2, 5, False): [4.1863149, 4.8834936, 6.3813095, 8.3781415], (2, 5, True): [5.053508, 5.8168869, 7.4384998, 9.565425], (3, 1, False): [1.998571, 2.4316514, 3.3919322, 4.709226], (3, 1, True): [3.0729965, 3.6016775, 4.7371358, 6.2398661], (3, 2, False): [2.3813866, 2.7820412, 3.6486786, 4.8089784], (3, 2, True): [3.1778198, 3.6364094, 4.6114583, 5.8888408], (3, 3, False): [2.7295224, 3.2290217, 4.3110408, 5.7599206], (3, 3, True): [3.7471556, 4.3222818, 5.5425521, 7.1435458], (3, 4, False): [2.9636218, 3.4007434, 4.3358236, 5.5729155], (3, 4, True): [3.7234883, 4.2135706, 5.247283, 6.5911207], (3, 5, False): [3.4742551, 4.0219835, 5.1911046, 6.7348191], (3, 5, True): [4.4323554, 5.0480574, 6.3448127, 8.0277313], (4, 1, False): [1.8897829, 2.2616928, 3.0771215, 4.1837434], (4, 1, True): [2.9925753, 3.4545032, 4.4326745, 5.7123835], (4, 2, False): [2.2123295, 2.5633388, 3.3177874, 4.321218], (4, 2, True): [3.0796353, 3.4898084, 4.3536497, 5.4747288], (4, 3, False): [2.4565534, 2.877209, 3.7798528, 4.9852682], (4, 3, True): [3.516144, 4.0104999, 5.0504684, 6.4022435], (4, 4, False): [2.6902225, 3.0699099, 3.877333, 4.9405835], (4, 4, True): [3.5231152, 3.9578931, 4.867071, 6.0403311], (4, 5, False): [3.0443998, 3.5009718, 4.4707539, 5.7457746], (4, 5, True): [4.0501255, 4.5739556, 5.6686684, 7.0814031], (5, 1, False): [1.8104326, 2.1394999, 2.8541086, 3.8114409], (5, 1, True): [2.9267613, 3.3396521, 4.2078599, 5.3342038], (5, 2, False): [2.0879588, 2.40264, 3.0748083, 3.9596152], (5, 2, True): [3.002768, 3.3764374, 4.1585099, 5.1657752], (5, 3, False): [2.2702787, 2.6369717, 3.4203738, 4.4521021], (5, 3, True): [3.3535243, 3.7914038, 4.7060983, 5.8841151], (5, 4, False): [2.4928973, 2.831033, 3.5478855, 4.4836677], (5, 4, True): [3.3756681, 3.7687148, 4.587147, 5.6351487], (5, 5, False): [2.7536425, 3.149282, 3.985975, 5.0799181], (5, 5, True): [3.7890425, 4.2501858, 5.2074857, 6.4355821], (6, 1, False): [1.7483313, 2.0453753, 2.685931, 3.5375009], (6, 1, True): [2.8719403, 3.2474515, 4.0322637, 5.0451946], (6, 2, False): [1.9922451, 2.2792144, 2.8891314, 3.690865], (6, 2, True): [2.9399824, 3.2851357, 4.0031551, 4.9247226], (6, 3, False): [2.1343676, 2.4620175, 3.1585901, 4.0720179], (6, 3, True): [3.2311014, 3.6271964, 4.4502999, 5.5018575], (6, 4, False): [2.3423792, 2.6488947, 3.2947623, 4.1354724], (6, 4, True): [3.2610813, 3.6218989, 4.3702232, 5.3232767], (6, 5, False): [2.5446232, 2.8951601, 3.633989, 4.5935586], (6, 5, True): [3.5984454, 4.0134462, 4.8709448, 5.9622726], (7, 1, False): [1.6985327, 1.9707636, 2.5536649, 3.3259272], (7, 1, True): [2.825928, 3.1725169, 3.8932738, 4.8134085], (7, 2, False): [1.9155946, 2.1802812, 2.7408759, 3.4710326], (7, 2, True): [2.8879427, 3.2093335, 3.8753322, 4.724748], (7, 3, False): [2.0305429, 2.3281704, 2.9569345, 3.7788337], (7, 3, True): [3.136325, 3.4999128, 4.2519893, 5.2075305], (7, 4, False): [2.2246175, 2.5055486, 3.0962182, 3.86164], (7, 4, True): [3.1695552, 3.5051856, 4.1974421, 5.073436], (7, 5, False): [2.3861201, 2.7031072, 3.3680435, 4.2305443], (7, 5, True): [3.4533491, 3.8323234, 4.613939, 5.6044399], (8, 1, False): [1.6569223, 1.9092423, 2.4470718, 3.1537838], (8, 1, True): [2.7862884, 3.1097259, 3.7785302, 4.6293176], (8, 2, False): [1.8532862, 2.0996872, 2.6186041, 3.2930359], (8, 2, True): [2.8435812, 3.1459955, 3.769165, 4.5623681], (8, 3, False): [1.9480198, 2.2215083, 2.7979659, 3.54771], (8, 3, True): [3.0595184, 3.3969531, 4.0923089, 4.9739178], (8, 4, False): [2.1289147, 2.3893773, 2.9340882, 3.6390988], (8, 4, True): [3.094188, 3.4085297, 4.0545165, 4.8699787], (8, 5, False): [2.2616596, 2.5515168, 3.1586476, 3.9422645], (8, 5, True): [3.3374076, 3.6880139, 4.407457, 5.3152095], (9, 1, False): [1.6224492, 1.8578787, 2.3580077, 3.0112501], (9, 1, True): [2.7520721, 3.0557346, 3.6811682, 4.4739536], (9, 2, False): [1.8008993, 2.0320841, 2.5170871, 3.1451424], (9, 2, True): [2.8053707, 3.091422, 3.6784683, 4.4205306], (9, 3, False): [1.8811231, 2.1353897, 2.6683796, 3.358463], (9, 3, True): [2.9957112, 3.3114482, 3.9596061, 4.7754473], (9, 4, False): [2.0498497, 2.2930641, 2.8018384, 3.4543646], (9, 4, True): [3.0308611, 3.3269185, 3.9347618, 4.6993614], (9, 5, False): [2.1610306, 2.4296727, 2.98963, 3.7067719], (9, 5, True): [3.2429533, 3.5699095, 4.2401975, 5.0823119], (10, 1, False): [1.5927907, 1.8145253, 2.2828013, 2.8927966], (10, 1, True): [2.7222721, 3.009471, 3.5990544, 4.3432975], (10, 2, False): [1.756145, 1.9744492, 2.4313123, 3.0218681], (10, 2, True): [2.7724339, 3.0440412, 3.6004793, 4.3015151], (10, 3, False): [1.8248841, 2.0628201, 2.5606728, 3.2029316], (10, 3, True): [2.9416094, 3.239357, 3.8484916, 4.6144906], (10, 4, False): [1.9833587, 2.2124939, 2.690228, 3.3020807], (10, 4, True): [2.9767752, 3.2574924, 3.8317161, 4.5512138], (10, 5, False): [2.0779589, 2.3285481, 2.8499681, 3.5195753], (10, 5, True): [3.1649384, 3.4725945, 4.1003673, 4.8879723]} |
installed_apps = (
'core',
'resources',
'arenas',
'sciences',
'military',
'profiles',
'matches',
'combat',
)
| installed_apps = ('core', 'resources', 'arenas', 'sciences', 'military', 'profiles', 'matches', 'combat') |
cont = 0
param = 10
while True:
cont = 0
num = int(input('Quer ver a tabuada de qual valor? '))
if num < 0:
break
while cont < 10:
cont = cont + 1
tab = num * cont
print(f'{num} x {cont} = {tab}')
print('PROGRAMA ENCERRADO')
| cont = 0
param = 10
while True:
cont = 0
num = int(input('Quer ver a tabuada de qual valor? '))
if num < 0:
break
while cont < 10:
cont = cont + 1
tab = num * cont
print(f'{num} x {cont} = {tab}')
print('PROGRAMA ENCERRADO') |
"""
import main_menu
# Pack of def for checking files:
def readfile(filename): # Read a file and print what's in there.
try:
a = open(filename, 'rt')
except:
print(f"File couldn't be ready")
else:
return f'\033[1:34m{a.read()}\033[m'
def appending(filename, info): # Append a new item in a file.
try:
a = open(filename, 'at')
except:
raise FileNotFoundError
else:
a.write(f'{info}\n')
a.close()
def checkduplication(filename, info):
# Check for duplications in a file and break to the menu if info is existent.
with open(filename, 'rt') as a:
if info in a.read():
print(f'\033[1:31mAlready registered in the system\033[m')
a.close()
main_menu.SubMenu(1)
else:
confirm = ''
while True:
confirm = str(input(f'Confirm registering "\033[1m{info}\033[m"? [Y/N]')).strip().lower()
if confirm == 'y' or confirm == 'n':
break
if confirm == 'y':
appending(filename, info)
print('\033[1mSuccessfully registered\033[m')
main_menu.SubMenu(1)
elif confirm == 'n':
main_menu.SubMenu(1)
""" | """
import main_menu
# Pack of def for checking files:
def readfile(filename): # Read a file and print what's in there.
try:
a = open(filename, 'rt')
except:
print(f"File couldn't be ready")
else:
return f'\x1b[1:34m{a.read()}\x1b[m'
def appending(filename, info): # Append a new item in a file.
try:
a = open(filename, 'at')
except:
raise FileNotFoundError
else:
a.write(f'{info}
')
a.close()
def checkduplication(filename, info):
# Check for duplications in a file and break to the menu if info is existent.
with open(filename, 'rt') as a:
if info in a.read():
print(f'\x1b[1:31mAlready registered in the system\x1b[m')
a.close()
main_menu.SubMenu(1)
else:
confirm = ''
while True:
confirm = str(input(f'Confirm registering "\x1b[1m{info}\x1b[m"? [Y/N]')).strip().lower()
if confirm == 'y' or confirm == 'n':
break
if confirm == 'y':
appending(filename, info)
print('\x1b[1mSuccessfully registered\x1b[m')
main_menu.SubMenu(1)
elif confirm == 'n':
main_menu.SubMenu(1)
""" |
class Node():
"""this is the Node class that will be used for heap data structures"""
def __init__(self, value, parent=None):
self.value = value
self.parent = parent
self.children = []
def __str__(self):
return "Value: " + str(self.value)
def add_children(self, value):
if len(self.children) < 2:
self.children.append(value)
else:
# do nothing since a node cannot
# have more than two children
pass
def get_parent(self):
"""It returns the parent node"""
return self.parent
def get_left_child(self):
"""returns the left child"""
return self.children[0]
def get_right_child(self):
return self.children[1]
class MinHeap():
"""
A Min-Heap is a complete binary tree in which the value in each parent
node is smaller than or equal to the values in the children of that node.
5 13
/ \ / \
10 15 16 31
/ / \ / \
30 41 51 100 41
"""
def __init__(self):
self.heap = []
self.root = Node(0, None)
self.heap.append(self.root)
def get_root(self):
"""It returns the root element of Min Heap."""
return self.root
def add_children(self, new_child_node_value):
for i in range(len(self.heap)):
# check if the current node is full (has two children)
if len(self.heap[i].children) == 2:
# if has 2 child than move to the next child Node by iterating
# the loop iteration variable & check if parent is smaller than
# the children for min heap
continue
elif len(self.heap[i].children) < 2:
# if the current node has less than 2 child than add the value
# to the current node & check if parent is smaller than the
# children for min heap
if self.heap[i].value <= new_child_node_value:
new_node = Node(new_child_node_value, self.heap[i])
self.heap[i].children.append(new_node)
self.heap.append(new_node)
break
else:
continue # parent value is bigger
def update_children(self):
pass
def delete_children(self):
pass
def print_heap(self):
pass
class MaxHeap():
"""
pass
"""
"""
I DID NOT FINISH THIS DATA STRUCTURE BECAUSE I GOT FCKN BORED
"""
| class Node:
"""this is the Node class that will be used for heap data structures"""
def __init__(self, value, parent=None):
self.value = value
self.parent = parent
self.children = []
def __str__(self):
return 'Value: ' + str(self.value)
def add_children(self, value):
if len(self.children) < 2:
self.children.append(value)
else:
pass
def get_parent(self):
"""It returns the parent node"""
return self.parent
def get_left_child(self):
"""returns the left child"""
return self.children[0]
def get_right_child(self):
return self.children[1]
class Minheap:
"""
A Min-Heap is a complete binary tree in which the value in each parent
node is smaller than or equal to the values in the children of that node.
5 13
/ \\ / 10 15 16 31
/ / \\ / 30 41 51 100 41
"""
def __init__(self):
self.heap = []
self.root = node(0, None)
self.heap.append(self.root)
def get_root(self):
"""It returns the root element of Min Heap."""
return self.root
def add_children(self, new_child_node_value):
for i in range(len(self.heap)):
if len(self.heap[i].children) == 2:
continue
elif len(self.heap[i].children) < 2:
if self.heap[i].value <= new_child_node_value:
new_node = node(new_child_node_value, self.heap[i])
self.heap[i].children.append(new_node)
self.heap.append(new_node)
break
else:
continue
def update_children(self):
pass
def delete_children(self):
pass
def print_heap(self):
pass
class Maxheap:
"""
pass
"""
'\nI DID NOT FINISH THIS DATA STRUCTURE BECAUSE I GOT FCKN BORED\n' |
#
# MacOS Packaging logic
#
# This is intended as the first step in comprehensive package build on MacOS. It replaces the
# following style of command:
#
# pkgbuild \
# --identifier (domain).$(PKG_NAME) \
# --component-plist $(PLIST) \
# --scripts $(SCRIPTS) \
# --version $(VER_BAZELISK) \
# --root $(STAGE) \
# $(DESTDIR)/$(PKG_UPPERNAME)-$(VER_BAZELISK).pkg:
#
# Identifiers refs:
# - https://en.wikipedia.org/wiki/Uniform_Type_Identifier
# - https://en.wikipedia.org/wiki/Reverse_domain_name_notation
#
# As with the command it replaces, this isintended to be installable in a simple CLI such as:
#
# sudo installer -pkg bazel-out/darwin-fastbuild/bin/chickenandbazel.pkg -target /
def _pkgbuild_tars_impl(ctx):
"""Completes a "pkgbuild --root" but pre-deployed the "tars" to that given "root".
Args:
name: A unique name for this rule.
component_plist: location of a plist file.
identifier: an Apple UTI -- ie Reverse-DNS Notation name for the package: Defaults to
com.example.{name} but watch for the expected namespace/name clash this default
can cause.
package_name: (optional) Target package name, defaulting to (name).pkg.
tars: One or more tar archives representing deliverables that should be extracted in "root"
before packaging.
version: a version string for the package; recommending Semver for simplicity. Comparing
two versions of matching identifier can be used to determine whether one package
upgrades or downgrades another.
"""
component_plist_opt = ""
if ctx.attr.component_plist:
component_plist_opt = "--component-plist \"{}\"".format(ctx.file.component_plist)
identifier = ctx.attr.identifier or "com.example.{}".format(ctx.attr.name)
package_name = ctx.attr.package_name or "{}.pkg".format(ctx.attr.name)
pkg = ctx.actions.declare_file(package_name)
inputs = [] + ctx.files.tars # TODO: plus pkgbuild, plus template, plus plist
#pkgbuild_toolchain = ctx.toolchains["@rules_pkg//toolchains/macos:pkgbuild_toolchain_type"].pkgbuild.path
# Generate a script from hydrating a template so that we can review the script to diagnose/debug
script_file = ctx.actions.declare_file("{}_pkgbuild".format(ctx.label.name))
ctx.actions.expand_template(
template = ctx.file._script_template,
output = script_file,
is_executable = True,
substitutions = {
"{IDENTIFIER}": identifier,
"{OPT_COMPONENT_PLIST}": component_plist_opt,
"{OPT_SCRIPTS_DIR}": "",
"{OUTPUT}": pkg.path,
#"{PKGBUILD}": pkgbuild_toolchain,
"{TARS}": " ".join([ f.path for f in ctx.files.tars ]),
"{VERSION}": ctx.attr.version,
},
)
ctx.actions.run(
inputs = inputs,
outputs = [pkg],
arguments = [],
executable = script_file,
execution_requirements = {
"local": "1",
"no-remote": "1",
"no-remote-exec": "1",
},
)
return [
DefaultInfo(
files = depset([pkg]),
),
]
pkgbuild_tars = rule(
implementation = _pkgbuild_tars_impl,
attrs = {
"tars": attr.label_list(
#allow_files = True,
mandatory = True,
doc = "One or more tar archives that should be extracted in 'root' before packaging",
),
"package_name": attr.string(
mandatory = False,
doc = "resulting filename.pkg, defaults to (name).pkg, analogous to the 'package-output-path'",
),
"identifier": attr.string(
mandatory = False,
doc = "An Apple Uniform Type Identifier (similar to a Reverse-DNS Notation) as a unique identifier for this package"
),
"component_plist": attr.label(allow_files = True, mandatory = False),
"version": attr.string(
mandatory = True,
default = "0",
doc = "A version for the package; used to compare against different versions of the 'identifier' to see whether this upgrades or downgrades an existing install",
),
"_script_template": attr.label(
allow_single_file = True,
default = ":pkgbuild_tars.sh.tpl",
),
},
doc = "Package a complete destination root. For example, the 'xcodebuild' tool with the 'install' action creates a destination root. This rule is intended to package up a destination root that would be given as 'pkgbuild --root' except that it wants to lay out the given 'tars' into that 'root' before packaging",
)
# NOTES
#
# full paths? https://github.com/bazelbuild/rules_python/blob/main/python/defs.bzl#L76
| def _pkgbuild_tars_impl(ctx):
"""Completes a "pkgbuild --root" but pre-deployed the "tars" to that given "root".
Args:
name: A unique name for this rule.
component_plist: location of a plist file.
identifier: an Apple UTI -- ie Reverse-DNS Notation name for the package: Defaults to
com.example.{name} but watch for the expected namespace/name clash this default
can cause.
package_name: (optional) Target package name, defaulting to (name).pkg.
tars: One or more tar archives representing deliverables that should be extracted in "root"
before packaging.
version: a version string for the package; recommending Semver for simplicity. Comparing
two versions of matching identifier can be used to determine whether one package
upgrades or downgrades another.
"""
component_plist_opt = ''
if ctx.attr.component_plist:
component_plist_opt = '--component-plist "{}"'.format(ctx.file.component_plist)
identifier = ctx.attr.identifier or 'com.example.{}'.format(ctx.attr.name)
package_name = ctx.attr.package_name or '{}.pkg'.format(ctx.attr.name)
pkg = ctx.actions.declare_file(package_name)
inputs = [] + ctx.files.tars
script_file = ctx.actions.declare_file('{}_pkgbuild'.format(ctx.label.name))
ctx.actions.expand_template(template=ctx.file._script_template, output=script_file, is_executable=True, substitutions={'{IDENTIFIER}': identifier, '{OPT_COMPONENT_PLIST}': component_plist_opt, '{OPT_SCRIPTS_DIR}': '', '{OUTPUT}': pkg.path, '{TARS}': ' '.join([f.path for f in ctx.files.tars]), '{VERSION}': ctx.attr.version})
ctx.actions.run(inputs=inputs, outputs=[pkg], arguments=[], executable=script_file, execution_requirements={'local': '1', 'no-remote': '1', 'no-remote-exec': '1'})
return [default_info(files=depset([pkg]))]
pkgbuild_tars = rule(implementation=_pkgbuild_tars_impl, attrs={'tars': attr.label_list(mandatory=True, doc="One or more tar archives that should be extracted in 'root' before packaging"), 'package_name': attr.string(mandatory=False, doc="resulting filename.pkg, defaults to (name).pkg, analogous to the 'package-output-path'"), 'identifier': attr.string(mandatory=False, doc='An Apple Uniform Type Identifier (similar to a Reverse-DNS Notation) as a unique identifier for this package'), 'component_plist': attr.label(allow_files=True, mandatory=False), 'version': attr.string(mandatory=True, default='0', doc="A version for the package; used to compare against different versions of the 'identifier' to see whether this upgrades or downgrades an existing install"), '_script_template': attr.label(allow_single_file=True, default=':pkgbuild_tars.sh.tpl')}, doc="Package a complete destination root. For example, the 'xcodebuild' tool with the 'install' action creates a destination root. This rule is intended to package up a destination root that would be given as 'pkgbuild --root' except that it wants to lay out the given 'tars' into that 'root' before packaging") |
pipe = make_pipeline(preprocessor, LinearRegression())
res = -cross_val_score(
pipe, with_age, with_age['Age'], n_jobs=1, cv=100,
scoring='neg_mean_absolute_error'
)
sns.distplot(res)
sns.distplot(with_age.Age)
print(f'{res.mean()} +/- {res.std()}')
| pipe = make_pipeline(preprocessor, linear_regression())
res = -cross_val_score(pipe, with_age, with_age['Age'], n_jobs=1, cv=100, scoring='neg_mean_absolute_error')
sns.distplot(res)
sns.distplot(with_age.Age)
print(f'{res.mean()} +/- {res.std()}') |
#Finding the percentage
if __name__ == '__main__':
n = int(raw_input())
student_marks = {}
for _ in range(n):
line = raw_input().split()
name, scores = line[0], line[1:]
scores = map(float, scores)
student_marks[name] = scores
query_name = raw_input()
scores=student_marks[query_name]
#scores=scores.split()
sum1=scores[0]+scores[1]+scores[2]
avg=round(sum1/3,2)
print("%.2f" % avg)
| if __name__ == '__main__':
n = int(raw_input())
student_marks = {}
for _ in range(n):
line = raw_input().split()
(name, scores) = (line[0], line[1:])
scores = map(float, scores)
student_marks[name] = scores
query_name = raw_input()
scores = student_marks[query_name]
sum1 = scores[0] + scores[1] + scores[2]
avg = round(sum1 / 3, 2)
print('%.2f' % avg) |
# Problem : https://codeforces.com/problemset/problem/855/B
n, p, q, r = map(int, input().split())
arr = [int(i) for i in input().split()]
Pmax = [-10**9] * n
Pmax[0] = p * arr[0]
for i in range(1, n):
Pmax[i] = max(Pmax[i-1], p * arr[i])
Smax = [-10**9] * n
Smax[n-1] = r * arr[n-1]
for i in range(n-2, -1, -1):
Smax[i] = max(Smax[i+1], r * arr[i])
ans = Pmax[0] + q * arr[0] + Smax[0]
for i in range(1, n):
ans = max(ans, Pmax[i] + q * arr[i] + Smax[i])
print(ans)
| (n, p, q, r) = map(int, input().split())
arr = [int(i) for i in input().split()]
pmax = [-10 ** 9] * n
Pmax[0] = p * arr[0]
for i in range(1, n):
Pmax[i] = max(Pmax[i - 1], p * arr[i])
smax = [-10 ** 9] * n
Smax[n - 1] = r * arr[n - 1]
for i in range(n - 2, -1, -1):
Smax[i] = max(Smax[i + 1], r * arr[i])
ans = Pmax[0] + q * arr[0] + Smax[0]
for i in range(1, n):
ans = max(ans, Pmax[i] + q * arr[i] + Smax[i])
print(ans) |
class WhatThePatchException(Exception):
pass
class HunkException(WhatThePatchException):
def __init__(self, msg, hunk=None):
self.hunk = hunk
if hunk is not None:
super(HunkException, self).__init__(
"{msg}, in hunk #{n}".format(msg=msg, n=hunk)
)
else:
super(HunkException, self).__init__(msg)
class ApplyException(WhatThePatchException):
pass
class SubprocessException(ApplyException):
def __init__(self, msg, code):
super(SubprocessException, self).__init__(msg)
self.code = code
class HunkApplyException(HunkException, ApplyException, ValueError):
pass
class ParseException(HunkException, ValueError):
pass
| class Whatthepatchexception(Exception):
pass
class Hunkexception(WhatThePatchException):
def __init__(self, msg, hunk=None):
self.hunk = hunk
if hunk is not None:
super(HunkException, self).__init__('{msg}, in hunk #{n}'.format(msg=msg, n=hunk))
else:
super(HunkException, self).__init__(msg)
class Applyexception(WhatThePatchException):
pass
class Subprocessexception(ApplyException):
def __init__(self, msg, code):
super(SubprocessException, self).__init__(msg)
self.code = code
class Hunkapplyexception(HunkException, ApplyException, ValueError):
pass
class Parseexception(HunkException, ValueError):
pass |
'''
Given a sorted array nums, remove the duplicates in-place such that duplicates appeared at most twice and return the new length.
Do not allocate extra space for another array, you must do this by modifying the input array in-place with O(1) extra memory.
Example 1:
Given nums = [1,1,1,2,2,3],
Your function should return length = 5, with the first five elements of nums being 1, 1, 2, 2 and 3 respectively.
It doesn't matter what you leave beyond the returned length.
'''
class Solution(object):
def removeDuplicates(self, nums):
"""
:type nums: List[int]
:rtype: int
"""
if len(nums) <= 2:
return len(nums)
prev, curr = 1, 2
while curr < len(nums):
if nums[prev] == nums[curr] and nums[curr] == nums[prev-1]:
curr += 1
else:
prev += 1
nums[prev] = nums[curr]
curr += 1
return prev+1
| """
Given a sorted array nums, remove the duplicates in-place such that duplicates appeared at most twice and return the new length.
Do not allocate extra space for another array, you must do this by modifying the input array in-place with O(1) extra memory.
Example 1:
Given nums = [1,1,1,2,2,3],
Your function should return length = 5, with the first five elements of nums being 1, 1, 2, 2 and 3 respectively.
It doesn't matter what you leave beyond the returned length.
"""
class Solution(object):
def remove_duplicates(self, nums):
"""
:type nums: List[int]
:rtype: int
"""
if len(nums) <= 2:
return len(nums)
(prev, curr) = (1, 2)
while curr < len(nums):
if nums[prev] == nums[curr] and nums[curr] == nums[prev - 1]:
curr += 1
else:
prev += 1
nums[prev] = nums[curr]
curr += 1
return prev + 1 |
#Project Euler Question 18
#By starting at the top of the triangle below and moving to adjacent numbers on the row below, the maximum total from top to bottom is 23.
#3
#7 4
#2 4 6
#8 5 9 3
#That is, 3 + 7 + 4 + 9 = 23.
#Find the maximum total from top to bottom of the triangle below:
grid = """75
95 64
17 47 82
18 35 87 10
20 04 82 47 65
19 01 23 75 03 34
88 02 77 73 07 63 67
99 65 04 28 06 16 70 92
41 41 26 56 83 40 80 70 33
41 48 72 33 47 32 37 16 94 29
53 71 44 65 25 43 91 52 97 51 14
70 11 33 28 77 73 17 78 39 68 17 57
91 71 52 38 17 14 91 43 58 50 27 29 48
63 66 04 68 89 53 67 30 73 16 69 87 40 31
04 62 98 27 23 09 70 98 73 93 38 53 60 04 23"""
grid = grid.replace("00", "0")
grid = grid.replace("01", "1")
grid = grid.replace("02", "2")
grid = grid.replace("03", "3")
grid = grid.replace("04", "4")
grid = grid.replace("05", "5")
grid = grid.replace("06", "6")
grid = grid.replace("07", "7")
grid = grid.replace("08", "8")
grid = grid.replace("09", "9")
grid = [(row.split(" ")) for row in grid.split("\n")]
for row in grid:
for term in row:
intterm = int(term)
row[row.index(term)] = intterm
y = 1
high_term = []
for row in grid[-1:-2:-1]:
#print (row)
for term in row:
#print (term)
#print (row[y])
if term >= row[y]:
high_term.append(term)
else:
high_term.append(row[y])
y += 1
if y >= len(row):
break
y = 1
y = 1
#print (high_term)
old_high_term = high_term.copy()
new_high_term = []
#new_high_list = []
z = 0
for row in grid[-2::-1]:
#print (row, "is the current row")
if len(new_high_term) == 1:
highest_sum = new_high_term
highest_sum.append(row[0])
highest_sum = sum(highest_sum)
break
else:
new_high_term.clear()
for term in row:
#print (term)
check1 = (term + old_high_term[z])
check2 = (row[y] + old_high_term[z+1])
if check1 >= check2:
new_high_term.append(check1)
else:
new_high_term.append(check2)
y += 1
z += 1
if z >= (len(old_high_term)-1):
break
#print (new_high_term, "is the current list of high sums")
old_high_term.clear()
old_high_term = new_high_term.copy()
y = 1
z = 0
print (highest_sum, "is the highest sum") | grid = '75\n95 64\n17 47 82\n18 35 87 10\n20 04 82 47 65\n19 01 23 75 03 34\n88 02 77 73 07 63 67\n99 65 04 28 06 16 70 92\n41 41 26 56 83 40 80 70 33\n41 48 72 33 47 32 37 16 94 29\n53 71 44 65 25 43 91 52 97 51 14\n70 11 33 28 77 73 17 78 39 68 17 57\n91 71 52 38 17 14 91 43 58 50 27 29 48\n63 66 04 68 89 53 67 30 73 16 69 87 40 31\n04 62 98 27 23 09 70 98 73 93 38 53 60 04 23'
grid = grid.replace('00', '0')
grid = grid.replace('01', '1')
grid = grid.replace('02', '2')
grid = grid.replace('03', '3')
grid = grid.replace('04', '4')
grid = grid.replace('05', '5')
grid = grid.replace('06', '6')
grid = grid.replace('07', '7')
grid = grid.replace('08', '8')
grid = grid.replace('09', '9')
grid = [row.split(' ') for row in grid.split('\n')]
for row in grid:
for term in row:
intterm = int(term)
row[row.index(term)] = intterm
y = 1
high_term = []
for row in grid[-1:-2:-1]:
for term in row:
if term >= row[y]:
high_term.append(term)
else:
high_term.append(row[y])
y += 1
if y >= len(row):
break
y = 1
y = 1
old_high_term = high_term.copy()
new_high_term = []
z = 0
for row in grid[-2::-1]:
if len(new_high_term) == 1:
highest_sum = new_high_term
highest_sum.append(row[0])
highest_sum = sum(highest_sum)
break
else:
new_high_term.clear()
for term in row:
check1 = term + old_high_term[z]
check2 = row[y] + old_high_term[z + 1]
if check1 >= check2:
new_high_term.append(check1)
else:
new_high_term.append(check2)
y += 1
z += 1
if z >= len(old_high_term) - 1:
break
old_high_term.clear()
old_high_term = new_high_term.copy()
y = 1
z = 0
print(highest_sum, 'is the highest sum') |
class Request:
pickup_deadline = 0
def __init__(self, request_id, start_lon, start_lat, end_lon, end_lat, start_node_id, end_node_id, release_time=None, delivery_deadline=None, pickup_deadline=None):
self.request_id = request_id
self.start_lon = start_lon
self.start_lat = start_lat
self.end_lon = end_lon
self.end_lat = end_lat
self.start_node_id = start_node_id
self.end_node_id = end_node_id
self.release_time = release_time
self.delivery_deadline = delivery_deadline
def config_pickup_deadline(self, t):
self.pickup_deadline = t
| class Request:
pickup_deadline = 0
def __init__(self, request_id, start_lon, start_lat, end_lon, end_lat, start_node_id, end_node_id, release_time=None, delivery_deadline=None, pickup_deadline=None):
self.request_id = request_id
self.start_lon = start_lon
self.start_lat = start_lat
self.end_lon = end_lon
self.end_lat = end_lat
self.start_node_id = start_node_id
self.end_node_id = end_node_id
self.release_time = release_time
self.delivery_deadline = delivery_deadline
def config_pickup_deadline(self, t):
self.pickup_deadline = t |
# AUTOGENERATED! DO NOT EDIT! File to edit: 00_core.ipynb (unless otherwise specified).
__all__ = ['do_something']
# Cell
def do_something():
print('brztt') | __all__ = ['do_something']
def do_something():
print('brztt') |
class C1:
def __init__(self, value):
self.value = value
def __bytes__(self):
return self.value
c1 = C1(b"class 1")
print(bytes(c1))
| class C1:
def __init__(self, value):
self.value = value
def __bytes__(self):
return self.value
c1 = c1(b'class 1')
print(bytes(c1)) |
###############################################################
############# FIND THE LAND LORDS ###############
###############################################################
#Residential props ['100','113','150','160','210','220','230','240','330']
#df_tcad['res'] = (df_tcad.res | df_tcad.land_use.isin(res_code))
#df_tcad = df_tcad.loc[df_tcad.res]
df_tcad.address.fillna('MISSING ADDRESS',inplace=True) #change to 0 for fuzz match
df_tcad.owner_add.fillna('NO ADDRESS FOUND',inplace=True) #change to 0 for fuzz match
#Determine landlord criteria
df_tcad['single_unit'] = np.where(df_tcad.units_x>1, False, True)
#See if mailing address and address match up is 75 too HIGH???
df_tcad['score'] = df_tcad.apply(lambda x: fuzz.partial_ratio(x.address,x.owner_add),axis=1)
df_tcad['add_match'] = np.where((df_tcad.score > 70), True, False)
#Multiple property owner
df_tcad['multi_own'] = df_tcad.duplicated(subset='py_owner_i') #multiple owner ids
df_tcad['multi_own1'] = df_tcad.duplicated(subset='prop_owner') #multiple owner names
#df_tcad['multi_own2'] = df_tcad.duplicated(subset='mail_add_2') #multiple owner_add subsets
df_tcad['multi_own3'] = df_tcad.duplicated(subset='owner_add') #multiple owner_add
#props with no address should be nan
df_tcad.address.replace('MISSING ADDRESS',np.nan,inplace=True)
df_tcad.owner_add.replace('NO ADDRESS FOUND',np.nan,inplace=True) #change to 0 for fuzz match
#If single unit addresses match zips match not a biz and not a multi owner
#maybe include hs figure out how to use to get corner cases?
df_ll = df_tcad.loc[df_tcad.res & (~((df_tcad.single_unit)&(df_tcad.add_match)&(~(df_tcad.multi_own|df_tcad.multi_own1|df_tcad.multi_own3))))]
#Drop non residential locations and city properties that slipped through the algorithm
df_ll = df_ll.loc[~(df_ll.address=='VARIOUS LOCATIONS')] #No idea what these are but they dont belong
df_ll = df_ll.loc[~(df_ll.address=='*VARIOUS LOCATIONS')] #No idea what these are but they dont belong
df_ll = df_ll.loc[~(df_ll.owner_add.str.contains('PO BOX 1088 ',na=False))] #City of Austin
df_ll = df_ll.loc[~(df_ll.owner_add.str.contains('PO BOX 1748 ',na=False))] #Travis County
df_ll = df_ll.loc[df_ll.address.str.len()>=5] #get rid of properties with bad addresses as they all have none type prop_owner (cant filter out weird bug?)
df_ll = df_ll.loc[~(df_ll.owner_add.str.contains('PO BOX 15426',na=False))] #State of Texas
df_ll = df_ll.loc[~(df_ll.owner_add.str.contains('PO BOX 17126',na=False))] #Land Fills why are these coded res?
df_ll = df_ll.loc[df_ll.land_use!=640] #schools
com_type = ['OFF/RETAIL (SFR)', 'COMMERCIAL SPACE CONDOS', 'SM OFFICE CONDO', 'LG OFFICE CONDO', 'OFFICE (SMALL)','SM STORE <10K SF', 'STRIP CTR <10000', 'WAREHOUSE <20000', "MF'D COMMCL BLDG", 'OFFICE LG >35000', 'MEDICAL OFF <10K','PARKING GARAGE']
df_ll = df_ll.loc[~(df_ll.type1.isin(com_type)&(~df_ll.land_use.isin(res_code)))] #office condos that are not mixed use
#Handle more missing
df_ll.X_x = df_ll.groupby(['st_name','st_number']).X_x.transform('ffill')
df_ll.X_x = df_ll.groupby(['st_name','st_number']).X_x.transform('bfill')
df_ll.Y_x = df_ll.groupby(['st_name','st_number']).Y_x.transform('ffill')
df_ll.Y_x = df_ll.groupby(['st_name','st_number']).Y_x.transform('bfill')
#Combine units with same prop owner and same address
#df_ll.units_x = df_ll.groupby(['address','prop_owner'])['units_x'].transform('sum')
#df_ll.drop_duplicates(['address','prop_owner'],inplace=True)
#Add in values from eviction data
#df_e = pd.read_csv('Evictions_filled_partial_9_26.csv')
#df_e['prop_id'] = df_e['Property ID']
#df_e = df_e.loc[df_e.prop_id.notnull()]
#df_eid = df_e[['prop_id','Lat','Long']]
#df_eid = df_eid.merge(df_tcad,on='prop_id',how='left')
#cols = df_tcad.columns.tolist()
#df_ll = df_eid.merge(df_ll,on=cols,how='outer').drop_duplicates('prop_id')
#df_ll.Y_x.fillna(df_ll.Lat,inplace=True)
#df_ll.X_x.fillna(df_ll.Long,inplace=True)
#df_e.loc[~df_e.prop_id.isin(df_ll.prop_id.values)]
#Fill in imputed values
df_ll.units_x.fillna(df_ll['unit_est'],inplace=True)
#Round it and correct
df_ll.units_x = round(df_ll.units_x)
df_ll.units_x = np.where(df_ll.units_x<1, 1, df_ll.units_x)
#Fill in with property unit estimations on ly where the low of the range estimate is higher then the imputated value
df_ll.units_x = np.where((df_ll.low>df_ll.units_x)&(df_ll.known==False),df_ll.low,df_ll.units_x)
#Get rid of estimates from type that are above 1k
df_ll.units_x = np.where((df_ll.units_x>1000),np.nan,df_ll.units_x)
#Export for dedupe and affiliation clustering
df_ll_dup = df_ll[['prop_owner','py_owner_i','address','owner_add','prop_id','DBA']]
df_ll_dup.to_csv('./land_lords.csv',index=False)
df_ll['land_lord_res'] = (((df_ll.units_x==1)&df_ll.add_match) | ((df_ll.hs=='T')&(df_ll.units_x==1)))
#df_ll.loc[(df_ll.hs=='T')&(df_ll.units_x>2)&(df_ll.known)][['prop_owner','owner_add','address','units_x','type1','low']]
#Export shape file and csv file for prelim check in qGIS
#coor_to_geometry(df_ll,col=['X_x_x','Y_x_x'],out='geometry')
#keep = ['prop_id', 'py_owner_i', 'prop_owner', 'DBA', 'address', 'owner_add','units_x','geometry']
#gdf_ll = geopandas.GeoDataFrame(df_ll,geometry='geometry')
#clean_up(gdf_ll,cols=keep,delete=False)
#gdf_ll.to_file("all_landlords.shp")
#pid= []
#cols = [ 'desc' ,'DBA' ,'address' ,'owner_add' ,'type1']
#for col in cols:
# pid.append(df_tcad.loc[df_tcad[col].str.contains('COMMERCIAL',na=False)].prop_id.tolist())
#
#pid = list(set(pid))
#
#df_tcad.loc[~df_tcad.prop_id.isin(pid)]
| df_tcad.address.fillna('MISSING ADDRESS', inplace=True)
df_tcad.owner_add.fillna('NO ADDRESS FOUND', inplace=True)
df_tcad['single_unit'] = np.where(df_tcad.units_x > 1, False, True)
df_tcad['score'] = df_tcad.apply(lambda x: fuzz.partial_ratio(x.address, x.owner_add), axis=1)
df_tcad['add_match'] = np.where(df_tcad.score > 70, True, False)
df_tcad['multi_own'] = df_tcad.duplicated(subset='py_owner_i')
df_tcad['multi_own1'] = df_tcad.duplicated(subset='prop_owner')
df_tcad['multi_own3'] = df_tcad.duplicated(subset='owner_add')
df_tcad.address.replace('MISSING ADDRESS', np.nan, inplace=True)
df_tcad.owner_add.replace('NO ADDRESS FOUND', np.nan, inplace=True)
df_ll = df_tcad.loc[df_tcad.res & ~(df_tcad.single_unit & df_tcad.add_match & ~(df_tcad.multi_own | df_tcad.multi_own1 | df_tcad.multi_own3))]
df_ll = df_ll.loc[~(df_ll.address == 'VARIOUS LOCATIONS')]
df_ll = df_ll.loc[~(df_ll.address == '*VARIOUS LOCATIONS')]
df_ll = df_ll.loc[~df_ll.owner_add.str.contains('PO BOX 1088 ', na=False)]
df_ll = df_ll.loc[~df_ll.owner_add.str.contains('PO BOX 1748 ', na=False)]
df_ll = df_ll.loc[df_ll.address.str.len() >= 5]
df_ll = df_ll.loc[~df_ll.owner_add.str.contains('PO BOX 15426', na=False)]
df_ll = df_ll.loc[~df_ll.owner_add.str.contains('PO BOX 17126', na=False)]
df_ll = df_ll.loc[df_ll.land_use != 640]
com_type = ['OFF/RETAIL (SFR)', 'COMMERCIAL SPACE CONDOS', 'SM OFFICE CONDO', 'LG OFFICE CONDO', 'OFFICE (SMALL)', 'SM STORE <10K SF', 'STRIP CTR <10000', 'WAREHOUSE <20000', "MF'D COMMCL BLDG", 'OFFICE LG >35000', 'MEDICAL OFF <10K', 'PARKING GARAGE']
df_ll = df_ll.loc[~(df_ll.type1.isin(com_type) & ~df_ll.land_use.isin(res_code))]
df_ll.X_x = df_ll.groupby(['st_name', 'st_number']).X_x.transform('ffill')
df_ll.X_x = df_ll.groupby(['st_name', 'st_number']).X_x.transform('bfill')
df_ll.Y_x = df_ll.groupby(['st_name', 'st_number']).Y_x.transform('ffill')
df_ll.Y_x = df_ll.groupby(['st_name', 'st_number']).Y_x.transform('bfill')
df_ll.units_x.fillna(df_ll['unit_est'], inplace=True)
df_ll.units_x = round(df_ll.units_x)
df_ll.units_x = np.where(df_ll.units_x < 1, 1, df_ll.units_x)
df_ll.units_x = np.where((df_ll.low > df_ll.units_x) & (df_ll.known == False), df_ll.low, df_ll.units_x)
df_ll.units_x = np.where(df_ll.units_x > 1000, np.nan, df_ll.units_x)
df_ll_dup = df_ll[['prop_owner', 'py_owner_i', 'address', 'owner_add', 'prop_id', 'DBA']]
df_ll_dup.to_csv('./land_lords.csv', index=False)
df_ll['land_lord_res'] = (df_ll.units_x == 1) & df_ll.add_match | (df_ll.hs == 'T') & (df_ll.units_x == 1) |
#
# @lc app=leetcode id=1143 lang=python3
#
# [1143] Longest Common Subsequence
#
# https://leetcode.com/problems/longest-common-subsequence/description/
#
# algorithms
# Medium (58.79%)
# Likes: 4759
# Dislikes: 56
# Total Accepted: 295.2K
# Total Submissions: 502K
# Testcase Example: '"abcde"\n"ace"'
#
# Given two strings text1 and text2, return the length of their longest common
# subsequence. If there is no common subsequence, return 0.
#
# A subsequence of a string is a new string generated from the original string
# with some characters (can be none) deleted without changing the relative
# order of the remaining characters.
#
#
# For example, "ace" is a subsequence of "abcde".
#
#
# A common subsequence of two strings is a subsequence that is common to both
# strings.
#
#
# Example 1:
#
#
# Input: text1 = "abcde", text2 = "ace"
# Output: 3
# Explanation: The longest common subsequence is "ace" and its length is 3.
#
#
# Example 2:
#
#
# Input: text1 = "abc", text2 = "abc"
# Output: 3
# Explanation: The longest common subsequence is "abc" and its length is 3.
#
#
# Example 3:
#
#
# Input: text1 = "abc", text2 = "def"
# Output: 0
# Explanation: There is no such common subsequence, so the result is 0.
#
#
#
# Constraints:
#
#
# 1 <= text1.length, text2.length <= 1000
# text1 and text2 consist of only lowercase English characters.
#
#
#
# @lc code=start
class Solution:
def longestCommonSubsequence(self, text1: str, text2: str) -> int:
m = len(text1)
n = len(text2)
dp = [[0] * (n+1) for _ in range(m+1)]
for i in range(1, m+1):
for j in range(1, n+1):
if text1[i-1] == text2[j-1]:
dp[i][j] = dp[i-1][j-1] + 1
else:
dp[i][j] = max(dp[i][j-1], dp[i-1][j])
return dp[-1][-1]
# def longestCommonSubsequence(self, text1: str, text2: str) -> int:
# m, n = len(text1), len(text2)
# dp = [[0] * n for _ in range(m)]
# for i in range(m):
# if text2[0] in text1[:i+1]:
# dp[i][0] = 1
# for i in range(n):
# if text1[0] in text2[:i+1]:
# dp[0][i] = 1
# for i in range(1, m):
# for j in range(1, n):
# if text1[i] == text2[j]:
# dp[i][j] = dp[i-1][j-1] + 1
# else:
# dp[i][j] = max(dp[i-1][j], dp[i][j-1])
# return dp[-1][-1]
# @lc code=end
| class Solution:
def longest_common_subsequence(self, text1: str, text2: str) -> int:
m = len(text1)
n = len(text2)
dp = [[0] * (n + 1) for _ in range(m + 1)]
for i in range(1, m + 1):
for j in range(1, n + 1):
if text1[i - 1] == text2[j - 1]:
dp[i][j] = dp[i - 1][j - 1] + 1
else:
dp[i][j] = max(dp[i][j - 1], dp[i - 1][j])
return dp[-1][-1] |
class Solution:
def closestDivisors(self, num: int) -> List[int]:
def largest(n):
res = [1, n]
for i in range(2, int(n**0.5)+1):
if n % i == 0:
res = [i, n//i]
return res
r1, r2 = largest(num+1)
r3, r4 = largest(num+2)
return [r1, r2] if abs(r1 - r2) < abs(r3- r4) else [r3,r4]
class Solution:
def closestDivisors(self, x):
for a in range(int((x + 2)**0.5), 0, -1):
if (x + 1) % a == 0:
return [a, (x + 1) // a]
if (x + 2) % a == 0:
return [a, (x + 2) // a]
class Solution:
def closestDivisors(self, x):
return next([a, y // a] for a in range(int((x + 2)**0.5), 0, -1) for y in [x + 1, x + 2] if not y % a) | class Solution:
def closest_divisors(self, num: int) -> List[int]:
def largest(n):
res = [1, n]
for i in range(2, int(n ** 0.5) + 1):
if n % i == 0:
res = [i, n // i]
return res
(r1, r2) = largest(num + 1)
(r3, r4) = largest(num + 2)
return [r1, r2] if abs(r1 - r2) < abs(r3 - r4) else [r3, r4]
class Solution:
def closest_divisors(self, x):
for a in range(int((x + 2) ** 0.5), 0, -1):
if (x + 1) % a == 0:
return [a, (x + 1) // a]
if (x + 2) % a == 0:
return [a, (x + 2) // a]
class Solution:
def closest_divisors(self, x):
return next(([a, y // a] for a in range(int((x + 2) ** 0.5), 0, -1) for y in [x + 1, x + 2] if not y % a)) |
def new(name):
print("Hi, " + name)
player = {
"name": "Cris",
"age": 40
}
| def new(name):
print('Hi, ' + name)
player = {'name': 'Cris', 'age': 40} |
LAST_SEEN = {
"Last 1 Hour": 1,
"Last 2 Hours": 2,
"Last 6 Hours": 6,
"Last 12 Hours": 12,
"Last 24 Hours": 24,
"Last 48 Hours": 48,
"Last 72 Hours": 72,
"Last 7 Days": 7,
"Last 14 Days": 14,
"Last 21 Days": 21,
"Last 30 Days": 30,
"Last 60 Days": 60,
"Last 90 Days": 90,
"Last Year": 365
}
| last_seen = {'Last 1 Hour': 1, 'Last 2 Hours': 2, 'Last 6 Hours': 6, 'Last 12 Hours': 12, 'Last 24 Hours': 24, 'Last 48 Hours': 48, 'Last 72 Hours': 72, 'Last 7 Days': 7, 'Last 14 Days': 14, 'Last 21 Days': 21, 'Last 30 Days': 30, 'Last 60 Days': 60, 'Last 90 Days': 90, 'Last Year': 365} |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""Problem 050
Set .add()
Source : https://www.hackerrank.com/challenges/py-set-add/problem
"""
countries = set()
[countries.add(input()) for country in range(int(input()))]
print(len(countries))
| """Problem 050
Set .add()
Source : https://www.hackerrank.com/challenges/py-set-add/problem
"""
countries = set()
[countries.add(input()) for country in range(int(input()))]
print(len(countries)) |
#
# PySNMP MIB module TERADICI-PCOIPv2-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/TERADICI-PCOIPv2-MIB
# Produced by pysmi-0.3.4 at Wed May 1 15:15:50 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 (default, Mar 27 2019, 09:23:15)
#
OctetString, ObjectIdentifier, Integer = mibBuilder.importSymbols("ASN1", "OctetString", "ObjectIdentifier", "Integer")
NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues")
ConstraintsIntersection, SingleValueConstraint, ValueRangeConstraint, ValueSizeConstraint, ConstraintsUnion = mibBuilder.importSymbols("ASN1-REFINEMENT", "ConstraintsIntersection", "SingleValueConstraint", "ValueRangeConstraint", "ValueSizeConstraint", "ConstraintsUnion")
ModuleCompliance, NotificationGroup = mibBuilder.importSymbols("SNMPv2-CONF", "ModuleCompliance", "NotificationGroup")
Counter64, iso, Unsigned32, ModuleIdentity, IpAddress, Integer32, enterprises, Gauge32, NotificationType, Bits, Counter32, MibIdentifier, TimeTicks, MibScalar, MibTable, MibTableRow, MibTableColumn, ObjectIdentity = mibBuilder.importSymbols("SNMPv2-SMI", "Counter64", "iso", "Unsigned32", "ModuleIdentity", "IpAddress", "Integer32", "enterprises", "Gauge32", "NotificationType", "Bits", "Counter32", "MibIdentifier", "TimeTicks", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "ObjectIdentity")
TextualConvention, DisplayString = mibBuilder.importSymbols("SNMPv2-TC", "TextualConvention", "DisplayString")
teraMibModule = ModuleIdentity((1, 3, 6, 1, 4, 1, 25071))
teraMibModule.setRevisions(('2012-01-28 10:00',))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
if mibBuilder.loadTexts: teraMibModule.setRevisionsDescriptions(('Version 2 of the PCoIP MIB.',))
if mibBuilder.loadTexts: teraMibModule.setLastUpdated('201201281000Z')
if mibBuilder.loadTexts: teraMibModule.setOrganization('Teradici Corporation')
if mibBuilder.loadTexts: teraMibModule.setContactInfo(' Chris Topp Postal: 101-4621 Canada Way Burnaby, BC V5G 4X8 Canada Tel: +1 604 451 5800 Fax: +1 604 451 5818 E-mail: ctopp@teradici.com')
if mibBuilder.loadTexts: teraMibModule.setDescription('MIB describing PC-over-IP (tm) statistics.')
teraProducts = MibIdentifier((1, 3, 6, 1, 4, 1, 25071, 1))
teraPcoipV2 = MibIdentifier((1, 3, 6, 1, 4, 1, 25071, 1, 2))
teraPcoipGenStats = MibIdentifier((1, 3, 6, 1, 4, 1, 25071, 1, 2, 1))
teraPcoipNetStats = MibIdentifier((1, 3, 6, 1, 4, 1, 25071, 1, 2, 2))
teraPcoipAudioStats = MibIdentifier((1, 3, 6, 1, 4, 1, 25071, 1, 2, 3))
teraPcoipImagingStats = MibIdentifier((1, 3, 6, 1, 4, 1, 25071, 1, 2, 4))
teraPcoipUSBStats = MibIdentifier((1, 3, 6, 1, 4, 1, 25071, 1, 2, 5))
teraPcoipGenDevices = MibIdentifier((1, 3, 6, 1, 4, 1, 25071, 1, 2, 6))
teraPcoipImagingDevices = MibIdentifier((1, 3, 6, 1, 4, 1, 25071, 1, 2, 7))
teraPcoipUSBDevices = MibIdentifier((1, 3, 6, 1, 4, 1, 25071, 1, 2, 8))
pcoipGenStatsTable = MibTable((1, 3, 6, 1, 4, 1, 25071, 1, 2, 1, 1), )
if mibBuilder.loadTexts: pcoipGenStatsTable.setStatus('current')
if mibBuilder.loadTexts: pcoipGenStatsTable.setDescription('The PCoIP General statistics table.')
pcoipGenStatsEntry = MibTableRow((1, 3, 6, 1, 4, 1, 25071, 1, 2, 1, 1, 1), ).setIndexNames((0, "TERADICI-PCOIPv2-MIB", "pcoipGenStatsSessionNumber"))
if mibBuilder.loadTexts: pcoipGenStatsEntry.setStatus('current')
if mibBuilder.loadTexts: pcoipGenStatsEntry.setDescription('An entry in the PCoIP general statistics table.')
pcoipGenStatsSessionNumber = MibTableColumn((1, 3, 6, 1, 4, 1, 25071, 1, 2, 1, 1, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 1))).setMaxAccess("readonly")
if mibBuilder.loadTexts: pcoipGenStatsSessionNumber.setStatus('current')
if mibBuilder.loadTexts: pcoipGenStatsSessionNumber.setDescription('PCoIP session number used to link PCoIP statistics to session.')
pcoipGenStatsPacketsSent = MibTableColumn((1, 3, 6, 1, 4, 1, 25071, 1, 2, 1, 1, 1, 2), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pcoipGenStatsPacketsSent.setStatus('current')
if mibBuilder.loadTexts: pcoipGenStatsPacketsSent.setDescription('Total number of packets that have been transmitted since the PCoIP session started.')
pcoipGenStatsBytesSent = MibTableColumn((1, 3, 6, 1, 4, 1, 25071, 1, 2, 1, 1, 1, 3), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pcoipGenStatsBytesSent.setStatus('current')
if mibBuilder.loadTexts: pcoipGenStatsBytesSent.setDescription('Total number of bytes that have been transmitted since the PCoIP session started.')
pcoipGenStatsPacketsReceived = MibTableColumn((1, 3, 6, 1, 4, 1, 25071, 1, 2, 1, 1, 1, 4), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pcoipGenStatsPacketsReceived.setStatus('current')
if mibBuilder.loadTexts: pcoipGenStatsPacketsReceived.setDescription('Total number of packets that have been received since the PCoIP session started.')
pcoipGenStatsBytesReceived = MibTableColumn((1, 3, 6, 1, 4, 1, 25071, 1, 2, 1, 1, 1, 5), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pcoipGenStatsBytesReceived.setStatus('current')
if mibBuilder.loadTexts: pcoipGenStatsBytesReceived.setDescription('Total number of bytes that have been received since the PCoIP session started.')
pcoipGenStatsTxPacketsLost = MibTableColumn((1, 3, 6, 1, 4, 1, 25071, 1, 2, 1, 1, 1, 6), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pcoipGenStatsTxPacketsLost.setStatus('current')
if mibBuilder.loadTexts: pcoipGenStatsTxPacketsLost.setDescription('Total number of transmit packets that have been lost since the PCoIP session started.')
pcoipGenStatsSessionDuration = MibTableColumn((1, 3, 6, 1, 4, 1, 25071, 1, 2, 1, 1, 1, 7), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pcoipGenStatsSessionDuration.setStatus('current')
if mibBuilder.loadTexts: pcoipGenStatsSessionDuration.setDescription('An incrementing number that represents the total number of seconds the PCoIP session has been open.')
pcoipNetStatsTable = MibTable((1, 3, 6, 1, 4, 1, 25071, 1, 2, 2, 1), )
if mibBuilder.loadTexts: pcoipNetStatsTable.setStatus('current')
if mibBuilder.loadTexts: pcoipNetStatsTable.setDescription('The PCoIP Network statistics table.')
pcoipNetStatsEntry = MibTableRow((1, 3, 6, 1, 4, 1, 25071, 1, 2, 2, 1, 1), ).setIndexNames((0, "TERADICI-PCOIPv2-MIB", "pcoipNetStatsSessionNumber"))
if mibBuilder.loadTexts: pcoipNetStatsEntry.setStatus('current')
if mibBuilder.loadTexts: pcoipNetStatsEntry.setDescription('An entry in the PCoIP network statistics table.')
pcoipNetStatsSessionNumber = MibTableColumn((1, 3, 6, 1, 4, 1, 25071, 1, 2, 2, 1, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 1))).setMaxAccess("readonly")
if mibBuilder.loadTexts: pcoipNetStatsSessionNumber.setStatus('current')
if mibBuilder.loadTexts: pcoipNetStatsSessionNumber.setDescription('PCoIP session number used to link statistics to session.')
pcoipNetStatsRoundTripLatencyMs = MibTableColumn((1, 3, 6, 1, 4, 1, 25071, 1, 2, 2, 1, 1, 2), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pcoipNetStatsRoundTripLatencyMs.setStatus('current')
if mibBuilder.loadTexts: pcoipNetStatsRoundTripLatencyMs.setDescription('Round trip latency (in milliseconds) between server and client.')
pcoipNetStatsRXBWkbitPersec = MibTableColumn((1, 3, 6, 1, 4, 1, 25071, 1, 2, 2, 1, 1, 3), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pcoipNetStatsRXBWkbitPersec.setStatus('current')
if mibBuilder.loadTexts: pcoipNetStatsRXBWkbitPersec.setDescription('Average number of kilobits per second that have been received by this device.')
pcoipNetStatsRXBWPeakkbitPersec = MibTableColumn((1, 3, 6, 1, 4, 1, 25071, 1, 2, 2, 1, 1, 4), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 1000))).setMaxAccess("readonly")
if mibBuilder.loadTexts: pcoipNetStatsRXBWPeakkbitPersec.setStatus('current')
if mibBuilder.loadTexts: pcoipNetStatsRXBWPeakkbitPersec.setDescription('Peak bandwidth for incoming PCoIP packets within a one second sampling period.')
pcoipNetStatsRXPacketLossPercent = MibTableColumn((1, 3, 6, 1, 4, 1, 25071, 1, 2, 2, 1, 1, 5), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 100))).setMaxAccess("readonly")
if mibBuilder.loadTexts: pcoipNetStatsRXPacketLossPercent.setStatus('current')
if mibBuilder.loadTexts: pcoipNetStatsRXPacketLossPercent.setDescription('Percentage of received packets lost during a one second sampling period.')
pcoipNetStatsTXBWkbitPersec = MibTableColumn((1, 3, 6, 1, 4, 1, 25071, 1, 2, 2, 1, 1, 6), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pcoipNetStatsTXBWkbitPersec.setStatus('current')
if mibBuilder.loadTexts: pcoipNetStatsTXBWkbitPersec.setDescription('Average number of kilobits per second that have been transmitted by this device.')
pcoipNetStatsTXBWActiveLimitkbitPersec = MibTableColumn((1, 3, 6, 1, 4, 1, 25071, 1, 2, 2, 1, 1, 7), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 1000))).setMaxAccess("readonly")
if mibBuilder.loadTexts: pcoipNetStatsTXBWActiveLimitkbitPersec.setStatus('current')
if mibBuilder.loadTexts: pcoipNetStatsTXBWActiveLimitkbitPersec.setDescription('The current estimate of the available network bandwidth, updated every second.')
pcoipNetStatsTXBWLimitkbitPersec = MibTableColumn((1, 3, 6, 1, 4, 1, 25071, 1, 2, 2, 1, 1, 8), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 1000))).setMaxAccess("readonly")
if mibBuilder.loadTexts: pcoipNetStatsTXBWLimitkbitPersec.setStatus('current')
if mibBuilder.loadTexts: pcoipNetStatsTXBWLimitkbitPersec.setDescription('Transmit bandwidth limit for outgoing packets.')
pcoipNetStatsTXPacketLossPercent = MibTableColumn((1, 3, 6, 1, 4, 1, 25071, 1, 2, 2, 1, 1, 9), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 100))).setMaxAccess("readonly")
if mibBuilder.loadTexts: pcoipNetStatsTXPacketLossPercent.setStatus('current')
if mibBuilder.loadTexts: pcoipNetStatsTXPacketLossPercent.setDescription('Percentage of transmitted packets lost during the one second sampling period.')
pcoipAudioStatsTable = MibTable((1, 3, 6, 1, 4, 1, 25071, 1, 2, 3, 1), )
if mibBuilder.loadTexts: pcoipAudioStatsTable.setStatus('current')
if mibBuilder.loadTexts: pcoipAudioStatsTable.setDescription('The PCoIP Audio statistics table.')
pcoipAudioStatsEntry = MibTableRow((1, 3, 6, 1, 4, 1, 25071, 1, 2, 3, 1, 1), ).setIndexNames((0, "TERADICI-PCOIPv2-MIB", "pcoipAudioStatsSessionNumber"))
if mibBuilder.loadTexts: pcoipAudioStatsEntry.setStatus('current')
if mibBuilder.loadTexts: pcoipAudioStatsEntry.setDescription('An entry in the PCoIP audio statistics table.')
pcoipAudioStatsSessionNumber = MibTableColumn((1, 3, 6, 1, 4, 1, 25071, 1, 2, 3, 1, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 1))).setMaxAccess("readonly")
if mibBuilder.loadTexts: pcoipAudioStatsSessionNumber.setStatus('current')
if mibBuilder.loadTexts: pcoipAudioStatsSessionNumber.setDescription('PCoIP session number used to link statistics to session.')
pcoipAudioStatsBytesReceived = MibTableColumn((1, 3, 6, 1, 4, 1, 25071, 1, 2, 3, 1, 1, 2), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pcoipAudioStatsBytesReceived.setStatus('current')
if mibBuilder.loadTexts: pcoipAudioStatsBytesReceived.setDescription('Total number of audio bytes that have been received since the PCoIP session started.')
pcoipAudioStatsBytesSent = MibTableColumn((1, 3, 6, 1, 4, 1, 25071, 1, 2, 3, 1, 1, 3), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pcoipAudioStatsBytesSent.setStatus('current')
if mibBuilder.loadTexts: pcoipAudioStatsBytesSent.setDescription('Total number of audio bytes that have been sent since the PCoIP session started.')
pcoipAudioStatsRXBWkbitPersec = MibTableColumn((1, 3, 6, 1, 4, 1, 25071, 1, 2, 3, 1, 1, 4), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pcoipAudioStatsRXBWkbitPersec.setStatus('current')
if mibBuilder.loadTexts: pcoipAudioStatsRXBWkbitPersec.setDescription('Average number of kilobits per second that have been received by the audio channel of this device.')
pcoipAudioStatsTXBWkbitPersec = MibTableColumn((1, 3, 6, 1, 4, 1, 25071, 1, 2, 3, 1, 1, 5), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pcoipAudioStatsTXBWkbitPersec.setStatus('current')
if mibBuilder.loadTexts: pcoipAudioStatsTXBWkbitPersec.setDescription('Total number of audio kilobits that have been transmitted since the PCoIP session started.')
pcoipAudioStatsTXBWLimitkbitPersec = MibTableColumn((1, 3, 6, 1, 4, 1, 25071, 1, 2, 3, 1, 1, 6), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 1000))).setMaxAccess("readonly")
if mibBuilder.loadTexts: pcoipAudioStatsTXBWLimitkbitPersec.setStatus('current')
if mibBuilder.loadTexts: pcoipAudioStatsTXBWLimitkbitPersec.setDescription('Transmit bandwidth limit for outgoing audio packets.')
pcoipImagingStatsTable = MibTable((1, 3, 6, 1, 4, 1, 25071, 1, 2, 4, 1), )
if mibBuilder.loadTexts: pcoipImagingStatsTable.setStatus('current')
if mibBuilder.loadTexts: pcoipImagingStatsTable.setDescription('The PCoIP Imaging statistics table.')
pcoipImagingStatsEntry = MibTableRow((1, 3, 6, 1, 4, 1, 25071, 1, 2, 4, 1, 1), ).setIndexNames((0, "TERADICI-PCOIPv2-MIB", "pcoipImagingStatsSessionNumber"))
if mibBuilder.loadTexts: pcoipImagingStatsEntry.setStatus('current')
if mibBuilder.loadTexts: pcoipImagingStatsEntry.setDescription('An entry in the PCoIP imaging statistics table.')
pcoipImagingStatsSessionNumber = MibTableColumn((1, 3, 6, 1, 4, 1, 25071, 1, 2, 4, 1, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 1))).setMaxAccess("readonly")
if mibBuilder.loadTexts: pcoipImagingStatsSessionNumber.setStatus('current')
if mibBuilder.loadTexts: pcoipImagingStatsSessionNumber.setDescription('PCoIP session number used to link statistics to session.')
pcoipImagingStatsBytesReceived = MibTableColumn((1, 3, 6, 1, 4, 1, 25071, 1, 2, 4, 1, 1, 2), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pcoipImagingStatsBytesReceived.setStatus('current')
if mibBuilder.loadTexts: pcoipImagingStatsBytesReceived.setDescription('Total number of imaging bytes that have been received since the PCoIP session started.')
pcoipImagingStatsBytesSent = MibTableColumn((1, 3, 6, 1, 4, 1, 25071, 1, 2, 4, 1, 1, 3), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pcoipImagingStatsBytesSent.setStatus('current')
if mibBuilder.loadTexts: pcoipImagingStatsBytesSent.setDescription('Total number of imaging bytes that have been sent since the PCoIP session started.')
pcoipImagingStatsRXBWkbitPersec = MibTableColumn((1, 3, 6, 1, 4, 1, 25071, 1, 2, 4, 1, 1, 4), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pcoipImagingStatsRXBWkbitPersec.setStatus('current')
if mibBuilder.loadTexts: pcoipImagingStatsRXBWkbitPersec.setDescription('Average number of kilobits per second that have been received by the imaging channel of this device.')
pcoipImagingStatsTXBWkbitPersec = MibTableColumn((1, 3, 6, 1, 4, 1, 25071, 1, 2, 4, 1, 1, 5), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pcoipImagingStatsTXBWkbitPersec.setStatus('current')
if mibBuilder.loadTexts: pcoipImagingStatsTXBWkbitPersec.setDescription('Average number of kilobits per second that have been received by the imaging channel of this device.')
pcoipImagingStatsEncodedFramesPersec = MibTableColumn((1, 3, 6, 1, 4, 1, 25071, 1, 2, 4, 1, 1, 6), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 2400))).setMaxAccess("readonly")
if mibBuilder.loadTexts: pcoipImagingStatsEncodedFramesPersec.setStatus('current')
if mibBuilder.loadTexts: pcoipImagingStatsEncodedFramesPersec.setDescription('The number of imaging frames which were encoded over a one second sampling period.')
pcoipImagingStatsActiveMinimumQuality = MibTableColumn((1, 3, 6, 1, 4, 1, 25071, 1, 2, 4, 1, 1, 7), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 100))).setMaxAccess("readonly")
if mibBuilder.loadTexts: pcoipImagingStatsActiveMinimumQuality.setStatus('current')
if mibBuilder.loadTexts: pcoipImagingStatsActiveMinimumQuality.setDescription('The lowest encoded quality, updated every second.')
pcoipImagingStatsDecoderCapabilitykbitPersec = MibTableColumn((1, 3, 6, 1, 4, 1, 25071, 1, 2, 4, 1, 1, 8), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 100000))).setMaxAccess("readonly")
if mibBuilder.loadTexts: pcoipImagingStatsDecoderCapabilitykbitPersec.setStatus('current')
if mibBuilder.loadTexts: pcoipImagingStatsDecoderCapabilitykbitPersec.setDescription('The current estimate of the decoder processing capability.')
pcoipImagingStatsPipelineProcRate = MibTableColumn((1, 3, 6, 1, 4, 1, 25071, 1, 2, 4, 1, 1, 9), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 300))).setMaxAccess("readonly")
if mibBuilder.loadTexts: pcoipImagingStatsPipelineProcRate.setStatus('current')
if mibBuilder.loadTexts: pcoipImagingStatsPipelineProcRate.setDescription('The current pipeline processing rate.')
pcoipUSBStatsTable = MibTable((1, 3, 6, 1, 4, 1, 25071, 1, 2, 5, 1), )
if mibBuilder.loadTexts: pcoipUSBStatsTable.setStatus('current')
if mibBuilder.loadTexts: pcoipUSBStatsTable.setDescription('The PCoIP USB statistics table.')
pcoipUSBStatsEntry = MibTableRow((1, 3, 6, 1, 4, 1, 25071, 1, 2, 5, 1, 1), ).setIndexNames((0, "TERADICI-PCOIPv2-MIB", "pcoipUSBStatsSessionNumber"))
if mibBuilder.loadTexts: pcoipUSBStatsEntry.setStatus('current')
if mibBuilder.loadTexts: pcoipUSBStatsEntry.setDescription('An entry in the PCoIP USB statistics table.')
pcoipUSBStatsSessionNumber = MibTableColumn((1, 3, 6, 1, 4, 1, 25071, 1, 2, 5, 1, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 1))).setMaxAccess("readonly")
if mibBuilder.loadTexts: pcoipUSBStatsSessionNumber.setStatus('current')
if mibBuilder.loadTexts: pcoipUSBStatsSessionNumber.setDescription('PCoIP session number used to link statistics to session.')
pcoipUSBStatsBytesReceived = MibTableColumn((1, 3, 6, 1, 4, 1, 25071, 1, 2, 5, 1, 1, 2), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pcoipUSBStatsBytesReceived.setStatus('current')
if mibBuilder.loadTexts: pcoipUSBStatsBytesReceived.setDescription('Total number of USB bytes that have been received since the PCoIP session started.')
pcoipUSBStatsBytesSent = MibTableColumn((1, 3, 6, 1, 4, 1, 25071, 1, 2, 5, 1, 1, 3), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pcoipUSBStatsBytesSent.setStatus('current')
if mibBuilder.loadTexts: pcoipUSBStatsBytesSent.setDescription('Total number of USB bytes that have been sent since the PCoIP session started.')
pcoipUSBStatsRXBWkbitPersec = MibTableColumn((1, 3, 6, 1, 4, 1, 25071, 1, 2, 5, 1, 1, 4), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pcoipUSBStatsRXBWkbitPersec.setStatus('current')
if mibBuilder.loadTexts: pcoipUSBStatsRXBWkbitPersec.setDescription('Average number of kilobits per second that have been received by the USB channel of this device.')
pcoipUSBStatsTXBWkbitPersec = MibTableColumn((1, 3, 6, 1, 4, 1, 25071, 1, 2, 5, 1, 1, 5), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pcoipUSBStatsTXBWkbitPersec.setStatus('current')
if mibBuilder.loadTexts: pcoipUSBStatsTXBWkbitPersec.setDescription('Average number of kilobits per second that have been received by the USB channel of this device.')
pcoipGenDevicesTable = MibTable((1, 3, 6, 1, 4, 1, 25071, 1, 2, 6, 1), )
if mibBuilder.loadTexts: pcoipGenDevicesTable.setStatus('current')
if mibBuilder.loadTexts: pcoipGenDevicesTable.setDescription('The PCoIP General Devices table.')
pcoipGenDevicesEntry = MibTableRow((1, 3, 6, 1, 4, 1, 25071, 1, 2, 6, 1, 1), ).setIndexNames((0, "TERADICI-PCOIPv2-MIB", "pcoipGenDevicesSessionNumber"))
if mibBuilder.loadTexts: pcoipGenDevicesEntry.setStatus('current')
if mibBuilder.loadTexts: pcoipGenDevicesEntry.setDescription('An entry in the PCoIP general devices table.')
pcoipGenDevicesSessionNumber = MibTableColumn((1, 3, 6, 1, 4, 1, 25071, 1, 2, 6, 1, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 1))).setMaxAccess("readonly")
if mibBuilder.loadTexts: pcoipGenDevicesSessionNumber.setStatus('current')
if mibBuilder.loadTexts: pcoipGenDevicesSessionNumber.setDescription('PCoIP session number used to link imaging devices to statistics.')
pcoipGenDevicesName = MibTableColumn((1, 3, 6, 1, 4, 1, 25071, 1, 2, 6, 1, 1, 2), OctetString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pcoipGenDevicesName.setStatus('current')
if mibBuilder.loadTexts: pcoipGenDevicesName.setDescription('String containing the PCoIP device name.')
pcoipGenDevicesDescription = MibTableColumn((1, 3, 6, 1, 4, 1, 25071, 1, 2, 6, 1, 1, 3), OctetString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pcoipGenDevicesDescription.setStatus('current')
if mibBuilder.loadTexts: pcoipGenDevicesDescription.setDescription('String describing the processor.')
pcoipGenDevicesGenericTag = MibTableColumn((1, 3, 6, 1, 4, 1, 25071, 1, 2, 6, 1, 1, 4), OctetString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pcoipGenDevicesGenericTag.setStatus('current')
if mibBuilder.loadTexts: pcoipGenDevicesGenericTag.setDescription('String describing device generic tag. ')
pcoipGenDevicesPartNumber = MibTableColumn((1, 3, 6, 1, 4, 1, 25071, 1, 2, 6, 1, 1, 5), OctetString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pcoipGenDevicesPartNumber.setStatus('current')
if mibBuilder.loadTexts: pcoipGenDevicesPartNumber.setDescription('String describing the silicon part number of the device.')
pcoipGenDevicesFwPartNumber = MibScalar((1, 3, 6, 1, 4, 1, 25071, 1, 2, 6, 1, 1, 6), OctetString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pcoipGenDevicesFwPartNumber.setStatus('current')
if mibBuilder.loadTexts: pcoipGenDevicesFwPartNumber.setDescription('String describing the product ID of the device.')
pcoipGenDevicesSerialNumber = MibTableColumn((1, 3, 6, 1, 4, 1, 25071, 1, 2, 6, 1, 1, 7), OctetString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pcoipGenDevicesSerialNumber.setStatus('current')
if mibBuilder.loadTexts: pcoipGenDevicesSerialNumber.setDescription('String describing device serial number.')
pcoipGenDevicesHardwareVersion = MibTableColumn((1, 3, 6, 1, 4, 1, 25071, 1, 2, 6, 1, 1, 8), OctetString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pcoipGenDevicesHardwareVersion.setStatus('current')
if mibBuilder.loadTexts: pcoipGenDevicesHardwareVersion.setDescription('String describing the silicon version.')
pcoipGenDevicesFirmwareVersion = MibTableColumn((1, 3, 6, 1, 4, 1, 25071, 1, 2, 6, 1, 1, 9), OctetString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pcoipGenDevicesFirmwareVersion.setStatus('current')
if mibBuilder.loadTexts: pcoipGenDevicesFirmwareVersion.setDescription('String describing the currently running firmware revision.')
pcoipGenDevicesUniqueID = MibTableColumn((1, 3, 6, 1, 4, 1, 25071, 1, 2, 6, 1, 1, 10), OctetString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pcoipGenDevicesUniqueID.setStatus('current')
if mibBuilder.loadTexts: pcoipGenDevicesUniqueID.setDescription('String describing the device unique identifier.')
pcoipGenDevicesMAC = MibTableColumn((1, 3, 6, 1, 4, 1, 25071, 1, 2, 6, 1, 1, 11), OctetString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pcoipGenDevicesMAC.setStatus('current')
if mibBuilder.loadTexts: pcoipGenDevicesMAC.setDescription('String describing the device MAC address.')
pcoipGenDevicesUptime = MibTableColumn((1, 3, 6, 1, 4, 1, 25071, 1, 2, 6, 1, 1, 12), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pcoipGenDevicesUptime.setStatus('current')
if mibBuilder.loadTexts: pcoipGenDevicesUptime.setDescription('Integer containing the number of seconds since boot.')
pcoipImagingDevicesTable = MibTable((1, 3, 6, 1, 4, 1, 25071, 1, 2, 7, 1), )
if mibBuilder.loadTexts: pcoipImagingDevicesTable.setStatus('current')
if mibBuilder.loadTexts: pcoipImagingDevicesTable.setDescription('The PCoIP Imaging Devices table.')
pcoipImagingDevicesEntry = MibTableRow((1, 3, 6, 1, 4, 1, 25071, 1, 2, 7, 1, 1), ).setIndexNames((0, "TERADICI-PCOIPv2-MIB", "pcoipImagingDevicesIndex"))
if mibBuilder.loadTexts: pcoipImagingDevicesEntry.setStatus('current')
if mibBuilder.loadTexts: pcoipImagingDevicesEntry.setDescription('An entry in the PCoIP imaging devices table.')
pcoipImagingDevicesIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 25071, 1, 2, 7, 1, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 4))).setMaxAccess("readonly")
if mibBuilder.loadTexts: pcoipImagingDevicesIndex.setStatus('current')
if mibBuilder.loadTexts: pcoipImagingDevicesIndex.setDescription('The auxiliary variable used for identifying instances of the columnar objects in the devices table.')
pcoipImagingDevicesSessionNumber = MibTableColumn((1, 3, 6, 1, 4, 1, 25071, 1, 2, 7, 1, 1, 2), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 1))).setMaxAccess("readonly")
if mibBuilder.loadTexts: pcoipImagingDevicesSessionNumber.setStatus('current')
if mibBuilder.loadTexts: pcoipImagingDevicesSessionNumber.setDescription('PCoIP session number used to link imaging devices to statistics.')
pcoipImagingDevicesDisplayWidth = MibTableColumn((1, 3, 6, 1, 4, 1, 25071, 1, 2, 7, 1, 1, 3), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 4096))).setMaxAccess("readonly")
if mibBuilder.loadTexts: pcoipImagingDevicesDisplayWidth.setStatus('current')
if mibBuilder.loadTexts: pcoipImagingDevicesDisplayWidth.setDescription('Display width in pixels.')
pcoipImagingDevicesDisplayHeight = MibTableColumn((1, 3, 6, 1, 4, 1, 25071, 1, 2, 7, 1, 1, 4), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 4096))).setMaxAccess("readonly")
if mibBuilder.loadTexts: pcoipImagingDevicesDisplayHeight.setStatus('current')
if mibBuilder.loadTexts: pcoipImagingDevicesDisplayHeight.setDescription('Display height in lines.')
pcoipImagingDevicesDisplayRefreshRate = MibTableColumn((1, 3, 6, 1, 4, 1, 25071, 1, 2, 7, 1, 1, 5), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 600))).setMaxAccess("readonly")
if mibBuilder.loadTexts: pcoipImagingDevicesDisplayRefreshRate.setStatus('current')
if mibBuilder.loadTexts: pcoipImagingDevicesDisplayRefreshRate.setDescription('Display refresh rate in Hz.')
pcoipImagingDevicesDisplayChangeRate = MibTableColumn((1, 3, 6, 1, 4, 1, 25071, 1, 2, 7, 1, 1, 6), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 600))).setMaxAccess("readonly")
if mibBuilder.loadTexts: pcoipImagingDevicesDisplayChangeRate.setStatus('current')
if mibBuilder.loadTexts: pcoipImagingDevicesDisplayChangeRate.setDescription('Display input change rate in Hz over a 1 second sample.')
pcoipImagingDevicesDisplayProcessRate = MibTableColumn((1, 3, 6, 1, 4, 1, 25071, 1, 2, 7, 1, 1, 7), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 600))).setMaxAccess("readonly")
if mibBuilder.loadTexts: pcoipImagingDevicesDisplayProcessRate.setStatus('current')
if mibBuilder.loadTexts: pcoipImagingDevicesDisplayProcessRate.setDescription('Display process frame rate in Hz over a 1 second sample.')
pcoipImagingDevicesLimitReason = MibTableColumn((1, 3, 6, 1, 4, 1, 25071, 1, 2, 7, 1, 1, 8), OctetString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pcoipImagingDevicesLimitReason.setStatus('current')
if mibBuilder.loadTexts: pcoipImagingDevicesLimitReason.setDescription('String describing the reason for limiting the frame rate of this display.')
pcoipImagingDevicesModel = MibTableColumn((1, 3, 6, 1, 4, 1, 25071, 1, 2, 7, 1, 1, 9), OctetString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pcoipImagingDevicesModel.setStatus('current')
if mibBuilder.loadTexts: pcoipImagingDevicesModel.setDescription('String describing the display model name.')
pcoipImagingDevicesStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 25071, 1, 2, 7, 1, 1, 10), OctetString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pcoipImagingDevicesStatus.setStatus('current')
if mibBuilder.loadTexts: pcoipImagingDevicesStatus.setDescription('String describing the display device status.')
pcoipImagingDevicesMode = MibTableColumn((1, 3, 6, 1, 4, 1, 25071, 1, 2, 7, 1, 1, 11), OctetString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pcoipImagingDevicesMode.setStatus('current')
if mibBuilder.loadTexts: pcoipImagingDevicesMode.setDescription('String describing the display mode.')
pcoipImagingDevicesSerial = MibTableColumn((1, 3, 6, 1, 4, 1, 25071, 1, 2, 7, 1, 1, 12), OctetString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pcoipImagingDevicesSerial.setStatus('current')
if mibBuilder.loadTexts: pcoipImagingDevicesSerial.setDescription('String describing the display serial number.')
pcoipImagingDevicesVID = MibTableColumn((1, 3, 6, 1, 4, 1, 25071, 1, 2, 7, 1, 1, 13), OctetString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pcoipImagingDevicesVID.setStatus('current')
if mibBuilder.loadTexts: pcoipImagingDevicesVID.setDescription('String describing the display vendor ID.')
pcoipImagingDevicesPID = MibTableColumn((1, 3, 6, 1, 4, 1, 25071, 1, 2, 7, 1, 1, 14), OctetString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pcoipImagingDevicesPID.setStatus('current')
if mibBuilder.loadTexts: pcoipImagingDevicesPID.setDescription('String describing the display product ID.')
pcoipImagingDevicesDate = MibTableColumn((1, 3, 6, 1, 4, 1, 25071, 1, 2, 7, 1, 1, 15), OctetString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pcoipImagingDevicesDate.setStatus('current')
if mibBuilder.loadTexts: pcoipImagingDevicesDate.setDescription('String describing the display date of manufacture.')
pcoipUSBDevicesTable = MibTable((1, 3, 6, 1, 4, 1, 25071, 1, 2, 8, 1), )
if mibBuilder.loadTexts: pcoipUSBDevicesTable.setStatus('current')
if mibBuilder.loadTexts: pcoipUSBDevicesTable.setDescription('The PCoIP USB Devices table.')
pcoipUSBDevicesEntry = MibTableRow((1, 3, 6, 1, 4, 1, 25071, 1, 2, 8, 1, 1), ).setIndexNames((0, "TERADICI-PCOIPv2-MIB", "pcoipUSBDevicesIndex"))
if mibBuilder.loadTexts: pcoipUSBDevicesEntry.setStatus('current')
if mibBuilder.loadTexts: pcoipUSBDevicesEntry.setDescription('An entry in the PCoIP USB devices table.')
pcoipUSBDevicesIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 25071, 1, 2, 8, 1, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 127))).setMaxAccess("readonly")
if mibBuilder.loadTexts: pcoipUSBDevicesIndex.setStatus('current')
if mibBuilder.loadTexts: pcoipUSBDevicesIndex.setDescription('The auxiliary variable used for identifying instances of the columnar objects in the devices table.')
pcoipUSBDevicesSessionNumber = MibTableColumn((1, 3, 6, 1, 4, 1, 25071, 1, 2, 8, 1, 1, 2), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 1))).setMaxAccess("readonly")
if mibBuilder.loadTexts: pcoipUSBDevicesSessionNumber.setStatus('current')
if mibBuilder.loadTexts: pcoipUSBDevicesSessionNumber.setDescription('PCoIP session number used to link USB devices to statistics.')
pcoipUSBDevicesPort = MibTableColumn((1, 3, 6, 1, 4, 1, 25071, 1, 2, 8, 1, 1, 3), OctetString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pcoipUSBDevicesPort.setStatus('current')
if mibBuilder.loadTexts: pcoipUSBDevicesPort.setDescription('USB device port: OHCI or EHCI.')
pcoipUSBDevicesModel = MibTableColumn((1, 3, 6, 1, 4, 1, 25071, 1, 2, 8, 1, 1, 4), OctetString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pcoipUSBDevicesModel.setStatus('current')
if mibBuilder.loadTexts: pcoipUSBDevicesModel.setDescription('String describing the model name of the connected device.')
pcoipUSBDevicesStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 25071, 1, 2, 8, 1, 1, 5), OctetString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pcoipUSBDevicesStatus.setStatus('current')
if mibBuilder.loadTexts: pcoipUSBDevicesStatus.setDescription('String describing the USB device status.')
pcoipUSBDevicesDeviceClass = MibTableColumn((1, 3, 6, 1, 4, 1, 25071, 1, 2, 8, 1, 1, 6), OctetString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pcoipUSBDevicesDeviceClass.setStatus('current')
if mibBuilder.loadTexts: pcoipUSBDevicesDeviceClass.setDescription('String describing the USB device class.')
pcoipUSBDevicesSubClass = MibTableColumn((1, 3, 6, 1, 4, 1, 25071, 1, 2, 8, 1, 1, 7), OctetString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pcoipUSBDevicesSubClass.setStatus('current')
if mibBuilder.loadTexts: pcoipUSBDevicesSubClass.setDescription('String describing the USB sub device class.')
pcoipUSBDevicesProtocol = MibTableColumn((1, 3, 6, 1, 4, 1, 25071, 1, 2, 8, 1, 1, 8), OctetString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pcoipUSBDevicesProtocol.setStatus('current')
if mibBuilder.loadTexts: pcoipUSBDevicesProtocol.setDescription('String describing the USB protocol used.')
pcoipUSBDevicesSerial = MibTableColumn((1, 3, 6, 1, 4, 1, 25071, 1, 2, 8, 1, 1, 9), OctetString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pcoipUSBDevicesSerial.setStatus('current')
if mibBuilder.loadTexts: pcoipUSBDevicesSerial.setDescription('String describing the USB device serial number.')
pcoipUSBDevicesVID = MibTableColumn((1, 3, 6, 1, 4, 1, 25071, 1, 2, 8, 1, 1, 10), OctetString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pcoipUSBDevicesVID.setStatus('current')
if mibBuilder.loadTexts: pcoipUSBDevicesVID.setDescription('String describing the USB device vendor ID.')
pcoipUSBDevicesPID = MibTableColumn((1, 3, 6, 1, 4, 1, 25071, 1, 2, 8, 1, 1, 11), OctetString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pcoipUSBDevicesPID.setStatus('current')
if mibBuilder.loadTexts: pcoipUSBDevicesPID.setDescription('String describing the USB device product ID.')
mibBuilder.exportSymbols("TERADICI-PCOIPv2-MIB", pcoipImagingStatsActiveMinimumQuality=pcoipImagingStatsActiveMinimumQuality, pcoipGenStatsBytesReceived=pcoipGenStatsBytesReceived, pcoipUSBStatsTable=pcoipUSBStatsTable, pcoipGenDevicesSerialNumber=pcoipGenDevicesSerialNumber, pcoipNetStatsTXBWActiveLimitkbitPersec=pcoipNetStatsTXBWActiveLimitkbitPersec, pcoipNetStatsTXPacketLossPercent=pcoipNetStatsTXPacketLossPercent, pcoipImagingStatsPipelineProcRate=pcoipImagingStatsPipelineProcRate, pcoipUSBDevicesProtocol=pcoipUSBDevicesProtocol, pcoipNetStatsRXBWPeakkbitPersec=pcoipNetStatsRXBWPeakkbitPersec, pcoipImagingDevicesTable=pcoipImagingDevicesTable, teraPcoipUSBStats=teraPcoipUSBStats, pcoipAudioStatsTXBWLimitkbitPersec=pcoipAudioStatsTXBWLimitkbitPersec, pcoipAudioStatsTXBWkbitPersec=pcoipAudioStatsTXBWkbitPersec, pcoipNetStatsEntry=pcoipNetStatsEntry, pcoipGenStatsPacketsReceived=pcoipGenStatsPacketsReceived, pcoipUSBDevicesPort=pcoipUSBDevicesPort, pcoipGenStatsSessionNumber=pcoipGenStatsSessionNumber, pcoipImagingDevicesPID=pcoipImagingDevicesPID, pcoipNetStatsSessionNumber=pcoipNetStatsSessionNumber, pcoipGenDevicesGenericTag=pcoipGenDevicesGenericTag, teraPcoipUSBDevices=teraPcoipUSBDevices, teraPcoipAudioStats=teraPcoipAudioStats, pcoipAudioStatsEntry=pcoipAudioStatsEntry, pcoipImagingStatsRXBWkbitPersec=pcoipImagingStatsRXBWkbitPersec, pcoipGenStatsEntry=pcoipGenStatsEntry, pcoipUSBDevicesSubClass=pcoipUSBDevicesSubClass, pcoipImagingDevicesDisplayProcessRate=pcoipImagingDevicesDisplayProcessRate, pcoipGenDevicesHardwareVersion=pcoipGenDevicesHardwareVersion, pcoipGenDevicesMAC=pcoipGenDevicesMAC, pcoipUSBStatsBytesReceived=pcoipUSBStatsBytesReceived, pcoipImagingDevicesVID=pcoipImagingDevicesVID, teraPcoipImagingStats=teraPcoipImagingStats, pcoipAudioStatsBytesReceived=pcoipAudioStatsBytesReceived, teraPcoipGenStats=teraPcoipGenStats, pcoipImagingStatsDecoderCapabilitykbitPersec=pcoipImagingStatsDecoderCapabilitykbitPersec, pcoipUSBStatsBytesSent=pcoipUSBStatsBytesSent, pcoipUSBDevicesIndex=pcoipUSBDevicesIndex, pcoipImagingStatsTXBWkbitPersec=pcoipImagingStatsTXBWkbitPersec, pcoipImagingDevicesModel=pcoipImagingDevicesModel, pcoipImagingDevicesIndex=pcoipImagingDevicesIndex, pcoipUSBStatsEntry=pcoipUSBStatsEntry, pcoipUSBDevicesStatus=pcoipUSBDevicesStatus, pcoipImagingStatsBytesReceived=pcoipImagingStatsBytesReceived, pcoipGenStatsPacketsSent=pcoipGenStatsPacketsSent, pcoipUSBDevicesTable=pcoipUSBDevicesTable, pcoipGenStatsSessionDuration=pcoipGenStatsSessionDuration, pcoipGenDevicesUptime=pcoipGenDevicesUptime, pcoipNetStatsRoundTripLatencyMs=pcoipNetStatsRoundTripLatencyMs, pcoipImagingDevicesLimitReason=pcoipImagingDevicesLimitReason, pcoipUSBStatsTXBWkbitPersec=pcoipUSBStatsTXBWkbitPersec, pcoipImagingStatsSessionNumber=pcoipImagingStatsSessionNumber, pcoipNetStatsTXBWkbitPersec=pcoipNetStatsTXBWkbitPersec, pcoipAudioStatsRXBWkbitPersec=pcoipAudioStatsRXBWkbitPersec, pcoipUSBDevicesSerial=pcoipUSBDevicesSerial, pcoipImagingStatsTable=pcoipImagingStatsTable, pcoipGenDevicesEntry=pcoipGenDevicesEntry, pcoipNetStatsRXBWkbitPersec=pcoipNetStatsRXBWkbitPersec, pcoipGenDevicesName=pcoipGenDevicesName, pcoipGenDevicesFirmwareVersion=pcoipGenDevicesFirmwareVersion, pcoipGenDevicesSessionNumber=pcoipGenDevicesSessionNumber, pcoipGenDevicesFwPartNumber=pcoipGenDevicesFwPartNumber, teraMibModule=teraMibModule, pcoipGenDevicesUniqueID=pcoipGenDevicesUniqueID, pcoipUSBDevicesVID=pcoipUSBDevicesVID, pcoipAudioStatsTable=pcoipAudioStatsTable, pcoipUSBDevicesEntry=pcoipUSBDevicesEntry, pcoipGenStatsTxPacketsLost=pcoipGenStatsTxPacketsLost, pcoipGenDevicesPartNumber=pcoipGenDevicesPartNumber, pcoipImagingDevicesMode=pcoipImagingDevicesMode, teraProducts=teraProducts, teraPcoipImagingDevices=teraPcoipImagingDevices, pcoipImagingDevicesStatus=pcoipImagingDevicesStatus, pcoipImagingDevicesEntry=pcoipImagingDevicesEntry, pcoipImagingDevicesDate=pcoipImagingDevicesDate, pcoipAudioStatsBytesSent=pcoipAudioStatsBytesSent, pcoipGenStatsBytesSent=pcoipGenStatsBytesSent, pcoipImagingDevicesDisplayChangeRate=pcoipImagingDevicesDisplayChangeRate, pcoipNetStatsRXPacketLossPercent=pcoipNetStatsRXPacketLossPercent, pcoipUSBStatsSessionNumber=pcoipUSBStatsSessionNumber, teraPcoipGenDevices=teraPcoipGenDevices, pcoipNetStatsTXBWLimitkbitPersec=pcoipNetStatsTXBWLimitkbitPersec, pcoipImagingDevicesDisplayHeight=pcoipImagingDevicesDisplayHeight, pcoipGenStatsTable=pcoipGenStatsTable, pcoipImagingDevicesSessionNumber=pcoipImagingDevicesSessionNumber, pcoipNetStatsTable=pcoipNetStatsTable, PYSNMP_MODULE_ID=teraMibModule, pcoipImagingDevicesDisplayWidth=pcoipImagingDevicesDisplayWidth, pcoipGenDevicesTable=pcoipGenDevicesTable, pcoipImagingDevicesDisplayRefreshRate=pcoipImagingDevicesDisplayRefreshRate, pcoipUSBDevicesDeviceClass=pcoipUSBDevicesDeviceClass, teraPcoipV2=teraPcoipV2, pcoipUSBDevicesPID=pcoipUSBDevicesPID, pcoipImagingStatsBytesSent=pcoipImagingStatsBytesSent, pcoipAudioStatsSessionNumber=pcoipAudioStatsSessionNumber, pcoipUSBDevicesSessionNumber=pcoipUSBDevicesSessionNumber, pcoipImagingDevicesSerial=pcoipImagingDevicesSerial, pcoipImagingStatsEncodedFramesPersec=pcoipImagingStatsEncodedFramesPersec, pcoipImagingStatsEntry=pcoipImagingStatsEntry, pcoipUSBStatsRXBWkbitPersec=pcoipUSBStatsRXBWkbitPersec, pcoipGenDevicesDescription=pcoipGenDevicesDescription, teraPcoipNetStats=teraPcoipNetStats, pcoipUSBDevicesModel=pcoipUSBDevicesModel)
| (octet_string, object_identifier, integer) = mibBuilder.importSymbols('ASN1', 'OctetString', 'ObjectIdentifier', 'Integer')
(named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues')
(constraints_intersection, single_value_constraint, value_range_constraint, value_size_constraint, constraints_union) = mibBuilder.importSymbols('ASN1-REFINEMENT', 'ConstraintsIntersection', 'SingleValueConstraint', 'ValueRangeConstraint', 'ValueSizeConstraint', 'ConstraintsUnion')
(module_compliance, notification_group) = mibBuilder.importSymbols('SNMPv2-CONF', 'ModuleCompliance', 'NotificationGroup')
(counter64, iso, unsigned32, module_identity, ip_address, integer32, enterprises, gauge32, notification_type, bits, counter32, mib_identifier, time_ticks, mib_scalar, mib_table, mib_table_row, mib_table_column, object_identity) = mibBuilder.importSymbols('SNMPv2-SMI', 'Counter64', 'iso', 'Unsigned32', 'ModuleIdentity', 'IpAddress', 'Integer32', 'enterprises', 'Gauge32', 'NotificationType', 'Bits', 'Counter32', 'MibIdentifier', 'TimeTicks', 'MibScalar', 'MibTable', 'MibTableRow', 'MibTableColumn', 'ObjectIdentity')
(textual_convention, display_string) = mibBuilder.importSymbols('SNMPv2-TC', 'TextualConvention', 'DisplayString')
tera_mib_module = module_identity((1, 3, 6, 1, 4, 1, 25071))
teraMibModule.setRevisions(('2012-01-28 10:00',))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
if mibBuilder.loadTexts:
teraMibModule.setRevisionsDescriptions(('Version 2 of the PCoIP MIB.',))
if mibBuilder.loadTexts:
teraMibModule.setLastUpdated('201201281000Z')
if mibBuilder.loadTexts:
teraMibModule.setOrganization('Teradici Corporation')
if mibBuilder.loadTexts:
teraMibModule.setContactInfo(' Chris Topp Postal: 101-4621 Canada Way Burnaby, BC V5G 4X8 Canada Tel: +1 604 451 5800 Fax: +1 604 451 5818 E-mail: ctopp@teradici.com')
if mibBuilder.loadTexts:
teraMibModule.setDescription('MIB describing PC-over-IP (tm) statistics.')
tera_products = mib_identifier((1, 3, 6, 1, 4, 1, 25071, 1))
tera_pcoip_v2 = mib_identifier((1, 3, 6, 1, 4, 1, 25071, 1, 2))
tera_pcoip_gen_stats = mib_identifier((1, 3, 6, 1, 4, 1, 25071, 1, 2, 1))
tera_pcoip_net_stats = mib_identifier((1, 3, 6, 1, 4, 1, 25071, 1, 2, 2))
tera_pcoip_audio_stats = mib_identifier((1, 3, 6, 1, 4, 1, 25071, 1, 2, 3))
tera_pcoip_imaging_stats = mib_identifier((1, 3, 6, 1, 4, 1, 25071, 1, 2, 4))
tera_pcoip_usb_stats = mib_identifier((1, 3, 6, 1, 4, 1, 25071, 1, 2, 5))
tera_pcoip_gen_devices = mib_identifier((1, 3, 6, 1, 4, 1, 25071, 1, 2, 6))
tera_pcoip_imaging_devices = mib_identifier((1, 3, 6, 1, 4, 1, 25071, 1, 2, 7))
tera_pcoip_usb_devices = mib_identifier((1, 3, 6, 1, 4, 1, 25071, 1, 2, 8))
pcoip_gen_stats_table = mib_table((1, 3, 6, 1, 4, 1, 25071, 1, 2, 1, 1))
if mibBuilder.loadTexts:
pcoipGenStatsTable.setStatus('current')
if mibBuilder.loadTexts:
pcoipGenStatsTable.setDescription('The PCoIP General statistics table.')
pcoip_gen_stats_entry = mib_table_row((1, 3, 6, 1, 4, 1, 25071, 1, 2, 1, 1, 1)).setIndexNames((0, 'TERADICI-PCOIPv2-MIB', 'pcoipGenStatsSessionNumber'))
if mibBuilder.loadTexts:
pcoipGenStatsEntry.setStatus('current')
if mibBuilder.loadTexts:
pcoipGenStatsEntry.setDescription('An entry in the PCoIP general statistics table.')
pcoip_gen_stats_session_number = mib_table_column((1, 3, 6, 1, 4, 1, 25071, 1, 2, 1, 1, 1, 1), integer32().subtype(subtypeSpec=value_range_constraint(1, 1))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
pcoipGenStatsSessionNumber.setStatus('current')
if mibBuilder.loadTexts:
pcoipGenStatsSessionNumber.setDescription('PCoIP session number used to link PCoIP statistics to session.')
pcoip_gen_stats_packets_sent = mib_table_column((1, 3, 6, 1, 4, 1, 25071, 1, 2, 1, 1, 1, 2), counter64()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
pcoipGenStatsPacketsSent.setStatus('current')
if mibBuilder.loadTexts:
pcoipGenStatsPacketsSent.setDescription('Total number of packets that have been transmitted since the PCoIP session started.')
pcoip_gen_stats_bytes_sent = mib_table_column((1, 3, 6, 1, 4, 1, 25071, 1, 2, 1, 1, 1, 3), counter64()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
pcoipGenStatsBytesSent.setStatus('current')
if mibBuilder.loadTexts:
pcoipGenStatsBytesSent.setDescription('Total number of bytes that have been transmitted since the PCoIP session started.')
pcoip_gen_stats_packets_received = mib_table_column((1, 3, 6, 1, 4, 1, 25071, 1, 2, 1, 1, 1, 4), counter64()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
pcoipGenStatsPacketsReceived.setStatus('current')
if mibBuilder.loadTexts:
pcoipGenStatsPacketsReceived.setDescription('Total number of packets that have been received since the PCoIP session started.')
pcoip_gen_stats_bytes_received = mib_table_column((1, 3, 6, 1, 4, 1, 25071, 1, 2, 1, 1, 1, 5), counter64()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
pcoipGenStatsBytesReceived.setStatus('current')
if mibBuilder.loadTexts:
pcoipGenStatsBytesReceived.setDescription('Total number of bytes that have been received since the PCoIP session started.')
pcoip_gen_stats_tx_packets_lost = mib_table_column((1, 3, 6, 1, 4, 1, 25071, 1, 2, 1, 1, 1, 6), counter64()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
pcoipGenStatsTxPacketsLost.setStatus('current')
if mibBuilder.loadTexts:
pcoipGenStatsTxPacketsLost.setDescription('Total number of transmit packets that have been lost since the PCoIP session started.')
pcoip_gen_stats_session_duration = mib_table_column((1, 3, 6, 1, 4, 1, 25071, 1, 2, 1, 1, 1, 7), counter64()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
pcoipGenStatsSessionDuration.setStatus('current')
if mibBuilder.loadTexts:
pcoipGenStatsSessionDuration.setDescription('An incrementing number that represents the total number of seconds the PCoIP session has been open.')
pcoip_net_stats_table = mib_table((1, 3, 6, 1, 4, 1, 25071, 1, 2, 2, 1))
if mibBuilder.loadTexts:
pcoipNetStatsTable.setStatus('current')
if mibBuilder.loadTexts:
pcoipNetStatsTable.setDescription('The PCoIP Network statistics table.')
pcoip_net_stats_entry = mib_table_row((1, 3, 6, 1, 4, 1, 25071, 1, 2, 2, 1, 1)).setIndexNames((0, 'TERADICI-PCOIPv2-MIB', 'pcoipNetStatsSessionNumber'))
if mibBuilder.loadTexts:
pcoipNetStatsEntry.setStatus('current')
if mibBuilder.loadTexts:
pcoipNetStatsEntry.setDescription('An entry in the PCoIP network statistics table.')
pcoip_net_stats_session_number = mib_table_column((1, 3, 6, 1, 4, 1, 25071, 1, 2, 2, 1, 1, 1), integer32().subtype(subtypeSpec=value_range_constraint(1, 1))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
pcoipNetStatsSessionNumber.setStatus('current')
if mibBuilder.loadTexts:
pcoipNetStatsSessionNumber.setDescription('PCoIP session number used to link statistics to session.')
pcoip_net_stats_round_trip_latency_ms = mib_table_column((1, 3, 6, 1, 4, 1, 25071, 1, 2, 2, 1, 1, 2), counter64()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
pcoipNetStatsRoundTripLatencyMs.setStatus('current')
if mibBuilder.loadTexts:
pcoipNetStatsRoundTripLatencyMs.setDescription('Round trip latency (in milliseconds) between server and client.')
pcoip_net_stats_rxb_wkbit_persec = mib_table_column((1, 3, 6, 1, 4, 1, 25071, 1, 2, 2, 1, 1, 3), counter64()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
pcoipNetStatsRXBWkbitPersec.setStatus('current')
if mibBuilder.loadTexts:
pcoipNetStatsRXBWkbitPersec.setDescription('Average number of kilobits per second that have been received by this device.')
pcoip_net_stats_rxbw_peakkbit_persec = mib_table_column((1, 3, 6, 1, 4, 1, 25071, 1, 2, 2, 1, 1, 4), integer32().subtype(subtypeSpec=value_range_constraint(0, 1000))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
pcoipNetStatsRXBWPeakkbitPersec.setStatus('current')
if mibBuilder.loadTexts:
pcoipNetStatsRXBWPeakkbitPersec.setDescription('Peak bandwidth for incoming PCoIP packets within a one second sampling period.')
pcoip_net_stats_rx_packet_loss_percent = mib_table_column((1, 3, 6, 1, 4, 1, 25071, 1, 2, 2, 1, 1, 5), integer32().subtype(subtypeSpec=value_range_constraint(0, 100))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
pcoipNetStatsRXPacketLossPercent.setStatus('current')
if mibBuilder.loadTexts:
pcoipNetStatsRXPacketLossPercent.setDescription('Percentage of received packets lost during a one second sampling period.')
pcoip_net_stats_txb_wkbit_persec = mib_table_column((1, 3, 6, 1, 4, 1, 25071, 1, 2, 2, 1, 1, 6), counter64()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
pcoipNetStatsTXBWkbitPersec.setStatus('current')
if mibBuilder.loadTexts:
pcoipNetStatsTXBWkbitPersec.setDescription('Average number of kilobits per second that have been transmitted by this device.')
pcoip_net_stats_txbw_active_limitkbit_persec = mib_table_column((1, 3, 6, 1, 4, 1, 25071, 1, 2, 2, 1, 1, 7), integer32().subtype(subtypeSpec=value_range_constraint(0, 1000))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
pcoipNetStatsTXBWActiveLimitkbitPersec.setStatus('current')
if mibBuilder.loadTexts:
pcoipNetStatsTXBWActiveLimitkbitPersec.setDescription('The current estimate of the available network bandwidth, updated every second.')
pcoip_net_stats_txbw_limitkbit_persec = mib_table_column((1, 3, 6, 1, 4, 1, 25071, 1, 2, 2, 1, 1, 8), integer32().subtype(subtypeSpec=value_range_constraint(0, 1000))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
pcoipNetStatsTXBWLimitkbitPersec.setStatus('current')
if mibBuilder.loadTexts:
pcoipNetStatsTXBWLimitkbitPersec.setDescription('Transmit bandwidth limit for outgoing packets.')
pcoip_net_stats_tx_packet_loss_percent = mib_table_column((1, 3, 6, 1, 4, 1, 25071, 1, 2, 2, 1, 1, 9), integer32().subtype(subtypeSpec=value_range_constraint(0, 100))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
pcoipNetStatsTXPacketLossPercent.setStatus('current')
if mibBuilder.loadTexts:
pcoipNetStatsTXPacketLossPercent.setDescription('Percentage of transmitted packets lost during the one second sampling period.')
pcoip_audio_stats_table = mib_table((1, 3, 6, 1, 4, 1, 25071, 1, 2, 3, 1))
if mibBuilder.loadTexts:
pcoipAudioStatsTable.setStatus('current')
if mibBuilder.loadTexts:
pcoipAudioStatsTable.setDescription('The PCoIP Audio statistics table.')
pcoip_audio_stats_entry = mib_table_row((1, 3, 6, 1, 4, 1, 25071, 1, 2, 3, 1, 1)).setIndexNames((0, 'TERADICI-PCOIPv2-MIB', 'pcoipAudioStatsSessionNumber'))
if mibBuilder.loadTexts:
pcoipAudioStatsEntry.setStatus('current')
if mibBuilder.loadTexts:
pcoipAudioStatsEntry.setDescription('An entry in the PCoIP audio statistics table.')
pcoip_audio_stats_session_number = mib_table_column((1, 3, 6, 1, 4, 1, 25071, 1, 2, 3, 1, 1, 1), integer32().subtype(subtypeSpec=value_range_constraint(1, 1))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
pcoipAudioStatsSessionNumber.setStatus('current')
if mibBuilder.loadTexts:
pcoipAudioStatsSessionNumber.setDescription('PCoIP session number used to link statistics to session.')
pcoip_audio_stats_bytes_received = mib_table_column((1, 3, 6, 1, 4, 1, 25071, 1, 2, 3, 1, 1, 2), counter64()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
pcoipAudioStatsBytesReceived.setStatus('current')
if mibBuilder.loadTexts:
pcoipAudioStatsBytesReceived.setDescription('Total number of audio bytes that have been received since the PCoIP session started.')
pcoip_audio_stats_bytes_sent = mib_table_column((1, 3, 6, 1, 4, 1, 25071, 1, 2, 3, 1, 1, 3), counter64()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
pcoipAudioStatsBytesSent.setStatus('current')
if mibBuilder.loadTexts:
pcoipAudioStatsBytesSent.setDescription('Total number of audio bytes that have been sent since the PCoIP session started.')
pcoip_audio_stats_rxb_wkbit_persec = mib_table_column((1, 3, 6, 1, 4, 1, 25071, 1, 2, 3, 1, 1, 4), counter64()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
pcoipAudioStatsRXBWkbitPersec.setStatus('current')
if mibBuilder.loadTexts:
pcoipAudioStatsRXBWkbitPersec.setDescription('Average number of kilobits per second that have been received by the audio channel of this device.')
pcoip_audio_stats_txb_wkbit_persec = mib_table_column((1, 3, 6, 1, 4, 1, 25071, 1, 2, 3, 1, 1, 5), counter64()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
pcoipAudioStatsTXBWkbitPersec.setStatus('current')
if mibBuilder.loadTexts:
pcoipAudioStatsTXBWkbitPersec.setDescription('Total number of audio kilobits that have been transmitted since the PCoIP session started.')
pcoip_audio_stats_txbw_limitkbit_persec = mib_table_column((1, 3, 6, 1, 4, 1, 25071, 1, 2, 3, 1, 1, 6), integer32().subtype(subtypeSpec=value_range_constraint(0, 1000))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
pcoipAudioStatsTXBWLimitkbitPersec.setStatus('current')
if mibBuilder.loadTexts:
pcoipAudioStatsTXBWLimitkbitPersec.setDescription('Transmit bandwidth limit for outgoing audio packets.')
pcoip_imaging_stats_table = mib_table((1, 3, 6, 1, 4, 1, 25071, 1, 2, 4, 1))
if mibBuilder.loadTexts:
pcoipImagingStatsTable.setStatus('current')
if mibBuilder.loadTexts:
pcoipImagingStatsTable.setDescription('The PCoIP Imaging statistics table.')
pcoip_imaging_stats_entry = mib_table_row((1, 3, 6, 1, 4, 1, 25071, 1, 2, 4, 1, 1)).setIndexNames((0, 'TERADICI-PCOIPv2-MIB', 'pcoipImagingStatsSessionNumber'))
if mibBuilder.loadTexts:
pcoipImagingStatsEntry.setStatus('current')
if mibBuilder.loadTexts:
pcoipImagingStatsEntry.setDescription('An entry in the PCoIP imaging statistics table.')
pcoip_imaging_stats_session_number = mib_table_column((1, 3, 6, 1, 4, 1, 25071, 1, 2, 4, 1, 1, 1), integer32().subtype(subtypeSpec=value_range_constraint(1, 1))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
pcoipImagingStatsSessionNumber.setStatus('current')
if mibBuilder.loadTexts:
pcoipImagingStatsSessionNumber.setDescription('PCoIP session number used to link statistics to session.')
pcoip_imaging_stats_bytes_received = mib_table_column((1, 3, 6, 1, 4, 1, 25071, 1, 2, 4, 1, 1, 2), counter64()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
pcoipImagingStatsBytesReceived.setStatus('current')
if mibBuilder.loadTexts:
pcoipImagingStatsBytesReceived.setDescription('Total number of imaging bytes that have been received since the PCoIP session started.')
pcoip_imaging_stats_bytes_sent = mib_table_column((1, 3, 6, 1, 4, 1, 25071, 1, 2, 4, 1, 1, 3), counter64()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
pcoipImagingStatsBytesSent.setStatus('current')
if mibBuilder.loadTexts:
pcoipImagingStatsBytesSent.setDescription('Total number of imaging bytes that have been sent since the PCoIP session started.')
pcoip_imaging_stats_rxb_wkbit_persec = mib_table_column((1, 3, 6, 1, 4, 1, 25071, 1, 2, 4, 1, 1, 4), counter64()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
pcoipImagingStatsRXBWkbitPersec.setStatus('current')
if mibBuilder.loadTexts:
pcoipImagingStatsRXBWkbitPersec.setDescription('Average number of kilobits per second that have been received by the imaging channel of this device.')
pcoip_imaging_stats_txb_wkbit_persec = mib_table_column((1, 3, 6, 1, 4, 1, 25071, 1, 2, 4, 1, 1, 5), counter64()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
pcoipImagingStatsTXBWkbitPersec.setStatus('current')
if mibBuilder.loadTexts:
pcoipImagingStatsTXBWkbitPersec.setDescription('Average number of kilobits per second that have been received by the imaging channel of this device.')
pcoip_imaging_stats_encoded_frames_persec = mib_table_column((1, 3, 6, 1, 4, 1, 25071, 1, 2, 4, 1, 1, 6), integer32().subtype(subtypeSpec=value_range_constraint(0, 2400))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
pcoipImagingStatsEncodedFramesPersec.setStatus('current')
if mibBuilder.loadTexts:
pcoipImagingStatsEncodedFramesPersec.setDescription('The number of imaging frames which were encoded over a one second sampling period.')
pcoip_imaging_stats_active_minimum_quality = mib_table_column((1, 3, 6, 1, 4, 1, 25071, 1, 2, 4, 1, 1, 7), integer32().subtype(subtypeSpec=value_range_constraint(0, 100))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
pcoipImagingStatsActiveMinimumQuality.setStatus('current')
if mibBuilder.loadTexts:
pcoipImagingStatsActiveMinimumQuality.setDescription('The lowest encoded quality, updated every second.')
pcoip_imaging_stats_decoder_capabilitykbit_persec = mib_table_column((1, 3, 6, 1, 4, 1, 25071, 1, 2, 4, 1, 1, 8), integer32().subtype(subtypeSpec=value_range_constraint(0, 100000))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
pcoipImagingStatsDecoderCapabilitykbitPersec.setStatus('current')
if mibBuilder.loadTexts:
pcoipImagingStatsDecoderCapabilitykbitPersec.setDescription('The current estimate of the decoder processing capability.')
pcoip_imaging_stats_pipeline_proc_rate = mib_table_column((1, 3, 6, 1, 4, 1, 25071, 1, 2, 4, 1, 1, 9), integer32().subtype(subtypeSpec=value_range_constraint(0, 300))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
pcoipImagingStatsPipelineProcRate.setStatus('current')
if mibBuilder.loadTexts:
pcoipImagingStatsPipelineProcRate.setDescription('The current pipeline processing rate.')
pcoip_usb_stats_table = mib_table((1, 3, 6, 1, 4, 1, 25071, 1, 2, 5, 1))
if mibBuilder.loadTexts:
pcoipUSBStatsTable.setStatus('current')
if mibBuilder.loadTexts:
pcoipUSBStatsTable.setDescription('The PCoIP USB statistics table.')
pcoip_usb_stats_entry = mib_table_row((1, 3, 6, 1, 4, 1, 25071, 1, 2, 5, 1, 1)).setIndexNames((0, 'TERADICI-PCOIPv2-MIB', 'pcoipUSBStatsSessionNumber'))
if mibBuilder.loadTexts:
pcoipUSBStatsEntry.setStatus('current')
if mibBuilder.loadTexts:
pcoipUSBStatsEntry.setDescription('An entry in the PCoIP USB statistics table.')
pcoip_usb_stats_session_number = mib_table_column((1, 3, 6, 1, 4, 1, 25071, 1, 2, 5, 1, 1, 1), integer32().subtype(subtypeSpec=value_range_constraint(1, 1))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
pcoipUSBStatsSessionNumber.setStatus('current')
if mibBuilder.loadTexts:
pcoipUSBStatsSessionNumber.setDescription('PCoIP session number used to link statistics to session.')
pcoip_usb_stats_bytes_received = mib_table_column((1, 3, 6, 1, 4, 1, 25071, 1, 2, 5, 1, 1, 2), counter64()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
pcoipUSBStatsBytesReceived.setStatus('current')
if mibBuilder.loadTexts:
pcoipUSBStatsBytesReceived.setDescription('Total number of USB bytes that have been received since the PCoIP session started.')
pcoip_usb_stats_bytes_sent = mib_table_column((1, 3, 6, 1, 4, 1, 25071, 1, 2, 5, 1, 1, 3), counter64()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
pcoipUSBStatsBytesSent.setStatus('current')
if mibBuilder.loadTexts:
pcoipUSBStatsBytesSent.setDescription('Total number of USB bytes that have been sent since the PCoIP session started.')
pcoip_usb_stats_rxb_wkbit_persec = mib_table_column((1, 3, 6, 1, 4, 1, 25071, 1, 2, 5, 1, 1, 4), counter64()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
pcoipUSBStatsRXBWkbitPersec.setStatus('current')
if mibBuilder.loadTexts:
pcoipUSBStatsRXBWkbitPersec.setDescription('Average number of kilobits per second that have been received by the USB channel of this device.')
pcoip_usb_stats_txb_wkbit_persec = mib_table_column((1, 3, 6, 1, 4, 1, 25071, 1, 2, 5, 1, 1, 5), counter64()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
pcoipUSBStatsTXBWkbitPersec.setStatus('current')
if mibBuilder.loadTexts:
pcoipUSBStatsTXBWkbitPersec.setDescription('Average number of kilobits per second that have been received by the USB channel of this device.')
pcoip_gen_devices_table = mib_table((1, 3, 6, 1, 4, 1, 25071, 1, 2, 6, 1))
if mibBuilder.loadTexts:
pcoipGenDevicesTable.setStatus('current')
if mibBuilder.loadTexts:
pcoipGenDevicesTable.setDescription('The PCoIP General Devices table.')
pcoip_gen_devices_entry = mib_table_row((1, 3, 6, 1, 4, 1, 25071, 1, 2, 6, 1, 1)).setIndexNames((0, 'TERADICI-PCOIPv2-MIB', 'pcoipGenDevicesSessionNumber'))
if mibBuilder.loadTexts:
pcoipGenDevicesEntry.setStatus('current')
if mibBuilder.loadTexts:
pcoipGenDevicesEntry.setDescription('An entry in the PCoIP general devices table.')
pcoip_gen_devices_session_number = mib_table_column((1, 3, 6, 1, 4, 1, 25071, 1, 2, 6, 1, 1, 1), integer32().subtype(subtypeSpec=value_range_constraint(1, 1))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
pcoipGenDevicesSessionNumber.setStatus('current')
if mibBuilder.loadTexts:
pcoipGenDevicesSessionNumber.setDescription('PCoIP session number used to link imaging devices to statistics.')
pcoip_gen_devices_name = mib_table_column((1, 3, 6, 1, 4, 1, 25071, 1, 2, 6, 1, 1, 2), octet_string()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
pcoipGenDevicesName.setStatus('current')
if mibBuilder.loadTexts:
pcoipGenDevicesName.setDescription('String containing the PCoIP device name.')
pcoip_gen_devices_description = mib_table_column((1, 3, 6, 1, 4, 1, 25071, 1, 2, 6, 1, 1, 3), octet_string()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
pcoipGenDevicesDescription.setStatus('current')
if mibBuilder.loadTexts:
pcoipGenDevicesDescription.setDescription('String describing the processor.')
pcoip_gen_devices_generic_tag = mib_table_column((1, 3, 6, 1, 4, 1, 25071, 1, 2, 6, 1, 1, 4), octet_string()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
pcoipGenDevicesGenericTag.setStatus('current')
if mibBuilder.loadTexts:
pcoipGenDevicesGenericTag.setDescription('String describing device generic tag. ')
pcoip_gen_devices_part_number = mib_table_column((1, 3, 6, 1, 4, 1, 25071, 1, 2, 6, 1, 1, 5), octet_string()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
pcoipGenDevicesPartNumber.setStatus('current')
if mibBuilder.loadTexts:
pcoipGenDevicesPartNumber.setDescription('String describing the silicon part number of the device.')
pcoip_gen_devices_fw_part_number = mib_scalar((1, 3, 6, 1, 4, 1, 25071, 1, 2, 6, 1, 1, 6), octet_string()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
pcoipGenDevicesFwPartNumber.setStatus('current')
if mibBuilder.loadTexts:
pcoipGenDevicesFwPartNumber.setDescription('String describing the product ID of the device.')
pcoip_gen_devices_serial_number = mib_table_column((1, 3, 6, 1, 4, 1, 25071, 1, 2, 6, 1, 1, 7), octet_string()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
pcoipGenDevicesSerialNumber.setStatus('current')
if mibBuilder.loadTexts:
pcoipGenDevicesSerialNumber.setDescription('String describing device serial number.')
pcoip_gen_devices_hardware_version = mib_table_column((1, 3, 6, 1, 4, 1, 25071, 1, 2, 6, 1, 1, 8), octet_string()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
pcoipGenDevicesHardwareVersion.setStatus('current')
if mibBuilder.loadTexts:
pcoipGenDevicesHardwareVersion.setDescription('String describing the silicon version.')
pcoip_gen_devices_firmware_version = mib_table_column((1, 3, 6, 1, 4, 1, 25071, 1, 2, 6, 1, 1, 9), octet_string()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
pcoipGenDevicesFirmwareVersion.setStatus('current')
if mibBuilder.loadTexts:
pcoipGenDevicesFirmwareVersion.setDescription('String describing the currently running firmware revision.')
pcoip_gen_devices_unique_id = mib_table_column((1, 3, 6, 1, 4, 1, 25071, 1, 2, 6, 1, 1, 10), octet_string()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
pcoipGenDevicesUniqueID.setStatus('current')
if mibBuilder.loadTexts:
pcoipGenDevicesUniqueID.setDescription('String describing the device unique identifier.')
pcoip_gen_devices_mac = mib_table_column((1, 3, 6, 1, 4, 1, 25071, 1, 2, 6, 1, 1, 11), octet_string()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
pcoipGenDevicesMAC.setStatus('current')
if mibBuilder.loadTexts:
pcoipGenDevicesMAC.setDescription('String describing the device MAC address.')
pcoip_gen_devices_uptime = mib_table_column((1, 3, 6, 1, 4, 1, 25071, 1, 2, 6, 1, 1, 12), counter64()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
pcoipGenDevicesUptime.setStatus('current')
if mibBuilder.loadTexts:
pcoipGenDevicesUptime.setDescription('Integer containing the number of seconds since boot.')
pcoip_imaging_devices_table = mib_table((1, 3, 6, 1, 4, 1, 25071, 1, 2, 7, 1))
if mibBuilder.loadTexts:
pcoipImagingDevicesTable.setStatus('current')
if mibBuilder.loadTexts:
pcoipImagingDevicesTable.setDescription('The PCoIP Imaging Devices table.')
pcoip_imaging_devices_entry = mib_table_row((1, 3, 6, 1, 4, 1, 25071, 1, 2, 7, 1, 1)).setIndexNames((0, 'TERADICI-PCOIPv2-MIB', 'pcoipImagingDevicesIndex'))
if mibBuilder.loadTexts:
pcoipImagingDevicesEntry.setStatus('current')
if mibBuilder.loadTexts:
pcoipImagingDevicesEntry.setDescription('An entry in the PCoIP imaging devices table.')
pcoip_imaging_devices_index = mib_table_column((1, 3, 6, 1, 4, 1, 25071, 1, 2, 7, 1, 1, 1), integer32().subtype(subtypeSpec=value_range_constraint(1, 4))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
pcoipImagingDevicesIndex.setStatus('current')
if mibBuilder.loadTexts:
pcoipImagingDevicesIndex.setDescription('The auxiliary variable used for identifying instances of the columnar objects in the devices table.')
pcoip_imaging_devices_session_number = mib_table_column((1, 3, 6, 1, 4, 1, 25071, 1, 2, 7, 1, 1, 2), integer32().subtype(subtypeSpec=value_range_constraint(1, 1))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
pcoipImagingDevicesSessionNumber.setStatus('current')
if mibBuilder.loadTexts:
pcoipImagingDevicesSessionNumber.setDescription('PCoIP session number used to link imaging devices to statistics.')
pcoip_imaging_devices_display_width = mib_table_column((1, 3, 6, 1, 4, 1, 25071, 1, 2, 7, 1, 1, 3), integer32().subtype(subtypeSpec=value_range_constraint(0, 4096))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
pcoipImagingDevicesDisplayWidth.setStatus('current')
if mibBuilder.loadTexts:
pcoipImagingDevicesDisplayWidth.setDescription('Display width in pixels.')
pcoip_imaging_devices_display_height = mib_table_column((1, 3, 6, 1, 4, 1, 25071, 1, 2, 7, 1, 1, 4), integer32().subtype(subtypeSpec=value_range_constraint(0, 4096))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
pcoipImagingDevicesDisplayHeight.setStatus('current')
if mibBuilder.loadTexts:
pcoipImagingDevicesDisplayHeight.setDescription('Display height in lines.')
pcoip_imaging_devices_display_refresh_rate = mib_table_column((1, 3, 6, 1, 4, 1, 25071, 1, 2, 7, 1, 1, 5), integer32().subtype(subtypeSpec=value_range_constraint(0, 600))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
pcoipImagingDevicesDisplayRefreshRate.setStatus('current')
if mibBuilder.loadTexts:
pcoipImagingDevicesDisplayRefreshRate.setDescription('Display refresh rate in Hz.')
pcoip_imaging_devices_display_change_rate = mib_table_column((1, 3, 6, 1, 4, 1, 25071, 1, 2, 7, 1, 1, 6), integer32().subtype(subtypeSpec=value_range_constraint(0, 600))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
pcoipImagingDevicesDisplayChangeRate.setStatus('current')
if mibBuilder.loadTexts:
pcoipImagingDevicesDisplayChangeRate.setDescription('Display input change rate in Hz over a 1 second sample.')
pcoip_imaging_devices_display_process_rate = mib_table_column((1, 3, 6, 1, 4, 1, 25071, 1, 2, 7, 1, 1, 7), integer32().subtype(subtypeSpec=value_range_constraint(0, 600))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
pcoipImagingDevicesDisplayProcessRate.setStatus('current')
if mibBuilder.loadTexts:
pcoipImagingDevicesDisplayProcessRate.setDescription('Display process frame rate in Hz over a 1 second sample.')
pcoip_imaging_devices_limit_reason = mib_table_column((1, 3, 6, 1, 4, 1, 25071, 1, 2, 7, 1, 1, 8), octet_string()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
pcoipImagingDevicesLimitReason.setStatus('current')
if mibBuilder.loadTexts:
pcoipImagingDevicesLimitReason.setDescription('String describing the reason for limiting the frame rate of this display.')
pcoip_imaging_devices_model = mib_table_column((1, 3, 6, 1, 4, 1, 25071, 1, 2, 7, 1, 1, 9), octet_string()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
pcoipImagingDevicesModel.setStatus('current')
if mibBuilder.loadTexts:
pcoipImagingDevicesModel.setDescription('String describing the display model name.')
pcoip_imaging_devices_status = mib_table_column((1, 3, 6, 1, 4, 1, 25071, 1, 2, 7, 1, 1, 10), octet_string()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
pcoipImagingDevicesStatus.setStatus('current')
if mibBuilder.loadTexts:
pcoipImagingDevicesStatus.setDescription('String describing the display device status.')
pcoip_imaging_devices_mode = mib_table_column((1, 3, 6, 1, 4, 1, 25071, 1, 2, 7, 1, 1, 11), octet_string()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
pcoipImagingDevicesMode.setStatus('current')
if mibBuilder.loadTexts:
pcoipImagingDevicesMode.setDescription('String describing the display mode.')
pcoip_imaging_devices_serial = mib_table_column((1, 3, 6, 1, 4, 1, 25071, 1, 2, 7, 1, 1, 12), octet_string()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
pcoipImagingDevicesSerial.setStatus('current')
if mibBuilder.loadTexts:
pcoipImagingDevicesSerial.setDescription('String describing the display serial number.')
pcoip_imaging_devices_vid = mib_table_column((1, 3, 6, 1, 4, 1, 25071, 1, 2, 7, 1, 1, 13), octet_string()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
pcoipImagingDevicesVID.setStatus('current')
if mibBuilder.loadTexts:
pcoipImagingDevicesVID.setDescription('String describing the display vendor ID.')
pcoip_imaging_devices_pid = mib_table_column((1, 3, 6, 1, 4, 1, 25071, 1, 2, 7, 1, 1, 14), octet_string()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
pcoipImagingDevicesPID.setStatus('current')
if mibBuilder.loadTexts:
pcoipImagingDevicesPID.setDescription('String describing the display product ID.')
pcoip_imaging_devices_date = mib_table_column((1, 3, 6, 1, 4, 1, 25071, 1, 2, 7, 1, 1, 15), octet_string()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
pcoipImagingDevicesDate.setStatus('current')
if mibBuilder.loadTexts:
pcoipImagingDevicesDate.setDescription('String describing the display date of manufacture.')
pcoip_usb_devices_table = mib_table((1, 3, 6, 1, 4, 1, 25071, 1, 2, 8, 1))
if mibBuilder.loadTexts:
pcoipUSBDevicesTable.setStatus('current')
if mibBuilder.loadTexts:
pcoipUSBDevicesTable.setDescription('The PCoIP USB Devices table.')
pcoip_usb_devices_entry = mib_table_row((1, 3, 6, 1, 4, 1, 25071, 1, 2, 8, 1, 1)).setIndexNames((0, 'TERADICI-PCOIPv2-MIB', 'pcoipUSBDevicesIndex'))
if mibBuilder.loadTexts:
pcoipUSBDevicesEntry.setStatus('current')
if mibBuilder.loadTexts:
pcoipUSBDevicesEntry.setDescription('An entry in the PCoIP USB devices table.')
pcoip_usb_devices_index = mib_table_column((1, 3, 6, 1, 4, 1, 25071, 1, 2, 8, 1, 1, 1), integer32().subtype(subtypeSpec=value_range_constraint(1, 127))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
pcoipUSBDevicesIndex.setStatus('current')
if mibBuilder.loadTexts:
pcoipUSBDevicesIndex.setDescription('The auxiliary variable used for identifying instances of the columnar objects in the devices table.')
pcoip_usb_devices_session_number = mib_table_column((1, 3, 6, 1, 4, 1, 25071, 1, 2, 8, 1, 1, 2), integer32().subtype(subtypeSpec=value_range_constraint(1, 1))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
pcoipUSBDevicesSessionNumber.setStatus('current')
if mibBuilder.loadTexts:
pcoipUSBDevicesSessionNumber.setDescription('PCoIP session number used to link USB devices to statistics.')
pcoip_usb_devices_port = mib_table_column((1, 3, 6, 1, 4, 1, 25071, 1, 2, 8, 1, 1, 3), octet_string()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
pcoipUSBDevicesPort.setStatus('current')
if mibBuilder.loadTexts:
pcoipUSBDevicesPort.setDescription('USB device port: OHCI or EHCI.')
pcoip_usb_devices_model = mib_table_column((1, 3, 6, 1, 4, 1, 25071, 1, 2, 8, 1, 1, 4), octet_string()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
pcoipUSBDevicesModel.setStatus('current')
if mibBuilder.loadTexts:
pcoipUSBDevicesModel.setDescription('String describing the model name of the connected device.')
pcoip_usb_devices_status = mib_table_column((1, 3, 6, 1, 4, 1, 25071, 1, 2, 8, 1, 1, 5), octet_string()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
pcoipUSBDevicesStatus.setStatus('current')
if mibBuilder.loadTexts:
pcoipUSBDevicesStatus.setDescription('String describing the USB device status.')
pcoip_usb_devices_device_class = mib_table_column((1, 3, 6, 1, 4, 1, 25071, 1, 2, 8, 1, 1, 6), octet_string()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
pcoipUSBDevicesDeviceClass.setStatus('current')
if mibBuilder.loadTexts:
pcoipUSBDevicesDeviceClass.setDescription('String describing the USB device class.')
pcoip_usb_devices_sub_class = mib_table_column((1, 3, 6, 1, 4, 1, 25071, 1, 2, 8, 1, 1, 7), octet_string()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
pcoipUSBDevicesSubClass.setStatus('current')
if mibBuilder.loadTexts:
pcoipUSBDevicesSubClass.setDescription('String describing the USB sub device class.')
pcoip_usb_devices_protocol = mib_table_column((1, 3, 6, 1, 4, 1, 25071, 1, 2, 8, 1, 1, 8), octet_string()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
pcoipUSBDevicesProtocol.setStatus('current')
if mibBuilder.loadTexts:
pcoipUSBDevicesProtocol.setDescription('String describing the USB protocol used.')
pcoip_usb_devices_serial = mib_table_column((1, 3, 6, 1, 4, 1, 25071, 1, 2, 8, 1, 1, 9), octet_string()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
pcoipUSBDevicesSerial.setStatus('current')
if mibBuilder.loadTexts:
pcoipUSBDevicesSerial.setDescription('String describing the USB device serial number.')
pcoip_usb_devices_vid = mib_table_column((1, 3, 6, 1, 4, 1, 25071, 1, 2, 8, 1, 1, 10), octet_string()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
pcoipUSBDevicesVID.setStatus('current')
if mibBuilder.loadTexts:
pcoipUSBDevicesVID.setDescription('String describing the USB device vendor ID.')
pcoip_usb_devices_pid = mib_table_column((1, 3, 6, 1, 4, 1, 25071, 1, 2, 8, 1, 1, 11), octet_string()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
pcoipUSBDevicesPID.setStatus('current')
if mibBuilder.loadTexts:
pcoipUSBDevicesPID.setDescription('String describing the USB device product ID.')
mibBuilder.exportSymbols('TERADICI-PCOIPv2-MIB', pcoipImagingStatsActiveMinimumQuality=pcoipImagingStatsActiveMinimumQuality, pcoipGenStatsBytesReceived=pcoipGenStatsBytesReceived, pcoipUSBStatsTable=pcoipUSBStatsTable, pcoipGenDevicesSerialNumber=pcoipGenDevicesSerialNumber, pcoipNetStatsTXBWActiveLimitkbitPersec=pcoipNetStatsTXBWActiveLimitkbitPersec, pcoipNetStatsTXPacketLossPercent=pcoipNetStatsTXPacketLossPercent, pcoipImagingStatsPipelineProcRate=pcoipImagingStatsPipelineProcRate, pcoipUSBDevicesProtocol=pcoipUSBDevicesProtocol, pcoipNetStatsRXBWPeakkbitPersec=pcoipNetStatsRXBWPeakkbitPersec, pcoipImagingDevicesTable=pcoipImagingDevicesTable, teraPcoipUSBStats=teraPcoipUSBStats, pcoipAudioStatsTXBWLimitkbitPersec=pcoipAudioStatsTXBWLimitkbitPersec, pcoipAudioStatsTXBWkbitPersec=pcoipAudioStatsTXBWkbitPersec, pcoipNetStatsEntry=pcoipNetStatsEntry, pcoipGenStatsPacketsReceived=pcoipGenStatsPacketsReceived, pcoipUSBDevicesPort=pcoipUSBDevicesPort, pcoipGenStatsSessionNumber=pcoipGenStatsSessionNumber, pcoipImagingDevicesPID=pcoipImagingDevicesPID, pcoipNetStatsSessionNumber=pcoipNetStatsSessionNumber, pcoipGenDevicesGenericTag=pcoipGenDevicesGenericTag, teraPcoipUSBDevices=teraPcoipUSBDevices, teraPcoipAudioStats=teraPcoipAudioStats, pcoipAudioStatsEntry=pcoipAudioStatsEntry, pcoipImagingStatsRXBWkbitPersec=pcoipImagingStatsRXBWkbitPersec, pcoipGenStatsEntry=pcoipGenStatsEntry, pcoipUSBDevicesSubClass=pcoipUSBDevicesSubClass, pcoipImagingDevicesDisplayProcessRate=pcoipImagingDevicesDisplayProcessRate, pcoipGenDevicesHardwareVersion=pcoipGenDevicesHardwareVersion, pcoipGenDevicesMAC=pcoipGenDevicesMAC, pcoipUSBStatsBytesReceived=pcoipUSBStatsBytesReceived, pcoipImagingDevicesVID=pcoipImagingDevicesVID, teraPcoipImagingStats=teraPcoipImagingStats, pcoipAudioStatsBytesReceived=pcoipAudioStatsBytesReceived, teraPcoipGenStats=teraPcoipGenStats, pcoipImagingStatsDecoderCapabilitykbitPersec=pcoipImagingStatsDecoderCapabilitykbitPersec, pcoipUSBStatsBytesSent=pcoipUSBStatsBytesSent, pcoipUSBDevicesIndex=pcoipUSBDevicesIndex, pcoipImagingStatsTXBWkbitPersec=pcoipImagingStatsTXBWkbitPersec, pcoipImagingDevicesModel=pcoipImagingDevicesModel, pcoipImagingDevicesIndex=pcoipImagingDevicesIndex, pcoipUSBStatsEntry=pcoipUSBStatsEntry, pcoipUSBDevicesStatus=pcoipUSBDevicesStatus, pcoipImagingStatsBytesReceived=pcoipImagingStatsBytesReceived, pcoipGenStatsPacketsSent=pcoipGenStatsPacketsSent, pcoipUSBDevicesTable=pcoipUSBDevicesTable, pcoipGenStatsSessionDuration=pcoipGenStatsSessionDuration, pcoipGenDevicesUptime=pcoipGenDevicesUptime, pcoipNetStatsRoundTripLatencyMs=pcoipNetStatsRoundTripLatencyMs, pcoipImagingDevicesLimitReason=pcoipImagingDevicesLimitReason, pcoipUSBStatsTXBWkbitPersec=pcoipUSBStatsTXBWkbitPersec, pcoipImagingStatsSessionNumber=pcoipImagingStatsSessionNumber, pcoipNetStatsTXBWkbitPersec=pcoipNetStatsTXBWkbitPersec, pcoipAudioStatsRXBWkbitPersec=pcoipAudioStatsRXBWkbitPersec, pcoipUSBDevicesSerial=pcoipUSBDevicesSerial, pcoipImagingStatsTable=pcoipImagingStatsTable, pcoipGenDevicesEntry=pcoipGenDevicesEntry, pcoipNetStatsRXBWkbitPersec=pcoipNetStatsRXBWkbitPersec, pcoipGenDevicesName=pcoipGenDevicesName, pcoipGenDevicesFirmwareVersion=pcoipGenDevicesFirmwareVersion, pcoipGenDevicesSessionNumber=pcoipGenDevicesSessionNumber, pcoipGenDevicesFwPartNumber=pcoipGenDevicesFwPartNumber, teraMibModule=teraMibModule, pcoipGenDevicesUniqueID=pcoipGenDevicesUniqueID, pcoipUSBDevicesVID=pcoipUSBDevicesVID, pcoipAudioStatsTable=pcoipAudioStatsTable, pcoipUSBDevicesEntry=pcoipUSBDevicesEntry, pcoipGenStatsTxPacketsLost=pcoipGenStatsTxPacketsLost, pcoipGenDevicesPartNumber=pcoipGenDevicesPartNumber, pcoipImagingDevicesMode=pcoipImagingDevicesMode, teraProducts=teraProducts, teraPcoipImagingDevices=teraPcoipImagingDevices, pcoipImagingDevicesStatus=pcoipImagingDevicesStatus, pcoipImagingDevicesEntry=pcoipImagingDevicesEntry, pcoipImagingDevicesDate=pcoipImagingDevicesDate, pcoipAudioStatsBytesSent=pcoipAudioStatsBytesSent, pcoipGenStatsBytesSent=pcoipGenStatsBytesSent, pcoipImagingDevicesDisplayChangeRate=pcoipImagingDevicesDisplayChangeRate, pcoipNetStatsRXPacketLossPercent=pcoipNetStatsRXPacketLossPercent, pcoipUSBStatsSessionNumber=pcoipUSBStatsSessionNumber, teraPcoipGenDevices=teraPcoipGenDevices, pcoipNetStatsTXBWLimitkbitPersec=pcoipNetStatsTXBWLimitkbitPersec, pcoipImagingDevicesDisplayHeight=pcoipImagingDevicesDisplayHeight, pcoipGenStatsTable=pcoipGenStatsTable, pcoipImagingDevicesSessionNumber=pcoipImagingDevicesSessionNumber, pcoipNetStatsTable=pcoipNetStatsTable, PYSNMP_MODULE_ID=teraMibModule, pcoipImagingDevicesDisplayWidth=pcoipImagingDevicesDisplayWidth, pcoipGenDevicesTable=pcoipGenDevicesTable, pcoipImagingDevicesDisplayRefreshRate=pcoipImagingDevicesDisplayRefreshRate, pcoipUSBDevicesDeviceClass=pcoipUSBDevicesDeviceClass, teraPcoipV2=teraPcoipV2, pcoipUSBDevicesPID=pcoipUSBDevicesPID, pcoipImagingStatsBytesSent=pcoipImagingStatsBytesSent, pcoipAudioStatsSessionNumber=pcoipAudioStatsSessionNumber, pcoipUSBDevicesSessionNumber=pcoipUSBDevicesSessionNumber, pcoipImagingDevicesSerial=pcoipImagingDevicesSerial, pcoipImagingStatsEncodedFramesPersec=pcoipImagingStatsEncodedFramesPersec, pcoipImagingStatsEntry=pcoipImagingStatsEntry, pcoipUSBStatsRXBWkbitPersec=pcoipUSBStatsRXBWkbitPersec, pcoipGenDevicesDescription=pcoipGenDevicesDescription, teraPcoipNetStats=teraPcoipNetStats, pcoipUSBDevicesModel=pcoipUSBDevicesModel) |
__version__ = "0.1.0"
__name__ = "python-gmail-export"
__description__ = "Python Gmail Export"
__url__ = "https://github.com/rjmoggach/python-gmail-export"
__author__ = "RJ Moggach"
__authoremail__ = "rjmoggach@gmail.com"
__license__ = "The MIT License (MIT)"
__copyright__ = "Copyright 2021 RJ Moggach" | __version__ = '0.1.0'
__name__ = 'python-gmail-export'
__description__ = 'Python Gmail Export'
__url__ = 'https://github.com/rjmoggach/python-gmail-export'
__author__ = 'RJ Moggach'
__authoremail__ = 'rjmoggach@gmail.com'
__license__ = 'The MIT License (MIT)'
__copyright__ = 'Copyright 2021 RJ Moggach' |
def laceStringsRecur(S1, S2):
"""
s1 and s2 are strings.
Returns a new str with elements of s1 and s2 interlaced,
beginning with s1. If strings are not of same length,
then the extra elements should appear at the end.
"""
def helpLaceStrings(s1, s2, out):
print('s1: ', s1, 's2: ', s2, ' : out:', out + '\n')
if s1 == '':
# print('0000000000s1:::', out)
return out + s2
if s2 == '':
# print('0000000000s2:::', out)
return out + s1
else:
# PLACE A LINE OF CODE HERE
# print('>>>>>>>>>> ' + str(round(len(out) / 2)))
return helpLaceStrings(S1[round(len(out) / 2 + 1):],
S2[round(len(out) / 2 + 1):],
out +
s1[0] +
s2[0])
return helpLaceStrings(S1, S2, '')
s1 = 'abcdef'
s2 = 'ABCDEF'
r = laceStringsRecur(s1, s2)
print('RESULTADO', r)
| def lace_strings_recur(S1, S2):
"""
s1 and s2 are strings.
Returns a new str with elements of s1 and s2 interlaced,
beginning with s1. If strings are not of same length,
then the extra elements should appear at the end.
"""
def help_lace_strings(s1, s2, out):
print('s1: ', s1, 's2: ', s2, ' : out:', out + '\n')
if s1 == '':
return out + s2
if s2 == '':
return out + s1
else:
return help_lace_strings(S1[round(len(out) / 2 + 1):], S2[round(len(out) / 2 + 1):], out + s1[0] + s2[0])
return help_lace_strings(S1, S2, '')
s1 = 'abcdef'
s2 = 'ABCDEF'
r = lace_strings_recur(s1, s2)
print('RESULTADO', r) |
# todas as variaveis vao virar comida pois passa pela global
def comida():
global ovos
ovos = 'comida'
bacon()
def bacon():
ovos = 'bacon'
pimenta()
def pimenta():
print(ovos)
# Programa Principal
ovos = 12
comida()
print(ovos)
| def comida():
global ovos
ovos = 'comida'
bacon()
def bacon():
ovos = 'bacon'
pimenta()
def pimenta():
print(ovos)
ovos = 12
comida()
print(ovos) |
# Numbers
# Define two integers
x = 12
y = 8
# Define two variables that will hold the result of these equations
sum = x+y
difference = x-y
print(f"{x} plus {y} is {sum}.")
print(f"{x} minus {y} is {difference}.")
# There are other operators, such as "*" for multiplication,
# "/" for division, and "%" for modulus.
| x = 12
y = 8
sum = x + y
difference = x - y
print(f'{x} plus {y} is {sum}.')
print(f'{x} minus {y} is {difference}.') |
# Ejercicio 2.4.
nro_one = int(input("Ingrese primer nro: "))
nro_two = int(input("Ingrese segundo nro: "))
for i in range(nro_one, nro_two + 1):
if i % 2 == 0:
print(i)
| nro_one = int(input('Ingrese primer nro: '))
nro_two = int(input('Ingrese segundo nro: '))
for i in range(nro_one, nro_two + 1):
if i % 2 == 0:
print(i) |
n = int(input())
sequencia = [0]
if n > 1:
sequencia.append(1)
for i in range(2, n):
sequencia.append(sequencia[-1] + sequencia[-2])
print(' '.join(str(x) for x in sequencia))
| n = int(input())
sequencia = [0]
if n > 1:
sequencia.append(1)
for i in range(2, n):
sequencia.append(sequencia[-1] + sequencia[-2])
print(' '.join((str(x) for x in sequencia))) |
"""
Description: instantiate object
"""
class EntityState:
"""
Physical/external base state of all entities.
"""
def __init__(self):
# physical position
self.p_pos = None
# physical velocity
self.p_vel = None
class Entity:
"""
Properties and state of physical world entity.
"""
def __init__(self):
self.name = ''
self.movable = False
self.collide = False
self.color = None
self.max_speed = None
self.state = EntityState()
self.initial_mass = 1.0
class Landmark(Entity):
"""
Properties of landmark entities.
"""
def __init__(self):
super(Landmark, self).__init__()
| """
Description: instantiate object
"""
class Entitystate:
"""
Physical/external base state of all entities.
"""
def __init__(self):
self.p_pos = None
self.p_vel = None
class Entity:
"""
Properties and state of physical world entity.
"""
def __init__(self):
self.name = ''
self.movable = False
self.collide = False
self.color = None
self.max_speed = None
self.state = entity_state()
self.initial_mass = 1.0
class Landmark(Entity):
"""
Properties of landmark entities.
"""
def __init__(self):
super(Landmark, self).__init__() |
i = 0
def foo():
i = i + 1 # UnboundLocalError: local variable 'i' referenced before assignment
print(i)
foo() # i does not reference to global variable | i = 0
def foo():
i = i + 1
print(i)
foo() |
#!/usr/bin/env python3
# ~*~ coding: utf-8 ~*~
onetoten = range(1, 11)
for count in onetoten:
print(count)
## Shorter version:
#for count in range(1, 11):
# print(count)
| onetoten = range(1, 11)
for count in onetoten:
print(count) |
class Solution(object):
def TwoSum(self, nums, target):
"""
:type nums: List[int]
:type target: int
:rtype: List[int]
"""
for i in range(len(nums)):
for j in range(len(nums)):
if i != j:
if nums[i] + nums[j] == target:
return [i, j]
return [0, 0]
nums = [7, 2, 11, 15]
target = 9
p = Solution()
print(p.TwoSum(nums,target)) | class Solution(object):
def two_sum(self, nums, target):
"""
:type nums: List[int]
:type target: int
:rtype: List[int]
"""
for i in range(len(nums)):
for j in range(len(nums)):
if i != j:
if nums[i] + nums[j] == target:
return [i, j]
return [0, 0]
nums = [7, 2, 11, 15]
target = 9
p = solution()
print(p.TwoSum(nums, target)) |
class Solution:
# @param A : integer
# @return a strings
def convertToTitle(self, A):
alphalist = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N',
'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z']
outputstring = ''
base = 26
while A != 0:
quo = A // base
rem = A % base
if rem == 0:
outputstring += 'Z'
A = quo - 1
else:
outputstring += alphalist[rem - 1]
A = quo
returnstring = outputstring[::-1]
return returnstring
A = 943566
# A = 28 * 26
s = Solution()
print(s.convertToTitle(A))
| class Solution:
def convert_to_title(self, A):
alphalist = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z']
outputstring = ''
base = 26
while A != 0:
quo = A // base
rem = A % base
if rem == 0:
outputstring += 'Z'
a = quo - 1
else:
outputstring += alphalist[rem - 1]
a = quo
returnstring = outputstring[::-1]
return returnstring
a = 943566
s = solution()
print(s.convertToTitle(A)) |
#https://galaiko.rocks/posts/2018-07-08/
def f(num):
return 1 if int(num) <= 26 else 0
def count_possibilites(enc):
length = len(enc)
if length == 1:
return 1
elif length == 2:
return f(enc) + 1
else:
return f(enc[:1]) * count_possibilites(enc[1:]) + f(enc[:2]) * count_possibilites(enc[2:])
testCase = '221282229182918928192912195211191212192819813'
print(count_possibilites(testCase)) | def f(num):
return 1 if int(num) <= 26 else 0
def count_possibilites(enc):
length = len(enc)
if length == 1:
return 1
elif length == 2:
return f(enc) + 1
else:
return f(enc[:1]) * count_possibilites(enc[1:]) + f(enc[:2]) * count_possibilites(enc[2:])
test_case = '221282229182918928192912195211191212192819813'
print(count_possibilites(testCase)) |
#https://www.codewars.com/kata/convert-boolean-values-to-strings-yes-or-no
def bool_to_word(boolean):
return "Yes" if boolean == True else "No"
| def bool_to_word(boolean):
return 'Yes' if boolean == True else 'No' |
""" This problem was recently asked by Google.
Given a list of numbers and a number k, return whether any two numbers from the
list add up to k. For example, given [10, 15, 3, 7] and k of 17, return true
since 10 + 7 is 17. Bonus: Can you do this in one pass? """
# BRUT FORCE SOLUTION
#
# arr = [10, 15, 3, 7]
# for i in arr:
# for j in arr:
# if i + j == 17:
# print(True)
# ONE PASS SOLUTION
def check(arr, num):
for i in arr:
needed_num = num - i
if needed_num in arr:
return True
if __name__ == '__main__':
arr = [10, 15, 3, 7]
checked = check(arr,17)
print(checked) | """ This problem was recently asked by Google.
Given a list of numbers and a number k, return whether any two numbers from the
list add up to k. For example, given [10, 15, 3, 7] and k of 17, return true
since 10 + 7 is 17. Bonus: Can you do this in one pass? """
def check(arr, num):
for i in arr:
needed_num = num - i
if needed_num in arr:
return True
if __name__ == '__main__':
arr = [10, 15, 3, 7]
checked = check(arr, 17)
print(checked) |
######################################################################
#
# Copyright (C) 2013
# Associated Universities, Inc. Washington DC, USA,
#
# This library is free software; you can redistribute it and/or modify it
# under the terms of the GNU Library General Public License as published by
# the Free Software Foundation; either version 2 of the License, or (at your
# option) any later version.
#
# This library is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
# License for more details.
#
# You should have received a copy of the GNU Library General Public License
# along with this library; if not, write to the Free Software Foundation,
# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA.
#
# Correspondence concerning VLA Pipelines should be addressed as follows:
# Please register and submit helpdesk tickets via: https://help.nrao.edu
# Postal address:
# National Radio Astronomy Observatory
# VLA Pipeline Support Office
# PO Box O
# Socorro, NM, USA
#
######################################################################
# CALCULATE DATA WEIGHTS BASED ON ST. DEV. WITHIN EACH SPW
# use statwt
logprint ("Starting EVLA_pipe_statwt.py", logfileout='logs/statwt.log')
time_list=runtiming('checkflag', 'start')
QA2_statwt='Pass'
logprint ("Calculate data weights per spw using statwt", logfileout='logs/statwt.log')
# Run on all calibrators
default(statwt)
vis=ms_active
dorms=False
fitspw=''
fitcorr=''
combine=''
minsamp=2
field=''
spw=''
intent='*CALIBRATE*'
datacolumn='corrected'
statwt()
# Run on all targets
# set spw to exclude strong science spectral lines
# Calculate std excluding edges and middle of SPW
# spw_usechan = ''
# percents = np.array([0.1, 0.3, 0.7, 0.9])
# for idx, spw_num in enumerate(spws):
# perc_chans = np.round(channels[idx] * percents).astype(int)
# spw_usechan += str(idx) + ":{0}~{1};{2}~{3}".format(*perc_chans) + ","
# Here are the channels I would like to use for finding the stand. dev.
# This is now dependent on the instrument setup and should be removed for all
# other purposes?
hi_chans = "0:600~900;2800~3300"
rrl_chans = "10~25;100~110"
all_rrls = ""
for i in [1, 2, 4, 8, 9]:
all_rrls += "{0}:{1},".format(i, rrl_chans)
all_rrls = all_rrls[:-1]
oh_chans = "20~50;200~230"
all_ohs = ""
for i in [3, 5, 6, 7]:
all_ohs += "{0}:{1},".format(i, oh_chans)
all_ohs = all_ohs[:-1]
spw_usechan = "{0},{1},{2}".format(hi_chans, all_rrls, all_ohs)
default(statwt)
vis=ms_active
dorms=False
# fitspw=spw_usechan[:-1] # Use with the percentile finder above
fitspw=spw_usechan # Use with the user-defined channels
fitcorr=''
combine=''
minsamp=2
field=''
spw=''
intent='*TARGET*'
datacolumn='corrected'
statwt()
# Until we understand better the failure modes of this task, leave QA2
# score set to "Pass".
logprint ("QA2 score: "+QA2_statwt, logfileout='logs/statwt.log')
logprint ("Finished EVLA_pipe_statwt.py", logfileout='logs/statwt.log')
time_list=runtiming('targetflag', 'end')
pipeline_save()
######################################################################
| logprint('Starting EVLA_pipe_statwt.py', logfileout='logs/statwt.log')
time_list = runtiming('checkflag', 'start')
qa2_statwt = 'Pass'
logprint('Calculate data weights per spw using statwt', logfileout='logs/statwt.log')
default(statwt)
vis = ms_active
dorms = False
fitspw = ''
fitcorr = ''
combine = ''
minsamp = 2
field = ''
spw = ''
intent = '*CALIBRATE*'
datacolumn = 'corrected'
statwt()
hi_chans = '0:600~900;2800~3300'
rrl_chans = '10~25;100~110'
all_rrls = ''
for i in [1, 2, 4, 8, 9]:
all_rrls += '{0}:{1},'.format(i, rrl_chans)
all_rrls = all_rrls[:-1]
oh_chans = '20~50;200~230'
all_ohs = ''
for i in [3, 5, 6, 7]:
all_ohs += '{0}:{1},'.format(i, oh_chans)
all_ohs = all_ohs[:-1]
spw_usechan = '{0},{1},{2}'.format(hi_chans, all_rrls, all_ohs)
default(statwt)
vis = ms_active
dorms = False
fitspw = spw_usechan
fitcorr = ''
combine = ''
minsamp = 2
field = ''
spw = ''
intent = '*TARGET*'
datacolumn = 'corrected'
statwt()
logprint('QA2 score: ' + QA2_statwt, logfileout='logs/statwt.log')
logprint('Finished EVLA_pipe_statwt.py', logfileout='logs/statwt.log')
time_list = runtiming('targetflag', 'end')
pipeline_save() |
#!/usr/bin/env python3
def handler(event, context):
print("Hello World!")
print("=====Event=====")
print("{}".format(event))
print("=====Context=====")
print("{}".format(context))
| def handler(event, context):
print('Hello World!')
print('=====Event=====')
print('{}'.format(event))
print('=====Context=====')
print('{}'.format(context)) |
# Mackie CU pages
Pan = 0
Stereo = 1
Sends = 2
Effects = 3
Equalizer = 4
Free = 5
| pan = 0
stereo = 1
sends = 2
effects = 3
equalizer = 4
free = 5 |
WIDTH = 800
HEIGHT = 800
BLACK = (60, 60, 60)
WHITE = (255, 255, 255)
HIGHLIGHT = (200, 0, 0)
WINDOW_NAME = 'PyChess'
ROWS = 8
COLUMNS = 8
SQUARE_SIZE = int(WIDTH/ROWS)
| width = 800
height = 800
black = (60, 60, 60)
white = (255, 255, 255)
highlight = (200, 0, 0)
window_name = 'PyChess'
rows = 8
columns = 8
square_size = int(WIDTH / ROWS) |
n=int(input())
s=input()
a=s.split()
sett=set(a)
lis=list(sett)
x=[int(i) for i in lis]
x.remove(max(x))
print(max(x))
| n = int(input())
s = input()
a = s.split()
sett = set(a)
lis = list(sett)
x = [int(i) for i in lis]
x.remove(max(x))
print(max(x)) |
# -- Project information -----------------------------------------------------
project = "Sphinx Book Theme"
copyright = "2020, Executable Book Project"
author = "Executable Book Project"
master_doc = "index"
extensions = ["myst_parser"]
html_theme = "sphinx_book_theme"
html_theme_options = {
"home_page_in_toc": True,
}
| project = 'Sphinx Book Theme'
copyright = '2020, Executable Book Project'
author = 'Executable Book Project'
master_doc = 'index'
extensions = ['myst_parser']
html_theme = 'sphinx_book_theme'
html_theme_options = {'home_page_in_toc': True} |
#
# For your reference:
#
# SinglyLinkedListNode:
# int data
# SinglyLinkedListNode next
#
def findMergeNode(head1, head2):
"""
Go forward the lists every time till the end, and
then jumps to the beginning of the opposite list, and
so on. Advance each of the pointers by 1 every time,
until they meet. The number of nodes traveled from
head1 -> tail1 -> head2 -> intersection point and
head2 -> tail2-> head1 -> intersection point will be equal.
"""
node1 = head1
node2 = head2
while node1 != node2:
if node1.next:
node1 = node1.next
else:
node1 = head2
if node2.next:
node2 = node2.next
else:
node2 = head1
return node2.data
| def find_merge_node(head1, head2):
"""
Go forward the lists every time till the end, and
then jumps to the beginning of the opposite list, and
so on. Advance each of the pointers by 1 every time,
until they meet. The number of nodes traveled from
head1 -> tail1 -> head2 -> intersection point and
head2 -> tail2-> head1 -> intersection point will be equal.
"""
node1 = head1
node2 = head2
while node1 != node2:
if node1.next:
node1 = node1.next
else:
node1 = head2
if node2.next:
node2 = node2.next
else:
node2 = head1
return node2.data |
#
# PySNMP MIB module FNET-OPTIVIEW-WAN-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/FNET-OPTIVIEW-WAN-MIB
# Produced by pysmi-0.3.4 at Mon Apr 29 19:00:31 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 (default, Mar 27 2019, 09:23:15)
#
Integer, OctetString, ObjectIdentifier = mibBuilder.importSymbols("ASN1", "Integer", "OctetString", "ObjectIdentifier")
NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues")
ConstraintsIntersection, SingleValueConstraint, ValueSizeConstraint, ConstraintsUnion, ValueRangeConstraint = mibBuilder.importSymbols("ASN1-REFINEMENT", "ConstraintsIntersection", "SingleValueConstraint", "ValueSizeConstraint", "ConstraintsUnion", "ValueRangeConstraint")
fnetOptiViewGeneric, = mibBuilder.importSymbols("FNET-GLOBAL-REG", "fnetOptiViewGeneric")
ovTrapDescription, ovTrapOffenderSubId, ovTrapSeverity, ovTrapAgentSysName, ovTrapOffenderName, ovTrapStatus, ovTrapOffenderNetAddr = mibBuilder.importSymbols("FNET-OPTIVIEW-GENERIC-MIB", "ovTrapDescription", "ovTrapOffenderSubId", "ovTrapSeverity", "ovTrapAgentSysName", "ovTrapOffenderName", "ovTrapStatus", "ovTrapOffenderNetAddr")
ModuleCompliance, NotificationGroup = mibBuilder.importSymbols("SNMPv2-CONF", "ModuleCompliance", "NotificationGroup")
Integer32, MibIdentifier, Counter64, Bits, Counter32, Unsigned32, iso, MibScalar, MibTable, MibTableRow, MibTableColumn, ModuleIdentity, ObjectIdentity, TimeTicks, Gauge32, NotificationType, NotificationType, IpAddress = mibBuilder.importSymbols("SNMPv2-SMI", "Integer32", "MibIdentifier", "Counter64", "Bits", "Counter32", "Unsigned32", "iso", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "ModuleIdentity", "ObjectIdentity", "TimeTicks", "Gauge32", "NotificationType", "NotificationType", "IpAddress")
DisplayString, TextualConvention = mibBuilder.importSymbols("SNMPv2-TC", "DisplayString", "TextualConvention")
probSonetLinkDown = NotificationType((1, 3, 6, 1, 4, 1, 1226, 2, 1) + (0,12000)).setObjects(("FNET-OPTIVIEW-GENERIC-MIB", "ovTrapAgentSysName"), ("FNET-OPTIVIEW-GENERIC-MIB", "ovTrapSeverity"), ("FNET-OPTIVIEW-GENERIC-MIB", "ovTrapStatus"), ("FNET-OPTIVIEW-GENERIC-MIB", "ovTrapDescription"), ("FNET-OPTIVIEW-GENERIC-MIB", "ovTrapOffenderName"), ("FNET-OPTIVIEW-GENERIC-MIB", "ovTrapOffenderNetAddr"), ("FNET-OPTIVIEW-GENERIC-MIB", "ovTrapOffenderSubId"))
probSonetErrors = NotificationType((1, 3, 6, 1, 4, 1, 1226, 2, 1) + (0,12001)).setObjects(("FNET-OPTIVIEW-GENERIC-MIB", "ovTrapAgentSysName"), ("FNET-OPTIVIEW-GENERIC-MIB", "ovTrapSeverity"), ("FNET-OPTIVIEW-GENERIC-MIB", "ovTrapStatus"), ("FNET-OPTIVIEW-GENERIC-MIB", "ovTrapDescription"), ("FNET-OPTIVIEW-GENERIC-MIB", "ovTrapOffenderName"), ("FNET-OPTIVIEW-GENERIC-MIB", "ovTrapOffenderNetAddr"), ("FNET-OPTIVIEW-GENERIC-MIB", "ovTrapOffenderSubId"))
probSonetAlarms = NotificationType((1, 3, 6, 1, 4, 1, 1226, 2, 1) + (0,12002)).setObjects(("FNET-OPTIVIEW-GENERIC-MIB", "ovTrapAgentSysName"), ("FNET-OPTIVIEW-GENERIC-MIB", "ovTrapSeverity"), ("FNET-OPTIVIEW-GENERIC-MIB", "ovTrapStatus"), ("FNET-OPTIVIEW-GENERIC-MIB", "ovTrapDescription"), ("FNET-OPTIVIEW-GENERIC-MIB", "ovTrapOffenderName"), ("FNET-OPTIVIEW-GENERIC-MIB", "ovTrapOffenderNetAddr"), ("FNET-OPTIVIEW-GENERIC-MIB", "ovTrapOffenderSubId"))
probAtmLinkDown = NotificationType((1, 3, 6, 1, 4, 1, 1226, 2, 1) + (0,12003)).setObjects(("FNET-OPTIVIEW-GENERIC-MIB", "ovTrapAgentSysName"), ("FNET-OPTIVIEW-GENERIC-MIB", "ovTrapSeverity"), ("FNET-OPTIVIEW-GENERIC-MIB", "ovTrapStatus"), ("FNET-OPTIVIEW-GENERIC-MIB", "ovTrapDescription"), ("FNET-OPTIVIEW-GENERIC-MIB", "ovTrapOffenderName"), ("FNET-OPTIVIEW-GENERIC-MIB", "ovTrapOffenderNetAddr"), ("FNET-OPTIVIEW-GENERIC-MIB", "ovTrapOffenderSubId"))
probAtmErrors = NotificationType((1, 3, 6, 1, 4, 1, 1226, 2, 1) + (0,12004)).setObjects(("FNET-OPTIVIEW-GENERIC-MIB", "ovTrapAgentSysName"), ("FNET-OPTIVIEW-GENERIC-MIB", "ovTrapSeverity"), ("FNET-OPTIVIEW-GENERIC-MIB", "ovTrapStatus"), ("FNET-OPTIVIEW-GENERIC-MIB", "ovTrapDescription"), ("FNET-OPTIVIEW-GENERIC-MIB", "ovTrapOffenderName"), ("FNET-OPTIVIEW-GENERIC-MIB", "ovTrapOffenderNetAddr"), ("FNET-OPTIVIEW-GENERIC-MIB", "ovTrapOffenderSubId"))
probPDUCRCErrors = NotificationType((1, 3, 6, 1, 4, 1, 1226, 2, 1) + (0,12005)).setObjects(("FNET-OPTIVIEW-GENERIC-MIB", "ovTrapAgentSysName"), ("FNET-OPTIVIEW-GENERIC-MIB", "ovTrapSeverity"), ("FNET-OPTIVIEW-GENERIC-MIB", "ovTrapStatus"), ("FNET-OPTIVIEW-GENERIC-MIB", "ovTrapDescription"), ("FNET-OPTIVIEW-GENERIC-MIB", "ovTrapOffenderName"), ("FNET-OPTIVIEW-GENERIC-MIB", "ovTrapOffenderNetAddr"), ("FNET-OPTIVIEW-GENERIC-MIB", "ovTrapOffenderSubId"))
probPosLinkDown = NotificationType((1, 3, 6, 1, 4, 1, 1226, 2, 1) + (0,12006)).setObjects(("FNET-OPTIVIEW-GENERIC-MIB", "ovTrapAgentSysName"), ("FNET-OPTIVIEW-GENERIC-MIB", "ovTrapSeverity"), ("FNET-OPTIVIEW-GENERIC-MIB", "ovTrapStatus"), ("FNET-OPTIVIEW-GENERIC-MIB", "ovTrapDescription"), ("FNET-OPTIVIEW-GENERIC-MIB", "ovTrapOffenderName"), ("FNET-OPTIVIEW-GENERIC-MIB", "ovTrapOffenderNetAddr"), ("FNET-OPTIVIEW-GENERIC-MIB", "ovTrapOffenderSubId"))
probPosErrorsDetected = NotificationType((1, 3, 6, 1, 4, 1, 1226, 2, 1) + (0,12007)).setObjects(("FNET-OPTIVIEW-GENERIC-MIB", "ovTrapAgentSysName"), ("FNET-OPTIVIEW-GENERIC-MIB", "ovTrapSeverity"), ("FNET-OPTIVIEW-GENERIC-MIB", "ovTrapStatus"), ("FNET-OPTIVIEW-GENERIC-MIB", "ovTrapDescription"), ("FNET-OPTIVIEW-GENERIC-MIB", "ovTrapOffenderName"), ("FNET-OPTIVIEW-GENERIC-MIB", "ovTrapOffenderNetAddr"), ("FNET-OPTIVIEW-GENERIC-MIB", "ovTrapOffenderSubId"))
probLinkUtilization = NotificationType((1, 3, 6, 1, 4, 1, 1226, 2, 1) + (0,12008)).setObjects(("FNET-OPTIVIEW-GENERIC-MIB", "ovTrapAgentSysName"), ("FNET-OPTIVIEW-GENERIC-MIB", "ovTrapSeverity"), ("FNET-OPTIVIEW-GENERIC-MIB", "ovTrapStatus"), ("FNET-OPTIVIEW-GENERIC-MIB", "ovTrapDescription"), ("FNET-OPTIVIEW-GENERIC-MIB", "ovTrapOffenderName"), ("FNET-OPTIVIEW-GENERIC-MIB", "ovTrapOffenderNetAddr"), ("FNET-OPTIVIEW-GENERIC-MIB", "ovTrapOffenderSubId"))
probDNSServerNoResp = NotificationType((1, 3, 6, 1, 4, 1, 1226, 2, 1) + (0,12009)).setObjects(("FNET-OPTIVIEW-GENERIC-MIB", "ovTrapAgentSysName"), ("FNET-OPTIVIEW-GENERIC-MIB", "ovTrapSeverity"), ("FNET-OPTIVIEW-GENERIC-MIB", "ovTrapStatus"), ("FNET-OPTIVIEW-GENERIC-MIB", "ovTrapDescription"), ("FNET-OPTIVIEW-GENERIC-MIB", "ovTrapOffenderName"), ("FNET-OPTIVIEW-GENERIC-MIB", "ovTrapOffenderNetAddr"), ("FNET-OPTIVIEW-GENERIC-MIB", "ovTrapOffenderSubId"))
probDNSServerNowUsing = NotificationType((1, 3, 6, 1, 4, 1, 1226, 2, 1) + (0,12010)).setObjects(("FNET-OPTIVIEW-GENERIC-MIB", "ovTrapAgentSysName"), ("FNET-OPTIVIEW-GENERIC-MIB", "ovTrapSeverity"), ("FNET-OPTIVIEW-GENERIC-MIB", "ovTrapStatus"), ("FNET-OPTIVIEW-GENERIC-MIB", "ovTrapDescription"), ("FNET-OPTIVIEW-GENERIC-MIB", "ovTrapOffenderName"), ("FNET-OPTIVIEW-GENERIC-MIB", "ovTrapOffenderNetAddr"), ("FNET-OPTIVIEW-GENERIC-MIB", "ovTrapOffenderSubId"))
probLostDHCPLease = NotificationType((1, 3, 6, 1, 4, 1, 1226, 2, 1) + (0,12011)).setObjects(("FNET-OPTIVIEW-GENERIC-MIB", "ovTrapAgentSysName"), ("FNET-OPTIVIEW-GENERIC-MIB", "ovTrapSeverity"), ("FNET-OPTIVIEW-GENERIC-MIB", "ovTrapStatus"), ("FNET-OPTIVIEW-GENERIC-MIB", "ovTrapDescription"), ("FNET-OPTIVIEW-GENERIC-MIB", "ovTrapOffenderName"), ("FNET-OPTIVIEW-GENERIC-MIB", "ovTrapOffenderNetAddr"), ("FNET-OPTIVIEW-GENERIC-MIB", "ovTrapOffenderSubId"))
probDefaultRouterNoResp = NotificationType((1, 3, 6, 1, 4, 1, 1226, 2, 1) + (0,12012)).setObjects(("FNET-OPTIVIEW-GENERIC-MIB", "ovTrapAgentSysName"), ("FNET-OPTIVIEW-GENERIC-MIB", "ovTrapSeverity"), ("FNET-OPTIVIEW-GENERIC-MIB", "ovTrapStatus"), ("FNET-OPTIVIEW-GENERIC-MIB", "ovTrapDescription"), ("FNET-OPTIVIEW-GENERIC-MIB", "ovTrapOffenderName"), ("FNET-OPTIVIEW-GENERIC-MIB", "ovTrapOffenderNetAddr"), ("FNET-OPTIVIEW-GENERIC-MIB", "ovTrapOffenderSubId"))
probDiscoveryFull = NotificationType((1, 3, 6, 1, 4, 1, 1226, 2, 1) + (0,12013)).setObjects(("FNET-OPTIVIEW-GENERIC-MIB", "ovTrapAgentSysName"), ("FNET-OPTIVIEW-GENERIC-MIB", "ovTrapSeverity"), ("FNET-OPTIVIEW-GENERIC-MIB", "ovTrapStatus"), ("FNET-OPTIVIEW-GENERIC-MIB", "ovTrapDescription"), ("FNET-OPTIVIEW-GENERIC-MIB", "ovTrapOffenderName"), ("FNET-OPTIVIEW-GENERIC-MIB", "ovTrapOffenderNetAddr"), ("FNET-OPTIVIEW-GENERIC-MIB", "ovTrapOffenderSubId"))
probClearCounts = NotificationType((1, 3, 6, 1, 4, 1, 1226, 2, 1) + (0,12014)).setObjects(("FNET-OPTIVIEW-GENERIC-MIB", "ovTrapAgentSysName"), ("FNET-OPTIVIEW-GENERIC-MIB", "ovTrapSeverity"), ("FNET-OPTIVIEW-GENERIC-MIB", "ovTrapStatus"), ("FNET-OPTIVIEW-GENERIC-MIB", "ovTrapDescription"), ("FNET-OPTIVIEW-GENERIC-MIB", "ovTrapOffenderName"), ("FNET-OPTIVIEW-GENERIC-MIB", "ovTrapOffenderNetAddr"), ("FNET-OPTIVIEW-GENERIC-MIB", "ovTrapOffenderSubId"))
probDS1LinkDown = NotificationType((1, 3, 6, 1, 4, 1, 1226, 2, 1) + (0,12015)).setObjects(("FNET-OPTIVIEW-GENERIC-MIB", "ovTrapAgentSysName"), ("FNET-OPTIVIEW-GENERIC-MIB", "ovTrapSeverity"), ("FNET-OPTIVIEW-GENERIC-MIB", "ovTrapStatus"), ("FNET-OPTIVIEW-GENERIC-MIB", "ovTrapDescription"), ("FNET-OPTIVIEW-GENERIC-MIB", "ovTrapOffenderName"), ("FNET-OPTIVIEW-GENERIC-MIB", "ovTrapOffenderNetAddr"), ("FNET-OPTIVIEW-GENERIC-MIB", "ovTrapOffenderSubId"))
probDS1Errors = NotificationType((1, 3, 6, 1, 4, 1, 1226, 2, 1) + (0,12016)).setObjects(("FNET-OPTIVIEW-GENERIC-MIB", "ovTrapAgentSysName"), ("FNET-OPTIVIEW-GENERIC-MIB", "ovTrapSeverity"), ("FNET-OPTIVIEW-GENERIC-MIB", "ovTrapStatus"), ("FNET-OPTIVIEW-GENERIC-MIB", "ovTrapDescription"), ("FNET-OPTIVIEW-GENERIC-MIB", "ovTrapOffenderName"), ("FNET-OPTIVIEW-GENERIC-MIB", "ovTrapOffenderNetAddr"), ("FNET-OPTIVIEW-GENERIC-MIB", "ovTrapOffenderSubId"))
probDS1Alarms = NotificationType((1, 3, 6, 1, 4, 1, 1226, 2, 1) + (0,12017)).setObjects(("FNET-OPTIVIEW-GENERIC-MIB", "ovTrapAgentSysName"), ("FNET-OPTIVIEW-GENERIC-MIB", "ovTrapSeverity"), ("FNET-OPTIVIEW-GENERIC-MIB", "ovTrapStatus"), ("FNET-OPTIVIEW-GENERIC-MIB", "ovTrapDescription"), ("FNET-OPTIVIEW-GENERIC-MIB", "ovTrapOffenderName"), ("FNET-OPTIVIEW-GENERIC-MIB", "ovTrapOffenderNetAddr"), ("FNET-OPTIVIEW-GENERIC-MIB", "ovTrapOffenderSubId"))
probDS3LinkDown = NotificationType((1, 3, 6, 1, 4, 1, 1226, 2, 1) + (0,12018)).setObjects(("FNET-OPTIVIEW-GENERIC-MIB", "ovTrapAgentSysName"), ("FNET-OPTIVIEW-GENERIC-MIB", "ovTrapSeverity"), ("FNET-OPTIVIEW-GENERIC-MIB", "ovTrapStatus"), ("FNET-OPTIVIEW-GENERIC-MIB", "ovTrapDescription"), ("FNET-OPTIVIEW-GENERIC-MIB", "ovTrapOffenderName"), ("FNET-OPTIVIEW-GENERIC-MIB", "ovTrapOffenderNetAddr"), ("FNET-OPTIVIEW-GENERIC-MIB", "ovTrapOffenderSubId"))
probDS3Errors = NotificationType((1, 3, 6, 1, 4, 1, 1226, 2, 1) + (0,12019)).setObjects(("FNET-OPTIVIEW-GENERIC-MIB", "ovTrapAgentSysName"), ("FNET-OPTIVIEW-GENERIC-MIB", "ovTrapSeverity"), ("FNET-OPTIVIEW-GENERIC-MIB", "ovTrapStatus"), ("FNET-OPTIVIEW-GENERIC-MIB", "ovTrapDescription"), ("FNET-OPTIVIEW-GENERIC-MIB", "ovTrapOffenderName"), ("FNET-OPTIVIEW-GENERIC-MIB", "ovTrapOffenderNetAddr"), ("FNET-OPTIVIEW-GENERIC-MIB", "ovTrapOffenderSubId"))
probDS3Alarms = NotificationType((1, 3, 6, 1, 4, 1, 1226, 2, 1) + (0,12020)).setObjects(("FNET-OPTIVIEW-GENERIC-MIB", "ovTrapAgentSysName"), ("FNET-OPTIVIEW-GENERIC-MIB", "ovTrapSeverity"), ("FNET-OPTIVIEW-GENERIC-MIB", "ovTrapStatus"), ("FNET-OPTIVIEW-GENERIC-MIB", "ovTrapDescription"), ("FNET-OPTIVIEW-GENERIC-MIB", "ovTrapOffenderName"), ("FNET-OPTIVIEW-GENERIC-MIB", "ovTrapOffenderNetAddr"), ("FNET-OPTIVIEW-GENERIC-MIB", "ovTrapOffenderSubId"))
probFrLmiLinkDown = NotificationType((1, 3, 6, 1, 4, 1, 1226, 2, 1) + (0,12021)).setObjects(("FNET-OPTIVIEW-GENERIC-MIB", "ovTrapAgentSysName"), ("FNET-OPTIVIEW-GENERIC-MIB", "ovTrapSeverity"), ("FNET-OPTIVIEW-GENERIC-MIB", "ovTrapStatus"), ("FNET-OPTIVIEW-GENERIC-MIB", "ovTrapDescription"), ("FNET-OPTIVIEW-GENERIC-MIB", "ovTrapOffenderName"), ("FNET-OPTIVIEW-GENERIC-MIB", "ovTrapOffenderNetAddr"), ("FNET-OPTIVIEW-GENERIC-MIB", "ovTrapOffenderSubId"))
probFrLmiErrors = NotificationType((1, 3, 6, 1, 4, 1, 1226, 2, 1) + (0,12022)).setObjects(("FNET-OPTIVIEW-GENERIC-MIB", "ovTrapAgentSysName"), ("FNET-OPTIVIEW-GENERIC-MIB", "ovTrapSeverity"), ("FNET-OPTIVIEW-GENERIC-MIB", "ovTrapStatus"), ("FNET-OPTIVIEW-GENERIC-MIB", "ovTrapDescription"), ("FNET-OPTIVIEW-GENERIC-MIB", "ovTrapOffenderName"), ("FNET-OPTIVIEW-GENERIC-MIB", "ovTrapOffenderNetAddr"), ("FNET-OPTIVIEW-GENERIC-MIB", "ovTrapOffenderSubId"))
probFrErrorsDetected = NotificationType((1, 3, 6, 1, 4, 1, 1226, 2, 1) + (0,12023)).setObjects(("FNET-OPTIVIEW-GENERIC-MIB", "ovTrapAgentSysName"), ("FNET-OPTIVIEW-GENERIC-MIB", "ovTrapSeverity"), ("FNET-OPTIVIEW-GENERIC-MIB", "ovTrapStatus"), ("FNET-OPTIVIEW-GENERIC-MIB", "ovTrapDescription"), ("FNET-OPTIVIEW-GENERIC-MIB", "ovTrapOffenderName"), ("FNET-OPTIVIEW-GENERIC-MIB", "ovTrapOffenderNetAddr"), ("FNET-OPTIVIEW-GENERIC-MIB", "ovTrapOffenderSubId"))
probVcDown = NotificationType((1, 3, 6, 1, 4, 1, 1226, 2, 1) + (0,12024)).setObjects(("FNET-OPTIVIEW-GENERIC-MIB", "ovTrapAgentSysName"), ("FNET-OPTIVIEW-GENERIC-MIB", "ovTrapSeverity"), ("FNET-OPTIVIEW-GENERIC-MIB", "ovTrapStatus"), ("FNET-OPTIVIEW-GENERIC-MIB", "ovTrapDescription"), ("FNET-OPTIVIEW-GENERIC-MIB", "ovTrapOffenderName"), ("FNET-OPTIVIEW-GENERIC-MIB", "ovTrapOffenderNetAddr"), ("FNET-OPTIVIEW-GENERIC-MIB", "ovTrapOffenderSubId"))
probInvalidDlci = NotificationType((1, 3, 6, 1, 4, 1, 1226, 2, 1) + (0,12025)).setObjects(("FNET-OPTIVIEW-GENERIC-MIB", "ovTrapAgentSysName"), ("FNET-OPTIVIEW-GENERIC-MIB", "ovTrapSeverity"), ("FNET-OPTIVIEW-GENERIC-MIB", "ovTrapStatus"), ("FNET-OPTIVIEW-GENERIC-MIB", "ovTrapDescription"), ("FNET-OPTIVIEW-GENERIC-MIB", "ovTrapOffenderName"), ("FNET-OPTIVIEW-GENERIC-MIB", "ovTrapOffenderNetAddr"), ("FNET-OPTIVIEW-GENERIC-MIB", "ovTrapOffenderSubId"))
probFrDEUnderCIRUtilization = NotificationType((1, 3, 6, 1, 4, 1, 1226, 2, 1) + (0,12026)).setObjects(("FNET-OPTIVIEW-GENERIC-MIB", "ovTrapAgentSysName"), ("FNET-OPTIVIEW-GENERIC-MIB", "ovTrapSeverity"), ("FNET-OPTIVIEW-GENERIC-MIB", "ovTrapStatus"), ("FNET-OPTIVIEW-GENERIC-MIB", "ovTrapDescription"), ("FNET-OPTIVIEW-GENERIC-MIB", "ovTrapOffenderName"), ("FNET-OPTIVIEW-GENERIC-MIB", "ovTrapOffenderNetAddr"), ("FNET-OPTIVIEW-GENERIC-MIB", "ovTrapOffenderSubId"))
probHdlcLinkDown = NotificationType((1, 3, 6, 1, 4, 1, 1226, 2, 1) + (0,12027)).setObjects(("FNET-OPTIVIEW-GENERIC-MIB", "ovTrapAgentSysName"), ("FNET-OPTIVIEW-GENERIC-MIB", "ovTrapSeverity"), ("FNET-OPTIVIEW-GENERIC-MIB", "ovTrapStatus"), ("FNET-OPTIVIEW-GENERIC-MIB", "ovTrapDescription"), ("FNET-OPTIVIEW-GENERIC-MIB", "ovTrapOffenderName"), ("FNET-OPTIVIEW-GENERIC-MIB", "ovTrapOffenderNetAddr"), ("FNET-OPTIVIEW-GENERIC-MIB", "ovTrapOffenderSubId"))
probHdlcErrorsDetected = NotificationType((1, 3, 6, 1, 4, 1, 1226, 2, 1) + (0,12028)).setObjects(("FNET-OPTIVIEW-GENERIC-MIB", "ovTrapAgentSysName"), ("FNET-OPTIVIEW-GENERIC-MIB", "ovTrapSeverity"), ("FNET-OPTIVIEW-GENERIC-MIB", "ovTrapStatus"), ("FNET-OPTIVIEW-GENERIC-MIB", "ovTrapDescription"), ("FNET-OPTIVIEW-GENERIC-MIB", "ovTrapOffenderName"), ("FNET-OPTIVIEW-GENERIC-MIB", "ovTrapOffenderNetAddr"), ("FNET-OPTIVIEW-GENERIC-MIB", "ovTrapOffenderSubId"))
probFrDteDceReversed = NotificationType((1, 3, 6, 1, 4, 1, 1226, 2, 1) + (0,12029)).setObjects(("FNET-OPTIVIEW-GENERIC-MIB", "ovTrapAgentSysName"), ("FNET-OPTIVIEW-GENERIC-MIB", "ovTrapSeverity"), ("FNET-OPTIVIEW-GENERIC-MIB", "ovTrapStatus"), ("FNET-OPTIVIEW-GENERIC-MIB", "ovTrapDescription"), ("FNET-OPTIVIEW-GENERIC-MIB", "ovTrapOffenderName"), ("FNET-OPTIVIEW-GENERIC-MIB", "ovTrapOffenderNetAddr"), ("FNET-OPTIVIEW-GENERIC-MIB", "ovTrapOffenderSubId"))
probKeyDevPingLatency = NotificationType((1, 3, 6, 1, 4, 1, 1226, 2, 1) + (0,12030)).setObjects(("FNET-OPTIVIEW-GENERIC-MIB", "ovTrapAgentSysName"), ("FNET-OPTIVIEW-GENERIC-MIB", "ovTrapSeverity"), ("FNET-OPTIVIEW-GENERIC-MIB", "ovTrapStatus"), ("FNET-OPTIVIEW-GENERIC-MIB", "ovTrapDescription"), ("FNET-OPTIVIEW-GENERIC-MIB", "ovTrapOffenderName"), ("FNET-OPTIVIEW-GENERIC-MIB", "ovTrapOffenderNetAddr"), ("FNET-OPTIVIEW-GENERIC-MIB", "ovTrapOffenderSubId"))
mibBuilder.exportSymbols("FNET-OPTIVIEW-WAN-MIB", probFrDteDceReversed=probFrDteDceReversed, probKeyDevPingLatency=probKeyDevPingLatency, probAtmLinkDown=probAtmLinkDown, probDefaultRouterNoResp=probDefaultRouterNoResp, probDS3LinkDown=probDS3LinkDown, probAtmErrors=probAtmErrors, probVcDown=probVcDown, probDNSServerNoResp=probDNSServerNoResp, probDS3Alarms=probDS3Alarms, probPDUCRCErrors=probPDUCRCErrors, probFrLmiErrors=probFrLmiErrors, probClearCounts=probClearCounts, probFrDEUnderCIRUtilization=probFrDEUnderCIRUtilization, probInvalidDlci=probInvalidDlci, probDS1Alarms=probDS1Alarms, probFrErrorsDetected=probFrErrorsDetected, probPosLinkDown=probPosLinkDown, probLinkUtilization=probLinkUtilization, probLostDHCPLease=probLostDHCPLease, probDS1Errors=probDS1Errors, probDiscoveryFull=probDiscoveryFull, probSonetLinkDown=probSonetLinkDown, probPosErrorsDetected=probPosErrorsDetected, probHdlcLinkDown=probHdlcLinkDown, probSonetErrors=probSonetErrors, probDNSServerNowUsing=probDNSServerNowUsing, probSonetAlarms=probSonetAlarms, probHdlcErrorsDetected=probHdlcErrorsDetected, probDS3Errors=probDS3Errors, probFrLmiLinkDown=probFrLmiLinkDown, probDS1LinkDown=probDS1LinkDown)
| (integer, octet_string, object_identifier) = mibBuilder.importSymbols('ASN1', 'Integer', 'OctetString', 'ObjectIdentifier')
(named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues')
(constraints_intersection, single_value_constraint, value_size_constraint, constraints_union, value_range_constraint) = mibBuilder.importSymbols('ASN1-REFINEMENT', 'ConstraintsIntersection', 'SingleValueConstraint', 'ValueSizeConstraint', 'ConstraintsUnion', 'ValueRangeConstraint')
(fnet_opti_view_generic,) = mibBuilder.importSymbols('FNET-GLOBAL-REG', 'fnetOptiViewGeneric')
(ov_trap_description, ov_trap_offender_sub_id, ov_trap_severity, ov_trap_agent_sys_name, ov_trap_offender_name, ov_trap_status, ov_trap_offender_net_addr) = mibBuilder.importSymbols('FNET-OPTIVIEW-GENERIC-MIB', 'ovTrapDescription', 'ovTrapOffenderSubId', 'ovTrapSeverity', 'ovTrapAgentSysName', 'ovTrapOffenderName', 'ovTrapStatus', 'ovTrapOffenderNetAddr')
(module_compliance, notification_group) = mibBuilder.importSymbols('SNMPv2-CONF', 'ModuleCompliance', 'NotificationGroup')
(integer32, mib_identifier, counter64, bits, counter32, unsigned32, iso, mib_scalar, mib_table, mib_table_row, mib_table_column, module_identity, object_identity, time_ticks, gauge32, notification_type, notification_type, ip_address) = mibBuilder.importSymbols('SNMPv2-SMI', 'Integer32', 'MibIdentifier', 'Counter64', 'Bits', 'Counter32', 'Unsigned32', 'iso', 'MibScalar', 'MibTable', 'MibTableRow', 'MibTableColumn', 'ModuleIdentity', 'ObjectIdentity', 'TimeTicks', 'Gauge32', 'NotificationType', 'NotificationType', 'IpAddress')
(display_string, textual_convention) = mibBuilder.importSymbols('SNMPv2-TC', 'DisplayString', 'TextualConvention')
prob_sonet_link_down = notification_type((1, 3, 6, 1, 4, 1, 1226, 2, 1) + (0, 12000)).setObjects(('FNET-OPTIVIEW-GENERIC-MIB', 'ovTrapAgentSysName'), ('FNET-OPTIVIEW-GENERIC-MIB', 'ovTrapSeverity'), ('FNET-OPTIVIEW-GENERIC-MIB', 'ovTrapStatus'), ('FNET-OPTIVIEW-GENERIC-MIB', 'ovTrapDescription'), ('FNET-OPTIVIEW-GENERIC-MIB', 'ovTrapOffenderName'), ('FNET-OPTIVIEW-GENERIC-MIB', 'ovTrapOffenderNetAddr'), ('FNET-OPTIVIEW-GENERIC-MIB', 'ovTrapOffenderSubId'))
prob_sonet_errors = notification_type((1, 3, 6, 1, 4, 1, 1226, 2, 1) + (0, 12001)).setObjects(('FNET-OPTIVIEW-GENERIC-MIB', 'ovTrapAgentSysName'), ('FNET-OPTIVIEW-GENERIC-MIB', 'ovTrapSeverity'), ('FNET-OPTIVIEW-GENERIC-MIB', 'ovTrapStatus'), ('FNET-OPTIVIEW-GENERIC-MIB', 'ovTrapDescription'), ('FNET-OPTIVIEW-GENERIC-MIB', 'ovTrapOffenderName'), ('FNET-OPTIVIEW-GENERIC-MIB', 'ovTrapOffenderNetAddr'), ('FNET-OPTIVIEW-GENERIC-MIB', 'ovTrapOffenderSubId'))
prob_sonet_alarms = notification_type((1, 3, 6, 1, 4, 1, 1226, 2, 1) + (0, 12002)).setObjects(('FNET-OPTIVIEW-GENERIC-MIB', 'ovTrapAgentSysName'), ('FNET-OPTIVIEW-GENERIC-MIB', 'ovTrapSeverity'), ('FNET-OPTIVIEW-GENERIC-MIB', 'ovTrapStatus'), ('FNET-OPTIVIEW-GENERIC-MIB', 'ovTrapDescription'), ('FNET-OPTIVIEW-GENERIC-MIB', 'ovTrapOffenderName'), ('FNET-OPTIVIEW-GENERIC-MIB', 'ovTrapOffenderNetAddr'), ('FNET-OPTIVIEW-GENERIC-MIB', 'ovTrapOffenderSubId'))
prob_atm_link_down = notification_type((1, 3, 6, 1, 4, 1, 1226, 2, 1) + (0, 12003)).setObjects(('FNET-OPTIVIEW-GENERIC-MIB', 'ovTrapAgentSysName'), ('FNET-OPTIVIEW-GENERIC-MIB', 'ovTrapSeverity'), ('FNET-OPTIVIEW-GENERIC-MIB', 'ovTrapStatus'), ('FNET-OPTIVIEW-GENERIC-MIB', 'ovTrapDescription'), ('FNET-OPTIVIEW-GENERIC-MIB', 'ovTrapOffenderName'), ('FNET-OPTIVIEW-GENERIC-MIB', 'ovTrapOffenderNetAddr'), ('FNET-OPTIVIEW-GENERIC-MIB', 'ovTrapOffenderSubId'))
prob_atm_errors = notification_type((1, 3, 6, 1, 4, 1, 1226, 2, 1) + (0, 12004)).setObjects(('FNET-OPTIVIEW-GENERIC-MIB', 'ovTrapAgentSysName'), ('FNET-OPTIVIEW-GENERIC-MIB', 'ovTrapSeverity'), ('FNET-OPTIVIEW-GENERIC-MIB', 'ovTrapStatus'), ('FNET-OPTIVIEW-GENERIC-MIB', 'ovTrapDescription'), ('FNET-OPTIVIEW-GENERIC-MIB', 'ovTrapOffenderName'), ('FNET-OPTIVIEW-GENERIC-MIB', 'ovTrapOffenderNetAddr'), ('FNET-OPTIVIEW-GENERIC-MIB', 'ovTrapOffenderSubId'))
prob_pducrc_errors = notification_type((1, 3, 6, 1, 4, 1, 1226, 2, 1) + (0, 12005)).setObjects(('FNET-OPTIVIEW-GENERIC-MIB', 'ovTrapAgentSysName'), ('FNET-OPTIVIEW-GENERIC-MIB', 'ovTrapSeverity'), ('FNET-OPTIVIEW-GENERIC-MIB', 'ovTrapStatus'), ('FNET-OPTIVIEW-GENERIC-MIB', 'ovTrapDescription'), ('FNET-OPTIVIEW-GENERIC-MIB', 'ovTrapOffenderName'), ('FNET-OPTIVIEW-GENERIC-MIB', 'ovTrapOffenderNetAddr'), ('FNET-OPTIVIEW-GENERIC-MIB', 'ovTrapOffenderSubId'))
prob_pos_link_down = notification_type((1, 3, 6, 1, 4, 1, 1226, 2, 1) + (0, 12006)).setObjects(('FNET-OPTIVIEW-GENERIC-MIB', 'ovTrapAgentSysName'), ('FNET-OPTIVIEW-GENERIC-MIB', 'ovTrapSeverity'), ('FNET-OPTIVIEW-GENERIC-MIB', 'ovTrapStatus'), ('FNET-OPTIVIEW-GENERIC-MIB', 'ovTrapDescription'), ('FNET-OPTIVIEW-GENERIC-MIB', 'ovTrapOffenderName'), ('FNET-OPTIVIEW-GENERIC-MIB', 'ovTrapOffenderNetAddr'), ('FNET-OPTIVIEW-GENERIC-MIB', 'ovTrapOffenderSubId'))
prob_pos_errors_detected = notification_type((1, 3, 6, 1, 4, 1, 1226, 2, 1) + (0, 12007)).setObjects(('FNET-OPTIVIEW-GENERIC-MIB', 'ovTrapAgentSysName'), ('FNET-OPTIVIEW-GENERIC-MIB', 'ovTrapSeverity'), ('FNET-OPTIVIEW-GENERIC-MIB', 'ovTrapStatus'), ('FNET-OPTIVIEW-GENERIC-MIB', 'ovTrapDescription'), ('FNET-OPTIVIEW-GENERIC-MIB', 'ovTrapOffenderName'), ('FNET-OPTIVIEW-GENERIC-MIB', 'ovTrapOffenderNetAddr'), ('FNET-OPTIVIEW-GENERIC-MIB', 'ovTrapOffenderSubId'))
prob_link_utilization = notification_type((1, 3, 6, 1, 4, 1, 1226, 2, 1) + (0, 12008)).setObjects(('FNET-OPTIVIEW-GENERIC-MIB', 'ovTrapAgentSysName'), ('FNET-OPTIVIEW-GENERIC-MIB', 'ovTrapSeverity'), ('FNET-OPTIVIEW-GENERIC-MIB', 'ovTrapStatus'), ('FNET-OPTIVIEW-GENERIC-MIB', 'ovTrapDescription'), ('FNET-OPTIVIEW-GENERIC-MIB', 'ovTrapOffenderName'), ('FNET-OPTIVIEW-GENERIC-MIB', 'ovTrapOffenderNetAddr'), ('FNET-OPTIVIEW-GENERIC-MIB', 'ovTrapOffenderSubId'))
prob_dns_server_no_resp = notification_type((1, 3, 6, 1, 4, 1, 1226, 2, 1) + (0, 12009)).setObjects(('FNET-OPTIVIEW-GENERIC-MIB', 'ovTrapAgentSysName'), ('FNET-OPTIVIEW-GENERIC-MIB', 'ovTrapSeverity'), ('FNET-OPTIVIEW-GENERIC-MIB', 'ovTrapStatus'), ('FNET-OPTIVIEW-GENERIC-MIB', 'ovTrapDescription'), ('FNET-OPTIVIEW-GENERIC-MIB', 'ovTrapOffenderName'), ('FNET-OPTIVIEW-GENERIC-MIB', 'ovTrapOffenderNetAddr'), ('FNET-OPTIVIEW-GENERIC-MIB', 'ovTrapOffenderSubId'))
prob_dns_server_now_using = notification_type((1, 3, 6, 1, 4, 1, 1226, 2, 1) + (0, 12010)).setObjects(('FNET-OPTIVIEW-GENERIC-MIB', 'ovTrapAgentSysName'), ('FNET-OPTIVIEW-GENERIC-MIB', 'ovTrapSeverity'), ('FNET-OPTIVIEW-GENERIC-MIB', 'ovTrapStatus'), ('FNET-OPTIVIEW-GENERIC-MIB', 'ovTrapDescription'), ('FNET-OPTIVIEW-GENERIC-MIB', 'ovTrapOffenderName'), ('FNET-OPTIVIEW-GENERIC-MIB', 'ovTrapOffenderNetAddr'), ('FNET-OPTIVIEW-GENERIC-MIB', 'ovTrapOffenderSubId'))
prob_lost_dhcp_lease = notification_type((1, 3, 6, 1, 4, 1, 1226, 2, 1) + (0, 12011)).setObjects(('FNET-OPTIVIEW-GENERIC-MIB', 'ovTrapAgentSysName'), ('FNET-OPTIVIEW-GENERIC-MIB', 'ovTrapSeverity'), ('FNET-OPTIVIEW-GENERIC-MIB', 'ovTrapStatus'), ('FNET-OPTIVIEW-GENERIC-MIB', 'ovTrapDescription'), ('FNET-OPTIVIEW-GENERIC-MIB', 'ovTrapOffenderName'), ('FNET-OPTIVIEW-GENERIC-MIB', 'ovTrapOffenderNetAddr'), ('FNET-OPTIVIEW-GENERIC-MIB', 'ovTrapOffenderSubId'))
prob_default_router_no_resp = notification_type((1, 3, 6, 1, 4, 1, 1226, 2, 1) + (0, 12012)).setObjects(('FNET-OPTIVIEW-GENERIC-MIB', 'ovTrapAgentSysName'), ('FNET-OPTIVIEW-GENERIC-MIB', 'ovTrapSeverity'), ('FNET-OPTIVIEW-GENERIC-MIB', 'ovTrapStatus'), ('FNET-OPTIVIEW-GENERIC-MIB', 'ovTrapDescription'), ('FNET-OPTIVIEW-GENERIC-MIB', 'ovTrapOffenderName'), ('FNET-OPTIVIEW-GENERIC-MIB', 'ovTrapOffenderNetAddr'), ('FNET-OPTIVIEW-GENERIC-MIB', 'ovTrapOffenderSubId'))
prob_discovery_full = notification_type((1, 3, 6, 1, 4, 1, 1226, 2, 1) + (0, 12013)).setObjects(('FNET-OPTIVIEW-GENERIC-MIB', 'ovTrapAgentSysName'), ('FNET-OPTIVIEW-GENERIC-MIB', 'ovTrapSeverity'), ('FNET-OPTIVIEW-GENERIC-MIB', 'ovTrapStatus'), ('FNET-OPTIVIEW-GENERIC-MIB', 'ovTrapDescription'), ('FNET-OPTIVIEW-GENERIC-MIB', 'ovTrapOffenderName'), ('FNET-OPTIVIEW-GENERIC-MIB', 'ovTrapOffenderNetAddr'), ('FNET-OPTIVIEW-GENERIC-MIB', 'ovTrapOffenderSubId'))
prob_clear_counts = notification_type((1, 3, 6, 1, 4, 1, 1226, 2, 1) + (0, 12014)).setObjects(('FNET-OPTIVIEW-GENERIC-MIB', 'ovTrapAgentSysName'), ('FNET-OPTIVIEW-GENERIC-MIB', 'ovTrapSeverity'), ('FNET-OPTIVIEW-GENERIC-MIB', 'ovTrapStatus'), ('FNET-OPTIVIEW-GENERIC-MIB', 'ovTrapDescription'), ('FNET-OPTIVIEW-GENERIC-MIB', 'ovTrapOffenderName'), ('FNET-OPTIVIEW-GENERIC-MIB', 'ovTrapOffenderNetAddr'), ('FNET-OPTIVIEW-GENERIC-MIB', 'ovTrapOffenderSubId'))
prob_ds1_link_down = notification_type((1, 3, 6, 1, 4, 1, 1226, 2, 1) + (0, 12015)).setObjects(('FNET-OPTIVIEW-GENERIC-MIB', 'ovTrapAgentSysName'), ('FNET-OPTIVIEW-GENERIC-MIB', 'ovTrapSeverity'), ('FNET-OPTIVIEW-GENERIC-MIB', 'ovTrapStatus'), ('FNET-OPTIVIEW-GENERIC-MIB', 'ovTrapDescription'), ('FNET-OPTIVIEW-GENERIC-MIB', 'ovTrapOffenderName'), ('FNET-OPTIVIEW-GENERIC-MIB', 'ovTrapOffenderNetAddr'), ('FNET-OPTIVIEW-GENERIC-MIB', 'ovTrapOffenderSubId'))
prob_ds1_errors = notification_type((1, 3, 6, 1, 4, 1, 1226, 2, 1) + (0, 12016)).setObjects(('FNET-OPTIVIEW-GENERIC-MIB', 'ovTrapAgentSysName'), ('FNET-OPTIVIEW-GENERIC-MIB', 'ovTrapSeverity'), ('FNET-OPTIVIEW-GENERIC-MIB', 'ovTrapStatus'), ('FNET-OPTIVIEW-GENERIC-MIB', 'ovTrapDescription'), ('FNET-OPTIVIEW-GENERIC-MIB', 'ovTrapOffenderName'), ('FNET-OPTIVIEW-GENERIC-MIB', 'ovTrapOffenderNetAddr'), ('FNET-OPTIVIEW-GENERIC-MIB', 'ovTrapOffenderSubId'))
prob_ds1_alarms = notification_type((1, 3, 6, 1, 4, 1, 1226, 2, 1) + (0, 12017)).setObjects(('FNET-OPTIVIEW-GENERIC-MIB', 'ovTrapAgentSysName'), ('FNET-OPTIVIEW-GENERIC-MIB', 'ovTrapSeverity'), ('FNET-OPTIVIEW-GENERIC-MIB', 'ovTrapStatus'), ('FNET-OPTIVIEW-GENERIC-MIB', 'ovTrapDescription'), ('FNET-OPTIVIEW-GENERIC-MIB', 'ovTrapOffenderName'), ('FNET-OPTIVIEW-GENERIC-MIB', 'ovTrapOffenderNetAddr'), ('FNET-OPTIVIEW-GENERIC-MIB', 'ovTrapOffenderSubId'))
prob_ds3_link_down = notification_type((1, 3, 6, 1, 4, 1, 1226, 2, 1) + (0, 12018)).setObjects(('FNET-OPTIVIEW-GENERIC-MIB', 'ovTrapAgentSysName'), ('FNET-OPTIVIEW-GENERIC-MIB', 'ovTrapSeverity'), ('FNET-OPTIVIEW-GENERIC-MIB', 'ovTrapStatus'), ('FNET-OPTIVIEW-GENERIC-MIB', 'ovTrapDescription'), ('FNET-OPTIVIEW-GENERIC-MIB', 'ovTrapOffenderName'), ('FNET-OPTIVIEW-GENERIC-MIB', 'ovTrapOffenderNetAddr'), ('FNET-OPTIVIEW-GENERIC-MIB', 'ovTrapOffenderSubId'))
prob_ds3_errors = notification_type((1, 3, 6, 1, 4, 1, 1226, 2, 1) + (0, 12019)).setObjects(('FNET-OPTIVIEW-GENERIC-MIB', 'ovTrapAgentSysName'), ('FNET-OPTIVIEW-GENERIC-MIB', 'ovTrapSeverity'), ('FNET-OPTIVIEW-GENERIC-MIB', 'ovTrapStatus'), ('FNET-OPTIVIEW-GENERIC-MIB', 'ovTrapDescription'), ('FNET-OPTIVIEW-GENERIC-MIB', 'ovTrapOffenderName'), ('FNET-OPTIVIEW-GENERIC-MIB', 'ovTrapOffenderNetAddr'), ('FNET-OPTIVIEW-GENERIC-MIB', 'ovTrapOffenderSubId'))
prob_ds3_alarms = notification_type((1, 3, 6, 1, 4, 1, 1226, 2, 1) + (0, 12020)).setObjects(('FNET-OPTIVIEW-GENERIC-MIB', 'ovTrapAgentSysName'), ('FNET-OPTIVIEW-GENERIC-MIB', 'ovTrapSeverity'), ('FNET-OPTIVIEW-GENERIC-MIB', 'ovTrapStatus'), ('FNET-OPTIVIEW-GENERIC-MIB', 'ovTrapDescription'), ('FNET-OPTIVIEW-GENERIC-MIB', 'ovTrapOffenderName'), ('FNET-OPTIVIEW-GENERIC-MIB', 'ovTrapOffenderNetAddr'), ('FNET-OPTIVIEW-GENERIC-MIB', 'ovTrapOffenderSubId'))
prob_fr_lmi_link_down = notification_type((1, 3, 6, 1, 4, 1, 1226, 2, 1) + (0, 12021)).setObjects(('FNET-OPTIVIEW-GENERIC-MIB', 'ovTrapAgentSysName'), ('FNET-OPTIVIEW-GENERIC-MIB', 'ovTrapSeverity'), ('FNET-OPTIVIEW-GENERIC-MIB', 'ovTrapStatus'), ('FNET-OPTIVIEW-GENERIC-MIB', 'ovTrapDescription'), ('FNET-OPTIVIEW-GENERIC-MIB', 'ovTrapOffenderName'), ('FNET-OPTIVIEW-GENERIC-MIB', 'ovTrapOffenderNetAddr'), ('FNET-OPTIVIEW-GENERIC-MIB', 'ovTrapOffenderSubId'))
prob_fr_lmi_errors = notification_type((1, 3, 6, 1, 4, 1, 1226, 2, 1) + (0, 12022)).setObjects(('FNET-OPTIVIEW-GENERIC-MIB', 'ovTrapAgentSysName'), ('FNET-OPTIVIEW-GENERIC-MIB', 'ovTrapSeverity'), ('FNET-OPTIVIEW-GENERIC-MIB', 'ovTrapStatus'), ('FNET-OPTIVIEW-GENERIC-MIB', 'ovTrapDescription'), ('FNET-OPTIVIEW-GENERIC-MIB', 'ovTrapOffenderName'), ('FNET-OPTIVIEW-GENERIC-MIB', 'ovTrapOffenderNetAddr'), ('FNET-OPTIVIEW-GENERIC-MIB', 'ovTrapOffenderSubId'))
prob_fr_errors_detected = notification_type((1, 3, 6, 1, 4, 1, 1226, 2, 1) + (0, 12023)).setObjects(('FNET-OPTIVIEW-GENERIC-MIB', 'ovTrapAgentSysName'), ('FNET-OPTIVIEW-GENERIC-MIB', 'ovTrapSeverity'), ('FNET-OPTIVIEW-GENERIC-MIB', 'ovTrapStatus'), ('FNET-OPTIVIEW-GENERIC-MIB', 'ovTrapDescription'), ('FNET-OPTIVIEW-GENERIC-MIB', 'ovTrapOffenderName'), ('FNET-OPTIVIEW-GENERIC-MIB', 'ovTrapOffenderNetAddr'), ('FNET-OPTIVIEW-GENERIC-MIB', 'ovTrapOffenderSubId'))
prob_vc_down = notification_type((1, 3, 6, 1, 4, 1, 1226, 2, 1) + (0, 12024)).setObjects(('FNET-OPTIVIEW-GENERIC-MIB', 'ovTrapAgentSysName'), ('FNET-OPTIVIEW-GENERIC-MIB', 'ovTrapSeverity'), ('FNET-OPTIVIEW-GENERIC-MIB', 'ovTrapStatus'), ('FNET-OPTIVIEW-GENERIC-MIB', 'ovTrapDescription'), ('FNET-OPTIVIEW-GENERIC-MIB', 'ovTrapOffenderName'), ('FNET-OPTIVIEW-GENERIC-MIB', 'ovTrapOffenderNetAddr'), ('FNET-OPTIVIEW-GENERIC-MIB', 'ovTrapOffenderSubId'))
prob_invalid_dlci = notification_type((1, 3, 6, 1, 4, 1, 1226, 2, 1) + (0, 12025)).setObjects(('FNET-OPTIVIEW-GENERIC-MIB', 'ovTrapAgentSysName'), ('FNET-OPTIVIEW-GENERIC-MIB', 'ovTrapSeverity'), ('FNET-OPTIVIEW-GENERIC-MIB', 'ovTrapStatus'), ('FNET-OPTIVIEW-GENERIC-MIB', 'ovTrapDescription'), ('FNET-OPTIVIEW-GENERIC-MIB', 'ovTrapOffenderName'), ('FNET-OPTIVIEW-GENERIC-MIB', 'ovTrapOffenderNetAddr'), ('FNET-OPTIVIEW-GENERIC-MIB', 'ovTrapOffenderSubId'))
prob_fr_de_under_cir_utilization = notification_type((1, 3, 6, 1, 4, 1, 1226, 2, 1) + (0, 12026)).setObjects(('FNET-OPTIVIEW-GENERIC-MIB', 'ovTrapAgentSysName'), ('FNET-OPTIVIEW-GENERIC-MIB', 'ovTrapSeverity'), ('FNET-OPTIVIEW-GENERIC-MIB', 'ovTrapStatus'), ('FNET-OPTIVIEW-GENERIC-MIB', 'ovTrapDescription'), ('FNET-OPTIVIEW-GENERIC-MIB', 'ovTrapOffenderName'), ('FNET-OPTIVIEW-GENERIC-MIB', 'ovTrapOffenderNetAddr'), ('FNET-OPTIVIEW-GENERIC-MIB', 'ovTrapOffenderSubId'))
prob_hdlc_link_down = notification_type((1, 3, 6, 1, 4, 1, 1226, 2, 1) + (0, 12027)).setObjects(('FNET-OPTIVIEW-GENERIC-MIB', 'ovTrapAgentSysName'), ('FNET-OPTIVIEW-GENERIC-MIB', 'ovTrapSeverity'), ('FNET-OPTIVIEW-GENERIC-MIB', 'ovTrapStatus'), ('FNET-OPTIVIEW-GENERIC-MIB', 'ovTrapDescription'), ('FNET-OPTIVIEW-GENERIC-MIB', 'ovTrapOffenderName'), ('FNET-OPTIVIEW-GENERIC-MIB', 'ovTrapOffenderNetAddr'), ('FNET-OPTIVIEW-GENERIC-MIB', 'ovTrapOffenderSubId'))
prob_hdlc_errors_detected = notification_type((1, 3, 6, 1, 4, 1, 1226, 2, 1) + (0, 12028)).setObjects(('FNET-OPTIVIEW-GENERIC-MIB', 'ovTrapAgentSysName'), ('FNET-OPTIVIEW-GENERIC-MIB', 'ovTrapSeverity'), ('FNET-OPTIVIEW-GENERIC-MIB', 'ovTrapStatus'), ('FNET-OPTIVIEW-GENERIC-MIB', 'ovTrapDescription'), ('FNET-OPTIVIEW-GENERIC-MIB', 'ovTrapOffenderName'), ('FNET-OPTIVIEW-GENERIC-MIB', 'ovTrapOffenderNetAddr'), ('FNET-OPTIVIEW-GENERIC-MIB', 'ovTrapOffenderSubId'))
prob_fr_dte_dce_reversed = notification_type((1, 3, 6, 1, 4, 1, 1226, 2, 1) + (0, 12029)).setObjects(('FNET-OPTIVIEW-GENERIC-MIB', 'ovTrapAgentSysName'), ('FNET-OPTIVIEW-GENERIC-MIB', 'ovTrapSeverity'), ('FNET-OPTIVIEW-GENERIC-MIB', 'ovTrapStatus'), ('FNET-OPTIVIEW-GENERIC-MIB', 'ovTrapDescription'), ('FNET-OPTIVIEW-GENERIC-MIB', 'ovTrapOffenderName'), ('FNET-OPTIVIEW-GENERIC-MIB', 'ovTrapOffenderNetAddr'), ('FNET-OPTIVIEW-GENERIC-MIB', 'ovTrapOffenderSubId'))
prob_key_dev_ping_latency = notification_type((1, 3, 6, 1, 4, 1, 1226, 2, 1) + (0, 12030)).setObjects(('FNET-OPTIVIEW-GENERIC-MIB', 'ovTrapAgentSysName'), ('FNET-OPTIVIEW-GENERIC-MIB', 'ovTrapSeverity'), ('FNET-OPTIVIEW-GENERIC-MIB', 'ovTrapStatus'), ('FNET-OPTIVIEW-GENERIC-MIB', 'ovTrapDescription'), ('FNET-OPTIVIEW-GENERIC-MIB', 'ovTrapOffenderName'), ('FNET-OPTIVIEW-GENERIC-MIB', 'ovTrapOffenderNetAddr'), ('FNET-OPTIVIEW-GENERIC-MIB', 'ovTrapOffenderSubId'))
mibBuilder.exportSymbols('FNET-OPTIVIEW-WAN-MIB', probFrDteDceReversed=probFrDteDceReversed, probKeyDevPingLatency=probKeyDevPingLatency, probAtmLinkDown=probAtmLinkDown, probDefaultRouterNoResp=probDefaultRouterNoResp, probDS3LinkDown=probDS3LinkDown, probAtmErrors=probAtmErrors, probVcDown=probVcDown, probDNSServerNoResp=probDNSServerNoResp, probDS3Alarms=probDS3Alarms, probPDUCRCErrors=probPDUCRCErrors, probFrLmiErrors=probFrLmiErrors, probClearCounts=probClearCounts, probFrDEUnderCIRUtilization=probFrDEUnderCIRUtilization, probInvalidDlci=probInvalidDlci, probDS1Alarms=probDS1Alarms, probFrErrorsDetected=probFrErrorsDetected, probPosLinkDown=probPosLinkDown, probLinkUtilization=probLinkUtilization, probLostDHCPLease=probLostDHCPLease, probDS1Errors=probDS1Errors, probDiscoveryFull=probDiscoveryFull, probSonetLinkDown=probSonetLinkDown, probPosErrorsDetected=probPosErrorsDetected, probHdlcLinkDown=probHdlcLinkDown, probSonetErrors=probSonetErrors, probDNSServerNowUsing=probDNSServerNowUsing, probSonetAlarms=probSonetAlarms, probHdlcErrorsDetected=probHdlcErrorsDetected, probDS3Errors=probDS3Errors, probFrLmiLinkDown=probFrLmiLinkDown, probDS1LinkDown=probDS1LinkDown) |
n = int (input('Cuantos numeros de fibonacii?'))
i = 0
a, b = 0, 1
while i < n :
print(a)
a, b = b, a+b
i = i + 1 | n = int(input('Cuantos numeros de fibonacii?'))
i = 0
(a, b) = (0, 1)
while i < n:
print(a)
(a, b) = (b, a + b)
i = i + 1 |
#!/usr/bin/env python3
############################################################################################
# #
# Program purpose: Prints letter 'U' to the console. #
# Program Author : Happi Yvan <ivensteinpoker@gmail.com> #
# Creation Date : January 27, 2019 #
# #
############################################################################################
def print_letter_U():
for x in range(6):
print('*', ' ' * 3, '*')
print(('*' * 5).center(7, ' '))
if __name__ == '__main__':
print_letter_U()
| def print_letter_u():
for x in range(6):
print('*', ' ' * 3, '*')
print(('*' * 5).center(7, ' '))
if __name__ == '__main__':
print_letter_u() |
__all__ = ('')
"""
Parent class to keep all statistical queries uniform
"""
class StatisticalTechnique():
def __init__(self, freqmap, latest_freqmap):
self.freqmap = freqmap
self.latest_freqmap = latest_freqmap
self.scores = dict()
def get_name(self):
pass
def process(self):
pass
def get_scores(self):
return self.scores
def get_freqmap(self):
return self.freqmap
def get_latest_freqmap(self):
return self.latest_freqmap | __all__ = ''
'\nParent class to keep all statistical queries uniform\n'
class Statisticaltechnique:
def __init__(self, freqmap, latest_freqmap):
self.freqmap = freqmap
self.latest_freqmap = latest_freqmap
self.scores = dict()
def get_name(self):
pass
def process(self):
pass
def get_scores(self):
return self.scores
def get_freqmap(self):
return self.freqmap
def get_latest_freqmap(self):
return self.latest_freqmap |
def inc(x):
return x + 1
def catcher(event):
print(event.origin_state)
| def inc(x):
return x + 1
def catcher(event):
print(event.origin_state) |
# Created by Egor Kostan.
# GitHub: https://github.com/ikostan
# LinkedIn: https://www.linkedin.com/in/egor-kostan/
def numericals(s):
"""
For each symbol in the string if it's the
first character occurrence, replace it with
a '1', else replace it with the amount of
times you've already seen it.
:param s:
:return:
"""
char_dict = dict()
result = ''
for char in s:
if char in char_dict:
char_dict[char] += 1
else:
char_dict[char] = 1
result += str(char_dict[char])
return result
| def numericals(s):
"""
For each symbol in the string if it's the
first character occurrence, replace it with
a '1', else replace it with the amount of
times you've already seen it.
:param s:
:return:
"""
char_dict = dict()
result = ''
for char in s:
if char in char_dict:
char_dict[char] += 1
else:
char_dict[char] = 1
result += str(char_dict[char])
return result |
with open("original.txt", 'a') as jabber:
for i in range(2, 13):
for j in range(1, 13):
print(f"{j:>2} times {i} is {i * j}", file=jabber)
print("=" * 40, file=jabber)
| with open('original.txt', 'a') as jabber:
for i in range(2, 13):
for j in range(1, 13):
print(f'{j:>2} times {i} is {i * j}', file=jabber)
print('=' * 40, file=jabber) |
def all_descendants(class_object, _memo=None):
if _memo is None:
_memo = {}
elif class_object in _memo:
return
yield class_object
for subclass in class_object.__subclasses__():
for descendant in all_descendants(subclass, _memo):
yield descendant
| def all_descendants(class_object, _memo=None):
if _memo is None:
_memo = {}
elif class_object in _memo:
return
yield class_object
for subclass in class_object.__subclasses__():
for descendant in all_descendants(subclass, _memo):
yield descendant |
# -*- coding: utf-8 -*-
"""
Optimus project for basic.
Contains basic template, assets and settings without i18n enabled.
"""
| """
Optimus project for basic.
Contains basic template, assets and settings without i18n enabled.
""" |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.