content
stringlengths 7
1.05M
|
---|
'''
Fixed arguments
'''
def print_fib(a, b, c):
print(a, b, c)
print_fib(1, 1, 2)
print_fib(1, 1, 2, 3)
'''
Using *args
'''
def print_fib(a, *args):
print(a)
print(args)
print_fib(1, 1, 2, 3)
print_fib(1)
'''
Using **kwargs
'''
def print_fib(a, **kwargs):
print(a)
print(kwargs)
print_fib(1, se=1, th=2, fo=3, fi=5)
print_fib(1)
'''
Using *args and **kwargs
'''
def print_fib(*args, **kwargs):
print(args)
print(kwargs)
print_fib(1, 1, 2, 3)
print_fib(fi=1, se=1, th=2, fo=3)
print_fib(1, 1, 2, fo=3, fi=5)
print_fib()
|
s, t, n = map(int, input().split())
dList = input().split()
bList = input().split()
cList = input().split()
Time = 0
for i in range(len(dList) - 1):
Time += int(dList[i])
if Time % int(cList[i]) == 0:
wait = abs(Time - int(cList[i])) - int(cList[i])
else:
wait = abs(Time - int(cList[i]))
Time += wait + int(bList[i])
Time += int(dList[-1])
print('yes' if Time <= t else 'no')
|
""" Pipeless / examples.py. MIT licensed.
Basic functionality
>>> from pipeless import pipeline
>>> function, run, _ = pipeline(lambda item, e: None)
>>> @function
... def up_one(_): return _+1
>>> list(run([0, 1, 3]))
[1, 2, 4]
>>> @function
... def twofer(_):
... yield _
... yield _
>>> list(run([0, 1, 3]))
[1, 1, 2, 2, 4, 4]
Pipelines are composable
>>> list(run(run([0])))
[2, 2, 2, 2]
Returning None Drops result
>>> @function
... def none(_): return None
>>> list(run([0]))
[]
Exception handler can replace result
>>> function, run, _ = pipeline(lambda item, e: 100)
>>> @function
... def raises_exception():
... def func(_):
... raise Exception
... return func
>>> list(run([0]))
[100]
Grouping up functions
>>> function, run, _ = pipeline(lambda item, e: None)
>>> @function('my_group')
... def nothing_special(_): return _
>>> list(run([1,2,3]))
[1, 2, 3]
>>> @function('baller_group')
... def triple_double(_):
... return 3*(_**2)
>>> list(run([1,2,3]))
[3, 12, 27]
>>> @function('my_group')
... def zeroed(_): return 0
>>> list(run([1,2,3]))
[0, 0, 0]
>>> list(run([1,2,3], function_groups_to_skip=['my_group']))
[3, 12, 27]
>>> list(run([1,2,3], function_groups_to_skip=['my_group', 'baller_group']))
[1, 2, 3]
Function Builders
>>> function, run, _ = pipeline(lambda item, e: None, use_builders=True)
>>> @function
... def bob_the_builder(): return lambda _: _+1
>>> list(run([1,2,3]))
[2, 3, 4]
"""
|
logic_registry = []
def logic(function):
"""A descriptor to tag a function as programmable logic, contianing migen commands."""
logic_registry.append(function)
return function
def is_logic(function):
"""Returns True if the given function was tagged using the ``@logic`` descriptor."""
return function in logic_registry
|
n = int(input())
string = []
string = input().split(" ")
string.sort()
for i in range (0,n):
print (string[i], end = " ")
|
"""外挂1"""
wg1 = 5
wg2 = 0
while True:
n1 = input("输入您的红包数量:")
if n1 == " " or n1 == "exit":
break
n2=float(n1)
if n2>= 5:
wg2 += 1
if n2 >= 10:
wg1 += 1
print(wg1, wg2)
|
#
# @lc app=leetcode.cn id=227 lang=python3
#
# [227] 基本计算器 II
#
# https://leetcode-cn.com/problems/basic-calculator-ii/description/
#
# algorithms
# Medium (38.94%)
# Likes: 323
# Dislikes: 0
# Total Accepted: 51.2K
# Total Submissions: 121.3K
# Testcase Example: '"3+2*2"'
#
# 给你一个字符串表达式 s ,请你实现一个基本计算器来计算并返回它的值。
#
# 整数除法仅保留整数部分。
#
#
#
#
#
# 示例 1:
#
#
# 输入:s = "3+2*2"
# 输出:7
#
#
# 示例 2:
#
#
# 输入:s = " 3/2 "
# 输出:1
#
#
# 示例 3:
#
#
# 输入:s = " 3+5 / 2 "
# 输出:5
#
#
#
#
# 提示:
#
#
# 1
# s 由整数和算符 ('+', '-', '*', '/') 组成,中间由一些空格隔开
# s 表示一个 有效表达式
# 表达式中的所有整数都是非负整数,且在范围 [0, 2^31 - 1] 内
# 题目数据保证答案是一个 32-bit 整数
#
#
#
#
#
# @lc code=start
class Solution:
def calculate(self, s: str) -> int:
n = len(s)
pre = '+'
num = 0
stack = []
for i in range(n):
if s[i] != ' ' and s[i].isdigit():
num = num * 10 + int(s[i])
if i == n- 1 or s[i] in '+-*/':
if pre == '+':
stack.append(num)
elif pre == '-':
stack.append(-num)
elif pre == '*':
stack.append(stack.pop()*num)
else:
stack.append(int(stack.pop()/num))
pre = s[i]
num = 0
return sum(stack)
# @lc code=end
|
# Calculate an average value
# Calculate an average value iteratively:
# def average(nums):
# result = 0
# for num in nums:
# result += num
# return result/len(nums)
# Could you provide a recursive solution?
# A formula for updating an average value given a new input might be handy:
# @ = ( xi + ((n−1) * @ ) ) / n
# Here, @ stands for an average value,
# xi is a new supplied value which is used to update the average, and
# n corresponds to the recursive call number (excluding the initial call to the function).
# Calculate an average value of the sequence of numbers
def average(nums):
# Base case
if len(nums) == 1:
return nums[0]
# Recursive call
n = len(nums)
return ( nums[0] + (n - 1) * average( nums[1:] ) ) / n
# Testing the function
print(average([1, 2, 3, 4, 5]))
|
class GlobalInfo:
gui_thread = None
main_window = None
daemon_inst = None
daemon_conn = None
headless_plugin_manager = None
|
class MinimumBalanceAccount(BankAccount):
def __init__(self, minimum_balance):
BankAccount.__init__(self)
self.minimum_balance = minimum_balance
def withdraw(self, amount):
if self.balance - amount < self.minimum_balance:
print ('Sorry, minimum balance must be maintained.')
else:
BankAccount.withdraw(self, amount)
|
class Solution:
def divide(self, dividend: int, divisor: int) -> int:
if (dividend == -2147483648 and divisor == -1): return 2147483647
ans = 1
nORp = 1 if (dividend > 0) == (divisor > 0) else -1
a , b = abs(dividend) , abs(divisor)
if a < b : return 0
elif a == b: return ans * nORp
while a > b:
b <<= 1
ans <<= 1
ans >>= 1
b >>= 1
ans += self.divide(a - b, abs(divisor))
return nORp * ans
|
colors = ["red", "yellow", "green", "blue"]
print(type(colors))
print(colors)
numbers = (1,2,3)
print(numbers)
numbers_list = list(numbers)
print(numbers_list)
print(list("Fabio"))
groceries = "eggs, milk, cheese"
grocery_list = groceries.split(", ")
print(grocery_list)
numbers = list(range(1,10))
print(numbers)
print(numbers[1])
print(numbers[1:3])
colors[0] = "burgundy"
print(colors)
colors[1:3] = ["orange", "magenta"]
print(colors)
colors = ["red", "yellow", "green", "blue"]
colors[1:3] = ["orange", "magenta", "aqua"]
print(colors)
colors[1:4] = ["yellow", "green"]
print(colors)
colors.insert(1, "orange")
print(colors)
colors.insert(10, "violet")
print(colors)
colors.insert(-1, "indigo")
print(colors)
color = colors.pop(3)
print(color)
print(colors)
print(colors.pop(-1))
print(colors)
print(colors.pop())
print(colors)
colors.append("indigo")
print(colors)
colors.extend(["violet", "ultraviolet"])
print(colors)
nums = list(range(1,6))
total = 0
for number in nums:
total += number
print(total)
print(sum(nums))
print(min(nums))
print(max(nums))
numbers = tuple(range(1,6))
print(numbers)
squares = [num**2 for num in numbers]
print(squares)
str_numbers = ["1.5", "2.3", "5.25"]
float_numbers = [float(value) for value in str_numbers]
print(float_numbers)
food = ["rice", "beans"]
print(food)
food.append("broccoli")
print(food)
food.extend(["bread", "pizza"])
print(food)
print(food[:2])
print(food[len(food)-1])
breakfast = "eggs, fruit, orange juice".split(", ")
print(breakfast)
print(len(breakfast) == 3)
lengths = [len(fast) for fast in breakfast]
print(lengths)
|
# -*- coding: utf-8 -*-
"""
Stopwords from the nltk package
Bird, Steven, Edward Loper and Ewan Klein (2009).
Natural Language Processing with Python. O'Reilly Media Inc.
List of stopwords useful in text mining, analyzing content of tweets, web
pages, keywords, etc.
Each list is accessible as part of a dictionary `stopwords` which is a normal
Python dictionary.
>>> import advertools as adv
>>> adv.stopwords['english'][:5]
['i', 'me', 'my', 'myself', 'we']
>>> adv.stopwords['german'][:5]
['aber', 'alle', 'allem', 'allen', 'aller']
>>> adv.stopwords.keys()
dict_keys(['arabic', 'azerbaijani', 'danish', 'dutch', 'english', 'finnish', 'french',
'german', 'greek', 'hungarian', 'italian', 'kazakh', 'nepali', 'norwegian', 'portuguese',
'romanian', 'russian', 'spanish', 'swedish', 'turkish'])
"""
stopwords = {
'arabic':
[
'إذ',
'إذا',
'إذما',
'إذن',
'أف',
'أقل',
'أكثر',
'ألا',
'إلا',
'التي',
'الذي',
'الذين',
'اللاتي',
'اللائي',
'اللتان',
'اللتيا',
'اللتين',
'اللذان',
'اللذين',
'اللواتي',
'إلى',
'إليك',
'إليكم',
'إليكما',
'إليكن',
'أم',
'أما',
'أما',
'إما',
'أن',
'إن',
'إنا',
'أنا',
'أنت',
'أنتم',
'أنتما',
'أنتن',
'إنما',
'إنه',
'أنى',
'أنى',
'آه',
'آها',
'أو',
'أولاء',
'أولئك',
'أوه',
'آي',
'أي',
'أيها',
'إي',
'أين',
'أين',
'أينما',
'إيه',
'بخ',
'بس',
'بعد',
'بعض',
'بك',
'بكم',
'بكم',
'بكما',
'بكن',
'بل',
'بلى',
'بما',
'بماذا',
'بمن',
'بنا',
'به',
'بها',
'بهم',
'بهما',
'بهن',
'بي',
'بين',
'بيد',
'تلك',
'تلكم',
'تلكما',
'ته',
'تي',
'تين',
'تينك',
'ثم',
'ثمة',
'حاشا',
'حبذا',
'حتى',
'حيث',
'حيثما',
'حين',
'خلا',
'دون',
'ذا',
'ذات',
'ذاك',
'ذان',
'ذانك',
'ذلك',
'ذلكم',
'ذلكما',
'ذلكن',
'ذه',
'ذو',
'ذوا',
'ذواتا',
'ذواتي',
'ذي',
'ذين',
'ذينك',
'ريث',
'سوف',
'سوى',
'شتان',
'عدا',
'عسى',
'عل',
'على',
'عليك',
'عليه',
'عما',
'عن',
'عند',
'غير',
'فإذا',
'فإن',
'فلا',
'فمن',
'في',
'فيم',
'فيما',
'فيه',
'فيها',
'قد',
'كأن',
'كأنما',
'كأي',
'كأين',
'كذا',
'كذلك',
'كل',
'كلا',
'كلاهما',
'كلتا',
'كلما',
'كليكما',
'كليهما',
'كم',
'كم',
'كما',
'كي',
'كيت',
'كيف',
'كيفما',
'لا',
'لاسيما',
'لدى',
'لست',
'لستم',
'لستما',
'لستن',
'لسن',
'لسنا',
'لعل',
'لك',
'لكم',
'لكما',
'لكن',
'لكنما',
'لكي',
'لكيلا',
'لم',
'لما',
'لن',
'لنا',
'له',
'لها',
'لهم',
'لهما',
'لهن',
'لو',
'لولا',
'لوما',
'لي',
'لئن',
'ليت',
'ليس',
'ليسا',
'ليست',
'ليستا',
'ليسوا',
'ما',
'ماذا',
'متى',
'مذ',
'مع',
'مما',
'ممن',
'من',
'منه',
'منها',
'منذ',
'مه',
'مهما',
'نحن',
'نحو',
'نعم',
'ها',
'هاتان',
'هاته',
'هاتي',
'هاتين',
'هاك',
'هاهنا',
'هذا',
'هذان',
'هذه',
'هذي',
'هذين',
'هكذا',
'هل',
'هلا',
'هم',
'هما',
'هن',
'هنا',
'هناك',
'هنالك',
'هو',
'هؤلاء',
'هي',
'هيا',
'هيت',
'هيهات',
'والذي',
'والذين',
'وإذ',
'وإذا',
'وإن',
'ولا',
'ولكن',
'ولو',
'وما',
'ومن',
'وهو',
'يا'
],
'azerbaijani':
[
'a',
'ad',
'altı',
'altmış',
'amma',
'arasında',
'artıq',
'ay',
'az',
'bax',
'belə',
'bəli',
'bəlkə',
'beş',
'bəy',
'bəzən',
'bəzi',
'bilər',
'bir',
'biraz',
'biri',
'birşey',
'biz',
'bizim',
'bizlər',
'bu',
'buna',
'bundan',
'bunların',
'bunu',
'bunun',
'buradan',
'bütün',
'ci',
'cı',
'çox',
'cu',
'cü',
'çünki',
'da',
'daha',
'də',
'dedi',
'dək',
'dən',
'dəqiqə',
'deyil',
'dir',
'doqquz',
'doqsan',
'dörd',
'düz',
'ə',
'edən',
'edir',
'əgər',
'əlbəttə',
'elə',
'əlli',
'ən',
'əslində',
'et',
'etdi',
'etmə',
'etmək',
'faiz',
'gilə',
'görə',
'ha',
'haqqında',
'harada',
'hə',
'heç',
'həm',
'həmin',
'həmişə',
'hər',
'ı',
'idi',
'iki',
'il',
'ildə',
'ilə',
'ilk',
'in',
'indi',
'isə',
'istifadə',
'iyirmi',
'ki',
'kim',
'kimə',
'kimi',
'lakin',
'lap',
'məhz',
'mən',
'mənə',
'mirşey',
'nə',
'nəhayət',
'niyə',
'o',
'obirisi',
'of',
'olan',
'olar',
'olaraq',
'oldu',
'olduğu',
'olmadı',
'olmaz',
'olmuşdur',
'olsun',
'olur',
'on',
'ona',
'ondan',
'onlar',
'onlardan',
'onların',
'onsuzda',
'onu',
'onun',
'oradan',
'otuz',
'öz',
'özü',
'qarşı',
'qədər',
'qırx',
'saat',
'sadəcə',
'saniyə',
'səhv',
'səkkiz',
'səksən',
'sən',
'sənə',
'sənin',
'siz',
'sizin',
'sizlər',
'sonra',
'təəssüf',
'ü',
'üç',
'üçün',
'var',
'və',
'xan',
'xanım',
'xeyr',
'ya',
'yalnız',
'yaxşı',
'yeddi',
'yenə',
'yəni',
'yetmiş',
'yox',
'yoxdur',
'yoxsa',
'yüz',
'zaman'
],
'danish':
[
'og',
'i',
'jeg',
'det',
'at',
'en',
'den',
'til',
'er',
'som',
'på',
'de',
'med',
'han',
'af',
'for',
'ikke',
'der',
'var',
'mig',
'sig',
'men',
'et',
'har',
'om',
'vi',
'min',
'havde',
'ham',
'hun',
'nu',
'over',
'da',
'fra',
'du',
'ud',
'sin',
'dem',
'os',
'op',
'man',
'hans',
'hvor',
'eller',
'hvad',
'skal',
'selv',
'her',
'alle',
'vil',
'blev',
'kunne',
'ind',
'når',
'være',
'dog',
'noget',
'ville',
'jo',
'deres',
'efter',
'ned',
'skulle',
'denne',
'end',
'dette',
'mit',
'også',
'under',
'have',
'dig',
'anden',
'hende',
'mine',
'alt',
'meget',
'sit',
'sine',
'vor',
'mod',
'disse',
'hvis',
'din',
'nogle',
'hos',
'blive',
'mange',
'ad',
'bliver',
'hendes',
'været',
'thi',
'jer',
'sådan'
],
'dutch':
[
'de',
'en',
'van',
'ik',
'te',
'dat',
'die',
'in',
'een',
'hij',
'het',
'niet',
'zijn',
'is',
'was',
'op',
'aan',
'met',
'als',
'voor',
'had',
'er',
'maar',
'om',
'hem',
'dan',
'zou',
'of',
'wat',
'mijn',
'men',
'dit',
'zo',
'door',
'over',
'ze',
'zich',
'bij',
'ook',
'tot',
'je',
'mij',
'uit',
'der',
'daar',
'haar',
'naar',
'heb',
'hoe',
'heeft',
'hebben',
'deze',
'u',
'want',
'nog',
'zal',
'me',
'zij',
'nu',
'ge',
'geen',
'omdat',
'iets',
'worden',
'toch',
'al',
'waren',
'veel',
'meer',
'doen',
'toen',
'moet',
'ben',
'zonder',
'kan',
'hun',
'dus',
'alles',
'onder',
'ja',
'eens',
'hier',
'wie',
'werd',
'altijd',
'doch',
'wordt',
'wezen',
'kunnen',
'ons',
'zelf',
'tegen',
'na',
'reeds',
'wil',
'kon',
'niets',
'uw',
'iemand',
'geweest',
'andere'
],
'english':
[
'i',
'me',
'my',
'myself',
'we',
'our',
'ours',
'ourselves',
'you',
"you're",
"you've",
"you'll",
"you'd",
'your',
'yours',
'yourself',
'yourselves',
'he',
'him',
'his',
'himself',
'she',
"she's",
'her',
'hers',
'herself',
'it',
"it's",
'its',
'itself',
'they',
'them',
'their',
'theirs',
'themselves',
'what',
'which',
'who',
'whom',
'this',
'that',
"that'll",
'these',
'those',
'am',
'is',
'are',
'was',
'were',
'be',
'been',
'being',
'have',
'has',
'had',
'having',
'do',
'does',
'did',
'doing',
'a',
'an',
'the',
'and',
'but',
'if',
'or',
'because',
'as',
'until',
'while',
'of',
'at',
'by',
'for',
'with',
'about',
'against',
'between',
'into',
'through',
'during',
'before',
'after',
'above',
'below',
'to',
'from',
'up',
'down',
'in',
'out',
'on',
'off',
'over',
'under',
'again',
'further',
'then',
'once',
'here',
'there',
'when',
'where',
'why',
'how',
'all',
'any',
'both',
'each',
'few',
'more',
'most',
'other',
'some',
'such',
'no',
'nor',
'not',
'only',
'own',
'same',
'so',
'than',
'too',
'very',
's',
't',
'can',
'will',
'just',
'don',
"don't",
'should',
"should've",
'now',
'd',
'll',
'm',
'o',
're',
've',
'y',
'ain',
'aren',
"aren't",
'couldn',
"couldn't",
'didn',
"didn't",
'doesn',
"doesn't",
'hadn',
"hadn't",
'hasn',
"hasn't",
'haven',
"haven't",
'isn',
"isn't",
'ma',
'mightn',
"mightn't",
'mustn',
"mustn't",
'needn',
"needn't",
'shan',
"shan't",
'shouldn',
"shouldn't",
'wasn',
"wasn't",
'weren',
"weren't",
'won',
"won't",
'wouldn',
"wouldn't"
],
'finnish':
[
'olla',
'olen',
'olet',
'on',
'olemme',
'olette',
'ovat',
'ole',
'oli',
'olisi',
'olisit',
'olisin',
'olisimme',
'olisitte',
'olisivat',
'olit',
'olin',
'olimme',
'olitte',
'olivat',
'ollut',
'olleet',
'en',
'et',
'ei',
'emme',
'ette',
'eivät',
'minä',
'minun',
'minut',
'minua',
'minussa',
'minusta',
'minuun',
'minulla',
'minulta',
'minulle',
'sinä',
'sinun',
'sinut',
'sinua',
'sinussa',
'sinusta',
'sinuun',
'sinulla',
'sinulta',
'sinulle',
'hän',
'hänen',
'hänet',
'häntä',
'hänessä',
'hänestä',
'häneen',
'hänellä',
'häneltä',
'hänelle',
'me',
'meidän',
'meidät',
'meitä',
'meissä',
'meistä',
'meihin',
'meillä',
'meiltä',
'meille',
'te',
'teidän',
'teidät',
'teitä',
'teissä',
'teistä',
'teihin',
'teillä',
'teiltä',
'teille',
'he',
'heidän',
'heidät',
'heitä',
'heissä',
'heistä',
'heihin',
'heillä',
'heiltä',
'heille',
'tämä',
'tämän',
'tätä',
'tässä',
'tästä',
'tähän',
'tallä',
'tältä',
'tälle',
'tänä',
'täksi',
'tuo',
'tuon',
'tuotä',
'tuossa',
'tuosta',
'tuohon',
'tuolla',
'tuolta',
'tuolle',
'tuona',
'tuoksi',
'se',
'sen',
'sitä',
'siinä',
'siitä',
'siihen',
'sillä',
'siltä',
'sille',
'sinä',
'siksi',
'nämä',
'näiden',
'näitä',
'näissä',
'näistä',
'näihin',
'näillä',
'näiltä',
'näille',
'näinä',
'näiksi',
'nuo',
'noiden',
'noita',
'noissa',
'noista',
'noihin',
'noilla',
'noilta',
'noille',
'noina',
'noiksi',
'ne',
'niiden',
'niitä',
'niissä',
'niistä',
'niihin',
'niillä',
'niiltä',
'niille',
'niinä',
'niiksi',
'kuka',
'kenen',
'kenet',
'ketä',
'kenessä',
'kenestä',
'keneen',
'kenellä',
'keneltä',
'kenelle',
'kenenä',
'keneksi',
'ketkä',
'keiden',
'ketkä',
'keitä',
'keissä',
'keistä',
'keihin',
'keillä',
'keiltä',
'keille',
'keinä',
'keiksi',
'mikä',
'minkä',
'minkä',
'mitä',
'missä',
'mistä',
'mihin',
'millä',
'miltä',
'mille',
'minä',
'miksi',
'mitkä',
'joka',
'jonka',
'jota',
'jossa',
'josta',
'johon',
'jolla',
'jolta',
'jolle',
'jona',
'joksi',
'jotka',
'joiden',
'joita',
'joissa',
'joista',
'joihin',
'joilla',
'joilta',
'joille',
'joina',
'joiksi',
'että',
'ja',
'jos',
'koska',
'kuin',
'mutta',
'niin',
'sekä',
'sillä',
'tai',
'vaan',
'vai',
'vaikka',
'kanssa',
'mukaan',
'noin',
'poikki',
'yli',
'kun',
'niin',
'nyt',
'itse'
],
'french':
[
'au',
'aux',
'avec',
'ce',
'ces',
'dans',
'de',
'des',
'du',
'elle',
'en',
'et',
'eux',
'il',
'je',
'la',
'le',
'leur',
'lui',
'ma',
'mais',
'me',
'même',
'mes',
'moi',
'mon',
'ne',
'nos',
'notre',
'nous',
'on',
'ou',
'par',
'pas',
'pour',
'qu',
'que',
'qui',
'sa',
'se',
'ses',
'son',
'sur',
'ta',
'te',
'tes',
'toi',
'ton',
'tu',
'un',
'une',
'vos',
'votre',
'vous',
'c',
'd',
'j',
'l',
'à',
'm',
'n',
's',
't',
'y',
'été',
'étée',
'étées',
'étés',
'étant',
'étante',
'étants',
'étantes',
'suis',
'es',
'est',
'sommes',
'êtes',
'sont',
'serai',
'seras',
'sera',
'serons',
'serez',
'seront',
'serais',
'serait',
'serions',
'seriez',
'seraient',
'étais',
'était',
'étions',
'étiez',
'étaient',
'fus',
'fut',
'fûmes',
'fûtes',
'furent',
'sois',
'soit',
'soyons',
'soyez',
'soient',
'fusse',
'fusses',
'fût',
'fussions',
'fussiez',
'fussent',
'ayant',
'ayante',
'ayantes',
'ayants',
'eu',
'eue',
'eues',
'eus',
'ai',
'as',
'avons',
'avez',
'ont',
'aurai',
'auras',
'aura',
'aurons',
'aurez',
'auront',
'aurais',
'aurait',
'aurions',
'auriez',
'auraient',
'avais',
'avait',
'avions',
'aviez',
'avaient',
'eut',
'eûmes',
'eûtes',
'eurent',
'aie',
'aies',
'ait',
'ayons',
'ayez',
'aient',
'eusse',
'eusses',
'eût',
'eussions',
'eussiez',
'eussent'
],
'german':
[
'aber',
'alle',
'allem',
'allen',
'aller',
'alles',
'als',
'also',
'am',
'an',
'ander',
'andere',
'anderem',
'anderen',
'anderer',
'anderes',
'anderm',
'andern',
'anderr',
'anders',
'auch',
'auf',
'aus',
'bei',
'bin',
'bis',
'bist',
'da',
'damit',
'dann',
'der',
'den',
'des',
'dem',
'die',
'das',
'daß',
'derselbe',
'derselben',
'denselben',
'desselben',
'demselben',
'dieselbe',
'dieselben',
'dasselbe',
'dazu',
'dein',
'deine',
'deinem',
'deinen',
'deiner',
'deines',
'denn',
'derer',
'dessen',
'dich',
'dir',
'du',
'dies',
'diese',
'diesem',
'diesen',
'dieser',
'dieses',
'doch',
'dort',
'durch',
'ein',
'eine',
'einem',
'einen',
'einer',
'eines',
'einig',
'einige',
'einigem',
'einigen',
'einiger',
'einiges',
'einmal',
'er',
'ihn',
'ihm',
'es',
'etwas',
'euer',
'eure',
'eurem',
'euren',
'eurer',
'eures',
'für',
'gegen',
'gewesen',
'hab',
'habe',
'haben',
'hat',
'hatte',
'hatten',
'hier',
'hin',
'hinter',
'ich',
'mich',
'mir',
'ihr',
'ihre',
'ihrem',
'ihren',
'ihrer',
'ihres',
'euch',
'im',
'in',
'indem',
'ins',
'ist',
'jede',
'jedem',
'jeden',
'jeder',
'jedes',
'jene',
'jenem',
'jenen',
'jener',
'jenes',
'jetzt',
'kann',
'kein',
'keine',
'keinem',
'keinen',
'keiner',
'keines',
'können',
'könnte',
'machen',
'man',
'manche',
'manchem',
'manchen',
'mancher',
'manches',
'mein',
'meine',
'meinem',
'meinen',
'meiner',
'meines',
'mit',
'muss',
'musste',
'nach',
'nicht',
'nichts',
'noch',
'nun',
'nur',
'ob',
'oder',
'ohne',
'sehr',
'sein',
'seine',
'seinem',
'seinen',
'seiner',
'seines',
'selbst',
'sich',
'sie',
'ihnen',
'sind',
'so',
'solche',
'solchem',
'solchen',
'solcher',
'solches',
'soll',
'sollte',
'sondern',
'sonst',
'über',
'um',
'und',
'uns',
'unsere',
'unserem',
'unseren',
'unser',
'unseres',
'unter',
'viel',
'vom',
'von',
'vor',
'während',
'war',
'waren',
'warst',
'was',
'weg',
'weil',
'weiter',
'welche',
'welchem',
'welchen',
'welcher',
'welches',
'wenn',
'werde',
'werden',
'wie',
'wieder',
'will',
'wir',
'wird',
'wirst',
'wo',
'wollen',
'wollte',
'würde',
'würden',
'zu',
'zum',
'zur',
'zwar',
'zwischen'
],
'greek':
[
'αλλα',
'αν',
'αντι',
'απο',
'αυτα',
'αυτεσ',
'αυτη',
'αυτο',
'αυτοι',
'αυτοσ',
'αυτουσ',
'αυτων',
'αἱ',
'αἳ',
'αἵ',
'αὐτόσ',
'αὐτὸς',
'αὖ',
'γάρ',
'γα',
'γα^',
'γε',
'για',
'γοῦν',
'γὰρ',
"δ'",
'δέ',
'δή',
'δαί',
'δαίσ',
'δαὶ',
'δαὶς',
'δε',
'δεν',
"δι'",
'διά',
'διὰ',
'δὲ',
'δὴ',
'δ’',
'εαν',
'ειμαι',
'ειμαστε',
'ειναι',
'εισαι',
'ειστε',
'εκεινα',
'εκεινεσ',
'εκεινη',
'εκεινο',
'εκεινοι',
'εκεινοσ',
'εκεινουσ',
'εκεινων',
'ενω',
'επ',
'επι',
'εἰ',
'εἰμί',
'εἰμὶ',
'εἰς',
'εἰσ',
'εἴ',
'εἴμι',
'εἴτε',
'η',
'θα',
'ισωσ',
'κ',
'καί',
'καίτοι',
'καθ',
'και',
'κατ',
'κατά',
'κατα',
'κατὰ',
'καὶ',
'κι',
'κἀν',
'κἂν',
'μέν',
'μή',
'μήτε',
'μα',
'με',
'μεθ',
'μετ',
'μετά',
'μετα',
'μετὰ',
'μη',
'μην',
'μἐν',
'μὲν',
'μὴ',
'μὴν',
'να',
'ο',
'οι',
'ομωσ',
'οπωσ',
'οσο',
'οτι',
'οἱ',
'οἳ',
'οἷς',
'οὐ',
'οὐδ',
'οὐδέ',
'οὐδείσ',
'οὐδεὶς',
'οὐδὲ',
'οὐδὲν',
'οὐκ',
'οὐχ',
'οὐχὶ',
'οὓς',
'οὔτε',
'οὕτω',
'οὕτως',
'οὕτωσ',
'οὖν',
'οὗ',
'οὗτος',
'οὗτοσ',
'παρ',
'παρά',
'παρα',
'παρὰ',
'περί',
'περὶ',
'ποια',
'ποιεσ',
'ποιο',
'ποιοι',
'ποιοσ',
'ποιουσ',
'ποιων',
'ποτε',
'που',
'ποῦ',
'προ',
'προσ',
'πρόσ',
'πρὸ',
'πρὸς',
'πως',
'πωσ',
'σε',
'στη',
'στην',
'στο',
'στον',
'σόσ',
'σύ',
'σύν',
'σὸς',
'σὺ',
'σὺν',
'τά',
'τήν',
'τί',
'τίς',
'τίσ',
'τα',
'ταῖς',
'τε',
'την',
'τησ',
'τι',
'τινα',
'τις',
'τισ',
'το',
'τοί',
'τοι',
'τοιοῦτος',
'τοιοῦτοσ',
'τον',
'τοτε',
'του',
'τούσ',
'τοὺς',
'τοῖς',
'τοῦ',
'των',
'τό',
'τόν',
'τότε',
'τὰ',
'τὰς',
'τὴν',
'τὸ',
'τὸν',
'τῆς',
'τῆσ',
'τῇ',
'τῶν',
'τῷ',
'ωσ',
"ἀλλ'",
'ἀλλά',
'ἀλλὰ',
'ἀλλ’',
'ἀπ',
'ἀπό',
'ἀπὸ',
'ἀφ',
'ἂν',
'ἃ',
'ἄλλος',
'ἄλλοσ',
'ἄν',
'ἄρα',
'ἅμα',
'ἐάν',
'ἐγώ',
'ἐγὼ',
'ἐκ',
'ἐμόσ',
'ἐμὸς',
'ἐν',
'ἐξ',
'ἐπί',
'ἐπεὶ',
'ἐπὶ',
'ἐστι',
'ἐφ',
'ἐὰν',
'ἑαυτοῦ',
'ἔτι',
'ἡ',
'ἢ',
'ἣ',
'ἤ',
'ἥ',
'ἧς',
'ἵνα',
'ὁ',
'ὃ',
'ὃν',
'ὃς',
'ὅ',
'ὅδε',
'ὅθεν',
'ὅπερ',
'ὅς',
'ὅσ',
'ὅστις',
'ὅστισ',
'ὅτε',
'ὅτι',
'ὑμόσ',
'ὑπ',
'ὑπέρ',
'ὑπό',
'ὑπὲρ',
'ὑπὸ',
'ὡς',
'ὡσ',
'ὥς',
'ὥστε',
'ὦ',
'ᾧ'
],
'hungarian':
[
'a',
'ahogy',
'ahol',
'aki',
'akik',
'akkor',
'alatt',
'által',
'általában',
'amely',
'amelyek',
'amelyekben',
'amelyeket',
'amelyet',
'amelynek',
'ami',
'amit',
'amolyan',
'amíg',
'amikor',
'át',
'abban',
'ahhoz',
'annak',
'arra',
'arról',
'az',
'azok',
'azon',
'azt',
'azzal',
'azért',
'aztán',
'azután',
'azonban',
'bár',
'be',
'belül',
'benne',
'cikk',
'cikkek',
'cikkeket',
'csak',
'de',
'e',
'eddig',
'egész',
'egy',
'egyes',
'egyetlen',
'egyéb',
'egyik',
'egyre',
'ekkor',
'el',
'elég',
'ellen',
'elõ',
'elõször',
'elõtt',
'elsõ',
'én',
'éppen',
'ebben',
'ehhez',
'emilyen',
'ennek',
'erre',
'ez',
'ezt',
'ezek',
'ezen',
'ezzel',
'ezért',
'és',
'fel',
'felé',
'hanem',
'hiszen',
'hogy',
'hogyan',
'igen',
'így',
'illetve',
'ill.',
'ill',
'ilyen',
'ilyenkor',
'ison',
'ismét',
'itt',
'jó',
'jól',
'jobban',
'kell',
'kellett',
'keresztül',
'keressünk',
'ki',
'kívül',
'között',
'közül',
'legalább',
'lehet',
'lehetett',
'legyen',
'lenne',
'lenni',
'lesz',
'lett',
'maga',
'magát',
'majd',
'majd',
'már',
'más',
'másik',
'meg',
'még',
'mellett',
'mert',
'mely',
'melyek',
'mi',
'mit',
'míg',
'miért',
'milyen',
'mikor',
'minden',
'mindent',
'mindenki',
'mindig',
'mint',
'mintha',
'mivel',
'most',
'nagy',
'nagyobb',
'nagyon',
'ne',
'néha',
'nekem',
'neki',
'nem',
'néhány',
'nélkül',
'nincs',
'olyan',
'ott',
'össze',
'õ',
'õk',
'õket',
'pedig',
'persze',
'rá',
's',
'saját',
'sem',
'semmi',
'sok',
'sokat',
'sokkal',
'számára',
'szemben',
'szerint',
'szinte',
'talán',
'tehát',
'teljes',
'tovább',
'továbbá',
'több',
'úgy',
'ugyanis',
'új',
'újabb',
'újra',
'után',
'utána',
'utolsó',
'vagy',
'vagyis',
'valaki',
'valami',
'valamint',
'való',
'vagyok',
'van',
'vannak',
'volt',
'voltam',
'voltak',
'voltunk',
'vissza',
'vele',
'viszont',
'volna'
],
'italian':
[
'ad',
'al',
'allo',
'ai',
'agli',
'all',
'agl',
'alla',
'alle',
'con',
'col',
'coi',
'da',
'dal',
'dallo',
'dai',
'dagli',
'dall',
'dagl',
'dalla',
'dalle',
'di',
'del',
'dello',
'dei',
'degli',
'dell',
'degl',
'della',
'delle',
'in',
'nel',
'nello',
'nei',
'negli',
'nell',
'negl',
'nella',
'nelle',
'su',
'sul',
'sullo',
'sui',
'sugli',
'sull',
'sugl',
'sulla',
'sulle',
'per',
'tra',
'contro',
'io',
'tu',
'lui',
'lei',
'noi',
'voi',
'loro',
'mio',
'mia',
'miei',
'mie',
'tuo',
'tua',
'tuoi',
'tue',
'suo',
'sua',
'suoi',
'sue',
'nostro',
'nostra',
'nostri',
'nostre',
'vostro',
'vostra',
'vostri',
'vostre',
'mi',
'ti',
'ci',
'vi',
'lo',
'la',
'li',
'le',
'gli',
'ne',
'il',
'un',
'uno',
'una',
'ma',
'ed',
'se',
'perché',
'anche',
'come',
'dov',
'dove',
'che',
'chi',
'cui',
'non',
'più',
'quale',
'quanto',
'quanti',
'quanta',
'quante',
'quello',
'quelli',
'quella',
'quelle',
'questo',
'questi',
'questa',
'queste',
'si',
'tutto',
'tutti',
'a',
'c',
'e',
'i',
'l',
'o',
'ho',
'hai',
'ha',
'abbiamo',
'avete',
'hanno',
'abbia',
'abbiate',
'abbiano',
'avrò',
'avrai',
'avrà',
'avremo',
'avrete',
'avranno',
'avrei',
'avresti',
'avrebbe',
'avremmo',
'avreste',
'avrebbero',
'avevo',
'avevi',
'aveva',
'avevamo',
'avevate',
'avevano',
'ebbi',
'avesti',
'ebbe',
'avemmo',
'aveste',
'ebbero',
'avessi',
'avesse',
'avessimo',
'avessero',
'avendo',
'avuto',
'avuta',
'avuti',
'avute',
'sono',
'sei',
'è',
'siamo',
'siete',
'sia',
'siate',
'siano',
'sarò',
'sarai',
'sarà',
'saremo',
'sarete',
'saranno',
'sarei',
'saresti',
'sarebbe',
'saremmo',
'sareste',
'sarebbero',
'ero',
'eri',
'era',
'eravamo',
'eravate',
'erano',
'fui',
'fosti',
'fu',
'fummo',
'foste',
'furono',
'fossi',
'fosse',
'fossimo',
'fossero',
'essendo',
'faccio',
'fai',
'facciamo',
'fanno',
'faccia',
'facciate',
'facciano',
'farò',
'farai',
'farà',
'faremo',
'farete',
'faranno',
'farei',
'faresti',
'farebbe',
'faremmo',
'fareste',
'farebbero',
'facevo',
'facevi',
'faceva',
'facevamo',
'facevate',
'facevano',
'feci',
'facesti',
'fece',
'facemmo',
'faceste',
'fecero',
'facessi',
'facesse',
'facessimo',
'facessero',
'facendo',
'sto',
'stai',
'sta',
'stiamo',
'stanno',
'stia',
'stiate',
'stiano',
'starò',
'starai',
'starà',
'staremo',
'starete',
'staranno',
'starei',
'staresti',
'starebbe',
'staremmo',
'stareste',
'starebbero',
'stavo',
'stavi',
'stava',
'stavamo',
'stavate',
'stavano',
'stetti',
'stesti',
'stette',
'stemmo',
'steste',
'stettero',
'stessi',
'stesse',
'stessimo',
'stessero',
'stando'
],
'kazakh':
[
'ах',
'ох',
'эх',
'ай',
'эй',
'ой',
'тағы',
'тағыда',
'әрине',
'жоқ',
'сондай',
'осындай',
'осылай',
'солай',
'мұндай',
'бұндай',
'мен',
'сен',
'ол',
'біз',
'біздер',
'олар',
'сіз',
'сіздер',
'маған',
'оған',
'саған',
'біздің',
'сіздің',
'оның',
'бізге',
'сізге',
'оларға',
'біздерге',
'сіздерге',
'оларға',
'менімен',
'сенімен',
'онымен',
'бізбен',
'сізбен',
'олармен',
'біздермен',
'сіздермен',
'менің',
'сенің',
'біздің',
'сіздің',
'оның',
'біздердің',
'сіздердің',
'олардың',
'маған',
'саған',
'оған',
'менен',
'сенен',
'одан',
'бізден',
'сізден',
'олардан',
'біздерден',
'сіздерден',
'олардан',
'айтпақшы',
'сонымен',
'сондықтан',
'бұл',
'осы',
'сол',
'анау',
'мынау',
'сонау',
'осынау',
'ана',
'мына',
'сона',
'әні',
'міне',
'өй',
'үйт',
'бүйт',
'біреу',
'кейбіреу',
'кейбір',
'қайсыбір',
'әрбір',
'бірнеше',
'бірдеме',
'бірнеше',
'әркім',
'әрне',
'әрқайсы',
'әрқалай',
'әлдекім',
'әлдене',
'әлдеқайдан',
'әлденеше',
'әлдеқалай',
'әлдеқашан',
'алдақашан',
'еш',
'ешкім',
'ешбір',
'ештеме',
'дәнеңе',
'ешқашан',
'ешқандай',
'ешқайсы',
'емес',
'бәрі',
'барлық',
'барша',
'бар',
'күллі',
'бүкіл',
'түгел',
'өз',
'өзім',
'өзің',
'өзінің',
'өзіме',
'өзіне',
'өзімнің',
'өзі',
'өзге',
'менде',
'сенде',
'онда',
'менен',
'сенен\tонан',
'одан',
'ау',
'па',
'ей',
'әй',
'е',
'уа',
'уау',
'уай',
'я',
'пай',
'ә',
'о',
'оһо',
'ой',
'ие',
'аһа',
'ау',
'беу',
'мәссаған',
'бәрекелді',
'әттегенай',
'жаракімалла',
'масқарай',
'астапыралла',
'япырмай',
'ойпырмай',
'кәне',
'кәнеки',
'ал',
'әйда',
'кәні',
'міне',
'әні',
'сорап',
'қош-қош',
'пфша',
'пішә',
'құрау-құрау',
'шәйт',
'шек',
'моһ',
'тәк',
'құрау',
'құр',
'кә',
'кәһ',
'күшім',
'күшім',
'мышы',
'пырс',
'әукім',
'алақай',
'паһ-паһ',
'бәрекелді',
'ура',
'әттең',
'әттеген-ай',
'қап',
'түге',
'пішту',
'шіркін',
'алатау',
'пай-пай',
'үшін',
'сайын',
'сияқты',
'туралы',
'арқылы',
'бойы',
'бойымен',
'шамалы',
'шақты',
'қаралы',
'ғұрлы',
'ғұрлым',
'шейін',
'дейін',
'қарай',
'таман',
'салым',
'тарта',
'жуық',
'таяу',
'гөрі',
'бері',
'кейін',
'соң',
'бұрын',
'бетер',
'қатар',
'бірге',
'қоса',
'арс',
'гүрс',
'дүрс',
'қорс',
'тарс',
'тырс',
'ырс',
'барқ',
'борт',
'күрт',
'кірт',
'морт',
'сарт',
'шырт',
'дүңк',
'күңк',
'қыңқ',
'мыңқ',
'маңқ',
'саңқ',
'шаңқ',
'шіңк',
'сыңқ',
'таңқ',
'тыңқ',
'ыңқ',
'болп',
'былп',
'жалп',
'желп',
'қолп',
'ірк',
'ырқ',
'сарт-сұрт',
'тарс-тұрс',
'арс-ұрс',
'жалт-жалт',
'жалт-жұлт',
'қалт-қалт',
'қалт-құлт',
'қаңқ-қаңқ',
'қаңқ-құңқ',
'шаңқ-шаңқ',
'шаңқ-шұңқ',
'арбаң-арбаң',
'бүгжең-бүгжең',
'арсалаң-арсалаң',
'ербелең-ербелең',
'батыр-бұтыр',
'далаң-далаң',
'тарбаң-тарбаң',
'қызараң-қызараң',
'қаңғыр-күңгір',
'қайқаң-құйқаң',
'митың-митың',
'салаң-сұлаң',
'ыржың-тыржың',
'бірақ',
'алайда',
'дегенмен',
'әйтпесе',
'әйткенмен',
'себебі',
'өйткені',
'сондықтан',
'үшін',
'сайын',
'сияқты',
'туралы',
'арқылы',
'бойы',
'бойымен',
'шамалы',
'шақты',
'қаралы',
'ғұрлы',
'ғұрлым',
'гөрі',
'бері',
'кейін',
'соң',
'бұрын',
'бетер',
'қатар',
'бірге',
'қоса',
'шейін',
'дейін',
'қарай',
'таман',
'салым',
'тарта',
'жуық',
'таяу',
'арнайы',
'осындай',
'ғана',
'қана',
'тек',
'әншейін'
],
'nepali':
[
'छ',
'र',
'पनि',
'छन्',
'लागि',
'भएको',
'गरेको',
'भने',
'गर्न',
'गर्ने',
'हो',
'तथा',
'यो',
'रहेको',
'उनले',
'थियो',
'हुने',
'गरेका',
'थिए',
'गर्दै',
'तर',
'नै',
'को',
'मा',
'हुन्',
'भन्ने',
'हुन',
'गरी',
'त',
'हुन्छ',
'अब',
'के',
'रहेका',
'गरेर',
'छैन',
'दिए',
'भए',
'यस',
'ले',
'गर्नु',
'औं',
'सो',
'त्यो',
'कि',
'जुन',
'यी',
'का',
'गरि',
'ती',
'न',
'छु',
'छौं',
'लाई',
'नि',
'उप',
'अक्सर',
'आदि',
'कसरी',
'क्रमशः',
'चाले',
'अगाडी',
'अझै',
'अनुसार',
'अन्तर्गत',
'अन्य',
'अन्यत्र',
'अन्यथा',
'अरु',
'अरुलाई',
'अर्को',
'अर्थात',
'अर्थात्',
'अलग',
'आए',
'आजको',
'ओठ',
'आत्म',
'आफू',
'आफूलाई',
'आफ्नै',
'आफ्नो',
'आयो',
'उदाहरण',
'उनको',
'उहालाई',
'एउटै',
'एक',
'एकदम',
'कतै',
'कम से कम',
'कसै',
'कसैले',
'कहाँबाट',
'कहिलेकाहीं',
'का',
'किन',
'किनभने',
'कुनै',
'कुरा',
'कृपया',
'केही',
'कोही',
'गए',
'गरौं',
'गर्छ',
'गर्छु',
'गर्नुपर्छ',
'गयौ',
'गैर',
'चार',
'चाहनुहुन्छ',
'चाहन्छु',
'चाहिए',
'छू',
'जताततै',
'जब',
'जबकि',
'जसको',
'जसबाट',
'जसमा',
'जसलाई',
'जसले',
'जस्तै',
'जस्तो',
'जस्तोसुकै',
'जहाँ',
'जान',
'जाहिर',
'जे',
'जो',
'ठीक',
'तत्काल',
'तदनुसार',
'तपाईको',
'तपाई',
'पर्याप्त',
'पहिले',
'पहिलो',
'पहिल्यै',
'पाँच',
'पाँचौं',
'तल',
'तापनी',
'तिनी',
'तिनीहरू',
'तिनीहरुको',
'तिनिहरुलाई',
'तिमी',
'तिर',
'तीन',
'तुरुन्तै',
'तेस्रो',
'तेस्कारण',
'पूर्व',
'प्रति',
'प्रतेक',
'प्लस',
'फेरी',
'बने',
'त्सपछि',
'त्सैले',
'त्यहाँ',
'थिएन',
'दिनुभएको',
'दिनुहुन्छ',
'दुई',
'देखि',
'बरु',
'बारे',
'बाहिर',
'देखिन्छ',
'देखियो',
'देखे',
'देखेको',
'देखेर',
'दोस्रो',
'धेरै',
'नजिकै',
'नत्र',
'नयाँ',
'निम्ति',
'बाहेक',
'बीच',
'बीचमा',
'भन',
'निम्न',
'निम्नानुसार',
'निर्दिष्ट',
'नौ',
'पक्का',
'पक्कै',
'पछि',
'पछिल्लो',
'पटक',
'पर्छ',
'पर्थ्यो',
'भन्छन्',
'भन्',
'भन्छु',
'भन्दा',
'भन्नुभयो',
'भर',
'भित्र',
'भित्री',
'म',
'मलाई',
'मात्र',
'माथि',
'मुख्य',
'मेरो',
'यति',
'यथोचित',
'यदि',
'यद्यपि',
'यसको',
'यसपछि',
'यसबाहेक',
'यसरी',
'यसो',
'यस्तो',
'यहाँ',
'यहाँसम्म',
'या',
'रही',
'राखे',
'राख्छ',
'राम्रो',
'रूप',
'लगभग',
'वरीपरी',
'वास्तवमा',
'बिरुद्ध',
'बिशेष',
'सायद',
'शायद',
'संग',
'संगै',
'सक्छ',
'सट्टा',
'सधै',
'सबै',
'सबैलाई',
'समय',
'सम्भव',
'सम्म',
'सही',
'साँच्चै',
'सात',
'साथ',
'साथै',
'सारा',
'सोही',
'स्पष्ट',
'हरे',
'हरेक'
],
'norwegian':
[
'og',
'i',
'jeg',
'det',
'at',
'en',
'et',
'den',
'til',
'er',
'som',
'på',
'de',
'med',
'han',
'av',
'ikke',
'ikkje',
'der',
'så',
'var',
'meg',
'seg',
'men',
'ett',
'har',
'om',
'vi',
'min',
'mitt',
'ha',
'hadde',
'hun',
'nå',
'over',
'da',
'ved',
'fra',
'du',
'ut',
'sin',
'dem',
'oss',
'opp',
'man',
'kan',
'hans',
'hvor',
'eller',
'hva',
'skal',
'selv',
'sjøl',
'her',
'alle',
'vil',
'bli',
'ble',
'blei',
'blitt',
'kunne',
'inn',
'når',
'være',
'kom',
'noen',
'noe',
'ville',
'dere',
'som',
'deres',
'kun',
'ja',
'etter',
'ned',
'skulle',
'denne',
'for',
'deg',
'si',
'sine',
'sitt',
'mot',
'å',
'meget',
'hvorfor',
'dette',
'disse',
'uten',
'hvordan',
'ingen',
'din',
'ditt',
'blir',
'samme',
'hvilken',
'hvilke',
'sånn',
'inni',
'mellom',
'vår',
'hver',
'hvem',
'vors',
'hvis',
'både',
'bare',
'enn',
'fordi',
'før',
'mange',
'også',
'slik',
'vært',
'være',
'båe',
'begge',
'siden',
'dykk',
'dykkar',
'dei',
'deira',
'deires',
'deim',
'di',
'då',
'eg',
'ein',
'eit',
'eitt',
'elles',
'honom',
'hjå',
'ho',
'hoe',
'henne',
'hennar',
'hennes',
'hoss',
'hossen',
'ikkje',
'ingi',
'inkje',
'korleis',
'korso',
'kva',
'kvar',
'kvarhelst',
'kven',
'kvi',
'kvifor',
'me',
'medan',
'mi',
'mine',
'mykje',
'no',
'nokon',
'noka',
'nokor',
'noko',
'nokre',
'si',
'sia',
'sidan',
'so',
'somt',
'somme',
'um',
'upp',
'vere',
'vore',
'verte',
'vort',
'varte',
'vart'
],
'portuguese':
[
'de',
'a',
'o',
'que',
'e',
'do',
'da',
'em',
'um',
'para',
'com',
'não',
'uma',
'os',
'no',
'se',
'na',
'por',
'mais',
'as',
'dos',
'como',
'mas',
'ao',
'ele',
'das',
'à',
'seu',
'sua',
'ou',
'quando',
'muito',
'nos',
'já',
'eu',
'também',
'só',
'pelo',
'pela',
'até',
'isso',
'ela',
'entre',
'depois',
'sem',
'mesmo',
'aos',
'seus',
'quem',
'nas',
'me',
'esse',
'eles',
'você',
'essa',
'num',
'nem',
'suas',
'meu',
'às',
'minha',
'numa',
'pelos',
'elas',
'qual',
'nós',
'lhe',
'deles',
'essas',
'esses',
'pelas',
'este',
'dele',
'tu',
'te',
'vocês',
'vos',
'lhes',
'meus',
'minhas',
'teu',
'tua',
'teus',
'tuas',
'nosso',
'nossa',
'nossos',
'nossas',
'dela',
'delas',
'esta',
'estes',
'estas',
'aquele',
'aquela',
'aqueles',
'aquelas',
'isto',
'aquilo',
'estou',
'está',
'estamos',
'estão',
'estive',
'esteve',
'estivemos',
'estiveram',
'estava',
'estávamos',
'estavam',
'estivera',
'estivéramos',
'esteja',
'estejamos',
'estejam',
'estivesse',
'estivéssemos',
'estivessem',
'estiver',
'estivermos',
'estiverem',
'hei',
'há',
'havemos',
'hão',
'houve',
'houvemos',
'houveram',
'houvera',
'houvéramos',
'haja',
'hajamos',
'hajam',
'houvesse',
'houvéssemos',
'houvessem',
'houver',
'houvermos',
'houverem',
'houverei',
'houverá',
'houveremos',
'houverão',
'houveria',
'houveríamos',
'houveriam',
'sou',
'somos',
'são',
'era',
'éramos',
'eram',
'fui',
'foi',
'fomos',
'foram',
'fora',
'fôramos',
'seja',
'sejamos',
'sejam',
'fosse',
'fôssemos',
'fossem',
'for',
'formos',
'forem',
'serei',
'será',
'seremos',
'serão',
'seria',
'seríamos',
'seriam',
'tenho',
'tem',
'temos',
'tém',
'tinha',
'tínhamos',
'tinham',
'tive',
'teve',
'tivemos',
'tiveram',
'tivera',
'tivéramos',
'tenha',
'tenhamos',
'tenham',
'tivesse',
'tivéssemos',
'tivessem',
'tiver',
'tivermos',
'tiverem',
'terei',
'terá',
'teremos',
'terão',
'teria',
'teríamos',
'teriam'
],
'romanian':
[
'a',
'abia',
'acea',
'aceasta',
'această',
'aceea',
'aceeasi',
'acei',
'aceia',
'acel',
'acela',
'acelasi',
'acele',
'acelea',
'acest',
'acesta',
'aceste',
'acestea',
'acestei',
'acestia',
'acestui',
'aceşti',
'aceştia',
'adica',
'ai',
'aia',
'aibă',
'aici',
'al',
'ala',
'ale',
'alea',
'alt',
'alta',
'altceva',
'altcineva',
'alte',
'altfel',
'alti',
'altii',
'altul',
'am',
'anume',
'apoi',
'ar',
'are',
'as',
'asa',
'asta',
'astea',
'astfel',
'asupra',
'atare',
'atat',
'atata',
'atatea',
'atatia',
'ati',
'atit',
'atita',
'atitea',
'atitia',
'atunci',
'au',
'avea',
'avem',
'aveţi',
'avut',
'aş',
'aţi',
'ba',
'ca',
'cam',
'cand',
'care',
'careia',
'carora',
'caruia',
'cat',
'catre',
'ce',
'cea',
'ceea',
'cei',
'ceilalti',
'cel',
'cele',
'celor',
'ceva',
'chiar',
'ci',
'cind',
'cine',
'cineva',
'cit',
'cita',
'cite',
'citeva',
'citi',
'citiva',
'cu',
'cui',
'cum',
'cumva',
'cât',
'câte',
'câtva',
'câţi',
'cînd',
'cît',
'cîte',
'cîtva',
'cîţi',
'că',
'căci',
'cărei',
'căror',
'cărui',
'către',
'da',
'daca',
'dacă',
'dar',
'dat',
'dată',
'dau',
'de',
'deasupra',
'deci',
'decit',
'deja',
'desi',
'despre',
'deşi',
'din',
'dintr',
'dintr-',
'dintre',
'doar',
'doi',
'doilea',
'două',
'drept',
'dupa',
'după',
'dă',
'e',
'ea',
'ei',
'el',
'ele',
'era',
'eram',
'este',
'eu',
'eşti',
'face',
'fara',
'fata',
'fel',
'fi',
'fie',
'fiecare',
'fii',
'fim',
'fiu',
'fiţi',
'foarte',
'fost',
'fără',
'i',
'ia',
'iar',
'ii',
'il',
'imi',
'in',
'inainte',
'inapoi',
'inca',
'incit',
'insa',
'intr',
'intre',
'isi',
'iti',
'la',
'le',
'li',
'lor',
'lui',
'lângă',
'lîngă',
'm',
'ma',
'mai',
'mea',
'mei',
'mele',
'mereu',
'meu',
'mi',
'mie',
'mine',
'mod',
'mult',
'multa',
'multe',
'multi',
'multă',
'mulţi',
'mâine',
'mîine',
'mă',
'ne',
'ni',
'nici',
'nimeni',
'nimic',
'niste',
'nişte',
'noastre',
'noastră',
'noi',
'nostri',
'nostru',
'nou',
'noua',
'nouă',
'noştri',
'nu',
'numai',
'o',
'or',
'ori',
'oricare',
'orice',
'oricine',
'oricum',
'oricând',
'oricât',
'oricînd',
'oricît',
'oriunde',
'pai',
'parca',
'patra',
'patru',
'pe',
'pentru',
'peste',
'pic',
'pina',
'poate',
'pot',
'prea',
'prima',
'primul',
'prin',
'printr-',
'putini',
'puţin',
'puţina',
'puţină',
'până',
'pînă',
'sa',
'sa-mi',
'sa-ti',
'sai',
'sale',
'sau',
'se',
'si',
'sint',
'sintem',
'spate',
'spre',
'sub',
'sunt',
'suntem',
'sunteţi',
'sus',
'să',
'săi',
'său',
't',
'ta',
'tale',
'te',
'ti',
'tine',
'toata',
'toate',
'toată',
'tocmai',
'tot',
'toti',
'totul',
'totusi',
'totuşi',
'toţi',
'trei',
'treia',
'treilea',
'tu',
'tuturor',
'tăi',
'tău',
'u',
'ul',
'ului',
'un',
'una',
'unde',
'undeva',
'unei',
'uneia',
'unele',
'uneori',
'unii',
'unor',
'unora',
'unu',
'unui',
'unuia',
'unul',
'v',
'va',
'vi',
'voastre',
'voastră',
'voi',
'vom',
'vor',
'vostru',
'vouă',
'voştri',
'vreo',
'vreun',
'vă',
'zi',
'zice',
'îi',
'îl',
'îmi',
'în',
'îţi',
'ăla',
'ălea',
'ăsta',
'ăstea',
'ăştia',
'şi',
'ţi',
'ţie'
],
'russian':
[
'и',
'в',
'во',
'не',
'что',
'он',
'на',
'я',
'с',
'со',
'как',
'а',
'то',
'все',
'она',
'так',
'его',
'но',
'да',
'ты',
'к',
'у',
'же',
'вы',
'за',
'бы',
'по',
'только',
'ее',
'мне',
'было',
'вот',
'от',
'меня',
'еще',
'нет',
'о',
'из',
'ему',
'теперь',
'когда',
'даже',
'ну',
'вдруг',
'ли',
'если',
'уже',
'или',
'ни',
'быть',
'был',
'него',
'до',
'вас',
'нибудь',
'опять',
'уж',
'вам',
'ведь',
'там',
'потом',
'себя',
'ничего',
'ей',
'может',
'они',
'тут',
'где',
'есть',
'надо',
'ней',
'для',
'мы',
'тебя',
'их',
'чем',
'была',
'сам',
'чтоб',
'без',
'будто',
'чего',
'раз',
'тоже',
'себе',
'под',
'будет',
'ж',
'тогда',
'кто',
'этот',
'того',
'потому',
'этого',
'какой',
'совсем',
'ним',
'здесь',
'этом',
'один',
'почти',
'мой',
'тем',
'чтобы',
'нее',
'сейчас',
'были',
'куда',
'зачем',
'всех',
'никогда',
'можно',
'при',
'наконец',
'два',
'об',
'другой',
'хоть',
'после',
'над',
'больше',
'тот',
'через',
'эти',
'нас',
'про',
'всего',
'них',
'какая',
'много',
'разве',
'три',
'эту',
'моя',
'впрочем',
'хорошо',
'свою',
'этой',
'перед',
'иногда',
'лучше',
'чуть',
'том',
'нельзя',
'такой',
'им',
'более',
'всегда',
'конечно',
'всю',
'между'
],
'spanish':
[
'de',
'la',
'que',
'el',
'en',
'y',
'a',
'los',
'del',
'se',
'las',
'por',
'un',
'para',
'con',
'no',
'una',
'su',
'al',
'lo',
'como',
'más',
'pero',
'sus',
'le',
'ya',
'o',
'este',
'sí',
'porque',
'esta',
'entre',
'cuando',
'muy',
'sin',
'sobre',
'también',
'me',
'hasta',
'hay',
'donde',
'quien',
'desde',
'todo',
'nos',
'durante',
'todos',
'uno',
'les',
'ni',
'contra',
'otros',
'ese',
'eso',
'ante',
'ellos',
'e',
'esto',
'mí',
'antes',
'algunos',
'qué',
'unos',
'yo',
'otro',
'otras',
'otra',
'él',
'tanto',
'esa',
'estos',
'mucho',
'quienes',
'nada',
'muchos',
'cual',
'poco',
'ella',
'estar',
'estas',
'algunas',
'algo',
'nosotros',
'mi',
'mis',
'tú',
'te',
'ti',
'tu',
'tus',
'ellas',
'nosotras',
'vosostros',
'vosostras',
'os',
'mío',
'mía',
'míos',
'mías',
'tuyo',
'tuya',
'tuyos',
'tuyas',
'suyo',
'suya',
'suyos',
'suyas',
'nuestro',
'nuestra',
'nuestros',
'nuestras',
'vuestro',
'vuestra',
'vuestros',
'vuestras',
'esos',
'esas',
'estoy',
'estás',
'está',
'estamos',
'estáis',
'están',
'esté',
'estés',
'estemos',
'estéis',
'estén',
'estaré',
'estarás',
'estará',
'estaremos',
'estaréis',
'estarán',
'estaría',
'estarías',
'estaríamos',
'estaríais',
'estarían',
'estaba',
'estabas',
'estábamos',
'estabais',
'estaban',
'estuve',
'estuviste',
'estuvo',
'estuvimos',
'estuvisteis',
'estuvieron',
'estuviera',
'estuvieras',
'estuviéramos',
'estuvierais',
'estuvieran',
'estuviese',
'estuvieses',
'estuviésemos',
'estuvieseis',
'estuviesen',
'estando',
'estado',
'estada',
'estados',
'estadas',
'estad',
'he',
'has',
'ha',
'hemos',
'habéis',
'han',
'haya',
'hayas',
'hayamos',
'hayáis',
'hayan',
'habré',
'habrás',
'habrá',
'habremos',
'habréis',
'habrán',
'habría',
'habrías',
'habríamos',
'habríais',
'habrían',
'había',
'habías',
'habíamos',
'habíais',
'habían',
'hube',
'hubiste',
'hubo',
'hubimos',
'hubisteis',
'hubieron',
'hubiera',
'hubieras',
'hubiéramos',
'hubierais',
'hubieran',
'hubiese',
'hubieses',
'hubiésemos',
'hubieseis',
'hubiesen',
'habiendo',
'habido',
'habida',
'habidos',
'habidas',
'soy',
'eres',
'es',
'somos',
'sois',
'son',
'sea',
'seas',
'seamos',
'seáis',
'sean',
'seré',
'serás',
'será',
'seremos',
'seréis',
'serán',
'sería',
'serías',
'seríamos',
'seríais',
'serían',
'era',
'eras',
'éramos',
'erais',
'eran',
'fui',
'fuiste',
'fue',
'fuimos',
'fuisteis',
'fueron',
'fuera',
'fueras',
'fuéramos',
'fuerais',
'fueran',
'fuese',
'fueses',
'fuésemos',
'fueseis',
'fuesen',
'sintiendo',
'sentido',
'sentida',
'sentidos',
'sentidas',
'siente',
'sentid',
'tengo',
'tienes',
'tiene',
'tenemos',
'tenéis',
'tienen',
'tenga',
'tengas',
'tengamos',
'tengáis',
'tengan',
'tendré',
'tendrás',
'tendrá',
'tendremos',
'tendréis',
'tendrán',
'tendría',
'tendrías',
'tendríamos',
'tendríais',
'tendrían',
'tenía',
'tenías',
'teníamos',
'teníais',
'tenían',
'tuve',
'tuviste',
'tuvo',
'tuvimos',
'tuvisteis',
'tuvieron',
'tuviera',
'tuvieras',
'tuviéramos',
'tuvierais',
'tuvieran',
'tuviese',
'tuvieses',
'tuviésemos',
'tuvieseis',
'tuviesen',
'teniendo',
'tenido',
'tenida',
'tenidos',
'tenidas',
'tened'
],
'swedish':
[
'och',
'det',
'att',
'i',
'en',
'jag',
'hon',
'som',
'han',
'på',
'den',
'med',
'var',
'sig',
'för',
'så',
'till',
'är',
'men',
'ett',
'om',
'hade',
'de',
'av',
'icke',
'mig',
'du',
'henne',
'då',
'sin',
'nu',
'har',
'inte',
'hans',
'honom',
'skulle',
'hennes',
'där',
'min',
'man',
'ej',
'vid',
'kunde',
'något',
'från',
'ut',
'när',
'efter',
'upp',
'vi',
'dem',
'vara',
'vad',
'över',
'än',
'dig',
'kan',
'sina',
'här',
'ha',
'mot',
'alla',
'under',
'någon',
'eller',
'allt',
'mycket',
'sedan',
'ju',
'denna',
'själv',
'detta',
'åt',
'utan',
'varit',
'hur',
'ingen',
'mitt',
'ni',
'bli',
'blev',
'oss',
'din',
'dessa',
'några',
'deras',
'blir',
'mina',
'samma',
'vilken',
'er',
'sådan',
'vår',
'blivit',
'dess',
'inom',
'mellan',
'sådant',
'varför',
'varje',
'vilka',
'ditt',
'vem',
'vilket',
'sitta',
'sådana',
'vart',
'dina',
'vars',
'vårt',
'våra',
'ert',
'era',
'vilkas'
],
'turkish':
[
'acaba',
'ama',
'aslında',
'az',
'bazı',
'belki',
'biri',
'birkaç',
'birşey',
'biz',
'bu',
'çok',
'çünkü',
'da',
'daha',
'de',
'defa',
'diye',
'eğer',
'en',
'gibi',
'hem',
'hep',
'hepsi',
'her',
'hiç',
'için',
'ile',
'ise',
'kez',
'ki',
'kim',
'mı',
'mu',
'mü',
'nasıl',
'ne',
'neden',
'nerde',
'nerede',
'nereye',
'niçin',
'niye',
'o',
'sanki',
'şey',
'siz',
'şu',
'tüm',
've',
'veya',
'ya',
'yani'
]
}
|
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""Meta data for appveyorpy."""
__version__ = '0.0.1'
def add(a: int, b: int) -> int:
"""Add ``a`` and ``b``."""
return a + b
|
class Solution:
def maxArea(self, height: List[int]) -> int:
n = len(height)
start, end = 0, n-1
maxArea = 0
while start < end:
area = (end - start)*min(height[start], height[end])
if maxArea < area:
maxArea = area
if height[start] < height[end]:
start += 1
else:
end -= 1
return maxArea
|
N = int(input())
A = int(input())
if N%500 <= A:
print('Yes')
else:
print('No')
|
# puzzle3b.py
def get_rating(input_data, rating_type, num_len):
def rating_type_compare(rating_type, count_0, count_1):
if rating_type.upper() in ["OXYGEN", "O2"]:
return (count_0 > count_1)
elif rating_type.upper() in ["CO2"]:
return (count_0 <= count_1)
# Strategy: For each position in binary representation, extract the
# digits (0 or 1) from each number (line of input). Count the number of 0s
# and 1s for that position and determine which is greater (for oxygen)
# smaller (for CO2) to determine which numbers from input to keep for
# next iteration. If 0s and 1s are equal, keep based on 1s for oxygen
# and 0s for CO2. Repeat/iterate for each position. Iterate twice: once for
# oxygen and once for CO2.
input_values = input_data # Initial values are numbers from input file.
for i in range(num_len):
column = list()
num_count = len(input_values)
for j in range(num_count):
num_digits = list(input_values[j]) # Expand binary number input into array of digits as characters
column.append(num_digits[i]) # Take the digit character from the appropriate position
# Get counts of 0s and 1s for this position
count_0 = len([val for val in column if val == "0"])
count_1 = len([val for val in column if val == "1"])
# Determine values for next iteration
if rating_type_compare(rating_type, count_0, count_1):
input_values = [val for val in input_values
if list(val)[i] == "0"]
else:
input_values = [val for val in input_values
if list(val)[i] == "1"]
if len(input_values) == 1:
return (input_values[0])
def main():
input_file = open("input3b.txt", "r")
lines = input_file.read().splitlines()
num_count = len(lines) # Count of numbers in list
num_len = len(lines[0]) # Length of each number in list
(oxygen, co2) = ("", "")
# Determine oxygen generator rating
oxygen = get_rating(input_data=lines, rating_type="oxygen", num_len=num_len)
# Determine CO2 scrubber rating
co2 = get_rating(input_data=lines, rating_type="CO2", num_len=num_len)
print("oxygen: {o}\nCO2: {c}\nProduct: {p}\n"
.format(o=oxygen,
c=co2,
p=(int(oxygen, 2) * int(co2, 2))))
if __name__ == "__main__":
main()
|
dado1 = 'pessego'
dado2 = 'se'
if dado2 in dado1:
print(f'{dado2} encontrado na posição {dado1.find(dado2)} de {dado1}')
|
class ParticipantIdentifierTypeName():
AS_PROGRESSION_ID = 'AS_PROGRESSION_ID'
BME_COVID_ID = 'BME_COVID_ID'
CARDIOMET_ID = 'CARDIOMET_ID'
CARMER_BREATH_ID = 'CARMER_BREATH_ID'
EASY_AS_ID = 'EASY_AS_ID'
EDEN_ID = 'EDEN_ID'
EDIFY_ID = 'EDIFY_ID'
ELASTIC_AS_ID = 'ELASTIC_AS_ID'
EPIGENE1_ID = 'EPIGENE1_ID'
EXTEND_ID = 'EXTEND_ID'
MEIRU_ID = 'MEIRU_ID'
FAST_ID = 'FAST_ID'
FOAMI_ID = 'FOAMI_ID'
STUDY_PARTICIPANT_ID = 'study_participant_id'
ALLEVIATE_ID = 'alleviate_id'
BREATHE_DEEP_ID = 'BREATHE_DEEP_ID'
BREATHLESSNESS_ID = 'BREATHLESSNESS_ID'
BRICCS_ID = 'BRICCS_ID'
CHABLIS_ID = 'CHABLIS_ID'
CIA_ID = 'CIA_ID'
COHERE_ID = 'COHERE_ID'
COPD_COVID_19_ID = 'COPD_COVID_19_ID'
COPD_INTRO_ID = 'COPD_INTRO_ID'
CTO_ID = 'CTO_ID'
CVLPRIT_ID = 'CVLPRIT_ID'
CVLPRIT_LOCAL_ID = 'CVLPRIT_LOCAL_ID'
PILOT_ID = 'PILOT_ID'
DAL_GENE_ID = 'DAL_GENE_ID'
DESMOND_ID = 'DESMOND_ID'
DHF_ID = 'DHF_ID'
DISCORDANCE_ID = 'DISCORDANCE_ID'
DREAM_ID = 'DREAM_ID'
BIORESOURCE_ID = 'BIORESOURCE_ID'
GENVASC_ID = 'GENVASC_ID'
GLOBAL_VIEWS_ID = 'GLOBAL_VIEWS_ID'
GO_DCM_ID = 'GO_DCM_ID'
GRAPHIC2_ID = 'GRAPHIC2_ID'
GRAPHIC_ID = 'GRAPHIC_ID'
GRAPHIC_LAB_ID = 'GRAPHIC_LAB_ID'
TMAO_ID = 'tmao_id'
BRAVE_ID = 'BRAVE_ID'
NHS_NUMBER = 'nhs_number'
UHL_SYSTEM_NUMBER = 'uhl_system_number'
UHL_HCW_COVID_19_ID = 'UHL_HCW_COVID_19_ID'
HAD_ID = 'HAD_ID'
IDAPAMIDE_ID = 'IDAPAMIDE_ID'
INTERFIELD_ID = 'INTERFIELD_ID'
LENTEN_ID = 'LENTEN_ID'
LIMB_ID = 'LIMB_ID'
MARI_ID = 'MARI_ID'
MCCANN_IMAGE_ID = 'MCCANN_IMAGE_ID'
MEL_ID = 'MEL_ID'
MI_ECMO_ID = 'MI_ECMO_ID'
MINERVA_ID = 'MINERVA_ID'
MRP_HFPEF_ID = 'MRP_HFPEF_ID'
MULTI_MORBID_PRIORITIES_ID = 'MULTI_MORBID_PRIORITIES_ID'
NON_ADHERENCE_ID = 'NON_ADHERENCE_ID'
NOVO5K_ID = 'NOVO5K_ID'
PARC_ID = 'PARC_ID'
HC_NUMBER = 'HC_NUMBER'
CHI_NUMBER = 'CHI_NUMBER'
PHOSP_COVID19_ID = 'PHOSP_COVID19_ID'
PREDICT_ID = 'PREDICT_ID'
PREECLAMPSIA_ID = 'PREECLAMPSIA_ID'
RAPID_NSTEMI_ID = 'RAPID_NSTEMI_ID'
RECHARGE_ID = 'RECHARGE_ID'
REST_ID = 'REST_ID'
SALT_ID = 'SALT_ID'
SCAD_SURVEY_ID = 'SCAD_SURVEY_ID'
SCAD_LOCAL_ID = 'SCAD_LOCAL_ID'
SCAD_ID = 'SCAD_ID'
SCAD_REG_ID = 'SCAD_REG_ID'
SCAD_CAE_ID = 'SCAD_CAE_ID'
SKOPE_ID = 'SKOPE_ID'
SPACE_FOR_COPD_ID = 'SPACE_FOR_COPD_ID'
SPIRAL_ID = 'SPIRAL_ID'
UPFOR5_ID = 'UPFOR5_ID'
VASCEGENS_ID = 'VASCEGENS_ID'
YAKULT_ID = 'yakult_id'
YOGA_ID = 'yoga_id'
UHL_NUMBER = 'UHL_NUMBER'
CIVICRM_CONTACT_ID = 'CIVICRM_CONTACT_ID'
CIVICRM_CASE_ID = 'CIVICRM_CASE_ID'
OMICS_REGISTER_ID = 'OMICS_REGISTER_ID'
def all_types(self):
return [getattr(self, f) for f in dir(self) if not callable(getattr(self,f)) and not f.startswith('__')]
|
def D2old():
n = int(input())
bricks = input().split()
bricks = [int(x) for x in bricks]
m = min(bricks)
M = max(bricks)
while(m!=M):
for idx in range(n):
if(bricks[idx] != m): continue
m_count = 0
while( idx+m_count < n and bricks[idx+m_count]== m):
bricks[idx+m_count] +=1
m_count+=1
if(m_count%2):
print("NO")
return
m_count = 0
m = min(bricks)
break
print("YES")
D2old()
# Daba TLE en test 12
|
# -*- coding: utf-8 -*-
"""
Created on Sat Aug 17 13:18:39 2019
@author: solis
https://opendata.aemet.es/centrodedescargas/inicio
"""
MYAPIKEY = 'facilitadoPorAEMET'
|
'''
9. Faça um programa que imprima na tela apenas os números ímpares entre 1 e 50.
'''
for j in range(1, 50):
if j % 2 == 1:
print(j, end=' ')
|
class LoginError(Exception):
"""
An error occurred when logging in.
"""
pass
class ParseError(Exception):
"""
An error occurred when trying to parse the message.
"""
pass
class ParserNotFoundError(Exception):
"""
Parser for the given destto name was not registered with the meta class.
"""
pass
|
# Copyright (c) 2015, 2014 Computational Molecular Biology Group, Free University
# Berlin, 14195 Berlin, Germany.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice, this
# list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the documentation and/or
# other materials provided with the distribution.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
# ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
# ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
'''
Created on May 26, 2014
@author: marscher
'''
class SpectralWarning(RuntimeWarning):
pass
class ImaginaryEigenValueWarning(SpectralWarning):
pass
class PrecisionWarning(RuntimeWarning):
r"""
This warning indicates that some operation in your code leads
to a conversion of datatypes, which involves a loss/gain in
precision.
"""
pass
class NotConvergedWarning(RuntimeWarning):
r"""
This warning indicates that some iterative procdure has not
converged or reached the maximum number of iterations implemented
as a safe guard to prevent arbitrary many iterations in loops with
a conditional termination criterion.
"""
|
# Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: MIT-0
"""
Stubs for testing organization.py
"""
describe_organization = {
'Organization': {
'Id': 'some_org_id',
'Arn': 'string',
'FeatureSet': 'ALL',
'MasterAccountArn': 'string',
'MasterAccountId': 'some_master_account_id',
'MasterAccountEmail': 'string',
'AvailablePolicyTypes': [
{
'Type': 'SERVICE_CONTROL_POLICY',
'Status': 'ENABLED'
},
]
}
}
list_parents = {
'Parents': [
{
'Id': 'some_id',
'Type': 'ORGANIZATIONAL_UNIT'
},
],
'NextToken': 'string'
}
list_parents_root = {
'Parents': [
{
'Id': 'some_id',
'Type': 'ROOT'
},
],
'NextToken': 'string'
}
describe_organizational_unit = {
'OrganizationalUnit': {
'Id': 'some_org_unit_id',
'Arn': 'string',
'Name': 'some_ou_name'
}
}
describe_account = {
'Account': {
'Id': 'some_account_id',
'Arn': 'string',
'Email': 'some_account_email',
'Name': 'some_account_name',
'Status': 'ACTIVE',
'JoinedMethod': 'INVITED'
# Excluding JoinedTimestamp to avoid
# adding dependency on datetime
}
}
|
"""
Python program using class sructure for calculating
a dining bill and diners' shares on any percentages
of sales tax or tip, and on any given number of diners
sharing the bill, as given per the user input
"""
class Tip_Calculator():
"""define a Tip_Calculator class"""
def __init__(self):
"""initialize class attributes"""
self.num_of_diners = 0
self.food_cost = 0
self.tax_rate = 0
self.tip_rate = 0
def print_header_and_usage(self):
"""print header and usage instrucitons to stdout"""
print('\n🟪🟪🟪🟪🟪🟪🟪🟪🟪🟪🟪🟪🟪🟪🟪🟪🟪🟪🟪🟪🟪🟪🟪',
'🟪🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟪',
'🟪🟨🟨🟨🟨🟨🟨🟨Tip Calculator🟨🟨🟨🟨🟨🟨🟨🟪',
'🟪🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟪',
'🟪🟪🟪🟪🟪🟪🟪🟪🟪🟪🟪🟪🟪🟪🟪🟪🟪🟪🟪🟪🟪🟪🟪',
sep='\n', end='\n\n')
print('Welcome, thank you for using the Tip',
'Calculator. This program calculates the',
'restaurant bill after tax and tip and each',
'diner\'s share of the bill, based on the',
'user input as to the number of diners in',
'the party and the percentages of the tip',
'that the diners give and of the sales tax.',
sep='\n', end='\n\n')
def get_food_cost(self):
"""take input of the cost of meal from user"""
# process only valid input
while True:
cost_given = input('How much does the meal cost? ')
try:
if float(cost_given) > 0:
break
print('\nFree meal or negative cost isn\'t calculable. Let\'s try again.\n')
except ValueError:
self.print_error_msg()
# store food cost in class after validation
self.food_cost = float(cost_given)
# confirm input with user
print(f'🟡 The cost of the meal is {self.food_cost}.\n')
def get_num_of_diners(self):
"""take input of the number of diners from user"""
# process only valid input
while True:
num_given = input('How many people are dining together? ')
try:
if int(num_given) > 0:
break
print('\nAt least one person will have been dining. Let\'s try agan.\n')
except ValueError:
self.print_error_msg()
# store number of diners in class after validation
self.num_of_diners = int(num_given)
# confirm input with user
print(f'🟣 You have {self.num_of_diners} diner(s).\n')
def get_tax_rate(self):
"""take input of the percentage of tax from user"""
# process only valid input
while True:
tax_percentage = input('What percentage is the sales tax?\nPlease give the percentage without the percentage sign >> ')
try:
if float(tax_percentage) >= 0:
break
print('\nNegative tax is impossible. Let\'s try again.\n')
except ValueError:
self.print_error_msg()
# store tax percentage in class after validation
self.tax_rate = float(tax_percentage)
# confirm input with user
print(f'🟠 The sales tax for the meal is {self.tax_rate}%.\n')
def get_tip_rate(self):
"""take input of the percentage of the tip from user"""
# process only valid input
while True:
tip_percentage = input('What percentage are you going to tip?\nPlease give the percentage without the percentage sign >> ')
try:
if float(tip_percentage) > 0:
break
print('\nThe waiters/waitresses won\'t let you get away. Let\'s try again.\n')
except ValueError:
self.print_error_msg()
# store tip percentage in calss after validation
self.tip_rate = float(tip_percentage)
# confirm input with user
print(f'⚪️ You are going to give a {self.tip_rate}% tip.\n')
def print_error_msg(self):
"""print input error message to user"""
print('\nHmm, something is wrong with that figure. Your',
'number should be an integer (number of diners)',
'or a floating point numder (cost and rates), and',
'should not have letters or else. Let\'s try again.',
sep='\n', end='\n\n')
def get_info_and_calculate(self):
"""get user input, calculate and output results"""
# get necessary inputs from the user
self.get_food_cost()
self.get_num_of_diners()
self.get_tax_rate()
self.get_tip_rate()
# if all is well, calculate total bill/each diner's share
tax = self.food_cost * self.tax_rate / 100
tip = self.food_cost * self.tip_rate / 100
total_with_tax_and_tip = self.food_cost + tax + tip
each_diners_share = total_with_tax_and_tip / self.num_of_diners
# display results of calculation
print(f'🟨 The total bill for the meal is ${round(total_with_tax_and_tip, 2)}.',
f'🟪 And each diner should pay ${round(each_diners_share, 2)}.',
sep='\n', end='\n\n')
def run_calculator(self):
# print the header and usage instructions
self.print_header_and_usage()
# run calculator as many times as the user want
while True:
self.get_info_and_calculate()
run_again = input('Would you like to run the calculator again? (y/n) ')
if run_again[0:1].lower() == 'n':
break
print()
# print message to end program
print('\nThank you for using the Tip Calculator. Bye.\n')
# assign an instance of class
tip_calculator = Tip_Calculator()
# run and calculate
tip_calculator.run_calculator()
|
list = []
def list_(times):
for x in range(times):
number = int(input('Ingrese numero(s) a incluir '))
list.append(number)
return list
times = int(input('Cantidad de elementos?: '))
list = list_(times)
print(list)
|
class Helmet:
name = ""
info = ""
level = 0
visibility = 0
_type = ""
heaviness = 0
loudness = 0
hit_points = 10000
cut_damage_reduction = 0 # 1 - 10(%)
stab_damage_reduction = 0 # 1 - 10(%)
smash_damage_reduction = 0 # 1 - 10(%)
special_abilities = []
occupied = False
no_helmet = Helmet()
# helmet patterns
class RustyOrkHelmet(Helmet):
name = "rezavá orkská helma"
info = "vyrobená skřety ve velmi primitivní podmínkách velmi primitivními nástroji, která se" \
" pak někde dlouho válela, nejspíš i s mrtvolou mrtvého orka, takže je dosti zrezlá a" \
" nositel si musí dát pozor aby se omylem nepořezal. Je velmi těžká ale hlavu docela ochrání"
level = 1 # 1 - 3
visibility = 1 # 0 - 3
heaviness = 10 # 1 - 10
loudness = 3
hit_points = 2000
cut_damage_reduction = 8 # 1 - 10(%)
stab_damage_reduction = 2 # 1 - 10(%)
smash_damage_reduction = 3 # 1 - 10(%)
special_abilities = ["rusty", "elf_debuff"]
class DwarvenMinerHelmet(Helmet):
name = "trpasličí důlnická helma"
info = "používaná trpaslíky v dolech slouží spíše jako ochrana hlavy při chození tunelem než" \
" na boj, ale část úderu rozhodně zastaví"
level = 1
visibility = 1
loudness = 2
cut_damage_reduction = 5
stab_damage_reduction = 3
smash_damage_reduction = 5
class GromrilHelmet(Helmet):
name = "gromrilová přilba"
info = "přilba vyrobená trpaslíky z nejtvrdšího kovu jim známého, gromrilu, který nejen že je ohromně pevný, ale" \
" dokonce ho jeho váhu na sobě nositel téměř necítí, bohužel je ohromně vzácný a tak se tato brnění" \
" předávájí z generace na generaci a každý klan jich má jen pár jestli nějaká má"
level = 3
visibility = 3
heaviness = 3
loudness = 3
hit_points = 1000000
cut_damage_reduction = 10
stab_damage_reduction = 10
smash_damage_reduction = 10
class GuardsmenHelmet(Helmet):
pass
class ElvenPathfinderHelmet(Helmet):
pass
# helmets
class Helmet1(RustyOrkHelmet):
hit_points = 500
class Helmet2(RustyOrkHelmet):
pass
class Helmet3(DwarvenMinerHelmet):
pass
class Helmet4(GromrilHelmet):
pass
helmet_1 = Helmet1()
helmet_2 = Helmet2()
helmet_3 = Helmet3()
gromril_helmet_1 = Helmet4()
|
#Patterns to detect accommodation related queries
pattern_details1 = {
"LABEL" : "PICKUP_REG",
"pattern" : [
{ "TEXT" : { "REGEX" : "\bpickup\b|\bpick-up\b|\bdeliver*\b|\bgrab*\b" } }
]
}
pattern_details2 = {
"LABEL" : "PICKUP_LEMM",
"pattern" : [
{ "TEXT" : { "REGEX" : "deliver|pickup|pick-up|grab|drop" } },
{ "OP" : "*" },
{ "TEXT" : { "REGEX" : "\bgrocer*\b|\bmedicin*\b|\bmedicat*\b|\bclinic*\b|\bparamedic*\b|\bhealth*\b" }}
]
}
patterns = [
pattern_details2, pattern_details1
]
|
#remove all the digits from given string
inp="test1254ab995drgdc10108done"
inp=inp.replace("0","")
inp=inp.replace("1","")
inp=inp.replace("2","")
inp=inp.replace("3","")
inp=inp.replace("4","")
inp=inp.replace("5","")
inp=inp.replace("6","")
inp=inp.replace("7","")
inp=inp.replace("8","")
inp=inp.replace("9","")
print(inp)
|
n = int(input())
if n%2!=0:
print("Weird")
else:
if (n>=2 and n<=5):
print("Not Weird")
elif (n>=6 and n<=20):
print("Weird")
elif(n>20):
print("Not Weird")
|
#!/usr/bin/env python
"""Temp GGBweb python formating functions"""
__author__ = "Aaron Brooks"
__copyright__ = "Copyright 2014, cMonkey2"
__credits__ = ["Aaron Brooks"]
__license__ = "GPL"
__version__ = "0.0.1"
__maintainer__ = "Aaron Brooks"
__email__ = "[email protected]"
__status__ = "Development"
|
n = int(input())
d = len(str(n)) - 1
k = str(n)
j = int(k[0])
count = 1
co = 0
for i9 in range(3, 8, 2):
for i8 in range(3, 8, 2):
for i7 in range(3, 8, 2):
for i6 in range(3, 8, 2):
for i5 in range(3, 8, 2):
for i4 in range(3, 8, 2):
for i3 in range(3, 8, 2):
for i2 in range(3, 8, 2):
for i1 in range(3, 8, 2):
if len(set([i9,i8,i7,i6,i5,i4,i3,i2,i1])) == 3:
t = int(str(i9) + str(i8) + str(i7) + str(i6) + str(i5) + str(i4) + str(i3) + str(i2) + str(i1))
if t <= n:
co += 1
for i8 in range(3, 8, 2):
for i7 in range(3, 8, 2):
for i6 in range(3, 8, 2):
for i5 in range(3, 8, 2):
for i4 in range(3, 8, 2):
for i3 in range(3, 8, 2):
for i2 in range(3, 8, 2):
for i1 in range(3, 8, 2):
if len(set([i8,i7, i6, i5, i4, i3, i2, i1])) == 3:
t = int(str(i8) + str(i7) + str(i6) + str(i5) + str(i4) + str(i3) + str(i2) + str(i1))
if t <= n:
co += 1
for i7 in range(3, 8, 2):
for i6 in range(3, 8, 2):
for i5 in range(3, 8, 2):
for i4 in range(3, 8, 2):
for i3 in range(3, 8, 2):
for i2 in range(3, 8, 2):
for i1 in range(3, 8, 2):
if len(set([i7, i6, i5, i4, i3, i2, i1])) == 3:
t = int(str(i7) + str(i6) + str(i5) + str(i4) + str(i3) + str(i2) + str(i1))
if t <= n:
co += 1
for i6 in range(3, 8, 2):
for i5 in range(3, 8, 2):
for i4 in range(3, 8, 2):
for i3 in range(3, 8, 2):
for i2 in range(3, 8, 2):
for i1 in range(3, 8, 2):
if len(set([i6, i5, i4, i3, i2, i1])) == 3:
t = int(str(i6) + str(i5) + str(i4) + str(i3) + str(i2) + str(i1))
if t <= n:
co += 1
for i5 in range(3, 8, 2):
for i4 in range(3, 8, 2):
for i3 in range(3, 8, 2):
for i2 in range(3, 8, 2):
for i1 in range(3, 8, 2):
if len(set([i5, i4, i3, i2, i1])) == 3:
t = int(str(i5) + str(i4) + str(i3) + str(i2) + str(i1))
if t <= n:
co += 1
for i4 in range(3, 8, 2):
for i3 in range(3, 8, 2):
for i2 in range(3, 8, 2):
for i1 in range(3, 8, 2):
if len(set([i4, i3, i2, i1])) == 3:
t = int(str(i4) + str(i3) + str(i2) + str(i1))
if t <= n:
co += 1
for i3 in range(3, 8, 2):
for i2 in range(3, 8, 2):
for i1 in range(3, 8, 2):
if len(set([i3, i2, i1])) == 3:
t = int(str(i3) + str(i2) + str(i1))
if t <= n:
co += 1
print(co)
"""for i in range(3, d):
co += 3 ** i - 3 * 2 ** i + 3
if 0 < j < 3:
co += 3 ** d - 3 * 2 ** d + 3
elif 3 <= j < 5:
for u
elif 5 <= j < 7:
count *= 2
elif 7 <= j:
count *= 3"""
"""li = [6, ]
for i in range(d, 0, -1):
if i >= 3:
count *= 3
elif i == 2 and d + 1 > 2:
count *= 2
elif d + 1 <= 2:
count = 0
if 5 <= j < 7:
count *= 2
elif 7 <= j:
count *= 3
print(count)"""
|
n1 = int(input('Digite um número: '))
dob = n1 * 2
tri = n1 * 3
raiz = n1 ** (1/2)
print(f'O dobro de {n1} é {dob}')
print(f'O triplo de {n1} vale {tri}')
print(f'A raiz quadrada de {n1} é igual a {raiz:.6f}')
|
"""
@author: David Lei
@since: 21/08/2016
@modified:
Common problem with many variations
- minimum number of coins
- how many ways can we give change
- each coin only used once
- each coin can be used as many times as you want
etc
"""
"""
Minimum number of coins variation
Given coins of different denomination how many minimum coins are needed to get our desired total assuming
an unlimited supply of coins
https://www.youtube.com/watch?v=Y0ZqKpToTic
1. start by building 2d array of size len(denominations)*total
eg: denominations = [1, 5, 6, 8], total = 11
index 0 1 2 3 4 5 6 7 8 9 10 11 # len = 12
val rep 0 1 2 3 4 5 6 7 8 9 10 11
-----------------------------------------------
1 1 | 0 1 x 3 4 5 6 7 8 9 10 11 # first row, do by itself
2 5 | 0 y 2 3 4 z l . . . . 3 # every other row builds on either the min from above
3 6 | 0 1 2< 3 4 1 1 2 3< 4 2 2 # or back a number of places + 1
4 8 | 0 1 2 3 4 1 1 2 1 2 2 2 # as to make 8 you need with coins of 6 and 1 you need one
# 6 and two 1s, go back 6 places to get to 2<
that gives us the number of coins to make 2 from coins (1, 5, 6) then + 1 representing adding a coin of value 6 resutling in 3<
x is asking what is the minimum number of ways we can make a value of 1 with an unlimited supply of coins of value 1 = 1
carry on like this for the first row
y is asking what is the minimum number of ways we can make the value of 1 with an unlimited supply of coins of value 1, 5
we can't do better so the value comes from the row above = 1
z is asking what is the minimum number of ways we can make the value of 5 with an unlimited supply of coins of value 1, 5 = 1
this comes from minimum of value above vs going 5 steps back to the value 0 + 1
l is from going 5 steps backwards and adding 1
this is because going 5 steps back we are saying we need one 5 coin and one 1 coin
formula: if j >= coin[i] # don't use this formula for the first row
then table[i][j] = min (
table[i-1][j], # look at solution 1 row above and use that
1 + table[i][j-coin[i]] # take the solution coin[i] spaces to the left and add 1
)
else:
table[i][j] = table[i-1][j] # take row above value as we won't be able to use this new coin as value we are trying to make is (j) < the new coin
How to pick out a formula like this?
1. practice questions --> builds intuition on similar problems
2. if we need to store lots of past calculations --> hints at dp
3. extend a basic solution to something else some how
"""
def minimum_number_of_coins(coin_denominations, total):
"""
:param coin_denominations: array of coins of different values
:param total: total we need to make
:return:
"""
full_array_filled = False
table = [[0 for _ in range(total + 1)] for _ in range(len(coin_denominations))] # initialize the first column as 0 for each row, needed as need to loop to total + 1 (so total is looked at)
for k in range(1, total+1):
even_div = k % coin_denominations[0]
if even_div == 0:
table[0][k] = k // coin_denominations[0]
else:
table[0][k] = 0
for i in range(1, len(coin_denominations)): # i indexes the coin_denominations array and the row in the table
for j in range(1, total + 1): # we skip the 0th value of the ith row
if j >= coin_denominations[i]: # j indexes the sum we are trying to make <= total
table[i][j] = min_bounded(table, coin_denominations, i, j)
# does the above (prev) way take less coins?
#table[i][j - coin_denominations[i]] + 1 # value in current_col - value of coin + 1 (adding another coin of the same value)
# ) # want minimum number of coins
else:
table[i][j] = table[i-1][j] # value above as we can't make it with the newest coin i.e. can't make value 3 with a coin of value 5
[print(x) for x in table]
coins_needed = find_coins(table, coin_denominations) # find actual coins needed
return table, coins_needed # final number of coins needed
def find_coins(table, coin_denominations):
number_coins_needed = table[-1][-1]
coins = []
row, col = -1, -1
to_find = number_coins_needed
going_up = False
while len(coins) != number_coins_needed:
if row != -len(table):
if table[row - 1][col] == to_find: # check if it came from above
# it came from the top, need to check where this one came from
going_up = True
#coins.append(coin_denominations[row - 1])
#to_find -= 1
row -= 1
if col - coin_denominations[row] >= -len(table[0]):
if table[row][col - coin_denominations[row]] == to_find - 1: # check if it came from this row
coins.append(coin_denominations[row])
to_find -= 1
if col - coin_denominations[row] == 0: # reached first column, means we are done
coins.append(coin_denominations[row])
break
col = col - coin_denominations[row]
else:
row -= 1
if row == 0:
if col - coin_denominations[row] == 0: # reached first column, means we are done
coins.append(coin_denominations[row])
break
# else:
# print("ERR")
return coins
def min_bounded(table, coin_denminations, i, j):
"""
we have the case where if anything = 0 it means we can't make that value of j
additionally when checking in the same row to extend the solution, should check if the value is 0
if so we can't just +1 to it
if both value are 0, return 0
else if both are > 0 return min
else return the non zero one
remembering to +1 if it is on the same row
:return:
"""
# table[i-1][j],table[i][j - coin_denominations[i]]+1
# value from above row
above = table[i - 1][j]
# value from same row (already used coin_dem[i]
same_row = table[i][j - coin_denminations[i]] # don't +1 to this until later as if you do it at the start will lead to a false soln
new = False
if j % coin_denminations[i] == 0:
new = j // coin_denminations[i]
if above == 0 and same_row == 0: # both can't make a solution
if new:
return new
return 0 # no solution
elif above > 0 and same_row == 0: # can make a solution using above value
if new:
return min(new, above)
return above
elif above == 0 and same_row > 0: # can make a solution using value on same_row, remember to + 1
if new:
return min(new, same_row+1)
return same_row + 1
elif above > 0 and same_row > 0: # pick min
m = min(above, same_row + 1) # remember to + 1 to same_row
if new:
return min(new, m)
return m
else:
raise Exception
denominations = [1, 2, 4, 6]
total = 100
min_coins = minimum_number_of_coins(denominations, total)
table, coins = min_coins
print("Minimum number of coins: " + str(table[-1][-1]))
print("Coins used: " + str(coins))
|
"""
Test routes for routes for authorizing users, app/main/routes
"""
# pylint: disable=redefined-outer-name,unused-argument
def test_index_route_to_login(client):
"""
Test redirect to login when go to index and not authorized
"""
response = client.get("/", follow_redirects=True)
assert response.status_code == 200
assert b"Please log in to access this page." in response.data
assert b"Sign In" in response.data
def test_index_post(client, user_post_response, user_dict):
"""
Test redirect to login when go to index and not authorized
"""
response = user_post_response
assert b"Say something" in response.data
assert b"Submit" in response.data
assert response.status_code == 200
assert str.encode("Hi, " + user_dict["username"]) in response.data
assert b"This is my first post" in response.data
assert b"Your post is now live" in response.data
assert b"Submit" in response.data
|
# coding: utf-8
"""
Heapsort implementation
https://en.wikipedia.org/wiki/Heapsort
Worst-case performance O(n * log(n))
Best-case performance O(n)
Average performance O(n * log(n))
"""
def heapsort(lst):
""" Implementation of heap sort algorithm """
lenght = len(lst)
heapstart = int(lenght / 2) - 1
# build max heap part
for start in range(heapstart, -1, -1):
# build max heap
max_heapify(lst, start, lenght - 1)
# sorting part
for end in range(lenght - 1, 0, -1):
# zero element in heap has max value
# we get zero element from the heap
# and swap it with the end element in list
lst[end], lst[0] = lst[0], lst[end]
# restores heap properties
# with list from zero to end - 1
# storing sorted list after end - 1 element
max_heapify(lst, 0, end - 1)
return lst
def max_heapify(lst, start, end):
""" performs permutation in a binary tree """
root = start
while True:
# set child position from left branch
child = root * 2 + 1
# exit if child position outside the list
if child > end:
break
# if right value bigger than left
# change child position to right branch
if child + 1 <= end and lst[child] < lst[child + 1]:
child += 1
# if root value lower than child
if lst[root] < lst[child]:
# swap root and child elements in list
lst[root], lst[child] = lst[child], lst[root]
# set new root
root = child
else:
# otherwise exit
break
if __name__ in "__main__":
LIST = [4, 1, 3, 2, 16, 9, 10, 14, 8, 7]
print('list :', LIST)
print('heapsort:', heapsort(LIST))
|
#!/usr/bin/python3
# -*- coding: utf-8 -*-
#
# Run inside python3 shell.
#
def gen_gray(n):
"""
A generator that yields the elements of a gray sequence (as lists) with `n` bits.
"""
k = 0
even = True
seq = [False]*n
while k < 2**n:
yield seq
if even:
seq[n - 1] = not seq[n - 1]
else:
tmp = n - 1
while not seq[tmp]:
tmp -= 1
seq[tmp - 1] = not seq[tmp - 1]
even = not even
k += 1
def print_gray_subsets(n):
"""
Prints all subsets of {1, 2, ..., `n`} in the order
given by grey ordering of characteristic vectors.
"""
for gray in gen_gray(n):
# assoc_seq = [0 ^ gray[0]] + [gray[k - 1] ^ gray[k] for k in range(1, n)]
print([k + 1 for k in range(n) if gray[k]])
def calc_rank(someset, n):
"""
Calculates the rank of a subset `someset` of {1, 2, ..., `n`}
in the ordering given by grey sequenccce of characteristic vectors.
"""
assoc_seq = [k + 1 in someset for k in range(n)]
bit = False
rank = 0
for k, x in enumerate(assoc_seq):
bit ^= x
rank += bit * 2**(n - k - 1)
return rank
def calc_set(pos, n):
"""
Computes the subset of {1, 2, ..., `n`} with given rank `pos`
in the ordering induces by gray ordering of indicator vectors.
"""
binary = [1 & (pos >> (n - k - 1)) for k in range(n)]
assoc_seq = list(map(lambda x: x[0] ^ x[1], zip([0] + binary[:-1], binary)))
return [x + 1 for x in range(n) if assoc_seq[x]]
def calc_set_lazy(pos, n):
k = -1
for gray in gen_gray(n):
k += 1
if k == pos:
return [x + 1 for x in range(n) if gray[x]]
|
def convert_and_sum_list_kwargs(usd_list, **kwargs):
total = 0
for amount in usd_list:
total += convert_usd_to_aud(amount, **kwargs)
return total
print(convert_and_sum_list_kwargs([1, 3], rate=0.8))
|
class SimpleGraph:
def __init__(self):
self.edges = {}
@property
def nodes(self):
return self.edges.keys()
def neighbors(self, id):
return self.edges[id]
class DFS(object):
'''
Implementation of recursive depth-first search algorithm
Note for status 0=not visited, 1=seen but not done, 2=done
'''
def __init__(self, graph):
self.graph = graph
self.status = {k:0 for k in graph.nodes}
self.predecessors = {k:None for k in graph.nodes}
self.seen = {k: 0 for k in graph.nodes}
self.done = {k: 0 for k in graph.nodes}
self.t = 0
def dfs_visit_recursive(self, s):
self.status[s] = 1
self.seen[s] = self.t
self.t += 1
neighbours = self.graph.neighbors(s)
for v in neighbours:
if self.status[v] == 0:
self.predecessors[v] = s
self.dfs_visit_recursive(v)
self.status[s] = 2
self.done[s] = self.t
self.t += 1
def search(self):
'''
Searches the graph in depth-first order
:return: dict of seen-times and done-times of nodes
'''
for node in self.graph.nodes:
if self.status[node] == 0:
self.dfs_visit_recursive(node)
return self.seen, self.done
if __name__ == '__main__':
example_graph = SimpleGraph()
example_graph.edges = {
'A': ['B'],
'B': ['A', 'C', 'D'],
'C': ['A'],
'D': ['E', 'A'],
'E': ['B']
}
print(DFS(example_graph).search())
|
#link: https://leetcode.com/problems/island-perimeter/submissions/
"""
Go through every cell on the grid and whenever you are at cell 1 (land cell), look for surrounding (UP, RIGHT, DOWN, LEFT) cells. A land cell without any surrounding land cell will have a perimeter of 4. Subtract 1 for each surrounding land cell.
"""
class Solution(object):
def islandPerimeter(self, grid):
"""
:type grid: List[List[int]]
:rtype: int
"""
rows, cols = len(grid), len(grid[0])
result = 0
for r in range(rows):
for c in range(cols):
if grid[r][c] == 1:
if r==0:
up = 0
else:
up = grid[r-1][c]
if c ==0:
left = 0
else:
left = grid[r][c-1]
if r == rows-1:
down =0
else:
down =grid[r+1][c]
if c == cols-1:
right = 0
else:
right = grid[r][c+1]
result += 4-(up+down+left+right)
return result
|
#check if it is a multiple subject
def is_multiple_subject_linked_to_subject(subject):
for child in subject.children:
if child.dep_ == "conj":
return True
return False
def is_multiple_subject_linked_to_predicate(predicate):
#this case is for personal pronoun, and not only, but much more nsubj
subjects = []
for child in predicate.children:
if child.dep_ == "nsubj":
subjects.append(child)
if len(subjects) > 1:
return True
return False
#al that are in conjunction relation
def get_multiple_predicates(root):
predicates = [root]
for child in root.children:
if child.dep_ == "conj" and has_own_subject(child) == False:
predicates.append(child)
return predicates
#because 2 sentences that are in coordinative relation will have verbs in conjunction, even if they have own subject
def has_own_subject(predicate):
for child in predicate.children:
if child.dep_ == "nsubj":
return True
return False
#adjectives that are linked with the other through conjunctions
def is_in_adjective_noun_relation(adjective):
if adjective.dep_ == "amod":
return (True, adjective.head)
if adjective.head.dep_ == "amod" and adjective.head.head.tag_[:2] == "Nc":
return (True, adjective.head.head)
return (False, None)
|
def test_getitem_fetches_delayed_array_from_index():
"""
spec['a']
"""
def test_getitem_logical_indexing_fetches_result_from_param_file():
"""
Ensure that `spec[spec['param1'] == 1]` fetches the correct delayed object from the param files
"""
def test_getitem_multidimensional_logical_indexing_fetches_result_from_param_file():
"""
Ensure that `spec[spec['param1'] == 1 | spec['param2'] == 2]` fetches the correct delayed object from the param files
"""
|
#!/usr/bin/env python
NAME = 'Imperva SecureSphere'
def is_waf(self):
# thanks to Mathieu Dessus <mathieu.dessus(a)verizonbusiness.com> for this
# might lead to false positives so please report back to [email protected]
for attack in self.attacks:
r = attack(self)
if r is None:
return
response, responsebody = r
if response.version == 10:
return True
return False
|
class Node(object):
def __init__(self, val, parent=None):
self.val = val
self.leftChild = None
self.rightChild = None
self.parent = parent
def getLeftChild(self):
return self.leftChild
def getRightChild(self):
return self.rightChild
def getParent(self):
return self.parent
def isRoot(self):
return self.parent != None
def hasLeftChild(self):
return self.leftChild != None
def hasRightChild(self):
return self.rightChild != None
def hasBothChildren(self):
return self.hasLeftChild() and self.hasRightChild()
def hasOneChild(self):
return self.hasLeftChild() or self.hasRightChild()
class BinarySearchTree(object):
def __init__(self):
self.size = 0
self.root = None
def insert(self, val):
if not self.root:
self.root = Node(val)
else:
temp = self.root
done = False
while not done:
if val < temp.val:
if temp.hasLeftChild():
temp = temp.getLeftChild()
else:
temp.leftChild = Node(val, temp)
done = True
else:
if temp.hasRightChild():
temp = temp.getRightChild()
else:
temp.rightChild = Node(val, temp)
done = True
self.size += 1
def inorder(self, root):
if root:
self.inorder(root.leftChild)
print(root.val, end=" ")
self.inorder(root.rightChild)
def level_traversal(self, root):
if not root:
return
q = [root]
while len(q) > 0:
q2 = []
for x in q:
print(x.val, end=" ")
if x.hasLeftChild():
q2.append(x.leftChild)
if x.hasRightChild():
q2.append(x.rightChild)
print()
q = q2
if __name__ == "__main__":
b = BinarySearchTree()
b.insert(25)
b.insert(15)
b.insert(8)
b.insert(20)
b.insert(17)
b.insert(16)
b.insert(18)
b.insert(40)
b.insert(35)
b.insert(46)
b.insert(42)
b.insert(50)
b.inorder(b.root)
print("Length:", b.size)
b.level_traversal(b.root)
|
"""Tests suite for pCrunch."""
__author__ = ["Jake Nunemaker", "Nikhar Abbas"]
__copyright__ = "Copyright 2020, National Renewable Energy Laboratory"
__maintainer__ = "Jake Nunemaker"
__email__ = "[email protected]"
|
class FundNameException(BaseException): pass
class FundOutFileNameException(BaseException): pass
class FundNotFoundException(BaseException): pass
class StockInformationMissingException(BaseException): pass
class StockCandleInformatinMissingException(StockInformationMissingException): pass
|
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""glyph.py: Represents a glyph for a dot matrix."""
__author__ = "Victor RENÉ"
__copyright__ = "Copyright 2014, Kivy widget library"
__license__ = "MIT"
__version__ = "1.0"
__maintainer__ = "Victor RENÉ"
__email__ = "[email protected]"
__status__ = "Production"
class Glyph(object):
def __init__(self, **kw):
if 'filename' in kw:
with open(kw['filename'], 'r') as f:
lines = f.readlines()
self.size = self.get_size(lines)
self.resize()
self.parse(lines)
if 'data' in kw:
self.size = self.get_size(kw['data'])
self.resize()
self.parse(kw['data'])
def resize(self):
self.dots = [[None for x in range(self.size[0])] \
for y in range(self.size[1])]
def get_size(self, lines):
x_max, y_max = 0, 0
x, y = 0, 0
for line in lines:
line = line.strip('\n')
for dot in line:
x += 1
x_max = max(x_max, x)
x = 0
y += 1
y_max = max(y_max, y)
return x_max, y_max
def parse(self, lines):
x, y = 0, 0
for line in lines:
line = line.strip('\n')
for dot in line:
if dot == ' ':
self.dots[y][x] = False
else:
self.dots[y][x] = True
x += 1
x = 0
y += 1
def write(self, filename):
pass
|
dp = {0:0,1:1,2:2}
class Solution:
def minDays(self, n: int) -> int:
if n in dp: return dp[n]
ans = 1 + min(n%2 + self.minDays((n-n%2)//2), n%3 + self.minDays((n-n%3)//3))
dp[n] = ans
return ans
|
class MinStack:
def __init__(self):
"""
initialize your data structure here.
"""
self.stack = list()
def push(self, x: int) -> None:
cur_min = self.getMin()
if x < cur_min:
cur_min = x
self.stack.append((x, cur_min))
def pop(self) -> None:
self.stack.pop()
def top(self) -> int:
return self.stack[-1][0]
def getMin(self) -> int:
if len(self.stack) > 0:
return self.stack[-1][1]
else:
return 2147483647
|
magicians = ['alice','david','carolina']
for magician in magicians:
print(f"{magician.title()},that was a great trick!")
for i in range(1,6):
print(i)
for j in range(6):
print(j)
numbers = list(range(1,6))
print(numbers)
even_numbers = list(range(2,11,2))
print(even_numbers)
squares = []
for value in range(1,11):
square = value ** 2
squares.append(square)
print(squares)
print(max(squares))
print(min(squares))
print(sum(numbers))
#列表解析的使用
squares = [value ** 2 for value in range(1,11)]
print(squares)
|
class ImeContext(object):
""" Contains static methods that interact directly with the IME API. """
@staticmethod
def Disable(handle):
"""
Disable(handle: IntPtr)
Disables the specified IME.
handle: A pointer to the IME to disable.
"""
pass
@staticmethod
def Enable(handle):
"""
Enable(handle: IntPtr)
Enables the specified IME.
handle: A pointer to the IME to enable.
"""
pass
@staticmethod
def GetImeMode(handle):
"""
GetImeMode(handle: IntPtr) -> ImeMode
Returns the System.Windows.Forms.ImeMode of the specified IME.
handle: A pointer to the IME to query.
Returns: The System.Windows.Forms.ImeMode of the specified IME.
"""
pass
@staticmethod
def IsOpen(handle):
"""
IsOpen(handle: IntPtr) -> bool
Returns a value that indicates whether the specified IME is open.
handle: A pointer to the IME to query.
Returns: true if the specified IME is open; otherwise,false.
"""
pass
@staticmethod
def SetImeStatus(imeMode, handle):
"""
SetImeStatus(imeMode: ImeMode,handle: IntPtr)
Sets the status of the specified IME.
imeMode: The status to set.
handle: A pointer to the IME to set status of.
"""
pass
@staticmethod
def SetOpenStatus(open, handle):
"""
SetOpenStatus(open: bool,handle: IntPtr)
Opens or closes the IME context.
open: true to open the IME or false to close it.
handle: A pointer to the IME to open or close.
"""
pass
__all__ = [
"Disable",
"Enable",
"GetImeMode",
"IsOpen",
"SetImeStatus",
"SetOpenStatus",
]
|
class Template:
def __init__(self, bot, channel):
self.bot = bot
self.channel = channel
channel.set_command("!command", self.on_command, "!command description")
def on_command(self, message):
pass
# runs when a personal message is received
# message is a dictionary containing the username, channel and message
# channel parameter in message dictionary is the bot username
def on_personal_message(self, message):
pass
# runs when a message is received in the channel
# message is a dictionary containing the username, channel and message
def on_message(self, message):
pass
# runs when a user joins the channel
# slot is an integer of the slot number joined
# username is a string of the user's username who joined
def on_join(self, username, slot):
pass
# runs when a user leaves the channel
# slot is an integer of the slot number joined
# username is a string of the user's username who joined
def on_part(self, username, slot):
pass
# runs when the match is started
def on_match_start(self):
pass
# runs when the match finishes normally
def on_match_finish(self):
pass
# runs when a match is aborted with either a command or the method channel.abort_match()
def on_match_abort(self):
pass
# runs when the host is changed
# old_host is the username of the user who had host before the change
# new_host is the username of the user who has just received host
def on_host_change(self, old_host, new_host):
pass
# runs when a user changes team
# username is the username of the user who changed team
# team is the colour of the team joined
def on_team_change(self, username, team):
pass
# runs when a user is added to a team
# username is the username of the user who changed team
# team is the colour of the team joined
def on_team_addition(self, username, team):
pass
# runs when a user changes slot
# slot is an integer of the slot number joined
# username is a string of the user's username who joined
def on_slot_change(self, username, slot):
pass
# runs when all players in the room have readied up
def on_all_players_ready(self):
pass
# runs when the beatmap is changed
# old beatmap is the previous beatmap before the change
# new_beatmap is the beatmap which hasw just been changed to
def on_beatmap_change(self, old_beatmap, new_beatmap):
pass
# runs when host enters map select
def on_changing_beatmap(self):
pass
# runs when a game room is closed
def on_room_close(self):
pass
# runs when the host is cleared
# old_host is the host prior to clearing the room
def on_clear_host(self, old_host):
pass
# runs when an enforced attribute is violated
# error contains:
# type - the type of on_rule_violation
# message - a message to explain what is going on
def on_rule_violation(self, error):
pass
|
YOUTUBE_PREVIEW = {
'url': 'https://www.youtube.com/watch?v=dQw4w9WgXcQ',
'domain': 'youtube.com',
'lastUpdated': '2021-04-09T23:28:10.364301Z',
'nextUpdate': '2021-04-10T23:28:09.016859Z',
'contentType': 'html',
'mimeType': 'text/html',
'size': 499047,
'redirected': True,
'redirectionUrl': 'https://www.youtube.com/watch?ucbcb=1&v=dQw4w9WgXcQ',
'redirectionCount': 2,
'redirectionTrail': [
'https://consent.youtube.com/m?continue=https://www.youtube.com/watch?v=dQw4w9WgXcQ&gl=NL&hl=nl&m=0&pc=yt&src=1&uxe=23983172',
'https://www.youtube.com/watch?ucbcb=1&v=dQw4w9WgXcQ'
],
'title': 'Rick Astley - Never Gonna Give You Up (Video)',
'description': 'Rick Astley\'s official music video for “Never Gonna Give You Up” Listen to..',
'name': 'RickAstleyVEVO',
'trackersDetected': True,
'icon': {
'url': 'https://cdn.peekalink.io/public/images/4a7a8f80-13e9-4d85-8f17-9ac55e5be47e/123bf9ac-d3f4-4de9-84f9-25caebca53be.jpg',
'width': 48,
'height': 48
},
'image': {
'url': 'https://cdn.peekalink.io/public/images/0efea819-54a5-4900-97c7-be7ef7b2f160/abfb9ac8-4b65-42ce-9838-aecdc60bdb46.jpe',
'width': 480,
'height': 360
},
'details': {
'type': 'youtube',
'videoId': 'dQw4w9WgXcQ',
'duration': '213.0',
'viewCount': 915578000,
'likeCount': 9182302,
'dislikeCount': 272157,
'commentCount': 1519506,
'publishedAt': '2009-10-25T06:57:33Z'
}
}
TWITTER_PREVIEW = {
'url': 'https://twitter.com/GetFlexSeal/status/1278897629221588992',
'domain': 'twitter.com',
'lastUpdated': '2021-06-27T10:59:52.101013Z',
'nextUpdate': '2021-06-28T10:59:51.844244Z',
'contentType': 'html',
'mimeType': 'text/html',
'redirected': False,
'title': 'Tweet by @Flex Seal',
'description': 'Joe',
'name': '@GetFlexSeal',
'trackersDetected': True,
'icon': {
'url': 'https://cdn.peekalink.io/public/images/23189b4b-89a9-4ea6-a5ac-e6d2245b3ed5/7c233e8b-9e4f-4e45-bddc-10ef37296ffb.jpg',
'width': 640,
'height': 640
},
'details': {
'type': 'twitter',
'statusId': '1278897629221588992',
'retweetCount': 285,
'likesCount': 2172,
'publishedAt': '2020-07-03T03:45:30Z'
}
}
GENERIC_PREVIEW = {
'url': 'https://github.com/jozsefsallai/peekalink.py',
'domain': 'github.com',
'lastUpdated': '2021-06-27T11:01:35.332629Z',
'nextUpdate': '2021-06-28T11:01:33.140360Z',
'contentType': 'html',
'mimeType': 'text/html',
'redirected': False,
'title': 'jozsefsallai/peekalink.py',
'description': 'Python API wrapper for the Peekalink link preview service - jozsefsallai/peekalink.py',
'name': 'GITHUB.COM',
'trackersDetected': True,
'icon': {
'url': 'https://cdn.peekalink.io/public/images/fa594927-5453-4c4d-9ac6-1fc59f3c6704/7effbc39-74ca-4ad9-bb27-989cba6856d0.jpg',
'width': 120,
'height': 120
},
'image': {
'url': 'https://cdn.peekalink.io/public/images/932627c9-b5cd-4de7-9741-ce34f898fbd3/cb0d2cfc-6fe7-42a1-a938-e3e7939d6e64.jpg',
'width': 640,
'height': 320
}
}
|
def setup(app):
"""Additions and customizations to Sphinx that are useful for documenting
the Salt project.
"""
app.add_crossref_type(directivename="conf_master", rolename="conf_master",
indextemplate="pair: %s; conf/master")
app.add_crossref_type(directivename="conf_minion", rolename="conf_minion",
indextemplate="pair: %s; conf/minion")
app.add_crossref_type(directivename="conf-log", rolename="conf-log",
indextemplate="pair: %s; conf/logging")
|
# -*- coding: utf-8 -*-
DEBUG = True
TESTING = True
SECRET_KEY = 'SECRET_KEY'
DATABASE_URI = 'mysql+pymysql://root:[email protected]/git_webhook'
CELERY_BROKER_URL = 'redis://:@127.0.0.1:6379/0'
CELERY_RESULT_BACKEND = 'redis://:@127.0.0.1:6379/0'
SOCKET_MESSAGE_QUEUE = 'redis://:@127.0.0.1:6379/0'
GITHUB_CLIENT_ID = '123'
GITHUB_CLIENT_SECRET = 'SECRET'
|
__title__ = 'django-activeurl'
__package_name__ = 'django_activeurl'
__version__ = '0.1.12'
__description__ = 'Easy-to-use active URL highlighting for Django'
__email__ = '[email protected]'
__author__ = 'hellysmile'
__license__ = 'Apache 2.0'
__copyright__ = 'Copyright (c) [email protected]'
|
# Copyright 2018 The Bazel Authors. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""Implementation of compilation logic for Swift."""
load(":actions.bzl", "run_toolchain_action")
load(":deps.bzl", "collect_link_libraries")
load(":derived_files.bzl", "derived_files")
load(
":providers.bzl",
"SwiftClangModuleInfo",
"SwiftInfo",
"SwiftToolchainInfo",
)
load(":utils.bzl", "collect_transitive")
load("@bazel_skylib//lib:collections.bzl", "collections")
load("@bazel_skylib//lib:paths.bzl", "paths")
# Swift compiler options that cause the code to be compiled using whole-module optimization.
_WMO_COPTS = ("-force-single-frontend-invocation", "-whole-module-optimization", "-wmo")
def collect_transitive_compile_inputs(args, deps, direct_defines = []):
"""Collect transitive inputs and flags from Swift providers.
Args:
args: An `Args` object to which
deps: The dependencies for which the inputs should be gathered.
direct_defines: The list of defines for the target being built, which are merged with the
transitive defines before they are added to `args` in order to prevent duplication.
Returns:
A list of `depset`s representing files that must be passed as inputs to the Swift
compilation action.
"""
input_depsets = []
# Collect all the search paths, module maps, flags, and so forth from transitive dependencies.
transitive_swiftmodules = collect_transitive(
deps,
SwiftInfo,
"transitive_swiftmodules",
)
args.add_all(transitive_swiftmodules, format_each = "-I%s", map_each = _dirname_map_fn)
input_depsets.append(transitive_swiftmodules)
transitive_defines = collect_transitive(
deps,
SwiftInfo,
"transitive_defines",
direct = direct_defines,
)
args.add_all(transitive_defines, format_each = "-D%s")
transitive_modulemaps = collect_transitive(
deps,
SwiftClangModuleInfo,
"transitive_modulemaps",
)
input_depsets.append(transitive_modulemaps)
args.add_all(
transitive_modulemaps,
before_each = "-Xcc",
format_each = "-fmodule-map-file=%s",
)
transitive_cc_headers = collect_transitive(
deps,
SwiftClangModuleInfo,
"transitive_headers",
)
input_depsets.append(transitive_cc_headers)
transitive_cc_compile_flags = collect_transitive(
deps,
SwiftClangModuleInfo,
"transitive_compile_flags",
)
# Handle possible spaces in these arguments correctly (for example,
# `-isystem foo`) by prepending `-Xcc` to each one.
for arg in transitive_cc_compile_flags.to_list():
args.add_all(arg.split(" "), before_each = "-Xcc")
transitive_cc_defines = collect_transitive(
deps,
SwiftClangModuleInfo,
"transitive_defines",
)
args.add_all(transitive_cc_defines, before_each = "-Xcc", format_each = "-D%s")
return input_depsets
def declare_compile_outputs(
actions,
copts,
srcs,
target_name,
index_while_building = False):
"""Declares output files (and optional output file map) for a compile action.
Args:
actions: The object used to register actions.
copts: The flags that will be passed to the compile action, which are scanned to determine
whether a single frontend invocation will be used or not.
srcs: The list of source files that will be compiled.
target_name: The name (excluding package path) of the target being built.
index_while_building: If `True`, a tree artifact will be declared to hold Clang index store
data and the relevant option will be added during compilation to generate the indexes.
Returns:
A `struct` containing the following fields:
* `args`: A list of values that should be added to the `Args` of the compile action.
* `compile_inputs`: Additional input files that should be passed to the compile action.
* `other_outputs`: Additional output files that should be declared by the compile action,
but which are not processed further.
* `output_groups`: A dictionary of additional output groups that should be propagated by
the calling rule using the `OutputGroupInfo` provider.
* `output_objects`: A list of object (.o) files that will be the result of the compile
action and which should be archived afterward.
"""
output_nature = _emitted_output_nature(copts)
if not output_nature.emits_multiple_objects:
# If we're emitting a single object, we don't use an object map; we just declare the output
# file that the compiler will generate and there are no other partial outputs.
out_obj = derived_files.whole_module_object_file(actions, target_name = target_name)
return struct(
args = ["-o", out_obj],
compile_inputs = [],
other_outputs = [],
output_groups = {},
output_objects = [out_obj],
)
# Otherwise, we need to create an output map that lists the individual object files so that we
# can pass them all to the archive action.
output_map_file = derived_files.swiftc_output_file_map(actions, target_name = target_name)
# The output map data, which is keyed by source path and will be written to `output_map_file`.
output_map = {}
# Object files that will be used to build the archive.
output_objs = []
# Additional files, such as partial Swift modules, that must be declared as action outputs
# although they are not processed further.
other_outputs = []
for src in srcs:
src_output_map = {}
# Declare the object file (there is one per source file).
obj = derived_files.intermediate_object_file(actions, target_name = target_name, src = src)
output_objs.append(obj)
src_output_map["object"] = obj.path
# Multi-threaded WMO compiles still produce a single .swiftmodule file, despite producing
# multiple object files, so we have to check explicitly for that case.
if output_nature.emits_partial_modules:
partial_module = derived_files.partial_swiftmodule(
actions,
target_name = target_name,
src = src,
)
other_outputs.append(partial_module)
src_output_map["swiftmodule"] = partial_module.path
output_map[src.path] = struct(**src_output_map)
actions.write(
content = struct(**output_map).to_json(),
output = output_map_file,
)
args = ["-output-file-map", output_map_file]
output_groups = {}
# Configure index-while-building if requested. IDEs and other indexing tools can enable this
# feature on the command line during a build and then access the index store artifacts that are
# produced.
if index_while_building:
index_store_dir = derived_files.indexstore_directory(actions, target_name = target_name)
other_outputs.append(index_store_dir)
args.extend(["-index-store-path", index_store_dir.path])
output_groups["swift_index_store"] = depset(direct = [index_store_dir])
return struct(
args = args,
compile_inputs = [output_map_file],
other_outputs = other_outputs,
output_groups = output_groups,
output_objects = output_objs,
)
def find_swift_version_copt_value(copts):
"""Returns the value of the `-swift-version` argument, if found.
Args:
copts: The list of copts to be scanned.
Returns:
The value of the `-swift-version` argument, or None if it was not found in the copt list.
"""
# Note that the argument can occur multiple times, and the last one wins.
last_swift_version = None
count = len(copts)
for i in range(count):
copt = copts[i]
if copt == "-swift-version" and i + 1 < count:
last_swift_version = copts[i + 1]
return last_swift_version
def new_objc_provider(
deps,
include_path,
link_inputs,
linkopts,
module_map,
static_archive,
swiftmodule,
objc_header = None):
"""Creates an `apple_common.Objc` provider for a Swift target.
Args:
deps: The dependencies of the target being built, whose `Objc` providers will be passed to
the new one in order to propagate the correct transitive fields.
include_path: A header search path that should be propagated to dependents.
link_inputs: Additional linker input files that should be propagated to dependents.
linkopts: Linker options that should be propagated to dependents.
module_map: The module map generated for the Swift target's Objective-C header, if any.
static_archive: The static archive (`.a` file) containing the target's compiled code.
swiftmodule: The `.swiftmodule` file for the compiled target.
objc_header: The generated Objective-C header for the Swift target. If `None`, no headers
will be propagated. This header is only needed for Swift code that defines classes that
should be exposed to Objective-C.
Returns:
An `apple_common.Objc` provider that should be returned by the calling rule.
"""
objc_providers = [dep[apple_common.Objc] for dep in deps if apple_common.Objc in dep]
objc_provider_args = {
"include": depset(direct = [include_path]),
"library": depset(direct = [static_archive]),
"link_inputs": depset(direct = [swiftmodule] + link_inputs),
"providers": objc_providers,
"uses_swift": True,
}
if objc_header:
objc_provider_args["header"] = depset(direct = [objc_header])
if linkopts:
objc_provider_args["linkopt"] = depset(direct = linkopts)
# In addition to the generated header's module map, we must re-propagate the direct deps'
# Objective-C module maps to dependents, because those Swift modules still need to see them. We
# need to construct a new transitive objc provider to get the correct strict propagation
# behavior.
transitive_objc_provider_args = {"providers": objc_providers}
if module_map:
transitive_objc_provider_args["module_map"] = depset(direct = [module_map])
transitive_objc = apple_common.new_objc_provider(**transitive_objc_provider_args)
objc_provider_args["module_map"] = transitive_objc.module_map
return apple_common.new_objc_provider(**objc_provider_args)
def objc_compile_requirements(args, deps, objc_fragment):
"""Collects compilation requirements for Objective-C dependencies.
Args:
args: An `Args` object to which compile options will be added.
deps: The `deps` of the target being built.
objc_fragment: The `objc` configuration fragment.
Returns:
A `depset` of files that should be included among the inputs of the compile action.
"""
defines = []
includes = []
inputs = []
module_maps = []
static_frameworks = []
all_frameworks = []
objc_providers = [dep[apple_common.Objc] for dep in deps if apple_common.Objc in dep]
for objc in objc_providers:
inputs.append(objc.header)
inputs.append(objc.umbrella_header)
inputs.append(objc.static_framework_file)
inputs.append(objc.dynamic_framework_file)
defines.append(objc.define)
includes.append(objc.include)
static_frameworks.append(objc.framework_dir)
all_frameworks.append(objc.framework_dir)
all_frameworks.append(objc.dynamic_framework_dir)
# Collect module maps for dependencies. These must be pulled from a combined transitive
# provider to get the correct strict propagation behavior that we use to workaround command-line
# length issues until Swift 4.2 is available.
transitive_objc_provider = apple_common.new_objc_provider(providers = objc_providers)
module_maps = transitive_objc_provider.module_map
inputs.append(module_maps)
# Add the objc dependencies' header search paths so that imported modules can find their
# headers.
args.add_all(depset(transitive = includes), format_each = "-I%s")
# Add framework search paths for any Objective-C frameworks propagated through static/dynamic
# framework provider keys.
args.add_all(
depset(transitive = all_frameworks),
format_each = "-F%s",
map_each = paths.dirname,
)
# Disable the `LC_LINKER_OPTION` load commands for static framework automatic linking. This is
# needed to correctly deduplicate static frameworks from also being linked into test binaries
# where it is also linked into the app binary. TODO(allevato): Update this to not expand the
# depset once `Args.add` supports returning multiple elements from a `map_fn`.
for framework in depset(transitive = static_frameworks).to_list():
args.add_all(collections.before_each(
"-Xfrontend",
[
"-disable-autolink-framework",
_objc_provider_framework_name(framework),
],
))
# Swift's ClangImporter does not include the current directory by default in its search paths,
# so we must add it to find workspace-relative imports in headers imported by module maps.
args.add_all(["-Xcc", "-iquote."])
# Ensure that headers imported by Swift modules have the correct defines propagated from
# dependencies.
args.add_all(depset(transitive = defines), before_each = "-Xcc", format_each = "-D%s")
# Load module maps explicitly instead of letting Clang discover them in the search paths. This
# is needed to avoid a case where Clang may load the same header in modular and non-modular
# contexts, leading to duplicate definitions in the same file.
# <https://llvm.org/bugs/show_bug.cgi?id=19501>
args.add_all(module_maps, before_each = "-Xcc", format_each = "-fmodule-map-file=%s")
# Add any copts required by the `objc` configuration fragment.
args.add_all(_clang_copts(objc_fragment), before_each = "-Xcc")
return depset(transitive = inputs)
def register_autolink_extract_action(
actions,
objects,
output,
toolchain):
"""Extracts autolink information from Swift `.o` files.
For some platforms (such as Linux), autolinking of imported frameworks is achieved by extracting
the information about which libraries are needed from the `.o` files and producing a text file
with the necessary linker flags. That file can then be passed to the linker as a response file
(i.e., `@flags.txt`).
Args:
actions: The object used to register actions.
objects: The list of object files whose autolink information will be extracted.
output: A `File` into which the autolink information will be written.
toolchain: The `SwiftToolchainInfo` provider of the toolchain.
"""
tool_args = actions.args()
tool_args.add_all(objects)
tool_args.add("-o", output)
run_toolchain_action(
actions = actions,
toolchain = toolchain,
arguments = [tool_args],
executable = "swift-autolink-extract",
inputs = objects,
mnemonic = "SwiftAutolinkExtract",
outputs = [output],
)
def swift_library_output_map(name, module_link_name):
"""Returns the dictionary of implicit outputs for a `swift_library`.
This function is used to specify the `outputs` of the `swift_library` rule; as such, its
arguments must be named exactly the same as the attributes to which they refer.
Args:
name: The name of the target being built.
module_link_name: The module link name of the target being built.
Returns:
The implicit outputs dictionary for a `swift_library`.
"""
lib_name = module_link_name if module_link_name else name
return {
"archive": "lib{}.a".format(lib_name),
}
def write_objc_header_module_map(
actions,
module_name,
objc_header,
output):
"""Writes a module map for a generated Swift header to a file.
Args:
actions: The context's actions object.
module_name: The name of the Swift module.
objc_header: The `File` representing the generated header.
output: The `File` to which the module map should be written.
"""
actions.write(
content = ('module "{module_name}" {{\n' +
' header "../{header_name}"\n' +
"}}\n").format(
header_name = objc_header.basename,
module_name = module_name,
),
output = output,
)
def _clang_copts(objc_fragment):
"""Returns copts that should be passed to `clang` from the `objc` fragment.
Args:
objc_fragment: The `objc` configuration fragment.
Returns:
A list of `clang` copts.
"""
# In general, every compilation mode flag from native `objc_*` rules should be passed, but `-g`
# seems to break Clang module compilation. Since this flag does not make much sense for module
# compilation and only touches headers, it's ok to omit.
clang_copts = objc_fragment.copts + objc_fragment.copts_for_current_compilation_mode
return [copt for copt in clang_copts if copt != "-g"]
def _dirname_map_fn(f):
"""Returns the dir name of a file.
This function is intended to be used as a mapping function for file passed into `Args.add`.
Args:
f: The file.
Returns:
The dirname of the file.
"""
return f.dirname
def _emitted_output_nature(copts):
"""Returns a `struct` with information about the nature of emitted outputs for the given flags.
The compiler emits a single object if it is invoked with whole-module optimization enabled and
is single-threaded (`-num-threads` is not present or is equal to 1); otherwise, it emits one
object file per source file. It also emits a single `.swiftmodule` file for WMO builds,
_regardless of thread count,_ so we have to treat that case separately.
Args:
copts: The options passed into the compile action.
Returns:
A struct containing the following fields:
* `emits_multiple_objects`: `True` if the Swift frontend emits an object file per source
file, instead of a single object file for the whole module, in a compilation action with
the given flags.
* `emits_partial_modules`: `True` if the Swift frontend emits partial `.swiftmodule` files
for the individual source files in a compilation action with the given flags.
"""
is_wmo = False
saw_space_separated_num_threads = False
num_threads = 1
for copt in copts:
if copt in _WMO_COPTS:
is_wmo = True
elif saw_space_separated_num_threads:
saw_space_separated_num_threads = False
num_threads = _safe_int(copt)
elif copt == "-num-threads":
saw_space_separated_num_threads = True
elif copt.startswith("-num-threads="):
num_threads = _safe_int(copt.split("=")[1])
if not num_threads:
fail("The value of '-num-threads' must be a positive integer.")
return struct(
emits_multiple_objects = not (is_wmo and num_threads == 1),
emits_partial_modules = not is_wmo,
)
def _safe_int(s):
"""Returns the integer value of `s` when interpreted as base 10, or `None` if it is invalid.
This function is needed because `int()` fails the build when passed a string that isn't a valid
integer, with no way to recover (https://github.com/bazelbuild/bazel/issues/5940).
Args:
s: The string to be converted to an integer.
Returns:
The integer value of `s`, or `None` if was not a valid base 10 integer.
"""
for i in range(len(s)):
if s[i] < "0" or s[i] > "9":
return None
return int(s)
def _objc_provider_framework_name(path):
"""Returns the name of the framework from an `objc` provider path.
Args:
path: A path that came from an `objc` provider.
Returns:
A string containing the name of the framework (e.g., `Foo` for `Foo.framework`).
"""
return path.rpartition("/")[2].partition(".")[0]
|
"""Sample Configuration
The bot doesn't actually read sample-config.py; it reads config.py instead.
So you need to copy this file to config.py then make your local changes there.
(The reason for this extra step is to make it harder for me to accidentally
check in private information like server names or passwords.)
"""
# The bot's IRC nick
nickname = "blahblahblahbot"
# Hostname of the IRC server. For now, only one.
serverhost = "irc.example.com"
# Port of the IRC server. For now, only one.
serverport = 6667
# List of IRC channels to watch
channels = ["#bottest"]
# List of bot admins. For now, admins are global not per-channel.
admins = ["dripton"]
# SQLite 3 database path.
sqlite_path = "/var/tmp/blahblahblahbot.db"
|
#
# PySNMP MIB module AT-ISDN-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/AT-ISDN-MIB
# Produced by pysmi-0.3.4 at Mon Apr 29 17:14:15 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")
ConstraintsUnion, SingleValueConstraint, ValueRangeConstraint, ConstraintsIntersection, ValueSizeConstraint = mibBuilder.importSymbols("ASN1-REFINEMENT", "ConstraintsUnion", "SingleValueConstraint", "ValueRangeConstraint", "ConstraintsIntersection", "ValueSizeConstraint")
modules, DisplayStringUnsized = mibBuilder.importSymbols("AT-SMI-MIB", "modules", "DisplayStringUnsized")
ifIndex, InterfaceIndexOrZero = mibBuilder.importSymbols("IF-MIB", "ifIndex", "InterfaceIndexOrZero")
ModuleCompliance, NotificationGroup = mibBuilder.importSymbols("SNMPv2-CONF", "ModuleCompliance", "NotificationGroup")
Counter32, ObjectIdentity, IpAddress, Gauge32, Integer32, MibIdentifier, ModuleIdentity, iso, Unsigned32, TimeTicks, Bits, NotificationType, Counter64, MibScalar, MibTable, MibTableRow, MibTableColumn = mibBuilder.importSymbols("SNMPv2-SMI", "Counter32", "ObjectIdentity", "IpAddress", "Gauge32", "Integer32", "MibIdentifier", "ModuleIdentity", "iso", "Unsigned32", "TimeTicks", "Bits", "NotificationType", "Counter64", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn")
TruthValue, TextualConvention, DisplayString = mibBuilder.importSymbols("SNMPv2-TC", "TruthValue", "TextualConvention", "DisplayString")
cc = ModuleIdentity((1, 3, 6, 1, 4, 1, 207, 8, 4, 4, 4, 37))
cc.setRevisions(('2006-06-28 12:22',))
if mibBuilder.loadTexts: cc.setLastUpdated('200606281222Z')
if mibBuilder.loadTexts: cc.setOrganization('Allied Telesis, Inc')
ccDetailsTable = MibTable((1, 3, 6, 1, 4, 1, 207, 8, 4, 4, 4, 37, 1), )
if mibBuilder.loadTexts: ccDetailsTable.setStatus('current')
ccDetailsEntry = MibTableRow((1, 3, 6, 1, 4, 1, 207, 8, 4, 4, 4, 37, 1, 1), ).setIndexNames((0, "AT-ISDN-MIB", "ccDetailsIndex"))
if mibBuilder.loadTexts: ccDetailsEntry.setStatus('current')
ccDetailsIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 4, 4, 4, 37, 1, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 128))).setMaxAccess("readonly")
if mibBuilder.loadTexts: ccDetailsIndex.setStatus('current')
ccDetailsName = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 4, 4, 4, 37, 1, 1, 2), DisplayStringUnsized().subtype(subtypeSpec=ValueSizeConstraint(0, 15))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: ccDetailsName.setStatus('current')
ccDetailsRemoteName = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 4, 4, 4, 37, 1, 1, 3), DisplayStringUnsized().subtype(subtypeSpec=ValueSizeConstraint(0, 15))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: ccDetailsRemoteName.setStatus('current')
ccDetailsCalledNumber = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 4, 4, 4, 37, 1, 1, 4), DisplayStringUnsized().subtype(subtypeSpec=ValueSizeConstraint(0, 31))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: ccDetailsCalledNumber.setStatus('current')
ccDetailsCallingNumber = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 4, 4, 4, 37, 1, 1, 5), DisplayStringUnsized().subtype(subtypeSpec=ValueSizeConstraint(0, 31))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: ccDetailsCallingNumber.setStatus('current')
ccDetailsAlternateNumber = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 4, 4, 4, 37, 1, 1, 6), DisplayStringUnsized().subtype(subtypeSpec=ValueSizeConstraint(0, 31))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: ccDetailsAlternateNumber.setStatus('current')
ccDetailsEnabled = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 4, 4, 4, 37, 1, 1, 7), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("disabled", 1), ("enabled", 2))).clone('enabled')).setMaxAccess("readwrite")
if mibBuilder.loadTexts: ccDetailsEnabled.setStatus('current')
ccDetailsDirection = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 4, 4, 4, 37, 1, 1, 8), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("inOnly", 1), ("outOnly", 2), ("both", 3))).clone('both')).setMaxAccess("readwrite")
if mibBuilder.loadTexts: ccDetailsDirection.setStatus('current')
ccDetailsPrecedence = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 4, 4, 4, 37, 1, 1, 9), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("in", 1), ("out", 2)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: ccDetailsPrecedence.setStatus('current')
ccDetailsHoldupTime = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 4, 4, 4, 37, 1, 1, 10), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 7200))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: ccDetailsHoldupTime.setStatus('current')
ccDetailsPreferredIfIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 4, 4, 4, 37, 1, 1, 11), InterfaceIndexOrZero()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: ccDetailsPreferredIfIndex.setStatus('current')
ccDetailsRequiredIfIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 4, 4, 4, 37, 1, 1, 12), InterfaceIndexOrZero()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: ccDetailsRequiredIfIndex.setStatus('current')
ccDetailsPriority = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 4, 4, 4, 37, 1, 1, 13), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 99)).clone(50)).setMaxAccess("readwrite")
if mibBuilder.loadTexts: ccDetailsPriority.setStatus('current')
ccDetailsRetryT1 = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 4, 4, 4, 37, 1, 1, 14), Integer32().subtype(subtypeSpec=ValueRangeConstraint(5, 120)).clone(30)).setMaxAccess("readwrite")
if mibBuilder.loadTexts: ccDetailsRetryT1.setStatus('current')
ccDetailsRetryN1 = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 4, 4, 4, 37, 1, 1, 15), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 10))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: ccDetailsRetryN1.setStatus('current')
ccDetailsRetryT2 = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 4, 4, 4, 37, 1, 1, 16), Integer32().subtype(subtypeSpec=ValueRangeConstraint(300, 1200)).clone(600)).setMaxAccess("readwrite")
if mibBuilder.loadTexts: ccDetailsRetryT2.setStatus('current')
ccDetailsRetryN2 = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 4, 4, 4, 37, 1, 1, 17), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 5))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: ccDetailsRetryN2.setStatus('current')
ccDetailsKeepup = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 4, 4, 4, 37, 1, 1, 18), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("no", 1), ("yes", 2))).clone('no')).setMaxAccess("readwrite")
if mibBuilder.loadTexts: ccDetailsKeepup.setStatus('current')
ccDetailsOutSetupCli = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 4, 4, 4, 37, 1, 1, 19), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4))).clone(namedValues=NamedValues(("off", 1), ("calling", 2), ("interface", 3), ("nonumber", 4))).clone('off')).setMaxAccess("readwrite")
if mibBuilder.loadTexts: ccDetailsOutSetupCli.setStatus('current')
ccDetailsOutSetupUser = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 4, 4, 4, 37, 1, 1, 20), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("off", 1), ("local", 2), ("remote", 3))).clone('off')).setMaxAccess("readwrite")
if mibBuilder.loadTexts: ccDetailsOutSetupUser.setStatus('current')
ccDetailsOutSetupCalledSub = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 4, 4, 4, 37, 1, 1, 21), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("off", 1), ("local", 2), ("remote", 3))).clone('off')).setMaxAccess("readwrite")
if mibBuilder.loadTexts: ccDetailsOutSetupCalledSub.setStatus('current')
ccDetailsOutSubaddress = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 4, 4, 4, 37, 1, 1, 22), DisplayStringUnsized().subtype(subtypeSpec=ValueSizeConstraint(0, 31))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: ccDetailsOutSubaddress.setStatus('current')
ccDetailsCallback = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 4, 4, 4, 37, 1, 1, 23), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("no", 1), ("yes", 2))).clone('no')).setMaxAccess("readwrite")
if mibBuilder.loadTexts: ccDetailsCallback.setStatus('current')
ccDetailsCallbackDelay = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 4, 4, 4, 37, 1, 1, 24), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 100)).clone(41)).setMaxAccess("readwrite")
if mibBuilder.loadTexts: ccDetailsCallbackDelay.setStatus('current')
ccDetailsInSetupCalledSubSearch = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 4, 4, 4, 37, 1, 1, 25), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("off", 1), ("local", 2), ("remote", 3))).clone('off')).setMaxAccess("readwrite")
if mibBuilder.loadTexts: ccDetailsInSetupCalledSubSearch.setStatus('current')
ccDetailsInSetupUserSearch = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 4, 4, 4, 37, 1, 1, 26), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("off", 1), ("local", 2), ("remote", 3))).clone('off')).setMaxAccess("readwrite")
if mibBuilder.loadTexts: ccDetailsInSetupUserSearch.setStatus('current')
ccDetailsInSetupCliSearch = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 4, 4, 4, 37, 1, 1, 27), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("off", 1), ("on", 2), ("list", 3))).clone('off')).setMaxAccess("readwrite")
if mibBuilder.loadTexts: ccDetailsInSetupCliSearch.setStatus('current')
ccDetailsInSetupCliSearchList = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 4, 4, 4, 37, 1, 1, 28), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 100))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: ccDetailsInSetupCliSearchList.setStatus('current')
ccDetailsInAnyFlag = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 4, 4, 4, 37, 1, 1, 29), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("no", 1), ("yes", 2))).clone('no')).setMaxAccess("readwrite")
if mibBuilder.loadTexts: ccDetailsInAnyFlag.setStatus('current')
ccDetailsInSetupCalledSubCheck = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 4, 4, 4, 37, 1, 1, 30), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("off", 1), ("local", 2), ("remote", 3))).clone('off')).setMaxAccess("readwrite")
if mibBuilder.loadTexts: ccDetailsInSetupCalledSubCheck.setStatus('current')
ccDetailsInSetupUserCheck = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 4, 4, 4, 37, 1, 1, 31), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("off", 1), ("local", 2), ("remote", 3))).clone('off')).setMaxAccess("readwrite")
if mibBuilder.loadTexts: ccDetailsInSetupUserCheck.setStatus('current')
ccDetailsInSetupCliCheck = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 4, 4, 4, 37, 1, 1, 32), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("off", 1), ("present", 2), ("required", 3))).clone('off')).setMaxAccess("readwrite")
if mibBuilder.loadTexts: ccDetailsInSetupCliCheck.setStatus('current')
ccDetailsInSetupCliCheckList = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 4, 4, 4, 37, 1, 1, 33), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 100))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: ccDetailsInSetupCliCheckList.setStatus('current')
ccDetailsUserType = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 4, 4, 4, 37, 1, 1, 34), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("attach", 1), ("ppp", 2))).clone('attach')).setMaxAccess("readwrite")
if mibBuilder.loadTexts: ccDetailsUserType.setStatus('current')
ccDetailsLoginType = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 4, 4, 4, 37, 1, 1, 35), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6, 7, 8))).clone(namedValues=NamedValues(("none", 1), ("userdb", 2), ("radius", 3), ("papTacacs", 4), ("chap", 5), ("papRadius", 6), ("tacacs", 7), ("all", 8))).clone('none')).setMaxAccess("readwrite")
if mibBuilder.loadTexts: ccDetailsLoginType.setStatus('current')
ccDetailsUsername = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 4, 4, 4, 37, 1, 1, 36), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5))).clone(namedValues=NamedValues(("none", 1), ("cli", 2), ("calledsub", 3), ("useruser", 4), ("callname", 5))).clone('none')).setMaxAccess("readwrite")
if mibBuilder.loadTexts: ccDetailsUsername.setStatus('current')
ccDetailsPassword = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 4, 4, 4, 37, 1, 1, 37), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5))).clone(namedValues=NamedValues(("none", 1), ("cli", 2), ("calledsub", 3), ("useruser", 4), ("callname", 5))).clone('none')).setMaxAccess("readwrite")
if mibBuilder.loadTexts: ccDetailsPassword.setStatus('current')
ccDetailsBumpDelay = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 4, 4, 4, 37, 1, 1, 38), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 100)).clone(5)).setMaxAccess("readwrite")
if mibBuilder.loadTexts: ccDetailsBumpDelay.setStatus('current')
ccDetailsDataRate = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 4, 4, 4, 37, 1, 1, 39), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("rate-64k", 1), ("rate-56k", 2))).clone('rate-64k')).setMaxAccess("readwrite")
if mibBuilder.loadTexts: ccDetailsDataRate.setStatus('current')
ccDetailsPppTemplate = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 4, 4, 4, 37, 1, 1, 40), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 33)).clone(33)).setMaxAccess("readwrite")
if mibBuilder.loadTexts: ccDetailsPppTemplate.setStatus('current')
ccDetailsUserModule = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 4, 4, 4, 37, 1, 1, 41), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ccDetailsUserModule.setStatus('current')
ccDetailsNumberAttachments = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 4, 4, 4, 37, 1, 1, 42), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ccDetailsNumberAttachments.setStatus('current')
ccCliListTable = MibTable((1, 3, 6, 1, 4, 1, 207, 8, 4, 4, 4, 37, 2), )
if mibBuilder.loadTexts: ccCliListTable.setStatus('current')
ccCliListEntry = MibTableRow((1, 3, 6, 1, 4, 1, 207, 8, 4, 4, 4, 37, 2, 1), ).setIndexNames((0, "AT-ISDN-MIB", "ccCliListListIndex"), (0, "AT-ISDN-MIB", "ccCliListEntryIndex"))
if mibBuilder.loadTexts: ccCliListEntry.setStatus('current')
ccCliListListIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 4, 4, 4, 37, 2, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 100))).setMaxAccess("readonly")
if mibBuilder.loadTexts: ccCliListListIndex.setStatus('current')
ccCliListEntryIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 4, 4, 4, 37, 2, 1, 2), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ccCliListEntryIndex.setStatus('current')
ccCliListNumber = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 4, 4, 4, 37, 2, 1, 3), DisplayStringUnsized().subtype(subtypeSpec=ValueSizeConstraint(0, 31))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: ccCliListNumber.setStatus('current')
ccActiveCallTable = MibTable((1, 3, 6, 1, 4, 1, 207, 8, 4, 4, 4, 37, 3), )
if mibBuilder.loadTexts: ccActiveCallTable.setStatus('current')
ccActiveCallEntry = MibTableRow((1, 3, 6, 1, 4, 1, 207, 8, 4, 4, 4, 37, 3, 1), ).setIndexNames((0, "AT-ISDN-MIB", "ccActiveCallIndex"))
if mibBuilder.loadTexts: ccActiveCallEntry.setStatus('current')
ccActiveCallIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 4, 4, 4, 37, 3, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 128))).setMaxAccess("readonly")
if mibBuilder.loadTexts: ccActiveCallIndex.setStatus('current')
ccActiveCallDetailsIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 4, 4, 4, 37, 3, 1, 2), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 128))).setMaxAccess("readonly")
if mibBuilder.loadTexts: ccActiveCallDetailsIndex.setStatus('current')
ccActiveCallIfIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 4, 4, 4, 37, 3, 1, 3), InterfaceIndexOrZero()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ccActiveCallIfIndex.setStatus('current')
ccActiveCallDataRate = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 4, 4, 4, 37, 3, 1, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("rate-64k", 1), ("rate-56k", 2)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: ccActiveCallDataRate.setStatus('current')
ccActiveCallState = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 4, 4, 4, 37, 3, 1, 5), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6))).clone(namedValues=NamedValues(("null", 1), ("off", 2), ("try", 3), ("on", 4), ("wait", 5), ("await1", 6)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: ccActiveCallState.setStatus('current')
ccActiveCallDirection = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 4, 4, 4, 37, 3, 1, 6), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("in", 1), ("out", 2), ("undefined", 3)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: ccActiveCallDirection.setStatus('current')
ccActiveCallUserModule = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 4, 4, 4, 37, 3, 1, 7), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ccActiveCallUserModule.setStatus('current')
ccActiveCallUserInstance = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 4, 4, 4, 37, 3, 1, 8), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ccActiveCallUserInstance.setStatus('current')
ccActiveCallBchannelIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 4, 4, 4, 37, 3, 1, 9), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 31))).setMaxAccess("readonly")
if mibBuilder.loadTexts: ccActiveCallBchannelIndex.setStatus('current')
ccCallLogTable = MibTable((1, 3, 6, 1, 4, 1, 207, 8, 4, 4, 4, 37, 4), )
if mibBuilder.loadTexts: ccCallLogTable.setStatus('current')
ccCallLogEntry = MibTableRow((1, 3, 6, 1, 4, 1, 207, 8, 4, 4, 4, 37, 4, 1), ).setIndexNames((0, "AT-ISDN-MIB", "ccCallLogIndex"))
if mibBuilder.loadTexts: ccCallLogEntry.setStatus('current')
ccCallLogIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 4, 4, 4, 37, 4, 1, 1), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ccCallLogIndex.setStatus('current')
ccCallLogName = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 4, 4, 4, 37, 4, 1, 2), DisplayString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ccCallLogName.setStatus('current')
ccCallLogState = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 4, 4, 4, 37, 4, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4))).clone(namedValues=NamedValues(("initial", 1), ("active", 2), ("disconnected", 3), ("cleared", 4)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: ccCallLogState.setStatus('current')
ccCallLogTimeStarted = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 4, 4, 4, 37, 4, 1, 4), DisplayString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ccCallLogTimeStarted.setStatus('current')
ccCallLogDirection = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 4, 4, 4, 37, 4, 1, 5), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("in", 1), ("out", 2)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: ccCallLogDirection.setStatus('current')
ccCallLogDuration = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 4, 4, 4, 37, 4, 1, 6), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ccCallLogDuration.setStatus('current')
ccCallLogRemoteNumber = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 4, 4, 4, 37, 4, 1, 7), DisplayString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ccCallLogRemoteNumber.setStatus('current')
ccAttachmentTable = MibTable((1, 3, 6, 1, 4, 1, 207, 8, 4, 4, 4, 37, 5), )
if mibBuilder.loadTexts: ccAttachmentTable.setStatus('current')
ccAttachmentEntry = MibTableRow((1, 3, 6, 1, 4, 1, 207, 8, 4, 4, 4, 37, 5, 1), ).setIndexNames((0, "AT-ISDN-MIB", "ccAttachmentDetailsIndex"), (0, "AT-ISDN-MIB", "ccAttachmentEntryIndex"))
if mibBuilder.loadTexts: ccAttachmentEntry.setStatus('current')
ccAttachmentDetailsIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 4, 4, 4, 37, 5, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 128))).setMaxAccess("readonly")
if mibBuilder.loadTexts: ccAttachmentDetailsIndex.setStatus('current')
ccAttachmentEntryIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 4, 4, 4, 37, 5, 1, 2), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ccAttachmentEntryIndex.setStatus('current')
ccAttachmentActiveCallIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 4, 4, 4, 37, 5, 1, 3), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 128))).setMaxAccess("readonly")
if mibBuilder.loadTexts: ccAttachmentActiveCallIndex.setStatus('current')
ccAttachmentUserInstance = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 4, 4, 4, 37, 5, 1, 4), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ccAttachmentUserInstance.setStatus('current')
ccBchannelTable = MibTable((1, 3, 6, 1, 4, 1, 207, 8, 4, 4, 4, 37, 6), )
if mibBuilder.loadTexts: ccBchannelTable.setStatus('current')
ccBchannelEntry = MibTableRow((1, 3, 6, 1, 4, 1, 207, 8, 4, 4, 4, 37, 6, 1), ).setIndexNames((0, "AT-ISDN-MIB", "ccBchannelIfIndex"), (0, "AT-ISDN-MIB", "ccBchannelChannelIndex"))
if mibBuilder.loadTexts: ccBchannelEntry.setStatus('current')
ccBchannelIfIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 4, 4, 4, 37, 6, 1, 1), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ccBchannelIfIndex.setStatus('current')
ccBchannelChannelIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 4, 4, 4, 37, 6, 1, 2), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 31))).setMaxAccess("readonly")
if mibBuilder.loadTexts: ccBchannelChannelIndex.setStatus('current')
ccBchannelAllocated = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 4, 4, 4, 37, 6, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("no", 1), ("yes", 2)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: ccBchannelAllocated.setStatus('current')
ccBchannelCallType = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 4, 4, 4, 37, 6, 1, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4))).clone(namedValues=NamedValues(("undefined", 1), ("data", 2), ("voice", 3), ("x25", 4)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: ccBchannelCallType.setStatus('current')
ccBchannelActiveCallIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 4, 4, 4, 37, 6, 1, 5), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 128))).setMaxAccess("readonly")
if mibBuilder.loadTexts: ccBchannelActiveCallIndex.setStatus('current')
ccBchannelPriority = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 4, 4, 4, 37, 6, 1, 6), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ccBchannelPriority.setStatus('current')
ccBchannelDirection = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 4, 4, 4, 37, 6, 1, 7), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("in", 1), ("out", 2), ("unallocated", 3)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: ccBchannelDirection.setStatus('current')
mibBuilder.exportSymbols("AT-ISDN-MIB", ccActiveCallDirection=ccActiveCallDirection, ccBchannelIfIndex=ccBchannelIfIndex, ccDetailsInAnyFlag=ccDetailsInAnyFlag, ccDetailsCalledNumber=ccDetailsCalledNumber, ccCliListTable=ccCliListTable, ccDetailsPriority=ccDetailsPriority, ccActiveCallDataRate=ccActiveCallDataRate, ccDetailsPreferredIfIndex=ccDetailsPreferredIfIndex, ccActiveCallUserInstance=ccActiveCallUserInstance, ccDetailsEnabled=ccDetailsEnabled, ccCallLogIndex=ccCallLogIndex, ccDetailsEntry=ccDetailsEntry, ccDetailsRequiredIfIndex=ccDetailsRequiredIfIndex, ccCallLogDirection=ccCallLogDirection, ccCliListEntryIndex=ccCliListEntryIndex, ccDetailsTable=ccDetailsTable, ccDetailsOutSetupCli=ccDetailsOutSetupCli, ccCallLogTable=ccCallLogTable, ccDetailsPassword=ccDetailsPassword, ccCallLogDuration=ccCallLogDuration, ccBchannelChannelIndex=ccBchannelChannelIndex, ccActiveCallUserModule=ccActiveCallUserModule, ccAttachmentTable=ccAttachmentTable, ccBchannelPriority=ccBchannelPriority, ccAttachmentEntry=ccAttachmentEntry, ccAttachmentEntryIndex=ccAttachmentEntryIndex, ccBchannelCallType=ccBchannelCallType, ccDetailsCallback=ccDetailsCallback, ccAttachmentActiveCallIndex=ccAttachmentActiveCallIndex, ccDetailsInSetupCliCheck=ccDetailsInSetupCliCheck, ccCallLogName=ccCallLogName, ccCliListEntry=ccCliListEntry, ccDetailsCallingNumber=ccDetailsCallingNumber, ccAttachmentDetailsIndex=ccAttachmentDetailsIndex, ccDetailsName=ccDetailsName, ccActiveCallEntry=ccActiveCallEntry, ccDetailsOutSubaddress=ccDetailsOutSubaddress, ccCliListNumber=ccCliListNumber, ccDetailsRetryN1=ccDetailsRetryN1, ccCallLogRemoteNumber=ccCallLogRemoteNumber, ccBchannelActiveCallIndex=ccBchannelActiveCallIndex, ccDetailsOutSetupCalledSub=ccDetailsOutSetupCalledSub, ccActiveCallState=ccActiveCallState, ccDetailsUserType=ccDetailsUserType, ccDetailsRetryN2=ccDetailsRetryN2, ccDetailsKeepup=ccDetailsKeepup, ccDetailsDataRate=ccDetailsDataRate, ccDetailsAlternateNumber=ccDetailsAlternateNumber, ccDetailsRetryT2=ccDetailsRetryT2, ccDetailsRetryT1=ccDetailsRetryT1, ccDetailsInSetupUserCheck=ccDetailsInSetupUserCheck, ccActiveCallBchannelIndex=ccActiveCallBchannelIndex, ccActiveCallIfIndex=ccActiveCallIfIndex, ccDetailsInSetupCliSearchList=ccDetailsInSetupCliSearchList, ccDetailsRemoteName=ccDetailsRemoteName, ccCallLogState=ccCallLogState, ccDetailsOutSetupUser=ccDetailsOutSetupUser, ccBchannelEntry=ccBchannelEntry, ccDetailsLoginType=ccDetailsLoginType, ccDetailsPrecedence=ccDetailsPrecedence, ccActiveCallDetailsIndex=ccActiveCallDetailsIndex, ccDetailsCallbackDelay=ccDetailsCallbackDelay, ccActiveCallIndex=ccActiveCallIndex, ccBchannelTable=ccBchannelTable, ccDetailsInSetupCliCheckList=ccDetailsInSetupCliCheckList, ccDetailsInSetupCalledSubSearch=ccDetailsInSetupCalledSubSearch, ccDetailsInSetupCliSearch=ccDetailsInSetupCliSearch, ccBchannelDirection=ccBchannelDirection, ccBchannelAllocated=ccBchannelAllocated, ccAttachmentUserInstance=ccAttachmentUserInstance, ccDetailsUsername=ccDetailsUsername, ccDetailsHoldupTime=ccDetailsHoldupTime, ccDetailsBumpDelay=ccDetailsBumpDelay, ccCallLogEntry=ccCallLogEntry, ccDetailsNumberAttachments=ccDetailsNumberAttachments, ccDetailsInSetupCalledSubCheck=ccDetailsInSetupCalledSubCheck, ccCliListListIndex=ccCliListListIndex, ccDetailsUserModule=ccDetailsUserModule, ccActiveCallTable=ccActiveCallTable, ccCallLogTimeStarted=ccCallLogTimeStarted, PYSNMP_MODULE_ID=cc, ccDetailsIndex=ccDetailsIndex, ccDetailsDirection=ccDetailsDirection, ccDetailsInSetupUserSearch=ccDetailsInSetupUserSearch, ccDetailsPppTemplate=ccDetailsPppTemplate, cc=cc)
|
# Compound Interest
P = float(input('Enter principal amount: $'))
r = float(input('Enter annual interest rate %'))
n = float(input('Enter number of times per year interest has compounded: '))
t = float(
input('Enter number of years account will be left to earn interest: '))
r /= 100 # 50% = .50
A = P * ((1 + (r / n)) ** (n * t))
print('After ', t, ' years, $', format(A, ',.2f'), ' will be in the account. ',
sep='')
|
#coding: utf-8
# Copyright 2005-2010 Wesabe, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# ofx.validators - Classes to validate certain financial data types.
#
class RoutingNumber:
def __init__(self, number):
self.number = number
# FIXME: need to make sure we're really getting a number and not any non-number characters.
try:
self.digits = [int(digit) for digit in str(self.number).strip()]
self.region_code = int(str(self.digits[0]) + str(self.digits[1]))
self.converted = True
except ValueError:
# Not a number, failed to convert
self.digits = None
self.region_code = None
self.converted = False
def is_valid(self):
if self.converted is False or len(self.digits) != 9:
return False
checksum = ((self.digits[0] * 3) +
(self.digits[1] * 7) +
self.digits[2] +
(self.digits[3] * 3) +
(self.digits[4] * 7) +
self.digits[5] +
(self.digits[6] * 3) +
(self.digits[7] * 7) +
self.digits[8] )
return (checksum % 10 == 0)
def get_type(self):
# Remember that range() stops one short of the second argument.
# In other words, "x in range(1, 13)" means "x >= 1 and x < 13".
if self.region_code == 0:
return "United States Government"
elif self.region_code in range(1, 13):
return "Primary"
elif self.region_code in range(21, 33):
return "Thrift"
elif self.region_code in range(61, 73):
return "Electronic"
elif self.region_code == 80:
return "Traveller's Cheque"
else:
return None
def get_region(self):
if self.region_code == 0:
return "United States Government"
elif self.region_code in [1, 21, 61]:
return "Boston"
elif self.region_code in [2, 22, 62]:
return "New York"
elif self.region_code in [3, 23, 63]:
return "Philadelphia"
elif self.region_code in [4, 24, 64]:
return "Cleveland"
elif self.region_code in [5, 25, 65]:
return "Richmond"
elif self.region_code in [6, 26, 66]:
return "Atlanta"
elif self.region_code in [7, 27, 67]:
return "Chicago"
elif self.region_code in [8, 28, 68]:
return "St. Louis"
elif self.region_code in [9, 29, 69]:
return "Minneapolis"
elif self.region_code in [10, 30, 70]:
return "Kansas City"
elif self.region_code in [11, 31, 71]:
return "Dallas"
elif self.region_code in [12, 32, 72]:
return "San Francisco"
elif self.region_code == 80:
return "Traveller's Cheque"
else:
return None
def to_s(self):
return str(self.number) + " (valid: %s; type: %s; region: %s)" % \
(self.is_valid(), self.get_type(), self.get_region())
def __repr__(self):
return self.to_s()
|
def pytest_addoption(parser):
parser.addoption("--project", action="store", default='None')
def pytest_generate_tests(metafunc):
# This is called for every test. Only get/set command line arguments
# if the argument is specified in the list of test "fixturenames".
option_value = metafunc.config.option.project
if 'project' in metafunc.fixturenames and option_value is not None:
metafunc.parametrize("project", [option_value])
|
def endswith(x, lst):
""" Select longest suffix that matches x from provided list(lst)
:param x: input string
:param lst: suffixes to compare with
:return: longest suffix that matches input string if available otherwise None
"""
longest_suffix = None
for suffix in lst:
if x.endswith(suffix):
if longest_suffix is None or len(longest_suffix) < len(suffix):
longest_suffix = suffix
return longest_suffix
def startswith(x, lst):
""" Select longest prefix that matches x from provided list(lst)
:param x: input string
:param lst: prefixes to compare with
:return: longest prefix that matches input string if available otherwise None
"""
longest_prefix = None
for prefix in lst:
if x.startswith(prefix):
if longest_prefix is None or len(longest_prefix) < len(prefix):
longest_prefix = prefix
return longest_prefix
def combine(cs, vs):
""" Returns all possible combinations preserving the order
:param cs: list of first strings
:param vs: list of second strings
:return: list of combined strings
"""
return [ci + vi for ci in cs for vi in vs]
def harmonic_mean(*a):
return len(a) / sum([1 / k for k in a])
|
#!/usr/bin/env python3
class Solution:
def findCircleNum(self, M):
sz, num = len(M), 0
marked = [False] * sz
def dfs(p):
marked[p] = True
for q in range(sz):
if M[p][q] and (not marked[q]):
dfs(q)
for p in range(sz):
if not marked[p]:
num += 1
dfs(p)
return num
sol = Solution()
M = [[1,1,0],
[1,1,0],
[0,0,1]]
M = [[1,1,0],
[1,1,1],
[0,1,1]]
M = [[1]]
print(sol.findCircleNum(M))
|
#prints all TRs in a table
table = soup.findAll('table')[3]
for row in table.findAll('tr'):
print(row)
#prints each TR and each child tag in TR
table = soup.findAll('table')[3]
for row in table.findAll('tr'):
for line in row.findAll():
print(line)
|
#1. Idea here is we want to return a list of strings which contains all of the root to leaf paths in the binary tree.
#2. So initialize a list (path_list) then we are going to make a recursive call function. In the function we will pass the root of the binary tree and a empty string which we will modify and add node values as we recurse.
#3. If the root is NOT none, we want to add that node value to our string, this will always begin from the ROOT of the binary tree. This will build our string of paths.
#4. Once we come accross a leaf our second condition will be met thus we know that if we hit a leaf we have reached the END of the path, so we have our root to leaf path, hence we should add that path to our path_list, not path_list will be global for inner function.
#5. Otherwise if we are not at a leaf, we still want to build our list and add the node value BUT we want to keep recursing down the tree until we hit the leaves, so we simply recurse left and right respectivley.
#6. Rememeber to pass the path + -> as this will build the string according to the desired output. Done!
def binaryTreePaths(self, root):
path_list = []
def recurse(root, path):
if root:
path += str(root.val)
if not root.left and not root.right:
path_list.append(path)
else:
recurse(root.left, path + "->")
recurse(root.right, path + "->")
recurse(root, "")
return path_list
|
class NfDictionaryTryGetResults:
def __init__(
self):
self.__key_exists = \
False
self.__value = \
None
def __get_key_exists(
self) \
-> bool:
key_exists = \
self.__key_exists
return \
key_exists
def __set_key_exists(
self,
key_exists: bool):
self.__key_exists = \
key_exists
def __get_value(
self):
value = \
self.__value
return \
value
def __set_value(
self,
value):
self.__value = \
value
key_exists = \
property(
fget=__get_key_exists,
fset=__set_key_exists)
value = \
property(
fget=__get_value,
fset=__set_value)
|
class Solution:
"""
@param nums: An integer array sorted in ascending order
@param target: An integer
@return: An integer
"""
def findPosition(self, nums, target):
low = 0
high = len(nums) - 1
while low<=high :
mid = (low+high) >> 1
if nums[mid]>target :
high = mid-1
elif nums[mid]<target :
low = mid+1
else :
return mid
return -1
|
# pylint: disable=missing-function-docstring, missing-module-docstring/
# coding: utf-8
x = 1
e1 = x + a
e3 = f(x) + 1
# TODO e4 not working yet. we must get 2 errors
#e4 = f(x,y) + 1
|
# -*- coding: utf-8 -*-
"""A Collection of Financial Calculators.
This script contains a variety of financial calculator functions needed to
determine loan qualifications.
"""
"""Credit Score Filter.
This script filters a bank list by the user's minimum credit score.
"""
def filter_credit_score(credit_score, bank_list):
"""Filters the bank list by the mininim allowed credit score set by the bank.
Args:
credit_score (int): The applicant's credit score.
bank_list (list of lists): The available bank loans.
Returns:
A list of qualifying bank loans.
"""
credit_score_approval_list = []
for bank in bank_list:
if credit_score >= int(bank[4]):
credit_score_approval_list.append(bank)
return credit_score_approval_list
"""Debt to Income Filter.
This script filters the bank list by the applicant's
maximum debt-to-income ratio.
"""
def filter_debt_to_income(monthly_debt_ratio, bank_list):
"""Filters the bank list by the maximum debt-to-income ratio allowed by the bank.
Args:
monthly_debt_ratio (float): The applicant's monthly debt ratio.
bank_list (list of lists): The available bank loans.
Returns:
A list of qualifying bank loans.
"""
debt_to_income_approval_list = []
for bank in bank_list:
if monthly_debt_ratio <= float(bank[3]):
debt_to_income_approval_list.append(bank)
return debt_to_income_approval_list
"""Loan to Value Filter.
This script filters the bank list by the applicant's maximum home loan
to home value ratio.
"""
def filter_loan_to_value(loan_to_value_ratio, bank_list):
"""Filters the bank list by the maximum loan to value ratio.
Args:
loan_to_value_ratio (float): The applicant's loan to value ratio.
bank_list (list of lists): The available bank loans.
Returns:
A list of qualifying bank loans.
"""
loan_to_value_approval_list = []
for bank in bank_list:
if loan_to_value_ratio <= float(bank[2]):
loan_to_value_approval_list.append(bank)
return loan_to_value_approval_list
"""Max Loan Size Filter.
This script filters the bank list by comparing the user's loan value
against the bank's maximum loan size.
"""
def filter_max_loan_size(loan_amount, bank_list):
"""Filters the bank list by the maximum allowed loan amount.
Args:
loan_amount (int): The requested loan amount.
bank_list (list of lists): The available bank loans.
Returns:
A list of qualifying bank loans.
"""
loan_size_approval_list = []
for bank in bank_list:
if loan_amount <= int(bank[1]):
loan_size_approval_list.append(bank)
return loan_size_approval_list
|
# -*- coding: utf-8 -*-
def command():
return "edit-instance-vmware"
def init_argument(parser):
parser.add_argument("--instance-no", required=True)
parser.add_argument("--instance-type", required=True)
parser.add_argument("--key-name", required=True)
parser.add_argument("--compute-resource", required=True)
parser.add_argument("--is-static-ip", required=True)
parser.add_argument("--ip-address", required=False)
parser.add_argument("--subnet-mask", required=False)
parser.add_argument("--default-gateway", required=False)
parser.add_argument("--comment", required=False)
parser.add_argument("--root-size", required=False)
def execute(requester, args):
instance_no = args.instance_no
instance_type = args.instance_type
key_name = args.key_name
compute_resource = args.compute_resource
is_static_ip = args.is_static_ip
ip_address = args.ip_address
subnet_mask = args.subnet_mask
default_gateway = args.default_gateway
comment = args.comment
root_size = args.root_size
parameters = {}
parameters["InstanceNo"] = instance_no
parameters["InstanceType"] = instance_type
parameters["KeyName"] = key_name
parameters["ComputeResource"] = compute_resource
parameters["IsStaticIp"] = is_static_ip
if (ip_address != None):
parameters["IpAddress"] = ip_address
if (subnet_mask != None):
parameters["SubnetMask"] = subnet_mask
if (default_gateway != None):
parameters["DefaultGateway"] = default_gateway
if (comment != None):
parameters["Comment"] = comment
if (root_size != None):
parameters["RootSize"] = root_size
return requester.execute("/EditInstanceVmware", parameters)
|
##############################################################################
# Documentation/conf.py
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership. The
# ASF licenses this file to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance with the
# License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
##############################################################################
# Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
# -- Path setup --------------------------------------------------------------
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
#
# import os
# import sys
# sys.path.insert(0, os.path.abspath('.'))
# -- Project information -----------------------------------------------------
project = 'NuttX'
copyright = '2020, The Apache Software Foundation'
author = 'NuttX community'
version = release = 'latest'
# -- General configuration ---------------------------------------------------
# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = [
"sphinx_rtd_theme",
"m2r2",
'sphinx.ext.autosectionlabel',
'sphinx.ext.todo',
'sphinx_tabs.tabs'
]
source_suffix = [ '.rst', '.md' ]
todo_include_todos = True
autosectionlabel_prefix_document = True
# do not set Python as primary domain for code blocks
highlight_language = "none"
primary_domain = None
# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This pattern also affects html_static_path and html_extra_path.
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
# list of documentation versions to offer (besides latest)
html_context = dict()
html_context['nuttx_versions'] = ['latest']
# TODO: append other options using releases detected from git (or maybe just
# a few hand-selected ones, or maybe just a "stable" option)
# -- Options for HTML output -------------------------------------------------
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
html_theme = 'sphinx_rtd_theme'
html_show_sphinx = False
html_theme_options = {
'prev_next_buttons_location': None
}
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['_static']
html_css_files = [
'custom.css'
]
html_show_license = True
html_logo = '_static/NuttX.png'
html_favicon = '_static/favicon.ico'
today_fmt = '%d %B %y at %H:%M'
c_id_attributes = [
'FAR',
'CODE',
'noreturn_function'
]
|
config = {
'Department_level_configs': {
'Department_Name': 'Data Analisys Department',
'Department_Short_Name': 'DATA'
}
}
|
"""
At a lemonade stand, each lemonade costs $5.
Customers are standing in a queue to buy from you, and order one at a time (in the order specified by bills).
Each customer will only buy one lemonade and pay with either a $5, $10, or $20 bill. You must provide the correct change to each customer, so that the net transaction is that the customer pays $5.
Note that you don't have any change in hand at first.
Return true if and only if you can provide every customer with correct change.
Example 1:
Input: [5,5,5,10,20]
Output: true
Explanation:
From the first 3 customers, we collect three $5 bills in order.
From the fourth customer, we collect a $10 bill and give back a $5.
From the fifth customer, we give a $10 bill and a $5 bill.
Since all customers got correct change, we output true.
Example 2:
Input: [5,5,10]
Output: true
Example 3:
Input: [10,10]
Output: false
Example 4:
Input: [5,5,10,10,20]
Output: false
Explanation:
From the first two customers in order, we collect two $5 bills.
For the next two customers in order, we collect a $10 bill and give back a $5 bill.
For the last customer, we can't give change of $15 back because we only have two $10 bills.
Since not every customer received correct change, the answer is false.
Note:
0 <= bills.length <= 10000
bills[i] will be either 5, 10, or 20.
"""
class Solution(object):
def lemonadeChange(self, bills):
"""
:type bills: List[int]
:rtype: bool
"""
"""
Method 1:
* Given:
Lemonade Cost = $5
Every customer only buys 1 lemonade
Customers pay $5, $10 or $20
We must give back the correct change
We initially start with zero change
* Initialize three counters, 5 10 and 20
* IF the customer pays 5, then no sweat!
Increment the counter
* IF the customer pays 10, then we must
give back a 5
* IF the customer pays 20, then we must
give back a 5 and a 10
Your runtime beats 79.46 % of python submissions.
"""
count_5 = 0
count_10 = 0
count_20 = 0
for ele in bills:
if ele == 5:
count_5 += 1
if ele == 10:
if count_5:
count_5 -= 1
count_10 += 1
else:
return False
if ele == 20:
if count_5 and count_10:
count_5 -= 1
count_10 -= 1
count_20 += 1
elif count_5 > 3:
count_5 -= 3
count_20 += 1
else:
return False
return True
|
# coding: utf-8
class UtgError(Exception):
MSG = None
def __init__(self, **kwargs):
super(UtgError, self).__init__(self.MSG % kwargs)
self.arguments = kwargs
class WordsError(UtgError):
pass
class WrongFormsNumberError(WordsError):
MSG = 'constuctor of word receive wrong number of forms (%(wrong_number)s intead of %(expected_number)s), forms are: %(forms)s'
class DuplicateWordError(WordsError):
MSG = 'duplicate word in dictionary, type: %(type)s, normal form: %(normal_form)s'
class UnknownVerboseIdError(WordsError):
MSG = 'Unknown verbose id: %(verbose_id)s'
class ExternalDependecyNotFoundError(WordsError):
MSG = 'External dependency not found: %(dependency)s'
class WrongDependencyFormatError(WordsError):
MSG = 'wrong dependency format: %(dependency)s'
class NoWordsFoundError(WordsError):
MSG = 'no words found for text="%(text)s"'
class MoreThenOneWordFoundError(WordsError):
MSG = 'more then one word found for text="%(text)s" and type=%(type)s'
class LexiconError(UtgError):
pass
class UnknownLexiconKeyError(LexiconError):
MSG = 'unknown lexicon key: %(key)s'
class NoTemplatesWithSpecifiedRestrictions(LexiconError):
MSG = 'no templates with specified key: %(key)s and restrictions: %(restrictions)r'
class TransformatorsError(UtgError):
pass
class UnknownIntegerFormError(TransformatorsError):
MSG = 'unknown integer form: %(form)s'
|
''' Abstract class of healthcheck. There is only one method to implement,
that determines state of Vm or its underlying services.
Initialization - consider following config:
::
healthcheck:
driver: SomeHC
param1: AAAA
param2: BBBB
some_x: CCC
All params will be passed as config dict to the driver init:
'''
class AbstractHealthcheck:
def __init__(self, config):
pass
async def is_healthy(self, vm):
''' Checks that is a given vm is healthy
:arg vmshepherd.iaas.Vm vm: Vm object
Returns boolean - True means is healthy, False means unhealthy.
'''
raise NotImplementedError
|
# Solution
#----------------------------------------------------#
def prepend(self, value):
""" Prepend a node to the beginning of the list """
if self.head is None:
self.head = Node(value)
return
new_head = Node(value)
new_head.next = self.head
self.head = new_head
#----------------------------------------------------#
def append(self, value):
""" Append a node to the end of the list """
# Here I'm not keeping track of the tail. It's possible to store the tail
# as well as the head, which makes appending like this an O(1) operation.
# Otherwise, it's an O(N) operation as you have to iterate through the
# entire list to add a new tail.
if self.head is None:
self.head = Node(value)
return
node = self.head
while node.next:
node = node.next
node.next = Node(value)
#----------------------------------------------------#
def search(self, value):
""" Search the linked list for a node with the requested value and return the node. """
if self.head is None:
return None
node = self.head
while node:
if node.value == value:
return node
node = node.next
raise ValueError("Value not found in the list.")
#----------------------------------------------------#
def remove(self, value):
""" Delete the first node with the desired data. """
if self.head is None:
return
if self.head.value == value:
self.head = self.head.next
return
node = self.head
while node.next:
if node.next.value == value:
node.next = node.next.next
return
node = node.next
raise ValueError("Value not found in the list.")
#----------------------------------------------------#
def pop(self):
""" Return the first node's value and remove it from the list. """
if self.head is None:
return None
node = self.head
self.head = self.head.next
return node.value
#----------------------------------------------------#
def insert(self, value, pos):
""" Insert value at pos position in the list. If pos is larger than the
length of the list, append to the end of the list. """
# If the list is empty
if self.head is None:
self.head = Node(value)
return
if pos == 0:
self.prepend(value)
return
index = 0
node = self.head
while node.next and index <= pos:
if (pos - 1) == index:
new_node = Node(value)
new_node.next = node.next
node.next = new_node
return
index += 1
node = node.next
else:
self.append(value)
#----------------------------------------------------#
def size(self):
""" Return the size or length of the linked list. """
size = 0
node = self.head
while node:
size += 1
node = node.next
return size
#----------------------------------------------------#
def to_list(self):
out = []
node = self.head
while node:
out.append(node.value)
node = node.next
return out
|
class State(object):
def __init__(self):
print("Processing current state: ", str(self))
def on_event(self, event):
"""
Handle events that are delegated to this State.
"""
pass
def __repr__(self):
"""
Leverages the __str__ method to describe the State.
"""
return self.__str__()
def __str__(self):
"""
Returns the name of the State.
"""
return self.__class__.__name___
|
lines = int(input("Please enter number of lines : \n"))
ln = 1
while ln <= lines:
col = 1
while col <= lines:
if ln == 1 or col == 1 or col == lines or ln == lines:
print('*', end='')
else:
print(' ', end = '')
col += 1
print()
ln += 1
|
# -*- coding: utf-8 -*-
"""
Created on Sun Aug 1 22:16:33 2021
@author: McLaren
"""
# 邮件提醒功能,若启用必须设置为True,并配置后续内容
# 配置QQ邮箱的SMTP服务即可实现邮件发送
# 详见:https://www.cnblogs.com/Alear/p/11594932.html
email_notice = True
email = "" # 邮箱
passwd = "" # 填入发送方邮箱的授权码
# 体力恢复配置
use_Crystal_stone = False
use_Gold_apple = True
use_Silver_apple = True
use_Bronze_apple = False
# 按键与位置全局配置区(目前软件可以自适应1080p与720p分辨率,其余分辨率需要自行修改配置)
# 可以通过Base_func中window_capture开启debug参数查看游戏界面的截图
# 像素测量可以采用Photoshop等专业软件,也可使用win10下的图片软件,裁剪功能里可以设置单位为像素进行测量
position = {
"CardLeftBias": 205, # 第一张卡牌与界面左侧距离
"CardVerticalPosition": 765, # 卡牌距顶端垂直距离
"CardGap": 383, # 卡牌间距
"NoblePhantasmLeftBias": 623, # 第一张宝具与界面左侧距离
"NoblePhantasmVerticalPosition": 356, # 宝具距顶端垂直距离
"NoblePhantasmGap": 356, # 宝具卡牌间距
"CharacterSkillLeftBias": 115, # 战斗界面中英灵第一张技能按键与界面左侧距离
"CharacterSkillVerticalPosition": 868, # 技能按键距顶端垂直距离
"ServantGap": 480, # 战斗界面中英灵间距
"CharacterSkillGap": 142, # 技能按键间距间距
"SelectCharacterLeftBias": 498, # 选人界面第一个英灵与界面左侧距离
"SelectCharacterVerticalPosition": 623, # 选人界面英灵中心距顶端垂直距离
"SelectCharacterGap": 445, # 选人界面英灵间距
"MasterSkillVerticalPosition": 473, # 御主技能按键距顶端垂直距离
"MasterSkillLeftBias": 1352, # 第一个御主技能按键距与界面左侧距离
"MasterSkillGap": 142, # 御主技能按键间距
"ChangeOrderServantLeftBias": 213, # 换人界面第一个英灵与界面左侧距离
"ChangeOrderServantGap": 302, # 换人界面英灵间距
"ChangeOrderServantVerticalPosition": 534 # 换人界面英灵中心距顶端垂直距离
}
button = {
"DefaultBattlePosition": (1407, 276), # 默认的关卡位置(右上角)
"ReenterBattleButton": (1254, 845), # “连续出击“按键
"FeedAppleDecideButton": (1263, 836), # 吃苹果决定按键
"RefreshFriendButton": (1281, 196), # 刷新好友按键
"RefreshFriendDecideButton": (1254, 845), # 刷新好友决定按键
"AttackButton": (1708, 907), # 攻击按键
"NextStep": (1754, 990), # 下一步按键(关卡结束后确认战利品时右下角的按键)
"RefuseFriendRequest": (418, 934), # 拒绝好友申请按键
"MasterSkillButton": (1797, position["MasterSkillVerticalPosition"]), # 御主技能按键
"StartBattleButton": (1780, 1014), # 开始战斗按键
"ChangeOrderDecideButton": (943, 943), # 御主换人技能决定按键
"SkipAnimation": (960, 355), # 跳过动画时点击
"FriendPointSummonButton": (960, 840), # 友情点召唤
"FriendPointResummon": (1150, 1014), # 继续友情点召唤
"FriendPointSummonConfirm": (1245, 855) # 友情点召唤确认
}
# 战斗中金银苹果使用数量、礼装掉落数量
num_Gold_apple_used = 0
num_Silver_apple_used = 0
num_Bronze_apple_used = 0
num_Crystal_stone_used = 0
num_Craft = 0
global_pause = False
remaining_battle_times = 0
estimated_finished_time = 0
last_battle_time_usage = 0
global_error_flag = False
global_error_msg = ""
|
# Valid API version in URL path: YYYY-MM or unstable
VERSION_PATTERN = r"([0-9]{4}-[0-9]{2})|unstable"
# /oauth/authorize, /oauth/access_token do not require authentication
NOT_AUTHABLE_PATTERN = r"\/oauth\/(authorize|access_token)"
# /oauth/access_scopes does not require versioned API path
NOT_VERSIONABLE_PATTERN = r"\/(oauth\/access_scopes)"
# For extracting next/prev link header on REST API calls
LINK_PATTERN = r"<.*?page_info=([a-zA-Z0-9\-_]+).*?>; rel=\"(next|previous)\""
# Header supplied by Shopify when rate limit is hit
RETRY_HEADER = "retry-after"
# Header supplied by Shopify for REST API calls, used by LINK_PATTERN
LINK_HEADER = "link"
# Header to send for public API calls
ACCESS_TOKEN_HEADER = "x-shopify-access-token"
# Default API version
DEFAULT_VERSION = "2020-04"
# Default API mode
DEFAULT_MODE = "public"
# Alternate API mode
ALT_MODE = "private"
# One second in milliseconds
ONE_SECOND = 1000
# REST API type
REST = "rest"
# GraphQL API type
GRAPHQL = "graphql"
|
def iterate(pop):
p = pop.copy()
for i in range(8):
p[i] = pop[i + 1]
p[8] = pop[0]
p[6] += pop[0]
return p
pop = {0: 0, 1: 0, 2: 0, 3: 0, 4: 0, 5: 0, 6: 0, 7: 0, 8: 0}
population = [int(n) for n in open('input.txt', 'r').readline().split(',')]
for fish in population:
pop[fish] += 1
for i in range(256):
pop = iterate(pop)
print(sum(pop.values()))
|
for c in range(6, 0,-1):
print(c)
n1 = int(input('Inicio: '))
n2 = int(input('Fim: '))
n3 = int(input('Passo: '))
for c in range(n1, n2 + 1, n3):
print(c)
|
#
# PySNMP MIB module SLAPM-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/SLAPM-MIB
# Produced by pysmi-0.3.4 at Wed May 1 15:06:04 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 (default, Mar 27 2019, 09:23:15)
#
OctetString, Integer, ObjectIdentifier = mibBuilder.importSymbols("ASN1", "OctetString", "Integer", "ObjectIdentifier")
NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues")
ConstraintsUnion, SingleValueConstraint, ValueSizeConstraint, ValueRangeConstraint, ConstraintsIntersection = mibBuilder.importSymbols("ASN1-REFINEMENT", "ConstraintsUnion", "SingleValueConstraint", "ValueSizeConstraint", "ValueRangeConstraint", "ConstraintsIntersection")
SnmpAdminString, = mibBuilder.importSymbols("SNMP-FRAMEWORK-MIB", "SnmpAdminString")
ModuleCompliance, ObjectGroup, NotificationGroup = mibBuilder.importSymbols("SNMPv2-CONF", "ModuleCompliance", "ObjectGroup", "NotificationGroup")
TimeTicks, MibIdentifier, Unsigned32, IpAddress, Gauge32, experimental, iso, NotificationType, Counter32, Bits, MibScalar, MibTable, MibTableRow, MibTableColumn, Counter64, ObjectIdentity, Integer32, ModuleIdentity = mibBuilder.importSymbols("SNMPv2-SMI", "TimeTicks", "MibIdentifier", "Unsigned32", "IpAddress", "Gauge32", "experimental", "iso", "NotificationType", "Counter32", "Bits", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "Counter64", "ObjectIdentity", "Integer32", "ModuleIdentity")
TextualConvention, TestAndIncr, DateAndTime, DisplayString, RowStatus = mibBuilder.importSymbols("SNMPv2-TC", "TextualConvention", "TestAndIncr", "DateAndTime", "DisplayString", "RowStatus")
slapmMIB = ModuleIdentity((1, 3, 6, 1, 3, 88))
slapmMIB.setRevisions(('2000-01-24 00:00',))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
if mibBuilder.loadTexts: slapmMIB.setRevisionsDescriptions(('This version published as RFC 2758.',))
if mibBuilder.loadTexts: slapmMIB.setLastUpdated('200001240000Z')
if mibBuilder.loadTexts: slapmMIB.setOrganization('International Business Machines Corp.')
if mibBuilder.loadTexts: slapmMIB.setContactInfo('Kenneth White International Business Machines Corporation Network Computing Software Division Research Triangle Park, NC, USA E-mail: [email protected]')
if mibBuilder.loadTexts: slapmMIB.setDescription('The Service Level Agreement Performance Monitoring MIB (SLAPM-MIB) provides data collection and monitoring capabilities for Service Level Agreements (SLAs) policy definitions.')
class SlapmNameType(SnmpAdminString):
description = 'The textual convention for naming entities within this MIB. The actual contents of an object defined using this textual convention should consist of the distinguished name portion of an name. This is usually the right-most portion of the name. This convention is necessary, since names within this MIB can be used as index items and an instance identifier is limited to 128 subidentifiers. This textual convention has been deprecated. All of the tables defined within this MIB that use this textual convention have been deprecated as well since the method of using a portion of the name (either of a policy definition or of a traffic profile) has been replaced by using an Unsigned32 index. The new slapmPolicyNameTable would then map the Unsigned32 index to a real name.'
status = 'deprecated'
subtypeSpec = SnmpAdminString.subtypeSpec + ValueSizeConstraint(0, 32)
class SlapmStatus(TextualConvention, Bits):
description = 'The textual convention for defining the various slapmPRMonTable (or old slapmPolicyMonitorTable) and the slapmSubcomponentTable states for actual policy rule traffic monitoring.'
status = 'current'
namedValues = NamedValues(("slaMinInRateNotAchieved", 0), ("slaMaxInRateExceeded", 1), ("slaMaxDelayExceeded", 2), ("slaMinOutRateNotAchieved", 3), ("slaMaxOutRateExceeded", 4), ("monitorMinInRateNotAchieved", 5), ("monitorMaxInRateExceeded", 6), ("monitorMaxDelayExceeded", 7), ("monitorMinOutRateNotAchieved", 8), ("monitorMaxOutRateExceeded", 9))
class SlapmPolicyRuleName(TextualConvention, OctetString):
description = 'To facilitate internationalization, this TC represents information taken from the ISO/IEC IS 10646-1 character set, encoded as an octet string using the UTF-8 character encoding scheme described in RFC 2044. For strings in 7-bit US-ASCII, there is no impact since the UTF-8 representation is identical to the US-ASCII encoding.'
status = 'current'
displayHint = '1024t'
subtypeSpec = OctetString.subtypeSpec + ValueSizeConstraint(0, 1024)
slapmNotifications = MibIdentifier((1, 3, 6, 1, 3, 88, 0))
slapmObjects = MibIdentifier((1, 3, 6, 1, 3, 88, 1))
slapmConformance = MibIdentifier((1, 3, 6, 1, 3, 88, 2))
slapmBaseObjects = MibIdentifier((1, 3, 6, 1, 3, 88, 1, 1))
slapmSpinLock = MibScalar((1, 3, 6, 1, 3, 88, 1, 1, 1), TestAndIncr()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: slapmSpinLock.setStatus('current')
if mibBuilder.loadTexts: slapmSpinLock.setDescription('An advisory lock used to allow cooperating applications to coordinate their use of the contents of this MIB. This typically occurs when an application seeks to create an new entry or alter an existing entry in slapmPRMonTable (or old slapmPolicyMonitorTable). A management implementation MAY utilize the slapmSpinLock to serialize its changes or additions. This usage is not required. However, slapmSpinLock MUST be supported by agent implementations.')
slapmPolicyCountQueries = MibScalar((1, 3, 6, 1, 3, 88, 1, 1, 2), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: slapmPolicyCountQueries.setStatus('current')
if mibBuilder.loadTexts: slapmPolicyCountQueries.setDescription('The total number of times that a policy lookup occurred with respect to a policy agent. This is the number of times that a reference was made to a policy definition at a system and includes the number of times that a policy repository was accessed, slapmPolicyCountAccesses. The object slapmPolicyCountAccesses should be less than slapmPolicyCountQueries when policy definitions are cached at a system.')
slapmPolicyCountAccesses = MibScalar((1, 3, 6, 1, 3, 88, 1, 1, 3), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: slapmPolicyCountAccesses.setStatus('current')
if mibBuilder.loadTexts: slapmPolicyCountAccesses.setDescription('Total number of times that a policy repository was accessed with respect to a policy agent. The value of this object should be less than slapmPolicyCountQueries, since typically policy entries are cached to minimize repository accesses.')
slapmPolicyCountSuccessAccesses = MibScalar((1, 3, 6, 1, 3, 88, 1, 1, 4), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: slapmPolicyCountSuccessAccesses.setStatus('current')
if mibBuilder.loadTexts: slapmPolicyCountSuccessAccesses.setDescription('Total number of successful policy repository accesses with respect to a policy agent.')
slapmPolicyCountNotFounds = MibScalar((1, 3, 6, 1, 3, 88, 1, 1, 5), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: slapmPolicyCountNotFounds.setStatus('current')
if mibBuilder.loadTexts: slapmPolicyCountNotFounds.setDescription('Total number of policy repository accesses, with respect to a policy agent, that resulted in an entry not being located.')
slapmPolicyPurgeTime = MibScalar((1, 3, 6, 1, 3, 88, 1, 1, 6), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 3600)).clone(900)).setUnits('seconds').setMaxAccess("readwrite")
if mibBuilder.loadTexts: slapmPolicyPurgeTime.setStatus('current')
if mibBuilder.loadTexts: slapmPolicyPurgeTime.setDescription('The purpose of this object is to define the amount of time (in seconds) to wait before removing an slapmPolicyRuleStatsEntry (or old slapmPolicyStatsEntry) when a system detects that the associated policy definition has been deleted. This gives any polling management applications time to complete their last poll before an entry is removed. An slapmPolicyRuleStatsEntry (or old slapmPolicyStatsEntry) enters the deleteNeeded(3) state via slapmPolicyRuleStatsOperStatus (or old slapmPolicyStatsOperStatus) when a system first detects that the entry needs to be removed. Once slapmPolicyPurgeTime has expired for an entry in deleteNeeded(3) state it is removed a long with any dependent slapmPRMonTable (or slapmPolicyMonitorTable) entries. A value of 0 for this option disables this function and results in the automatic purging of slapmPRMonTable (or slapmPolicyTable) entries upon transition into deleteNeeded(3) state. A slapmPolicyRuleDeleted (or slapmPolicyProfileDeleted) notification is sent when an slapmPolicyRuleStatsEntry (or slapmPolicyStatsEntry) is removed. Dependent slapmPRMonTable (or slapmPolicyMonitorTable) deletion results in a slapmPolicyRuleMonDeleted (or slapmPolicyMonitorDeleted) notification being sent. These notifications are suppressed if the value of slapmPolicyTrapEnable is disabled(2).')
slapmPolicyTrapEnable = MibScalar((1, 3, 6, 1, 3, 88, 1, 1, 7), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enabled", 1), ("disabled", 2))).clone('disabled')).setMaxAccess("readwrite")
if mibBuilder.loadTexts: slapmPolicyTrapEnable.setStatus('current')
if mibBuilder.loadTexts: slapmPolicyTrapEnable.setDescription('Indicates whether slapmPolicyRuleDeleted and slapmPolicyRuleMonDeleted (or slapmPolicyProfileDeleted and slapmPolicyMonitorDeleted) notifications should be generated by this system.')
slapmPolicyTrapFilter = MibScalar((1, 3, 6, 1, 3, 88, 1, 1, 8), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 64)).clone(3)).setUnits('intervals').setMaxAccess("readwrite")
if mibBuilder.loadTexts: slapmPolicyTrapFilter.setStatus('current')
if mibBuilder.loadTexts: slapmPolicyTrapFilter.setDescription('The purpose of this object is to suppress unnecessary slapmSubcMonitorNotOkay (or slapmSubcomponentMonitoredEventNotAchieved), for example, notifications. Basically, a monitored event has to not meet its SLA requirement for the number of consecutive intervals indicated by the value of this object.')
slapmTableObjects = MibIdentifier((1, 3, 6, 1, 3, 88, 1, 2))
slapmPolicyStatsTable = MibTable((1, 3, 6, 1, 3, 88, 1, 2, 1), )
if mibBuilder.loadTexts: slapmPolicyStatsTable.setStatus('deprecated')
if mibBuilder.loadTexts: slapmPolicyStatsTable.setDescription('Provides statistics on all policies known at a system. This table has been deprecated and replaced with the slapmPolicyRuleStatsTable. Older implementations of this MIB are expected to continue their support of this table.')
slapmPolicyStatsEntry = MibTableRow((1, 3, 6, 1, 3, 88, 1, 2, 1, 1), ).setIndexNames((0, "SLAPM-MIB", "slapmPolicyStatsSystemAddress"), (0, "SLAPM-MIB", "slapmPolicyStatsPolicyName"), (0, "SLAPM-MIB", "slapmPolicyStatsTrafficProfileName"))
if mibBuilder.loadTexts: slapmPolicyStatsEntry.setStatus('deprecated')
if mibBuilder.loadTexts: slapmPolicyStatsEntry.setDescription('Defines an entry in the slapmPolicyStatsTable. This table defines a set of statistics that is kept on a per system, policy and traffic profile basis. A policy can be defined to contain multiple traffic profiles that map to a single action. Entries in this table are not created or deleted via SNMP but reflect the set of policy definitions known at a system.')
slapmPolicyStatsSystemAddress = MibTableColumn((1, 3, 6, 1, 3, 88, 1, 2, 1, 1, 1), OctetString().subtype(subtypeSpec=ConstraintsUnion(ValueSizeConstraint(0, 0), ValueSizeConstraint(4, 4), ValueSizeConstraint(16, 16), )))
if mibBuilder.loadTexts: slapmPolicyStatsSystemAddress.setStatus('deprecated')
if mibBuilder.loadTexts: slapmPolicyStatsSystemAddress.setDescription('Address of a system that an Policy definition relates to. A zero length octet string must be used to indicate that only a single system is being represented. Otherwise, the length of the octet string must be 4 for an ipv4 address or 16 for an ipv6 address.')
slapmPolicyStatsPolicyName = MibTableColumn((1, 3, 6, 1, 3, 88, 1, 2, 1, 1, 2), SlapmNameType())
if mibBuilder.loadTexts: slapmPolicyStatsPolicyName.setStatus('deprecated')
if mibBuilder.loadTexts: slapmPolicyStatsPolicyName.setDescription('Policy name that this entry relates to.')
slapmPolicyStatsTrafficProfileName = MibTableColumn((1, 3, 6, 1, 3, 88, 1, 2, 1, 1, 3), SlapmNameType())
if mibBuilder.loadTexts: slapmPolicyStatsTrafficProfileName.setStatus('deprecated')
if mibBuilder.loadTexts: slapmPolicyStatsTrafficProfileName.setDescription('The name of a traffic profile that is associated with a policy.')
slapmPolicyStatsOperStatus = MibTableColumn((1, 3, 6, 1, 3, 88, 1, 2, 1, 1, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("inactive", 1), ("active", 2), ("deleteNeeded", 3)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: slapmPolicyStatsOperStatus.setStatus('deprecated')
if mibBuilder.loadTexts: slapmPolicyStatsOperStatus.setDescription('The state of a policy entry: inactive(1) - An policy entry was either defined by local system definition or discovered via a directory search but has not been activated (not currently being used). active(2) - Policy entry is being used to affect traffic flows. deleteNeeded(3) - Either though local implementation dependent methods or by discovering that the directory entry corresponding to this table entry no longer exists and slapmPolicyPurgeTime needs to expire before attempting to remove the corresponding slapmPolicyStatsEntry and any dependent slapmPolicyMonitor table entries. Note: a policy traffic profile in a state other than active(1) is not being used to affect traffic flows.')
slapmPolicyStatsActiveConns = MibTableColumn((1, 3, 6, 1, 3, 88, 1, 2, 1, 1, 5), Gauge32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: slapmPolicyStatsActiveConns.setStatus('deprecated')
if mibBuilder.loadTexts: slapmPolicyStatsActiveConns.setDescription('The number of active TCP connections that are affected by the corresponding policy entry.')
slapmPolicyStatsTotalConns = MibTableColumn((1, 3, 6, 1, 3, 88, 1, 2, 1, 1, 6), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: slapmPolicyStatsTotalConns.setStatus('deprecated')
if mibBuilder.loadTexts: slapmPolicyStatsTotalConns.setDescription('The number of total TCP connections that are affected by the corresponding policy entry.')
slapmPolicyStatsFirstActivated = MibTableColumn((1, 3, 6, 1, 3, 88, 1, 2, 1, 1, 7), DateAndTime().clone(hexValue="0000000000000000")).setMaxAccess("readonly")
if mibBuilder.loadTexts: slapmPolicyStatsFirstActivated.setStatus('deprecated')
if mibBuilder.loadTexts: slapmPolicyStatsFirstActivated.setDescription('The timestamp for when the corresponding policy entry is activated. The value of this object serves as the discontinuity event indicator when polling entries in this table. The value of this object is updated on transition of slapmPolicyStatsOperStatus into the active(2) state.')
slapmPolicyStatsLastMapping = MibTableColumn((1, 3, 6, 1, 3, 88, 1, 2, 1, 1, 8), DateAndTime().clone(hexValue="0000000000000000")).setMaxAccess("readonly")
if mibBuilder.loadTexts: slapmPolicyStatsLastMapping.setStatus('deprecated')
if mibBuilder.loadTexts: slapmPolicyStatsLastMapping.setDescription('The timestamp for when the last time that the associated policy entry was used.')
slapmPolicyStatsInOctets = MibTableColumn((1, 3, 6, 1, 3, 88, 1, 2, 1, 1, 9), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: slapmPolicyStatsInOctets.setStatus('deprecated')
if mibBuilder.loadTexts: slapmPolicyStatsInOctets.setDescription('The number of octets that was received by IP for an entity that map to this entry.')
slapmPolicyStatsOutOctets = MibTableColumn((1, 3, 6, 1, 3, 88, 1, 2, 1, 1, 10), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: slapmPolicyStatsOutOctets.setStatus('deprecated')
if mibBuilder.loadTexts: slapmPolicyStatsOutOctets.setDescription('The number of octets that was transmitted by IP for an entity that map to this entry.')
slapmPolicyStatsConnectionLimit = MibTableColumn((1, 3, 6, 1, 3, 88, 1, 2, 1, 1, 11), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: slapmPolicyStatsConnectionLimit.setStatus('deprecated')
if mibBuilder.loadTexts: slapmPolicyStatsConnectionLimit.setDescription('The limit for the number of active TCP connections that are allowed for this policy definition. A value of zero for this object implies that a connection limit has not been specified.')
slapmPolicyStatsCountAccepts = MibTableColumn((1, 3, 6, 1, 3, 88, 1, 2, 1, 1, 12), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: slapmPolicyStatsCountAccepts.setStatus('deprecated')
if mibBuilder.loadTexts: slapmPolicyStatsCountAccepts.setDescription("This counter is incremented when a policy action's Permission value is set to Accept and a session (TCP connection) is accepted.")
slapmPolicyStatsCountDenies = MibTableColumn((1, 3, 6, 1, 3, 88, 1, 2, 1, 1, 13), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: slapmPolicyStatsCountDenies.setStatus('deprecated')
if mibBuilder.loadTexts: slapmPolicyStatsCountDenies.setDescription("This counter is incremented when a policy action's Permission value is set to Deny and a session is denied, or when a session (TCP connection) is rejected due to a policy's connection limit (slapmPolicyStatsConnectLimit) being reached.")
slapmPolicyStatsInDiscards = MibTableColumn((1, 3, 6, 1, 3, 88, 1, 2, 1, 1, 14), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: slapmPolicyStatsInDiscards.setStatus('deprecated')
if mibBuilder.loadTexts: slapmPolicyStatsInDiscards.setDescription('This counter counts the number of in octets discarded. This occurs when an error is detected. Examples of this are buffer overflow, checksum error, or bad packet format.')
slapmPolicyStatsOutDiscards = MibTableColumn((1, 3, 6, 1, 3, 88, 1, 2, 1, 1, 15), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: slapmPolicyStatsOutDiscards.setStatus('deprecated')
if mibBuilder.loadTexts: slapmPolicyStatsOutDiscards.setDescription('This counter counts the number of out octets discarded. Examples of this are buffer overflow, checksum error, or bad packet format.')
slapmPolicyStatsInPackets = MibTableColumn((1, 3, 6, 1, 3, 88, 1, 2, 1, 1, 16), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: slapmPolicyStatsInPackets.setStatus('deprecated')
if mibBuilder.loadTexts: slapmPolicyStatsInPackets.setDescription('This counter counts the number of in packets received that relate to this policy entry from IP.')
slapmPolicyStatsOutPackets = MibTableColumn((1, 3, 6, 1, 3, 88, 1, 2, 1, 1, 17), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: slapmPolicyStatsOutPackets.setStatus('deprecated')
if mibBuilder.loadTexts: slapmPolicyStatsOutPackets.setDescription('This counter counts the number of out packets sent by IP that relate to this policy entry.')
slapmPolicyStatsInProfileOctets = MibTableColumn((1, 3, 6, 1, 3, 88, 1, 2, 1, 1, 18), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: slapmPolicyStatsInProfileOctets.setStatus('deprecated')
if mibBuilder.loadTexts: slapmPolicyStatsInProfileOctets.setDescription('This counter counts the number of in octets that are determined to be within profile.')
slapmPolicyStatsOutProfileOctets = MibTableColumn((1, 3, 6, 1, 3, 88, 1, 2, 1, 1, 19), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: slapmPolicyStatsOutProfileOctets.setStatus('deprecated')
if mibBuilder.loadTexts: slapmPolicyStatsOutProfileOctets.setDescription('This counter counts the number of out octets that are determined to be within profile.')
slapmPolicyStatsMinRate = MibTableColumn((1, 3, 6, 1, 3, 88, 1, 2, 1, 1, 20), Integer32()).setUnits('Kilobits per second').setMaxAccess("readonly")
if mibBuilder.loadTexts: slapmPolicyStatsMinRate.setStatus('deprecated')
if mibBuilder.loadTexts: slapmPolicyStatsMinRate.setDescription('The minimum transfer rate defined for this entry.')
slapmPolicyStatsMaxRate = MibTableColumn((1, 3, 6, 1, 3, 88, 1, 2, 1, 1, 21), Integer32()).setUnits('Kilobits per second').setMaxAccess("readonly")
if mibBuilder.loadTexts: slapmPolicyStatsMaxRate.setStatus('deprecated')
if mibBuilder.loadTexts: slapmPolicyStatsMaxRate.setDescription('The maximum transfer rate defined for this entry.')
slapmPolicyStatsMaxDelay = MibTableColumn((1, 3, 6, 1, 3, 88, 1, 2, 1, 1, 22), Integer32()).setUnits('milliseconds').setMaxAccess("readonly")
if mibBuilder.loadTexts: slapmPolicyStatsMaxDelay.setStatus('deprecated')
if mibBuilder.loadTexts: slapmPolicyStatsMaxDelay.setDescription('The maximum delay defined for this entry.')
slapmPolicyMonitorTable = MibTable((1, 3, 6, 1, 3, 88, 1, 2, 2), )
if mibBuilder.loadTexts: slapmPolicyMonitorTable.setStatus('deprecated')
if mibBuilder.loadTexts: slapmPolicyMonitorTable.setDescription('Provides a method of monitoring policies and their effect at a system. This table has been deprecated and replaced with the slapmPRMonTable. Older implementations of this MIB are expected to continue their support of this table.')
slapmPolicyMonitorEntry = MibTableRow((1, 3, 6, 1, 3, 88, 1, 2, 2, 1), ).setIndexNames((0, "SLAPM-MIB", "slapmPolicyMonitorOwnerIndex"), (0, "SLAPM-MIB", "slapmPolicyMonitorSystemAddress"), (0, "SLAPM-MIB", "slapmPolicyMonitorPolicyName"), (0, "SLAPM-MIB", "slapmPolicyMonitorTrafficProfileName"))
if mibBuilder.loadTexts: slapmPolicyMonitorEntry.setStatus('deprecated')
if mibBuilder.loadTexts: slapmPolicyMonitorEntry.setDescription('Defines an entry in the slapmPolicyMonitorTable. This table defines which policies should be monitored on a per policy traffic profile basis.')
slapmPolicyMonitorOwnerIndex = MibTableColumn((1, 3, 6, 1, 3, 88, 1, 2, 2, 1, 1), SnmpAdminString().subtype(subtypeSpec=ValueSizeConstraint(0, 16)))
if mibBuilder.loadTexts: slapmPolicyMonitorOwnerIndex.setStatus('deprecated')
if mibBuilder.loadTexts: slapmPolicyMonitorOwnerIndex.setDescription("To facilitate the provisioning of access control by a security administrator using the View-Based Access Control Model (RFC 2575, VACM) for tables in which multiple users may need to independently create or modify entries, the initial index is used as an 'owner index'. Such an initial index has a syntax of SnmpAdminString, and can thus be trivially mapped to a securityName or groupName as defined in VACM, in accordance with a security policy. All entries in that table belonging to a particular user will have the same value for this initial index. For a given user's entries in a particular table, the object identifiers for the information in these entries will have the same subidentifiers (except for the 'column' subidentifier) up to the end of the encoded owner index. To configure VACM to permit access to this portion of the table, one would create vacmViewTreeFamilyTable entries with the value of vacmViewTreeFamilySubtree including the owner index portion, and vacmViewTreeFamilyMask 'wildcarding' the column subidentifier. More elaborate configurations are possible.")
slapmPolicyMonitorSystemAddress = MibTableColumn((1, 3, 6, 1, 3, 88, 1, 2, 2, 1, 2), OctetString().subtype(subtypeSpec=ConstraintsUnion(ValueSizeConstraint(0, 0), ValueSizeConstraint(4, 4), ValueSizeConstraint(16, 16), )))
if mibBuilder.loadTexts: slapmPolicyMonitorSystemAddress.setStatus('deprecated')
if mibBuilder.loadTexts: slapmPolicyMonitorSystemAddress.setDescription('Address of a system that an Policy definition relates to. A zero length octet string can be used to indicate that only a single system is being represented. Otherwise, the length of the octet string should be 4 for an ipv4 address and 16 for an ipv6 address.')
slapmPolicyMonitorPolicyName = MibTableColumn((1, 3, 6, 1, 3, 88, 1, 2, 2, 1, 3), SlapmNameType())
if mibBuilder.loadTexts: slapmPolicyMonitorPolicyName.setStatus('deprecated')
if mibBuilder.loadTexts: slapmPolicyMonitorPolicyName.setDescription('Policy name that this entry relates to.')
slapmPolicyMonitorTrafficProfileName = MibTableColumn((1, 3, 6, 1, 3, 88, 1, 2, 2, 1, 4), SlapmNameType())
if mibBuilder.loadTexts: slapmPolicyMonitorTrafficProfileName.setStatus('deprecated')
if mibBuilder.loadTexts: slapmPolicyMonitorTrafficProfileName.setDescription('The corresponding Traffic Profile name.')
slapmPolicyMonitorControl = MibTableColumn((1, 3, 6, 1, 3, 88, 1, 2, 2, 1, 5), Bits().clone(namedValues=NamedValues(("monitorMinRate", 0), ("monitorMaxRate", 1), ("monitorMaxDelay", 2), ("enableAggregateTraps", 3), ("enableSubcomponentTraps", 4), ("monitorSubcomponents", 5))).clone(namedValues=NamedValues(("monitorMinRate", 0), ("monitorMaxRate", 1), ("monitorMaxDelay", 2)))).setMaxAccess("readcreate")
if mibBuilder.loadTexts: slapmPolicyMonitorControl.setStatus('deprecated')
if mibBuilder.loadTexts: slapmPolicyMonitorControl.setDescription("The value of this object determines the type and level of monitoring that is applied to a policy/profile. The value of this object can't be changed once the table entry that it is a part of is activated via a slapmPolicyMonitorRowStatus transition to active state. monitorMinRate(0) - Monitor minimum transfer rate. monitorMaxRate(1) - Monitor maximum transfer rate. monitorMaxDelay(2) - Monitor maximum delay. enableAggregateTraps(3) - The enableAggregateTraps(3) BITS setting enables notification generation when monitoring a policy traffic profile as an aggregate using the values in the corresponding slapmPolicyStatsEntry. By default this function is not enabled. enableSubcomponentTraps(4) - This BITS setting enables notification generation when monitoring all subcomponents that are mapped to an corresponding slapmPolicyStatsEntry. By default this function is not enabled. monitorSubcomponents(5) - This BITS setting enables monitoring of each subcomponent (typically a TCP connection or UDP listener) individually.")
slapmPolicyMonitorStatus = MibTableColumn((1, 3, 6, 1, 3, 88, 1, 2, 2, 1, 6), SlapmStatus()).setMaxAccess("readonly")
if mibBuilder.loadTexts: slapmPolicyMonitorStatus.setStatus('deprecated')
if mibBuilder.loadTexts: slapmPolicyMonitorStatus.setDescription("The value of this object indicates when a monitored value has not meet a threshold or isn't meeting the defined service level. The SlapmStatus TEXTUAL-CONVENTION defines two levels of not meeting a threshold. The first set: slaMinInRateNotAchieved(0), slaMaxInRateExceeded(1), slaMaxDelayExceeded(2), slaMinOutRateNotAchieved(3), slaMaxOutRateExceeded(4) are used to indicate when the SLA as an aggregate is not meeting a threshold while the second set: monitorMinInRateNotAchieved(5), monitorMaxInRateExceeded(6), monitorMaxDelayExceeded(7), monitorMinOutRateNotAchieved(8), monitorMaxOutRateExceeded(9) indicate that at least one subcomponent is not meeting a threshold.")
slapmPolicyMonitorInterval = MibTableColumn((1, 3, 6, 1, 3, 88, 1, 2, 2, 1, 7), Integer32().subtype(subtypeSpec=ValueRangeConstraint(15, 86400)).clone(20)).setUnits('seconds').setMaxAccess("readcreate")
if mibBuilder.loadTexts: slapmPolicyMonitorInterval.setStatus('deprecated')
if mibBuilder.loadTexts: slapmPolicyMonitorInterval.setDescription('The number of seconds that defines the sample period.')
slapmPolicyMonitorIntTime = MibTableColumn((1, 3, 6, 1, 3, 88, 1, 2, 2, 1, 8), DateAndTime().clone(hexValue="0000000000000000")).setMaxAccess("readonly")
if mibBuilder.loadTexts: slapmPolicyMonitorIntTime.setStatus('deprecated')
if mibBuilder.loadTexts: slapmPolicyMonitorIntTime.setDescription('The timestamp for when the last interval ended.')
slapmPolicyMonitorCurrentInRate = MibTableColumn((1, 3, 6, 1, 3, 88, 1, 2, 2, 1, 9), Gauge32()).setUnits('kilobits per second').setMaxAccess("readonly")
if mibBuilder.loadTexts: slapmPolicyMonitorCurrentInRate.setStatus('deprecated')
if mibBuilder.loadTexts: slapmPolicyMonitorCurrentInRate.setDescription('Using the value of the corresponding slapmPolicyMonitorInterval, slapmPolicyStatsInOctets is sampled and then divided by slapmPolicyMonitorInterval to determine the current in transfer rate.')
slapmPolicyMonitorCurrentOutRate = MibTableColumn((1, 3, 6, 1, 3, 88, 1, 2, 2, 1, 10), Gauge32()).setUnits('kilobits per second').setMaxAccess("readonly")
if mibBuilder.loadTexts: slapmPolicyMonitorCurrentOutRate.setStatus('deprecated')
if mibBuilder.loadTexts: slapmPolicyMonitorCurrentOutRate.setDescription('Using the value of the corresponding slapmPolicyMonitorInterval, slapmPolicyStatsOutOctets is sampled and then divided by slapmPolicyMonitorInterval to determine the current out transfer rate.')
slapmPolicyMonitorMinRateLow = MibTableColumn((1, 3, 6, 1, 3, 88, 1, 2, 2, 1, 11), Integer32()).setUnits('kilobits per second').setMaxAccess("readcreate")
if mibBuilder.loadTexts: slapmPolicyMonitorMinRateLow.setStatus('deprecated')
if mibBuilder.loadTexts: slapmPolicyMonitorMinRateLow.setDescription("The threshold for generating a slapmMonitoredEventNotAchieved notification, signalling that a monitored minimum transfer rate has not been meet. A slapmMonitoredEventNotAchieved notification is not generated again for an slapmPolicyMonitorEntry until the minimum transfer rate exceeds slapmPolicyMonitorMinRateHigh (a slapmMonitoredEventOkay notification is then transmitted) and then fails below slapmPolicyMonitorMinRateLow. This behavior reduces the slapmMonitoredEventNotAchieved notifications that are transmitted. A value of zero for this object is returned when the slapmPolicyMonitorControl monitorMinRate(0) is not enabled. When enabled the default value for this object is the min rate value specified in the associated action definition minus 10%. If the action definition doesn't have a min rate defined then there is no default for this object and a value MUST be specified prior to activating this entry when monitorMinRate(0) is selected. Note: The corresponding slapmPolicyMonitorControl BITS setting, enableAggregateTraps(3), MUST be selected in order for any notification relating to this entry to potentially be generated.")
slapmPolicyMonitorMinRateHigh = MibTableColumn((1, 3, 6, 1, 3, 88, 1, 2, 2, 1, 12), Integer32()).setUnits('kilobits per second').setMaxAccess("readcreate")
if mibBuilder.loadTexts: slapmPolicyMonitorMinRateHigh.setStatus('deprecated')
if mibBuilder.loadTexts: slapmPolicyMonitorMinRateHigh.setDescription("The threshold for generating a slapmMonitoredEventOkay notification, signalling that a monitored minimum transfer rate has increased to an acceptable level. A value of zero for this object is returned when the slapmPolicyMonitorControl monitorMinRate(0) is not enabled. When enabled the default value for this object is the min rate value specified in the associated action definition plus 10%. If the action definition doesn't have a min rate defined then there is no default for this object and a value MUST be specified prior to activating this entry when monitorMinRate(0) is selected. Note: The corresponding slapmPolicyMonitorControl BITS setting, enableAggregateTraps(3), MUST be selected in order for any notification relating to this entry to potentially be generated.")
slapmPolicyMonitorMaxRateHigh = MibTableColumn((1, 3, 6, 1, 3, 88, 1, 2, 2, 1, 13), Integer32()).setUnits('kilobits per second').setMaxAccess("readcreate")
if mibBuilder.loadTexts: slapmPolicyMonitorMaxRateHigh.setStatus('deprecated')
if mibBuilder.loadTexts: slapmPolicyMonitorMaxRateHigh.setDescription("The threshold for generating a slapmMonitoredEventNotAchieved notification, signalling that a monitored maximum transfer rate has been exceeded. A slapmMonitoredEventNotAchieved notification is not generated again for an slapmPolicyMonitorEntry until the maximum transfer rate fails below slapmPolicyMonitorMaxRateLow (a slapmMonitoredEventOkay notification is then transmitted) and then raises above slapmPolicyMonitorMaxRateHigh. This behavior reduces the slapmMonitoredEventNotAchieved notifications that are transmitted. A value of zero for this object is returned when the slapmPolicyMonitorControl monitorMaxRate(1) is not enabled. When enabled the default value for this object is the max rate value specified in the associated action definition plus 10%. If the action definition doesn't have a max rate defined then there is no default for this object and a value MUST be specified prior to activating this entry when monitorMaxRate(1) is selected. Note: The corresponding slapmPolicyMonitorControl BITS setting, enableAggregateTraps(3), MUST be selected in order for any notification relating to this entry to potentially be generated.")
slapmPolicyMonitorMaxRateLow = MibTableColumn((1, 3, 6, 1, 3, 88, 1, 2, 2, 1, 14), Integer32()).setUnits('kilobits per second').setMaxAccess("readcreate")
if mibBuilder.loadTexts: slapmPolicyMonitorMaxRateLow.setStatus('deprecated')
if mibBuilder.loadTexts: slapmPolicyMonitorMaxRateLow.setDescription("The threshold for generating a slapmMonitoredEventOkay notification, signalling that a monitored maximum transfer rate has fallen to an acceptable level. A value of zero for this object is returned when the slapmPolicyMonitorControl monitorMaxRate(1) is not enabled. When enabled the default value for this object is the max rate value specified in the associated action definition minus 10%. If the action definition doesn't have a max rate defined then there is no default for this object and a value MUST be specified prior to activating this entry when monitorMaxRate(1) is selected. Note: The corresponding slapmPolicyMonitorControl BITS setting, enableAggregateTraps(3), MUST be selected in order for any notification relating to this entry to potentially be generated.")
slapmPolicyMonitorMaxDelayHigh = MibTableColumn((1, 3, 6, 1, 3, 88, 1, 2, 2, 1, 15), Integer32()).setUnits('milliseconds').setMaxAccess("readcreate")
if mibBuilder.loadTexts: slapmPolicyMonitorMaxDelayHigh.setStatus('deprecated')
if mibBuilder.loadTexts: slapmPolicyMonitorMaxDelayHigh.setDescription("The threshold for generating a slapmMonitoredEventNotAchieved notification, signalling that a monitored maximum delay rate has been exceeded. A slapmMonitoredEventNotAchieved notification is not generated again for an slapmPolicyMonitorEntry until the maximum delay rate falls below slapmPolicyMonitorMaxDelayLow (a slapmMonitoredEventOkay notification is then transmitted) and raises above slapmPolicyMonitorMaxDelayHigh. This behavior reduces the slapmMonitoredEventNotAchieved notifications that are transmitted. A value of zero for this object is returned when the slapmPolicyMonitorControl monitorMaxDelay(4) is not enabled. When enabled the default value for this object is the max delay value specified in the associated action definition plus 10%. If the action definition doesn't have a max delay defined then there is no default for this object and a value MUST be specified prior to activating this entry when monitorMaxDelay(4) is selected. Note: The corresponding slapmPolicyMonitorControl BITS setting, enableAggregateTraps(3), MUST be selected in order for any notification relating to this entry to potentially be generated.")
slapmPolicyMonitorMaxDelayLow = MibTableColumn((1, 3, 6, 1, 3, 88, 1, 2, 2, 1, 16), Integer32()).setUnits('milliseconds').setMaxAccess("readcreate")
if mibBuilder.loadTexts: slapmPolicyMonitorMaxDelayLow.setStatus('deprecated')
if mibBuilder.loadTexts: slapmPolicyMonitorMaxDelayLow.setDescription("The threshold for generating a slapmMonitoredEventOkay notification, signalling that a monitored maximum delay rate has fallen to an acceptable level. A value of zero for this object is returned when the slapmPolicyMonitorControl monitorMaxDelay(4) is not enabled. When enabled the default value for this object is the max delay value specified in the associated action definition minus 10%. If the action definition doesn't have a max delay defined then there is no default for this object and a value MUST be specified prior to activating this entry when monitorMaxDelay(4) is selected. Note: The corresponding slapmPolicyMonitorControl BITS setting, enableAggregateTraps(3), MUST be selected in order for any notification relating to this entry to potentially be generated.")
slapmPolicyMonitorMinInRateNotAchieves = MibTableColumn((1, 3, 6, 1, 3, 88, 1, 2, 2, 1, 17), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: slapmPolicyMonitorMinInRateNotAchieves.setStatus('deprecated')
if mibBuilder.loadTexts: slapmPolicyMonitorMinInRateNotAchieves.setDescription('The number of times that a minimum transfer in rate was not achieved.')
slapmPolicyMonitorMaxInRateExceeds = MibTableColumn((1, 3, 6, 1, 3, 88, 1, 2, 2, 1, 18), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: slapmPolicyMonitorMaxInRateExceeds.setStatus('deprecated')
if mibBuilder.loadTexts: slapmPolicyMonitorMaxInRateExceeds.setDescription('The number of times that a maximum transfer in rate was exceeded.')
slapmPolicyMonitorMaxDelayExceeds = MibTableColumn((1, 3, 6, 1, 3, 88, 1, 2, 2, 1, 19), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: slapmPolicyMonitorMaxDelayExceeds.setStatus('deprecated')
if mibBuilder.loadTexts: slapmPolicyMonitorMaxDelayExceeds.setDescription('The number of times that a maximum delay in rate was exceeded.')
slapmPolicyMonitorMinOutRateNotAchieves = MibTableColumn((1, 3, 6, 1, 3, 88, 1, 2, 2, 1, 20), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: slapmPolicyMonitorMinOutRateNotAchieves.setStatus('deprecated')
if mibBuilder.loadTexts: slapmPolicyMonitorMinOutRateNotAchieves.setDescription('The number of times that a minimum transfer out rate was not achieved.')
slapmPolicyMonitorMaxOutRateExceeds = MibTableColumn((1, 3, 6, 1, 3, 88, 1, 2, 2, 1, 21), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: slapmPolicyMonitorMaxOutRateExceeds.setStatus('deprecated')
if mibBuilder.loadTexts: slapmPolicyMonitorMaxOutRateExceeds.setDescription('The number of times that a maximum transfer out rate was exceeded.')
slapmPolicyMonitorCurrentDelayRate = MibTableColumn((1, 3, 6, 1, 3, 88, 1, 2, 2, 1, 22), Gauge32()).setUnits('milliseconds').setMaxAccess("readonly")
if mibBuilder.loadTexts: slapmPolicyMonitorCurrentDelayRate.setStatus('deprecated')
if mibBuilder.loadTexts: slapmPolicyMonitorCurrentDelayRate.setDescription('The current delay rate for this entry. This is calculated by taking the average of the TCP round trip times for all associating slapmSubcomponentTable entries within a interval.')
slapmPolicyMonitorRowStatus = MibTableColumn((1, 3, 6, 1, 3, 88, 1, 2, 2, 1, 23), RowStatus()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: slapmPolicyMonitorRowStatus.setStatus('deprecated')
if mibBuilder.loadTexts: slapmPolicyMonitorRowStatus.setDescription('This object allows entries to be created and deleted in the slapmPolicyMonitorTable. An entry in this table is deleted by setting this object to destroy(6). Removal of a corresponding (same policy and traffic profile names) slapmPolicyStatsEntry has the side effect of the automatic deletion an entry in this table.')
slapmSubcomponentTable = MibTable((1, 3, 6, 1, 3, 88, 1, 2, 3), )
if mibBuilder.loadTexts: slapmSubcomponentTable.setStatus('current')
if mibBuilder.loadTexts: slapmSubcomponentTable.setDescription('Defines a table to provide information on the individually components that are mapped to a policy rule (or old traffic profile). The indexing for this table is designed to support the use of an SNMP GET-NEXT operation using only the remote address and remote port as a way for a management station to retrieve the table entries relating to a particular client.')
slapmSubcomponentEntry = MibTableRow((1, 3, 6, 1, 3, 88, 1, 2, 3, 1), ).setIndexNames((0, "SLAPM-MIB", "slapmSubcomponentRemAddress"), (0, "SLAPM-MIB", "slapmSubcomponentRemPort"), (0, "SLAPM-MIB", "slapmSubcomponentLocalAddress"), (0, "SLAPM-MIB", "slapmSubcomponentLocalPort"))
if mibBuilder.loadTexts: slapmSubcomponentEntry.setStatus('current')
if mibBuilder.loadTexts: slapmSubcomponentEntry.setDescription("Describes a particular subcomponent entry. This table does not have an OwnerIndex as part of its indexing since this table's contents is intended to span multiple users.")
slapmSubcomponentRemAddress = MibTableColumn((1, 3, 6, 1, 3, 88, 1, 2, 3, 1, 1), OctetString().subtype(subtypeSpec=ConstraintsUnion(ValueSizeConstraint(0, 0), ValueSizeConstraint(4, 4), ValueSizeConstraint(16, 16), )))
if mibBuilder.loadTexts: slapmSubcomponentRemAddress.setStatus('current')
if mibBuilder.loadTexts: slapmSubcomponentRemAddress.setDescription('Indicate the remote address of a subcomponent. A remote address can be either an ipv4 address in which case 4 octets are required or as an ipv6 address that requires 16 octets. The value of this subidentifier is a zero length octet string when this entry relates to a UDP listener.')
slapmSubcomponentRemPort = MibTableColumn((1, 3, 6, 1, 3, 88, 1, 2, 3, 1, 2), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 65535)))
if mibBuilder.loadTexts: slapmSubcomponentRemPort.setStatus('current')
if mibBuilder.loadTexts: slapmSubcomponentRemPort.setDescription('Indicate the remote port of a subcomponent. The value of this subidentifier is 0 when this entry relates to a UDP listener.')
slapmSubcomponentLocalAddress = MibTableColumn((1, 3, 6, 1, 3, 88, 1, 2, 3, 1, 3), OctetString().subtype(subtypeSpec=ConstraintsUnion(ValueSizeConstraint(4, 4), ValueSizeConstraint(16, 16), )))
if mibBuilder.loadTexts: slapmSubcomponentLocalAddress.setStatus('current')
if mibBuilder.loadTexts: slapmSubcomponentLocalAddress.setDescription('Indicate the local address of a subcomponent. A local address can be either an ipv4 address in which case 4 octets are required or as an ipv6 address that requires 16 octets.')
slapmSubcomponentLocalPort = MibTableColumn((1, 3, 6, 1, 3, 88, 1, 2, 3, 1, 4), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 65535)))
if mibBuilder.loadTexts: slapmSubcomponentLocalPort.setStatus('current')
if mibBuilder.loadTexts: slapmSubcomponentLocalPort.setDescription('Indicate the local port of a subcomponent.')
slapmSubcomponentProtocol = MibTableColumn((1, 3, 6, 1, 3, 88, 1, 2, 3, 1, 5), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("udpListener", 1), ("tcpConnection", 2)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: slapmSubcomponentProtocol.setStatus('current')
if mibBuilder.loadTexts: slapmSubcomponentProtocol.setDescription('Indicate the protocol in use that identifies the type of subcomponent.')
slapmSubcomponentSystemAddress = MibTableColumn((1, 3, 6, 1, 3, 88, 1, 2, 3, 1, 6), OctetString().subtype(subtypeSpec=ConstraintsUnion(ValueSizeConstraint(0, 0), ValueSizeConstraint(4, 4), ValueSizeConstraint(16, 16), ))).setMaxAccess("readonly")
if mibBuilder.loadTexts: slapmSubcomponentSystemAddress.setStatus('current')
if mibBuilder.loadTexts: slapmSubcomponentSystemAddress.setDescription('Address of a system that an Policy definition relates to. A zero length octet string can be used to indicate that only a single system is being represented. Otherwise, the length of the octet string should be 4 for an ipv4 address and 16 for an ipv6 address.')
slapmSubcomponentPolicyName = MibTableColumn((1, 3, 6, 1, 3, 88, 1, 2, 3, 1, 7), SlapmNameType()).setMaxAccess("readonly")
if mibBuilder.loadTexts: slapmSubcomponentPolicyName.setStatus('deprecated')
if mibBuilder.loadTexts: slapmSubcomponentPolicyName.setDescription('Policy name that this entry relates to. This object, along with slapmSubcomponentTrafficProfileName, have been replaced with the use of an unsigned integer index that is mapped to an slapmPolicyNameEntry to actually identify policy naming.')
slapmSubcomponentTrafficProfileName = MibTableColumn((1, 3, 6, 1, 3, 88, 1, 2, 3, 1, 8), SlapmNameType()).setMaxAccess("readonly")
if mibBuilder.loadTexts: slapmSubcomponentTrafficProfileName.setStatus('deprecated')
if mibBuilder.loadTexts: slapmSubcomponentTrafficProfileName.setDescription('The corresponding traffic profile name. This object, along with slapmSubcomponentProfileName, have been replaced with the use of an unsigned integer index that is mapped to an slapmPolicyNameEntry to actually identify policy naming.')
slapmSubcomponentLastActivity = MibTableColumn((1, 3, 6, 1, 3, 88, 1, 2, 3, 1, 9), DateAndTime().clone(hexValue="0000000000000000")).setMaxAccess("readonly")
if mibBuilder.loadTexts: slapmSubcomponentLastActivity.setStatus('current')
if mibBuilder.loadTexts: slapmSubcomponentLastActivity.setDescription('The date and timestamp of when this entry was last used.')
slapmSubcomponentInOctets = MibTableColumn((1, 3, 6, 1, 3, 88, 1, 2, 3, 1, 10), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: slapmSubcomponentInOctets.setStatus('current')
if mibBuilder.loadTexts: slapmSubcomponentInOctets.setDescription('The number of octets received from IP for this connection.')
slapmSubcomponentOutOctets = MibTableColumn((1, 3, 6, 1, 3, 88, 1, 2, 3, 1, 11), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: slapmSubcomponentOutOctets.setStatus('current')
if mibBuilder.loadTexts: slapmSubcomponentOutOctets.setDescription('The number of octets sent to IP for this connection.')
slapmSubcomponentTcpOutBufferedOctets = MibTableColumn((1, 3, 6, 1, 3, 88, 1, 2, 3, 1, 12), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: slapmSubcomponentTcpOutBufferedOctets.setStatus('current')
if mibBuilder.loadTexts: slapmSubcomponentTcpOutBufferedOctets.setDescription('Number of outgoing octets buffered. The value of this object is zero when the entry is not for a TCP connection.')
slapmSubcomponentTcpInBufferedOctets = MibTableColumn((1, 3, 6, 1, 3, 88, 1, 2, 3, 1, 13), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: slapmSubcomponentTcpInBufferedOctets.setStatus('current')
if mibBuilder.loadTexts: slapmSubcomponentTcpInBufferedOctets.setDescription('Number of incoming octets buffered. The value of this object is zero when the entry is not for a TCP connection.')
slapmSubcomponentTcpReXmts = MibTableColumn((1, 3, 6, 1, 3, 88, 1, 2, 3, 1, 14), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: slapmSubcomponentTcpReXmts.setStatus('current')
if mibBuilder.loadTexts: slapmSubcomponentTcpReXmts.setDescription('Number of retransmissions. The value of this object is zero when the entry is not for a TCP connection.')
slapmSubcomponentTcpRoundTripTime = MibTableColumn((1, 3, 6, 1, 3, 88, 1, 2, 3, 1, 15), Integer32()).setUnits('milliseconds').setMaxAccess("readonly")
if mibBuilder.loadTexts: slapmSubcomponentTcpRoundTripTime.setStatus('current')
if mibBuilder.loadTexts: slapmSubcomponentTcpRoundTripTime.setDescription('The amount of time that has elapsed, measured in milliseconds, from when the last TCP segment was transmitted by the TCP Stack until the ACK was received. The value of this object is zero when the entry is not for a TCP connection.')
slapmSubcomponentTcpRoundTripVariance = MibTableColumn((1, 3, 6, 1, 3, 88, 1, 2, 3, 1, 16), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: slapmSubcomponentTcpRoundTripVariance.setStatus('current')
if mibBuilder.loadTexts: slapmSubcomponentTcpRoundTripVariance.setDescription('Round trip time variance. The value of this object is zero when the entry is not for a TCP connection.')
slapmSubcomponentInPdus = MibTableColumn((1, 3, 6, 1, 3, 88, 1, 2, 3, 1, 17), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: slapmSubcomponentInPdus.setStatus('current')
if mibBuilder.loadTexts: slapmSubcomponentInPdus.setDescription('The number of protocol related data units transferred inbound: slapmSubcomponentProtocol PDU Type udpListener(1) UDP datagrams tcpConnection(2) TCP segments')
slapmSubcomponentOutPdus = MibTableColumn((1, 3, 6, 1, 3, 88, 1, 2, 3, 1, 18), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: slapmSubcomponentOutPdus.setStatus('current')
if mibBuilder.loadTexts: slapmSubcomponentOutPdus.setDescription('The number of protocol related data units transferred outbound: slapmSubcomponentProtocol PDU Type udpListener(1) UDP datagrams tcpConnection(2) TCP segments')
slapmSubcomponentApplName = MibTableColumn((1, 3, 6, 1, 3, 88, 1, 2, 3, 1, 19), SnmpAdminString().subtype(subtypeSpec=ValueSizeConstraint(0, 32))).setMaxAccess("readonly")
if mibBuilder.loadTexts: slapmSubcomponentApplName.setStatus('current')
if mibBuilder.loadTexts: slapmSubcomponentApplName.setDescription('The application name associated with this entry if known, otherwise a zero-length octet string is returned as the value of this object.')
slapmSubcomponentMonitorStatus = MibTableColumn((1, 3, 6, 1, 3, 88, 1, 2, 3, 1, 20), SlapmStatus()).setMaxAccess("readonly")
if mibBuilder.loadTexts: slapmSubcomponentMonitorStatus.setStatus('current')
if mibBuilder.loadTexts: slapmSubcomponentMonitorStatus.setDescription("The value of this object indicates when a monitored value has exceeded a threshold or isn't meeting the defined service level. Only the following SlapmStatus BITS setting can be reported here: monitorMinInRateNotAchieved(5), monitorMaxInRateExceeded(6), monitorMaxDelayExceeded(7), monitorMinOutRateNotAchieved(8), monitorMaxOutRateExceeded(9) This object only has meaning when an corresponding slapmPolicyMonitorEntry exists with the slapmPolicyMonitorControl BITS setting monitorSubcomponents(5) enabled.")
slapmSubcomponentMonitorIntTime = MibTableColumn((1, 3, 6, 1, 3, 88, 1, 2, 3, 1, 21), DateAndTime().clone(hexValue="0000000000000000")).setMaxAccess("readonly")
if mibBuilder.loadTexts: slapmSubcomponentMonitorIntTime.setStatus('current')
if mibBuilder.loadTexts: slapmSubcomponentMonitorIntTime.setDescription('The timestamp for when the last interval ended. This object only has meaning when an corresponding slapmPRMonEntry (or old slapmPolicyMonitorEntry) exists with the slapmPRMonControl (or slapmPolicyMonitorControl) BITS setting monitorSubcomponents(5) enabled. All of the octets returned when monitoring is not in effect must be zero.')
slapmSubcomponentMonitorCurrentInRate = MibTableColumn((1, 3, 6, 1, 3, 88, 1, 2, 3, 1, 22), Gauge32()).setUnits('kilobits per second').setMaxAccess("readonly")
if mibBuilder.loadTexts: slapmSubcomponentMonitorCurrentInRate.setStatus('current')
if mibBuilder.loadTexts: slapmSubcomponentMonitorCurrentInRate.setDescription('Using the value of the corresponding slapmPRMonInterval (or slapmPolicyMonitorInterval), slapmSubcomponentStatsInOctets is divided by slapmSubcomponentMonitorInterval to determine the current in transfer rate. This object only has meaning when an corresponding slapmPRMonEntry (or slapmPolicyMonitorEntry) exists with the slapmPRMonControl (or slapmPolicyMonitorControl) BITS setting monitorSubcomponents(5) enabled. The value of this object is zero when monitoring is not in effect.')
slapmSubcomponentMonitorCurrentOutRate = MibTableColumn((1, 3, 6, 1, 3, 88, 1, 2, 3, 1, 23), Gauge32()).setUnits('kilobits per second').setMaxAccess("readonly")
if mibBuilder.loadTexts: slapmSubcomponentMonitorCurrentOutRate.setStatus('current')
if mibBuilder.loadTexts: slapmSubcomponentMonitorCurrentOutRate.setDescription('Using the value of the corresponding slapmPRMonInterval (or slapmPolicyMonitorInterva)l, slapmSubcomponentStatsOutOctets is divided by slapmPRMonInterval (or slapmPolicyMonitorInterval) to determine the current out transfer rate. This object only has meaning when an corresponding slapmPRMonEntry (or slapmPolicyMonitorEntry) exists with the slapmPRMonControl (or slapmPolicyMonitorControl) BITS setting monitorSubcomponents(5) enabled. The value of this object is zero when monitoring is not in effect.')
slapmSubcomponentPolicyRuleIndex = MibTableColumn((1, 3, 6, 1, 3, 88, 1, 2, 3, 1, 24), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(0, 4294967295))).setMaxAccess("readonly")
if mibBuilder.loadTexts: slapmSubcomponentPolicyRuleIndex.setStatus('current')
if mibBuilder.loadTexts: slapmSubcomponentPolicyRuleIndex.setDescription('Points to an slapmPolicyNameEntry when combined with slapmSubcomponentSystemAddress to indicate the policy naming that relates to this entry. A value of 0 for this object MUST be returned when the corresponding slapmSubcomponentEntry has no policy rule associated with it.')
slapmPolicyNameTable = MibTable((1, 3, 6, 1, 3, 88, 1, 2, 4), )
if mibBuilder.loadTexts: slapmPolicyNameTable.setStatus('current')
if mibBuilder.loadTexts: slapmPolicyNameTable.setDescription('Provides the mapping between a policy index as a unsigned 32 bit integer and the unique name associated with a policy rule.')
slapmPolicyNameEntry = MibTableRow((1, 3, 6, 1, 3, 88, 1, 2, 4, 1), ).setIndexNames((0, "SLAPM-MIB", "slapmPolicyNameSystemAddress"), (0, "SLAPM-MIB", "slapmPolicyNameIndex"))
if mibBuilder.loadTexts: slapmPolicyNameEntry.setStatus('current')
if mibBuilder.loadTexts: slapmPolicyNameEntry.setDescription('Defines an entry in the slapmPolicyNameTable.')
slapmPolicyNameSystemAddress = MibTableColumn((1, 3, 6, 1, 3, 88, 1, 2, 4, 1, 1), OctetString().subtype(subtypeSpec=ConstraintsUnion(ValueSizeConstraint(0, 0), ValueSizeConstraint(4, 4), ValueSizeConstraint(16, 16), )))
if mibBuilder.loadTexts: slapmPolicyNameSystemAddress.setStatus('current')
if mibBuilder.loadTexts: slapmPolicyNameSystemAddress.setDescription('Address of a system that an Policy rule definition relates to. A zero length octet string must be used to indicate that only a single system is being represented. Otherwise, the length of the octet string must be 4 for an ipv4 address or 16 for an ipv6 address.')
slapmPolicyNameIndex = MibTableColumn((1, 3, 6, 1, 3, 88, 1, 2, 4, 1, 2), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(1, 4294967295)))
if mibBuilder.loadTexts: slapmPolicyNameIndex.setStatus('current')
if mibBuilder.loadTexts: slapmPolicyNameIndex.setDescription('A locally arbitrary, but unique identifier associated with this table entry. This value is not expected to remain constant across reIPLs.')
slapmPolicyNameOfRule = MibTableColumn((1, 3, 6, 1, 3, 88, 1, 2, 4, 1, 3), SlapmPolicyRuleName()).setMaxAccess("readonly")
if mibBuilder.loadTexts: slapmPolicyNameOfRule.setStatus('current')
if mibBuilder.loadTexts: slapmPolicyNameOfRule.setDescription('The unique name that identifies a policy rule definition.')
slapmPolicyRuleStatsTable = MibTable((1, 3, 6, 1, 3, 88, 1, 2, 5), )
if mibBuilder.loadTexts: slapmPolicyRuleStatsTable.setStatus('current')
if mibBuilder.loadTexts: slapmPolicyRuleStatsTable.setDescription('Provides statistics on a per system and a per policy rule basis.')
slapmPolicyRuleStatsEntry = MibTableRow((1, 3, 6, 1, 3, 88, 1, 2, 5, 1), ).setIndexNames((0, "SLAPM-MIB", "slapmPolicyNameSystemAddress"), (0, "SLAPM-MIB", "slapmPolicyNameIndex"))
if mibBuilder.loadTexts: slapmPolicyRuleStatsEntry.setStatus('current')
if mibBuilder.loadTexts: slapmPolicyRuleStatsEntry.setDescription('Defines an entry in the slapmPolicyRuleStatsTable. This table defines a set of statistics that is kept on a per system and per policy rule basis. Entries in this table are not created or deleted via SNMP but reflect the set of policy rule definitions known at a system.')
slapmPolicyRuleStatsOperStatus = MibTableColumn((1, 3, 6, 1, 3, 88, 1, 2, 5, 1, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("inactive", 1), ("active", 2), ("deleteNeeded", 3)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: slapmPolicyRuleStatsOperStatus.setStatus('current')
if mibBuilder.loadTexts: slapmPolicyRuleStatsOperStatus.setDescription('The state of a policy entry: inactive(1) - An policy entry was either defined by local system definition or discovered via a directory search but has not been activated (not currently being used). active(2) - Policy entry is being used to affect traffic flows. deleteNeeded(3) - Either though local implementation dependent methods or by discovering that the directory entry corresponding to this table entry no longer exists and slapmPolicyPurgeTime needs to expire before attempting to remove the corresponding slapmPolicyStatsEntry and any dependent slapmPolicyMonitor table entries. Note: a policy rule in a state other than active(2) is not being used to affect traffic flows.')
slapmPolicyRuleStatsActiveConns = MibTableColumn((1, 3, 6, 1, 3, 88, 1, 2, 5, 1, 2), Gauge32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: slapmPolicyRuleStatsActiveConns.setStatus('current')
if mibBuilder.loadTexts: slapmPolicyRuleStatsActiveConns.setDescription('The number of active TCP connections that are affected by the corresponding policy entry.')
slapmPolicyRuleStatsTotalConns = MibTableColumn((1, 3, 6, 1, 3, 88, 1, 2, 5, 1, 3), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: slapmPolicyRuleStatsTotalConns.setStatus('current')
if mibBuilder.loadTexts: slapmPolicyRuleStatsTotalConns.setDescription('The number of total TCP connections that are affected by the corresponding policy entry.')
slapmPolicyRuleStatsLActivated = MibTableColumn((1, 3, 6, 1, 3, 88, 1, 2, 5, 1, 4), DateAndTime().clone(hexValue="0000000000000000")).setMaxAccess("readonly")
if mibBuilder.loadTexts: slapmPolicyRuleStatsLActivated.setStatus('current')
if mibBuilder.loadTexts: slapmPolicyRuleStatsLActivated.setDescription('The timestamp for when the corresponding policy entry was last activated. The value of this object serves as the discontinuity event indicator when polling entries in this table. The value of this object is updated on transition of slapmPolicyRuleStatsOperStatus into the active(2) state.')
slapmPolicyRuleStatsLastMapping = MibTableColumn((1, 3, 6, 1, 3, 88, 1, 2, 5, 1, 5), DateAndTime().clone(hexValue="0000000000000000")).setMaxAccess("readonly")
if mibBuilder.loadTexts: slapmPolicyRuleStatsLastMapping.setStatus('current')
if mibBuilder.loadTexts: slapmPolicyRuleStatsLastMapping.setDescription('The timestamp for when the last time that the associated policy entry was used.')
slapmPolicyRuleStatsInOctets = MibTableColumn((1, 3, 6, 1, 3, 88, 1, 2, 5, 1, 6), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: slapmPolicyRuleStatsInOctets.setStatus('current')
if mibBuilder.loadTexts: slapmPolicyRuleStatsInOctets.setDescription('The number of octets that was received by IP for an entity that map to this entry.')
slapmPolicyRuleStatsOutOctets = MibTableColumn((1, 3, 6, 1, 3, 88, 1, 2, 5, 1, 7), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: slapmPolicyRuleStatsOutOctets.setStatus('current')
if mibBuilder.loadTexts: slapmPolicyRuleStatsOutOctets.setDescription('The number of octets that was transmitted by IP for an entity that map to this entry.')
slapmPolicyRuleStatsConnLimit = MibTableColumn((1, 3, 6, 1, 3, 88, 1, 2, 5, 1, 8), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: slapmPolicyRuleStatsConnLimit.setStatus('current')
if mibBuilder.loadTexts: slapmPolicyRuleStatsConnLimit.setDescription('The limit for the number of active TCP connections that are allowed for this policy definition. A value of zero for this object implies that a connection limit has not been specified.')
slapmPolicyRuleStatsCountAccepts = MibTableColumn((1, 3, 6, 1, 3, 88, 1, 2, 5, 1, 9), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: slapmPolicyRuleStatsCountAccepts.setStatus('current')
if mibBuilder.loadTexts: slapmPolicyRuleStatsCountAccepts.setDescription("This counter is incremented when a policy action's Permission value is set to Accept and a session (TCP connection) is accepted.")
slapmPolicyRuleStatsCountDenies = MibTableColumn((1, 3, 6, 1, 3, 88, 1, 2, 5, 1, 10), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: slapmPolicyRuleStatsCountDenies.setStatus('current')
if mibBuilder.loadTexts: slapmPolicyRuleStatsCountDenies.setDescription("This counter is incremented when a policy action's Permission value is set to Deny and a session is denied, or when a session (TCP connection) is rejected due to a policy's connection limit (slapmPolicyRuleStatsConnectLimit) being reached.")
slapmPolicyRuleStatsInDiscards = MibTableColumn((1, 3, 6, 1, 3, 88, 1, 2, 5, 1, 11), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: slapmPolicyRuleStatsInDiscards.setStatus('current')
if mibBuilder.loadTexts: slapmPolicyRuleStatsInDiscards.setDescription('This counter counts the number of in octets discarded. This occurs when an error is detected. Examples of this are buffer overflow, checksum error, or bad packet format.')
slapmPolicyRuleStatsOutDiscards = MibTableColumn((1, 3, 6, 1, 3, 88, 1, 2, 5, 1, 12), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: slapmPolicyRuleStatsOutDiscards.setStatus('current')
if mibBuilder.loadTexts: slapmPolicyRuleStatsOutDiscards.setDescription('This counter counts the number of out octets discarded. Examples of this are buffer overflow, checksum error, or bad packet format.')
slapmPolicyRuleStatsInPackets = MibTableColumn((1, 3, 6, 1, 3, 88, 1, 2, 5, 1, 13), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: slapmPolicyRuleStatsInPackets.setStatus('current')
if mibBuilder.loadTexts: slapmPolicyRuleStatsInPackets.setDescription('This counter counts the number of in packets received that relate to this policy entry from IP.')
slapmPolicyRuleStatsOutPackets = MibTableColumn((1, 3, 6, 1, 3, 88, 1, 2, 5, 1, 14), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: slapmPolicyRuleStatsOutPackets.setStatus('current')
if mibBuilder.loadTexts: slapmPolicyRuleStatsOutPackets.setDescription('This counter counts the number of out packets sent by IP that relate to this policy entry.')
slapmPolicyRuleStatsInProOctets = MibTableColumn((1, 3, 6, 1, 3, 88, 1, 2, 5, 1, 15), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: slapmPolicyRuleStatsInProOctets.setStatus('current')
if mibBuilder.loadTexts: slapmPolicyRuleStatsInProOctets.setDescription('This counter counts the number of in octets that are determined to be within profile.')
slapmPolicyRuleStatsOutProOctets = MibTableColumn((1, 3, 6, 1, 3, 88, 1, 2, 5, 1, 16), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: slapmPolicyRuleStatsOutProOctets.setStatus('current')
if mibBuilder.loadTexts: slapmPolicyRuleStatsOutProOctets.setDescription('This counter counts the number of out octets that are determined to be within profile.')
slapmPolicyRuleStatsMinRate = MibTableColumn((1, 3, 6, 1, 3, 88, 1, 2, 5, 1, 17), Unsigned32()).setUnits('Kilobits per second').setMaxAccess("readonly")
if mibBuilder.loadTexts: slapmPolicyRuleStatsMinRate.setStatus('current')
if mibBuilder.loadTexts: slapmPolicyRuleStatsMinRate.setDescription('The minimum transfer rate defined for this entry.')
slapmPolicyRuleStatsMaxRate = MibTableColumn((1, 3, 6, 1, 3, 88, 1, 2, 5, 1, 18), Unsigned32()).setUnits('Kilobits per second').setMaxAccess("readonly")
if mibBuilder.loadTexts: slapmPolicyRuleStatsMaxRate.setStatus('current')
if mibBuilder.loadTexts: slapmPolicyRuleStatsMaxRate.setDescription('The maximum transfer rate defined for this entry.')
slapmPolicyRuleStatsMaxDelay = MibTableColumn((1, 3, 6, 1, 3, 88, 1, 2, 5, 1, 19), Unsigned32()).setUnits('milliseconds').setMaxAccess("readonly")
if mibBuilder.loadTexts: slapmPolicyRuleStatsMaxDelay.setStatus('current')
if mibBuilder.loadTexts: slapmPolicyRuleStatsMaxDelay.setDescription('The maximum delay defined for this entry.')
slapmPolicyRuleStatsTotalRsvpFlows = MibTableColumn((1, 3, 6, 1, 3, 88, 1, 2, 5, 1, 20), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: slapmPolicyRuleStatsTotalRsvpFlows.setStatus('current')
if mibBuilder.loadTexts: slapmPolicyRuleStatsTotalRsvpFlows.setDescription('Total number of RSVP flows that have be activated.')
slapmPolicyRuleStatsActRsvpFlows = MibTableColumn((1, 3, 6, 1, 3, 88, 1, 2, 5, 1, 21), Gauge32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: slapmPolicyRuleStatsActRsvpFlows.setStatus('current')
if mibBuilder.loadTexts: slapmPolicyRuleStatsActRsvpFlows.setDescription('Current number of active RSVP flows.')
slapmPRMonTable = MibTable((1, 3, 6, 1, 3, 88, 1, 2, 6), )
if mibBuilder.loadTexts: slapmPRMonTable.setStatus('current')
if mibBuilder.loadTexts: slapmPRMonTable.setDescription('Provides a method of monitoring policies and their effect at a system.')
slapmPRMonEntry = MibTableRow((1, 3, 6, 1, 3, 88, 1, 2, 6, 1), ).setIndexNames((0, "SLAPM-MIB", "slapmPRMonOwnerIndex"), (0, "SLAPM-MIB", "slapmPRMonSystemAddress"), (0, "SLAPM-MIB", "slapmPRMonIndex"))
if mibBuilder.loadTexts: slapmPRMonEntry.setStatus('current')
if mibBuilder.loadTexts: slapmPRMonEntry.setDescription('Defines an entry in the slapmPRMonTable. This table defines which policies should be monitored on a per policy rule basis. An attempt to set any read-create object defined within an slapmPRMonEntry while the value of slapmPRMonRowStatus is active(1) will result in an inconsistentValue error.')
slapmPRMonOwnerIndex = MibTableColumn((1, 3, 6, 1, 3, 88, 1, 2, 6, 1, 1), SnmpAdminString().subtype(subtypeSpec=ValueSizeConstraint(0, 16)))
if mibBuilder.loadTexts: slapmPRMonOwnerIndex.setStatus('current')
if mibBuilder.loadTexts: slapmPRMonOwnerIndex.setDescription("To facilitate the provisioning of access control by a security administrator using the View-Based Access Control Model (RFC 2575, VACM) for tables in which multiple users may need to independently create or modify entries, the initial index is used as an 'owner index'. Such an initial index has a syntax of SnmpAdminString, and can thus be trivially mapped to a securityName or groupName as defined in VACM, in accordance with a security policy. All entries in that table belonging to a particular user will have the same value for this initial index. For a given user's entries in a particular table, the object identifiers for the information in these entries will have the same subidentifiers (except for the 'column' subidentifier) up to the end of the encoded owner index. To configure VACM to permit access to this portion of the table, one would create vacmViewTreeFamilyTable entries with the value of vacmViewTreeFamilySubtree including the owner index portion, and vacmViewTreeFamilyMask 'wildcarding' the column subidentifier. More elaborate configurations are possible.")
slapmPRMonSystemAddress = MibTableColumn((1, 3, 6, 1, 3, 88, 1, 2, 6, 1, 2), OctetString().subtype(subtypeSpec=ConstraintsUnion(ValueSizeConstraint(0, 0), ValueSizeConstraint(4, 4), ValueSizeConstraint(16, 16), )))
if mibBuilder.loadTexts: slapmPRMonSystemAddress.setStatus('current')
if mibBuilder.loadTexts: slapmPRMonSystemAddress.setDescription('Address of a system that an Policy definition relates to. A zero length octet string can be used to indicate that only a single system is being represented. Otherwise, the length of the octet string should be 4 for an ipv4 address and 16 for an ipv6 address.')
slapmPRMonIndex = MibTableColumn((1, 3, 6, 1, 3, 88, 1, 2, 6, 1, 3), Unsigned32())
if mibBuilder.loadTexts: slapmPRMonIndex.setStatus('current')
if mibBuilder.loadTexts: slapmPRMonIndex.setDescription('An slapmPolicyNameTable index, slapmPolicyNameIndex, that points to the unique name associated with a policy rule definition.')
slapmPRMonControl = MibTableColumn((1, 3, 6, 1, 3, 88, 1, 2, 6, 1, 4), Bits().clone(namedValues=NamedValues(("monitorMinRate", 0), ("monitorMaxRate", 1), ("monitorMaxDelay", 2), ("enableAggregateTraps", 3), ("enableSubcomponentTraps", 4), ("monitorSubcomponents", 5))).clone(namedValues=NamedValues(("monitorMinRate", 0), ("monitorMaxRate", 1), ("monitorMaxDelay", 2)))).setMaxAccess("readcreate")
if mibBuilder.loadTexts: slapmPRMonControl.setStatus('current')
if mibBuilder.loadTexts: slapmPRMonControl.setDescription("The value of this object determines the type and level of monitoring that is applied to a policy rule. The value of this object can't be changed once the table entry that it is a part of is activated via a slapmPRMonRowStatus transition to active state. monitorMinRate(0) - Monitor minimum transfer rate. monitorMaxRate(1) - Monitor maximum transfer rate. monitorMaxDelay(2) - Monitor maximum delay. enableAggregateTraps(3) - The enableAggregateTraps(3) BITS setting enables notification generation when monitoring a policy rule as an aggregate using the values in the corresponding slapmPRMonStatsEntry. By default this function is not enabled. enableSubcomponentTraps(4) - This BITS setting enables notification generation when monitoring all subcomponents that are mapped to an corresponding slapmPRMonStatsEntry. By default this function is not enabled. monitorSubcomponents(5) - This BITS setting enables monitoring of each subcomponent (typically a TCP connection or UDP listener) individually.")
slapmPRMonStatus = MibTableColumn((1, 3, 6, 1, 3, 88, 1, 2, 6, 1, 5), SlapmStatus()).setMaxAccess("readonly")
if mibBuilder.loadTexts: slapmPRMonStatus.setStatus('current')
if mibBuilder.loadTexts: slapmPRMonStatus.setDescription("The value of this object indicates when a monitored value has not meet a threshold or isn't meeting the defined service level. The SlapmStatus TEXTUAL-CONVENTION defines two levels of not meeting a threshold. The first set: slaMinInRateNotAchieved(0), slaMaxInRateExceeded(1), slaMaxDelayExceeded(2), slaMinOutRateNotAchieved(3), slaMaxOutRateExceeded(4) are used to indicate when the SLA as an aggregate is not meeting a threshold while the second set: monitorMinInRateNotAchieved(5), monitorMaxInRateExceeded(6), monitorMaxDelayExceeded(7), monitorMinOutRateNotAchieved(8), monitorMaxOutRateExceeded(9) indicate that at least one subcomponent is not meeting a threshold.")
slapmPRMonInterval = MibTableColumn((1, 3, 6, 1, 3, 88, 1, 2, 6, 1, 6), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(15, 86400)).clone(20)).setUnits('seconds').setMaxAccess("readcreate")
if mibBuilder.loadTexts: slapmPRMonInterval.setStatus('current')
if mibBuilder.loadTexts: slapmPRMonInterval.setDescription('The number of seconds that defines the sample period.')
slapmPRMonIntTime = MibTableColumn((1, 3, 6, 1, 3, 88, 1, 2, 6, 1, 7), DateAndTime().clone(hexValue="0000000000000000")).setMaxAccess("readonly")
if mibBuilder.loadTexts: slapmPRMonIntTime.setStatus('current')
if mibBuilder.loadTexts: slapmPRMonIntTime.setDescription('The timestamp for when the last interval ended.')
slapmPRMonCurrentInRate = MibTableColumn((1, 3, 6, 1, 3, 88, 1, 2, 6, 1, 8), Gauge32()).setUnits('kilobits per second').setMaxAccess("readonly")
if mibBuilder.loadTexts: slapmPRMonCurrentInRate.setStatus('current')
if mibBuilder.loadTexts: slapmPRMonCurrentInRate.setDescription('Using the value of the corresponding slapmPRMonInterval, slapmPolicyRuleStatsInOctets is sampled and then divided by slapmPRMonInterval to determine the current in transfer rate.')
slapmPRMonCurrentOutRate = MibTableColumn((1, 3, 6, 1, 3, 88, 1, 2, 6, 1, 9), Gauge32()).setUnits('kilobits per second').setMaxAccess("readonly")
if mibBuilder.loadTexts: slapmPRMonCurrentOutRate.setStatus('current')
if mibBuilder.loadTexts: slapmPRMonCurrentOutRate.setDescription('Using the value of the corresponding slapmPolicyMonInterval, slapmPolicyRuleStatsOutOctets is sampled and then divided by slapmPRMonInterval to determine the current out transfer rate.')
slapmPRMonMinRateLow = MibTableColumn((1, 3, 6, 1, 3, 88, 1, 2, 6, 1, 10), Unsigned32()).setUnits('kilobits per second').setMaxAccess("readcreate")
if mibBuilder.loadTexts: slapmPRMonMinRateLow.setStatus('current')
if mibBuilder.loadTexts: slapmPRMonMinRateLow.setDescription("The threshold for generating a slapmPolicyRuleMonNotOkay notification, signalling that a monitored minimum transfer rate has not been meet. A slapmPolicyRuleMonNotOkay notification is not generated again for an slapmPRMonEntry until the minimum transfer rate exceeds slapmPRMonMinRateHigh (a slapmPolicyRuleMonOkay notification is then transmitted) and then fails below slapmPRMonMinRateLow. This behavior reduces the slapmPolicyRuleMonNotOkay notifications that are transmitted. A value of zero for this object is returned when the slapmPRMonControl monitorMinRate(0) is not enabled. When enabled the default value for this object is the min rate value specified in the associated action definition minus 10%. If the action definition doesn't have a min rate defined then there is no default for this object and a value MUST be specified prior to activating this entry when monitorMinRate(0) is selected. Note: The corresponding slapmPRMonControl BITS setting, enableAggregateTraps(3), MUST be selected in order for any notification relating to this entry to potentially be generated.")
slapmPRMonMinRateHigh = MibTableColumn((1, 3, 6, 1, 3, 88, 1, 2, 6, 1, 11), Unsigned32()).setUnits('kilobits per second').setMaxAccess("readcreate")
if mibBuilder.loadTexts: slapmPRMonMinRateHigh.setStatus('current')
if mibBuilder.loadTexts: slapmPRMonMinRateHigh.setDescription("The threshold for generating a slapmPolicyRuleMonOkay notification, signalling that a monitored minimum transfer rate has increased to an acceptable level. A value of zero for this object is returned when the slapmPRMonControl monitorMinRate(0) is not enabled. When enabled the default value for this object is the min rate value specified in the associated action definition plus 10%. If the action definition doesn't have a min rate defined then there is no default for this object and a value MUST be specified prior to activating this entry when monitorMinRate(0) is selected. Note: The corresponding slapmPRMonControl BITS setting, enableAggregateTraps(3), MUST be selected in order for any notification relating to this entry to potentially be generated.")
slapmPRMonMaxRateHigh = MibTableColumn((1, 3, 6, 1, 3, 88, 1, 2, 6, 1, 12), Unsigned32()).setUnits('kilobits per second').setMaxAccess("readcreate")
if mibBuilder.loadTexts: slapmPRMonMaxRateHigh.setStatus('current')
if mibBuilder.loadTexts: slapmPRMonMaxRateHigh.setDescription("The threshold for generating a slapmPolicyRuleMonNotOkay notification, signalling that a monitored maximum transfer rate has been exceeded. A slapmPolicyRuleNotOkay notification is not generated again for an slapmPRMonEntry until the maximum transfer rate fails below slapmPRMonMaxRateLow (a slapmPolicyRuleMonOkay notification is then transmitted) and then raises above slapmPRMonMaxRateHigh. This behavior reduces the slapmPolicyRuleMonNotOkay notifications that are transmitted. A value of zero for this object is returned when the slapmPRMonControl monitorMaxRate(1) is not enabled. When enabled the default value for this object is the max rate value specified in the associated action definition plus 10%. If the action definition doesn't have a max rate defined then there is no default for this object and a value MUST be specified prior to activating this entry when monitorMaxRate(1) is selected. Note: The corresponding slapmPRMonControl BITS setting, enableAggregateTraps(3), MUST be selected in order for any notification relating to this entry to potentially be generated.")
slapmPRMonMaxRateLow = MibTableColumn((1, 3, 6, 1, 3, 88, 1, 2, 6, 1, 13), Unsigned32()).setUnits('kilobits per second').setMaxAccess("readcreate")
if mibBuilder.loadTexts: slapmPRMonMaxRateLow.setStatus('current')
if mibBuilder.loadTexts: slapmPRMonMaxRateLow.setDescription("The threshold for generating a slapmPolicyRuleMonOkay notification, signalling that a monitored maximum transfer rate has fallen to an acceptable level. A value of zero for this object is returned when the slapmPRMonControl monitorMaxRate(1) is not enabled. When enabled the default value for this object is the max rate value specified in the associated action definition minus 10%. If the action definition doesn't have a max rate defined then there is no default for this object and a value MUST be specified prior to activating this entry when monitorMaxRate(1) is selected. Note: The corresponding slapmPRMonControl BITS setting, enableAggregateTraps(3), MUST be selected in order for any notification relating to this entry to potentially be generated.")
slapmPRMonMaxDelayHigh = MibTableColumn((1, 3, 6, 1, 3, 88, 1, 2, 6, 1, 14), Unsigned32()).setUnits('milliseconds').setMaxAccess("readcreate")
if mibBuilder.loadTexts: slapmPRMonMaxDelayHigh.setStatus('current')
if mibBuilder.loadTexts: slapmPRMonMaxDelayHigh.setDescription("The threshold for generating a slapmPolicyRuleMonNotOkay notification, signalling that a monitored maximum delay rate has been exceeded. A slapmPolicyRuleMonNotOkay notification is not generated again for an slapmPRMonEntry until the maximum delay rate falls below slapmPRMonMaxDelayLow (a slapmPolicyRuleMonOkay notification is then transmitted) and raises above slapmPRMonMaxDelayHigh. This behavior reduces the slapmPolicyRuleMonNotOkay notifications that are transmitted. A value of zero for this object is returned when the slapmPRMonControl monitorMaxDelay(4) is not enabled. When enabled the default value for this object is the max delay value specified in the associated action definition plus 10%. If the action definition doesn't have a max delay defined then there is no default for this object and a value MUST be specified prior to activating this entry when monitorMaxDelay(4) is selected. Note: The corresponding slapmPRMonControl BITS setting, enableAggregateTraps(3), MUST be selected in order for any notification relating to this entry to potentially be generated.")
slapmPRMonMaxDelayLow = MibTableColumn((1, 3, 6, 1, 3, 88, 1, 2, 6, 1, 15), Unsigned32()).setUnits('milliseconds').setMaxAccess("readcreate")
if mibBuilder.loadTexts: slapmPRMonMaxDelayLow.setStatus('current')
if mibBuilder.loadTexts: slapmPRMonMaxDelayLow.setDescription("The threshold for generating a slapmPolicyRuleMonOkay notification, signalling that a monitored maximum delay rate has fallen to an acceptable level. A value of zero for this object is returned when the slapmPRMonControl monitorMaxDelay(4) is not enabled. When enabled the default value for this object is the max delay value specified in the associated action definition minus 10%. If the action definition doesn't have a max delay defined then there is no default for this object and a value MUST be specified prior to activating this entry when monitorMaxDelay(4) is selected. Note: The corresponding slapmPRMonControl BITS setting, enableAggregateTraps(3), MUST be selected in order for any notification relating to this entry to potentially be generated.")
slapmPRMonMinInRateNotAchieves = MibTableColumn((1, 3, 6, 1, 3, 88, 1, 2, 6, 1, 16), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: slapmPRMonMinInRateNotAchieves.setStatus('current')
if mibBuilder.loadTexts: slapmPRMonMinInRateNotAchieves.setDescription('The number of times that a minimum transfer in rate was not achieved.')
slapmPRMonMaxInRateExceeds = MibTableColumn((1, 3, 6, 1, 3, 88, 1, 2, 6, 1, 17), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: slapmPRMonMaxInRateExceeds.setStatus('current')
if mibBuilder.loadTexts: slapmPRMonMaxInRateExceeds.setDescription('The number of times that a maximum transfer in rate was exceeded.')
slapmPRMonMaxDelayExceeds = MibTableColumn((1, 3, 6, 1, 3, 88, 1, 2, 6, 1, 18), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: slapmPRMonMaxDelayExceeds.setStatus('current')
if mibBuilder.loadTexts: slapmPRMonMaxDelayExceeds.setDescription('The number of times that a maximum delay in rate was exceeded.')
slapmPRMonMinOutRateNotAchieves = MibTableColumn((1, 3, 6, 1, 3, 88, 1, 2, 6, 1, 19), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: slapmPRMonMinOutRateNotAchieves.setStatus('current')
if mibBuilder.loadTexts: slapmPRMonMinOutRateNotAchieves.setDescription('The number of times that a minimum transfer out rate was not achieved.')
slapmPRMonMaxOutRateExceeds = MibTableColumn((1, 3, 6, 1, 3, 88, 1, 2, 6, 1, 20), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: slapmPRMonMaxOutRateExceeds.setStatus('current')
if mibBuilder.loadTexts: slapmPRMonMaxOutRateExceeds.setDescription('The number of times that a maximum transfer out rate was exceeded.')
slapmPRMonCurrentDelayRate = MibTableColumn((1, 3, 6, 1, 3, 88, 1, 2, 6, 1, 21), Gauge32()).setUnits('milliseconds').setMaxAccess("readonly")
if mibBuilder.loadTexts: slapmPRMonCurrentDelayRate.setStatus('current')
if mibBuilder.loadTexts: slapmPRMonCurrentDelayRate.setDescription('The current delay rate for this entry. This is calculated by taking the average of the TCP round trip times for all associating slapmSubcomponentTable entries within a interval.')
slapmPRMonRowStatus = MibTableColumn((1, 3, 6, 1, 3, 88, 1, 2, 6, 1, 22), RowStatus()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: slapmPRMonRowStatus.setStatus('current')
if mibBuilder.loadTexts: slapmPRMonRowStatus.setDescription('This object allows entries to be created and deleted in the slapmPRMonTable. An entry in this table is deleted by setting this object to destroy(6). Removal of an corresponding (same policy index) slapmPolicyRuleStatsEntry has the side effect of the automatic deletion an entry in this table. Note that an attempt to set any read-create object defined within an slapmPRMonEntry while the value of slapmPRMonRowStatus is active(1) will result in an inconsistentValue error.')
slapmMonitoredEventNotAchieved = NotificationType((1, 3, 6, 1, 3, 88, 0, 1)).setObjects(("SLAPM-MIB", "slapmPolicyMonitorIntTime"), ("SLAPM-MIB", "slapmPolicyMonitorControl"), ("SLAPM-MIB", "slapmPolicyMonitorStatus"), ("SLAPM-MIB", "slapmPolicyMonitorStatus"), ("SLAPM-MIB", "slapmPolicyMonitorCurrentInRate"), ("SLAPM-MIB", "slapmPolicyMonitorCurrentOutRate"), ("SLAPM-MIB", "slapmPolicyMonitorCurrentDelayRate"))
if mibBuilder.loadTexts: slapmMonitoredEventNotAchieved.setStatus('deprecated')
if mibBuilder.loadTexts: slapmMonitoredEventNotAchieved.setDescription('This notification is generated when an monitored event is not achieved with respect to threshold. This applies only towards monitoring a policy traffic profile as an aggregate via an associating slapmPolicyStatsEntry. The value of slapmPolicyMonitorControl can be examined to determine what is being monitored. The first slapmPolicyMonitorStatus value supplies the current monitor status while the 2nd value supplies the previous status. Note: The corresponding slapmPolicyMonitorControl BITS setting, enableAggregateTraps(3), MUST be selected in order for this notification to potentially be generated.')
slapmMonitoredEventOkay = NotificationType((1, 3, 6, 1, 3, 88, 0, 2)).setObjects(("SLAPM-MIB", "slapmPolicyMonitorIntTime"), ("SLAPM-MIB", "slapmPolicyMonitorControl"), ("SLAPM-MIB", "slapmPolicyMonitorStatus"), ("SLAPM-MIB", "slapmPolicyMonitorStatus"), ("SLAPM-MIB", "slapmPolicyMonitorCurrentInRate"), ("SLAPM-MIB", "slapmPolicyMonitorCurrentOutRate"), ("SLAPM-MIB", "slapmPolicyMonitorCurrentDelayRate"))
if mibBuilder.loadTexts: slapmMonitoredEventOkay.setStatus('deprecated')
if mibBuilder.loadTexts: slapmMonitoredEventOkay.setDescription('This notification is generated when a monitored event has improved to an acceptable level. This applies only towards monitoring a policy traffic profile as an aggregate via an associating slapmPolicyStatsEntry. The value of slapmPolicyMonitorControl can be examined to determine what is being monitored. The first slapmPolicyMonitorStatus value supplies the current monitor status while the 2nd value supplies the previous status. Note: The corresponding slapmPolicyMonitorControl BITS setting, enableAggregateTraps(3), MUST be selected in order for this notification to potentially be generated.')
slapmPolicyProfileDeleted = NotificationType((1, 3, 6, 1, 3, 88, 0, 3)).setObjects(("SLAPM-MIB", "slapmPolicyStatsActiveConns"), ("SLAPM-MIB", "slapmPolicyStatsTotalConns"), ("SLAPM-MIB", "slapmPolicyStatsFirstActivated"), ("SLAPM-MIB", "slapmPolicyStatsLastMapping"), ("SLAPM-MIB", "slapmPolicyStatsInOctets"), ("SLAPM-MIB", "slapmPolicyStatsOutOctets"), ("SLAPM-MIB", "slapmPolicyStatsConnectionLimit"), ("SLAPM-MIB", "slapmPolicyStatsCountAccepts"), ("SLAPM-MIB", "slapmPolicyStatsCountDenies"), ("SLAPM-MIB", "slapmPolicyStatsInDiscards"), ("SLAPM-MIB", "slapmPolicyStatsOutDiscards"), ("SLAPM-MIB", "slapmPolicyStatsInPackets"), ("SLAPM-MIB", "slapmPolicyStatsOutPackets"), ("SLAPM-MIB", "slapmPolicyStatsInProfileOctets"), ("SLAPM-MIB", "slapmPolicyStatsOutProfileOctets"), ("SLAPM-MIB", "slapmPolicyStatsMinRate"), ("SLAPM-MIB", "slapmPolicyStatsMaxRate"), ("SLAPM-MIB", "slapmPolicyStatsMaxDelay"))
if mibBuilder.loadTexts: slapmPolicyProfileDeleted.setStatus('deprecated')
if mibBuilder.loadTexts: slapmPolicyProfileDeleted.setDescription('A slapmPolicyDeleted notification is sent when a slapmPolicyStatsEntry is deleted if the value of slapmPolicyTrapEnable is enabled(1).')
slapmPolicyMonitorDeleted = NotificationType((1, 3, 6, 1, 3, 88, 0, 4)).setObjects(("SLAPM-MIB", "slapmPolicyMonitorStatus"), ("SLAPM-MIB", "slapmPolicyMonitorInterval"), ("SLAPM-MIB", "slapmPolicyMonitorIntTime"), ("SLAPM-MIB", "slapmPolicyMonitorCurrentInRate"), ("SLAPM-MIB", "slapmPolicyMonitorCurrentOutRate"), ("SLAPM-MIB", "slapmPolicyMonitorCurrentDelayRate"), ("SLAPM-MIB", "slapmPolicyMonitorMinRateLow"), ("SLAPM-MIB", "slapmPolicyMonitorMinRateHigh"), ("SLAPM-MIB", "slapmPolicyMonitorMaxRateHigh"), ("SLAPM-MIB", "slapmPolicyMonitorMaxRateLow"), ("SLAPM-MIB", "slapmPolicyMonitorMaxDelayHigh"), ("SLAPM-MIB", "slapmPolicyMonitorMaxDelayLow"), ("SLAPM-MIB", "slapmPolicyMonitorMinInRateNotAchieves"), ("SLAPM-MIB", "slapmPolicyMonitorMaxInRateExceeds"), ("SLAPM-MIB", "slapmPolicyMonitorMaxDelayExceeds"), ("SLAPM-MIB", "slapmPolicyMonitorMinOutRateNotAchieves"), ("SLAPM-MIB", "slapmPolicyMonitorMaxOutRateExceeds"))
if mibBuilder.loadTexts: slapmPolicyMonitorDeleted.setStatus('deprecated')
if mibBuilder.loadTexts: slapmPolicyMonitorDeleted.setDescription('A slapmPolicyMonitorDeleted notification is sent when a slapmPolicyMonitorEntry is deleted if the value of slapmPolicyTrapEnable is enabled(1).')
slapmSubcomponentMonitoredEventNotAchieved = NotificationType((1, 3, 6, 1, 3, 88, 0, 5)).setObjects(("SLAPM-MIB", "slapmSubcomponentSystemAddress"), ("SLAPM-MIB", "slapmSubcomponentPolicyName"), ("SLAPM-MIB", "slapmSubcomponentTrafficProfileName"), ("SLAPM-MIB", "slapmSubcomponentMonitorStatus"), ("SLAPM-MIB", "slapmSubcomponentMonitorStatus"), ("SLAPM-MIB", "slapmSubcomponentMonitorIntTime"), ("SLAPM-MIB", "slapmSubcomponentMonitorCurrentInRate"), ("SLAPM-MIB", "slapmSubcomponentMonitorCurrentOutRate"), ("SLAPM-MIB", "slapmSubcomponentTcpRoundTripTime"))
if mibBuilder.loadTexts: slapmSubcomponentMonitoredEventNotAchieved.setStatus('deprecated')
if mibBuilder.loadTexts: slapmSubcomponentMonitoredEventNotAchieved.setDescription('This notification is generated when a monitored value does not achieved a threshold specification. This applies only towards monitoring the individual components of a policy traffic profile. The value of the corresponding slapmPolicyMonitorControl can be examined to determine what is being monitored. The first slapmSubcomponentMonitorStatus value supplies the current monitor status while the 2nd value supplies the previous status. Note: The corresponding slapmPolicyMonitorControl BITS setting, enableSubcomponentTraps(4), MUST be selected in order for this notification to potentially be generated.')
slapmSubcomponentMonitoredEventOkay = NotificationType((1, 3, 6, 1, 3, 88, 0, 6)).setObjects(("SLAPM-MIB", "slapmSubcomponentSystemAddress"), ("SLAPM-MIB", "slapmSubcomponentPolicyName"), ("SLAPM-MIB", "slapmSubcomponentTrafficProfileName"), ("SLAPM-MIB", "slapmSubcomponentMonitorStatus"), ("SLAPM-MIB", "slapmSubcomponentMonitorStatus"), ("SLAPM-MIB", "slapmSubcomponentMonitorIntTime"), ("SLAPM-MIB", "slapmSubcomponentMonitorCurrentInRate"), ("SLAPM-MIB", "slapmSubcomponentMonitorCurrentOutRate"), ("SLAPM-MIB", "slapmSubcomponentTcpRoundTripTime"))
if mibBuilder.loadTexts: slapmSubcomponentMonitoredEventOkay.setStatus('deprecated')
if mibBuilder.loadTexts: slapmSubcomponentMonitoredEventOkay.setDescription('This notification is generated when a monitored value has reached an acceptable level. Note: The corresponding slapmPolicyMonitorControl BITS setting, enableSubcomponentTraps(3), MUST be selected in order for this notification to potentially be generated.')
slapmPolicyRuleMonNotOkay = NotificationType((1, 3, 6, 1, 3, 88, 0, 7)).setObjects(("SLAPM-MIB", "slapmPRMonIntTime"), ("SLAPM-MIB", "slapmPRMonControl"), ("SLAPM-MIB", "slapmPRMonStatus"), ("SLAPM-MIB", "slapmPRMonStatus"), ("SLAPM-MIB", "slapmPRMonCurrentInRate"), ("SLAPM-MIB", "slapmPRMonCurrentOutRate"), ("SLAPM-MIB", "slapmPRMonCurrentDelayRate"))
if mibBuilder.loadTexts: slapmPolicyRuleMonNotOkay.setStatus('current')
if mibBuilder.loadTexts: slapmPolicyRuleMonNotOkay.setDescription('This notification is generated when an monitored event is not achieved with respect to a threshold. This applies only towards monitoring a policy rule as an aggregate via an associating slapmPolicyRuleStatsEntry. The value of slapmPRMonControl can be examined to determine what is being monitored. The first slapmPRMonStatus value supplies the current monitor status while the 2nd value supplies the previous status. Note: The corresponding slapmPRMonControl BITS setting, enableAggregateTraps(3), MUST be selected in order for this notification to potentially be generated.')
slapmPolicyRuleMonOkay = NotificationType((1, 3, 6, 1, 3, 88, 0, 8)).setObjects(("SLAPM-MIB", "slapmPRMonIntTime"), ("SLAPM-MIB", "slapmPRMonControl"), ("SLAPM-MIB", "slapmPRMonStatus"), ("SLAPM-MIB", "slapmPRMonStatus"), ("SLAPM-MIB", "slapmPRMonCurrentInRate"), ("SLAPM-MIB", "slapmPRMonCurrentOutRate"), ("SLAPM-MIB", "slapmPRMonCurrentDelayRate"))
if mibBuilder.loadTexts: slapmPolicyRuleMonOkay.setStatus('current')
if mibBuilder.loadTexts: slapmPolicyRuleMonOkay.setDescription('This notification is generated when a monitored event has improved to an acceptable level. This applies only towards monitoring a policy rule as an aggregate via an associating slapmPolicyRuleStatsEntry. The value of slapmPRMonControl can be examined to determine what is being monitored. The first slapmPRMonStatus value supplies the current monitor status while the 2nd value supplies the previous status. Note: The corresponding slapmPRMonControl BITS setting, enableAggregateTraps(3), MUST be selected in order for this notification to potentially be generated.')
slapmPolicyRuleDeleted = NotificationType((1, 3, 6, 1, 3, 88, 0, 9)).setObjects(("SLAPM-MIB", "slapmPolicyRuleStatsActiveConns"), ("SLAPM-MIB", "slapmPolicyRuleStatsTotalConns"), ("SLAPM-MIB", "slapmPolicyRuleStatsLActivated"), ("SLAPM-MIB", "slapmPolicyRuleStatsLastMapping"), ("SLAPM-MIB", "slapmPolicyRuleStatsInOctets"), ("SLAPM-MIB", "slapmPolicyRuleStatsOutOctets"), ("SLAPM-MIB", "slapmPolicyRuleStatsConnLimit"), ("SLAPM-MIB", "slapmPolicyRuleStatsCountAccepts"), ("SLAPM-MIB", "slapmPolicyRuleStatsCountDenies"), ("SLAPM-MIB", "slapmPolicyRuleStatsInDiscards"), ("SLAPM-MIB", "slapmPolicyRuleStatsOutDiscards"), ("SLAPM-MIB", "slapmPolicyRuleStatsInPackets"), ("SLAPM-MIB", "slapmPolicyRuleStatsOutPackets"), ("SLAPM-MIB", "slapmPolicyRuleStatsInProOctets"), ("SLAPM-MIB", "slapmPolicyRuleStatsOutProOctets"), ("SLAPM-MIB", "slapmPolicyRuleStatsMinRate"), ("SLAPM-MIB", "slapmPolicyRuleStatsMaxRate"), ("SLAPM-MIB", "slapmPolicyRuleStatsMaxDelay"), ("SLAPM-MIB", "slapmPolicyRuleStatsTotalRsvpFlows"), ("SLAPM-MIB", "slapmPolicyRuleStatsActRsvpFlows"))
if mibBuilder.loadTexts: slapmPolicyRuleDeleted.setStatus('current')
if mibBuilder.loadTexts: slapmPolicyRuleDeleted.setDescription('A slapmPolicyRuleDeleted notification is sent when a slapmPolicyRuleStatsEntry is deleted if the value of slapmPolicyTrapEnable is enabled(1).')
slapmPolicyRuleMonDeleted = NotificationType((1, 3, 6, 1, 3, 88, 0, 10)).setObjects(("SLAPM-MIB", "slapmPRMonControl"), ("SLAPM-MIB", "slapmPRMonStatus"), ("SLAPM-MIB", "slapmPRMonInterval"), ("SLAPM-MIB", "slapmPRMonIntTime"), ("SLAPM-MIB", "slapmPRMonCurrentInRate"), ("SLAPM-MIB", "slapmPRMonCurrentOutRate"), ("SLAPM-MIB", "slapmPRMonCurrentDelayRate"), ("SLAPM-MIB", "slapmPRMonMinRateLow"), ("SLAPM-MIB", "slapmPRMonMinRateHigh"), ("SLAPM-MIB", "slapmPRMonMaxRateHigh"), ("SLAPM-MIB", "slapmPRMonMaxRateLow"), ("SLAPM-MIB", "slapmPRMonMaxDelayHigh"), ("SLAPM-MIB", "slapmPRMonMaxDelayLow"), ("SLAPM-MIB", "slapmPRMonMinInRateNotAchieves"), ("SLAPM-MIB", "slapmPRMonMaxInRateExceeds"), ("SLAPM-MIB", "slapmPRMonMaxDelayExceeds"), ("SLAPM-MIB", "slapmPRMonMinOutRateNotAchieves"), ("SLAPM-MIB", "slapmPRMonMaxOutRateExceeds"))
if mibBuilder.loadTexts: slapmPolicyRuleMonDeleted.setStatus('current')
if mibBuilder.loadTexts: slapmPolicyRuleMonDeleted.setDescription('A slapmPolicyRuleMonDeleted notification is sent when a slapmPRMonEntry is deleted if the value of slapmPolicyTrapEnable is enabled(1).')
slapmSubcMonitorNotOkay = NotificationType((1, 3, 6, 1, 3, 88, 0, 11)).setObjects(("SLAPM-MIB", "slapmSubcomponentSystemAddress"), ("SLAPM-MIB", "slapmSubcomponentPolicyRuleIndex"), ("SLAPM-MIB", "slapmPRMonControl"), ("SLAPM-MIB", "slapmSubcomponentMonitorStatus"), ("SLAPM-MIB", "slapmSubcomponentMonitorStatus"), ("SLAPM-MIB", "slapmSubcomponentMonitorIntTime"), ("SLAPM-MIB", "slapmSubcomponentMonitorCurrentInRate"), ("SLAPM-MIB", "slapmSubcomponentMonitorCurrentOutRate"), ("SLAPM-MIB", "slapmSubcomponentTcpRoundTripTime"))
if mibBuilder.loadTexts: slapmSubcMonitorNotOkay.setStatus('current')
if mibBuilder.loadTexts: slapmSubcMonitorNotOkay.setDescription('This notification is generated when a monitored value does not achieved a threshold specification. This applies only towards monitoring the individual components of a policy rule. The value of the corresponding slapmPRMonControl can be examined to determine what is being monitored. The first slapmSubcomponentMonitorStatus value supplies the current monitor status while the 2nd value supplies the previous status. Note: The corresponding slapmPRMonControl BITS setting, enableSubcomponentTraps(4), MUST be selected in order for this notification to potentially be generated.')
slapmSubcMonitorOkay = NotificationType((1, 3, 6, 1, 3, 88, 0, 12)).setObjects(("SLAPM-MIB", "slapmSubcomponentSystemAddress"), ("SLAPM-MIB", "slapmSubcomponentPolicyRuleIndex"), ("SLAPM-MIB", "slapmPRMonControl"), ("SLAPM-MIB", "slapmSubcomponentMonitorStatus"), ("SLAPM-MIB", "slapmSubcomponentMonitorStatus"), ("SLAPM-MIB", "slapmSubcomponentMonitorIntTime"), ("SLAPM-MIB", "slapmSubcomponentMonitorCurrentInRate"), ("SLAPM-MIB", "slapmSubcomponentMonitorCurrentOutRate"), ("SLAPM-MIB", "slapmSubcomponentTcpRoundTripTime"))
if mibBuilder.loadTexts: slapmSubcMonitorOkay.setStatus('current')
if mibBuilder.loadTexts: slapmSubcMonitorOkay.setDescription('This notification is generated when a monitored value has reached an acceptable level. Note: The corresponding slapmPRMonControl BITS setting, enableSubcomponentTraps(3), MUST be selected in order for this notification to potentially be generated.')
slapmCompliances = MibIdentifier((1, 3, 6, 1, 3, 88, 2, 1))
slapmGroups = MibIdentifier((1, 3, 6, 1, 3, 88, 2, 2))
slapmCompliance = ModuleCompliance((1, 3, 6, 1, 3, 88, 2, 1, 1)).setObjects(("SLAPM-MIB", "slapmBaseGroup2"), ("SLAPM-MIB", "slapmNotGroup2"), ("SLAPM-MIB", "slapmEndSystemGroup2"), ("SLAPM-MIB", "slapmEndSystemNotGroup2"), ("SLAPM-MIB", "slapmBaseGroup"), ("SLAPM-MIB", "slapmNotGroup"), ("SLAPM-MIB", "slapmOptionalGroup"), ("SLAPM-MIB", "slapmEndSystemGroup"), ("SLAPM-MIB", "slapmEndSystemNotGroup"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
slapmCompliance = slapmCompliance.setStatus('current')
if mibBuilder.loadTexts: slapmCompliance.setDescription('The compliance statement for the SLAPM-MIB.')
slapmBaseGroup = ObjectGroup((1, 3, 6, 1, 3, 88, 2, 2, 1)).setObjects(("SLAPM-MIB", "slapmSpinLock"), ("SLAPM-MIB", "slapmPolicyCountQueries"), ("SLAPM-MIB", "slapmPolicyCountAccesses"), ("SLAPM-MIB", "slapmPolicyCountSuccessAccesses"), ("SLAPM-MIB", "slapmPolicyCountNotFounds"), ("SLAPM-MIB", "slapmPolicyPurgeTime"), ("SLAPM-MIB", "slapmPolicyTrapEnable"), ("SLAPM-MIB", "slapmPolicyStatsOperStatus"), ("SLAPM-MIB", "slapmPolicyStatsActiveConns"), ("SLAPM-MIB", "slapmPolicyStatsFirstActivated"), ("SLAPM-MIB", "slapmPolicyStatsLastMapping"), ("SLAPM-MIB", "slapmPolicyStatsInOctets"), ("SLAPM-MIB", "slapmPolicyStatsOutOctets"), ("SLAPM-MIB", "slapmPolicyStatsConnectionLimit"), ("SLAPM-MIB", "slapmPolicyStatsTotalConns"), ("SLAPM-MIB", "slapmPolicyStatsCountAccepts"), ("SLAPM-MIB", "slapmPolicyStatsCountDenies"), ("SLAPM-MIB", "slapmPolicyStatsInDiscards"), ("SLAPM-MIB", "slapmPolicyStatsOutDiscards"), ("SLAPM-MIB", "slapmPolicyStatsInPackets"), ("SLAPM-MIB", "slapmPolicyStatsOutPackets"), ("SLAPM-MIB", "slapmPolicyStatsMinRate"), ("SLAPM-MIB", "slapmPolicyStatsMaxRate"), ("SLAPM-MIB", "slapmPolicyStatsMaxDelay"), ("SLAPM-MIB", "slapmPolicyMonitorControl"), ("SLAPM-MIB", "slapmPolicyMonitorStatus"), ("SLAPM-MIB", "slapmPolicyMonitorInterval"), ("SLAPM-MIB", "slapmPolicyMonitorIntTime"), ("SLAPM-MIB", "slapmPolicyMonitorCurrentInRate"), ("SLAPM-MIB", "slapmPolicyMonitorCurrentOutRate"), ("SLAPM-MIB", "slapmPolicyMonitorMinRateLow"), ("SLAPM-MIB", "slapmPolicyMonitorMinRateHigh"), ("SLAPM-MIB", "slapmPolicyMonitorMaxRateHigh"), ("SLAPM-MIB", "slapmPolicyMonitorMaxRateLow"), ("SLAPM-MIB", "slapmPolicyMonitorMaxDelayHigh"), ("SLAPM-MIB", "slapmPolicyMonitorMaxDelayLow"), ("SLAPM-MIB", "slapmPolicyMonitorMinInRateNotAchieves"), ("SLAPM-MIB", "slapmPolicyMonitorMaxInRateExceeds"), ("SLAPM-MIB", "slapmPolicyMonitorMaxDelayExceeds"), ("SLAPM-MIB", "slapmPolicyMonitorMinOutRateNotAchieves"), ("SLAPM-MIB", "slapmPolicyMonitorMaxOutRateExceeds"), ("SLAPM-MIB", "slapmPolicyMonitorCurrentDelayRate"), ("SLAPM-MIB", "slapmPolicyMonitorRowStatus"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
slapmBaseGroup = slapmBaseGroup.setStatus('deprecated')
if mibBuilder.loadTexts: slapmBaseGroup.setDescription('The group of objects defined by this MIB that are required for all implementations to be compliant.')
slapmOptionalGroup = ObjectGroup((1, 3, 6, 1, 3, 88, 2, 2, 2)).setObjects(("SLAPM-MIB", "slapmPolicyStatsInProfileOctets"), ("SLAPM-MIB", "slapmPolicyStatsOutProfileOctets"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
slapmOptionalGroup = slapmOptionalGroup.setStatus('deprecated')
if mibBuilder.loadTexts: slapmOptionalGroup.setDescription('The group of objects defined by this MIB that are optional.')
slapmEndSystemGroup = ObjectGroup((1, 3, 6, 1, 3, 88, 2, 2, 3)).setObjects(("SLAPM-MIB", "slapmPolicyTrapFilter"), ("SLAPM-MIB", "slapmSubcomponentProtocol"), ("SLAPM-MIB", "slapmSubcomponentSystemAddress"), ("SLAPM-MIB", "slapmSubcomponentPolicyName"), ("SLAPM-MIB", "slapmSubcomponentTrafficProfileName"), ("SLAPM-MIB", "slapmSubcomponentLastActivity"), ("SLAPM-MIB", "slapmSubcomponentInOctets"), ("SLAPM-MIB", "slapmSubcomponentOutOctets"), ("SLAPM-MIB", "slapmSubcomponentTcpOutBufferedOctets"), ("SLAPM-MIB", "slapmSubcomponentTcpInBufferedOctets"), ("SLAPM-MIB", "slapmSubcomponentTcpReXmts"), ("SLAPM-MIB", "slapmSubcomponentTcpRoundTripTime"), ("SLAPM-MIB", "slapmSubcomponentTcpRoundTripVariance"), ("SLAPM-MIB", "slapmSubcomponentInPdus"), ("SLAPM-MIB", "slapmSubcomponentOutPdus"), ("SLAPM-MIB", "slapmSubcomponentApplName"), ("SLAPM-MIB", "slapmSubcomponentMonitorStatus"), ("SLAPM-MIB", "slapmSubcomponentMonitorIntTime"), ("SLAPM-MIB", "slapmSubcomponentMonitorCurrentOutRate"), ("SLAPM-MIB", "slapmSubcomponentMonitorCurrentInRate"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
slapmEndSystemGroup = slapmEndSystemGroup.setStatus('deprecated')
if mibBuilder.loadTexts: slapmEndSystemGroup.setDescription('The group of objects defined by this MIB that are required for end system implementations.')
slapmNotGroup = NotificationGroup((1, 3, 6, 1, 3, 88, 2, 2, 4)).setObjects(("SLAPM-MIB", "slapmMonitoredEventNotAchieved"), ("SLAPM-MIB", "slapmMonitoredEventOkay"), ("SLAPM-MIB", "slapmPolicyProfileDeleted"), ("SLAPM-MIB", "slapmPolicyMonitorDeleted"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
slapmNotGroup = slapmNotGroup.setStatus('deprecated')
if mibBuilder.loadTexts: slapmNotGroup.setDescription('The group of notifications defined by this MIB that MUST be implemented.')
slapmEndSystemNotGroup = NotificationGroup((1, 3, 6, 1, 3, 88, 2, 2, 5)).setObjects(("SLAPM-MIB", "slapmSubcomponentMonitoredEventNotAchieved"), ("SLAPM-MIB", "slapmSubcomponentMonitoredEventOkay"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
slapmEndSystemNotGroup = slapmEndSystemNotGroup.setStatus('deprecated')
if mibBuilder.loadTexts: slapmEndSystemNotGroup.setDescription('The group of objects defined by this MIB that are required for end system implementations.')
slapmBaseGroup2 = ObjectGroup((1, 3, 6, 1, 3, 88, 2, 2, 6)).setObjects(("SLAPM-MIB", "slapmSpinLock"), ("SLAPM-MIB", "slapmPolicyCountQueries"), ("SLAPM-MIB", "slapmPolicyCountAccesses"), ("SLAPM-MIB", "slapmPolicyCountSuccessAccesses"), ("SLAPM-MIB", "slapmPolicyCountNotFounds"), ("SLAPM-MIB", "slapmPolicyPurgeTime"), ("SLAPM-MIB", "slapmPolicyTrapEnable"), ("SLAPM-MIB", "slapmPolicyNameOfRule"), ("SLAPM-MIB", "slapmPolicyRuleStatsOperStatus"), ("SLAPM-MIB", "slapmPolicyRuleStatsActiveConns"), ("SLAPM-MIB", "slapmPolicyRuleStatsTotalConns"), ("SLAPM-MIB", "slapmPolicyRuleStatsLActivated"), ("SLAPM-MIB", "slapmPolicyRuleStatsLastMapping"), ("SLAPM-MIB", "slapmPolicyRuleStatsInOctets"), ("SLAPM-MIB", "slapmPolicyRuleStatsOutOctets"), ("SLAPM-MIB", "slapmPolicyRuleStatsConnLimit"), ("SLAPM-MIB", "slapmPolicyRuleStatsCountAccepts"), ("SLAPM-MIB", "slapmPolicyRuleStatsCountDenies"), ("SLAPM-MIB", "slapmPolicyRuleStatsInDiscards"), ("SLAPM-MIB", "slapmPolicyRuleStatsOutDiscards"), ("SLAPM-MIB", "slapmPolicyRuleStatsInPackets"), ("SLAPM-MIB", "slapmPolicyRuleStatsOutPackets"), ("SLAPM-MIB", "slapmPolicyRuleStatsInProOctets"), ("SLAPM-MIB", "slapmPolicyRuleStatsOutProOctets"), ("SLAPM-MIB", "slapmPolicyRuleStatsMinRate"), ("SLAPM-MIB", "slapmPolicyRuleStatsMaxRate"), ("SLAPM-MIB", "slapmPolicyRuleStatsMaxDelay"), ("SLAPM-MIB", "slapmPolicyRuleStatsTotalRsvpFlows"), ("SLAPM-MIB", "slapmPolicyRuleStatsActRsvpFlows"), ("SLAPM-MIB", "slapmPRMonControl"), ("SLAPM-MIB", "slapmPRMonStatus"), ("SLAPM-MIB", "slapmPRMonInterval"), ("SLAPM-MIB", "slapmPRMonIntTime"), ("SLAPM-MIB", "slapmPRMonCurrentInRate"), ("SLAPM-MIB", "slapmPRMonCurrentOutRate"), ("SLAPM-MIB", "slapmPRMonMinRateLow"), ("SLAPM-MIB", "slapmPRMonMinRateHigh"), ("SLAPM-MIB", "slapmPRMonMaxRateHigh"), ("SLAPM-MIB", "slapmPRMonMaxRateLow"), ("SLAPM-MIB", "slapmPRMonMaxDelayHigh"), ("SLAPM-MIB", "slapmPRMonMaxDelayLow"), ("SLAPM-MIB", "slapmPRMonMinInRateNotAchieves"), ("SLAPM-MIB", "slapmPRMonMaxInRateExceeds"), ("SLAPM-MIB", "slapmPRMonMaxDelayExceeds"), ("SLAPM-MIB", "slapmPRMonMinOutRateNotAchieves"), ("SLAPM-MIB", "slapmPRMonMaxOutRateExceeds"), ("SLAPM-MIB", "slapmPRMonCurrentDelayRate"), ("SLAPM-MIB", "slapmPRMonRowStatus"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
slapmBaseGroup2 = slapmBaseGroup2.setStatus('current')
if mibBuilder.loadTexts: slapmBaseGroup2.setDescription('The group of objects defined by this MIB that are required for all implementations to be compliant.')
slapmEndSystemGroup2 = ObjectGroup((1, 3, 6, 1, 3, 88, 2, 2, 7)).setObjects(("SLAPM-MIB", "slapmPolicyTrapFilter"), ("SLAPM-MIB", "slapmSubcomponentProtocol"), ("SLAPM-MIB", "slapmSubcomponentSystemAddress"), ("SLAPM-MIB", "slapmSubcomponentLastActivity"), ("SLAPM-MIB", "slapmSubcomponentInOctets"), ("SLAPM-MIB", "slapmSubcomponentOutOctets"), ("SLAPM-MIB", "slapmSubcomponentTcpOutBufferedOctets"), ("SLAPM-MIB", "slapmSubcomponentTcpInBufferedOctets"), ("SLAPM-MIB", "slapmSubcomponentTcpReXmts"), ("SLAPM-MIB", "slapmSubcomponentTcpRoundTripTime"), ("SLAPM-MIB", "slapmSubcomponentTcpRoundTripVariance"), ("SLAPM-MIB", "slapmSubcomponentInPdus"), ("SLAPM-MIB", "slapmSubcomponentOutPdus"), ("SLAPM-MIB", "slapmSubcomponentApplName"), ("SLAPM-MIB", "slapmSubcomponentMonitorStatus"), ("SLAPM-MIB", "slapmSubcomponentMonitorIntTime"), ("SLAPM-MIB", "slapmSubcomponentMonitorCurrentOutRate"), ("SLAPM-MIB", "slapmSubcomponentMonitorCurrentInRate"), ("SLAPM-MIB", "slapmSubcomponentPolicyRuleIndex"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
slapmEndSystemGroup2 = slapmEndSystemGroup2.setStatus('current')
if mibBuilder.loadTexts: slapmEndSystemGroup2.setDescription('The group of objects defined by this MIB that are required for end system implementations.')
slapmNotGroup2 = NotificationGroup((1, 3, 6, 1, 3, 88, 2, 2, 8)).setObjects(("SLAPM-MIB", "slapmPolicyRuleMonNotOkay"), ("SLAPM-MIB", "slapmPolicyRuleMonOkay"), ("SLAPM-MIB", "slapmPolicyRuleDeleted"), ("SLAPM-MIB", "slapmPolicyRuleMonDeleted"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
slapmNotGroup2 = slapmNotGroup2.setStatus('current')
if mibBuilder.loadTexts: slapmNotGroup2.setDescription('The group of notifications defined by this MIB that MUST be implemented.')
slapmEndSystemNotGroup2 = NotificationGroup((1, 3, 6, 1, 3, 88, 2, 2, 9)).setObjects(("SLAPM-MIB", "slapmSubcMonitorNotOkay"), ("SLAPM-MIB", "slapmSubcMonitorOkay"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
slapmEndSystemNotGroup2 = slapmEndSystemNotGroup2.setStatus('current')
if mibBuilder.loadTexts: slapmEndSystemNotGroup2.setDescription('The group of objects defined by this MIB that are required for end system implementations.')
mibBuilder.exportSymbols("SLAPM-MIB", slapmPRMonCurrentOutRate=slapmPRMonCurrentOutRate, slapmPRMonMaxRateLow=slapmPRMonMaxRateLow, slapmPolicyRuleDeleted=slapmPolicyRuleDeleted, slapmPolicyStatsLastMapping=slapmPolicyStatsLastMapping, slapmPolicyMonitorMaxDelayExceeds=slapmPolicyMonitorMaxDelayExceeds, slapmPolicyStatsOutOctets=slapmPolicyStatsOutOctets, slapmPolicyMonitorIntTime=slapmPolicyMonitorIntTime, slapmPolicyRuleStatsCountDenies=slapmPolicyRuleStatsCountDenies, slapmSubcomponentTrafficProfileName=slapmSubcomponentTrafficProfileName, slapmPolicyRuleStatsTotalRsvpFlows=slapmPolicyRuleStatsTotalRsvpFlows, slapmPolicyRuleStatsInPackets=slapmPolicyRuleStatsInPackets, slapmPolicyMonitorMinRateLow=slapmPolicyMonitorMinRateLow, slapmPolicyMonitorCurrentDelayRate=slapmPolicyMonitorCurrentDelayRate, slapmSubcomponentInPdus=slapmSubcomponentInPdus, slapmSubcomponentOutOctets=slapmSubcomponentOutOctets, slapmPolicyStatsInOctets=slapmPolicyStatsInOctets, slapmPolicyMonitorMaxInRateExceeds=slapmPolicyMonitorMaxInRateExceeds, slapmPolicyCountAccesses=slapmPolicyCountAccesses, slapmPolicyStatsPolicyName=slapmPolicyStatsPolicyName, slapmSubcomponentRemPort=slapmSubcomponentRemPort, slapmPolicyMonitorTrafficProfileName=slapmPolicyMonitorTrafficProfileName, slapmPolicyMonitorMaxRateHigh=slapmPolicyMonitorMaxRateHigh, slapmMonitoredEventOkay=slapmMonitoredEventOkay, slapmOptionalGroup=slapmOptionalGroup, slapmPolicyRuleStatsCountAccepts=slapmPolicyRuleStatsCountAccepts, slapmPRMonTable=slapmPRMonTable, slapmPolicyStatsInDiscards=slapmPolicyStatsInDiscards, slapmSubcomponentPolicyName=slapmSubcomponentPolicyName, slapmPRMonMinOutRateNotAchieves=slapmPRMonMinOutRateNotAchieves, slapmSubcomponentOutPdus=slapmSubcomponentOutPdus, slapmPolicyMonitorControl=slapmPolicyMonitorControl, slapmSubcomponentMonitorCurrentInRate=slapmSubcomponentMonitorCurrentInRate, slapmPolicyRuleStatsTable=slapmPolicyRuleStatsTable, slapmPolicyRuleStatsOperStatus=slapmPolicyRuleStatsOperStatus, slapmSubcomponentTcpRoundTripVariance=slapmSubcomponentTcpRoundTripVariance, slapmMIB=slapmMIB, slapmPolicyRuleMonNotOkay=slapmPolicyRuleMonNotOkay, slapmPolicyStatsTrafficProfileName=slapmPolicyStatsTrafficProfileName, slapmPolicyRuleStatsInDiscards=slapmPolicyRuleStatsInDiscards, slapmPolicyStatsTable=slapmPolicyStatsTable, slapmSubcomponentMonitoredEventOkay=slapmSubcomponentMonitoredEventOkay, slapmPolicyNameTable=slapmPolicyNameTable, slapmPolicyStatsCountAccepts=slapmPolicyStatsCountAccepts, slapmPolicyStatsOutDiscards=slapmPolicyStatsOutDiscards, slapmBaseGroup2=slapmBaseGroup2, slapmObjects=slapmObjects, slapmPolicyMonitorCurrentInRate=slapmPolicyMonitorCurrentInRate, slapmPRMonMaxDelayLow=slapmPRMonMaxDelayLow, slapmPolicyStatsFirstActivated=slapmPolicyStatsFirstActivated, slapmPRMonIntTime=slapmPRMonIntTime, slapmPolicyRuleStatsTotalConns=slapmPolicyRuleStatsTotalConns, slapmPRMonRowStatus=slapmPRMonRowStatus, slapmPolicyStatsActiveConns=slapmPolicyStatsActiveConns, slapmPolicyMonitorMinInRateNotAchieves=slapmPolicyMonitorMinInRateNotAchieves, slapmSubcomponentApplName=slapmSubcomponentApplName, slapmEndSystemGroup2=slapmEndSystemGroup2, slapmEndSystemNotGroup2=slapmEndSystemNotGroup2, slapmSubcomponentLocalPort=slapmSubcomponentLocalPort, slapmPolicyStatsOutProfileOctets=slapmPolicyStatsOutProfileOctets, slapmPRMonCurrentInRate=slapmPRMonCurrentInRate, slapmPolicyRuleStatsActiveConns=slapmPolicyRuleStatsActiveConns, slapmEndSystemNotGroup=slapmEndSystemNotGroup, slapmPolicyMonitorMaxOutRateExceeds=slapmPolicyMonitorMaxOutRateExceeds, slapmPolicyRuleStatsOutProOctets=slapmPolicyRuleStatsOutProOctets, slapmPolicyStatsOutPackets=slapmPolicyStatsOutPackets, slapmPolicyStatsMinRate=slapmPolicyStatsMinRate, slapmPolicyMonitorMaxRateLow=slapmPolicyMonitorMaxRateLow, slapmSubcomponentTcpInBufferedOctets=slapmSubcomponentTcpInBufferedOctets, slapmPolicyStatsOperStatus=slapmPolicyStatsOperStatus, slapmPRMonMaxOutRateExceeds=slapmPRMonMaxOutRateExceeds, slapmPRMonMinRateLow=slapmPRMonMinRateLow, slapmSubcomponentRemAddress=slapmSubcomponentRemAddress, slapmBaseObjects=slapmBaseObjects, slapmPolicyMonitorMaxDelayHigh=slapmPolicyMonitorMaxDelayHigh, slapmSubcomponentLocalAddress=slapmSubcomponentLocalAddress, slapmPRMonIndex=slapmPRMonIndex, slapmBaseGroup=slapmBaseGroup, slapmPolicyCountQueries=slapmPolicyCountQueries, slapmPolicyRuleStatsConnLimit=slapmPolicyRuleStatsConnLimit, slapmCompliance=slapmCompliance, slapmPolicyMonitorRowStatus=slapmPolicyMonitorRowStatus, slapmConformance=slapmConformance, slapmPolicyRuleStatsActRsvpFlows=slapmPolicyRuleStatsActRsvpFlows, slapmPolicyRuleMonDeleted=slapmPolicyRuleMonDeleted, slapmPolicyMonitorPolicyName=slapmPolicyMonitorPolicyName, slapmPolicyMonitorTable=slapmPolicyMonitorTable, slapmPRMonMinRateHigh=slapmPRMonMinRateHigh, slapmCompliances=slapmCompliances, slapmPolicyMonitorMinRateHigh=slapmPolicyMonitorMinRateHigh, slapmPolicyPurgeTime=slapmPolicyPurgeTime, slapmPRMonMaxRateHigh=slapmPRMonMaxRateHigh, slapmPRMonMaxDelayExceeds=slapmPRMonMaxDelayExceeds, slapmPolicyNameIndex=slapmPolicyNameIndex, slapmPolicyRuleStatsMinRate=slapmPolicyRuleStatsMinRate, slapmEndSystemGroup=slapmEndSystemGroup, slapmPRMonMaxDelayHigh=slapmPRMonMaxDelayHigh, slapmNotifications=slapmNotifications, slapmPolicyStatsCountDenies=slapmPolicyStatsCountDenies, slapmPolicyRuleStatsLActivated=slapmPolicyRuleStatsLActivated, slapmSubcMonitorNotOkay=slapmSubcMonitorNotOkay, slapmPolicyRuleStatsLastMapping=slapmPolicyRuleStatsLastMapping, slapmPRMonMinInRateNotAchieves=slapmPRMonMinInRateNotAchieves, slapmPolicyTrapFilter=slapmPolicyTrapFilter, slapmSubcomponentMonitorStatus=slapmSubcomponentMonitorStatus, slapmPolicyCountNotFounds=slapmPolicyCountNotFounds, slapmSubcomponentLastActivity=slapmSubcomponentLastActivity, slapmPolicyRuleStatsInOctets=slapmPolicyRuleStatsInOctets, slapmPolicyMonitorOwnerIndex=slapmPolicyMonitorOwnerIndex, slapmPRMonCurrentDelayRate=slapmPRMonCurrentDelayRate, slapmSubcomponentMonitorIntTime=slapmSubcomponentMonitorIntTime, slapmSubcomponentSystemAddress=slapmSubcomponentSystemAddress, slapmPolicyMonitorEntry=slapmPolicyMonitorEntry, slapmPolicyRuleMonOkay=slapmPolicyRuleMonOkay, slapmPolicyRuleStatsMaxDelay=slapmPolicyRuleStatsMaxDelay, slapmSubcomponentTable=slapmSubcomponentTable, slapmPRMonInterval=slapmPRMonInterval, SlapmStatus=SlapmStatus, PYSNMP_MODULE_ID=slapmMIB, slapmPolicyMonitorStatus=slapmPolicyMonitorStatus, slapmSubcomponentProtocol=slapmSubcomponentProtocol, slapmSubcomponentTcpOutBufferedOctets=slapmSubcomponentTcpOutBufferedOctets, slapmPRMonOwnerIndex=slapmPRMonOwnerIndex, slapmSubcomponentInOctets=slapmSubcomponentInOctets, slapmSpinLock=slapmSpinLock, slapmPolicyMonitorMinOutRateNotAchieves=slapmPolicyMonitorMinOutRateNotAchieves, slapmPolicyStatsSystemAddress=slapmPolicyStatsSystemAddress, slapmPolicyMonitorDeleted=slapmPolicyMonitorDeleted, slapmPolicyStatsInPackets=slapmPolicyStatsInPackets, slapmPolicyStatsInProfileOctets=slapmPolicyStatsInProfileOctets, slapmSubcomponentTcpRoundTripTime=slapmSubcomponentTcpRoundTripTime, slapmNotGroup=slapmNotGroup, slapmPolicyRuleStatsOutOctets=slapmPolicyRuleStatsOutOctets, slapmSubcomponentPolicyRuleIndex=slapmSubcomponentPolicyRuleIndex, slapmPRMonControl=slapmPRMonControl, slapmPolicyNameEntry=slapmPolicyNameEntry, slapmPRMonSystemAddress=slapmPRMonSystemAddress, slapmPolicyStatsEntry=slapmPolicyStatsEntry, SlapmNameType=SlapmNameType, slapmPolicyMonitorCurrentOutRate=slapmPolicyMonitorCurrentOutRate, slapmPolicyStatsTotalConns=slapmPolicyStatsTotalConns, slapmPolicyTrapEnable=slapmPolicyTrapEnable, SlapmPolicyRuleName=SlapmPolicyRuleName, slapmSubcomponentTcpReXmts=slapmSubcomponentTcpReXmts, slapmPolicyRuleStatsEntry=slapmPolicyRuleStatsEntry, slapmPolicyStatsConnectionLimit=slapmPolicyStatsConnectionLimit, slapmPRMonStatus=slapmPRMonStatus, slapmPolicyNameOfRule=slapmPolicyNameOfRule, slapmPolicyMonitorSystemAddress=slapmPolicyMonitorSystemAddress, slapmTableObjects=slapmTableObjects, slapmGroups=slapmGroups, slapmPolicyStatsMaxRate=slapmPolicyStatsMaxRate, slapmPolicyRuleStatsOutPackets=slapmPolicyRuleStatsOutPackets, slapmMonitoredEventNotAchieved=slapmMonitoredEventNotAchieved, slapmPolicyNameSystemAddress=slapmPolicyNameSystemAddress, slapmSubcMonitorOkay=slapmSubcMonitorOkay, slapmPolicyRuleStatsInProOctets=slapmPolicyRuleStatsInProOctets, slapmPolicyMonitorInterval=slapmPolicyMonitorInterval, slapmPolicyProfileDeleted=slapmPolicyProfileDeleted, slapmSubcomponentMonitoredEventNotAchieved=slapmSubcomponentMonitoredEventNotAchieved, slapmSubcomponentEntry=slapmSubcomponentEntry, slapmPolicyRuleStatsMaxRate=slapmPolicyRuleStatsMaxRate, slapmPolicyCountSuccessAccesses=slapmPolicyCountSuccessAccesses, slapmPRMonEntry=slapmPRMonEntry, slapmPolicyStatsMaxDelay=slapmPolicyStatsMaxDelay, slapmSubcomponentMonitorCurrentOutRate=slapmSubcomponentMonitorCurrentOutRate, slapmPRMonMaxInRateExceeds=slapmPRMonMaxInRateExceeds, slapmPolicyRuleStatsOutDiscards=slapmPolicyRuleStatsOutDiscards, slapmPolicyMonitorMaxDelayLow=slapmPolicyMonitorMaxDelayLow, slapmNotGroup2=slapmNotGroup2)
|
"""The CLI package."""
__all__ = [
"main", "bootstrap", "config", "log", "project", "experiment", "report",
"run", "slurm"
]
|
# To format the names in title case
input_first_name=input("Enter the first name: ")
input_last_name= input("Enter the last name: ")
def format_name(first_name,last_name):
first_name = first_name.title()
last_name = last_name.title()
full_name = first_name + " "+last_name
return full_name
name = format_name(input_first_name,input_last_name)
print(name)
|
def determine_dim_size(dim_modalities, pick_modalities):
if len(pick_modalities) < len(dim_modalities):
dim_modalities = [dim_modalities[mod_idx] for mod_idx in pick_modalities]
return dim_modalities
def prepare_batch(multidimensional_ts, split_modalities, pick_modalities, dim_modalities):
if split_modalities:
sig = list()
start_idx = 0
for mod_idx, mod_dim in zip(pick_modalities, dim_modalities):
end_idx = start_idx + mod_dim
sig.append(multidimensional_ts[..., start_idx:end_idx])
start_idx = end_idx
else:
sig = multidimensional_ts
return sig
|
#################################################################
# #
# Program Code for Spot Micro MRL #
# Of the Cyber_One YouTube Channel #
# https://www.youtube.com/cyber_one #
# #
# This is version 0.1 #
# Divided up into sub programs #
# Coded for the Nixie Version of MyRobotLab. #
# #
# Running on MyRobotLab (MRL) http://myrobotlab.org/ #
# Spot Micro MRL is a set of Python scripts that run inside #
# the MRL system #
# #
# Start.py #
# This file starts the GUI if required and runs all the #
# other files required for the Spot Micro robot to run. #
# #
#################################################################
# Because you might want to place your robots files into a #
# different dicrectory compared to what I have, #
# the RunningFolder variable is the name of the folder you #
# will be using. #
#################################################################
RuningFolder="Spot"
#################################################################
# The execfile() function loads and executes the named program. #
# This is handy for breaking a program into smaller more #
# manageable parts. #
# This file is the system configuration file. #
#################################################################
execfile(RuningFolder+'/1_Configuration/1_Sys_Config.py')
#################################################################
# Before we get too carried away, I plan to start Spot using a #
# shell script called start_spot.sh #
# This will start the MRL and the Spot scripts with no #
# Graphical User Interfaces (GUI) at all. #
# Under normal conditions, this would be desirable as spot #
# doesn't have a monitor at all, however we can connect to it #
# with VNC which does give us a monitor so we may want a GUI. #
# To overcome this issue, we will start the GUI here. #
# #
# Python uses indentation or white space to show each of the #
# lines to be executed as part of an if statement. #
# In the first if statement, there is only one indented line #
# following, then we have a blank line (for clarity) before #
# we have another if statement. The second If statement needs #
# to execute a number of line, and you can see these lines are #
# all indented. There is also one nested if statement. #
#################################################################
if RunWebGUI == True:
plan = runtime.load("webgui","WebGui")
config = plan.get("webgui")
config.autoStartBrowser = False
runtime.start("webgui", "WebGui")
#WebGui = Runtime.create("WebGui","WebGui")
#WebGui.hide('cli')
#sleep(1)
#WebGui.show('cli')
#sleep(1)
#WebGui.set('cli', 400, 400, 999)
#############################################################
# if you don't want the browser to autostart to homepage #
# then set the autoStartBrowser to False #
#############################################################
#if RunWebGUIbrowser == False:
# WebGui.autoStartBrowser(False)
#############################################################
# set a different port number to listen to. default is 8888 #
# WebGui.setPort(7777) #
# on startup the WebGui will look for a "resources" #
# directory (may change in the future) #
# static html files can be placed here and accessed #
# through the WebGui service starts the websocket server #
# and attempts to autostart browser unless it was disabled #
#############################################################
#WebGui.startService();
#################################################################
# Load in the Common Variables used to help track and control #
# various functions #
#################################################################
execfile(RuningFolder+'/Common_Variables.py')
#################################################################
# Controllers.py starts the major controller interface services #
# such as the Raspberry Pi service and the Adafruit Servo #
# controller services #
# This is also where you would start any Arduino services you #
# might want to add like the Nano for the Ultra-Sonic sensors. #
#################################################################
execfile(RuningFolder+'/Controllers.py')
#################################################################
# The IO services are for things like the PIR, Ultrasonic
# range finders and NeoPixel rings ect.
#################################################################
execfile(RuningFolder+'/IO.py')
#################################################################
# The next is for the different servos we will be running. #
# This set of files are responsible for starting and #
# configuring each of the servos throughout the robot. #
#################################################################
execfile(RuningFolder+'/Servos.py')
#################################################################
# There are a number of options for Text To Speech (TTS) and #
# Speech To Text (STT) service. You will need to have a look #
# in this file to select which ones you want to use. #
#################################################################
#execfile(RuningFolder+'/Speech.py')
#################################################################
# When not activly executing a command, we don't want the #
# robot to just stand there, This file is responsible for #
# giving our robot a bitof life. #
# By blinking the eyes, coordinating the left and right eyes #
# and performing other random like movements, just to make our #
# robot appear to be alive. #
#################################################################
execfile(RuningFolder+'/Life.py')
#################################################################
# When not activly executing a command, we don't want the #
# robot to just stand there, This file is responsible for #
# giving our robot a bitof life. #
# By blinking the eyes, coordinating the left and right eyes #
# and performing other random like movements, just to make our #
# robot appear to be alive. #
#################################################################
execfile(RuningFolder+'/Gestures.py')
#################################################################
# If your robot has cameras in it's eye, then we may want to #
# add in Open Computer Vison to help the robot make sense of #
# the world around it. #
#################################################################
#execfile(RuningFolder+'/OpenCV.py')
#################################################################
# This file sets up the WebKitSpeechRecognition service #
# The MarySpeech TTS service and the ProgramAB service that #
# interperates the Alice2 AIML files #
#################################################################
#execfile(RuningFolder+'/Brain.py')
|
#!/usr/bin/env python3
# Extra Line added
# -*- coding: utf-8 -*-
"""
Created on Sun Sep 30 13:52:32 2018
@author: jaley
"""
class Dog(object):
# 2 Underscores
def __init__(self,breed):
self.breed = breed
sam = Dog(breed='Lab')
frank = Dog(breed='Huskie')
print (sam.breed)
class Animal(object):
def __init__(self,name):
self.name = name
print (self.name + " created")
def whoAmI(self): print ("Animal")
def eat(self): print ("Eating")
class Dog(Animal):
def __init__(self,name):
self.name = name
#Animal.__init__(self,name)
print (self.name + " object created")
self.name = "Lab"
def whoAmI(self): print (self.name)
def bark(self): print ("Woof!")
tommyObject = Dog("tommy") # Creating the class instancce
germanShepherdObject = Dog("gs") # Creating the class instancce
|
def printg(grid, name):
print( '%s: [' % name)
for row in grid:
print( row)
print( ']')
def dist(p, q):
dx = abs(p[0] - q[0])
dy = abs(p[1] - q[1])
return dx + dy;
def reconstruct_path(came_from, current):
total_path = [current]
while current in came_from.keys():
current = came_from[current]
total_path.append(current)
return list(reversed(total_path))
def neighbours(node, grid, score, tail, ignore_list):
width = len(grid)
height = len(grid[0])
subtail = []
if score >= len(tail):
subtail = [tuple(x) for x in tail]
else:
subtail = [tuple(x) for x in tail[len(tail)-score:]]
result = []
if (node[0] > 0):
result.append((node[0]-1,node[1]))
if (node[0] < width-1):
result.append((node[0]+1,node[1]))
if (node[1] > 0):
result.append((node[0],node[1]-1))
if (node[1] < height-1):
result.append((node[0],node[1]+1))
result = filter(lambda p: (grid[p[0]][p[1]] not in ignore_list) or (p in subtail), result)
return result
def a_star(start, goal, grid, tail):
start = tuple(start)
goal = tuple(goal)
closed_set = []
open_set = [start]
came_from = {} #empty map
#for x in range(len(grid[y]))
g_score = [[10000 for x in range(len(grid[y]))] for y in range(len(grid))]
g_score[start[0]][start[1]] = 0
f_score = [[10000 for x in range(len(grid[y]))] for y in range(len(grid))]
f_score[start[0]][start[1]] = dist(start,goal)
while(len(open_set) > 0):
current = min(open_set, key=lambda p: f_score[p[0]][p[1]])
if (current == goal):
return reconstruct_path(came_from, goal)
open_set.remove(current)
closed_set.append(current)
for neighbour in neighbours(current, grid, g_score[current[0]][current[1]], tail,[1,2,5]):
if neighbour in closed_set:
continue
tentative_g_score = g_score[current[0]][current[1]] + dist(current,neighbour)
if neighbour not in open_set:
open_set.append(neighbour)
elif tentative_g_score >= g_score[neighbour[0]][neighbour[1]]:
continue
came_from[neighbour] = current
g_score[neighbour[0]][neighbour[1]] = tentative_g_score
f_score[neighbour[0]][neighbour[1]] = tentative_g_score + dist(neighbour,goal)
return None
|
#!/usr/bin/env python
#pylint: skip-file
# This source code is licensed under the Apache license found in the
# LICENSE file in the root directory of this project.
class ZtdDevice(object):
def __init__(self):
"""
Attributes:
swaggerTypes (dict): The key is attribute name and the value is attribute type.
attributeMap (dict): The key is attribute name and the value is json key in definition.
"""
self.swaggerTypes = {
'serialNumber': 'str',
'source': 'str',
'aliases': 'list[str]',
'ipAddress': 'str',
'id': 'str',
'platformId': 'str',
'site': 'str',
'imageId': 'str',
'configId': 'str',
'pkiEnabled': 'bool',
'eulaAccepted': 'bool',
'licenseLevel': 'str',
'templateConfigId': 'str',
'licenseString': 'str',
'apCount': 'str',
'isMobilityController': 'str',
'deviceDiscoveryInfo': 'ZtdDeviceDiscoveryInfo',
'macAddress': 'str',
'sudiRequired': 'bool',
'memberUdi': 'str',
'fileDestination': 'str',
'backoffTimer': 'str',
'provisioningType': 'str',
'unclaimedHint': 'str',
'bootstrapId': 'str',
'hwRevision': 'str',
'mainMemSize': 'str',
'boardId': 'str',
'boardReworkId': 'str',
'midplaneVersion': 'str',
'versionString': 'str',
'imageFile': 'str',
'returnToRomReason': 'str',
'bootVariable': 'str',
'bootLdrVariable': 'str',
'configVariable': 'str',
'configReg': 'str',
'configRegNext': 'str',
'topologyInfo': 'str',
'filesystemInfo': 'str',
'deviceDetailsLastUpdate': 'str',
'slotNumber': 'str',
'certificateNeededState': 'str',
'pnpProfileUsedAddr': 'str',
'pnpProfileUsedHost': 'str',
'authStatus': 'DeviceAuthState',
'deviceCertificate': 'str',
'deviceType': 'str',
'memberDetail': 'list[ZtdMemberDetail]',
'requestHeader': 'ZtdRequestHeader',
'lastStateTransitionTime': 'str',
'firstContact': 'str',
'lastContact': 'str',
'cleanup': 'bool',
'stateDisplay': 'str',
'versionCompatible': 'str',
'state': 'str',
'hostName': 'str'
}
self.attributeMap = {
'serialNumber': 'serialNumber',
'source': 'source',
'aliases': 'aliases',
'ipAddress': 'ipAddress',
'id': 'id',
'platformId': 'platformId',
'site': 'site',
'imageId': 'imageId',
'configId': 'configId',
'pkiEnabled': 'pkiEnabled',
'eulaAccepted': 'eulaAccepted',
'licenseLevel': 'licenseLevel',
'templateConfigId': 'templateConfigId',
'licenseString': 'licenseString',
'apCount': 'apCount',
'isMobilityController': 'isMobilityController',
'deviceDiscoveryInfo': 'deviceDiscoveryInfo',
'macAddress': 'macAddress',
'sudiRequired': 'sudiRequired',
'memberUdi': 'memberUdi',
'fileDestination': 'fileDestination',
'backoffTimer': 'backoffTimer',
'provisioningType': 'provisioningType',
'unclaimedHint': 'unclaimedHint',
'bootstrapId': 'bootstrapId',
'hwRevision': 'hwRevision',
'mainMemSize': 'mainMemSize',
'boardId': 'boardId',
'boardReworkId': 'boardReworkId',
'midplaneVersion': 'midplaneVersion',
'versionString': 'versionString',
'imageFile': 'imageFile',
'returnToRomReason': 'returnToRomReason',
'bootVariable': 'bootVariable',
'bootLdrVariable': 'bootLdrVariable',
'configVariable': 'configVariable',
'configReg': 'configReg',
'configRegNext': 'configRegNext',
'topologyInfo': 'topologyInfo',
'filesystemInfo': 'filesystemInfo',
'deviceDetailsLastUpdate': 'deviceDetailsLastUpdate',
'slotNumber': 'slotNumber',
'certificateNeededState': 'certificateNeededState',
'pnpProfileUsedAddr': 'pnpProfileUsedAddr',
'pnpProfileUsedHost': 'pnpProfileUsedHost',
'authStatus': 'authStatus',
'deviceCertificate': 'deviceCertificate',
'deviceType': 'deviceType',
'memberDetail': 'memberDetail',
'requestHeader': 'requestHeader',
'lastStateTransitionTime': 'lastStateTransitionTime',
'firstContact': 'firstContact',
'lastContact': 'lastContact',
'cleanup': 'cleanup',
'stateDisplay': 'stateDisplay',
'versionCompatible': 'versionCompatible',
'state': 'state',
'hostName': 'hostName'
}
#Serial number
self.serialNumber = None # str
#Source of device,set to CLOUD if device matches synced cloud device
self.source = None # str
self.aliases = None # list[str]
self.ipAddress = None # str
#Device ID
self.id = None # str
#Platform ID
self.platformId = None # str
#Project to which device belongs if pre-provisioned
self.site = None # str
#Image file ID
self.imageId = None # str
#Configuration file ID
self.configId = None # str
#Configure PKCS#12 trust point during PNP workflow if true
self.pkiEnabled = None # bool
#CLI execution EULA accepted or not
self.eulaAccepted = None # bool
#CLI execution license level
self.licenseLevel = None # str
#Template config ID
self.templateConfigId = None # str
#License information
self.licenseString = None # str
#Wireless AP count
self.apCount = None # str
#Specify if device is a wireless mobility controller
self.isMobilityController = None # str
#Device discovery info
self.deviceDiscoveryInfo = None # ZtdDeviceDiscoveryInfo
self.macAddress = None # str
self.sudiRequired = None # bool
#Unique device ID of redundant/stack switches
self.memberUdi = None # str
#Location on device to which image/config files will be copied
self.fileDestination = None # str
#Backoff timer
self.backoffTimer = None # str
#Type of device
self.provisioningType = None # str
#Hint whether device might be RMA
self.unclaimedHint = None # str
#Bootstrap file ID
self.bootstrapId = None # str
#HW revision
self.hwRevision = None # str
#Main memory size
self.mainMemSize = None # str
#Board ID
self.boardId = None # str
#Board rework ID
self.boardReworkId = None # str
#Mid plane version
self.midplaneVersion = None # str
#IOS Version
self.versionString = None # str
#Image ID
self.imageFile = None # str
#Return to rom reason
self.returnToRomReason = None # str
#Boot variable
self.bootVariable = None # str
#Boot ldr variable
self.bootLdrVariable = None # str
#Config variable
self.configVariable = None # str
#Config reg
self.configReg = None # str
#Config reg next
self.configRegNext = None # str
#Information about topology
self.topologyInfo = None # str
#Information about filesystem
self.filesystemInfo = None # str
#Timestamp when the device details were last read
self.deviceDetailsLastUpdate = None # str
#Slot number
self.slotNumber = None # str
#State which is detected as happening over http instead of https
self.certificateNeededState = None # str
#PnP server ipv4 address used by pnp profile
self.pnpProfileUsedAddr = None # str
#PnP server hostname used by pnp profile
self.pnpProfileUsedHost = None # str
self.authStatus = None # DeviceAuthState
self.deviceCertificate = None # str
self.deviceType = None # str
self.memberDetail = None # list[ZtdMemberDetail]
self.requestHeader = None # ZtdRequestHeader
#Last state transition time of device
self.lastStateTransitionTime = None # str
#First contact time of device
self.firstContact = None # str
#Last contact time of device
self.lastContact = None # str
self.cleanup = None # bool
self.stateDisplay = None # str
self.versionCompatible = None # str
#Device state
self.state = None # str
#Host name
self.hostName = None # str
|
FRONT_MATTER = '\
---\n\
pageType: post\n\
game: {game_title_nospace}\n\
slug: /{game_title}-{article_type_hyphen}/\n\
title: "{article_title} <em class=\'game-title\'>{game_title_space_caps}</em>"\n\
postType: [{article_type_comma}]\n\
tagline: "{tagline}"\n\
date: {date}\n\
release-date: {release_date}\n\
image: {game_title_nospace_caps}.png\n\
video: https://www.youtube.com/embed/{video_id}\n\
author: {author}\n\
categories: [{genres}, {article_type_comma}, story]\n\
tags: ["{game_title_space_caps}", "{developer}", "{publisher}", {tags}]\n\
---\
'
QUICK_SUMMARY = '\n\
{game_title_nospace}:\n\
quote: {quote}\n\
image: post/{game_title_nospace}/{thumbnail}\n\
points:\n\
- question: Genre\n\
answer: {genres}\n\
- question: Developer\n\
answer: {developer}\n\
- question: Publisher\n\
answer: {publisher}\n\
- question: Main Character\n\
answer: {main_character}\n\
- question: Platforms\n\
answer: {platforms}\n\
- question: Release Date\n\
answer: {release_date_verbose}\n\
- question: Time Spent\n\
answer: {time_spent}\n\
- question: Completion\n\
answer: {completion}\n\
- question: Winning Traits\n\
answer: {winning_traits}\n\
- question: Recommended?\n\
answer: {recommended}\n\
'
POST_IMAGES = '\n\
[image0]: ../../../images/post/{game_title_nospace}/{game_title_nospace_caps}0.png\n\
[image1]: ../../../images/post/{game_title_nospace}/{game_title_nospace_caps}1.png\n\
[image2]: ../../../images/post/{game_title_nospace}/{game_title_nospace_caps}2.png\n\
[image3]: ../../../images/post/{game_title_nospace}/{game_title_nospace_caps}3.png\n\
[image4]: ../../../images/post/{game_title_nospace}/{game_title_nospace_caps}4.png\n\
[image5]: ../../../images/post/{game_title_nospace}/{game_title_nospace_caps}5.png\n\
[image6]: ../../../images/post/{game_title_nospace}/{game_title_nospace_caps}6.png\n\
[image7]: ../../../images/post/{game_title_nospace}/{game_title_nospace_caps}7.png\n\
[image8]: ../../../images/post/{game_title_nospace}/{game_title_nospace_caps}8.png\n\
[image9]: ../../../images/post/{game_title_nospace}/{game_title_nospace_caps}9.png\n\
[image10]: ../../../images/post/{game_title_nospace}/{game_title_nospace_caps}10.png\n\
[image11]: ../../../images/post/{game_title_nospace}/{game_title_nospace_caps}11.png\n\
[image12]: ../../../images/post/{game_title_nospace}/{game_title_nospace_caps}12.png\n\
[image13]: ../../../images/post/{game_title_nospace}/{game_title_nospace_caps}13.png\n\
[image14]: ../../../images/post/{game_title_nospace}/{game_title_nospace_caps}14.png\n\
[image15]: ../../../images/post/{game_title_nospace}/{game_title_nospace_caps}15.png\n\
'
|
msg_soc='BA:?'
msg_p='P:?'
msg_ppvt='PV:?'
msg_conso='CON:?'
soc=101
try:
tree = etree.parse(configGet('tmpFileDataXml'))
for datas in tree.xpath("/devices/device/datas/data"):
if datas.get("id") in configGet('lcd','dataPrint'):
for data in datas.getchildren():
if data.tag == "value":
if datas.get("id") == 'SOC':
msg_soc='BA:'+data.text + '%'
soc=data.text
elif datas.get("id") == 'P':
msg_p = 'P:'+data.text + 'W'
elif datas.get("id") == 'PPVT':
msg_ppvt = 'PV:'+data.text + 'W'
elif datas.get("id") == 'CONSO' and data.text != 'NODATA':
msg_conso = 'CON:'+data.text + 'W'
except:
debugTerm("Erreur dans la lecture du XML la syntax n'est pas bonne ?")
# Construction de l'affichage
lcd.clear()
nb_ligne1_space=lcd_columns-len(msg_soc)-len(msg_p)
ligne1_msg=msg_soc
for nb_space1 in range(nb_ligne1_space):
ligne1_msg=ligne1_msg+' '
ligne1_msg=ligne1_msg+msg_p
nb_ligne2_space=lcd_columns-len(msg_ppvt)-len(msg_conso)
ligne2_msg=msg_ppvt
for nb_space2 in range(nb_ligne2_space):
ligne2_msg=ligne2_msg+' '
ligne2_msg=ligne2_msg+msg_conso
lcd.message = ligne1_msg+'\n'+ligne2_msg
debugTerm('Affichage\n' + ligne1_msg+'\n'+ligne2_msg)
if etat_lcd == True:
if float(soc) >= 94 and float(soc) < 100:
# Vert
lcd.color = [0, 100, 0]
elif float(soc) <= 85:
# Rouge
lcd.color = [100, 0, 0]
elif float(soc) > 85:
# Jaune
lcd.color = [100, 100, 0]
else:
lcd.color = [100, 100, 100]
|
def average(number_list):
total = 0
for each in number_list:
total = total + each
return total / len(number_list)
number_list = [10, 20, 30, 40, 50, 60, 70, 80, 90]
print("평균 :", average(number_list))
|
HP_SERIAL_FORMAT_DEFAULT = "auto"
HP_SERIAL_FORMAT_CHOICES = ["auto", "yaml", "pickle"]
HP_ACTION_PREFIX_DEFAULT = "hp"
|
# 二分查找
# 返回 x 在 arr 中的索引,如果不存在返回 -1
def binarySearch (arr, x):
low = 0 # 最小数下标
high = len(arr) - 1 # 最大数下标
while low <= high:
mid = (low + high) // 2 # 中间数下标
if arr[mid] == x: # 如果中间数下标等于val, 返回
return mid
elif arr[mid] > x: # 如果val在中间数左边, 移动high下标
high = mid - 1
else: # 如果val在中间数右边, 移动low下标
low = mid + 1
return -1
print(binarySearch(list(range(1, 10)), 3))
|
"""Implements the BiDi Rule.
(Source: RFC 5893, Section 2)
The following rule, consisting of six conditions, applies to labels
in Bidi domain names. The requirements that this rule satisfies are
described in Section 3. All of the conditions must be satisfied for
the rule to be satisfied.
1. The first character must be a character with Bidi property L, R,
or AL. If it has the R or AL property, it is an RTL label; if it
has the L property, it is an LTR label.
2. In an RTL label, only characters with the Bidi properties R, AL,
AN, EN, ES, CS, ET, ON, BN, or NSM are allowed.
3. In an RTL label, the end of the label must be a character with
Bidi property R, AL, EN, or AN, followed by zero or more
characters with Bidi property NSM.
4. In an RTL label, if an EN is present, no AN may be present, and
vice versa.
5. In an LTR label, only characters with the Bidi properties L, EN,
ES, CS, ET, ON, BN, or NSM are allowed.
6. In an LTR label, the end of the label must be a character with
Bidi property L or EN, followed by zero or more characters with
Bidi property NSM.
"""
_LTR_FIRST = {'L'}
_LTR_ALLOWED = {'L', 'EN', 'ES', 'CS', 'ET', 'ON', 'BN', 'NSM'}
_LTR_LAST = {'L', 'EN'}
_LTR_EXCL = set()
_RTL_FIRST = {'R', 'AL'}
_RTL_ALLOWED = {'R', 'AL', 'AN', 'EN', 'ES', 'CS', 'ET', 'ON', 'BN', 'NSM'}
_RTL_LAST = {'R', 'AL', 'EN', 'AN'}
_RTL_EXCL = {'EN', 'AN'}
_RTL_ANY = {'R', 'AL', 'AN'}
def bidi_rule(value, ucd):
"""Check if `value` obeys the BiDi rule.
Args:
value (str): String value to check.
ucd (UnicodeData): Unicode character database.
Returns:
bool: True if value satisfies BiDi rule.
"""
bidi = ucd.bidirectional(value[0])
if bidi in _LTR_FIRST:
return _bidi_rule(value, ucd, _LTR_ALLOWED, _LTR_LAST, _LTR_EXCL)
if bidi in _RTL_FIRST:
return _bidi_rule(value, ucd, _RTL_ALLOWED, _RTL_LAST, _RTL_EXCL)
return False
def _bidi_rule(value, ucd, allowed, last, exclusive):
"""Check the bidi_rule for LTR or RTL, depending on parameters.
Args:
value (str): String value to check.
ucd (UnicodeData): Unicode character database.
allowed (set): Set of allowed BiDi properties.
last (set): Set of BiDi properties allowed at end (followed by NSM).
exclusive (set): Set of BiDi properties that are mutually exclusive.
Returns:
bool: True if value satisfies the BiDi rule.
"""
assert ucd.bidirectional(value[0]) in _LTR_FIRST | _RTL_FIRST
# Starting from the end, find the first character whose bidi is not 'NSM'.
bidi = None
found = -1
for i in reversed(range(len(value))):
bidi = ucd.bidirectional(value[i])
if bidi != 'NSM':
found = i
break
# Last non-NSM character must be in `last`.
if found < 0 or bidi not in last:
return False
# Check if last char is in the exclusive set.
bidi_seen = bidi if bidi in exclusive else None
# Make sure the remaining characters are allowed.
for i in range(1, found):
bidi = ucd.bidirectional(value[i])
if bidi not in allowed:
return False
if bidi in exclusive and bidi_seen != bidi:
if bidi_seen:
return False
bidi_seen = bidi
return True
def has_rtl(value, ucd):
"""Check if value contains any RTL characters.
Args:
value (str): String value to check.
ucd (UnicodeData): Unicode character database.
Returns:
bool: True if value contains RTL characters.
"""
return any(ucd.bidirectional(x) in _RTL_ANY for x in value)
|
class TranslatorExceptions(Exception):
def __init__(self, message):
super().__init__()
self.message = message
class LangDoesNotExists(TranslatorExceptions):
def __init__(self):
super().__init__(
'Requested language does not exists\nTry to run \'lang\' command to be familiar with supported languages')
class EnglishNotFound(TranslatorExceptions):
def __init__(self):
super().__init__('Either source language or destination language has to be English')
class InvalidApiKey(TranslatorExceptions):
def __init__(self):
super().__init__('Make sure that your API Key is valid')
|
routes = [
('Binance Futures', 'ETH-USDT', '30m', 'SimplEma'), # r'(╯°□°)╯︵ ┻━┻'
]
extra_candles = []
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.