content
stringlengths
7
1.05M
fixed_cases
stringlengths
1
1.28M
description = 'GE detector setup PV values' group = 'configdata' EIGHT_PACKS = [ # ('ep01', 'GE-DD590C-EP'), # replaced 2015/10/29 ('ep01', 'GE-DD6D8C-EP'), ('ep02', 'GE-DD5FB3-EP'), ('ep03', 'GE-DDA871-EP'), ('ep04', 'GE-DD7D29-EP'), ('ep05', 'GE-DDBA8F-EP'), ('ep06', 'GE-DD5913-EP'), ('ep07', 'GE-DDC7CA-EP'), ('ep08', 'GE-DD6DEF-EP'), ('ep09', 'GE-DD5FB6-EP'), ('ep10', 'GE-DDBA88-EP'), # ('ep11', 'GE-DD6AE9-EP'), # ('ep11', 'GE-DD6D79-EP'), # was spare ('ep11', 'GE-DD9522-EP'), # changed 2015/09/23 ('ep12', 'GE-DD6D89-EP'), ('ep13', 'GE-DD6D96-EP'), ('ep14', 'GE-DD6974-EP'), ('ep15', 'GE-DD5FA9-EP'), ('ep16', 'GE-DDA874-EP'), ('ep17', 'GE-DD6975-EP'), ('ep18', 'GE-DD5916-EP'), ] HV_VALUES = {n[0]: 1530 for n in EIGHT_PACKS} # -- To set different HVs for some 8-packs: # HV_VALUES['ep01'] = 0 # HV_VALUES['ep18'] = 0 PV_SCALES = { 'ep01': [('AScales', [2077, 2033, 2127, 2137, 2095, 2130, 2149, 2123]), ('Scales', [2102, 2114, 2118, 2088, 2088, 2076, 2107, 2124])], 'ep02': [('AScales', [2089, 2148, 2095, 2090, 2088, 2147, 2107, 2098]), ('Scales', [2069, 2099, 2061, 2100, 2104, 2090, 2101, 2087])], 'ep03': [('AScales', [2105, 2084, 2112, 2107, 2183, 2050, 2084, 2102]), ('Scales', [2093, 2125, 2086, 2112, 2101, 2097, 2102, 2111])], 'ep04': [('AScales', [2060, 2036, 2055, 2063, 2060, 2071, 2067, 2083]), ('Scales', [2006, 1991, 1996, 2003, 2011, 2002, 1996, 1999])], 'ep05': [('AScales', [2016, 2064, 2037, 2083, 2062, 2023, 2078, 2083]), ('Scales', [2009, 1997, 1973, 2020, 1989, 2038, 2010, 2010])], 'ep06': [('AScales', [2026, 2048, 2087, 2059, 2040, 2050, 2073, 2037]), ('Scales', [2007, 2005, 2011, 2009, 2010, 1990, 2002, 2010])], 'ep07': [('AScales', [2041, 2037, 1999, 1996, 2031, 2013, 1982, 2063]), ('Scales', [1982, 2021, 1993, 1984, 1987, 1961, 1986, 1964])], 'ep08': [('AScales', [2055, 2074, 2039, 2032, 2068, 2070, 2054, 2100]), ('Scales', [2010, 1999, 1987, 2009, 1986, 2005, 1984, 2005])], 'ep09': [('AScales', [2031, 2065, 2005, 2088, 2048, 2048, 2035, 2009]), ('Scales', [2001, 1999, 1984, 2018, 1979, 1992, 1986, 1977])], 'ep10': [('AScales', [2050, 2022, 2040, 2082, 2059, 2030, 2033, 2055]), ('Scales', [1978, 2030, 1978, 1980, 1997, 2016, 1982, 1991])], 'ep11': [('AScales', [2035, 2024, 2042, 2014, 2024, 2005, 2063, 2037]), ('Scales', [1996, 2018, 1996, 1975, 1966, 1963, 2035, 2016])], 'ep12': [('AScales', [2063, 2079, 2042, 2049, 2053, 2055, 2050, 2063]), ('Scales', [1990, 2020, 2003, 2002, 1978, 1988, 2015, 1975])], 'ep13': [('AScales', [2072, 2095, 2092, 2104, 2083, 2077, 2036, 2092]), ('Scales', [2018, 2013, 2004, 2013, 2007, 2002, 2027, 2004])], 'ep15': [('AScales', [2078, 2060, 2063, 2091, 2050, 2053, 2071, 2061]), ('Scales', [2014, 2000, 2017, 1998, 1989, 1996, 2002, 2030])], 'ep14': [('AScales', [2070, 2078, 2055, 2026, 2075, 2053, 2072, 2073]), ('Scales', [2011, 2002, 2009, 1990, 1998, 1963, 2015, 1986])], 'ep16': [('AScales', [2196, 2085, 2053, 2161, 2168, 2127, 2155, 2185]), ('Scales', [2087, 2079, 2090, 2113, 2100, 2085, 2082, 2086])], 'ep17': [('AScales', [2144, 2188, 2168, 2153, 2192, 2148, 2178, 2205]), ('Scales', [2105, 2070, 2098, 2109, 2111, 2099, 2103, 2090])], 'ep18': [('AScales', [2178, 2134, 2149, 2053, 2142, 2191, 2154, 2115]), ('Scales', [2125, 2118, 2110, 2154, 2113, 2132, 2102, 2099])], } # -- For recalibration, set everything to defaults: # PV_SCALES = { # 'ep%02d' % i: [('AScales', [2048]*8), ('Scales', [2048]*8)] for i in range(1, 19) # } # event modes MODE = 0x03 MODE_DIAG = 0x06 MODE_FAKE = 0x23 MODE_FAKEDIAG = 0x26 PV_VALUES_COMMON = [ ('Mode', MODE), ('DecimationFactor', 1), ('DiscriminatorLevel', 1024), ('NegativeVeto', -16384), ('PositiveVeto', 16383), ('Sample1', 10), ('BScales', [2048, 2048, 2048, 2048, 2048, 2048, 2048, 2048]), ('TubeEnables', [1, 1, 1, 1, 1, 1, 1, 1]), ('AccumulationLength', 60), ('WaveformCaptureLength', 1015), ] # pixel per tube PPT_S = 94 PPT_M = 206 PPT_L = 256 # -- For recalibration, set to max. pixel resolution: # PPT_S = 1024 # PPT_M = 1024 # PPT_L = 1024 PV_VALUES_SINGLE = { 'ep01': [('ModulePixelIdStart', 0*8192), ('PixelCount', PPT_S)], 'ep02': [('ModulePixelIdStart', 1*8192), ('PixelCount', PPT_S)], 'ep03': [('ModulePixelIdStart', 2*8192), ('PixelCount', PPT_S)], 'ep04': [('ModulePixelIdStart', 3*8192), ('PixelCount', PPT_M)], 'ep05': [('ModulePixelIdStart', 4*8192), ('PixelCount', PPT_M)], 'ep06': [('ModulePixelIdStart', 5*8192), ('PixelCount', PPT_M)], 'ep07': [('ModulePixelIdStart', 6*8192), ('PixelCount', PPT_L)], 'ep08': [('ModulePixelIdStart', 7*8192), ('PixelCount', PPT_L)], 'ep09': [('ModulePixelIdStart', 8*8192), ('PixelCount', PPT_L)], 'ep10': [('ModulePixelIdStart', 9*8192), ('PixelCount', PPT_L)], 'ep11': [('ModulePixelIdStart', 10*8192), ('PixelCount', PPT_L)], 'ep12': [('ModulePixelIdStart', 11*8192), ('PixelCount', PPT_L)], 'ep13': [('ModulePixelIdStart', 12*8192), ('PixelCount', PPT_M)], 'ep14': [('ModulePixelIdStart', 14*8192), ('PixelCount', PPT_M)], 'ep15': [('ModulePixelIdStart', 13*8192), ('PixelCount', PPT_M)], 'ep16': [('ModulePixelIdStart', 15*8192), ('PixelCount', PPT_S)], 'ep17': [('ModulePixelIdStart', 16*8192), ('PixelCount', PPT_S)], 'ep18': [('ModulePixelIdStart', 17*8192), ('PixelCount', PPT_S)], }
description = 'GE detector setup PV values' group = 'configdata' eight_packs = [('ep01', 'GE-DD6D8C-EP'), ('ep02', 'GE-DD5FB3-EP'), ('ep03', 'GE-DDA871-EP'), ('ep04', 'GE-DD7D29-EP'), ('ep05', 'GE-DDBA8F-EP'), ('ep06', 'GE-DD5913-EP'), ('ep07', 'GE-DDC7CA-EP'), ('ep08', 'GE-DD6DEF-EP'), ('ep09', 'GE-DD5FB6-EP'), ('ep10', 'GE-DDBA88-EP'), ('ep11', 'GE-DD9522-EP'), ('ep12', 'GE-DD6D89-EP'), ('ep13', 'GE-DD6D96-EP'), ('ep14', 'GE-DD6974-EP'), ('ep15', 'GE-DD5FA9-EP'), ('ep16', 'GE-DDA874-EP'), ('ep17', 'GE-DD6975-EP'), ('ep18', 'GE-DD5916-EP')] hv_values = {n[0]: 1530 for n in EIGHT_PACKS} pv_scales = {'ep01': [('AScales', [2077, 2033, 2127, 2137, 2095, 2130, 2149, 2123]), ('Scales', [2102, 2114, 2118, 2088, 2088, 2076, 2107, 2124])], 'ep02': [('AScales', [2089, 2148, 2095, 2090, 2088, 2147, 2107, 2098]), ('Scales', [2069, 2099, 2061, 2100, 2104, 2090, 2101, 2087])], 'ep03': [('AScales', [2105, 2084, 2112, 2107, 2183, 2050, 2084, 2102]), ('Scales', [2093, 2125, 2086, 2112, 2101, 2097, 2102, 2111])], 'ep04': [('AScales', [2060, 2036, 2055, 2063, 2060, 2071, 2067, 2083]), ('Scales', [2006, 1991, 1996, 2003, 2011, 2002, 1996, 1999])], 'ep05': [('AScales', [2016, 2064, 2037, 2083, 2062, 2023, 2078, 2083]), ('Scales', [2009, 1997, 1973, 2020, 1989, 2038, 2010, 2010])], 'ep06': [('AScales', [2026, 2048, 2087, 2059, 2040, 2050, 2073, 2037]), ('Scales', [2007, 2005, 2011, 2009, 2010, 1990, 2002, 2010])], 'ep07': [('AScales', [2041, 2037, 1999, 1996, 2031, 2013, 1982, 2063]), ('Scales', [1982, 2021, 1993, 1984, 1987, 1961, 1986, 1964])], 'ep08': [('AScales', [2055, 2074, 2039, 2032, 2068, 2070, 2054, 2100]), ('Scales', [2010, 1999, 1987, 2009, 1986, 2005, 1984, 2005])], 'ep09': [('AScales', [2031, 2065, 2005, 2088, 2048, 2048, 2035, 2009]), ('Scales', [2001, 1999, 1984, 2018, 1979, 1992, 1986, 1977])], 'ep10': [('AScales', [2050, 2022, 2040, 2082, 2059, 2030, 2033, 2055]), ('Scales', [1978, 2030, 1978, 1980, 1997, 2016, 1982, 1991])], 'ep11': [('AScales', [2035, 2024, 2042, 2014, 2024, 2005, 2063, 2037]), ('Scales', [1996, 2018, 1996, 1975, 1966, 1963, 2035, 2016])], 'ep12': [('AScales', [2063, 2079, 2042, 2049, 2053, 2055, 2050, 2063]), ('Scales', [1990, 2020, 2003, 2002, 1978, 1988, 2015, 1975])], 'ep13': [('AScales', [2072, 2095, 2092, 2104, 2083, 2077, 2036, 2092]), ('Scales', [2018, 2013, 2004, 2013, 2007, 2002, 2027, 2004])], 'ep15': [('AScales', [2078, 2060, 2063, 2091, 2050, 2053, 2071, 2061]), ('Scales', [2014, 2000, 2017, 1998, 1989, 1996, 2002, 2030])], 'ep14': [('AScales', [2070, 2078, 2055, 2026, 2075, 2053, 2072, 2073]), ('Scales', [2011, 2002, 2009, 1990, 1998, 1963, 2015, 1986])], 'ep16': [('AScales', [2196, 2085, 2053, 2161, 2168, 2127, 2155, 2185]), ('Scales', [2087, 2079, 2090, 2113, 2100, 2085, 2082, 2086])], 'ep17': [('AScales', [2144, 2188, 2168, 2153, 2192, 2148, 2178, 2205]), ('Scales', [2105, 2070, 2098, 2109, 2111, 2099, 2103, 2090])], 'ep18': [('AScales', [2178, 2134, 2149, 2053, 2142, 2191, 2154, 2115]), ('Scales', [2125, 2118, 2110, 2154, 2113, 2132, 2102, 2099])]} mode = 3 mode_diag = 6 mode_fake = 35 mode_fakediag = 38 pv_values_common = [('Mode', MODE), ('DecimationFactor', 1), ('DiscriminatorLevel', 1024), ('NegativeVeto', -16384), ('PositiveVeto', 16383), ('Sample1', 10), ('BScales', [2048, 2048, 2048, 2048, 2048, 2048, 2048, 2048]), ('TubeEnables', [1, 1, 1, 1, 1, 1, 1, 1]), ('AccumulationLength', 60), ('WaveformCaptureLength', 1015)] ppt_s = 94 ppt_m = 206 ppt_l = 256 pv_values_single = {'ep01': [('ModulePixelIdStart', 0 * 8192), ('PixelCount', PPT_S)], 'ep02': [('ModulePixelIdStart', 1 * 8192), ('PixelCount', PPT_S)], 'ep03': [('ModulePixelIdStart', 2 * 8192), ('PixelCount', PPT_S)], 'ep04': [('ModulePixelIdStart', 3 * 8192), ('PixelCount', PPT_M)], 'ep05': [('ModulePixelIdStart', 4 * 8192), ('PixelCount', PPT_M)], 'ep06': [('ModulePixelIdStart', 5 * 8192), ('PixelCount', PPT_M)], 'ep07': [('ModulePixelIdStart', 6 * 8192), ('PixelCount', PPT_L)], 'ep08': [('ModulePixelIdStart', 7 * 8192), ('PixelCount', PPT_L)], 'ep09': [('ModulePixelIdStart', 8 * 8192), ('PixelCount', PPT_L)], 'ep10': [('ModulePixelIdStart', 9 * 8192), ('PixelCount', PPT_L)], 'ep11': [('ModulePixelIdStart', 10 * 8192), ('PixelCount', PPT_L)], 'ep12': [('ModulePixelIdStart', 11 * 8192), ('PixelCount', PPT_L)], 'ep13': [('ModulePixelIdStart', 12 * 8192), ('PixelCount', PPT_M)], 'ep14': [('ModulePixelIdStart', 14 * 8192), ('PixelCount', PPT_M)], 'ep15': [('ModulePixelIdStart', 13 * 8192), ('PixelCount', PPT_M)], 'ep16': [('ModulePixelIdStart', 15 * 8192), ('PixelCount', PPT_S)], 'ep17': [('ModulePixelIdStart', 16 * 8192), ('PixelCount', PPT_S)], 'ep18': [('ModulePixelIdStart', 17 * 8192), ('PixelCount', PPT_S)]}
# Write a program to print the pattern ''' * * * * * * * * * ''' n = int(input("Size: ")) s1 = 0 s2 = 2 * n - 3 i = 0 while (i < n): if (i < n-1): extra = "*" else : extra = "" print(" " * s1 + "*" + " " * s2 + extra) s1 += 1 s2 -= 2 i += 1 s1 -= 2 s2 += 4 i = 0 while (i < n-1): print(" " * s1 + "*" + " " * s2 + "*") s1 -= 1 s2 += 2 i += 1
""" * * * * * * * * * """ n = int(input('Size: ')) s1 = 0 s2 = 2 * n - 3 i = 0 while i < n: if i < n - 1: extra = '*' else: extra = '' print(' ' * s1 + '*' + ' ' * s2 + extra) s1 += 1 s2 -= 2 i += 1 s1 -= 2 s2 += 4 i = 0 while i < n - 1: print(' ' * s1 + '*' + ' ' * s2 + '*') s1 -= 1 s2 += 2 i += 1
def empty_float(): """ >>> float() 0.0 >>> empty_float() 0.0 """ x = float() return x def float_conjugate(): """ >>> float_call_conjugate() 1.5 """ x = 1.5 .conjugate() return x def float_call_conjugate(): """ >>> float_call_conjugate() 1.5 """ x = float(1.5).conjugate() return x
def empty_float(): """ >>> float() 0.0 >>> empty_float() 0.0 """ x = float() return x def float_conjugate(): """ >>> float_call_conjugate() 1.5 """ x = 1.5.conjugate() return x def float_call_conjugate(): """ >>> float_call_conjugate() 1.5 """ x = float(1.5).conjugate() return x
""" Exception module. """ __docformat__ = "restructuredtext en" ## Copyright (c) 2009 Emmanuel Goossaert ## ## This file is part of npy. ## ## npy is free software; you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by ## the Free Software Foundation; either version 3 of the License, or ## (at your option) any later version. ## ## npy is distributed in the hope that it will be useful, ## but WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ## GNU General Public License for more details. ## ## You should have received a copy of the GNU General Public License ## along with npy. If not, see <http://www.gnu.org/licenses/>. class NpyException(Exception): """ Exception base class. The base Exception class is overridden, so that the __init__() function can be redefined. """ def __init__(self, msg): self.msg = msg def __str__(self): return repr(self.msg) class NpyStreamError(NpyException): """ Raised when an error is met while working with streams. """ pass class NpyTransferFunctionError(NpyException): """ Raised when a critical error regarding transfer function is encountered. """ pass class NpyDataTypeError(NpyException): """ Raised when the type of a parameter is not the one that is expected. """ pass class NpyIndexError(NpyException): """ Raised when an error regarding internal data structure indices occurs. """ pass class NpyValueError(NpyException): """ Raised when the value of a parameter is critical. """ pass class NpyUnitError(NpyException): """ Raised when a problem occurs during the creation of a `Unit`. """ pass
""" Exception module. """ __docformat__ = 'restructuredtext en' class Npyexception(Exception): """ Exception base class. The base Exception class is overridden, so that the __init__() function can be redefined. """ def __init__(self, msg): self.msg = msg def __str__(self): return repr(self.msg) class Npystreamerror(NpyException): """ Raised when an error is met while working with streams. """ pass class Npytransferfunctionerror(NpyException): """ Raised when a critical error regarding transfer function is encountered. """ pass class Npydatatypeerror(NpyException): """ Raised when the type of a parameter is not the one that is expected. """ pass class Npyindexerror(NpyException): """ Raised when an error regarding internal data structure indices occurs. """ pass class Npyvalueerror(NpyException): """ Raised when the value of a parameter is critical. """ pass class Npyuniterror(NpyException): """ Raised when a problem occurs during the creation of a `Unit`. """ pass
# Write your solution here def double_items(numbers): double_numbers = [] for item in numbers: double_numbers.append(item*2) return double_numbers if __name__ == "__main__": numbers = [2, 4, 5, 3, 11, -4] numbers_doubled = double_items(numbers) print("original:", numbers) print("doubled:", numbers_doubled)
def double_items(numbers): double_numbers = [] for item in numbers: double_numbers.append(item * 2) return double_numbers if __name__ == '__main__': numbers = [2, 4, 5, 3, 11, -4] numbers_doubled = double_items(numbers) print('original:', numbers) print('doubled:', numbers_doubled)
class SIG_REVERIESH(object): KILL = 'SIG_REVERIESH_KILL'.encode() PROMPT = 'SIG_REVERIESH_PROMPT'.encode() class ascii_format: magenta = '\033[95m' blue = '\033[94m' green = '\033[92m' yellow = '\033[93m' red = '\033[91m' clear = '\033[0m' bold = '\033[1m' underline = '\033[4m' def __new__(cls, s, f=None): return ascii_format.format(s, f) @staticmethod def from_int(i): return '\033[{}m'.format(i) @staticmethod def format(s, f=None): if f is None: f = ascii_format.clear elif isinstance(f, int): f = ascii_format.from_int(f) elif isinstance(f, str): f = getattr(ascii_format, f) else: raise ValueError('Invalid format type: {}'.format(type(f))) return '{}{}{}'.format(f, s, ascii_format.clear) """WORK IN PROGRESS """ def marshall_item(x): # type: (Any) -> bytes """Marshall data into binary format Right now, only working with strings, so we can take some shortcuts with deliminators """ if isinstance(x, bytes): return x if isinstance(x, str): return x.encode() raise TypeError('Cannot marshall type: {}'.format(type(x))) def unmarshall_item(x): # type: (bytes) -> str try: return x.decode() except Exception as exc: raise TypeError('Cannot marshall data: {}'.format(type(x))) def dictpack(dd): # type: (dict) -> bytes out = b'' for k, v in dd.items(): ke = marshall_item(k) kv = marshall_item(v) def dictunpack(): # type: (bytes) -> dict pass
class Sig_Reveriesh(object): kill = 'SIG_REVERIESH_KILL'.encode() prompt = 'SIG_REVERIESH_PROMPT'.encode() class Ascii_Format: magenta = '\x1b[95m' blue = '\x1b[94m' green = '\x1b[92m' yellow = '\x1b[93m' red = '\x1b[91m' clear = '\x1b[0m' bold = '\x1b[1m' underline = '\x1b[4m' def __new__(cls, s, f=None): return ascii_format.format(s, f) @staticmethod def from_int(i): return '\x1b[{}m'.format(i) @staticmethod def format(s, f=None): if f is None: f = ascii_format.clear elif isinstance(f, int): f = ascii_format.from_int(f) elif isinstance(f, str): f = getattr(ascii_format, f) else: raise value_error('Invalid format type: {}'.format(type(f))) return '{}{}{}'.format(f, s, ascii_format.clear) 'WORK IN PROGRESS ' def marshall_item(x): """Marshall data into binary format Right now, only working with strings, so we can take some shortcuts with deliminators """ if isinstance(x, bytes): return x if isinstance(x, str): return x.encode() raise type_error('Cannot marshall type: {}'.format(type(x))) def unmarshall_item(x): try: return x.decode() except Exception as exc: raise type_error('Cannot marshall data: {}'.format(type(x))) def dictpack(dd): out = b'' for (k, v) in dd.items(): ke = marshall_item(k) kv = marshall_item(v) def dictunpack(): pass
#!/usr/bin/env python3 # Write a program that computes the running sum from 1..n # Also, have it compute the factorial of n while you're at it # No, you may not use math.factorial() # Use the same loop for both calculations n = 5 runsum = 0 factorial = 1 for i in range(1, n+1): runsum += i # computes the running sum from 1 to 5 (we set the range 1, n+1) factorial *= i # computes factorial of n = 5 print(n, runsum, factorial) """ 5 15 120 """
n = 5 runsum = 0 factorial = 1 for i in range(1, n + 1): runsum += i factorial *= i print(n, runsum, factorial) '\n5 15 120\n'
# -*- coding: utf-8 -*- TOILET_CHOICES = ( ('F', 'Flush'), ('PT', 'Pit toilet'), ('TPT', 'Traditional Pit toilet'), ('L', 'Latrine'), ('BF', 'Bush /Field'), ('R', 'River'), ('O', 'Others'), ) COOKING_FACILITIES = ( ('Electricity', 'Electricity'), ('Gas', 'Gas'), ('Biomass', 'Biomass'), ('Kerosene', 'Kerosene'), ('Coal', 'Coal'), ('Charcoal', 'Charcoal'), ('Firewood', 'Firewood'), ('Others', 'Others'), ) SEX_CHOICES = ( ("M","Male"), ("F","Female"), ("O","Others"), ) MARITAL_CHOICES = ( ('SG', 'Single'), ('MR', 'Married'), ('DV', 'Divorced'), ('WD', 'Widowed'), ) FREQUENCY_CHOICES = ( ('AL', 'Always'), ('US', 'Usually'), ('OF', 'Often'), ('SO', 'Sometimes'), ('SE', 'Seldom'), ('RA', 'Rarely'), ('NV', 'Never'), ) LITERATE_CHOICES = ( ('LT', 'Literate'), ('SL', 'Semiliterate'), ('IL', 'Iliterate'), ) LEVEL_CHOICES = ( ('No', 'No'), ('Mi', 'Mild'), ('Mo', 'Moderate'), ('S', 'Severe'), ) EDUCATIONAL_LEVEL_CHOICES = ( ('KD', 'Kindergarden'), ('PR', 'Primary'), ('SC', 'Secondary'), ('UN', 'University'), ('NV', 'Never'), ) RELATIONSHIP_CHOICES = ( ('HS', 'Husband'), ('FA', 'Father'), ('MO', 'Mother'), ('GF', 'Grandfather'), ('GM', 'Grandmother'), ('UN', 'Uncle'), ('AU', 'Aunt'), ('FR', 'Friend'), ) MENSTRUAL_CYCLE_CHOICES = ( ('28', '28days'), ('30', '30days'), ('OT', 'Others'), ) HAVE_BEEN_PREGNANT_CHOICES = ( (0, '0'), (1, '1'), (2, '2'), (3, '3'), (4, '4'), (5, '5'), (6, '6'), (7, '7'), (8, '8'), (9, '9'), (10, '10'), (11, '11'), (12, '12'), (13, '13'), (14, '14'), (15, '15'), (16, '16'), (17, '17'), (18, '18'), (19, '19'), (20, '20'), ) TYPES_OF_DELIVERY_CHOICES = ( ('LB', 'Live Birth'), ('SB', 'Still Birth'), ('AB', 'Abortion'), ('EC', 'Ectopic'), ('HM', 'Hydatidiform Model'), ('OT', 'Others'), ) PROBLEMS_CHOICES = ( ('NO', 'None'), ('PL','PretermLabor'), ('DB','Diabetes'), ('HB','High Blood Pressure'), ('TH','Thrombosis'), ('EM','Embolus'), ('HT','Hypertension'), ('PE','Pre-Eclampsia'), ('EC','Eclampsia'), ('OT','Others'), ) OBSTETRICALOPERATION_CHOICES = ( ('NO', 'None'), ('CS', 'Caesarian Section'), ('FO','Forceps'), ('VE','Vacuum Extraction'), ('MI','Manual instrumental help in vaginal breech delivery'), ('MR','Manual Removal Of The Placenta'), ('OT','Others'), ) METHOD_OF_BIRTH_CONTROL_CHOICES = ( ('CO', 'Condoms'), ('PI', 'Pills'), ('PA', 'Patch'), ('VR', 'Vaginal Ring'), ('TU', 'Tubal/Essure'), ('IU', 'IUD'), ('PV', 'Partner with vasectomy'), ('NA', 'Natural Family Planning'), ('IM', 'Implanon'), ('NO', 'None'), ('OT', 'Other'), ) NORMAL_CHOICES = ( ('NR', 'Normal'), ('AB', 'Abnormal'), ) VACCINATION_CHOICES= ( ('RU', 'Rubella'), ('TT', 'Tetanus Toxoid'), ('OT', 'Other'), ) VISIT_CHOICES = ( ('FT', 'First trimester'), ('ST', 'Second Trimester'), ('TT', 'Third Trimester'), ('OT', 'Other visit'), ) BLOOD_PRESSURE_CHOICES = ( ('BE','140/90'), ('AB','>= 140/90'), ) URINALYSIS_CHOICES = ( ('BE', '<0.3g/24h'), ('AB', '>0.3g/24h'), ) HEMOGLOBIN_CHOICES = ( ('A', '9-10'), ('B', '7-8'), ('C', '<7'), ('D', '>=11'), ) MATERNAL_COMPLICATIONS_CHOICES = ( ('NO','No complication'), ('RA', 'Recurrent early abortion'), ('IA','Induced abortion and any associated complications'), ('TH','Thrombosis'), ('EM','Embolus'), ('HY','Hypertension'), ('PE','Pre-Eclampsia'), ('EC','Eclampsia'), ('PA','Placental abruption'), ('OT','Others'), ) PERINATAL_COMPLICATIONS_CHOICES = ( ('NO','No complication'), ('TW', 'Twins or higher order multiples'), ('LO', 'Low birth weight (<2500g)'), ('IG','Intrauterine growth retardation'), ('RA','Rhesus antibody(erytroblastosis,hydrops)'), ('MC','Malformed or chromosomally abnormal child'), ('MA','macrosomic(>4500g) newborn'), ('RE','Resuscitation or other treatment of newborn'), ('PE','Perinatal,neonatal or infant death'), ('OT','Others'), )
toilet_choices = (('F', 'Flush'), ('PT', 'Pit toilet'), ('TPT', 'Traditional Pit toilet'), ('L', 'Latrine'), ('BF', 'Bush /Field'), ('R', 'River'), ('O', 'Others')) cooking_facilities = (('Electricity', 'Electricity'), ('Gas', 'Gas'), ('Biomass', 'Biomass'), ('Kerosene', 'Kerosene'), ('Coal', 'Coal'), ('Charcoal', 'Charcoal'), ('Firewood', 'Firewood'), ('Others', 'Others')) sex_choices = (('M', 'Male'), ('F', 'Female'), ('O', 'Others')) marital_choices = (('SG', 'Single'), ('MR', 'Married'), ('DV', 'Divorced'), ('WD', 'Widowed')) frequency_choices = (('AL', 'Always'), ('US', 'Usually'), ('OF', 'Often'), ('SO', 'Sometimes'), ('SE', 'Seldom'), ('RA', 'Rarely'), ('NV', 'Never')) literate_choices = (('LT', 'Literate'), ('SL', 'Semiliterate'), ('IL', 'Iliterate')) level_choices = (('No', 'No'), ('Mi', 'Mild'), ('Mo', 'Moderate'), ('S', 'Severe')) educational_level_choices = (('KD', 'Kindergarden'), ('PR', 'Primary'), ('SC', 'Secondary'), ('UN', 'University'), ('NV', 'Never')) relationship_choices = (('HS', 'Husband'), ('FA', 'Father'), ('MO', 'Mother'), ('GF', 'Grandfather'), ('GM', 'Grandmother'), ('UN', 'Uncle'), ('AU', 'Aunt'), ('FR', 'Friend')) menstrual_cycle_choices = (('28', '28days'), ('30', '30days'), ('OT', 'Others')) have_been_pregnant_choices = ((0, '0'), (1, '1'), (2, '2'), (3, '3'), (4, '4'), (5, '5'), (6, '6'), (7, '7'), (8, '8'), (9, '9'), (10, '10'), (11, '11'), (12, '12'), (13, '13'), (14, '14'), (15, '15'), (16, '16'), (17, '17'), (18, '18'), (19, '19'), (20, '20')) types_of_delivery_choices = (('LB', 'Live Birth'), ('SB', 'Still Birth'), ('AB', 'Abortion'), ('EC', 'Ectopic'), ('HM', 'Hydatidiform Model'), ('OT', 'Others')) problems_choices = (('NO', 'None'), ('PL', 'PretermLabor'), ('DB', 'Diabetes'), ('HB', 'High Blood Pressure'), ('TH', 'Thrombosis'), ('EM', 'Embolus'), ('HT', 'Hypertension'), ('PE', 'Pre-Eclampsia'), ('EC', 'Eclampsia'), ('OT', 'Others')) obstetricaloperation_choices = (('NO', 'None'), ('CS', 'Caesarian Section'), ('FO', 'Forceps'), ('VE', 'Vacuum Extraction'), ('MI', 'Manual instrumental help in vaginal breech delivery'), ('MR', 'Manual Removal Of The Placenta'), ('OT', 'Others')) method_of_birth_control_choices = (('CO', 'Condoms'), ('PI', 'Pills'), ('PA', 'Patch'), ('VR', 'Vaginal Ring'), ('TU', 'Tubal/Essure'), ('IU', 'IUD'), ('PV', 'Partner with vasectomy'), ('NA', 'Natural Family Planning'), ('IM', 'Implanon'), ('NO', 'None'), ('OT', 'Other')) normal_choices = (('NR', 'Normal'), ('AB', 'Abnormal')) vaccination_choices = (('RU', 'Rubella'), ('TT', 'Tetanus Toxoid'), ('OT', 'Other')) visit_choices = (('FT', 'First trimester'), ('ST', 'Second Trimester'), ('TT', 'Third Trimester'), ('OT', 'Other visit')) blood_pressure_choices = (('BE', '140/90'), ('AB', '>= 140/90')) urinalysis_choices = (('BE', '<0.3g/24h'), ('AB', '>0.3g/24h')) hemoglobin_choices = (('A', '9-10'), ('B', '7-8'), ('C', '<7'), ('D', '>=11')) maternal_complications_choices = (('NO', 'No complication'), ('RA', 'Recurrent early abortion'), ('IA', 'Induced abortion and any associated complications'), ('TH', 'Thrombosis'), ('EM', 'Embolus'), ('HY', 'Hypertension'), ('PE', 'Pre-Eclampsia'), ('EC', 'Eclampsia'), ('PA', 'Placental abruption'), ('OT', 'Others')) perinatal_complications_choices = (('NO', 'No complication'), ('TW', 'Twins or higher order multiples'), ('LO', 'Low birth weight (<2500g)'), ('IG', 'Intrauterine growth retardation'), ('RA', 'Rhesus antibody(erytroblastosis,hydrops)'), ('MC', 'Malformed or chromosomally abnormal child'), ('MA', 'macrosomic(>4500g) newborn'), ('RE', 'Resuscitation or other treatment of newborn'), ('PE', 'Perinatal,neonatal or infant death'), ('OT', 'Others'))
# # PySNMP MIB module ZHONE-COM-IP-ZEDGE-NAT-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/ZHONE-COM-IP-ZEDGE-NAT-MIB # Produced by pysmi-0.3.4 at Mon Apr 29 21:41:01 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) # ObjectIdentifier, Integer, OctetString = mibBuilder.importSymbols("ASN1", "ObjectIdentifier", "Integer", "OctetString") NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues") ConstraintsUnion, ConstraintsIntersection, ValueRangeConstraint, SingleValueConstraint, ValueSizeConstraint = mibBuilder.importSymbols("ASN1-REFINEMENT", "ConstraintsUnion", "ConstraintsIntersection", "ValueRangeConstraint", "SingleValueConstraint", "ValueSizeConstraint") InterfaceIndex, = mibBuilder.importSymbols("IF-MIB", "InterfaceIndex") NotificationGroup, ModuleCompliance = mibBuilder.importSymbols("SNMPv2-CONF", "NotificationGroup", "ModuleCompliance") NotificationType, Gauge32, iso, Counter32, IpAddress, Bits, Unsigned32, ObjectIdentity, ModuleIdentity, MibIdentifier, MibScalar, MibTable, MibTableRow, MibTableColumn, Integer32, Counter64, TimeTicks = mibBuilder.importSymbols("SNMPv2-SMI", "NotificationType", "Gauge32", "iso", "Counter32", "IpAddress", "Bits", "Unsigned32", "ObjectIdentity", "ModuleIdentity", "MibIdentifier", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "Integer32", "Counter64", "TimeTicks") TruthValue, DisplayString, TextualConvention = mibBuilder.importSymbols("SNMPv2-TC", "TruthValue", "DisplayString", "TextualConvention") zhoneModules, zhoneIp = mibBuilder.importSymbols("Zhone", "zhoneModules", "zhoneIp") ZhoneRowStatus, = mibBuilder.importSymbols("Zhone-TC", "ZhoneRowStatus") comIpZEdgeNat = ModuleIdentity((1, 3, 6, 1, 4, 1, 5504, 6, 66)) comIpZEdgeNat.setRevisions(('2010-10-20 05:52', '2008-07-22 07:28', '2003-12-11 02:58', '2003-03-19 09:02', '2000-10-04 15:30',)) if mibBuilder.loadTexts: comIpZEdgeNat.setLastUpdated('201010200727Z') if mibBuilder.loadTexts: comIpZEdgeNat.setOrganization('Zhone Technologies, Inc.') zedgeNat = ObjectIdentity((1, 3, 6, 1, 4, 1, 5504, 4, 1, 16)) if mibBuilder.loadTexts: zedgeNat.setStatus('current') natConfigGroup = ObjectIdentity((1, 3, 6, 1, 4, 1, 5504, 4, 1, 16, 1)) if mibBuilder.loadTexts: natConfigGroup.setStatus('current') natTcpTimeout = MibScalar((1, 3, 6, 1, 4, 1, 5504, 4, 1, 16, 1, 1), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(0, 604800))).setUnits('seconds').setMaxAccess("readwrite") if mibBuilder.loadTexts: natTcpTimeout.setStatus('current') natUdpTimeout = MibScalar((1, 3, 6, 1, 4, 1, 5504, 4, 1, 16, 1, 2), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(0, 604800))).setUnits('seconds').setMaxAccess("readwrite") if mibBuilder.loadTexts: natUdpTimeout.setStatus('current') natClearBindings = MibScalar((1, 3, 6, 1, 4, 1, 5504, 4, 1, 16, 1, 3), TruthValue()).setMaxAccess("readwrite") if mibBuilder.loadTexts: natClearBindings.setStatus('current') natStatsGroup = ObjectIdentity((1, 3, 6, 1, 4, 1, 5504, 4, 1, 16, 2)) if mibBuilder.loadTexts: natStatsGroup.setStatus('current') natNumCurrentBindings = MibScalar((1, 3, 6, 1, 4, 1, 5504, 4, 1, 16, 2, 1), Gauge32()).setMaxAccess("readonly") if mibBuilder.loadTexts: natNumCurrentBindings.setStatus('current') natNumExpiredBindings = MibScalar((1, 3, 6, 1, 4, 1, 5504, 4, 1, 16, 2, 2), Gauge32()).setMaxAccess("readonly") if mibBuilder.loadTexts: natNumExpiredBindings.setStatus('current') natTotalPkts = MibScalar((1, 3, 6, 1, 4, 1, 5504, 4, 1, 16, 2, 3), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: natTotalPkts.setStatus('current') natDroppedPkts = MibScalar((1, 3, 6, 1, 4, 1, 5504, 4, 1, 16, 2, 4), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: natDroppedPkts.setStatus('current') natBindingsTable = MibTable((1, 3, 6, 1, 4, 1, 5504, 4, 1, 16, 3), ) if mibBuilder.loadTexts: natBindingsTable.setStatus('current') natBindingsEntry = MibTableRow((1, 3, 6, 1, 4, 1, 5504, 4, 1, 16, 3, 1), ).setIndexNames((0, "ZHONE-COM-IP-ZEDGE-NAT-MIB", "natBindingsIfIndex"), (0, "ZHONE-COM-IP-ZEDGE-NAT-MIB", "natBindingLocalAddr"), (0, "ZHONE-COM-IP-ZEDGE-NAT-MIB", "natBindingLocalPort"), (0, "ZHONE-COM-IP-ZEDGE-NAT-MIB", "natBindingPublicAddr"), (0, "ZHONE-COM-IP-ZEDGE-NAT-MIB", "natBindingPublicPort")) if mibBuilder.loadTexts: natBindingsEntry.setStatus('current') natBindingsIfIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 5504, 4, 1, 16, 3, 1, 1), InterfaceIndex()) if mibBuilder.loadTexts: natBindingsIfIndex.setStatus('current') natBindingLocalAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 5504, 4, 1, 16, 3, 1, 2), IpAddress()) if mibBuilder.loadTexts: natBindingLocalAddr.setStatus('current') natBindingLocalPort = MibTableColumn((1, 3, 6, 1, 4, 1, 5504, 4, 1, 16, 3, 1, 3), Unsigned32()) if mibBuilder.loadTexts: natBindingLocalPort.setStatus('current') natBindingPublicAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 5504, 4, 1, 16, 3, 1, 4), IpAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: natBindingPublicAddr.setStatus('current') natBindingPublicPort = MibTableColumn((1, 3, 6, 1, 4, 1, 5504, 4, 1, 16, 3, 1, 5), Unsigned32()).setMaxAccess("readonly") if mibBuilder.loadTexts: natBindingPublicPort.setStatus('current') zhonePATBindings = MibIdentifier((1, 3, 6, 1, 4, 1, 5504, 4, 1, 16, 4)) patBindNextIndex = MibScalar((1, 3, 6, 1, 4, 1, 5504, 4, 1, 16, 4, 1), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: patBindNextIndex.setStatus('current') patTable = MibTable((1, 3, 6, 1, 4, 1, 5504, 4, 1, 16, 4, 2), ) if mibBuilder.loadTexts: patTable.setStatus('current') patEntry = MibTableRow((1, 3, 6, 1, 4, 1, 5504, 4, 1, 16, 4, 2, 1), ).setIndexNames((0, "ZHONE-COM-IP-ZEDGE-NAT-MIB", "zhonePATBindIndex")) if mibBuilder.loadTexts: patEntry.setStatus('current') zhonePATBindIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 5504, 4, 1, 16, 4, 2, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 4320))) if mibBuilder.loadTexts: zhonePATBindIndex.setStatus('current') zhonePATBindRowStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 5504, 4, 1, 16, 4, 2, 1, 2), ZhoneRowStatus()).setMaxAccess("readcreate") if mibBuilder.loadTexts: zhonePATBindRowStatus.setStatus('current') publicAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 5504, 4, 1, 16, 4, 2, 1, 3), IpAddress()).setMaxAccess("readcreate") if mibBuilder.loadTexts: publicAddr.setStatus('current') publicPort = MibTableColumn((1, 3, 6, 1, 4, 1, 5504, 4, 1, 16, 4, 2, 1, 4), Integer32().subtype(subtypeSpec=ValueRangeConstraint(51921, 56250))).setMaxAccess("readcreate") if mibBuilder.loadTexts: publicPort.setStatus('current') localAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 5504, 4, 1, 16, 4, 2, 1, 5), IpAddress()).setMaxAccess("readcreate") if mibBuilder.loadTexts: localAddr.setStatus('current') localPort = MibTableColumn((1, 3, 6, 1, 4, 1, 5504, 4, 1, 16, 4, 2, 1, 6), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 49151))).setMaxAccess("readcreate") if mibBuilder.loadTexts: localPort.setStatus('current') portType = MibTableColumn((1, 3, 6, 1, 4, 1, 5504, 4, 1, 16, 4, 2, 1, 7), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4))).clone(namedValues=NamedValues(("tcp", 1), ("udp", 2), ("cpemgr", 3), ("cpemgrsecure", 4))).clone('tcp')).setMaxAccess("readcreate") if mibBuilder.loadTexts: portType.setStatus('current') zhoneNATExclusion = MibIdentifier((1, 3, 6, 1, 4, 1, 5504, 4, 1, 16, 5)) natExcludeNextIndex = MibScalar((1, 3, 6, 1, 4, 1, 5504, 4, 1, 16, 5, 1), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: natExcludeNextIndex.setStatus('current') natExcludeTable = MibTable((1, 3, 6, 1, 4, 1, 5504, 4, 1, 16, 5, 2), ) if mibBuilder.loadTexts: natExcludeTable.setStatus('current') natExcludeEntry = MibTableRow((1, 3, 6, 1, 4, 1, 5504, 4, 1, 16, 5, 2, 1), ).setIndexNames((0, "ZHONE-COM-IP-ZEDGE-NAT-MIB", "zhoneNATExcludeIndex")) if mibBuilder.loadTexts: natExcludeEntry.setStatus('current') zhoneNATExcludeIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 5504, 4, 1, 16, 5, 2, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 20))) if mibBuilder.loadTexts: zhoneNATExcludeIndex.setStatus('current') zhoneNATExcludeRowStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 5504, 4, 1, 16, 5, 2, 1, 2), ZhoneRowStatus()).setMaxAccess("readcreate") if mibBuilder.loadTexts: zhoneNATExcludeRowStatus.setStatus('current') ipStartAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 5504, 4, 1, 16, 5, 2, 1, 3), IpAddress()).setMaxAccess("readcreate") if mibBuilder.loadTexts: ipStartAddr.setStatus('current') ipEndAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 5504, 4, 1, 16, 5, 2, 1, 4), IpAddress()).setMaxAccess("readcreate") if mibBuilder.loadTexts: ipEndAddr.setStatus('current') mibBuilder.exportSymbols("ZHONE-COM-IP-ZEDGE-NAT-MIB", portType=portType, natBindingLocalAddr=natBindingLocalAddr, zedgeNat=zedgeNat, natBindingsIfIndex=natBindingsIfIndex, patEntry=patEntry, publicPort=publicPort, natClearBindings=natClearBindings, natNumExpiredBindings=natNumExpiredBindings, natBindingPublicPort=natBindingPublicPort, natTcpTimeout=natTcpTimeout, natBindingLocalPort=natBindingLocalPort, natStatsGroup=natStatsGroup, natExcludeTable=natExcludeTable, natBindingsTable=natBindingsTable, natExcludeNextIndex=natExcludeNextIndex, natBindingPublicAddr=natBindingPublicAddr, zhonePATBindings=zhonePATBindings, natDroppedPkts=natDroppedPkts, localPort=localPort, comIpZEdgeNat=comIpZEdgeNat, natExcludeEntry=natExcludeEntry, patTable=patTable, zhoneNATExclusion=zhoneNATExclusion, natConfigGroup=natConfigGroup, natUdpTimeout=natUdpTimeout, natBindingsEntry=natBindingsEntry, PYSNMP_MODULE_ID=comIpZEdgeNat, zhonePATBindRowStatus=zhonePATBindRowStatus, patBindNextIndex=patBindNextIndex, zhonePATBindIndex=zhonePATBindIndex, zhoneNATExcludeRowStatus=zhoneNATExcludeRowStatus, zhoneNATExcludeIndex=zhoneNATExcludeIndex, natNumCurrentBindings=natNumCurrentBindings, ipStartAddr=ipStartAddr, natTotalPkts=natTotalPkts, ipEndAddr=ipEndAddr, localAddr=localAddr, publicAddr=publicAddr)
(object_identifier, integer, octet_string) = mibBuilder.importSymbols('ASN1', 'ObjectIdentifier', 'Integer', 'OctetString') (named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues') (constraints_union, constraints_intersection, value_range_constraint, single_value_constraint, value_size_constraint) = mibBuilder.importSymbols('ASN1-REFINEMENT', 'ConstraintsUnion', 'ConstraintsIntersection', 'ValueRangeConstraint', 'SingleValueConstraint', 'ValueSizeConstraint') (interface_index,) = mibBuilder.importSymbols('IF-MIB', 'InterfaceIndex') (notification_group, module_compliance) = mibBuilder.importSymbols('SNMPv2-CONF', 'NotificationGroup', 'ModuleCompliance') (notification_type, gauge32, iso, counter32, ip_address, bits, unsigned32, object_identity, module_identity, mib_identifier, mib_scalar, mib_table, mib_table_row, mib_table_column, integer32, counter64, time_ticks) = mibBuilder.importSymbols('SNMPv2-SMI', 'NotificationType', 'Gauge32', 'iso', 'Counter32', 'IpAddress', 'Bits', 'Unsigned32', 'ObjectIdentity', 'ModuleIdentity', 'MibIdentifier', 'MibScalar', 'MibTable', 'MibTableRow', 'MibTableColumn', 'Integer32', 'Counter64', 'TimeTicks') (truth_value, display_string, textual_convention) = mibBuilder.importSymbols('SNMPv2-TC', 'TruthValue', 'DisplayString', 'TextualConvention') (zhone_modules, zhone_ip) = mibBuilder.importSymbols('Zhone', 'zhoneModules', 'zhoneIp') (zhone_row_status,) = mibBuilder.importSymbols('Zhone-TC', 'ZhoneRowStatus') com_ip_z_edge_nat = module_identity((1, 3, 6, 1, 4, 1, 5504, 6, 66)) comIpZEdgeNat.setRevisions(('2010-10-20 05:52', '2008-07-22 07:28', '2003-12-11 02:58', '2003-03-19 09:02', '2000-10-04 15:30')) if mibBuilder.loadTexts: comIpZEdgeNat.setLastUpdated('201010200727Z') if mibBuilder.loadTexts: comIpZEdgeNat.setOrganization('Zhone Technologies, Inc.') zedge_nat = object_identity((1, 3, 6, 1, 4, 1, 5504, 4, 1, 16)) if mibBuilder.loadTexts: zedgeNat.setStatus('current') nat_config_group = object_identity((1, 3, 6, 1, 4, 1, 5504, 4, 1, 16, 1)) if mibBuilder.loadTexts: natConfigGroup.setStatus('current') nat_tcp_timeout = mib_scalar((1, 3, 6, 1, 4, 1, 5504, 4, 1, 16, 1, 1), unsigned32().subtype(subtypeSpec=value_range_constraint(0, 604800))).setUnits('seconds').setMaxAccess('readwrite') if mibBuilder.loadTexts: natTcpTimeout.setStatus('current') nat_udp_timeout = mib_scalar((1, 3, 6, 1, 4, 1, 5504, 4, 1, 16, 1, 2), unsigned32().subtype(subtypeSpec=value_range_constraint(0, 604800))).setUnits('seconds').setMaxAccess('readwrite') if mibBuilder.loadTexts: natUdpTimeout.setStatus('current') nat_clear_bindings = mib_scalar((1, 3, 6, 1, 4, 1, 5504, 4, 1, 16, 1, 3), truth_value()).setMaxAccess('readwrite') if mibBuilder.loadTexts: natClearBindings.setStatus('current') nat_stats_group = object_identity((1, 3, 6, 1, 4, 1, 5504, 4, 1, 16, 2)) if mibBuilder.loadTexts: natStatsGroup.setStatus('current') nat_num_current_bindings = mib_scalar((1, 3, 6, 1, 4, 1, 5504, 4, 1, 16, 2, 1), gauge32()).setMaxAccess('readonly') if mibBuilder.loadTexts: natNumCurrentBindings.setStatus('current') nat_num_expired_bindings = mib_scalar((1, 3, 6, 1, 4, 1, 5504, 4, 1, 16, 2, 2), gauge32()).setMaxAccess('readonly') if mibBuilder.loadTexts: natNumExpiredBindings.setStatus('current') nat_total_pkts = mib_scalar((1, 3, 6, 1, 4, 1, 5504, 4, 1, 16, 2, 3), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: natTotalPkts.setStatus('current') nat_dropped_pkts = mib_scalar((1, 3, 6, 1, 4, 1, 5504, 4, 1, 16, 2, 4), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: natDroppedPkts.setStatus('current') nat_bindings_table = mib_table((1, 3, 6, 1, 4, 1, 5504, 4, 1, 16, 3)) if mibBuilder.loadTexts: natBindingsTable.setStatus('current') nat_bindings_entry = mib_table_row((1, 3, 6, 1, 4, 1, 5504, 4, 1, 16, 3, 1)).setIndexNames((0, 'ZHONE-COM-IP-ZEDGE-NAT-MIB', 'natBindingsIfIndex'), (0, 'ZHONE-COM-IP-ZEDGE-NAT-MIB', 'natBindingLocalAddr'), (0, 'ZHONE-COM-IP-ZEDGE-NAT-MIB', 'natBindingLocalPort'), (0, 'ZHONE-COM-IP-ZEDGE-NAT-MIB', 'natBindingPublicAddr'), (0, 'ZHONE-COM-IP-ZEDGE-NAT-MIB', 'natBindingPublicPort')) if mibBuilder.loadTexts: natBindingsEntry.setStatus('current') nat_bindings_if_index = mib_table_column((1, 3, 6, 1, 4, 1, 5504, 4, 1, 16, 3, 1, 1), interface_index()) if mibBuilder.loadTexts: natBindingsIfIndex.setStatus('current') nat_binding_local_addr = mib_table_column((1, 3, 6, 1, 4, 1, 5504, 4, 1, 16, 3, 1, 2), ip_address()) if mibBuilder.loadTexts: natBindingLocalAddr.setStatus('current') nat_binding_local_port = mib_table_column((1, 3, 6, 1, 4, 1, 5504, 4, 1, 16, 3, 1, 3), unsigned32()) if mibBuilder.loadTexts: natBindingLocalPort.setStatus('current') nat_binding_public_addr = mib_table_column((1, 3, 6, 1, 4, 1, 5504, 4, 1, 16, 3, 1, 4), ip_address()).setMaxAccess('readonly') if mibBuilder.loadTexts: natBindingPublicAddr.setStatus('current') nat_binding_public_port = mib_table_column((1, 3, 6, 1, 4, 1, 5504, 4, 1, 16, 3, 1, 5), unsigned32()).setMaxAccess('readonly') if mibBuilder.loadTexts: natBindingPublicPort.setStatus('current') zhone_pat_bindings = mib_identifier((1, 3, 6, 1, 4, 1, 5504, 4, 1, 16, 4)) pat_bind_next_index = mib_scalar((1, 3, 6, 1, 4, 1, 5504, 4, 1, 16, 4, 1), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: patBindNextIndex.setStatus('current') pat_table = mib_table((1, 3, 6, 1, 4, 1, 5504, 4, 1, 16, 4, 2)) if mibBuilder.loadTexts: patTable.setStatus('current') pat_entry = mib_table_row((1, 3, 6, 1, 4, 1, 5504, 4, 1, 16, 4, 2, 1)).setIndexNames((0, 'ZHONE-COM-IP-ZEDGE-NAT-MIB', 'zhonePATBindIndex')) if mibBuilder.loadTexts: patEntry.setStatus('current') zhone_pat_bind_index = mib_table_column((1, 3, 6, 1, 4, 1, 5504, 4, 1, 16, 4, 2, 1, 1), integer32().subtype(subtypeSpec=value_range_constraint(1, 4320))) if mibBuilder.loadTexts: zhonePATBindIndex.setStatus('current') zhone_pat_bind_row_status = mib_table_column((1, 3, 6, 1, 4, 1, 5504, 4, 1, 16, 4, 2, 1, 2), zhone_row_status()).setMaxAccess('readcreate') if mibBuilder.loadTexts: zhonePATBindRowStatus.setStatus('current') public_addr = mib_table_column((1, 3, 6, 1, 4, 1, 5504, 4, 1, 16, 4, 2, 1, 3), ip_address()).setMaxAccess('readcreate') if mibBuilder.loadTexts: publicAddr.setStatus('current') public_port = mib_table_column((1, 3, 6, 1, 4, 1, 5504, 4, 1, 16, 4, 2, 1, 4), integer32().subtype(subtypeSpec=value_range_constraint(51921, 56250))).setMaxAccess('readcreate') if mibBuilder.loadTexts: publicPort.setStatus('current') local_addr = mib_table_column((1, 3, 6, 1, 4, 1, 5504, 4, 1, 16, 4, 2, 1, 5), ip_address()).setMaxAccess('readcreate') if mibBuilder.loadTexts: localAddr.setStatus('current') local_port = mib_table_column((1, 3, 6, 1, 4, 1, 5504, 4, 1, 16, 4, 2, 1, 6), integer32().subtype(subtypeSpec=value_range_constraint(1, 49151))).setMaxAccess('readcreate') if mibBuilder.loadTexts: localPort.setStatus('current') port_type = mib_table_column((1, 3, 6, 1, 4, 1, 5504, 4, 1, 16, 4, 2, 1, 7), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3, 4))).clone(namedValues=named_values(('tcp', 1), ('udp', 2), ('cpemgr', 3), ('cpemgrsecure', 4))).clone('tcp')).setMaxAccess('readcreate') if mibBuilder.loadTexts: portType.setStatus('current') zhone_nat_exclusion = mib_identifier((1, 3, 6, 1, 4, 1, 5504, 4, 1, 16, 5)) nat_exclude_next_index = mib_scalar((1, 3, 6, 1, 4, 1, 5504, 4, 1, 16, 5, 1), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: natExcludeNextIndex.setStatus('current') nat_exclude_table = mib_table((1, 3, 6, 1, 4, 1, 5504, 4, 1, 16, 5, 2)) if mibBuilder.loadTexts: natExcludeTable.setStatus('current') nat_exclude_entry = mib_table_row((1, 3, 6, 1, 4, 1, 5504, 4, 1, 16, 5, 2, 1)).setIndexNames((0, 'ZHONE-COM-IP-ZEDGE-NAT-MIB', 'zhoneNATExcludeIndex')) if mibBuilder.loadTexts: natExcludeEntry.setStatus('current') zhone_nat_exclude_index = mib_table_column((1, 3, 6, 1, 4, 1, 5504, 4, 1, 16, 5, 2, 1, 1), integer32().subtype(subtypeSpec=value_range_constraint(1, 20))) if mibBuilder.loadTexts: zhoneNATExcludeIndex.setStatus('current') zhone_nat_exclude_row_status = mib_table_column((1, 3, 6, 1, 4, 1, 5504, 4, 1, 16, 5, 2, 1, 2), zhone_row_status()).setMaxAccess('readcreate') if mibBuilder.loadTexts: zhoneNATExcludeRowStatus.setStatus('current') ip_start_addr = mib_table_column((1, 3, 6, 1, 4, 1, 5504, 4, 1, 16, 5, 2, 1, 3), ip_address()).setMaxAccess('readcreate') if mibBuilder.loadTexts: ipStartAddr.setStatus('current') ip_end_addr = mib_table_column((1, 3, 6, 1, 4, 1, 5504, 4, 1, 16, 5, 2, 1, 4), ip_address()).setMaxAccess('readcreate') if mibBuilder.loadTexts: ipEndAddr.setStatus('current') mibBuilder.exportSymbols('ZHONE-COM-IP-ZEDGE-NAT-MIB', portType=portType, natBindingLocalAddr=natBindingLocalAddr, zedgeNat=zedgeNat, natBindingsIfIndex=natBindingsIfIndex, patEntry=patEntry, publicPort=publicPort, natClearBindings=natClearBindings, natNumExpiredBindings=natNumExpiredBindings, natBindingPublicPort=natBindingPublicPort, natTcpTimeout=natTcpTimeout, natBindingLocalPort=natBindingLocalPort, natStatsGroup=natStatsGroup, natExcludeTable=natExcludeTable, natBindingsTable=natBindingsTable, natExcludeNextIndex=natExcludeNextIndex, natBindingPublicAddr=natBindingPublicAddr, zhonePATBindings=zhonePATBindings, natDroppedPkts=natDroppedPkts, localPort=localPort, comIpZEdgeNat=comIpZEdgeNat, natExcludeEntry=natExcludeEntry, patTable=patTable, zhoneNATExclusion=zhoneNATExclusion, natConfigGroup=natConfigGroup, natUdpTimeout=natUdpTimeout, natBindingsEntry=natBindingsEntry, PYSNMP_MODULE_ID=comIpZEdgeNat, zhonePATBindRowStatus=zhonePATBindRowStatus, patBindNextIndex=patBindNextIndex, zhonePATBindIndex=zhonePATBindIndex, zhoneNATExcludeRowStatus=zhoneNATExcludeRowStatus, zhoneNATExcludeIndex=zhoneNATExcludeIndex, natNumCurrentBindings=natNumCurrentBindings, ipStartAddr=ipStartAddr, natTotalPkts=natTotalPkts, ipEndAddr=ipEndAddr, localAddr=localAddr, publicAddr=publicAddr)
# Data paths DATA_BACKGROUND_FOLDER = "../data/background/" DATA_GENERATED_FOLDER = "../data/generated_data/" # General settings IMAGES_TO_GENERATE = 500 COIN_RESIZE_RATIO_MIN = 0.4 COIN_RESIZE_RATIO_MAX = 0.6 # Background settings BACKGROUND_RESIZE_RATIO = 400 BACKGROUND_MAX_N_COINS = 25 # Coin crop settings MAX_COIN_OVERLAP_PERCENTAGE = 0.33 INDIVIDUAL_COIN_CROP_NOISE = 0.05
data_background_folder = '../data/background/' data_generated_folder = '../data/generated_data/' images_to_generate = 500 coin_resize_ratio_min = 0.4 coin_resize_ratio_max = 0.6 background_resize_ratio = 400 background_max_n_coins = 25 max_coin_overlap_percentage = 0.33 individual_coin_crop_noise = 0.05
""" This is the Blockchain Model class implementation """ class Blockchain: def __init__(self): self.current_transactions = [] self.chain = [] self.nodes = set() def __repr__(self): return '<Blockchain(chain={self.chain!r}, current_transactions={self.current_transactions!r})>'.format(self=self)
""" This is the Blockchain Model class implementation """ class Blockchain: def __init__(self): self.current_transactions = [] self.chain = [] self.nodes = set() def __repr__(self): return '<Blockchain(chain={self.chain!r}, current_transactions={self.current_transactions!r})>'.format(self=self)
#!/usr/bin/env python3 """Helper for finding threshold values for CO alarm.""" # The calculation is based of https://github.com/ElectronicCats/MICS4514-Croquette # and is not verified. LOAD_RESISTOR_OHM = 47000 VSUP = 3.3 VREF = 3.3 ADC_RESOLUTION_BITS = 10 def _main(): """Present the ppm value for each ADC raw value for the MiCS-4515.""" for adc in range(2 ** ADC_RESOLUTION_BITS): try: vco = (VREF * adc) / ((2 ** ADC_RESOLUTION_BITS) - 1) rco = LOAD_RESISTOR_OHM / ((VSUP - vco) / vco) conco = LOAD_RESISTOR_OHM / rco ppmco = 4.4138 * pow(conco, -1.178) except ZeroDivisionError: continue print('0x{0:04x} // {1} ppm CO'.format(adc, round(ppmco, 1))) if __name__ == "__main__": _main()
"""Helper for finding threshold values for CO alarm.""" load_resistor_ohm = 47000 vsup = 3.3 vref = 3.3 adc_resolution_bits = 10 def _main(): """Present the ppm value for each ADC raw value for the MiCS-4515.""" for adc in range(2 ** ADC_RESOLUTION_BITS): try: vco = VREF * adc / (2 ** ADC_RESOLUTION_BITS - 1) rco = LOAD_RESISTOR_OHM / ((VSUP - vco) / vco) conco = LOAD_RESISTOR_OHM / rco ppmco = 4.4138 * pow(conco, -1.178) except ZeroDivisionError: continue print('0x{0:04x} // {1} ppm CO'.format(adc, round(ppmco, 1))) if __name__ == '__main__': _main()
""" Given an array, find the nearest smaller element G[i] for every element A[i] in the array such that the element has an index smaller than i. More formally, G[i] for an element A[i] = an element A[j] such that j is maximum possible AND j < i AND A[j] < A[i] Elements for which no smaller element exist, consider next smaller element as -1. Example: Input : A : [4, 5, 2, 10, 8] Return : [-1, 4, -1, 2, 2] Example 2: Input : A : [3, 2, 1] Return : [-1, -1, -1] """ class Solution: # @param arr : list of integers # @return a list of integers def prevSmaller(self, arr): stack = [arr[0]] result = [-1] l = len(arr) for i in xrange(1, l): while stack and stack[len(stack) - 1] >= arr[i]: stack.pop() if stack: popped = stack.pop() stack.append(popped) stack.append(arr[i]) result.append(popped) else: stack.append(arr[i]) result.append(-1) return result
""" Given an array, find the nearest smaller element G[i] for every element A[i] in the array such that the element has an index smaller than i. More formally, G[i] for an element A[i] = an element A[j] such that j is maximum possible AND j < i AND A[j] < A[i] Elements for which no smaller element exist, consider next smaller element as -1. Example: Input : A : [4, 5, 2, 10, 8] Return : [-1, 4, -1, 2, 2] Example 2: Input : A : [3, 2, 1] Return : [-1, -1, -1] """ class Solution: def prev_smaller(self, arr): stack = [arr[0]] result = [-1] l = len(arr) for i in xrange(1, l): while stack and stack[len(stack) - 1] >= arr[i]: stack.pop() if stack: popped = stack.pop() stack.append(popped) stack.append(arr[i]) result.append(popped) else: stack.append(arr[i]) result.append(-1) return result
# Test values must be in the form [(text_input, expected_output), (text_input, expected_output), ...] test_values = [ ( "president", { "n": { "president", "presidentship", "presidencies", "presidency", "presidentships", "presidents", }, "r": {"presidentially"}, "a": {"presidential"}, "v": {"presiding", "presides", "preside", "presided"}, }, ), ( "elect", { "n": { "elector", "elects", "electors", "elective", "electorates", "elect", "electives", "elections", "electorate", "eligibility", "election", "eligibilities", }, "r": set(), "a": {"elect", "electoral", "elective", "eligible"}, "v": {"elect", "elects", "electing", "elected"}, }, ), ( "running", { "n": { "runninesses", "runnings", "runs", "running", "runniness", "runners", "runner", "run", }, "a": {"running", "runny"}, "v": {"running", "ran", "runs", "run"}, "r": set(), }, ), ( "run", { "n": { "runninesses", "runnings", "runs", "running", "runniness", "runners", "runner", "run", }, "a": {"running", "runny"}, "v": {"running", "ran", "runs", "run"}, "r": set(), }, ), ( "operations", { "n": { "operators", "operations", "operation", "operative", "operator", "operatives", }, "a": {"operant", "operative"}, "v": {"operated", "operating", "operate", "operates"}, "r": {"operatively"}, }, ), ( "operate", { "n": { "operators", "operations", "operation", "operative", "operator", "operatives", }, "a": {"operant", "operative"}, "v": {"operated", "operating", "operate", "operates"}, "r": {"operatively"}, }, ), ( "invest", { "n": { "investitures", "investors", "investiture", "investor", "investments", "investings", "investment", "investing", }, "a": set(), "v": {"invested", "invests", "invest", "investing"}, "r": set(), }, ), ( "investments", { "n": { "investitures", "investors", "investiture", "investor", "investments", "investings", "investment", "investing", }, "a": set(), "v": {"invested", "invests", "invest", "investing"}, "r": set(), }, ), ( "conjugation", { "n": {"conjugate", "conjugation", "conjugates", "conjugations"}, "a": {"conjugate"}, "v": {"conjugating", "conjugated", "conjugate", "conjugates"}, "r": set(), }, ), ( "do", { "n": {"does", "doer", "doers", "do"}, "a": set(), "v": { "doing", "don't", "does", "didn't", "do", "doesn't", "done", "did", }, "r": set(), }, ), ( "word", { "n": {"words", "word", "wordings", "wording"}, "a": set(), "v": {"words", "word", "worded", "wording"}, "r": set(), }, ), ( "love", { "a": {"lovable", "loveable"}, "n": {"love", "lover", "lovers", "loves"}, "r": set(), "v": {"love", "loved", "loves", "loving"}, }, ), ( "word", { "n": {"words", "word", "wordings", "wording"}, "a": set(), "v": {"words", "word", "worded", "wording"}, "r": set(), }, ), ( "verb", { "n": {"verbs", "verb"}, "a": {"verbal"}, "v": {"verbifying", "verbified", "verbify", "verbifies"}, "r": {"verbally"}, }, ), ( "genetic", { "n": {"geneticist", "genetics", "geneticists", "genes", "gene"}, "a": {"genic", "genetic", "genetical"}, "v": set(), "r": {"genetically"}, }, ), ( "politician", { "r": {"politically"}, "a": {"political"}, "n": {"politician", "politicians", "politics"}, "v": set(), }, ), ( "death", { "n": {"death", "dying", "deaths", "die", "dyings", "dice"}, "a": {"dying", "deathly"}, "v": {"died", "die", "dying", "dies"}, "r": {"deathly"}, }, ), ( "attitude", { "n": {"attitudes", "attitude"}, "a": set(), "v": { "attitudinise", "attitudinized", "attitudinize", "attitudinizes", "attitudinizing", }, "r": set(), }, ), ( "cheek", { "n": {"cheek", "cheekinesses", "cheeks", "cheekiness"}, "a": {"cheeky"}, "v": {"cheek", "cheeks", "cheeked", "cheeking"}, "r": {"cheekily"}, }, ), ( "world", { "n": {"worldliness", "world", "worldlinesses", "worlds"}, "a": {"worldly", "world"}, "v": set(), "r": set(), }, ), ("lake", {"n": {"lake", "lakes"}, "a": set(), "v": set(), "r": set()}), ( "guitar", { "n": {"guitarist", "guitarists", "guitar", "guitars"}, "a": set(), "v": set(), "r": set(), }, ), ( "presence", { "n": { "presenter", "present", "presents", "presentness", "presenters", "presentnesses", "presentments", "presentations", "presences", "presence", "presentment", "presentation", }, "a": {"present"}, "v": {"present", "presents", "presenting", "presented"}, "r": {"presently"}, }, ), ( "enthusiasm", { "n": {"enthusiasm", "enthusiasms"}, "a": {"enthusiastic"}, "v": set(), "r": {"enthusiastically"}, }, ), ( "organization", { "n": {"organizers", "organization", "organizations", "organizer"}, "a": set(), "v": {"organize", "organized", "organizing", "organizes"}, "r": set(), }, ), ( "player", { "n": { "plays", "playlet", "playings", "players", "playing", "playlets", "play", "player", }, "a": set(), "v": {"plays", "play", "playing", "played"}, "r": set(), }, ), ( "transportation", { "n": { "transporters", "transportation", "transportations", "transporter", "transport", "transports", }, "a": set(), "v": {"transport", "transporting", "transports", "transported"}, "r": set(), }, ), ( "television", { "n": {"televisions", "television"}, "a": set(), "v": {"televising", "televise", "televises", "televised"}, "r": set(), }, ), ( "cousin", {"n": {"cousins", "cousin"}, "a": {"cousinly"}, "v": set(), "r": set()}, ), ( "ability", {"n": {"abilities", "ability"}, "a": {"able"}, "v": set(), "r": {"ably"}}, ), ("chapter", {"n": {"chapters", "chapter"}, "a": set(), "v": set(), "r": set()}), ( "appearance", { "n": { "appearances", "apparitions", "appearance", "apparencies", "apparentness", "apparentnesses", "apparition", "apparency", }, "a": {"apparent"}, "v": {"appears", "appeared", "appear", "appearing"}, "r": {"apparently"}, }, ), ( "drawing", { "n": { "drawings", "drawers", "draws", "drawer", "drawees", "drawee", "draw", "drawing", }, "a": set(), "v": {"draws", "drew", "drawn", "draw", "drawing"}, "r": set(), }, ), ( "university", {"n": {"university", "universities"}, "a": set(), "v": set(), "r": set()}, ), ( "performance", { "n": { "performings", "performing", "performances", "performance", "performer", "performers", }, "a": set(), "v": {"performs", "performing", "performed", "perform"}, "r": set(), }, ), ("revenue", {"n": {"revenue", "revenues"}, "a": set(), "v": set(), "r": set()}), # Some Verbs ( "cling", { "n": {"cling", "clings"}, "a": set(), "v": {"clung", "cling", "clinging", "clings"}, "r": set(), }, ), ( "decrease", { "n": {"decrease", "decreases"}, "a": set(), "v": {"decrease", "decreases", "decreased", "decreasing"}, "r": set(), }, ), ( "wonder", { "n": { "wonder", "wonderment", "wonderments", "wonders", "wonderers", "wonderer", }, "a": {"wondrous"}, "v": {"wondering", "wonder", "wonders", "wondered"}, "r": {"wondrous", "wondrously"}, }, ), ( "rest", { "n": {"rest", "rests", "resters", "rester"}, "a": set(), "v": {"rest", "rests", "resting", "rested"}, "r": set(), }, ), ( "mutter", { "n": { "mutterer", "mutterers", "muttering", "mutter", "mutterings", "mutters", }, "a": set(), "v": {"muttering", "muttered", "mutters", "mutter"}, "r": set(), }, ), ( "implement", { "n": {"implementations", "implement", "implements", "implementation"}, "a": {"implemental"}, "v": {"implemented", "implement", "implements", "implementing"}, "r": set(), }, ), ( "evolve", { "n": {"evolution", "evolutions"}, "a": {"evolutionary"}, "v": {"evolved", "evolve", "evolves", "evolving"}, "r": {"evolutionarily"}, }, ), ( "allocate", { "n": {"allocations", "allocators", "allocation", "allocator"}, "a": {"allocable", "allocatable"}, "v": {"allocating", "allocates", "allocated", "allocate"}, "r": set(), }, ), ( "flood", { "n": {"flood", "flooding", "floodings", "floods"}, "a": set(), "v": {"flooding", "flooded", "flood", "floods"}, "r": set(), }, ), # Should there be `flooded` in 'a' here? ( "bow", { "n": {"bows", "bow"}, "a": set(), "v": {"bows", "bowing", "bowed", "bow"}, "r": set(), }, ), ( "advocate", { "n": { "advocates", "advocator", "advocacy", "advocacies", "advocators", "advocate", }, "a": set(), "v": {"advocates", "advocating", "advocated", "advocate"}, "r": set(), }, ), ( "divert", { "n": {"diversions", "diversionists", "diversionist", "diversion"}, "a": {"diversionary"}, "v": {"diverted", "diverts", "divert", "diverting"}, "r": set(), }, ), # Some adjectives ( "sweet", { "n": {"sweetnesses", "sweets", "sweetness", "sweet"}, "a": {"sweet"}, "v": set(), "r": {"sweet", "sweetly"}, }, ), ( "glossy", { "n": {"glossiness", "glossy", "glossies", "glossinesses"}, "a": {"glossy"}, "v": set(), "r": {"glossily"}, }, ), ( "relevant", { "n": {"relevancies", "relevance", "relevancy", "relevances"}, "a": {"relevant"}, "v": set(), "r": {"relevantly"}, }, ), ( "aloof", {"n": {"aloofnesses", "aloofness"}, "a": {"aloof"}, "v": set(), "r": {"aloof"}}, ), ( "therapeutic", { "n": { "therapists", "therapies", "therapy", "therapist", "therapeutic", "therapeutics", }, "a": {"therapeutical", "therapeutic"}, "v": set(), "r": {"therapeutically"}, }, ), ( "obviously", { "n": {"obviousnesses", "obviousness"}, "a": {"obvious"}, "v": set(), "r": {"obviously"}, }, ), ( "jumpy", { "n": {"jumpings", "jumpiness", "jumpinesses", "jump", "jumping", "jumps"}, "a": {"jumpy"}, "v": {"jump", "jumping", "jumped", "jumps"}, "r": set(), }, ), ( "venomous", {"n": {"venom", "venoms"}, "a": {"venomous"}, "v": set(), "r": {"venomously"}}, ), ( "laughable", { "n": {"laugher", "laughs", "laughers", "laugh"}, "a": {"laughable"}, "v": {"laughing", "laughs", "laughed", "laugh"}, "r": {"laughably"}, }, ), ( "demonic", { "n": {"demons", "demon", "demonizations", "demonization"}, "a": {"demonic"}, "v": {"demonized", "demonizing", "demonizes", "demonize"}, "r": set(), }, ), ( "knotty", { "n": {"knot", "knottiness", "knots", "knottinesses"}, "a": {"knotty"}, "v": {"knotted", "knotting", "knots", "knot"}, "r": set(), }, ), # Is `knottinesses` a valid plural? ( "little", { "n": {"little", "littlenesses", "littles", "littleness"}, "a": {"little"}, "v": set(), "r": {"little"}, }, ), # Is `littlenesses` a valid plural? ( "puzzling", { "n": { "puzzle", "puzzlers", "puzzler", "puzzlement", "puzzlements", "puzzles", }, "a": {"puzzling"}, "v": {"puzzle", "puzzled", "puzzles", "puzzling"}, "r": set(), }, ), ( "overrated", { "n": {"overratings", "overrating"}, "a": set(), "v": {"overrated", "overrating", "overrate", "overrates"}, "r": set(), }, ), ( "walk", { "n": {"walking", "walks", "walkings", "walker", "walk", "walkers"}, "a": {"walking"}, "v": {"walked", "walking", "walk", "walks"}, "r": set(), }, ), ( "walking", { "n": {"walking", "walks", "walkings", "walker", "walk", "walkers"}, "a": {"walking"}, "v": {"walked", "walking", "walk", "walks"}, "r": set(), }, ), ( "be", { "n": {"beings", "being"}, "a": set(), "v": { "wasn't", "being", "be", "are", "was", "am", "isn't", "is", "aren't", "been", "weren't", "were", "am not", }, "r": set(), }, ), ( "am", { "n": {"beings", "being"}, "a": set(), "v": { "wasn't", "being", "be", "are", "was", "am", "isn't", "is", "aren't", "been", "weren't", "were", "am not", }, "r": set(), }, ), ( "run", { "n": { "runnings", "run", "runninesses", "runner", "runniness", "running", "runs", "runners", }, "a": {"running", "runny"}, "v": {"running", "ran", "run", "runs"}, "r": set(), }, ), ( "ran", { "n": { "runnings", "run", "runninesses", "runner", "runniness", "running", "runs", "runners", }, "a": {"running", "runny"}, "v": {"running", "ran", "run", "runs"}, "r": set(), }, ), ( "blanket", { "n": {"blanket", "blankets"}, "a": {"blanket"}, "v": {"blankets", "blanketed", "blanketing", "blanket"}, "r": set(), }, ), ]
test_values = [('president', {'n': {'president', 'presidentship', 'presidencies', 'presidency', 'presidentships', 'presidents'}, 'r': {'presidentially'}, 'a': {'presidential'}, 'v': {'presiding', 'presides', 'preside', 'presided'}}), ('elect', {'n': {'elector', 'elects', 'electors', 'elective', 'electorates', 'elect', 'electives', 'elections', 'electorate', 'eligibility', 'election', 'eligibilities'}, 'r': set(), 'a': {'elect', 'electoral', 'elective', 'eligible'}, 'v': {'elect', 'elects', 'electing', 'elected'}}), ('running', {'n': {'runninesses', 'runnings', 'runs', 'running', 'runniness', 'runners', 'runner', 'run'}, 'a': {'running', 'runny'}, 'v': {'running', 'ran', 'runs', 'run'}, 'r': set()}), ('run', {'n': {'runninesses', 'runnings', 'runs', 'running', 'runniness', 'runners', 'runner', 'run'}, 'a': {'running', 'runny'}, 'v': {'running', 'ran', 'runs', 'run'}, 'r': set()}), ('operations', {'n': {'operators', 'operations', 'operation', 'operative', 'operator', 'operatives'}, 'a': {'operant', 'operative'}, 'v': {'operated', 'operating', 'operate', 'operates'}, 'r': {'operatively'}}), ('operate', {'n': {'operators', 'operations', 'operation', 'operative', 'operator', 'operatives'}, 'a': {'operant', 'operative'}, 'v': {'operated', 'operating', 'operate', 'operates'}, 'r': {'operatively'}}), ('invest', {'n': {'investitures', 'investors', 'investiture', 'investor', 'investments', 'investings', 'investment', 'investing'}, 'a': set(), 'v': {'invested', 'invests', 'invest', 'investing'}, 'r': set()}), ('investments', {'n': {'investitures', 'investors', 'investiture', 'investor', 'investments', 'investings', 'investment', 'investing'}, 'a': set(), 'v': {'invested', 'invests', 'invest', 'investing'}, 'r': set()}), ('conjugation', {'n': {'conjugate', 'conjugation', 'conjugates', 'conjugations'}, 'a': {'conjugate'}, 'v': {'conjugating', 'conjugated', 'conjugate', 'conjugates'}, 'r': set()}), ('do', {'n': {'does', 'doer', 'doers', 'do'}, 'a': set(), 'v': {'doing', "don't", 'does', "didn't", 'do', "doesn't", 'done', 'did'}, 'r': set()}), ('word', {'n': {'words', 'word', 'wordings', 'wording'}, 'a': set(), 'v': {'words', 'word', 'worded', 'wording'}, 'r': set()}), ('love', {'a': {'lovable', 'loveable'}, 'n': {'love', 'lover', 'lovers', 'loves'}, 'r': set(), 'v': {'love', 'loved', 'loves', 'loving'}}), ('word', {'n': {'words', 'word', 'wordings', 'wording'}, 'a': set(), 'v': {'words', 'word', 'worded', 'wording'}, 'r': set()}), ('verb', {'n': {'verbs', 'verb'}, 'a': {'verbal'}, 'v': {'verbifying', 'verbified', 'verbify', 'verbifies'}, 'r': {'verbally'}}), ('genetic', {'n': {'geneticist', 'genetics', 'geneticists', 'genes', 'gene'}, 'a': {'genic', 'genetic', 'genetical'}, 'v': set(), 'r': {'genetically'}}), ('politician', {'r': {'politically'}, 'a': {'political'}, 'n': {'politician', 'politicians', 'politics'}, 'v': set()}), ('death', {'n': {'death', 'dying', 'deaths', 'die', 'dyings', 'dice'}, 'a': {'dying', 'deathly'}, 'v': {'died', 'die', 'dying', 'dies'}, 'r': {'deathly'}}), ('attitude', {'n': {'attitudes', 'attitude'}, 'a': set(), 'v': {'attitudinise', 'attitudinized', 'attitudinize', 'attitudinizes', 'attitudinizing'}, 'r': set()}), ('cheek', {'n': {'cheek', 'cheekinesses', 'cheeks', 'cheekiness'}, 'a': {'cheeky'}, 'v': {'cheek', 'cheeks', 'cheeked', 'cheeking'}, 'r': {'cheekily'}}), ('world', {'n': {'worldliness', 'world', 'worldlinesses', 'worlds'}, 'a': {'worldly', 'world'}, 'v': set(), 'r': set()}), ('lake', {'n': {'lake', 'lakes'}, 'a': set(), 'v': set(), 'r': set()}), ('guitar', {'n': {'guitarist', 'guitarists', 'guitar', 'guitars'}, 'a': set(), 'v': set(), 'r': set()}), ('presence', {'n': {'presenter', 'present', 'presents', 'presentness', 'presenters', 'presentnesses', 'presentments', 'presentations', 'presences', 'presence', 'presentment', 'presentation'}, 'a': {'present'}, 'v': {'present', 'presents', 'presenting', 'presented'}, 'r': {'presently'}}), ('enthusiasm', {'n': {'enthusiasm', 'enthusiasms'}, 'a': {'enthusiastic'}, 'v': set(), 'r': {'enthusiastically'}}), ('organization', {'n': {'organizers', 'organization', 'organizations', 'organizer'}, 'a': set(), 'v': {'organize', 'organized', 'organizing', 'organizes'}, 'r': set()}), ('player', {'n': {'plays', 'playlet', 'playings', 'players', 'playing', 'playlets', 'play', 'player'}, 'a': set(), 'v': {'plays', 'play', 'playing', 'played'}, 'r': set()}), ('transportation', {'n': {'transporters', 'transportation', 'transportations', 'transporter', 'transport', 'transports'}, 'a': set(), 'v': {'transport', 'transporting', 'transports', 'transported'}, 'r': set()}), ('television', {'n': {'televisions', 'television'}, 'a': set(), 'v': {'televising', 'televise', 'televises', 'televised'}, 'r': set()}), ('cousin', {'n': {'cousins', 'cousin'}, 'a': {'cousinly'}, 'v': set(), 'r': set()}), ('ability', {'n': {'abilities', 'ability'}, 'a': {'able'}, 'v': set(), 'r': {'ably'}}), ('chapter', {'n': {'chapters', 'chapter'}, 'a': set(), 'v': set(), 'r': set()}), ('appearance', {'n': {'appearances', 'apparitions', 'appearance', 'apparencies', 'apparentness', 'apparentnesses', 'apparition', 'apparency'}, 'a': {'apparent'}, 'v': {'appears', 'appeared', 'appear', 'appearing'}, 'r': {'apparently'}}), ('drawing', {'n': {'drawings', 'drawers', 'draws', 'drawer', 'drawees', 'drawee', 'draw', 'drawing'}, 'a': set(), 'v': {'draws', 'drew', 'drawn', 'draw', 'drawing'}, 'r': set()}), ('university', {'n': {'university', 'universities'}, 'a': set(), 'v': set(), 'r': set()}), ('performance', {'n': {'performings', 'performing', 'performances', 'performance', 'performer', 'performers'}, 'a': set(), 'v': {'performs', 'performing', 'performed', 'perform'}, 'r': set()}), ('revenue', {'n': {'revenue', 'revenues'}, 'a': set(), 'v': set(), 'r': set()}), ('cling', {'n': {'cling', 'clings'}, 'a': set(), 'v': {'clung', 'cling', 'clinging', 'clings'}, 'r': set()}), ('decrease', {'n': {'decrease', 'decreases'}, 'a': set(), 'v': {'decrease', 'decreases', 'decreased', 'decreasing'}, 'r': set()}), ('wonder', {'n': {'wonder', 'wonderment', 'wonderments', 'wonders', 'wonderers', 'wonderer'}, 'a': {'wondrous'}, 'v': {'wondering', 'wonder', 'wonders', 'wondered'}, 'r': {'wondrous', 'wondrously'}}), ('rest', {'n': {'rest', 'rests', 'resters', 'rester'}, 'a': set(), 'v': {'rest', 'rests', 'resting', 'rested'}, 'r': set()}), ('mutter', {'n': {'mutterer', 'mutterers', 'muttering', 'mutter', 'mutterings', 'mutters'}, 'a': set(), 'v': {'muttering', 'muttered', 'mutters', 'mutter'}, 'r': set()}), ('implement', {'n': {'implementations', 'implement', 'implements', 'implementation'}, 'a': {'implemental'}, 'v': {'implemented', 'implement', 'implements', 'implementing'}, 'r': set()}), ('evolve', {'n': {'evolution', 'evolutions'}, 'a': {'evolutionary'}, 'v': {'evolved', 'evolve', 'evolves', 'evolving'}, 'r': {'evolutionarily'}}), ('allocate', {'n': {'allocations', 'allocators', 'allocation', 'allocator'}, 'a': {'allocable', 'allocatable'}, 'v': {'allocating', 'allocates', 'allocated', 'allocate'}, 'r': set()}), ('flood', {'n': {'flood', 'flooding', 'floodings', 'floods'}, 'a': set(), 'v': {'flooding', 'flooded', 'flood', 'floods'}, 'r': set()}), ('bow', {'n': {'bows', 'bow'}, 'a': set(), 'v': {'bows', 'bowing', 'bowed', 'bow'}, 'r': set()}), ('advocate', {'n': {'advocates', 'advocator', 'advocacy', 'advocacies', 'advocators', 'advocate'}, 'a': set(), 'v': {'advocates', 'advocating', 'advocated', 'advocate'}, 'r': set()}), ('divert', {'n': {'diversions', 'diversionists', 'diversionist', 'diversion'}, 'a': {'diversionary'}, 'v': {'diverted', 'diverts', 'divert', 'diverting'}, 'r': set()}), ('sweet', {'n': {'sweetnesses', 'sweets', 'sweetness', 'sweet'}, 'a': {'sweet'}, 'v': set(), 'r': {'sweet', 'sweetly'}}), ('glossy', {'n': {'glossiness', 'glossy', 'glossies', 'glossinesses'}, 'a': {'glossy'}, 'v': set(), 'r': {'glossily'}}), ('relevant', {'n': {'relevancies', 'relevance', 'relevancy', 'relevances'}, 'a': {'relevant'}, 'v': set(), 'r': {'relevantly'}}), ('aloof', {'n': {'aloofnesses', 'aloofness'}, 'a': {'aloof'}, 'v': set(), 'r': {'aloof'}}), ('therapeutic', {'n': {'therapists', 'therapies', 'therapy', 'therapist', 'therapeutic', 'therapeutics'}, 'a': {'therapeutical', 'therapeutic'}, 'v': set(), 'r': {'therapeutically'}}), ('obviously', {'n': {'obviousnesses', 'obviousness'}, 'a': {'obvious'}, 'v': set(), 'r': {'obviously'}}), ('jumpy', {'n': {'jumpings', 'jumpiness', 'jumpinesses', 'jump', 'jumping', 'jumps'}, 'a': {'jumpy'}, 'v': {'jump', 'jumping', 'jumped', 'jumps'}, 'r': set()}), ('venomous', {'n': {'venom', 'venoms'}, 'a': {'venomous'}, 'v': set(), 'r': {'venomously'}}), ('laughable', {'n': {'laugher', 'laughs', 'laughers', 'laugh'}, 'a': {'laughable'}, 'v': {'laughing', 'laughs', 'laughed', 'laugh'}, 'r': {'laughably'}}), ('demonic', {'n': {'demons', 'demon', 'demonizations', 'demonization'}, 'a': {'demonic'}, 'v': {'demonized', 'demonizing', 'demonizes', 'demonize'}, 'r': set()}), ('knotty', {'n': {'knot', 'knottiness', 'knots', 'knottinesses'}, 'a': {'knotty'}, 'v': {'knotted', 'knotting', 'knots', 'knot'}, 'r': set()}), ('little', {'n': {'little', 'littlenesses', 'littles', 'littleness'}, 'a': {'little'}, 'v': set(), 'r': {'little'}}), ('puzzling', {'n': {'puzzle', 'puzzlers', 'puzzler', 'puzzlement', 'puzzlements', 'puzzles'}, 'a': {'puzzling'}, 'v': {'puzzle', 'puzzled', 'puzzles', 'puzzling'}, 'r': set()}), ('overrated', {'n': {'overratings', 'overrating'}, 'a': set(), 'v': {'overrated', 'overrating', 'overrate', 'overrates'}, 'r': set()}), ('walk', {'n': {'walking', 'walks', 'walkings', 'walker', 'walk', 'walkers'}, 'a': {'walking'}, 'v': {'walked', 'walking', 'walk', 'walks'}, 'r': set()}), ('walking', {'n': {'walking', 'walks', 'walkings', 'walker', 'walk', 'walkers'}, 'a': {'walking'}, 'v': {'walked', 'walking', 'walk', 'walks'}, 'r': set()}), ('be', {'n': {'beings', 'being'}, 'a': set(), 'v': {"wasn't", 'being', 'be', 'are', 'was', 'am', "isn't", 'is', "aren't", 'been', "weren't", 'were', 'am not'}, 'r': set()}), ('am', {'n': {'beings', 'being'}, 'a': set(), 'v': {"wasn't", 'being', 'be', 'are', 'was', 'am', "isn't", 'is', "aren't", 'been', "weren't", 'were', 'am not'}, 'r': set()}), ('run', {'n': {'runnings', 'run', 'runninesses', 'runner', 'runniness', 'running', 'runs', 'runners'}, 'a': {'running', 'runny'}, 'v': {'running', 'ran', 'run', 'runs'}, 'r': set()}), ('ran', {'n': {'runnings', 'run', 'runninesses', 'runner', 'runniness', 'running', 'runs', 'runners'}, 'a': {'running', 'runny'}, 'v': {'running', 'ran', 'run', 'runs'}, 'r': set()}), ('blanket', {'n': {'blanket', 'blankets'}, 'a': {'blanket'}, 'v': {'blankets', 'blanketed', 'blanketing', 'blanket'}, 'r': set()})]
def simulate_accuracy_vs_stoptime(sigma, stop_time_list, num_sample): """Calculate the average decision accuracy vs. stopping time by running repeated SPRT simulations for each stop time. Args: sigma (float): standard deviation for observation model stop_list_list (list-like object): a list of stopping times to run over num_sample (int): number of simulations to run per stopping time Returns: accuracy_list: a list of average accuracies corresponding to input `stop_time_list` decisions_list: a list of decisions made in all trials """ # Determine true state (1 or -1) true_dist = 1 # Set up tracker of accuracy and decisions accuracies = np.zeros(len(stop_time_list),) decisions_list = [] # Loop over stop times for i_stop_time, stop_time in enumerate(stop_time_list): # Set up tracker of decisions for this stop time decisions = np.zeros((num_sample,)) # Loop over samples for i in range(num_sample): # Simulate run for this stop time (hint: last exercise) _, decision, _= simulate_SPRT_fixedtime(sigma, stop_time, true_dist) # Log decision decisions[i] = decision # Calculate accuracy accuracies[i_stop_time] = np.sum(decisions == true_dist) / decisions.shape[0] # Log decisions decisions_list.append(decisions) return accuracies, decisions_list # Set random seed np.random.seed(100) # Set parameters of model sigma = 4.65 # standard deviation for observation noise num_sample = 200 # number of simulations to run for each stopping time stop_time_list = np.arange(1, 150, 10) # Array of stopping times to use # Calculate accuracies for each stop time accuracies, _ = simulate_accuracy_vs_stoptime(sigma, stop_time_list, num_sample) # Visualize with plt.xkcd(): plot_accuracy_vs_stoptime(stop_time_list, accuracies)
def simulate_accuracy_vs_stoptime(sigma, stop_time_list, num_sample): """Calculate the average decision accuracy vs. stopping time by running repeated SPRT simulations for each stop time. Args: sigma (float): standard deviation for observation model stop_list_list (list-like object): a list of stopping times to run over num_sample (int): number of simulations to run per stopping time Returns: accuracy_list: a list of average accuracies corresponding to input `stop_time_list` decisions_list: a list of decisions made in all trials """ true_dist = 1 accuracies = np.zeros(len(stop_time_list)) decisions_list = [] for (i_stop_time, stop_time) in enumerate(stop_time_list): decisions = np.zeros((num_sample,)) for i in range(num_sample): (_, decision, _) = simulate_sprt_fixedtime(sigma, stop_time, true_dist) decisions[i] = decision accuracies[i_stop_time] = np.sum(decisions == true_dist) / decisions.shape[0] decisions_list.append(decisions) return (accuracies, decisions_list) np.random.seed(100) sigma = 4.65 num_sample = 200 stop_time_list = np.arange(1, 150, 10) (accuracies, _) = simulate_accuracy_vs_stoptime(sigma, stop_time_list, num_sample) with plt.xkcd(): plot_accuracy_vs_stoptime(stop_time_list, accuracies)
def myfunc(str): print(str) nstr = str.lower() for i in range(len(str)): nstr[i+1].upper() return nstr print(myfunc("SlseJbKWdOEuhB"))
def myfunc(str): print(str) nstr = str.lower() for i in range(len(str)): nstr[i + 1].upper() return nstr print(myfunc('SlseJbKWdOEuhB'))
''' @Coded by TSG, 2021 Problem: FizzBuzz is a well known programming assignment, asked during interviews. The given code solves the FizzBuzz problem and uses the words "Solo" and "Learn" instead of "Fizz" and "Buzz". It takes an input n and outputs the numbers from 1 to n. For each multiple of 3, print "Solo" instead of the number. For each multiple of 5, prints "Learn" instead of the number. For numbers which are multiples of both 3 and 5, output "SoloLearn". You need to change the code to skip the even numbers, so that the logic only applies to odd numbers in the range. ''' # your code goes here for x in range(1, int(input())): if x % 2 == 0: continue if x % 3 == 0 and x % 5 == 0: print("SoloLearn") elif x % 3 == 0: print("Solo") elif x % 5 == 0: print("Learn") else: print(x)
""" @Coded by TSG, 2021 Problem: FizzBuzz is a well known programming assignment, asked during interviews. The given code solves the FizzBuzz problem and uses the words "Solo" and "Learn" instead of "Fizz" and "Buzz". It takes an input n and outputs the numbers from 1 to n. For each multiple of 3, print "Solo" instead of the number. For each multiple of 5, prints "Learn" instead of the number. For numbers which are multiples of both 3 and 5, output "SoloLearn". You need to change the code to skip the even numbers, so that the logic only applies to odd numbers in the range. """ for x in range(1, int(input())): if x % 2 == 0: continue if x % 3 == 0 and x % 5 == 0: print('SoloLearn') elif x % 3 == 0: print('Solo') elif x % 5 == 0: print('Learn') else: print(x)
# # PySNMP MIB module HP-ICF-MLD-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/HP-ICF-MLD-MIB # Produced by pysmi-0.3.4 at Mon Apr 29 19:22:09 2019 # On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4 # Using Python version 3.7.3 (default, Mar 27 2019, 09:23:15) # OctetString, ObjectIdentifier, Integer = mibBuilder.importSymbols("ASN1", "OctetString", "ObjectIdentifier", "Integer") NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues") ConstraintsUnion, ConstraintsIntersection, SingleValueConstraint, ValueSizeConstraint, ValueRangeConstraint = mibBuilder.importSymbols("ASN1-REFINEMENT", "ConstraintsUnion", "ConstraintsIntersection", "SingleValueConstraint", "ValueSizeConstraint", "ValueRangeConstraint") hpSwitch, = mibBuilder.importSymbols("HP-ICF-OID", "hpSwitch") InterfaceIndex, = mibBuilder.importSymbols("IF-MIB", "InterfaceIndex") InetAddressIPv6, = mibBuilder.importSymbols("INET-ADDRESS-MIB", "InetAddressIPv6") mldInterfaceEntry, = mibBuilder.importSymbols("IPV6-MLD-MIB", "mldInterfaceEntry") PortList, = mibBuilder.importSymbols("Q-BRIDGE-MIB", "PortList") ModuleCompliance, NotificationGroup, ObjectGroup = mibBuilder.importSymbols("SNMPv2-CONF", "ModuleCompliance", "NotificationGroup", "ObjectGroup") Counter64, Integer32, Gauge32, Counter32, ModuleIdentity, Unsigned32, ObjectIdentity, NotificationType, IpAddress, TimeTicks, MibIdentifier, iso, MibScalar, MibTable, MibTableRow, MibTableColumn, Bits = mibBuilder.importSymbols("SNMPv2-SMI", "Counter64", "Integer32", "Gauge32", "Counter32", "ModuleIdentity", "Unsigned32", "ObjectIdentity", "NotificationType", "IpAddress", "TimeTicks", "MibIdentifier", "iso", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "Bits") RowStatus, TextualConvention, DisplayString, TruthValue = mibBuilder.importSymbols("SNMPv2-TC", "RowStatus", "TextualConvention", "DisplayString", "TruthValue") hpicfMldMIB = ModuleIdentity((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48)) hpicfMldMIB.setRevisions(('2015-09-11 00:00', '2013-02-10 00:00', '2011-03-10 00:00', '2011-01-11 00:00', '2010-09-09 00:00', '2007-07-02 00:00',)) if mibBuilder.loadTexts: hpicfMldMIB.setLastUpdated('201509110000Z') if mibBuilder.loadTexts: hpicfMldMIB.setOrganization('HP Networking') class HpicfMcastGroupTypeDefinition(TextualConvention, Integer32): status = 'current' subtypeSpec = Integer32.subtypeSpec + ConstraintsUnion(SingleValueConstraint(1, 2, 3)) namedValues = NamedValues(("standard", 1), ("filtered", 2), ("mini", 3)) class HpicfMldIfEntryState(TextualConvention, Integer32): status = 'current' subtypeSpec = Integer32.subtypeSpec + ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4)) namedValues = NamedValues(("initialWait", 1), ("querierElection", 2), ("querier", 3), ("nonQuerier", 4)) hpicfMldObjects = MibIdentifier((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 1)) hpicfMld = MibIdentifier((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 1, 1)) hpicfMldConformance = MibIdentifier((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 2)) hpicfMldGroups = MibIdentifier((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 2, 1)) hpicfMldCompliances = MibIdentifier((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 2, 2)) hpicfMldControlUnknownMulticast = MibScalar((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 1, 1, 1), TruthValue().clone('true')).setMaxAccess("readwrite") if mibBuilder.loadTexts: hpicfMldControlUnknownMulticast.setStatus('current') hpicfMldConfigForcedLeaveInterval = MibScalar((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 1, 1, 2), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 65535))).setMaxAccess("readwrite") if mibBuilder.loadTexts: hpicfMldConfigForcedLeaveInterval.setStatus('current') hpicfMldEnabledCount = MibScalar((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 1, 1, 3), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: hpicfMldEnabledCount.setStatus('current') hpicfMldMcastGroupJoinsCount = MibScalar((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 1, 1, 4), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: hpicfMldMcastGroupJoinsCount.setStatus('current') hpicfMldIfTable = MibTable((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 1, 1, 5), ) if mibBuilder.loadTexts: hpicfMldIfTable.setStatus('current') hpicfMldIfEntry = MibTableRow((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 1, 1, 5, 1), ) mldInterfaceEntry.registerAugmentions(("HP-ICF-MLD-MIB", "hpicfMldIfEntry")) hpicfMldIfEntry.setIndexNames(*mldInterfaceEntry.getIndexNames()) if mibBuilder.loadTexts: hpicfMldIfEntry.setStatus('current') hpicfMldIfEntryQuerierFeature = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 1, 1, 5, 1, 1), TruthValue().clone('true')).setMaxAccess("readwrite") if mibBuilder.loadTexts: hpicfMldIfEntryQuerierFeature.setStatus('current') hpicfMldIfEntrySnoopingFeature = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 1, 1, 5, 1, 2), TruthValue().clone('true')).setMaxAccess("readwrite") if mibBuilder.loadTexts: hpicfMldIfEntrySnoopingFeature.setStatus('current') hpicfMldIfEntryQuerierPort = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 1, 1, 5, 1, 3), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: hpicfMldIfEntryQuerierPort.setStatus('current') hpicfMldIfEntryFilteredJoins = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 1, 1, 5, 1, 4), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: hpicfMldIfEntryFilteredJoins.setStatus('current') hpicfMldIfEntryStandardJoins = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 1, 1, 5, 1, 5), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: hpicfMldIfEntryStandardJoins.setStatus('current') hpicfMldIfEntryPortsWithMcastRouter = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 1, 1, 5, 1, 6), PortList()).setMaxAccess("readonly") if mibBuilder.loadTexts: hpicfMldIfEntryPortsWithMcastRouter.setStatus('current') hpicfMldIfEntryStatGeneralQueryRx = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 1, 1, 5, 1, 7), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: hpicfMldIfEntryStatGeneralQueryRx.setStatus('current') hpicfMldIfEntryStatQueryTx = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 1, 1, 5, 1, 8), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: hpicfMldIfEntryStatQueryTx.setStatus('current') hpicfMldIfEntryStatGSQRx = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 1, 1, 5, 1, 9), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: hpicfMldIfEntryStatGSQRx.setStatus('current') hpicfMldIfEntryStatGSQTx = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 1, 1, 5, 1, 10), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: hpicfMldIfEntryStatGSQTx.setStatus('current') hpicfMldIfEntryStatMldV1ReportRx = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 1, 1, 5, 1, 11), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: hpicfMldIfEntryStatMldV1ReportRx.setStatus('current') hpicfMldIfEntryStatMldV2ReportRx = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 1, 1, 5, 1, 12), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: hpicfMldIfEntryStatMldV2ReportRx.setStatus('current') hpicfMldIfEntryStatMldV1LeaveRx = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 1, 1, 5, 1, 13), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: hpicfMldIfEntryStatMldV1LeaveRx.setStatus('current') hpicfMldIfEntryStatUnknownMldTypeRx = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 1, 1, 5, 1, 14), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: hpicfMldIfEntryStatUnknownMldTypeRx.setStatus('current') hpicfMldIfEntryStatUnknownPktRx = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 1, 1, 5, 1, 15), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: hpicfMldIfEntryStatUnknownPktRx.setStatus('current') hpicfMldIfEntryStatForwardToRoutersTx = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 1, 1, 5, 1, 16), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: hpicfMldIfEntryStatForwardToRoutersTx.setStatus('current') hpicfMldIfEntryStatForwardToAllPortsTx = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 1, 1, 5, 1, 17), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: hpicfMldIfEntryStatForwardToAllPortsTx.setStatus('current') hpicfMldIfEntryStatFastLeaves = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 1, 1, 5, 1, 18), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: hpicfMldIfEntryStatFastLeaves.setStatus('current') hpicfMldIfEntryStatForcedFastLeaves = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 1, 1, 5, 1, 19), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: hpicfMldIfEntryStatForcedFastLeaves.setStatus('current') hpicfMldIfEntryStatJoinTimeouts = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 1, 1, 5, 1, 20), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: hpicfMldIfEntryStatJoinTimeouts.setStatus('current') hpicfMldIfEntryStatWrongVersionQueries = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 1, 1, 5, 1, 21), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: hpicfMldIfEntryStatWrongVersionQueries.setStatus('current') hpicfMldIfEntryLastMemberQueryCount = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 1, 1, 5, 1, 22), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: hpicfMldIfEntryLastMemberQueryCount.setStatus('current') hpicfMldIfEntryStartupQueryCount = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 1, 1, 5, 1, 23), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: hpicfMldIfEntryStartupQueryCount.setStatus('current') hpicfMldIfEntryStartupQueryInterval = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 1, 1, 5, 1, 24), Unsigned32()).setUnits('seconds').setMaxAccess("readonly") if mibBuilder.loadTexts: hpicfMldIfEntryStartupQueryInterval.setStatus('current') hpicfMldIfEntryStatExcludeGroupJoinsCount = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 1, 1, 5, 1, 25), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: hpicfMldIfEntryStatExcludeGroupJoinsCount.setStatus('current') hpicfMldIfEntryStatIncludeGroupJoinsCount = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 1, 1, 5, 1, 26), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: hpicfMldIfEntryStatIncludeGroupJoinsCount.setStatus('current') hpicfMldIfEntryStatFilteredExcludeGroupJoinsCount = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 1, 1, 5, 1, 27), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: hpicfMldIfEntryStatFilteredExcludeGroupJoinsCount.setStatus('current') hpicfMldIfEntryStatFilteredIncludeGroupJoinsCount = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 1, 1, 5, 1, 28), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: hpicfMldIfEntryStatFilteredIncludeGroupJoinsCount.setStatus('current') hpicfMldIfEntryStatStandardExcludeGroupJoinsCount = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 1, 1, 5, 1, 29), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: hpicfMldIfEntryStatStandardExcludeGroupJoinsCount.setStatus('current') hpicfMldIfEntryStatStandardIncludeGroupJoinsCount = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 1, 1, 5, 1, 30), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: hpicfMldIfEntryStatStandardIncludeGroupJoinsCount.setStatus('current') hpicfMldIfEntryStatV1QueryTx = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 1, 1, 5, 1, 31), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: hpicfMldIfEntryStatV1QueryTx.setStatus('current') hpicfMldIfEntryStatV1QueryRx = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 1, 1, 5, 1, 32), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: hpicfMldIfEntryStatV1QueryRx.setStatus('current') hpicfMldIfEntryStatV2QueryTx = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 1, 1, 5, 1, 33), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: hpicfMldIfEntryStatV2QueryTx.setStatus('current') hpicfMldIfEntryStatV2QueryRx = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 1, 1, 5, 1, 34), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: hpicfMldIfEntryStatV2QueryRx.setStatus('current') hpicfMldIfEntryStatGSSQTx = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 1, 1, 5, 1, 35), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: hpicfMldIfEntryStatGSSQTx.setStatus('current') hpicfMldIfEntryStatGSSQRx = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 1, 1, 5, 1, 36), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: hpicfMldIfEntryStatGSSQRx.setStatus('current') hpicfMldIfEntryStatMalformedPktRx = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 1, 1, 5, 1, 37), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: hpicfMldIfEntryStatMalformedPktRx.setStatus('current') hpicfMldIfEntryStatBadCheckSumRx = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 1, 1, 5, 1, 38), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: hpicfMldIfEntryStatBadCheckSumRx.setStatus('current') hpicfMldIfEntryStatMartianSourceRx = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 1, 1, 5, 1, 39), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: hpicfMldIfEntryStatMartianSourceRx.setStatus('current') hpicfMldIfEntryStatPacketsRxOnDisabled = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 1, 1, 5, 1, 40), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: hpicfMldIfEntryStatPacketsRxOnDisabled.setStatus('current') hpicfMldIfEntryStrictVersionMode = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 1, 1, 5, 1, 41), TruthValue().clone('false')).setMaxAccess("readwrite") if mibBuilder.loadTexts: hpicfMldIfEntryStrictVersionMode.setStatus('current') hpicfMldIfEntryStatMldV1ReportTx = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 1, 1, 5, 1, 42), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: hpicfMldIfEntryStatMldV1ReportTx.setStatus('current') hpicfMldIfEntryStatMldV2ReportTx = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 1, 1, 5, 1, 43), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: hpicfMldIfEntryStatMldV2ReportTx.setStatus('current') hpicfMldIfEntryState = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 1, 1, 5, 1, 44), HpicfMldIfEntryState()).setMaxAccess("readonly") if mibBuilder.loadTexts: hpicfMldIfEntryState.setStatus('current') hpicfMldIfEntryStatV1GSQRx = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 1, 1, 5, 1, 45), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: hpicfMldIfEntryStatV1GSQRx.setStatus('current') hpicfMldIfEntryStatV1GSQTx = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 1, 1, 5, 1, 46), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: hpicfMldIfEntryStatV1GSQTx.setStatus('current') hpicfMldIfEntryStatV2GSQRx = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 1, 1, 5, 1, 47), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: hpicfMldIfEntryStatV2GSQRx.setStatus('current') hpicfMldIfEntryStatV2GSQTx = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 1, 1, 5, 1, 48), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: hpicfMldIfEntryStatV2GSQTx.setStatus('current') hpicfMldIfEntryStartupQueryExpiryTime = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 1, 1, 5, 1, 49), TimeTicks()).setMaxAccess("readonly") if mibBuilder.loadTexts: hpicfMldIfEntryStartupQueryExpiryTime.setStatus('current') hpicfMldIfEntryOtherQuerierInterval = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 1, 1, 5, 1, 50), Unsigned32()).setUnits('seconds').setMaxAccess("readonly") if mibBuilder.loadTexts: hpicfMldIfEntryOtherQuerierInterval.setStatus('current') hpicfMldIfEntryOtherQuerierExpiryTime = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 1, 1, 5, 1, 51), TimeTicks()).setMaxAccess("readonly") if mibBuilder.loadTexts: hpicfMldIfEntryOtherQuerierExpiryTime.setStatus('current') hpicfMldCacheTable = MibTable((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 1, 1, 6), ) if mibBuilder.loadTexts: hpicfMldCacheTable.setStatus('current') hpicfMldCacheEntry = MibTableRow((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 1, 1, 6, 1), ).setIndexNames((0, "HP-ICF-MLD-MIB", "hpicfMldCacheIfIndex"), (0, "HP-ICF-MLD-MIB", "hpicfMldCacheAddress")) if mibBuilder.loadTexts: hpicfMldCacheEntry.setStatus('current') hpicfMldCacheIfIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 1, 1, 6, 1, 1), InterfaceIndex()) if mibBuilder.loadTexts: hpicfMldCacheIfIndex.setStatus('current') hpicfMldCacheAddress = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 1, 1, 6, 1, 2), InetAddressIPv6().subtype(subtypeSpec=ValueSizeConstraint(16, 16)).setFixedLength(16)) if mibBuilder.loadTexts: hpicfMldCacheAddress.setStatus('current') hpicfMldCacheSelf = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 1, 1, 6, 1, 3), TruthValue().clone('true')).setMaxAccess("readcreate") if mibBuilder.loadTexts: hpicfMldCacheSelf.setStatus('current') hpicfMldCacheLastReporter = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 1, 1, 6, 1, 4), InetAddressIPv6().subtype(subtypeSpec=ValueSizeConstraint(16, 16)).setFixedLength(16)).setMaxAccess("readonly") if mibBuilder.loadTexts: hpicfMldCacheLastReporter.setStatus('current') hpicfMldCacheUpTime = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 1, 1, 6, 1, 5), TimeTicks()).setMaxAccess("readonly") if mibBuilder.loadTexts: hpicfMldCacheUpTime.setStatus('current') hpicfMldCacheExpiryTime = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 1, 1, 6, 1, 6), TimeTicks()).setMaxAccess("readonly") if mibBuilder.loadTexts: hpicfMldCacheExpiryTime.setStatus('current') hpicfMldGroupType = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 1, 1, 6, 1, 7), HpicfMcastGroupTypeDefinition()).setMaxAccess("readonly") if mibBuilder.loadTexts: hpicfMldGroupType.setStatus('current') hpicfJoinedPorts = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 1, 1, 6, 1, 8), PortList()).setMaxAccess("readonly") if mibBuilder.loadTexts: hpicfJoinedPorts.setStatus('current') hpicfMldCacheStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 1, 1, 6, 1, 9), RowStatus()).setMaxAccess("readcreate") if mibBuilder.loadTexts: hpicfMldCacheStatus.setStatus('current') hpicfMldCacheFilterMode = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 1, 1, 6, 1, 10), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("include", 1), ("exclude", 2)))).setMaxAccess("readonly") if mibBuilder.loadTexts: hpicfMldCacheFilterMode.setStatus('current') hpicfMldCacheExcludeModeExpiryTimer = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 1, 1, 6, 1, 11), TimeTicks()).setMaxAccess("readonly") if mibBuilder.loadTexts: hpicfMldCacheExcludeModeExpiryTimer.setStatus('current') hpicfMldCacheVersion1HostTimer = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 1, 1, 6, 1, 12), TimeTicks()).setMaxAccess("readonly") if mibBuilder.loadTexts: hpicfMldCacheVersion1HostTimer.setStatus('current') hpicfMldCacheSrcCount = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 1, 1, 6, 1, 13), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: hpicfMldCacheSrcCount.setStatus('current') class HpicfMldConfigPortModeType(TextualConvention, Integer32): status = 'current' subtypeSpec = Integer32.subtypeSpec + ConstraintsUnion(SingleValueConstraint(1, 2, 3)) namedValues = NamedValues(("auto", 1), ("blocked", 2), ("forward", 3)) hpicfMldPortConfigTable = MibTable((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 1, 1, 7), ) if mibBuilder.loadTexts: hpicfMldPortConfigTable.setStatus('current') hpicfMldPortConfigEntry = MibTableRow((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 1, 1, 7, 1), ).setIndexNames((0, "HP-ICF-MLD-MIB", "hpicfMldPortConfigEntryInterfaceIfIndex"), (0, "HP-ICF-MLD-MIB", "hpicfMldPortConfigEntryIndex")) if mibBuilder.loadTexts: hpicfMldPortConfigEntry.setStatus('current') hpicfMldPortConfigEntryInterfaceIfIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 1, 1, 7, 1, 1), InterfaceIndex()) if mibBuilder.loadTexts: hpicfMldPortConfigEntryInterfaceIfIndex.setStatus('current') hpicfMldPortConfigEntryIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 1, 1, 7, 1, 2), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 65535))) if mibBuilder.loadTexts: hpicfMldPortConfigEntryIndex.setStatus('current') hpicfMldPortConfigEntryPortModeFeature = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 1, 1, 7, 1, 3), HpicfMldConfigPortModeType()).setMaxAccess("readwrite") if mibBuilder.loadTexts: hpicfMldPortConfigEntryPortModeFeature.setStatus('current') hpicfMldPortConfigEntryForcedLeaveFeature = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 1, 1, 7, 1, 4), TruthValue()).setMaxAccess("readwrite") if mibBuilder.loadTexts: hpicfMldPortConfigEntryForcedLeaveFeature.setStatus('current') hpicfMldPortConfigEntryFastLeaveFeature = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 1, 1, 7, 1, 5), TruthValue()).setMaxAccess("readwrite") if mibBuilder.loadTexts: hpicfMldPortConfigEntryFastLeaveFeature.setStatus('current') hpicfMldFilteredGroupPortCacheTable = MibTable((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 1, 1, 8), ) if mibBuilder.loadTexts: hpicfMldFilteredGroupPortCacheTable.setStatus('current') hpicfMldFilteredGroupPortCacheEntry = MibTableRow((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 1, 1, 8, 1), ).setIndexNames((0, "HP-ICF-MLD-MIB", "hpicfMldFilteredGroupPortCacheIfIndex"), (0, "HP-ICF-MLD-MIB", "hpicfMldFilteredGroupPortCacheGroupAddress"), (0, "HP-ICF-MLD-MIB", "hpicfMldFilteredGroupPortCachePortIndex")) if mibBuilder.loadTexts: hpicfMldFilteredGroupPortCacheEntry.setStatus('current') hpicfMldFilteredGroupPortCacheIfIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 1, 1, 8, 1, 1), InterfaceIndex()) if mibBuilder.loadTexts: hpicfMldFilteredGroupPortCacheIfIndex.setStatus('current') hpicfMldFilteredGroupPortCacheGroupAddress = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 1, 1, 8, 1, 2), InetAddressIPv6()) if mibBuilder.loadTexts: hpicfMldFilteredGroupPortCacheGroupAddress.setStatus('current') hpicfMldFilteredGroupPortCachePortIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 1, 1, 8, 1, 3), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 65535))) if mibBuilder.loadTexts: hpicfMldFilteredGroupPortCachePortIndex.setStatus('current') hpicfMldFilteredGroupPortCacheExpiryTime = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 1, 1, 8, 1, 4), TimeTicks()).setMaxAccess("readonly") if mibBuilder.loadTexts: hpicfMldFilteredGroupPortCacheExpiryTime.setStatus('current') hpicfMldSrcListTable = MibTable((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 1, 1, 9), ) if mibBuilder.loadTexts: hpicfMldSrcListTable.setStatus('current') hpicfMldSrcListEntry = MibTableRow((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 1, 1, 9, 1), ).setIndexNames((0, "HP-ICF-MLD-MIB", "hpicfMldSrcListIfIndex"), (0, "HP-ICF-MLD-MIB", "hpicfMldSrcListAddress"), (0, "HP-ICF-MLD-MIB", "hpicfMldSrcListHostAddress")) if mibBuilder.loadTexts: hpicfMldSrcListEntry.setStatus('current') hpicfMldSrcListIfIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 1, 1, 9, 1, 1), InterfaceIndex()) if mibBuilder.loadTexts: hpicfMldSrcListIfIndex.setStatus('current') hpicfMldSrcListAddress = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 1, 1, 9, 1, 2), InetAddressIPv6().subtype(subtypeSpec=ValueSizeConstraint(16, 16)).setFixedLength(16)) if mibBuilder.loadTexts: hpicfMldSrcListAddress.setStatus('current') hpicfMldSrcListHostAddress = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 1, 1, 9, 1, 3), InetAddressIPv6().subtype(subtypeSpec=ValueSizeConstraint(16, 16)).setFixedLength(16)) if mibBuilder.loadTexts: hpicfMldSrcListHostAddress.setStatus('current') hpicfMldSrcListPorts = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 1, 1, 9, 1, 4), PortList()).setMaxAccess("readonly") if mibBuilder.loadTexts: hpicfMldSrcListPorts.setStatus('current') hpicfMldSrcListExpiry = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 1, 1, 9, 1, 5), TimeTicks()).setMaxAccess("readonly") if mibBuilder.loadTexts: hpicfMldSrcListExpiry.setStatus('current') hpicfMldSrcListUpTime = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 1, 1, 9, 1, 6), TimeTicks()).setMaxAccess("readonly") if mibBuilder.loadTexts: hpicfMldSrcListUpTime.setStatus('current') hpicfMldSrcListType = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 1, 1, 9, 1, 7), HpicfMcastGroupTypeDefinition()).setMaxAccess("readonly") if mibBuilder.loadTexts: hpicfMldSrcListType.setStatus('current') hpicfMldPortSrcTable = MibTable((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 1, 1, 10), ) if mibBuilder.loadTexts: hpicfMldPortSrcTable.setStatus('current') hpicfMldPortSrcEntry = MibTableRow((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 1, 1, 10, 1), ).setIndexNames((0, "HP-ICF-MLD-MIB", "hpicfMldPortSrcIfIndex"), (0, "HP-ICF-MLD-MIB", "hpicfMldPortSrcAddress"), (0, "HP-ICF-MLD-MIB", "hpicfMldPortSrcHostAddress"), (0, "HP-ICF-MLD-MIB", "hpicfMldPortSrcPortIndex")) if mibBuilder.loadTexts: hpicfMldPortSrcEntry.setStatus('current') hpicfMldPortSrcIfIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 1, 1, 10, 1, 1), InterfaceIndex()) if mibBuilder.loadTexts: hpicfMldPortSrcIfIndex.setStatus('current') hpicfMldPortSrcAddress = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 1, 1, 10, 1, 2), InetAddressIPv6().subtype(subtypeSpec=ValueSizeConstraint(16, 16)).setFixedLength(16)) if mibBuilder.loadTexts: hpicfMldPortSrcAddress.setStatus('current') hpicfMldPortSrcHostAddress = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 1, 1, 10, 1, 3), InetAddressIPv6().subtype(subtypeSpec=ValueSizeConstraint(16, 16)).setFixedLength(16)) if mibBuilder.loadTexts: hpicfMldPortSrcHostAddress.setStatus('current') hpicfMldPortSrcPortIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 1, 1, 10, 1, 4), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 65535))) if mibBuilder.loadTexts: hpicfMldPortSrcPortIndex.setStatus('current') hpicfMldPortSrcExpiry = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 1, 1, 10, 1, 5), TimeTicks()).setMaxAccess("readonly") if mibBuilder.loadTexts: hpicfMldPortSrcExpiry.setStatus('current') hpicfMldPortSrcUpTime = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 1, 1, 10, 1, 6), TimeTicks()).setMaxAccess("readonly") if mibBuilder.loadTexts: hpicfMldPortSrcUpTime.setStatus('current') hpicfMldPortSrcFilterMode = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 1, 1, 10, 1, 7), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("include", 1), ("exclude", 2)))).setMaxAccess("readonly") if mibBuilder.loadTexts: hpicfMldPortSrcFilterMode.setStatus('current') hpicfMldMcastExcludeGroupJoinsCount = MibScalar((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 1, 1, 11), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: hpicfMldMcastExcludeGroupJoinsCount.setStatus('current') hpicfMldMcastIncludeGroupJoinsCount = MibScalar((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 1, 1, 12), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: hpicfMldMcastIncludeGroupJoinsCount.setStatus('current') hpicfMldMcastPortFastLearn = MibScalar((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 1, 1, 13), PortList()).setMaxAccess("readwrite") if mibBuilder.loadTexts: hpicfMldMcastPortFastLearn.setStatus('current') hpicfMldGroupPortCacheTable = MibTable((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 1, 1, 14), ) if mibBuilder.loadTexts: hpicfMldGroupPortCacheTable.setStatus('current') hpicfMldGroupPortCacheEntry = MibTableRow((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 1, 1, 14, 1), ).setIndexNames((0, "HP-ICF-MLD-MIB", "hpicfMldGroupPortCacheIfIndex"), (0, "HP-ICF-MLD-MIB", "hpicfMldGroupPortCacheGroupAddress"), (0, "HP-ICF-MLD-MIB", "hpicfMldGroupPortCachePortIndex")) if mibBuilder.loadTexts: hpicfMldGroupPortCacheEntry.setStatus('current') hpicfMldGroupPortCacheIfIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 1, 1, 14, 1, 1), InterfaceIndex()) if mibBuilder.loadTexts: hpicfMldGroupPortCacheIfIndex.setStatus('current') hpicfMldGroupPortCacheGroupAddress = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 1, 1, 14, 1, 2), InetAddressIPv6()) if mibBuilder.loadTexts: hpicfMldGroupPortCacheGroupAddress.setStatus('current') hpicfMldGroupPortCachePortIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 1, 1, 14, 1, 3), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 65535))) if mibBuilder.loadTexts: hpicfMldGroupPortCachePortIndex.setStatus('current') hpicfMldGroupPortCacheExpiryTime = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 1, 1, 14, 1, 4), TimeTicks()).setMaxAccess("readonly") if mibBuilder.loadTexts: hpicfMldGroupPortCacheExpiryTime.setStatus('current') hpicfMldGroupPortCacheUpTime = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 1, 1, 14, 1, 5), TimeTicks()).setMaxAccess("readonly") if mibBuilder.loadTexts: hpicfMldGroupPortCacheUpTime.setStatus('current') hpicfMldGroupPortCacheVersion1Timer = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 1, 1, 14, 1, 6), TimeTicks()).setMaxAccess("readonly") if mibBuilder.loadTexts: hpicfMldGroupPortCacheVersion1Timer.setStatus('current') hpicfMldGroupPortCacheFilterTimer = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 1, 1, 14, 1, 7), TimeTicks()).setMaxAccess("readonly") if mibBuilder.loadTexts: hpicfMldGroupPortCacheFilterTimer.setStatus('current') hpicfMldGroupPortCacheFilterMode = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 1, 1, 14, 1, 8), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("include", 1), ("exclude", 2)))).setMaxAccess("readonly") if mibBuilder.loadTexts: hpicfMldGroupPortCacheFilterMode.setStatus('current') hpicfMldGroupPortCacheExcludeSrcCount = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 1, 1, 14, 1, 9), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: hpicfMldGroupPortCacheExcludeSrcCount.setStatus('current') hpicfMldGroupPortCacheRequestedSrcCount = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 1, 1, 14, 1, 10), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: hpicfMldGroupPortCacheRequestedSrcCount.setStatus('current') hpicfMldReload = MibScalar((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 1, 1, 15), TruthValue().clone('false')).setMaxAccess("readwrite") if mibBuilder.loadTexts: hpicfMldReload.setStatus('current') hpicfMldBaseGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 2, 1, 1)).setObjects(("HP-ICF-MLD-MIB", "hpicfMldControlUnknownMulticast"), ("HP-ICF-MLD-MIB", "hpicfMldConfigForcedLeaveInterval"), ("HP-ICF-MLD-MIB", "hpicfMldEnabledCount"), ("HP-ICF-MLD-MIB", "hpicfMldMcastGroupJoinsCount")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): hpicfMldBaseGroup = hpicfMldBaseGroup.setStatus('current') hpicfMldIfGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 2, 1, 2)).setObjects(("HP-ICF-MLD-MIB", "hpicfMldIfEntryQuerierFeature"), ("HP-ICF-MLD-MIB", "hpicfMldIfEntrySnoopingFeature"), ("HP-ICF-MLD-MIB", "hpicfMldIfEntryQuerierPort"), ("HP-ICF-MLD-MIB", "hpicfMldIfEntryFilteredJoins"), ("HP-ICF-MLD-MIB", "hpicfMldIfEntryStandardJoins"), ("HP-ICF-MLD-MIB", "hpicfMldIfEntryPortsWithMcastRouter"), ("HP-ICF-MLD-MIB", "hpicfMldIfEntryStatGeneralQueryRx"), ("HP-ICF-MLD-MIB", "hpicfMldIfEntryStatQueryTx"), ("HP-ICF-MLD-MIB", "hpicfMldIfEntryStatGSQRx"), ("HP-ICF-MLD-MIB", "hpicfMldIfEntryStatGSQTx"), ("HP-ICF-MLD-MIB", "hpicfMldIfEntryStatMldV1ReportRx"), ("HP-ICF-MLD-MIB", "hpicfMldIfEntryStatMldV2ReportRx"), ("HP-ICF-MLD-MIB", "hpicfMldIfEntryStatMldV1LeaveRx"), ("HP-ICF-MLD-MIB", "hpicfMldIfEntryStatUnknownMldTypeRx"), ("HP-ICF-MLD-MIB", "hpicfMldIfEntryStatUnknownPktRx"), ("HP-ICF-MLD-MIB", "hpicfMldIfEntryStatForwardToRoutersTx"), ("HP-ICF-MLD-MIB", "hpicfMldIfEntryStatForwardToAllPortsTx"), ("HP-ICF-MLD-MIB", "hpicfMldIfEntryStatFastLeaves"), ("HP-ICF-MLD-MIB", "hpicfMldIfEntryStatForcedFastLeaves"), ("HP-ICF-MLD-MIB", "hpicfMldIfEntryStatJoinTimeouts")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): hpicfMldIfGroup = hpicfMldIfGroup.setStatus('current') hpicfMldCacheGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 2, 1, 3)).setObjects(("HP-ICF-MLD-MIB", "hpicfMldCacheSelf"), ("HP-ICF-MLD-MIB", "hpicfMldCacheLastReporter"), ("HP-ICF-MLD-MIB", "hpicfMldCacheUpTime"), ("HP-ICF-MLD-MIB", "hpicfMldCacheExpiryTime"), ("HP-ICF-MLD-MIB", "hpicfMldGroupType"), ("HP-ICF-MLD-MIB", "hpicfJoinedPorts"), ("HP-ICF-MLD-MIB", "hpicfMldCacheStatus")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): hpicfMldCacheGroup = hpicfMldCacheGroup.setStatus('current') hpicfMldPortGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 2, 1, 4)).setObjects(("HP-ICF-MLD-MIB", "hpicfMldPortConfigEntryPortModeFeature"), ("HP-ICF-MLD-MIB", "hpicfMldPortConfigEntryForcedLeaveFeature"), ("HP-ICF-MLD-MIB", "hpicfMldPortConfigEntryFastLeaveFeature")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): hpicfMldPortGroup = hpicfMldPortGroup.setStatus('current') hpicfMldFilteredGroupPortCacheGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 2, 1, 5)).setObjects(("HP-ICF-MLD-MIB", "hpicfMldFilteredGroupPortCacheExpiryTime")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): hpicfMldFilteredGroupPortCacheGroup = hpicfMldFilteredGroupPortCacheGroup.setStatus('current') hpicfMldBaseGroupV2 = ObjectGroup((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 2, 1, 6)).setObjects(("HP-ICF-MLD-MIB", "hpicfMldControlUnknownMulticast"), ("HP-ICF-MLD-MIB", "hpicfMldConfigForcedLeaveInterval"), ("HP-ICF-MLD-MIB", "hpicfMldEnabledCount"), ("HP-ICF-MLD-MIB", "hpicfMldMcastGroupJoinsCount"), ("HP-ICF-MLD-MIB", "hpicfMldMcastExcludeGroupJoinsCount"), ("HP-ICF-MLD-MIB", "hpicfMldMcastIncludeGroupJoinsCount"), ("HP-ICF-MLD-MIB", "hpicfMldMcastPortFastLearn")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): hpicfMldBaseGroupV2 = hpicfMldBaseGroupV2.setStatus('current') hpicfMldIfGroupV2 = ObjectGroup((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 2, 1, 7)).setObjects(("HP-ICF-MLD-MIB", "hpicfMldIfEntryQuerierFeature"), ("HP-ICF-MLD-MIB", "hpicfMldIfEntrySnoopingFeature"), ("HP-ICF-MLD-MIB", "hpicfMldIfEntryQuerierPort"), ("HP-ICF-MLD-MIB", "hpicfMldIfEntryFilteredJoins"), ("HP-ICF-MLD-MIB", "hpicfMldIfEntryStandardJoins"), ("HP-ICF-MLD-MIB", "hpicfMldIfEntryPortsWithMcastRouter"), ("HP-ICF-MLD-MIB", "hpicfMldIfEntryStatGeneralQueryRx"), ("HP-ICF-MLD-MIB", "hpicfMldIfEntryStatQueryTx"), ("HP-ICF-MLD-MIB", "hpicfMldIfEntryStatGSQRx"), ("HP-ICF-MLD-MIB", "hpicfMldIfEntryStatGSQTx"), ("HP-ICF-MLD-MIB", "hpicfMldIfEntryStatMldV1ReportRx"), ("HP-ICF-MLD-MIB", "hpicfMldIfEntryStatMldV2ReportRx"), ("HP-ICF-MLD-MIB", "hpicfMldIfEntryStatMldV1LeaveRx"), ("HP-ICF-MLD-MIB", "hpicfMldIfEntryStatUnknownMldTypeRx"), ("HP-ICF-MLD-MIB", "hpicfMldIfEntryStatUnknownPktRx"), ("HP-ICF-MLD-MIB", "hpicfMldIfEntryStatForwardToRoutersTx"), ("HP-ICF-MLD-MIB", "hpicfMldIfEntryStatForwardToAllPortsTx"), ("HP-ICF-MLD-MIB", "hpicfMldIfEntryStatFastLeaves"), ("HP-ICF-MLD-MIB", "hpicfMldIfEntryStatForcedFastLeaves"), ("HP-ICF-MLD-MIB", "hpicfMldIfEntryStatJoinTimeouts"), ("HP-ICF-MLD-MIB", "hpicfMldIfEntryStatWrongVersionQueries"), ("HP-ICF-MLD-MIB", "hpicfMldIfEntryLastMemberQueryCount"), ("HP-ICF-MLD-MIB", "hpicfMldIfEntryStartupQueryCount"), ("HP-ICF-MLD-MIB", "hpicfMldIfEntryStartupQueryInterval"), ("HP-ICF-MLD-MIB", "hpicfMldIfEntryStatExcludeGroupJoinsCount"), ("HP-ICF-MLD-MIB", "hpicfMldIfEntryStatIncludeGroupJoinsCount"), ("HP-ICF-MLD-MIB", "hpicfMldIfEntryStatFilteredExcludeGroupJoinsCount"), ("HP-ICF-MLD-MIB", "hpicfMldIfEntryStatFilteredIncludeGroupJoinsCount"), ("HP-ICF-MLD-MIB", "hpicfMldIfEntryStatStandardExcludeGroupJoinsCount"), ("HP-ICF-MLD-MIB", "hpicfMldIfEntryStatStandardIncludeGroupJoinsCount"), ("HP-ICF-MLD-MIB", "hpicfMldIfEntryStatV1QueryTx"), ("HP-ICF-MLD-MIB", "hpicfMldIfEntryStatV1QueryRx"), ("HP-ICF-MLD-MIB", "hpicfMldIfEntryStatV2QueryTx"), ("HP-ICF-MLD-MIB", "hpicfMldIfEntryStatV2QueryRx"), ("HP-ICF-MLD-MIB", "hpicfMldIfEntryStatGSSQTx"), ("HP-ICF-MLD-MIB", "hpicfMldIfEntryStatGSSQRx"), ("HP-ICF-MLD-MIB", "hpicfMldIfEntryStatMalformedPktRx"), ("HP-ICF-MLD-MIB", "hpicfMldIfEntryStatBadCheckSumRx"), ("HP-ICF-MLD-MIB", "hpicfMldIfEntryStatMartianSourceRx"), ("HP-ICF-MLD-MIB", "hpicfMldIfEntryStatPacketsRxOnDisabled"), ("HP-ICF-MLD-MIB", "hpicfMldIfEntryStrictVersionMode"), ("HP-ICF-MLD-MIB", "hpicfMldIfEntryStatMldV1ReportTx"), ("HP-ICF-MLD-MIB", "hpicfMldIfEntryStatMldV2ReportTx"), ("HP-ICF-MLD-MIB", "hpicfMldIfEntryState"), ("HP-ICF-MLD-MIB", "hpicfMldIfEntryStatV1GSQRx"), ("HP-ICF-MLD-MIB", "hpicfMldIfEntryStatV1GSQTx"), ("HP-ICF-MLD-MIB", "hpicfMldIfEntryStatV2GSQRx"), ("HP-ICF-MLD-MIB", "hpicfMldIfEntryStatV2GSQTx")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): hpicfMldIfGroupV2 = hpicfMldIfGroupV2.setStatus('current') hpicfMldCacheGroupV2 = ObjectGroup((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 2, 1, 8)).setObjects(("HP-ICF-MLD-MIB", "hpicfMldCacheSelf"), ("HP-ICF-MLD-MIB", "hpicfMldCacheLastReporter"), ("HP-ICF-MLD-MIB", "hpicfMldCacheUpTime"), ("HP-ICF-MLD-MIB", "hpicfMldCacheExpiryTime"), ("HP-ICF-MLD-MIB", "hpicfMldGroupType"), ("HP-ICF-MLD-MIB", "hpicfJoinedPorts"), ("HP-ICF-MLD-MIB", "hpicfMldCacheStatus"), ("HP-ICF-MLD-MIB", "hpicfMldCacheFilterMode"), ("HP-ICF-MLD-MIB", "hpicfMldCacheExcludeModeExpiryTimer"), ("HP-ICF-MLD-MIB", "hpicfMldCacheVersion1HostTimer"), ("HP-ICF-MLD-MIB", "hpicfMldCacheSrcCount")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): hpicfMldCacheGroupV2 = hpicfMldCacheGroupV2.setStatus('current') hpicfMldSrcListGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 2, 1, 9)).setObjects(("HP-ICF-MLD-MIB", "hpicfMldSrcListPorts"), ("HP-ICF-MLD-MIB", "hpicfMldSrcListExpiry"), ("HP-ICF-MLD-MIB", "hpicfMldSrcListUpTime"), ("HP-ICF-MLD-MIB", "hpicfMldSrcListType")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): hpicfMldSrcListGroup = hpicfMldSrcListGroup.setStatus('current') hpicfMldPortSrcGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 2, 1, 10)).setObjects(("HP-ICF-MLD-MIB", "hpicfMldPortSrcExpiry"), ("HP-ICF-MLD-MIB", "hpicfMldPortSrcUpTime"), ("HP-ICF-MLD-MIB", "hpicfMldPortSrcFilterMode")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): hpicfMldPortSrcGroup = hpicfMldPortSrcGroup.setStatus('current') hpicfMldGroupPortCacheGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 2, 1, 11)).setObjects(("HP-ICF-MLD-MIB", "hpicfMldGroupPortCacheExpiryTime"), ("HP-ICF-MLD-MIB", "hpicfMldGroupPortCacheUpTime"), ("HP-ICF-MLD-MIB", "hpicfMldGroupPortCacheVersion1Timer"), ("HP-ICF-MLD-MIB", "hpicfMldGroupPortCacheFilterTimer"), ("HP-ICF-MLD-MIB", "hpicfMldGroupPortCacheFilterMode"), ("HP-ICF-MLD-MIB", "hpicfMldGroupPortCacheExcludeSrcCount"), ("HP-ICF-MLD-MIB", "hpicfMldGroupPortCacheRequestedSrcCount")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): hpicfMldGroupPortCacheGroup = hpicfMldGroupPortCacheGroup.setStatus('current') hpicfMldIfGroupV3 = ObjectGroup((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 2, 1, 12)).setObjects(("HP-ICF-MLD-MIB", "hpicfMldIfEntryQuerierFeature"), ("HP-ICF-MLD-MIB", "hpicfMldIfEntrySnoopingFeature"), ("HP-ICF-MLD-MIB", "hpicfMldIfEntryQuerierPort"), ("HP-ICF-MLD-MIB", "hpicfMldIfEntryFilteredJoins"), ("HP-ICF-MLD-MIB", "hpicfMldIfEntryStandardJoins"), ("HP-ICF-MLD-MIB", "hpicfMldIfEntryPortsWithMcastRouter"), ("HP-ICF-MLD-MIB", "hpicfMldIfEntryStatGeneralQueryRx"), ("HP-ICF-MLD-MIB", "hpicfMldIfEntryStatQueryTx"), ("HP-ICF-MLD-MIB", "hpicfMldIfEntryStatGSQRx"), ("HP-ICF-MLD-MIB", "hpicfMldIfEntryStatGSQTx"), ("HP-ICF-MLD-MIB", "hpicfMldIfEntryStatMldV1ReportRx"), ("HP-ICF-MLD-MIB", "hpicfMldIfEntryStatMldV2ReportRx"), ("HP-ICF-MLD-MIB", "hpicfMldIfEntryStatMldV1LeaveRx"), ("HP-ICF-MLD-MIB", "hpicfMldIfEntryStatUnknownMldTypeRx"), ("HP-ICF-MLD-MIB", "hpicfMldIfEntryStatUnknownPktRx"), ("HP-ICF-MLD-MIB", "hpicfMldIfEntryStatForwardToRoutersTx"), ("HP-ICF-MLD-MIB", "hpicfMldIfEntryStatForwardToAllPortsTx"), ("HP-ICF-MLD-MIB", "hpicfMldIfEntryStatFastLeaves"), ("HP-ICF-MLD-MIB", "hpicfMldIfEntryStatForcedFastLeaves"), ("HP-ICF-MLD-MIB", "hpicfMldIfEntryStatJoinTimeouts"), ("HP-ICF-MLD-MIB", "hpicfMldIfEntryStatWrongVersionQueries"), ("HP-ICF-MLD-MIB", "hpicfMldIfEntryLastMemberQueryCount"), ("HP-ICF-MLD-MIB", "hpicfMldIfEntryStartupQueryCount"), ("HP-ICF-MLD-MIB", "hpicfMldIfEntryStartupQueryInterval"), ("HP-ICF-MLD-MIB", "hpicfMldIfEntryStatExcludeGroupJoinsCount"), ("HP-ICF-MLD-MIB", "hpicfMldIfEntryStatIncludeGroupJoinsCount"), ("HP-ICF-MLD-MIB", "hpicfMldIfEntryStatFilteredExcludeGroupJoinsCount"), ("HP-ICF-MLD-MIB", "hpicfMldIfEntryStatFilteredIncludeGroupJoinsCount"), ("HP-ICF-MLD-MIB", "hpicfMldIfEntryStatStandardExcludeGroupJoinsCount"), ("HP-ICF-MLD-MIB", "hpicfMldIfEntryStatStandardIncludeGroupJoinsCount"), ("HP-ICF-MLD-MIB", "hpicfMldIfEntryStatV1QueryTx"), ("HP-ICF-MLD-MIB", "hpicfMldIfEntryStatV1QueryRx"), ("HP-ICF-MLD-MIB", "hpicfMldIfEntryStatV2QueryTx"), ("HP-ICF-MLD-MIB", "hpicfMldIfEntryStatV2QueryRx"), ("HP-ICF-MLD-MIB", "hpicfMldIfEntryStatGSSQTx"), ("HP-ICF-MLD-MIB", "hpicfMldIfEntryStatGSSQRx"), ("HP-ICF-MLD-MIB", "hpicfMldIfEntryStatMalformedPktRx"), ("HP-ICF-MLD-MIB", "hpicfMldIfEntryStatBadCheckSumRx"), ("HP-ICF-MLD-MIB", "hpicfMldIfEntryStatMartianSourceRx"), ("HP-ICF-MLD-MIB", "hpicfMldIfEntryStatPacketsRxOnDisabled"), ("HP-ICF-MLD-MIB", "hpicfMldIfEntryStrictVersionMode"), ("HP-ICF-MLD-MIB", "hpicfMldIfEntryStatMldV1ReportTx"), ("HP-ICF-MLD-MIB", "hpicfMldIfEntryStatMldV2ReportTx"), ("HP-ICF-MLD-MIB", "hpicfMldIfEntryState"), ("HP-ICF-MLD-MIB", "hpicfMldIfEntryStatV1GSQRx"), ("HP-ICF-MLD-MIB", "hpicfMldIfEntryStatV1GSQTx"), ("HP-ICF-MLD-MIB", "hpicfMldIfEntryStatV2GSQRx"), ("HP-ICF-MLD-MIB", "hpicfMldIfEntryStatV2GSQTx"), ("HP-ICF-MLD-MIB", "hpicfMldIfEntryStartupQueryExpiryTime"), ("HP-ICF-MLD-MIB", "hpicfMldIfEntryOtherQuerierInterval"), ("HP-ICF-MLD-MIB", "hpicfMldIfEntryOtherQuerierExpiryTime")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): hpicfMldIfGroupV3 = hpicfMldIfGroupV3.setStatus('current') hpicfMldReloadModeGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 2, 1, 13)).setObjects(("HP-ICF-MLD-MIB", "hpicfMldReload")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): hpicfMldReloadModeGroup = hpicfMldReloadModeGroup.setStatus('current') hpicfMldMIBCompliance = ModuleCompliance((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 2, 2, 1)).setObjects(("HP-ICF-MLD-MIB", "hpicfMldBaseGroup"), ("HP-ICF-MLD-MIB", "hpicfMldIfGroup"), ("HP-ICF-MLD-MIB", "hpicfMldCacheGroup"), ("HP-ICF-MLD-MIB", "hpicfMldPortGroup"), ("HP-ICF-MLD-MIB", "hpicfMldFilteredGroupPortCacheGroup")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): hpicfMldMIBCompliance = hpicfMldMIBCompliance.setStatus('current') hpicfMldMIBComplianceV2 = ModuleCompliance((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 2, 2, 2)).setObjects(("HP-ICF-MLD-MIB", "hpicfMldBaseGroupV2"), ("HP-ICF-MLD-MIB", "hpicfMldIfGroupV2"), ("HP-ICF-MLD-MIB", "hpicfMldCacheGroupV2"), ("HP-ICF-MLD-MIB", "hpicfMldPortGroup"), ("HP-ICF-MLD-MIB", "hpicfMldFilteredGroupPortCacheGroup"), ("HP-ICF-MLD-MIB", "hpicfMldSrcListGroup"), ("HP-ICF-MLD-MIB", "hpicfMldPortSrcGroup"), ("HP-ICF-MLD-MIB", "hpicfMldGroupPortCacheGroup")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): hpicfMldMIBComplianceV2 = hpicfMldMIBComplianceV2.setStatus('current') hpicfMldMIBComplianceV3 = ModuleCompliance((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 2, 2, 3)).setObjects(("HP-ICF-MLD-MIB", "hpicfMldBaseGroupV2"), ("HP-ICF-MLD-MIB", "hpicfMldIfGroupV3"), ("HP-ICF-MLD-MIB", "hpicfMldCacheGroupV2"), ("HP-ICF-MLD-MIB", "hpicfMldPortGroup"), ("HP-ICF-MLD-MIB", "hpicfMldFilteredGroupPortCacheGroup"), ("HP-ICF-MLD-MIB", "hpicfMldSrcListGroup"), ("HP-ICF-MLD-MIB", "hpicfMldPortSrcGroup"), ("HP-ICF-MLD-MIB", "hpicfMldGroupPortCacheGroup"), ("HP-ICF-MLD-MIB", "hpicfMldReloadModeGroup")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): hpicfMldMIBComplianceV3 = hpicfMldMIBComplianceV3.setStatus('current') mibBuilder.exportSymbols("HP-ICF-MLD-MIB", hpicfMldPortSrcExpiry=hpicfMldPortSrcExpiry, hpicfMldPortSrcAddress=hpicfMldPortSrcAddress, hpicfMldCacheAddress=hpicfMldCacheAddress, hpicfMldSrcListEntry=hpicfMldSrcListEntry, hpicfMldPortConfigTable=hpicfMldPortConfigTable, hpicfMldIfEntryPortsWithMcastRouter=hpicfMldIfEntryPortsWithMcastRouter, hpicfMldFilteredGroupPortCacheGroup=hpicfMldFilteredGroupPortCacheGroup, hpicfMldBaseGroupV2=hpicfMldBaseGroupV2, hpicfMldIfEntryStatGSSQRx=hpicfMldIfEntryStatGSSQRx, hpicfMldCacheTable=hpicfMldCacheTable, hpicfJoinedPorts=hpicfJoinedPorts, hpicfMldCacheSelf=hpicfMldCacheSelf, hpicfMldMIBComplianceV3=hpicfMldMIBComplianceV3, hpicfMldIfEntryStandardJoins=hpicfMldIfEntryStandardJoins, hpicfMldIfEntryStatV1GSQRx=hpicfMldIfEntryStatV1GSQRx, hpicfMldIfEntryStartupQueryExpiryTime=hpicfMldIfEntryStartupQueryExpiryTime, hpicfMldIfEntryStatUnknownMldTypeRx=hpicfMldIfEntryStatUnknownMldTypeRx, hpicfMldIfEntryQuerierPort=hpicfMldIfEntryQuerierPort, hpicfMldMcastExcludeGroupJoinsCount=hpicfMldMcastExcludeGroupJoinsCount, hpicfMldIfGroupV3=hpicfMldIfGroupV3, hpicfMldPortConfigEntryInterfaceIfIndex=hpicfMldPortConfigEntryInterfaceIfIndex, hpicfMldSrcListAddress=hpicfMldSrcListAddress, hpicfMldFilteredGroupPortCachePortIndex=hpicfMldFilteredGroupPortCachePortIndex, hpicfMldGroupPortCacheFilterTimer=hpicfMldGroupPortCacheFilterTimer, hpicfMldIfEntryStatFilteredIncludeGroupJoinsCount=hpicfMldIfEntryStatFilteredIncludeGroupJoinsCount, hpicfMldConformance=hpicfMldConformance, hpicfMldIfEntryStatGSSQTx=hpicfMldIfEntryStatGSSQTx, hpicfMldIfEntryStatExcludeGroupJoinsCount=hpicfMldIfEntryStatExcludeGroupJoinsCount, hpicfMldIfEntryLastMemberQueryCount=hpicfMldIfEntryLastMemberQueryCount, hpicfMldIfEntryStatForwardToAllPortsTx=hpicfMldIfEntryStatForwardToAllPortsTx, hpicfMldCacheSrcCount=hpicfMldCacheSrcCount, hpicfMldFilteredGroupPortCacheExpiryTime=hpicfMldFilteredGroupPortCacheExpiryTime, hpicfMldCacheFilterMode=hpicfMldCacheFilterMode, hpicfMldSrcListExpiry=hpicfMldSrcListExpiry, hpicfMldCacheGroupV2=hpicfMldCacheGroupV2, hpicfMldCacheExcludeModeExpiryTimer=hpicfMldCacheExcludeModeExpiryTimer, hpicfMldPortConfigEntryIndex=hpicfMldPortConfigEntryIndex, hpicfMldGroupPortCacheUpTime=hpicfMldGroupPortCacheUpTime, hpicfMldCacheGroup=hpicfMldCacheGroup, PYSNMP_MODULE_ID=hpicfMldMIB, hpicfMldIfEntryStatV2GSQTx=hpicfMldIfEntryStatV2GSQTx, hpicfMldCacheIfIndex=hpicfMldCacheIfIndex, hpicfMldGroupPortCacheEntry=hpicfMldGroupPortCacheEntry, hpicfMldIfEntryState=hpicfMldIfEntryState, hpicfMldGroupPortCacheRequestedSrcCount=hpicfMldGroupPortCacheRequestedSrcCount, hpicfMldIfTable=hpicfMldIfTable, hpicfMldMcastPortFastLearn=hpicfMldMcastPortFastLearn, hpicfMldIfEntryStatV2GSQRx=hpicfMldIfEntryStatV2GSQRx, hpicfMldReloadModeGroup=hpicfMldReloadModeGroup, hpicfMldIfEntryStatFilteredExcludeGroupJoinsCount=hpicfMldIfEntryStatFilteredExcludeGroupJoinsCount, hpicfMldIfEntryStatFastLeaves=hpicfMldIfEntryStatFastLeaves, hpicfMldIfEntrySnoopingFeature=hpicfMldIfEntrySnoopingFeature, HpicfMcastGroupTypeDefinition=HpicfMcastGroupTypeDefinition, hpicfMldSrcListType=hpicfMldSrcListType, hpicfMldPortConfigEntryFastLeaveFeature=hpicfMldPortConfigEntryFastLeaveFeature, hpicfMldIfEntryStatMldV1ReportTx=hpicfMldIfEntryStatMldV1ReportTx, hpicfMldCacheUpTime=hpicfMldCacheUpTime, hpicfMldMIBCompliance=hpicfMldMIBCompliance, hpicfMldPortGroup=hpicfMldPortGroup, hpicfMldIfEntryStatBadCheckSumRx=hpicfMldIfEntryStatBadCheckSumRx, hpicfMldIfEntryStatForcedFastLeaves=hpicfMldIfEntryStatForcedFastLeaves, hpicfMldGroups=hpicfMldGroups, hpicfMldPortSrcFilterMode=hpicfMldPortSrcFilterMode, hpicfMldEnabledCount=hpicfMldEnabledCount, hpicfMldIfEntryStatMldV1ReportRx=hpicfMldIfEntryStatMldV1ReportRx, hpicfMldCacheExpiryTime=hpicfMldCacheExpiryTime, hpicfMldMIBComplianceV2=hpicfMldMIBComplianceV2, hpicfMldCacheVersion1HostTimer=hpicfMldCacheVersion1HostTimer, hpicfMldCompliances=hpicfMldCompliances, hpicfMldSrcListHostAddress=hpicfMldSrcListHostAddress, hpicfMldFilteredGroupPortCacheIfIndex=hpicfMldFilteredGroupPortCacheIfIndex, hpicfMldCacheLastReporter=hpicfMldCacheLastReporter, hpicfMldGroupPortCacheTable=hpicfMldGroupPortCacheTable, hpicfMldCacheStatus=hpicfMldCacheStatus, hpicfMldGroupPortCacheGroup=hpicfMldGroupPortCacheGroup, hpicfMldControlUnknownMulticast=hpicfMldControlUnknownMulticast, hpicfMldIfEntryStatPacketsRxOnDisabled=hpicfMldIfEntryStatPacketsRxOnDisabled, hpicfMldPortSrcIfIndex=hpicfMldPortSrcIfIndex, hpicfMldIfEntryStatGSQRx=hpicfMldIfEntryStatGSQRx, hpicfMldMcastGroupJoinsCount=hpicfMldMcastGroupJoinsCount, hpicfMldSrcListIfIndex=hpicfMldSrcListIfIndex, hpicfMldGroupPortCachePortIndex=hpicfMldGroupPortCachePortIndex, hpicfMldPortSrcHostAddress=hpicfMldPortSrcHostAddress, hpicfMldPortSrcGroup=hpicfMldPortSrcGroup, hpicfMldIfEntryStatForwardToRoutersTx=hpicfMldIfEntryStatForwardToRoutersTx, hpicfMldGroupPortCacheFilterMode=hpicfMldGroupPortCacheFilterMode, hpicfMldIfEntryStatStandardExcludeGroupJoinsCount=hpicfMldIfEntryStatStandardExcludeGroupJoinsCount, hpicfMldIfEntryOtherQuerierInterval=hpicfMldIfEntryOtherQuerierInterval, hpicfMldFilteredGroupPortCacheGroupAddress=hpicfMldFilteredGroupPortCacheGroupAddress, hpicfMldMIB=hpicfMldMIB, hpicfMldSrcListUpTime=hpicfMldSrcListUpTime, hpicfMldConfigForcedLeaveInterval=hpicfMldConfigForcedLeaveInterval, hpicfMldGroupPortCacheExcludeSrcCount=hpicfMldGroupPortCacheExcludeSrcCount, hpicfMldIfEntryStatMldV2ReportTx=hpicfMldIfEntryStatMldV2ReportTx, hpicfMldIfEntryStatUnknownPktRx=hpicfMldIfEntryStatUnknownPktRx, hpicfMldIfEntryStatStandardIncludeGroupJoinsCount=hpicfMldIfEntryStatStandardIncludeGroupJoinsCount, hpicfMldIfGroupV2=hpicfMldIfGroupV2, hpicfMldIfEntryStatMldV1LeaveRx=hpicfMldIfEntryStatMldV1LeaveRx, hpicfMldIfEntryStartupQueryInterval=hpicfMldIfEntryStartupQueryInterval, hpicfMldIfEntryStatMalformedPktRx=hpicfMldIfEntryStatMalformedPktRx, hpicfMldReload=hpicfMldReload, HpicfMldIfEntryState=HpicfMldIfEntryState, hpicfMldIfEntryStatWrongVersionQueries=hpicfMldIfEntryStatWrongVersionQueries, hpicfMldMcastIncludeGroupJoinsCount=hpicfMldMcastIncludeGroupJoinsCount, hpicfMldIfEntryStatV1QueryRx=hpicfMldIfEntryStatV1QueryRx, hpicfMldIfEntryQuerierFeature=hpicfMldIfEntryQuerierFeature, hpicfMldIfEntryStrictVersionMode=hpicfMldIfEntryStrictVersionMode, hpicfMldGroupPortCacheExpiryTime=hpicfMldGroupPortCacheExpiryTime, hpicfMldIfEntryStatQueryTx=hpicfMldIfEntryStatQueryTx, hpicfMldIfEntryStatIncludeGroupJoinsCount=hpicfMldIfEntryStatIncludeGroupJoinsCount, hpicfMldPortConfigEntryPortModeFeature=hpicfMldPortConfigEntryPortModeFeature, hpicfMldIfEntry=hpicfMldIfEntry, hpicfMldSrcListGroup=hpicfMldSrcListGroup, hpicfMldIfEntryStatV1GSQTx=hpicfMldIfEntryStatV1GSQTx, hpicfMldCacheEntry=hpicfMldCacheEntry, hpicfMldIfEntryStatGeneralQueryRx=hpicfMldIfEntryStatGeneralQueryRx, hpicfMldIfEntryStatV2QueryTx=hpicfMldIfEntryStatV2QueryTx, hpicfMldSrcListTable=hpicfMldSrcListTable, hpicfMldPortSrcEntry=hpicfMldPortSrcEntry, hpicfMldPortSrcUpTime=hpicfMldPortSrcUpTime, hpicfMldPortSrcPortIndex=hpicfMldPortSrcPortIndex, hpicfMldIfEntryStatV2QueryRx=hpicfMldIfEntryStatV2QueryRx, hpicfMldGroupType=hpicfMldGroupType, hpicfMldIfEntryFilteredJoins=hpicfMldIfEntryFilteredJoins, hpicfMldFilteredGroupPortCacheEntry=hpicfMldFilteredGroupPortCacheEntry, hpicfMldIfEntryStatMartianSourceRx=hpicfMldIfEntryStatMartianSourceRx, hpicfMldIfEntryStatJoinTimeouts=hpicfMldIfEntryStatJoinTimeouts, hpicfMldIfEntryStatGSQTx=hpicfMldIfEntryStatGSQTx, hpicfMldIfEntryStatV1QueryTx=hpicfMldIfEntryStatV1QueryTx, hpicfMldGroupPortCacheIfIndex=hpicfMldGroupPortCacheIfIndex, hpicfMldGroupPortCacheGroupAddress=hpicfMldGroupPortCacheGroupAddress, hpicfMldPortConfigEntry=hpicfMldPortConfigEntry, HpicfMldConfigPortModeType=HpicfMldConfigPortModeType, hpicfMldObjects=hpicfMldObjects, hpicfMld=hpicfMld, hpicfMldIfEntryStartupQueryCount=hpicfMldIfEntryStartupQueryCount, hpicfMldPortConfigEntryForcedLeaveFeature=hpicfMldPortConfigEntryForcedLeaveFeature, hpicfMldPortSrcTable=hpicfMldPortSrcTable, hpicfMldBaseGroup=hpicfMldBaseGroup, hpicfMldIfGroup=hpicfMldIfGroup, hpicfMldFilteredGroupPortCacheTable=hpicfMldFilteredGroupPortCacheTable, hpicfMldGroupPortCacheVersion1Timer=hpicfMldGroupPortCacheVersion1Timer, hpicfMldIfEntryOtherQuerierExpiryTime=hpicfMldIfEntryOtherQuerierExpiryTime, hpicfMldSrcListPorts=hpicfMldSrcListPorts, hpicfMldIfEntryStatMldV2ReportRx=hpicfMldIfEntryStatMldV2ReportRx)
(octet_string, object_identifier, integer) = mibBuilder.importSymbols('ASN1', 'OctetString', 'ObjectIdentifier', 'Integer') (named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues') (constraints_union, constraints_intersection, single_value_constraint, value_size_constraint, value_range_constraint) = mibBuilder.importSymbols('ASN1-REFINEMENT', 'ConstraintsUnion', 'ConstraintsIntersection', 'SingleValueConstraint', 'ValueSizeConstraint', 'ValueRangeConstraint') (hp_switch,) = mibBuilder.importSymbols('HP-ICF-OID', 'hpSwitch') (interface_index,) = mibBuilder.importSymbols('IF-MIB', 'InterfaceIndex') (inet_address_i_pv6,) = mibBuilder.importSymbols('INET-ADDRESS-MIB', 'InetAddressIPv6') (mld_interface_entry,) = mibBuilder.importSymbols('IPV6-MLD-MIB', 'mldInterfaceEntry') (port_list,) = mibBuilder.importSymbols('Q-BRIDGE-MIB', 'PortList') (module_compliance, notification_group, object_group) = mibBuilder.importSymbols('SNMPv2-CONF', 'ModuleCompliance', 'NotificationGroup', 'ObjectGroup') (counter64, integer32, gauge32, counter32, module_identity, unsigned32, object_identity, notification_type, ip_address, time_ticks, mib_identifier, iso, mib_scalar, mib_table, mib_table_row, mib_table_column, bits) = mibBuilder.importSymbols('SNMPv2-SMI', 'Counter64', 'Integer32', 'Gauge32', 'Counter32', 'ModuleIdentity', 'Unsigned32', 'ObjectIdentity', 'NotificationType', 'IpAddress', 'TimeTicks', 'MibIdentifier', 'iso', 'MibScalar', 'MibTable', 'MibTableRow', 'MibTableColumn', 'Bits') (row_status, textual_convention, display_string, truth_value) = mibBuilder.importSymbols('SNMPv2-TC', 'RowStatus', 'TextualConvention', 'DisplayString', 'TruthValue') hpicf_mld_mib = module_identity((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48)) hpicfMldMIB.setRevisions(('2015-09-11 00:00', '2013-02-10 00:00', '2011-03-10 00:00', '2011-01-11 00:00', '2010-09-09 00:00', '2007-07-02 00:00')) if mibBuilder.loadTexts: hpicfMldMIB.setLastUpdated('201509110000Z') if mibBuilder.loadTexts: hpicfMldMIB.setOrganization('HP Networking') class Hpicfmcastgrouptypedefinition(TextualConvention, Integer32): status = 'current' subtype_spec = Integer32.subtypeSpec + constraints_union(single_value_constraint(1, 2, 3)) named_values = named_values(('standard', 1), ('filtered', 2), ('mini', 3)) class Hpicfmldifentrystate(TextualConvention, Integer32): status = 'current' subtype_spec = Integer32.subtypeSpec + constraints_union(single_value_constraint(1, 2, 3, 4)) named_values = named_values(('initialWait', 1), ('querierElection', 2), ('querier', 3), ('nonQuerier', 4)) hpicf_mld_objects = mib_identifier((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 1)) hpicf_mld = mib_identifier((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 1, 1)) hpicf_mld_conformance = mib_identifier((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 2)) hpicf_mld_groups = mib_identifier((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 2, 1)) hpicf_mld_compliances = mib_identifier((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 2, 2)) hpicf_mld_control_unknown_multicast = mib_scalar((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 1, 1, 1), truth_value().clone('true')).setMaxAccess('readwrite') if mibBuilder.loadTexts: hpicfMldControlUnknownMulticast.setStatus('current') hpicf_mld_config_forced_leave_interval = mib_scalar((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 1, 1, 2), integer32().subtype(subtypeSpec=value_range_constraint(1, 65535))).setMaxAccess('readwrite') if mibBuilder.loadTexts: hpicfMldConfigForcedLeaveInterval.setStatus('current') hpicf_mld_enabled_count = mib_scalar((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 1, 1, 3), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: hpicfMldEnabledCount.setStatus('current') hpicf_mld_mcast_group_joins_count = mib_scalar((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 1, 1, 4), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: hpicfMldMcastGroupJoinsCount.setStatus('current') hpicf_mld_if_table = mib_table((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 1, 1, 5)) if mibBuilder.loadTexts: hpicfMldIfTable.setStatus('current') hpicf_mld_if_entry = mib_table_row((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 1, 1, 5, 1)) mldInterfaceEntry.registerAugmentions(('HP-ICF-MLD-MIB', 'hpicfMldIfEntry')) hpicfMldIfEntry.setIndexNames(*mldInterfaceEntry.getIndexNames()) if mibBuilder.loadTexts: hpicfMldIfEntry.setStatus('current') hpicf_mld_if_entry_querier_feature = mib_table_column((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 1, 1, 5, 1, 1), truth_value().clone('true')).setMaxAccess('readwrite') if mibBuilder.loadTexts: hpicfMldIfEntryQuerierFeature.setStatus('current') hpicf_mld_if_entry_snooping_feature = mib_table_column((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 1, 1, 5, 1, 2), truth_value().clone('true')).setMaxAccess('readwrite') if mibBuilder.loadTexts: hpicfMldIfEntrySnoopingFeature.setStatus('current') hpicf_mld_if_entry_querier_port = mib_table_column((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 1, 1, 5, 1, 3), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: hpicfMldIfEntryQuerierPort.setStatus('current') hpicf_mld_if_entry_filtered_joins = mib_table_column((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 1, 1, 5, 1, 4), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: hpicfMldIfEntryFilteredJoins.setStatus('current') hpicf_mld_if_entry_standard_joins = mib_table_column((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 1, 1, 5, 1, 5), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: hpicfMldIfEntryStandardJoins.setStatus('current') hpicf_mld_if_entry_ports_with_mcast_router = mib_table_column((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 1, 1, 5, 1, 6), port_list()).setMaxAccess('readonly') if mibBuilder.loadTexts: hpicfMldIfEntryPortsWithMcastRouter.setStatus('current') hpicf_mld_if_entry_stat_general_query_rx = mib_table_column((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 1, 1, 5, 1, 7), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: hpicfMldIfEntryStatGeneralQueryRx.setStatus('current') hpicf_mld_if_entry_stat_query_tx = mib_table_column((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 1, 1, 5, 1, 8), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: hpicfMldIfEntryStatQueryTx.setStatus('current') hpicf_mld_if_entry_stat_gsq_rx = mib_table_column((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 1, 1, 5, 1, 9), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: hpicfMldIfEntryStatGSQRx.setStatus('current') hpicf_mld_if_entry_stat_gsq_tx = mib_table_column((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 1, 1, 5, 1, 10), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: hpicfMldIfEntryStatGSQTx.setStatus('current') hpicf_mld_if_entry_stat_mld_v1_report_rx = mib_table_column((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 1, 1, 5, 1, 11), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: hpicfMldIfEntryStatMldV1ReportRx.setStatus('current') hpicf_mld_if_entry_stat_mld_v2_report_rx = mib_table_column((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 1, 1, 5, 1, 12), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: hpicfMldIfEntryStatMldV2ReportRx.setStatus('current') hpicf_mld_if_entry_stat_mld_v1_leave_rx = mib_table_column((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 1, 1, 5, 1, 13), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: hpicfMldIfEntryStatMldV1LeaveRx.setStatus('current') hpicf_mld_if_entry_stat_unknown_mld_type_rx = mib_table_column((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 1, 1, 5, 1, 14), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: hpicfMldIfEntryStatUnknownMldTypeRx.setStatus('current') hpicf_mld_if_entry_stat_unknown_pkt_rx = mib_table_column((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 1, 1, 5, 1, 15), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: hpicfMldIfEntryStatUnknownPktRx.setStatus('current') hpicf_mld_if_entry_stat_forward_to_routers_tx = mib_table_column((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 1, 1, 5, 1, 16), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: hpicfMldIfEntryStatForwardToRoutersTx.setStatus('current') hpicf_mld_if_entry_stat_forward_to_all_ports_tx = mib_table_column((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 1, 1, 5, 1, 17), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: hpicfMldIfEntryStatForwardToAllPortsTx.setStatus('current') hpicf_mld_if_entry_stat_fast_leaves = mib_table_column((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 1, 1, 5, 1, 18), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: hpicfMldIfEntryStatFastLeaves.setStatus('current') hpicf_mld_if_entry_stat_forced_fast_leaves = mib_table_column((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 1, 1, 5, 1, 19), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: hpicfMldIfEntryStatForcedFastLeaves.setStatus('current') hpicf_mld_if_entry_stat_join_timeouts = mib_table_column((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 1, 1, 5, 1, 20), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: hpicfMldIfEntryStatJoinTimeouts.setStatus('current') hpicf_mld_if_entry_stat_wrong_version_queries = mib_table_column((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 1, 1, 5, 1, 21), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: hpicfMldIfEntryStatWrongVersionQueries.setStatus('current') hpicf_mld_if_entry_last_member_query_count = mib_table_column((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 1, 1, 5, 1, 22), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: hpicfMldIfEntryLastMemberQueryCount.setStatus('current') hpicf_mld_if_entry_startup_query_count = mib_table_column((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 1, 1, 5, 1, 23), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: hpicfMldIfEntryStartupQueryCount.setStatus('current') hpicf_mld_if_entry_startup_query_interval = mib_table_column((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 1, 1, 5, 1, 24), unsigned32()).setUnits('seconds').setMaxAccess('readonly') if mibBuilder.loadTexts: hpicfMldIfEntryStartupQueryInterval.setStatus('current') hpicf_mld_if_entry_stat_exclude_group_joins_count = mib_table_column((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 1, 1, 5, 1, 25), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: hpicfMldIfEntryStatExcludeGroupJoinsCount.setStatus('current') hpicf_mld_if_entry_stat_include_group_joins_count = mib_table_column((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 1, 1, 5, 1, 26), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: hpicfMldIfEntryStatIncludeGroupJoinsCount.setStatus('current') hpicf_mld_if_entry_stat_filtered_exclude_group_joins_count = mib_table_column((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 1, 1, 5, 1, 27), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: hpicfMldIfEntryStatFilteredExcludeGroupJoinsCount.setStatus('current') hpicf_mld_if_entry_stat_filtered_include_group_joins_count = mib_table_column((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 1, 1, 5, 1, 28), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: hpicfMldIfEntryStatFilteredIncludeGroupJoinsCount.setStatus('current') hpicf_mld_if_entry_stat_standard_exclude_group_joins_count = mib_table_column((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 1, 1, 5, 1, 29), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: hpicfMldIfEntryStatStandardExcludeGroupJoinsCount.setStatus('current') hpicf_mld_if_entry_stat_standard_include_group_joins_count = mib_table_column((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 1, 1, 5, 1, 30), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: hpicfMldIfEntryStatStandardIncludeGroupJoinsCount.setStatus('current') hpicf_mld_if_entry_stat_v1_query_tx = mib_table_column((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 1, 1, 5, 1, 31), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: hpicfMldIfEntryStatV1QueryTx.setStatus('current') hpicf_mld_if_entry_stat_v1_query_rx = mib_table_column((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 1, 1, 5, 1, 32), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: hpicfMldIfEntryStatV1QueryRx.setStatus('current') hpicf_mld_if_entry_stat_v2_query_tx = mib_table_column((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 1, 1, 5, 1, 33), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: hpicfMldIfEntryStatV2QueryTx.setStatus('current') hpicf_mld_if_entry_stat_v2_query_rx = mib_table_column((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 1, 1, 5, 1, 34), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: hpicfMldIfEntryStatV2QueryRx.setStatus('current') hpicf_mld_if_entry_stat_gssq_tx = mib_table_column((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 1, 1, 5, 1, 35), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: hpicfMldIfEntryStatGSSQTx.setStatus('current') hpicf_mld_if_entry_stat_gssq_rx = mib_table_column((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 1, 1, 5, 1, 36), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: hpicfMldIfEntryStatGSSQRx.setStatus('current') hpicf_mld_if_entry_stat_malformed_pkt_rx = mib_table_column((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 1, 1, 5, 1, 37), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: hpicfMldIfEntryStatMalformedPktRx.setStatus('current') hpicf_mld_if_entry_stat_bad_check_sum_rx = mib_table_column((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 1, 1, 5, 1, 38), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: hpicfMldIfEntryStatBadCheckSumRx.setStatus('current') hpicf_mld_if_entry_stat_martian_source_rx = mib_table_column((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 1, 1, 5, 1, 39), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: hpicfMldIfEntryStatMartianSourceRx.setStatus('current') hpicf_mld_if_entry_stat_packets_rx_on_disabled = mib_table_column((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 1, 1, 5, 1, 40), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: hpicfMldIfEntryStatPacketsRxOnDisabled.setStatus('current') hpicf_mld_if_entry_strict_version_mode = mib_table_column((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 1, 1, 5, 1, 41), truth_value().clone('false')).setMaxAccess('readwrite') if mibBuilder.loadTexts: hpicfMldIfEntryStrictVersionMode.setStatus('current') hpicf_mld_if_entry_stat_mld_v1_report_tx = mib_table_column((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 1, 1, 5, 1, 42), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: hpicfMldIfEntryStatMldV1ReportTx.setStatus('current') hpicf_mld_if_entry_stat_mld_v2_report_tx = mib_table_column((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 1, 1, 5, 1, 43), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: hpicfMldIfEntryStatMldV2ReportTx.setStatus('current') hpicf_mld_if_entry_state = mib_table_column((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 1, 1, 5, 1, 44), hpicf_mld_if_entry_state()).setMaxAccess('readonly') if mibBuilder.loadTexts: hpicfMldIfEntryState.setStatus('current') hpicf_mld_if_entry_stat_v1_gsq_rx = mib_table_column((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 1, 1, 5, 1, 45), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: hpicfMldIfEntryStatV1GSQRx.setStatus('current') hpicf_mld_if_entry_stat_v1_gsq_tx = mib_table_column((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 1, 1, 5, 1, 46), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: hpicfMldIfEntryStatV1GSQTx.setStatus('current') hpicf_mld_if_entry_stat_v2_gsq_rx = mib_table_column((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 1, 1, 5, 1, 47), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: hpicfMldIfEntryStatV2GSQRx.setStatus('current') hpicf_mld_if_entry_stat_v2_gsq_tx = mib_table_column((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 1, 1, 5, 1, 48), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: hpicfMldIfEntryStatV2GSQTx.setStatus('current') hpicf_mld_if_entry_startup_query_expiry_time = mib_table_column((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 1, 1, 5, 1, 49), time_ticks()).setMaxAccess('readonly') if mibBuilder.loadTexts: hpicfMldIfEntryStartupQueryExpiryTime.setStatus('current') hpicf_mld_if_entry_other_querier_interval = mib_table_column((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 1, 1, 5, 1, 50), unsigned32()).setUnits('seconds').setMaxAccess('readonly') if mibBuilder.loadTexts: hpicfMldIfEntryOtherQuerierInterval.setStatus('current') hpicf_mld_if_entry_other_querier_expiry_time = mib_table_column((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 1, 1, 5, 1, 51), time_ticks()).setMaxAccess('readonly') if mibBuilder.loadTexts: hpicfMldIfEntryOtherQuerierExpiryTime.setStatus('current') hpicf_mld_cache_table = mib_table((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 1, 1, 6)) if mibBuilder.loadTexts: hpicfMldCacheTable.setStatus('current') hpicf_mld_cache_entry = mib_table_row((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 1, 1, 6, 1)).setIndexNames((0, 'HP-ICF-MLD-MIB', 'hpicfMldCacheIfIndex'), (0, 'HP-ICF-MLD-MIB', 'hpicfMldCacheAddress')) if mibBuilder.loadTexts: hpicfMldCacheEntry.setStatus('current') hpicf_mld_cache_if_index = mib_table_column((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 1, 1, 6, 1, 1), interface_index()) if mibBuilder.loadTexts: hpicfMldCacheIfIndex.setStatus('current') hpicf_mld_cache_address = mib_table_column((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 1, 1, 6, 1, 2), inet_address_i_pv6().subtype(subtypeSpec=value_size_constraint(16, 16)).setFixedLength(16)) if mibBuilder.loadTexts: hpicfMldCacheAddress.setStatus('current') hpicf_mld_cache_self = mib_table_column((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 1, 1, 6, 1, 3), truth_value().clone('true')).setMaxAccess('readcreate') if mibBuilder.loadTexts: hpicfMldCacheSelf.setStatus('current') hpicf_mld_cache_last_reporter = mib_table_column((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 1, 1, 6, 1, 4), inet_address_i_pv6().subtype(subtypeSpec=value_size_constraint(16, 16)).setFixedLength(16)).setMaxAccess('readonly') if mibBuilder.loadTexts: hpicfMldCacheLastReporter.setStatus('current') hpicf_mld_cache_up_time = mib_table_column((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 1, 1, 6, 1, 5), time_ticks()).setMaxAccess('readonly') if mibBuilder.loadTexts: hpicfMldCacheUpTime.setStatus('current') hpicf_mld_cache_expiry_time = mib_table_column((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 1, 1, 6, 1, 6), time_ticks()).setMaxAccess('readonly') if mibBuilder.loadTexts: hpicfMldCacheExpiryTime.setStatus('current') hpicf_mld_group_type = mib_table_column((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 1, 1, 6, 1, 7), hpicf_mcast_group_type_definition()).setMaxAccess('readonly') if mibBuilder.loadTexts: hpicfMldGroupType.setStatus('current') hpicf_joined_ports = mib_table_column((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 1, 1, 6, 1, 8), port_list()).setMaxAccess('readonly') if mibBuilder.loadTexts: hpicfJoinedPorts.setStatus('current') hpicf_mld_cache_status = mib_table_column((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 1, 1, 6, 1, 9), row_status()).setMaxAccess('readcreate') if mibBuilder.loadTexts: hpicfMldCacheStatus.setStatus('current') hpicf_mld_cache_filter_mode = mib_table_column((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 1, 1, 6, 1, 10), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('include', 1), ('exclude', 2)))).setMaxAccess('readonly') if mibBuilder.loadTexts: hpicfMldCacheFilterMode.setStatus('current') hpicf_mld_cache_exclude_mode_expiry_timer = mib_table_column((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 1, 1, 6, 1, 11), time_ticks()).setMaxAccess('readonly') if mibBuilder.loadTexts: hpicfMldCacheExcludeModeExpiryTimer.setStatus('current') hpicf_mld_cache_version1_host_timer = mib_table_column((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 1, 1, 6, 1, 12), time_ticks()).setMaxAccess('readonly') if mibBuilder.loadTexts: hpicfMldCacheVersion1HostTimer.setStatus('current') hpicf_mld_cache_src_count = mib_table_column((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 1, 1, 6, 1, 13), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: hpicfMldCacheSrcCount.setStatus('current') class Hpicfmldconfigportmodetype(TextualConvention, Integer32): status = 'current' subtype_spec = Integer32.subtypeSpec + constraints_union(single_value_constraint(1, 2, 3)) named_values = named_values(('auto', 1), ('blocked', 2), ('forward', 3)) hpicf_mld_port_config_table = mib_table((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 1, 1, 7)) if mibBuilder.loadTexts: hpicfMldPortConfigTable.setStatus('current') hpicf_mld_port_config_entry = mib_table_row((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 1, 1, 7, 1)).setIndexNames((0, 'HP-ICF-MLD-MIB', 'hpicfMldPortConfigEntryInterfaceIfIndex'), (0, 'HP-ICF-MLD-MIB', 'hpicfMldPortConfigEntryIndex')) if mibBuilder.loadTexts: hpicfMldPortConfigEntry.setStatus('current') hpicf_mld_port_config_entry_interface_if_index = mib_table_column((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 1, 1, 7, 1, 1), interface_index()) if mibBuilder.loadTexts: hpicfMldPortConfigEntryInterfaceIfIndex.setStatus('current') hpicf_mld_port_config_entry_index = mib_table_column((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 1, 1, 7, 1, 2), integer32().subtype(subtypeSpec=value_range_constraint(1, 65535))) if mibBuilder.loadTexts: hpicfMldPortConfigEntryIndex.setStatus('current') hpicf_mld_port_config_entry_port_mode_feature = mib_table_column((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 1, 1, 7, 1, 3), hpicf_mld_config_port_mode_type()).setMaxAccess('readwrite') if mibBuilder.loadTexts: hpicfMldPortConfigEntryPortModeFeature.setStatus('current') hpicf_mld_port_config_entry_forced_leave_feature = mib_table_column((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 1, 1, 7, 1, 4), truth_value()).setMaxAccess('readwrite') if mibBuilder.loadTexts: hpicfMldPortConfigEntryForcedLeaveFeature.setStatus('current') hpicf_mld_port_config_entry_fast_leave_feature = mib_table_column((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 1, 1, 7, 1, 5), truth_value()).setMaxAccess('readwrite') if mibBuilder.loadTexts: hpicfMldPortConfigEntryFastLeaveFeature.setStatus('current') hpicf_mld_filtered_group_port_cache_table = mib_table((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 1, 1, 8)) if mibBuilder.loadTexts: hpicfMldFilteredGroupPortCacheTable.setStatus('current') hpicf_mld_filtered_group_port_cache_entry = mib_table_row((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 1, 1, 8, 1)).setIndexNames((0, 'HP-ICF-MLD-MIB', 'hpicfMldFilteredGroupPortCacheIfIndex'), (0, 'HP-ICF-MLD-MIB', 'hpicfMldFilteredGroupPortCacheGroupAddress'), (0, 'HP-ICF-MLD-MIB', 'hpicfMldFilteredGroupPortCachePortIndex')) if mibBuilder.loadTexts: hpicfMldFilteredGroupPortCacheEntry.setStatus('current') hpicf_mld_filtered_group_port_cache_if_index = mib_table_column((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 1, 1, 8, 1, 1), interface_index()) if mibBuilder.loadTexts: hpicfMldFilteredGroupPortCacheIfIndex.setStatus('current') hpicf_mld_filtered_group_port_cache_group_address = mib_table_column((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 1, 1, 8, 1, 2), inet_address_i_pv6()) if mibBuilder.loadTexts: hpicfMldFilteredGroupPortCacheGroupAddress.setStatus('current') hpicf_mld_filtered_group_port_cache_port_index = mib_table_column((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 1, 1, 8, 1, 3), integer32().subtype(subtypeSpec=value_range_constraint(1, 65535))) if mibBuilder.loadTexts: hpicfMldFilteredGroupPortCachePortIndex.setStatus('current') hpicf_mld_filtered_group_port_cache_expiry_time = mib_table_column((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 1, 1, 8, 1, 4), time_ticks()).setMaxAccess('readonly') if mibBuilder.loadTexts: hpicfMldFilteredGroupPortCacheExpiryTime.setStatus('current') hpicf_mld_src_list_table = mib_table((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 1, 1, 9)) if mibBuilder.loadTexts: hpicfMldSrcListTable.setStatus('current') hpicf_mld_src_list_entry = mib_table_row((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 1, 1, 9, 1)).setIndexNames((0, 'HP-ICF-MLD-MIB', 'hpicfMldSrcListIfIndex'), (0, 'HP-ICF-MLD-MIB', 'hpicfMldSrcListAddress'), (0, 'HP-ICF-MLD-MIB', 'hpicfMldSrcListHostAddress')) if mibBuilder.loadTexts: hpicfMldSrcListEntry.setStatus('current') hpicf_mld_src_list_if_index = mib_table_column((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 1, 1, 9, 1, 1), interface_index()) if mibBuilder.loadTexts: hpicfMldSrcListIfIndex.setStatus('current') hpicf_mld_src_list_address = mib_table_column((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 1, 1, 9, 1, 2), inet_address_i_pv6().subtype(subtypeSpec=value_size_constraint(16, 16)).setFixedLength(16)) if mibBuilder.loadTexts: hpicfMldSrcListAddress.setStatus('current') hpicf_mld_src_list_host_address = mib_table_column((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 1, 1, 9, 1, 3), inet_address_i_pv6().subtype(subtypeSpec=value_size_constraint(16, 16)).setFixedLength(16)) if mibBuilder.loadTexts: hpicfMldSrcListHostAddress.setStatus('current') hpicf_mld_src_list_ports = mib_table_column((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 1, 1, 9, 1, 4), port_list()).setMaxAccess('readonly') if mibBuilder.loadTexts: hpicfMldSrcListPorts.setStatus('current') hpicf_mld_src_list_expiry = mib_table_column((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 1, 1, 9, 1, 5), time_ticks()).setMaxAccess('readonly') if mibBuilder.loadTexts: hpicfMldSrcListExpiry.setStatus('current') hpicf_mld_src_list_up_time = mib_table_column((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 1, 1, 9, 1, 6), time_ticks()).setMaxAccess('readonly') if mibBuilder.loadTexts: hpicfMldSrcListUpTime.setStatus('current') hpicf_mld_src_list_type = mib_table_column((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 1, 1, 9, 1, 7), hpicf_mcast_group_type_definition()).setMaxAccess('readonly') if mibBuilder.loadTexts: hpicfMldSrcListType.setStatus('current') hpicf_mld_port_src_table = mib_table((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 1, 1, 10)) if mibBuilder.loadTexts: hpicfMldPortSrcTable.setStatus('current') hpicf_mld_port_src_entry = mib_table_row((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 1, 1, 10, 1)).setIndexNames((0, 'HP-ICF-MLD-MIB', 'hpicfMldPortSrcIfIndex'), (0, 'HP-ICF-MLD-MIB', 'hpicfMldPortSrcAddress'), (0, 'HP-ICF-MLD-MIB', 'hpicfMldPortSrcHostAddress'), (0, 'HP-ICF-MLD-MIB', 'hpicfMldPortSrcPortIndex')) if mibBuilder.loadTexts: hpicfMldPortSrcEntry.setStatus('current') hpicf_mld_port_src_if_index = mib_table_column((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 1, 1, 10, 1, 1), interface_index()) if mibBuilder.loadTexts: hpicfMldPortSrcIfIndex.setStatus('current') hpicf_mld_port_src_address = mib_table_column((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 1, 1, 10, 1, 2), inet_address_i_pv6().subtype(subtypeSpec=value_size_constraint(16, 16)).setFixedLength(16)) if mibBuilder.loadTexts: hpicfMldPortSrcAddress.setStatus('current') hpicf_mld_port_src_host_address = mib_table_column((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 1, 1, 10, 1, 3), inet_address_i_pv6().subtype(subtypeSpec=value_size_constraint(16, 16)).setFixedLength(16)) if mibBuilder.loadTexts: hpicfMldPortSrcHostAddress.setStatus('current') hpicf_mld_port_src_port_index = mib_table_column((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 1, 1, 10, 1, 4), integer32().subtype(subtypeSpec=value_range_constraint(1, 65535))) if mibBuilder.loadTexts: hpicfMldPortSrcPortIndex.setStatus('current') hpicf_mld_port_src_expiry = mib_table_column((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 1, 1, 10, 1, 5), time_ticks()).setMaxAccess('readonly') if mibBuilder.loadTexts: hpicfMldPortSrcExpiry.setStatus('current') hpicf_mld_port_src_up_time = mib_table_column((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 1, 1, 10, 1, 6), time_ticks()).setMaxAccess('readonly') if mibBuilder.loadTexts: hpicfMldPortSrcUpTime.setStatus('current') hpicf_mld_port_src_filter_mode = mib_table_column((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 1, 1, 10, 1, 7), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('include', 1), ('exclude', 2)))).setMaxAccess('readonly') if mibBuilder.loadTexts: hpicfMldPortSrcFilterMode.setStatus('current') hpicf_mld_mcast_exclude_group_joins_count = mib_scalar((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 1, 1, 11), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: hpicfMldMcastExcludeGroupJoinsCount.setStatus('current') hpicf_mld_mcast_include_group_joins_count = mib_scalar((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 1, 1, 12), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: hpicfMldMcastIncludeGroupJoinsCount.setStatus('current') hpicf_mld_mcast_port_fast_learn = mib_scalar((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 1, 1, 13), port_list()).setMaxAccess('readwrite') if mibBuilder.loadTexts: hpicfMldMcastPortFastLearn.setStatus('current') hpicf_mld_group_port_cache_table = mib_table((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 1, 1, 14)) if mibBuilder.loadTexts: hpicfMldGroupPortCacheTable.setStatus('current') hpicf_mld_group_port_cache_entry = mib_table_row((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 1, 1, 14, 1)).setIndexNames((0, 'HP-ICF-MLD-MIB', 'hpicfMldGroupPortCacheIfIndex'), (0, 'HP-ICF-MLD-MIB', 'hpicfMldGroupPortCacheGroupAddress'), (0, 'HP-ICF-MLD-MIB', 'hpicfMldGroupPortCachePortIndex')) if mibBuilder.loadTexts: hpicfMldGroupPortCacheEntry.setStatus('current') hpicf_mld_group_port_cache_if_index = mib_table_column((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 1, 1, 14, 1, 1), interface_index()) if mibBuilder.loadTexts: hpicfMldGroupPortCacheIfIndex.setStatus('current') hpicf_mld_group_port_cache_group_address = mib_table_column((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 1, 1, 14, 1, 2), inet_address_i_pv6()) if mibBuilder.loadTexts: hpicfMldGroupPortCacheGroupAddress.setStatus('current') hpicf_mld_group_port_cache_port_index = mib_table_column((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 1, 1, 14, 1, 3), integer32().subtype(subtypeSpec=value_range_constraint(1, 65535))) if mibBuilder.loadTexts: hpicfMldGroupPortCachePortIndex.setStatus('current') hpicf_mld_group_port_cache_expiry_time = mib_table_column((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 1, 1, 14, 1, 4), time_ticks()).setMaxAccess('readonly') if mibBuilder.loadTexts: hpicfMldGroupPortCacheExpiryTime.setStatus('current') hpicf_mld_group_port_cache_up_time = mib_table_column((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 1, 1, 14, 1, 5), time_ticks()).setMaxAccess('readonly') if mibBuilder.loadTexts: hpicfMldGroupPortCacheUpTime.setStatus('current') hpicf_mld_group_port_cache_version1_timer = mib_table_column((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 1, 1, 14, 1, 6), time_ticks()).setMaxAccess('readonly') if mibBuilder.loadTexts: hpicfMldGroupPortCacheVersion1Timer.setStatus('current') hpicf_mld_group_port_cache_filter_timer = mib_table_column((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 1, 1, 14, 1, 7), time_ticks()).setMaxAccess('readonly') if mibBuilder.loadTexts: hpicfMldGroupPortCacheFilterTimer.setStatus('current') hpicf_mld_group_port_cache_filter_mode = mib_table_column((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 1, 1, 14, 1, 8), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('include', 1), ('exclude', 2)))).setMaxAccess('readonly') if mibBuilder.loadTexts: hpicfMldGroupPortCacheFilterMode.setStatus('current') hpicf_mld_group_port_cache_exclude_src_count = mib_table_column((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 1, 1, 14, 1, 9), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: hpicfMldGroupPortCacheExcludeSrcCount.setStatus('current') hpicf_mld_group_port_cache_requested_src_count = mib_table_column((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 1, 1, 14, 1, 10), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: hpicfMldGroupPortCacheRequestedSrcCount.setStatus('current') hpicf_mld_reload = mib_scalar((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 1, 1, 15), truth_value().clone('false')).setMaxAccess('readwrite') if mibBuilder.loadTexts: hpicfMldReload.setStatus('current') hpicf_mld_base_group = object_group((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 2, 1, 1)).setObjects(('HP-ICF-MLD-MIB', 'hpicfMldControlUnknownMulticast'), ('HP-ICF-MLD-MIB', 'hpicfMldConfigForcedLeaveInterval'), ('HP-ICF-MLD-MIB', 'hpicfMldEnabledCount'), ('HP-ICF-MLD-MIB', 'hpicfMldMcastGroupJoinsCount')) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): hpicf_mld_base_group = hpicfMldBaseGroup.setStatus('current') hpicf_mld_if_group = object_group((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 2, 1, 2)).setObjects(('HP-ICF-MLD-MIB', 'hpicfMldIfEntryQuerierFeature'), ('HP-ICF-MLD-MIB', 'hpicfMldIfEntrySnoopingFeature'), ('HP-ICF-MLD-MIB', 'hpicfMldIfEntryQuerierPort'), ('HP-ICF-MLD-MIB', 'hpicfMldIfEntryFilteredJoins'), ('HP-ICF-MLD-MIB', 'hpicfMldIfEntryStandardJoins'), ('HP-ICF-MLD-MIB', 'hpicfMldIfEntryPortsWithMcastRouter'), ('HP-ICF-MLD-MIB', 'hpicfMldIfEntryStatGeneralQueryRx'), ('HP-ICF-MLD-MIB', 'hpicfMldIfEntryStatQueryTx'), ('HP-ICF-MLD-MIB', 'hpicfMldIfEntryStatGSQRx'), ('HP-ICF-MLD-MIB', 'hpicfMldIfEntryStatGSQTx'), ('HP-ICF-MLD-MIB', 'hpicfMldIfEntryStatMldV1ReportRx'), ('HP-ICF-MLD-MIB', 'hpicfMldIfEntryStatMldV2ReportRx'), ('HP-ICF-MLD-MIB', 'hpicfMldIfEntryStatMldV1LeaveRx'), ('HP-ICF-MLD-MIB', 'hpicfMldIfEntryStatUnknownMldTypeRx'), ('HP-ICF-MLD-MIB', 'hpicfMldIfEntryStatUnknownPktRx'), ('HP-ICF-MLD-MIB', 'hpicfMldIfEntryStatForwardToRoutersTx'), ('HP-ICF-MLD-MIB', 'hpicfMldIfEntryStatForwardToAllPortsTx'), ('HP-ICF-MLD-MIB', 'hpicfMldIfEntryStatFastLeaves'), ('HP-ICF-MLD-MIB', 'hpicfMldIfEntryStatForcedFastLeaves'), ('HP-ICF-MLD-MIB', 'hpicfMldIfEntryStatJoinTimeouts')) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): hpicf_mld_if_group = hpicfMldIfGroup.setStatus('current') hpicf_mld_cache_group = object_group((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 2, 1, 3)).setObjects(('HP-ICF-MLD-MIB', 'hpicfMldCacheSelf'), ('HP-ICF-MLD-MIB', 'hpicfMldCacheLastReporter'), ('HP-ICF-MLD-MIB', 'hpicfMldCacheUpTime'), ('HP-ICF-MLD-MIB', 'hpicfMldCacheExpiryTime'), ('HP-ICF-MLD-MIB', 'hpicfMldGroupType'), ('HP-ICF-MLD-MIB', 'hpicfJoinedPorts'), ('HP-ICF-MLD-MIB', 'hpicfMldCacheStatus')) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): hpicf_mld_cache_group = hpicfMldCacheGroup.setStatus('current') hpicf_mld_port_group = object_group((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 2, 1, 4)).setObjects(('HP-ICF-MLD-MIB', 'hpicfMldPortConfigEntryPortModeFeature'), ('HP-ICF-MLD-MIB', 'hpicfMldPortConfigEntryForcedLeaveFeature'), ('HP-ICF-MLD-MIB', 'hpicfMldPortConfigEntryFastLeaveFeature')) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): hpicf_mld_port_group = hpicfMldPortGroup.setStatus('current') hpicf_mld_filtered_group_port_cache_group = object_group((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 2, 1, 5)).setObjects(('HP-ICF-MLD-MIB', 'hpicfMldFilteredGroupPortCacheExpiryTime')) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): hpicf_mld_filtered_group_port_cache_group = hpicfMldFilteredGroupPortCacheGroup.setStatus('current') hpicf_mld_base_group_v2 = object_group((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 2, 1, 6)).setObjects(('HP-ICF-MLD-MIB', 'hpicfMldControlUnknownMulticast'), ('HP-ICF-MLD-MIB', 'hpicfMldConfigForcedLeaveInterval'), ('HP-ICF-MLD-MIB', 'hpicfMldEnabledCount'), ('HP-ICF-MLD-MIB', 'hpicfMldMcastGroupJoinsCount'), ('HP-ICF-MLD-MIB', 'hpicfMldMcastExcludeGroupJoinsCount'), ('HP-ICF-MLD-MIB', 'hpicfMldMcastIncludeGroupJoinsCount'), ('HP-ICF-MLD-MIB', 'hpicfMldMcastPortFastLearn')) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): hpicf_mld_base_group_v2 = hpicfMldBaseGroupV2.setStatus('current') hpicf_mld_if_group_v2 = object_group((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 2, 1, 7)).setObjects(('HP-ICF-MLD-MIB', 'hpicfMldIfEntryQuerierFeature'), ('HP-ICF-MLD-MIB', 'hpicfMldIfEntrySnoopingFeature'), ('HP-ICF-MLD-MIB', 'hpicfMldIfEntryQuerierPort'), ('HP-ICF-MLD-MIB', 'hpicfMldIfEntryFilteredJoins'), ('HP-ICF-MLD-MIB', 'hpicfMldIfEntryStandardJoins'), ('HP-ICF-MLD-MIB', 'hpicfMldIfEntryPortsWithMcastRouter'), ('HP-ICF-MLD-MIB', 'hpicfMldIfEntryStatGeneralQueryRx'), ('HP-ICF-MLD-MIB', 'hpicfMldIfEntryStatQueryTx'), ('HP-ICF-MLD-MIB', 'hpicfMldIfEntryStatGSQRx'), ('HP-ICF-MLD-MIB', 'hpicfMldIfEntryStatGSQTx'), ('HP-ICF-MLD-MIB', 'hpicfMldIfEntryStatMldV1ReportRx'), ('HP-ICF-MLD-MIB', 'hpicfMldIfEntryStatMldV2ReportRx'), ('HP-ICF-MLD-MIB', 'hpicfMldIfEntryStatMldV1LeaveRx'), ('HP-ICF-MLD-MIB', 'hpicfMldIfEntryStatUnknownMldTypeRx'), ('HP-ICF-MLD-MIB', 'hpicfMldIfEntryStatUnknownPktRx'), ('HP-ICF-MLD-MIB', 'hpicfMldIfEntryStatForwardToRoutersTx'), ('HP-ICF-MLD-MIB', 'hpicfMldIfEntryStatForwardToAllPortsTx'), ('HP-ICF-MLD-MIB', 'hpicfMldIfEntryStatFastLeaves'), ('HP-ICF-MLD-MIB', 'hpicfMldIfEntryStatForcedFastLeaves'), ('HP-ICF-MLD-MIB', 'hpicfMldIfEntryStatJoinTimeouts'), ('HP-ICF-MLD-MIB', 'hpicfMldIfEntryStatWrongVersionQueries'), ('HP-ICF-MLD-MIB', 'hpicfMldIfEntryLastMemberQueryCount'), ('HP-ICF-MLD-MIB', 'hpicfMldIfEntryStartupQueryCount'), ('HP-ICF-MLD-MIB', 'hpicfMldIfEntryStartupQueryInterval'), ('HP-ICF-MLD-MIB', 'hpicfMldIfEntryStatExcludeGroupJoinsCount'), ('HP-ICF-MLD-MIB', 'hpicfMldIfEntryStatIncludeGroupJoinsCount'), ('HP-ICF-MLD-MIB', 'hpicfMldIfEntryStatFilteredExcludeGroupJoinsCount'), ('HP-ICF-MLD-MIB', 'hpicfMldIfEntryStatFilteredIncludeGroupJoinsCount'), ('HP-ICF-MLD-MIB', 'hpicfMldIfEntryStatStandardExcludeGroupJoinsCount'), ('HP-ICF-MLD-MIB', 'hpicfMldIfEntryStatStandardIncludeGroupJoinsCount'), ('HP-ICF-MLD-MIB', 'hpicfMldIfEntryStatV1QueryTx'), ('HP-ICF-MLD-MIB', 'hpicfMldIfEntryStatV1QueryRx'), ('HP-ICF-MLD-MIB', 'hpicfMldIfEntryStatV2QueryTx'), ('HP-ICF-MLD-MIB', 'hpicfMldIfEntryStatV2QueryRx'), ('HP-ICF-MLD-MIB', 'hpicfMldIfEntryStatGSSQTx'), ('HP-ICF-MLD-MIB', 'hpicfMldIfEntryStatGSSQRx'), ('HP-ICF-MLD-MIB', 'hpicfMldIfEntryStatMalformedPktRx'), ('HP-ICF-MLD-MIB', 'hpicfMldIfEntryStatBadCheckSumRx'), ('HP-ICF-MLD-MIB', 'hpicfMldIfEntryStatMartianSourceRx'), ('HP-ICF-MLD-MIB', 'hpicfMldIfEntryStatPacketsRxOnDisabled'), ('HP-ICF-MLD-MIB', 'hpicfMldIfEntryStrictVersionMode'), ('HP-ICF-MLD-MIB', 'hpicfMldIfEntryStatMldV1ReportTx'), ('HP-ICF-MLD-MIB', 'hpicfMldIfEntryStatMldV2ReportTx'), ('HP-ICF-MLD-MIB', 'hpicfMldIfEntryState'), ('HP-ICF-MLD-MIB', 'hpicfMldIfEntryStatV1GSQRx'), ('HP-ICF-MLD-MIB', 'hpicfMldIfEntryStatV1GSQTx'), ('HP-ICF-MLD-MIB', 'hpicfMldIfEntryStatV2GSQRx'), ('HP-ICF-MLD-MIB', 'hpicfMldIfEntryStatV2GSQTx')) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): hpicf_mld_if_group_v2 = hpicfMldIfGroupV2.setStatus('current') hpicf_mld_cache_group_v2 = object_group((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 2, 1, 8)).setObjects(('HP-ICF-MLD-MIB', 'hpicfMldCacheSelf'), ('HP-ICF-MLD-MIB', 'hpicfMldCacheLastReporter'), ('HP-ICF-MLD-MIB', 'hpicfMldCacheUpTime'), ('HP-ICF-MLD-MIB', 'hpicfMldCacheExpiryTime'), ('HP-ICF-MLD-MIB', 'hpicfMldGroupType'), ('HP-ICF-MLD-MIB', 'hpicfJoinedPorts'), ('HP-ICF-MLD-MIB', 'hpicfMldCacheStatus'), ('HP-ICF-MLD-MIB', 'hpicfMldCacheFilterMode'), ('HP-ICF-MLD-MIB', 'hpicfMldCacheExcludeModeExpiryTimer'), ('HP-ICF-MLD-MIB', 'hpicfMldCacheVersion1HostTimer'), ('HP-ICF-MLD-MIB', 'hpicfMldCacheSrcCount')) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): hpicf_mld_cache_group_v2 = hpicfMldCacheGroupV2.setStatus('current') hpicf_mld_src_list_group = object_group((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 2, 1, 9)).setObjects(('HP-ICF-MLD-MIB', 'hpicfMldSrcListPorts'), ('HP-ICF-MLD-MIB', 'hpicfMldSrcListExpiry'), ('HP-ICF-MLD-MIB', 'hpicfMldSrcListUpTime'), ('HP-ICF-MLD-MIB', 'hpicfMldSrcListType')) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): hpicf_mld_src_list_group = hpicfMldSrcListGroup.setStatus('current') hpicf_mld_port_src_group = object_group((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 2, 1, 10)).setObjects(('HP-ICF-MLD-MIB', 'hpicfMldPortSrcExpiry'), ('HP-ICF-MLD-MIB', 'hpicfMldPortSrcUpTime'), ('HP-ICF-MLD-MIB', 'hpicfMldPortSrcFilterMode')) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): hpicf_mld_port_src_group = hpicfMldPortSrcGroup.setStatus('current') hpicf_mld_group_port_cache_group = object_group((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 2, 1, 11)).setObjects(('HP-ICF-MLD-MIB', 'hpicfMldGroupPortCacheExpiryTime'), ('HP-ICF-MLD-MIB', 'hpicfMldGroupPortCacheUpTime'), ('HP-ICF-MLD-MIB', 'hpicfMldGroupPortCacheVersion1Timer'), ('HP-ICF-MLD-MIB', 'hpicfMldGroupPortCacheFilterTimer'), ('HP-ICF-MLD-MIB', 'hpicfMldGroupPortCacheFilterMode'), ('HP-ICF-MLD-MIB', 'hpicfMldGroupPortCacheExcludeSrcCount'), ('HP-ICF-MLD-MIB', 'hpicfMldGroupPortCacheRequestedSrcCount')) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): hpicf_mld_group_port_cache_group = hpicfMldGroupPortCacheGroup.setStatus('current') hpicf_mld_if_group_v3 = object_group((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 2, 1, 12)).setObjects(('HP-ICF-MLD-MIB', 'hpicfMldIfEntryQuerierFeature'), ('HP-ICF-MLD-MIB', 'hpicfMldIfEntrySnoopingFeature'), ('HP-ICF-MLD-MIB', 'hpicfMldIfEntryQuerierPort'), ('HP-ICF-MLD-MIB', 'hpicfMldIfEntryFilteredJoins'), ('HP-ICF-MLD-MIB', 'hpicfMldIfEntryStandardJoins'), ('HP-ICF-MLD-MIB', 'hpicfMldIfEntryPortsWithMcastRouter'), ('HP-ICF-MLD-MIB', 'hpicfMldIfEntryStatGeneralQueryRx'), ('HP-ICF-MLD-MIB', 'hpicfMldIfEntryStatQueryTx'), ('HP-ICF-MLD-MIB', 'hpicfMldIfEntryStatGSQRx'), ('HP-ICF-MLD-MIB', 'hpicfMldIfEntryStatGSQTx'), ('HP-ICF-MLD-MIB', 'hpicfMldIfEntryStatMldV1ReportRx'), ('HP-ICF-MLD-MIB', 'hpicfMldIfEntryStatMldV2ReportRx'), ('HP-ICF-MLD-MIB', 'hpicfMldIfEntryStatMldV1LeaveRx'), ('HP-ICF-MLD-MIB', 'hpicfMldIfEntryStatUnknownMldTypeRx'), ('HP-ICF-MLD-MIB', 'hpicfMldIfEntryStatUnknownPktRx'), ('HP-ICF-MLD-MIB', 'hpicfMldIfEntryStatForwardToRoutersTx'), ('HP-ICF-MLD-MIB', 'hpicfMldIfEntryStatForwardToAllPortsTx'), ('HP-ICF-MLD-MIB', 'hpicfMldIfEntryStatFastLeaves'), ('HP-ICF-MLD-MIB', 'hpicfMldIfEntryStatForcedFastLeaves'), ('HP-ICF-MLD-MIB', 'hpicfMldIfEntryStatJoinTimeouts'), ('HP-ICF-MLD-MIB', 'hpicfMldIfEntryStatWrongVersionQueries'), ('HP-ICF-MLD-MIB', 'hpicfMldIfEntryLastMemberQueryCount'), ('HP-ICF-MLD-MIB', 'hpicfMldIfEntryStartupQueryCount'), ('HP-ICF-MLD-MIB', 'hpicfMldIfEntryStartupQueryInterval'), ('HP-ICF-MLD-MIB', 'hpicfMldIfEntryStatExcludeGroupJoinsCount'), ('HP-ICF-MLD-MIB', 'hpicfMldIfEntryStatIncludeGroupJoinsCount'), ('HP-ICF-MLD-MIB', 'hpicfMldIfEntryStatFilteredExcludeGroupJoinsCount'), ('HP-ICF-MLD-MIB', 'hpicfMldIfEntryStatFilteredIncludeGroupJoinsCount'), ('HP-ICF-MLD-MIB', 'hpicfMldIfEntryStatStandardExcludeGroupJoinsCount'), ('HP-ICF-MLD-MIB', 'hpicfMldIfEntryStatStandardIncludeGroupJoinsCount'), ('HP-ICF-MLD-MIB', 'hpicfMldIfEntryStatV1QueryTx'), ('HP-ICF-MLD-MIB', 'hpicfMldIfEntryStatV1QueryRx'), ('HP-ICF-MLD-MIB', 'hpicfMldIfEntryStatV2QueryTx'), ('HP-ICF-MLD-MIB', 'hpicfMldIfEntryStatV2QueryRx'), ('HP-ICF-MLD-MIB', 'hpicfMldIfEntryStatGSSQTx'), ('HP-ICF-MLD-MIB', 'hpicfMldIfEntryStatGSSQRx'), ('HP-ICF-MLD-MIB', 'hpicfMldIfEntryStatMalformedPktRx'), ('HP-ICF-MLD-MIB', 'hpicfMldIfEntryStatBadCheckSumRx'), ('HP-ICF-MLD-MIB', 'hpicfMldIfEntryStatMartianSourceRx'), ('HP-ICF-MLD-MIB', 'hpicfMldIfEntryStatPacketsRxOnDisabled'), ('HP-ICF-MLD-MIB', 'hpicfMldIfEntryStrictVersionMode'), ('HP-ICF-MLD-MIB', 'hpicfMldIfEntryStatMldV1ReportTx'), ('HP-ICF-MLD-MIB', 'hpicfMldIfEntryStatMldV2ReportTx'), ('HP-ICF-MLD-MIB', 'hpicfMldIfEntryState'), ('HP-ICF-MLD-MIB', 'hpicfMldIfEntryStatV1GSQRx'), ('HP-ICF-MLD-MIB', 'hpicfMldIfEntryStatV1GSQTx'), ('HP-ICF-MLD-MIB', 'hpicfMldIfEntryStatV2GSQRx'), ('HP-ICF-MLD-MIB', 'hpicfMldIfEntryStatV2GSQTx'), ('HP-ICF-MLD-MIB', 'hpicfMldIfEntryStartupQueryExpiryTime'), ('HP-ICF-MLD-MIB', 'hpicfMldIfEntryOtherQuerierInterval'), ('HP-ICF-MLD-MIB', 'hpicfMldIfEntryOtherQuerierExpiryTime')) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): hpicf_mld_if_group_v3 = hpicfMldIfGroupV3.setStatus('current') hpicf_mld_reload_mode_group = object_group((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 2, 1, 13)).setObjects(('HP-ICF-MLD-MIB', 'hpicfMldReload')) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): hpicf_mld_reload_mode_group = hpicfMldReloadModeGroup.setStatus('current') hpicf_mld_mib_compliance = module_compliance((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 2, 2, 1)).setObjects(('HP-ICF-MLD-MIB', 'hpicfMldBaseGroup'), ('HP-ICF-MLD-MIB', 'hpicfMldIfGroup'), ('HP-ICF-MLD-MIB', 'hpicfMldCacheGroup'), ('HP-ICF-MLD-MIB', 'hpicfMldPortGroup'), ('HP-ICF-MLD-MIB', 'hpicfMldFilteredGroupPortCacheGroup')) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): hpicf_mld_mib_compliance = hpicfMldMIBCompliance.setStatus('current') hpicf_mld_mib_compliance_v2 = module_compliance((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 2, 2, 2)).setObjects(('HP-ICF-MLD-MIB', 'hpicfMldBaseGroupV2'), ('HP-ICF-MLD-MIB', 'hpicfMldIfGroupV2'), ('HP-ICF-MLD-MIB', 'hpicfMldCacheGroupV2'), ('HP-ICF-MLD-MIB', 'hpicfMldPortGroup'), ('HP-ICF-MLD-MIB', 'hpicfMldFilteredGroupPortCacheGroup'), ('HP-ICF-MLD-MIB', 'hpicfMldSrcListGroup'), ('HP-ICF-MLD-MIB', 'hpicfMldPortSrcGroup'), ('HP-ICF-MLD-MIB', 'hpicfMldGroupPortCacheGroup')) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): hpicf_mld_mib_compliance_v2 = hpicfMldMIBComplianceV2.setStatus('current') hpicf_mld_mib_compliance_v3 = module_compliance((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 48, 2, 2, 3)).setObjects(('HP-ICF-MLD-MIB', 'hpicfMldBaseGroupV2'), ('HP-ICF-MLD-MIB', 'hpicfMldIfGroupV3'), ('HP-ICF-MLD-MIB', 'hpicfMldCacheGroupV2'), ('HP-ICF-MLD-MIB', 'hpicfMldPortGroup'), ('HP-ICF-MLD-MIB', 'hpicfMldFilteredGroupPortCacheGroup'), ('HP-ICF-MLD-MIB', 'hpicfMldSrcListGroup'), ('HP-ICF-MLD-MIB', 'hpicfMldPortSrcGroup'), ('HP-ICF-MLD-MIB', 'hpicfMldGroupPortCacheGroup'), ('HP-ICF-MLD-MIB', 'hpicfMldReloadModeGroup')) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): hpicf_mld_mib_compliance_v3 = hpicfMldMIBComplianceV3.setStatus('current') mibBuilder.exportSymbols('HP-ICF-MLD-MIB', hpicfMldPortSrcExpiry=hpicfMldPortSrcExpiry, hpicfMldPortSrcAddress=hpicfMldPortSrcAddress, hpicfMldCacheAddress=hpicfMldCacheAddress, hpicfMldSrcListEntry=hpicfMldSrcListEntry, hpicfMldPortConfigTable=hpicfMldPortConfigTable, hpicfMldIfEntryPortsWithMcastRouter=hpicfMldIfEntryPortsWithMcastRouter, hpicfMldFilteredGroupPortCacheGroup=hpicfMldFilteredGroupPortCacheGroup, hpicfMldBaseGroupV2=hpicfMldBaseGroupV2, hpicfMldIfEntryStatGSSQRx=hpicfMldIfEntryStatGSSQRx, hpicfMldCacheTable=hpicfMldCacheTable, hpicfJoinedPorts=hpicfJoinedPorts, hpicfMldCacheSelf=hpicfMldCacheSelf, hpicfMldMIBComplianceV3=hpicfMldMIBComplianceV3, hpicfMldIfEntryStandardJoins=hpicfMldIfEntryStandardJoins, hpicfMldIfEntryStatV1GSQRx=hpicfMldIfEntryStatV1GSQRx, hpicfMldIfEntryStartupQueryExpiryTime=hpicfMldIfEntryStartupQueryExpiryTime, hpicfMldIfEntryStatUnknownMldTypeRx=hpicfMldIfEntryStatUnknownMldTypeRx, hpicfMldIfEntryQuerierPort=hpicfMldIfEntryQuerierPort, hpicfMldMcastExcludeGroupJoinsCount=hpicfMldMcastExcludeGroupJoinsCount, hpicfMldIfGroupV3=hpicfMldIfGroupV3, hpicfMldPortConfigEntryInterfaceIfIndex=hpicfMldPortConfigEntryInterfaceIfIndex, hpicfMldSrcListAddress=hpicfMldSrcListAddress, hpicfMldFilteredGroupPortCachePortIndex=hpicfMldFilteredGroupPortCachePortIndex, hpicfMldGroupPortCacheFilterTimer=hpicfMldGroupPortCacheFilterTimer, hpicfMldIfEntryStatFilteredIncludeGroupJoinsCount=hpicfMldIfEntryStatFilteredIncludeGroupJoinsCount, hpicfMldConformance=hpicfMldConformance, hpicfMldIfEntryStatGSSQTx=hpicfMldIfEntryStatGSSQTx, hpicfMldIfEntryStatExcludeGroupJoinsCount=hpicfMldIfEntryStatExcludeGroupJoinsCount, hpicfMldIfEntryLastMemberQueryCount=hpicfMldIfEntryLastMemberQueryCount, hpicfMldIfEntryStatForwardToAllPortsTx=hpicfMldIfEntryStatForwardToAllPortsTx, hpicfMldCacheSrcCount=hpicfMldCacheSrcCount, hpicfMldFilteredGroupPortCacheExpiryTime=hpicfMldFilteredGroupPortCacheExpiryTime, hpicfMldCacheFilterMode=hpicfMldCacheFilterMode, hpicfMldSrcListExpiry=hpicfMldSrcListExpiry, hpicfMldCacheGroupV2=hpicfMldCacheGroupV2, hpicfMldCacheExcludeModeExpiryTimer=hpicfMldCacheExcludeModeExpiryTimer, hpicfMldPortConfigEntryIndex=hpicfMldPortConfigEntryIndex, hpicfMldGroupPortCacheUpTime=hpicfMldGroupPortCacheUpTime, hpicfMldCacheGroup=hpicfMldCacheGroup, PYSNMP_MODULE_ID=hpicfMldMIB, hpicfMldIfEntryStatV2GSQTx=hpicfMldIfEntryStatV2GSQTx, hpicfMldCacheIfIndex=hpicfMldCacheIfIndex, hpicfMldGroupPortCacheEntry=hpicfMldGroupPortCacheEntry, hpicfMldIfEntryState=hpicfMldIfEntryState, hpicfMldGroupPortCacheRequestedSrcCount=hpicfMldGroupPortCacheRequestedSrcCount, hpicfMldIfTable=hpicfMldIfTable, hpicfMldMcastPortFastLearn=hpicfMldMcastPortFastLearn, hpicfMldIfEntryStatV2GSQRx=hpicfMldIfEntryStatV2GSQRx, hpicfMldReloadModeGroup=hpicfMldReloadModeGroup, hpicfMldIfEntryStatFilteredExcludeGroupJoinsCount=hpicfMldIfEntryStatFilteredExcludeGroupJoinsCount, hpicfMldIfEntryStatFastLeaves=hpicfMldIfEntryStatFastLeaves, hpicfMldIfEntrySnoopingFeature=hpicfMldIfEntrySnoopingFeature, HpicfMcastGroupTypeDefinition=HpicfMcastGroupTypeDefinition, hpicfMldSrcListType=hpicfMldSrcListType, hpicfMldPortConfigEntryFastLeaveFeature=hpicfMldPortConfigEntryFastLeaveFeature, hpicfMldIfEntryStatMldV1ReportTx=hpicfMldIfEntryStatMldV1ReportTx, hpicfMldCacheUpTime=hpicfMldCacheUpTime, hpicfMldMIBCompliance=hpicfMldMIBCompliance, hpicfMldPortGroup=hpicfMldPortGroup, hpicfMldIfEntryStatBadCheckSumRx=hpicfMldIfEntryStatBadCheckSumRx, hpicfMldIfEntryStatForcedFastLeaves=hpicfMldIfEntryStatForcedFastLeaves, hpicfMldGroups=hpicfMldGroups, hpicfMldPortSrcFilterMode=hpicfMldPortSrcFilterMode, hpicfMldEnabledCount=hpicfMldEnabledCount, hpicfMldIfEntryStatMldV1ReportRx=hpicfMldIfEntryStatMldV1ReportRx, hpicfMldCacheExpiryTime=hpicfMldCacheExpiryTime, hpicfMldMIBComplianceV2=hpicfMldMIBComplianceV2, hpicfMldCacheVersion1HostTimer=hpicfMldCacheVersion1HostTimer, hpicfMldCompliances=hpicfMldCompliances, hpicfMldSrcListHostAddress=hpicfMldSrcListHostAddress, hpicfMldFilteredGroupPortCacheIfIndex=hpicfMldFilteredGroupPortCacheIfIndex, hpicfMldCacheLastReporter=hpicfMldCacheLastReporter, hpicfMldGroupPortCacheTable=hpicfMldGroupPortCacheTable, hpicfMldCacheStatus=hpicfMldCacheStatus, hpicfMldGroupPortCacheGroup=hpicfMldGroupPortCacheGroup, hpicfMldControlUnknownMulticast=hpicfMldControlUnknownMulticast, hpicfMldIfEntryStatPacketsRxOnDisabled=hpicfMldIfEntryStatPacketsRxOnDisabled, hpicfMldPortSrcIfIndex=hpicfMldPortSrcIfIndex, hpicfMldIfEntryStatGSQRx=hpicfMldIfEntryStatGSQRx, hpicfMldMcastGroupJoinsCount=hpicfMldMcastGroupJoinsCount, hpicfMldSrcListIfIndex=hpicfMldSrcListIfIndex, hpicfMldGroupPortCachePortIndex=hpicfMldGroupPortCachePortIndex, hpicfMldPortSrcHostAddress=hpicfMldPortSrcHostAddress, hpicfMldPortSrcGroup=hpicfMldPortSrcGroup, hpicfMldIfEntryStatForwardToRoutersTx=hpicfMldIfEntryStatForwardToRoutersTx, hpicfMldGroupPortCacheFilterMode=hpicfMldGroupPortCacheFilterMode, hpicfMldIfEntryStatStandardExcludeGroupJoinsCount=hpicfMldIfEntryStatStandardExcludeGroupJoinsCount, hpicfMldIfEntryOtherQuerierInterval=hpicfMldIfEntryOtherQuerierInterval, hpicfMldFilteredGroupPortCacheGroupAddress=hpicfMldFilteredGroupPortCacheGroupAddress, hpicfMldMIB=hpicfMldMIB, hpicfMldSrcListUpTime=hpicfMldSrcListUpTime, hpicfMldConfigForcedLeaveInterval=hpicfMldConfigForcedLeaveInterval, hpicfMldGroupPortCacheExcludeSrcCount=hpicfMldGroupPortCacheExcludeSrcCount, hpicfMldIfEntryStatMldV2ReportTx=hpicfMldIfEntryStatMldV2ReportTx, hpicfMldIfEntryStatUnknownPktRx=hpicfMldIfEntryStatUnknownPktRx, hpicfMldIfEntryStatStandardIncludeGroupJoinsCount=hpicfMldIfEntryStatStandardIncludeGroupJoinsCount, hpicfMldIfGroupV2=hpicfMldIfGroupV2, hpicfMldIfEntryStatMldV1LeaveRx=hpicfMldIfEntryStatMldV1LeaveRx, hpicfMldIfEntryStartupQueryInterval=hpicfMldIfEntryStartupQueryInterval, hpicfMldIfEntryStatMalformedPktRx=hpicfMldIfEntryStatMalformedPktRx, hpicfMldReload=hpicfMldReload, HpicfMldIfEntryState=HpicfMldIfEntryState, hpicfMldIfEntryStatWrongVersionQueries=hpicfMldIfEntryStatWrongVersionQueries, hpicfMldMcastIncludeGroupJoinsCount=hpicfMldMcastIncludeGroupJoinsCount, hpicfMldIfEntryStatV1QueryRx=hpicfMldIfEntryStatV1QueryRx, hpicfMldIfEntryQuerierFeature=hpicfMldIfEntryQuerierFeature, hpicfMldIfEntryStrictVersionMode=hpicfMldIfEntryStrictVersionMode, hpicfMldGroupPortCacheExpiryTime=hpicfMldGroupPortCacheExpiryTime, hpicfMldIfEntryStatQueryTx=hpicfMldIfEntryStatQueryTx, hpicfMldIfEntryStatIncludeGroupJoinsCount=hpicfMldIfEntryStatIncludeGroupJoinsCount, hpicfMldPortConfigEntryPortModeFeature=hpicfMldPortConfigEntryPortModeFeature, hpicfMldIfEntry=hpicfMldIfEntry, hpicfMldSrcListGroup=hpicfMldSrcListGroup, hpicfMldIfEntryStatV1GSQTx=hpicfMldIfEntryStatV1GSQTx, hpicfMldCacheEntry=hpicfMldCacheEntry, hpicfMldIfEntryStatGeneralQueryRx=hpicfMldIfEntryStatGeneralQueryRx, hpicfMldIfEntryStatV2QueryTx=hpicfMldIfEntryStatV2QueryTx, hpicfMldSrcListTable=hpicfMldSrcListTable, hpicfMldPortSrcEntry=hpicfMldPortSrcEntry, hpicfMldPortSrcUpTime=hpicfMldPortSrcUpTime, hpicfMldPortSrcPortIndex=hpicfMldPortSrcPortIndex, hpicfMldIfEntryStatV2QueryRx=hpicfMldIfEntryStatV2QueryRx, hpicfMldGroupType=hpicfMldGroupType, hpicfMldIfEntryFilteredJoins=hpicfMldIfEntryFilteredJoins, hpicfMldFilteredGroupPortCacheEntry=hpicfMldFilteredGroupPortCacheEntry, hpicfMldIfEntryStatMartianSourceRx=hpicfMldIfEntryStatMartianSourceRx, hpicfMldIfEntryStatJoinTimeouts=hpicfMldIfEntryStatJoinTimeouts, hpicfMldIfEntryStatGSQTx=hpicfMldIfEntryStatGSQTx, hpicfMldIfEntryStatV1QueryTx=hpicfMldIfEntryStatV1QueryTx, hpicfMldGroupPortCacheIfIndex=hpicfMldGroupPortCacheIfIndex, hpicfMldGroupPortCacheGroupAddress=hpicfMldGroupPortCacheGroupAddress, hpicfMldPortConfigEntry=hpicfMldPortConfigEntry, HpicfMldConfigPortModeType=HpicfMldConfigPortModeType, hpicfMldObjects=hpicfMldObjects, hpicfMld=hpicfMld, hpicfMldIfEntryStartupQueryCount=hpicfMldIfEntryStartupQueryCount, hpicfMldPortConfigEntryForcedLeaveFeature=hpicfMldPortConfigEntryForcedLeaveFeature, hpicfMldPortSrcTable=hpicfMldPortSrcTable, hpicfMldBaseGroup=hpicfMldBaseGroup, hpicfMldIfGroup=hpicfMldIfGroup, hpicfMldFilteredGroupPortCacheTable=hpicfMldFilteredGroupPortCacheTable, hpicfMldGroupPortCacheVersion1Timer=hpicfMldGroupPortCacheVersion1Timer, hpicfMldIfEntryOtherQuerierExpiryTime=hpicfMldIfEntryOtherQuerierExpiryTime, hpicfMldSrcListPorts=hpicfMldSrcListPorts, hpicfMldIfEntryStatMldV2ReportRx=hpicfMldIfEntryStatMldV2ReportRx)
# Author: Nic Wolfe <nic@wolfeden.ca> # URL: http://code.google.com/p/sickbeard/ # # This file is part of Sick Beard. # # Sick Beard is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Sick Beard is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with Sick Beard. If not, see <http://www.gnu.org/licenses/>. __all__ = ["mainDB", "cache"]
__all__ = ['mainDB', 'cache']
class Solution(object): def maxArea(self, height): """ :type height: List[int] :rtype: int """ start = 0 end = len(height)-1 best = 0 while start < end: best = max(best, self.getArea(start,end,height)) if height[start] < height[end]: start +=1 else: end-=1 return best def getArea (self, start, end, height): return min(height[start], height[end]) * (end - start)
class Solution(object): def max_area(self, height): """ :type height: List[int] :rtype: int """ start = 0 end = len(height) - 1 best = 0 while start < end: best = max(best, self.getArea(start, end, height)) if height[start] < height[end]: start += 1 else: end -= 1 return best def get_area(self, start, end, height): return min(height[start], height[end]) * (end - start)
def read_passphrases(): with open("day_04/input.txt", "r") as f: return [line.split() for line in f.readlines()] def part1(): return sum(len(phrase) == len(set(phrase)) for phrase in read_passphrases()) print(part1()) def anagram(passphrase): return len(passphrase) == len(set("".join(sorted(phrase)) for phrase in passphrase)) def part2(): return sum(anagram(phrase) for phrase in read_passphrases()) print(part2())
def read_passphrases(): with open('day_04/input.txt', 'r') as f: return [line.split() for line in f.readlines()] def part1(): return sum((len(phrase) == len(set(phrase)) for phrase in read_passphrases())) print(part1()) def anagram(passphrase): return len(passphrase) == len(set((''.join(sorted(phrase)) for phrase in passphrase))) def part2(): return sum((anagram(phrase) for phrase in read_passphrases())) print(part2())
autoref_rst=""" Math ==== .. index :: single: Math This is the reference documentation for the math modules. """ __all__ = ['kernel']
autoref_rst = '\nMath\n====\n.. index :: \n single: Math\n\nThis is the reference documentation for the math modules.\n' __all__ = ['kernel']
""" ID: IEV Title: Calculating Expected Offspring URL: http://rosalind.info/problems/iev/ """ # 1. P(AA-AA) = 1 (AA, AA, AA, AA) = 4/4 # 2. P(AA-Aa) = 1 (AA, AA, Aa, Aa) = 4/4 # 3. P(AA-aa) = 1 (Aa, Aa, Aa, Aa) = 4/4 # 4. P(Aa-Aa) = 0.75 (AA, Aa, Aa, aa) = 3/4 # 5. P(Aa-aa) = 0.5 (Aa, Aa, aa, aa) = 2/4 # 6. P(aa-aa) = 0 (aa, aa, aa, aa) = 0/4 probabilities = [1, 1, 1, 0.75, 0.5, 0] def get_expected_offspring(couples_string): """ Calculates the expected number of offspring displaying the dominant phenotype in the next generation, under the assumption that every couple has exactly two offspring. Args: couples_string (str): number of couples in a population possessing each genotype pairing for a given factor. Returns: float: expected offspring. """ couples = map(int, couples_string.split()) return sum([2 * probability * couple for probability, couple in zip(probabilities, couples)])
""" ID: IEV Title: Calculating Expected Offspring URL: http://rosalind.info/problems/iev/ """ probabilities = [1, 1, 1, 0.75, 0.5, 0] def get_expected_offspring(couples_string): """ Calculates the expected number of offspring displaying the dominant phenotype in the next generation, under the assumption that every couple has exactly two offspring. Args: couples_string (str): number of couples in a population possessing each genotype pairing for a given factor. Returns: float: expected offspring. """ couples = map(int, couples_string.split()) return sum([2 * probability * couple for (probability, couple) in zip(probabilities, couples)])
def n_params(model): """Return the number of parameters in a pytorch model. Args: model (nn.Module): The model to analyze. Returns: int: The number of parameters in the model. """ pp = 0 for p in list(model.parameters()): nn = 1 for s in list(p.size()): nn = nn * s pp += nn return pp
def n_params(model): """Return the number of parameters in a pytorch model. Args: model (nn.Module): The model to analyze. Returns: int: The number of parameters in the model. """ pp = 0 for p in list(model.parameters()): nn = 1 for s in list(p.size()): nn = nn * s pp += nn return pp
n = int(input()) a = sorted(list(map(int, input().split()))) if n % 2 == 1 and a[0] != 0: print(0) exit() for i in range(n % 2, n, 2): if a[i] != a[i + 1] or a[i] != i + 1: print(0) exit() print(2 ** (n // 2) % (10 ** 9 + 7))
n = int(input()) a = sorted(list(map(int, input().split()))) if n % 2 == 1 and a[0] != 0: print(0) exit() for i in range(n % 2, n, 2): if a[i] != a[i + 1] or a[i] != i + 1: print(0) exit() print(2 ** (n // 2) % (10 ** 9 + 7))
#------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. #-------------------------------------------------------------------------- # This is a placeholder file. It is deployed with inference only wheel. print("An inference only version of ONNX Runtime is installed. Training functionalities are unavailable.")
print('An inference only version of ONNX Runtime is installed. Training functionalities are unavailable.')
# Copyright 2010-2012 Institut Mines-Telecom # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. """ Created on Jun 19, 2012 @author: Bilel Msekni @contact: bilel.msekni@telecom-sudparis.eu @author: Houssem Medhioub @contact: houssem.medhioub@it-sudparis.eu @organization: Institut Mines-Telecom - Telecom SudParis @license: Apache License, Version 2.0 """ #======================================================================================================================= # JSON format #======================================================================================================================= kind =\ "{"\ "\"kinds\": ["\ "{"\ "\"term\": \"compute\","\ """ "scheme": "http://schemas.ogf.org/occi/infrastructure#", "title": "Compute Resource no2", "attributes": { "occi": { "compute": { "hostname": { "mutable": true, "required": false, "type": "string", "pattern": "(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\\\\-]*[a-zA-Z0-9])\\\\.)*", "minimum": "1", "maximum": "255" }, "state": { "mutable": false, "required": false, "type": "string", "pattern": "inactive|active|suspended|failed", "default": "inactive" } } } }, "actions": [ "http://schemas.ogf.org/occi/infrastructure/compute/action#start" ], """\ "\"location\": \"/compute/\""\ "}"\ "]"\ "}" #======================================================================================================================= mixin = """ { "mixins": [ { "term": "medium", "scheme": "http://example.com/template/resource#", "title": "Medium VM", "attributes": { "occi": { "compute": { "speed": { "type": "number", "default": 3.0 } } } }, "location": "/template/resource/medium/" } ] } """ #======================================================================================================================= action =\ """ { "actions": [ { "term": "start", "scheme": "http://schemas.ogf.org/occi/infrastructure/compute/action#", "title": "Start Compute instance now", "attributes": { "method": { "mutable": false, "required": false, "type": "string", "pattern": "graceful|acpion|poweron", "default": "poweron" } } } ] } """ #======================================================================================================================= put_provider = """ { "providers": [ { "Provider": { "local": [ "dummy" ], "remote": [ "Bilel" ] }, "OCCI_ID": "http://schemas.ogf.org/occi/infrastructure#compute" } ] } """ action_plus_attributes =\ """ { "actions": [ { "term": "start", "scheme": "http://schemas.ogf.org/occi/infrastructure/compute/action#", "title": "Start Compute instance now", "attributes": { "method": { "mutable": true, "required": false, "type": "string", "pattern": "graceful|acpion|poweron", "default": "poweron" } } } ], "attributes": { "occi": { "infrastructure": { "networkinterface": { "interface": "eth0", "mac": "00:80:41:ae:fd:7e", "address": "192.168.0.100", "gateway": "192.168.0.1", "allocation": "dynamic" } } } } } """ #======================================================================================================================= # HTTP format #======================================================================================================================= kind_occci_id = """Category: compute; scheme="http://schemas.ogf.org/occi/infrastructure#"; class=kind; """ #======================================================================================================================= mixin_occci_id = """Category: medium; scheme="http://example.com/template/resource#"; class=mixin; """ #======================================================================================================================= action_occci_id = """Category: start;scheme="http://schemas.ogf.org/occi/infrastructure/compute/action#"; class=action; """ #======================================================================================================================= mixin_http = "Category : my_stuff;\""\ "scheme=\"http://example.com/occi/my_stuff#\";"\ "class=\"mixin\";"\ "title=\"Storage Resource\";"\ "location=\"/my_stuff/\";"\ "attributes=\"occi.storage.size{required},occi.storage.state{immutable}\";"\ \ #======================================================================================================================= kind_http = "Category: compute5;"\ "scheme=\"http://schemas.ogf.org/occi/infrastructure#\";"\ "class=\"kind\";"\ "title=\"Compute Resource type\";"\ "rel=\"http://schemas.ogf.org/occi/core#resource\";"\ "attributes=\"occi.compute.cores, occi.compute.state{immutable}\";"\ "actions=\"http://schemas.ogf.org/occi/infrastructure/compute/action#stop\";"\ "location=\"http://example.com/compute/\"" #======================================================================================================================= action_att_http = """Category: start; scheme="http://schemas.ogf.org/occi/infrastructure/compute/action#"; class=action; X-OCCI-Attribute: occi.compute.cores=20:2 """
""" Created on Jun 19, 2012 @author: Bilel Msekni @contact: bilel.msekni@telecom-sudparis.eu @author: Houssem Medhioub @contact: houssem.medhioub@it-sudparis.eu @organization: Institut Mines-Telecom - Telecom SudParis @license: Apache License, Version 2.0 """ kind = '{"kinds": [{"term": "compute",\n"scheme": "http://schemas.ogf.org/occi/infrastructure#",\n"title": "Compute Resource no2",\n"attributes": {\n "occi": {\n "compute": {\n "hostname": {\n "mutable": true,\n "required": false,\n "type": "string",\n "pattern": "(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\\\\-]*[a-zA-Z0-9])\\\\.)*",\n "minimum": "1",\n "maximum": "255"\n },\n "state": {\n "mutable": false,\n "required": false,\n "type": "string",\n "pattern": "inactive|active|suspended|failed",\n "default": "inactive"\n }\n }\n }\n},\n"actions": [\n "http://schemas.ogf.org/occi/infrastructure/compute/action#start"\n],\n"location": "/compute/"}]}' mixin = '\n{\n"mixins": [\n {\n "term": "medium",\n "scheme": "http://example.com/template/resource#",\n "title": "Medium VM",\n "attributes": {\n "occi": {\n "compute": {\n "speed": {\n "type": "number",\n "default": 3.0\n }\n }\n }\n },\n "location": "/template/resource/medium/"\n }\n]\n}\n\n' action = '\n {\n "actions": [\n {\n "term": "start",\n "scheme": "http://schemas.ogf.org/occi/infrastructure/compute/action#",\n "title": "Start Compute instance now",\n "attributes": {\n "method": {\n "mutable": false,\n "required": false,\n "type": "string",\n "pattern": "graceful|acpion|poweron",\n "default": "poweron"\n }\n }\n }\n ]\n}\n' put_provider = '\n {\n "providers": [\n {\n "Provider": {\n "local": [\n "dummy"\n ],\n "remote": [\n "Bilel"\n ]\n },\n "OCCI_ID": "http://schemas.ogf.org/occi/infrastructure#compute"\n }\n ]\n}\n' action_plus_attributes = '\n {\n "actions": [\n {\n "term": "start",\n "scheme": "http://schemas.ogf.org/occi/infrastructure/compute/action#",\n "title": "Start Compute instance now",\n "attributes": {\n "method": {\n "mutable": true,\n "required": false,\n "type": "string",\n "pattern": "graceful|acpion|poweron",\n "default": "poweron"\n }\n }\n }\n ],\n "attributes": {\n "occi": {\n "infrastructure": {\n "networkinterface": {\n "interface": "eth0",\n "mac": "00:80:41:ae:fd:7e",\n "address": "192.168.0.100",\n "gateway": "192.168.0.1",\n "allocation": "dynamic"\n }\n }\n }\n }\n}\n' kind_occci_id = 'Category: compute;\nscheme="http://schemas.ogf.org/occi/infrastructure#";\nclass=kind;\n' mixin_occci_id = 'Category: medium;\n scheme="http://example.com/template/resource#";\n class=mixin;\n' action_occci_id = 'Category: start;scheme="http://schemas.ogf.org/occi/infrastructure/compute/action#"; class=action;\n' mixin_http = 'Category : my_stuff;"scheme="http://example.com/occi/my_stuff#";class="mixin";title="Storage Resource";location="/my_stuff/";attributes="occi.storage.size{required},occi.storage.state{immutable}";' kind_http = 'Category: compute5;scheme="http://schemas.ogf.org/occi/infrastructure#";class="kind";title="Compute Resource type";rel="http://schemas.ogf.org/occi/core#resource";attributes="occi.compute.cores, occi.compute.state{immutable}";actions="http://schemas.ogf.org/occi/infrastructure/compute/action#stop";location="http://example.com/compute/"' action_att_http = 'Category: start;\n scheme="http://schemas.ogf.org/occi/infrastructure/compute/action#";\n class=action;\n X-OCCI-Attribute: occi.compute.cores=20:2\n'
''' Basic Info ''' __version__ = '0.1'
""" Basic Info """ __version__ = '0.1'
def maprange( a, b, s): (a1, a2), (b1, b2) = a, b return b1 + ((s - a1) * (b2 - b1) / (a2 - a1)) for s in range(11): print("%2g maps to %g" % (s, maprange( (0, 10), (-1, 0), s)))
def maprange(a, b, s): ((a1, a2), (b1, b2)) = (a, b) return b1 + (s - a1) * (b2 - b1) / (a2 - a1) for s in range(11): print('%2g maps to %g' % (s, maprange((0, 10), (-1, 0), s)))
strings = { 'str NaN': 'NaN', 'str none': 'None', 'str true': 'True', 'str false': 'False', 'str 0': '0', 'str -1': '-1', 'str -1.5': '-1.5', 'str 0.42': '0.42', 'str .42': '.42', 'str 1.2E+9': '1.2E+9', 'str 1.2e8': '1.2e8', 'str 0xFF': '0xFF', 'str Inf..': 'Infinity', 'str empty': '', 'str space': ' ', 'str [Ob]': '[object Object]', 'str dot': '.', 'str +': '+', 'str -': '-', 'str 99,999': '99,999', 'str date': '2077-09-08', 'str #abcdef': '#abcdef', 'str 1.2.3': '1.2.3', 'str blah': 'blah', }
strings = {'str NaN': 'NaN', 'str none': 'None', 'str true': 'True', 'str false': 'False', 'str 0': '0', 'str -1': '-1', 'str -1.5': '-1.5', 'str 0.42': '0.42', 'str .42': '.42', 'str 1.2E+9': '1.2E+9', 'str 1.2e8': '1.2e8', 'str 0xFF': '0xFF', 'str Inf..': 'Infinity', 'str empty': '', 'str space': ' ', 'str [Ob]': '[object Object]', 'str dot': '.', 'str +': '+', 'str -': '-', 'str 99,999': '99,999', 'str date': '2077-09-08', 'str #abcdef': '#abcdef', 'str 1.2.3': '1.2.3', 'str blah': 'blah'}
# coding: utf8 #!/usr/bin/python2 def directorymaker(): pass
def directorymaker(): pass
ZALORA_URLS = ['https://www.zalora.co.id/women/pakaian/atasan/?from=header'] def get_start_urls(): return ZALORA_URLS
zalora_urls = ['https://www.zalora.co.id/women/pakaian/atasan/?from=header'] def get_start_urls(): return ZALORA_URLS
name0_0_0_1_0_1_0 = None name0_0_0_1_0_1_1 = None name0_0_0_1_0_1_2 = None name0_0_0_1_0_1_3 = None name0_0_0_1_0_1_4 = None
name0_0_0_1_0_1_0 = None name0_0_0_1_0_1_1 = None name0_0_0_1_0_1_2 = None name0_0_0_1_0_1_3 = None name0_0_0_1_0_1_4 = None
# Copyright (C) 2019-2020, TomTom (http://tomtom.com). # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. class Coordinate: """Class to hold information about a coordinate. A coordinate has a latitude, longitude, and an altitude. Attributes: latitude: Latitude in degrees. longitude: Longitude in degrees. altitude: Altitude in meters. """ latitude: float longitude: float altitude: float def __init__(self): self.latitude = 0.0 self.longitude = 0.0 self.altitude = 0.0 def is_valid(self) -> bool: """Check if the coordinate is valid. A coordinate is valid if its values are within WGS84 bounds. Returns: True if valid, False if not. """ ... @classmethod def from_string(cls, value: str) -> "Coordinate": """Create a coordinate from its string representation.""" ... @staticmethod def combine(left: "Coordinate", right: "Coordinate") -> "Coordinate": """Combine two coordinates.""" ...
class Coordinate: """Class to hold information about a coordinate. A coordinate has a latitude, longitude, and an altitude. Attributes: latitude: Latitude in degrees. longitude: Longitude in degrees. altitude: Altitude in meters. """ latitude: float longitude: float altitude: float def __init__(self): self.latitude = 0.0 self.longitude = 0.0 self.altitude = 0.0 def is_valid(self) -> bool: """Check if the coordinate is valid. A coordinate is valid if its values are within WGS84 bounds. Returns: True if valid, False if not. """ ... @classmethod def from_string(cls, value: str) -> 'Coordinate': """Create a coordinate from its string representation.""" ... @staticmethod def combine(left: 'Coordinate', right: 'Coordinate') -> 'Coordinate': """Combine two coordinates.""" ...
email_info = { 'recepient' : 'a.b@c.com', 'messages' : {'TOO_LOW' : 'Hi, the temperature is too low', 'TOO_HIGH' : 'Hi, the temperature is too high' } } def DefineCoolingtype_limits(coolingType): coolingtype_limits = { 'PASSIVE_COOLING' : {"lowerLimit" : 0, "upperLimit" : 35}, 'HI_ACTIVE_COOLING' : {"lowerLimit" : 0, "upperLimit" : 45}, 'MED_ACTIVE_COOLING' : {"lowerLimit" : 0, "upperLimit" : 40} } if coolingType in coolingtype_limits.keys(): return(coolingtype_limits[coolingType]) else: return({"lowerLimit" : 'NA', "upperLimit" : 'NA'}) def infer_breach(value, lowerLimit, upperLimit): if value < lowerLimit: return 'TOO_LOW' if value > upperLimit: return 'TOO_HIGH' return 'NORMAL' def classify_temperature_breach(coolingType, temperatureInC): limits = DefineCoolingtype_limits(coolingType) if 'NA' not in limits.values(): return infer_breach(temperatureInC, limits['lowerLimit'], limits['upperLimit']) else: return "Invalid cooling type" def IsbatteryCharValid(batteryChar): batteryChar_types = ['PASSIVE_COOLING', 'HI_ACTIVE_COOLING', 'MED_ACTIVE_COOLING'] if batteryChar in batteryChar_types: return True return False def GetBreachType(batteryChar, temperatureInC): breachType = classify_temperature_breach(batteryChar, temperatureInC) if IsbatteryCharValid(batteryChar) else False return breachType if breachType!=False else 'Invalid_Param' def check_and_alert(alertTarget, batteryChar, temperatureInC): breachType = GetBreachType(batteryChar, temperatureInC) alert_status = alertTarget(breachType) if breachType!='Invalid_Param' else False return(breachType) def send_to_controller(breachType): header = 0xfeed command_to_controller = (f'{header}, {breachType}') PrintMessageONConsole(command_to_controller) return(command_to_controller) def Generate_email_content(breachtype, email_messages): return email_messages[breachtype] def PrintMessageONConsole(message): print(message) return True def send_to_email(breachType): mail_content = Generate_email_content(breachType, email_info['messages']) sent_email = f"To: {email_info['recepient']} : {mail_content}" PrintMessageONConsole(sent_email) return(sent_email)
email_info = {'recepient': 'a.b@c.com', 'messages': {'TOO_LOW': 'Hi, the temperature is too low', 'TOO_HIGH': 'Hi, the temperature is too high'}} def define_coolingtype_limits(coolingType): coolingtype_limits = {'PASSIVE_COOLING': {'lowerLimit': 0, 'upperLimit': 35}, 'HI_ACTIVE_COOLING': {'lowerLimit': 0, 'upperLimit': 45}, 'MED_ACTIVE_COOLING': {'lowerLimit': 0, 'upperLimit': 40}} if coolingType in coolingtype_limits.keys(): return coolingtype_limits[coolingType] else: return {'lowerLimit': 'NA', 'upperLimit': 'NA'} def infer_breach(value, lowerLimit, upperLimit): if value < lowerLimit: return 'TOO_LOW' if value > upperLimit: return 'TOO_HIGH' return 'NORMAL' def classify_temperature_breach(coolingType, temperatureInC): limits = define_coolingtype_limits(coolingType) if 'NA' not in limits.values(): return infer_breach(temperatureInC, limits['lowerLimit'], limits['upperLimit']) else: return 'Invalid cooling type' def isbattery_char_valid(batteryChar): battery_char_types = ['PASSIVE_COOLING', 'HI_ACTIVE_COOLING', 'MED_ACTIVE_COOLING'] if batteryChar in batteryChar_types: return True return False def get_breach_type(batteryChar, temperatureInC): breach_type = classify_temperature_breach(batteryChar, temperatureInC) if isbattery_char_valid(batteryChar) else False return breachType if breachType != False else 'Invalid_Param' def check_and_alert(alertTarget, batteryChar, temperatureInC): breach_type = get_breach_type(batteryChar, temperatureInC) alert_status = alert_target(breachType) if breachType != 'Invalid_Param' else False return breachType def send_to_controller(breachType): header = 65261 command_to_controller = f'{header}, {breachType}' print_message_on_console(command_to_controller) return command_to_controller def generate_email_content(breachtype, email_messages): return email_messages[breachtype] def print_message_on_console(message): print(message) return True def send_to_email(breachType): mail_content = generate_email_content(breachType, email_info['messages']) sent_email = f"To: {email_info['recepient']} : {mail_content}" print_message_on_console(sent_email) return sent_email
# -*- coding: utf-8 -*- # vim: set sw=4 ts=4 expandtab : class ArgError(Exception): def __init__(self, message): if message == None: self.message = 'node error' else: self.message = message
class Argerror(Exception): def __init__(self, message): if message == None: self.message = 'node error' else: self.message = message
@PixieApp class Test(): @route() def main_screen(self): return """ <button type="submit" pd_script="call_me()" pd_target="target{{prefix}}"> <pd_script> self.name="some value" print("This is a multi-line pd_script") </pd_script> Click me </button> <div id="target{{prefix}}"></div> """ Test().run()
@PixieApp class Test: @route() def main_screen(self): return '\n <button type="submit" \npd_script="call_me()" \npd_target="target{{prefix}}">\n <pd_script>\nself.name="some value"\nprint("This is a multi-line pd_script")\n </pd_script>\n Click me\n </button>\n \n <div id="target{{prefix}}"></div>\n ' test().run()
def formula_transform(formula): """ :param formula: dependent variable ~ covariant | fixed_effect |clusters' :type formula: str :return: Lists of out_col, consist_col, category_col, cluster_col, respectively. :rtype: (list[str], list[str], list[str], list[str]) """ phenotype = formula.replace(' ', '').split("~") assert len(phenotype) == 2, f"Formula must have a phenotype separated by ~ yet failed to find via splitting " \ f"for {formula}" # Split the right hand side out, validate there is only one phenotype phenotype, rhs = phenotype assert len(phenotype.split("+")) == 1, f"Can only provide a single phenotype per OLS yet found " \ f"{phenotype.split('+')}" segments = rhs.split("|") assert 1 <= len(segments) < 4 and sum([len(seg) for seg in segments]) != 0, \ f"Right hand side should be 'covariant | fixed_effect | cluster's meaning.\nAll models should have at least " \ f"a covariant, and can be max length of 3 yet found: {segments}" # Ensure segments are of length 3 segments = segments + ["" for _ in range(3 - len(segments))] # Split each section on + then return the phenotype, covariant, fixed_effect and cluster variables sections = [[phenotype]] + [section.split("+") if len(section) > 0 else [] for section in segments] phenotype, covariant, fixed_effects, clusters = sections return phenotype, covariant, fixed_effects, clusters
def formula_transform(formula): """ :param formula: dependent variable ~ covariant | fixed_effect |clusters' :type formula: str :return: Lists of out_col, consist_col, category_col, cluster_col, respectively. :rtype: (list[str], list[str], list[str], list[str]) """ phenotype = formula.replace(' ', '').split('~') assert len(phenotype) == 2, f'Formula must have a phenotype separated by ~ yet failed to find via splitting for {formula}' (phenotype, rhs) = phenotype assert len(phenotype.split('+')) == 1, f"Can only provide a single phenotype per OLS yet found {phenotype.split('+')}" segments = rhs.split('|') assert 1 <= len(segments) < 4 and sum([len(seg) for seg in segments]) != 0, f"Right hand side should be 'covariant | fixed_effect | cluster's meaning.\nAll models should have at least a covariant, and can be max length of 3 yet found: {segments}" segments = segments + ['' for _ in range(3 - len(segments))] sections = [[phenotype]] + [section.split('+') if len(section) > 0 else [] for section in segments] (phenotype, covariant, fixed_effects, clusters) = sections return (phenotype, covariant, fixed_effects, clusters)
# encoding: utf-8 # module System.Custom calls itself Custom # from Wms.RemotingObjects,Version=1.23.1.0,Culture=neutral,PublicKeyToken=null # by generator 1.145 # no doc # no important # functions def Tuple(args,kwargs): # real signature unknown """ """ pass # no classes
def tuple(args, kwargs): """ """ pass
# Definition for singly-linked list. class ListNode: def __init__(self, x): self.val = x self.next = None class Solution: def rotateRight(self, head: ListNode, k: int) -> ListNode: if head is None: return head l = 1 tail = head while tail.next: tail = tail.next l += 1 k %= l p = head for _ in range(l - 1 - k): p = p.next tail.next = head head = p.next p.next = None return head
class Listnode: def __init__(self, x): self.val = x self.next = None class Solution: def rotate_right(self, head: ListNode, k: int) -> ListNode: if head is None: return head l = 1 tail = head while tail.next: tail = tail.next l += 1 k %= l p = head for _ in range(l - 1 - k): p = p.next tail.next = head head = p.next p.next = None return head
"""VIC Emergency Incidents constants.""" ATTR_CATEGORY1 = "category1" ATTR_CATEGORY2 = "category2" ATTR_DESCRIPTION = "description" ATTR_ID = "id" ATTR_PUB_DATE = "updated" ATTR_SOURCE_TITLE = "sourceTitle" ATTR_SOURCE_ORG = "sourceOrg" ATTR_ESTA_ID = "estaid" ATTR_RESOURCES = "resources" ATTRIBUTION = "VICEmergency" ATTR_SIZE = "size" ATTR_SIZE_FMT = "sizefmt" ATTR_LOCATION = "location" ATTR_TEXT = "text" ATTR_STATUS = "status" ATTR_TYPE = "feedtype" ATTR_STATEWIDE = "statewide" ATTR_WEBBODY = "webBody" CUSTOM_ATTRIBUTE = "custom_attribute" URL = "http://emergency.vic.gov.au/public/osom-geojson.json"
"""VIC Emergency Incidents constants.""" attr_category1 = 'category1' attr_category2 = 'category2' attr_description = 'description' attr_id = 'id' attr_pub_date = 'updated' attr_source_title = 'sourceTitle' attr_source_org = 'sourceOrg' attr_esta_id = 'estaid' attr_resources = 'resources' attribution = 'VICEmergency' attr_size = 'size' attr_size_fmt = 'sizefmt' attr_location = 'location' attr_text = 'text' attr_status = 'status' attr_type = 'feedtype' attr_statewide = 'statewide' attr_webbody = 'webBody' custom_attribute = 'custom_attribute' url = 'http://emergency.vic.gov.au/public/osom-geojson.json'
class ApiException(Exception): def __init__(self, response): if response.status_code == 404: self._rollbar_ignore = True message = response.text super(ApiException, self).__init__(message)
class Apiexception(Exception): def __init__(self, response): if response.status_code == 404: self._rollbar_ignore = True message = response.text super(ApiException, self).__init__(message)
__author__ = 'Chirag' x = {"Tom", 2.71, 36, 36} # is a set. REPETITION NOT ALLOWED y = ["Tom", 2.71, 36, 36] # is a list. MUTABLE print("x is a SET : ", x) print("y is a LIST : ", y) print() #=========================================== # CREATE sets s = {1,2,3,4,5} # direct declare print(s) s = set() for i in range(1,6): s.add(i) # using .add() method print(s) s = set([x for x in range(1,6)]) print(s) # list comprehension + conversion print() #=========================================== # SETS don't have order. Therefore no # indexing access is available list1 = [1,1,2,2,3,4,5,6,1,1] print(f"list1 = {list1}") s = set(list1) print(f"s = set(list1) = {s}") print() #=========================================== # METHODS for sets include .intersection() # .union() .issubset() etc. print(f"len(s) = {len(s)}") #===========================================
__author__ = 'Chirag' x = {'Tom', 2.71, 36, 36} y = ['Tom', 2.71, 36, 36] print('x is a SET : ', x) print('y is a LIST : ', y) print() s = {1, 2, 3, 4, 5} print(s) s = set() for i in range(1, 6): s.add(i) print(s) s = set([x for x in range(1, 6)]) print(s) print() list1 = [1, 1, 2, 2, 3, 4, 5, 6, 1, 1] print(f'list1 = {list1}') s = set(list1) print(f's = set(list1) = {s}') print() print(f'len(s) = {len(s)}')
# Python3 program to Merge Two Binary Trees # Helper class that allocates a new node # with the given data and None left and # right pointers. class newNode: def __init__(self, data): self.data = data self.left = self.right = None # Given a binary tree, prints nodes # in inorder def inorder(node): if not node: return # first recur on left child inorder(node.left) # then print the data of node print(node.data, end=" ") # now recur on right child inorder(node.right) # Function to merge given two # binary trees def MergeTrees(t1, t2): if not t1: return t2 if not t2: return t1 t1.data += t2.data t1.left = MergeTrees(t1.left, t2.left) t1.right = MergeTrees(t1.right, t2.right) return t1 # Driver code if __name__ == "__main__": # Let us construct the first Binary Tree # 1 # / \ # 2 3 # / \ \ # 4 5 6 root1 = newNode(1) root1.left = newNode(2) root1.right = newNode(3) root1.left.left = newNode(4) root1.left.right = newNode(5) root1.right.right = newNode(6) # Let us construct the second Binary Tree # 4 # / \ # 1 7 # / / \ # 3 2 6 root2 = newNode(4) root2.left = newNode(1) root2.right = newNode(7) root2.left.left = newNode(3) root2.right.left = newNode(2) root2.right.right = newNode(6) root3 = MergeTrees(root1, root2) print("The Merged Binary Tree is:") inorder(root3) # This code is contributed by PranchalK
class Newnode: def __init__(self, data): self.data = data self.left = self.right = None def inorder(node): if not node: return inorder(node.left) print(node.data, end=' ') inorder(node.right) def merge_trees(t1, t2): if not t1: return t2 if not t2: return t1 t1.data += t2.data t1.left = merge_trees(t1.left, t2.left) t1.right = merge_trees(t1.right, t2.right) return t1 if __name__ == '__main__': root1 = new_node(1) root1.left = new_node(2) root1.right = new_node(3) root1.left.left = new_node(4) root1.left.right = new_node(5) root1.right.right = new_node(6) root2 = new_node(4) root2.left = new_node(1) root2.right = new_node(7) root2.left.left = new_node(3) root2.right.left = new_node(2) root2.right.right = new_node(6) root3 = merge_trees(root1, root2) print('The Merged Binary Tree is:') inorder(root3)
def find_lis(a): T = [None]*len(a) prev = [None]*len(a) for i in range(len(a)): T[i] = 1 prev[i] = -1 for j in range(i): if a[j] <= a[i] and T[i]< T[j]+1: T[i] = T[j]+1 prev[i] = j longest =max(T) i = 0 for i in range( len(a)): if T[i] == longest: break store = [] while i > 0: store.append(a[i]) i = prev[i] return store if __name__ =='__main__': a= [7, 2, 1, 3, 8, 4, 9, 1, 2, 6] # a= [1, 7,2, 3, 8, 4, 9 ] print(find_lis(a))
def find_lis(a): t = [None] * len(a) prev = [None] * len(a) for i in range(len(a)): T[i] = 1 prev[i] = -1 for j in range(i): if a[j] <= a[i] and T[i] < T[j] + 1: T[i] = T[j] + 1 prev[i] = j longest = max(T) i = 0 for i in range(len(a)): if T[i] == longest: break store = [] while i > 0: store.append(a[i]) i = prev[i] return store if __name__ == '__main__': a = [7, 2, 1, 3, 8, 4, 9, 1, 2, 6] print(find_lis(a))
# -*- coding: utf-8 -*- """ Created on Mon Dec 6 23:56:31 2010 @author: Alexander Tsepkov """ """ This class wraps around ImageData HTML5 Canvas object and allows easier per-pixel access """ class ImageData: def __init__(self, imagedata): self.width = imagedata.width self.height = imagedata.height self.data = imagedata.data def getWidth(self): return self.width def getHeight(self): return self.height def getData(self): return self.data def setData(self, data): self.data = data def getPixel(self, x, y): offset = (y*self.width + x)*4 return self.data[offset:offset+4] """ rgba must be an array of 4 integers ranging from 0 to 255 """ def setPixel(self, x, y, rgba): offset = (y*self.width + x)*4 self.data[offset:offset+4] = rgba
""" Created on Mon Dec 6 23:56:31 2010 @author: Alexander Tsepkov """ '\nThis class wraps around ImageData HTML5 Canvas object and allows easier \nper-pixel access\n' class Imagedata: def __init__(self, imagedata): self.width = imagedata.width self.height = imagedata.height self.data = imagedata.data def get_width(self): return self.width def get_height(self): return self.height def get_data(self): return self.data def set_data(self, data): self.data = data def get_pixel(self, x, y): offset = (y * self.width + x) * 4 return self.data[offset:offset + 4] '\n rgba must be an array of 4 integers ranging from 0 to 255\n ' def set_pixel(self, x, y, rgba): offset = (y * self.width + x) * 4 self.data[offset:offset + 4] = rgba
# Problem 3 # Largest prime factor # The prime factors of 13195 are 5, 7, 13 and 29. # What is the largest prime factor of the number 600851475143 ? def is_prime(num): if num == 1: return False i = 2 while i*i <= num: if num % i == 0: return False i += 1 return True huge = 600851475143 # 600851475143 / 71 = 8462696833 / 839 = 10086647 / 1471 = 6857 for x in reversed(range(1,10000)): if is_prime(x): if huge % x == 0: print(x) # result is 6857 # 6857 # 1471 # 839 # 71
def is_prime(num): if num == 1: return False i = 2 while i * i <= num: if num % i == 0: return False i += 1 return True huge = 600851475143 for x in reversed(range(1, 10000)): if is_prime(x): if huge % x == 0: print(x)
# defines a mutable class class Mutable(): def __init__(self): self.layers = [] def getGen(self): gen = [] for layer in self.layers: gen += layer.getWeights() return gen def mutateWith(self, lover): genSelf = self.getGen() genLover = lover.getGen() self.setGen(self.mutationFunction(genSelf, genLover)) def setGen(self, gen): for layer in self.layers: layer.setWeights(gen[:layer.size]) del gen[:layer.size] print("Layer added") if len(gen) > 0: print("error, some genes were not used")
class Mutable: def __init__(self): self.layers = [] def get_gen(self): gen = [] for layer in self.layers: gen += layer.getWeights() return gen def mutate_with(self, lover): gen_self = self.getGen() gen_lover = lover.getGen() self.setGen(self.mutationFunction(genSelf, genLover)) def set_gen(self, gen): for layer in self.layers: layer.setWeights(gen[:layer.size]) del gen[:layer.size] print('Layer added') if len(gen) > 0: print('error, some genes were not used')
#!/usr/bin/env python3 # -*- encoding: utf-8 -*- __author__ = 'Florents Tselai' REDIS_URI = '127.0.0.1' REDIS_CAR_KEYSPACE = 'pycargr:car:{}' SEARCH_BASE_URL = 'https://www.car.gr/classifieds/cars/' CACHE_EXPIRE_IN = 24 * 3600
__author__ = 'Florents Tselai' redis_uri = '127.0.0.1' redis_car_keyspace = 'pycargr:car:{}' search_base_url = 'https://www.car.gr/classifieds/cars/' cache_expire_in = 24 * 3600
""" [2015-07-06] Challenge #222 [Easy] Balancing Words https://www.reddit.com/r/dailyprogrammer/comments/3c9a9h/20150706_challenge_222_easy_balancing_words/ # Description Today we're going to balance words on one of the letters in them. We'll use the position and letter itself to calculate the weight around the balance point. A word can be balanced if the weight on either side of the balance point is equal. Not all words can be balanced, but those that can are interesting for this challenge. The formula to calculate the weight of the word is to look at the letter position in the English alphabet (so A=1, B=2, C=3 ... Z=26) as the letter weight, then multiply that by the distance from the balance point, so the first letter away is multiplied by 1, the second away by 2, etc. As an example: STEAD balances at T: 1 * S(19) = 1 * E(5) + 2 * A(1) + 3 * D(4)) # Input Description You'll be given a series of English words. Example: STEAD # Output Description Your program or function should emit the words split by their balance point and the weight on either side of the balance point. Example: S T EAD - 19 This indicates that the T is the balance point and that the weight on either side is 19. # Challenge Input CONSUBSTANTIATION WRONGHEADED UNINTELLIGIBILITY SUPERGLUE # Challenge Output *Updated* - the weights and answers I had originally were wrong. My apologies. CONSUBST A NTIATION - 456 WRO N GHEADED - 120 UNINTELL I GIBILITY - 521 SUPERGLUE DOES NOT BALANCE # Notes This was found on a [word games page](http://www.questrel.com/records.html) suggested by /u/cDull, thanks! If you have your own idea for a challenge, submit it to /r/DailyProgrammer_Ideas, and there's a good chance we'll post it. """ def main(): pass if __name__ == "__main__": main()
""" [2015-07-06] Challenge #222 [Easy] Balancing Words https://www.reddit.com/r/dailyprogrammer/comments/3c9a9h/20150706_challenge_222_easy_balancing_words/ # Description Today we're going to balance words on one of the letters in them. We'll use the position and letter itself to calculate the weight around the balance point. A word can be balanced if the weight on either side of the balance point is equal. Not all words can be balanced, but those that can are interesting for this challenge. The formula to calculate the weight of the word is to look at the letter position in the English alphabet (so A=1, B=2, C=3 ... Z=26) as the letter weight, then multiply that by the distance from the balance point, so the first letter away is multiplied by 1, the second away by 2, etc. As an example: STEAD balances at T: 1 * S(19) = 1 * E(5) + 2 * A(1) + 3 * D(4)) # Input Description You'll be given a series of English words. Example: STEAD # Output Description Your program or function should emit the words split by their balance point and the weight on either side of the balance point. Example: S T EAD - 19 This indicates that the T is the balance point and that the weight on either side is 19. # Challenge Input CONSUBSTANTIATION WRONGHEADED UNINTELLIGIBILITY SUPERGLUE # Challenge Output *Updated* - the weights and answers I had originally were wrong. My apologies. CONSUBST A NTIATION - 456 WRO N GHEADED - 120 UNINTELL I GIBILITY - 521 SUPERGLUE DOES NOT BALANCE # Notes This was found on a [word games page](http://www.questrel.com/records.html) suggested by /u/cDull, thanks! If you have your own idea for a challenge, submit it to /r/DailyProgrammer_Ideas, and there's a good chance we'll post it. """ def main(): pass if __name__ == '__main__': main()
a = 28 b = 1.5 c = 'hello' d = True e = None print(a,b,c,d,e)
a = 28 b = 1.5 c = 'hello' d = True e = None print(a, b, c, d, e)
# -*- coding: utf-8 -*- class Fila: def __init__(self): self.element = list() def inserir(self,name): self.element.append(name) print(f'Inserindo o elemento {name}: ' + ' '.join(self.element)) def remover(self): self.element.pop(0) print(f'Removendo o primeiro elemento: ' + ' '.join(self.element)) def exibir(self): print('Fila: ' + ' '.join(self.element)) fila = Fila() fila.inserir('apple') fila.inserir('grape') fila.inserir('lemon') fila.remover() fila.exibir()
class Fila: def __init__(self): self.element = list() def inserir(self, name): self.element.append(name) print(f'Inserindo o elemento {name}: ' + ' '.join(self.element)) def remover(self): self.element.pop(0) print(f'Removendo o primeiro elemento: ' + ' '.join(self.element)) def exibir(self): print('Fila: ' + ' '.join(self.element)) fila = fila() fila.inserir('apple') fila.inserir('grape') fila.inserir('lemon') fila.remover() fila.exibir()
load("@bazel_skylib//lib:shell.bzl", "shell") load("@bazel_skylib//lib:paths.bzl", "paths") AsciidocInfo = provider( doc = "Information about the asciidoc-generated files.", fields = { "primary_output_path": "Path of the primary output file beneath {resource_dir}.", "resource_dir": "File for the directory containing all of the generated resources.", }, ) _toolchain_type = "//tools/build_rules/external_tools:external_tools_toolchain_type" def _asciidoc_impl(ctx): resource_dir = ctx.actions.declare_directory(ctx.label.name + ".d") primary_output = "{name}.html".format(name = ctx.label.name) # Declared as an output, but not saved as part of the default output group. # Build with --output_groups=+asciidoc_logfile to retain. logfile = ctx.actions.declare_file(ctx.label.name + ".logfile") # Locate the asciidoc binary from the toolchain and construct its args. asciidoc = ctx.toolchains[_toolchain_type].asciidoc args = ["--backend", "html", "--no-header-footer"] for key, value in ctx.attr.attrs.items(): if value: args.append("--attribute=%s=%s" % (key, value)) else: args.append("--attribute=%s!" % (key,)) if ctx.attr.example_script: args.append("--attribute=example_script=" + ctx.file.example_script.path) args += ["--conf-file=%s" % c.path for c in ctx.files.confs] args += ["-o", paths.join(resource_dir.path, primary_output)] args.append(ctx.file.src.path) # Get the path where all our necessary tools are located so it can be set # to PATH in our run_shell command. tool_path = ctx.toolchains[_toolchain_type].path # Resolve data targets to get input files and runfiles manifests. data, _, manifests = ctx.resolve_command(tools = ctx.attr.data) # Run asciidoc and capture stderr to logfile. If it succeeds, look in the # captured log for error messages and fail if we find any. ctx.actions.run_shell( inputs = ([ctx.file.src] + ctx.files.confs + ([ctx.file.example_script] if ctx.file.example_script else []) + data), input_manifests = manifests, outputs = [resource_dir, logfile], arguments = args, command = "\n".join([ "set -e", "mkdir -p {resource_dir}".format(resource_dir = shell.quote(resource_dir.path)), # Run asciidoc itself, and fail if it returns nonzero. "{asciidoc} \"$@\" 2> >(tee -a {logfile} >&2)".format( logfile = shell.quote(logfile.path), asciidoc = shell.quote(asciidoc), ), # The tool succeeded, but now check for error diagnostics. 'if grep -q -e "filter non-zero exit code" -e "no output from filter" {logfile}; then'.format( logfile = shell.quote(logfile.path), ), "exit 1", "fi", # Move SVGs to the appropriate directory. "find . -name '*.svg' -maxdepth 1 -exec mv '{{}}' {out}/ \\;".format(out = shell.quote(resource_dir.path)), ]), env = {"PATH": tool_path}, mnemonic = "RunAsciidoc", ) return [ DefaultInfo(files = depset([resource_dir])), OutputGroupInfo(asciidoc_logfile = depset([logfile])), AsciidocInfo(primary_output_path = primary_output, resource_dir = resource_dir), ] asciidoc = rule( implementation = _asciidoc_impl, toolchains = ["//tools/build_rules/external_tools:external_tools_toolchain_type"], attrs = { "src": attr.label( doc = "asciidoc file to process", allow_single_file = True, ), "attrs": attr.string_dict( doc = "Dict of attributes to pass to asciidoc as --attribute=KEY=VALUE", ), "confs": attr.label_list( doc = "`conf-file`s to pass to asciidoc", allow_files = True, ), "data": attr.label_list( doc = "Files/targets used during asciidoc generation. Only needed for tools used in example_script.", allow_files = True, ), "example_script": attr.label( doc = "Script to pass to asciidoc as --attribute=example_script=VALUE.", allow_single_file = True, ), }, doc = "Generate asciidoc", )
load('@bazel_skylib//lib:shell.bzl', 'shell') load('@bazel_skylib//lib:paths.bzl', 'paths') asciidoc_info = provider(doc='Information about the asciidoc-generated files.', fields={'primary_output_path': 'Path of the primary output file beneath {resource_dir}.', 'resource_dir': 'File for the directory containing all of the generated resources.'}) _toolchain_type = '//tools/build_rules/external_tools:external_tools_toolchain_type' def _asciidoc_impl(ctx): resource_dir = ctx.actions.declare_directory(ctx.label.name + '.d') primary_output = '{name}.html'.format(name=ctx.label.name) logfile = ctx.actions.declare_file(ctx.label.name + '.logfile') asciidoc = ctx.toolchains[_toolchain_type].asciidoc args = ['--backend', 'html', '--no-header-footer'] for (key, value) in ctx.attr.attrs.items(): if value: args.append('--attribute=%s=%s' % (key, value)) else: args.append('--attribute=%s!' % (key,)) if ctx.attr.example_script: args.append('--attribute=example_script=' + ctx.file.example_script.path) args += ['--conf-file=%s' % c.path for c in ctx.files.confs] args += ['-o', paths.join(resource_dir.path, primary_output)] args.append(ctx.file.src.path) tool_path = ctx.toolchains[_toolchain_type].path (data, _, manifests) = ctx.resolve_command(tools=ctx.attr.data) ctx.actions.run_shell(inputs=[ctx.file.src] + ctx.files.confs + ([ctx.file.example_script] if ctx.file.example_script else []) + data, input_manifests=manifests, outputs=[resource_dir, logfile], arguments=args, command='\n'.join(['set -e', 'mkdir -p {resource_dir}'.format(resource_dir=shell.quote(resource_dir.path)), '{asciidoc} "$@" 2> >(tee -a {logfile} >&2)'.format(logfile=shell.quote(logfile.path), asciidoc=shell.quote(asciidoc)), 'if grep -q -e "filter non-zero exit code" -e "no output from filter" {logfile}; then'.format(logfile=shell.quote(logfile.path)), 'exit 1', 'fi', "find . -name '*.svg' -maxdepth 1 -exec mv '{{}}' {out}/ \\;".format(out=shell.quote(resource_dir.path))]), env={'PATH': tool_path}, mnemonic='RunAsciidoc') return [default_info(files=depset([resource_dir])), output_group_info(asciidoc_logfile=depset([logfile])), asciidoc_info(primary_output_path=primary_output, resource_dir=resource_dir)] asciidoc = rule(implementation=_asciidoc_impl, toolchains=['//tools/build_rules/external_tools:external_tools_toolchain_type'], attrs={'src': attr.label(doc='asciidoc file to process', allow_single_file=True), 'attrs': attr.string_dict(doc='Dict of attributes to pass to asciidoc as --attribute=KEY=VALUE'), 'confs': attr.label_list(doc='`conf-file`s to pass to asciidoc', allow_files=True), 'data': attr.label_list(doc='Files/targets used during asciidoc generation. Only needed for tools used in example_script.', allow_files=True), 'example_script': attr.label(doc='Script to pass to asciidoc as --attribute=example_script=VALUE.', allow_single_file=True)}, doc='Generate asciidoc')
# return the keys of a dictionary def keys(dictionary): return dictionary.keys() # return the values of a dictionary def values(dictionary): return dictionary.values() # return the string representation of a dictionary def dict_to_string(d): return str(d) # merge two dictionaries def merge(d1, d2): for k, v in d2.iteritems(): if k in d1.keys(): if type(v) is dict: if type(d1[k]) is dict: merge(d1[k], v) elif d1[k] == 'none' or d1[k] is None: d1[k] = v else: n = [v, d1[k]] d1[k] = n elif type(v) is list: if type(d1[k]) is list: d1[k].extend(v) elif d1[k] == 'none' or d1[k] is None: d1[k] = v else: n = [v, d1[k]] d1[k] = n elif v == 'none' or v is None: pass else: n = [v, d1[k]] d1[k] = n else: d1.update({ k: v }) return d1
def keys(dictionary): return dictionary.keys() def values(dictionary): return dictionary.values() def dict_to_string(d): return str(d) def merge(d1, d2): for (k, v) in d2.iteritems(): if k in d1.keys(): if type(v) is dict: if type(d1[k]) is dict: merge(d1[k], v) elif d1[k] == 'none' or d1[k] is None: d1[k] = v else: n = [v, d1[k]] d1[k] = n elif type(v) is list: if type(d1[k]) is list: d1[k].extend(v) elif d1[k] == 'none' or d1[k] is None: d1[k] = v else: n = [v, d1[k]] d1[k] = n elif v == 'none' or v is None: pass else: n = [v, d1[k]] d1[k] = n else: d1.update({k: v}) return d1
def parse_line(line): splitted = line.strip().split() instruction, count = splitted[0], int(splitted[1]) return instruction, count def parse_input(filename): with open(filename) as file: lines = file.readlines() return [parse_line(l) for l in lines] def evaluate_til_repeat(instructions): seen_instructions_idx = set() program_length = len(instructions) instruction_counter = 0 acc = 0 while instruction_counter < program_length: if instruction_counter in seen_instructions_idx: return "Failed", acc seen_instructions_idx.add(instruction_counter) instr, count = instructions[instruction_counter] # print(instr, count, acc) if instr == "nop": instruction_counter += 1 elif instr == "jmp": instruction_counter += count elif instr == "acc": instruction_counter += 1 acc += count return "Succeeded", acc def swapped(instructions, idx): swap = lambda i: "nop" if i == "jmp" else "jmp" instr, count = instructions[idx] copy = list(instructions) copy[idx] = (swap(instr), count) return copy def bruteforce(instructions): """ It's kinda lame that I had to resort to this. I would have preferd to find some more clever solution which does not involve simulating every possible program but I'm too tired today to search for a more elaborate solution. Maybe if I have the energy, I will do that for the scala version. """ swappable_instructions = [ idx for idx, (instr, c) in enumerate(instructions) if instr == "jmp" or instr == "nop" ] for idx in swappable_instructions: status, acc = evaluate_til_repeat(swapped(instructions, idx)) if status == "Succeeded": return acc def main(): instructions = parse_input("input.txt") status, acc = evaluate_til_repeat(instructions) print(acc) acc = bruteforce(instructions) print(acc) if __name__ == '__main__': main()
def parse_line(line): splitted = line.strip().split() (instruction, count) = (splitted[0], int(splitted[1])) return (instruction, count) def parse_input(filename): with open(filename) as file: lines = file.readlines() return [parse_line(l) for l in lines] def evaluate_til_repeat(instructions): seen_instructions_idx = set() program_length = len(instructions) instruction_counter = 0 acc = 0 while instruction_counter < program_length: if instruction_counter in seen_instructions_idx: return ('Failed', acc) seen_instructions_idx.add(instruction_counter) (instr, count) = instructions[instruction_counter] if instr == 'nop': instruction_counter += 1 elif instr == 'jmp': instruction_counter += count elif instr == 'acc': instruction_counter += 1 acc += count return ('Succeeded', acc) def swapped(instructions, idx): swap = lambda i: 'nop' if i == 'jmp' else 'jmp' (instr, count) = instructions[idx] copy = list(instructions) copy[idx] = (swap(instr), count) return copy def bruteforce(instructions): """ It's kinda lame that I had to resort to this. I would have preferd to find some more clever solution which does not involve simulating every possible program but I'm too tired today to search for a more elaborate solution. Maybe if I have the energy, I will do that for the scala version. """ swappable_instructions = [idx for (idx, (instr, c)) in enumerate(instructions) if instr == 'jmp' or instr == 'nop'] for idx in swappable_instructions: (status, acc) = evaluate_til_repeat(swapped(instructions, idx)) if status == 'Succeeded': return acc def main(): instructions = parse_input('input.txt') (status, acc) = evaluate_til_repeat(instructions) print(acc) acc = bruteforce(instructions) print(acc) if __name__ == '__main__': main()
def runonce(): # This is only ran when OSIRIS is restarted, unlike normal live updates return {} def depends(): # this is list of modules to import from app return ['testmodule', 'osirisd'] def reply(msg): """ code, header, and template are optional header is another json dict thing template is another, but entries in the msg called (or in the file passed) {{ something }} will get replaced with the value If you don't pass msg you can pass the path to a file with file:, if you do both file has higher priority 'runonce':1 being added causes it to re-run the runonce function 'reload':1 being added causes the current app to be reloaded 'modload':[list] being added causes it to import the modules listed 'type' optionally accepts a mimetype used in the Content-Type header If no type is passed it logically figures it out based on path or falls back to text/html Passes object with the body and headers headers come in an object called header, keys are names body is the posted data IP is the IP, (X-Real-IP is proxy = 1 in osiris.conf) TYPE is the type (get, post, etc) PATH is the requested path, the / DNT support: If <tracker></tracker> tags are used in the sent data and the browser enables DNT that data will be removed from the request Also, dht is passed in the payload sent to reply A sample dict passed: {'body': '', 'header': {'Accept-Language': 'en-US,en;q=0.8', 'Accept-Encoding': 'gzip,deflate,sdch', 'Connection': 'keep-alive', 'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8', 'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2062.120 Safari/537.36', 'DNT': '1', 'Host': 'localhost:8000', 'Cache-Control': 'max-age=0', 'PATH': '/', 'TYPE': 'GET'}, 'ip': '127.0.0.1'} """ ip = msg['ip'] try: msg['runonce'][ip] += 1 except: msg['runonce'][ip] = 0 # Starts searching in app/{module name}/ if msg['header']['PATH'] == '/ip_stats': dat = "<p>" for ip in msg['runonce']: dat = dat + \ '%s has visited this page %s times<br>' % ( ip, msg['runonce'][ip]) dat += "</p>" return {"code": 200, "msg": dat} elif msg['header']['PATH'].startswith('/code'): request = int(msg['header']['PATH'].split('/')[2]) return {"code": request, "msg": str(msg['depends']['osirisd'].app().code(request))} elif msg['header']['PATH'] == '/test.html': return {"code": 200, "file": "test.html", "template": {"name.first": "Test", "name.last": "user"}} else: msg2srv = "Hello, {0}!\r\nYour IP is {1}\r\nYour name is {{name.first}} {{ name.last }}!\r\nYour key is '{2}'<br><br><tracker>Botnet mode is enabled</tracker>".format( msg['header']['User-Agent'], msg['ip'], msg['depends']['testmodule'].test()) send = {"code": 200, "msg": msg2srv, "template": {"name.first": "Test", "name.last": "user"}, 'modload': ['testmodule'], 'reload': 1, 'type': 'text/html'} return send
def runonce(): return {} def depends(): return ['testmodule', 'osirisd'] def reply(msg): """ code, header, and template are optional header is another json dict thing template is another, but entries in the msg called (or in the file passed) {{ something }} will get replaced with the value If you don't pass msg you can pass the path to a file with file:, if you do both file has higher priority 'runonce':1 being added causes it to re-run the runonce function 'reload':1 being added causes the current app to be reloaded 'modload':[list] being added causes it to import the modules listed 'type' optionally accepts a mimetype used in the Content-Type header If no type is passed it logically figures it out based on path or falls back to text/html Passes object with the body and headers headers come in an object called header, keys are names body is the posted data IP is the IP, (X-Real-IP is proxy = 1 in osiris.conf) TYPE is the type (get, post, etc) PATH is the requested path, the / DNT support: If <tracker></tracker> tags are used in the sent data and the browser enables DNT that data will be removed from the request Also, dht is passed in the payload sent to reply A sample dict passed: {'body': '', 'header': {'Accept-Language': 'en-US,en;q=0.8', 'Accept-Encoding': 'gzip,deflate,sdch', 'Connection': 'keep-alive', 'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8', 'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2062.120 Safari/537.36', 'DNT': '1', 'Host': 'localhost:8000', 'Cache-Control': 'max-age=0', 'PATH': '/', 'TYPE': 'GET'}, 'ip': '127.0.0.1'} """ ip = msg['ip'] try: msg['runonce'][ip] += 1 except: msg['runonce'][ip] = 0 if msg['header']['PATH'] == '/ip_stats': dat = '<p>' for ip in msg['runonce']: dat = dat + '%s has visited this page %s times<br>' % (ip, msg['runonce'][ip]) dat += '</p>' return {'code': 200, 'msg': dat} elif msg['header']['PATH'].startswith('/code'): request = int(msg['header']['PATH'].split('/')[2]) return {'code': request, 'msg': str(msg['depends']['osirisd'].app().code(request))} elif msg['header']['PATH'] == '/test.html': return {'code': 200, 'file': 'test.html', 'template': {'name.first': 'Test', 'name.last': 'user'}} else: msg2srv = "Hello, {0}!\r\nYour IP is {1}\r\nYour name is {{name.first}} {{ name.last }}!\r\nYour key is '{2}'<br><br><tracker>Botnet mode is enabled</tracker>".format(msg['header']['User-Agent'], msg['ip'], msg['depends']['testmodule'].test()) send = {'code': 200, 'msg': msg2srv, 'template': {'name.first': 'Test', 'name.last': 'user'}, 'modload': ['testmodule'], 'reload': 1, 'type': 'text/html'} return send
class Data: def __init__(self): self.__dia = 0 self.__mes = 0 self.__ano = 0 def le_data(self): self.dia = int(input('Digite o dia: ')) self.mes = int(input('Digite o mes: ')) self.ano = int(input('Digite o ano: ')) def formatada(self): print(f'{self.dia}/{self.mes}/{self.ano}')
class Data: def __init__(self): self.__dia = 0 self.__mes = 0 self.__ano = 0 def le_data(self): self.dia = int(input('Digite o dia: ')) self.mes = int(input('Digite o mes: ')) self.ano = int(input('Digite o ano: ')) def formatada(self): print(f'{self.dia}/{self.mes}/{self.ano}')
""" Given two strings A and B, return whether or not A can be shifted some number of times to get B. For example, if A is abcde and B is cdeab, return true. If A is abc and B is acb, return false """ class Solution: def rotateString(self, A, B): N = len(A) if N != len(B): return False if N == 0: return True # Compute shift table shifts = [1] * (N+1) left = -1 for right in range(N): while left >= 0 and B[left] != B[right]: left -= shifts[left] shifts[right + 1] = right - left left += 1 print('left ', left) print('right ', right) print('shifts ', shifts) # Find match of B in A+A match_len = 0 for char in A + A: while match_len >= 0 and B[match_len] != char: match_len -= shifts[match_len] match_len += 1 if match_len == N: return True return False if __name__ == '__main__': s = Solution() print(s.rotateString('abc', 'acb'))
""" Given two strings A and B, return whether or not A can be shifted some number of times to get B. For example, if A is abcde and B is cdeab, return true. If A is abc and B is acb, return false """ class Solution: def rotate_string(self, A, B): n = len(A) if N != len(B): return False if N == 0: return True shifts = [1] * (N + 1) left = -1 for right in range(N): while left >= 0 and B[left] != B[right]: left -= shifts[left] shifts[right + 1] = right - left left += 1 print('left ', left) print('right ', right) print('shifts ', shifts) match_len = 0 for char in A + A: while match_len >= 0 and B[match_len] != char: match_len -= shifts[match_len] match_len += 1 if match_len == N: return True return False if __name__ == '__main__': s = solution() print(s.rotateString('abc', 'acb'))
#este es el ejercicio 3.1 def ejercicio01(): print ("Como saber si puedes votar por tu edad") mensaje="" #Ingreso de datos edadP=int(input("ingrese la edad que tiene:")) #Proceso if edadP>=18: mensaje="Usted tiene la edad necesaria para votar" else: mensaje="Usted no cumple con la edad minima para votar" print(mensaje) ejercicio01()
def ejercicio01(): print('Como saber si puedes votar por tu edad') mensaje = '' edad_p = int(input('ingrese la edad que tiene:')) if edadP >= 18: mensaje = 'Usted tiene la edad necesaria para votar' else: mensaje = 'Usted no cumple con la edad minima para votar' print(mensaje) ejercicio01()
spam = {'name': 'Pooka', 'age': 5} print("Before:") print(spam) #Traditional if 'color' not in spam: spam['color'] = 'black' print("After:") print(spam) #With setDefault() spam.setdefault("color", "white") print(spam) message = 'It was a bright cold day in April, and the clocks were striking thirteen.' count = {} for character in message: count.setdefault(character, 0) count[character] = count[character] + 1 print(count)
spam = {'name': 'Pooka', 'age': 5} print('Before:') print(spam) if 'color' not in spam: spam['color'] = 'black' print('After:') print(spam) spam.setdefault('color', 'white') print(spam) message = 'It was a bright cold day in April, and the clocks were striking thirteen.' count = {} for character in message: count.setdefault(character, 0) count[character] = count[character] + 1 print(count)
"""This solution uses addition repititively to find largest power n of 2 such that 2**n*b < a. Then you keep subtracting these multiples of b of the form 2**i*b for smaller powers until the remainder is smaller than b. Each time you subtract, take the previous quotient and multiply by two. If there is any remaining in the end, just multiply them all by 2 iteratively.""" class Solution(object): def divide(self, dividend, divisor): """ :type dividend: int :type divisor: int :rtype: int """ # e.g. a=100, b=3 a, b = dividend, divisor negative = False if (a>0) == (b>0) else True a = a if a>0 else -a b = b if b>0 else -b mult = [b] c = b while c + c <= a: c += c mult.append(c) # here len(mult)=6, then n=5, which is the largest n # s.t. 2**n*b < a # mult = [3,6,12,24,48,96] # Here is the main step. After getting i's # where 2**i*b < a, keeping substracing them # from a and add the 2**i to 'out'. i = 0 out = 0 while a >= b: i += 1 out += out # here is to iteratively calcuate 2**i if a >= mult[-i]: a -= mult[-i] out += 1 # If there is any remaining in the end, # keeping finishing the calculation of 2**i while i < len(mult): out += out i += 1 if negative: out = -out if out>2147483647 or out<-2147483648: return 2147483647 else: return out
"""This solution uses addition repititively to find largest power n of 2 such that 2**n*b < a. Then you keep subtracting these multiples of b of the form 2**i*b for smaller powers until the remainder is smaller than b. Each time you subtract, take the previous quotient and multiply by two. If there is any remaining in the end, just multiply them all by 2 iteratively.""" class Solution(object): def divide(self, dividend, divisor): """ :type dividend: int :type divisor: int :rtype: int """ (a, b) = (dividend, divisor) negative = False if (a > 0) == (b > 0) else True a = a if a > 0 else -a b = b if b > 0 else -b mult = [b] c = b while c + c <= a: c += c mult.append(c) i = 0 out = 0 while a >= b: i += 1 out += out if a >= mult[-i]: a -= mult[-i] out += 1 while i < len(mult): out += out i += 1 if negative: out = -out if out > 2147483647 or out < -2147483648: return 2147483647 else: return out
# Problem 2. # Write the function subStringMatchExact. This function takes two arguments: a target string, # and a key string. It should return a tuple of the starting points of matches of the key # string in the target string, when indexing starts at 0. Complete the definition for # # def subStringMatchExact(target,key): # # For example, # subStringMatchExact("atgacatgcacaagtatgcat","atgc") # would return the tuple (5, 15). def subStringMatchExact(target, key): position_list = [] begin_point = 0 temp_position = 0 while temp_position >= 0: temp_position = target.find(key, begin_point) if temp_position >= 0: begin_point = temp_position + 1 position_list.append(temp_position) position_tuple = tuple(position_list) return position_tuple target1 = 'atgacatgcacaagtatgcat' key1 = 'atgc' print(subStringMatchExact(target1, key1))
def sub_string_match_exact(target, key): position_list = [] begin_point = 0 temp_position = 0 while temp_position >= 0: temp_position = target.find(key, begin_point) if temp_position >= 0: begin_point = temp_position + 1 position_list.append(temp_position) position_tuple = tuple(position_list) return position_tuple target1 = 'atgacatgcacaagtatgcat' key1 = 'atgc' print(sub_string_match_exact(target1, key1))
''' Palindrome checker by python ''' #Palindrome check for String inputs. def palindrome (s): r=s[::-1] if(r==s): print("Yes It is a palindrome") else: print("No It is not a palindrome") s = input("Enter a String to check whether it is palindrome or not") palindrome(s) #Palindrome check for Number (Integer) inputs. num=int(input("Enter a number:")) temp=num rev=0 while(num>0): dig=num%10 rev=rev*10+dig num=num//10 if(temp==rev): print("The number is Palindrome!") else: print("The number is Not a palindrome!")
""" Palindrome checker by python """ def palindrome(s): r = s[::-1] if r == s: print('Yes It is a palindrome') else: print('No It is not a palindrome') s = input('Enter a String to check whether it is palindrome or not') palindrome(s) num = int(input('Enter a number:')) temp = num rev = 0 while num > 0: dig = num % 10 rev = rev * 10 + dig num = num // 10 if temp == rev: print('The number is Palindrome!') else: print('The number is Not a palindrome!')
""" Number Data types Integers(int) Floating Point(float) Integer is a w """
""" Number Data types Integers(int) Floating Point(float) Integer is a w """
class BaseError(Exception): ... class InternalError(BaseError): _default = "An internal error has occurred." def __init__(self): super().__init__(self._default)
class Baseerror(Exception): ... class Internalerror(BaseError): _default = 'An internal error has occurred.' def __init__(self): super().__init__(self._default)
""" Find the contiguous subarray within an array (containing at least one number) which has the largest sum. For example: Given the array [-2,1,-3,4,-1,2,1,-5,4], the contiguous subarray [4,-1,2,1] has the largest sum = 6. For this problem, return the maximum sum. """ class Solution: # @param A : tuple of integers # @return an integer def maxSubArray(self, A): l = len(A) if l < 1: return 0 max_ending_here = A[0] max_so_far = A[0] for i in xrange(1, l): max_ending_here = max(max_ending_here + A[i], A[i]) max_so_far = max(max_ending_here, max_so_far) return max_so_far
""" Find the contiguous subarray within an array (containing at least one number) which has the largest sum. For example: Given the array [-2,1,-3,4,-1,2,1,-5,4], the contiguous subarray [4,-1,2,1] has the largest sum = 6. For this problem, return the maximum sum. """ class Solution: def max_sub_array(self, A): l = len(A) if l < 1: return 0 max_ending_here = A[0] max_so_far = A[0] for i in xrange(1, l): max_ending_here = max(max_ending_here + A[i], A[i]) max_so_far = max(max_ending_here, max_so_far) return max_so_far
class Solution: def hammingDistance(self, x: int, y: int) -> int: dis = 0 while x != 0 or y !=0: x,resx = x //2, x%2 y,resy = y//2, y%2 if resx!= resy: dis +=1 return dis class Solution: def hammingDistance(self, x: int, y: int) -> int: return bin(x^y).count('1')
class Solution: def hamming_distance(self, x: int, y: int) -> int: dis = 0 while x != 0 or y != 0: (x, resx) = (x // 2, x % 2) (y, resy) = (y // 2, y % 2) if resx != resy: dis += 1 return dis class Solution: def hamming_distance(self, x: int, y: int) -> int: return bin(x ^ y).count('1')
QUERIES = { 'average_movies_per_user': ( 'select avg(movies_watched) ' 'from ( ' 'select count(movie_id) as movies_watched ' 'from views ' 'group by user_id ' ' ) as movies_count;' ), 'average_view_times': 'select avg(viewed_frame) from views;', 'top_20_users_by_total_view_time': ( 'select user_id, sum(viewed_frame) as view_time ' 'from views ' 'group by user_id ' 'order by view_time desc ' 'limit 20;' ), 'top_20_movies_by_view_time': ( 'select movie_id, max(viewed_frame) as view_time ' 'from views ' 'group by movie_id ' 'order by view_time desc ' 'limit 20;' ), 'unique_movies_count': 'select count(distinct movie_id) from views;', 'unique_users_count': 'select count(distinct user_id) from views;' }
queries = {'average_movies_per_user': 'select avg(movies_watched) from ( select count(movie_id) as movies_watched from views group by user_id ) as movies_count;', 'average_view_times': 'select avg(viewed_frame) from views;', 'top_20_users_by_total_view_time': 'select user_id, sum(viewed_frame) as view_time from views group by user_id order by view_time desc limit 20;', 'top_20_movies_by_view_time': 'select movie_id, max(viewed_frame) as view_time from views group by movie_id order by view_time desc limit 20;', 'unique_movies_count': 'select count(distinct movie_id) from views;', 'unique_users_count': 'select count(distinct user_id) from views;'}
# Logic: Write a program that find the maximum positive integer from user input. # Algorithm: append all the numbers to a list and use the built-in method 'max()' to get the highest number in the list. num_int = int(input("Input a number: ")) num_list = [] while num_int >= 0: num_int = int(input("Input a number: ")) num_list.append(num_int) print("The maximum is",max(num_list))
num_int = int(input('Input a number: ')) num_list = [] while num_int >= 0: num_int = int(input('Input a number: ')) num_list.append(num_int) print('The maximum is', max(num_list))
def _print_aspect_impl(target, ctx): # Make sure the rule has a srcs attribute. if hasattr(ctx.rule.attr, 'srcs'): # Iterate through the files that make up the sources and # print their paths. for src in ctx.rule.attr.srcs: for f in src.files.to_list(): print(f.path) return [] print_aspect = aspect( implementation = _print_aspect_impl, attr_aspects = ['deps'], )
def _print_aspect_impl(target, ctx): if hasattr(ctx.rule.attr, 'srcs'): for src in ctx.rule.attr.srcs: for f in src.files.to_list(): print(f.path) return [] print_aspect = aspect(implementation=_print_aspect_impl, attr_aspects=['deps'])
for t in range(int(input())): n=int(input()) k = 3 + 5**(1/2) s = str(int(k**n)) if len(s) <3: s = "0"*(3-len(s)) +s print("Case #{}: {}".format(t+1,s[-3:]))
for t in range(int(input())): n = int(input()) k = 3 + 5 ** (1 / 2) s = str(int(k ** n)) if len(s) < 3: s = '0' * (3 - len(s)) + s print('Case #{}: {}'.format(t + 1, s[-3:]))
load( "@rules_scala3//rules:providers.bzl", _ScalaConfiguration = "ScalaConfiguration", _ScalaRulePhase = "ScalaRulePhase", ) def run_phases(ctx, phases): phase_providers = [ p[_ScalaRulePhase] for p in [ctx.attr.scala] + ctx.attr.plugins + ctx.attr._phase_providers if _ScalaRulePhase in p ] if phase_providers != []: phases = adjust_phases(phases, [p for pp in phase_providers for p in pp.phases]) gd = { "init": struct( scala_configuration = ctx.attr.scala[_ScalaConfiguration], ), "out": struct( output_groups = {}, providers = [], ), } g = struct(**gd) for (name, function) in phases: p = function(ctx, g) if p != None: gd[name] = p g = struct(**gd) return g def adjust_phases(phases, adjustments): if len(adjustments) == 0: return phases phases = phases[:] for (relation, peer_name, name, function) in adjustments: for idx, (needle, _) in enumerate(phases): if needle == peer_name: if relation in ["-", "before"]: phases.insert(idx, (name, function)) elif relation in ["+", "after"]: phases.insert(idx + 1, (name, function)) elif relation in ["=", "replace"]: phases[idx] = (name, function) return phases
load('@rules_scala3//rules:providers.bzl', _ScalaConfiguration='ScalaConfiguration', _ScalaRulePhase='ScalaRulePhase') def run_phases(ctx, phases): phase_providers = [p[_ScalaRulePhase] for p in [ctx.attr.scala] + ctx.attr.plugins + ctx.attr._phase_providers if _ScalaRulePhase in p] if phase_providers != []: phases = adjust_phases(phases, [p for pp in phase_providers for p in pp.phases]) gd = {'init': struct(scala_configuration=ctx.attr.scala[_ScalaConfiguration]), 'out': struct(output_groups={}, providers=[])} g = struct(**gd) for (name, function) in phases: p = function(ctx, g) if p != None: gd[name] = p g = struct(**gd) return g def adjust_phases(phases, adjustments): if len(adjustments) == 0: return phases phases = phases[:] for (relation, peer_name, name, function) in adjustments: for (idx, (needle, _)) in enumerate(phases): if needle == peer_name: if relation in ['-', 'before']: phases.insert(idx, (name, function)) elif relation in ['+', 'after']: phases.insert(idx + 1, (name, function)) elif relation in ['=', 'replace']: phases[idx] = (name, function) return phases
# Copyright 2017-2020 EPAM Systems, Inc. (https://www.epam.com/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. class ShareMountModel(object): def __init__(self): self.identifier = None self.region_id = None self.mount_root = None self.mount_type = None self.mount_options = None @classmethod def load(cls, json): instance = ShareMountModel() if not json: return None instance.identifier = json['id'] instance.region_id = json['regionId'] instance.mount_root = json['mountRoot'] instance.mount_type = json['mountType'] instance.mount_options = json['mountOptions'] if 'mountOptions' in json else None return instance
class Sharemountmodel(object): def __init__(self): self.identifier = None self.region_id = None self.mount_root = None self.mount_type = None self.mount_options = None @classmethod def load(cls, json): instance = share_mount_model() if not json: return None instance.identifier = json['id'] instance.region_id = json['regionId'] instance.mount_root = json['mountRoot'] instance.mount_type = json['mountType'] instance.mount_options = json['mountOptions'] if 'mountOptions' in json else None return instance
X, Y, N = map(int, input().split()) grid = [] win = '' for i in range(X): grid.append([]) for j, val in enumerate(input().split()): grid[i].append({'R':0,'B':0, 'dir':'none'}) if val != 'O': grid[i][j][val] = 1 up, left, upleft, upright = 0, 0, 0, 0 if i > 0: up = grid[i-1][j][val] if grid[i-1][j]['dir']=='up' or grid[i-1][j]['dir']=='none' else 0 if j > 0: left = grid[i][j-1][val] if grid[i][j-1]['dir']=='left' or grid[i][j-1]['dir']=='none' else 0 if i*j > 0: upleft = grid[i-1][j-1][val] if grid[i-1][j-1]['dir']=='upleft' or grid[i-1][j-1]['dir']=='none' else 0 if i > 0 and j < Y-1: upright = grid[i-1][j+1][val] if grid[i-1][j+1]['dir']=='upright' or grid[i-1][j+1]['dir']=='none' else 0 grid[i][j][val] += max(up, left, upleft, upright) if max(up, left, upleft, upright)==up: grid[i][j]['dir']='up' if max(up, left, upleft, upright)==left: grid[i][j]['dir']='left' if max(up, left, upleft, upright)==upleft: grid[i][j]['dir']='upleft' if max(up, left, upleft, upright)==upright: grid[i][j]['dir']='upright' if max(up, left, upleft, upright)==0: grid[i][j]['dir']='none' if grid[i][j][val] == N: win = {'B':'BLUE', 'R':'RED'}[val] break if win: break if win: print(win, 'WINS') else: print('NONE')
(x, y, n) = map(int, input().split()) grid = [] win = '' for i in range(X): grid.append([]) for (j, val) in enumerate(input().split()): grid[i].append({'R': 0, 'B': 0, 'dir': 'none'}) if val != 'O': grid[i][j][val] = 1 (up, left, upleft, upright) = (0, 0, 0, 0) if i > 0: up = grid[i - 1][j][val] if grid[i - 1][j]['dir'] == 'up' or grid[i - 1][j]['dir'] == 'none' else 0 if j > 0: left = grid[i][j - 1][val] if grid[i][j - 1]['dir'] == 'left' or grid[i][j - 1]['dir'] == 'none' else 0 if i * j > 0: upleft = grid[i - 1][j - 1][val] if grid[i - 1][j - 1]['dir'] == 'upleft' or grid[i - 1][j - 1]['dir'] == 'none' else 0 if i > 0 and j < Y - 1: upright = grid[i - 1][j + 1][val] if grid[i - 1][j + 1]['dir'] == 'upright' or grid[i - 1][j + 1]['dir'] == 'none' else 0 grid[i][j][val] += max(up, left, upleft, upright) if max(up, left, upleft, upright) == up: grid[i][j]['dir'] = 'up' if max(up, left, upleft, upright) == left: grid[i][j]['dir'] = 'left' if max(up, left, upleft, upright) == upleft: grid[i][j]['dir'] = 'upleft' if max(up, left, upleft, upright) == upright: grid[i][j]['dir'] = 'upright' if max(up, left, upleft, upright) == 0: grid[i][j]['dir'] = 'none' if grid[i][j][val] == N: win = {'B': 'BLUE', 'R': 'RED'}[val] break if win: break if win: print(win, 'WINS') else: print('NONE')
# Copied from https://rosettacode.org/wiki/Shortest_common_supersequence#Python # Use the Longest Common Subsequence algorithm def shortest_common_supersequence(a, b): lcs = longest_common_subsequence(a, b) scs = "" # Consume lcs while len(lcs) > 0: if a[0]==lcs[0] and b[0]==lcs[0]: # Part of the LCS, so consume from all strings scs += lcs[0] lcs = lcs[1:] a = a[1:] b = b[1:] elif a[0]==lcs[0]: scs += b[0] b = b[1:] else: scs += a[0] a = a[1:] # append remaining characters return scs + a + b
def shortest_common_supersequence(a, b): lcs = longest_common_subsequence(a, b) scs = '' while len(lcs) > 0: if a[0] == lcs[0] and b[0] == lcs[0]: scs += lcs[0] lcs = lcs[1:] a = a[1:] b = b[1:] elif a[0] == lcs[0]: scs += b[0] b = b[1:] else: scs += a[0] a = a[1:] return scs + a + b
def extract_tib_only(csv_dump): lines = csv_dump.strip().split('\n') # cut dump in lines lines = [l.split(',')[1] for l in lines] # only keep the text lines = [lines[i] for i in range(0, len(lines), 2)] # only keep the tibetan return ''.join(lines) def extract_all(csv_dump): lines = csv_dump.strip().split('\n') # cut dump in lines lines = [l.split(',')[1] for l in lines] # only keep the text return ''.join(lines)
def extract_tib_only(csv_dump): lines = csv_dump.strip().split('\n') lines = [l.split(',')[1] for l in lines] lines = [lines[i] for i in range(0, len(lines), 2)] return ''.join(lines) def extract_all(csv_dump): lines = csv_dump.strip().split('\n') lines = [l.split(',')[1] for l in lines] return ''.join(lines)
#! /usr/bin/env python3 description = """ Power digit sum Problem 16 215 = 32768 and the sum of its digits is 3 + 2 + 7 + 6 + 8 = 26. What is the sum of the digits of the number 21000? """ print(sum(int(x) for x in str(2**1000)))
description = '\nPower digit sum\nProblem 16\n215 = 32768 and the sum of its digits is 3 + 2 + 7 + 6 + 8 = 26.\n\nWhat is the sum of the digits of the number 21000?\n' print(sum((int(x) for x in str(2 ** 1000))))
#!/usr/bin/env python # -*- coding: utf-8 -*- # @Time : 2018/7/31 17:52 # @Author : Leishichi # @File : 27.py # @Software: PyCharm # @Tag: class Solution: def removeElement(self, nums, val): """ :type nums: List[int] :type val: int :rtype: int """ if len(nums) == 0: return 0 length = 0 for i in range(len(nums)): if val != nums[i]: nums[length] = nums[i] length += 1 return length
class Solution: def remove_element(self, nums, val): """ :type nums: List[int] :type val: int :rtype: int """ if len(nums) == 0: return 0 length = 0 for i in range(len(nums)): if val != nums[i]: nums[length] = nums[i] length += 1 return length
# 26.05.2019 # Tuples vs Lists # Tuples are read only # Tuples have ( ) brackets # Example with a List: awesomeList= ['hello', 45, 'Marc', 89.4] awesomeList[3] = 6 # List can be updated print(awesomeList) # now a tuple awesomeTuple = ('MarcTuple', 1, 213.2, 'Hello') print(awesomeTuple) print(awesomeTuple[2]) # ERROR awesomeTuple[2] = 3 # Tuple object does not support item assignment # ERROR awesomeTuple[1] +=3 # but slicing is working print(awesomeTuple[0][2:5]) var7 = awesomeTuple[0][2:5] var8 = awesomeTuple[2] print(var7*3) print(var8*3)
awesome_list = ['hello', 45, 'Marc', 89.4] awesomeList[3] = 6 print(awesomeList) awesome_tuple = ('MarcTuple', 1, 213.2, 'Hello') print(awesomeTuple) print(awesomeTuple[2]) print(awesomeTuple[0][2:5]) var7 = awesomeTuple[0][2:5] var8 = awesomeTuple[2] print(var7 * 3) print(var8 * 3)
def dfCheckAvailability(df, baseTrackingMap): ##### # step number -- iStep bIStep = False if not ("iStep" in df.columns) else True print("scan step number (iStep) availability: %s \n--" % str(bIStep)) ##### # Unix time -- epoch bEpoch = False if not ("epoch" in df.columns) else True print("Unix time (epoch) availability: %s \n--" % str(bEpoch)) ##### # goniometer DOF -- xGonioRaw... lsGonio = [s.replace("xGonioRaw", "") for s in df.columns if "xGonioRaw" in s] # list of the full raw goniometer DOF names -- without prefix bXGonio = False if len(lsGonio) == 0 else True printNr = ("(%d)" % len(lsGonio)) if bXGonio else "" print("goniometer DOF availability: %s %s" % (str(bXGonio), printNr)) print("xGonioRaw + %s" % str(lsGonio)) print("--") ##### # input (all 4) & output (both 2) tracking data... print("input modules should be: %s" % str(baseTrackingMap[0])) print("output modules should be: %s" % str(baseTrackingMap[1])) ##### # positions -- xRaw... bXRaw = {"in": True, "out": True} for iLayer in baseTrackingMap[0]: if not ("xRaw"+iLayer in df.columns): bXRaw["in"] = False # input for iLayer in baseTrackingMap[1]: if not ("xRaw"+iLayer in df.columns): bXRaw["out"] = False # output print("input tracking availability (xRaw...): %s" % str(bXRaw["in"])) print("output tracking availability (xRaw...): %s" % str(bXRaw["out"])) ##### # multiplicities -- nHit... bNHit = {"in": True, "out": True} for iLayer in baseTrackingMap[0]: if not ("nHit"+iLayer in df.columns): bNHit["in"] = False # input for iLayer in baseTrackingMap[1]: if not ("nHit"+iLayer in df.columns): bNHit["out"] = False # output print("input multiplicity availability (nHit...): %s" % str(bNHit["in"])) print("output multiplicity availability (nHit...): %s" % str(bNHit["out"])) print("--") ##### # digitizer data -- digiPHRaw... & digiTime... lsDigiRawCh = [s for s in sorted(df.columns) if "digiPHRaw" in s] # list of the full raw digitizer PH names lsDigiCh = [s.replace("digiPHRaw", "") for s in lsDigiRawCh] # list of the digitizer channel names -- without any prefix bDigiPHAny = False if len(lsDigiCh) == 0 else True # global PH availability -- single channels listed in lsDigiRawCh print("digitizer channel availability: %s" % str(bDigiPHAny)) bDigiTime = {} if bDigiPHAny: print("%d channels: digiPHRaw + %s" % (len(lsDigiCh), str(lsDigiCh))) for i, iCh in enumerate(lsDigiRawCh): # digitizer time availability for each of the available PH (listed in lsDigiRawCh) bDigiTime.update({iCh.replace("digiPHRaw", ""): True if iCh.replace("PHRaw", "Time") in df.columns else False}) print("%d with time: digiTime + %s" % (len([s for s in bDigiTime if bDigiTime[s]]), str([s for s in bDigiTime if bDigiTime[s]]))) print("--") ##### # forward calorimeter total PH & energy in GeV -- PHCaloFwd & EFwd bPHCaloFwd = False if not ("PHCaloFwd" in df.columns) else True print("forward calorimeter total signal (PHCaloFwd) availability a priori: %s" % str(bPHCaloFwd)) bEFwd = False if not ("EFwd" in df.columns) else True print("forward calorimeter total in GeV (EFwd) availability a priori: %s" % str(bEFwd)) return df, bIStep, bEpoch, bXGonio, bXRaw, bNHit, bDigiPHAny, lsDigiCh, bDigiTime, bPHCaloFwd, bEFwd ############################################################################### ############################################################################### def zBaseCheckAvailability(z, lsRun, baseTrackingMap): for iRun in lsRun: if iRun in z: bGlobalAvailability = True else: bGlobalAvailability = False z.update({iRun: {}}) # goniometer if not ("gonio" in z[iRun]): bGlobalAvailability = False print("z[%s][\"gonio\"] unavailable --> setting 0" % iRun) z[iRun].update({"gonio": 0}) # forward calorimeter if not ("caloFwd" in z[iRun]): bGlobalAvailability = False print("z[%s][\"caloFwd\"] unavailable --> setting 0" % iRun) z[iRun].update({"caloFwd": 0}) # input/output base tracking layers for iLayer in baseTrackingMap[0]+baseTrackingMap[1]: if not (iLayer in z[iRun]): bGlobalAvailability = False print("z[%s][\"%s\"] unavailable --> setting 0" % (iRun, iLayer)) z[iRun].update({iLayer: 0}) if bGlobalAvailability: print("all mandatory z[%s] available" % iRun) return z
def df_check_availability(df, baseTrackingMap): b_i_step = False if not 'iStep' in df.columns else True print('scan step number (iStep) availability: %s \n--' % str(bIStep)) b_epoch = False if not 'epoch' in df.columns else True print('Unix time (epoch) availability: %s \n--' % str(bEpoch)) ls_gonio = [s.replace('xGonioRaw', '') for s in df.columns if 'xGonioRaw' in s] b_x_gonio = False if len(lsGonio) == 0 else True print_nr = '(%d)' % len(lsGonio) if bXGonio else '' print('goniometer DOF availability: %s %s' % (str(bXGonio), printNr)) print('xGonioRaw + %s' % str(lsGonio)) print('--') print('input modules should be: %s' % str(baseTrackingMap[0])) print('output modules should be: %s' % str(baseTrackingMap[1])) b_x_raw = {'in': True, 'out': True} for i_layer in baseTrackingMap[0]: if not 'xRaw' + iLayer in df.columns: bXRaw['in'] = False for i_layer in baseTrackingMap[1]: if not 'xRaw' + iLayer in df.columns: bXRaw['out'] = False print('input tracking availability (xRaw...): %s' % str(bXRaw['in'])) print('output tracking availability (xRaw...): %s' % str(bXRaw['out'])) b_n_hit = {'in': True, 'out': True} for i_layer in baseTrackingMap[0]: if not 'nHit' + iLayer in df.columns: bNHit['in'] = False for i_layer in baseTrackingMap[1]: if not 'nHit' + iLayer in df.columns: bNHit['out'] = False print('input multiplicity availability (nHit...): %s' % str(bNHit['in'])) print('output multiplicity availability (nHit...): %s' % str(bNHit['out'])) print('--') ls_digi_raw_ch = [s for s in sorted(df.columns) if 'digiPHRaw' in s] ls_digi_ch = [s.replace('digiPHRaw', '') for s in lsDigiRawCh] b_digi_ph_any = False if len(lsDigiCh) == 0 else True print('digitizer channel availability: %s' % str(bDigiPHAny)) b_digi_time = {} if bDigiPHAny: print('%d channels: digiPHRaw + %s' % (len(lsDigiCh), str(lsDigiCh))) for (i, i_ch) in enumerate(lsDigiRawCh): bDigiTime.update({iCh.replace('digiPHRaw', ''): True if iCh.replace('PHRaw', 'Time') in df.columns else False}) print('%d with time: digiTime + %s' % (len([s for s in bDigiTime if bDigiTime[s]]), str([s for s in bDigiTime if bDigiTime[s]]))) print('--') b_ph_calo_fwd = False if not 'PHCaloFwd' in df.columns else True print('forward calorimeter total signal (PHCaloFwd) availability a priori: %s' % str(bPHCaloFwd)) b_e_fwd = False if not 'EFwd' in df.columns else True print('forward calorimeter total in GeV (EFwd) availability a priori: %s' % str(bEFwd)) return (df, bIStep, bEpoch, bXGonio, bXRaw, bNHit, bDigiPHAny, lsDigiCh, bDigiTime, bPHCaloFwd, bEFwd) def z_base_check_availability(z, lsRun, baseTrackingMap): for i_run in lsRun: if iRun in z: b_global_availability = True else: b_global_availability = False z.update({iRun: {}}) if not 'gonio' in z[iRun]: b_global_availability = False print('z[%s]["gonio"] unavailable --> setting 0' % iRun) z[iRun].update({'gonio': 0}) if not 'caloFwd' in z[iRun]: b_global_availability = False print('z[%s]["caloFwd"] unavailable --> setting 0' % iRun) z[iRun].update({'caloFwd': 0}) for i_layer in baseTrackingMap[0] + baseTrackingMap[1]: if not iLayer in z[iRun]: b_global_availability = False print('z[%s]["%s"] unavailable --> setting 0' % (iRun, iLayer)) z[iRun].update({iLayer: 0}) if bGlobalAvailability: print('all mandatory z[%s] available' % iRun) return z
# -*- coding: utf-8 -*- """ Created on Tue Jul 14 13:26:18 2020 @author: abhi0 """ class Solution: def isSubsequence(self, s: str, t: str) -> bool: for i in s: if i in t: tempIdx=t.index(i) t=t[tempIdx+1:] else: return False return True
""" Created on Tue Jul 14 13:26:18 2020 @author: abhi0 """ class Solution: def is_subsequence(self, s: str, t: str) -> bool: for i in s: if i in t: temp_idx = t.index(i) t = t[tempIdx + 1:] else: return False return True
list1 = [1, 7, 16, 11, 14, 19, 20, 18] list2 = [85, 111, 117, 43, 104, 127, 117, 117, 33, 110, 99, 43, 72, 95, 85, 85, 94, 66, 120, 98, 79, 117, 68, 83, 64, 94, 39, 65, 73, 32, 65, 72, 51] ans = '' for i in range(len(list2)): ans += chr(list2[i] ^ list1[i % len(list1)]) print(ans)
list1 = [1, 7, 16, 11, 14, 19, 20, 18] list2 = [85, 111, 117, 43, 104, 127, 117, 117, 33, 110, 99, 43, 72, 95, 85, 85, 94, 66, 120, 98, 79, 117, 68, 83, 64, 94, 39, 65, 73, 32, 65, 72, 51] ans = '' for i in range(len(list2)): ans += chr(list2[i] ^ list1[i % len(list1)]) print(ans)
""" A nevelty COVID-19 Infections estimator function. """ def estimator(data): #calculations for the currentlyInfected property impact_ci = data['reportedCases']*10 severe_ci = data['reportedCases']*50 #calculations for the inFectedByRequestTime if data['periodType'] == 'days': impact_ibrt = int(impact_ci*(2**int((data['timeToElapse']/3)))) severe_ibrt = int(severe_ci*(2**int((data['timeToElapse']/3)))) elif data['periodType'] == 'weeks': factor = int((data['timeToElapse']*7)/3) impact_ibrt = int(impact_ci*(2**factor)) severe_ibrt = int(severe_ci*(2**factor)) elif data['periodType'] == 'months': factor = int((data['timeToElapse']*30)/3) impact_ibrt = int(impact_ci*(2**factor)) severe_ibrt = int(severe_ci*(2**factor)) impact_scbrt = int(0.15*impact_ibrt) severe_scbrt = int(0.15*severe_ibrt) impact_hbbrt = int(0.35*data['totalHospitalBeds']-impact_scbrt) severe_hbbrt = int(0.35*data['totalHospitalBeds']-severe_scbrt) impact_icu = int(0.05*impact_ibrt) severe_icu = int(0.05*severe_ibrt) impact_venti = int(0.02*impact_ibrt) severe_venti = int(0.02*severe_ibrt) if data['periodType'] == 'days': impact_dnflight = ((impact_ibrt*data['region']['avgDailyIncomeInUSD']*data['region']\ ['avgDailyIncomePopulation'])/data['timeToElapse']) severe_dnflight = ((severe_ibrt*data['region']['avgDailyIncomeInUSD']*data['region'][\ 'avgDailyIncomePopulation'])/data['timeToElapse']) elif data['periodType'] == 'weeks': denum_var = data['timeToElapse']*7 impact_dnflight = ((impact_ibrt*data['region']['avgDailyIncomeInUSD']*data['region']\ ['avgDailyIncomePopulation'])/denum_var) severe_dnflight = ((severe_ibrt* data['region']['avgDailyIncomeInUSD'] * data['region']\ ['avgDailyIncomePopulation'])/denum_var) elif data['periodType'] == 'months': denum_var = data['timeToElapse']*30 impact_dnflight = ((impact_ibrt*data['region']['avgDailyIncomeInUSD'] * data['region']\ ['avgDailyIncomePopulation'])/denum_var) severe_dnflight = ((severe_ibrt*data['region']['avgDailyIncomeInUSD'] * data['region']\ ['avgDailyIncomePopulation'])/denum_var) #The returned data python_return_data = { "data": { "region": { "name": data['region']['name'], "avgAge": data['region']['avgAge'], "avgDailyIncomeInUSD": data['region']['avgDailyIncomeInUSD'], "avgDailyIncomePopulation": data['region']['avgDailyIncomePopulation'] }, "periodType": data['periodType'], "timeToElapse": data['timeToElapse'], "reportedCases": data['reportedCases'], "population": data['population'], "totalHospitalBeds": data['totalHospitalBeds'] }, "impact": { "currentlyInfected": impact_ci, "infectionsByRequestedTime": impact_ibrt, "severeCasesByRequestedTime": impact_scbrt, "hospitalBedsByRequestedTime": impact_hbbrt, "casesForICUByRequestedTime": impact_icu, "casesForVentilatorsByRequestedTime": impact_venti, "dollarsInFlight": int(impact_dnflight), }, "severeImpact": { "currentlyInfected": severe_ci, "infectionsByRequestedTime": severe_ibrt, "severeCasesByRequestedTime": severe_scbrt, "hospitalBedsByRequestedTime": severe_hbbrt, "casesForICUByRequestedTime": severe_icu, "casesForVentilatorsByRequestedTime": severe_venti, "dollarsInFlight": int(severe_dnflight), } } #return the json format of the input data and python return data return python_return_data
""" A nevelty COVID-19 Infections estimator function. """ def estimator(data): impact_ci = data['reportedCases'] * 10 severe_ci = data['reportedCases'] * 50 if data['periodType'] == 'days': impact_ibrt = int(impact_ci * 2 ** int(data['timeToElapse'] / 3)) severe_ibrt = int(severe_ci * 2 ** int(data['timeToElapse'] / 3)) elif data['periodType'] == 'weeks': factor = int(data['timeToElapse'] * 7 / 3) impact_ibrt = int(impact_ci * 2 ** factor) severe_ibrt = int(severe_ci * 2 ** factor) elif data['periodType'] == 'months': factor = int(data['timeToElapse'] * 30 / 3) impact_ibrt = int(impact_ci * 2 ** factor) severe_ibrt = int(severe_ci * 2 ** factor) impact_scbrt = int(0.15 * impact_ibrt) severe_scbrt = int(0.15 * severe_ibrt) impact_hbbrt = int(0.35 * data['totalHospitalBeds'] - impact_scbrt) severe_hbbrt = int(0.35 * data['totalHospitalBeds'] - severe_scbrt) impact_icu = int(0.05 * impact_ibrt) severe_icu = int(0.05 * severe_ibrt) impact_venti = int(0.02 * impact_ibrt) severe_venti = int(0.02 * severe_ibrt) if data['periodType'] == 'days': impact_dnflight = impact_ibrt * data['region']['avgDailyIncomeInUSD'] * data['region']['avgDailyIncomePopulation'] / data['timeToElapse'] severe_dnflight = severe_ibrt * data['region']['avgDailyIncomeInUSD'] * data['region']['avgDailyIncomePopulation'] / data['timeToElapse'] elif data['periodType'] == 'weeks': denum_var = data['timeToElapse'] * 7 impact_dnflight = impact_ibrt * data['region']['avgDailyIncomeInUSD'] * data['region']['avgDailyIncomePopulation'] / denum_var severe_dnflight = severe_ibrt * data['region']['avgDailyIncomeInUSD'] * data['region']['avgDailyIncomePopulation'] / denum_var elif data['periodType'] == 'months': denum_var = data['timeToElapse'] * 30 impact_dnflight = impact_ibrt * data['region']['avgDailyIncomeInUSD'] * data['region']['avgDailyIncomePopulation'] / denum_var severe_dnflight = severe_ibrt * data['region']['avgDailyIncomeInUSD'] * data['region']['avgDailyIncomePopulation'] / denum_var python_return_data = {'data': {'region': {'name': data['region']['name'], 'avgAge': data['region']['avgAge'], 'avgDailyIncomeInUSD': data['region']['avgDailyIncomeInUSD'], 'avgDailyIncomePopulation': data['region']['avgDailyIncomePopulation']}, 'periodType': data['periodType'], 'timeToElapse': data['timeToElapse'], 'reportedCases': data['reportedCases'], 'population': data['population'], 'totalHospitalBeds': data['totalHospitalBeds']}, 'impact': {'currentlyInfected': impact_ci, 'infectionsByRequestedTime': impact_ibrt, 'severeCasesByRequestedTime': impact_scbrt, 'hospitalBedsByRequestedTime': impact_hbbrt, 'casesForICUByRequestedTime': impact_icu, 'casesForVentilatorsByRequestedTime': impact_venti, 'dollarsInFlight': int(impact_dnflight)}, 'severeImpact': {'currentlyInfected': severe_ci, 'infectionsByRequestedTime': severe_ibrt, 'severeCasesByRequestedTime': severe_scbrt, 'hospitalBedsByRequestedTime': severe_hbbrt, 'casesForICUByRequestedTime': severe_icu, 'casesForVentilatorsByRequestedTime': severe_venti, 'dollarsInFlight': int(severe_dnflight)}} return python_return_data
class Array(object): def __init__(self, capacity, fill_value=None): """Capacity is the static size of the array. fillValue is placed at each position.""" self._items = list() for count in range(capacity): self._items.append(fill_value) def __len__(self): """-> The capacity of the array.""" return len(self._items) def __str__(self): """-> The string representation of the array.""" return str(self._items) def __iter__(self): """Supports traversal with a for loop.""" return iter(self._items) def __getitem__(self, index): """Subscript operator for access at index.""" return self._items[index] def __setitem__(self, index, new_item): """Subscript operator for replacement at index.""" self._items[index] = new_item
class Array(object): def __init__(self, capacity, fill_value=None): """Capacity is the static size of the array. fillValue is placed at each position.""" self._items = list() for count in range(capacity): self._items.append(fill_value) def __len__(self): """-> The capacity of the array.""" return len(self._items) def __str__(self): """-> The string representation of the array.""" return str(self._items) def __iter__(self): """Supports traversal with a for loop.""" return iter(self._items) def __getitem__(self, index): """Subscript operator for access at index.""" return self._items[index] def __setitem__(self, index, new_item): """Subscript operator for replacement at index.""" self._items[index] = new_item
f = open("Street_Centrelines.csv",'r') def tup(): for v in f: v = v.split(",") t = (v[2], v[4], v[6], v[7]) print(t) def maintenance(): h = dict() for f2 in f: f2 = f2.split(",") if f2[12] not in h: h[f2[12]] = 1 else: h[f[12]] += 1 print(h) def street_owner(): owner_list = f[11] final_list = [] for a in f: a = a.split(",") if a[11] not in final_list: final_list.append(a[11]) print(final_list) tup() maintenance() street_owner()
f = open('Street_Centrelines.csv', 'r') def tup(): for v in f: v = v.split(',') t = (v[2], v[4], v[6], v[7]) print(t) def maintenance(): h = dict() for f2 in f: f2 = f2.split(',') if f2[12] not in h: h[f2[12]] = 1 else: h[f[12]] += 1 print(h) def street_owner(): owner_list = f[11] final_list = [] for a in f: a = a.split(',') if a[11] not in final_list: final_list.append(a[11]) print(final_list) tup() maintenance() street_owner()
words = ['one', 'fish', 'two', 'fish', 'red', 'fish', 'blue', 'fish'] words2 = ['have', 'you', 'seen', 'a', 'blue', 'fish'] # what if we did the first example as a generator? def get_word_lengths(word_list): for word in word_list: yield len(word) for length in get_word_lengths(words): print(length) print('--------------------') for length in (len(word) for word in words): print(length)
words = ['one', 'fish', 'two', 'fish', 'red', 'fish', 'blue', 'fish'] words2 = ['have', 'you', 'seen', 'a', 'blue', 'fish'] def get_word_lengths(word_list): for word in word_list: yield len(word) for length in get_word_lengths(words): print(length) print('--------------------') for length in (len(word) for word in words): print(length)
# Time: O(n) # Space: O(1) # We are given two strings, A and B. # # A shift on A consists of taking string A and moving the leftmost character to the rightmost position. # For example, if A = 'abcde', then it will be 'bcdea' after one shift on A. Return True # if and only if A can become B after some number of shifts on A. # # Example 1: # Input: A = 'abcde', B = 'cdeab' # Output: true # # Example 2: # Input: A = 'abcde', B = 'abced' # Output: false # # Note: # - A and B will have length at most 100. # Rabin-Karp Algorithm (rolling hash) class Solution(object): def rotateString(self, A, B): """ :type A: str :type B: str :rtype: bool Our approach comes down to quickly checking whether B is a substring of A2 = A+A. Specifically, check whether B = A2[0:N], or B = A2[1:N+1], or B = A2[2:N+2] and so on. To check this, we can use a rolling hash. Algorithm For a string S, say hash(S) = (S[0] * P^0 + S[1] * P^1 + S[2] * P^2 + ...) % MOD, where S[i] is the ASCII code of the string at that index. The idea is that hash(S) has output that is approximately uniformly distributed between [0, 1, 2, ..., MOD-1], and so if MOD is big enough and hash(S) == hash(T) it is very likely that S == T. Say we have a hash hash(A), and we want the hash of A[1], A[2], ..., A[N-1], A[0]. We can subtract A[0] from the hash, divide by P, and add A[0] * P**(N-1). (Our division is done by multiplying by the modular inverse Pinv = pow(P, MOD-2, MOD).) """ def check(index): return all(A[(i+index) % len(A)] == c for i, c in enumerate(B)) if len(A) != len(B): return False M, p = 10**9+7, 113 p_inv = pow(p, M-2, M) b_hash, power = 0, 1 for c in B: b_hash += power * ord(c) b_hash %= M power = (power*p) % M a_hash, power = 0, 1 for i in xrange(len(B)): a_hash += power * ord(A[i%len(A)]) a_hash %= M power = (power*p) % M if a_hash == b_hash and check(0): return True power = (power*p_inv) % M for i in xrange(len(B), 2*len(A)): a_hash = (a_hash-ord(A[(i-len(B))%len(A)])) * p_inv a_hash += power * ord(A[i%len(A)]) a_hash %= M if a_hash == b_hash and check(i-len(B)+1): return True return False # Time: O(n) # Space: O(n) # KMP algorithm class Solution2(object): def rotateString(self, A, B): """ :type A: str :type B: str :rtype: bool Intuition We want to find whether B exists in A+A. The KMP algorithm is a textbook algo. that does string matching in linear time, faster than brute force. Algorithm The algorithm is broken up into two steps, building the shifts table (or failure table), and using it to find whether a match exists. The shift table tells about the largest prefix of B that ends here. More specifically, B[:shifts[i+1]] == B[i - shifts[i+1] : i] is the largest possible prefix of B ending before B[i]. We use a dynamic programming approach to build the shift table, where all previously calculated values of shifts are correct. Then, left will be the end of the candidate prefix of B, and right will be the end of the candidate section that should match the prefix B[0], B[1], ..., B[left]. Call positions (left, right) "matching" if the prefix ending at B[left] matches the same length string ending at B[right]. The invariant in our loop will be that (left-1, right-1) is matching by the end of each for-block. In a new for-block, if (left, right) is matching (ie. (left - 1, right - 1) is matching from before, plus B[left] == B[right]), then we know the shift (right - left) is the same number as before. Otherwise, when (left, right) is not matching, we need to find a shorter prefix. Our strategy is to find a matching of (left2, right) where left2 < left, by finding matchings (left2 - 1, right - 1) plus checking B[left2] == B[right]. Since (left - 1, right - 1) is a matching, by transitivity we want to find matchings (left2 - 1, left - 1). The largest such left2 is left2 = left - shifts[left]. We repeatedly check these left2's in greedy order from largest to smallest. To find a match of B in A+A with such a shift table ready, we employ a similar strategy. We maintain a matching (match_len - 1, i - 1), where these positions correspond to strings of length match_len that end at B[match_len - 1] and (A+A)[i-1] respectively. Now when trying to find the largest length matching for (A+A) at position i, it must be at most (match_len - 1) + 1, where the quantity in brackets is the largest length matching to position i-1. Again, our strategy is to find a matching (match_len2 - 1, i - 1) plus check that B[match_len2] == (A+A)[i]. Similar to before, if B[match_len] != (A+A)[i], then because (match_len - 1, i - 1) was a matching, by transitivity (match_len2 - 1, match_len - 1) must be a matching, of which the largest is found by match_len2 = match_len - shifts[match_len]. We also repeatedly check these match_len's in order from largest to smallest. If at any point in this algorithm our match length is N, we've found B in A+A successfully. """ def strStr(haystack, needle): def KMP(text, pattern): prefix = getPrefix(pattern) j = -1 for i in xrange(len(text)): while j > -1 and pattern[j + 1] != text[i]: j = prefix[j] if pattern[j + 1] == text[i]: j += 1 if j == len(pattern) - 1: return i - j return -1 def getPrefix(pattern): prefix = [-1] * len(pattern) j = -1 for i in xrange(1, len(pattern)): while j > -1 and pattern[j + 1] != pattern[i]: j = prefix[j] if pattern[j + 1] == pattern[i]: j += 1 prefix[i] = j return prefix if not needle: return 0 return KMP(haystack, needle) if len(A) != len(B): return False return strStr(A*2, B) != -1 # Time: O(n^2) # Space: O(1) class Solution3(object): def rotateString(self, A, B): if len(A) != len(B): return False if len(A) == 0: return True for s in xrange(len(A)): if all(A[(s+i) % len(A)] == B[i] for i in xrange(len(A))): return True return False # Time: O(n^2) # Space: O(n) # Brute force class Solution4(object): def rotateString(self, A, B): return len(A) == len(B) and B in A*2
class Solution(object): def rotate_string(self, A, B): """ :type A: str :type B: str :rtype: bool Our approach comes down to quickly checking whether B is a substring of A2 = A+A. Specifically, check whether B = A2[0:N], or B = A2[1:N+1], or B = A2[2:N+2] and so on. To check this, we can use a rolling hash. Algorithm For a string S, say hash(S) = (S[0] * P^0 + S[1] * P^1 + S[2] * P^2 + ...) % MOD, where S[i] is the ASCII code of the string at that index. The idea is that hash(S) has output that is approximately uniformly distributed between [0, 1, 2, ..., MOD-1], and so if MOD is big enough and hash(S) == hash(T) it is very likely that S == T. Say we have a hash hash(A), and we want the hash of A[1], A[2], ..., A[N-1], A[0]. We can subtract A[0] from the hash, divide by P, and add A[0] * P**(N-1). (Our division is done by multiplying by the modular inverse Pinv = pow(P, MOD-2, MOD).) """ def check(index): return all((A[(i + index) % len(A)] == c for (i, c) in enumerate(B))) if len(A) != len(B): return False (m, p) = (10 ** 9 + 7, 113) p_inv = pow(p, M - 2, M) (b_hash, power) = (0, 1) for c in B: b_hash += power * ord(c) b_hash %= M power = power * p % M (a_hash, power) = (0, 1) for i in xrange(len(B)): a_hash += power * ord(A[i % len(A)]) a_hash %= M power = power * p % M if a_hash == b_hash and check(0): return True power = power * p_inv % M for i in xrange(len(B), 2 * len(A)): a_hash = (a_hash - ord(A[(i - len(B)) % len(A)])) * p_inv a_hash += power * ord(A[i % len(A)]) a_hash %= M if a_hash == b_hash and check(i - len(B) + 1): return True return False class Solution2(object): def rotate_string(self, A, B): """ :type A: str :type B: str :rtype: bool Intuition We want to find whether B exists in A+A. The KMP algorithm is a textbook algo. that does string matching in linear time, faster than brute force. Algorithm The algorithm is broken up into two steps, building the shifts table (or failure table), and using it to find whether a match exists. The shift table tells about the largest prefix of B that ends here. More specifically, B[:shifts[i+1]] == B[i - shifts[i+1] : i] is the largest possible prefix of B ending before B[i]. We use a dynamic programming approach to build the shift table, where all previously calculated values of shifts are correct. Then, left will be the end of the candidate prefix of B, and right will be the end of the candidate section that should match the prefix B[0], B[1], ..., B[left]. Call positions (left, right) "matching" if the prefix ending at B[left] matches the same length string ending at B[right]. The invariant in our loop will be that (left-1, right-1) is matching by the end of each for-block. In a new for-block, if (left, right) is matching (ie. (left - 1, right - 1) is matching from before, plus B[left] == B[right]), then we know the shift (right - left) is the same number as before. Otherwise, when (left, right) is not matching, we need to find a shorter prefix. Our strategy is to find a matching of (left2, right) where left2 < left, by finding matchings (left2 - 1, right - 1) plus checking B[left2] == B[right]. Since (left - 1, right - 1) is a matching, by transitivity we want to find matchings (left2 - 1, left - 1). The largest such left2 is left2 = left - shifts[left]. We repeatedly check these left2's in greedy order from largest to smallest. To find a match of B in A+A with such a shift table ready, we employ a similar strategy. We maintain a matching (match_len - 1, i - 1), where these positions correspond to strings of length match_len that end at B[match_len - 1] and (A+A)[i-1] respectively. Now when trying to find the largest length matching for (A+A) at position i, it must be at most (match_len - 1) + 1, where the quantity in brackets is the largest length matching to position i-1. Again, our strategy is to find a matching (match_len2 - 1, i - 1) plus check that B[match_len2] == (A+A)[i]. Similar to before, if B[match_len] != (A+A)[i], then because (match_len - 1, i - 1) was a matching, by transitivity (match_len2 - 1, match_len - 1) must be a matching, of which the largest is found by match_len2 = match_len - shifts[match_len]. We also repeatedly check these match_len's in order from largest to smallest. If at any point in this algorithm our match length is N, we've found B in A+A successfully. """ def str_str(haystack, needle): def kmp(text, pattern): prefix = get_prefix(pattern) j = -1 for i in xrange(len(text)): while j > -1 and pattern[j + 1] != text[i]: j = prefix[j] if pattern[j + 1] == text[i]: j += 1 if j == len(pattern) - 1: return i - j return -1 def get_prefix(pattern): prefix = [-1] * len(pattern) j = -1 for i in xrange(1, len(pattern)): while j > -1 and pattern[j + 1] != pattern[i]: j = prefix[j] if pattern[j + 1] == pattern[i]: j += 1 prefix[i] = j return prefix if not needle: return 0 return kmp(haystack, needle) if len(A) != len(B): return False return str_str(A * 2, B) != -1 class Solution3(object): def rotate_string(self, A, B): if len(A) != len(B): return False if len(A) == 0: return True for s in xrange(len(A)): if all((A[(s + i) % len(A)] == B[i] for i in xrange(len(A)))): return True return False class Solution4(object): def rotate_string(self, A, B): return len(A) == len(B) and B in A * 2
# Data processing with open('input') as f: in_data = [line.rstrip() for line in f] for i in range(25, len(in_data)): pre_i = in_data[i-25:i] summed_pair_found = False for a in pre_i: for b in pre_i: if a != b: if int(a)+int(b) == int(in_data[i]): summed_pair_found = True if not summed_pair_found: print(in_data[i]) exit()
with open('input') as f: in_data = [line.rstrip() for line in f] for i in range(25, len(in_data)): pre_i = in_data[i - 25:i] summed_pair_found = False for a in pre_i: for b in pre_i: if a != b: if int(a) + int(b) == int(in_data[i]): summed_pair_found = True if not summed_pair_found: print(in_data[i]) exit()
#! python3 pessoas = [ {'nome': 'Pedro', 'idade': 11}, {'nome': 'Mariana', 'idade': 18}, {'nome': 'Arthur', 'idade': 26}, {'nome': 'Rebeca', 'idade': 6}, {'nome': 'Tiago', 'idade': 19}, {'nome': 'Gabriela', 'idade': 17}, ] menores = filter(lambda p: p['idade'] < 18, pessoas) print(list(menores)) nomeMaiorede6caracteres = filter(lambda p: len(p['nome']) > 6, pessoas) print(list(nomeMaiorede6caracteres))
pessoas = [{'nome': 'Pedro', 'idade': 11}, {'nome': 'Mariana', 'idade': 18}, {'nome': 'Arthur', 'idade': 26}, {'nome': 'Rebeca', 'idade': 6}, {'nome': 'Tiago', 'idade': 19}, {'nome': 'Gabriela', 'idade': 17}] menores = filter(lambda p: p['idade'] < 18, pessoas) print(list(menores)) nome_maiorede6caracteres = filter(lambda p: len(p['nome']) > 6, pessoas) print(list(nomeMaiorede6caracteres))
class Solution(object): def mySqrt(self, x): """ :type x: int :rtype: int """ if x < 0: return -1 elif x == 0: return 0 start, end = 1, x while start + 1 < end: mid = start + (end - start) / 2 if mid**2 == x: return mid elif mid**2 > x: end = mid else: start = mid return start
class Solution(object): def my_sqrt(self, x): """ :type x: int :rtype: int """ if x < 0: return -1 elif x == 0: return 0 (start, end) = (1, x) while start + 1 < end: mid = start + (end - start) / 2 if mid ** 2 == x: return mid elif mid ** 2 > x: end = mid else: start = mid return start
line = input() a, b = line.split() a = int(a) b = int(b) print(a + b)
line = input() (a, b) = line.split() a = int(a) b = int(b) print(a + b)
def load(opt, splits): """ Load the TUF train dataset :return: """ return {"train": [], "val": []}
def load(opt, splits): """ Load the TUF train dataset :return: """ return {'train': [], 'val': []}
class Solution: def strStr(self, haystack: str, needle: str) -> int: """ Implement strStr(). Return the index of the first occurrence of needle in haystack, or -1 if needle is not part of haystack. >>> Solution().strStr("asdf", "") 0 >>> Solution().strStr("hello", "ll") 2 >>> Solution().strStr("aaaaa", "bba") -1 >>> Solution().strStr("a", "a") 0 :param haystack: the string to find in :param needle: the target substring :return: the index of the substring """ if len(needle) == 0: return 0 if len(haystack) == 0 or len(haystack) < len(needle): return -1 return self.python_built_in(haystack, needle) def python_built_in(self, haystack: str, needle: str) -> int: """ T: O(n) The python built in method :param haystack: the string to find in :param needle: the target substring :return: the index of the substring """ return haystack.index(needle) if needle in haystack else -1 def two_pointer(self, haystack: str, needle: str) -> int: """ T: O(n^2) The two po9inter solution. Note: also the brute force solution :param haystack: the string to find in :param needle: the target substring :return: the index of the substring """ idx = 0 while idx <= len(haystack) - len(needle): if haystack[idx] == needle[0]: is_match = True num_char = 0 while num_char < len(needle): if haystack[idx + num_char] != needle[num_char]: is_match = False break num_char += 1 if is_match: return idx idx += 1 return -1
class Solution: def str_str(self, haystack: str, needle: str) -> int: """ Implement strStr(). Return the index of the first occurrence of needle in haystack, or -1 if needle is not part of haystack. >>> Solution().strStr("asdf", "") 0 >>> Solution().strStr("hello", "ll") 2 >>> Solution().strStr("aaaaa", "bba") -1 >>> Solution().strStr("a", "a") 0 :param haystack: the string to find in :param needle: the target substring :return: the index of the substring """ if len(needle) == 0: return 0 if len(haystack) == 0 or len(haystack) < len(needle): return -1 return self.python_built_in(haystack, needle) def python_built_in(self, haystack: str, needle: str) -> int: """ T: O(n) The python built in method :param haystack: the string to find in :param needle: the target substring :return: the index of the substring """ return haystack.index(needle) if needle in haystack else -1 def two_pointer(self, haystack: str, needle: str) -> int: """ T: O(n^2) The two po9inter solution. Note: also the brute force solution :param haystack: the string to find in :param needle: the target substring :return: the index of the substring """ idx = 0 while idx <= len(haystack) - len(needle): if haystack[idx] == needle[0]: is_match = True num_char = 0 while num_char < len(needle): if haystack[idx + num_char] != needle[num_char]: is_match = False break num_char += 1 if is_match: return idx idx += 1 return -1
class ContentTypeSerializer(object): """ A ContentTypeSerializer handles the conversion from a python data structure to a bytes object representing the content in a particular content type. """ def content_type(self): """ return back what a list of content types this serializer should support. """ raise NotImplementedError() # noqa def main_type(self): """ return back a single content type that represents this serializer. """ raise NotImplementedError() # noqa def dump(data): """ should return back a bytes (or string in python 2), representation of your object, to be used in e.g. response bodies. a ValueError should be returned in the case where the object cannote be serialized. """ raise NotImplementedError() # noqa def load(raw_bytes): """ given a bytes object, should return a base python data structure that represents the object. a ValueError should be returned in the case where the object cannot be serialized. """ raise NotImplementedError() # noqa def can_handle(content_type_name): """ given a content type, returns true if this serializer can convert bodies of the given type. """ raise NotImplementedError() # noqa
class Contenttypeserializer(object): """ A ContentTypeSerializer handles the conversion from a python data structure to a bytes object representing the content in a particular content type. """ def content_type(self): """ return back what a list of content types this serializer should support. """ raise not_implemented_error() def main_type(self): """ return back a single content type that represents this serializer. """ raise not_implemented_error() def dump(data): """ should return back a bytes (or string in python 2), representation of your object, to be used in e.g. response bodies. a ValueError should be returned in the case where the object cannote be serialized. """ raise not_implemented_error() def load(raw_bytes): """ given a bytes object, should return a base python data structure that represents the object. a ValueError should be returned in the case where the object cannot be serialized. """ raise not_implemented_error() def can_handle(content_type_name): """ given a content type, returns true if this serializer can convert bodies of the given type. """ raise not_implemented_error()
employees_happiness = [int(happiness) for happiness in input().split()] factor = int(input()) factored_employees_happiness = list(map(lambda h: h * factor, employees_happiness)) find_average_happiness = sum(factored_employees_happiness) / len(factored_employees_happiness) happy_employees = [e for e in factored_employees_happiness if e >= find_average_happiness] unhappy_employees = [e for e in factored_employees_happiness if e < find_average_happiness] if len(happy_employees) >= len(unhappy_employees): print(f'Score: {len(happy_employees)}/{len(employees_happiness)}. Employees are happy!') else: print(f'Score: {len(happy_employees)}/{len(employees_happiness)}. Employees are not happy!')
employees_happiness = [int(happiness) for happiness in input().split()] factor = int(input()) factored_employees_happiness = list(map(lambda h: h * factor, employees_happiness)) find_average_happiness = sum(factored_employees_happiness) / len(factored_employees_happiness) happy_employees = [e for e in factored_employees_happiness if e >= find_average_happiness] unhappy_employees = [e for e in factored_employees_happiness if e < find_average_happiness] if len(happy_employees) >= len(unhappy_employees): print(f'Score: {len(happy_employees)}/{len(employees_happiness)}. Employees are happy!') else: print(f'Score: {len(happy_employees)}/{len(employees_happiness)}. Employees are not happy!')
db_config = { 'user': 'user', 'password': 'password', 'host': 'host.com', 'port': 12345, 'database': 'db-name', "autocommit": True }
db_config = {'user': 'user', 'password': 'password', 'host': 'host.com', 'port': 12345, 'database': 'db-name', 'autocommit': True}
class Solution: def setZeroes(self, matrix: List[List[int]]) -> None: """ Do not return anything, modify matrix in-place instead. """ ''' T: O(m * n) S: (m + n) ''' nrow = len(matrix) ncol = len(matrix[0]) rows, cols = set(), set() for i in range(nrow): for j in range(ncol): if matrix[i][j] == 0: rows.add(i) cols.add(j) for i in range(nrow): for j in range(ncol): if i in rows or j in cols: matrix[i][j] = 0
class Solution: def set_zeroes(self, matrix: List[List[int]]) -> None: """ Do not return anything, modify matrix in-place instead. """ '\n T: O(m * n)\n S: (m + n)\n ' nrow = len(matrix) ncol = len(matrix[0]) (rows, cols) = (set(), set()) for i in range(nrow): for j in range(ncol): if matrix[i][j] == 0: rows.add(i) cols.add(j) for i in range(nrow): for j in range(ncol): if i in rows or j in cols: matrix[i][j] = 0
# encoding: utf-8 """ @version: v1.0 @author: Richard @license: Apache Licence @contact: billions.richard@qq.com @site: @software: PyCharm @time: 2019/9/8 9:37 """ def get_remove_len(node_pth: list) -> int: reversed_pth = list(reversed(node_pth)) pth_len = 0 lst_node = reversed_pth[0] for node in reversed_pth[1:]: pth_len += (lst_node - node - 1) lst_node = node return pth_len def remove_n_chars_to_be_sub_str(s, p): if p in s: return 0 matrix = [] s_len = len(s) for sub_chr in p: matrix.append([i for i in range(s_len) if s[i] == sub_chr]) p_len = len(p) first_nodes = matrix[0] all_pths = [] for f_node in first_nodes: pths = [] cur_node = f_node pths.append(cur_node) for i in range(1, p_len): next_nodes = matrix[i] next_nodes = list(filter(lambda n: n > cur_node, next_nodes)) if next_nodes: pths.append(next_nodes[0]) cur_node = next_nodes[0] if len(pths) == p_len: all_pths.append(pths) all_pths.sort(key=get_remove_len) return get_remove_len(all_pths[0]) if __name__ == '__main__': s = 'facbacdefacbabdfcadef' p = 'fdef' print(remove_n_chars_to_be_sub_str(s, p))
""" @version: v1.0 @author: Richard @license: Apache Licence @contact: billions.richard@qq.com @site: @software: PyCharm @time: 2019/9/8 9:37 """ def get_remove_len(node_pth: list) -> int: reversed_pth = list(reversed(node_pth)) pth_len = 0 lst_node = reversed_pth[0] for node in reversed_pth[1:]: pth_len += lst_node - node - 1 lst_node = node return pth_len def remove_n_chars_to_be_sub_str(s, p): if p in s: return 0 matrix = [] s_len = len(s) for sub_chr in p: matrix.append([i for i in range(s_len) if s[i] == sub_chr]) p_len = len(p) first_nodes = matrix[0] all_pths = [] for f_node in first_nodes: pths = [] cur_node = f_node pths.append(cur_node) for i in range(1, p_len): next_nodes = matrix[i] next_nodes = list(filter(lambda n: n > cur_node, next_nodes)) if next_nodes: pths.append(next_nodes[0]) cur_node = next_nodes[0] if len(pths) == p_len: all_pths.append(pths) all_pths.sort(key=get_remove_len) return get_remove_len(all_pths[0]) if __name__ == '__main__': s = 'facbacdefacbabdfcadef' p = 'fdef' print(remove_n_chars_to_be_sub_str(s, p))
VALUE_TYPES = { 'short', 'int', 'long', 'uchar', 'ushort', 'uint', 'ulong', 'bool', 'float', 'double', 'size_t', 'uint8', 'int8', 'int16', 'uint16', 'int32', 'uint32', 'int64', 'uint64', } VALA_TYPES = VALUE_TYPES | { 'char', 'string', 'void*', 'void**', 'time_t', } VALA_ALIASES = { 'unsigned int': 'uint', 'short unsigned int': 'ushort', 'unsigned long': 'ulong', 'int64_t': 'int64', 'uint64_t': 'uint64', 'long long': 'int64', } GLIB_TYPES = { "GData": "GLib.Datalist", }
value_types = {'short', 'int', 'long', 'uchar', 'ushort', 'uint', 'ulong', 'bool', 'float', 'double', 'size_t', 'uint8', 'int8', 'int16', 'uint16', 'int32', 'uint32', 'int64', 'uint64'} vala_types = VALUE_TYPES | {'char', 'string', 'void*', 'void**', 'time_t'} vala_aliases = {'unsigned int': 'uint', 'short unsigned int': 'ushort', 'unsigned long': 'ulong', 'int64_t': 'int64', 'uint64_t': 'uint64', 'long long': 'int64'} glib_types = {'GData': 'GLib.Datalist'}
num = float(input("Enter a Number: ")) if num > 0: print("This is a Positive Number") elif num == 0: print("Zero") else: print("This is a Negative Number")
num = float(input('Enter a Number: ')) if num > 0: print('This is a Positive Number') elif num == 0: print('Zero') else: print('This is a Negative Number')