content stringlengths 7 1.05M |
|---|
# Title: Construct Binary Tree from Preorder and Inorder Traversal
# Runtime: 68 ms
# Memory: 18.1 MB
# Definition for a binary tree node.
# class TreeNode:
# def __init__(self, x):
# self.val = x
# self.left = None
# self.right = None
# Time Complexity: O(n)
# Space Complexity: O(n)
class Solution:
def getMapping(self, inorder: List[int]) -> dict:
mapping = {}
for index in range(len(inorder)):
num = inorder[index]
mapping[num] = index
return mapping
def buildTreeRecursive(self, preorder: List[int], mapping: dict, left: int, right: int) -> TreeNode:
if right < left:
return None
num = preorder.pop(0)
curr = TreeNode(num)
curr.left = self.buildTreeRecursive(preorder, mapping, left, mapping[num] - 1)
curr.right = self.buildTreeRecursive(preorder, mapping, mapping[num] + 1, right)
return curr
def buildTree(self, preorder: List[int], inorder: List[int]) -> TreeNode:
if not len(preorder) == len(inorder):
return None
mapping = self.getMapping(inorder)
return self.buildTreeRecursive(preorder, mapping, 0, len(inorder) - 1)
|
class AnnotationObjectBase(RhinoObject):
"""
Provides a base class for Rhino.Geometry.AnnotationBase-derived
objects that are placed in a document.
"""
DisplayText=property(lambda self: object(),lambda self,v: None,lambda self: None)
"""Gets the text that is displayed to users.
Get: DisplayText(self: AnnotationObjectBase) -> str
"""
|
#H hours, M minutes and S seconds are passed since the midnight (0 ≤ H < 12, 0 ≤ M < 60, 0 ≤ S < 60).
# Determine the angle (in degrees) of the hour hand on the clock face right now.
H = int(input("H = ?"))
M = int(input("M = ?"))
S = int(input("S = ?"))
TotHours = round( (H + (M +(S/60))/60), 3)
print("Total number of hours are", TotHours)
if (0 <= H < 12)and (0<= M < 60) and (0<= S < 60):
print("Total no. of hours, Hr = ", TotHours )
else:
print("Invalid data")
exit()
Angle = round( (30 * TotHours), 2)
print("Angle between hour hand and minute hand = ", Angle, "degrees")
|
"""Module containing all the controllers for the rest_api_to_db IEX service"""
IEX_REST_API_TO_DB_CONTROLLERS = [
]
|
c = float(input('Informe a temperatura em Celsius: '))
k = c + 273.15
print(f'A temperatura em Kelvin é de {k}°') |
class Config:
# AWS Information
ACCESS_KEY = ""
SECRET_KEY = ""
INSTANCE_ID = ""
EC2_REGION = ""
# SSH Key Path
SSH_KEY_FILE_NAME = ""
# Login Password
SERVER_PASSWORD = "1"
|
Patk = 15
Pdef = 12
Php = 25
Pgold = 250
choices = [ ' a) Fight like a champion.',
' b) Run like a coward.',
' c) Analyze the situation first.',
' d) Attempt to heal.'
]
wit_access_token = 'GIKG4P7FJTE44GV3U6YPUJGCRY7AYPDH'
|
largest = None
smallest = None
def Maximum(largest, num):
if largest is None:
largest = num
elif largest < num:
largest = num
return largest
def Minimum(smallest, num):
if smallest is None:
smallest = num
elif smallest > num:
smallest = num
return smallest
while True:
num = input("Enter a number: ")
if num == "done":
print("Maximum is ", largest)
print("Minimum is ", smallest)
break
try:
num = int(num)
print(num)
largest = Maximum(largest, num)
smallest = Minimum(smallest, num)
except:
print('Invalid input')
|
print('''
A string is said to be palindrome if it reads
the same backward as forward. For e.g. "AKA" string
is a palindrome because if we try to read it from
backward, it is same as forward. One of the approach
to check this is iterate through the string till
middle of string and compare a character from back
and forth.
''')
string=input('Enter string here: ')
flag=1
#converts the given string into lowercase
string=string.lower()
#Iterate the string forward and backward, compare one character at a time
#till middle of the string is reached
for i in range(len(string)//2):
if string[i]!=string[len(string)-i-1]:
flag=0
break
if flag:
print(f'Given string \" {string} \" is a palindrome')
else:
print(f"Given string \" {string} \" is not a palindrome")
|
# AUTOGENERATED BY NBDEV! DO NOT EDIT!
__all__ = ["index", "modules", "custom_doc_links", "git_url"]
index = {"format_cookie_str": "01_Advanced_Request.ipynb",
"get_children": "01_Advanced_Request.ipynb",
"get_class": "01_Advanced_Request.ipynb",
"get_all_class": "01_Advanced_Request.ipynb",
"get_class_count": "01_Advanced_Request.ipynb",
"is_content_list": "01_Advanced_Request.ipynb",
"find_main_list": "01_Advanced_Request.ipynb",
"is_next_page": "01_Advanced_Request.ipynb",
"get_next_page_url": "01_Advanced_Request.ipynb",
"get_child_navigablestring": "01_Advanced_Request.ipynb",
"get_data_name": "01_Advanced_Request.ipynb",
"get_data": "01_Advanced_Request.ipynb",
"update_ip_pool": "11_Proxy_Request.ipynb",
"load_ip_pool": "11_Proxy_Request.ipynb",
"proxy_get": "11a_IP_Pool.ipynb",
"init_ip_dict": "11_Proxy_Request.ipynb",
"update_ip_health": "11_Proxy_Request.ipynb",
"smart_proxy_get": "11_Proxy_Request.ipynb",
"validate_ip": "11_Proxy_Request.ipynb",
"validate_ip_dict": "11_Proxy_Request.ipynb",
"get_healthy_ip_pool": "11_Proxy_Request.ipynb",
"Proxy": "11_Proxy_Request.ipynb",
"parse_recipe_data": "12_Database.ipynb",
"get_recipe_data": "12_Database.ipynb",
"connect_db": "11a_IP_Pool.ipynb",
"make_test_data": "23_IP_Pool.ipynb",
"update_health": "11a_IP_Pool.ipynb",
"match_ip": "11a_IP_Pool.ipynb",
"match_port": "11a_IP_Pool.ipynb",
"match_ip_with_port": "11a_IP_Pool.ipynb",
"find_port": "11a_IP_Pool.ipynb",
"find_ips": "11a_IP_Pool.ipynb",
"crawl_ip": "11a_IP_Pool.ipynb",
"proxy_website_urls": "11a_IP_Pool.ipynb",
"https": "11a_IP_Pool.ipynb",
"validate": "11a_IP_Pool.ipynb",
"parallel_validate": "23_IP_Pool.ipynb",
"parallel_crawl_ips": "11a_IP_Pool.ipynb",
"repeat_crawl_ips": "11a_IP_Pool.ipynb",
"last_crawl": "11a_IP_Pool.ipynb",
"delete_ips": "11a_IP_Pool.ipynb",
"repeat_delete_ips": "11a_IP_Pool.ipynb",
"last_delete": "11a_IP_Pool.ipynb",
"get_ip": "11a_IP_Pool.ipynb",
"client": "24_MongoDB.ipynb",
"db": "24_MongoDB.ipynb",
"articals": "24_MongoDB.ipynb",
"simple_request": "24_MongoDB.ipynb",
"get_urls": "24_MongoDB.ipynb",
"run": "24_MongoDB.ipynb",
"art_coll": "24_MongoDB.ipynb",
"category": "24_MongoDB.ipynb",
"crawl_artical_url": "24_MongoDB.ipynb",
"save_artical": "24_MongoDB.ipynb",
"crawl_artical": "24_MongoDB.ipynb",
"parrelel_crawl": "24_MongoDB.ipynb",
"parallel_task": "11a_IP_Pool.ipynb",
"rdb": "11a_IP_Pool.ipynb",
"parallel_crawl_artical_url": "24_MongoDB.ipynb",
"crawl_artical_url_v1": "24_MongoDB.ipynb",
"get_urls_v1": "24_MongoDB.ipynb",
"crawl_artical_url_and_html": "24_MongoDB.ipynb",
"crawl_artical_by_category": "24_MongoDB.ipynb",
"parse_html": "24_MongoDB.ipynb",
"update_artical_info": "24_MongoDB.ipynb",
"update_all_artical_info": "24_MongoDB.ipynb",
"parse_ymd": "24_MongoDB.ipynb",
"correct_field_type": "24_MongoDB.ipynb"}
modules = ["utils.py",
"None.py",
"proxy.py",
"db.py",
"DB.py",
"IpPool.py",
"RRPM.py"]
doc_url = "https://neo4dev.github.io/crawler_from_scratch/"
git_url = "https://github.com/neo4dev/crawler_from_scratch/tree/master/"
def custom_doc_links(name): return None
|
"""
Terminal Returner Plugin
************************
**Plugin Name:** ``terminal``
This plugin prints rendered result to terminal screen
applying minimal formating to improve readability.
For instance if these are rendering results::
{'rt-1': 'interface Gi1/1\\n'
' description Customer A\\n'
' encapsulation dot1q 100\\n'
' vrf forwarding cust_a\\n'
' ip address 10.0.0.1 255.255.255.0\\n'
' exit\\n'
'!\\n'
'interface Gi1/2\\n'
' description Customer C\\n'
' encapsulation dot1q 300\\n'
' vrf forwarding cust_c\\n'
' ip address 10.0.3.1 255.255.255.0\\n'
' exit\\n'
'!',
'rt-2': 'interface Gi1/2\\n'
' description Customer B\\n'
' encapsulation dot1q 200\\n'
' vrf forwarding cust_b\\n'
' ip address 10.0.2.1 255.255.255.0\\n'
' exit\\n'
'!'}
Terminal returner will print to screen::
# ---------------------------------------------------------------------------
# rt-1 rendering results
# ---------------------------------------------------------------------------
interface Gi1/1
description Customer A
encapsulation dot1q 100
vrf forwarding cust_a
ip address 10.0.0.1 255.255.255.0
exit
!
interface Gi1/2
description Customer C
encapsulation dot1q 300
vrf forwarding cust_c
ip address 10.0.3.1 255.255.255.0
exit
!
# ---------------------------------------------------------------------------
# rt-2 rendering results
# ---------------------------------------------------------------------------
interface Gi1/2
description Customer B
encapsulation dot1q 200
vrf forwarding cust_b
ip address 10.0.2.1 255.255.255.0
exit
!
This returner useful for debugging or, for instance, when it is easier
to copy produced results from terminal screen.
"""
def dump(data_dict, **kwargs):
"""
This function prints results to terminal screen
:param data_dict: (dict) dictionary keyed by ``result_name_key`` where
values are rendered results string
"""
for key, value in data_dict.items():
print("""
# ---------------------------------------------------------------------------
# {} rendering results
# ---------------------------------------------------------------------------""".format(key))
print(value) |
# -*- coding: utf-8 -*-
questoes = int(input())
respostas = input()
gabarito = input()
acertos = 0
for i in range(questoes):
if respostas[i] == gabarito[i]:
acertos += 1
print(acertos)
|
class Solution:
def removeDuplicates(self, nums):
"""
:type nums: List[int]
:rtype: int
"""
last = "NaN"
uniques = 0
i = 0
while i < len(nums): # len must be evaluated at every step for this to work
if nums[i] == last:
del nums[i]
else:
uniques += 1
last = nums[i]
i += 1
return uniques
|
#!/usr/bin/python
# Author: Wayne Keenan
# email: wayne@thebubbleworks.com
# Twitter: https://twitter.com/wkeenan
HCIPY_HCI_CMD_STRUCT_HEADER = "<BHB"
HCIPY_HCI_FILTER_STRUCT = "<LLLH"
# HCI ioctl Commands:
HCIDEVUP = 0x400448c9 # 201
HCIDEVDOWN = 0x400448ca # 202
HCIGETDEVINFO = -2147202861 #0x800448d3L # _IOR(ord('H'), 211, 4)
# HCI Status
HCI_SUCCESS = 0x00
HCI_OE_USER_ENDED_CONNECTION = 0x13
# HCI Parameters
LE_PUBLIC_ADDRESS = 0x00
LE_RANDOM_ADDRESS = 0x01
# Types of bluetooth scan
SCAN_TYPE_PASSIVE = 0x00
SCAN_TYPE_ACTIVE = 0x01
SCAN_FILTER_DUPLICATES = 0x01
SCAN_DISABLE = 0x00
SCAN_ENABLE = 0x01
# Advertisement event types
ADV_IND = 0x00
ADV_DIRECT_IND = 0x01
ADV_SCAN_IND = 0x02
ADV_NONCONN_IND = 0x03
ADV_SCAN_RSP = 0x04
FILTER_POLICY_NO_WHITELIST = 0x00 # Allow Scan Request from Any, Connect Request from Any
FILTER_POLICY_SCAN_WHITELIST = 0x01 # Allow Scan Request from White List Only, Connect Request from Any
FILTER_POLICY_CONN_WHITELIST = 0x02 # Allow Scan Request from Any, Connect Request from White List Only
FILTER_POLICY_SCAN_AND_CONN_WHITELIST = 0x03 # Allow Scan Request from White List Only, Connect Request from White List Only
# From bluetootchsocket.cpp
HCI_COMMAND_PKT = 0x01
HCI_ACLDATA_PKT = 0x02
HCI_EVENT_PKT = 0x04
EVT_CMD_COMPLETE = 0x0e
EVT_CMD_STATUS = 0x0f
LE_META_EVENT = 0x3E # Core_4.2.pdf section: 7.7.65 LE Meta Event
# sub-events of LE_META_EVENT
EVT_LE_CONN_COMPLETE = 0x01
EVT_LE_ADVERTISING_REPORT = 0x02
EVT_LE_CONN_UPDATE_COMPLETE = 0x03
EVT_LE_READ_REMOTE_USED_FEATURES_COMPLETE = 0x04
EVT_DISCONN_COMPLETE = 0x05
EVT_LE_META_EVENT = 0x3e
ATT_CID = 0x0004
ACL_START = 0x02
OGF_LE_CTL = 0x08
OGF_LINK_CTL = 0x01
OCF_LE_SET_SCAN_PARAMETERS = 0x000B
OCF_LE_SET_SCAN_ENABLE = 0x000C
OCF_LE_CREATE_CONN = 0x000D
OCF_LE_SET_ADVERTISING_PARAMETERS = 0x0006
OCF_LE_SET_ADVERTISE_ENABLE = 0x000A
OCF_LE_SET_ADVERTISING_DATA = 0x0008
OCF_LE_SET_SCAN_RESPONSE_DATA = 0x0009
OCF_DISCONNECT = 0x0006
LE_SET_SCAN_PARAMETERS_CMD = OCF_LE_SET_SCAN_PARAMETERS | OGF_LE_CTL << 10
LE_SET_SCAN_ENABLE_CMD = OCF_LE_SET_SCAN_ENABLE | OGF_LE_CTL << 10
LE_SET_ADVERTISING_PARAMETERS_CMD = OCF_LE_SET_ADVERTISING_PARAMETERS | OGF_LE_CTL << 10
LE_SET_ADVERTISING_DATA_CMD = OCF_LE_SET_ADVERTISING_DATA | OGF_LE_CTL << 10
LE_SET_SCAN_RESPONSE_DATA_CMD = OCF_LE_SET_SCAN_RESPONSE_DATA | OGF_LE_CTL << 10
LE_SET_ADVERTISE_ENABLE_CMD = OCF_LE_SET_ADVERTISE_ENABLE | OGF_LE_CTL << 10
LE_CREATE_CONN_CMD = OCF_LE_CREATE_CONN | OGF_LE_CTL << 10
DISCONNECT_CMD = OCF_DISCONNECT | OGF_LINK_CTL << 10
|
#Adapted from https://github.com/FakeNewsChallenge/fnc-1/blob/master/scorer.py
#Original credit - @bgalbraith
LABELS = ['agree', 'disagree', 'discuss', 'unrelated']
LABELS_RELATED = ['unrelated','related']
RELATED = LABELS[0:3]
def score_submission(gold_labels, test_labels):
score = 0.0
cm = [[0, 0, 0, 0],
[0, 0, 0, 0],
[0, 0, 0, 0],
[0, 0, 0, 0]]
for i, (g, t) in enumerate(zip(gold_labels, test_labels)):
g_stance, t_stance = g, t
if g_stance == t_stance:
score += 0.25
if g_stance != 'unrelated':
score += 0.50
if g_stance in RELATED and t_stance in RELATED:
score += 0.25
cm[LABELS.index(g_stance)][LABELS.index(t_stance)] += 1
return score, cm
def print_confusion_matrix(cm):
lines = []
header = "|{:^11}|{:^11}|{:^11}|{:^11}|{:^11}|".format('', *LABELS)
line_len = len(header)
lines.append("-"*line_len)
lines.append(header)
lines.append("-"*line_len)
hit = 0
total = 0
for i, row in enumerate(cm):
hit += row[i]
total += sum(row)
lines.append("|{:^11}|{:^11}|{:^11}|{:^11}|{:^11}|".format(LABELS[i],
*row))
lines.append("-"*line_len)
print('\n'.join(lines))
def report_score(actual, predicted, verbose=True):
score,cm = score_submission(actual,predicted)
best_score, _ = score_submission(actual,actual)
if verbose:
print_confusion_matrix(cm)
print("Score: " +str(score) + " out of " + str(best_score) + "\t("+str(score*100/best_score) + "%)")
return score*100/best_score
if __name__ == "__main__":
actual = [0,0,0,0,1,1,0,3,3]
predicted = [0,0,0,0,1,1,2,3,3]
report_score([LABELS[e] for e in actual],[LABELS[e] for e in predicted]) |
#
# @lc app=leetcode.cn id=1818 lang=python3
#
# [1818] 绝对差值和
#
# https://leetcode-cn.com/problems/minimum-absolute-sum-difference/description/
#
# algorithms
# Medium (38.79%)
# Likes: 72
# Dislikes: 0
# Total Accepted: 15.1K
# Total Submissions: 39.9K
# Testcase Example: '[1,7,5]\n[2,3,5]'
#
# 给你两个正整数数组 nums1 和 nums2 ,数组的长度都是 n 。
#
# 数组 nums1 和 nums2 的 绝对差值和 定义为所有 |nums1[i] - nums2[i]|(0 )的 总和(下标从 0 开始)。
#
# 你可以选用 nums1 中的 任意一个 元素来替换 nums1 中的 至多 一个元素,以 最小化 绝对差值和。
#
# 在替换数组 nums1 中最多一个元素 之后 ,返回最小绝对差值和。因为答案可能很大,所以需要对 10^9 + 7 取余 后返回。
#
# |x| 定义为:
#
#
# 如果 x >= 0 ,值为 x ,或者
# 如果 x ,值为 -x
#
#
#
#
# 示例 1:
#
#
# 输入:nums1 = [1,7,5], nums2 = [2,3,5]
# 输出:3
# 解释:有两种可能的最优方案:
# - 将第二个元素替换为第一个元素:[1,7,5] => [1,1,5] ,或者
# - 将第二个元素替换为第三个元素:[1,7,5] => [1,5,5]
# 两种方案的绝对差值和都是 |1-2| + (|1-3| 或者 |5-3|) + |5-5| = 3
#
#
# 示例 2:
#
#
# 输入:nums1 = [2,4,6,8,10], nums2 = [2,4,6,8,10]
# 输出:0
# 解释:nums1 和 nums2 相等,所以不用替换元素。绝对差值和为 0
#
#
# 示例 3:
#
#
# 输入:nums1 = [1,10,4,4,2,7], nums2 = [9,3,5,1,7,4]
# 输出:20
# 解释:将第一个元素替换为第二个元素:[1,10,4,4,2,7] => [10,10,4,4,2,7]
# 绝对差值和为 |10-9| + |10-3| + |4-5| + |4-1| + |2-7| + |7-4| = 20
#
#
#
#
# 提示:
#
#
# n == nums1.length
# n == nums2.length
# 1
# 1
#
#
#
# @lc code=start
class Solution:
def minAbsoluteSumDiff(self, nums1: List[int], nums2: List[int]) -> int:
n, total, sl, ans = len(nums1), 0, sorted(nums1), inf
for i in range(n):
diff = abs(nums1[i] - nums2[i])
total += diff
idx = bisect.bisect_left(sl, nums2[i])
# idx > 0 尝试用idx-1替换当前值
if idx:
ans = min(ans, abs(sl[idx - 1] - nums2[i]) - diff)
# idx < n 尝试用idx替换当前值
if idx < n:
ans = min(ans, abs(sl[idx] - nums2[i]) - diff)
return (total + ans) % (10**9 + 7) if total else total
# @lc code=end
|
"""basics"""
def main():
a = [1,2,3,4]
TestError( len(a)==4 )
#b = list()
#TestError( len(b)==0 )
|
#CODE:
def create_stack():
stack = []
return stack
def peek(stack):
if len(stack) == 0:
return "Underflow"
else:
return stack[-1]
def isEmpty(stack):
if len(stack) == 0:
return True
else:
return False
def push(stack):
element=int(input("Enter the element:"))
#int should be used if we want to accept int type elements
stack.append(element)
print("Element",element,"added successfully to the stack")
#the above print statemnt is not used in the newer versions of marking scheme
def pop(stack):
if (len(stack) == 0):
print("Stack empty") #Based on the question one can also display "Underflow"
else:
print ("Deleted element :",stack.pop())
'''
#EXAMPLE:
#Creating a stack
>>> stack_1 = create_stack()
>>> print(stack_1)
[]
#As the stack is empty we get underflow error
>>> print(peek(stack_1))
Underflow
#pushing element 1 to the stack
>>> push(stack_1)
Enter the element:1
Element 1 added successfully to the stack
>>> print(stack_1)
[1]
#pushing element 2 to the stack
>>> push(stack_1)
Enter the element:2
Element 2 added successfully to the stack
>>> print(stack_1)
[1,2]
#as the stack full we get Overflow
>>> push(stack_1)
Overflow
#poping element from the stack
>>> pop(stack_1)
Deleted element : 2
>>> print(stack_1)
[1]
#peeking the topmost element of the stack
>>> print(peek(stack_1))
1
#checking if a stack is empty or not
>>> print(isEmpty(stack_1))
False
#popping element the topmost element from the stack
>>> pop(stack_1)
Deleted element : 1
#as the stack is empty we get Stack empty
>>> print(stack_1)
[]
>>> pop(stack_1)
Stack empty
'''
|
class ObjectBase(dict):
def __init__(self, data, client=None):
"""
Create a new object from API result data.
"""
super().__init__(data)
self.client = client
def _get_property(self, name):
"""Return the named property from dictionary values."""
if name not in self:
return None
return self[name]
def _get_link(self, name):
"""Return a link by its name."""
try:
return self["_links"][name]["href"]
except (KeyError, TypeError):
return None
@classmethod
def get_object_name(cls):
name = cls.__name__.lower()
return f"{name}s"
@classmethod
def get_resource_class(cls, client):
raise NotImplementedError # pragma: no cover
|
# -*- coding: utf-8 -*-
"""
Created on Tue Sep 4 05:59:19 2018
@author: Deepti Kulkarni
"""
"""Exercise 1: Chapter 5, Write a program which repeatedly reads numbers until the
user enters “done”. Once “done” is entered, print out the total, count,
and average of the numbers. If the user enters anything other than a
number, detect their mistake using try and except and print an error
message and skip to the next number."""
count=0
total=0
while True:
try:
number=input("Enter a number: ")
if number=="done":
break
number=float(number)
count=count+1
total=total+number
except:
number=-1
print("Error! Please enter numeric values only.")
if count==0:
#if the first entry is "done", average is invalid, but printing it as zero
average=0
else:
average=total/count
print("Total is : ",total)
print("Count is: ",count)
print("Average is: ",average)
"""Exercise 2, Chapter 5: Write another program that prompts for a list of numbers
as above and at the end prints out both the maximum and minimum of
the numbers instead of the average."""
num_array= list()
while True:
try:
number=input("Enter a number: ")
if number=="done":
break
num_array.append(float(number))
except:
number=-1
print("Error! Please enter numeric values only.")
print("Total is : ",sum(num_array))
print("Count is: ",len(num_array))
#Maximum and minimum of an empty array is invalid, but here printing max and min as zero if array is empty
if num_array:
print("Maximum number is: ",max(num_array))
print("Minimum number is: ",min(num_array))
else:
print("Maximum number is: ",0)
print("Minimum number is: ",0)
""""Exercise 5: Chapter 6, Take the following Python code that stores a string:
str = 'X-DSPAM-Confidence:0.8475'
Use find and string slicing to extract the portion of the string after the
colon character and then use the float function to convert the extracted
string into a floating point number."""
str= 'X-DSPAM-Confidence:0.8475'
#Solution 1
print("\n Solution 1 \n")
strfind= str.find(':') # Finding ':' in the string
DividedString= str[strfind+1:] # Dividing string from ':' till end of the string
print(DividedString,"Type is: ", type(DividedString))
CovertedStr= float(DividedString) #Converting String to float
print(CovertedStr, "Type is: ", type(CovertedStr))
#Solution 2
print("\n Solution 2 \n") #Directly finding value only using 1 function
DividedString1,DividedString2=str.rsplit(':',1) #Spliting string directly
ConvertedString2= float(DividedString2) #Converting String to float
print(ConvertedString2,"Type is: ", type(ConvertedString2),"\n")
"""Exercise 6:Chapter 6 Read the documentation of the string methods at
https://docs.python.org/library/stdtypes.html#string-methods You
might want to experiment with some of them to make sure you
understand how they work. strip and replace are particularly useful.
The documentation uses a syntax that might be confusing. For example,
in find(sub[, start[, end]]), the brackets indicate optional arguments.
So sub is required, but start is optional, and if you include start, then
end is optional."""
str1='Business Analytics-Python Language'
#Finding string 'ness' in str1 by giving 1 argument which gives index value of starting character in substring
print("String Operations: ")
print(str1.find('ness'))
#Finding string 'ness' in str1 by giving 3 arguments, which passes -1 value if substring not found in string within given argument
strfind2= str1.find('ness', 0, 6)
print(strfind2)
#Finding string 'ness' in str1 by giving 2 arguments
strfind3= str1.find('ness',5)
print(strfind3)
#Finding string 'ness' in str1 by giving 3 arguments, where last argument is length of string
strfind4= str1.find('ness',0,len(str))
print(strfind4)
#Striping 'e' from string, strip() function can remove first and last space if no argument given
#and can remove char if argument is passed, only from first and last index
print(str1.strip("e"))
print(str1.strip("e,B")) # Removing 2 characters which is passed in as 1 argument
#Making first character capital and rest lower
str3='python business analytics'
print(str3.capitalize())
#Counting number of times particular character/word is repeated in the string
print(str1.count('s'))
print(str1.count('Business'))
#Making string upper case
print(str1.upper())
#Replacing character in the string with other character
print(str1.replace("e","o"))
"""
-----------SAMPLE OUTPUT------------------
-------Exercise 1: Chapter 5------
Enter a number: 1
Enter a number: 2
Enter a number: 7
Enter a number: ds
Error! Please enter numeric values only.
Enter a number: done
Total is : 10.0
Count is: 3
Average is: 3.3333333333333335
--------Exercise 2, Chapter 5-----
Enter a number: 1
Enter a number: 3
Enter a number: 7
Enter a number: done
Total is : 11.0
Count is: 3
Maximum number is: 7.0
Minimum number is: 1.0
--------Exercise 5: Chapter 6-----
0.8475 Type is: <class 'str'>
0.8475 Type is: <class 'float'>
Solution 2
0.8475 Type is: <class 'float'>
--------Exercise 6, Chapter 6-----
String Operations:
4
-1
-1
4
Business Analytics-Python Languag
usiness Analytics-Python Languag
Python business analytics
4
1
BUSINESS ANALYTICS-PYTHON LANGUAGE
Businoss Analytics-Python Languago
""" |
#GCD
a = int(input("Enter a: "))
b = int(input('Enter b: '))
gcd = 1 #initial gcd
k = 2 #possible gcd
while k <= a and k <= b:
if a%k == 0 and b%k == 0:
gcd = k
k += 1
print(gcd) |
ABCDE = list(map(int, input().split()))
t = []
for i in range(3):
for j in range(i + 1, 4):
for k in range(j + 1, 5):
t.append(ABCDE[i] + ABCDE[j] + ABCDE[k])
t.sort()
print(t[-3])
|
class CredentialsError(Exception):
pass
class InvalidSetup(Exception):
pass |
number_of_test_cases = int(input())
for i in range(number_of_test_cases):
number_of_candies = int(input())
one_gram_candies_number = 0
two_grams_candies_number = 0
for weight in map(int, input().split()):
if weight == 1:
one_gram_candies_number += 1
else:
two_grams_candies_number += 1
if one_gram_candies_number == 0 and two_grams_candies_number % 2 == 0:
print('YES')
elif one_gram_candies_number != 0 and one_gram_candies_number % 2 == 0:
print('YES')
else:
print('NO')
|
"""Roman numerals
"""
def convert_roman_to_int(rn):
mapping = {
"I": 1,
"IV": 4,
"V": 5,
"IX": 9,
"X": 10,
"XL": 40,
"L": 50,
"XC": 90,
"C": 100,
"CD": 400,
"D": 500,
"CM": 900,
"M": 1000
}
prev_digit = mapping[rn[0]]
s = prev_digit
for i in range(1, len(rn)):
val = mapping[rn[i]]
if val > prev_digit:
s -= prev_digit
s += mapping[rn[i-1:i+1]]
prev_digit = mapping[rn[i-1:i+1]]
else:
s += val
prev_digit = val
return s
def convert_int_to_roman(i):
mapping = {
1: 'I',
4: 'IV',
5: 'V',
9: 'IX',
10: 'X',
40: 'XL',
50: 'L',
90: 'XC',
100: 'C',
400: 'CD',
500: 'D',
900: 'CM',
1000: 'M'
}
c = [1000, 900, 500, 400, 100, 90, 50, 40, 10, 9, 5, 4, 1]
rn = ""
while i > 0:
if i >= c[0]:
rn += mapping[c[0]]
i -= c[0]
else:
c.pop(0)
return rn
counter = 0
with open("data/p089_roman.txt", "r") as f:
for line in f:
line = line.strip()
original_length = len(line)
new_length = len(convert_int_to_roman(convert_roman_to_int(line)))
counter += original_length - new_length
print(counter)
|
# Project Euler Problem 3
###############################
# Find the largest prime factor
# of the number 600851475143
###############################
#checks if a natural number n is prime
#returns boolean
def prime_check(n):
assert type(n) is int, "Non int passed"
assert n > 0, "No negative values allowed, or zero"
if n == 1:
return False
i = 2
while i*i < n + 1:
if n != i and n % i == 0:
return False
i += 1
return True
#generate a list of primes less than a given value n
def generate_primes(n):
assert type(n) is int, "Non int passed"
primes = []
if n < 0:
n *= -1
if n == 0 or n == 1:
return primes
for i in range(1, n):
if prime_check(i):
primes.append(i)
return primes
# Just going to do a simple trial run
def trial_factor(n):
assert type(n) is int, "Non-integer passed"
assert n >= 0, "No negative values allowed"
largest_prime_factor = 0
primes = generate_primes(int(n**.5) + 1)
for p in primes:
if n % p == 0:
if p > largest_prime_factor:
largest_prime_factor = p
return largest_prime_factor
# test
def main():
print(trial_factor(600851475143))
return
main()
|
# Origin dictionary of ABCnet
# CTLABELS = [' ','!','"','#','$','%','&','\'','(',')','*','+',',','-','.','/','0','1','2','3','4','5','6','7','8','9',':',';','<','=','>','?','@','A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z','[','\\',']','^','_','`','a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z','{','|','}','~']
# CTLABELS = ['a', 'A', 'à', 'À', 'ả', 'Ả', 'ã', 'Ã', 'á', 'Á', 'ạ', 'Ạ', 'ă', 'Ă', 'ằ', 'Ằ', 'ẳ', 'Ẳ', 'ẵ', 'Ẵ', 'ắ', 'Ắ', 'ặ', 'Ặ', 'â', 'Â', 'ầ', 'Ầ', 'ẩ', 'Ẩ', 'ẫ', 'Ẫ', 'ấ', 'Ấ', 'ậ', 'Ậ', 'b', 'B', 'c', 'C', 'd', 'D', 'đ', 'Đ', 'e', 'E', 'è', 'È', 'ẻ', 'Ẻ', 'ẽ', 'Ẽ', 'é', 'É', 'ẹ', 'Ẹ', 'ê', 'Ê', 'ề', 'Ề', 'ể', 'Ể', 'ễ', 'Ễ', 'ế', 'Ế', 'ệ', 'Ệ', 'f', 'F', 'g', 'G', 'h', 'H', 'i', 'I', 'ì', 'Ì', 'ỉ', 'Ỉ', 'ĩ', 'Ĩ', 'í', 'Í', 'ị', 'Ị', 'j', 'J', 'k', 'K', 'l', 'L', 'm', 'M', 'n', 'N', 'o', 'O', 'ò', 'Ò', 'ỏ', 'Ỏ', 'õ', 'Õ', 'ó', 'Ó', 'ọ', 'Ọ', 'ô', 'Ô', 'ồ', 'Ồ', 'ổ', 'Ổ', 'ỗ', 'Ỗ', 'ố', 'Ố', 'ộ', 'Ộ', 'ơ', 'Ơ', 'ờ', 'Ờ', 'ở', 'Ở', 'ỡ', 'Ỡ', 'ớ', 'Ớ', 'ợ', 'Ợ', 'p', 'P', 'q', 'Q', 'r', 'R', 's', 'S', 't', 'T', 'u', 'U', 'ù', 'Ù', 'ủ', 'Ủ', 'ũ', 'Ũ', 'ú', 'Ú', 'ụ', 'Ụ', 'ư', 'Ư', 'ừ', 'Ừ', 'ử', 'Ử', 'ữ', 'Ữ', 'ứ', 'Ứ', 'ự', 'Ự', 'v', 'V', 'w', 'W', 'x', 'X', 'y', 'Y', 'ỳ', 'Ỳ', 'ỷ', 'Ỷ', 'ỹ', 'Ỹ', 'ý', 'Ý', 'ỵ', 'Ỵ', 'z', 'Z', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '!', '"', '#', '$', '%', '&', "'", "'", '(', ')', '*', '+', ',', '-', '.', '/', ':', ';', '<', '=', '>', '?', '@', '[', '\\', ']', '^', '_', '`', '{', '|', '}', '~', ' ']
# Dicitionary for VinText datasets
CTLABELS = ['^', '\\', '}', 'ỵ', '>', '<', '{', '~', '`', '°', '$', 'ẽ', 'ỷ', 'ẳ', '_', 'ỡ', ';', '=', 'Ẳ', 'j', '[', ']', 'ẵ', '?', 'ẫ', 'Ẵ', 'ỳ', 'Ỡ', 'ẹ', 'è', 'z', 'ỹ', 'ằ', 'õ', 'ũ', 'Ẽ', 'ỗ', 'ỏ', '@', 'Ằ', 'Ỳ', 'Ẫ', 'ù', 'ử', '#', 'Ẹ', 'Z', 'Õ', 'ĩ', 'Ỏ', 'È', 'Ỷ', 'ý', 'Ũ', '*', 'ò', 'é', 'q', 'ở', 'ổ', 'ủ', 'ẩ', 'ã', 'ẻ', 'J', 'ữ', 'ễ', 'ặ', '+', 'ứ', 'Ỹ', 'ự', 'ụ', 'Ỗ', '%', 'ắ', 'ồ', '"', 'ề', 'ể', 'ỉ', 'ợ', '!', 'Ẻ', 'ừ', 'ọ', '&', 'ì', 'É', 'ậ', 'Ù', 'Ặ', 'x', 'Ỉ', 'ú', 'í', 'ó', 'Ẩ', 'ị', 'ế', 'Ứ', 'â', 'ấ', 'ầ', 'ớ', 'ă', 'Ủ', 'Ĩ', '(', 'Ắ', 'Ừ', ')', 'ờ', 'Ý', 'Ễ', 'Ã', 'ô', 'ộ', 'Ữ', 'Ợ', 'ả', 'Ở', 'ệ', 'W', 'ơ', 'Ổ', 'ố', 'Ề', 'f', 'Ử', 'ạ', 'w', 'Ò', 'Ự', 'Ụ', 'Ú', 'Ồ', 'ê', 'Ó', 'Ì', 'b', 'Í', 'Ể', 'đ', 'Ớ', '/', 'k', 'Ă', 'v', 'Ị', 'Ậ', 'Ọ', 'd', 'Ầ', 'Ấ', 'ư', 'á', 'Ế', ' ', 'p', 'Ơ', 'F', 'Ả', 'Ộ', 'Ê', 'Ờ', 's', '-', 'à', 'y', 'Ố', 'l', 'Â', 'Q', ',', 'X', 'Ệ', 'Ạ', 'Ô', 'r', ':', '6', '7', 'u', '4', 'm', '5', 'e', '8', 'c', 'Ư', 'Á', '9', 'D', '3', 'o', '.', 'Y', 'g', 'K', 'a', 'À', 't', '2', 'B', 'E', 'V', 'R', '1', 'S', 'i', 'L', 'P', 'Đ', 'h', 'U', '0', 'M', 'O', 'n', 'A', 'G', 'I', 'C', 'T', 'H', 'N']
def decode(rec):
s = ''
for c in rec:
c = int(c)
if c < len(CTLABELS):
s += CTLABELS[c]
elif c == len(CTLABELS) :
s += u'口'
return s
def ctc_decode(rec):
# ctc decoding
last_char = False
s = ''
for c in rec:
c = int(c)
if c < len(CTLABELS):
if last_char != c:
s += CTLABELS[c]
last_char = c
elif c == len(CTLABELS):
s += u'口'
else:
last_char = False
return s
print(len(CTLABELS))
print(CTLABELS[94]) |
#!/usr/bin/env python
# coding=utf-8
'''
Author: John
Email: johnjim0816@gmail.com
Date: 2020-08-09 08:40:38
LastEditor: John
LastEditTime: 2020-08-10 10:38:59
Discription:
Environment:
'''
# Source : https://leetcode.com/problems/as-far-from-land-as-possible/
# Author : JohnJim0816
# Date : 2020-08-09
#####################################################################################################
#
# Given an N x N grid containing only values 0 and 1, where 0 represents water and 1 represents land,
# find a water cell such that its distance to the nearest land cell is maximized and return the
# distance.
#
# The distance used in this problem is the Manhattan distance: the distance between two cells (x0,
# y0) and (x1, y1) is |x0 - x1| + |y0 - y1|.
#
# If no land or water exists in the grid, return -1.
#
# Example 1:
#
# Input: [[1,0,1],[0,0,0],[1,0,1]]
# Output: 2
# Explanation:
# The cell (1, 1) is as far as possible from all the land with distance 2.
#
# Example 2:
#
# Input: [[1,0,0],[0,0,0],[0,0,0]]
# Output: 4
# Explanation:
# The cell (2, 2) is as far as possible from all the land with distance 4.
#
# Note:
#
# 1 <= grid.length == grid[0].length <= 100
# grid[i][j] is 0 or 1
#####################################################################################################
class Solution:
def maxDistance(self, grid: List[List[int]]) -> int:
m, n = len(grid), len(grid[0])
steps = -1
island_pos = [(i,j) for i in range(m) for j in range(n) if grid[i][j]==1]
if len(island_pos) == 0 or len(island_pos) == n ** 2: return steps
q = collections.deque(island_pos)
while q:
for _ in range(len(q)):
x, y = q.popleft()
for xi, yj in [(x + 1, y), (x - 1, y), (x, y + 1), (x, y - 1)]:
if xi >= 0 and xi < n and yj >= 0 and yj < n and grid[xi][yj] == 0:
q.append((xi, yj))
grid[xi][yj] = -1
steps += 1
return steps |
#
# @lc app=leetcode.cn id=1734 lang=python3
#
# [1734] 解码异或后的排列
#
# https://leetcode-cn.com/problems/decode-xored-permutation/description/
#
# algorithms
# Medium (44.82%)
# Likes: 89
# Dislikes: 0
# Total Accepted: 17.4K
# Total Submissions: 24.9K
# Testcase Example: '[3,1]'
#
# 给你一个整数数组 perm ,它是前 n 个正整数的排列,且 n 是个 奇数 。
#
# 它被加密成另一个长度为 n - 1 的整数数组 encoded ,满足 encoded[i] = perm[i] XOR perm[i + 1]
# 。比方说,如果 perm = [1,3,2] ,那么 encoded = [2,1] 。
#
# 给你 encoded 数组,请你返回原始数组 perm 。题目保证答案存在且唯一。
#
#
#
# 示例 1:
#
# 输入:encoded = [3,1]
# 输出:[1,2,3]
# 解释:如果 perm = [1,2,3] ,那么 encoded = [1 XOR 2,2 XOR 3] = [3,1]
#
#
# 示例 2:
#
# 输入:encoded = [6,5,4,6]
# 输出:[2,4,1,5,3]
#
#
#
#
# 提示:
#
#
# 3 <= n < 10^5
# n 是奇数。
# encoded.length == n - 1
#
#
#
# @lc code=start
class Solution:
def decode(self, encoded: List[int]) -> List[int]:
n = len(encoded)+1
total,odd = 0,0
for i in range(n+1):
total ^= i
for i in range(1,n-1,2):
odd ^= encoded[i]
perm = [total^odd]
for i in range(n-1):
perm.append(perm[-1]^encoded[i])
return perm
# @lc code=end
|
# Given an array of integers arr, return true if and only if it is a valid mountain array.
# More info: https://leetcode.com/explore/learn/card/fun-with-arrays/527/searching-for-items-in-an-array/3251/
class Solution:
def is_mountain_array(self, arr: list([int])) -> bool:
if len(arr) < 3:
return False
going_down = False
going_up = arr[0] < arr[1]
if not going_up:
return False
prev_val = -1
for elem in arr:
if elem > prev_val and going_up:
prev_val = elem
elif elem < prev_val and going_up:
going_up = False
going_down = True
prev_val = elem
elif elem < prev_val and going_down:
prev_val = elem
else:
return False
return not going_up and going_down
sol = Solution()
# Tests
arr1 = [2, 1]
arr2 = [3, 5, 5]
arr3 = [0, 3, 2, 1]
arr4 = [3, 2, 1, 2]
arr5 = [1, 2, 3]
print(sol.is_mountain_array(arr1))
|
#
# PySNMP MIB module A3COM-SWITCHING-SYSTEMS-ROUTEPOLICY-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/A3COM-SWITCHING-SYSTEMS-ROUTEPOLICY-MIB
# Produced by pysmi-0.3.4 at Mon Apr 29 16:53:41 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 (default, Mar 27 2019, 09:23:15)
#
Integer, ObjectIdentifier, OctetString = mibBuilder.importSymbols("ASN1", "Integer", "ObjectIdentifier", "OctetString")
NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues")
SingleValueConstraint, ValueSizeConstraint, ValueRangeConstraint, ConstraintsIntersection, ConstraintsUnion = mibBuilder.importSymbols("ASN1-REFINEMENT", "SingleValueConstraint", "ValueSizeConstraint", "ValueRangeConstraint", "ConstraintsIntersection", "ConstraintsUnion")
NotificationGroup, ModuleCompliance = mibBuilder.importSymbols("SNMPv2-CONF", "NotificationGroup", "ModuleCompliance")
enterprises, Counter64, Bits, iso, ObjectIdentity, Unsigned32, IpAddress, TimeTicks, Counter32, ModuleIdentity, Gauge32, MibIdentifier, MibScalar, MibTable, MibTableRow, MibTableColumn, Integer32, NotificationType = mibBuilder.importSymbols("SNMPv2-SMI", "enterprises", "Counter64", "Bits", "iso", "ObjectIdentity", "Unsigned32", "IpAddress", "TimeTicks", "Counter32", "ModuleIdentity", "Gauge32", "MibIdentifier", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "Integer32", "NotificationType")
DisplayString, TextualConvention = mibBuilder.importSymbols("SNMPv2-TC", "DisplayString", "TextualConvention")
class RowStatus(Integer32):
subtypeSpec = Integer32.subtypeSpec + ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6))
namedValues = NamedValues(("active", 1), ("notInService", 2), ("notReady", 3), ("createAndGo", 4), ("createAndWait", 5), ("destroy", 6))
a3Com = MibIdentifier((1, 3, 6, 1, 4, 1, 43))
switchingSystemsMibs = MibIdentifier((1, 3, 6, 1, 4, 1, 43, 29))
a3ComSwitchingSystemsMib = MibIdentifier((1, 3, 6, 1, 4, 1, 43, 29, 4))
a3ComRoutePolicy = MibIdentifier((1, 3, 6, 1, 4, 1, 43, 29, 4, 23))
a3ComRoutePolicyTable = MibTable((1, 3, 6, 1, 4, 1, 43, 29, 4, 23, 1), )
if mibBuilder.loadTexts: a3ComRoutePolicyTable.setStatus('mandatory')
a3ComRoutePolicyEntry = MibTableRow((1, 3, 6, 1, 4, 1, 43, 29, 4, 23, 1, 1), ).setIndexNames((0, "A3COM-SWITCHING-SYSTEMS-ROUTEPOLICY-MIB", "a3ComRoutePolicyIndex"))
if mibBuilder.loadTexts: a3ComRoutePolicyEntry.setStatus('mandatory')
a3ComRoutePolicyIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 29, 4, 23, 1, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 4294967295))).setMaxAccess("readonly")
if mibBuilder.loadTexts: a3ComRoutePolicyIndex.setStatus('mandatory')
a3ComRoutePolicyProtocolType = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 29, 4, 23, 1, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6, 7, 8, 9))).clone(namedValues=NamedValues(("undefined", 1), ("ip-rip", 2), ("ip-ospf", 3), ("ip-bgp4", 4), ("ipx-rip", 5), ("ipx-sap", 6), ("at-rtmp", 7), ("at-kip", 8), ("at-aurp", 9))).clone('undefined')).setMaxAccess("readwrite")
if mibBuilder.loadTexts: a3ComRoutePolicyProtocolType.setStatus('mandatory')
a3ComRoutePolicyType = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 29, 4, 23, 1, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("import", 1), ("export", 2))).clone('import')).setMaxAccess("readwrite")
if mibBuilder.loadTexts: a3ComRoutePolicyType.setStatus('mandatory')
a3ComRoutePolicyOriginProtocol = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 29, 4, 23, 1, 1, 4), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 63))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: a3ComRoutePolicyOriginProtocol.setStatus('mandatory')
a3ComRoutePolicySourceAddress = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 29, 4, 23, 1, 1, 5), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 50))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: a3ComRoutePolicySourceAddress.setStatus('mandatory')
a3ComRoutePolicyRouteAddress = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 29, 4, 23, 1, 1, 6), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 50))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: a3ComRoutePolicyRouteAddress.setStatus('mandatory')
a3ComRoutePolicyRouteMask = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 29, 4, 23, 1, 1, 7), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 16))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: a3ComRoutePolicyRouteMask.setStatus('mandatory')
a3ComRoutePolicyAction = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 29, 4, 23, 1, 1, 8), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("accept", 1), ("reject", 2))).clone('accept')).setMaxAccess("readwrite")
if mibBuilder.loadTexts: a3ComRoutePolicyAction.setStatus('mandatory')
a3ComRoutePolicyAdjustMetric = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 29, 4, 23, 1, 1, 9), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6))).clone(namedValues=NamedValues(("noop", 1), ("add", 2), ("subtract", 3), ("multiply", 4), ("divide", 5), ("module", 6))).clone('noop')).setMaxAccess("readwrite")
if mibBuilder.loadTexts: a3ComRoutePolicyAdjustMetric.setStatus('mandatory')
a3ComRoutePolicyMetric = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 29, 4, 23, 1, 1, 10), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 65535))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: a3ComRoutePolicyMetric.setStatus('mandatory')
a3ComRoutePolicyWeight = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 29, 4, 23, 1, 1, 11), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 16)).clone(1)).setMaxAccess("readwrite")
if mibBuilder.loadTexts: a3ComRoutePolicyWeight.setStatus('mandatory')
a3ComRoutePolicyExportType = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 29, 4, 23, 1, 1, 12), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("ip-ospf-type1", 1), ("ip-ospf-type2", 2), ("default", 3))).clone('default')).setMaxAccess("readwrite")
if mibBuilder.loadTexts: a3ComRoutePolicyExportType.setStatus('mandatory')
a3ComRoutePolicyRowStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 29, 4, 23, 1, 1, 13), RowStatus()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: a3ComRoutePolicyRowStatus.setStatus('mandatory')
a3ComRoutePolicyNextFreeIndex = MibScalar((1, 3, 6, 1, 4, 1, 43, 29, 4, 23, 2), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 4294967295))).setMaxAccess("readonly")
if mibBuilder.loadTexts: a3ComRoutePolicyNextFreeIndex.setStatus('mandatory')
a3ComRoutePolicyIpIfTable = MibTable((1, 3, 6, 1, 4, 1, 43, 29, 4, 23, 3), )
if mibBuilder.loadTexts: a3ComRoutePolicyIpIfTable.setStatus('mandatory')
a3ComRoutePolicyIpIfEntry = MibTableRow((1, 3, 6, 1, 4, 1, 43, 29, 4, 23, 3, 1), ).setIndexNames((0, "A3COM-SWITCHING-SYSTEMS-ROUTEPOLICY-MIB", "a3ComRoutePolicyIpIfIndex"), (0, "A3COM-SWITCHING-SYSTEMS-ROUTEPOLICY-MIB", "a3ComRoutePolicyIpIfAddressIndex"))
if mibBuilder.loadTexts: a3ComRoutePolicyIpIfEntry.setStatus('mandatory')
a3ComRoutePolicyIpIfIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 29, 4, 23, 3, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 4294967295))).setMaxAccess("readonly")
if mibBuilder.loadTexts: a3ComRoutePolicyIpIfIndex.setStatus('mandatory')
a3ComRoutePolicyIpIfAddressIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 29, 4, 23, 3, 1, 2), IpAddress()).setMaxAccess("readonly")
if mibBuilder.loadTexts: a3ComRoutePolicyIpIfAddressIndex.setStatus('mandatory')
a3ComRoutePolicyIpIfRowStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 29, 4, 23, 3, 1, 3), RowStatus()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: a3ComRoutePolicyIpIfRowStatus.setStatus('mandatory')
mibBuilder.exportSymbols("A3COM-SWITCHING-SYSTEMS-ROUTEPOLICY-MIB", switchingSystemsMibs=switchingSystemsMibs, a3Com=a3Com, a3ComRoutePolicyAction=a3ComRoutePolicyAction, a3ComRoutePolicyIpIfEntry=a3ComRoutePolicyIpIfEntry, a3ComSwitchingSystemsMib=a3ComSwitchingSystemsMib, a3ComRoutePolicyRouteAddress=a3ComRoutePolicyRouteAddress, a3ComRoutePolicyIpIfAddressIndex=a3ComRoutePolicyIpIfAddressIndex, RowStatus=RowStatus, a3ComRoutePolicyExportType=a3ComRoutePolicyExportType, a3ComRoutePolicyRouteMask=a3ComRoutePolicyRouteMask, a3ComRoutePolicyEntry=a3ComRoutePolicyEntry, a3ComRoutePolicyIndex=a3ComRoutePolicyIndex, a3ComRoutePolicyIpIfRowStatus=a3ComRoutePolicyIpIfRowStatus, a3ComRoutePolicyNextFreeIndex=a3ComRoutePolicyNextFreeIndex, a3ComRoutePolicyTable=a3ComRoutePolicyTable, a3ComRoutePolicyIpIfTable=a3ComRoutePolicyIpIfTable, a3ComRoutePolicyType=a3ComRoutePolicyType, a3ComRoutePolicy=a3ComRoutePolicy, a3ComRoutePolicyAdjustMetric=a3ComRoutePolicyAdjustMetric, a3ComRoutePolicyProtocolType=a3ComRoutePolicyProtocolType, a3ComRoutePolicyRowStatus=a3ComRoutePolicyRowStatus, a3ComRoutePolicyMetric=a3ComRoutePolicyMetric, a3ComRoutePolicyOriginProtocol=a3ComRoutePolicyOriginProtocol, a3ComRoutePolicyIpIfIndex=a3ComRoutePolicyIpIfIndex, a3ComRoutePolicySourceAddress=a3ComRoutePolicySourceAddress, a3ComRoutePolicyWeight=a3ComRoutePolicyWeight)
|
#This function prints the initial menu
def print_program_menu():
print("\n")
print("Welcome to the probability & statistics calculator. Please, choose an option:")
print("1. Descripive Statistics")
#print("2. ")
#print("3. ")
#print("4. ")
#print("5. ")
print("6. Exit")
#Checks if option is a number
def identify_option(option):
if option.isdigit() : # Verify if this is a number
numeric_option = int(option)
# check if in range
if numeric_option >= 1 and numeric_option <= 6:
return numeric_option
else:
return -1 # invalid option
else:
return -1 # invalid option
|
# 10. Write a program to check whether an year is leap year or not.
year=int(input("Enter an year : "))
if (year%4==0) and (year%100!=0) or (year%400==0):
print(f"{year} is a leap year.")
else:
print(f"{year} is not a leap year.")
|
# 값 자체에 대한 자료형 확인
print(____(34))
# temperature 변수의 자료형을 확인
temperature = -1.5
print(____(_________))
|
def findone(L):
left = 0
right = len(L) - 1
while left < right:
mid = (left+right)// 2
isone = len(L[left:mid]) % 2
if L[mid] != L[mid-1] and L[mid] != L[mid+1]:
return L[mid]
if isone and L[mid] == L[mid-1]:
left = mid + 1
elif isone and L[mid] == L[mid + 1]:
right = mid - 1
elif not isone and L[mid] == L[mid-1]:
right = mid - 2
elif not isone and L[mid] == L[mid + 1]:
left = mid + 2
return L[left]
print(findone([3,3,7,7,10,11,11]))
print(findone([1,1,2,3,3,4,4,8,8]))
print(findone([9,9,1,1,2,3,3,4,4,8,8])) |
class BinarySearch:
def search(self, array, element):
first = 0
last = len(array) - 1
while first <= last:
mid = (first + last)//2
if array[mid] == element:
return mid
else:
if element < array[mid]:
last = mid - 1
else:
first = mid + 1
return False |
"""
Given a singly linked list of n nodes and find the smallest and largest elements in linked list.
"""
class ListNode:
def __init__(self, val=0, next=None):
self.val = val
self.next = next
def print_list(head):
while head:
print(f" {head.val} ->", end=" ")
head = head.next
print()
def min_max(head):
minVal, maxVal = 0, 0
while head:
minVal = min(minVal, head.val)
maxVal = max(maxVal, head.val)
head = head.next
return [minVal, maxVal]
def min_max_2(head):
minVal, maxVal = 0, 0
while head:
minVal = minVal if head.val > minVal else head.val
maxVal = maxVal if head.val < maxVal else head.val
head = head.next
return [minVal, maxVal]
def main():
nums = [8, 2, 4, 5, 7, 9, 12, 2, 1]
head = ListNode(10)
for num in nums:
node = ListNode(num, head)
head = node
print_list(head)
print(min_max(head))
print(min_max_2(head))
if __name__ == '__main__':
main()
|
MAX_RESULTS = '50'
CHANNELS_PART = 'brandingSettings,contentDetails,contentOwnerDetails,id,localizations,snippet,statistics,status,topicDetails'
VIDEOS_PART = 'contentDetails,id,liveStreamingDetails,localizations,player,recordingDetails,snippet,statistics,status,topicDetails'
SEARCH_PARTS = 'snippet'
COMMENT_THREADS_PARTS = 'id,snippet,replies'
COMMENTS_PARTS = 'id,snippet'
PLAYLIST_ITEMS_PARTS = 'id,snippet,contentDetails,status'
PLAYLISTS_PARTS = 'id,snippet,contentDetails,status,player,localizations'
BASE_URL = 'https://www.googleapis.com/youtube/v3'
|
# -*- coding: utf-8 -*-
"""db/tests/collection_test.py
By David J. Thomas, thePortus.com, dave.a.base@gmail.com
Unit test for the Collection, Publisher, Subject, and many-to-many tables
that join them
"""
|
heroes = {
"*Adagio*": "Adagio",
"*Alpha*": "Alpha",
"*Ardan*": "Ardan",
"*Baron*": "Baron",
"*Blackfeather*": "Blackfeather",
"*Catherine*": "Catherine",
"*Celeste*": "Celeste",
"*Flicker*": "Flicker",
"*Fortress*": "Fortress",
"*Glaive*": "Glaive",
"*Gwen*": "Gwen",
"*Krul*": "Krul",
"*Hero009*": "Krul",
"*Skaarf*": "Skaarf",
"*Hero010*": "Skaarf",
"*Rona*": "Rona",
"*Hero016*": "Rona",
"*Idris*": "Idris",
"*Joule*": "Joule",
"*Kestrel*": "Kestrel",
"*Koshka*": "Koshka",
"*Lance*": "Lance",
"*Lyra*": "Lyra",
"*Ozo*": "Ozo",
"*Petal*": "Petal",
"*Phinn*": "Phinn",
"*Reim*": "Reim",
"*Ringo*": "Ringo",
"*Samuel*": "Samuel",
"*SAW*": "SAW",
"*Taka*": "Taka",
"*Sayoc*": "Taka",
"*Skye*": "Skye",
"*Vox*": "Vox",
"*Grumpjaw*": "Grumpjaw",
"*Baptiste*": "Baptiste"
}
|
# Generated by h2py from /usr/include/netinet/in.h
# Included from net/nh.h
# Included from sys/machine.h
LITTLE_ENDIAN = 1234
BIG_ENDIAN = 4321
PDP_ENDIAN = 3412
BYTE_ORDER = BIG_ENDIAN
DEFAULT_GPR = 0xDEADBEEF
MSR_EE = 0x8000
MSR_PR = 0x4000
MSR_FP = 0x2000
MSR_ME = 0x1000
MSR_FE = 0x0800
MSR_FE0 = 0x0800
MSR_SE = 0x0400
MSR_BE = 0x0200
MSR_IE = 0x0100
MSR_FE1 = 0x0100
MSR_AL = 0x0080
MSR_IP = 0x0040
MSR_IR = 0x0020
MSR_DR = 0x0010
MSR_PM = 0x0004
DEFAULT_MSR = (MSR_EE | MSR_ME | MSR_AL | MSR_IR | MSR_DR)
DEFAULT_USER_MSR = (DEFAULT_MSR | MSR_PR)
CR_LT = 0x80000000
CR_GT = 0x40000000
CR_EQ = 0x20000000
CR_SO = 0x10000000
CR_FX = 0x08000000
CR_FEX = 0x04000000
CR_VX = 0x02000000
CR_OX = 0x01000000
XER_SO = 0x80000000
XER_OV = 0x40000000
XER_CA = 0x20000000
def XER_COMP_BYTE(xer): return ((xer >> 8) & 0x000000FF)
def XER_LENGTH(xer): return (xer & 0x0000007F)
DSISR_IO = 0x80000000
DSISR_PFT = 0x40000000
DSISR_LOCK = 0x20000000
DSISR_FPIO = 0x10000000
DSISR_PROT = 0x08000000
DSISR_LOOP = 0x04000000
DSISR_DRST = 0x04000000
DSISR_ST = 0x02000000
DSISR_SEGB = 0x01000000
DSISR_DABR = 0x00400000
DSISR_EAR = 0x00100000
SRR_IS_PFT = 0x40000000
SRR_IS_ISPEC = 0x20000000
SRR_IS_IIO = 0x10000000
SRR_IS_GUARD = 0x10000000
SRR_IS_PROT = 0x08000000
SRR_IS_LOOP = 0x04000000
SRR_PR_FPEN = 0x00100000
SRR_PR_INVAL = 0x00080000
SRR_PR_PRIV = 0x00040000
SRR_PR_TRAP = 0x00020000
SRR_PR_IMPRE = 0x00010000
def BUID_7F_SRVAL(raddr): return (0x87F00000 | (((uint)(raddr)) >> 28))
BT_256M = 0x1FFC
BT_128M = 0x0FFC
BT_64M = 0x07FC
BT_32M = 0x03FC
BT_16M = 0x01FC
BT_8M = 0x00FC
BT_4M = 0x007C
BT_2M = 0x003C
BT_1M = 0x001C
BT_512K = 0x000C
BT_256K = 0x0004
BT_128K = 0x0000
BT_NOACCESS = 0x0
BT_RDONLY = 0x1
BT_WRITE = 0x2
BT_VS = 0x2
BT_VP = 0x1
def BAT_ESEG(dbatu): return (((uint)(dbatu) >> 28))
MIN_BAT_SIZE = 0x00020000
MAX_BAT_SIZE = 0x10000000
def ntohl(x): return (x)
def ntohs(x): return (x)
def htonl(x): return (x)
def htons(x): return (x)
IPPROTO_IP = 0
IPPROTO_ICMP = 1
IPPROTO_IGMP = 2
IPPROTO_GGP = 3
IPPROTO_TCP = 6
IPPROTO_EGP = 8
IPPROTO_PUP = 12
IPPROTO_UDP = 17
IPPROTO_IDP = 22
IPPROTO_TP = 29
IPPROTO_LOCAL = 63
IPPROTO_EON = 80
IPPROTO_BIP = 0x53
IPPROTO_RAW = 255
IPPROTO_MAX = 256
IPPORT_RESERVED = 1024
IPPORT_USERRESERVED = 5000
IPPORT_TIMESERVER = 37
def IN_CLASSA(i): return (((int)(i) & 0x80000000) == 0)
IN_CLASSA_NET = 0xff000000
IN_CLASSA_NSHIFT = 24
IN_CLASSA_HOST = 0x00ffffff
IN_CLASSA_MAX = 128
def IN_CLASSB(i): return (((int)(i) & 0xc0000000) == 0x80000000)
IN_CLASSB_NET = 0xffff0000
IN_CLASSB_NSHIFT = 16
IN_CLASSB_HOST = 0x0000ffff
IN_CLASSB_MAX = 65536
def IN_CLASSC(i): return (((int)(i) & 0xe0000000) == 0xc0000000)
IN_CLASSC_NET = 0xffffff00
IN_CLASSC_NSHIFT = 8
IN_CLASSC_HOST = 0x000000ff
def IN_CLASSD(i): return (((int)(i) & 0xf0000000) == 0xe0000000)
def IN_MULTICAST(i): return IN_CLASSD(i)
IN_CLASSD_NET = 0xf0000000
IN_CLASSD_NSHIFT = 28
IN_CLASSD_HOST = 0x0fffffff
INADDR_UNSPEC_GROUP = 0xe0000000
INADDR_ALLHOSTS_GROUP = 0xe0000001
INADDR_MAX_LOCAL_GROUP = 0xe00000ff
def IN_EXPERIMENTAL(i): return (((int)(i) & 0xe0000000) == 0xe0000000)
def IN_BADCLASS(i): return (((int)(i) & 0xf0000000) == 0xf0000000)
INADDR_ANY = 0x00000000
INADDR_BROADCAST = 0xffffffff
INADDR_LOOPBACK = 0x7f000001
INADDR_NONE = 0xffffffff
IN_LOOPBACKNET = 127
IP_OPTIONS = 1
IP_HDRINCL = 2
IP_TOS = 3
IP_TTL = 4
IP_RECVOPTS = 5
IP_RECVRETOPTS = 6
IP_RECVDSTADDR = 7
IP_RETOPTS = 8
IP_MULTICAST_IF = 9
IP_MULTICAST_TTL = 10
IP_MULTICAST_LOOP = 11
IP_ADD_MEMBERSHIP = 12
IP_DROP_MEMBERSHIP = 13
IP_DEFAULT_MULTICAST_TTL = 1
IP_DEFAULT_MULTICAST_LOOP = 1
IP_MAX_MEMBERSHIPS = 20
|
characterMapNurse = {
"nurse_be1_001": "nurse_be1_001", # Auto: Same
"nurse_be1_002": "nurse_be1_002", # Auto: Same
"nurse_be1_003": "nurse_be1_003", # Auto: Same
"nurse_be1_full_001": "nurse_be1_full_001", # Auto: Same
"nurse_be1_full_002": "nurse_be1_full_002", # Auto: Same
"nurse_be1_full_003": "nurse_be1_full_003", # Auto: Same
"nurse_be1_full_naked_001": "nurse_be1_full_naked_001", # Auto: Same
"nurse_be1_full_naked_002": "nurse_be1_full_naked_002", # Auto: Same
"nurse_be1_full_naked_003": "nurse_be1_full_naked_003", # Auto: Same
"nurse_be1_full_skimp_001": "nurse_be1_full_skimp_001", # Auto: Same
"nurse_be1_full_skimp_002": "nurse_be1_full_skimp_002", # Auto: Same
"nurse_be1_full_skimp_003": "nurse_be1_full_skimp_003", # Auto: Same
"nurse_be1_full_under_001": "nurse_be1_full_under_001", # Auto: Same
"nurse_be1_full_under_002": "nurse_be1_full_under_002", # Auto: Same
"nurse_be1_full_under_003": "nurse_be1_full_under_003", # Auto: Same
"nurse_be1_naked_001": "nurse_be1_naked_001", # Auto: Same
"nurse_be1_naked_002": "nurse_be1_naked_002", # Auto: Same
"nurse_be1_naked_003": "nurse_be1_naked_003", # Auto: Same
"nurse_be1_skimp_001": "nurse_be1_skimp_001", # Auto: Same
"nurse_be1_skimp_002": "nurse_be1_skimp_002", # Auto: Same
"nurse_be1_skimp_003": "nurse_be1_skimp_003", # Auto: Same
"nurse_be1_under_001": "nurse_be1_under_001", # Auto: Same
"nurse_be1_under_002": "nurse_be1_under_002", # Auto: Same
"nurse_be1_under_003": "nurse_be1_under_003", # Auto: Same
"nurse_base_001": "nurse_base_001", # Auto: Edited
"nurse_base_002": "nurse_base_002", # Auto: Edited
"nurse_base_003": "nurse_base_003", # Auto: Edited
"nurse_base_full_001": "nurse_base_full_001", # Auto: Same
"nurse_base_full_002": "nurse_base_full_002", # Auto: Same
"nurse_base_full_003": "nurse_base_full_003", # Auto: Same
"nurse_base_full_naked_001": "nurse_base_full_naked_001", # Auto: Same
"nurse_base_full_naked_002": "nurse_base_full_naked_002", # Auto: Same
"nurse_base_full_naked_003": "nurse_base_full_naked_003", # Auto: Same
"nurse_base_full_skimp_001": "nurse_base_full_skimp_001", # Auto: Same
"nurse_base_full_skimp_002": "nurse_base_full_skimp_002", # Auto: Same
"nurse_base_full_skimp_003": "nurse_base_full_skimp_003", # Auto: Same
"nurse_base_full_under_001": "nurse_base_full_under_001", # Auto: Same
"nurse_base_full_under_002": "nurse_base_full_under_002", # Auto: Same
"nurse_base_full_under_003": "nurse_base_full_under_003", # Auto: Same
"nurse_base_naked_001": "nurse_base_naked_001", # Auto: Edited
"nurse_base_naked_002": "nurse_base_naked_002", # Auto: Edited
"nurse_base_naked_003": "nurse_base_naked_003", # Auto: Edited
"nurse_base_skimp_001": "nurse_base_skimp_001", # Auto: Edited
"nurse_base_skimp_002": "nurse_base_skimp_002", # Auto: Edited
"nurse_base_skimp_003": "nurse_base_skimp_003", # Auto: Edited
"nurse_base_under_001": "nurse_base_under_001", # Auto: Edited
"nurse_base_under_002": "nurse_base_under_002", # Auto: Edited
"nurse_base_under_003": "nurse_base_under_003", # Auto: Edited
"nurse_ex_001_001": "nurse_ex_001_001", # Auto: Same
"nurse_ex_001_neutral_001": "nurse_ex_001_neutral_001", # Auto: Same
"nurse_ex_001_smile_001": "nurse_ex_001_smile_001", # Auto: Same
"nurse_ex_002_001": "nurse_ex_002_smile_001", # Auto: Renamed
"nurse_ex_002_smile_001": "nurse_ex_002_001", # Auto: Renamed
"nurse_ex_003_001": "nurse_ex_003_irked_001", # Auto: Renamed
"nurse_ex_003_grin2_001": "nurse_ex_003_smile2_001", # Auto: Renamed
"nurse_ex_003_grin_001": "", # Auto: Deleted
"nurse_ex_003_open2_002": "nurse_ex_003_open2_002", # Auto: Same
"nurse_ex_003_open_001": "nurse_ex_003_irked2_001", # Auto: Renamed
"nurse_ex_004_001": "nurse_ex_004_open_001", # Auto: Renamed
"nurse_ex_004_closed_001": "nurse_ex_004_001", # Auto: Renamed
"nurse_ex_004_smile_001": "nurse_ex_004_smile_001", # Auto: Edited
"nurse_ex_005_001": "nurse_ex_005_001", # Auto: Same
"nurse_ex_005_open_001": "nurse_ex_005_open_001", # Auto: Same
"nurse_ex_005_smile2_001": "nurse_ex_005_smile2_001", # Auto: Same
"nurse_ex_005_smile_001": "nurse_ex_005_smile_001", # Auto: Same
"nurse_ex_006_001": "nurse_ex_006_001", # Auto: Same
"nurse_ex_006_open_001": "nurse_ex_006_open_001", # Auto: Same
"nurse_ex_006_smile2_001": "nurse_ex_006_smile2_001", # Auto: Same
"nurse_ex_006_smile_001": "nurse_ex_006_smile_001", # Auto: Same
"nurse_ex_007_001": "nurse_ex_005_aroused2_001", # Auto: Renamed
"nurse_ex_008_002": "", # Auto: Deleted
"nurse_ex_009_002": "nurse_ex_003_grin_002", # Auto: Renamed
"nurse_ex_010_002": "nurse_ex_012_002", # Auto: Renamed
"nurse_ex_011_003": "nurse_ex_007_003", # Auto: Renamed
"nurse_ex_012_003": "nurse_ex_008_003", # Auto: Renamed
"nurse_ex_013_003": "nurse_ex_013_003", # Auto: Same
"nurse_ex_full_001_001": "nurse_ex_full_001_001", # Auto: Same
"nurse_ex_full_001_neutral_001": "nurse_ex_full_001_neutral_001", # Auto: Same
"nurse_ex_full_001_smile_001": "nurse_ex_full_001_smile_001", # Auto: Same
"nurse_ex_full_002_001": "nurse_ex_full_002_smile_001", # Auto: Renamed
"nurse_ex_full_002_smile_001": "nurse_ex_full_002_001", # Auto: Renamed
"nurse_ex_full_003_001": "nurse_ex_full_003_irked_001", # Auto: Renamed
"nurse_ex_full_003_grin2_001": "nurse_ex_full_003_smile2_001", # Auto: Renamed
"nurse_ex_full_003_grin_001": "", # Auto: Deleted
"nurse_ex_full_003_open2_002": "nurse_ex_full_003_open2_002", # Auto: Same
"nurse_ex_full_003_open_001": "nurse_ex_full_003_irked2_001", # Auto: Renamed
"nurse_ex_full_004_001": "nurse_ex_full_004_open_001", # Auto: Renamed
"nurse_ex_full_004_closed_001": "nurse_ex_full_004_001", # Auto: Renamed
"nurse_ex_full_004_smile_001": "nurse_ex_full_004_smile_001", # Auto: Edited
"nurse_ex_full_005_001": "nurse_ex_full_005_001", # Auto: Same
"nurse_ex_full_005_open_001": "nurse_ex_full_005_open_001", # Auto: Same
"nurse_ex_full_005_smile2_001": "nurse_ex_full_005_smile2_001", # Auto: Same
"nurse_ex_full_005_smile_001": "nurse_ex_full_005_smile_001", # Auto: Same
"nurse_ex_full_006_001": "nurse_ex_full_006_001", # Auto: Same
"nurse_ex_full_006_open_001": "nurse_ex_full_006_open_001", # Auto: Same
"nurse_ex_full_006_smile2_001": "nurse_ex_full_006_smile2_001", # Auto: Same
"nurse_ex_full_006_smile_001": "nurse_ex_full_006_smile_001", # Auto: Same
"nurse_ex_full_007_001": "nurse_ex_full_005_aroused2_001", # Auto: Renamed
"nurse_ex_full_008_002": "", # Auto: Deleted
"nurse_ex_full_009_002": "nurse_ex_full_003_grin_002", # Auto: Renamed
"nurse_ex_full_010_002": "nurse_ex_full_012_002", # Auto: Renamed
"nurse_ex_full_011_003": "nurse_ex_full_007_003", # Auto: Renamed
"nurse_ex_full_012_003": "nurse_ex_full_008_003", # Auto: Renamed
"nurse_ex_full_013_003": "nurse_ex_full_013_003", # Auto: Same
}
|
nombre="roberto"
edad=25
persona=["jorge","peralta",34256643,1987,0]
print(persona)
clave_personal=persona[2] * persona[-2]
print(clave_personal)
persona[-1]=clave_personal
print(persona)
|
Mystring = "Castlevania"
Mystring2 = "C a s t l e v a n i a"
Otherstring = "Mankind"
# Comando dir -> Sacar Metodos
# print(dir(Mystring))
# print(Mystring.title())
# print(Mystring.upper())
# print(Otherstring.lower())
# print(Mystring.lower())
# print(Mystring.swapcase())
# print(Otherstring.replace("Mankind", "Pale"))
# print(Mystring.count("a"))
# print(Otherstring.count("n"))
# print(Mystring.startswith("C"))
# print(Mystring.endswith("C"))
# print(Mystring2.split())
# print(Mystring.split("a"))
# print(Mystring.find("C"))
# print(len(Mystring))
# print(Mystring[0])
# print(Mystring[1])
# print(Mystring[2])
# print(Mystring[3])
# print(Mystring[4])
# print(Mystring[5])
# print(Mystring[6])
# print(Mystring[7])
# print(Mystring[8])
# print(Mystring[9])
# print(Mystring[10])
# Formas de concatenar
print(f"My favorite game is {Mystring}") # 3.6 -> Version mas actual
print("My favorite game is " + Mystring)
print("My favorite game is {0}".format(Mystring))
print(f"{Otherstring} in spanish is Humanidad") |
# define the paths to the image directory
IMAGES_PATH = "../dataset/kaggle_dogs_vs_cats/train"
# since we do not have the validation data or acces to the testing
# labels we need to take a number of images from the training
# data and use them instead
NUM_CLASSES = 2
NUM_VALIDATION_IMAGES = 1250 * NUM_CLASSES
NUM_TEST_IMAGES = 1250 * NUM_CLASSES
# define the path to the output training, validation, and testing
# HDF5 files
TRAIN_HDF5 = "../dataset/kaggle_dogs_vs_cats/hdf5/train.hdf5"
VALIDATION_HDF5 = "../dataset/kaggle_dogs_vs_cats/hdf5/validation.hdf5"
TEST_HDF5 = "../dataset/kaggle_dogs_vs_cats/hdf5/test.hdf5"
# path to the output model file
MODEL_PATH = "output/alexnet_dogs_vs_cats.model"
# define the path to the dataset mean
DATASET_MEAN = "output/dogs_vs_cats_mean.json"
# define the path to the output directory used for storing plots,
# classification reports, etc
OUTPUT_PATH = "output" |
##
## code
##
pmLookup = {
b'00': 'Film',
b'01': 'Cinema',
b'02': 'Animation',
b'03': 'Natural',
b'04': 'HDR10',
b'06': 'THX',
b'0B': 'FrameAdaptHDR',
b'0C': 'User1',
b'0D': 'User2',
b'0E': 'User3',
b'0F': 'User4',
b'10': 'User5',
b'11': 'User6',
b'14': 'HLG',
b'16': 'PanaPQ'
}
def getPictureMode(bin):
if bin in pmLookup:
return pmLookup[bin]
else:
return 'Unknown' + bin.decode('ascii') |
# Copyright 2019 The Vearch Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# ==============================================================================
#Definition of parameters
# Define which port the web runs on
# you can view the result of searching by
# inputting http://yourIP:show_port in your web browse
port = 4101
# Batch Extraction Features, you can modify batch_size by
# your GPU Memory
batch_size = 16
# The name of model for web platform, Currently only one model is supported
detect_model = "yolo3"
extract_model = "vgg16"
# Define gpu parameters,
gpu = "0"
# Define deployment address of vearch
ip_address = "http://****"
ip_scheme = ip_address + ":443/space"
ip_insert = ip_address + ":80"
database_name = "test"
table_name = "test"
|
class Test_2020(object):
def __init__(self):
self.a = 1
print(f'success')
def add_a(self):
self.a += 1
|
# Nº 9 - Tabuada
# Descrição: Faça um programa que leia um número Inteiro qualquer e mostre na tela a
# sua tabuada.
class CalculadoraDeTabuada():
'''Calcula um número indicado pelo usuário multiplicado de 1 a 10.'''
def __init__(self):
self.numero = 0
self.resultados = []
def iniciar(self):
'''Função inicial do programa.'''
print(f'{" CALCULADORA DE TABUADA ":*^40}')
self.receber_numero()
self.calcular_tabuada()
self.mostrar_resultados()
print('\nTenha um bom dia!')
def receber_numero(self):
'''Recebe número indicado pelo usuário para cálculo de tabuada.'''
print('Indique o número que deseja calcular a tabuada:')
while True:
try:
self.numero = int(input())
break
except ValueError:
print('Digite um número inteiro, sem espaços ou letras.')
def calcular_tabuada(self):
'''Calcula a tabuada de um número indicado pelo usuário.'''
for i in range(1, 11):
self.resultados.append(self.numero * i) # Resultados armazenados em uma lista.
return None
def mostrar_resultados(self):
'''Exibe os cálculos e resultados.'''
print('-' * 20)
for i in range(1, 11):
print(f'{self.numero} X {i : >2} = {self.resultados[i - 1]}')
print('-' * 20)
return None
tabuada = CalculadoraDeTabuada()
tabuada.iniciar()
|
lista = list()
ficha = list()
print('-'*20)
print(' Escola Dueto')
print('-'*20)
while True:
lista.append(str(input('Digite seu 1ª nome = ')))
lista.append(float(input('Digite a 1ª nota: ')))
lista.append(float(input('Digite a 2ª nota: ')))
media = (lista[1] + lista[2])/ 2
lista.append(media)
ficha.append(lista[:])
lista.clear()
op = str(input('Deseja cadastra outro aluno?[S/N]: '))
if op in 'Nn':
break
print('-='*15)
for n in range(0,len(ficha)):
if n == 0:
print(f'{"Nº":<4}{"Nome":<10}{"Média":>8}')
print(f'{n:<4}{ficha[n][0].capitalize():<10}{ficha[n][3]:>8.2f}')
while True:
opc = int(input('Deseja ver a nota de qual aluno?[999 para sair]: '))
if opc == 999:
print('FINALIZANDO...')
break
print(f'As notas de {ficha[opc][0].capitalize()} foram: {ficha[opc][1:3]}')
|
#
# PySNMP MIB module ALCATEL-IND1-VIRTUAL-FLOW-CONTROL-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/ALCATEL-IND1-VIRTUAL-FLOW-CONTROL-MIB
# Produced by pysmi-0.3.4 at Mon Apr 29 17:01:40 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)
#
softentIND1Vfc, = mibBuilder.importSymbols("ALCATEL-IND1-BASE", "softentIND1Vfc")
ObjectIdentifier, Integer, OctetString = mibBuilder.importSymbols("ASN1", "ObjectIdentifier", "Integer", "OctetString")
NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues")
ConstraintsUnion, ValueRangeConstraint, ValueSizeConstraint, ConstraintsIntersection, SingleValueConstraint = mibBuilder.importSymbols("ASN1-REFINEMENT", "ConstraintsUnion", "ValueRangeConstraint", "ValueSizeConstraint", "ConstraintsIntersection", "SingleValueConstraint")
InterfaceIndex, = mibBuilder.importSymbols("IF-MIB", "InterfaceIndex")
SnmpAdminString, = mibBuilder.importSymbols("SNMP-FRAMEWORK-MIB", "SnmpAdminString")
NotificationGroup, ModuleCompliance, ObjectGroup = mibBuilder.importSymbols("SNMPv2-CONF", "NotificationGroup", "ModuleCompliance", "ObjectGroup")
Integer32, IpAddress, MibScalar, MibTable, MibTableRow, MibTableColumn, MibIdentifier, Bits, ModuleIdentity, TimeTicks, Counter64, Unsigned32, Counter32, NotificationType, ObjectIdentity, Gauge32, iso = mibBuilder.importSymbols("SNMPv2-SMI", "Integer32", "IpAddress", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "MibIdentifier", "Bits", "ModuleIdentity", "TimeTicks", "Counter64", "Unsigned32", "Counter32", "NotificationType", "ObjectIdentity", "Gauge32", "iso")
TextualConvention, RowStatus, DisplayString, DateAndTime = mibBuilder.importSymbols("SNMPv2-TC", "TextualConvention", "RowStatus", "DisplayString", "DateAndTime")
alcatelIND1VfcMIB = ModuleIdentity((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 61, 1))
alcatelIND1VfcMIB.setRevisions(('2010-03-15 00:00',))
if mibBuilder.loadTexts: alcatelIND1VfcMIB.setLastUpdated('201003150000Z')
if mibBuilder.loadTexts: alcatelIND1VfcMIB.setOrganization('Alcatel-Lucent')
alcatelIND1VfcMIBObjects = ObjectIdentity((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 61, 1, 1))
if mibBuilder.loadTexts: alcatelIND1VfcMIBObjects.setStatus('current')
alcatelIND1VfcMIBConformance = ObjectIdentity((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 61, 1, 2))
if mibBuilder.loadTexts: alcatelIND1VfcMIBConformance.setStatus('current')
alcatelIND1VfcMIBGroups = ObjectIdentity((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 61, 1, 2, 1))
if mibBuilder.loadTexts: alcatelIND1VfcMIBGroups.setStatus('current')
alcatelIND1VfcMIBCompliances = ObjectIdentity((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 61, 1, 2, 2))
if mibBuilder.loadTexts: alcatelIND1VfcMIBCompliances.setStatus('current')
alaVfcConfig = MibIdentifier((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 61, 1, 1, 1))
alaVfcConformance = MibIdentifier((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 61, 1, 1, 2))
class VfcEnableState(TextualConvention, Integer32):
status = 'current'
subtypeSpec = Integer32.subtypeSpec + ConstraintsUnion(SingleValueConstraint(0, 1))
namedValues = NamedValues(("disabled", 0), ("enabled", 1))
class VfcBwLimitType(TextualConvention, Integer32):
status = 'current'
subtypeSpec = Integer32.subtypeSpec + ConstraintsUnion(SingleValueConstraint(1, 2))
namedValues = NamedValues(("mbits", 1), ("percentage", 2))
class VfcProfileType(TextualConvention, Integer32):
status = 'current'
subtypeSpec = Integer32.subtypeSpec + ConstraintsUnion(SingleValueConstraint(1, 2, 3))
namedValues = NamedValues(("wredProfile", 1), ("qsetProfile", 2), ("qProfile", 3))
class VfcQueueType(TextualConvention, Integer32):
status = 'current'
class VfcQsetAction(TextualConvention, Integer32):
status = 'deprecated'
subtypeSpec = Integer32.subtypeSpec + ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3))
namedValues = NamedValues(("default", 0), ("override", 1), ("detach", 2), ("revert", 3))
class VfcQsapList(TextualConvention, OctetString):
status = 'current'
subtypeSpec = OctetString.subtypeSpec + ValueSizeConstraint(0, 128)
class VfcQsapType(TextualConvention, Integer32):
status = 'current'
subtypeSpec = Integer32.subtypeSpec + ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6, 7, 8))
namedValues = NamedValues(("all", 1), ("slot", 2), ("slotport", 3), ("lag", 4), ("ipif", 5), ("lsp", 6), ("sbind", 7), ("sap", 8))
class VfcSchedulingMethod(TextualConvention, Integer32):
status = 'current'
subtypeSpec = Integer32.subtypeSpec + ConstraintsUnion(SingleValueConstraint(1, 2))
namedValues = NamedValues(("strictPriority", 1), ("queueSpecified", 2))
class VfcWfqMode(TextualConvention, Integer32):
status = 'current'
subtypeSpec = Integer32.subtypeSpec + ConstraintsUnion(SingleValueConstraint(1, 2))
namedValues = NamedValues(("werr", 1), ("wrr", 2))
class VfcProfileMode(TextualConvention, Integer32):
status = 'current'
subtypeSpec = Integer32.subtypeSpec + ConstraintsUnion(SingleValueConstraint(1, 2))
namedValues = NamedValues(("nonDcb", 1), ("dcb", 2))
alaVfcWREDProfileTable = MibTable((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 61, 1, 1, 1, 1), )
if mibBuilder.loadTexts: alaVfcWREDProfileTable.setStatus('current')
alaVfcWREDProfileEntry = MibTableRow((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 61, 1, 1, 1, 1, 1), ).setIndexNames((0, "ALCATEL-IND1-VIRTUAL-FLOW-CONTROL-MIB", "alaVfcWRPId"))
if mibBuilder.loadTexts: alaVfcWREDProfileEntry.setStatus('current')
alaVfcWRPId = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 61, 1, 1, 1, 1, 1, 1), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(1, 16)))
if mibBuilder.loadTexts: alaVfcWRPId.setStatus('current')
alaVfcWRPAdminState = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 61, 1, 1, 1, 1, 1, 2), VfcEnableState().clone('disabled')).setMaxAccess("readcreate")
if mibBuilder.loadTexts: alaVfcWRPAdminState.setStatus('deprecated')
alaVfcWRPName = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 61, 1, 1, 1, 1, 1, 3), SnmpAdminString().subtype(subtypeSpec=ValueSizeConstraint(0, 32))).setMaxAccess("readonly")
if mibBuilder.loadTexts: alaVfcWRPName.setStatus('current')
alaVfcWRPGreenMinThreshold = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 61, 1, 1, 1, 1, 1, 4), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(0, 100)).clone(90)).setMaxAccess("readonly")
if mibBuilder.loadTexts: alaVfcWRPGreenMinThreshold.setStatus('current')
alaVfcWRPGreenMaxThreshold = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 61, 1, 1, 1, 1, 1, 5), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(0, 100)).clone(90)).setMaxAccess("readonly")
if mibBuilder.loadTexts: alaVfcWRPGreenMaxThreshold.setStatus('current')
alaVfcWRPGreenMaxDropProbability = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 61, 1, 1, 1, 1, 1, 6), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(0, 100)).clone(10)).setMaxAccess("readonly")
if mibBuilder.loadTexts: alaVfcWRPGreenMaxDropProbability.setStatus('current')
alaVfcWRPGreenGain = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 61, 1, 1, 1, 1, 1, 7), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(0, 15)).clone(7)).setMaxAccess("readonly")
if mibBuilder.loadTexts: alaVfcWRPGreenGain.setStatus('current')
alaVfcWRPYellowMinThreshold = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 61, 1, 1, 1, 1, 1, 8), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(0, 100)).clone(90)).setMaxAccess("readonly")
if mibBuilder.loadTexts: alaVfcWRPYellowMinThreshold.setStatus('current')
alaVfcWRPYellowMaxThreshold = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 61, 1, 1, 1, 1, 1, 9), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(0, 100)).clone(90)).setMaxAccess("readonly")
if mibBuilder.loadTexts: alaVfcWRPYellowMaxThreshold.setStatus('current')
alaVfcWRPYellowMaxDropProbability = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 61, 1, 1, 1, 1, 1, 10), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(0, 100)).clone(10)).setMaxAccess("readonly")
if mibBuilder.loadTexts: alaVfcWRPYellowMaxDropProbability.setStatus('current')
alaVfcWRPYellowGain = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 61, 1, 1, 1, 1, 1, 11), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(0, 15)).clone(7)).setMaxAccess("readonly")
if mibBuilder.loadTexts: alaVfcWRPYellowGain.setStatus('current')
alaVfcWRPRedMinThreshold = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 61, 1, 1, 1, 1, 1, 12), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(0, 100)).clone(90)).setMaxAccess("readonly")
if mibBuilder.loadTexts: alaVfcWRPRedMinThreshold.setStatus('current')
alaVfcWRPRedMaxThreshold = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 61, 1, 1, 1, 1, 1, 13), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(0, 100)).clone(90)).setMaxAccess("readonly")
if mibBuilder.loadTexts: alaVfcWRPRedMaxThreshold.setStatus('current')
alaVfcWRPRedMaxDropProbability = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 61, 1, 1, 1, 1, 1, 14), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(0, 100)).clone(10)).setMaxAccess("readonly")
if mibBuilder.loadTexts: alaVfcWRPRedMaxDropProbability.setStatus('current')
alaVfcWRPRedGain = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 61, 1, 1, 1, 1, 1, 15), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(0, 15)).clone(7)).setMaxAccess("readonly")
if mibBuilder.loadTexts: alaVfcWRPRedGain.setStatus('current')
alaVfcWRPStatsAdmin = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 61, 1, 1, 1, 1, 1, 16), VfcEnableState().clone('disabled')).setMaxAccess("readonly")
if mibBuilder.loadTexts: alaVfcWRPStatsAdmin.setStatus('deprecated')
alaVfcWRPAttachmentCount = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 61, 1, 1, 1, 1, 1, 17), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(0, 16384))).setMaxAccess("readonly")
if mibBuilder.loadTexts: alaVfcWRPAttachmentCount.setStatus('current')
alaVfcWRPMTU = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 61, 1, 1, 1, 1, 1, 18), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(0, 16384))).setMaxAccess("readonly")
if mibBuilder.loadTexts: alaVfcWRPMTU.setStatus('current')
alaVfcWRPLastChange = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 61, 1, 1, 1, 1, 1, 19), DateAndTime()).setMaxAccess("readonly")
if mibBuilder.loadTexts: alaVfcWRPLastChange.setStatus('current')
alaVfcWRPRowStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 61, 1, 1, 1, 1, 1, 20), RowStatus()).setMaxAccess("readonly")
if mibBuilder.loadTexts: alaVfcWRPRowStatus.setStatus('current')
alaVfcQsetProfileTable = MibTable((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 61, 1, 1, 1, 2), )
if mibBuilder.loadTexts: alaVfcQsetProfileTable.setStatus('current')
alaVfcQsetProfileEntry = MibTableRow((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 61, 1, 1, 1, 2, 1), ).setIndexNames((0, "ALCATEL-IND1-VIRTUAL-FLOW-CONTROL-MIB", "alaVfcQSPId"))
if mibBuilder.loadTexts: alaVfcQsetProfileEntry.setStatus('current')
alaVfcQSPId = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 61, 1, 1, 1, 2, 1, 1), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(1, 8)))
if mibBuilder.loadTexts: alaVfcQSPId.setStatus('current')
alaVfcQSPAdminState = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 61, 1, 1, 1, 2, 1, 2), VfcEnableState().clone('enabled')).setMaxAccess("readonly")
if mibBuilder.loadTexts: alaVfcQSPAdminState.setStatus('deprecated')
alaVfcQSPName = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 61, 1, 1, 1, 2, 1, 3), SnmpAdminString().subtype(subtypeSpec=ValueSizeConstraint(0, 32))).setMaxAccess("readonly")
if mibBuilder.loadTexts: alaVfcQSPName.setStatus('current')
alaVfcQSPType = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 61, 1, 1, 1, 2, 1, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("static", 1), ("dynamic", 2)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: alaVfcQSPType.setStatus('current')
alaVfcQSPTemplateId = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 61, 1, 1, 1, 2, 1, 5), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(0, 8))).setMaxAccess("readonly")
if mibBuilder.loadTexts: alaVfcQSPTemplateId.setStatus('current')
alaVfcQSPTemplateName = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 61, 1, 1, 1, 2, 1, 6), SnmpAdminString().subtype(subtypeSpec=ValueSizeConstraint(0, 32))).setMaxAccess("readonly")
if mibBuilder.loadTexts: alaVfcQSPTemplateName.setStatus('current')
alaVfcQSPBandwidthLimitType = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 61, 1, 1, 1, 2, 1, 7), VfcBwLimitType().clone('percentage')).setMaxAccess("readonly")
if mibBuilder.loadTexts: alaVfcQSPBandwidthLimitType.setStatus('current')
alaVfcQSPBandwidthLimitValue = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 61, 1, 1, 1, 2, 1, 8), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: alaVfcQSPBandwidthLimitValue.setStatus('current')
alaVfcQSPQueueCount = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 61, 1, 1, 1, 2, 1, 9), Unsigned32().clone(8)).setMaxAccess("readonly")
if mibBuilder.loadTexts: alaVfcQSPQueueCount.setStatus('current')
alaVfcQSPWRPId = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 61, 1, 1, 1, 2, 1, 10), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(1, 16))).setMaxAccess("readonly")
if mibBuilder.loadTexts: alaVfcQSPWRPId.setStatus('current')
alaVfcQSPWRPName = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 61, 1, 1, 1, 2, 1, 11), SnmpAdminString().subtype(subtypeSpec=ValueSizeConstraint(0, 32))).setMaxAccess("readonly")
if mibBuilder.loadTexts: alaVfcQSPWRPName.setStatus('current')
alaVfcQSPWRPAdminState = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 61, 1, 1, 1, 2, 1, 12), VfcEnableState().clone('disabled')).setMaxAccess("readcreate")
if mibBuilder.loadTexts: alaVfcQSPWRPAdminState.setStatus('deprecated')
alaVfcQSPSchedulingMethod = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 61, 1, 1, 1, 2, 1, 13), VfcSchedulingMethod().clone('strictPriority')).setMaxAccess("readonly")
if mibBuilder.loadTexts: alaVfcQSPSchedulingMethod.setStatus('current')
alaVfcQSPStatsAdmin = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 61, 1, 1, 1, 2, 1, 14), VfcEnableState().clone('disabled')).setMaxAccess("readcreate")
if mibBuilder.loadTexts: alaVfcQSPStatsAdmin.setStatus('deprecated')
alaVfcQSPAttachmentCount = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 61, 1, 1, 1, 2, 1, 15), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: alaVfcQSPAttachmentCount.setStatus('current')
alaVfcQSPLastChange = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 61, 1, 1, 1, 2, 1, 16), DateAndTime()).setMaxAccess("readonly")
if mibBuilder.loadTexts: alaVfcQSPLastChange.setStatus('current')
alaVfcQSPRowStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 61, 1, 1, 1, 2, 1, 17), RowStatus()).setMaxAccess("readonly")
if mibBuilder.loadTexts: alaVfcQSPRowStatus.setStatus('current')
alaVfcQsetInstanceTable = MibTable((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 61, 1, 1, 1, 3), )
if mibBuilder.loadTexts: alaVfcQsetInstanceTable.setStatus('current')
alaVfcQsetInstanceEntry = MibTableRow((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 61, 1, 1, 1, 3, 1), ).setIndexNames((0, "ALCATEL-IND1-VIRTUAL-FLOW-CONTROL-MIB", "alaVfcQsetId"))
if mibBuilder.loadTexts: alaVfcQsetInstanceEntry.setStatus('current')
alaVfcQsetId = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 61, 1, 1, 1, 3, 1, 1), Unsigned32())
if mibBuilder.loadTexts: alaVfcQsetId.setStatus('current')
alaVfcQsetQsapId = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 61, 1, 1, 1, 3, 1, 2), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: alaVfcQsetQsapId.setStatus('current')
alaVfcQsetAdminState = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 61, 1, 1, 1, 3, 1, 3), VfcEnableState().clone('enabled')).setMaxAccess("readwrite")
if mibBuilder.loadTexts: alaVfcQsetAdminState.setStatus('deprecated')
alaVfcQsetOperState = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 61, 1, 1, 1, 3, 1, 4), VfcEnableState().clone('enabled')).setMaxAccess("readonly")
if mibBuilder.loadTexts: alaVfcQsetOperState.setStatus('deprecated')
alaVfcQsetQSPId = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 61, 1, 1, 1, 3, 1, 5), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(1, 128))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: alaVfcQsetQSPId.setStatus('current')
alaVfcQsetQSPName = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 61, 1, 1, 1, 3, 1, 6), SnmpAdminString().subtype(subtypeSpec=ValueSizeConstraint(0, 32))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: alaVfcQsetQSPName.setStatus('current')
alaVfcQsetOperBandwidthLimitType = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 61, 1, 1, 1, 3, 1, 7), VfcBwLimitType().clone('percentage')).setMaxAccess("readonly")
if mibBuilder.loadTexts: alaVfcQsetOperBandwidthLimitType.setStatus('current')
alaVfcQsetOperBandwidthLimitValue = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 61, 1, 1, 1, 3, 1, 8), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: alaVfcQsetOperBandwidthLimitValue.setStatus('current')
alaVfcQsetBandwidthLimitType = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 61, 1, 1, 1, 3, 1, 9), VfcBwLimitType().clone('percentage')).setMaxAccess("readonly")
if mibBuilder.loadTexts: alaVfcQsetBandwidthLimitType.setStatus('deprecated')
alaVfcQsetBandwidthLimitValue = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 61, 1, 1, 1, 3, 1, 10), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: alaVfcQsetBandwidthLimitValue.setStatus('deprecated')
alaVfcQsetQueueCount = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 61, 1, 1, 1, 3, 1, 11), Unsigned32().clone(8)).setMaxAccess("readonly")
if mibBuilder.loadTexts: alaVfcQsetQueueCount.setStatus('deprecated')
alaVfcQsetWRPId = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 61, 1, 1, 1, 3, 1, 12), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(1, 16))).setMaxAccess("readonly")
if mibBuilder.loadTexts: alaVfcQsetWRPId.setStatus('deprecated')
alaVfcQsetWRPName = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 61, 1, 1, 1, 3, 1, 13), SnmpAdminString().subtype(subtypeSpec=ValueSizeConstraint(0, 32))).setMaxAccess("readonly")
if mibBuilder.loadTexts: alaVfcQsetWRPName.setStatus('deprecated')
alaVfcQsetWRPAdminState = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 61, 1, 1, 1, 3, 1, 14), VfcEnableState().clone('disabled')).setMaxAccess("readwrite")
if mibBuilder.loadTexts: alaVfcQsetWRPAdminState.setStatus('current')
alaVfcQsetWRPOperState = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 61, 1, 1, 1, 3, 1, 15), VfcEnableState().clone('disabled')).setMaxAccess("readonly")
if mibBuilder.loadTexts: alaVfcQsetWRPOperState.setStatus('current')
alaVfcQsetSchedulingMethod = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 61, 1, 1, 1, 3, 1, 16), VfcSchedulingMethod().clone('strictPriority')).setMaxAccess("readonly")
if mibBuilder.loadTexts: alaVfcQsetSchedulingMethod.setStatus('deprecated')
alaVfcQsetStatsAdmin = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 61, 1, 1, 1, 3, 1, 17), VfcEnableState().clone('disabled')).setMaxAccess("readwrite")
if mibBuilder.loadTexts: alaVfcQsetStatsAdmin.setStatus('current')
alaVfcQsetStatsOper = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 61, 1, 1, 1, 3, 1, 18), VfcEnableState().clone('disabled')).setMaxAccess("readonly")
if mibBuilder.loadTexts: alaVfcQsetStatsOper.setStatus('current')
alaVfcQsetLastChange = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 61, 1, 1, 1, 3, 1, 19), DateAndTime()).setMaxAccess("readonly")
if mibBuilder.loadTexts: alaVfcQsetLastChange.setStatus('current')
alaVfcQsetStatsClear = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 61, 1, 1, 1, 3, 1, 20), VfcEnableState().clone('disabled')).setMaxAccess("readwrite")
if mibBuilder.loadTexts: alaVfcQsetStatsClear.setStatus('current')
alaVfcQsetStatsInterval = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 61, 1, 1, 1, 3, 1, 21), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(10, 300))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: alaVfcQsetStatsInterval.setStatus('current')
alaVfcQsetMisconfigured = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 61, 1, 1, 1, 3, 1, 22), VfcEnableState().clone('disabled')).setMaxAccess("readonly")
if mibBuilder.loadTexts: alaVfcQsetMisconfigured.setStatus('current')
alaVfcQsetMode = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 61, 1, 1, 1, 3, 1, 23), VfcProfileMode()).setMaxAccess("readonly")
if mibBuilder.loadTexts: alaVfcQsetMode.setStatus('current')
alaVfcQProfileTable = MibTable((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 61, 1, 1, 1, 4), )
if mibBuilder.loadTexts: alaVfcQProfileTable.setStatus('current')
alaVfcQProfileEntry = MibTableRow((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 61, 1, 1, 1, 4, 1), ).setIndexNames((0, "ALCATEL-IND1-VIRTUAL-FLOW-CONTROL-MIB", "alaVfcQPQSPId"), (0, "ALCATEL-IND1-VIRTUAL-FLOW-CONTROL-MIB", "alaVfcQPQId"))
if mibBuilder.loadTexts: alaVfcQProfileEntry.setStatus('current')
alaVfcQPQSPId = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 61, 1, 1, 1, 4, 1, 1), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(1, 8)))
if mibBuilder.loadTexts: alaVfcQPQSPId.setStatus('current')
alaVfcQPQId = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 61, 1, 1, 1, 4, 1, 2), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(1, 8)))
if mibBuilder.loadTexts: alaVfcQPQId.setStatus('current')
alaVfcQPAdminState = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 61, 1, 1, 1, 4, 1, 3), VfcEnableState().clone('disabled')).setMaxAccess("readonly")
if mibBuilder.loadTexts: alaVfcQPAdminState.setStatus('deprecated')
alaVfcQPWRPId = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 61, 1, 1, 1, 4, 1, 4), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(1, 16))).setMaxAccess("readonly")
if mibBuilder.loadTexts: alaVfcQPWRPId.setStatus('current')
alaVfcQPWRPName = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 61, 1, 1, 1, 4, 1, 5), SnmpAdminString().subtype(subtypeSpec=ValueSizeConstraint(0, 32))).setMaxAccess("readonly")
if mibBuilder.loadTexts: alaVfcQPWRPName.setStatus('current')
alaVfcQPWRPAdminState = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 61, 1, 1, 1, 4, 1, 6), VfcEnableState().clone('disabled')).setMaxAccess("readonly")
if mibBuilder.loadTexts: alaVfcQPWRPAdminState.setStatus('deprecated')
alaVfcQPQSPName = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 61, 1, 1, 1, 4, 1, 7), SnmpAdminString().subtype(subtypeSpec=ValueSizeConstraint(0, 32))).setMaxAccess("readonly")
if mibBuilder.loadTexts: alaVfcQPQSPName.setStatus('current')
alaVfcQPTrafficClass = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 61, 1, 1, 1, 4, 1, 8), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(0, 7))).setMaxAccess("readonly")
if mibBuilder.loadTexts: alaVfcQPTrafficClass.setStatus('current')
alaVfcQPQType = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 61, 1, 1, 1, 4, 1, 9), VfcQueueType()).setMaxAccess("readonly")
if mibBuilder.loadTexts: alaVfcQPQType.setStatus('current')
alaVfcQPCIRBandwidthLimitType = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 61, 1, 1, 1, 4, 1, 10), VfcBwLimitType()).setMaxAccess("readonly")
if mibBuilder.loadTexts: alaVfcQPCIRBandwidthLimitType.setStatus('current')
alaVfcQPCIRBandwidthLimitValue = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 61, 1, 1, 1, 4, 1, 11), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: alaVfcQPCIRBandwidthLimitValue.setStatus('current')
alaVfcQPPIRBandwidthLimitType = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 61, 1, 1, 1, 4, 1, 12), VfcBwLimitType()).setMaxAccess("readonly")
if mibBuilder.loadTexts: alaVfcQPPIRBandwidthLimitType.setStatus('current')
alaVfcQPPIRBandwidthLimitValue = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 61, 1, 1, 1, 4, 1, 13), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: alaVfcQPPIRBandwidthLimitValue.setStatus('current')
alaVfcQPStatsAdmin = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 61, 1, 1, 1, 4, 1, 14), VfcEnableState().clone('disabled')).setMaxAccess("readonly")
if mibBuilder.loadTexts: alaVfcQPStatsAdmin.setStatus('deprecated')
alaVfcQPCbs = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 61, 1, 1, 1, 4, 1, 15), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: alaVfcQPCbs.setStatus('current')
alaVfcQPMbs = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 61, 1, 1, 1, 4, 1, 16), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: alaVfcQPMbs.setStatus('current')
alaVfcQPLastChange = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 61, 1, 1, 1, 4, 1, 17), DateAndTime()).setMaxAccess("readonly")
if mibBuilder.loadTexts: alaVfcQPLastChange.setStatus('current')
alaVfcQPWfqWeight = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 61, 1, 1, 1, 4, 1, 18), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: alaVfcQPWfqWeight.setStatus('current')
alaVfcQPWfqMode = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 61, 1, 1, 1, 4, 1, 19), VfcWfqMode()).setMaxAccess("readonly")
if mibBuilder.loadTexts: alaVfcQPWfqMode.setStatus('current')
alaVfcQInstanceTable = MibTable((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 61, 1, 1, 1, 5), )
if mibBuilder.loadTexts: alaVfcQInstanceTable.setStatus('current')
alaVfcQInstanceEntry = MibTableRow((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 61, 1, 1, 1, 5, 1), ).setIndexNames((0, "ALCATEL-IND1-VIRTUAL-FLOW-CONTROL-MIB", "alaVfcQInstanceQsiId"), (0, "ALCATEL-IND1-VIRTUAL-FLOW-CONTROL-MIB", "alaVfcQInstanceQId"))
if mibBuilder.loadTexts: alaVfcQInstanceEntry.setStatus('current')
alaVfcQInstanceQsiId = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 61, 1, 1, 1, 5, 1, 1), Unsigned32())
if mibBuilder.loadTexts: alaVfcQInstanceQsiId.setStatus('current')
alaVfcQInstanceQId = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 61, 1, 1, 1, 5, 1, 2), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(1, 8)))
if mibBuilder.loadTexts: alaVfcQInstanceQId.setStatus('current')
alaVfcQInstanceQsapId = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 61, 1, 1, 1, 5, 1, 3), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: alaVfcQInstanceQsapId.setStatus('deprecated')
alaVfcQInstanceQSPId = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 61, 1, 1, 1, 5, 1, 4), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(1, 8))).setMaxAccess("readonly")
if mibBuilder.loadTexts: alaVfcQInstanceQSPId.setStatus('deprecated')
alaVfcQInstanceQSPName = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 61, 1, 1, 1, 5, 1, 5), SnmpAdminString().subtype(subtypeSpec=ValueSizeConstraint(0, 32))).setMaxAccess("readonly")
if mibBuilder.loadTexts: alaVfcQInstanceQSPName.setStatus('deprecated')
alaVfcQInstanceAdminState = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 61, 1, 1, 1, 5, 1, 6), VfcEnableState().clone('enabled')).setMaxAccess("readwrite")
if mibBuilder.loadTexts: alaVfcQInstanceAdminState.setStatus('deprecated')
alaVfcQInstanceOperState = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 61, 1, 1, 1, 5, 1, 7), VfcEnableState().clone('enabled')).setMaxAccess("readonly")
if mibBuilder.loadTexts: alaVfcQInstanceOperState.setStatus('deprecated')
alaVfcQInstanceWRPAdminState = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 61, 1, 1, 1, 5, 1, 8), VfcEnableState().clone('disabled')).setMaxAccess("readwrite")
if mibBuilder.loadTexts: alaVfcQInstanceWRPAdminState.setStatus('current')
alaVfcQInstanceWRPOperState = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 61, 1, 1, 1, 5, 1, 9), VfcEnableState().clone('disabled')).setMaxAccess("readonly")
if mibBuilder.loadTexts: alaVfcQInstanceWRPOperState.setStatus('current')
alaVfcQInstanceWRPId = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 61, 1, 1, 1, 5, 1, 10), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(1, 16))).setMaxAccess("readonly")
if mibBuilder.loadTexts: alaVfcQInstanceWRPId.setStatus('deprecated')
alaVfcQInstanceWRPName = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 61, 1, 1, 1, 5, 1, 11), SnmpAdminString().subtype(subtypeSpec=ValueSizeConstraint(0, 32))).setMaxAccess("readonly")
if mibBuilder.loadTexts: alaVfcQInstanceWRPName.setStatus('deprecated')
alaVfcQInstanceCIRBandwidthLimitType = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 61, 1, 1, 1, 5, 1, 12), VfcBwLimitType()).setMaxAccess("readonly")
if mibBuilder.loadTexts: alaVfcQInstanceCIRBandwidthLimitType.setStatus('deprecated')
alaVfcQInstanceCIRBandwidthLimitValue = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 61, 1, 1, 1, 5, 1, 13), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: alaVfcQInstanceCIRBandwidthLimitValue.setStatus('deprecated')
alaVfcQInstancePIRBandwidthLimitType = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 61, 1, 1, 1, 5, 1, 14), VfcBwLimitType()).setMaxAccess("readonly")
if mibBuilder.loadTexts: alaVfcQInstancePIRBandwidthLimitType.setStatus('deprecated')
alaVfcQInstancePIRBandwidthLimitValue = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 61, 1, 1, 1, 5, 1, 15), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: alaVfcQInstancePIRBandwidthLimitValue.setStatus('deprecated')
alaVfcQInstanceCIROperationalBandwidthLimitType = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 61, 1, 1, 1, 5, 1, 16), VfcBwLimitType()).setMaxAccess("readonly")
if mibBuilder.loadTexts: alaVfcQInstanceCIROperationalBandwidthLimitType.setStatus('current')
alaVfcQInstanceCIROperationalBandwidthLimitValue = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 61, 1, 1, 1, 5, 1, 17), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: alaVfcQInstanceCIROperationalBandwidthLimitValue.setStatus('current')
alaVfcQInstancePIROperationalBandwidthLimitType = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 61, 1, 1, 1, 5, 1, 18), VfcBwLimitType()).setMaxAccess("readonly")
if mibBuilder.loadTexts: alaVfcQInstancePIROperationalBandwidthLimitType.setStatus('current')
alaVfcQInstancePIROperationalBandwidthLimitValue = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 61, 1, 1, 1, 5, 1, 19), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: alaVfcQInstancePIROperationalBandwidthLimitValue.setStatus('current')
alaVfcQInstanceStatsAdmin = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 61, 1, 1, 1, 5, 1, 20), VfcEnableState().clone('disabled')).setMaxAccess("readwrite")
if mibBuilder.loadTexts: alaVfcQInstanceStatsAdmin.setStatus('deprecated')
alaVfcQInstanceStatsOper = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 61, 1, 1, 1, 5, 1, 21), VfcEnableState().clone('disabled')).setMaxAccess("readonly")
if mibBuilder.loadTexts: alaVfcQInstanceStatsOper.setStatus('deprecated')
alaVfcQInstancePacketsEnqueued = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 61, 1, 1, 1, 5, 1, 22), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: alaVfcQInstancePacketsEnqueued.setStatus('current')
alaVfcQInstanceBytesEnqueued = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 61, 1, 1, 1, 5, 1, 23), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: alaVfcQInstanceBytesEnqueued.setStatus('current')
alaVfcQInstancePacketsDequeued = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 61, 1, 1, 1, 5, 1, 24), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: alaVfcQInstancePacketsDequeued.setStatus('deprecated')
alaVfcQInstanceBytesDequeued = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 61, 1, 1, 1, 5, 1, 25), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: alaVfcQInstanceBytesDequeued.setStatus('deprecated')
alaVfcQInstancePacketsDropped = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 61, 1, 1, 1, 5, 1, 26), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: alaVfcQInstancePacketsDropped.setStatus('current')
alaVfcQInstanceBytesDropped = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 61, 1, 1, 1, 5, 1, 27), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: alaVfcQInstanceBytesDropped.setStatus('current')
alaVfcQInstanceGreenPacketsAccepted = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 61, 1, 1, 1, 5, 1, 28), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: alaVfcQInstanceGreenPacketsAccepted.setStatus('current')
alaVfcQInstanceGreenBytesAccepted = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 61, 1, 1, 1, 5, 1, 29), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: alaVfcQInstanceGreenBytesAccepted.setStatus('current')
alaVfcQInstanceGreenPacketsDropped = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 61, 1, 1, 1, 5, 1, 30), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: alaVfcQInstanceGreenPacketsDropped.setStatus('current')
alaVfcQInstanceGreenBytesDropped = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 61, 1, 1, 1, 5, 1, 31), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: alaVfcQInstanceGreenBytesDropped.setStatus('current')
alaVfcQInstanceYellowPacketsAccepted = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 61, 1, 1, 1, 5, 1, 32), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: alaVfcQInstanceYellowPacketsAccepted.setStatus('current')
alaVfcQInstanceYellowBytesAccepted = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 61, 1, 1, 1, 5, 1, 33), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: alaVfcQInstanceYellowBytesAccepted.setStatus('current')
alaVfcQInstanceYellowPacketsDropped = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 61, 1, 1, 1, 5, 1, 34), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: alaVfcQInstanceYellowPacketsDropped.setStatus('current')
alaVfcQInstanceYellowBytesDropped = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 61, 1, 1, 1, 5, 1, 35), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: alaVfcQInstanceYellowBytesDropped.setStatus('current')
alaVfcQInstanceRedPacketsAccepted = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 61, 1, 1, 1, 5, 1, 36), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: alaVfcQInstanceRedPacketsAccepted.setStatus('current')
alaVfcQInstanceRedBytesAccepted = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 61, 1, 1, 1, 5, 1, 37), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: alaVfcQInstanceRedBytesAccepted.setStatus('current')
alaVfcQInstanceRedPacketsDropped = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 61, 1, 1, 1, 5, 1, 38), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: alaVfcQInstanceRedPacketsDropped.setStatus('current')
alaVfcQInstanceRedBytesDropped = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 61, 1, 1, 1, 5, 1, 39), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: alaVfcQInstanceRedBytesDropped.setStatus('current')
alaVfcQInstanceLastChange = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 61, 1, 1, 1, 5, 1, 40), DateAndTime()).setMaxAccess("readonly")
if mibBuilder.loadTexts: alaVfcQInstanceLastChange.setStatus('current')
alaVfcQInstanceStatsClear = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 61, 1, 1, 1, 5, 1, 41), VfcEnableState().clone('disabled')).setMaxAccess("readwrite")
if mibBuilder.loadTexts: alaVfcQInstanceStatsClear.setStatus('deprecated')
alaVfcQsapTable = MibTable((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 61, 1, 1, 1, 6), )
if mibBuilder.loadTexts: alaVfcQsapTable.setStatus('current')
alaVfcQsapEntry = MibTableRow((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 61, 1, 1, 1, 6, 1), ).setIndexNames((0, "ALCATEL-IND1-VIRTUAL-FLOW-CONTROL-MIB", "alaVfcQsapId"))
if mibBuilder.loadTexts: alaVfcQsapEntry.setStatus('current')
alaVfcQsapId = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 61, 1, 1, 1, 6, 1, 1), Unsigned32())
if mibBuilder.loadTexts: alaVfcQsapId.setStatus('current')
alaVfcQsapAdminState = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 61, 1, 1, 1, 6, 1, 2), VfcEnableState().clone('enabled')).setMaxAccess("readonly")
if mibBuilder.loadTexts: alaVfcQsapAdminState.setStatus('deprecated')
alaVfcQsapType = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 61, 1, 1, 1, 6, 1, 3), VfcQsapType()).setMaxAccess("readonly")
if mibBuilder.loadTexts: alaVfcQsapType.setStatus('current')
alaVfcQsapValue = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 61, 1, 1, 1, 6, 1, 4), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: alaVfcQsapValue.setStatus('current')
alaVfcQsapQSPId = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 61, 1, 1, 1, 6, 1, 5), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(1, 8))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: alaVfcQsapQSPId.setStatus('deprecated')
alaVfcQsapQSPName = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 61, 1, 1, 1, 6, 1, 6), SnmpAdminString().subtype(subtypeSpec=ValueSizeConstraint(0, 32))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: alaVfcQsapQSPName.setStatus('deprecated')
alaVfcQsapWRPAdminState = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 61, 1, 1, 1, 6, 1, 7), VfcEnableState().clone('disabled')).setMaxAccess("readwrite")
if mibBuilder.loadTexts: alaVfcQsapWRPAdminState.setStatus('deprecated')
alaVfcQsapStatsAdmin = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 61, 1, 1, 1, 6, 1, 8), VfcEnableState().clone('disabled')).setMaxAccess("readwrite")
if mibBuilder.loadTexts: alaVfcQsapStatsAdmin.setStatus('deprecated')
alaVfcQsapBandwidthLimitType = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 61, 1, 1, 1, 6, 1, 9), VfcBwLimitType().clone('percentage')).setMaxAccess("readonly")
if mibBuilder.loadTexts: alaVfcQsapBandwidthLimitType.setStatus('current')
alaVfcQsapBandwidthLimitValue = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 61, 1, 1, 1, 6, 1, 10), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: alaVfcQsapBandwidthLimitValue.setStatus('current')
alaVfcQsapClearStats = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 61, 1, 1, 1, 6, 1, 11), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1))).clone(namedValues=NamedValues(("default", 0), ("reset", 1)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: alaVfcQsapClearStats.setStatus('deprecated')
alaVfcQsapQpId = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 61, 1, 1, 1, 6, 1, 12), Unsigned32()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: alaVfcQsapQpId.setStatus('deprecated')
alaVfcQsapAction = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 61, 1, 1, 1, 6, 1, 13), VfcQsetAction()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: alaVfcQsapAction.setStatus('deprecated')
alaVfcQsapLastChange = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 61, 1, 1, 1, 6, 1, 14), DateAndTime()).setMaxAccess("readonly")
if mibBuilder.loadTexts: alaVfcQsapLastChange.setStatus('current')
alaVfcQsapParent = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 61, 1, 1, 1, 6, 1, 15), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: alaVfcQsapParent.setStatus('current')
alaVfcProfileIndexLookupTable = MibTable((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 61, 1, 1, 1, 7), )
if mibBuilder.loadTexts: alaVfcProfileIndexLookupTable.setStatus('current')
alaVfcProfileIndexLookupEntry = MibTableRow((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 61, 1, 1, 1, 7, 1), ).setIndexNames((0, "ALCATEL-IND1-VIRTUAL-FLOW-CONTROL-MIB", "alaVfcProfileType"), (1, "ALCATEL-IND1-VIRTUAL-FLOW-CONTROL-MIB", "alaVfcProfileName"))
if mibBuilder.loadTexts: alaVfcProfileIndexLookupEntry.setStatus('current')
alaVfcProfileType = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 61, 1, 1, 1, 7, 1, 1), VfcProfileType())
if mibBuilder.loadTexts: alaVfcProfileType.setStatus('current')
alaVfcProfileName = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 61, 1, 1, 1, 7, 1, 2), SnmpAdminString().subtype(subtypeSpec=ValueSizeConstraint(1, 32)))
if mibBuilder.loadTexts: alaVfcProfileName.setStatus('current')
alaVfcProfileId = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 61, 1, 1, 1, 7, 1, 3), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(1, 64))).setMaxAccess("readonly")
if mibBuilder.loadTexts: alaVfcProfileId.setStatus('current')
alaVfcProfileQsapLookupTable = MibTable((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 61, 1, 1, 1, 8), )
if mibBuilder.loadTexts: alaVfcProfileQsapLookupTable.setStatus('current')
alaVfcProfileQsapLookupEntry = MibTableRow((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 61, 1, 1, 1, 8, 1), ).setIndexNames((0, "ALCATEL-IND1-VIRTUAL-FLOW-CONTROL-MIB", "alaVfcProfileQsapLookupType"), (0, "ALCATEL-IND1-VIRTUAL-FLOW-CONTROL-MIB", "alaVfcProfileQsapLookupId"), (0, "ALCATEL-IND1-VIRTUAL-FLOW-CONTROL-MIB", "alaVfcProfileQsapLookupValue"))
if mibBuilder.loadTexts: alaVfcProfileQsapLookupEntry.setStatus('current')
alaVfcProfileQsapLookupType = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 61, 1, 1, 1, 8, 1, 1), VfcProfileType())
if mibBuilder.loadTexts: alaVfcProfileQsapLookupType.setStatus('current')
alaVfcProfileQsapLookupId = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 61, 1, 1, 1, 8, 1, 2), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(1, 64)))
if mibBuilder.loadTexts: alaVfcProfileQsapLookupId.setStatus('current')
alaVfcProfileQsapLookupValue = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 61, 1, 1, 1, 8, 1, 3), Unsigned32())
if mibBuilder.loadTexts: alaVfcProfileQsapLookupValue.setStatus('current')
alaVfcProfileQsapLookupList = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 61, 1, 1, 1, 8, 1, 4), VfcQsapList()).setMaxAccess("readonly")
if mibBuilder.loadTexts: alaVfcProfileQsapLookupList.setStatus('current')
alaVfcQSIQsapLookupTable = MibTable((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 61, 1, 1, 1, 9), )
if mibBuilder.loadTexts: alaVfcQSIQsapLookupTable.setStatus('current')
alaVfcQSIQsapLookupEntry = MibTableRow((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 61, 1, 1, 1, 9, 1), ).setIndexNames((0, "ALCATEL-IND1-VIRTUAL-FLOW-CONTROL-MIB", "alaVfcQSIQsapLookupQsetId"), (0, "ALCATEL-IND1-VIRTUAL-FLOW-CONTROL-MIB", "alaVfcQSIQsapLookupValue"))
if mibBuilder.loadTexts: alaVfcQSIQsapLookupEntry.setStatus('current')
alaVfcQSIQsapLookupQsetId = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 61, 1, 1, 1, 9, 1, 1), Unsigned32())
if mibBuilder.loadTexts: alaVfcQSIQsapLookupQsetId.setStatus('current')
alaVfcQSIQsapLookupValue = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 61, 1, 1, 1, 9, 1, 2), Unsigned32())
if mibBuilder.loadTexts: alaVfcQSIQsapLookupValue.setStatus('current')
alaVfcQSIQsapLookupList = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 61, 1, 1, 1, 9, 1, 3), VfcQsapList()).setMaxAccess("readonly")
if mibBuilder.loadTexts: alaVfcQSIQsapLookupList.setStatus('current')
alaVfcStatisticsCollectionInterval = MibScalar((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 61, 1, 1, 1, 10), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: alaVfcStatisticsCollectionInterval.setStatus('deprecated')
alaVfcStatisticsCollectionDuration = MibScalar((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 61, 1, 1, 1, 11), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: alaVfcStatisticsCollectionDuration.setStatus('deprecated')
alcatelIND1VfcMIBCompliance = ModuleCompliance((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 61, 1, 2, 2, 1)).setObjects(("ALCATEL-IND1-VIRTUAL-FLOW-CONTROL-MIB", "alaVfcWREDProfileGroup"), ("ALCATEL-IND1-VIRTUAL-FLOW-CONTROL-MIB", "alaVfcQsetProfileGroup"), ("ALCATEL-IND1-VIRTUAL-FLOW-CONTROL-MIB", "alaVfcQsetInstanceGroup"), ("ALCATEL-IND1-VIRTUAL-FLOW-CONTROL-MIB", "alaVfcQProfileGroup"), ("ALCATEL-IND1-VIRTUAL-FLOW-CONTROL-MIB", "alaVfcQInstanceGroup"), ("ALCATEL-IND1-VIRTUAL-FLOW-CONTROL-MIB", "alaVfcQsapGroup"), ("ALCATEL-IND1-VIRTUAL-FLOW-CONTROL-MIB", "alaVfcProfileIndexLookupGroup"), ("ALCATEL-IND1-VIRTUAL-FLOW-CONTROL-MIB", "alaVfcProfileQsapLookupGroup"), ("ALCATEL-IND1-VIRTUAL-FLOW-CONTROL-MIB", "alaVfcQSIQsapLookupGroup"), ("ALCATEL-IND1-VIRTUAL-FLOW-CONTROL-MIB", "alaVfcStatsGroup"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
alcatelIND1VfcMIBCompliance = alcatelIND1VfcMIBCompliance.setStatus('current')
alaVfcWREDProfileGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 61, 1, 2, 1, 1)).setObjects(("ALCATEL-IND1-VIRTUAL-FLOW-CONTROL-MIB", "alaVfcWRPAdminState"), ("ALCATEL-IND1-VIRTUAL-FLOW-CONTROL-MIB", "alaVfcWRPName"), ("ALCATEL-IND1-VIRTUAL-FLOW-CONTROL-MIB", "alaVfcWRPGreenMinThreshold"), ("ALCATEL-IND1-VIRTUAL-FLOW-CONTROL-MIB", "alaVfcWRPGreenMaxThreshold"), ("ALCATEL-IND1-VIRTUAL-FLOW-CONTROL-MIB", "alaVfcWRPGreenMaxDropProbability"), ("ALCATEL-IND1-VIRTUAL-FLOW-CONTROL-MIB", "alaVfcWRPGreenGain"), ("ALCATEL-IND1-VIRTUAL-FLOW-CONTROL-MIB", "alaVfcWRPYellowMinThreshold"), ("ALCATEL-IND1-VIRTUAL-FLOW-CONTROL-MIB", "alaVfcWRPYellowMaxThreshold"), ("ALCATEL-IND1-VIRTUAL-FLOW-CONTROL-MIB", "alaVfcWRPYellowMaxDropProbability"), ("ALCATEL-IND1-VIRTUAL-FLOW-CONTROL-MIB", "alaVfcWRPYellowGain"), ("ALCATEL-IND1-VIRTUAL-FLOW-CONTROL-MIB", "alaVfcWRPRedMinThreshold"), ("ALCATEL-IND1-VIRTUAL-FLOW-CONTROL-MIB", "alaVfcWRPRedMaxThreshold"), ("ALCATEL-IND1-VIRTUAL-FLOW-CONTROL-MIB", "alaVfcWRPRedMaxDropProbability"), ("ALCATEL-IND1-VIRTUAL-FLOW-CONTROL-MIB", "alaVfcWRPRedGain"), ("ALCATEL-IND1-VIRTUAL-FLOW-CONTROL-MIB", "alaVfcWRPStatsAdmin"), ("ALCATEL-IND1-VIRTUAL-FLOW-CONTROL-MIB", "alaVfcWRPAttachmentCount"), ("ALCATEL-IND1-VIRTUAL-FLOW-CONTROL-MIB", "alaVfcWRPMTU"), ("ALCATEL-IND1-VIRTUAL-FLOW-CONTROL-MIB", "alaVfcWRPLastChange"), ("ALCATEL-IND1-VIRTUAL-FLOW-CONTROL-MIB", "alaVfcWRPRowStatus"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
alaVfcWREDProfileGroup = alaVfcWREDProfileGroup.setStatus('current')
alaVfcQsetProfileGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 61, 1, 2, 1, 2)).setObjects(("ALCATEL-IND1-VIRTUAL-FLOW-CONTROL-MIB", "alaVfcQSPAdminState"), ("ALCATEL-IND1-VIRTUAL-FLOW-CONTROL-MIB", "alaVfcQSPName"), ("ALCATEL-IND1-VIRTUAL-FLOW-CONTROL-MIB", "alaVfcQSPType"), ("ALCATEL-IND1-VIRTUAL-FLOW-CONTROL-MIB", "alaVfcQSPTemplateId"), ("ALCATEL-IND1-VIRTUAL-FLOW-CONTROL-MIB", "alaVfcQSPTemplateName"), ("ALCATEL-IND1-VIRTUAL-FLOW-CONTROL-MIB", "alaVfcQSPBandwidthLimitType"), ("ALCATEL-IND1-VIRTUAL-FLOW-CONTROL-MIB", "alaVfcQSPBandwidthLimitValue"), ("ALCATEL-IND1-VIRTUAL-FLOW-CONTROL-MIB", "alaVfcQSPQueueCount"), ("ALCATEL-IND1-VIRTUAL-FLOW-CONTROL-MIB", "alaVfcQSPWRPId"), ("ALCATEL-IND1-VIRTUAL-FLOW-CONTROL-MIB", "alaVfcQSPWRPName"), ("ALCATEL-IND1-VIRTUAL-FLOW-CONTROL-MIB", "alaVfcQSPWRPAdminState"), ("ALCATEL-IND1-VIRTUAL-FLOW-CONTROL-MIB", "alaVfcQSPSchedulingMethod"), ("ALCATEL-IND1-VIRTUAL-FLOW-CONTROL-MIB", "alaVfcQSPStatsAdmin"), ("ALCATEL-IND1-VIRTUAL-FLOW-CONTROL-MIB", "alaVfcQSPAttachmentCount"), ("ALCATEL-IND1-VIRTUAL-FLOW-CONTROL-MIB", "alaVfcQSPLastChange"), ("ALCATEL-IND1-VIRTUAL-FLOW-CONTROL-MIB", "alaVfcQSPRowStatus"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
alaVfcQsetProfileGroup = alaVfcQsetProfileGroup.setStatus('current')
alaVfcQsetInstanceGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 61, 1, 2, 1, 3)).setObjects(("ALCATEL-IND1-VIRTUAL-FLOW-CONTROL-MIB", "alaVfcQsetQsapId"), ("ALCATEL-IND1-VIRTUAL-FLOW-CONTROL-MIB", "alaVfcQsetAdminState"), ("ALCATEL-IND1-VIRTUAL-FLOW-CONTROL-MIB", "alaVfcQsetOperState"), ("ALCATEL-IND1-VIRTUAL-FLOW-CONTROL-MIB", "alaVfcQsetQSPId"), ("ALCATEL-IND1-VIRTUAL-FLOW-CONTROL-MIB", "alaVfcQsetQSPName"), ("ALCATEL-IND1-VIRTUAL-FLOW-CONTROL-MIB", "alaVfcQsetBandwidthLimitType"), ("ALCATEL-IND1-VIRTUAL-FLOW-CONTROL-MIB", "alaVfcQsetBandwidthLimitValue"), ("ALCATEL-IND1-VIRTUAL-FLOW-CONTROL-MIB", "alaVfcQsetOperBandwidthLimitType"), ("ALCATEL-IND1-VIRTUAL-FLOW-CONTROL-MIB", "alaVfcQsetOperBandwidthLimitValue"), ("ALCATEL-IND1-VIRTUAL-FLOW-CONTROL-MIB", "alaVfcQsetQueueCount"), ("ALCATEL-IND1-VIRTUAL-FLOW-CONTROL-MIB", "alaVfcQsetWRPId"), ("ALCATEL-IND1-VIRTUAL-FLOW-CONTROL-MIB", "alaVfcQsetWRPName"), ("ALCATEL-IND1-VIRTUAL-FLOW-CONTROL-MIB", "alaVfcQsetWRPAdminState"), ("ALCATEL-IND1-VIRTUAL-FLOW-CONTROL-MIB", "alaVfcQsetWRPOperState"), ("ALCATEL-IND1-VIRTUAL-FLOW-CONTROL-MIB", "alaVfcQsetSchedulingMethod"), ("ALCATEL-IND1-VIRTUAL-FLOW-CONTROL-MIB", "alaVfcQsetStatsAdmin"), ("ALCATEL-IND1-VIRTUAL-FLOW-CONTROL-MIB", "alaVfcQsetStatsOper"), ("ALCATEL-IND1-VIRTUAL-FLOW-CONTROL-MIB", "alaVfcQsetLastChange"), ("ALCATEL-IND1-VIRTUAL-FLOW-CONTROL-MIB", "alaVfcQsetStatsClear"), ("ALCATEL-IND1-VIRTUAL-FLOW-CONTROL-MIB", "alaVfcQsetStatsInterval"), ("ALCATEL-IND1-VIRTUAL-FLOW-CONTROL-MIB", "alaVfcQsetMisconfigured"), ("ALCATEL-IND1-VIRTUAL-FLOW-CONTROL-MIB", "alaVfcQsetMode"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
alaVfcQsetInstanceGroup = alaVfcQsetInstanceGroup.setStatus('current')
alaVfcQProfileGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 61, 1, 2, 1, 4)).setObjects(("ALCATEL-IND1-VIRTUAL-FLOW-CONTROL-MIB", "alaVfcQPAdminState"), ("ALCATEL-IND1-VIRTUAL-FLOW-CONTROL-MIB", "alaVfcQPWRPId"), ("ALCATEL-IND1-VIRTUAL-FLOW-CONTROL-MIB", "alaVfcQPWRPName"), ("ALCATEL-IND1-VIRTUAL-FLOW-CONTROL-MIB", "alaVfcQPWRPAdminState"), ("ALCATEL-IND1-VIRTUAL-FLOW-CONTROL-MIB", "alaVfcQPQSPName"), ("ALCATEL-IND1-VIRTUAL-FLOW-CONTROL-MIB", "alaVfcQPTrafficClass"), ("ALCATEL-IND1-VIRTUAL-FLOW-CONTROL-MIB", "alaVfcQPQType"), ("ALCATEL-IND1-VIRTUAL-FLOW-CONTROL-MIB", "alaVfcQPCIRBandwidthLimitType"), ("ALCATEL-IND1-VIRTUAL-FLOW-CONTROL-MIB", "alaVfcQPCIRBandwidthLimitValue"), ("ALCATEL-IND1-VIRTUAL-FLOW-CONTROL-MIB", "alaVfcQPPIRBandwidthLimitType"), ("ALCATEL-IND1-VIRTUAL-FLOW-CONTROL-MIB", "alaVfcQPPIRBandwidthLimitValue"), ("ALCATEL-IND1-VIRTUAL-FLOW-CONTROL-MIB", "alaVfcQPStatsAdmin"), ("ALCATEL-IND1-VIRTUAL-FLOW-CONTROL-MIB", "alaVfcQPCbs"), ("ALCATEL-IND1-VIRTUAL-FLOW-CONTROL-MIB", "alaVfcQPMbs"), ("ALCATEL-IND1-VIRTUAL-FLOW-CONTROL-MIB", "alaVfcQPLastChange"), ("ALCATEL-IND1-VIRTUAL-FLOW-CONTROL-MIB", "alaVfcQPWfqWeight"), ("ALCATEL-IND1-VIRTUAL-FLOW-CONTROL-MIB", "alaVfcQPWfqMode"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
alaVfcQProfileGroup = alaVfcQProfileGroup.setStatus('current')
alaVfcQInstanceGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 61, 1, 2, 1, 5)).setObjects(("ALCATEL-IND1-VIRTUAL-FLOW-CONTROL-MIB", "alaVfcQInstanceQsapId"), ("ALCATEL-IND1-VIRTUAL-FLOW-CONTROL-MIB", "alaVfcQInstanceQSPId"), ("ALCATEL-IND1-VIRTUAL-FLOW-CONTROL-MIB", "alaVfcQInstanceQSPName"), ("ALCATEL-IND1-VIRTUAL-FLOW-CONTROL-MIB", "alaVfcQInstanceAdminState"), ("ALCATEL-IND1-VIRTUAL-FLOW-CONTROL-MIB", "alaVfcQInstanceOperState"), ("ALCATEL-IND1-VIRTUAL-FLOW-CONTROL-MIB", "alaVfcQInstanceWRPAdminState"), ("ALCATEL-IND1-VIRTUAL-FLOW-CONTROL-MIB", "alaVfcQInstanceWRPOperState"), ("ALCATEL-IND1-VIRTUAL-FLOW-CONTROL-MIB", "alaVfcQInstanceWRPId"), ("ALCATEL-IND1-VIRTUAL-FLOW-CONTROL-MIB", "alaVfcQInstanceWRPName"), ("ALCATEL-IND1-VIRTUAL-FLOW-CONTROL-MIB", "alaVfcQInstanceCIRBandwidthLimitType"), ("ALCATEL-IND1-VIRTUAL-FLOW-CONTROL-MIB", "alaVfcQInstanceCIRBandwidthLimitValue"), ("ALCATEL-IND1-VIRTUAL-FLOW-CONTROL-MIB", "alaVfcQInstancePIRBandwidthLimitType"), ("ALCATEL-IND1-VIRTUAL-FLOW-CONTROL-MIB", "alaVfcQInstancePIRBandwidthLimitValue"), ("ALCATEL-IND1-VIRTUAL-FLOW-CONTROL-MIB", "alaVfcQInstanceCIROperationalBandwidthLimitType"), ("ALCATEL-IND1-VIRTUAL-FLOW-CONTROL-MIB", "alaVfcQInstanceCIROperationalBandwidthLimitValue"), ("ALCATEL-IND1-VIRTUAL-FLOW-CONTROL-MIB", "alaVfcQInstancePIROperationalBandwidthLimitType"), ("ALCATEL-IND1-VIRTUAL-FLOW-CONTROL-MIB", "alaVfcQInstancePIROperationalBandwidthLimitValue"), ("ALCATEL-IND1-VIRTUAL-FLOW-CONTROL-MIB", "alaVfcQInstanceStatsAdmin"), ("ALCATEL-IND1-VIRTUAL-FLOW-CONTROL-MIB", "alaVfcQInstanceStatsOper"), ("ALCATEL-IND1-VIRTUAL-FLOW-CONTROL-MIB", "alaVfcQInstancePacketsEnqueued"), ("ALCATEL-IND1-VIRTUAL-FLOW-CONTROL-MIB", "alaVfcQInstanceBytesEnqueued"), ("ALCATEL-IND1-VIRTUAL-FLOW-CONTROL-MIB", "alaVfcQInstancePacketsDequeued"), ("ALCATEL-IND1-VIRTUAL-FLOW-CONTROL-MIB", "alaVfcQInstanceBytesDequeued"), ("ALCATEL-IND1-VIRTUAL-FLOW-CONTROL-MIB", "alaVfcQInstancePacketsDropped"), ("ALCATEL-IND1-VIRTUAL-FLOW-CONTROL-MIB", "alaVfcQInstanceBytesDropped"), ("ALCATEL-IND1-VIRTUAL-FLOW-CONTROL-MIB", "alaVfcQInstanceGreenPacketsAccepted"), ("ALCATEL-IND1-VIRTUAL-FLOW-CONTROL-MIB", "alaVfcQInstanceGreenBytesAccepted"), ("ALCATEL-IND1-VIRTUAL-FLOW-CONTROL-MIB", "alaVfcQInstanceGreenPacketsDropped"), ("ALCATEL-IND1-VIRTUAL-FLOW-CONTROL-MIB", "alaVfcQInstanceGreenBytesDropped"), ("ALCATEL-IND1-VIRTUAL-FLOW-CONTROL-MIB", "alaVfcQInstanceYellowPacketsAccepted"), ("ALCATEL-IND1-VIRTUAL-FLOW-CONTROL-MIB", "alaVfcQInstanceYellowBytesAccepted"), ("ALCATEL-IND1-VIRTUAL-FLOW-CONTROL-MIB", "alaVfcQInstanceYellowPacketsDropped"), ("ALCATEL-IND1-VIRTUAL-FLOW-CONTROL-MIB", "alaVfcQInstanceYellowBytesDropped"), ("ALCATEL-IND1-VIRTUAL-FLOW-CONTROL-MIB", "alaVfcQInstanceRedPacketsAccepted"), ("ALCATEL-IND1-VIRTUAL-FLOW-CONTROL-MIB", "alaVfcQInstanceRedBytesAccepted"), ("ALCATEL-IND1-VIRTUAL-FLOW-CONTROL-MIB", "alaVfcQInstanceRedPacketsDropped"), ("ALCATEL-IND1-VIRTUAL-FLOW-CONTROL-MIB", "alaVfcQInstanceRedBytesDropped"), ("ALCATEL-IND1-VIRTUAL-FLOW-CONTROL-MIB", "alaVfcQInstanceLastChange"), ("ALCATEL-IND1-VIRTUAL-FLOW-CONTROL-MIB", "alaVfcQInstanceStatsClear"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
alaVfcQInstanceGroup = alaVfcQInstanceGroup.setStatus('current')
alaVfcQsapGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 61, 1, 2, 1, 6)).setObjects(("ALCATEL-IND1-VIRTUAL-FLOW-CONTROL-MIB", "alaVfcQsapAdminState"), ("ALCATEL-IND1-VIRTUAL-FLOW-CONTROL-MIB", "alaVfcQsapType"), ("ALCATEL-IND1-VIRTUAL-FLOW-CONTROL-MIB", "alaVfcQsapValue"), ("ALCATEL-IND1-VIRTUAL-FLOW-CONTROL-MIB", "alaVfcQsapQSPId"), ("ALCATEL-IND1-VIRTUAL-FLOW-CONTROL-MIB", "alaVfcQsapQSPName"), ("ALCATEL-IND1-VIRTUAL-FLOW-CONTROL-MIB", "alaVfcQsapWRPAdminState"), ("ALCATEL-IND1-VIRTUAL-FLOW-CONTROL-MIB", "alaVfcQsapStatsAdmin"), ("ALCATEL-IND1-VIRTUAL-FLOW-CONTROL-MIB", "alaVfcQsapBandwidthLimitType"), ("ALCATEL-IND1-VIRTUAL-FLOW-CONTROL-MIB", "alaVfcQsapBandwidthLimitValue"), ("ALCATEL-IND1-VIRTUAL-FLOW-CONTROL-MIB", "alaVfcQsapClearStats"), ("ALCATEL-IND1-VIRTUAL-FLOW-CONTROL-MIB", "alaVfcQsapQpId"), ("ALCATEL-IND1-VIRTUAL-FLOW-CONTROL-MIB", "alaVfcQsapAction"), ("ALCATEL-IND1-VIRTUAL-FLOW-CONTROL-MIB", "alaVfcQsapLastChange"), ("ALCATEL-IND1-VIRTUAL-FLOW-CONTROL-MIB", "alaVfcQsapParent"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
alaVfcQsapGroup = alaVfcQsapGroup.setStatus('current')
alaVfcProfileIndexLookupGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 61, 1, 2, 1, 7)).setObjects(("ALCATEL-IND1-VIRTUAL-FLOW-CONTROL-MIB", "alaVfcProfileId"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
alaVfcProfileIndexLookupGroup = alaVfcProfileIndexLookupGroup.setStatus('current')
alaVfcProfileQsapLookupGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 61, 1, 2, 1, 8)).setObjects(("ALCATEL-IND1-VIRTUAL-FLOW-CONTROL-MIB", "alaVfcProfileQsapLookupList"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
alaVfcProfileQsapLookupGroup = alaVfcProfileQsapLookupGroup.setStatus('current')
alaVfcQSIQsapLookupGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 61, 1, 2, 1, 9)).setObjects(("ALCATEL-IND1-VIRTUAL-FLOW-CONTROL-MIB", "alaVfcQSIQsapLookupList"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
alaVfcQSIQsapLookupGroup = alaVfcQSIQsapLookupGroup.setStatus('current')
alaVfcStatsGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 61, 1, 2, 1, 10)).setObjects(("ALCATEL-IND1-VIRTUAL-FLOW-CONTROL-MIB", "alaVfcStatisticsCollectionInterval"), ("ALCATEL-IND1-VIRTUAL-FLOW-CONTROL-MIB", "alaVfcStatisticsCollectionDuration"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
alaVfcStatsGroup = alaVfcStatsGroup.setStatus('deprecated')
mibBuilder.exportSymbols("ALCATEL-IND1-VIRTUAL-FLOW-CONTROL-MIB", alaVfcQPWfqMode=alaVfcQPWfqMode, alcatelIND1VfcMIBCompliances=alcatelIND1VfcMIBCompliances, alaVfcConfig=alaVfcConfig, alaVfcQInstanceYellowPacketsDropped=alaVfcQInstanceYellowPacketsDropped, alaVfcQSPTemplateId=alaVfcQSPTemplateId, alaVfcQPTrafficClass=alaVfcQPTrafficClass, alaVfcQInstanceQId=alaVfcQInstanceQId, alaVfcQInstanceGreenPacketsDropped=alaVfcQInstanceGreenPacketsDropped, alaVfcWRPMTU=alaVfcWRPMTU, alaVfcQInstanceYellowPacketsAccepted=alaVfcQInstanceYellowPacketsAccepted, VfcEnableState=VfcEnableState, alaVfcQsetProfileEntry=alaVfcQsetProfileEntry, alaVfcWRPRedMinThreshold=alaVfcWRPRedMinThreshold, alaVfcQInstanceGreenBytesAccepted=alaVfcQInstanceGreenBytesAccepted, alaVfcQInstanceStatsClear=alaVfcQInstanceStatsClear, alaVfcQsapId=alaVfcQsapId, alaVfcQSPLastChange=alaVfcQSPLastChange, VfcQsetAction=VfcQsetAction, alaVfcQsapGroup=alaVfcQsapGroup, alaVfcQPWfqWeight=alaVfcQPWfqWeight, alaVfcQsetStatsInterval=alaVfcQsetStatsInterval, alaVfcProfileType=alaVfcProfileType, alaVfcQsapStatsAdmin=alaVfcQsapStatsAdmin, alaVfcWRPYellowMaxDropProbability=alaVfcWRPYellowMaxDropProbability, alaVfcQPStatsAdmin=alaVfcQPStatsAdmin, alaVfcQsetProfileGroup=alaVfcQsetProfileGroup, alaVfcQsetBandwidthLimitType=alaVfcQsetBandwidthLimitType, alaVfcProfileIndexLookupEntry=alaVfcProfileIndexLookupEntry, alaVfcQPAdminState=alaVfcQPAdminState, alaVfcWRPGreenGain=alaVfcWRPGreenGain, alaVfcQInstanceWRPOperState=alaVfcQInstanceWRPOperState, alaVfcQInstanceCIROperationalBandwidthLimitValue=alaVfcQInstanceCIROperationalBandwidthLimitValue, alaVfcQInstanceBytesDropped=alaVfcQInstanceBytesDropped, alaVfcQPPIRBandwidthLimitType=alaVfcQPPIRBandwidthLimitType, alaVfcQsapBandwidthLimitType=alaVfcQsapBandwidthLimitType, alaVfcQSPId=alaVfcQSPId, alaVfcProfileQsapLookupType=alaVfcProfileQsapLookupType, alaVfcQInstanceLastChange=alaVfcQInstanceLastChange, alaVfcQInstanceCIRBandwidthLimitValue=alaVfcQInstanceCIRBandwidthLimitValue, alaVfcQInstanceOperState=alaVfcQInstanceOperState, alaVfcQSIQsapLookupEntry=alaVfcQSIQsapLookupEntry, alaVfcQInstancePIROperationalBandwidthLimitType=alaVfcQInstancePIROperationalBandwidthLimitType, alaVfcQSPName=alaVfcQSPName, alaVfcQInstanceWRPId=alaVfcQInstanceWRPId, alcatelIND1VfcMIBConformance=alcatelIND1VfcMIBConformance, alaVfcWREDProfileGroup=alaVfcWREDProfileGroup, alaVfcQPPIRBandwidthLimitValue=alaVfcQPPIRBandwidthLimitValue, alaVfcQPQSPName=alaVfcQPQSPName, alaVfcQInstancePIROperationalBandwidthLimitValue=alaVfcQInstancePIROperationalBandwidthLimitValue, alaVfcProfileId=alaVfcProfileId, alaVfcWRPAttachmentCount=alaVfcWRPAttachmentCount, alaVfcQsetMisconfigured=alaVfcQsetMisconfigured, alaVfcQInstanceGreenBytesDropped=alaVfcQInstanceGreenBytesDropped, alaVfcWRPGreenMaxDropProbability=alaVfcWRPGreenMaxDropProbability, alaVfcQsapEntry=alaVfcQsapEntry, alaVfcQSIQsapLookupList=alaVfcQSIQsapLookupList, alaVfcQProfileEntry=alaVfcQProfileEntry, alaVfcQInstanceEntry=alaVfcQInstanceEntry, alaVfcWRPGreenMinThreshold=alaVfcWRPGreenMinThreshold, alaVfcQSPWRPName=alaVfcQSPWRPName, alaVfcQsetQSPName=alaVfcQsetQSPName, VfcProfileMode=VfcProfileMode, alaVfcWRPRedMaxThreshold=alaVfcWRPRedMaxThreshold, alaVfcQInstancePacketsDropped=alaVfcQInstancePacketsDropped, alaVfcWRPLastChange=alaVfcWRPLastChange, alaVfcQsapType=alaVfcQsapType, alaVfcQSPWRPId=alaVfcQSPWRPId, alaVfcQsetWRPAdminState=alaVfcQsetWRPAdminState, alaVfcProfileQsapLookupEntry=alaVfcProfileQsapLookupEntry, alaVfcStatsGroup=alaVfcStatsGroup, alaVfcWREDProfileTable=alaVfcWREDProfileTable, alaVfcQsetQsapId=alaVfcQsetQsapId, alaVfcQInstanceGreenPacketsAccepted=alaVfcQInstanceGreenPacketsAccepted, alaVfcQsetBandwidthLimitValue=alaVfcQsetBandwidthLimitValue, alaVfcQsetInstanceGroup=alaVfcQsetInstanceGroup, alaVfcQSPRowStatus=alaVfcQSPRowStatus, alaVfcQsetQSPId=alaVfcQsetQSPId, alaVfcQSPWRPAdminState=alaVfcQSPWRPAdminState, alaVfcQInstanceYellowBytesAccepted=alaVfcQInstanceYellowBytesAccepted, alcatelIND1VfcMIBGroups=alcatelIND1VfcMIBGroups, alaVfcProfileQsapLookupId=alaVfcProfileQsapLookupId, alaVfcQsetQueueCount=alaVfcQsetQueueCount, alaVfcQPWRPAdminState=alaVfcQPWRPAdminState, alaVfcQInstanceRedBytesAccepted=alaVfcQInstanceRedBytesAccepted, alaVfcQInstanceAdminState=alaVfcQInstanceAdminState, alaVfcQsapWRPAdminState=alaVfcQsapWRPAdminState, alaVfcQsetOperState=alaVfcQsetOperState, alaVfcQSPQueueCount=alaVfcQSPQueueCount, alaVfcQsetOperBandwidthLimitValue=alaVfcQsetOperBandwidthLimitValue, alaVfcQInstancePIRBandwidthLimitType=alaVfcQInstancePIRBandwidthLimitType, alaVfcQSIQsapLookupTable=alaVfcQSIQsapLookupTable, alaVfcProfileQsapLookupList=alaVfcProfileQsapLookupList, alaVfcQSPAdminState=alaVfcQSPAdminState, alaVfcQsetStatsOper=alaVfcQsetStatsOper, alaVfcQsetInstanceEntry=alaVfcQsetInstanceEntry, alaVfcQsetStatsAdmin=alaVfcQsetStatsAdmin, VfcProfileType=VfcProfileType, alaVfcQSPBandwidthLimitType=alaVfcQSPBandwidthLimitType, alaVfcQPCbs=alaVfcQPCbs, alaVfcQsapQSPName=alaVfcQsapQSPName, alaVfcWRPAdminState=alaVfcWRPAdminState, alaVfcQsapLastChange=alaVfcQsapLastChange, VfcQueueType=VfcQueueType, alaVfcWREDProfileEntry=alaVfcWREDProfileEntry, alaVfcQSPBandwidthLimitValue=alaVfcQSPBandwidthLimitValue, alaVfcQPWRPId=alaVfcQPWRPId, alaVfcQsapValue=alaVfcQsapValue, alaVfcQInstanceGroup=alaVfcQInstanceGroup, alaVfcQInstanceQSPName=alaVfcQInstanceQSPName, alaVfcQInstanceStatsAdmin=alaVfcQInstanceStatsAdmin, alaVfcQInstancePacketsEnqueued=alaVfcQInstancePacketsEnqueued, VfcSchedulingMethod=VfcSchedulingMethod, alaVfcQSIQsapLookupQsetId=alaVfcQSIQsapLookupQsetId, alaVfcQSPAttachmentCount=alaVfcQSPAttachmentCount, alaVfcQSIQsapLookupGroup=alaVfcQSIQsapLookupGroup, alaVfcQInstanceStatsOper=alaVfcQInstanceStatsOper, alaVfcWRPRedMaxDropProbability=alaVfcWRPRedMaxDropProbability, alaVfcQInstanceBytesEnqueued=alaVfcQInstanceBytesEnqueued, alaVfcQsapParent=alaVfcQsapParent, alaVfcWRPRedGain=alaVfcWRPRedGain, alaVfcQPLastChange=alaVfcQPLastChange, alaVfcQsetId=alaVfcQsetId, alaVfcQSPTemplateName=alaVfcQSPTemplateName, VfcQsapType=VfcQsapType, alaVfcStatisticsCollectionDuration=alaVfcStatisticsCollectionDuration, alaVfcQInstanceRedBytesDropped=alaVfcQInstanceRedBytesDropped, alaVfcProfileQsapLookupGroup=alaVfcProfileQsapLookupGroup, alaVfcQPQId=alaVfcQPQId, alaVfcQPCIRBandwidthLimitType=alaVfcQPCIRBandwidthLimitType, alaVfcQsetProfileTable=alaVfcQsetProfileTable, alaVfcQsetStatsClear=alaVfcQsetStatsClear, alaVfcQsetAdminState=alaVfcQsetAdminState, alaVfcQsetWRPOperState=alaVfcQsetWRPOperState, alaVfcProfileQsapLookupTable=alaVfcProfileQsapLookupTable, alaVfcQInstanceYellowBytesDropped=alaVfcQInstanceYellowBytesDropped, alcatelIND1VfcMIB=alcatelIND1VfcMIB, alaVfcQsapQSPId=alaVfcQsapQSPId, alaVfcQPMbs=alaVfcQPMbs, alaVfcQsetSchedulingMethod=alaVfcQsetSchedulingMethod, alaVfcProfileIndexLookupGroup=alaVfcProfileIndexLookupGroup, alcatelIND1VfcMIBObjects=alcatelIND1VfcMIBObjects, alaVfcWRPYellowGain=alaVfcWRPYellowGain, alaVfcWRPGreenMaxThreshold=alaVfcWRPGreenMaxThreshold, alaVfcWRPYellowMaxThreshold=alaVfcWRPYellowMaxThreshold, alaVfcQsetWRPName=alaVfcQsetWRPName, alaVfcQPQType=alaVfcQPQType, alaVfcQPWRPName=alaVfcQPWRPName, alaVfcQInstanceWRPName=alaVfcQInstanceWRPName, alaVfcQInstanceCIRBandwidthLimitType=alaVfcQInstanceCIRBandwidthLimitType, alaVfcQInstanceCIROperationalBandwidthLimitType=alaVfcQInstanceCIROperationalBandwidthLimitType, alaVfcWRPName=alaVfcWRPName, alaVfcQPCIRBandwidthLimitValue=alaVfcQPCIRBandwidthLimitValue, alaVfcQsetOperBandwidthLimitType=alaVfcQsetOperBandwidthLimitType, alaVfcQSIQsapLookupValue=alaVfcQSIQsapLookupValue, alaVfcQInstanceRedPacketsAccepted=alaVfcQInstanceRedPacketsAccepted, alcatelIND1VfcMIBCompliance=alcatelIND1VfcMIBCompliance, alaVfcQInstanceTable=alaVfcQInstanceTable, alaVfcWRPId=alaVfcWRPId, alaVfcQSPSchedulingMethod=alaVfcQSPSchedulingMethod, alaVfcQSPStatsAdmin=alaVfcQSPStatsAdmin, alaVfcStatisticsCollectionInterval=alaVfcStatisticsCollectionInterval, alaVfcQInstancePIRBandwidthLimitValue=alaVfcQInstancePIRBandwidthLimitValue, VfcQsapList=VfcQsapList, alaVfcProfileQsapLookupValue=alaVfcProfileQsapLookupValue, alaVfcQsapQpId=alaVfcQsapQpId, alaVfcQsapTable=alaVfcQsapTable, VfcWfqMode=VfcWfqMode, alaVfcQsetMode=alaVfcQsetMode, alaVfcWRPStatsAdmin=alaVfcWRPStatsAdmin, alaVfcQsetWRPId=alaVfcQsetWRPId, alaVfcQPQSPId=alaVfcQPQSPId, alaVfcQInstanceQSPId=alaVfcQInstanceQSPId, alaVfcQsapClearStats=alaVfcQsapClearStats, alaVfcQSPType=alaVfcQSPType, alaVfcWRPYellowMinThreshold=alaVfcWRPYellowMinThreshold, alaVfcProfileIndexLookupTable=alaVfcProfileIndexLookupTable, alaVfcQInstanceQsapId=alaVfcQInstanceQsapId, alaVfcQsetInstanceTable=alaVfcQsetInstanceTable, alaVfcQsapAction=alaVfcQsapAction, alaVfcConformance=alaVfcConformance, alaVfcQsapAdminState=alaVfcQsapAdminState, alaVfcQInstanceQsiId=alaVfcQInstanceQsiId, alaVfcProfileName=alaVfcProfileName, alaVfcQInstanceWRPAdminState=alaVfcQInstanceWRPAdminState, alaVfcQInstanceBytesDequeued=alaVfcQInstanceBytesDequeued, alaVfcQProfileTable=alaVfcQProfileTable, alaVfcQInstancePacketsDequeued=alaVfcQInstancePacketsDequeued, VfcBwLimitType=VfcBwLimitType, alaVfcQsapBandwidthLimitValue=alaVfcQsapBandwidthLimitValue, alaVfcWRPRowStatus=alaVfcWRPRowStatus, PYSNMP_MODULE_ID=alcatelIND1VfcMIB, alaVfcQProfileGroup=alaVfcQProfileGroup, alaVfcQInstanceRedPacketsDropped=alaVfcQInstanceRedPacketsDropped, alaVfcQsetLastChange=alaVfcQsetLastChange)
|
## While loop
# like if but it indicates the sequence of statements might be executed many times as long as the condition remains true
theSum = 0
data = input("Enter a number: ")
while (data!= ""):
number = float(data)
theSum += number
data = input("Enter a number or enter to quit: ")
print(f"the sum is: {theSum:,.2f}")
## Summation using for loop
theSum = 0
for number in range(1,10001):
theSum += number
print(theSum)
## Summation using while loop
theSum = 0
number = 1 # must explicitly initialize before the loop
while (number < 10001):
theSum += number
number += 1
print(theSum)
## Count down with for loop
for count in range(10):
print(count, end = " ")
## Count down with while loop
count = 10
while (count > 0):
print(count, end = " ")
count -= 1
|
# -*- coding: utf-8 -*-
API_BASE_URL = 'https://b-api.cardioqvark.ru:1443/'
API_PORT = 1443
CLIENT_CERT_PATH = '/tmp/'
QVARK_CA_CERT_NAME = 'qvark_ca.pem'
|
def dynamically_import():
mod = __import__('my_package.my_module', fromlist=['my_class'])
klass = getattr(mod, 'my_class')
if '__main__' == __name__:
dynamically_import()
|
class Mandatory:
def __init__(self, mandatory1, mandatory2):
self.mandatory1 = mandatory1
self.mandatory2 = mandatory2
def get_args(self):
return self.mandatory1, self.mandatory2
class Defaults:
def __init__(self, mandatory, default1='value', default2=None):
self.mandatory = mandatory
self.default1 = default1
self.default2 = default2
def get_args(self):
return self.mandatory, self.default1, self.default2
class Varargs(Mandatory):
def __init__(self, mandatory, *varargs):
Mandatory.__init__(self, mandatory, ' '.join(str(a) for a in varargs))
class Mixed(Defaults):
def __init__(self, mandatory, default=42, *extra):
Defaults.__init__(self, mandatory, default,
' '.join(str(a) for a in extra))
|
n = int(input())
a = list(map(int, input().split()))
count = 0
j = n - 1
#j là giới hạn bắt đầu của một lần vả: j giúp chống lặp người đã bị giết.
#j phải luôn bé hơn i, vì người ở i chỉ vả được những người ở bên trái nó.
#last_kill_pos: là giới hạn kết thúc của một lần vả.
for i in range(n - 1, -1 , -1):
j = min(i, j)
last_kill_pos = max(0, i - a[i])
if j > last_kill_pos:
count += (j - last_kill_pos)
j = last_kill_pos
print(n - count)
|
"""リスト基礎
リストの要素位置を返すindex関数の使い方
(リストの検索開始位置、終了位置を指定する方法)
[説明ページ]
https://tech.nkhn37.net/python-list-index/#i
"""
# 開始位置と終了位置を指定する。
data = ['A', 'B', 'C', 'A', 'B', 'C', 'D']
idx = data.index('B', 2, 5)
print(f'idx: {idx}, data[idx]: {data[idx]}')
|
#!/usr/bin/env python3
def apples_and_oranges(pair):
first, second = pair
if first == "apples":
return True
elif second == "oranges":
return True
else:
return False
|
# 1)
a = [1, 4, 5, 7, 8, -2, 0, -1]
# 2)
print('At index 3:', a[3])
print('At index 5:', a[5])
# 3)
a_sorted = sorted(a, reverse = True)
print('Sorted a:', a_sorted)
# 4)
print('1...3:', a_sorted[1:4])
print('2...6:', a_sorted[2:7])
# 5)
del a_sorted[2:4]
# 6)
print('Sorted a:', a_sorted)
# 7)
b = ['grapes', 'Potatoes', 'tomatoes', 'Orange', 'Lemon', 'Broccoli', 'Carrot', 'Sausages']
# 8)
b_sorted = sorted(b)
print('Sorted b:', b_sorted)
# 9)
c = a[1:4] + b[4:7]
# 10
print('c:', c)
|
#encoding:utf-8
subreddit = 'PolHumor'
t_channel = '@r_PolHumor'
def send_post(submission, r2t):
return r2t.send_simple(submission)
|
"""
Tools for validating inputs or variables according to specifications detailing what format, datatype, etc. the data must be.
TODO:
- Add common specifications already created
- Change date, time and datetime to use isValid date, time and datetime methods so can call externally
- Change true_false to error if not one of the possibilities
"""
def _round(num, digits):
"""
Private rounding method which uses the built-in round function but fixes a problem:
If you call it with the number of digits as 0, it will round to 0 decimal places but leave as a float (so it has a .0 at the end)
Whereas if you call it without the number of digits, it will round to 0 decimal places but convert to an integer
But as I dynamically work out digits, I always provide the number of digits even if it is 0 and if it is 0, I want it to be an int
So I just check this and potentially call it with no arguments accordingly
"""
return round(num, digits) if digits != 0 else round(num)
class Spec:
"""
Specifies the format of data in general
:param type_: The datatype the data must be
:param extra_values: A list of extra values it can take to always be true, even if not the datatype. Default: None
"""
def __init__(self, type_, extra_values=None):
"""
Specifies the format of data
:param type_: The datatype the data must be
:param extra_values: A list of extra values it can take to always be true, even if not the datatype. Default: None
"""
assert isinstance(type_, type), "param type_ must be a datatype"
self.type = type_
self.extra_values = extra_values
self.msg = "Must be type {}".format(str(type_)[8:-2])
if extra_values:
self.msg += " or one of the following: " + ", ".join(["'{}'".format(value) for value in extra_values])
def __repr__(self):
return "Spec({})".format(self.msg)
class SpecStr(Spec):
"""
Specifies the format of a string
:param allowed_strings: A list of allowed strings. None allows any. Default: None.
:param allowed_chars: A list of allowed characters. None allows any. Default: None.
:param to_lower: Whether or not to lower the string before checking. Default: True
:param extra_values: A list of extra values it can take to always be true, even if not the datatype. Default: None
"""
def __init__(self, allowed_strings=None, allowed_chars=None, to_lower=True, extra_values=None):
"""
Specifies the format of a string
:param allowed_strings: A list of allowed strings. None allows any. Default: None.
:param allowed_chars: A list of allowed characters. None allows any. Default: None.
:param to_lower: Whether or not to lower the string before checking. Default: True
:param extra_values: A list of extra values it can take to always be true, even if not the datatype. Default: None
"""
assert isinstance(allowed_strings, list) or allowed_strings is None, "param allowed_strings must be a list or None"
if allowed_strings is not None:
assert all([isinstance(item, str) for item in allowed_strings]), "all items in param allowed_strings must be strings"
assert isinstance(allowed_chars, list) or allowed_chars is None, "param allowed_chars must be a list or None"
if allowed_chars is not None:
assert all([isinstance(item, str) and len(item) == 1 for item in allowed_chars]), "all items in param allowed_chars must be strings of length 1"
super().__init__(str, extra_values)
self.allowed_strings = [item.lower() for item in allowed_strings] if to_lower and allowed_strings is not None else allowed_strings
self.allowed_chars = [item.lower() for item in allowed_chars] if to_lower and allowed_chars is not None else allowed_chars
self.to_lower = to_lower
if allowed_strings is not None:
if to_lower:
self.msg += " and once converted to lower case, must be one of the following: "
else:
self.msg += " and must be one of the following: "
self.msg += ", ".join(["'{}'".format(item) for item in allowed_strings])
if allowed_chars is not None:
if to_lower:
self.msg += " and once converted to lower case, every character must be one of the following: "
else:
self.msg += " and every character must be one of the following: "
self.msg += ", ".join(["'{}'".format(item) for item in allowed_chars])
class SpecNum(Spec):
"""
Specifies the format of a number
:param round_digits: The number of digits to round to before checking. None means don't round. Default: None
:param restrict_to_int: Whether or not to only allow integers. Default: False
:param extra_values: A list of extra values it can take to always be true, even if not the datatype. Default: None
"""
def __init__(self, round_digits=None, restrict_to_int=False, extra_values=None):
"""
Specifies the format of a number
:param round_digits: The number of digits to round to before checking. None means don't round. Default: None
:param restrict_to_int: Whether or not to only allow integers. Default: False
:param extra_values: A list of extra values it can take to always be true, even if not the datatype. Default: None
"""
assert round_digits is None or isinstance(round_digits, int), "param round_digits must be an integer or None"
super().__init__(int if restrict_to_int else float, extra_values)
self.round_digits = round_digits
if restrict_to_int:
self.msg = "Must be an integer"
else:
self.msg = "Must be a number"
if round_digits is not None:
self.msg = "Once rounded to {} decimal places, m".format(round_digits) + self.msg[1:]
if extra_values:
self.msg += " or leave blank"
class SpecNumRange(SpecNum):
"""
Specifies the format of a number in a range
:param min_: The minimum valid value. None means there is no minimum. Default: None
:param max_: The maximum valid value. None means there is no maximum. Default: None
:param round_digits: The number of digits to round to before checking. None means don't round. Default: None
:param restrict_to_int: Whether or not to only allow integers. Default: False
:param extra_values: A list of extra values it can take to always be true, even if not the datatype. Default: None
"""
def __init__(self, min_=None, max_=None, round_digits=None, restrict_to_int=False, extra_values=None):
"""
Specifies the format of a number in a range
:param min_: The minimum valid value. None means there is no minimum. Default: None
:param max_: The maximum valid value. None means there is no maximum. Default: None
:param round_digits: The number of digits to round to before checking. None means don't round. Default: None
:param restrict_to_int: Whether or not to only allow integers. Default: False
:param extra_values: A list of extra values it can take to always be true, even if not the datatype. Default: None
"""
assert isinstance(min_, (int, float)) or min_ is None, "param min_ must be a number or None"
assert isinstance(max_, (int, float)) or max_ is None, "param max_ must be a number or None"
super().__init__(round_digits, restrict_to_int, extra_values)
self.min = min_
self.max = max_
if min_ is not None:
self.msg += ", minimum {}".format(min_)
if max_ is not None:
self.msg += ", maximum {}".format(max_)
class SpecNumList(SpecNum):
"""
Specifies the format of a number from a list of allowed numbers
:param list_of_allowed: A list of allowed numbers
:param round_digits: The number of digits to round to before checking. None means don't round. Default: None
:param restrict_to_int: Whether or not to only allow integers. Default: False
:param extra_values: A list of extra values it can take to always be true, even if not the datatype. Default: None
"""
def __init__(self, list_of_allowed, round_digits=None, restrict_to_int=False, extra_values=None):
"""
Specifies the format of a number from a list of allowed numbers
:param list_of_allowed: A list of allowed numbers
:param round_digits: The number of digits to round to before checking. None means don't round. Default: None
:param restrict_to_int: Whether or not to only allow integers. Default: False
:param extra_values: A list of extra values it can take to always be true, even if not the datatype. Default: None
"""
assert isinstance(list_of_allowed, (list, tuple)), "param list_of_allowed must be a list or tuple"
assert all([isinstance(item, int if restrict_to_int else (int, float)) for item in list_of_allowed]), "all items in param list_of_allowed must be numbers"
super().__init__(round_digits, restrict_to_int, extra_values)
self.list_of_allowed = list_of_allowed
self.msg += " that is one of the following: " + ", ".join(["'{}'".format(item) for item in list_of_allowed])
def is_valid(value, spec):
"""
Return whether or not 'value' is valid according to 'spec' and the validated 'value'
:param value: The value to validate
:param spec: A descendant of the 'Spec' class, containing information on how to validate
:return: Whether or not the value was valid according to the specification
:return: The value after validation (converted to the right type, lowered if applicable, etc.). This is only valid if the first return value is True.
"""
assert isinstance(spec, Spec), "param spec must be an object of a 'Spec' class"
if spec.extra_values and value in spec.extra_values:
return True, value
if isinstance(value, str):
value = value.strip()
if isinstance(spec, SpecNum):
# rounds before converting as if it is meant to be an int but it is a float but they have
# allowed rounding to the nearest whole number, it would error but not when doing this
try:
value = float(value)
except (ValueError, TypeError):
return False, value
else:
if spec.round_digits is not None:
value = _round(value, spec.round_digits)
try:
value = spec.type(value)
except ValueError:
return False, value
else:
if isinstance(spec, SpecStr) and spec.to_lower:
value = value.lower()
if isinstance(spec, SpecNum) and spec.round_digits is not None:
value = _round(value, spec.round_digits)
if hasattr(spec, "allowed_strings") and spec.allowed_strings is not None:
return value in spec.allowed_strings, value
if hasattr(spec, "list_of_allowed") and spec.list_of_allowed is not None:
return value in spec.list_of_allowed, value
if hasattr(spec, "allowed_chars") and spec.allowed_chars is not None:
return all([char in spec.allowed_chars for char in value]), value
if isinstance(spec, SpecNumRange):
if spec.min is not None and spec.max is not None:
return spec.min <= value <= spec.max, value
if spec.min is not None:
return spec.min <= value, value
if spec.max is not None:
return value <= spec.max, value
return True, value
def validate_input(spec, prompt=None):
"""
Repeatedly ask the user for input until their input is valid according to 'spec' and return their validated input
:param spec: A descendant of the 'Spec' class, containing information on how to validate
:param prompt: The prompt to display to the user before asking them to input. None displays nothing. Default: None
:return: The valid value the user input
"""
acceptable = False
while not acceptable:
acceptable, value = is_valid(input(prompt) if prompt is not None else input(), spec)
if not acceptable:
print(spec.msg)
return value
def assert_valid(value, spec, name=None):
"""
Throw an assertion error if 'value' is invalid according to 'spec', otherwise return it
:param value: The value to validate
:param spec: A descendant of the 'Spec' class, containing information on how to validate
:param name: The name to reference the value so it is clear what is invalid in error messages. None just displays the error message. Default: None
:return value: If it hasn't thrown an assertion error, returns the valid value after normalisation
"""
valid, value = is_valid(value, spec)
assert valid, spec.msg if name is None else str(name).strip().lower() + ": " + spec.msg
return value
def true_false(prompt=None, extra_values=None):
"""
Repeatedly ask the user for an input until they input a boolean-like value and return the boolean version
:param prompt: The prompt to display to the user before asking them to input. None will not display anything. Default: None
:param extra_values: A list of extra values it can take to be None. Default: None
:return: True or False depending on the user's input or None if extra_values and they input one of these
"""
value = validate_input(specTrueFalse, prompt)
if extra_values is not None and value in extra_values:
return None
if value in ["f", "false", "n", "no", "0", "off", "disabled", "disable"]:
return False
return True
def date(prompt=None, enforce=True, form="exact", fill_0s=True):
"""
Repeatedly ask the user for a year, month and day until they input valid values and return this in a defined format
:param prompt: Message to display to the user before asking them for inputs. Default: None
:param enforce: Whether or not to enforce valid dates. If False, will allow empty inputs. Default: True
:param form: The form to output the date in. Default: 'exact'. Must be one of the following:
- 'exact': year-month-day
- 'uk': day/month/year
- 'us': month/day/year
- 'long': day_with_suffix month_as_word, year
:param fill_0s: Whether or not to fill numerical dates with leading 0s. Doesn't apply to 'long' form
"""
extras = None if enforce else [""]
form = assert_valid(form, SpecStr(["exact", "uk", "us", "long"]), "param form")
if prompt is not None:
print(prompt, "\n")
year = validate_input(SpecNumRange(restrict_to_int=True, extra_values=extras), "Year: " if enforce else "Year (can leave blank): ")
if enforce:
if year % 4 == 0 and (year % 100 != 0 or year % 400 == 0):
leap_year = True
else:
leap_year = False
months = ["jan", "feb", "mar", "apr", "may", "jun", "jul", "aug", "sep", "oct", "nov", "dec"]
allowed = months.copy()
allowed.extend(["1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12"])
month = validate_input(SpecStr(allowed, extra_values=extras), "Month: " if enforce else "Month (can leave blank): ")
if month in months:
month = months.index(month) + 1
elif month in allowed:
month = int(month)
days = 28 if month == 2 and (not enforce or not leap_year) else \
29 if month == 2 and (not enforce or leap_year) else \
30 if month == 4 or month == 6 or month == 9 or month == 11 else \
31
day = validate_input(SpecNumRange(1, days, None, True, extras), "Date/day: " if enforce else "Date/day (can leave blank): ")
if year is None:
year = "?"
if month is None:
month = "?"
if day is None:
day = "?"
if form == "long":
suffix = "st" if day % 10 == 1 else "nd" if day % 10 == 2 else "rd" if day % 10 == 3 else "th"
month = months[month - 1]
month = "".join([month[i].upper() if i == 0 else month[i] for i in range(len(month))])
return "{}{} {}, {}".format(day, suffix, month, year)
if fill_0s and month != "?" and day != "?":
if month < 10:
month = "0" + str(month)
if day < 10:
day = "0" + str(day)
if form == "exact":
return "{}-{}-{}".format(year, month, day)
if form == "us":
return "{}/{}/{}".format(month, day, year)
return "{}/{}/{}".format(day, month, year)
def time(prompt=None, output_hour_clock=24, milli_seconds=False, fill_0s=True, allow_na=False):
"""
Repeatedly ask the user to input hours, minutes and seconds until they input valid values and return this in a defined format
:param prompt: Message to display to the user before asking them for inputs. Default: None
:param output_hour_clock: Whether to output in 24 hour clock or in 12 hour clock with AM/PM. Default: 24
:param milli_seconds: Whether or not to allow more accuracy in seconds. Default: False
:param fill_0s: Whether or not to fill numerical times with leading 0s. Default: False
:param allow_na: Whether or not to allow empty inputs too. Default: False
"""
extras = None if allow_na else [""]
output_hour_clock = assert_valid(output_hour_clock, SpecNumList([12, 24], None, True), "param output_hour_clock")
if prompt is not None:
print(prompt, "\n")
input_hour_clock = validate_input(SpecNumList([12, 24], None, True), "Input hour clock (12/24): ")
if input_hour_clock == 12:
hours = validate_input(SpecNumRange(1, 12, None, True, extras), "Hours (12 hour clock): ")
period = validate_input(SpecStr(["am", "pm"], extra_values=extras), "AM or PM? ")
if hours == 12:
hours = 0
if period == "pm":
hours += 12
else:
hours = validate_input(SpecNumRange(0, 23, None, True, extras), "Hours (24 hour clock): ")
minutes = validate_input(SpecNumRange(0, 59, None, True, extras), "Minutes: ")
if milli_seconds:
seconds = validate_input(SpecNumRange(0, 59.999999, 6, False, extras), "Seconds including decimal: ")
else:
seconds = validate_input(SpecNumRange(0, 59, 0, True, extras), "Seconds: ")
if hours is not None and output_hour_clock == 12:
if hours < 12:
period = "AM"
else:
period = "PM"
hours %= 12
if hours == 0:
hours = 12
if fill_0s:
if hours is not None and hours < 10:
hours = "0" + str(hours)
if minutes is not None and minutes < 10:
minutes = "0" + str(minutes)
if seconds is not None and seconds < 10:
seconds = "0" + str(seconds)
to_return = "{}:{}:{}".format(hours, minutes, seconds)
if output_hour_clock == 12:
to_return += " {}".format(period)
return to_return
def datetime(prompt=None, enforce=True, form="exact", milli_seconds=False, fill_0s=True):
"""
Repeatedly ask the user to input a year, month, day, hours, minutes and seconds until they input valid values and return this in a defined format
:param prompt: Message to display to the user before asking them for inputs. Default: None
:param enforce: Whether or not to enforce valid dates. If False, will allow empty inputs. Default: True
:param form: The form to output the datetime in. Default: exact
- 'exact': year-month-day hour_in_24_hour_clock:minute:second
- 'long': day_with_suffix month_as_word, year hour_in_12_hour_clock:minute:second AM_or_PM
:param milli_seconds: Whether or not to allow more accuracy when inputting seconds. Default: False
:param fill_0s: Whether or not to fill numerical datetimes with leading 0s. Default: True
"""
form = assert_valid(form, SpecStr(["exact", "long"]), "param form")
if prompt is not None:
print(prompt, "\n")
date_ = date(None, enforce, form, fill_0s)
time_ = time(None, 24 if form == "exact" else 12, milli_seconds, fill_0s, not enforce)
return "{} {}".format(date_, time_)
specTrueFalse = SpecStr(["t", "true", "f", "false", "y", "yes", "n", "no", "0", "1", "on", "off", "enabled", "enable", "disabled", "disable"])
specDay = SpecNumRange(1, 31, restrict_to_int=True)
specMonth = SpecNumRange(1, 12, restrict_to_int=True)
specYear = SpecNumRange(1, restrict_to_int=True)
specHour = SpecNumRange(0, 23, restrict_to_int=True)
specMinuteSecond = SpecNumRange(0, 59, restrict_to_int=True)
|
"""
LC 775
You are given an integer array nums of length n which represents a permutation of all the integers in the range [0, n - 1].
The number of global inversions is the number of the different pairs (i, j) where:
0 <= i < j < n
nums[i] > nums[j]
The number of local inversions is the number of indices i where:
0 <= i < n - 1
nums[i] > nums[i + 1]
Return true if the number of global inversions is equal to the number of local inversions.
Example 1:
Input: nums = [1,0,2]
Output: true
Explanation: There is 1 global inversion and 1 local inversion.
Example 2:
Input: nums = [1,2,0]
Output: false
Explanation: There are 2 global inversions and 1 local inversion.
"""
class Solution:
def isIdealPermutation(self, nums: List[int]) -> bool:
running_min = nums[-1]
# check value pairs whose indices have difference of 2
for i in range(len(nums) - 1, 1, -1):
running_min = min(nums[i], running_min)
if nums[i - 2] > running_min:
return False
return True
"""
Time O(N)
Space O(1)
"""
|
print("this is a test for branching")
print("this is on loopbranch")
#this will be added on the new file with out modifing the code before
l = list()
for i in range(6):
l.append(i)
print(l) |
"""Exceptions used by the FlickrAPI module."""
class IllegalArgumentException(ValueError):
"""Raised when a method is passed an illegal argument.
More specific details will be included in the exception message
when thrown.
"""
class FlickrError(Exception):
"""Raised when a Flickr method fails.
More specific details will be included in the exception message
when thrown.
"""
def __init__(self, message, code=None):
Exception.__init__(self, message)
if code is None:
self.code = None
else:
self.code = int(code)
class CancelUpload(Exception):
"""Raise this exception in an upload/replace callback function to
abort the upload.
"""
class LockingError(Exception):
"""Raised when TokenCache cannot acquire a lock within the timeout
period, or when a lock release is attempted when the lock does not
belong to this process.
"""
class CacheDatabaseError(FlickrError):
"""Raised when the OAuth token cache database is corrupted
or otherwise unusable.
"""
|
# -*- coding: utf-8 -*-
"""Top-level package for napari-aicsimageio."""
__author__ = "Jackson Maxfield Brown"
__email__ = "jacksonb@alleninstitute.org"
# Do not edit this string manually, always use bumpversion
# Details in CONTRIBUTING.md
__version__ = "0.4.0"
def get_module_version() -> str:
return __version__
|
def show_dict(D):
for i,j in D.items():
print(f"{i}: {j}")
def sort_by_values(D):
L = sorted(D.items(), key=lambda kv: kv[1])
return L |
# coding = utf-8
# Create date: 2018-10-29
# Author :Bowen Lee
def test_dhcp_hostname(ros_kvm_init, cloud_config_url):
command = 'hostname'
feed_back = 'rancher'
kwargs = dict(cloud_config='{url}test_dncp_hostname.yml'.format(url=cloud_config_url),
is_install_to_hard_drive=True)
tuple_return = ros_kvm_init(**kwargs)
client = tuple_return[0]
stdin, stdout, stderr = client.exec_command(command, timeout=60)
output = stdout.read().decode('utf-8')
assert (feed_back in output)
command_etc = 'cat /etc/hosts'
stdin, stdout, stderr = client.exec_command(command_etc, timeout=60)
output_etc = stdout.read().decode('utf-8')
client.close()
assert (output_etc in output_etc)
|
condition = 1
while condition < 10:
print(condition)
condition += 1
while True:
print('santhosh')
|
class ParsingError(Exception):
pass
class CastError(Exception):
original_exception = None
def __init__(self, exception):
if isinstance(exception, Exception):
message = str(exception)
self.original_exception = exception
else:
message = str(exception)
self.original_exception = None
super().__init__(message)
|
"""Python library for Lyapunov Estimation and Policy Augmentation (LEAP).
controllers - All controller classes.
examples - Example implementations, simulations, and plotting code.
learning - Learning utilities.
lyapunov_functions - All Lyapunov function classes.
outputs - All output classes.
systems - All system classes.
"""
name = 'lyapy'
|
# dataset settings
dataset_type = 'S3DISSegDataset'
data_root = './data/s3dis/'
class_names = ('ceiling', 'floor', 'wall', 'beam', 'column', 'window', 'door',
'table', 'chair', 'sofa', 'bookcase', 'board', 'clutter')
num_points = 4096
train_area = [1, 2, 3, 4, 6]
test_area = 5
train_pipeline = [
dict(
type='LoadPointsFromFile',
coord_type='DEPTH',
shift_height=False,
use_color=True,
load_dim=6,
use_dim=[0, 1, 2, 3, 4, 5]),
dict(
type='LoadAnnotations3D',
with_bbox_3d=False,
with_label_3d=False,
with_mask_3d=False,
with_seg_3d=True),
dict(
type='PointSegClassMapping',
valid_cat_ids=tuple(range(len(class_names))),
max_cat_id=13),
dict(
type='IndoorPatchPointSample',
num_points=num_points,
block_size=1.0,
sample_rate=1.0,
ignore_index=len(class_names),
use_normalized_coord=True),
dict(type='NormalizePointsColor', color_mean=None),
dict(type='DefaultFormatBundle3D', class_names=class_names),
dict(type='Collect3D', keys=['points', 'pts_semantic_mask'])
]
test_pipeline = [
dict(
type='LoadPointsFromFile',
coord_type='DEPTH',
shift_height=False,
use_color=True,
load_dim=6,
use_dim=[0, 1, 2, 3, 4, 5]),
dict(type='NormalizePointsColor', color_mean=None),
dict(
# a wrapper in order to successfully call test function
# actually we don't perform test-time-aug
type='MultiScaleFlipAug3D',
img_scale=(1333, 800),
pts_scale_ratio=1,
flip=False,
transforms=[
dict(
type='GlobalRotScaleTrans',
rot_range=[0, 0],
scale_ratio_range=[1., 1.],
translation_std=[0, 0, 0]),
dict(
type='RandomFlip3D',
sync_2d=False,
flip_ratio_bev_horizontal=0.0,
flip_ratio_bev_vertical=0.0),
dict(
type='DefaultFormatBundle3D',
class_names=class_names,
with_label=False),
dict(type='Collect3D', keys=['points'])
])
]
# construct a pipeline for data and gt loading in show function
# please keep its loading function consistent with test_pipeline (e.g. client)
# we need to load gt seg_mask!
eval_pipeline = [
dict(
type='LoadPointsFromFile',
coord_type='DEPTH',
shift_height=False,
use_color=True,
load_dim=6,
use_dim=[0, 1, 2, 3, 4, 5]),
dict(
type='LoadAnnotations3D',
with_bbox_3d=False,
with_label_3d=False,
with_mask_3d=False,
with_seg_3d=True),
dict(
type='PointSegClassMapping',
valid_cat_ids=tuple(range(len(class_names))),
max_cat_id=13),
dict(
type='DefaultFormatBundle3D',
with_label=False,
class_names=class_names),
dict(type='Collect3D', keys=['points', 'pts_semantic_mask'])
]
data = dict(
samples_per_gpu=8,
workers_per_gpu=4,
# train on area 1, 2, 3, 4, 6
# test on area 5
train=dict(
type=dataset_type,
data_root=data_root,
ann_files=[
data_root + f's3dis_infos_Area_{i}.pkl' for i in train_area
],
pipeline=train_pipeline,
classes=class_names,
test_mode=False,
ignore_index=len(class_names),
scene_idxs=[
data_root + f'seg_info/Area_{i}_resampled_scene_idxs.npy'
for i in train_area
],
label_weights=[
data_root + f'seg_info/Area_{i}_label_weight.npy'
for i in train_area
]),
val=dict(
type=dataset_type,
data_root=data_root,
ann_files=data_root + f's3dis_infos_Area_{test_area}.pkl',
pipeline=test_pipeline,
classes=class_names,
test_mode=True,
ignore_index=len(class_names),
scene_idxs=data_root +
f'seg_info/Area_{test_area}_resampled_scene_idxs.npy'),
test=dict(
type=dataset_type,
data_root=data_root,
ann_files=data_root + f's3dis_infos_Area_{test_area}.pkl',
pipeline=test_pipeline,
classes=class_names,
test_mode=True,
ignore_index=len(class_names)))
evaluation = dict(pipeline=eval_pipeline)
|
# my_module.py is about the use of modules in python
# I did random things that came to mind
# makes use of the type function
# returns the type as expected from the type function
#
# put the bracket around a sequence of numbers before you cast,
# when you are looking for the type of the casted obj
# that is, pass it as a tuple
# sample: get_obj_type((1,2,3,4)), get_obj_type takes on positional argument
def get_obj_type(obj):
""" returns the type of an object """
return type(obj)
# makes use of the len function
# this works on any sequence i know off as at now
# i changed the length of True to 1 and False to 0
# for numbers such as int and float
# it returns the length of the number when casted
# for the float the dot, "." is also counted
def get_obj_len(obj):
"""
returns the length of an object
"""
number_types = [int, float]
if get_obj_type(obj) in number_types:
return len(str(obj))
elif get_obj_type(obj) == bool:
return 1 if obj == True else 0
elif get_obj_type(obj) == type:
return 0
else:
return len(obj)
# check if an object is a sequence (an iterable)
def is_obj_sequence(obj):
"""
checks if an object is a sequence (an iterable) and returns a boolean\r\n
"""
sequence = [set, list, tuple, str, dict]
return True if obj in sequence or get_obj_type(obj) in sequence else False
# calls the above functions on the object
def display_obj_stats(obj):
"""
makes call to get_obj_type, get_obj_len and is_obj_sequence, passes obj as argument and prints the result\r\n
sample use case: \r\n
display_obj_stats("python") -> arg: python type: < class 'str' > size: 6 sequential: True\r\n
display_obj_stats("Afro circus") -> arg: Afro circus type: < class 'str' > size: 11 sequential: True
"""
print("arg:", obj, "type:", get_obj_type(obj), "size:",
get_obj_len(obj), "sequential:", is_obj_sequence(obj))
# test cases as a module
display_obj_stats(0)
display_obj_stats(-3143)
display_obj_stats(int())
display_obj_stats(int('123'))
display_obj_stats(int)
display_obj_stats(3.143)
display_obj_stats("")
display_obj_stats("python")
display_obj_stats(True)
display_obj_stats(False)
display_obj_stats((1, 2, 3, 4))
display_obj_stats({1, 2, 2, 3, 4})
display_obj_stats(set)
display_obj_stats(set((2, 3, 4)))
display_obj_stats(list((2, 3, 4)))
display_obj_stats(dict([('c', 0), ('python', 1), ('cotu', 2)]))
# this part isn't working as i thought it would
# i hope i get it later
# if __name__ == "__main__":
# from sys import argv
# obj = argv[1]
# print(get_obj_type(obj))
# print(get_obj_len(obj))
# print(is_obj_sequence(obj))
# from tier2.my_module import get_obj_type as _type, get_obj_len as _len, is_obj_sequence as _seq
# my_module was in tier2 on my pc
# from my_module import get_obj_type as _type, get_obj_len as _len, is_obj_sequence as _seq
# if you have my_module in same directory as the command line
# from path.to.my_module.my_module import get_obj_type as _type, get_obj_len as _len, is_obj_sequence as _seq
# it will be better if a try and catch is added
|
def wind_stress_curl(Tx, Ty, x, y):
"""Calculate the curl of wind stress (Tx, Ty).
Args:
Tx, Ty: Wind stress components (N/m^2), 3d
x, y: Coordinates in lon, lat (degrees), 1d.
Notes:
Curl(Tx,Ty) = dTy/dx - dTx/dy
The different constants come from oblateness of the ellipsoid.
Ensure the coordinates follow tdim=0, ydim=1, xdim=2
"""
dy = np.abs(y[1] - y[0]) # scalar in deg
dx = np.abs(x[1] - x[0])
dy *= 110575. # scalar in m
dx *= 111303. * np.cos(y * np.pi/180) # array in m (varies w/lat)
dTxdy = np.gradient(Tx, dy, axis=1) # (N/m^3)
dTydx = np.ndarray(Ty.shape)
for i in range(len(y)):
dTydx[:,i,:] = np.gradient(Ty[:,i,:], dx[i], axis=1)
curl_tau = dTydx - dTxdy # (N/m^3)
return curl_tau |
p = int(input("Enter a number: "))
def expand_x_1(p):
if p == 1:
print('Neither composite nor prime')
exit()
elif p < 1 or (p - int(p)) != 0:
print('Invalid Input')
exit()
coefficient = [1]
for i in range(p):
coefficient.append(coefficient[-1] * -(p - i) / (i + 1))
coefficients = coefficient[1: p]
#print(coefficients)
sum = 0 # Finding the sum of all the numbers in the coefficients
for number in coefficients:
int_value = int(number)
abs_number = abs(int_value)
#print(abs_number)
sum += abs_number
#print("Sum:",sum)
if sum % p == 0: # checking whether the number is prime or not
print("{} is a prime".format(p))
else:
print("{} is not a prime".format(p))
expand_x_1(p) |
class CFG:
random_state = 42
shuffle = True
test_size = 0.3
no_of_fold = 5
use_gpu = False |
def extractJapmtlWordpressCom(item):
'''
Parser for 'japmtl.wordpress.com'
'''
vol, chp, frag, postfix = extractVolChapterFragmentPostfix(item['title'])
if not (chp or vol) or "preview" in item['title'].lower():
return None
tagmap = [
('one day, the engagement was suddenly cancelled. ......my little sister\'s.', 'one day, the engagement was suddenly cancelled. ......my little sister\'s.', 'translated'),
('villainess (?) and my engagement cancellation', 'villainess (?) and my engagement cancellation', 'translated'),
('beloved villain flips the skies', 'beloved villain flips the skies', 'translated'),
('slow life villainess doesn\'t notice the prince\'s fondness', 'slow life villainess doesn\'t notice the prince\'s fondness', 'translated'),
('is the villain not allowed to fall in love?', 'is the villain not allowed to fall in love?', 'translated'),
('PRC', 'PRC', 'translated'),
('Loiterous', 'Loiterous', 'oel'),
]
for tagname, name, tl_type in tagmap:
if tagname in item['tags']:
return buildReleaseMessageWithType(item, name, vol, chp, frag=frag, postfix=postfix, tl_type=tl_type)
return False |
# a = dict(name="陈云老师",age=20)
# a = {"name":"陈云"}
# print(a['name'])
# def hello(name, age):
# print(f"Hello {name}, your age is {age}")
#
#
# hello(age=20,name="陈云老师")
# def add_numbers(a, b):
# return a + b
# print(add_numbers(2, 3))
# def get_info():
# return "Chen", 20
#
#
# name, age = get_info()
# print(name)
# data = (1, 2, 3, "Hello World") # 元组
# print(data[0])
class A:
def hello(self):
print("Hello World")
a = A()
a.hello()
class B(A):
pass
b = B()
b.hello()
|
"""\
Imposer
=======
Main promise class for use of barriers/shared states.
"""
class Imposer:
def __init__(self, env):
self.env = env
return
def resolve(self):
"""Notify the states are ready"""
return
def reject(self):
"""Notify its rejection with exceptions"""
return
def wait(self):
"""Block to wait for the returning states"""
return
def wait_for(self):
"""Wait but with a timeout"""
return
|
class DataGridViewCellPaintingEventArgs(HandledEventArgs):
"""
Provides data for the System.Windows.Forms.DataGridView.CellPainting event.
DataGridViewCellPaintingEventArgs(dataGridView: DataGridView,graphics: Graphics,clipBounds: Rectangle,cellBounds: Rectangle,rowIndex: int,columnIndex: int,cellState: DataGridViewElementStates,value: object,formattedValue: object,errorText: str,cellStyle: DataGridViewCellStyle,advancedBorderStyle: DataGridViewAdvancedBorderStyle,paintParts: DataGridViewPaintParts)
"""
def Instance(self):
""" This function has been arbitrarily put into the stubs"""
return DataGridViewCellPaintingEventArgs()
def Paint(self,clipBounds,paintParts):
"""
Paint(self: DataGridViewCellPaintingEventArgs,clipBounds: Rectangle,paintParts: DataGridViewPaintParts)
Paints the specified parts of the cell for the area in the specified bounds.
clipBounds: A System.Drawing.Rectangle that specifies the area of the System.Windows.Forms.DataGridView to be painted.
paintParts: A bitwise combination of System.Windows.Forms.DataGridViewPaintParts values specifying the parts to paint.
"""
pass
def PaintBackground(self,clipBounds,cellsPaintSelectionBackground):
"""
PaintBackground(self: DataGridViewCellPaintingEventArgs,clipBounds: Rectangle,cellsPaintSelectionBackground: bool)
Paints the cell background for the area in the specified bounds.
clipBounds: A System.Drawing.Rectangle that specifies the area of the System.Windows.Forms.DataGridView to be painted.
cellsPaintSelectionBackground: true to paint the background of the specified bounds with the color of the System.Windows.Forms.DataGridViewCellStyle.SelectionBackColor property of the System.Windows.Forms.DataGridViewCell.InheritedStyle; false to paint the background of the specified bounds with the color of the System.Windows.Forms.DataGridViewCellStyle.BackColor property of the System.Windows.Forms.DataGridViewCell.InheritedStyle.
"""
pass
def PaintContent(self,clipBounds):
"""
PaintContent(self: DataGridViewCellPaintingEventArgs,clipBounds: Rectangle)
Paints the cell content for the area in the specified bounds.
clipBounds: A System.Drawing.Rectangle that specifies the area of the System.Windows.Forms.DataGridView to be painted.
"""
pass
@staticmethod
def __new__(self,dataGridView,graphics,clipBounds,cellBounds,rowIndex,columnIndex,cellState,value,formattedValue,errorText,cellStyle,advancedBorderStyle,paintParts):
""" __new__(cls: type,dataGridView: DataGridView,graphics: Graphics,clipBounds: Rectangle,cellBounds: Rectangle,rowIndex: int,columnIndex: int,cellState: DataGridViewElementStates,value: object,formattedValue: object,errorText: str,cellStyle: DataGridViewCellStyle,advancedBorderStyle: DataGridViewAdvancedBorderStyle,paintParts: DataGridViewPaintParts) """
pass
AdvancedBorderStyle=property(lambda self: object(),lambda self,v: None,lambda self: None)
"""Gets the border style of the current System.Windows.Forms.DataGridViewCell.
Get: AdvancedBorderStyle(self: DataGridViewCellPaintingEventArgs) -> DataGridViewAdvancedBorderStyle
"""
CellBounds=property(lambda self: object(),lambda self,v: None,lambda self: None)
"""Get the bounds of the current System.Windows.Forms.DataGridViewCell.
Get: CellBounds(self: DataGridViewCellPaintingEventArgs) -> Rectangle
"""
CellStyle=property(lambda self: object(),lambda self,v: None,lambda self: None)
"""Gets the cell style of the current System.Windows.Forms.DataGridViewCell.
Get: CellStyle(self: DataGridViewCellPaintingEventArgs) -> DataGridViewCellStyle
"""
ClipBounds=property(lambda self: object(),lambda self,v: None,lambda self: None)
"""Gets the area of the System.Windows.Forms.DataGridView that needs to be repainted.
Get: ClipBounds(self: DataGridViewCellPaintingEventArgs) -> Rectangle
"""
ColumnIndex=property(lambda self: object(),lambda self,v: None,lambda self: None)
"""Gets the column index of the current System.Windows.Forms.DataGridViewCell.
Get: ColumnIndex(self: DataGridViewCellPaintingEventArgs) -> int
"""
ErrorText=property(lambda self: object(),lambda self,v: None,lambda self: None)
"""Gets a string that represents an error message for the current System.Windows.Forms.DataGridViewCell.
Get: ErrorText(self: DataGridViewCellPaintingEventArgs) -> str
"""
FormattedValue=property(lambda self: object(),lambda self,v: None,lambda self: None)
"""Gets the formatted value of the current System.Windows.Forms.DataGridViewCell.
Get: FormattedValue(self: DataGridViewCellPaintingEventArgs) -> object
"""
Graphics=property(lambda self: object(),lambda self,v: None,lambda self: None)
"""Gets the System.Drawing.Graphics used to paint the current System.Windows.Forms.DataGridViewCell.
Get: Graphics(self: DataGridViewCellPaintingEventArgs) -> Graphics
"""
PaintParts=property(lambda self: object(),lambda self,v: None,lambda self: None)
"""The cell parts that are to be painted.
Get: PaintParts(self: DataGridViewCellPaintingEventArgs) -> DataGridViewPaintParts
"""
RowIndex=property(lambda self: object(),lambda self,v: None,lambda self: None)
"""Gets the row index of the current System.Windows.Forms.DataGridViewCell.
Get: RowIndex(self: DataGridViewCellPaintingEventArgs) -> int
"""
State=property(lambda self: object(),lambda self,v: None,lambda self: None)
"""Gets the state of the current System.Windows.Forms.DataGridViewCell.
Get: State(self: DataGridViewCellPaintingEventArgs) -> DataGridViewElementStates
"""
Value=property(lambda self: object(),lambda self,v: None,lambda self: None)
"""Gets the value of the current System.Windows.Forms.DataGridViewCell.
Get: Value(self: DataGridViewCellPaintingEventArgs) -> object
"""
|
resp = ''
resp2 = ''
lista = list()
alunos = list()
media = 0
while True:
alunos.append(str(input('Nome: ')))
alunos.append(float(input('Nota 1: ')))
alunos.append(float(input('Nota 2: ')))
resp = str(input('Quer continuar? [S/N] '))
lista.append(alunos[:])
alunos.clear()
if resp[0].upper() in 'N':
break
for a in lista:
media = (a[1] + a[2]) / 2
print('-'*26)
print(f'{"NOME":<10}{"MÉDIA":>13}')
print(f'{a[0].title():<10} -> {media:>8.1f}')
print('-' * 26)
while True:
resp2 = str(input('Qual aluno você quer ver a nota [FLAG 999] ? '))
if resp2 == '999':
break
else:
for a in lista:
if resp2.lower() == a[0].lower():
print(f'Notas do(a) {a[0].title()}: {a[1:3]}')
|
#
# PySNMP MIB module HPN-ICF-DHCPR-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/HPN-ICF-DHCPR-MIB
# Produced by pysmi-0.3.4 at Mon Apr 29 19:25:26 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")
ValueRangeConstraint, ValueSizeConstraint, ConstraintsIntersection, SingleValueConstraint, ConstraintsUnion = mibBuilder.importSymbols("ASN1-REFINEMENT", "ValueRangeConstraint", "ValueSizeConstraint", "ConstraintsIntersection", "SingleValueConstraint", "ConstraintsUnion")
hpnicfRhw, = mibBuilder.importSymbols("HPN-ICF-OID-MIB", "hpnicfRhw")
ifIndex, = mibBuilder.importSymbols("IF-MIB", "ifIndex")
ModuleCompliance, ObjectGroup, NotificationGroup = mibBuilder.importSymbols("SNMPv2-CONF", "ModuleCompliance", "ObjectGroup", "NotificationGroup")
ObjectIdentity, Integer32, NotificationType, Unsigned32, Bits, ModuleIdentity, Gauge32, IpAddress, iso, MibScalar, MibTable, MibTableRow, MibTableColumn, Counter64, TimeTicks, MibIdentifier, Counter32 = mibBuilder.importSymbols("SNMPv2-SMI", "ObjectIdentity", "Integer32", "NotificationType", "Unsigned32", "Bits", "ModuleIdentity", "Gauge32", "IpAddress", "iso", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "Counter64", "TimeTicks", "MibIdentifier", "Counter32")
TextualConvention, DisplayString, RowStatus = mibBuilder.importSymbols("SNMPv2-TC", "TextualConvention", "DisplayString", "RowStatus")
hpnicfDHCPRelayMib = ModuleIdentity((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 8, 1))
hpnicfDHCPRelayMib.setRevisions(('2003-02-12 00:00',))
if mibBuilder.loadTexts: hpnicfDHCPRelayMib.setLastUpdated('200303010000Z')
if mibBuilder.loadTexts: hpnicfDHCPRelayMib.setOrganization('')
hpnicfDHCPRelayMibObject = MibIdentifier((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 8, 1, 1))
hpnicfDHCPRIPTable = MibTable((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 8, 1, 1, 1), )
if mibBuilder.loadTexts: hpnicfDHCPRIPTable.setStatus('current')
hpnicfDHCPRIPEntry = MibTableRow((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 8, 1, 1, 1, 1), ).setIndexNames((0, "IF-MIB", "ifIndex"), (0, "HPN-ICF-DHCPR-MIB", "hpnicfDHCPRIPAddr"))
if mibBuilder.loadTexts: hpnicfDHCPRIPEntry.setStatus('current')
hpnicfDHCPRIPAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 8, 1, 1, 1, 1, 1), IpAddress()).setMaxAccess("readonly")
if mibBuilder.loadTexts: hpnicfDHCPRIPAddr.setStatus('current')
hpnicfDHCPRIPRowStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 8, 1, 1, 1, 1, 2), RowStatus()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: hpnicfDHCPRIPRowStatus.setStatus('current')
hpnicfDHCPRSeletAllocateModeTable = MibTable((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 8, 1, 1, 2), )
if mibBuilder.loadTexts: hpnicfDHCPRSeletAllocateModeTable.setStatus('current')
hpnicfDHCPRSeletAllocateModeEntry = MibTableRow((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 8, 1, 1, 2, 1), ).setIndexNames((0, "IF-MIB", "ifIndex"))
if mibBuilder.loadTexts: hpnicfDHCPRSeletAllocateModeEntry.setStatus('current')
hpnicfDHCPRSelectAllocateMode = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 8, 1, 1, 2, 1, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2))).clone(namedValues=NamedValues(("global", 0), ("interface", 1), ("relay", 2)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: hpnicfDHCPRSelectAllocateMode.setStatus('current')
hpnicfDHCPRelayCycleStatus = MibScalar((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 8, 1, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1))).clone(namedValues=NamedValues(("on", 0), ("off", 1)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: hpnicfDHCPRelayCycleStatus.setStatus('current')
hpnicfDHCPRRxBadPktNum = MibScalar((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 8, 1, 1, 4), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: hpnicfDHCPRRxBadPktNum.setStatus('current')
hpnicfDHCPRRxServerPktNum = MibScalar((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 8, 1, 1, 5), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: hpnicfDHCPRRxServerPktNum.setStatus('current')
hpnicfDHCPRTxServerPktNum = MibScalar((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 8, 1, 1, 6), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: hpnicfDHCPRTxServerPktNum.setStatus('current')
hpnicfDHCPRRxClientPktNum = MibScalar((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 8, 1, 1, 7), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: hpnicfDHCPRRxClientPktNum.setStatus('current')
hpnicfDHCPRTxClientPktNum = MibScalar((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 8, 1, 1, 8), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: hpnicfDHCPRTxClientPktNum.setStatus('current')
hpnicfDHCPRTxClientUniPktNum = MibScalar((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 8, 1, 1, 9), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: hpnicfDHCPRTxClientUniPktNum.setStatus('current')
hpnicfDHCPRTxClientBroPktNum = MibScalar((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 8, 1, 1, 10), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: hpnicfDHCPRTxClientBroPktNum.setStatus('current')
hpnicfDHCPRelayDiscoverPktNum = MibScalar((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 8, 1, 1, 11), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: hpnicfDHCPRelayDiscoverPktNum.setStatus('current')
hpnicfDHCPRelayRequestPktNum = MibScalar((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 8, 1, 1, 12), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: hpnicfDHCPRelayRequestPktNum.setStatus('current')
hpnicfDHCPRelayDeclinePktNum = MibScalar((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 8, 1, 1, 13), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: hpnicfDHCPRelayDeclinePktNum.setStatus('current')
hpnicfDHCPRelayReleasePktNum = MibScalar((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 8, 1, 1, 14), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: hpnicfDHCPRelayReleasePktNum.setStatus('current')
hpnicfDHCPRelayInformPktNum = MibScalar((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 8, 1, 1, 15), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: hpnicfDHCPRelayInformPktNum.setStatus('current')
hpnicfDHCPRelayOfferPktNum = MibScalar((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 8, 1, 1, 16), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: hpnicfDHCPRelayOfferPktNum.setStatus('current')
hpnicfDHCPRelayAckPktNum = MibScalar((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 8, 1, 1, 17), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: hpnicfDHCPRelayAckPktNum.setStatus('current')
hpnicfDHCPRelayNakPktNum = MibScalar((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 8, 1, 1, 18), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: hpnicfDHCPRelayNakPktNum.setStatus('current')
hpnicfDHCPRelayStatisticsReset = MibScalar((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 8, 1, 1, 19), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1))).clone(namedValues=NamedValues(("invalid", 0), ("reset", 1)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: hpnicfDHCPRelayStatisticsReset.setStatus('current')
hpnicfDHCPRelayMIBConformance = MibIdentifier((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 8, 1, 2))
hpnicfDHCPRelayMIBCompliances = MibIdentifier((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 8, 1, 2, 1))
hpnicfDHCPRelayMIBGroups = MibIdentifier((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 8, 1, 2, 2))
hpnicfDHCPRelayMIBGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 8, 1, 2, 2, 1)).setObjects(("HPN-ICF-DHCPR-MIB", "hpnicfDHCPRIPAddr"), ("HPN-ICF-DHCPR-MIB", "hpnicfDHCPRIPRowStatus"), ("HPN-ICF-DHCPR-MIB", "hpnicfDHCPRSelectAllocateMode"), ("HPN-ICF-DHCPR-MIB", "hpnicfDHCPRelayCycleStatus"), ("HPN-ICF-DHCPR-MIB", "hpnicfDHCPRRxBadPktNum"), ("HPN-ICF-DHCPR-MIB", "hpnicfDHCPRRxServerPktNum"), ("HPN-ICF-DHCPR-MIB", "hpnicfDHCPRTxServerPktNum"), ("HPN-ICF-DHCPR-MIB", "hpnicfDHCPRRxClientPktNum"), ("HPN-ICF-DHCPR-MIB", "hpnicfDHCPRTxClientPktNum"), ("HPN-ICF-DHCPR-MIB", "hpnicfDHCPRTxClientUniPktNum"), ("HPN-ICF-DHCPR-MIB", "hpnicfDHCPRTxClientBroPktNum"), ("HPN-ICF-DHCPR-MIB", "hpnicfDHCPRelayDiscoverPktNum"), ("HPN-ICF-DHCPR-MIB", "hpnicfDHCPRelayRequestPktNum"), ("HPN-ICF-DHCPR-MIB", "hpnicfDHCPRelayDeclinePktNum"), ("HPN-ICF-DHCPR-MIB", "hpnicfDHCPRelayReleasePktNum"), ("HPN-ICF-DHCPR-MIB", "hpnicfDHCPRelayInformPktNum"), ("HPN-ICF-DHCPR-MIB", "hpnicfDHCPRelayOfferPktNum"), ("HPN-ICF-DHCPR-MIB", "hpnicfDHCPRelayAckPktNum"), ("HPN-ICF-DHCPR-MIB", "hpnicfDHCPRelayNakPktNum"), ("HPN-ICF-DHCPR-MIB", "hpnicfDHCPRelayStatisticsReset"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
hpnicfDHCPRelayMIBGroup = hpnicfDHCPRelayMIBGroup.setStatus('current')
mibBuilder.exportSymbols("HPN-ICF-DHCPR-MIB", hpnicfDHCPRIPEntry=hpnicfDHCPRIPEntry, hpnicfDHCPRelayMibObject=hpnicfDHCPRelayMibObject, hpnicfDHCPRelayMIBGroup=hpnicfDHCPRelayMIBGroup, hpnicfDHCPRelayMIBConformance=hpnicfDHCPRelayMIBConformance, hpnicfDHCPRRxServerPktNum=hpnicfDHCPRRxServerPktNum, hpnicfDHCPRelayMIBCompliances=hpnicfDHCPRelayMIBCompliances, hpnicfDHCPRelayDiscoverPktNum=hpnicfDHCPRelayDiscoverPktNum, hpnicfDHCPRIPAddr=hpnicfDHCPRIPAddr, PYSNMP_MODULE_ID=hpnicfDHCPRelayMib, hpnicfDHCPRelayAckPktNum=hpnicfDHCPRelayAckPktNum, hpnicfDHCPRRxClientPktNum=hpnicfDHCPRRxClientPktNum, hpnicfDHCPRSeletAllocateModeEntry=hpnicfDHCPRSeletAllocateModeEntry, hpnicfDHCPRelayRequestPktNum=hpnicfDHCPRelayRequestPktNum, hpnicfDHCPRelayMIBGroups=hpnicfDHCPRelayMIBGroups, hpnicfDHCPRelayReleasePktNum=hpnicfDHCPRelayReleasePktNum, hpnicfDHCPRSelectAllocateMode=hpnicfDHCPRSelectAllocateMode, hpnicfDHCPRIPRowStatus=hpnicfDHCPRIPRowStatus, hpnicfDHCPRelayOfferPktNum=hpnicfDHCPRelayOfferPktNum, hpnicfDHCPRTxServerPktNum=hpnicfDHCPRTxServerPktNum, hpnicfDHCPRelayDeclinePktNum=hpnicfDHCPRelayDeclinePktNum, hpnicfDHCPRIPTable=hpnicfDHCPRIPTable, hpnicfDHCPRTxClientBroPktNum=hpnicfDHCPRTxClientBroPktNum, hpnicfDHCPRelayCycleStatus=hpnicfDHCPRelayCycleStatus, hpnicfDHCPRRxBadPktNum=hpnicfDHCPRRxBadPktNum, hpnicfDHCPRelayInformPktNum=hpnicfDHCPRelayInformPktNum, hpnicfDHCPRelayNakPktNum=hpnicfDHCPRelayNakPktNum, hpnicfDHCPRelayMib=hpnicfDHCPRelayMib, hpnicfDHCPRelayStatisticsReset=hpnicfDHCPRelayStatisticsReset, hpnicfDHCPRSeletAllocateModeTable=hpnicfDHCPRSeletAllocateModeTable, hpnicfDHCPRTxClientUniPktNum=hpnicfDHCPRTxClientUniPktNum, hpnicfDHCPRTxClientPktNum=hpnicfDHCPRTxClientPktNum)
|
def sort_contacts(contacts):
newcontacts=[]
keys = contacts.keys()
for key in sorted(keys):
data = (key, contacts[key][0], contacts[key][1])
newcontacts.append(data)
return newcontacts
contacts = input("Please input the contacts.")
print(sort_contacts(contacts))
|
color = input("Enter a color: ")
plural_noun = input("Enter a plural noun: ")
celebrity = input("Enter the name of a Celebrity: ")
print("Roses are " + color)
print(plural_noun + " are blue")
print("I love " + celebrity)
## Mad Lib 1
date = input("Enter a date: ")
full_name = input("Enter a full name: ")
a_place = input("Enter the name of a place: ")
class_noun = input("Enter a class subject: ")
signature = input("Enter a signature: ")
print("Date: " + date)
print(full_name + " is authorized"),
print("to be at " + a_place)
print("instead of " + class_noun),
print("class.")
print("SIGNED: " + signature)
## Mad Lib 2
noun = input("Enter a noun: ")
object = input("Enter an object: ")
food = input("Enter your least favorite food: ")
bad_things = input("Enter the funniest thing that comes to mind: ")
verb = input("Enter a verb: ")
print(" We Are The Champions")
print("I've taken my " + noun + " out.")
print("And my " + object + " calls")
print("You brought me " + food + " and " + bad_things + " and everything that comes with it")
print("I " + verb + " you all.")
## Mad Lib 3
adjective = input("Enter an adjective: ")
object = input("Enter an object: ")
imaginary_friend = input("Enter the name of an imaginary friend: ")
adjective = input("Enter another adjective: ")
verb = input("Enter a verb: ")
print(" Under The Bridge")
print("Sometimes I feel like " + adjective )
print("I don't have a " + object )
print("Sometimes I feel like my only friend is " + imaginary_friend )
print("The " + adjective + " city ")
print("Lonely as I am, together we " + verb )
## Mad Lib 4
adjective = input("Enter an adjective: ")
adjective = input("Enter another adjective: ")
noun = input("Enter a noun: ")
noun = input("Enter another noun: ")
plural_noun = input("Enter a plural noun: ")
game = input("Enter a game: ")
plural_noun = input("Enter another plural noun: ")
verb = input("Enter a verb ending in 'ing': ")
verb = input("Enter another verb ending in 'ing': ")
plural_noun = input("Enter another plural noun: ")
verb = input("Enter another verb ending in 'ing': ")
noun = input("Enter another noun: ")
plant = input("Enter a plant; ")
body_part = input("Enter a part of the body: ")
place = input("Enter a place: ")
verb = input("Enter another verb ending in 'ing': ")
adjective = input("Enter another adjective: ")
number = input("Enter a number <100: ")
plural_noun = input("Enter another plural noun: ")
print("A vacation is when you take a trip to some " + adjective + " place"),
print(" with you " + adjective + " family.")
print("Usually you go to some place thatis near a/an " + noun ),
print(" or up on a/an " + noun + ".")
print("A good vacation place is one where you can ride " + plural_noun ),
print(" or play " + game + " or go hunting for " + plural_noun + ".")
print("I like to spend my time " + verb + " or " + verb + ".")
print("When parents go on a vacation, they spend their time eating three " + plural_noun + " a day,")
print(" and fathers play golf, and mothers sit around " + verb + ".")
print("Last summer, my little brother fell in a/an " + noun + " and got poison " + plant ),
print(" all over his " + body_part + ".")
print("My family is going to go to (the) " + place + ", and I will practice " + verb + ".")
print("Parents need vacations more than kids because parents are always very " + adjective + " and because they have to work " + number + " hours every day all year making enough " + plural_noun + " to pay for the vacation.")
## Mad Lib 5
name = input("Enter your name: ")
date = input("Enter a date: ")
adjective = input("Enter an adjective: ")
noun = input("Enter a noun: ")
verb = input("Enter a verb in past tense: ")
adverb = input("Enter an adverb: ")
adjective = input("Enter another adjective: ")
noun = input("Enter another noun: ")
noun = input("Enter another noun: ")
adjective = input("Enter another adjective: ")
verb = input("Enter a verb: ")
adverb = input("Enter another adverb: ")
verb = input("Enter another verb in past tense: ")
adjective = input("Enter another adjective: ")
print("Name: " + name + " Date: " + date )
print("Today I went to the zoo. I saw a " + adjective + " " + noun + " jumping up and down in its tree.")
print("He " + verb + " " + adverb + " through the large tunnel that led to its " + adjective + " " + noun + ".")
print("I got some peanuts and passed them through the cage to a gigantic gray " + noun + " towering above my head.")
print("Feeding the animals made me hungry. I went to get a " + adjective + " scoop of ice cream. It filled my stomach.")
print("Afterwards I had to " + verb + " " + adverb + " to catch our bus.")
print("When I got home I " + verb + " my mom for a " + adjective + " day at the zoo.")
## Mad Lib 6
adjective = input("Enter an adjective: ")
adjective = input("Enter another adjective: ")
noun = input("Enter a noun: ")
verb = input("Enter a verb in singular present form: ")
fruit = input("Enter a fruit: ")
noun = input("Enter another noun: ")
fruit = input("Enter another fruit: ")
object = input("Enter an object: ")
animal = input("Enter an animal: ")
adjective = input("Enter another adjective: ")
plural_noun = input("Enter a plural noun: ")
print(" The Rose Family")
print("The rose is a " + adjective + ",")
print("And was always a " + adjective + ".")
print("But the " + noun + " now " + verb )
print("That the " + fruit + " is a " + noun + ",")
print("And the " + fruit + " is, and so is ")
print("The " + object + ", I suppose.")
print("The " + animal + " only knows")
print("What will next prove a rose " + adjective + ".")
print(plural_noun + " , of course, are a rose -")
print("But were always a rose.")
## Mad Lib 7
name = input("Enter a name: ")
date = input("Enter a date: ")
plural_noun = input("Enter a plural noun: ")
plural_noun = input("Enter another plural noun: ")
verb = input("Enter a verb: ")
celebrity = ("Enter the name of a celebrity: ")
noun = input("Enter a noun: ")
ing = input("Enter a verb ending in 'ing': ")
plural_noun = input("Enter another plural noun: ")
noun = input("Enter another noun: ")
plural_noun = input("Enter another plural noun: ")
print("Name: " + name)
print("Date: " + date)
print(" At The Arcade!")
print("When I go to the arcade with my " + plural_noun + " there are lots of games to play.")
print("I spend lots of time there with my friends. In 'Xmen' you can be different " + plural_noun + ".")
print("The point of the game is to " + verb + " every robot.")
print("You also need to save people, and then you can go to the next level. In 'Star Wars' you are " + celebrity + " and you try to destroy every " + noun + ".")
print("In a car racing / motorcycle racing game you need to beat every computerized vehicle that you are " + ing + " against.")
print("There are a whole lot of other cool games. When you play some games you win " + plural_noun + " for certain scores.")
print("Once you're done you can cash in your tickets to get a big " + noun + ".")
print("You can save your " + plural_noun + " for another time.")
print("When I went to this arcade I didn't believe how much fun it would be. You might annoy your parents by asking them over and over if you can go back to there. So far I have had a lot of fun every time I've been to this great arcade!")
## Mad Lib 8
name = input("Enter your name: ")
date = input("Enter a date: ")
last_name = input("Enter a last name: ")
noun = input("Enter a noun: ")
letter = input("Enter a letter: ")
noun = input("Enter a 3 letter noun: ")
letter = input("Enter another letter: ")
noun = input("Enter another 3 letter noun: ")
noun = input("Enter a noun: ")
plural_noun = input("Enter a plural noun: ")
letter = input("Enter another letter: ")
noun = input("Enter another 3 letter noun: ")
letter = input("Enter another letter: ")
noun = input("Enter another 3 letter noun: ")
sound = input("Enter a sound: ")
sound = input("Enter a sound: ")
sound = input("Enter a sound: ")
sound = input("Enter a sound: ")
sound = input("Enter a sound: ")
sound = input("Enter a sound: ")
letter = input("Enter another letter: ")
noun = input("Enter another 3 letter noun: ")
letter = input("Enter another letter: ")
noun = input("Enter another 3 letter noun: ")
print("Name: " + name )
print("Date: " + date )
print( "Big Mac Who?")
print("Big Mc " + last_name + " had a " + noun + ",")
print(letter + "- " + noun + ", " + letter + "- " + noun + " O.")
print("On this " + noun + " he had some " + plural_noun + ", " + letter + " -3 " + noun + ", " + letter + "- " + noun + " O.")
print("With a " + sound + ", " + sound + " here, and a " + sound + " " + sound + " there, everywhere a " + sound + "- " + sound + " " + letter + "- " + noun + ", " + letter + "- " + noun + " O.")
## Mad Lib 9
object = input("Enter an object: ")
adjective = input("Enter an adjective: ")
adjective = input("Enter another adjective: ")
place = input("Enter a place: ")
hobby = input("Enter a hobby: ")
president = input("Enter the name of a president: ")
food = input("Enter your fav food: ")
print("Send up a signal throw me a/an " + object )
print("It might not be " + adjective + " but it sure ain't " + adjective )
print("I'm one step from " + place + " and two steps behind")
print("I picked up " + hobby + " I called " + president + " who said " + food + " was the new national meal")
## Mad Lib 10
print(" Life In Technicolor")
adjective = input("Enter an adjective: ")
verb = input("Enter a verb in ing form: ")
thing = input("Enter an interesting happening: ")
celebrity = input("Enter a celebrity: ")
adjective = input("Enter an adjective: ")
print("There's a " + adjective + " wind blowing")
print("Every night there, the headlights are " + verb )
print("There's a " + thing + " coming")
print("On the radio I heard " + celebrity + " talking about their pet's addiction to snickers")
print("Baby, it's a " + adjective + " world")
|
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
{
'variables': {
'flapper_version_h_file%': 'flapper_version.h',
'flapper_binary_files%': [],
'conditions': [
[ 'branding == "Chrome"', {
'conditions': [
[ 'OS == "linux" and target_arch == "ia32"', {
'flapper_version_h_file%': 'symbols/ppapi/linux/flapper_version.h',
'flapper_binary_files%': [
'binaries/ppapi/linux/libpepflashplayer.so',
'binaries/ppapi/linux/manifest.json',
],
}],
[ 'OS == "linux" and target_arch == "x64"', {
'flapper_version_h_file%': 'symbols/ppapi/linux_x64/flapper_version.h',
'flapper_binary_files%': [
'binaries/ppapi/linux_x64/libpepflashplayer.so',
'binaries/ppapi/linux_x64/manifest.json',
],
}],
[ 'OS == "mac" and target_arch == "ia32"', {
'flapper_version_h_file%': 'symbols/ppapi/mac/flapper_version.h',
'flapper_binary_files%': [
'binaries/ppapi/mac/PepperFlashPlayer.plugin',
'binaries/ppapi/mac/manifest.json',
],
}],
[ 'OS == "mac" and target_arch == "x64"', {
'flapper_version_h_file%': 'symbols/ppapi/mac_64/flapper_version.h',
'flapper_binary_files%': [
'binaries/ppapi/mac_64/PepperFlashPlayer.plugin',
'binaries/ppapi/mac_64/manifest.json',
],
}],
[ 'OS == "win" and target_arch == "ia32"', {
'flapper_version_h_file%': 'symbols/ppapi/win/flapper_version.h',
'flapper_binary_files%': [
'binaries/ppapi/win/pepflashplayer.dll',
'binaries/ppapi/win/manifest.json',
],
}],
[ 'OS == "win" and target_arch == "x64"', {
'flapper_version_h_file%': 'symbols/ppapi/win_x64/flapper_version.h',
'flapper_binary_files%': [
'binaries/ppapi/win_x64/pepflashplayer.dll',
'binaries/ppapi/win_x64/manifest.json',
],
}],
],
}],
],
},
# Always provide a target, so we can put the logic about whether there's
# anything to be done in this file (instead of a higher-level .gyp file).
'targets': [
{
# GN version: //third_party/adobe/flash:flapper_version_h
'target_name': 'flapper_version_h',
'type': 'none',
'copies': [{
'destination': '<(SHARED_INTERMEDIATE_DIR)',
'files': [ '<(flapper_version_h_file)' ],
}],
},
{
# GN version: //third_party/adobe/flash:flapper_binaries
'target_name': 'flapper_binaries',
'type': 'none',
'copies': [{
'destination': '<(PRODUCT_DIR)/PepperFlash',
'files': [ '<@(flapper_binary_files)' ],
}],
},
],
}
|
# 204. Count Primes
# Runtime: 4512 ms, faster than 43.85% of Python3 online submissions for Count Primes.
# Memory Usage: 52.8 MB, less than 90.72% of Python3 online submissions for Count Primes.
class Solution:
# Sieve of Eratosthenes
def countPrimes(self, n: int) -> int:
if n <= 2:
return 0
is_prime = [True] * n
count = 0
for i in range(2, n):
if is_prime[i]:
count += 1
for j in range(i * i, n, i):
is_prime[j] = False
return count |
""" Asked by: Google [Hard].
Given a string, split it into as few strings as possible such that each string is a palindrome.
For example, given the input string racecarannakayak, return ["racecar", "anna", "kayak"].
Given the input string abc, return ["a", "b", "c"].
"""
|
def ErrorHandler(function):
def wrapper(*args, **kwargs):
try:
return function(*args, **kwargs)
except Exception as e: # pragma: no cover
pass
return wrapper
|
#
#
# Copyright 2016 Kirk A Jackson DBA bristoSOFT all rights reserved. All methods,
# techniques, algorithms are confidential trade secrets under Ohio and U.S.
# Federal law owned by bristoSOFT.
#
# Kirk A Jackson dba bristoSOFT
# 4100 Executive Park Drive
# Suite 11
# Cincinnati, OH 45241
# Phone (513) 401-9114
# email jacksonkirka@bristosoft.com
#
# The trade name bristoSOFT is a registered trade name with the State of Ohio
# document No. 201607803210.
#
'''
This control package includes all the modules needed for bristoSOFT Contacts.
'''
|
"""Top-level package for investment_tracker."""
__author__ = """Ranko Liang"""
__email__ = "rankoliang@gmail.com"
__version__ = "0.1.0"
|
class Metadata:
def __init__(self, network, code, position, name, source=None):
self.network = network
self.code = code
self.position = position
self.name = name
self.source = source
self.enabled = True
class Polarization:
def __init__(self):
self.azimuth = []
self.azimuth_error = []
self.time = []
def __str__(self):
return "Polarization object with azimuth = {:} +/- {:}".format(self.azimuth, self.azimuth_error)
class AnnotationList:
def __init__(self):
self.annotation_list = []
def __str__(self):
A = ""
if len(self.annotation_list) > 0:
for item in self.annotation_list:
A += "{:}\n".format(item.title)
else:
A = "No annotations"
return A
def add(self, an):
self.annotation_list.append(an)
def overwrite(self, an):
new_list = []
for annote in self.annotation_list:
if annote.title != an.title:
new_list.append(annote)
new_list.append(an)
self.annotation_list = new_list
def remove(self, an):
new_list = []
for annote in self.annotation_list:
if annote.title != an.title:
new_list.append(annote)
self.annotation_list = new_list
class Station:
"""
A station object containing information and position of the station
"""
def __init__(self, metadata, stream, edits=None, response=None):
"""
Arguments:
network: [String] the network of the station
code: [String] the code of the station
position: [position Obj] a position object of the station containing the lat/lon/elev of the station
channel: [String] the channel of the station (BHZ, HHZ, BDF, etc.)
name: [String] A string describing the station's name or location (for display purposes only)
file_name: [String] Location of the .mseed file inside the working directory
"""
self.metadata = metadata
self.stream = stream
self.edits = edits
self.response = response
self.polarization = Polarization()
self.annotation = AnnotationList()
self.bandpass = None
def __str__(self):
A = "Station: {:}\n".format(self.metadata.name)
B = str(self.metadata.position) + "\n"
try:
C = "Ground Distance: {:} \n".format(self.ground_distance)
except:
C = ''
if self.response is not None:
D = "Response Attatched"
else:
D = "No Response Found"
return A + B + C + D
def hasResponse(self):
if not hasattr(self, "response"):
return False
if self.response is None:
return False
return True
def hasSeismic(self):
st = self.stream
a = st.select(component="Z")
if len(a) > 0:
return True
else:
return False
def hasInfrasound(self):
st = self.stream
a = st.select(component="F")
if len(a) > 0:
return True
else:
return False
def stn_distance(self, ref_pos):
self.distance = self.metadata.position.pos_distance(ref_pos)
return self.distance
def stn_ground_distance(self, ref_pos):
self.ground_distance = self.metadata.position.ground_distance(ref_pos) |
class CommandNotFound(Exception):
def __init__(self, command_name):
self.name = command_name
def __str__(self):
return f"Command with name {self.name} not found"
|
def _merge(left, right, cmp):
res = []
leftI , rightI = 0, 0
while leftI<len(left) and rightI<len(right):
if cmp(left[leftI], right[rightI])<=0:
res.append(left[leftI])
leftI += 1
else:
res.append(right[rightI])
rightI += 1
while leftI<len(left):
res.append(left[leftI])
leftI += 1
while rightI<len(right):
res.append(right[rightI])
rightI += 1
return res
def _merge2(left, right, cmp):
result = []
while len(left)>0 or len(right)>0:
if cmp(left[0],right[0])<=0:
result.append(left.pop(0))
else:
result.append(right.pop(0))
while len(left)>0:
result.append(left.pop(0))
while len(right)>0:
result.append(right.pop(0))
return result
def mergeSort(items, cmp = None):
cmp = cmp if cmp != None else (lambda a,b: a-b)
n = len(items)
if n<=1: return items
left = mergeSort(items[:int(n/2)],cmp)
right = mergeSort(items[int(n/2):],cmp)
res = _merge(left, right, cmp)
return res
if __name__ == "__main__":
pass
|
tokentype = {
'INT': 'INT',
'FLOAT': 'FLOAT',
'STRING': 'STRING',
'CHAR': 'CHAR',
'+': 'PLUS',
'-': 'MINUS',
'*': 'MUL',
'/': 'DIV',
'=': 'ASSIGN',
'%': 'MODULO',
':': 'COLON',
';': 'SEMICOLON',
'<': 'LT',
'>': 'GT',
'[': 'O_BRACKET',
']': 'C_BRACKET',
'(': 'O_PAREN',
')': 'C_PAREN',
'{': 'O_BRACE',
'}': 'C_BRACE',
'&': 'AND',
'|': 'OR',
'!': 'NOT',
'^': 'EXPO',
'ID': 'ID',
'EOF': 'EOF'
}
class Token:
def __init__(self, type, value):
self.type = type
self.value = value
def __str__(self):
return f'<{self.type}: {self.value}>'
__repr__ = __str__
|
'''
Given an array of integers, find if the array contains any duplicates. Your function should return true if any value appears at least twice in the array, and it should return false if every element is distinct.
'''
class Solution:
def containsDuplicate(self, nums):
"""
:type nums: List[int]
:rtype: bool
"""
'''
if(len(nums)==0 or len(nums)==1):
return(False)
new_nums=sorted(nums)
for i in range(1,len(nums)):
if(new_nums[i] == new_nums[i-1]):
return(True)
return(False)
'''
new_list=list(set(nums))
if(len(new_list)==len(nums)):
return(False)
else:
return(True) |
# Takes the following input :- number of items, a weights array, a value array, and the capacity of knap_sack
def knap_sack(n, w, v, c):
if n == 0 or w == 0:
return 0
if w[n - 1] > c:
return knap_sack(n - 1, w, v, c)
else:
return max(v[n - 1] + knap_sack(n - 1, w, v, c - w[n - 1]), knap_sack(n - 1, w, v, c))
val = [60, 100, 120]
wt = [10, 20, 30]
W = 50
n = len(val)
print(knap_sack(n, wt, val, W))
|
def maxXorSum(n, k):
if k == 1:
return n
res = 1
l = [1]
while res <= n:
res <<= 1
l.append(res)
print(l)
# return res - 1
n, k = map(int, input().split())
maxXorSum(n, k)
|
# 두 정수의 덧셈 (64비트)
# minso.jeong@daum.net
'''
문제링크 : https://www.codeup.kr/problem.php?id=1115
'''
a, b = list(map(int, input().split()))
print(a + b) |
#Gasolina
t=float(input())
v=float(input())
l=(t*v) /12
print("{:.3f}".format(l) )
|
# Code Listing #5
"""
Borg - Pattern which allows class instances to share state without the strict requirement
of Singletons
"""
class Borg(object):
""" I ain't a Singleton """
__shared_state = {}
def __init__(self):
print("self: ", self)
self.__dict__ = self.__shared_state
class IBorg(Borg):
""" I am a Borg """
def __init__(self):
self.state = 'init'
Borg.__init__(self)
# print("Hello1")
# def __str__(self):
# # print("Hello2")
# return self.state
# class ABorg(Borg): pass
# class BBorg(Borg): pass
# class A1Borg(ABorg): pass
if __name__ == "__main__":
# a = ABorg()
# a1 = A1Borg()
# b = BBorg()
# a.x = 100
# print('a.x =>',a.x)
# print('a1.x =>',a1.x)
# print('b.x =>',b.x)
x = IBorg()
y = IBorg()
# x.state = "running"
print(x.__dict__, y, x == y, x is y)
|
# Copyright 2021 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
register_npcx_project(
project_name="volteer",
zephyr_board="volteer",
dts_overlays=[
"bb_retimer.dts",
"cbi_eeprom.dts",
"fan.dts",
"gpio.dts",
"keyboard.dts",
"motionsense.dts",
"pwm.dts",
"pwm_leds.dts",
"usbc.dts",
],
)
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.