content stringlengths 7 1.05M | fixed_cases stringlengths 1 1.28M |
|---|---|
setup(
name='pyroll',
description='cli for simulating the rolling of dice',
author='Philip Z Nevill',
author_email='pznevill.dev@gmail.com',
version='0.1.0',
packages=find_packages(include=['pyroll', 'pyroll.*']),
)
| setup(name='pyroll', description='cli for simulating the rolling of dice', author='Philip Z Nevill', author_email='pznevill.dev@gmail.com', version='0.1.0', packages=find_packages(include=['pyroll', 'pyroll.*'])) |
def calculation(filepath,down,across):
with open(filepath) as file:
rows = [x.strip() for x in file.readlines()]
end = len(rows)
currentrow = 0
currentcolumn = 0
count = 0
while currentrow < (end-1):
currentrow = currentrow+down
currentcolumn = (currentcolumn+across)%len(rows[0])
if rows[currentrow][currentcolumn] == "#":
count+=1
return count
def main(filepath):
a = calculation(filepath,1,1)
b = calculation(filepath,1,3)
c = calculation(filepath,1,5)
d = calculation(filepath,1,7)
e = calculation(filepath,2,1)
print("Part a solution: "+ str(b))
print("Part b solution: "+ str(a*b*c*d*e))
return
| def calculation(filepath, down, across):
with open(filepath) as file:
rows = [x.strip() for x in file.readlines()]
end = len(rows)
currentrow = 0
currentcolumn = 0
count = 0
while currentrow < end - 1:
currentrow = currentrow + down
currentcolumn = (currentcolumn + across) % len(rows[0])
if rows[currentrow][currentcolumn] == '#':
count += 1
return count
def main(filepath):
a = calculation(filepath, 1, 1)
b = calculation(filepath, 1, 3)
c = calculation(filepath, 1, 5)
d = calculation(filepath, 1, 7)
e = calculation(filepath, 2, 1)
print('Part a solution: ' + str(b))
print('Part b solution: ' + str(a * b * c * d * e))
return |
class Student:
def __init__(self, firstname, lastname, major, gpa):
self.firstname = firstname
self.lastname = lastname
self.major = major
self.gpa = gpa
@property # property decorator # access this method as an attribute
def fullname(self):
return f'{self.firstname} {self.lastname}'
@fullname.setter # setter decorator # set the attribute
def fullname(self, fullname):
first, last = fullname.split(' ')
self.firstname = firstname
self.lastname = lastname
@fullname.deleter # deleter decorator # set an attribute to None
def fullname(self):
self.firstname = None
self.lastname = None
| class Student:
def __init__(self, firstname, lastname, major, gpa):
self.firstname = firstname
self.lastname = lastname
self.major = major
self.gpa = gpa
@property
def fullname(self):
return f'{self.firstname} {self.lastname}'
@fullname.setter
def fullname(self, fullname):
(first, last) = fullname.split(' ')
self.firstname = firstname
self.lastname = lastname
@fullname.deleter
def fullname(self):
self.firstname = None
self.lastname = None |
{
"targets": [
{
"target_name": "simpleTest",
"sources": [ "simpleTest.cc" ]
},
{
"target_name": "simpleTest2",
"sources": [ "simpleTest.cc" ]
},
{
"target_name": "simpleTest3",
"sources": [ "simpleTest.cc" ]
}
]
} | {'targets': [{'target_name': 'simpleTest', 'sources': ['simpleTest.cc']}, {'target_name': 'simpleTest2', 'sources': ['simpleTest.cc']}, {'target_name': 'simpleTest3', 'sources': ['simpleTest.cc']}]} |
# =============================================================================
# Author: Teerapat Jenrungrot - https://github.com/mjenrungrot/
# FileName: 12700.py
# Description: UVa Online Judge - 12700
# =============================================================================
def run():
N = int(input())
line = input()
countB = sum(map(lambda x: x == "B", line))
countW = sum(map(lambda x: x == "W", line))
countT = sum(map(lambda x: x == "T", line))
if countT == 0 and countW == 0 and countB == 0:
print("ABANDONED")
elif countT == 0 and countW == 0 and countB:
print("BANGLAWASH")
elif countT == 0 and countB == 0 and countW:
print("WHITEWASH")
elif countW == countB:
print("DRAW {} {}".format(countW, countT))
elif countW > countB:
print("WWW {} - {}".format(countW, countB))
else:
print("BANGLADESH {} - {}".format(countB, countW))
if __name__ == "__main__":
T = int(input())
for i in range(T):
print("Case {}: ".format(i + 1), end="")
run()
| def run():
n = int(input())
line = input()
count_b = sum(map(lambda x: x == 'B', line))
count_w = sum(map(lambda x: x == 'W', line))
count_t = sum(map(lambda x: x == 'T', line))
if countT == 0 and countW == 0 and (countB == 0):
print('ABANDONED')
elif countT == 0 and countW == 0 and countB:
print('BANGLAWASH')
elif countT == 0 and countB == 0 and countW:
print('WHITEWASH')
elif countW == countB:
print('DRAW {} {}'.format(countW, countT))
elif countW > countB:
print('WWW {} - {}'.format(countW, countB))
else:
print('BANGLADESH {} - {}'.format(countB, countW))
if __name__ == '__main__':
t = int(input())
for i in range(T):
print('Case {}: '.format(i + 1), end='')
run() |
DEBUG = True
PORT = 5000
UPLOAD_FOLDER = 'sacapp/static/tmp'
MODEL_FOLDER = 'model/'
DRUG2ID_FILE = 'model/drug2id.txt'
GENE2ID_FILE = 'model/gene2idx.txt'
IC50_DRUGS_FILE = 'model/ic50_drugid.txt'
IC50_DRUG2ID_FILE = 'model/ic50_drug2idx.txt'
IC50_GENES_FILE = 'model/ic50_genes.txt'
PERT_DRUGS_FILE = 'model/pert_drugid.txt'
PERT_DRUG2ID_FILE = 'model/pert_drug2idx.txt'
CCLE_RPKM_FILE = 'model/ccle_rpkm.csv'
CELL_LINES_FILE = 'model/cell_lines.txt'
GDSC_FILE = 'model/ccle_gdsc.csv'
| debug = True
port = 5000
upload_folder = 'sacapp/static/tmp'
model_folder = 'model/'
drug2_id_file = 'model/drug2id.txt'
gene2_id_file = 'model/gene2idx.txt'
ic50_drugs_file = 'model/ic50_drugid.txt'
ic50_drug2_id_file = 'model/ic50_drug2idx.txt'
ic50_genes_file = 'model/ic50_genes.txt'
pert_drugs_file = 'model/pert_drugid.txt'
pert_drug2_id_file = 'model/pert_drug2idx.txt'
ccle_rpkm_file = 'model/ccle_rpkm.csv'
cell_lines_file = 'model/cell_lines.txt'
gdsc_file = 'model/ccle_gdsc.csv' |
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
{
'name': 'Point of Sale',
'version': '1.0.1',
'category': 'Sales/Point of Sale',
'sequence': 40,
'summary': 'User-friendly PoS interface for shops and restaurants',
'description': "",
'depends': ['stock_account', 'barcodes', 'web_editor', 'digest'],
'data': [
'security/point_of_sale_security.xml',
'security/ir.model.access.csv',
'data/default_barcode_patterns.xml',
'data/digest_data.xml',
'wizard/pos_box.xml',
'wizard/pos_details.xml',
'wizard/pos_payment.xml',
'views/pos_assets_common.xml',
'views/pos_assets_index.xml',
'views/pos_assets_qunit.xml',
'views/point_of_sale_report.xml',
'views/point_of_sale_view.xml',
'views/pos_order_view.xml',
'views/pos_category_view.xml',
'views/product_view.xml',
'views/account_journal_view.xml',
'views/pos_payment_method_views.xml',
'views/pos_payment_views.xml',
'views/pos_config_view.xml',
'views/pos_session_view.xml',
'views/point_of_sale_sequence.xml',
'views/customer_facing_display.xml',
'data/point_of_sale_data.xml',
'views/pos_order_report_view.xml',
'views/account_statement_view.xml',
'views/res_config_settings_views.xml',
'views/digest_views.xml',
'views/res_partner_view.xml',
'views/report_userlabel.xml',
'views/report_saledetails.xml',
'views/point_of_sale_dashboard.xml',
],
'demo': [
'data/point_of_sale_demo.xml',
],
'installable': True,
'application': True,
'qweb': [
'static/src/xml/Chrome.xml',
'static/src/xml/debug_manager.xml',
'static/src/xml/Screens/ProductScreen/ProductScreen.xml',
'static/src/xml/Screens/ClientListScreen/ClientLine.xml',
'static/src/xml/Screens/ClientListScreen/ClientDetailsEdit.xml',
'static/src/xml/Screens/ClientListScreen/ClientListScreen.xml',
'static/src/xml/Screens/OrderManagementScreen/ControlButtons/InvoiceButton.xml',
'static/src/xml/Screens/OrderManagementScreen/ControlButtons/ReprintReceiptButton.xml',
'static/src/xml/Screens/OrderManagementScreen/OrderManagementScreen.xml',
'static/src/xml/Screens/OrderManagementScreen/MobileOrderManagementScreen.xml',
'static/src/xml/Screens/OrderManagementScreen/OrderManagementControlPanel.xml',
'static/src/xml/Screens/OrderManagementScreen/OrderList.xml',
'static/src/xml/Screens/OrderManagementScreen/OrderRow.xml',
'static/src/xml/Screens/OrderManagementScreen/OrderDetails.xml',
'static/src/xml/Screens/OrderManagementScreen/OrderlineDetails.xml',
'static/src/xml/Screens/OrderManagementScreen/ReprintReceiptScreen.xml',
'static/src/xml/Screens/TicketScreen/TicketScreen.xml',
'static/src/xml/Screens/PaymentScreen/PSNumpadInputButton.xml',
'static/src/xml/Screens/PaymentScreen/PaymentScreenNumpad.xml',
'static/src/xml/Screens/PaymentScreen/PaymentScreenElectronicPayment.xml',
'static/src/xml/Screens/PaymentScreen/PaymentScreenPaymentLines.xml',
'static/src/xml/Screens/PaymentScreen/PaymentScreenStatus.xml',
'static/src/xml/Screens/PaymentScreen/PaymentMethodButton.xml',
'static/src/xml/Screens/PaymentScreen/PaymentScreen.xml',
'static/src/xml/Screens/ProductScreen/Orderline.xml',
'static/src/xml/Screens/ProductScreen/OrderSummary.xml',
'static/src/xml/Screens/ProductScreen/OrderWidget.xml',
'static/src/xml/Screens/ProductScreen/NumpadWidget.xml',
'static/src/xml/Screens/ProductScreen/ActionpadWidget.xml',
'static/src/xml/Screens/ProductScreen/CategoryBreadcrumb.xml',
'static/src/xml/Screens/ProductScreen/CashBoxOpening.xml',
'static/src/xml/Screens/ProductScreen/CategoryButton.xml',
'static/src/xml/Screens/ProductScreen/CategorySimpleButton.xml',
'static/src/xml/Screens/ProductScreen/HomeCategoryBreadcrumb.xml',
'static/src/xml/Screens/ProductScreen/ProductsWidgetControlPanel.xml',
'static/src/xml/Screens/ProductScreen/ProductItem.xml',
'static/src/xml/Screens/ProductScreen/ProductList.xml',
'static/src/xml/Screens/ProductScreen/ProductsWidget.xml',
'static/src/xml/Screens/ReceiptScreen/WrappedProductNameLines.xml',
'static/src/xml/Screens/ReceiptScreen/OrderReceipt.xml',
'static/src/xml/Screens/ReceiptScreen/ReceiptScreen.xml',
'static/src/xml/Screens/ScaleScreen/ScaleScreen.xml',
'static/src/xml/ChromeWidgets/CashierName.xml',
'static/src/xml/ChromeWidgets/ProxyStatus.xml',
'static/src/xml/ChromeWidgets/SyncNotification.xml',
'static/src/xml/ChromeWidgets/OrderManagementButton.xml',
'static/src/xml/ChromeWidgets/HeaderButton.xml',
'static/src/xml/ChromeWidgets/SaleDetailsButton.xml',
'static/src/xml/ChromeWidgets/TicketButton.xml',
'static/src/xml/SaleDetailsReport.xml',
'static/src/xml/Misc/Draggable.xml',
'static/src/xml/Misc/NotificationSound.xml',
'static/src/xml/Misc/SearchBar.xml',
'static/src/xml/ChromeWidgets/DebugWidget.xml',
'static/src/xml/Popups/ErrorPopup.xml',
'static/src/xml/Popups/ErrorBarcodePopup.xml',
'static/src/xml/Popups/ConfirmPopup.xml',
'static/src/xml/Popups/TextInputPopup.xml',
'static/src/xml/Popups/TextAreaPopup.xml',
'static/src/xml/Popups/ErrorTracebackPopup.xml',
'static/src/xml/Popups/SelectionPopup.xml',
'static/src/xml/Popups/EditListInput.xml',
'static/src/xml/Popups/EditListPopup.xml',
'static/src/xml/Popups/NumberPopup.xml',
'static/src/xml/Popups/OfflineErrorPopup.xml',
'static/src/xml/Popups/OrderImportPopup.xml',
'static/src/xml/Popups/ProductConfiguratorPopup.xml',
'static/src/xml/Screens/ProductScreen/ControlButtons/SetPricelistButton.xml',
'static/src/xml/Screens/ProductScreen/ControlButtons/SetFiscalPositionButton.xml',
'static/src/xml/ChromeWidgets/ClientScreenButton.xml',
'static/src/xml/Misc/MobileOrderWidget.xml',
],
'website': 'https://www.odoo.com/page/point-of-sale-shop',
'license': 'LGPL-3',
}
| {'name': 'Point of Sale', 'version': '1.0.1', 'category': 'Sales/Point of Sale', 'sequence': 40, 'summary': 'User-friendly PoS interface for shops and restaurants', 'description': '', 'depends': ['stock_account', 'barcodes', 'web_editor', 'digest'], 'data': ['security/point_of_sale_security.xml', 'security/ir.model.access.csv', 'data/default_barcode_patterns.xml', 'data/digest_data.xml', 'wizard/pos_box.xml', 'wizard/pos_details.xml', 'wizard/pos_payment.xml', 'views/pos_assets_common.xml', 'views/pos_assets_index.xml', 'views/pos_assets_qunit.xml', 'views/point_of_sale_report.xml', 'views/point_of_sale_view.xml', 'views/pos_order_view.xml', 'views/pos_category_view.xml', 'views/product_view.xml', 'views/account_journal_view.xml', 'views/pos_payment_method_views.xml', 'views/pos_payment_views.xml', 'views/pos_config_view.xml', 'views/pos_session_view.xml', 'views/point_of_sale_sequence.xml', 'views/customer_facing_display.xml', 'data/point_of_sale_data.xml', 'views/pos_order_report_view.xml', 'views/account_statement_view.xml', 'views/res_config_settings_views.xml', 'views/digest_views.xml', 'views/res_partner_view.xml', 'views/report_userlabel.xml', 'views/report_saledetails.xml', 'views/point_of_sale_dashboard.xml'], 'demo': ['data/point_of_sale_demo.xml'], 'installable': True, 'application': True, 'qweb': ['static/src/xml/Chrome.xml', 'static/src/xml/debug_manager.xml', 'static/src/xml/Screens/ProductScreen/ProductScreen.xml', 'static/src/xml/Screens/ClientListScreen/ClientLine.xml', 'static/src/xml/Screens/ClientListScreen/ClientDetailsEdit.xml', 'static/src/xml/Screens/ClientListScreen/ClientListScreen.xml', 'static/src/xml/Screens/OrderManagementScreen/ControlButtons/InvoiceButton.xml', 'static/src/xml/Screens/OrderManagementScreen/ControlButtons/ReprintReceiptButton.xml', 'static/src/xml/Screens/OrderManagementScreen/OrderManagementScreen.xml', 'static/src/xml/Screens/OrderManagementScreen/MobileOrderManagementScreen.xml', 'static/src/xml/Screens/OrderManagementScreen/OrderManagementControlPanel.xml', 'static/src/xml/Screens/OrderManagementScreen/OrderList.xml', 'static/src/xml/Screens/OrderManagementScreen/OrderRow.xml', 'static/src/xml/Screens/OrderManagementScreen/OrderDetails.xml', 'static/src/xml/Screens/OrderManagementScreen/OrderlineDetails.xml', 'static/src/xml/Screens/OrderManagementScreen/ReprintReceiptScreen.xml', 'static/src/xml/Screens/TicketScreen/TicketScreen.xml', 'static/src/xml/Screens/PaymentScreen/PSNumpadInputButton.xml', 'static/src/xml/Screens/PaymentScreen/PaymentScreenNumpad.xml', 'static/src/xml/Screens/PaymentScreen/PaymentScreenElectronicPayment.xml', 'static/src/xml/Screens/PaymentScreen/PaymentScreenPaymentLines.xml', 'static/src/xml/Screens/PaymentScreen/PaymentScreenStatus.xml', 'static/src/xml/Screens/PaymentScreen/PaymentMethodButton.xml', 'static/src/xml/Screens/PaymentScreen/PaymentScreen.xml', 'static/src/xml/Screens/ProductScreen/Orderline.xml', 'static/src/xml/Screens/ProductScreen/OrderSummary.xml', 'static/src/xml/Screens/ProductScreen/OrderWidget.xml', 'static/src/xml/Screens/ProductScreen/NumpadWidget.xml', 'static/src/xml/Screens/ProductScreen/ActionpadWidget.xml', 'static/src/xml/Screens/ProductScreen/CategoryBreadcrumb.xml', 'static/src/xml/Screens/ProductScreen/CashBoxOpening.xml', 'static/src/xml/Screens/ProductScreen/CategoryButton.xml', 'static/src/xml/Screens/ProductScreen/CategorySimpleButton.xml', 'static/src/xml/Screens/ProductScreen/HomeCategoryBreadcrumb.xml', 'static/src/xml/Screens/ProductScreen/ProductsWidgetControlPanel.xml', 'static/src/xml/Screens/ProductScreen/ProductItem.xml', 'static/src/xml/Screens/ProductScreen/ProductList.xml', 'static/src/xml/Screens/ProductScreen/ProductsWidget.xml', 'static/src/xml/Screens/ReceiptScreen/WrappedProductNameLines.xml', 'static/src/xml/Screens/ReceiptScreen/OrderReceipt.xml', 'static/src/xml/Screens/ReceiptScreen/ReceiptScreen.xml', 'static/src/xml/Screens/ScaleScreen/ScaleScreen.xml', 'static/src/xml/ChromeWidgets/CashierName.xml', 'static/src/xml/ChromeWidgets/ProxyStatus.xml', 'static/src/xml/ChromeWidgets/SyncNotification.xml', 'static/src/xml/ChromeWidgets/OrderManagementButton.xml', 'static/src/xml/ChromeWidgets/HeaderButton.xml', 'static/src/xml/ChromeWidgets/SaleDetailsButton.xml', 'static/src/xml/ChromeWidgets/TicketButton.xml', 'static/src/xml/SaleDetailsReport.xml', 'static/src/xml/Misc/Draggable.xml', 'static/src/xml/Misc/NotificationSound.xml', 'static/src/xml/Misc/SearchBar.xml', 'static/src/xml/ChromeWidgets/DebugWidget.xml', 'static/src/xml/Popups/ErrorPopup.xml', 'static/src/xml/Popups/ErrorBarcodePopup.xml', 'static/src/xml/Popups/ConfirmPopup.xml', 'static/src/xml/Popups/TextInputPopup.xml', 'static/src/xml/Popups/TextAreaPopup.xml', 'static/src/xml/Popups/ErrorTracebackPopup.xml', 'static/src/xml/Popups/SelectionPopup.xml', 'static/src/xml/Popups/EditListInput.xml', 'static/src/xml/Popups/EditListPopup.xml', 'static/src/xml/Popups/NumberPopup.xml', 'static/src/xml/Popups/OfflineErrorPopup.xml', 'static/src/xml/Popups/OrderImportPopup.xml', 'static/src/xml/Popups/ProductConfiguratorPopup.xml', 'static/src/xml/Screens/ProductScreen/ControlButtons/SetPricelistButton.xml', 'static/src/xml/Screens/ProductScreen/ControlButtons/SetFiscalPositionButton.xml', 'static/src/xml/ChromeWidgets/ClientScreenButton.xml', 'static/src/xml/Misc/MobileOrderWidget.xml'], 'website': 'https://www.odoo.com/page/point-of-sale-shop', 'license': 'LGPL-3'} |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
__author__ = "Dexter Scott Belmont"
__credits__ = [ "Dexter Scott Belmont" ]
__tags__ = [ "Maya", "Virus", "Removal" ]
__license__ = "MIT"
__version__ = "0.1"
__maintainer__ = "Dexter Scott Belmont"
__email__ = "dexter@kerneloid.com"
__status__ = "alpha"
#jobs = cmds.scriptJob(lj=True)
#for job in jobs:
found = False
for job in cmds.scriptJob( lj=True ) :
if "leukocyte.antivirus()" in job :
id = job.split( ":" )[ 0 ]
if id.isdigit() :
cmds.scriptJob( k=int(id), f=True )
if found == False :
found = True
print( "Virus Found" )
script_nodes = cmds.ls( "vaccine_gene", type="script" )
if script_nodes :
if found == False :
found = True
print( "Virus Found" )
cmds.delete( script_nodes ) | __author__ = 'Dexter Scott Belmont'
__credits__ = ['Dexter Scott Belmont']
__tags__ = ['Maya', 'Virus', 'Removal']
__license__ = 'MIT'
__version__ = '0.1'
__maintainer__ = 'Dexter Scott Belmont'
__email__ = 'dexter@kerneloid.com'
__status__ = 'alpha'
found = False
for job in cmds.scriptJob(lj=True):
if 'leukocyte.antivirus()' in job:
id = job.split(':')[0]
if id.isdigit():
cmds.scriptJob(k=int(id), f=True)
if found == False:
found = True
print('Virus Found')
script_nodes = cmds.ls('vaccine_gene', type='script')
if script_nodes:
if found == False:
found = True
print('Virus Found')
cmds.delete(script_nodes) |
__all__ = ['Mine']
class Mine(object):
'''A mine object.
Attributes:
x (int): the mine position in X.
y (int): the mine position in Y.
owner (int): the hero's id that owns this mine.
'''
def __init__(self, x, y):
'''Constructor.
Args:
x (int): the mine position in X.
y (int): the mine position in Y.
'''
self.x = x
self.y = y
self.owner = None
| __all__ = ['Mine']
class Mine(object):
"""A mine object.
Attributes:
x (int): the mine position in X.
y (int): the mine position in Y.
owner (int): the hero's id that owns this mine.
"""
def __init__(self, x, y):
"""Constructor.
Args:
x (int): the mine position in X.
y (int): the mine position in Y.
"""
self.x = x
self.y = y
self.owner = None |
INVALID_EMAIL = "invalid_email"
INVALID_EMAIL_CHANGE = "invalid_email_change"
MISSING_EMAIL = "missing_email"
MISSING_NATIONALITY = "missing_nationality"
DUPLICATE_EMAIL = "unique"
REQUIRED = "required"
INVALID_SUBSCRIBE_TO_EMPTY_EMAIL = "invalid_subscribe_to_empty_email"
| invalid_email = 'invalid_email'
invalid_email_change = 'invalid_email_change'
missing_email = 'missing_email'
missing_nationality = 'missing_nationality'
duplicate_email = 'unique'
required = 'required'
invalid_subscribe_to_empty_email = 'invalid_subscribe_to_empty_email' |
min_temp = None
max_temp = None
# factor = 2.25
factor = 0
HUE_MAX = 240 / 360
HUE_MIN = 0
HUE_GOOD = 120 / 360
HUE_WARNING = 50/360
HUE_DANGER = 0
#comfort ranges
TEMP_LOW = 16
TEMP_HIGH = 24
HUMIDITY_LOW = 30
HUMIDITY_HIGHT = 60 | min_temp = None
max_temp = None
factor = 0
hue_max = 240 / 360
hue_min = 0
hue_good = 120 / 360
hue_warning = 50 / 360
hue_danger = 0
temp_low = 16
temp_high = 24
humidity_low = 30
humidity_hight = 60 |
MAX_PIXEL_VALUE = 255
LAPLAS_FACTOR = 0.5
LAPLAS_1 = [[0,1,0],[1,-4,1],[0,1,0]]
LAPLAS_2 = [[1,1,1],[1,-8,1],[1,1,1]]
LAPLAS_3 = [[0,-1,0],[-1,4,-1],[0,-1,0]]
LAPLAS_4 = [[-1,-1,-1],[-1,8,-1],[-1,-1,-1]]
LAPLAS_5 = [[0,-1,0],[-1,5,-1],[0,-1,0]]
LAPLAS_6 = [[-1,-1,-1],[-1,9,-1],[-1,-1,-1]]
LAPLAS_7 = [[0,-1,0],[-1,LAPLAS_FACTOR + 4,-1],[0,-1,0]]
LAPLAS_8 = [[-1,-1,-1],[-1,LAPLAS_FACTOR + 8,-1],[-1,-1,-1]] | max_pixel_value = 255
laplas_factor = 0.5
laplas_1 = [[0, 1, 0], [1, -4, 1], [0, 1, 0]]
laplas_2 = [[1, 1, 1], [1, -8, 1], [1, 1, 1]]
laplas_3 = [[0, -1, 0], [-1, 4, -1], [0, -1, 0]]
laplas_4 = [[-1, -1, -1], [-1, 8, -1], [-1, -1, -1]]
laplas_5 = [[0, -1, 0], [-1, 5, -1], [0, -1, 0]]
laplas_6 = [[-1, -1, -1], [-1, 9, -1], [-1, -1, -1]]
laplas_7 = [[0, -1, 0], [-1, LAPLAS_FACTOR + 4, -1], [0, -1, 0]]
laplas_8 = [[-1, -1, -1], [-1, LAPLAS_FACTOR + 8, -1], [-1, -1, -1]] |
class ListExtension(object):
@staticmethod
def split_list_in_n_parts(my_list, number_chunks):
k, m = len(my_list) / number_chunks, len(my_list) % number_chunks
return list(my_list[i * k + min(i, m):(i + 1) * k + min(i + 1, m)] for i in xrange(number_chunks))
@staticmethod
def convert_list_to_string(my_list, separator=' '):
return separator.join(list(map(str, my_list)))
if __name__ == '__main__':
my_list = [(1,2), (3,4), (5,6)]
res = ListExtension.convert_list_to_string(my_list)
print(res) | class Listextension(object):
@staticmethod
def split_list_in_n_parts(my_list, number_chunks):
(k, m) = (len(my_list) / number_chunks, len(my_list) % number_chunks)
return list((my_list[i * k + min(i, m):(i + 1) * k + min(i + 1, m)] for i in xrange(number_chunks)))
@staticmethod
def convert_list_to_string(my_list, separator=' '):
return separator.join(list(map(str, my_list)))
if __name__ == '__main__':
my_list = [(1, 2), (3, 4), (5, 6)]
res = ListExtension.convert_list_to_string(my_list)
print(res) |
# Violet Cube Fragment
FRAGMENT = 2434125
REWARD1 = 5062009 # red cube
REWARD2 = 5062010 # black cube
q = sm.getQuantityOfItem(FRAGMENT)
if q >= 10:
if sm.canHold(REWARD2):
sm.giveItem(REWARD2)
sm.consumeItem(FRAGMENT, 10)
else:
sm.systemMessage("Make sure you have enough space in your inventory..")
elif q >= 5:
if sm.canHold(REWARD1):
sm.giveItem(REWARD1)
sm.consumeItem(FRAGMENT, 5)
else:
sm.systemMessage("Make sure you have enough space in your inventory..")
else:
sm.systemMessage("One must have at least 5 fragments to unleash the magic powers..") | fragment = 2434125
reward1 = 5062009
reward2 = 5062010
q = sm.getQuantityOfItem(FRAGMENT)
if q >= 10:
if sm.canHold(REWARD2):
sm.giveItem(REWARD2)
sm.consumeItem(FRAGMENT, 10)
else:
sm.systemMessage('Make sure you have enough space in your inventory..')
elif q >= 5:
if sm.canHold(REWARD1):
sm.giveItem(REWARD1)
sm.consumeItem(FRAGMENT, 5)
else:
sm.systemMessage('Make sure you have enough space in your inventory..')
else:
sm.systemMessage('One must have at least 5 fragments to unleash the magic powers..') |
num = {}
for i in range(97,123):
num[chr(i)] = i-96
L = int(input())
data = list(input().rstrip())
res = 0
M = 1234567891
for idx,val in enumerate(data):
res += (31**idx)*num[val]
res %= M
print(res) | num = {}
for i in range(97, 123):
num[chr(i)] = i - 96
l = int(input())
data = list(input().rstrip())
res = 0
m = 1234567891
for (idx, val) in enumerate(data):
res += 31 ** idx * num[val]
res %= M
print(res) |
class f:
def __init__(self,s,i):
self.s=s;self.i=i
r=""
for _ in range(int(__import__('sys').stdin.readline())):
n=int(__import__('sys').stdin.readline())
a=__import__('sys').stdin.readline().split()
b=__import__('sys').stdin.readline().split()
o=[-1]*n
for i in range(n):
for j in range(n):
if b[i]==a[j]:
o[i]=j;break
t=""
c=__import__('sys').stdin.readline().split()
for i in range(n):
o[i]=f(c[i],o[i])
o.sort(key=lambda x:x.i)
for x in o:
t+=x.s+' '
r+=t+'\n'
print(r,end="")
| class F:
def __init__(self, s, i):
self.s = s
self.i = i
r = ''
for _ in range(int(__import__('sys').stdin.readline())):
n = int(__import__('sys').stdin.readline())
a = __import__('sys').stdin.readline().split()
b = __import__('sys').stdin.readline().split()
o = [-1] * n
for i in range(n):
for j in range(n):
if b[i] == a[j]:
o[i] = j
break
t = ''
c = __import__('sys').stdin.readline().split()
for i in range(n):
o[i] = f(c[i], o[i])
o.sort(key=lambda x: x.i)
for x in o:
t += x.s + ' '
r += t + '\n'
print(r, end='') |
n = int(input())
even = 0
odd = 0
for i in range(1, n + 1):
number = int(input())
if i % 2 == 0:
even += number
else:
odd += number
if even == odd:
print(f"Yes\nSum = {even}")
else:
print(f"No\nDiff = {abs(even - odd)}")
| n = int(input())
even = 0
odd = 0
for i in range(1, n + 1):
number = int(input())
if i % 2 == 0:
even += number
else:
odd += number
if even == odd:
print(f'Yes\nSum = {even}')
else:
print(f'No\nDiff = {abs(even - odd)}') |
def diff():
print("Diff Diff")
def patch():
print("Patch")
| def diff():
print('Diff Diff')
def patch():
print('Patch') |
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
}
}
INSTALLED_APPS = [
'userprofile',
]
USER_PROFILE_MODULE = 'userprofile.Profile'
| databases = {'default': {'ENGINE': 'django.db.backends.sqlite3'}}
installed_apps = ['userprofile']
user_profile_module = 'userprofile.Profile' |
class Solution:
def equalSubstring(self, s: str, t: str, mx: int) -> int:
i = 0
for j in range(len(s)):
mx -= abs(ord(s[j]) - ord(t[j]))
if mx < 0:
mx += abs(ord(s[i]) - ord(t[i]))
i += 1
return j - i + 1 | class Solution:
def equal_substring(self, s: str, t: str, mx: int) -> int:
i = 0
for j in range(len(s)):
mx -= abs(ord(s[j]) - ord(t[j]))
if mx < 0:
mx += abs(ord(s[i]) - ord(t[i]))
i += 1
return j - i + 1 |
'''
Problem:
Given an array A of n integers, in sorted order, and an integer x,
design an O(n)-time complexity algorithm to determine whether there
are 2 integers in A whose sum is exactly x.
'''
def sum(target, x):
lookup = set()
# Build a lookup table.
for item in target:
lookup.add(x - item)
# Check for a hit.
for item in target:
if item in lookup:
return '%d + %d' % (item, x - item)
return None
x = 7
test = [1, 2, 3, 4, 5]
print(sum(test, x))
x = 15
print(sum(test, x))
| """
Problem:
Given an array A of n integers, in sorted order, and an integer x,
design an O(n)-time complexity algorithm to determine whether there
are 2 integers in A whose sum is exactly x.
"""
def sum(target, x):
lookup = set()
for item in target:
lookup.add(x - item)
for item in target:
if item in lookup:
return '%d + %d' % (item, x - item)
return None
x = 7
test = [1, 2, 3, 4, 5]
print(sum(test, x))
x = 15
print(sum(test, x)) |
class Televisao():
def __init__(self, c):
self.ligada = False
self.canal = c
self.marca = 'SAMSUNG'
self.tamanho = '43'
def muda_canal_cima(self):
if self.canal < 50:
self.canal += 1
else:
self.canal = 1
def muda_canal_baixo(self):
if self.canal > 1:
self.canal -= 1
else:
self.canal = 50
tv_quarto = Televisao(48)
print(tv_quarto.canal)
tv_quarto.muda_canal_cima()
tv_quarto.muda_canal_cima()
tv_quarto.muda_canal_cima()
tv_quarto.muda_canal_cima()
tv_quarto.muda_canal_cima()
print(tv_quarto.canal)
tv_quarto.canal = 5
print(tv_quarto.canal)
tv_quarto.muda_canal_baixo()
tv_quarto.muda_canal_baixo()
tv_quarto.muda_canal_baixo()
tv_quarto.muda_canal_baixo()
tv_quarto.muda_canal_baixo()
tv_quarto.muda_canal_baixo()
print(tv_quarto.canal)
| class Televisao:
def __init__(self, c):
self.ligada = False
self.canal = c
self.marca = 'SAMSUNG'
self.tamanho = '43'
def muda_canal_cima(self):
if self.canal < 50:
self.canal += 1
else:
self.canal = 1
def muda_canal_baixo(self):
if self.canal > 1:
self.canal -= 1
else:
self.canal = 50
tv_quarto = televisao(48)
print(tv_quarto.canal)
tv_quarto.muda_canal_cima()
tv_quarto.muda_canal_cima()
tv_quarto.muda_canal_cima()
tv_quarto.muda_canal_cima()
tv_quarto.muda_canal_cima()
print(tv_quarto.canal)
tv_quarto.canal = 5
print(tv_quarto.canal)
tv_quarto.muda_canal_baixo()
tv_quarto.muda_canal_baixo()
tv_quarto.muda_canal_baixo()
tv_quarto.muda_canal_baixo()
tv_quarto.muda_canal_baixo()
tv_quarto.muda_canal_baixo()
print(tv_quarto.canal) |
def test_numbers():
assert 1234 == 1234
def test_hello_world():
assert "hello" + "world" == "helloworld"
def test_foobar():
assert True
| def test_numbers():
assert 1234 == 1234
def test_hello_world():
assert 'hello' + 'world' == 'helloworld'
def test_foobar():
assert True |
'''
SPDX-License-Identifier: Apache-2.0
Copyright 2021 Keylime Authors
'''
async def execute(revocation):
try:
value = revocation['hello']
print(value)
except Exception as e:
raise Exception(
"The provided dictionary does not contain the 'hello' key")
| """
SPDX-License-Identifier: Apache-2.0
Copyright 2021 Keylime Authors
"""
async def execute(revocation):
try:
value = revocation['hello']
print(value)
except Exception as e:
raise exception("The provided dictionary does not contain the 'hello' key") |
# local scope
def my_func():
x = 300
print(x)
def my_inner_func():
print(x)
my_inner_func()
my_func()
| def my_func():
x = 300
print(x)
def my_inner_func():
print(x)
my_inner_func()
my_func() |
# OpenWeatherMap API Key
weather_api_key = "8915eee544f1c9b3ef5fa102f5edeb66"
# Google API Key
g_key = "AIzaSyDgD7ZgpyA4MuuVfr3Ep8G2-uCEx37joSE"
| weather_api_key = '8915eee544f1c9b3ef5fa102f5edeb66'
g_key = 'AIzaSyDgD7ZgpyA4MuuVfr3Ep8G2-uCEx37joSE' |
def to_polar(x, y):
'Rectangular to polar conversion using ints scaled by 100000. Angle in degrees.'
theta = 0
for i, adj in enumerate((4500000, 2656505, 1403624, 712502, 357633, 178991, 89517, 44761)):
sign = 1 if y < 0 else -1
x, y, theta = x - sign*(y >> i) , y + sign*(x >> i), theta - sign*adj
return theta, x * 60726 // 100000
def to_rect(r, theta):
'Polar to rectangular conversion using ints scaled by 100000. Angle in degrees.'
x, y = 60726 * r // 100000, 0
for i, adj in enumerate((4500000, 2656505, 1403624, 712502, 357633, 178991, 89517, 44761)):
sign = 1 if theta > 0 else -1
x, y, theta = x - sign*(y >> i) , y + sign*(x >> i), theta - sign*adj
return x, y
if __name__ == '__main__':
print(to_rect(471700, 5799460)) # r=4.71700 theta=57.99460
print(to_polar(250000, 400000)) # x=2.50000 y=4.00000
| def to_polar(x, y):
"""Rectangular to polar conversion using ints scaled by 100000. Angle in degrees."""
theta = 0
for (i, adj) in enumerate((4500000, 2656505, 1403624, 712502, 357633, 178991, 89517, 44761)):
sign = 1 if y < 0 else -1
(x, y, theta) = (x - sign * (y >> i), y + sign * (x >> i), theta - sign * adj)
return (theta, x * 60726 // 100000)
def to_rect(r, theta):
"""Polar to rectangular conversion using ints scaled by 100000. Angle in degrees."""
(x, y) = (60726 * r // 100000, 0)
for (i, adj) in enumerate((4500000, 2656505, 1403624, 712502, 357633, 178991, 89517, 44761)):
sign = 1 if theta > 0 else -1
(x, y, theta) = (x - sign * (y >> i), y + sign * (x >> i), theta - sign * adj)
return (x, y)
if __name__ == '__main__':
print(to_rect(471700, 5799460))
print(to_polar(250000, 400000)) |
# -*- coding: utf-8 -*-
description = 'common detector devices provided by QMesyDAQ'
group = 'lowlevel'
devices = dict(
timer = device('nicos.devices.generic.VirtualTimer',
description = 'QMesyDAQ timer',
lowlevel = True,
unit = 's',
fmtstr = '%.1f',
),
mon1 = device('nicos.devices.generic.VirtualCounter',
description = 'QMesyDAQ monitor 1',
type = 'monitor',
lowlevel = True,
fmtstr = '%d',
),
# mon2 = device('nicos.devices.generic.VirtualCounter',
# type = 'monitor',
# lowlevel = True,
# fmtstr = '%d',
# ),
det1 = device('nicos.devices.generic.VirtualCounter',
type = 'counter',
lowlevel = True,
fmtstr = '%d',
),
det2 = device('nicos.devices.generic.VirtualCounter',
type = 'counter',
lowlevel = True,
fmtstr = '%d',
),
det3 = device('nicos.devices.generic.VirtualCounter',
type = 'counter',
lowlevel = True,
fmtstr = '%d',
),
# det4 = device('nicos.devices.generic.VirtualCounter',
# type = 'counter',
# lowlevel = True,
# fmtstr = '%d',
# ),
# det5 = device('nicos.devices.generic.VirtualCounter',
# type = 'counter',
# lowlevel = True,
# fmtstr = '%d',
# ),
events = device('nicos.devices.generic.VirtualCounter',
description = 'QMesyDAQ Events channel',
type = 'counter',
lowlevel = True,
fmtstr = '%d',
),
image = device('nicos.devices.generic.VirtualImage',
description = 'QMesyDAQ Image',
fmtstr = '%d',
pollinterval = 86400,
lowlevel = True,
sizes = (1, 5),
),
det = device('nicos.devices.generic.Detector',
# description = 'Puma detector device (5 counters)',
description = 'Puma detector QMesydaq device (3 counters)',
timers = ['timer'],
# monitors = ['mon1', 'mon2'],
monitors = ['mon1'],
# counters = ['det1', 'det2', 'det3', 'det4', 'det5'],
counters = ['det1', 'det2', 'det3'],
images = [],
maxage = 1,
pollinterval = 1,
),
)
startupcode = '''
SetDetectors(det)
'''
| description = 'common detector devices provided by QMesyDAQ'
group = 'lowlevel'
devices = dict(timer=device('nicos.devices.generic.VirtualTimer', description='QMesyDAQ timer', lowlevel=True, unit='s', fmtstr='%.1f'), mon1=device('nicos.devices.generic.VirtualCounter', description='QMesyDAQ monitor 1', type='monitor', lowlevel=True, fmtstr='%d'), det1=device('nicos.devices.generic.VirtualCounter', type='counter', lowlevel=True, fmtstr='%d'), det2=device('nicos.devices.generic.VirtualCounter', type='counter', lowlevel=True, fmtstr='%d'), det3=device('nicos.devices.generic.VirtualCounter', type='counter', lowlevel=True, fmtstr='%d'), events=device('nicos.devices.generic.VirtualCounter', description='QMesyDAQ Events channel', type='counter', lowlevel=True, fmtstr='%d'), image=device('nicos.devices.generic.VirtualImage', description='QMesyDAQ Image', fmtstr='%d', pollinterval=86400, lowlevel=True, sizes=(1, 5)), det=device('nicos.devices.generic.Detector', description='Puma detector QMesydaq device (3 counters)', timers=['timer'], monitors=['mon1'], counters=['det1', 'det2', 'det3'], images=[], maxage=1, pollinterval=1))
startupcode = '\nSetDetectors(det)\n' |
def arrayMap(f):
def app(arr):
return tuple(f(e) for e in arr)
return app
| def array_map(f):
def app(arr):
return tuple((f(e) for e in arr))
return app |
n = int(input())
arr = [int(e) for e in input().split()]
for inicio in range(1, n):
i = inicio
while i >= 1 and arr[i] < arr[i-1]:
arr[i], arr[i-1] = arr[i-1], arr[i]
i -= 1
for i in range(8):
print(arr[i], end=" ")
print()
| n = int(input())
arr = [int(e) for e in input().split()]
for inicio in range(1, n):
i = inicio
while i >= 1 and arr[i] < arr[i - 1]:
(arr[i], arr[i - 1]) = (arr[i - 1], arr[i])
i -= 1
for i in range(8):
print(arr[i], end=' ')
print() |
def area_for_polygon(polygon):
result = 0
imax = len(polygon) - 1
for i in range(0, imax):
result += (polygon[i][1] * polygon[i + 1][0]) - (polygon[i + 1][1] * polygon[i][0])
result += (polygon[imax][1] * polygon[0][0]) - (polygon[0][1] * polygon[imax][0])
return result / 2.
def centroid_for_polygon(polygon):
area = area_for_polygon(polygon)
imax = len(polygon) - 1
result_x = 0
result_y = 0
for i in range(0, imax):
result_x += (polygon[i][1] + polygon[i + 1][1]) * ((polygon[i][1] *
polygon[i + 1][0]) - (polygon[i + 1][1] * polygon[i][0]))
result_y += (polygon[i][0] + polygon[i + 1][0]) * ((polygon[i][1] *
polygon[i + 1][0]) - (polygon[i + 1][1] * polygon[i][0]))
result_x += (polygon[imax][1] + polygon[0][1]) * \
((polygon[imax][1] * polygon[0][0]) - (polygon[0][1] * polygon[imax][0]))
result_y += (polygon[imax][0] + polygon[0][0]) * \
((polygon[imax][1] * polygon[0][0]) - (polygon[0][1] * polygon[imax][0]))
result_x /= (area * 6.0)
result_y /= (area * 6.0)
return result_y, result_x
| def area_for_polygon(polygon):
result = 0
imax = len(polygon) - 1
for i in range(0, imax):
result += polygon[i][1] * polygon[i + 1][0] - polygon[i + 1][1] * polygon[i][0]
result += polygon[imax][1] * polygon[0][0] - polygon[0][1] * polygon[imax][0]
return result / 2.0
def centroid_for_polygon(polygon):
area = area_for_polygon(polygon)
imax = len(polygon) - 1
result_x = 0
result_y = 0
for i in range(0, imax):
result_x += (polygon[i][1] + polygon[i + 1][1]) * (polygon[i][1] * polygon[i + 1][0] - polygon[i + 1][1] * polygon[i][0])
result_y += (polygon[i][0] + polygon[i + 1][0]) * (polygon[i][1] * polygon[i + 1][0] - polygon[i + 1][1] * polygon[i][0])
result_x += (polygon[imax][1] + polygon[0][1]) * (polygon[imax][1] * polygon[0][0] - polygon[0][1] * polygon[imax][0])
result_y += (polygon[imax][0] + polygon[0][0]) * (polygon[imax][1] * polygon[0][0] - polygon[0][1] * polygon[imax][0])
result_x /= area * 6.0
result_y /= area * 6.0
return (result_y, result_x) |
def square(): # function header
new_value=4 ** 2 # function body
print(new_value)
square()
| def square():
new_value = 4 ** 2
print(new_value)
square() |
class MockDbQuery(object):
def __init__(self, responses):
self.responses = responses
def get(self, method, **kws):
resp = None
if method in self.responses:
resp = self.responses[method].pop(0)
if 'validate' in resp:
checks = resp['validate']['checks']
resp = resp['validate']['data']
for check in checks:
assert check in kws
expected_value = checks[check]
assert expected_value == kws[check]
return resp
class MockHTTPResponse(object):
def __init__(self, status_code, text):
self.status_code = status_code
self.text = text
| class Mockdbquery(object):
def __init__(self, responses):
self.responses = responses
def get(self, method, **kws):
resp = None
if method in self.responses:
resp = self.responses[method].pop(0)
if 'validate' in resp:
checks = resp['validate']['checks']
resp = resp['validate']['data']
for check in checks:
assert check in kws
expected_value = checks[check]
assert expected_value == kws[check]
return resp
class Mockhttpresponse(object):
def __init__(self, status_code, text):
self.status_code = status_code
self.text = text |
'''
Globals that are used throughout CheckAPI
'''
# Whether to output debugging statements
debug = False
# The model's current working directory
workingdir = "/"
| """
Globals that are used throughout CheckAPI
"""
debug = False
workingdir = '/' |
class SuperPalmTree:
def __init__(self, a: int, b: int, c: float):
self.a = a
self.b = b
self.c = c
def __call__(self, x):
return (self.a + self.b) * x / self.c
def unpack(self):
yield self.a
yield self.b
yield self.c
def param_tuple(self):
return (self.a, self.b, self.c)
| class Superpalmtree:
def __init__(self, a: int, b: int, c: float):
self.a = a
self.b = b
self.c = c
def __call__(self, x):
return (self.a + self.b) * x / self.c
def unpack(self):
yield self.a
yield self.b
yield self.c
def param_tuple(self):
return (self.a, self.b, self.c) |
# functions
def yes_or_no(): # Returns 'yes' or 'no' based on first letter of user input.
while True:
item = input()
if not item or item[0] not in ['y', 'n']:
print('(y)es or (n)o are valid answers')
continue
elif item[0].lower() == 'y':
return 'yes'
elif item[0].lower() == 'n':
return 'no'
| def yes_or_no():
while True:
item = input()
if not item or item[0] not in ['y', 'n']:
print('(y)es or (n)o are valid answers')
continue
elif item[0].lower() == 'y':
return 'yes'
elif item[0].lower() == 'n':
return 'no' |
# selection sorting is an in-place comparison sort
# O(N^2) time, inefficient for large datasets
# best when memory is limited
def selection_sort(lst):
''' Implementation of selection sort. Efficient with space but not time. Finds the smallest unsorted index (index 0 in the first run) and compares it to all other items in the list. if an item has a smaller numeric value than the smallest unsorted index, it swaps with the smallest of all the values that are smaller. Continues until sorted. '''
if len(lst) < 2:
return lst
for item in range(len(lst)):
# smallest unsorted index
smallest_unsorted_index = item
# look at all unsorted items, don't look at ones before index position lst[item]
for i in range(item+1, len(lst)):
# if a new index value is smaller than the current, we want to swap
# there may be multiple values smaller
if lst[smallest_unsorted_index] > lst[i]:
smallest_unsorted_index = i
# when done with inner loop, swap lst[item] and lst[smallest_unsorted_index]
temp_for_swapping = lst[item]
lst[item] = lst[smallest_unsorted_index]
lst[smallest_unsorted_index] = temp_for_swapping
return lst
| def selection_sort(lst):
""" Implementation of selection sort. Efficient with space but not time. Finds the smallest unsorted index (index 0 in the first run) and compares it to all other items in the list. if an item has a smaller numeric value than the smallest unsorted index, it swaps with the smallest of all the values that are smaller. Continues until sorted. """
if len(lst) < 2:
return lst
for item in range(len(lst)):
smallest_unsorted_index = item
for i in range(item + 1, len(lst)):
if lst[smallest_unsorted_index] > lst[i]:
smallest_unsorted_index = i
temp_for_swapping = lst[item]
lst[item] = lst[smallest_unsorted_index]
lst[smallest_unsorted_index] = temp_for_swapping
return lst |
def list_to_string(lst):
string = ''
for item in lst:
string = string + item
return string
def find_rc(rc):
rc = rc[:: -1]
replacements = {"A": "T",
"T": "A",
"G": "C",
"C": "G"}
rc = "".join([replacements.get(c, c) for c in rc])
return rc
def find_palindromes(x):
sequence = list(x.upper())
end_index = 4
palindromes = []
count = 0
for i in range(0, len(sequence) - 1):
rc = find_rc(sequence[i:end_index])
original = sequence[i:end_index]
end_index += 1
if rc == list_to_string(original):
palindromes.append(i)
count += 1
str_palindromes = ''
for item in palindromes[0:len(palindromes) - 1]:
str_palindromes += str(item)
str_palindromes += ', '
return count, str_palindromes
dna = str(input('Enter seq: '))
print('there are', find_palindromes(dna)[0], 'palindromes at places', find_palindromes(dna)[1], '\n')
| def list_to_string(lst):
string = ''
for item in lst:
string = string + item
return string
def find_rc(rc):
rc = rc[::-1]
replacements = {'A': 'T', 'T': 'A', 'G': 'C', 'C': 'G'}
rc = ''.join([replacements.get(c, c) for c in rc])
return rc
def find_palindromes(x):
sequence = list(x.upper())
end_index = 4
palindromes = []
count = 0
for i in range(0, len(sequence) - 1):
rc = find_rc(sequence[i:end_index])
original = sequence[i:end_index]
end_index += 1
if rc == list_to_string(original):
palindromes.append(i)
count += 1
str_palindromes = ''
for item in palindromes[0:len(palindromes) - 1]:
str_palindromes += str(item)
str_palindromes += ', '
return (count, str_palindromes)
dna = str(input('Enter seq: '))
print('there are', find_palindromes(dna)[0], 'palindromes at places', find_palindromes(dna)[1], '\n') |
t = int(input())
for _ in range(t):
s = input()
c = 0
for i in range(len(s)-1):
if abs(ord(s[i]) - ord(s[i+1])) != 1:
c += 1
print (c)
| t = int(input())
for _ in range(t):
s = input()
c = 0
for i in range(len(s) - 1):
if abs(ord(s[i]) - ord(s[i + 1])) != 1:
c += 1
print(c) |
class CheckResult:
msg: str = ""
def __init__(self, msg) -> None:
self.msg = msg
class Ok(CheckResult):
pass
class Warn(CheckResult):
pass
class Err(CheckResult):
pass
class Unk(CheckResult):
pass
class Probe:
def __init__(self, **kwargs):
for k, v in kwargs.items():
if v is not None and k in self.__class__.__dict__:
setattr(self, k, v)
@classmethod
def get_help(cls):
return cls.__doc__
@classmethod
def get_type(cls):
return cls.__name__.replace("Probe", "").lower()
@classmethod
def get_args(cls):
return [i for i in cls.__dict__.keys() if i[:1] != "_"]
def get_labels(self):
return {k: getattr(self, k) for k in self.__class__.__dict__ if k[:1] != "_"}
def __call__(self) -> CheckResult:
return Unk("No check implemented")
def __repr__(self):
return f"<{self.__class__.__name__}: {self.get_labels()}>"
| class Checkresult:
msg: str = ''
def __init__(self, msg) -> None:
self.msg = msg
class Ok(CheckResult):
pass
class Warn(CheckResult):
pass
class Err(CheckResult):
pass
class Unk(CheckResult):
pass
class Probe:
def __init__(self, **kwargs):
for (k, v) in kwargs.items():
if v is not None and k in self.__class__.__dict__:
setattr(self, k, v)
@classmethod
def get_help(cls):
return cls.__doc__
@classmethod
def get_type(cls):
return cls.__name__.replace('Probe', '').lower()
@classmethod
def get_args(cls):
return [i for i in cls.__dict__.keys() if i[:1] != '_']
def get_labels(self):
return {k: getattr(self, k) for k in self.__class__.__dict__ if k[:1] != '_'}
def __call__(self) -> CheckResult:
return unk('No check implemented')
def __repr__(self):
return f'<{self.__class__.__name__}: {self.get_labels()}>' |
load(":testing.bzl", "asserts", "test_suite")
load("//maven:sets.bzl", "sets")
def new_test(env):
set = sets.new()
asserts.equals(env, 0, len(set))
set = sets.new("a", "b", "c")
asserts.equals(env, 3, len(set))
asserts.equals(env, ["a", "b", "c"], list(set))
def equality_test(env):
a = sets.new()
b = sets.new()
sets.add(a, "foo1")
sets.add(b, "foo1")
asserts.equals(env, a, b)
def inequality_test(env):
a = sets.new()
b = sets.new()
sets.add(a, "foo1")
sets.add(b, "foo1")
asserts.equals(env, a, b)
def add_test(env):
a = sets.new()
sets.add(a, "foo")
asserts.equals(env, "foo", list(a)[0])
def add_all_as_list_test(env):
a = sets.new()
sets.add_all(a, ["foo", "bar", "baz"])
asserts.equals(env, ["foo", "bar", "baz"], list(a))
def add_all_as_dict_test(env):
a = sets.new()
sets.add_all(a, {"foo": "", "bar": "", "baz": ""})
asserts.equals(env, ["foo", "bar", "baz"], list(a))
def add_each_test(env):
a = sets.new()
sets.add_each(a, "foo", "bar", "baz")
asserts.equals(env, ["foo", "bar", "baz"], list(a))
def set_behavior_test(env):
a = sets.new("foo", "bar", "baz")
sets.add(a, "bar")
asserts.equals(env, ["foo", "bar", "baz"], list(a))
def pop_test(env):
a = sets.new("a", "b", "c")
item = sets.pop(a)
asserts.equals(env, 2, len(a))
item = sets.pop(a)
asserts.equals(env, 1, len(a))
item = sets.pop(a)
asserts.equals(env, 0, len(a))
# Can't test failure, as that invokes bazel fail().
def contains_test(env):
a = sets.new("a")
asserts.true(env, sets.contains(a, "a"))
asserts.false(env, sets.contains(a, "b"))
def difference_test(env):
a = sets.new("a", "b", "c")
b = sets.new ("c", "d", "e")
asserts.equals(env, sets.new("d", "e"), sets.difference(a, b))
asserts.equals(env, sets.new("a", "b"), sets.difference(b, a))
def disjoint_test(env):
a = sets.new("a", "b", "c")
b = sets.new ("c", "d", "e")
asserts.equals(env, sets.new("a", "b", "d", "e"), sets.disjoint(a, b))
TESTS = [
new_test,
equality_test,
inequality_test,
pop_test,
add_test,
add_all_as_dict_test,
add_all_as_list_test,
add_each_test,
set_behavior_test,
contains_test,
difference_test,
disjoint_test,
]
# Roll-up function.
def suite():
return test_suite("sets", tests = TESTS)
| load(':testing.bzl', 'asserts', 'test_suite')
load('//maven:sets.bzl', 'sets')
def new_test(env):
set = sets.new()
asserts.equals(env, 0, len(set))
set = sets.new('a', 'b', 'c')
asserts.equals(env, 3, len(set))
asserts.equals(env, ['a', 'b', 'c'], list(set))
def equality_test(env):
a = sets.new()
b = sets.new()
sets.add(a, 'foo1')
sets.add(b, 'foo1')
asserts.equals(env, a, b)
def inequality_test(env):
a = sets.new()
b = sets.new()
sets.add(a, 'foo1')
sets.add(b, 'foo1')
asserts.equals(env, a, b)
def add_test(env):
a = sets.new()
sets.add(a, 'foo')
asserts.equals(env, 'foo', list(a)[0])
def add_all_as_list_test(env):
a = sets.new()
sets.add_all(a, ['foo', 'bar', 'baz'])
asserts.equals(env, ['foo', 'bar', 'baz'], list(a))
def add_all_as_dict_test(env):
a = sets.new()
sets.add_all(a, {'foo': '', 'bar': '', 'baz': ''})
asserts.equals(env, ['foo', 'bar', 'baz'], list(a))
def add_each_test(env):
a = sets.new()
sets.add_each(a, 'foo', 'bar', 'baz')
asserts.equals(env, ['foo', 'bar', 'baz'], list(a))
def set_behavior_test(env):
a = sets.new('foo', 'bar', 'baz')
sets.add(a, 'bar')
asserts.equals(env, ['foo', 'bar', 'baz'], list(a))
def pop_test(env):
a = sets.new('a', 'b', 'c')
item = sets.pop(a)
asserts.equals(env, 2, len(a))
item = sets.pop(a)
asserts.equals(env, 1, len(a))
item = sets.pop(a)
asserts.equals(env, 0, len(a))
def contains_test(env):
a = sets.new('a')
asserts.true(env, sets.contains(a, 'a'))
asserts.false(env, sets.contains(a, 'b'))
def difference_test(env):
a = sets.new('a', 'b', 'c')
b = sets.new('c', 'd', 'e')
asserts.equals(env, sets.new('d', 'e'), sets.difference(a, b))
asserts.equals(env, sets.new('a', 'b'), sets.difference(b, a))
def disjoint_test(env):
a = sets.new('a', 'b', 'c')
b = sets.new('c', 'd', 'e')
asserts.equals(env, sets.new('a', 'b', 'd', 'e'), sets.disjoint(a, b))
tests = [new_test, equality_test, inequality_test, pop_test, add_test, add_all_as_dict_test, add_all_as_list_test, add_each_test, set_behavior_test, contains_test, difference_test, disjoint_test]
def suite():
return test_suite('sets', tests=TESTS) |
#Write a function that accepts a filename as input argument and reads the file and saves each line of the file as an element
#in a list (without the new line ("\n")character) and returns the list. Each line of the file has comma separated values
# Type your code here
def list_from_file(file_name):
# Make a connection to the file
file_pointer = open(file_name, 'r')
# You can use either .read() or .readline() or .readlines()
data = file_pointer.readlines()
# NOW CONTINUE YOUR CODE FROM HERE!!!
final_list = []
for x in data:
final_list.append(x.strip('\n'))
return final_list
file_pointer.close()
print(list_from_file('file_name.txt')) | def list_from_file(file_name):
file_pointer = open(file_name, 'r')
data = file_pointer.readlines()
final_list = []
for x in data:
final_list.append(x.strip('\n'))
return final_list
file_pointer.close()
print(list_from_file('file_name.txt')) |
# Instruction opcodes
_CHAR = 0
_NEWLINE = 1
_FONT = 2
_COLOR = 3
_SHAKE = 4
_WAIT = 5
_CUSTOM = 6
class Graph:
def __init__(self, default_font):
self.instructions = []
self.default_font = default_font
def string(self, s):
'''Adds a string of characters to the passage.'''
for c in s:
self.instructions.append((_CHAR, c))
def draw(self, dst, x, y):
'''Draw the passage.'''
cursor_x = x
cursor_y = y
font = self.default_font
color = (255, 255, 255)
shake = None
char_index = 0 # For shake effects
for op in self.instructions:
if op[0] == _CHAR:
# The character we need to draw
ch = op[1]
# Offset by shake
off_x, off_y = 0, 0
if shake:
off_x, off_y = shake(char_index)
# Draw it
font.draw_glyph(dst, cursor_x+off_x, cursor_y+off_y, color, ch)
# Advance the cursor
cursor_x += font.get_glyph_width(ch)
char_index += 1
elif op[0] == _NEWLINE:
cursor_x = x
cursor_y += font.get_linesize()
elif op[0] == _FONT:
font = op[1]
elif op[0] == _COLOR:
color = (op[1], op[2], op[3])
elif op[0] == _SHAKE:
shake = op[1]
def newline(self):
'''Add a newline to the passage.'''
self.instructions.append((_NEWLINE,))
def font(self, font):
'''Use a new font for this part of the passage.'''
self.instructions.append((_FONT, font))
def color(self, r, g, b):
'''Use a new color for this part of the passage.'''
self.instructions.append((_COLOR, r, g, b))
def shake(self, func):
'''Use a shake function for this part of the passage.'''
self.instructions.append((_SHAKE, func))
class Typewriter:
'''Wraps around a Graph, throttling character output.'''
def __init__(self, view):
self.view = view
self.queue = []
def slow_string(self, delay, s):
'''Queue up a slow string of characters.'''
for c in s:
self.wait(delay)
self.string(c)
def string(self, s):
'''Queue up a string of characters.'''
for c in s:
self.queue.append((_CHAR, c))
def draw(self, dst, x, y):
'''Draw the graph somewhere.'''
self.view.draw(dst, x, y)
def newline(self):
'''Queue up a newline.'''
self.queue.append((_NEWLINE,))
def font(self, surface_list):
'''Queue up a font change.'''
self.queue.append((_FONT, surface_list))
def color(self, r, g, b):
'''Queue up a color change.'''
self.queue.append((_COLOR, r, g, b))
def shake(self, func):
'''Queue up a shake-function change.'''
self.queue.append((_SHAKE, func))
def pulse(self):
'''Executes the queue up to the first printed character.'''
while self.queue:
op = self.queue.pop(0)
if op[0] == _CHAR:
self.view.string(op[1])
break
elif op[0] == _NEWLINE:
self.view.newline()
elif op[0] == _FONT:
self.view.font(op[1])
elif op[0] == _COLOR:
self.view.color(op[1], op[2], op[3])
elif op[0] == _SHAKE:
self.view.shake(op[1])
elif op[0] == _WAIT:
break
elif op[0] == _CUSTOM:
op[1]()
def flush(self):
'''Flush the whole queue.'''
while self.queue:
self.pulse()
def wait(self, n):
'''Queue up a delay.'''
for _ in xrange(n):
self.queue.append((_WAIT,))
def custom(self, func):
'''Queue up a custom function call.'''
self.queue.append((_CUSTOM, func))
| _char = 0
_newline = 1
_font = 2
_color = 3
_shake = 4
_wait = 5
_custom = 6
class Graph:
def __init__(self, default_font):
self.instructions = []
self.default_font = default_font
def string(self, s):
"""Adds a string of characters to the passage."""
for c in s:
self.instructions.append((_CHAR, c))
def draw(self, dst, x, y):
"""Draw the passage."""
cursor_x = x
cursor_y = y
font = self.default_font
color = (255, 255, 255)
shake = None
char_index = 0
for op in self.instructions:
if op[0] == _CHAR:
ch = op[1]
(off_x, off_y) = (0, 0)
if shake:
(off_x, off_y) = shake(char_index)
font.draw_glyph(dst, cursor_x + off_x, cursor_y + off_y, color, ch)
cursor_x += font.get_glyph_width(ch)
char_index += 1
elif op[0] == _NEWLINE:
cursor_x = x
cursor_y += font.get_linesize()
elif op[0] == _FONT:
font = op[1]
elif op[0] == _COLOR:
color = (op[1], op[2], op[3])
elif op[0] == _SHAKE:
shake = op[1]
def newline(self):
"""Add a newline to the passage."""
self.instructions.append((_NEWLINE,))
def font(self, font):
"""Use a new font for this part of the passage."""
self.instructions.append((_FONT, font))
def color(self, r, g, b):
"""Use a new color for this part of the passage."""
self.instructions.append((_COLOR, r, g, b))
def shake(self, func):
"""Use a shake function for this part of the passage."""
self.instructions.append((_SHAKE, func))
class Typewriter:
"""Wraps around a Graph, throttling character output."""
def __init__(self, view):
self.view = view
self.queue = []
def slow_string(self, delay, s):
"""Queue up a slow string of characters."""
for c in s:
self.wait(delay)
self.string(c)
def string(self, s):
"""Queue up a string of characters."""
for c in s:
self.queue.append((_CHAR, c))
def draw(self, dst, x, y):
"""Draw the graph somewhere."""
self.view.draw(dst, x, y)
def newline(self):
"""Queue up a newline."""
self.queue.append((_NEWLINE,))
def font(self, surface_list):
"""Queue up a font change."""
self.queue.append((_FONT, surface_list))
def color(self, r, g, b):
"""Queue up a color change."""
self.queue.append((_COLOR, r, g, b))
def shake(self, func):
"""Queue up a shake-function change."""
self.queue.append((_SHAKE, func))
def pulse(self):
"""Executes the queue up to the first printed character."""
while self.queue:
op = self.queue.pop(0)
if op[0] == _CHAR:
self.view.string(op[1])
break
elif op[0] == _NEWLINE:
self.view.newline()
elif op[0] == _FONT:
self.view.font(op[1])
elif op[0] == _COLOR:
self.view.color(op[1], op[2], op[3])
elif op[0] == _SHAKE:
self.view.shake(op[1])
elif op[0] == _WAIT:
break
elif op[0] == _CUSTOM:
op[1]()
def flush(self):
"""Flush the whole queue."""
while self.queue:
self.pulse()
def wait(self, n):
"""Queue up a delay."""
for _ in xrange(n):
self.queue.append((_WAIT,))
def custom(self, func):
"""Queue up a custom function call."""
self.queue.append((_CUSTOM, func)) |
class DummyField(object):
def __init__(self, value, **kwargs):
self.value = value
for k_, v_ in kwargs.items():
setattr(self, k_, v_)
| class Dummyfield(object):
def __init__(self, value, **kwargs):
self.value = value
for (k_, v_) in kwargs.items():
setattr(self, k_, v_) |
class TempProps:
def __init__(self, start_temperature, grad_temperature, temperature_coefficient):
self.start_temp = start_temperature
self.grad_temp = grad_temperature
self.temp_coeff = temperature_coefficient
def __str__(self):
out_str = ""
out_str += "start temp: " + str(self.start_temp)
out_str += "\tgrad temp: " + str(self.grad_temp)
out_str += "\ttemp coefficient: " + str(self.temp_coeff)
return out_str
def is_empty(self):
if self.start_temp == 0 and self.grad_temp == 0 and self.temp_coeff == 0:
return True
return False
| class Tempprops:
def __init__(self, start_temperature, grad_temperature, temperature_coefficient):
self.start_temp = start_temperature
self.grad_temp = grad_temperature
self.temp_coeff = temperature_coefficient
def __str__(self):
out_str = ''
out_str += 'start temp: ' + str(self.start_temp)
out_str += '\tgrad temp: ' + str(self.grad_temp)
out_str += '\ttemp coefficient: ' + str(self.temp_coeff)
return out_str
def is_empty(self):
if self.start_temp == 0 and self.grad_temp == 0 and (self.temp_coeff == 0):
return True
return False |
class SmallArray():
def __init__(self) -> None:
self.clusters = 0
self.cluster_size = 0 | class Smallarray:
def __init__(self) -> None:
self.clusters = 0
self.cluster_size = 0 |
class ValidationError(Exception):
pass
class empty(Exception):
pass
| class Validationerror(Exception):
pass
class Empty(Exception):
pass |
# 1 and 9
TERMINAL_INDICES = [0, 8, 9, 17, 18, 26]
# dragons and winds
EAST = 27
SOUTH = 28
WEST = 29
NORTH = 30
HAKU = 31
HATSU = 32
CHUN = 33
WINDS = [EAST, SOUTH, WEST, NORTH]
HONOR_INDICES = WINDS + [HAKU, HATSU, CHUN]
FIVE_RED_MAN = 16
FIVE_RED_PIN = 52
FIVE_RED_SOU = 88
AKA_DORA_LIST = [FIVE_RED_MAN, FIVE_RED_PIN, FIVE_RED_SOU]
DISPLAY_WINDS = {
EAST: 'East',
SOUTH: 'South',
WEST: 'West',
NORTH: 'North'
}
| terminal_indices = [0, 8, 9, 17, 18, 26]
east = 27
south = 28
west = 29
north = 30
haku = 31
hatsu = 32
chun = 33
winds = [EAST, SOUTH, WEST, NORTH]
honor_indices = WINDS + [HAKU, HATSU, CHUN]
five_red_man = 16
five_red_pin = 52
five_red_sou = 88
aka_dora_list = [FIVE_RED_MAN, FIVE_RED_PIN, FIVE_RED_SOU]
display_winds = {EAST: 'East', SOUTH: 'South', WEST: 'West', NORTH: 'North'} |
# #class
class user:
def __init__(self,first_name,last_name,birth,sex): # this is the main class's (attribute)function , self is the main v
self.first_name=first_name
self.last_name=last_name
self.birth=birth
self.sex=sex
def grit(self):
print (f"name: {self.first_name},{self.last_name}, year: {self.birth}")
def calc_age (self, curr_year):
return 2021-self.birth
def calc_avg(self,other): #static
z=(self.calc_age(2021)+other.calc_age(2021))/2
return z
user_data=input(" Enter Ur name , last name , birth year, sex separated by pint: ").split(".")
user1=user("paul" ,"yo" ,1991 ,"male")
# user1.grit()
# print(user1.calc_age(2021))
user2=user("mariam","khoury",1993,"female")
# user2.grit()
# a= user.calc_avg (user1,user2)
# print(a)
user3=user(user_data[0],user_data[1],user_data[2],user_data[3])
user3.grit()
# import math as m # here we call it as new name (m)
# import os #???????
# import antigravity
# # pypi.org
# import random
# import cos
# x=10
# y=m.pow(x,2) #math.cos()
# print(y)
# __name__=="__main__"
# side file
# def printing(name):
# print(f"I am afraid {name}")
# if __name__=="__main__":
# print("wubba lubba DbDub")
# main file
# import my_file
# n=input("enter your friend's name: ")
# my_file.printing(n) | class User:
def __init__(self, first_name, last_name, birth, sex):
self.first_name = first_name
self.last_name = last_name
self.birth = birth
self.sex = sex
def grit(self):
print(f'name: {self.first_name},{self.last_name}, year: {self.birth}')
def calc_age(self, curr_year):
return 2021 - self.birth
def calc_avg(self, other):
z = (self.calc_age(2021) + other.calc_age(2021)) / 2
return z
user_data = input(' Enter Ur name , last name , birth year, sex separated by pint: ').split('.')
user1 = user('paul', 'yo', 1991, 'male')
user2 = user('mariam', 'khoury', 1993, 'female')
user3 = user(user_data[0], user_data[1], user_data[2], user_data[3])
user3.grit() |
DEBUG = True
TEMPLATE_DEBUG = DEBUG
STATIC_DEBUG = DEBUG
CRISPY_FAIL_SILENTLY = not DEBUG
ADMINS = (
('Dummy', 'dummy@example.org'),
)
MANAGERS = ADMINS
DATABASES = {
'default': {
'NAME': 'sdemo.db',
'ENGINE': 'django.db.backends.sqlite3',
'USER': '',
'PASSWORD': ''
}
}
# Absolute filesystem path to the directory that will hold user-uploaded files.
# Example: "/home/media/media.lawrence.com/media/"
MEDIA_ROOT = ''
# URL that handles the media served from MEDIA_ROOT. Make sure to use a
# trailing slash.
# Examples: "http://media.lawrence.com/media/", "http://example.com/media/"
MEDIA_URL = ''
# Absolute path to the directory static files should be collected to.
# Don't put anything in this directory yourself; store your static files
# in apps' "static/" subdirectories and in STATICFILES_DIRS.
# Example: "/home/media/media.lawrence.com/static/"
STATIC_ROOT = ''
# URL prefix for static files.
# Example: "http://media.lawrence.com/static/"
STATIC_URL = '/static/'
# URL prefix for admin media
# USE TRAILING SLASH
ADMIN_MEDIA_PREFIX = STATIC_URL + 'admin/'
# Make this unique, and don't share it with anybody.
# Remember to change this!
SECRET_KEY = 'lic-@(-)mi^b&**h1ggnbyya2qiivaop-@c#3@m3w%m1o73j8@' | debug = True
template_debug = DEBUG
static_debug = DEBUG
crispy_fail_silently = not DEBUG
admins = (('Dummy', 'dummy@example.org'),)
managers = ADMINS
databases = {'default': {'NAME': 'sdemo.db', 'ENGINE': 'django.db.backends.sqlite3', 'USER': '', 'PASSWORD': ''}}
media_root = ''
media_url = ''
static_root = ''
static_url = '/static/'
admin_media_prefix = STATIC_URL + 'admin/'
secret_key = 'lic-@(-)mi^b&**h1ggnbyya2qiivaop-@c#3@m3w%m1o73j8@' |
def path(current, visited_small_caves, cmap):
if current == 'end':
return [[current]]
next_caves = cmap[current]
paths = []
for next_cave in next_caves:
if next_cave in visited_small_caves:
continue
if next_cave.islower():
next_visited_small_caves = visited_small_caves + [next_cave]
else:
next_visited_small_caves = visited_small_caves
followups = path(next_cave, next_visited_small_caves, cmap)
for followup in followups:
paths.append([current] + followup)
return paths
with open('input.txt') as input:
connections = [(line.split('-')[0], line.strip().split('-')[1]) for line in input.readlines()]
# build connection map
cmap = {}
for s, e in connections:
if s in cmap:
cmap[s].append(e)
else:
cmap[s] = [e]
if e in cmap:
cmap[e].append(s)
else:
cmap[e] = [s]
paths = path('start', ['start'], cmap)
print(len(paths)) # 4754 | def path(current, visited_small_caves, cmap):
if current == 'end':
return [[current]]
next_caves = cmap[current]
paths = []
for next_cave in next_caves:
if next_cave in visited_small_caves:
continue
if next_cave.islower():
next_visited_small_caves = visited_small_caves + [next_cave]
else:
next_visited_small_caves = visited_small_caves
followups = path(next_cave, next_visited_small_caves, cmap)
for followup in followups:
paths.append([current] + followup)
return paths
with open('input.txt') as input:
connections = [(line.split('-')[0], line.strip().split('-')[1]) for line in input.readlines()]
cmap = {}
for (s, e) in connections:
if s in cmap:
cmap[s].append(e)
else:
cmap[s] = [e]
if e in cmap:
cmap[e].append(s)
else:
cmap[e] = [s]
paths = path('start', ['start'], cmap)
print(len(paths)) |
def func1(a):
a += 1
def funct2(b):
val = 1+b
return val
return funct2(a)
print(func1(5)) | def func1(a):
a += 1
def funct2(b):
val = 1 + b
return val
return funct2(a)
print(func1(5)) |
# You're given strings J representing the types of stones that are jewels, and S representing the stones you have. Each character in S is a type of stone you have. You want to know how many of the stones you have are also jewels.
# The letters in J are guaranteed distinct, and all characters in J and S are letters. Letters are case sensitive, so "a" is considered a different type of stone from "A".
# Example 1:
# Input: J = "aA", S = "aAAbbbb"
# Output: 3
# Example 2:
# Input: J = "z", S = "ZZ"
# Output: 0
# Note:
# S and J will consist of letters and have length at most 50.
# The characters in J are distinct.
class Solution:
def numJewelsInStones(self, J, S):
count=0
if (J.isalpha() and S.isalpha() and len(J) <= 50 and len(S) <= 50):
for stones in S:
if stones in J:
count +=1
return count
if __name__ == "__main__":
J="aA"
S="aAAbbbb"
print(Solution().numJewelsInStones(J,S)) | class Solution:
def num_jewels_in_stones(self, J, S):
count = 0
if J.isalpha() and S.isalpha() and (len(J) <= 50) and (len(S) <= 50):
for stones in S:
if stones in J:
count += 1
return count
if __name__ == '__main__':
j = 'aA'
s = 'aAAbbbb'
print(solution().numJewelsInStones(J, S)) |
#identify cycles in a linked list
def has_cycle(head):
taboo_list = list()
temp = head
while temp:
if temp not in taboo_list:
taboo_list.append(temp)
temp = temp.next
else:
return 1
return 0
| def has_cycle(head):
taboo_list = list()
temp = head
while temp:
if temp not in taboo_list:
taboo_list.append(temp)
temp = temp.next
else:
return 1
return 0 |
# CAN controls for MQB platform Volkswagen, Audi, Skoda and SEAT.
# PQ35/PQ46/NMS, and any future MLB, to come later.
def create_mqb_steering_control(packer, bus, apply_steer, idx, lkas_enabled):
values = {
"SET_ME_0X3": 0x3,
"Assist_Torque": abs(apply_steer),
"Assist_Requested": lkas_enabled,
"Assist_VZ": 1 if apply_steer < 0 else 0,
"HCA_Available": 1,
"HCA_Standby": not lkas_enabled,
"HCA_Active": lkas_enabled,
"SET_ME_0XFE": 0xFE,
"SET_ME_0X07": 0x07,
}
return packer.make_can_msg("HCA_01", bus, values, idx)
def create_mqb_hud_control(packer, bus, enabled, steering_pressed, hud_alert, left_lane_visible, right_lane_visible,
ldw_stock_values, left_lane_depart, right_lane_depart):
# Lane color reference:
# 0 (LKAS disabled) - off
# 1 (LKAS enabled, no lane detected) - dark gray
# 2 (LKAS enabled, lane detected) - light gray on VW, green or white on Audi depending on year or virtual cockpit. On a color MFD on a 2015 A3 TDI it is white, virtual cockpit on a 2018 A3 e-Tron its green.
# 3 (LKAS enabled, lane departure detected) - white on VW, red on Audi
values = ldw_stock_values.copy()
values.update({
"LDW_Status_LED_gelb": 1 if enabled and steering_pressed else 0,
"LDW_Status_LED_gruen": 1 if enabled and not steering_pressed else 0,
"LDW_Lernmodus_links": 3 if left_lane_depart else 1 + left_lane_visible,
"LDW_Lernmodus_rechts": 3 if right_lane_depart else 1 + right_lane_visible,
"LDW_Texte": hud_alert,
})
return packer.make_can_msg("LDW_02", bus, values)
def create_mqb_acc_buttons_control(packer, bus, buttonStatesToSend, CS, idx):
values = {
"GRA_Hauptschalter": CS.graHauptschalter,
"GRA_Abbrechen": buttonStatesToSend["cancel"],
"GRA_Tip_Setzen": buttonStatesToSend["setCruise"],
"GRA_Tip_Hoch": buttonStatesToSend["accelCruise"],
"GRA_Tip_Runter": buttonStatesToSend["decelCruise"],
"GRA_Tip_Wiederaufnahme": buttonStatesToSend["resumeCruise"],
"GRA_Verstellung_Zeitluecke": 3 if buttonStatesToSend["gapAdjustCruise"] else 0,
"GRA_Typ_Hauptschalter": CS.graTypHauptschalter,
"GRA_Codierung": 2,
"GRA_Tip_Stufe_2": CS.graTipStufe2,
"GRA_ButtonTypeInfo": CS.graButtonTypeInfo
}
return packer.make_can_msg("GRA_ACC_01", bus, values, idx)
def create_mqb_acc_02_control(packer, bus, acc_status, set_speed, speed_visible, lead_visible, idx):
values = {
"ACC_Status_Anzeige": 3 if acc_status == 5 else acc_status,
"ACC_Wunschgeschw": 327.36 if not speed_visible else set_speed,
"ACC_Gesetzte_Zeitluecke": 3,
"ACC_Display_Prio": 3,
"ACC_Abstandsindex": 637 if lead_visible else 0,
}
return packer.make_can_msg("ACC_02", bus, values, idx)
def create_mqb_acc_04_control(packer, bus, acc_04_stock_values, idx):
values = acc_04_stock_values.copy()
# Suppress disengagement alert from stock radar when OP long is in use, but passthru FCW/AEB alerts
if values["ACC_Texte_braking_guard"] == 4:
values["ACC_Texte_braking_guard"] = 0
return packer.make_can_msg("ACC_04", bus, values, idx)
def create_mqb_acc_06_control(packer, bus, enabled, acc_status, accel, acc_stopping, acc_starting,
cb_pos, cb_neg, acc_type, idx):
values = {
"ACC_Typ": acc_type,
"ACC_Status_ACC": acc_status,
"ACC_StartStopp_Info": enabled,
"ACC_Sollbeschleunigung_02": accel if enabled else 3.01,
"ACC_zul_Regelabw_unten": cb_neg,
"ACC_zul_Regelabw_oben": cb_pos,
"ACC_neg_Sollbeschl_Grad_02": 4.0 if enabled else 0,
"ACC_pos_Sollbeschl_Grad_02": 4.0 if enabled else 0,
"ACC_Anfahren": acc_starting,
"ACC_Anhalten": acc_stopping,
}
return packer.make_can_msg("ACC_06", bus, values, idx)
def create_mqb_acc_07_control(packer, bus, enabled, accel, acc_hold_request, acc_hold_release,
acc_hold_type, stopping_distance, idx):
values = {
"ACC_Distance_to_Stop": stopping_distance,
"ACC_Hold_Request": acc_hold_request,
"ACC_Freewheel_Type": 2 if enabled else 0,
"ACC_Hold_Type": acc_hold_type,
"ACC_Hold_Release": acc_hold_release,
"ACC_Accel_Secondary": 3.02, # not using this unless and until we understand its impact
"ACC_Accel_TSK": accel if enabled else 3.01,
}
return packer.make_can_msg("ACC_07", bus, values, idx)
| def create_mqb_steering_control(packer, bus, apply_steer, idx, lkas_enabled):
values = {'SET_ME_0X3': 3, 'Assist_Torque': abs(apply_steer), 'Assist_Requested': lkas_enabled, 'Assist_VZ': 1 if apply_steer < 0 else 0, 'HCA_Available': 1, 'HCA_Standby': not lkas_enabled, 'HCA_Active': lkas_enabled, 'SET_ME_0XFE': 254, 'SET_ME_0X07': 7}
return packer.make_can_msg('HCA_01', bus, values, idx)
def create_mqb_hud_control(packer, bus, enabled, steering_pressed, hud_alert, left_lane_visible, right_lane_visible, ldw_stock_values, left_lane_depart, right_lane_depart):
values = ldw_stock_values.copy()
values.update({'LDW_Status_LED_gelb': 1 if enabled and steering_pressed else 0, 'LDW_Status_LED_gruen': 1 if enabled and (not steering_pressed) else 0, 'LDW_Lernmodus_links': 3 if left_lane_depart else 1 + left_lane_visible, 'LDW_Lernmodus_rechts': 3 if right_lane_depart else 1 + right_lane_visible, 'LDW_Texte': hud_alert})
return packer.make_can_msg('LDW_02', bus, values)
def create_mqb_acc_buttons_control(packer, bus, buttonStatesToSend, CS, idx):
values = {'GRA_Hauptschalter': CS.graHauptschalter, 'GRA_Abbrechen': buttonStatesToSend['cancel'], 'GRA_Tip_Setzen': buttonStatesToSend['setCruise'], 'GRA_Tip_Hoch': buttonStatesToSend['accelCruise'], 'GRA_Tip_Runter': buttonStatesToSend['decelCruise'], 'GRA_Tip_Wiederaufnahme': buttonStatesToSend['resumeCruise'], 'GRA_Verstellung_Zeitluecke': 3 if buttonStatesToSend['gapAdjustCruise'] else 0, 'GRA_Typ_Hauptschalter': CS.graTypHauptschalter, 'GRA_Codierung': 2, 'GRA_Tip_Stufe_2': CS.graTipStufe2, 'GRA_ButtonTypeInfo': CS.graButtonTypeInfo}
return packer.make_can_msg('GRA_ACC_01', bus, values, idx)
def create_mqb_acc_02_control(packer, bus, acc_status, set_speed, speed_visible, lead_visible, idx):
values = {'ACC_Status_Anzeige': 3 if acc_status == 5 else acc_status, 'ACC_Wunschgeschw': 327.36 if not speed_visible else set_speed, 'ACC_Gesetzte_Zeitluecke': 3, 'ACC_Display_Prio': 3, 'ACC_Abstandsindex': 637 if lead_visible else 0}
return packer.make_can_msg('ACC_02', bus, values, idx)
def create_mqb_acc_04_control(packer, bus, acc_04_stock_values, idx):
values = acc_04_stock_values.copy()
if values['ACC_Texte_braking_guard'] == 4:
values['ACC_Texte_braking_guard'] = 0
return packer.make_can_msg('ACC_04', bus, values, idx)
def create_mqb_acc_06_control(packer, bus, enabled, acc_status, accel, acc_stopping, acc_starting, cb_pos, cb_neg, acc_type, idx):
values = {'ACC_Typ': acc_type, 'ACC_Status_ACC': acc_status, 'ACC_StartStopp_Info': enabled, 'ACC_Sollbeschleunigung_02': accel if enabled else 3.01, 'ACC_zul_Regelabw_unten': cb_neg, 'ACC_zul_Regelabw_oben': cb_pos, 'ACC_neg_Sollbeschl_Grad_02': 4.0 if enabled else 0, 'ACC_pos_Sollbeschl_Grad_02': 4.0 if enabled else 0, 'ACC_Anfahren': acc_starting, 'ACC_Anhalten': acc_stopping}
return packer.make_can_msg('ACC_06', bus, values, idx)
def create_mqb_acc_07_control(packer, bus, enabled, accel, acc_hold_request, acc_hold_release, acc_hold_type, stopping_distance, idx):
values = {'ACC_Distance_to_Stop': stopping_distance, 'ACC_Hold_Request': acc_hold_request, 'ACC_Freewheel_Type': 2 if enabled else 0, 'ACC_Hold_Type': acc_hold_type, 'ACC_Hold_Release': acc_hold_release, 'ACC_Accel_Secondary': 3.02, 'ACC_Accel_TSK': accel if enabled else 3.01}
return packer.make_can_msg('ACC_07', bus, values, idx) |
#
# gambit
#
# Configuration file for gravity inversion for use by planeGravInv.py
# mesh has been made with mkGeoWithData2D.py
#
# Inversion constants:
#
# scale between misfit and regularization
mu = 1.e-14
#
# used to scale computed density. kg/m^3
rho_0 = 1.
#
# IPCG tolerance *|r| <= atol+rtol*|r0|* (energy norm)
# absolute tolerance for IPCG interations
atol = 0.
#
# relative tolerance for IPCG iterations
rtol = 1.e-3
#
# tolerance for solving PDEs
# make sure this is not more than the square of rtol
pdetol = 1.e-10
#
# maximum number of IPCG iterations
iter_max = 500
#
# data scale. Program assumes m/s^2,
# converts micrometres/s^2 to m/s^2
data_scale = 1.e-6
#
#
# File names
# mesh file name. This needs to be in msh or fly format
mesh_name = "G_201x338test.fly"
#
# data file name in netcdf format. See readme.md for more details.
data_file = "Gravity_201x338.nc"
#
# output file name for .csv output and silo output
output_name = "G_test_201x338_rho0_{0:1.3e}_mu_{1:1.3e}".format(rho_0,mu)
#
#
# Level for the verbosity of the output, "low", "medium" or "high".
# low:
# screen outputs:
# data range,
# summaries of gravity data and final gravity
# initial, final and difference misfits
# file output:
# silo of final solution
# medium: low outputs +
# screen outputs:
# residual norm from the IPCG iterations
# high: medium outputs +
# screen outputs:
# misfit and smoothing value at each iteration step
# file outputs:
# csv files for misfit and smoothing at each IPCG iteration
# silos at misfit values of 0.05, 0.01, 0.008 and 0.005. (Initial misfit is 0.5.)
VerboseLevel = "low"
#VerboseLevel = "medium"
#VerboseLevel = "high"
| mu = 1e-14
rho_0 = 1.0
atol = 0.0
rtol = 0.001
pdetol = 1e-10
iter_max = 500
data_scale = 1e-06
mesh_name = 'G_201x338test.fly'
data_file = 'Gravity_201x338.nc'
output_name = 'G_test_201x338_rho0_{0:1.3e}_mu_{1:1.3e}'.format(rho_0, mu)
verbose_level = 'low' |
def countWaysToChangeDigit(value):
result = 0
for i in str(value):
result += 9 - int(i)
return result
| def count_ways_to_change_digit(value):
result = 0
for i in str(value):
result += 9 - int(i)
return result |
def product(x):
t = 1
for n in x:
t *= n
return t
| def product(x):
t = 1
for n in x:
t *= n
return t |
# Note: The schema is stored in a .py file in order to take advantage of the
# int() and float() type coercion functions. Otherwise it could easily stored as
# as JSON or another serialized format.
'''This schema has been changed compared to the Udacity schema,
due to missing values for attributes 'user' and 'uid'.
It makes sense to keep them in the schema for use of other OSM data.'''
schema = {
'node': {
'type': 'dict',
'schema': {
'id': {'required': True, 'type': 'integer', 'coerce': int},
'lat': {'required': True, 'type': 'float', 'coerce': float},
'lon': {'required': True, 'type': 'float', 'coerce': float},
'user': {'required': False, 'type': 'string'},
'uid': {'required': False, 'type': 'integer', 'coerce': int},
'version': {'required': True, 'type': 'string'},
'changeset': {'required': True, 'type': 'integer', 'coerce': int},
'timestamp': {'required': True, 'type': 'string'}
}
},
'node_tags': {
'type': 'list',
'schema': {
'type': 'dict',
'schema': {
'id': {'required': True, 'type': 'integer', 'coerce': int},
'key': {'required': True, 'type': 'string'},
'value': {'required': True, 'type': 'string'},
'type': {'required': True, 'type': 'string'}
}
}
},
'way': {
'type': 'dict',
'schema': {
'id': {'required': True, 'type': 'integer', 'coerce': int},
'user': {'required': False, 'type': 'string'},
'uid': {'required': False, 'type': 'integer', 'coerce': int},
'version': {'required': True, 'type': 'string'},
'changeset': {'required': True, 'type': 'integer', 'coerce': int},
'timestamp': {'required': True, 'type': 'string'}
}
},
'way_nodes': {
'type': 'list',
'schema': {
'type': 'dict',
'schema': {
'id': {'required': True, 'type': 'integer', 'coerce': int},
'node_id': {'required': True, 'type': 'integer', 'coerce': int},
'position': {'required': True, 'type': 'integer', 'coerce': int}
}
}
},
'way_tags': {
'type': 'list',
'schema': {
'type': 'dict',
'schema': {
'id': {'required': True, 'type': 'integer', 'coerce': int},
'key': {'required': True, 'type': 'string'},
'value': {'required': True, 'type': 'string'},
'type': {'required': True, 'type': 'string'}
}
}
}
}
| """This schema has been changed compared to the Udacity schema,
due to missing values for attributes 'user' and 'uid'.
It makes sense to keep them in the schema for use of other OSM data."""
schema = {'node': {'type': 'dict', 'schema': {'id': {'required': True, 'type': 'integer', 'coerce': int}, 'lat': {'required': True, 'type': 'float', 'coerce': float}, 'lon': {'required': True, 'type': 'float', 'coerce': float}, 'user': {'required': False, 'type': 'string'}, 'uid': {'required': False, 'type': 'integer', 'coerce': int}, 'version': {'required': True, 'type': 'string'}, 'changeset': {'required': True, 'type': 'integer', 'coerce': int}, 'timestamp': {'required': True, 'type': 'string'}}}, 'node_tags': {'type': 'list', 'schema': {'type': 'dict', 'schema': {'id': {'required': True, 'type': 'integer', 'coerce': int}, 'key': {'required': True, 'type': 'string'}, 'value': {'required': True, 'type': 'string'}, 'type': {'required': True, 'type': 'string'}}}}, 'way': {'type': 'dict', 'schema': {'id': {'required': True, 'type': 'integer', 'coerce': int}, 'user': {'required': False, 'type': 'string'}, 'uid': {'required': False, 'type': 'integer', 'coerce': int}, 'version': {'required': True, 'type': 'string'}, 'changeset': {'required': True, 'type': 'integer', 'coerce': int}, 'timestamp': {'required': True, 'type': 'string'}}}, 'way_nodes': {'type': 'list', 'schema': {'type': 'dict', 'schema': {'id': {'required': True, 'type': 'integer', 'coerce': int}, 'node_id': {'required': True, 'type': 'integer', 'coerce': int}, 'position': {'required': True, 'type': 'integer', 'coerce': int}}}}, 'way_tags': {'type': 'list', 'schema': {'type': 'dict', 'schema': {'id': {'required': True, 'type': 'integer', 'coerce': int}, 'key': {'required': True, 'type': 'string'}, 'value': {'required': True, 'type': 'string'}, 'type': {'required': True, 'type': 'string'}}}}} |
class Port:
def __init__(self, mac_address, ip_address, mtu):
self.mac_address = mac_address
self.ip_address = ip_address
self.mtu = mtu
def __str__(self):
return '(%s - %s - %d)' % (self.mac_address, self.ip_address, self.mtu)
| class Port:
def __init__(self, mac_address, ip_address, mtu):
self.mac_address = mac_address
self.ip_address = ip_address
self.mtu = mtu
def __str__(self):
return '(%s - %s - %d)' % (self.mac_address, self.ip_address, self.mtu) |
class Context:
def __init__(self, **kwargs):
self.message = kwargs.get("message")
self.command = kwargs.get("command")
def print(self, content, *, indent=0, **kwargs):
if indent > 0:
lines = content.split("\n")
for line in lines:
prefix = "| " * indent
print(prefix + line, **kwargs)
else:
print(content, **kwargs)
def print_empty(self, indent=0):
if indent > 0:
print("| " * indent)
else:
print()
| class Context:
def __init__(self, **kwargs):
self.message = kwargs.get('message')
self.command = kwargs.get('command')
def print(self, content, *, indent=0, **kwargs):
if indent > 0:
lines = content.split('\n')
for line in lines:
prefix = '| ' * indent
print(prefix + line, **kwargs)
else:
print(content, **kwargs)
def print_empty(self, indent=0):
if indent > 0:
print('| ' * indent)
else:
print() |
'''
Config! Change as needed.
NOTE: Please make sure that all information (except for authentication keys)
are passed in lower-case!
'''
# Your twitter access tokens. These are your accounts that you will enter giveaways from.
# Add as many users as you want, and please make sure to enter your username in lower case!
access_tokens = {
"user1" : {
'consumer_key' : '',
'consumer_secret' : '',
'access_token' : '',
'access_token_secret' : ''
},
"user2" : {
'consumer_key' : '',
'consumer_secret' : '',
'access_token' : '',
'access_token_secret' : ''
},
"user3" : {
'consumer_key' : '',
'consumer_secret' : '',
'access_token' : '',
'access_token_secret' : ''
}
}
# REQUIRED
# Users that you would like to tag in the giveaway. Add three users here.
tag_users = ["z1rk4", "user2", "user3"]
#REQUIRED
# Keywords that the bot will search for in tweets. Change/add as many as you want!
keywords = ["giveaway", "coding", "python"]
# OPTIONAL
# Account names that you want to specifically search for giveaway tweets.
# Add as many as you want!
account_names = ["giveaway_account1", "giveaway_account2", "giveaway_account3"]
# OPTIONAL
# Add your own custom replies here that are triggered upon a specific keyword.
# NOTE: Program may not be able to send reply if replies are too long! Please be careful
# with how many custom replies you use :)
custom_replies = {
"keyword1" : "reply1",
"keyword2" : "reply2",
"keyword3" : "reply3",
}
'''
Leave the variables below alone if you do not have the respective information.
'''
# OPTIONAL
# Your steam trade link
trade_link = ""
# OPTIONAL
# Your wax trade link
wax_trade_link = ""
# OPTIONAL
# Your DatDrop profile link
datdrop_profile_link = ""
# IGNORE
link_paste_keywords = ["tradelink", "trade link", " tl"] | """
Config! Change as needed.
NOTE: Please make sure that all information (except for authentication keys)
are passed in lower-case!
"""
access_tokens = {'user1': {'consumer_key': '', 'consumer_secret': '', 'access_token': '', 'access_token_secret': ''}, 'user2': {'consumer_key': '', 'consumer_secret': '', 'access_token': '', 'access_token_secret': ''}, 'user3': {'consumer_key': '', 'consumer_secret': '', 'access_token': '', 'access_token_secret': ''}}
tag_users = ['z1rk4', 'user2', 'user3']
keywords = ['giveaway', 'coding', 'python']
account_names = ['giveaway_account1', 'giveaway_account2', 'giveaway_account3']
custom_replies = {'keyword1': 'reply1', 'keyword2': 'reply2', 'keyword3': 'reply3'}
'\nLeave the variables below alone if you do not have the respective information.\n'
trade_link = ''
wax_trade_link = ''
datdrop_profile_link = ''
link_paste_keywords = ['tradelink', 'trade link', ' tl'] |
n, m = [int(x) for x in input().split()]
edges = [[int(x) for x in input().split()] for _ in range(m)]
if m < n - 1:
print(0)
exit()
paths = []
start = 1
still_possible = True
while still_possible:
passed = [1]
current = start
for i in range(1, n):
for e in edges:
if e[0] == current and e[1] != current and not (e[1] in passed):
for path in paths:
if path[i] == e[1]:
break
else:
passed.append(e[1])
current = e[1]
break
elif e[0] != current and e[1] == current and not (e[0] in passed):
for path in paths:
if path[i] == e[0]:
break
else:
passed.append(e[0])
current = e[0]
break
else: # if e all in edges are not accepted
if passed == [1]:
still_possible = False
break
if len(passed) == n:
paths.append(passed)
print(len(paths))
| (n, m) = [int(x) for x in input().split()]
edges = [[int(x) for x in input().split()] for _ in range(m)]
if m < n - 1:
print(0)
exit()
paths = []
start = 1
still_possible = True
while still_possible:
passed = [1]
current = start
for i in range(1, n):
for e in edges:
if e[0] == current and e[1] != current and (not e[1] in passed):
for path in paths:
if path[i] == e[1]:
break
else:
passed.append(e[1])
current = e[1]
break
elif e[0] != current and e[1] == current and (not e[0] in passed):
for path in paths:
if path[i] == e[0]:
break
else:
passed.append(e[0])
current = e[0]
break
else:
if passed == [1]:
still_possible = False
break
if len(passed) == n:
paths.append(passed)
print(len(paths)) |
def is_unique_points(points=None):
if points is None:
points = {}
points_dict = {}
for key, values in points.items():
new_key = '%s:%s' % tuple(values)
is_exists = points_dict.get(new_key, None)
if is_exists:
return False
else:
points_dict[new_key] = key
return True
| def is_unique_points(points=None):
if points is None:
points = {}
points_dict = {}
for (key, values) in points.items():
new_key = '%s:%s' % tuple(values)
is_exists = points_dict.get(new_key, None)
if is_exists:
return False
else:
points_dict[new_key] = key
return True |
def containsDuplicate(nums):
sorted = sorted(nums)
for i in range(len(nums)-1):
if nums[i] == nums[i+1]:
return True
return False | def contains_duplicate(nums):
sorted = sorted(nums)
for i in range(len(nums) - 1):
if nums[i] == nums[i + 1]:
return True
return False |
def find_max(root):
if not root:
return 0
if not root.left and not root.right:
return root.val
m = [0]
helper(root, m)
return m[0]
def helper(n, m):
if n.val > m[0]:
m[0] = n.val
if n.left:
helper(n.left, m)
if n.right:
helper(n.right, m)
| def find_max(root):
if not root:
return 0
if not root.left and (not root.right):
return root.val
m = [0]
helper(root, m)
return m[0]
def helper(n, m):
if n.val > m[0]:
m[0] = n.val
if n.left:
helper(n.left, m)
if n.right:
helper(n.right, m) |
# Definition for singly-linked list.
# class ListNode:
# def __init__(self, val=0, next=None):
# self.val = val
# self.next = next
# Definition for a binary tree node.
# class TreeNode:
# def __init__(self, val=0, left=None, right=None):
# self.val = val
# self.left = left
# self.right = right
class Solution:
def sortedListToBST(self, head: ListNode) -> TreeNode:
def getMedian(left: ListNode, right: ListNode) -> ListNode:
fast = slow = left
while fast != right and fast.next != right:
fast = fast.next.next
slow = slow.next
return slow
def recursive(left, right):
if left == right: return None
mid = getMedian(left, right)
root = TreeNode(mid.val)
root.left = recursive(left, mid)
root.right = recursive(mid.next, right)
return root
return recursive(head, None)
| class Solution:
def sorted_list_to_bst(self, head: ListNode) -> TreeNode:
def get_median(left: ListNode, right: ListNode) -> ListNode:
fast = slow = left
while fast != right and fast.next != right:
fast = fast.next.next
slow = slow.next
return slow
def recursive(left, right):
if left == right:
return None
mid = get_median(left, right)
root = tree_node(mid.val)
root.left = recursive(left, mid)
root.right = recursive(mid.next, right)
return root
return recursive(head, None) |
#!/usr/bin/env python3
def chdir(path, folder):
return path+"/"+folder
def previous(path):
temp = ""
for i in path.split("/")[1:-1]:
temp += "/"+i
return temp
| def chdir(path, folder):
return path + '/' + folder
def previous(path):
temp = ''
for i in path.split('/')[1:-1]:
temp += '/' + i
return temp |
# Bradley Grose
data = ("John", "Doe", 53.44)
format_string = "Hello %s %s. Your current balance is $%s"
print(format_string % data) | data = ('John', 'Doe', 53.44)
format_string = 'Hello %s %s. Your current balance is $%s'
print(format_string % data) |
def winning_score():
while True:
try:
winning_score = int(input("\nHow many points should "
"declare the winner? "))
except ValueError:
print("\nInvalid input type. Enter a positive number.")
continue
else:
if winning_score <= 0:
print("\nInvalid input value. Enter a positive number.")
continue
return winning_score
| def winning_score():
while True:
try:
winning_score = int(input('\nHow many points should declare the winner? '))
except ValueError:
print('\nInvalid input type. Enter a positive number.')
continue
else:
if winning_score <= 0:
print('\nInvalid input value. Enter a positive number.')
continue
return winning_score |
''' Else Statements
Code that executes if contitions checked evaluates to False.
''' | """ Else Statements
Code that executes if contitions checked evaluates to False.
""" |
class Solution:
def selfDividingNumbers(self, left: int, right: int) -> List[int]:
ret = []
for x in range(left, right + 1):
y = x
while y > 0:
z = y % 10
if z == 0 or x % z != 0:
break;
y //= 10
if y == 0:
ret.append(x)
return ret | class Solution:
def self_dividing_numbers(self, left: int, right: int) -> List[int]:
ret = []
for x in range(left, right + 1):
y = x
while y > 0:
z = y % 10
if z == 0 or x % z != 0:
break
y //= 10
if y == 0:
ret.append(x)
return ret |
# -*- coding: utf_8 -*-
__author__ = 'Yagg'
class ShipGroup:
def __init__(self, ownerName, count, shipType, driveTech, weaponTech, shieldTech, cargoTech, cargoType, cargoQuantity):
self.count = count
self.shipType = shipType
self.driveTech = driveTech
self.weaponTech = weaponTech
self.shieldTech = shieldTech
self.cargoTech = cargoTech
self.cargoType = cargoType
self.cargoQuantity = cargoQuantity
self.ownerName = ownerName
self.shipMass = 0
self.number = -1
self.liveCount = 0
self.battleStatus = ''
self.destinationPlanet = ''
self.sourcePlanet = ''
self.range = 0.0
self.speed = 0.0
self.fleetName = ''
self.groupStatus = ''
| __author__ = 'Yagg'
class Shipgroup:
def __init__(self, ownerName, count, shipType, driveTech, weaponTech, shieldTech, cargoTech, cargoType, cargoQuantity):
self.count = count
self.shipType = shipType
self.driveTech = driveTech
self.weaponTech = weaponTech
self.shieldTech = shieldTech
self.cargoTech = cargoTech
self.cargoType = cargoType
self.cargoQuantity = cargoQuantity
self.ownerName = ownerName
self.shipMass = 0
self.number = -1
self.liveCount = 0
self.battleStatus = ''
self.destinationPlanet = ''
self.sourcePlanet = ''
self.range = 0.0
self.speed = 0.0
self.fleetName = ''
self.groupStatus = '' |
class MyHookExtension(object):
def post_create_hook(self, archive, product):
pass
def post_ingest_hook(self, archive, product):
pass
def post_pull_hook(self, archive, product):
pass
def post_remove_hook(self, archive, product):
pass
_hook_extensions = {
'myhooks': MyHookExtension()
}
def hook_extensions():
return _hook_extensions.keys()
def hook_extension(name):
return _hook_extensions[name]
| class Myhookextension(object):
def post_create_hook(self, archive, product):
pass
def post_ingest_hook(self, archive, product):
pass
def post_pull_hook(self, archive, product):
pass
def post_remove_hook(self, archive, product):
pass
_hook_extensions = {'myhooks': my_hook_extension()}
def hook_extensions():
return _hook_extensions.keys()
def hook_extension(name):
return _hook_extensions[name] |
# return a go-to-goal heading vector in the robot's reference frame
def calculate_gtg_heading_vector( self ):
# get the inverse of the robot's pose
robot_inv_pos, robot_inv_theta = self.supervisor.estimated_pose().inverse().vector_unpack()
# calculate the goal vector in the robot's reference frame
goal = self.supervisor.goal()
goal = linalg.rotate_and_translate_vector( goal, robot_inv_theta, robot_inv_pos )
return goal
# calculate translational velocity
# velocity is v_max when omega is 0,
# drops rapidly to zero as |omega| rises
v = self.supervisor.v_max() / ( abs( omega ) + 1 )**0.5
| def calculate_gtg_heading_vector(self):
(robot_inv_pos, robot_inv_theta) = self.supervisor.estimated_pose().inverse().vector_unpack()
goal = self.supervisor.goal()
goal = linalg.rotate_and_translate_vector(goal, robot_inv_theta, robot_inv_pos)
return goal
v = self.supervisor.v_max() / (abs(omega) + 1) ** 0.5 |
# pylint: disable=global-statement,missing-docstring,blacklisted-name
foo = "test"
def broken():
global foo
bar = len(foo)
foo = foo[bar]
| foo = 'test'
def broken():
global foo
bar = len(foo)
foo = foo[bar] |
def parse_input():
fin = open('input_day3.txt','r')
inputs = []
for line in fin:
inputs.append(line.strip('\n'))
return inputs
def plot_path(inputs, path, ref_path=None):
x=0
y=0
c = 0
hits = []
for i in inputs.split(','):
(d, v) = (i[0],int(i[1:]))
fn = lambda x,y,p: (x,y)
if d == 'R':
fn = lambda x,y: (x + 1, y)
elif d == 'L':
fn = lambda x,y: (x - 1, y)
elif d == 'U':
fn = lambda x,y: (x, y + 1)
elif d == 'D':
fn = lambda x,y: (x, y - 1)
for p in range(1,v+1):
c+=1
x,y = fn(x,y)
key = "{}_{}".format(x,y)
if key in path:
pass # first count of steps is retained
else:
path[key] = c
# find intersections
if ref_path and key in ref_path:
hits.append(key)
return hits
def find_manhattan_dist(hits):
md_list = []
for h in hits:
(x,y) = map(int,h.split('_'))
md_list.append(abs(x) + abs(y))
return md_list
if __name__ == '__main__':
inputs = parse_input()
w1_path = {}
w2_path = {}
plot_path(inputs[0], w1_path)
hits = plot_path(inputs[1], w2_path, w1_path)
print('hits', hits)
# part one
md_list = find_manhattan_dist(hits)
print('manhattan distances', md_list)
print('Shortest', min(md_list))
# part two
steps = []
for h in hits:
steps.append(w1_path[h] + w2_path[h])
print('steps', steps);
print('shortest step', min(steps))
| def parse_input():
fin = open('input_day3.txt', 'r')
inputs = []
for line in fin:
inputs.append(line.strip('\n'))
return inputs
def plot_path(inputs, path, ref_path=None):
x = 0
y = 0
c = 0
hits = []
for i in inputs.split(','):
(d, v) = (i[0], int(i[1:]))
fn = lambda x, y, p: (x, y)
if d == 'R':
fn = lambda x, y: (x + 1, y)
elif d == 'L':
fn = lambda x, y: (x - 1, y)
elif d == 'U':
fn = lambda x, y: (x, y + 1)
elif d == 'D':
fn = lambda x, y: (x, y - 1)
for p in range(1, v + 1):
c += 1
(x, y) = fn(x, y)
key = '{}_{}'.format(x, y)
if key in path:
pass
else:
path[key] = c
if ref_path and key in ref_path:
hits.append(key)
return hits
def find_manhattan_dist(hits):
md_list = []
for h in hits:
(x, y) = map(int, h.split('_'))
md_list.append(abs(x) + abs(y))
return md_list
if __name__ == '__main__':
inputs = parse_input()
w1_path = {}
w2_path = {}
plot_path(inputs[0], w1_path)
hits = plot_path(inputs[1], w2_path, w1_path)
print('hits', hits)
md_list = find_manhattan_dist(hits)
print('manhattan distances', md_list)
print('Shortest', min(md_list))
steps = []
for h in hits:
steps.append(w1_path[h] + w2_path[h])
print('steps', steps)
print('shortest step', min(steps)) |
# This file is imported from __init__.py and exec'd from setup.py
__version__ = "1.0.0+dev"
VERSION = (1, 0, 0)
| __version__ = '1.0.0+dev'
version = (1, 0, 0) |
#returns list of groups. group is a list of strings, a string per person.
def getgroups():
with open('Day6.txt', 'r') as file:
groupList = []
currgroup = []
for line in file:
if line not in ['\n', '\n\n']:
currgroup.append(line.strip())
else:
groupList.append(currgroup)
currgroup = []
groupList.append(currgroup)
return(groupList)
def option1():
groupList = getgroups()
norepeatsgroups = []
for group in groupList:
combined = []
for person in group:
for char in person:
if char not in combined:
combined.append(char)
norepeatsgroups.append(combined)
answer = 0
for group in norepeatsgroups:
answer += len(group)
print(answer, "unique 'yes'es ")
def option2():
groupList = getgroups()
count = 0
allyesgroups = []
for group in groupList:
person1 = group[0]
for person in group[1:]:
for char in person1: #checks against the first person since first person must contain every letter(they all do but we have to pick one ok)
if char not in person:
person1 = person1.replace(char,'') #removes from first person if first person has a unique letter.
if person1 != '': #removes empty lists. len([''])=1
allyesgroups.append(person1)
count += len(person1)
print(count, " communal 'yes'es ")
def menu():
#privae grievance: yes's is silly. That is all.
print("\nOption 1: Number of Unique yes's(Part A) \nOption 2: Number of communal yes's(Part B)\nOption 3: Exit\n\nType a number\n\n")
try:
option = int(input(">> "))
if option == 1:
option1()
elif option == 2:
option2()
elif option == 3:
exit()
else:
print("Error: Incorrect Input\n\n")
menu()
except ValueError:
print("Error: Incorrect Input. Enter a number\n\n")
menu()
if __name__ == "__main__":
menu()
| def getgroups():
with open('Day6.txt', 'r') as file:
group_list = []
currgroup = []
for line in file:
if line not in ['\n', '\n\n']:
currgroup.append(line.strip())
else:
groupList.append(currgroup)
currgroup = []
groupList.append(currgroup)
return groupList
def option1():
group_list = getgroups()
norepeatsgroups = []
for group in groupList:
combined = []
for person in group:
for char in person:
if char not in combined:
combined.append(char)
norepeatsgroups.append(combined)
answer = 0
for group in norepeatsgroups:
answer += len(group)
print(answer, "unique 'yes'es ")
def option2():
group_list = getgroups()
count = 0
allyesgroups = []
for group in groupList:
person1 = group[0]
for person in group[1:]:
for char in person1:
if char not in person:
person1 = person1.replace(char, '')
if person1 != '':
allyesgroups.append(person1)
count += len(person1)
print(count, " communal 'yes'es ")
def menu():
print("\nOption 1: Number of Unique yes's(Part A) \nOption 2: Number of communal yes's(Part B)\nOption 3: Exit\n\nType a number\n\n")
try:
option = int(input('>> '))
if option == 1:
option1()
elif option == 2:
option2()
elif option == 3:
exit()
else:
print('Error: Incorrect Input\n\n')
menu()
except ValueError:
print('Error: Incorrect Input. Enter a number\n\n')
menu()
if __name__ == '__main__':
menu() |
list1=['Apple','Mango',1999,2000]
print(list1)
del list1[2]
print("After deleting value at index 2:")
print(list1)
list2=['Apple','Mango',1999,2000,1111,2222,3333]
print(list2)
del list2[0:3]
print("After deleting value till index 2:")
print(list2)
| list1 = ['Apple', 'Mango', 1999, 2000]
print(list1)
del list1[2]
print('After deleting value at index 2:')
print(list1)
list2 = ['Apple', 'Mango', 1999, 2000, 1111, 2222, 3333]
print(list2)
del list2[0:3]
print('After deleting value till index 2:')
print(list2) |
base_vectors = [[0.001178571428571168, 1.9904285714285708, 0.0011071428571440833], [-0.013142857142857345, -0.0018571428571430015, 1.9921428571428583], [-0.0007499999999995843, 0.17799999999999994, -0.00024999999999630873], [-4.440892098500626e-16, -8.881784197001252e-16, 0.1769999999999996]]
n = [8, 8, 6, 6]
origin = [-3.4612499999999944, -7.169999999999995, -6.396750000000013]
support_indices = [[0, 0, 1, 0], [0, 0, 1, 5], [0, 0, 5, 5], [0, 7, 1, 0], [7, 7, 0, 0]]
support_xyz = [[-3.462, -6.992, -6.397], [-3.462, -6.992, -5.512], [-3.465, -6.28, -5.513], [-3.554, -7.005, 7.548], [-3.545, 6.75, 7.556]]
| base_vectors = [[0.001178571428571168, 1.9904285714285708, 0.0011071428571440833], [-0.013142857142857345, -0.0018571428571430015, 1.9921428571428583], [-0.0007499999999995843, 0.17799999999999994, -0.00024999999999630873], [-4.440892098500626e-16, -8.881784197001252e-16, 0.1769999999999996]]
n = [8, 8, 6, 6]
origin = [-3.4612499999999944, -7.169999999999995, -6.396750000000013]
support_indices = [[0, 0, 1, 0], [0, 0, 1, 5], [0, 0, 5, 5], [0, 7, 1, 0], [7, 7, 0, 0]]
support_xyz = [[-3.462, -6.992, -6.397], [-3.462, -6.992, -5.512], [-3.465, -6.28, -5.513], [-3.554, -7.005, 7.548], [-3.545, 6.75, 7.556]] |
def solveProblem(inputPath):
floor = 0
indexFloorInfo = 0
with open(inputPath) as fileP:
valueLine = fileP.readline()
for floorInfo in valueLine:
indexFloorInfo += 1
if floorInfo == '(':
floor += 1
elif floorInfo == ')':
floor -= 1
if floor == -1:
return indexFloorInfo
print(solveProblem('InputD01Q2.txt'))
| def solve_problem(inputPath):
floor = 0
index_floor_info = 0
with open(inputPath) as file_p:
value_line = fileP.readline()
for floor_info in valueLine:
index_floor_info += 1
if floorInfo == '(':
floor += 1
elif floorInfo == ')':
floor -= 1
if floor == -1:
return indexFloorInfo
print(solve_problem('InputD01Q2.txt')) |
try:
tests=int(input())
k=[]
for i in range(tests):
z=[]
count=0
find,length=[int(x) for x in input().split(" ")]
list1=list(map(int,input().rstrip().split()))
for i in range(len(list1)):
if list1[i]==find:
z.append(i+1)
count=count+1
if count>1:
k.append(z)
else:
k.append("-1")
if len(k)>1:
for x in k:
print(*x)
except:
pass
| try:
tests = int(input())
k = []
for i in range(tests):
z = []
count = 0
(find, length) = [int(x) for x in input().split(' ')]
list1 = list(map(int, input().rstrip().split()))
for i in range(len(list1)):
if list1[i] == find:
z.append(i + 1)
count = count + 1
if count > 1:
k.append(z)
else:
k.append('-1')
if len(k) > 1:
for x in k:
print(*x)
except:
pass |
python = {'John':35,'Eric':36,'Michael':35,'Terry':38,'Graham':37,'TerryG':34}
holy_grail = {'Arthur':40,'Galahad':35,'Lancelot':39,'Knight of NI':40, 'Zoot':17}
life_of_brian = {'Brian':33,'Reg':35,'Stan/Loretta':32,'Biccus Diccus':45}
#membership test
print('Arthur' in holy_grail)
if 'Arthur' not in python:
print('He\'s not here!')
people = {}
people1 = {}
people2 = {}
#method 1 update
people.update(python)
people.update(holy_grail)
people.update(life_of_brian)
print(sorted(people.items()))
#method 2 comprehension
for groups in (python,holy_grail,life_of_brian) : people1.update(groups)
print(sorted(people1.items()))
#method 3 unpacking 3.5 later
people2 = {**python,**holy_grail,**life_of_brian}
print(sorted(people2.items()))
print('The sum of the ages: ', sum(people.values())) | python = {'John': 35, 'Eric': 36, 'Michael': 35, 'Terry': 38, 'Graham': 37, 'TerryG': 34}
holy_grail = {'Arthur': 40, 'Galahad': 35, 'Lancelot': 39, 'Knight of NI': 40, 'Zoot': 17}
life_of_brian = {'Brian': 33, 'Reg': 35, 'Stan/Loretta': 32, 'Biccus Diccus': 45}
print('Arthur' in holy_grail)
if 'Arthur' not in python:
print("He's not here!")
people = {}
people1 = {}
people2 = {}
people.update(python)
people.update(holy_grail)
people.update(life_of_brian)
print(sorted(people.items()))
for groups in (python, holy_grail, life_of_brian):
people1.update(groups)
print(sorted(people1.items()))
people2 = {**python, **holy_grail, **life_of_brian}
print(sorted(people2.items()))
print('The sum of the ages: ', sum(people.values())) |
a, b, c = input().split(' ')
a = float(a)
b = float(b)
c = float(c)
areat = (a * c) / 2
areac = 3.14159 * c**2
areatp = (a + b) * c / 2
areaq = b * b
arear = b * a
print(f'TRIANGULO: {areat:.3f}')
print(f'CIRCULO: {areac:.3f}')
print(f'TRAPEZIO: {areatp:.3f}')
print(f'QUADRADO: {areaq:.3f}')
print(f'RETANGULO: {arear:.3f}')
| (a, b, c) = input().split(' ')
a = float(a)
b = float(b)
c = float(c)
areat = a * c / 2
areac = 3.14159 * c ** 2
areatp = (a + b) * c / 2
areaq = b * b
arear = b * a
print(f'TRIANGULO: {areat:.3f}')
print(f'CIRCULO: {areac:.3f}')
print(f'TRAPEZIO: {areatp:.3f}')
print(f'QUADRADO: {areaq:.3f}')
print(f'RETANGULO: {arear:.3f}') |
#! python3
# aoc_05.py
# Advent of code:
# https://adventofcode.com/2021/day/5
# https://adventofcode.com/2021/day/5#part2
#
def hello_world():
return 'hello world'
class ventmap:
def __init__(self, xmax, ymax):
self.xmax = xmax
self.ymax = ymax
self.map = [[0 for i in range(xmax)] for j in range(ymax)]
def check_line(x1,y1,x2,y2):
return x1 == x2 or y1 == y2
def find_vents(input,x,y):
mymap = ventmap(x,y)
with open(input, 'r') as line_list:
for line in line_list.readlines():
lstart, lend = line.split(' -> ')
x1,y1 = lstart.split(',')
x1 = int(x1)
y1 = int(y1)
x2,y2 = lend.split(',')
x2= int(x2)
y2 = int(y2)
if check_line(x1,y1,x2,y2):
if x1>x2 or y1 >y2:
x1,x2 = x2,x1
y1,y2 = y2,y1
for i in range(x1,x2+1):
for l in range(y1,y2+1):
mymap.map[l][i]+=1
else:
if x1>x2:
x1,x2 = x2,x1
y1,y2 = y2,y1
if x1 < x2 and y1 < y2:
#print("Diag down")
for i in range(0,x2-x1+1):
mymap.map[y1+i][x1+i] += 1
#diag down:
else:
#print("Diag up")
for i in range(0,x2-x1+1):
mymap.map[y1-i][x1+i] += 1
danger_points = 0
for line in mymap.map:
for field in line:
if field > 1:
danger_points +=1
return danger_points
print(find_vents("aoc_05_example.txt",10,10))
print(find_vents("aoc_05_input.txt",1000,1000)) | def hello_world():
return 'hello world'
class Ventmap:
def __init__(self, xmax, ymax):
self.xmax = xmax
self.ymax = ymax
self.map = [[0 for i in range(xmax)] for j in range(ymax)]
def check_line(x1, y1, x2, y2):
return x1 == x2 or y1 == y2
def find_vents(input, x, y):
mymap = ventmap(x, y)
with open(input, 'r') as line_list:
for line in line_list.readlines():
(lstart, lend) = line.split(' -> ')
(x1, y1) = lstart.split(',')
x1 = int(x1)
y1 = int(y1)
(x2, y2) = lend.split(',')
x2 = int(x2)
y2 = int(y2)
if check_line(x1, y1, x2, y2):
if x1 > x2 or y1 > y2:
(x1, x2) = (x2, x1)
(y1, y2) = (y2, y1)
for i in range(x1, x2 + 1):
for l in range(y1, y2 + 1):
mymap.map[l][i] += 1
else:
if x1 > x2:
(x1, x2) = (x2, x1)
(y1, y2) = (y2, y1)
if x1 < x2 and y1 < y2:
for i in range(0, x2 - x1 + 1):
mymap.map[y1 + i][x1 + i] += 1
else:
for i in range(0, x2 - x1 + 1):
mymap.map[y1 - i][x1 + i] += 1
danger_points = 0
for line in mymap.map:
for field in line:
if field > 1:
danger_points += 1
return danger_points
print(find_vents('aoc_05_example.txt', 10, 10))
print(find_vents('aoc_05_input.txt', 1000, 1000)) |
#
# PySNMP MIB module RAQMON-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/RAQMON-MIB
# Produced by pysmi-0.3.4 at Wed May 1 14:52:12 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, ObjectIdentifier, OctetString = mibBuilder.importSymbols("ASN1", "Integer", "ObjectIdentifier", "OctetString")
NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues")
SingleValueConstraint, ValueRangeConstraint, ConstraintsUnion, ConstraintsIntersection, ValueSizeConstraint = mibBuilder.importSymbols("ASN1-REFINEMENT", "SingleValueConstraint", "ValueRangeConstraint", "ConstraintsUnion", "ConstraintsIntersection", "ValueSizeConstraint")
InetPortNumber, InetAddress, InetAddressType = mibBuilder.importSymbols("INET-ADDRESS-MIB", "InetPortNumber", "InetAddress", "InetAddressType")
rmon, = mibBuilder.importSymbols("RMON-MIB", "rmon")
SnmpAdminString, = mibBuilder.importSymbols("SNMP-FRAMEWORK-MIB", "SnmpAdminString")
ObjectGroup, NotificationGroup, ModuleCompliance = mibBuilder.importSymbols("SNMPv2-CONF", "ObjectGroup", "NotificationGroup", "ModuleCompliance")
Bits, IpAddress, MibIdentifier, MibScalar, MibTable, MibTableRow, MibTableColumn, TimeTicks, NotificationType, Counter64, Gauge32, iso, Integer32, Counter32, ModuleIdentity, Unsigned32, ObjectIdentity = mibBuilder.importSymbols("SNMPv2-SMI", "Bits", "IpAddress", "MibIdentifier", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "TimeTicks", "NotificationType", "Counter64", "Gauge32", "iso", "Integer32", "Counter32", "ModuleIdentity", "Unsigned32", "ObjectIdentity")
RowPointer, DisplayString, RowStatus, TruthValue, DateAndTime, TextualConvention = mibBuilder.importSymbols("SNMPv2-TC", "RowPointer", "DisplayString", "RowStatus", "TruthValue", "DateAndTime", "TextualConvention")
raqmonMIB = ModuleIdentity((1, 3, 6, 1, 2, 1, 16, 31))
raqmonMIB.setRevisions(('2006-10-10 00:00',))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
if mibBuilder.loadTexts: raqmonMIB.setRevisionsDescriptions(('Initial version, published as RFC 4711.',))
if mibBuilder.loadTexts: raqmonMIB.setLastUpdated('200610100000Z')
if mibBuilder.loadTexts: raqmonMIB.setOrganization('IETF RMON MIB Working Group')
if mibBuilder.loadTexts: raqmonMIB.setContactInfo('WG Charter: http://www.ietf.org/html.charters/rmonmib-charter.html Mailing lists: General Discussion: rmonmib@ietf.org To Subscribe: rmonmib-requests@ietf.org In Body: subscribe your_email_address Chair: Andy Bierman Email: ietf@andybierman.com Editor: Dan Romascanu Avaya Email: dromasca@avaya.com')
if mibBuilder.loadTexts: raqmonMIB.setDescription('Real-Time Application QoS Monitoring MIB. Copyright (c) The Internet Society (2006). This version of this MIB module is part of RFC 4711; See the RFC itself for full legal notices.')
raqmonNotifications = MibIdentifier((1, 3, 6, 1, 2, 1, 16, 31, 0))
raqmonSessionAlarm = NotificationType((1, 3, 6, 1, 2, 1, 16, 31, 0, 1)).setObjects(("RAQMON-MIB", "raqmonParticipantAddr"), ("RAQMON-MIB", "raqmonParticipantName"), ("RAQMON-MIB", "raqmonParticipantPeerAddrType"), ("RAQMON-MIB", "raqmonParticipantPeerAddr"), ("RAQMON-MIB", "raqmonQoSEnd2EndNetDelay"), ("RAQMON-MIB", "raqmonQoSInterArrivalJitter"), ("RAQMON-MIB", "raqmonQosLostPackets"), ("RAQMON-MIB", "raqmonQosRcvdPackets"))
if mibBuilder.loadTexts: raqmonSessionAlarm.setStatus('current')
if mibBuilder.loadTexts: raqmonSessionAlarm.setDescription('A notification generated by an entry in the raqmonSessionExceptionTable.')
raqmonMIBObjects = MibIdentifier((1, 3, 6, 1, 2, 1, 16, 31, 1))
raqmonSession = MibIdentifier((1, 3, 6, 1, 2, 1, 16, 31, 1, 1))
raqmonParticipantTable = MibTable((1, 3, 6, 1, 2, 1, 16, 31, 1, 1, 1), )
if mibBuilder.loadTexts: raqmonParticipantTable.setStatus('current')
if mibBuilder.loadTexts: raqmonParticipantTable.setDescription('This table contains information about participants in both active and closed (terminated) sessions.')
raqmonParticipantEntry = MibTableRow((1, 3, 6, 1, 2, 1, 16, 31, 1, 1, 1, 1), ).setIndexNames((0, "RAQMON-MIB", "raqmonParticipantStartDate"), (0, "RAQMON-MIB", "raqmonParticipantIndex"))
if mibBuilder.loadTexts: raqmonParticipantEntry.setStatus('current')
if mibBuilder.loadTexts: raqmonParticipantEntry.setDescription('Each row contains information for a single session (application) run by one participant. Indexation by the start time of the session aims to ease sorting by management applications. Agents MUST NOT report identical start times for any two sessions on the same host. Rows are removed for inactive sessions when implementation-specific age or space limits are reached.')
raqmonParticipantStartDate = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 31, 1, 1, 1, 1, 1), DateAndTime())
if mibBuilder.loadTexts: raqmonParticipantStartDate.setStatus('current')
if mibBuilder.loadTexts: raqmonParticipantStartDate.setDescription('The date and time of this entry. It will be the date and time of the first report received.')
raqmonParticipantIndex = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 31, 1, 1, 1, 1, 2), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(1, 2147483647)))
if mibBuilder.loadTexts: raqmonParticipantIndex.setStatus('current')
if mibBuilder.loadTexts: raqmonParticipantIndex.setDescription('The index of the conceptual row, which is for SNMP purposes only and has no relation to any protocol value. There is no requirement that these rows be created or maintained sequentially. The index will be unique for a particular date and time.')
raqmonParticipantReportCaps = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 31, 1, 1, 1, 1, 3), Bits().clone(namedValues=NamedValues(("raqmonPartRepDsrcName", 0), ("raqmonPartRepRecvName", 1), ("raqmonPartRepDsrcPort", 2), ("raqmonPartRepRecvPort", 3), ("raqmonPartRepSetupTime", 4), ("raqmonPartRepSetupDelay", 5), ("raqmonPartRepSessionDuration", 6), ("raqmonPartRepSetupStatus", 7), ("raqmonPartRepRTEnd2EndNetDelay", 8), ("raqmonPartRepOWEnd2EndNetDelay", 9), ("raqmonPartApplicationDelay", 10), ("raqmonPartRepIAJitter", 11), ("raqmonPartRepIPDV", 12), ("raqmonPartRepRcvdPackets", 13), ("raqmonPartRepRcvdOctets", 14), ("raqmonPartRepSentPackets", 15), ("raqmonPartRepSentOctets", 16), ("raqmonPartRepCumPacketsLoss", 17), ("raqmonPartRepFractionPacketsLoss", 18), ("raqmonPartRepCumDiscards", 19), ("raqmonPartRepFractionDiscards", 20), ("raqmonPartRepSrcPayloadType", 21), ("raqmonPartRepDestPayloadType", 22), ("raqmonPartRepSrcLayer2Priority", 23), ("raqmonPartRepSrcTosDscp", 24), ("raqmonPartRepDestLayer2Priority", 25), ("raqmonPartRepDestTosDscp", 26), ("raqmonPartRepCPU", 27), ("raqmonPartRepMemory", 28), ("raqmonPartRepAppName", 29)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: raqmonParticipantReportCaps.setStatus('current')
if mibBuilder.loadTexts: raqmonParticipantReportCaps.setDescription('The Report capabilities of the participant, as perceived by the Collector. If the participant can report the Data Source Name as defined in [RFC4710], Section 5.3, then the raqmonPartRepDsrcName bit will be set. If the participant can report the Receiver Name as defined in [RFC4710], Section 5.4, then the raqmonPartRepRecvName bit will be set. If the participant can report the Data Source Port as defined in [RFC4710], Section 5.5, then the raqmonPartRepDsrcPort bit will be set. If the participant can report the Receiver Port as defined in [RFC4710], Section 5.6, then the raqmonPartRepRecvPort bit will be set. If the participant can report the Session Setup Time as defined in [RFC4710], Section 5.7, then the raqmonPartRepSetupTime bit will be set. If the participant can report the Session Setup Delay as defined in [RFC4710], Section 5.8, then the raqmonPartRepSetupDelay bit will be set. If the participant can report the Session Duration as defined in [RFC4710], Section 5.9, then the raqmonPartRepSessionDuration bit will be set. If the participant can report the Setup Status as defined in [RFC4710], Section 5.10, then the raqmonPartRepSetupStatus bit will be set. If the participant can report the Round-Trip End-to-end Network Delay as defined in [RFC4710], Section 5.11, then the raqmonPartRepRTEnd2EndNetDelay bit will be set. If the participant can report the One-way End-to-end Network Delay as defined in [RFC4710], Section 5.12, then the raqmonPartRepOWEnd2EndNetDelay bit will be set. If the participant can report the Application Delay as defined in [RFC4710], Section 5.13, then the raqmonPartApplicationDelay bit will be set. If the participant can report the Inter-Arrival Jitter as defined in [RFC4710], Section 5.14, then the raqmonPartRepIAJitter bit will be set. If the participant can report the IP Packet Delay Variation as defined in [RFC4710], Section 5.15, then the raqmonPartRepIPDV bit will be set. If the participant can report the number of application packets received as defined in [RFC4710], Section 5.16, then the raqmonPartRepRcvdPackets bit will be set. If the participant can report the number of application octets received as defined in [RFC4710], Section 5.17, then the raqmonPartRepRcvdOctets bit will be set. If the participant can report the number of application packets sent as defined in [RFC4710], Section 5.18, then the raqmonPartRepSentPackets bit will be set. If the participant can report the number of application octets sent as defined in [RFC4710], Section 5.19, then the raqmonPartRepSentOctets bit will be set. If the participant can report the number of cumulative packets lost as defined in [RFC4710], Section 5.20, then the raqmonPartRepCumPacketsLoss bit will be set. If the participant can report the fraction of packet loss as defined in [RFC4710], Section 5.21, then the raqmonPartRepFractionPacketsLoss bit will be set. If the participant can report the number of cumulative discards as defined in [RFC4710], Section 5.22, then the raqmonPartRepCumDiscards bit will be set. If the participant can report the fraction of discards as defined in [RFC4710], Section 5.23, then the raqmonPartRepFractionDiscards bit will be set. If the participant can report the Source Payload Type as defined in [RFC4710], Section 5.24, then the raqmonPartRepSrcPayloadType bit will be set. If the participant can report the Destination Payload Type as defined in [RFC4710], Section 5.25, then the raqmonPartRepDestPayloadType bit will be set. If the participant can report the Source Layer 2 Priority as defined in [RFC4710], Section 5.26, then the raqmonPartRepSrcLayer2Priority bit will be set. If the participant can report the Source DSCP/ToS value as defined in [RFC4710], Section 5.27, then the raqmonPartRepSrcToSDscp bit will be set. If the participant can report the Destination Layer 2 Priority as defined in [RFC4710], Section 5.28, then the raqmonPartRepDestLayer2Priority bit will be set. If the participant can report the Destination DSCP/ToS Value as defined in [RFC4710], Section 5.29, then the raqmonPartRepDestToSDscp bit will be set. If the participant can report the CPU utilization as defined in [RFC4710], Section 5.30, then the raqmonPartRepCPU bit will be set. If the participant can report the memory utilization as defined in [RFC4710], Section 5.31, then the raqmonPartRepMemory bit will be set. If the participant can report the Application Name as defined in [RFC4710], Section 5.32, then the raqmonPartRepAppName bit will be set. The capability of reporting of a specific metric does not mandate that the metric must be reported permanently by the data source to the respective collector. Some data sources MAY be configured not to send a metric, or some metrics may not be relevant to the specific application.')
raqmonParticipantAddrType = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 31, 1, 1, 1, 1, 4), InetAddressType()).setMaxAccess("readonly")
if mibBuilder.loadTexts: raqmonParticipantAddrType.setStatus('current')
if mibBuilder.loadTexts: raqmonParticipantAddrType.setDescription('The type of the Internet address of the participant for this session.')
raqmonParticipantAddr = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 31, 1, 1, 1, 1, 5), InetAddress()).setMaxAccess("readonly")
if mibBuilder.loadTexts: raqmonParticipantAddr.setStatus('current')
if mibBuilder.loadTexts: raqmonParticipantAddr.setDescription('The Internet Address of the participant for this session. Formatting of this object is determined by the value of raqmonParticipantAddrType.')
raqmonParticipantSendPort = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 31, 1, 1, 1, 1, 6), InetPortNumber()).setMaxAccess("readonly")
if mibBuilder.loadTexts: raqmonParticipantSendPort.setReference('Section 5.5 of the [RFC4710]')
if mibBuilder.loadTexts: raqmonParticipantSendPort.setStatus('current')
if mibBuilder.loadTexts: raqmonParticipantSendPort.setDescription('Port from which session data is sent. If the value was not reported to the collector, this object will have the value 0.')
raqmonParticipantRecvPort = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 31, 1, 1, 1, 1, 7), InetPortNumber()).setMaxAccess("readonly")
if mibBuilder.loadTexts: raqmonParticipantRecvPort.setReference('Section 5.6 of the [RFC4710]')
if mibBuilder.loadTexts: raqmonParticipantRecvPort.setStatus('current')
if mibBuilder.loadTexts: raqmonParticipantRecvPort.setDescription('Port on which session data is received. If the value was not reported to the collector, this object will have the value 0.')
raqmonParticipantSetupDelay = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 31, 1, 1, 1, 1, 8), Integer32().subtype(subtypeSpec=ConstraintsUnion(ValueRangeConstraint(-1, -1), ValueRangeConstraint(0, 2147483647), ))).setUnits('milliseconds').setMaxAccess("readonly")
if mibBuilder.loadTexts: raqmonParticipantSetupDelay.setReference('Section 5.8 of the [RFC4710]')
if mibBuilder.loadTexts: raqmonParticipantSetupDelay.setStatus('current')
if mibBuilder.loadTexts: raqmonParticipantSetupDelay.setDescription('Session setup time. If the value was not reported to the collector, this object will have the value -1.')
raqmonParticipantName = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 31, 1, 1, 1, 1, 9), SnmpAdminString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: raqmonParticipantName.setReference('Section 5.3 of the [RFC4710]')
if mibBuilder.loadTexts: raqmonParticipantName.setStatus('current')
if mibBuilder.loadTexts: raqmonParticipantName.setDescription('The data source name for the participant.')
raqmonParticipantAppName = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 31, 1, 1, 1, 1, 10), SnmpAdminString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: raqmonParticipantAppName.setReference('Section 5.32 of the [RFC4710]')
if mibBuilder.loadTexts: raqmonParticipantAppName.setStatus('current')
if mibBuilder.loadTexts: raqmonParticipantAppName.setDescription("A string giving the name and possibly the version of the application generating the stream, e.g., 'videotool 1.2.' This information may be useful for debugging purposes and is similar to the Mailer or Mail-System-Version SMTP headers. The tool value is expected to remain constant for the duration of the session.")
raqmonParticipantQosCount = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 31, 1, 1, 1, 1, 11), Gauge32()).setUnits('entries').setMaxAccess("readonly")
if mibBuilder.loadTexts: raqmonParticipantQosCount.setStatus('current')
if mibBuilder.loadTexts: raqmonParticipantQosCount.setDescription('The current number of entries in the raqmonQosTable for this participant and session.')
raqmonParticipantEndDate = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 31, 1, 1, 1, 1, 12), DateAndTime()).setMaxAccess("readonly")
if mibBuilder.loadTexts: raqmonParticipantEndDate.setStatus('current')
if mibBuilder.loadTexts: raqmonParticipantEndDate.setDescription('The date and time of the most recent report received.')
raqmonParticipantDestPayloadType = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 31, 1, 1, 1, 1, 13), Integer32().subtype(subtypeSpec=ConstraintsUnion(ValueRangeConstraint(-1, -1), ValueRangeConstraint(0, 127), ))).setMaxAccess("readonly")
if mibBuilder.loadTexts: raqmonParticipantDestPayloadType.setReference('RFC 3551 and Section 5.25 of the [RFC4710]')
if mibBuilder.loadTexts: raqmonParticipantDestPayloadType.setStatus('current')
if mibBuilder.loadTexts: raqmonParticipantDestPayloadType.setDescription('Destination Payload Type. If the value was not reported to the collector, this object will have the value -1.')
raqmonParticipantSrcPayloadType = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 31, 1, 1, 1, 1, 14), Integer32().subtype(subtypeSpec=ConstraintsUnion(ValueRangeConstraint(-1, -1), ValueRangeConstraint(0, 127), ))).setMaxAccess("readonly")
if mibBuilder.loadTexts: raqmonParticipantSrcPayloadType.setReference('RFC 3551 and Section 5.24 of the [RFC4710]')
if mibBuilder.loadTexts: raqmonParticipantSrcPayloadType.setStatus('current')
if mibBuilder.loadTexts: raqmonParticipantSrcPayloadType.setDescription('Source Payload Type. If the value was not reported to the collector, this object will have the value -1.')
raqmonParticipantActive = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 31, 1, 1, 1, 1, 15), TruthValue()).setMaxAccess("readonly")
if mibBuilder.loadTexts: raqmonParticipantActive.setStatus('current')
if mibBuilder.loadTexts: raqmonParticipantActive.setDescription("Value 'true' indicates that the session for this participant is active (open). Value 'false' indicates that the session is closed (terminated).")
raqmonParticipantPeer = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 31, 1, 1, 1, 1, 16), RowPointer()).setMaxAccess("readonly")
if mibBuilder.loadTexts: raqmonParticipantPeer.setStatus('current')
if mibBuilder.loadTexts: raqmonParticipantPeer.setDescription('The pointer to the corresponding entry in this table for the other peer participant. If there is no such entry in the participant table of the collector represented by this SNMP agent, then the value will be { 0 0 }. ')
raqmonParticipantPeerAddrType = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 31, 1, 1, 1, 1, 17), InetAddressType()).setMaxAccess("readonly")
if mibBuilder.loadTexts: raqmonParticipantPeerAddrType.setStatus('current')
if mibBuilder.loadTexts: raqmonParticipantPeerAddrType.setDescription('The type of the Internet address of the peer participant for this session.')
raqmonParticipantPeerAddr = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 31, 1, 1, 1, 1, 18), InetAddress()).setMaxAccess("readonly")
if mibBuilder.loadTexts: raqmonParticipantPeerAddr.setStatus('current')
if mibBuilder.loadTexts: raqmonParticipantPeerAddr.setDescription('The Internet Address of the peer participant for this session. Formatting of this object is determined by the value of raqmonParticipantPeerAddrType.')
raqmonParticipantSrcL2Priority = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 31, 1, 1, 1, 1, 19), Integer32().subtype(subtypeSpec=ConstraintsUnion(ValueRangeConstraint(-1, -1), ValueRangeConstraint(0, 7), ))).setMaxAccess("readonly")
if mibBuilder.loadTexts: raqmonParticipantSrcL2Priority.setReference('Section 5.26 of the [RFC4710]')
if mibBuilder.loadTexts: raqmonParticipantSrcL2Priority.setStatus('current')
if mibBuilder.loadTexts: raqmonParticipantSrcL2Priority.setDescription('Source Layer 2 Priority. If the value was not reported to the collector, this object will have the value -1.')
raqmonParticipantDestL2Priority = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 31, 1, 1, 1, 1, 20), Integer32().subtype(subtypeSpec=ConstraintsUnion(ValueRangeConstraint(-1, -1), ValueRangeConstraint(0, 7), ))).setMaxAccess("readonly")
if mibBuilder.loadTexts: raqmonParticipantDestL2Priority.setReference('Section 5.28 of the [RFC4710]')
if mibBuilder.loadTexts: raqmonParticipantDestL2Priority.setStatus('current')
if mibBuilder.loadTexts: raqmonParticipantDestL2Priority.setDescription('Destination Layer 2 Priority. If the value was not reported to the collector, this object will have the value -1.')
raqmonParticipantSrcDSCP = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 31, 1, 1, 1, 1, 21), Integer32().subtype(subtypeSpec=ConstraintsUnion(ValueRangeConstraint(-1, -1), ValueRangeConstraint(0, 63), ))).setMaxAccess("readonly")
if mibBuilder.loadTexts: raqmonParticipantSrcDSCP.setReference('Section 5.27 of the [RFC4710]')
if mibBuilder.loadTexts: raqmonParticipantSrcDSCP.setStatus('current')
if mibBuilder.loadTexts: raqmonParticipantSrcDSCP.setDescription('Source Layer 3 DSCP value. If the value was not reported to the collector, this object will have the value -1.')
raqmonParticipantDestDSCP = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 31, 1, 1, 1, 1, 22), Integer32().subtype(subtypeSpec=ConstraintsUnion(ValueRangeConstraint(-1, -1), ValueRangeConstraint(0, 63), ))).setMaxAccess("readonly")
if mibBuilder.loadTexts: raqmonParticipantDestDSCP.setReference('Section 5.29 of the [RFC4710]')
if mibBuilder.loadTexts: raqmonParticipantDestDSCP.setStatus('current')
if mibBuilder.loadTexts: raqmonParticipantDestDSCP.setDescription('Destination Layer 3 DSCP value.')
raqmonParticipantCpuMean = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 31, 1, 1, 1, 1, 23), Integer32().subtype(subtypeSpec=ConstraintsUnion(ValueRangeConstraint(-1, -1), ValueRangeConstraint(0, 100), ))).setUnits('percents').setMaxAccess("readonly")
if mibBuilder.loadTexts: raqmonParticipantCpuMean.setReference('Section 5.30 of the [RFC4710]')
if mibBuilder.loadTexts: raqmonParticipantCpuMean.setStatus('current')
if mibBuilder.loadTexts: raqmonParticipantCpuMean.setDescription('Mean CPU utilization. If the value was not reported to the collector, this object will have the value -1.')
raqmonParticipantCpuMin = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 31, 1, 1, 1, 1, 24), Integer32().subtype(subtypeSpec=ConstraintsUnion(ValueRangeConstraint(-1, -1), ValueRangeConstraint(0, 100), ))).setUnits('percents').setMaxAccess("readonly")
if mibBuilder.loadTexts: raqmonParticipantCpuMin.setReference('Section 5.30 of the [RFC4710]')
if mibBuilder.loadTexts: raqmonParticipantCpuMin.setStatus('current')
if mibBuilder.loadTexts: raqmonParticipantCpuMin.setDescription('Minimum CPU utilization. If the value was not reported to the collector, this object will have the value -1.')
raqmonParticipantCpuMax = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 31, 1, 1, 1, 1, 25), Integer32().subtype(subtypeSpec=ConstraintsUnion(ValueRangeConstraint(-1, -1), ValueRangeConstraint(0, 100), ))).setUnits('percents').setMaxAccess("readonly")
if mibBuilder.loadTexts: raqmonParticipantCpuMax.setReference('Section 5.30 of the [RFC4710]')
if mibBuilder.loadTexts: raqmonParticipantCpuMax.setStatus('current')
if mibBuilder.loadTexts: raqmonParticipantCpuMax.setDescription('Maximum CPU utilization. If the value was not reported to the collector, this object will have the value -1.')
raqmonParticipantMemoryMean = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 31, 1, 1, 1, 1, 26), Integer32().subtype(subtypeSpec=ConstraintsUnion(ValueRangeConstraint(-1, -1), ValueRangeConstraint(0, 100), ))).setUnits('percents').setMaxAccess("readonly")
if mibBuilder.loadTexts: raqmonParticipantMemoryMean.setReference('Section 5.31 of the [RFC4710]')
if mibBuilder.loadTexts: raqmonParticipantMemoryMean.setStatus('current')
if mibBuilder.loadTexts: raqmonParticipantMemoryMean.setDescription('Mean memory utilization. If the value was not reported to the collector, this object will have the value -1.')
raqmonParticipantMemoryMin = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 31, 1, 1, 1, 1, 27), Integer32().subtype(subtypeSpec=ConstraintsUnion(ValueRangeConstraint(-1, -1), ValueRangeConstraint(0, 100), ))).setUnits('percents').setMaxAccess("readonly")
if mibBuilder.loadTexts: raqmonParticipantMemoryMin.setReference('Section 5.31 of the [RFC4710]')
if mibBuilder.loadTexts: raqmonParticipantMemoryMin.setStatus('current')
if mibBuilder.loadTexts: raqmonParticipantMemoryMin.setDescription('Minimum memory utilization. If the value was not reported to the collector, this object will have the value -1.')
raqmonParticipantMemoryMax = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 31, 1, 1, 1, 1, 28), Integer32().subtype(subtypeSpec=ConstraintsUnion(ValueRangeConstraint(-1, -1), ValueRangeConstraint(0, 100), ))).setUnits('percents').setMaxAccess("readonly")
if mibBuilder.loadTexts: raqmonParticipantMemoryMax.setReference('Section 5.31 of the [RFC4710]')
if mibBuilder.loadTexts: raqmonParticipantMemoryMax.setStatus('current')
if mibBuilder.loadTexts: raqmonParticipantMemoryMax.setDescription('Maximum memory utilization. If the value was not reported to the collector, this object will have the value -1.')
raqmonParticipantNetRTTMean = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 31, 1, 1, 1, 1, 29), Integer32().subtype(subtypeSpec=ConstraintsUnion(ValueRangeConstraint(-1, -1), ValueRangeConstraint(0, 2147483647), ))).setUnits('milliseconds').setMaxAccess("readonly")
if mibBuilder.loadTexts: raqmonParticipantNetRTTMean.setReference('Section 5.11 of the [RFC4710]')
if mibBuilder.loadTexts: raqmonParticipantNetRTTMean.setStatus('current')
if mibBuilder.loadTexts: raqmonParticipantNetRTTMean.setDescription('Mean round-trip end-to-end network delay over the entire session. If the value was not reported to the collector, this object will have the value -1.')
raqmonParticipantNetRTTMin = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 31, 1, 1, 1, 1, 30), Integer32().subtype(subtypeSpec=ConstraintsUnion(ValueRangeConstraint(-1, -1), ValueRangeConstraint(0, 2147483647), ))).setUnits('milliseconds').setMaxAccess("readonly")
if mibBuilder.loadTexts: raqmonParticipantNetRTTMin.setReference('Section 5.11 of the [RFC4710]')
if mibBuilder.loadTexts: raqmonParticipantNetRTTMin.setStatus('current')
if mibBuilder.loadTexts: raqmonParticipantNetRTTMin.setDescription('Minimum round-trip end-to-end network delay over the entire session. If the value was not reported to the collector, this object will have the value -1.')
raqmonParticipantNetRTTMax = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 31, 1, 1, 1, 1, 31), Integer32().subtype(subtypeSpec=ConstraintsUnion(ValueRangeConstraint(-1, -1), ValueRangeConstraint(0, 2147483647), ))).setUnits('milliseconds').setMaxAccess("readonly")
if mibBuilder.loadTexts: raqmonParticipantNetRTTMax.setReference('Section 5.11 of the [RFC4710]')
if mibBuilder.loadTexts: raqmonParticipantNetRTTMax.setStatus('current')
if mibBuilder.loadTexts: raqmonParticipantNetRTTMax.setDescription('Maximum round-trip end-to-end network delay over the entire session. If the value was not reported to the collector, this object will have the value -1.')
raqmonParticipantIAJitterMean = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 31, 1, 1, 1, 1, 32), Integer32().subtype(subtypeSpec=ConstraintsUnion(ValueRangeConstraint(-1, -1), ValueRangeConstraint(0, 2147483647), ))).setUnits('milliseconds').setMaxAccess("readonly")
if mibBuilder.loadTexts: raqmonParticipantIAJitterMean.setReference('Section 5.14 of the [RFC4710]')
if mibBuilder.loadTexts: raqmonParticipantIAJitterMean.setStatus('current')
if mibBuilder.loadTexts: raqmonParticipantIAJitterMean.setDescription('Mean inter-arrival jitter over the entire session. If the value was not reported to the collector, this object will have the value -1.')
raqmonParticipantIAJitterMin = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 31, 1, 1, 1, 1, 33), Integer32().subtype(subtypeSpec=ConstraintsUnion(ValueRangeConstraint(-1, -1), ValueRangeConstraint(0, 2147483647), ))).setUnits('milliseconds').setMaxAccess("readonly")
if mibBuilder.loadTexts: raqmonParticipantIAJitterMin.setReference('Section 5.14 of the [RFC4710]')
if mibBuilder.loadTexts: raqmonParticipantIAJitterMin.setStatus('current')
if mibBuilder.loadTexts: raqmonParticipantIAJitterMin.setDescription('Minimum inter-arrival jitter over the entire session. If the value was not reported to the collector, this object will have the value -1.')
raqmonParticipantIAJitterMax = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 31, 1, 1, 1, 1, 34), Integer32().subtype(subtypeSpec=ConstraintsUnion(ValueRangeConstraint(-1, -1), ValueRangeConstraint(0, 2147483647), ))).setUnits('milliseconds').setMaxAccess("readonly")
if mibBuilder.loadTexts: raqmonParticipantIAJitterMax.setReference('Section 5.14 of the [RFC4710]')
if mibBuilder.loadTexts: raqmonParticipantIAJitterMax.setStatus('current')
if mibBuilder.loadTexts: raqmonParticipantIAJitterMax.setDescription('Maximum inter-arrival jitter over the entire session. If the value was not reported to the collector, this object will have the value -1.')
raqmonParticipantIPDVMean = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 31, 1, 1, 1, 1, 35), Integer32().subtype(subtypeSpec=ConstraintsUnion(ValueRangeConstraint(-1, -1), ValueRangeConstraint(0, 2147483647), ))).setUnits('milliseconds').setMaxAccess("readonly")
if mibBuilder.loadTexts: raqmonParticipantIPDVMean.setReference('Section 5.15 of the [RFC4710]')
if mibBuilder.loadTexts: raqmonParticipantIPDVMean.setStatus('current')
if mibBuilder.loadTexts: raqmonParticipantIPDVMean.setDescription('Mean IP packet delay variation over the entire session. If the value was not reported to the collector, this object will have the value -1.')
raqmonParticipantIPDVMin = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 31, 1, 1, 1, 1, 36), Integer32().subtype(subtypeSpec=ConstraintsUnion(ValueRangeConstraint(-1, -1), ValueRangeConstraint(0, 2147483647), ))).setUnits('milliseconds').setMaxAccess("readonly")
if mibBuilder.loadTexts: raqmonParticipantIPDVMin.setReference('Section 5.15 of the [RFC4710]')
if mibBuilder.loadTexts: raqmonParticipantIPDVMin.setStatus('current')
if mibBuilder.loadTexts: raqmonParticipantIPDVMin.setDescription('Minimum IP packet delay variation over the entire session. If the value was not reported to the collector, this object will have the value -1.')
raqmonParticipantIPDVMax = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 31, 1, 1, 1, 1, 37), Integer32().subtype(subtypeSpec=ConstraintsUnion(ValueRangeConstraint(-1, -1), ValueRangeConstraint(0, 2147483647), ))).setUnits('milliseconds').setMaxAccess("readonly")
if mibBuilder.loadTexts: raqmonParticipantIPDVMax.setReference('Section 5.15 of the [RFC4710]')
if mibBuilder.loadTexts: raqmonParticipantIPDVMax.setStatus('current')
if mibBuilder.loadTexts: raqmonParticipantIPDVMax.setDescription('Maximum IP packet delay variation over the entire session. If the value was not reported to the collector, this object will have the value -1.')
raqmonParticipantNetOwdMean = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 31, 1, 1, 1, 1, 38), Integer32().subtype(subtypeSpec=ConstraintsUnion(ValueRangeConstraint(-1, -1), ValueRangeConstraint(0, 2147483647), ))).setUnits('milliseconds').setMaxAccess("readonly")
if mibBuilder.loadTexts: raqmonParticipantNetOwdMean.setReference('Section 5.12 of the [RFC4710]')
if mibBuilder.loadTexts: raqmonParticipantNetOwdMean.setStatus('current')
if mibBuilder.loadTexts: raqmonParticipantNetOwdMean.setDescription('Mean Network one-way delay over the entire session. If the value was not reported to the collector, this object will have the value -1.')
raqmonParticipantNetOwdMin = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 31, 1, 1, 1, 1, 39), Integer32().subtype(subtypeSpec=ConstraintsUnion(ValueRangeConstraint(-1, -1), ValueRangeConstraint(0, 2147483647), ))).setUnits('milliseconds').setMaxAccess("readonly")
if mibBuilder.loadTexts: raqmonParticipantNetOwdMin.setReference('Section 5.12 of the [RFC4710]')
if mibBuilder.loadTexts: raqmonParticipantNetOwdMin.setStatus('current')
if mibBuilder.loadTexts: raqmonParticipantNetOwdMin.setDescription('Minimum Network one-way delay over the entire session. If the value was not reported to the collector, this object will have the value -1.')
raqmonParticipantNetOwdMax = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 31, 1, 1, 1, 1, 40), Integer32().subtype(subtypeSpec=ConstraintsUnion(ValueRangeConstraint(-1, -1), ValueRangeConstraint(0, 2147483647), ))).setUnits('milliseconds').setMaxAccess("readonly")
if mibBuilder.loadTexts: raqmonParticipantNetOwdMax.setReference('Section 5.1 of the [RFC4710]')
if mibBuilder.loadTexts: raqmonParticipantNetOwdMax.setStatus('current')
if mibBuilder.loadTexts: raqmonParticipantNetOwdMax.setDescription('Maximum Network one-way delay over the entire session. If the value was not reported to the collector, this object will have the value -1.')
raqmonParticipantAppDelayMean = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 31, 1, 1, 1, 1, 41), Integer32().subtype(subtypeSpec=ConstraintsUnion(ValueRangeConstraint(-1, -1), ValueRangeConstraint(0, 2147483647), ))).setUnits('milliseconds').setMaxAccess("readonly")
if mibBuilder.loadTexts: raqmonParticipantAppDelayMean.setReference('Section 5.13 of the [RFC4710]')
if mibBuilder.loadTexts: raqmonParticipantAppDelayMean.setStatus('current')
if mibBuilder.loadTexts: raqmonParticipantAppDelayMean.setDescription('Mean application delay over the entire session. If the value was not reported to the collector, this object will have the value -1.')
raqmonParticipantAppDelayMin = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 31, 1, 1, 1, 1, 42), Integer32().subtype(subtypeSpec=ConstraintsUnion(ValueRangeConstraint(-1, -1), ValueRangeConstraint(0, 2147483647), ))).setUnits('milliseconds').setMaxAccess("readonly")
if mibBuilder.loadTexts: raqmonParticipantAppDelayMin.setReference('Section 5.13 of the [RFC4710]')
if mibBuilder.loadTexts: raqmonParticipantAppDelayMin.setStatus('current')
if mibBuilder.loadTexts: raqmonParticipantAppDelayMin.setDescription('Minimum application delay over the entire session. If the value was not reported to the collector, this object will have the value -1.')
raqmonParticipantAppDelayMax = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 31, 1, 1, 1, 1, 43), Integer32().subtype(subtypeSpec=ConstraintsUnion(ValueRangeConstraint(-1, -1), ValueRangeConstraint(0, 2147483647), ))).setUnits('milliseconds').setMaxAccess("readonly")
if mibBuilder.loadTexts: raqmonParticipantAppDelayMax.setReference('Section 5.13 of the [RFC4710]')
if mibBuilder.loadTexts: raqmonParticipantAppDelayMax.setStatus('current')
if mibBuilder.loadTexts: raqmonParticipantAppDelayMax.setDescription('Maximum application delay over the entire session. If the value was not reported to the collector, this object will have the value -1.')
raqmonParticipantPacketsRcvd = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 31, 1, 1, 1, 1, 44), Integer32().subtype(subtypeSpec=ConstraintsUnion(ValueRangeConstraint(-1, -1), ValueRangeConstraint(0, 2147483647), ))).setUnits('packets').setMaxAccess("readonly")
if mibBuilder.loadTexts: raqmonParticipantPacketsRcvd.setReference('Section 5.16 of the [RFC4710]')
if mibBuilder.loadTexts: raqmonParticipantPacketsRcvd.setStatus('current')
if mibBuilder.loadTexts: raqmonParticipantPacketsRcvd.setDescription('Count of packets received for the entire session. If the value was not reported to the collector, this object will have the value -1.')
raqmonParticipantPacketsSent = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 31, 1, 1, 1, 1, 45), Integer32().subtype(subtypeSpec=ConstraintsUnion(ValueRangeConstraint(-1, -1), ValueRangeConstraint(0, 2147483647), ))).setUnits('packets').setMaxAccess("readonly")
if mibBuilder.loadTexts: raqmonParticipantPacketsSent.setReference('Section 5.17 of the [RFC4710]')
if mibBuilder.loadTexts: raqmonParticipantPacketsSent.setStatus('current')
if mibBuilder.loadTexts: raqmonParticipantPacketsSent.setDescription('Count of packets sent for the entire session. If the value was not reported to the collector, this object will have the value -1.')
raqmonParticipantOctetsRcvd = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 31, 1, 1, 1, 1, 46), Integer32().subtype(subtypeSpec=ConstraintsUnion(ValueRangeConstraint(-1, -1), ValueRangeConstraint(0, 2147483647), ))).setUnits('Octets').setMaxAccess("readonly")
if mibBuilder.loadTexts: raqmonParticipantOctetsRcvd.setReference('Section 5.18 of the [RFC4710]')
if mibBuilder.loadTexts: raqmonParticipantOctetsRcvd.setStatus('current')
if mibBuilder.loadTexts: raqmonParticipantOctetsRcvd.setDescription('Count of octets received for the entire session. If the value was not reported to the collector, this object will have the value -1.')
raqmonParticipantOctetsSent = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 31, 1, 1, 1, 1, 47), Integer32().subtype(subtypeSpec=ConstraintsUnion(ValueRangeConstraint(-1, -1), ValueRangeConstraint(0, 2147483647), ))).setUnits('Octets').setMaxAccess("readonly")
if mibBuilder.loadTexts: raqmonParticipantOctetsSent.setReference('Section 5.19 of the [RFC4710]')
if mibBuilder.loadTexts: raqmonParticipantOctetsSent.setStatus('current')
if mibBuilder.loadTexts: raqmonParticipantOctetsSent.setDescription('Count of octets sent for the entire session. If the value was not reported to the collector, this object will have the value -1.')
raqmonParticipantLostPackets = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 31, 1, 1, 1, 1, 48), Integer32().subtype(subtypeSpec=ConstraintsUnion(ValueRangeConstraint(-1, -1), ValueRangeConstraint(0, 2147483647), ))).setUnits('packets').setMaxAccess("readonly")
if mibBuilder.loadTexts: raqmonParticipantLostPackets.setReference('Section 5.20 of the [RFC4710]')
if mibBuilder.loadTexts: raqmonParticipantLostPackets.setStatus('current')
if mibBuilder.loadTexts: raqmonParticipantLostPackets.setDescription('Count of packets lost by this receiver for the entire session. If the value was not reported to the collector, this object will have the value -1.')
raqmonParticipantLostPacketsFrct = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 31, 1, 1, 1, 1, 49), Integer32().subtype(subtypeSpec=ConstraintsUnion(ValueRangeConstraint(-1, -1), ValueRangeConstraint(0, 100), ))).setUnits('percents').setMaxAccess("readonly")
if mibBuilder.loadTexts: raqmonParticipantLostPacketsFrct.setReference('Section 5.21 of the [RFC4710]')
if mibBuilder.loadTexts: raqmonParticipantLostPacketsFrct.setStatus('current')
if mibBuilder.loadTexts: raqmonParticipantLostPacketsFrct.setDescription('Fraction of lost packets out of total packets received. If the value was not reported to the collector, this object will have the value -1.')
raqmonParticipantDiscards = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 31, 1, 1, 1, 1, 50), Integer32().subtype(subtypeSpec=ConstraintsUnion(ValueRangeConstraint(-1, -1), ValueRangeConstraint(0, 2147483647), ))).setUnits('packets').setMaxAccess("readonly")
if mibBuilder.loadTexts: raqmonParticipantDiscards.setReference('Section 5.22 of the [RFC4710]')
if mibBuilder.loadTexts: raqmonParticipantDiscards.setStatus('current')
if mibBuilder.loadTexts: raqmonParticipantDiscards.setDescription('Count of packets discarded by this receiver for the entire session. If the value was not reported to the collector, this object will have the value -1.')
raqmonParticipantDiscardsFrct = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 31, 1, 1, 1, 1, 51), Integer32().subtype(subtypeSpec=ConstraintsUnion(ValueRangeConstraint(-1, -1), ValueRangeConstraint(0, 100), ))).setUnits('percents').setMaxAccess("readonly")
if mibBuilder.loadTexts: raqmonParticipantDiscardsFrct.setReference('Section 5.23 of the [RFC4710]')
if mibBuilder.loadTexts: raqmonParticipantDiscardsFrct.setStatus('current')
if mibBuilder.loadTexts: raqmonParticipantDiscardsFrct.setDescription('Fraction of discarded packets out of total packets received. If the value was not reported to the collector, this object will have the value -1.')
raqmonQosTable = MibTable((1, 3, 6, 1, 2, 1, 16, 31, 1, 1, 2), )
if mibBuilder.loadTexts: raqmonQosTable.setStatus('current')
if mibBuilder.loadTexts: raqmonQosTable.setDescription('Table of historical information about quality-of-service data during sessions.')
raqmonQosEntry = MibTableRow((1, 3, 6, 1, 2, 1, 16, 31, 1, 1, 2, 1), ).setIndexNames((0, "RAQMON-MIB", "raqmonParticipantStartDate"), (0, "RAQMON-MIB", "raqmonParticipantIndex"), (0, "RAQMON-MIB", "raqmonQosTime"))
if mibBuilder.loadTexts: raqmonQosEntry.setStatus('current')
if mibBuilder.loadTexts: raqmonQosEntry.setDescription('Each entry contains information from a single RAQMON packet, related to a single session (application) run by one participant. Indexation by the start time of the session aims to ease sorting by management applications. Agents MUST NOT report identical start times for any two sessions on the same host. Rows are removed for inactive sessions when implementation-specific time or space limits are reached.')
raqmonQosTime = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 31, 1, 1, 2, 1, 1), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(0, 2147483647))).setUnits('seconds')
if mibBuilder.loadTexts: raqmonQosTime.setStatus('current')
if mibBuilder.loadTexts: raqmonQosTime.setDescription('Time of this entry measured from the start of the corresponding participant session.')
raqmonQoSEnd2EndNetDelay = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 31, 1, 1, 2, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(ValueRangeConstraint(-1, -1), ValueRangeConstraint(0, 2147483647), ))).setUnits('milliseconds').setMaxAccess("readonly")
if mibBuilder.loadTexts: raqmonQoSEnd2EndNetDelay.setReference('Section 5.11 of the [RFC4710]')
if mibBuilder.loadTexts: raqmonQoSEnd2EndNetDelay.setStatus('current')
if mibBuilder.loadTexts: raqmonQoSEnd2EndNetDelay.setDescription('The round-trip time. Will contain the previous value if there was no report for this time, or -1 if the value has never been reported.')
raqmonQoSInterArrivalJitter = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 31, 1, 1, 2, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(ValueRangeConstraint(-1, -1), ValueRangeConstraint(0, 2147483647), ))).setUnits('milliseconds').setMaxAccess("readonly")
if mibBuilder.loadTexts: raqmonQoSInterArrivalJitter.setReference('Section 5.14 of the [RFC4710]')
if mibBuilder.loadTexts: raqmonQoSInterArrivalJitter.setStatus('current')
if mibBuilder.loadTexts: raqmonQoSInterArrivalJitter.setDescription('An estimate of delay variation as observed by this receiver. Will contain the previous value if there was no report for this time, or -1 if the value has never been reported.')
raqmonQosRcvdPackets = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 31, 1, 1, 2, 1, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(ValueRangeConstraint(-1, -1), ValueRangeConstraint(0, 2147483647), ))).setUnits('packets').setMaxAccess("readonly")
if mibBuilder.loadTexts: raqmonQosRcvdPackets.setReference('Section 5.16 of the [RFC4710]')
if mibBuilder.loadTexts: raqmonQosRcvdPackets.setStatus('current')
if mibBuilder.loadTexts: raqmonQosRcvdPackets.setDescription('Count of packets received by this receiver since the previous entry. Will contain the previous value if there was no report for this time, or -1 if the value has never been reported.')
raqmonQosRcvdOctets = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 31, 1, 1, 2, 1, 5), Integer32().subtype(subtypeSpec=ConstraintsUnion(ValueRangeConstraint(-1, -1), ValueRangeConstraint(0, 2147483647), ))).setUnits('octets').setMaxAccess("readonly")
if mibBuilder.loadTexts: raqmonQosRcvdOctets.setReference('Section 5.18 of the [RFC4710]')
if mibBuilder.loadTexts: raqmonQosRcvdOctets.setStatus('current')
if mibBuilder.loadTexts: raqmonQosRcvdOctets.setDescription('Count of octets received by this receiver since the previous report. Will contain the previous value if there was no report for this time, or -1 if the value has never been reported.')
raqmonQosSentPackets = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 31, 1, 1, 2, 1, 6), Integer32().subtype(subtypeSpec=ConstraintsUnion(ValueRangeConstraint(-1, -1), ValueRangeConstraint(0, 2147483647), ))).setUnits('packets').setMaxAccess("readonly")
if mibBuilder.loadTexts: raqmonQosSentPackets.setReference('Section 5.17 of the [RFC4710]')
if mibBuilder.loadTexts: raqmonQosSentPackets.setStatus('current')
if mibBuilder.loadTexts: raqmonQosSentPackets.setDescription('Count of packets sent since the previous report. Will contain the previous value if there was no report for this time, or -1 if the value has never been reported.')
raqmonQosSentOctets = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 31, 1, 1, 2, 1, 7), Integer32().subtype(subtypeSpec=ConstraintsUnion(ValueRangeConstraint(-1, -1), ValueRangeConstraint(0, 2147483647), ))).setUnits('octets').setMaxAccess("readonly")
if mibBuilder.loadTexts: raqmonQosSentOctets.setReference('Section 5.19 of the [RFC4710]')
if mibBuilder.loadTexts: raqmonQosSentOctets.setStatus('current')
if mibBuilder.loadTexts: raqmonQosSentOctets.setDescription('Count of octets sent since the previous report. Will contain the previous value if there was no report for this time, or -1 if the value has never been reported.')
raqmonQosLostPackets = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 31, 1, 1, 2, 1, 8), Integer32().subtype(subtypeSpec=ConstraintsUnion(ValueRangeConstraint(-1, -1), ValueRangeConstraint(0, 2147483647), ))).setUnits('packets').setMaxAccess("readonly")
if mibBuilder.loadTexts: raqmonQosLostPackets.setReference('Section 5.20 of the [RFC4710]')
if mibBuilder.loadTexts: raqmonQosLostPackets.setStatus('current')
if mibBuilder.loadTexts: raqmonQosLostPackets.setDescription('A count of packets lost as observed by this receiver since the previous report. Will contain the previous value if there was no report for this time, or -1 if the value has never been reported.')
raqmonQosSessionStatus = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 31, 1, 1, 2, 1, 9), SnmpAdminString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: raqmonQosSessionStatus.setReference('Section 5.10 of the [RFC4710]')
if mibBuilder.loadTexts: raqmonQosSessionStatus.setStatus('current')
if mibBuilder.loadTexts: raqmonQosSessionStatus.setDescription('The session status. Will contain the previous value if there was no report for this time or the zero-length string if no value was ever reported.')
raqmonParticipantAddrTable = MibTable((1, 3, 6, 1, 2, 1, 16, 31, 1, 1, 3), )
if mibBuilder.loadTexts: raqmonParticipantAddrTable.setStatus('current')
if mibBuilder.loadTexts: raqmonParticipantAddrTable.setDescription('Maps raqmonParticipantAddr to the index of the raqmonParticipantTable. This table allows management applications to find entries sorted by raqmonParticipantAddr rather than raqmonParticipantStartDate.')
raqmonParticipantAddrEntry = MibTableRow((1, 3, 6, 1, 2, 1, 16, 31, 1, 1, 3, 1), ).setIndexNames((0, "RAQMON-MIB", "raqmonParticipantAddrType"), (0, "RAQMON-MIB", "raqmonParticipantAddr"), (0, "RAQMON-MIB", "raqmonParticipantStartDate"), (0, "RAQMON-MIB", "raqmonParticipantIndex"))
if mibBuilder.loadTexts: raqmonParticipantAddrEntry.setStatus('current')
if mibBuilder.loadTexts: raqmonParticipantAddrEntry.setDescription('Each entry corresponds to exactly one entry in the raqmonParticipantEntry: the entry containing the index pair raqmonParticipantStartDate, raqmonParticipantIndex. Note that there is no concern about the indexation of this table exceeding the limits defined by RFC 2578, Section 3.5. According to [RFC4710], Section 5.1, only IPv4 and IPv6 addresses can be reported as participant addresses.')
raqmonParticipantAddrEndDate = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 31, 1, 1, 3, 1, 1), DateAndTime()).setMaxAccess("readonly")
if mibBuilder.loadTexts: raqmonParticipantAddrEndDate.setStatus('current')
if mibBuilder.loadTexts: raqmonParticipantAddrEndDate.setDescription('The value of raqmonParticipantEndDate for the corresponding raqmonParticipantEntry.')
raqmonException = MibIdentifier((1, 3, 6, 1, 2, 1, 16, 31, 1, 2))
raqmonSessionExceptionTable = MibTable((1, 3, 6, 1, 2, 1, 16, 31, 1, 2, 2), )
if mibBuilder.loadTexts: raqmonSessionExceptionTable.setStatus('current')
if mibBuilder.loadTexts: raqmonSessionExceptionTable.setDescription('This table defines thresholds for the management station to get notifications about sessions that encountered poor quality of service. The information in this table MUST be persistent across agent reboots.')
raqmonSessionExceptionEntry = MibTableRow((1, 3, 6, 1, 2, 1, 16, 31, 1, 2, 2, 1), ).setIndexNames((0, "RAQMON-MIB", "raqmonSessionExceptionIndex"))
if mibBuilder.loadTexts: raqmonSessionExceptionEntry.setStatus('current')
if mibBuilder.loadTexts: raqmonSessionExceptionEntry.setDescription('A conceptual row in the raqmonSessionExceptionTable.')
raqmonSessionExceptionIndex = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 31, 1, 2, 2, 1, 2), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(1, 65535)))
if mibBuilder.loadTexts: raqmonSessionExceptionIndex.setStatus('current')
if mibBuilder.loadTexts: raqmonSessionExceptionIndex.setDescription('An index that uniquely identifies an entry in the raqmonSessionExceptionTable. Management applications can determine unused indices by performing GetNext or GetBulk operations on the Table.')
raqmonSessionExceptionIAJitterThreshold = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 31, 1, 2, 2, 1, 3), Unsigned32()).setUnits('milliseconds').setMaxAccess("readcreate")
if mibBuilder.loadTexts: raqmonSessionExceptionIAJitterThreshold.setStatus('current')
if mibBuilder.loadTexts: raqmonSessionExceptionIAJitterThreshold.setDescription('Threshold for jitter. The value during a session must be greater than or equal to this value for an exception to be created.')
raqmonSessionExceptionNetRTTThreshold = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 31, 1, 2, 2, 1, 4), Unsigned32()).setUnits('milliseconds').setMaxAccess("readcreate")
if mibBuilder.loadTexts: raqmonSessionExceptionNetRTTThreshold.setStatus('current')
if mibBuilder.loadTexts: raqmonSessionExceptionNetRTTThreshold.setDescription('Threshold for round-trip time. The value during a session must be greater than or equal to this value for an exception to be created.')
raqmonSessionExceptionLostPacketsThreshold = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 31, 1, 2, 2, 1, 5), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(0, 1000))).setUnits('tenth of a percent').setMaxAccess("readcreate")
if mibBuilder.loadTexts: raqmonSessionExceptionLostPacketsThreshold.setStatus('current')
if mibBuilder.loadTexts: raqmonSessionExceptionLostPacketsThreshold.setDescription('Threshold for lost packets in units of tenths of a percent. The value during a session must be greater than or equal to this value for an exception to be created.')
raqmonSessionExceptionRowStatus = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 31, 1, 2, 2, 1, 7), RowStatus()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: raqmonSessionExceptionRowStatus.setStatus('current')
if mibBuilder.loadTexts: raqmonSessionExceptionRowStatus.setDescription("This object has a value of 'active' when exceptions are being monitored by the system. A newly-created conceptual row must have all the read-create objects initialized before becoming 'active'. A conceptual row that is in the 'notReady' or 'notInService' state MAY be removed after 5 minutes. No writeable objects can be changed while the row is active.")
raqmonConfig = MibIdentifier((1, 3, 6, 1, 2, 1, 16, 31, 1, 3))
raqmonConfigPort = MibScalar((1, 3, 6, 1, 2, 1, 16, 31, 1, 3, 1), InetPortNumber()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: raqmonConfigPort.setStatus('current')
if mibBuilder.loadTexts: raqmonConfigPort.setDescription('The UDP port to listen on for RAQMON reports, running on transport protocols other than SNMP. If the RAQMON PDU transport protocol is SNMP, a write operation on this object has no effect, as the standard port 162 is always used. The value of this object MUST be persistent across agent reboots.')
raqmonConfigPduTransport = MibScalar((1, 3, 6, 1, 2, 1, 16, 31, 1, 3, 2), Bits().clone(namedValues=NamedValues(("other", 0), ("tcp", 1), ("snmp", 2)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: raqmonConfigPduTransport.setStatus('current')
if mibBuilder.loadTexts: raqmonConfigPduTransport.setDescription('The PDU transport(s) used by this collector. If other(0) is set, the collector supports a transport other than SNMP or TCP. If tcp(1) is set, the collector supports TCP as a transport protocol. If snmp(2) is set, the collector supports SNMP as a transport protocol.')
raqmonConfigRaqmonPdus = MibScalar((1, 3, 6, 1, 2, 1, 16, 31, 1, 3, 3), Counter32()).setUnits('PDUs').setMaxAccess("readonly")
if mibBuilder.loadTexts: raqmonConfigRaqmonPdus.setStatus('current')
if mibBuilder.loadTexts: raqmonConfigRaqmonPdus.setDescription('Count of RAQMON PDUs received by the Collector.')
raqmonConfigRDSTimeout = MibScalar((1, 3, 6, 1, 2, 1, 16, 31, 1, 3, 4), Unsigned32()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: raqmonConfigRDSTimeout.setStatus('current')
if mibBuilder.loadTexts: raqmonConfigRDSTimeout.setDescription('The number of seconds since the reception of the last RAQMON PDU from a RDS after which a session between the respective RDS and the collector will be considered terminated. The value of this object MUST be persistent across agent reboots.')
raqmonConformance = MibIdentifier((1, 3, 6, 1, 2, 1, 16, 31, 2))
raqmonCompliances = MibIdentifier((1, 3, 6, 1, 2, 1, 16, 31, 2, 1))
raqmonGroups = MibIdentifier((1, 3, 6, 1, 2, 1, 16, 31, 2, 2))
raqmonCompliance = ModuleCompliance((1, 3, 6, 1, 2, 1, 16, 31, 2, 1, 1)).setObjects(("RAQMON-MIB", "raqmonCollectorGroup"), ("RAQMON-MIB", "raqmonCollectorNotificationsGroup"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
raqmonCompliance = raqmonCompliance.setStatus('current')
if mibBuilder.loadTexts: raqmonCompliance.setDescription('Describes the requirements for conformance to the RAQMON MIB.')
raqmonCollectorGroup = ObjectGroup((1, 3, 6, 1, 2, 1, 16, 31, 2, 2, 1)).setObjects(("RAQMON-MIB", "raqmonParticipantReportCaps"), ("RAQMON-MIB", "raqmonParticipantAddrType"), ("RAQMON-MIB", "raqmonParticipantAddr"), ("RAQMON-MIB", "raqmonParticipantSendPort"), ("RAQMON-MIB", "raqmonParticipantRecvPort"), ("RAQMON-MIB", "raqmonParticipantSetupDelay"), ("RAQMON-MIB", "raqmonParticipantName"), ("RAQMON-MIB", "raqmonParticipantAppName"), ("RAQMON-MIB", "raqmonParticipantQosCount"), ("RAQMON-MIB", "raqmonParticipantEndDate"), ("RAQMON-MIB", "raqmonParticipantDestPayloadType"), ("RAQMON-MIB", "raqmonParticipantSrcPayloadType"), ("RAQMON-MIB", "raqmonParticipantActive"), ("RAQMON-MIB", "raqmonParticipantPeer"), ("RAQMON-MIB", "raqmonParticipantPeerAddrType"), ("RAQMON-MIB", "raqmonParticipantPeerAddr"), ("RAQMON-MIB", "raqmonParticipantSrcL2Priority"), ("RAQMON-MIB", "raqmonParticipantDestL2Priority"), ("RAQMON-MIB", "raqmonParticipantSrcDSCP"), ("RAQMON-MIB", "raqmonParticipantDestDSCP"), ("RAQMON-MIB", "raqmonParticipantCpuMean"), ("RAQMON-MIB", "raqmonParticipantCpuMin"), ("RAQMON-MIB", "raqmonParticipantCpuMax"), ("RAQMON-MIB", "raqmonParticipantMemoryMean"), ("RAQMON-MIB", "raqmonParticipantMemoryMin"), ("RAQMON-MIB", "raqmonParticipantMemoryMax"), ("RAQMON-MIB", "raqmonParticipantNetRTTMean"), ("RAQMON-MIB", "raqmonParticipantNetRTTMin"), ("RAQMON-MIB", "raqmonParticipantNetRTTMax"), ("RAQMON-MIB", "raqmonParticipantIAJitterMean"), ("RAQMON-MIB", "raqmonParticipantIAJitterMin"), ("RAQMON-MIB", "raqmonParticipantIAJitterMax"), ("RAQMON-MIB", "raqmonParticipantIPDVMean"), ("RAQMON-MIB", "raqmonParticipantIPDVMin"), ("RAQMON-MIB", "raqmonParticipantIPDVMax"), ("RAQMON-MIB", "raqmonParticipantNetOwdMean"), ("RAQMON-MIB", "raqmonParticipantNetOwdMin"), ("RAQMON-MIB", "raqmonParticipantNetOwdMax"), ("RAQMON-MIB", "raqmonParticipantAppDelayMean"), ("RAQMON-MIB", "raqmonParticipantAppDelayMin"), ("RAQMON-MIB", "raqmonParticipantAppDelayMax"), ("RAQMON-MIB", "raqmonParticipantPacketsRcvd"), ("RAQMON-MIB", "raqmonParticipantPacketsSent"), ("RAQMON-MIB", "raqmonParticipantOctetsRcvd"), ("RAQMON-MIB", "raqmonParticipantOctetsSent"), ("RAQMON-MIB", "raqmonParticipantLostPackets"), ("RAQMON-MIB", "raqmonParticipantLostPacketsFrct"), ("RAQMON-MIB", "raqmonParticipantDiscards"), ("RAQMON-MIB", "raqmonParticipantDiscardsFrct"), ("RAQMON-MIB", "raqmonQoSEnd2EndNetDelay"), ("RAQMON-MIB", "raqmonQoSInterArrivalJitter"), ("RAQMON-MIB", "raqmonQosRcvdPackets"), ("RAQMON-MIB", "raqmonQosRcvdOctets"), ("RAQMON-MIB", "raqmonQosSentPackets"), ("RAQMON-MIB", "raqmonQosSentOctets"), ("RAQMON-MIB", "raqmonQosLostPackets"), ("RAQMON-MIB", "raqmonQosSessionStatus"), ("RAQMON-MIB", "raqmonParticipantAddrEndDate"), ("RAQMON-MIB", "raqmonConfigPort"), ("RAQMON-MIB", "raqmonSessionExceptionIAJitterThreshold"), ("RAQMON-MIB", "raqmonSessionExceptionNetRTTThreshold"), ("RAQMON-MIB", "raqmonSessionExceptionLostPacketsThreshold"), ("RAQMON-MIB", "raqmonSessionExceptionRowStatus"), ("RAQMON-MIB", "raqmonConfigPduTransport"), ("RAQMON-MIB", "raqmonConfigRaqmonPdus"), ("RAQMON-MIB", "raqmonConfigRDSTimeout"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
raqmonCollectorGroup = raqmonCollectorGroup.setStatus('current')
if mibBuilder.loadTexts: raqmonCollectorGroup.setDescription('Objects used in RAQMON by a collector.')
raqmonCollectorNotificationsGroup = NotificationGroup((1, 3, 6, 1, 2, 1, 16, 31, 2, 2, 2)).setObjects(("RAQMON-MIB", "raqmonSessionAlarm"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
raqmonCollectorNotificationsGroup = raqmonCollectorNotificationsGroup.setStatus('current')
if mibBuilder.loadTexts: raqmonCollectorNotificationsGroup.setDescription('Notifications emitted by a RAQMON collector.')
mibBuilder.exportSymbols("RAQMON-MIB", raqmonParticipantPacketsRcvd=raqmonParticipantPacketsRcvd, raqmonCompliance=raqmonCompliance, raqmonParticipantSetupDelay=raqmonParticipantSetupDelay, raqmonParticipantPacketsSent=raqmonParticipantPacketsSent, raqmonSessionExceptionTable=raqmonSessionExceptionTable, raqmonParticipantDestPayloadType=raqmonParticipantDestPayloadType, raqmonMIBObjects=raqmonMIBObjects, raqmonParticipantReportCaps=raqmonParticipantReportCaps, raqmonQoSEnd2EndNetDelay=raqmonQoSEnd2EndNetDelay, raqmonParticipantPeer=raqmonParticipantPeer, raqmonConformance=raqmonConformance, raqmonParticipantAppDelayMean=raqmonParticipantAppDelayMean, raqmonParticipantCpuMax=raqmonParticipantCpuMax, raqmonParticipantNetRTTMax=raqmonParticipantNetRTTMax, raqmonSessionExceptionIAJitterThreshold=raqmonSessionExceptionIAJitterThreshold, raqmonQosRcvdOctets=raqmonQosRcvdOctets, raqmonParticipantSrcL2Priority=raqmonParticipantSrcL2Priority, raqmonParticipantEndDate=raqmonParticipantEndDate, raqmonQosSentPackets=raqmonQosSentPackets, raqmonParticipantDestDSCP=raqmonParticipantDestDSCP, raqmonSessionExceptionRowStatus=raqmonSessionExceptionRowStatus, raqmonParticipantAppName=raqmonParticipantAppName, raqmonParticipantIAJitterMax=raqmonParticipantIAJitterMax, raqmonQosEntry=raqmonQosEntry, raqmonConfigRDSTimeout=raqmonConfigRDSTimeout, raqmonParticipantActive=raqmonParticipantActive, raqmonParticipantPeerAddrType=raqmonParticipantPeerAddrType, raqmonCompliances=raqmonCompliances, raqmonSessionExceptionEntry=raqmonSessionExceptionEntry, raqmonQosRcvdPackets=raqmonQosRcvdPackets, raqmonParticipantLostPacketsFrct=raqmonParticipantLostPacketsFrct, raqmonQosSessionStatus=raqmonQosSessionStatus, raqmonParticipantOctetsRcvd=raqmonParticipantOctetsRcvd, raqmonCollectorGroup=raqmonCollectorGroup, PYSNMP_MODULE_ID=raqmonMIB, raqmonParticipantIPDVMax=raqmonParticipantIPDVMax, raqmonParticipantTable=raqmonParticipantTable, raqmonParticipantDestL2Priority=raqmonParticipantDestL2Priority, raqmonCollectorNotificationsGroup=raqmonCollectorNotificationsGroup, raqmonParticipantMemoryMin=raqmonParticipantMemoryMin, raqmonParticipantLostPackets=raqmonParticipantLostPackets, raqmonParticipantDiscardsFrct=raqmonParticipantDiscardsFrct, raqmonParticipantAddrEndDate=raqmonParticipantAddrEndDate, raqmonParticipantSrcPayloadType=raqmonParticipantSrcPayloadType, raqmonSession=raqmonSession, raqmonQosLostPackets=raqmonQosLostPackets, raqmonParticipantNetOwdMin=raqmonParticipantNetOwdMin, raqmonQosTable=raqmonQosTable, raqmonParticipantIPDVMin=raqmonParticipantIPDVMin, raqmonParticipantCpuMin=raqmonParticipantCpuMin, raqmonParticipantNetRTTMin=raqmonParticipantNetRTTMin, raqmonParticipantQosCount=raqmonParticipantQosCount, raqmonConfigPduTransport=raqmonConfigPduTransport, raqmonParticipantSendPort=raqmonParticipantSendPort, raqmonParticipantAppDelayMin=raqmonParticipantAppDelayMin, raqmonConfig=raqmonConfig, raqmonGroups=raqmonGroups, raqmonSessionExceptionIndex=raqmonSessionExceptionIndex, raqmonConfigRaqmonPdus=raqmonConfigRaqmonPdus, raqmonConfigPort=raqmonConfigPort, raqmonParticipantSrcDSCP=raqmonParticipantSrcDSCP, raqmonMIB=raqmonMIB, raqmonQosTime=raqmonQosTime, raqmonParticipantIndex=raqmonParticipantIndex, raqmonParticipantRecvPort=raqmonParticipantRecvPort, raqmonSessionAlarm=raqmonSessionAlarm, raqmonParticipantStartDate=raqmonParticipantStartDate, raqmonSessionExceptionLostPacketsThreshold=raqmonSessionExceptionLostPacketsThreshold, raqmonParticipantAppDelayMax=raqmonParticipantAppDelayMax, raqmonParticipantDiscards=raqmonParticipantDiscards, raqmonParticipantAddrType=raqmonParticipantAddrType, raqmonParticipantCpuMean=raqmonParticipantCpuMean, raqmonParticipantIAJitterMin=raqmonParticipantIAJitterMin, raqmonParticipantOctetsSent=raqmonParticipantOctetsSent, raqmonNotifications=raqmonNotifications, raqmonParticipantNetRTTMean=raqmonParticipantNetRTTMean, raqmonParticipantMemoryMax=raqmonParticipantMemoryMax, raqmonParticipantAddr=raqmonParticipantAddr, raqmonQosSentOctets=raqmonQosSentOctets, raqmonParticipantMemoryMean=raqmonParticipantMemoryMean, raqmonParticipantPeerAddr=raqmonParticipantPeerAddr, raqmonParticipantName=raqmonParticipantName, raqmonSessionExceptionNetRTTThreshold=raqmonSessionExceptionNetRTTThreshold, raqmonParticipantAddrEntry=raqmonParticipantAddrEntry, raqmonParticipantIAJitterMean=raqmonParticipantIAJitterMean, raqmonParticipantEntry=raqmonParticipantEntry, raqmonParticipantAddrTable=raqmonParticipantAddrTable, raqmonQoSInterArrivalJitter=raqmonQoSInterArrivalJitter, raqmonParticipantIPDVMean=raqmonParticipantIPDVMean, raqmonParticipantNetOwdMean=raqmonParticipantNetOwdMean, raqmonParticipantNetOwdMax=raqmonParticipantNetOwdMax, raqmonException=raqmonException)
| (integer, object_identifier, octet_string) = mibBuilder.importSymbols('ASN1', 'Integer', 'ObjectIdentifier', 'OctetString')
(named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues')
(single_value_constraint, value_range_constraint, constraints_union, constraints_intersection, value_size_constraint) = mibBuilder.importSymbols('ASN1-REFINEMENT', 'SingleValueConstraint', 'ValueRangeConstraint', 'ConstraintsUnion', 'ConstraintsIntersection', 'ValueSizeConstraint')
(inet_port_number, inet_address, inet_address_type) = mibBuilder.importSymbols('INET-ADDRESS-MIB', 'InetPortNumber', 'InetAddress', 'InetAddressType')
(rmon,) = mibBuilder.importSymbols('RMON-MIB', 'rmon')
(snmp_admin_string,) = mibBuilder.importSymbols('SNMP-FRAMEWORK-MIB', 'SnmpAdminString')
(object_group, notification_group, module_compliance) = mibBuilder.importSymbols('SNMPv2-CONF', 'ObjectGroup', 'NotificationGroup', 'ModuleCompliance')
(bits, ip_address, mib_identifier, mib_scalar, mib_table, mib_table_row, mib_table_column, time_ticks, notification_type, counter64, gauge32, iso, integer32, counter32, module_identity, unsigned32, object_identity) = mibBuilder.importSymbols('SNMPv2-SMI', 'Bits', 'IpAddress', 'MibIdentifier', 'MibScalar', 'MibTable', 'MibTableRow', 'MibTableColumn', 'TimeTicks', 'NotificationType', 'Counter64', 'Gauge32', 'iso', 'Integer32', 'Counter32', 'ModuleIdentity', 'Unsigned32', 'ObjectIdentity')
(row_pointer, display_string, row_status, truth_value, date_and_time, textual_convention) = mibBuilder.importSymbols('SNMPv2-TC', 'RowPointer', 'DisplayString', 'RowStatus', 'TruthValue', 'DateAndTime', 'TextualConvention')
raqmon_mib = module_identity((1, 3, 6, 1, 2, 1, 16, 31))
raqmonMIB.setRevisions(('2006-10-10 00:00',))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
if mibBuilder.loadTexts:
raqmonMIB.setRevisionsDescriptions(('Initial version, published as RFC 4711.',))
if mibBuilder.loadTexts:
raqmonMIB.setLastUpdated('200610100000Z')
if mibBuilder.loadTexts:
raqmonMIB.setOrganization('IETF RMON MIB Working Group')
if mibBuilder.loadTexts:
raqmonMIB.setContactInfo('WG Charter: http://www.ietf.org/html.charters/rmonmib-charter.html Mailing lists: General Discussion: rmonmib@ietf.org To Subscribe: rmonmib-requests@ietf.org In Body: subscribe your_email_address Chair: Andy Bierman Email: ietf@andybierman.com Editor: Dan Romascanu Avaya Email: dromasca@avaya.com')
if mibBuilder.loadTexts:
raqmonMIB.setDescription('Real-Time Application QoS Monitoring MIB. Copyright (c) The Internet Society (2006). This version of this MIB module is part of RFC 4711; See the RFC itself for full legal notices.')
raqmon_notifications = mib_identifier((1, 3, 6, 1, 2, 1, 16, 31, 0))
raqmon_session_alarm = notification_type((1, 3, 6, 1, 2, 1, 16, 31, 0, 1)).setObjects(('RAQMON-MIB', 'raqmonParticipantAddr'), ('RAQMON-MIB', 'raqmonParticipantName'), ('RAQMON-MIB', 'raqmonParticipantPeerAddrType'), ('RAQMON-MIB', 'raqmonParticipantPeerAddr'), ('RAQMON-MIB', 'raqmonQoSEnd2EndNetDelay'), ('RAQMON-MIB', 'raqmonQoSInterArrivalJitter'), ('RAQMON-MIB', 'raqmonQosLostPackets'), ('RAQMON-MIB', 'raqmonQosRcvdPackets'))
if mibBuilder.loadTexts:
raqmonSessionAlarm.setStatus('current')
if mibBuilder.loadTexts:
raqmonSessionAlarm.setDescription('A notification generated by an entry in the raqmonSessionExceptionTable.')
raqmon_mib_objects = mib_identifier((1, 3, 6, 1, 2, 1, 16, 31, 1))
raqmon_session = mib_identifier((1, 3, 6, 1, 2, 1, 16, 31, 1, 1))
raqmon_participant_table = mib_table((1, 3, 6, 1, 2, 1, 16, 31, 1, 1, 1))
if mibBuilder.loadTexts:
raqmonParticipantTable.setStatus('current')
if mibBuilder.loadTexts:
raqmonParticipantTable.setDescription('This table contains information about participants in both active and closed (terminated) sessions.')
raqmon_participant_entry = mib_table_row((1, 3, 6, 1, 2, 1, 16, 31, 1, 1, 1, 1)).setIndexNames((0, 'RAQMON-MIB', 'raqmonParticipantStartDate'), (0, 'RAQMON-MIB', 'raqmonParticipantIndex'))
if mibBuilder.loadTexts:
raqmonParticipantEntry.setStatus('current')
if mibBuilder.loadTexts:
raqmonParticipantEntry.setDescription('Each row contains information for a single session (application) run by one participant. Indexation by the start time of the session aims to ease sorting by management applications. Agents MUST NOT report identical start times for any two sessions on the same host. Rows are removed for inactive sessions when implementation-specific age or space limits are reached.')
raqmon_participant_start_date = mib_table_column((1, 3, 6, 1, 2, 1, 16, 31, 1, 1, 1, 1, 1), date_and_time())
if mibBuilder.loadTexts:
raqmonParticipantStartDate.setStatus('current')
if mibBuilder.loadTexts:
raqmonParticipantStartDate.setDescription('The date and time of this entry. It will be the date and time of the first report received.')
raqmon_participant_index = mib_table_column((1, 3, 6, 1, 2, 1, 16, 31, 1, 1, 1, 1, 2), unsigned32().subtype(subtypeSpec=value_range_constraint(1, 2147483647)))
if mibBuilder.loadTexts:
raqmonParticipantIndex.setStatus('current')
if mibBuilder.loadTexts:
raqmonParticipantIndex.setDescription('The index of the conceptual row, which is for SNMP purposes only and has no relation to any protocol value. There is no requirement that these rows be created or maintained sequentially. The index will be unique for a particular date and time.')
raqmon_participant_report_caps = mib_table_column((1, 3, 6, 1, 2, 1, 16, 31, 1, 1, 1, 1, 3), bits().clone(namedValues=named_values(('raqmonPartRepDsrcName', 0), ('raqmonPartRepRecvName', 1), ('raqmonPartRepDsrcPort', 2), ('raqmonPartRepRecvPort', 3), ('raqmonPartRepSetupTime', 4), ('raqmonPartRepSetupDelay', 5), ('raqmonPartRepSessionDuration', 6), ('raqmonPartRepSetupStatus', 7), ('raqmonPartRepRTEnd2EndNetDelay', 8), ('raqmonPartRepOWEnd2EndNetDelay', 9), ('raqmonPartApplicationDelay', 10), ('raqmonPartRepIAJitter', 11), ('raqmonPartRepIPDV', 12), ('raqmonPartRepRcvdPackets', 13), ('raqmonPartRepRcvdOctets', 14), ('raqmonPartRepSentPackets', 15), ('raqmonPartRepSentOctets', 16), ('raqmonPartRepCumPacketsLoss', 17), ('raqmonPartRepFractionPacketsLoss', 18), ('raqmonPartRepCumDiscards', 19), ('raqmonPartRepFractionDiscards', 20), ('raqmonPartRepSrcPayloadType', 21), ('raqmonPartRepDestPayloadType', 22), ('raqmonPartRepSrcLayer2Priority', 23), ('raqmonPartRepSrcTosDscp', 24), ('raqmonPartRepDestLayer2Priority', 25), ('raqmonPartRepDestTosDscp', 26), ('raqmonPartRepCPU', 27), ('raqmonPartRepMemory', 28), ('raqmonPartRepAppName', 29)))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
raqmonParticipantReportCaps.setStatus('current')
if mibBuilder.loadTexts:
raqmonParticipantReportCaps.setDescription('The Report capabilities of the participant, as perceived by the Collector. If the participant can report the Data Source Name as defined in [RFC4710], Section 5.3, then the raqmonPartRepDsrcName bit will be set. If the participant can report the Receiver Name as defined in [RFC4710], Section 5.4, then the raqmonPartRepRecvName bit will be set. If the participant can report the Data Source Port as defined in [RFC4710], Section 5.5, then the raqmonPartRepDsrcPort bit will be set. If the participant can report the Receiver Port as defined in [RFC4710], Section 5.6, then the raqmonPartRepRecvPort bit will be set. If the participant can report the Session Setup Time as defined in [RFC4710], Section 5.7, then the raqmonPartRepSetupTime bit will be set. If the participant can report the Session Setup Delay as defined in [RFC4710], Section 5.8, then the raqmonPartRepSetupDelay bit will be set. If the participant can report the Session Duration as defined in [RFC4710], Section 5.9, then the raqmonPartRepSessionDuration bit will be set. If the participant can report the Setup Status as defined in [RFC4710], Section 5.10, then the raqmonPartRepSetupStatus bit will be set. If the participant can report the Round-Trip End-to-end Network Delay as defined in [RFC4710], Section 5.11, then the raqmonPartRepRTEnd2EndNetDelay bit will be set. If the participant can report the One-way End-to-end Network Delay as defined in [RFC4710], Section 5.12, then the raqmonPartRepOWEnd2EndNetDelay bit will be set. If the participant can report the Application Delay as defined in [RFC4710], Section 5.13, then the raqmonPartApplicationDelay bit will be set. If the participant can report the Inter-Arrival Jitter as defined in [RFC4710], Section 5.14, then the raqmonPartRepIAJitter bit will be set. If the participant can report the IP Packet Delay Variation as defined in [RFC4710], Section 5.15, then the raqmonPartRepIPDV bit will be set. If the participant can report the number of application packets received as defined in [RFC4710], Section 5.16, then the raqmonPartRepRcvdPackets bit will be set. If the participant can report the number of application octets received as defined in [RFC4710], Section 5.17, then the raqmonPartRepRcvdOctets bit will be set. If the participant can report the number of application packets sent as defined in [RFC4710], Section 5.18, then the raqmonPartRepSentPackets bit will be set. If the participant can report the number of application octets sent as defined in [RFC4710], Section 5.19, then the raqmonPartRepSentOctets bit will be set. If the participant can report the number of cumulative packets lost as defined in [RFC4710], Section 5.20, then the raqmonPartRepCumPacketsLoss bit will be set. If the participant can report the fraction of packet loss as defined in [RFC4710], Section 5.21, then the raqmonPartRepFractionPacketsLoss bit will be set. If the participant can report the number of cumulative discards as defined in [RFC4710], Section 5.22, then the raqmonPartRepCumDiscards bit will be set. If the participant can report the fraction of discards as defined in [RFC4710], Section 5.23, then the raqmonPartRepFractionDiscards bit will be set. If the participant can report the Source Payload Type as defined in [RFC4710], Section 5.24, then the raqmonPartRepSrcPayloadType bit will be set. If the participant can report the Destination Payload Type as defined in [RFC4710], Section 5.25, then the raqmonPartRepDestPayloadType bit will be set. If the participant can report the Source Layer 2 Priority as defined in [RFC4710], Section 5.26, then the raqmonPartRepSrcLayer2Priority bit will be set. If the participant can report the Source DSCP/ToS value as defined in [RFC4710], Section 5.27, then the raqmonPartRepSrcToSDscp bit will be set. If the participant can report the Destination Layer 2 Priority as defined in [RFC4710], Section 5.28, then the raqmonPartRepDestLayer2Priority bit will be set. If the participant can report the Destination DSCP/ToS Value as defined in [RFC4710], Section 5.29, then the raqmonPartRepDestToSDscp bit will be set. If the participant can report the CPU utilization as defined in [RFC4710], Section 5.30, then the raqmonPartRepCPU bit will be set. If the participant can report the memory utilization as defined in [RFC4710], Section 5.31, then the raqmonPartRepMemory bit will be set. If the participant can report the Application Name as defined in [RFC4710], Section 5.32, then the raqmonPartRepAppName bit will be set. The capability of reporting of a specific metric does not mandate that the metric must be reported permanently by the data source to the respective collector. Some data sources MAY be configured not to send a metric, or some metrics may not be relevant to the specific application.')
raqmon_participant_addr_type = mib_table_column((1, 3, 6, 1, 2, 1, 16, 31, 1, 1, 1, 1, 4), inet_address_type()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
raqmonParticipantAddrType.setStatus('current')
if mibBuilder.loadTexts:
raqmonParticipantAddrType.setDescription('The type of the Internet address of the participant for this session.')
raqmon_participant_addr = mib_table_column((1, 3, 6, 1, 2, 1, 16, 31, 1, 1, 1, 1, 5), inet_address()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
raqmonParticipantAddr.setStatus('current')
if mibBuilder.loadTexts:
raqmonParticipantAddr.setDescription('The Internet Address of the participant for this session. Formatting of this object is determined by the value of raqmonParticipantAddrType.')
raqmon_participant_send_port = mib_table_column((1, 3, 6, 1, 2, 1, 16, 31, 1, 1, 1, 1, 6), inet_port_number()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
raqmonParticipantSendPort.setReference('Section 5.5 of the [RFC4710]')
if mibBuilder.loadTexts:
raqmonParticipantSendPort.setStatus('current')
if mibBuilder.loadTexts:
raqmonParticipantSendPort.setDescription('Port from which session data is sent. If the value was not reported to the collector, this object will have the value 0.')
raqmon_participant_recv_port = mib_table_column((1, 3, 6, 1, 2, 1, 16, 31, 1, 1, 1, 1, 7), inet_port_number()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
raqmonParticipantRecvPort.setReference('Section 5.6 of the [RFC4710]')
if mibBuilder.loadTexts:
raqmonParticipantRecvPort.setStatus('current')
if mibBuilder.loadTexts:
raqmonParticipantRecvPort.setDescription('Port on which session data is received. If the value was not reported to the collector, this object will have the value 0.')
raqmon_participant_setup_delay = mib_table_column((1, 3, 6, 1, 2, 1, 16, 31, 1, 1, 1, 1, 8), integer32().subtype(subtypeSpec=constraints_union(value_range_constraint(-1, -1), value_range_constraint(0, 2147483647)))).setUnits('milliseconds').setMaxAccess('readonly')
if mibBuilder.loadTexts:
raqmonParticipantSetupDelay.setReference('Section 5.8 of the [RFC4710]')
if mibBuilder.loadTexts:
raqmonParticipantSetupDelay.setStatus('current')
if mibBuilder.loadTexts:
raqmonParticipantSetupDelay.setDescription('Session setup time. If the value was not reported to the collector, this object will have the value -1.')
raqmon_participant_name = mib_table_column((1, 3, 6, 1, 2, 1, 16, 31, 1, 1, 1, 1, 9), snmp_admin_string()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
raqmonParticipantName.setReference('Section 5.3 of the [RFC4710]')
if mibBuilder.loadTexts:
raqmonParticipantName.setStatus('current')
if mibBuilder.loadTexts:
raqmonParticipantName.setDescription('The data source name for the participant.')
raqmon_participant_app_name = mib_table_column((1, 3, 6, 1, 2, 1, 16, 31, 1, 1, 1, 1, 10), snmp_admin_string()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
raqmonParticipantAppName.setReference('Section 5.32 of the [RFC4710]')
if mibBuilder.loadTexts:
raqmonParticipantAppName.setStatus('current')
if mibBuilder.loadTexts:
raqmonParticipantAppName.setDescription("A string giving the name and possibly the version of the application generating the stream, e.g., 'videotool 1.2.' This information may be useful for debugging purposes and is similar to the Mailer or Mail-System-Version SMTP headers. The tool value is expected to remain constant for the duration of the session.")
raqmon_participant_qos_count = mib_table_column((1, 3, 6, 1, 2, 1, 16, 31, 1, 1, 1, 1, 11), gauge32()).setUnits('entries').setMaxAccess('readonly')
if mibBuilder.loadTexts:
raqmonParticipantQosCount.setStatus('current')
if mibBuilder.loadTexts:
raqmonParticipantQosCount.setDescription('The current number of entries in the raqmonQosTable for this participant and session.')
raqmon_participant_end_date = mib_table_column((1, 3, 6, 1, 2, 1, 16, 31, 1, 1, 1, 1, 12), date_and_time()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
raqmonParticipantEndDate.setStatus('current')
if mibBuilder.loadTexts:
raqmonParticipantEndDate.setDescription('The date and time of the most recent report received.')
raqmon_participant_dest_payload_type = mib_table_column((1, 3, 6, 1, 2, 1, 16, 31, 1, 1, 1, 1, 13), integer32().subtype(subtypeSpec=constraints_union(value_range_constraint(-1, -1), value_range_constraint(0, 127)))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
raqmonParticipantDestPayloadType.setReference('RFC 3551 and Section 5.25 of the [RFC4710]')
if mibBuilder.loadTexts:
raqmonParticipantDestPayloadType.setStatus('current')
if mibBuilder.loadTexts:
raqmonParticipantDestPayloadType.setDescription('Destination Payload Type. If the value was not reported to the collector, this object will have the value -1.')
raqmon_participant_src_payload_type = mib_table_column((1, 3, 6, 1, 2, 1, 16, 31, 1, 1, 1, 1, 14), integer32().subtype(subtypeSpec=constraints_union(value_range_constraint(-1, -1), value_range_constraint(0, 127)))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
raqmonParticipantSrcPayloadType.setReference('RFC 3551 and Section 5.24 of the [RFC4710]')
if mibBuilder.loadTexts:
raqmonParticipantSrcPayloadType.setStatus('current')
if mibBuilder.loadTexts:
raqmonParticipantSrcPayloadType.setDescription('Source Payload Type. If the value was not reported to the collector, this object will have the value -1.')
raqmon_participant_active = mib_table_column((1, 3, 6, 1, 2, 1, 16, 31, 1, 1, 1, 1, 15), truth_value()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
raqmonParticipantActive.setStatus('current')
if mibBuilder.loadTexts:
raqmonParticipantActive.setDescription("Value 'true' indicates that the session for this participant is active (open). Value 'false' indicates that the session is closed (terminated).")
raqmon_participant_peer = mib_table_column((1, 3, 6, 1, 2, 1, 16, 31, 1, 1, 1, 1, 16), row_pointer()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
raqmonParticipantPeer.setStatus('current')
if mibBuilder.loadTexts:
raqmonParticipantPeer.setDescription('The pointer to the corresponding entry in this table for the other peer participant. If there is no such entry in the participant table of the collector represented by this SNMP agent, then the value will be { 0 0 }. ')
raqmon_participant_peer_addr_type = mib_table_column((1, 3, 6, 1, 2, 1, 16, 31, 1, 1, 1, 1, 17), inet_address_type()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
raqmonParticipantPeerAddrType.setStatus('current')
if mibBuilder.loadTexts:
raqmonParticipantPeerAddrType.setDescription('The type of the Internet address of the peer participant for this session.')
raqmon_participant_peer_addr = mib_table_column((1, 3, 6, 1, 2, 1, 16, 31, 1, 1, 1, 1, 18), inet_address()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
raqmonParticipantPeerAddr.setStatus('current')
if mibBuilder.loadTexts:
raqmonParticipantPeerAddr.setDescription('The Internet Address of the peer participant for this session. Formatting of this object is determined by the value of raqmonParticipantPeerAddrType.')
raqmon_participant_src_l2_priority = mib_table_column((1, 3, 6, 1, 2, 1, 16, 31, 1, 1, 1, 1, 19), integer32().subtype(subtypeSpec=constraints_union(value_range_constraint(-1, -1), value_range_constraint(0, 7)))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
raqmonParticipantSrcL2Priority.setReference('Section 5.26 of the [RFC4710]')
if mibBuilder.loadTexts:
raqmonParticipantSrcL2Priority.setStatus('current')
if mibBuilder.loadTexts:
raqmonParticipantSrcL2Priority.setDescription('Source Layer 2 Priority. If the value was not reported to the collector, this object will have the value -1.')
raqmon_participant_dest_l2_priority = mib_table_column((1, 3, 6, 1, 2, 1, 16, 31, 1, 1, 1, 1, 20), integer32().subtype(subtypeSpec=constraints_union(value_range_constraint(-1, -1), value_range_constraint(0, 7)))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
raqmonParticipantDestL2Priority.setReference('Section 5.28 of the [RFC4710]')
if mibBuilder.loadTexts:
raqmonParticipantDestL2Priority.setStatus('current')
if mibBuilder.loadTexts:
raqmonParticipantDestL2Priority.setDescription('Destination Layer 2 Priority. If the value was not reported to the collector, this object will have the value -1.')
raqmon_participant_src_dscp = mib_table_column((1, 3, 6, 1, 2, 1, 16, 31, 1, 1, 1, 1, 21), integer32().subtype(subtypeSpec=constraints_union(value_range_constraint(-1, -1), value_range_constraint(0, 63)))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
raqmonParticipantSrcDSCP.setReference('Section 5.27 of the [RFC4710]')
if mibBuilder.loadTexts:
raqmonParticipantSrcDSCP.setStatus('current')
if mibBuilder.loadTexts:
raqmonParticipantSrcDSCP.setDescription('Source Layer 3 DSCP value. If the value was not reported to the collector, this object will have the value -1.')
raqmon_participant_dest_dscp = mib_table_column((1, 3, 6, 1, 2, 1, 16, 31, 1, 1, 1, 1, 22), integer32().subtype(subtypeSpec=constraints_union(value_range_constraint(-1, -1), value_range_constraint(0, 63)))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
raqmonParticipantDestDSCP.setReference('Section 5.29 of the [RFC4710]')
if mibBuilder.loadTexts:
raqmonParticipantDestDSCP.setStatus('current')
if mibBuilder.loadTexts:
raqmonParticipantDestDSCP.setDescription('Destination Layer 3 DSCP value.')
raqmon_participant_cpu_mean = mib_table_column((1, 3, 6, 1, 2, 1, 16, 31, 1, 1, 1, 1, 23), integer32().subtype(subtypeSpec=constraints_union(value_range_constraint(-1, -1), value_range_constraint(0, 100)))).setUnits('percents').setMaxAccess('readonly')
if mibBuilder.loadTexts:
raqmonParticipantCpuMean.setReference('Section 5.30 of the [RFC4710]')
if mibBuilder.loadTexts:
raqmonParticipantCpuMean.setStatus('current')
if mibBuilder.loadTexts:
raqmonParticipantCpuMean.setDescription('Mean CPU utilization. If the value was not reported to the collector, this object will have the value -1.')
raqmon_participant_cpu_min = mib_table_column((1, 3, 6, 1, 2, 1, 16, 31, 1, 1, 1, 1, 24), integer32().subtype(subtypeSpec=constraints_union(value_range_constraint(-1, -1), value_range_constraint(0, 100)))).setUnits('percents').setMaxAccess('readonly')
if mibBuilder.loadTexts:
raqmonParticipantCpuMin.setReference('Section 5.30 of the [RFC4710]')
if mibBuilder.loadTexts:
raqmonParticipantCpuMin.setStatus('current')
if mibBuilder.loadTexts:
raqmonParticipantCpuMin.setDescription('Minimum CPU utilization. If the value was not reported to the collector, this object will have the value -1.')
raqmon_participant_cpu_max = mib_table_column((1, 3, 6, 1, 2, 1, 16, 31, 1, 1, 1, 1, 25), integer32().subtype(subtypeSpec=constraints_union(value_range_constraint(-1, -1), value_range_constraint(0, 100)))).setUnits('percents').setMaxAccess('readonly')
if mibBuilder.loadTexts:
raqmonParticipantCpuMax.setReference('Section 5.30 of the [RFC4710]')
if mibBuilder.loadTexts:
raqmonParticipantCpuMax.setStatus('current')
if mibBuilder.loadTexts:
raqmonParticipantCpuMax.setDescription('Maximum CPU utilization. If the value was not reported to the collector, this object will have the value -1.')
raqmon_participant_memory_mean = mib_table_column((1, 3, 6, 1, 2, 1, 16, 31, 1, 1, 1, 1, 26), integer32().subtype(subtypeSpec=constraints_union(value_range_constraint(-1, -1), value_range_constraint(0, 100)))).setUnits('percents').setMaxAccess('readonly')
if mibBuilder.loadTexts:
raqmonParticipantMemoryMean.setReference('Section 5.31 of the [RFC4710]')
if mibBuilder.loadTexts:
raqmonParticipantMemoryMean.setStatus('current')
if mibBuilder.loadTexts:
raqmonParticipantMemoryMean.setDescription('Mean memory utilization. If the value was not reported to the collector, this object will have the value -1.')
raqmon_participant_memory_min = mib_table_column((1, 3, 6, 1, 2, 1, 16, 31, 1, 1, 1, 1, 27), integer32().subtype(subtypeSpec=constraints_union(value_range_constraint(-1, -1), value_range_constraint(0, 100)))).setUnits('percents').setMaxAccess('readonly')
if mibBuilder.loadTexts:
raqmonParticipantMemoryMin.setReference('Section 5.31 of the [RFC4710]')
if mibBuilder.loadTexts:
raqmonParticipantMemoryMin.setStatus('current')
if mibBuilder.loadTexts:
raqmonParticipantMemoryMin.setDescription('Minimum memory utilization. If the value was not reported to the collector, this object will have the value -1.')
raqmon_participant_memory_max = mib_table_column((1, 3, 6, 1, 2, 1, 16, 31, 1, 1, 1, 1, 28), integer32().subtype(subtypeSpec=constraints_union(value_range_constraint(-1, -1), value_range_constraint(0, 100)))).setUnits('percents').setMaxAccess('readonly')
if mibBuilder.loadTexts:
raqmonParticipantMemoryMax.setReference('Section 5.31 of the [RFC4710]')
if mibBuilder.loadTexts:
raqmonParticipantMemoryMax.setStatus('current')
if mibBuilder.loadTexts:
raqmonParticipantMemoryMax.setDescription('Maximum memory utilization. If the value was not reported to the collector, this object will have the value -1.')
raqmon_participant_net_rtt_mean = mib_table_column((1, 3, 6, 1, 2, 1, 16, 31, 1, 1, 1, 1, 29), integer32().subtype(subtypeSpec=constraints_union(value_range_constraint(-1, -1), value_range_constraint(0, 2147483647)))).setUnits('milliseconds').setMaxAccess('readonly')
if mibBuilder.loadTexts:
raqmonParticipantNetRTTMean.setReference('Section 5.11 of the [RFC4710]')
if mibBuilder.loadTexts:
raqmonParticipantNetRTTMean.setStatus('current')
if mibBuilder.loadTexts:
raqmonParticipantNetRTTMean.setDescription('Mean round-trip end-to-end network delay over the entire session. If the value was not reported to the collector, this object will have the value -1.')
raqmon_participant_net_rtt_min = mib_table_column((1, 3, 6, 1, 2, 1, 16, 31, 1, 1, 1, 1, 30), integer32().subtype(subtypeSpec=constraints_union(value_range_constraint(-1, -1), value_range_constraint(0, 2147483647)))).setUnits('milliseconds').setMaxAccess('readonly')
if mibBuilder.loadTexts:
raqmonParticipantNetRTTMin.setReference('Section 5.11 of the [RFC4710]')
if mibBuilder.loadTexts:
raqmonParticipantNetRTTMin.setStatus('current')
if mibBuilder.loadTexts:
raqmonParticipantNetRTTMin.setDescription('Minimum round-trip end-to-end network delay over the entire session. If the value was not reported to the collector, this object will have the value -1.')
raqmon_participant_net_rtt_max = mib_table_column((1, 3, 6, 1, 2, 1, 16, 31, 1, 1, 1, 1, 31), integer32().subtype(subtypeSpec=constraints_union(value_range_constraint(-1, -1), value_range_constraint(0, 2147483647)))).setUnits('milliseconds').setMaxAccess('readonly')
if mibBuilder.loadTexts:
raqmonParticipantNetRTTMax.setReference('Section 5.11 of the [RFC4710]')
if mibBuilder.loadTexts:
raqmonParticipantNetRTTMax.setStatus('current')
if mibBuilder.loadTexts:
raqmonParticipantNetRTTMax.setDescription('Maximum round-trip end-to-end network delay over the entire session. If the value was not reported to the collector, this object will have the value -1.')
raqmon_participant_ia_jitter_mean = mib_table_column((1, 3, 6, 1, 2, 1, 16, 31, 1, 1, 1, 1, 32), integer32().subtype(subtypeSpec=constraints_union(value_range_constraint(-1, -1), value_range_constraint(0, 2147483647)))).setUnits('milliseconds').setMaxAccess('readonly')
if mibBuilder.loadTexts:
raqmonParticipantIAJitterMean.setReference('Section 5.14 of the [RFC4710]')
if mibBuilder.loadTexts:
raqmonParticipantIAJitterMean.setStatus('current')
if mibBuilder.loadTexts:
raqmonParticipantIAJitterMean.setDescription('Mean inter-arrival jitter over the entire session. If the value was not reported to the collector, this object will have the value -1.')
raqmon_participant_ia_jitter_min = mib_table_column((1, 3, 6, 1, 2, 1, 16, 31, 1, 1, 1, 1, 33), integer32().subtype(subtypeSpec=constraints_union(value_range_constraint(-1, -1), value_range_constraint(0, 2147483647)))).setUnits('milliseconds').setMaxAccess('readonly')
if mibBuilder.loadTexts:
raqmonParticipantIAJitterMin.setReference('Section 5.14 of the [RFC4710]')
if mibBuilder.loadTexts:
raqmonParticipantIAJitterMin.setStatus('current')
if mibBuilder.loadTexts:
raqmonParticipantIAJitterMin.setDescription('Minimum inter-arrival jitter over the entire session. If the value was not reported to the collector, this object will have the value -1.')
raqmon_participant_ia_jitter_max = mib_table_column((1, 3, 6, 1, 2, 1, 16, 31, 1, 1, 1, 1, 34), integer32().subtype(subtypeSpec=constraints_union(value_range_constraint(-1, -1), value_range_constraint(0, 2147483647)))).setUnits('milliseconds').setMaxAccess('readonly')
if mibBuilder.loadTexts:
raqmonParticipantIAJitterMax.setReference('Section 5.14 of the [RFC4710]')
if mibBuilder.loadTexts:
raqmonParticipantIAJitterMax.setStatus('current')
if mibBuilder.loadTexts:
raqmonParticipantIAJitterMax.setDescription('Maximum inter-arrival jitter over the entire session. If the value was not reported to the collector, this object will have the value -1.')
raqmon_participant_ipdv_mean = mib_table_column((1, 3, 6, 1, 2, 1, 16, 31, 1, 1, 1, 1, 35), integer32().subtype(subtypeSpec=constraints_union(value_range_constraint(-1, -1), value_range_constraint(0, 2147483647)))).setUnits('milliseconds').setMaxAccess('readonly')
if mibBuilder.loadTexts:
raqmonParticipantIPDVMean.setReference('Section 5.15 of the [RFC4710]')
if mibBuilder.loadTexts:
raqmonParticipantIPDVMean.setStatus('current')
if mibBuilder.loadTexts:
raqmonParticipantIPDVMean.setDescription('Mean IP packet delay variation over the entire session. If the value was not reported to the collector, this object will have the value -1.')
raqmon_participant_ipdv_min = mib_table_column((1, 3, 6, 1, 2, 1, 16, 31, 1, 1, 1, 1, 36), integer32().subtype(subtypeSpec=constraints_union(value_range_constraint(-1, -1), value_range_constraint(0, 2147483647)))).setUnits('milliseconds').setMaxAccess('readonly')
if mibBuilder.loadTexts:
raqmonParticipantIPDVMin.setReference('Section 5.15 of the [RFC4710]')
if mibBuilder.loadTexts:
raqmonParticipantIPDVMin.setStatus('current')
if mibBuilder.loadTexts:
raqmonParticipantIPDVMin.setDescription('Minimum IP packet delay variation over the entire session. If the value was not reported to the collector, this object will have the value -1.')
raqmon_participant_ipdv_max = mib_table_column((1, 3, 6, 1, 2, 1, 16, 31, 1, 1, 1, 1, 37), integer32().subtype(subtypeSpec=constraints_union(value_range_constraint(-1, -1), value_range_constraint(0, 2147483647)))).setUnits('milliseconds').setMaxAccess('readonly')
if mibBuilder.loadTexts:
raqmonParticipantIPDVMax.setReference('Section 5.15 of the [RFC4710]')
if mibBuilder.loadTexts:
raqmonParticipantIPDVMax.setStatus('current')
if mibBuilder.loadTexts:
raqmonParticipantIPDVMax.setDescription('Maximum IP packet delay variation over the entire session. If the value was not reported to the collector, this object will have the value -1.')
raqmon_participant_net_owd_mean = mib_table_column((1, 3, 6, 1, 2, 1, 16, 31, 1, 1, 1, 1, 38), integer32().subtype(subtypeSpec=constraints_union(value_range_constraint(-1, -1), value_range_constraint(0, 2147483647)))).setUnits('milliseconds').setMaxAccess('readonly')
if mibBuilder.loadTexts:
raqmonParticipantNetOwdMean.setReference('Section 5.12 of the [RFC4710]')
if mibBuilder.loadTexts:
raqmonParticipantNetOwdMean.setStatus('current')
if mibBuilder.loadTexts:
raqmonParticipantNetOwdMean.setDescription('Mean Network one-way delay over the entire session. If the value was not reported to the collector, this object will have the value -1.')
raqmon_participant_net_owd_min = mib_table_column((1, 3, 6, 1, 2, 1, 16, 31, 1, 1, 1, 1, 39), integer32().subtype(subtypeSpec=constraints_union(value_range_constraint(-1, -1), value_range_constraint(0, 2147483647)))).setUnits('milliseconds').setMaxAccess('readonly')
if mibBuilder.loadTexts:
raqmonParticipantNetOwdMin.setReference('Section 5.12 of the [RFC4710]')
if mibBuilder.loadTexts:
raqmonParticipantNetOwdMin.setStatus('current')
if mibBuilder.loadTexts:
raqmonParticipantNetOwdMin.setDescription('Minimum Network one-way delay over the entire session. If the value was not reported to the collector, this object will have the value -1.')
raqmon_participant_net_owd_max = mib_table_column((1, 3, 6, 1, 2, 1, 16, 31, 1, 1, 1, 1, 40), integer32().subtype(subtypeSpec=constraints_union(value_range_constraint(-1, -1), value_range_constraint(0, 2147483647)))).setUnits('milliseconds').setMaxAccess('readonly')
if mibBuilder.loadTexts:
raqmonParticipantNetOwdMax.setReference('Section 5.1 of the [RFC4710]')
if mibBuilder.loadTexts:
raqmonParticipantNetOwdMax.setStatus('current')
if mibBuilder.loadTexts:
raqmonParticipantNetOwdMax.setDescription('Maximum Network one-way delay over the entire session. If the value was not reported to the collector, this object will have the value -1.')
raqmon_participant_app_delay_mean = mib_table_column((1, 3, 6, 1, 2, 1, 16, 31, 1, 1, 1, 1, 41), integer32().subtype(subtypeSpec=constraints_union(value_range_constraint(-1, -1), value_range_constraint(0, 2147483647)))).setUnits('milliseconds').setMaxAccess('readonly')
if mibBuilder.loadTexts:
raqmonParticipantAppDelayMean.setReference('Section 5.13 of the [RFC4710]')
if mibBuilder.loadTexts:
raqmonParticipantAppDelayMean.setStatus('current')
if mibBuilder.loadTexts:
raqmonParticipantAppDelayMean.setDescription('Mean application delay over the entire session. If the value was not reported to the collector, this object will have the value -1.')
raqmon_participant_app_delay_min = mib_table_column((1, 3, 6, 1, 2, 1, 16, 31, 1, 1, 1, 1, 42), integer32().subtype(subtypeSpec=constraints_union(value_range_constraint(-1, -1), value_range_constraint(0, 2147483647)))).setUnits('milliseconds').setMaxAccess('readonly')
if mibBuilder.loadTexts:
raqmonParticipantAppDelayMin.setReference('Section 5.13 of the [RFC4710]')
if mibBuilder.loadTexts:
raqmonParticipantAppDelayMin.setStatus('current')
if mibBuilder.loadTexts:
raqmonParticipantAppDelayMin.setDescription('Minimum application delay over the entire session. If the value was not reported to the collector, this object will have the value -1.')
raqmon_participant_app_delay_max = mib_table_column((1, 3, 6, 1, 2, 1, 16, 31, 1, 1, 1, 1, 43), integer32().subtype(subtypeSpec=constraints_union(value_range_constraint(-1, -1), value_range_constraint(0, 2147483647)))).setUnits('milliseconds').setMaxAccess('readonly')
if mibBuilder.loadTexts:
raqmonParticipantAppDelayMax.setReference('Section 5.13 of the [RFC4710]')
if mibBuilder.loadTexts:
raqmonParticipantAppDelayMax.setStatus('current')
if mibBuilder.loadTexts:
raqmonParticipantAppDelayMax.setDescription('Maximum application delay over the entire session. If the value was not reported to the collector, this object will have the value -1.')
raqmon_participant_packets_rcvd = mib_table_column((1, 3, 6, 1, 2, 1, 16, 31, 1, 1, 1, 1, 44), integer32().subtype(subtypeSpec=constraints_union(value_range_constraint(-1, -1), value_range_constraint(0, 2147483647)))).setUnits('packets').setMaxAccess('readonly')
if mibBuilder.loadTexts:
raqmonParticipantPacketsRcvd.setReference('Section 5.16 of the [RFC4710]')
if mibBuilder.loadTexts:
raqmonParticipantPacketsRcvd.setStatus('current')
if mibBuilder.loadTexts:
raqmonParticipantPacketsRcvd.setDescription('Count of packets received for the entire session. If the value was not reported to the collector, this object will have the value -1.')
raqmon_participant_packets_sent = mib_table_column((1, 3, 6, 1, 2, 1, 16, 31, 1, 1, 1, 1, 45), integer32().subtype(subtypeSpec=constraints_union(value_range_constraint(-1, -1), value_range_constraint(0, 2147483647)))).setUnits('packets').setMaxAccess('readonly')
if mibBuilder.loadTexts:
raqmonParticipantPacketsSent.setReference('Section 5.17 of the [RFC4710]')
if mibBuilder.loadTexts:
raqmonParticipantPacketsSent.setStatus('current')
if mibBuilder.loadTexts:
raqmonParticipantPacketsSent.setDescription('Count of packets sent for the entire session. If the value was not reported to the collector, this object will have the value -1.')
raqmon_participant_octets_rcvd = mib_table_column((1, 3, 6, 1, 2, 1, 16, 31, 1, 1, 1, 1, 46), integer32().subtype(subtypeSpec=constraints_union(value_range_constraint(-1, -1), value_range_constraint(0, 2147483647)))).setUnits('Octets').setMaxAccess('readonly')
if mibBuilder.loadTexts:
raqmonParticipantOctetsRcvd.setReference('Section 5.18 of the [RFC4710]')
if mibBuilder.loadTexts:
raqmonParticipantOctetsRcvd.setStatus('current')
if mibBuilder.loadTexts:
raqmonParticipantOctetsRcvd.setDescription('Count of octets received for the entire session. If the value was not reported to the collector, this object will have the value -1.')
raqmon_participant_octets_sent = mib_table_column((1, 3, 6, 1, 2, 1, 16, 31, 1, 1, 1, 1, 47), integer32().subtype(subtypeSpec=constraints_union(value_range_constraint(-1, -1), value_range_constraint(0, 2147483647)))).setUnits('Octets').setMaxAccess('readonly')
if mibBuilder.loadTexts:
raqmonParticipantOctetsSent.setReference('Section 5.19 of the [RFC4710]')
if mibBuilder.loadTexts:
raqmonParticipantOctetsSent.setStatus('current')
if mibBuilder.loadTexts:
raqmonParticipantOctetsSent.setDescription('Count of octets sent for the entire session. If the value was not reported to the collector, this object will have the value -1.')
raqmon_participant_lost_packets = mib_table_column((1, 3, 6, 1, 2, 1, 16, 31, 1, 1, 1, 1, 48), integer32().subtype(subtypeSpec=constraints_union(value_range_constraint(-1, -1), value_range_constraint(0, 2147483647)))).setUnits('packets').setMaxAccess('readonly')
if mibBuilder.loadTexts:
raqmonParticipantLostPackets.setReference('Section 5.20 of the [RFC4710]')
if mibBuilder.loadTexts:
raqmonParticipantLostPackets.setStatus('current')
if mibBuilder.loadTexts:
raqmonParticipantLostPackets.setDescription('Count of packets lost by this receiver for the entire session. If the value was not reported to the collector, this object will have the value -1.')
raqmon_participant_lost_packets_frct = mib_table_column((1, 3, 6, 1, 2, 1, 16, 31, 1, 1, 1, 1, 49), integer32().subtype(subtypeSpec=constraints_union(value_range_constraint(-1, -1), value_range_constraint(0, 100)))).setUnits('percents').setMaxAccess('readonly')
if mibBuilder.loadTexts:
raqmonParticipantLostPacketsFrct.setReference('Section 5.21 of the [RFC4710]')
if mibBuilder.loadTexts:
raqmonParticipantLostPacketsFrct.setStatus('current')
if mibBuilder.loadTexts:
raqmonParticipantLostPacketsFrct.setDescription('Fraction of lost packets out of total packets received. If the value was not reported to the collector, this object will have the value -1.')
raqmon_participant_discards = mib_table_column((1, 3, 6, 1, 2, 1, 16, 31, 1, 1, 1, 1, 50), integer32().subtype(subtypeSpec=constraints_union(value_range_constraint(-1, -1), value_range_constraint(0, 2147483647)))).setUnits('packets').setMaxAccess('readonly')
if mibBuilder.loadTexts:
raqmonParticipantDiscards.setReference('Section 5.22 of the [RFC4710]')
if mibBuilder.loadTexts:
raqmonParticipantDiscards.setStatus('current')
if mibBuilder.loadTexts:
raqmonParticipantDiscards.setDescription('Count of packets discarded by this receiver for the entire session. If the value was not reported to the collector, this object will have the value -1.')
raqmon_participant_discards_frct = mib_table_column((1, 3, 6, 1, 2, 1, 16, 31, 1, 1, 1, 1, 51), integer32().subtype(subtypeSpec=constraints_union(value_range_constraint(-1, -1), value_range_constraint(0, 100)))).setUnits('percents').setMaxAccess('readonly')
if mibBuilder.loadTexts:
raqmonParticipantDiscardsFrct.setReference('Section 5.23 of the [RFC4710]')
if mibBuilder.loadTexts:
raqmonParticipantDiscardsFrct.setStatus('current')
if mibBuilder.loadTexts:
raqmonParticipantDiscardsFrct.setDescription('Fraction of discarded packets out of total packets received. If the value was not reported to the collector, this object will have the value -1.')
raqmon_qos_table = mib_table((1, 3, 6, 1, 2, 1, 16, 31, 1, 1, 2))
if mibBuilder.loadTexts:
raqmonQosTable.setStatus('current')
if mibBuilder.loadTexts:
raqmonQosTable.setDescription('Table of historical information about quality-of-service data during sessions.')
raqmon_qos_entry = mib_table_row((1, 3, 6, 1, 2, 1, 16, 31, 1, 1, 2, 1)).setIndexNames((0, 'RAQMON-MIB', 'raqmonParticipantStartDate'), (0, 'RAQMON-MIB', 'raqmonParticipantIndex'), (0, 'RAQMON-MIB', 'raqmonQosTime'))
if mibBuilder.loadTexts:
raqmonQosEntry.setStatus('current')
if mibBuilder.loadTexts:
raqmonQosEntry.setDescription('Each entry contains information from a single RAQMON packet, related to a single session (application) run by one participant. Indexation by the start time of the session aims to ease sorting by management applications. Agents MUST NOT report identical start times for any two sessions on the same host. Rows are removed for inactive sessions when implementation-specific time or space limits are reached.')
raqmon_qos_time = mib_table_column((1, 3, 6, 1, 2, 1, 16, 31, 1, 1, 2, 1, 1), unsigned32().subtype(subtypeSpec=value_range_constraint(0, 2147483647))).setUnits('seconds')
if mibBuilder.loadTexts:
raqmonQosTime.setStatus('current')
if mibBuilder.loadTexts:
raqmonQosTime.setDescription('Time of this entry measured from the start of the corresponding participant session.')
raqmon_qo_s_end2_end_net_delay = mib_table_column((1, 3, 6, 1, 2, 1, 16, 31, 1, 1, 2, 1, 2), integer32().subtype(subtypeSpec=constraints_union(value_range_constraint(-1, -1), value_range_constraint(0, 2147483647)))).setUnits('milliseconds').setMaxAccess('readonly')
if mibBuilder.loadTexts:
raqmonQoSEnd2EndNetDelay.setReference('Section 5.11 of the [RFC4710]')
if mibBuilder.loadTexts:
raqmonQoSEnd2EndNetDelay.setStatus('current')
if mibBuilder.loadTexts:
raqmonQoSEnd2EndNetDelay.setDescription('The round-trip time. Will contain the previous value if there was no report for this time, or -1 if the value has never been reported.')
raqmon_qo_s_inter_arrival_jitter = mib_table_column((1, 3, 6, 1, 2, 1, 16, 31, 1, 1, 2, 1, 3), integer32().subtype(subtypeSpec=constraints_union(value_range_constraint(-1, -1), value_range_constraint(0, 2147483647)))).setUnits('milliseconds').setMaxAccess('readonly')
if mibBuilder.loadTexts:
raqmonQoSInterArrivalJitter.setReference('Section 5.14 of the [RFC4710]')
if mibBuilder.loadTexts:
raqmonQoSInterArrivalJitter.setStatus('current')
if mibBuilder.loadTexts:
raqmonQoSInterArrivalJitter.setDescription('An estimate of delay variation as observed by this receiver. Will contain the previous value if there was no report for this time, or -1 if the value has never been reported.')
raqmon_qos_rcvd_packets = mib_table_column((1, 3, 6, 1, 2, 1, 16, 31, 1, 1, 2, 1, 4), integer32().subtype(subtypeSpec=constraints_union(value_range_constraint(-1, -1), value_range_constraint(0, 2147483647)))).setUnits('packets').setMaxAccess('readonly')
if mibBuilder.loadTexts:
raqmonQosRcvdPackets.setReference('Section 5.16 of the [RFC4710]')
if mibBuilder.loadTexts:
raqmonQosRcvdPackets.setStatus('current')
if mibBuilder.loadTexts:
raqmonQosRcvdPackets.setDescription('Count of packets received by this receiver since the previous entry. Will contain the previous value if there was no report for this time, or -1 if the value has never been reported.')
raqmon_qos_rcvd_octets = mib_table_column((1, 3, 6, 1, 2, 1, 16, 31, 1, 1, 2, 1, 5), integer32().subtype(subtypeSpec=constraints_union(value_range_constraint(-1, -1), value_range_constraint(0, 2147483647)))).setUnits('octets').setMaxAccess('readonly')
if mibBuilder.loadTexts:
raqmonQosRcvdOctets.setReference('Section 5.18 of the [RFC4710]')
if mibBuilder.loadTexts:
raqmonQosRcvdOctets.setStatus('current')
if mibBuilder.loadTexts:
raqmonQosRcvdOctets.setDescription('Count of octets received by this receiver since the previous report. Will contain the previous value if there was no report for this time, or -1 if the value has never been reported.')
raqmon_qos_sent_packets = mib_table_column((1, 3, 6, 1, 2, 1, 16, 31, 1, 1, 2, 1, 6), integer32().subtype(subtypeSpec=constraints_union(value_range_constraint(-1, -1), value_range_constraint(0, 2147483647)))).setUnits('packets').setMaxAccess('readonly')
if mibBuilder.loadTexts:
raqmonQosSentPackets.setReference('Section 5.17 of the [RFC4710]')
if mibBuilder.loadTexts:
raqmonQosSentPackets.setStatus('current')
if mibBuilder.loadTexts:
raqmonQosSentPackets.setDescription('Count of packets sent since the previous report. Will contain the previous value if there was no report for this time, or -1 if the value has never been reported.')
raqmon_qos_sent_octets = mib_table_column((1, 3, 6, 1, 2, 1, 16, 31, 1, 1, 2, 1, 7), integer32().subtype(subtypeSpec=constraints_union(value_range_constraint(-1, -1), value_range_constraint(0, 2147483647)))).setUnits('octets').setMaxAccess('readonly')
if mibBuilder.loadTexts:
raqmonQosSentOctets.setReference('Section 5.19 of the [RFC4710]')
if mibBuilder.loadTexts:
raqmonQosSentOctets.setStatus('current')
if mibBuilder.loadTexts:
raqmonQosSentOctets.setDescription('Count of octets sent since the previous report. Will contain the previous value if there was no report for this time, or -1 if the value has never been reported.')
raqmon_qos_lost_packets = mib_table_column((1, 3, 6, 1, 2, 1, 16, 31, 1, 1, 2, 1, 8), integer32().subtype(subtypeSpec=constraints_union(value_range_constraint(-1, -1), value_range_constraint(0, 2147483647)))).setUnits('packets').setMaxAccess('readonly')
if mibBuilder.loadTexts:
raqmonQosLostPackets.setReference('Section 5.20 of the [RFC4710]')
if mibBuilder.loadTexts:
raqmonQosLostPackets.setStatus('current')
if mibBuilder.loadTexts:
raqmonQosLostPackets.setDescription('A count of packets lost as observed by this receiver since the previous report. Will contain the previous value if there was no report for this time, or -1 if the value has never been reported.')
raqmon_qos_session_status = mib_table_column((1, 3, 6, 1, 2, 1, 16, 31, 1, 1, 2, 1, 9), snmp_admin_string()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
raqmonQosSessionStatus.setReference('Section 5.10 of the [RFC4710]')
if mibBuilder.loadTexts:
raqmonQosSessionStatus.setStatus('current')
if mibBuilder.loadTexts:
raqmonQosSessionStatus.setDescription('The session status. Will contain the previous value if there was no report for this time or the zero-length string if no value was ever reported.')
raqmon_participant_addr_table = mib_table((1, 3, 6, 1, 2, 1, 16, 31, 1, 1, 3))
if mibBuilder.loadTexts:
raqmonParticipantAddrTable.setStatus('current')
if mibBuilder.loadTexts:
raqmonParticipantAddrTable.setDescription('Maps raqmonParticipantAddr to the index of the raqmonParticipantTable. This table allows management applications to find entries sorted by raqmonParticipantAddr rather than raqmonParticipantStartDate.')
raqmon_participant_addr_entry = mib_table_row((1, 3, 6, 1, 2, 1, 16, 31, 1, 1, 3, 1)).setIndexNames((0, 'RAQMON-MIB', 'raqmonParticipantAddrType'), (0, 'RAQMON-MIB', 'raqmonParticipantAddr'), (0, 'RAQMON-MIB', 'raqmonParticipantStartDate'), (0, 'RAQMON-MIB', 'raqmonParticipantIndex'))
if mibBuilder.loadTexts:
raqmonParticipantAddrEntry.setStatus('current')
if mibBuilder.loadTexts:
raqmonParticipantAddrEntry.setDescription('Each entry corresponds to exactly one entry in the raqmonParticipantEntry: the entry containing the index pair raqmonParticipantStartDate, raqmonParticipantIndex. Note that there is no concern about the indexation of this table exceeding the limits defined by RFC 2578, Section 3.5. According to [RFC4710], Section 5.1, only IPv4 and IPv6 addresses can be reported as participant addresses.')
raqmon_participant_addr_end_date = mib_table_column((1, 3, 6, 1, 2, 1, 16, 31, 1, 1, 3, 1, 1), date_and_time()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
raqmonParticipantAddrEndDate.setStatus('current')
if mibBuilder.loadTexts:
raqmonParticipantAddrEndDate.setDescription('The value of raqmonParticipantEndDate for the corresponding raqmonParticipantEntry.')
raqmon_exception = mib_identifier((1, 3, 6, 1, 2, 1, 16, 31, 1, 2))
raqmon_session_exception_table = mib_table((1, 3, 6, 1, 2, 1, 16, 31, 1, 2, 2))
if mibBuilder.loadTexts:
raqmonSessionExceptionTable.setStatus('current')
if mibBuilder.loadTexts:
raqmonSessionExceptionTable.setDescription('This table defines thresholds for the management station to get notifications about sessions that encountered poor quality of service. The information in this table MUST be persistent across agent reboots.')
raqmon_session_exception_entry = mib_table_row((1, 3, 6, 1, 2, 1, 16, 31, 1, 2, 2, 1)).setIndexNames((0, 'RAQMON-MIB', 'raqmonSessionExceptionIndex'))
if mibBuilder.loadTexts:
raqmonSessionExceptionEntry.setStatus('current')
if mibBuilder.loadTexts:
raqmonSessionExceptionEntry.setDescription('A conceptual row in the raqmonSessionExceptionTable.')
raqmon_session_exception_index = mib_table_column((1, 3, 6, 1, 2, 1, 16, 31, 1, 2, 2, 1, 2), unsigned32().subtype(subtypeSpec=value_range_constraint(1, 65535)))
if mibBuilder.loadTexts:
raqmonSessionExceptionIndex.setStatus('current')
if mibBuilder.loadTexts:
raqmonSessionExceptionIndex.setDescription('An index that uniquely identifies an entry in the raqmonSessionExceptionTable. Management applications can determine unused indices by performing GetNext or GetBulk operations on the Table.')
raqmon_session_exception_ia_jitter_threshold = mib_table_column((1, 3, 6, 1, 2, 1, 16, 31, 1, 2, 2, 1, 3), unsigned32()).setUnits('milliseconds').setMaxAccess('readcreate')
if mibBuilder.loadTexts:
raqmonSessionExceptionIAJitterThreshold.setStatus('current')
if mibBuilder.loadTexts:
raqmonSessionExceptionIAJitterThreshold.setDescription('Threshold for jitter. The value during a session must be greater than or equal to this value for an exception to be created.')
raqmon_session_exception_net_rtt_threshold = mib_table_column((1, 3, 6, 1, 2, 1, 16, 31, 1, 2, 2, 1, 4), unsigned32()).setUnits('milliseconds').setMaxAccess('readcreate')
if mibBuilder.loadTexts:
raqmonSessionExceptionNetRTTThreshold.setStatus('current')
if mibBuilder.loadTexts:
raqmonSessionExceptionNetRTTThreshold.setDescription('Threshold for round-trip time. The value during a session must be greater than or equal to this value for an exception to be created.')
raqmon_session_exception_lost_packets_threshold = mib_table_column((1, 3, 6, 1, 2, 1, 16, 31, 1, 2, 2, 1, 5), unsigned32().subtype(subtypeSpec=value_range_constraint(0, 1000))).setUnits('tenth of a percent').setMaxAccess('readcreate')
if mibBuilder.loadTexts:
raqmonSessionExceptionLostPacketsThreshold.setStatus('current')
if mibBuilder.loadTexts:
raqmonSessionExceptionLostPacketsThreshold.setDescription('Threshold for lost packets in units of tenths of a percent. The value during a session must be greater than or equal to this value for an exception to be created.')
raqmon_session_exception_row_status = mib_table_column((1, 3, 6, 1, 2, 1, 16, 31, 1, 2, 2, 1, 7), row_status()).setMaxAccess('readcreate')
if mibBuilder.loadTexts:
raqmonSessionExceptionRowStatus.setStatus('current')
if mibBuilder.loadTexts:
raqmonSessionExceptionRowStatus.setDescription("This object has a value of 'active' when exceptions are being monitored by the system. A newly-created conceptual row must have all the read-create objects initialized before becoming 'active'. A conceptual row that is in the 'notReady' or 'notInService' state MAY be removed after 5 minutes. No writeable objects can be changed while the row is active.")
raqmon_config = mib_identifier((1, 3, 6, 1, 2, 1, 16, 31, 1, 3))
raqmon_config_port = mib_scalar((1, 3, 6, 1, 2, 1, 16, 31, 1, 3, 1), inet_port_number()).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
raqmonConfigPort.setStatus('current')
if mibBuilder.loadTexts:
raqmonConfigPort.setDescription('The UDP port to listen on for RAQMON reports, running on transport protocols other than SNMP. If the RAQMON PDU transport protocol is SNMP, a write operation on this object has no effect, as the standard port 162 is always used. The value of this object MUST be persistent across agent reboots.')
raqmon_config_pdu_transport = mib_scalar((1, 3, 6, 1, 2, 1, 16, 31, 1, 3, 2), bits().clone(namedValues=named_values(('other', 0), ('tcp', 1), ('snmp', 2)))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
raqmonConfigPduTransport.setStatus('current')
if mibBuilder.loadTexts:
raqmonConfigPduTransport.setDescription('The PDU transport(s) used by this collector. If other(0) is set, the collector supports a transport other than SNMP or TCP. If tcp(1) is set, the collector supports TCP as a transport protocol. If snmp(2) is set, the collector supports SNMP as a transport protocol.')
raqmon_config_raqmon_pdus = mib_scalar((1, 3, 6, 1, 2, 1, 16, 31, 1, 3, 3), counter32()).setUnits('PDUs').setMaxAccess('readonly')
if mibBuilder.loadTexts:
raqmonConfigRaqmonPdus.setStatus('current')
if mibBuilder.loadTexts:
raqmonConfigRaqmonPdus.setDescription('Count of RAQMON PDUs received by the Collector.')
raqmon_config_rds_timeout = mib_scalar((1, 3, 6, 1, 2, 1, 16, 31, 1, 3, 4), unsigned32()).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
raqmonConfigRDSTimeout.setStatus('current')
if mibBuilder.loadTexts:
raqmonConfigRDSTimeout.setDescription('The number of seconds since the reception of the last RAQMON PDU from a RDS after which a session between the respective RDS and the collector will be considered terminated. The value of this object MUST be persistent across agent reboots.')
raqmon_conformance = mib_identifier((1, 3, 6, 1, 2, 1, 16, 31, 2))
raqmon_compliances = mib_identifier((1, 3, 6, 1, 2, 1, 16, 31, 2, 1))
raqmon_groups = mib_identifier((1, 3, 6, 1, 2, 1, 16, 31, 2, 2))
raqmon_compliance = module_compliance((1, 3, 6, 1, 2, 1, 16, 31, 2, 1, 1)).setObjects(('RAQMON-MIB', 'raqmonCollectorGroup'), ('RAQMON-MIB', 'raqmonCollectorNotificationsGroup'))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
raqmon_compliance = raqmonCompliance.setStatus('current')
if mibBuilder.loadTexts:
raqmonCompliance.setDescription('Describes the requirements for conformance to the RAQMON MIB.')
raqmon_collector_group = object_group((1, 3, 6, 1, 2, 1, 16, 31, 2, 2, 1)).setObjects(('RAQMON-MIB', 'raqmonParticipantReportCaps'), ('RAQMON-MIB', 'raqmonParticipantAddrType'), ('RAQMON-MIB', 'raqmonParticipantAddr'), ('RAQMON-MIB', 'raqmonParticipantSendPort'), ('RAQMON-MIB', 'raqmonParticipantRecvPort'), ('RAQMON-MIB', 'raqmonParticipantSetupDelay'), ('RAQMON-MIB', 'raqmonParticipantName'), ('RAQMON-MIB', 'raqmonParticipantAppName'), ('RAQMON-MIB', 'raqmonParticipantQosCount'), ('RAQMON-MIB', 'raqmonParticipantEndDate'), ('RAQMON-MIB', 'raqmonParticipantDestPayloadType'), ('RAQMON-MIB', 'raqmonParticipantSrcPayloadType'), ('RAQMON-MIB', 'raqmonParticipantActive'), ('RAQMON-MIB', 'raqmonParticipantPeer'), ('RAQMON-MIB', 'raqmonParticipantPeerAddrType'), ('RAQMON-MIB', 'raqmonParticipantPeerAddr'), ('RAQMON-MIB', 'raqmonParticipantSrcL2Priority'), ('RAQMON-MIB', 'raqmonParticipantDestL2Priority'), ('RAQMON-MIB', 'raqmonParticipantSrcDSCP'), ('RAQMON-MIB', 'raqmonParticipantDestDSCP'), ('RAQMON-MIB', 'raqmonParticipantCpuMean'), ('RAQMON-MIB', 'raqmonParticipantCpuMin'), ('RAQMON-MIB', 'raqmonParticipantCpuMax'), ('RAQMON-MIB', 'raqmonParticipantMemoryMean'), ('RAQMON-MIB', 'raqmonParticipantMemoryMin'), ('RAQMON-MIB', 'raqmonParticipantMemoryMax'), ('RAQMON-MIB', 'raqmonParticipantNetRTTMean'), ('RAQMON-MIB', 'raqmonParticipantNetRTTMin'), ('RAQMON-MIB', 'raqmonParticipantNetRTTMax'), ('RAQMON-MIB', 'raqmonParticipantIAJitterMean'), ('RAQMON-MIB', 'raqmonParticipantIAJitterMin'), ('RAQMON-MIB', 'raqmonParticipantIAJitterMax'), ('RAQMON-MIB', 'raqmonParticipantIPDVMean'), ('RAQMON-MIB', 'raqmonParticipantIPDVMin'), ('RAQMON-MIB', 'raqmonParticipantIPDVMax'), ('RAQMON-MIB', 'raqmonParticipantNetOwdMean'), ('RAQMON-MIB', 'raqmonParticipantNetOwdMin'), ('RAQMON-MIB', 'raqmonParticipantNetOwdMax'), ('RAQMON-MIB', 'raqmonParticipantAppDelayMean'), ('RAQMON-MIB', 'raqmonParticipantAppDelayMin'), ('RAQMON-MIB', 'raqmonParticipantAppDelayMax'), ('RAQMON-MIB', 'raqmonParticipantPacketsRcvd'), ('RAQMON-MIB', 'raqmonParticipantPacketsSent'), ('RAQMON-MIB', 'raqmonParticipantOctetsRcvd'), ('RAQMON-MIB', 'raqmonParticipantOctetsSent'), ('RAQMON-MIB', 'raqmonParticipantLostPackets'), ('RAQMON-MIB', 'raqmonParticipantLostPacketsFrct'), ('RAQMON-MIB', 'raqmonParticipantDiscards'), ('RAQMON-MIB', 'raqmonParticipantDiscardsFrct'), ('RAQMON-MIB', 'raqmonQoSEnd2EndNetDelay'), ('RAQMON-MIB', 'raqmonQoSInterArrivalJitter'), ('RAQMON-MIB', 'raqmonQosRcvdPackets'), ('RAQMON-MIB', 'raqmonQosRcvdOctets'), ('RAQMON-MIB', 'raqmonQosSentPackets'), ('RAQMON-MIB', 'raqmonQosSentOctets'), ('RAQMON-MIB', 'raqmonQosLostPackets'), ('RAQMON-MIB', 'raqmonQosSessionStatus'), ('RAQMON-MIB', 'raqmonParticipantAddrEndDate'), ('RAQMON-MIB', 'raqmonConfigPort'), ('RAQMON-MIB', 'raqmonSessionExceptionIAJitterThreshold'), ('RAQMON-MIB', 'raqmonSessionExceptionNetRTTThreshold'), ('RAQMON-MIB', 'raqmonSessionExceptionLostPacketsThreshold'), ('RAQMON-MIB', 'raqmonSessionExceptionRowStatus'), ('RAQMON-MIB', 'raqmonConfigPduTransport'), ('RAQMON-MIB', 'raqmonConfigRaqmonPdus'), ('RAQMON-MIB', 'raqmonConfigRDSTimeout'))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
raqmon_collector_group = raqmonCollectorGroup.setStatus('current')
if mibBuilder.loadTexts:
raqmonCollectorGroup.setDescription('Objects used in RAQMON by a collector.')
raqmon_collector_notifications_group = notification_group((1, 3, 6, 1, 2, 1, 16, 31, 2, 2, 2)).setObjects(('RAQMON-MIB', 'raqmonSessionAlarm'))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
raqmon_collector_notifications_group = raqmonCollectorNotificationsGroup.setStatus('current')
if mibBuilder.loadTexts:
raqmonCollectorNotificationsGroup.setDescription('Notifications emitted by a RAQMON collector.')
mibBuilder.exportSymbols('RAQMON-MIB', raqmonParticipantPacketsRcvd=raqmonParticipantPacketsRcvd, raqmonCompliance=raqmonCompliance, raqmonParticipantSetupDelay=raqmonParticipantSetupDelay, raqmonParticipantPacketsSent=raqmonParticipantPacketsSent, raqmonSessionExceptionTable=raqmonSessionExceptionTable, raqmonParticipantDestPayloadType=raqmonParticipantDestPayloadType, raqmonMIBObjects=raqmonMIBObjects, raqmonParticipantReportCaps=raqmonParticipantReportCaps, raqmonQoSEnd2EndNetDelay=raqmonQoSEnd2EndNetDelay, raqmonParticipantPeer=raqmonParticipantPeer, raqmonConformance=raqmonConformance, raqmonParticipantAppDelayMean=raqmonParticipantAppDelayMean, raqmonParticipantCpuMax=raqmonParticipantCpuMax, raqmonParticipantNetRTTMax=raqmonParticipantNetRTTMax, raqmonSessionExceptionIAJitterThreshold=raqmonSessionExceptionIAJitterThreshold, raqmonQosRcvdOctets=raqmonQosRcvdOctets, raqmonParticipantSrcL2Priority=raqmonParticipantSrcL2Priority, raqmonParticipantEndDate=raqmonParticipantEndDate, raqmonQosSentPackets=raqmonQosSentPackets, raqmonParticipantDestDSCP=raqmonParticipantDestDSCP, raqmonSessionExceptionRowStatus=raqmonSessionExceptionRowStatus, raqmonParticipantAppName=raqmonParticipantAppName, raqmonParticipantIAJitterMax=raqmonParticipantIAJitterMax, raqmonQosEntry=raqmonQosEntry, raqmonConfigRDSTimeout=raqmonConfigRDSTimeout, raqmonParticipantActive=raqmonParticipantActive, raqmonParticipantPeerAddrType=raqmonParticipantPeerAddrType, raqmonCompliances=raqmonCompliances, raqmonSessionExceptionEntry=raqmonSessionExceptionEntry, raqmonQosRcvdPackets=raqmonQosRcvdPackets, raqmonParticipantLostPacketsFrct=raqmonParticipantLostPacketsFrct, raqmonQosSessionStatus=raqmonQosSessionStatus, raqmonParticipantOctetsRcvd=raqmonParticipantOctetsRcvd, raqmonCollectorGroup=raqmonCollectorGroup, PYSNMP_MODULE_ID=raqmonMIB, raqmonParticipantIPDVMax=raqmonParticipantIPDVMax, raqmonParticipantTable=raqmonParticipantTable, raqmonParticipantDestL2Priority=raqmonParticipantDestL2Priority, raqmonCollectorNotificationsGroup=raqmonCollectorNotificationsGroup, raqmonParticipantMemoryMin=raqmonParticipantMemoryMin, raqmonParticipantLostPackets=raqmonParticipantLostPackets, raqmonParticipantDiscardsFrct=raqmonParticipantDiscardsFrct, raqmonParticipantAddrEndDate=raqmonParticipantAddrEndDate, raqmonParticipantSrcPayloadType=raqmonParticipantSrcPayloadType, raqmonSession=raqmonSession, raqmonQosLostPackets=raqmonQosLostPackets, raqmonParticipantNetOwdMin=raqmonParticipantNetOwdMin, raqmonQosTable=raqmonQosTable, raqmonParticipantIPDVMin=raqmonParticipantIPDVMin, raqmonParticipantCpuMin=raqmonParticipantCpuMin, raqmonParticipantNetRTTMin=raqmonParticipantNetRTTMin, raqmonParticipantQosCount=raqmonParticipantQosCount, raqmonConfigPduTransport=raqmonConfigPduTransport, raqmonParticipantSendPort=raqmonParticipantSendPort, raqmonParticipantAppDelayMin=raqmonParticipantAppDelayMin, raqmonConfig=raqmonConfig, raqmonGroups=raqmonGroups, raqmonSessionExceptionIndex=raqmonSessionExceptionIndex, raqmonConfigRaqmonPdus=raqmonConfigRaqmonPdus, raqmonConfigPort=raqmonConfigPort, raqmonParticipantSrcDSCP=raqmonParticipantSrcDSCP, raqmonMIB=raqmonMIB, raqmonQosTime=raqmonQosTime, raqmonParticipantIndex=raqmonParticipantIndex, raqmonParticipantRecvPort=raqmonParticipantRecvPort, raqmonSessionAlarm=raqmonSessionAlarm, raqmonParticipantStartDate=raqmonParticipantStartDate, raqmonSessionExceptionLostPacketsThreshold=raqmonSessionExceptionLostPacketsThreshold, raqmonParticipantAppDelayMax=raqmonParticipantAppDelayMax, raqmonParticipantDiscards=raqmonParticipantDiscards, raqmonParticipantAddrType=raqmonParticipantAddrType, raqmonParticipantCpuMean=raqmonParticipantCpuMean, raqmonParticipantIAJitterMin=raqmonParticipantIAJitterMin, raqmonParticipantOctetsSent=raqmonParticipantOctetsSent, raqmonNotifications=raqmonNotifications, raqmonParticipantNetRTTMean=raqmonParticipantNetRTTMean, raqmonParticipantMemoryMax=raqmonParticipantMemoryMax, raqmonParticipantAddr=raqmonParticipantAddr, raqmonQosSentOctets=raqmonQosSentOctets, raqmonParticipantMemoryMean=raqmonParticipantMemoryMean, raqmonParticipantPeerAddr=raqmonParticipantPeerAddr, raqmonParticipantName=raqmonParticipantName, raqmonSessionExceptionNetRTTThreshold=raqmonSessionExceptionNetRTTThreshold, raqmonParticipantAddrEntry=raqmonParticipantAddrEntry, raqmonParticipantIAJitterMean=raqmonParticipantIAJitterMean, raqmonParticipantEntry=raqmonParticipantEntry, raqmonParticipantAddrTable=raqmonParticipantAddrTable, raqmonQoSInterArrivalJitter=raqmonQoSInterArrivalJitter, raqmonParticipantIPDVMean=raqmonParticipantIPDVMean, raqmonParticipantNetOwdMean=raqmonParticipantNetOwdMean, raqmonParticipantNetOwdMax=raqmonParticipantNetOwdMax, raqmonException=raqmonException) |
def findDecision(obj): #obj[0]: Passanger, obj[1]: Time, obj[2]: Coupon, obj[3]: Coupon_validity, obj[4]: Gender, obj[5]: Age, obj[6]: Children, obj[7]: Education, obj[8]: Occupation, obj[9]: Income, obj[10]: Bar, obj[11]: Coffeehouse, obj[12]: Restaurant20to50, obj[13]: Direction_same, obj[14]: Distance
# {"feature": "Passanger", "instances": 127, "metric_value": 0.9978, "depth": 1}
if obj[0]<=1:
# {"feature": "Bar", "instances": 75, "metric_value": 0.971, "depth": 2}
if obj[10]<=1.0:
# {"feature": "Coupon", "instances": 45, "metric_value": 0.8673, "depth": 3}
if obj[2]>0:
# {"feature": "Occupation", "instances": 36, "metric_value": 0.9436, "depth": 4}
if obj[8]<=14:
# {"feature": "Coffeehouse", "instances": 31, "metric_value": 0.9812, "depth": 5}
if obj[11]<=2.0:
# {"feature": "Education", "instances": 27, "metric_value": 0.999, "depth": 6}
if obj[7]>0:
# {"feature": "Time", "instances": 17, "metric_value": 0.9367, "depth": 7}
if obj[1]>0:
# {"feature": "Age", "instances": 12, "metric_value": 1.0, "depth": 8}
if obj[5]<=4:
# {"feature": "Restaurant20to50", "instances": 10, "metric_value": 0.971, "depth": 9}
if obj[12]>0.0:
# {"feature": "Income", "instances": 8, "metric_value": 1.0, "depth": 10}
if obj[9]>0:
# {"feature": "Direction_same", "instances": 7, "metric_value": 0.9852, "depth": 11}
if obj[13]<=0:
# {"feature": "Coupon_validity", "instances": 6, "metric_value": 1.0, "depth": 12}
if obj[3]<=0:
# {"feature": "Distance", "instances": 5, "metric_value": 0.971, "depth": 13}
if obj[14]>1:
# {"feature": "Gender", "instances": 4, "metric_value": 1.0, "depth": 14}
if obj[4]>0:
# {"feature": "Children", "instances": 3, "metric_value": 0.9183, "depth": 15}
if obj[6]<=0:
return 'True'
elif obj[6]>0:
return 'False'
else: return 'False'
elif obj[4]<=0:
return 'True'
else: return 'True'
elif obj[14]<=1:
return 'False'
else: return 'False'
elif obj[3]>0:
return 'True'
else: return 'True'
elif obj[13]>0:
return 'False'
else: return 'False'
elif obj[9]<=0:
return 'True'
else: return 'True'
elif obj[12]<=0.0:
return 'False'
else: return 'False'
elif obj[5]>4:
return 'True'
else: return 'True'
elif obj[1]<=0:
return 'False'
else: return 'False'
elif obj[7]<=0:
# {"feature": "Coupon_validity", "instances": 10, "metric_value": 0.8813, "depth": 7}
if obj[3]>0:
# {"feature": "Distance", "instances": 6, "metric_value": 1.0, "depth": 8}
if obj[14]<=1:
return 'True'
elif obj[14]>1:
return 'False'
else: return 'False'
elif obj[3]<=0:
return 'True'
else: return 'True'
else: return 'True'
elif obj[11]>2.0:
return 'False'
else: return 'False'
elif obj[8]>14:
return 'False'
else: return 'False'
elif obj[2]<=0:
return 'False'
else: return 'False'
elif obj[10]>1.0:
# {"feature": "Age", "instances": 30, "metric_value": 0.9871, "depth": 3}
if obj[5]>0:
# {"feature": "Income", "instances": 27, "metric_value": 0.951, "depth": 4}
if obj[9]<=4:
# {"feature": "Occupation", "instances": 21, "metric_value": 0.9984, "depth": 5}
if obj[8]>1:
# {"feature": "Restaurant20to50", "instances": 18, "metric_value": 0.9911, "depth": 6}
if obj[12]>0.0:
# {"feature": "Distance", "instances": 16, "metric_value": 1.0, "depth": 7}
if obj[14]<=2:
# {"feature": "Time", "instances": 14, "metric_value": 0.9852, "depth": 8}
if obj[1]>0:
# {"feature": "Education", "instances": 10, "metric_value": 0.8813, "depth": 9}
if obj[7]<=3:
# {"feature": "Children", "instances": 9, "metric_value": 0.7642, "depth": 10}
if obj[6]<=0:
# {"feature": "Gender", "instances": 7, "metric_value": 0.8631, "depth": 11}
if obj[4]<=0:
# {"feature": "Coupon_validity", "instances": 6, "metric_value": 0.65, "depth": 12}
if obj[3]<=0:
return 'True'
elif obj[3]>0:
# {"feature": "Coffeehouse", "instances": 2, "metric_value": 1.0, "depth": 13}
if obj[11]>2.0:
return 'False'
elif obj[11]<=2.0:
return 'True'
else: return 'True'
else: return 'False'
elif obj[4]>0:
return 'False'
else: return 'False'
elif obj[6]>0:
return 'True'
else: return 'True'
elif obj[7]>3:
return 'False'
else: return 'False'
elif obj[1]<=0:
# {"feature": "Coupon", "instances": 4, "metric_value": 0.8113, "depth": 9}
if obj[2]>3:
return 'False'
elif obj[2]<=3:
return 'True'
else: return 'True'
else: return 'False'
elif obj[14]>2:
return 'False'
else: return 'False'
elif obj[12]<=0.0:
return 'False'
else: return 'False'
elif obj[8]<=1:
return 'True'
else: return 'True'
elif obj[9]>4:
return 'True'
else: return 'True'
elif obj[5]<=0:
return 'False'
else: return 'False'
else: return 'True'
elif obj[0]>1:
# {"feature": "Coupon", "instances": 52, "metric_value": 0.8667, "depth": 2}
if obj[2]>1:
# {"feature": "Coupon_validity", "instances": 38, "metric_value": 0.6892, "depth": 3}
if obj[3]<=0:
# {"feature": "Income", "instances": 20, "metric_value": 0.2864, "depth": 4}
if obj[9]>1:
return 'True'
elif obj[9]<=1:
# {"feature": "Age", "instances": 4, "metric_value": 0.8113, "depth": 5}
if obj[5]<=3:
return 'True'
elif obj[5]>3:
return 'False'
else: return 'False'
else: return 'True'
elif obj[3]>0:
# {"feature": "Age", "instances": 18, "metric_value": 0.9183, "depth": 4}
if obj[5]<=4:
# {"feature": "Occupation", "instances": 12, "metric_value": 1.0, "depth": 5}
if obj[8]<=7:
# {"feature": "Income", "instances": 7, "metric_value": 0.8631, "depth": 6}
if obj[9]<=5:
# {"feature": "Coffeehouse", "instances": 6, "metric_value": 0.65, "depth": 7}
if obj[11]<=2.0:
return 'False'
elif obj[11]>2.0:
# {"feature": "Time", "instances": 2, "metric_value": 1.0, "depth": 8}
if obj[1]>2:
return 'False'
elif obj[1]<=2:
return 'True'
else: return 'True'
else: return 'False'
elif obj[9]>5:
return 'True'
else: return 'True'
elif obj[8]>7:
# {"feature": "Coffeehouse", "instances": 5, "metric_value": 0.7219, "depth": 6}
if obj[11]>0.0:
return 'True'
elif obj[11]<=0.0:
return 'False'
else: return 'False'
else: return 'True'
elif obj[5]>4:
return 'True'
else: return 'True'
else: return 'True'
elif obj[2]<=1:
# {"feature": "Bar", "instances": 14, "metric_value": 0.9852, "depth": 3}
if obj[10]>0.0:
# {"feature": "Age", "instances": 9, "metric_value": 0.9183, "depth": 4}
if obj[5]>3:
return 'True'
elif obj[5]<=3:
# {"feature": "Income", "instances": 4, "metric_value": 0.8113, "depth": 5}
if obj[9]>2:
return 'False'
elif obj[9]<=2:
return 'True'
else: return 'True'
else: return 'False'
elif obj[10]<=0.0:
return 'False'
else: return 'False'
else: return 'False'
else: return 'True'
| def find_decision(obj):
if obj[0] <= 1:
if obj[10] <= 1.0:
if obj[2] > 0:
if obj[8] <= 14:
if obj[11] <= 2.0:
if obj[7] > 0:
if obj[1] > 0:
if obj[5] <= 4:
if obj[12] > 0.0:
if obj[9] > 0:
if obj[13] <= 0:
if obj[3] <= 0:
if obj[14] > 1:
if obj[4] > 0:
if obj[6] <= 0:
return 'True'
elif obj[6] > 0:
return 'False'
else:
return 'False'
elif obj[4] <= 0:
return 'True'
else:
return 'True'
elif obj[14] <= 1:
return 'False'
else:
return 'False'
elif obj[3] > 0:
return 'True'
else:
return 'True'
elif obj[13] > 0:
return 'False'
else:
return 'False'
elif obj[9] <= 0:
return 'True'
else:
return 'True'
elif obj[12] <= 0.0:
return 'False'
else:
return 'False'
elif obj[5] > 4:
return 'True'
else:
return 'True'
elif obj[1] <= 0:
return 'False'
else:
return 'False'
elif obj[7] <= 0:
if obj[3] > 0:
if obj[14] <= 1:
return 'True'
elif obj[14] > 1:
return 'False'
else:
return 'False'
elif obj[3] <= 0:
return 'True'
else:
return 'True'
else:
return 'True'
elif obj[11] > 2.0:
return 'False'
else:
return 'False'
elif obj[8] > 14:
return 'False'
else:
return 'False'
elif obj[2] <= 0:
return 'False'
else:
return 'False'
elif obj[10] > 1.0:
if obj[5] > 0:
if obj[9] <= 4:
if obj[8] > 1:
if obj[12] > 0.0:
if obj[14] <= 2:
if obj[1] > 0:
if obj[7] <= 3:
if obj[6] <= 0:
if obj[4] <= 0:
if obj[3] <= 0:
return 'True'
elif obj[3] > 0:
if obj[11] > 2.0:
return 'False'
elif obj[11] <= 2.0:
return 'True'
else:
return 'True'
else:
return 'False'
elif obj[4] > 0:
return 'False'
else:
return 'False'
elif obj[6] > 0:
return 'True'
else:
return 'True'
elif obj[7] > 3:
return 'False'
else:
return 'False'
elif obj[1] <= 0:
if obj[2] > 3:
return 'False'
elif obj[2] <= 3:
return 'True'
else:
return 'True'
else:
return 'False'
elif obj[14] > 2:
return 'False'
else:
return 'False'
elif obj[12] <= 0.0:
return 'False'
else:
return 'False'
elif obj[8] <= 1:
return 'True'
else:
return 'True'
elif obj[9] > 4:
return 'True'
else:
return 'True'
elif obj[5] <= 0:
return 'False'
else:
return 'False'
else:
return 'True'
elif obj[0] > 1:
if obj[2] > 1:
if obj[3] <= 0:
if obj[9] > 1:
return 'True'
elif obj[9] <= 1:
if obj[5] <= 3:
return 'True'
elif obj[5] > 3:
return 'False'
else:
return 'False'
else:
return 'True'
elif obj[3] > 0:
if obj[5] <= 4:
if obj[8] <= 7:
if obj[9] <= 5:
if obj[11] <= 2.0:
return 'False'
elif obj[11] > 2.0:
if obj[1] > 2:
return 'False'
elif obj[1] <= 2:
return 'True'
else:
return 'True'
else:
return 'False'
elif obj[9] > 5:
return 'True'
else:
return 'True'
elif obj[8] > 7:
if obj[11] > 0.0:
return 'True'
elif obj[11] <= 0.0:
return 'False'
else:
return 'False'
else:
return 'True'
elif obj[5] > 4:
return 'True'
else:
return 'True'
else:
return 'True'
elif obj[2] <= 1:
if obj[10] > 0.0:
if obj[5] > 3:
return 'True'
elif obj[5] <= 3:
if obj[9] > 2:
return 'False'
elif obj[9] <= 2:
return 'True'
else:
return 'True'
else:
return 'False'
elif obj[10] <= 0.0:
return 'False'
else:
return 'False'
else:
return 'False'
else:
return 'True' |
def fib(x):
if x < 2:
return x
return fib(x - 1) + fib(x-2)
if __name__ == "__main__":
N = int(input())
while N > 0:
x = int(input())
print(fib(x))
N = N - 1
| def fib(x):
if x < 2:
return x
return fib(x - 1) + fib(x - 2)
if __name__ == '__main__':
n = int(input())
while N > 0:
x = int(input())
print(fib(x))
n = N - 1 |
T = int(input())
for _ in range(T):
for i in range(1, 1001):
print(i**2)
a = int(input())
if a==0:
continue
else:
break | t = int(input())
for _ in range(T):
for i in range(1, 1001):
print(i ** 2)
a = int(input())
if a == 0:
continue
else:
break |
class BaseException(object):
'''
The base exception class (equivalent to System.Exception)
'''
def __init__(self):
self.message = None
| class Baseexception(object):
"""
The base exception class (equivalent to System.Exception)
"""
def __init__(self):
self.message = None |
class Name(object):
def __init__(self,
normal: str,
folded: str):
self.normal = normal
self.folded = folded
| class Name(object):
def __init__(self, normal: str, folded: str):
self.normal = normal
self.folded = folded |
n = int(input())
x = list(map(int, input().split()))
m = 0
e = 0
c = 0
for n in x:
m += abs(n)
e += n ** 2
c = max(c, abs(n))
print(m)
print(e ** 0.5)
print(c) | n = int(input())
x = list(map(int, input().split()))
m = 0
e = 0
c = 0
for n in x:
m += abs(n)
e += n ** 2
c = max(c, abs(n))
print(m)
print(e ** 0.5)
print(c) |
#!/usr/bin/env python3
# String to be evaluated
s = "azcbobobegghakl"
# Initialize count
count = 0
# Vowels that will be evaluted inside s
vowels = "aeiou"
# For loop to count vowels in var s
for letter in s:
if letter in vowels:
count += 1
# Prints final count to terminal
print("Number of vowels in " + s + ": " + str(count))
| s = 'azcbobobegghakl'
count = 0
vowels = 'aeiou'
for letter in s:
if letter in vowels:
count += 1
print('Number of vowels in ' + s + ': ' + str(count)) |
def diglet(i_buraco_origem, buracos):
if buracos[i_buraco_origem] == -99:
return 0
else:
i_buraco_destino = buracos[i_buraco_origem] - 1
buracos[i_buraco_origem] = -99
return 1 + diglet(i_buraco_destino, buracos)
def mdc_euclide(a, b):
if b == 0:
return a
else:
return mdc_euclide(b, a % b)
n = int(input())
buracos = list(map(int, input().split()))
caminhos = []
for i in range(0, n):
ciclo = diglet(i, buracos)
if ciclo != 0:
caminhos.append(ciclo)
mmc = caminhos[0]
for j in range(0, len(caminhos) - 1):
mmc = mmc * caminhos[j+1] / mdc_euclide(mmc, caminhos[j+1])
print("%i" % mmc) | def diglet(i_buraco_origem, buracos):
if buracos[i_buraco_origem] == -99:
return 0
else:
i_buraco_destino = buracos[i_buraco_origem] - 1
buracos[i_buraco_origem] = -99
return 1 + diglet(i_buraco_destino, buracos)
def mdc_euclide(a, b):
if b == 0:
return a
else:
return mdc_euclide(b, a % b)
n = int(input())
buracos = list(map(int, input().split()))
caminhos = []
for i in range(0, n):
ciclo = diglet(i, buracos)
if ciclo != 0:
caminhos.append(ciclo)
mmc = caminhos[0]
for j in range(0, len(caminhos) - 1):
mmc = mmc * caminhos[j + 1] / mdc_euclide(mmc, caminhos[j + 1])
print('%i' % mmc) |
x = ['happy','sad','cheerful']
print('{0},{1},{2}'.format(x[0],x[1].x[2]))
##-------------------------------------------##
a = "{x}, {y}".format(x=5, y=12)
print(a)
| x = ['happy', 'sad', 'cheerful']
print('{0},{1},{2}'.format(x[0], x[1].x[2]))
a = '{x}, {y}'.format(x=5, y=12)
print(a) |
class Book:
def __init__(self,title,author):
self.title = title
self.author = author
def __str__(self):
return '{} by {}'.format(self.title,self.author)
class Bookcase():
def __init__(self,books=None):
self.books = books
@classmethod
def create_bookcase(cls,book_list):
books = []
for title, author in book_list:
books.append(Book(title,author))
return cls(books)
| class Book:
def __init__(self, title, author):
self.title = title
self.author = author
def __str__(self):
return '{} by {}'.format(self.title, self.author)
class Bookcase:
def __init__(self, books=None):
self.books = books
@classmethod
def create_bookcase(cls, book_list):
books = []
for (title, author) in book_list:
books.append(book(title, author))
return cls(books) |
# # Copyright (c) 2017 - The MITRE Corporation
# For license information, see the LICENSE.txt file
__version__ = "1.3.0"
| __version__ = '1.3.0' |
class car():
def __init__(self, make, model, year ):
self.make = make
self.model = model
self.year = year
self.odometer = 0
def describe_car(self):
long_name = str(self.year)+' '+self.make+' '+self.model
return long_name.title()
def read_odometer(self):
print('This car has '+str(self.odometer)+' miles on it.')
def update_odometer(self, mileage):
if mileage < self.odometer:
print('You cannot roll back the odometer !')
else:
print('The odometer has updated !')
def increase_odometer(self, increment):
self.odometer += increment | class Car:
def __init__(self, make, model, year):
self.make = make
self.model = model
self.year = year
self.odometer = 0
def describe_car(self):
long_name = str(self.year) + ' ' + self.make + ' ' + self.model
return long_name.title()
def read_odometer(self):
print('This car has ' + str(self.odometer) + ' miles on it.')
def update_odometer(self, mileage):
if mileage < self.odometer:
print('You cannot roll back the odometer !')
else:
print('The odometer has updated !')
def increase_odometer(self, increment):
self.odometer += increment |
expected_output = {
"route-information": {
"route-table": [
{
"active-route-count": "16",
"destination-count": "16",
"hidden-route-count": "0",
"holddown-route-count": "0",
"rt": [
{
"rt-announced-count": "1",
"rt-destination": "10.1.0.0",
"rt-entry": {
"as-path": "AS path: I",
"bgp-path-attributes": {
"attr-as-path-effective": {
"aspath-effective-string": "AS path:",
"attr-value": "I",
}
},
"bgp-rt-flag": "Accepted",
"local-preference": "100",
"nh": {"to": "10.64.4.4"},
},
"rt-entry-count": {"#text": "2"},
"rt-prefix-length": "24",
},
{
"rt-announced-count": "1",
"rt-destination": "10.64.4.4",
"rt-entry": {
"as-path": "AS path: I",
"bgp-path-attributes": {
"attr-as-path-effective": {
"aspath-effective-string": "AS path:",
"attr-value": "I",
}
},
"bgp-rt-flag": "Accepted",
"local-preference": "100",
"nh": {"to": "10.64.4.4"},
},
"rt-entry-count": {"#text": "2"},
"rt-prefix-length": "32",
},
{
"rt-announced-count": "1",
"rt-destination": "10.145.0.0",
"rt-entry": {
"as-path": "AS path: I",
"bgp-path-attributes": {
"attr-as-path-effective": {
"aspath-effective-string": "AS path:",
"attr-value": "I",
}
},
"bgp-rt-flag": "Accepted",
"local-preference": "100",
"nh": {"to": "10.64.4.4"},
},
"rt-entry-count": {"#text": "2"},
"rt-prefix-length": "24",
},
{
"active-tag": "* ",
"rt-announced-count": "1",
"rt-destination": "192.168.220.0",
"rt-entry": {
"as-path": "AS path: I",
"bgp-path-attributes": {
"attr-as-path-effective": {
"aspath-effective-string": "AS path:",
"attr-value": "I",
}
},
"bgp-rt-flag": "Accepted",
"local-preference": "100",
"nh": {"to": "10.64.4.4"},
},
"rt-entry-count": {"#text": "1"},
"rt-prefix-length": "24",
},
{
"active-tag": "* ",
"rt-announced-count": "1",
"rt-destination": "192.168.240.0",
"rt-entry": {
"as-path": "AS path: 200000 4 5 6 I",
"bgp-path-attributes": {
"attr-as-path-effective": {
"aspath-effective-string": "AS path:",
"attr-value": "200000 4 5 6 I",
}
},
"bgp-rt-flag": "Accepted",
"local-preference": "100",
"nh": {"to": "10.64.4.4"},
},
"rt-entry-count": {"#text": "1"},
"rt-prefix-length": "24",
},
{
"active-tag": "* ",
"rt-announced-count": "1",
"rt-destination": "192.168.205.0",
"rt-entry": {
"as-path": "AS path: 200000 4 7 8 I",
"bgp-path-attributes": {
"attr-as-path-effective": {
"aspath-effective-string": "AS path:",
"attr-value": "200000 4 7 8 I",
}
},
"bgp-rt-flag": "Accepted",
"local-preference": "100",
"nh": {"to": "10.64.4.4"},
},
"rt-entry-count": {"#text": "1"},
"rt-prefix-length": "24",
},
{
"active-tag": "* ",
"rt-announced-count": "1",
"rt-destination": "192.168.115.0",
"rt-entry": {
"as-path": "AS path: 200000 4 100000 8 I",
"bgp-path-attributes": {
"attr-as-path-effective": {
"aspath-effective-string": "AS path:",
"attr-value": "200000 4 100000 8 I",
}
},
"bgp-rt-flag": "Accepted",
"local-preference": "100",
"nh": {"to": "10.64.4.4"},
},
"rt-entry-count": {"#text": "1"},
"rt-prefix-length": "24",
},
],
"table-name": "inet.0",
"total-route-count": "19",
},
{
"active-route-count": "18",
"destination-count": "18",
"hidden-route-count": "0",
"holddown-route-count": "0",
"table-name": "inet6.0",
"total-route-count": "20",
},
]
}
}
| expected_output = {'route-information': {'route-table': [{'active-route-count': '16', 'destination-count': '16', 'hidden-route-count': '0', 'holddown-route-count': '0', 'rt': [{'rt-announced-count': '1', 'rt-destination': '10.1.0.0', 'rt-entry': {'as-path': 'AS path: I', 'bgp-path-attributes': {'attr-as-path-effective': {'aspath-effective-string': 'AS path:', 'attr-value': 'I'}}, 'bgp-rt-flag': 'Accepted', 'local-preference': '100', 'nh': {'to': '10.64.4.4'}}, 'rt-entry-count': {'#text': '2'}, 'rt-prefix-length': '24'}, {'rt-announced-count': '1', 'rt-destination': '10.64.4.4', 'rt-entry': {'as-path': 'AS path: I', 'bgp-path-attributes': {'attr-as-path-effective': {'aspath-effective-string': 'AS path:', 'attr-value': 'I'}}, 'bgp-rt-flag': 'Accepted', 'local-preference': '100', 'nh': {'to': '10.64.4.4'}}, 'rt-entry-count': {'#text': '2'}, 'rt-prefix-length': '32'}, {'rt-announced-count': '1', 'rt-destination': '10.145.0.0', 'rt-entry': {'as-path': 'AS path: I', 'bgp-path-attributes': {'attr-as-path-effective': {'aspath-effective-string': 'AS path:', 'attr-value': 'I'}}, 'bgp-rt-flag': 'Accepted', 'local-preference': '100', 'nh': {'to': '10.64.4.4'}}, 'rt-entry-count': {'#text': '2'}, 'rt-prefix-length': '24'}, {'active-tag': '* ', 'rt-announced-count': '1', 'rt-destination': '192.168.220.0', 'rt-entry': {'as-path': 'AS path: I', 'bgp-path-attributes': {'attr-as-path-effective': {'aspath-effective-string': 'AS path:', 'attr-value': 'I'}}, 'bgp-rt-flag': 'Accepted', 'local-preference': '100', 'nh': {'to': '10.64.4.4'}}, 'rt-entry-count': {'#text': '1'}, 'rt-prefix-length': '24'}, {'active-tag': '* ', 'rt-announced-count': '1', 'rt-destination': '192.168.240.0', 'rt-entry': {'as-path': 'AS path: 200000 4 5 6 I', 'bgp-path-attributes': {'attr-as-path-effective': {'aspath-effective-string': 'AS path:', 'attr-value': '200000 4 5 6 I'}}, 'bgp-rt-flag': 'Accepted', 'local-preference': '100', 'nh': {'to': '10.64.4.4'}}, 'rt-entry-count': {'#text': '1'}, 'rt-prefix-length': '24'}, {'active-tag': '* ', 'rt-announced-count': '1', 'rt-destination': '192.168.205.0', 'rt-entry': {'as-path': 'AS path: 200000 4 7 8 I', 'bgp-path-attributes': {'attr-as-path-effective': {'aspath-effective-string': 'AS path:', 'attr-value': '200000 4 7 8 I'}}, 'bgp-rt-flag': 'Accepted', 'local-preference': '100', 'nh': {'to': '10.64.4.4'}}, 'rt-entry-count': {'#text': '1'}, 'rt-prefix-length': '24'}, {'active-tag': '* ', 'rt-announced-count': '1', 'rt-destination': '192.168.115.0', 'rt-entry': {'as-path': 'AS path: 200000 4 100000 8 I', 'bgp-path-attributes': {'attr-as-path-effective': {'aspath-effective-string': 'AS path:', 'attr-value': '200000 4 100000 8 I'}}, 'bgp-rt-flag': 'Accepted', 'local-preference': '100', 'nh': {'to': '10.64.4.4'}}, 'rt-entry-count': {'#text': '1'}, 'rt-prefix-length': '24'}], 'table-name': 'inet.0', 'total-route-count': '19'}, {'active-route-count': '18', 'destination-count': '18', 'hidden-route-count': '0', 'holddown-route-count': '0', 'table-name': 'inet6.0', 'total-route-count': '20'}]}} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.