content
stringlengths 7
1.05M
|
---|
arr1 = [-12, 11, -13, -5, 6, -7, 5, -3, -6]
arr2 = [1, 2, -4, -5, 2, -7, 3, 2, -6, -8, -9, 3, 2, 1]
def moveNegativeInt(arr):
for i in arr:
if i < 0:
temp = i
arr.remove(i)
arr.insert(0, temp)
return arr
print(moveNegativeInt(arr1))
print(moveNegativeInt(arr2))
|
el_mundo_es_plano = True
if el_mundo_es_plano:
print ("Tené cuidado de no caerte")
# este es el primer comentario
spam = 1 # y este es el segundo comentario
# ... y ahora un tercero!
text = "# Este no es un comentario, es un String"
print (spam)
print (text)
print ("Como calculadora")
print ("Sumar")
valor1 = 6
valor2 = 3
print (valor1)
print ("+")
print (valor2)
suma = valor1 + valor2
print ("Igual")
print (suma)
print ("Por 2")
multiplicacion = suma * 2
print (multiplicacion)
resta = (multiplicacion - 5)
print ("menos 5")
print (resta)
division = round((resta / 3) ,2)
print ("entre 3")
print (division)
print ("***** Metodos para String")
nombre = 'alex'
print (nombre)
ininombre = (nombre[0])
print (ininombre)
print (nombre.upper())
print (nombre.lower())
print (nombre.title())
# Captura de datos con If
# x = input('Ingresa un entero, por favor: ')
x = 15
if x < 0:
x = 0
print ('Negativo cambiado a cero')
elif x == 0:
print ("Cero")
elif x == 1:
print ("Simple")
else:
print ("Mas")
# sentencia For, contando cadenas de texto
print ("***** Almacena cadenas")
palabras = ["Gato","Ventana","Murcielago"]
for p in palabras:
print (p,len(p))
nombres = [
"Pablo",
"Juan",
"Luis",
"Bruno",
"Maria"
]
print(nombres[4]) # Maria
print ("***** Agregar elementos a list")
libro = []
libro.append("Programacion")
libro.append("Computacion")
print(libro[0]) # Programacion
print(libro[1]) # Computacion
# loop e iteracion
print ("***** Loop e Iteracion")
num = 1
while num <= 10:
print(num)
num += 1
print ("***** Estructura de datos Clave, Valor")
Diccionario = {
"key1": "value1",
"key2": "value2",
"key3": "value3"
}
diccionario = {
"nombre": "Pablo",
"apodo": "Paul",
"nacionalidad": "Mexicana"
}
print("Mi nombre es %s" %(diccionario["nombre"])) # Mi nombre es Pedro
print("Pero puedes llamarme %s" %(diccionario["apodo"])) # Pero puedes llamarme Paul
print("Mi nacionalidad es %s" %(diccionario["nacionalidad"])) # Mi nacionalidad es Mexicana
print ("***** Class")
class vehiculo:
def __init__(self, numero_de_ruedas, tipo_de_tanque, numero_de_asientos, velocidad_maxima):
self.numero_de_ruedas = numero_de_ruedas
self.tipo_de_tanque = tipo_de_tanque
self.numero_de_asientos = numero_de_asientos
self.velocidad_maxima = velocidad_maxima
#Adicionar datos a la clase
tesla_model_s = vehiculo(4, 'Electrico', 5, 250)
print ("Numero de ruedas: %s" % (tesla_model_s.numero_de_ruedas))
print ("Tipo de tanque: %s" % (tesla_model_s.tipo_de_tanque))
print ("Numero de asientos: %s" % (tesla_model_s.numero_de_asientos))
print ("Velocidad maxima (k/h): %s" % (tesla_model_s.velocidad_maxima))
|
s = input()
l = len(s)
r = 'AWH'
# just repeat Os bc valid, ignore other rules
print(r + 'O' * l)
|
# By manish.17, contest: ITMO Academy. Двоичный поиск - 2, problem: (G) Student Councils
# https://codeforces.com/profile/manish.17
k = int(input())
n = int(input())
a = []
for i in range(n):
a += [int(input())]
alpha, omega = 1, 10**18
while alpha < omega:
mid = (alpha + omega + 1) // 2
total = k*mid
for i in range(n):
total -= min(mid, a[i], total)
if total == 0:
alpha = mid
else:
omega = mid - 1
print(omega)
|
WOQL_CONCAT_JSON = {
"@type": "Concatenate",
"list": {"@type" : "DataValue",
"list" : [
{"@type": "DataValue", "variable": "Duration"},
{
"@type": "DataValue",
"data": {"@type": "xsd:string", "@value": " yo "},
},
{"@type": "DataValue", "variable": "Duration_Cast"},
]},
"result": {"@type": "DataValue", "variable": "x"},
}
|
class GeneralizationSet:
name = ""
id = ""
attributes = []
def __init__(self, name, gs_id, attributes):
self.name = name
self.id = gs_id
self.attributes = attributes
def __str__(self):
return f'id:{self.id} name: {self.name} attributes: {self.attributes}'
|
"""igcommit - The main module
Copyright (c) 2021 InnoGames GmbH
Portions Copyright (c) 2021 Emre Hasegeli
"""
VERSION = (3, 1)
|
#
# @lc app=leetcode id=32 lang=python3
#
# [32] Longest Valid Parentheses
#
# @lc code=start
class Solution:
def longestValidParentheses(self, s: str) -> int:
max_length = 0
left_count = right_count = 0
for i in range(len(s)): # left to right scan
if s[i] == '(':
left_count += 1
elif s[i] == ')':
right_count += 1
if left_count == right_count:
max_length = max(max_length, right_count * 2)
elif left_count < right_count:
left_count = right_count = 0
left_count = right_count = 0
for i in range(len(s))[::-1]: # right to left scan
if s[i] == '(':
left_count += 1
elif s[i] == ')':
right_count += 1
if left_count == right_count:
max_length = max(max_length, left_count * 2)
elif left_count > right_count:
left_count = right_count = 0
return max_length
# @lc code=end
# Accepted
# 230/230 cases passed(48 ms)
# Your runtime beats 90.94 % of python3 submissions
# Your memory usage beats 44.44 % of python3 submissions(13.8 MB)
|
# Definition for a binary tree node.
# class TreeNode:
# def __init__(self, val=0, left=None, right=None):
# self.val = val
# self.left = left
# self.right = right
class Solution:
def sumNumbers(self, root: TreeNode) -> int:
if root == None:
return 0
else:
return sum([ int(i) for i in self.travelTree(root) ])
def travelTree(self, root):
if root.left == None and root.right == None:
return [ str(root.val) ]
else:
if root.right == None:
numList = self.travelTree( root.left )
elif root.left == None:
numList = self.travelTree( root.right )
else:
lNumList = self.travelTree( root.left )
rNumList = self.travelTree( root.right )
numList = lNumList + rNumList
outList = []
for num in numList:
newNum = str(root.val) + num
outList.append( newNum )
return outList
|
###########################################################################
#
# Copyright 2017 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
###########################################################################
DCM_Field_Lookup = {
"Video_Unmutes":"INTEGER",
"Zip_Postal_Code":"INTEGER",
"Path_Length":"INTEGER",
"Billable_Impressions":"FLOAT",
"Active_View_Of_Completed_Impressions_Audible_And_Visible":"FLOAT",
"Measurable_Impressions_For_Audio":"INTEGER",
"Average_Interaction_Time":"FLOAT",
"Invalid_Impressions":"FLOAT",
"Floodlight_Variable_40":"STRING",
"Floodlight_Variable_41":"STRING",
"Floodlight_Variable_42":"STRING",
"Floodlight_Variable_43":"STRING",
"Floodlight_Variable_44":"STRING",
"Floodlight_Variable_45":"STRING",
"Floodlight_Variable_46":"STRING",
"Floodlight_Variable_47":"STRING",
"Floodlight_Variable_48":"STRING",
"Floodlight_Variable_49":"STRING",
"Clicks":"INTEGER",
"Active_View_In_Background":"FLOAT",
"Active_View_Of_First_Quartile_Impressions_Audible_And_Visible":"FLOAT",
"Paid_Search_Advertiser_Id":"INTEGER",
"Video_Third_Quartile_Completions":"INTEGER",
"Video_Progress_Events":"INTEGER",
"Cost_Per_Revenue":"FLOAT",
"Total_Interaction_Time":"INTEGER",
"Roadblock_Impressions":"INTEGER",
"Active_View_Of_Completed_Impressions_Visible":"FLOAT",
"Video_Replays":"INTEGER",
"Keyword":"STRING",
"Full_Screen_Video_Plays":"INTEGER",
"Active_View_Impression_Distribution_Not_Measurable":"FLOAT",
"Unique_Reach_Total_Reach":"INTEGER",
"Has_Exits":"BOOLEAN",
"Paid_Search_Engine_Account":"STRING",
"Operating_System_Version":"STRING",
"Campaign":"STRING",
"Active_View_Not_Viewable_Impressions":"INTEGER",
"Twitter_Offers_Accepted":"INTEGER",
"Interaction_Type":"STRING",
"Activity_Delivery_Status":"FLOAT",
"Video_Companion_Clicks":"INTEGER",
"Floodlight_Paid_Search_Average_Cost_Per_Transaction":"FLOAT",
"Paid_Search_Agency_Id":"INTEGER",
"Asset":"STRING",
"Active_View_Audible_Amp_Fully_On_Screen_For_Half_Of_Duration_15_Sec_Cap_Impressions":"INTEGER",
"User_List_Current_Size":"STRING",
"Exit_Url":"STRING",
"Natural_Search_Revenue":"FLOAT",
"Retweets":"INTEGER",
"Full_Screen_Impressions":"INTEGER",
"Audio_Unmutes":"INTEGER",
"Dynamic_Element_4_Field_Value_2":"STRING",
"Dynamic_Element_4_Field_Value_3":"STRING",
"Dynamic_Element_4_Field_Value_1":"STRING",
"Creative_Start_Date":"STRING",
"Small_Video_Player_Size_Impressions":"INTEGER",
"Audio_Replays":"INTEGER",
"Video_Player_Size_Avg_Width":"INTEGER",
"Rich_Media_Standard_Event_Count":"INTEGER",
"Publisher_Problems":"INTEGER",
"Paid_Search_Advertiser":"STRING",
"Has_Video_Completions":"BOOLEAN",
"Cookie_Reach_Duplicate_Impression_Reach":"FLOAT",
"Audio_Third_Quartile_Completions":"INTEGER",
"Package_Roadblock_Strategy":"STRING",
"Video_Midpoints":"INTEGER",
"Click_Through_Conversion_Events_Cross_Environment":"INTEGER",
"Video_Pauses":"INTEGER",
"Trueview_Views":"INTEGER",
"Interaction_Count_Mobile_Static_Image":"INTEGER",
"Dynamic_Element_Click_Rate":"FLOAT",
"Active_View_Play_Time_Visible":"FLOAT",
"Dynamic_Element_1_Field_6_Value":"STRING",
"Dynamic_Element_4_Value":"STRING",
"Creative_End_Date":"STRING",
"Dynamic_Element_4_Field_3_Value":"STRING",
"Dynamic_Field_Value_3":"STRING",
"Mobile_Carrier":"STRING",
"Warnings":"INTEGER",
"U_Value":"STRING",
"Average_Display_Time":"FLOAT",
"Custom_Variable":"STRING",
"Video_Interactions":"INTEGER",
"Average_Expansion_Time":"FLOAT",
"Email_Shares":"INTEGER",
"Flight_Booked_Rate":"STRING",
"Impression_Count":"INTEGER",
"Site_Id_Dcm":"INTEGER",
"Dynamic_Element_3_Value_Id":"STRING",
"Paid_Search_Legacy_Keyword_Id":"INTEGER",
"View_Through_Conversion_Events_Cross_Environment":"INTEGER",
"Active_View_Visible_At_Midpoint":"FLOAT",
"Counters":"INTEGER",
"Floodlight_Paid_Search_Average_Cost_Per_Action":"FLOAT",
"Activity_Group_Id":"INTEGER",
"Active_View_Of_First_Quartile_Impressions_Visible":"FLOAT",
"Click_Count":"INTEGER",
"Video_4A_39_S_Ad_Id":"STRING",
"Total_Interactions":"INTEGER",
"Active_View_Viewable_Impressions":"INTEGER",
"Natural_Search_Engine_Property":"STRING",
"Video_Views":"INTEGER",
"Active_View_Of_Third_Quartile_Impressions_Visible":"FLOAT",
"Domain":"STRING",
"Total_Conversion_Events_Cross_Environment":"INTEGER",
"Dbm_Advertiser":"STRING",
"Companion_Impressions":"INTEGER",
"View_Through_Conversions_Cross_Environment":"INTEGER",
"Dynamic_Element_5_Field_Value_3":"STRING",
"Dynamic_Element_5_Field_Value_2":"STRING",
"Dynamic_Element_5_Field_Value_1":"STRING",
"Active_View_Visible_10_Seconds":"FLOAT",
"Active_View_Impression_Distribution_Viewable":"FLOAT",
"Creative_Field_2":"STRING",
"Twitter_Leads_Generated":"INTEGER",
"Paid_Search_External_Campaign_Id":"INTEGER",
"Creative_Field_8":"STRING",
"Interaction_Count_Paid_Search":"INTEGER",
"Activity_Group":"STRING",
"Video_Player_Location_Avg_Pixels_From_Top":"INTEGER",
"Interaction_Number":"INTEGER",
"Dynamic_Element_3_Value":"STRING",
"Cookie_Reach_Total_Reach":"INTEGER",
"Cookie_Reach_Exclusive_Click_Reach":"FLOAT",
"Creative_Field_5":"STRING",
"Cookie_Reach_Overlap_Impression_Reach":"FLOAT",
"Paid_Search_Ad_Group":"STRING",
"Interaction_Count_Rich_Media":"INTEGER",
"Dynamic_Element_Total_Conversions":"INTEGER",
"Transaction_Count":"INTEGER",
"Num_Value":"STRING",
"Cookie_Reach_Overlap_Total_Reach":"FLOAT",
"Floodlight_Attribution_Type":"STRING",
"Html5_Impressions":"INTEGER",
"Served_Pixel_Density":"STRING",
"Has_Full_Screen_Video_Plays":"BOOLEAN",
"Interaction_Count_Static_Image":"INTEGER",
"Has_Video_Companion_Clicks":"BOOLEAN",
"Paid_Search_Ad":"STRING",
"Paid_Search_Visits":"INTEGER",
"Audio_Pauses":"INTEGER",
"Creative_Pixel_Size":"STRING",
"Flight_Start_Date":"STRING",
"Natural_Search_Transactions":"FLOAT",
"Cookie_Reach_Impression_Reach":"INTEGER",
"Dynamic_Field_Value_4":"STRING",
"Twitter_Line_Item_Id":"INTEGER",
"Has_Video_Stops":"BOOLEAN",
"Paid_Search_Labels":"STRING",
"Twitter_Creative_Type":"STRING",
"Operating_System":"STRING",
"Dynamic_Element_3_Field_4_Value":"STRING",
"Hours_Since_First_Interaction":"INTEGER",
"Asset_Category":"STRING",
"Active_View_Measurable_Impressions":"FLOAT",
"Package_Roadblock":"STRING",
"Large_Video_Player_Size_Impressions":"INTEGER",
"Paid_Search_Actions":"FLOAT",
"Has_Full_Screen_Views":"BOOLEAN",
"Backup_Image":"INTEGER",
"Likes":"INTEGER",
"Serving_Problems":"INTEGER",
"Audio_Midpoints":"INTEGER",
"Flight_Booked_Cost":"STRING",
"Other_Twitter_Engagements":"INTEGER",
"Audio_Completions":"INTEGER",
"Click_Rate":"FLOAT",
"Cost_Per_Activity":"FLOAT",
"Dynamic_Element_2_Value":"STRING",
"Cookie_Reach_Exclusive_Impression_Reach":"FLOAT",
"Content_Category":"STRING",
"Total_Revenue_Cross_Environment":"FLOAT",
"Unique_Reach_Click_Reach":"INTEGER",
"Has_Video_Replays":"BOOLEAN",
"Twitter_Creative_Id":"INTEGER",
"Has_Counters":"BOOLEAN",
"Dynamic_Element_4_Value_Id":"STRING",
"Twitter_Video_50_In_View_For_2_Seconds":"INTEGER",
"Dynamic_Element_4_Field_1_Value":"STRING",
"Has_Video_Interactions":"BOOLEAN",
"Video_Player_Size":"STRING",
"Active_View_Audible_Amp_Fully_On_Screen_For_Half_Of_Duration_Trueview_Impressions":"INTEGER",
"Advertiser_Id":"INTEGER",
"Rich_Media_Clicks":"INTEGER",
"Floodlight_Variable_59":"STRING",
"Floodlight_Variable_58":"STRING",
"Floodlight_Variable_57":"STRING",
"Floodlight_Variable_56":"STRING",
"Floodlight_Variable_55":"STRING",
"Floodlight_Variable_54":"STRING",
"Floodlight_Variable_53":"STRING",
"Floodlight_Variable_52":"STRING",
"Floodlight_Variable_51":"STRING",
"Floodlight_Variable_50":"STRING",
"Cookie_Reach_Incremental_Total_Reach":"INTEGER",
"Playback_Method":"STRING",
"Has_Interactive_Impressions":"BOOLEAN",
"Paid_Search_Average_Position":"FLOAT",
"Floodlight_Variable_96":"STRING",
"Package_Roadblock_Id":"INTEGER",
"Recalculated_Attribution_Type":"STRING",
"Dbm_Advertiser_Id":"INTEGER",
"Floodlight_Variable_100":"STRING",
"Active_View_Impression_Distribution_Not_Viewable":"FLOAT",
"Floodlight_Variable_3":"STRING",
"Floodlight_Variable_2":"STRING",
"Floodlight_Variable_1":"STRING",
"Floodlight_Variable_7":"STRING",
"Floodlight_Variable_6":"STRING",
"Floodlight_Variable_5":"STRING",
"Floodlight_Variable_4":"STRING",
"Rendering_Id":"INTEGER",
"Floodlight_Variable_9":"STRING",
"Floodlight_Variable_8":"STRING",
"Cookie_Reach_Incremental_Impression_Reach":"INTEGER",
"Active_View_Play_Time_Audible_And_Visible":"FLOAT",
"Reporting_Problems":"INTEGER",
"Package_Roadblock_Total_Booked_Units":"STRING",
"Has_Video_Midpoints":"BOOLEAN",
"Dynamic_Element_4_Field_4_Value":"STRING",
"Percentage_Of_Measurable_Impressions_For_Video_Player_Location":"FLOAT",
"Campaign_End_Date":"STRING",
"Placement_External_Id":"STRING",
"Cost_Per_Click":"FLOAT",
"Hour":"STRING",
"Click_Through_Revenue":"FLOAT",
"Video_Skips":"INTEGER",
"Active_View_Of_Third_Quartile_Impressions_Audible_And_Visible":"FLOAT",
"Paid_Search_Click_Rate":"FLOAT",
"Has_Video_Views":"BOOLEAN",
"Dbm_Cost_Account_Currency":"FLOAT",
"Flight_End_Date":"STRING",
"Has_Video_Plays":"BOOLEAN",
"Paid_Search_Clicks":"INTEGER",
"Creative_Field_9":"STRING",
"Manual_Closes":"INTEGER",
"Creative_Field_7":"STRING",
"Creative_Field_6":"STRING",
"App":"STRING",
"Creative_Field_4":"STRING",
"Creative_Field_3":"STRING",
"Campaign_Start_Date":"STRING",
"Creative_Field_1":"STRING",
"Content_Classifier":"STRING",
"Cookie_Reach_Duplicate_Click_Reach":"FLOAT",
"Site_Dcm":"STRING",
"Digital_Content_Label":"STRING",
"Has_Manual_Closes":"BOOLEAN",
"Has_Timers":"BOOLEAN",
"Active_View_Audible_Impressions":"FLOAT",
"Impressions":"INTEGER",
"Classified_Impressions":"INTEGER",
"Dbm_Site_Id":"INTEGER",
"Dynamic_Element_2_Field_1_Value":"STRING",
"Floodlight_Variable_72":"STRING",
"Creative":"STRING",
"Asset_Orientation":"STRING",
"Custom_Variable_Count_1":"INTEGER",
"Revenue_Adv_Currency":"FLOAT",
"Video_Stops":"INTEGER",
"Paid_Search_Ad_Id":"INTEGER",
"Dbm_Line_Item":"STRING",
"Click_Delivery_Status":"FLOAT",
"Dynamic_Element_Impressions":"INTEGER",
"Interaction_Count_Click_Tracker":"INTEGER",
"Active_View_Audible_And_Visible_At_Midpoint":"FLOAT",
"Placement_Total_Booked_Units":"STRING",
"Date":"STRING",
"Twitter_Placement_Type":"STRING",
"Total_Revenue":"FLOAT",
"Recalculated_Attributed_Interaction":"STRING",
"Ad_Type":"STRING",
"Social_Engagement_Rate":"FLOAT",
"Dynamic_Element_5_Field_1_Value":"STRING",
"Dynamic_Profile_Id":"INTEGER",
"Active_View_Impressions_Visible_10_Seconds":"INTEGER",
"Interaction_Count_Video":"INTEGER",
"Dynamic_Element_5_Value":"STRING",
"Active_View_Visible_At_Completion":"FLOAT",
"Video_Player_Size_Avg_Height":"INTEGER",
"Creative_Type":"STRING",
"Campaign_External_Id":"STRING",
"Dynamic_Element_Click_Through_Conversions":"INTEGER",
"Conversion_Url":"STRING",
"Floodlight_Variable_89":"STRING",
"Floodlight_Variable_84":"STRING",
"Floodlight_Variable_85":"STRING",
"Floodlight_Variable_86":"STRING",
"Floodlight_Variable_87":"STRING",
"Floodlight_Variable_80":"STRING",
"Floodlight_Variable_81":"STRING",
"Floodlight_Variable_82":"STRING",
"Floodlight_Variable_83":"STRING",
"Active_View_Audible_Amp_Fully_On_Screen_For_Half_Of_Duration_Trueview_Measurable_Impressions":"INTEGER",
"Floodlight_Variable_66":"STRING",
"Floodlight_Variable_67":"STRING",
"Floodlight_Variable_64":"STRING",
"Floodlight_Variable_65":"STRING",
"Floodlight_Variable_62":"STRING",
"Floodlight_Variable_63":"STRING",
"Floodlight_Variable_60":"STRING",
"Active_View_Eligible_Impressions":"INTEGER",
"Dynamic_Element_3_Field_Value_1":"STRING",
"Dynamic_Element_3_Field_Value_3":"STRING",
"Dynamic_Element_3_Field_Value_2":"STRING",
"Active_View_Of_Midpoint_Impressions_Visible":"FLOAT",
"Floodlight_Variable_68":"STRING",
"Floodlight_Variable_69":"STRING",
"Floodlight_Variable_13":"STRING",
"Floodlight_Variable_12":"STRING",
"Floodlight_Variable_11":"STRING",
"Floodlight_Variable_10":"STRING",
"Floodlight_Variable_17":"STRING",
"Floodlight_Variable_16":"STRING",
"Floodlight_Variable_15":"STRING",
"Floodlight_Variable_14":"STRING",
"Floodlight_Variable_19":"STRING",
"Floodlight_Variable_18":"STRING",
"Audience_Targeted":"STRING",
"Total_Conversions_Cross_Environment":"INTEGER",
"Twitter_Url_Clicks":"INTEGER",
"Dynamic_Element_1_Field_1_Value":"STRING",
"Active_View_Audible_Amp_Fully_On_Screen_For_Half_Of_Duration_Trueview_Rate":"FLOAT",
"Active_View_Audible_And_Visible_At_First_Quartile":"FLOAT",
"Has_Video_Skips":"BOOLEAN",
"Dynamic_Element_5_Field_2_Value":"STRING",
"Twitter_Buy_Now_Clicks":"INTEGER",
"Creative_Groups_2":"STRING",
"Creative_Groups_1":"STRING",
"Campaign_Id":"INTEGER",
"Twitter_Campaign_Id":"INTEGER",
"Active_View_Audible_Amp_Fully_On_Screen_For_Half_Of_Duration_15_Sec_Cap_Rate":"FLOAT",
"Dynamic_Element_1_Field_5_Value":"STRING",
"Paid_Search_Match_Type":"STRING",
"Activity_Per_Thousand_Impressions":"FLOAT",
"Has_Expansions":"BOOLEAN",
"Dbm_Creative_Id":"INTEGER",
"Booked_Viewable_Impressions":"FLOAT",
"Dynamic_Element_1_Field_2_Value":"STRING",
"Paid_Search_Cost":"FLOAT",
"Dynamic_Element_5_Field_5_Value":"STRING",
"Floodlight_Paid_Search_Spend_Per_Transaction_Revenue":"FLOAT",
"Dynamic_Element_4":"STRING",
"Dynamic_Element_5":"STRING",
"Dynamic_Element_2":"STRING",
"Click_Through_Conversions":"FLOAT",
"Dynamic_Element_1":"STRING",
"Dynamic_Element_4_Field_6_Value":"STRING",
"Attributed_Event_Platform_Type":"STRING",
"Attributed_Event_Connection_Type":"STRING",
"Dynamic_Element_1_Value":"STRING",
"Measurable_Impressions_For_Video_Player_Location":"INTEGER",
"Audio_Companion_Impressions":"INTEGER",
"Video_Full_Screen":"INTEGER",
"Companion_Creative":"STRING",
"Cookie_Reach_Exclusive_Total_Reach":"FLOAT",
"Audio_Mutes":"INTEGER",
"Placement_Rate":"STRING",
"Companion_Clicks":"INTEGER",
"Cookie_Reach_Overlap_Click_Reach":"FLOAT",
"Site_Keyname":"STRING",
"Placement_Cost_Structure":"STRING",
"Percentage_Of_Measurable_Impressions_For_Audio":"FLOAT",
"Rich_Media_Custom_Event_Count":"INTEGER",
"Dbm_Cost_Usd":"FLOAT",
"Dynamic_Element_1_Field_3_Value":"STRING",
"Paid_Search_Landing_Page_Url":"STRING",
"Verifiable_Impressions":"INTEGER",
"Average_Time":"FLOAT",
"Creative_Field_12":"STRING",
"Creative_Field_11":"STRING",
"Creative_Field_10":"STRING",
"Channel_Mix":"STRING",
"Paid_Search_Campaign":"STRING",
"Active_View_Audible_And_Visible_At_Start":"FLOAT",
"Natural_Search_Landing_Page":"STRING",
"Dynamic_Element_1_Field_4_Value":"STRING",
"Payment_Source":"STRING",
"Planned_Media_Cost":"FLOAT",
"Conversion_Referrer":"STRING",
"Companion_Creative_Id":"INTEGER",
"Dynamic_Element_4_Field_2_Value":"STRING",
"Total_Conversions":"FLOAT",
"Custom_Variable_Count_2":"INTEGER",
"Paid_Search_External_Ad_Group_Id":"INTEGER",
"Hd_Video_Player_Size_Impressions":"INTEGER",
"Click_Through_Transaction_Count":"FLOAT",
"Floodlight_Attributed_Interaction":"STRING",
"Dynamic_Profile":"STRING",
"Floodlight_Variable_28":"STRING",
"Floodlight_Variable_29":"STRING",
"Dynamic_Element_2_Field_2_Value":"STRING",
"Floodlight_Variable_22":"STRING",
"Floodlight_Variable_23":"STRING",
"Floodlight_Variable_20":"STRING",
"Floodlight_Variable_21":"STRING",
"Floodlight_Variable_26":"STRING",
"Floodlight_Variable_27":"STRING",
"Floodlight_Variable_24":"STRING",
"Floodlight_Variable_25":"STRING",
"Dynamic_Element_4_Field_5_Value":"STRING",
"Creative_Id":"STRING",
"View_Through_Conversions":"FLOAT",
"Active_View_Full_Screen":"FLOAT",
"Activity_Per_Click":"FLOAT",
"Floodlight_Variable_88":"STRING",
"Active_View_Audible_And_Visible_At_Third_Quartile":"FLOAT",
"Placement":"STRING",
"Dynamic_Element_2_Field_Value_1":"STRING",
"Dynamic_Element_2_Field_Value_2":"STRING",
"Dynamic_Element_2_Field_Value_3":"STRING",
"Interaction_Count_Mobile_Video":"INTEGER",
"Has_Full_Screen_Video_Completions":"BOOLEAN",
"Placement_Total_Planned_Media_Cost":"STRING",
"Video_First_Quartile_Completions":"INTEGER",
"Twitter_Creative_Media_Id":"INTEGER",
"Cookie_Reach_Duplicate_Total_Reach":"FLOAT",
"Rich_Media_Impressions":"INTEGER",
"Video_Completions":"INTEGER",
"Month":"STRING",
"Paid_Search_Keyword_Id":"INTEGER",
"Replies":"INTEGER",
"Dynamic_Element_5_Field_6_Value":"STRING",
"Video_Mutes":"INTEGER",
"Flight_Booked_Units":"STRING",
"Dynamic_Element_Value_Id":"STRING",
"Expansion_Time":"INTEGER",
"Invalid_Clicks":"FLOAT",
"Has_Video_Progress_Events":"BOOLEAN",
"Dynamic_Element_2_Field_3_Value":"STRING",
"Rich_Media_Standard_Event_Path_Summary":"STRING",
"Video_Muted_At_Start":"INTEGER",
"Audio_Companion_Clicks":"INTEGER",
"Active_View_Audible_Amp_Fully_On_Screen_For_Half_Of_Duration_15_Sec_Cap_Measurable_Impressions":"INTEGER",
"Interaction_Date_Time":"STRING",
"User_List":"STRING",
"Paid_Search_External_Keyword_Id":"INTEGER",
"Timers":"INTEGER",
"Floodlight_Paid_Search_Action_Conversion_Percentage":"FLOAT",
"View_Through_Revenue_Cross_Environment":"FLOAT",
"Advertiser":"STRING",
"Has_Video_Unmutes":"BOOLEAN",
"Natural_Search_Query":"STRING",
"Audio_Plays":"INTEGER",
"Unique_Reach_Average_Impression_Frequency":"FLOAT",
"Path_Type":"STRING",
"Dynamic_Field_Value_2":"STRING",
"Interaction_Channel":"STRING",
"Blocked_Impressions":"INTEGER",
"Dynamic_Field_Value_5":"STRING",
"Dynamic_Field_Value_6":"STRING",
"Placement_Compatibility":"STRING",
"City":"STRING",
"Dbm_Line_Item_Id":"INTEGER",
"Cookie_Reach_Incremental_Click_Reach":"INTEGER",
"Floodlight_Variable_61":"STRING",
"Natural_Search_Processed_Landing_Page_Query_String":"STRING",
"Report_Day":"INTEGER",
"Dbm_Site":"STRING",
"Connection_Type":"STRING",
"Video_Average_View_Time":"FLOAT",
"Click_Through_Revenue_Cross_Environment":"FLOAT",
"Dbm_Creative":"STRING",
"Attributed_Event_Environment":"STRING",
"Floodlight_Variable_99":"STRING",
"Floodlight_Variable_98":"STRING",
"Measurable_Impressions_For_Video_Player_Size":"INTEGER",
"Dynamic_Element_1_Value_Id":"STRING",
"Paid_Search_Engine_Account_Id":"INTEGER",
"Floodlight_Variable_93":"STRING",
"Floodlight_Variable_92":"STRING",
"Floodlight_Variable_91":"STRING",
"Floodlight_Variable_90":"STRING",
"Floodlight_Variable_97":"STRING",
"Placement_Strategy":"STRING",
"Floodlight_Variable_95":"STRING",
"Floodlight_Variable_94":"STRING",
"Floodlight_Variable_75":"STRING",
"Floodlight_Variable_74":"STRING",
"Floodlight_Variable_77":"STRING",
"Floodlight_Variable_76":"STRING",
"Floodlight_Variable_71":"STRING",
"Floodlight_Variable_70":"STRING",
"Floodlight_Variable_73":"STRING",
"Activity":"STRING",
"Natural_Search_Engine_Url":"STRING",
"Total_Display_Time":"INTEGER",
"User_List_Description":"STRING",
"Active_View_Impressions_Audible_And_Visible_At_Completion":"INTEGER",
"Floodlight_Variable_79":"STRING",
"Floodlight_Variable_78":"STRING",
"Twitter_Impression_Type":"STRING",
"Active_View_Average_Viewable_Time_Seconds":"FLOAT",
"Active_View_Visible_At_Start":"FLOAT",
"Natural_Search_Landing_Page_Query_String":"STRING",
"Percentage_Of_Measurable_Impressions_For_Video_Player_Size":"FLOAT",
"Has_Full_Screen_Impressions":"BOOLEAN",
"Conversion_Id":"INTEGER",
"Creative_Version":"STRING",
"Dynamic_Element_2_Value_Id":"STRING",
"Active_View_Audible_And_Visible_At_Completion":"FLOAT",
"Hours_Since_Attributed_Interaction":"INTEGER",
"Dynamic_Element_3_Field_5_Value":"STRING",
"Has_Video_First_Quartile_Completions":"BOOLEAN",
"Dynamic_Element":"STRING",
"Booked_Clicks":"FLOAT",
"Booked_Impressions":"FLOAT",
"Tran_Value":"STRING",
"Dynamic_Element_Clicks":"INTEGER",
"Has_Dynamic_Impressions":"BOOLEAN",
"Site_Id_Site_Directory":"INTEGER",
"Event_Timers":"FLOAT",
"Twitter_Video_100_In_View_For_3_Seconds":"INTEGER",
"Dynamic_Element_2_Field_6_Value":"STRING",
"Has_Backup_Image":"BOOLEAN",
"Dynamic_Element_2_Field_5_Value":"STRING",
"Rich_Media_Custom_Event_Path_Summary":"STRING",
"Advertiser_Group":"STRING",
"General_Invalid_Traffic_Givt_Clicks":"INTEGER",
"Follows":"INTEGER",
"Has_Html5_Impressions":"BOOLEAN",
"Active_View_Of_Midpoint_Impressions_Audible_And_Visible":"FLOAT",
"Activity_Date_Time":"STRING",
"Site_Site_Directory":"STRING",
"Placement_Pixel_Size":"STRING",
"Within_Floodlight_Lookback_Window":"STRING",
"Dbm_Partner":"STRING",
"Dynamic_Element_3_Field_3_Value":"STRING",
"Ord_Value":"STRING",
"Floodlight_Configuration":"INTEGER",
"Ad_Id":"INTEGER",
"Dynamic_Field_Value_1":"STRING",
"Video_Plays":"INTEGER",
"Days_Since_First_Interaction":"INTEGER",
"Event_Counters":"INTEGER",
"Active_View_Not_Measurable_Impressions":"INTEGER",
"Landing_Page_Url":"STRING",
"Ad_Status":"STRING",
"Unique_Reach_Impression_Reach":"INTEGER",
"Dynamic_Element_2_Field_4_Value":"STRING",
"Dbm_Partner_Id":"INTEGER",
"Asset_Id":"INTEGER",
"Video_View_Rate":"FLOAT",
"Active_View_Visible_At_Third_Quartile":"FLOAT",
"Twitter_App_Install_Clicks":"INTEGER",
"Total_Social_Engagements":"INTEGER",
"Media_Cost":"FLOAT",
"Placement_Tag_Type":"STRING",
"Dbm_Insertion_Order":"STRING",
"Floodlight_Variable_39":"STRING",
"Floodlight_Variable_38":"STRING",
"Paid_Search_External_Ad_Id":"INTEGER",
"Browser_Platform":"STRING",
"Floodlight_Variable_31":"STRING",
"Floodlight_Variable_30":"STRING",
"Floodlight_Variable_33":"STRING",
"Floodlight_Variable_32":"STRING",
"Floodlight_Variable_35":"STRING",
"Floodlight_Variable_34":"STRING",
"Floodlight_Variable_37":"STRING",
"Floodlight_Variable_36":"STRING",
"Dynamic_Element_View_Through_Conversions":"INTEGER",
"Active_View_Viewable_Impression_Cookie_Reach":"INTEGER",
"Video_Interaction_Rate":"FLOAT",
"Active_View_Visible_At_First_Quartile":"FLOAT",
"Dynamic_Element_3_Field_1_Value":"STRING",
"Booked_Activities":"FLOAT",
"Has_Video_Full_Screen":"BOOLEAN",
"User_List_Membership_Life_Span":"STRING",
"Video_Length":"STRING",
"Paid_Search_Keyword":"STRING",
"Revenue_Per_Click":"FLOAT",
"Downloaded_Impressions":"INTEGER",
"Days_Since_Attributed_Interaction":"INTEGER",
"Code_Serves":"INTEGER",
"Effective_Cpm":"FLOAT",
"Environment":"STRING",
"Paid_Search_Agency":"STRING",
"Dynamic_Element_5_Field_3_Value":"STRING",
"Paid_Search_Engine_Account_Category":"STRING",
"Week":"STRING",
"Designated_Market_Area_Dma":"STRING",
"Cookie_Reach_Click_Reach":"INTEGER",
"Twitter_Buy_Now_Purchases":"INTEGER",
"Floodlight_Paid_Search_Average_Dcm_Transaction_Amount":"FLOAT",
"Placement_Start_Date":"STRING",
"View_Through_Revenue":"FLOAT",
"Impression_Delivery_Status":"FLOAT",
"Floodlight_Paid_Search_Transaction_Conversion_Percentage":"FLOAT",
"Click_Through_Conversions_Cross_Environment":"INTEGER",
"Activity_Id":"INTEGER",
"Has_Video_Mutes":"BOOLEAN",
"Exits":"INTEGER",
"Paid_Search_Bid_Strategy":"STRING",
"Interaction_Count_Mobile_Rich_Media":"INTEGER",
"Dbm_Insertion_Order_Id":"INTEGER",
"Placement_Id":"INTEGER",
"App_Id":"STRING",
"View_Through_Transaction_Count":"FLOAT",
"Floodlight_Paid_Search_Transaction_Revenue_Per_Spend":"FLOAT",
"Active_View_Play_Time_Audible":"FLOAT",
"Dynamic_Element_5_Field_4_Value":"STRING",
"Companion_Creative_Pixel_Size":"STRING",
"Revenue_Per_Thousand_Impressions":"FLOAT",
"Natural_Search_Clicks":"INTEGER",
"Dynamic_Element_3_Field_2_Value":"STRING",
"Audio_First_Quartile_Completions":"INTEGER",
"Dynamic_Element_1_Field_Value_3":"STRING",
"Dynamic_Element_1_Field_Value_2":"STRING",
"Dynamic_Element_1_Field_Value_1":"STRING",
"Full_Screen_Average_View_Time":"FLOAT",
"Dynamic_Element_5_Value_Id":"STRING",
"Rich_Media_Click_Rate":"FLOAT",
"User_List_Id":"INTEGER",
"Click_Through_Url":"STRING",
"Has_Video_Pauses":"BOOLEAN",
"Video_Prominence_Score":"STRING",
"Has_Video_Third_Quartile_Completions":"BOOLEAN",
"Natural_Search_Actions":"FLOAT",
"Platform_Type":"STRING",
"General_Invalid_Traffic_Givt_Impressions":"INTEGER",
"Dynamic_Element_3":"STRING",
"Video_Player_Location_Avg_Pixels_From_Left":"INTEGER",
"Paid_Search_Transactions":"FLOAT",
"Rich_Media_Event":"STRING",
"Country":"STRING",
"Dynamic_Element_3_Field_6_Value":"STRING",
"Expansions":"INTEGER",
"Interaction_Rate":"FLOAT",
"Natural_Search_Processed_Landing_Page":"STRING",
"Floodlight_Impressions":"INTEGER",
"Paid_Search_Bid_Strategy_Id":"INTEGER",
"Interactive_Impressions":"INTEGER",
"Interaction_Count_Natural_Search":"INTEGER",
"Twitter_Impression_Id":"INTEGER",
"Ad":"STRING",
"Paid_Search_Ad_Group_Id":"INTEGER",
"Paid_Search_Campaign_Id":"INTEGER",
"Full_Screen_Video_Completions":"INTEGER",
"Dynamic_Element_Value":"STRING",
"State_Region":"STRING",
"Placement_End_Date":"STRING",
"Paid_Search_Impressions":"INTEGER",
"Cookie_Reach_Average_Impression_Frequency":"FLOAT",
"Natural_Search_Engine_Country":"STRING",
"Paid_Search_Revenue":"FLOAT"
}
|
# Problem 1: Two Sum
class Solution(object):
def twoSum(self, nums, target):
"""
:type nums: List[int]
:type target: int
:rtype: List[int]
"""
# Given an array of integers, return indices of the two numbers such that they add up to a specific target.
# You may assume that each input would have exactly one solution, and you may not use the same element twice.
# total = 0
# for key, value in nums
# total = total + value
# for key1, value1 in nums
# if key != key1
# total = total + value1
# if total == target
# return [key, key1]
total = 0
for x in range(0, len(nums)):
total = 0
for y in range(0, len(nums)):
if x != y:
total = nums[x] + nums[y]
if total == target:
return [x, y]
# Problem 2: Implement a Queue Using Stacks
class MyQueue(object):
# Implement the following operations of a queue (FIFO) using stacks (LIFO).
# Depending on your language, stack may not be supported natively. You may simulate a stack by using a list or deque(double-ended queue), as long as you use only standard operations of a stack.
# You may assume that all operations are valid (for example, no pop or peek operations will be called on an empty queue).
# You must use only standard operations of a stack -- which means only:
# peek from top
# pop from top
# push to bottom
# size
# is empty
def __init__(self):
"""
Initialize your data structure here.
"""
self.stack1 = []
self.stack2 = []
def push(self, x):
"""
Push element x to the back of queue.
:type x: int
:rtype: None
"""
# while self.stack1 not empty, append its last element to stack2
while self.stack1:
popped1 = self.stack1.pop()
self.stack2.append(popped1)
# then append x to stack1, which is empty
self.stack1.append(x)
# then put all the other elements, now on stack2, back on stack1
while self.stack2:
popped2 = self.stack2.pop()
self.stack1.append(popped2)
def pop(self):
"""
Removes the element from in front of queue and returns that element.
:rtype: int
"""
# remove last element of stack, which is front element of queue, and return it
popped = self.stack1.pop()
return popped
def peek(self):
"""
Get the front element.
:rtype: int
"""
# return last element of stack, which is front element of queue (no removal)
front_element = self.stack1[-1]
return front_element
def empty(self):
"""
Returns whether the queue is empty.
:rtype: bool
"""
# if both stacks are empty, return true; else return false
if not self.stack1 and not self.stack2:
is_empty = True
else:
is_empty = False
return is_empty
# Your MyQueue object will be instantiated and called as such:
# obj = MyQueue()
# obj.push(x)
# param_2 = obj.pop()
# param_3 = obj.peek()
# param_4 = obj.empty()
|
a = 1.123456
b = 10
c = -30
d = 34
e = 123.456
f = 19892122
# form 0
s = "b=%i" % b
print(s)
# form 1
s = "b,c,d=%i+%i+%i" % (b,c,d)
print(s)
# form 2
s = "b=%(b)i and c=%(c)i and d=%(d)i" % { 'b':b,'c':c,'d':d }
print(s)
# width,flags
s = "e=%020i e=%+i e=%20i e=%-20i (e=%- 20i)" % (e,e,e,e,e)
print(s)
|
#!/usr/bin/Anaconda3/python
# -*- coding: utf-8 -*-
class Board(object):
"""
Board 黑白棋棋盘,规格是8*8,黑棋用 X 表示,白棋用 O 表示,未落子时用 . 表示。
"""
def __init__(self):
"""
初始化棋盘状态
"""
self.empty = '.' # 未落子状态
self._board = [[self.empty for _ in range(8)] for _ in range(8)] # 规格:8*8
self._board[3][4] = 'X' # 黑棋棋子
self._board[4][3] = 'X' # 黑棋棋子
self._board[3][3], self._board[4][4] = 'O', 'O' # 白棋棋子
def __getitem__(self, index):
"""
添加Board[][] 索引语法
:param index: 下标索引
:return:
"""
return self._board[index]
def display(self, step_time=None, total_time=None):
"""
打印棋盘
:param step_time: 每一步的耗时, 比如:{"X":1,"O":0},默认值是None
:param total_time: 总耗时, 比如:{"X":1,"O":0},默认值是None
:return:
"""
board = self._board
# print(step_time,total_time)
# 打印列名
print(' ', ' '.join(list('ABCDEFGH')))
# 打印行名和棋盘
for i in range(8):
# print(board)
print(str(i + 1), ' '.join(board[i]))
if (not step_time) or (not total_time):
# 棋盘初始化时展示的时间
step_time = {"X": 0, "O": 0}
total_time = {"X": 0, "O": 0}
print("统计棋局: 棋子总数 / 每一步耗时 / 总时间 ")
print("黑 棋: " + str(self.count('X')) + ' / ' + str(step_time['X']) + ' / ' + str(
total_time['X']))
print("白 棋: " + str(self.count('O')) + ' / ' + str(step_time['O']) + ' / ' + str(
total_time['O']) + '\n')
else:
# 比赛时展示时间
print("统计棋局: 棋子总数 / 每一步耗时 / 总时间 ")
print("黑 棋: " + str(self.count('X')) + ' / ' + str(step_time['X']) + ' / ' + str(
total_time['X']))
print("白 棋: " + str(self.count('O')) + ' / ' + str(step_time['O']) + ' / ' + str(
total_time['O']) + '\n')
def count(self, color):
"""
统计 color 一方棋子的数量。(O:白棋, X:黑棋, .:未落子状态)
:param color: [O,X,.] 表示棋盘上不同的棋子
:return: 返回 color 棋子在棋盘上的总数
"""
count = 0
for y in range(8):
for x in range(8):
if self._board[x][y] == color:
count += 1
return count
def get_winner(self):
"""
判断黑棋和白旗的输赢,通过棋子的个数进行判断
:return: 0-黑棋赢,1-白旗赢,2-表示平局,黑棋个数和白旗个数相等
"""
# 定义黑白棋子初始的个数
black_count, white_count = 0, 0
for i in range(8):
for j in range(8):
# 统计黑棋棋子的个数
if self._board[i][j] == 'X':
black_count += 1
# 统计白旗棋子的个数
if self._board[i][j] == 'O':
white_count += 1
if black_count > white_count:
# 黑棋胜
return 0, black_count - white_count
elif black_count < white_count:
# 白棋胜
return 1, white_count - black_count
elif black_count == white_count:
# 表示平局,黑棋个数和白旗个数相等
return 2, 0
def _move(self, action, color):
"""
落子并获取反转棋子的坐标
:param action: 落子的坐标 可以是 D3 也可以是(2,3)
:param color: [O,X,.] 表示棋盘上不同的棋子
:return: 返回反转棋子的坐标列表,落子失败则返回False
"""
# 判断action 是不是字符串,如果是则转化为数字坐标
if isinstance(action, str):
action = self.board_num(action)
fliped = self._can_fliped(action, color)
if fliped:
# 有就反转对方棋子坐标
for flip in fliped:
x, y = self.board_num(flip)
self._board[x][y] = color
# 落子坐标
x, y = action
# 更改棋盘上 action 坐标处的状态,修改之后该位置属于 color[X,O,.]等三状态
self._board[x][y] = color
return fliped
else:
# 没有反转子则落子失败
return False
def backpropagation(self, action, flipped_pos, color):
"""
回溯
:param action: 落子点的坐标
:param flipped_pos: 反转棋子坐标列表
:param color: 棋子的属性,[X,0,.]三种情况
:return:
"""
# 判断action 是不是字符串,如果是则转化为数字坐标
if isinstance(action, str):
action = self.board_num(action)
self._board[action[0]][action[1]] = self.empty
# 如果 color == 'X',则 op_color = 'O';否则 op_color = 'X'
op_color = "O" if color == "X" else "X"
for p in flipped_pos:
# 判断action 是不是字符串,如果是则转化为数字坐标
if isinstance(p, str):
p = self.board_num(p)
self._board[p[0]][p[1]] = op_color
def is_on_board(self, x, y):
"""
判断坐标是否出界
:param x: row 行坐标
:param y: col 列坐标
:return: True or False
"""
return x >= 0 and x <= 7 and y >= 0 and y <= 7
def _can_fliped(self, action, color):
"""
检测落子是否合法,如果不合法,返回 False,否则返回反转子的坐标列表
:param action: 下子位置
:param color: [X,0,.] 棋子状态
:return: False or 反转对方棋子的坐标列表
"""
# 判断action 是不是字符串,如果是则转化为数字坐标
if isinstance(action, str):
action = self.board_num(action)
xstart, ystart = action
# 如果该位置已经有棋子或者出界,返回 False
if not self.is_on_board(xstart, ystart) or self._board[xstart][ystart] != self.empty:
return False
# 临时将color放到指定位置
self._board[xstart][ystart] = color
# 棋手
op_color = "O" if color == "X" else "X"
# 要被翻转的棋子
flipped_pos = []
flipped_pos_board = []
for xdirection, ydirection in [[0, 1], [1, 1], [1, 0], [1, -1], [0, -1], [-1, -1], [-1, 0],
[-1, 1]]:
x, y = xstart, ystart
x += xdirection
y += ydirection
# 如果(x,y)在棋盘上,而且为对方棋子,则在这个方向上继续前进,否则循环下一个角度。
if self.is_on_board(x, y) and self._board[x][y] == op_color:
x += xdirection
y += ydirection
# 进一步判断点(x,y)是否在棋盘上,如果不在棋盘上,继续循环下一个角度,如果在棋盘上,则进行while循环。
if not self.is_on_board(x, y):
continue
# 一直走到出界或不是对方棋子的位置
while self._board[x][y] == op_color:
# 如果一直是对方的棋子,则点(x,y)一直循环,直至点(x,y)出界或者不是对方的棋子。
x += xdirection
y += ydirection
# 点(x,y)出界了和不是对方棋子
if not self.is_on_board(x, y):
break
# 出界了,则没有棋子要翻转OXXXXX
if not self.is_on_board(x, y):
continue
# 是自己的棋子OXXXXXXO
if self._board[x][y] == color:
while True:
x -= xdirection
y -= ydirection
# 回到了起点则结束
if x == xstart and y == ystart:
break
# 需要翻转的棋子
flipped_pos.append([x, y])
# 将前面临时放上的棋子去掉,即还原棋盘
self._board[xstart][ystart] = self.empty # restore the empty space
# 没有要被翻转的棋子,则走法非法。返回 False
if len(flipped_pos) == 0:
return False
for fp in flipped_pos:
flipped_pos_board.append(self.num_board(fp))
# 走法正常,返回翻转棋子的棋盘坐标
return flipped_pos_board
def get_legal_actions(self, color):
"""
按照黑白棋的规则获取棋子的合法走法
:param color: 不同颜色的棋子,X-黑棋,O-白棋
:return: 生成合法的落子坐标,用list()方法可以获取所有的合法坐标
"""
# 表示棋盘坐标点的8个不同方向坐标,比如方向坐标[0][1]则表示坐标点的正上方。
direction = [(-1, 0), (-1, 1), (0, 1), (1, 1), (1, 0), (1, -1), (0, -1), (-1, -1)]
op_color = "O" if color == "X" else "X"
# 统计 op_color 一方邻近的未落子状态的位置
op_color_near_points = []
board = self._board
for i in range(8):
# i 是行数,从0开始,j是列数,也是从0开始
for j in range(8):
# 判断棋盘[i][j]位子棋子的属性,如果是op_color,则继续进行下一步操作,
# 否则继续循环获取下一个坐标棋子的属性
if board[i][j] == op_color:
# dx,dy 分别表示[i][j]坐标在行、列方向上的步长,direction 表示方向坐标
for dx, dy in direction:
x, y = i + dx, j + dy
# 表示x、y坐标值在合理范围,棋盘坐标点board[x][y]为未落子状态,
# 而且(x,y)不在op_color_near_points 中,统计对方未落子状态位置的列表才可以添加该坐标点
if 0 <= x <= 7 and 0 <= y <= 7 and board[x][y] == self.empty and (
x, y) not in op_color_near_points:
op_color_near_points.append((x, y))
l = [0, 1, 2, 3, 4, 5, 6, 7]
for p in op_color_near_points:
if self._can_fliped(p, color):
# 判断p是不是数字坐标,如果是则返回棋盘坐标
# p = self.board_num(p)
if p[0] in l and p[1] in l:
p = self.num_board(p)
yield p
def board_num(self, action):
"""
棋盘坐标转化为数字坐标
:param action:棋盘坐标,比如A1
:return:数字坐标,比如 A1 --->(0,0)
"""
row, col = str(action[1]).upper(), str(action[0]).upper()
if row in '12345678' and col in 'ABCDEFGH':
# 坐标正确
x, y = '12345678'.index(row), 'ABCDEFGH'.index(col)
return x, y
def num_board(self, action):
"""
数字坐标转化为棋盘坐标
:param action:数字坐标 ,比如(0,0)
:return:棋盘坐标,比如 (0,0)---> A1
"""
row, col = action
l = [0, 1, 2, 3, 4, 5, 6, 7]
if col in l and row in l:
return chr(ord('A') + col) + str(row + 1)
# # # 测试
# if __name__ == '__main__':
# board = Board() # 棋盘初始化
# board.display()
# print("----------------------------------X",list(board.get_legal_actions('X')))
# # print("打印D2放置为X",board._move('D2','X'))
# print("==========",'F1' in list(board.get_legal_actions('X')))
# # print('E2' in list(board.get_legal_actions('X')))
|
registry = []
def register(cls, bench_type=None, bench_params=None):
registry.append((cls, bench_type, bench_params))
return cls
|
__author__ = "Bilal El Uneis and Jieshu Wang"
__since__ = "Nov 2018"
__email__ = "[email protected]"
"""
Meta Classes are the blue print for classes just like classes are blue print for types instantiated from them.
they allow to set class capabilities.
bellow is example:
Meta Class To prevent inheritance of Class when used.
"""
class CantInheritFrom(type):
def __new__(mcs, name, bases, attr):
type_list: [] = [type(x) for x in bases]
for _type in type_list:
if _type is CantInheritFrom:
raise RuntimeError("You cannot subclass a Final class")
return super(CantInheritFrom, mcs).__new__(mcs, name, bases, attr)
"""
Actual Classes that will use Meta Classes to adjust class capabilities
"""
class FinalClass(metaclass=CantInheritFrom):
def __init__(self):
print("__init__ FinalClass")
# uncomment class bellow to see error
# class A(FinalClass):
# def __init__(self):
# super().__init__()
# print("__init__ A")
def main():
FinalClass()
# A()
# start of running code
if __name__ == "__main__":
main()
|
#
# PySNMP MIB module ASCEND-MIBUDS3NET-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/ASCEND-MIBUDS3NET-MIB
# Produced by pysmi-0.3.4 at Mon Apr 29 17:12:47 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)
#
configuration, = mibBuilder.importSymbols("ASCEND-MIB", "configuration")
ObjectIdentifier, OctetString, Integer = mibBuilder.importSymbols("ASN1", "ObjectIdentifier", "OctetString", "Integer")
NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues")
ValueRangeConstraint, ConstraintsUnion, ValueSizeConstraint, ConstraintsIntersection, SingleValueConstraint = mibBuilder.importSymbols("ASN1-REFINEMENT", "ValueRangeConstraint", "ConstraintsUnion", "ValueSizeConstraint", "ConstraintsIntersection", "SingleValueConstraint")
NotificationGroup, ModuleCompliance = mibBuilder.importSymbols("SNMPv2-CONF", "NotificationGroup", "ModuleCompliance")
Counter32, TimeTicks, IpAddress, ModuleIdentity, Bits, Integer32, Unsigned32, Counter64, ObjectIdentity, NotificationType, Gauge32, MibIdentifier, MibScalar, MibTable, MibTableRow, MibTableColumn, iso = mibBuilder.importSymbols("SNMPv2-SMI", "Counter32", "TimeTicks", "IpAddress", "ModuleIdentity", "Bits", "Integer32", "Unsigned32", "Counter64", "ObjectIdentity", "NotificationType", "Gauge32", "MibIdentifier", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "iso")
DisplayString, TextualConvention = mibBuilder.importSymbols("SNMPv2-TC", "DisplayString", "TextualConvention")
class DisplayString(OctetString):
pass
mibuds3NetworkProfile = MibIdentifier((1, 3, 6, 1, 4, 1, 529, 23, 5))
mibuds3NetworkProfileTable = MibTable((1, 3, 6, 1, 4, 1, 529, 23, 5, 1), )
if mibBuilder.loadTexts: mibuds3NetworkProfileTable.setStatus('mandatory')
mibuds3NetworkProfileEntry = MibTableRow((1, 3, 6, 1, 4, 1, 529, 23, 5, 1, 1), ).setIndexNames((0, "ASCEND-MIBUDS3NET-MIB", "uds3NetworkProfile-Shelf-o"), (0, "ASCEND-MIBUDS3NET-MIB", "uds3NetworkProfile-Slot-o"), (0, "ASCEND-MIBUDS3NET-MIB", "uds3NetworkProfile-Item-o"))
if mibBuilder.loadTexts: mibuds3NetworkProfileEntry.setStatus('mandatory')
uds3NetworkProfile_Shelf_o = MibScalar((1, 3, 6, 1, 4, 1, 529, 23, 5, 1, 1, 1), Integer32()).setLabel("uds3NetworkProfile-Shelf-o").setMaxAccess("readonly")
if mibBuilder.loadTexts: uds3NetworkProfile_Shelf_o.setStatus('mandatory')
uds3NetworkProfile_Slot_o = MibScalar((1, 3, 6, 1, 4, 1, 529, 23, 5, 1, 1, 2), Integer32()).setLabel("uds3NetworkProfile-Slot-o").setMaxAccess("readonly")
if mibBuilder.loadTexts: uds3NetworkProfile_Slot_o.setStatus('mandatory')
uds3NetworkProfile_Item_o = MibScalar((1, 3, 6, 1, 4, 1, 529, 23, 5, 1, 1, 3), Integer32()).setLabel("uds3NetworkProfile-Item-o").setMaxAccess("readonly")
if mibBuilder.loadTexts: uds3NetworkProfile_Item_o.setStatus('mandatory')
uds3NetworkProfile_Name = MibScalar((1, 3, 6, 1, 4, 1, 529, 23, 5, 1, 1, 4), DisplayString()).setLabel("uds3NetworkProfile-Name").setMaxAccess("readwrite")
if mibBuilder.loadTexts: uds3NetworkProfile_Name.setStatus('mandatory')
uds3NetworkProfile_PhysicalAddress_Shelf = MibScalar((1, 3, 6, 1, 4, 1, 529, 23, 5, 1, 1, 5), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6, 7, 8, 9, 10))).clone(namedValues=NamedValues(("anyShelf", 1), ("shelf1", 2), ("shelf2", 3), ("shelf3", 4), ("shelf4", 5), ("shelf5", 6), ("shelf6", 7), ("shelf7", 8), ("shelf8", 9), ("shelf9", 10)))).setLabel("uds3NetworkProfile-PhysicalAddress-Shelf").setMaxAccess("readwrite")
if mibBuilder.loadTexts: uds3NetworkProfile_PhysicalAddress_Shelf.setStatus('mandatory')
uds3NetworkProfile_PhysicalAddress_Slot = MibScalar((1, 3, 6, 1, 4, 1, 529, 23, 5, 1, 1, 6), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 55, 56, 57, 58, 49, 50, 42, 53, 54, 45, 46, 51, 59))).clone(namedValues=NamedValues(("anySlot", 1), ("slot1", 2), ("slot2", 3), ("slot3", 4), ("slot4", 5), ("slot5", 6), ("slot6", 7), ("slot7", 8), ("slot8", 9), ("slot9", 10), ("slot10", 11), ("slot11", 12), ("slot12", 13), ("slot13", 14), ("slot14", 15), ("slot15", 16), ("slot16", 17), ("slot17", 18), ("slot18", 19), ("slot19", 20), ("slot20", 21), ("slot21", 22), ("slot22", 23), ("slot23", 24), ("slot24", 25), ("slot25", 26), ("slot26", 27), ("slot27", 28), ("slot28", 29), ("slot29", 30), ("slot30", 31), ("slot31", 32), ("slot32", 33), ("slot33", 34), ("slot34", 35), ("slot35", 36), ("slot36", 37), ("slot37", 38), ("slot38", 39), ("slot39", 40), ("slot40", 41), ("aLim", 55), ("bLim", 56), ("cLim", 57), ("dLim", 58), ("leftController", 49), ("rightController", 50), ("controller", 42), ("firstControlModule", 53), ("secondControlModule", 54), ("trunkModule1", 45), ("trunkModule2", 46), ("controlModule", 51), ("slotPrimary", 59)))).setLabel("uds3NetworkProfile-PhysicalAddress-Slot").setMaxAccess("readwrite")
if mibBuilder.loadTexts: uds3NetworkProfile_PhysicalAddress_Slot.setStatus('mandatory')
uds3NetworkProfile_PhysicalAddress_ItemNumber = MibScalar((1, 3, 6, 1, 4, 1, 529, 23, 5, 1, 1, 7), Integer32()).setLabel("uds3NetworkProfile-PhysicalAddress-ItemNumber").setMaxAccess("readwrite")
if mibBuilder.loadTexts: uds3NetworkProfile_PhysicalAddress_ItemNumber.setStatus('mandatory')
uds3NetworkProfile_Enabled = MibScalar((1, 3, 6, 1, 4, 1, 529, 23, 5, 1, 1, 8), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("no", 1), ("yes", 2)))).setLabel("uds3NetworkProfile-Enabled").setMaxAccess("readwrite")
if mibBuilder.loadTexts: uds3NetworkProfile_Enabled.setStatus('mandatory')
uds3NetworkProfile_ProfileNumber = MibScalar((1, 3, 6, 1, 4, 1, 529, 23, 5, 1, 1, 9), Integer32()).setLabel("uds3NetworkProfile-ProfileNumber").setMaxAccess("readwrite")
if mibBuilder.loadTexts: uds3NetworkProfile_ProfileNumber.setStatus('mandatory')
uds3NetworkProfile_LineConfig_TrunkGroup = MibScalar((1, 3, 6, 1, 4, 1, 529, 23, 5, 1, 1, 10), Integer32()).setLabel("uds3NetworkProfile-LineConfig-TrunkGroup").setMaxAccess("readwrite")
if mibBuilder.loadTexts: uds3NetworkProfile_LineConfig_TrunkGroup.setStatus('mandatory')
uds3NetworkProfile_LineConfig_NailedGroup = MibScalar((1, 3, 6, 1, 4, 1, 529, 23, 5, 1, 1, 11), Integer32()).setLabel("uds3NetworkProfile-LineConfig-NailedGroup").setMaxAccess("readwrite")
if mibBuilder.loadTexts: uds3NetworkProfile_LineConfig_NailedGroup.setStatus('mandatory')
uds3NetworkProfile_LineConfig_RoutePort_SlotNumber_SlotNumber = MibScalar((1, 3, 6, 1, 4, 1, 529, 23, 5, 1, 1, 12), Integer32()).setLabel("uds3NetworkProfile-LineConfig-RoutePort-SlotNumber-SlotNumber").setMaxAccess("readwrite")
if mibBuilder.loadTexts: uds3NetworkProfile_LineConfig_RoutePort_SlotNumber_SlotNumber.setStatus('mandatory')
uds3NetworkProfile_LineConfig_RoutePort_SlotNumber_ShelfNumber = MibScalar((1, 3, 6, 1, 4, 1, 529, 23, 5, 1, 1, 13), Integer32()).setLabel("uds3NetworkProfile-LineConfig-RoutePort-SlotNumber-ShelfNumber").setMaxAccess("readwrite")
if mibBuilder.loadTexts: uds3NetworkProfile_LineConfig_RoutePort_SlotNumber_ShelfNumber.setStatus('mandatory')
uds3NetworkProfile_LineConfig_RoutePort_RelativePortNumber_RelativePortNumber = MibScalar((1, 3, 6, 1, 4, 1, 529, 23, 5, 1, 1, 14), Integer32()).setLabel("uds3NetworkProfile-LineConfig-RoutePort-RelativePortNumber-RelativePortNumber").setMaxAccess("readwrite")
if mibBuilder.loadTexts: uds3NetworkProfile_LineConfig_RoutePort_RelativePortNumber_RelativePortNumber.setStatus('mandatory')
uds3NetworkProfile_LineConfig_Activation = MibScalar((1, 3, 6, 1, 4, 1, 529, 23, 5, 1, 1, 15), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("static", 1), ("dsrActive", 2), ("dcdDsrActive", 3)))).setLabel("uds3NetworkProfile-LineConfig-Activation").setMaxAccess("readwrite")
if mibBuilder.loadTexts: uds3NetworkProfile_LineConfig_Activation.setStatus('mandatory')
uds3NetworkProfile_LineConfig_LineType = MibScalar((1, 3, 6, 1, 4, 1, 529, 23, 5, 1, 1, 19), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1))).clone(namedValues=NamedValues(("cBitParity", 1)))).setLabel("uds3NetworkProfile-LineConfig-LineType").setMaxAccess("readwrite")
if mibBuilder.loadTexts: uds3NetworkProfile_LineConfig_LineType.setStatus('mandatory')
uds3NetworkProfile_LineConfig_LineCoding = MibScalar((1, 3, 6, 1, 4, 1, 529, 23, 5, 1, 1, 20), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1))).clone(namedValues=NamedValues(("b3zs", 1)))).setLabel("uds3NetworkProfile-LineConfig-LineCoding").setMaxAccess("readwrite")
if mibBuilder.loadTexts: uds3NetworkProfile_LineConfig_LineCoding.setStatus('mandatory')
uds3NetworkProfile_LineConfig_Loopback = MibScalar((1, 3, 6, 1, 4, 1, 529, 23, 5, 1, 1, 21), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("noLoopback", 1), ("facilityLoopback", 2), ("localLoopback", 3)))).setLabel("uds3NetworkProfile-LineConfig-Loopback").setMaxAccess("readwrite")
if mibBuilder.loadTexts: uds3NetworkProfile_LineConfig_Loopback.setStatus('mandatory')
uds3NetworkProfile_LineConfig_ClockSource = MibScalar((1, 3, 6, 1, 4, 1, 529, 23, 5, 1, 1, 23), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("eligible", 1), ("notEligible", 2)))).setLabel("uds3NetworkProfile-LineConfig-ClockSource").setMaxAccess("readwrite")
if mibBuilder.loadTexts: uds3NetworkProfile_LineConfig_ClockSource.setStatus('mandatory')
uds3NetworkProfile_LineConfig_ClockPriority = MibScalar((1, 3, 6, 1, 4, 1, 529, 23, 5, 1, 1, 24), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(2, 3, 4))).clone(namedValues=NamedValues(("highPriority", 2), ("middlePriority", 3), ("lowPriority", 4)))).setLabel("uds3NetworkProfile-LineConfig-ClockPriority").setMaxAccess("readwrite")
if mibBuilder.loadTexts: uds3NetworkProfile_LineConfig_ClockPriority.setStatus('mandatory')
uds3NetworkProfile_LineConfig_StatusChangeTrapEnable = MibScalar((1, 3, 6, 1, 4, 1, 529, 23, 5, 1, 1, 25), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("no", 1), ("yes", 2)))).setLabel("uds3NetworkProfile-LineConfig-StatusChangeTrapEnable").setMaxAccess("readwrite")
if mibBuilder.loadTexts: uds3NetworkProfile_LineConfig_StatusChangeTrapEnable.setStatus('mandatory')
uds3NetworkProfile_Action_o = MibScalar((1, 3, 6, 1, 4, 1, 529, 23, 5, 1, 1, 22), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("noAction", 1), ("createProfile", 2), ("deleteProfile", 3)))).setLabel("uds3NetworkProfile-Action-o").setMaxAccess("readwrite")
if mibBuilder.loadTexts: uds3NetworkProfile_Action_o.setStatus('mandatory')
mibBuilder.exportSymbols("ASCEND-MIBUDS3NET-MIB", uds3NetworkProfile_LineConfig_TrunkGroup=uds3NetworkProfile_LineConfig_TrunkGroup, uds3NetworkProfile_LineConfig_RoutePort_RelativePortNumber_RelativePortNumber=uds3NetworkProfile_LineConfig_RoutePort_RelativePortNumber_RelativePortNumber, uds3NetworkProfile_LineConfig_LineCoding=uds3NetworkProfile_LineConfig_LineCoding, uds3NetworkProfile_Shelf_o=uds3NetworkProfile_Shelf_o, uds3NetworkProfile_Action_o=uds3NetworkProfile_Action_o, uds3NetworkProfile_ProfileNumber=uds3NetworkProfile_ProfileNumber, mibuds3NetworkProfileTable=mibuds3NetworkProfileTable, uds3NetworkProfile_LineConfig_RoutePort_SlotNumber_ShelfNumber=uds3NetworkProfile_LineConfig_RoutePort_SlotNumber_ShelfNumber, uds3NetworkProfile_LineConfig_ClockSource=uds3NetworkProfile_LineConfig_ClockSource, uds3NetworkProfile_Name=uds3NetworkProfile_Name, uds3NetworkProfile_LineConfig_RoutePort_SlotNumber_SlotNumber=uds3NetworkProfile_LineConfig_RoutePort_SlotNumber_SlotNumber, uds3NetworkProfile_Slot_o=uds3NetworkProfile_Slot_o, uds3NetworkProfile_PhysicalAddress_ItemNumber=uds3NetworkProfile_PhysicalAddress_ItemNumber, uds3NetworkProfile_LineConfig_NailedGroup=uds3NetworkProfile_LineConfig_NailedGroup, uds3NetworkProfile_LineConfig_Activation=uds3NetworkProfile_LineConfig_Activation, mibuds3NetworkProfileEntry=mibuds3NetworkProfileEntry, uds3NetworkProfile_Item_o=uds3NetworkProfile_Item_o, mibuds3NetworkProfile=mibuds3NetworkProfile, uds3NetworkProfile_PhysicalAddress_Shelf=uds3NetworkProfile_PhysicalAddress_Shelf, uds3NetworkProfile_LineConfig_ClockPriority=uds3NetworkProfile_LineConfig_ClockPriority, DisplayString=DisplayString, uds3NetworkProfile_LineConfig_StatusChangeTrapEnable=uds3NetworkProfile_LineConfig_StatusChangeTrapEnable, uds3NetworkProfile_LineConfig_LineType=uds3NetworkProfile_LineConfig_LineType, uds3NetworkProfile_LineConfig_Loopback=uds3NetworkProfile_LineConfig_Loopback, uds3NetworkProfile_Enabled=uds3NetworkProfile_Enabled, uds3NetworkProfile_PhysicalAddress_Slot=uds3NetworkProfile_PhysicalAddress_Slot)
|
vermelho = '\033[31m'
verde = '\033[32m'
azul = '\033[34m'
#-----------------------------
ciano = '\033[36m'
magenta = '\033[35m'
amarelo = '\033[33m'
preto = '\033[30m'
branco = '\033[37m'
#-----------------------------
original = '\033[0;0m'
negrito = '\033[1m'
reverso = '\033[2m'
#-----------------------------
fundo_preto = '\033[40m'
fundo_vermelho = '\033[41m'
fundo_verde = '\033[42m'
fundo_amarelo = '\033[43m'
fundo_azul = '\033[44m'
fundo_magenta = '\033[45m'
fundo_ciano = '\033[46m'
fundo_branco = '\033[47m' |
class AppCredentials(object):
def __init__(self, client_id, client_secret, redirect_uri):
self.client_id = client_id
self.client_secret = client_secret
self.redirect_uri = redirect_uri
|
# * T<=11, n<=10, c_i<=10
# * มีชุดทดสอบ 10 ชุด ชุดละ 10 คะแนน
# * 10 คะแนน: f(x) = ax^2 + c
# * 10 คะแนน: f(x) = ax^2 + bx + c
# * 30 คะแนน: T<=4, n<=3
# * 50 คะแนน: ไม่มีเงื่อนไขเพิ่มเติม
def useGenerator(gen):
gen("s1", "sample1", 2, 2)
gen("s2", "ssss", 3, 2)
gen(1, "deg 2 pls", 2, 2)
gen(2, "seed", 3, 2)
gen(3, "cocoa", 4, 3)
gen(4, "chino", 4, 3)
gen(5, "rize", 4, 3)
gen(6, "germany", 6, 10)
gen(7, "jail", 7, 8)
gen(8, "bruh wtf", 7, 9)
gen(9, "meta", 8, 10)
gen(10, 101336844, 11, 10)
|
s=str(input())
n1,n2=[int(e) for e in input().split()]
count=0
count2=1
for i in range(n1):
print(s[i],end="")
for i in range(n2-n1+1):
print(s[n2-count],end="")
count+=1
for i in range(len(s)-n2-1):
print(s[n2+count2],end="")
count2+=1
|
# 28. Implement strStr()
class Solution(object):
# brute-force 1
def strStr(self, haystack, needle):
"""
:type haystack: str
:type needle: str
:rtype: int
"""
lh , ln = len(haystack), len(needle)
if ln == 0: return 0
for i in range(lh - ln + 1):
j = 0
while j < ln:
if haystack[i + j] != needle[j]: break
j += 1
if j == ln:
return i
return -1
# brute-force 2
def strStr1(self, haystack, needle):
"""
:type haystack: str
:type needle: str
:rtype: int
"""
lh, ln = len(haystack), len(needle)
for i in range(lh - ln + 1):
if haystack[i : (i+ln)] == needle:
return i
return -1
# KMP
def strStr2(self, haystack, needle):
"""
:type haystack: str
:type needle: str
:rtype: int
"""
N, M = len(haystack), len(needle)
if not N and not M:
return 0
if not N:
return -1
if not M:
return 0
# longest prefix suffix
lps = [0] * M
self.calculateLPS(needle, M, lps)
i, j, matches = 0, 0, []
while i < N:
if needle[j] == haystack[i]:
i += 1
j += 1
if j == M:
matches.append(i - j)
j = lps[j - 1]
elif i < N and needle[j] != haystack[i]:
if j != 0:
j = lps[j - 1]
else:
i += 1
return matches[0] if matches else -1
def calculateLPS(self, needle, M, lps):
len = 0 # length of the previous longest refix suffix
lps[0] = 0
i = 1
while i < M:
if needle[i] == needle[len]:
len += 1
lps[i] = len
i += 1
else:
if len != 0:
len = lps[len - 1]
else:
lps[i] = 0
i += 1
# Z-algorithm
def strStr3(self, haystack, needle):
N, M = len(haystack), len(needle)
if not N and not M:
return 0
if not N:
return -1
if not M:
return 0
s = needle + "$" + haystack
z = self.calculateZ(s)
res = []
for i in range(len(z)):
if z[i] == len(needle):
res.append(i - len(needle) - 1)
return res[0] if res else -1
def calculateZ(self, s):
z = [0 for ch in s]
left = right = 0
for k in range(len(s)):
if k > right:
left = right = k
while right < len(s) and s[right] == s[right - left]:
right += 1
z[k] = right - left
right -= 1
else:
k1 = k - left
if z[k1] < right - k + 1:
z[k] = z[k1]
else:
left = k
while right < len(s) and s[right] == s[right-left]:
right += 1
z[k] = right - left
right -= 1
return z
|
#
# PySNMP MIB module DLGHWINF-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/DLGHWINF-MIB
# Produced by pysmi-0.3.4 at Wed May 1 12:47:46 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")
ValueSizeConstraint, ValueRangeConstraint, ConstraintsIntersection, SingleValueConstraint, ConstraintsUnion = mibBuilder.importSymbols("ASN1-REFINEMENT", "ValueSizeConstraint", "ValueRangeConstraint", "ConstraintsIntersection", "SingleValueConstraint", "ConstraintsUnion")
dlgHardwareInfo, dialogic = mibBuilder.importSymbols("DLGC-GLOBAL-REG", "dlgHardwareInfo", "dialogic")
ModuleCompliance, NotificationGroup = mibBuilder.importSymbols("SNMPv2-CONF", "ModuleCompliance", "NotificationGroup")
sysName, = mibBuilder.importSymbols("SNMPv2-MIB", "sysName")
Integer32, NotificationType, iso, Counter64, MibScalar, MibTable, MibTableRow, MibTableColumn, TimeTicks, Gauge32, Counter32, Unsigned32, IpAddress, ModuleIdentity, Bits, ObjectIdentity, NotificationType, MibIdentifier = mibBuilder.importSymbols("SNMPv2-SMI", "Integer32", "NotificationType", "iso", "Counter64", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "TimeTicks", "Gauge32", "Counter32", "Unsigned32", "IpAddress", "ModuleIdentity", "Bits", "ObjectIdentity", "NotificationType", "MibIdentifier")
TextualConvention, DisplayString = mibBuilder.importSymbols("SNMPv2-TC", "TextualConvention", "DisplayString")
dlgHiMibRev = MibIdentifier((1, 3, 6, 1, 4, 1, 3028, 1, 1, 1))
dlgHiComponent = MibIdentifier((1, 3, 6, 1, 4, 1, 3028, 1, 1, 2))
dlgHiInterface = MibIdentifier((1, 3, 6, 1, 4, 1, 3028, 1, 1, 2, 1))
dlgHiIdent = MibIdentifier((1, 3, 6, 1, 4, 1, 3028, 1, 1, 2, 2))
dlgHiOsCommon = MibIdentifier((1, 3, 6, 1, 4, 1, 3028, 1, 1, 2, 1, 1))
dlgHiMibRevMajor = MibScalar((1, 3, 6, 1, 4, 1, 3028, 1, 1, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 65535))).setMaxAccess("readonly")
if mibBuilder.loadTexts: dlgHiMibRevMajor.setStatus('mandatory')
if mibBuilder.loadTexts: dlgHiMibRevMajor.setDescription('The Major Revision level. A change in the major revision level represents a major change in the architecture of the MIB. A change in the major revision level may indicate a significant change in the information supported and/or the meaning of the supported information, correct interpretation of data may require a MIB document with the same major revision level.')
dlgHiMibRevMinor = MibScalar((1, 3, 6, 1, 4, 1, 3028, 1, 1, 1, 2), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 65535))).setMaxAccess("readonly")
if mibBuilder.loadTexts: dlgHiMibRevMinor.setStatus('mandatory')
if mibBuilder.loadTexts: dlgHiMibRevMinor.setDescription('The Minor Revision level. A change in the minor revision level may represent some minor additional support. no changes to any pre-existing information has occurred.')
dlgHiMibCondition = MibScalar((1, 3, 6, 1, 4, 1, 3028, 1, 1, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4))).clone(namedValues=NamedValues(("other", 1), ("ok", 2), ("degraded", 3), ("failed", 4)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: dlgHiMibCondition.setStatus('mandatory')
if mibBuilder.loadTexts: dlgHiMibCondition.setDescription('The overall condition. This object represents the overall status of the Dialogic Hardware Information system represented by this MIB. Other - The status of the MIB is Unknown OK - The status of the MIB is OK Degraded - Some statuses in the MIB are not OK Failed - Most statuses in the MIB are not OK')
dlgHiOsCommonPollFreq = MibScalar((1, 3, 6, 1, 4, 1, 3028, 1, 1, 2, 1, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 65535))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: dlgHiOsCommonPollFreq.setStatus('mandatory')
if mibBuilder.loadTexts: dlgHiOsCommonPollFreq.setDescription("The Agent's polling frequency in seconds. The frequency, in seconds, at which the Agent updates the operational status of the individual devices within the device table. A value of zero indicates that the Agent will not check the status of the indivdual devices. The default value is 60 (60 seconds). In this case the Agent checks each individual device every 60 seconds to make sure it is still operational. Should a device fail, it's status will set to failed and a trap is sent to the management application. Setting the poll frequency to a value too low can impact system performance.")
dlgHiOsCommonNumberOfModules = MibScalar((1, 3, 6, 1, 4, 1, 3028, 1, 1, 2, 1, 1, 2), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: dlgHiOsCommonNumberOfModules.setStatus('mandatory')
if mibBuilder.loadTexts: dlgHiOsCommonNumberOfModules.setDescription('The number of modules in the OS Common Module table.')
dlgHiOsLogEnable = MibScalar((1, 3, 6, 1, 4, 1, 3028, 1, 1, 2, 1, 1, 4), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 1))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: dlgHiOsLogEnable.setStatus('mandatory')
if mibBuilder.loadTexts: dlgHiOsLogEnable.setDescription("The Agent's log enable bit 0 - disabled Setting this variable to this value will disable the trap logging 1 - enabled Setting this variable to this value will enable the trap logging ")
dlgHiOsTestTrapEnable = MibScalar((1, 3, 6, 1, 4, 1, 3028, 1, 1, 2, 1, 1, 5), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1))).clone(namedValues=NamedValues(("enabled", 1)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: dlgHiOsTestTrapEnable.setStatus('mandatory')
if mibBuilder.loadTexts: dlgHiOsTestTrapEnable.setDescription(' Every time this bit is set, test trap is sent from the agent ')
dlgHiIdentSystemServicesNameForTrap = MibScalar((1, 3, 6, 1, 4, 1, 3028, 1, 1, 2, 1, 1, 6), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 256))).setMaxAccess("readonly")
if mibBuilder.loadTexts: dlgHiIdentSystemServicesNameForTrap.setStatus('mandatory')
dlgHiIdentSystemServicesStatusForTrap = MibScalar((1, 3, 6, 1, 4, 1, 3028, 1, 1, 2, 1, 1, 7), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5))).clone(namedValues=NamedValues(("other", 1), ("started", 2), ("stop-pending", 3), ("stopped", 4), ("start-pending", 5)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: dlgHiIdentSystemServicesStatusForTrap.setStatus('mandatory')
dlgHiIdentIndexForTrap = MibScalar((1, 3, 6, 1, 4, 1, 3028, 1, 1, 2, 1, 1, 8), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 65535))).setMaxAccess("readonly")
if mibBuilder.loadTexts: dlgHiIdentIndexForTrap.setStatus('mandatory')
if mibBuilder.loadTexts: dlgHiIdentIndexForTrap.setDescription('An index that uniquely specifies each device. This value is not necessarily contiguous')
dlgHiIdentModelForTrap = MibScalar((1, 3, 6, 1, 4, 1, 3028, 1, 1, 2, 1, 1, 9), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 32))).setMaxAccess("readonly")
if mibBuilder.loadTexts: dlgHiIdentModelForTrap.setStatus('mandatory')
if mibBuilder.loadTexts: dlgHiIdentModelForTrap.setDescription("Dialogic board Model. This is the Dialogic board's model name and can be used for identification purposes.")
dlgHiIdentOperStatusForTrap = MibScalar((1, 3, 6, 1, 4, 1, 3028, 1, 1, 2, 1, 1, 10), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4))).clone(namedValues=NamedValues(("other", 1), ("ok", 2), ("degraded", 3), ("failed", 4)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: dlgHiIdentOperStatusForTrap.setStatus('mandatory')
if mibBuilder.loadTexts: dlgHiIdentOperStatusForTrap.setDescription('Dialogic board Operational Status. This is the overall condition of the Dialogic board. The following values are defined other(1) The board does not support board condition monitoring. ok(2) The board is operating normally. No user action is required. degraded(3) The board is partially failed. The board may need to be reset. failed(4) The board has failed. The board should be reset NOTE: In the implmentation of this version of the MIB (Major 1, Minor 2), SpanCards do not support the degraded state. ')
dlgHiIdentAdminStatusForTrap = MibScalar((1, 3, 6, 1, 4, 1, 3028, 1, 1, 2, 1, 1, 11), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6, 7))).clone(namedValues=NamedValues(("other", 1), ("started", 2), ("stopped", 3), ("disabled", 4), ("diagnose", 5), ("start-pending", 6), ("stop-pending", 7)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: dlgHiIdentAdminStatusForTrap.setStatus('mandatory')
if mibBuilder.loadTexts: dlgHiIdentAdminStatusForTrap.setDescription("Dialogic board Admin Status. This is the Administrative Status of the Dialogic board. The following values are defined other(1) The board's admin status in unavailable. started(2) The board has been started. stopped(3) The board is stopped. disabled(4) The board is disabled. diagnose(5) The board is being diagnosed. start-pending(6) The board is in the process of starting. stop-pending(7) The board is in the process of stopping. ")
dlgHiIdentSerNumForTrap = MibScalar((1, 3, 6, 1, 4, 1, 3028, 1, 1, 2, 1, 1, 12), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 12))).setMaxAccess("readonly")
if mibBuilder.loadTexts: dlgHiIdentSerNumForTrap.setStatus('mandatory')
if mibBuilder.loadTexts: dlgHiIdentSerNumForTrap.setDescription('Dialogic board Serial Number. This is the Dialogic board serial number and can be used for identification purposes. On many boards the serial number appears on the back of the board.')
dlgHiIdentErrorMessageForTrap = MibScalar((1, 3, 6, 1, 4, 1, 3028, 1, 1, 2, 1, 1, 13), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 96))).setMaxAccess("readonly")
if mibBuilder.loadTexts: dlgHiIdentErrorMessageForTrap.setStatus('mandatory')
if mibBuilder.loadTexts: dlgHiIdentErrorMessageForTrap.setDescription('Dialogic board Error Message. This value represents the error message associated with a failing Dialogic board.')
dlgHiOsCommonModuleTable = MibTable((1, 3, 6, 1, 4, 1, 3028, 1, 1, 2, 1, 1, 3), )
if mibBuilder.loadTexts: dlgHiOsCommonModuleTable.setStatus('mandatory')
if mibBuilder.loadTexts: dlgHiOsCommonModuleTable.setDescription('A table of software modules that provide an interface to the devicethis MIB describes.')
dlgHiOsCommonModuleEntry = MibTableRow((1, 3, 6, 1, 4, 1, 3028, 1, 1, 2, 1, 1, 3, 1), ).setIndexNames((0, "DLGHWINF-MIB", "dlgHiOsCommonModuleIndex"))
if mibBuilder.loadTexts: dlgHiOsCommonModuleEntry.setStatus('mandatory')
if mibBuilder.loadTexts: dlgHiOsCommonModuleEntry.setDescription('A description of a software module that provides an interface to the device this MIB describes.')
dlgHiOsCommonModuleIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 3028, 1, 1, 2, 1, 1, 3, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 255))).setMaxAccess("readonly")
if mibBuilder.loadTexts: dlgHiOsCommonModuleIndex.setStatus('mandatory')
if mibBuilder.loadTexts: dlgHiOsCommonModuleIndex.setDescription('A unique index for this module description.')
dlgHiOsCommonModuleName = MibTableColumn((1, 3, 6, 1, 4, 1, 3028, 1, 1, 2, 1, 1, 3, 1, 2), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 255))).setMaxAccess("readonly")
if mibBuilder.loadTexts: dlgHiOsCommonModuleName.setStatus('mandatory')
if mibBuilder.loadTexts: dlgHiOsCommonModuleName.setDescription('The module name.')
dlgHiOsCommonModuleVersion = MibTableColumn((1, 3, 6, 1, 4, 1, 3028, 1, 1, 2, 1, 1, 3, 1, 3), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 5))).setMaxAccess("readonly")
if mibBuilder.loadTexts: dlgHiOsCommonModuleVersion.setStatus('mandatory')
if mibBuilder.loadTexts: dlgHiOsCommonModuleVersion.setDescription('Version of the module.')
dlgHiOsCommonModuleDate = MibTableColumn((1, 3, 6, 1, 4, 1, 3028, 1, 1, 2, 1, 1, 3, 1, 4), OctetString().subtype(subtypeSpec=ValueSizeConstraint(7, 7)).setFixedLength(7)).setMaxAccess("readonly")
if mibBuilder.loadTexts: dlgHiOsCommonModuleDate.setStatus('mandatory')
if mibBuilder.loadTexts: dlgHiOsCommonModuleDate.setDescription('The module date. field octets contents range ===== ====== ======= ===== 1 1-2 year 0..65536 2 3 month 1..12 3 4 day 1..31 4 5 hour 0..23 5 6 minute 0..59 6 7 second 0..60 (use 60 for leap-second) This field will be set to year = 0 if the agent cannot provide the module date. The hour, minute, and second field will be set to zero (0) if they are not relevant.')
dlgHiOsCommonModulePurpose = MibTableColumn((1, 3, 6, 1, 4, 1, 3028, 1, 1, 2, 1, 1, 3, 1, 5), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 255))).setMaxAccess("readonly")
if mibBuilder.loadTexts: dlgHiOsCommonModulePurpose.setStatus('mandatory')
if mibBuilder.loadTexts: dlgHiOsCommonModulePurpose.setDescription('The purpose of the module described in this entry.')
dlgHiIdentNumberOfDevices = MibScalar((1, 3, 6, 1, 4, 1, 3028, 1, 1, 2, 2, 2), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: dlgHiIdentNumberOfDevices.setStatus('mandatory')
if mibBuilder.loadTexts: dlgHiIdentNumberOfDevices.setDescription('Number of Dialogic device in the system. A device may be a physical board, a channel on a board or an embedded component on a board')
dlgHiIdentServiceStatus = MibScalar((1, 3, 6, 1, 4, 1, 3028, 1, 1, 2, 2, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5))).clone(namedValues=NamedValues(("other", 1), ("started", 2), ("stop-pending", 3), ("stopped", 4), ("start-pending", 5)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: dlgHiIdentServiceStatus.setStatus('mandatory')
if mibBuilder.loadTexts: dlgHiIdentServiceStatus.setDescription('Dialogic Service Status This is the overall status of the Dialogic system service. The following values are defined: other(1) The service status is unknown. started(2) The service status is running - boards are started. Setting the variable to this value will fail. stop-pending(3) The service is in the act of stopping. Setting the variable to this value when the current condition is started(2) will cause the service to begin stopping, otherwise it will fail. stopped(4) The service status is stopped - boards are stopped. Setting the variable to this value will fail. start-pending(5) The service is in the act of starting. Setting the variable to this value when the current condition is stopped(4) will cause the service to begin starting, othewise it will fail.')
dlgHiIdentServiceChangeDate = MibScalar((1, 3, 6, 1, 4, 1, 3028, 1, 1, 2, 2, 4), OctetString().subtype(subtypeSpec=ValueSizeConstraint(7, 7)).setFixedLength(7)).setMaxAccess("readonly")
if mibBuilder.loadTexts: dlgHiIdentServiceChangeDate.setStatus('mandatory')
if mibBuilder.loadTexts: dlgHiIdentServiceChangeDate.setDescription('The date and time the service was last started or stopped. field octets contents range ===== ====== ======= ===== 1 1-2 year 0..65536 2 3 month 1..12 3 4 day 1..31 4 5 hour 0..23 5 6 minute 0..59 6 7 second 0..60 (use 60 for leap-second) This field will be set to year = 0 if the agent cannot provide the module date. The hour, minute, and second field will be set to zero (0) if they are not relevant.')
dlgHiIdentTrapMask = MibScalar((1, 3, 6, 1, 4, 1, 3028, 1, 1, 2, 2, 5), Integer32()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: dlgHiIdentTrapMask.setStatus('mandatory')
if mibBuilder.loadTexts: dlgHiIdentTrapMask.setDescription("Trap Enable mask. This variable is a bit mask which can be used to enable or disable certain enterprise specific traps. A '1' is used to enable the trap, a '0' disables it. Bit 0 - (1) enables Traps upon Dialogic Service Status transitions to the Stopped or Started State. Bit 1 - (1) enables Traps when a specific board Condition transitions to the Failed State. Bit 2 - (1) enables the dlgDsx1Alarm trap from the DS1 MIB. This trap indicates the beginning and end of a new alarm condition. Bit 3 - (1) enables the dlgDsx1SwEvtMskTrap trap from the DS1 MIB. This trap indicates that the DS1 Event Mask has been changed. Bit 4 - (1) enables the dlgIsdnDChanged trap from the ISDN MIB. This trap indicates the current operational status of LAPD of a particular D channel has changed Bit 5 - (1) enables the dlgIsdnBChanged trap from the DS1 MIB. This trap indicates the current operational status of LAPD of a particular B channel has changed ")
dlgHiIdentSystemServicesTable = MibTable((1, 3, 6, 1, 4, 1, 3028, 1, 1, 2, 2, 6), )
if mibBuilder.loadTexts: dlgHiIdentSystemServicesTable.setStatus('mandatory')
if mibBuilder.loadTexts: dlgHiIdentSystemServicesTable.setDescription('Dialogic-Related system services table.')
dlgHiIdentSystemServicesEntry = MibTableRow((1, 3, 6, 1, 4, 1, 3028, 1, 1, 2, 2, 6, 1), ).setIndexNames((0, "DLGHWINF-MIB", "dlgHiIdentSystemServicesIndex"))
if mibBuilder.loadTexts: dlgHiIdentSystemServicesEntry.setStatus('mandatory')
if mibBuilder.loadTexts: dlgHiIdentSystemServicesEntry.setDescription('Dialogic-Related system services table entry.')
dlgHiIdentSystemServicesIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 3028, 1, 1, 2, 2, 6, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 65535))).setMaxAccess("readonly")
if mibBuilder.loadTexts: dlgHiIdentSystemServicesIndex.setStatus('mandatory')
if mibBuilder.loadTexts: dlgHiIdentSystemServicesIndex.setDescription('An index that uniquely specifies each system service. This value is not necessarily contiguous')
dlgHiIdentSystemServicesName = MibTableColumn((1, 3, 6, 1, 4, 1, 3028, 1, 1, 2, 2, 6, 1, 2), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 256))).setMaxAccess("readonly")
if mibBuilder.loadTexts: dlgHiIdentSystemServicesName.setStatus('mandatory')
if mibBuilder.loadTexts: dlgHiIdentSystemServicesName.setDescription('System Service Name. This is the name of the system service used for Identification Purposes.')
dlgHiIdentSystemServicesScmName = MibTableColumn((1, 3, 6, 1, 4, 1, 3028, 1, 1, 2, 2, 6, 1, 3), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 256))).setMaxAccess("readonly")
if mibBuilder.loadTexts: dlgHiIdentSystemServicesScmName.setStatus('mandatory')
if mibBuilder.loadTexts: dlgHiIdentSystemServicesScmName.setDescription('SCM System Service Name. This is the name of the system service that is given to SCM (Service Control Manager) and is used by SCM to identify the service.')
dlgHiIdentSystemServicesStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 3028, 1, 1, 2, 2, 6, 1, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5))).clone(namedValues=NamedValues(("other", 1), ("started", 2), ("stop-pending", 3), ("stopped", 4), ("start-pending", 5)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: dlgHiIdentSystemServicesStatus.setStatus('mandatory')
if mibBuilder.loadTexts: dlgHiIdentSystemServicesStatus.setDescription('Service Status This is the overall status of the Dialogic system service. The following values are defined: other(1) The service status is unknown. started(2) The service status is running - boards are started. Setting the variable to this value will fail. stop-pending(3) The service is in the act of stopping. Setting the variable to this value when the current condition is started(2) will cause the service to begin stopping, otherwise it will fail. stopped(4) The service status is stopped - boards are stopped. Setting the variable to this value will fail. start-pending(5) The service is in the act of starting. Setting the variable to this value when the current condition is stopped(4) will cause the service to begin starting, othewise it will fail.')
dlgHiIdentSystemServicesChangeDate = MibTableColumn((1, 3, 6, 1, 4, 1, 3028, 1, 1, 2, 2, 6, 1, 5), OctetString().subtype(subtypeSpec=ValueSizeConstraint(7, 7)).setFixedLength(7)).setMaxAccess("readonly")
if mibBuilder.loadTexts: dlgHiIdentSystemServicesChangeDate.setStatus('mandatory')
if mibBuilder.loadTexts: dlgHiIdentSystemServicesChangeDate.setDescription('The date and time the service was last started or stopped. field octets contents range ===== ====== ======= ===== 1 1-2 year 0..65536 2 3 month 1..12 3 4 day 1..31 4 5 hour 0..23 5 6 minute 0..59 6 7 second 0..60 (use 60 for leap-second) This field will be set to year = 0 if the agent cannot provide the module date. The hour, minute, and second field will be set to zero (0) if they are not relevant.')
dlgHiIdentTable = MibTable((1, 3, 6, 1, 4, 1, 3028, 1, 1, 2, 2, 1), )
if mibBuilder.loadTexts: dlgHiIdentTable.setStatus('mandatory')
if mibBuilder.loadTexts: dlgHiIdentTable.setDescription('Dialogic board Identification Table.')
dlgHiIdentEntry = MibTableRow((1, 3, 6, 1, 4, 1, 3028, 1, 1, 2, 2, 1, 1), ).setIndexNames((0, "DLGHWINF-MIB", "dlgHiIdentIndex"))
if mibBuilder.loadTexts: dlgHiIdentEntry.setStatus('mandatory')
if mibBuilder.loadTexts: dlgHiIdentEntry.setDescription('Dialogic board Identification Table Entry.')
dlgHiIdentIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 3028, 1, 1, 2, 2, 1, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 65535))).setMaxAccess("readonly")
if mibBuilder.loadTexts: dlgHiIdentIndex.setStatus('mandatory')
if mibBuilder.loadTexts: dlgHiIdentIndex.setDescription('An index that uniquely specifies each device. This value is not necessarily contiguous')
dlgHiIdentModel = MibTableColumn((1, 3, 6, 1, 4, 1, 3028, 1, 1, 2, 2, 1, 1, 2), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 32))).setMaxAccess("readonly")
if mibBuilder.loadTexts: dlgHiIdentModel.setStatus('mandatory')
if mibBuilder.loadTexts: dlgHiIdentModel.setDescription("Dialogic board Model. This is the Dialogic board's model name and can be used for identification purposes.")
dlgHiIdentType = MibTableColumn((1, 3, 6, 1, 4, 1, 3028, 1, 1, 2, 2, 1, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4))).clone(namedValues=NamedValues(("other", 1), ("release4span", 2), ("dm3", 3), ("gammaCP", 4)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: dlgHiIdentType.setStatus('mandatory')
if mibBuilder.loadTexts: dlgHiIdentType.setDescription('Dialogic board type. This indicates which family of boards this device belongs to. other(1) -- none of the following release4span(2) -- Proline/2V up to D/600SC-2E1 boards dm3(3) -- DM3 based board gammaCP(4) -- Gamma CP/x series antares(5) -- Antares based board')
dlgHiIdentFuncDescr = MibTableColumn((1, 3, 6, 1, 4, 1, 3028, 1, 1, 2, 2, 1, 1, 4), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 128))).setMaxAccess("readonly")
if mibBuilder.loadTexts: dlgHiIdentFuncDescr.setStatus('mandatory')
if mibBuilder.loadTexts: dlgHiIdentFuncDescr.setDescription('Dialogic board Function Description. This provides a description of the functionality provided by the Dialogic board. If the functional description of the board is unavailable, then this string will be of length zero (0).')
dlgHiIdentSerNum = MibTableColumn((1, 3, 6, 1, 4, 1, 3028, 1, 1, 2, 2, 1, 1, 5), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 12))).setMaxAccess("readonly")
if mibBuilder.loadTexts: dlgHiIdentSerNum.setStatus('mandatory')
if mibBuilder.loadTexts: dlgHiIdentSerNum.setDescription('Dialogic board Serial Number. This is the Dialogic board serial number and can be used for identification purposes. On many boards the serial number appears on the back of the board.')
dlgHiIdentFWName = MibTableColumn((1, 3, 6, 1, 4, 1, 3028, 1, 1, 2, 2, 1, 1, 6), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 128))).setMaxAccess("readonly")
if mibBuilder.loadTexts: dlgHiIdentFWName.setStatus('mandatory')
if mibBuilder.loadTexts: dlgHiIdentFWName.setDescription("Dialogic Firmware Name. This is the name of the firmware downloaded to this Dialogic board. If multiple different firmwares are loaded the filenames will be separated by a '\\'. If the firmware name is unavailable, then this strng will be of length zero (0).")
dlgHiIdentFWVers = MibTableColumn((1, 3, 6, 1, 4, 1, 3028, 1, 1, 2, 2, 1, 1, 7), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 64))).setMaxAccess("readonly")
if mibBuilder.loadTexts: dlgHiIdentFWVers.setStatus('mandatory')
if mibBuilder.loadTexts: dlgHiIdentFWVers.setDescription("Dialogic Firmware Version. This is the version of the firmware downloaded to this Dialogic board. If multiple different firmwares are loaded then each firmware version will be separated by a '\\'. If the Dialogic firmware version is unavailable, then this string will be of length zero (0).")
dlgHiIdentMemBaseAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 3028, 1, 1, 2, 2, 1, 1, 8), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: dlgHiIdentMemBaseAddr.setStatus('mandatory')
if mibBuilder.loadTexts: dlgHiIdentMemBaseAddr.setDescription('Dialogic board Base Memory Address. This is the Memory address where the Dialogic board has been installed on the system. If the Dialogic board does not use system memory then a value of zero (0) is returned')
dlgHiIdentIOBaseAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 3028, 1, 1, 2, 2, 1, 1, 9), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: dlgHiIdentIOBaseAddr.setStatus('mandatory')
if mibBuilder.loadTexts: dlgHiIdentIOBaseAddr.setDescription('Dialogic board Base I/O Port Address. This is the I/O Port address where the Dialogic board has been installed on the system. If the Dialogic board does not use a system I/O Port then a value of zero (0) is returned')
dlgHiIdentIrq = MibTableColumn((1, 3, 6, 1, 4, 1, 3028, 1, 1, 2, 2, 1, 1, 10), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: dlgHiIdentIrq.setStatus('mandatory')
if mibBuilder.loadTexts: dlgHiIdentIrq.setDescription('Dialogic board IRQ (Interrupt) Level. This is the Interrupt Level used by the Dialogic board installed on the system. If the Dialogic board does not use an Interrupt then a value of zero (0) is returned')
dlgHiIdentBoardID = MibTableColumn((1, 3, 6, 1, 4, 1, 3028, 1, 1, 2, 2, 1, 1, 11), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: dlgHiIdentBoardID.setStatus('mandatory')
if mibBuilder.loadTexts: dlgHiIdentBoardID.setDescription('Dialogic board Board Locator ID. This is the Unique Board Locator ID set by the thumbwheel on certain Dialogic boards. This may be used for identification purposes. If the Dialogic board does not have a Unique Board Locator ID setting then a value of negative one (-1) is returned')
dlgHiIdentPCISlotID = MibTableColumn((1, 3, 6, 1, 4, 1, 3028, 1, 1, 2, 2, 1, 1, 12), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: dlgHiIdentPCISlotID.setStatus('mandatory')
if mibBuilder.loadTexts: dlgHiIdentPCISlotID.setDescription('Dialogic board PCI Slot ID. This is a PCI slot identifier where the Dialogic board is installed. This may be used for identification purposes. If the Dialogic board is not a PCI board or if this info is not available then a value of zero (0) is returned')
dlgHiIdentOperStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 3028, 1, 1, 2, 2, 1, 1, 13), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4))).clone(namedValues=NamedValues(("other", 1), ("ok", 2), ("degraded", 3), ("failed", 4)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: dlgHiIdentOperStatus.setStatus('mandatory')
if mibBuilder.loadTexts: dlgHiIdentOperStatus.setDescription('Dialogic board Operational Status. This is the overall condition of the Dialogic board. The following values are defined other(1) The board does not support board condition monitoring. ok(2) The board is operating normally. No user action is required. degraded(3) The board is partially failed. The board may need to be reset. failed(4) The board has failed. The board should be reset NOTE: In the implmentation of this version of the MIB (Major 1, Minor 2), SpanCards do not support the degraded state. ')
dlgHiIdentAdminStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 3028, 1, 1, 2, 2, 1, 1, 14), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6, 7))).clone(namedValues=NamedValues(("other", 1), ("started", 2), ("stopped", 3), ("disabled", 4), ("diagnose", 5), ("start-pending", 6), ("stop-pending", 7)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: dlgHiIdentAdminStatus.setStatus('mandatory')
if mibBuilder.loadTexts: dlgHiIdentAdminStatus.setDescription("Dialogic board Admin Status. This is the Administrative Status of the Dialogic board. The following values are defined other(1) The board's admin status in unavailable. started(2) The board has been started. stopped(3) The board is stopped. disabled(4) The board is disabled. diagnose(5) The board is being diagnosed. start-pending(6) The board is in the process of starting. stop-pending(7) The board is in the process of stopping. ")
dlgHiIdentErrorMessage = MibTableColumn((1, 3, 6, 1, 4, 1, 3028, 1, 1, 2, 2, 1, 1, 15), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 96))).setMaxAccess("readonly")
if mibBuilder.loadTexts: dlgHiIdentErrorMessage.setStatus('mandatory')
if mibBuilder.loadTexts: dlgHiIdentErrorMessage.setDescription('Dialogic board Error Message. This value represents the error message associated with a failing Dialogic board.')
dlgHiIdentDeviceChangeDate = MibTableColumn((1, 3, 6, 1, 4, 1, 3028, 1, 1, 2, 2, 1, 1, 16), OctetString().subtype(subtypeSpec=ValueSizeConstraint(7, 7)).setFixedLength(7)).setMaxAccess("readonly")
if mibBuilder.loadTexts: dlgHiIdentDeviceChangeDate.setStatus('mandatory')
if mibBuilder.loadTexts: dlgHiIdentDeviceChangeDate.setDescription('The date and time the boards operational status last changed. field octets contents range ===== ====== ======= ===== 1 1-2 year 0..65536 2 3 month 1..12 3 4 day 1..31 4 5 hour 0..23 5 6 minute 0..59 6 7 second 0..60 (use 60 for leap-second) This field will be set to year = 0 if the agent cannot provide the module date. The hour, minute, and second field will be set to zero (0) if they are not relevant.')
dlgHiIdentSpecific = MibTableColumn((1, 3, 6, 1, 4, 1, 3028, 1, 1, 2, 2, 1, 1, 17), ObjectIdentifier()).setMaxAccess("readonly")
if mibBuilder.loadTexts: dlgHiIdentSpecific.setStatus('mandatory')
if mibBuilder.loadTexts: dlgHiIdentSpecific.setDescription('A reference to MIB definitions specific to the particular board type specified in the row of the table If this information is not present, its value should be set to the OBJECT IDENTIFIER { 0 0 }, which is a syntatically valid object identifier, and any conformant implementation of ASN.1 and BER must be able to generate and recognize this value.')
dlgHiIdentPCIBusID = MibTableColumn((1, 3, 6, 1, 4, 1, 3028, 1, 1, 2, 2, 1, 1, 18), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: dlgHiIdentPCIBusID.setStatus('mandatory')
if mibBuilder.loadTexts: dlgHiIdentPCIBusID.setDescription('Dialogic board PCI Bus ID. This is a PCI Bus identifier where the Dialogic board is installed. This may be used for identification purposes. If the Dialogic board is not a PCI board or if this info is not available then a value of zero (0) is returned')
dlgHiServiceChanged = NotificationType((1, 3, 6, 1, 4, 1, 3028) + (0,1001)).setObjects(("SNMPv2-MIB", "sysName"), ("DLGHWINF-MIB", "dlgHiIdentServiceStatus"))
if mibBuilder.loadTexts: dlgHiServiceChanged.setDescription('The Dialogic service condition has been changed Description: The dlgHiIdentServiceChanged trap indicates that the Dialogic service has transitioned to either the started or stopped state. This may occur by performing a set on the dlgHiIdentServiceStatus variable or by controlling the service directly on the machine which generated the trap. Action: This trap is informational. A management console may want to update any current device table views since attributes of the device may change when the Dialogic service is started or stopped')
dlgHiboardStatusChanged = NotificationType((1, 3, 6, 1, 4, 1, 3028) + (0,1002)).setObjects(("SNMPv2-MIB", "sysName"), ("DLGHWINF-MIB", "dlgHiIdentIndexForTrap"), ("DLGHWINF-MIB", "dlgHiIdentOperStatusForTrap"), ("DLGHWINF-MIB", "dlgHiIdentAdminStatusForTrap"), ("DLGHWINF-MIB", "dlgHiIdentModelForTrap"), ("DLGHWINF-MIB", "dlgHiIdentSerNumForTrap"), ("DLGHWINF-MIB", "dlgHiIdentErrorMessageForTrap"))
if mibBuilder.loadTexts: dlgHiboardStatusChanged.setDescription('The condition of a Dialogic board has changed to failed or ok Description: The dlgHiIdentboardStatusChanged trap indicates that a device in the device table has transitioned from the ok state to the failed state or vice versa. In general this indicates that on-board firmware has crashed and is no longer responding or that the board has gone bad. Should the board recover from the failed state, the state will be transitioned back to the ok state and a trap will be generated to indicate the board is okay again. Action: If the state has transitioned to the failed then shutdown any active applications and reset the Dialogic service. This will cause the on-board firmware to be re-downloaded. If the problem persists you should run the device diagnostics on the board to make sure it is okay.')
dlgHiNonDlgcServiceChanged = NotificationType((1, 3, 6, 1, 4, 1, 3028) + (0,1003)).setObjects(("SNMPv2-MIB", "sysName"), ("DLGHWINF-MIB", "dlgHiIdentSystemServicesNameForTrap"), ("DLGHWINF-MIB", "dlgHiIdentSystemServicesStatusForTrap"))
if mibBuilder.loadTexts: dlgHiNonDlgcServiceChanged.setDescription('A Dialogic-Related service condition has been changed Description: The dlgHiNonDlgcServiceChanged trap indicates that a Dialogic-Related service (any UNIX Service other than the Dialogic System Service that has dependencies on Dialogic products) has transitioned to either the started or stopped state. This may occur by performing a set on the dlgHiIdentSystemServicesStatus variable or by controlling the service directly on the machine which generated the trap. Action: This trap is informational. A management console may want to update any current device table views since attributes of the device may change when the Dialogic-Related service is started or stopped')
dlgHiTestTrap = NotificationType((1, 3, 6, 1, 4, 1, 3028) + (0,1004)).setObjects(("SNMPv2-MIB", "sysName"))
if mibBuilder.loadTexts: dlgHiTestTrap.setDescription('This trap is to test if the trap sending mechanism is acting properly Description: A managed node will request from the hardware agent to send this trap with the name of the node the agent resides on to the manager. Action: This trap is informational to indicate that the hardware agent is capable of sending traps to the manager.')
mibBuilder.exportSymbols("DLGHWINF-MIB", dlgHiOsLogEnable=dlgHiOsLogEnable, dlgHiIdentServiceChangeDate=dlgHiIdentServiceChangeDate, dlgHiIdentSpecific=dlgHiIdentSpecific, dlgHiIdentType=dlgHiIdentType, dlgHiOsCommonModuleName=dlgHiOsCommonModuleName, dlgHiOsCommonModuleDate=dlgHiOsCommonModuleDate, dlgHiIdentModel=dlgHiIdentModel, dlgHiOsCommon=dlgHiOsCommon, dlgHiIdentFuncDescr=dlgHiIdentFuncDescr, dlgHiIdentPCISlotID=dlgHiIdentPCISlotID, dlgHiIdentFWVers=dlgHiIdentFWVers, dlgHiIdentMemBaseAddr=dlgHiIdentMemBaseAddr, dlgHiNonDlgcServiceChanged=dlgHiNonDlgcServiceChanged, dlgHiOsTestTrapEnable=dlgHiOsTestTrapEnable, dlgHiIdentSystemServicesTable=dlgHiIdentSystemServicesTable, dlgHiIdentFWName=dlgHiIdentFWName, dlgHiMibRevMajor=dlgHiMibRevMajor, dlgHiMibRevMinor=dlgHiMibRevMinor, dlgHiOsCommonModuleIndex=dlgHiOsCommonModuleIndex, dlgHiIdentBoardID=dlgHiIdentBoardID, dlgHiIdentErrorMessageForTrap=dlgHiIdentErrorMessageForTrap, dlgHiOsCommonModuleEntry=dlgHiOsCommonModuleEntry, dlgHiIdentOperStatusForTrap=dlgHiIdentOperStatusForTrap, dlgHiInterface=dlgHiInterface, dlgHiOsCommonNumberOfModules=dlgHiOsCommonNumberOfModules, dlgHiIdentSystemServicesScmName=dlgHiIdentSystemServicesScmName, dlgHiComponent=dlgHiComponent, dlgHiIdentTable=dlgHiIdentTable, dlgHiIdentSystemServicesStatus=dlgHiIdentSystemServicesStatus, dlgHiIdentSystemServicesStatusForTrap=dlgHiIdentSystemServicesStatusForTrap, dlgHiIdentIndex=dlgHiIdentIndex, dlgHiIdentSystemServicesChangeDate=dlgHiIdentSystemServicesChangeDate, dlgHiIdentSystemServicesEntry=dlgHiIdentSystemServicesEntry, dlgHiTestTrap=dlgHiTestTrap, dlgHiIdentSystemServicesNameForTrap=dlgHiIdentSystemServicesNameForTrap, dlgHiIdentErrorMessage=dlgHiIdentErrorMessage, dlgHiIdentNumberOfDevices=dlgHiIdentNumberOfDevices, dlgHiIdentIrq=dlgHiIdentIrq, dlgHiIdentEntry=dlgHiIdentEntry, dlgHiOsCommonModuleTable=dlgHiOsCommonModuleTable, dlgHiIdentIOBaseAddr=dlgHiIdentIOBaseAddr, dlgHiIdentOperStatus=dlgHiIdentOperStatus, dlgHiServiceChanged=dlgHiServiceChanged, dlgHiMibCondition=dlgHiMibCondition, dlgHiIdentAdminStatusForTrap=dlgHiIdentAdminStatusForTrap, dlgHiIdentSerNum=dlgHiIdentSerNum, dlgHiIdentSystemServicesIndex=dlgHiIdentSystemServicesIndex, dlgHiOsCommonModuleVersion=dlgHiOsCommonModuleVersion, dlgHiOsCommonModulePurpose=dlgHiOsCommonModulePurpose, dlgHiboardStatusChanged=dlgHiboardStatusChanged, dlgHiIdentTrapMask=dlgHiIdentTrapMask, dlgHiIdentModelForTrap=dlgHiIdentModelForTrap, dlgHiIdentSerNumForTrap=dlgHiIdentSerNumForTrap, dlgHiIdentPCIBusID=dlgHiIdentPCIBusID, dlgHiIdentSystemServicesName=dlgHiIdentSystemServicesName, dlgHiIdentServiceStatus=dlgHiIdentServiceStatus, dlgHiMibRev=dlgHiMibRev, dlgHiIdentIndexForTrap=dlgHiIdentIndexForTrap, dlgHiIdent=dlgHiIdent, dlgHiOsCommonPollFreq=dlgHiOsCommonPollFreq, dlgHiIdentAdminStatus=dlgHiIdentAdminStatus, dlgHiIdentDeviceChangeDate=dlgHiIdentDeviceChangeDate)
|
primeiraNota = float(input('Informe a primeira nota: '))
segundaNota = float(input('Informe a segunda nota: '))
media = (primeiraNota + segundaNota) / 2
if 9 <= media <= 10:
conceito = 'A'
situacao = 'APROVADO'
elif 7.5 <= media <= 9:
conceito = 'B'
situacao = 'APROVADO'
elif 6 <= media <= 7.5:
conceito = 'C'
situacao = 'APROVADO'
elif 4 <= media <= 6:
conceito = 'D'
situacao = 'REPROVADO'
elif 0 <= media < 4:
conceito = 'E'
situacao = 'REPROVADO'
else:
media = 'Inválida'
conceito = 'Inválida'
situacao = 'Inválida'
print('Informe notas válidas para visualizar média, conceito e situação')
print(f'1º nota: {primeiraNota} - 2º nota: {segundaNota}\n'
f'Média: {media} - Conceito: {conceito} - Situação: {situacao}')
|
class Pricing(object):
def __init__(self, location, event):
self.location = location
self.event = event
def setlocation(self, location):
self.location = location
def getprice(self):
return self.location.getprice()
def getquantity(self):
return self.location.getquantity()
def getdiscount(self):
return self.event.getdiscount()
## and many more such methods
|
class Solution(object):
def sub_two(self, a, b):
if a is None or b is None:
raise TypeError('a or b cannot be None')
result = a ^ b
borrow = (~a & b) << 1
if borrow != 0:
return self.sub_two(result, borrow)
return result |
class Plan():
"""
This is a class for the plans.
"""
def __init__(self, name, price, limit):
"""
The constructor for the Subscription class.
Parameters:
name (str): The plan name.
price (int): The plan price.
limit (int): Allowed nuber of websites.
"""
self.name = name
self.price = price
self.limit = limit
def __repr__(self):
return f'< Plan {self.limit}>'
|
# write a function that accepts a name as input and
# prints out "Hello {name}!"
def greeting(name):
print("Hello " + name + "!")
greeting("Alfred") |
class MetaGetter:
def __init__(self, context):
self.__context = context
def render_width_px(self):
original_width = self.__context.scene.render.resolution_x
return int(original_width * self.__render_size_fraction())
def render_height_px(self):
original_height = self.__context.scene.render.resolution_y
return int(original_height * self.__render_size_fraction())
def spp(self):
return self.__context.scene.ph_render_num_spp
def sample_filter_name(self):
filter_type = self.__context.scene.ph_render_sample_filter_type
if filter_type == "BOX":
return "box"
elif filter_type == "GAUSSIAN":
return "gaussian"
elif filter_type == "MN":
return "mn"
elif filter_type == "BH":
return "bh"
else:
print("warning: unsupported filter type %s, using box BH instead" % filter_type)
return "bh"
def render_method(self):
return self.__context.scene.ph_render_integrator_type
def integrator_type_name(self):
integrator_type = self.__context.scene.ph_render_integrator_type
if integrator_type == "BVPT":
return "bvpt"
elif integrator_type == "BNEEPT":
return "bneept"
else:
print("warning: unsupported integrator type %s, using BVPT instead" % integrator_type)
return "bvpt"
def __render_size_fraction(self):
return self.__context.scene.render.resolution_percentage / 100.0
|
# 024 - Write a Python program to test whether a passed letter is a vowel or not.
def vowelLetter(pLetter):
return pLetter.upper() in 'AEIOU'
print(vowelLetter('A'))
print(vowelLetter('B')) |
def extractTandQ(item):
"""
T&Q
"""
vol, chp, frag, postfix = extractVolChapterFragmentPostfix(item['title'])
if not (chp or vol or frag) or 'preview' in item['title'].lower():
return None
bad = [
'#K-drama',
'fashion',
'C-Drama',
'#Trending',
'Feature',
'#Trailer',
'#Eng Sub',
'Movies',
'Status Updates/Post Tallies',
'Learn Chinese',
'Short Stories',
]
if any([(tmp in item['tags']) for tmp in bad]):
return None
tagmap = [
('Three Kingdoms Online Overlord', 'Three Kingdoms Online Overlord', 'translated'),
('Three Kingdoms Online Overlord | 网游之三国超级领主', 'Three Kingdoms Online Overlord', 'translated'),
('Perfect Fiance', 'Perfect Fiancé', 'translated'),
('Perfect Fiancé | 完美未婚夫', 'Perfect Fiancé', 'translated'),
('Ten Years are not that Far', 'Ten Years are not that Far', 'translated'),
('#Les Interpretes', 'Les Interpretes', 'translated'),
('致我们终将逝去的青春', 'To Our Youth That is Fading Away', 'translated'),
('So Young | 致我们终将逝去的青春', 'To Our Youth That is Fading Away', 'translated'),
("Fleeting Midsummer (Beijing University's Weakest Student)", "Fleeting Midsummer (Beijing University's Weakest Student)", 'translated'),
("Fleeting Midsummer (Peking University's Weakest Student)", "Fleeting Midsummer (Peking University's Weakest Student)", 'translated'),
("Fleeting Midsummer (Peking University's Weakest Student)| 北大差生·", "Fleeting Midsummer (Peking University's Weakest Student)", 'translated'),
("Fleeting Midsummer (Peking University's Weakest Student)| 北大差生", "Fleeting Midsummer (Peking University's Weakest Student)", 'translated'),
('When A Snail Falls in Love| 如果蜗牛有爱情', 'When A Snail Falls in Love', 'translated'),
('The Rebirth of an Ill-Fated Consort | 重生之嫡女祸妃', 'The Rebirth of an Ill-Fated Consort', 'translated'),
('Siege in Fog | 迷雾围城', 'Siege in Fog', 'translated'),
('Pristine Darkness | 他来了请闭眼之暗粼', 'Pristine Darkness', 'translated'),
('Les Interpretes | 亲爱的翻译官', 'Les Interpretes', 'translated'),
('Les Interpretes | 情爱的翻译官', 'Les Interpretes', 'translated'),
('The Daily Record of Secretly Loving the Male Idol|男神暗恋日记', 'The Daily Record of Secretly Loving the Male Idol', 'translated'),
('Master Devil Don\'t Kiss Me', 'Master Devil Don\'t Kiss Me', 'translated'),
('Master Devil Don\'t Kiss Me! | 恶魔少爷别吻我', 'Master Devil Don\'t Kiss Me', 'translated'),
]
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 |
class IntervalStats:
def __init__(self) -> None:
self.interval_duration = 0.0
self.rtt_ratio = 0.0
self.marked_lost_bytes = 0
self.loss_rate = 0
self.actual_sending_rate_mbps = 0
self.ack_rate_mbps = 0
self.avg_rtt = 0.0
self.rtt_dev = 0.0
self.min_rtt = -1.0
self.max_rtt = -1.0
self.approx_rtt_gradient = 0
self.rtt_gradient = 0
self.rtt_gradient_cut = 0
self.rtt_gradient_error = 0
self.trending_gradient = 0
self.trending_gradient_cut = 0
self.trending_gradient_error = 0
self.trending_deviation = 0
class UtilityManager:
# Exponent of sending rate contribution term in Vivace utility function.
kSendingRateExponent = 0.9
# Coefficient of loss penalty term in Vivace utility function.
kVivaceLossCoefficient = 11.35
# Coefficient of latency penalty term in Vivace utility function.
kLatencyCoefficient = 900.0
def __init__(self, utility_tag: str = "vivace") -> None:
self.utility_tag = utility_tag
self.interval_stats = IntervalStats()
def calculate_utility(self, mi, event_time: float) -> float:
# TODO: compute interval stats
utility = 0.0
if self.utility_tag == "Vivace":
utility = self.calculate_utility_vivace(mi)
else:
raise RuntimeError
return utility
def calculate_utility_vivace(self, mi) -> float:
return self.calculate_utility_proportional(
mi, self.kLatencyCoefficient, self.kVivaceLossCoefficient)
def calculate_utility_proportional(self, mi, latency_coefficient: float,
loss_coefficient: float) -> float:
sending_rate_contribution = pow(self.interval_stats.actual_sending_rate_mbps, self.kSendingRateExponent)
rtt_gradient = 0.0 if is_rtt_inflation_tolerable_ else self.interval_stats.rtt_gradient
if (mi.rtt_fluctuation_tolerance_ratio > 50.0 and
abs(rtt_gradient) < 1000.0 / self.interval_stats.interval_duration):
rtt_gradient = 0.0
if rtt_gradient < 0:
rtt_gradient = 0.0
latency_penalty = latency_coefficient * rtt_gradient * self.interval_stats.actual_sending_rate_mbps
loss_penalty = loss_coefficient * self.interval_stats.loss_rate * self.interval_stats.actual_sending_rate_mbps
return sending_rate_contribution - latency_penalty - loss_penalty
|
nome = str(input('Digite seu nome completo: '))
nome = nome.strip()
print('Seu nome é {}'.format(nome))
print('O seu nome com todas as letras maiúsculas é: {}'.format(nome.upper()))
print('O seu nome com todas as letras minúsculas é: {}'.format(nome.lower()))
n1 = nome.split()
print('Seu nome completo tem {} letras!'.format(len(''.join(n1))))
print('Seu primeiro nome tem {} letras!'.format(len(n1[0])))
|
velhomasc = ''
listmasc = []
media = 0
mulheres = 0
for c in range(1, 5):
print('-' * 5, f'{c}º PESSOA', '-' * 5)
nome = str(input('Nome: '))
idade = int(input('Idade: '))
sexo = str(input('Sexo [M/F]: ')).upper().strip()
media += idade
if sexo == 'M':
listmasc += [idade]
velhomasc = nome
else:
if idade < 20:
mulheres += 1
print(f'A média de idade do grupo é de {media / 4} anos')
print(f'O homem mais velho tem {max(listmasc)} anos e se chama {velhomasc}')
print(f'Ao todo são {mulheres} mulheres com menos de 20 anos') |
# Python3 Total Ways to arrange coins {1, 3, 5} to Sum Upto N
# Using Recursion
def Arrangement(N):
if N < 0:
return 0
if N == 0:
return 1
return Arrangement(N-1) + Arrangement(N-3) + Arrangement(N-5)
# Using DP
dp = [None for _ in range(10001)]
def Arrangement_DP(n):
if n < 0:
return 0
if n == 0:
return 1
if dp[n]:
return dp[n]
dp[n] = Arrangement_DP(n-1) + Arrangement_DP(n-3) + Arrangement_DP(n-5)
return dp[n]
print(Arrangement(10))
print(Arrangement_DP(500)) |
def ex2():
rs = np.random.RandomState(112)
x=np.linspace(0,10,11)
y=np.linspace(0,10,11)
X,Y = np.meshgrid(x,y)
X=X.flatten()
Y=Y.flatten()
weights=np.random.random(len(X))
plt.hist2d(X,Y,weights=weights); #The semicolon here avoids that Jupyter shows the resulting arrays
|
"""Module with util funcs for testing."""
def assert_raises(exception, func, *args, **kwargs) -> None:
"""Check whether calling func(*args, **kwargs) raises exeption.
Parameters
----------
exception : Exception
Exception type.
func : callable
Method to be run.
"""
try:
func(*args, **kwargs)
except exception:
pass
|
def change_data(x):
if x < 0 or x >255:
return None
elif 200 <= x <=255:
return int(round((x - 200) * 3 / 11.0 + 85, 0))
elif 0 <= x <=130:
return int(round(x * 6 / 13.0, 0))
else:
return int(round((x - 131) * 23 / 68.0 + 61, 0))
if __name__ == '__main__':
print('-1 => ' + str(change_data(-1)))
print('0 => ' + str(change_data(0)))
print('55 => ' + str(change_data(55)))
print('131 => ' + str(change_data(131)))
print('255 => ' + str(change_data(255)))
'''
-1 => None
0 => 0
55 => 25
131 => 61
255 => 100
'''
|
n, x = map(int, input().split())
s = str(input())
for e in s:
if e == "o":
x += 1
else:
x -= 1
if x < 0:
x = 0
print(x)
|
cont = soma = 0
while True:
nota = float(input())
if nota < 0 or nota > 10:
print('nota invalida')
else:
soma += nota
cont += 1
if cont == 2:
break
print('media = {}'.format(soma / cont)) |
template = """
/****************************************************************************
* ${name}.sv
****************************************************************************/
module ${name}(
${ports}
);
${wires}
${port_wire_assignments}
${interconnects}
endmodule
"""
|
src = Split('''
awss.c
enrollee.c
sha256.c
zconfig_utils.c
zconfig_ieee80211.c
wifimgr.c
ywss_utils.c
zconfig_ut_test.c
registrar.c
zconfig_protocol.c
zconfig_vendor_common.c
''')
component = aos_component('ywss', src)
component.add_macros('DEBUG')
component.add_global_macros('CONFIG_YWSS') |
numeros = []
while True:
x = int(input('Digite um valor:'))
if x not in numeros:
numeros.append(x)
else:
print(f'O Numero digitado {x} já esta na lista e não será incluido!')
stop = str(input('Deseja continuar? [S/N]')).upper().strip()[0]
while stop not in 'SN':
stop = str(input('Opção invalida, Deseja continuar? [S/N]')).upper().strip()[0]
if stop == 'N':
break
print('-'*40)
numeros.sort()
print(f'Os Valores digitados foram {numeros}')
print('-'*40) |
#!/usr/bin/env python
# coding: utf-8
# # **Estruturas de controle condicionais**
#
# > São estruturas para controlar o fluxo do programa
#
# Vamos utilizar os famosos SE e SENÃO.
#
# Em Python a estrutura é bem simples, comparado a outras linguagens, mas antes considere esse fluxograma:
#
# 
#
# **Vamos transcrever ele em Python**
# In[ ]:
# SE em Python é if
# SENÃO em Python é else
n1 = float(input('Digite a primeira nota: '))
n2 = float(input('Digite a segunda nota: '))
media = (n1 + n2) / 2
if media >= 6: #Retornar True ou False
print(f'Aluno aprovado com a média: {media}')
else:
print(f'Aluno reprovado com a média: {media}')
print('Fim do programa!')
# # **Exercícios**
# ## Exercício 01
#
# Faça um programa que pergunte ao usuário um número e valide se o numero é par ou impar:
#
# * Crie uma variável para receber o valor, com conversão para int
# * Para um número ser par, a divisão dele por 2 tem que dar resto 0
# In[ ]:
# Resposta
numero = int(input('Digite o numero: '))
if numero % 2 == 0:
print('Numero par')
else:
print('Numero impar')
# ## Exercício 02
#
# > Parte 1
#
# Faça um script que peça um valor e mostre na tela se o valor é positivo ou negativo.
#
# > Parte 2
#
# Agora implemente a funcionalidade de não aceitar o número 0, no input.
# In[ ]:
# Resposta Parte 1
valor = int(input('Valor: '))
if valor > 0:
print('Valor positivo')
else:
print('Valor negativo')
# In[ ]:
# Resposta Parte 2
valor = int(input('Digite o valor: '))
if valor == 0:
print('Número inválido!')
else:
if valor > 0:
print('Numero positivo')
else:
print('Numero negativo')
print('Programa finalizado!')
# # **IF aninhado**
#
# Nesse último exercício a gente precisou utilizar dois if e else para resolver nosso problema, isso se chama If aninhado, vamos continuar treinando esse tipo de if com os exercícios abaixo:
# # **Exercícios**
# ## Exercício 03
#
# Faça um programa que peça dois números, imprima o maior deles ou imprima "Numeros iguais" se os números forem iguais.
# In[ ]:
num1 = int(input('Digite o primeiro numero: '))
num2 = int(input('Digite o segundo numero: '))
if num1 > num2:
print(f'O numero {num1} é o maior')
else:
if num1 == num2:
print("Os numeros são iguais!")
else:
print(f'O numero {num2} é o maior')
# ## Exercício 04
#
# Crie um programa que verifique se uma letra digitada é "F" ou "M". Conforme a letra escrever: F - Feminino, M - Masculino, caso escreva outra letra: Sexo Inválido.
#
# In[ ]:
resposta = input('Digite M ou F: ').upper()
if resposta == 'M':
print('Masculino')
else:
if resposta == 'F':
print('Feminino')
else:
print('Você não digitou as letras correta!')
# # **ELIF**
#
# > O If serve para verificar uma condição e o elif serve para verificar outra condição caso a condição do If seja falsa. No código não há muita diferença, o elif vai garantir que aquela condição seja verificada caso o If seja falso, diferente dos dois If que são 'fluxos' independentes.
#
# Vamos refazer o exemplo da média adicionando a condição de "Aluno em recuperação"
# In[ ]:
n1 = float(input('Digite a primeira nota: '))
n2 = float(input('Digite a segunda nota: '))
media = (n1 + n2) / 2
if media >= 6:
print(f'Aluno aprovado com a média {media}')
elif media >= 4 and media < 6:
print(f'Aluno está de recuperação com a média {media}')
else:
print(f'Aluno reprovado com a média {media}')
# # **Exercícios**
# ## Exercício 05
#
# Crie um programa em Python que peça a nota do aluno, que deve ser um float entre 0.00 e 10.0
#
# * Se a nota for menor que 6.0, deve exibir a nota F.
#
# * Se a nota for de 6.0 até 7.0, deve exibir a nota D.
#
# * Se a nota for entre 7.0 e 8.0, deve exibir a nota C.
#
# * Se a nota for entre 8.0 e 9.0, deve exibir a nota B.
#
# * Por fim, se for entre 9.0 e 10.0, deve exibir um belo de um A.
# In[ ]:
nota = float(input('Qual a nota [0.0 - 10.00]: '))
if nota >= 0 and nota <= 10:
if nota < 6:
print('Nota F')
elif nota < 7:
print('Nota D')
elif nota < 8:
print('Nota C')
elif nota < 9:
print('Nota B')
else:
print('Nota A')
else:
print('Nota inválida!')
# # *Projetos*
# ## **PROJETO 01**
#
# * Escreva um programa que receba uma string digitada pelo usuário;
# * Caso a string seja "medieval", exiba no console "espada";
# * Caso contrário, se a string for "futurista", exiba no console "sabre de luz";
# * Caso contrário, exiba no console "Tente novamente"
# In[ ]:
# Resposta:
arma = input('Que tipo de arma vc quer usar? Medieval ou Futurista?').upper()
if arma == ('MEDIEVAL'):
print ('Você usará uma ESPADA como arma. BOA SORTE!')
else:
if arma == ('FUTURISTA'):
print ('Você usará um SABRE DE LUZ como arma. BOA SORTE!')
else:
print('Você digitou uma opção inválida :[. TENTE DE NOVO!')
# ## **PROJETO 02**
#
# * Escreva um programa que receba um ataque de espada ou sabre digitada pelo usuário;
#
# * Caso o ataque seja "espada", exiba no console "VOCÊ AINDA NÃO MATOU O CHEFÃO";
#
# * Caso contrário, se o ataque for "sabre", exiba no console "VOCÊ DERROTOU O CHEFÃO COM O SABRE DE LUZ";
#
# * Caso contrário, exiba no console "ATAQUE NOVAMENTE"
# In[ ]:
# Resposta:
arma = input('Qual arma vc quer usar? Espada ou Sabre de Luz?').upper()
if arma == ('ESPADA'):
print ('VOCÊ AINDA NÃO MATOU O CHEFÃO :[')
else:
if arma == ('SABRE DE LUZ'):
print ('VOCÊ DERROTOU O CHEFÃO COM O SABRE DE LUZ')
else:
print('ATAQUE NOVAMENTE')
# ## **PROJETO 03 - DESAFIO**
#
# As empresas @.com resolveram dar um aumento de salário aos seus colaboradores e lhe contrataram para desenvolver o programa que calculará os reajustes.
#
# Faça um programa que recebe o salário de um colaborador e o reajuste segundo o seguinte critério, baseado no salário atual:
# * salários até R$ 280,00 (incluindo) : aumento de 20%
#
# * salários entre R\$ 280,00 e R$ 700,00 : aumento de 15%
#
# * salários entre R\$ 700,00 e R$ 1500,00 : aumento de 10%
#
# * salários de R$ 1500,00 em diante : aumento de 5%
#
# Após o aumento ser realizado, informe na tela:
# * o salário antes do reajuste;
#
# * o percentual de aumento aplicado;
#
# * o valor do aumento;
#
# * o novo salário, após o aumento."
# In[11]:
# Resposta:
salário = float(input('Digite o valor do seu salário:'))
if salário <= 280:
percent1 = 20/100
cal1 = salário*percent1
n1 = salário+cal1
print(f'Seu salário antes do reajuste é: R${salário}')
print('o percentual de aumento aplicado foi de 20%')
print(f'o valor do aumento foi de: R${cal1}')
print(f'o novo salário, após o aumento será de: R${n1}')
else:
if salário > 280 and salário <= 700:
percent2 = 15/100
cal2 = salário*percent2
n2 = salário+cal2
print(f'Seu salário antes do reajuste é: R${salário}')
print('o percentual de aumento aplicado foi de 15%')
print(f'o valor do aumento foi de: R${cal2}')
print(f'o novo salário, após o aumento será de: R${n2}')
else:
if salário > 700 and salário <= 1500:
percent3 = 10/100
cal3 = salário*percent3
n3 = salário+cal3
print(f'Seu salário antes do reajuste é: R${salário}')
print('o percentual de aumento aplicado foi de 10%')
print(f'o valor do aumento foi de: R${cal3}')
print(f'o novo salário, após o aumento será de: R${n3}')
else:
if salário > 1500:
percent4 = 5/100
cal4 = salário*percent4
n4 = salário+cal4
print(f'Seu salário antes do reajuste é: R${salário}')
print('o percentual de aumento aplicado foi de 5%')
print(f'o valor do aumento foi de: R${cal4}')
print(f'o novo salário, após o aumento será de: R${n4}')
# ## **PROJETO 04 - DESAFIO**
#
# Faça um Programa para um caixa eletrônico. O programa deverá perguntar ao usuário a valor do saque e depois informar quantas notas de cada valor serão fornecidas. As notas disponíveis serão as de 1, 5, 10, 50 e 100 reais. O valor mínimo é de 10 reais e o máximo de 600 reais. O programa não deve se preocupar com a quantidade de notas existentes na máquina.
#
# * Exemplo 1: Para sacar a quantia de 256 reais, o programa fornece duas notas de 100, uma nota de 50, uma nota de 5 e uma nota de 1;
#
# * Exemplo 2: Para sacar a quantia de 399 reais, o programa fornece três notas de 100, uma nota de 50, quatro notas de 10, uma nota de 5 e quatro notas de 1.
# In[9]:
#ORIGINAL
print('As notas disponíveis são: 1, 5, 10, 50 e 100')
print('Valor minimo: R$ 10. Valor máximo: R$ 600.')
valor = int(input('Valor do saque: R$ '))
if valor == 600:
print('6 notas de R$ 100')
elif valor < 600 and valor >= 100:
cal1 = valor//100
resto1 = valor%100
if resto1 == 0:
print(f'{cal1} nota(s) de R$ 100')
else:
cal2 = resto1//50
resto2 = resto1%50
if resto2 == 0:
print(f'{cal1} nota(s) de R$ 100')
print(f'{cal2} nota(s) de R$ 50')
else:
cal3 = resto2//10
resto3 = resto2%10
if resto3 == 0:
print(f'{cal1} nota(s) de R$ 100')
if cal2 >0:
print(f'{cal2} nota(s) de R$ 50')
print(f'{cal3} nota(s) de R$ 10')
else:
cal4 = resto3//5
resto4 = resto3%5
if resto4 == 0:
print(f'{cal1} nota(s) de R$ 100')
print(f'{cal2} nota(s) de R$ 50')
print(f'{cal3} nota(s) de R$ 10')
print(f'{cal4} nota(s) de R$ 5')
else:
cal5 = resto4//1
resto5 = resto4%1
if resto5 == 0:
print(f'{cal1} nota(s) de R$ 100')
if cal2>0:
print(f'{cal2} nota(s) de R$ 50')
if cal3 >0:
print(f'{cal3} nota(s) de R$ 10')
if cal4 >0:
print(f'{cal4} nota(s) de R$ 5')
if cal5>0:
print(f'{cal5} nota(s) de R$ 1')
elif valor < 100 and valor >= 50:
cal1 = valor//50
resto1 = valor%50
if resto1 == 0:
print(f'{cal1} nota(s) de 50 R$')
else:
cal2 = resto1//10
resto2 = resto1%10
if resto2 == 0:
print(f'{cal1} nota(s) de R$ 50')
print(f'{cal2} nota(s) de R$ 10')
else:
cal3 = resto2//5
resto3 = resto2%5
if resto3 == 0:
print(f'{cal1} nota(s) de R$ 50')
print(f'{cal2} nota(s) de R$ 10')
print(f'{cal3} nota(s) de R$ 5')
else:
cal4 = resto3//1
resto4 = resto3%1
if resto4 == 0:
print(f'{cal1} nota(s) de R$ 50')
if cal2 >0:
print(f'{cal2} nota(s) de R$ 10')
if cal3 >0:
print(f'{cal3} nota(s) de R$ 5')
if cal4>0:
print(f'{cal4} nota(s) de R$ 1')
elif valor <50 and valor >= 10:
cal1 = valor//10
resto1 = valor%10
if resto1 == 0:
print(f'{cal1} nota(s) de R$ 10')
else:
cal2 = resto1//5
resto2 = resto1%5
if resto2 == 0:
print(f'{cal1} nota(s) de R$ 10')
print(f'{cal2} nota(s) de R$ 5')
else:
cal3 = resto2//1
resto3 = resto2%1
if resto3 == 0:
print(f'{cal1} nota(s) de R$ 10')
if cal2 >0:
print(f'{cal2} nota(s) de R$ 5')
if cal3 >0:
print(f'{cal3} nota(s) de R$ 1')
elif valor <10 and valor >=5:
cal1 = valor//5
resto1 = valor%5
if resto1 == 0:
print(f'{cal1} nota(s) de R$ 5')
else:
cal2 = resto1//1
resto2 = resto1%1
if resto2 == 0:
print(f'{cal1} nota(s) de R$ 5')
print(f'{cal2} nota(s) de R$ 1')
# In[ ]:
|
class Settings:
base_url = "https://compass.scouts.org.uk"
date_format = "%d %B %Y" # dd Month YYYY
org_number = 10000001
total_requests = 0
wcf_json_endpoint = "/JSon.svc" # Windows communication foundation JSON service endpoint
web_service_path = base_url + wcf_json_endpoint
|
def say_hello():
return "hello"
|
def searchRange(nums, target):
start, end = -1, -1
lo, hi = 0, len(nums)-1
while lo <= hi:
mid = (lo+hi)//2
if nums[mid] == target and (mid == 0 or nums[mid-1] != target):
start = mid
break
elif nums[mid] < target:
lo = mid+1
elif nums[mid] >= target:
hi = mid-1
if start == -1: return [-1, -1]
lo, hi = 0, len(nums)-1
while lo <= hi:
mid = (lo+hi)//2
if nums[mid] == target and (mid == len(nums)-1 or nums[mid+1] != target):
end = mid
break
elif nums[mid] <= target:
lo = mid+1
elif nums[mid] > target:
hi = mid-1
if end == -1: return [-1, -1]
return [start, end]
print(searchRange([5, 7, 7, 8, 8, 10], 8))
print(searchRange([5, 7, 7, 8, 8, 10], 6))
print(searchRange([5, 5, 5, 5, 6, 7], 5))
print(searchRange([0, 1, 5, 5, 5, 5], 5)) |
start,end=input().split()
edges=[("ab",1),("ac",1),("be",3),("cd",1),("de",1),("df",2),("eg",1),("fg",1),("ba",1),("ca",1),("eb",3),("dc",1),("ed",1),("fd",2),("ge",1),("gf",1)]
paths=[(start,0)]
while True:
new_paths=paths
for (path,T) in paths:
for (edge,t) in edges:
if path[-1]==edge[0] and edge[1] not in path:
if (path+edge[1],T+t) not in new_paths:
new_paths.append((path+edge[1],T+t))
if len(new_paths)!=len(paths):
paths=new_paths
else:
break
best_time=100
for (path,T) in paths:
if path[-1]==end:
if T<best_time:
best_time=T
best_path=path
print(best_path)
|
# OpenWeatherMap API Key
weather_api_key = "972fc242a771ca44611f48d634a9e967"
# Google API Key
g_key = "AIzaSyCWD-Z7WINc53d-5orJ46Zg3qVZN1UK0ho"
|
class ListNode:
def __init__(self,x):
self.val = x
self.next = None
class Solution:
def hasCycle(self,head):
# type head: ListNode
# rtype: bool
fast, slow = head, head
while fast and fast.next:
fast = fast.next.next
slow = slow.next
if fast == slow:
return True
return False
def buildLinkedList(self,s):
# type s: integer array
# rtype: ListNode
if len(s) == 0:
return None
i = 1
head = ListNode(s[0])
run = head
while i < len(s):
node = ListNode(s[i])
run.next = node
run = node
i += 1
return head
def printLinkedList(self,head):
# type head: ListNode
# rtype: None
run = head
while run != None:
print(run.val)
run = run.next
s= [1,2]
solution = Solution()
s = solution.buildLinkedList(s)
print(solution.hasCycle(s))
|
#Exercicio 50
s = 0
for c in range(1, 7):
n = int(input(f'Escolha o {c}° número: '))
if n % 2 == 0:
s = s + n
print(f'A soma entre os números pares entre esses números escolhidos vai ser igual a {s}')
|
class Solution:
# @param A, a list of integer
# @return an integer
def singleNumber(self, A):
num = A[0]
for number in A[ 1 : ]:
num = num ^ number
return num |
def count_3_in_time(n):
# 00:00:00 ~ n:59:59
count = 0
for hrs in range(0, n + 1):
for min in range(0, 60):
for sec in range(0, 60):
if -1 != str(hrs).find('3') or -1 != str(min).find('3') or -1 != str(sec).find('3'):
count += 1
return count
def main():
n = int(input())
count = count_3_in_time(n)
print(count)
if __name__ == '__main__':
main()
|
# Given a binary tree, return all root-to-leaf paths.
# Note: A leaf is a node with no children.
# Example:
# Input:
# 1
# / \
# 2 3
# \
# 5
# Output: ["1->2->5", "1->3"]
# Explanation: All root-to-leaf paths are: 1->2->5, 1->3
# Definition for a binary tree node.
# class TreeNode(object):
# def __init__(self, x):
# self.val = x
# self.left = None
# self.right = None
class Solution(object):
def binaryTreePaths(self, root):
"""
:type root: TreeNode
:rtype: List[str]
"""
# bfs
if not root: return []
res, stack = [],[(root,"")]
while stack:
node, ans = stack.pop()
if not node.left and not node.right:
res.append(ans + str(node.val))
if node.left:
stack.append((node.left, ans + str(node.val) + "->"))
if node.right:
stack.append((node.right, ans + str(node.val) + "->"))
return res
def binaryTreePaths2(self, root):
"""
:type root: TreeNode
:rtype: List[str]
"""
# dfs
if not root: return []
anslist = []
def dfs(root, ans = ""):
ans += str(root.val)
if not root.left and not root.right:
anslist.append(ans)
return
ans += "->"
if root.left: dfs(root.left, ans)
if root.right: dfs(root.right, ans)
dfs(root)
return anslist
# Time: O(m+n)
# Space: O(m+n)
# Difficulty: easy |
def last_index(pattern):
wave_list = pattern.wave_list
number_of_elements = len(wave_list)
return number_of_elements
|
def code(st, syntax = ""): return f"```{syntax}\n{st}```"
def md(st): return code(st, "md")
def diff(st): return code(st, "diff")
|
class AuthStatusError(Exception):
""" Auth status error
"""
pass
|
def IDW(Z, b):
"""
Inverse distance weighted interpolation.
Input
Z: a list of lists where each element list contains
four values: X, Y, Value, and Distance to target
point. Z can also be a NumPy 2-D array.
b: power of distance
Output
Estimated value at the target location.
"""
zw = 0.0 # sum of weighted z
sw = 0.0 # sum of weights
N = len(Z) # number of points in the data
for i in range(N):
d = Z[i][3]
if d == 0:
return Z[i][2]
w = 1.0/d**b
sw += w
zw += w*Z[i][2]
return zw/sw
|
"""
Query
=====
This is the query package.
"""
|
def maxSum(a, b, k, n):
a.sort()
b.sort()
i = 0
j = n - 1
while i < k:
if (a[i] < b[j]):
a[i], b[j] = b[j], a[i]
else:
break
i += 1
j -= 1
sum = 0
for i in range (n):
sum += a[i]
return(sum)
tc = int(input())
for i in range(tc):
kn = input()
l = list(kn.split(' '))
l = list(map(int,l))
#print(tc,kn,l)
k = l[1]
n = l[0]
a1 = input()
b1 = input()
a = list(a1.split(' '))
b = list(b1.split(' '))
a = list(map(int,a))
b = list(map(int,b))
print(maxSum(a, b, k, n))
|
def aumentar(n=0, porc=0):
"""
-> Calcula o aumento de um valor, utilizando porcentagem pré-determinada
:param n: (opcional) Número a ser aumentado
:param porc: (opcional) Porcentagem a ser utilizada
:return: (opcional) Retorna 'n' mais 'porc' porcento, ex: 10 + 20%
"""
return n * (1 + porc/100)
def diminuir(n=0, porc=0):
"""
-> Retorna um valor com um desconto pré-determinado
:param n: (opcional) Números a receber o desconto
:param porc: (opcional) Porcentagem a se descontada
:return: Retorna o valor 'n' com o desconto
"""
return n * (1 - porc/100)
def dobro(n=0):
"""
-> Retorna o dobro do valor inserido
:param n: (opcional) Número a ter seu valor dobrado
:return: Retorna o dobro de 'n'
"""
return n*2
def metade(n=0):
"""
-> Retorna metade do valor inserido
:param n: (opcional) Número a ser dividido
:return: Retorna metade de 'n'
"""
return n/2
def moeda(n=0, moeda='R$'):
"""
-> Formata os valores monetários
:param n: (opcional) Valor a ser formatado
:param moeda: (opcional) Moeda a ser utilizado na formatação
:return: Valor 'n' formatado
"""
return f'{moeda}{n:.2f}'.replace('.', ',')
|
def fib(n):
first=0
second=1
overall=0
if n==0:
return 0
elif n==1:
return 1
else:
for i in range(1,n):
overall=second+first
first=second
second=overall
return overall
def productFib(num):
n=1
append_array=[]
while True:
if fib(n)*fib(n-1)==num:
append_array=[fib(n-1),fib(n),bool(True)]
break;
elif fib(n)*fib(n-1)>num:
append_array=[fib(n-1),fib(n),bool(False)]
break;
n+=1
return(append_array) |
number = 600851475143
def isPrime(n):
for i in range(2, n):
if n % i == 0 and i != n:
return False
return True
def LargestPrimeFactor(n):
_n, lpf = n, 0
for i in range(2, n):
if isPrime(i) and n % i == 0:
_n, lpf = _n/i, i
print(i, end=', ')
if _n == 1:
break
print(lpf)
return
LargestPrimeFactor(number)
|
"""
This file provides all error codes for the program.
"""
ERR_OK = 0
WARN_OK = 0
ERR_MISSING_ARGUMENT = 100
ERR_MISMATCHED_FORMAT = 101
ERR_MISMATCHED_PLATFORM = 102
ERR_UNKNOWN_PLATFORM = 103
ERR_MISMATCHED_ARGUMENT = 104
ERR_UNKNOWN_ARGUMENT = 105
WARN_IMPLICIT_FORMAT = 200
WARN_MODULE_NOT_FOUND = 201
WARN_MOD_NOT_FOUND = 202
WARN_KEY_NOT_FOUND = 203
WARN_MAPPING_NOT_FOUND = 204
WARN_CORRUPTED_MAPPING = 205
WARN_DUPLICATED_FILE = 206
WARN_UNKNOWN_MOD_FILE = 207
WARN_BROKEN_MODULE = 250
WARN_UNKNOWN_MODULE = 251
WARN_LOOP_COLLECTION = 252
WARN_DEPRECATED_MODULE_CONTENT = 253
WARN_MISSING_CLASSIFIER = 254
|
# Title : TODO
# Objective : TODO
# Created by: Wenzurk
# Created on: 2018/2/5
# for value in range(1,5):
# print(value)
# for value in range(1,6):
# print(value)
numbers = list(range(1,6))
print(numbers) |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Решите задачу: создайте словарь, связав его с переменной school , и наполните данными,
# которые бы отражали количество учащихся в разных классах (1а, 1б, 2б, 6а, 7в и т. п.).
# Внесите изменения в словарь согласно следующему: а) в одном из классов изменилось
# количество учащихся, б) в школе появился новый класс, с) в школе был расформирован
# (удален) другой класс. Вычислите общее количество учащихся в школе.
if __name__ == '__main__':
school = {'1а': 20, '1б': 17, '2а': 18, '2б': 23, '3a': 24, '3б': 22, '4а': 25, "4б": 27}
while True:
print('change - Изменилось количество учеников:')
print('new - В школе появился новый класс')
print('remove - В школе был расформирован (удален) класс')
print('print - Выгрузка данных')
print('sum - Число учеников')
print('exit - Выход')
n = input('Введите название операции >>> ')
if n == 'change':
school.update({input(f'Название изменяемого класса: '):
int(input(f'Количество учеников изменяемого класса: '))})
elif n == 'new':
school.update({input(f'Название класса №: '): int(input(f'Количество учеников класса №: '))})
elif n == 'remove':
del school[input(f'Название расформировываемого класса: ')]
elif n == 'print':
print(school)
elif n == 'sum':
print(sum(school.values()))
elif n == 'exit':
break |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Author : Jinyuan Sun
# @Time : 2022/3/31 6:17 PM
# @File : aa_index.py
# @annotation : define properties of amino acids
ALPHABET = "QWERTYIPASDFGHKLCVNM"
hydrophobic_index = {
'R': -0.9,
'K': -0.889,
'D': -0.767,
'E': -0.696,
'N': -0.674,
'Q': -0.464,
'S': -0.364,
'G': -0.342,
'H': -0.271,
'T': -0.199,
'A': -0.171,
'P': 0.055,
'Y': 0.188,
'V': 0.331,
'M': 0.337,
'C': 0.508,
'L': 0.596,
'F': 0.646,
'I': 0.652,
'W': 0.9
}
volume_index = {
'G': -0.9,
'A': -0.677,
'S': -0.544,
'C': -0.359,
'T': -0.321,
'P': -0.294,
'D': -0.281,
'N': -0.243,
'V': -0.232,
'E': -0.058,
'Q': -0.02,
'L': -0.009,
'I': -0.009,
'M': 0.087,
'H': 0.138,
'K': 0.163,
'F': 0.412,
'R': 0.466,
'Y': 0.541,
'W': 0.9
}
helix_tendency = {
'P': -0.9,
'G': -0.9,
'C': -0.652,
'S': -0.466,
'T': -0.403,
'N': -0.403,
'Y': -0.155,
'D': -0.155,
'V': -0.031,
'H': -0.031,
'I': 0.155,
'F': 0.155,
'W': 0.279,
'K': 0.279,
'Q': 0.528,
'R': 0.528,
'M': 0.652,
'L': 0.714,
'E': 0.9,
'A': 0.9
}
sheet_tendency = {
'G': -0.9,
'D': -0.635,
'E': -0.582,
'N': -0.529,
'A': -0.476,
'R': -0.371,
'Q': -0.371,
'K': -0.265,
'S': -0.212,
'H': -0.106,
'L': -0.053,
'M': -0.001,
'P': 0.106,
'T': 0.212,
'F': 0.318,
'C': 0.476,
'Y': 0.476,
'W': 0.529,
'I': 0.688,
'V': 0.9
}
class_type_dict = {
'_small': 'GAVSTC',
'_large': 'FYWKRHQE',
'_neg': 'DE',
'_pos': 'RK',
'_polar': 'YTSHKREDQN',
'_non_charged_polar': 'YTSNQH',
'_hydrophobic': 'FILVAGMW',
'_cys': "C",
'_pro': 'P',
'_scan': 'ARNDCQEGHILKMFPSTWYV'
}
|
class DefaultTokenizer:
def __init__(self, prefixes, suffixes, infixes, exceptions):
self.prefixes = prefixes
self.suffixes = suffixes
self.infixes = infixes
self.exceptions = exceptions
def __call__(self, text: str):
return text.split(" ")
|
for i in range(1, 21):
if i % 3 == 0:
print("Fizz")
else:
print(i)
|
cutoff = 20
decision_cutoff = .25
model_path = 'ml/overwatch_messages.model'
vectorizer_path = 'ml/overwatch_messages.vectorizer'
|
#!/usr/bin/env python
# __author__ = "Ronie Martinez"
# __copyright__ = "Copyright 2019-2020, Ronie Martinez"
# __credits__ = ["Ronie Martinez"]
# __maintainer__ = "Ronie Martinez"
# __email__ = "[email protected]"
def calculate_amortization_amount(principal, interest_rate, period):
"""
Calculates Amortization Amount per period
:param principal: Principal amount
:param interest_rate: Interest rate per period
:param period: Total number of periods
:return: Amortization amount per period
"""
x = (1 + interest_rate) ** period
return principal * (interest_rate * x) / (x - 1)
|
def clean_xml_indentation(element, level=0, spaces_per_level=2):
"""
copy and paste from http://effbot.org/zone/elementent-lib.htm#prettyprint
it basically walks your tree and adds spaces and newlines so the tree is
printed in a nice way
"""
i = "\n" + level*spaces_per_level*" "
if len(element):
if not element.text or not element.text.strip():
element.text = i + spaces_per_level*" "
if not element.tail or not element.tail.strip():
element.tail = i
for sub_element in element:
clean_xml_indentation(sub_element, level+1, spaces_per_level)
if not sub_element.tail or not sub_element.tail.strip():
sub_element.tail = i
else:
if level and (not element.tail or not element.tail.strip()):
element.tail = i
|
# -*- coding: utf-8 -*-
"""Top-level package for dsn_3000."""
__author__ = """Shannon-li"""
__email__ = '[email protected]'
__version__ = '0.1.0'
|
#
# PySNMP MIB module Juniper-SUBSCRIBER-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/JUNIPER-SUBSCRIBER-MIB
# Produced by pysmi-0.3.4 at Wed May 1 14:01:13 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 (default, Mar 27 2019, 09:23:15)
#
OctetString, Integer, ObjectIdentifier = mibBuilder.importSymbols("ASN1", "OctetString", "Integer", "ObjectIdentifier")
NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues")
ConstraintsIntersection, SingleValueConstraint, ValueSizeConstraint, ConstraintsUnion, ValueRangeConstraint = mibBuilder.importSymbols("ASN1-REFINEMENT", "ConstraintsIntersection", "SingleValueConstraint", "ValueSizeConstraint", "ConstraintsUnion", "ValueRangeConstraint")
InterfaceIndex, = mibBuilder.importSymbols("IF-MIB", "InterfaceIndex")
juniMibs, = mibBuilder.importSymbols("Juniper-MIBs", "juniMibs")
JuniEnable, = mibBuilder.importSymbols("Juniper-TC", "JuniEnable")
NotificationGroup, ModuleCompliance, ObjectGroup = mibBuilder.importSymbols("SNMPv2-CONF", "NotificationGroup", "ModuleCompliance", "ObjectGroup")
Counter64, NotificationType, Gauge32, IpAddress, iso, MibScalar, MibTable, MibTableRow, MibTableColumn, ModuleIdentity, TimeTicks, ObjectIdentity, Counter32, MibIdentifier, Integer32, Unsigned32, Bits = mibBuilder.importSymbols("SNMPv2-SMI", "Counter64", "NotificationType", "Gauge32", "IpAddress", "iso", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "ModuleIdentity", "TimeTicks", "ObjectIdentity", "Counter32", "MibIdentifier", "Integer32", "Unsigned32", "Bits")
DisplayString, TextualConvention = mibBuilder.importSymbols("SNMPv2-TC", "DisplayString", "TextualConvention")
juniSubscriberMIB = ModuleIdentity((1, 3, 6, 1, 4, 1, 4874, 2, 2, 49))
juniSubscriberMIB.setRevisions(('2002-09-16 21:44', '2002-05-10 19:53', '2000-11-16 00:00',))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
if mibBuilder.loadTexts: juniSubscriberMIB.setRevisionsDescriptions(('Replaced Unisphere names with Juniper names.', 'Added local authentication support.', 'Initial version of this MIB module.',))
if mibBuilder.loadTexts: juniSubscriberMIB.setLastUpdated('200209162144Z')
if mibBuilder.loadTexts: juniSubscriberMIB.setOrganization('Juniper Networks, Inc.')
if mibBuilder.loadTexts: juniSubscriberMIB.setContactInfo(' Juniper Networks, Inc. Postal: 10 Technology Park Drive Westford, MA 01886-3146 USA Tel: +1 978 589 5800 Email: [email protected]')
if mibBuilder.loadTexts: juniSubscriberMIB.setDescription('The Subscriber MIB for the Juniper Networks enterprise.')
class JuniSubscrEncaps(TextualConvention, Integer32):
description = 'Encapsulated protocol type.'
status = 'current'
subtypeSpec = Integer32.subtypeSpec + ConstraintsUnion(SingleValueConstraint(0, 19))
namedValues = NamedValues(("ip", 0), ("bridgedEthernet", 19))
juniSubscrObjects = MibIdentifier((1, 3, 6, 1, 4, 1, 4874, 2, 2, 49, 1))
juniSubscrLocal = MibIdentifier((1, 3, 6, 1, 4, 1, 4874, 2, 2, 49, 1, 1))
juniSubscrLocalTable = MibTable((1, 3, 6, 1, 4, 1, 4874, 2, 2, 49, 1, 1, 1), )
if mibBuilder.loadTexts: juniSubscrLocalTable.setStatus('current')
if mibBuilder.loadTexts: juniSubscrLocalTable.setDescription("Permits local configuration associating a remote subscriber's identity with a local interface, for use in circumstances where the remote subscriber's identity cannot be queried directly (e.g. dynamic IPoA operation).")
juniSubscrLocalEntry = MibTableRow((1, 3, 6, 1, 4, 1, 4874, 2, 2, 49, 1, 1, 1, 1), ).setIndexNames((0, "Juniper-SUBSCRIBER-MIB", "juniSubscrLocalIfIndex"), (0, "Juniper-SUBSCRIBER-MIB", "juniSubscrLocalEncaps"))
if mibBuilder.loadTexts: juniSubscrLocalEntry.setStatus('current')
if mibBuilder.loadTexts: juniSubscrLocalEntry.setDescription("Local configuration associating a remote subscriber's identity with a local interface.")
juniSubscrLocalIfIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 4874, 2, 2, 49, 1, 1, 1, 1, 1), InterfaceIndex())
if mibBuilder.loadTexts: juniSubscrLocalIfIndex.setStatus('current')
if mibBuilder.loadTexts: juniSubscrLocalIfIndex.setDescription('The ifIndex of the interface to which this subscriber information applies.')
juniSubscrLocalEncaps = MibTableColumn((1, 3, 6, 1, 4, 1, 4874, 2, 2, 49, 1, 1, 1, 1, 2), JuniSubscrEncaps())
if mibBuilder.loadTexts: juniSubscrLocalEncaps.setStatus('current')
if mibBuilder.loadTexts: juniSubscrLocalEncaps.setDescription('The incoming data encapsulation to which this subscriber information applies. An interface may have a unique subscriber identity configured for each incoming data encapsulation it supports.')
juniSubscrLocalControl = MibTableColumn((1, 3, 6, 1, 4, 1, 4874, 2, 2, 49, 1, 1, 1, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1))).clone(namedValues=NamedValues(("ok", 0), ("clear", 1)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: juniSubscrLocalControl.setStatus('current')
if mibBuilder.loadTexts: juniSubscrLocalControl.setDescription('When set to clear(1), causes the subscriber information in this entry to be cleared. When set to ok(0), there is no effect and subscriber information is unchanged. When read, always returns a value of ok(0). No other object in this entry can be set simultaneously, otherwise an InconsistentValue error is reported.')
juniSubscrLocalNamePrefix = MibTableColumn((1, 3, 6, 1, 4, 1, 4874, 2, 2, 49, 1, 1, 1, 1, 4), JuniEnable()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: juniSubscrLocalNamePrefix.setStatus('current')
if mibBuilder.loadTexts: juniSubscrLocalNamePrefix.setDescription('If enabled, indicates whether the value of juniSubscrLocalName is a prefix rather than a full name.')
juniSubscrLocalName = MibTableColumn((1, 3, 6, 1, 4, 1, 4874, 2, 2, 49, 1, 1, 1, 1, 5), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 31))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: juniSubscrLocalName.setStatus('current')
if mibBuilder.loadTexts: juniSubscrLocalName.setDescription("The subscriber's name. If juniSubscrLocalNamePrefix has the value 'enabled', the value of this object serves as the prefix of a full subscriber name. The full name is constructed by appending local geographic information (slot, port, etc.) that uniquely distinguishes the subscriber.")
juniSubscrLocalPasswordPrefix = MibTableColumn((1, 3, 6, 1, 4, 1, 4874, 2, 2, 49, 1, 1, 1, 1, 6), JuniEnable()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: juniSubscrLocalPasswordPrefix.setStatus('current')
if mibBuilder.loadTexts: juniSubscrLocalPasswordPrefix.setDescription('If enabled, indicates whether the value of juniSubscrLocalPassword prefix rather than a full password.')
juniSubscrLocalPassword = MibTableColumn((1, 3, 6, 1, 4, 1, 4874, 2, 2, 49, 1, 1, 1, 1, 7), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 31))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: juniSubscrLocalPassword.setStatus('current')
if mibBuilder.loadTexts: juniSubscrLocalPassword.setDescription("The subscriber's password. If juniSubscrLocalPasswordPrefix has the value 'enabled', the value of this object serves as the prefix of a full subscriber password. The full password is constructed by appending local geographic information (slot, port, etc.) that uniquely distinguishes the subscriber.")
juniSubscrLocalDomain = MibTableColumn((1, 3, 6, 1, 4, 1, 4874, 2, 2, 49, 1, 1, 1, 1, 8), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 31))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: juniSubscrLocalDomain.setStatus('current')
if mibBuilder.loadTexts: juniSubscrLocalDomain.setDescription("The subscriber's domain.")
juniSubscrLocalAuthentication = MibTableColumn((1, 3, 6, 1, 4, 1, 4874, 2, 2, 49, 1, 1, 1, 1, 9), JuniEnable().clone('enable')).setMaxAccess("readwrite")
if mibBuilder.loadTexts: juniSubscrLocalAuthentication.setStatus('current')
if mibBuilder.loadTexts: juniSubscrLocalAuthentication.setDescription('When enabled, the interface performs authentication with RADIUS server using the configured subscriber information and associated with the incoming data encapsulation (juniSubscriberLocalEncaps).')
juniSubscriberMIBConformance = MibIdentifier((1, 3, 6, 1, 4, 1, 4874, 2, 2, 49, 4))
juniSubscriberMIBCompliances = MibIdentifier((1, 3, 6, 1, 4, 1, 4874, 2, 2, 49, 4, 1))
juniSubscriberMIBGroups = MibIdentifier((1, 3, 6, 1, 4, 1, 4874, 2, 2, 49, 4, 2))
juniSubscriberCompliance = ModuleCompliance((1, 3, 6, 1, 4, 1, 4874, 2, 2, 49, 4, 1, 1)).setObjects(("Juniper-SUBSCRIBER-MIB", "juniSubscriberLocalGroup"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
juniSubscriberCompliance = juniSubscriberCompliance.setStatus('obsolete')
if mibBuilder.loadTexts: juniSubscriberCompliance.setDescription('Obsolete compliance statement for systems supporting subscriber operation. This statement became obsolete when local authentication support was added.')
juniSubscriberCompliance2 = ModuleCompliance((1, 3, 6, 1, 4, 1, 4874, 2, 2, 49, 4, 1, 2)).setObjects(("Juniper-SUBSCRIBER-MIB", "juniSubscriberLocalGroup2"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
juniSubscriberCompliance2 = juniSubscriberCompliance2.setStatus('current')
if mibBuilder.loadTexts: juniSubscriberCompliance2.setDescription('The compliance statement for systems supporting subscriber operation.')
juniSubscriberLocalGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 4874, 2, 2, 49, 4, 2, 1)).setObjects(("Juniper-SUBSCRIBER-MIB", "juniSubscrLocalControl"), ("Juniper-SUBSCRIBER-MIB", "juniSubscrLocalNamePrefix"), ("Juniper-SUBSCRIBER-MIB", "juniSubscrLocalName"), ("Juniper-SUBSCRIBER-MIB", "juniSubscrLocalPasswordPrefix"), ("Juniper-SUBSCRIBER-MIB", "juniSubscrLocalPassword"), ("Juniper-SUBSCRIBER-MIB", "juniSubscrLocalDomain"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
juniSubscriberLocalGroup = juniSubscriberLocalGroup.setStatus('obsolete')
if mibBuilder.loadTexts: juniSubscriberLocalGroup.setDescription('Obsolete basic collection of objects providing management of locally-configured subscriber identities in a Juniper product. This group became obsolete when local authentication support was added.')
juniSubscriberLocalGroup2 = ObjectGroup((1, 3, 6, 1, 4, 1, 4874, 2, 2, 49, 4, 2, 2)).setObjects(("Juniper-SUBSCRIBER-MIB", "juniSubscrLocalControl"), ("Juniper-SUBSCRIBER-MIB", "juniSubscrLocalNamePrefix"), ("Juniper-SUBSCRIBER-MIB", "juniSubscrLocalName"), ("Juniper-SUBSCRIBER-MIB", "juniSubscrLocalPasswordPrefix"), ("Juniper-SUBSCRIBER-MIB", "juniSubscrLocalPassword"), ("Juniper-SUBSCRIBER-MIB", "juniSubscrLocalDomain"), ("Juniper-SUBSCRIBER-MIB", "juniSubscrLocalAuthentication"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
juniSubscriberLocalGroup2 = juniSubscriberLocalGroup2.setStatus('current')
if mibBuilder.loadTexts: juniSubscriberLocalGroup2.setDescription('The basic collection of objects providing management of locally-configured subscriber identities in a Juniper product.')
mibBuilder.exportSymbols("Juniper-SUBSCRIBER-MIB", juniSubscrLocalDomain=juniSubscrLocalDomain, juniSubscriberCompliance2=juniSubscriberCompliance2, juniSubscrLocalControl=juniSubscrLocalControl, PYSNMP_MODULE_ID=juniSubscriberMIB, juniSubscrLocalAuthentication=juniSubscrLocalAuthentication, juniSubscriberMIBCompliances=juniSubscriberMIBCompliances, JuniSubscrEncaps=JuniSubscrEncaps, juniSubscrLocalPasswordPrefix=juniSubscrLocalPasswordPrefix, juniSubscriberMIBConformance=juniSubscriberMIBConformance, juniSubscrLocal=juniSubscrLocal, juniSubscrObjects=juniSubscrObjects, juniSubscrLocalEntry=juniSubscrLocalEntry, juniSubscriberMIB=juniSubscriberMIB, juniSubscrLocalIfIndex=juniSubscrLocalIfIndex, juniSubscrLocalTable=juniSubscrLocalTable, juniSubscriberCompliance=juniSubscriberCompliance, juniSubscriberLocalGroup2=juniSubscriberLocalGroup2, juniSubscrLocalPassword=juniSubscrLocalPassword, juniSubscrLocalNamePrefix=juniSubscrLocalNamePrefix, juniSubscriberLocalGroup=juniSubscriberLocalGroup, juniSubscrLocalName=juniSubscrLocalName, juniSubscriberMIBGroups=juniSubscriberMIBGroups, juniSubscrLocalEncaps=juniSubscrLocalEncaps)
|
#input
# 69 237 245 22 97 105 68 243 232 209 177 72 161 199 237 218 206 122 209 100 79 226 195 202 160 238 106 99 118 57 68 68 53 65 240 230 160 99 208 64 118 210 232 244 119 178 69 224 146 87 104 237 232 204 227 75 65 162 90 75 64 133 75 225 238 160 204 54 14 196 121 78 72 240 89 237 145 108 244 179 102 54 32 160 53 82 160 248 238 180 72 66 253 113 103 78 121 237 116 160 46
def decode(seq):
if len(seq) == 8:
seq = '0b' + seq[1:]
char = chr(int(seq,2))
return char
encoded_sequence = [int(x) for x in input().split()]
for c in encoded_sequence:
binc = (bin(c))[2:]
num_of_bits = binc.count('1')
if num_of_bits % 2 == 0:
decoded_character = decode(binc)
print(decoded_character, end="") |
def trapes_areal(sideEn=float, sideTo=float, høyde=float):
""" Returnerer arealet til et trapes """
return abs(( ( sideEn+sideTo ) * høyde ) / 2)
def array(array):
'''
Returnerer arealet til array
'''
A = 0
bredde = 1
for i in range(0, len(array)-1):
A += trapes_areal( array[bredde * i],
array[bredde * (i+1)],
bredde )
return A
|
# Definition for singly-linked list.
# class ListNode:
# def __init__(self, val=0, next=None):
# self.val = val
# self.next = next
class Solution:
def mergeTwoLists(self, list1: Optional[ListNode], list2: Optional[ListNode]) -> Optional[ListNode]:
# root and current node
cur = root = ListNode(0)
# merge process
while list1 and list2:
if list1.val <= list2.val:
item = list1.val
list1 = list1.next
elif list1.val > list2.val:
item = list2.val
list2 = list2.next
cur.next = ListNode(item)
cur = cur.next
cur.next = list1 or list2
return root.next |
def proc(command, message):
return {
"data": {
"text": "Your command was not recognised. Type 'help' to read the list of all available commands."
},
"response_required": True
}
|
A, B, C = input().split()
A = int(A)
B = int(B)
C = int(C)
if(A < B and A < C and B < C):
a = C
b = B
c = A
elif(A < B and A < C and C < B):
a = B
b = C
c = A
elif(B < A and B < C and A < C):
a = C
b = A
c = B
elif(B < A and B < C and C < A):
a = A
b = C
c = B
elif(C < A and C < B and A < B):
a = B
b = A
c = C
elif(C < A and C < B and B < A):
a = A
b = B
c = C
elif(A == B and A < C):
a = C
b = A
c = A
elif(A == B and C < A):
a = A
b = A
c = C
elif(A == C and A < B):
a = B
b = A
c = A
elif(A == C and B < A):
a = A
b = B
c = A
elif(B == C and B < A):
a = A
b = B
c = B
elif(B == C and A < B):
a = B
b = A
c = B
else:
a = A
b = B
c = C
if(a >= b + c):
print("Invalido")
exit()
elif(a == b and b == c):
print("Valido-Equilatero")
elif(a == b or a == c or b == c):
print("Valido-Isoceles")
else:
print("Valido-Escaleno")
if(((a * a) == b * b + c * c) == True):
print("Retangulo: S")
else:
print("Retangulo: N") |
"""Ordered List impelementation."""
class Node(object):
"""Node class."""
def __init__(self, initdata=None):
"""Initialization."""
self.data = initdata
self.next = None
def getData(self):
"""Get node's data."""
return self.data
def setData(self, data):
"""Set node's data."""
self.data = data
def getNext(self):
"""Get next node."""
return self.next
def setNext(self, node):
"""Set next node."""
self.next = node
class OrderedList(object):
"""Ordered List."""
def __init__(self):
self.head = None
def add(self, item):
"""Adds new item to list ensuring order is preserved."""
"""
:type item: Node()
:rtype None
"""
node = Node(item)
if self.head == None or self.head.getData() > node.getData():
node.setNext(self.head)
self.head = node
return
prev = self.head
curr = self.head
while curr:
if curr.getData() > node.getData():
prev.setNext(node)
node.setNext(curr)
return
prev = curr
curr = curr.getNext()
# Add to the end
prev.setNext(node)
def remove(self, item):
"""Removes the item from the list. Assumes item is present."""
"""
:type item: Node()
:rtype None
"""
if self.head.getData() == item:
self.head = self.head.getNext()
return
prev = curr = self.head
while curr:
if curr.getData() == item:
prev.setNext(curr.getNext())
break
prev = curr
curr = curr.getNext()
def search(self, item):
"""Searches for the item in the list."""
"""
:type item: Node()
:rtype Boolean
"""
curr = self.head
while curr:
if curr.getData() == item:
return True
curr = curr.getNext()
return False
def isEmpty(self):
"""Tests to see if the list is empty."""
"""
:type None
:rtype Boolean
"""
return self.head == None
def size(self):
"""Returns the number of items in the list."""
"""
:type None
:rtype int
"""
curr = self.head
count = 0
while curr:
count += 1
curr = curr.getNext()
return count
def index(self, item):
"""Returns the position of the item in the list."""
"""
:type item: Node
:rtype int
"""
curr = self.head
idx = 0
while curr:
if item == curr.getData():
break
idx += 1
curr = curr.getNext()
return idx
def pop(self, pos=None):
"""Removes and returns the item. Position is optional and returns the last item if undefined."""
"""
:type pos: int (optional)
:rtype item: Node()
"""
if pos == None:
pos = self.size() - 1
if pos == 0:
temp = self.head
self.head = self.head.getNext()
return temp.getData()
prev = curr = self.head
for idx in range(self.size()):
if idx == pos:
prev.setNext(curr.getNext())
return curr.getData()
prev = curr
curr = curr.getNext()
def print(self):
curr = self.head
while curr:
print("%d" % curr.getData(), end=" ")
curr = curr.getNext()
print('\n--------------------------------')
if __name__ == "__main__":
orderedList = OrderedList()
assert(orderedList.isEmpty())
assert(orderedList.size() == 0)
orderedList.add(5)
orderedList.add(1)
orderedList.add(10)
orderedList.add(-10)
assert(orderedList.index(-10) == 0)
orderedList.add(7)
orderedList.add(70)
assert(orderedList.index(70) == 5)
assert(orderedList.size() == 6)
orderedList.print()
orderedList.remove(-10)
orderedList.remove(70)
orderedList.remove(7)
assert(orderedList.size() == 3)
orderedList.print()
assert(not orderedList.search(-10))
assert(not orderedList.search(70))
assert(not orderedList.search(7))
assert(orderedList.search(1))
assert(orderedList.search(5))
orderedList.add(70)
assert(orderedList.search(70))
orderedList.remove(70)
assert(not orderedList.search(70))
assert(not orderedList.isEmpty())
assert(orderedList.size() == 3)
assert(orderedList.index(1) == 0)
assert(orderedList.index(5) == 1)
assert(orderedList.index(10) == 2)
assert(orderedList.pop(0) == 1)
assert(orderedList.size() == 2)
assert(orderedList.pop() == 10)
assert(orderedList.size() == 1)
assert(orderedList.pop() == 5)
assert(orderedList.isEmpty())
orderedList.add(1)
orderedList.add(100)
orderedList.add(1000)
assert(orderedList.pop() == 1000)
assert(orderedList.pop() == 100)
assert(orderedList.pop() == 1)
|
print('******* Bem vindo a aula 13 *********')
n = int(input('Informe um número'))
for c in range(0, n):
print(c)
print('Fim')
for c in range (0, 6, 2):
print(c)
print('Fim') |
for _ in range(int(input())):
s = input()
f,l,r = 0,0,0
for i in range(len(s) - 1):
if(s[i] == s[i + 1]):
f = 1
l = i
break
for i in range(len(s) - 1,0,-1):
if(s[i] == s[i - 1]):
# print(i)
f = 1
r = i
break
if s[0] == s[len(s) - 1]: f = 1
if f == 0:print('yes')
elif(len(s) % 2 != 0): print('no')
else:
r,g = 0,0
for i in range(len(s) - 1):
if(s[i] == s[i + 1] and s[i] == 'R'): r += 1
if(s[i] == s[i + 1] and s[i] == "G"): g += 1
if(s[0] == s[len(s) - 1] and s[0] == "R"):
# print('R')
r += 1
if(s[0] == s[len(s) - 1] and s[0] == 'G'):
# print(s[0],s[len(s) - 1])
# print('G')
g += 1
# print(r,g)
if(r < 2 and g < 2 ):print('yes')
else :print('no')
# # print(l,r)
# temp1 = s[:l + 1:]
# temp2 = s[l+1:r:]
# temp3 = s[r::]
# print(temp1, temp2, temp3)
# temp = s[:l + 1:] + temp2[::-1] + s[r::]
# # print(temp)
# f1,f2 = 0,0
# for i in range(len(temp) - 1):
# if(temp[i] == temp[i + 1]): f1 = 1
# if(temp[0] == temp[len(temp) - 1]):f1 = 1
# temp = temp3[::-1] + temp2 + temp1[::-1]
# # print(temp)
# for i in range(len(temp) - 1):
# if(temp[i] == temp[i + 1]): f2 = 1
# if(temp[0] == temp[len(temp) - 1]):f2 = 1
# print('yes') if f1 == 0 or f2 == 0 else print('no') |
""" tells the bot to join the [params] channel """
class Command:
owner_command = True
def run(self):
self.response = f"attempting to join {self.params}"
self.raw_send = "JOIN " + self.params
|
def solution(n, delivery):
answer = ''
ans_list = []
for i in range(n):
ans_list.append('?')
for de in delivery:
if(de[2] == 1):
ans_list[de[0] -1] = 'O'
ans_list[de[1] -1] = 'O'
for de in delivery:
if(de[2] == 0):
if(ans_list[de[0] -1 ] == 'O'):
ans_list[de[1] - 1] = 'X'
elif(ans_list[de[1] -1] == 'O'):
ans_list[de[0] - 1] = 'X'
for i in range(n):
answer += ans_list[i]
return answer
a = solution(7,[[5,6,0],[1,3,1],[1,5,0],[7,6,0],[3,7,1],[2,5,0]])
print (a) |
# def summation(num):
# pos = 0
# while (num > 0):
# pos += num
# print(pos)
# num -= 1
# print(num)
# return pos
# # Code here
def summation(num):
pos = 0
for num in range(1,num + 1):
pos += num
print(num)
return pos
# Code here
num = int(input("Write number = "))
print(summation(num)) |
def somar(a=0,b=0,c=0):
s=a+b+c
return s
def main():
#print(somar(3,4,5))
r1 = somar(3,4,5)
r2 = somar(1,7)
r3 = somar(4)
print('RESULTADOS: ',r1,r2,r3)
main()
|
def tf_io_copts():
return (
[
"-std=c++11",
"-DNDEBUG",
] +
select({
"@bazel_tools//src/conditions:darwin": [],
"//conditions:default": ["-pthread"]
})
)
|
def nb_post_fix(rtl_log_f,rtl_log,nb_log):
''' Replaces non-blocking load results in rd of trace log.
Sees time/CycleCnt at which non-block load is written back to gpr,
checks from that time/CycleCnt backwards, where this gpr was written in trace log,
replaces the result in rd (also load) at that instruction'''
nb_file = open(nb_log,"r")
load_lines = nb_file.readlines()
#read whole file
trace_file = open(rtl_log,"r")
trace_lines = trace_file.readlines()
list1 = []
list2 = []
x = 1
for i in range(len(load_lines)):
l= load_lines[i].split()
list1.append(l)
for i in range(len(trace_lines)):
l2 = trace_lines[i].split()
list2.append(l2)
#flow with trace log read as whole
# find and replace the non-block load instruction reg
i = 1
while (x < len(load_lines)):
try:
t = list1[x][0]
except IndexError:
break
if(int(list1[x][0])<=int(list2[i][0])):
for a in range(i,i-20,-1):
try:
t = list2[a][5].split(',')
except IndexError:
continue
try:
t = list2[a][10].split(':')
except IndexError:
continue
if(list1[x][2]==list2[a][5].split(',')[0] and (list2[a][10].split(':')[0]=="load") ):
list2[a][7]=("%s=0x%s" %(list1[x][2],list1[x][3]))
list2[a][10]=("load:0x%s" %(list1[x][3]))
#print(str('\t'.join(list2[a])))
i=a+1
break
x+=1
i+=1
#update trace lines
for i in range(len(trace_lines)):
list2[i]='\t'.join(list2[i])
trace_lines[i]=str(list2[i]+'\n')
#writing back lines
nb_file = open(rtl_log_f,"w")
nb_file.writelines(trace_lines)
def main():
parser = argparse.ArgumentParser()
parser.add_argument("--rtl_log_f",
help="Output core simulation log post-fixed (default: stdout)",
type=argparse.FileType('w'),
default=sys.stdout)
parser.add_argument("--nb_log",
help="Input core simulation log (default: stdin)",
type=argparse.FileType('r'),
default=sys.stdin)
parser.add_argument("--rtl_log",
help="Input core simulation log (default: stdin)",
type=argparse.FileType('r'),
default=sys.stdin)
args = parser.parse_args()
print("Post-fix log for nonblock load values\n")
nb_post_fix(args.rtl_log_f, args.rtl_log, args.nb_log)
if __name__ == "__main__":
main()
|
# a place to hold event type constants used among many data models, rules, or policies
ADMIN_ROLE_ASSIGNED = "admin_role_assigned"
FAILED_LOGIN = "failed_login"
MFA_DISABLED = "mfa_disabled"
SUCCESSFUL_LOGIN = "successful_login"
SUCCESSFUL_LOGOUT = "successful_logout"
USER_ACCOUNT_CREATED = "user_account_created"
# ACCOUNT_CREATED refers to an account not associated with a specific user,
# such as a billing account
ACCOUNT_CREATED = "account_created"
# USER_ACCOUNT_CREATED refers to an account that is associated with one user or service user
USER_ACCOUNT_DELETED = "user_account_deleted"
USER_ACCOUNT_MODIFIED = "user_account_modified"
USER_GROUP_CREATED = "user_group_created"
USER_GROUP_MODIFIED = "user_group_modified"
USER_GROUP_DELETED = "user_group_deleted"
USER_ROLE_CREATED = "user_role_created"
USER_ROLE_MODIFIED = "user_role_modified"
USER_ROLE_DELETED = "user_role_deleted"
|
#
# PySNMP MIB module WebGraph-AnalogIO-57662-US-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/WebGraph-AnalogIO-57662-US-MIB
# Produced by pysmi-0.3.4 at Mon Apr 29 21:32:20 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 (default, Mar 27 2019, 09:23:15)
#
OctetString, ObjectIdentifier, Integer = mibBuilder.importSymbols("ASN1", "OctetString", "ObjectIdentifier", "Integer")
NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues")
ValueSizeConstraint, SingleValueConstraint, ValueRangeConstraint, ConstraintsUnion, ConstraintsIntersection = mibBuilder.importSymbols("ASN1-REFINEMENT", "ValueSizeConstraint", "SingleValueConstraint", "ValueRangeConstraint", "ConstraintsUnion", "ConstraintsIntersection")
ModuleCompliance, NotificationGroup = mibBuilder.importSymbols("SNMPv2-CONF", "ModuleCompliance", "NotificationGroup")
IpAddress, ObjectIdentity, Integer32, NotificationType, MibScalar, MibTable, MibTableRow, MibTableColumn, Unsigned32, enterprises, TimeTicks, Bits, Counter64, ModuleIdentity, MibIdentifier, iso, Gauge32, NotificationType, Counter32 = mibBuilder.importSymbols("SNMPv2-SMI", "IpAddress", "ObjectIdentity", "Integer32", "NotificationType", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "Unsigned32", "enterprises", "TimeTicks", "Bits", "Counter64", "ModuleIdentity", "MibIdentifier", "iso", "Gauge32", "NotificationType", "Counter32")
DisplayString, TextualConvention, PhysAddress = mibBuilder.importSymbols("SNMPv2-TC", "DisplayString", "TextualConvention", "PhysAddress")
wut = MibIdentifier((1, 3, 6, 1, 4, 1, 5040))
wtComServer = MibIdentifier((1, 3, 6, 1, 4, 1, 5040, 1))
wtWebio = MibIdentifier((1, 3, 6, 1, 4, 1, 5040, 1, 2))
wtWebGraphAnalog57662 = MibIdentifier((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29))
wtWebGraphAnalog57662Inventory = MibIdentifier((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 1))
wtWebGraphAnalog57662SessCntrl = MibIdentifier((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 2))
wtWebGraphAnalog57662Config = MibIdentifier((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 3))
wtWebGraphAnalog57662Diag = MibIdentifier((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 4))
wtWebGraphAnalog57662Device = MibIdentifier((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 3, 1))
wtWebGraphAnalog57662Ports = MibIdentifier((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 3, 2))
wtWebGraphAnalog57662Manufact = MibIdentifier((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 3, 3))
wtWebGraphAnalog57662Text = MibIdentifier((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 3, 1, 1))
wtWebGraphAnalog57662TimeDate = MibIdentifier((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 3, 1, 2))
wtWebGraphAnalog57662Basic = MibIdentifier((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 3, 1, 3))
wtWebGraphAnalog57662Datalogger = MibIdentifier((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 3, 1, 4))
wtWebGraphAnalog57662Alarm = MibIdentifier((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 3, 1, 5))
wtWebGraphAnalog57662Graphics = MibIdentifier((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 3, 1, 6))
wtWebGraphAnalog57662Report = MibIdentifier((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 3, 1, 7))
wtWebGraphAnalog57662TimeZone = MibIdentifier((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 3, 1, 2, 1))
wtWebGraphAnalog57662TimeServer = MibIdentifier((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 3, 1, 2, 2))
wtWebGraphAnalog57662DeviceClock = MibIdentifier((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 3, 1, 2, 3))
wtWebGraphAnalog57662Network = MibIdentifier((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 3, 1, 3, 1))
wtWebGraphAnalog57662HTTP = MibIdentifier((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 3, 1, 3, 2))
wtWebGraphAnalog57662Mail = MibIdentifier((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 3, 1, 3, 3))
wtWebGraphAnalog57662SNMP = MibIdentifier((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 3, 1, 3, 4))
wtWebGraphAnalog57662UDP = MibIdentifier((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 3, 1, 3, 5))
wtWebGraphAnalog57662Syslog = MibIdentifier((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 3, 1, 3, 6))
wtWebGraphAnalog57662FTP = MibIdentifier((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 3, 1, 3, 7))
wtWebGraphAnalog57662Language = MibIdentifier((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 3, 1, 3, 8))
wtWebGraphAnalog57662Binary = MibIdentifier((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 3, 1, 3, 9))
wtWebGraphAnalog57662GraphicsBase = MibIdentifier((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 3, 1, 6, 1))
wtWebGraphAnalog57662GraphicsSelect = MibIdentifier((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 3, 1, 6, 2))
wtWebGraphAnalog57662GraphicsScale = MibIdentifier((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 3, 1, 6, 3))
wtWebGraphAnalog57662Sensors = MibScalar((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 2))).setMaxAccess("readonly")
if mibBuilder.loadTexts: wtWebGraphAnalog57662Sensors.setStatus('mandatory')
wtWebGraphAnalog57662SensorTable = MibTable((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 1, 2), )
if mibBuilder.loadTexts: wtWebGraphAnalog57662SensorTable.setStatus('mandatory')
wtWebGraphAnalog57662SensorEntry = MibTableRow((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 1, 2, 1), ).setIndexNames((0, "WebGraph-AnalogIO-57662-US-MIB", "wtWebGraphAnalog57662SensorNo"))
if mibBuilder.loadTexts: wtWebGraphAnalog57662SensorEntry.setStatus('mandatory')
wtWebGraphAnalog57662SensorNo = MibTableColumn((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 1, 2, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 2))).setMaxAccess("readonly")
if mibBuilder.loadTexts: wtWebGraphAnalog57662SensorNo.setStatus('mandatory')
wtWebGraphAnalog57662ValuesTable = MibTable((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 1, 3), )
if mibBuilder.loadTexts: wtWebGraphAnalog57662ValuesTable.setStatus('mandatory')
wtWebGraphAnalog57662ValuesEntry = MibTableRow((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 1, 3, 1), ).setIndexNames((0, "WebGraph-AnalogIO-57662-US-MIB", "wtWebGraphAnalog57662SensorNo"))
if mibBuilder.loadTexts: wtWebGraphAnalog57662ValuesEntry.setStatus('mandatory')
wtWebGraphAnalog57662Values = MibTableColumn((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 1, 3, 1, 1), OctetString().subtype(subtypeSpec=ValueSizeConstraint(5, 5)).setFixedLength(5)).setMaxAccess("readwrite")
if mibBuilder.loadTexts: wtWebGraphAnalog57662Values.setStatus('mandatory')
wtWebGraphAnalog57662BinaryValuesTable = MibTable((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 1, 4), )
if mibBuilder.loadTexts: wtWebGraphAnalog57662BinaryValuesTable.setStatus('mandatory')
wtWebGraphAnalog57662BinaryValuesEntry = MibTableRow((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 1, 4, 1), ).setIndexNames((0, "WebGraph-AnalogIO-57662-US-MIB", "wtWebGraphAnalog57662SensorNo"))
if mibBuilder.loadTexts: wtWebGraphAnalog57662BinaryValuesEntry.setStatus('mandatory')
wtWebGraphAnalog57662BinaryValues = MibTableColumn((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 1, 4, 1, 1), Integer32()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: wtWebGraphAnalog57662BinaryValues.setStatus('mandatory')
wtWebGraphAnalog57662SessCntrlPassword = MibScalar((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 2, 1), OctetString()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: wtWebGraphAnalog57662SessCntrlPassword.setStatus('mandatory')
wtWebGraphAnalog57662SessCntrlConfigMode = MibScalar((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 2, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1))).clone(namedValues=NamedValues(("wtWebGraphAnalog57662SessCntrl-NoSession", 0), ("wtWebGraphAnalog57662SessCntrl-Session", 1)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: wtWebGraphAnalog57662SessCntrlConfigMode.setStatus('mandatory')
wtWebGraphAnalog57662SessCntrlLogout = MibScalar((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 2, 3), Integer32()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: wtWebGraphAnalog57662SessCntrlLogout.setStatus('mandatory')
wtWebGraphAnalog57662SessCntrlAdminPassword = MibScalar((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 2, 4), OctetString()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: wtWebGraphAnalog57662SessCntrlAdminPassword.setStatus('mandatory')
wtWebGraphAnalog57662SessCntrlConfigPassword = MibScalar((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 2, 5), OctetString()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: wtWebGraphAnalog57662SessCntrlConfigPassword.setStatus('mandatory')
wtWebGraphAnalog57662DeviceName = MibScalar((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 3, 1, 1, 1), OctetString()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: wtWebGraphAnalog57662DeviceName.setStatus('mandatory')
wtWebGraphAnalog57662DeviceText = MibScalar((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 3, 1, 1, 2), OctetString()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: wtWebGraphAnalog57662DeviceText.setStatus('mandatory')
wtWebGraphAnalog57662DeviceLocation = MibScalar((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 3, 1, 1, 3), OctetString()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: wtWebGraphAnalog57662DeviceLocation.setStatus('mandatory')
wtWebGraphAnalog57662DeviceContact = MibScalar((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 3, 1, 1, 4), OctetString()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: wtWebGraphAnalog57662DeviceContact.setStatus('mandatory')
wtWebGraphAnalog57662TzOffsetHrs = MibScalar((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 3, 1, 2, 1, 1), Integer32()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: wtWebGraphAnalog57662TzOffsetHrs.setStatus('mandatory')
wtWebGraphAnalog57662TzOffsetMin = MibScalar((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 3, 1, 2, 1, 2), Integer32()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: wtWebGraphAnalog57662TzOffsetMin.setStatus('mandatory')
wtWebGraphAnalog57662TzEnable = MibScalar((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 3, 1, 2, 1, 3), OctetString().subtype(subtypeSpec=ValueSizeConstraint(4, 4)).setFixedLength(4)).setMaxAccess("readwrite")
if mibBuilder.loadTexts: wtWebGraphAnalog57662TzEnable.setStatus('mandatory')
wtWebGraphAnalog57662StTzOffsetHrs = MibScalar((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 3, 1, 2, 1, 4), Integer32()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: wtWebGraphAnalog57662StTzOffsetHrs.setStatus('mandatory')
wtWebGraphAnalog57662StTzOffsetMin = MibScalar((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 3, 1, 2, 1, 5), Integer32()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: wtWebGraphAnalog57662StTzOffsetMin.setStatus('mandatory')
wtWebGraphAnalog57662StTzEnable = MibScalar((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 3, 1, 2, 1, 6), OctetString().subtype(subtypeSpec=ValueSizeConstraint(4, 4)).setFixedLength(4)).setMaxAccess("readwrite")
if mibBuilder.loadTexts: wtWebGraphAnalog57662StTzEnable.setStatus('mandatory')
wtWebGraphAnalog57662StTzStartMonth = MibScalar((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 3, 1, 2, 1, 7), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12))).clone(namedValues=NamedValues(("wtWebGraphAnalog57662StartMonth-January", 1), ("wtWebGraphAnalog57662StartMonth-February", 2), ("wtWebGraphAnalog57662StartMonth-March", 3), ("wtWebGraphAnalog57662StartMonth-April", 4), ("wtWebGraphAnalog57662StartMonth-May", 5), ("wtWebGraphAnalog57662StartMonth-June", 6), ("wtWebGraphAnalog57662StartMonth-July", 7), ("wtWebGraphAnalog57662StartMonth-August", 8), ("wtWebGraphAnalog57662StartMonth-September", 9), ("wtWebGraphAnalog57662StartMonth-October", 10), ("wtWebGraphAnalog57662StartMonth-November", 11), ("wtWebGraphAnalog57662StartMonth-December", 12)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: wtWebGraphAnalog57662StTzStartMonth.setStatus('mandatory')
wtWebGraphAnalog57662StTzStartMode = MibScalar((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 3, 1, 2, 1, 8), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5))).clone(namedValues=NamedValues(("wtWebGraphAnalog57662StartMode-first", 1), ("wtWebGraphAnalog57662StartMode-second", 2), ("wtWebGraphAnalog57662StartMode-third", 3), ("wtWebGraphAnalog57662StartMode-fourth", 4), ("wtWebGraphAnalog57662StartMode-last", 5)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: wtWebGraphAnalog57662StTzStartMode.setStatus('mandatory')
wtWebGraphAnalog57662StTzStartWday = MibScalar((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 3, 1, 2, 1, 9), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6, 7))).clone(namedValues=NamedValues(("wtWebGraphAnalog57662StartWday-Sunday", 1), ("wtWebGraphAnalog57662StartWday-Monday", 2), ("wtWebGraphAnalog57662StartWday-Tuesday", 3), ("wtWebGraphAnalog57662StartWday-Thursday", 4), ("wtWebGraphAnalog57662StartWday-Wednesday", 5), ("wtWebGraphAnalog57662StartWday-Friday", 6), ("wtWebGraphAnalog57662StartWday-Saturday", 7)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: wtWebGraphAnalog57662StTzStartWday.setStatus('mandatory')
wtWebGraphAnalog57662StTzStartHrs = MibScalar((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 3, 1, 2, 1, 10), Integer32()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: wtWebGraphAnalog57662StTzStartHrs.setStatus('mandatory')
wtWebGraphAnalog57662StTzStartMin = MibScalar((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 3, 1, 2, 1, 11), Integer32()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: wtWebGraphAnalog57662StTzStartMin.setStatus('mandatory')
wtWebGraphAnalog57662StTzStopMonth = MibScalar((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 3, 1, 2, 1, 12), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12))).clone(namedValues=NamedValues(("wtWebGraphAnalog57662StopMonth-January", 1), ("wtWebGraphAnalog57662StopMonth-February", 2), ("wtWebGraphAnalog57662StopMonth-March", 3), ("wtWebGraphAnalog57662StopMonth-April", 4), ("wtWebGraphAnalog57662StopMonth-May", 5), ("wtWebGraphAnalog57662StopMonth-June", 6), ("wtWebGraphAnalog57662StopMonth-July", 7), ("wtWebGraphAnalog57662StopMonth-August", 8), ("wtWebGraphAnalog57662StopMonth-September", 9), ("wtWebGraphAnalog57662StopMonth-October", 10), ("wtWebGraphAnalog57662StopMonth-November", 11), ("wtWebGraphAnalog57662StopMonth-December", 12)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: wtWebGraphAnalog57662StTzStopMonth.setStatus('mandatory')
wtWebGraphAnalog57662StTzStopMode = MibScalar((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 3, 1, 2, 1, 13), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5))).clone(namedValues=NamedValues(("wtWebGraphAnalog57662StopMode-first", 1), ("wtWebGraphAnalog57662StopMode-second", 2), ("wtWebGraphAnalog57662StopMode-third", 3), ("wtWebGraphAnalog57662StopMode-fourth", 4), ("wtWebGraphAnalog57662StopMode-last", 5)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: wtWebGraphAnalog57662StTzStopMode.setStatus('mandatory')
wtWebGraphAnalog57662StTzStopWday = MibScalar((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 3, 1, 2, 1, 14), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6, 7))).clone(namedValues=NamedValues(("wtWebGraphAnalog57662StopWday-Sunday", 1), ("wtWebGraphAnalog57662StopWday-Monday", 2), ("wtWebGraphAnalog57662StopWday-Tuesday", 3), ("wtWebGraphAnalog57662StopWday-Thursday", 4), ("wtWebGraphAnalog57662StopWday-Wednesday", 5), ("wtWebGraphAnalog57662StopWday-Friday", 6), ("wtWebGraphAnalog57662StopWday-Saturday", 7)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: wtWebGraphAnalog57662StTzStopWday.setStatus('mandatory')
wtWebGraphAnalog57662StTzStopHrs = MibScalar((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 3, 1, 2, 1, 15), Integer32()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: wtWebGraphAnalog57662StTzStopHrs.setStatus('mandatory')
wtWebGraphAnalog57662StTzStopMin = MibScalar((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 3, 1, 2, 1, 16), Integer32()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: wtWebGraphAnalog57662StTzStopMin.setStatus('mandatory')
wtWebGraphAnalog57662TimeServer1 = MibScalar((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 3, 1, 2, 2, 1), OctetString()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: wtWebGraphAnalog57662TimeServer1.setStatus('mandatory')
wtWebGraphAnalog57662TimeServer2 = MibScalar((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 3, 1, 2, 2, 2), OctetString()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: wtWebGraphAnalog57662TimeServer2.setStatus('mandatory')
wtWebGraphAnalog57662TsEnable = MibScalar((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 3, 1, 2, 2, 3), OctetString().subtype(subtypeSpec=ValueSizeConstraint(4, 4)).setFixedLength(4)).setMaxAccess("readwrite")
if mibBuilder.loadTexts: wtWebGraphAnalog57662TsEnable.setStatus('mandatory')
wtWebGraphAnalog57662TsSyncTime = MibScalar((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 3, 1, 2, 2, 4), Integer32()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: wtWebGraphAnalog57662TsSyncTime.setStatus('mandatory')
wtWebGraphAnalog57662ClockHrs = MibScalar((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 3, 1, 2, 3, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 23))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: wtWebGraphAnalog57662ClockHrs.setStatus('mandatory')
wtWebGraphAnalog57662ClockMin = MibScalar((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 3, 1, 2, 3, 2), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 59))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: wtWebGraphAnalog57662ClockMin.setStatus('mandatory')
wtWebGraphAnalog57662ClockDay = MibScalar((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 3, 1, 2, 3, 3), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 31))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: wtWebGraphAnalog57662ClockDay.setStatus('mandatory')
wtWebGraphAnalog57662ClockMonth = MibScalar((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 3, 1, 2, 3, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12))).clone(namedValues=NamedValues(("wtWebGraphAnalog57662ClockMonth-January", 1), ("wtWebGraphAnalog57662ClockMonth-February", 2), ("wtWebGraphAnalog57662ClockMonth-March", 3), ("wtWebGraphAnalog57662ClockMonth-April", 4), ("wtWebGraphAnalog57662ClockMonth-May", 5), ("wtWebGraphAnalog57662ClockMonth-June", 6), ("wtWebGraphAnalog57662ClockMonth-July", 7), ("wtWebGraphAnalog57662ClockMonth-August", 8), ("wtWebGraphAnalog57662ClockMonth-September", 9), ("wtWebGraphAnalog57662ClockMonth-October", 10), ("wtWebGraphAnalog57662ClockMonth-November", 11), ("wtWebGraphAnalog57662ClockMonth-December", 12)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: wtWebGraphAnalog57662ClockMonth.setStatus('mandatory')
wtWebGraphAnalog57662ClockYear = MibScalar((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 3, 1, 2, 3, 5), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 65535))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: wtWebGraphAnalog57662ClockYear.setStatus('mandatory')
wtWebGraphAnalog57662IpAddress = MibScalar((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 3, 1, 3, 1, 1), IpAddress()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: wtWebGraphAnalog57662IpAddress.setStatus('mandatory')
wtWebGraphAnalog57662SubnetMask = MibScalar((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 3, 1, 3, 1, 2), IpAddress()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: wtWebGraphAnalog57662SubnetMask.setStatus('mandatory')
wtWebGraphAnalog57662Gateway = MibScalar((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 3, 1, 3, 1, 3), IpAddress()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: wtWebGraphAnalog57662Gateway.setStatus('mandatory')
wtWebGraphAnalog57662DnsServer1 = MibScalar((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 3, 1, 3, 1, 4), OctetString()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: wtWebGraphAnalog57662DnsServer1.setStatus('mandatory')
wtWebGraphAnalog57662DnsServer2 = MibScalar((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 3, 1, 3, 1, 5), OctetString()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: wtWebGraphAnalog57662DnsServer2.setStatus('mandatory')
wtWebGraphAnalog57662AddConfig = MibScalar((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 3, 1, 3, 1, 6), OctetString()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: wtWebGraphAnalog57662AddConfig.setStatus('mandatory')
wtWebGraphAnalog57662Startup = MibScalar((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 3, 1, 3, 2, 1), OctetString()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: wtWebGraphAnalog57662Startup.setStatus('mandatory')
wtWebGraphAnalog57662GetHeaderEnable = MibScalar((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 3, 1, 3, 2, 2), OctetString()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: wtWebGraphAnalog57662GetHeaderEnable.setStatus('mandatory')
wtWebGraphAnalog57662HttpPort = MibScalar((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 3, 1, 3, 2, 3), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 65535))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: wtWebGraphAnalog57662HttpPort.setStatus('mandatory')
wtWebGraphAnalog57662MailAdName = MibScalar((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 3, 1, 3, 3, 1), OctetString()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: wtWebGraphAnalog57662MailAdName.setStatus('mandatory')
wtWebGraphAnalog57662MailReply = MibScalar((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 3, 1, 3, 3, 2), OctetString()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: wtWebGraphAnalog57662MailReply.setStatus('mandatory')
wtWebGraphAnalog57662MailServer = MibScalar((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 3, 1, 3, 3, 3), OctetString()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: wtWebGraphAnalog57662MailServer.setStatus('mandatory')
wtWebioAn1MailEnable = MibScalar((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 3, 1, 3, 3, 4), OctetString()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: wtWebioAn1MailEnable.setStatus('mandatory')
wtWebGraphAnalog57662MailAuthentication = MibScalar((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 3, 1, 3, 3, 5), OctetString().subtype(subtypeSpec=ValueSizeConstraint(4, 4)).setFixedLength(4)).setMaxAccess("readwrite")
if mibBuilder.loadTexts: wtWebGraphAnalog57662MailAuthentication.setStatus('mandatory')
wtWebGraphAnalog57662MailAuthUser = MibScalar((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 3, 1, 3, 3, 6), OctetString()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: wtWebGraphAnalog57662MailAuthUser.setStatus('mandatory')
wtWebGraphAnalog57662MailAuthPassword = MibScalar((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 3, 1, 3, 3, 7), OctetString()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: wtWebGraphAnalog57662MailAuthPassword.setStatus('mandatory')
wtWebGraphAnalog57662MailPop3Server = MibScalar((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 3, 1, 3, 3, 8), OctetString()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: wtWebGraphAnalog57662MailPop3Server.setStatus('mandatory')
wtWebGraphAnalog57662SnmpCommunityStringRead = MibScalar((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 3, 1, 3, 4, 1), OctetString()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: wtWebGraphAnalog57662SnmpCommunityStringRead.setStatus('mandatory')
wtWebGraphAnalog57662SnmpCommunityStringReadWrite = MibScalar((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 3, 1, 3, 4, 2), OctetString()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: wtWebGraphAnalog57662SnmpCommunityStringReadWrite.setStatus('mandatory')
wtWebGraphAnalog57662SystemTrapManagerIP = MibScalar((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 3, 1, 3, 4, 3), OctetString()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: wtWebGraphAnalog57662SystemTrapManagerIP.setStatus('mandatory')
wtWebGraphAnalog57662SystemTrapEnable = MibScalar((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 3, 1, 3, 4, 4), OctetString().subtype(subtypeSpec=ValueSizeConstraint(4, 4)).setFixedLength(4)).setMaxAccess("readwrite")
if mibBuilder.loadTexts: wtWebGraphAnalog57662SystemTrapEnable.setStatus('mandatory')
wtWebGraphAnalog57662SnmpEnable = MibScalar((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 3, 1, 3, 4, 5), OctetString()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: wtWebGraphAnalog57662SnmpEnable.setStatus('mandatory')
wtWebGraphAnalog57662SnmpCommunityStringTrap = MibScalar((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 3, 1, 3, 4, 6), OctetString()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: wtWebGraphAnalog57662SnmpCommunityStringTrap.setStatus('mandatory')
wtWebGraphAnalog57662UdpPort = MibScalar((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 3, 1, 3, 5, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 65535))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: wtWebGraphAnalog57662UdpPort.setStatus('mandatory')
wtWebGraphAnalog57662UdpEnable = MibScalar((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 3, 1, 3, 5, 2), OctetString()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: wtWebGraphAnalog57662UdpEnable.setStatus('mandatory')
wtWebGraphAnalog57662SyslogServerIP = MibScalar((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 3, 1, 3, 6, 1), OctetString()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: wtWebGraphAnalog57662SyslogServerIP.setStatus('mandatory')
wtWebGraphAnalog57662SyslogServerPort = MibScalar((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 3, 1, 3, 6, 2), Integer32()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: wtWebGraphAnalog57662SyslogServerPort.setStatus('mandatory')
wtWebGraphAnalog57662SyslogSystemMessagesEnable = MibScalar((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 3, 1, 3, 6, 3), OctetString().subtype(subtypeSpec=ValueSizeConstraint(4, 4)).setFixedLength(4)).setMaxAccess("readwrite")
if mibBuilder.loadTexts: wtWebGraphAnalog57662SyslogSystemMessagesEnable.setStatus('mandatory')
wtWebGraphAnalog57662SyslogEnable = MibScalar((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 3, 1, 3, 6, 4), OctetString()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: wtWebGraphAnalog57662SyslogEnable.setStatus('mandatory')
wtWebGraphAnalog57662FTPServerIP = MibScalar((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 3, 1, 3, 7, 1), OctetString()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: wtWebGraphAnalog57662FTPServerIP.setStatus('mandatory')
wtWebGraphAnalog57662FTPServerControlPort = MibScalar((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 3, 1, 3, 7, 2), Integer32()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: wtWebGraphAnalog57662FTPServerControlPort.setStatus('mandatory')
wtWebGraphAnalog57662FTPUserName = MibScalar((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 3, 1, 3, 7, 3), OctetString()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: wtWebGraphAnalog57662FTPUserName.setStatus('mandatory')
wtWebGraphAnalog57662FTPPassword = MibScalar((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 3, 1, 3, 7, 4), OctetString()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: wtWebGraphAnalog57662FTPPassword.setStatus('mandatory')
wtWebGraphAnalog57662FTPAccount = MibScalar((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 3, 1, 3, 7, 5), OctetString()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: wtWebGraphAnalog57662FTPAccount.setStatus('mandatory')
wtWebGraphAnalog57662FTPOption = MibScalar((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 3, 1, 3, 7, 6), OctetString()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: wtWebGraphAnalog57662FTPOption.setStatus('mandatory')
wtWebGraphAnalog57662FTPEnable = MibScalar((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 3, 1, 3, 7, 7), OctetString()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: wtWebGraphAnalog57662FTPEnable.setStatus('mandatory')
wtWebGraphAnalog57662LanguageSelect = MibScalar((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 3, 1, 3, 8, 1), OctetString()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: wtWebGraphAnalog57662LanguageSelect.setStatus('mandatory')
wtWebGraphAnalog57662BinaryModeCount = MibScalar((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 3, 1, 3, 9, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 2))).setMaxAccess("readonly")
if mibBuilder.loadTexts: wtWebGraphAnalog57662BinaryModeCount.setStatus('mandatory')
wtWebGraphAnalog57662BinaryIfTable = MibTable((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 3, 1, 3, 9, 2), )
if mibBuilder.loadTexts: wtWebGraphAnalog57662BinaryIfTable.setStatus('mandatory')
wtWebGraphAnalog57662BinaryIfEntry = MibTableRow((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 3, 1, 3, 9, 2, 1), ).setIndexNames((0, "WebGraph-AnalogIO-57662-US-MIB", "wtWebGraphAnalog57662BinaryModeNo"))
if mibBuilder.loadTexts: wtWebGraphAnalog57662BinaryIfEntry.setStatus('mandatory')
wtWebGraphAnalog57662BinaryModeNo = MibTableColumn((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 3, 1, 3, 9, 2, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 2))).setMaxAccess("readonly")
if mibBuilder.loadTexts: wtWebGraphAnalog57662BinaryModeNo.setStatus('mandatory')
wtWebGraphAnalog57662BinaryTable = MibTable((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 3, 1, 3, 9, 3), )
if mibBuilder.loadTexts: wtWebGraphAnalog57662BinaryTable.setStatus('mandatory')
wtWebGraphAnalog57662BinaryEntry = MibTableRow((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 3, 1, 3, 9, 3, 1), ).setIndexNames((0, "WebGraph-AnalogIO-57662-US-MIB", "wtWebGraphAnalog57662BinaryModeNo"))
if mibBuilder.loadTexts: wtWebGraphAnalog57662BinaryEntry.setStatus('mandatory')
wtWebGraphAnalog57662BinaryOperationMode = MibTableColumn((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 3, 1, 3, 9, 3, 1, 1), OctetString().subtype(subtypeSpec=ValueSizeConstraint(4, 4)).setFixedLength(4)).setMaxAccess("readwrite")
if mibBuilder.loadTexts: wtWebGraphAnalog57662BinaryOperationMode.setStatus('mandatory')
wtWebGraphAnalog57662BinaryTcpServerLocalPort = MibTableColumn((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 3, 1, 3, 9, 3, 1, 2), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 65535))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: wtWebGraphAnalog57662BinaryTcpServerLocalPort.setStatus('mandatory')
wtWebGraphAnalog57662BinaryTcpServerInputTrigger = MibTableColumn((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 3, 1, 3, 9, 3, 1, 3), OctetString().subtype(subtypeSpec=ValueSizeConstraint(4, 4)).setFixedLength(4)).setMaxAccess("readwrite")
if mibBuilder.loadTexts: wtWebGraphAnalog57662BinaryTcpServerInputTrigger.setStatus('mandatory')
wtWebGraphAnalog57662BinaryTcpServerApplicationMode = MibTableColumn((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 3, 1, 3, 9, 3, 1, 4), OctetString().subtype(subtypeSpec=ValueSizeConstraint(4, 4)).setFixedLength(4)).setMaxAccess("readwrite")
if mibBuilder.loadTexts: wtWebGraphAnalog57662BinaryTcpServerApplicationMode.setStatus('mandatory')
wtWebGraphAnalog57662BinaryTcpClientLocalPort = MibTableColumn((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 3, 1, 3, 9, 3, 1, 5), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 65535))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: wtWebGraphAnalog57662BinaryTcpClientLocalPort.setStatus('mandatory')
wtWebGraphAnalog57662BinaryTcpClientServerPort = MibTableColumn((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 3, 1, 3, 9, 3, 1, 6), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 65535))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: wtWebGraphAnalog57662BinaryTcpClientServerPort.setStatus('mandatory')
wtWebGraphAnalog57662BinaryTcpClientServerIpAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 3, 1, 3, 9, 3, 1, 7), OctetString()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: wtWebGraphAnalog57662BinaryTcpClientServerIpAddr.setStatus('mandatory')
wtWebGraphAnalog57662BinaryTcpClientServerPassword = MibTableColumn((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 3, 1, 3, 9, 3, 1, 8), OctetString()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: wtWebGraphAnalog57662BinaryTcpClientServerPassword.setStatus('mandatory')
wtWebGraphAnalog57662BinaryTcpClientInactivity = MibTableColumn((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 3, 1, 3, 9, 3, 1, 9), Integer32()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: wtWebGraphAnalog57662BinaryTcpClientInactivity.setStatus('mandatory')
wtWebGraphAnalog57662BinaryTcpClientInputTrigger = MibTableColumn((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 3, 1, 3, 9, 3, 1, 10), OctetString().subtype(subtypeSpec=ValueSizeConstraint(4, 4)).setFixedLength(4)).setMaxAccess("readwrite")
if mibBuilder.loadTexts: wtWebGraphAnalog57662BinaryTcpClientInputTrigger.setStatus('mandatory')
wtWebGraphAnalog57662BinaryTcpClientInterval = MibTableColumn((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 3, 1, 3, 9, 3, 1, 11), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 65535))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: wtWebGraphAnalog57662BinaryTcpClientInterval.setStatus('mandatory')
wtWebGraphAnalog57662BinaryTcpClientApplicationMode = MibTableColumn((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 3, 1, 3, 9, 3, 1, 12), OctetString().subtype(subtypeSpec=ValueSizeConstraint(4, 4)).setFixedLength(4)).setMaxAccess("readwrite")
if mibBuilder.loadTexts: wtWebGraphAnalog57662BinaryTcpClientApplicationMode.setStatus('mandatory')
wtWebGraphAnalog57662BinaryUdpPeerLocalPort = MibTableColumn((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 3, 1, 3, 9, 3, 1, 13), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 65535))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: wtWebGraphAnalog57662BinaryUdpPeerLocalPort.setStatus('mandatory')
wtWebGraphAnalog57662BinaryUdpPeerRemotePort = MibTableColumn((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 3, 1, 3, 9, 3, 1, 14), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 65535))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: wtWebGraphAnalog57662BinaryUdpPeerRemotePort.setStatus('mandatory')
wtWebGraphAnalog57662BinaryUdpPeerRemoteIpAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 3, 1, 3, 9, 3, 1, 15), OctetString()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: wtWebGraphAnalog57662BinaryUdpPeerRemoteIpAddr.setStatus('mandatory')
wtWebGraphAnalog57662BinaryUdpPeerInputTrigger = MibTableColumn((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 3, 1, 3, 9, 3, 1, 16), OctetString().subtype(subtypeSpec=ValueSizeConstraint(4, 4)).setFixedLength(4)).setMaxAccess("readwrite")
if mibBuilder.loadTexts: wtWebGraphAnalog57662BinaryUdpPeerInputTrigger.setStatus('mandatory')
wtWebGraphAnalog57662BinaryUdpPeerInterval = MibTableColumn((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 3, 1, 3, 9, 3, 1, 17), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 65535))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: wtWebGraphAnalog57662BinaryUdpPeerInterval.setStatus('mandatory')
wtWebGraphAnalog57662BinaryUdpPeerApplicationMode = MibTableColumn((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 3, 1, 3, 9, 3, 1, 18), OctetString().subtype(subtypeSpec=ValueSizeConstraint(4, 4)).setFixedLength(4)).setMaxAccess("readwrite")
if mibBuilder.loadTexts: wtWebGraphAnalog57662BinaryUdpPeerApplicationMode.setStatus('mandatory')
wtWebGraphAnalog57662BinaryConnectedPort = MibTableColumn((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 3, 1, 3, 9, 3, 1, 19), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 65535))).setMaxAccess("readonly")
if mibBuilder.loadTexts: wtWebGraphAnalog57662BinaryConnectedPort.setStatus('mandatory')
wtWebGraphAnalog57662BinaryConnectedIpAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 3, 1, 3, 9, 3, 1, 20), IpAddress()).setMaxAccess("readonly")
if mibBuilder.loadTexts: wtWebGraphAnalog57662BinaryConnectedIpAddr.setStatus('mandatory')
wtWebGraphAnalog57662BinaryTcpServerClientHttpPort = MibTableColumn((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 3, 1, 3, 9, 3, 1, 21), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 65535))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: wtWebGraphAnalog57662BinaryTcpServerClientHttpPort.setStatus('mandatory')
wtWebGraphAnalog57662BinaryTcpClientServerHttpPort = MibTableColumn((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 3, 1, 3, 9, 3, 1, 22), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 65535))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: wtWebGraphAnalog57662BinaryTcpClientServerHttpPort.setStatus('mandatory')
wtWebGraphAnalog57662BinaryTcpServerHysteresis1 = MibTableColumn((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 3, 1, 3, 9, 3, 1, 23), OctetString()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: wtWebGraphAnalog57662BinaryTcpServerHysteresis1.setStatus('mandatory')
wtWebGraphAnalog57662BinaryTcpServerHysteresis2 = MibTableColumn((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 3, 1, 3, 9, 3, 1, 24), OctetString()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: wtWebGraphAnalog57662BinaryTcpServerHysteresis2.setStatus('mandatory')
wtWebGraphAnalog57662BinaryTcpClientHysteresis1 = MibTableColumn((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 3, 1, 3, 9, 3, 1, 25), OctetString()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: wtWebGraphAnalog57662BinaryTcpClientHysteresis1.setStatus('mandatory')
wtWebGraphAnalog57662BinaryTcpClientHysteresis2 = MibTableColumn((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 3, 1, 3, 9, 3, 1, 26), OctetString()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: wtWebGraphAnalog57662BinaryTcpClientHysteresis2.setStatus('mandatory')
wtWebGraphAnalog57662BinaryUdpPeerHysteresis1 = MibTableColumn((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 3, 1, 3, 9, 3, 1, 27), OctetString()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: wtWebGraphAnalog57662BinaryUdpPeerHysteresis1.setStatus('mandatory')
wtWebGraphAnalog57662BinaryUdpPeerHysteresis2 = MibTableColumn((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 3, 1, 3, 9, 3, 1, 28), OctetString()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: wtWebGraphAnalog57662BinaryUdpPeerHysteresis2.setStatus('mandatory')
wtWebGraphAnalog57662LoggerTimebase = MibScalar((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 3, 1, 4, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6))).clone(namedValues=NamedValues(("wtWebGraphAnalog57662Datalogger-15Sec", 1), ("wtWebGraphAnalog57662Datalogger-30Sec", 2), ("wtWebGraphAnalog57662Datalogger-1Min", 3), ("wtWebGraphAnalog57662Datalogger-5Min", 4), ("wtWebGraphAnalog57662Datalogger-15Min", 5), ("wtWebGraphAnalog57662Datalogger-60Min", 6)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: wtWebGraphAnalog57662LoggerTimebase.setStatus('mandatory')
wtWebGraphAnalog57662LoggerSensorSel = MibScalar((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 3, 1, 4, 2), OctetString().subtype(subtypeSpec=ValueSizeConstraint(4, 4)).setFixedLength(4)).setMaxAccess("readwrite")
if mibBuilder.loadTexts: wtWebGraphAnalog57662LoggerSensorSel.setStatus('mandatory')
wtWebGraphAnalog57662DisplaySensorSel = MibScalar((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 3, 1, 4, 3), OctetString().subtype(subtypeSpec=ValueSizeConstraint(4, 4)).setFixedLength(4)).setMaxAccess("readwrite")
if mibBuilder.loadTexts: wtWebGraphAnalog57662DisplaySensorSel.setStatus('mandatory')
wtWebGraphAnalog57662SensorColorTable = MibTable((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 3, 1, 4, 4), )
if mibBuilder.loadTexts: wtWebGraphAnalog57662SensorColorTable.setStatus('mandatory')
wtWebGraphAnalog57662SensorColorEntry = MibTableRow((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 3, 1, 4, 4, 1), ).setIndexNames((0, "WebGraph-AnalogIO-57662-US-MIB", "wtWebGraphAnalog57662SensorNo"))
if mibBuilder.loadTexts: wtWebGraphAnalog57662SensorColorEntry.setStatus('mandatory')
wtWebGraphAnalog57662SensorColor = MibTableColumn((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 3, 1, 4, 4, 1, 1), OctetString().subtype(subtypeSpec=ValueSizeConstraint(3, 3)).setFixedLength(3)).setMaxAccess("readwrite")
if mibBuilder.loadTexts: wtWebGraphAnalog57662SensorColor.setStatus('mandatory')
wtWebGraphAnalog57662AutoScaleEnable = MibScalar((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 3, 1, 4, 5), OctetString()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: wtWebGraphAnalog57662AutoScaleEnable.setStatus('mandatory')
wtWebGraphAnalog57662VerticalUpperLimit = MibScalar((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 3, 1, 4, 6), OctetString()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: wtWebGraphAnalog57662VerticalUpperLimit.setStatus('mandatory')
wtWebGraphAnalog57662VerticalLowerLimit = MibScalar((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 3, 1, 4, 7), OctetString()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: wtWebGraphAnalog57662VerticalLowerLimit.setStatus('mandatory')
wtWebGraphAnalog57662HorizontalZoom = MibScalar((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 3, 1, 4, 8), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6))).clone(namedValues=NamedValues(("wtWebGraphAnalog57662Zoom-25min", 1), ("wtWebGraphAnalog57662Zoom-75min", 2), ("wtWebGraphAnalog57662Zoom-5hrs", 3), ("wtWebGraphAnalog57662Zoom-30hrs", 4), ("wtWebGraphAnalog57662Zoom-5days", 5), ("wtWebGraphAnalog57662Zoom-25days", 6)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: wtWebGraphAnalog57662HorizontalZoom.setStatus('mandatory')
wtWebGraphAnalog57662AlarmCount = MibScalar((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 3, 1, 5, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 8))).setMaxAccess("readonly")
if mibBuilder.loadTexts: wtWebGraphAnalog57662AlarmCount.setStatus('mandatory')
wtWebGraphAnalog57662AlarmIfTable = MibTable((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 3, 1, 5, 2), )
if mibBuilder.loadTexts: wtWebGraphAnalog57662AlarmIfTable.setStatus('mandatory')
wtWebGraphAnalog57662AlarmIfEntry = MibTableRow((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 3, 1, 5, 2, 1), ).setIndexNames((0, "WebGraph-AnalogIO-57662-US-MIB", "wtWebGraphAnalog57662AlarmNo"))
if mibBuilder.loadTexts: wtWebGraphAnalog57662AlarmIfEntry.setStatus('mandatory')
wtWebGraphAnalog57662AlarmNo = MibTableColumn((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 3, 1, 5, 2, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 8))).setMaxAccess("readonly")
if mibBuilder.loadTexts: wtWebGraphAnalog57662AlarmNo.setStatus('mandatory')
wtWebGraphAnalog57662AlarmTable = MibTable((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 3, 1, 5, 3), )
if mibBuilder.loadTexts: wtWebGraphAnalog57662AlarmTable.setStatus('mandatory')
wtWebGraphAnalog57662AlarmEntry = MibTableRow((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 3, 1, 5, 3, 1), ).setIndexNames((0, "WebGraph-AnalogIO-57662-US-MIB", "wtWebGraphAnalog57662AlarmNo"))
if mibBuilder.loadTexts: wtWebGraphAnalog57662AlarmEntry.setStatus('mandatory')
wtWebGraphAnalog57662AlarmTrigger = MibTableColumn((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 3, 1, 5, 3, 1, 1), OctetString().subtype(subtypeSpec=ValueSizeConstraint(4, 4)).setFixedLength(4)).setMaxAccess("readwrite")
if mibBuilder.loadTexts: wtWebGraphAnalog57662AlarmTrigger.setStatus('mandatory')
wtWebGraphAnalog57662AlarmMin1 = MibTableColumn((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 3, 1, 5, 3, 1, 2), OctetString()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: wtWebGraphAnalog57662AlarmMin1.setStatus('mandatory')
wtWebGraphAnalog57662AlarmMax1 = MibTableColumn((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 3, 1, 5, 3, 1, 3), OctetString()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: wtWebGraphAnalog57662AlarmMax1.setStatus('mandatory')
wtWebGraphAnalog57662AlarmHysteresis1 = MibTableColumn((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 3, 1, 5, 3, 1, 4), OctetString()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: wtWebGraphAnalog57662AlarmHysteresis1.setStatus('mandatory')
wtWebGraphAnalog57662AlarmDelay = MibTableColumn((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 3, 1, 5, 3, 1, 5), OctetString()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: wtWebGraphAnalog57662AlarmDelay.setStatus('mandatory')
wtWebGraphAnalog57662AlarmInterval = MibTableColumn((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 3, 1, 5, 3, 1, 6), OctetString()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: wtWebGraphAnalog57662AlarmInterval.setStatus('mandatory')
wtWebGraphAnalog57662AlarmEnable = MibTableColumn((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 3, 1, 5, 3, 1, 7), OctetString().subtype(subtypeSpec=ValueSizeConstraint(4, 4)).setFixedLength(4)).setMaxAccess("readwrite")
if mibBuilder.loadTexts: wtWebGraphAnalog57662AlarmEnable.setStatus('mandatory')
wtWebGraphAnalog57662AlarmEMailAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 3, 1, 5, 3, 1, 8), OctetString()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: wtWebGraphAnalog57662AlarmEMailAddr.setStatus('mandatory')
wtWebGraphAnalog57662AlarmMailSubject = MibTableColumn((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 3, 1, 5, 3, 1, 9), OctetString()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: wtWebGraphAnalog57662AlarmMailSubject.setStatus('mandatory')
wtWebGraphAnalog57662AlarmMailText = MibTableColumn((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 3, 1, 5, 3, 1, 10), OctetString()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: wtWebGraphAnalog57662AlarmMailText.setStatus('mandatory')
wtWebGraphAnalog57662AlarmManagerIP = MibTableColumn((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 3, 1, 5, 3, 1, 11), OctetString()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: wtWebGraphAnalog57662AlarmManagerIP.setStatus('mandatory')
wtWebGraphAnalog57662AlarmTrapText = MibTableColumn((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 3, 1, 5, 3, 1, 12), OctetString()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: wtWebGraphAnalog57662AlarmTrapText.setStatus('mandatory')
wtWebGraphAnalog57662AlarmMailOptions = MibTableColumn((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 3, 1, 5, 3, 1, 13), OctetString().subtype(subtypeSpec=ValueSizeConstraint(4, 4)).setFixedLength(4)).setMaxAccess("readwrite")
if mibBuilder.loadTexts: wtWebGraphAnalog57662AlarmMailOptions.setStatus('mandatory')
wtWebGraphAnalog57662AlarmTcpIpAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 3, 1, 5, 3, 1, 14), OctetString()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: wtWebGraphAnalog57662AlarmTcpIpAddr.setStatus('mandatory')
wtWebGraphAnalog57662AlarmTcpPort = MibTableColumn((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 3, 1, 5, 3, 1, 15), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 65535))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: wtWebGraphAnalog57662AlarmTcpPort.setStatus('mandatory')
wtWebGraphAnalog57662AlarmTcpText = MibTableColumn((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 3, 1, 5, 3, 1, 16), OctetString()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: wtWebGraphAnalog57662AlarmTcpText.setStatus('mandatory')
wtWebGraphAnalog57662AlarmClearMailSubject = MibTableColumn((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 3, 1, 5, 3, 1, 17), OctetString()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: wtWebGraphAnalog57662AlarmClearMailSubject.setStatus('mandatory')
wtWebGraphAnalog57662AlarmClearMailText = MibTableColumn((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 3, 1, 5, 3, 1, 18), OctetString()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: wtWebGraphAnalog57662AlarmClearMailText.setStatus('mandatory')
wtWebGraphAnalog57662AlarmClearTrapText = MibTableColumn((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 3, 1, 5, 3, 1, 19), OctetString()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: wtWebGraphAnalog57662AlarmClearTrapText.setStatus('mandatory')
wtWebGraphAnalog57662AlarmClearTcpText = MibTableColumn((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 3, 1, 5, 3, 1, 20), OctetString()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: wtWebGraphAnalog57662AlarmClearTcpText.setStatus('mandatory')
wtWebGraphAnalog57662AlarmMin2 = MibTableColumn((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 3, 1, 5, 3, 1, 21), OctetString()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: wtWebGraphAnalog57662AlarmMin2.setStatus('mandatory')
wtWebGraphAnalog57662AlarmMax2 = MibTableColumn((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 3, 1, 5, 3, 1, 22), OctetString()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: wtWebGraphAnalog57662AlarmMax2.setStatus('mandatory')
wtWebGraphAnalog57662AlarmHysteresis2 = MibTableColumn((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 3, 1, 5, 3, 1, 23), OctetString()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: wtWebGraphAnalog57662AlarmHysteresis2.setStatus('mandatory')
wtWebGraphAnalog57662AlarmSyslogIpAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 3, 1, 5, 3, 1, 24), OctetString()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: wtWebGraphAnalog57662AlarmSyslogIpAddr.setStatus('mandatory')
wtWebGraphAnalog57662AlarmSyslogPort = MibTableColumn((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 3, 1, 5, 3, 1, 25), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 65535))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: wtWebGraphAnalog57662AlarmSyslogPort.setStatus('mandatory')
wtWebGraphAnalog57662AlarmSyslogText = MibTableColumn((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 3, 1, 5, 3, 1, 26), OctetString()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: wtWebGraphAnalog57662AlarmSyslogText.setStatus('mandatory')
wtWebGraphAnalog57662AlarmSyslogClearText = MibTableColumn((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 3, 1, 5, 3, 1, 27), OctetString()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: wtWebGraphAnalog57662AlarmSyslogClearText.setStatus('mandatory')
wtWebGraphAnalog57662AlarmFtpDataPort = MibTableColumn((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 3, 1, 5, 3, 1, 28), OctetString()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: wtWebGraphAnalog57662AlarmFtpDataPort.setStatus('mandatory')
wtWebGraphAnalog57662AlarmFtpFileName = MibTableColumn((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 3, 1, 5, 3, 1, 29), OctetString()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: wtWebGraphAnalog57662AlarmFtpFileName.setStatus('mandatory')
wtWebGraphAnalog57662AlarmFtpText = MibTableColumn((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 3, 1, 5, 3, 1, 30), OctetString()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: wtWebGraphAnalog57662AlarmFtpText.setStatus('mandatory')
wtWebGraphAnalog57662AlarmFtpClearText = MibTableColumn((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 3, 1, 5, 3, 1, 31), OctetString()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: wtWebGraphAnalog57662AlarmFtpClearText.setStatus('mandatory')
wtWebGraphAnalog57662AlarmFtpOption = MibTableColumn((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 3, 1, 5, 3, 1, 32), OctetString().subtype(subtypeSpec=ValueSizeConstraint(4, 4)).setFixedLength(4)).setMaxAccess("readwrite")
if mibBuilder.loadTexts: wtWebGraphAnalog57662AlarmFtpOption.setStatus('mandatory')
wtWebGraphAnalog57662AlarmTimerCron = MibTableColumn((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 3, 1, 5, 3, 1, 33), OctetString()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: wtWebGraphAnalog57662AlarmTimerCron.setStatus('mandatory')
wtWebGraphAnalog57662GraphicsBaseEnable = MibScalar((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 3, 1, 6, 1, 1), OctetString()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: wtWebGraphAnalog57662GraphicsBaseEnable.setStatus('mandatory')
wtWebGraphAnalog57662GraphicsBaseWidth = MibScalar((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 3, 1, 6, 1, 2), Integer32()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: wtWebGraphAnalog57662GraphicsBaseWidth.setStatus('mandatory')
wtWebGraphAnalog57662GraphicsBaseHeight = MibScalar((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 3, 1, 6, 1, 3), Integer32()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: wtWebGraphAnalog57662GraphicsBaseHeight.setStatus('mandatory')
wtWebGraphAnalog57662GraphicsBaseFrameColor = MibScalar((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 3, 1, 6, 1, 4), OctetString().subtype(subtypeSpec=ValueSizeConstraint(3, 3)).setFixedLength(3)).setMaxAccess("readwrite")
if mibBuilder.loadTexts: wtWebGraphAnalog57662GraphicsBaseFrameColor.setStatus('mandatory')
wtWebGraphAnalog57662GraphicsBaseBackgroundColor = MibScalar((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 3, 1, 6, 1, 5), OctetString().subtype(subtypeSpec=ValueSizeConstraint(3, 3)).setFixedLength(3)).setMaxAccess("readwrite")
if mibBuilder.loadTexts: wtWebGraphAnalog57662GraphicsBaseBackgroundColor.setStatus('mandatory')
wtWebGraphAnalog57662GraphicsBasePollingrate = MibScalar((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 3, 1, 6, 1, 6), Integer32()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: wtWebGraphAnalog57662GraphicsBasePollingrate.setStatus('mandatory')
wtWebGraphAnalog57662GraphicsSelectDisplaySensorSel = MibScalar((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 3, 1, 6, 2, 1), OctetString().subtype(subtypeSpec=ValueSizeConstraint(4, 4)).setFixedLength(4)).setMaxAccess("readwrite")
if mibBuilder.loadTexts: wtWebGraphAnalog57662GraphicsSelectDisplaySensorSel.setStatus('mandatory')
wtWebGraphAnalog57662GraphicsSelectDisplayShowExtrem = MibScalar((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 3, 1, 6, 2, 2), OctetString().subtype(subtypeSpec=ValueSizeConstraint(4, 4)).setFixedLength(4)).setMaxAccess("readwrite")
if mibBuilder.loadTexts: wtWebGraphAnalog57662GraphicsSelectDisplayShowExtrem.setStatus('mandatory')
wtWebGraphAnalog57662SensorColor2Table = MibTable((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 3, 1, 6, 2, 3), )
if mibBuilder.loadTexts: wtWebGraphAnalog57662SensorColor2Table.setStatus('mandatory')
wtWebGraphAnalog57662SensorColor2Entry = MibTableRow((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 3, 1, 6, 2, 3, 1), ).setIndexNames((0, "WebGraph-AnalogIO-57662-US-MIB", "wtWebGraphAnalog57662SensorNo"))
if mibBuilder.loadTexts: wtWebGraphAnalog57662SensorColor2Entry.setStatus('mandatory')
wtWebGraphAnalog57662GraphicsSensorColor = MibTableColumn((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 3, 1, 6, 2, 3, 1, 1), OctetString().subtype(subtypeSpec=ValueSizeConstraint(3, 3)).setFixedLength(3)).setMaxAccess("readwrite")
if mibBuilder.loadTexts: wtWebGraphAnalog57662GraphicsSensorColor.setStatus('mandatory')
wtWebGraphAnalog57662GraphicsSelectScale = MibTableColumn((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 3, 1, 6, 2, 3, 1, 2), OctetString()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: wtWebGraphAnalog57662GraphicsSelectScale.setStatus('mandatory')
wtWebGraphAnalog57662GraphicsScaleAutoScaleEnable = MibScalar((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 3, 1, 6, 3, 1), OctetString()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: wtWebGraphAnalog57662GraphicsScaleAutoScaleEnable.setStatus('mandatory')
wtWebGraphAnalog57662GraphicsScaleAutoFitEnable = MibScalar((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 3, 1, 6, 3, 2), OctetString()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: wtWebGraphAnalog57662GraphicsScaleAutoFitEnable.setStatus('mandatory')
wtWebGraphAnalog57662GraphicsScale1Min = MibScalar((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 3, 1, 6, 3, 3), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: wtWebGraphAnalog57662GraphicsScale1Min.setStatus('mandatory')
wtWebGraphAnalog57662GraphicsScale2Min = MibScalar((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 3, 1, 6, 3, 4), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: wtWebGraphAnalog57662GraphicsScale2Min.setStatus('mandatory')
wtWebGraphAnalog57662GraphicsScale1Max = MibScalar((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 3, 1, 6, 3, 7), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: wtWebGraphAnalog57662GraphicsScale1Max.setStatus('mandatory')
wtWebGraphAnalog57662GraphicsScale2Max = MibScalar((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 3, 1, 6, 3, 8), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: wtWebGraphAnalog57662GraphicsScale2Max.setStatus('mandatory')
wtWebGraphAnalog57662GraphicsScale1Unit = MibScalar((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 3, 1, 6, 3, 11), OctetString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: wtWebGraphAnalog57662GraphicsScale1Unit.setStatus('mandatory')
wtWebGraphAnalog57662GraphicsScale2Unit = MibScalar((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 3, 1, 6, 3, 12), OctetString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: wtWebGraphAnalog57662GraphicsScale2Unit.setStatus('mandatory')
wtWebGraphAnalog57662ReportCount = MibScalar((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 3, 1, 7, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 8))).setMaxAccess("readonly")
if mibBuilder.loadTexts: wtWebGraphAnalog57662ReportCount.setStatus('mandatory')
wtWebGraphAnalog57662ReportIfTable = MibTable((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 3, 1, 7, 2), )
if mibBuilder.loadTexts: wtWebGraphAnalog57662ReportIfTable.setStatus('mandatory')
wtWebGraphAnalog57662ReportIfEntry = MibTableRow((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 3, 1, 7, 2, 1), ).setIndexNames((0, "WebGraph-AnalogIO-57662-US-MIB", "wtWebGraphAnalog57662ReportNo"))
if mibBuilder.loadTexts: wtWebGraphAnalog57662ReportIfEntry.setStatus('mandatory')
wtWebGraphAnalog57662ReportNo = MibTableColumn((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 3, 1, 7, 2, 1, 1), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: wtWebGraphAnalog57662ReportNo.setStatus('mandatory')
wtWebGraphAnalog57662ReportTable = MibTable((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 3, 1, 7, 3), )
if mibBuilder.loadTexts: wtWebGraphAnalog57662ReportTable.setStatus('mandatory')
wtWebGraphAnalog57662ReportEntry = MibTableRow((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 3, 1, 7, 3, 1), ).setIndexNames((0, "WebGraph-AnalogIO-57662-US-MIB", "wtWebGraphAnalog57662ReportNo"))
if mibBuilder.loadTexts: wtWebGraphAnalog57662ReportEntry.setStatus('mandatory')
wtWebGraphAnalog57662ReportEnable = MibTableColumn((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 3, 1, 7, 3, 1, 1), OctetString().subtype(subtypeSpec=ValueSizeConstraint(4, 4)).setFixedLength(4)).setMaxAccess("readwrite")
if mibBuilder.loadTexts: wtWebGraphAnalog57662ReportEnable.setStatus('mandatory')
wtWebGraphAnalog57662ReportTimerCron = MibTableColumn((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 3, 1, 7, 3, 1, 2), OctetString()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: wtWebGraphAnalog57662ReportTimerCron.setStatus('mandatory')
wtWebGraphAnalog57662ReportMethodeEnable = MibTableColumn((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 3, 1, 7, 3, 1, 3), OctetString().subtype(subtypeSpec=ValueSizeConstraint(4, 4)).setFixedLength(4)).setMaxAccess("readwrite")
if mibBuilder.loadTexts: wtWebGraphAnalog57662ReportMethodeEnable.setStatus('mandatory')
wtWebGraphAnalog57662ReportEMailAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 3, 1, 7, 3, 1, 8), OctetString()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: wtWebGraphAnalog57662ReportEMailAddr.setStatus('mandatory')
wtWebGraphAnalog57662ReportMailSubject = MibTableColumn((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 3, 1, 7, 3, 1, 9), OctetString()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: wtWebGraphAnalog57662ReportMailSubject.setStatus('mandatory')
wtWebGraphAnalog57662ReportMailText = MibTableColumn((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 3, 1, 7, 3, 1, 10), OctetString()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: wtWebGraphAnalog57662ReportMailText.setStatus('mandatory')
wtWebGraphAnalog57662ReportManagerIP = MibTableColumn((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 3, 1, 7, 3, 1, 11), OctetString()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: wtWebGraphAnalog57662ReportManagerIP.setStatus('mandatory')
wtWebGraphAnalog57662ReportTrapText = MibTableColumn((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 3, 1, 7, 3, 1, 12), OctetString()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: wtWebGraphAnalog57662ReportTrapText.setStatus('mandatory')
wtWebGraphAnalog57662ReportMailOptions = MibTableColumn((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 3, 1, 7, 3, 1, 13), OctetString().subtype(subtypeSpec=ValueSizeConstraint(4, 4)).setFixedLength(4)).setMaxAccess("readwrite")
if mibBuilder.loadTexts: wtWebGraphAnalog57662ReportMailOptions.setStatus('mandatory')
wtWebGraphAnalog57662ReportTcpIpAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 3, 1, 7, 3, 1, 14), OctetString()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: wtWebGraphAnalog57662ReportTcpIpAddr.setStatus('mandatory')
wtWebGraphAnalog57662ReportTcpPort = MibTableColumn((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 3, 1, 7, 3, 1, 15), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 65535))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: wtWebGraphAnalog57662ReportTcpPort.setStatus('mandatory')
wtWebGraphAnalog57662ReportTcpText = MibTableColumn((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 3, 1, 7, 3, 1, 16), OctetString()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: wtWebGraphAnalog57662ReportTcpText.setStatus('mandatory')
wtWebGraphAnalog57662ReportClearMailSubject = MibTableColumn((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 3, 1, 7, 3, 1, 17), OctetString()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: wtWebGraphAnalog57662ReportClearMailSubject.setStatus('mandatory')
wtWebGraphAnalog57662ReportClearMailText = MibTableColumn((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 3, 1, 7, 3, 1, 18), OctetString()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: wtWebGraphAnalog57662ReportClearMailText.setStatus('mandatory')
wtWebGraphAnalog57662ReportClearTrapText = MibTableColumn((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 3, 1, 7, 3, 1, 19), OctetString()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: wtWebGraphAnalog57662ReportClearTrapText.setStatus('mandatory')
wtWebGraphAnalog57662ReportClearTcpText = MibTableColumn((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 3, 1, 7, 3, 1, 20), OctetString()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: wtWebGraphAnalog57662ReportClearTcpText.setStatus('mandatory')
wtWebGraphAnalog57662ReportSyslogIpAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 3, 1, 7, 3, 1, 24), OctetString()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: wtWebGraphAnalog57662ReportSyslogIpAddr.setStatus('mandatory')
wtWebGraphAnalog57662ReportSyslogPort = MibTableColumn((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 3, 1, 7, 3, 1, 25), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 65535))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: wtWebGraphAnalog57662ReportSyslogPort.setStatus('mandatory')
wtWebGraphAnalog57662ReportSyslogText = MibTableColumn((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 3, 1, 7, 3, 1, 26), OctetString()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: wtWebGraphAnalog57662ReportSyslogText.setStatus('mandatory')
wtWebGraphAnalog57662ReportSyslogClearText = MibTableColumn((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 3, 1, 7, 3, 1, 27), OctetString()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: wtWebGraphAnalog57662ReportSyslogClearText.setStatus('mandatory')
wtWebGraphAnalog57662ReportFtpDataPort = MibTableColumn((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 3, 1, 7, 3, 1, 28), OctetString()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: wtWebGraphAnalog57662ReportFtpDataPort.setStatus('mandatory')
wtWebGraphAnalog57662ReportFtpFileName = MibTableColumn((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 3, 1, 7, 3, 1, 29), OctetString()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: wtWebGraphAnalog57662ReportFtpFileName.setStatus('mandatory')
wtWebGraphAnalog57662ReportFtpText = MibTableColumn((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 3, 1, 7, 3, 1, 30), OctetString()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: wtWebGraphAnalog57662ReportFtpText.setStatus('mandatory')
wtWebGraphAnalog57662ReportFtpClearText = MibTableColumn((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 3, 1, 7, 3, 1, 31), OctetString()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: wtWebGraphAnalog57662ReportFtpClearText.setStatus('mandatory')
wtWebGraphAnalog57662ReportFtpOption = MibTableColumn((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 3, 1, 7, 3, 1, 32), OctetString().subtype(subtypeSpec=ValueSizeConstraint(4, 4)).setFixedLength(4)).setMaxAccess("readwrite")
if mibBuilder.loadTexts: wtWebGraphAnalog57662ReportFtpOption.setStatus('mandatory')
wtWebGraphAnalog57662PortTable = MibTable((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 3, 2, 1), )
if mibBuilder.loadTexts: wtWebGraphAnalog57662PortTable.setStatus('mandatory')
wtWebGraphAnalog57662PortEntry = MibTableRow((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 3, 2, 1, 1), ).setIndexNames((0, "WebGraph-AnalogIO-57662-US-MIB", "wtWebGraphAnalog57662SensorNo"))
if mibBuilder.loadTexts: wtWebGraphAnalog57662PortEntry.setStatus('mandatory')
wtWebGraphAnalog57662PortName = MibTableColumn((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 3, 2, 1, 1, 1), OctetString()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: wtWebGraphAnalog57662PortName.setStatus('mandatory')
wtWebGraphAnalog57662PortText = MibTableColumn((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 3, 2, 1, 1, 2), OctetString()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: wtWebGraphAnalog57662PortText.setStatus('mandatory')
wtWebGraphAnalog57662PortOffset1 = MibTableColumn((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 3, 2, 1, 1, 3), OctetString()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: wtWebGraphAnalog57662PortOffset1.setStatus('mandatory')
wtWebGraphAnalog57662SetPoint1 = MibTableColumn((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 3, 2, 1, 1, 4), OctetString()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: wtWebGraphAnalog57662SetPoint1.setStatus('mandatory')
wtWebGraphAnalog57662PortOffset2 = MibTableColumn((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 3, 2, 1, 1, 5), OctetString()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: wtWebGraphAnalog57662PortOffset2.setStatus('mandatory')
wtWebGraphAnalog57662SetPoint2 = MibTableColumn((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 3, 2, 1, 1, 6), OctetString()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: wtWebGraphAnalog57662SetPoint2.setStatus('mandatory')
wtWebGraphAnalog57662PortComment = MibTableColumn((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 3, 2, 1, 1, 7), OctetString()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: wtWebGraphAnalog57662PortComment.setStatus('mandatory')
wtWebGraphAnalog57662PortSensorSelect = MibTableColumn((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 3, 2, 1, 1, 8), OctetString().subtype(subtypeSpec=ValueSizeConstraint(4, 4)).setFixedLength(4)).setMaxAccess("readwrite")
if mibBuilder.loadTexts: wtWebGraphAnalog57662PortSensorSelect.setStatus('mandatory')
wtWebGraphAnalog57662PortUnit = MibTableColumn((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 3, 2, 1, 1, 9), OctetString()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: wtWebGraphAnalog57662PortUnit.setStatus('mandatory')
wtWebGraphAnalog57662PortScale0 = MibTableColumn((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 3, 2, 1, 1, 10), OctetString()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: wtWebGraphAnalog57662PortScale0.setStatus('mandatory')
wtWebGraphAnalog57662PortScale100 = MibTableColumn((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 3, 2, 1, 1, 11), OctetString()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: wtWebGraphAnalog57662PortScale100.setStatus('mandatory')
wtWebGraphAnalog57662PortOutputMode = MibTableColumn((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 3, 2, 1, 1, 12), OctetString().subtype(subtypeSpec=ValueSizeConstraint(4, 4)).setFixedLength(4)).setMaxAccess("readwrite")
if mibBuilder.loadTexts: wtWebGraphAnalog57662PortOutputMode.setStatus('mandatory')
wtWebGraphAnalog57662PortInputMode = MibTableColumn((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 3, 2, 1, 1, 13), OctetString().subtype(subtypeSpec=ValueSizeConstraint(4, 4)).setFixedLength(4)).setMaxAccess("readwrite")
if mibBuilder.loadTexts: wtWebGraphAnalog57662PortInputMode.setStatus('mandatory')
wtWebGraphAnalog57662PortCompensationValue = MibTableColumn((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 3, 2, 1, 1, 14), OctetString()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: wtWebGraphAnalog57662PortCompensationValue.setStatus('mandatory')
wtWebGraphAnalog57662PortCompensationMode = MibTableColumn((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 3, 2, 1, 1, 15), OctetString().subtype(subtypeSpec=ValueSizeConstraint(4, 4)).setFixedLength(4)).setMaxAccess("readwrite")
if mibBuilder.loadTexts: wtWebGraphAnalog57662PortCompensationMode.setStatus('mandatory')
wtWebGraphAnalog57662MfName = MibScalar((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 3, 3, 1), OctetString()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: wtWebGraphAnalog57662MfName.setStatus('mandatory')
wtWebGraphAnalog57662MfAddr = MibScalar((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 3, 3, 2), OctetString()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: wtWebGraphAnalog57662MfAddr.setStatus('mandatory')
wtWebGraphAnalog57662MfHotline = MibScalar((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 3, 3, 3), OctetString()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: wtWebGraphAnalog57662MfHotline.setStatus('mandatory')
wtWebGraphAnalog57662MfInternet = MibScalar((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 3, 3, 4), OctetString()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: wtWebGraphAnalog57662MfInternet.setStatus('mandatory')
wtWebGraphAnalog57662MfDeviceTyp = MibScalar((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 3, 3, 5), OctetString()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: wtWebGraphAnalog57662MfDeviceTyp.setStatus('mandatory')
wtWebGraphAnalog57662MfOrderNo = MibScalar((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 3, 3, 6), OctetString()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: wtWebGraphAnalog57662MfOrderNo.setStatus('mandatory')
wtWebGraphAnalog57662DiagErrorCount = MibScalar((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 4, 1), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: wtWebGraphAnalog57662DiagErrorCount.setStatus('mandatory')
wtWebGraphAnalog57662DiagBinaryError = MibScalar((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 4, 2), OctetString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: wtWebGraphAnalog57662DiagBinaryError.setStatus('mandatory')
wtWebGraphAnalog57662DiagErrorIndex = MibScalar((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 4, 3), Integer32()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: wtWebGraphAnalog57662DiagErrorIndex.setStatus('mandatory')
wtWebGraphAnalog57662DiagErrorMessage = MibScalar((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 4, 4), OctetString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: wtWebGraphAnalog57662DiagErrorMessage.setStatus('mandatory')
wtWebGraphAnalog57662DiagErrorClear = MibScalar((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29, 4, 5), Integer32()).setMaxAccess("writeonly")
if mibBuilder.loadTexts: wtWebGraphAnalog57662DiagErrorClear.setStatus('mandatory')
wtWebGraphAnalog57662Alert1 = NotificationType((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29) + (0,31)).setObjects(("WebGraph-AnalogIO-57662-US-MIB", "wtWebGraphAnalog57662AlarmTrapText"))
wtWebGraphAnalog57662Alert2 = NotificationType((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29) + (0,32)).setObjects(("WebGraph-AnalogIO-57662-US-MIB", "wtWebGraphAnalog57662AlarmTrapText"))
wtWebGraphAnalog57662Alert3 = NotificationType((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29) + (0,33)).setObjects(("WebGraph-AnalogIO-57662-US-MIB", "wtWebGraphAnalog57662AlarmTrapText"))
wtWebGraphAnalog57662Alert4 = NotificationType((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29) + (0,34)).setObjects(("WebGraph-AnalogIO-57662-US-MIB", "wtWebGraphAnalog57662AlarmTrapText"))
wtWebGraphAnalog57662Alert5 = NotificationType((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29) + (0,35)).setObjects(("WebGraph-AnalogIO-57662-US-MIB", "wtWebGraphAnalog57662AlarmTrapText"))
wtWebGraphAnalog57662Alert6 = NotificationType((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29) + (0,36)).setObjects(("WebGraph-AnalogIO-57662-US-MIB", "wtWebGraphAnalog57662AlarmTrapText"))
wtWebGraphAnalog57662Alert7 = NotificationType((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29) + (0,37)).setObjects(("WebGraph-AnalogIO-57662-US-MIB", "wtWebGraphAnalog57662AlarmTrapText"))
wtWebGraphAnalog57662Alert8 = NotificationType((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29) + (0,38)).setObjects(("WebGraph-AnalogIO-57662-US-MIB", "wtWebGraphAnalog57662AlarmTrapText"))
wtWebGraphAnalog57662Alert9 = NotificationType((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29) + (0,91)).setObjects(("WebGraph-AnalogIO-57662-US-MIB", "wtWebGraphAnalog57662AlarmClearTrapText"))
wtWebGraphAnalog57662Alert10 = NotificationType((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29) + (0,92)).setObjects(("WebGraph-AnalogIO-57662-US-MIB", "wtWebGraphAnalog57662AlarmClearTrapText"))
wtWebGraphAnalog57662Alert11 = NotificationType((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29) + (0,93)).setObjects(("WebGraph-AnalogIO-57662-US-MIB", "wtWebGraphAnalog57662AlarmClearTrapText"))
wtWebGraphAnalog57662Alert12 = NotificationType((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29) + (0,94)).setObjects(("WebGraph-AnalogIO-57662-US-MIB", "wtWebGraphAnalog57662AlarmClearTrapText"))
wtWebGraphAnalog57662Alert13 = NotificationType((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29) + (0,95)).setObjects(("WebGraph-AnalogIO-57662-US-MIB", "wtWebGraphAnalog57662AlarmClearTrapText"))
wtWebGraphAnalog57662Alert14 = NotificationType((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29) + (0,96)).setObjects(("WebGraph-AnalogIO-57662-US-MIB", "wtWebGraphAnalog57662AlarmClearTrapText"))
wtWebGraphAnalog57662Alert15 = NotificationType((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29) + (0,97)).setObjects(("WebGraph-AnalogIO-57662-US-MIB", "wtWebGraphAnalog57662AlarmClearTrapText"))
wtWebGraphAnalog57662Alert16 = NotificationType((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29) + (0,98)).setObjects(("WebGraph-AnalogIO-57662-US-MIB", "wtWebGraphAnalog57662AlarmClearTrapText"))
wtWebGraphAnalog57662AlertReport = NotificationType((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29) + (0,39)).setObjects(("WebGraph-AnalogIO-57662-US-MIB", "wtWebGraphAnalog57662AlarmTrapText"))
wtWebGraphAnalog57662AlertDiag = NotificationType((1, 3, 6, 1, 4, 1, 5040, 1, 2, 29) + (0,110)).setObjects(("WebGraph-AnalogIO-57662-US-MIB", "wtWebGraphAnalog57662DiagErrorIndex"), ("WebGraph-AnalogIO-57662-US-MIB", "wtWebGraphAnalog57662DiagErrorMessage"))
mibBuilder.exportSymbols("WebGraph-AnalogIO-57662-US-MIB", wtWebGraphAnalog57662TzOffsetHrs=wtWebGraphAnalog57662TzOffsetHrs, wtWebGraphAnalog57662ReportFtpDataPort=wtWebGraphAnalog57662ReportFtpDataPort, wtWebGraphAnalog57662Language=wtWebGraphAnalog57662Language, wtWebGraphAnalog57662SyslogServerIP=wtWebGraphAnalog57662SyslogServerIP, wtWebGraphAnalog57662AlarmTimerCron=wtWebGraphAnalog57662AlarmTimerCron, wtWebGraphAnalog57662BinaryOperationMode=wtWebGraphAnalog57662BinaryOperationMode, wtWebGraphAnalog57662PortName=wtWebGraphAnalog57662PortName, wtWebGraphAnalog57662GraphicsScale1Unit=wtWebGraphAnalog57662GraphicsScale1Unit, wtWebGraphAnalog57662FTPAccount=wtWebGraphAnalog57662FTPAccount, wtWebGraphAnalog57662BinaryTcpServerHysteresis1=wtWebGraphAnalog57662BinaryTcpServerHysteresis1, wtWebGraphAnalog57662VerticalUpperLimit=wtWebGraphAnalog57662VerticalUpperLimit, wtWebGraphAnalog57662GraphicsScaleAutoScaleEnable=wtWebGraphAnalog57662GraphicsScaleAutoScaleEnable, wtWebGraphAnalog57662MailAuthentication=wtWebGraphAnalog57662MailAuthentication, wtWebGraphAnalog57662Alert7=wtWebGraphAnalog57662Alert7, wtWebGraphAnalog57662SensorColor2Entry=wtWebGraphAnalog57662SensorColor2Entry, wtWebGraphAnalog57662TimeZone=wtWebGraphAnalog57662TimeZone, wtWebGraphAnalog57662PortOffset1=wtWebGraphAnalog57662PortOffset1, wtWebGraphAnalog57662DeviceContact=wtWebGraphAnalog57662DeviceContact, wtWebGraphAnalog57662AddConfig=wtWebGraphAnalog57662AddConfig, wtWebGraphAnalog57662Manufact=wtWebGraphAnalog57662Manufact, wtWebGraphAnalog57662GraphicsScale1Max=wtWebGraphAnalog57662GraphicsScale1Max, wtWebGraphAnalog57662BinaryTcpClientServerPort=wtWebGraphAnalog57662BinaryTcpClientServerPort, wtWebGraphAnalog57662ReportSyslogIpAddr=wtWebGraphAnalog57662ReportSyslogIpAddr, wtWebGraphAnalog57662AlarmTcpText=wtWebGraphAnalog57662AlarmTcpText, wtWebGraphAnalog57662SyslogSystemMessagesEnable=wtWebGraphAnalog57662SyslogSystemMessagesEnable, wtWebGraphAnalog57662LanguageSelect=wtWebGraphAnalog57662LanguageSelect, wtWebGraphAnalog57662TimeServer=wtWebGraphAnalog57662TimeServer, wtWebGraphAnalog57662ValuesTable=wtWebGraphAnalog57662ValuesTable, wtWebGraphAnalog57662StTzOffsetMin=wtWebGraphAnalog57662StTzOffsetMin, wtWebGraphAnalog57662BinaryTcpClientServerPassword=wtWebGraphAnalog57662BinaryTcpClientServerPassword, wtWebGraphAnalog57662ReportTrapText=wtWebGraphAnalog57662ReportTrapText, wtWebGraphAnalog57662PortScale100=wtWebGraphAnalog57662PortScale100, wtWebGraphAnalog57662BinaryUdpPeerInterval=wtWebGraphAnalog57662BinaryUdpPeerInterval, wtWebGraphAnalog57662MfDeviceTyp=wtWebGraphAnalog57662MfDeviceTyp, wtWebGraphAnalog57662Alert8=wtWebGraphAnalog57662Alert8, wtWebGraphAnalog57662Alert2=wtWebGraphAnalog57662Alert2, wtWebGraphAnalog57662TsEnable=wtWebGraphAnalog57662TsEnable, wtWebGraphAnalog57662AlarmHysteresis2=wtWebGraphAnalog57662AlarmHysteresis2, wtWebGraphAnalog57662Graphics=wtWebGraphAnalog57662Graphics, wtWebGraphAnalog57662ClockYear=wtWebGraphAnalog57662ClockYear, wtWebGraphAnalog57662ValuesEntry=wtWebGraphAnalog57662ValuesEntry, wtWebGraphAnalog57662BinaryValuesTable=wtWebGraphAnalog57662BinaryValuesTable, wtWebGraphAnalog57662SystemTrapEnable=wtWebGraphAnalog57662SystemTrapEnable, wtWebGraphAnalog57662SensorColorEntry=wtWebGraphAnalog57662SensorColorEntry, wtWebGraphAnalog57662PortTable=wtWebGraphAnalog57662PortTable, wtWebGraphAnalog57662GraphicsScale1Min=wtWebGraphAnalog57662GraphicsScale1Min, wtWebGraphAnalog57662DiagBinaryError=wtWebGraphAnalog57662DiagBinaryError, wtWebGraphAnalog57662BinaryValues=wtWebGraphAnalog57662BinaryValues, wtWebGraphAnalog57662AlarmCount=wtWebGraphAnalog57662AlarmCount, wtWebGraphAnalog57662AlarmNo=wtWebGraphAnalog57662AlarmNo, wtWebGraphAnalog57662AlarmTable=wtWebGraphAnalog57662AlarmTable, wtWebGraphAnalog57662GraphicsScale2Max=wtWebGraphAnalog57662GraphicsScale2Max, wtWebGraphAnalog57662GraphicsSensorColor=wtWebGraphAnalog57662GraphicsSensorColor, wtWebGraphAnalog57662SessCntrlPassword=wtWebGraphAnalog57662SessCntrlPassword, wtWebGraphAnalog57662SnmpCommunityStringReadWrite=wtWebGraphAnalog57662SnmpCommunityStringReadWrite, wtWebGraphAnalog57662FTPServerIP=wtWebGraphAnalog57662FTPServerIP, wtWebGraphAnalog57662SensorColor=wtWebGraphAnalog57662SensorColor, wtWebGraphAnalog57662Gateway=wtWebGraphAnalog57662Gateway, wtWebGraphAnalog57662StTzStopMode=wtWebGraphAnalog57662StTzStopMode, wtWebGraphAnalog57662AlarmEnable=wtWebGraphAnalog57662AlarmEnable, wtWebGraphAnalog57662AlarmInterval=wtWebGraphAnalog57662AlarmInterval, wtWebGraphAnalog57662DiagErrorClear=wtWebGraphAnalog57662DiagErrorClear, wtWebGraphAnalog57662SessCntrlLogout=wtWebGraphAnalog57662SessCntrlLogout, wtWebGraphAnalog57662Alert5=wtWebGraphAnalog57662Alert5, wtWebGraphAnalog57662DnsServer1=wtWebGraphAnalog57662DnsServer1, wtWebGraphAnalog57662BinaryIfTable=wtWebGraphAnalog57662BinaryIfTable, wtWebGraphAnalog57662MailAdName=wtWebGraphAnalog57662MailAdName, wtWebGraphAnalog57662AlarmSyslogIpAddr=wtWebGraphAnalog57662AlarmSyslogIpAddr, wtWebGraphAnalog57662ReportClearMailText=wtWebGraphAnalog57662ReportClearMailText, wtWebGraphAnalog57662MfOrderNo=wtWebGraphAnalog57662MfOrderNo, wtWebGraphAnalog57662BinaryTable=wtWebGraphAnalog57662BinaryTable, wtWebGraphAnalog57662DiagErrorMessage=wtWebGraphAnalog57662DiagErrorMessage, wtWebGraphAnalog57662AlarmTcpPort=wtWebGraphAnalog57662AlarmTcpPort, wtWebGraphAnalog57662BinaryUdpPeerRemoteIpAddr=wtWebGraphAnalog57662BinaryUdpPeerRemoteIpAddr, wtWebGraphAnalog57662GraphicsScale=wtWebGraphAnalog57662GraphicsScale, wtWebGraphAnalog57662TzEnable=wtWebGraphAnalog57662TzEnable, wtWebGraphAnalog57662Alert6=wtWebGraphAnalog57662Alert6, wtWebGraphAnalog57662BinaryTcpClientLocalPort=wtWebGraphAnalog57662BinaryTcpClientLocalPort, wtWebGraphAnalog57662Values=wtWebGraphAnalog57662Values, wtWebGraphAnalog57662PortScale0=wtWebGraphAnalog57662PortScale0, wtWebGraphAnalog57662TimeDate=wtWebGraphAnalog57662TimeDate, wtWebGraphAnalog57662PortOutputMode=wtWebGraphAnalog57662PortOutputMode, wtWebGraphAnalog57662StTzStartMin=wtWebGraphAnalog57662StTzStartMin, wtWebGraphAnalog57662UDP=wtWebGraphAnalog57662UDP, wtWebGraphAnalog57662ReportEMailAddr=wtWebGraphAnalog57662ReportEMailAddr, wtWebGraphAnalog57662DnsServer2=wtWebGraphAnalog57662DnsServer2, wtWebGraphAnalog57662UdpPort=wtWebGraphAnalog57662UdpPort, wtWebGraphAnalog57662AlarmSyslogClearText=wtWebGraphAnalog57662AlarmSyslogClearText, wtWebGraphAnalog57662BinaryTcpClientServerIpAddr=wtWebGraphAnalog57662BinaryTcpClientServerIpAddr, wtWebGraphAnalog57662AlarmFtpClearText=wtWebGraphAnalog57662AlarmFtpClearText, wtWebGraphAnalog57662UdpEnable=wtWebGraphAnalog57662UdpEnable, wtWebGraphAnalog57662AlarmMin1=wtWebGraphAnalog57662AlarmMin1, wtWebGraphAnalog57662AlertReport=wtWebGraphAnalog57662AlertReport, wtWebGraphAnalog57662StTzStartWday=wtWebGraphAnalog57662StTzStartWday, wtWebGraphAnalog57662AlarmIfEntry=wtWebGraphAnalog57662AlarmIfEntry, wtWebGraphAnalog57662Basic=wtWebGraphAnalog57662Basic, wtWebGraphAnalog57662AlarmEntry=wtWebGraphAnalog57662AlarmEntry, wtWebGraphAnalog57662AlarmMailOptions=wtWebGraphAnalog57662AlarmMailOptions, wtWebGraphAnalog57662DeviceName=wtWebGraphAnalog57662DeviceName, wtWebGraphAnalog57662AlarmClearMailSubject=wtWebGraphAnalog57662AlarmClearMailSubject, wtWebGraphAnalog57662Report=wtWebGraphAnalog57662Report, wtWebGraphAnalog57662PortSensorSelect=wtWebGraphAnalog57662PortSensorSelect, wtWebGraphAnalog57662ReportFtpFileName=wtWebGraphAnalog57662ReportFtpFileName, wtWebGraphAnalog57662=wtWebGraphAnalog57662, wtWebGraphAnalog57662GraphicsSelect=wtWebGraphAnalog57662GraphicsSelect, wtWebGraphAnalog57662BinaryTcpClientInputTrigger=wtWebGraphAnalog57662BinaryTcpClientInputTrigger, wtWebGraphAnalog57662ReportFtpText=wtWebGraphAnalog57662ReportFtpText, wtWebGraphAnalog57662VerticalLowerLimit=wtWebGraphAnalog57662VerticalLowerLimit, wtWebGraphAnalog57662SessCntrl=wtWebGraphAnalog57662SessCntrl, wtWebGraphAnalog57662IpAddress=wtWebGraphAnalog57662IpAddress, wtWebGraphAnalog57662Startup=wtWebGraphAnalog57662Startup, wtWebGraphAnalog57662BinaryTcpServerHysteresis2=wtWebGraphAnalog57662BinaryTcpServerHysteresis2, wtWebGraphAnalog57662BinaryUdpPeerHysteresis1=wtWebGraphAnalog57662BinaryUdpPeerHysteresis1, wtWebGraphAnalog57662ReportTcpIpAddr=wtWebGraphAnalog57662ReportTcpIpAddr, wtWebGraphAnalog57662BinaryTcpServerClientHttpPort=wtWebGraphAnalog57662BinaryTcpServerClientHttpPort, wtWebGraphAnalog57662DisplaySensorSel=wtWebGraphAnalog57662DisplaySensorSel, wtWebGraphAnalog57662ClockHrs=wtWebGraphAnalog57662ClockHrs, wtWebGraphAnalog57662SyslogEnable=wtWebGraphAnalog57662SyslogEnable, wtWebGraphAnalog57662BinaryIfEntry=wtWebGraphAnalog57662BinaryIfEntry, wtWebGraphAnalog57662LoggerTimebase=wtWebGraphAnalog57662LoggerTimebase, wtWebGraphAnalog57662ReportFtpClearText=wtWebGraphAnalog57662ReportFtpClearText, wtWebGraphAnalog57662Alert11=wtWebGraphAnalog57662Alert11, wtWebGraphAnalog57662SensorTable=wtWebGraphAnalog57662SensorTable, wtWebGraphAnalog57662AlarmMin2=wtWebGraphAnalog57662AlarmMin2, wtWebGraphAnalog57662Sensors=wtWebGraphAnalog57662Sensors, wtWebGraphAnalog57662FTPOption=wtWebGraphAnalog57662FTPOption, wtWebGraphAnalog57662FTPPassword=wtWebGraphAnalog57662FTPPassword, wtWebGraphAnalog57662AlarmIfTable=wtWebGraphAnalog57662AlarmIfTable, wtWebGraphAnalog57662SetPoint2=wtWebGraphAnalog57662SetPoint2, wtWebGraphAnalog57662DeviceClock=wtWebGraphAnalog57662DeviceClock, wtWebGraphAnalog57662ReportMailOptions=wtWebGraphAnalog57662ReportMailOptions, wtWebGraphAnalog57662ReportClearTcpText=wtWebGraphAnalog57662ReportClearTcpText, wtWebGraphAnalog57662Mail=wtWebGraphAnalog57662Mail, wtWebGraphAnalog57662ReportSyslogText=wtWebGraphAnalog57662ReportSyslogText, wtWebGraphAnalog57662StTzStopWday=wtWebGraphAnalog57662StTzStopWday, wtWebGraphAnalog57662TzOffsetMin=wtWebGraphAnalog57662TzOffsetMin, wtWebGraphAnalog57662SessCntrlAdminPassword=wtWebGraphAnalog57662SessCntrlAdminPassword, wtWebGraphAnalog57662BinaryModeNo=wtWebGraphAnalog57662BinaryModeNo, wtWebGraphAnalog57662PortUnit=wtWebGraphAnalog57662PortUnit, wtWebGraphAnalog57662DiagErrorCount=wtWebGraphAnalog57662DiagErrorCount, wtWebGraphAnalog57662Alert1=wtWebGraphAnalog57662Alert1, wtWebGraphAnalog57662Alert12=wtWebGraphAnalog57662Alert12, wtWebGraphAnalog57662Alert13=wtWebGraphAnalog57662Alert13, wtWebGraphAnalog57662AlarmFtpDataPort=wtWebGraphAnalog57662AlarmFtpDataPort, wtWebGraphAnalog57662MfName=wtWebGraphAnalog57662MfName, wtWebGraphAnalog57662ReportClearTrapText=wtWebGraphAnalog57662ReportClearTrapText, wtWebGraphAnalog57662AlarmEMailAddr=wtWebGraphAnalog57662AlarmEMailAddr, wtWebGraphAnalog57662AlarmClearTcpText=wtWebGraphAnalog57662AlarmClearTcpText, wtWebGraphAnalog57662ReportClearMailSubject=wtWebGraphAnalog57662ReportClearMailSubject, wtWebGraphAnalog57662DeviceLocation=wtWebGraphAnalog57662DeviceLocation, wtWebGraphAnalog57662GraphicsBaseHeight=wtWebGraphAnalog57662GraphicsBaseHeight, wtWebGraphAnalog57662HorizontalZoom=wtWebGraphAnalog57662HorizontalZoom, wtWebGraphAnalog57662Inventory=wtWebGraphAnalog57662Inventory, wtWebGraphAnalog57662SetPoint1=wtWebGraphAnalog57662SetPoint1, wtWebGraphAnalog57662GraphicsSelectScale=wtWebGraphAnalog57662GraphicsSelectScale, wtWebGraphAnalog57662BinaryTcpClientHysteresis1=wtWebGraphAnalog57662BinaryTcpClientHysteresis1, wtWebGraphAnalog57662BinaryTcpClientInactivity=wtWebGraphAnalog57662BinaryTcpClientInactivity, wtWebioAn1MailEnable=wtWebioAn1MailEnable, wtWebGraphAnalog57662ReportIfEntry=wtWebGraphAnalog57662ReportIfEntry, wtWebGraphAnalog57662SnmpCommunityStringTrap=wtWebGraphAnalog57662SnmpCommunityStringTrap, wtWebGraphAnalog57662AlarmMailText=wtWebGraphAnalog57662AlarmMailText, wtWebGraphAnalog57662AlarmTrigger=wtWebGraphAnalog57662AlarmTrigger, wtWebGraphAnalog57662PortComment=wtWebGraphAnalog57662PortComment, wtWebGraphAnalog57662GraphicsSelectDisplayShowExtrem=wtWebGraphAnalog57662GraphicsSelectDisplayShowExtrem, wtWebGraphAnalog57662AlarmFtpText=wtWebGraphAnalog57662AlarmFtpText, wtWebGraphAnalog57662AlarmMax2=wtWebGraphAnalog57662AlarmMax2, wtWebGraphAnalog57662ReportIfTable=wtWebGraphAnalog57662ReportIfTable, wtWebGraphAnalog57662PortCompensationValue=wtWebGraphAnalog57662PortCompensationValue, wtWebGraphAnalog57662AutoScaleEnable=wtWebGraphAnalog57662AutoScaleEnable, wtWebGraphAnalog57662Text=wtWebGraphAnalog57662Text, wtWebGraphAnalog57662SensorNo=wtWebGraphAnalog57662SensorNo, wtWebGraphAnalog57662ReportSyslogClearText=wtWebGraphAnalog57662ReportSyslogClearText, wtWebGraphAnalog57662StTzStopMonth=wtWebGraphAnalog57662StTzStopMonth, wtComServer=wtComServer, wtWebGraphAnalog57662Binary=wtWebGraphAnalog57662Binary, wtWebGraphAnalog57662AlarmMailSubject=wtWebGraphAnalog57662AlarmMailSubject, wtWebGraphAnalog57662GraphicsScale2Min=wtWebGraphAnalog57662GraphicsScale2Min, wtWebGraphAnalog57662StTzStopHrs=wtWebGraphAnalog57662StTzStopHrs, wtWebGraphAnalog57662Ports=wtWebGraphAnalog57662Ports, wtWebGraphAnalog57662BinaryUdpPeerHysteresis2=wtWebGraphAnalog57662BinaryUdpPeerHysteresis2, wtWebGraphAnalog57662AlarmSyslogPort=wtWebGraphAnalog57662AlarmSyslogPort, wtWebGraphAnalog57662ReportTcpPort=wtWebGraphAnalog57662ReportTcpPort, wtWebGraphAnalog57662MfHotline=wtWebGraphAnalog57662MfHotline, wtWebGraphAnalog57662GetHeaderEnable=wtWebGraphAnalog57662GetHeaderEnable, wtWebGraphAnalog57662AlarmMax1=wtWebGraphAnalog57662AlarmMax1, wtWebGraphAnalog57662ReportEntry=wtWebGraphAnalog57662ReportEntry, wtWebGraphAnalog57662ClockDay=wtWebGraphAnalog57662ClockDay, wtWebGraphAnalog57662MailAuthUser=wtWebGraphAnalog57662MailAuthUser, wtWebGraphAnalog57662PortOffset2=wtWebGraphAnalog57662PortOffset2, wtWebGraphAnalog57662SessCntrlConfigMode=wtWebGraphAnalog57662SessCntrlConfigMode, wtWebGraphAnalog57662AlarmClearMailText=wtWebGraphAnalog57662AlarmClearMailText, wtWebGraphAnalog57662ReportMethodeEnable=wtWebGraphAnalog57662ReportMethodeEnable, wtWebGraphAnalog57662Config=wtWebGraphAnalog57662Config, wtWebGraphAnalog57662AlarmDelay=wtWebGraphAnalog57662AlarmDelay, wtWebGraphAnalog57662SensorColor2Table=wtWebGraphAnalog57662SensorColor2Table, wtWebGraphAnalog57662HTTP=wtWebGraphAnalog57662HTTP, wtWebGraphAnalog57662SessCntrlConfigPassword=wtWebGraphAnalog57662SessCntrlConfigPassword, wtWebGraphAnalog57662Device=wtWebGraphAnalog57662Device, wtWebGraphAnalog57662BinaryModeCount=wtWebGraphAnalog57662BinaryModeCount, wtWebGraphAnalog57662PortInputMode=wtWebGraphAnalog57662PortInputMode, wtWebGraphAnalog57662TsSyncTime=wtWebGraphAnalog57662TsSyncTime, wtWebGraphAnalog57662ReportFtpOption=wtWebGraphAnalog57662ReportFtpOption, wtWebGraphAnalog57662Alert10=wtWebGraphAnalog57662Alert10, wtWebGraphAnalog57662FTPServerControlPort=wtWebGraphAnalog57662FTPServerControlPort, wtWebGraphAnalog57662ClockMonth=wtWebGraphAnalog57662ClockMonth, wtWebGraphAnalog57662GraphicsScaleAutoFitEnable=wtWebGraphAnalog57662GraphicsScaleAutoFitEnable, wtWebGraphAnalog57662Syslog=wtWebGraphAnalog57662Syslog, wtWebGraphAnalog57662AlarmHysteresis1=wtWebGraphAnalog57662AlarmHysteresis1, wtWebGraphAnalog57662GraphicsSelectDisplaySensorSel=wtWebGraphAnalog57662GraphicsSelectDisplaySensorSel, wtWebGraphAnalog57662ReportTable=wtWebGraphAnalog57662ReportTable, wut=wut, wtWebGraphAnalog57662SyslogServerPort=wtWebGraphAnalog57662SyslogServerPort, wtWebGraphAnalog57662SensorColorTable=wtWebGraphAnalog57662SensorColorTable, wtWebGraphAnalog57662StTzStartMode=wtWebGraphAnalog57662StTzStartMode, wtWebGraphAnalog57662BinaryTcpClientInterval=wtWebGraphAnalog57662BinaryTcpClientInterval, wtWebGraphAnalog57662PortEntry=wtWebGraphAnalog57662PortEntry, wtWebGraphAnalog57662MailPop3Server=wtWebGraphAnalog57662MailPop3Server, wtWebGraphAnalog57662GraphicsBaseEnable=wtWebGraphAnalog57662GraphicsBaseEnable, wtWebGraphAnalog57662Diag=wtWebGraphAnalog57662Diag, wtWebGraphAnalog57662TimeServer2=wtWebGraphAnalog57662TimeServer2, wtWebGraphAnalog57662BinaryConnectedPort=wtWebGraphAnalog57662BinaryConnectedPort, wtWebGraphAnalog57662MailReply=wtWebGraphAnalog57662MailReply, wtWebGraphAnalog57662GraphicsBaseWidth=wtWebGraphAnalog57662GraphicsBaseWidth, wtWebGraphAnalog57662ReportCount=wtWebGraphAnalog57662ReportCount, wtWebio=wtWebio, wtWebGraphAnalog57662ReportTimerCron=wtWebGraphAnalog57662ReportTimerCron, wtWebGraphAnalog57662BinaryConnectedIpAddr=wtWebGraphAnalog57662BinaryConnectedIpAddr, wtWebGraphAnalog57662DiagErrorIndex=wtWebGraphAnalog57662DiagErrorIndex, wtWebGraphAnalog57662GraphicsScale2Unit=wtWebGraphAnalog57662GraphicsScale2Unit, wtWebGraphAnalog57662TimeServer1=wtWebGraphAnalog57662TimeServer1, wtWebGraphAnalog57662ReportMailSubject=wtWebGraphAnalog57662ReportMailSubject, wtWebGraphAnalog57662ReportTcpText=wtWebGraphAnalog57662ReportTcpText, wtWebGraphAnalog57662Alert15=wtWebGraphAnalog57662Alert15, wtWebGraphAnalog57662BinaryUdpPeerInputTrigger=wtWebGraphAnalog57662BinaryUdpPeerInputTrigger, wtWebGraphAnalog57662ReportSyslogPort=wtWebGraphAnalog57662ReportSyslogPort, wtWebGraphAnalog57662MfAddr=wtWebGraphAnalog57662MfAddr, wtWebGraphAnalog57662BinaryTcpServerLocalPort=wtWebGraphAnalog57662BinaryTcpServerLocalPort, wtWebGraphAnalog57662ReportEnable=wtWebGraphAnalog57662ReportEnable, wtWebGraphAnalog57662Alert3=wtWebGraphAnalog57662Alert3, wtWebGraphAnalog57662GraphicsBaseFrameColor=wtWebGraphAnalog57662GraphicsBaseFrameColor, wtWebGraphAnalog57662MfInternet=wtWebGraphAnalog57662MfInternet, wtWebGraphAnalog57662BinaryEntry=wtWebGraphAnalog57662BinaryEntry, wtWebGraphAnalog57662Alert9=wtWebGraphAnalog57662Alert9, wtWebGraphAnalog57662AlarmTrapText=wtWebGraphAnalog57662AlarmTrapText, wtWebGraphAnalog57662SensorEntry=wtWebGraphAnalog57662SensorEntry, wtWebGraphAnalog57662ReportNo=wtWebGraphAnalog57662ReportNo, wtWebGraphAnalog57662SubnetMask=wtWebGraphAnalog57662SubnetMask, wtWebGraphAnalog57662StTzStartHrs=wtWebGraphAnalog57662StTzStartHrs, wtWebGraphAnalog57662AlarmClearTrapText=wtWebGraphAnalog57662AlarmClearTrapText, wtWebGraphAnalog57662GraphicsBasePollingrate=wtWebGraphAnalog57662GraphicsBasePollingrate, wtWebGraphAnalog57662BinaryUdpPeerLocalPort=wtWebGraphAnalog57662BinaryUdpPeerLocalPort, wtWebGraphAnalog57662GraphicsBase=wtWebGraphAnalog57662GraphicsBase, wtWebGraphAnalog57662HttpPort=wtWebGraphAnalog57662HttpPort, wtWebGraphAnalog57662Alert4=wtWebGraphAnalog57662Alert4)
mibBuilder.exportSymbols("WebGraph-AnalogIO-57662-US-MIB", wtWebGraphAnalog57662SNMP=wtWebGraphAnalog57662SNMP, wtWebGraphAnalog57662FTPUserName=wtWebGraphAnalog57662FTPUserName, wtWebGraphAnalog57662SystemTrapManagerIP=wtWebGraphAnalog57662SystemTrapManagerIP, wtWebGraphAnalog57662BinaryTcpClientHysteresis2=wtWebGraphAnalog57662BinaryTcpClientHysteresis2, wtWebGraphAnalog57662GraphicsBaseBackgroundColor=wtWebGraphAnalog57662GraphicsBaseBackgroundColor, wtWebGraphAnalog57662Datalogger=wtWebGraphAnalog57662Datalogger, wtWebGraphAnalog57662ReportMailText=wtWebGraphAnalog57662ReportMailText, wtWebGraphAnalog57662SnmpCommunityStringRead=wtWebGraphAnalog57662SnmpCommunityStringRead, wtWebGraphAnalog57662DeviceText=wtWebGraphAnalog57662DeviceText, wtWebGraphAnalog57662AlarmManagerIP=wtWebGraphAnalog57662AlarmManagerIP, wtWebGraphAnalog57662Alarm=wtWebGraphAnalog57662Alarm, wtWebGraphAnalog57662BinaryTcpClientApplicationMode=wtWebGraphAnalog57662BinaryTcpClientApplicationMode, wtWebGraphAnalog57662SnmpEnable=wtWebGraphAnalog57662SnmpEnable, wtWebGraphAnalog57662FTPEnable=wtWebGraphAnalog57662FTPEnable, wtWebGraphAnalog57662FTP=wtWebGraphAnalog57662FTP, wtWebGraphAnalog57662PortCompensationMode=wtWebGraphAnalog57662PortCompensationMode, wtWebGraphAnalog57662BinaryTcpClientServerHttpPort=wtWebGraphAnalog57662BinaryTcpClientServerHttpPort, wtWebGraphAnalog57662StTzStartMonth=wtWebGraphAnalog57662StTzStartMonth, wtWebGraphAnalog57662StTzOffsetHrs=wtWebGraphAnalog57662StTzOffsetHrs, wtWebGraphAnalog57662MailAuthPassword=wtWebGraphAnalog57662MailAuthPassword, wtWebGraphAnalog57662AlarmTcpIpAddr=wtWebGraphAnalog57662AlarmTcpIpAddr, wtWebGraphAnalog57662AlarmSyslogText=wtWebGraphAnalog57662AlarmSyslogText, wtWebGraphAnalog57662ReportManagerIP=wtWebGraphAnalog57662ReportManagerIP, wtWebGraphAnalog57662StTzStopMin=wtWebGraphAnalog57662StTzStopMin, wtWebGraphAnalog57662MailServer=wtWebGraphAnalog57662MailServer, wtWebGraphAnalog57662LoggerSensorSel=wtWebGraphAnalog57662LoggerSensorSel, wtWebGraphAnalog57662AlertDiag=wtWebGraphAnalog57662AlertDiag, wtWebGraphAnalog57662BinaryTcpServerInputTrigger=wtWebGraphAnalog57662BinaryTcpServerInputTrigger, wtWebGraphAnalog57662Network=wtWebGraphAnalog57662Network, wtWebGraphAnalog57662AlarmFtpOption=wtWebGraphAnalog57662AlarmFtpOption, wtWebGraphAnalog57662BinaryUdpPeerApplicationMode=wtWebGraphAnalog57662BinaryUdpPeerApplicationMode, wtWebGraphAnalog57662BinaryUdpPeerRemotePort=wtWebGraphAnalog57662BinaryUdpPeerRemotePort, wtWebGraphAnalog57662PortText=wtWebGraphAnalog57662PortText, wtWebGraphAnalog57662Alert14=wtWebGraphAnalog57662Alert14, wtWebGraphAnalog57662BinaryValuesEntry=wtWebGraphAnalog57662BinaryValuesEntry, wtWebGraphAnalog57662ClockMin=wtWebGraphAnalog57662ClockMin, wtWebGraphAnalog57662StTzEnable=wtWebGraphAnalog57662StTzEnable, wtWebGraphAnalog57662AlarmFtpFileName=wtWebGraphAnalog57662AlarmFtpFileName, wtWebGraphAnalog57662BinaryTcpServerApplicationMode=wtWebGraphAnalog57662BinaryTcpServerApplicationMode, wtWebGraphAnalog57662Alert16=wtWebGraphAnalog57662Alert16)
|
#!/usr/bin/env python
PART1SOL = 388611
PART2SOL = 27763113
# Right on the first try!
def part1(x):
count = 0
loc = 0
while True:
try:
dat = x[loc]
except IndexError:
return count
count += 1
x[loc] += 1
loc += dat
# 137 too low
# 169 too low
def part2(x):
count = 0
loc = 0
while True:
try:
dat = x[loc]
except IndexError:
return count
count += 1
if dat >= 3:
x[loc] -= 1
else:
x[loc] += 1
loc += dat
if __name__ == "__main__":
with open("./dec5.txt", "r") as f:
test1 = [0, 3, 0, 1, -3]
test2 = test1[:]
print(part1(test1) == 5)
print(part2(test2) == 10)
inp1 = [int(z) for z in f]
inp2 = inp1[:]
print(part1(inp1) == PART1SOL)
f.seek(0)
print(part2(inp2) == PART2SOL)
|
'''
This problem was recently asked by AirBNB:
Given a sorted array, A, with possibly duplicated elements, find the indices of the first and last occurrences of a target element, x. Return -1 if the target is not found.
Example:
Input: A = [1,3,3,5,7,8,9,9,9,15], target = 9
Output: [6,8]
Input: A = [100, 150, 150, 153], target = 150
Output: [1,2]
Input: A = [1,2,3,4,5,6,10], target = 9
Output: [-1, -1]
'''
class Solution:
def getRange(self, arr, target):
first_index = self.getRangeHelper(arr, 0, len(arr), target, 'first')
last_index = self.getRangeHelper(arr, 0, len(arr), target, 'last')
return [first_index, last_index]
def getRangeHelper(self, arr, low, high, target, index_type):
if low <= high:
mid = low + (high - low)//2
if arr[mid] < target:
return self.getRangeHelper(arr, mid+1, high, target, index_type)
elif arr[mid] > target:
return self.getRangeHelper(arr, low, mid-1, target, index_type)
else:
if index_type == 'first':
if mid > 0 and arr[mid-1] == target:
return self.getRangeHelper(arr, low, mid-1, target, index_type)
else:
if mid < len(arr)-1 and arr[mid+1] == target:
return self.getRangeHelper(arr, mid+1, high, target, index_type)
return mid
return -1
# Test program
arr = [1, 2, 2, 2, 2, 3, 4, 7, 8, 8]
x = 2
print(Solution().getRange(arr, x))
# [1, 4]
arr = [1,3,3,5,7,8,9,9,9,15]
x = 9
print(Solution().getRange(arr, x))
# [6, 8]
arr = [100, 150, 150, 153]
x = 150
print(Solution().getRange(arr, x))
# [1, 2]
arr = [1,2,3,4,5,6,10]
x = 9
print(Solution().getRange(arr, x))
# [-1 ,-1] |
#!/usr/bin/env python
# encoding: utf-8
'''
@author: Jason Lee
@license: (C) Copyright @ Jason Lee
@contact: [email protected]
@file: jianzhi_offer_28.py
@time: 2019/3/26 18:26
@desc:
字符串的排列:
输入一个字符串,按字典序打印出该字符串中字符的所有排列。
例如输入字符串abc,则打印出由字符a,b,c所能排列出来的所有字符串abc,acb,bac,bca,cab和cba。
'''
def Permutation(str):
#temp = list(set(str)) # filter out the duplicate character
temp = list(str)
if not temp:
return temp
if len(temp) == 1:
return temp
i = -2
res = temp[-1]
while i >= -len(temp):
res = combine(temp[i], res)
i -= 1
#return sorted(set(res), key=res.index)
return sorted(set(res))
def combine(a, b): # insert character a into string b
# character a will be inserted into b with len(b)+1 times
res = []
for bb in b:
i = 0
while i <= len(bb):
res.append(''.join([bb[:i], a, bb[i:]]))
i += 1
return res
if __name__ == '__main__':
str = "abc"
b = Permutation(str)
print(b)
|
# -*- coding: utf-8 -*-
"""
Created on Tue Mar 31 08:21:14 2020
@author: Shivadhar SIngh
"""
def sum_odd_digits(number):
dsum = 0
# only count odd digits
while number > 0:
# add the last digit to the sum
digit = number % 10
if digit % 2 != 0 :
dsum = dsum + digit
# print("digit = ", digit)
# print(dsum)
# divide by 10 (rounded down) to remove the last digit
number = number // 10
return dsum
def sum_even_digits(number):
m = 1 # the position of the next digit
dsum = 0 # the sum
while number % (10 ** m) != 0:
# get the m:th digit
digit = (number % (10 ** m)) // (10 ** (m - 1))
print("digit =",digit)
# only add it if even:
if digit % 2 == 0:
dsum = dsum + digit
print(dsum)
# number = number // 10
print("number = ",number)
m = m+1
print(m)
return dsum |
def foo(a, b):
return a * b
foo(1, 2) ## OK
foo(1) ## error: wrong number of arguments
|
"""
Questão #4
Vale
20
Enunciado
Faça uma função que receba uma lista que contém números inteiros positivos e textos.
Retorne uma lista em que os primeiros elementos são os números pares ordenados em ordem crescente, seguidos pelos textos sem ordenação específica
e depois pelos ímpares ordenados em ordem decrescente.
Não é necessário validar os dados de entrada. Assuma o enunciado.
Ex.: ['Casa', 1, 3, 'Fruta', 9, 1001, 'Escola', 8, 4, 'Aluno', 200]
Retorno: [4, 8, 200, 'Casa', 'Fruta', 'Escola', 'Aluno', 1001, 9, 3, 1]
"""
def separa(lista):
cont = 0
pares = []
impar = []
texto = []
while cont < len(lista):
if type(lista[cont]) == int:
if lista[cont] % 2 == 0:
pares.append(lista[cont])
else:
impar.append(lista[cont])
else:
texto.append(lista[cont])
cont += 1
saida = sorted(pares) + texto + sorted(impar,reverse=True)
return saida
lista = ['Casa', 1, 3, 'Fruta', 9, 1001, 'Escola', 8, 4, 'Aluno', 200]
print("Retorno: ", separa(lista)) |
# 7. Sa se scrie o functie care primeste ca parametri un numar x default egal cu 1,
# un numar variabil de siruri de caractere
# si un flag boolean setat default pe True.
# Pentru fiecare sir de caractere, sa se genereze o lista care sa contina caracterele care au codul ASCII divizibil cu x
# in caz ca flag-ul este setat pe True, in caz contrar sa contina caracterele care au codul ASCII nedivizibil cu x.
# Exemplu: x=2, "test", "hello", "lab002", flag=False va returna (["e", "s"], ["e", "o"], ["a"]).
# Atentie: functia trebuie sa returneze un numar variabil de liste care sa corespunda cu numarul de siruri de caractere
# primite ca input.
def generate_by_condition(x=1, flag=True, *strings):
generated_lists = []
for string in strings:
if flag:
generated_lists.append([c for c in string if ord(c) % x == 0])
else:
generated_lists.append([c for c in string if ord(c) % x != 0])
return generated_lists
print(generate_by_condition(2, False, "test", "hello", "lab002"))
|
#!/usr/bin/python
# ENVIRONMENT / WORLD DEFINITIONS
class world(object):
def __init__(self):
return
def get_outcome(self):
print("Abstract method, not implemented")
return
def get_all_outcomes(self):
outcomes = {}
for state in xrange(self.n_states):
for action in xrange(self.n_actions):
next_state, reward = self.get_outcome(state, action)
outcomes[state, action] = [(1, next_state, reward)]
return outcomes
class n_armed_bandit(world):
"""
World: N-Armed bandit.
Only one state, multiple actions.
Each action returns different amount of reward.
"""
def __init__(self):
self.name = "n_armed_bandit"
self.n_states = 1
self.n_actions = 4
self.dim_x = 1
self.dim_y = 1
def get_outcome(self, state, action):
if not 0 <= action <= self.n_actions:
print("Action must be between 0 and 3.")
return None, None
next_state = None # session ends
rewards = [0, 0.5, -0.5, 1]
reward = rewards[action]
return int(next_state) if next_state is not None else None, reward
class cheese_world(world):
"""
World: Cheese world.
4 states, 2 actions.
States represent a one-dimensional track: 0 1 2 3
0 is always the starting state.
Actions 0, 1 correspond to move left and right.
Moving left at state 0 stays at 0.
Moving right at state 2 gets the reward.
Moving right at state 3 stays at 3.
"""
def __init__(self):
self.name = "cheese_world"
self.n_states = 4
self.n_actions = 2
self.dim_x = 4
self.dim_y = 1
def get_outcome(self, state, action):
if state == 3: # goal state
reward = 0
next_state = None
return next_state, reward
reward = 0 # default reward
if action == 0: # move left
next_state = state - 1
if state == 0:
next_state = state
elif action == 1: # move right
next_state = state + 1
if state == 2:
reward = 1
else:
print("Action must be between 0 and 1.")
next_state = None
reward = None
return int(next_state) if next_state is not None else None, reward
class cliff_world(world):
"""
World: Cliff world.
40 states (4-by-10 grid world).
The mapping from state to the grids are as follows:
30 31 32 ... 39
20 21 22 ... 29
10 11 12 ... 19
0 1 2 ... 9
0 is the starting state (S) and 9 is the goal state (G).
Actions 0, 1, 2, 3 correspond to right, up, left, down.
Moving anywhere from state 9 (goal state) will end the session.
Taking action down at state 11-18 will go back to state 0 and incur a
reward of -100.
Landing in any states other than the goal state will incur a reward of -1.
Going towards the border when already at the border will stay in the same
place.
"""
def __init__(self):
self.name = "cliff_world"
self.n_states = 40
self.n_actions = 4
self.dim_x = 10
self.dim_y = 4
def get_outcome(self, state, action):
if state == 9: # goal state
reward = 0
next_state = None
return next_state, reward
reward = -1 # default reward value
if action == 0: # move right
next_state = state + 1
if state % 10 == 9: # right border
next_state = state
elif state == 0: # start state (next state is cliff)
next_state = None
reward = -100
elif action == 1: # move up
next_state = state + 10
if state >= 30: # top border
next_state = state
elif action == 2: # move left
next_state = state - 1
if state % 10 == 0: # left border
next_state = state
elif action == 3: # move down
next_state = state - 10
if state >= 11 and state <= 18: # next is cliff
next_state = None
reward = -100
elif state <= 9: # bottom border
next_state = state
else:
print("Action must be between 0 and 3.")
next_state = None
reward = None
return int(next_state) if next_state is not None else None, reward
class quentins_world(world):
"""
World: Quentin's world.
100 states (10-by-10 grid world).
The mapping from state to the grid is as follows:
90 ... 99
...
40 ... 49
30 ... 39
20 21 22 ... 29
10 11 12 ... 19
0 1 2 ... 9
54 is the start state.
Actions 0, 1, 2, 3 correspond to right, up, left, down.
Moving anywhere from state 99 (goal state) will end the session.
Landing in red states incurs a reward of -1.
Landing in the goal state (99) gets a reward of 1.
Going towards the border when already at the border will stay in the same
place.
"""
def __init__(self):
self.name = "quentins_world"
self.n_states = 100
self.n_actions = 4
self.dim_x = 10
self.dim_y = 10
def get_outcome(self, state, action):
if state == 99: # goal state
reward = 0
next_state = None
return next_state, reward
reward = 0 # default reward value
if action == 0: # move right
next_state = state + 1
if state == 98: # next state is goal state
reward = 1
elif state % 10 == 9: # right border
next_state = state
elif state in [11, 21, 31, 41, 51, 61, 71,
12, 72,
73,
14, 74,
15, 25, 35, 45, 55, 65, 75]: # next state is red
reward = -1
elif action == 1: # move up
next_state = state + 10
if state == 89: # next state is goal state
reward = 1
if state >= 90: # top border
next_state = state
elif state in [2, 12, 22, 32, 42, 52, 62,
3, 63,
64,
5, 65,
6, 16, 26, 36, 46, 56, 66]: # next state is red
reward = -1
elif action == 2: # move left
next_state = state - 1
if state % 10 == 0: # left border
next_state = state
elif state in [17, 27, 37, 47, 57, 67, 77,
16, 76,
75,
14, 74,
13, 23, 33, 43, 53, 63, 73]: # next state is red
reward = -1
elif action == 3: # move down
next_state = state - 10
if state <= 9: # bottom border
next_state = state
elif state in [22, 32, 42, 52, 62, 72, 82,
23, 83,
84,
25, 85,
26, 36, 46, 56, 66, 76, 86]: # next state is red
reward = -1
else:
print("Action must be between 0 and 3.")
next_state = None
reward = None
return int(next_state) if next_state is not None else None, reward
class windy_cliff_grid(world):
"""
World: Windy grid world with cliffs.
84 states(6-by-14 grid world).
4 possible actions.
Actions 0, 1, 3, 4 correspond to right, up, left, down.
Each action returns different amount of reward.
"""
def __init__(self):
self.name = "windy_cliff_grid"
self.n_states = 168
self.n_actions = 4
self.dim_x = 14
self.dim_y = 12
def get_outcome(self, state, action):
"""
Obtains the outcome (next state and reward) obtained when taking
a particular action from a particular state.
Args:
state: int, current state.
action: int, action taken.
Returns:
the next state (int) and the reward (int) obtained.
"""
next_state = None
reward = 0
if state in [53, 131]: # end of MDP
return next_state, reward
if action == 0: # move right
next_state = state + 1
if state == 38: # goal state 1
next_state = 53
reward = 100
elif state == 158: # goal state 2
next_state = 131
reward = 100
elif state == 1: # cliff
next_state = None
reward = -100
elif 7 <= state <= 51 and (state % 14 == 7 or state % 14 == 8 or state % 14 == 9): # room 1 wind
next_state = state + 29
elif state in [63, 64, 65]: # room 1 wind
next_state = state + 15
elif 10 <= state <= 68 and (state % 14 == 10 or state % 14 == 11 or state % 14 == 12): # room 1 wind
next_state = state + 15
elif 113 <= state <= 157 and (state % 14 == 1 or state % 14 == 2 or state % 14 == 3): # room 2 wind
next_state = state - 13
elif 130 <= state <= 160 and (state % 14 == 4 or state % 14 == 5 or state % 14 == 6): # room 2 wind
next_state = state - 27
elif state in [116, 117, 118]: # room 2 wind
next_state = state - 13
elif 19 <= state <= 75 and state % 14 == 5: # room 1 left border
next_state = state
elif 105 <= state <= 161 and state % 14 == 7: # room 2 right border
next_state = state
elif state % 14 == 13: # world right border
next_state = state
elif action == 1: # move up
next_state = state - 14
if state in [16, 17, 18, 84]: # cliff
next_state = None
reward = -100
elif 21 <= state <= 65 and (state % 14 == 7 or state % 14 == 8 or state % 14 == 9): # room 1 wind
next_state = state + 14
elif state in [7, 8, 9]: # room 1 wind
next_state = state + 28
elif state in [77, 78, 79]: # room 1 wind
next_state = state
elif 24 <= state <= 82 and (state % 14 == 10 or state % 14 == 11 or state % 14 == 12): # room 1 wind
next_state = state
elif state in [10, 11, 12]: # room 1 wind
next_state = state + 14
elif 127 <= state <= 157 and (state % 14 == 1 or state % 14 == 2 or state % 14 == 3): # room 2 wind
next_state = state - 28
elif 144 <= state <= 160 and (state % 14 == 4 or state % 14 == 5 or state % 14 == 6): # room 2 wind
next_state = state - 42
elif state in [130, 131, 132]: # room 2 wind
next_state = state - 28
elif 90 <= state <= 97: # room 1 bottom border
next_state = state
elif 99 <= state <= 105: # room 2 top border
next_state = state
elif 0 <= state <= 13: # world top border
next_state = state
elif action == 2: # move left
next_state = state - 1
if state == 40: # goal state 1
next_state = 53
reward = 100
elif state == 160: # goal state 2
next_state = 131
reward = 100
elif state in [29, 43, 57, 71, 5]: # cliff
next_state = None
reward = -100
elif 7 <= state <= 51 and (state % 14 == 7 or state % 14 == 8 or state % 14 == 9): # room 1 wind
next_state = state + 27
elif state in [63, 64, 65]: # room 1 wind
next_state = state + 13
elif 10 <= state <= 68 and (state % 14 == 10 or state % 14 == 11 or state % 14 == 12): # room 1 wind
next_state = state + 13
elif 113 <= state <= 157 and (state % 14 == 1 or state % 14 == 2 or state % 14 == 3): # room 2 wind
next_state = state - 15
elif state == 99: # room 2 wind
next_state = state - 15
elif 130 <= state <= 160 and (state % 14 == 4 or state % 14 == 5 or state % 14 == 6): # room 2 wind
next_state = state - 29
elif state in [116, 117, 118]: # room 2 wind
next_state = state - 15
elif 20 <= state <= 76 and state % 14 == 6: # room 1 left border
next_state = state
elif 106 <= state <= 162 and state % 14 == 8: # room 2 right border
next_state = state
elif state % 14 == 0: # world left border
next_state = state
elif action == 3: # move down
next_state = state + 14
if state == 25: # goal state 1
next_state = 53
reward = 100
elif state == 145: # goal state 2
next_state = 131
reward = 100
elif state == 14: # cliff
next_state = None
reward = -100
elif 7 <= state <= 37 and (state % 14 == 7 or state % 14 == 8 or state % 14 == 9): # room 1 wind
next_state = state + 42
elif state in [49, 50, 51]: # room 1 wind
next_state = state + 28
elif 99 <= state <= 143 and (state % 14 == 1 or state % 14 == 2 or state % 14 == 3): # room 2 wind
next_state = state
elif state in [155, 156, 157]: # room 2 wind
next_state = state - 14
elif 116 <= state <= 146 and (state % 14 == 4 or state % 14 == 5 or state % 14 == 6): # room 2 wind
next_state = state - 14
elif state in [102, 103, 104]: # room 2 wind
next_state = state
elif state in [158, 159, 160]: # room 2 wind
next_state = state - 28
elif 76 <= state <= 83: # room 1 bottom border
next_state = state
elif 85 <= state <= 91: # room 2 top border
next_state = state
elif 154 <= state <= 167: # world bottom border
next_state = state
else:
print("Action must be between 0 and 3.")
next_state = None
reward = None
return int(next_state) if next_state is not None else None, reward
class windy_cliff_grid_2(windy_cliff_grid):
def get_outcome(self, state, action):
"""
Obtains the outcome (next state and reward) obtained when taking
a particular action from a particular state.
Args:
state: int, current state.
action: int, action taken.
Returns:
the next state (int) and the reward (int) obtained.
"""
next_state = None
reward = 0
if state in [53, 131]: # end of MDP
return next_state, reward
if action == 0: # move right
next_state = state + 1
if state == 38: # goal state 1
next_state = 53
reward = 100
elif state == 158: # goal state 2
next_state = 131
reward = 100
elif state == 1: # cliff
next_state = None
reward = -100
elif 7 <= state <= 51 and (state % 14 == 7 or state % 14 == 8 or state % 14 == 9): # room 1 wind
next_state = state + 29
elif state in [63, 64, 65]: # room 1 wind
next_state = state + 15
elif 10 <= state <= 68 and (state % 14 == 10 or state % 14 == 11 or state % 14 == 12): # room 1 wind
next_state = state + 15
elif 113 <= state <= 157 and (state % 14 == 1 or state % 14 == 2 or state % 14 == 3): # room 2 wind
next_state = state - 13
elif 130 <= state <= 160 and (state % 14 == 4 or state % 14 == 5 or state % 14 == 6): # room 2 wind
next_state = state - 27
elif state in [116, 117, 118]: # room 2 wind
next_state = state - 13
elif 5 <= state <= 75 and state % 14 == 5: # room 1 left border
next_state = state
elif 105 <= state <= 147 and state % 14 == 7: # room 2 right border
next_state = state
elif state % 14 == 13: # world right border
next_state = state
elif action == 1: # move up
next_state = state - 14
if state in [16, 17, 18, 84]: # cliff
next_state = None
reward = -100
elif 21 <= state <= 65 and (state % 14 == 7 or state % 14 == 8 or state % 14 == 9): # room 1 wind
next_state = state + 14
elif state in [7, 8, 9]: # room 1 wind
next_state = state + 28
elif state in [77, 78, 79]: # room 1 wind
next_state = state
elif 24 <= state <= 82 and (state % 14 == 10 or state % 14 == 11 or state % 14 == 12): # room 1 wind
next_state = state
elif state in [10, 11, 12]: # room 1 wind
next_state = state + 14
elif 127 <= state <= 157 and (state % 14 == 1 or state % 14 == 2 or state % 14 == 3): # room 2 wind
next_state = state - 28
elif 144 <= state <= 160 and (state % 14 == 4 or state % 14 == 5 or state % 14 == 6): # room 2 wind
next_state = state - 42
elif state in [130, 131, 132]: # room 2 wind
next_state = state - 28
elif 90 <= state <= 96: # room 1 bottom border
next_state = state
elif 98 <= state <= 105: # room 2 top border
next_state = state
elif 0 <= state <= 13: # world top border
next_state = state
elif action == 2: # move left
next_state = state - 1
if state == 40: # goal state 1
next_state = 53
reward = 100
elif state == 160: # goal state 2
next_state = 131
reward = 100
elif state in [29, 43, 57, 71, 5]: # cliff
next_state = None
reward = -100
elif 7 <= state <= 51 and (state % 14 == 7 or state % 14 == 8 or state % 14 == 9): # room 1 wind
next_state = state + 27
elif state in [63, 64, 65]: # room 1 wind
next_state = state + 13
elif 10 <= state <= 68 and (state % 14 == 10 or state % 14 == 11 or state % 14 == 12): # room 1 wind
next_state = state + 13
elif 113 <= state <= 157 and (state % 14 == 1 or state % 14 == 2 or state % 14 == 3): # room 2 wind
next_state = state - 15
elif state == 99: # room 2 wind
next_state = state - 15
elif 130 <= state <= 160 and (state % 14 == 4 or state % 14 == 5 or state % 14 == 6): # room 2 wind
next_state = state - 29
elif state in [116, 117, 118]: # room 2 wind
next_state = state - 15
elif 6 <= state <= 76 and state % 14 == 6: # room 1 left border
next_state = state
elif 106 <= state <= 148 and state % 14 == 8: # room 2 right border
next_state = state
elif state % 14 == 0: # world left border
next_state = state
elif action == 3: # move down
next_state = state + 14
if state == 25: # goal state 1
next_state = 53
reward = 100
elif state == 145: # goal state 2
next_state = 131
reward = 100
elif state == 14: # cliff
next_state = None
reward = -100
elif 7 <= state <= 37 and (state % 14 == 7 or state % 14 == 8 or state % 14 == 9): # room 1 wind
next_state = state + 42
elif state in [49, 50, 51]: # room 1 wind
next_state = state + 28
elif 99 <= state <= 143 and (state % 14 == 1 or state % 14 == 2 or state % 14 == 3): # room 2 wind
next_state = state
elif state in [155, 156, 157]: # room 2 wind
next_state = state - 14
elif 116 <= state <= 146 and (state % 14 == 4 or state % 14 == 5 or state % 14 == 6): # room 2 wind
next_state = state - 14
elif state in [102, 103, 104]: # room 2 wind
next_state = state
elif state in [158, 159, 160]: # room 2 wind
next_state = state - 28
elif 76 <= state <= 82: # room 1 bottom border
next_state = state
elif 84 <= state <= 91: # room 2 top border
next_state = state
elif 154 <= state <= 167: # world bottom border
next_state = state
else:
print("Action must be between 0 and 3.")
next_state = None
reward = None
return int(next_state) if next_state is not None else None, reward
|
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
__project__ = 'leetcode'
__file__ = '__init__.py'
__author__ = 'king'
__time__ = '2020/1/9 13:28'
_ooOoo_
o8888888o
88" . "88
(| -_- |)
O\ = /O
____/`---'\____
.' \\| |// `.
/ \\||| : |||// \
/ _||||| -:- |||||- \
| | \\\ - /// | |
| \_| ''\---/'' | |
\ .-\__ `-` ___/-. /
___`. .' /--.--\ `. . __
."" '< `.___\_<|>_/___.' >'"".
| | : `- \`.;`\ _ /`;.`/ - ` : | |
\ \ `-. \_ __\ /__ _/ .-` / /
======`-.____`-.___\_____/___.-`____.-'======
`=---='
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
佛祖保佑 永无BUG
"""
"""
难度:中等
假设按照升序排序的数组在预先未知的某个点上进行了旋转。
( 例如,数组[0,1,2,4,5,6,7]可能变为[4,5,6,7,0,1,2])。
搜索一个给定的目标值,如果数组中存在这个目标值,则返回它的索引,否则返回-1。
你可以假设数组中不存在重复的元素。
你的算法时间复杂度必须是O(logn) 级别。
示例 1:
输入: nums = [4,5,6,7,0,1,2], target = 0
输出: 4
示例2:
输入: nums = [4,5,6,7,0,1,2], target = 3
输出: -1
"""
class Solution(object):
def search(self, nums, target):
"""
:type nums: List[int]
:type target: int
:rtype: int
"""
left = 0
right = len(nums) - 1
while left <= right:
mid = (left + right) // 2
if nums[mid] == target:
return mid
# 左半边有序
if nums[left] <= nums[mid]:
if nums[left] <= target < nums[mid]:
right = mid - 1
else:
left = mid + 1
# 右半边有序
else:
if nums[mid] < target <= nums[right]:
left = mid + 1
else:
right = mid - 1
return -1
print(Solution().search([3, 4, 5, 6, 7, 8, 9, 0, 1, 2], 1))
|
def common_code(tipoInt, txt):
"""
Função usada para tipos numéricos inteiros ou flutuantes.
:param tipoInt: padrão para tipo inteiro
:param txt: mensagem a ser utilizada no input de 'n'
:return: retorna n
"""
while True:
try:
if tipoInt:
n = int(input(txt))
else:
n = float(input(txt).replace(',', '.'))
except Exception as error:
print('ERRO! o_o`')
print(f'Tipo do erro: {error.__class__}')
continue
except KeyboardInterrupt:
print('ERRO! x..x')
print('O usuário interrompeu a entrada de dados.')
return 0
else:
return n
def leiaInt(msg):
return common_code(True, msg)
def leiaFloat(msg):
return common_code(False, msg)
n_i = leiaInt('Insira um número inteiro: ')
n_f = leiaFloat('Insira um número real: ')
print(f'Você acabou de cadastrar um número inteiro {n_i} e real {n_f}!') |
"""Status Messeges string formats."""
FLIGHT_RECORD_NOT_FOUND = "File: {filename} not found"
# TODO: Add a link to upload new files once endpoint to upload files implemented.
FLIGHT_RECORDS_EXISTING = """
Available flight records:\n{flight_records}
"""
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.