content stringlengths 7 1.05M |
|---|
API_STAGE = 'dev'
APP_FUNCTION = 'handler_for_events'
APP_MODULE = 'tests.test_event_script_app'
DEBUG = 'True'
DJANGO_SETTINGS = None
DOMAIN = 'api.example.com'
ENVIRONMENT_VARIABLES = {}
LOG_LEVEL = 'DEBUG'
PROJECT_NAME = 'test_event_script_app'
COGNITO_TRIGGER_MAPPING = {}
|
AVAILABLE_OUTPUTS = [
(20, 'out 1'),
(21, 'out 2')
]
|
# Definition for a binary tree node.
class TreeNode:
def __init__(self, x):
self.val = x
self.left = None
self.right = None
class Solution:
def isValidBST(self, root):
def util(root, low, high):
if not root:
return True
return low < root.val and root.val < high and util(root.left, low, root.val) and util(root.right,
root.val, high)
return util(root, -float("INF"), float("INF"))
|
class Solution:
def reverseVowels(self, s):
"""
:type s: str
:rtype: str
"""
vow = ['a', 'e', 'i', 'o', 'u']
ch = [c for c in s]
low, high = 0, len(ch) - 1
while low < high:
while low < high and ch[low] not in vow:
print("low")
low += 1
while low < high and ch[high] not in vow:
print("high")
high -= 1
ch[low], ch[high] = ch[high], ch[low]
low += 1
high -= 1
return ''.join(ch)
s = Solution()
s.reverseVowels('hello')
|
"""
Copyright 2019 Islam Elnabarawy
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.
"""
__author__ = 'Islam Elnabarawy'
def scale_range(x, x_range, y_range=(0.0, 1.0)):
"""
scale the number x from the range specified by x_range to the range specified by y_range
:param x: the number to scale
:type x: float
:param x_range: the number range that x belongs to
:type x_range: tuple
:param y_range: the number range to convert x to, defaults to (0.0, 1.0)
:type y_range: tuple
:return: the scaled value
:rtype: float
"""
x_min, x_max = x_range
y_min, y_max = y_range
return (y_max - y_min) * (x - x_min) / (x_max - x_min) + y_min
def normalize(p, data_ranges):
for i in range(len(p)):
p[i] = scale_range(p[i], data_ranges[i])
def denormalize(p, data_ranges):
for i in range(len(p)):
p[i] = scale_range(p[i], x_range=(0.0, 1.0), y_range=data_ranges[i])
|
"""
ID: tony_hu1
PROG: milk3
LANG: PYTHON3
"""
filein = []
with open('milk3.in') as filename:
for line in filename:
filein.append(line.rstrip())
filein = filein[0].split(' ')
a = int(filein[0])
b = int(filein[1])
c = int(filein[2])
list_possibilities = [[[False]*c]*b]*a
m = get_possible(a,b,c)
outstring = ''
for i in range(len(m)-1):
outstring = outstring + str(m[i]) + ' '
outstring += str(m[len(m)-1])
def get_possible(a,b,c):
possible = []
if (a>=b and b>=c) or ( b>=a and a>=c):
possible.append(0)
possible.append(c)
return possible
if (a>=c and c>=b):
possible.append(c)
possible.append(c-b)
ctemp = b
while ctemp <= c:
possible.append(ctemp)
ctemp += b
return list(set(possible))
if (b>=c and c>=a):
possible.append(c)
possible.append(0)
btemp = a
while btemp <= c:
possible.append(btemp)
possible.append(c-btemp)
btemp += a
return list(set(possible))
if (c>=b and b>=a):
possible.append(c)
possible.append(c-b)
if c-b <= a:
possible.append(b)
temp = a
while temp <= b:
possible.append(c-b+temp)
temp += a
temp = a
while temp <= c and c-temp <= b:
possible.append(temp)
temp += a
temp = a
while temp <= b:
possible.append(c-temp)
temp += a
possible.sort()
return list(set(possible))
def write_out(outfile,outstring):
fout = open (outfile, 'w')
fout.write(str(outstring)+'\n')
print(outstring)
write_out('milk3.out',milk3_main(read_in('milk3.in'))) |
#input
# 28
# RP PP RR PS RP
# PR PP SR PS SS RR RS RP
# PR SP PR RS RP PP RS
# RP PS PS PR SS RR PP PR SP SP RR PR PS PS SP
# RS PS RR PR RP PR RS SR SR RR PP PP SR RS RP
# RR RR RR SP PR RP RR PP SP PS RR RS SP
# SS RP RP PP SS RR RP PS SP RR RS SR RS RS SS PS
# SR SP SR RP RP SS SP PP SS SS SS SS RP
# SR PP RP PP RP SS SR PP RR RP
# RR SS RP SR RP RP SS PP RR SS SP PR SS PR RS SR RP
# PR SS PR SS SS PP RP RS
# PR PP RS PR SP
# RR PP RR RP RR RR RS PR RS RP RP RS
# RR SR SR PS PR RP PP SS SS SP PR SR
# PP SS PR RP SR RS SR PS
# SR SS SP SS RR SR PR PR
# RP RR RS PP SR PP SS PR PR SR SP PR PP SP
# SP RP PP PP RS PR PS RR PR SP RS
# SR PR PP SP RR SP SR RP PR
# SS SS RR RS SP PR RP SP RR RS RP PS RS
# PR PP SR PS RP
# SR SR PR SR PR PP SS RP
# RP SS PR PP RS PP RS RP PP RP PP SS SP PP PR
# SP SS RR RP PS RS RS
# PP SS RR RR SS SP RR SR RR RS RR SS PP RP PR
# RP RS SP SS PS PS SS SR SS RS RR PS
# RS RS RS SP RS PP SR RP SS PP SP
# PP RP SS PS RP RS PR PR RR PS SP SP
def convert_sign(s):
if (s == 'R'):
return 0
elif (s == 'P'):
return 1
else:
return 2
def winner(seq):
a = convert_sign(seq[0])
b = convert_sign(seq[1])
res = (a - b + 3) % 3
if res == 0:
return -1
elif res == 1:
return 0
else:
return 1
def check_winner(s):
player = [0,0]
for i in range(0, len(s)):
win = winner(s[i])
if win != -1:
player[win] += 1
if player[0] > player[1]:
return 0
elif player[0] < player[1]:
return 1
else:
return -1
def main():
n = int(input())
for i in range(0, n):
seq = input().split()
winner = check_winner(seq)
if winner == -1:
return
print(winner + 1, "", end="")
if __name__ == "__main__":
main() |
"""Custom exceptions.
All the exceptions raised by the code in avazu_ctr_prediction.* should derive from Avazu-Ctr-PredictionException
"""
class AvazuCtrPredictionException(Exception):
"""Mother class for common avazu_ctr_prediction exceptions."""
pass
class MissingModelException(AvazuCtrPredictionException):
"""Exception raised when a parameter cannot be found in the configuration."""
pass
class MissingConfigurationParamException(AvazuCtrPredictionException):
"""Exception raised when a parameter cannot be found in the configuration."""
pass
|
# -*- coding: utf-8 -*-
"""
Простейшим примером использования полиморфизма является функция print,
которая вызывает у переданного ей объекта метод __str__.
"""
print('str')
print(42) |
sum =0
n = 99
while n>0:
sum = sum+n
n=n-2
if n<10:
break
print(sum)
#----------
for x in range(101):
if x%2==0:
continue
else:
print(x)
#----------
y = 0
while True:
print(y)
y=y+1
|
'''
给定一个非空的整数数组,返回其中出现频率前 k 高的元素。
示例 1:
输入: nums = [1,1,1,2,2,3], k = 2
输出: [1,2]
示例 2:
输入: nums = [1], k = 1
输出: [1]
来源:力扣(LeetCode)
链接:https://leetcode-cn.com/problems/top-k-frequent-elements
'''
class Solution:
def topKFrequent(self, nums: List[int], k: int) -> List[int]:
top_dict = {}
for n in nums:
if n not in top_dict:
top_dict[n] = 1
else:
top_dict[n] += 1
results = []
# print(top_dict)
for ke,v in sorted(top_dict.items(),key = lambda x:x[1],reverse=True):
results.append(ke)
# print(results)
return results[:k] |
def imprimePorIdade(pDIct = dict()):
sortedDict = sorted(pDIct.items(), key = lambda x: x[1], reverse=False)
for i in sortedDict:
print(i[0], i[1])
pass
pass
testDict = { "narto": 29, "leo": 13, "antonia": 45, "mimosa": 27, }
imprimePorIdade(testDict) |
#sublist
def sub_list(list):
return list[1:3]
result = sub_list([1,2,3,4,5])
print(result)
#concatenation
list1 = [1,2,4,5,6]
list2 = [5,6,7,8,9]
list3 = list1 + list2
print(list3)
#traverse
for element in list3:
print(element)
#list slicing
def get_sublist(list):
return [list[0:3], list[3:]]
print(get_sublist([1,4,9,10,23]))
print()
#append at the end
def append_to_end(list, num):
list.append(num)
return list
result = append_to_end([1,2,4,5,6], 10)
print(result)
print()
#average without using sum function
def get_average(list):
sum = 0
for element in list:
sum += element
return sum/len(list)
print(get_average([1,2,3,4,5,6]))
print()
#average with sum function
def get_average_with_sum_func(list):
return sum(list)/len(list)
result = get_average_with_sum_func([1,2,3,4,5,6])
print(result)
print()
#remove from list
def remove_from_list(list, elements_to_remove):
for element in elements_to_remove:
list.remove(element)
return list
result = remove_from_list([1,2,3,4,5,6,7,8],[5,8])
print(result)
print() |
# -*- coding: utf-8 -*-
__author__ = 'Allen'
#ValueRef 是指向数据库中二进制数据对象的Python对象,是对数据库中数据的引用。
class ValueRef(object):
def __init__(self,referent=None,address=0):
self._referent = referent#就是它引用的值
self._address = address#就是该值在文件中的位置
def prepare_to_store(self,storage):
'''存储之前要做的事情,此处不实现'''
pass
@staticmethod
def referent_to_string(referent):
#值的处理很简单,只要将utf-8格式的字节串解码就可以了
return referent.encode('utf-8')
@staticmethod
def string_to_referent(string):
return string.decode('utf-8')
@property
def address(self):
return self._address
def get(self,storage):
'''获取引用'''
if self._referent is None and self._address:
#根据地址到文件取读取该引用的数据
self._referent = self.string_to_referent(storage.read(self._address))
return self._referent
def store(self,storage):
'''存储引用'''
# 引用对象不为空而地址为空说明该引用对象还未被存储过
if self._referent is not None and not self._address:
self.prepare_to_store(storage)
#把引用数据写入到文件,并得到写入的地址
self._address = storage.write(self.referent_to_string(self._referent))
#LogicalBase 类提供了逻辑更新(比如 get,set 以及 commit)的抽象接口,
# 它同时负责管理存储对象的锁以及对内部节点的解引用。
class LogicalBase(object):
node_ref_class = None
value_ref_class = ValueRef
def __init__(self,storage):
self._storage = storage
self._refresh_tree_ref()
def commit(self):
self._tree_ref.store(self._storage)
self._storage.commit_root_address(self._tree_ref.address)
def _refresh_tree_ref(self):
'''不可变二叉树每次添加删除结点都会生成一个新的二叉树
新的二叉树的根节点地址会重写到superblock文件开头
这个方法就是更新根节点地址'''
self._tree_ref = self.node_ref_class(
address = self._storage.get_root_address()
)
def _follow(self,ref):
'''获取Ref所引用的具体对象'''
return ref.get(self._storage)#这里的get是ValueRef的get方法
def get(self,key):
'''获取键值'''
# 如果数据库文件没有上锁,则更新对树的引用
if not self._storage.locked:
self._refresh_tree_ref()
# _get 方法将在子类中实现
return self._get(self._follow(self._tree_ref),key)
def set(self,key,value):
'''设置键值'''
# 如果数据库文件没有上锁,则更新对树的引用
#这里不用self._storage.locked判断是不管是否锁定,这里都要加锁
if self._storage.lock():
self._refresh_tree_ref()
# _insert 方法将在子类中实现
self._tree_ref = self._insert(
self._follow(self._tree_ref),
key,
self.value_ref_class(value)
)
def pop(self,key):
'''删除键值'''
if self._storage.lock():
self._refresh_tree_ref()
# _delete 方法将在子类中实现
self._tree_ref = self._delete(
self._follow(self._tree_ref),key
)
def __len__(self):
if not self._storage.locked:
self._refresh_tree_ref()
root = self._follow(self._tree_ref)
if root:
return root.length
else:
return 0
|
# _*_ coding:utf-8 _*_
#!/usr/local/bin/python
encrypted = [6,3,1,7,5,8,9,2,4]
def decrypt(encryptedTxt):
head = 0
tail = len(encryptedTxt)-1
decrypted = []
while len(encryptedTxt)>0:
decrypted.append(encryptedTxt[0])
del encryptedTxt[0]
print(encryptedTxt)
if(len(encryptedTxt)<=0):
break
encryptedTxt.append(encryptedTxt[0])
del encryptedTxt[0]
print(encryptedTxt)
return decrypted
if __name__ == "__main__":
decrypted = decrypt(encrypted)
print(decrypted)
|
# https://www.codewars.com/kata/550554fd08b86f84fe000a58/train/python
def in_array(array1, array2):
result = []
array1 = list(set(array1))
for arr1_element in array1:
for arr2_element in array2:
if arr2_element.count(arr1_element) != 0:
result.append(arr1_element)
break
return sorted(result)
|
'''Refaça o desafio 051, lendo um número e a razão de uma PA, e mostrando os
10 primeiros termos dessa PA utilizando while'''
print('\033[31m==\033[m'*11)
print('\033[33mProgressão Aritmética\033[m')
print('\033[31m==\033[m'*11)
x = 0
resposta = ''
while resposta != 'n':
resposta = str(input('''Gostaria de Calcular uma PA?
[ S ] Sim;
[ N ] Não.
Resposta: ''')).strip().lower()
if resposta == 'n':
x = 10
else:
n = int(input('Digite um número: '))
r = int(input('Digite a Razão da PA: '))
print('Progressão Aritmética: ')
while x != 10:
if x == 9:
print('\033[32m {}\033[m'.format(n + r*x))
x = 10
else:
print('\033[32m {}\033[m'.format(n + r*x), end=' ->')
x += 1
|
#!/usr/bin/python
#https://practice.geeksforgeeks.org/problems/is-binary-number-multiple-of-3/0
def sol(x):
"""
If the diff. of even set bits and odd set bits is divisible by 3, then
the number is divisible by 3
"""
n = len(x)
oddCount = 0
evenCount = 0
for i in range(n):
if i%2 == 0:
if x[i] == '1':
evenCount += 1
else:
if x[i] == '1':
oddCount += 1
if abs(evenCount-oddCount)%3 == 0:
return 1
return 0 |
#!/usr/bin/env python
# -*- coding: utf8 -*-
# coding: utf8
# This class is used for the communication between bots
class LinkCable():
def __init__(self, engine):
# Class attributes
self.engine = engine
self.buy_waiting_ack = False
self.buy_username = ""
self.buy_pokestuff = 0
def new_buy(self, username, pokestuff):
self.buy_waiting_ack = True
self.buy_username = username
self.buy_pokestuff = pokestuff
def soul_mate_listener(self, msg):
if msg.lower() == "** Hautes herbes **".lower(): # Steroïd trigger
for i in range(10):
self.engine.tall_grass.trigger()
if self.buy_waiting_ack:
if msg.startswith("Ca fera "): # Positive ack for the buy
self.engine.buy_pokestuff(self.buy_username, self.buy_pokestuff)
else: # Negative ack for the buy, cancel it. (@bug if another message from my soul mate intercalate before the ack)
pass
self.buy_waiting_ack = False
|
class MyCircularQueue:
def __init__(self, k: int):
self.q = [None] * k
self.front_idx = -1
self.back_idx = -1
self.capacity = k
def display_elements(self):
print("The elements in the Queue are ")
print_str = ""
# add the elements to the print string
for i in range(self.capacity):
print_str += str(self.q[i]) + " "
print(print_str)
def enQueue(self, value: int) -> bool:
# if the queue is full return false
if self.isFull():
print("The queue is full..")
return False
# if the front index is negative, update its value to 0
if self.front_idx == -1:
self.front_idx = 0
# increment the back index
self.back_idx = (self.back_idx + 1) % self.capacity
# update the queue value
self.q[self.back_idx] = value
return True
def deQueue(self) -> bool:
# if the queue is empty return false
if self.front_idx == -1:
print("The queue is empty..")
return False
self.q[self.front_idx] = None
# if the front and back indices are the same reset the queue indices
if self.front_idx == self.back_idx:
self.front_idx = -1
self.back_idx = -1
else:
# increment the front idx
self.front_idx = (self.front_idx + 1) % self.capacity
return True
def Front(self) -> int:
# if the front idx is -1 return -1 else the front value
return -1 if self.front_idx == -1 else self.q[self.front_idx]
def Rear(self) -> int:
# if the rear idx is -1 return -1 else the back value
return -1 if self.back_idx == -1 else self.q[self.back_idx]
# check if queue is empty
def isEmpty(self) -> bool:
return self.front_idx == -1
# check if queue is full
def isFull(self) -> bool:
return (self.back_idx + 1) % self.capacity == self.front_idx
def main():
Queue = MyCircularQueue(10)
Queue.enQueue(20)
Queue.enQueue(10)
Queue.display_elements()
Queue.deQueue()
Queue.enQueue(20)
Queue.enQueue(10)
Queue.enQueue(20)
Queue.enQueue(10)
Queue.enQueue(20)
Queue.enQueue(10)
Queue.enQueue(20)
Queue.enQueue(10)
Queue.enQueue(20)
Queue.enQueue(10)
Queue.enQueue(20)
Queue.enQueue(10)
Queue.enQueue(20)
Queue.enQueue(10)
Queue.display_elements()
print("The front element of the queue is " + str(Queue.Front()))
print("The rear element of the queue is " + str(Queue.Rear()))
Queue.deQueue()
Queue.deQueue()
Queue.deQueue()
Queue.deQueue()
Queue.deQueue()
Queue.deQueue()
Queue.deQueue()
Queue.deQueue()
Queue.deQueue()
print("The front element of the queue is " + str(Queue.Front()))
print("The rear element of the queue is " + str(Queue.Rear()))
Queue.display_elements()
if __name__ == "__main__":
main() |
def binary_search(search_val, search_list):
midpoint = (len(search_list)-1) // 2
if search_val == search_list[midpoint]:
return True
elif len(search_list) == 1 and search_val != search_list[0]:
return False
elif search_val > search_list[midpoint]:
return binary_search(search_val, search_list[midpoint:])
else:
return binary_search(search_val, search_list[:midpoint])
def main():
test_list = [7, 1, 16, 100, 5, 8, 101, 2, 6, 1560]
test_list_sorted = sorted(test_list)
search_val = 101
print(binary_search(search_val, test_list_sorted))
if __name__ == "__main__":
main() |
class CachedAccessor:
def __init__(self, name, accessor):
self._name = name
self._accessor = accessor
def __get__(self, obj, cls):
if obj is None:
return self._accessor
accessor_obj = self._accessor(obj)
setattr(obj, self._name, accessor_obj)
return accessor_obj
class Example:
"""test class"""
def __init__(self, data):
self._data = data
def register_accessor(name):
def func(accessor):
setattr(Example, name, CachedAccessor(name, accessor))
return accessor
return func
@register_accessor("test")
class TestAccessor:
"""an accessor of Example"""
def __init__(self, obj):
self._obj = obj
def __call__(self, other):
"""check for equality
Parameters
----------
other
The value to compare to
Returns
-------
result : bool
"""
return self._obj._data == other
@property
def double(self):
"""double the data"""
return self.multiply(2)
def multiply(self, factor):
"""multiply data with a factor
Parameters
----------
factor : int
The factor for the multiplication
"""
return self._obj._data * factor
class SubAccessor:
def __init__(self, obj):
self._obj = obj
def func(self, a):
"""namespaced function"""
print(self._obj, a)
@register_accessor("test2")
class Test2Accessor:
"""an accessor of Example"""
sub = CachedAccessor("sub", SubAccessor)
def __init__(self, obj):
self._obj = obj
|
matrix = [[0,0,0], [0,0,0], [0,0,0]]
for l in range(0,3):
for c in range(0,3):
matrix[l][c] = int(input(f'digite um numero [{l}][{c}]: '))
print('-='*30)
for l in range(0,3):
for c in range(0,3):
print(f'[{matrix[l][c]:^5}]', end='')
print() |
# -*- coding: utf-8 -*-
# Scrapy settings for FinalProject project
#
# For simplicity, this file contains only settings considered important or
# commonly used. You can find more settings consulting the documentation:
#
# http://doc.scrapy.org/en/latest/topics/settings.html
# http://scrapy.readthedocs.org/en/latest/topics/downloader-middleware.html
# http://scrapy.readthedocs.org/en/latest/topics/spider-middleware.html
BOT_NAME = 'FinalProject'
SPIDER_MODULES = ['FinalProject.spiders']
NEWSPIDER_MODULE = 'FinalProject.spiders'
# database connection parameters
DBKWARGS = {'db': 'final_project', 'user': 'root', 'passwd': '',
'host': 'localhost', 'use_unicode': False, 'charset': 'utf8'}
DB_TABLE = 'HouseRent_58'
CRAWLERA_ENABLED = True
CRAWLERA_APIKEY = '0ccaed0e66654294baf419f03c32344d'
# CRAWLERA_PRESERVE_DELAY = True
# Retry many times since proxies often fail
RETRY_TIMES = 10
# Retry on most error codes since proxies fail for different reasons
RETRY_HTTP_CODES = [500, 503, 504, 400, 403, 404, 408, 301, 302, 429]
# Proxy list containing entries like
# http://host1:port
# http://username:password@host2:port
# http://host3:port
# ...
PROXY_LIST = 'proxies.txt'
# Proxy mode
# 0 = Every requests have different proxy
# 1 = Take only one proxy from the list and assign it to every requests
# 2 = Put a custom proxy to use in the settings
PROXY_MODE = 0
# Crawl responsibly by identifying yourself (and your website) on the user-agent
USER_AGENT = "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.95 Safari/537.36"
USER_AGENTS = [
"Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; AcooBrowser; .NET CLR 1.1.4322; .NET CLR 2.0.50727)",
"Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0; Acoo Browser; SLCC1; .NET CLR 2.0.50727; Media Center PC 5.0; .NET CLR 3.0.04506)",
"Mozilla/4.0 (compatible; MSIE 7.0; AOL 9.5; AOLBuild 4337.35; Windows NT 5.1; .NET CLR 1.1.4322; .NET CLR 2.0.50727)",
"Mozilla/5.0 (Windows; U; MSIE 9.0; Windows NT 9.0; en-US)",
"Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Win64; x64; Trident/5.0; .NET CLR 3.5.30729; .NET CLR 3.0.30729; .NET CLR 2.0.50727; Media Center PC 6.0)",
"Mozilla/5.0 (compatible; MSIE 8.0; Windows NT 6.0; Trident/4.0; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; .NET CLR 1.0.3705; .NET CLR 1.1.4322)",
"Mozilla/4.0 (compatible; MSIE 7.0b; Windows NT 5.2; .NET CLR 1.1.4322; .NET CLR 2.0.50727; InfoPath.2; .NET CLR 3.0.04506.30)",
"Mozilla/5.0 (Windows; U; Windows NT 5.1; zh-CN) AppleWebKit/523.15 (KHTML, like Gecko, Safari/419.3) Arora/0.3 (Change: 287 c9dfb30)",
"Mozilla/5.0 (X11; U; Linux; en-US) AppleWebKit/527+ (KHTML, like Gecko, Safari/419.3) Arora/0.6",
"Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.2pre) Gecko/20070215 K-Ninja/2.1.1",
"Mozilla/5.0 (Windows; U; Windows NT 5.1; zh-CN; rv:1.9) Gecko/20080705 Firefox/3.0 Kapiko/3.0",
"Mozilla/5.0 (X11; Linux i686; U;) Gecko/20070322 Kazehakase/0.4.5",
"Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.8) Gecko Fedora/1.9.0.8-1.fc10 Kazehakase/0.5.6",
"Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.11 (KHTML, like Gecko) Chrome/17.0.963.56 Safari/535.11",
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_3) AppleWebKit/535.20 (KHTML, like Gecko) Chrome/19.0.1036.7 Safari/535.20",
"Opera/9.80 (Macintosh; Intel Mac OS X 10.6.8; U; fr) Presto/2.9.168 Version/11.52",
]
# Obey robots.txt rules
# ROBOTSTXT_OBEY = True
# Configure maximum concurrent requests performed by Scrapy (default: 16)
# CONCURRENT_REQUESTS = 32
# Configure a delay for requests for the same website (default: 0)
# See http://scrapy.readthedocs.org/en/latest/topics/settings.html#download-delay
# See also autothrottle settings and docs
# DOWNLOAD_DELAY = 1
# RANDOMIZE_DOWNLOAD_DELAY = True
# The download delay setting will honor only one of:
# CONCURRENT_REQUESTS_PER_DOMAIN = 16
# CONCURRENT_REQUESTS_PER_IP = 16
# Disable cookies (enabled by default)
# COOKIES_ENABLED = False
# Disable Telnet Console (enabled by default)
# TELNETCONSOLE_ENABLED = False
# Override the default request headers:
# DEFAULT_REQUEST_HEADERS = {
# 'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',
# 'Accept-Language': 'en',
# }
# Enable or disable spider middlewares
# See http://scrapy.readthedocs.org/en/latest/topics/spider-middleware.html
# SPIDER_MIDDLEWARES = {
# 'FinalProject.middlewares.FinalprojectSpiderMiddleware': 543,
# }
# Enable or disable downloader middlewares
# See http://scrapy.readthedocs.org/en/latest/topics/downloader-middleware.html
DOWNLOADER_MIDDLEWARES = {
# 'scrapy.downloadermiddlewares.retry.RetryMiddleware': 90,
# 'FinalProject.middlewares.RandomProxy': 100,
# 'scrapy.downloadermiddlewares.httpproxy.HttpProxyMiddleware': 110,
# 'FinalProject.middlewares.RandomUserAgent': 120,
'FinalProject.middlewares.CustomDownloaderMiddleware': 200,
'scrapy_crawlera.CrawleraMiddleware': 610
}
# Enable or disable extensions
# See http://scrapy.readthedocs.org/en/latest/topics/extensions.html
# EXTENSIONS = {
# 'scrapy.extensions.telnet.TelnetConsole': None,
# }
# Configure item pipelines
# See http://scrapy.readthedocs.org/en/latest/topics/item-pipeline.html
ITEM_PIPELINES = {
# 'FinalProject.pipelines.CSVPipeline': 1000,
'FinalProject.pipelines.MysqlPipeline': 1000,
}
# Enable and configure the AutoThrottle extension (disabled by default)
# See http://doc.scrapy.org/en/latest/topics/autothrottle.html
# AUTOTHROTTLE_ENABLED = True
# The initial download delay
# AUTOTHROTTLE_START_DELAY = 5
# The maximum download delay to be set in case of high latencies
# AUTOTHROTTLE_MAX_DELAY = 60
# The average number of requests Scrapy should be sending in parallel to
# each remote server
# AUTOTHROTTLE_TARGET_CONCURRENCY = 1.0
# Enable showing throttling stats for every response received:
# AUTOTHROTTLE_DEBUG = False
# Enable and configure HTTP caching (disabled by default)
# See http://scrapy.readthedocs.org/en/latest/topics/downloader-middleware.html#httpcache-middleware-settings
# HTTPCACHE_ENABLED = True
# HTTPCACHE_EXPIRATION_SECS = 0
# HTTPCACHE_DIR = 'httpcache'
# HTTPCACHE_IGNORE_HTTP_CODES = []
# HTTPCACHE_STORAGE = 'scrapy.extensions.httpcache.FilesystemCacheStorage'
|
def _try_composite(a, d, n, s):
if pow(a, d, n) == 1:
return False
for i in range(s):
if pow(a, 2**i * d, n) == n - 1:
return False
return True
def is_prime(n):
"""
Deterministic variant of the Miller-Rabin primality test to determine
whether a given number is prime.
Parameters
----------
n : int
n >= 0, an integer to be tested for primality.
Returns
-------
bool
False if n is composite, otherwise True.
"""
if n in [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37]:
return True
if (any((n % p) == 0 for p in [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37])) or (n in [0, 1]):
return False
d, s = n - 1, 0
while not d % 2:
d, s = d >> 1, s + 1
if n < 2047:
return not _try_composite(2, d, n, s)
if n < 1373653:
return not any(_try_composite(a, d, n, s) for a in [2, 3])
if n < 25326001:
return not any(_try_composite(a, d, n, s) for a in [2, 3, 5])
if n < 118670087467:
if n == 3215031751:
return False
return not any(_try_composite(a, d, n, s) for a in [2, 3, 5, 7])
if n < 2152302898747:
return not any(_try_composite(a, d, n, s) for a in [2, 3, 5, 7, 11])
if n < 3474749660383:
return not any(_try_composite(a, d, n, s) for a in [2, 3, 5, 7, 11, 13])
if n < 341550071728321:
return not any(_try_composite(a, d, n, s) for a in [2, 3, 5, 7, 11, 13, 17])
if n < 3825123056546413051:
return not any(_try_composite(a, d, n, s) for a in [2, 3, 5, 7, 11, 13, 17, 19, 23])
return not any(_try_composite(a, d, n, s) for a in [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37])
|
"""
https://edabit.com/challenge/FgAsxMCaEzvKhnuAH
Deep Arithmetic
Create a function that takes an array of strings of arbitrary dimensionality ([], [][], [][][], etc) and returns the deep_sum of every separate number in each string in the array.
Examples
deep_sum(["1", "five", "2wenty", "thr33"]) ➞ 36
deep_sum([["1X2", "t3n"], ["1024", "5", "64"]]) ➞ 1099
deep_sum([[["1"], "10v3"], ["738h"], [["s0"], ["1mu4ch3"], "-1s0"]]) ➞ 759
Notes
Numbers in strings can be negative, but will all be base-10 integers.
Negative numbers may directly follow another number.
The hyphen or minus character ("-") does not only occur in numbers.
Arrays may be ragged or empty.
actual_param = [
["1", "five", "2wenty", "thr33"],
[["1X2", "t3n"],["1024", "5", "64"]],
[[["1"], "10v3"], ["738h"], [["s0"], ["1mu4ch3"], "-1s0"]],
[[["0", "0x2", "z3r1"],["1", "55a46"]],[["1", "0b2", "4"],["0x5fp-2", "nine", "09"],["4", "4", "4"]],[["03"]], []],
[[[[[[[[[[[[[[[["-1", "1"], ["3"], [""], []]]]]]]]]]]]]]]],
[[[[[[[[[[[[[[[[]]]]]]]]]]]]]]]],
[[[[[["-32-64", "a-zA-Z"], ["01-1"]]]]]]
]
expected_param = [36, 1099, 759, 142, 3, 0, -96]
"""
def deep_sum(lst):
a,b,c,rr=[],[],[],[]
num="0123456789"
for t in range(20):
for i in lst:
if type(i)==list:
for j in i:b.append(j)
else:b.append(i)
if lst==b : break
else:lst=b
b=[]
for i in b:
e=[]
if not len(i)==0:
if i[0]=='-':
if len(i)>0:
e=list(i)
for k in range(1,len(i)):
if not i[k] in num:
e.remove(i[k])
if i[k]=='-':
b.append("".join(i[k:]))
elif not i[k] in num:
b.append("".join(i[k+1:]))
c.append("".join(i[0:k]))
break
if e==list(i) :
c.append("".join(e))
elif not (i[0] in num or i[0]=='-'):
b.append(i[1:])
else:
e=list(i)
for k in range(0,len(i)):
if not i[k] in num:
e.remove(i[k])
if i[k]=='-':
b.append("".join(i[k:]))
elif not i[k] in num:
b.append("".join(i[k+1:]))
c.append("".join(i[0:k]))
break
if e==list(i) :
c.append("".join(e))
for i in c:
if not (i=='' or i=="-"):rr.append(int(i))
return (sum(rr))
deep_sum(["1", "five", "2wenty", "thr33"]) #➞ 36
#deep_sum([[[[[["-32-64", "a-zA-Z"], ["01-1"]]]]]]) #-96
#deep_sum([["1X2", "t3n"], ["1024", "5", "64"]]) #➞ 1099
#deep_sum([[["1"], "10v3"], ["738h"], [["s0"], ["1mu4ch3"], "-1s0"]]) #➞ 759
#deep_sum([[[[[[[[[[[[[[[[]]]]]]]]]]]]]]]])
#deep_sum([[["0", "0x2", "z3r1"],["1", "55a46"]],[["1", "0b2", "4"],["0x5fp-2", "nine", "09"],["4", "4", "4"]],[["03"]], []]) #142 |
soma = 0
cont = 0
for contador in range(1,501, 2):
if contador % 3 == 0:
cont = cont + 1
soma = soma + contador
print('A soma dos {} números ímpares múltiplos de 3 é {}'.format(cont, soma))
|
class Solution:
def stringMatching(self, words: List[str]) -> List[str]:
words.sort(key=len)
res = []
lps = [self._compute_lps(w) for w in words[:-1]]
for i in range(len(words)):
for j in range(i + 1, len(words)):
if self._kmp(words[i], words[j], lps[i]):
res.append(words[i])
break
return res
def _kmp(self, w, s, lps):
i, j = 0, 0
c = 0
while i < len(s):
if s[i] == w[j]:
i += 1
j += 1
if j == len(w):
return True
else:
if j != 0:
j = lps[j-1]
else:
i += 1
return False
def _compute_lps(self, w):
n = len(w)
lps = [0] * n
i = 1
p = 0
while i < n:
if w[i] == w[p]:
p += 1
lps[i] = p
i += 1
else:
if p != 0:
p = lps[p-1]
else:
p = 0
i += 1
return lps
|
def get_users(passwd: str) -> dict:
"""Split password output by newline,
extract user and name (1st and 5th columns),
strip trailing commas from name,
replace multiple commas in name with a single space
return dict of keys = user, values = name.
"""
output = {}
for line in passwd.strip().splitlines():
user, name = line.split(":")[0], line.split(":")[4]
name = name.rstrip(",").replace(",,,,", " ") if name else "unknown"
output[user] = name
return output
|
def char_concat(word):
string = ''
for i in range(int(len(word)/2)):
string += word[i] + word[-i-1] + str(i+1)
return string |
def transcribe(seq: str) -> str:
"""
transcribes DNA to RNA by generating
the complement sequence with T -> U replacement
"""
rna=""
for i in seq:
if i not in 'ATGC':
rna = "Invalid Input" ##only accepts ATGC as a input
break
##builds a rna string by concataning each letter
if i == 'A':
rna += 'U'
elif i == 'C':
rna += 'G'
elif i == 'T':
rna += 'A'
else:
rna += 'C'
return(rna)
def reverse_transcribe(seq: str) -> str:
"""
transcribes DNA to RNA then reverses
the strand
"""
##calls trasncribe function
## Then reverse the string using slicing
reverse=transcribe(seq)
reverse=reverse[::-1]
return(reverse) |
class KdcVendor(basestring):
"""
Kerberos Key Distribution Center (KDC) Vendor
Possible values:
<ul>
<li> "microsoft" ,
<li> "other"
</ul>
"""
@staticmethod
def get_api_name():
return "kdc-vendor"
|
def test_chain_web3_is_preconfigured_with_default_from(project):
default_account = '0x0000000000000000000000000000000000001234'
project.config['web3.Tester.eth.default_account'] = default_account
with project.get_chain('tester') as chain:
web3 = chain.web3
assert web3.eth.defaultAccount == default_account
assert web3.eth.coinbase != default_account
|
args = dict(
models = [
{
"name": 'RandomForestClassifier',
'params': {
'n_estimators': [60],
'max_depth': [12],
'min_samples_split': [6],
'min_samples_leaf': [2],
# 'max_features': [12],
'random_state': [123456],
'class_weight': [{0:1, 1:10}]
},
},
{
"name": 'ExtraTreesClassifier',
'params': {
# 'n_estimators': [70],
# 'max_depth': [13],
# 'min_samples_split': [8],
# 'min_samples_leaf': [2],
# 'max_features': [13],
# 'random_state': [123456],
'class_weight': [{0:1, 1:5}],
},
},
{
'name': 'AdaBoostClassifier',
'params': {
'n_estimators': [400],
'learning_rate': [0.5],
'random_state': [123456],
'algorithm': ['SAMME.R']
},
},
{
'name': 'GradientBoostingClassifier',
'params': {
'n_estimators': [60],
'max_depth': [12],
'min_samples_split': [6],
'min_samples_leaf': [2],
'max_features': [0.7],
'random_state': [123456]
# fit(X, y, sample_weight=None, monitor=None)
},
},
{
'name': 'BaggingClassifier',
'params': {
'n_estimators': [70],
'max_features': [0.8],
'random_state': [123456],
},
},
# {
# 'name': 'KNeighborsClassifier',
# 'params': {
# 'weights': ['distance'],
# 'algorithm': ['auto'],
# 'n_neighbors': [3]
# },
# },
# {
# 'name':'XGBClassifier',
# 'params': {
# }
# },
# {
# 'name': 'LogisticRegressionCV',
# 'params': {
# 'class_weight': ['balanced'],
# 'solver': ['saga'],
# 'max_iter': [3000],
# 'scoring': ['f1'],
# }
# },
],
scoring = "f1",
cv = 5,
n_jobs = 6,
# 设置为True,DataPrepare会重新生成train_train和train_test数据集
# 在调试、训练特征时使用,
TRAIN_Features = False,
# 训练集的比例
TRAIN_Percent = 0.6,
# 控制train.py、test.py加载train或test数据还是整个数据
NEED_TEST = False,
test_config = {
"models": [
'ExtraTreesClassifier',
'AdaBoostClassifier',
'GradientBoostingClassifier',
'RandomForestClassifier',
'BaggingClassifier',
# 'KNeighborsClassifier',
# 'LogisticRegressionCV'
# 'XGBClassifier'
],
"scoring" : "f1",
"cv" : 5,
"n_jobs" : 3
},
drop_cols = ['srcAddress', 'destAddress', 'tlsSubject', 'appProtocol', 'tlsIssuerDn', 'tlsSni', 'eventId'] +
['C', 'ST', 'L', 'O', 'OU', 'CN'] +
['label'] +
['tls_star', 'tls_XX', 'C_len', 'tls_some_state', 'unknown_len', 'tls_default', 'serialNumber_len'] +
['CN_len', 'ST_len', 'tlsVersion'] + ['ST', 'L', 'O', 'emailAddress', 'serialNumber'],
)
|
#Ascending order
n = int(input().strip())
a = list(map(int, input().strip().split(' ')))
for i in range(n):
for j in range(n-1):
if(a[j]>a[j+1]):
a[j],a[j+1]=a[j+1],a[j]
print(a)
#Descending order
Data = [75,3,73,7,6,23,89,8]
for i in range(len(Data)):
for j in range(len(Data)-1):
if(Data[j]<Data[j+1]):
Data[j],Data[j+1]=Data[j+1],Data[j]
print(Data) |
class Solution:
def letterCasePermutation(self, S: str) -> List[str]:
ans = []
self.dfs(S, 0, ans, [])
return ans
def dfs(self, S, i, ans, path):
if i == len(S):
ans.append(''.join(path))
return
self.dfs(S, i+1, ans, path + [S[i]])
if S[i].isalpha():
self.dfs(S, i+1, ans, path + [S[i].swapcase()])
|
# Copyright (c) 2013-2017 by Ron Frederick <ronf@timeheart.net>.
# All rights reserved.
#
# This program and the accompanying materials are made available under
# the terms of the Eclipse Public License v1.0 which accompanies this
# distribution and is available at:
#
# http://www.eclipse.org/legal/epl-v10.html
#
# Contributors:
# Ron Frederick - initial implementation, API, and documentation
"""SSH client protocol handler"""
class SSHClient:
"""SSH client protocol handler
Applications should subclass this when implementing an SSH client.
The functions listed below should be overridden to define
application-specific behavior. In particular, the method
:meth:`auth_completed` should be defined to open the desired
SSH channels on this connection once authentication has been
completed.
For simple password or public key based authentication, nothing
needs to be defined here if the password or client keys are passed
in when the connection is created. However, to prompt interactively
or otherwise dynamically select these values, the methods
:meth:`password_auth_requested` and/or :meth:`public_key_auth_requested`
can be defined. Keyboard-interactive authentication is also supported
via :meth:`kbdint_auth_requested` and :meth:`kbdint_challenge_received`.
If the server sends an authentication banner, the method
:meth:`auth_banner_received` will be called.
If the server requires a password change, the method
:meth:`password_change_requested` will be called, followed by either
:meth:`password_changed` or :meth:`password_change_failed` depending
on whether the password change is successful.
.. note:: The authentication callbacks described here can be
defined as coroutines. However, they may be cancelled if
they are running when the SSH connection is closed by
the server. If they attempt to catch the CancelledError
exception to perform cleanup, they should make sure to
re-raise it to allow AsyncSSH to finish its own cleanup.
"""
# pylint: disable=no-self-use,unused-argument
def connection_made(self, conn):
"""Called when a connection is made
This method is called as soon as the TCP connection completes.
The `conn` parameter should be stored if needed for later use.
:param conn:
The connection which was successfully opened
:type conn: :class:`SSHClientConnection`
"""
pass # pragma: no cover
def connection_lost(self, exc):
"""Called when a connection is lost or closed
This method is called when a connection is closed. If the
connection is shut down cleanly, *exc* will be `None`.
Otherwise, it will be an exception explaining the reason for
the disconnect.
:param exc:
The exception which caused the connection to close, or
`None` if the connection closed cleanly
:type exc: :class:`Exception`
"""
pass # pragma: no cover
def debug_msg_received(self, msg, lang, always_display):
"""A debug message was received on this connection
This method is called when the other end of the connection sends
a debug message. Applications should implement this method if
they wish to process these debug messages.
:param msg:
The debug message sent
:param lang:
The language the message is in
:param always_display:
Whether or not to display the message
:type msg: `str`
:type lang: `str`
:type always_display: `bool`
"""
pass # pragma: no cover
def auth_banner_received(self, msg, lang):
"""An incoming authentication banner was received
This method is called when the server sends a banner to display
during authentication. Applications should implement this method
if they wish to do something with the banner.
:param msg:
The message the server wanted to display
:param lang:
The language the message is in
:type msg: `str`
:type lang: `str`
"""
pass # pragma: no cover
def auth_completed(self):
"""Authentication was completed successfully
This method is called when authentication has completed
succesfully. Applications may use this method to create
whatever client sessions and direct TCP/IP or UNIX domain
connections are needed and/or set up listeners for incoming
TCP/IP or UNIX domain connections coming from the server.
"""
pass # pragma: no cover
def public_key_auth_requested(self):
"""Public key authentication has been requested
This method should return a private key corresponding to
the user that authentication is being attempted for.
This method may be called multiple times and can return a
different key to try each time it is called. When there are
no keys left to try, it should return `None` to indicate
that some other authentication method should be tried.
If client keys were provided when the connection was opened,
they will be tried before this method is called.
If blocking operations need to be performed to determine the
key to authenticate with, this method may be defined as a
coroutine.
:returns: A key as described in :ref:`SpecifyingPrivateKeys`
or `None` to move on to another authentication
method
"""
return None # pragma: no cover
def password_auth_requested(self):
"""Password authentication has been requested
This method should return a string containing the password
corresponding to the user that authentication is being
attempted for. It may be called multiple times and can
return a different password to try each time, but most
servers have a limit on the number of attempts allowed.
When there's no password left to try, this method should
return `None` to indicate that some other authentication
method should be tried.
If a password was provided when the connection was opened,
it will be tried before this method is called.
If blocking operations need to be performed to determine the
password to authenticate with, this method may be defined as
a coroutine.
:returns: A string containing the password to authenticate
with or `None` to move on to another authentication
method
"""
return None # pragma: no cover
def password_change_requested(self, prompt, lang):
"""A password change has been requested
This method is called when password authentication was
attempted and the user's password was expired on the
server. To request a password change, this method should
return a tuple or two strings containing the old and new
passwords. Otherwise, it should return `NotImplemented`.
If blocking operations need to be performed to determine the
passwords to authenticate with, this method may be defined
as a coroutine.
By default, this method returns `NotImplemented`.
:param prompt:
The prompt requesting that the user enter a new password
:param lang:
The language that the prompt is in
:type prompt: `str`
:type lang: `str`
:returns: A tuple of two strings containing the old and new
passwords or `NotImplemented` if password changes
aren't supported
"""
return NotImplemented # pragma: no cover
def password_changed(self):
"""The requested password change was successful
This method is called to indicate that a requested password
change was successful. It is generally followed by a call to
:meth:`auth_completed` since this means authentication was
also successful.
"""
pass # pragma: no cover
def password_change_failed(self):
"""The requested password change has failed
This method is called to indicate that a requested password
change failed, generally because the requested new password
doesn't meet the password criteria on the remote system.
After this method is called, other forms of authentication
will automatically be attempted.
"""
pass # pragma: no cover
def kbdint_auth_requested(self):
"""Keyboard-interactive authentication has been requested
This method should return a string containing a comma-separated
list of submethods that the server should use for
keyboard-interactive authentication. An empty string can be
returned to let the server pick the type of keyboard-interactive
authentication to perform. If keyboard-interactive authentication
is not supported, `None` should be returned.
By default, keyboard-interactive authentication is supported
if a password was provided when the :class:`SSHClient` was
created and it hasn't been sent yet. If the challenge is not
a password challenge, this authentication will fail. This
method and the :meth:`kbdint_challenge_received` method can be
overridden if other forms of challenge should be supported.
If blocking operations need to be performed to determine the
submethods to request, this method may be defined as a
coroutine.
:returns: A string containing the submethods the server should
use for authentication or `None` to move on to
another authentication method
"""
return NotImplemented # pragma: no cover
def kbdint_challenge_received(self, name, instructions, lang, prompts):
"""A keyboard-interactive auth challenge has been received
This method is called when the server sends a keyboard-interactive
authentication challenge.
The return value should be a list of strings of the same length
as the number of prompts provided if the challenge can be
answered, or `None` to indicate that some other form of
authentication should be attempted.
If blocking operations need to be performed to determine the
responses to authenticate with, this method may be defined
as a coroutine.
By default, this method will look for a challenge consisting
of a single 'Password:' prompt, and call the method
:meth:`password_auth_requested` to provide the response.
It will also ignore challenges with no prompts (generally used
to provide instructions). Any other form of challenge will
cause this method to return `None` to move on to another
authentication method.
:param name:
The name of the challenge
:param instructions:
Instructions to the user about how to respond to the challenge
:param lang:
The language the challenge is in
:param prompts:
The challenges the user should respond to and whether or
not the responses should be echoed when they are entered
:type name: `str`
:type instructions: `str`
:type lang: `str`
:type prompts: `list` of tuples of `str` and `bool`
:returns: List of string responses to the challenge or `None`
to move on to another authentication method
"""
return None # pragma: no cover
|
#!/usr/bin/env python3
def validate_user(username, minlen):
if type(username) != str:
raise TypeError("username must be a string")
if len(username) < minlen:
return False
if not username.isalnum():
return False
# Username can't begin with a number
if username[0].isnumeric():
return False
return True |
# Get balances queries
LIQUIDITY_POSITIONS_QUERY = (
"""
liquidityPositions
(
first: $limit,
skip: $offset,
where: {{
user_in: $addresses,
liquidityTokenBalance_gt: $balance,
}}) {{
id
liquidityTokenBalance
pair {{
id
reserve0
reserve1
token0 {{
id
decimals
name
symbol
}}
token1 {{
id
decimals
name
symbol
}}
totalSupply
}}
user {{
id
}}
}}}}
"""
)
TOKEN_DAY_DATAS_QUERY = (
"""
tokenDayDatas
(
first: $limit,
skip: $offset,
where: {{
token_in: $token_ids,
date: $datetime,
}}) {{
date
token {{
id
}}
priceUSD
}}}}
"""
)
|
#
# PySNMP MIB module HPN-ICF-DHCPRELAY-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/HPN-ICF-DHCPRELAY-MIB
# Produced by pysmi-0.3.4 at Wed May 1 13:37:51 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")
ConstraintsIntersection, ValueSizeConstraint, ConstraintsUnion, SingleValueConstraint, ValueRangeConstraint = mibBuilder.importSymbols("ASN1-REFINEMENT", "ConstraintsIntersection", "ValueSizeConstraint", "ConstraintsUnion", "SingleValueConstraint", "ValueRangeConstraint")
hpnicfCommon, = mibBuilder.importSymbols("HPN-ICF-OID-MIB", "hpnicfCommon")
ifIndex, = mibBuilder.importSymbols("IF-MIB", "ifIndex")
InetAddressType, InetAddress = mibBuilder.importSymbols("INET-ADDRESS-MIB", "InetAddressType", "InetAddress")
ModuleCompliance, NotificationGroup = mibBuilder.importSymbols("SNMPv2-CONF", "ModuleCompliance", "NotificationGroup")
Gauge32, iso, Counter64, ModuleIdentity, TimeTicks, Integer32, NotificationType, MibScalar, MibTable, MibTableRow, MibTableColumn, Bits, MibIdentifier, IpAddress, ObjectIdentity, Unsigned32, Counter32 = mibBuilder.importSymbols("SNMPv2-SMI", "Gauge32", "iso", "Counter64", "ModuleIdentity", "TimeTicks", "Integer32", "NotificationType", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "Bits", "MibIdentifier", "IpAddress", "ObjectIdentity", "Unsigned32", "Counter32")
DisplayString, MacAddress, TextualConvention, TruthValue, RowStatus = mibBuilder.importSymbols("SNMPv2-TC", "DisplayString", "MacAddress", "TextualConvention", "TruthValue", "RowStatus")
hpnicfDhcpRelay = ModuleIdentity((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 58))
hpnicfDhcpRelay.setRevisions(('2005-06-08 00:00',))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
if mibBuilder.loadTexts: hpnicfDhcpRelay.setRevisionsDescriptions(('The initial version of this MIB module.',))
if mibBuilder.loadTexts: hpnicfDhcpRelay.setLastUpdated('200506080000Z')
if mibBuilder.loadTexts: hpnicfDhcpRelay.setOrganization('')
if mibBuilder.loadTexts: hpnicfDhcpRelay.setContactInfo('')
if mibBuilder.loadTexts: hpnicfDhcpRelay.setDescription('DHCPR MIB')
hpnicfDHCPRMibObject = MibIdentifier((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 58, 1))
hpnicfDHCPRIfSelectTable = MibTable((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 58, 1, 1), )
if mibBuilder.loadTexts: hpnicfDHCPRIfSelectTable.setStatus('current')
if mibBuilder.loadTexts: hpnicfDHCPRIfSelectTable.setDescription('A table for configuring relay mode for interfaces. ')
hpnicfDHCPRIfSelectEntry = MibTableRow((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 58, 1, 1, 1), ).setIndexNames((0, "IF-MIB", "ifIndex"))
if mibBuilder.loadTexts: hpnicfDHCPRIfSelectEntry.setStatus('current')
if mibBuilder.loadTexts: hpnicfDHCPRIfSelectEntry.setDescription('An entry for configuring relay mode for an interface. ')
hpnicfDHCPRIfSelectRelayMode = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 58, 1, 1, 1, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("on", 1), ("off", 2))).clone('off')).setMaxAccess("readwrite")
if mibBuilder.loadTexts: hpnicfDHCPRIfSelectRelayMode.setStatus('current')
if mibBuilder.loadTexts: hpnicfDHCPRIfSelectRelayMode.setDescription('If the value is on, the DHCP relay function would be enabled on this interface. ')
hpnicfDHCPRIpToGroupTable = MibTable((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 58, 1, 2), )
if mibBuilder.loadTexts: hpnicfDHCPRIpToGroupTable.setStatus('current')
if mibBuilder.loadTexts: hpnicfDHCPRIpToGroupTable.setDescription('A table for configuring ip addresses for DHCP server groups. ')
hpnicfDHCPRIpToGroupEntry = MibTableRow((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 58, 1, 2, 1), ).setIndexNames((0, "HPN-ICF-DHCPRELAY-MIB", "hpnicfDHCPRIpToGroupGroupId"), (0, "HPN-ICF-DHCPRELAY-MIB", "hpnicfDHCPRIpToGroupServerIpType"), (0, "HPN-ICF-DHCPRELAY-MIB", "hpnicfDHCPRIpToGroupServerIp"))
if mibBuilder.loadTexts: hpnicfDHCPRIpToGroupEntry.setStatus('current')
if mibBuilder.loadTexts: hpnicfDHCPRIpToGroupEntry.setDescription('An entry for configuring ip addresses for a DHCP server group. ')
hpnicfDHCPRIpToGroupGroupId = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 58, 1, 2, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 19)))
if mibBuilder.loadTexts: hpnicfDHCPRIpToGroupGroupId.setStatus('current')
if mibBuilder.loadTexts: hpnicfDHCPRIpToGroupGroupId.setDescription('Group identifier of DHCP server group. ')
hpnicfDHCPRIpToGroupServerIpType = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 58, 1, 2, 1, 2), InetAddressType())
if mibBuilder.loadTexts: hpnicfDHCPRIpToGroupServerIpType.setStatus('current')
if mibBuilder.loadTexts: hpnicfDHCPRIpToGroupServerIpType.setDescription('Ip address type of DHCP server. ')
hpnicfDHCPRIpToGroupServerIp = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 58, 1, 2, 1, 3), InetAddress().subtype(subtypeSpec=ValueSizeConstraint(1, 64)))
if mibBuilder.loadTexts: hpnicfDHCPRIpToGroupServerIp.setStatus('current')
if mibBuilder.loadTexts: hpnicfDHCPRIpToGroupServerIp.setDescription('Ip address of DHCP server. ')
hpnicfDHCPRIpToGroupRowStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 58, 1, 2, 1, 4), RowStatus()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: hpnicfDHCPRIpToGroupRowStatus.setStatus('current')
if mibBuilder.loadTexts: hpnicfDHCPRIpToGroupRowStatus.setDescription('Operation status of this table entry. Three actions are used: active, createAndGo, destroy. ')
hpnicfDHCPRIfToGroupTable = MibTable((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 58, 1, 3), )
if mibBuilder.loadTexts: hpnicfDHCPRIfToGroupTable.setStatus('current')
if mibBuilder.loadTexts: hpnicfDHCPRIfToGroupTable.setDescription('A table for configuring DHCP server groups for interfaces. ')
hpnicfDHCPRIfToGroupEntry = MibTableRow((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 58, 1, 3, 1), ).setIndexNames((0, "IF-MIB", "ifIndex"))
if mibBuilder.loadTexts: hpnicfDHCPRIfToGroupEntry.setStatus('current')
if mibBuilder.loadTexts: hpnicfDHCPRIfToGroupEntry.setDescription('An entry for configuring DHCP server group for an interface. ')
hpnicfDHCPRIfToGroupGroupId = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 58, 1, 3, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 19))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: hpnicfDHCPRIfToGroupGroupId.setStatus('current')
if mibBuilder.loadTexts: hpnicfDHCPRIfToGroupGroupId.setDescription('The DHCP server group for this interface. ')
hpnicfDHCPRIfToGroupRowStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 58, 1, 3, 1, 2), RowStatus()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: hpnicfDHCPRIfToGroupRowStatus.setStatus('current')
if mibBuilder.loadTexts: hpnicfDHCPRIfToGroupRowStatus.setDescription('Operation status of this table entry. Three actions are used: active, createAndGo, destroy')
hpnicfDHCPRAddrCheckTable = MibTable((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 58, 1, 4), )
if mibBuilder.loadTexts: hpnicfDHCPRAddrCheckTable.setStatus('current')
if mibBuilder.loadTexts: hpnicfDHCPRAddrCheckTable.setDescription('A table containing the states of dhcp security address check switchs for interfaces. ')
hpnicfDHCPRAddrCheckEntry = MibTableRow((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 58, 1, 4, 1), ).setIndexNames((0, "IF-MIB", "ifIndex"))
if mibBuilder.loadTexts: hpnicfDHCPRAddrCheckEntry.setStatus('current')
if mibBuilder.loadTexts: hpnicfDHCPRAddrCheckEntry.setDescription('An entry containing the state of dhcp security address check switch for an interface. ')
hpnicfDHCPRAddrCheckSwitch = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 58, 1, 4, 1, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enabled", 1), ("disabled", 2))).clone('disabled')).setMaxAccess("readwrite")
if mibBuilder.loadTexts: hpnicfDHCPRAddrCheckSwitch.setStatus('current')
if mibBuilder.loadTexts: hpnicfDHCPRAddrCheckSwitch.setDescription('The state of dhcp security address check switch for this interface. It has two defined values: enabled and disabled. If the value is enabled, the address check function would be enabled. The default value is disabled. ')
hpnicfDHCPRSecurityTable = MibTable((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 58, 1, 5), )
if mibBuilder.loadTexts: hpnicfDHCPRSecurityTable.setStatus('current')
if mibBuilder.loadTexts: hpnicfDHCPRSecurityTable.setDescription('A table containing the information of DHCP security. ')
hpnicfDHCPRSecurityEntry = MibTableRow((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 58, 1, 5, 1), ).setIndexNames((0, "HPN-ICF-DHCPRELAY-MIB", "hpnicfDHCPRSecurityClientIpAddrType"), (0, "HPN-ICF-DHCPRELAY-MIB", "hpnicfDHCPRSecurityClientIpAddr"))
if mibBuilder.loadTexts: hpnicfDHCPRSecurityEntry.setStatus('current')
if mibBuilder.loadTexts: hpnicfDHCPRSecurityEntry.setDescription('An entry containing the information of DHCP security. ')
hpnicfDHCPRSecurityClientIpAddrType = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 58, 1, 5, 1, 1), InetAddressType())
if mibBuilder.loadTexts: hpnicfDHCPRSecurityClientIpAddrType.setStatus('current')
if mibBuilder.loadTexts: hpnicfDHCPRSecurityClientIpAddrType.setDescription("DHCP client's net ip address type")
hpnicfDHCPRSecurityClientIpAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 58, 1, 5, 1, 2), InetAddress().subtype(subtypeSpec=ValueSizeConstraint(1, 64)))
if mibBuilder.loadTexts: hpnicfDHCPRSecurityClientIpAddr.setStatus('current')
if mibBuilder.loadTexts: hpnicfDHCPRSecurityClientIpAddr.setDescription("DHCP client's net ip address")
hpnicfDHCPRSecurityClientMacAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 58, 1, 5, 1, 3), MacAddress()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: hpnicfDHCPRSecurityClientMacAddr.setStatus('current')
if mibBuilder.loadTexts: hpnicfDHCPRSecurityClientMacAddr.setDescription("DHCP client's mac address")
hpnicfDHCPRSecurityClientProperty = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 58, 1, 5, 1, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("static", 1), ("dynamic", 2)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: hpnicfDHCPRSecurityClientProperty.setStatus('current')
if mibBuilder.loadTexts: hpnicfDHCPRSecurityClientProperty.setDescription('Property of client address')
hpnicfDHCPRSecurityClientRowStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 58, 1, 5, 1, 5), RowStatus()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: hpnicfDHCPRSecurityClientRowStatus.setStatus('current')
if mibBuilder.loadTexts: hpnicfDHCPRSecurityClientRowStatus.setDescription('Operation status of this table entry. Three actions are used: active, createAndGo, destroy')
hpnicfDHCPRStatisticsGroup = MibIdentifier((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 58, 1, 6))
hpnicfDHCPRRxClientPktNum = MibScalar((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 58, 1, 6, 1), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: hpnicfDHCPRRxClientPktNum.setStatus('current')
if mibBuilder.loadTexts: hpnicfDHCPRRxClientPktNum.setDescription('The total number of the packets received from DHCP clients by DHCP relay. ')
hpnicfDHCPRTxClientPktNum = MibScalar((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 58, 1, 6, 2), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: hpnicfDHCPRTxClientPktNum.setStatus('current')
if mibBuilder.loadTexts: hpnicfDHCPRTxClientPktNum.setDescription('The total number of the brodcast packets transmitted to DHCP clients by DHCP relay. ')
hpnicfDHCPRRxServerPktNum = MibScalar((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 58, 1, 6, 3), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: hpnicfDHCPRRxServerPktNum.setStatus('current')
if mibBuilder.loadTexts: hpnicfDHCPRRxServerPktNum.setDescription('The total number of the packets received from DHCP Servers by DHCP relay. ')
hpnicfDHCPRTxServerPktNum = MibScalar((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 58, 1, 6, 4), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: hpnicfDHCPRTxServerPktNum.setStatus('current')
if mibBuilder.loadTexts: hpnicfDHCPRTxServerPktNum.setDescription('The total number of the packets transmitted to DHCP Servers by DHCP relay. ')
hpnicfDHCPRDiscoverPktNum = MibScalar((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 58, 1, 6, 5), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: hpnicfDHCPRDiscoverPktNum.setStatus('current')
if mibBuilder.loadTexts: hpnicfDHCPRDiscoverPktNum.setDescription('The total number of the DHCP Discover packets handled by DHCP relay. ')
hpnicfDHCPRRequestPktNum = MibScalar((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 58, 1, 6, 6), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: hpnicfDHCPRRequestPktNum.setStatus('current')
if mibBuilder.loadTexts: hpnicfDHCPRRequestPktNum.setDescription('The total number of the DHCP Request packets handled by DHCP relay. ')
hpnicfDHCPRDeclinePktNum = MibScalar((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 58, 1, 6, 7), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: hpnicfDHCPRDeclinePktNum.setStatus('current')
if mibBuilder.loadTexts: hpnicfDHCPRDeclinePktNum.setDescription('The total number of the DHCP Decline packets handled by DHCP relay. ')
hpnicfDHCPRReleasePktNum = MibScalar((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 58, 1, 6, 8), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: hpnicfDHCPRReleasePktNum.setStatus('current')
if mibBuilder.loadTexts: hpnicfDHCPRReleasePktNum.setDescription('The total number of the DHCP Release packets handled by DHCP relay. ')
hpnicfDHCPRInformPktNum = MibScalar((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 58, 1, 6, 9), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: hpnicfDHCPRInformPktNum.setStatus('current')
if mibBuilder.loadTexts: hpnicfDHCPRInformPktNum.setDescription('The total number of the DHCP Inform packets handled by DHCP relay. ')
hpnicfDHCPROfferPktNum = MibScalar((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 58, 1, 6, 10), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: hpnicfDHCPROfferPktNum.setStatus('current')
if mibBuilder.loadTexts: hpnicfDHCPROfferPktNum.setDescription('The total number of the DHCP Offer packets handled by DHCP relay. ')
hpnicfDHCPRAckPktNum = MibScalar((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 58, 1, 6, 11), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: hpnicfDHCPRAckPktNum.setStatus('current')
if mibBuilder.loadTexts: hpnicfDHCPRAckPktNum.setDescription('The total number of the DHCP Ack packets handled by DHCP relay. ')
hpnicfDHCPRNakPktNum = MibScalar((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 58, 1, 6, 12), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: hpnicfDHCPRNakPktNum.setStatus('current')
if mibBuilder.loadTexts: hpnicfDHCPRNakPktNum.setDescription('The total number of the DHCP Nak packets handled by DHCP relay. ')
hpnicfDHCPRStatisticsReset = MibScalar((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 58, 1, 6, 13), TruthValue()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: hpnicfDHCPRStatisticsReset.setStatus('current')
if mibBuilder.loadTexts: hpnicfDHCPRStatisticsReset.setDescription('This node only supports set operation. If the value is true,it will clear all of the packet statistics. ')
hpnicfDHCPRCycleGroup = MibIdentifier((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 58, 1, 7))
hpnicfDHCPRCycleStatus = MibScalar((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 58, 1, 7, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("on", 1), ("off", 2))).clone('off')).setMaxAccess("readwrite")
if mibBuilder.loadTexts: hpnicfDHCPRCycleStatus.setStatus('current')
if mibBuilder.loadTexts: hpnicfDHCPRCycleStatus.setDescription('If the value is on, the cycle function would be enabled. ')
hpnicfDHCPRConfigOption82Group = MibIdentifier((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 58, 1, 8))
hpnicfDHCPROption82Switch = MibScalar((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 58, 1, 8, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enabled", 1), ("disabled", 2))).clone('disabled')).setMaxAccess("readwrite")
if mibBuilder.loadTexts: hpnicfDHCPROption82Switch.setStatus('current')
if mibBuilder.loadTexts: hpnicfDHCPROption82Switch.setDescription('If the value is enabled, DHCP relay supporting option 82 function would be enabled. ')
hpnicfDHCPROption82HandleStrategy = MibScalar((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 58, 1, 8, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("drop", 1), ("keep", 2), ("replace", 3))).clone('replace')).setMaxAccess("readwrite")
if mibBuilder.loadTexts: hpnicfDHCPROption82HandleStrategy.setStatus('current')
if mibBuilder.loadTexts: hpnicfDHCPROption82HandleStrategy.setDescription("The strategies of DHCP relay handling option 82. 'drop' indicates DHCP relay discarding the request packet including option 82. 'keep' indicates DHCP relay accepting the request packet without any change of the option 82. 'replace' indicates DHCP relay accepting the request packet on condition that it generates a new option 82 to replace the original one. ")
hpnicfDHCPRConfigOption82IfTable = MibTable((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 58, 1, 8, 3), )
if mibBuilder.loadTexts: hpnicfDHCPRConfigOption82IfTable.setStatus('current')
if mibBuilder.loadTexts: hpnicfDHCPRConfigOption82IfTable.setDescription('A table containing the information of DHCP option 82. This table depends on hpnicfDHCPRIfToGroupTable. An entry of this table will be created when an entry of hpnicfDHCPRIfToGroupTable is created. ')
hpnicfDHCPRConfigOption82IfEntry = MibTableRow((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 58, 1, 8, 3, 1), ).setIndexNames((0, "IF-MIB", "ifIndex"))
if mibBuilder.loadTexts: hpnicfDHCPRConfigOption82IfEntry.setStatus('current')
if mibBuilder.loadTexts: hpnicfDHCPRConfigOption82IfEntry.setDescription('An entry containing the information of DHCP option 82. ')
hpnicfDHCPROption82IfSwitch = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 58, 1, 8, 3, 1, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enabled", 1), ("disabled", 2))).clone('disabled')).setMaxAccess("readwrite")
if mibBuilder.loadTexts: hpnicfDHCPROption82IfSwitch.setStatus('current')
if mibBuilder.loadTexts: hpnicfDHCPROption82IfSwitch.setDescription("If DHCP relay supports option 82 functions, the value is 'enabled'. If DHCP relay does not support option 82 functions, the value is 'disabled'. ")
hpnicfDHCPROption82IfStrategy = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 58, 1, 8, 3, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("drop", 1), ("keep", 2), ("replace", 3))).clone('replace')).setMaxAccess("readwrite")
if mibBuilder.loadTexts: hpnicfDHCPROption82IfStrategy.setStatus('current')
if mibBuilder.loadTexts: hpnicfDHCPROption82IfStrategy.setDescription("The strategies of DHCP relay handling option 82. 'drop' indicates DHCP relay discarding the request packet including option 82. 'keep' indicates DHCP relay accepting the request packet without any change of the option 82. 'replace' indicates DHCP relay accepting the request packet on condition that it generates a new option 82 to replace the original one. ")
hpnicfDHCPROption82IfFormat = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 58, 1, 8, 3, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("normal", 1), ("verbose", 2))).clone('normal')).setMaxAccess("readwrite")
if mibBuilder.loadTexts: hpnicfDHCPROption82IfFormat.setStatus('current')
if mibBuilder.loadTexts: hpnicfDHCPROption82IfFormat.setDescription("The format of DHCP relay option 82. 'normal' is the standard format. 'verbose' is the detailed format. ")
hpnicfDHCPROption82IfNodeType = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 58, 1, 8, 3, 1, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4))).clone(namedValues=NamedValues(("invalid", 1), ("mac", 2), ("sysname", 3), ("userdefine", 4))).clone('invalid')).setMaxAccess("readwrite")
if mibBuilder.loadTexts: hpnicfDHCPROption82IfNodeType.setStatus('current')
if mibBuilder.loadTexts: hpnicfDHCPROption82IfNodeType.setDescription("Property of DHCP relay option 82 verbose format. The value can be set by user only when the value of hpnicfDHCPROption82IfFormat is set with 'verbose'. If the value of hpnicfDHCPROption82IfFormat is 'normal', the value is automatically set with 'invalid'. the value can not be set with 'invalid' by user. 'mac' indicates the option 82 verbose format is filled in with the mac of DHCP relay input interface. If the value of hpnicfDHCPROption82IfFormat is set with 'verbose', the value is automatically set with 'mac'. 'sysname' indicates the option 82 verbose format is filled in with the name of the DHCP relay. 'userdefine' indicates the option 82 verbose format is filled in with the string defined by user. If the value is set with 'userdefine', the value of hpnicfDHCPROption82IfUsrDefString must be set simultaneously. ")
hpnicfDHCPROption82IfUsrDefString = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 58, 1, 8, 3, 1, 5), OctetString().subtype(subtypeSpec=ValueSizeConstraint(0, 256))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: hpnicfDHCPROption82IfUsrDefString.setStatus('current')
if mibBuilder.loadTexts: hpnicfDHCPROption82IfUsrDefString.setDescription("The string defined by user to fill in the option 82 verbose format. If the value of hpnicfDHCPROption82IfFormat is 'normal', or the value of hpnicfDHCPROption82IfNodeType is 'mac' or 'sysname', it is set with a null string automatically and can not be modified by user. It must be set with a non-zero length string when the value of hpnicfDHCPROption82IfNodeType is set with 'userdefine'. ")
mibBuilder.exportSymbols("HPN-ICF-DHCPRELAY-MIB", hpnicfDHCPRSecurityClientRowStatus=hpnicfDHCPRSecurityClientRowStatus, hpnicfDHCPRRequestPktNum=hpnicfDHCPRRequestPktNum, hpnicfDHCPRInformPktNum=hpnicfDHCPRInformPktNum, hpnicfDHCPRIpToGroupServerIpType=hpnicfDHCPRIpToGroupServerIpType, hpnicfDHCPRSecurityEntry=hpnicfDHCPRSecurityEntry, hpnicfDHCPRDiscoverPktNum=hpnicfDHCPRDiscoverPktNum, hpnicfDHCPRReleasePktNum=hpnicfDHCPRReleasePktNum, hpnicfDHCPROption82IfNodeType=hpnicfDHCPROption82IfNodeType, hpnicfDHCPROption82IfUsrDefString=hpnicfDHCPROption82IfUsrDefString, hpnicfDHCPRIfSelectRelayMode=hpnicfDHCPRIfSelectRelayMode, hpnicfDHCPRMibObject=hpnicfDHCPRMibObject, hpnicfDHCPRConfigOption82IfTable=hpnicfDHCPRConfigOption82IfTable, hpnicfDhcpRelay=hpnicfDhcpRelay, hpnicfDHCPRSecurityClientIpAddrType=hpnicfDHCPRSecurityClientIpAddrType, hpnicfDHCPRAddrCheckTable=hpnicfDHCPRAddrCheckTable, hpnicfDHCPRRxClientPktNum=hpnicfDHCPRRxClientPktNum, hpnicfDHCPRAckPktNum=hpnicfDHCPRAckPktNum, hpnicfDHCPRTxServerPktNum=hpnicfDHCPRTxServerPktNum, hpnicfDHCPRDeclinePktNum=hpnicfDHCPRDeclinePktNum, hpnicfDHCPRConfigOption82IfEntry=hpnicfDHCPRConfigOption82IfEntry, hpnicfDHCPROption82IfSwitch=hpnicfDHCPROption82IfSwitch, hpnicfDHCPRIfToGroupRowStatus=hpnicfDHCPRIfToGroupRowStatus, hpnicfDHCPROption82IfFormat=hpnicfDHCPROption82IfFormat, hpnicfDHCPRIpToGroupTable=hpnicfDHCPRIpToGroupTable, hpnicfDHCPRSecurityClientProperty=hpnicfDHCPRSecurityClientProperty, hpnicfDHCPRSecurityClientIpAddr=hpnicfDHCPRSecurityClientIpAddr, hpnicfDHCPROption82Switch=hpnicfDHCPROption82Switch, hpnicfDHCPRIpToGroupServerIp=hpnicfDHCPRIpToGroupServerIp, hpnicfDHCPRIfSelectEntry=hpnicfDHCPRIfSelectEntry, hpnicfDHCPRIfSelectTable=hpnicfDHCPRIfSelectTable, hpnicfDHCPROption82HandleStrategy=hpnicfDHCPROption82HandleStrategy, hpnicfDHCPRIfToGroupTable=hpnicfDHCPRIfToGroupTable, hpnicfDHCPRCycleStatus=hpnicfDHCPRCycleStatus, hpnicfDHCPRStatisticsReset=hpnicfDHCPRStatisticsReset, hpnicfDHCPRStatisticsGroup=hpnicfDHCPRStatisticsGroup, hpnicfDHCPRCycleGroup=hpnicfDHCPRCycleGroup, hpnicfDHCPROfferPktNum=hpnicfDHCPROfferPktNum, hpnicfDHCPRIpToGroupGroupId=hpnicfDHCPRIpToGroupGroupId, hpnicfDHCPRConfigOption82Group=hpnicfDHCPRConfigOption82Group, hpnicfDHCPRIpToGroupRowStatus=hpnicfDHCPRIpToGroupRowStatus, hpnicfDHCPROption82IfStrategy=hpnicfDHCPROption82IfStrategy, hpnicfDHCPRAddrCheckSwitch=hpnicfDHCPRAddrCheckSwitch, hpnicfDHCPRTxClientPktNum=hpnicfDHCPRTxClientPktNum, hpnicfDHCPRIfToGroupEntry=hpnicfDHCPRIfToGroupEntry, hpnicfDHCPRSecurityClientMacAddr=hpnicfDHCPRSecurityClientMacAddr, hpnicfDHCPRIpToGroupEntry=hpnicfDHCPRIpToGroupEntry, hpnicfDHCPRIfToGroupGroupId=hpnicfDHCPRIfToGroupGroupId, PYSNMP_MODULE_ID=hpnicfDhcpRelay, hpnicfDHCPRNakPktNum=hpnicfDHCPRNakPktNum, hpnicfDHCPRRxServerPktNum=hpnicfDHCPRRxServerPktNum, hpnicfDHCPRSecurityTable=hpnicfDHCPRSecurityTable, hpnicfDHCPRAddrCheckEntry=hpnicfDHCPRAddrCheckEntry)
|
# =============================================================================
# Author: Teerapat Jenrungrot - https://github.com/mjenrungrot/
# FileName: 10921.py
# Description: UVa Online Judge - 10921
# =============================================================================
source = list("-1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ")
target = list("-123456789022233344455566677778889999")
mapping = dict(zip(source, target))
while True:
try:
line = input()
except EOFError:
break
print("".join(list(map(lambda x: mapping[x], line))))
|
#!/usr/bin/python3
def words_count(filename):
with open(filename, 'r') as file:
strg = file.read()
number = len(strg.split())
return number
print(words_count("testscript.py"))
a = [1, 2, 3]
b = (4, 5, 8)
for i, j in zip(a,b):
print(i + j)
|
"""
Module that implements APL's dyadic operators.
"""
def jot(*, aalpha, oomega):
"""Define the dyadic jot ∘ operator.
Monadic case:
f∘g ⍵
f g ⍵
Dyadic case:
⍺ f∘g ⍵
⍺ f g ⍵
"""
def derived(*, alpha=None, omega):
return aalpha(alpha=alpha, omega=oomega(omega=omega))
return derived
def atop(*, aalpha, oomega):
"""Define the dyadic atop ⍤ operator.
Monadic case:
f⍤g ⍵
f g ⍵
Dyadic case:
⍺ f⍤g ⍵
f ⍺ g ⍵
"""
def derived(*, alpha=None, omega):
return aalpha(alpha=None, omega=oomega(alpha=alpha, omega=omega))
return derived
def over(*, aalpha, oomega):
"""Define the dyadic over ⍥ operator.
Monadic case:
f⍥g ⍵
f g ⍵
Dyadic case:
⍺ f⍥g ⍵
(g ⍺) f (g ⍵)
"""
def derived(*, alpha=None, omega):
if alpha is None:
return aalpha(alpha=alpha, omega=oomega(omega=omega))
else:
return aalpha(alpha=oomega(omega=alpha), omega=oomega(omega=omega))
return derived
|
def main():
n, k = map(int, input().split())
h = list(map(int, input().split()))
cost = [float('inf')] * n
cost[0] = 0
for i in range(1, n):
for j in range(1, k + 1):
if i - j < 0:
break
else:
cost[i] = min(cost[i], cost[i - j] + abs(h[i] - h[i - j]))
print(cost[n - 1])
if __name__ == "__main__":
main()
|
grammar = """
nonzeroDigit = digit:x ?(x != '0')
digits = <'0' | nonzeroDigit digit*>:i -> int(i)
netstring = digits:length ':' <anything{length}>:string ',' -> string
receiveNetstring = netstring:string -> receiver.netstringReceived(string)
"""
class NetstringSender(object):
def __init__(self, transport):
self.transport = transport
def sendNetstring(self, string):
self.transport.write('%d:%s,' % (len(string), string))
|
"""
type ctrl+space
this executes this file
type ctrl+.
you see the result in a pane
to see the result in a file
type ctrl+.
select line 20 (g 20 g v $)
type ctrl+enter
this executes your selection
you see the result in a pane
to see the result in a file
type ctrl+.
"""
print('hello world!')
"""
ctrl+space ctrl+. and ctrl+enter are your friends
use them to execute file in test_all.py marked with
import file_name
you can even execute
test_all.py
""" |
class SimApp(QWidget):
def __init__(self, env):
super().__init__()
self.env = env
self.initUI()
def initUI(self):
grid = QGridLayout()
self.setLayout(grid)
grid.addWidget(QLabel('pods_min:'), 0, 0)
grid.addWidget(QLabel('pods_max:'), 1, 0)
grid.addWidget(QLabel('timeout (sec):'), 2, 0)
grid.addWidget(QLabel('autoscale period (sec):'), 3, 0)
grid.addWidget(QLabel('simulation period (sec):'), 4, 0)
grid.addWidget(QLabel('readiness_probe (sec):'), 5, 0)
grid.addWidget(QLabel('scaling_tolerance:'), 6, 0)
btn_run_one = QPushButton('Run One Step', self)
grid.addWidget(btn_run_one, 7, 0)
setting = self.env.get_setting()
grid.addWidget(QLabel(str(setting["pods_min"])), 0, 1)
grid.addWidget(QLabel(str(setting["pods_max"])), 1, 1)
grid.addWidget(QLabel(str(setting["timeout"])), 2, 1)
grid.addWidget(QLabel(str(setting["autoscale_period"])), 3, 1)
grid.addWidget(QLabel(str(setting["simulation_period"])), 4, 1)
grid.addWidget(QLabel(str(setting["readiness_probe"])), 5, 1)
grid.addWidget(QLabel(str(setting["scaling_tolerance"])), 6, 1)
btn_run = QPushButton('Run', self)
grid.addWidget(btn_run, 7, 1)
self.setWindowTitle('Simulator')
self.show()
def run_one_step(self):
self.env.next_rl_state()
class MyApp(QWidget):
def __init__(self):
super().__init__()
self.loadHistroy()
self.initUI()
def loadHistroy(self):
self.traffic_history = []
f = open('./data/nasa-http-data-3.csv', 'r', encoding='utf-8')
rdr =csv.reader(f)
j = 0
for line in rdr:
if j == 0:
j = j+1
self.traffic_history.append(0)
continue
# for i in range(60):
self.traffic_history.append(int(line[0]))
def initUI(self):
grid = QGridLayout()
self.setLayout(grid)
grid.addWidget(QLabel('pods_min:'), 0, 0)
grid.addWidget(QLabel('pods_max:'), 1, 0)
grid.addWidget(QLabel('timeout (sec):'), 2, 0)
grid.addWidget(QLabel('autoscale period (sec):'), 3, 0)
grid.addWidget(QLabel('simulation period (sec):'), 4, 0)
grid.addWidget(QLabel('readiness_probe (sec):'), 5, 0)
grid.addWidget(QLabel('scaling_tolerance:'), 6, 0)
self.qe_pods_min = QLineEdit()
self.qe_pods_min.setText("1")
self.qe_pods_max = QLineEdit()
self.qe_pods_max.setText("6")
self.qe_timeout = QLineEdit()
self.qe_timeout.setText("0.3")
self.qe_autoscale_period = QLineEdit()
self.qe_autoscale_period.setText("15")
self.qe_simulation_period = QLineEdit()
self.qe_simulation_period.setText("0.1")
self.qe_readiness_probe = QLineEdit()
self.qe_readiness_probe.setText("3")
self.qe_scaling_tolerance = QLineEdit()
self.qe_scaling_tolerance.setText("0.1")
grid.addWidget(self.qe_pods_min, 0, 1)
grid.addWidget(self.qe_pods_max, 1, 1)
grid.addWidget(self.qe_timeout, 2, 1)
grid.addWidget(self.qe_autoscale_period, 3, 1)
grid.addWidget(self.qe_simulation_period, 4, 1)
grid.addWidget(self.qe_readiness_probe, 5, 1)
grid.addWidget(self.qe_scaling_tolerance, 6, 1)
btn_set = QPushButton('SetButton', self)
btn_set.clicked.connect(self.set_env)
grid.addWidget(btn_set, 7, 1)
self.setWindowTitle('Setting')
self.show()
def set_env(self):
self.env = Environment(
application_profile=application_profile,
traffic_history=self.traffic_history,
pods_min=int(self.qe_pods_min.text()),
pods_max=int(self.qe_pods_max.text()),
timeout=float(self.qe_timeout.text()),
autoscale_period=float(self.qe_autoscale_period.text()),
simulation_period=float(self.qe_simulation_period.text()),
readiness_probe=float(self.qe_readiness_probe.text()),
scaling_tolerance=float(self.qe_scaling_tolerance.text())
)
self.sim = SimApp(self.env)
self.sim.show()
self.hide()
# app = QApplication(sys.argv)
# ex = MyApp()
# sys.exit(app.exec_()) |
class ContentBasedFiltering:
def limit_number_of_recommendations(self,limit):
self.limit = limit
def __init__(self,db, regenerate = False):
self.db = db
self.table = 'content_based_recommendations'
if regenerate or not db.table_exists(self.table):
self.generate_similarity_matrix()
self.limit_number_of_recommendations(20)
self.store_top_n_similarities_to_database()
# fetch prediction from database
def predict(self, item_id):
prediction = self.db.get(self.table, where='id = ' + str(item_id))
prediction = prediction.drop(['index', 'id'], axis=1)
return prediction.values[0]
# regeneration of similarity matrix
def generate_similarity_matrix(self):
ml = Movielens(self.db)
self.item_similarities = core.pairwise_cosine(ml.load_complete_movie_info())
def predict_using_similarirty_matrix(self, item_id):
arguments_sorted = core.reverse_argsort(self.item_similarities[item_id])
# select everything except item_id; else same movie will be recommended
arguments_sorted = arguments_sorted[arguments_sorted!=item_id]
#limit to number of output
arguments_sorted = arguments_sorted[: self.limit+1]
return arguments_sorted
def store_top_n_similarities_to_database(self):
similar_movies = []
for i in range(0, self.item_similarities.shape[0]):
predicted = self.predict_using_similarirty_matrix(i)
similar_movies.append(predicted)
df = pd.DataFrame(similar_movies)
df['id']=df.index
self.db.save_entire_df(df, self.table)
#####
class CollaborativeFiltering:
def limit_number_of_recommendations(self,limit):
self.limit = limit
def reload_conditions(self):
return not self.db.table_exists(cf_table['user'],cf_table['item'],cf_table['user_recommendation'])
def __init__(self, db, clear_cache=False):
self.db = db
ml = Movielens(db)
self.user_similarities_table = 'collaborative_user_similarities'
self.user_recommendation_table = 'collaborative_user_recommendation';
if self.reload_conditions() or clear_cache:
PrepareCollaborativeFiltering(db)
def predict_for_item(self, item_id):
prediction = self.db.get(cf_table['item'], where = 'id = '+str(item_id))
prediction = prediction.drop(['index', 'id'], axis=1)
return prediction.values[0]
def generate_prediction(self, user_id):
top_10_similar_users = self.db.get(cf_table['user'], where = 'id = '+ str(user_id))
top_10_similar_users = top_10_similar_users.drop(['index', 'id'], axis=1)
similarities = dict(zip(top_10_similar_users['similar_user'].tolist(), top_10_similar_users['similarity'].tolist()))
# get ratings
similar_users_ratings = self.db.get('ratings', where = 'userId in ('+','.join(map(str,similarities))+')')
similar_users_ratings = similar_users_ratings.drop(['index', 'timestamp'], axis=1)
user_ratings = self.db.get('ratings', where = 'userId = '+str(user_id))
# remove things which are already rated by the user
similar_users_ratings = similar_users_ratings[~similar_users_ratings['movieId'].isin(user_ratings['movieId'])]
movies = similar_users_ratings['movieId'].unique().tolist()
movie_weightage = []
for i in movies:
user_who_have_rated = similar_users_ratings[similar_users_ratings['movieId']==i]
user_who_have_rated['weightage'] = user_who_have_rated['rating'] * user_who_have_rated['userId'].map(similarities)
movie_weightage.append([i, user_who_have_rated['weightage'].sum()])
df = pd.DataFrame(movie_weightage, columns=['id','weightage'])
df = df.sort_values('weightage', ascending=False)
return df.head(10)['id'].tolist()
def predict_for_user(self, user_id):
recommendation = self.db.get(cf_table['user_recommendation'], where = 'id = '+str(user_id))
recommendation = recommendation.drop(['index','id'], axis =1)
return recommendation.values[0]
# return self.generate_prediction(user_id)
###
class PrepareCollaborativeFiltering:
def __init__(self,db):
self.db = db
self.ratings = Movielens(db).load_ratings()
self.limit = 20
self.generate_user_similarity_matrix()
self.generate_item_similarity_matrix()
self.save_complete_item_similarities_to_database()
self.save_complete_similar_users_to_database()
self.save_recommendation_for_user()
# Item Similarity
def generate_item_similarity_matrix(self):
data = self.ratings.transpose()
data[data > 0] = 1
self.item_similarities = core.pairwise_cosine(data)
def save_complete_item_similarities_to_database(self):
similar_movies = []
for i in range(0, self.ratings.shape[1]):
predicted = self.predict_by_item_similarirty(i)
similar_movies.append(predicted)
df = pd.DataFrame(similar_movies)
df['id']=df.index
self.db.save_entire_df(df, cf_table['item'])
def predict_by_item_similarirty(self, item_id):
arguments_sorted = core.reverse_argsort(self.item_similarities[item_id])
arguments_sorted = arguments_sorted[arguments_sorted != item_id][:self.limit]
return arguments_sorted
# User Similarity
def generate_user_similarity_matrix(self):
self.user_similarities = core.pairwise_cosine(self.ratings)
def top_n_similar_users(self,user_id):
return np.argsort(self.user_similarities[user_id])[::-1][1:11]
def user_similarity_for_index(self,row, column):
return self.user_similarities[row, column]
def save_complete_similar_users_to_database(self):
values = []
for i in range(0, self.ratings.shape[0]):
predicted = self.top_n_similar_users(i)
similarity = self.user_similarity_for_index(i,predicted)
user_id = np.array([i for j in range(predicted.shape[0])])
data = pd.DataFrame([user_id,predicted,similarity])
data = data.transpose()
values.append(data)
df = pd.concat(values)
renaming = {0: 'id', 1: 'similar_user', 2: 'similarity'}
df = df.rename(columns = renaming)
df['id'] = df['id'].astype(int)
df['similar_user'] = df['similar_user'].astype(int)
#print(df)
self.db.save_entire_df(df, cf_table['user'])
def predict_by_user_similarity(self, user_id):
top_10_similar_users = np.argsort(self.user_similarities[user_id])[::-1][1:11]
value = []
for i in range(self.ratings.shape[0]):
if self.ratings[user_id,i] != 0:
value.append(0)
continue
weightage_of_item = 0
for k in top_10_similar_users:
weightage_of_item+=self.ratings[k,i]*self.user_similarities[user_id,k]
value.append(weightage_of_item)
return np.argsort(value)[:self.limit]
def save_recommendation_for_user(self):
recommendation = []
print(self.user_similarities.shape[0])
for i in range(self.user_similarities.shape[0]):
print(i)
prediction = self.predict_by_user_similarity(i)
recommendation.append(prediction)
df = pd.DataFrame(recommendation)
df['id'] = df.index
print(df)
self.db.save_entire_df(df, table_name=cf_table['user_recommendation'])
###
class Normalised_ContentBasedFiltering:
def limit_number_of_recommendations(self,limit):
self.limit = limit
def __init__(self,db, regenerate = False):
self.db = db
self.table = 'normalised_content_based_recommendations'
self.ml = Movielens(self.db)
self.normalise()
exit()
if regenerate or not db.table_exists(self.table):
self.generate_similarity_matrix()
self.limit_number_of_recommendations(20)
self.store_top_n_similarities_to_database()
def normalise(self):
a = core.normalise_dataframe(self.ml.load_complete_movie_info())
print(a)
# fetch prediction from database
def predict(self, item_id):
prediction = self.db.get(self.table, where='id = ' + str(item_id))
prediction = prediction.drop(['index', 'id'], axis=1)
return prediction.values[0]
# regeneration of similarity matrix
def generate_similarity_matrix(self):
ml = Movielens(self.db)
self.item_similarities = core.pairwise_cosine(ml.load_complete_movie_info())
def predict_using_similarirty_matrix(self, item_id):
arguments_sorted = core.reverse_argsort(self.item_similarities[item_id])
# select everything except item_id; else same movie will be recommended
arguments_sorted = arguments_sorted[arguments_sorted!=item_id]
#limit to number of output
arguments_sorted = arguments_sorted[: self.limit+1]
return arguments_sorted
def store_top_n_similarities_to_database(self):
similar_movies = []
for i in range(0, self.item_similarities.shape[0]):
predicted = self.predict_using_similarirty_matrix(i)
similar_movies.append(predicted)
df = pd.DataFrame(similar_movies)
df['id']=df.index
self.db.save_entire_df(df, self.table)
|
APP_VERSION = '1.4.5.112'
PEER_ID = 'A6B186B2630BDAE0641F78858136A65D'
ACT = 'tab_show'
OS_VERSION = 'Windows 10'
TAB_ID = 'all'
ACCOUNT_TYPE = '4'
PHONE_AREA = '86'
PRODUCT_ID = '0'
PROTOCOL_VERSION = '1'
# 系统初始化调用
URL_INIT = 'http://xyajs.data.p2cdn.com/o_onecloud_pc_cycle'
URL_ACCOUNT_BASE = 'http://account.onethingpcs.com'
URL_LOGIN = '%s/user/login?appversion=%s' % (URL_ACCOUNT_BASE, APP_VERSION)
URL_CHECK_SESSION = '%s/user/check-session?appversion=%s' % (URL_ACCOUNT_BASE, APP_VERSION)
URL_CONTROL_BASE = 'https://control.onethingpcs.com'
URL_LIST_PEER = '%s/listPeer?' % URL_CONTROL_BASE
URL_GET_TURN_SERVER = '%s/getturnserver?' % URL_CONTROL_BASE
URL_CONTROL_REMOTE_BASE = 'https://control-remotedl.onethingpcs.com'
URL_CONTROL_REMOTE_LIST = '%s/list?' % URL_CONTROL_REMOTE_BASE
URL_CONTROL_REMOTE_DEL = '%s/del?' % URL_CONTROL_REMOTE_BASE
URL_CONTROL_REMOTE_URL_RESOLVE = '%s/urlResolve?' % URL_CONTROL_REMOTE_BASE
URL_CONTROL_REMOTE_CREATE_BATCH_TASK = '%s/createBatchTask?' % URL_CONTROL_REMOTE_BASE
URL_CONTROL_REMOTE_PAUSE = '%s/pause?' % URL_CONTROL_REMOTE_BASE
URL_CONTROL_REMOTE_START = '%s/start?' % URL_CONTROL_REMOTE_BASE
|
liste = [1, 2 , 5, 3, 6, 4]
print (sorted(liste)) # listenin aslı ile oynamadan sıralı sekilde yazdırır
print ("\n")
print (liste) # burada listenin aslını görecegiz
print("\n")
liste.sort() # listenin aslını degistirerek siralama yapar
print (liste)
print ("\n")
liste.reverse() # sıralanmıs listeyi ters cevirir
print (liste)
|
#This code has conflicting attributes,
#but the documentation in the standard library tells you do it this way :(
#See https://discuss.lgtm.com/t/warning-on-normal-use-of-python-socketserver-mixins/677
class ThreadingMixIn(object):
def process_request(selfself, req):
pass
class HTTPServer(object):
def process_request(selfself, req):
pass
class _ThreadingSimpleServer(ThreadingMixIn, HTTPServer):
pass
|
"""
1. Clarification
2. Possible solutions
- Backtracking + Bit manipulation
- Iterative + Bit manipulation
3. Coding
4. Tests
"""
# T=O(len(all letters in arr) + 2^n), S=O(n)
class Solution:
def maxLength(self, arr: List[str]) -> int:
masks = list()
for s in arr:
mask = 0
for ch in s:
idx = ord(ch) - ord("a")
if (mask >> idx) & 1:
mask = 0
break
mask |= 1 << idx
if mask > 0:
masks.append(mask)
ans = 0
def backtrack(pos: int, mask: int) -> None:
if pos == len(masks):
nonlocal ans
ans = max(ans, bin(mask).count('1'))
return
if (mask & masks[pos]) == 0:
backtrack(pos + 1, mask | masks[pos])
backtrack(pos + 1, mask)
backtrack(0, 0)
return ans
# T=O(len(all letters in arr) + 2^n), S=O(2^n)
class Solution:
def maxLength(self, arr: List[str]) -> int:
ans = 0
masks = [0]
for s in arr:
mask = 0
for ch in s:
idx = ord(ch) - ord("a")
if (mask >> idx) & 1:
mask = 0
break
mask |= 1 << idx
if mask == 0:
continue
n = len(masks)
for i in range(n):
m = masks[i]
if (m & mask) == 0:
masks.append(m | mask)
ans = max(ans, bin(m | mask).count("1"))
return ans
|
gamestr = "Baldur's Gate EE 2.6.6.0"
headers = ["Area", "NPC", "XP", "Gold Carried", "Pickpocket Skill", "Item Price (base)", "Item Type", "Item"]
areas = [
"act04 (Spawned)",
"act05 (Spawned)",
"act06 (Spawned)",
"actboun (Spawned)",
"actnesto (Spawned)",
"aldcut01 (Spawned)",
"aldcut02 (Spawned)",
"ar0004 - Behren's home, ground floor",
"ar0006 - Rinnie's home, ground floor",
"ar0010 - Jardak's home, ground floor (Drelik the butler)",
"ar0011 - Jardak's home, second floor",
"ar0102 - Silvershield Estate, second floor",
"ar0103 (Spawned) - Splurging Sturgeon, ground floor (Lusselyn)",
"ar0105 - Blade and Stars, ground floor (G'axir the Seer, Elkart)",
"ar0106 (Spawned) - Blade and Stars, second floor (Maple Willow Aspen)",
"ar0108 (Spawned) - Duchal Palace, ground floor",
"ar0112 (Spawned) - Undercellars (Slythe, Krystin)",
"ar0112 - Undercellars (Slythe, Krystin)",
"ar0114 (Spawned) - Blushing Mermaid, ground floor (Larze)",
"ar0114 - Blushing Mermaid, ground floor (Larze)",
"ar0115 (Spawned) - Blushing Mermaid, second floor",
"ar0116 - Helm & Cloak, ground floor (Gorpel Hind)",
"ar0119 - Three Old Kegs tavern, ground floor",
"ar0120 - Three Old Kegs tavern, second floor (Skull of Keraph)",
"ar0121 - Three Old Kegs tavern, third floor (Areana)",
"ar0123 - Undercity (Temple of Bhaal, old city ruins)",
"ar0125 - Temple of Bhaal (game finale)",
"ar0126 - Ragefast's home",
"ar0128 (Spawned) - Merchant League, second floor (Aldeth, Brandilar, Zorl)",
"ar0128 - Merchant League, second floor (Aldeth, Brandilar, Zorl)",
"ar0130 - Hall of Wonders (Alora)",
"ar0131 - Temple of Gond (Forthel August)",
"ar0132 - Lady's House (Agnasia, Chanthalas Ulbright)",
"ar0134 - Low Lantern, first underwater level (Desreta, Vay-ya)",
"ar0135 - Low Lantern, second underwater level (Yago)",
"ar0137 (Spawned) - Ramazith's Tower, ground floor",
"ar0143 - Oberan's Estate, ground floor",
"ar0145 - Oberan's Estate, third floor (Helshara, Ithmeera, Delorna)",
"ar0148 (Spawned) - Thieves Guild, front house (fourth from west)",
"ar0150 (Spawned) - Thieves Guild, front house (first from west)",
"ar0151 (Spawned) - Thieves Guild, front house (second from west)",
"ar0152 (Spawned) - Thieves Guild, front house (third from west)",
"ar0153 (Spawned) - Thieves Guild, main area (Alatos, Narlen Darkwalk)",
"ar0153 - Thieves Guild, main area (Alatos, Narlen Darkwalk)",
"ar0162 - Louise and Laerta's home",
"ar0167 - Phierkas's home, ground floor",
"ar0200 - N Baldur's Gate (Ramazith's Tower, Duchal Palace)",
"ar0224 - BG Sewers, western area (Schlumpsha the Sewer King)",
"ar0225 - BG Sewers, central area (Ratchild)",
"ar0226 - BG Sewers, eastern area (ogre mage for Scar)",
"ar0300 (Spawned) - NE Baldur's Gate (Blushing Mermaid, Splurging Sturgeon, Counting House)",
"ar0300 - NE Baldur's Gate (Blushing Mermaid, Splurging Sturgeon, Counting House)",
"ar0304 - Generic store",
"ar0307 (Spawned) - Counting House, ground floor (Jacil or Ulf)",
"ar0307 - Counting House, ground floor (Jacil or Ulf)",
"ar0308 (Spawned) - Counting House, second floor (Captain Kieres)",
"ar0500 (Spawned) - Durlag's Tower, exterior",
"ar0501 - Durlag's Tower, first subterranean level",
"ar0504 - Durlag's Tower, third floor (Rigglio)",
"ar0505 - Durlag's Tower, fourth floor (Kirinhale)",
"ar0514 - Durlag's Tower, fifth subterranean level",
"ar0516 - Durlag's Tower, demon knight chamber (Dalton)",
"ar0601 - Seven Suns, ground floor",
"ar0602 - Seven Suns, second floor",
"ar0608 (Spawned) - Flaming Fist HQ, second floor (Duke Eltan)",
"ar0612 (Spawned) - Iron Throne, second floor (Dra'tan)",
"ar0612 - Iron Throne, second floor (Dra'tan)",
"ar0613 - Iron Throne, third floor (Nortuary, Emissary Tar)",
"ar0615 (Spawned) - Iron Throne, fifth (top) floor (chapter five finale)",
"ar0615 - Iron Throne, fifth (top) floor (chapter five finale)",
"ar0616 (Spawned) - Iron Throne, ground floor (Triadore)",
"ar0617 (Spawned) - Tremain Belde'ar's home, ground floor",
"ar0700 (Spawned) - Central Baldur's Gate (marketplace, Oberan's home)",
"ar0703 - Sorcerous Sundries, ground floor (Halbazzer Drin)",
"ar0704 - Sorcerous Sundries, second floor",
"ar0705 (Spawned) - Elfsong Tavern, ground floor (Brevlik)",
"ar0705 - Elfsong Tavern, ground floor (Brevlik)",
"ar0706 - Elfsong Tavern, second floor (Alyth, Cyrdemac)",
"ar0715 - Nadine's home, ground floor",
"ar0800 (Spawned) - E Baldur's Gate (Sorcerous Sundries, Elfsong Tavern)",
"ar0800 - E Baldur's Gate (Sorcerous Sundries, Elfsong Tavern)",
"ar0803 - Maltz's Weapon Shop, ground floor",
"ar0805 - Arkion's home, ground floor",
"ar0809 (Spawned) - Silence's store",
"ar0810 - Luck Aello's store",
"ar0813 - Nemphre's home, ground floor",
"ar0900 (Spawned) - Wyrm's Crossing (bridge to BG, Tenya, Quayle)",
"ar0900 - Wyrm's Crossing (bridge to BG, Tenya, Quayle)",
"ar1000 (Spawned) - Ulgoth's Beard (Shandalar, Ike, Mendas)",
"ar1000 - Ulgoth's Beard (Shandalar, Ike, Mendas)",
"ar1001 - Ulgoth Beard's Inn (Hurgan Stoneblade)",
"ar1002 (Spawned) - Aec'Letec cult building, basement (Aec'Letec)",
"ar1003 (Spawned) - Aec'Letec cult building, ground floor",
"ar1005 - Therella's home",
"ar1009 - Ice island, dungeon",
"ar1010 - Ice island, unused exit area",
"ar1100 (Spawned) - SW Baldur's Gate (Flaming Fist HQ, Merchant League, Seven Suns)",
"ar1101 - Generic home, ground floor (thieves Wiven, Dirk, Meakin and Sath)",
"ar1111 - Sunin's home",
"ar1112 - Generic weapons store",
"ar1115 - Generic potions store",
"ar1116 - Generic weapons store",
"ar1117 - Generic potions store",
"ar1200 (Spawned) - S Baldur's Gate (docks, Iron Throne, Low Lantern, Umberlee temple)",
"ar1200 - S Baldur's Gate (docks, Iron Throne, Low Lantern, Umberlee temple)",
"ar1201 - Generic home, ground floor (ogre mages)",
"ar1208 - Warehouse (Noralee)",
"ar1209 - Generic home, ground floor (Larriaz the Sirine)",
"ar1213 - Cordyr's home, ground floor",
"ar1300 (Spawned) - SE Baldur's Gate (Blade and Stars)",
"ar1302 - Well-Adjusted Al's General Store",
"ar1303 - Warehouse (Nadarin)",
"ar1316 - Generic home, ground floor (thieves Taxek and Michael)",
"ar1320 - Generic store",
"ar1400 - Fishing village (Ajantis, farmer Brun, Gerde, lots of ankhegs)",
"ar1500 (Spawned) - Balduran's Isle, north (AKA Werewolf Isle)",
"ar1500 - Balduran's Isle, north (AKA Werewolf Isle)",
"ar1504 - Balduran's ship, fourth floor (Karoug)",
"ar1600 - Cloakwood, third main area (shadow druids, Eldoth, Faldorn)",
"ar1603 - Baby wyvern cave (Peter of the North)",
"ar1800 - Cloakwood mines, exterior",
"ar1802 - Cloakwood mines, third subterranean level (Natasha, ogre mage)",
"ar1803 - Cloakwood mines, fourth subterranean level (Davaeorn, Stephan)",
"ar1900 - Bandit Camp",
"ar1901 - Bandit Camp, main tent (Raemon, Venkt, Hakt, Britik)",
"ar1902 - Bandit Camp, tent (Ardenor Crush)",
"ar1903 - Bandit Camp, cave (Garclax)",
"ar1904 - Bandit Camp, tent (Tersus)",
"ar1905 - Bandit Camp, tent (Knott)",
"ar2000 (Spawned) - Balduran's Isle, south (AKA Werewolf Isle, Delainy/Durlyle)",
"ar2000 - Balduran's Isle, south (AKA Werewolf Isle, Delainy/Durlyle)",
"ar2200 - Cloakwood, first main area (Aldeth Sashenstar, Seniyad, Coran)",
"ar2300 - Friendly Arm Inn, exterior",
"ar2302 - Friendly Arm Inn, second floor (Unshey)",
"ar2303 - Friendly Arm Inn, third floor (Landrin, Golden Pantaloons)",
"ar2304 - Friendly Arm Inn, Temple of Wisdom (Gellana Mirrorshade)",
"ar2400 (Spawned) - Peldvale (Viconia, Raiken)",
"ar2400 - Peldvale (Viconia, Raiken)",
"ar2600 - Candlekeep (prologue), exterior",
"ar2602 - Candlekeep (prologue), Priest's Quarters (Shank)",
"ar2605 - Candlekeep (prologue), infirmary",
"ar2607 - Candlekeep (prologue), bunkhouse (Carbos)",
"ar2609 - Candlekeep Citadel, second floor (Koveras)",
"ar2610 - Candlekeep Citadel, third floor (Rieltar, Brunos Costak, Tuth and Kestor)",
"ar2614 - Candlekeep Citadel, sixth floor (Ulraunt, Tethtoril)",
"ar2615 - Candlekeep Catacombs, first level",
"ar2616 - Candlekeep (prologue), Inn ground floor",
"ar2618 - Candlekeep (prologue), barracks",
"ar2619 - Candlekeep Catacombs, second level",
"ar2626 - Candlekeep (chapter 6), exterior",
"ar2629 - Candlekeep (chapter 6), Inn ground floor",
"ar2631 - Candlekeep (chapter 6), barracks",
"ar2639 - Unused",
"ar2800 (Spawned) - Coast Way (S of Friendly Arm Inn, destroyed caravan)",
"ar2800 - Coast Way (S of Friendly Arm Inn, destroyed caravan)",
"ar2900 (Spawned) - Larswood (Teven, Osmadi, Corsone)",
"ar3000 - Spider Wood (E of Larswood, Thayvian Red Wizards)",
"ar3100 - Shipwreck's Coast (S of Candlekeep, Shoal, Droth, Mad Arcand, Surgeon)",
"ar3200 - High Hedge, exterior (Kivan)",
"ar3202 - High Hedge, interior (Thalantyr)",
"ar3300 (Spawned) - Beregost (Garrick, Jovial Juggler, Feldepost's Inn, Burning Wizard, Red Sheaf))",
"ar3300 - Beregost (Garrick, Jovial Juggler, Feldepost's Inn, Burning Wizard, Red Sheaf))",
"ar3304 - Jovial Juggler, ground floor (Bjornin, Gurke)",
"ar3313 - Mirianne's home, ground floor",
"ar3320 - Travenhurst Manor, ground floor",
"ar3327 - Generic home, ground floor",
"ar3333 - Firebeard Elvenhair's home, ground floor",
"ar3351 - Feldepost's Inn, ground floor (Marl)",
"ar3352 (Spawned) - Feldepost's Inn, second floor (Algernon)",
"ar3352 - Feldepost's Inn, second floor (Algernon)",
"ar3357 - Red Sheaf, ground floor (Perdue)",
"ar3400 - Beregost Temple, exterior (Cattack)",
"ar3402 - Beregost Temple, interior (AKA Song of the Morning, Keldath Ormlyr)",
"ar3500 - Mutamin's Garden (Shar-Teel, Mutamin, Korax, basilisks, Tamah)",
"ar3600 - Lighthouse (Safana, Ardrouine, Sil)",
"ar3700 - Red Canyons (Bassilus, Melicamp)",
"ar3800 - South Beregost Road",
"ar3900 - Ulcaster School, exterior (Ulcaster, Icharyd)",
"ar4000 - Gullykin, exterior",
"ar4003 - Temple of Yondalla, ground floor",
"ar4007 - Generic home, ground floor",
"ar4011 - Generic home, ground floor",
"ar4100 - Archaeological Site, exterior (Brage, Charleston Nib, Doomsayer)",
"ar4200 - Fisherman's Lake (Drizzt. Bjornin's half-ogres)",
"ar4400 - Lonely Peaks (Hulrik and Arabelle, Sarhedra, Arghain)",
"ar4500 - Firewine Bridge (Kahrk, Carsa, Poe, Bentan, Melium)",
"ar4600 - Bear River (N of Gnoll Stronghold, Larel, Nevill, Jared)",
"ar4700 - Xvart Village (Nexlit, Ursa, Borda)",
"ar4800 (Spawned) - Nashkel (Minsc, Edwin, Berrun Ghastkill, Belching Dragon, Temple of Helm)",
"ar4800 - Nashkel (Minsc, Edwin, Berrun Ghastkill, Belching Dragon, Temple of Helm)",
"ar4801 - Nashkel Inn",
"ar4803 - Nashkel Store",
"ar4809 - Belching Dragon Tavern (Volo)",
"ar4810 - Nashkel barracks",
"ar4900 - Nashkel Carnival (Branwen, Great Gazib)",
"ar4901 - Small carnival tent (armor merchant)",
"ar4903 - Large carnival tent (Vitiare)",
"ar4905 - Small carnival tent (rare potions merchant)",
"ar4906 - Small carnival tent (Zordral and Bentha)",
"ar4908 - Small carnival tent (melee weapons merchant)",
"ar4909 - Small carnival tent (ranged weapons merchant)",
"ar5000 - Valley of the Tombs (Nashkel mines exit, Narcillicus, Hentold)",
"ar5100 - Gnoll Stronghold (Dynaheir)",
"ar5200 - Dryad Falls (Cloudpeak Dryad, Drienne, Ingot, Krumm, Caldo)",
"ar5201 - Firewine Ruins (Lendarn, ogre mage, undead knights)",
"ar5300 - Fire Leaf Forest (S of Nashkel, Albert, Rufie, Vax, Sendai)",
"ar5400 - Nashkel Mines, exterior (Prism)",
"ar5401 - Nashkel Mines, first subterranean level (Dink)",
"ar5402 - Nashkel Mines, second subterranean level (Kylee, Beldin)",
"ar5405 - Nashkel Mines, Mulahey's lair (Xan, Mulahey)",
"ar5500 (Spawned) - Gibberling Mountains (Samuel, Hafiz)",
"ar5500 - Gibberling Mountains (Samuel, Hafiz)",
"ar5506 - Candlekeep Caves (Diarmid, Prat, Sakul, Tam, Bor)",
"ar5600 (Spawned) - Random encounter area",
"ar5601 (Spawned) - Random encounter area",
"ar5700 (Spawned) - Random encounter area",
"ar5701 (Spawned) - Random encounter area",
"ar5710 - Unused",
"ar5800 (Spawned) - Random encounter area",
"ar5801 (Spawned) - Random encounter area",
"ar5900 (Spawned) - Random encounter area",
"ar5901 (Spawned) - Random encounter area",
"ar6000 (Spawned) - Random encounter area",
"ar6001 (Spawned) - Random encounter area",
"ar6100 (Spawned) - Random encounter area",
"bancut01 (Spawned)",
"bancut02 (Spawned)",
"bd0010 (Spawned) - Ducal Palace City Exterior",
"bd0010 - Ducal Palace City Exterior",
"bd0020 (Spawned) - Sorcerous/Elf Song City Exterior",
"bd0020 - Sorcerous/Elf Song City Exterior",
"bd0021",
"bd0030 - Flaming Fist City Exterior",
"bd0035",
"bd0040 (Spawned) - Three Kegs City Exterior",
"bd0040 - Three Kegs City Exterior",
"bd0050 (Spawned) - Iron Throne City Exterior",
"bd0050 - Iron Throne City Exterior",
"bd0064 - Random Area - Forest Paths",
"bd0100 (Spawned) - Ducal Palace, Second Floor",
"bd0100 - Ducal Palace, Second Floor",
"bd0101 (Spawned) - Ducal Palace, Leaving BG",
"bd0101 - Ducal Palace, Leaving BG",
"bd0102 (Spawned) - Ducal Palace, First Floor",
"bd0102 - Ducal Palace, First Floor",
"bd0103 (Spawned) - Ducal Palace, Third Floor",
"bd0103 - Ducal Palace, Third Floor",
"bd0104 (Spawned) - Flaming Fist HQ",
"bd0104 - Flaming Fist HQ",
"bd0106 - Three Old Kegs, First Floor",
"bd0107 - Three Old Kegs, Second Floor",
"bd0108 (Spawned) - Three Old Kegs, Third Floor",
"bd0108 - Three Old Kegs, Third Floor",
"bd0109 - Elfsong Tavern, First Floor",
"bd0110 (Spawned) - Elfsong Tavern, Second Floor",
"bd0110 - Elfsong Tavern, Second Floor",
"bd0111 (Spawned) - Iron Throne Floor, First Floor",
"bd0111 - Iron Throne Floor, First Floor",
"bd0112 - Baldur's Gate East",
"bd0116 (Spawned) - Ducal Palace, Basement",
"bd0120 (Spawned) - Tomb Safehouse, First Floor",
"bd0120 - Tomb Safehouse, First Floor",
"bd0122 (Spawned) - Sorcerous Sundries, Second Floor",
"bd0130 - Tomb Safehouse, Second Floor",
"bd1000 (Spawned) - Coast Way Crossing",
"bd1000 - Coast Way Crossing",
"bd1100 - The Dig",
"bd1200 - Lich Outpost",
"bd2000 (Spawned) - Boareskyr Bridge & Bridgefort",
"bd2000 - Boareskyr Bridge & Bridgefort",
"bd2100 (Spawned) - Bridgefort Interior",
"bd2100 - Bridgefort Interior",
"bd3000 (Spawned) - Allied Siege Camp",
"bd3000 - Allied Siege Camp",
"bd4000 (Spawned) - Dragonspear Castle, Exterior",
"bd4000 - Dragonspear Castle, Exterior",
"bd4100 (Spawned) - Dragonspear Castle Keep, First Floor",
"bd4100 - Dragonspear Castle Keep, First Floor",
"bd4300 (Spawned) - Dragonspear Castle Basement",
"bd4300 - Dragonspear Castle Basement",
"bd4400 - Avernus",
"bd4700 - Avernus Roof",
"bd5000 (Spawned) - Underground River Entrance",
"bd5000 - Underground River Entrance",
"bd5100 (Spawned) - Underground River",
"bd5100 - Underground River",
"bd5200 - The Warrens",
"bd5300 - Kanaglym",
"bd6000 (Spawned) - Abandoned Sewers & Caverns",
"bd6100 (Spawned) - The Ambush",
"bd6200 (Spawned) - Sewers Exit",
"bd7000 (Spawned) - Coast Way Forest",
"bd7000 - Coast Way Forest",
"bd7100 (Spawned) - Troll Forest",
"bd7100 - Troll Forest",
"bd7200 - Forest of Wyrms",
"bd7220 (Spawned) - Bugbear Stronghold",
"bd7230 - Temple of Cyric",
"bd7300 - Dead Man's Pass",
"bd7400 - Bloodbark Grove",
"bdboarb2 (Spawned)",
"bdbranch (Spawned)",
"bdbteam1 (Spawned)",
"bdbteam2 (Spawned)",
"bdbteam3 (Spawned)",
"bdbteam4 (Spawned)",
"bdbteam5 (Spawned)",
"bdbteam6 (Spawned)",
"bdc123a (Spawned)",
"bdc205aa (Spawned)",
"bdc205ab (Spawned)",
"bdc205ac (Spawned)",
"bdc205ba (Spawned)",
"bdc205bb (Spawned)",
"bdc205bc (Spawned)",
"bdc205ca (Spawned)",
"bdc205cb (Spawned)",
"bdc205da (Spawned)",
"bdc205db (Spawned)",
"bdc205r (Spawned)",
"bdcut09 (Spawned)",
"bdcut09a (Spawned)",
"bdcut09b (Spawned)",
"bdcut11 (Spawned)",
"bdcut11a (Spawned)",
"bdcut15 (Spawned)",
"bdcut16 (Spawned)",
"bdcut20a (Spawned)",
"bdcut21 (Spawned)",
"bdcut26 (Spawned)",
"bdcut27 (Spawned)",
"bdcut28 (Spawned)",
"bdcut30a (Spawned)",
"bdcut322 (Spawned)",
"bdcut36 (Spawned)",
"bdcut40a (Spawned)",
"bdcut40b (Spawned)",
"bdcut40c (Spawned)",
"bdcut40d (Spawned)",
"bdcut41 (Spawned)",
"bdcut42 (Spawned)",
"bdcut43 (Spawned)",
"bdcut45 (Spawned)",
"bdcut45a (Spawned)",
"bdcut58 (Spawned)",
"bdcut59b (Spawned)",
"bdcut60a (Spawned)",
"bdcut60b (Spawned)",
"bdcut60x (Spawned)",
"bdcut61t (Spawned)",
"bdcut62 (Spawned)",
"bdcut64 (Spawned)",
"bdddd2a (Spawned)",
"bdddd2b (Spawned)",
"bdddd3a (Spawned)",
"bddebug (Spawned)",
"bddmspwn (Spawned)",
"bddoor30 (Spawned)",
"bddsgat1 (Spawned)",
"bdexduel (Spawned)",
"bdintro (Spawned)",
"bdnorest (Spawned)",
"bdscry01 (Spawned)",
"bdscry03 (Spawned)",
"bdscry05 (Spawned)",
"bdsdd251 (Spawned)",
"bdsddski (Spawned)",
"bdshcut0 (Spawned)",
"bdwaterf (Spawned)",
"bphub (Spawned)",
"ch1cut01 (Spawned)",
"cutba01 (Spawned)",
"cutmove1 (Spawned)",
"cutne0a (Spawned)",
"cutskip (Spawned)",
"cutskip1 (Spawned)",
"digcut01 (Spawned)",
"explore (Spawned)",
"merch2 (Spawned)",
"merch4 (Spawned)",
"merch5 (Spawned)",
"merch6 (Spawned)",
"mercha (Spawned)",
"mysmer (Spawned)",
"narcut (Spawned)",
"oh1000 (Spawned) - Dorn - Random Encounter Area",
"oh2000 - Neera - Adoy's Enclave, exterior",
"oh2010 (Spawned) - Neera - Adoy's Enclave, interior",
"oh2010 - Neera - Adoy's Enclave, interior",
"oh3000 - Rasaad - Dark Moon temple, exterior",
"oh3010 - Rasaad - Dark Moon temple, interior",
"oh3100 - Rasaad - Dark Moon temple, interior",
"oh9310 (Spawned) - The Black Pits: Arena 1",
"rasaad (Spawned)",
"scarcut (Spawned)",
"shopkn (Spawned)",
"tbullrsh (Spawned)",
"titach (Spawned)",
"tmeiala (Spawned)",
"unknown",
]
types = {
"Amulet": [
"Amulet of Spell Warding",
"Arkion's Bloodstone Amulet",
"Bloodstone Amulet",
"Gold Necklace",
"Greenstone Amulet",
"Laeral's Tear Necklace",
"Necklace of Form Stability",
"Pearl Necklace",
"Rainbow Obsidian Necklace",
"Shield Amulet",
"Silver Necklace",
"The Amplifier",
"The One Gift Lost",
"The Protector +1",
"bdamul09.itm (TLK missing name)",
"bdamul11.itm (TLK missing name)",
"bdamul24.itm (TLK missing name)",
"bdamul25.itm (TLK missing name)",
],
"Armor": [
"Ankheg Plate Mail",
"Chain Mail",
"Hide Armor",
"Leather Armor",
"Leather Armor +1",
"Plate Mail",
"Robe of the Evil Archmagi",
"Splint Mail",
"Studded Leather Armor",
"Traveler's Robe",
"bdleat08.itm (TLK missing name)",
],
"Arrows": [
"Acid Arrow +1",
"Arrow",
"Arrow +1",
"Arrow +2",
"Arrow of Biting",
"Arrow of Detonation",
"Arrow of Dispelling",
"Arrow of Fire +2",
"Arrow of Ice",
"Arrow of Piercing +1",
"bdarow03.itm (TLK missing name)",
],
"Axe": [
"Battle Axe",
"Battle Axe +1",
"Throwing Axe",
"ax1h11.itm (TLK missing name)",
],
"Belt & Girdle": [
"Adoy's Belt",
"Belt of Antipode",
"Destroyer of the Hills",
"Golden Girdle of Urnst",
"bdbelt01.itm (TLK missing name)",
"bdbelt03.itm (TLK missing name)",
"bdbelt12.itm (TLK missing name)",
"bdbelt13.itm (TLK missing name)",
"bdbelt14.itm (TLK missing name)",
],
"Bolts": [
"Bolt",
"Bolt +1",
"Bolt +2",
"Bolt of Biting",
"Bolt of Lightning",
"Case of Plenty +1",
],
"Books & misc": [
"Ancient Armor",
"Bassilus's Holy Symbol",
"Bowl of Water Elemental Control",
"Dradeel's Spellbook",
"Farthing's Dolly",
"Golden Pantaloons",
"History of Tethyr",
"History of the Dead Three",
"History of the Fateful Coin",
"History of the Last March of the Giants",
"History of the Nether Scrolls",
"Key to River Plug",
"Mulahey's Holy Symbol",
"Peladan",
"Sea Charts",
"Tome of Understanding",
"Yago's Book of Curses",
"bdbwoosh.itm (TLK missing name)",
"bdjar.itm (TLK missing name)",
"bdmisc04.itm (TLK missing name)",
"bdmisc08.itm (TLK missing name)",
"bdmisc19.itm (TLK missing name)",
"bdmisc25.itm (TLK missing name)",
"bdmisc51.itm (TLK missing name)",
"bdmisc52.itm (TLK missing name)",
"bdmisc58.itm (TLK missing name)",
"bdpetsg.itm (TLK missing name)",
"rndaro01.itm",
"rndgem01.itm",
"rndgem02.itm",
"rndgem03.itm",
"rndptn01.itm",
"rndtre01.itm",
"rndtre02.itm",
"rndtre03.itm",
"rndtre04.itm",
"rndtre05.itm",
"rndtre09.itm",
"rndtri02.itm",
"rndwand.itm",
],
"Books/Broken shields/bracelets": [
"The Diary of Sarevok",
],
"Boots": [
"Talos's Gift",
"The Frost's Embrace",
"The Paws of the Cheetah",
"Worn Whispers",
],
"Bow": [
"Composite Longbow",
"Composite Longbow +1",
"Longbow",
"Longbow +1",
"Shortbow",
"Shortbow +1",
"bdbow05.itm (TLK missing name)",
],
"Bracers & gauntlets": [
"Bracers",
"Bracers of Defense AC 7",
"Bracers of Defense AC 8",
"Bracers to the Death",
"Elander's Gloves of Misplacement",
"Glimmering Bands",
"Hands of Takkok",
"Legacy of the Masters",
"The Brawling Hands",
"The Dale's Protector",
"Xarrnous's Second Sword Arm",
"bdbrac01.itm (TLK missing name)",
"bdbrac03.itm (TLK missing name)",
"bdbrac09.itm (TLK missing name)",
"bdbrac10.itm (TLK missing name)",
"bdbrac13.itm (TLK missing name)",
"bdbrac14.itm (TLK missing name)",
],
"Bullets": [
"Bullet",
"Bullet +1",
"Bullet +2",
"Bullet of Electricity +1",
"Bullet of Fire +1",
"Bullet of Ice +1",
"Sunstone Bullet +1",
],
"Cloaks & Robes": [
"Algernon's Cloak",
"Cloak of Balduran",
"Cloak of Displacement",
"Cloak of Protection +1",
"Nymph Cloak",
"Relair's Mistake",
"Shandalar's Cloak",
"The Spirit's Shield +2",
"Whispers of Silence",
"bdclck06.itm (TLK missing name)",
],
"Containers/eye/broken armor": [
"Gem Bag",
"Scroll Case",
],
"Crossbow": [
"Heavy Crossbow",
"Heavy Crossbow +1",
"Light Crossbow",
"Light Crossbow +1",
],
"Dagger": [
"Dagger",
"Dagger +1",
"Heart of the Golem +2",
"Kylee's Dagger",
"Throwing Dagger",
"bddagg04.itm (TLK missing name)",
],
"Darts": [
"Asp's Nest +1",
"Dart",
"Dart +1",
"Dart of Acid +1",
"Dart of Fire +1",
"Dart of Ice +1",
"Dart of Stunning",
"Dart of Wounding",
],
"Drinks (IWD)": [
"De'Tranion's Baalor Ale",
"bdjuice.itm (TLK missing name)",
"bdmisc29.itm (TLK missing name)",
],
"Flail": [
"Flail",
"Flail +1",
"dwblun01.itm (TLK missing name)",
],
"Gem": [
"Andar Gem",
"Aquamarine Gem",
"Black Opal",
"Bloodstone Gem",
"Chrysoberyl Gem",
"Diamond",
"Dwarven Rune Wardstone",
"Emerald",
"Fire Agate Gem",
"Garnet Gem",
"Horn Coral Gem",
"Iol Gem",
"Jasper Gem",
"Lynx Eye Gem",
"Moonstone Gem",
"Pearl",
"Skydrop Gem",
"Sphene Gem",
"Star Diopside Gem",
"Sunstone Gem",
"Tchazar Gem",
"Turquoise Gem",
"Wardstone Forgery",
"Water Opal",
"Waterstar Gem",
"Ziose Gem",
],
"Halberd": [
"Halberd",
"Halberd +1",
"Suryris's Blade +2",
],
"Hammer": [
"The Kneecapper +1",
"War Hammer",
"War Hammer +1",
],
"Hat": [
"Dusty Rose Ioun Stone",
"bdhelm12.itm (TLK missing name)",
],
"Headgear": [
"Helmet",
"bdhelm05.itm (TLK missing name)",
"bdmisc05.itm (TLK missing name)",
],
"Key": [
"bdkey05.itm (TLK missing name)",
"bdkey07.itm (TLK missing name)",
"bdkey11.itm (TLK missing name)",
"bdkey12.itm (TLK missing name)",
"bdshkey.itm (TLK missing name)",
],
"Large sword": [
"Bastard Sword",
"Gold Digger +1",
"Harrower +1",
"Katana",
"Long Sword",
"Long Sword +1",
"Ninjatō",
"Scimitar",
"Scimitar +1",
"Two-handed Sword",
"Two-handed Sword +1",
"Two-handed Sword +2",
"Varscona +2",
"bdsw1h03.itm (TLK missing name)",
"bdsw1h08.itm (TLK missing name)",
],
"Mace & Club": [
"Club",
"Club +1",
"Mace",
"Mace +1",
"Mace +2",
"bdblun01.itm (TLK missing name)",
"bdblun02.itm (TLK missing name)",
],
"Morning star": [
"Morning Star",
"Morning Star +1",
],
"Potion": [
"Antidote",
"Elixir of Health",
"Marek's Potion of Antidote",
"Oil of Fiery Burning",
"Oil of Speed",
"Potion of Absorption",
"Potion of Agility",
"Potion of Clarity",
"Potion of Cloud Giant Strength",
"Potion of Cold Resistance",
"Potion of Defense",
"Potion of Explosions",
"Potion of Extra Healing",
"Potion of Fire Breath",
"Potion of Fire Giant Strength",
"Potion of Fire Resistance",
"Potion of Fortitude",
"Potion of Freedom",
"Potion of Frost Giant Strength",
"Potion of Genius",
"Potion of Healing",
"Potion of Heroism",
"Potion of Hill Giant Strength",
"Potion of Infravision",
"Potion of Insight",
"Potion of Insulation",
"Potion of Invisibility",
"Potion of Invulnerability",
"Potion of Magic Blocking",
"Potion of Magic Protection",
"Potion of Magic Shielding",
"Potion of Master Thievery",
"Potion of Mind Focusing",
"Potion of Mirrored Eyes",
"Potion of Perception",
"Potion of Power",
"Potion of Regeneration",
"Potion of Stone Form",
"Potion of Stone Giant Strength",
"Potion of Storm Giant Strength",
"Potion of Strength",
"Red Potion",
"Speedily Stolen Slaves' Salve",
"Violet Potion",
"bdmisc02.itm (TLK missing name)",
"bdpotn06.itm (TLK missing name)",
"potn60.itm (TLK missing name)",
],
"Quarterstaff": [
"Neera's Staff +1",
"Quarterstaff",
"Quarterstaff +1",
"Staff Mace +2",
"Staff Spear +2",
"The Ossifier",
],
"Ring": [
"Angel Skin Ring",
"Bloodstone Ring",
"Discipliner",
"Druid's Ring",
"Edventar's Gift",
"Evermemory",
"Fire Opal Ring",
"Flamedance Ring",
"Gold Ring",
"Honorary Ring of Sune",
"Jade Ring",
"Koveras's Ring of Protection +1",
"Nemphre's Onyx Ring",
"Onyx Ring",
"Ring of the Princes +1",
"Ruby Ring",
"Sashenstar's Ruby Ring",
"Silver Ring",
"The Guard's Ring +2",
"The Jester's Folly",
"The Victor",
"Topsider's Crutch",
"bdring04.itm (TLK missing name)",
"bdring06.itm (TLK missing name)",
"bdring08.itm (TLK missing name)",
"bdring09.itm (TLK missing name)",
"bdring10.itm (TLK missing name)",
"bdring12.itm (TLK missing name)",
"ring35.itm (TLK missing name)",
"swordi.itm (TLK missing name)",
],
"Scroll": [
"Agannazar's Scorcher",
"Andris's Journal",
"Animate Dead",
"Armor",
"Blindness",
"Burning Hands",
"Chaos",
"Chaotic Commands",
"Charm Person",
"Chill Touch",
"Chromatic Orb",
"Clairvoyance",
"Color Spray",
"Confusion",
"Cure Critical Wounds",
"Cure Serious Wounds",
"Cursed Scroll of Ailment",
"Cursed Scroll of Clumsiness",
"Cursed Scroll of Foolishness",
"Cursed Scroll of Petrification",
"Cursed Scroll of Stupidity",
"Cursed Scroll of Summon Monster",
"Cursed Scroll of Ugliness",
"Cursed Scroll of Weakness",
"Dark Moon Note",
"Detect Evil",
"Detect Illusion",
"Dezkiel's Scroll",
"Dire Charm",
"Dispel Magic",
"Domination",
"Emotion, Hopelessness",
"Feeblemind",
"Find Familiar",
"Fireball",
"Fireshield (Blue)",
"Fireshield (Red)",
"Flame Arrow",
"Free Action",
"Friends",
"Geas Removal Scroll",
"Ghost Armor",
"Ghoul Touch",
"Glitterdust",
"Grease",
"Greater Malison",
"Greater Restoration",
"Haste",
"Hold Person",
"Horror",
"Identify",
"Infravision",
"Invitation",
"Know Alignment",
"Larloch's Minor Drain",
"Letter",
"Letter to Kryll",
"Lightning Bolt",
"Luck",
"Magic Missile",
"Melf's Acid Arrow",
"Minor Globe of Invulnerability",
"Minor Sequencer",
"Mirror Image",
"Monster Summoning I",
"Neutralize Poison",
"Non-Detection",
"Otiluke's Resilient Sphere",
"Protection From Acid",
"Protection From Cold",
"Protection From Electricity",
"Protection From Evil",
"Protection From Fire",
"Protection From Magic",
"Protection From Normal Missiles",
"Protection From Petrification",
"Protection From Poison",
"Protection From Undead",
"Raise Dead",
"Remove Curse",
"Remove Magic",
"Resist Fear",
"Scroll",
"Shield",
"Shocking Grasp",
"Skull Trap",
"Sleep",
"Slow",
"Sorrem's Note",
"Spell Thrust",
"Spider Spawn",
"Spirit Armor",
"Stinking Cloud",
"Stone to Flesh Scroll",
"Stoneskin",
"Strength",
"Vampiric Touch",
"Vocalize",
"Web",
"Wraithform",
"bdbflye2.itm (TLK missing name)",
"bdbflyer.itm (TLK missing name)",
"bdscrl01.itm (TLK missing name)",
"bdscrl1.itm (TLK missing name)",
],
"Shield": [
"Buckler",
"Buckler +1",
"Large Shield",
"Medium Shield",
"Medium Shield +1",
"Small Shield",
"bdmisc10.itm (TLK missing name)",
"bdshld02.itm (TLK missing name)",
],
"Sling": [
"Sling",
"Sling +1",
"slng04.itm (TLK missing name)",
],
"Small sword": [
"Short Sword",
"Short Sword +1",
"The Shadow's Blade +3",
"The Whistling Sword +2",
"Wakizashi",
],
"Spear": [
"Spear",
"Spear +2",
],
"Unknown": [
"bdbody01.itm (TLK missing name)",
"bdbody02.itm (TLK missing name)",
"bdbody03.itm (TLK missing name)",
],
"Wand": [
"Wand of Fear",
"Wand of Fire",
"Wand of Frost",
"Wand of Lightning",
"Wand of Magic Missiles",
"Wand of Monster Summoning",
"Wand of Paralyzation",
"Wand of Polymorphing",
"Wand of Sleep",
"Wand of the Heavens",
],
}
|
def cap_text(text):
'''
Input a String
Output a Capitalized String
'''
# return text.capitalize()
return text.title() |
# test to make sure that every brand in our file is at least 3 characters long
with open('car-brands.txt') as f:
result = all(map(lambda row: len(row) >= 3, f))
print(result)
# => True
# test to see if any line is more than 10 characters
with open('car-brands.txt') as f:
result = any(map(lambda row: len(row) > 10, f))
print(result)
# => True
# More than 13?
with open('car-brands.txt') as f:
result = any(map(lambda row: len(row) > 13, f))
print(result)
# => False
# generator expressions instead of map
with open('car-brands.txt') as f:
result = any(len(row) > 13 for row in f)
print(result)
# => False
|
FUTEBOL = 'Futebol'
VOLEI = 'Volei'
NATACAO = 'Natacao'
LUTA = 'Luta'
ESPORTES_CAPACITADOS = [
(FUTEBOL, 'Futebol'),
(VOLEI, 'Volei'),
(NATACAO, 'Natação'),
(LUTA, 'Luta'),
] |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
# File Name: master.py
# Description :
# Author : SanYapeng
# date: 2019-05-18
# Change Activity: 2019-05-18:
name = "alex"
def func():
print("我是func")
class Person:
def __init__(self, name, age):
self.name = name
self.age = age
def chi(self):
print("人喜欢吃东西")
# if __name__ == '__main__':
# print(__name__)
# p = Person("alex", 18)
# p.chi() |
# from log_utils.remote_logs import (
# post_output_log, post_build_complete,
# post_build_error, post_build_timeout)
class TestPostOutputLog():
def test_post_output_log(self):
pass
class TestPostBuildComplete():
def test_post_build_complete(self):
pass
class TestPostBuildError():
def test_post_build_error(self):
pass
class TestPostBuildTimeout():
def test_post_build_timeout(self):
pass
|
"""
A simple stock analyzer that collects data from 3 stock-listed company files
(NASDAQ, NYSE, and AMEX), and parses it into a single delimited file where
a user can search company data from all 3 file sources.
Author: Oscar Lopez
"""
def clean_data(data):
"""
Removes any trailing new lines, replaces '"' with tab delimiter, and
removes trailing commas and unnecessary quotation marks.
Parameters:
data: String of data.
"""
data = data.strip("\n")
data = data.replace('","', "\t")
data = data.replace('"', '')
# remove unnecessary comma at end of data.
data = data[:len(data) -1]
return data
def parse_file_as_dict(*filename):
"""
Parses data from an opened file into a dictionary data.
Parameters:
(String) *filename: File name(s) of data to be parsed as dictionary of data.
"""
parsed_data_dict = dict()
for f in filename:
try:
fopen = open(f)
except:
print(f'ERROR: Could not parse data from {f}!')
continue
#ignore header of file.
fopen.readline()
for line in fopen:
line = clean_data(line)
data_list = line.split('\t')
symbol = data_list[0]
parsed_data_dict.update(
{
symbol:{
'Name': data_list[1],
'Last Sale': data_list[2],
'Market Cap': data_list[3],
'ADR TSO': data_list[4],
'IPO Year': data_list[5],
'Sector': data_list[6],
'Industry': data_list[7],
'Summary Quote': data_list[8]
}
}
)
fopen.close()
return parsed_data_dict
def parse_file_as_list(*filename):
"""
Parses all data from file(s) as a list.
Parameters:
(String) *filename: File name(s) of data to be parsed as a list of
data.
"""
parsed_data_list = list()
for f in filename:
try:
fopen = open(f)
except:
print(f'ERROR: Could not parse data from {f}!')
continue
#ignore header of file.
fopen.readline()
for line in fopen:
line = clean_data(line)
data_list = line.split('\t')
parsed_data_list.append(data_list)
return parsed_data_list
def output_data_file(filename, data):
"""
Writes data to an output file.
Parameters:
(String) filename: Name of file to be written to.
(list) data: Data to be written to file.
"""
f_write = open(filename, "w+")
data.sort()
for line in data:
for element in line:
f_write.write(str(element) + '\t')
f_write.write('\n')
f_write.close()
print(f'Finished writing data to {filename}')
def search_symbol(symbol, dict_data):
"""
Searches for a company symbol and returns its data as a formatted string if
found.Returns None otherwise.
Parameters:
(String) symbol: Company tag to be searched for.
(dict) dict_data: Dictionary of data to be searched through.
"""
symbol = symbol.upper()
if symbol in dict_data:
name = dict_data[symbol]['Name']
last_sale = dict_data[symbol]['Last Sale']
market_cap = dict_data[symbol]['Market Cap']
ipo_year = dict_data[symbol]['IPO Year']
sector = dict_data[symbol]['Sector']
industry = dict_data[symbol]['Industry']
return f'{symbol}, {name}, {last_sale}, {market_cap}, {ipo_year}, {sector}, {industry}'
return None
def get_top_15_marketcap(data):
"""
Gets the top 15 companies based on their marketcap.
Parameters:
(list)data: A compiled list of lists of company data.
"""
top_15_marketcap = list()
all_company_marketcap = list()
for line in data:
company_tag = line[0]
company_marketcap = line[3]
all_company_marketcap.append([company_marketcap, company_tag])
all_company_marketcap.sort(reverse=True)
for i in range(0,15):
top_15_marketcap.append(all_company_marketcap[i])
return top_15_marketcap
def display_menu():
"""
Returns the main menu of the program.
"""
return """
Lopez's CompanyList Data Analyzer
======================================
1 : Export to merged/sorted(by stock symbol) CSV file.
2 : Search by stock symbol.
3 : Display 15 Companies with the highest MarketCap value.
4 : Exit
"""
def promptChoice(prompt):
"""
Returns the numerical choice of a prompt. Otherwise returns None.
"""
try:
return int(input(prompt))
except ValueError:
return None
""" Main Program. """
# Parsing and preparing csv datasets.
data_dict = parse_file_as_dict('companylist_nasdaq.csv',
'companylist_nyse.csv',
'companylist_amex.csv')
data_list = parse_file_as_list('companylist_nasdaq.csv',
'companylist_nyse.csv',
'companylist_amex.csv')
print(display_menu())
while True:
try:
user_choice = int(promptChoice('> '))
except:
print('Plese enter a valid numerical value!')
continue
if user_choice == 1:
filename = input('What will be the name of the file? ')
output_data_file(filename, data_list)
print(f'Sorted data exported to {filename}')
elif user_choice == 2:
company_symbol = input('Enter company symbol: ')
result = search_symbol(company_symbol, data_dict)
if result:
print(result)
else:
print(f'Sorry, {company_symbol} not found!')
elif user_choice == 3:
for company in enumerate(get_top_15_marketcap(data_list)):
print(f'{company[0] + 1} : Company: {company[1][1]} : MarketCap: {company[1][0]}')
elif user_choice == 4:
print('Exiting.')
break
else:
print('Please enter a valid choice from the menu!')
|
# Small Pizza: $15
# Medium Pizza: $20
# Large Pizza: $25
# Pepperoni for Small Pizza: +$2
# Pepperoni for Medium or Large Pizza: +$3
# Extra cheese for any size pizza: + $1
print("Welcome to Python Pizza Deliveries!")
size = input("What size pizza do you want? S, M, or L ")
add_pepperoni = input("Do you want pepperoni? Y or N ")
extra_cheese = input("Do you want extra cheese? Y or N ")
bill = 0
if size == "S":
bill += 15
elif size == "M":
bill += 20
elif size == "L":
bill += 25
if add_pepperoni == "Y":
if size == "S":
bill += 2
else:
bill += 3
if extra_cheese == "Y":
bill += 1
print(f"Your final bill is: ${bill}")
|
#
# PySNMP MIB module FMX1830 (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/FMX1830
# Produced by pysmi-0.3.4 at Mon Apr 29 19:00:22 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 (default, Mar 27 2019, 09:23:15)
#
OctetString, Integer, ObjectIdentifier = mibBuilder.importSymbols("ASN1", "OctetString", "Integer", "ObjectIdentifier")
NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues")
ConstraintsIntersection, SingleValueConstraint, ValueSizeConstraint, ValueRangeConstraint, ConstraintsUnion = mibBuilder.importSymbols("ASN1-REFINEMENT", "ConstraintsIntersection", "SingleValueConstraint", "ValueSizeConstraint", "ValueRangeConstraint", "ConstraintsUnion")
NotificationGroup, ModuleCompliance = mibBuilder.importSymbols("SNMPv2-CONF", "NotificationGroup", "ModuleCompliance")
IpAddress, iso, MibIdentifier, ObjectIdentity, enterprises, Counter32, TimeTicks, NotificationType, MibScalar, MibTable, MibTableRow, MibTableColumn, Bits, Gauge32, Integer32, Counter64, ModuleIdentity, Unsigned32 = mibBuilder.importSymbols("SNMPv2-SMI", "IpAddress", "iso", "MibIdentifier", "ObjectIdentity", "enterprises", "Counter32", "TimeTicks", "NotificationType", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "Bits", "Gauge32", "Integer32", "Counter64", "ModuleIdentity", "Unsigned32")
TextualConvention, DisplayString = mibBuilder.importSymbols("SNMPv2-TC", "TextualConvention", "DisplayString")
fibronics = MibIdentifier((1, 3, 6, 1, 4, 1, 22))
fmxbd = MibIdentifier((1, 3, 6, 1, 4, 1, 22, 65))
devices = MibIdentifier((1, 3, 6, 1, 4, 1, 22, 65, 1))
terminal_server = MibIdentifier((1, 3, 6, 1, 4, 1, 22, 65, 1, 2)).setLabel("terminal-server")
port = MibIdentifier((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 1))
server = MibIdentifier((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 2))
service = MibIdentifier((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 3))
slot = MibIdentifier((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 4))
serverAdmin = MibIdentifier((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 5))
serverMibs = MibIdentifier((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6))
serverDevice = MibIdentifier((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 5, 1))
fmxServerDevice = MibIdentifier((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 5, 1, 1))
serverProtocol = MibIdentifier((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 5, 2))
protNone = MibIdentifier((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 5, 2, 1))
protTelnet = MibIdentifier((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 5, 2, 2))
protRlogin = MibIdentifier((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 5, 2, 3))
protLt = MibIdentifier((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 5, 2, 4))
fmxServerMib = MibIdentifier((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1))
fmxSystem = MibIdentifier((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 1))
fmxPort = MibIdentifier((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 2))
fmxService = MibIdentifier((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 3))
fmxProfile = MibIdentifier((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 4))
fmxIpSecurity = MibIdentifier((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 5))
fmxHostname = MibIdentifier((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 6))
fmxNameserver = MibIdentifier((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 7))
fmxTacacs = MibIdentifier((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 8))
fmxIp = MibIdentifier((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 9))
fmxArp = MibIdentifier((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 10))
fmxTcp = MibIdentifier((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 11))
fmxTelnet = MibIdentifier((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 12))
fmxRlogin = MibIdentifier((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 13))
fmxLt = MibIdentifier((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 14))
fmxQueue = MibIdentifier((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 15))
fmxSnmp = MibIdentifier((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 16))
class Character(Integer32):
subtypeSpec = Integer32.subtypeSpec + ValueRangeConstraint(0, 255)
class DisplayChar(Integer32):
subtypeSpec = Integer32.subtypeSpec + ValueRangeConstraint(32, 126)
class LtGroupList(OctetString):
pass
vSysIdentifier = MibScalar((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 1, 1), ObjectIdentifier()).setMaxAccess("readonly")
if mibBuilder.loadTexts: vSysIdentifier.setStatus('mandatory')
vSysReboot = MibScalar((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("ready", 1), ("execute", 2)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: vSysReboot.setStatus('mandatory')
vSysLtGroupStatus = MibScalar((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("present", 1), ("absent", 2)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: vSysLtGroupStatus.setStatus('mandatory')
vSysPrimaryBoot = MibScalar((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 1, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5))).clone(namedValues=NamedValues(("rom", 1), ("mop", 2), ("bootp", 3), ("tftp", 4), ("card", 5)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: vSysPrimaryBoot.setStatus('mandatory')
vSysSecondaryBoot = MibScalar((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 1, 5), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6))).clone(namedValues=NamedValues(("rom", 1), ("mop", 2), ("bootp", 3), ("tftp", 4), ("card", 5), ("none", 6)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: vSysSecondaryBoot.setStatus('mandatory')
vSysBootFilePath = MibScalar((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 1, 6), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 16))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: vSysBootFilePath.setStatus('mandatory')
vSysBootFileName = MibScalar((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 1, 7), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 9))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: vSysBootFileName.setStatus('mandatory')
vSysBootServer = MibScalar((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 1, 8), IpAddress()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: vSysBootServer.setStatus('mandatory')
vSysRemoteBoot = MibScalar((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 1, 9), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enabled", 1), ("disabled", 2)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: vSysRemoteBoot.setStatus('mandatory')
vSysEtherType = MibScalar((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 1, 10), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4))).clone(namedValues=NamedValues(("autoSelect", 1), ("thinWire", 2), ("thickWire", 3), ("tenBaseT", 4)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: vSysEtherType.setStatus('mandatory')
vSysBroadband = MibScalar((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 1, 11), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enabled", 1), ("disabled", 2)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: vSysBroadband.setStatus('mandatory')
vSysPasswordLimit = MibScalar((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 1, 12), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 250))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: vSysPasswordLimit.setStatus('mandatory')
vSysPrivPassword = MibScalar((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 1, 13), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(1, 6))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: vSysPrivPassword.setStatus('mandatory')
vSysMaintenancePassword = MibScalar((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 1, 14), OctetString().subtype(subtypeSpec=ValueSizeConstraint(8, 8)).setFixedLength(8)).setMaxAccess("readwrite")
if mibBuilder.loadTexts: vSysMaintenancePassword.setStatus('mandatory')
vPortBroadcast = MibScalar((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 2, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enabled", 1), ("disabled", 2)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: vPortBroadcast.setStatus('mandatory')
vPortInactivityTimer = MibScalar((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 2, 2), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 120))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: vPortInactivityTimer.setStatus('mandatory')
vPortAbsoluteTimer = MibScalar((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 2, 3), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 1439))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: vPortAbsoluteTimer.setStatus('mandatory')
vPortLock = MibScalar((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 2, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enabled", 1), ("disabled", 2)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: vPortLock.setStatus('mandatory')
vPortLoginPassword = MibScalar((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 2, 5), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(1, 6))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: vPortLoginPassword.setStatus('mandatory')
vPortConsoleIndex = MibScalar((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 2, 6), Integer32()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: vPortConsoleIndex.setStatus('mandatory')
vPortFailover = MibScalar((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 2, 7), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enabled", 1), ("disabled", 2)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: vPortFailover.setStatus('mandatory')
vPortSignalCheck = MibScalar((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 2, 8), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enabled", 1), ("disabled", 2)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: vPortSignalCheck.setStatus('mandatory')
vPortLoginMsgEnable = MibScalar((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 2, 9), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enabled", 1), ("disabled", 2)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: vPortLoginMsgEnable.setStatus('mandatory')
vPortBreakDuration = MibScalar((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 2, 10), Integer32().subtype(subtypeSpec=ValueRangeConstraint(10, 200))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: vPortBreakDuration.setStatus('mandatory')
vPortXoffMark = MibScalar((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 2, 11), Integer32().subtype(subtypeSpec=ValueRangeConstraint(2, 510))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: vPortXoffMark.setStatus('mandatory')
vPortXonMark = MibScalar((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 2, 12), Integer32().subtype(subtypeSpec=ValueRangeConstraint(2, 510))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: vPortXonMark.setStatus('mandatory')
vPortNumber = MibScalar((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 2, 13), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: vPortNumber.setStatus('mandatory')
vPortTable = MibTable((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 2, 14), )
if mibBuilder.loadTexts: vPortTable.setStatus('mandatory')
vPortEntry = MibTableRow((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 2, 14, 1), ).setIndexNames((0, "FMX1830", "vPortIndex"))
if mibBuilder.loadTexts: vPortEntry.setStatus('mandatory')
vPortIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 2, 14, 1, 1), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: vPortIndex.setStatus('mandatory')
vPortType = MibTableColumn((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 2, 14, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6, 7, 8, 9))).clone(namedValues=NamedValues(("unknown", 1), ("physicalRS-232", 2), ("physicalRS-423", 3), ("physicalModem", 4), ("physicalLCDPanel", 5), ("virtualConsole", 6), ("virtualNPT", 7), ("virtualX25", 8), ("virtual3270", 9)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: vPortType.setStatus('mandatory')
vPortName = MibTableColumn((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 2, 14, 1, 3), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(1, 16))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: vPortName.setStatus('mandatory')
vPortUserName = MibTableColumn((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 2, 14, 1, 4), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 16))).setMaxAccess("readonly")
if mibBuilder.loadTexts: vPortUserName.setStatus('mandatory')
vPortState = MibTableColumn((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 2, 14, 1, 5), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6, 7))).clone(namedValues=NamedValues(("unknown", 1), ("idle", 2), ("local", 3), ("connecting", 4), ("connected", 5), ("locked", 6), ("serial-interface", 7)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: vPortState.setStatus('mandatory')
vPortLogout = MibTableColumn((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 2, 14, 1, 6), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("ready", 1), ("execute", 2)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: vPortLogout.setStatus('mandatory')
vPortActiveSessions = MibTableColumn((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 2, 14, 1, 7), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: vPortActiveSessions.setStatus('mandatory')
vPortCurrSessNumber = MibTableColumn((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 2, 14, 1, 8), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: vPortCurrSessNumber.setStatus('mandatory')
vPortCurrSessProt = MibTableColumn((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 2, 14, 1, 9), ObjectIdentifier()).setMaxAccess("readonly")
if mibBuilder.loadTexts: vPortCurrSessProt.setStatus('mandatory')
vPortAccess = MibTableColumn((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 2, 14, 1, 10), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4))).clone(namedValues=NamedValues(("local", 1), ("remote", 2), ("dynamic", 3), ("none", 4)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: vPortAccess.setStatus('mandatory')
vPortVirtualEnable = MibTableColumn((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 2, 14, 1, 11), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enabled", 1), ("disabled", 2)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: vPortVirtualEnable.setStatus('mandatory')
vPortVirtualString = MibTableColumn((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 2, 14, 1, 12), OctetString().subtype(subtypeSpec=ValueSizeConstraint(0, 112))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: vPortVirtualString.setStatus('mandatory')
vPortSessionLimit = MibTableColumn((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 2, 14, 1, 13), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 10))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: vPortSessionLimit.setStatus('mandatory')
vPortProfile = MibTableColumn((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 2, 14, 1, 14), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 16))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: vPortProfile.setStatus('mandatory')
vPortQueueing = MibTableColumn((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 2, 14, 1, 15), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enabled", 1), ("disabled", 2)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: vPortQueueing.setStatus('mandatory')
vPortPasswordEnable = MibTableColumn((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 2, 14, 1, 16), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enabled", 1), ("disabled", 2)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: vPortPasswordEnable.setStatus('mandatory')
vPortTacacsEnable = MibTableColumn((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 2, 14, 1, 17), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enabled", 1), ("disabled", 2)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: vPortTacacsEnable.setStatus('mandatory')
vPortSecurityEnable = MibTableColumn((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 2, 14, 1, 18), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enabled", 1), ("disabled", 2)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: vPortSecurityEnable.setStatus('mandatory')
vPortGroups = MibTableColumn((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 2, 14, 1, 19), LtGroupList()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: vPortGroups.setStatus('mandatory')
vPortBreakMode = MibTableColumn((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 2, 14, 1, 20), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("local", 1), ("remote", 2), ("disabled", 3)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: vPortBreakMode.setStatus('mandatory')
vPortBackSwitch = MibTableColumn((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 2, 14, 1, 21), Character()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: vPortBackSwitch.setStatus('mandatory')
vPortForwSwitch = MibTableColumn((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 2, 14, 1, 22), Character()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: vPortForwSwitch.setStatus('mandatory')
vPortLocalSwitch = MibTableColumn((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 2, 14, 1, 23), Character()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: vPortLocalSwitch.setStatus('mandatory')
vPortPrefSvc = MibTableColumn((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 2, 14, 1, 24), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 16))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: vPortPrefSvc.setStatus('mandatory')
vPortPrefNode = MibTableColumn((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 2, 14, 1, 25), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 16))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: vPortPrefNode.setStatus('mandatory')
vPortPrefPort = MibTableColumn((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 2, 14, 1, 26), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 16))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: vPortPrefPort.setStatus('mandatory')
vPortPrefMode = MibTableColumn((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 2, 14, 1, 27), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("dedicated", 1), ("preferred", 2)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: vPortPrefMode.setStatus('mandatory')
vPortAutoConnect = MibTableColumn((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 2, 14, 1, 28), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enabled", 1), ("disabled", 2)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: vPortAutoConnect.setStatus('mandatory')
vPortPrompt = MibTableColumn((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 2, 14, 1, 29), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 11))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: vPortPrompt.setStatus('mandatory')
vPortInactiveLogout = MibTableColumn((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 2, 14, 1, 30), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enabled", 1), ("disabled", 2)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: vPortInactiveLogout.setStatus('mandatory')
vPortAutoPrompt = MibTableColumn((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 2, 14, 1, 31), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enabled", 1), ("disabled", 2)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: vPortAutoPrompt.setStatus('mandatory')
vPortBroadcastEnable = MibTableColumn((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 2, 14, 1, 32), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enabled", 1), ("disabled", 2)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: vPortBroadcastEnable.setStatus('mandatory')
vPortInterrupts = MibTableColumn((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 2, 14, 1, 33), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enabled", 1), ("disabled", 2)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: vPortInterrupts.setStatus('mandatory')
vPortMessageCodes = MibTableColumn((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 2, 14, 1, 34), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enabled", 1), ("disabled", 2)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: vPortMessageCodes.setStatus('mandatory')
vPortVerification = MibTableColumn((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 2, 14, 1, 35), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enabled", 1), ("disabled", 2)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: vPortVerification.setStatus('mandatory')
vPortDialup = MibTableColumn((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 2, 14, 1, 36), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enabled", 1), ("disabled", 2)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: vPortDialup.setStatus('mandatory')
vPortRemoteModify = MibTableColumn((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 2, 14, 1, 37), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enabled", 1), ("disabled", 2)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: vPortRemoteModify.setStatus('mandatory')
vPortAbsoluteLogout = MibTableColumn((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 2, 14, 1, 38), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enabled", 1), ("disabled", 2)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: vPortAbsoluteLogout.setStatus('mandatory')
vPortIOflush = MibTableColumn((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 2, 14, 1, 39), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enabled", 1), ("disabled", 2)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: vPortIOflush.setStatus('mandatory')
vPortLogoutMsgEnable = MibTableColumn((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 2, 14, 1, 40), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enabled", 1), ("disabled", 2)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: vPortLogoutMsgEnable.setStatus('mandatory')
vPortScreenType = MibTableColumn((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 2, 14, 1, 41), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("ansi", 1), ("softcopy", 2), ("hardcopy", 3)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: vPortScreenType.setStatus('mandatory')
vPortFlowType = MibTableColumn((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 2, 14, 1, 42), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5))).clone(namedValues=NamedValues(("none", 1), ("xonXoff", 2), ("hardware", 3), ("ctsRts", 4), ("dsrDtr", 5)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: vPortFlowType.setStatus('mandatory')
vPortInFlowState = MibTableColumn((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 2, 14, 1, 43), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4))).clone(namedValues=NamedValues(("none", 1), ("unknown", 2), ("stop", 3), ("go", 4)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: vPortInFlowState.setStatus('mandatory')
vPortOutFlowState = MibTableColumn((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 2, 14, 1, 44), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4))).clone(namedValues=NamedValues(("none", 1), ("unknown", 2), ("stop", 3), ("go", 4)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: vPortOutFlowState.setStatus('mandatory')
vPortCTSstate = MibTableColumn((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 2, 14, 1, 45), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4))).clone(namedValues=NamedValues(("none", 1), ("on", 2), ("off", 3), ("unknown", 4)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: vPortCTSstate.setStatus('mandatory')
vPortDSRstate = MibTableColumn((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 2, 14, 1, 46), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4))).clone(namedValues=NamedValues(("none", 1), ("on", 2), ("off", 3), ("unknown", 4)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: vPortDSRstate.setStatus('mandatory')
vPortDCDstate = MibTableColumn((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 2, 14, 1, 47), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4))).clone(namedValues=NamedValues(("none", 1), ("on", 2), ("off", 3), ("unknown", 4)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: vPortDCDstate.setStatus('mandatory')
vPortDTRstate = MibTableColumn((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 2, 14, 1, 48), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4))).clone(namedValues=NamedValues(("none", 1), ("on", 2), ("off", 3), ("unknown", 4)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: vPortDTRstate.setStatus('mandatory')
vPortRIstate = MibTableColumn((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 2, 14, 1, 49), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4))).clone(namedValues=NamedValues(("none", 1), ("on", 2), ("off", 3), ("unknown", 4)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: vPortRIstate.setStatus('mandatory')
vPortRTSstate = MibTableColumn((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 2, 14, 1, 50), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4))).clone(namedValues=NamedValues(("none", 1), ("on", 2), ("off", 3), ("unknown", 4)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: vPortRTSstate.setStatus('mandatory')
vPortSpeed = MibTableColumn((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 2, 14, 1, 51), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13))).clone(namedValues=NamedValues(("none", 1), ("baud-110", 2), ("baud-300", 3), ("baud-600", 4), ("baud-1200", 5), ("baud-2400", 6), ("baud-4800", 7), ("baud-9600", 8), ("baud-14400", 9), ("baud-19200", 10), ("baud-28800", 11), ("baud-38400", 12), ("baud-57600", 13)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: vPortSpeed.setStatus('mandatory')
vPortCharSize = MibTableColumn((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 2, 14, 1, 52), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("none", 1), ("seven-bits", 2), ("eight-bits", 3)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: vPortCharSize.setStatus('mandatory')
vPortParityType = MibTableColumn((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 2, 14, 1, 53), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6))).clone(namedValues=NamedValues(("not-applicable", 1), ("none", 2), ("even", 3), ("odd", 4), ("mark", 5), ("space", 6)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: vPortParityType.setStatus('mandatory')
vPortAutobaud = MibTableColumn((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 2, 14, 1, 54), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("enabled", 1), ("disabled", 2), ("not-applicable", 3)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: vPortAutobaud.setStatus('mandatory')
vPortModemControl = MibTableColumn((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 2, 14, 1, 55), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("enabled", 1), ("disabled", 2), ("not-applicable", 3)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: vPortModemControl.setStatus('mandatory')
vPortDSRlogout = MibTableColumn((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 2, 14, 1, 56), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("enabled", 1), ("disabled", 2), ("not-applicable", 3)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: vPortDSRlogout.setStatus('mandatory')
vPortRing = MibTableColumn((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 2, 14, 1, 57), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("enabled", 1), ("disabled", 2), ("not-applicable", 3)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: vPortRing.setStatus('mandatory')
vPortDTRwait = MibTableColumn((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 2, 14, 1, 58), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("enabled", 1), ("disabled", 2), ("not-applicable", 3)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: vPortDTRwait.setStatus('mandatory')
vPortSignalCheckEnable = MibTableColumn((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 2, 14, 1, 59), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("enabled", 1), ("disabled", 2), ("not-applicable", 3)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: vPortSignalCheckEnable.setStatus('mandatory')
vPortHandshake = MibTableColumn((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 2, 14, 1, 60), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("signalCTS", 1), ("signalRI", 2), ("not-applicable", 3)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: vPortHandshake.setStatus('mandatory')
vPortRcvChars = MibTableColumn((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 2, 14, 1, 61), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: vPortRcvChars.setStatus('mandatory')
vPortTrnChars = MibTableColumn((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 2, 14, 1, 62), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: vPortTrnChars.setStatus('mandatory')
vPortFrameErrs = MibTableColumn((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 2, 14, 1, 63), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: vPortFrameErrs.setStatus('mandatory')
vPortOverrunErrs = MibTableColumn((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 2, 14, 1, 64), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: vPortOverrunErrs.setStatus('mandatory')
vPortParityErrs = MibTableColumn((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 2, 14, 1, 65), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: vPortParityErrs.setStatus('mandatory')
vPortCharsDropped = MibTableColumn((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 2, 14, 1, 66), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: vPortCharsDropped.setStatus('mandatory')
vSvcRatingMode = MibScalar((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 3, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("scaled", 1), ("unScaled", 2)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: vSvcRatingMode.setStatus('mandatory')
vSvcCurrNumber = MibScalar((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 3, 2), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: vSvcCurrNumber.setStatus('mandatory')
vSvcTable = MibTable((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 3, 3), )
if mibBuilder.loadTexts: vSvcTable.setStatus('mandatory')
vSvcEntry = MibTableRow((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 3, 3, 1), ).setIndexNames((0, "FMX1830", "vSvcName"))
if mibBuilder.loadTexts: vSvcEntry.setStatus('mandatory')
vSvcName = MibTableColumn((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 3, 3, 1, 1), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 16))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: vSvcName.setStatus('mandatory')
vSvcPorts = MibTableColumn((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 3, 3, 1, 2), OctetString().subtype(subtypeSpec=ValueSizeConstraint(32, 32)).setFixedLength(32)).setMaxAccess("readwrite")
if mibBuilder.loadTexts: vSvcPorts.setStatus('mandatory')
vSvcIdent = MibTableColumn((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 3, 3, 1, 3), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 40))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: vSvcIdent.setStatus('mandatory')
vSvcRating = MibTableColumn((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 3, 3, 1, 4), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 255))).setMaxAccess("readonly")
if mibBuilder.loadTexts: vSvcRating.setStatus('mandatory')
vSvcLtEnable = MibTableColumn((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 3, 3, 1, 5), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enabled", 1), ("disabled", 2)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: vSvcLtEnable.setStatus('mandatory')
vSvcTelEnable = MibTableColumn((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 3, 3, 1, 6), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enabled", 1), ("disabled", 2)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: vSvcTelEnable.setStatus('mandatory')
vSvcLprEnable = MibTableColumn((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 3, 3, 1, 7), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enabled", 1), ("disabled", 2)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: vSvcLprEnable.setStatus('mandatory')
vSvcRawEnable = MibTableColumn((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 3, 3, 1, 8), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enabled", 1), ("disabled", 2)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: vSvcRawEnable.setStatus('mandatory')
vSvcVirtualEnable = MibTableColumn((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 3, 3, 1, 9), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enabled", 1), ("disabled", 2)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: vSvcVirtualEnable.setStatus('mandatory')
vSvcVirtualText = MibTableColumn((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 3, 3, 1, 10), OctetString().subtype(subtypeSpec=ValueSizeConstraint(0, 112))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: vSvcVirtualText.setStatus('mandatory')
vSvcConnectEnable = MibTableColumn((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 3, 3, 1, 11), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enabled", 1), ("disabled", 2)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: vSvcConnectEnable.setStatus('mandatory')
vSvcPassword = MibTableColumn((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 3, 3, 1, 12), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 6))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: vSvcPassword.setStatus('mandatory')
vSvcQueueEnable = MibTableColumn((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 3, 3, 1, 13), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enabled", 1), ("disabled", 2)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: vSvcQueueEnable.setStatus('mandatory')
vSvcIpAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 3, 3, 1, 14), IpAddress()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: vSvcIpAddr.setStatus('mandatory')
vSvcTcpPort = MibTableColumn((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 3, 3, 1, 15), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 65535))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: vSvcTcpPort.setStatus('mandatory')
vSvcProfile = MibTableColumn((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 3, 3, 1, 16), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 16))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: vSvcProfile.setStatus('mandatory')
vSvcStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 3, 3, 1, 17), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("valid", 1), ("invalid", 2)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: vSvcStatus.setStatus('mandatory')
vProfCurrNumber = MibScalar((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 4, 1), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: vProfCurrNumber.setStatus('mandatory')
vProfTable = MibTable((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 4, 2), )
if mibBuilder.loadTexts: vProfTable.setStatus('mandatory')
vProfEntry = MibTableRow((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 4, 2, 1), ).setIndexNames((0, "FMX1830", "vProfName"))
if mibBuilder.loadTexts: vProfEntry.setStatus('mandatory')
vProfName = MibTableColumn((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 4, 2, 1, 1), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 16))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: vProfName.setStatus('mandatory')
vProfDomain = MibTableColumn((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 4, 2, 1, 2), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 63))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: vProfDomain.setStatus('mandatory')
vProfConcatenate = MibTableColumn((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 4, 2, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enabled", 1), ("disabled", 2)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: vProfConcatenate.setStatus('mandatory')
vProfPermHostOnly = MibTableColumn((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 4, 2, 1, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enabled", 1), ("disabled", 2)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: vProfPermHostOnly.setStatus('mandatory')
vProfTcpPort = MibTableColumn((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 4, 2, 1, 5), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 65535))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: vProfTcpPort.setStatus('mandatory')
vProfTcpTimeout = MibTableColumn((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 4, 2, 1, 6), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 65535))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: vProfTcpTimeout.setStatus('mandatory')
vProfTcpKeepalive = MibTableColumn((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 4, 2, 1, 7), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 65535))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: vProfTcpKeepalive.setStatus('mandatory')
vProfIpTTL = MibTableColumn((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 4, 2, 1, 8), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 255))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: vProfIpTTL.setStatus('mandatory')
vProfIpPrecedence = MibTableColumn((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 4, 2, 1, 9), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 255))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: vProfIpPrecedence.setStatus('mandatory')
vProfTermType = MibTableColumn((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 4, 2, 1, 10), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 16))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: vProfTermType.setStatus('mandatory')
vProfCrToNet = MibTableColumn((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 4, 2, 1, 11), OctetString().subtype(subtypeSpec=ValueSizeConstraint(1, 2))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: vProfCrToNet.setStatus('mandatory')
vProfCrFromTerm = MibTableColumn((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 4, 2, 1, 12), OctetString().subtype(subtypeSpec=ValueSizeConstraint(1, 2))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: vProfCrFromTerm.setStatus('mandatory')
vProfPadChar = MibTableColumn((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 4, 2, 1, 13), Character()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: vProfPadChar.setStatus('mandatory')
vProfPadLength = MibTableColumn((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 4, 2, 1, 14), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 255))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: vProfPadLength.setStatus('mandatory')
vProfEndRecord = MibTableColumn((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 4, 2, 1, 15), Character()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: vProfEndRecord.setStatus('mandatory')
vProfNop = MibTableColumn((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 4, 2, 1, 16), Character()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: vProfNop.setStatus('mandatory')
vProfDataMark = MibTableColumn((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 4, 2, 1, 17), Character()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: vProfDataMark.setStatus('mandatory')
vProfBreak = MibTableColumn((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 4, 2, 1, 18), Character()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: vProfBreak.setStatus('mandatory')
vProfIntProcess = MibTableColumn((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 4, 2, 1, 19), Character()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: vProfIntProcess.setStatus('mandatory')
vProfAbortOutput = MibTableColumn((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 4, 2, 1, 20), Character()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: vProfAbortOutput.setStatus('mandatory')
vProfAttention = MibTableColumn((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 4, 2, 1, 21), Character()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: vProfAttention.setStatus('mandatory')
vProfEraseChar = MibTableColumn((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 4, 2, 1, 22), Character()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: vProfEraseChar.setStatus('mandatory')
vProfEraseLine = MibTableColumn((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 4, 2, 1, 23), Character()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: vProfEraseLine.setStatus('mandatory')
vProfGoAhead = MibTableColumn((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 4, 2, 1, 24), Character()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: vProfGoAhead.setStatus('mandatory')
vProfNullPass = MibTableColumn((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 4, 2, 1, 25), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enabled", 1), ("disabled", 2)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: vProfNullPass.setStatus('mandatory')
vProfLocalEcho = MibTableColumn((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 4, 2, 1, 26), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("attempt", 1), ("refuse", 2), ("allow", 3)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: vProfLocalEcho.setStatus('mandatory')
vProfRemoteEcho = MibTableColumn((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 4, 2, 1, 27), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("attempt", 1), ("refuse", 2), ("allow", 3)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: vProfRemoteEcho.setStatus('mandatory')
vProfLocalBinary = MibTableColumn((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 4, 2, 1, 28), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("attempt", 1), ("refuse", 2), ("allow", 3)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: vProfLocalBinary.setStatus('mandatory')
vProfRemoteBinary = MibTableColumn((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 4, 2, 1, 29), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("attempt", 1), ("refuse", 2), ("allow", 3)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: vProfRemoteBinary.setStatus('mandatory')
vProfStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 4, 2, 1, 30), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("valid", 1), ("invalid", 2)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: vProfStatus.setStatus('mandatory')
vSecEnable = MibScalar((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 5, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enabled", 1), ("disabled", 2)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: vSecEnable.setStatus('mandatory')
vSecCurrNumber = MibScalar((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 5, 2), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: vSecCurrNumber.setStatus('mandatory')
vSecTable = MibTable((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 5, 3), )
if mibBuilder.loadTexts: vSecTable.setStatus('mandatory')
vSecEntry = MibTableRow((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 5, 3, 1), ).setIndexNames((0, "FMX1830", "vSecIndex"))
if mibBuilder.loadTexts: vSecEntry.setStatus('mandatory')
vSecIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 5, 3, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 32))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: vSecIndex.setStatus('mandatory')
vSecAddress = MibTableColumn((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 5, 3, 1, 2), IpAddress()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: vSecAddress.setStatus('mandatory')
vSecMask = MibTableColumn((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 5, 3, 1, 3), IpAddress()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: vSecMask.setStatus('mandatory')
vSecGroups = MibTableColumn((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 5, 3, 1, 4), LtGroupList()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: vSecGroups.setStatus('mandatory')
vSecStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 5, 3, 1, 5), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("valid", 1), ("invalid", 2)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: vSecStatus.setStatus('mandatory')
vHostCurrNumber = MibScalar((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 6, 1), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: vHostCurrNumber.setStatus('mandatory')
vHostTable = MibTable((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 6, 2), )
if mibBuilder.loadTexts: vHostTable.setStatus('mandatory')
vHostEntry = MibTableRow((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 6, 2, 1), ).setIndexNames((0, "FMX1830", "vHostHostname"))
if mibBuilder.loadTexts: vHostEntry.setStatus('mandatory')
vHostHostname = MibTableColumn((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 6, 2, 1, 1), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(1, 64))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: vHostHostname.setStatus('mandatory')
vHostAddress = MibTableColumn((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 6, 2, 1, 2), IpAddress()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: vHostAddress.setStatus('mandatory')
vHostTTL = MibTableColumn((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 6, 2, 1, 3), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: vHostTTL.setStatus('mandatory')
vHostStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 6, 2, 1, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("valid", 1), ("invalid", 2)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: vHostStatus.setStatus('mandatory')
vNsRequestMode = MibScalar((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 7, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("recursive", 1), ("nonRecursive", 2)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: vNsRequestMode.setStatus('mandatory')
vNsAllowLowerCase = MibScalar((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 7, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enabled", 1), ("disabled", 2)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: vNsAllowLowerCase.setStatus('mandatory')
vNsCurrNumber = MibScalar((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 7, 3), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: vNsCurrNumber.setStatus('mandatory')
vNsTable = MibTable((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 7, 4), )
if mibBuilder.loadTexts: vNsTable.setStatus('mandatory')
vNsEntry = MibTableRow((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 7, 4, 1), ).setIndexNames((0, "FMX1830", "vNsAddress"))
if mibBuilder.loadTexts: vNsEntry.setStatus('mandatory')
vNsAddress = MibTableColumn((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 7, 4, 1, 1), IpAddress()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: vNsAddress.setStatus('mandatory')
vNsHostname = MibTableColumn((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 7, 4, 1, 2), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(1, 64))).setMaxAccess("readonly")
if mibBuilder.loadTexts: vNsHostname.setStatus('mandatory')
vNsTTL = MibTableColumn((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 7, 4, 1, 3), TimeTicks()).setMaxAccess("readonly")
if mibBuilder.loadTexts: vNsTTL.setStatus('mandatory')
vNsStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 7, 4, 1, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("valid", 1), ("invalid", 2)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: vNsStatus.setStatus('mandatory')
vTacServerCurrNumber = MibScalar((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 8, 1), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: vTacServerCurrNumber.setStatus('mandatory')
vTacTable = MibTable((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 8, 2), )
if mibBuilder.loadTexts: vTacTable.setStatus('mandatory')
vTacEntry = MibTableRow((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 8, 2, 1), ).setIndexNames((0, "FMX1830", "vTacAddress"))
if mibBuilder.loadTexts: vTacEntry.setStatus('mandatory')
vTacAddress = MibTableColumn((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 8, 2, 1, 1), IpAddress()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: vTacAddress.setStatus('mandatory')
vTacHostname = MibTableColumn((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 8, 2, 1, 2), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 63))).setMaxAccess("readonly")
if mibBuilder.loadTexts: vTacHostname.setStatus('mandatory')
vTacStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 8, 2, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("valid", 1), ("invalid", 2)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: vTacStatus.setStatus('mandatory')
vIpBcastAddr = MibScalar((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 9, 1), IpAddress()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: vIpBcastAddr.setStatus('mandatory')
vIpMaxAddr = MibScalar((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 9, 2), Integer32().subtype(subtypeSpec=ValueRangeConstraint(8, 64))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: vIpMaxAddr.setStatus('mandatory')
vIpMaxHostHashEntries = MibScalar((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 9, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16))).clone(namedValues=NamedValues(("size-11", 1), ("size-13", 2), ("size-17", 3), ("size-19", 4), ("size-23", 5), ("size-29", 6), ("size-31", 7), ("size-37", 8), ("size-41", 9), ("size-43", 10), ("size-47", 11), ("size-49", 12), ("size-53", 13), ("size-59", 14), ("size-61", 15), ("size-67", 16)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: vIpMaxHostHashEntries.setStatus('mandatory')
vIpMaxNetHashEntries = MibScalar((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 9, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16))).clone(namedValues=NamedValues(("size-11", 1), ("size-13", 2), ("size-17", 3), ("size-19", 4), ("size-23", 5), ("size-29", 6), ("size-31", 7), ("size-37", 8), ("size-41", 9), ("size-43", 10), ("size-47", 11), ("size-49", 12), ("size-53", 13), ("size-59", 14), ("size-61", 15), ("size-67", 16)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: vIpMaxNetHashEntries.setStatus('mandatory')
vIpMaxInterfaces = MibScalar((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 9, 5), Integer32().subtype(subtypeSpec=ValueRangeConstraint(2, 128))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: vIpMaxInterfaces.setStatus('mandatory')
vIpMaxRoutes = MibScalar((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 9, 6), Integer32().subtype(subtypeSpec=ValueRangeConstraint(16, 128))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: vIpMaxRoutes.setStatus('mandatory')
vArpMaxEntries = MibScalar((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 10, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(16, 128))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: vArpMaxEntries.setStatus('mandatory')
vArpRetryTimeout = MibScalar((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 10, 2), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 30))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: vArpRetryTimeout.setStatus('mandatory')
vArpRetryMax = MibScalar((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 10, 3), Integer32().subtype(subtypeSpec=ValueRangeConstraint(2, 10))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: vArpRetryMax.setStatus('mandatory')
vArpConfirmTimer = MibScalar((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 10, 4), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 300))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: vArpConfirmTimer.setStatus('mandatory')
vArpIdleTimeout = MibScalar((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 10, 5), Integer32().subtype(subtypeSpec=ValueRangeConstraint(60, 1800))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: vArpIdleTimeout.setStatus('mandatory')
vTcpIpPrecedence = MibScalar((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 11, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 255))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: vTcpIpPrecedence.setStatus('mandatory')
vTcpSendQSize = MibScalar((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 11, 2), Integer32().subtype(subtypeSpec=ValueRangeConstraint(128, 8192))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: vTcpSendQSize.setStatus('mandatory')
vTcpRcvWinSize = MibScalar((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 11, 3), Integer32().subtype(subtypeSpec=ValueRangeConstraint(128, 8192))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: vTcpRcvWinSize.setStatus('mandatory')
vTcpSegSize = MibScalar((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 11, 4), Integer32().subtype(subtypeSpec=ValueRangeConstraint(64, 511))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: vTcpSegSize.setStatus('mandatory')
vTcpTimerInterval = MibScalar((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 11, 5), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 200))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: vTcpTimerInterval.setStatus('mandatory')
vTcpChecksumEnable = MibScalar((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 11, 6), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enabled", 1), ("disabled", 2)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: vTcpChecksumEnable.setStatus('mandatory')
vTelCourierEnable = MibScalar((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 12, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enabled", 1), ("disabled", 2)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: vTelCourierEnable.setStatus('mandatory')
vTelCourierText = MibScalar((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 12, 2), OctetString().subtype(subtypeSpec=ValueSizeConstraint(0, 16))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: vTelCourierText.setStatus('mandatory')
vTelSessCurrNumber = MibScalar((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 12, 3), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: vTelSessCurrNumber.setStatus('mandatory')
vTelSessTable = MibTable((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 12, 4), )
if mibBuilder.loadTexts: vTelSessTable.setStatus('mandatory')
vTelSessEntry = MibTableRow((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 12, 4, 1), ).setIndexNames((0, "FMX1830", "vTelSessPortIndex"), (0, "FMX1830", "vTelSessIndex"))
if mibBuilder.loadTexts: vTelSessEntry.setStatus('mandatory')
vTelSessPortIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 12, 4, 1, 1), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: vTelSessPortIndex.setStatus('mandatory')
vTelSessIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 12, 4, 1, 2), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: vTelSessIndex.setStatus('mandatory')
vTelSessOrigin = MibTableColumn((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 12, 4, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("unknown", 1), ("network", 2), ("local", 3)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: vTelSessOrigin.setStatus('mandatory')
vTelSessState = MibTableColumn((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 12, 4, 1, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("starting", 1), ("running", 2), ("stopping", 3)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: vTelSessState.setStatus('mandatory')
vTelSessDisconnect = MibTableColumn((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 12, 4, 1, 5), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("ready", 1), ("execute", 2)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: vTelSessDisconnect.setStatus('mandatory')
vTelSessLocalAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 12, 4, 1, 6), IpAddress()).setMaxAccess("readonly")
if mibBuilder.loadTexts: vTelSessLocalAddr.setStatus('mandatory')
vTelSessLocalTcpPort = MibTableColumn((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 12, 4, 1, 7), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 65535))).setMaxAccess("readonly")
if mibBuilder.loadTexts: vTelSessLocalTcpPort.setStatus('mandatory')
vTelSessRemAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 12, 4, 1, 8), IpAddress()).setMaxAccess("readonly")
if mibBuilder.loadTexts: vTelSessRemAddr.setStatus('mandatory')
vTelSessRemTcpPort = MibTableColumn((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 12, 4, 1, 9), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 65535))).setMaxAccess("readonly")
if mibBuilder.loadTexts: vTelSessRemTcpPort.setStatus('mandatory')
vTelSessCrToNet = MibTableColumn((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 12, 4, 1, 10), OctetString().subtype(subtypeSpec=ValueSizeConstraint(1, 2))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: vTelSessCrToNet.setStatus('mandatory')
vTelSessCrFromTerm = MibTableColumn((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 12, 4, 1, 11), OctetString().subtype(subtypeSpec=ValueSizeConstraint(1, 2))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: vTelSessCrFromTerm.setStatus('mandatory')
vTelSessPadChar = MibTableColumn((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 12, 4, 1, 12), Character()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: vTelSessPadChar.setStatus('mandatory')
vTelSessPadLength = MibTableColumn((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 12, 4, 1, 13), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 255))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: vTelSessPadLength.setStatus('mandatory')
vTelSessUserTimeout = MibTableColumn((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 12, 4, 1, 14), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 65535))).setMaxAccess("readonly")
if mibBuilder.loadTexts: vTelSessUserTimeout.setStatus('mandatory')
vTelSessKeepalive = MibTableColumn((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 12, 4, 1, 15), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 65535))).setMaxAccess("readonly")
if mibBuilder.loadTexts: vTelSessKeepalive.setStatus('mandatory')
vTelSessIpTTL = MibTableColumn((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 12, 4, 1, 16), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 255))).setMaxAccess("readonly")
if mibBuilder.loadTexts: vTelSessIpTTL.setStatus('mandatory')
vTelSessIpPrecedence = MibTableColumn((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 12, 4, 1, 17), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 255))).setMaxAccess("readonly")
if mibBuilder.loadTexts: vTelSessIpPrecedence.setStatus('mandatory')
vTelSessEndRecord = MibTableColumn((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 12, 4, 1, 18), Character()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: vTelSessEndRecord.setStatus('mandatory')
vTelSessNop = MibTableColumn((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 12, 4, 1, 19), Character()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: vTelSessNop.setStatus('mandatory')
vTelSessDataMark = MibTableColumn((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 12, 4, 1, 20), Character()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: vTelSessDataMark.setStatus('mandatory')
vTelSessBreak = MibTableColumn((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 12, 4, 1, 21), Character()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: vTelSessBreak.setStatus('mandatory')
vTelSessIntProcess = MibTableColumn((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 12, 4, 1, 22), Character()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: vTelSessIntProcess.setStatus('mandatory')
vTelSessAbortOutput = MibTableColumn((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 12, 4, 1, 23), Character()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: vTelSessAbortOutput.setStatus('mandatory')
vTelSessAttention = MibTableColumn((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 12, 4, 1, 24), Character()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: vTelSessAttention.setStatus('mandatory')
vTelSessEraseChar = MibTableColumn((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 12, 4, 1, 25), Character()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: vTelSessEraseChar.setStatus('mandatory')
vTelSessEraseLine = MibTableColumn((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 12, 4, 1, 26), Character()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: vTelSessEraseLine.setStatus('mandatory')
vTelSessGoAhead = MibTableColumn((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 12, 4, 1, 27), Character()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: vTelSessGoAhead.setStatus('mandatory')
vTelSessNullPass = MibTableColumn((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 12, 4, 1, 28), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enabled", 1), ("disabled", 2)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: vTelSessNullPass.setStatus('mandatory')
vTelSessTermType = MibTableColumn((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 12, 4, 1, 29), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 16))).setMaxAccess("readonly")
if mibBuilder.loadTexts: vTelSessTermType.setStatus('mandatory')
vTelSessLocalEcho = MibTableColumn((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 12, 4, 1, 30), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enabled", 1), ("disabled", 2)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: vTelSessLocalEcho.setStatus('mandatory')
vTelSessRemoteEcho = MibTableColumn((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 12, 4, 1, 31), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enabled", 1), ("disabled", 2)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: vTelSessRemoteEcho.setStatus('mandatory')
vTelSessLocalBinary = MibTableColumn((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 12, 4, 1, 32), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enabled", 1), ("disabled", 2)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: vTelSessLocalBinary.setStatus('mandatory')
vTelSessRemoteBinary = MibTableColumn((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 12, 4, 1, 33), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enabled", 1), ("disabled", 2)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: vTelSessRemoteBinary.setStatus('mandatory')
vRlogSessCurrNumber = MibScalar((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 13, 1), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: vRlogSessCurrNumber.setStatus('mandatory')
vRlogSessTable = MibTable((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 13, 2), )
if mibBuilder.loadTexts: vRlogSessTable.setStatus('mandatory')
vRlogSessEntry = MibTableRow((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 13, 2, 1), ).setIndexNames((0, "FMX1830", "vRlogSessPortIndex"), (0, "FMX1830", "vRlogSessIndex"))
if mibBuilder.loadTexts: vRlogSessEntry.setStatus('mandatory')
vRlogSessPortIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 13, 2, 1, 1), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: vRlogSessPortIndex.setStatus('mandatory')
vRlogSessIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 13, 2, 1, 2), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: vRlogSessIndex.setStatus('mandatory')
vRlogSessOrigin = MibTableColumn((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 13, 2, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("unknown", 1), ("network", 2), ("local", 3)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: vRlogSessOrigin.setStatus('mandatory')
vRlogSessState = MibTableColumn((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 13, 2, 1, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("starting", 1), ("running", 2), ("stopping", 3)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: vRlogSessState.setStatus('mandatory')
vRlogSessDisconnect = MibTableColumn((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 13, 2, 1, 5), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("ready", 1), ("execute", 2)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: vRlogSessDisconnect.setStatus('mandatory')
vRlogSessLocalAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 13, 2, 1, 6), IpAddress()).setMaxAccess("readonly")
if mibBuilder.loadTexts: vRlogSessLocalAddr.setStatus('mandatory')
vRlogSessLocalTcpPort = MibTableColumn((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 13, 2, 1, 7), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 65535))).setMaxAccess("readonly")
if mibBuilder.loadTexts: vRlogSessLocalTcpPort.setStatus('mandatory')
vRlogSessRemAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 13, 2, 1, 8), IpAddress()).setMaxAccess("readonly")
if mibBuilder.loadTexts: vRlogSessRemAddr.setStatus('mandatory')
vRlogSessRemTcpPort = MibTableColumn((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 13, 2, 1, 9), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 65535))).setMaxAccess("readonly")
if mibBuilder.loadTexts: vRlogSessRemTcpPort.setStatus('mandatory')
vRlogSessTermType = MibTableColumn((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 13, 2, 1, 10), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 16))).setMaxAccess("readonly")
if mibBuilder.loadTexts: vRlogSessTermType.setStatus('mandatory')
vLtNodeName = MibScalar((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 14, 1), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 16))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: vLtNodeName.setStatus('mandatory')
vLtNodeID = MibScalar((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 14, 2), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 40))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: vLtNodeID.setStatus('mandatory')
vLtNodeGroups = MibScalar((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 14, 3), LtGroupList()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: vLtNodeGroups.setStatus('mandatory')
vLtNumber = MibScalar((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 14, 4), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 65535))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: vLtNumber.setStatus('mandatory')
vLtMcastEnable = MibScalar((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 14, 5), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enabled", 1), ("disabled", 2)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: vLtMcastEnable.setStatus('mandatory')
vLtMcastTimer = MibScalar((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 14, 6), Integer32().subtype(subtypeSpec=ValueRangeConstraint(10, 180))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: vLtMcastTimer.setStatus('mandatory')
vLtCktTimer = MibScalar((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 14, 7), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 200))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: vLtCktTimer.setStatus('mandatory')
vLtKeepaliveTimer = MibScalar((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 14, 8), Integer32().subtype(subtypeSpec=ValueRangeConstraint(10, 180))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: vLtKeepaliveTimer.setStatus('mandatory')
vLtMaxRetran = MibScalar((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 14, 9), Integer32().subtype(subtypeSpec=ValueRangeConstraint(4, 120))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: vLtMaxRetran.setStatus('mandatory')
vLtSlotPerCkt = MibScalar((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 14, 10), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 255))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: vLtSlotPerCkt.setStatus('mandatory')
vLtMaxNodes = MibScalar((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 14, 11), Integer32().subtype(subtypeSpec=ValueRangeConstraint(16, 1024))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: vLtMaxNodes.setStatus('mandatory')
vLtMaxSvcs = MibScalar((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 14, 12), Integer32().subtype(subtypeSpec=ValueRangeConstraint(16, 2048))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: vLtMaxSvcs.setStatus('mandatory')
vLtMaxCkts = MibScalar((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 14, 13), Integer32().subtype(subtypeSpec=ValueRangeConstraint(4, 128))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: vLtMaxCkts.setStatus('mandatory')
vLtSessCurrNumber = MibScalar((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 14, 14), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: vLtSessCurrNumber.setStatus('mandatory')
vLtSessTable = MibTable((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 14, 15), )
if mibBuilder.loadTexts: vLtSessTable.setStatus('mandatory')
vLtSessEntry = MibTableRow((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 14, 15, 1), ).setIndexNames((0, "FMX1830", "vLtSessPortIndex"))
if mibBuilder.loadTexts: vLtSessEntry.setStatus('mandatory')
vLtSessPortIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 14, 15, 1, 1), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: vLtSessPortIndex.setStatus('mandatory')
vLtSessIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 14, 15, 1, 2), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: vLtSessIndex.setStatus('mandatory')
vLtSessOrigin = MibTableColumn((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 14, 15, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4))).clone(namedValues=NamedValues(("unknown", 1), ("network", 2), ("local", 3), ("remote-port", 4)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: vLtSessOrigin.setStatus('mandatory')
vLtSessState = MibTableColumn((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 14, 15, 1, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("starting", 1), ("running", 2), ("stopping", 3)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: vLtSessState.setStatus('mandatory')
vLtSessDisconnect = MibTableColumn((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 14, 15, 1, 5), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("ready", 1), ("execute", 2)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: vLtSessDisconnect.setStatus('mandatory')
vLtSessSvcName = MibTableColumn((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 14, 15, 1, 6), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 16))).setMaxAccess("readonly")
if mibBuilder.loadTexts: vLtSessSvcName.setStatus('mandatory')
vLtSessNodeName = MibTableColumn((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 14, 15, 1, 7), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 16))).setMaxAccess("readonly")
if mibBuilder.loadTexts: vLtSessNodeName.setStatus('mandatory')
vLtSessDestName = MibTableColumn((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 14, 15, 1, 8), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 16))).setMaxAccess("readonly")
if mibBuilder.loadTexts: vLtSessDestName.setStatus('mandatory')
vLtTotalRcvPkts = MibScalar((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 14, 16), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: vLtTotalRcvPkts.setStatus('mandatory')
vLtTotalTrnPkts = MibScalar((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 14, 17), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: vLtTotalTrnPkts.setStatus('mandatory')
vLtTotalRetranPkts = MibScalar((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 14, 18), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: vLtTotalRetranPkts.setStatus('mandatory')
vLtRcvCorruptPkts = MibScalar((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 14, 19), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: vLtRcvCorruptPkts.setStatus('mandatory')
vLtRcvCorruptMcasts = MibScalar((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 14, 20), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: vLtRcvCorruptMcasts.setStatus('mandatory')
vLtRcvDuplicatePkts = MibScalar((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 14, 21), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: vLtRcvDuplicatePkts.setStatus('mandatory')
vLtReqAccepted = MibScalar((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 14, 22), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: vLtReqAccepted.setStatus('mandatory')
vLtReqRejected = MibScalar((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 14, 23), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: vLtReqRejected.setStatus('mandatory')
vLtTotalNodeDiscards = MibScalar((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 14, 24), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: vLtTotalNodeDiscards.setStatus('mandatory')
vQueMaxEntries = MibScalar((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 15, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(4, 128))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: vQueMaxEntries.setStatus('mandatory')
vQueCurrNumber = MibScalar((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 15, 2), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: vQueCurrNumber.setStatus('mandatory')
vQueTable = MibTable((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 15, 3), )
if mibBuilder.loadTexts: vQueTable.setStatus('mandatory')
vQueEntry = MibTableRow((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 15, 3, 1), ).setIndexNames((0, "FMX1830", "vQueEntryNumber"))
if mibBuilder.loadTexts: vQueEntry.setStatus('mandatory')
vQueEntryNumber = MibTableColumn((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 15, 3, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 65535))).setMaxAccess("readonly")
if mibBuilder.loadTexts: vQueEntryNumber.setStatus('mandatory')
vQueSvcName = MibTableColumn((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 15, 3, 1, 2), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(1, 16))).setMaxAccess("readonly")
if mibBuilder.loadTexts: vQueSvcName.setStatus('mandatory')
vQueNodeName = MibTableColumn((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 15, 3, 1, 3), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(1, 16))).setMaxAccess("readonly")
if mibBuilder.loadTexts: vQueNodeName.setStatus('mandatory')
vQuePortName = MibTableColumn((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 15, 3, 1, 4), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(1, 16))).setMaxAccess("readonly")
if mibBuilder.loadTexts: vQuePortName.setStatus('mandatory')
vQueStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 15, 3, 1, 5), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("valid", 1), ("invalid", 2)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: vQueStatus.setStatus('mandatory')
vSnmpReadCommunity = MibScalar((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 16, 1), OctetString().subtype(subtypeSpec=ValueSizeConstraint(1, 10))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: vSnmpReadCommunity.setStatus('mandatory')
vSnmpWriteCommunity = MibScalar((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 16, 2), OctetString().subtype(subtypeSpec=ValueSizeConstraint(1, 10))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: vSnmpWriteCommunity.setStatus('mandatory')
vSnmpReadWriteCommunity = MibScalar((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 16, 3), OctetString().subtype(subtypeSpec=ValueSizeConstraint(1, 10))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: vSnmpReadWriteCommunity.setStatus('mandatory')
vSnmpWriteEnable = MibScalar((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 16, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enabled", 1), ("disabled", 2)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: vSnmpWriteEnable.setStatus('mandatory')
vSnmpTrapDestCurrNumber = MibScalar((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 16, 5), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: vSnmpTrapDestCurrNumber.setStatus('mandatory')
vSnmpTrapDestTable = MibTable((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 16, 6), )
if mibBuilder.loadTexts: vSnmpTrapDestTable.setStatus('mandatory')
vSnmpTrapDestEntry = MibTableRow((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 16, 6, 1), ).setIndexNames((0, "FMX1830", "vSnmpTrapDestAddr"))
if mibBuilder.loadTexts: vSnmpTrapDestEntry.setStatus('mandatory')
vSnmpTrapDestAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 16, 6, 1, 1), IpAddress()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: vSnmpTrapDestAddr.setStatus('mandatory')
vSnmpTrapDestCommunity = MibTableColumn((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 16, 6, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("read", 1), ("write", 2), ("readwrite", 3)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: vSnmpTrapDestCommunity.setStatus('mandatory')
vSnmpTrapDestColdEnable = MibTableColumn((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 16, 6, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enabled", 1), ("disabled", 2)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: vSnmpTrapDestColdEnable.setStatus('mandatory')
vSnmpTrapDestAuthEnable = MibTableColumn((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 16, 6, 1, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enabled", 1), ("disabled", 2)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: vSnmpTrapDestAuthEnable.setStatus('mandatory')
vSnmpTrapDestStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 22, 65, 1, 2, 6, 1, 16, 6, 1, 5), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("valid", 1), ("invalid", 2)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: vSnmpTrapDestStatus.setStatus('mandatory')
mibBuilder.exportSymbols("FMX1830", vPortTrnChars=vPortTrnChars, vSysLtGroupStatus=vSysLtGroupStatus, vSvcIpAddr=vSvcIpAddr, vSvcTelEnable=vSvcTelEnable, vPortAutobaud=vPortAutobaud, vNsAllowLowerCase=vNsAllowLowerCase, vPortInactivityTimer=vPortInactivityTimer, vHostTable=vHostTable, vProfIntProcess=vProfIntProcess, vQueCurrNumber=vQueCurrNumber, protTelnet=protTelnet, vPortParityErrs=vPortParityErrs, vPortCurrSessProt=vPortCurrSessProt, vTelSessCrToNet=vTelSessCrToNet, vProfLocalBinary=vProfLocalBinary, vRlogSessState=vRlogSessState, vPortDTRwait=vPortDTRwait, vNsAddress=vNsAddress, vRlogSessRemTcpPort=vRlogSessRemTcpPort, vTelSessDisconnect=vTelSessDisconnect, vSvcPorts=vSvcPorts, fmxLt=fmxLt, vNsCurrNumber=vNsCurrNumber, vPortFrameErrs=vPortFrameErrs, vProfNullPass=vProfNullPass, vLtSessTable=vLtSessTable, vArpIdleTimeout=vArpIdleTimeout, DisplayChar=DisplayChar, vSecGroups=vSecGroups, vLtSessOrigin=vLtSessOrigin, vTcpRcvWinSize=vTcpRcvWinSize, vLtMaxRetran=vLtMaxRetran, vTacTable=vTacTable, fmxSystem=fmxSystem, vProfGoAhead=vProfGoAhead, vPortAutoPrompt=vPortAutoPrompt, vSecAddress=vSecAddress, vIpBcastAddr=vIpBcastAddr, vLtNodeID=vLtNodeID, protLt=protLt, vSnmpTrapDestAuthEnable=vSnmpTrapDestAuthEnable, vSnmpTrapDestCommunity=vSnmpTrapDestCommunity, vPortLogout=vPortLogout, vHostAddress=vHostAddress, vTelSessState=vTelSessState, vSvcConnectEnable=vSvcConnectEnable, vTelSessIntProcess=vTelSessIntProcess, vPortIOflush=vPortIOflush, vTelSessRemTcpPort=vTelSessRemTcpPort, vLtRcvCorruptMcasts=vLtRcvCorruptMcasts, vSysPrimaryBoot=vSysPrimaryBoot, vProfEraseChar=vProfEraseChar, vPortMessageCodes=vPortMessageCodes, vIpMaxInterfaces=vIpMaxInterfaces, vTelSessNop=vTelSessNop, vQueEntry=vQueEntry, vIpMaxNetHashEntries=vIpMaxNetHashEntries, vLtSessCurrNumber=vLtSessCurrNumber, vTelSessIpPrecedence=vTelSessIpPrecedence, vPortQueueing=vPortQueueing, vSysPrivPassword=vSysPrivPassword, vTelSessEraseChar=vTelSessEraseChar, vLtTotalTrnPkts=vLtTotalTrnPkts, vLtMcastEnable=vLtMcastEnable, vPortEntry=vPortEntry, vLtRcvDuplicatePkts=vLtRcvDuplicatePkts, vLtSessSvcName=vLtSessSvcName, vPortRTSstate=vPortRTSstate, vTelSessIndex=vTelSessIndex, vPortVirtualEnable=vPortVirtualEnable, vSvcLprEnable=vSvcLprEnable, vLtNodeName=vLtNodeName, vTelSessLocalTcpPort=vTelSessLocalTcpPort, vTelSessEraseLine=vTelSessEraseLine, vPortDCDstate=vPortDCDstate, vSvcName=vSvcName, vProfAbortOutput=vProfAbortOutput, vPortDTRstate=vPortDTRstate, vLtSessIndex=vLtSessIndex, vProfPermHostOnly=vProfPermHostOnly, vPortNumber=vPortNumber, vRlogSessCurrNumber=vRlogSessCurrNumber, vPortActiveSessions=vPortActiveSessions, vQueStatus=vQueStatus, vProfAttention=vProfAttention, vProfTermType=vProfTermType, fmxSnmp=fmxSnmp, vTelSessPortIndex=vTelSessPortIndex, serverDevice=serverDevice, vSysBootServer=vSysBootServer, vSysPasswordLimit=vSysPasswordLimit, vLtReqRejected=vLtReqRejected, vPortPrefSvc=vPortPrefSvc, vIpMaxHostHashEntries=vIpMaxHostHashEntries, serverAdmin=serverAdmin, vSecEntry=vSecEntry, vTelSessLocalAddr=vTelSessLocalAddr, vRlogSessDisconnect=vRlogSessDisconnect, vLtNodeGroups=vLtNodeGroups, vRlogSessEntry=vRlogSessEntry, vRlogSessLocalAddr=vRlogSessLocalAddr, vLtSlotPerCkt=vLtSlotPerCkt, vProfCurrNumber=vProfCurrNumber, vProfPadChar=vProfPadChar, vPortHandshake=vPortHandshake, vPortAbsoluteTimer=vPortAbsoluteTimer, vSnmpTrapDestColdEnable=vSnmpTrapDestColdEnable, vTelSessLocalEcho=vTelSessLocalEcho, vPortState=vPortState, vNsTable=vNsTable, vPortRIstate=vPortRIstate, fmxServerDevice=fmxServerDevice, vIpMaxAddr=vIpMaxAddr, vArpConfirmTimer=vArpConfirmTimer, vRlogSessTable=vRlogSessTable, vPortFlowType=vPortFlowType, protNone=protNone, fmxbd=fmxbd, vPortLoginPassword=vPortLoginPassword, vQueEntryNumber=vQueEntryNumber, vSecEnable=vSecEnable, vProfRemoteBinary=vProfRemoteBinary, fmxTcp=fmxTcp, vPortAutoConnect=vPortAutoConnect, vSysEtherType=vSysEtherType, vRlogSessTermType=vRlogSessTermType, vProfDomain=vProfDomain, vSvcQueueEnable=vSvcQueueEnable, vSvcRating=vSvcRating, vHostEntry=vHostEntry, vPortRemoteModify=vPortRemoteModify, vProfDataMark=vProfDataMark, vTcpIpPrecedence=vTcpIpPrecedence, vTcpTimerInterval=vTcpTimerInterval, service=service, fmxRlogin=fmxRlogin, vTelSessEntry=vTelSessEntry, vSvcIdent=vSvcIdent, vTelSessEndRecord=vTelSessEndRecord, vTelSessCrFromTerm=vTelSessCrFromTerm, vPortModemControl=vPortModemControl, vLtNumber=vLtNumber, vPortXonMark=vPortXonMark, vPortIndex=vPortIndex, vPortBreakMode=vPortBreakMode, vLtMcastTimer=vLtMcastTimer, vQueNodeName=vQueNodeName, vPortPrefPort=vPortPrefPort, vLtSessEntry=vLtSessEntry, vRlogSessRemAddr=vRlogSessRemAddr, vTelSessPadChar=vTelSessPadChar, vTcpSegSize=vTcpSegSize, vSecStatus=vSecStatus, vPortConsoleIndex=vPortConsoleIndex, vHostCurrNumber=vHostCurrNumber, vSnmpTrapDestTable=vSnmpTrapDestTable, vPortSessionLimit=vPortSessionLimit, vQueSvcName=vQueSvcName, vPortBroadcast=vPortBroadcast, vProfTcpPort=vProfTcpPort, vTelSessRemoteEcho=vTelSessRemoteEcho, vPortType=vPortType, vProfEntry=vProfEntry, vProfEndRecord=vProfEndRecord, devices=devices, vHostHostname=vHostHostname, vHostStatus=vHostStatus, fmxServerMib=fmxServerMib, fmxHostname=fmxHostname, vSvcVirtualText=vSvcVirtualText, vPortSpeed=vPortSpeed, vTelSessCurrNumber=vTelSessCurrNumber, fmxQueue=fmxQueue, vTelSessBreak=vTelSessBreak, vTelSessLocalBinary=vTelSessLocalBinary, vPortPrompt=vPortPrompt, vNsTTL=vNsTTL, fmxTelnet=fmxTelnet, vProfCrFromTerm=vProfCrFromTerm, vTacAddress=vTacAddress, vPortUserName=vPortUserName, vSvcCurrNumber=vSvcCurrNumber, vSvcLtEnable=vSvcLtEnable, vPortInterrupts=vPortInterrupts, vTcpSendQSize=vTcpSendQSize, vProfTable=vProfTable, vSecCurrNumber=vSecCurrNumber, vPortParityType=vPortParityType, vPortForwSwitch=vPortForwSwitch, vHostTTL=vHostTTL, vTelSessAttention=vTelSessAttention, vSecTable=vSecTable, vLtSessState=vLtSessState, vPortPasswordEnable=vPortPasswordEnable, vProfConcatenate=vProfConcatenate, vTelSessTable=vTelSessTable, terminal_server=terminal_server, vLtMaxNodes=vLtMaxNodes, vTelSessRemAddr=vTelSessRemAddr, port=port, vTelSessIpTTL=vTelSessIpTTL, fmxIp=fmxIp, vSecMask=vSecMask, vPortPrefMode=vPortPrefMode, vProfPadLength=vProfPadLength, vPortVerification=vPortVerification, vSysSecondaryBoot=vSysSecondaryBoot, vProfIpTTL=vProfIpTTL, vSnmpTrapDestCurrNumber=vSnmpTrapDestCurrNumber, vRlogSessOrigin=vRlogSessOrigin, serverProtocol=serverProtocol, vPortCharsDropped=vPortCharsDropped, vPortSignalCheck=vPortSignalCheck, vTelCourierText=vTelCourierText, protRlogin=protRlogin, vSysMaintenancePassword=vSysMaintenancePassword, vPortGroups=vPortGroups, fmxNameserver=fmxNameserver, fibronics=fibronics, vLtSessDisconnect=vLtSessDisconnect, serverMibs=serverMibs, vPortLogoutMsgEnable=vPortLogoutMsgEnable, vPortPrefNode=vPortPrefNode, vSvcRatingMode=vSvcRatingMode, vPortAbsoluteLogout=vPortAbsoluteLogout, vPortRcvChars=vPortRcvChars, vSvcTable=vSvcTable, vPortLoginMsgEnable=vPortLoginMsgEnable, vLtTotalRetranPkts=vLtTotalRetranPkts, vPortDSRstate=vPortDSRstate, vSvcPassword=vSvcPassword, vSnmpReadCommunity=vSnmpReadCommunity, vLtKeepaliveTimer=vLtKeepaliveTimer, vArpRetryMax=vArpRetryMax, fmxIpSecurity=fmxIpSecurity, vProfIpPrecedence=vProfIpPrecedence, vSvcProfile=vSvcProfile, vPortDialup=vPortDialup, vSysBroadband=vSysBroadband, vSnmpReadWriteCommunity=vSnmpReadWriteCommunity, vSnmpTrapDestStatus=vSnmpTrapDestStatus, vSvcTcpPort=vSvcTcpPort, vProfNop=vProfNop, vTelSessDataMark=vTelSessDataMark, vLtTotalRcvPkts=vLtTotalRcvPkts, vQuePortName=vQuePortName, vSvcRawEnable=vSvcRawEnable, vArpRetryTimeout=vArpRetryTimeout, vLtTotalNodeDiscards=vLtTotalNodeDiscards, vQueMaxEntries=vQueMaxEntries, vTelSessAbortOutput=vTelSessAbortOutput, vPortCharSize=vPortCharSize, vPortProfile=vPortProfile, vPortAccess=vPortAccess)
mibBuilder.exportSymbols("FMX1830", vTelSessTermType=vTelSessTermType, vLtSessNodeName=vLtSessNodeName, Character=Character, vSvcEntry=vSvcEntry, vPortRing=vPortRing, vPortSignalCheckEnable=vPortSignalCheckEnable, vPortScreenType=vPortScreenType, vPortVirtualString=vPortVirtualString, vProfLocalEcho=vProfLocalEcho, fmxArp=fmxArp, vProfBreak=vProfBreak, vPortInactiveLogout=vPortInactiveLogout, vPortLock=vPortLock, vLtSessDestName=vLtSessDestName, slot=slot, vProfEraseLine=vProfEraseLine, vPortInFlowState=vPortInFlowState, vNsEntry=vNsEntry, fmxProfile=fmxProfile, vIpMaxRoutes=vIpMaxRoutes, vTacHostname=vTacHostname, vPortLocalSwitch=vPortLocalSwitch, vProfTcpTimeout=vProfTcpTimeout, vProfTcpKeepalive=vProfTcpKeepalive, vProfStatus=vProfStatus, vNsHostname=vNsHostname, vTelCourierEnable=vTelCourierEnable, vLtRcvCorruptPkts=vLtRcvCorruptPkts, fmxTacacs=fmxTacacs, LtGroupList=LtGroupList, vTelSessNullPass=vTelSessNullPass, vTacStatus=vTacStatus, vPortFailover=vPortFailover, vPortCTSstate=vPortCTSstate, vSvcVirtualEnable=vSvcVirtualEnable, vTelSessOrigin=vTelSessOrigin, vPortXoffMark=vPortXoffMark, vNsStatus=vNsStatus, vRlogSessIndex=vRlogSessIndex, vLtMaxCkts=vLtMaxCkts, vSysReboot=vSysReboot, vSvcStatus=vSvcStatus, vProfName=vProfName, vQueTable=vQueTable, vSnmpWriteEnable=vSnmpWriteEnable, vSysIdentifier=vSysIdentifier, fmxService=fmxService, vLtReqAccepted=vLtReqAccepted, vPortOverrunErrs=vPortOverrunErrs, vPortOutFlowState=vPortOutFlowState, vTelSessRemoteBinary=vTelSessRemoteBinary, vSnmpTrapDestEntry=vSnmpTrapDestEntry, vPortName=vPortName, vArpMaxEntries=vArpMaxEntries, vPortBreakDuration=vPortBreakDuration, vSnmpTrapDestAddr=vSnmpTrapDestAddr, vSysRemoteBoot=vSysRemoteBoot, vPortDSRlogout=vPortDSRlogout, vTcpChecksumEnable=vTcpChecksumEnable, vTelSessUserTimeout=vTelSessUserTimeout, vSysBootFilePath=vSysBootFilePath, vSysBootFileName=vSysBootFileName, vRlogSessPortIndex=vRlogSessPortIndex, vRlogSessLocalTcpPort=vRlogSessLocalTcpPort, vTacEntry=vTacEntry, vPortTacacsEnable=vPortTacacsEnable, vTelSessPadLength=vTelSessPadLength, vLtMaxSvcs=vLtMaxSvcs, vLtSessPortIndex=vLtSessPortIndex, vPortBroadcastEnable=vPortBroadcastEnable, vTacServerCurrNumber=vTacServerCurrNumber, vPortSecurityEnable=vPortSecurityEnable, vTelSessGoAhead=vTelSessGoAhead, vProfCrToNet=vProfCrToNet, vPortTable=vPortTable, vSnmpWriteCommunity=vSnmpWriteCommunity, vLtCktTimer=vLtCktTimer, vSecIndex=vSecIndex, vProfRemoteEcho=vProfRemoteEcho, server=server, vNsRequestMode=vNsRequestMode, fmxPort=fmxPort, vPortCurrSessNumber=vPortCurrSessNumber, vPortBackSwitch=vPortBackSwitch, vTelSessKeepalive=vTelSessKeepalive)
|
#
# @lc app=leetcode id=78 lang=python3
#
# [78] Subsets
#
# https://leetcode.com/problems/subsets/description/
#
# algorithms
# Medium (64.66%)
# Likes: 5346
# Dislikes: 109
# Total Accepted: 728.5K
# Total Submissions: 1.1M
# Testcase Example: '[1,2,3]'
#
# Given an integer array nums of unique elements, return all possible subsets
# (the power set).
#
# The solution set must not contain duplicate subsets. Return the solution in
# any order.
#
#
# Example 1:
#
#
# Input: nums = [1,2,3]
# Output: [[],[1],[2],[1,2],[3],[1,3],[2,3],[1,2,3]]
#
#
# Example 2:
#
#
# Input: nums = [0]
# Output: [[],[0]]
#
#
#
# Constraints:
#
#
# 1 <= nums.length <= 10
# -10 <= nums[i] <= 10
# All the numbers of nums are unique.
#
#
#
# @lc code=start
class Solution:
def subsets(self, nums: List[int]) -> List[List[int]]:
res = []
self._dfs(nums, [], res, 0)
return res
def _dfs(self, nums, curr, res, start):
# exit
res.append(curr[:])
for i in range(start, len(nums)):
curr.append(nums[i])
self._dfs(nums, curr, res, i + 1)
curr.pop()
# @lc code=end
|
"""
CS241 Checkpoint 02B
Written by Chad Macbeth
"""
### Get file name from the user
def get_filename():
filename = input("Enter file: ")
return filename
### Open the file and analyze words and lines
### Returns a tuple (word count, line count)
def read_file(filename):
file_in = open(filename, "r")
line_count = 0
word_count = 0
for line in file_in: # Loop through each line of the file
line_count += 1
words = line.split() # Create a list of words from the line (default is spaces)
word_count += len(words) # Count the number of words in the list
file_in.close()
return (word_count, line_count)
### Driver to test funtions
def main():
filename = get_filename()
(word_count, line_count) = read_file(filename)
print("The file contains {} lines and {} words." .format(line_count, word_count))
if __name__ == "__main__":
main()
|
REDIS_URL = 'redis://redis/0'
ERROR_NO_IMAGE = 'Please provide an image'
ERROR_NO_TEXT = 'Please provide some text'
MAX_SIZE = (512, 512)
# Where to store the models weights
# (except for Keras' that are stored in ~/.keras)
WEIGHT_PATH = './weights'
# Original model source: https://drive.google.com/drive/folders/0B_rootXHuswsZ0E4Mjh1ZU5xZVU
DEEPLAB_URL = 'http://eliot.andres.free.fr/models/deeplab_resnet.ckpt'
DEEPLAB_FILENAME = 'deeplab_resnet.ckpt'
SSD_INCEPTION_URL = 'http://download.tensorflow.org/models/object_detection/ssd_inception_v2_coco_11_06_2017.tar.gz'
SSD_INCEPTION_FILENAME = 'ssd_inception_v2_coco_11_06_2017.tar.gz'
|
s = input()
print(any(char.isalnum() for char in s))
print(any(char.isalpha() for char in s))
print(any(char.isdigit() for char in s))
print(any(char.islower() for char in s))
print(any(char.isupper() for char in s)) |
"""Kata url: https://www.codewars.com/kata/544675c6f971f7399a000e79."""
def string_to_number(s: int) -> int:
return int(s)
|
# -*- coding: utf-8 -*-
# @Author: jpch89
# @Email: jpch89@outlook.com
# @Time: 2018/7/28 20:29
def convert_number(s):
try:
return int(s)
except ValueError:
return None
|
# This test verifies that __name__ == "__main__" works properly in Python Loader
if __name__ == "__main__":
print('Test: 1234567890abcd')
|
def run():
my_list = [1, 'Hi', True, 4.5]
my_dict = {
"first_name": "Hernan",
"last_name": "Chamorro",
}
super_list = [
{ "first_name": "Hernan", "last_name": "Chamorro",},
{ "first_name": "Gustavo", "last_name": "Ramon",},
{ "first_name": "Bruno", "last_name": "Facundo",},
{ "first_name": "Geronimo", "last_name": "Atahualpa",},
]
super_dict = {
"natural_nums": [1, 2, 3, 4, 5, 6, 7, 8, 9, 10],
"integer_nums": [-2, -1, 0, 1, 2, 3, 4, 5,],
"floating_nums": [0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0],
}
for key, value in super_dict.items():
print(key, "-", value)
for dict in super_list:
print(dict['first_name'], "-", dict['last_name'])
if __name__ == '__main__':
run() |
friends = ['Mark', 'Simona', 'Paul', 'Jeremy', 'Colin', 'Sophie']
counter = 0
for counter, friend in enumerate(friends, start=1):
print(counter, friend)
print(list(enumerate(friends)))
print(dict(enumerate(friends)))
|
def removeElement_1(nums, val):
"""
Brute force solution
Don't preserve order
"""
# count the frequency of the val
val_freq = 0
for num in nums:
if num == val:
val_freq += 1
# print(val_freq)
new_len = len(nums) - val_freq
# remove the element from the list
i = 0
j = len(nums) - 1
while val_freq > 0 and i < new_len:
if nums[i] == val:
print('index:', i)
while j > 0 and nums[j] == val:
j -= 1
print('j:', j)
# swap elements
temp = nums[i]
nums[i] = nums[j]
nums[j] = temp
val_freq -= 1
j -= 1
i += 1
return new_len
def removeElement_2(nums, val):
"""
Using one loop and two pointers
Don't preserve order
"""
# Remove the elment from the list
i = 0
j = len(nums) - 1
count = 0
while i < j:
if nums[i] == val:
while j > i and nums[j] == val:
j -= 1
print('i:', i, 'j:', j)
# swap elements
temp = nums[i]
nums[i] = nums[j]
nums[j] = temp
count += 1
print(nums)
i += 1
if count == 0:
j = j + 1
return j
def main():
arr = [int(j) for j in input().split()]
val = int(input())
ans = removeElement_2(arr, val)
print(ans)
print(arr[:ans])
if __name__ == '__main__':
main()
|
print("Gerador de PA")
inicio = int(input("Primeiro termo: "))
razao = int(input("Razão: "))
cont = 1
while cont <= 10:
print(inicio, end=", " )
inicio += razao
cont += 1
print("acabou !!") |
"""
给定一个已按照**升序排列**的有序数组,找到两个数使得它们相加之和等于目标数
返回这两个数的index, 从1开始(不是从0开始)
"""
sample_numbers = [2, 7, 11, 15]
def twoSum(array, target):
# assume the array already been sorted
low, high = 0, len(array) - 1
while low < high:
result = array[low] + array[high]
if result < target:
low += 1
elif result > target:
high -= 1
elif result == target:
return [low + 1, high + 1]
print(f"For input array: {sample_numbers}, two sum answer: "
f"\n {twoSum(array=sample_numbers, target=9)}")
|
"""
Building a Pie Chart
A pie chart is a circular graphical representation of a dataset, where each category frequency is represented by a slice (or circular sector) with an amplitude in degrees given by the single frequency percentage over the total of frequencies. You can obtain the degrees of sectors following these steps:
Calculate frequencies total.
Calculate percentage of every category frequency dividing it by the frequencies total.
Transform every percentage in degrees multiplying it for 360.
You are given a dictionary data with keys being the data categories (represented by letters) and values being the data frequencies. Implement a function that returns a map to design a pie chart, like to say the same dictionary with values transformed in degrees instead of frequencies. Round final values to the nearest tenth.
Pie Chart
Examples
pie_chart({ "a": 1, "b": 2 }) ➞ { "a": 120, "b": 240 }
pie_chart({ "a": 30, "b": 15, "c": 55 }) ➞ { "a": 108, "b": 54, "c": 198 }
pie_chart({ "a": 8, "b": 21, "c": 12, "d": 5, "e": 4 }) ➞ { "a": 57.6, "b": 151.2, "c": 86.4, "d": 36, "e": 28.8 }
"""
def pie_chart(data):
a, d = (sum(data.values())), {}
for i in data:
d.update({i: round(data[i]*360/a,1)})
return d
#pie_chart({ "a": 1, "b": 2 }) #➞ { "a": 120, "b": 240 }
pie_chart({ "a": 30, "b": 15, "c": 55 }) #➞ { "a": 108, "b": 54, "c": 198 }
#pie_chart({ "a": 8, "b": 21, "c": 12, "d": 5, "e": 4 }) #➞ { "a": 57.6, "b": 151.2, "c": 86.4, "d": 36, "e": 28.8 } |
"""
Programa 110
Área de estudos.
data 08.12.2020 (Indefinida) Hs
@Autor: Abraão A. Silva
"""
# Declaração e inicialização das variáveis compostas.
codigo_objetos, relatorios = list(), list()
# Imprimi a tabela, recolhe as informações, faz verificações de validez, por fim armazena.
while True:
print('{:-^46}'.format(' Opções de Relatório '))
print('\n',
'Necessita de esfera'+' '*23+'[1]'+'\n',
'Necessita de limpeza'+' '*22+'[2]'+'\n',
'Necessita troca de cabo ou conector'+' '*7+'[3]'+'\n',
'Inutilizavel'+' '*30+'[4]'+'\n',
'\n',
'-'*46+'\n',
)
codigo_mouse = int(input('Código identificador.: '))
if codigo_mouse == 0:
print('Programa encerrado...')
print()
break
if codigo_mouse in codigo_objetos:
print('Este objeto já foi cadastrado.')
print()
continue
relatorio = int(input('Situação do Equipamento.: '))
if relatorio < 0 or relatorio > 4:
print('Opção inválida.')
print()
continue
codigo_objetos.append(codigo_mouse)
relatorios.append(relatorio)
print()
# Definindo o percentual
percentual = list()
for item in range(1, 5):
percentagem = (relatorios.count(item) * 100) / len(relatorios)
percentual.append(percentagem)
# Formatando uma saída.
print(f' Quantidade de Mouses: {len(codigo_objetos)}')
print('\n',
f'[1]- Necessita da esfera'+f'{relatorios.count(1)}'.rjust(25)+f'{percentual[0]}%'.rjust(20)+'\n',
f'[2]- Necessita de limpeza'+f'{relatorios.count(2)}'.rjust(24)+f'{percentual[1]}%'.rjust(20)+'\n',
f'[3]- Necessita troca cabo ou conector'+f'{relatorios.count(3)}'.rjust(12)+f'{percentual[2]}%'.rjust(20)+'\n',
f'[4]- Inutílizavel'+f'{relatorios.count(4)}'.rjust(32)+f'{percentual[3]}%'.rjust(20)+'\n',
)
|
#
# @lc app=leetcode id=109 lang=python3
#
# [109] Convert Sorted List to Binary Search Tree
#
# https://leetcode.com/problems/convert-sorted-list-to-binary-search-tree/description/
#
# algorithms
# Medium (49.90%)
# Likes: 2801
# Dislikes: 95
# Total Accepted: 287.7K
# Total Submissions: 568.6K
# Testcase Example: '[-10,-3,0,5,9]'
#
# Given the head of a singly linked list where elements are sorted in ascending
# order, convert it to a height balanced BST.
#
# For this problem, a height-balanced binary tree is defined as a binary tree
# in which the depth of the two subtrees of every node never differ by more
# than 1.
#
#
# Example 1:
#
#
# Input: head = [-10,-3,0,5,9]
# Output: [0,-3,9,-10,null,5]
# Explanation: One possible answer is [0,-3,9,-10,null,5], which represents the
# shown height balanced BST.
#
#
# Example 2:
#
#
# Input: head = []
# Output: []
#
#
# Example 3:
#
#
# Input: head = [0]
# Output: [0]
#
#
# Example 4:
#
#
# Input: head = [1,3]
# Output: [3,1]
#
#
#
# Constraints:
#
#
# The number of nodes in head is in the range [0, 2 * 10^4].
# -10^5 <= Node.val <= 10^5
#
#
#
# @lc code=start
# Definition for singly-linked list.
# class ListNode:
# def __init__(self, val=0, next=None):
# self.val = val
# self.next = next
# Definition for a binary tree node.
# class TreeNode:
# def __init__(self, val=0, left=None, right=None):
# self.val = val
# self.left = left
# self.right = right
class Solution:
def sortedListToBST(self, head: ListNode) -> TreeNode:
return self.create_bst(head)
def create_bst(self, head):
if not head or not head.next:
return TreeNode(head.val) if head else None
# find mid treenode
slow, fast = head, head.next
while fast.next and fast.next.next:
slow = slow.next
fast = fast.next.next
next_node = slow.next
slow.next = None
root = TreeNode(next_node.val)
left = self.create_bst(head)
right = self.create_bst(next_node.next)
root.left = left
root.right = right
return root
# @lc code=end
|
# Copyright ClusterHQ Inc. See LICENSE file for details.
"""
Tests for shared flocker components.
"""
|
class Tree_node:
def __init__(self,data):
self.data = data
self.parent = None
self.left = None
self.right = None
def __repr__(self):
return repr(self.data)
def add_left(self, node):
self.left = node
if node is not None:
node.parent = self
def add_right(self, node):
self.right = node
if node is not None:
node.parent = self
def bst_insert(root, node):
last_node = None
current_node = root
while current_node is not None:
last_node = current_node
if node.data < current_node.data:
current_node = current_node.left
else:
current_node = current_node.right
if last_node is None:
root = node
elif node.data < last_node.data:
last_node.add_left(node)
else:
last_node.add_right(node)
return root
"""
10
/ \
5 17
/ \ / \
3 7 12 19
/ \
1 4
"""
def create_bst():
root = Tree_node(10)
for item in [5, 17, 3, 7, 12, 9, 1, 4]:
node = Tree_node(item)
root = bst_insert(root, node)
return root
def bst_search(node, key):
while node is not None:
if node.data == key:
return node
if key < node.data:
node = node.left
else:
node = node.right
return node
if __name__ == '__main__':
root = create_bst()
print(root)
for key in [7, 8]:
print('Searching', key)
print(bst_search(root, key))
|
"""
Write a function that satisfies the following rules:
Return true if the string in the first element of the list contains all of the letters of the string in the second element of the list.
"""
def mutation(input_list):
short, long = sorted(map(lambda l: l.lower(), input_list), key=lambda item: len(item))
for letter in short:
if letter not in long:
return False
return True
if __name__ == "__main__":
print(mutation(["hello", "Hello"]))
print(mutation(["hello", "hey"]))
print(mutation(["Alien", "line"]))
print(mutation(["aaaaa", "aaaa"])) |
class Solution(object):
def numberOfBeams(self, bank):
"""
:type bank: List[str]
:rtype: int
"""
beams = 0
bank_len = len(bank)
if bank_len == 1:
return 0
else:
i = 0
j = 1
while(j < bank_len):
# does row i have any lasers?
sum_lasers_i = sum([int(x) for x in bank[i]])
if sum_lasers_i == 0:
i += 1
j = i + 1
else:
# does row j have any lasers?
sum_lasers_j = sum([int(x) for x in bank[j]])
if sum_lasers_j == 0:
j += 1
else:
beams += sum_lasers_i * sum_lasers_j
i = j
j += 1
return beams
def main():
bank = ["011001","000000","010100","001000"]
obj = Solution()
return obj.numberOfBeams(bank)
if __name__ == "__main__":
print(main())
|
def fatorial(num, show=False):
'''
-> calcula o fatorial de um número
:param num: o número a ser calculado
:param show: (opcional) mostrar ou não a conta
:return: o valor fatorial de um número num
'''
f = 1
for c in range(num, 0, -1):
f = f * c
if show == True:
print(f'{c}', end='')
print(' x ' if c >= 2 else ' = ', end='')
return f
n = int(input('você quer ver o fatorial de qual número?: '))
resp = ' '
while resp not in 'sn':
resp = str(input('você quer ver o calculo?: ')).lower().strip()[0]
if resp == 's':
print(fatorial(n, show=True))
else:
print(fatorial(n))
|
class RegularExpression():
def __init__(self, regexStr):
self.regexStr = regexStr
def __str__(self):
return self.regexStr
|
# @Fábio C Nunes - 24.06.20
def ficha(nome='<Desconhecido>', gols= 0):
print(f'O Jogador {nome} fez {gols} gols no campeonato.')
#Main
n = str(input('Nome do jogador: '))
gol = str(input('Nº de gols: '))
if gol.isnumeric():
gol = int(gol)
else:
gol = 0
if n.strip() == '':
ficha(gols=gol)
else:
ficha(n, gol)
|
def pythonic_solution(S, P, Q):
I = {'A': 1, 'C': 2, 'G': 3, 'T': 4}
# Obvious solution, scalable and compact. But slow for very large S
# with plenty of entropy.
result = []
for a, b in zip(P, Q):
i = min(S[a:b+1], key=lambda x: I[x])
result.append(I[i])
return result
def prefix_sum_solution(S, P, Q):
I = {'A': 1, 'C': 2, 'G': 3, 'T': 4}
# Faster version using prefix sums as hinted at by the lesson. But has a
# pretty large space vs time trade-off. It uses both a prefix sum array and
# a pigeonhole array to keep track fo the impact factor counts.
n = len(S)
# Create an array of n+1 pigeon holes to store counts for each impact
# factor.
PS = [[0, 0, 0, 0]] * (n + 1)
# Use prefix sum algorithm to store occurrences of each impact factor in
# its pigeon hole..
for k in range(1, n + 1):
PS[k] = PS[k - 1][:]
PS[k][I[S[k - 1]] - 1] += 1
result = []
for a, b in zip(P, Q):
# Use prefix sum pigeon holes to count occurences of impact factor for
# the slice in a, b.
hits = [i - j for i, j in zip(PS[b+1], PS[a])]
# This could be generalized into a loop to scan for hit counts. But
# Since our set is small we can optimize into if..elif..else
if hits[0]:
result.append(1)
elif hits[1]:
result.append(2)
elif hits[2]:
result.append(3)
else:
result.append(4)
return result
def solution(S, P, Q):
return prefix_sum_solution(S, P, Q)
def test_example():
assert [2, 4, 1] == solution('CAGCCTA', [2, 5, 0], [4, 5, 6])
def test_single():
assert [1] == solution('A', [0], [0])
def test_extreme_large_last():
S = ('T' * 99999) + 'A'
assert [1] == solution(S, [0], [99999])
|
class shapeCharacter:
rotationNumber = 1
def moveRight(self):
self.x1 = self.x1 + 1
self.x2 = self.x2 + 1
self.x3 = self.x3 + 1
self.x4 = self.x4 + 1
self.cordinates = [(self.y1,self.x1), (self.y2,self.x2), (self.y3,self.x3), (self.y4,self.x4)]
self.rotationCordinates = [(self.y1,self.x1), (self.y2,self.x2), (self.y3,self.x3), (self.y4,self.x4)]
def moveDown(self):
self.y1 = self.y1 + 1
self.y2+=1
self.y3+=1
self.y4+=1
self.cordinates = [(self.y1,self.x1), (self.y2,self.x2), (self.y3,self.x3), (self.y4,self.x4)]
self.rotationCordinates = [(self.y1,self.x1), (self.y2,self.x2), (self.y3,self.x3), (self.y4,self.x4)]
def moveLeft(self):
self.x1 = self.x1 - 1
self.x2 = self.x2 - 1
self.x3 = self.x3 - 1
self.x4 = self.x4 - 1
self.cordinates = [(self.y1,self.x1), (self.y2,self.x2), (self.y3,self.x3), (self.y4,self.x4)]
self.rotationCordinates = [(self.y1,self.x1), (self.y2,self.x2), (self.y3,self.x3), (self.y4,self.x4)]
def updateCords(self, update):
[(self.y1,self.x1), (self.y2,self.x2), (self.y3,self.x3), (self.y4,self.x4)] = update
self.cordinates = [(self.y1,self.x1), (self.y2,self.x2), (self.y3,self.x3), (self.y4,self.x4)]
class Square(shapeCharacter):
def __init__(self):
self.number = 1
self.y1, self.y2, self.y3, self.y4 = 0, 0, 1, 1
self.x1, self.x2, self.x3, self.x4 = 4, 5, 4, 5
self.cordinates = [(self.y1,self.x1), (self.y2,self.x2), (self.y3,self.x3), (self.y4,self.x4)]
self.rotationCordinates = [(self.y1,self.x1), (self.y2,self.x2), (self.y3,self.x3), (self.y4,self.x4)]
def rotate(self):
self.rotationNumber = 1
class LongPiece(shapeCharacter):
def __init__(self):
self.number = 2
self.y1, self.y2, self.y3, self.y4 = 0, 0, 0, 0
self.x1, self.x2, self.x3, self.x4 = 3, 4, 5, 6
self.cordinates = [(self.y1,self.x1), (self.y2,self.x2), (self.y3,self.x3), (self.y4,self.x4)]
self.rotationCordinates = [(self.y1,self.x1), (self.y2,self.x2), (self.y3,self.x3), (self.y4,self.x4)]
def rotate(self):
self.rotationNumber+=1
if self.rotationNumber % 2 != 0:
self.rotationCordinates = [(self.y1+1,self.x1-1), (self.y2,self.x2), (self.y3-1,self.x3+1), (self.y4-2,self.x4+2)]
if self.rotationNumber % 2 == 0:
self.rotationCordinates = [(self.y1-1,self.x1+1), (self.y2,self.x2), (self.y3+1,self.x3-1), (self.y4+2,self.x4-2)]
class TeePiece(shapeCharacter):
def __init__(self):
self.number = 3
self.y1, self.y2, self.y3, self.y4 = 0, 1, 1, 1
self.x1, self.x2, self.x3, self.x4 = 4, 3, 4, 5
self.cordinates = [(self.y1,self.x1), (self.y2,self.x2), (self.y3,self.x3), (self.y4,self.x4)]
self.rotationCordinates = [(self.y1,self.x1), (self.y2,self.x2), (self.y3,self.x3), (self.y4,self.x4)]
def rotate(self):
self.rotationNumber+=1
if self.rotationNumber % 4 == 0:
self.rotationCordinates = [(self.y1-1,self.x1+1), (self.y2,self.x2), (self.y3,self.x3), (self.y4,self.x4-2)]
elif self.rotationNumber % 3 == 0:
self.rotationCordinates = [(self.y1+1,self.x1-1), (self.y2,self.x2), (self.y3,self.x3), (self.y4,self.x4)]
elif self.rotationNumber % 2 == 0:
self.rotationCordinates = [(self.y1,self.x1), (self.y2+1,self.x2+1), (self.y3,self.x3), (self.y4,self.x4)]
else:
self.rotationCordinates = [(self.y1,self.x1), (self.y2-1,self.x2-1), (self.y3,self.x3), (self.y4,self.x4+2)]
self.rotationNumber = 1
class LeftEl(shapeCharacter):
def __init__(self):
self.number = 4
self.y1, self.y2, self.y3, self.y4 = 0, 1, 1, 1
self.x1, self.x2, self.x3, self.x4 = 3, 3, 4, 5
self.cordinates = [(self.y1,self.x1), (self.y2,self.x2), (self.y3,self.x3), (self.y4,self.x4)]
self.rotationCordinates = [(self.y1,self.x1), (self.y2,self.x2), (self.y3,self.x3), (self.y4,self.x4)]
def rotate(self):
self.rotationNumber+=1
if self.rotationNumber % 4 == 0:
self.rotationCordinates = [(self.y1,self.x1-2), (self.y2+1,self.x2-1), (self.y3,self.x3), (self.y4-1,self.x4+1)]
elif self.rotationNumber % 3 == 0:
self.rotationCordinates = [(self.y1+2,self.x1), (self.y2+1,self.x2+1), (self.y3,self.x3), (self.y4-1,self.x4-1)]
elif self.rotationNumber % 2 == 0:
self.rotationCordinates = [(self.y1,self.x1+2), (self.y2-1,self.x2+1), (self.y3,self.x3), (self.y4+1,self.x4-1)]
else:
self.rotationCordinates = [(self.y1-2,self.x1), (self.y2-1,self.x2-1), (self.y3,self.x3), (self.y4+1,self.x4+1)]
self.rotationNumber = 1
class RightEl(shapeCharacter):
def __init__(self):
self.number = 5
self.y1, self.y2, self.y3, self.y4 = 0, 1, 1, 1
self.x1, self.x2, self.x3, self.x4 = 5, 3, 4, 5
self.cordinates = [(self.y1,self.x1), (self.y2,self.x2), (self.y3,self.x3), (self.y4,self.x4)]
self.rotationCordinates = [(self.y1,self.x1), (self.y2,self.x2), (self.y3,self.x3), (self.y4,self.x4)]
def rotate(self):
self.rotationNumber+=1
if self.rotationNumber % 4 == 0:
self.rotationCordinates = [(self.y1-2,self.x1), (self.y2+1,self.x2-1), (self.y3,self.x3), (self.y4-1,self.x4+1)]
elif self.rotationNumber % 3 == 0:
self.rotationCordinates = [(self.y1,self.x1-2), (self.y2+1,self.x2+1), (self.y3,self.x3), (self.y4-1,self.x4-1)]
elif self.rotationNumber % 2 == 0:
self.rotationCordinates = [(self.y1+2,self.x1), (self.y2-1,self.x2+1), (self.y3,self.x3), (self.y4+1,self.x4-1)]
else:
self.rotationCordinates = [(self.y1,self.x1+2), (self.y2-1,self.x2-1), (self.y3,self.x3), (self.y4+1,self.x4+1)]
self.rotationNumber = 1
class ZigZagRight(shapeCharacter):
def __init__(self):
self.number = 6
self.y1, self.y2, self.y3, self.y4 = 0, 0, 1, 1
self.x1, self.x2, self.x3, self.x4 = 4, 5, 3, 4
self.cordinates = [(self.y1,self.x1), (self.y2,self.x2), (self.y3,self.x3), (self.y4,self.x4)]
self.rotationCordinates = [(self.y1,self.x1), (self.y2,self.x2), (self.y3,self.x3), (self.y4,self.x4)]
def rotate(self):
self.rotationNumber+=1
if self.rotationNumber % 4 == 0:
self.rotationCordinates = [(self.y1-1,self.x1-1), (self.y2-2,self.x2), (self.y3+1,self.x3-1), (self.y4,self.x4)]
elif self.rotationNumber % 3 == 0:
self.rotationCordinates = [(self.y1+1,self.x1-1), (self.y2,self.x2-2), (self.y3+1,self.x3+1), (self.y4,self.x4)]
elif self.rotationNumber % 2 == 0:
self.rotationCordinates = [(self.y1+1,self.x1+1), (self.y2+2,self.x2), (self.y3-1,self.x3+1), (self.y4,self.x4)]
else:
self.rotationCordinates = [(self.y1-1,self.x1+1), (self.y2,self.x2+2), (self.y3-1,self.x3-1), (self.y4,self.x4)]
self.rotationNumber = 1
class ZigZagLeft(shapeCharacter):
def __init__(self):
self.number = 7
self.y1, self.y2, self.y3, self.y4 = 0, 0, 1, 1
self.x1, self.x2, self.x3, self.x4 = 3, 4, 4, 5
self.cordinates = [(self.y1,self.x1), (self.y2,self.x2), (self.y3,self.x3), (self.y4,self.x4)]
self.rotationCordinates = [(self.y1,self.x1), (self.y2,self.x2), (self.y3,self.x3), (self.y4,self.x4)]
def rotate(self):
self.rotationNumber+=1
if self.rotationNumber % 4 == 0:
self.rotationCordinates = [(self.y1,self.x1-2), (self.y2-1,self.x2-1), (self.y3,self.x3), (self.y4-1,self.x4+1)]
elif self.rotationNumber % 3 == 0:
self.rotationCordinates = [(self.y1+2,self.x1), (self.y2+1,self.x2-1), (self.y3,self.x3), (self.y4-1,self.x4-1)]
elif self.rotationNumber % 2 == 0:
self.rotationCordinates = [(self.y1,self.x1+2), (self.y2+1,self.x2+1), (self.y3,self.x3), (self.y4+1,self.x4-1)]
else:
self.rotationCordinates = [(self.y1-2,self.x1), (self.y2-1,self.x2+1), (self.y3,self.x3), (self.y4+1,self.x4+1)]
self.rotationNumber = 1
#%% |
""" My implementation of fizzbuzz. """
def fizzbuzz(number):
if number % 3 == 0 and number % 5 == 0:
print ('fizzbuzz')
elif number % 3 == 0:
print ('fizz')
elif number % 5 != 0:
print ('buzz')
if __name__ == '__main__':
fizzbuzz(15)
|
# class Solution(object):
# def isValid(self, s):
#
class Solution:
def isValid(self, s):
stack = []
dic = {']' :'[', '}':'{', ')':'('}
for c in s:
if c in dic.values():
stack.append(c)
elif c in dic.keys():
if stack == [] or dic[c] != stack.pop():
return False
else:
return False
return stack == []
# def isValid(self, s):
# # python replace
# n = len(s)
# if n == 0:
# return True
#
# if n % 2 != 0:
# return False
#
# while '()' in s or '{}' in s or '[]' in s:
# s = s.replace('{}', '').replace('()', '').replace('[]', '')
#
# if s == '':
# return True
# else:
# return False
|
'''
Project: SingleLinkedList
File: SingleLinkedList.py
Author: Sanjay Vyas
Description:
Implementation of a simple linked list in Python
Revision History:
2018-November-17: Initial Creation
Copyright (c) 2019 Sanjay Vyas
License:
This code is meant for learning algorithms and writing clean code
Do not copy-paste it, it may not help in understanding the code
You are required to understand the code and then type it yourself
Disclaimer:
This code may contain intentional and unintentional bugs
There are no warranties of the code working correctly
'''
class Node:
'''
Node class represents a single node in the linked list
It holds a value and pointer to next
'''
def __init__(self, value):
'''
Constructor
'''
self.value = value
self.next = None
class List:
'''
List represents a list of Nodes
It holds head (pointing to first node) and tail (pointing to last node)
'''
def __init__(self):
# Create head and tail fields
self.head = None
self.tail = None
def __del__(self):
pass
def push_back(self, value):
'''
Create a new node and add it to the end of the list
'''
node = Node(value)
# Check if its the first node created
# In which case, make head and tail point to it
if (self.head is None):
self.head = node
else:
# If its not the first node, then it will next of tail
self.tail.next = node
self.tail = node
def push_front(self, value):
'''
Create a new node and add it to the beginning of the list
'''
node = Node(value)
# Check if its the first node created
# In which case, make head and tail point to it
if (self.head is None):
self.tail = node
else:
# If its not the first node, then it will be before head
node.next = self.head
self.head = node
def print_list(self):
'''
Print the entire list from head to tail
'''
# Start with head
node=self.head
# While we don't reach the tail, keep printing the value
while node is not None:
print(node.value)
node=node.next
if __name__ == '__main__':
obj = List()
i=1
while i !=0:
i=int(raw_input("Enter value: "))
if i != 0:
obj.push_back(i)
obj.print_list()
i=1
while i !=0:
i=int(raw_input("Enter value: "))
if i != 0:
obj.push_front(i)
obj.print_list()
|
"""
[2015-12-09] Challenge #244 [Easy]er - Array language (part 3) - J Forks
https://www.reddit.com/r/dailyprogrammer/comments/3wdm0w/20151209_challenge_244_easyer_array_language_part/
This challenge does not require doing the previous 2 parts. If you want something harder, the rank conjunction from
Wednesday's challenge requires concentration.
# Forks
A fork is a function that takes 3 functions that are all "duck defined" to take 2 parameters with 2nd optional or
ignorable.
for 3 functions, `f(y,x= default):` , `g(y,x= default):` , `h(y,x= default):` , where the function g is a "genuine" 2
parameter function,
the call `Fork(f,g,h)` executes the function composition:
g(f(y,x),h(y,x)) (data1,data2)
**1. Produce the string that makes the function call from string input:**
sum divide count
(above input are 3 function names to Fork)
**2. Native to your favorite language, create an executable function from above string input**
or 3. create a function that takes 3 functions as input, and returns a function.
Fork(sum, divide ,count) (array data)
should return the mean of that array. Where divide works similarly to add from Monday's challenge.
**4. Extend above functions to work for any odd number of function parameters**
for 5 parameters, Fork(a, b, c, d, e) is:
b(a, Fork(c,d,e)) NB. should expand this if producing strings.
# challenge input
(25 functions)
a b c d e f g h i j k l m n o p q r s t u v w x y
"""
def main():
pass
if __name__ == "__main__":
main()
|
#MODIFICANDO UMA TUPLA
tpl_values = (10, 14, 16, 20)
try:
tpl_values[1] = 26
except (TypeError) as err:
print(f"Error: {err}")
#ALTERANDO LISTA DENTRO DE UMA TUPLA
tpl_values = (10, 14, 16, 20, [24,26])
try:
tpl_values[4].append(30)
print(tpl_values)
except (TypeError) as err:
print(f"Error: {err}") |
# -*- coding: utf-8 -*-
def __download(core, filepath, request):
request['stream'] = True
with core.request.execute(core, request) as r:
with open(filepath, 'wb') as f:
core.shutil.copyfileobj(r.raw, f)
def __extract_gzip(core, archivepath, filename):
filepath = core.os.path.join(core.utils.temp_dir, filename)
if core.utils.py2:
with open(archivepath, 'rb') as f:
gzip_file = f.read()
with core.gzip.GzipFile(fileobj=core.utils.StringIO(gzip_file)) as gzip:
with open(filepath, 'wb') as f:
f.write(gzip.read())
f.flush()
else:
with core.gzip.open(archivepath, 'rb') as f_in:
with open(filepath, 'wb') as f_out:
core.shutil.copyfileobj(f_in, f_out)
return filepath
def __extract_zip(core, archivepath, filename, episodeid):
sub_exts = ['.srt', '.sub']
sub_exts_secondary = ['.smi', '.ssa', '.aqt', '.jss', '.ass', '.rt', '.txt']
try:
using_libvfs = False
with open(archivepath, 'rb') as f:
zipfile = core.zipfile.ZipFile(core.BytesIO(f.read()))
namelist = core.utils.get_zipfile_namelist(zipfile)
except:
using_libvfs = True
archivepath_ = core.utils.quote_plus(archivepath)
(dirs, files) = core.kodi.xbmcvfs.listdir('archive://%s' % archivepath_)
namelist = [file.decode(core.utils.default_encoding) if core.utils.py2 else file for file in files]
subfile = core.utils.find_file_in_archive(core, namelist, sub_exts, episodeid)
if not subfile:
subfile = core.utils.find_file_in_archive(core, namelist, sub_exts_secondary, episodeid)
dest = core.os.path.join(core.utils.temp_dir, filename)
if not subfile:
try:
return __extract_gzip(core, archivepath, filename)
except:
try: core.os.remove(dest)
except: pass
try: core.os.rename(archivepath, dest)
except: pass
return dest
if not using_libvfs:
src = core.utils.extract_zipfile_member(zipfile, subfile, core.utils.temp_dir)
try: core.os.remove(dest)
except: pass
try: core.os.rename(src, dest)
except: pass
else:
src = 'archive://' + archivepath_ + '/' + subfile
core.kodi.xbmcvfs.copy(src, dest)
return dest
def __insert_lang_code_in_filename(core, filename, lang_code):
filename_chunks = core.utils.strip_non_ascii_and_unprintable(filename).split('.')
filename_chunks.insert(-1, lang_code)
return '.'.join(filename_chunks)
def __postprocess(core, filepath, lang_code):
try:
with open(filepath, 'rb') as f:
text_bytes = f.read()
if core.kodi.get_bool_setting('general.use_chardet'):
encoding = ''
if core.utils.py3:
detection = core.utils.chardet.detect(text_bytes)
detected_lang_code = core.kodi.xbmc.convertLanguage(detection['language'], core.kodi.xbmc.ISO_639_2)
if detection['confidence'] == 1.0 or detected_lang_code == lang_code:
encoding = detection['encoding']
if not encoding:
encoding = core.utils.code_pages.get(lang_code, core.utils.default_encoding)
text = text_bytes.decode(encoding)
else:
text = text_bytes.decode(core.utils.default_encoding)
try:
if all(ch in text for ch in core.utils.cp1251_garbled):
text = text.encode(core.utils.base_encoding).decode('cp1251')
elif all(ch in text for ch in core.utils.koi8r_garbled):
try:
text = text.encode(core.utils.base_encoding).decode('koi8-r')
except:
text = text.encode(core.utils.base_encoding).decode('koi8-u')
except: pass
try:
clean_text = core.utils.cleanup_subtitles(core, text)
if len(clean_text) > len(text) / 2:
text = clean_text
except: pass
with open(filepath, 'wb') as f:
f.write(text.encode(core.utils.default_encoding))
except: pass
def download(core, params):
core.logger.debug(lambda: core.json.dumps(params, indent=2))
core.shutil.rmtree(core.utils.temp_dir, ignore_errors=True)
core.kodi.xbmcvfs.mkdirs(core.utils.temp_dir)
actions_args = params['action_args']
lang_code = core.kodi.xbmc.convertLanguage(actions_args['lang'], core.kodi.xbmc.ISO_639_2)
filename = __insert_lang_code_in_filename(core, actions_args['filename'], lang_code)
archivepath = core.os.path.join(core.utils.temp_dir, 'sub.zip')
service_name = params['service_name']
service = core.services[service_name]
request = service.build_download_request(core, service_name, actions_args)
if actions_args.get('raw', False):
filepath = core.os.path.join(core.utils.temp_dir, filename)
__download(core, filepath, request)
else:
__download(core, archivepath, request)
if actions_args.get('gzip', False):
filepath = __extract_gzip(core, archivepath, filename)
else:
episodeid = actions_args.get('episodeid', '')
filepath = __extract_zip(core, archivepath, filename, episodeid)
__postprocess(core, filepath, lang_code)
if core.api_mode_enabled:
return filepath
listitem = core.kodi.xbmcgui.ListItem(label=filepath, offscreen=True)
core.kodi.xbmcplugin.addDirectoryItem(handle=core.handle, url=filepath, listitem=listitem, isFolder=False)
|
if __name__ == '__main__':
try:
main()
log.info("Script completed successfully")
except Exception as e:
log.critical("The script did not complete successfully")
log.exception(e)
sys.exit(1)
|
# Birthday Wishes
# Demonstrates keyword arguments and default parameter values
# День рождения
# Демонстрирует именованные аргументы и значения параметров по умолчанию
# positional parameters
# позиционные параметры
def birthday1(name, age):
print("С днём рождения, ", name, "!", " Вам сегодня исполняется ", age, ", не так ли?\n")
# parameters with default values
# параметры со значениями по умолчанию
def birthday2(name = "товарищ Иванов", age = 1):
print("С днём рождения, ", name, "!", " Вам сегодня исполняется ", age, ", не так ли?\n")
birthday1("товарищ Иванов", 1)
birthday1(1, "товарищ Иванов")
birthday1(name = "товарищ Иванов", age = 1)
birthday1(age = 1, name = "товарищ Иванов")
birthday2()
birthday2(name = "Катя")
birthday2(age = 12)
birthday2(name = "Катя", age = 12)
birthday2("Катя", 12)
|
bind = '127.0.0.1:8000'
workers = 3
user = 'web'
timeout = 120
|
user_input = input("Input two words separated by space to create key value pairs, or enter nothing to quit")
empty_dict = {}
while user_input != "":
words = user_input.split(" ")
if len(words) >= 2:
empty_dict[words[0]] = words[1]
else:
print("not enough words to create an entry")
user_input = input("Input two words separated by space to create key value pairs, or enter nothing to quit")
print(empty_dict) |
class Snapshot:
def __init__(self, state: any, index: int):
self.state = state
self.index = index
class RecoverSnapshot(Snapshot):
def __init__(self, data: any, index: int):
super().__init__(data, index)
class PersistedSnapshot(Snapshot):
def __init__(self, data: any, index: int):
super().__init__(data, index)
class Event:
def __init__(self, data: any, index: int):
self.data = data
self.index = index
class RecoverEvent(Event):
def __init__(self, data: any, index: int):
super().__init__(data, index)
class ReplayEvent(Event):
def __init__(self, data: any, index: int):
super().__init__(data, index)
class PersistedEvent(Event):
def __init__(self, data: any, index: int):
super().__init__(data, index) |
'''Instructions
Congratulations, you've got a job at Python Pizza. Your first job is to build an automatic pizza order program.
Based on a user's order, work out their final bill.
Small Pizza: $15
Medium Pizza: $20
Large Pizza: $25
Pepperoni for Small Pizza: +$2
Pepperoni for Medium or Large Pizza: +$3
Extra cheese for any size pizza: + $1
Example Input
size = "L"
add_pepperoni = "Y"
extra_cheese = "N"
Example Output
Your final bill is: $28.
'''
# 🚨 Don't change the code below 👇
print("Welcome to Python Pizza Deliveries!")
size = input("What size pizza do you want? S, M, or L ")
add_pepperoni = input("Do you want pepperoni? Y or N ")
extra_cheese = input("Do you want extra cheese? Y or N ")
# 🚨 Don't change the code above 👆
# Write your code below this line 👇
if size == 'S':
bill = 15
elif size == 'M':
bill = 20
else:
bill = 25
if add_pepperoni == 'Y':
if size == 'S':
bill += 2
else:
bill += 3
if extra_cheese == 'Y':
bill += 1
print(f'Your final bill is: ${bill}.')
|
def positive_sum(arr):
positive_list = []
for i in arr:
if i > 0:
positive_list.append(i)
return(sum(positive_list))
# Best Practices
def positive_sum(arr):
return sum(x for x in arr if x > 0)
|
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
:mod:`orion.core.cli.checks.presence` -- Presence stage for database checks
===========================================================================
.. module:: presence
:platform: Unix
:synopsis: Checks for the presence of a configuration.
"""
class PresenceStage:
"""The presence stage of the checks."""
def __init__(self, experiment_builder, cmdargs):
"""Create an instance of the stage.
Parameters
----------
experiment_builder: `ExperimentBuilder`
An instance of `ExperimentBuilder` to fetch configs.
"""
self.builder = experiment_builder
self.cmdargs = cmdargs
self.db_config = {}
def checks(self):
"""Return the registered checks."""
yield self.check_default_config
yield self.check_environment_vars
yield self.check_configuration_file
def check_default_config(self):
"""Check for a configuration inside the default paths."""
config = self.builder.fetch_default_options()
if 'database' not in config:
return "Skipping", "No default configuration found for database."
self.db_config = config['database']
print('\n ', self.db_config)
return "Success", ""
def check_environment_vars(self):
"""Check for a configuration inside the environment variables."""
config = self.builder.fetch_env_vars()
config = config['database']
names = ['type', 'name', 'host', 'port']
if not any(name in config for name in names):
return "Skipping", "No environment variables found."
self.db_config.update(config)
print('\n ', self.db_config)
return "Success", ""
def check_configuration_file(self):
"""Check if configuration file has valid database configuration."""
config = self.builder.fetch_file_config(self.cmdargs)
if not len(config):
return "Skipping", "Missing configuration file."
if 'database' not in config:
return "Skipping", "No database found in configuration file."
config = config['database']
names = ['type', 'name', 'host', 'port']
if not any(name in config for name in names):
return "Skipping", "No configuration value found inside `database`."
self.db_config.update(config)
print('\n ', config)
return "Success", ""
def post_stage(self):
"""Print the current config."""
print("Using configuration: {}".format(self.db_config))
|
'''
We are given two strings, A and B.
A shift on A consists of taking string A and moving the leftmost character to the rightmost position. For example, if A = 'abcde', then it will be 'bcdea' after one shift on A. Return True if and only if A can become B after some number of shifts on A.
Example 1:
Input: A = 'abcde', B = 'cdeab'
Output: true
Example 2:
Input: A = 'abcde', B = 'abced'
Output: false
Note:
A and B will have length at most 100.
'''
class Solution(object):
def rotateString(self, A, B):
"""
:type A: str
:type B: str
:rtype: bool
"""
if len(A) != len(B):
return False
return B in A + A
return A in B + B
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.