content stringlengths 7 1.05M | fixed_cases stringlengths 1 1.28M |
|---|---|
def urandom(n):
# """urandom(n) -> str
# Return a string of n random bytes suitable for cryptographic use.
# """
#try:
# _urandomfd = open("/dev/urandom", O_RDONLY)
#except (OSError, IOError):
# raise NotImplementedError("/dev/urandom (or equivalent) not found")
#try:
# bs = b""
# while n - len(bs) >= 1:
# bs += read(_urandomfd, n - len(bs))
#finally:
# close(_urandomfd)
raise NotImplementedError("/dev/urandom (or equivalent) not found")
return bs
| def urandom(n):
raise not_implemented_error('/dev/urandom (or equivalent) not found')
return bs |
#!/usr/bin/env python
"""List of hedge funds/institution names **for educational purposes only. MIT License"""
__author__ = "Aneesh Panoli"
__copyright__ = "MIT License"
def institutions():
keywords = ["Natixis", "TIAA", "Deutsche", "Invesco", "Franklin", "Rowe", "AXA", "Legg", "Sumitomo"\
, "UBS", "Affiliated", "Mitsubishi", "Insight", "BNP", "New", "Allianz", "Columbia", "AllianceBernstein"\
, "Schroder", "APG", "Generali", "Aberdeen", "Aviva", "HSBC", "MFS", "Morgan"\
, "Dimensional", "Principal", "Aegon", "Standard", "M&G", "Federated", "Mellon"\
, "Wells", "Natixis", "Macquarie", "Nomura", "Credit", "Eaton", "Manulife", "Robeco"\
, "Eurizon", "Union", "RBC", "MEAG", "Fidelity", "SEI", "Dodge", "Pioneer"\
, "Neuberger", "DekaBank", "BNY", "Babson", "BMO", "Loomis", "Voya", "Nordea", "NN"\
, "SEB", "Guggenheim", "PGGM", "Nuveen", "Swiss", "Baillie", "TCW", "Caisse"\
, "Janus", "Santander", "Lazard", "Russell", "La Banque", "Nikko", "Standish"\
, "Pictet", "Putnam", "Bridgewater", "Bank", "DIAM", "AQR", "First", "American"\
, "Itau", "Talanx", "Eastspring", "Swedbank", "Helaba", "MN", "Lyxor", "Lord,"\
, "Royal", "Zurcher", "Harris", "Henderson", "GAM", "Kohlberg", "Danske", "AMP"\
, "Achmea", "GE", "Union", "BBVA", "KBC", "Artisan", "Sumitomo", "Investec"\
, "SURA", "Hartford", "Candriam", "GMO", "Harvest", "Groupama", "Bram", "Covea"\
, "Oaktree", "BMO", "CIBC", "Vontobel", "Payden", "Ares", "First", "MacKay"\
, "CBRE", "Barrow", "Conning", "Hines", "PineBridge", "LSV", "Kames", "CI"\
, "Man", "Mirae", "Mediolanum", "OP", "Anima", "BayernInvest", "OFI", "Metzler"\
, "Newton", "Mesirow", "Acadian", "CM", "Storebrand", "LBBW", "DNB", "Erste"\
, "Arrowstreet", "Handelsbanken", "Prologis", "Walter", "BBH", "LaSalle", "William"\
, "Edmond", "La", "BlueBay", "Irish", "QIC", "Mondrian", "Actiam", "Carmignac"\
, "Delta", "Warburg", "M", "Rothschild", "Thornburg", "Degroof", "LGT", "Record"\
, "Marathon", "Jupiter", "Cohen", "Sal", "Brown", "Daiwa", "Hauck", "Partners"\
, "Oddo", "Caixabank", "Cornerstone", "GCM", "Ashmore", "Tokio", "Lombard"\
, "CVC", "KLP", "Joh", "Coronation", "THEAM", "Fischer", "Epoch", "CPR", "Stone"\
, "HarbourVest", "Quilvest", "Schroder", "Columbia", "Principal", "Manulife"\
, "APG", "Robeco", "Barings", "Dekabank", "Nordea", "Loomis", "Baillie", "Lazard"\
, "Russell", "Bram", "China", "Nikko", "Bridgewater", "Pictet", "Standish"\
, "Zurcher", "John", "Talanx", "Helaba", "Eastspring", "Lyxor", "Henderson"\
, "ClearBridge", "IGM", "Harvest", "Harris", "Conning", "Candriam", "KBC", "Payden"\
, "Danske", "CIBC", "Groupama", "Sumitomo", "Vontobel", "Hartford", "Covea"\
, "LSV", "Hines", "Ares", "New", "MacKay", "Galliard", "Mirae", "CI", "Boston"\
, "Fiera", "CBRE", "Man", "Metzler", "Anima", "BayernInvest", "Acadian", "Mediolanum"\
, "Arrowstreet", "OFI", "KLP", "Irish", "Mesirow", "CM", "Storebrand", "Prologis"\
, "LBBW", "Newton", "Brandywine", "William", "Hauck", "La Francaise", "Kames"\
, "Delta", "Carmignac", "DNB", "Erste", "Edmond", "Handelsbanken", "Mondrian"\
, "Walter", "LaSalle", "Actiam", "QIC", "Cohen", "Partners", "M", "Rothschild"\
, "Record", "Colony", "Pavilion", "LGT", "BBH", "Victory", "Degroof", "Tokio"\
, "CapitaLand", "Brown", "Marathon", "Caixabank", "ASR", "Ashmore", "Sal", "Kempen"\
, "BlueBay", "Jupiter", "Daiwa", "Thornburg", "GCM", "W", "Starwood", "HarbourVest"\
, "Oddo", "Pathway", "Lombard", "Clarion", "Old", "Joh", "PanAgora", "Epoch"\
, "Northill", "CPR", "Coronation", "Tishman", "Hamilton", "THEAM", "The", "Quilvest"\
, "Harding", "Heitman", "Stone", "Fischer", "Logan", "Hermes", "Fisher", "Colchester"\
, "CVC", "Pantheon", "Shinhan", "Eagle", "GW", "Arca", "Raiffeisen", "Bentall", "J"\
, "Artemis", "Gothaer", "Alcentra", "HFT", "Winton", "Adams", "Universal"\
, "Mirabaud", "VidaCaixa", "Muzinich", "Brandes", "Quoniam", "AEW", "Seix", "Davis"\
, "Beutel", "AGF", "Genesis", "Axeltis", "Capital", "TKP", "Managed", "Intermediate"\
, "Comgest", "First", "KGAL", "AEW", "Nykredit", "Kutxabank", "BlueMountain"\
, "SPF", "Banco", "DNCA", "Unigestion", "EnTrust", "Assenagon", "Patrizia"\
, "Southeastern", "BankInvest", "Calamos", "Lendlease", "Calamos", "Westwood"\
, "Jyske", "Tweedy", "Savills", "Royce", "QS", "ValueAct", "Frankfurt", "Allianz"\
, "Syz", "Majedie", "Yacktman", "TimesSquare", "Landmark", "PAG", "Veritas"\
, "Brookfield", "Kepler", "Seeyond", "Scor", "Siemens", "Semper", "Highland"\
, "Martin", "EIG", "CamGestion", "The", "Millennium", "Bankia", "Millennium", "GNB"\
, "C", "Theodoor", "Sydbank", "Frontier", "Patron", "Alfred", "CQS", "H2O"\
, "Veritable", "Siguler", "DJE", "Gateway", "HQ", "McDonnell", "BPI", "Evli"\
, "Vaughan", "EFG", "Sparinvest", "T", "Aktia", "Glenview", "RWC", "Systematica"\
, "LocalTapiola", "Capital", "DTZ", "Chicago", "Baring", "Pacific", "TwentyFour"\
, "Pyrford", "KBI", "Skagen", "Fisch", "Arion", "Bantleon", "Maj", "Lupus", "Setanta"\
, "Maple", "Adrian", "Trilogy", "Bouwinvest", "Edinburgh", "Sparx", "CenterSquare"\
, "Hayfin", "Kairos", "Foyston", "Ecofi", "IDFC", "Tristan", "Caser", "Rockspring"\
, "Renta", "Orchard", "Driehaus", "Access", "La", "TOBAM", "Jacobs", "Investa"\
, "DDJ", "Liontrust", "River", "Cromwell", "Abbott", "Adveq", "Bankia", "Sentinel"\
, "Sberbank", "Sentinel", "Mirova", "March", "myCIO", "IPM", "Ibercaja", "AlphaSimplex"\
, "Perennial", "Impax", "LumX", "texas", "california"]
uniqueKw = list(set(keywords))
return uniqueKw
| """List of hedge funds/institution names **for educational purposes only. MIT License"""
__author__ = 'Aneesh Panoli'
__copyright__ = 'MIT License'
def institutions():
keywords = ['Natixis', 'TIAA', 'Deutsche', 'Invesco', 'Franklin', 'Rowe', 'AXA', 'Legg', 'Sumitomo', 'UBS', 'Affiliated', 'Mitsubishi', 'Insight', 'BNP', 'New', 'Allianz', 'Columbia', 'AllianceBernstein', 'Schroder', 'APG', 'Generali', 'Aberdeen', 'Aviva', 'HSBC', 'MFS', 'Morgan', 'Dimensional', 'Principal', 'Aegon', 'Standard', 'M&G', 'Federated', 'Mellon', 'Wells', 'Natixis', 'Macquarie', 'Nomura', 'Credit', 'Eaton', 'Manulife', 'Robeco', 'Eurizon', 'Union', 'RBC', 'MEAG', 'Fidelity', 'SEI', 'Dodge', 'Pioneer', 'Neuberger', 'DekaBank', 'BNY', 'Babson', 'BMO', 'Loomis', 'Voya', 'Nordea', 'NN', 'SEB', 'Guggenheim', 'PGGM', 'Nuveen', 'Swiss', 'Baillie', 'TCW', 'Caisse', 'Janus', 'Santander', 'Lazard', 'Russell', 'La Banque', 'Nikko', 'Standish', 'Pictet', 'Putnam', 'Bridgewater', 'Bank', 'DIAM', 'AQR', 'First', 'American', 'Itau', 'Talanx', 'Eastspring', 'Swedbank', 'Helaba', 'MN', 'Lyxor', 'Lord,', 'Royal', 'Zurcher', 'Harris', 'Henderson', 'GAM', 'Kohlberg', 'Danske', 'AMP', 'Achmea', 'GE', 'Union', 'BBVA', 'KBC', 'Artisan', 'Sumitomo', 'Investec', 'SURA', 'Hartford', 'Candriam', 'GMO', 'Harvest', 'Groupama', 'Bram', 'Covea', 'Oaktree', 'BMO', 'CIBC', 'Vontobel', 'Payden', 'Ares', 'First', 'MacKay', 'CBRE', 'Barrow', 'Conning', 'Hines', 'PineBridge', 'LSV', 'Kames', 'CI', 'Man', 'Mirae', 'Mediolanum', 'OP', 'Anima', 'BayernInvest', 'OFI', 'Metzler', 'Newton', 'Mesirow', 'Acadian', 'CM', 'Storebrand', 'LBBW', 'DNB', 'Erste', 'Arrowstreet', 'Handelsbanken', 'Prologis', 'Walter', 'BBH', 'LaSalle', 'William', 'Edmond', 'La', 'BlueBay', 'Irish', 'QIC', 'Mondrian', 'Actiam', 'Carmignac', 'Delta', 'Warburg', 'M', 'Rothschild', 'Thornburg', 'Degroof', 'LGT', 'Record', 'Marathon', 'Jupiter', 'Cohen', 'Sal', 'Brown', 'Daiwa', 'Hauck', 'Partners', 'Oddo', 'Caixabank', 'Cornerstone', 'GCM', 'Ashmore', 'Tokio', 'Lombard', 'CVC', 'KLP', 'Joh', 'Coronation', 'THEAM', 'Fischer', 'Epoch', 'CPR', 'Stone', 'HarbourVest', 'Quilvest', 'Schroder', 'Columbia', 'Principal', 'Manulife', 'APG', 'Robeco', 'Barings', 'Dekabank', 'Nordea', 'Loomis', 'Baillie', 'Lazard', 'Russell', 'Bram', 'China', 'Nikko', 'Bridgewater', 'Pictet', 'Standish', 'Zurcher', 'John', 'Talanx', 'Helaba', 'Eastspring', 'Lyxor', 'Henderson', 'ClearBridge', 'IGM', 'Harvest', 'Harris', 'Conning', 'Candriam', 'KBC', 'Payden', 'Danske', 'CIBC', 'Groupama', 'Sumitomo', 'Vontobel', 'Hartford', 'Covea', 'LSV', 'Hines', 'Ares', 'New', 'MacKay', 'Galliard', 'Mirae', 'CI', 'Boston', 'Fiera', 'CBRE', 'Man', 'Metzler', 'Anima', 'BayernInvest', 'Acadian', 'Mediolanum', 'Arrowstreet', 'OFI', 'KLP', 'Irish', 'Mesirow', 'CM', 'Storebrand', 'Prologis', 'LBBW', 'Newton', 'Brandywine', 'William', 'Hauck', 'La Francaise', 'Kames', 'Delta', 'Carmignac', 'DNB', 'Erste', 'Edmond', 'Handelsbanken', 'Mondrian', 'Walter', 'LaSalle', 'Actiam', 'QIC', 'Cohen', 'Partners', 'M', 'Rothschild', 'Record', 'Colony', 'Pavilion', 'LGT', 'BBH', 'Victory', 'Degroof', 'Tokio', 'CapitaLand', 'Brown', 'Marathon', 'Caixabank', 'ASR', 'Ashmore', 'Sal', 'Kempen', 'BlueBay', 'Jupiter', 'Daiwa', 'Thornburg', 'GCM', 'W', 'Starwood', 'HarbourVest', 'Oddo', 'Pathway', 'Lombard', 'Clarion', 'Old', 'Joh', 'PanAgora', 'Epoch', 'Northill', 'CPR', 'Coronation', 'Tishman', 'Hamilton', 'THEAM', 'The', 'Quilvest', 'Harding', 'Heitman', 'Stone', 'Fischer', 'Logan', 'Hermes', 'Fisher', 'Colchester', 'CVC', 'Pantheon', 'Shinhan', 'Eagle', 'GW', 'Arca', 'Raiffeisen', 'Bentall', 'J', 'Artemis', 'Gothaer', 'Alcentra', 'HFT', 'Winton', 'Adams', 'Universal', 'Mirabaud', 'VidaCaixa', 'Muzinich', 'Brandes', 'Quoniam', 'AEW', 'Seix', 'Davis', 'Beutel', 'AGF', 'Genesis', 'Axeltis', 'Capital', 'TKP', 'Managed', 'Intermediate', 'Comgest', 'First', 'KGAL', 'AEW', 'Nykredit', 'Kutxabank', 'BlueMountain', 'SPF', 'Banco', 'DNCA', 'Unigestion', 'EnTrust', 'Assenagon', 'Patrizia', 'Southeastern', 'BankInvest', 'Calamos', 'Lendlease', 'Calamos', 'Westwood', 'Jyske', 'Tweedy', 'Savills', 'Royce', 'QS', 'ValueAct', 'Frankfurt', 'Allianz', 'Syz', 'Majedie', 'Yacktman', 'TimesSquare', 'Landmark', 'PAG', 'Veritas', 'Brookfield', 'Kepler', 'Seeyond', 'Scor', 'Siemens', 'Semper', 'Highland', 'Martin', 'EIG', 'CamGestion', 'The', 'Millennium', 'Bankia', 'Millennium', 'GNB', 'C', 'Theodoor', 'Sydbank', 'Frontier', 'Patron', 'Alfred', 'CQS', 'H2O', 'Veritable', 'Siguler', 'DJE', 'Gateway', 'HQ', 'McDonnell', 'BPI', 'Evli', 'Vaughan', 'EFG', 'Sparinvest', 'T', 'Aktia', 'Glenview', 'RWC', 'Systematica', 'LocalTapiola', 'Capital', 'DTZ', 'Chicago', 'Baring', 'Pacific', 'TwentyFour', 'Pyrford', 'KBI', 'Skagen', 'Fisch', 'Arion', 'Bantleon', 'Maj', 'Lupus', 'Setanta', 'Maple', 'Adrian', 'Trilogy', 'Bouwinvest', 'Edinburgh', 'Sparx', 'CenterSquare', 'Hayfin', 'Kairos', 'Foyston', 'Ecofi', 'IDFC', 'Tristan', 'Caser', 'Rockspring', 'Renta', 'Orchard', 'Driehaus', 'Access', 'La', 'TOBAM', 'Jacobs', 'Investa', 'DDJ', 'Liontrust', 'River', 'Cromwell', 'Abbott', 'Adveq', 'Bankia', 'Sentinel', 'Sberbank', 'Sentinel', 'Mirova', 'March', 'myCIO', 'IPM', 'Ibercaja', 'AlphaSimplex', 'Perennial', 'Impax', 'LumX', 'texas', 'california']
unique_kw = list(set(keywords))
return uniqueKw |
#
# @lc app=leetcode id=114 lang=python3
#
# [114] Flatten Binary Tree to Linked List
#
# https://leetcode.com/problems/flatten-binary-tree-to-linked-list/description/
#
# algorithms
# Medium (51.57%)
# Likes: 4378
# Dislikes: 411
# Total Accepted: 451.1K
# Total Submissions: 847.4K
# Testcase Example: '[1,2,5,3,4,null,6]'
#
# Given the root of a binary tree, flatten the tree into a "linked list":
#
#
# The "linked list" should use the same TreeNode class where the right child
# pointer points to the next node in the list and the left child pointer is
# always null.
# The "linked list" should be in the same order as a pre-order traversal of the
# binary tree.
#
#
#
# Example 1:
#
#
# Input: root = [1,2,5,3,4,null,6]
# Output: [1,null,2,null,3,null,4,null,5,null,6]
#
#
# Example 2:
#
#
# Input: root = []
# Output: []
#
#
# Example 3:
#
#
# Input: root = [0]
# Output: [0]
#
#
#
# Constraints:
#
#
# The number of nodes in the tree is in the range [0, 2000].
# -100 <= Node.val <= 100
#
#
#
# Follow up: Can you flatten the tree in-place (with O(1) extra space)?
#
# @lc code=start
# Definition for a binary tree node.
# class TreeNode:
# def __init__(self, val=0, left=None, right=None):
# self.val = val
# self.left = left
# self.right = right
class Solution:
def flatten(self, root: TreeNode) -> None:
"""
Do not return anything, modify root in-place instead.
"""
if root is None:
return None
self.flatten(root.left)
self.flatten(root.right)
if root.left is None:
return None
node = root.left
while node.right is not None:
node = node.right
node.right = root.right
root.right = root.left
root.left = None
# @lc code=end
| class Solution:
def flatten(self, root: TreeNode) -> None:
"""
Do not return anything, modify root in-place instead.
"""
if root is None:
return None
self.flatten(root.left)
self.flatten(root.right)
if root.left is None:
return None
node = root.left
while node.right is not None:
node = node.right
node.right = root.right
root.right = root.left
root.left = None |
def Tproduct(arg0, *args):
p = arg0
for arg in args:
p *= arg
return p
| def tproduct(arg0, *args):
p = arg0
for arg in args:
p *= arg
return p |
mylist = input('Enter your list: ')
mylist = [int(x) for x in mylist.split(' ')]
points = [0,15,10,10,25,15,15,20,10,25,20,25,25,5,20,30,20,15,10,5,5,15,20,20,20,20,15,15,20,25,15,20,20,20,15,40,15,30,35,20,25,15,20,15,25,20,25,20,25,20,10]
total = 0
for index in mylist:
total += points[index]
print (total) | mylist = input('Enter your list: ')
mylist = [int(x) for x in mylist.split(' ')]
points = [0, 15, 10, 10, 25, 15, 15, 20, 10, 25, 20, 25, 25, 5, 20, 30, 20, 15, 10, 5, 5, 15, 20, 20, 20, 20, 15, 15, 20, 25, 15, 20, 20, 20, 15, 40, 15, 30, 35, 20, 25, 15, 20, 15, 25, 20, 25, 20, 25, 20, 10]
total = 0
for index in mylist:
total += points[index]
print(total) |
"""Pipelines for features generation."""
__all__ = [
"base",
"lgb_pipeline",
"image_pipeline",
"linear_pipeline",
"text_pipeline",
"wb_pipeline",
]
| """Pipelines for features generation."""
__all__ = ['base', 'lgb_pipeline', 'image_pipeline', 'linear_pipeline', 'text_pipeline', 'wb_pipeline'] |
'''
The MIT License (MIT)
Copyright (c) 2016 WavyCloud
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.
'''
def batch_check_layer_availability(registryId=None, repositoryName=None, layerDigests=None):
"""
Check the availability of multiple image layers in a specified registry and repository.
See also: AWS API Documentation
:example: response = client.batch_check_layer_availability(
registryId='string',
repositoryName='string',
layerDigests=[
'string',
]
)
:type registryId: string
:param registryId: The AWS account ID associated with the registry that contains the image layers to check. If you do not specify a registry, the default registry is assumed.
:type repositoryName: string
:param repositoryName: [REQUIRED]
The name of the repository that is associated with the image layers to check.
:type layerDigests: list
:param layerDigests: [REQUIRED]
The digests of the image layers to check.
(string) --
:rtype: dict
:return: {
'layers': [
{
'layerDigest': 'string',
'layerAvailability': 'AVAILABLE'|'UNAVAILABLE',
'layerSize': 123,
'mediaType': 'string'
},
],
'failures': [
{
'layerDigest': 'string',
'failureCode': 'InvalidLayerDigest'|'MissingLayerDigest',
'failureReason': 'string'
},
]
}
"""
pass
def batch_delete_image(registryId=None, repositoryName=None, imageIds=None):
"""
Deletes a list of specified images within a specified repository. Images are specified with either imageTag or imageDigest .
You can remove a tag from an image by specifying the image's tag in your request. When you remove the last tag from an image, the image is deleted from your repository.
You can completely delete an image (and all of its tags) by specifying the image's digest in your request.
See also: AWS API Documentation
Examples
This example deletes images with the tags precise and trusty in a repository called ubuntu in the default registry for an account.
Expected Output:
:example: response = client.batch_delete_image(
registryId='string',
repositoryName='string',
imageIds=[
{
'imageDigest': 'string',
'imageTag': 'string'
},
]
)
:type registryId: string
:param registryId: The AWS account ID associated with the registry that contains the image to delete. If you do not specify a registry, the default registry is assumed.
:type repositoryName: string
:param repositoryName: [REQUIRED]
The repository that contains the image to delete.
:type imageIds: list
:param imageIds: [REQUIRED]
A list of image ID references that correspond to images to delete. The format of the imageIds reference is imageTag=tag or imageDigest=digest .
(dict) --An object with identifying information for an Amazon ECR image.
imageDigest (string) --The sha256 digest of the image manifest.
imageTag (string) --The tag used for the image.
:rtype: dict
:return: {
'imageIds': [
{
'imageDigest': 'string',
'imageTag': 'string'
},
],
'failures': [
{
'imageId': {
'imageDigest': 'string',
'imageTag': 'string'
},
'failureCode': 'InvalidImageDigest'|'InvalidImageTag'|'ImageTagDoesNotMatchDigest'|'ImageNotFound'|'MissingDigestAndTag',
'failureReason': 'string'
},
]
}
"""
pass
def batch_get_image(registryId=None, repositoryName=None, imageIds=None, acceptedMediaTypes=None):
"""
Gets detailed information for specified images within a specified repository. Images are specified with either imageTag or imageDigest .
See also: AWS API Documentation
Examples
This example obtains information for an image with a specified image digest ID from the repository named ubuntu in the current account.
Expected Output:
:example: response = client.batch_get_image(
registryId='string',
repositoryName='string',
imageIds=[
{
'imageDigest': 'string',
'imageTag': 'string'
},
],
acceptedMediaTypes=[
'string',
]
)
:type registryId: string
:param registryId: The AWS account ID associated with the registry that contains the images to describe. If you do not specify a registry, the default registry is assumed.
:type repositoryName: string
:param repositoryName: [REQUIRED]
The repository that contains the images to describe.
:type imageIds: list
:param imageIds: [REQUIRED]
A list of image ID references that correspond to images to describe. The format of the imageIds reference is imageTag=tag or imageDigest=digest .
(dict) --An object with identifying information for an Amazon ECR image.
imageDigest (string) --The sha256 digest of the image manifest.
imageTag (string) --The tag used for the image.
:type acceptedMediaTypes: list
:param acceptedMediaTypes: The accepted media types for the request.
Valid values: application/vnd.docker.distribution.manifest.v1+json | application/vnd.docker.distribution.manifest.v2+json | application/vnd.oci.image.manifest.v1+json
(string) --
:rtype: dict
:return: {
'images': [
{
'registryId': 'string',
'repositoryName': 'string',
'imageId': {
'imageDigest': 'string',
'imageTag': 'string'
},
'imageManifest': 'string'
},
],
'failures': [
{
'imageId': {
'imageDigest': 'string',
'imageTag': 'string'
},
'failureCode': 'InvalidImageDigest'|'InvalidImageTag'|'ImageTagDoesNotMatchDigest'|'ImageNotFound'|'MissingDigestAndTag',
'failureReason': 'string'
},
]
}
"""
pass
def can_paginate(operation_name=None):
"""
Check if an operation can be paginated.
:type operation_name: string
:param operation_name: The operation name. This is the same name
as the method name on the client. For example, if the
method name is create_foo, and you'd normally invoke the
operation as client.create_foo(**kwargs), if the
create_foo operation can be paginated, you can use the
call client.get_paginator('create_foo').
"""
pass
def complete_layer_upload(registryId=None, repositoryName=None, uploadId=None, layerDigests=None):
"""
Inform Amazon ECR that the image layer upload for a specified registry, repository name, and upload ID, has completed. You can optionally provide a sha256 digest of the image layer for data validation purposes.
See also: AWS API Documentation
:example: response = client.complete_layer_upload(
registryId='string',
repositoryName='string',
uploadId='string',
layerDigests=[
'string',
]
)
:type registryId: string
:param registryId: The AWS account ID associated with the registry to which to upload layers. If you do not specify a registry, the default registry is assumed.
:type repositoryName: string
:param repositoryName: [REQUIRED]
The name of the repository to associate with the image layer.
:type uploadId: string
:param uploadId: [REQUIRED]
The upload ID from a previous InitiateLayerUpload operation to associate with the image layer.
:type layerDigests: list
:param layerDigests: [REQUIRED]
The sha256 digest of the image layer.
(string) --
:rtype: dict
:return: {
'registryId': 'string',
'repositoryName': 'string',
'uploadId': 'string',
'layerDigest': 'string'
}
"""
pass
def create_repository(repositoryName=None):
"""
Creates an image repository.
See also: AWS API Documentation
Examples
This example creates a repository called nginx-web-app inside the project-a namespace in the default registry for an account.
Expected Output:
:example: response = client.create_repository(
repositoryName='string'
)
:type repositoryName: string
:param repositoryName: [REQUIRED]
The name to use for the repository. The repository name may be specified on its own (such as nginx-web-app ) or it can be prepended with a namespace to group the repository into a category (such as project-a/nginx-web-app ).
:rtype: dict
:return: {
'repository': {
'repositoryArn': 'string',
'registryId': 'string',
'repositoryName': 'string',
'repositoryUri': 'string',
'createdAt': datetime(2015, 1, 1)
}
}
"""
pass
def delete_repository(registryId=None, repositoryName=None, force=None):
"""
Deletes an existing image repository. If a repository contains images, you must use the force option to delete it.
See also: AWS API Documentation
Examples
This example force deletes a repository named ubuntu in the default registry for an account. The force parameter is required if the repository contains images.
Expected Output:
:example: response = client.delete_repository(
registryId='string',
repositoryName='string',
force=True|False
)
:type registryId: string
:param registryId: The AWS account ID associated with the registry that contains the repository to delete. If you do not specify a registry, the default registry is assumed.
:type repositoryName: string
:param repositoryName: [REQUIRED]
The name of the repository to delete.
:type force: boolean
:param force: Force the deletion of the repository if it contains images.
:rtype: dict
:return: {
'repository': {
'repositoryArn': 'string',
'registryId': 'string',
'repositoryName': 'string',
'repositoryUri': 'string',
'createdAt': datetime(2015, 1, 1)
}
}
"""
pass
def delete_repository_policy(registryId=None, repositoryName=None):
"""
Deletes the repository policy from a specified repository.
See also: AWS API Documentation
Examples
This example deletes the policy associated with the repository named ubuntu in the current account.
Expected Output:
:example: response = client.delete_repository_policy(
registryId='string',
repositoryName='string'
)
:type registryId: string
:param registryId: The AWS account ID associated with the registry that contains the repository policy to delete. If you do not specify a registry, the default registry is assumed.
:type repositoryName: string
:param repositoryName: [REQUIRED]
The name of the repository that is associated with the repository policy to delete.
:rtype: dict
:return: {
'registryId': 'string',
'repositoryName': 'string',
'policyText': 'string'
}
"""
pass
def describe_images(registryId=None, repositoryName=None, imageIds=None, nextToken=None, maxResults=None, filter=None):
"""
Returns metadata about the images in a repository, including image size, image tags, and creation date.
See also: AWS API Documentation
:example: response = client.describe_images(
registryId='string',
repositoryName='string',
imageIds=[
{
'imageDigest': 'string',
'imageTag': 'string'
},
],
nextToken='string',
maxResults=123,
filter={
'tagStatus': 'TAGGED'|'UNTAGGED'
}
)
:type registryId: string
:param registryId: The AWS account ID associated with the registry that contains the repository in which to describe images. If you do not specify a registry, the default registry is assumed.
:type repositoryName: string
:param repositoryName: [REQUIRED]
A list of repositories to describe. If this parameter is omitted, then all repositories in a registry are described.
:type imageIds: list
:param imageIds: The list of image IDs for the requested repository.
(dict) --An object with identifying information for an Amazon ECR image.
imageDigest (string) --The sha256 digest of the image manifest.
imageTag (string) --The tag used for the image.
:type nextToken: string
:param nextToken: The nextToken value returned from a previous paginated DescribeImages request where maxResults was used and the results exceeded the value of that parameter. Pagination continues from the end of the previous results that returned the nextToken value. This value is null when there are no more results to return.
:type maxResults: integer
:param maxResults: The maximum number of repository results returned by DescribeImages in paginated output. When this parameter is used, DescribeImages only returns maxResults results in a single page along with a nextToken response element. The remaining results of the initial request can be seen by sending another DescribeImages request with the returned nextToken value. This value can be between 1 and 100. If this parameter is not used, then DescribeImages returns up to 100 results and a nextToken value, if applicable.
:type filter: dict
:param filter: The filter key and value with which to filter your DescribeImages results.
tagStatus (string) --The tag status with which to filter your DescribeImages results. You can filter results based on whether they are TAGGED or UNTAGGED .
:rtype: dict
:return: {
'imageDetails': [
{
'registryId': 'string',
'repositoryName': 'string',
'imageDigest': 'string',
'imageTags': [
'string',
],
'imageSizeInBytes': 123,
'imagePushedAt': datetime(2015, 1, 1)
},
],
'nextToken': 'string'
}
:returns:
(string) --
"""
pass
def describe_repositories(registryId=None, repositoryNames=None, nextToken=None, maxResults=None):
"""
Describes image repositories in a registry.
See also: AWS API Documentation
Examples
The following example obtains a list and description of all repositories in the default registry to which the current user has access.
Expected Output:
:example: response = client.describe_repositories(
registryId='string',
repositoryNames=[
'string',
],
nextToken='string',
maxResults=123
)
:type registryId: string
:param registryId: The AWS account ID associated with the registry that contains the repositories to be described. If you do not specify a registry, the default registry is assumed.
:type repositoryNames: list
:param repositoryNames: A list of repositories to describe. If this parameter is omitted, then all repositories in a registry are described.
(string) --
:type nextToken: string
:param nextToken: The nextToken value returned from a previous paginated DescribeRepositories request where maxResults was used and the results exceeded the value of that parameter. Pagination continues from the end of the previous results that returned the nextToken value. This value is null when there are no more results to return.
Note
This token should be treated as an opaque identifier that is only used to retrieve the next items in a list and not for other programmatic purposes.
:type maxResults: integer
:param maxResults: The maximum number of repository results returned by DescribeRepositories in paginated output. When this parameter is used, DescribeRepositories only returns maxResults results in a single page along with a nextToken response element. The remaining results of the initial request can be seen by sending another DescribeRepositories request with the returned nextToken value. This value can be between 1 and 100. If this parameter is not used, then DescribeRepositories returns up to 100 results and a nextToken value, if applicable.
:rtype: dict
:return: {
'repositories': [
{
'repositoryArn': 'string',
'registryId': 'string',
'repositoryName': 'string',
'repositoryUri': 'string',
'createdAt': datetime(2015, 1, 1)
},
],
'nextToken': 'string'
}
"""
pass
def generate_presigned_url(ClientMethod=None, Params=None, ExpiresIn=None, HttpMethod=None):
"""
Generate a presigned url given a client, its method, and arguments
:type ClientMethod: string
:param ClientMethod: The client method to presign for
:type Params: dict
:param Params: The parameters normally passed to
ClientMethod.
:type ExpiresIn: int
:param ExpiresIn: The number of seconds the presigned url is valid
for. By default it expires in an hour (3600 seconds)
:type HttpMethod: string
:param HttpMethod: The http method to use on the generated url. By
default, the http method is whatever is used in the method's model.
"""
pass
def get_authorization_token(registryIds=None):
"""
Retrieves a token that is valid for a specified registry for 12 hours. This command allows you to use the docker CLI to push and pull images with Amazon ECR. If you do not specify a registry, the default registry is assumed.
The authorizationToken returned for each registry specified is a base64 encoded string that can be decoded and used in a docker login command to authenticate to a registry. The AWS CLI offers an aws ecr get-login command that simplifies the login process.
See also: AWS API Documentation
Examples
This example gets an authorization token for your default registry.
Expected Output:
:example: response = client.get_authorization_token(
registryIds=[
'string',
]
)
:type registryIds: list
:param registryIds: A list of AWS account IDs that are associated with the registries for which to get authorization tokens. If you do not specify a registry, the default registry is assumed.
(string) --
:rtype: dict
:return: {
'authorizationData': [
{
'authorizationToken': 'string',
'expiresAt': datetime(2015, 1, 1),
'proxyEndpoint': 'string'
},
]
}
"""
pass
def get_download_url_for_layer(registryId=None, repositoryName=None, layerDigest=None):
"""
Retrieves the pre-signed Amazon S3 download URL corresponding to an image layer. You can only get URLs for image layers that are referenced in an image.
See also: AWS API Documentation
:example: response = client.get_download_url_for_layer(
registryId='string',
repositoryName='string',
layerDigest='string'
)
:type registryId: string
:param registryId: The AWS account ID associated with the registry that contains the image layer to download. If you do not specify a registry, the default registry is assumed.
:type repositoryName: string
:param repositoryName: [REQUIRED]
The name of the repository that is associated with the image layer to download.
:type layerDigest: string
:param layerDigest: [REQUIRED]
The digest of the image layer to download.
:rtype: dict
:return: {
'downloadUrl': 'string',
'layerDigest': 'string'
}
"""
pass
def get_paginator(operation_name=None):
"""
Create a paginator for an operation.
:type operation_name: string
:param operation_name: The operation name. This is the same name
as the method name on the client. For example, if the
method name is create_foo, and you'd normally invoke the
operation as client.create_foo(**kwargs), if the
create_foo operation can be paginated, you can use the
call client.get_paginator('create_foo').
:rtype: L{botocore.paginate.Paginator}
"""
pass
def get_repository_policy(registryId=None, repositoryName=None):
"""
Retrieves the repository policy for a specified repository.
See also: AWS API Documentation
Examples
This example obtains the repository policy for the repository named ubuntu.
Expected Output:
:example: response = client.get_repository_policy(
registryId='string',
repositoryName='string'
)
:type registryId: string
:param registryId: The AWS account ID associated with the registry that contains the repository. If you do not specify a registry, the default registry is assumed.
:type repositoryName: string
:param repositoryName: [REQUIRED]
The name of the repository whose policy you want to retrieve.
:rtype: dict
:return: {
'registryId': 'string',
'repositoryName': 'string',
'policyText': 'string'
}
"""
pass
def get_waiter():
"""
"""
pass
def initiate_layer_upload(registryId=None, repositoryName=None):
"""
Notify Amazon ECR that you intend to upload an image layer.
See also: AWS API Documentation
:example: response = client.initiate_layer_upload(
registryId='string',
repositoryName='string'
)
:type registryId: string
:param registryId: The AWS account ID associated with the registry that you intend to upload layers to. If you do not specify a registry, the default registry is assumed.
:type repositoryName: string
:param repositoryName: [REQUIRED]
The name of the repository that you intend to upload layers to.
:rtype: dict
:return: {
'uploadId': 'string',
'partSize': 123
}
"""
pass
def list_images(registryId=None, repositoryName=None, nextToken=None, maxResults=None, filter=None):
"""
Lists all the image IDs for a given repository.
You can filter images based on whether or not they are tagged by setting the tagStatus parameter to TAGGED or UNTAGGED . For example, you can filter your results to return only UNTAGGED images and then pipe that result to a BatchDeleteImage operation to delete them. Or, you can filter your results to return only TAGGED images to list all of the tags in your repository.
See also: AWS API Documentation
Examples
This example lists all of the images in the repository named ubuntu in the default registry in the current account.
Expected Output:
:example: response = client.list_images(
registryId='string',
repositoryName='string',
nextToken='string',
maxResults=123,
filter={
'tagStatus': 'TAGGED'|'UNTAGGED'
}
)
:type registryId: string
:param registryId: The AWS account ID associated with the registry that contains the repository to list images in. If you do not specify a registry, the default registry is assumed.
:type repositoryName: string
:param repositoryName: [REQUIRED]
The repository whose image IDs are to be listed.
:type nextToken: string
:param nextToken: The nextToken value returned from a previous paginated ListImages request where maxResults was used and the results exceeded the value of that parameter. Pagination continues from the end of the previous results that returned the nextToken value. This value is null when there are no more results to return.
Note
This token should be treated as an opaque identifier that is only used to retrieve the next items in a list and not for other programmatic purposes.
:type maxResults: integer
:param maxResults: The maximum number of image results returned by ListImages in paginated output. When this parameter is used, ListImages only returns maxResults results in a single page along with a nextToken response element. The remaining results of the initial request can be seen by sending another ListImages request with the returned nextToken value. This value can be between 1 and 100. If this parameter is not used, then ListImages returns up to 100 results and a nextToken value, if applicable.
:type filter: dict
:param filter: The filter key and value with which to filter your ListImages results.
tagStatus (string) --The tag status with which to filter your ListImages results. You can filter results based on whether they are TAGGED or UNTAGGED .
:rtype: dict
:return: {
'imageIds': [
{
'imageDigest': 'string',
'imageTag': 'string'
},
],
'nextToken': 'string'
}
"""
pass
def put_image(registryId=None, repositoryName=None, imageManifest=None, imageTag=None):
"""
Creates or updates the image manifest and tags associated with an image.
See also: AWS API Documentation
:example: response = client.put_image(
registryId='string',
repositoryName='string',
imageManifest='string',
imageTag='string'
)
:type registryId: string
:param registryId: The AWS account ID associated with the registry that contains the repository in which to put the image. If you do not specify a registry, the default registry is assumed.
:type repositoryName: string
:param repositoryName: [REQUIRED]
The name of the repository in which to put the image.
:type imageManifest: string
:param imageManifest: [REQUIRED]
The image manifest corresponding to the image to be uploaded.
:type imageTag: string
:param imageTag: The tag to associate with the image. This parameter is required for images that use the Docker Image Manifest V2 Schema 2 or OCI formats.
:rtype: dict
:return: {
'image': {
'registryId': 'string',
'repositoryName': 'string',
'imageId': {
'imageDigest': 'string',
'imageTag': 'string'
},
'imageManifest': 'string'
}
}
"""
pass
def set_repository_policy(registryId=None, repositoryName=None, policyText=None, force=None):
"""
Applies a repository policy on a specified repository to control access permissions.
See also: AWS API Documentation
:example: response = client.set_repository_policy(
registryId='string',
repositoryName='string',
policyText='string',
force=True|False
)
:type registryId: string
:param registryId: The AWS account ID associated with the registry that contains the repository. If you do not specify a registry, the default registry is assumed.
:type repositoryName: string
:param repositoryName: [REQUIRED]
The name of the repository to receive the policy.
:type policyText: string
:param policyText: [REQUIRED]
The JSON repository policy text to apply to the repository.
:type force: boolean
:param force: If the policy you are attempting to set on a repository policy would prevent you from setting another policy in the future, you must force the SetRepositoryPolicy operation. This is intended to prevent accidental repository lock outs.
:rtype: dict
:return: {
'registryId': 'string',
'repositoryName': 'string',
'policyText': 'string'
}
"""
pass
def upload_layer_part(registryId=None, repositoryName=None, uploadId=None, partFirstByte=None, partLastByte=None, layerPartBlob=None):
"""
Uploads an image layer part to Amazon ECR.
See also: AWS API Documentation
:example: response = client.upload_layer_part(
registryId='string',
repositoryName='string',
uploadId='string',
partFirstByte=123,
partLastByte=123,
layerPartBlob=b'bytes'
)
:type registryId: string
:param registryId: The AWS account ID associated with the registry that you are uploading layer parts to. If you do not specify a registry, the default registry is assumed.
:type repositoryName: string
:param repositoryName: [REQUIRED]
The name of the repository that you are uploading layer parts to.
:type uploadId: string
:param uploadId: [REQUIRED]
The upload ID from a previous InitiateLayerUpload operation to associate with the layer part upload.
:type partFirstByte: integer
:param partFirstByte: [REQUIRED]
The integer value of the first byte of the layer part.
:type partLastByte: integer
:param partLastByte: [REQUIRED]
The integer value of the last byte of the layer part.
:type layerPartBlob: bytes
:param layerPartBlob: [REQUIRED]
The base64-encoded layer part payload.
:rtype: dict
:return: {
'registryId': 'string',
'repositoryName': 'string',
'uploadId': 'string',
'lastByteReceived': 123
}
"""
pass
| """
The MIT License (MIT)
Copyright (c) 2016 WavyCloud
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.
"""
def batch_check_layer_availability(registryId=None, repositoryName=None, layerDigests=None):
"""
Check the availability of multiple image layers in a specified registry and repository.
See also: AWS API Documentation
:example: response = client.batch_check_layer_availability(
registryId='string',
repositoryName='string',
layerDigests=[
'string',
]
)
:type registryId: string
:param registryId: The AWS account ID associated with the registry that contains the image layers to check. If you do not specify a registry, the default registry is assumed.
:type repositoryName: string
:param repositoryName: [REQUIRED]
The name of the repository that is associated with the image layers to check.
:type layerDigests: list
:param layerDigests: [REQUIRED]
The digests of the image layers to check.
(string) --
:rtype: dict
:return: {
'layers': [
{
'layerDigest': 'string',
'layerAvailability': 'AVAILABLE'|'UNAVAILABLE',
'layerSize': 123,
'mediaType': 'string'
},
],
'failures': [
{
'layerDigest': 'string',
'failureCode': 'InvalidLayerDigest'|'MissingLayerDigest',
'failureReason': 'string'
},
]
}
"""
pass
def batch_delete_image(registryId=None, repositoryName=None, imageIds=None):
"""
Deletes a list of specified images within a specified repository. Images are specified with either imageTag or imageDigest .
You can remove a tag from an image by specifying the image's tag in your request. When you remove the last tag from an image, the image is deleted from your repository.
You can completely delete an image (and all of its tags) by specifying the image's digest in your request.
See also: AWS API Documentation
Examples
This example deletes images with the tags precise and trusty in a repository called ubuntu in the default registry for an account.
Expected Output:
:example: response = client.batch_delete_image(
registryId='string',
repositoryName='string',
imageIds=[
{
'imageDigest': 'string',
'imageTag': 'string'
},
]
)
:type registryId: string
:param registryId: The AWS account ID associated with the registry that contains the image to delete. If you do not specify a registry, the default registry is assumed.
:type repositoryName: string
:param repositoryName: [REQUIRED]
The repository that contains the image to delete.
:type imageIds: list
:param imageIds: [REQUIRED]
A list of image ID references that correspond to images to delete. The format of the imageIds reference is imageTag=tag or imageDigest=digest .
(dict) --An object with identifying information for an Amazon ECR image.
imageDigest (string) --The sha256 digest of the image manifest.
imageTag (string) --The tag used for the image.
:rtype: dict
:return: {
'imageIds': [
{
'imageDigest': 'string',
'imageTag': 'string'
},
],
'failures': [
{
'imageId': {
'imageDigest': 'string',
'imageTag': 'string'
},
'failureCode': 'InvalidImageDigest'|'InvalidImageTag'|'ImageTagDoesNotMatchDigest'|'ImageNotFound'|'MissingDigestAndTag',
'failureReason': 'string'
},
]
}
"""
pass
def batch_get_image(registryId=None, repositoryName=None, imageIds=None, acceptedMediaTypes=None):
"""
Gets detailed information for specified images within a specified repository. Images are specified with either imageTag or imageDigest .
See also: AWS API Documentation
Examples
This example obtains information for an image with a specified image digest ID from the repository named ubuntu in the current account.
Expected Output:
:example: response = client.batch_get_image(
registryId='string',
repositoryName='string',
imageIds=[
{
'imageDigest': 'string',
'imageTag': 'string'
},
],
acceptedMediaTypes=[
'string',
]
)
:type registryId: string
:param registryId: The AWS account ID associated with the registry that contains the images to describe. If you do not specify a registry, the default registry is assumed.
:type repositoryName: string
:param repositoryName: [REQUIRED]
The repository that contains the images to describe.
:type imageIds: list
:param imageIds: [REQUIRED]
A list of image ID references that correspond to images to describe. The format of the imageIds reference is imageTag=tag or imageDigest=digest .
(dict) --An object with identifying information for an Amazon ECR image.
imageDigest (string) --The sha256 digest of the image manifest.
imageTag (string) --The tag used for the image.
:type acceptedMediaTypes: list
:param acceptedMediaTypes: The accepted media types for the request.
Valid values: application/vnd.docker.distribution.manifest.v1+json | application/vnd.docker.distribution.manifest.v2+json | application/vnd.oci.image.manifest.v1+json
(string) --
:rtype: dict
:return: {
'images': [
{
'registryId': 'string',
'repositoryName': 'string',
'imageId': {
'imageDigest': 'string',
'imageTag': 'string'
},
'imageManifest': 'string'
},
],
'failures': [
{
'imageId': {
'imageDigest': 'string',
'imageTag': 'string'
},
'failureCode': 'InvalidImageDigest'|'InvalidImageTag'|'ImageTagDoesNotMatchDigest'|'ImageNotFound'|'MissingDigestAndTag',
'failureReason': 'string'
},
]
}
"""
pass
def can_paginate(operation_name=None):
"""
Check if an operation can be paginated.
:type operation_name: string
:param operation_name: The operation name. This is the same name
as the method name on the client. For example, if the
method name is create_foo, and you'd normally invoke the
operation as client.create_foo(**kwargs), if the
create_foo operation can be paginated, you can use the
call client.get_paginator('create_foo').
"""
pass
def complete_layer_upload(registryId=None, repositoryName=None, uploadId=None, layerDigests=None):
"""
Inform Amazon ECR that the image layer upload for a specified registry, repository name, and upload ID, has completed. You can optionally provide a sha256 digest of the image layer for data validation purposes.
See also: AWS API Documentation
:example: response = client.complete_layer_upload(
registryId='string',
repositoryName='string',
uploadId='string',
layerDigests=[
'string',
]
)
:type registryId: string
:param registryId: The AWS account ID associated with the registry to which to upload layers. If you do not specify a registry, the default registry is assumed.
:type repositoryName: string
:param repositoryName: [REQUIRED]
The name of the repository to associate with the image layer.
:type uploadId: string
:param uploadId: [REQUIRED]
The upload ID from a previous InitiateLayerUpload operation to associate with the image layer.
:type layerDigests: list
:param layerDigests: [REQUIRED]
The sha256 digest of the image layer.
(string) --
:rtype: dict
:return: {
'registryId': 'string',
'repositoryName': 'string',
'uploadId': 'string',
'layerDigest': 'string'
}
"""
pass
def create_repository(repositoryName=None):
"""
Creates an image repository.
See also: AWS API Documentation
Examples
This example creates a repository called nginx-web-app inside the project-a namespace in the default registry for an account.
Expected Output:
:example: response = client.create_repository(
repositoryName='string'
)
:type repositoryName: string
:param repositoryName: [REQUIRED]
The name to use for the repository. The repository name may be specified on its own (such as nginx-web-app ) or it can be prepended with a namespace to group the repository into a category (such as project-a/nginx-web-app ).
:rtype: dict
:return: {
'repository': {
'repositoryArn': 'string',
'registryId': 'string',
'repositoryName': 'string',
'repositoryUri': 'string',
'createdAt': datetime(2015, 1, 1)
}
}
"""
pass
def delete_repository(registryId=None, repositoryName=None, force=None):
"""
Deletes an existing image repository. If a repository contains images, you must use the force option to delete it.
See also: AWS API Documentation
Examples
This example force deletes a repository named ubuntu in the default registry for an account. The force parameter is required if the repository contains images.
Expected Output:
:example: response = client.delete_repository(
registryId='string',
repositoryName='string',
force=True|False
)
:type registryId: string
:param registryId: The AWS account ID associated with the registry that contains the repository to delete. If you do not specify a registry, the default registry is assumed.
:type repositoryName: string
:param repositoryName: [REQUIRED]
The name of the repository to delete.
:type force: boolean
:param force: Force the deletion of the repository if it contains images.
:rtype: dict
:return: {
'repository': {
'repositoryArn': 'string',
'registryId': 'string',
'repositoryName': 'string',
'repositoryUri': 'string',
'createdAt': datetime(2015, 1, 1)
}
}
"""
pass
def delete_repository_policy(registryId=None, repositoryName=None):
"""
Deletes the repository policy from a specified repository.
See also: AWS API Documentation
Examples
This example deletes the policy associated with the repository named ubuntu in the current account.
Expected Output:
:example: response = client.delete_repository_policy(
registryId='string',
repositoryName='string'
)
:type registryId: string
:param registryId: The AWS account ID associated with the registry that contains the repository policy to delete. If you do not specify a registry, the default registry is assumed.
:type repositoryName: string
:param repositoryName: [REQUIRED]
The name of the repository that is associated with the repository policy to delete.
:rtype: dict
:return: {
'registryId': 'string',
'repositoryName': 'string',
'policyText': 'string'
}
"""
pass
def describe_images(registryId=None, repositoryName=None, imageIds=None, nextToken=None, maxResults=None, filter=None):
"""
Returns metadata about the images in a repository, including image size, image tags, and creation date.
See also: AWS API Documentation
:example: response = client.describe_images(
registryId='string',
repositoryName='string',
imageIds=[
{
'imageDigest': 'string',
'imageTag': 'string'
},
],
nextToken='string',
maxResults=123,
filter={
'tagStatus': 'TAGGED'|'UNTAGGED'
}
)
:type registryId: string
:param registryId: The AWS account ID associated with the registry that contains the repository in which to describe images. If you do not specify a registry, the default registry is assumed.
:type repositoryName: string
:param repositoryName: [REQUIRED]
A list of repositories to describe. If this parameter is omitted, then all repositories in a registry are described.
:type imageIds: list
:param imageIds: The list of image IDs for the requested repository.
(dict) --An object with identifying information for an Amazon ECR image.
imageDigest (string) --The sha256 digest of the image manifest.
imageTag (string) --The tag used for the image.
:type nextToken: string
:param nextToken: The nextToken value returned from a previous paginated DescribeImages request where maxResults was used and the results exceeded the value of that parameter. Pagination continues from the end of the previous results that returned the nextToken value. This value is null when there are no more results to return.
:type maxResults: integer
:param maxResults: The maximum number of repository results returned by DescribeImages in paginated output. When this parameter is used, DescribeImages only returns maxResults results in a single page along with a nextToken response element. The remaining results of the initial request can be seen by sending another DescribeImages request with the returned nextToken value. This value can be between 1 and 100. If this parameter is not used, then DescribeImages returns up to 100 results and a nextToken value, if applicable.
:type filter: dict
:param filter: The filter key and value with which to filter your DescribeImages results.
tagStatus (string) --The tag status with which to filter your DescribeImages results. You can filter results based on whether they are TAGGED or UNTAGGED .
:rtype: dict
:return: {
'imageDetails': [
{
'registryId': 'string',
'repositoryName': 'string',
'imageDigest': 'string',
'imageTags': [
'string',
],
'imageSizeInBytes': 123,
'imagePushedAt': datetime(2015, 1, 1)
},
],
'nextToken': 'string'
}
:returns:
(string) --
"""
pass
def describe_repositories(registryId=None, repositoryNames=None, nextToken=None, maxResults=None):
"""
Describes image repositories in a registry.
See also: AWS API Documentation
Examples
The following example obtains a list and description of all repositories in the default registry to which the current user has access.
Expected Output:
:example: response = client.describe_repositories(
registryId='string',
repositoryNames=[
'string',
],
nextToken='string',
maxResults=123
)
:type registryId: string
:param registryId: The AWS account ID associated with the registry that contains the repositories to be described. If you do not specify a registry, the default registry is assumed.
:type repositoryNames: list
:param repositoryNames: A list of repositories to describe. If this parameter is omitted, then all repositories in a registry are described.
(string) --
:type nextToken: string
:param nextToken: The nextToken value returned from a previous paginated DescribeRepositories request where maxResults was used and the results exceeded the value of that parameter. Pagination continues from the end of the previous results that returned the nextToken value. This value is null when there are no more results to return.
Note
This token should be treated as an opaque identifier that is only used to retrieve the next items in a list and not for other programmatic purposes.
:type maxResults: integer
:param maxResults: The maximum number of repository results returned by DescribeRepositories in paginated output. When this parameter is used, DescribeRepositories only returns maxResults results in a single page along with a nextToken response element. The remaining results of the initial request can be seen by sending another DescribeRepositories request with the returned nextToken value. This value can be between 1 and 100. If this parameter is not used, then DescribeRepositories returns up to 100 results and a nextToken value, if applicable.
:rtype: dict
:return: {
'repositories': [
{
'repositoryArn': 'string',
'registryId': 'string',
'repositoryName': 'string',
'repositoryUri': 'string',
'createdAt': datetime(2015, 1, 1)
},
],
'nextToken': 'string'
}
"""
pass
def generate_presigned_url(ClientMethod=None, Params=None, ExpiresIn=None, HttpMethod=None):
"""
Generate a presigned url given a client, its method, and arguments
:type ClientMethod: string
:param ClientMethod: The client method to presign for
:type Params: dict
:param Params: The parameters normally passed to
ClientMethod.
:type ExpiresIn: int
:param ExpiresIn: The number of seconds the presigned url is valid
for. By default it expires in an hour (3600 seconds)
:type HttpMethod: string
:param HttpMethod: The http method to use on the generated url. By
default, the http method is whatever is used in the method's model.
"""
pass
def get_authorization_token(registryIds=None):
"""
Retrieves a token that is valid for a specified registry for 12 hours. This command allows you to use the docker CLI to push and pull images with Amazon ECR. If you do not specify a registry, the default registry is assumed.
The authorizationToken returned for each registry specified is a base64 encoded string that can be decoded and used in a docker login command to authenticate to a registry. The AWS CLI offers an aws ecr get-login command that simplifies the login process.
See also: AWS API Documentation
Examples
This example gets an authorization token for your default registry.
Expected Output:
:example: response = client.get_authorization_token(
registryIds=[
'string',
]
)
:type registryIds: list
:param registryIds: A list of AWS account IDs that are associated with the registries for which to get authorization tokens. If you do not specify a registry, the default registry is assumed.
(string) --
:rtype: dict
:return: {
'authorizationData': [
{
'authorizationToken': 'string',
'expiresAt': datetime(2015, 1, 1),
'proxyEndpoint': 'string'
},
]
}
"""
pass
def get_download_url_for_layer(registryId=None, repositoryName=None, layerDigest=None):
"""
Retrieves the pre-signed Amazon S3 download URL corresponding to an image layer. You can only get URLs for image layers that are referenced in an image.
See also: AWS API Documentation
:example: response = client.get_download_url_for_layer(
registryId='string',
repositoryName='string',
layerDigest='string'
)
:type registryId: string
:param registryId: The AWS account ID associated with the registry that contains the image layer to download. If you do not specify a registry, the default registry is assumed.
:type repositoryName: string
:param repositoryName: [REQUIRED]
The name of the repository that is associated with the image layer to download.
:type layerDigest: string
:param layerDigest: [REQUIRED]
The digest of the image layer to download.
:rtype: dict
:return: {
'downloadUrl': 'string',
'layerDigest': 'string'
}
"""
pass
def get_paginator(operation_name=None):
"""
Create a paginator for an operation.
:type operation_name: string
:param operation_name: The operation name. This is the same name
as the method name on the client. For example, if the
method name is create_foo, and you'd normally invoke the
operation as client.create_foo(**kwargs), if the
create_foo operation can be paginated, you can use the
call client.get_paginator('create_foo').
:rtype: L{botocore.paginate.Paginator}
"""
pass
def get_repository_policy(registryId=None, repositoryName=None):
"""
Retrieves the repository policy for a specified repository.
See also: AWS API Documentation
Examples
This example obtains the repository policy for the repository named ubuntu.
Expected Output:
:example: response = client.get_repository_policy(
registryId='string',
repositoryName='string'
)
:type registryId: string
:param registryId: The AWS account ID associated with the registry that contains the repository. If you do not specify a registry, the default registry is assumed.
:type repositoryName: string
:param repositoryName: [REQUIRED]
The name of the repository whose policy you want to retrieve.
:rtype: dict
:return: {
'registryId': 'string',
'repositoryName': 'string',
'policyText': 'string'
}
"""
pass
def get_waiter():
"""
"""
pass
def initiate_layer_upload(registryId=None, repositoryName=None):
"""
Notify Amazon ECR that you intend to upload an image layer.
See also: AWS API Documentation
:example: response = client.initiate_layer_upload(
registryId='string',
repositoryName='string'
)
:type registryId: string
:param registryId: The AWS account ID associated with the registry that you intend to upload layers to. If you do not specify a registry, the default registry is assumed.
:type repositoryName: string
:param repositoryName: [REQUIRED]
The name of the repository that you intend to upload layers to.
:rtype: dict
:return: {
'uploadId': 'string',
'partSize': 123
}
"""
pass
def list_images(registryId=None, repositoryName=None, nextToken=None, maxResults=None, filter=None):
"""
Lists all the image IDs for a given repository.
You can filter images based on whether or not they are tagged by setting the tagStatus parameter to TAGGED or UNTAGGED . For example, you can filter your results to return only UNTAGGED images and then pipe that result to a BatchDeleteImage operation to delete them. Or, you can filter your results to return only TAGGED images to list all of the tags in your repository.
See also: AWS API Documentation
Examples
This example lists all of the images in the repository named ubuntu in the default registry in the current account.
Expected Output:
:example: response = client.list_images(
registryId='string',
repositoryName='string',
nextToken='string',
maxResults=123,
filter={
'tagStatus': 'TAGGED'|'UNTAGGED'
}
)
:type registryId: string
:param registryId: The AWS account ID associated with the registry that contains the repository to list images in. If you do not specify a registry, the default registry is assumed.
:type repositoryName: string
:param repositoryName: [REQUIRED]
The repository whose image IDs are to be listed.
:type nextToken: string
:param nextToken: The nextToken value returned from a previous paginated ListImages request where maxResults was used and the results exceeded the value of that parameter. Pagination continues from the end of the previous results that returned the nextToken value. This value is null when there are no more results to return.
Note
This token should be treated as an opaque identifier that is only used to retrieve the next items in a list and not for other programmatic purposes.
:type maxResults: integer
:param maxResults: The maximum number of image results returned by ListImages in paginated output. When this parameter is used, ListImages only returns maxResults results in a single page along with a nextToken response element. The remaining results of the initial request can be seen by sending another ListImages request with the returned nextToken value. This value can be between 1 and 100. If this parameter is not used, then ListImages returns up to 100 results and a nextToken value, if applicable.
:type filter: dict
:param filter: The filter key and value with which to filter your ListImages results.
tagStatus (string) --The tag status with which to filter your ListImages results. You can filter results based on whether they are TAGGED or UNTAGGED .
:rtype: dict
:return: {
'imageIds': [
{
'imageDigest': 'string',
'imageTag': 'string'
},
],
'nextToken': 'string'
}
"""
pass
def put_image(registryId=None, repositoryName=None, imageManifest=None, imageTag=None):
"""
Creates or updates the image manifest and tags associated with an image.
See also: AWS API Documentation
:example: response = client.put_image(
registryId='string',
repositoryName='string',
imageManifest='string',
imageTag='string'
)
:type registryId: string
:param registryId: The AWS account ID associated with the registry that contains the repository in which to put the image. If you do not specify a registry, the default registry is assumed.
:type repositoryName: string
:param repositoryName: [REQUIRED]
The name of the repository in which to put the image.
:type imageManifest: string
:param imageManifest: [REQUIRED]
The image manifest corresponding to the image to be uploaded.
:type imageTag: string
:param imageTag: The tag to associate with the image. This parameter is required for images that use the Docker Image Manifest V2 Schema 2 or OCI formats.
:rtype: dict
:return: {
'image': {
'registryId': 'string',
'repositoryName': 'string',
'imageId': {
'imageDigest': 'string',
'imageTag': 'string'
},
'imageManifest': 'string'
}
}
"""
pass
def set_repository_policy(registryId=None, repositoryName=None, policyText=None, force=None):
"""
Applies a repository policy on a specified repository to control access permissions.
See also: AWS API Documentation
:example: response = client.set_repository_policy(
registryId='string',
repositoryName='string',
policyText='string',
force=True|False
)
:type registryId: string
:param registryId: The AWS account ID associated with the registry that contains the repository. If you do not specify a registry, the default registry is assumed.
:type repositoryName: string
:param repositoryName: [REQUIRED]
The name of the repository to receive the policy.
:type policyText: string
:param policyText: [REQUIRED]
The JSON repository policy text to apply to the repository.
:type force: boolean
:param force: If the policy you are attempting to set on a repository policy would prevent you from setting another policy in the future, you must force the SetRepositoryPolicy operation. This is intended to prevent accidental repository lock outs.
:rtype: dict
:return: {
'registryId': 'string',
'repositoryName': 'string',
'policyText': 'string'
}
"""
pass
def upload_layer_part(registryId=None, repositoryName=None, uploadId=None, partFirstByte=None, partLastByte=None, layerPartBlob=None):
"""
Uploads an image layer part to Amazon ECR.
See also: AWS API Documentation
:example: response = client.upload_layer_part(
registryId='string',
repositoryName='string',
uploadId='string',
partFirstByte=123,
partLastByte=123,
layerPartBlob=b'bytes'
)
:type registryId: string
:param registryId: The AWS account ID associated with the registry that you are uploading layer parts to. If you do not specify a registry, the default registry is assumed.
:type repositoryName: string
:param repositoryName: [REQUIRED]
The name of the repository that you are uploading layer parts to.
:type uploadId: string
:param uploadId: [REQUIRED]
The upload ID from a previous InitiateLayerUpload operation to associate with the layer part upload.
:type partFirstByte: integer
:param partFirstByte: [REQUIRED]
The integer value of the first byte of the layer part.
:type partLastByte: integer
:param partLastByte: [REQUIRED]
The integer value of the last byte of the layer part.
:type layerPartBlob: bytes
:param layerPartBlob: [REQUIRED]
The base64-encoded layer part payload.
:rtype: dict
:return: {
'registryId': 'string',
'repositoryName': 'string',
'uploadId': 'string',
'lastByteReceived': 123
}
"""
pass |
# -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
#
# FreeType high-level python API - Copyright 2011-2015 Nicolas P. Rougier
# Distributed under the terms of the new BSD license.
#
# -----------------------------------------------------------------------------
"""
These values determine how the end of opened sub-paths are rendered in a
stroke.
FT_STROKER_LINECAP_BUTT
The end of lines is rendered as a full stop on the last point itself.
FT_STROKER_LINECAP_ROUND
The end of lines is rendered as a half-circle around the last point.
FT_STROKER_LINECAP_SQUARE
The end of lines is rendered as a square around the last point.
"""
FT_STROKER_LINECAPS = { 'FT_STROKER_LINECAP_BUTT' : 0,
'FT_STROKER_LINECAP_ROUND' : 1,
'FT_STROKER_LINECAP_SQUARE' : 2}
globals().update(FT_STROKER_LINECAPS)
| """
These values determine how the end of opened sub-paths are rendered in a
stroke.
FT_STROKER_LINECAP_BUTT
The end of lines is rendered as a full stop on the last point itself.
FT_STROKER_LINECAP_ROUND
The end of lines is rendered as a half-circle around the last point.
FT_STROKER_LINECAP_SQUARE
The end of lines is rendered as a square around the last point.
"""
ft_stroker_linecaps = {'FT_STROKER_LINECAP_BUTT': 0, 'FT_STROKER_LINECAP_ROUND': 1, 'FT_STROKER_LINECAP_SQUARE': 2}
globals().update(FT_STROKER_LINECAPS) |
INPUT_FILE = "../../input/01.txt"
def parse_input() -> list[int]:
"""
Parses the input and returns a list of depth measurements.
"""
with open(INPUT_FILE, "r") as f:
return [int(line) for line in f]
def count_increases(measurements: list[int]) -> int:
"""
Counts the number of times a measurement increases from the previous measurement.
"""
return sum(1 for a, b in zip(measurements[:-1], measurements[1:]) if a < b)
def get_sliding_windows(depths: list[int]) -> list[int]:
"""
Calculates the three-measurement sliding windows.
"""
return [a + b + c for a, b, c in zip(depths[:-2], depths[1:-1], depths[2:])]
if __name__ == "__main__":
depths = parse_input()
part1 = count_increases(depths)
sliding_windows = get_sliding_windows(depths)
part2 = count_increases(sliding_windows)
print(part1)
print(part2)
| input_file = '../../input/01.txt'
def parse_input() -> list[int]:
"""
Parses the input and returns a list of depth measurements.
"""
with open(INPUT_FILE, 'r') as f:
return [int(line) for line in f]
def count_increases(measurements: list[int]) -> int:
"""
Counts the number of times a measurement increases from the previous measurement.
"""
return sum((1 for (a, b) in zip(measurements[:-1], measurements[1:]) if a < b))
def get_sliding_windows(depths: list[int]) -> list[int]:
"""
Calculates the three-measurement sliding windows.
"""
return [a + b + c for (a, b, c) in zip(depths[:-2], depths[1:-1], depths[2:])]
if __name__ == '__main__':
depths = parse_input()
part1 = count_increases(depths)
sliding_windows = get_sliding_windows(depths)
part2 = count_increases(sliding_windows)
print(part1)
print(part2) |
URLS = 'app.urls'
POSTGRESQL_DATABASE_URI = ""
DEBUG = True
BASE_HOSTNAME = 'http://192.168.30.101:8080'
HOST = '0.0.0.0'
USERNAME = 'user'
PASSWORD = 'pass'
| urls = 'app.urls'
postgresql_database_uri = ''
debug = True
base_hostname = 'http://192.168.30.101:8080'
host = '0.0.0.0'
username = 'user'
password = 'pass' |
class ModelMetrics:
def __init__(self, model_name, model_version, metric_by_feature):
self.model_name = model_name
self.model_version = model_version
self.metrics_by_feature = metric_by_feature
| class Modelmetrics:
def __init__(self, model_name, model_version, metric_by_feature):
self.model_name = model_name
self.model_version = model_version
self.metrics_by_feature = metric_by_feature |
{
"name": "Attachment Url",
"summary": """Use attachment URL and upload data to external storage""",
"category": "Tools",
"images": [],
"version": "13.0.2.1.0",
"application": False,
"author": "IT-Projects LLC, Ildar Nasyrov",
"website": "https://apps.odoo.com/apps/modules/13.0/ir_attachment_url/",
"license": "LGPL-3",
"depends": ["web"],
"external_dependencies": {"python": [], "bin": []},
"data": ["views/ir_attachment.xml"],
"qweb": [],
"demo": [],
"post_load": None,
"pre_init_hook": None,
"post_init_hook": None,
"auto_install": False,
"installable": True,
}
| {'name': 'Attachment Url', 'summary': 'Use attachment URL and upload data to external storage', 'category': 'Tools', 'images': [], 'version': '13.0.2.1.0', 'application': False, 'author': 'IT-Projects LLC, Ildar Nasyrov', 'website': 'https://apps.odoo.com/apps/modules/13.0/ir_attachment_url/', 'license': 'LGPL-3', 'depends': ['web'], 'external_dependencies': {'python': [], 'bin': []}, 'data': ['views/ir_attachment.xml'], 'qweb': [], 'demo': [], 'post_load': None, 'pre_init_hook': None, 'post_init_hook': None, 'auto_install': False, 'installable': True} |
class Sample:
"""A representation of a sample obtained from IRIDA"""
def __init__(self, name, paired_path, unpaired_path):
"""
Initialize a sample instance
:type name: str
:param name: the name of the sample
:type path: str
:param path: the URI to obtain the sample from IRIDA
"""
self.name = name
self.paired_path = paired_path
self.unpaired_path = unpaired_path
self._sample_reads = [] # A list of SampleFile/SamplePair objects
def __repr__(self):
num_files = 0
for item in self.get_files():
try:
for _file in item:
num_files += 1
except TypeError:
num_files += 1
return_string = self.name + ":\n"
return_string += "\tPaired path: " + self.paired_path + "\n"
return_string += "\tSingles path: " + self.unpaired_path + "\n"
return_string += "\tNumber of files: " + str(num_files) + "\n"
return return_string
def add_file(self, new_file):
self._sample_reads.append(new_file)
def add_pair(self, pair):
self.add_file(pair)
def get_reads(self):
return self._sample_reads
| class Sample:
"""A representation of a sample obtained from IRIDA"""
def __init__(self, name, paired_path, unpaired_path):
"""
Initialize a sample instance
:type name: str
:param name: the name of the sample
:type path: str
:param path: the URI to obtain the sample from IRIDA
"""
self.name = name
self.paired_path = paired_path
self.unpaired_path = unpaired_path
self._sample_reads = []
def __repr__(self):
num_files = 0
for item in self.get_files():
try:
for _file in item:
num_files += 1
except TypeError:
num_files += 1
return_string = self.name + ':\n'
return_string += '\tPaired path: ' + self.paired_path + '\n'
return_string += '\tSingles path: ' + self.unpaired_path + '\n'
return_string += '\tNumber of files: ' + str(num_files) + '\n'
return return_string
def add_file(self, new_file):
self._sample_reads.append(new_file)
def add_pair(self, pair):
self.add_file(pair)
def get_reads(self):
return self._sample_reads |
class QuotesType:
""" Checks whether quotation marks are double or single in source file. """
NEED_TO_USE_SINGLE_QUOTES = 'need_to_use_single_quotes'
NEED_TO_USE_DOUBLE_QUOTES = 'need_to_use_double_quotes'
discrete_groups = [
{ 'name': 'single_quotes' },
{ 'name': 'double_quotes' },
]
inspections = {
NEED_TO_USE_SINGLE_QUOTES: 'Mostly single quotes are used in the source code, '
'maybe you need to change double quotes here.',
NEED_TO_USE_DOUBLE_QUOTES: 'Mostly double quotes are used in the source code, '
'maybe you need to change single quotes here.',
}
def count(self, file, verbose=False):
# Count all quotes that are single or double
with open(file) as f:
single_quotes_count = 0
double_quotes_count = 0
single_quotes_lines = []
double_quotes_lines = []
line_number = 0
for line in f.readlines():
line_number += 1
is_single = False
is_double = False
for i in range(len(line)):
if i > 0 and line[i - 1] == '\\':
continue
if line[i] == '\'':
if is_double:
continue
if is_single:
single_quotes_count += 1
single_quotes_lines.append(line_number)
is_single = False
else:
is_single = True
if line[i] == '\"':
if is_single:
continue
if is_double:
double_quotes_count += 1
double_quotes_lines.append(line_number)
is_double = False
else:
is_double = True
single_quotes_lines.sort()
unique_single_quotes_lines = []
for i in range(len(single_quotes_lines) - 1):
if i == 0 or single_quotes_lines[i] != single_quotes_lines[i-1]:
unique_single_quotes_lines.append(single_quotes_lines[i])
# Getting unique values for lines
double_quotes_lines.sort()
unique_double_quotes_lines = []
for i in range(len(double_quotes_lines) - 1):
if i == 0 or double_quotes_lines[i] != double_quotes_lines[i - 1]:
unique_double_quotes_lines.append(double_quotes_lines[i])
# Form result
result = {
'single_quotes': single_quotes_count,
'double_quotes': double_quotes_count,
}
if verbose:
result['single_quotes'] = {
'count': single_quotes_count,
'lines': unique_single_quotes_lines,
}
result['double_quotes'] = {
'count': double_quotes_count,
'lines': unique_double_quotes_lines,
}
return result
def discretize(self, values):
discrete_values = {}
sum = 0.0
# Set initial values for groups to 0
for group in self.discrete_groups:
discrete_values[group['name']] = 0
# Sum values for each group
for group, count in values.items():
discrete_values[group] = count
sum += count
# Normalize
for group, count in discrete_values.items():
if sum != 0:
discrete_values[group] = count / sum
return discrete_values
def inspect(self, discrete, values):
for_discretization = {}
for key, value in values.items():
for_discretization[key] = value['count']
file_discrete = self.discretize(for_discretization)
# Check if single or double quotes are prevailing
is_single_quote = False
if discrete['single_quotes'] > discrete['double_quotes']:
is_single_quote = True
inspections = {}
# Issue messages for all double quotes if single quotes prevail (or overwise)
if is_single_quote and file_discrete['double_quotes'] > 0.0:
inspections[self.NEED_TO_USE_SINGLE_QUOTES] = {
'message': self.inspections[self.NEED_TO_USE_SINGLE_QUOTES].format(discrete['single_quotes'] * 100),
'lines': values['double_quotes']['lines'][:],
}
elif not is_single_quote and file_discrete['single_quotes'] > 0.0:
inspections[self.NEED_TO_USE_DOUBLE_QUOTES] = {
'message': self.inspections[self.NEED_TO_USE_DOUBLE_QUOTES].format(discrete['double_quotes'] * 100),
'lines': values['single_quotes']['lines'][:],
}
return inspections
| class Quotestype:
""" Checks whether quotation marks are double or single in source file. """
need_to_use_single_quotes = 'need_to_use_single_quotes'
need_to_use_double_quotes = 'need_to_use_double_quotes'
discrete_groups = [{'name': 'single_quotes'}, {'name': 'double_quotes'}]
inspections = {NEED_TO_USE_SINGLE_QUOTES: 'Mostly single quotes are used in the source code, maybe you need to change double quotes here.', NEED_TO_USE_DOUBLE_QUOTES: 'Mostly double quotes are used in the source code, maybe you need to change single quotes here.'}
def count(self, file, verbose=False):
with open(file) as f:
single_quotes_count = 0
double_quotes_count = 0
single_quotes_lines = []
double_quotes_lines = []
line_number = 0
for line in f.readlines():
line_number += 1
is_single = False
is_double = False
for i in range(len(line)):
if i > 0 and line[i - 1] == '\\':
continue
if line[i] == "'":
if is_double:
continue
if is_single:
single_quotes_count += 1
single_quotes_lines.append(line_number)
is_single = False
else:
is_single = True
if line[i] == '"':
if is_single:
continue
if is_double:
double_quotes_count += 1
double_quotes_lines.append(line_number)
is_double = False
else:
is_double = True
single_quotes_lines.sort()
unique_single_quotes_lines = []
for i in range(len(single_quotes_lines) - 1):
if i == 0 or single_quotes_lines[i] != single_quotes_lines[i - 1]:
unique_single_quotes_lines.append(single_quotes_lines[i])
double_quotes_lines.sort()
unique_double_quotes_lines = []
for i in range(len(double_quotes_lines) - 1):
if i == 0 or double_quotes_lines[i] != double_quotes_lines[i - 1]:
unique_double_quotes_lines.append(double_quotes_lines[i])
result = {'single_quotes': single_quotes_count, 'double_quotes': double_quotes_count}
if verbose:
result['single_quotes'] = {'count': single_quotes_count, 'lines': unique_single_quotes_lines}
result['double_quotes'] = {'count': double_quotes_count, 'lines': unique_double_quotes_lines}
return result
def discretize(self, values):
discrete_values = {}
sum = 0.0
for group in self.discrete_groups:
discrete_values[group['name']] = 0
for (group, count) in values.items():
discrete_values[group] = count
sum += count
for (group, count) in discrete_values.items():
if sum != 0:
discrete_values[group] = count / sum
return discrete_values
def inspect(self, discrete, values):
for_discretization = {}
for (key, value) in values.items():
for_discretization[key] = value['count']
file_discrete = self.discretize(for_discretization)
is_single_quote = False
if discrete['single_quotes'] > discrete['double_quotes']:
is_single_quote = True
inspections = {}
if is_single_quote and file_discrete['double_quotes'] > 0.0:
inspections[self.NEED_TO_USE_SINGLE_QUOTES] = {'message': self.inspections[self.NEED_TO_USE_SINGLE_QUOTES].format(discrete['single_quotes'] * 100), 'lines': values['double_quotes']['lines'][:]}
elif not is_single_quote and file_discrete['single_quotes'] > 0.0:
inspections[self.NEED_TO_USE_DOUBLE_QUOTES] = {'message': self.inspections[self.NEED_TO_USE_DOUBLE_QUOTES].format(discrete['double_quotes'] * 100), 'lines': values['single_quotes']['lines'][:]}
return inspections |
def get_xoutput_ref(self):
"""Return the reference XOutput (or Output) either from xoutput_ref or output_list
Parameters
----------
self : XOutput
A XOutput object
Returns
-------
xoutput_ref: XOutput
reference XOutput (or Output) (if defined)
"""
if self.xoutput_ref_index is not None:
return self.output_list[self.xoutput_ref_index]
else:
return self.xoutput_ref
| def get_xoutput_ref(self):
"""Return the reference XOutput (or Output) either from xoutput_ref or output_list
Parameters
----------
self : XOutput
A XOutput object
Returns
-------
xoutput_ref: XOutput
reference XOutput (or Output) (if defined)
"""
if self.xoutput_ref_index is not None:
return self.output_list[self.xoutput_ref_index]
else:
return self.xoutput_ref |
def constraint_in_set(_set = range(0,128)):
def f(context):
note, seq, tick = context
if seq.to_pitch_set() == {}:
return False
return seq.to_pitch_set().issubset(_set)
return f
def constraint_no_repeated_adjacent_notes():
def f(context):
note, seq, tick = context
return seq[0].pitches[0] != context["previous"][-1].pitches[0]
return f
def constraint_limit_shared_pitches(max_shared=1):
def f(context):
note, seq, tick = context
intersection = set(seq.pitches).intersection(set(context["previous"].pitches))
return len(intersection) <= max_shared
return f
def constraint_enforce_shared_pitches(min_shared=1):
def f(context):
note, seq, tick = context
intersection = set(seq.pitches).intersection(set(context["previous"].pitches))
return len(intersection) >= min_shared
return f
def constraint_no_leaps_more_than(max_int):
def f(context):
note, seq, tick = context
previous_pitch = seq.events[-2].pitches[0]
delta = note - previous_pitch
return abs(delta) <= max_int
return f
def constraint_note_is(tick=0,pitch=0):
def f(context):
event, seq, _tick = context
if _tick != tick:
return True
return event.pitches[0] == pitch
return f
def constraint_voice2_is_lower_than(voice1):
def f(context):
event, seq, tick = context
#print(tick, voice1[tick], note, voice1[tick] >= note)
return voice1[tick].pitches[0] >= event.pitches[0]
return f | def constraint_in_set(_set=range(0, 128)):
def f(context):
(note, seq, tick) = context
if seq.to_pitch_set() == {}:
return False
return seq.to_pitch_set().issubset(_set)
return f
def constraint_no_repeated_adjacent_notes():
def f(context):
(note, seq, tick) = context
return seq[0].pitches[0] != context['previous'][-1].pitches[0]
return f
def constraint_limit_shared_pitches(max_shared=1):
def f(context):
(note, seq, tick) = context
intersection = set(seq.pitches).intersection(set(context['previous'].pitches))
return len(intersection) <= max_shared
return f
def constraint_enforce_shared_pitches(min_shared=1):
def f(context):
(note, seq, tick) = context
intersection = set(seq.pitches).intersection(set(context['previous'].pitches))
return len(intersection) >= min_shared
return f
def constraint_no_leaps_more_than(max_int):
def f(context):
(note, seq, tick) = context
previous_pitch = seq.events[-2].pitches[0]
delta = note - previous_pitch
return abs(delta) <= max_int
return f
def constraint_note_is(tick=0, pitch=0):
def f(context):
(event, seq, _tick) = context
if _tick != tick:
return True
return event.pitches[0] == pitch
return f
def constraint_voice2_is_lower_than(voice1):
def f(context):
(event, seq, tick) = context
return voice1[tick].pitches[0] >= event.pitches[0]
return f |
load("@rules_scala_annex//rules:providers.bzl", "LabeledJars")
def labeled_jars_implementation(target, ctx):
if JavaInfo not in target:
return []
deps_labeled_jars = [dep[LabeledJars] for dep in getattr(ctx.rule.attr, "deps", []) if LabeledJars in dep]
java_info = target[JavaInfo]
return [
LabeledJars(
values = depset(
[struct(label = ctx.label, jars = depset(transitive = [java_info.compile_jars, java_info.full_compile_jars]))],
order = "preorder",
transitive = [labeled_jars.values for labeled_jars in deps_labeled_jars],
),
),
]
| load('@rules_scala_annex//rules:providers.bzl', 'LabeledJars')
def labeled_jars_implementation(target, ctx):
if JavaInfo not in target:
return []
deps_labeled_jars = [dep[LabeledJars] for dep in getattr(ctx.rule.attr, 'deps', []) if LabeledJars in dep]
java_info = target[JavaInfo]
return [labeled_jars(values=depset([struct(label=ctx.label, jars=depset(transitive=[java_info.compile_jars, java_info.full_compile_jars]))], order='preorder', transitive=[labeled_jars.values for labeled_jars in deps_labeled_jars]))] |
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0.html
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
class TableJoiner:
def __init__(self, hive_context, query):
self.query = query
self.hive_context = hive_context
def join_tables(self):
df = self.hive_context.sql(self.query)
return df
| class Tablejoiner:
def __init__(self, hive_context, query):
self.query = query
self.hive_context = hive_context
def join_tables(self):
df = self.hive_context.sql(self.query)
return df |
def check_for_wildcard(policy):
"""
Checks for wildcards in policy statements
"""
# Make sure Statement is a list
if type(policy.policy_json['Statement']) is dict:
policy.policy_json['Statement'] = [ policy.policy_json['Statement'] ]
for sid in policy.policy_json['Statement']:
if 'Action' in sid:
# Action should be a list for easy iteration
if type(sid['Action']) is str:
sid['Action'] = [ sid['Action'] ]
# Check each action in the list if it has a wildcard, add finding if so.
for action in sid['Action']:
if '*' in action:
policy.add_finding('Action_Wildcard', location={"action": action}) | def check_for_wildcard(policy):
"""
Checks for wildcards in policy statements
"""
if type(policy.policy_json['Statement']) is dict:
policy.policy_json['Statement'] = [policy.policy_json['Statement']]
for sid in policy.policy_json['Statement']:
if 'Action' in sid:
if type(sid['Action']) is str:
sid['Action'] = [sid['Action']]
for action in sid['Action']:
if '*' in action:
policy.add_finding('Action_Wildcard', location={'action': action}) |
#Escreva um programa que leia a velocidade de um carro.
velocidade = float(input('Velocidade: '))
# Se ele ultrapassar 80Km/h, mostre uma mensagem dizendo que ele foi multado
if velocidade > 80:
print(f'Passou a {velocidade} numa pista de 80 !!! \nVai pagar R${((velocidade-80)*30):.2f} de multa')
#A multa vai custar R$7,00 por cada Km acima do limite.
else:
print(f'{velocidade}Km. Voce estava dentro do limite de 80Km') | velocidade = float(input('Velocidade: '))
if velocidade > 80:
print(f'Passou a {velocidade} numa pista de 80 !!! \nVai pagar R${(velocidade - 80) * 30:.2f} de multa')
else:
print(f'{velocidade}Km. Voce estava dentro do limite de 80Km') |
# This is the version string assigned to the entire egg post
# setup.py install
__version__ = "0.0.9"
# Ownership and Copyright Information.
__author__ = "Colin Bell <colin.bell@uwaterloo.ca>"
__copyright__ = "Copyright 2011-2014, University of Waterloo"
__license__ = "BSD-new"
| __version__ = '0.0.9'
__author__ = 'Colin Bell <colin.bell@uwaterloo.ca>'
__copyright__ = 'Copyright 2011-2014, University of Waterloo'
__license__ = 'BSD-new' |
#This file was created by Diego Saldana
TITLE = " SUPREME JUMP "
TITLE2 = " GAME OVER FOO :( "
# screen dims
WIDTH = 480
HEIGHT = 600
# frames per second
FPS = 60
# player settings
PLAYER_ACC = 0.5
PLAYER_FRICTION = -0.12
PLAYER_GRAV = 0.8
PLAYER_JUMP = 100
FONT_NAME = 'arcade'
# platform settings
PLATFORM_LIST = [(0, HEIGHT - 40, WIDTH, 40),
(65, HEIGHT - 300, WIDTH-400, 40),
(20, HEIGHT - 350, WIDTH-300, 40),
(200, HEIGHT - 150, WIDTH-350, 40),
(200, HEIGHT - 450, WIDTH-350, 40)]
#colors
WHITE = (255, 255, 255)
GREY = (205,201,201)
BLUE = (175,238,238)
BLACK = (0,0,0)
RED = (178,34,34) | title = ' SUPREME JUMP '
title2 = ' GAME OVER FOO :( '
width = 480
height = 600
fps = 60
player_acc = 0.5
player_friction = -0.12
player_grav = 0.8
player_jump = 100
font_name = 'arcade'
platform_list = [(0, HEIGHT - 40, WIDTH, 40), (65, HEIGHT - 300, WIDTH - 400, 40), (20, HEIGHT - 350, WIDTH - 300, 40), (200, HEIGHT - 150, WIDTH - 350, 40), (200, HEIGHT - 450, WIDTH - 350, 40)]
white = (255, 255, 255)
grey = (205, 201, 201)
blue = (175, 238, 238)
black = (0, 0, 0)
red = (178, 34, 34) |
#
# PySNMP MIB module XYLAN-HEALTH-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/XYLAN-HEALTH-MIB
# Produced by pysmi-0.3.4 at Mon Apr 29 21:38:37 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 (default, Mar 27 2019, 09:23:15)
#
OctetString, ObjectIdentifier, Integer = mibBuilder.importSymbols("ASN1", "OctetString", "ObjectIdentifier", "Integer")
NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues")
ValueSizeConstraint, ConstraintsUnion, ValueRangeConstraint, ConstraintsIntersection, SingleValueConstraint = mibBuilder.importSymbols("ASN1-REFINEMENT", "ValueSizeConstraint", "ConstraintsUnion", "ValueRangeConstraint", "ConstraintsIntersection", "SingleValueConstraint")
ModuleCompliance, NotificationGroup = mibBuilder.importSymbols("SNMPv2-CONF", "ModuleCompliance", "NotificationGroup")
Integer32, ModuleIdentity, iso, MibIdentifier, Counter64, NotificationType, Counter32, Bits, ObjectIdentity, MibScalar, MibTable, MibTableRow, MibTableColumn, IpAddress, Unsigned32, Gauge32, TimeTicks = mibBuilder.importSymbols("SNMPv2-SMI", "Integer32", "ModuleIdentity", "iso", "MibIdentifier", "Counter64", "NotificationType", "Counter32", "Bits", "ObjectIdentity", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "IpAddress", "Unsigned32", "Gauge32", "TimeTicks")
DisplayString, TextualConvention = mibBuilder.importSymbols("SNMPv2-TC", "DisplayString", "TextualConvention")
xylanHealthArch, = mibBuilder.importSymbols("XYLAN-BASE-MIB", "xylanHealthArch")
healthDeviceInfo = MibIdentifier((1, 3, 6, 1, 4, 1, 800, 2, 18, 1))
healthModuleInfo = MibIdentifier((1, 3, 6, 1, 4, 1, 800, 2, 18, 2))
healthPortInfo = MibIdentifier((1, 3, 6, 1, 4, 1, 800, 2, 18, 3))
healthGroupInfo = MibIdentifier((1, 3, 6, 1, 4, 1, 800, 2, 18, 4))
healthControlInfo = MibIdentifier((1, 3, 6, 1, 4, 1, 800, 2, 18, 5))
healthThreshInfo = MibIdentifier((1, 3, 6, 1, 4, 1, 800, 2, 18, 6))
health2DeviceInfo = MibIdentifier((1, 3, 6, 1, 4, 1, 800, 2, 18, 7))
health2ModuleInfo = MibIdentifier((1, 3, 6, 1, 4, 1, 800, 2, 18, 8))
health2PortInfo = MibIdentifier((1, 3, 6, 1, 4, 1, 800, 2, 18, 9))
healthDeviceRxData = MibScalar((1, 3, 6, 1, 4, 1, 800, 2, 18, 1, 1), OctetString().subtype(subtypeSpec=ValueSizeConstraint(4, 4)).setFixedLength(4)).setMaxAccess("readonly")
if mibBuilder.loadTexts: healthDeviceRxData.setStatus('mandatory')
healthDeviceRxTimeDelta = MibScalar((1, 3, 6, 1, 4, 1, 800, 2, 18, 1, 2), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: healthDeviceRxTimeDelta.setStatus('mandatory')
healthDeviceRxTxData = MibScalar((1, 3, 6, 1, 4, 1, 800, 2, 18, 1, 3), OctetString().subtype(subtypeSpec=ValueSizeConstraint(4, 4)).setFixedLength(4)).setMaxAccess("readonly")
if mibBuilder.loadTexts: healthDeviceRxTxData.setStatus('mandatory')
healthDeviceRxTxTimeDelta = MibScalar((1, 3, 6, 1, 4, 1, 800, 2, 18, 1, 4), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: healthDeviceRxTxTimeDelta.setStatus('mandatory')
healthDeviceBackplaneData = MibScalar((1, 3, 6, 1, 4, 1, 800, 2, 18, 1, 5), OctetString().subtype(subtypeSpec=ValueSizeConstraint(4, 4)).setFixedLength(4)).setMaxAccess("readonly")
if mibBuilder.loadTexts: healthDeviceBackplaneData.setStatus('mandatory')
healthDeviceBackplaneTimeDelta = MibScalar((1, 3, 6, 1, 4, 1, 800, 2, 18, 1, 6), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: healthDeviceBackplaneTimeDelta.setStatus('mandatory')
healthDeviceCamData = MibScalar((1, 3, 6, 1, 4, 1, 800, 2, 18, 1, 7), OctetString().subtype(subtypeSpec=ValueSizeConstraint(12, 12)).setFixedLength(12)).setMaxAccess("readonly")
if mibBuilder.loadTexts: healthDeviceCamData.setStatus('mandatory')
healthDeviceCamTimeDelta = MibScalar((1, 3, 6, 1, 4, 1, 800, 2, 18, 1, 8), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: healthDeviceCamTimeDelta.setStatus('mandatory')
healthDeviceMemoryData = MibScalar((1, 3, 6, 1, 4, 1, 800, 2, 18, 1, 9), OctetString().subtype(subtypeSpec=ValueSizeConstraint(12, 12)).setFixedLength(12)).setMaxAccess("readonly")
if mibBuilder.loadTexts: healthDeviceMemoryData.setStatus('mandatory')
healthDeviceMemoryTimeDelta = MibScalar((1, 3, 6, 1, 4, 1, 800, 2, 18, 1, 10), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: healthDeviceMemoryTimeDelta.setStatus('mandatory')
healthDeviceCpuData = MibScalar((1, 3, 6, 1, 4, 1, 800, 2, 18, 1, 11), OctetString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: healthDeviceCpuData.setStatus('mandatory')
healthDeviceCpuTimeDelta = MibScalar((1, 3, 6, 1, 4, 1, 800, 2, 18, 1, 12), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: healthDeviceCpuTimeDelta.setStatus('mandatory')
healthDeviceNumCpus = MibScalar((1, 3, 6, 1, 4, 1, 800, 2, 18, 1, 13), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: healthDeviceNumCpus.setStatus('mandatory')
healthDeviceMemoryTotal = MibScalar((1, 3, 6, 1, 4, 1, 800, 2, 18, 1, 14), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: healthDeviceMemoryTotal.setStatus('mandatory')
healthDeviceMemoryFree = MibScalar((1, 3, 6, 1, 4, 1, 800, 2, 18, 1, 15), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: healthDeviceMemoryFree.setStatus('mandatory')
healthDeviceMpmCamTotal = MibScalar((1, 3, 6, 1, 4, 1, 800, 2, 18, 1, 16), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: healthDeviceMpmCamTotal.setStatus('mandatory')
healthDeviceMpmCamFree = MibScalar((1, 3, 6, 1, 4, 1, 800, 2, 18, 1, 17), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: healthDeviceMpmCamFree.setStatus('mandatory')
healthDeviceHreCamTotal = MibScalar((1, 3, 6, 1, 4, 1, 800, 2, 18, 1, 18), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: healthDeviceHreCamTotal.setStatus('mandatory')
healthDeviceHreCamFree = MibScalar((1, 3, 6, 1, 4, 1, 800, 2, 18, 1, 19), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: healthDeviceHreCamFree.setStatus('mandatory')
healthDeviceTemp = MibScalar((1, 3, 6, 1, 4, 1, 800, 2, 18, 1, 20), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: healthDeviceTemp.setStatus('mandatory')
healthDeviceIPRouteCacheFlushCount = MibScalar((1, 3, 6, 1, 4, 1, 800, 2, 18, 1, 21), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: healthDeviceIPRouteCacheFlushCount.setStatus('mandatory')
healthDeviceIPXRouteCacheFlushCount = MibScalar((1, 3, 6, 1, 4, 1, 800, 2, 18, 1, 22), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: healthDeviceIPXRouteCacheFlushCount.setStatus('mandatory')
healthDeviceMpmRxOverrunCount = MibScalar((1, 3, 6, 1, 4, 1, 800, 2, 18, 1, 23), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: healthDeviceMpmRxOverrunCount.setStatus('mandatory')
healthDeviceMpmTxOverrunCount = MibScalar((1, 3, 6, 1, 4, 1, 800, 2, 18, 1, 24), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: healthDeviceMpmTxOverrunCount.setStatus('mandatory')
healthDeviceVccData = MibScalar((1, 3, 6, 1, 4, 1, 800, 2, 18, 1, 25), OctetString().subtype(subtypeSpec=ValueSizeConstraint(4, 4)).setFixedLength(4)).setMaxAccess("readonly")
if mibBuilder.loadTexts: healthDeviceVccData.setStatus('mandatory')
healthDeviceVccTimeDelta = MibScalar((1, 3, 6, 1, 4, 1, 800, 2, 18, 1, 26), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: healthDeviceVccTimeDelta.setStatus('mandatory')
healthDeviceTemperatureData = MibScalar((1, 3, 6, 1, 4, 1, 800, 2, 18, 1, 27), OctetString().subtype(subtypeSpec=ValueSizeConstraint(4, 4)).setFixedLength(4)).setMaxAccess("readonly")
if mibBuilder.loadTexts: healthDeviceTemperatureData.setStatus('mandatory')
healthDeviceTemperatureTimeDelta = MibScalar((1, 3, 6, 1, 4, 1, 800, 2, 18, 1, 28), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: healthDeviceTemperatureTimeDelta.setStatus('mandatory')
healthDeviceVpData = MibScalar((1, 3, 6, 1, 4, 1, 800, 2, 18, 1, 29), OctetString().subtype(subtypeSpec=ValueSizeConstraint(4, 4)).setFixedLength(4)).setMaxAccess("readonly")
if mibBuilder.loadTexts: healthDeviceVpData.setStatus('mandatory')
healthDeviceVpTimeDelta = MibScalar((1, 3, 6, 1, 4, 1, 800, 2, 18, 1, 30), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: healthDeviceVpTimeDelta.setStatus('mandatory')
healthDeviceHreCollisionTotal = MibScalar((1, 3, 6, 1, 4, 1, 800, 2, 18, 1, 31), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: healthDeviceHreCollisionTotal.setStatus('mandatory')
healthDeviceHreCollisionFree = MibScalar((1, 3, 6, 1, 4, 1, 800, 2, 18, 1, 32), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: healthDeviceHreCollisionFree.setStatus('mandatory')
healthModuleTable = MibTable((1, 3, 6, 1, 4, 1, 800, 2, 18, 2, 1), )
if mibBuilder.loadTexts: healthModuleTable.setStatus('mandatory')
healthModuleEntry = MibTableRow((1, 3, 6, 1, 4, 1, 800, 2, 18, 2, 1, 1), ).setIndexNames((0, "XYLAN-HEALTH-MIB", "healthModuleSlot"))
if mibBuilder.loadTexts: healthModuleEntry.setStatus('mandatory')
healthModuleSlot = MibTableColumn((1, 3, 6, 1, 4, 1, 800, 2, 18, 2, 1, 1, 1), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: healthModuleSlot.setStatus('mandatory')
healthModuleRxData = MibTableColumn((1, 3, 6, 1, 4, 1, 800, 2, 18, 2, 1, 1, 2), OctetString().subtype(subtypeSpec=ValueSizeConstraint(4, 4)).setFixedLength(4)).setMaxAccess("readonly")
if mibBuilder.loadTexts: healthModuleRxData.setStatus('mandatory')
healthModuleRxTimeDelta = MibTableColumn((1, 3, 6, 1, 4, 1, 800, 2, 18, 2, 1, 1, 3), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: healthModuleRxTimeDelta.setStatus('mandatory')
healthModuleRxTxData = MibTableColumn((1, 3, 6, 1, 4, 1, 800, 2, 18, 2, 1, 1, 4), OctetString().subtype(subtypeSpec=ValueSizeConstraint(4, 4)).setFixedLength(4)).setMaxAccess("readonly")
if mibBuilder.loadTexts: healthModuleRxTxData.setStatus('mandatory')
healthModuleRxTxTimeDelta = MibTableColumn((1, 3, 6, 1, 4, 1, 800, 2, 18, 2, 1, 1, 5), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: healthModuleRxTxTimeDelta.setStatus('mandatory')
healthModuleBackplaneData = MibTableColumn((1, 3, 6, 1, 4, 1, 800, 2, 18, 2, 1, 1, 6), OctetString().subtype(subtypeSpec=ValueSizeConstraint(4, 4)).setFixedLength(4)).setMaxAccess("readonly")
if mibBuilder.loadTexts: healthModuleBackplaneData.setStatus('mandatory')
healthModuleBackplaneTimeDelta = MibTableColumn((1, 3, 6, 1, 4, 1, 800, 2, 18, 2, 1, 1, 7), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: healthModuleBackplaneTimeDelta.setStatus('mandatory')
healthModuleCamData = MibTableColumn((1, 3, 6, 1, 4, 1, 800, 2, 18, 2, 1, 1, 8), OctetString().subtype(subtypeSpec=ValueSizeConstraint(4, 4)).setFixedLength(4)).setMaxAccess("readonly")
if mibBuilder.loadTexts: healthModuleCamData.setStatus('mandatory')
healthModuleCamTimeDelta = MibTableColumn((1, 3, 6, 1, 4, 1, 800, 2, 18, 2, 1, 1, 9), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: healthModuleCamTimeDelta.setStatus('mandatory')
healthModuleCamNumInstalled = MibTableColumn((1, 3, 6, 1, 4, 1, 800, 2, 18, 2, 1, 1, 10), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: healthModuleCamNumInstalled.setStatus('mandatory')
healthModuleCamConfigured = MibTableColumn((1, 3, 6, 1, 4, 1, 800, 2, 18, 2, 1, 1, 11), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: healthModuleCamConfigured.setStatus('mandatory')
healthModuleCamAvail = MibTableColumn((1, 3, 6, 1, 4, 1, 800, 2, 18, 2, 1, 1, 12), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: healthModuleCamAvail.setStatus('mandatory')
healthModuleCamAvailNonIntern = MibTableColumn((1, 3, 6, 1, 4, 1, 800, 2, 18, 2, 1, 1, 13), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: healthModuleCamAvailNonIntern.setStatus('mandatory')
healthModuleCamFree = MibTableColumn((1, 3, 6, 1, 4, 1, 800, 2, 18, 2, 1, 1, 14), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: healthModuleCamFree.setStatus('mandatory')
healthModuleVccData = MibTableColumn((1, 3, 6, 1, 4, 1, 800, 2, 18, 2, 1, 1, 15), OctetString().subtype(subtypeSpec=ValueSizeConstraint(4, 4)).setFixedLength(4)).setMaxAccess("readonly")
if mibBuilder.loadTexts: healthModuleVccData.setStatus('mandatory')
healthModuleVccTimeDelta = MibTableColumn((1, 3, 6, 1, 4, 1, 800, 2, 18, 2, 1, 1, 16), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: healthModuleVccTimeDelta.setStatus('mandatory')
healthSamplingInterval = MibScalar((1, 3, 6, 1, 4, 1, 800, 2, 18, 5, 1), Integer32()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: healthSamplingInterval.setStatus('mandatory')
healthSamplingReset = MibScalar((1, 3, 6, 1, 4, 1, 800, 2, 18, 5, 2), Integer32()).setMaxAccess("writeonly")
if mibBuilder.loadTexts: healthSamplingReset.setStatus('mandatory')
healthThreshDeviceRxLimit = MibScalar((1, 3, 6, 1, 4, 1, 800, 2, 18, 6, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 100))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: healthThreshDeviceRxLimit.setStatus('mandatory')
healthThreshDeviceRxTxLimit = MibScalar((1, 3, 6, 1, 4, 1, 800, 2, 18, 6, 2), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 100))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: healthThreshDeviceRxTxLimit.setStatus('mandatory')
healthThreshDeviceBackplaneLimit = MibScalar((1, 3, 6, 1, 4, 1, 800, 2, 18, 6, 3), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 100))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: healthThreshDeviceBackplaneLimit.setStatus('mandatory')
healthThreshDeviceCamLimit = MibScalar((1, 3, 6, 1, 4, 1, 800, 2, 18, 6, 4), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 100))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: healthThreshDeviceCamLimit.setStatus('mandatory')
healthThreshDeviceMemoryLimit = MibScalar((1, 3, 6, 1, 4, 1, 800, 2, 18, 6, 5), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 100))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: healthThreshDeviceMemoryLimit.setStatus('mandatory')
healthThreshDeviceCpuLimit = MibScalar((1, 3, 6, 1, 4, 1, 800, 2, 18, 6, 6), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 100))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: healthThreshDeviceCpuLimit.setStatus('mandatory')
healthThreshDeviceSummary = MibScalar((1, 3, 6, 1, 4, 1, 800, 2, 18, 6, 7), OctetString().subtype(subtypeSpec=ValueSizeConstraint(27, 27)).setFixedLength(27)).setMaxAccess("readonly")
if mibBuilder.loadTexts: healthThreshDeviceSummary.setStatus('mandatory')
healthThreshModuleSummaryTable = MibTable((1, 3, 6, 1, 4, 1, 800, 2, 18, 6, 8), )
if mibBuilder.loadTexts: healthThreshModuleSummaryTable.setStatus('mandatory')
healthThreshModuleSummaryEntry = MibTableRow((1, 3, 6, 1, 4, 1, 800, 2, 18, 6, 8, 1), ).setIndexNames((0, "XYLAN-HEALTH-MIB", "healthThreshModuleSummarySlot"))
if mibBuilder.loadTexts: healthThreshModuleSummaryEntry.setStatus('mandatory')
healthThreshModuleSummarySlot = MibTableColumn((1, 3, 6, 1, 4, 1, 800, 2, 18, 6, 8, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 9))).setMaxAccess("readonly")
if mibBuilder.loadTexts: healthThreshModuleSummarySlot.setStatus('mandatory')
healthThreshModuleSummaryData = MibTableColumn((1, 3, 6, 1, 4, 1, 800, 2, 18, 6, 8, 1, 2), OctetString().subtype(subtypeSpec=ValueSizeConstraint(16, 16)).setFixedLength(16)).setMaxAccess("readonly")
if mibBuilder.loadTexts: healthThreshModuleSummaryData.setStatus('mandatory')
healthThreshDevTrapData = MibScalar((1, 3, 6, 1, 4, 1, 800, 2, 18, 6, 9), OctetString().subtype(subtypeSpec=ValueSizeConstraint(0, 21)))
if mibBuilder.loadTexts: healthThreshDevTrapData.setStatus('mandatory')
healthThreshModTrapCount = MibScalar((1, 3, 6, 1, 4, 1, 800, 2, 18, 6, 10), Integer32())
if mibBuilder.loadTexts: healthThreshModTrapCount.setStatus('mandatory')
healthThreshModTrapData = MibScalar((1, 3, 6, 1, 4, 1, 800, 2, 18, 6, 11), OctetString().subtype(subtypeSpec=ValueSizeConstraint(0, 128)))
if mibBuilder.loadTexts: healthThreshModTrapData.setStatus('mandatory')
healthThreshPortSummaryTable = MibTable((1, 3, 6, 1, 4, 1, 800, 2, 18, 6, 12), )
if mibBuilder.loadTexts: healthThreshPortSummaryTable.setStatus('mandatory')
healthThreshPortSummaryEntry = MibTableRow((1, 3, 6, 1, 4, 1, 800, 2, 18, 6, 12, 1), ).setIndexNames((0, "XYLAN-HEALTH-MIB", "healthThreshPortSummarySlot"), (0, "XYLAN-HEALTH-MIB", "healthThreshPortSummaryIF"))
if mibBuilder.loadTexts: healthThreshPortSummaryEntry.setStatus('mandatory')
healthThreshPortSummarySlot = MibTableColumn((1, 3, 6, 1, 4, 1, 800, 2, 18, 6, 12, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 9))).setMaxAccess("readonly")
if mibBuilder.loadTexts: healthThreshPortSummarySlot.setStatus('mandatory')
healthThreshPortSummaryIF = MibTableColumn((1, 3, 6, 1, 4, 1, 800, 2, 18, 6, 12, 1, 2), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 9))).setMaxAccess("readonly")
if mibBuilder.loadTexts: healthThreshPortSummaryIF.setStatus('mandatory')
healthThreshPortSummaryData = MibTableColumn((1, 3, 6, 1, 4, 1, 800, 2, 18, 6, 12, 1, 3), OctetString().subtype(subtypeSpec=ValueSizeConstraint(13, 13)).setFixedLength(13)).setMaxAccess("readonly")
if mibBuilder.loadTexts: healthThreshPortSummaryData.setStatus('mandatory')
healthThreshPortTrapSlot = MibScalar((1, 3, 6, 1, 4, 1, 800, 2, 18, 6, 13), Integer32())
if mibBuilder.loadTexts: healthThreshPortTrapSlot.setStatus('mandatory')
healthThreshPortTrapCount = MibScalar((1, 3, 6, 1, 4, 1, 800, 2, 18, 6, 14), Integer32())
if mibBuilder.loadTexts: healthThreshPortTrapCount.setStatus('mandatory')
healthThreshPortTrapData = MibScalar((1, 3, 6, 1, 4, 1, 800, 2, 18, 6, 15), OctetString().subtype(subtypeSpec=ValueSizeConstraint(0, 255)))
if mibBuilder.loadTexts: healthThreshPortTrapData.setStatus('mandatory')
healthThreshDeviceVccLimit = MibScalar((1, 3, 6, 1, 4, 1, 800, 2, 18, 6, 16), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 100))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: healthThreshDeviceVccLimit.setStatus('mandatory')
healthThreshDeviceTemperatureLimit = MibScalar((1, 3, 6, 1, 4, 1, 800, 2, 18, 6, 17), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 100))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: healthThreshDeviceTemperatureLimit.setStatus('mandatory')
healthThreshDeviceVpLimit = MibScalar((1, 3, 6, 1, 4, 1, 800, 2, 18, 6, 18), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 100))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: healthThreshDeviceVpLimit.setStatus('mandatory')
healthPortMax = MibScalar((1, 3, 6, 1, 4, 1, 800, 2, 18, 3, 1), OctetString().subtype(subtypeSpec=ValueSizeConstraint(21, 21)).setFixedLength(21)).setMaxAccess("readonly")
if mibBuilder.loadTexts: healthPortMax.setStatus('mandatory')
class HealthPortUpDownStatus(Integer32):
subtypeSpec = Integer32.subtypeSpec + ConstraintsUnion(SingleValueConstraint(1, 2))
namedValues = NamedValues(("healthPortDn", 1), ("healthPortUp", 2))
healthPortTable = MibTable((1, 3, 6, 1, 4, 1, 800, 2, 18, 3, 2), )
if mibBuilder.loadTexts: healthPortTable.setStatus('mandatory')
healthPortEntry = MibTableRow((1, 3, 6, 1, 4, 1, 800, 2, 18, 3, 2, 1), ).setIndexNames((0, "XYLAN-HEALTH-MIB", "healthPortSlot"), (0, "XYLAN-HEALTH-MIB", "healthPortIF"))
if mibBuilder.loadTexts: healthPortEntry.setStatus('mandatory')
healthPortSlot = MibTableColumn((1, 3, 6, 1, 4, 1, 800, 2, 18, 3, 2, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 9))).setMaxAccess("readonly")
if mibBuilder.loadTexts: healthPortSlot.setStatus('mandatory')
healthPortIF = MibTableColumn((1, 3, 6, 1, 4, 1, 800, 2, 18, 3, 2, 1, 2), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: healthPortIF.setStatus('mandatory')
healthPortUpDn = MibTableColumn((1, 3, 6, 1, 4, 1, 800, 2, 18, 3, 2, 1, 3), HealthPortUpDownStatus()).setMaxAccess("readonly")
if mibBuilder.loadTexts: healthPortUpDn.setStatus('mandatory')
healthPortRxData = MibTableColumn((1, 3, 6, 1, 4, 1, 800, 2, 18, 3, 2, 1, 4), OctetString().subtype(subtypeSpec=ValueSizeConstraint(4, 4)).setFixedLength(4)).setMaxAccess("readonly")
if mibBuilder.loadTexts: healthPortRxData.setStatus('mandatory')
healthPortRxTimeDelta = MibTableColumn((1, 3, 6, 1, 4, 1, 800, 2, 18, 3, 2, 1, 5), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: healthPortRxTimeDelta.setStatus('mandatory')
healthPortRxTxData = MibTableColumn((1, 3, 6, 1, 4, 1, 800, 2, 18, 3, 2, 1, 6), OctetString().subtype(subtypeSpec=ValueSizeConstraint(4, 4)).setFixedLength(4)).setMaxAccess("readonly")
if mibBuilder.loadTexts: healthPortRxTxData.setStatus('mandatory')
healthPortRxTxTimeDelta = MibTableColumn((1, 3, 6, 1, 4, 1, 800, 2, 18, 3, 2, 1, 7), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: healthPortRxTxTimeDelta.setStatus('mandatory')
healthPortBackplaneData = MibTableColumn((1, 3, 6, 1, 4, 1, 800, 2, 18, 3, 2, 1, 8), OctetString().subtype(subtypeSpec=ValueSizeConstraint(4, 4)).setFixedLength(4)).setMaxAccess("readonly")
if mibBuilder.loadTexts: healthPortBackplaneData.setStatus('mandatory')
healthPortBackplaneTimeDelta = MibTableColumn((1, 3, 6, 1, 4, 1, 800, 2, 18, 3, 2, 1, 9), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: healthPortBackplaneTimeDelta.setStatus('mandatory')
healthPortVccData = MibTableColumn((1, 3, 6, 1, 4, 1, 800, 2, 18, 3, 2, 1, 10), OctetString().subtype(subtypeSpec=ValueSizeConstraint(4, 4)).setFixedLength(4)).setMaxAccess("readonly")
if mibBuilder.loadTexts: healthPortVccData.setStatus('mandatory')
healthPortVccTimeDelta = MibTableColumn((1, 3, 6, 1, 4, 1, 800, 2, 18, 3, 2, 1, 11), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: healthPortVccTimeDelta.setStatus('mandatory')
health2DeviceRxLatest = MibScalar((1, 3, 6, 1, 4, 1, 800, 2, 18, 7, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 100))).setMaxAccess("readonly")
if mibBuilder.loadTexts: health2DeviceRxLatest.setStatus('mandatory')
health2DeviceRx1MinAvg = MibScalar((1, 3, 6, 1, 4, 1, 800, 2, 18, 7, 2), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 100))).setMaxAccess("readonly")
if mibBuilder.loadTexts: health2DeviceRx1MinAvg.setStatus('mandatory')
health2DeviceRx1HrAvg = MibScalar((1, 3, 6, 1, 4, 1, 800, 2, 18, 7, 3), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 100))).setMaxAccess("readonly")
if mibBuilder.loadTexts: health2DeviceRx1HrAvg.setStatus('mandatory')
health2DeviceRx1HrMax = MibScalar((1, 3, 6, 1, 4, 1, 800, 2, 18, 7, 4), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 100))).setMaxAccess("readonly")
if mibBuilder.loadTexts: health2DeviceRx1HrMax.setStatus('mandatory')
health2DeviceRxTxLatest = MibScalar((1, 3, 6, 1, 4, 1, 800, 2, 18, 7, 5), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 100))).setMaxAccess("readonly")
if mibBuilder.loadTexts: health2DeviceRxTxLatest.setStatus('mandatory')
health2DeviceRxTx1MinAvg = MibScalar((1, 3, 6, 1, 4, 1, 800, 2, 18, 7, 6), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 100))).setMaxAccess("readonly")
if mibBuilder.loadTexts: health2DeviceRxTx1MinAvg.setStatus('mandatory')
health2DeviceRxTx1HrAvg = MibScalar((1, 3, 6, 1, 4, 1, 800, 2, 18, 7, 7), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 100))).setMaxAccess("readonly")
if mibBuilder.loadTexts: health2DeviceRxTx1HrAvg.setStatus('mandatory')
health2DeviceRxTx1HrMax = MibScalar((1, 3, 6, 1, 4, 1, 800, 2, 18, 7, 8), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 100))).setMaxAccess("readonly")
if mibBuilder.loadTexts: health2DeviceRxTx1HrMax.setStatus('mandatory')
health2DeviceBackplaneLatest = MibScalar((1, 3, 6, 1, 4, 1, 800, 2, 18, 7, 9), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 100))).setMaxAccess("readonly")
if mibBuilder.loadTexts: health2DeviceBackplaneLatest.setStatus('mandatory')
health2DeviceBackplane1MinAvg = MibScalar((1, 3, 6, 1, 4, 1, 800, 2, 18, 7, 10), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 100))).setMaxAccess("readonly")
if mibBuilder.loadTexts: health2DeviceBackplane1MinAvg.setStatus('mandatory')
health2DeviceBackplane1HrAvg = MibScalar((1, 3, 6, 1, 4, 1, 800, 2, 18, 7, 11), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 100))).setMaxAccess("readonly")
if mibBuilder.loadTexts: health2DeviceBackplane1HrAvg.setStatus('mandatory')
health2DeviceBackplane1HrMax = MibScalar((1, 3, 6, 1, 4, 1, 800, 2, 18, 7, 12), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 100))).setMaxAccess("readonly")
if mibBuilder.loadTexts: health2DeviceBackplane1HrMax.setStatus('mandatory')
health2DeviceMpmCamLatest = MibScalar((1, 3, 6, 1, 4, 1, 800, 2, 18, 7, 13), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 100))).setMaxAccess("readonly")
if mibBuilder.loadTexts: health2DeviceMpmCamLatest.setStatus('mandatory')
health2DeviceMpmCam1MinAvg = MibScalar((1, 3, 6, 1, 4, 1, 800, 2, 18, 7, 14), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 100))).setMaxAccess("readonly")
if mibBuilder.loadTexts: health2DeviceMpmCam1MinAvg.setStatus('mandatory')
health2DeviceMpmCam1HrAvg = MibScalar((1, 3, 6, 1, 4, 1, 800, 2, 18, 7, 15), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 100))).setMaxAccess("readonly")
if mibBuilder.loadTexts: health2DeviceMpmCam1HrAvg.setStatus('mandatory')
health2DeviceMpmCam1HrMax = MibScalar((1, 3, 6, 1, 4, 1, 800, 2, 18, 7, 16), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 100))).setMaxAccess("readonly")
if mibBuilder.loadTexts: health2DeviceMpmCam1HrMax.setStatus('mandatory')
health2DeviceHreCamLatest = MibScalar((1, 3, 6, 1, 4, 1, 800, 2, 18, 7, 17), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 100))).setMaxAccess("readonly")
if mibBuilder.loadTexts: health2DeviceHreCamLatest.setStatus('mandatory')
health2DeviceHreCam1MinAvg = MibScalar((1, 3, 6, 1, 4, 1, 800, 2, 18, 7, 18), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 100))).setMaxAccess("readonly")
if mibBuilder.loadTexts: health2DeviceHreCam1MinAvg.setStatus('mandatory')
health2DeviceHreCam1HrAvg = MibScalar((1, 3, 6, 1, 4, 1, 800, 2, 18, 7, 19), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 100))).setMaxAccess("readonly")
if mibBuilder.loadTexts: health2DeviceHreCam1HrAvg.setStatus('mandatory')
health2DeviceHreCam1HrMax = MibScalar((1, 3, 6, 1, 4, 1, 800, 2, 18, 7, 20), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 100))).setMaxAccess("readonly")
if mibBuilder.loadTexts: health2DeviceHreCam1HrMax.setStatus('mandatory')
health2DeviceMemoryLatest = MibScalar((1, 3, 6, 1, 4, 1, 800, 2, 18, 7, 21), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 100))).setMaxAccess("readonly")
if mibBuilder.loadTexts: health2DeviceMemoryLatest.setStatus('mandatory')
health2DeviceMemory1MinAvg = MibScalar((1, 3, 6, 1, 4, 1, 800, 2, 18, 7, 22), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 100))).setMaxAccess("readonly")
if mibBuilder.loadTexts: health2DeviceMemory1MinAvg.setStatus('mandatory')
health2DeviceMemory1HrAvg = MibScalar((1, 3, 6, 1, 4, 1, 800, 2, 18, 7, 23), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 100))).setMaxAccess("readonly")
if mibBuilder.loadTexts: health2DeviceMemory1HrAvg.setStatus('mandatory')
health2DeviceMemory1HrMax = MibScalar((1, 3, 6, 1, 4, 1, 800, 2, 18, 7, 24), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 100))).setMaxAccess("readonly")
if mibBuilder.loadTexts: health2DeviceMemory1HrMax.setStatus('mandatory')
health2DeviceNumCpus = MibScalar((1, 3, 6, 1, 4, 1, 800, 2, 18, 7, 25), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: health2DeviceNumCpus.setStatus('mandatory')
health2DeviceCpuTable = MibTable((1, 3, 6, 1, 4, 1, 800, 2, 18, 7, 26), )
if mibBuilder.loadTexts: health2DeviceCpuTable.setStatus('mandatory')
health2DeviceCpuEntry = MibTableRow((1, 3, 6, 1, 4, 1, 800, 2, 18, 7, 26, 1), ).setIndexNames((0, "XYLAN-HEALTH-MIB", "health2DeviceCpuNum"))
if mibBuilder.loadTexts: health2DeviceCpuEntry.setStatus('mandatory')
health2DeviceCpuNum = MibTableColumn((1, 3, 6, 1, 4, 1, 800, 2, 18, 7, 26, 1, 1), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: health2DeviceCpuNum.setStatus('mandatory')
health2DeviceCpuLatest = MibTableColumn((1, 3, 6, 1, 4, 1, 800, 2, 18, 7, 26, 1, 2), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 100))).setMaxAccess("readonly")
if mibBuilder.loadTexts: health2DeviceCpuLatest.setStatus('mandatory')
health2DeviceCpu1MinAvg = MibTableColumn((1, 3, 6, 1, 4, 1, 800, 2, 18, 7, 26, 1, 3), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 100))).setMaxAccess("readonly")
if mibBuilder.loadTexts: health2DeviceCpu1MinAvg.setStatus('mandatory')
health2DeviceCpu1HrAvg = MibTableColumn((1, 3, 6, 1, 4, 1, 800, 2, 18, 7, 26, 1, 4), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 100))).setMaxAccess("readonly")
if mibBuilder.loadTexts: health2DeviceCpu1HrAvg.setStatus('mandatory')
health2DeviceCpu1HrMax = MibTableColumn((1, 3, 6, 1, 4, 1, 800, 2, 18, 7, 26, 1, 5), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 100))).setMaxAccess("readonly")
if mibBuilder.loadTexts: health2DeviceCpu1HrMax.setStatus('mandatory')
health2DeviceVccLatest = MibScalar((1, 3, 6, 1, 4, 1, 800, 2, 18, 7, 27), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 100))).setMaxAccess("readonly")
if mibBuilder.loadTexts: health2DeviceVccLatest.setStatus('mandatory')
health2DeviceVcc1MinAvg = MibScalar((1, 3, 6, 1, 4, 1, 800, 2, 18, 7, 28), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 100))).setMaxAccess("readonly")
if mibBuilder.loadTexts: health2DeviceVcc1MinAvg.setStatus('mandatory')
health2DeviceVcc1HrAvg = MibScalar((1, 3, 6, 1, 4, 1, 800, 2, 18, 7, 29), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 100))).setMaxAccess("readonly")
if mibBuilder.loadTexts: health2DeviceVcc1HrAvg.setStatus('mandatory')
health2DeviceVcc1HrMax = MibScalar((1, 3, 6, 1, 4, 1, 800, 2, 18, 7, 30), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 100))).setMaxAccess("readonly")
if mibBuilder.loadTexts: health2DeviceVcc1HrMax.setStatus('mandatory')
health2DeviceTemperatureLatest = MibScalar((1, 3, 6, 1, 4, 1, 800, 2, 18, 7, 31), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 100))).setMaxAccess("readonly")
if mibBuilder.loadTexts: health2DeviceTemperatureLatest.setStatus('mandatory')
health2DeviceTemperature1MinAvg = MibScalar((1, 3, 6, 1, 4, 1, 800, 2, 18, 7, 32), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 100))).setMaxAccess("readonly")
if mibBuilder.loadTexts: health2DeviceTemperature1MinAvg.setStatus('mandatory')
health2DeviceTemperature1HrAvg = MibScalar((1, 3, 6, 1, 4, 1, 800, 2, 18, 7, 33), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 100))).setMaxAccess("readonly")
if mibBuilder.loadTexts: health2DeviceTemperature1HrAvg.setStatus('mandatory')
health2DeviceTemperature1HrMax = MibScalar((1, 3, 6, 1, 4, 1, 800, 2, 18, 7, 34), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 100))).setMaxAccess("readonly")
if mibBuilder.loadTexts: health2DeviceTemperature1HrMax.setStatus('mandatory')
health2DeviceVpLatest = MibScalar((1, 3, 6, 1, 4, 1, 800, 2, 18, 7, 35), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 100))).setMaxAccess("readonly")
if mibBuilder.loadTexts: health2DeviceVpLatest.setStatus('mandatory')
health2DeviceVp1MinAvg = MibScalar((1, 3, 6, 1, 4, 1, 800, 2, 18, 7, 36), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 100))).setMaxAccess("readonly")
if mibBuilder.loadTexts: health2DeviceVp1MinAvg.setStatus('mandatory')
health2DeviceVp1HrAvg = MibScalar((1, 3, 6, 1, 4, 1, 800, 2, 18, 7, 37), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 100))).setMaxAccess("readonly")
if mibBuilder.loadTexts: health2DeviceVp1HrAvg.setStatus('mandatory')
health2DeviceVp1HrMax = MibScalar((1, 3, 6, 1, 4, 1, 800, 2, 18, 7, 38), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 100))).setMaxAccess("readonly")
if mibBuilder.loadTexts: health2DeviceVp1HrMax.setStatus('mandatory')
health2DeviceHreCollisionLatest = MibScalar((1, 3, 6, 1, 4, 1, 800, 2, 18, 7, 39), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 100))).setMaxAccess("readonly")
if mibBuilder.loadTexts: health2DeviceHreCollisionLatest.setStatus('mandatory')
health2DeviceHreCollision1MinAvg = MibScalar((1, 3, 6, 1, 4, 1, 800, 2, 18, 7, 40), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 100))).setMaxAccess("readonly")
if mibBuilder.loadTexts: health2DeviceHreCollision1MinAvg.setStatus('mandatory')
health2DeviceHreCollision1HrAvg = MibScalar((1, 3, 6, 1, 4, 1, 800, 2, 18, 7, 41), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 100))).setMaxAccess("readonly")
if mibBuilder.loadTexts: health2DeviceHreCollision1HrAvg.setStatus('mandatory')
health2DeviceHreCollision1HrMax = MibScalar((1, 3, 6, 1, 4, 1, 800, 2, 18, 7, 42), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 100))).setMaxAccess("readonly")
if mibBuilder.loadTexts: health2DeviceHreCollision1HrMax.setStatus('mandatory')
health2ModuleTable = MibTable((1, 3, 6, 1, 4, 1, 800, 2, 18, 8, 1), )
if mibBuilder.loadTexts: health2ModuleTable.setStatus('mandatory')
health2ModuleEntry = MibTableRow((1, 3, 6, 1, 4, 1, 800, 2, 18, 8, 1, 1), ).setIndexNames((0, "XYLAN-HEALTH-MIB", "health2ModuleSlot"))
if mibBuilder.loadTexts: health2ModuleEntry.setStatus('mandatory')
health2ModuleSlot = MibTableColumn((1, 3, 6, 1, 4, 1, 800, 2, 18, 8, 1, 1, 1), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: health2ModuleSlot.setStatus('mandatory')
health2ModuleRxLatest = MibTableColumn((1, 3, 6, 1, 4, 1, 800, 2, 18, 8, 1, 1, 2), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 100))).setMaxAccess("readonly")
if mibBuilder.loadTexts: health2ModuleRxLatest.setStatus('mandatory')
health2ModuleRx1MinAvg = MibTableColumn((1, 3, 6, 1, 4, 1, 800, 2, 18, 8, 1, 1, 3), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 100))).setMaxAccess("readonly")
if mibBuilder.loadTexts: health2ModuleRx1MinAvg.setStatus('mandatory')
health2ModuleRx1HrAvg = MibTableColumn((1, 3, 6, 1, 4, 1, 800, 2, 18, 8, 1, 1, 4), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 100))).setMaxAccess("readonly")
if mibBuilder.loadTexts: health2ModuleRx1HrAvg.setStatus('mandatory')
health2ModuleRx1HrMax = MibTableColumn((1, 3, 6, 1, 4, 1, 800, 2, 18, 8, 1, 1, 5), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 100))).setMaxAccess("readonly")
if mibBuilder.loadTexts: health2ModuleRx1HrMax.setStatus('mandatory')
health2ModuleRxTxLatest = MibTableColumn((1, 3, 6, 1, 4, 1, 800, 2, 18, 8, 1, 1, 6), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 100))).setMaxAccess("readonly")
if mibBuilder.loadTexts: health2ModuleRxTxLatest.setStatus('mandatory')
health2ModuleRxTx1MinAvg = MibTableColumn((1, 3, 6, 1, 4, 1, 800, 2, 18, 8, 1, 1, 7), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 100))).setMaxAccess("readonly")
if mibBuilder.loadTexts: health2ModuleRxTx1MinAvg.setStatus('mandatory')
health2ModuleRxTx1HrAvg = MibTableColumn((1, 3, 6, 1, 4, 1, 800, 2, 18, 8, 1, 1, 8), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 100))).setMaxAccess("readonly")
if mibBuilder.loadTexts: health2ModuleRxTx1HrAvg.setStatus('mandatory')
health2ModuleRxTx1HrMax = MibTableColumn((1, 3, 6, 1, 4, 1, 800, 2, 18, 8, 1, 1, 9), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 100))).setMaxAccess("readonly")
if mibBuilder.loadTexts: health2ModuleRxTx1HrMax.setStatus('mandatory')
health2ModuleBackplaneLatest = MibTableColumn((1, 3, 6, 1, 4, 1, 800, 2, 18, 8, 1, 1, 10), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 100))).setMaxAccess("readonly")
if mibBuilder.loadTexts: health2ModuleBackplaneLatest.setStatus('mandatory')
health2ModuleBackplane1MinAvg = MibTableColumn((1, 3, 6, 1, 4, 1, 800, 2, 18, 8, 1, 1, 11), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 100))).setMaxAccess("readonly")
if mibBuilder.loadTexts: health2ModuleBackplane1MinAvg.setStatus('mandatory')
health2ModuleBackplane1HrAvg = MibTableColumn((1, 3, 6, 1, 4, 1, 800, 2, 18, 8, 1, 1, 12), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 100))).setMaxAccess("readonly")
if mibBuilder.loadTexts: health2ModuleBackplane1HrAvg.setStatus('mandatory')
health2ModuleBackplane1HrMax = MibTableColumn((1, 3, 6, 1, 4, 1, 800, 2, 18, 8, 1, 1, 13), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 100))).setMaxAccess("readonly")
if mibBuilder.loadTexts: health2ModuleBackplane1HrMax.setStatus('mandatory')
health2ModuleCamLatest = MibTableColumn((1, 3, 6, 1, 4, 1, 800, 2, 18, 8, 1, 1, 14), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 100))).setMaxAccess("readonly")
if mibBuilder.loadTexts: health2ModuleCamLatest.setStatus('mandatory')
health2ModuleCam1MinAvg = MibTableColumn((1, 3, 6, 1, 4, 1, 800, 2, 18, 8, 1, 1, 15), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 100))).setMaxAccess("readonly")
if mibBuilder.loadTexts: health2ModuleCam1MinAvg.setStatus('mandatory')
health2ModuleCam1HrAvg = MibTableColumn((1, 3, 6, 1, 4, 1, 800, 2, 18, 8, 1, 1, 16), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 100))).setMaxAccess("readonly")
if mibBuilder.loadTexts: health2ModuleCam1HrAvg.setStatus('mandatory')
health2ModuleCam1HrMax = MibTableColumn((1, 3, 6, 1, 4, 1, 800, 2, 18, 8, 1, 1, 17), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 100))).setMaxAccess("readonly")
if mibBuilder.loadTexts: health2ModuleCam1HrMax.setStatus('mandatory')
health2ModuleVccLatest = MibTableColumn((1, 3, 6, 1, 4, 1, 800, 2, 18, 8, 1, 1, 18), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 100))).setMaxAccess("readonly")
if mibBuilder.loadTexts: health2ModuleVccLatest.setStatus('mandatory')
health2ModuleVcc1MinAvg = MibTableColumn((1, 3, 6, 1, 4, 1, 800, 2, 18, 8, 1, 1, 19), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 100))).setMaxAccess("readonly")
if mibBuilder.loadTexts: health2ModuleVcc1MinAvg.setStatus('mandatory')
health2ModuleVcc1HrAvg = MibTableColumn((1, 3, 6, 1, 4, 1, 800, 2, 18, 8, 1, 1, 20), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 100))).setMaxAccess("readonly")
if mibBuilder.loadTexts: health2ModuleVcc1HrAvg.setStatus('mandatory')
health2ModuleVcc1HrMax = MibTableColumn((1, 3, 6, 1, 4, 1, 800, 2, 18, 8, 1, 1, 21), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 100))).setMaxAccess("readonly")
if mibBuilder.loadTexts: health2ModuleVcc1HrMax.setStatus('mandatory')
health2PortTable = MibTable((1, 3, 6, 1, 4, 1, 800, 2, 18, 9, 1), )
if mibBuilder.loadTexts: health2PortTable.setStatus('mandatory')
health2PortEntry = MibTableRow((1, 3, 6, 1, 4, 1, 800, 2, 18, 9, 1, 1), ).setIndexNames((0, "XYLAN-HEALTH-MIB", "health2PortSlot"), (0, "XYLAN-HEALTH-MIB", "health2PortIF"))
if mibBuilder.loadTexts: health2PortEntry.setStatus('mandatory')
health2PortSlot = MibTableColumn((1, 3, 6, 1, 4, 1, 800, 2, 18, 9, 1, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 9))).setMaxAccess("readonly")
if mibBuilder.loadTexts: health2PortSlot.setStatus('mandatory')
health2PortIF = MibTableColumn((1, 3, 6, 1, 4, 1, 800, 2, 18, 9, 1, 1, 2), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: health2PortIF.setStatus('mandatory')
health2PortRxLatest = MibTableColumn((1, 3, 6, 1, 4, 1, 800, 2, 18, 9, 1, 1, 3), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 100))).setMaxAccess("readonly")
if mibBuilder.loadTexts: health2PortRxLatest.setStatus('mandatory')
health2PortRx1MinAvg = MibTableColumn((1, 3, 6, 1, 4, 1, 800, 2, 18, 9, 1, 1, 4), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 100))).setMaxAccess("readonly")
if mibBuilder.loadTexts: health2PortRx1MinAvg.setStatus('mandatory')
health2PortRx1HrAvg = MibTableColumn((1, 3, 6, 1, 4, 1, 800, 2, 18, 9, 1, 1, 5), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 100))).setMaxAccess("readonly")
if mibBuilder.loadTexts: health2PortRx1HrAvg.setStatus('mandatory')
health2PortRx1HrMax = MibTableColumn((1, 3, 6, 1, 4, 1, 800, 2, 18, 9, 1, 1, 6), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 100))).setMaxAccess("readonly")
if mibBuilder.loadTexts: health2PortRx1HrMax.setStatus('mandatory')
health2PortRxTxLatest = MibTableColumn((1, 3, 6, 1, 4, 1, 800, 2, 18, 9, 1, 1, 7), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 100))).setMaxAccess("readonly")
if mibBuilder.loadTexts: health2PortRxTxLatest.setStatus('mandatory')
health2PortRxTx1MinAvg = MibTableColumn((1, 3, 6, 1, 4, 1, 800, 2, 18, 9, 1, 1, 8), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 100))).setMaxAccess("readonly")
if mibBuilder.loadTexts: health2PortRxTx1MinAvg.setStatus('mandatory')
health2PortRxTx1HrAvg = MibTableColumn((1, 3, 6, 1, 4, 1, 800, 2, 18, 9, 1, 1, 9), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 100))).setMaxAccess("readonly")
if mibBuilder.loadTexts: health2PortRxTx1HrAvg.setStatus('mandatory')
health2PortRxTx1HrMax = MibTableColumn((1, 3, 6, 1, 4, 1, 800, 2, 18, 9, 1, 1, 10), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 100))).setMaxAccess("readonly")
if mibBuilder.loadTexts: health2PortRxTx1HrMax.setStatus('mandatory')
health2PortBackplaneLatest = MibTableColumn((1, 3, 6, 1, 4, 1, 800, 2, 18, 9, 1, 1, 11), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 100))).setMaxAccess("readonly")
if mibBuilder.loadTexts: health2PortBackplaneLatest.setStatus('mandatory')
health2PortBackplane1MinAvg = MibTableColumn((1, 3, 6, 1, 4, 1, 800, 2, 18, 9, 1, 1, 12), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 100))).setMaxAccess("readonly")
if mibBuilder.loadTexts: health2PortBackplane1MinAvg.setStatus('mandatory')
health2PortBackplane1HrAvg = MibTableColumn((1, 3, 6, 1, 4, 1, 800, 2, 18, 9, 1, 1, 13), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 100))).setMaxAccess("readonly")
if mibBuilder.loadTexts: health2PortBackplane1HrAvg.setStatus('mandatory')
health2PortBackplane1HrMax = MibTableColumn((1, 3, 6, 1, 4, 1, 800, 2, 18, 9, 1, 1, 14), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 100))).setMaxAccess("readonly")
if mibBuilder.loadTexts: health2PortBackplane1HrMax.setStatus('mandatory')
health2PortVccLatest = MibTableColumn((1, 3, 6, 1, 4, 1, 800, 2, 18, 9, 1, 1, 15), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 100))).setMaxAccess("readonly")
if mibBuilder.loadTexts: health2PortVccLatest.setStatus('mandatory')
health2PortVcc1MinAvg = MibTableColumn((1, 3, 6, 1, 4, 1, 800, 2, 18, 9, 1, 1, 16), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 100))).setMaxAccess("readonly")
if mibBuilder.loadTexts: health2PortVcc1MinAvg.setStatus('mandatory')
health2PortVcc1HrAvg = MibTableColumn((1, 3, 6, 1, 4, 1, 800, 2, 18, 9, 1, 1, 17), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 100))).setMaxAccess("readonly")
if mibBuilder.loadTexts: health2PortVcc1HrAvg.setStatus('mandatory')
health2PortVcc1HrMax = MibTableColumn((1, 3, 6, 1, 4, 1, 800, 2, 18, 9, 1, 1, 18), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 100))).setMaxAccess("readonly")
if mibBuilder.loadTexts: health2PortVcc1HrMax.setStatus('mandatory')
mibBuilder.exportSymbols("XYLAN-HEALTH-MIB", healthThreshPortSummaryIF=healthThreshPortSummaryIF, healthDeviceTemp=healthDeviceTemp, healthDeviceMpmRxOverrunCount=healthDeviceMpmRxOverrunCount, healthThreshDeviceRxLimit=healthThreshDeviceRxLimit, healthDeviceRxTxData=healthDeviceRxTxData, healthPortRxTxTimeDelta=healthPortRxTxTimeDelta, health2PortSlot=health2PortSlot, health2DeviceHreCamLatest=health2DeviceHreCamLatest, health2DeviceBackplaneLatest=health2DeviceBackplaneLatest, health2ModuleVcc1MinAvg=health2ModuleVcc1MinAvg, healthPortRxData=healthPortRxData, health2DeviceCpu1MinAvg=health2DeviceCpu1MinAvg, health2DeviceHreCam1HrMax=health2DeviceHreCam1HrMax, health2ModuleRx1HrMax=health2ModuleRx1HrMax, healthThreshModTrapCount=healthThreshModTrapCount, healthPortVccTimeDelta=healthPortVccTimeDelta, health2ModuleSlot=health2ModuleSlot, healthDeviceHreCamTotal=healthDeviceHreCamTotal, healthDeviceTemperatureTimeDelta=healthDeviceTemperatureTimeDelta, health2PortBackplaneLatest=health2PortBackplaneLatest, health2DeviceVcc1HrMax=health2DeviceVcc1HrMax, health2DeviceHreCollision1HrMax=health2DeviceHreCollision1HrMax, healthPortIF=healthPortIF, health2DeviceCpu1HrMax=health2DeviceCpu1HrMax, healthThreshDeviceBackplaneLimit=healthThreshDeviceBackplaneLimit, healthDeviceVpTimeDelta=healthDeviceVpTimeDelta, health2DeviceHreCollision1MinAvg=health2DeviceHreCollision1MinAvg, health2DeviceInfo=health2DeviceInfo, healthThreshDeviceVpLimit=healthThreshDeviceVpLimit, healthDeviceVccData=healthDeviceVccData, healthDeviceTemperatureData=healthDeviceTemperatureData, healthPortEntry=healthPortEntry, healthThreshPortSummarySlot=healthThreshPortSummarySlot, health2PortRxLatest=health2PortRxLatest, healthThreshDeviceSummary=healthThreshDeviceSummary, healthDeviceCpuTimeDelta=healthDeviceCpuTimeDelta, health2DeviceRxTx1HrAvg=health2DeviceRxTx1HrAvg, healthModuleRxData=healthModuleRxData, health2DeviceCpuNum=health2DeviceCpuNum, healthDeviceMpmCamFree=healthDeviceMpmCamFree, healthThreshDeviceMemoryLimit=healthThreshDeviceMemoryLimit, health2ModuleCam1HrMax=health2ModuleCam1HrMax, health2DeviceTemperature1HrAvg=health2DeviceTemperature1HrAvg, health2ModuleCam1MinAvg=health2ModuleCam1MinAvg, healthThreshPortTrapCount=healthThreshPortTrapCount, health2ModuleInfo=health2ModuleInfo, health2ModuleBackplaneLatest=health2ModuleBackplaneLatest, health2PortRxTxLatest=health2PortRxTxLatest, health2ModuleRx1HrAvg=health2ModuleRx1HrAvg, HealthPortUpDownStatus=HealthPortUpDownStatus, healthDeviceRxTimeDelta=healthDeviceRxTimeDelta, health2DeviceRx1MinAvg=health2DeviceRx1MinAvg, health2DeviceHreCam1MinAvg=health2DeviceHreCam1MinAvg, healthPortSlot=healthPortSlot, health2ModuleBackplane1MinAvg=health2ModuleBackplane1MinAvg, healthControlInfo=healthControlInfo, healthThreshDeviceVccLimit=healthThreshDeviceVccLimit, health2DeviceVp1HrMax=health2DeviceVp1HrMax, health2ModuleCam1HrAvg=health2ModuleCam1HrAvg, healthThreshModuleSummaryEntry=healthThreshModuleSummaryEntry, health2PortBackplane1HrAvg=health2PortBackplane1HrAvg, health2PortVcc1HrAvg=health2PortVcc1HrAvg, health2ModuleEntry=health2ModuleEntry, health2PortRx1MinAvg=health2PortRx1MinAvg, healthModuleCamConfigured=healthModuleCamConfigured, health2DeviceNumCpus=health2DeviceNumCpus, healthDeviceBackplaneTimeDelta=healthDeviceBackplaneTimeDelta, health2ModuleRxTx1HrAvg=health2ModuleRxTx1HrAvg, healthDeviceBackplaneData=healthDeviceBackplaneData, healthPortRxTxData=healthPortRxTxData, healthDeviceMemoryTimeDelta=healthDeviceMemoryTimeDelta, healthDeviceHreCamFree=healthDeviceHreCamFree, healthThreshPortSummaryEntry=healthThreshPortSummaryEntry, health2DeviceMpmCam1HrAvg=health2DeviceMpmCam1HrAvg, health2DeviceRx1HrMax=health2DeviceRx1HrMax, healthModuleInfo=healthModuleInfo, health2ModuleBackplane1HrAvg=health2ModuleBackplane1HrAvg, health2ModuleCamLatest=health2ModuleCamLatest, healthDeviceRxTxTimeDelta=healthDeviceRxTxTimeDelta, health2DeviceRxLatest=health2DeviceRxLatest, health2PortEntry=health2PortEntry, healthModuleRxTxData=healthModuleRxTxData, healthModuleVccTimeDelta=healthModuleVccTimeDelta, health2DeviceMpmCam1HrMax=health2DeviceMpmCam1HrMax, healthDeviceVccTimeDelta=healthDeviceVccTimeDelta, health2DeviceMemoryLatest=health2DeviceMemoryLatest, health2DeviceMpmCam1MinAvg=health2DeviceMpmCam1MinAvg, health2ModuleRxTx1HrMax=health2ModuleRxTx1HrMax, health2DeviceVpLatest=health2DeviceVpLatest, healthThreshDeviceCamLimit=healthThreshDeviceCamLimit, healthDeviceRxData=healthDeviceRxData, healthThreshInfo=healthThreshInfo, healthModuleVccData=healthModuleVccData, health2DeviceCpuTable=health2DeviceCpuTable, healthDeviceIPXRouteCacheFlushCount=healthDeviceIPXRouteCacheFlushCount, health2PortRx1HrMax=health2PortRx1HrMax, healthPortUpDn=healthPortUpDn, healthPortBackplaneData=healthPortBackplaneData, health2DeviceCpuEntry=health2DeviceCpuEntry, healthDeviceMemoryFree=healthDeviceMemoryFree, healthPortRxTimeDelta=healthPortRxTimeDelta, healthModuleRxTxTimeDelta=healthModuleRxTxTimeDelta, health2ModuleRxTxLatest=health2ModuleRxTxLatest, healthSamplingInterval=healthSamplingInterval, healthPortVccData=healthPortVccData, healthModuleCamData=healthModuleCamData, health2DeviceVccLatest=health2DeviceVccLatest, healthThreshDeviceCpuLimit=healthThreshDeviceCpuLimit, health2DeviceTemperature1HrMax=health2DeviceTemperature1HrMax, healthDeviceMpmTxOverrunCount=healthDeviceMpmTxOverrunCount, health2DeviceBackplane1HrAvg=health2DeviceBackplane1HrAvg, health2PortBackplane1HrMax=health2PortBackplane1HrMax, health2PortVcc1MinAvg=health2PortVcc1MinAvg, health2PortInfo=health2PortInfo, healthPortBackplaneTimeDelta=healthPortBackplaneTimeDelta, health2PortRx1HrAvg=health2PortRx1HrAvg, health2PortTable=health2PortTable, healthThreshModTrapData=healthThreshModTrapData, healthModuleCamNumInstalled=healthModuleCamNumInstalled, health2DeviceMpmCamLatest=health2DeviceMpmCamLatest, health2DeviceHreCam1HrAvg=health2DeviceHreCam1HrAvg, healthDeviceIPRouteCacheFlushCount=healthDeviceIPRouteCacheFlushCount, healthDeviceMemoryTotal=healthDeviceMemoryTotal, healthDeviceHreCollisionTotal=healthDeviceHreCollisionTotal, healthModuleBackplaneTimeDelta=healthModuleBackplaneTimeDelta, healthPortMax=healthPortMax, health2ModuleVcc1HrMax=health2ModuleVcc1HrMax, health2ModuleBackplane1HrMax=health2ModuleBackplane1HrMax, health2PortBackplane1MinAvg=health2PortBackplane1MinAvg, health2DeviceTemperature1MinAvg=health2DeviceTemperature1MinAvg, health2DeviceVcc1MinAvg=health2DeviceVcc1MinAvg, healthThreshModuleSummaryData=healthThreshModuleSummaryData, healthThreshModuleSummarySlot=healthThreshModuleSummarySlot, health2ModuleRxTx1MinAvg=health2ModuleRxTx1MinAvg, health2DeviceBackplane1HrMax=health2DeviceBackplane1HrMax, healthDeviceNumCpus=healthDeviceNumCpus, healthDeviceInfo=healthDeviceInfo, healthDeviceMemoryData=healthDeviceMemoryData, health2DeviceHreCollision1HrAvg=health2DeviceHreCollision1HrAvg, healthModuleCamFree=healthModuleCamFree, healthModuleRxTimeDelta=healthModuleRxTimeDelta, healthDeviceHreCollisionFree=healthDeviceHreCollisionFree, healthModuleTable=healthModuleTable, healthPortInfo=healthPortInfo, healthThreshPortSummaryData=healthThreshPortSummaryData, health2DeviceBackplane1MinAvg=health2DeviceBackplane1MinAvg, healthThreshPortTrapData=healthThreshPortTrapData, health2PortVccLatest=health2PortVccLatest, healthThreshModuleSummaryTable=healthThreshModuleSummaryTable, healthThreshPortTrapSlot=healthThreshPortTrapSlot, healthGroupInfo=healthGroupInfo, health2PortRxTx1MinAvg=health2PortRxTx1MinAvg, healthModuleBackplaneData=healthModuleBackplaneData, health2DeviceTemperatureLatest=health2DeviceTemperatureLatest, healthModuleCamAvailNonIntern=healthModuleCamAvailNonIntern, healthSamplingReset=healthSamplingReset, health2PortIF=health2PortIF, health2PortVcc1HrMax=health2PortVcc1HrMax, health2DeviceVp1MinAvg=health2DeviceVp1MinAvg, healthDeviceVpData=healthDeviceVpData, health2DeviceMemory1HrMax=health2DeviceMemory1HrMax, health2DeviceCpu1HrAvg=health2DeviceCpu1HrAvg, healthModuleCamTimeDelta=healthModuleCamTimeDelta, health2DeviceCpuLatest=health2DeviceCpuLatest, health2DeviceHreCollisionLatest=health2DeviceHreCollisionLatest, healthDeviceMpmCamTotal=healthDeviceMpmCamTotal, health2ModuleRx1MinAvg=health2ModuleRx1MinAvg, healthDeviceCamData=healthDeviceCamData, health2DeviceVp1HrAvg=health2DeviceVp1HrAvg, healthModuleEntry=healthModuleEntry, healthPortTable=healthPortTable, health2DeviceRxTx1MinAvg=health2DeviceRxTx1MinAvg, health2ModuleVcc1HrAvg=health2ModuleVcc1HrAvg, healthDeviceCpuData=healthDeviceCpuData, health2DeviceVcc1HrAvg=health2DeviceVcc1HrAvg, health2PortRxTx1HrAvg=health2PortRxTx1HrAvg, health2DeviceRx1HrAvg=health2DeviceRx1HrAvg, healthThreshDeviceTemperatureLimit=healthThreshDeviceTemperatureLimit, health2ModuleVccLatest=health2ModuleVccLatest, healthModuleCamAvail=healthModuleCamAvail, health2DeviceMemory1MinAvg=health2DeviceMemory1MinAvg, healthThreshDeviceRxTxLimit=healthThreshDeviceRxTxLimit, health2DeviceMemory1HrAvg=health2DeviceMemory1HrAvg, health2PortRxTx1HrMax=health2PortRxTx1HrMax, healthThreshDevTrapData=healthThreshDevTrapData, healthDeviceCamTimeDelta=healthDeviceCamTimeDelta, health2DeviceRxTxLatest=health2DeviceRxTxLatest, health2DeviceRxTx1HrMax=health2DeviceRxTx1HrMax, health2ModuleRxLatest=health2ModuleRxLatest, health2ModuleTable=health2ModuleTable, healthThreshPortSummaryTable=healthThreshPortSummaryTable, healthModuleSlot=healthModuleSlot)
| (octet_string, object_identifier, integer) = mibBuilder.importSymbols('ASN1', 'OctetString', 'ObjectIdentifier', 'Integer')
(named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues')
(value_size_constraint, constraints_union, value_range_constraint, constraints_intersection, single_value_constraint) = mibBuilder.importSymbols('ASN1-REFINEMENT', 'ValueSizeConstraint', 'ConstraintsUnion', 'ValueRangeConstraint', 'ConstraintsIntersection', 'SingleValueConstraint')
(module_compliance, notification_group) = mibBuilder.importSymbols('SNMPv2-CONF', 'ModuleCompliance', 'NotificationGroup')
(integer32, module_identity, iso, mib_identifier, counter64, notification_type, counter32, bits, object_identity, mib_scalar, mib_table, mib_table_row, mib_table_column, ip_address, unsigned32, gauge32, time_ticks) = mibBuilder.importSymbols('SNMPv2-SMI', 'Integer32', 'ModuleIdentity', 'iso', 'MibIdentifier', 'Counter64', 'NotificationType', 'Counter32', 'Bits', 'ObjectIdentity', 'MibScalar', 'MibTable', 'MibTableRow', 'MibTableColumn', 'IpAddress', 'Unsigned32', 'Gauge32', 'TimeTicks')
(display_string, textual_convention) = mibBuilder.importSymbols('SNMPv2-TC', 'DisplayString', 'TextualConvention')
(xylan_health_arch,) = mibBuilder.importSymbols('XYLAN-BASE-MIB', 'xylanHealthArch')
health_device_info = mib_identifier((1, 3, 6, 1, 4, 1, 800, 2, 18, 1))
health_module_info = mib_identifier((1, 3, 6, 1, 4, 1, 800, 2, 18, 2))
health_port_info = mib_identifier((1, 3, 6, 1, 4, 1, 800, 2, 18, 3))
health_group_info = mib_identifier((1, 3, 6, 1, 4, 1, 800, 2, 18, 4))
health_control_info = mib_identifier((1, 3, 6, 1, 4, 1, 800, 2, 18, 5))
health_thresh_info = mib_identifier((1, 3, 6, 1, 4, 1, 800, 2, 18, 6))
health2_device_info = mib_identifier((1, 3, 6, 1, 4, 1, 800, 2, 18, 7))
health2_module_info = mib_identifier((1, 3, 6, 1, 4, 1, 800, 2, 18, 8))
health2_port_info = mib_identifier((1, 3, 6, 1, 4, 1, 800, 2, 18, 9))
health_device_rx_data = mib_scalar((1, 3, 6, 1, 4, 1, 800, 2, 18, 1, 1), octet_string().subtype(subtypeSpec=value_size_constraint(4, 4)).setFixedLength(4)).setMaxAccess('readonly')
if mibBuilder.loadTexts:
healthDeviceRxData.setStatus('mandatory')
health_device_rx_time_delta = mib_scalar((1, 3, 6, 1, 4, 1, 800, 2, 18, 1, 2), integer32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
healthDeviceRxTimeDelta.setStatus('mandatory')
health_device_rx_tx_data = mib_scalar((1, 3, 6, 1, 4, 1, 800, 2, 18, 1, 3), octet_string().subtype(subtypeSpec=value_size_constraint(4, 4)).setFixedLength(4)).setMaxAccess('readonly')
if mibBuilder.loadTexts:
healthDeviceRxTxData.setStatus('mandatory')
health_device_rx_tx_time_delta = mib_scalar((1, 3, 6, 1, 4, 1, 800, 2, 18, 1, 4), integer32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
healthDeviceRxTxTimeDelta.setStatus('mandatory')
health_device_backplane_data = mib_scalar((1, 3, 6, 1, 4, 1, 800, 2, 18, 1, 5), octet_string().subtype(subtypeSpec=value_size_constraint(4, 4)).setFixedLength(4)).setMaxAccess('readonly')
if mibBuilder.loadTexts:
healthDeviceBackplaneData.setStatus('mandatory')
health_device_backplane_time_delta = mib_scalar((1, 3, 6, 1, 4, 1, 800, 2, 18, 1, 6), integer32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
healthDeviceBackplaneTimeDelta.setStatus('mandatory')
health_device_cam_data = mib_scalar((1, 3, 6, 1, 4, 1, 800, 2, 18, 1, 7), octet_string().subtype(subtypeSpec=value_size_constraint(12, 12)).setFixedLength(12)).setMaxAccess('readonly')
if mibBuilder.loadTexts:
healthDeviceCamData.setStatus('mandatory')
health_device_cam_time_delta = mib_scalar((1, 3, 6, 1, 4, 1, 800, 2, 18, 1, 8), integer32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
healthDeviceCamTimeDelta.setStatus('mandatory')
health_device_memory_data = mib_scalar((1, 3, 6, 1, 4, 1, 800, 2, 18, 1, 9), octet_string().subtype(subtypeSpec=value_size_constraint(12, 12)).setFixedLength(12)).setMaxAccess('readonly')
if mibBuilder.loadTexts:
healthDeviceMemoryData.setStatus('mandatory')
health_device_memory_time_delta = mib_scalar((1, 3, 6, 1, 4, 1, 800, 2, 18, 1, 10), integer32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
healthDeviceMemoryTimeDelta.setStatus('mandatory')
health_device_cpu_data = mib_scalar((1, 3, 6, 1, 4, 1, 800, 2, 18, 1, 11), octet_string()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
healthDeviceCpuData.setStatus('mandatory')
health_device_cpu_time_delta = mib_scalar((1, 3, 6, 1, 4, 1, 800, 2, 18, 1, 12), integer32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
healthDeviceCpuTimeDelta.setStatus('mandatory')
health_device_num_cpus = mib_scalar((1, 3, 6, 1, 4, 1, 800, 2, 18, 1, 13), integer32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
healthDeviceNumCpus.setStatus('mandatory')
health_device_memory_total = mib_scalar((1, 3, 6, 1, 4, 1, 800, 2, 18, 1, 14), integer32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
healthDeviceMemoryTotal.setStatus('mandatory')
health_device_memory_free = mib_scalar((1, 3, 6, 1, 4, 1, 800, 2, 18, 1, 15), integer32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
healthDeviceMemoryFree.setStatus('mandatory')
health_device_mpm_cam_total = mib_scalar((1, 3, 6, 1, 4, 1, 800, 2, 18, 1, 16), integer32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
healthDeviceMpmCamTotal.setStatus('mandatory')
health_device_mpm_cam_free = mib_scalar((1, 3, 6, 1, 4, 1, 800, 2, 18, 1, 17), integer32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
healthDeviceMpmCamFree.setStatus('mandatory')
health_device_hre_cam_total = mib_scalar((1, 3, 6, 1, 4, 1, 800, 2, 18, 1, 18), integer32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
healthDeviceHreCamTotal.setStatus('mandatory')
health_device_hre_cam_free = mib_scalar((1, 3, 6, 1, 4, 1, 800, 2, 18, 1, 19), integer32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
healthDeviceHreCamFree.setStatus('mandatory')
health_device_temp = mib_scalar((1, 3, 6, 1, 4, 1, 800, 2, 18, 1, 20), integer32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
healthDeviceTemp.setStatus('mandatory')
health_device_ip_route_cache_flush_count = mib_scalar((1, 3, 6, 1, 4, 1, 800, 2, 18, 1, 21), integer32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
healthDeviceIPRouteCacheFlushCount.setStatus('mandatory')
health_device_ipx_route_cache_flush_count = mib_scalar((1, 3, 6, 1, 4, 1, 800, 2, 18, 1, 22), integer32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
healthDeviceIPXRouteCacheFlushCount.setStatus('mandatory')
health_device_mpm_rx_overrun_count = mib_scalar((1, 3, 6, 1, 4, 1, 800, 2, 18, 1, 23), integer32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
healthDeviceMpmRxOverrunCount.setStatus('mandatory')
health_device_mpm_tx_overrun_count = mib_scalar((1, 3, 6, 1, 4, 1, 800, 2, 18, 1, 24), integer32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
healthDeviceMpmTxOverrunCount.setStatus('mandatory')
health_device_vcc_data = mib_scalar((1, 3, 6, 1, 4, 1, 800, 2, 18, 1, 25), octet_string().subtype(subtypeSpec=value_size_constraint(4, 4)).setFixedLength(4)).setMaxAccess('readonly')
if mibBuilder.loadTexts:
healthDeviceVccData.setStatus('mandatory')
health_device_vcc_time_delta = mib_scalar((1, 3, 6, 1, 4, 1, 800, 2, 18, 1, 26), integer32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
healthDeviceVccTimeDelta.setStatus('mandatory')
health_device_temperature_data = mib_scalar((1, 3, 6, 1, 4, 1, 800, 2, 18, 1, 27), octet_string().subtype(subtypeSpec=value_size_constraint(4, 4)).setFixedLength(4)).setMaxAccess('readonly')
if mibBuilder.loadTexts:
healthDeviceTemperatureData.setStatus('mandatory')
health_device_temperature_time_delta = mib_scalar((1, 3, 6, 1, 4, 1, 800, 2, 18, 1, 28), integer32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
healthDeviceTemperatureTimeDelta.setStatus('mandatory')
health_device_vp_data = mib_scalar((1, 3, 6, 1, 4, 1, 800, 2, 18, 1, 29), octet_string().subtype(subtypeSpec=value_size_constraint(4, 4)).setFixedLength(4)).setMaxAccess('readonly')
if mibBuilder.loadTexts:
healthDeviceVpData.setStatus('mandatory')
health_device_vp_time_delta = mib_scalar((1, 3, 6, 1, 4, 1, 800, 2, 18, 1, 30), integer32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
healthDeviceVpTimeDelta.setStatus('mandatory')
health_device_hre_collision_total = mib_scalar((1, 3, 6, 1, 4, 1, 800, 2, 18, 1, 31), integer32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
healthDeviceHreCollisionTotal.setStatus('mandatory')
health_device_hre_collision_free = mib_scalar((1, 3, 6, 1, 4, 1, 800, 2, 18, 1, 32), integer32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
healthDeviceHreCollisionFree.setStatus('mandatory')
health_module_table = mib_table((1, 3, 6, 1, 4, 1, 800, 2, 18, 2, 1))
if mibBuilder.loadTexts:
healthModuleTable.setStatus('mandatory')
health_module_entry = mib_table_row((1, 3, 6, 1, 4, 1, 800, 2, 18, 2, 1, 1)).setIndexNames((0, 'XYLAN-HEALTH-MIB', 'healthModuleSlot'))
if mibBuilder.loadTexts:
healthModuleEntry.setStatus('mandatory')
health_module_slot = mib_table_column((1, 3, 6, 1, 4, 1, 800, 2, 18, 2, 1, 1, 1), integer32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
healthModuleSlot.setStatus('mandatory')
health_module_rx_data = mib_table_column((1, 3, 6, 1, 4, 1, 800, 2, 18, 2, 1, 1, 2), octet_string().subtype(subtypeSpec=value_size_constraint(4, 4)).setFixedLength(4)).setMaxAccess('readonly')
if mibBuilder.loadTexts:
healthModuleRxData.setStatus('mandatory')
health_module_rx_time_delta = mib_table_column((1, 3, 6, 1, 4, 1, 800, 2, 18, 2, 1, 1, 3), integer32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
healthModuleRxTimeDelta.setStatus('mandatory')
health_module_rx_tx_data = mib_table_column((1, 3, 6, 1, 4, 1, 800, 2, 18, 2, 1, 1, 4), octet_string().subtype(subtypeSpec=value_size_constraint(4, 4)).setFixedLength(4)).setMaxAccess('readonly')
if mibBuilder.loadTexts:
healthModuleRxTxData.setStatus('mandatory')
health_module_rx_tx_time_delta = mib_table_column((1, 3, 6, 1, 4, 1, 800, 2, 18, 2, 1, 1, 5), integer32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
healthModuleRxTxTimeDelta.setStatus('mandatory')
health_module_backplane_data = mib_table_column((1, 3, 6, 1, 4, 1, 800, 2, 18, 2, 1, 1, 6), octet_string().subtype(subtypeSpec=value_size_constraint(4, 4)).setFixedLength(4)).setMaxAccess('readonly')
if mibBuilder.loadTexts:
healthModuleBackplaneData.setStatus('mandatory')
health_module_backplane_time_delta = mib_table_column((1, 3, 6, 1, 4, 1, 800, 2, 18, 2, 1, 1, 7), integer32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
healthModuleBackplaneTimeDelta.setStatus('mandatory')
health_module_cam_data = mib_table_column((1, 3, 6, 1, 4, 1, 800, 2, 18, 2, 1, 1, 8), octet_string().subtype(subtypeSpec=value_size_constraint(4, 4)).setFixedLength(4)).setMaxAccess('readonly')
if mibBuilder.loadTexts:
healthModuleCamData.setStatus('mandatory')
health_module_cam_time_delta = mib_table_column((1, 3, 6, 1, 4, 1, 800, 2, 18, 2, 1, 1, 9), integer32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
healthModuleCamTimeDelta.setStatus('mandatory')
health_module_cam_num_installed = mib_table_column((1, 3, 6, 1, 4, 1, 800, 2, 18, 2, 1, 1, 10), integer32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
healthModuleCamNumInstalled.setStatus('mandatory')
health_module_cam_configured = mib_table_column((1, 3, 6, 1, 4, 1, 800, 2, 18, 2, 1, 1, 11), integer32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
healthModuleCamConfigured.setStatus('mandatory')
health_module_cam_avail = mib_table_column((1, 3, 6, 1, 4, 1, 800, 2, 18, 2, 1, 1, 12), integer32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
healthModuleCamAvail.setStatus('mandatory')
health_module_cam_avail_non_intern = mib_table_column((1, 3, 6, 1, 4, 1, 800, 2, 18, 2, 1, 1, 13), integer32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
healthModuleCamAvailNonIntern.setStatus('mandatory')
health_module_cam_free = mib_table_column((1, 3, 6, 1, 4, 1, 800, 2, 18, 2, 1, 1, 14), integer32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
healthModuleCamFree.setStatus('mandatory')
health_module_vcc_data = mib_table_column((1, 3, 6, 1, 4, 1, 800, 2, 18, 2, 1, 1, 15), octet_string().subtype(subtypeSpec=value_size_constraint(4, 4)).setFixedLength(4)).setMaxAccess('readonly')
if mibBuilder.loadTexts:
healthModuleVccData.setStatus('mandatory')
health_module_vcc_time_delta = mib_table_column((1, 3, 6, 1, 4, 1, 800, 2, 18, 2, 1, 1, 16), integer32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
healthModuleVccTimeDelta.setStatus('mandatory')
health_sampling_interval = mib_scalar((1, 3, 6, 1, 4, 1, 800, 2, 18, 5, 1), integer32()).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
healthSamplingInterval.setStatus('mandatory')
health_sampling_reset = mib_scalar((1, 3, 6, 1, 4, 1, 800, 2, 18, 5, 2), integer32()).setMaxAccess('writeonly')
if mibBuilder.loadTexts:
healthSamplingReset.setStatus('mandatory')
health_thresh_device_rx_limit = mib_scalar((1, 3, 6, 1, 4, 1, 800, 2, 18, 6, 1), integer32().subtype(subtypeSpec=value_range_constraint(0, 100))).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
healthThreshDeviceRxLimit.setStatus('mandatory')
health_thresh_device_rx_tx_limit = mib_scalar((1, 3, 6, 1, 4, 1, 800, 2, 18, 6, 2), integer32().subtype(subtypeSpec=value_range_constraint(0, 100))).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
healthThreshDeviceRxTxLimit.setStatus('mandatory')
health_thresh_device_backplane_limit = mib_scalar((1, 3, 6, 1, 4, 1, 800, 2, 18, 6, 3), integer32().subtype(subtypeSpec=value_range_constraint(0, 100))).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
healthThreshDeviceBackplaneLimit.setStatus('mandatory')
health_thresh_device_cam_limit = mib_scalar((1, 3, 6, 1, 4, 1, 800, 2, 18, 6, 4), integer32().subtype(subtypeSpec=value_range_constraint(0, 100))).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
healthThreshDeviceCamLimit.setStatus('mandatory')
health_thresh_device_memory_limit = mib_scalar((1, 3, 6, 1, 4, 1, 800, 2, 18, 6, 5), integer32().subtype(subtypeSpec=value_range_constraint(0, 100))).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
healthThreshDeviceMemoryLimit.setStatus('mandatory')
health_thresh_device_cpu_limit = mib_scalar((1, 3, 6, 1, 4, 1, 800, 2, 18, 6, 6), integer32().subtype(subtypeSpec=value_range_constraint(0, 100))).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
healthThreshDeviceCpuLimit.setStatus('mandatory')
health_thresh_device_summary = mib_scalar((1, 3, 6, 1, 4, 1, 800, 2, 18, 6, 7), octet_string().subtype(subtypeSpec=value_size_constraint(27, 27)).setFixedLength(27)).setMaxAccess('readonly')
if mibBuilder.loadTexts:
healthThreshDeviceSummary.setStatus('mandatory')
health_thresh_module_summary_table = mib_table((1, 3, 6, 1, 4, 1, 800, 2, 18, 6, 8))
if mibBuilder.loadTexts:
healthThreshModuleSummaryTable.setStatus('mandatory')
health_thresh_module_summary_entry = mib_table_row((1, 3, 6, 1, 4, 1, 800, 2, 18, 6, 8, 1)).setIndexNames((0, 'XYLAN-HEALTH-MIB', 'healthThreshModuleSummarySlot'))
if mibBuilder.loadTexts:
healthThreshModuleSummaryEntry.setStatus('mandatory')
health_thresh_module_summary_slot = mib_table_column((1, 3, 6, 1, 4, 1, 800, 2, 18, 6, 8, 1, 1), integer32().subtype(subtypeSpec=value_range_constraint(1, 9))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
healthThreshModuleSummarySlot.setStatus('mandatory')
health_thresh_module_summary_data = mib_table_column((1, 3, 6, 1, 4, 1, 800, 2, 18, 6, 8, 1, 2), octet_string().subtype(subtypeSpec=value_size_constraint(16, 16)).setFixedLength(16)).setMaxAccess('readonly')
if mibBuilder.loadTexts:
healthThreshModuleSummaryData.setStatus('mandatory')
health_thresh_dev_trap_data = mib_scalar((1, 3, 6, 1, 4, 1, 800, 2, 18, 6, 9), octet_string().subtype(subtypeSpec=value_size_constraint(0, 21)))
if mibBuilder.loadTexts:
healthThreshDevTrapData.setStatus('mandatory')
health_thresh_mod_trap_count = mib_scalar((1, 3, 6, 1, 4, 1, 800, 2, 18, 6, 10), integer32())
if mibBuilder.loadTexts:
healthThreshModTrapCount.setStatus('mandatory')
health_thresh_mod_trap_data = mib_scalar((1, 3, 6, 1, 4, 1, 800, 2, 18, 6, 11), octet_string().subtype(subtypeSpec=value_size_constraint(0, 128)))
if mibBuilder.loadTexts:
healthThreshModTrapData.setStatus('mandatory')
health_thresh_port_summary_table = mib_table((1, 3, 6, 1, 4, 1, 800, 2, 18, 6, 12))
if mibBuilder.loadTexts:
healthThreshPortSummaryTable.setStatus('mandatory')
health_thresh_port_summary_entry = mib_table_row((1, 3, 6, 1, 4, 1, 800, 2, 18, 6, 12, 1)).setIndexNames((0, 'XYLAN-HEALTH-MIB', 'healthThreshPortSummarySlot'), (0, 'XYLAN-HEALTH-MIB', 'healthThreshPortSummaryIF'))
if mibBuilder.loadTexts:
healthThreshPortSummaryEntry.setStatus('mandatory')
health_thresh_port_summary_slot = mib_table_column((1, 3, 6, 1, 4, 1, 800, 2, 18, 6, 12, 1, 1), integer32().subtype(subtypeSpec=value_range_constraint(1, 9))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
healthThreshPortSummarySlot.setStatus('mandatory')
health_thresh_port_summary_if = mib_table_column((1, 3, 6, 1, 4, 1, 800, 2, 18, 6, 12, 1, 2), integer32().subtype(subtypeSpec=value_range_constraint(1, 9))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
healthThreshPortSummaryIF.setStatus('mandatory')
health_thresh_port_summary_data = mib_table_column((1, 3, 6, 1, 4, 1, 800, 2, 18, 6, 12, 1, 3), octet_string().subtype(subtypeSpec=value_size_constraint(13, 13)).setFixedLength(13)).setMaxAccess('readonly')
if mibBuilder.loadTexts:
healthThreshPortSummaryData.setStatus('mandatory')
health_thresh_port_trap_slot = mib_scalar((1, 3, 6, 1, 4, 1, 800, 2, 18, 6, 13), integer32())
if mibBuilder.loadTexts:
healthThreshPortTrapSlot.setStatus('mandatory')
health_thresh_port_trap_count = mib_scalar((1, 3, 6, 1, 4, 1, 800, 2, 18, 6, 14), integer32())
if mibBuilder.loadTexts:
healthThreshPortTrapCount.setStatus('mandatory')
health_thresh_port_trap_data = mib_scalar((1, 3, 6, 1, 4, 1, 800, 2, 18, 6, 15), octet_string().subtype(subtypeSpec=value_size_constraint(0, 255)))
if mibBuilder.loadTexts:
healthThreshPortTrapData.setStatus('mandatory')
health_thresh_device_vcc_limit = mib_scalar((1, 3, 6, 1, 4, 1, 800, 2, 18, 6, 16), integer32().subtype(subtypeSpec=value_range_constraint(0, 100))).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
healthThreshDeviceVccLimit.setStatus('mandatory')
health_thresh_device_temperature_limit = mib_scalar((1, 3, 6, 1, 4, 1, 800, 2, 18, 6, 17), integer32().subtype(subtypeSpec=value_range_constraint(0, 100))).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
healthThreshDeviceTemperatureLimit.setStatus('mandatory')
health_thresh_device_vp_limit = mib_scalar((1, 3, 6, 1, 4, 1, 800, 2, 18, 6, 18), integer32().subtype(subtypeSpec=value_range_constraint(0, 100))).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
healthThreshDeviceVpLimit.setStatus('mandatory')
health_port_max = mib_scalar((1, 3, 6, 1, 4, 1, 800, 2, 18, 3, 1), octet_string().subtype(subtypeSpec=value_size_constraint(21, 21)).setFixedLength(21)).setMaxAccess('readonly')
if mibBuilder.loadTexts:
healthPortMax.setStatus('mandatory')
class Healthportupdownstatus(Integer32):
subtype_spec = Integer32.subtypeSpec + constraints_union(single_value_constraint(1, 2))
named_values = named_values(('healthPortDn', 1), ('healthPortUp', 2))
health_port_table = mib_table((1, 3, 6, 1, 4, 1, 800, 2, 18, 3, 2))
if mibBuilder.loadTexts:
healthPortTable.setStatus('mandatory')
health_port_entry = mib_table_row((1, 3, 6, 1, 4, 1, 800, 2, 18, 3, 2, 1)).setIndexNames((0, 'XYLAN-HEALTH-MIB', 'healthPortSlot'), (0, 'XYLAN-HEALTH-MIB', 'healthPortIF'))
if mibBuilder.loadTexts:
healthPortEntry.setStatus('mandatory')
health_port_slot = mib_table_column((1, 3, 6, 1, 4, 1, 800, 2, 18, 3, 2, 1, 1), integer32().subtype(subtypeSpec=value_range_constraint(1, 9))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
healthPortSlot.setStatus('mandatory')
health_port_if = mib_table_column((1, 3, 6, 1, 4, 1, 800, 2, 18, 3, 2, 1, 2), integer32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
healthPortIF.setStatus('mandatory')
health_port_up_dn = mib_table_column((1, 3, 6, 1, 4, 1, 800, 2, 18, 3, 2, 1, 3), health_port_up_down_status()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
healthPortUpDn.setStatus('mandatory')
health_port_rx_data = mib_table_column((1, 3, 6, 1, 4, 1, 800, 2, 18, 3, 2, 1, 4), octet_string().subtype(subtypeSpec=value_size_constraint(4, 4)).setFixedLength(4)).setMaxAccess('readonly')
if mibBuilder.loadTexts:
healthPortRxData.setStatus('mandatory')
health_port_rx_time_delta = mib_table_column((1, 3, 6, 1, 4, 1, 800, 2, 18, 3, 2, 1, 5), integer32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
healthPortRxTimeDelta.setStatus('mandatory')
health_port_rx_tx_data = mib_table_column((1, 3, 6, 1, 4, 1, 800, 2, 18, 3, 2, 1, 6), octet_string().subtype(subtypeSpec=value_size_constraint(4, 4)).setFixedLength(4)).setMaxAccess('readonly')
if mibBuilder.loadTexts:
healthPortRxTxData.setStatus('mandatory')
health_port_rx_tx_time_delta = mib_table_column((1, 3, 6, 1, 4, 1, 800, 2, 18, 3, 2, 1, 7), integer32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
healthPortRxTxTimeDelta.setStatus('mandatory')
health_port_backplane_data = mib_table_column((1, 3, 6, 1, 4, 1, 800, 2, 18, 3, 2, 1, 8), octet_string().subtype(subtypeSpec=value_size_constraint(4, 4)).setFixedLength(4)).setMaxAccess('readonly')
if mibBuilder.loadTexts:
healthPortBackplaneData.setStatus('mandatory')
health_port_backplane_time_delta = mib_table_column((1, 3, 6, 1, 4, 1, 800, 2, 18, 3, 2, 1, 9), integer32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
healthPortBackplaneTimeDelta.setStatus('mandatory')
health_port_vcc_data = mib_table_column((1, 3, 6, 1, 4, 1, 800, 2, 18, 3, 2, 1, 10), octet_string().subtype(subtypeSpec=value_size_constraint(4, 4)).setFixedLength(4)).setMaxAccess('readonly')
if mibBuilder.loadTexts:
healthPortVccData.setStatus('mandatory')
health_port_vcc_time_delta = mib_table_column((1, 3, 6, 1, 4, 1, 800, 2, 18, 3, 2, 1, 11), integer32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
healthPortVccTimeDelta.setStatus('mandatory')
health2_device_rx_latest = mib_scalar((1, 3, 6, 1, 4, 1, 800, 2, 18, 7, 1), integer32().subtype(subtypeSpec=value_range_constraint(0, 100))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
health2DeviceRxLatest.setStatus('mandatory')
health2_device_rx1_min_avg = mib_scalar((1, 3, 6, 1, 4, 1, 800, 2, 18, 7, 2), integer32().subtype(subtypeSpec=value_range_constraint(0, 100))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
health2DeviceRx1MinAvg.setStatus('mandatory')
health2_device_rx1_hr_avg = mib_scalar((1, 3, 6, 1, 4, 1, 800, 2, 18, 7, 3), integer32().subtype(subtypeSpec=value_range_constraint(0, 100))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
health2DeviceRx1HrAvg.setStatus('mandatory')
health2_device_rx1_hr_max = mib_scalar((1, 3, 6, 1, 4, 1, 800, 2, 18, 7, 4), integer32().subtype(subtypeSpec=value_range_constraint(0, 100))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
health2DeviceRx1HrMax.setStatus('mandatory')
health2_device_rx_tx_latest = mib_scalar((1, 3, 6, 1, 4, 1, 800, 2, 18, 7, 5), integer32().subtype(subtypeSpec=value_range_constraint(0, 100))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
health2DeviceRxTxLatest.setStatus('mandatory')
health2_device_rx_tx1_min_avg = mib_scalar((1, 3, 6, 1, 4, 1, 800, 2, 18, 7, 6), integer32().subtype(subtypeSpec=value_range_constraint(0, 100))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
health2DeviceRxTx1MinAvg.setStatus('mandatory')
health2_device_rx_tx1_hr_avg = mib_scalar((1, 3, 6, 1, 4, 1, 800, 2, 18, 7, 7), integer32().subtype(subtypeSpec=value_range_constraint(0, 100))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
health2DeviceRxTx1HrAvg.setStatus('mandatory')
health2_device_rx_tx1_hr_max = mib_scalar((1, 3, 6, 1, 4, 1, 800, 2, 18, 7, 8), integer32().subtype(subtypeSpec=value_range_constraint(0, 100))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
health2DeviceRxTx1HrMax.setStatus('mandatory')
health2_device_backplane_latest = mib_scalar((1, 3, 6, 1, 4, 1, 800, 2, 18, 7, 9), integer32().subtype(subtypeSpec=value_range_constraint(0, 100))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
health2DeviceBackplaneLatest.setStatus('mandatory')
health2_device_backplane1_min_avg = mib_scalar((1, 3, 6, 1, 4, 1, 800, 2, 18, 7, 10), integer32().subtype(subtypeSpec=value_range_constraint(0, 100))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
health2DeviceBackplane1MinAvg.setStatus('mandatory')
health2_device_backplane1_hr_avg = mib_scalar((1, 3, 6, 1, 4, 1, 800, 2, 18, 7, 11), integer32().subtype(subtypeSpec=value_range_constraint(0, 100))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
health2DeviceBackplane1HrAvg.setStatus('mandatory')
health2_device_backplane1_hr_max = mib_scalar((1, 3, 6, 1, 4, 1, 800, 2, 18, 7, 12), integer32().subtype(subtypeSpec=value_range_constraint(0, 100))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
health2DeviceBackplane1HrMax.setStatus('mandatory')
health2_device_mpm_cam_latest = mib_scalar((1, 3, 6, 1, 4, 1, 800, 2, 18, 7, 13), integer32().subtype(subtypeSpec=value_range_constraint(0, 100))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
health2DeviceMpmCamLatest.setStatus('mandatory')
health2_device_mpm_cam1_min_avg = mib_scalar((1, 3, 6, 1, 4, 1, 800, 2, 18, 7, 14), integer32().subtype(subtypeSpec=value_range_constraint(0, 100))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
health2DeviceMpmCam1MinAvg.setStatus('mandatory')
health2_device_mpm_cam1_hr_avg = mib_scalar((1, 3, 6, 1, 4, 1, 800, 2, 18, 7, 15), integer32().subtype(subtypeSpec=value_range_constraint(0, 100))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
health2DeviceMpmCam1HrAvg.setStatus('mandatory')
health2_device_mpm_cam1_hr_max = mib_scalar((1, 3, 6, 1, 4, 1, 800, 2, 18, 7, 16), integer32().subtype(subtypeSpec=value_range_constraint(0, 100))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
health2DeviceMpmCam1HrMax.setStatus('mandatory')
health2_device_hre_cam_latest = mib_scalar((1, 3, 6, 1, 4, 1, 800, 2, 18, 7, 17), integer32().subtype(subtypeSpec=value_range_constraint(0, 100))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
health2DeviceHreCamLatest.setStatus('mandatory')
health2_device_hre_cam1_min_avg = mib_scalar((1, 3, 6, 1, 4, 1, 800, 2, 18, 7, 18), integer32().subtype(subtypeSpec=value_range_constraint(0, 100))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
health2DeviceHreCam1MinAvg.setStatus('mandatory')
health2_device_hre_cam1_hr_avg = mib_scalar((1, 3, 6, 1, 4, 1, 800, 2, 18, 7, 19), integer32().subtype(subtypeSpec=value_range_constraint(0, 100))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
health2DeviceHreCam1HrAvg.setStatus('mandatory')
health2_device_hre_cam1_hr_max = mib_scalar((1, 3, 6, 1, 4, 1, 800, 2, 18, 7, 20), integer32().subtype(subtypeSpec=value_range_constraint(0, 100))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
health2DeviceHreCam1HrMax.setStatus('mandatory')
health2_device_memory_latest = mib_scalar((1, 3, 6, 1, 4, 1, 800, 2, 18, 7, 21), integer32().subtype(subtypeSpec=value_range_constraint(0, 100))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
health2DeviceMemoryLatest.setStatus('mandatory')
health2_device_memory1_min_avg = mib_scalar((1, 3, 6, 1, 4, 1, 800, 2, 18, 7, 22), integer32().subtype(subtypeSpec=value_range_constraint(0, 100))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
health2DeviceMemory1MinAvg.setStatus('mandatory')
health2_device_memory1_hr_avg = mib_scalar((1, 3, 6, 1, 4, 1, 800, 2, 18, 7, 23), integer32().subtype(subtypeSpec=value_range_constraint(0, 100))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
health2DeviceMemory1HrAvg.setStatus('mandatory')
health2_device_memory1_hr_max = mib_scalar((1, 3, 6, 1, 4, 1, 800, 2, 18, 7, 24), integer32().subtype(subtypeSpec=value_range_constraint(0, 100))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
health2DeviceMemory1HrMax.setStatus('mandatory')
health2_device_num_cpus = mib_scalar((1, 3, 6, 1, 4, 1, 800, 2, 18, 7, 25), integer32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
health2DeviceNumCpus.setStatus('mandatory')
health2_device_cpu_table = mib_table((1, 3, 6, 1, 4, 1, 800, 2, 18, 7, 26))
if mibBuilder.loadTexts:
health2DeviceCpuTable.setStatus('mandatory')
health2_device_cpu_entry = mib_table_row((1, 3, 6, 1, 4, 1, 800, 2, 18, 7, 26, 1)).setIndexNames((0, 'XYLAN-HEALTH-MIB', 'health2DeviceCpuNum'))
if mibBuilder.loadTexts:
health2DeviceCpuEntry.setStatus('mandatory')
health2_device_cpu_num = mib_table_column((1, 3, 6, 1, 4, 1, 800, 2, 18, 7, 26, 1, 1), integer32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
health2DeviceCpuNum.setStatus('mandatory')
health2_device_cpu_latest = mib_table_column((1, 3, 6, 1, 4, 1, 800, 2, 18, 7, 26, 1, 2), integer32().subtype(subtypeSpec=value_range_constraint(0, 100))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
health2DeviceCpuLatest.setStatus('mandatory')
health2_device_cpu1_min_avg = mib_table_column((1, 3, 6, 1, 4, 1, 800, 2, 18, 7, 26, 1, 3), integer32().subtype(subtypeSpec=value_range_constraint(0, 100))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
health2DeviceCpu1MinAvg.setStatus('mandatory')
health2_device_cpu1_hr_avg = mib_table_column((1, 3, 6, 1, 4, 1, 800, 2, 18, 7, 26, 1, 4), integer32().subtype(subtypeSpec=value_range_constraint(0, 100))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
health2DeviceCpu1HrAvg.setStatus('mandatory')
health2_device_cpu1_hr_max = mib_table_column((1, 3, 6, 1, 4, 1, 800, 2, 18, 7, 26, 1, 5), integer32().subtype(subtypeSpec=value_range_constraint(0, 100))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
health2DeviceCpu1HrMax.setStatus('mandatory')
health2_device_vcc_latest = mib_scalar((1, 3, 6, 1, 4, 1, 800, 2, 18, 7, 27), integer32().subtype(subtypeSpec=value_range_constraint(0, 100))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
health2DeviceVccLatest.setStatus('mandatory')
health2_device_vcc1_min_avg = mib_scalar((1, 3, 6, 1, 4, 1, 800, 2, 18, 7, 28), integer32().subtype(subtypeSpec=value_range_constraint(0, 100))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
health2DeviceVcc1MinAvg.setStatus('mandatory')
health2_device_vcc1_hr_avg = mib_scalar((1, 3, 6, 1, 4, 1, 800, 2, 18, 7, 29), integer32().subtype(subtypeSpec=value_range_constraint(0, 100))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
health2DeviceVcc1HrAvg.setStatus('mandatory')
health2_device_vcc1_hr_max = mib_scalar((1, 3, 6, 1, 4, 1, 800, 2, 18, 7, 30), integer32().subtype(subtypeSpec=value_range_constraint(0, 100))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
health2DeviceVcc1HrMax.setStatus('mandatory')
health2_device_temperature_latest = mib_scalar((1, 3, 6, 1, 4, 1, 800, 2, 18, 7, 31), integer32().subtype(subtypeSpec=value_range_constraint(0, 100))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
health2DeviceTemperatureLatest.setStatus('mandatory')
health2_device_temperature1_min_avg = mib_scalar((1, 3, 6, 1, 4, 1, 800, 2, 18, 7, 32), integer32().subtype(subtypeSpec=value_range_constraint(0, 100))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
health2DeviceTemperature1MinAvg.setStatus('mandatory')
health2_device_temperature1_hr_avg = mib_scalar((1, 3, 6, 1, 4, 1, 800, 2, 18, 7, 33), integer32().subtype(subtypeSpec=value_range_constraint(0, 100))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
health2DeviceTemperature1HrAvg.setStatus('mandatory')
health2_device_temperature1_hr_max = mib_scalar((1, 3, 6, 1, 4, 1, 800, 2, 18, 7, 34), integer32().subtype(subtypeSpec=value_range_constraint(0, 100))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
health2DeviceTemperature1HrMax.setStatus('mandatory')
health2_device_vp_latest = mib_scalar((1, 3, 6, 1, 4, 1, 800, 2, 18, 7, 35), integer32().subtype(subtypeSpec=value_range_constraint(0, 100))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
health2DeviceVpLatest.setStatus('mandatory')
health2_device_vp1_min_avg = mib_scalar((1, 3, 6, 1, 4, 1, 800, 2, 18, 7, 36), integer32().subtype(subtypeSpec=value_range_constraint(0, 100))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
health2DeviceVp1MinAvg.setStatus('mandatory')
health2_device_vp1_hr_avg = mib_scalar((1, 3, 6, 1, 4, 1, 800, 2, 18, 7, 37), integer32().subtype(subtypeSpec=value_range_constraint(0, 100))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
health2DeviceVp1HrAvg.setStatus('mandatory')
health2_device_vp1_hr_max = mib_scalar((1, 3, 6, 1, 4, 1, 800, 2, 18, 7, 38), integer32().subtype(subtypeSpec=value_range_constraint(0, 100))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
health2DeviceVp1HrMax.setStatus('mandatory')
health2_device_hre_collision_latest = mib_scalar((1, 3, 6, 1, 4, 1, 800, 2, 18, 7, 39), integer32().subtype(subtypeSpec=value_range_constraint(0, 100))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
health2DeviceHreCollisionLatest.setStatus('mandatory')
health2_device_hre_collision1_min_avg = mib_scalar((1, 3, 6, 1, 4, 1, 800, 2, 18, 7, 40), integer32().subtype(subtypeSpec=value_range_constraint(0, 100))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
health2DeviceHreCollision1MinAvg.setStatus('mandatory')
health2_device_hre_collision1_hr_avg = mib_scalar((1, 3, 6, 1, 4, 1, 800, 2, 18, 7, 41), integer32().subtype(subtypeSpec=value_range_constraint(0, 100))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
health2DeviceHreCollision1HrAvg.setStatus('mandatory')
health2_device_hre_collision1_hr_max = mib_scalar((1, 3, 6, 1, 4, 1, 800, 2, 18, 7, 42), integer32().subtype(subtypeSpec=value_range_constraint(0, 100))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
health2DeviceHreCollision1HrMax.setStatus('mandatory')
health2_module_table = mib_table((1, 3, 6, 1, 4, 1, 800, 2, 18, 8, 1))
if mibBuilder.loadTexts:
health2ModuleTable.setStatus('mandatory')
health2_module_entry = mib_table_row((1, 3, 6, 1, 4, 1, 800, 2, 18, 8, 1, 1)).setIndexNames((0, 'XYLAN-HEALTH-MIB', 'health2ModuleSlot'))
if mibBuilder.loadTexts:
health2ModuleEntry.setStatus('mandatory')
health2_module_slot = mib_table_column((1, 3, 6, 1, 4, 1, 800, 2, 18, 8, 1, 1, 1), integer32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
health2ModuleSlot.setStatus('mandatory')
health2_module_rx_latest = mib_table_column((1, 3, 6, 1, 4, 1, 800, 2, 18, 8, 1, 1, 2), integer32().subtype(subtypeSpec=value_range_constraint(0, 100))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
health2ModuleRxLatest.setStatus('mandatory')
health2_module_rx1_min_avg = mib_table_column((1, 3, 6, 1, 4, 1, 800, 2, 18, 8, 1, 1, 3), integer32().subtype(subtypeSpec=value_range_constraint(0, 100))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
health2ModuleRx1MinAvg.setStatus('mandatory')
health2_module_rx1_hr_avg = mib_table_column((1, 3, 6, 1, 4, 1, 800, 2, 18, 8, 1, 1, 4), integer32().subtype(subtypeSpec=value_range_constraint(0, 100))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
health2ModuleRx1HrAvg.setStatus('mandatory')
health2_module_rx1_hr_max = mib_table_column((1, 3, 6, 1, 4, 1, 800, 2, 18, 8, 1, 1, 5), integer32().subtype(subtypeSpec=value_range_constraint(0, 100))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
health2ModuleRx1HrMax.setStatus('mandatory')
health2_module_rx_tx_latest = mib_table_column((1, 3, 6, 1, 4, 1, 800, 2, 18, 8, 1, 1, 6), integer32().subtype(subtypeSpec=value_range_constraint(0, 100))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
health2ModuleRxTxLatest.setStatus('mandatory')
health2_module_rx_tx1_min_avg = mib_table_column((1, 3, 6, 1, 4, 1, 800, 2, 18, 8, 1, 1, 7), integer32().subtype(subtypeSpec=value_range_constraint(0, 100))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
health2ModuleRxTx1MinAvg.setStatus('mandatory')
health2_module_rx_tx1_hr_avg = mib_table_column((1, 3, 6, 1, 4, 1, 800, 2, 18, 8, 1, 1, 8), integer32().subtype(subtypeSpec=value_range_constraint(0, 100))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
health2ModuleRxTx1HrAvg.setStatus('mandatory')
health2_module_rx_tx1_hr_max = mib_table_column((1, 3, 6, 1, 4, 1, 800, 2, 18, 8, 1, 1, 9), integer32().subtype(subtypeSpec=value_range_constraint(0, 100))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
health2ModuleRxTx1HrMax.setStatus('mandatory')
health2_module_backplane_latest = mib_table_column((1, 3, 6, 1, 4, 1, 800, 2, 18, 8, 1, 1, 10), integer32().subtype(subtypeSpec=value_range_constraint(0, 100))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
health2ModuleBackplaneLatest.setStatus('mandatory')
health2_module_backplane1_min_avg = mib_table_column((1, 3, 6, 1, 4, 1, 800, 2, 18, 8, 1, 1, 11), integer32().subtype(subtypeSpec=value_range_constraint(0, 100))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
health2ModuleBackplane1MinAvg.setStatus('mandatory')
health2_module_backplane1_hr_avg = mib_table_column((1, 3, 6, 1, 4, 1, 800, 2, 18, 8, 1, 1, 12), integer32().subtype(subtypeSpec=value_range_constraint(0, 100))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
health2ModuleBackplane1HrAvg.setStatus('mandatory')
health2_module_backplane1_hr_max = mib_table_column((1, 3, 6, 1, 4, 1, 800, 2, 18, 8, 1, 1, 13), integer32().subtype(subtypeSpec=value_range_constraint(0, 100))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
health2ModuleBackplane1HrMax.setStatus('mandatory')
health2_module_cam_latest = mib_table_column((1, 3, 6, 1, 4, 1, 800, 2, 18, 8, 1, 1, 14), integer32().subtype(subtypeSpec=value_range_constraint(0, 100))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
health2ModuleCamLatest.setStatus('mandatory')
health2_module_cam1_min_avg = mib_table_column((1, 3, 6, 1, 4, 1, 800, 2, 18, 8, 1, 1, 15), integer32().subtype(subtypeSpec=value_range_constraint(0, 100))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
health2ModuleCam1MinAvg.setStatus('mandatory')
health2_module_cam1_hr_avg = mib_table_column((1, 3, 6, 1, 4, 1, 800, 2, 18, 8, 1, 1, 16), integer32().subtype(subtypeSpec=value_range_constraint(0, 100))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
health2ModuleCam1HrAvg.setStatus('mandatory')
health2_module_cam1_hr_max = mib_table_column((1, 3, 6, 1, 4, 1, 800, 2, 18, 8, 1, 1, 17), integer32().subtype(subtypeSpec=value_range_constraint(0, 100))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
health2ModuleCam1HrMax.setStatus('mandatory')
health2_module_vcc_latest = mib_table_column((1, 3, 6, 1, 4, 1, 800, 2, 18, 8, 1, 1, 18), integer32().subtype(subtypeSpec=value_range_constraint(0, 100))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
health2ModuleVccLatest.setStatus('mandatory')
health2_module_vcc1_min_avg = mib_table_column((1, 3, 6, 1, 4, 1, 800, 2, 18, 8, 1, 1, 19), integer32().subtype(subtypeSpec=value_range_constraint(0, 100))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
health2ModuleVcc1MinAvg.setStatus('mandatory')
health2_module_vcc1_hr_avg = mib_table_column((1, 3, 6, 1, 4, 1, 800, 2, 18, 8, 1, 1, 20), integer32().subtype(subtypeSpec=value_range_constraint(0, 100))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
health2ModuleVcc1HrAvg.setStatus('mandatory')
health2_module_vcc1_hr_max = mib_table_column((1, 3, 6, 1, 4, 1, 800, 2, 18, 8, 1, 1, 21), integer32().subtype(subtypeSpec=value_range_constraint(0, 100))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
health2ModuleVcc1HrMax.setStatus('mandatory')
health2_port_table = mib_table((1, 3, 6, 1, 4, 1, 800, 2, 18, 9, 1))
if mibBuilder.loadTexts:
health2PortTable.setStatus('mandatory')
health2_port_entry = mib_table_row((1, 3, 6, 1, 4, 1, 800, 2, 18, 9, 1, 1)).setIndexNames((0, 'XYLAN-HEALTH-MIB', 'health2PortSlot'), (0, 'XYLAN-HEALTH-MIB', 'health2PortIF'))
if mibBuilder.loadTexts:
health2PortEntry.setStatus('mandatory')
health2_port_slot = mib_table_column((1, 3, 6, 1, 4, 1, 800, 2, 18, 9, 1, 1, 1), integer32().subtype(subtypeSpec=value_range_constraint(1, 9))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
health2PortSlot.setStatus('mandatory')
health2_port_if = mib_table_column((1, 3, 6, 1, 4, 1, 800, 2, 18, 9, 1, 1, 2), integer32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
health2PortIF.setStatus('mandatory')
health2_port_rx_latest = mib_table_column((1, 3, 6, 1, 4, 1, 800, 2, 18, 9, 1, 1, 3), integer32().subtype(subtypeSpec=value_range_constraint(0, 100))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
health2PortRxLatest.setStatus('mandatory')
health2_port_rx1_min_avg = mib_table_column((1, 3, 6, 1, 4, 1, 800, 2, 18, 9, 1, 1, 4), integer32().subtype(subtypeSpec=value_range_constraint(0, 100))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
health2PortRx1MinAvg.setStatus('mandatory')
health2_port_rx1_hr_avg = mib_table_column((1, 3, 6, 1, 4, 1, 800, 2, 18, 9, 1, 1, 5), integer32().subtype(subtypeSpec=value_range_constraint(0, 100))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
health2PortRx1HrAvg.setStatus('mandatory')
health2_port_rx1_hr_max = mib_table_column((1, 3, 6, 1, 4, 1, 800, 2, 18, 9, 1, 1, 6), integer32().subtype(subtypeSpec=value_range_constraint(0, 100))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
health2PortRx1HrMax.setStatus('mandatory')
health2_port_rx_tx_latest = mib_table_column((1, 3, 6, 1, 4, 1, 800, 2, 18, 9, 1, 1, 7), integer32().subtype(subtypeSpec=value_range_constraint(0, 100))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
health2PortRxTxLatest.setStatus('mandatory')
health2_port_rx_tx1_min_avg = mib_table_column((1, 3, 6, 1, 4, 1, 800, 2, 18, 9, 1, 1, 8), integer32().subtype(subtypeSpec=value_range_constraint(0, 100))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
health2PortRxTx1MinAvg.setStatus('mandatory')
health2_port_rx_tx1_hr_avg = mib_table_column((1, 3, 6, 1, 4, 1, 800, 2, 18, 9, 1, 1, 9), integer32().subtype(subtypeSpec=value_range_constraint(0, 100))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
health2PortRxTx1HrAvg.setStatus('mandatory')
health2_port_rx_tx1_hr_max = mib_table_column((1, 3, 6, 1, 4, 1, 800, 2, 18, 9, 1, 1, 10), integer32().subtype(subtypeSpec=value_range_constraint(0, 100))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
health2PortRxTx1HrMax.setStatus('mandatory')
health2_port_backplane_latest = mib_table_column((1, 3, 6, 1, 4, 1, 800, 2, 18, 9, 1, 1, 11), integer32().subtype(subtypeSpec=value_range_constraint(0, 100))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
health2PortBackplaneLatest.setStatus('mandatory')
health2_port_backplane1_min_avg = mib_table_column((1, 3, 6, 1, 4, 1, 800, 2, 18, 9, 1, 1, 12), integer32().subtype(subtypeSpec=value_range_constraint(0, 100))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
health2PortBackplane1MinAvg.setStatus('mandatory')
health2_port_backplane1_hr_avg = mib_table_column((1, 3, 6, 1, 4, 1, 800, 2, 18, 9, 1, 1, 13), integer32().subtype(subtypeSpec=value_range_constraint(0, 100))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
health2PortBackplane1HrAvg.setStatus('mandatory')
health2_port_backplane1_hr_max = mib_table_column((1, 3, 6, 1, 4, 1, 800, 2, 18, 9, 1, 1, 14), integer32().subtype(subtypeSpec=value_range_constraint(0, 100))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
health2PortBackplane1HrMax.setStatus('mandatory')
health2_port_vcc_latest = mib_table_column((1, 3, 6, 1, 4, 1, 800, 2, 18, 9, 1, 1, 15), integer32().subtype(subtypeSpec=value_range_constraint(0, 100))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
health2PortVccLatest.setStatus('mandatory')
health2_port_vcc1_min_avg = mib_table_column((1, 3, 6, 1, 4, 1, 800, 2, 18, 9, 1, 1, 16), integer32().subtype(subtypeSpec=value_range_constraint(0, 100))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
health2PortVcc1MinAvg.setStatus('mandatory')
health2_port_vcc1_hr_avg = mib_table_column((1, 3, 6, 1, 4, 1, 800, 2, 18, 9, 1, 1, 17), integer32().subtype(subtypeSpec=value_range_constraint(0, 100))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
health2PortVcc1HrAvg.setStatus('mandatory')
health2_port_vcc1_hr_max = mib_table_column((1, 3, 6, 1, 4, 1, 800, 2, 18, 9, 1, 1, 18), integer32().subtype(subtypeSpec=value_range_constraint(0, 100))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
health2PortVcc1HrMax.setStatus('mandatory')
mibBuilder.exportSymbols('XYLAN-HEALTH-MIB', healthThreshPortSummaryIF=healthThreshPortSummaryIF, healthDeviceTemp=healthDeviceTemp, healthDeviceMpmRxOverrunCount=healthDeviceMpmRxOverrunCount, healthThreshDeviceRxLimit=healthThreshDeviceRxLimit, healthDeviceRxTxData=healthDeviceRxTxData, healthPortRxTxTimeDelta=healthPortRxTxTimeDelta, health2PortSlot=health2PortSlot, health2DeviceHreCamLatest=health2DeviceHreCamLatest, health2DeviceBackplaneLatest=health2DeviceBackplaneLatest, health2ModuleVcc1MinAvg=health2ModuleVcc1MinAvg, healthPortRxData=healthPortRxData, health2DeviceCpu1MinAvg=health2DeviceCpu1MinAvg, health2DeviceHreCam1HrMax=health2DeviceHreCam1HrMax, health2ModuleRx1HrMax=health2ModuleRx1HrMax, healthThreshModTrapCount=healthThreshModTrapCount, healthPortVccTimeDelta=healthPortVccTimeDelta, health2ModuleSlot=health2ModuleSlot, healthDeviceHreCamTotal=healthDeviceHreCamTotal, healthDeviceTemperatureTimeDelta=healthDeviceTemperatureTimeDelta, health2PortBackplaneLatest=health2PortBackplaneLatest, health2DeviceVcc1HrMax=health2DeviceVcc1HrMax, health2DeviceHreCollision1HrMax=health2DeviceHreCollision1HrMax, healthPortIF=healthPortIF, health2DeviceCpu1HrMax=health2DeviceCpu1HrMax, healthThreshDeviceBackplaneLimit=healthThreshDeviceBackplaneLimit, healthDeviceVpTimeDelta=healthDeviceVpTimeDelta, health2DeviceHreCollision1MinAvg=health2DeviceHreCollision1MinAvg, health2DeviceInfo=health2DeviceInfo, healthThreshDeviceVpLimit=healthThreshDeviceVpLimit, healthDeviceVccData=healthDeviceVccData, healthDeviceTemperatureData=healthDeviceTemperatureData, healthPortEntry=healthPortEntry, healthThreshPortSummarySlot=healthThreshPortSummarySlot, health2PortRxLatest=health2PortRxLatest, healthThreshDeviceSummary=healthThreshDeviceSummary, healthDeviceCpuTimeDelta=healthDeviceCpuTimeDelta, health2DeviceRxTx1HrAvg=health2DeviceRxTx1HrAvg, healthModuleRxData=healthModuleRxData, health2DeviceCpuNum=health2DeviceCpuNum, healthDeviceMpmCamFree=healthDeviceMpmCamFree, healthThreshDeviceMemoryLimit=healthThreshDeviceMemoryLimit, health2ModuleCam1HrMax=health2ModuleCam1HrMax, health2DeviceTemperature1HrAvg=health2DeviceTemperature1HrAvg, health2ModuleCam1MinAvg=health2ModuleCam1MinAvg, healthThreshPortTrapCount=healthThreshPortTrapCount, health2ModuleInfo=health2ModuleInfo, health2ModuleBackplaneLatest=health2ModuleBackplaneLatest, health2PortRxTxLatest=health2PortRxTxLatest, health2ModuleRx1HrAvg=health2ModuleRx1HrAvg, HealthPortUpDownStatus=HealthPortUpDownStatus, healthDeviceRxTimeDelta=healthDeviceRxTimeDelta, health2DeviceRx1MinAvg=health2DeviceRx1MinAvg, health2DeviceHreCam1MinAvg=health2DeviceHreCam1MinAvg, healthPortSlot=healthPortSlot, health2ModuleBackplane1MinAvg=health2ModuleBackplane1MinAvg, healthControlInfo=healthControlInfo, healthThreshDeviceVccLimit=healthThreshDeviceVccLimit, health2DeviceVp1HrMax=health2DeviceVp1HrMax, health2ModuleCam1HrAvg=health2ModuleCam1HrAvg, healthThreshModuleSummaryEntry=healthThreshModuleSummaryEntry, health2PortBackplane1HrAvg=health2PortBackplane1HrAvg, health2PortVcc1HrAvg=health2PortVcc1HrAvg, health2ModuleEntry=health2ModuleEntry, health2PortRx1MinAvg=health2PortRx1MinAvg, healthModuleCamConfigured=healthModuleCamConfigured, health2DeviceNumCpus=health2DeviceNumCpus, healthDeviceBackplaneTimeDelta=healthDeviceBackplaneTimeDelta, health2ModuleRxTx1HrAvg=health2ModuleRxTx1HrAvg, healthDeviceBackplaneData=healthDeviceBackplaneData, healthPortRxTxData=healthPortRxTxData, healthDeviceMemoryTimeDelta=healthDeviceMemoryTimeDelta, healthDeviceHreCamFree=healthDeviceHreCamFree, healthThreshPortSummaryEntry=healthThreshPortSummaryEntry, health2DeviceMpmCam1HrAvg=health2DeviceMpmCam1HrAvg, health2DeviceRx1HrMax=health2DeviceRx1HrMax, healthModuleInfo=healthModuleInfo, health2ModuleBackplane1HrAvg=health2ModuleBackplane1HrAvg, health2ModuleCamLatest=health2ModuleCamLatest, healthDeviceRxTxTimeDelta=healthDeviceRxTxTimeDelta, health2DeviceRxLatest=health2DeviceRxLatest, health2PortEntry=health2PortEntry, healthModuleRxTxData=healthModuleRxTxData, healthModuleVccTimeDelta=healthModuleVccTimeDelta, health2DeviceMpmCam1HrMax=health2DeviceMpmCam1HrMax, healthDeviceVccTimeDelta=healthDeviceVccTimeDelta, health2DeviceMemoryLatest=health2DeviceMemoryLatest, health2DeviceMpmCam1MinAvg=health2DeviceMpmCam1MinAvg, health2ModuleRxTx1HrMax=health2ModuleRxTx1HrMax, health2DeviceVpLatest=health2DeviceVpLatest, healthThreshDeviceCamLimit=healthThreshDeviceCamLimit, healthDeviceRxData=healthDeviceRxData, healthThreshInfo=healthThreshInfo, healthModuleVccData=healthModuleVccData, health2DeviceCpuTable=health2DeviceCpuTable, healthDeviceIPXRouteCacheFlushCount=healthDeviceIPXRouteCacheFlushCount, health2PortRx1HrMax=health2PortRx1HrMax, healthPortUpDn=healthPortUpDn, healthPortBackplaneData=healthPortBackplaneData, health2DeviceCpuEntry=health2DeviceCpuEntry, healthDeviceMemoryFree=healthDeviceMemoryFree, healthPortRxTimeDelta=healthPortRxTimeDelta, healthModuleRxTxTimeDelta=healthModuleRxTxTimeDelta, health2ModuleRxTxLatest=health2ModuleRxTxLatest, healthSamplingInterval=healthSamplingInterval, healthPortVccData=healthPortVccData, healthModuleCamData=healthModuleCamData, health2DeviceVccLatest=health2DeviceVccLatest, healthThreshDeviceCpuLimit=healthThreshDeviceCpuLimit, health2DeviceTemperature1HrMax=health2DeviceTemperature1HrMax, healthDeviceMpmTxOverrunCount=healthDeviceMpmTxOverrunCount, health2DeviceBackplane1HrAvg=health2DeviceBackplane1HrAvg, health2PortBackplane1HrMax=health2PortBackplane1HrMax, health2PortVcc1MinAvg=health2PortVcc1MinAvg, health2PortInfo=health2PortInfo, healthPortBackplaneTimeDelta=healthPortBackplaneTimeDelta, health2PortRx1HrAvg=health2PortRx1HrAvg, health2PortTable=health2PortTable, healthThreshModTrapData=healthThreshModTrapData, healthModuleCamNumInstalled=healthModuleCamNumInstalled, health2DeviceMpmCamLatest=health2DeviceMpmCamLatest, health2DeviceHreCam1HrAvg=health2DeviceHreCam1HrAvg, healthDeviceIPRouteCacheFlushCount=healthDeviceIPRouteCacheFlushCount, healthDeviceMemoryTotal=healthDeviceMemoryTotal, healthDeviceHreCollisionTotal=healthDeviceHreCollisionTotal, healthModuleBackplaneTimeDelta=healthModuleBackplaneTimeDelta, healthPortMax=healthPortMax, health2ModuleVcc1HrMax=health2ModuleVcc1HrMax, health2ModuleBackplane1HrMax=health2ModuleBackplane1HrMax, health2PortBackplane1MinAvg=health2PortBackplane1MinAvg, health2DeviceTemperature1MinAvg=health2DeviceTemperature1MinAvg, health2DeviceVcc1MinAvg=health2DeviceVcc1MinAvg, healthThreshModuleSummaryData=healthThreshModuleSummaryData, healthThreshModuleSummarySlot=healthThreshModuleSummarySlot, health2ModuleRxTx1MinAvg=health2ModuleRxTx1MinAvg, health2DeviceBackplane1HrMax=health2DeviceBackplane1HrMax, healthDeviceNumCpus=healthDeviceNumCpus, healthDeviceInfo=healthDeviceInfo, healthDeviceMemoryData=healthDeviceMemoryData, health2DeviceHreCollision1HrAvg=health2DeviceHreCollision1HrAvg, healthModuleCamFree=healthModuleCamFree, healthModuleRxTimeDelta=healthModuleRxTimeDelta, healthDeviceHreCollisionFree=healthDeviceHreCollisionFree, healthModuleTable=healthModuleTable, healthPortInfo=healthPortInfo, healthThreshPortSummaryData=healthThreshPortSummaryData, health2DeviceBackplane1MinAvg=health2DeviceBackplane1MinAvg, healthThreshPortTrapData=healthThreshPortTrapData, health2PortVccLatest=health2PortVccLatest, healthThreshModuleSummaryTable=healthThreshModuleSummaryTable, healthThreshPortTrapSlot=healthThreshPortTrapSlot, healthGroupInfo=healthGroupInfo, health2PortRxTx1MinAvg=health2PortRxTx1MinAvg, healthModuleBackplaneData=healthModuleBackplaneData, health2DeviceTemperatureLatest=health2DeviceTemperatureLatest, healthModuleCamAvailNonIntern=healthModuleCamAvailNonIntern, healthSamplingReset=healthSamplingReset, health2PortIF=health2PortIF, health2PortVcc1HrMax=health2PortVcc1HrMax, health2DeviceVp1MinAvg=health2DeviceVp1MinAvg, healthDeviceVpData=healthDeviceVpData, health2DeviceMemory1HrMax=health2DeviceMemory1HrMax, health2DeviceCpu1HrAvg=health2DeviceCpu1HrAvg, healthModuleCamTimeDelta=healthModuleCamTimeDelta, health2DeviceCpuLatest=health2DeviceCpuLatest, health2DeviceHreCollisionLatest=health2DeviceHreCollisionLatest, healthDeviceMpmCamTotal=healthDeviceMpmCamTotal, health2ModuleRx1MinAvg=health2ModuleRx1MinAvg, healthDeviceCamData=healthDeviceCamData, health2DeviceVp1HrAvg=health2DeviceVp1HrAvg, healthModuleEntry=healthModuleEntry, healthPortTable=healthPortTable, health2DeviceRxTx1MinAvg=health2DeviceRxTx1MinAvg, health2ModuleVcc1HrAvg=health2ModuleVcc1HrAvg, healthDeviceCpuData=healthDeviceCpuData, health2DeviceVcc1HrAvg=health2DeviceVcc1HrAvg, health2PortRxTx1HrAvg=health2PortRxTx1HrAvg, health2DeviceRx1HrAvg=health2DeviceRx1HrAvg, healthThreshDeviceTemperatureLimit=healthThreshDeviceTemperatureLimit, health2ModuleVccLatest=health2ModuleVccLatest, healthModuleCamAvail=healthModuleCamAvail, health2DeviceMemory1MinAvg=health2DeviceMemory1MinAvg, healthThreshDeviceRxTxLimit=healthThreshDeviceRxTxLimit, health2DeviceMemory1HrAvg=health2DeviceMemory1HrAvg, health2PortRxTx1HrMax=health2PortRxTx1HrMax, healthThreshDevTrapData=healthThreshDevTrapData, healthDeviceCamTimeDelta=healthDeviceCamTimeDelta, health2DeviceRxTxLatest=health2DeviceRxTxLatest, health2DeviceRxTx1HrMax=health2DeviceRxTx1HrMax, health2ModuleRxLatest=health2ModuleRxLatest, health2ModuleTable=health2ModuleTable, healthThreshPortSummaryTable=healthThreshPortSummaryTable, healthModuleSlot=healthModuleSlot) |
# parrot = "Norwegian Blue"
#
# for character in parrot:
# print(character)
number = '9,223;372:036 854,775;807'
seperators = ""
for char in number:
if not char.isnumeric():
seperators = seperators + char
print(seperators)
things = ["bed", "computer", "red", "desk"]
space = ""
for i in things:
if not "ed" in i:
space = space + i + " "
print(space)
print()
quote = """Alright, but apart from the Sanitation, the Medicine, Education, Wine,
Public Order, Irrigation, Roads, the Fresh-Water System,
and Public Health, what have the Romans ever done for us?"""
capitals = ""
for i in quote:
if i.isupper():
capitals = capitals + i
print(capitals)
upperCase = ""
for i in quote:
if i in "ABCDEFGHIJKLMNOPQRSTUVWXYZ":
upperCase = upperCase + i
print(upperCase)
| number = '9,223;372:036 854,775;807'
seperators = ''
for char in number:
if not char.isnumeric():
seperators = seperators + char
print(seperators)
things = ['bed', 'computer', 'red', 'desk']
space = ''
for i in things:
if not 'ed' in i:
space = space + i + ' '
print(space)
print()
quote = 'Alright, but apart from the Sanitation, the Medicine, Education, Wine,\nPublic Order, Irrigation, Roads, the Fresh-Water System,\nand Public Health, what have the Romans ever done for us?'
capitals = ''
for i in quote:
if i.isupper():
capitals = capitals + i
print(capitals)
upper_case = ''
for i in quote:
if i in 'ABCDEFGHIJKLMNOPQRSTUVWXYZ':
upper_case = upperCase + i
print(upperCase) |
""" Settings for running tests. """
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': ':memory:',
}
}
SECRET_KEY = '8ij$(7l2!w0f8kggntbv=+$bd=^2xs$cl+3v^_##qjw@2py9_3'
INSTALLED_APPS = ('django.contrib.admin', 'django.contrib.auth',
'django.contrib.contenttypes', 'django.contrib.sessions',
'django.contrib.messages', 'django.contrib.staticfiles',
'django_zip_stream', 'django_nose')
MIDDLEWARE_CLASSES = (
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware', )
# Use nose to run all tests
TEST_RUNNER = 'django_nose.NoseTestSuiteRunner'
NOSE_ARGS = [
'--with-coverage',
'--cover-package=django_zip_stream',
'--cover-branches',
'--cover-erase',
]
| """ Settings for running tests. """
databases = {'default': {'ENGINE': 'django.db.backends.sqlite3', 'NAME': ':memory:'}}
secret_key = '8ij$(7l2!w0f8kggntbv=+$bd=^2xs$cl+3v^_##qjw@2py9_3'
installed_apps = ('django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', 'django_zip_stream', 'django_nose')
middleware_classes = ('django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.common.CommonMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.auth.middleware.SessionAuthenticationMiddleware', 'django.contrib.messages.middleware.MessageMiddleware', 'django.middleware.clickjacking.XFrameOptionsMiddleware')
test_runner = 'django_nose.NoseTestSuiteRunner'
nose_args = ['--with-coverage', '--cover-package=django_zip_stream', '--cover-branches', '--cover-erase'] |
expected_output = {
'vll': {
'MY-UNTAGGED-VLL': {
'vcid': 3566,
'vll_index': 37,
'local': {
'type': 'untagged',
'interface': 'ethernet2/8',
'state': 'Up',
'mct_state': 'None',
'ifl_id': '--',
'vc_type': 'tag',
'mtu': 9190,
'cos': '--',
'extended_counters': True
},
'peer': {
'ip': '192.168.1.2',
'state': 'UP',
'vc_type': 'tag',
'mtu': 9190,
'local_label': 851974,
'remote_label': 852059,
'local_group_id': 0,
'remote_group_id': 0,
'tunnel_lsp': {
'name': 'my_untagged-lsp',
'tunnel_interface': 'tnl32'
},
'lsps_assigned': 'No LSPs assigned'
}
}
}
}
| expected_output = {'vll': {'MY-UNTAGGED-VLL': {'vcid': 3566, 'vll_index': 37, 'local': {'type': 'untagged', 'interface': 'ethernet2/8', 'state': 'Up', 'mct_state': 'None', 'ifl_id': '--', 'vc_type': 'tag', 'mtu': 9190, 'cos': '--', 'extended_counters': True}, 'peer': {'ip': '192.168.1.2', 'state': 'UP', 'vc_type': 'tag', 'mtu': 9190, 'local_label': 851974, 'remote_label': 852059, 'local_group_id': 0, 'remote_group_id': 0, 'tunnel_lsp': {'name': 'my_untagged-lsp', 'tunnel_interface': 'tnl32'}, 'lsps_assigned': 'No LSPs assigned'}}}} |
#
# @lc app=leetcode id=72 lang=python3
#
# [72] Edit Distance
#
# https://leetcode.com/problems/edit-distance/description/
#
# algorithms
# Hard (40.50%)
# Likes: 2795
# Dislikes: 44
# Total Accepted: 213.4K
# Total Submissions: 526.3K
# Testcase Example: '"horse"\n"ros"'
#
# Given two words word1 and word2, find the minimum number of operations
# required to convert word1 to word2.
#
# You have the following 3 operations permitted on a word:
#
#
# Insert a character
# Delete a character
# Replace a character
#
#
# Example 1:
#
#
# Input: word1 = "horse", word2 = "ros"
# Output: 3
# Explanation:
# horse -> rorse (replace 'h' with 'r')
# rorse -> rose (remove 'r')
# rose -> ros (remove 'e')
#
#
# Example 2:
#
#
# Input: word1 = "intention", word2 = "execution"
# Output: 5
# Explanation:
# intention -> inention (remove 't')
# inention -> enention (replace 'i' with 'e')
# enention -> exention (replace 'n' with 'x')
# exention -> exection (replace 'n' with 'c')
# exection -> execution (insert 'u')
#
#
#
# @lc code=start
class Solution:
def minDistance(self, word1: str, word2: str) -> int:
return self.dp_bottom_up(word1, word2)
def dp_bottom_up(self, word1: str, word2: str) -> int:
"""
dp bottom up solution
"""
memo = [[0] * (len(word2) + 1) for _ in range(len(word1) + 1)]
for i in range(len(word1) + 1):
memo[i][0] = i
for j in range(len(word2) + 1):
memo[0][j] = j
for i in range(1, len(word1) + 1):
for j in range(1, len(word2) + 1):
if word1[i - 1] == word2[j - 1]:
memo[i][j] = memo[i - 1][j - 1]
else:
memo[i][j] = 1 + min(memo[i - 1][j],
memo[i][j - 1],
memo[i - 1][j - 1])
return memo[-1][-1]
def dp_memoize(self, word1: str, word2: str) -> int:
"""
dp memoized solution
"""
memo = [[None] * len(word2) for _ in range(len(word1))]
def helper(i: int, j: int) -> int:
if i >= len(word1) and j >= len(word2):
return 0
if i >= len(word1) or j >= len(word2):
return max(len(word1) - i, len(word2) - j)
if word1[i:] == word2[j:]:
return 0
if memo[i][j] is None:
if word1[i] == word2[j]:
return helper(i + 1, j + 1)
insert = helper(i + 1, j)
remove = helper(i, j + 1)
replace = helper(i + 1, j + 1)
res = 1 + min(insert, remove, replace)
memo[i][j] = res
return memo[i][j]
return helper(0, 0)
def dp_recursive(self, word1: str, word2: str) -> int:
"""
DP recursive Solution
Let P(word1, word2) := min number of moves to match word 1 and word 2
P(word1, word2) =
1. 0 if word1 == word2
2. 1 + min(A, B, C)
where A = insert a char, B = remove a char, C = replace a char
"""
def helper(word1: str, word2: str) -> int:
if word1 == word2:
return 0
if word1 == "" or word2 == "":
return max(len(word1), len(word2))
if word1[0] == word2[0]:
return helper(word1[1:], word2[1:])
insert = helper(word1[1:], word2)
remove = helper(word1, word2[1:])
replace = helper(word1[1:], word2[1:])
return 1 + min(insert, remove, replace)
return helper(word1, word2)
# @lc code=end
if __name__ == "__main__":
print(Solution().minDistance("horse", "ros"), 3)
| class Solution:
def min_distance(self, word1: str, word2: str) -> int:
return self.dp_bottom_up(word1, word2)
def dp_bottom_up(self, word1: str, word2: str) -> int:
"""
dp bottom up solution
"""
memo = [[0] * (len(word2) + 1) for _ in range(len(word1) + 1)]
for i in range(len(word1) + 1):
memo[i][0] = i
for j in range(len(word2) + 1):
memo[0][j] = j
for i in range(1, len(word1) + 1):
for j in range(1, len(word2) + 1):
if word1[i - 1] == word2[j - 1]:
memo[i][j] = memo[i - 1][j - 1]
else:
memo[i][j] = 1 + min(memo[i - 1][j], memo[i][j - 1], memo[i - 1][j - 1])
return memo[-1][-1]
def dp_memoize(self, word1: str, word2: str) -> int:
"""
dp memoized solution
"""
memo = [[None] * len(word2) for _ in range(len(word1))]
def helper(i: int, j: int) -> int:
if i >= len(word1) and j >= len(word2):
return 0
if i >= len(word1) or j >= len(word2):
return max(len(word1) - i, len(word2) - j)
if word1[i:] == word2[j:]:
return 0
if memo[i][j] is None:
if word1[i] == word2[j]:
return helper(i + 1, j + 1)
insert = helper(i + 1, j)
remove = helper(i, j + 1)
replace = helper(i + 1, j + 1)
res = 1 + min(insert, remove, replace)
memo[i][j] = res
return memo[i][j]
return helper(0, 0)
def dp_recursive(self, word1: str, word2: str) -> int:
"""
DP recursive Solution
Let P(word1, word2) := min number of moves to match word 1 and word 2
P(word1, word2) =
1. 0 if word1 == word2
2. 1 + min(A, B, C)
where A = insert a char, B = remove a char, C = replace a char
"""
def helper(word1: str, word2: str) -> int:
if word1 == word2:
return 0
if word1 == '' or word2 == '':
return max(len(word1), len(word2))
if word1[0] == word2[0]:
return helper(word1[1:], word2[1:])
insert = helper(word1[1:], word2)
remove = helper(word1, word2[1:])
replace = helper(word1[1:], word2[1:])
return 1 + min(insert, remove, replace)
return helper(word1, word2)
if __name__ == '__main__':
print(solution().minDistance('horse', 'ros'), 3) |
"""
Reverse Words in a String III
Given a string, you need to reverse the order of characters in each word within a sentence while still preserving whitespace and initial word order.
Example 1:
Input: "Let's take LeetCode contest"
Output: "s'teL ekat edoCteeL tsetnoc"
Note: In the string, each word is separated by single space and there will not be any extra space in the string.
"""
class Solution(object):
def reverseWords(self, s):
"""
:type s: str
:rtype: str
"""
if not s:
return s
words=s.split()
reversed_words=[word[::-1] for word in words]
return ' '.join(reversed_words)
# s = s[::-1]
#return " ".join(s.split(" ")[::-1]) | """
Reverse Words in a String III
Given a string, you need to reverse the order of characters in each word within a sentence while still preserving whitespace and initial word order.
Example 1:
Input: "Let's take LeetCode contest"
Output: "s'teL ekat edoCteeL tsetnoc"
Note: In the string, each word is separated by single space and there will not be any extra space in the string.
"""
class Solution(object):
def reverse_words(self, s):
"""
:type s: str
:rtype: str
"""
if not s:
return s
words = s.split()
reversed_words = [word[::-1] for word in words]
return ' '.join(reversed_words) |
class User:
def __init__(self, id = None, email = None, name = None, surname = None, password = None, wallet = 0.00, disability = False, active_account = False, id_user_category = 2): # id_user_category = 2 -> Student
self._id = id
self._email = email
self._name = name
self._surname = surname
self._password = password
self._wallet = wallet
self._disability = disability
self._active_account = active_account
self._id_user_category = id_user_category
def set_id(self, id):
self._id = id
# def set_email(self, email):
# self._email = email
# def set_name(self, name):
# self._name = name
# def set_surname(self, surname):
# self._surname = surname
def set_password(self, password):
self._password = password
def set_wallet(self, wallet):
self._wallet = wallet
def set_disability(self, disability):
self._disability = disability
def set_active_account(self, active_account):
self._active_account = active_account
# def set_id_user_category(self, id_user_category):
# self._id_user_category = id_user_category
def get_id(self):
return self._id
def get_email(self):
return self._email
def get_name(self):
return self._name
def get_surname(self):
return self._surname
def get_password(self):
return self._password
def get_wallet(self):
return self._wallet
def get_disability(self):
return self._disability
def get_active_account(self):
return self._active_account
def get_id_user_category(self):
return self._id_user_category
def __eq__(self, other):
if isinstance(other, User):
return self._id == other._id
return NotImplemented
def __str__(self):
user_info = (f"User Id: {self._id}, email: {self._email}, name: {self._name}, surname: {self._surname}, "
f"password: {self._password}, wallet: {self._wallet}, disability: {self._disability}, active accont: {self._active_account}, "
f"id_user_category: {self._id_user_category}")
return user_info
| class User:
def __init__(self, id=None, email=None, name=None, surname=None, password=None, wallet=0.0, disability=False, active_account=False, id_user_category=2):
self._id = id
self._email = email
self._name = name
self._surname = surname
self._password = password
self._wallet = wallet
self._disability = disability
self._active_account = active_account
self._id_user_category = id_user_category
def set_id(self, id):
self._id = id
def set_password(self, password):
self._password = password
def set_wallet(self, wallet):
self._wallet = wallet
def set_disability(self, disability):
self._disability = disability
def set_active_account(self, active_account):
self._active_account = active_account
def get_id(self):
return self._id
def get_email(self):
return self._email
def get_name(self):
return self._name
def get_surname(self):
return self._surname
def get_password(self):
return self._password
def get_wallet(self):
return self._wallet
def get_disability(self):
return self._disability
def get_active_account(self):
return self._active_account
def get_id_user_category(self):
return self._id_user_category
def __eq__(self, other):
if isinstance(other, User):
return self._id == other._id
return NotImplemented
def __str__(self):
user_info = f'User Id: {self._id}, email: {self._email}, name: {self._name}, surname: {self._surname}, password: {self._password}, wallet: {self._wallet}, disability: {self._disability}, active accont: {self._active_account}, id_user_category: {self._id_user_category}'
return user_info |
# 487. Max Consecutive Ones II
# Runtime: 420 ms, faster than 12.98% of Python3 online submissions for Max Consecutive Ones II.
# Memory Usage: 14.5 MB, less than 11.06% of Python3 online submissions for Max Consecutive Ones II.
class Solution:
_FLIP_COUNT = 1
# Sliding Window
def findMaxConsecutiveOnes(self, nums: list[int]) -> int:
assert Solution._FLIP_COUNT > 0
max_count = 0
left = 0
zero_idx = []
for right in range(len(nums)):
if nums[right] == 0:
zero_idx.append(right)
if len(zero_idx) > Solution._FLIP_COUNT:
left = zero_idx[0] + 1
del zero_idx[0]
max_count = max(max_count, right - left + 1)
return max_count | class Solution:
_flip_count = 1
def find_max_consecutive_ones(self, nums: list[int]) -> int:
assert Solution._FLIP_COUNT > 0
max_count = 0
left = 0
zero_idx = []
for right in range(len(nums)):
if nums[right] == 0:
zero_idx.append(right)
if len(zero_idx) > Solution._FLIP_COUNT:
left = zero_idx[0] + 1
del zero_idx[0]
max_count = max(max_count, right - left + 1)
return max_count |
# -*- coding:utf-8 -*-
# ---------------------------------------------
# @file options
# @description options
# @author WcJun
# @date 2021/08/02
# ---------------------------------------------
class RequestOptions(object):
def __init__(self, url, method='post',
body=None, parameters=None, headers=None, ssl=False, mock_enabled=False, mock_response=None):
"""
get-post-put-patch-delete
:param url:
:param method:
"""
self.url = url
self.method = method
self.body = body
self.headers = headers
self.parameters = parameters
self.ssl = ssl
self.mock = False
self.mock_enabled = mock_enabled
self.mock_response = mock_response
| class Requestoptions(object):
def __init__(self, url, method='post', body=None, parameters=None, headers=None, ssl=False, mock_enabled=False, mock_response=None):
"""
get-post-put-patch-delete
:param url:
:param method:
"""
self.url = url
self.method = method
self.body = body
self.headers = headers
self.parameters = parameters
self.ssl = ssl
self.mock = False
self.mock_enabled = mock_enabled
self.mock_response = mock_response |
x1, y1, x2, y2 = map(int, input().split())
dx = x2 - x1
dy = y2 - y1
ans = []
for i in range(2):
dx, dy = -dy, dx
x2 += dx
y2 += dy
ans.append(x2)
ans.append(y2)
print(*ans)
| (x1, y1, x2, y2) = map(int, input().split())
dx = x2 - x1
dy = y2 - y1
ans = []
for i in range(2):
(dx, dy) = (-dy, dx)
x2 += dx
y2 += dy
ans.append(x2)
ans.append(y2)
print(*ans) |
# O(NlogM) / O(1)
class Solution:
def shipWithinDays(self, weights: List[int], D: int) -> int:
def count(t):
ans, cur = 1, 0
for w in weights:
cur += w
if cur > t:
ans += 1
cur = w
return ans
l, r = max(weights), sum(weights) + 1
while l < r:
m = l + (r - l) // 2
if count(m) <= D:
r = m
else:
l = m + 1
return l | class Solution:
def ship_within_days(self, weights: List[int], D: int) -> int:
def count(t):
(ans, cur) = (1, 0)
for w in weights:
cur += w
if cur > t:
ans += 1
cur = w
return ans
(l, r) = (max(weights), sum(weights) + 1)
while l < r:
m = l + (r - l) // 2
if count(m) <= D:
r = m
else:
l = m + 1
return l |
x=oi()
q=x
z(q)
| x = oi()
q = x
z(q) |
#!/usr/bin/env python
"""
Author: Gianluca Biccari
Description: Implementation of an Hash Table with string keys
"""
class HashTable(object):
"""
Do-it by yourself implemenation in case you don't want to use the
built in data structure dictionary.
"""
def __init__(self):
# number of slots per hast table
self.size = 11
self.__load_factor_threshold = 100
# count the element stored in the hash table, to cotroll the load
# factor and eventually you could resize the table size.
self.count = 0
# conflicts resolution with chaining, we use a list per each slot
self.table = [[] for i in range(1, self.size + 1)]
def hash_function(self, key):
# raise an error if the key is not a string
if not isinstance(key, str):
raise KeyError('Key for hash table must be a string')
# hash value is build usin the reminder operator. we sum up the ordinal
# value of each char using position to weight the value to avoid
# collision on a palindrome
sum = 0
for i, char in enumerate(key):
sum = sum + ord(char) * (i+1)
return sum % self.size
def put(self, key, value):
hash_value = self.hash_function(key)
hash_list = self.table[hash_value]
# we store in the hash table a tuple, including the original key. This
# is necessary for implementing the remove method.
hash_data = (key, value)
hash_keys = [k for (k, v) in hash_list]
if key in hash_keys:
# we have already a value with that key, replace it
index = hash_keys.index(key)
hash_list[index] = hash_data
else:
# append the new value:
hash_list.append(hash_data)
self.count = self.count + 1
if self.__load_factor() > self.__load_factor_threshold:
print('Collision density warning - ', self.__load_factor())
def get(self, key):
hash_value = self.hash_function(key)
hash_list = self.table[hash_value]
hash_keys = [k for (k, v) in hash_list]
if key in hash_keys:
index = hash_keys.index(key)
return hash_list[index][1]
else:
return None
def remove(self, key):
hash_value = self.hash_function(key)
hash_list = self.table[hash_value]
hash_keys = [k for (k, v) in hash_list]
if key in hash_keys:
index = hash_keys.index(key)
hash_list.pop(index)
self.count = self.count - 1
else:
return None
def __load_factor(self):
"""
__load_factor := (total input) / size
To signal the level of collisions present in the table at the moment.
Geometrically is the min(H) where Area = (H x Size) of the hash table
rectangle.
"""
return self.count / self.size
# special class methods (to make it prettier)
def __getitem__(self, value):
return self.get(value)
def __setitem__(self, key, item):
return self.put(key, item)
def __len__(self):
return self.count
def __delitem__(self, key):
self.remove(key)
def __repr__(self):
return str(self.table)
| """
Author: Gianluca Biccari
Description: Implementation of an Hash Table with string keys
"""
class Hashtable(object):
"""
Do-it by yourself implemenation in case you don't want to use the
built in data structure dictionary.
"""
def __init__(self):
self.size = 11
self.__load_factor_threshold = 100
self.count = 0
self.table = [[] for i in range(1, self.size + 1)]
def hash_function(self, key):
if not isinstance(key, str):
raise key_error('Key for hash table must be a string')
sum = 0
for (i, char) in enumerate(key):
sum = sum + ord(char) * (i + 1)
return sum % self.size
def put(self, key, value):
hash_value = self.hash_function(key)
hash_list = self.table[hash_value]
hash_data = (key, value)
hash_keys = [k for (k, v) in hash_list]
if key in hash_keys:
index = hash_keys.index(key)
hash_list[index] = hash_data
else:
hash_list.append(hash_data)
self.count = self.count + 1
if self.__load_factor() > self.__load_factor_threshold:
print('Collision density warning - ', self.__load_factor())
def get(self, key):
hash_value = self.hash_function(key)
hash_list = self.table[hash_value]
hash_keys = [k for (k, v) in hash_list]
if key in hash_keys:
index = hash_keys.index(key)
return hash_list[index][1]
else:
return None
def remove(self, key):
hash_value = self.hash_function(key)
hash_list = self.table[hash_value]
hash_keys = [k for (k, v) in hash_list]
if key in hash_keys:
index = hash_keys.index(key)
hash_list.pop(index)
self.count = self.count - 1
else:
return None
def __load_factor(self):
"""
__load_factor := (total input) / size
To signal the level of collisions present in the table at the moment.
Geometrically is the min(H) where Area = (H x Size) of the hash table
rectangle.
"""
return self.count / self.size
def __getitem__(self, value):
return self.get(value)
def __setitem__(self, key, item):
return self.put(key, item)
def __len__(self):
return self.count
def __delitem__(self, key):
self.remove(key)
def __repr__(self):
return str(self.table) |
class Output:
def __init__(self,
race_nr,
winner,
loser,
):
self.race_nr = race_nr
self.winner = winner
self.loser = loser
def get_output_template(self):
if self.winner == 'O' or 'X':
results = f'\nRace {self.race_nr}: car {self.winner} - WIN, car {self.loser} - LOSE\n'
return results
else:
results = f'\nRace {self.race_nr}: was a tie\n'
return results
def score_save(self):
with open("race_results.txt", "w", encoding='utf-8') as f:
f.write(self.get_output_template())
| class Output:
def __init__(self, race_nr, winner, loser):
self.race_nr = race_nr
self.winner = winner
self.loser = loser
def get_output_template(self):
if self.winner == 'O' or 'X':
results = f'\nRace {self.race_nr}: car {self.winner} - WIN, car {self.loser} - LOSE\n'
return results
else:
results = f'\nRace {self.race_nr}: was a tie\n'
return results
def score_save(self):
with open('race_results.txt', 'w', encoding='utf-8') as f:
f.write(self.get_output_template()) |
#-*- coding:utf-8 -*-
# <component_name>.<environment>[.<group_number>]
HostGroups = {
'web.dev': ['web.dev.example.com'],
'ap.dev': ['ap.dev.example.com'],
'web.prod.1': ['web001.example.com'],
'web.prod.2': ['web{:03d}.example.com'.format(n) for n in range(2,4)],
'web.prod.3': ['web{:03d}.example.com'.format(n) for n in range(4,6)],
'ap.prod.1': ['ap001.example.com'],
'ap.prod.2': ['ap{:03d}.example.com'.format(n) for n in range(2,4)],
'ap.prod.3': ['ap{:03d}.example.com'.format(n) for n in range(4,6)]
}
def get_environment_list():
return ['dev', 'prod']
def get_host_groups():
global HostGroups
return HostGroups | host_groups = {'web.dev': ['web.dev.example.com'], 'ap.dev': ['ap.dev.example.com'], 'web.prod.1': ['web001.example.com'], 'web.prod.2': ['web{:03d}.example.com'.format(n) for n in range(2, 4)], 'web.prod.3': ['web{:03d}.example.com'.format(n) for n in range(4, 6)], 'ap.prod.1': ['ap001.example.com'], 'ap.prod.2': ['ap{:03d}.example.com'.format(n) for n in range(2, 4)], 'ap.prod.3': ['ap{:03d}.example.com'.format(n) for n in range(4, 6)]}
def get_environment_list():
return ['dev', 'prod']
def get_host_groups():
global HostGroups
return HostGroups |
class NewsValidator:
def __init__(self, config):
self._config = config
def validate_news(self, news):
news = news.as_dict()
assert self.check_languages(news), "Wrong language!"
assert self.check_null_values(news), "Null values!"
assert self.check_description_length(news), "Short description!"
def check_null_values(self, news):
news_values = list(news.values())
return all(news_values)
def check_description_length(self, news):
description_length = self._config.get("description_length")
return len(news.get("description")) >= description_length
def check_languages(self, news):
languages = self._config.get("languages")
lang = news.get("language")
return any(
filter(lambda x: x == lang, languages)
)
| class Newsvalidator:
def __init__(self, config):
self._config = config
def validate_news(self, news):
news = news.as_dict()
assert self.check_languages(news), 'Wrong language!'
assert self.check_null_values(news), 'Null values!'
assert self.check_description_length(news), 'Short description!'
def check_null_values(self, news):
news_values = list(news.values())
return all(news_values)
def check_description_length(self, news):
description_length = self._config.get('description_length')
return len(news.get('description')) >= description_length
def check_languages(self, news):
languages = self._config.get('languages')
lang = news.get('language')
return any(filter(lambda x: x == lang, languages)) |
# -*- coding: utf-8 -*-
"""
Created on Tue Dec 12 01:33:05 2017
@author: Mayur
"""
# =============================================================================
# Exercise: coordinate
#
# Consider the following code from the last lecture video:
#
# class Coordinate(object):
# def __init__(self, x, y):
# self.x = x
# self.y = y
#
# def getX(self):
# # Getter method for a Coordinate object's x coordinate.
# # Getter methods are better practice than just accessing an attribute
# # directly
# return self.x
#
# def getY(self):
# # Getter method for a Coordinate object's y coordinate
# return self.y
#
# def __str__(self):
# return '<' + str(self.getX()) + ',' + str(self.getY()) + '>'
# Your task is to define the following two methods for the Coordinate class:
#
# Add an __eq__ method that returns True if coordinates refer to same point in
# the plane (i.e., have the same x and y coordinate).
#
# Define __repr__, a special method that returns a string that looks like a valid
# Python expression that could be used to recreate an object with the same value.
# In other words, eval(repr(c)) == c given the definition of __eq__ from part 1.
#
# =============================================================================
#code
class Coordinate(object):
def __init__(self,x,y):
self.x = x
self.y = y
def getX(self):
# Getter method for a Coordinate object's x coordinate.
# Getter methods are better practice than just accessing an attribute
# directly
return self.x
def getY(self):
# Getter method for a Coordinate object's y coordinate
return self.y
def __str__(self):
return '<' + str(self.getX()) + ',' + str(self.getY()) + '>'
def __eq__(self, other):
return self.getX() == other.getX() and self.getY() == other.getY()
def __repr__(self):
return "Coordinate(" + str(self.getX()) + "," + str(self.getY()) + ")" | """
Created on Tue Dec 12 01:33:05 2017
@author: Mayur
"""
class Coordinate(object):
def __init__(self, x, y):
self.x = x
self.y = y
def get_x(self):
return self.x
def get_y(self):
return self.y
def __str__(self):
return '<' + str(self.getX()) + ',' + str(self.getY()) + '>'
def __eq__(self, other):
return self.getX() == other.getX() and self.getY() == other.getY()
def __repr__(self):
return 'Coordinate(' + str(self.getX()) + ',' + str(self.getY()) + ')' |
#https://programmers.co.kr/learn/courses/30/lessons/42860
def solution(name):
answer = 0
name_length = len(name)
move = [1 if name[i]=='A' else 0 for i in range(name_length)]
for i in range(name_length):
now_str = name[i]
answer += get_move_num_alphabet(now_str, 'A')
answer += get_move_num_cursor(move)
return answer
def get_move_num_alphabet(str1, str2):
return min(abs(ord(str1) - ord(str2)), 26 - abs(ord(str1) - ord(str2)))
def get_move_num_cursor(move):
cursor_pos = 0
move_num = 0
move[cursor_pos] = 1
while sum(move) != len(move):
now_move = [move[i%len(move)] for i in range(cursor_pos, len(move)+cursor_pos)]
move_right = now_move[1:][:(len(move)-1)//2]
move_left = now_move[1:][::-1][:(len(move)-1)//2]
is_right_direction = check_direction(move_right, move_left)
if is_right_direction:
cursor_pos += 1
else:
cursor_pos -= 1
move_num += 1
move[cursor_pos] = 1
return move_num
def check_direction(right, left):
assert len(right) == len(left), "len(right) == len(left) but differnt"
right_direction = True
left_direction = False
for i in range(len(right)):
r = right[i]
l = left[i]
if r == 0 and l == 1:
return right_direction
elif r == 1 and l == 0:
return left_direction
elif r == 0 and l == 0:
for j in range(i+1, len(right)):
r_ = right[j]
l_ = left[j]
if r_ == 1 and l_ == 0:
return right_direction
elif r_ == 0 and l_ == 1:
return left_direction
return right_direction | def solution(name):
answer = 0
name_length = len(name)
move = [1 if name[i] == 'A' else 0 for i in range(name_length)]
for i in range(name_length):
now_str = name[i]
answer += get_move_num_alphabet(now_str, 'A')
answer += get_move_num_cursor(move)
return answer
def get_move_num_alphabet(str1, str2):
return min(abs(ord(str1) - ord(str2)), 26 - abs(ord(str1) - ord(str2)))
def get_move_num_cursor(move):
cursor_pos = 0
move_num = 0
move[cursor_pos] = 1
while sum(move) != len(move):
now_move = [move[i % len(move)] for i in range(cursor_pos, len(move) + cursor_pos)]
move_right = now_move[1:][:(len(move) - 1) // 2]
move_left = now_move[1:][::-1][:(len(move) - 1) // 2]
is_right_direction = check_direction(move_right, move_left)
if is_right_direction:
cursor_pos += 1
else:
cursor_pos -= 1
move_num += 1
move[cursor_pos] = 1
return move_num
def check_direction(right, left):
assert len(right) == len(left), 'len(right) == len(left) but differnt'
right_direction = True
left_direction = False
for i in range(len(right)):
r = right[i]
l = left[i]
if r == 0 and l == 1:
return right_direction
elif r == 1 and l == 0:
return left_direction
elif r == 0 and l == 0:
for j in range(i + 1, len(right)):
r_ = right[j]
l_ = left[j]
if r_ == 1 and l_ == 0:
return right_direction
elif r_ == 0 and l_ == 1:
return left_direction
return right_direction |
#code
def SelectionSort(arr,n):
for i in range(0,n):
minpos = i
for j in range(i,n):
if(arr[j]<arr[minpos]):
minpos = j
arr[i],arr[minpos] = arr[minpos],arr[i]
#or
#temp = arr[minpos]
#arr[minpos] = arr[i]
#arr[i] = temp
#driver
arr = [5,2,8,6,9,1,4]
n = len(arr)
SelectionSort(arr,n)
print("Sorted array is :")
for i in range(n):
print(arr[i],end=" ") | def selection_sort(arr, n):
for i in range(0, n):
minpos = i
for j in range(i, n):
if arr[j] < arr[minpos]:
minpos = j
(arr[i], arr[minpos]) = (arr[minpos], arr[i])
arr = [5, 2, 8, 6, 9, 1, 4]
n = len(arr)
selection_sort(arr, n)
print('Sorted array is :')
for i in range(n):
print(arr[i], end=' ') |
ES_HOST = 'localhost:9200'
ES_INDEX = 'pending-pseudocap_go'
ES_DOC_TYPE = 'gene'
API_PREFIX = 'pseudocap_go'
API_VERSION = ''
| es_host = 'localhost:9200'
es_index = 'pending-pseudocap_go'
es_doc_type = 'gene'
api_prefix = 'pseudocap_go'
api_version = '' |
# V1.43 messages
# PID advanced
# does not include feedforward data or vbat sag comp or thrust linearization
# pid_advanced = b"$M>2^\x00\x00\x00\x00x00\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x007\x00\xfa\x00\xd8\x0e\x00\x00\x00\x00\x01\x01\x00\n\x14H\x00H\x00H\x00\x00\x15\x1a\x00(\x14\x00\xc8\x0fd\x04\x00\xb1"
pid_advanced = b'$M>2^\x00\x00\x00\x00\x00\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x007\x00\xfa\x00\xd8\x0e\x00\x00\x00\x00\x01\x01\x00\n\x14H\x00H\x00H\x00\x00\x15\x1a\x00(\x14\x00\xc8\x0fd\x04\x00\xb1'
# PID coefficient
pid = b"$M>\x0fp\x16D\x1f\x1aD\x1f\x1dL\x0457K(\x00\x00G"
fc_version = b"$M>\x03\x03\x01\x0c\x15\x18"
fc_version_2 = b"$M>\x03\x01\x00\x01\x15\x16"
api_version = b"$M>\x03\x01\x00\x01\x15\x16"
status_response = b"$M>\x16e}\x00\x00\x00!\x00\x00\x00\x00\x00\x00\x05\x00\x00\x00\x00\x1a\x04\x01\x01\x00\x004"
status_ex_response = (
b"$M>\x16\x96}\x00\x00\x00!\x00\x00\x00\x00\x00\x00\x05\x00\x03\x00\x00\x1a\x04\x01\x01\x00\x00\xc4"
)
sensor_alignment = b"$M>\x07~\x01\x01\x00\x01\x00\x01\x01x"
# status_ex_response = (
# b'$M>\x16\x96}\x00\x00\x00!\x00\x00\x00\x00\x00\x00\x05\x00\x03\x04\x00\x1a\x04\x00\x00\x00\x00\xc0'
# )
rc_tuning = b"$M>\x17od\x00FFFA2\x00F\x05\x00dd\x00\x00d\xce\x07\xce\x07\xce\x07\x00\xc7"
rx_tuning2 = (
b"$M>\x02l\x07\xdc\x05\x1a\x04\x00u\x03C\x08\x02\x13\xe2\x04\x00\x00\x00\x00\x00\x00(\x02\x01\x00\x00\x01\x03\x00"
)
board_info = b"$M>J\x04S405\x00\x00\x027\tSTM32F405\nCLRACINGF4\x04CLRA\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x03\x02@\x1f\x00\x00\x00\x00\r"
# MSP.ATTITUDE
attitude_response = b"$M>\x06l`\x02\xaa\xff\x0e\x00S"
# MSP.BOXNAMES
box_names_response = (
b"$M>\xfft\x0b\x01ARM;ANGLE;HORIZON;HEADFREE;FAILSAFE;HEADADJ;BEEPER;"
b"OSD DISABLE SW;BLACKBOX;FPV ANGLE MIX;BLACKBOX ERASE (>30s);CAMERA CONTROL 1;"
b"CAMERA CONTROL 2;CAMERA CONTROL 3;FLIP OVER AFTER CRASH;PREARM;VTX PIT MODE;"
b"PARALYZE;USER1;ACRO TRAINER;DISABLE VTX CONTROL;LA"
)
# MSP.BOXIDS
box_names_response = b'$M>\x16w\x00\x01\x02\x06\x1b\x07\r\x13\x1a\x1e\x1f !"#$\'-(/01U'
# MSP.FEATURE_CONFIG
feature_config_response = b'$M>\x04$\x00 D0t'
| pid_advanced = b'$M>2^\x00\x00\x00\x00\x00\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x007\x00\xfa\x00\xd8\x0e\x00\x00\x00\x00\x01\x01\x00\n\x14H\x00H\x00H\x00\x00\x15\x1a\x00(\x14\x00\xc8\x0fd\x04\x00\xb1'
pid = b'$M>\x0fp\x16D\x1f\x1aD\x1f\x1dL\x0457K(\x00\x00G'
fc_version = b'$M>\x03\x03\x01\x0c\x15\x18'
fc_version_2 = b'$M>\x03\x01\x00\x01\x15\x16'
api_version = b'$M>\x03\x01\x00\x01\x15\x16'
status_response = b'$M>\x16e}\x00\x00\x00!\x00\x00\x00\x00\x00\x00\x05\x00\x00\x00\x00\x1a\x04\x01\x01\x00\x004'
status_ex_response = b'$M>\x16\x96}\x00\x00\x00!\x00\x00\x00\x00\x00\x00\x05\x00\x03\x00\x00\x1a\x04\x01\x01\x00\x00\xc4'
sensor_alignment = b'$M>\x07~\x01\x01\x00\x01\x00\x01\x01x'
rc_tuning = b'$M>\x17od\x00FFFA2\x00F\x05\x00dd\x00\x00d\xce\x07\xce\x07\xce\x07\x00\xc7'
rx_tuning2 = b'$M>\x02l\x07\xdc\x05\x1a\x04\x00u\x03C\x08\x02\x13\xe2\x04\x00\x00\x00\x00\x00\x00(\x02\x01\x00\x00\x01\x03\x00'
board_info = b'$M>J\x04S405\x00\x00\x027\tSTM32F405\nCLRACINGF4\x04CLRA\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x03\x02@\x1f\x00\x00\x00\x00\r'
attitude_response = b'$M>\x06l`\x02\xaa\xff\x0e\x00S'
box_names_response = b'$M>\xfft\x0b\x01ARM;ANGLE;HORIZON;HEADFREE;FAILSAFE;HEADADJ;BEEPER;OSD DISABLE SW;BLACKBOX;FPV ANGLE MIX;BLACKBOX ERASE (>30s);CAMERA CONTROL 1;CAMERA CONTROL 2;CAMERA CONTROL 3;FLIP OVER AFTER CRASH;PREARM;VTX PIT MODE;PARALYZE;USER1;ACRO TRAINER;DISABLE VTX CONTROL;LA'
box_names_response = b'$M>\x16w\x00\x01\x02\x06\x1b\x07\r\x13\x1a\x1e\x1f !"#$\'-(/01U'
feature_config_response = b'$M>\x04$\x00 D0t' |
N = int(input())
swifts = [int(n) for n in input().split(' ')]
semaphores = [int(n) for n in input().split(' ')]
swift_sum = 0
semaphore_sum = 0
largest = 0
for k in range(N):
swift_sum += swifts[k]
semaphore_sum += semaphores[k]
if swift_sum == semaphore_sum:
largest = k + 1
print(largest)
| n = int(input())
swifts = [int(n) for n in input().split(' ')]
semaphores = [int(n) for n in input().split(' ')]
swift_sum = 0
semaphore_sum = 0
largest = 0
for k in range(N):
swift_sum += swifts[k]
semaphore_sum += semaphores[k]
if swift_sum == semaphore_sum:
largest = k + 1
print(largest) |
"""Firehose resource for AWS Cloudformation."""
__version__ = "0.0.6"
__author__ = "German Gomez-Herrero, FindHotel BV"
| """Firehose resource for AWS Cloudformation."""
__version__ = '0.0.6'
__author__ = 'German Gomez-Herrero, FindHotel BV' |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Mon Aug 17 09:54:02 2020
@author: AzureD
Formatting tools for displaying HELP inside the MUD clients.
"""
def docstring_to_help(name: str, docstring: str):
"""
Converts a function docstring to a more viewable format for MUD clients.
Mainly used inside `src/mud/commands` commands for quick help documentation in-code.
"""
split_doc = docstring.split('\n') # split by newline
# generate the header of the help, and the footer, examples:
# ------ [ name #help ] ---------------------------
# -------------------------------------------------
header = f"""------ [ {name} #help ] -""".ljust(70, "-")
footer = "".ljust(70, "-")
split_doc.insert(0, header)
split_doc.append(footer)
return "\r\n".join(split_doc) # ensure compatibility with carriage return aswell as newline | """
Created on Mon Aug 17 09:54:02 2020
@author: AzureD
Formatting tools for displaying HELP inside the MUD clients.
"""
def docstring_to_help(name: str, docstring: str):
"""
Converts a function docstring to a more viewable format for MUD clients.
Mainly used inside `src/mud/commands` commands for quick help documentation in-code.
"""
split_doc = docstring.split('\n')
header = f'------ [ {name} #help ] -'.ljust(70, '-')
footer = ''.ljust(70, '-')
split_doc.insert(0, header)
split_doc.append(footer)
return '\r\n'.join(split_doc) |
# Iterate over the enitre array. Insert counts only if != 1. Pop repeated occurances of characters.
class Solution:
def compress(self, chars: List[str]) -> int:
run = 1
prev = chars[0]
i = 1
while i<len(chars):
c = chars[i]
if c==prev:
run += 1
chars.pop(i) # this makes up for incrementing i
else:
if run>1: # insert run only if > 1
for r in str(run):
chars.insert(i, r) # Insert run digit at i and increment i
i += 1
prev = c # now lookout for the new char
run = 1 # which has run of 1
i += 1 # increment i for jumping to the next itereation
if run>1: # Add the last run to the result
for r in str(run):
chars.append(r)
return len(chars)
| class Solution:
def compress(self, chars: List[str]) -> int:
run = 1
prev = chars[0]
i = 1
while i < len(chars):
c = chars[i]
if c == prev:
run += 1
chars.pop(i)
else:
if run > 1:
for r in str(run):
chars.insert(i, r)
i += 1
prev = c
run = 1
i += 1
if run > 1:
for r in str(run):
chars.append(r)
return len(chars) |
{
"targets": [{
"target_name": "pifacecad",
"sources": ["piface.cc"],
"include_dirs": ["./src/"],
"link_settings": {
"libraries": [
"../lib/libpifacecad.a",
"../lib/libmcp23s17.a"
]
},
"cflags": ["-std=c++11"]
}]
} | {'targets': [{'target_name': 'pifacecad', 'sources': ['piface.cc'], 'include_dirs': ['./src/'], 'link_settings': {'libraries': ['../lib/libpifacecad.a', '../lib/libmcp23s17.a']}, 'cflags': ['-std=c++11']}]} |
# Definition for singly-linked list.
class ListNode:
def __init__(self, x):
self.val = x
self.next = None
class Solution:
def removeNthFromEnd(self, head: ListNode, n: int) -> ListNode:
pre = ListNode(0)
pre.next = head
head1, head2 = pre, pre
for i in range(n):
head2 = head2.next
if not head2:
return head
while head2.next is not None:
head1 = head1.next
head2 = head2.next
head1.next = head1.next.next
return pre.next
def removeNthFromEnd2(self, head: ListNode, n: int) -> ListNode:
p = ListNode(-1)
p.next = head
a, b = p, p
while n > 0 and b:
n = n - 1
b = b.next
if not b:
return head
while b.next:
b = b.next
a = a.next
a.next = a.next.next
return p.next
'''
for i in range(n):
head2 = head2.next
while head2.next is not None:
head1 = head1.next
head2 = head2.next
print(head2.val, head1.val)
print(head1.val, "*******", head1.next.next.val)
head1.next = head1.next.next
return pre.next
'''
head = ListNode(1)
head.next = ListNode(2)
head.next.next = ListNode(3)
head.next.next.next = ListNode(4)
head.next.next.next.next = ListNode(5)
head.next.next.next.next.next = ListNode(6)
slu = Solution()
neddle = slu.removeNthFromEnd(head, 2)
while neddle:
print(neddle.val)
neddle = neddle.next
| class Listnode:
def __init__(self, x):
self.val = x
self.next = None
class Solution:
def remove_nth_from_end(self, head: ListNode, n: int) -> ListNode:
pre = list_node(0)
pre.next = head
(head1, head2) = (pre, pre)
for i in range(n):
head2 = head2.next
if not head2:
return head
while head2.next is not None:
head1 = head1.next
head2 = head2.next
head1.next = head1.next.next
return pre.next
def remove_nth_from_end2(self, head: ListNode, n: int) -> ListNode:
p = list_node(-1)
p.next = head
(a, b) = (p, p)
while n > 0 and b:
n = n - 1
b = b.next
if not b:
return head
while b.next:
b = b.next
a = a.next
a.next = a.next.next
return p.next
'\n for i in range(n):\n head2 = head2.next\n while head2.next is not None:\n head1 = head1.next\n head2 = head2.next\n print(head2.val, head1.val)\n print(head1.val, "*******", head1.next.next.val)\n head1.next = head1.next.next\n\n return pre.next\n '
head = list_node(1)
head.next = list_node(2)
head.next.next = list_node(3)
head.next.next.next = list_node(4)
head.next.next.next.next = list_node(5)
head.next.next.next.next.next = list_node(6)
slu = solution()
neddle = slu.removeNthFromEnd(head, 2)
while neddle:
print(neddle.val)
neddle = neddle.next |
with open("day10/input.txt", encoding='utf-8') as file:
data = file.read().splitlines()
opening_chars = '([{<'
closing_chars = ')]}>'
sum_of_corrupted = 0
mapping_dict = {'(' : [')', 3], '[' : [']', 57], '{' : ['}', 1197], '<' : ['>', 25137]}
mapping_dict_sums = {')' : 3, ']' : 57, '}' : 1197, '>' : 25137}
mapping_dict_part2 = {'(' : 1, '[' : 2, '{' : 3, '<' : 4}
total_points = []
for line in data:
empty_array = []
for key, char in enumerate(line):
if char in closing_chars:
last_char = empty_array.pop(-1)
if char != mapping_dict[last_char][0]:
empty_array = []
break
else:
empty_array.insert(len(empty_array), char)
acc = 0
for score in empty_array[::-1]:
acc = acc * 5 + mapping_dict_part2[score]
if len(empty_array) != 0:
total_points.append(acc)
middle_key = int(len(total_points)/2)
middle_score = sorted(total_points)[middle_key]
print(middle_score)
| with open('day10/input.txt', encoding='utf-8') as file:
data = file.read().splitlines()
opening_chars = '([{<'
closing_chars = ')]}>'
sum_of_corrupted = 0
mapping_dict = {'(': [')', 3], '[': [']', 57], '{': ['}', 1197], '<': ['>', 25137]}
mapping_dict_sums = {')': 3, ']': 57, '}': 1197, '>': 25137}
mapping_dict_part2 = {'(': 1, '[': 2, '{': 3, '<': 4}
total_points = []
for line in data:
empty_array = []
for (key, char) in enumerate(line):
if char in closing_chars:
last_char = empty_array.pop(-1)
if char != mapping_dict[last_char][0]:
empty_array = []
break
else:
empty_array.insert(len(empty_array), char)
acc = 0
for score in empty_array[::-1]:
acc = acc * 5 + mapping_dict_part2[score]
if len(empty_array) != 0:
total_points.append(acc)
middle_key = int(len(total_points) / 2)
middle_score = sorted(total_points)[middle_key]
print(middle_score) |
class StairsEditScope(EditScope,IDisposable):
"""
StairsEditScope allows user to maintain a stairs-editing session.
StairsEditScope(document: Document,transactionName: str)
"""
def Dispose(self):
""" Dispose(self: EditScope,A_0: bool) """
pass
def ReleaseUnmanagedResources(self,*args):
""" ReleaseUnmanagedResources(self: EditScope,disposing: bool) """
pass
def Start(self,*__args):
"""
Start(self: StairsEditScope,baseLevelId: ElementId,topLevelId: ElementId) -> ElementId
Creates a new empty stairs element with a default stairs type in the specified
levels
and then starts stairs edit mode and editing the new stairs.
baseLevelId: The base level on which the stairs is to be placed.
topLevelId: The top level where the stairs is to reach.
Returns: ElementId of the new stairs.
Start(self: StairsEditScope,stairsId: ElementId) -> ElementId
Starts an stairs edit mode for an existing Stairs element
stairsId: The stairs element to be edited.
Returns: ElementId of the editing stairs. It should be the same as the input stairsId
"""
pass
def __enter__(self,*args):
""" __enter__(self: IDisposable) -> object """
pass
def __exit__(self,*args):
""" __exit__(self: IDisposable,exc_type: object,exc_value: object,exc_back: object) """
pass
def __init__(self,*args):
""" x.__init__(...) initializes x; see x.__class__.__doc__ for signaturex.__init__(...) initializes x; see x.__class__.__doc__ for signaturex.__init__(...) initializes x; see x.__class__.__doc__ for signature """
pass
@staticmethod
def __new__(self,document,transactionName):
""" __new__(cls: type,document: Document,transactionName: str) """
pass
IsPermitted=property(lambda self: object(),lambda self,v: None,lambda self: None)
"""Tells if the StairsEditScope is permitted to start.
Get: IsPermitted(self: StairsEditScope) -> bool
"""
| class Stairseditscope(EditScope, IDisposable):
"""
StairsEditScope allows user to maintain a stairs-editing session.
StairsEditScope(document: Document,transactionName: str)
"""
def dispose(self):
""" Dispose(self: EditScope,A_0: bool) """
pass
def release_unmanaged_resources(self, *args):
""" ReleaseUnmanagedResources(self: EditScope,disposing: bool) """
pass
def start(self, *__args):
"""
Start(self: StairsEditScope,baseLevelId: ElementId,topLevelId: ElementId) -> ElementId
Creates a new empty stairs element with a default stairs type in the specified
levels
and then starts stairs edit mode and editing the new stairs.
baseLevelId: The base level on which the stairs is to be placed.
topLevelId: The top level where the stairs is to reach.
Returns: ElementId of the new stairs.
Start(self: StairsEditScope,stairsId: ElementId) -> ElementId
Starts an stairs edit mode for an existing Stairs element
stairsId: The stairs element to be edited.
Returns: ElementId of the editing stairs. It should be the same as the input stairsId
"""
pass
def __enter__(self, *args):
""" __enter__(self: IDisposable) -> object """
pass
def __exit__(self, *args):
""" __exit__(self: IDisposable,exc_type: object,exc_value: object,exc_back: object) """
pass
def __init__(self, *args):
""" x.__init__(...) initializes x; see x.__class__.__doc__ for signaturex.__init__(...) initializes x; see x.__class__.__doc__ for signaturex.__init__(...) initializes x; see x.__class__.__doc__ for signature """
pass
@staticmethod
def __new__(self, document, transactionName):
""" __new__(cls: type,document: Document,transactionName: str) """
pass
is_permitted = property(lambda self: object(), lambda self, v: None, lambda self: None)
'Tells if the StairsEditScope is permitted to start.\n\n\n\nGet: IsPermitted(self: StairsEditScope) -> bool\n\n\n\n' |
{ 'application':{ 'type':'Application',
'name':'Template',
'backgrounds':
[
{ 'type':'Background',
'name':'bgTemplate',
'title':'Standard Template with File->Exit menu',
'size':( 400, 300 ),
'style':['resizeable'],
'statusBar':0,
'menubar':
{
'type':'MenuBar',
'menus':
[
{ 'type':'Menu',
'name':'menuFile',
'label':'&File',
'items': [
{ 'type':'MenuItem',
'name':'menuFileExit',
'label':'E&xit',
'command':'exit', } ] }
]
},
'components':
[
]
}
]
}
}
| {'application': {'type': 'Application', 'name': 'Template', 'backgrounds': [{'type': 'Background', 'name': 'bgTemplate', 'title': 'Standard Template with File->Exit menu', 'size': (400, 300), 'style': ['resizeable'], 'statusBar': 0, 'menubar': {'type': 'MenuBar', 'menus': [{'type': 'Menu', 'name': 'menuFile', 'label': '&File', 'items': [{'type': 'MenuItem', 'name': 'menuFileExit', 'label': 'E&xit', 'command': 'exit'}]}]}, 'components': []}]}} |
def menu_selection_error(a):
"""if input is not a valid menu choice, throw an error"""
print("'\033[91m'ERROR:'\033[92m'Invalid input! Please select from the menu'\033[0m'")
def handle_division(a):
"""makes sure number is not zero"""
if a == 0:
print("'\033[91m'ERROR:'\033[92m'Cannot divide by zero!'\033[0m'")
| def menu_selection_error(a):
"""if input is not a valid menu choice, throw an error"""
print("'\x1b[91m'ERROR:'\x1b[92m'Invalid input! Please select from the menu'\x1b[0m'")
def handle_division(a):
"""makes sure number is not zero"""
if a == 0:
print("'\x1b[91m'ERROR:'\x1b[92m'Cannot divide by zero!'\x1b[0m'") |
class ErosionStatus:
is_running: bool
# signalize that the erosion (usually in other thread) should stop
stop_requested: bool = False
progress: int
def __init__(self, is_running: bool = False, progress: int = 0):
self.is_running = is_running
self.progress = progress
| class Erosionstatus:
is_running: bool
stop_requested: bool = False
progress: int
def __init__(self, is_running: bool=False, progress: int=0):
self.is_running = is_running
self.progress = progress |
# Any recipe starts with a list of ingredients. Below is an extract
# from a cookbook with the ingredients for some dishes. Write a
# program that tells you what recipe you can make based on the
# ingredient you have.
# The input format:
# A name of some ingredient.
# The ouput format:
# A message that says "food time!" where "food" stands for the
# dish that contains this ingredient. For example, "pizza time!". If
# the ingredient is featured in several recipes, write about all of
# then in the order they're featured in the cook book.
pasta = "tomato, basil, garlic, salt, pasta, olive oil"
apple_pie = "apple, sugar, salt, cinnamon, flour, egg, butter"
ratatouille = "aubergine, carrot, onion, tomato, garlic, olive oil, pepper, salt"
chocolate_cake = "chocolate, sugar, salt, flour, coffee, butter"
omelette = "egg, milk, bacon, tomato, salt, pepper"
ingredient = input()
if ingredient in pasta:
print("pasta time!")
if ingredient in apple_pie:
print("apple pie time!")
if ingredient in ratatouille:
print("ratatouille time!")
if ingredient in chocolate_cake:
print("chocolate cake time!")
if ingredient in omelette:
print("omelette time!") | pasta = 'tomato, basil, garlic, salt, pasta, olive oil'
apple_pie = 'apple, sugar, salt, cinnamon, flour, egg, butter'
ratatouille = 'aubergine, carrot, onion, tomato, garlic, olive oil, pepper, salt'
chocolate_cake = 'chocolate, sugar, salt, flour, coffee, butter'
omelette = 'egg, milk, bacon, tomato, salt, pepper'
ingredient = input()
if ingredient in pasta:
print('pasta time!')
if ingredient in apple_pie:
print('apple pie time!')
if ingredient in ratatouille:
print('ratatouille time!')
if ingredient in chocolate_cake:
print('chocolate cake time!')
if ingredient in omelette:
print('omelette time!') |
PROXIES = [
{'protocol':'http', 'ip_port':'118.193.26.18:8080'},
{'protocol':'http', 'ip_port':'213.136.77.246:80'},
{'protocol':'http', 'ip_port':'198.199.127.16:80'},
{'protocol':'http', 'ip_port':'103.78.213.147:80'},
{'protocol':'https', 'ip_port':'61.90.73.10:8080'},
{'protocol':'http', 'ip_port':'36.83.78.184:80'},
{'protocol':'http', 'ip_port':'66.119.180.101:80'},
{'protocol':'https', 'ip_port':'142.44.135.148:8080'},
{'protocol':'http', 'ip_port':'80.211.181.37:3128'},
{'protocol':'http', 'ip_port':'36.79.15.169:80'},
{'protocol':'https', 'ip_port':'140.227.81.53:3128'},
{'protocol':'http', 'ip_port':'47.52.231.140:8080'},
{'protocol':'https', 'ip_port':'185.93.3.123:8080'},
{'protocol':'http', 'ip_port':'121.121.125.55:80'},
{'protocol':'https', 'ip_port':'191.252.92.198:8080'},
{'protocol':'http', 'ip_port':'213.136.89.121:80'},
{'protocol':'http', 'ip_port':'36.83.82.36:80'},
{'protocol':'https', 'ip_port':'163.44.165.165:8080'},
{'protocol':'https', 'ip_port':'191.252.186.52:80'},
{'protocol':'https', 'ip_port':'140.227.78.54:3128'},
{'protocol':'http', 'ip_port':'36.75.254.142:80'},
{'protocol':'https', 'ip_port':'178.57.44.159:44331'},
{'protocol':'http', 'ip_port':'80.48.119.28:8080'},
{'protocol':'https', 'ip_port':'103.241.205.66:8080'},
{'protocol':'http', 'ip_port':'36.83.77.39:80'},
{'protocol':'https', 'ip_port':'149.56.45.68:10000'},
{'protocol':'http', 'ip_port':'177.67.83.134:3128'},
{'protocol':'https', 'ip_port':'167.99.224.142:8080'},
{'protocol':'http', 'ip_port':'66.70.190.244:8080'},
{'protocol':'http', 'ip_port':'36.83.93.62:80'},
{'protocol':'https', 'ip_port':'178.136.225.96:53281'},
{'protocol':'https', 'ip_port':'212.77.86.103:80'},
{'protocol':'https', 'ip_port':'158.69.150.164:8080'},
{'protocol':'http', 'ip_port':'66.119.180.104:80'},
{'protocol':'https', 'ip_port':'66.70.146.227:3128'},
{'protocol':'https', 'ip_port':'110.164.181.164:8080'},
{'protocol':'http', 'ip_port':'88.99.215.14:80'},
{'protocol':'https', 'ip_port':'124.120.105.127:3128'},
{'protocol':'http', 'ip_port':'159.65.63.23:80'},
{'protocol':'http', 'ip_port':'66.119.180.103:80'},
{'protocol':'http', 'ip_port':'18.130.46.39:80'},
{'protocol':'http', 'ip_port':'81.22.54.60:53281'},
{'protocol':'http', 'ip_port':'45.115.39.139:7777'},
{'protocol':'http', 'ip_port':'60.49.97.65:53281'},
{'protocol':'http', 'ip_port':'176.15.169.70:53281'},
{'protocol':'http', 'ip_port':'81.211.23.6:3128'},
{'protocol':'http', 'ip_port':'190.12.58.187:53281'},
{'protocol':'http', 'ip_port':'196.61.28.125:53281'},
{'protocol':'http', 'ip_port':'47.89.30.82:8118'},
{'protocol':'http', 'ip_port':'109.76.229.164:8080'},
{'protocol':'http', 'ip_port':'199.195.119.37:80'},
{'protocol':'http', 'ip_port':'122.54.105.143:53281'},
{'protocol':'http', 'ip_port':'62.43.201.40:53281'},
{'protocol':'http', 'ip_port':'41.204.84.182:53281'},
{'protocol':'http', 'ip_port':'196.202.194.127:62225'},
{'protocol':'http', 'ip_port':'159.224.176.205:53281'},
{'protocol':'http', 'ip_port':'136.169.141.254:8080'},
{'protocol':'http', 'ip_port':'125.162.211.20:80'},
{'protocol':'http', 'ip_port':'60.250.79.187:80'},
{'protocol':'http', 'ip_port':'165.90.11.18:8080'},
{'protocol':'http', 'ip_port':'111.93.64.113:80'},
{'protocol':'https', 'ip_port':'147.135.210.114:54566'},
{'protocol':'http', 'ip_port':'184.172.231.86:80'},
{'protocol':'https', 'ip_port':'89.236.17.106:3128'},
{'protocol':'http', 'ip_port':'175.139.252.193:80'},
{'protocol':'http', 'ip_port':'187.60.253.78:3128'},
{'protocol':'http', 'ip_port':'109.74.75.61:80'},
{'protocol':'http', 'ip_port':'14.136.246.173:3128'},
{'protocol':'http', 'ip_port':'198.1.122.29:80'},
{'protocol':'http', 'ip_port':'159.65.182.63:80'},
{'protocol':'http', 'ip_port':'129.213.76.9:3128'},
{'protocol':'https', 'ip_port':'189.115.92.71:80'},
{'protocol':'http', 'ip_port':'74.209.243.116:3128'},
{'protocol':'https', 'ip_port':'191.252.120.198:8080'},
{'protocol':'http', 'ip_port':'115.249.145.202:80'},
{'protocol':'https', 'ip_port':'94.130.20.85:31288'},
{'protocol':'https', 'ip_port':'185.65.192.36:8080'},
{'protocol':'http', 'ip_port':'185.70.79.131:3128'},
{'protocol':'https', 'ip_port':'77.120.72.235:53281'},
{'protocol':'https', 'ip_port':'191.252.194.156:3128'},
{'protocol':'https', 'ip_port':'71.13.112.152:3128'},
{'protocol':'http', 'ip_port':'5.189.133.231:80'},
{'protocol':'http', 'ip_port':'91.205.239.120:8080'},
{'protocol':'http', 'ip_port':'121.254.214.219:80'},
{'protocol':'http', 'ip_port':'185.229.224.61:80'},
{'protocol':'http', 'ip_port':'34.201.72.254:80'},
{'protocol':'http', 'ip_port':'163.172.86.64:3128'},
{'protocol':'http', 'ip_port':'46.4.62.108:80'},
{'protocol':'http', 'ip_port':'47.89.41.164:80'},
{'protocol':'http', 'ip_port':'34.244.2.143:80'},
{'protocol':'http', 'ip_port':'177.21.115.43:20183'},
{'protocol':'http', 'ip_port':'190.109.32.251:8080'},
{'protocol':'http', 'ip_port':'177.21.109.90:20183'},
{'protocol':'http', 'ip_port':'89.169.88.169:8080'},
{'protocol':'http', 'ip_port':'167.99.28.176:8080'},
{'protocol':'http', 'ip_port':'128.199.129.5:80'},
{'protocol':'http', 'ip_port':'192.141.206.176:20183'},
{'protocol':'http', 'ip_port':'85.109.69.223:9090'},
{'protocol':'http', 'ip_port':'103.18.180.1:8080'},
{'protocol':'http', 'ip_port':'36.65.187.232:8080'},
{'protocol':'http', 'ip_port':'103.41.96.186:8080'},
{'protocol':'http', 'ip_port':'186.94.179.162:8080'},
{'protocol':'http', 'ip_port':'93.143.193.34:8080'},
{'protocol':'http', 'ip_port':'4.35.210.222:8181'},
{'protocol':'http', 'ip_port':'87.118.208.125:8080'},
{'protocol':'http', 'ip_port':'103.26.54.21:8080'},
{'protocol':'http', 'ip_port':'80.245.117.133:8080'},
{'protocol':'http', 'ip_port':'123.49.53.210:8080'},
{'protocol':'http', 'ip_port':'201.249.49.105:8080'},
{'protocol':'http', 'ip_port':'201.44.187.67:20183'},
{'protocol':'http', 'ip_port':'103.25.155.5:8080'},
{'protocol':'http', 'ip_port':'193.150.117.61:8000'},
{'protocol':'http', 'ip_port':'62.69.195.249:8080'},
{'protocol':'http', 'ip_port':'103.35.168.14:8080'},
{'protocol':'http', 'ip_port':'74.83.246.125:8081'},
{'protocol':'http', 'ip_port':'27.123.0.153:8080'},
{'protocol':'http', 'ip_port':'5.13.254.175:8080'},
{'protocol':'http', 'ip_port':'103.216.144.17:8080'},
{'protocol':'http', 'ip_port':'5.40.227.209:8080'},
{'protocol':'http', 'ip_port':'182.18.200.92:8080'},
{'protocol':'http', 'ip_port':'170.79.200.233:20183'},
{'protocol':'http', 'ip_port':'52.128.58.102:8080'},
{'protocol':'http', 'ip_port':'103.218.24.41:8080'},
{'protocol':'http', 'ip_port':'221.187.134.102:8080'},
{'protocol':'http', 'ip_port':'103.111.228.2:8080'},
{'protocol':'http', 'ip_port':'103.218.25.33:8080'},
{'protocol':'http', 'ip_port':'61.8.78.130:8080'},
{'protocol':'http', 'ip_port':'177.36.208.121:3128'},
{'protocol':'http', 'ip_port':'45.125.223.145:8080'},
{'protocol':'http', 'ip_port':'193.19.135.1:8080'},
{'protocol':'http', 'ip_port':'103.48.70.193:8080'},
{'protocol':'http', 'ip_port':'81.34.18.159:8080'},
{'protocol':'http', 'ip_port':'175.209.132.102:808'},
{'protocol':'http', 'ip_port':'177.74.247.59:3128'},
{'protocol':'http', 'ip_port':'1.179.181.17:8081'},
{'protocol':'http', 'ip_port':'80.72.66.212:8081'},
{'protocol':'http', 'ip_port':'91.237.240.70:8080'},
{'protocol':'http', 'ip_port':'200.122.209.78:8080'},
{'protocol':'http', 'ip_port':'36.66.103.63:3128'},
{'protocol':'http', 'ip_port':'122.54.20.216:8090'},
{'protocol':'http', 'ip_port':'203.154.82.34:8080'},
{'protocol':'http', 'ip_port':'66.96.237.133:8080'},
{'protocol':'http', 'ip_port':'177.36.131.200:20183'},
{'protocol':'http', 'ip_port':'200.122.211.26:8080'},
{'protocol':'http', 'ip_port':'103.35.171.93:8080'},
{'protocol':'http', 'ip_port':'2.138.25.150:8080'},
{'protocol':'http', 'ip_port':'177.204.155.131:3128'},
{'protocol':'http', 'ip_port':'103.206.254.190:8080'},
{'protocol':'http', 'ip_port':'177.220.186.11:8080'},
{'protocol':'http', 'ip_port':'177.47.243.74:8088'},
{'protocol':'http', 'ip_port':'177.21.109.69:20183'},
{'protocol':'http', 'ip_port':'1.179.185.253:8080'},
{'protocol':'http', 'ip_port':'182.23.28.186:3128'},
{'protocol':'http', 'ip_port':'80.87.176.16:8080'},
{'protocol':'http', 'ip_port':'202.169.252.73:8080'},
{'protocol':'http', 'ip_port':'154.72.81.45:8080'},
{'protocol':'http', 'ip_port':'190.201.95.84:8080'},
{'protocol':'http', 'ip_port':'195.228.210.245:8080'},
{'protocol':'http', 'ip_port':'91.237.240.4:8080'},
{'protocol':'http', 'ip_port':'202.137.15.93:8080'},
{'protocol':'http', 'ip_port':'87.249.205.103:8080'},
{'protocol':'http', 'ip_port':'189.8.93.173:20183'},
{'protocol':'http', 'ip_port':'177.21.104.205:20183'},
{'protocol':'http', 'ip_port':'172.245.211.188:5836'},
{'protocol':'http', 'ip_port':'88.255.101.175:8080'},
{'protocol':'http', 'ip_port':'131.161.124.36:3128'},
{'protocol':'http', 'ip_port':'182.16.171.26:53281'},
{'protocol':'http', 'ip_port':'45.123.43.158:8080'},
{'protocol':'http', 'ip_port':'94.45.49.170:8080'},
{'protocol':'http', 'ip_port':'177.22.91.71:20183'},
{'protocol':'http', 'ip_port':'181.129.33.218:62225'},
{'protocol':'http', 'ip_port':'190.109.169.41:53281'},
{'protocol':'https', 'ip_port':'204.48.22.184:3432'},
{'protocol':'https', 'ip_port':'198.50.137.181:3128'},
{'protocol':'http', 'ip_port':'173.212.202.65:443'},
{'protocol':'https', 'ip_port':'170.78.23.245:8080'},
{'protocol':'https', 'ip_port':'158.69.143.77:8080'},
{'protocol':'http', 'ip_port':'103.87.16.2:80'},
{'protocol':'https', 'ip_port':'18.222.124.59:8080'},
{'protocol':'http', 'ip_port':'47.254.22.115:8080'},
{'protocol':'http', 'ip_port':'118.69.34.21:8080'},
{'protocol':'http', 'ip_port':'138.117.115.249:53281'},
{'protocol':'http', 'ip_port':'190.4.4.204:3128'},
{'protocol':'http', 'ip_port':'42.112.208.124:53281'},
{'protocol':'http', 'ip_port':'188.120.232.181:8118'},
{'protocol':'https', 'ip_port':'177.52.250.126:8080'},
{'protocol':'http', 'ip_port':'218.50.2.102:8080'},
{'protocol':'http', 'ip_port':'54.95.211.163:8080'},
{'protocol':'http', 'ip_port':'35.200.69.141:8080'},
{'protocol':'http', 'ip_port':'181.49.24.126:8081'},
{'protocol':'https', 'ip_port':'96.9.69.230:53281'},
{'protocol':'https', 'ip_port':'192.116.142.153:8080'},
{'protocol':'http', 'ip_port':'171.244.32.140:8080'},
{'protocol':'https', 'ip_port':'195.133.220.18:43596'},
{'protocol':'https', 'ip_port':'209.190.4.117:8080'},
{'protocol':'http', 'ip_port':'39.109.112.111:8080'},
{'protocol':'http', 'ip_port':'176.53.2.122:8080'},
{'protocol':'https', 'ip_port':'200.255.53.2:8080'},
{'protocol':'http', 'ip_port':'125.26.98.165:8080'},
{'protocol':'http', 'ip_port':'212.90.167.90:55555'},
{'protocol':'https', 'ip_port':'125.25.202.139:3128'},
{'protocol':'http', 'ip_port':'83.238.100.226:3128'},
{'protocol':'http', 'ip_port':'103.87.170.105:42421'},
{'protocol':'http', 'ip_port':'195.138.83.218:53281'},
{'protocol':'http', 'ip_port':'185.237.87.240:80'},
{'protocol':'http', 'ip_port':'188.0.138.147:8080'},
{'protocol':'http', 'ip_port':'181.211.166.105:54314'},
{'protocol':'http', 'ip_port':'87.185.153.132:8080'},
{'protocol':'http', 'ip_port':'67.238.124.52:8080'},
{'protocol':'http', 'ip_port':'159.192.206.10:8080'},
{'protocol':'http', 'ip_port':'159.65.168.7:80'},
{'protocol':'http', 'ip_port':'108.61.203.146:8118'},
{'protocol':'http', 'ip_port':'173.212.209.59:80'},
{'protocol':'http', 'ip_port':'88.205.171.222:8080'},
{'protocol':'http', 'ip_port':'38.103.239.2:44372'},
{'protocol':'http', 'ip_port':'182.16.171.18:53281'},
{'protocol':'http', 'ip_port':'177.21.108.222:20183'},
{'protocol':'http', 'ip_port':'182.253.139.36:65301'},
{'protocol':'https', 'ip_port':'200.7.205.198:8081'},
{'protocol':'https', 'ip_port':'41.169.67.242:53281'},
{'protocol':'http', 'ip_port':'41.190.33.162:8080'},
{'protocol':'https', 'ip_port':'94.130.14.146:31288'},
{'protocol':'https', 'ip_port':'88.99.149.188:31288'},
{'protocol':'https', 'ip_port':'80.211.151.246:8145'},
{'protocol':'https', 'ip_port':'136.169.225.53:3128'},
{'protocol':'http', 'ip_port':'47.252.1.152:80'},
{'protocol':'https', 'ip_port':'61.7.175.138:41496'},
{'protocol':'http', 'ip_port':'52.214.181.43:80'},
{'protocol':'https', 'ip_port':'67.205.148.246:8080'},
{'protocol':'https', 'ip_port':'176.31.250.164:3128'},
{'protocol':'http', 'ip_port':'109.195.243.177:8197'},
{'protocol':'http', 'ip_port':'46.105.51.183:80'},
{'protocol':'https', 'ip_port':'94.141.157.182:8080'},
{'protocol':'https', 'ip_port':'14.207.100.203:8080'},
{'protocol':'http', 'ip_port':'163.172.181.29:80'},
{'protocol':'https', 'ip_port':'54.36.162.123:10000'},
{'protocol':'http', 'ip_port':'52.87.190.26:80'},
{'protocol':'http', 'ip_port':'212.98.150.50:80'},
{'protocol':'https', 'ip_port':'66.82.144.29:8080'},
{'protocol':'http', 'ip_port':'188.166.223.181:80'},
{'protocol':'http', 'ip_port':'180.251.80.119:8080'},
{'protocol':'http', 'ip_port':'94.21.75.9:8080'},
{'protocol':'http', 'ip_port':'177.105.252.133:20183'},
{'protocol':'http', 'ip_port':'61.7.138.109:8080'},
{'protocol':'http', 'ip_port':'110.78.155.27:8080'},
{'protocol':'http', 'ip_port':'178.49.139.13:80'},
{'protocol':'https', 'ip_port':'146.158.30.192:53281'},
{'protocol':'https', 'ip_port':'171.255.199.129:80'},
{'protocol':'http', 'ip_port':'92.222.74.221:80'},
{'protocol':'http', 'ip_port':'170.79.202.23:20183'},
{'protocol':'http', 'ip_port':'179.182.63.63:20183'},
{'protocol':'http', 'ip_port':'212.14.166.26:3128'},
{'protocol':'https', 'ip_port':'103.233.118.83:808'},
{'protocol':'http', 'ip_port':'110.170.150.52:8080'},
{'protocol':'http', 'ip_port':'181.143.129.180:3128'},
{'protocol':'http', 'ip_port':'181.119.115.2:53281'},
{'protocol':'http', 'ip_port':'185.8.158.149:8080'},
{'protocol':'http', 'ip_port':'103.39.251.241:8080'},
{'protocol':'http', 'ip_port':'46.229.252.61:8080'},
{'protocol':'http', 'ip_port':'93.182.72.36:8080'},
{'protocol':'http', 'ip_port':'201.54.5.117:3128'},
{'protocol':'http', 'ip_port':'78.140.6.68:53281'},
{'protocol':'http', 'ip_port':'177.184.83.162:20183'},
{'protocol':'http', 'ip_port':'143.202.75.240:20183'},
{'protocol':'http', 'ip_port':'31.145.83.202:8080'},
{'protocol':'http', 'ip_port':'177.101.181.33:20183'},
{'protocol':'http', 'ip_port':'144.76.190.233:3128'},
{'protocol':'http', 'ip_port':'134.0.63.134:8000'},
{'protocol':'http', 'ip_port':'38.103.239.13:35617'},
{'protocol':'http', 'ip_port':'110.78.168.138:62225'},
{'protocol':'http', 'ip_port':'198.58.123.138:8123'},
{'protocol':'http', 'ip_port':'190.78.8.120:8080'},
{'protocol':'http', 'ip_port':'190.23.68.39:8080'},
{'protocol':'http', 'ip_port':'191.55.10.27:3128'},
{'protocol':'http', 'ip_port':'200.71.146.146:8080'},
{'protocol':'http', 'ip_port':'103.102.248.56:3128'},
{'protocol':'http', 'ip_port':'37.110.74.231:8181'},
{'protocol':'http', 'ip_port':'191.5.183.120:20183'},
{'protocol':'http', 'ip_port':'154.68.195.8:8080'},
{'protocol':'http', 'ip_port':'182.53.201.240:8080'},
{'protocol':'http', 'ip_port':'177.21.115.164:20183'},
{'protocol':'http', 'ip_port':'201.49.238.77:20183'},
{'protocol':'http', 'ip_port':'101.109.64.19:8080'},
{'protocol':'http', 'ip_port':'36.81.21.226:8080'},
{'protocol':'http', 'ip_port':'37.60.209.54:8081'},
{'protocol':'http', 'ip_port':'143.0.141.96:80'},
{'protocol':'http', 'ip_port':'201.49.238.28:20183'},
{'protocol':'http', 'ip_port':'175.107.208.74:8080'},
{'protocol':'http', 'ip_port':'80.211.226.156:80'},
{'protocol':'http', 'ip_port':'119.42.72.139:31588'},
{'protocol':'http', 'ip_port':'61.5.101.56:3128'},
{'protocol':'http', 'ip_port':'180.183.223.47:8080'},
{'protocol':'http', 'ip_port':'197.159.16.2:8080'},
{'protocol':'http', 'ip_port':'27.147.142.146:8080'},
{'protocol':'http', 'ip_port':'201.76.125.107:20183'},
{'protocol':'http', 'ip_port':'103.78.74.170:3128'},
{'protocol':'http', 'ip_port':'85.130.3.136:53281'},
{'protocol':'http', 'ip_port':'213.144.123.146:80'},
{'protocol':'http', 'ip_port':'182.253.179.230:8080'},
{'protocol':'http', 'ip_port':'170.79.202.162:20183'},
] | proxies = [{'protocol': 'http', 'ip_port': '118.193.26.18:8080'}, {'protocol': 'http', 'ip_port': '213.136.77.246:80'}, {'protocol': 'http', 'ip_port': '198.199.127.16:80'}, {'protocol': 'http', 'ip_port': '103.78.213.147:80'}, {'protocol': 'https', 'ip_port': '61.90.73.10:8080'}, {'protocol': 'http', 'ip_port': '36.83.78.184:80'}, {'protocol': 'http', 'ip_port': '66.119.180.101:80'}, {'protocol': 'https', 'ip_port': '142.44.135.148:8080'}, {'protocol': 'http', 'ip_port': '80.211.181.37:3128'}, {'protocol': 'http', 'ip_port': '36.79.15.169:80'}, {'protocol': 'https', 'ip_port': '140.227.81.53:3128'}, {'protocol': 'http', 'ip_port': '47.52.231.140:8080'}, {'protocol': 'https', 'ip_port': '185.93.3.123:8080'}, {'protocol': 'http', 'ip_port': '121.121.125.55:80'}, {'protocol': 'https', 'ip_port': '191.252.92.198:8080'}, {'protocol': 'http', 'ip_port': '213.136.89.121:80'}, {'protocol': 'http', 'ip_port': '36.83.82.36:80'}, {'protocol': 'https', 'ip_port': '163.44.165.165:8080'}, {'protocol': 'https', 'ip_port': '191.252.186.52:80'}, {'protocol': 'https', 'ip_port': '140.227.78.54:3128'}, {'protocol': 'http', 'ip_port': '36.75.254.142:80'}, {'protocol': 'https', 'ip_port': '178.57.44.159:44331'}, {'protocol': 'http', 'ip_port': '80.48.119.28:8080'}, {'protocol': 'https', 'ip_port': '103.241.205.66:8080'}, {'protocol': 'http', 'ip_port': '36.83.77.39:80'}, {'protocol': 'https', 'ip_port': '149.56.45.68:10000'}, {'protocol': 'http', 'ip_port': '177.67.83.134:3128'}, {'protocol': 'https', 'ip_port': '167.99.224.142:8080'}, {'protocol': 'http', 'ip_port': '66.70.190.244:8080'}, {'protocol': 'http', 'ip_port': '36.83.93.62:80'}, {'protocol': 'https', 'ip_port': '178.136.225.96:53281'}, {'protocol': 'https', 'ip_port': '212.77.86.103:80'}, {'protocol': 'https', 'ip_port': '158.69.150.164:8080'}, {'protocol': 'http', 'ip_port': '66.119.180.104:80'}, {'protocol': 'https', 'ip_port': '66.70.146.227:3128'}, {'protocol': 'https', 'ip_port': '110.164.181.164:8080'}, {'protocol': 'http', 'ip_port': '88.99.215.14:80'}, {'protocol': 'https', 'ip_port': '124.120.105.127:3128'}, {'protocol': 'http', 'ip_port': '159.65.63.23:80'}, {'protocol': 'http', 'ip_port': '66.119.180.103:80'}, {'protocol': 'http', 'ip_port': '18.130.46.39:80'}, {'protocol': 'http', 'ip_port': '81.22.54.60:53281'}, {'protocol': 'http', 'ip_port': '45.115.39.139:7777'}, {'protocol': 'http', 'ip_port': '60.49.97.65:53281'}, {'protocol': 'http', 'ip_port': '176.15.169.70:53281'}, {'protocol': 'http', 'ip_port': '81.211.23.6:3128'}, {'protocol': 'http', 'ip_port': '190.12.58.187:53281'}, {'protocol': 'http', 'ip_port': '196.61.28.125:53281'}, {'protocol': 'http', 'ip_port': '47.89.30.82:8118'}, {'protocol': 'http', 'ip_port': '109.76.229.164:8080'}, {'protocol': 'http', 'ip_port': '199.195.119.37:80'}, {'protocol': 'http', 'ip_port': '122.54.105.143:53281'}, {'protocol': 'http', 'ip_port': '62.43.201.40:53281'}, {'protocol': 'http', 'ip_port': '41.204.84.182:53281'}, {'protocol': 'http', 'ip_port': '196.202.194.127:62225'}, {'protocol': 'http', 'ip_port': '159.224.176.205:53281'}, {'protocol': 'http', 'ip_port': '136.169.141.254:8080'}, {'protocol': 'http', 'ip_port': '125.162.211.20:80'}, {'protocol': 'http', 'ip_port': '60.250.79.187:80'}, {'protocol': 'http', 'ip_port': '165.90.11.18:8080'}, {'protocol': 'http', 'ip_port': '111.93.64.113:80'}, {'protocol': 'https', 'ip_port': '147.135.210.114:54566'}, {'protocol': 'http', 'ip_port': '184.172.231.86:80'}, {'protocol': 'https', 'ip_port': '89.236.17.106:3128'}, {'protocol': 'http', 'ip_port': '175.139.252.193:80'}, {'protocol': 'http', 'ip_port': '187.60.253.78:3128'}, {'protocol': 'http', 'ip_port': '109.74.75.61:80'}, {'protocol': 'http', 'ip_port': '14.136.246.173:3128'}, {'protocol': 'http', 'ip_port': '198.1.122.29:80'}, {'protocol': 'http', 'ip_port': '159.65.182.63:80'}, {'protocol': 'http', 'ip_port': '129.213.76.9:3128'}, {'protocol': 'https', 'ip_port': '189.115.92.71:80'}, {'protocol': 'http', 'ip_port': '74.209.243.116:3128'}, {'protocol': 'https', 'ip_port': '191.252.120.198:8080'}, {'protocol': 'http', 'ip_port': '115.249.145.202:80'}, {'protocol': 'https', 'ip_port': '94.130.20.85:31288'}, {'protocol': 'https', 'ip_port': '185.65.192.36:8080'}, {'protocol': 'http', 'ip_port': '185.70.79.131:3128'}, {'protocol': 'https', 'ip_port': '77.120.72.235:53281'}, {'protocol': 'https', 'ip_port': '191.252.194.156:3128'}, {'protocol': 'https', 'ip_port': '71.13.112.152:3128'}, {'protocol': 'http', 'ip_port': '5.189.133.231:80'}, {'protocol': 'http', 'ip_port': '91.205.239.120:8080'}, {'protocol': 'http', 'ip_port': '121.254.214.219:80'}, {'protocol': 'http', 'ip_port': '185.229.224.61:80'}, {'protocol': 'http', 'ip_port': '34.201.72.254:80'}, {'protocol': 'http', 'ip_port': '163.172.86.64:3128'}, {'protocol': 'http', 'ip_port': '46.4.62.108:80'}, {'protocol': 'http', 'ip_port': '47.89.41.164:80'}, {'protocol': 'http', 'ip_port': '34.244.2.143:80'}, {'protocol': 'http', 'ip_port': '177.21.115.43:20183'}, {'protocol': 'http', 'ip_port': '190.109.32.251:8080'}, {'protocol': 'http', 'ip_port': '177.21.109.90:20183'}, {'protocol': 'http', 'ip_port': '89.169.88.169:8080'}, {'protocol': 'http', 'ip_port': '167.99.28.176:8080'}, {'protocol': 'http', 'ip_port': '128.199.129.5:80'}, {'protocol': 'http', 'ip_port': '192.141.206.176:20183'}, {'protocol': 'http', 'ip_port': '85.109.69.223:9090'}, {'protocol': 'http', 'ip_port': '103.18.180.1:8080'}, {'protocol': 'http', 'ip_port': '36.65.187.232:8080'}, {'protocol': 'http', 'ip_port': '103.41.96.186:8080'}, {'protocol': 'http', 'ip_port': '186.94.179.162:8080'}, {'protocol': 'http', 'ip_port': '93.143.193.34:8080'}, {'protocol': 'http', 'ip_port': '4.35.210.222:8181'}, {'protocol': 'http', 'ip_port': '87.118.208.125:8080'}, {'protocol': 'http', 'ip_port': '103.26.54.21:8080'}, {'protocol': 'http', 'ip_port': '80.245.117.133:8080'}, {'protocol': 'http', 'ip_port': '123.49.53.210:8080'}, {'protocol': 'http', 'ip_port': '201.249.49.105:8080'}, {'protocol': 'http', 'ip_port': '201.44.187.67:20183'}, {'protocol': 'http', 'ip_port': '103.25.155.5:8080'}, {'protocol': 'http', 'ip_port': '193.150.117.61:8000'}, {'protocol': 'http', 'ip_port': '62.69.195.249:8080'}, {'protocol': 'http', 'ip_port': '103.35.168.14:8080'}, {'protocol': 'http', 'ip_port': '74.83.246.125:8081'}, {'protocol': 'http', 'ip_port': '27.123.0.153:8080'}, {'protocol': 'http', 'ip_port': '5.13.254.175:8080'}, {'protocol': 'http', 'ip_port': '103.216.144.17:8080'}, {'protocol': 'http', 'ip_port': '5.40.227.209:8080'}, {'protocol': 'http', 'ip_port': '182.18.200.92:8080'}, {'protocol': 'http', 'ip_port': '170.79.200.233:20183'}, {'protocol': 'http', 'ip_port': '52.128.58.102:8080'}, {'protocol': 'http', 'ip_port': '103.218.24.41:8080'}, {'protocol': 'http', 'ip_port': '221.187.134.102:8080'}, {'protocol': 'http', 'ip_port': '103.111.228.2:8080'}, {'protocol': 'http', 'ip_port': '103.218.25.33:8080'}, {'protocol': 'http', 'ip_port': '61.8.78.130:8080'}, {'protocol': 'http', 'ip_port': '177.36.208.121:3128'}, {'protocol': 'http', 'ip_port': '45.125.223.145:8080'}, {'protocol': 'http', 'ip_port': '193.19.135.1:8080'}, {'protocol': 'http', 'ip_port': '103.48.70.193:8080'}, {'protocol': 'http', 'ip_port': '81.34.18.159:8080'}, {'protocol': 'http', 'ip_port': '175.209.132.102:808'}, {'protocol': 'http', 'ip_port': '177.74.247.59:3128'}, {'protocol': 'http', 'ip_port': '1.179.181.17:8081'}, {'protocol': 'http', 'ip_port': '80.72.66.212:8081'}, {'protocol': 'http', 'ip_port': '91.237.240.70:8080'}, {'protocol': 'http', 'ip_port': '200.122.209.78:8080'}, {'protocol': 'http', 'ip_port': '36.66.103.63:3128'}, {'protocol': 'http', 'ip_port': '122.54.20.216:8090'}, {'protocol': 'http', 'ip_port': '203.154.82.34:8080'}, {'protocol': 'http', 'ip_port': '66.96.237.133:8080'}, {'protocol': 'http', 'ip_port': '177.36.131.200:20183'}, {'protocol': 'http', 'ip_port': '200.122.211.26:8080'}, {'protocol': 'http', 'ip_port': '103.35.171.93:8080'}, {'protocol': 'http', 'ip_port': '2.138.25.150:8080'}, {'protocol': 'http', 'ip_port': '177.204.155.131:3128'}, {'protocol': 'http', 'ip_port': '103.206.254.190:8080'}, {'protocol': 'http', 'ip_port': '177.220.186.11:8080'}, {'protocol': 'http', 'ip_port': '177.47.243.74:8088'}, {'protocol': 'http', 'ip_port': '177.21.109.69:20183'}, {'protocol': 'http', 'ip_port': '1.179.185.253:8080'}, {'protocol': 'http', 'ip_port': '182.23.28.186:3128'}, {'protocol': 'http', 'ip_port': '80.87.176.16:8080'}, {'protocol': 'http', 'ip_port': '202.169.252.73:8080'}, {'protocol': 'http', 'ip_port': '154.72.81.45:8080'}, {'protocol': 'http', 'ip_port': '190.201.95.84:8080'}, {'protocol': 'http', 'ip_port': '195.228.210.245:8080'}, {'protocol': 'http', 'ip_port': '91.237.240.4:8080'}, {'protocol': 'http', 'ip_port': '202.137.15.93:8080'}, {'protocol': 'http', 'ip_port': '87.249.205.103:8080'}, {'protocol': 'http', 'ip_port': '189.8.93.173:20183'}, {'protocol': 'http', 'ip_port': '177.21.104.205:20183'}, {'protocol': 'http', 'ip_port': '172.245.211.188:5836'}, {'protocol': 'http', 'ip_port': '88.255.101.175:8080'}, {'protocol': 'http', 'ip_port': '131.161.124.36:3128'}, {'protocol': 'http', 'ip_port': '182.16.171.26:53281'}, {'protocol': 'http', 'ip_port': '45.123.43.158:8080'}, {'protocol': 'http', 'ip_port': '94.45.49.170:8080'}, {'protocol': 'http', 'ip_port': '177.22.91.71:20183'}, {'protocol': 'http', 'ip_port': '181.129.33.218:62225'}, {'protocol': 'http', 'ip_port': '190.109.169.41:53281'}, {'protocol': 'https', 'ip_port': '204.48.22.184:3432'}, {'protocol': 'https', 'ip_port': '198.50.137.181:3128'}, {'protocol': 'http', 'ip_port': '173.212.202.65:443'}, {'protocol': 'https', 'ip_port': '170.78.23.245:8080'}, {'protocol': 'https', 'ip_port': '158.69.143.77:8080'}, {'protocol': 'http', 'ip_port': '103.87.16.2:80'}, {'protocol': 'https', 'ip_port': '18.222.124.59:8080'}, {'protocol': 'http', 'ip_port': '47.254.22.115:8080'}, {'protocol': 'http', 'ip_port': '118.69.34.21:8080'}, {'protocol': 'http', 'ip_port': '138.117.115.249:53281'}, {'protocol': 'http', 'ip_port': '190.4.4.204:3128'}, {'protocol': 'http', 'ip_port': '42.112.208.124:53281'}, {'protocol': 'http', 'ip_port': '188.120.232.181:8118'}, {'protocol': 'https', 'ip_port': '177.52.250.126:8080'}, {'protocol': 'http', 'ip_port': '218.50.2.102:8080'}, {'protocol': 'http', 'ip_port': '54.95.211.163:8080'}, {'protocol': 'http', 'ip_port': '35.200.69.141:8080'}, {'protocol': 'http', 'ip_port': '181.49.24.126:8081'}, {'protocol': 'https', 'ip_port': '96.9.69.230:53281'}, {'protocol': 'https', 'ip_port': '192.116.142.153:8080'}, {'protocol': 'http', 'ip_port': '171.244.32.140:8080'}, {'protocol': 'https', 'ip_port': '195.133.220.18:43596'}, {'protocol': 'https', 'ip_port': '209.190.4.117:8080'}, {'protocol': 'http', 'ip_port': '39.109.112.111:8080'}, {'protocol': 'http', 'ip_port': '176.53.2.122:8080'}, {'protocol': 'https', 'ip_port': '200.255.53.2:8080'}, {'protocol': 'http', 'ip_port': '125.26.98.165:8080'}, {'protocol': 'http', 'ip_port': '212.90.167.90:55555'}, {'protocol': 'https', 'ip_port': '125.25.202.139:3128'}, {'protocol': 'http', 'ip_port': '83.238.100.226:3128'}, {'protocol': 'http', 'ip_port': '103.87.170.105:42421'}, {'protocol': 'http', 'ip_port': '195.138.83.218:53281'}, {'protocol': 'http', 'ip_port': '185.237.87.240:80'}, {'protocol': 'http', 'ip_port': '188.0.138.147:8080'}, {'protocol': 'http', 'ip_port': '181.211.166.105:54314'}, {'protocol': 'http', 'ip_port': '87.185.153.132:8080'}, {'protocol': 'http', 'ip_port': '67.238.124.52:8080'}, {'protocol': 'http', 'ip_port': '159.192.206.10:8080'}, {'protocol': 'http', 'ip_port': '159.65.168.7:80'}, {'protocol': 'http', 'ip_port': '108.61.203.146:8118'}, {'protocol': 'http', 'ip_port': '173.212.209.59:80'}, {'protocol': 'http', 'ip_port': '88.205.171.222:8080'}, {'protocol': 'http', 'ip_port': '38.103.239.2:44372'}, {'protocol': 'http', 'ip_port': '182.16.171.18:53281'}, {'protocol': 'http', 'ip_port': '177.21.108.222:20183'}, {'protocol': 'http', 'ip_port': '182.253.139.36:65301'}, {'protocol': 'https', 'ip_port': '200.7.205.198:8081'}, {'protocol': 'https', 'ip_port': '41.169.67.242:53281'}, {'protocol': 'http', 'ip_port': '41.190.33.162:8080'}, {'protocol': 'https', 'ip_port': '94.130.14.146:31288'}, {'protocol': 'https', 'ip_port': '88.99.149.188:31288'}, {'protocol': 'https', 'ip_port': '80.211.151.246:8145'}, {'protocol': 'https', 'ip_port': '136.169.225.53:3128'}, {'protocol': 'http', 'ip_port': '47.252.1.152:80'}, {'protocol': 'https', 'ip_port': '61.7.175.138:41496'}, {'protocol': 'http', 'ip_port': '52.214.181.43:80'}, {'protocol': 'https', 'ip_port': '67.205.148.246:8080'}, {'protocol': 'https', 'ip_port': '176.31.250.164:3128'}, {'protocol': 'http', 'ip_port': '109.195.243.177:8197'}, {'protocol': 'http', 'ip_port': '46.105.51.183:80'}, {'protocol': 'https', 'ip_port': '94.141.157.182:8080'}, {'protocol': 'https', 'ip_port': '14.207.100.203:8080'}, {'protocol': 'http', 'ip_port': '163.172.181.29:80'}, {'protocol': 'https', 'ip_port': '54.36.162.123:10000'}, {'protocol': 'http', 'ip_port': '52.87.190.26:80'}, {'protocol': 'http', 'ip_port': '212.98.150.50:80'}, {'protocol': 'https', 'ip_port': '66.82.144.29:8080'}, {'protocol': 'http', 'ip_port': '188.166.223.181:80'}, {'protocol': 'http', 'ip_port': '180.251.80.119:8080'}, {'protocol': 'http', 'ip_port': '94.21.75.9:8080'}, {'protocol': 'http', 'ip_port': '177.105.252.133:20183'}, {'protocol': 'http', 'ip_port': '61.7.138.109:8080'}, {'protocol': 'http', 'ip_port': '110.78.155.27:8080'}, {'protocol': 'http', 'ip_port': '178.49.139.13:80'}, {'protocol': 'https', 'ip_port': '146.158.30.192:53281'}, {'protocol': 'https', 'ip_port': '171.255.199.129:80'}, {'protocol': 'http', 'ip_port': '92.222.74.221:80'}, {'protocol': 'http', 'ip_port': '170.79.202.23:20183'}, {'protocol': 'http', 'ip_port': '179.182.63.63:20183'}, {'protocol': 'http', 'ip_port': '212.14.166.26:3128'}, {'protocol': 'https', 'ip_port': '103.233.118.83:808'}, {'protocol': 'http', 'ip_port': '110.170.150.52:8080'}, {'protocol': 'http', 'ip_port': '181.143.129.180:3128'}, {'protocol': 'http', 'ip_port': '181.119.115.2:53281'}, {'protocol': 'http', 'ip_port': '185.8.158.149:8080'}, {'protocol': 'http', 'ip_port': '103.39.251.241:8080'}, {'protocol': 'http', 'ip_port': '46.229.252.61:8080'}, {'protocol': 'http', 'ip_port': '93.182.72.36:8080'}, {'protocol': 'http', 'ip_port': '201.54.5.117:3128'}, {'protocol': 'http', 'ip_port': '78.140.6.68:53281'}, {'protocol': 'http', 'ip_port': '177.184.83.162:20183'}, {'protocol': 'http', 'ip_port': '143.202.75.240:20183'}, {'protocol': 'http', 'ip_port': '31.145.83.202:8080'}, {'protocol': 'http', 'ip_port': '177.101.181.33:20183'}, {'protocol': 'http', 'ip_port': '144.76.190.233:3128'}, {'protocol': 'http', 'ip_port': '134.0.63.134:8000'}, {'protocol': 'http', 'ip_port': '38.103.239.13:35617'}, {'protocol': 'http', 'ip_port': '110.78.168.138:62225'}, {'protocol': 'http', 'ip_port': '198.58.123.138:8123'}, {'protocol': 'http', 'ip_port': '190.78.8.120:8080'}, {'protocol': 'http', 'ip_port': '190.23.68.39:8080'}, {'protocol': 'http', 'ip_port': '191.55.10.27:3128'}, {'protocol': 'http', 'ip_port': '200.71.146.146:8080'}, {'protocol': 'http', 'ip_port': '103.102.248.56:3128'}, {'protocol': 'http', 'ip_port': '37.110.74.231:8181'}, {'protocol': 'http', 'ip_port': '191.5.183.120:20183'}, {'protocol': 'http', 'ip_port': '154.68.195.8:8080'}, {'protocol': 'http', 'ip_port': '182.53.201.240:8080'}, {'protocol': 'http', 'ip_port': '177.21.115.164:20183'}, {'protocol': 'http', 'ip_port': '201.49.238.77:20183'}, {'protocol': 'http', 'ip_port': '101.109.64.19:8080'}, {'protocol': 'http', 'ip_port': '36.81.21.226:8080'}, {'protocol': 'http', 'ip_port': '37.60.209.54:8081'}, {'protocol': 'http', 'ip_port': '143.0.141.96:80'}, {'protocol': 'http', 'ip_port': '201.49.238.28:20183'}, {'protocol': 'http', 'ip_port': '175.107.208.74:8080'}, {'protocol': 'http', 'ip_port': '80.211.226.156:80'}, {'protocol': 'http', 'ip_port': '119.42.72.139:31588'}, {'protocol': 'http', 'ip_port': '61.5.101.56:3128'}, {'protocol': 'http', 'ip_port': '180.183.223.47:8080'}, {'protocol': 'http', 'ip_port': '197.159.16.2:8080'}, {'protocol': 'http', 'ip_port': '27.147.142.146:8080'}, {'protocol': 'http', 'ip_port': '201.76.125.107:20183'}, {'protocol': 'http', 'ip_port': '103.78.74.170:3128'}, {'protocol': 'http', 'ip_port': '85.130.3.136:53281'}, {'protocol': 'http', 'ip_port': '213.144.123.146:80'}, {'protocol': 'http', 'ip_port': '182.253.179.230:8080'}, {'protocol': 'http', 'ip_port': '170.79.202.162:20183'}] |
"""
GTSAM Copyright 2010-2020, Georgia Tech Research Corporation,
Atlanta, Georgia 30332-0415
All Rights Reserved
See LICENSE for the license information
Various common utilities.
Author: Varun Agrawal
"""
def collect_namespaces(obj):
"""
Get the chain of namespaces from the lowest to highest for the given object.
Args:
obj: Object of type Namespace, Class, InstantiatedClass, or Enum.
"""
namespaces = []
ancestor = obj.parent
while ancestor and ancestor.name:
namespaces = [ancestor.name] + namespaces
ancestor = ancestor.parent
return [''] + namespaces
| """
GTSAM Copyright 2010-2020, Georgia Tech Research Corporation,
Atlanta, Georgia 30332-0415
All Rights Reserved
See LICENSE for the license information
Various common utilities.
Author: Varun Agrawal
"""
def collect_namespaces(obj):
"""
Get the chain of namespaces from the lowest to highest for the given object.
Args:
obj: Object of type Namespace, Class, InstantiatedClass, or Enum.
"""
namespaces = []
ancestor = obj.parent
while ancestor and ancestor.name:
namespaces = [ancestor.name] + namespaces
ancestor = ancestor.parent
return [''] + namespaces |
def notas(*n, sit=False):
"""
-> Funcao para analisar notas e situacoes de alunos
:param n: uma ou mais notas de alunos
:param sit: valor opcional, indicando se deve ou nao adicionar a situacao
:return: dicionario com varias informacoes sobre a situacao da turma
"""
r = dict()
r['total'] = len(n)
r['maior'] = max(n)
r['menor'] = min(n)
r['media'] = sum(n)/len(n)
if sit:
if r['media'] >= 7:
r['situacao'] = 'BOA'
elif r['media'] >= 5:
r['situacao'] = 'RAZOAVEL'
else:
r['situacao'] = 'RUIM'
return r
resp = notas(5.5,9.5,10,6.5,sit=True)
print(resp)
help(notas) | def notas(*n, sit=False):
"""
-> Funcao para analisar notas e situacoes de alunos
:param n: uma ou mais notas de alunos
:param sit: valor opcional, indicando se deve ou nao adicionar a situacao
:return: dicionario com varias informacoes sobre a situacao da turma
"""
r = dict()
r['total'] = len(n)
r['maior'] = max(n)
r['menor'] = min(n)
r['media'] = sum(n) / len(n)
if sit:
if r['media'] >= 7:
r['situacao'] = 'BOA'
elif r['media'] >= 5:
r['situacao'] = 'RAZOAVEL'
else:
r['situacao'] = 'RUIM'
return r
resp = notas(5.5, 9.5, 10, 6.5, sit=True)
print(resp)
help(notas) |
"""
This package is for adding officially supported integrations with other libraries.
The goal of the integrations is to make it easy to get started with dbx combined
with other frameworks. Features that an integration might add are:
- automatic loggic
- automatic checkpoints
- pause/resume functionality integrated with that of the other framework
- imports to from another framework format to dbx format (e.g. tensorboard to dbx)
- exports from dbx format to another framework format (e.g. dbx to tensorboard)
- and more.
Currently we only have a callback class for torchbearer which adds automatic
logging of some events. More integrations will be added in the future, depending
on user demand.
Are you using dbx or dbxlogger with other library or framework? Please share
back your work so others can benefit from it too. Simply sharing your experience
is also great so we can investigate together on how to create the best
integration.
"""
| """
This package is for adding officially supported integrations with other libraries.
The goal of the integrations is to make it easy to get started with dbx combined
with other frameworks. Features that an integration might add are:
- automatic loggic
- automatic checkpoints
- pause/resume functionality integrated with that of the other framework
- imports to from another framework format to dbx format (e.g. tensorboard to dbx)
- exports from dbx format to another framework format (e.g. dbx to tensorboard)
- and more.
Currently we only have a callback class for torchbearer which adds automatic
logging of some events. More integrations will be added in the future, depending
on user demand.
Are you using dbx or dbxlogger with other library or framework? Please share
back your work so others can benefit from it too. Simply sharing your experience
is also great so we can investigate together on how to create the best
integration.
""" |
def dict_words(string):
dict_word={}
list_words=string.split()
for word in list_words:
if(dict_word.get(word)!=None):
dict_word[word]+=1
else:
dict_word[word]=1
return dict_word
def main():
with open('datasets/rosalind_ini6.txt') as input_file:
string=input_file.read().strip()
dict_word=dict_words(string)
for key, value in dict_word.items():
print(str(key)+' '+str(value))
with open('solutions/rosalind_ini6.txt', 'w') as output_file:
for key, value in dict_word.items():
output_file.write(str(key)+' '+str(value)+'\n')
if(__name__=='__main__'):
main() | def dict_words(string):
dict_word = {}
list_words = string.split()
for word in list_words:
if dict_word.get(word) != None:
dict_word[word] += 1
else:
dict_word[word] = 1
return dict_word
def main():
with open('datasets/rosalind_ini6.txt') as input_file:
string = input_file.read().strip()
dict_word = dict_words(string)
for (key, value) in dict_word.items():
print(str(key) + ' ' + str(value))
with open('solutions/rosalind_ini6.txt', 'w') as output_file:
for (key, value) in dict_word.items():
output_file.write(str(key) + ' ' + str(value) + '\n')
if __name__ == '__main__':
main() |
SORTIE_PREFIXE = "God save"
def get_enfants(parent, liens_parente, morts):
return [f for p, f in liens_parente if (p == parent) and (f not in morts)]
def get_parent(fils, liens_parente):
for p, f in liens_parente:
if f == fils:
return p
def get_heritier(mec_mort, liens_parente, morts):
enfants = get_enfants(mec_mort, liens_parente, morts)
if len(enfants) > 0:
if enfants[0] not in morts:
return enfants[0]
else:
return get_heritier(enfants[0], liens_parente, morts)
else:
pere = get_parent(mec_mort, liens_parente)
return get_heritier(pere, liens_parente, morts)
def main():
mec_mort = input()
N = int(input())
liens_parente = [input().split() for _ in range(N - 1)]
D = int(input())
morts = [input() for _ in range(D)]
print(SORTIE_PREFIXE, get_heritier(mec_mort, liens_parente, morts))
if __name__ == '__main__':
main()
| sortie_prefixe = 'God save'
def get_enfants(parent, liens_parente, morts):
return [f for (p, f) in liens_parente if p == parent and f not in morts]
def get_parent(fils, liens_parente):
for (p, f) in liens_parente:
if f == fils:
return p
def get_heritier(mec_mort, liens_parente, morts):
enfants = get_enfants(mec_mort, liens_parente, morts)
if len(enfants) > 0:
if enfants[0] not in morts:
return enfants[0]
else:
return get_heritier(enfants[0], liens_parente, morts)
else:
pere = get_parent(mec_mort, liens_parente)
return get_heritier(pere, liens_parente, morts)
def main():
mec_mort = input()
n = int(input())
liens_parente = [input().split() for _ in range(N - 1)]
d = int(input())
morts = [input() for _ in range(D)]
print(SORTIE_PREFIXE, get_heritier(mec_mort, liens_parente, morts))
if __name__ == '__main__':
main() |
###############################################
# #
# Created by Youssef Sully #
# Beginner python #
# While Loops 3 #
# #
###############################################
# 1. in while loop we have to INITIALIZE the variable (iterator = 0)
# 2. execute the below command until this statement is (iterator < 10) TRUE
print("\n{} {} {}\n".format("-" * 9, "While loop", "-" * 9))
iterator = 0
while iterator < 10:
print("{} ".format(iterator), end='')
# means the new iterator = old iterator + 1 ---> the new value of the iterator is 1
# # also can be written as ---> iterator += 1
iterator = iterator + 1
print("\n")
print("{} {} {}\n".format("-" * 9, "Using break", "-" * 9))
# break used to break out of the loop
iterator = 0
while iterator < 10:
if iterator == 4:
print("Number 4 is reached the loop stopped due to break")
break
print("{} ".format(iterator), end='')
iterator += 1
print("\n{} {} {}\n".format("-" * 9, "Infinite loop", "-" * 9))
# Infinite loop needs a BREAK condition otherwise is going to run forever!
iterator = 0
while True:
if iterator == 4:
print("Number 4 is reached the loop stopped due to break")
break
print("{} ".format(iterator), end='')
iterator += 1
| print('\n{} {} {}\n'.format('-' * 9, 'While loop', '-' * 9))
iterator = 0
while iterator < 10:
print('{} '.format(iterator), end='')
iterator = iterator + 1
print('\n')
print('{} {} {}\n'.format('-' * 9, 'Using break', '-' * 9))
iterator = 0
while iterator < 10:
if iterator == 4:
print('Number 4 is reached the loop stopped due to break')
break
print('{} '.format(iterator), end='')
iterator += 1
print('\n{} {} {}\n'.format('-' * 9, 'Infinite loop', '-' * 9))
iterator = 0
while True:
if iterator == 4:
print('Number 4 is reached the loop stopped due to break')
break
print('{} '.format(iterator), end='')
iterator += 1 |
class Solution:
def findOcurrences(self, text: str, first: str, second: str) -> List[str]:
text = text.split(' ')
return [text[i] for i in range(2, len(text)) if text[i - 2] == first and text[i - 1] == second]
| class Solution:
def find_ocurrences(self, text: str, first: str, second: str) -> List[str]:
text = text.split(' ')
return [text[i] for i in range(2, len(text)) if text[i - 2] == first and text[i - 1] == second] |
# Swap Pairs using Recursion
'''
Given a linked list, swap every two adjacent nodes and return its head.
You may not modify the values in the list's nodes, only nodes itself may be changed.
Example:
Given 1->2->3->4, you should return the list as 2->1->4->3.
'''
# Definition for singly-linked list.
# class ListNode:
# def __init__(self, val=0, next=None):
# self.val = val
# self.next = next
class Solution:
def swapPairs(self, head: ListNode) -> ListNode:
if not head or not head.next:
return head
temp = head
head = head.next
temp.next = head.next
head.next = temp
head.next.next = self.swapPairs(head.next.next)
return head | """
Given a linked list, swap every two adjacent nodes and return its head.
You may not modify the values in the list's nodes, only nodes itself may be changed.
Example:
Given 1->2->3->4, you should return the list as 2->1->4->3.
"""
class Solution:
def swap_pairs(self, head: ListNode) -> ListNode:
if not head or not head.next:
return head
temp = head
head = head.next
temp.next = head.next
head.next = temp
head.next.next = self.swapPairs(head.next.next)
return head |
class BaseMixin(object):
@property
def blocks(self):
return self.request.GET.getlist('hierarchy_block', [])
@property
def awcs(self):
return self.request.GET.getlist('hierarchy_awc', [])
@property
def gp(self):
return self.request.GET.getlist('hierarchy_gp', None)
def _safeint(value):
try:
return int(value)
except (ValueError, TypeError):
return 0
def format_percent(x, y):
y = _safeint(y)
percent = (y or 0) * 100 / (x or 1)
if percent < 33:
color = 'red'
elif 33 <= percent <= 67:
color = 'orange'
else:
color = 'green'
return "<span style='display: block; text-align:center; color:%s;'>%d<hr style='margin: 0;border-top: 0; border-color: black;'>%d%%</span>" % (color, y, percent)
def normal_format(value):
if not value:
value = 0
return "<span style='display: block; text-align:center;'>%d<hr style='margin: 0;border-top: 0; border-color: black;'></span>" % value
| class Basemixin(object):
@property
def blocks(self):
return self.request.GET.getlist('hierarchy_block', [])
@property
def awcs(self):
return self.request.GET.getlist('hierarchy_awc', [])
@property
def gp(self):
return self.request.GET.getlist('hierarchy_gp', None)
def _safeint(value):
try:
return int(value)
except (ValueError, TypeError):
return 0
def format_percent(x, y):
y = _safeint(y)
percent = (y or 0) * 100 / (x or 1)
if percent < 33:
color = 'red'
elif 33 <= percent <= 67:
color = 'orange'
else:
color = 'green'
return "<span style='display: block; text-align:center; color:%s;'>%d<hr style='margin: 0;border-top: 0; border-color: black;'>%d%%</span>" % (color, y, percent)
def normal_format(value):
if not value:
value = 0
return "<span style='display: block; text-align:center;'>%d<hr style='margin: 0;border-top: 0; border-color: black;'></span>" % value |
n, k = input().strip().split(' ')
n, k = int(n), int(k)
imp_contests = 0
imp = []
nimp = []
for i in range(n):
l, t = input().strip().split(' ')
l, t = int(l), int(t)
if t == 1:
imp.append([l,t])
else:
nimp.append([l,t])
imp.sort()
ans = 0
ans_subtract = 0
for i in range(len(imp)-k):
ans_subtract += imp[i][0]
del imp[i]
for i in range(len(imp)):
ans += imp[i][0]
for i in range(len(nimp)):
ans += nimp[i][0]
print(ans-ans_subtract)
| (n, k) = input().strip().split(' ')
(n, k) = (int(n), int(k))
imp_contests = 0
imp = []
nimp = []
for i in range(n):
(l, t) = input().strip().split(' ')
(l, t) = (int(l), int(t))
if t == 1:
imp.append([l, t])
else:
nimp.append([l, t])
imp.sort()
ans = 0
ans_subtract = 0
for i in range(len(imp) - k):
ans_subtract += imp[i][0]
del imp[i]
for i in range(len(imp)):
ans += imp[i][0]
for i in range(len(nimp)):
ans += nimp[i][0]
print(ans - ans_subtract) |
def f(a):
s = 0
for i in range(1,a):
if a%i == 0:
s+=i
return "Perfect" if s==a else ("Abundant" if s > a else "Deficient")
T = int(input())
L = list(map(int,input().split()))
for i in L:
print(f(i)) | def f(a):
s = 0
for i in range(1, a):
if a % i == 0:
s += i
return 'Perfect' if s == a else 'Abundant' if s > a else 'Deficient'
t = int(input())
l = list(map(int, input().split()))
for i in L:
print(f(i)) |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sun Oct 13 19:35:17 2019
@author: abhijithneilabraham
"""
name='katran' | """
Created on Sun Oct 13 19:35:17 2019
@author: abhijithneilabraham
"""
name = 'katran' |
#!/usr/bin/python
class Block(object):
def __init__(self):
print("Block")
class Chain(object):
def __init__(self):
print("Chain")
def main():
b = Block()
c = Chain()
if __name__ == "__main__":
main() | class Block(object):
def __init__(self):
print('Block')
class Chain(object):
def __init__(self):
print('Chain')
def main():
b = block()
c = chain()
if __name__ == '__main__':
main() |
class Config:
DEBUG = True
SQLALCHEMY_DATABASE_URI = "mysql+mysqldb://taewookim:1234@173.194.86.171:3306/roompi2_db"
SQLALCHEMY_TRACK_MODIFICATION = True
@classmethod
def init_app(cls, app):
# config setting for flask app instance
app.config.from_object(cls)
return app
| class Config:
debug = True
sqlalchemy_database_uri = 'mysql+mysqldb://taewookim:1234@173.194.86.171:3306/roompi2_db'
sqlalchemy_track_modification = True
@classmethod
def init_app(cls, app):
app.config.from_object(cls)
return app |
"""
Given a string path, which is an absolute path (starting with a slash '/') to a file or directory in a Unix-style file system, convert it to the simplified canonical path.
In a Unix-style file system, a period '.' refers to the current directory, a double period '..' refers to the directory up a level, and any multiple consecutive slashes (i.e. '//') are treated as a single slash '/'. For this problem, any other format of periods such as '...' are treated as file/directory names.
The canonical path should have the following format:
The path starts with a single slash '/'.
Any two directories are separated by a single slash '/'.
The path does not end with a trailing '/'.
The path only contains the directories on the path from the root directory to the target file or directory (i.e., no period '.' or double period '..')
Return the simplified canonical path.
Example 1:
Input: path = "/home/"
Output: "/home"
Explanation: Note that there is no trailing slash after the last directory name.
Example 2:
Input: path = "/../"
Output: "/"
Explanation: Going one level up from the root directory is a no-op, as the root level is the highest level you can go.
Example 3:
Input: path = "/home//foo/"
Output: "/home/foo"
Explanation: In the canonical path, multiple consecutive slashes are replaced by a single one.
Example 4:
Input: path = "/a/./b/../../c/"
Output: "/c"
Constraints:
1 <= path.length <= 3000
path consists of English letters, digits, period '.', slash '/' or '_'.
path is a valid absolute Unix path.
"""
# e.g. :
# path = "/../a/b/c/./.. "
# -- > output = "/a/b"
# TRICK :
# IF ".." , then stack pop
# IF "." , then do nothing
# ELSE , push to stack
# STEP 1. "/" : root directory
# STEP 2. ".." : to the upper directory, since it is blank, so still stay at root directory
# STEP 3. "a" : to sub directory a, now at "/a"
# STEP 4. "b" : to sub directory a, now at "/a/b"
# STEP 5. "c" : to sub directory a, now at "/a/b/c"
# STEP 6. "." : current directory, do nothing. still at "/a/b/c"
# STEP 7. ".." : back to the upper directory, stay at "/a/b" finally
# V0
class Solution(object):
def simplifyPath(self, path):
stack = []
dirs = path.split('/')
for dir in dirs:
if not dir or dir == '.':
continue
if dir == '..':
if stack:
stack.pop()
else:
stack.append(dir)
return '/' + '/'.join(stack)
# V0'
class Solution(object):
def simplifyPath(self, path):
s_final = []
# note this trick
_path = path.split("/")
for p in _path:
if p == "." or p == "":
## NOTE : use continue here
# the continue will SKIP REST OF THE CODE IN THE LOOP
# https://www.programiz.com/python-programming/break-continue
continue
elif p == "..":
if s_final:
# attay has this method
s_final.pop()
else:
s_final.append(p)
return "/" + "/".join(s_final)
# V1
# https://blog.csdn.net/fuxuemingzhu/article/details/80812350
# https://www.cnblogs.com/zuoyuan/p/3777289.html
# IDEA : SIMULATE THE PROCESS
class Solution(object):
def simplifyPath(self, path):
"""
:type path: str
:rtype: str
"""
stack = list()
dirs = path.split('/')
for dir in dirs:
if not dir or dir == '.':
continue
if dir == '..':
if stack:
stack.pop()
else:
stack.append(dir)
return '/' + '/'.join(stack)
# output :
# In [54]: Solution().simplifyPath(path)
# ...:
# token :
# stack : []
# token : a
# stack : ['a']
# token : .
# stack : ['a']
# token : b
# stack : ['a', 'b']
# token : ..
# stack : ['a']
# token : ..
# stack : []
# token : c
# stack : ['c']
# token :
# stack : ['c']
# Out[54]: '/c'
# V2
# Time: O(n)
# Space: O(n)
class Solution(object):
# @param path, a string
# @return a string
def simplifyPath(self, path):
stack, tokens = [], path.split("/")
for token in tokens:
if token == ".." and stack:
stack.pop()
elif token != ".." and token != "." and token:
stack.append(token)
return "/" + "/".join(stack)
| """
Given a string path, which is an absolute path (starting with a slash '/') to a file or directory in a Unix-style file system, convert it to the simplified canonical path.
In a Unix-style file system, a period '.' refers to the current directory, a double period '..' refers to the directory up a level, and any multiple consecutive slashes (i.e. '//') are treated as a single slash '/'. For this problem, any other format of periods such as '...' are treated as file/directory names.
The canonical path should have the following format:
The path starts with a single slash '/'.
Any two directories are separated by a single slash '/'.
The path does not end with a trailing '/'.
The path only contains the directories on the path from the root directory to the target file or directory (i.e., no period '.' or double period '..')
Return the simplified canonical path.
Example 1:
Input: path = "/home/"
Output: "/home"
Explanation: Note that there is no trailing slash after the last directory name.
Example 2:
Input: path = "/../"
Output: "/"
Explanation: Going one level up from the root directory is a no-op, as the root level is the highest level you can go.
Example 3:
Input: path = "/home//foo/"
Output: "/home/foo"
Explanation: In the canonical path, multiple consecutive slashes are replaced by a single one.
Example 4:
Input: path = "/a/./b/../../c/"
Output: "/c"
Constraints:
1 <= path.length <= 3000
path consists of English letters, digits, period '.', slash '/' or '_'.
path is a valid absolute Unix path.
"""
class Solution(object):
def simplify_path(self, path):
stack = []
dirs = path.split('/')
for dir in dirs:
if not dir or dir == '.':
continue
if dir == '..':
if stack:
stack.pop()
else:
stack.append(dir)
return '/' + '/'.join(stack)
class Solution(object):
def simplify_path(self, path):
s_final = []
_path = path.split('/')
for p in _path:
if p == '.' or p == '':
continue
elif p == '..':
if s_final:
s_final.pop()
else:
s_final.append(p)
return '/' + '/'.join(s_final)
class Solution(object):
def simplify_path(self, path):
"""
:type path: str
:rtype: str
"""
stack = list()
dirs = path.split('/')
for dir in dirs:
if not dir or dir == '.':
continue
if dir == '..':
if stack:
stack.pop()
else:
stack.append(dir)
return '/' + '/'.join(stack)
class Solution(object):
def simplify_path(self, path):
(stack, tokens) = ([], path.split('/'))
for token in tokens:
if token == '..' and stack:
stack.pop()
elif token != '..' and token != '.' and token:
stack.append(token)
return '/' + '/'.join(stack) |
# -*- coding: utf-8 -*-
# segundo link: dobro do terceiro
# segundo link: metade do primeiro
clicks_on_3 = int(input())
clicks_on_2 = clicks_on_3 * 2
clicks_on_1 = clicks_on_2 * 2
print(clicks_on_1)
| clicks_on_3 = int(input())
clicks_on_2 = clicks_on_3 * 2
clicks_on_1 = clicks_on_2 * 2
print(clicks_on_1) |
#Coded by Ribhu Sengupta.
def solveKnightMove(board, n, move_no, currRow, currCol): #solveKnightMove(board, dimesion of board, Moves_already_done, currRoe, currCol)
if move_no == n*n: #Lets say n=8, if no of moves knight covered 64 then it will stop further recursion.
return True
rowDir = [+2, +1, -1, -2, -2, -1, +2, +2] #x or Row Co-ordinates where knight can be placed in respective to its current co-ordinate.
colDir = [+1, +2, +2, +1, -1, -2, -2, -1] #y or Column Co-ordinates where knight can be placed in respective to its current co-ordinate.
for index in range(0, len(rowDir)): #Loop among row and column coordinates
nextRow = currRow + rowDir[index]
nextCol = currCol + colDir[index]
if canPlace(board, n, nextRow, nextCol) is True: #checking weather next move is valid and not covered till yet.
board[nextRow][nextCol] = move_no+1
isSuccessfull = solveKnightMove(board, n, move_no+1, nextRow, nextCol) # can predict that the next valid move could cover all the cells of chess board or not.
if isSuccessfull is True:
return True
board[nextRow][nextCol] = 0
return False
def canPlace(board, n, row, col): # Can Check the next moves of knight
if row>=0 and row<n and col>=0 and col<n:
if board[row][col] == 0:
return True
return False
return False
def printBoard(board, n): #printing the board.
for index1 in range(0, n):
for index2 in range(0, n):
print(board[index1][index2])
print('\n')
n = int(input("Enter a Dimension of board: "))
#creation of chess Board
board = [[]]
for index in range(0, n):
for index2 in range(0, n):
board[index].append(0)
board.append([])
board.pop(index+1)
# end of creation of chess board
board[0][0] = 1
ans = solveKnightMove(board, n, 1, 0, 0) #solveKnightMove(board, dimesion, Moves_already_done, currRoe, currCol)
if ans is True:
printBoard(board, n)
print(board)
else:
print("Not able to solve the board.")
| def solve_knight_move(board, n, move_no, currRow, currCol):
if move_no == n * n:
return True
row_dir = [+2, +1, -1, -2, -2, -1, +2, +2]
col_dir = [+1, +2, +2, +1, -1, -2, -2, -1]
for index in range(0, len(rowDir)):
next_row = currRow + rowDir[index]
next_col = currCol + colDir[index]
if can_place(board, n, nextRow, nextCol) is True:
board[nextRow][nextCol] = move_no + 1
is_successfull = solve_knight_move(board, n, move_no + 1, nextRow, nextCol)
if isSuccessfull is True:
return True
board[nextRow][nextCol] = 0
return False
def can_place(board, n, row, col):
if row >= 0 and row < n and (col >= 0) and (col < n):
if board[row][col] == 0:
return True
return False
return False
def print_board(board, n):
for index1 in range(0, n):
for index2 in range(0, n):
print(board[index1][index2])
print('\n')
n = int(input('Enter a Dimension of board: '))
board = [[]]
for index in range(0, n):
for index2 in range(0, n):
board[index].append(0)
board.append([])
board.pop(index + 1)
board[0][0] = 1
ans = solve_knight_move(board, n, 1, 0, 0)
if ans is True:
print_board(board, n)
print(board)
else:
print('Not able to solve the board.') |
# https://leetcode.com/problems/jewels-and-stones/description/
# input: J = "aA" | S = "aAAbbbb"
# output: 3
# input: J = "z", S = "ZZ"
# output: 0
# Solution: O(N^2)
def num_jewels_in_stones(J, S):
jewels = 0
for j in J:
for s in S:
if s == j:
jewels += 1
return jewels
print(num_jewels_in_stones("aA", "aAAbbbb"))
print(num_jewels_in_stones("z", "ZZ"))
# Solution: O(N)
def num_jewels_in_stones_opt(J, S):
number_by_chars = {}
counter = 0
for char in J:
if char in number_by_chars:
number_by_chars[char] += 1
else:
number_by_chars[char] = 1
for char in S:
if char in number_by_chars:
counter += number_by_chars[char]
return counter
print(num_jewels_in_stones_opt("aA", "aAAbbbb"))
print(num_jewels_in_stones_opt("z", "ZZ"))
| def num_jewels_in_stones(J, S):
jewels = 0
for j in J:
for s in S:
if s == j:
jewels += 1
return jewels
print(num_jewels_in_stones('aA', 'aAAbbbb'))
print(num_jewels_in_stones('z', 'ZZ'))
def num_jewels_in_stones_opt(J, S):
number_by_chars = {}
counter = 0
for char in J:
if char in number_by_chars:
number_by_chars[char] += 1
else:
number_by_chars[char] = 1
for char in S:
if char in number_by_chars:
counter += number_by_chars[char]
return counter
print(num_jewels_in_stones_opt('aA', 'aAAbbbb'))
print(num_jewels_in_stones_opt('z', 'ZZ')) |
def writeList(l,name):
wptr = open(name,"w")
wptr.write("%d\n" % len(l))
for i in l:
wptr.write("%d\n" % i)
wptr.close() | def write_list(l, name):
wptr = open(name, 'w')
wptr.write('%d\n' % len(l))
for i in l:
wptr.write('%d\n' % i)
wptr.close() |
# DEFAULT ROUTE
ROUTE_SANDBOX = 'https://sandbox.boletobancario.com/api-integration'
ROUTE_SANDBOX_AUTORIZATION_SERVER = "https://sandbox.boletobancario.com/authorization-server/oauth/token"
ROUTE_PRODUCAO = 'https://api.juno.com.br'
ROUTE_PRODUCAO_AUTORIZATION_SERVER = "https://api.juno.com.br/authorization-server/oauth/token"
| route_sandbox = 'https://sandbox.boletobancario.com/api-integration'
route_sandbox_autorization_server = 'https://sandbox.boletobancario.com/authorization-server/oauth/token'
route_producao = 'https://api.juno.com.br'
route_producao_autorization_server = 'https://api.juno.com.br/authorization-server/oauth/token' |
user_input = input("Enter maximum number: ")
number = int(user_input)
spaces_amount = number // 2
f = open("my_tree.txt", "w")
while (spaces_amount >= 0):
if (spaces_amount*2 == number):
spaces_amount -= 1
continue
for j in range(spaces_amount):
f.write(" ")
# print(" ", sep="", end="")
for j in range((number - (spaces_amount * 2))):
f.write("*")
# print("*", sep="", end="")
spaces_amount -= 1
f.write("\n")
# print()
f.close()
| user_input = input('Enter maximum number: ')
number = int(user_input)
spaces_amount = number // 2
f = open('my_tree.txt', 'w')
while spaces_amount >= 0:
if spaces_amount * 2 == number:
spaces_amount -= 1
continue
for j in range(spaces_amount):
f.write(' ')
for j in range(number - spaces_amount * 2):
f.write('*')
spaces_amount -= 1
f.write('\n')
f.close() |
# Copyright (c) 2020. JetBrains s.r.o.
# Use of this source code is governed by the MIT license that can be found in the LICENSE file.
# from .corr import *
# from .im import *
# __all__ = (im.__all__ +
# corr.__all__)
# 'bistro' packages must be imported explicitly.
__all__ = []
| __all__ = [] |
if __name__ == "__main__":
net_amount=0
while(True):
person = input("Enter the amount that you want to Deposit/Withdral ? ")
transaction = person.split(" ")
type = transaction[0]
amount =int( transaction[1])
if type =="D" or type =='d':
net_amount += amount
print("Your Net_amount is :-",net_amount)
elif type == 'W' or 'w':
net_amount -= amount
if net_amount>0:
print("Your Net_amount is :-",net_amount)
else:
print("Insufficient Balance!!!!!!!")
else:
pass
ext = input("Want to Continue (Y for yes and N for no)")
if not (ext=='Y' or ext=='y'):
break
| if __name__ == '__main__':
net_amount = 0
while True:
person = input('Enter the amount that you want to Deposit/Withdral ? ')
transaction = person.split(' ')
type = transaction[0]
amount = int(transaction[1])
if type == 'D' or type == 'd':
net_amount += amount
print('Your Net_amount is :-', net_amount)
elif type == 'W' or 'w':
net_amount -= amount
if net_amount > 0:
print('Your Net_amount is :-', net_amount)
else:
print('Insufficient Balance!!!!!!!')
else:
pass
ext = input('Want to Continue (Y for yes and N for no)')
if not (ext == 'Y' or ext == 'y'):
break |
# Put the token you got from https://discord.com/developers/applications/ here
token = 'x'
# Choose the prefix you'd like for your bot
prefix = "?"
# Copy your user id on Discord to set you as the owner of this bot
myid = 0
# Change None to the id of your logschannel (if you want one)
logschannelid = None
# Change 0 to your server's id (if you have one)
myserverid = 0
| token = 'x'
prefix = '?'
myid = 0
logschannelid = None
myserverid = 0 |
# course = "Python's course for Beginners"
# print(course[0])
# print(course[-1])
# print(course[-2])
# print(course[0:3])
# print(course[0:])
# print(course[1:])
# print(course[:5])
# print(course[:]) # copy string
#
# another = course[:]
# print(another)
#######################################
# first_name = 'Jennifer'
# print(first_name[1:-1])
#######################################
# Formatted Strings
# first = 'john'
# last = 'Smith'
# john [smith] is a coder
# message = first + ' [' + last + '] ' + 'is a coder'
#
# print(message)
#
# msg = f'{first} [{last}] is a coder'
#
# print(msg)
#######################################
# string Methods
course = "Python's course for Beginners"
# print(len(course)) # count number of chars
# print(course.upper())
# print(course.lower())
print(course.find('p')) # prints -1 means not exist
print(course.find('P'))
print(course.find('o'))
print(course.find('Beginners'))
print(course.replace('Beginners', 'Absolute Beginners'))
print('Python' in course)
print(course.title()) # to capitalize the first letter of every word
| course = "Python's course for Beginners"
print(course.find('p'))
print(course.find('P'))
print(course.find('o'))
print(course.find('Beginners'))
print(course.replace('Beginners', 'Absolute Beginners'))
print('Python' in course)
print(course.title()) |
class bcolors:
HEADER = '\033[95m'
OKBLUE = '\033[94m'
OKGREEN = '\033[92m'
WARNING = '\033[93m'
FAIL = '\033[91m'
ENDC = '\033[0m'
BOLD = '\033[1m'
UNDERLINE = '\033[4m'
# default load test intervals, in milliseconds
INTERVAL_DEFAULT = 200
# load test speed, txs per second
TXS_PER_SEC_NORMAL = 100
TXS_PER_SEC_SLOW = 10
# broadcast mode
TxCommit = 1
TxSync = 2
TxAsync = 3
| class Bcolors:
header = '\x1b[95m'
okblue = '\x1b[94m'
okgreen = '\x1b[92m'
warning = '\x1b[93m'
fail = '\x1b[91m'
endc = '\x1b[0m'
bold = '\x1b[1m'
underline = '\x1b[4m'
interval_default = 200
txs_per_sec_normal = 100
txs_per_sec_slow = 10
tx_commit = 1
tx_sync = 2
tx_async = 3 |
# -*- coding: utf-8 -*-
# @Time : 2020/1/23 13:38
# @Author : jwh5566
# @Email : jwh5566@aliyun.com
# @File : if_example.py
def check_if():
a = int(input("Enter a number \n"))
if (a == 100):
print("a is equal 100")
else:
print("a is not equal 100")
return a
| def check_if():
a = int(input('Enter a number \n'))
if a == 100:
print('a is equal 100')
else:
print('a is not equal 100')
return a |
amount_of_dancers = int(input())
amount_of_points = float(input())
season = input()
place = input()
money_left = 0
charity = 0
dancers_point_won = amount_of_dancers * amount_of_points
dancers_point_won_aboard = dancers_point_won + (dancers_point_won * 0.50)
money_per_dancer = 0
if place == "Bulgaria":
if season == "summer":
dancers_point_won = dancers_point_won - (dancers_point_won * 0.05)
charity = dancers_point_won * 0.75
money_left = dancers_point_won - charity
elif season == "winter":
dancers_point_won = dancers_point_won - (dancers_point_won * 0.08)
charity = dancers_point_won * 0.75
money_left = dancers_point_won - charity
if place == "Abroad":
if season == "summer":
dancers_point_won_aboard = dancers_point_won_aboard - (dancers_point_won_aboard * 0.10)
charity = dancers_point_won_aboard * 0.75
money_left = dancers_point_won_aboard - charity
elif season == "winter":
dancers_point_won_aboard = dancers_point_won_aboard - (dancers_point_won_aboard * 0.15)
charity = dancers_point_won_aboard * 0.75
money_left = dancers_point_won_aboard - charity
money_per_dancer = money_left / amount_of_dancers
print(f"Charity - {charity:.2f} ")
print(f"Money per dancer - {money_per_dancer:.2f}") | amount_of_dancers = int(input())
amount_of_points = float(input())
season = input()
place = input()
money_left = 0
charity = 0
dancers_point_won = amount_of_dancers * amount_of_points
dancers_point_won_aboard = dancers_point_won + dancers_point_won * 0.5
money_per_dancer = 0
if place == 'Bulgaria':
if season == 'summer':
dancers_point_won = dancers_point_won - dancers_point_won * 0.05
charity = dancers_point_won * 0.75
money_left = dancers_point_won - charity
elif season == 'winter':
dancers_point_won = dancers_point_won - dancers_point_won * 0.08
charity = dancers_point_won * 0.75
money_left = dancers_point_won - charity
if place == 'Abroad':
if season == 'summer':
dancers_point_won_aboard = dancers_point_won_aboard - dancers_point_won_aboard * 0.1
charity = dancers_point_won_aboard * 0.75
money_left = dancers_point_won_aboard - charity
elif season == 'winter':
dancers_point_won_aboard = dancers_point_won_aboard - dancers_point_won_aboard * 0.15
charity = dancers_point_won_aboard * 0.75
money_left = dancers_point_won_aboard - charity
money_per_dancer = money_left / amount_of_dancers
print(f'Charity - {charity:.2f} ')
print(f'Money per dancer - {money_per_dancer:.2f}') |
nome = input("Qual seu nome: ")
idade = int(input("Qual sua idade: "))
altura = float(input("Qual sua altura: "))
peso = float(input("Qual seu peso: "))
op= int(input("Estado civil:\n1.Casado\n2.Solteiro\n"))
if op==1:
op = True
else:
op = False
eu = [nome, idade, altura, peso, op]
for c in eu:
print(c, "\n")
| nome = input('Qual seu nome: ')
idade = int(input('Qual sua idade: '))
altura = float(input('Qual sua altura: '))
peso = float(input('Qual seu peso: '))
op = int(input('Estado civil:\n1.Casado\n2.Solteiro\n'))
if op == 1:
op = True
else:
op = False
eu = [nome, idade, altura, peso, op]
for c in eu:
print(c, '\n') |
#Example:
grocery = 'Milk\nChicken\r\nBread\rButter'
print(grocery.splitlines())
print(grocery.splitlines(True))
grocery = 'Milk Chicken Bread Butter'
print(grocery.splitlines())
| grocery = 'Milk\nChicken\r\nBread\rButter'
print(grocery.splitlines())
print(grocery.splitlines(True))
grocery = 'Milk Chicken Bread Butter'
print(grocery.splitlines()) |
class Document:
# general info about document
class Info:
def __init__(self):
self.author = "unknown"
self.producer = "unknown"
self.subject = "unknown"
self.title = "unknown"
self.table_of_contents = []
def __init__(self, path: str, is_pdf: bool):
self.is_pdf = is_pdf
self.info = Document.Info()
self.path = path
self.ocr_path = path
self.num_pages = None
self.images = []
self.tables = []
self.paragraphs = []
self.extractable = False
self.filename = None
def document_info_to_string(self):
return "Author: " + self.info.author + "\n" \
+ "Producer: " + self.info.producer + "\n" \
+ "Subject: " + self.info.subject + "\n" \
+ "Title: " + self.info.title + "\n" \
+ "Number of Pages: " + str(self.num_pages)
def table_of_contents_to_string(self):
output_string = ""
for tup in self.info.table_of_contents:
output_string += str(tup[0]) + ': ' + tup[1] + '\n'
return output_string
| class Document:
class Info:
def __init__(self):
self.author = 'unknown'
self.producer = 'unknown'
self.subject = 'unknown'
self.title = 'unknown'
self.table_of_contents = []
def __init__(self, path: str, is_pdf: bool):
self.is_pdf = is_pdf
self.info = Document.Info()
self.path = path
self.ocr_path = path
self.num_pages = None
self.images = []
self.tables = []
self.paragraphs = []
self.extractable = False
self.filename = None
def document_info_to_string(self):
return 'Author: ' + self.info.author + '\n' + 'Producer: ' + self.info.producer + '\n' + 'Subject: ' + self.info.subject + '\n' + 'Title: ' + self.info.title + '\n' + 'Number of Pages: ' + str(self.num_pages)
def table_of_contents_to_string(self):
output_string = ''
for tup in self.info.table_of_contents:
output_string += str(tup[0]) + ': ' + tup[1] + '\n'
return output_string |
class Solution:
def removeElement(self, nums: [int], val: int) -> int:
i = 0
j = len(nums)
while i < j:
if nums[i] == val:
nums[i] = nums[j - 1]
j -= 1
else:
i += 1
return i
| class Solution:
def remove_element(self, nums: [int], val: int) -> int:
i = 0
j = len(nums)
while i < j:
if nums[i] == val:
nums[i] = nums[j - 1]
j -= 1
else:
i += 1
return i |
class Solution:
def findItinerary(self, tickets: List[List[str]]) -> List[str]:
def dfs(graph, u, res):
while(len(graph[u])):
dfs(graph, graph[u].pop(), res)
res.append(u)
graph = defaultdict(list)
res = []
for ticket in tickets:
graph[ticket[0]].append(ticket[1])
for k in graph:
graph[k].sort(reverse=True)
u = "JFK"
dfs(graph, u, res)
res.reverse()
return res
| class Solution:
def find_itinerary(self, tickets: List[List[str]]) -> List[str]:
def dfs(graph, u, res):
while len(graph[u]):
dfs(graph, graph[u].pop(), res)
res.append(u)
graph = defaultdict(list)
res = []
for ticket in tickets:
graph[ticket[0]].append(ticket[1])
for k in graph:
graph[k].sort(reverse=True)
u = 'JFK'
dfs(graph, u, res)
res.reverse()
return res |
SKULLTAG_FREQS = [
0.14473691, 0.01147017, 0.00167522, 0.03831121, 0.00356579, 0.03811315,
0.00178254, 0.00199644, 0.00183511, 0.00225716, 0.00211240, 0.00308829,
0.00172852, 0.00186608, 0.00215921, 0.00168891, 0.00168603, 0.00218586,
0.00284414, 0.00161833, 0.00196043, 0.00151029, 0.00173932, 0.00218370,
0.00934121, 0.00220530, 0.00381211, 0.00185456, 0.00194675, 0.00161977,
0.00186680, 0.00182071, 0.06421956, 0.00537786, 0.00514019, 0.00487155,
0.00493925, 0.00503143, 0.00514019, 0.00453520, 0.00454241, 0.00485642,
0.00422407, 0.00593387, 0.00458130, 0.00343687, 0.00342823, 0.00531592,
0.00324890, 0.00333388, 0.00308613, 0.00293776, 0.00258918, 0.00259278,
0.00377105, 0.00267488, 0.00227516, 0.00415997, 0.00248763, 0.00301555,
0.00220962, 0.00206990, 0.00270369, 0.00231694, 0.00273826, 0.00450928,
0.00384380, 0.00504728, 0.00221251, 0.00376961, 0.00232990, 0.00312574,
0.00291688, 0.00280236, 0.00252436, 0.00229461, 0.00294353, 0.00241201,
0.00366590, 0.00199860, 0.00257838, 0.00225860, 0.00260646, 0.00187256,
0.00266552, 0.00242641, 0.00219450, 0.00192082, 0.00182071, 0.02185930,
0.00157439, 0.00164353, 0.00161401, 0.00187544, 0.00186248, 0.03338637,
0.00186968, 0.00172132, 0.00148509, 0.00177749, 0.00144620, 0.00192442,
0.00169683, 0.00209439, 0.00209439, 0.00259062, 0.00194531, 0.00182359,
0.00159096, 0.00145196, 0.00128199, 0.00158376, 0.00171412, 0.00243433,
0.00345704, 0.00156359, 0.00145700, 0.00157007, 0.00232342, 0.00154198,
0.00140730, 0.00288807, 0.00152830, 0.00151246, 0.00250203, 0.00224420,
0.00161761, 0.00714383, 0.08188576, 0.00802537, 0.00119484, 0.00123805,
0.05632671, 0.00305156, 0.00105584, 0.00105368, 0.00099246, 0.00090459,
0.00109473, 0.00115379, 0.00261223, 0.00105656, 0.00124381, 0.00100326,
0.00127550, 0.00089739, 0.00162481, 0.00100830, 0.00097229, 0.00078864,
0.00107240, 0.00084409, 0.00265760, 0.00116891, 0.00073102, 0.00075695,
0.00093916, 0.00106880, 0.00086786, 0.00185600, 0.00608367, 0.00133600,
0.00075695, 0.00122077, 0.00566955, 0.00108249, 0.00259638, 0.00077063,
0.00166586, 0.00090387, 0.00087074, 0.00084914, 0.00130935, 0.00162409,
0.00085922, 0.00093340, 0.00093844, 0.00087722, 0.00108249, 0.00098598,
0.00095933, 0.00427593, 0.00496661, 0.00102775, 0.00159312, 0.00118404,
0.00114947, 0.00104936, 0.00154342, 0.00140082, 0.00115883, 0.00110769,
0.00161112, 0.00169107, 0.00107816, 0.00142747, 0.00279804, 0.00085922,
0.00116315, 0.00119484, 0.00128559, 0.00146204, 0.00130215, 0.00101551,
0.00091756, 0.00161184, 0.00236375, 0.00131872, 0.00214120, 0.00088875,
0.00138570, 0.00211960, 0.00094060, 0.00088083, 0.00094564, 0.00090243,
0.00106160, 0.00088659, 0.00114514, 0.00095861, 0.00108753, 0.00124165,
0.00427016, 0.00159384, 0.00170547, 0.00104431, 0.00091395, 0.00095789,
0.00134681, 0.00095213, 0.00105944, 0.00094132, 0.00141883, 0.00102127,
0.00101911, 0.00082105, 0.00158448, 0.00102631, 0.00087938, 0.00139290,
0.00114658, 0.00095501, 0.00161329, 0.00126542, 0.00113218, 0.00123661,
0.00101695, 0.00112930, 0.00317976, 0.00085346, 0.00101190, 0.00189849,
0.00105728, 0.00186824, 0.00092908, 0.00160896,
]
class HuffmanObject(object):
def __init__(self, freqs):
self.huffman_freqs = freqs
self.huffman_tree = []
self.huffman_table = [None] * 256
self.__build_binary_tree()
self.__binary_tree_to_lookup_table(self.huffman_tree)
def __build_binary_tree(self):
"""
Create the huffman tree from frequency list found in the
current object.
"""
# Create starting leaves
for i in range(256):
self.huffman_tree.append({
'frq': self.huffman_freqs[i],
'asc': i,
})
# Pair leaves and branches based on frequency until there is a
# single root
for i in range(255):
lowest_key1 = -1
lowest_key2 = -1
lowest_frq1 = 1e30
lowest_frq2 = 1e30
# Find two lowest frequencies
for j in range(256):
if not self.huffman_tree[j]:
continue
if self.huffman_tree[j]['frq'] < lowest_frq1:
lowest_key2 = lowest_key1
lowest_frq2 = lowest_frq1
lowest_key1 = j
lowest_frq1 = self.huffman_tree[j]['frq']
elif self.huffman_tree[j]['frq'] < lowest_frq2:
lowest_key2 = j
lowest_frq2 = self.huffman_tree[j]['frq']
# Join the two together under a new branch
self.huffman_tree[lowest_key1] = {
'frq': lowest_frq1 + lowest_frq2,
'0': self.huffman_tree[lowest_key2],
'1': self.huffman_tree[lowest_key1],
}
self.huffman_tree[lowest_key2] = None
# Make the root the list
self.huffman_tree = self.huffman_tree[lowest_key1]
def __binary_tree_to_lookup_table(self, branch, binary_path = ''):
"""
Recursively create the lookup table used to encode a message.
"""
# Go through a branch finding leaves while tracking the path taken
if '0' in branch:
self.__binary_tree_to_lookup_table(branch['0'], binary_path + '0')
self.__binary_tree_to_lookup_table(branch['1'], binary_path + '1')
else:
self.huffman_table[branch['asc']] = binary_path
def encode(self, data_string):
"""
Encode a string into a huffman-coded string.
"""
if type(data_string) is not bytes:
raise ValueError('Must pass bytes to encode')
binary_string = ''
# Match ASCII to entries in the lookup table
for byte in data_string:
binary_string += self.huffman_table[byte]
# Convert binary string into ASCII
encoded_string = b'';
for i in range(0, len(binary_string), 8):
binary = binary_string[i:i+8]
encoded_string += bytes([int(binary[::-1], 2)])
# If the huffman-coded string is longer than the original
# string, return the original string instead. Putting an
# ASCII value 0xff where the padding bit should be signals to
# the decoder that the message is not encoded.
if len(data_string) <= len(encoded_string):
return b'\xff' + data_string
# In the first byte, store the number of padding bits
padding_value = (8 - (len(binary_string) % 8)) % 8
encoded_string = bytes([padding_value]) + encoded_string
return encoded_string
def decode(self, data_string):
"""
Decode a huffman-coded string into a string.
"""
if type(data_string) is not bytes:
raise ValueError('Must pass bytes to decode')
# Obtain and remove the number of padding bits stored in the
# first byte.
padding_length = data_string[0]
data_string = data_string[1:]
# If the padding bit is set to 0xff the message is not encoded.
if padding_length == 0xff:
return data_string
# Convert ascii string into binary string
binary_string = ''
for byte in data_string:
binary_string += '{0:08b}'.format(byte)[::-1]
# Remove padding bits from the end
binary_string = binary_string[:len(binary_string) - padding_length]
# Match binary to entries in the huffman tree
decoded_string = b'';
tree_node = self.huffman_tree
for bit in binary_string:
if bit in tree_node:
tree_node = tree_node[bit]
else:
decoded_string += bytes([tree_node['asc']])
tree_node = self.huffman_tree[bit]
decoded_string += bytes([tree_node['asc']])
return decoded_string
| skulltag_freqs = [0.14473691, 0.01147017, 0.00167522, 0.03831121, 0.00356579, 0.03811315, 0.00178254, 0.00199644, 0.00183511, 0.00225716, 0.0021124, 0.00308829, 0.00172852, 0.00186608, 0.00215921, 0.00168891, 0.00168603, 0.00218586, 0.00284414, 0.00161833, 0.00196043, 0.00151029, 0.00173932, 0.0021837, 0.00934121, 0.0022053, 0.00381211, 0.00185456, 0.00194675, 0.00161977, 0.0018668, 0.00182071, 0.06421956, 0.00537786, 0.00514019, 0.00487155, 0.00493925, 0.00503143, 0.00514019, 0.0045352, 0.00454241, 0.00485642, 0.00422407, 0.00593387, 0.0045813, 0.00343687, 0.00342823, 0.00531592, 0.0032489, 0.00333388, 0.00308613, 0.00293776, 0.00258918, 0.00259278, 0.00377105, 0.00267488, 0.00227516, 0.00415997, 0.00248763, 0.00301555, 0.00220962, 0.0020699, 0.00270369, 0.00231694, 0.00273826, 0.00450928, 0.0038438, 0.00504728, 0.00221251, 0.00376961, 0.0023299, 0.00312574, 0.00291688, 0.00280236, 0.00252436, 0.00229461, 0.00294353, 0.00241201, 0.0036659, 0.0019986, 0.00257838, 0.0022586, 0.00260646, 0.00187256, 0.00266552, 0.00242641, 0.0021945, 0.00192082, 0.00182071, 0.0218593, 0.00157439, 0.00164353, 0.00161401, 0.00187544, 0.00186248, 0.03338637, 0.00186968, 0.00172132, 0.00148509, 0.00177749, 0.0014462, 0.00192442, 0.00169683, 0.00209439, 0.00209439, 0.00259062, 0.00194531, 0.00182359, 0.00159096, 0.00145196, 0.00128199, 0.00158376, 0.00171412, 0.00243433, 0.00345704, 0.00156359, 0.001457, 0.00157007, 0.00232342, 0.00154198, 0.0014073, 0.00288807, 0.0015283, 0.00151246, 0.00250203, 0.0022442, 0.00161761, 0.00714383, 0.08188576, 0.00802537, 0.00119484, 0.00123805, 0.05632671, 0.00305156, 0.00105584, 0.00105368, 0.00099246, 0.00090459, 0.00109473, 0.00115379, 0.00261223, 0.00105656, 0.00124381, 0.00100326, 0.0012755, 0.00089739, 0.00162481, 0.0010083, 0.00097229, 0.00078864, 0.0010724, 0.00084409, 0.0026576, 0.00116891, 0.00073102, 0.00075695, 0.00093916, 0.0010688, 0.00086786, 0.001856, 0.00608367, 0.001336, 0.00075695, 0.00122077, 0.00566955, 0.00108249, 0.00259638, 0.00077063, 0.00166586, 0.00090387, 0.00087074, 0.00084914, 0.00130935, 0.00162409, 0.00085922, 0.0009334, 0.00093844, 0.00087722, 0.00108249, 0.00098598, 0.00095933, 0.00427593, 0.00496661, 0.00102775, 0.00159312, 0.00118404, 0.00114947, 0.00104936, 0.00154342, 0.00140082, 0.00115883, 0.00110769, 0.00161112, 0.00169107, 0.00107816, 0.00142747, 0.00279804, 0.00085922, 0.00116315, 0.00119484, 0.00128559, 0.00146204, 0.00130215, 0.00101551, 0.00091756, 0.00161184, 0.00236375, 0.00131872, 0.0021412, 0.00088875, 0.0013857, 0.0021196, 0.0009406, 0.00088083, 0.00094564, 0.00090243, 0.0010616, 0.00088659, 0.00114514, 0.00095861, 0.00108753, 0.00124165, 0.00427016, 0.00159384, 0.00170547, 0.00104431, 0.00091395, 0.00095789, 0.00134681, 0.00095213, 0.00105944, 0.00094132, 0.00141883, 0.00102127, 0.00101911, 0.00082105, 0.00158448, 0.00102631, 0.00087938, 0.0013929, 0.00114658, 0.00095501, 0.00161329, 0.00126542, 0.00113218, 0.00123661, 0.00101695, 0.0011293, 0.00317976, 0.00085346, 0.0010119, 0.00189849, 0.00105728, 0.00186824, 0.00092908, 0.00160896]
class Huffmanobject(object):
def __init__(self, freqs):
self.huffman_freqs = freqs
self.huffman_tree = []
self.huffman_table = [None] * 256
self.__build_binary_tree()
self.__binary_tree_to_lookup_table(self.huffman_tree)
def __build_binary_tree(self):
"""
Create the huffman tree from frequency list found in the
current object.
"""
for i in range(256):
self.huffman_tree.append({'frq': self.huffman_freqs[i], 'asc': i})
for i in range(255):
lowest_key1 = -1
lowest_key2 = -1
lowest_frq1 = 1e+30
lowest_frq2 = 1e+30
for j in range(256):
if not self.huffman_tree[j]:
continue
if self.huffman_tree[j]['frq'] < lowest_frq1:
lowest_key2 = lowest_key1
lowest_frq2 = lowest_frq1
lowest_key1 = j
lowest_frq1 = self.huffman_tree[j]['frq']
elif self.huffman_tree[j]['frq'] < lowest_frq2:
lowest_key2 = j
lowest_frq2 = self.huffman_tree[j]['frq']
self.huffman_tree[lowest_key1] = {'frq': lowest_frq1 + lowest_frq2, '0': self.huffman_tree[lowest_key2], '1': self.huffman_tree[lowest_key1]}
self.huffman_tree[lowest_key2] = None
self.huffman_tree = self.huffman_tree[lowest_key1]
def __binary_tree_to_lookup_table(self, branch, binary_path=''):
"""
Recursively create the lookup table used to encode a message.
"""
if '0' in branch:
self.__binary_tree_to_lookup_table(branch['0'], binary_path + '0')
self.__binary_tree_to_lookup_table(branch['1'], binary_path + '1')
else:
self.huffman_table[branch['asc']] = binary_path
def encode(self, data_string):
"""
Encode a string into a huffman-coded string.
"""
if type(data_string) is not bytes:
raise value_error('Must pass bytes to encode')
binary_string = ''
for byte in data_string:
binary_string += self.huffman_table[byte]
encoded_string = b''
for i in range(0, len(binary_string), 8):
binary = binary_string[i:i + 8]
encoded_string += bytes([int(binary[::-1], 2)])
if len(data_string) <= len(encoded_string):
return b'\xff' + data_string
padding_value = (8 - len(binary_string) % 8) % 8
encoded_string = bytes([padding_value]) + encoded_string
return encoded_string
def decode(self, data_string):
"""
Decode a huffman-coded string into a string.
"""
if type(data_string) is not bytes:
raise value_error('Must pass bytes to decode')
padding_length = data_string[0]
data_string = data_string[1:]
if padding_length == 255:
return data_string
binary_string = ''
for byte in data_string:
binary_string += '{0:08b}'.format(byte)[::-1]
binary_string = binary_string[:len(binary_string) - padding_length]
decoded_string = b''
tree_node = self.huffman_tree
for bit in binary_string:
if bit in tree_node:
tree_node = tree_node[bit]
else:
decoded_string += bytes([tree_node['asc']])
tree_node = self.huffman_tree[bit]
decoded_string += bytes([tree_node['asc']])
return decoded_string |
'''
Description:
X is a good number if after rotating each digit individually by 180 degrees, we get a valid number that is different from X. Each digit must be rotated - we cannot choose to leave it alone.
A number is valid if each digit remains a digit after rotation. 0, 1, and 8 rotate to themselves; 2 and 5 rotate to each other; 6 and 9 rotate to each other, and the rest of the numbers do not rotate to any other number and become invalid.
Now given a positive number N, how many numbers X from 1 to N are good?
Example:
Input: 10
Output: 4
Explanation:
There are four good numbers in the range [1, 10] : 2, 5, 6, 9.
Note that 1 and 10 are not good numbers, since they remain unchanged after rotating.
Note:
N will be in range [1, 10000].
'''
class Solution:
def rotatedDigits(self, N: int) -> int:
counter = 0
for i in range(1, N+1):
# convert number i to digit character array
str_num_list = list( str(i) )
# flag for good number judgement
is_good_number = False
for digit in str_num_list:
if digit in {'3','4','7'}:
# invalid number after rotation
is_good_number = False
break
elif digit in {'2','5','6','9'}:
is_good_number = True
if is_good_number:
# update conter for good number
counter += 1
return counter
# n : input value of N
## Time Complexity: O( n log n )
#
# The overhead in time is the outer for loop and inner for loop.
# The outer for loop, iterating on i, takes O( n )
# The inner for loop, iterating on digit, takes O( log n )
# It takes O( n log n ) in total
## Space Complexity: O( log n )
#
# The overhead in space is the storage for buffer, str_num_list, which is of O( log n )
def test_bench():
test_data = [10,20,30,50,100]
# expected output:
'''
4
9
15
16
40
'''
for n in test_data:
print( Solution().rotatedDigits(n) )
return
if __name__ == '__main__':
test_bench() | """
Description:
X is a good number if after rotating each digit individually by 180 degrees, we get a valid number that is different from X. Each digit must be rotated - we cannot choose to leave it alone.
A number is valid if each digit remains a digit after rotation. 0, 1, and 8 rotate to themselves; 2 and 5 rotate to each other; 6 and 9 rotate to each other, and the rest of the numbers do not rotate to any other number and become invalid.
Now given a positive number N, how many numbers X from 1 to N are good?
Example:
Input: 10
Output: 4
Explanation:
There are four good numbers in the range [1, 10] : 2, 5, 6, 9.
Note that 1 and 10 are not good numbers, since they remain unchanged after rotating.
Note:
N will be in range [1, 10000].
"""
class Solution:
def rotated_digits(self, N: int) -> int:
counter = 0
for i in range(1, N + 1):
str_num_list = list(str(i))
is_good_number = False
for digit in str_num_list:
if digit in {'3', '4', '7'}:
is_good_number = False
break
elif digit in {'2', '5', '6', '9'}:
is_good_number = True
if is_good_number:
counter += 1
return counter
def test_bench():
test_data = [10, 20, 30, 50, 100]
'\n 4\n 9\n 15\n 16\n 40\n '
for n in test_data:
print(solution().rotatedDigits(n))
return
if __name__ == '__main__':
test_bench() |
# Python - 2.7.6
Test.describe('Basic tests')
Test.assert_equals(logical_calc([True, False], 'AND'), False)
Test.assert_equals(logical_calc([True, False], 'OR'), True)
Test.assert_equals(logical_calc([True, False], 'XOR'), True)
Test.assert_equals(logical_calc([True, True, False], 'AND'), False)
Test.assert_equals(logical_calc([True, True, False], 'OR'), True)
Test.assert_equals(logical_calc([True, True, False], 'XOR'), False)
| Test.describe('Basic tests')
Test.assert_equals(logical_calc([True, False], 'AND'), False)
Test.assert_equals(logical_calc([True, False], 'OR'), True)
Test.assert_equals(logical_calc([True, False], 'XOR'), True)
Test.assert_equals(logical_calc([True, True, False], 'AND'), False)
Test.assert_equals(logical_calc([True, True, False], 'OR'), True)
Test.assert_equals(logical_calc([True, True, False], 'XOR'), False) |
# -*- coding: utf-8 -*-
class INITIALIZE(object):
def __init__(self, ALPHANUMERIC=' ', NUMERIC=0):
self.alphanumeric = ALPHANUMERIC
self.numeric = NUMERIC
def __call__(self, obj):
self.initialize(obj)
def initialize(self, obj):
if isinstance(obj, dict):
for k, v in obj.items():
if isinstance(v, dict):
self.initialize(obj[k])
elif isinstance(v, list):
for l in v:
self.initialize(l)
elif k.startswith('FILLER'):
continue
elif isinstance(v, str):
obj[k] = self.alphanumeric
elif isinstance(v, int):
obj[k] = self.numeric
elif isinstance(v, float):
obj[k] = float(self.numeric)
elif isinstance(obj, list):
for l in obj:
self.initialize(l)
| class Initialize(object):
def __init__(self, ALPHANUMERIC=' ', NUMERIC=0):
self.alphanumeric = ALPHANUMERIC
self.numeric = NUMERIC
def __call__(self, obj):
self.initialize(obj)
def initialize(self, obj):
if isinstance(obj, dict):
for (k, v) in obj.items():
if isinstance(v, dict):
self.initialize(obj[k])
elif isinstance(v, list):
for l in v:
self.initialize(l)
elif k.startswith('FILLER'):
continue
elif isinstance(v, str):
obj[k] = self.alphanumeric
elif isinstance(v, int):
obj[k] = self.numeric
elif isinstance(v, float):
obj[k] = float(self.numeric)
elif isinstance(obj, list):
for l in obj:
self.initialize(l) |
class User:
userdetail = ["layersony","Samuel", "Maingi", "0796727706", "sm@gmail.com", "123456", '123456']
"""
class for register user have to firstname, lastname, phonenumber, email, password, confirm password
"""
def __init__(self, username ,first_name, last_name, phone_number, email, password, con_pass):
'''
initialize the class user when called
'''
self.username = username
self.first_name = first_name
self.last_name = last_name
self.phone_number = phone_number
self.email = email
self.password = password
self.con_pass = con_pass
@classmethod
def checkUserExist(cls, usrname, password):
'''
this method checks the username and password provided by user input if it exists in the file or not
'''
with open("userlocker.txt", "r") as handle:
data = handle.read()
fulldata = data.split("|")
if usrname == fulldata[0] and password == fulldata[-1]:
return True
else:
return False
def saveUser(inputtype, mood):
'''
method to save data that is provide by user during registration
'''
with open("userlocker.txt", mood) as handle:
handle.write(inputtype)
| class User:
userdetail = ['layersony', 'Samuel', 'Maingi', '0796727706', 'sm@gmail.com', '123456', '123456']
'\n class for register user have to firstname, lastname, phonenumber, email, password, confirm password\n '
def __init__(self, username, first_name, last_name, phone_number, email, password, con_pass):
"""
initialize the class user when called
"""
self.username = username
self.first_name = first_name
self.last_name = last_name
self.phone_number = phone_number
self.email = email
self.password = password
self.con_pass = con_pass
@classmethod
def check_user_exist(cls, usrname, password):
"""
this method checks the username and password provided by user input if it exists in the file or not
"""
with open('userlocker.txt', 'r') as handle:
data = handle.read()
fulldata = data.split('|')
if usrname == fulldata[0] and password == fulldata[-1]:
return True
else:
return False
def save_user(inputtype, mood):
"""
method to save data that is provide by user during registration
"""
with open('userlocker.txt', mood) as handle:
handle.write(inputtype) |
class Config:
SECRET_KEY = 'hard to guess string'
SQLALCHEMY_COMMIT_ON_TEARDOWN = True
MAIL_SERVER = 'smtp.qq.com'
MAIL_PORT = 465
MAIL_USE_TLS = False
MAIL_USE_SSL = True
MAIL_USERNAME = '536700549@qq.com'
MAIL_PASSWORD = 'mystery123.'
FLASKY_MAIL_SUBJECT_PREFIX = '[Flasky]'
FLASKY_MAIL_SENDER = '536700549@qq.com'
FLASKY_ADMIN = '536700549@qq.com'
FLASKY_POSTS_PER_PAGE = 20
FLASKY_FOLLOWERS_PER_PAGE = 50
FLASKY_COMMENTS_PER_PAGE = 30
@staticmethod
def init_app(app):
pass
class DevelopmentConfig(Config):
DEBUG = True
SQLALCHEMY_DATABASE_URI = 'mysql://root:root@localhost/finaldev'
class TestingConfig(Config):
TESTING = True
SQLALCHEMY_DATABASE_URI = 'mysql://root:root@localhost/finaltest'
class ProductionConfig(Config):
SQLALCHEMY_DATABASE_URI = 'mysql://root:root@localhost/finalpro'
config = {
'development': DevelopmentConfig,
'testing': TestingConfig,
'production': ProductionConfig,
'default': DevelopmentConfig
} | class Config:
secret_key = 'hard to guess string'
sqlalchemy_commit_on_teardown = True
mail_server = 'smtp.qq.com'
mail_port = 465
mail_use_tls = False
mail_use_ssl = True
mail_username = '536700549@qq.com'
mail_password = 'mystery123.'
flasky_mail_subject_prefix = '[Flasky]'
flasky_mail_sender = '536700549@qq.com'
flasky_admin = '536700549@qq.com'
flasky_posts_per_page = 20
flasky_followers_per_page = 50
flasky_comments_per_page = 30
@staticmethod
def init_app(app):
pass
class Developmentconfig(Config):
debug = True
sqlalchemy_database_uri = 'mysql://root:root@localhost/finaldev'
class Testingconfig(Config):
testing = True
sqlalchemy_database_uri = 'mysql://root:root@localhost/finaltest'
class Productionconfig(Config):
sqlalchemy_database_uri = 'mysql://root:root@localhost/finalpro'
config = {'development': DevelopmentConfig, 'testing': TestingConfig, 'production': ProductionConfig, 'default': DevelopmentConfig} |
"""
This script learns about escape characters.
Even more practice on the document string
"""
SPLIT_STRING = "This string has been \nsplit over\nseveral\nlines"
print(SPLIT_STRING)
TABBED_STRING = "1\t2\t3\t4\t5"
print(TABBED_STRING)
print('The pet shop owner said "No, no, \'e\'s uh,...he\'s resting".')
# or
print("The pet shop owner said \"No, no, 'e's uh,...he's resting\".")
print("""The pet shop owner said "No, no, \
'e's uh,...he's resting". """)
ANOTHER_SPLIT_STRING = """This string has been \
split over \
several \
lines"""
print(ANOTHER_SPLIT_STRING)
print("C:\\Users\\tjgyy\\notes.txt")
print(r"C:\Users\jgyy\notes.txt")
| """
This script learns about escape characters.
Even more practice on the document string
"""
split_string = 'This string has been \nsplit over\nseveral\nlines'
print(SPLIT_STRING)
tabbed_string = '1\t2\t3\t4\t5'
print(TABBED_STRING)
print('The pet shop owner said "No, no, \'e\'s uh,...he\'s resting".')
print('The pet shop owner said "No, no, \'e\'s uh,...he\'s resting".')
print('The pet shop owner said "No, no, \'e\'s uh,...he\'s resting". ')
another_split_string = 'This string has been split over several lines'
print(ANOTHER_SPLIT_STRING)
print('C:\\Users\\tjgyy\\notes.txt')
print('C:\\Users\\jgyy\\notes.txt') |
n = int(input())
lst = [float('inf') for _ in range(n+1)]
lst[1] = 0
for i in range(1,n):
if 3*i<=n:lst[3*i]=min(lst[3*i],lst[i]+1)
if 2*i<=n:lst[2*i]=min(lst[2*i],lst[i]+1)
lst[i+1]=min(lst[i+1],lst[i]+1)
print(lst[n])
| n = int(input())
lst = [float('inf') for _ in range(n + 1)]
lst[1] = 0
for i in range(1, n):
if 3 * i <= n:
lst[3 * i] = min(lst[3 * i], lst[i] + 1)
if 2 * i <= n:
lst[2 * i] = min(lst[2 * i], lst[i] + 1)
lst[i + 1] = min(lst[i + 1], lst[i] + 1)
print(lst[n]) |
Till=int(input("Enter the upper limit\n"))
From=int(input("Enter the lower limit\n"))
i=1
print("\n")
while(From<=Till):
if((From%4==0)and(From%100!=0))or(From%400==0):
print(From)
From+=1
input()
| till = int(input('Enter the upper limit\n'))
from = int(input('Enter the lower limit\n'))
i = 1
print('\n')
while From <= Till:
if From % 4 == 0 and From % 100 != 0 or From % 400 == 0:
print(From)
from += 1
input() |
class BaseKeyMap():
"""docstring for BaseKeyMap."""
def __init__(self, arg):
self.arg = arg
| class Basekeymap:
"""docstring for BaseKeyMap."""
def __init__(self, arg):
self.arg = arg |
class Square:
piece = None
promoting = False
def __init__(self, promoting=False):
self.promoting = promoting
def set_piece(self, piece):
self.piece = piece
def remove_piece(self):
self.piece = None
def get_piece(self):
return self.piece
def is_empty(self):
return self.piece is None
def is_promoting(self):
return self.promoting
def to_string(self):
return self.piece.to_string() if self.piece is not None else ' '
| class Square:
piece = None
promoting = False
def __init__(self, promoting=False):
self.promoting = promoting
def set_piece(self, piece):
self.piece = piece
def remove_piece(self):
self.piece = None
def get_piece(self):
return self.piece
def is_empty(self):
return self.piece is None
def is_promoting(self):
return self.promoting
def to_string(self):
return self.piece.to_string() if self.piece is not None else ' ' |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.