content
stringlengths
7
1.05M
""" adam_objects.py """ class AdamObject(object): def __init__(self): self._uuid = None self._runnable_state = None self._children = None def set_uuid(self, uuid): self._uuid = uuid def set_runnable_state(self, runnable_state): self._runnable_state = runnable_state def set_children(self, children): self._children = children def get_uuid(self): return self._uuid def get_runnable_state(self): return self._runnable_state def get_children(self): return self._children class AdamObjectRunnableState(object): def __init__(self, response): self._uuid = response['uuid'] self._calc_state = response['calculationState'] self._error = response.get('error') def get_uuid(self): return self._uuid def get_calc_state(self): return self._calc_state def get_error(self): return self._error class AdamObjects(object): """Module for managing AdamObjects. """ def __init__(self, rest, obj_type): self._rest = rest self._type = obj_type def __repr__(self): return "AdamObjects module" def _insert(self, data): code, response = self._rest.post( '/adam_object/single/' + self._type, data) if code != 200: raise RuntimeError( "Server status code: %s; Response: %s" % (code, response)) return response['uuid'] def get_runnable_state(self, uuid): code, response = self._rest.get( '/adam_object/runnable_state/single/' + self._type + '/' + uuid) if code == 404: return None elif code != 200: raise RuntimeError( "Server status code: %s; Response: %s" % (code, response)) return AdamObjectRunnableState(response) def get_runnable_states(self, project_uuid): code, response = self._rest.get( '/adam_object/runnable_state/by_project/' + self._type + '/' + project_uuid) if code == 404: return [] elif code != 200: raise RuntimeError( "Server status code: %s; Response: %s" % (code, response)) return [AdamObjectRunnableState(r) for r in response['items']] def _get_json(self, uuid): code, response = self._rest.get( '/adam_object/single/' + self._type + '/' + uuid) if code == 404: return None elif code != 200: raise RuntimeError( "Server status code: %s; Response: %s" % (code, response)) return response def _get_in_project_json(self, project_uuid): code, response = self._rest.get( '/adam_object/by_project/' + self._type + '/' + project_uuid) if code == 404: return [] elif code != 200: raise RuntimeError( "Server status code: %s; Response: %s" % (code, response)) return response['items'] def _get_children_json(self, uuid): code, response = self._rest.get( '/adam_object/by_parent/' + self._type + '/' + uuid) if code == 404: return [] elif code != 200: raise RuntimeError( "Server status code: %s; Response: %s" % (code, response)) if response is None: return [] child_json_list = [] for child_type, child_uuid in zip(response['childTypes'], response['childUuids']): print('Fetching ' + child_uuid + ' of type ' + child_type) retriever = AdamObjects(self._rest, child_type) child_json_list.append([retriever._get_json(child_uuid), retriever.get_runnable_state(child_uuid), child_type]) return child_json_list def delete(self, uuid): code, _ = self._rest.delete( '/adam_object/single/' + self._type + '/' + uuid) if code != 204: raise RuntimeError("Server status code: %s" % (code))
# Sudoku Solver :https://leetcode.com/problems/sudoku-solver/ # Write a program to solve a Sudoku puzzle by filling the empty cells. # A sudoku solution must satisfy all of the following rules: # Each of the digits 1-9 must occur exactly once in each row. # Each of the digits 1-9 must occur exactly once in each column. # Each of the digits 1-9 must occur exactly once in each of the 9 3x3 sub-boxes of the grid. # The '.' character indicates empty cells. # So this problem seems rather complicated. However when we apply a backtracking dfs solution # this problem becomes easier to write. Basically we will continue trying every possible remaining option # From the set of values 1-9 left after considering following sets: Row, Col and Square if we run out of options # remove the last value and continue trying until we have reached the last square class Solution: def solveSudoku(self, board) -> None: """ Do not return anything, modify board in-place instead. """ # For any backtracking problem we need a few steps # Check if you can place an element as they can't be in any set def canAddVal(value, r, c): return value not in row[r] and value not in col[c] and value not in sqr[sqrIndex(r, c)] # Add an element def addToBoard(value, r, c): row[r].add(value) col[c].add(value) sqr[sqrIndex(r, c)].add(value) board[r][c] = str(value) # Remove an element def remFromBoard(value, r, c): row[r].remove(value) col[c].remove(value) sqr[sqrIndex(r, c)].remove(value) board[r][c] = '.' # Move forward def nextLocation(r, c): if r == N-1 and c == N-1: self.isSolved = True return else: if c == N - 1: backtrack(r + 1) else: backtrack(r, c + 1) def backtrack(r=0, c=0): if board[r][c] != '.': # If the number already exists keep moving nextLocation(r, c) else: # iterate over all values 1-9 and try adding them for val in range(1, 10): if canAddVal(val, r, c): addToBoard(val, r, c) nextLocation(r, c) # Now that we have added if we end up solving # we need return the result if self.isSolved: return remFromBoard(val, r, c) # Set up box lengths n = 3 N = n * n # There are 9 rows 9 col and 9 squares which influence which # nums can be chosen row = [set() for _ in range(N)] col = [set() for _ in range(N)] sqr = [set() for _ in range(N)] # This formula comes from the fact squares in sudoku work like this: # 0 1 2 # 3 4 5 # 6 7 8 def sqrIndex(r, c): return (r // 3 * 3) + (c // 3) self.isSolved = False for i in range(N): for j in range(N): # Add all existing numbers to our sets if board[i][j] != '.': addToBoard(int(board[i][j]), i, j) backtrack() return board # So the above works the problem is for backtracking the time complexity is o(1) However # in the worst case you have to run 9! possible combinations minus whatever combinations # are removed from numbers already on the board. # As for the space complexity it is also o(1) as we have 3 sets of 9 and then the 9 by 9 board # Score Card # Did I need hints? N # Did you finish within 30 min? 30 # Was the solution optimal? This is optimal # Were there any bugs? No # 5 4 5 5 = 4.75
class FunctionMetadata: def __init__(self): self._constantReturnValue = () def setConstantReturnValue(self, value): self._constantReturnValue = (value,) def hasConstantReturnValue(self): return self._constantReturnValue def getConstantReturnValue(self): return self._constantReturnValue[0] if self._constantReturnValue else None
# https://www.codewars.com/kata/578553c3a1b8d5c40300037c/train/python # Given an array of ones and zeroes, convert the equivalent binary value # to an integer. # Eg: [0, 0, 0, 1] is treated as 0001 which is the binary representation of 1. # Examples: # Testing: [0, 0, 0, 1] ==> 1 # Testing: [0, 0, 1, 0] ==> 2 # Testing: [0, 1, 0, 1] ==> 5 # Testing: [1, 0, 0, 1] ==> 9 # Testing: [0, 0, 1, 0] ==> 2 # Testing: [0, 1, 1, 0] ==> 6 # Testing: [1, 1, 1, 1] ==> 15 # Testing: [1, 0, 1, 1] ==> 11 # However, the arrays can have varying lengths, not just limited to 4. def binary_array_to_number(arr): total = 0 i = 1 for num in arr[::-1]: total += i * num i *= 2 return total # Alternative: # def binary_array_to_number(arr): # return int("".join( # map(str, arr) # ), 2) # def binary_array_to_number(arr): # s = 0 # for digit in arr: # s = s * 2 + digit # return s
class Solution: def rob(self, nums: List[int]) -> int: def rob(l: int, r: int) -> int: dp1 = 0 dp2 = 0 for i in range(l, r + 1): temp = dp1 dp1 = max(dp1, dp2 + nums[i]) dp2 = temp return dp1 if not nums: return 0 if len(nums) < 2: return nums[0] return max(rob(0, len(nums) - 2), rob(1, len(nums) - 1))
array = ['a', 'b', 'c'] def decorator(func): def newValueOf(pos): if pos >= len(array): print("Oops! Array index is out of range") return func(pos) return newValueOf @decorator def valueOf(index): print(array[index]) valueOf(10)
numero = 5 fracao = 6.1 online = True texto = "Armando"
maior = 0 pos = 0 for i in range(1, 11): val = int(input()) if val > maior: maior = val pos = i print('{}\n{}'.format(maior, pos))
x = 1 products=list() employees=list() customers=list() Sales=list() while x > 0 : print('Type 0 to end') print('Type 1 to create new product') print('Type 2 to show registered products') print('Type 3 to create new employee ') print('Type 4 to show registered employees') print('Type 5 to create new customer') print('Type 6 to show registered customers') print('Type 7 to create new sale') print('Type 8 to show registered sales') b=0 x =int(input('Digite aqui: ')) if x ==1 : n_prod=list() namep=n_prod.append(str(input("Name: "))) pricep=n_prod.append(int(input('Price: '))) stock_quatity=n_prod.append(int(input('Quantity: '))) b=n_prod.copy() products.append(b) if x ==2 : print(products) print(n_prod) if x ==3 : Employees=list() namee=Employees.append(str(input("Name: "))) agee=Employees.append(int(input('Age: '))) addresse=Employees.append(str(input('Adress: '))) wagee=Employees.append(int(input('Wage: '))) b=Employees.copy() employees.append(b) if x == 4: print(employees) if x == 5: Customers=list() name=Customers.append(str(input("New name: "))) age=Customers.append(int(input('Age: '))) address=Customers.append(str(input('Address: '))) b=Customers.copy() customers.append(b) if x == 6: print(customers) if x == 7: sales=list() names=sales.append(str(input('Item name:'))) Cust_name=sales.append(str(input('Customer name: '))) quantity=sales.append(int(input('Quantity: '))) #achar o indice que corresponde ao preço do produto correto para poder atribuir o valor correto for i in enumerate(products): if names == namep: indice=i break price=int(products[indice]) final_price=price*quantity #caso o cliente seja um funcionario o preço final tem redução de 10% b=sales.copy() Sales.append(b) if x == 8: print(Sales)
# -*- coding: utf-8 -*- """ Created on Sun Jul 14 09:42:46 2019 @author: ASUS """ class Solution: def uniqueMorseRepresentations(self, words: list) -> int: self.M = [".-","-...","-.-.","-..",".","..-.","--.","....","..",".---","-.-",".-..","--","-.","---",".--.","--.-",".-.","...","-","..-","...-",".--","-..-","-.--","--.."] for k in range(len(words)): words[k] = self.convert(words[k]) return len(set(words)) def convert(self, word): # word = list(word) # length = len(word) # for letter in word: # word.append(self.M[ord(letter) - ord('a')]) # word.reverse() # for _ in range(length): # word.pop() # word.reverse() # return ''.join(word) word = list(word) for k in range(len(word)): word[k] = self.M[ord(word[k]) - ord('a')] return ''.join(word) solu = Solution() words = ["gin", "zen", "gig", "msg"] print(solu.uniqueMorseRepresentations(words))
COUNT = 100 class Stack: def __init__(self, value): self.value = value; self.next = None def test(): top = None for i in range(0, COUNT): curr = Stack(f'Hello #{i}') curr.next = top top = curr print(stackSize(top)) def stackSize(stack): size = 0 if stack is not None: size = stackSize(stack.next) + 1 return size if __name__ == "__main__": test()
class Solution(object): def checkRecord(self, s): """ :type s: str :rtype: bool """ return s.count('A') <=1 and 'LLL' not in s """ You are given a string representing an attendance record for a student. The record only contains the following three characters: 'A' : Absent. 'L' : Late. 'P' : Present. A student could be rewarded if his attendance record doesn't contain more than one 'A' (absent) or more than two continuous 'L' (late). You need to return whether the student could be rewarded according to his attendance record. Example 1: Input: "PPALLP" Output: True """
''' Author: Maciej Kaczkowski 26.03-13.04.2021 ''' # configuration file with constans, etc. # using "reversi convention" - black has first move, # hence BLACK is Max player, while WHITE is Min player WHITE = -1 BLACK = 1 EMPTY = 0 # player's codenames RANDOM = 'random' ALGO = 'minmax' # min-max parameters MAX_DEPTH = 4 # cordinates for better readability NORTHEAST = (-1, 1) NORTH = (-1, 0) NORTHWEST = (-1, -1) WEST = (0, -1) SOUTHWEST = (1, -1) SOUTH = (1, 0) SOUTHEAST = (1, 1) EAST = (0, 1)
def replace_string_in_file(filepath, searched, replaced): with open(filepath) as f: file_source = f.read() # replace all occurences replace_string = file_source.replace(searched, replaced) with open(filepath, "w") as f: f.write(replace_string)
class Fail(Exception): pass class InvalidArgument(Fail): pass
# -*- coding: utf-8 -*- def main(): n = int(input()) a = list(map(int, input().split())) inf = 1 << 30 ans = inf for bit in range(1 << n - 1): candidate = 0 inner = 0 for j in range(n): inner |= a[j] if (bit >> j) & 1: candidate ^= inner inner = 0 candidate ^= inner ans = min(ans, candidate) print(ans) if __name__ == "__main__": main()
# Addition and subtraction print(5 + 5) print(5 - 5) # Multiplication and division print(3 * 5) print(10 / 2) # Exponentiation print(4 ** 2) # Modulo print(18 % 7)
""" File: basic_permutations.py Name: Sharon ----------------------------- This program finds all the 3-digits binary permutations by calling a recursive function binary_permutations. Students will find a helper function useful in advanced recursion problems. """ def main(): binary_permutations(5) def binary_permutations(n): permutations_helper(n, '') def permutations_helper(n, ans): if len(ans) == n: print(ans) else: permutations_helper(n, ans+'0') permutations_helper(n, ans+'1') if __name__ == '__main__': main()
#!/usr/bin/env python # -*- coding: utf-8 -*- '''A simple module to store the user's style preferences.''' INDENT_PREFERENCE = {'indent': ' '} def get_indent_preference(): '''str: How the user prefers their indentation. Default: " ".''' return INDENT_PREFERENCE['indent'] def register_indent_preference(text): '''Set indentation that will be used for multi-line function calls.''' INDENT_PREFERENCE['indent'] = text
''' StaticRoute Genie Ops Object Outputs for IOSXE. ''' class StaticRouteOutput(object): # 'show ipv4 static route' output showIpv4StaticRoute = { 'vrf': { 'VRF1': { 'address_family': { 'ipv4': { 'routes': { '2.2.2.2/32': { 'route': '2.2.2.2/32', 'next_hop': { 'next_hop_list': { 1: { 'index': 1, 'active': True, 'next_hop': '10.1.2.2', 'outgoing_interface': 'GigabitEthernet0/0', 'preference': 1, }, 2: { 'index': 2, 'active': False, 'next_hop': '20.1.2.2', 'outgoing_interface': 'GigabitEthernet0/1', 'preference': 2, }, 3: { 'index': 3, 'active': False, 'next_hop': '20.1.2.2', 'preference': 3, }, }, }, }, '3.3.3.3/32': { 'route': '3.3.3.3/32', 'next_hop': { 'outgoing_interface': { 'GigabitEthernet0/2': { 'active': True, 'outgoing_interface': 'GigabitEthernet0/2', 'preference': 1, }, 'GigabitEthernet0/3': { 'active': True, 'outgoing_interface': 'GigabitEthernet0/3', 'preference': 1, }, }, }, }, }, }, }, }, }, } showIpv6StaticRoute = { 'vrf': { 'default': { 'address_family': { 'ipv6': { 'routes': { '2001:2:2:2::2/128': { 'route': '2001:2:2:2::2/128', 'next_hop': { 'next_hop_list': { 1: { 'index': 1, 'active': False, 'next_hop': '2001:10:1:2::2', 'resolved_outgoing_interface': 'GigabitEthernet0/0', 'resolved_paths_number': 1, 'max_depth': 1, 'preference': 3, }, 2: { 'index': 2, 'next_hop': '2001:20:1:2::2', 'active': True, 'outgoing_interface': 'GigabitEthernet0/1', 'preference': 1, }, 3: { 'index': 3, 'active': False, 'next_hop': '2001:10:1:2::2', 'outgoing_interface': 'GigabitEthernet0/0', 'rejected_by': 'routing table', 'preference': 11, 'tag': 100, 'track': 1, 'track_state': 'up', }, }, }, }, '2001:3:3:3::3/128': { 'route': '2001:3:3:3::3/128', 'next_hop': { 'outgoing_interface': { 'GigabitEthernet0/3': { 'outgoing_interface': 'GigabitEthernet0/3', 'active': True, 'preference': 1, }, 'GigabitEthernet0/2': { 'outgoing_interface': 'GigabitEthernet0/2', 'active': True, 'preference': 1, }, }, }, }, }, }, }, }, }, } staticRouteOpsOutput = { 'vrf': { 'VRF1': { 'address_family': { 'ipv4': { 'routes': { '2.2.2.2/32': { 'route': '2.2.2.2/32', 'next_hop': { 'next_hop_list': { 1: { 'index': 1, 'active': True, 'next_hop': '10.1.2.2', 'outgoing_interface': 'GigabitEthernet0/0', 'preference': 1, }, 2: { 'index': 2, 'active': False, 'next_hop': '20.1.2.2', 'outgoing_interface': 'GigabitEthernet0/1', 'preference': 2, }, 3: { 'index': 3, 'active': False, 'next_hop': '20.1.2.2', 'preference': 3, }, }, }, }, '3.3.3.3/32': { 'route': '3.3.3.3/32', 'next_hop': { 'outgoing_interface': { 'GigabitEthernet0/2': { 'active': True, 'outgoing_interface': 'GigabitEthernet0/2', 'preference': 1, }, 'GigabitEthernet0/3': { 'active': True, 'outgoing_interface': 'GigabitEthernet0/3', 'preference': 1, }, }, }, }, }, }, }, }, 'default': { 'address_family': { 'ipv6': { 'routes': { '2001:2:2:2::2/128': { 'route': '2001:2:2:2::2/128', 'next_hop': { 'next_hop_list': { 1: { 'index': 1, 'active': False, 'next_hop': '2001:10:1:2::2', 'preference': 3, }, 2: { 'index': 2, 'next_hop': '2001:20:1:2::2', 'active': True, 'outgoing_interface': 'GigabitEthernet0/1', 'preference': 1, }, 3: { 'index': 3, 'active': False, 'next_hop': '2001:10:1:2::2', 'outgoing_interface': 'GigabitEthernet0/0', 'preference': 11, }, }, }, }, '2001:3:3:3::3/128': { 'route': '2001:3:3:3::3/128', 'next_hop': { 'outgoing_interface': { 'GigabitEthernet0/3': { 'outgoing_interface': 'GigabitEthernet0/3', 'active': True, 'preference': 1, }, 'GigabitEthernet0/2': { 'outgoing_interface': 'GigabitEthernet0/2', 'active': True, 'preference': 1, }, }, }, }, }, }, }, }, }, }
''' Write a function to find the longest common prefix string amongst an array of strings. If there is no common prefix, return an empty string "". Example 1: Input: ["flower","flow","flight"] Output: "fl" Example 2: Input: ["dog","racecar","car"] Output: "" Explanation: There is no common prefix among the input strings. Note: All given inputs are in lowercase letters a-z. ''' class Solution: def longestCommonPrefix(self, strs: [str]) -> str: if len(strs) == 0: return '' result = '' maxLength = len(strs[0]) for str in strs: if len(str) < maxLength: maxLength = len(str) for i in range(maxLength): c = strs[0][i] for str in strs: if str[i] != c: return result result += c return result if __name__ == '__main__': solution = Solution() print(solution.longestCommonPrefix(["flower","flow","flight"]))
#=============================================================================== """ Optional features config. """ #=============================================================================== # Enter mail below to receive real-time email alerts # e.g., '[email protected]' MAIL = '' # Enter the ip camera url (e.g., url = 'http://191.138.0.100:8040/video') url = '' # ON/OFF for mail feature. Enter True to turn on the email alert feature. ALERT = False # Set max. people inside limit. Optimise number below: 10, 50, 100, etc. Threshold = 10 # Threading ON/OFF Thread = False # Simple log to log the counting data Log = False # Auto run/Schedule the software to run at your desired time Scheduler = False # Auto stop the software after certain a time/hours Timer = False #=============================================================================== #===============================================================================
datos= [0,0,0,0,0,0,0,0,0,0,0,0,0 ,1,1,1,1,1,1,1,1,1,1 ,2,2,2,2,2,2,2 ,3,3,3,3,3,3 ,4,4] def media(datos): return sum(datos)/len(datos) def mediana(datos): if(len(datos)%2 == 0): return (datos[int(len(datos)/2)] + datos[int((len(datos)+1)/2)]) / 2 else: return datos[(len(datos)+1)/2] if __name__ == '__main__': print(media(datos)) print(mediana(datos))
FILTERS = [ "Você irá aprender", "Você irá receber", "Você também irá receber", "O seguinte feitiço será lançado em você", "Você vai poder escolher uma dessas recompensas", "Completando essa missão você ganhará", "Item fornecido", "texto temporário 02 - registro", "texto temporário 02 - descrição" ]
while True: b=input().split() X,M=b X=int(X) M=int(M) if(X==0 and M==0): break else: E=X*M print(E)
first = ['Bucky', 'Tom', 'Taylor'] last = ['Roberts', 'Hanks', 'Swift'] names = zip(first, last) for a, b in names: print(a, b)
'''To find Symmetric Difference between two Sets.''' #Example INPUT: ''' 4 2 4 5 9 4 2 4 11 12 ''' #OUTPUT: (Symmetric difference in ascending order) ''' 5 9 11 12 ''' #Code n=int(input()) a=[int(i) for i in input().split()] m=int(input()) b=[int(i) for i in input().split()] a1=set(a) b1=set(b) t=a1.union(b1) f=t-(a1.intersection(b1)) tt=list(f) tt.sort() for i in tt: print(i)
class EditorFactory(object): __registeredEditors = [] def __init__(self): super(EditorFactory, self).__init__() @classmethod def registerEditorClass(cls, widgetClass): cls.__registeredEditors.append(widgetClass) @classmethod def constructEditor(cls, valueController, parent=None): for widgetCls in reversed(cls.__registeredEditors): if widgetCls.canDisplay(valueController): return widgetCls(valueController, parent=parent) raise Exception("No Editors registered for the given controller:" + valueController.getName() + ":" + valueController.getDataType())
def rev(j): rev = 0 while (j > 0): remainder = j % 10 rev = (rev * 10) + remainder j = j // 10 return rev def emirp(j): if j <= 1: return False else: for i in range(2, rev(j)): if j % i == 0 or rev(j) % i == 0: print(j, "Is not emirp no.") break else: print(j, "Is emirp no.") break j = int(input()) emirp(j)
#Leia um número qualquer #Mostre o seu fatorial resp = 1 c = 1 n = int(input('Digite um número :')) while (c < n) : c = c + 1 resp = resp * c print('O fatorial de {} é {}'.format(n,resp))
""" LeetCode Problem: 766. Toeplitz Matrix Link: https://leetcode.com/problems/toeplitz-matrix/ Language: Python Written by: Mostofa Adib Shakib """ # Optimal Solution # Time Complexity: O(M*N) # Space Complexity: O(1) class Solution: def isToeplitzMatrix(self, matrix: List[List[int]]) -> bool: rows = len(matrix) columns = len(matrix[0]) for r in range(rows): for c in range(columns): if r > 0 and c > 0 and matrix[r-1][c-1] != matrix[r][c]: return False return True # Brute Force # Time Complexity: O(N^2) # Space Complexity: O(N) class Solution: def isToeplitzMatrix(self, matrix: List[List[int]]) -> bool: rows = len(matrix) columns = len(matrix[0]) temp = matrix[0][:-1] for r in range(1, rows): subArray = matrix[r] if subArray[1:] != temp: return False temp = subArray[:-1] return True
x = 0 y = 0 def setup(): size(400, 400) def draw(): global x, y background(255) ellipse(x, y, 30, 30) x += (mouseX - x) / 10 y += (mouseY - y) / 10
class SignupsException(Exception): """Base class for PvP Signups exceptions.""" class CancelBooking(SignupsException): """User requested or timeout based booking cancellation.""" class BadConfig(SignupsException): """Value in config.json invalid.""" class ChannelNotFound(SignupsException): """Channel lookup exception.""" class MessageNotFound(SignupsException): """Message lookup exception""" class InvalidTokenResponse(SignupsException): """Unsuccessful access token retrieval.""" class RequestFailed(SignupsException): """An action the user has requested has failed, class paramater is sent back to the user as str.""" class BookingUntaken(SignupsException): """Booking was not taken and will be moved to the untaken boosts board""" class UnsupportedInstanceType(SignupsException): """Booking instance type is not supported"""
soma = 0 for n in range(1, 7): num = int(input(f'Informe o {n}° valor: ')) if num % 2 == 0: soma += num print(f'A soma dos numeros pares digitado é de {soma}.')
def parse_from_file(filename, parser): with open(filename,"r") as f: string=f.read() args=parser.parse_args(string.split()) return args
#Problem Set 02 print('Problem Set 02') # Problem 01 (20 points) print('\nProblem 1') cases = [70, 75, 126, 144, 170] cases_latest = None #TODO Replace # Problem 02 (20 points) print('\nProblem 2') tests = None #TODO Replace tests_last_three = None #TODO Replace tests_reverse = None #TODO Replace # Problem 03 (20 points) print('\nProblem 3') vaccines = " 39,896-41,826-44,154-46,458-48,634-50,090 " vaccines_list = None #TODO Replace # Problem 04 (20 points) print('\nProblem 4') dates = ["January 31st", "January 30th", "January 29th", "January 28th", "January 27th", "January 26th"] dates_str = None #TODO Replace # Problem 05 (20 points) print('\nProblem 5') vaccines_26th = None #TODO Replace vaccines_31st = None #TODO Replace
"""Top-level package for CY Widgets.""" try: __import__('pkg_resources').declare_namespace(__name__) except ImportError: __path__ = __import__('pkgutil').extend_path(__path__, __name__) __author__ = """CY Gatro""" __email__ = '[email protected]' __version__ = '0.4.35'
class Mesh: def __init__(self): self.vertexs = [] def setName(self, name): self.name = name def addVertex(self, x, y, z): self.vertexs.append([x, y, z]) def read(self): print(self.name) print(self.vertexs) def getVertexs(self): return self.vertexs def getName(self): return self.name
#!/usr/bin/env python3 class RunfileFormatError(Exception): pass class RunfileNotFoundError(Exception): def __init__(self, path): self.path = path class TargetNotFoundError(Exception): def __init__(self, target=None): self.target = target class TargetExecutionError(Exception): def __init__(self, exit_code): self.exit_code = exit_code class CodeBlockExecutionError(Exception): def __init__(self, exit_code): self.exit_code = exit_code class ContainerBuildError(Exception): def __init__(self, exit_code): self.exit_code = exit_code
count= 0 fname= input("Enter the file name:") if fname== "na na boo boo": print("NA NA BOO BOO TO YOU- You have been punk'd") exit() else: try: fhand= open(fname) except: print("File cannot be opened", fname) exit() for line in fhand: if line.startswith("Subject"): count= count + 1 print("There were",count, "subject lines in", fname)
'''Faça um programa que leia o sexo de uma pessoa, mas só aceite M ou F. Caso esteja errado, peça a digitação novamente até ter um valor correto.''' sexo = '' n = 1 while n != 0: sexo = str(input('''Escolha seu sexo: [ M ] - Masculino; [ F ] - Feminino. ''')).strip().upper()[0] if sexo == 'M': print('Você escolheu "Sexo Masculino".') n = 0 elif sexo == 'F': print('Você escolheu "Sexo Feminino".') n = 0 else: print('\033[31mDados inválidos! Digite novamente.\033[m')
input_data = input() symbols = {} def count_symbols(data): for symbol in data: if symbol not in symbols: symbols[symbol] = 0 symbols[symbol] += 1 return dict(sorted(symbols.items(), key=lambda s: s[0])) def print_data(symbols): for symbol, count in symbols.items(): print(f'{symbol}: {count} time/s') symbols = count_symbols(input_data) print_data(symbols)
def userinfo(claims, user): claims["name"] = user.username claims["preferred_username"] = user.username return claims
#%% 6-misol lst=list(input().split()) lst=[int(i) for i in lst] print(lst) k=0 son=list() for i in range(len(lst)-1): if lst[i]>lst[i+1]: if son!=[]: son.append(lst[i]) print(*son) son=list() k+=1 #%% 7-misol son=int(input("son=")) list1=list() while son!=0: list1.append(son%10) son//=10 list1.reverse() xona=['million','ming','yuz'] bir={1:'bir', 2:'ikki', 3:'uch', 4:'to\'rt', 5:'besh', 6:'olti', 7:'yetti', 8:'sakkiz', 9:'to\'qqiz'} on={ 1:'o\'n', 2:'yigirma', 3:'o\'ttiz', 4:'qirq', 5:'ellik', 6:'oltmish', 7:'yetmish', 8:'sakson', 9:'to\'qson'} for i in range(len(list1)-1,-1,-1): if i==2: if list1[0]!=0: print(bir[list1[0]],"yuz",end=' ') if list1[1]!=0: print(on[list1[1]],end=' ') if list1[2]!=0: print(bir[list1[2]]) elif i==1: if list1[0]!=0: print(on[list1[0]],end=' ') if list1[1]!=0: print(bir[list1[1]]) else: print(bir[list1[0]])
#!/usr/bin/env python # -*- coding: utf-8 -*- # @Time : 17/5/16 下午3:09 # @Author : irmo file = 'pts.txt' output = 'lfw_landmark.txt' def check_line(line): if 'lfw' in line: return True def main(): f = open(file, 'r') out = open(output, 'w') while True: line = f.readline() if not line: break if check_line(line): bounding_box = f.readline().split() l1 = f.readline().split() l2 = f.readline().split() l3 = f.readline().split() l4 = f.readline().split() l5 = f.readline().split() filename = '/'.join(line.split('/')[-2:]).strip() new_line_list = [filename] + bounding_box + l1 + l2 + l3 + l4 + l5 new_line = ' '.join(new_line_list) out.write(new_line + '\n') if __name__ == "__main__": main()
class Utils(object): ''' keep values between -180 and 180 degrees input and output parameters are in degrees ''' def normalize_angle(self, degrees: float) -> float: degrees = degrees % 360 if degrees > 180: return degrees - 360 return degrees
# The following is an implementation of the hex helper # from Electrum - lightweight Bitcoin client, which is # subject to the following license. # # Copyright (C) 2011 thomasv@gitorious # # Permission is hereby granted, free of charge, to any person # obtaining a copy of this software and associated documentation files # (the "Software"), to deal in the Software without restriction, # including without limitation the rights to use, copy, modify, merge, # publish, distribute, sublicense, and/or sell copies of the Software, # and to permit persons to whom the Software is furnished to do so, # subject to the following conditions: # # The above copyright notice and this permission notice shall be # included in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS # BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN # ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN # CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE # SOFTWARE. class Hexxer: bfh = bytes.fromhex @classmethod def bh2u(self, x: bytes) -> str: # str with hex representation of a bytes-like object # x = bytes((1, 2, 10)) # bh2u(x) # '01020A' return x.hex() @classmethod def rev_hex(self, s: str) -> str: return self.bh2u(self.bfh(s)[::-1]) @classmethod def int_to_hex(self, i: int, length: int=1) -> str: # Converts int to little-endian hex string where # length is the number of bytes available if not isinstance(i, int): raise TypeError('{} instead of int'.format(i)) range_size = pow(256, length) if i < -(range_size//2) or i >= range_size: raise OverflowError('cannot convert int {} to hex ({} bytes)'.format(i, length)) if i < 0: i = range_size + i s = hex(i)[2:].rstrip('L') s = "0"*(2*length - len(s)) + s return self.rev_hex(s)
num = input("Please enter a num: ") while not num.isdigit(): num = input("Please enter a num: ") print("Your num: %s" % num)
class ModulationException(Exception): pass class EncodingException(ModulationException): pass class DecodingException(ModulationException): pass
class RedisMock(): def __init__(self): self.incoming_queue = [] self.in_progress_queue = [] def brpoplpush(self, *args): if self.incoming_queue: item = self.incoming_queue.pop(0) self.in_progress_queue.append(item) return item else: return None def lrem(self, queue_name, op_type, item): self.in_progress_queue.remove(item) def lrange(self, *args): # remove-safe copy return self.in_progress_queue[:] def lpush(self, queue_name, *messages): self.incoming_queue += messages def create_init_data(self, initial_messages: list): self.incoming_queue = initial_messages def set_in_progress_data(self, messages): self.in_progress_queue = messages def mock_redis(): return RedisMock()
def solve(matrix, target): possible_results = [] for r, row in enumerate(matrix): start = 0 end = len(row) - 1 while start <= end: mid = (start + end) // 2 if row[mid] == target: possible_results.append((r + 1) * 1009 + mid + 1) break elif row[mid] < target: start = mid + 1 else: end = mid - 1 if len(possible_results) == 0: return -1 return min(possible_results)
P1_CHAR = "1" P2_CHAR = "2" class ChessPiece(object): """ This class is used entirely for inheretence for other chess piece classes. """ def __init__(self, row, col, player): assert 0 <= row < 8 assert 0 <= col < 8 assert player in (P1_CHAR, P2_CHAR), "player: {} error".format(player) self._row = row self._col = col self._player = player self._char = "?" def __str__(self): return "({} at {}, {})".format(self.__class__.__name__, self._row, self._col) def get_char(self): """ Returns single character representation of given chess piece on board. If the piece is owned by player1, it will be lowercase. Otherwise it will be uppercase. :return: string of 1 letter """ if self._player == P1_CHAR: return self._char else: return self._char.upper() def is_moving(self, r2, c2): """ Returns boolean for if target row, col are not both exactly the same as current row, col of the chess piece. :param r2: int :param c2: int :return: Boolean """ return r2 != self._row or c2 != self._col def is_valid_attack(self, board, r2, c2): """ Determines if an attack is valid based on a few criteria: target square is on the board, target square is not a king (of either side) and the defending square is on the opposite team of the current square. :param board: board object :param r2: int :param c2: int :return: Boolean """ if board.on_board(r2, c2) and board.get_square(r2, c2).lower() != "k": defending_square = board.get_square(r2, c2) # able to attack # not islower() is used here to account for "." being valid attack if self._player == P1_CHAR and not defending_square.islower(): return True elif self._player == P2_CHAR and not defending_square.isupper(): return True return False class Pawn(ChessPiece): def __init__(self, row, col, player): ChessPiece.__init__(self, row, col, player) self._char = "p" def calc_moves(self, board): """ returns a dictionary mapping "attacker" to a tuple indicating row and col of the attacking piece and a set of tuples indicating row and column of valid moves. This will include moves that put the king in check which will be filtered out later. """ r1 = self._row c1 = self._col moves = {"attacker": (r1, c1), "defender": set()} # player pawn attack upward, comp pawns attack downward if self._player == P1_CHAR: direction = 1 else: direction = -1 # find diagonal pawn attacks r2 = r1 + (1 * direction) for i in (-1, 1): c2 = c1 + i if self.is_valid_attack(board, r2, c2) and board.get_square(r2, c2) != ".": moves["defender"].add((r2, c2)) # pawn moving 1 upward r2 = r1 + (1 * direction) c2 = c1 if self.is_valid_attack(board, r2, c2): moves["defender"].add((r2, c2)) # pawn moving 2 forward (only in 0-based rows 1 and 6 if r1 == 6 or r1 == 1: r2 = r1 + (2 * direction) c2 = c1 if self.is_valid_attack(board, r2, c2): moves["defender"].add((r2, c2)) return moves class Knight(ChessPiece): def __init__(self, row, col, player): ChessPiece.__init__(self, row, col, player) self._char = "n" def calc_moves(self, board): """ returns a dictionary mapping "attacker" to a tuple indicating row and col of the attacking piece and a set of tuples indicating row and column of valid moves. This will include moves that put the king in check which will be filtered out later. """ r1 = self._row c1 = self._col moves = {"attacker": (r1, c1), "defender": set()} for i, j in ((1, 2), (2, 1)): for i_sign in (-1, 1): for j_sign in (-1, 1): r2 = r1 + (i * i_sign) c2 = c1 + (j * j_sign) assert i != j if self.is_valid_attack(board, r2, c2): moves["defender"].add((r2, c2)) return moves class Bishop(ChessPiece): def __init__(self, row, col, player): ChessPiece.__init__(self, row, col, player) self._char = "b" def calc_moves(self, board): """ returns a dictionary mapping "attacker" to a tuple indicating row and col of the attacking piece and a set of tuples indicating row and column of valid moves. This will include moves that put the king in check which will be filtered out later. """ r1 = self._row c1 = self._col moves = {"attacker": (r1, c1), "defender": set()} # i and j are increments for r2 and c2 going in diagonal directions for i in (-1, 1): for j in (-1, 1): r2 = r1 + i c2 = c1 + j while True: # go in this diagonal direction until hitting a piece if self.is_valid_attack(board, r2, c2): moves["defender"].add((r2, c2)) if board.get_square(r2, c2) != ".": break else: break r2 += i c2 += j return moves class Rook(ChessPiece): def __init__(self, row, col, player): ChessPiece.__init__(self, row, col, player) self._char = "r" def calc_moves(self, board): """ returns a dictionary mapping "attacker" to a tuple indicating row and col of the attacking piece and a set of tuples indicating row and column of valid moves. This will include moves that put the king in check which will be filtered out later. """ r1 = self._row c1 = self._col moves = {"attacker": (r1, c1), "defender": set()} # increment in both directions # collision if piece is found break while for i in (-1, 1): # check all rows in same col r2 = r1 + i c2 = c1 while True: if self.is_valid_attack(board, r2, c2): moves["defender"].add((r2, c2)) # checks for path block if board.get_square(r2, c2) != ".": break else: break r2 += i # check all cols in same row r2 = r1 c2 = c1 + i while True: # breaks in that direction if it can attack a piece if self.is_valid_attack(board, r2, c2): moves["defender"].add((r2, c2)) # checks for path blocked if board.get_square(r2, c2) != ".": break else: break c2 += i return moves class Queen(ChessPiece): def __init__(self, row, col, player): ChessPiece.__init__(self, row, col, player) self._char = "q" def calc_moves(self, board): """ returns a dictionary mapping "attacker" to a tuple indicating row and col of the attacking piece and a set of tuples indicating row and column of valid moves. This will include moves that put the king in check which will be filtered out later. """ r1 = self._row c1 = self._col moves = {"attacker": (r1, c1), "defender": set()} # check columns and rows for i in (-1, 1): r2 = r1 + i c2 = c1 # check all rows in same col while True: if self.is_valid_attack(board, r2, c2): moves["defender"].add((r2, c2)) if board.get_square(r2, c2) != ".": break else: break r2 += i r2 = r1 c2 = c1 + i # check all cols in same row while True: if self.is_valid_attack(board, r2, c2): moves["defender"].add((r2, c2)) if board.get_square(r2, c2) != ".": break else: break c2 += i # check diagonals for i in (-1, 1): for j in (-1, 1): r2 = r1 + i c2 = c1 + j while True: if self.is_valid_attack(board, r2, c2): moves["defender"].add((r2, c2)) if board.get_square(r2, c2) != ".": break else: break r2 += i c2 += j return moves class King(ChessPiece): def __init__(self, row, col, player): ChessPiece.__init__(self, row, col, player) self._char = "k" def calc_moves(self, board): """ returns a dictionary mapping "attacker" to a tuple indicating row and col of the attacking piece and a set of tuples indicating row and column of valid moves. This will include moves that put the king in check which will be filtered out later. """ r1 = self._row c1 = self._col moves = {"attacker": (r1, c1), "defender": set()} # find possible king moves for i in range(-1, 2): for j in range(-1, 2): r2 = r1 + i c2 = c1 + j if self.is_valid_attack(board, r2, c2) \ and not board.is_square_attacked(r2, c2, static_player=True): moves["defender"].add((r2, c2)) assert (r1, c1) not in moves["defender"] return moves
class Solution: def pivotIndex(self, nums: List[int]) -> int: for i in range(0, len(nums)): if sum(nums[:i]) == sum(nums[i+1:]): return i return -1
# para variavel de vi até vf passo x # inicio # fim # para variavel de 1 até 5 passo 1 # inicio # Escrever "Oswaldo" # fim for variavel in range(1,6,1): print("Oswaldo")
class Solution: def longestOnes(self, A: List[int], K: int) -> int: maxLen = zero = start = 0 for i, a in enumerate(A): if a == 0: zero += 1 while zero > K: if A[start] == 0: zero -= 1 start += 1 maxLen = max(maxLen, i - start + 1) return maxLen class Solution2: def longestOnes(self, A: List[int], K: int) -> int: zero = start = 0 for i, a in enumerate(A): if a == 0: zero += 1 if zero > K: if A[start] == 0: zero -= 1 start += 1 return len(A) - start
# coding: utf-8 SUBJECT_AREAS = [ 'Health Sciences', 'Agricultural Sciences', 'Human Sciences', 'Biological Sciences', 'Exact and Earth Sciences', 'Engineering', 'Applied Social Sciences', 'Linguistics, Letters and Arts' ] ISO_639_1 = { u"BE": u"Belarusian", u"BG": u"Bulgarian", u"VE": u"Venda", u"BA": u"Bashkir", u"WA": u"Walloon", u"WO": u"Wolof", u"BM": u"Bambara", u"BN": u"Bengali", u"BO": u"Tibetan", u"BH": u"Bihari languages", u"BI": u"Bislama", u"MH": u"Marshallese", u"BR": u"Breton", u"BS": u"Bosnian", u"JA": u"Japanese", u"RU": u"Russian", u"RW": u"Kinyarwanda", u"TL": u"Tagalog", u"RM": u"Romansh", u"RN": u"Rundi", u"RO": u"Romanian", u"JV": u"Javanese", u"GV": u"Manx", u"GU": u"Gujarati", u"GD": u"Gaelic", u"GA": u"Irish", u"SV": u"Swedish", u"GN": u"Guarani", u"GL": u"Galician", u"OM": u"Oromo", u"TN": u"Tswana", u"OJ": u"Ojibwa", u"FA": u"Persian", u"OC": u"Occitan (post 1500)", u"SS": u"Swati", u"SU": u"Sundanese", u"SR": u"Serbian", u"OS": u"Ossetian", u"OR": u"Oriya", u"HZ": u"Herero", u"HY": u"Armenian", u"HR": u"Croatian", u"SW": u"Swahili", u"HT": u"Haitian", u"HU": u"Hungarian", u"HI": u"Hindi", u"HO": u"Hiri Motu", u"HA": u"Hausa", u"HE": u"Hebrew", u"PS": u"Pushto", u"PT": u"Portuguese", u"SK": u"Slovak", u"PA": u"Panjabi", u"SO": u"Somali", u"PI": u"Pali", u"AK": u"Akan", u"PL": u"Polish", u"SN": u"Shona", u"EL": u"Greek", u"EO": u"Esperanto", u"EN": u"English", u"ZH": u"Chinese", u"SM": u"Samoan", u"EE": u"Ewe", u"AM": u"Amharic", u"ZA": u"Zhuang", u"EU": u"Basque", u"ET": u"Estonian", u"VO": u"Volapük", u"SA": u"Sanskrit", u"ES": u"Spanish", u"MG": u"Malagasy", u"UZ": u"Uzbek", u"ML": u"Malayalam", u"MN": u"Mongolian", u"MI": u"Maori", u"AS": u"Assamese", u"MK": u"Macedonian", u"UR": u"Urdu", u"MT": u"Maltese", u"MS": u"Malay", u"MR": u"Marathi", u"UG": u"Uighur; Uyghur", u"MY": u"Burmese", u"FR": u"French", u"FY": u"Western Frisian", u"AY": u"Aymara", u"FF": u"Fulah", u"ZU": u"Zulu", u"FI": u"Finnish", u"FJ": u"Fijian", u"FO": u"Faroese", u"NL": u"Dutch; Flemish", u"NN": u"Norwegian Nynorsk", u"NO": u"Norwegian", u"NA": u"Nauru", u"NB": u"Bokmål, Norwegian", u"ND": u"Ndebele, North", u"NE": u"Nepali", u"NG": u"Ndonga", u"NY": u"Chichewa", u"NR": u"Ndebele, South", u"NV": u"Navajo", u"XH": u"Xhosa", u"CH": u"Chamorro", u"CO": u"Corsican", u"CA": u"Catalan; Valencian", u"CE": u"Chechen", u"CY": u"Welsh", u"CS": u"Czech", u"CR": u"Cree", u"CV": u"Chuvash", u"CU": u"Church Slavic; Old Slavonic; Church Slavonic; Old Bulgarian; Old Church Slavonic", u"KA": u"Georgian", u"KG": u"Kongo", u"KK": u"Kazakh", u"KJ": u"Kuanyama; Kwanyama", u"KI": u"Kikuyu; Gikuyu", u"KO": u"Korean", u"KN": u"Kannada", u"KM": u"Central Khmer", u"KL": u"Kalaallisut", u"KS": u"Kashmiri", u"KR": u"Kanuri", u"SI": u"Sinhala", u"KW": u"Cornish", u"KV": u"Komi", u"KU": u"Kurdish", u"SL": u"Slovenian", u"SC": u"Sardinian", u"KY": u"Kirghiz", u"SG": u"Sango", u"SE": u"Northern Sami", u"SD": u"Sindhi", u"YI": u"Yiddish", u"YO": u"Yoruba", u"DE": u"German", u"DA": u"Danish", u"DZ": u"Dzongkha", u"DV": u"Divehi", u"LG": u"Ganda", u"LB": u"Luxembourgish", u"LA": u"Latin", u"LN": u"Lingala", u"LO": u"Lao", u"TT": u"Tatar", u"TR": u"Turkish", u"TS": u"Tsonga", u"LI": u"Limburgan", u"LV": u"Latvian", u"TO": u"Tonga", u"LT": u"Lithuanian", u"LU": u"Luba-Katanga", u"TK": u"Turkmen", u"TH": u"Thai", u"TI": u"Tigrinya", u"TG": u"Tajik", u"TE": u"Telugu", u"TA": u"Tamil", u"AA": u"Afar", u"AB": u"Abkhazian", u"AE": u"Avestan", u"UK": u"Ukrainian", u"AF": u"Afrikaans", u"VI": u"Vietnamese", u"IS": u"Icelandic", u"IU": u"Inuktitut", u"IT": u"Italian", u"AN": u"Aragonese", u"II": u"Sichuan Yi", u"IK": u"Inupiaq", u"AR": u"Arabic", u"IO": u"Ido", u"AV": u"Avaric", u"IA": u"Interlingua", u"AZ": u"Azerbaijani", u"IE": u"Interlingue", u"ID": u"Indonesian", u"IG": u"Igbo", u"QU": u"Quechua", u"TY": u"Tahitian", u"ST": u"Sotho, Southern", u"TW": u"Twi", u"SQ": u"Albanian" } ISO_3166 = { 'BD': u'Bangladesh', 'BE': u'Belgium', 'BF': u'Burkina Faso', 'BG': u'Bulgaria', 'BA': u'Bosnia and Herzegovina', 'BB': u'Barbados', 'WF': u'Wallis and Futuna', 'BL': u'Saint Barthélemy', 'BM': u'Bermuda', 'BN': u'Brunei Darussalam', 'BO': u'Bolivia', 'BH': u'Bahrain', 'BI': u'Burundi', 'BJ': u'Benin', 'BT': u'Bhutan', 'BU': u'Burma', 'BV': u'Bouvet Island', 'BW': u'Botswana', 'WS': u'Samoa', 'BQ': u'British Antarctic Territory', 'BR': u'Brazil', 'BS': u'Bahamas', 'JE': u'Jersey', 'WK': u'Wake Island', 'BY': u'Byelorussian SSR', 'BZ': u'Belize', 'RU': u'Russian Federation', 'RW': u'Rwanda', 'PC': u'Pacific Islands', 'TL': u'Timor-Leste', 'JT': u'Johnston Island', 'TM': u'Turkmenistan', 'TJ': u'Tajikistan', 'RO': u'Romania', 'RH': u'Southern Rhodesia', 'TK': u'Tokelau', 'GW': u'Guinea-Bissau', 'GU': u'Guam', 'GT': u'Guatemala', 'GS': u'South Georgia and the South Sandwich Islands', 'GR': u'Greece', 'GQ': u'Equatorial Guinea', 'GP': u'Guadeloupe', 'JP': u'Japan', 'GY': u'Guyana', 'GG': u'Guernsey', 'GF': u'French Guiana', 'GE': u'Gilbert and Ellice Islands', 'GD': u'Grenada', 'GB': u'United Kingdom', 'GA': u'Gabon', 'SV': u'El Salvador', 'GN': u'Guinea', 'GM': u'Gambia', 'GL': u'Greenland', 'GI': u'Gibraltar', 'GH': u'Ghana', 'OM': u'Oman', 'TN': u'Tunisia', 'JM': u'Jamaica', 'JO': u'Jordan', 'HR': u'Croatia', 'HV': u'Upper Volta', 'HT': u'Haiti', 'HU': u'Hungary', 'HK': u'Hong Kong', 'HN': u'Honduras', 'HM': u'Heard Island and McDonald Islands', 'VD': u'Viet-Nam', 'VE': u'Venezuela', 'PR': u'Puerto Rico', 'PS': u'Palestine', 'UA': u'Ukraine', 'PW': u'Palau', 'PT': u'Portugal', 'PU': u'United States Miscellaneous Pacific Islands', 'PZ': u'Panama Canal Zone', 'PY': u'Paraguay', 'IQ': u'Iraq', 'PA': u'Panama', 'PF': u'French Polynesia', 'PG': u'Papua New Guinea', 'PE': u'Peru', 'PK': u'Pakistan', 'PH': u'Philippines', 'PN': u'Pitcairn', 'PL': u'Poland', 'PM': u'Saint Pierre and Miquelon', 'ZM': u'Zambia', 'EH': u'Western Sahara', 'EE': u'Estonia', 'EG': u'Egypt', 'ZA': u'South Africa', 'EC': u'Ecuador', 'IT': u'Italy', 'VN': u'Viet Nam', 'SB': u'Solomon Islands', 'ET': u'Ethiopia', 'SO': u'Somalia', 'ZW': u'Zimbabwe', 'SA': u'Saudi Arabia', 'ES': u'Spain', 'ER': u'Eritrea', 'ME': u'Montenegro', 'MD': u'Moldova', 'MG': u'Madagascar', 'MF': u'Saint Martin', 'MA': u'Morocco', 'MC': u'Monaco', 'UZ': u'Uzbekistan', 'MM': u'Myanmar', 'ML': u'Mali', 'MO': u'Macao', 'MN': u'Mongolia', 'MI': u'Midway Islands', 'MH': u'Marshall Islands', 'MK': u'Macedonia', 'MU': u'Mauritius', 'MT': u'Malta', 'MW': u'Malawi', 'MV': u'Maldives', 'MQ': u'Martinique', 'MP': u'Northern Mariana Islands', 'MS': u'Montserrat', 'MR': u'Mauritania', 'IM': u'Isle of Man', 'UG': u'Uganda', 'TZ': u'Tanzania', 'MY': u'Malaysia', 'MX': u'Mexico', 'IL': u'Israel', 'FQ': u'French Southern and Antarctic Territories', 'FR': u'France', 'IO': u'British Indian Ocean Territory', 'SH': u'Saint Helena', 'RE': u'Réunion', 'SJ': u'Svalbard and Jan Mayen', 'FI': u'Finland', 'FJ': u'Fiji', 'FK': u'Falkland Islands', 'FM': u'Micronesia', 'FO': u'Faroe Islands', 'NH': u'New Hebrides', 'NI': u'Nicaragua', 'NL': u'Netherlands', 'NO': u'Norway', 'NA': u'Namibia', 'VU': u'Vanuatu', 'NC': u'New Caledonia', 'NE': u'Niger', 'NF': u'Norfolk Island', 'NG': u'Nigeria', 'NZ': u'New Zealand', 'ZR': u'Zaire', 'NP': u'Nepal', 'NQ': u'Dronning Maud Land', 'NR': u'Nauru', 'NT': u'Neutral Zone', 'NU': u'Niue', 'CK': u'Cook Islands', 'CI': u"Côte d'Ivoire", 'CH': u'Switzerland', 'CO': u'Colombia', 'CN': u'China', 'CM': u'Cameroon', 'CL': u'Chile', 'CC': u'Cocos', 'CA': u'Canada', 'CG': u'Congo', 'CF': u'Central African Republic', 'CD': u'Congo', 'CZ': u'Czech Republic', 'CY': u'Cyprus', 'CX': u'Christmas Island', 'CS': u'Czechoslovakia', 'CR': u'Costa Rica', 'CW': u'Curaçao', 'CV': u'Cabo Verde', 'CU': u'Cuba', 'CT': u'Canton and Enderbury Islands', 'SZ': u'Swaziland', 'SY': u'Syrian Arab Republic', 'SX': u'Sint Maarten', 'KG': u'Kyrgyzstan', 'KE': u'Kenya', 'SS': u'South Sudan', 'SR': u'Suriname', 'KI': u'Kiribati', 'KH': u'Cambodia', 'KN': u'Saint Kitts and Nevis', 'KM': u'Comoros', 'ST': u'Sao Tome and Principe', 'SK': u'Slovakia', 'KR': u'Korea', 'SI': u'Slovenia', 'KP': u'Korea', 'KW': u'Kuwait', 'SN': u'Senegal', 'SM': u'San Marino', 'SL': u'Sierra Leone', 'SC': u'Seychelles', 'KZ': u'Kazakhstan', 'KY': u'Cayman Islands', 'SG': u'Singapore', 'SE': u'Sweden', 'SD': u'Sudan', 'DO': u'Dominican Republic', 'DM': u'Dominica', 'DJ': u'Djibouti', 'DK': u'Denmark', 'VG': u'Virgin Islands', 'DD': u'German Democratic Republic', 'DE': u'Germany', 'YE': u'Yemen', 'YD': u'Yemen', 'DZ': u'Algeria', 'US': u'United States', 'DY': u'Dahomey', 'UY': u'Uruguay', 'YU': u'Yugoslavia', 'YT': u'Mayotte', 'UM': u'United States Minor Outlying Islands', 'LB': u'Lebanon', 'LC': u'Saint Lucia', 'LA': u"Lao People's Democratic Republic", 'TV': u'Tuvalu', 'TW': u'Taiwan', 'TT': u'Trinidad and Tobago', 'TR': u'Turkey', 'LK': u'Sri Lanka', 'TP': u'East Timor', 'LI': u'Liechtenstein', 'LV': u'Latvia', 'TO': u'Tonga', 'LT': u'Lithuania', 'LU': u'Luxembourg', 'LR': u'Liberia', 'LS': u'Lesotho', 'TH': u'Thailand', 'TF': u'French Southern Territories', 'TG': u'Togo', 'TD': u'Chad', 'TC': u'Turks and Caicos Islands', 'LY': u'Libya', 'VA': u'Holy See', 'VC': u'Saint Vincent and the Grenadines', 'AE': u'United Arab Emirates', 'AD': u'Andorra', 'AG': u'Antigua and Barbuda', 'AF': u'Afghanistan', 'AI': u'Anguilla', 'VI': u'Virgin Islands', 'IS': u'Iceland', 'IR': u'Iran', 'AM': u'Armenia', 'AL': u'Albania', 'AO': u'Angola', 'AN': u'Netherlands Antilles', 'AQ': u'Antarctica', 'AS': u'American Samoa', 'AR': u'Argentina', 'AU': u'Australia', 'AT': u'Austria', 'AW': u'Aruba', 'IN': u'India', 'AX': u'Âland Islands', 'AZ': u'Azerbaijan', 'IE': u'Ireland', 'ID': u'Indonesia', 'RS': u'Serbia', 'QA': u'Qatar', 'MZ': u'Mozambique' }
"""simtk pydra tasks and workflows.""" # __all__ = [ # 'load_image_task' # ] # import numpy as np # from pydra import mark # import itk # from simtk import load_image # load_image_annotated = mark.annotate({'filename': str, 'nphases': int, # 'norientations': int, 'spacing': np.ndarray, 'return': itk.VectorImage })(load_image) # load_image_task = mark.task(load_image_annotated)()
# Fill all this out with your information patreon_client_id = None patreon_client_secret = None patreon_creator_refresh_token = None patreon_creator_access_token = None patreon_creator_id = None patreon_redirect_uri = None
#!/usr/bin/env python3 #https://codeforces.com/problemset/problem/180/C #这个题难度好像标的有点虚高 s = input() #1e5 n = len(s) ll = [0]*(n+1) #lower@left ur = [0]*(n+1) #upper@right for i in range(n): ll[i+1] = ll[i]+1 if s[i].islower() else ll[i] for i in range(n-1,-1,-1): ur[i] = ur[i+1]+1 if s[i].isupper() else ur[i+1] print(min([ll[i]+ur[i] for i in range(n+1)]))
# Initialize Global Variables VERSION = '1.4' TITLE = 'RO:X Next Generation - Auto Fishing version' PID = '' SCREEN_WIDTH = 0 SCREEN_HEIGHT = 0 IS_ACTIVE = False HOLD = True FRAME = None PREV_TIME = 0 CURRENT_TIME = 0 LIMIT = 0 LOOP = 0 IS_FISHING = True LAST_CLICK_TIME = 0 COUNT = 0 BOUNDING_BOX = {'top': 0, 'left': 0, 'width': 240, 'height': 250} CENTER_X = 0 CENTER_Y = 0 RADIUS = 80
class Node: next_node = None data = 0 def __init__(self, value): self.data = value def run(input_data): if input_data is None or input_data.next_node is None: return False input_data.data = input_data.next_node.data input_data.next_node = input_data.next_node.next_node return True
# File to automate the conversion of the glosary to txt file text_file = open("glossory.txt", "r") glossory = text_file.readlines() word = [] deffinition = [] for i in range(len(glossory)): if (i % 2) == 0: word.append(glossory[i]) else: deffinition.append(glossory[i]) word[:] = [line.rstrip('\n') for line in word] deffinition[:] = [line.rstrip('\n') for line in deffinition] for i in word: print(i.lower()) print("\n \n \n \n \n \n \n") for i in deffinition: print(i)
class CronExecutor(object): def __init__(self): # cron cache key is {<Date String YYY-mm-dd>: {<timestamp>: [<string command 1>...]} self._cache = {}
# connect-4 # Define the board's Width and Height as constant WIDTH = 7 HEIGHT = 6 def init_board(): b = [] for x in range(0, WIDTH): b.append([]) for y in range(0, HEIGHT): b[x].append(0) return b def player1_move(board, x, y): board[x][y] = 1 def player2_move(board, x, y): board[x][y] = 2 def print_board(board): for y in range(0, HEIGHT): line = '' for x in range(0, WIDTH): if board[x][y] == 0: line = line + '-' elif board[x][y] == 1: line = line + 'X' elif board[x][y] == 2: line = line + 'O' print(line) def who_won(board): # 0 means no one win, 1 means player 1 wins, 2 means player 2 wins result = 0 # check row for y in range(0, HEIGHT): for x in range(0, WIDTH - 4 + 1): result = check_winning(board[x][y], board[x+1][y], board[x+2][y], board[x+3][y]) if result > 0: return result # check col for x in range(0, WIDTH): for y in range(0, HEIGHT - 4 + 1): # print("{0} {1}".format(x, y)) result = check_winning(board[x][y], board[x][y+1], board[x][y+2], board[x][y+3]) if result > 0: return result # check diagonal NW to SE: for x in range(0, WIDTH - 4 + 1): for y in range(0, HEIGHT - 4 + 1): result = check_winning(board[x][y], board[x+1][y+1], board[x+2][y+2], board[x+3][y+3]) if result > 0: return result # check diagonal NE to SW: for x in range(WIDTH - 4, WIDTH): for y in range(0, HEIGHT - 4 + 1): # print("{0} {1}".format(x, y)) result = check_winning(board[x-3][y+3], board[x-2][y+2], board[x-1][y+1], board[x][y]) if result > 0: return result return result def check_winning(a, b, c, d): if (a == 1) and (b == 1) and (c == 1) and (d == 1): return 1 elif (a == 2) and (b == 2) and (c == 2) and (d == 2): return 2 else: return 0 def print_line(): print("") def is_full(board): result = True for y in range(0, HEIGHT): for x in range(0, WIDTH): if board[x][y] == 0: result = False break return result def input_player_move(board, player_number): # Python 2.7, You need to change input => raw_input input_valid = False while input_valid is False: x = input("Player {0}, enter your move X:".format(player_number)) x = int(x) if x >= 0 and x <= WIDTH - 1: input_valid = True if (input_valid): y = find_top_of_column(board, x) return x, y def find_top_of_column(board, x): result = -1 for y in range(0, HEIGHT): if board[x][y] == 0: result = y return result def main(): board = init_board() won = 0 turn = 1 while (won == 0) and (is_full(board) is False): print_board(board) print_line() x, y = input_player_move(board, turn) if turn == 1: player1_move(board, x, y) if turn == 2: player2_move(board, x, y) won = who_won(board) if turn == 1: turn = 2 else: turn = 1 print_board(board) print_line() if won > 0: print("Player {0} has won!!".format(won)) else: print("It is a tie.") ''' print(board) print(board[0][0]) print(board[0][1]) print_board(board) print_line() player1_move(board, 1, 1) print_board(board) print_line() player2_move(board, 1, 0) print_board(board) print_line() player1_move(board, 0, 0) x, y = input_player_move(1) print("{0}, {1}".format(x, y)) ''' if __name__ == "__main__": main()
class _BaseStateError(BaseException): '''Base class for state-related exceptions. Accepts only one param which must be a list of strings.''' def __init__(self, message=None): message = message or [] if not isinstance(message, list): raise TypeError('{} takes a list of errors not {}'.format( self.__class__, type(message) )) super(_BaseStateError, self).__init__(message) def __str__(self): return '\n'.join([str(msg) for msg in self.args[0]]) class TransitionError(_BaseStateError): pass class StateValidationError(_BaseStateError): pass class BasicValidationError(BaseException): def __init__(self, message=''): super(BasicValidationError, self).__init__(message)
'''16 - Faça um programa para uma loja de tintas. O programa deverá pedir o tamanho em metros quadrados da área a ser pintada. Considere que a cobertura da tinta é de 1 litro para cada 3 metros quadrados e que a tinta é vendida em latas de 18 litros, que custam R$ 80,00. Informe ao usuário a quantidades de latas de tinta a serem compradas e o preço total. ''' metros = float(input("Digite a quantidade de metros quadrados a serem pintados: ")) litros = metros/3 precoL = 80.0 capacidadeL = 18 latas = litros / capacidadeL total = latas * precoL print(f'Você usara {latas} latas de tinta') print(f'O preco total é de: R${total}')
P1_TWO_SUMS = """ Example 1: Input: nums = [2,7,11,15], target = 9 Output: [0,1] Output: Because nums[0] + nums[1] == 9, we return [0, 1]. Example 2: Input: nums = [3,2,4], target = 6 Output: [1,2] Example 3: Input: nums = [3,3], target = 6 Output: [0,1] """ P10_REGEXP_MATCHING = """ The matching should cover the entire input string (not partial). Example 1: Input: s = "aa", p = "a" Output: false Explanation: "a" does not match the entire string "aa". Example 2: Input: s = "aa", p = "a*" Output: true Explanation: '*' means zero or more of the preceding element, 'a'. Therefore, by repeating 'a' once, it becomes "aa". Example 3: Input: s = "ab", p = ".*" Output: true Explanation: ".*" means "zero or more (*) of any character (.)". """
# # PySNMP MIB module EATON-EPDU-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/EATON-EPDU-MIB # Produced by pysmi-0.3.4 at Mon Apr 29 18:44:24 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") ConstraintsUnion, SingleValueConstraint, ValueSizeConstraint, ConstraintsIntersection, ValueRangeConstraint = mibBuilder.importSymbols("ASN1-REFINEMENT", "ConstraintsUnion", "SingleValueConstraint", "ValueSizeConstraint", "ConstraintsIntersection", "ValueRangeConstraint") pduAgent, = mibBuilder.importSymbols("EATON-OIDS", "pduAgent") ModuleCompliance, NotificationGroup, ObjectGroup = mibBuilder.importSymbols("SNMPv2-CONF", "ModuleCompliance", "NotificationGroup", "ObjectGroup") NotificationType, MibScalar, MibTable, MibTableRow, MibTableColumn, iso, TimeTicks, Bits, Counter64, ObjectIdentity, IpAddress, Unsigned32, Counter32, MibIdentifier, Gauge32, Integer32, ModuleIdentity = mibBuilder.importSymbols("SNMPv2-SMI", "NotificationType", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "iso", "TimeTicks", "Bits", "Counter64", "ObjectIdentity", "IpAddress", "Unsigned32", "Counter32", "MibIdentifier", "Gauge32", "Integer32", "ModuleIdentity") DisplayString, DateAndTime, TextualConvention = mibBuilder.importSymbols("SNMPv2-TC", "DisplayString", "DateAndTime", "TextualConvention") eatonEpdu = ModuleIdentity((1, 3, 6, 1, 4, 1, 534, 6, 6, 7)) eatonEpdu.setRevisions(('2014-09-29 12:00', '2013-12-18 12:00', '2013-09-02 12:00', '2013-05-29 12:00', '2013-02-21 12:00', '2011-11-21 12:00', '2011-10-24 12:00', '2011-02-07 15:29',)) if mibBuilder.loadTexts: eatonEpdu.setLastUpdated('201312181200Z') if mibBuilder.loadTexts: eatonEpdu.setOrganization('Eaton Corporation') class UnixTimeStamp(TextualConvention, Counter32): status = 'current' notifications = MibIdentifier((1, 3, 6, 1, 4, 1, 534, 6, 6, 7, 0)) units = MibIdentifier((1, 3, 6, 1, 4, 1, 534, 6, 6, 7, 1)) inputs = MibIdentifier((1, 3, 6, 1, 4, 1, 534, 6, 6, 7, 3)) groups = MibIdentifier((1, 3, 6, 1, 4, 1, 534, 6, 6, 7, 5)) outlets = MibIdentifier((1, 3, 6, 1, 4, 1, 534, 6, 6, 7, 6)) environmental = MibIdentifier((1, 3, 6, 1, 4, 1, 534, 6, 6, 7, 7)) conformance = MibIdentifier((1, 3, 6, 1, 4, 1, 534, 6, 6, 7, 25)) objectGroups = MibIdentifier((1, 3, 6, 1, 4, 1, 534, 6, 6, 7, 25, 5)) notifyUserLogin = NotificationType((1, 3, 6, 1, 4, 1, 534, 6, 6, 7, 0, 1)).setObjects(("EATON-EPDU-MIB", "userName"), ("EATON-EPDU-MIB", "commInterface")) if mibBuilder.loadTexts: notifyUserLogin.setStatus('current') notifyUserLogout = NotificationType((1, 3, 6, 1, 4, 1, 534, 6, 6, 7, 0, 2)).setObjects(("EATON-EPDU-MIB", "userName"), ("EATON-EPDU-MIB", "commInterface")) if mibBuilder.loadTexts: notifyUserLogout.setStatus('current') notifyFailedLogin = NotificationType((1, 3, 6, 1, 4, 1, 534, 6, 6, 7, 0, 3)).setObjects(("EATON-EPDU-MIB", "userName"), ("EATON-EPDU-MIB", "commInterface")) if mibBuilder.loadTexts: notifyFailedLogin.setStatus('current') notifyBootUp = NotificationType((1, 3, 6, 1, 4, 1, 534, 6, 6, 7, 0, 4)).setObjects(("EATON-EPDU-MIB", "strappingIndex")) if mibBuilder.loadTexts: notifyBootUp.setStatus('current') notifyInputVoltageThStatus = NotificationType((1, 3, 6, 1, 4, 1, 534, 6, 6, 7, 0, 11)).setObjects(("EATON-EPDU-MIB", "strappingIndex"), ("EATON-EPDU-MIB", "inputIndex"), ("EATON-EPDU-MIB", "inputVoltageIndex"), ("EATON-EPDU-MIB", "inputVoltage"), ("EATON-EPDU-MIB", "inputVoltageThStatus")) if mibBuilder.loadTexts: notifyInputVoltageThStatus.setStatus('current') notifyInputCurrentThStatus = NotificationType((1, 3, 6, 1, 4, 1, 534, 6, 6, 7, 0, 12)).setObjects(("EATON-EPDU-MIB", "strappingIndex"), ("EATON-EPDU-MIB", "inputIndex"), ("EATON-EPDU-MIB", "inputCurrentIndex"), ("EATON-EPDU-MIB", "inputCurrent"), ("EATON-EPDU-MIB", "inputCurrentThStatus")) if mibBuilder.loadTexts: notifyInputCurrentThStatus.setStatus('current') notifyInputFrequencyStatus = NotificationType((1, 3, 6, 1, 4, 1, 534, 6, 6, 7, 0, 13)).setObjects(("EATON-EPDU-MIB", "strappingIndex"), ("EATON-EPDU-MIB", "inputIndex"), ("EATON-EPDU-MIB", "inputFrequency"), ("EATON-EPDU-MIB", "inputFrequencyStatus")) if mibBuilder.loadTexts: notifyInputFrequencyStatus.setStatus('current') notifyGroupVoltageThStatus = NotificationType((1, 3, 6, 1, 4, 1, 534, 6, 6, 7, 0, 21)).setObjects(("EATON-EPDU-MIB", "strappingIndex"), ("EATON-EPDU-MIB", "groupIndex"), ("EATON-EPDU-MIB", "groupVoltage"), ("EATON-EPDU-MIB", "groupVoltageThStatus")) if mibBuilder.loadTexts: notifyGroupVoltageThStatus.setStatus('current') notifyGroupCurrentThStatus = NotificationType((1, 3, 6, 1, 4, 1, 534, 6, 6, 7, 0, 22)).setObjects(("EATON-EPDU-MIB", "strappingIndex"), ("EATON-EPDU-MIB", "groupIndex"), ("EATON-EPDU-MIB", "groupCurrent"), ("EATON-EPDU-MIB", "groupCurrentThStatus")) if mibBuilder.loadTexts: notifyGroupCurrentThStatus.setStatus('current') notifyGroupBreakerStatus = NotificationType((1, 3, 6, 1, 4, 1, 534, 6, 6, 7, 0, 23)).setObjects(("EATON-EPDU-MIB", "strappingIndex"), ("EATON-EPDU-MIB", "groupIndex"), ("EATON-EPDU-MIB", "groupBreakerStatus")) if mibBuilder.loadTexts: notifyGroupBreakerStatus.setStatus('current') notifyOutletVoltageThStatus = NotificationType((1, 3, 6, 1, 4, 1, 534, 6, 6, 7, 0, 31)).setObjects(("EATON-EPDU-MIB", "strappingIndex"), ("EATON-EPDU-MIB", "outletIndex"), ("EATON-EPDU-MIB", "outletVoltage"), ("EATON-EPDU-MIB", "outletVoltageThStatus")) if mibBuilder.loadTexts: notifyOutletVoltageThStatus.setStatus('current') notifyOutletCurrentThStatus = NotificationType((1, 3, 6, 1, 4, 1, 534, 6, 6, 7, 0, 32)).setObjects(("EATON-EPDU-MIB", "strappingIndex"), ("EATON-EPDU-MIB", "outletIndex"), ("EATON-EPDU-MIB", "outletCurrent"), ("EATON-EPDU-MIB", "outletCurrentThStatus")) if mibBuilder.loadTexts: notifyOutletCurrentThStatus.setStatus('current') notifyOutletControlStatus = NotificationType((1, 3, 6, 1, 4, 1, 534, 6, 6, 7, 0, 33)).setObjects(("EATON-EPDU-MIB", "strappingIndex"), ("EATON-EPDU-MIB", "outletIndex"), ("EATON-EPDU-MIB", "outletControlStatus")) if mibBuilder.loadTexts: notifyOutletControlStatus.setStatus('current') notifyTemperatureThStatus = NotificationType((1, 3, 6, 1, 4, 1, 534, 6, 6, 7, 0, 41)).setObjects(("EATON-EPDU-MIB", "strappingIndex"), ("EATON-EPDU-MIB", "temperatureIndex"), ("EATON-EPDU-MIB", "temperatureValue"), ("EATON-EPDU-MIB", "temperatureThStatus")) if mibBuilder.loadTexts: notifyTemperatureThStatus.setStatus('current') notifyHumidityThStatus = NotificationType((1, 3, 6, 1, 4, 1, 534, 6, 6, 7, 0, 42)).setObjects(("EATON-EPDU-MIB", "strappingIndex"), ("EATON-EPDU-MIB", "humidityIndex"), ("EATON-EPDU-MIB", "humidityValue"), ("EATON-EPDU-MIB", "humidityThStatus")) if mibBuilder.loadTexts: notifyHumidityThStatus.setStatus('current') notifyContactState = NotificationType((1, 3, 6, 1, 4, 1, 534, 6, 6, 7, 0, 43)).setObjects(("EATON-EPDU-MIB", "strappingIndex"), ("EATON-EPDU-MIB", "contactIndex"), ("EATON-EPDU-MIB", "contactState")) if mibBuilder.loadTexts: notifyContactState.setStatus('current') notifyProbeStatus = NotificationType((1, 3, 6, 1, 4, 1, 534, 6, 6, 7, 0, 44)).setObjects(("EATON-EPDU-MIB", "strappingIndex"), ("EATON-EPDU-MIB", "temperatureIndex"), ("EATON-EPDU-MIB", "temperatureProbeStatus")) if mibBuilder.loadTexts: notifyProbeStatus.setStatus('current') notifyCommunicationStatus = NotificationType((1, 3, 6, 1, 4, 1, 534, 6, 6, 7, 0, 51)).setObjects(("EATON-EPDU-MIB", "strappingIndex"), ("EATON-EPDU-MIB", "communicationStatus")) if mibBuilder.loadTexts: notifyCommunicationStatus.setStatus('current') notifyInternalStatus = NotificationType((1, 3, 6, 1, 4, 1, 534, 6, 6, 7, 0, 52)).setObjects(("EATON-EPDU-MIB", "strappingIndex"), ("EATON-EPDU-MIB", "internalStatus")) if mibBuilder.loadTexts: notifyInternalStatus.setStatus('current') notifyTest = NotificationType((1, 3, 6, 1, 4, 1, 534, 6, 6, 7, 0, 53)) if mibBuilder.loadTexts: notifyTest.setStatus('current') notifyStrappingStatus = NotificationType((1, 3, 6, 1, 4, 1, 534, 6, 6, 7, 0, 54)).setObjects(("EATON-EPDU-MIB", "strappingIndex"), ("EATON-EPDU-MIB", "strappingStatus")) if mibBuilder.loadTexts: notifyStrappingStatus.setStatus('current') unitsPresent = MibScalar((1, 3, 6, 1, 4, 1, 534, 6, 6, 7, 1, 1), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: unitsPresent.setStatus('current') unitTable = MibTable((1, 3, 6, 1, 4, 1, 534, 6, 6, 7, 1, 2), ) if mibBuilder.loadTexts: unitTable.setStatus('current') unitEntry = MibTableRow((1, 3, 6, 1, 4, 1, 534, 6, 6, 7, 1, 2, 1), ).setIndexNames((0, "EATON-EPDU-MIB", "strappingIndex")) if mibBuilder.loadTexts: unitEntry.setStatus('current') strappingIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 534, 6, 6, 7, 1, 2, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 23))).setMaxAccess("accessiblefornotify") if mibBuilder.loadTexts: strappingIndex.setStatus('current') productName = MibTableColumn((1, 3, 6, 1, 4, 1, 534, 6, 6, 7, 1, 2, 1, 2), OctetString().subtype(subtypeSpec=ValueSizeConstraint(1, 127))).setMaxAccess("readonly") if mibBuilder.loadTexts: productName.setStatus('current') partNumber = MibTableColumn((1, 3, 6, 1, 4, 1, 534, 6, 6, 7, 1, 2, 1, 3), OctetString()).setMaxAccess("readonly") if mibBuilder.loadTexts: partNumber.setStatus('current') serialNumber = MibTableColumn((1, 3, 6, 1, 4, 1, 534, 6, 6, 7, 1, 2, 1, 4), OctetString()).setMaxAccess("readonly") if mibBuilder.loadTexts: serialNumber.setStatus('current') firmwareVersion = MibTableColumn((1, 3, 6, 1, 4, 1, 534, 6, 6, 7, 1, 2, 1, 5), OctetString()).setMaxAccess("readonly") if mibBuilder.loadTexts: firmwareVersion.setStatus('current') unitName = MibTableColumn((1, 3, 6, 1, 4, 1, 534, 6, 6, 7, 1, 2, 1, 6), OctetString().subtype(subtypeSpec=ValueSizeConstraint(1, 63))).setMaxAccess("readwrite") if mibBuilder.loadTexts: unitName.setStatus('current') lcdControl = MibTableColumn((1, 3, 6, 1, 4, 1, 534, 6, 6, 7, 1, 2, 1, 7), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3))).clone(namedValues=NamedValues(("notApplicable", 0), ("lcdScreenOff", 1), ("lcdKeyLock", 2), ("lcdScreenOffAndKeyLock", 3)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: lcdControl.setStatus('current') clockValue = MibTableColumn((1, 3, 6, 1, 4, 1, 534, 6, 6, 7, 1, 2, 1, 8), DateAndTime()).setMaxAccess("readwrite") if mibBuilder.loadTexts: clockValue.setStatus('current') temperatureScale = MibTableColumn((1, 3, 6, 1, 4, 1, 534, 6, 6, 7, 1, 2, 1, 9), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1))).clone(namedValues=NamedValues(("celsius", 0), ("fahrenheit", 1)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: temperatureScale.setStatus('current') unitType = MibTableColumn((1, 3, 6, 1, 4, 1, 534, 6, 6, 7, 1, 2, 1, 10), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3, 4))).clone(namedValues=NamedValues(("unknown", 0), ("switched", 1), ("advancedMonitored", 2), ("managed", 3), ("monitored", 4)))).setMaxAccess("readonly") if mibBuilder.loadTexts: unitType.setStatus('current') inputCount = MibTableColumn((1, 3, 6, 1, 4, 1, 534, 6, 6, 7, 1, 2, 1, 20), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: inputCount.setStatus('current') groupCount = MibTableColumn((1, 3, 6, 1, 4, 1, 534, 6, 6, 7, 1, 2, 1, 21), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: groupCount.setStatus('current') outletCount = MibTableColumn((1, 3, 6, 1, 4, 1, 534, 6, 6, 7, 1, 2, 1, 22), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: outletCount.setStatus('current') temperatureCount = MibTableColumn((1, 3, 6, 1, 4, 1, 534, 6, 6, 7, 1, 2, 1, 23), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: temperatureCount.setStatus('current') humidityCount = MibTableColumn((1, 3, 6, 1, 4, 1, 534, 6, 6, 7, 1, 2, 1, 24), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: humidityCount.setStatus('current') contactCount = MibTableColumn((1, 3, 6, 1, 4, 1, 534, 6, 6, 7, 1, 2, 1, 25), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: contactCount.setStatus('current') communicationStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 534, 6, 6, 7, 1, 2, 1, 30), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1))).clone(namedValues=NamedValues(("good", 0), ("communicationLost", 1)))).setMaxAccess("readonly") if mibBuilder.loadTexts: communicationStatus.setStatus('current') internalStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 534, 6, 6, 7, 1, 2, 1, 31), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1))).clone(namedValues=NamedValues(("good", 0), ("internalFailure", 1)))).setMaxAccess("readonly") if mibBuilder.loadTexts: internalStatus.setStatus('current') strappingStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 534, 6, 6, 7, 1, 2, 1, 32), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1))).clone(namedValues=NamedValues(("good", 0), ("communicationLost", 1)))).setMaxAccess("readonly") if mibBuilder.loadTexts: strappingStatus.setStatus('current') userName = MibTableColumn((1, 3, 6, 1, 4, 1, 534, 6, 6, 7, 1, 2, 1, 40), OctetString().subtype(subtypeSpec=ValueSizeConstraint(0, 31))).setMaxAccess("accessiblefornotify") if mibBuilder.loadTexts: userName.setStatus('current') commInterface = MibTableColumn((1, 3, 6, 1, 4, 1, 534, 6, 6, 7, 1, 2, 1, 41), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3, 4, 5))).clone(namedValues=NamedValues(("serial", 0), ("usb", 1), ("telnet", 2), ("web", 3), ("ftp", 4), ("xml", 5)))).setMaxAccess("accessiblefornotify") if mibBuilder.loadTexts: commInterface.setStatus('current') unitControlTable = MibTable((1, 3, 6, 1, 4, 1, 534, 6, 6, 7, 1, 3), ) if mibBuilder.loadTexts: unitControlTable.setStatus('current') unitControlEntry = MibTableRow((1, 3, 6, 1, 4, 1, 534, 6, 6, 7, 1, 3, 1), ).setIndexNames((0, "EATON-EPDU-MIB", "strappingIndex")) if mibBuilder.loadTexts: unitControlEntry.setStatus('current') unitControlOffCmd = MibTableColumn((1, 3, 6, 1, 4, 1, 534, 6, 6, 7, 1, 3, 1, 2), Integer32().subtype(subtypeSpec=ValueRangeConstraint(-1, 99999))).setMaxAccess("readwrite") if mibBuilder.loadTexts: unitControlOffCmd.setStatus('current') unitControlOnCmd = MibTableColumn((1, 3, 6, 1, 4, 1, 534, 6, 6, 7, 1, 3, 1, 3), Integer32().subtype(subtypeSpec=ValueRangeConstraint(-1, 99999))).setMaxAccess("readwrite") if mibBuilder.loadTexts: unitControlOnCmd.setStatus('current') inputTable = MibTable((1, 3, 6, 1, 4, 1, 534, 6, 6, 7, 3, 1), ) if mibBuilder.loadTexts: inputTable.setStatus('current') inputEntry = MibTableRow((1, 3, 6, 1, 4, 1, 534, 6, 6, 7, 3, 1, 1), ).setIndexNames((0, "EATON-EPDU-MIB", "strappingIndex"), (0, "EATON-EPDU-MIB", "inputIndex")) if mibBuilder.loadTexts: inputEntry.setStatus('current') inputIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 534, 6, 6, 7, 3, 1, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 2))).setMaxAccess("accessiblefornotify") if mibBuilder.loadTexts: inputIndex.setStatus('current') inputType = MibTableColumn((1, 3, 6, 1, 4, 1, 534, 6, 6, 7, 3, 1, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4))).clone(namedValues=NamedValues(("singlePhase", 1), ("splitPhase", 2), ("threePhaseDelta", 3), ("threePhaseWye", 4)))).setMaxAccess("readonly") if mibBuilder.loadTexts: inputType.setStatus('current') inputFrequency = MibTableColumn((1, 3, 6, 1, 4, 1, 534, 6, 6, 7, 3, 1, 1, 3), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: inputFrequency.setStatus('current') inputFrequencyStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 534, 6, 6, 7, 3, 1, 1, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1))).clone(namedValues=NamedValues(("good", 0), ("outOfRange", 1)))).setMaxAccess("readonly") if mibBuilder.loadTexts: inputFrequencyStatus.setStatus('current') inputVoltageCount = MibTableColumn((1, 3, 6, 1, 4, 1, 534, 6, 6, 7, 3, 1, 1, 5), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: inputVoltageCount.setStatus('current') inputCurrentCount = MibTableColumn((1, 3, 6, 1, 4, 1, 534, 6, 6, 7, 3, 1, 1, 6), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: inputCurrentCount.setStatus('current') inputPowerCount = MibTableColumn((1, 3, 6, 1, 4, 1, 534, 6, 6, 7, 3, 1, 1, 7), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: inputPowerCount.setStatus('current') inputPlugType = MibTableColumn((1, 3, 6, 1, 4, 1, 534, 6, 6, 7, 3, 1, 1, 8), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(100, 200, 300, 101, 102, 103, 104, 105, 106, 107, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 150, 151, 152, 201, 202, 301, 302, 303, 304, 306, 320, 321, 322, 323, 324, 325, 326, 350, 351))).clone(namedValues=NamedValues(("other1Phase", 100), ("other2Phase", 200), ("other3Phase", 300), ("iecC14Inlet", 101), ("iecC20Inlet", 102), ("iec316P6", 103), ("iec332P6", 104), ("iec360P6", 105), ("iecC14Plug", 106), ("iecC20Plug", 107), ("nema515", 120), ("nemaL515", 121), ("nema520", 122), ("nemaL520", 123), ("nema615", 124), ("nemaL615", 125), ("nemaL530", 126), ("nema620", 127), ("nemaL620", 128), ("nemaL630", 129), ("cs8265", 130), ("french", 150), ("schuko", 151), ("uk", 152), ("nemaL1420", 201), ("nemaL1430", 202), ("iec516P6", 301), ("iec460P9", 302), ("iec560P9", 303), ("iec532P6", 304), ("iec563P6", 306), ("nemaL1520", 320), ("nemaL2120", 321), ("nemaL1530", 322), ("nemaL2130", 323), ("cs8365", 324), ("nemaL2220", 325), ("nemaL2230", 326), ("bladeUps208V", 350), ("bladeUps400V", 351)))).setMaxAccess("readonly") if mibBuilder.loadTexts: inputPlugType.setStatus('current') inputVoltageTable = MibTable((1, 3, 6, 1, 4, 1, 534, 6, 6, 7, 3, 2), ) if mibBuilder.loadTexts: inputVoltageTable.setStatus('current') inputVoltageEntry = MibTableRow((1, 3, 6, 1, 4, 1, 534, 6, 6, 7, 3, 2, 1), ).setIndexNames((0, "EATON-EPDU-MIB", "strappingIndex"), (0, "EATON-EPDU-MIB", "inputIndex"), (0, "EATON-EPDU-MIB", "inputVoltageIndex")) if mibBuilder.loadTexts: inputVoltageEntry.setStatus('current') inputVoltageIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 534, 6, 6, 7, 3, 2, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 3))).setMaxAccess("accessiblefornotify") if mibBuilder.loadTexts: inputVoltageIndex.setStatus('current') inputVoltageMeasType = MibTableColumn((1, 3, 6, 1, 4, 1, 534, 6, 6, 7, 3, 2, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6, 7))).clone(namedValues=NamedValues(("singlePhase", 1), ("phase1toN", 2), ("phase2toN", 3), ("phase3toN", 4), ("phase1to2", 5), ("phase2to3", 6), ("phase3to1", 7)))).setMaxAccess("readonly") if mibBuilder.loadTexts: inputVoltageMeasType.setStatus('current') inputVoltage = MibTableColumn((1, 3, 6, 1, 4, 1, 534, 6, 6, 7, 3, 2, 1, 3), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: inputVoltage.setStatus('current') inputVoltageThStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 534, 6, 6, 7, 3, 2, 1, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3, 4))).clone(namedValues=NamedValues(("good", 0), ("lowWarning", 1), ("lowCritical", 2), ("highWarning", 3), ("highCritical", 4)))).setMaxAccess("readonly") if mibBuilder.loadTexts: inputVoltageThStatus.setStatus('current') inputVoltageThLowerWarning = MibTableColumn((1, 3, 6, 1, 4, 1, 534, 6, 6, 7, 3, 2, 1, 5), Integer32().subtype(subtypeSpec=ValueRangeConstraint(-1, 500000))).setMaxAccess("readwrite") if mibBuilder.loadTexts: inputVoltageThLowerWarning.setStatus('current') inputVoltageThLowerCritical = MibTableColumn((1, 3, 6, 1, 4, 1, 534, 6, 6, 7, 3, 2, 1, 6), Integer32().subtype(subtypeSpec=ValueRangeConstraint(-1, 500000))).setMaxAccess("readwrite") if mibBuilder.loadTexts: inputVoltageThLowerCritical.setStatus('current') inputVoltageThUpperWarning = MibTableColumn((1, 3, 6, 1, 4, 1, 534, 6, 6, 7, 3, 2, 1, 7), Integer32().subtype(subtypeSpec=ValueRangeConstraint(-1, 500000))).setMaxAccess("readwrite") if mibBuilder.loadTexts: inputVoltageThUpperWarning.setStatus('current') inputVoltageThUpperCritical = MibTableColumn((1, 3, 6, 1, 4, 1, 534, 6, 6, 7, 3, 2, 1, 8), Integer32().subtype(subtypeSpec=ValueRangeConstraint(-1, 500000))).setMaxAccess("readwrite") if mibBuilder.loadTexts: inputVoltageThUpperCritical.setStatus('current') inputCurrentTable = MibTable((1, 3, 6, 1, 4, 1, 534, 6, 6, 7, 3, 3), ) if mibBuilder.loadTexts: inputCurrentTable.setStatus('current') inputCurrentEntry = MibTableRow((1, 3, 6, 1, 4, 1, 534, 6, 6, 7, 3, 3, 1), ).setIndexNames((0, "EATON-EPDU-MIB", "strappingIndex"), (0, "EATON-EPDU-MIB", "inputIndex"), (0, "EATON-EPDU-MIB", "inputCurrentIndex")) if mibBuilder.loadTexts: inputCurrentEntry.setStatus('current') inputCurrentIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 534, 6, 6, 7, 3, 3, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 4))).setMaxAccess("accessiblefornotify") if mibBuilder.loadTexts: inputCurrentIndex.setStatus('current') inputCurrentMeasType = MibTableColumn((1, 3, 6, 1, 4, 1, 534, 6, 6, 7, 3, 3, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5))).clone(namedValues=NamedValues(("singlePhase", 1), ("neutral", 2), ("phase1", 3), ("phase2", 4), ("phase3", 5)))).setMaxAccess("readonly") if mibBuilder.loadTexts: inputCurrentMeasType.setStatus('current') inputCurrentCapacity = MibTableColumn((1, 3, 6, 1, 4, 1, 534, 6, 6, 7, 3, 3, 1, 3), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: inputCurrentCapacity.setStatus('current') inputCurrent = MibTableColumn((1, 3, 6, 1, 4, 1, 534, 6, 6, 7, 3, 3, 1, 4), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: inputCurrent.setStatus('current') inputCurrentThStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 534, 6, 6, 7, 3, 3, 1, 5), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3, 4))).clone(namedValues=NamedValues(("good", 0), ("lowWarning", 1), ("lowCritical", 2), ("highWarning", 3), ("highCritical", 4)))).setMaxAccess("readonly") if mibBuilder.loadTexts: inputCurrentThStatus.setStatus('current') inputCurrentThLowerWarning = MibTableColumn((1, 3, 6, 1, 4, 1, 534, 6, 6, 7, 3, 3, 1, 6), Integer32().subtype(subtypeSpec=ValueRangeConstraint(-1, 100000))).setMaxAccess("readwrite") if mibBuilder.loadTexts: inputCurrentThLowerWarning.setStatus('current') inputCurrentThLowerCritical = MibTableColumn((1, 3, 6, 1, 4, 1, 534, 6, 6, 7, 3, 3, 1, 7), Integer32().subtype(subtypeSpec=ValueRangeConstraint(-1, 100000))).setMaxAccess("readwrite") if mibBuilder.loadTexts: inputCurrentThLowerCritical.setStatus('current') inputCurrentThUpperWarning = MibTableColumn((1, 3, 6, 1, 4, 1, 534, 6, 6, 7, 3, 3, 1, 8), Integer32().subtype(subtypeSpec=ValueRangeConstraint(-1, 100000))).setMaxAccess("readwrite") if mibBuilder.loadTexts: inputCurrentThUpperWarning.setStatus('current') inputCurrentThUpperCritical = MibTableColumn((1, 3, 6, 1, 4, 1, 534, 6, 6, 7, 3, 3, 1, 9), Integer32().subtype(subtypeSpec=ValueRangeConstraint(-1, 100000))).setMaxAccess("readwrite") if mibBuilder.loadTexts: inputCurrentThUpperCritical.setStatus('current') inputCurrentCrestFactor = MibTableColumn((1, 3, 6, 1, 4, 1, 534, 6, 6, 7, 3, 3, 1, 10), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: inputCurrentCrestFactor.setStatus('current') inputCurrentPercentLoad = MibTableColumn((1, 3, 6, 1, 4, 1, 534, 6, 6, 7, 3, 3, 1, 11), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: inputCurrentPercentLoad.setStatus('current') inputPowerTable = MibTable((1, 3, 6, 1, 4, 1, 534, 6, 6, 7, 3, 4), ) if mibBuilder.loadTexts: inputPowerTable.setStatus('current') inputPowerEntry = MibTableRow((1, 3, 6, 1, 4, 1, 534, 6, 6, 7, 3, 4, 1), ).setIndexNames((0, "EATON-EPDU-MIB", "strappingIndex"), (0, "EATON-EPDU-MIB", "inputIndex"), (0, "EATON-EPDU-MIB", "inputPowerIndex")) if mibBuilder.loadTexts: inputPowerEntry.setStatus('current') inputPowerIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 534, 6, 6, 7, 3, 4, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 12))) if mibBuilder.loadTexts: inputPowerIndex.setStatus('current') inputPowerMeasType = MibTableColumn((1, 3, 6, 1, 4, 1, 534, 6, 6, 7, 3, 4, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3, 4))).clone(namedValues=NamedValues(("unknown", 0), ("phase1", 1), ("phase2", 2), ("phase3", 3), ("total", 4)))).setMaxAccess("readonly") if mibBuilder.loadTexts: inputPowerMeasType.setStatus('current') inputVA = MibTableColumn((1, 3, 6, 1, 4, 1, 534, 6, 6, 7, 3, 4, 1, 3), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: inputVA.setStatus('current') inputWatts = MibTableColumn((1, 3, 6, 1, 4, 1, 534, 6, 6, 7, 3, 4, 1, 4), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: inputWatts.setStatus('current') inputWh = MibTableColumn((1, 3, 6, 1, 4, 1, 534, 6, 6, 7, 3, 4, 1, 5), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(0, 4294967295))).setMaxAccess("readwrite") if mibBuilder.loadTexts: inputWh.setStatus('current') inputWhTimer = MibTableColumn((1, 3, 6, 1, 4, 1, 534, 6, 6, 7, 3, 4, 1, 6), UnixTimeStamp()).setMaxAccess("readonly") if mibBuilder.loadTexts: inputWhTimer.setStatus('current') inputPowerFactor = MibTableColumn((1, 3, 6, 1, 4, 1, 534, 6, 6, 7, 3, 4, 1, 7), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: inputPowerFactor.setStatus('current') inputVAR = MibTableColumn((1, 3, 6, 1, 4, 1, 534, 6, 6, 7, 3, 4, 1, 8), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: inputVAR.setStatus('current') inputTotalPowerTable = MibTable((1, 3, 6, 1, 4, 1, 534, 6, 6, 7, 3, 5), ) if mibBuilder.loadTexts: inputTotalPowerTable.setStatus('current') inputTotalPowerEntry = MibTableRow((1, 3, 6, 1, 4, 1, 534, 6, 6, 7, 3, 5, 1), ).setIndexNames((0, "EATON-EPDU-MIB", "strappingIndex"), (0, "EATON-EPDU-MIB", "inputIndex")) if mibBuilder.loadTexts: inputTotalPowerEntry.setStatus('current') inputTotalVA = MibTableColumn((1, 3, 6, 1, 4, 1, 534, 6, 6, 7, 3, 5, 1, 3), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: inputTotalVA.setStatus('current') inputTotalWatts = MibTableColumn((1, 3, 6, 1, 4, 1, 534, 6, 6, 7, 3, 5, 1, 4), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: inputTotalWatts.setStatus('current') inputTotalWh = MibTableColumn((1, 3, 6, 1, 4, 1, 534, 6, 6, 7, 3, 5, 1, 5), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(0, 4294967295))).setMaxAccess("readwrite") if mibBuilder.loadTexts: inputTotalWh.setStatus('current') inputTotalWhTimer = MibTableColumn((1, 3, 6, 1, 4, 1, 534, 6, 6, 7, 3, 5, 1, 6), UnixTimeStamp()).setMaxAccess("readonly") if mibBuilder.loadTexts: inputTotalWhTimer.setStatus('current') inputTotalPowerFactor = MibTableColumn((1, 3, 6, 1, 4, 1, 534, 6, 6, 7, 3, 5, 1, 7), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: inputTotalPowerFactor.setStatus('current') inputTotalVAR = MibTableColumn((1, 3, 6, 1, 4, 1, 534, 6, 6, 7, 3, 5, 1, 8), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: inputTotalVAR.setStatus('current') groupTable = MibTable((1, 3, 6, 1, 4, 1, 534, 6, 6, 7, 5, 1), ) if mibBuilder.loadTexts: groupTable.setStatus('current') groupEntry = MibTableRow((1, 3, 6, 1, 4, 1, 534, 6, 6, 7, 5, 1, 1), ).setIndexNames((0, "EATON-EPDU-MIB", "strappingIndex"), (0, "EATON-EPDU-MIB", "groupIndex")) if mibBuilder.loadTexts: groupEntry.setStatus('current') groupIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 534, 6, 6, 7, 5, 1, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 64))).setMaxAccess("accessiblefornotify") if mibBuilder.loadTexts: groupIndex.setStatus('current') groupID = MibTableColumn((1, 3, 6, 1, 4, 1, 534, 6, 6, 7, 5, 1, 1, 2), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(2, 4))).setMaxAccess("readonly") if mibBuilder.loadTexts: groupID.setStatus('current') groupName = MibTableColumn((1, 3, 6, 1, 4, 1, 534, 6, 6, 7, 5, 1, 1, 3), OctetString().subtype(subtypeSpec=ValueSizeConstraint(1, 31))).setMaxAccess("readwrite") if mibBuilder.loadTexts: groupName.setStatus('current') groupType = MibTableColumn((1, 3, 6, 1, 4, 1, 534, 6, 6, 7, 5, 1, 1, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3, 4, 5))).clone(namedValues=NamedValues(("unknown", 0), ("breaker1pole", 1), ("breaker2pole", 2), ("breaker3pole", 3), ("outletSection", 4), ("userDefined", 5)))).setMaxAccess("readonly") if mibBuilder.loadTexts: groupType.setStatus('current') groupBreakerStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 534, 6, 6, 7, 5, 1, 1, 5), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2))).clone(namedValues=NamedValues(("notApplicable", 0), ("breakerOn", 1), ("breakerOff", 2)))).setMaxAccess("readonly") if mibBuilder.loadTexts: groupBreakerStatus.setStatus('current') groupChildCount = MibTableColumn((1, 3, 6, 1, 4, 1, 534, 6, 6, 7, 5, 1, 1, 6), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: groupChildCount.setStatus('current') groupChildTable = MibTable((1, 3, 6, 1, 4, 1, 534, 6, 6, 7, 5, 2), ) if mibBuilder.loadTexts: groupChildTable.setStatus('current') groupChildEntry = MibTableRow((1, 3, 6, 1, 4, 1, 534, 6, 6, 7, 5, 2, 1), ).setIndexNames((0, "EATON-EPDU-MIB", "strappingIndex"), (0, "EATON-EPDU-MIB", "groupIndex"), (0, "EATON-EPDU-MIB", "groupChildIndex")) if mibBuilder.loadTexts: groupChildEntry.setStatus('current') groupChildIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 534, 6, 6, 7, 5, 2, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 32))) if mibBuilder.loadTexts: groupChildIndex.setStatus('current') groupChildType = MibTableColumn((1, 3, 6, 1, 4, 1, 534, 6, 6, 7, 5, 2, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 2, 3, 4))).clone(namedValues=NamedValues(("unknown", 0), ("section", 2), ("custom", 3), ("outlet", 4)))).setMaxAccess("readonly") if mibBuilder.loadTexts: groupChildType.setStatus('current') groupChildOID = MibTableColumn((1, 3, 6, 1, 4, 1, 534, 6, 6, 7, 5, 2, 1, 3), ObjectIdentifier()).setMaxAccess("readonly") if mibBuilder.loadTexts: groupChildOID.setStatus('current') groupVoltageTable = MibTable((1, 3, 6, 1, 4, 1, 534, 6, 6, 7, 5, 3), ) if mibBuilder.loadTexts: groupVoltageTable.setStatus('current') groupVoltageEntry = MibTableRow((1, 3, 6, 1, 4, 1, 534, 6, 6, 7, 5, 3, 1), ).setIndexNames((0, "EATON-EPDU-MIB", "strappingIndex"), (0, "EATON-EPDU-MIB", "groupIndex")) if mibBuilder.loadTexts: groupVoltageEntry.setStatus('current') groupVoltageMeasType = MibTableColumn((1, 3, 6, 1, 4, 1, 534, 6, 6, 7, 5, 3, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3, 4, 5, 6, 7))).clone(namedValues=NamedValues(("unknown", 0), ("singlePhase", 1), ("phase1toN", 2), ("phase2toN", 3), ("phase3toN", 4), ("phase1to2", 5), ("phase2to3", 6), ("phase3to1", 7)))).setMaxAccess("readonly") if mibBuilder.loadTexts: groupVoltageMeasType.setStatus('current') groupVoltage = MibTableColumn((1, 3, 6, 1, 4, 1, 534, 6, 6, 7, 5, 3, 1, 3), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: groupVoltage.setStatus('current') groupVoltageThStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 534, 6, 6, 7, 5, 3, 1, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3, 4))).clone(namedValues=NamedValues(("good", 0), ("lowWarning", 1), ("lowCritical", 2), ("highWarning", 3), ("highCritical", 4)))).setMaxAccess("readonly") if mibBuilder.loadTexts: groupVoltageThStatus.setStatus('current') groupVoltageThLowerWarning = MibTableColumn((1, 3, 6, 1, 4, 1, 534, 6, 6, 7, 5, 3, 1, 5), Integer32().subtype(subtypeSpec=ValueRangeConstraint(-1, 500000))).setMaxAccess("readwrite") if mibBuilder.loadTexts: groupVoltageThLowerWarning.setStatus('current') groupVoltageThLowerCritical = MibTableColumn((1, 3, 6, 1, 4, 1, 534, 6, 6, 7, 5, 3, 1, 6), Integer32().subtype(subtypeSpec=ValueRangeConstraint(-1, 500000))).setMaxAccess("readwrite") if mibBuilder.loadTexts: groupVoltageThLowerCritical.setStatus('current') groupVoltageThUpperWarning = MibTableColumn((1, 3, 6, 1, 4, 1, 534, 6, 6, 7, 5, 3, 1, 7), Integer32().subtype(subtypeSpec=ValueRangeConstraint(-1, 500000))).setMaxAccess("readwrite") if mibBuilder.loadTexts: groupVoltageThUpperWarning.setStatus('current') groupVoltageThUpperCritical = MibTableColumn((1, 3, 6, 1, 4, 1, 534, 6, 6, 7, 5, 3, 1, 8), Integer32().subtype(subtypeSpec=ValueRangeConstraint(-1, 500000))).setMaxAccess("readwrite") if mibBuilder.loadTexts: groupVoltageThUpperCritical.setStatus('current') groupCurrentTable = MibTable((1, 3, 6, 1, 4, 1, 534, 6, 6, 7, 5, 4), ) if mibBuilder.loadTexts: groupCurrentTable.setStatus('current') groupCurrentEntry = MibTableRow((1, 3, 6, 1, 4, 1, 534, 6, 6, 7, 5, 4, 1), ).setIndexNames((0, "EATON-EPDU-MIB", "strappingIndex"), (0, "EATON-EPDU-MIB", "groupIndex")) if mibBuilder.loadTexts: groupCurrentEntry.setStatus('current') groupCurrentCapacity = MibTableColumn((1, 3, 6, 1, 4, 1, 534, 6, 6, 7, 5, 4, 1, 2), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: groupCurrentCapacity.setStatus('current') groupCurrent = MibTableColumn((1, 3, 6, 1, 4, 1, 534, 6, 6, 7, 5, 4, 1, 3), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: groupCurrent.setStatus('current') groupCurrentThStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 534, 6, 6, 7, 5, 4, 1, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3, 4))).clone(namedValues=NamedValues(("good", 0), ("lowWarning", 1), ("lowCritical", 2), ("highWarning", 3), ("highCritical", 4)))).setMaxAccess("readonly") if mibBuilder.loadTexts: groupCurrentThStatus.setStatus('current') groupCurrentThLowerWarning = MibTableColumn((1, 3, 6, 1, 4, 1, 534, 6, 6, 7, 5, 4, 1, 5), Integer32().subtype(subtypeSpec=ValueRangeConstraint(-1, 100000))).setMaxAccess("readwrite") if mibBuilder.loadTexts: groupCurrentThLowerWarning.setStatus('current') groupCurrentThLowerCritical = MibTableColumn((1, 3, 6, 1, 4, 1, 534, 6, 6, 7, 5, 4, 1, 6), Integer32().subtype(subtypeSpec=ValueRangeConstraint(-1, 100000))).setMaxAccess("readwrite") if mibBuilder.loadTexts: groupCurrentThLowerCritical.setStatus('current') groupCurrentThUpperWarning = MibTableColumn((1, 3, 6, 1, 4, 1, 534, 6, 6, 7, 5, 4, 1, 7), Integer32().subtype(subtypeSpec=ValueRangeConstraint(-1, 100000))).setMaxAccess("readwrite") if mibBuilder.loadTexts: groupCurrentThUpperWarning.setStatus('current') groupCurrentThUpperCritical = MibTableColumn((1, 3, 6, 1, 4, 1, 534, 6, 6, 7, 5, 4, 1, 8), Integer32().subtype(subtypeSpec=ValueRangeConstraint(-1, 100000))).setMaxAccess("readwrite") if mibBuilder.loadTexts: groupCurrentThUpperCritical.setStatus('current') groupCurrentCrestFactor = MibTableColumn((1, 3, 6, 1, 4, 1, 534, 6, 6, 7, 5, 4, 1, 9), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: groupCurrentCrestFactor.setStatus('current') groupCurrentPercentLoad = MibTableColumn((1, 3, 6, 1, 4, 1, 534, 6, 6, 7, 5, 4, 1, 10), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: groupCurrentPercentLoad.setStatus('current') groupPowerTable = MibTable((1, 3, 6, 1, 4, 1, 534, 6, 6, 7, 5, 5), ) if mibBuilder.loadTexts: groupPowerTable.setStatus('current') groupPowerEntry = MibTableRow((1, 3, 6, 1, 4, 1, 534, 6, 6, 7, 5, 5, 1), ).setIndexNames((0, "EATON-EPDU-MIB", "strappingIndex"), (0, "EATON-EPDU-MIB", "groupIndex")) if mibBuilder.loadTexts: groupPowerEntry.setStatus('current') groupVA = MibTableColumn((1, 3, 6, 1, 4, 1, 534, 6, 6, 7, 5, 5, 1, 2), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: groupVA.setStatus('current') groupWatts = MibTableColumn((1, 3, 6, 1, 4, 1, 534, 6, 6, 7, 5, 5, 1, 3), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: groupWatts.setStatus('current') groupWh = MibTableColumn((1, 3, 6, 1, 4, 1, 534, 6, 6, 7, 5, 5, 1, 4), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(0, 4294967295))).setMaxAccess("readwrite") if mibBuilder.loadTexts: groupWh.setStatus('current') groupWhTimer = MibTableColumn((1, 3, 6, 1, 4, 1, 534, 6, 6, 7, 5, 5, 1, 5), UnixTimeStamp()).setMaxAccess("readonly") if mibBuilder.loadTexts: groupWhTimer.setStatus('current') groupPowerFactor = MibTableColumn((1, 3, 6, 1, 4, 1, 534, 6, 6, 7, 5, 5, 1, 6), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: groupPowerFactor.setStatus('current') groupVAR = MibTableColumn((1, 3, 6, 1, 4, 1, 534, 6, 6, 7, 5, 5, 1, 7), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: groupVAR.setStatus('current') groupControlTable = MibTable((1, 3, 6, 1, 4, 1, 534, 6, 6, 7, 5, 6), ) if mibBuilder.loadTexts: groupControlTable.setStatus('current') groupControlEntry = MibTableRow((1, 3, 6, 1, 4, 1, 534, 6, 6, 7, 5, 6, 1), ).setIndexNames((0, "EATON-EPDU-MIB", "strappingIndex"), (0, "EATON-EPDU-MIB", "groupIndex")) if mibBuilder.loadTexts: groupControlEntry.setStatus('current') groupControlStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 534, 6, 6, 7, 5, 6, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3))).clone(namedValues=NamedValues(("off", 0), ("on", 1), ("rebooting", 2), ("mixed", 3)))).setMaxAccess("readonly") if mibBuilder.loadTexts: groupControlStatus.setStatus('current') groupControlOffCmd = MibTableColumn((1, 3, 6, 1, 4, 1, 534, 6, 6, 7, 5, 6, 1, 3), Integer32().subtype(subtypeSpec=ValueRangeConstraint(-1, 99999))).setMaxAccess("readwrite") if mibBuilder.loadTexts: groupControlOffCmd.setStatus('current') groupControl0nCmd = MibTableColumn((1, 3, 6, 1, 4, 1, 534, 6, 6, 7, 5, 6, 1, 4), Integer32().subtype(subtypeSpec=ValueRangeConstraint(-1, 99999))).setMaxAccess("readwrite") if mibBuilder.loadTexts: groupControl0nCmd.setStatus('current') groupControlRebootCmd = MibTableColumn((1, 3, 6, 1, 4, 1, 534, 6, 6, 7, 5, 6, 1, 5), Integer32().subtype(subtypeSpec=ValueRangeConstraint(-1, 0))).setMaxAccess("readwrite") if mibBuilder.loadTexts: groupControlRebootCmd.setStatus('current') outletTable = MibTable((1, 3, 6, 1, 4, 1, 534, 6, 6, 7, 6, 1), ) if mibBuilder.loadTexts: outletTable.setStatus('current') outletEntry = MibTableRow((1, 3, 6, 1, 4, 1, 534, 6, 6, 7, 6, 1, 1), ).setIndexNames((0, "EATON-EPDU-MIB", "strappingIndex"), (0, "EATON-EPDU-MIB", "outletIndex")) if mibBuilder.loadTexts: outletEntry.setStatus('current') outletIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 534, 6, 6, 7, 6, 1, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 64))).setMaxAccess("accessiblefornotify") if mibBuilder.loadTexts: outletIndex.setStatus('current') outletID = MibTableColumn((1, 3, 6, 1, 4, 1, 534, 6, 6, 7, 6, 1, 1, 2), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(2, 4))).setMaxAccess("readonly") if mibBuilder.loadTexts: outletID.setStatus('current') outletName = MibTableColumn((1, 3, 6, 1, 4, 1, 534, 6, 6, 7, 6, 1, 1, 3), OctetString().subtype(subtypeSpec=ValueSizeConstraint(1, 31))).setMaxAccess("readwrite") if mibBuilder.loadTexts: outletName.setStatus('current') outletParentCount = MibTableColumn((1, 3, 6, 1, 4, 1, 534, 6, 6, 7, 6, 1, 1, 4), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: outletParentCount.setStatus('current') outletType = MibTableColumn((1, 3, 6, 1, 4, 1, 534, 6, 6, 7, 6, 1, 1, 5), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 10, 11, 12, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30))).clone(namedValues=NamedValues(("unknown", 0), ("iecC13", 1), ("iecC19", 2), ("uk", 10), ("french", 11), ("schuko", 12), ("nema515", 20), ("nema51520", 21), ("nema520", 22), ("nemaL520", 23), ("nemaL530", 24), ("nema615", 25), ("nema620", 26), ("nemaL620", 27), ("nemaL630", 28), ("nemaL715", 29), ("rf203p277", 30)))).setMaxAccess("readonly") if mibBuilder.loadTexts: outletType.setStatus('current') outletParentTable = MibTable((1, 3, 6, 1, 4, 1, 534, 6, 6, 7, 6, 2), ) if mibBuilder.loadTexts: outletParentTable.setStatus('current') outletParentEntry = MibTableRow((1, 3, 6, 1, 4, 1, 534, 6, 6, 7, 6, 2, 1), ).setIndexNames((0, "EATON-EPDU-MIB", "strappingIndex"), (0, "EATON-EPDU-MIB", "outletIndex"), (0, "EATON-EPDU-MIB", "outletParentIndex")) if mibBuilder.loadTexts: outletParentEntry.setStatus('current') outletParentIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 534, 6, 6, 7, 6, 2, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 32))) if mibBuilder.loadTexts: outletParentIndex.setStatus('current') outletParentType = MibTableColumn((1, 3, 6, 1, 4, 1, 534, 6, 6, 7, 6, 2, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3))).clone(namedValues=NamedValues(("unknown", 0), ("breaker", 1), ("section", 2), ("custom", 3)))).setMaxAccess("readonly") if mibBuilder.loadTexts: outletParentType.setStatus('current') outletParentOID = MibTableColumn((1, 3, 6, 1, 4, 1, 534, 6, 6, 7, 6, 2, 1, 3), ObjectIdentifier()).setMaxAccess("readonly") if mibBuilder.loadTexts: outletParentOID.setStatus('current') outletVoltageTable = MibTable((1, 3, 6, 1, 4, 1, 534, 6, 6, 7, 6, 3), ) if mibBuilder.loadTexts: outletVoltageTable.setStatus('current') outletVoltageEntry = MibTableRow((1, 3, 6, 1, 4, 1, 534, 6, 6, 7, 6, 3, 1), ).setIndexNames((0, "EATON-EPDU-MIB", "strappingIndex"), (0, "EATON-EPDU-MIB", "outletIndex")) if mibBuilder.loadTexts: outletVoltageEntry.setStatus('current') outletVoltage = MibTableColumn((1, 3, 6, 1, 4, 1, 534, 6, 6, 7, 6, 3, 1, 2), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: outletVoltage.setStatus('current') outletVoltageThStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 534, 6, 6, 7, 6, 3, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3, 4))).clone(namedValues=NamedValues(("good", 0), ("lowWarning", 1), ("lowCritical", 2), ("highWarning", 3), ("highCritical", 4)))).setMaxAccess("readonly") if mibBuilder.loadTexts: outletVoltageThStatus.setStatus('current') outletVoltageThLowerWarning = MibTableColumn((1, 3, 6, 1, 4, 1, 534, 6, 6, 7, 6, 3, 1, 4), Integer32().subtype(subtypeSpec=ValueRangeConstraint(-1, 500000))).setMaxAccess("readwrite") if mibBuilder.loadTexts: outletVoltageThLowerWarning.setStatus('current') outletVoltageThLowerCritical = MibTableColumn((1, 3, 6, 1, 4, 1, 534, 6, 6, 7, 6, 3, 1, 5), Integer32().subtype(subtypeSpec=ValueRangeConstraint(-1, 500000))).setMaxAccess("readwrite") if mibBuilder.loadTexts: outletVoltageThLowerCritical.setStatus('current') outletVoltageThUpperWarning = MibTableColumn((1, 3, 6, 1, 4, 1, 534, 6, 6, 7, 6, 3, 1, 6), Integer32().subtype(subtypeSpec=ValueRangeConstraint(-1, 500000))).setMaxAccess("readwrite") if mibBuilder.loadTexts: outletVoltageThUpperWarning.setStatus('current') outletVoltageThUpperCritical = MibTableColumn((1, 3, 6, 1, 4, 1, 534, 6, 6, 7, 6, 3, 1, 7), Integer32().subtype(subtypeSpec=ValueRangeConstraint(-1, 500000))).setMaxAccess("readwrite") if mibBuilder.loadTexts: outletVoltageThUpperCritical.setStatus('current') outletCurrentTable = MibTable((1, 3, 6, 1, 4, 1, 534, 6, 6, 7, 6, 4), ) if mibBuilder.loadTexts: outletCurrentTable.setStatus('current') outletCurrentEntry = MibTableRow((1, 3, 6, 1, 4, 1, 534, 6, 6, 7, 6, 4, 1), ).setIndexNames((0, "EATON-EPDU-MIB", "strappingIndex"), (0, "EATON-EPDU-MIB", "outletIndex")) if mibBuilder.loadTexts: outletCurrentEntry.setStatus('current') outletCurrentCapacity = MibTableColumn((1, 3, 6, 1, 4, 1, 534, 6, 6, 7, 6, 4, 1, 2), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: outletCurrentCapacity.setStatus('current') outletCurrent = MibTableColumn((1, 3, 6, 1, 4, 1, 534, 6, 6, 7, 6, 4, 1, 3), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: outletCurrent.setStatus('current') outletCurrentThStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 534, 6, 6, 7, 6, 4, 1, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3, 4))).clone(namedValues=NamedValues(("good", 0), ("lowWarning", 1), ("lowCritical", 2), ("highWarning", 3), ("highCritical", 4)))).setMaxAccess("readonly") if mibBuilder.loadTexts: outletCurrentThStatus.setStatus('current') outletCurrentThLowerWarning = MibTableColumn((1, 3, 6, 1, 4, 1, 534, 6, 6, 7, 6, 4, 1, 5), Integer32().subtype(subtypeSpec=ValueRangeConstraint(-1, 100000))).setMaxAccess("readwrite") if mibBuilder.loadTexts: outletCurrentThLowerWarning.setStatus('current') outletCurrentThLowerCritical = MibTableColumn((1, 3, 6, 1, 4, 1, 534, 6, 6, 7, 6, 4, 1, 6), Integer32().subtype(subtypeSpec=ValueRangeConstraint(-1, 100000))).setMaxAccess("readwrite") if mibBuilder.loadTexts: outletCurrentThLowerCritical.setStatus('current') outletCurrentThUpperWarning = MibTableColumn((1, 3, 6, 1, 4, 1, 534, 6, 6, 7, 6, 4, 1, 7), Integer32().subtype(subtypeSpec=ValueRangeConstraint(-1, 100000))).setMaxAccess("readwrite") if mibBuilder.loadTexts: outletCurrentThUpperWarning.setStatus('current') outletCurrentThUpperCritical = MibTableColumn((1, 3, 6, 1, 4, 1, 534, 6, 6, 7, 6, 4, 1, 8), Integer32().subtype(subtypeSpec=ValueRangeConstraint(-1, 100000))).setMaxAccess("readwrite") if mibBuilder.loadTexts: outletCurrentThUpperCritical.setStatus('current') outletCurrentCrestFactor = MibTableColumn((1, 3, 6, 1, 4, 1, 534, 6, 6, 7, 6, 4, 1, 9), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: outletCurrentCrestFactor.setStatus('current') outletCurrentPercentLoad = MibTableColumn((1, 3, 6, 1, 4, 1, 534, 6, 6, 7, 6, 4, 1, 10), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: outletCurrentPercentLoad.setStatus('current') outletPowerTable = MibTable((1, 3, 6, 1, 4, 1, 534, 6, 6, 7, 6, 5), ) if mibBuilder.loadTexts: outletPowerTable.setStatus('current') outletPowerEntry = MibTableRow((1, 3, 6, 1, 4, 1, 534, 6, 6, 7, 6, 5, 1), ).setIndexNames((0, "EATON-EPDU-MIB", "strappingIndex"), (0, "EATON-EPDU-MIB", "outletIndex")) if mibBuilder.loadTexts: outletPowerEntry.setStatus('current') outletVA = MibTableColumn((1, 3, 6, 1, 4, 1, 534, 6, 6, 7, 6, 5, 1, 2), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: outletVA.setStatus('current') outletWatts = MibTableColumn((1, 3, 6, 1, 4, 1, 534, 6, 6, 7, 6, 5, 1, 3), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: outletWatts.setStatus('current') outletWh = MibTableColumn((1, 3, 6, 1, 4, 1, 534, 6, 6, 7, 6, 5, 1, 4), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(0, 4294967295))).setMaxAccess("readwrite") if mibBuilder.loadTexts: outletWh.setStatus('current') outletWhTimer = MibTableColumn((1, 3, 6, 1, 4, 1, 534, 6, 6, 7, 6, 5, 1, 5), UnixTimeStamp()).setMaxAccess("readonly") if mibBuilder.loadTexts: outletWhTimer.setStatus('current') outletPowerFactor = MibTableColumn((1, 3, 6, 1, 4, 1, 534, 6, 6, 7, 6, 5, 1, 6), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: outletPowerFactor.setStatus('current') outletVAR = MibTableColumn((1, 3, 6, 1, 4, 1, 534, 6, 6, 7, 6, 5, 1, 7), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: outletVAR.setStatus('current') outletControlTable = MibTable((1, 3, 6, 1, 4, 1, 534, 6, 6, 7, 6, 6), ) if mibBuilder.loadTexts: outletControlTable.setStatus('current') outletControlEntry = MibTableRow((1, 3, 6, 1, 4, 1, 534, 6, 6, 7, 6, 6, 1), ).setIndexNames((0, "EATON-EPDU-MIB", "strappingIndex"), (0, "EATON-EPDU-MIB", "outletIndex")) if mibBuilder.loadTexts: outletControlEntry.setStatus('current') outletControlStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 534, 6, 6, 7, 6, 6, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3))).clone(namedValues=NamedValues(("off", 0), ("on", 1), ("pendingOff", 2), ("pendingOn", 3)))).setMaxAccess("readonly") if mibBuilder.loadTexts: outletControlStatus.setStatus('current') outletControlOffCmd = MibTableColumn((1, 3, 6, 1, 4, 1, 534, 6, 6, 7, 6, 6, 1, 3), Integer32().subtype(subtypeSpec=ValueRangeConstraint(-1, 99999))).setMaxAccess("readwrite") if mibBuilder.loadTexts: outletControlOffCmd.setStatus('current') outletControlOnCmd = MibTableColumn((1, 3, 6, 1, 4, 1, 534, 6, 6, 7, 6, 6, 1, 4), Integer32().subtype(subtypeSpec=ValueRangeConstraint(-1, 99999))).setMaxAccess("readwrite") if mibBuilder.loadTexts: outletControlOnCmd.setStatus('current') outletControlRebootCmd = MibTableColumn((1, 3, 6, 1, 4, 1, 534, 6, 6, 7, 6, 6, 1, 5), Integer32().subtype(subtypeSpec=ValueRangeConstraint(-1, 99999))).setMaxAccess("readwrite") if mibBuilder.loadTexts: outletControlRebootCmd.setStatus('current') outletControlPowerOnState = MibTableColumn((1, 3, 6, 1, 4, 1, 534, 6, 6, 7, 6, 6, 1, 6), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2))).clone(namedValues=NamedValues(("off", 0), ("on", 1), ("lastState", 2)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: outletControlPowerOnState.setStatus('current') outletControlSequenceDelay = MibTableColumn((1, 3, 6, 1, 4, 1, 534, 6, 6, 7, 6, 6, 1, 7), Integer32().subtype(subtypeSpec=ValueRangeConstraint(-1, 99999))).setMaxAccess("readwrite") if mibBuilder.loadTexts: outletControlSequenceDelay.setStatus('current') outletControlRebootOffTime = MibTableColumn((1, 3, 6, 1, 4, 1, 534, 6, 6, 7, 6, 6, 1, 8), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 99999))).setMaxAccess("readwrite") if mibBuilder.loadTexts: outletControlRebootOffTime.setStatus('current') outletControlSwitchable = MibTableColumn((1, 3, 6, 1, 4, 1, 534, 6, 6, 7, 6, 6, 1, 9), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("switchable", 1), ("notSwitchable", 2)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: outletControlSwitchable.setStatus('current') outletControlShutoffDelay = MibTableColumn((1, 3, 6, 1, 4, 1, 534, 6, 6, 7, 6, 6, 1, 10), Integer32().subtype(subtypeSpec=ValueRangeConstraint(-1, 99999))).setMaxAccess("readwrite") if mibBuilder.loadTexts: outletControlShutoffDelay.setStatus('current') temperatureTable = MibTable((1, 3, 6, 1, 4, 1, 534, 6, 6, 7, 7, 1), ) if mibBuilder.loadTexts: temperatureTable.setStatus('current') temperatureEntry = MibTableRow((1, 3, 6, 1, 4, 1, 534, 6, 6, 7, 7, 1, 1), ).setIndexNames((0, "EATON-EPDU-MIB", "strappingIndex"), (0, "EATON-EPDU-MIB", "temperatureIndex")) if mibBuilder.loadTexts: temperatureEntry.setStatus('current') temperatureIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 534, 6, 6, 7, 7, 1, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 2))).setMaxAccess("accessiblefornotify") if mibBuilder.loadTexts: temperatureIndex.setStatus('current') temperatureName = MibTableColumn((1, 3, 6, 1, 4, 1, 534, 6, 6, 7, 7, 1, 1, 2), OctetString().subtype(subtypeSpec=ValueSizeConstraint(1, 31))).setMaxAccess("readwrite") if mibBuilder.loadTexts: temperatureName.setStatus('current') temperatureProbeStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 534, 6, 6, 7, 7, 1, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(-1, 0, 1))).clone(namedValues=NamedValues(("bad", -1), ("disconnected", 0), ("connected", 1)))).setMaxAccess("readonly") if mibBuilder.loadTexts: temperatureProbeStatus.setStatus('current') temperatureValue = MibTableColumn((1, 3, 6, 1, 4, 1, 534, 6, 6, 7, 7, 1, 1, 4), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: temperatureValue.setStatus('current') temperatureThStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 534, 6, 6, 7, 7, 1, 1, 5), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3, 4))).clone(namedValues=NamedValues(("good", 0), ("lowWarning", 1), ("lowCritical", 2), ("highWarning", 3), ("highCritical", 4)))).setMaxAccess("readonly") if mibBuilder.loadTexts: temperatureThStatus.setStatus('current') temperatureThLowerWarning = MibTableColumn((1, 3, 6, 1, 4, 1, 534, 6, 6, 7, 7, 1, 1, 6), Integer32().subtype(subtypeSpec=ValueRangeConstraint(-1, 150000))).setMaxAccess("readwrite") if mibBuilder.loadTexts: temperatureThLowerWarning.setStatus('current') temperatureThLowerCritical = MibTableColumn((1, 3, 6, 1, 4, 1, 534, 6, 6, 7, 7, 1, 1, 7), Integer32().subtype(subtypeSpec=ValueRangeConstraint(-1, 150000))).setMaxAccess("readwrite") if mibBuilder.loadTexts: temperatureThLowerCritical.setStatus('current') temperatureThUpperWarning = MibTableColumn((1, 3, 6, 1, 4, 1, 534, 6, 6, 7, 7, 1, 1, 8), Integer32().subtype(subtypeSpec=ValueRangeConstraint(-1, 150000))).setMaxAccess("readwrite") if mibBuilder.loadTexts: temperatureThUpperWarning.setStatus('current') temperatureThUpperCritical = MibTableColumn((1, 3, 6, 1, 4, 1, 534, 6, 6, 7, 7, 1, 1, 9), Integer32().subtype(subtypeSpec=ValueRangeConstraint(-1, 150000))).setMaxAccess("readwrite") if mibBuilder.loadTexts: temperatureThUpperCritical.setStatus('current') humidityTable = MibTable((1, 3, 6, 1, 4, 1, 534, 6, 6, 7, 7, 2), ) if mibBuilder.loadTexts: humidityTable.setStatus('current') humidityEntry = MibTableRow((1, 3, 6, 1, 4, 1, 534, 6, 6, 7, 7, 2, 1), ).setIndexNames((0, "EATON-EPDU-MIB", "strappingIndex"), (0, "EATON-EPDU-MIB", "humidityIndex")) if mibBuilder.loadTexts: humidityEntry.setStatus('current') humidityIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 534, 6, 6, 7, 7, 2, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 2))).setMaxAccess("accessiblefornotify") if mibBuilder.loadTexts: humidityIndex.setStatus('current') humidityName = MibTableColumn((1, 3, 6, 1, 4, 1, 534, 6, 6, 7, 7, 2, 1, 2), OctetString().subtype(subtypeSpec=ValueSizeConstraint(1, 31))).setMaxAccess("readwrite") if mibBuilder.loadTexts: humidityName.setStatus('current') humidityProbeStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 534, 6, 6, 7, 7, 2, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(-1, 0, 1))).clone(namedValues=NamedValues(("bad", -1), ("disconnected", 0), ("connected", 1)))).setMaxAccess("readonly") if mibBuilder.loadTexts: humidityProbeStatus.setStatus('current') humidityValue = MibTableColumn((1, 3, 6, 1, 4, 1, 534, 6, 6, 7, 7, 2, 1, 4), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: humidityValue.setStatus('current') humidityThStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 534, 6, 6, 7, 7, 2, 1, 5), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3, 4))).clone(namedValues=NamedValues(("good", 0), ("lowWarning", 1), ("lowCritical", 2), ("highWarning", 3), ("highCritical", 4)))).setMaxAccess("readonly") if mibBuilder.loadTexts: humidityThStatus.setStatus('current') humidityThLowerWarning = MibTableColumn((1, 3, 6, 1, 4, 1, 534, 6, 6, 7, 7, 2, 1, 6), Integer32().subtype(subtypeSpec=ValueRangeConstraint(-1, 1000))).setMaxAccess("readwrite") if mibBuilder.loadTexts: humidityThLowerWarning.setStatus('current') humidityThLowerCritical = MibTableColumn((1, 3, 6, 1, 4, 1, 534, 6, 6, 7, 7, 2, 1, 7), Integer32().subtype(subtypeSpec=ValueRangeConstraint(-1, 1000))).setMaxAccess("readwrite") if mibBuilder.loadTexts: humidityThLowerCritical.setStatus('current') humidityThUpperWarning = MibTableColumn((1, 3, 6, 1, 4, 1, 534, 6, 6, 7, 7, 2, 1, 8), Integer32().subtype(subtypeSpec=ValueRangeConstraint(-1, 1000))).setMaxAccess("readwrite") if mibBuilder.loadTexts: humidityThUpperWarning.setStatus('current') humidityThUpperCritical = MibTableColumn((1, 3, 6, 1, 4, 1, 534, 6, 6, 7, 7, 2, 1, 9), Integer32().subtype(subtypeSpec=ValueRangeConstraint(-1, 1000))).setMaxAccess("readwrite") if mibBuilder.loadTexts: humidityThUpperCritical.setStatus('current') contactTable = MibTable((1, 3, 6, 1, 4, 1, 534, 6, 6, 7, 7, 3), ) if mibBuilder.loadTexts: contactTable.setStatus('current') contactEntry = MibTableRow((1, 3, 6, 1, 4, 1, 534, 6, 6, 7, 7, 3, 1), ).setIndexNames((0, "EATON-EPDU-MIB", "strappingIndex"), (0, "EATON-EPDU-MIB", "contactIndex")) if mibBuilder.loadTexts: contactEntry.setStatus('current') contactIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 534, 6, 6, 7, 7, 3, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 3))).setMaxAccess("accessiblefornotify") if mibBuilder.loadTexts: contactIndex.setStatus('current') contactName = MibTableColumn((1, 3, 6, 1, 4, 1, 534, 6, 6, 7, 7, 3, 1, 2), OctetString().subtype(subtypeSpec=ValueSizeConstraint(1, 31))).setMaxAccess("readwrite") if mibBuilder.loadTexts: contactName.setStatus('current') contactProbeStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 534, 6, 6, 7, 7, 3, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(-1, 0, 1))).clone(namedValues=NamedValues(("bad", -1), ("disconnected", 0), ("connected", 1)))).setMaxAccess("readonly") if mibBuilder.loadTexts: contactProbeStatus.setStatus('current') contactState = MibTableColumn((1, 3, 6, 1, 4, 1, 534, 6, 6, 7, 7, 3, 1, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(-1, 0, 1))).clone(namedValues=NamedValues(("contactBad", -1), ("contactOpen", 0), ("contactClosed", 1)))).setMaxAccess("readonly") if mibBuilder.loadTexts: contactState.setStatus('current') eatonEpduCompliances = ModuleCompliance((1, 3, 6, 1, 4, 1, 534, 6, 6, 7, 25, 1)).setObjects(("EATON-EPDU-MIB", "epduRequiredGroup"), ("EATON-EPDU-MIB", "epduOptionalGroup"), ("EATON-EPDU-MIB", "epduNotifyGroup")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): eatonEpduCompliances = eatonEpduCompliances.setStatus('current') epduRequiredGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 534, 6, 6, 7, 25, 5, 1)).setObjects(("EATON-EPDU-MIB", "unitName"), ("EATON-EPDU-MIB", "firmwareVersion")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): epduRequiredGroup = epduRequiredGroup.setStatus('current') epduOptionalGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 534, 6, 6, 7, 25, 5, 2)).setObjects(("EATON-EPDU-MIB", "clockValue"), ("EATON-EPDU-MIB", "commInterface"), ("EATON-EPDU-MIB", "communicationStatus"), ("EATON-EPDU-MIB", "contactCount"), ("EATON-EPDU-MIB", "contactIndex"), ("EATON-EPDU-MIB", "contactName"), ("EATON-EPDU-MIB", "contactProbeStatus"), ("EATON-EPDU-MIB", "contactState"), ("EATON-EPDU-MIB", "groupChildCount"), ("EATON-EPDU-MIB", "groupChildOID"), ("EATON-EPDU-MIB", "groupChildType"), ("EATON-EPDU-MIB", "groupControl0nCmd"), ("EATON-EPDU-MIB", "groupControlOffCmd"), ("EATON-EPDU-MIB", "groupControlRebootCmd"), ("EATON-EPDU-MIB", "groupControlStatus"), ("EATON-EPDU-MIB", "groupCount"), ("EATON-EPDU-MIB", "groupCurrent"), ("EATON-EPDU-MIB", "groupCurrentCapacity"), ("EATON-EPDU-MIB", "groupCurrentCrestFactor"), ("EATON-EPDU-MIB", "groupCurrentPercentLoad"), ("EATON-EPDU-MIB", "groupCurrentThLowerCritical"), ("EATON-EPDU-MIB", "groupCurrentThLowerWarning"), ("EATON-EPDU-MIB", "groupCurrentThStatus"), ("EATON-EPDU-MIB", "groupCurrentThUpperCritical"), ("EATON-EPDU-MIB", "groupCurrentThUpperWarning"), ("EATON-EPDU-MIB", "groupID"), ("EATON-EPDU-MIB", "groupIndex"), ("EATON-EPDU-MIB", "groupName"), ("EATON-EPDU-MIB", "groupBreakerStatus"), ("EATON-EPDU-MIB", "groupPowerFactor"), ("EATON-EPDU-MIB", "groupType"), ("EATON-EPDU-MIB", "groupVA"), ("EATON-EPDU-MIB", "groupVAR"), ("EATON-EPDU-MIB", "groupVoltage"), ("EATON-EPDU-MIB", "groupVoltageMeasType"), ("EATON-EPDU-MIB", "groupVoltageThLowerCritical"), ("EATON-EPDU-MIB", "groupVoltageThLowerWarning"), ("EATON-EPDU-MIB", "groupVoltageThStatus"), ("EATON-EPDU-MIB", "groupVoltageThUpperCritical"), ("EATON-EPDU-MIB", "groupVoltageThUpperWarning"), ("EATON-EPDU-MIB", "groupWatts"), ("EATON-EPDU-MIB", "groupWh"), ("EATON-EPDU-MIB", "groupWhTimer"), ("EATON-EPDU-MIB", "humidityCount"), ("EATON-EPDU-MIB", "humidityIndex"), ("EATON-EPDU-MIB", "humidityName"), ("EATON-EPDU-MIB", "humidityProbeStatus"), ("EATON-EPDU-MIB", "humidityThLowerCritical"), ("EATON-EPDU-MIB", "humidityThLowerWarning"), ("EATON-EPDU-MIB", "humidityThStatus"), ("EATON-EPDU-MIB", "humidityThUpperCritical"), ("EATON-EPDU-MIB", "humidityThUpperWarning"), ("EATON-EPDU-MIB", "humidityValue"), ("EATON-EPDU-MIB", "inputCount"), ("EATON-EPDU-MIB", "inputCurrent"), ("EATON-EPDU-MIB", "inputCurrentCapacity"), ("EATON-EPDU-MIB", "inputCurrentCount"), ("EATON-EPDU-MIB", "inputCurrentCrestFactor"), ("EATON-EPDU-MIB", "inputCurrentIndex"), ("EATON-EPDU-MIB", "inputCurrentMeasType"), ("EATON-EPDU-MIB", "inputCurrentPercentLoad"), ("EATON-EPDU-MIB", "inputCurrentThLowerCritical"), ("EATON-EPDU-MIB", "inputCurrentThLowerWarning"), ("EATON-EPDU-MIB", "inputCurrentThStatus"), ("EATON-EPDU-MIB", "inputCurrentThUpperCritical"), ("EATON-EPDU-MIB", "inputCurrentThUpperWarning"), ("EATON-EPDU-MIB", "inputFrequency"), ("EATON-EPDU-MIB", "inputFrequencyStatus"), ("EATON-EPDU-MIB", "inputIndex"), ("EATON-EPDU-MIB", "inputPlugType"), ("EATON-EPDU-MIB", "inputPowerCount"), ("EATON-EPDU-MIB", "inputPowerFactor"), ("EATON-EPDU-MIB", "inputPowerMeasType"), ("EATON-EPDU-MIB", "inputType"), ("EATON-EPDU-MIB", "inputVA"), ("EATON-EPDU-MIB", "inputVAR"), ("EATON-EPDU-MIB", "inputVoltage"), ("EATON-EPDU-MIB", "inputVoltageCount"), ("EATON-EPDU-MIB", "inputVoltageIndex"), ("EATON-EPDU-MIB", "inputVoltageMeasType"), ("EATON-EPDU-MIB", "inputVoltageThLowerCritical"), ("EATON-EPDU-MIB", "inputVoltageThLowerWarning"), ("EATON-EPDU-MIB", "inputVoltageThStatus"), ("EATON-EPDU-MIB", "inputVoltageThUpperCritical"), ("EATON-EPDU-MIB", "inputVoltageThUpperWarning"), ("EATON-EPDU-MIB", "inputWatts"), ("EATON-EPDU-MIB", "inputWh"), ("EATON-EPDU-MIB", "inputWhTimer"), ("EATON-EPDU-MIB", "inputTotalVA"), ("EATON-EPDU-MIB", "inputTotalWatts"), ("EATON-EPDU-MIB", "inputTotalWh"), ("EATON-EPDU-MIB", "inputTotalWhTimer"), ("EATON-EPDU-MIB", "inputTotalPowerFactor"), ("EATON-EPDU-MIB", "inputTotalVAR"), ("EATON-EPDU-MIB", "internalStatus"), ("EATON-EPDU-MIB", "lcdControl"), ("EATON-EPDU-MIB", "outletControlSwitchable"), ("EATON-EPDU-MIB", "outletControlShutoffDelay"), ("EATON-EPDU-MIB", "outletControlOffCmd"), ("EATON-EPDU-MIB", "outletControlOnCmd"), ("EATON-EPDU-MIB", "outletControlPowerOnState"), ("EATON-EPDU-MIB", "outletControlRebootCmd"), ("EATON-EPDU-MIB", "outletControlRebootOffTime"), ("EATON-EPDU-MIB", "outletControlSequenceDelay"), ("EATON-EPDU-MIB", "outletControlStatus"), ("EATON-EPDU-MIB", "outletCount"), ("EATON-EPDU-MIB", "outletCurrent"), ("EATON-EPDU-MIB", "outletCurrentCapacity"), ("EATON-EPDU-MIB", "outletCurrentCrestFactor"), ("EATON-EPDU-MIB", "outletCurrentPercentLoad"), ("EATON-EPDU-MIB", "outletCurrentThLowerCritical"), ("EATON-EPDU-MIB", "outletCurrentThLowerWarning"), ("EATON-EPDU-MIB", "outletCurrentThStatus"), ("EATON-EPDU-MIB", "outletCurrentThUpperCritical"), ("EATON-EPDU-MIB", "outletCurrentThUpperWarning"), ("EATON-EPDU-MIB", "outletID"), ("EATON-EPDU-MIB", "outletIndex"), ("EATON-EPDU-MIB", "outletName"), ("EATON-EPDU-MIB", "outletParentCount"), ("EATON-EPDU-MIB", "outletParentOID"), ("EATON-EPDU-MIB", "outletParentType"), ("EATON-EPDU-MIB", "outletPowerFactor"), ("EATON-EPDU-MIB", "outletType"), ("EATON-EPDU-MIB", "outletVA"), ("EATON-EPDU-MIB", "outletVAR"), ("EATON-EPDU-MIB", "outletVoltage"), ("EATON-EPDU-MIB", "outletVoltageThLowerCritical"), ("EATON-EPDU-MIB", "outletVoltageThLowerWarning"), ("EATON-EPDU-MIB", "outletVoltageThStatus"), ("EATON-EPDU-MIB", "outletVoltageThUpperCritical"), ("EATON-EPDU-MIB", "outletVoltageThUpperWarning"), ("EATON-EPDU-MIB", "outletWatts"), ("EATON-EPDU-MIB", "outletWh"), ("EATON-EPDU-MIB", "outletWhTimer"), ("EATON-EPDU-MIB", "partNumber"), ("EATON-EPDU-MIB", "productName"), ("EATON-EPDU-MIB", "serialNumber"), ("EATON-EPDU-MIB", "strappingIndex"), ("EATON-EPDU-MIB", "strappingStatus"), ("EATON-EPDU-MIB", "temperatureCount"), ("EATON-EPDU-MIB", "temperatureIndex"), ("EATON-EPDU-MIB", "temperatureName"), ("EATON-EPDU-MIB", "temperatureProbeStatus"), ("EATON-EPDU-MIB", "temperatureScale"), ("EATON-EPDU-MIB", "unitType"), ("EATON-EPDU-MIB", "temperatureThLowerCritical"), ("EATON-EPDU-MIB", "temperatureThLowerWarning"), ("EATON-EPDU-MIB", "temperatureThStatus"), ("EATON-EPDU-MIB", "temperatureThUpperCritical"), ("EATON-EPDU-MIB", "temperatureThUpperWarning"), ("EATON-EPDU-MIB", "temperatureValue"), ("EATON-EPDU-MIB", "unitControlOffCmd"), ("EATON-EPDU-MIB", "unitControlOnCmd"), ("EATON-EPDU-MIB", "unitName"), ("EATON-EPDU-MIB", "unitsPresent"), ("EATON-EPDU-MIB", "userName")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): epduOptionalGroup = epduOptionalGroup.setStatus('current') epduNotifyGroup = NotificationGroup((1, 3, 6, 1, 4, 1, 534, 6, 6, 7, 25, 5, 3)).setObjects(("EATON-EPDU-MIB", "notifyBootUp"), ("EATON-EPDU-MIB", "notifyCommunicationStatus"), ("EATON-EPDU-MIB", "notifyContactState"), ("EATON-EPDU-MIB", "notifyFailedLogin"), ("EATON-EPDU-MIB", "notifyGroupCurrentThStatus"), ("EATON-EPDU-MIB", "notifyGroupVoltageThStatus"), ("EATON-EPDU-MIB", "notifyGroupBreakerStatus"), ("EATON-EPDU-MIB", "notifyHumidityThStatus"), ("EATON-EPDU-MIB", "notifyInputCurrentThStatus"), ("EATON-EPDU-MIB", "notifyInputFrequencyStatus"), ("EATON-EPDU-MIB", "notifyInputVoltageThStatus"), ("EATON-EPDU-MIB", "notifyInternalStatus"), ("EATON-EPDU-MIB", "notifyOutletControlStatus"), ("EATON-EPDU-MIB", "notifyOutletCurrentThStatus"), ("EATON-EPDU-MIB", "notifyOutletVoltageThStatus"), ("EATON-EPDU-MIB", "notifyProbeStatus"), ("EATON-EPDU-MIB", "notifyStrappingStatus"), ("EATON-EPDU-MIB", "notifyTemperatureThStatus"), ("EATON-EPDU-MIB", "notifyTest"), ("EATON-EPDU-MIB", "notifyUserLogin"), ("EATON-EPDU-MIB", "notifyUserLogout")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): epduNotifyGroup = epduNotifyGroup.setStatus('current') mibBuilder.exportSymbols("EATON-EPDU-MIB", outletCurrent=outletCurrent, notifyGroupVoltageThStatus=notifyGroupVoltageThStatus, inputTotalWhTimer=inputTotalWhTimer, partNumber=partNumber, outletID=outletID, inputVoltageEntry=inputVoltageEntry, outletControlOffCmd=outletControlOffCmd, humidityEntry=humidityEntry, notifyOutletCurrentThStatus=notifyOutletCurrentThStatus, humidityIndex=humidityIndex, humidityValue=humidityValue, inputCount=inputCount, conformance=conformance, outletCurrentTable=outletCurrentTable, commInterface=commInterface, temperatureValue=temperatureValue, inputVoltageThUpperWarning=inputVoltageThUpperWarning, strappingStatus=strappingStatus, groupVoltageThStatus=groupVoltageThStatus, inputVoltageThLowerCritical=inputVoltageThLowerCritical, notifyBootUp=notifyBootUp, groupChildCount=groupChildCount, inputCurrentThStatus=inputCurrentThStatus, groupChildTable=groupChildTable, notifyStrappingStatus=notifyStrappingStatus, inputCurrentMeasType=inputCurrentMeasType, contactEntry=contactEntry, groupCount=groupCount, inputCurrentCapacity=inputCurrentCapacity, inputType=inputType, notifyProbeStatus=notifyProbeStatus, humidityCount=humidityCount, outletControlOnCmd=outletControlOnCmd, contactState=contactState, notifyInternalStatus=notifyInternalStatus, inputTotalPowerTable=inputTotalPowerTable, groupEntry=groupEntry, lcdControl=lcdControl, inputVoltage=inputVoltage, outletCurrentThLowerWarning=outletCurrentThLowerWarning, inputCurrentThUpperWarning=inputCurrentThUpperWarning, unitsPresent=unitsPresent, temperatureTable=temperatureTable, epduNotifyGroup=epduNotifyGroup, inputTotalPowerEntry=inputTotalPowerEntry, notifyUserLogout=notifyUserLogout, outletVoltage=outletVoltage, inputCurrentEntry=inputCurrentEntry, inputTotalVAR=inputTotalVAR, unitType=unitType, notifyOutletVoltageThStatus=notifyOutletVoltageThStatus, groupCurrentThLowerCritical=groupCurrentThLowerCritical, outletVoltageThLowerCritical=outletVoltageThLowerCritical, outletCurrentEntry=outletCurrentEntry, groupVoltageThLowerCritical=groupVoltageThLowerCritical, humidityThLowerWarning=humidityThLowerWarning, groupControl0nCmd=groupControl0nCmd, inputCurrentThLowerWarning=inputCurrentThLowerWarning, inputTable=inputTable, strappingIndex=strappingIndex, userName=userName, outletCurrentThLowerCritical=outletCurrentThLowerCritical, temperatureThLowerWarning=temperatureThLowerWarning, objectGroups=objectGroups, inputPlugType=inputPlugType, inputVoltageMeasType=inputVoltageMeasType, inputCurrentIndex=inputCurrentIndex, groupPowerTable=groupPowerTable, outletVA=outletVA, groupCurrentThUpperWarning=groupCurrentThUpperWarning, groups=groups, inputCurrentThLowerCritical=inputCurrentThLowerCritical, outletVoltageTable=outletVoltageTable, inputVoltageCount=inputVoltageCount, outletEntry=outletEntry, outletControlSequenceDelay=outletControlSequenceDelay, humidityThUpperCritical=humidityThUpperCritical, inputCurrentCrestFactor=inputCurrentCrestFactor, temperatureName=temperatureName, outletIndex=outletIndex, unitControlEntry=unitControlEntry, notifyUserLogin=notifyUserLogin, outletParentEntry=outletParentEntry, outletTable=outletTable, inputFrequency=inputFrequency, unitControlOffCmd=unitControlOffCmd, outletVoltageThLowerWarning=outletVoltageThLowerWarning, notifyInputFrequencyStatus=notifyInputFrequencyStatus, outletControlRebootCmd=outletControlRebootCmd, inputTotalWatts=inputTotalWatts, unitTable=unitTable, clockValue=clockValue, groupControlEntry=groupControlEntry, groupCurrentCapacity=groupCurrentCapacity, outletControlRebootOffTime=outletControlRebootOffTime, temperatureThUpperCritical=temperatureThUpperCritical, groupCurrentEntry=groupCurrentEntry, groupCurrent=groupCurrent, notifyGroupCurrentThStatus=notifyGroupCurrentThStatus, outletPowerTable=outletPowerTable, outletParentIndex=outletParentIndex, contactCount=contactCount, outletControlShutoffDelay=outletControlShutoffDelay, inputTotalVA=inputTotalVA, groupType=groupType, outletControlPowerOnState=outletControlPowerOnState, outletParentTable=outletParentTable, humidityProbeStatus=humidityProbeStatus, groupCurrentTable=groupCurrentTable, groupName=groupName, temperatureProbeStatus=temperatureProbeStatus, eatonEpduCompliances=eatonEpduCompliances, outletControlTable=outletControlTable, outletParentType=outletParentType, inputVoltageThLowerWarning=inputVoltageThLowerWarning, PYSNMP_MODULE_ID=eatonEpdu, groupPowerEntry=groupPowerEntry, outletType=outletType, unitName=unitName, contactName=contactName, temperatureScale=temperatureScale, groupCurrentPercentLoad=groupCurrentPercentLoad, firmwareVersion=firmwareVersion, notifications=notifications, UnixTimeStamp=UnixTimeStamp, outletCount=outletCount, inputCurrentThUpperCritical=inputCurrentThUpperCritical, groupID=groupID, groupChildEntry=groupChildEntry, humidityThUpperWarning=humidityThUpperWarning, unitEntry=unitEntry, outletParentCount=outletParentCount, inputVAR=inputVAR, temperatureThLowerCritical=temperatureThLowerCritical, outlets=outlets, inputCurrentCount=inputCurrentCount, inputVA=inputVA, outletCurrentThUpperWarning=outletCurrentThUpperWarning, outletPowerFactor=outletPowerFactor, inputWh=inputWh, outletName=outletName, inputPowerIndex=inputPowerIndex, temperatureEntry=temperatureEntry, groupVoltageThUpperWarning=groupVoltageThUpperWarning, outletWhTimer=outletWhTimer, groupChildOID=groupChildOID, temperatureThUpperWarning=temperatureThUpperWarning, notifyGroupBreakerStatus=notifyGroupBreakerStatus, outletParentOID=outletParentOID, humidityName=humidityName, groupChildType=groupChildType, groupIndex=groupIndex, inputPowerTable=inputPowerTable, inputVoltageIndex=inputVoltageIndex, inputWatts=inputWatts, inputs=inputs, notifyContactState=notifyContactState, groupPowerFactor=groupPowerFactor, outletCurrentCrestFactor=outletCurrentCrestFactor, outletControlEntry=outletControlEntry, temperatureIndex=temperatureIndex, outletWh=outletWh, notifyOutletControlStatus=notifyOutletControlStatus, contactIndex=contactIndex, inputPowerCount=inputPowerCount, outletControlSwitchable=outletControlSwitchable, groupVoltageThLowerWarning=groupVoltageThLowerWarning, inputCurrentTable=inputCurrentTable, outletVAR=outletVAR, groupVA=groupVA, inputEntry=inputEntry, inputVoltageTable=inputVoltageTable, inputWhTimer=inputWhTimer, outletPowerEntry=outletPowerEntry, outletControlStatus=outletControlStatus, groupWatts=groupWatts, outletCurrentCapacity=outletCurrentCapacity, inputPowerFactor=inputPowerFactor, groupVoltageEntry=groupVoltageEntry, temperatureCount=temperatureCount, humidityThLowerCritical=humidityThLowerCritical, inputTotalPowerFactor=inputTotalPowerFactor, epduOptionalGroup=epduOptionalGroup, notifyHumidityThStatus=notifyHumidityThStatus, outletVoltageThUpperCritical=outletVoltageThUpperCritical, groupVAR=groupVAR, environmental=environmental, groupCurrentThUpperCritical=groupCurrentThUpperCritical, groupControlStatus=groupControlStatus, notifyTest=notifyTest, humidityTable=humidityTable, inputIndex=inputIndex, inputTotalWh=inputTotalWh, unitControlOnCmd=unitControlOnCmd, unitControlTable=unitControlTable, outletVoltageThStatus=outletVoltageThStatus, outletWatts=outletWatts, groupBreakerStatus=groupBreakerStatus, eatonEpdu=eatonEpdu, notifyFailedLogin=notifyFailedLogin, temperatureThStatus=temperatureThStatus, inputPowerEntry=inputPowerEntry, groupVoltageTable=groupVoltageTable, productName=productName, outletCurrentThUpperCritical=outletCurrentThUpperCritical, outletVoltageEntry=outletVoltageEntry, inputPowerMeasType=inputPowerMeasType, groupTable=groupTable, groupWhTimer=groupWhTimer, groupVoltage=groupVoltage, groupCurrentThLowerWarning=groupCurrentThLowerWarning, epduRequiredGroup=epduRequiredGroup, inputFrequencyStatus=inputFrequencyStatus, groupCurrentThStatus=groupCurrentThStatus, contactProbeStatus=contactProbeStatus, groupControlRebootCmd=groupControlRebootCmd, inputCurrentPercentLoad=inputCurrentPercentLoad, outletCurrentPercentLoad=outletCurrentPercentLoad, humidityThStatus=humidityThStatus, serialNumber=serialNumber, notifyInputVoltageThStatus=notifyInputVoltageThStatus, groupControlTable=groupControlTable, outletVoltageThUpperWarning=outletVoltageThUpperWarning, groupControlOffCmd=groupControlOffCmd, groupVoltageMeasType=groupVoltageMeasType, contactTable=contactTable, inputVoltageThStatus=inputVoltageThStatus, inputVoltageThUpperCritical=inputVoltageThUpperCritical, groupWh=groupWh, notifyTemperatureThStatus=notifyTemperatureThStatus, internalStatus=internalStatus, outletCurrentThStatus=outletCurrentThStatus, notifyCommunicationStatus=notifyCommunicationStatus, notifyInputCurrentThStatus=notifyInputCurrentThStatus, communicationStatus=communicationStatus, groupChildIndex=groupChildIndex, groupVoltageThUpperCritical=groupVoltageThUpperCritical, groupCurrentCrestFactor=groupCurrentCrestFactor, units=units, inputCurrent=inputCurrent)
# -*- coding: utf-8 -*- # URI Judge - Problema 1013 a, b, c = map(int, input().split()) if a > (b and c): print(str(a) + " eh o maior") elif b > c: print(str(b) + " eh o maior") else: print(str(c) + " eh o maior")
#reg add HKEY_CURRENT_USER\Console /v VirtualTerminalLevel /t REG_DWORD /d 0x00000001 /f colors = {\ 'OKBLUE' : '\033[94m', 'OKGREEN' : '\033[92m', 'WARNING' : '\033[93m', 'RED' : '\033[1;31;40m', } def colorText(text): for color in colors: text = text.replace("[[" + color + "]]", colors[color]) return text hola = ''' [[OKGREEN]] _ _ ____ _ _ ____ / )( ( _ \/ )( ( _ \ \ /\ /) /\ /\ /) / [[RED]]_/\_|__\_)(_/\_|__\_) ''' banner=''' [[RED]] ) ( /( ) )\()) ( ( ( /( ) ( ) ( ((_)\ )( )\ )\()) ( ( ( ( ( /( )( ( )\ ) _)((_)(()\((_)((_)\ )\ )\ )\ )\ )(_))(()\ )\ '(()/( [[OKGREEN]]| |/ / [[RED]]((_)[[OKGREEN]](_)[[RED]]| |(_)((_)((_) ((_)((_) ((_)_ ((_) _((_)) )(_)) [[OKGREEN]]| ' < | '_|| || / // _ \(_-</ _ \(_-< / _` || '_|| ' \()| || | [[OKGREEN]]|_|\_\ |_| |_||_\_\\\___//__/\___//__/ \__,_||_| |_|_|_| \_, | |__/ ''' xd = ''' [[WARNING]] ) ) [[WARNING]] ( /( ( ( ( /( ) ( ) ( [[WARNING]] )\()))( )\ )\()) ( ( ( ( ( /( )( ( )\ ) [[WARNING]]((_)\(()\((_)((_)\ )\ )\ )\ )\ )(_))(()\ )\ '(()/( [[OKGREEN]]| |[[WARNING]](_)((_)(_)[[OKGREEN]]| |[[WARNING]](_)((_)((_) ((_)((_) ((_)_ ((_) _((_)) )(_)) [[OKGREEN]]| / /| '_|| || / // _ \(_-</ _ \(_-< / _` || '_|| ' \[[WARNING]]()[[OKGREEN]]| || | [[OKGREEN]]|_\_\|_| |_||_\_\\___//__/\___/ /__/ \__,_||_| |_|_|_| \_, | |__/ [[OKBLUE]] ''' print(colorText(banner)) print(colorText(xd)) print(colorText(hola))
#function to check whether a number is in a given range. def test_range(n): if n in range(3,9): print( " %s is in the range"%str(n)) else : print("The number is outside the given range.") test_range(5)
# 短信验证码过期时间 SMS_CODE_EXPIRES = 300 # 发送信息短信的间隔 SMS_FLAG_EXPIRES = 60
ans = 0 for _ in range(5): a, b, c = sorted([int(x) for x in input().split()]) if a + b > c: ans += 1 print(ans)
def move_cars(current, final): if len(current) <= 1: return 0 if len(current) == 2 and current[0] == final[0]: return 0 moves = 0 for i, car in enumerate(current): if car == final[i]: if car == '_': # need to move car to this spot first moves += 1 else: moves += 1 # if there are two spots, only needs 1 move not 2 moves return moves - 1 if __name__ == '__main__': current = ['A', 'B', 'C', '_'] final = ['_', 'B', 'A', 'C'] print(move_cars(current, final)) # 2 current = ['A', 'B', '_'] final = ['B', 'A', '_'] print(move_cars(current, final)) # 2 current = ['A', '_', 'B', 'C'] final = ['B', '_', 'C', 'A'] print(move_cars(current, final)) # 3 current = ['A', '_'] final = ['_', 'A'] print(move_cars(current, final)) # 1 current = ['_', 'A'] final = ['_', 'A'] print(move_cars(current, final)) # 0
def get_letter_frequency(word): chars_dict = {} for letter in word: if letter in chars_dict: chars_dict[letter] += 1 else: chars_dict[letter] = 1 return chars_dict def number_of_deletions(a, b): count = 0 chars_of_a = get_letter_frequency(a) chars_of_b = get_letter_frequency(b) for k, v in chars_of_a.items(): if k not in chars_of_b: count += v else: count += abs(v - chars_of_b[k]) for k, v in chars_of_b.items(): if k not in chars_of_a: count += v return count a = input().strip() b = input().strip() print(number_of_deletions(a, b))
""" mcpython - a minecraft clone written in python licenced under the MIT-licence (https://github.com/mcpython4-coding/core) Contributors: uuk, xkcdjerry (inactive) Based on the game of fogleman (https://github.com/fogleman/Minecraft), licenced under the MIT-licence Original game "minecraft" by Mojang Studios (www.minecraft.net), licenced under the EULA (https://account.mojang.com/documents/minecraft_eula) Mod loader inspired by "Minecraft Forge" (https://github.com/MinecraftForge/MinecraftForge) and similar This project is not official by mojang and does not relate to it. """ class StackCollectingException(Exception): def __init__(self, text: str, base: Exception = None): self.text = str(text) self.traces = [] self.method_call_stack = [] self.base = base def add_trace(self, line): self.traces.append(str(line)) return self def add_method_invocation_step(self, method): self.method_call_stack.append(method) def format_exception(self): return self.text + "\n" + "\n".join(self.traces)
def repeat(chars: str, count: int) -> str: """Return a string of repeated characters. :param chars: The characters to repeat. :param count: The number of times to repeat. :return: The string of repeated characters. """ return chars * count def truncate(source, max_len: int, el: str = "...", align: str = "<") -> str: """Return a truncated string. :param source: The string to truncate. :param max_len: The total length of the string to be returned. :param el: The ellipsis characters to append to the end of the string if it exceeds max_len. :param align: The alignment for the string if it does not exceed max_len. :return: The truncated string. """ if type(source) is int: source = str(source) if source is not None and len(source) > 0: if len(source) < max_len: return source elif max_len < len(el) + 1: return "{s:{c}{a}{n}}".format(s=source[0], c=".", a=align, n=max_len) else: return source[:max_len - len(el)] + el if len(source) > max_len else source else: return "" def pad(source: str, pad_len: int, align: str) -> str: """Return a padded string. :param source: The string to be padded. :param pad_len: The total length of the string to be returned. :param align: The alignment for the string. :return: The padded string. """ return "{s:{a}{n}}".format(s=source, a=align, n=pad_len)
# -*- coding: utf-8 -*- # Created at 03/10/2020 __author__ = 'raniys' class HomeData: home_url = "https://www.python.org/" search_text = "pycon"
def get_db_uri(dbinfo): username = dbinfo.get('user') or "root" password = dbinfo.get('pwd') or "123456" host = dbinfo.get('host') or "localhost" port = dbinfo.get('port') or "3306" database = dbinfo.get('dbname') or "pythonixf" driver = dbinfo.get('driver') or "pymysql" dialect = dbinfo.get('dialect') or "mysql" return "{}+{}://{}:{}@{}:{}/{}".format(dialect,driver,username,password,host,port,database) class Config(): DEBUG = False TESTING = False SECRET_KEY = '110' SESSION_TYPE = 'redis' SQLALCHEMY_TRACK_MODIFICATIONS = False DEBUG_TB_INTERCEPT_REDIRECTS = False class DevelopConfig(Config): DEBUG = True DATABASE = { "user": "root", "pwd": "123456", "host": "127.0.0.1", "port": "3306", "dialect": "mysql", "driver": "pymysql", "dbname": "pythonixf", } SQLALCHEMY_DATABASE_URI = get_db_uri(DATABASE) class TestingConfig(Config): TESTING = True DATABASE = { "user": "root", "pwd": "123456", "host": "127.0.0.1", "port": "3306", "dialect": "mysql", "driver": "pymysql", "dbname": "pythonixf", } SQLALCHEMY_DATABASE_URI = get_db_uri(DATABASE) class ShowConfig(Config): DEBUG = True DATABASE = { "user": "root", "pwd": "123456", "host": "127.0.0.1", "port": "3306", "dialect": "mysql", "driver": "pymysql", "dbname": "pythonixf", } SQLALCHEMY_DATABASE_URI = get_db_uri(DATABASE) class ProductConfig(Config): DEBUG = True DATABASE = { "user": "root", "pwd": "123456", "host": "127.0.0.1", "port": "3306", "dialect": "mysql", "driver": "pymysql", "dbname": "pythonixf", } SQLALCHEMY_DATABASE_URI = get_db_uri(DATABASE) config = { "developConfig" : DevelopConfig, "testingConfig" : TestingConfig, "showConfig" : ShowConfig, "productConfig" : ProductConfig, "default" : DevelopConfig, }
expected_output = { "vrf": { "L3VPN-1538": { "index": {1: {"address_type": "Interface", "ip_address": "192.168.10.254"}} } } }
fib = {1: 1, 2: 1, 3: 2, 4: 3} print(fib.get(4, 0) + fib.get(7, 5)) ## get(4,0) is 3 because as you can see, 4:3, in the key 4, you can 3. ## Since there is not key 7, this will just equivalent to 5. ## 3 + 5 = 8 ## output is 8
contPares = 0 print('Numeros pares: ',end='') for i in range(1,51): if i % 2 == 0: print(i, end=' ')
# encoding: utf-8 # module SingleNameSpace.Some.Deep calls itself Deep # from SingleNameSpace, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null # by generatorXXX # no doc # no imports # no functions # classes class WeHaveClass(object): """ WeHaveClass() """ MyClass = None
__author__ = 'Meemaw' def isPalindrome(x, i): zacetek = 0 konec = len(x)-1 while zacetek <= konec: if x[zacetek] != x[konec]: return 0 zacetek+=1 konec-=1 return 1 vsota = 0 print("Please insert upper bound:") x = int(input()) for i in range(1,x+1): if isPalindrome(str(i),10) and isPalindrome(str(bin(i)[2:]),2): vsota+=i print("Sum of all numbers below " + str(x) + " which are palindromic in base 10 and 2 is:") print(vsota)
class NestedIterator: def __init__(self, nestedList): self.l = [] self.i = 0 def search(l): for e in l: if e.isInteger(): self.l.append(e.getInteger()) else: search(e.getList()) search(nestedList) def next(self) -> int: ret = self.l[self.i] self.i += 1 return ret def hasNext(self) -> bool: return self.i < len(self.l)
def _copy_libs_impl(ctx): # Get a list of the input files in_files = ctx.files.libs # Declare the output files out_files = [ctx.actions.declare_file(f.basename) for f in in_files] ctx.actions.run_shell( # Input files visible to the action. inputs = in_files, # Output files that must be created by the action. outputs = out_files, # A progress message to display during the build progress_message = "Copying libs for target %s" % ctx.attr.name, # Copy all the input files to the output directory command = "cp -a %s %s" % ( " ".join([f.path for f in in_files]), out_files[0].dirname, ), ) # Tell bazel to make these files available at runtime runfiles = ctx.runfiles( files = out_files, collect_default = True, ) return [DefaultInfo(runfiles = runfiles)] copy_libs = rule( implementation = _copy_libs_impl, attrs = { "libs": attr.label( mandatory = True, allow_files = True, doc = "A filegroup containing the libs to copy", ), }, doc = """ Copies all the files in a filegroup to the rule's directory and makes them available at runtime. """, )
#https://www.hackerrank.com/challenges/quicksort1 def partition(a, first, last): pivot = a[first] wall = last+1 for j in range(last, first,-1): if a[j] > pivot: wall -= 1 if j!=wall: a[j],a[wall] = a[wall], a[j] #saves time. in case lik [3,2,4,1] do its partition and see a[wall-1],a[first] = a[first], a[wall-1] return a n = int(input()) a = [int(x) for x in input().strip().split(' ')] partition(a,0,n-1) print(" ".join(map(str,a)))
# -*- coding: utf-8 -*- """ Advent of Code 2021 @author marc """ with open("input-day06", 'r') as f: # with open("input-day06-test", 'r') as f: lines = f.readlines() fish = lines[0][:-1].split(',') fish = [(int(i),1) for i in fish] def run(fish, nrEpochs): for i in range(nrEpochs): spawncount = sum(f[1] for f in fish if f[0] == 0) fish = [(f[0]-1, f[1]) if f[0]-1 >= 0 else (6,f[1]) for f in fish] if spawncount > 0: fish.append((8, spawncount)) # print(f"epoch {i}: length {len(fish)}") return sum(f[1] for f in fish) print(f"Task 1: Result is {run(fish, 80)}") print(f"Task 2: Result is {run(fish, 256)}")
prompt = input('Enter the file name: ') try: prompt = open(prompt) except: print('File cannot be opened:', prompt) exit() total = 0 count = 0 # reading through the file for line in prompt: if line.startswith("X-DSPAM-Confidence:"): # removes lines after and before a sentence line = line.strip() pos = line.index(":") f_num = float(line[pos + 1:]) count += 1 total = total + f_num average = total/count print(f'Average Spam Confidence {average}')
""" A simple bencoding implementation in pure Python. Consult help(encode) and help(decode) for more info. >>> encode(42) == b'i42e' True >>> decode(b'i42e') 42 """ class Bencached(): __slots__ = ['bencoded'] def __init__(self, s): self.bencoded = s def encode_bencached(x, r): r.append(x.bencoded) def encode_int(x, r): r.append(f"i{x}e".encode()) def encode_bool(x, r): if x: encode_int(1, r) else: encode_int(0, r) def encode_string(x, r): if isinstance(x, str): x = x.encode() r.extend((str(len(x)).encode(), b':', x)) def encode_list(x, r): r.append(b'l') for i in x: encode_func[type(i)](i, r) r.append(b'e') def encode_dict(x, r): r.append(b'd') for k, v in sorted(x.items()): if isinstance(k, str): k = k.encode() r.extend((str(len(k)).encode(), b':', k)) encode_func[type(v)](v, r) r.append(b'e') encode_func = { Bencached: encode_bencached, int: encode_int, str: encode_string, bytes: encode_string, list: encode_list, tuple: encode_list, dict: encode_dict, bool: encode_bool } def decode_int(x, ptr): ptr += 1 end = x.index(b'e', ptr) if x[ptr] == b'-'[0]: if x[ptr + 1] == b'0'[0]: raise ValueError elif x[ptr] == b'0'[0] and end != ptr + 1: raise ValueError n = int(x[ptr:end]) return n, end + 1 def decode_string(x, ptr): colon = x.index(b':', ptr) n = int(x[ptr:colon]) if x[ptr] == b'0'[0] and colon != ptr + 1: raise ValueError colon += 1 return x[colon:colon + n], colon + n def decode_list(x, ptr): r, ptr = [], ptr + 1 while x[ptr] != b'e'[0]: v, ptr = decode_func[x[ptr]](x, ptr) r.append(v) return r, ptr + 1 def decode_dict(x, ptr): r, ptr = {}, ptr + 1 while x[ptr] != b'e'[0]: k, ptr = decode_string(x, ptr) if isinstance(k, bytes): k = k.decode() r[k], ptr = decode_func[x[ptr]](x, ptr) return r, ptr + 1 decode_func = {b'l'[0]: decode_list, b'd'[0]: decode_dict, b'i'[0]: decode_int} for i in range(10): decode_func[f"{i}".encode()[0]] = decode_string def encode(obj): """ bencodes given object. Given object should be a int, bytes, list or dict. If a str is given, it'll be encoded as ASCII. >>> [encode(i) for i in (-2, 42, b"answer", b"")] \ == [b'i-2e', b'i42e', b'6:answer', b'0:'] True >>> encode([b'a', 42, [13, 14]]) == b'l1:ai42eli13ei14eee' True >>> encode({'bar': b'spam', 'foo': 42, 'mess': [1, b'c']}) \ == b'd3:bar4:spam3:fooi42e4:messli1e1:cee' True """ r = [] try: encode_func[type(obj)](obj, r) except KeyError: raise ValueError( "Allowed types: int, bytes, list, dict; not %s", type(obj)) r = b''.join(r) return r def decode(s): """ Decodes given bencoded bytes object. >>> decode(b'i-42e') -42 >>> decode(b'4:utku') == b'utku' True >>> decode(b'li1eli2eli3eeee') [1, [2, [3]]] >>> decode(b'd3:bar4:spam3:fooi42ee') == {'bar': b'spam', 'foo': 42} True """ if isinstance(s, str): s = s.encode() try: r, l = decode_func[s[0]](s, 0) except (IndexError, KeyError, ValueError): raise ValueError("not a valid bencoded string") if l != len(s): raise ValueError("invalid bencoded value (data after valid prefix)") return r __all__ = ['decode', 'encode']
SOLUTIONS = { "LC": [ [0, 0, 1, 0, 0], [0, 0, 1, 0, 0], [0, 0, 0, 1, 1], [0, 0, 0, 0, 0], [0, 0, 0, 0, 0], ], "WASTE": [ [0, 0, 0, 1, 0, 0, 0, 1, 0], [0, 0, 0, 0, 1, 0, 0, 0, 0], [0, 0, 0, 0, 0, 1, 0, 1, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 1, 0], [0, 0, 0, 0, 0, 0, 0, 0, 1], [0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 1, 0, 1], [0, 0, 0, 0, 0, 0, 0, 0, 0], ], }
number = [1,3,6,2,7,5,8,9,0] result = filter(lambda x:x>5,number) print("Number List",number) print("Number Smaller than 5 in the list are:",list(result))
# # PySNMP MIB module NETGEAR-REF-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/NETGEAR-REF-MIB # Produced by pysmi-0.3.4 at Wed May 1 14:19:33 2019 # On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4 # Using Python version 3.7.3 (default, Mar 27 2019, 09:23:15) # Integer, OctetString, ObjectIdentifier = mibBuilder.importSymbols("ASN1", "Integer", "OctetString", "ObjectIdentifier") NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues") SingleValueConstraint, ValueRangeConstraint, ConstraintsUnion, ConstraintsIntersection, ValueSizeConstraint = mibBuilder.importSymbols("ASN1-REFINEMENT", "SingleValueConstraint", "ValueRangeConstraint", "ConstraintsUnion", "ConstraintsIntersection", "ValueSizeConstraint") ModuleCompliance, NotificationGroup = mibBuilder.importSymbols("SNMPv2-CONF", "ModuleCompliance", "NotificationGroup") MibScalar, MibTable, MibTableRow, MibTableColumn, ModuleIdentity, Bits, iso, MibIdentifier, IpAddress, Integer32, Counter32, Unsigned32, Gauge32, ObjectIdentity, Counter64, TimeTicks, enterprises, NotificationType = mibBuilder.importSymbols("SNMPv2-SMI", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "ModuleIdentity", "Bits", "iso", "MibIdentifier", "IpAddress", "Integer32", "Counter32", "Unsigned32", "Gauge32", "ObjectIdentity", "Counter64", "TimeTicks", "enterprises", "NotificationType") DisplayString, TextualConvention = mibBuilder.importSymbols("SNMPv2-TC", "DisplayString", "TextualConvention") netgear = ModuleIdentity((1, 3, 6, 1, 4, 1, 4526)) netgear.setRevisions(('2005-02-23 12:00',)) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): if mibBuilder.loadTexts: netgear.setRevisionsDescriptions(('Initial revision.',)) if mibBuilder.loadTexts: netgear.setLastUpdated('200502231200Z') if mibBuilder.loadTexts: netgear.setOrganization('Netgear') if mibBuilder.loadTexts: netgear.setContactInfo('') if mibBuilder.loadTexts: netgear.setDescription('') managedSwitch = MibIdentifier((1, 3, 6, 1, 4, 1, 4526, 1)) fsm726s = MibIdentifier((1, 3, 6, 1, 4, 1, 4526, 1, 1)) fsm750s = MibIdentifier((1, 3, 6, 1, 4, 1, 4526, 1, 2)) gsm712 = MibIdentifier((1, 3, 6, 1, 4, 1, 4526, 1, 3)) fsm726 = MibIdentifier((1, 3, 6, 1, 4, 1, 4526, 1, 4)) gsm712f = MibIdentifier((1, 3, 6, 1, 4, 1, 4526, 1, 5)) fsm726v3 = MibIdentifier((1, 3, 6, 1, 4, 1, 4526, 1, 10)) gsm7312 = MibIdentifier((1, 3, 6, 1, 4, 1, 4526, 1, 6)) gsm7324 = MibIdentifier((1, 3, 6, 1, 4, 1, 4526, 1, 7)) gsm7224 = MibIdentifier((1, 3, 6, 1, 4, 1, 4526, 1, 8)) fsm7326p = MibIdentifier((1, 3, 6, 1, 4, 1, 4526, 1, 9)) ng7000Switch = MibIdentifier((1, 3, 6, 1, 4, 1, 4526, 10)) ng700Switch = MibIdentifier((1, 3, 6, 1, 4, 1, 4526, 11)) ngrouter = MibIdentifier((1, 3, 6, 1, 4, 1, 4526, 12)) ngfirewall = MibIdentifier((1, 3, 6, 1, 4, 1, 4526, 13)) ngap = MibIdentifier((1, 3, 6, 1, 4, 1, 4526, 14)) ngwlan = MibIdentifier((1, 3, 6, 1, 4, 1, 4526, 15)) ng9000chassisswitch = MibIdentifier((1, 3, 6, 1, 4, 1, 4526, 16)) productID = MibIdentifier((1, 3, 6, 1, 4, 1, 4526, 100)) stackswitch = MibIdentifier((1, 3, 6, 1, 4, 1, 4526, 100, 1)) l2switch = MibIdentifier((1, 3, 6, 1, 4, 1, 4526, 100, 2)) l3switch = MibIdentifier((1, 3, 6, 1, 4, 1, 4526, 100, 3)) smartswitch = MibIdentifier((1, 3, 6, 1, 4, 1, 4526, 100, 4)) router = MibIdentifier((1, 3, 6, 1, 4, 1, 4526, 100, 5)) firewall = MibIdentifier((1, 3, 6, 1, 4, 1, 4526, 100, 6)) accesspoint = MibIdentifier((1, 3, 6, 1, 4, 1, 4526, 100, 7)) wirelessLAN = MibIdentifier((1, 3, 6, 1, 4, 1, 4526, 100, 8)) chassisswitch = MibIdentifier((1, 3, 6, 1, 4, 1, 4526, 100, 9)) fsm7328s = MibIdentifier((1, 3, 6, 1, 4, 1, 4526, 100, 1, 1)) fsm7352s = MibIdentifier((1, 3, 6, 1, 4, 1, 4526, 100, 1, 2)) gsm7328s = MibIdentifier((1, 3, 6, 1, 4, 1, 4526, 100, 1, 3)) gsm7352s = MibIdentifier((1, 3, 6, 1, 4, 1, 4526, 100, 1, 4)) fsm7352sp = MibIdentifier((1, 3, 6, 1, 4, 1, 4526, 100, 1, 5)) fsm7328sp = MibIdentifier((1, 3, 6, 1, 4, 1, 4526, 100, 1, 6)) gsm7312v2 = MibIdentifier((1, 3, 6, 1, 4, 1, 4526, 100, 3, 1)) gsm7324v2 = MibIdentifier((1, 3, 6, 1, 4, 1, 4526, 100, 3, 2)) xsm7312 = MibIdentifier((1, 3, 6, 1, 4, 1, 4526, 100, 3, 3)) gsm7324p = MibIdentifier((1, 3, 6, 1, 4, 1, 4526, 100, 3, 4)) gsm7248 = MibIdentifier((1, 3, 6, 1, 4, 1, 4526, 100, 2, 1)) gsm7212 = MibIdentifier((1, 3, 6, 1, 4, 1, 4526, 100, 2, 2)) gcm9600 = MibIdentifier((1, 3, 6, 1, 4, 1, 4526, 100, 9, 1)) gs748t = MibIdentifier((1, 3, 6, 1, 4, 1, 4526, 100, 4, 1)) fs726t = MibIdentifier((1, 3, 6, 1, 4, 1, 4526, 100, 4, 2)) gs716t = MibIdentifier((1, 3, 6, 1, 4, 1, 4526, 100, 4, 3)) fs750t = MibIdentifier((1, 3, 6, 1, 4, 1, 4526, 100, 4, 4)) gs724t = MibIdentifier((1, 3, 6, 1, 4, 1, 4526, 100, 4, 5)) fvx538 = MibIdentifier((1, 3, 6, 1, 4, 1, 4526, 100, 5, 1)) fvs338 = MibIdentifier((1, 3, 6, 1, 4, 1, 4526, 100, 5, 2)) fwag114 = MibIdentifier((1, 3, 6, 1, 4, 1, 4526, 100, 6, 3)) wag302 = MibIdentifier((1, 3, 6, 1, 4, 1, 4526, 100, 7, 1)) wapc538 = MibIdentifier((1, 3, 6, 1, 4, 1, 4526, 100, 8, 1)) class AgentPortMask(TextualConvention, OctetString): description = "Each octet within this value specifies a set of eight ports, with the first octet specifying ports 1 through 8, the second octet specifying ports 9 through 16, etc. Within each octet, the most significant bit represents the lowest numbered port, and the least significant bit represents the highest numbered port. Thus, each port of the bridge is represented by a single bit within the value of this object. If that bit has a value of '1' then that port is included in the set of ports; the port is not included if its bit has a value of '0' When setting this value, the system will ignore configuration for ports not between the first and last valid ports. Configuration of any port numbers between this range that are not valid ports return a failure message, but will still apply configuration for valid ports." status = 'current' mibBuilder.exportSymbols("NETGEAR-REF-MIB", gsm7224=gsm7224, fsm7326p=fsm7326p, router=router, wapc538=wapc538, fsm726=fsm726, smartswitch=smartswitch, chassisswitch=chassisswitch, gs724t=gs724t, fsm750s=fsm750s, gsm712=gsm712, gsm7352s=gsm7352s, gcm9600=gcm9600, productID=productID, xsm7312=xsm7312, fsm7352s=fsm7352s, stackswitch=stackswitch, l2switch=l2switch, ngwlan=ngwlan, ng9000chassisswitch=ng9000chassisswitch, fwag114=fwag114, accesspoint=accesspoint, fsm7328s=fsm7328s, gsm7248=gsm7248, gsm7312=gsm7312, fs750t=fs750t, gsm7324=gsm7324, gsm7312v2=gsm7312v2, firewall=firewall, fsm726s=fsm726s, wirelessLAN=wirelessLAN, netgear=netgear, fsm726v3=fsm726v3, ngap=ngap, gsm7328s=gsm7328s, ng700Switch=ng700Switch, fsm7352sp=fsm7352sp, fvs338=fvs338, l3switch=l3switch, managedSwitch=managedSwitch, gs716t=gs716t, AgentPortMask=AgentPortMask, ngfirewall=ngfirewall, gsm7212=gsm7212, gsm7324v2=gsm7324v2, fs726t=fs726t, fvx538=fvx538, fsm7328sp=fsm7328sp, wag302=wag302, gsm712f=gsm712f, ng7000Switch=ng7000Switch, PYSNMP_MODULE_ID=netgear, ngrouter=ngrouter, gs748t=gs748t, gsm7324p=gsm7324p)
""" Low-level methods for handling a MiCADO master with Occopus """ class OccopusLauncher: """For launching a MiCADO Master with Occopus """
my_host = 'localhost' my_port = 10000 is_emulation = False emulator_host = '0.0.0.0' emulator_port = 4390 apis_web_host = '0.0.0.0' apis_web_budo_emulator_port = 43830 apis_web_api_server_port = 9999 #apis_log_group_address = 'FF02:0:0:0:0:0:0:1' apis_log_group_address = '224.2.2.4' apis_log_port = 8888 units = [ { 'id' : 'E001', 'name' : 'E001', 'host' : '0.0.0.0', 'dcdc_port' : 4380, 'emu_port' : 8080, }, { 'id' : 'E002', 'name' : 'E002', 'host' : '0.0.0.0', 'dcdc_port' : 4380, 'emu_port' : 8080, }, { 'id' : 'E003', 'name' : 'E003', 'host' : '0.0.0.0', 'dcdc_port' : 4380, 'emu_port' : 8080, }, { 'id' : 'E004', 'name' : 'E004', 'host' : '0.0.0.0', 'dcdc_port' : 4380, 'emu_port' : 8080, }, ] default_control_dcdc_command = 'MODE' default_control_dcdc_mode = 'WAIT' default_grid_voltage_v = 350 default_grid_current_a = 2.3 default_droop_ratio = 0 default_deal_grid_current_a = 2 default_deal_amount_wh = 100 default_point_per_wh = 10 default_efficient_grid_voltage_v = 330 default_error_level = 'ERROR' default_error_extent = 'LOCAL' default_error_category = 'HARDWARE' default_wait_log_timeout_s = 30 default_wait_duration_s = 5 default_apis_global_operation_mode = 'Run' default_apis_local_operation_mode = None
def primes(): i, f = 2, 1 while True: if (f + 1) % i == 0: yield i f, i = f * i, i + 1
mypass = input() if ("1234" or "qwerty" in mypass) or (len(mypass) < 8): print("Bad password") elif ("1" or "2" or "3" or "4" or "5" or "6" or "7" or "8" or "9" or "0") not in mypass: print("Bad password") else: print("Good password")
n, m = map(int, input().split()) matches = [] for i in range(m): matches.append(list(map(int, input().split()))) matches.sort(key=lambda container: container[1], reverse=True) count = 0 i = 0 j = 0 while i <= n and j < m: if matches[j][0] < n - i: i += matches[j][0] count += matches[j][0] * matches[j][1] else: count += (n - i) * matches[j][1] i = n j += 1 print(count)
def test(): assert len(doc1.ents) == 2, "Attendu deux entités dans le premier exemple" assert ( doc1.ents[0].label_ == "SITE_WEB" and doc1.ents[0].text == "Reddit" ), "Vérifie l'entité une dans le premier exemple" assert ( doc1.ents[1].label_ == "SITE_WEB" and doc1.ents[1].text == "Patreon" ), "Vérifie l'entité deux dans le premier exemple" assert len(doc2.ents) == 1, "Attendu une entité dans dans le deuxième exemple" assert ( doc2.ents[0].label_ == "SITE_WEB" and doc2.ents[0].text == "YouTube" ), "Vérifie l'entité dans le deuxième exemple" assert len(doc3.ents) == 1, "Attendu une entité dans dans le troisième exemple" assert ( doc3.ents[0].label_ == "SITE_WEB" and doc3.ents[0].text == "Reddit" ), "Vérifie l'entité dans le troisième exemple" __msg__.good("Joli boulot !")
# 'guinea pig' is appended to the animals list animals.append('guinea pig') # Updated animals list print('Updated animals list: ', animals)