content
stringlengths
7
1.05M
fixed_cases
stringlengths
1
1.28M
DEBUG = True PORT = 8080 SECRET_KEY = "secret" WTF_CSRF_ENABLED = True baseUrl = "https://hp8xm3yzr0.execute-api.us-east-2.amazonaws.com/prod/"
debug = True port = 8080 secret_key = 'secret' wtf_csrf_enabled = True base_url = 'https://hp8xm3yzr0.execute-api.us-east-2.amazonaws.com/prod/'
class DigestConfig: def __init__(self): self.digest_AAs = "KR" self.Nterm = False self.min_len = 9 self.max_len = 30 self.max_miss_cleave = 2 self.cleave_type = "full" def digest(protein, pepset, conf): if conf.cleave_type == "full": return digest_full(protein, pepset, conf.digest_AAs, conf.Nterm, conf.min_len, conf.max_len, conf.max_miss_cleave) else: return pepset def digest_full(protein, pepset, digest_AAs="KR", Nterm=False, min_len=9, max_len=30, max_miss_cleave=2): seq = protein.seq if Nterm: seq = seq[::-1] digest_sites = [0] # no matter what, cleavage at pos before the first aa for i in range(len(seq)): if seq[i] in digest_AAs: digest_sites.append(i + 1) # i+1? seq=KAAK, sites=0 and 3, result seq is seq[0+1:3+1] if digest_sites[-1] != len(seq) - 1: # no matter what, cleavage at the last aa digest_sites.append(len(seq)) return cleave_full(seq, pepset, digest_sites, Nterm, min_len, max_len, max_miss_cleave) def cleave_full(seq, seq_set, sites, Nterm=False, min_len=7, max_len=30, max_miss_cleave=2): def add_Nterm_M_loss(seq_set, sub_seq): if sub_seq[0] == "M" and len(sub_seq) - 1 >= min_len and len(sub_seq) - 1 <= max_len: seq_set.add(sub_seq[1:]) for i in range(len(sites)): for msclv in range(max_miss_cleave + 1): if i + msclv + 1 >= len(sites): break sub_seq = seq[sites[i]:sites[i + msclv + 1]] if len(sub_seq) > max_len or len(sub_seq) < min_len: continue if Nterm: sub_seq = sub_seq[::-1] if i == len(sites) - 1: add_Nterm_M_loss(seq_set, sub_seq) else: if i == 0: add_Nterm_M_loss(seq_set, sub_seq) seq_set.add(sub_seq) return seq_set
class Digestconfig: def __init__(self): self.digest_AAs = 'KR' self.Nterm = False self.min_len = 9 self.max_len = 30 self.max_miss_cleave = 2 self.cleave_type = 'full' def digest(protein, pepset, conf): if conf.cleave_type == 'full': return digest_full(protein, pepset, conf.digest_AAs, conf.Nterm, conf.min_len, conf.max_len, conf.max_miss_cleave) else: return pepset def digest_full(protein, pepset, digest_AAs='KR', Nterm=False, min_len=9, max_len=30, max_miss_cleave=2): seq = protein.seq if Nterm: seq = seq[::-1] digest_sites = [0] for i in range(len(seq)): if seq[i] in digest_AAs: digest_sites.append(i + 1) if digest_sites[-1] != len(seq) - 1: digest_sites.append(len(seq)) return cleave_full(seq, pepset, digest_sites, Nterm, min_len, max_len, max_miss_cleave) def cleave_full(seq, seq_set, sites, Nterm=False, min_len=7, max_len=30, max_miss_cleave=2): def add__nterm_m_loss(seq_set, sub_seq): if sub_seq[0] == 'M' and len(sub_seq) - 1 >= min_len and (len(sub_seq) - 1 <= max_len): seq_set.add(sub_seq[1:]) for i in range(len(sites)): for msclv in range(max_miss_cleave + 1): if i + msclv + 1 >= len(sites): break sub_seq = seq[sites[i]:sites[i + msclv + 1]] if len(sub_seq) > max_len or len(sub_seq) < min_len: continue if Nterm: sub_seq = sub_seq[::-1] if i == len(sites) - 1: add__nterm_m_loss(seq_set, sub_seq) elif i == 0: add__nterm_m_loss(seq_set, sub_seq) seq_set.add(sub_seq) return seq_set
def split(str): splitted=str.split(" ") return splitted def join(str): joined="-".join(str) return joined str="Geeks For Geeks" splitted=split(str) print(splitted) print(join(splitted))
def split(str): splitted = str.split(' ') return splitted def join(str): joined = '-'.join(str) return joined str = 'Geeks For Geeks' splitted = split(str) print(splitted) print(join(splitted))
def stage(hub, name): ''' Take the highdata and reconcoile the extend keyword ''' high, errors = hub.idem.extend.reconcile(hub.idem.RUNS[name]['high']) hub.idem.RUNS[name]['high'] = high hub.idem.RUNS[name]['errors'] = errors
def stage(hub, name): """ Take the highdata and reconcoile the extend keyword """ (high, errors) = hub.idem.extend.reconcile(hub.idem.RUNS[name]['high']) hub.idem.RUNS[name]['high'] = high hub.idem.RUNS[name]['errors'] = errors
# Formatting configuration for locale sv_SE languages={'gv': 'manx gaeliska', 'gu': 'gujarati', 'rom': 'romani', 'ale': 'aleutiska', 'sco': 'skotska', 'mni': 'manipuri', 'gd': 'skotsk gaeliska', 'ga': u'irl\xe4ndsk gaeliska', 'osa': 'osage', 'gn': u'guaran\xed', 'gl': 'galiciska', 'mwr': 'marwari', 'ty': 'tahitiska', 'tw': 'twi', 'tt': 'tatariska', 'tr': 'turkiska', 'ts': 'tsonga', 'tn': 'tswana', 'to': 'tonga', 'tl': 'tagalog', 'tk': 'turkmeniska', 'th': u'thail\xe4ndska', 'ti': 'tigrinja', 'tg': 'tadzjikiska', 'te': 'telugu', 'uga': 'ugaritiska', 'ta': 'tamil', 'fat': 'fanti', 'fan': 'fang', 'got': 'gotiska', 'din': 'dinka', 'ml': 'malayalam', 'zh': 'kinesiska', 'tem': 'temne', 'za': 'zhuang', 'zu': 'zulu', 'ter': 'tereno', 'tet': 'tetum', 'mnc': 'manchu', 'kut': 'kutenai', 'suk': 'sukuma', 'kum': 'kumyk', 'sus': 'susu', 'new': 'newari', 'sux': 'sumeriska', 'men': 'mende', 'lez': 'lezghien', 'eka': 'ekajuk', 'akk': 'akkadiska', 'bra': 'braj', 'chb': 'chibcha', 'chg': 'chagatai', 'chk': 'chuukesiska', 'chm': 'mari', 'chn': 'chinook', 'cho': 'choctaw', 'chr': 'cherokesiska', 'chy': 'cheyenne', 'ii': 'yi', 'mg': 'malagassiska', 'iba': 'iban', 'mo': 'moldaviska', 'mn': 'mongoliska', 'mi': 'maori', 'mh': 'marshalliska', 'mk': 'makedonska', 'mt': 'maltesiska', 'del': 'delaware', 'ms': 'malajiska', 'mr': 'marathi', 'my': 'burmanska', 'cad': 'caddo', 'nyn': 'nyankole', 'nyo': 'nyoro', 'sid': 'sidamo', 'lam': 'lamba', 'mas': 'massajiska', 'lah': 'lahnda', 'fy': 'frisiska', 'snk': 'soninke', 'fa': 'farsi', 'mad': 'madurese', 'mag': 'magahi', 'mai': 'maithili', 'fi': 'finska', 'fj': 'fidjianska', 'man': 'mande', 'znd': u'zand\xe9', 'ss': 'swati', 'sr': 'serbiska', 'sq': 'albanska', 'sw': 'swahili', 'sv': 'svenska', 'su': 'sundanesiska', 'st': u'syd\xadsotho', 'sk': 'slovakiska', 'si': 'singalesiska', 'sh': 'serbokroatiska', 'so': 'somali', 'sn': 'shona; manshona', 'sm': 'samoanska', 'sl': 'slovenska', 'sc': 'sardiska', 'sa': 'sanskrit', 'sg': 'sango', 'se': u'nord\xadsamiska', 'sd': 'sindhi', 'zen': 'zenaga', 'lg': 'luganda', 'lb': 'luxemburgiska', 'la': 'latin', 'ln': 'lingala', 'lo': 'laotiska', 'li': 'limburgiska', 'lv': 'lettiska', 'lt': 'litauiska', 'lu': 'luba-katanga', 'yi': 'jiddisch', 'ceb': 'cebuano', 'yo': 'yoruba', 'nym': 'nyamwezi', 'dak': 'dakota', 'day': 'dayak', 'kpe': 'kpelle', 'el': 'grekiska', 'eo': 'esperanto', 'en': 'engelska', 'ee': 'ewe', 'fr': 'franska', 'eu': 'baskiska', 'et': 'estniska', 'es': 'spanska', 'ru': 'ryska', 'gon': 'gondi', 'rm': u'r\xe4to\xadromanska', 'rn': 'rundi', 'ro': u'rum\xe4nska', 'bla': 'siksika', 'gor': 'gorontalo', 'ast': 'asturiska', 'xh': 'xhosa', 'ff': 'fulani', 'mak': 'makasar', 'zap': 'zapotek', 'kok': 'konkani', 'kos': 'kosreanska', 'fo': u'f\xe4r\xf6iska', 'tog': 'tonga-Nyasa', 'hup': 'hupa', 'bej': 'beyja', 'bem': 'bemba', 'nzi': 'nzima', 'sah': 'jakutiska', 'sam': 'samaritanska', 'raj': 'rajasthani', 'sad': 'sandawe', 'rar': 'rarotongan', 'rap': 'rapanui', 'sas': 'sasak', 'car': 'karibiska', 'min': 'minangkabau', 'mic': 'mic-mac', 'nah': 'nahuatl; aztekiska', 'efi': 'efik', 'btk': 'batak', 'kac': 'kachin', 'kab': 'kabyliska', 'kaa': 'karakalpakiska', 'kam': 'kamba', 'kar': 'karen', 'kaw': 'kawi', 'tyv': 'tuviniska', 'awa': 'awadhi', 'ka': 'georgiska', 'doi': 'dogri', 'kg': 'kikongo', 'kk': 'kazakiska', 'kj': 'kuanyama', 'ki': 'kikuyu', 'ko': 'koreanska', 'kn': 'kanaresiska; kannada', 'tpi': 'tok pisin', 'kl': u'gr\xf6nl\xe4ndska', 'ks': 'kashmiri', 'kr': 'kanuri', 'kw': 'korniska', 'kv': 'kome', 'ku': 'kurdiska', 'ky': 'kirgisiska', 'tkl': 'tokelau', 'bua': 'buriat', 'dyu': 'dyula', 'de': 'tyska', 'da': 'danska', 'dz': 'dzongkha', 'dv': 'maldiviska', 'hil': 'hiligaynon', 'him': 'himachali', 'qu': 'quechua', 'bas': 'basa', 'gba': 'gbaya', 'bad': 'banda', 'ban': 'balinesiska', 'bal': 'baluchi', 'bam': 'bambara', 'shn': 'shan', 'arp': 'arapaho', 'arw': 'arawakiska', 'arc': 'arameiska', 'sel': 'selkup', 'arn': 'araukanska', 'lus': 'lushai', 'mus': 'muskogee', 'lua': 'luba-lulua', 'lui': u'luise\xf1o', 'lun': 'lunda', 'wa': 'walloon', 'wo': 'wolof', 'jv': 'javanska', 'tum': 'tumbuka', 'ja': 'japanska', 'cop': 'koptiska', 'ilo': 'iloko', 'tsi': 'tsimshian', 'gwi': "gwich'in", 'tli': 'tlingit', 'ch': 'chamorro', 'co': 'korsiska', 'ca': 'katalanska', 'ce': 'tjetjenska', 'pon': 'ponape', 'cy': 'walesiska', 'cs': 'tjeckiska', 'cr': 'cree', 'cv': 'tjuvasjiska', 'ps': 'pashto; afghanska', 'bho': 'bhojpuri', 'pt': 'portugisiska', 'dua': 'duala', 'pa': 'panjabi', 'pi': 'pali', 'pl': 'polska', 'gay': 'gayo', 'hmn': 'hmong', 'gaa': u'g\xe0', 'fur': 'friuilian', 've': 'venda', 'vi': 'vietnamesiska', 'is': u'isl\xe4ndska', 'av': 'avariska', 'iu': 'inuktitut', 'it': 'italienska', 'vot': 'votiska', 'ik': 'inupiaq', 'id': 'indonesiska', 'ig': 'ibo', 'pap': 'papiamento', 'ewo': 'ewondo', 'pau': 'palauan', 'pag': 'pangasinan', 'sat': 'santali', 'pam': 'pampanga', 'phn': 'kananeiska; feniciska', 'nia': 'nias', 'dgr': 'dogrib', 'syr': 'syriska', 'niu': 'niuean', 'nb': u'norskt bokm\xe5l', 'hai': 'haida', 'elx': 'elamitiska', 'ada': 'adangme', 'haw': 'hawaiiska', 'bin': 'bini', 'bik': 'bikol', 'mos': 'mossi', 'moh': 'mohawk', 'tvl': 'tuvaluan', 'kmb': 'kinbundu', 'umb': 'umbundu', 'tmh': 'tamashek', 'be': 'vitryska', 'bg': 'bulgariska', 'ba': 'basjkiriska', 'bn': 'bengali', 'bo': 'tibetanska', 'bh': 'bihari', 'bi': 'bislama', 'br': 'bretonska', 'bs': 'bosniska', 'om': 'oromo', 'oj': 'odjibwa; chippewa', 'ace': 'achinese', 'ach': 'acholi', 'oc': 'provensalska', 'kru': 'kurukh', 'srr': 'serer', 'kro': 'kru', 'os': 'ossetiska', 'or': 'oriya', 'sog': 'sogdiska', 'nso': u'nord\xadsotho', 'son': 'songhai', 'wal': 'walamo', 'lol': 'lolo; mongo', 'loz': 'lozi', 'gil': 'gilbertesiska; kiribati', 'was': 'washo', 'war': 'waray', 'hz': 'herero', 'hy': 'armeniska', 'hr': 'kroatiska', 'hu': 'ungerska', 'hi': 'hindi', 'ho': 'hiri motu', 'ha': 'haussa', 'bug': 'buginesiska', 'he': 'hebreiska', 'uz': 'uzbekiska', 'ur': 'urdu', 'uk': 'ukrainska', 'ug': 'uiguriska', 'aa': 'afar', 'ab': 'abkhaziska', 'ae': 'avestiska', 'af': 'afrikaans', 'ak': 'akan', 'am': 'amhariska', 'mdr': 'mandar', 'as': 'assami', 'ar': 'arabiska', 'km': 'kambodjanska; khmer', 'kho': 'sakiska', 'ay': 'aymara', 'kha': 'khasi', 'az': 'azerbadzjanska', 'nl': u'nederl\xe4ndska', 'nn': u'ny\xadnorsk', 'no': 'norska', 'na': 'nauru', 'tiv': 'tivi', 'nd': u'nord\xadndebele', 'ne': 'nepali', 'ng': 'ndonga', 'ny': 'nyanja', 'nap': 'napolitanska', 'grb': 'grebo', 'nr': u'syd\xadndebele', 'tig': u'tigr\xe9', 'nv': 'navaho', 'zun': u'zu\xf1i', 'rw': 'rwanda; kinjarwanda'} countries={'BD': 'Bangladesh', 'BE': 'Belgien', 'BF': 'Burkina Faso', 'BG': 'Bulgarien', 'BA': 'Bosnien och Hercegovina', 'BB': 'Barbados', 'WF': u'Wallis och Futuna\xf6arna', 'BM': 'Bermuda', 'BN': 'Brunei', 'BO': 'Bolivia', 'BH': 'Bahrain', 'BI': 'Burundi', 'BJ': 'Benin', 'BT': 'Bhutan', 'JM': 'Jamaica', 'BV': u'Bouvet\xf6n', 'BW': 'Botswana', 'WS': 'Samoa', 'BR': 'Brasilien', 'BS': 'Bahamas', 'BY': 'Vitryssland', 'BZ': 'Belize', 'RU': 'Ryssland', 'RW': 'Rwanda', 'TL': u'\xd6sttimor', 'RE': u'R\xe9union', 'TM': 'Turkmenistan', 'TJ': 'Tadzjikistan', 'RO': u'Rum\xe4nien', 'TK': u'Tokelau\xf6arna', 'GW': 'Guinea-Bissau', 'GU': 'Guam', 'GT': 'Guatemala', 'GS': u'Sydgeorgien och S\xf6dra Sandwich\xf6arna', 'GR': 'Grekland', 'GQ': 'Ekvatorialguinea', 'GP': 'Guadelope', 'JP': 'Japan', 'GY': 'Guyana', 'GF': 'Franska Guyana', 'GE': 'Georgien', 'GD': 'Grenada', 'GB': 'Storbritannien', 'GA': 'Gabon', 'SV': 'El Salvador', 'GN': 'Guinea', 'GM': 'Gambia', 'GL': u'Gr\xf6nland', 'GI': 'Gibraltar', 'GH': 'Ghana', 'OM': 'Oman', 'TN': 'Tunisien', 'JO': 'Jordanien', 'SP': 'Serbia', 'HR': 'Kroatien', 'HT': 'Haiti', 'HU': 'Ungern', 'HK': 'Hongkong (Kina)', 'HN': 'Honduras', 'HM': u'Heard- och McDonald\xf6arna', 'VE': 'Venezuela', 'PR': 'Puerto Rico', 'PS': 'Palestinska territoriet', 'PW': 'Palau', 'PT': 'Portugal', 'SJ': 'Svalbard och Jan Mayen', 'PY': 'Paraguay', 'IQ': 'Irak', 'PA': 'Panama', 'PF': 'Franska Polynesien', 'PG': 'Papua Nya Guinea', 'PE': 'Peru', 'PK': 'Pakistan', 'PH': 'Filippinerna', 'PN': 'Pitcairn', 'PL': 'Polen', 'PM': 'S:t Pierre och Miquelon', 'ZM': 'Zambia', 'EH': u'V\xe4stra Sahara', 'EE': 'Estland', 'EG': 'Egypten', 'ZA': 'Sydafrika', 'EC': 'Ecuador', 'IT': 'Italien', 'VN': 'Vietnam', 'SB': u'Salomon\xf6arna', 'ET': 'Etiopien', 'SO': 'Somalia', 'ZW': 'Zimbabwe', 'SA': 'Saudi-Arabien', 'ES': 'Spanien', 'ER': 'Eritrea', 'MD': 'Moldavien', 'MG': 'Madagaskar', 'MA': 'Marocko', 'MC': 'Monaco', 'UZ': 'Uzbekistan', 'MM': 'Myanmar', 'ML': 'Mali', 'MO': 'Macao S.A.R. China', 'MN': 'Mongoliet', 'MH': u'Marshall\xf6arna', 'MK': 'Makedonien', 'MU': 'Mauritius', 'MT': 'Malta', 'MW': 'Malawi', 'MV': 'Maldiverna', 'MQ': 'Martinique', 'MP': 'Nordmarianerna', 'MS': 'Montserrat', 'MR': 'Mauretanien', 'UG': 'Uganda', 'MY': 'Malaysia', 'MX': 'Mexiko', 'IL': 'Israel', 'FR': 'Frankrike', 'IO': u'Brittiska Indiska ocean\xf6arna', 'SH': 'S:t Helena', 'FI': 'Finland', 'FJ': 'Fiji', 'FK': u'Falklands\xf6arna', 'FM': 'Mikronesien', 'FO': u'F\xe4r\xf6arna', 'NI': 'Nicaragua', 'NL': u'Nederl\xe4nderna', 'NO': 'Norge', 'NA': 'Namibia', 'VU': 'Vanuatu', 'NC': 'Nya Kaledonien', 'NE': 'Niger', 'NF': u'Norfolk\xf6n', 'NG': 'Nigeria', 'NZ': 'Nya Zeeland', 'NP': 'Nepal', 'NR': 'Nauru', 'NU': u'Niue\xf6n', 'CK': u'Cook\xf6arna', 'CI': 'Elfenbenskusten', 'CH': 'Schweiz', 'CO': 'Colombia', 'CN': 'Kina', 'CM': 'Kamerun', 'CL': 'Chile', 'CC': u'Kokos\xf6arna (Keeling\xf6arna)', 'CA': 'Kanada', 'CG': 'Kongo', 'CF': 'Centralafrikanska republiken', 'CD': 'Demokratiska republiken Kongo', 'CZ': 'Tjeckien', 'CY': 'Cypern', 'CX': u'Jul\xf6n', 'CR': 'Costa Rica', 'Fallback': 'en', 'CV': 'Kap Verde', 'CU': 'Kuba', 'SZ': 'Swaziland', 'SY': 'Syrien', 'KG': 'Kirgisistan', 'KE': 'Kenya', 'SR': 'Surinam', 'KI': 'Kiribati', 'KH': 'Kambodja', 'KN': 'S:t Christopher och Nevis', 'KM': 'Komorerna', 'ST': u'S\xe3o Tom\xe9 och Pr\xedncipe', 'SK': 'Slovakien', 'KR': 'Sydkorea', 'SI': 'Slovenien', 'KP': 'Nordkorea', 'KW': 'Kuwait', 'SN': 'Senegal', 'SM': 'San Marino', 'SL': 'Sierra Leone', 'SC': 'Seychellerna', 'KZ': 'Kazachstan', 'KY': u'Kajman\xf6arna', 'SG': 'Singapore', 'SE': 'Sverige', 'SD': 'Sudan', 'DO': 'Dominikanska republiken', 'DM': 'Dominica', 'DJ': 'Djibouti', 'DK': 'Danmark', 'VG': u'Brittiska Jungfru\xf6arna', 'DE': 'Tyskland', 'YE': 'Jemen', 'DZ': 'Algeriet', 'US': u'Amerikas F\xf6renta Stater', 'UY': 'Uruguay', 'YU': 'Jugoslavien', 'YT': 'Mayotte', 'UM': u'Sm\xe5, avl\xe4gset bel\xe4gna \xf6ar som tillh\xf6r F\xf6renta staterna', 'LB': 'Libanon', 'LC': 'S:t Lucia', 'LA': 'Laos', 'TV': 'Tuvalu', 'TW': 'Taiwan', 'TT': 'Trinidad och Tobago', 'TR': 'Turkiet', 'LK': 'Sri Lanka', 'LI': 'Liechtenstein', 'LV': 'Lettland', 'TO': 'Tonga', 'LT': 'Litauen', 'LU': 'Luxemburg', 'LR': 'Liberia', 'LS': 'Lesotho', 'TH': 'Thailand', 'TF': 'Franska Sydterritorierna', 'TG': 'Togo', 'TD': 'Tchad', 'TC': u'Turks- och Caicos\xf6arna', 'LY': 'Libyen', 'VA': 'Vatikanstaten', 'VC': 'S:t Vincent och Grenadinerna', 'AE': u'F\xf6renade Arabemiraten', 'AD': 'Andorra', 'AG': 'Antigua och Barbuda', 'AF': 'Afganistan', 'AI': 'Anguilla', 'VI': u'Amerikanska Jungfru\xf6arna', 'IS': 'Island', 'IR': 'Iran', 'AM': 'Armenien', 'AL': 'Albanien', 'AO': 'Angola', 'AN': u'Nederl\xe4ndska Antillerna', 'AQ': 'Antarktis', 'AS': 'Amerikanska Samoa', 'AR': 'Argentina', 'AU': 'Australien', 'AT': u'\xd6sterrike', 'AW': 'Aruba', 'IN': 'Indien', 'TZ': 'Tanzania', 'AZ': 'Azerbajdzjan', 'IE': 'Irland', 'ID': 'Indonesien', 'UA': 'Ukraina', 'QA': 'Qatar', 'MZ': u'Mo\xe7ambique'} months=['januari', 'februari', 'mars', 'april', 'maj', 'juni', 'juli', 'augusti', 'september', 'oktober', 'november', 'december'] abbrMonths=['jan', 'feb', 'mar', 'apr', 'maj', 'jun', 'jul', 'aug', 'sep', 'okt', 'nov', 'dec'] days=[u'm\xe5ndag', 'tisdag', 'onsdag', 'torsdag', 'fredag', u'l\xf6rdag', u's\xf6ndag'] abbrDays=[u'm\xe5', 'ti', 'on', 'to', 'fr', u'l\xf6', u's\xf6'] dateFormats={'medium': '%Y-%m-%d', 'full': 'den %d %%(monthname)s %Y', 'long': 'den %d %%(abbrmonthname)s %Y', 'short': '%Y-%m-%d'} numericSymbols={'group': u'\xa0', 'nativeZeroDigit': '0', 'exponential': 'E', 'perMille': u'\u2030', 'nan': u'\ufffd', 'decimal': ',', 'percentSign': '%', 'list': ';', 'patternDigit': '#', 'plusSign': '+', 'infinity': u'\u221e', 'minusSign': '-'}
languages = {'gv': 'manx gaeliska', 'gu': 'gujarati', 'rom': 'romani', 'ale': 'aleutiska', 'sco': 'skotska', 'mni': 'manipuri', 'gd': 'skotsk gaeliska', 'ga': u'irländsk gaeliska', 'osa': 'osage', 'gn': u'guaraní', 'gl': 'galiciska', 'mwr': 'marwari', 'ty': 'tahitiska', 'tw': 'twi', 'tt': 'tatariska', 'tr': 'turkiska', 'ts': 'tsonga', 'tn': 'tswana', 'to': 'tonga', 'tl': 'tagalog', 'tk': 'turkmeniska', 'th': u'thailändska', 'ti': 'tigrinja', 'tg': 'tadzjikiska', 'te': 'telugu', 'uga': 'ugaritiska', 'ta': 'tamil', 'fat': 'fanti', 'fan': 'fang', 'got': 'gotiska', 'din': 'dinka', 'ml': 'malayalam', 'zh': 'kinesiska', 'tem': 'temne', 'za': 'zhuang', 'zu': 'zulu', 'ter': 'tereno', 'tet': 'tetum', 'mnc': 'manchu', 'kut': 'kutenai', 'suk': 'sukuma', 'kum': 'kumyk', 'sus': 'susu', 'new': 'newari', 'sux': 'sumeriska', 'men': 'mende', 'lez': 'lezghien', 'eka': 'ekajuk', 'akk': 'akkadiska', 'bra': 'braj', 'chb': 'chibcha', 'chg': 'chagatai', 'chk': 'chuukesiska', 'chm': 'mari', 'chn': 'chinook', 'cho': 'choctaw', 'chr': 'cherokesiska', 'chy': 'cheyenne', 'ii': 'yi', 'mg': 'malagassiska', 'iba': 'iban', 'mo': 'moldaviska', 'mn': 'mongoliska', 'mi': 'maori', 'mh': 'marshalliska', 'mk': 'makedonska', 'mt': 'maltesiska', 'del': 'delaware', 'ms': 'malajiska', 'mr': 'marathi', 'my': 'burmanska', 'cad': 'caddo', 'nyn': 'nyankole', 'nyo': 'nyoro', 'sid': 'sidamo', 'lam': 'lamba', 'mas': 'massajiska', 'lah': 'lahnda', 'fy': 'frisiska', 'snk': 'soninke', 'fa': 'farsi', 'mad': 'madurese', 'mag': 'magahi', 'mai': 'maithili', 'fi': 'finska', 'fj': 'fidjianska', 'man': 'mande', 'znd': u'zandé', 'ss': 'swati', 'sr': 'serbiska', 'sq': 'albanska', 'sw': 'swahili', 'sv': 'svenska', 'su': 'sundanesiska', 'st': u'syd\xadsotho', 'sk': 'slovakiska', 'si': 'singalesiska', 'sh': 'serbokroatiska', 'so': 'somali', 'sn': 'shona; manshona', 'sm': 'samoanska', 'sl': 'slovenska', 'sc': 'sardiska', 'sa': 'sanskrit', 'sg': 'sango', 'se': u'nord\xadsamiska', 'sd': 'sindhi', 'zen': 'zenaga', 'lg': 'luganda', 'lb': 'luxemburgiska', 'la': 'latin', 'ln': 'lingala', 'lo': 'laotiska', 'li': 'limburgiska', 'lv': 'lettiska', 'lt': 'litauiska', 'lu': 'luba-katanga', 'yi': 'jiddisch', 'ceb': 'cebuano', 'yo': 'yoruba', 'nym': 'nyamwezi', 'dak': 'dakota', 'day': 'dayak', 'kpe': 'kpelle', 'el': 'grekiska', 'eo': 'esperanto', 'en': 'engelska', 'ee': 'ewe', 'fr': 'franska', 'eu': 'baskiska', 'et': 'estniska', 'es': 'spanska', 'ru': 'ryska', 'gon': 'gondi', 'rm': u'räto\xadromanska', 'rn': 'rundi', 'ro': u'rumänska', 'bla': 'siksika', 'gor': 'gorontalo', 'ast': 'asturiska', 'xh': 'xhosa', 'ff': 'fulani', 'mak': 'makasar', 'zap': 'zapotek', 'kok': 'konkani', 'kos': 'kosreanska', 'fo': u'färöiska', 'tog': 'tonga-Nyasa', 'hup': 'hupa', 'bej': 'beyja', 'bem': 'bemba', 'nzi': 'nzima', 'sah': 'jakutiska', 'sam': 'samaritanska', 'raj': 'rajasthani', 'sad': 'sandawe', 'rar': 'rarotongan', 'rap': 'rapanui', 'sas': 'sasak', 'car': 'karibiska', 'min': 'minangkabau', 'mic': 'mic-mac', 'nah': 'nahuatl; aztekiska', 'efi': 'efik', 'btk': 'batak', 'kac': 'kachin', 'kab': 'kabyliska', 'kaa': 'karakalpakiska', 'kam': 'kamba', 'kar': 'karen', 'kaw': 'kawi', 'tyv': 'tuviniska', 'awa': 'awadhi', 'ka': 'georgiska', 'doi': 'dogri', 'kg': 'kikongo', 'kk': 'kazakiska', 'kj': 'kuanyama', 'ki': 'kikuyu', 'ko': 'koreanska', 'kn': 'kanaresiska; kannada', 'tpi': 'tok pisin', 'kl': u'grönländska', 'ks': 'kashmiri', 'kr': 'kanuri', 'kw': 'korniska', 'kv': 'kome', 'ku': 'kurdiska', 'ky': 'kirgisiska', 'tkl': 'tokelau', 'bua': 'buriat', 'dyu': 'dyula', 'de': 'tyska', 'da': 'danska', 'dz': 'dzongkha', 'dv': 'maldiviska', 'hil': 'hiligaynon', 'him': 'himachali', 'qu': 'quechua', 'bas': 'basa', 'gba': 'gbaya', 'bad': 'banda', 'ban': 'balinesiska', 'bal': 'baluchi', 'bam': 'bambara', 'shn': 'shan', 'arp': 'arapaho', 'arw': 'arawakiska', 'arc': 'arameiska', 'sel': 'selkup', 'arn': 'araukanska', 'lus': 'lushai', 'mus': 'muskogee', 'lua': 'luba-lulua', 'lui': u'luiseño', 'lun': 'lunda', 'wa': 'walloon', 'wo': 'wolof', 'jv': 'javanska', 'tum': 'tumbuka', 'ja': 'japanska', 'cop': 'koptiska', 'ilo': 'iloko', 'tsi': 'tsimshian', 'gwi': "gwich'in", 'tli': 'tlingit', 'ch': 'chamorro', 'co': 'korsiska', 'ca': 'katalanska', 'ce': 'tjetjenska', 'pon': 'ponape', 'cy': 'walesiska', 'cs': 'tjeckiska', 'cr': 'cree', 'cv': 'tjuvasjiska', 'ps': 'pashto; afghanska', 'bho': 'bhojpuri', 'pt': 'portugisiska', 'dua': 'duala', 'pa': 'panjabi', 'pi': 'pali', 'pl': 'polska', 'gay': 'gayo', 'hmn': 'hmong', 'gaa': u'gà', 'fur': 'friuilian', 've': 'venda', 'vi': 'vietnamesiska', 'is': u'isländska', 'av': 'avariska', 'iu': 'inuktitut', 'it': 'italienska', 'vot': 'votiska', 'ik': 'inupiaq', 'id': 'indonesiska', 'ig': 'ibo', 'pap': 'papiamento', 'ewo': 'ewondo', 'pau': 'palauan', 'pag': 'pangasinan', 'sat': 'santali', 'pam': 'pampanga', 'phn': 'kananeiska; feniciska', 'nia': 'nias', 'dgr': 'dogrib', 'syr': 'syriska', 'niu': 'niuean', 'nb': u'norskt bokmål', 'hai': 'haida', 'elx': 'elamitiska', 'ada': 'adangme', 'haw': 'hawaiiska', 'bin': 'bini', 'bik': 'bikol', 'mos': 'mossi', 'moh': 'mohawk', 'tvl': 'tuvaluan', 'kmb': 'kinbundu', 'umb': 'umbundu', 'tmh': 'tamashek', 'be': 'vitryska', 'bg': 'bulgariska', 'ba': 'basjkiriska', 'bn': 'bengali', 'bo': 'tibetanska', 'bh': 'bihari', 'bi': 'bislama', 'br': 'bretonska', 'bs': 'bosniska', 'om': 'oromo', 'oj': 'odjibwa; chippewa', 'ace': 'achinese', 'ach': 'acholi', 'oc': 'provensalska', 'kru': 'kurukh', 'srr': 'serer', 'kro': 'kru', 'os': 'ossetiska', 'or': 'oriya', 'sog': 'sogdiska', 'nso': u'nord\xadsotho', 'son': 'songhai', 'wal': 'walamo', 'lol': 'lolo; mongo', 'loz': 'lozi', 'gil': 'gilbertesiska; kiribati', 'was': 'washo', 'war': 'waray', 'hz': 'herero', 'hy': 'armeniska', 'hr': 'kroatiska', 'hu': 'ungerska', 'hi': 'hindi', 'ho': 'hiri motu', 'ha': 'haussa', 'bug': 'buginesiska', 'he': 'hebreiska', 'uz': 'uzbekiska', 'ur': 'urdu', 'uk': 'ukrainska', 'ug': 'uiguriska', 'aa': 'afar', 'ab': 'abkhaziska', 'ae': 'avestiska', 'af': 'afrikaans', 'ak': 'akan', 'am': 'amhariska', 'mdr': 'mandar', 'as': 'assami', 'ar': 'arabiska', 'km': 'kambodjanska; khmer', 'kho': 'sakiska', 'ay': 'aymara', 'kha': 'khasi', 'az': 'azerbadzjanska', 'nl': u'nederländska', 'nn': u'ny\xadnorsk', 'no': 'norska', 'na': 'nauru', 'tiv': 'tivi', 'nd': u'nord\xadndebele', 'ne': 'nepali', 'ng': 'ndonga', 'ny': 'nyanja', 'nap': 'napolitanska', 'grb': 'grebo', 'nr': u'syd\xadndebele', 'tig': u'tigré', 'nv': 'navaho', 'zun': u'zuñi', 'rw': 'rwanda; kinjarwanda'} countries = {'BD': 'Bangladesh', 'BE': 'Belgien', 'BF': 'Burkina Faso', 'BG': 'Bulgarien', 'BA': 'Bosnien och Hercegovina', 'BB': 'Barbados', 'WF': u'Wallis och Futunaöarna', 'BM': 'Bermuda', 'BN': 'Brunei', 'BO': 'Bolivia', 'BH': 'Bahrain', 'BI': 'Burundi', 'BJ': 'Benin', 'BT': 'Bhutan', 'JM': 'Jamaica', 'BV': u'Bouvetön', 'BW': 'Botswana', 'WS': 'Samoa', 'BR': 'Brasilien', 'BS': 'Bahamas', 'BY': 'Vitryssland', 'BZ': 'Belize', 'RU': 'Ryssland', 'RW': 'Rwanda', 'TL': u'Östtimor', 'RE': u'Réunion', 'TM': 'Turkmenistan', 'TJ': 'Tadzjikistan', 'RO': u'Rumänien', 'TK': u'Tokelauöarna', 'GW': 'Guinea-Bissau', 'GU': 'Guam', 'GT': 'Guatemala', 'GS': u'Sydgeorgien och Södra Sandwichöarna', 'GR': 'Grekland', 'GQ': 'Ekvatorialguinea', 'GP': 'Guadelope', 'JP': 'Japan', 'GY': 'Guyana', 'GF': 'Franska Guyana', 'GE': 'Georgien', 'GD': 'Grenada', 'GB': 'Storbritannien', 'GA': 'Gabon', 'SV': 'El Salvador', 'GN': 'Guinea', 'GM': 'Gambia', 'GL': u'Grönland', 'GI': 'Gibraltar', 'GH': 'Ghana', 'OM': 'Oman', 'TN': 'Tunisien', 'JO': 'Jordanien', 'SP': 'Serbia', 'HR': 'Kroatien', 'HT': 'Haiti', 'HU': 'Ungern', 'HK': 'Hongkong (Kina)', 'HN': 'Honduras', 'HM': u'Heard- och McDonaldöarna', 'VE': 'Venezuela', 'PR': 'Puerto Rico', 'PS': 'Palestinska territoriet', 'PW': 'Palau', 'PT': 'Portugal', 'SJ': 'Svalbard och Jan Mayen', 'PY': 'Paraguay', 'IQ': 'Irak', 'PA': 'Panama', 'PF': 'Franska Polynesien', 'PG': 'Papua Nya Guinea', 'PE': 'Peru', 'PK': 'Pakistan', 'PH': 'Filippinerna', 'PN': 'Pitcairn', 'PL': 'Polen', 'PM': 'S:t Pierre och Miquelon', 'ZM': 'Zambia', 'EH': u'Västra Sahara', 'EE': 'Estland', 'EG': 'Egypten', 'ZA': 'Sydafrika', 'EC': 'Ecuador', 'IT': 'Italien', 'VN': 'Vietnam', 'SB': u'Salomonöarna', 'ET': 'Etiopien', 'SO': 'Somalia', 'ZW': 'Zimbabwe', 'SA': 'Saudi-Arabien', 'ES': 'Spanien', 'ER': 'Eritrea', 'MD': 'Moldavien', 'MG': 'Madagaskar', 'MA': 'Marocko', 'MC': 'Monaco', 'UZ': 'Uzbekistan', 'MM': 'Myanmar', 'ML': 'Mali', 'MO': 'Macao S.A.R. China', 'MN': 'Mongoliet', 'MH': u'Marshallöarna', 'MK': 'Makedonien', 'MU': 'Mauritius', 'MT': 'Malta', 'MW': 'Malawi', 'MV': 'Maldiverna', 'MQ': 'Martinique', 'MP': 'Nordmarianerna', 'MS': 'Montserrat', 'MR': 'Mauretanien', 'UG': 'Uganda', 'MY': 'Malaysia', 'MX': 'Mexiko', 'IL': 'Israel', 'FR': 'Frankrike', 'IO': u'Brittiska Indiska oceanöarna', 'SH': 'S:t Helena', 'FI': 'Finland', 'FJ': 'Fiji', 'FK': u'Falklandsöarna', 'FM': 'Mikronesien', 'FO': u'Färöarna', 'NI': 'Nicaragua', 'NL': u'Nederländerna', 'NO': 'Norge', 'NA': 'Namibia', 'VU': 'Vanuatu', 'NC': 'Nya Kaledonien', 'NE': 'Niger', 'NF': u'Norfolkön', 'NG': 'Nigeria', 'NZ': 'Nya Zeeland', 'NP': 'Nepal', 'NR': 'Nauru', 'NU': u'Niueön', 'CK': u'Cooköarna', 'CI': 'Elfenbenskusten', 'CH': 'Schweiz', 'CO': 'Colombia', 'CN': 'Kina', 'CM': 'Kamerun', 'CL': 'Chile', 'CC': u'Kokosöarna (Keelingöarna)', 'CA': 'Kanada', 'CG': 'Kongo', 'CF': 'Centralafrikanska republiken', 'CD': 'Demokratiska republiken Kongo', 'CZ': 'Tjeckien', 'CY': 'Cypern', 'CX': u'Julön', 'CR': 'Costa Rica', 'Fallback': 'en', 'CV': 'Kap Verde', 'CU': 'Kuba', 'SZ': 'Swaziland', 'SY': 'Syrien', 'KG': 'Kirgisistan', 'KE': 'Kenya', 'SR': 'Surinam', 'KI': 'Kiribati', 'KH': 'Kambodja', 'KN': 'S:t Christopher och Nevis', 'KM': 'Komorerna', 'ST': u'São Tomé och Príncipe', 'SK': 'Slovakien', 'KR': 'Sydkorea', 'SI': 'Slovenien', 'KP': 'Nordkorea', 'KW': 'Kuwait', 'SN': 'Senegal', 'SM': 'San Marino', 'SL': 'Sierra Leone', 'SC': 'Seychellerna', 'KZ': 'Kazachstan', 'KY': u'Kajmanöarna', 'SG': 'Singapore', 'SE': 'Sverige', 'SD': 'Sudan', 'DO': 'Dominikanska republiken', 'DM': 'Dominica', 'DJ': 'Djibouti', 'DK': 'Danmark', 'VG': u'Brittiska Jungfruöarna', 'DE': 'Tyskland', 'YE': 'Jemen', 'DZ': 'Algeriet', 'US': u'Amerikas Förenta Stater', 'UY': 'Uruguay', 'YU': 'Jugoslavien', 'YT': 'Mayotte', 'UM': u'Små, avlägset belägna öar som tillhör Förenta staterna', 'LB': 'Libanon', 'LC': 'S:t Lucia', 'LA': 'Laos', 'TV': 'Tuvalu', 'TW': 'Taiwan', 'TT': 'Trinidad och Tobago', 'TR': 'Turkiet', 'LK': 'Sri Lanka', 'LI': 'Liechtenstein', 'LV': 'Lettland', 'TO': 'Tonga', 'LT': 'Litauen', 'LU': 'Luxemburg', 'LR': 'Liberia', 'LS': 'Lesotho', 'TH': 'Thailand', 'TF': 'Franska Sydterritorierna', 'TG': 'Togo', 'TD': 'Tchad', 'TC': u'Turks- och Caicosöarna', 'LY': 'Libyen', 'VA': 'Vatikanstaten', 'VC': 'S:t Vincent och Grenadinerna', 'AE': u'Förenade Arabemiraten', 'AD': 'Andorra', 'AG': 'Antigua och Barbuda', 'AF': 'Afganistan', 'AI': 'Anguilla', 'VI': u'Amerikanska Jungfruöarna', 'IS': 'Island', 'IR': 'Iran', 'AM': 'Armenien', 'AL': 'Albanien', 'AO': 'Angola', 'AN': u'Nederländska Antillerna', 'AQ': 'Antarktis', 'AS': 'Amerikanska Samoa', 'AR': 'Argentina', 'AU': 'Australien', 'AT': u'Österrike', 'AW': 'Aruba', 'IN': 'Indien', 'TZ': 'Tanzania', 'AZ': 'Azerbajdzjan', 'IE': 'Irland', 'ID': 'Indonesien', 'UA': 'Ukraina', 'QA': 'Qatar', 'MZ': u'Moçambique'} months = ['januari', 'februari', 'mars', 'april', 'maj', 'juni', 'juli', 'augusti', 'september', 'oktober', 'november', 'december'] abbr_months = ['jan', 'feb', 'mar', 'apr', 'maj', 'jun', 'jul', 'aug', 'sep', 'okt', 'nov', 'dec'] days = [u'måndag', 'tisdag', 'onsdag', 'torsdag', 'fredag', u'lördag', u'söndag'] abbr_days = [u'må', 'ti', 'on', 'to', 'fr', u'lö', u'sö'] date_formats = {'medium': '%Y-%m-%d', 'full': 'den %d %%(monthname)s %Y', 'long': 'den %d %%(abbrmonthname)s %Y', 'short': '%Y-%m-%d'} numeric_symbols = {'group': u'\xa0', 'nativeZeroDigit': '0', 'exponential': 'E', 'perMille': u'‰', 'nan': u'�', 'decimal': ',', 'percentSign': '%', 'list': ';', 'patternDigit': '#', 'plusSign': '+', 'infinity': u'∞', 'minusSign': '-'}
N = int(input()) count = 0 for i in range(1, N+1, 2): yakusuu = 0 for j in range(1, i+1, 2): if i % j == 0: yakusuu += 1 if yakusuu == 8: count += 1 print(count)
n = int(input()) count = 0 for i in range(1, N + 1, 2): yakusuu = 0 for j in range(1, i + 1, 2): if i % j == 0: yakusuu += 1 if yakusuu == 8: count += 1 print(count)
class reverse_iter: def __init__(self, elements): self.elements = elements self.start = len(self.elements) - 1 def __iter__(self): return self def __next__(self): if self.start < 0: raise StopIteration index = self.start self.start -= 1 return self.elements[index] reversed_list = reverse_iter([1, 2, 3, 4]) for item in reversed_list: print(item)
class Reverse_Iter: def __init__(self, elements): self.elements = elements self.start = len(self.elements) - 1 def __iter__(self): return self def __next__(self): if self.start < 0: raise StopIteration index = self.start self.start -= 1 return self.elements[index] reversed_list = reverse_iter([1, 2, 3, 4]) for item in reversed_list: print(item)
# syms =['["2_x00"]', '["2_0y0"]', '["2_00z"]', # '["2_xx0"]', '["2_x0x"]', '["2_0yy"]', # '["2_xmx0"]', '["2_mx0x"]', '["2_0myy"]', # # '["3_xxx"]', '["3_xmxmx"]', # '["3_mxxmx"]', '["3_mxmxx"]', # # '["m3_xxx"]', '["m3_xmxmx"]', # '["m3_mxxmx"]', '["m3_mxmxx"]', # # '["4_x00"]', '["4_0y0"]', '["4_00z"]', # # '["-4_x00"]', '["-4_0y0"]', '["-4_00z"]'] syms_hex = [ '["i_000"]', '["hex_m_x2xz"]', '["hex_m_2xxz"]', '["hex_m_x0z"]', '["hex_m_0yz"]', '["hex_2_x00"]', '["hex_2_0y0"]', '["hex_2_x2x0"]', '["hex_2_2xx0"]', '["3_00z"]', '["m3_00z"]', '["6_00z"]', '["m6_00z"]', ] text = \ '''import matrices_new_extended as mne import numpy as np import sympy as sp from equality_check import Point x, y, z = sp.symbols("x y z") Point.unchanged = np.array([ x, y, z, 1]) class Test_Axis_''' inner = ''' def test_matrix_{0}(self): expected = Point([ x, y, z, 1]) calculated = Point.calculate(mne._matrix_{0}) assert calculated == expected ''' inner_test = \ ''' def test{0}(self): expected = Point([ x, y, z, 1]) calculated = Point.calculate(mne.{0}) assert calculated == expected #{1}''' for sym in syms_hex: name = sym.strip('["]') new_file = f"test_matrices_like_{name}.py" # proba = f"test.py" with open(new_file, "w") as write_file: write_file.write(text+name+":\n") write_file.write(inner.format(name)) with open("../matrices_new_extended_hexx.py") as read_file: for line in read_file: if sym in line: separator = f" = matrices_dict_hex{sym}" matrix, slide = line.split(separator) write_file.write(inner_test.format(matrix, slide.replace("+", "")))
syms_hex = ['["i_000"]', '["hex_m_x2xz"]', '["hex_m_2xxz"]', '["hex_m_x0z"]', '["hex_m_0yz"]', '["hex_2_x00"]', '["hex_2_0y0"]', '["hex_2_x2x0"]', '["hex_2_2xx0"]', '["3_00z"]', '["m3_00z"]', '["6_00z"]', '["m6_00z"]'] text = 'import matrices_new_extended as mne\nimport numpy as np\nimport sympy as sp\nfrom equality_check import Point\n\nx, y, z = sp.symbols("x y z")\nPoint.unchanged = np.array([ x, y, z, 1])\n\n\nclass Test_Axis_' inner = '\n def test_matrix_{0}(self):\n expected = Point([ x, y, z, 1])\n calculated = Point.calculate(mne._matrix_{0})\n assert calculated == expected\n' inner_test = '\n def test{0}(self):\n expected = Point([ x, y, z, 1])\n calculated = Point.calculate(mne.{0})\n assert calculated == expected\n #{1}' for sym in syms_hex: name = sym.strip('["]') new_file = f'test_matrices_like_{name}.py' with open(new_file, 'w') as write_file: write_file.write(text + name + ':\n') write_file.write(inner.format(name)) with open('../matrices_new_extended_hexx.py') as read_file: for line in read_file: if sym in line: separator = f' = matrices_dict_hex{sym}' (matrix, slide) = line.split(separator) write_file.write(inner_test.format(matrix, slide.replace('+', '')))
class NetstorageError(Exception): def __init__(self, response, *args, **kwargs): super(NetstorageError, self).__init__(response) self.msg = kwargs.get('message') class NotFoundError(NetstorageError): def __init__(self, response, *args, **kwargs): message = ('Can occur if the targeted object can not be found in the ' 'specified path. Check the path provided and try again') super(NotFoundError, self).__init__(response, message=message) class BadRequestError(NetstorageError): pass class UnauthorizedError(NetstorageError): pass class ForbiddenError(NetstorageError): def __init__(self, response): message = ('The Akamai Edge server has denied access to the call. ' 'Please verify that the call is properly formatted ' 'and retry') super(ForbiddenError, self).__init__(response, message=message) class NotAcceptableError(NetstorageError): pass class ConflictError(NetstorageError): pass class PreconditionFailedError(NetstorageError): pass class UnprocessableEntityError(NetstorageError): pass class LockedError(NetstorageError): pass class InternalServerError(NetstorageError): pass class NotImplementedError(NetstorageError): pass class ClientError(NetstorageError): pass class ServerError(NetstorageError): pass error_classes = { 400: BadRequestError, 401: UnauthorizedError, 403: ForbiddenError, 404: NotFoundError, 406: NotAcceptableError, 409: ConflictError, 412: PreconditionFailedError, 422: UnprocessableEntityError, 423: LockedError, 500: InternalServerError, 501: NotImplementedError } def raise_exception_for(response): error_class = error_classes.get(response.status_code) if error_class is None: if 400 <= response.status_code <= 500: error_class = ClientError if 500 <= response.status_code <= 600: error_class = ServerError return error_class(response)
class Netstorageerror(Exception): def __init__(self, response, *args, **kwargs): super(NetstorageError, self).__init__(response) self.msg = kwargs.get('message') class Notfounderror(NetstorageError): def __init__(self, response, *args, **kwargs): message = 'Can occur if the targeted object can not be found in the specified path. Check the path provided and try again' super(NotFoundError, self).__init__(response, message=message) class Badrequesterror(NetstorageError): pass class Unauthorizederror(NetstorageError): pass class Forbiddenerror(NetstorageError): def __init__(self, response): message = 'The Akamai Edge server has denied access to the call. Please verify that the call is properly formatted and retry' super(ForbiddenError, self).__init__(response, message=message) class Notacceptableerror(NetstorageError): pass class Conflicterror(NetstorageError): pass class Preconditionfailederror(NetstorageError): pass class Unprocessableentityerror(NetstorageError): pass class Lockederror(NetstorageError): pass class Internalservererror(NetstorageError): pass class Notimplementederror(NetstorageError): pass class Clienterror(NetstorageError): pass class Servererror(NetstorageError): pass error_classes = {400: BadRequestError, 401: UnauthorizedError, 403: ForbiddenError, 404: NotFoundError, 406: NotAcceptableError, 409: ConflictError, 412: PreconditionFailedError, 422: UnprocessableEntityError, 423: LockedError, 500: InternalServerError, 501: NotImplementedError} def raise_exception_for(response): error_class = error_classes.get(response.status_code) if error_class is None: if 400 <= response.status_code <= 500: error_class = ClientError if 500 <= response.status_code <= 600: error_class = ServerError return error_class(response)
# numbers to letters small = ['zero','one','two','three','four','five','six','seven','eight','nine','ten','eleven','twelve','thirteen','fourteen','fifteen','sixteen','seventeen','eighteen','nineteen'] tens = ['mistake0','mistake1','twenty','thirty','forty','fifty','sixty','seventy','eighty','ninety'] # simple algorithm that take a number less than a billing and converts it into a str def convert(n): if n < 20: return small[n] elif n < 100: if n % 10 == 0: return tens[n//10] else: return tens[n//10] + '-' + small[n%10] elif n < 1000: if n % 100 == 0: return convert(n//100) + ' hundred' else: return convert(n//100)+' hundred and '+convert(n%100) elif n < 10**6: if n % 1000 == 0: return convert(n//1000)+' thousand' else: return convert(n//1000)+' thousand '+convert(n%1000) else: if n % 10**6 == 0: return convert(n//10**6)+' million ' else: return convert(n//10**6)+' million '+convert(n%10**6)
small = ['zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight', 'nine', 'ten', 'eleven', 'twelve', 'thirteen', 'fourteen', 'fifteen', 'sixteen', 'seventeen', 'eighteen', 'nineteen'] tens = ['mistake0', 'mistake1', 'twenty', 'thirty', 'forty', 'fifty', 'sixty', 'seventy', 'eighty', 'ninety'] def convert(n): if n < 20: return small[n] elif n < 100: if n % 10 == 0: return tens[n // 10] else: return tens[n // 10] + '-' + small[n % 10] elif n < 1000: if n % 100 == 0: return convert(n // 100) + ' hundred' else: return convert(n // 100) + ' hundred and ' + convert(n % 100) elif n < 10 ** 6: if n % 1000 == 0: return convert(n // 1000) + ' thousand' else: return convert(n // 1000) + ' thousand ' + convert(n % 1000) elif n % 10 ** 6 == 0: return convert(n // 10 ** 6) + ' million ' else: return convert(n // 10 ** 6) + ' million ' + convert(n % 10 ** 6)
ALPHABET = 'abcdefghijklmnopqrstuvwxyz' def increment(word: str) -> str: last_index = len(word) - 1 if word[last_index] != 'z': return word[:last_index] + ALPHABET[ALPHABET.find(word[last_index]) + 1] elif len(word) == 1: return "aa" else: return increment(word[:last_index]) + 'a' def noBadLetters(password: str) -> bool: badLetters = ['i','o','l'] for letter in badLetters: if letter in password: return False return True def overlaps(password: str) -> bool: for idx1 in range(len(password) - 1): if password[idx1] == password[idx1+1] and len(password[idx1+2:]) >= 2: # Loop found a pair, now look for a different pair in the remaining part of the string for idx2 in range(idx1+2, len(password) - 1): if password[idx2] == password[idx2+1] and password[idx2] != password[idx1]: return True return False def straight3(password: str) -> bool: if len(password) < 2: return False for idx in range(len(password) - 2): start = password[idx] mid = password[idx + 1] end = password[idx + 2] if ALPHABET.find(start) + 2 == ALPHABET.find(mid) + 1 == ALPHABET.find(end): return True return False def passes(password: str) -> bool: return noBadLetters(password) and overlaps(password) and straight3(password) def part1(password: str) -> str: password = increment(password) while not passes(password): password = increment(password) return password def part2(password: str) -> str: return part1(part1(password)) if __name__ == "__main__": with open("../input.txt") as file: lines = [line.strip() for line in file] print(part1("vzbxkghb")) print(part2("vzbxkghb"))
alphabet = 'abcdefghijklmnopqrstuvwxyz' def increment(word: str) -> str: last_index = len(word) - 1 if word[last_index] != 'z': return word[:last_index] + ALPHABET[ALPHABET.find(word[last_index]) + 1] elif len(word) == 1: return 'aa' else: return increment(word[:last_index]) + 'a' def no_bad_letters(password: str) -> bool: bad_letters = ['i', 'o', 'l'] for letter in badLetters: if letter in password: return False return True def overlaps(password: str) -> bool: for idx1 in range(len(password) - 1): if password[idx1] == password[idx1 + 1] and len(password[idx1 + 2:]) >= 2: for idx2 in range(idx1 + 2, len(password) - 1): if password[idx2] == password[idx2 + 1] and password[idx2] != password[idx1]: return True return False def straight3(password: str) -> bool: if len(password) < 2: return False for idx in range(len(password) - 2): start = password[idx] mid = password[idx + 1] end = password[idx + 2] if ALPHABET.find(start) + 2 == ALPHABET.find(mid) + 1 == ALPHABET.find(end): return True return False def passes(password: str) -> bool: return no_bad_letters(password) and overlaps(password) and straight3(password) def part1(password: str) -> str: password = increment(password) while not passes(password): password = increment(password) return password def part2(password: str) -> str: return part1(part1(password)) if __name__ == '__main__': with open('../input.txt') as file: lines = [line.strip() for line in file] print(part1('vzbxkghb')) print(part2('vzbxkghb'))
DB_CONFIG_DEV = {'host': 'host', 'usuario':'usr_pesquisabr', 'senha':'senhapesquisabr', 'database': 'pesquisabr' } DB_CONFIG_PROD = {'host': 'host', 'usuario':'usr_pesquisabr', 'senha':'senhapesquisabr', 'database': 'pesquisabr' }
db_config_dev = {'host': 'host', 'usuario': 'usr_pesquisabr', 'senha': 'senhapesquisabr', 'database': 'pesquisabr'} db_config_prod = {'host': 'host', 'usuario': 'usr_pesquisabr', 'senha': 'senhapesquisabr', 'database': 'pesquisabr'}
def diag_diff(matr): sum1 = 0 sum2 = 0 length = len(matr[0]) for i in range(length): for j in range(length): if i == j: sum1 = sum1 + matr[i][j] if i == length - j - 1: sum2 = sum2 + matr[i][j] return sum1 - sum2
def diag_diff(matr): sum1 = 0 sum2 = 0 length = len(matr[0]) for i in range(length): for j in range(length): if i == j: sum1 = sum1 + matr[i][j] if i == length - j - 1: sum2 = sum2 + matr[i][j] return sum1 - sum2
# # PySNMP MIB module HH3C-DOT11-RRM-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/HH3C-DOT11-RRM-MIB # Produced by pysmi-0.3.4 at Wed May 1 13:26:18 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") ValueSizeConstraint, ConstraintsUnion, SingleValueConstraint, ValueRangeConstraint, ConstraintsIntersection = mibBuilder.importSymbols("ASN1-REFINEMENT", "ValueSizeConstraint", "ConstraintsUnion", "SingleValueConstraint", "ValueRangeConstraint", "ConstraintsIntersection") Hh3cDot11RadioScopeType, hh3cDot11APElementIndex, Hh3cDot11ObjectIDType, Hh3cDot11ChannelScopeType, hh3cDot11, Hh3cDot11SSIDStringType, Hh3cDot11RadioElementIndex, Hh3cDot11RadioType = mibBuilder.importSymbols("HH3C-DOT11-REF-MIB", "Hh3cDot11RadioScopeType", "hh3cDot11APElementIndex", "Hh3cDot11ObjectIDType", "Hh3cDot11ChannelScopeType", "hh3cDot11", "Hh3cDot11SSIDStringType", "Hh3cDot11RadioElementIndex", "Hh3cDot11RadioType") NotificationGroup, ModuleCompliance = mibBuilder.importSymbols("SNMPv2-CONF", "NotificationGroup", "ModuleCompliance") MibScalar, MibTable, MibTableRow, MibTableColumn, TimeTicks, IpAddress, Bits, Unsigned32, Gauge32, Integer32, Counter64, iso, NotificationType, ObjectIdentity, MibIdentifier, Counter32, ModuleIdentity = mibBuilder.importSymbols("SNMPv2-SMI", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "TimeTicks", "IpAddress", "Bits", "Unsigned32", "Gauge32", "Integer32", "Counter64", "iso", "NotificationType", "ObjectIdentity", "MibIdentifier", "Counter32", "ModuleIdentity") RowStatus, MacAddress, TextualConvention, TruthValue, DisplayString, DateAndTime = mibBuilder.importSymbols("SNMPv2-TC", "RowStatus", "MacAddress", "TextualConvention", "TruthValue", "DisplayString", "DateAndTime") hh3cDot11RRM = ModuleIdentity((1, 3, 6, 1, 4, 1, 25506, 2, 75, 8)) hh3cDot11RRM.setRevisions(('2010-09-25 18:00', '2010-02-23 18:00', '2009-08-01 20:00', '2009-05-07 20:00', '2009-04-17 20:00', '2008-07-14 14:29',)) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): if mibBuilder.loadTexts: hh3cDot11RRM.setRevisionsDescriptions(('Modified to add new nodes.', 'Modified to add new nodes.', 'Modified to add new nodes and new table.', 'Modified to add new nodes and new table.', 'Modified to add new table and new group.', 'The initial revision of this MIB module.',)) if mibBuilder.loadTexts: hh3cDot11RRM.setLastUpdated('201009251800Z') if mibBuilder.loadTexts: hh3cDot11RRM.setOrganization('Hangzhou H3C Technologies Co., Ltd.') if mibBuilder.loadTexts: hh3cDot11RRM.setContactInfo('Platform Team H3C Technologies Co., Ltd. Hai-Dian District Beijing P.R.China Http://www.h3c.com Zip: 100085') if mibBuilder.loadTexts: hh3cDot11RRM.setDescription('This MIB file is to provide the object definition of WLAN radio resource management (RRM).') hh3cDot11RRMConfigGroup = MibIdentifier((1, 3, 6, 1, 4, 1, 25506, 2, 75, 8, 1)) hh3cDot11RRMGlobalCfgPara = MibIdentifier((1, 3, 6, 1, 4, 1, 25506, 2, 75, 8, 1, 1)) hh3cDot11RRM11nMadtMaxMcs = MibScalar((1, 3, 6, 1, 4, 1, 25506, 2, 75, 8, 1, 1, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(ValueRangeConstraint(0, 76), ValueRangeConstraint(255, 255), )).clone(255)).setMaxAccess("readwrite") if mibBuilder.loadTexts: hh3cDot11RRM11nMadtMaxMcs.setStatus('current') if mibBuilder.loadTexts: hh3cDot11RRM11nMadtMaxMcs.setDescription('Specify the maximum modulation and coding scheme (MCS) index for 802.11n mandatory rates. The value 255 indicates that no maximum MCS index is specified. No maximum MCS index is specified for 802.11n mandatory rates by default. Besides 255, the specified maximum MCS index for 802.11n supported rates must be no less than the specified maximum MCS index for 802.11n mandatory rates.') hh3cDot11RRM11nSuptMaxMcs = MibScalar((1, 3, 6, 1, 4, 1, 25506, 2, 75, 8, 1, 1, 2), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 76)).clone(76)).setMaxAccess("readwrite") if mibBuilder.loadTexts: hh3cDot11RRM11nSuptMaxMcs.setStatus('current') if mibBuilder.loadTexts: hh3cDot11RRM11nSuptMaxMcs.setDescription('Specify the maximum Modulation and Coding Scheme (MCS) index for 802.11n supported rates. The specified maximum MCS index for 802.11n supported rates must be no less than the specified maximum MCS index for 802.11n mandatory rates.') hh3cDot11RRM11gProtect = MibScalar((1, 3, 6, 1, 4, 1, 25506, 2, 75, 8, 1, 1, 3), TruthValue().clone('false')).setMaxAccess("readwrite") if mibBuilder.loadTexts: hh3cDot11RRM11gProtect.setStatus('current') if mibBuilder.loadTexts: hh3cDot11RRM11gProtect.setDescription('Enable/Disable dot11g protection.') hh3cDot11RRM11aPwrConstrt = MibScalar((1, 3, 6, 1, 4, 1, 25506, 2, 75, 8, 1, 1, 4), Integer32()).setUnits('dBm').setMaxAccess("readwrite") if mibBuilder.loadTexts: hh3cDot11RRM11aPwrConstrt.setStatus('current') if mibBuilder.loadTexts: hh3cDot11RRM11aPwrConstrt.setDescription('Configure the power constraint for all 802.11a radios. The configured power constraint is advertised in beacons if spectrum management is enabled. The range of power constraint is 0 to MAX-POWER-1 (where the MAX-POWER is defined by the regulatory domain).') hh3cDot11RRM11aSpectrumManag = MibScalar((1, 3, 6, 1, 4, 1, 25506, 2, 75, 8, 1, 1, 5), TruthValue().clone('false')).setMaxAccess("readwrite") if mibBuilder.loadTexts: hh3cDot11RRM11aSpectrumManag.setStatus('current') if mibBuilder.loadTexts: hh3cDot11RRM11aSpectrumManag.setDescription('Enable/Disable spectrum management for 802.11a radios. When spectrum management is enabled, the WLAN sub-system advertises power capabilities of the AP and power constraints applicable to all devices in the BSS based on regulatory domain specification.') hh3cDot11RRMAutoChlAvoid11h = MibScalar((1, 3, 6, 1, 4, 1, 25506, 2, 75, 8, 1, 1, 6), TruthValue().clone('false')).setMaxAccess("readwrite") if mibBuilder.loadTexts: hh3cDot11RRMAutoChlAvoid11h.setStatus('current') if mibBuilder.loadTexts: hh3cDot11RRMAutoChlAvoid11h.setDescription('Configure the auto-channel set as non-dot11h channels, this is, only the non-dot11h channels belonging to the country code are scanned during initial channel selection and one of them is selected.') hh3cDot11RRMScanChl = MibScalar((1, 3, 6, 1, 4, 1, 25506, 2, 75, 8, 1, 1, 7), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("auto", 1), ("all", 2))).clone('auto')).setMaxAccess("readwrite") if mibBuilder.loadTexts: hh3cDot11RRMScanChl.setStatus('current') if mibBuilder.loadTexts: hh3cDot11RRMScanChl.setDescription('Set the scan mode. auto: When this option is set, all channels of the country code being set are scanned. all: When this option is set, all the channels of the radio band are scanned.') hh3cDot11RRMScanRptIntvel = MibScalar((1, 3, 6, 1, 4, 1, 25506, 2, 75, 8, 1, 1, 8), Integer32().subtype(subtypeSpec=ValueRangeConstraint(5, 120)).clone(10)).setUnits('second').setMaxAccess("readwrite") if mibBuilder.loadTexts: hh3cDot11RRMScanRptIntvel.setStatus('current') if mibBuilder.loadTexts: hh3cDot11RRMScanRptIntvel.setDescription('Set the scan report interval.') hh3cDot11APInterfNumThreshhd = MibScalar((1, 3, 6, 1, 4, 1, 25506, 2, 75, 8, 1, 1, 9), Integer32()).setMaxAccess("readwrite") if mibBuilder.loadTexts: hh3cDot11APInterfNumThreshhd.setStatus('current') if mibBuilder.loadTexts: hh3cDot11APInterfNumThreshhd.setDescription('Represents threshold of AP interference . If the value of AP interference exceeds this threshold, AP interference trap will be sent. If the value of this node is zero, AP interference trap will be sent immediately.') hh3cDot11StaInterfNumThreshhd = MibScalar((1, 3, 6, 1, 4, 1, 25506, 2, 75, 8, 1, 1, 10), Integer32()).setMaxAccess("readwrite") if mibBuilder.loadTexts: hh3cDot11StaInterfNumThreshhd.setStatus('current') if mibBuilder.loadTexts: hh3cDot11StaInterfNumThreshhd.setDescription('Represents threshold of STA interference. If the value of STA interference exceeds this threshold, STA interference trap will be sent. If the value of this node is zero, STA interference trap will be sent immediately. ') hh3cDot11RRMRadioCfgTable = MibTable((1, 3, 6, 1, 4, 1, 25506, 2, 75, 8, 1, 2), ) if mibBuilder.loadTexts: hh3cDot11RRMRadioCfgTable.setStatus('current') if mibBuilder.loadTexts: hh3cDot11RRMRadioCfgTable.setDescription('Configure WLAN RRM based radio type. When 802.11b parameter is modified, 802.11g parameter will be changed at the same time. In the same way, when 802.11g parameter is modified, 802.11b parameter will be changed at the same time.') hh3cDot11RRMRadioCfgEntry = MibTableRow((1, 3, 6, 1, 4, 1, 25506, 2, 75, 8, 1, 2, 1), ).setIndexNames((0, "HH3C-DOT11-RRM-MIB", "hh3cDot11RRMRadioType")) if mibBuilder.loadTexts: hh3cDot11RRMRadioCfgEntry.setStatus('current') if mibBuilder.loadTexts: hh3cDot11RRMRadioCfgEntry.setDescription('Configure WLAN RRM based radio type. When 802.11b parameter is modified, 802.11g parameter will be changed at the same time. In the same way, when 802.11g parameter is modified, 802.11b parameter will be changed at the same time.') hh3cDot11RRMRadioType = MibTableColumn((1, 3, 6, 1, 4, 1, 25506, 2, 75, 8, 1, 2, 1, 1), Hh3cDot11RadioType()) if mibBuilder.loadTexts: hh3cDot11RRMRadioType.setStatus('current') if mibBuilder.loadTexts: hh3cDot11RRMRadioType.setDescription('802.11 radio type.') hh3cDot11RRMCfgChlState = MibTableColumn((1, 3, 6, 1, 4, 1, 25506, 2, 75, 8, 1, 2, 1, 2), TruthValue().clone('false')).setMaxAccess("readwrite") if mibBuilder.loadTexts: hh3cDot11RRMCfgChlState.setStatus('current') if mibBuilder.loadTexts: hh3cDot11RRMCfgChlState.setDescription('Enable/Disable dynamic channel selection.') hh3cDot11RRMCfgChlMode = MibTableColumn((1, 3, 6, 1, 4, 1, 25506, 2, 75, 8, 1, 2, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("selfDecisive", 1), ("userTriggered", 2))).clone('userTriggered')).setMaxAccess("readwrite") if mibBuilder.loadTexts: hh3cDot11RRMCfgChlMode.setStatus('current') if mibBuilder.loadTexts: hh3cDot11RRMCfgChlMode.setDescription('Configure the mode of channel selection. This node can be configured only when dynamic channel selection is enabled.') hh3cDot11RRMChlProntoRadioElmt = MibTableColumn((1, 3, 6, 1, 4, 1, 25506, 2, 75, 8, 1, 2, 1, 4), Unsigned32()).setMaxAccess("readwrite") if mibBuilder.loadTexts: hh3cDot11RRMChlProntoRadioElmt.setStatus('current') if mibBuilder.loadTexts: hh3cDot11RRMChlProntoRadioElmt.setDescription('Specify the AP and radio that will change channel at next calibration cycle. 0 is returned when getting the value of this node. This node can be configured only when the mode of channel selection control is user-triggered. When configuring, the higher 24 bits stand for the AP index, and the last 8 bits stand for the radio index. 4294967295 stand for configuring each radio on all APs.') hh3cDot11RRMCfgPwrState = MibTableColumn((1, 3, 6, 1, 4, 1, 25506, 2, 75, 8, 1, 2, 1, 5), TruthValue().clone('false')).setMaxAccess("readwrite") if mibBuilder.loadTexts: hh3cDot11RRMCfgPwrState.setStatus('current') if mibBuilder.loadTexts: hh3cDot11RRMCfgPwrState.setDescription('Enable/Disable dynamic power selection for the band.') hh3cDot11RRMCfgPwrMode = MibTableColumn((1, 3, 6, 1, 4, 1, 25506, 2, 75, 8, 1, 2, 1, 6), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("selfDecisive", 1), ("userTriggered", 2))).clone('userTriggered')).setMaxAccess("readwrite") if mibBuilder.loadTexts: hh3cDot11RRMCfgPwrMode.setStatus('current') if mibBuilder.loadTexts: hh3cDot11RRMCfgPwrMode.setDescription('Configure the mode of transmit power control. This node can be configured only when dynamic power selection is enabled.') hh3cDot11RRMPwrProntoRadioElmt = MibTableColumn((1, 3, 6, 1, 4, 1, 25506, 2, 75, 8, 1, 2, 1, 7), Unsigned32()).setMaxAccess("readwrite") if mibBuilder.loadTexts: hh3cDot11RRMPwrProntoRadioElmt.setStatus('current') if mibBuilder.loadTexts: hh3cDot11RRMPwrProntoRadioElmt.setDescription('Specify the AP and radio that will change power at next calibration cycle. 0 is returned when getting the value of this node. This node can be configured only when the mode of transmit power control is user-triggered. When configuring, the higher 24 bits stand for the AP index, and the last 8 bits stand for the radio index. 4294967295 stand for configuring each radio on all APs.') hh3cDot11RRMCfgIntrvl = MibTableColumn((1, 3, 6, 1, 4, 1, 25506, 2, 75, 8, 1, 2, 1, 8), Integer32().clone(8)).setUnits('minute').setMaxAccess("readwrite") if mibBuilder.loadTexts: hh3cDot11RRMCfgIntrvl.setStatus('current') if mibBuilder.loadTexts: hh3cDot11RRMCfgIntrvl.setDescription('Configure the calibration interval.') hh3cDot11RRMCfgIntrfThres = MibTableColumn((1, 3, 6, 1, 4, 1, 25506, 2, 75, 8, 1, 2, 1, 9), Integer32().subtype(subtypeSpec=ValueRangeConstraint(40, 100)).clone(50)).setUnits('percent').setMaxAccess("readwrite") if mibBuilder.loadTexts: hh3cDot11RRMCfgIntrfThres.setStatus('current') if mibBuilder.loadTexts: hh3cDot11RRMCfgIntrfThres.setDescription('Configure the interface threshold. By default, interference observed on an operating channel is considered during dynamic frequency selection and transmit power control. If the interference percentage on the channel reaches the set threshold, RRM will perform resource adjustment to control the situation.') hh3cDot11RRMCfgNoiseThres = MibTableColumn((1, 3, 6, 1, 4, 1, 25506, 2, 75, 8, 1, 2, 1, 10), Integer32().subtype(subtypeSpec=ValueRangeConstraint(-127, 127)).clone(-70)).setMaxAccess("readwrite") if mibBuilder.loadTexts: hh3cDot11RRMCfgNoiseThres.setStatus('current') if mibBuilder.loadTexts: hh3cDot11RRMCfgNoiseThres.setDescription('Configure the noise threshold.') hh3cDot11RRMCfgPERThres = MibTableColumn((1, 3, 6, 1, 4, 1, 25506, 2, 75, 8, 1, 2, 1, 11), Integer32().subtype(subtypeSpec=ValueRangeConstraint(10, 100)).clone(20)).setUnits('percent').setMaxAccess("readwrite") if mibBuilder.loadTexts: hh3cDot11RRMCfgPERThres.setStatus('current') if mibBuilder.loadTexts: hh3cDot11RRMCfgPERThres.setDescription('Configure the CRC error threshold. If the percentage of CRC errors reaches the threshold, RRM will perform resource adjustment to control the situation.') hh3cDot11RRMCfgToleranceFctr = MibTableColumn((1, 3, 6, 1, 4, 1, 25506, 2, 75, 8, 1, 2, 1, 12), Integer32().subtype(subtypeSpec=ValueRangeConstraint(15, 45)).clone(20)).setUnits('percent').setMaxAccess("readwrite") if mibBuilder.loadTexts: hh3cDot11RRMCfgToleranceFctr.setStatus('current') if mibBuilder.loadTexts: hh3cDot11RRMCfgToleranceFctr.setDescription('Configure the tolerance level. During dynamic frequency selection (DFS), the channel will be changed only if there is a better channel having lesser interference and packet error rate than those specified by the user.') hh3cDot11RRMCfgAdjacencyFctr = MibTableColumn((1, 3, 6, 1, 4, 1, 25506, 2, 75, 8, 1, 2, 1, 13), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 16)).clone(3)).setMaxAccess("readwrite") if mibBuilder.loadTexts: hh3cDot11RRMCfgAdjacencyFctr.setStatus('current') if mibBuilder.loadTexts: hh3cDot11RRMCfgAdjacencyFctr.setDescription('Configure the adjacency factor for the band. If transmit power control (TPC) is configured, power will be adjusted when the nth neighbor is detected. The value n is the adjacency factor.') hh3cDot11RRMAPCfgTable = MibTable((1, 3, 6, 1, 4, 1, 25506, 2, 75, 8, 1, 3), ) if mibBuilder.loadTexts: hh3cDot11RRMAPCfgTable.setStatus('current') if mibBuilder.loadTexts: hh3cDot11RRMAPCfgTable.setDescription('This table defines the RRM parameters for AP.') hh3cDot11RRMAPCfgEntry = MibTableRow((1, 3, 6, 1, 4, 1, 25506, 2, 75, 8, 1, 3, 1), ).setIndexNames((0, "HH3C-DOT11-REF-MIB", "hh3cDot11APElementIndex")) if mibBuilder.loadTexts: hh3cDot11RRMAPCfgEntry.setStatus('current') if mibBuilder.loadTexts: hh3cDot11RRMAPCfgEntry.setDescription('Each entry contains information of RRM parameters for AP.') hh3cDot11RRMAPWorkMode = MibTableColumn((1, 3, 6, 1, 4, 1, 25506, 2, 75, 8, 1, 3, 1, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("normal", 1), ("monitor", 2), ("hybrid", 3)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: hh3cDot11RRMAPWorkMode.setStatus('current') if mibBuilder.loadTexts: hh3cDot11RRMAPWorkMode.setDescription('AP work mode.') hh3cDot11RRMSDRadioGroupTable = MibTable((1, 3, 6, 1, 4, 1, 25506, 2, 75, 8, 1, 4), ) if mibBuilder.loadTexts: hh3cDot11RRMSDRadioGroupTable.setStatus('current') if mibBuilder.loadTexts: hh3cDot11RRMSDRadioGroupTable.setDescription('This table defines RRM self-decisive radio group.') hh3cDot11RRMSDRadioGroupEntry = MibTableRow((1, 3, 6, 1, 4, 1, 25506, 2, 75, 8, 1, 4, 1), ).setIndexNames((0, "HH3C-DOT11-RRM-MIB", "hh3cDot11RRMSDRadioGroupId")) if mibBuilder.loadTexts: hh3cDot11RRMSDRadioGroupEntry.setStatus('current') if mibBuilder.loadTexts: hh3cDot11RRMSDRadioGroupEntry.setDescription('Each entry contains information of one RRM self-decisive radio group.') hh3cDot11RRMSDRadioGroupId = MibTableColumn((1, 3, 6, 1, 4, 1, 25506, 2, 75, 8, 1, 4, 1, 1), Unsigned32()) if mibBuilder.loadTexts: hh3cDot11RRMSDRadioGroupId.setStatus('current') if mibBuilder.loadTexts: hh3cDot11RRMSDRadioGroupId.setDescription('Represents RRM self-decisive radio group ID.') hh3cDot11RRMSDRadioGroupDesc = MibTableColumn((1, 3, 6, 1, 4, 1, 25506, 2, 75, 8, 1, 4, 1, 2), OctetString()).setMaxAccess("readcreate") if mibBuilder.loadTexts: hh3cDot11RRMSDRadioGroupDesc.setStatus('current') if mibBuilder.loadTexts: hh3cDot11RRMSDRadioGroupDesc.setDescription('Represents the description of RRM self-decisive radio group.') hh3cDot11RRMSDRdGrpChlHolddownTm = MibTableColumn((1, 3, 6, 1, 4, 1, 25506, 2, 75, 8, 1, 4, 1, 3), Unsigned32()).setUnits('minute').setMaxAccess("readcreate") if mibBuilder.loadTexts: hh3cDot11RRMSDRdGrpChlHolddownTm.setStatus('current') if mibBuilder.loadTexts: hh3cDot11RRMSDRdGrpChlHolddownTm.setDescription('Represents the channel holddown time of RRM self-decisive radio group.') hh3cDot11RRMSDRdGrpPwrHolddownTm = MibTableColumn((1, 3, 6, 1, 4, 1, 25506, 2, 75, 8, 1, 4, 1, 4), Unsigned32()).setUnits('minute').setMaxAccess("readcreate") if mibBuilder.loadTexts: hh3cDot11RRMSDRdGrpPwrHolddownTm.setStatus('current') if mibBuilder.loadTexts: hh3cDot11RRMSDRdGrpPwrHolddownTm.setDescription('Represents the power holddown time of RRM self-decisive radio group.') hh3cDot11RRMSDRdGroupRowStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 25506, 2, 75, 8, 1, 4, 1, 5), RowStatus()).setMaxAccess("readcreate") if mibBuilder.loadTexts: hh3cDot11RRMSDRdGroupRowStatus.setStatus('current') if mibBuilder.loadTexts: hh3cDot11RRMSDRdGroupRowStatus.setDescription('The row status of this table entry.') hh3cDot11RRMAPCfg2Table = MibTable((1, 3, 6, 1, 4, 1, 25506, 2, 75, 8, 1, 5), ) if mibBuilder.loadTexts: hh3cDot11RRMAPCfg2Table.setStatus('current') if mibBuilder.loadTexts: hh3cDot11RRMAPCfg2Table.setDescription('This table defines the RRM parameters for AP.') hh3cDot11RRMAPCfg2Entry = MibTableRow((1, 3, 6, 1, 4, 1, 25506, 2, 75, 8, 1, 5, 1), ).setIndexNames((0, "HH3C-DOT11-RRM-MIB", "hh3cDot11RRMAPSerialID")) if mibBuilder.loadTexts: hh3cDot11RRMAPCfg2Entry.setStatus('current') if mibBuilder.loadTexts: hh3cDot11RRMAPCfg2Entry.setDescription('Each entry contains information of RRM parameters for AP.') hh3cDot11RRMAPSerialID = MibTableColumn((1, 3, 6, 1, 4, 1, 25506, 2, 75, 8, 1, 5, 1, 1), Hh3cDot11ObjectIDType()) if mibBuilder.loadTexts: hh3cDot11RRMAPSerialID.setStatus('current') if mibBuilder.loadTexts: hh3cDot11RRMAPSerialID.setDescription('Serial ID of the AP.') hh3cDot11RRMAPIntfThreshold = MibTableColumn((1, 3, 6, 1, 4, 1, 25506, 2, 75, 8, 1, 5, 1, 2), Integer32()).setMaxAccess("readwrite") if mibBuilder.loadTexts: hh3cDot11RRMAPIntfThreshold.setStatus('current') if mibBuilder.loadTexts: hh3cDot11RRMAPIntfThreshold.setDescription('Represents threshold of AP interference . If the number of AP interference exceeds this threshold, AP interference trap will be sent.') hh3cDot11RRMStaIntfThreshold = MibTableColumn((1, 3, 6, 1, 4, 1, 25506, 2, 75, 8, 1, 5, 1, 3), Integer32()).setMaxAccess("readwrite") if mibBuilder.loadTexts: hh3cDot11RRMStaIntfThreshold.setStatus('current') if mibBuilder.loadTexts: hh3cDot11RRMStaIntfThreshold.setDescription('Represents threshold of STA interference. If the number of STA interference exceeds this threshold, station interference trap will be sent.') hh3cDot11RRMCoChlIntfTrapThhd = MibTableColumn((1, 3, 6, 1, 4, 1, 25506, 2, 75, 8, 1, 5, 1, 4), Integer32()).setUnits('dbm').setMaxAccess("readwrite") if mibBuilder.loadTexts: hh3cDot11RRMCoChlIntfTrapThhd.setStatus('current') if mibBuilder.loadTexts: hh3cDot11RRMCoChlIntfTrapThhd.setDescription('Represents threshold of interference trap with current ap. If signal strength of the device exceeds this threshold, corresponding trap will be sent.') hh3cDot11RRMAdjChlIntfTrapThhd = MibTableColumn((1, 3, 6, 1, 4, 1, 25506, 2, 75, 8, 1, 5, 1, 5), Integer32()).setUnits('dbm').setMaxAccess("readwrite") if mibBuilder.loadTexts: hh3cDot11RRMAdjChlIntfTrapThhd.setStatus('current') if mibBuilder.loadTexts: hh3cDot11RRMAdjChlIntfTrapThhd.setDescription('Represents threshold of adjacent interference trap with current ap. If signal strength of the device exceeds this threshold, corresponding trap will be sent.') hh3cDot11RRMDetectGroup = MibIdentifier((1, 3, 6, 1, 4, 1, 25506, 2, 75, 8, 2)) hh3cDot11RRMChlRptTable = MibTable((1, 3, 6, 1, 4, 1, 25506, 2, 75, 8, 2, 1), ) if mibBuilder.loadTexts: hh3cDot11RRMChlRptTable.setStatus('current') if mibBuilder.loadTexts: hh3cDot11RRMChlRptTable.setDescription('This table shows the RRM channel information of each radio on all APs.') hh3cDot11RRMChlRptEntry = MibTableRow((1, 3, 6, 1, 4, 1, 25506, 2, 75, 8, 2, 1, 1), ).setIndexNames((0, "HH3C-DOT11-RRM-MIB", "hh3cDot11RRMRadioIndex"), (0, "HH3C-DOT11-RRM-MIB", "hh3cDot11RRMChlRptChlNum")) if mibBuilder.loadTexts: hh3cDot11RRMChlRptEntry.setStatus('current') if mibBuilder.loadTexts: hh3cDot11RRMChlRptEntry.setDescription('Each entry contains information of RRM channel information of the radio on the AP.') hh3cDot11RRMRadioIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 25506, 2, 75, 8, 2, 1, 1, 1), Hh3cDot11RadioElementIndex()).setMaxAccess("accessiblefornotify") if mibBuilder.loadTexts: hh3cDot11RRMRadioIndex.setStatus('current') if mibBuilder.loadTexts: hh3cDot11RRMRadioIndex.setDescription('Represents index of the radio.') hh3cDot11RRMChlRptChlNum = MibTableColumn((1, 3, 6, 1, 4, 1, 25506, 2, 75, 8, 2, 1, 1, 2), Integer32()).setMaxAccess("accessiblefornotify") if mibBuilder.loadTexts: hh3cDot11RRMChlRptChlNum.setStatus('current') if mibBuilder.loadTexts: hh3cDot11RRMChlRptChlNum.setDescription('Channel number.') hh3cDot11RRMChlRptChlType = MibTableColumn((1, 3, 6, 1, 4, 1, 25506, 2, 75, 8, 2, 1, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("primeChannel", 1), ("offChannel", 2)))).setMaxAccess("readonly") if mibBuilder.loadTexts: hh3cDot11RRMChlRptChlType.setStatus('current') if mibBuilder.loadTexts: hh3cDot11RRMChlRptChlType.setDescription('Channel type.') hh3cDot11RRMChlRptChlQlty = MibTableColumn((1, 3, 6, 1, 4, 1, 25506, 2, 75, 8, 2, 1, 1, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("good", 1), ("bad", 2)))).setMaxAccess("readonly") if mibBuilder.loadTexts: hh3cDot11RRMChlRptChlQlty.setStatus('current') if mibBuilder.loadTexts: hh3cDot11RRMChlRptChlQlty.setDescription('Channel quality.') hh3cDot11RRMChlRptNbrCnt = MibTableColumn((1, 3, 6, 1, 4, 1, 25506, 2, 75, 8, 2, 1, 1, 5), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: hh3cDot11RRMChlRptNbrCnt.setStatus('current') if mibBuilder.loadTexts: hh3cDot11RRMChlRptNbrCnt.setDescription('Number of neighbors found on the channel.') hh3cDot11RRMChlRptLoad = MibTableColumn((1, 3, 6, 1, 4, 1, 25506, 2, 75, 8, 2, 1, 1, 6), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 100))).setUnits('percent').setMaxAccess("readonly") if mibBuilder.loadTexts: hh3cDot11RRMChlRptLoad.setStatus('current') if mibBuilder.loadTexts: hh3cDot11RRMChlRptLoad.setDescription('Load observed on the channel in percentage.') hh3cDot11RRMChlRptUtlz = MibTableColumn((1, 3, 6, 1, 4, 1, 25506, 2, 75, 8, 2, 1, 1, 7), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 100))).setUnits('percent').setMaxAccess("readonly") if mibBuilder.loadTexts: hh3cDot11RRMChlRptUtlz.setStatus('current') if mibBuilder.loadTexts: hh3cDot11RRMChlRptUtlz.setDescription('Utilization of the channel in percentage.') hh3cDot11RRMChlRptIntrf = MibTableColumn((1, 3, 6, 1, 4, 1, 25506, 2, 75, 8, 2, 1, 1, 8), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 100))).setUnits('percent').setMaxAccess("readonly") if mibBuilder.loadTexts: hh3cDot11RRMChlRptIntrf.setStatus('current') if mibBuilder.loadTexts: hh3cDot11RRMChlRptIntrf.setDescription('Interference observed on the channel in percentage.') hh3cDot11RRMChlRptPER = MibTableColumn((1, 3, 6, 1, 4, 1, 25506, 2, 75, 8, 2, 1, 1, 9), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 100))).setUnits('percent').setMaxAccess("readonly") if mibBuilder.loadTexts: hh3cDot11RRMChlRptPER.setStatus('current') if mibBuilder.loadTexts: hh3cDot11RRMChlRptPER.setDescription('Packet error rate observed on the channel in percentage.') hh3cDot11RRMChlRptRetryRate = MibTableColumn((1, 3, 6, 1, 4, 1, 25506, 2, 75, 8, 2, 1, 1, 10), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 100))).setUnits('percent').setMaxAccess("readonly") if mibBuilder.loadTexts: hh3cDot11RRMChlRptRetryRate.setStatus('current') if mibBuilder.loadTexts: hh3cDot11RRMChlRptRetryRate.setDescription('Percentage of retransmission happened on the channel.') hh3cDot11RRMChlRptNoise = MibTableColumn((1, 3, 6, 1, 4, 1, 25506, 2, 75, 8, 2, 1, 1, 11), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: hh3cDot11RRMChlRptNoise.setStatus('current') if mibBuilder.loadTexts: hh3cDot11RRMChlRptNoise.setDescription('Noise observed on the channel.') hh3cDot11RRMChlRptRadarIndtcr = MibTableColumn((1, 3, 6, 1, 4, 1, 25506, 2, 75, 8, 2, 1, 1, 12), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("detected", 1), ("notDetected", 2)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: hh3cDot11RRMChlRptRadarIndtcr.setStatus('current') if mibBuilder.loadTexts: hh3cDot11RRMChlRptRadarIndtcr.setDescription('Radar detection status.') hh3cDot11RRMNbrInfoTable = MibTable((1, 3, 6, 1, 4, 1, 25506, 2, 75, 8, 2, 2), ) if mibBuilder.loadTexts: hh3cDot11RRMNbrInfoTable.setStatus('current') if mibBuilder.loadTexts: hh3cDot11RRMNbrInfoTable.setDescription('This table shows the RRM neighbor information of each radio on all APs.') hh3cDot11RRMNbrInfoEntry = MibTableRow((1, 3, 6, 1, 4, 1, 25506, 2, 75, 8, 2, 2, 1), ).setIndexNames((0, "HH3C-DOT11-RRM-MIB", "hh3cDot11RRMRadioIndex"), (0, "HH3C-DOT11-RRM-MIB", "hh3cDot11RrmNbrBSSID")) if mibBuilder.loadTexts: hh3cDot11RRMNbrInfoEntry.setStatus('current') if mibBuilder.loadTexts: hh3cDot11RRMNbrInfoEntry.setDescription('Each entry contains information of RRM neighbor information of the radio on an AP.') hh3cDot11RrmNbrBSSID = MibTableColumn((1, 3, 6, 1, 4, 1, 25506, 2, 75, 8, 2, 2, 1, 1), MacAddress()) if mibBuilder.loadTexts: hh3cDot11RrmNbrBSSID.setStatus('current') if mibBuilder.loadTexts: hh3cDot11RrmNbrBSSID.setDescription('MAC address of the AP.') hh3cDot11RrmNbrChl = MibTableColumn((1, 3, 6, 1, 4, 1, 25506, 2, 75, 8, 2, 2, 1, 2), Hh3cDot11ChannelScopeType()).setMaxAccess("readonly") if mibBuilder.loadTexts: hh3cDot11RrmNbrChl.setStatus('current') if mibBuilder.loadTexts: hh3cDot11RrmNbrChl.setDescription('Channel number on which the neighbor was found.') hh3cDot11RRMNbrIntrf = MibTableColumn((1, 3, 6, 1, 4, 1, 25506, 2, 75, 8, 2, 2, 1, 3), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 100))).setUnits('percent').setMaxAccess("readonly") if mibBuilder.loadTexts: hh3cDot11RRMNbrIntrf.setStatus('current') if mibBuilder.loadTexts: hh3cDot11RRMNbrIntrf.setDescription('Interference observed on the channel in percentage by neighbor.') hh3cDot11RrmNbrRSSI = MibTableColumn((1, 3, 6, 1, 4, 1, 25506, 2, 75, 8, 2, 2, 1, 4), Integer32()).setUnits('dBm').setMaxAccess("readonly") if mibBuilder.loadTexts: hh3cDot11RrmNbrRSSI.setStatus('current') if mibBuilder.loadTexts: hh3cDot11RrmNbrRSSI.setDescription('Signal strength of the AP in dBm.') hh3cDot11RrmNbrType = MibTableColumn((1, 3, 6, 1, 4, 1, 25506, 2, 75, 8, 2, 2, 1, 5), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("managed", 1), ("unmanaged", 2)))).setMaxAccess("readonly") if mibBuilder.loadTexts: hh3cDot11RrmNbrType.setStatus('current') if mibBuilder.loadTexts: hh3cDot11RrmNbrType.setDescription('Type of the AP, managed or unmanaged.') hh3cDot11RrmNbrSSID = MibTableColumn((1, 3, 6, 1, 4, 1, 25506, 2, 75, 8, 2, 2, 1, 6), Hh3cDot11SSIDStringType()).setMaxAccess("readonly") if mibBuilder.loadTexts: hh3cDot11RrmNbrSSID.setStatus('current') if mibBuilder.loadTexts: hh3cDot11RrmNbrSSID.setDescription('SSID of the Neighbor.') hh3cDot11RRMHistoryTable = MibTable((1, 3, 6, 1, 4, 1, 25506, 2, 75, 8, 2, 3), ) if mibBuilder.loadTexts: hh3cDot11RRMHistoryTable.setStatus('current') if mibBuilder.loadTexts: hh3cDot11RRMHistoryTable.setDescription('This table shows the details of the latest three channel changes and power changes applied on all APs, including time of change, reason of the change and the channel, power, interference parameters.') hh3cDot11RRMHistoryEntry = MibTableRow((1, 3, 6, 1, 4, 1, 25506, 2, 75, 8, 2, 3, 1), ).setIndexNames((0, "HH3C-DOT11-RRM-MIB", "hh3cDot11RRMRadioIndex"), (0, "HH3C-DOT11-RRM-MIB", "hh3cDot11RRMHistoryId"), (0, "HH3C-DOT11-RRM-MIB", "hh3cDot11RRMHistoryRecIndctr")) if mibBuilder.loadTexts: hh3cDot11RRMHistoryEntry.setStatus('current') if mibBuilder.loadTexts: hh3cDot11RRMHistoryEntry.setDescription('Each entry shows the details of channel and power changes.') hh3cDot11RRMHistoryId = MibTableColumn((1, 3, 6, 1, 4, 1, 25506, 2, 75, 8, 2, 3, 1, 1), Integer32()) if mibBuilder.loadTexts: hh3cDot11RRMHistoryId.setStatus('current') if mibBuilder.loadTexts: hh3cDot11RRMHistoryId.setDescription('History number of the change.') hh3cDot11RRMHistoryRecIndctr = MibTableColumn((1, 3, 6, 1, 4, 1, 25506, 2, 75, 8, 2, 3, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("before", 1), ("after", 2)))) if mibBuilder.loadTexts: hh3cDot11RRMHistoryRecIndctr.setStatus('current') if mibBuilder.loadTexts: hh3cDot11RRMHistoryRecIndctr.setDescription('History record type of the change.') hh3cDot11RRMHistoryChl = MibTableColumn((1, 3, 6, 1, 4, 1, 25506, 2, 75, 8, 2, 3, 1, 3), Hh3cDot11ChannelScopeType()).setMaxAccess("readonly") if mibBuilder.loadTexts: hh3cDot11RRMHistoryChl.setStatus('current') if mibBuilder.loadTexts: hh3cDot11RRMHistoryChl.setDescription('Channel on which the radio operates before/after the change of channel or power.') hh3cDot11RRMHistoryPwr = MibTableColumn((1, 3, 6, 1, 4, 1, 25506, 2, 75, 8, 2, 3, 1, 4), Integer32()).setUnits('dBm').setMaxAccess("readonly") if mibBuilder.loadTexts: hh3cDot11RRMHistoryPwr.setStatus('current') if mibBuilder.loadTexts: hh3cDot11RRMHistoryPwr.setDescription('Power of the radio before/after the change of channel or power.') hh3cDot11RRMHistoryLoad = MibTableColumn((1, 3, 6, 1, 4, 1, 25506, 2, 75, 8, 2, 3, 1, 5), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 100))).setUnits('percent').setMaxAccess("readonly") if mibBuilder.loadTexts: hh3cDot11RRMHistoryLoad.setStatus('current') if mibBuilder.loadTexts: hh3cDot11RRMHistoryLoad.setDescription('Load observed on the radio in percentage before/after the change of channel or power.') hh3cDot11RRMHistoryUtlz = MibTableColumn((1, 3, 6, 1, 4, 1, 25506, 2, 75, 8, 2, 3, 1, 6), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 100))).setUnits('percent').setMaxAccess("readonly") if mibBuilder.loadTexts: hh3cDot11RRMHistoryUtlz.setStatus('current') if mibBuilder.loadTexts: hh3cDot11RRMHistoryUtlz.setDescription('Utilization of the radio in percentage before/after the change of channel or power.') hh3cDot11RRMHistoryIntrf = MibTableColumn((1, 3, 6, 1, 4, 1, 25506, 2, 75, 8, 2, 3, 1, 7), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 100))).setUnits('percent').setMaxAccess("readonly") if mibBuilder.loadTexts: hh3cDot11RRMHistoryIntrf.setStatus('current') if mibBuilder.loadTexts: hh3cDot11RRMHistoryIntrf.setDescription('Interference observed on the radio in percentage before/after the change of channel or power.') hh3cDot11RRMHistoryNoise = MibTableColumn((1, 3, 6, 1, 4, 1, 25506, 2, 75, 8, 2, 3, 1, 8), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: hh3cDot11RRMHistoryNoise.setStatus('current') if mibBuilder.loadTexts: hh3cDot11RRMHistoryNoise.setDescription('Noise observed on the radio before/after the change of channel or power.') hh3cDot11RRMHistoryPER = MibTableColumn((1, 3, 6, 1, 4, 1, 25506, 2, 75, 8, 2, 3, 1, 9), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 100))).setUnits('percent').setMaxAccess("readonly") if mibBuilder.loadTexts: hh3cDot11RRMHistoryPER.setStatus('current') if mibBuilder.loadTexts: hh3cDot11RRMHistoryPER.setDescription('Packet error rate observed on the radio in percentage before/after the change of channel or power.') hh3cDot11RRMHistoryRetryRate = MibTableColumn((1, 3, 6, 1, 4, 1, 25506, 2, 75, 8, 2, 3, 1, 10), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 100))).setUnits('percent').setMaxAccess("readonly") if mibBuilder.loadTexts: hh3cDot11RRMHistoryRetryRate.setStatus('current') if mibBuilder.loadTexts: hh3cDot11RRMHistoryRetryRate.setDescription('Percentage of retransmission happened on the radio before/after the change of channel or power.') hh3cDot11RRMHistoryChgReason = MibTableColumn((1, 3, 6, 1, 4, 1, 25506, 2, 75, 8, 2, 3, 1, 11), Bits().clone(namedValues=NamedValues(("others", 0), ("coverage", 1), ("radar", 2), ("retransmission", 3), ("packetsDiscarded", 4), ("interference", 5)))).setMaxAccess("readonly") if mibBuilder.loadTexts: hh3cDot11RRMHistoryChgReason.setStatus('current') if mibBuilder.loadTexts: hh3cDot11RRMHistoryChgReason.setDescription('Reason for the change of channel or power. The various bit positions are: |0 |Others | |1 |Coverage | |2 |Radar | |3 |Retransmission | |4 |Packets discarded | |5 |Interference | 0 is returned when the history record type is after.') hh3cDot11RRMHistoryChgDateTime = MibTableColumn((1, 3, 6, 1, 4, 1, 25506, 2, 75, 8, 2, 3, 1, 12), DateAndTime()).setMaxAccess("readonly") if mibBuilder.loadTexts: hh3cDot11RRMHistoryChgDateTime.setStatus('current') if mibBuilder.loadTexts: hh3cDot11RRMHistoryChgDateTime.setDescription('The time when the channel or power change occurred.') hh3cDot11RRMNotifyGroup = MibIdentifier((1, 3, 6, 1, 4, 1, 25506, 2, 75, 8, 3)) hh3cDot11RRMChlQltyNotifications = MibIdentifier((1, 3, 6, 1, 4, 1, 25506, 2, 75, 8, 3, 1)) hh3cDot11RRMChlQltyNtfPrefix = MibIdentifier((1, 3, 6, 1, 4, 1, 25506, 2, 75, 8, 3, 1, 0)) hh3cDot11RRMIntrfLimit = NotificationType((1, 3, 6, 1, 4, 1, 25506, 2, 75, 8, 3, 1, 0, 1)).setObjects(("HH3C-DOT11-RRM-MIB", "hh3cDot11RRMChlRptIntrf")) if mibBuilder.loadTexts: hh3cDot11RRMIntrfLimit.setStatus('current') if mibBuilder.loadTexts: hh3cDot11RRMIntrfLimit.setDescription('This notification will be sent when interference on the radio exceeds the limit.') hh3cDot11RRMPERLimit = NotificationType((1, 3, 6, 1, 4, 1, 25506, 2, 75, 8, 3, 1, 0, 2)).setObjects(("HH3C-DOT11-RRM-MIB", "hh3cDot11RRMChlRptPER")) if mibBuilder.loadTexts: hh3cDot11RRMPERLimit.setStatus('current') if mibBuilder.loadTexts: hh3cDot11RRMPERLimit.setDescription('This notification will be sent when packet error rate on the radio exceeds the limit.') hh3cDot11RRMNoiseLimit = NotificationType((1, 3, 6, 1, 4, 1, 25506, 2, 75, 8, 3, 1, 0, 3)).setObjects(("HH3C-DOT11-RRM-MIB", "hh3cDot11RRMChlRptNoise")) if mibBuilder.loadTexts: hh3cDot11RRMNoiseLimit.setStatus('current') if mibBuilder.loadTexts: hh3cDot11RRMNoiseLimit.setDescription('This notification will be sent when noise on the radio exceeds the limit.') hh3cDot11RRMResChgNotifications = MibIdentifier((1, 3, 6, 1, 4, 1, 25506, 2, 75, 8, 3, 2)) hh3cDot11RRMResChgNtfPrefix = MibIdentifier((1, 3, 6, 1, 4, 1, 25506, 2, 75, 8, 3, 2, 0)) hh3cDot11RRMPowerChange = NotificationType((1, 3, 6, 1, 4, 1, 25506, 2, 75, 8, 3, 2, 0, 1)).setObjects(("HH3C-DOT11-RRM-MIB", "hh3cDot11RRMRadioIndex"), ("HH3C-DOT11-RRM-MIB", "hh3cDot11NewPower"), ("HH3C-DOT11-RRM-MIB", "hh3cDot11OldPower")) if mibBuilder.loadTexts: hh3cDot11RRMPowerChange.setStatus('current') if mibBuilder.loadTexts: hh3cDot11RRMPowerChange.setDescription('This notification will be sent when power changed on the radio automatically.') hh3cDot11RRMNotificationsVar = MibIdentifier((1, 3, 6, 1, 4, 1, 25506, 2, 75, 8, 3, 3)) hh3cDot11NewPower = MibScalar((1, 3, 6, 1, 4, 1, 25506, 2, 75, 8, 3, 3, 1), Integer32()).setMaxAccess("accessiblefornotify") if mibBuilder.loadTexts: hh3cDot11NewPower.setStatus('current') if mibBuilder.loadTexts: hh3cDot11NewPower.setDescription('Power of the radio after the change of power.') hh3cDot11OldPower = MibScalar((1, 3, 6, 1, 4, 1, 25506, 2, 75, 8, 3, 3, 2), Integer32()).setMaxAccess("accessiblefornotify") if mibBuilder.loadTexts: hh3cDot11OldPower.setStatus('current') if mibBuilder.loadTexts: hh3cDot11OldPower.setDescription('Power of the radio before the change of power.') hh3cDot11MonitorDetectedGroup = MibIdentifier((1, 3, 6, 1, 4, 1, 25506, 2, 75, 8, 4)) hh3cDot11MonitorDetectedDevTable = MibTable((1, 3, 6, 1, 4, 1, 25506, 2, 75, 8, 4, 1), ) if mibBuilder.loadTexts: hh3cDot11MonitorDetectedDevTable.setStatus('current') if mibBuilder.loadTexts: hh3cDot11MonitorDetectedDevTable.setDescription('This table shows the devices of AP detected') hh3cDot11MonitorDetectedDevEntry = MibTableRow((1, 3, 6, 1, 4, 1, 25506, 2, 75, 8, 4, 1, 1), ).setIndexNames((0, "HH3C-DOT11-RRM-MIB", "hh3cDot11MonitorDevMAC"), (0, "HH3C-DOT11-REF-MIB", "hh3cDot11APElementIndex")) if mibBuilder.loadTexts: hh3cDot11MonitorDetectedDevEntry.setStatus('current') if mibBuilder.loadTexts: hh3cDot11MonitorDetectedDevEntry.setDescription('Each entry contains information of detected devices.') hh3cDot11MonitorDevMAC = MibTableColumn((1, 3, 6, 1, 4, 1, 25506, 2, 75, 8, 4, 1, 1, 1), MacAddress()) if mibBuilder.loadTexts: hh3cDot11MonitorDevMAC.setStatus('current') if mibBuilder.loadTexts: hh3cDot11MonitorDevMAC.setDescription('Represents MAC address of the device detected.') hh3cDot11MonitorDevType = MibTableColumn((1, 3, 6, 1, 4, 1, 25506, 2, 75, 8, 4, 1, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5))).clone(namedValues=NamedValues(("client", 1), ("ap", 2), ("adhoc", 3), ("wirelessBridge", 4), ("unknown", 5)))).setMaxAccess("readonly") if mibBuilder.loadTexts: hh3cDot11MonitorDevType.setStatus('current') if mibBuilder.loadTexts: hh3cDot11MonitorDevType.setDescription('Represents type of the device detected.') hh3cDot11MonitorDevVendor = MibTableColumn((1, 3, 6, 1, 4, 1, 25506, 2, 75, 8, 4, 1, 1, 3), OctetString()).setMaxAccess("readonly") if mibBuilder.loadTexts: hh3cDot11MonitorDevVendor.setStatus('current') if mibBuilder.loadTexts: hh3cDot11MonitorDevVendor.setDescription('Represents vendor of the detected device.') hh3cDot11MonitorDevSSID = MibTableColumn((1, 3, 6, 1, 4, 1, 25506, 2, 75, 8, 4, 1, 1, 4), OctetString()).setMaxAccess("readonly") if mibBuilder.loadTexts: hh3cDot11MonitorDevSSID.setStatus('current') if mibBuilder.loadTexts: hh3cDot11MonitorDevSSID.setDescription('Represents the service set identifier for the ESS of the device which type is ap or adhoc.') hh3cDot11MonitorDevBSSID = MibTableColumn((1, 3, 6, 1, 4, 1, 25506, 2, 75, 8, 4, 1, 1, 5), MacAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: hh3cDot11MonitorDevBSSID.setStatus('current') if mibBuilder.loadTexts: hh3cDot11MonitorDevBSSID.setDescription('Represents the basic service set identifier of the detected device.') hh3cDot11MonitorDevChannel = MibTableColumn((1, 3, 6, 1, 4, 1, 25506, 2, 75, 8, 4, 1, 1, 6), Hh3cDot11ChannelScopeType()).setMaxAccess("readonly") if mibBuilder.loadTexts: hh3cDot11MonitorDevChannel.setStatus('current') if mibBuilder.loadTexts: hh3cDot11MonitorDevChannel.setDescription('Represents the channel in which the device was last detected. AP will choose the channel which has maximum signal strength as effective channel, as there is interference between adjacent channels.') hh3cDot11MonitorRadioId = MibTableColumn((1, 3, 6, 1, 4, 1, 25506, 2, 75, 8, 4, 1, 1, 7), Hh3cDot11RadioScopeType()).setMaxAccess("readonly") if mibBuilder.loadTexts: hh3cDot11MonitorRadioId.setStatus('current') if mibBuilder.loadTexts: hh3cDot11MonitorRadioId.setDescription('Represents the radio ID of the AP that detected the device.') hh3cDot11MonitorDevMaxRSSI = MibTableColumn((1, 3, 6, 1, 4, 1, 25506, 2, 75, 8, 4, 1, 1, 8), Integer32()).setUnits('dbm').setMaxAccess("readonly") if mibBuilder.loadTexts: hh3cDot11MonitorDevMaxRSSI.setStatus('current') if mibBuilder.loadTexts: hh3cDot11MonitorDevMaxRSSI.setDescription('Represents the maximum detected RSSI of the device in a scan report cycle.') hh3cDot11MonitorDevBeaconIntvl = MibTableColumn((1, 3, 6, 1, 4, 1, 25506, 2, 75, 8, 4, 1, 1, 9), Integer32()).setUnits('millisecond').setMaxAccess("readonly") if mibBuilder.loadTexts: hh3cDot11MonitorDevBeaconIntvl.setStatus('current') if mibBuilder.loadTexts: hh3cDot11MonitorDevBeaconIntvl.setDescription('Represents the beacon interval for the detected device(not include the device which type is client).') hh3cDot11MonitorDevFstDctTime = MibTableColumn((1, 3, 6, 1, 4, 1, 25506, 2, 75, 8, 4, 1, 1, 10), DateAndTime()).setMaxAccess("readonly") if mibBuilder.loadTexts: hh3cDot11MonitorDevFstDctTime.setStatus('current') if mibBuilder.loadTexts: hh3cDot11MonitorDevFstDctTime.setDescription('Represents the time at which the device was first detected.') hh3cDot11MonitorDevLstDctTime = MibTableColumn((1, 3, 6, 1, 4, 1, 25506, 2, 75, 8, 4, 1, 1, 11), DateAndTime()).setMaxAccess("readonly") if mibBuilder.loadTexts: hh3cDot11MonitorDevLstDctTime.setStatus('current') if mibBuilder.loadTexts: hh3cDot11MonitorDevLstDctTime.setDescription('Represents the time at which the device was detected last time.') hh3cDot11MonitorDevClear = MibTableColumn((1, 3, 6, 1, 4, 1, 25506, 2, 75, 8, 4, 1, 1, 12), TruthValue()).setMaxAccess("readwrite") if mibBuilder.loadTexts: hh3cDot11MonitorDevClear.setStatus('current') if mibBuilder.loadTexts: hh3cDot11MonitorDevClear.setDescription('This object is used to clear the information of the device detected in the WLAN. It will return false for get operation.') hh3cDot11MonitorDevSNR = MibTableColumn((1, 3, 6, 1, 4, 1, 25506, 2, 75, 8, 4, 1, 1, 13), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: hh3cDot11MonitorDevSNR.setStatus('current') if mibBuilder.loadTexts: hh3cDot11MonitorDevSNR.setDescription('Represents the SNR of the device in a scan report cycle.') mibBuilder.exportSymbols("HH3C-DOT11-RRM-MIB", hh3cDot11RRMSDRadioGroupEntry=hh3cDot11RRMSDRadioGroupEntry, hh3cDot11MonitorDetectedDevTable=hh3cDot11MonitorDetectedDevTable, hh3cDot11RrmNbrType=hh3cDot11RrmNbrType, hh3cDot11RRMAPCfgTable=hh3cDot11RRMAPCfgTable, hh3cDot11RRMStaIntfThreshold=hh3cDot11RRMStaIntfThreshold, hh3cDot11RrmNbrChl=hh3cDot11RrmNbrChl, hh3cDot11RRMHistoryEntry=hh3cDot11RRMHistoryEntry, hh3cDot11RRMCfgChlState=hh3cDot11RRMCfgChlState, hh3cDot11MonitorDevClear=hh3cDot11MonitorDevClear, hh3cDot11RRMNotifyGroup=hh3cDot11RRMNotifyGroup, hh3cDot11MonitorDevSSID=hh3cDot11MonitorDevSSID, hh3cDot11RRMHistoryChl=hh3cDot11RRMHistoryChl, hh3cDot11MonitorDevSNR=hh3cDot11MonitorDevSNR, hh3cDot11MonitorDetectedDevEntry=hh3cDot11MonitorDetectedDevEntry, hh3cDot11MonitorDetectedGroup=hh3cDot11MonitorDetectedGroup, hh3cDot11RRMConfigGroup=hh3cDot11RRMConfigGroup, hh3cDot11MonitorDevVendor=hh3cDot11MonitorDevVendor, hh3cDot11RRMResChgNtfPrefix=hh3cDot11RRMResChgNtfPrefix, hh3cDot11RRMCfgPwrState=hh3cDot11RRMCfgPwrState, hh3cDot11RRMChlRptLoad=hh3cDot11RRMChlRptLoad, hh3cDot11RRMCfgNoiseThres=hh3cDot11RRMCfgNoiseThres, hh3cDot11RRMChlRptNbrCnt=hh3cDot11RRMChlRptNbrCnt, hh3cDot11RRMChlRptRadarIndtcr=hh3cDot11RRMChlRptRadarIndtcr, hh3cDot11RRMHistoryNoise=hh3cDot11RRMHistoryNoise, hh3cDot11RRMHistoryChgDateTime=hh3cDot11RRMHistoryChgDateTime, hh3cDot11RRMPowerChange=hh3cDot11RRMPowerChange, hh3cDot11RRMHistoryChgReason=hh3cDot11RRMHistoryChgReason, hh3cDot11RRMHistoryId=hh3cDot11RRMHistoryId, hh3cDot11RRMHistoryRetryRate=hh3cDot11RRMHistoryRetryRate, hh3cDot11MonitorRadioId=hh3cDot11MonitorRadioId, hh3cDot11RRMCfgToleranceFctr=hh3cDot11RRMCfgToleranceFctr, hh3cDot11RRMCfgPERThres=hh3cDot11RRMCfgPERThres, hh3cDot11RRMChlQltyNotifications=hh3cDot11RRMChlQltyNotifications, hh3cDot11MonitorDevMAC=hh3cDot11MonitorDevMAC, hh3cDot11RRMRadioCfgEntry=hh3cDot11RRMRadioCfgEntry, hh3cDot11RRMResChgNotifications=hh3cDot11RRMResChgNotifications, hh3cDot11RRMSDRadioGroupId=hh3cDot11RRMSDRadioGroupId, hh3cDot11RRMIntrfLimit=hh3cDot11RRMIntrfLimit, hh3cDot11RRMSDRdGrpChlHolddownTm=hh3cDot11RRMSDRdGrpChlHolddownTm, hh3cDot11RRMHistoryPwr=hh3cDot11RRMHistoryPwr, hh3cDot11RRMCfgPwrMode=hh3cDot11RRMCfgPwrMode, hh3cDot11RRM11nSuptMaxMcs=hh3cDot11RRM11nSuptMaxMcs, hh3cDot11RRMChlRptPER=hh3cDot11RRMChlRptPER, hh3cDot11RRMCfgIntrvl=hh3cDot11RRMCfgIntrvl, hh3cDot11RRMRadioType=hh3cDot11RRMRadioType, hh3cDot11MonitorDevLstDctTime=hh3cDot11MonitorDevLstDctTime, hh3cDot11RRMHistoryRecIndctr=hh3cDot11RRMHistoryRecIndctr, hh3cDot11RRM11aSpectrumManag=hh3cDot11RRM11aSpectrumManag, hh3cDot11MonitorDevChannel=hh3cDot11MonitorDevChannel, hh3cDot11RRMNotificationsVar=hh3cDot11RRMNotificationsVar, hh3cDot11RRMNbrIntrf=hh3cDot11RRMNbrIntrf, hh3cDot11RRMChlRptChlNum=hh3cDot11RRMChlRptChlNum, hh3cDot11RRMPwrProntoRadioElmt=hh3cDot11RRMPwrProntoRadioElmt, hh3cDot11RrmNbrBSSID=hh3cDot11RrmNbrBSSID, PYSNMP_MODULE_ID=hh3cDot11RRM, hh3cDot11RRMAPWorkMode=hh3cDot11RRMAPWorkMode, hh3cDot11RRMChlRptChlType=hh3cDot11RRMChlRptChlType, hh3cDot11RRMAdjChlIntfTrapThhd=hh3cDot11RRMAdjChlIntfTrapThhd, hh3cDot11RRMPERLimit=hh3cDot11RRMPERLimit, hh3cDot11RRMHistoryIntrf=hh3cDot11RRMHistoryIntrf, hh3cDot11RRMNbrInfoEntry=hh3cDot11RRMNbrInfoEntry, hh3cDot11RRM11nMadtMaxMcs=hh3cDot11RRM11nMadtMaxMcs, hh3cDot11RRMAPCfgEntry=hh3cDot11RRMAPCfgEntry, hh3cDot11RrmNbrSSID=hh3cDot11RrmNbrSSID, hh3cDot11MonitorDevType=hh3cDot11MonitorDevType, hh3cDot11StaInterfNumThreshhd=hh3cDot11StaInterfNumThreshhd, hh3cDot11RRMSDRdGrpPwrHolddownTm=hh3cDot11RRMSDRdGrpPwrHolddownTm, hh3cDot11RRMAPCfg2Table=hh3cDot11RRMAPCfg2Table, hh3cDot11RRM11gProtect=hh3cDot11RRM11gProtect, hh3cDot11MonitorDevBeaconIntvl=hh3cDot11MonitorDevBeaconIntvl, hh3cDot11RRMScanRptIntvel=hh3cDot11RRMScanRptIntvel, hh3cDot11RRMCfgAdjacencyFctr=hh3cDot11RRMCfgAdjacencyFctr, hh3cDot11RRMChlQltyNtfPrefix=hh3cDot11RRMChlQltyNtfPrefix, hh3cDot11RRM11aPwrConstrt=hh3cDot11RRM11aPwrConstrt, hh3cDot11RRMAPSerialID=hh3cDot11RRMAPSerialID, hh3cDot11RRMSDRdGroupRowStatus=hh3cDot11RRMSDRdGroupRowStatus, hh3cDot11RRMNoiseLimit=hh3cDot11RRMNoiseLimit, hh3cDot11RRMChlRptTable=hh3cDot11RRMChlRptTable, hh3cDot11RRMHistoryLoad=hh3cDot11RRMHistoryLoad, hh3cDot11RRMChlRptChlQlty=hh3cDot11RRMChlRptChlQlty, hh3cDot11RRMNbrInfoTable=hh3cDot11RRMNbrInfoTable, hh3cDot11RrmNbrRSSI=hh3cDot11RrmNbrRSSI, hh3cDot11RRMChlRptNoise=hh3cDot11RRMChlRptNoise, hh3cDot11OldPower=hh3cDot11OldPower, hh3cDot11RRMChlProntoRadioElmt=hh3cDot11RRMChlProntoRadioElmt, hh3cDot11RRMChlRptRetryRate=hh3cDot11RRMChlRptRetryRate, hh3cDot11RRMHistoryPER=hh3cDot11RRMHistoryPER, hh3cDot11RRMChlRptIntrf=hh3cDot11RRMChlRptIntrf, hh3cDot11RRMSDRadioGroupDesc=hh3cDot11RRMSDRadioGroupDesc, hh3cDot11RRMAutoChlAvoid11h=hh3cDot11RRMAutoChlAvoid11h, hh3cDot11RRMHistoryTable=hh3cDot11RRMHistoryTable, hh3cDot11RRMRadioCfgTable=hh3cDot11RRMRadioCfgTable, hh3cDot11RRMScanChl=hh3cDot11RRMScanChl, hh3cDot11RRMHistoryUtlz=hh3cDot11RRMHistoryUtlz, hh3cDot11APInterfNumThreshhd=hh3cDot11APInterfNumThreshhd, hh3cDot11MonitorDevMaxRSSI=hh3cDot11MonitorDevMaxRSSI, hh3cDot11RRMRadioIndex=hh3cDot11RRMRadioIndex, hh3cDot11MonitorDevBSSID=hh3cDot11MonitorDevBSSID, hh3cDot11RRMSDRadioGroupTable=hh3cDot11RRMSDRadioGroupTable, hh3cDot11RRMChlRptUtlz=hh3cDot11RRMChlRptUtlz, hh3cDot11RRMChlRptEntry=hh3cDot11RRMChlRptEntry, hh3cDot11NewPower=hh3cDot11NewPower, hh3cDot11RRM=hh3cDot11RRM, hh3cDot11RRMCoChlIntfTrapThhd=hh3cDot11RRMCoChlIntfTrapThhd, hh3cDot11MonitorDevFstDctTime=hh3cDot11MonitorDevFstDctTime, hh3cDot11RRMCfgIntrfThres=hh3cDot11RRMCfgIntrfThres, hh3cDot11RRMGlobalCfgPara=hh3cDot11RRMGlobalCfgPara, hh3cDot11RRMDetectGroup=hh3cDot11RRMDetectGroup, hh3cDot11RRMCfgChlMode=hh3cDot11RRMCfgChlMode, hh3cDot11RRMAPCfg2Entry=hh3cDot11RRMAPCfg2Entry, hh3cDot11RRMAPIntfThreshold=hh3cDot11RRMAPIntfThreshold)
(object_identifier, integer, octet_string) = mibBuilder.importSymbols('ASN1', 'ObjectIdentifier', 'Integer', 'OctetString') (named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues') (value_size_constraint, constraints_union, single_value_constraint, value_range_constraint, constraints_intersection) = mibBuilder.importSymbols('ASN1-REFINEMENT', 'ValueSizeConstraint', 'ConstraintsUnion', 'SingleValueConstraint', 'ValueRangeConstraint', 'ConstraintsIntersection') (hh3c_dot11_radio_scope_type, hh3c_dot11_ap_element_index, hh3c_dot11_object_id_type, hh3c_dot11_channel_scope_type, hh3c_dot11, hh3c_dot11_ssid_string_type, hh3c_dot11_radio_element_index, hh3c_dot11_radio_type) = mibBuilder.importSymbols('HH3C-DOT11-REF-MIB', 'Hh3cDot11RadioScopeType', 'hh3cDot11APElementIndex', 'Hh3cDot11ObjectIDType', 'Hh3cDot11ChannelScopeType', 'hh3cDot11', 'Hh3cDot11SSIDStringType', 'Hh3cDot11RadioElementIndex', 'Hh3cDot11RadioType') (notification_group, module_compliance) = mibBuilder.importSymbols('SNMPv2-CONF', 'NotificationGroup', 'ModuleCompliance') (mib_scalar, mib_table, mib_table_row, mib_table_column, time_ticks, ip_address, bits, unsigned32, gauge32, integer32, counter64, iso, notification_type, object_identity, mib_identifier, counter32, module_identity) = mibBuilder.importSymbols('SNMPv2-SMI', 'MibScalar', 'MibTable', 'MibTableRow', 'MibTableColumn', 'TimeTicks', 'IpAddress', 'Bits', 'Unsigned32', 'Gauge32', 'Integer32', 'Counter64', 'iso', 'NotificationType', 'ObjectIdentity', 'MibIdentifier', 'Counter32', 'ModuleIdentity') (row_status, mac_address, textual_convention, truth_value, display_string, date_and_time) = mibBuilder.importSymbols('SNMPv2-TC', 'RowStatus', 'MacAddress', 'TextualConvention', 'TruthValue', 'DisplayString', 'DateAndTime') hh3c_dot11_rrm = module_identity((1, 3, 6, 1, 4, 1, 25506, 2, 75, 8)) hh3cDot11RRM.setRevisions(('2010-09-25 18:00', '2010-02-23 18:00', '2009-08-01 20:00', '2009-05-07 20:00', '2009-04-17 20:00', '2008-07-14 14:29')) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): if mibBuilder.loadTexts: hh3cDot11RRM.setRevisionsDescriptions(('Modified to add new nodes.', 'Modified to add new nodes.', 'Modified to add new nodes and new table.', 'Modified to add new nodes and new table.', 'Modified to add new table and new group.', 'The initial revision of this MIB module.')) if mibBuilder.loadTexts: hh3cDot11RRM.setLastUpdated('201009251800Z') if mibBuilder.loadTexts: hh3cDot11RRM.setOrganization('Hangzhou H3C Technologies Co., Ltd.') if mibBuilder.loadTexts: hh3cDot11RRM.setContactInfo('Platform Team H3C Technologies Co., Ltd. Hai-Dian District Beijing P.R.China Http://www.h3c.com Zip: 100085') if mibBuilder.loadTexts: hh3cDot11RRM.setDescription('This MIB file is to provide the object definition of WLAN radio resource management (RRM).') hh3c_dot11_rrm_config_group = mib_identifier((1, 3, 6, 1, 4, 1, 25506, 2, 75, 8, 1)) hh3c_dot11_rrm_global_cfg_para = mib_identifier((1, 3, 6, 1, 4, 1, 25506, 2, 75, 8, 1, 1)) hh3c_dot11_rrm11n_madt_max_mcs = mib_scalar((1, 3, 6, 1, 4, 1, 25506, 2, 75, 8, 1, 1, 1), integer32().subtype(subtypeSpec=constraints_union(value_range_constraint(0, 76), value_range_constraint(255, 255))).clone(255)).setMaxAccess('readwrite') if mibBuilder.loadTexts: hh3cDot11RRM11nMadtMaxMcs.setStatus('current') if mibBuilder.loadTexts: hh3cDot11RRM11nMadtMaxMcs.setDescription('Specify the maximum modulation and coding scheme (MCS) index for 802.11n mandatory rates. The value 255 indicates that no maximum MCS index is specified. No maximum MCS index is specified for 802.11n mandatory rates by default. Besides 255, the specified maximum MCS index for 802.11n supported rates must be no less than the specified maximum MCS index for 802.11n mandatory rates.') hh3c_dot11_rrm11n_supt_max_mcs = mib_scalar((1, 3, 6, 1, 4, 1, 25506, 2, 75, 8, 1, 1, 2), integer32().subtype(subtypeSpec=value_range_constraint(0, 76)).clone(76)).setMaxAccess('readwrite') if mibBuilder.loadTexts: hh3cDot11RRM11nSuptMaxMcs.setStatus('current') if mibBuilder.loadTexts: hh3cDot11RRM11nSuptMaxMcs.setDescription('Specify the maximum Modulation and Coding Scheme (MCS) index for 802.11n supported rates. The specified maximum MCS index for 802.11n supported rates must be no less than the specified maximum MCS index for 802.11n mandatory rates.') hh3c_dot11_rrm11g_protect = mib_scalar((1, 3, 6, 1, 4, 1, 25506, 2, 75, 8, 1, 1, 3), truth_value().clone('false')).setMaxAccess('readwrite') if mibBuilder.loadTexts: hh3cDot11RRM11gProtect.setStatus('current') if mibBuilder.loadTexts: hh3cDot11RRM11gProtect.setDescription('Enable/Disable dot11g protection.') hh3c_dot11_rrm11a_pwr_constrt = mib_scalar((1, 3, 6, 1, 4, 1, 25506, 2, 75, 8, 1, 1, 4), integer32()).setUnits('dBm').setMaxAccess('readwrite') if mibBuilder.loadTexts: hh3cDot11RRM11aPwrConstrt.setStatus('current') if mibBuilder.loadTexts: hh3cDot11RRM11aPwrConstrt.setDescription('Configure the power constraint for all 802.11a radios. The configured power constraint is advertised in beacons if spectrum management is enabled. The range of power constraint is 0 to MAX-POWER-1 (where the MAX-POWER is defined by the regulatory domain).') hh3c_dot11_rrm11a_spectrum_manag = mib_scalar((1, 3, 6, 1, 4, 1, 25506, 2, 75, 8, 1, 1, 5), truth_value().clone('false')).setMaxAccess('readwrite') if mibBuilder.loadTexts: hh3cDot11RRM11aSpectrumManag.setStatus('current') if mibBuilder.loadTexts: hh3cDot11RRM11aSpectrumManag.setDescription('Enable/Disable spectrum management for 802.11a radios. When spectrum management is enabled, the WLAN sub-system advertises power capabilities of the AP and power constraints applicable to all devices in the BSS based on regulatory domain specification.') hh3c_dot11_rrm_auto_chl_avoid11h = mib_scalar((1, 3, 6, 1, 4, 1, 25506, 2, 75, 8, 1, 1, 6), truth_value().clone('false')).setMaxAccess('readwrite') if mibBuilder.loadTexts: hh3cDot11RRMAutoChlAvoid11h.setStatus('current') if mibBuilder.loadTexts: hh3cDot11RRMAutoChlAvoid11h.setDescription('Configure the auto-channel set as non-dot11h channels, this is, only the non-dot11h channels belonging to the country code are scanned during initial channel selection and one of them is selected.') hh3c_dot11_rrm_scan_chl = mib_scalar((1, 3, 6, 1, 4, 1, 25506, 2, 75, 8, 1, 1, 7), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('auto', 1), ('all', 2))).clone('auto')).setMaxAccess('readwrite') if mibBuilder.loadTexts: hh3cDot11RRMScanChl.setStatus('current') if mibBuilder.loadTexts: hh3cDot11RRMScanChl.setDescription('Set the scan mode. auto: When this option is set, all channels of the country code being set are scanned. all: When this option is set, all the channels of the radio band are scanned.') hh3c_dot11_rrm_scan_rpt_intvel = mib_scalar((1, 3, 6, 1, 4, 1, 25506, 2, 75, 8, 1, 1, 8), integer32().subtype(subtypeSpec=value_range_constraint(5, 120)).clone(10)).setUnits('second').setMaxAccess('readwrite') if mibBuilder.loadTexts: hh3cDot11RRMScanRptIntvel.setStatus('current') if mibBuilder.loadTexts: hh3cDot11RRMScanRptIntvel.setDescription('Set the scan report interval.') hh3c_dot11_ap_interf_num_threshhd = mib_scalar((1, 3, 6, 1, 4, 1, 25506, 2, 75, 8, 1, 1, 9), integer32()).setMaxAccess('readwrite') if mibBuilder.loadTexts: hh3cDot11APInterfNumThreshhd.setStatus('current') if mibBuilder.loadTexts: hh3cDot11APInterfNumThreshhd.setDescription('Represents threshold of AP interference . If the value of AP interference exceeds this threshold, AP interference trap will be sent. If the value of this node is zero, AP interference trap will be sent immediately.') hh3c_dot11_sta_interf_num_threshhd = mib_scalar((1, 3, 6, 1, 4, 1, 25506, 2, 75, 8, 1, 1, 10), integer32()).setMaxAccess('readwrite') if mibBuilder.loadTexts: hh3cDot11StaInterfNumThreshhd.setStatus('current') if mibBuilder.loadTexts: hh3cDot11StaInterfNumThreshhd.setDescription('Represents threshold of STA interference. If the value of STA interference exceeds this threshold, STA interference trap will be sent. If the value of this node is zero, STA interference trap will be sent immediately. ') hh3c_dot11_rrm_radio_cfg_table = mib_table((1, 3, 6, 1, 4, 1, 25506, 2, 75, 8, 1, 2)) if mibBuilder.loadTexts: hh3cDot11RRMRadioCfgTable.setStatus('current') if mibBuilder.loadTexts: hh3cDot11RRMRadioCfgTable.setDescription('Configure WLAN RRM based radio type. When 802.11b parameter is modified, 802.11g parameter will be changed at the same time. In the same way, when 802.11g parameter is modified, 802.11b parameter will be changed at the same time.') hh3c_dot11_rrm_radio_cfg_entry = mib_table_row((1, 3, 6, 1, 4, 1, 25506, 2, 75, 8, 1, 2, 1)).setIndexNames((0, 'HH3C-DOT11-RRM-MIB', 'hh3cDot11RRMRadioType')) if mibBuilder.loadTexts: hh3cDot11RRMRadioCfgEntry.setStatus('current') if mibBuilder.loadTexts: hh3cDot11RRMRadioCfgEntry.setDescription('Configure WLAN RRM based radio type. When 802.11b parameter is modified, 802.11g parameter will be changed at the same time. In the same way, when 802.11g parameter is modified, 802.11b parameter will be changed at the same time.') hh3c_dot11_rrm_radio_type = mib_table_column((1, 3, 6, 1, 4, 1, 25506, 2, 75, 8, 1, 2, 1, 1), hh3c_dot11_radio_type()) if mibBuilder.loadTexts: hh3cDot11RRMRadioType.setStatus('current') if mibBuilder.loadTexts: hh3cDot11RRMRadioType.setDescription('802.11 radio type.') hh3c_dot11_rrm_cfg_chl_state = mib_table_column((1, 3, 6, 1, 4, 1, 25506, 2, 75, 8, 1, 2, 1, 2), truth_value().clone('false')).setMaxAccess('readwrite') if mibBuilder.loadTexts: hh3cDot11RRMCfgChlState.setStatus('current') if mibBuilder.loadTexts: hh3cDot11RRMCfgChlState.setDescription('Enable/Disable dynamic channel selection.') hh3c_dot11_rrm_cfg_chl_mode = mib_table_column((1, 3, 6, 1, 4, 1, 25506, 2, 75, 8, 1, 2, 1, 3), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('selfDecisive', 1), ('userTriggered', 2))).clone('userTriggered')).setMaxAccess('readwrite') if mibBuilder.loadTexts: hh3cDot11RRMCfgChlMode.setStatus('current') if mibBuilder.loadTexts: hh3cDot11RRMCfgChlMode.setDescription('Configure the mode of channel selection. This node can be configured only when dynamic channel selection is enabled.') hh3c_dot11_rrm_chl_pronto_radio_elmt = mib_table_column((1, 3, 6, 1, 4, 1, 25506, 2, 75, 8, 1, 2, 1, 4), unsigned32()).setMaxAccess('readwrite') if mibBuilder.loadTexts: hh3cDot11RRMChlProntoRadioElmt.setStatus('current') if mibBuilder.loadTexts: hh3cDot11RRMChlProntoRadioElmt.setDescription('Specify the AP and radio that will change channel at next calibration cycle. 0 is returned when getting the value of this node. This node can be configured only when the mode of channel selection control is user-triggered. When configuring, the higher 24 bits stand for the AP index, and the last 8 bits stand for the radio index. 4294967295 stand for configuring each radio on all APs.') hh3c_dot11_rrm_cfg_pwr_state = mib_table_column((1, 3, 6, 1, 4, 1, 25506, 2, 75, 8, 1, 2, 1, 5), truth_value().clone('false')).setMaxAccess('readwrite') if mibBuilder.loadTexts: hh3cDot11RRMCfgPwrState.setStatus('current') if mibBuilder.loadTexts: hh3cDot11RRMCfgPwrState.setDescription('Enable/Disable dynamic power selection for the band.') hh3c_dot11_rrm_cfg_pwr_mode = mib_table_column((1, 3, 6, 1, 4, 1, 25506, 2, 75, 8, 1, 2, 1, 6), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('selfDecisive', 1), ('userTriggered', 2))).clone('userTriggered')).setMaxAccess('readwrite') if mibBuilder.loadTexts: hh3cDot11RRMCfgPwrMode.setStatus('current') if mibBuilder.loadTexts: hh3cDot11RRMCfgPwrMode.setDescription('Configure the mode of transmit power control. This node can be configured only when dynamic power selection is enabled.') hh3c_dot11_rrm_pwr_pronto_radio_elmt = mib_table_column((1, 3, 6, 1, 4, 1, 25506, 2, 75, 8, 1, 2, 1, 7), unsigned32()).setMaxAccess('readwrite') if mibBuilder.loadTexts: hh3cDot11RRMPwrProntoRadioElmt.setStatus('current') if mibBuilder.loadTexts: hh3cDot11RRMPwrProntoRadioElmt.setDescription('Specify the AP and radio that will change power at next calibration cycle. 0 is returned when getting the value of this node. This node can be configured only when the mode of transmit power control is user-triggered. When configuring, the higher 24 bits stand for the AP index, and the last 8 bits stand for the radio index. 4294967295 stand for configuring each radio on all APs.') hh3c_dot11_rrm_cfg_intrvl = mib_table_column((1, 3, 6, 1, 4, 1, 25506, 2, 75, 8, 1, 2, 1, 8), integer32().clone(8)).setUnits('minute').setMaxAccess('readwrite') if mibBuilder.loadTexts: hh3cDot11RRMCfgIntrvl.setStatus('current') if mibBuilder.loadTexts: hh3cDot11RRMCfgIntrvl.setDescription('Configure the calibration interval.') hh3c_dot11_rrm_cfg_intrf_thres = mib_table_column((1, 3, 6, 1, 4, 1, 25506, 2, 75, 8, 1, 2, 1, 9), integer32().subtype(subtypeSpec=value_range_constraint(40, 100)).clone(50)).setUnits('percent').setMaxAccess('readwrite') if mibBuilder.loadTexts: hh3cDot11RRMCfgIntrfThres.setStatus('current') if mibBuilder.loadTexts: hh3cDot11RRMCfgIntrfThres.setDescription('Configure the interface threshold. By default, interference observed on an operating channel is considered during dynamic frequency selection and transmit power control. If the interference percentage on the channel reaches the set threshold, RRM will perform resource adjustment to control the situation.') hh3c_dot11_rrm_cfg_noise_thres = mib_table_column((1, 3, 6, 1, 4, 1, 25506, 2, 75, 8, 1, 2, 1, 10), integer32().subtype(subtypeSpec=value_range_constraint(-127, 127)).clone(-70)).setMaxAccess('readwrite') if mibBuilder.loadTexts: hh3cDot11RRMCfgNoiseThres.setStatus('current') if mibBuilder.loadTexts: hh3cDot11RRMCfgNoiseThres.setDescription('Configure the noise threshold.') hh3c_dot11_rrm_cfg_per_thres = mib_table_column((1, 3, 6, 1, 4, 1, 25506, 2, 75, 8, 1, 2, 1, 11), integer32().subtype(subtypeSpec=value_range_constraint(10, 100)).clone(20)).setUnits('percent').setMaxAccess('readwrite') if mibBuilder.loadTexts: hh3cDot11RRMCfgPERThres.setStatus('current') if mibBuilder.loadTexts: hh3cDot11RRMCfgPERThres.setDescription('Configure the CRC error threshold. If the percentage of CRC errors reaches the threshold, RRM will perform resource adjustment to control the situation.') hh3c_dot11_rrm_cfg_tolerance_fctr = mib_table_column((1, 3, 6, 1, 4, 1, 25506, 2, 75, 8, 1, 2, 1, 12), integer32().subtype(subtypeSpec=value_range_constraint(15, 45)).clone(20)).setUnits('percent').setMaxAccess('readwrite') if mibBuilder.loadTexts: hh3cDot11RRMCfgToleranceFctr.setStatus('current') if mibBuilder.loadTexts: hh3cDot11RRMCfgToleranceFctr.setDescription('Configure the tolerance level. During dynamic frequency selection (DFS), the channel will be changed only if there is a better channel having lesser interference and packet error rate than those specified by the user.') hh3c_dot11_rrm_cfg_adjacency_fctr = mib_table_column((1, 3, 6, 1, 4, 1, 25506, 2, 75, 8, 1, 2, 1, 13), integer32().subtype(subtypeSpec=value_range_constraint(1, 16)).clone(3)).setMaxAccess('readwrite') if mibBuilder.loadTexts: hh3cDot11RRMCfgAdjacencyFctr.setStatus('current') if mibBuilder.loadTexts: hh3cDot11RRMCfgAdjacencyFctr.setDescription('Configure the adjacency factor for the band. If transmit power control (TPC) is configured, power will be adjusted when the nth neighbor is detected. The value n is the adjacency factor.') hh3c_dot11_rrmap_cfg_table = mib_table((1, 3, 6, 1, 4, 1, 25506, 2, 75, 8, 1, 3)) if mibBuilder.loadTexts: hh3cDot11RRMAPCfgTable.setStatus('current') if mibBuilder.loadTexts: hh3cDot11RRMAPCfgTable.setDescription('This table defines the RRM parameters for AP.') hh3c_dot11_rrmap_cfg_entry = mib_table_row((1, 3, 6, 1, 4, 1, 25506, 2, 75, 8, 1, 3, 1)).setIndexNames((0, 'HH3C-DOT11-REF-MIB', 'hh3cDot11APElementIndex')) if mibBuilder.loadTexts: hh3cDot11RRMAPCfgEntry.setStatus('current') if mibBuilder.loadTexts: hh3cDot11RRMAPCfgEntry.setDescription('Each entry contains information of RRM parameters for AP.') hh3c_dot11_rrmap_work_mode = mib_table_column((1, 3, 6, 1, 4, 1, 25506, 2, 75, 8, 1, 3, 1, 1), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3))).clone(namedValues=named_values(('normal', 1), ('monitor', 2), ('hybrid', 3)))).setMaxAccess('readwrite') if mibBuilder.loadTexts: hh3cDot11RRMAPWorkMode.setStatus('current') if mibBuilder.loadTexts: hh3cDot11RRMAPWorkMode.setDescription('AP work mode.') hh3c_dot11_rrmsd_radio_group_table = mib_table((1, 3, 6, 1, 4, 1, 25506, 2, 75, 8, 1, 4)) if mibBuilder.loadTexts: hh3cDot11RRMSDRadioGroupTable.setStatus('current') if mibBuilder.loadTexts: hh3cDot11RRMSDRadioGroupTable.setDescription('This table defines RRM self-decisive radio group.') hh3c_dot11_rrmsd_radio_group_entry = mib_table_row((1, 3, 6, 1, 4, 1, 25506, 2, 75, 8, 1, 4, 1)).setIndexNames((0, 'HH3C-DOT11-RRM-MIB', 'hh3cDot11RRMSDRadioGroupId')) if mibBuilder.loadTexts: hh3cDot11RRMSDRadioGroupEntry.setStatus('current') if mibBuilder.loadTexts: hh3cDot11RRMSDRadioGroupEntry.setDescription('Each entry contains information of one RRM self-decisive radio group.') hh3c_dot11_rrmsd_radio_group_id = mib_table_column((1, 3, 6, 1, 4, 1, 25506, 2, 75, 8, 1, 4, 1, 1), unsigned32()) if mibBuilder.loadTexts: hh3cDot11RRMSDRadioGroupId.setStatus('current') if mibBuilder.loadTexts: hh3cDot11RRMSDRadioGroupId.setDescription('Represents RRM self-decisive radio group ID.') hh3c_dot11_rrmsd_radio_group_desc = mib_table_column((1, 3, 6, 1, 4, 1, 25506, 2, 75, 8, 1, 4, 1, 2), octet_string()).setMaxAccess('readcreate') if mibBuilder.loadTexts: hh3cDot11RRMSDRadioGroupDesc.setStatus('current') if mibBuilder.loadTexts: hh3cDot11RRMSDRadioGroupDesc.setDescription('Represents the description of RRM self-decisive radio group.') hh3c_dot11_rrmsd_rd_grp_chl_holddown_tm = mib_table_column((1, 3, 6, 1, 4, 1, 25506, 2, 75, 8, 1, 4, 1, 3), unsigned32()).setUnits('minute').setMaxAccess('readcreate') if mibBuilder.loadTexts: hh3cDot11RRMSDRdGrpChlHolddownTm.setStatus('current') if mibBuilder.loadTexts: hh3cDot11RRMSDRdGrpChlHolddownTm.setDescription('Represents the channel holddown time of RRM self-decisive radio group.') hh3c_dot11_rrmsd_rd_grp_pwr_holddown_tm = mib_table_column((1, 3, 6, 1, 4, 1, 25506, 2, 75, 8, 1, 4, 1, 4), unsigned32()).setUnits('minute').setMaxAccess('readcreate') if mibBuilder.loadTexts: hh3cDot11RRMSDRdGrpPwrHolddownTm.setStatus('current') if mibBuilder.loadTexts: hh3cDot11RRMSDRdGrpPwrHolddownTm.setDescription('Represents the power holddown time of RRM self-decisive radio group.') hh3c_dot11_rrmsd_rd_group_row_status = mib_table_column((1, 3, 6, 1, 4, 1, 25506, 2, 75, 8, 1, 4, 1, 5), row_status()).setMaxAccess('readcreate') if mibBuilder.loadTexts: hh3cDot11RRMSDRdGroupRowStatus.setStatus('current') if mibBuilder.loadTexts: hh3cDot11RRMSDRdGroupRowStatus.setDescription('The row status of this table entry.') hh3c_dot11_rrmap_cfg2_table = mib_table((1, 3, 6, 1, 4, 1, 25506, 2, 75, 8, 1, 5)) if mibBuilder.loadTexts: hh3cDot11RRMAPCfg2Table.setStatus('current') if mibBuilder.loadTexts: hh3cDot11RRMAPCfg2Table.setDescription('This table defines the RRM parameters for AP.') hh3c_dot11_rrmap_cfg2_entry = mib_table_row((1, 3, 6, 1, 4, 1, 25506, 2, 75, 8, 1, 5, 1)).setIndexNames((0, 'HH3C-DOT11-RRM-MIB', 'hh3cDot11RRMAPSerialID')) if mibBuilder.loadTexts: hh3cDot11RRMAPCfg2Entry.setStatus('current') if mibBuilder.loadTexts: hh3cDot11RRMAPCfg2Entry.setDescription('Each entry contains information of RRM parameters for AP.') hh3c_dot11_rrmap_serial_id = mib_table_column((1, 3, 6, 1, 4, 1, 25506, 2, 75, 8, 1, 5, 1, 1), hh3c_dot11_object_id_type()) if mibBuilder.loadTexts: hh3cDot11RRMAPSerialID.setStatus('current') if mibBuilder.loadTexts: hh3cDot11RRMAPSerialID.setDescription('Serial ID of the AP.') hh3c_dot11_rrmap_intf_threshold = mib_table_column((1, 3, 6, 1, 4, 1, 25506, 2, 75, 8, 1, 5, 1, 2), integer32()).setMaxAccess('readwrite') if mibBuilder.loadTexts: hh3cDot11RRMAPIntfThreshold.setStatus('current') if mibBuilder.loadTexts: hh3cDot11RRMAPIntfThreshold.setDescription('Represents threshold of AP interference . If the number of AP interference exceeds this threshold, AP interference trap will be sent.') hh3c_dot11_rrm_sta_intf_threshold = mib_table_column((1, 3, 6, 1, 4, 1, 25506, 2, 75, 8, 1, 5, 1, 3), integer32()).setMaxAccess('readwrite') if mibBuilder.loadTexts: hh3cDot11RRMStaIntfThreshold.setStatus('current') if mibBuilder.loadTexts: hh3cDot11RRMStaIntfThreshold.setDescription('Represents threshold of STA interference. If the number of STA interference exceeds this threshold, station interference trap will be sent.') hh3c_dot11_rrm_co_chl_intf_trap_thhd = mib_table_column((1, 3, 6, 1, 4, 1, 25506, 2, 75, 8, 1, 5, 1, 4), integer32()).setUnits('dbm').setMaxAccess('readwrite') if mibBuilder.loadTexts: hh3cDot11RRMCoChlIntfTrapThhd.setStatus('current') if mibBuilder.loadTexts: hh3cDot11RRMCoChlIntfTrapThhd.setDescription('Represents threshold of interference trap with current ap. If signal strength of the device exceeds this threshold, corresponding trap will be sent.') hh3c_dot11_rrm_adj_chl_intf_trap_thhd = mib_table_column((1, 3, 6, 1, 4, 1, 25506, 2, 75, 8, 1, 5, 1, 5), integer32()).setUnits('dbm').setMaxAccess('readwrite') if mibBuilder.loadTexts: hh3cDot11RRMAdjChlIntfTrapThhd.setStatus('current') if mibBuilder.loadTexts: hh3cDot11RRMAdjChlIntfTrapThhd.setDescription('Represents threshold of adjacent interference trap with current ap. If signal strength of the device exceeds this threshold, corresponding trap will be sent.') hh3c_dot11_rrm_detect_group = mib_identifier((1, 3, 6, 1, 4, 1, 25506, 2, 75, 8, 2)) hh3c_dot11_rrm_chl_rpt_table = mib_table((1, 3, 6, 1, 4, 1, 25506, 2, 75, 8, 2, 1)) if mibBuilder.loadTexts: hh3cDot11RRMChlRptTable.setStatus('current') if mibBuilder.loadTexts: hh3cDot11RRMChlRptTable.setDescription('This table shows the RRM channel information of each radio on all APs.') hh3c_dot11_rrm_chl_rpt_entry = mib_table_row((1, 3, 6, 1, 4, 1, 25506, 2, 75, 8, 2, 1, 1)).setIndexNames((0, 'HH3C-DOT11-RRM-MIB', 'hh3cDot11RRMRadioIndex'), (0, 'HH3C-DOT11-RRM-MIB', 'hh3cDot11RRMChlRptChlNum')) if mibBuilder.loadTexts: hh3cDot11RRMChlRptEntry.setStatus('current') if mibBuilder.loadTexts: hh3cDot11RRMChlRptEntry.setDescription('Each entry contains information of RRM channel information of the radio on the AP.') hh3c_dot11_rrm_radio_index = mib_table_column((1, 3, 6, 1, 4, 1, 25506, 2, 75, 8, 2, 1, 1, 1), hh3c_dot11_radio_element_index()).setMaxAccess('accessiblefornotify') if mibBuilder.loadTexts: hh3cDot11RRMRadioIndex.setStatus('current') if mibBuilder.loadTexts: hh3cDot11RRMRadioIndex.setDescription('Represents index of the radio.') hh3c_dot11_rrm_chl_rpt_chl_num = mib_table_column((1, 3, 6, 1, 4, 1, 25506, 2, 75, 8, 2, 1, 1, 2), integer32()).setMaxAccess('accessiblefornotify') if mibBuilder.loadTexts: hh3cDot11RRMChlRptChlNum.setStatus('current') if mibBuilder.loadTexts: hh3cDot11RRMChlRptChlNum.setDescription('Channel number.') hh3c_dot11_rrm_chl_rpt_chl_type = mib_table_column((1, 3, 6, 1, 4, 1, 25506, 2, 75, 8, 2, 1, 1, 3), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('primeChannel', 1), ('offChannel', 2)))).setMaxAccess('readonly') if mibBuilder.loadTexts: hh3cDot11RRMChlRptChlType.setStatus('current') if mibBuilder.loadTexts: hh3cDot11RRMChlRptChlType.setDescription('Channel type.') hh3c_dot11_rrm_chl_rpt_chl_qlty = mib_table_column((1, 3, 6, 1, 4, 1, 25506, 2, 75, 8, 2, 1, 1, 4), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('good', 1), ('bad', 2)))).setMaxAccess('readonly') if mibBuilder.loadTexts: hh3cDot11RRMChlRptChlQlty.setStatus('current') if mibBuilder.loadTexts: hh3cDot11RRMChlRptChlQlty.setDescription('Channel quality.') hh3c_dot11_rrm_chl_rpt_nbr_cnt = mib_table_column((1, 3, 6, 1, 4, 1, 25506, 2, 75, 8, 2, 1, 1, 5), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: hh3cDot11RRMChlRptNbrCnt.setStatus('current') if mibBuilder.loadTexts: hh3cDot11RRMChlRptNbrCnt.setDescription('Number of neighbors found on the channel.') hh3c_dot11_rrm_chl_rpt_load = mib_table_column((1, 3, 6, 1, 4, 1, 25506, 2, 75, 8, 2, 1, 1, 6), integer32().subtype(subtypeSpec=value_range_constraint(0, 100))).setUnits('percent').setMaxAccess('readonly') if mibBuilder.loadTexts: hh3cDot11RRMChlRptLoad.setStatus('current') if mibBuilder.loadTexts: hh3cDot11RRMChlRptLoad.setDescription('Load observed on the channel in percentage.') hh3c_dot11_rrm_chl_rpt_utlz = mib_table_column((1, 3, 6, 1, 4, 1, 25506, 2, 75, 8, 2, 1, 1, 7), integer32().subtype(subtypeSpec=value_range_constraint(0, 100))).setUnits('percent').setMaxAccess('readonly') if mibBuilder.loadTexts: hh3cDot11RRMChlRptUtlz.setStatus('current') if mibBuilder.loadTexts: hh3cDot11RRMChlRptUtlz.setDescription('Utilization of the channel in percentage.') hh3c_dot11_rrm_chl_rpt_intrf = mib_table_column((1, 3, 6, 1, 4, 1, 25506, 2, 75, 8, 2, 1, 1, 8), integer32().subtype(subtypeSpec=value_range_constraint(0, 100))).setUnits('percent').setMaxAccess('readonly') if mibBuilder.loadTexts: hh3cDot11RRMChlRptIntrf.setStatus('current') if mibBuilder.loadTexts: hh3cDot11RRMChlRptIntrf.setDescription('Interference observed on the channel in percentage.') hh3c_dot11_rrm_chl_rpt_per = mib_table_column((1, 3, 6, 1, 4, 1, 25506, 2, 75, 8, 2, 1, 1, 9), integer32().subtype(subtypeSpec=value_range_constraint(0, 100))).setUnits('percent').setMaxAccess('readonly') if mibBuilder.loadTexts: hh3cDot11RRMChlRptPER.setStatus('current') if mibBuilder.loadTexts: hh3cDot11RRMChlRptPER.setDescription('Packet error rate observed on the channel in percentage.') hh3c_dot11_rrm_chl_rpt_retry_rate = mib_table_column((1, 3, 6, 1, 4, 1, 25506, 2, 75, 8, 2, 1, 1, 10), integer32().subtype(subtypeSpec=value_range_constraint(0, 100))).setUnits('percent').setMaxAccess('readonly') if mibBuilder.loadTexts: hh3cDot11RRMChlRptRetryRate.setStatus('current') if mibBuilder.loadTexts: hh3cDot11RRMChlRptRetryRate.setDescription('Percentage of retransmission happened on the channel.') hh3c_dot11_rrm_chl_rpt_noise = mib_table_column((1, 3, 6, 1, 4, 1, 25506, 2, 75, 8, 2, 1, 1, 11), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: hh3cDot11RRMChlRptNoise.setStatus('current') if mibBuilder.loadTexts: hh3cDot11RRMChlRptNoise.setDescription('Noise observed on the channel.') hh3c_dot11_rrm_chl_rpt_radar_indtcr = mib_table_column((1, 3, 6, 1, 4, 1, 25506, 2, 75, 8, 2, 1, 1, 12), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('detected', 1), ('notDetected', 2)))).setMaxAccess('readwrite') if mibBuilder.loadTexts: hh3cDot11RRMChlRptRadarIndtcr.setStatus('current') if mibBuilder.loadTexts: hh3cDot11RRMChlRptRadarIndtcr.setDescription('Radar detection status.') hh3c_dot11_rrm_nbr_info_table = mib_table((1, 3, 6, 1, 4, 1, 25506, 2, 75, 8, 2, 2)) if mibBuilder.loadTexts: hh3cDot11RRMNbrInfoTable.setStatus('current') if mibBuilder.loadTexts: hh3cDot11RRMNbrInfoTable.setDescription('This table shows the RRM neighbor information of each radio on all APs.') hh3c_dot11_rrm_nbr_info_entry = mib_table_row((1, 3, 6, 1, 4, 1, 25506, 2, 75, 8, 2, 2, 1)).setIndexNames((0, 'HH3C-DOT11-RRM-MIB', 'hh3cDot11RRMRadioIndex'), (0, 'HH3C-DOT11-RRM-MIB', 'hh3cDot11RrmNbrBSSID')) if mibBuilder.loadTexts: hh3cDot11RRMNbrInfoEntry.setStatus('current') if mibBuilder.loadTexts: hh3cDot11RRMNbrInfoEntry.setDescription('Each entry contains information of RRM neighbor information of the radio on an AP.') hh3c_dot11_rrm_nbr_bssid = mib_table_column((1, 3, 6, 1, 4, 1, 25506, 2, 75, 8, 2, 2, 1, 1), mac_address()) if mibBuilder.loadTexts: hh3cDot11RrmNbrBSSID.setStatus('current') if mibBuilder.loadTexts: hh3cDot11RrmNbrBSSID.setDescription('MAC address of the AP.') hh3c_dot11_rrm_nbr_chl = mib_table_column((1, 3, 6, 1, 4, 1, 25506, 2, 75, 8, 2, 2, 1, 2), hh3c_dot11_channel_scope_type()).setMaxAccess('readonly') if mibBuilder.loadTexts: hh3cDot11RrmNbrChl.setStatus('current') if mibBuilder.loadTexts: hh3cDot11RrmNbrChl.setDescription('Channel number on which the neighbor was found.') hh3c_dot11_rrm_nbr_intrf = mib_table_column((1, 3, 6, 1, 4, 1, 25506, 2, 75, 8, 2, 2, 1, 3), integer32().subtype(subtypeSpec=value_range_constraint(0, 100))).setUnits('percent').setMaxAccess('readonly') if mibBuilder.loadTexts: hh3cDot11RRMNbrIntrf.setStatus('current') if mibBuilder.loadTexts: hh3cDot11RRMNbrIntrf.setDescription('Interference observed on the channel in percentage by neighbor.') hh3c_dot11_rrm_nbr_rssi = mib_table_column((1, 3, 6, 1, 4, 1, 25506, 2, 75, 8, 2, 2, 1, 4), integer32()).setUnits('dBm').setMaxAccess('readonly') if mibBuilder.loadTexts: hh3cDot11RrmNbrRSSI.setStatus('current') if mibBuilder.loadTexts: hh3cDot11RrmNbrRSSI.setDescription('Signal strength of the AP in dBm.') hh3c_dot11_rrm_nbr_type = mib_table_column((1, 3, 6, 1, 4, 1, 25506, 2, 75, 8, 2, 2, 1, 5), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('managed', 1), ('unmanaged', 2)))).setMaxAccess('readonly') if mibBuilder.loadTexts: hh3cDot11RrmNbrType.setStatus('current') if mibBuilder.loadTexts: hh3cDot11RrmNbrType.setDescription('Type of the AP, managed or unmanaged.') hh3c_dot11_rrm_nbr_ssid = mib_table_column((1, 3, 6, 1, 4, 1, 25506, 2, 75, 8, 2, 2, 1, 6), hh3c_dot11_ssid_string_type()).setMaxAccess('readonly') if mibBuilder.loadTexts: hh3cDot11RrmNbrSSID.setStatus('current') if mibBuilder.loadTexts: hh3cDot11RrmNbrSSID.setDescription('SSID of the Neighbor.') hh3c_dot11_rrm_history_table = mib_table((1, 3, 6, 1, 4, 1, 25506, 2, 75, 8, 2, 3)) if mibBuilder.loadTexts: hh3cDot11RRMHistoryTable.setStatus('current') if mibBuilder.loadTexts: hh3cDot11RRMHistoryTable.setDescription('This table shows the details of the latest three channel changes and power changes applied on all APs, including time of change, reason of the change and the channel, power, interference parameters.') hh3c_dot11_rrm_history_entry = mib_table_row((1, 3, 6, 1, 4, 1, 25506, 2, 75, 8, 2, 3, 1)).setIndexNames((0, 'HH3C-DOT11-RRM-MIB', 'hh3cDot11RRMRadioIndex'), (0, 'HH3C-DOT11-RRM-MIB', 'hh3cDot11RRMHistoryId'), (0, 'HH3C-DOT11-RRM-MIB', 'hh3cDot11RRMHistoryRecIndctr')) if mibBuilder.loadTexts: hh3cDot11RRMHistoryEntry.setStatus('current') if mibBuilder.loadTexts: hh3cDot11RRMHistoryEntry.setDescription('Each entry shows the details of channel and power changes.') hh3c_dot11_rrm_history_id = mib_table_column((1, 3, 6, 1, 4, 1, 25506, 2, 75, 8, 2, 3, 1, 1), integer32()) if mibBuilder.loadTexts: hh3cDot11RRMHistoryId.setStatus('current') if mibBuilder.loadTexts: hh3cDot11RRMHistoryId.setDescription('History number of the change.') hh3c_dot11_rrm_history_rec_indctr = mib_table_column((1, 3, 6, 1, 4, 1, 25506, 2, 75, 8, 2, 3, 1, 2), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('before', 1), ('after', 2)))) if mibBuilder.loadTexts: hh3cDot11RRMHistoryRecIndctr.setStatus('current') if mibBuilder.loadTexts: hh3cDot11RRMHistoryRecIndctr.setDescription('History record type of the change.') hh3c_dot11_rrm_history_chl = mib_table_column((1, 3, 6, 1, 4, 1, 25506, 2, 75, 8, 2, 3, 1, 3), hh3c_dot11_channel_scope_type()).setMaxAccess('readonly') if mibBuilder.loadTexts: hh3cDot11RRMHistoryChl.setStatus('current') if mibBuilder.loadTexts: hh3cDot11RRMHistoryChl.setDescription('Channel on which the radio operates before/after the change of channel or power.') hh3c_dot11_rrm_history_pwr = mib_table_column((1, 3, 6, 1, 4, 1, 25506, 2, 75, 8, 2, 3, 1, 4), integer32()).setUnits('dBm').setMaxAccess('readonly') if mibBuilder.loadTexts: hh3cDot11RRMHistoryPwr.setStatus('current') if mibBuilder.loadTexts: hh3cDot11RRMHistoryPwr.setDescription('Power of the radio before/after the change of channel or power.') hh3c_dot11_rrm_history_load = mib_table_column((1, 3, 6, 1, 4, 1, 25506, 2, 75, 8, 2, 3, 1, 5), integer32().subtype(subtypeSpec=value_range_constraint(0, 100))).setUnits('percent').setMaxAccess('readonly') if mibBuilder.loadTexts: hh3cDot11RRMHistoryLoad.setStatus('current') if mibBuilder.loadTexts: hh3cDot11RRMHistoryLoad.setDescription('Load observed on the radio in percentage before/after the change of channel or power.') hh3c_dot11_rrm_history_utlz = mib_table_column((1, 3, 6, 1, 4, 1, 25506, 2, 75, 8, 2, 3, 1, 6), integer32().subtype(subtypeSpec=value_range_constraint(0, 100))).setUnits('percent').setMaxAccess('readonly') if mibBuilder.loadTexts: hh3cDot11RRMHistoryUtlz.setStatus('current') if mibBuilder.loadTexts: hh3cDot11RRMHistoryUtlz.setDescription('Utilization of the radio in percentage before/after the change of channel or power.') hh3c_dot11_rrm_history_intrf = mib_table_column((1, 3, 6, 1, 4, 1, 25506, 2, 75, 8, 2, 3, 1, 7), integer32().subtype(subtypeSpec=value_range_constraint(0, 100))).setUnits('percent').setMaxAccess('readonly') if mibBuilder.loadTexts: hh3cDot11RRMHistoryIntrf.setStatus('current') if mibBuilder.loadTexts: hh3cDot11RRMHistoryIntrf.setDescription('Interference observed on the radio in percentage before/after the change of channel or power.') hh3c_dot11_rrm_history_noise = mib_table_column((1, 3, 6, 1, 4, 1, 25506, 2, 75, 8, 2, 3, 1, 8), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: hh3cDot11RRMHistoryNoise.setStatus('current') if mibBuilder.loadTexts: hh3cDot11RRMHistoryNoise.setDescription('Noise observed on the radio before/after the change of channel or power.') hh3c_dot11_rrm_history_per = mib_table_column((1, 3, 6, 1, 4, 1, 25506, 2, 75, 8, 2, 3, 1, 9), integer32().subtype(subtypeSpec=value_range_constraint(0, 100))).setUnits('percent').setMaxAccess('readonly') if mibBuilder.loadTexts: hh3cDot11RRMHistoryPER.setStatus('current') if mibBuilder.loadTexts: hh3cDot11RRMHistoryPER.setDescription('Packet error rate observed on the radio in percentage before/after the change of channel or power.') hh3c_dot11_rrm_history_retry_rate = mib_table_column((1, 3, 6, 1, 4, 1, 25506, 2, 75, 8, 2, 3, 1, 10), integer32().subtype(subtypeSpec=value_range_constraint(0, 100))).setUnits('percent').setMaxAccess('readonly') if mibBuilder.loadTexts: hh3cDot11RRMHistoryRetryRate.setStatus('current') if mibBuilder.loadTexts: hh3cDot11RRMHistoryRetryRate.setDescription('Percentage of retransmission happened on the radio before/after the change of channel or power.') hh3c_dot11_rrm_history_chg_reason = mib_table_column((1, 3, 6, 1, 4, 1, 25506, 2, 75, 8, 2, 3, 1, 11), bits().clone(namedValues=named_values(('others', 0), ('coverage', 1), ('radar', 2), ('retransmission', 3), ('packetsDiscarded', 4), ('interference', 5)))).setMaxAccess('readonly') if mibBuilder.loadTexts: hh3cDot11RRMHistoryChgReason.setStatus('current') if mibBuilder.loadTexts: hh3cDot11RRMHistoryChgReason.setDescription('Reason for the change of channel or power. The various bit positions are: |0 |Others | |1 |Coverage | |2 |Radar | |3 |Retransmission | |4 |Packets discarded | |5 |Interference | 0 is returned when the history record type is after.') hh3c_dot11_rrm_history_chg_date_time = mib_table_column((1, 3, 6, 1, 4, 1, 25506, 2, 75, 8, 2, 3, 1, 12), date_and_time()).setMaxAccess('readonly') if mibBuilder.loadTexts: hh3cDot11RRMHistoryChgDateTime.setStatus('current') if mibBuilder.loadTexts: hh3cDot11RRMHistoryChgDateTime.setDescription('The time when the channel or power change occurred.') hh3c_dot11_rrm_notify_group = mib_identifier((1, 3, 6, 1, 4, 1, 25506, 2, 75, 8, 3)) hh3c_dot11_rrm_chl_qlty_notifications = mib_identifier((1, 3, 6, 1, 4, 1, 25506, 2, 75, 8, 3, 1)) hh3c_dot11_rrm_chl_qlty_ntf_prefix = mib_identifier((1, 3, 6, 1, 4, 1, 25506, 2, 75, 8, 3, 1, 0)) hh3c_dot11_rrm_intrf_limit = notification_type((1, 3, 6, 1, 4, 1, 25506, 2, 75, 8, 3, 1, 0, 1)).setObjects(('HH3C-DOT11-RRM-MIB', 'hh3cDot11RRMChlRptIntrf')) if mibBuilder.loadTexts: hh3cDot11RRMIntrfLimit.setStatus('current') if mibBuilder.loadTexts: hh3cDot11RRMIntrfLimit.setDescription('This notification will be sent when interference on the radio exceeds the limit.') hh3c_dot11_rrmper_limit = notification_type((1, 3, 6, 1, 4, 1, 25506, 2, 75, 8, 3, 1, 0, 2)).setObjects(('HH3C-DOT11-RRM-MIB', 'hh3cDot11RRMChlRptPER')) if mibBuilder.loadTexts: hh3cDot11RRMPERLimit.setStatus('current') if mibBuilder.loadTexts: hh3cDot11RRMPERLimit.setDescription('This notification will be sent when packet error rate on the radio exceeds the limit.') hh3c_dot11_rrm_noise_limit = notification_type((1, 3, 6, 1, 4, 1, 25506, 2, 75, 8, 3, 1, 0, 3)).setObjects(('HH3C-DOT11-RRM-MIB', 'hh3cDot11RRMChlRptNoise')) if mibBuilder.loadTexts: hh3cDot11RRMNoiseLimit.setStatus('current') if mibBuilder.loadTexts: hh3cDot11RRMNoiseLimit.setDescription('This notification will be sent when noise on the radio exceeds the limit.') hh3c_dot11_rrm_res_chg_notifications = mib_identifier((1, 3, 6, 1, 4, 1, 25506, 2, 75, 8, 3, 2)) hh3c_dot11_rrm_res_chg_ntf_prefix = mib_identifier((1, 3, 6, 1, 4, 1, 25506, 2, 75, 8, 3, 2, 0)) hh3c_dot11_rrm_power_change = notification_type((1, 3, 6, 1, 4, 1, 25506, 2, 75, 8, 3, 2, 0, 1)).setObjects(('HH3C-DOT11-RRM-MIB', 'hh3cDot11RRMRadioIndex'), ('HH3C-DOT11-RRM-MIB', 'hh3cDot11NewPower'), ('HH3C-DOT11-RRM-MIB', 'hh3cDot11OldPower')) if mibBuilder.loadTexts: hh3cDot11RRMPowerChange.setStatus('current') if mibBuilder.loadTexts: hh3cDot11RRMPowerChange.setDescription('This notification will be sent when power changed on the radio automatically.') hh3c_dot11_rrm_notifications_var = mib_identifier((1, 3, 6, 1, 4, 1, 25506, 2, 75, 8, 3, 3)) hh3c_dot11_new_power = mib_scalar((1, 3, 6, 1, 4, 1, 25506, 2, 75, 8, 3, 3, 1), integer32()).setMaxAccess('accessiblefornotify') if mibBuilder.loadTexts: hh3cDot11NewPower.setStatus('current') if mibBuilder.loadTexts: hh3cDot11NewPower.setDescription('Power of the radio after the change of power.') hh3c_dot11_old_power = mib_scalar((1, 3, 6, 1, 4, 1, 25506, 2, 75, 8, 3, 3, 2), integer32()).setMaxAccess('accessiblefornotify') if mibBuilder.loadTexts: hh3cDot11OldPower.setStatus('current') if mibBuilder.loadTexts: hh3cDot11OldPower.setDescription('Power of the radio before the change of power.') hh3c_dot11_monitor_detected_group = mib_identifier((1, 3, 6, 1, 4, 1, 25506, 2, 75, 8, 4)) hh3c_dot11_monitor_detected_dev_table = mib_table((1, 3, 6, 1, 4, 1, 25506, 2, 75, 8, 4, 1)) if mibBuilder.loadTexts: hh3cDot11MonitorDetectedDevTable.setStatus('current') if mibBuilder.loadTexts: hh3cDot11MonitorDetectedDevTable.setDescription('This table shows the devices of AP detected') hh3c_dot11_monitor_detected_dev_entry = mib_table_row((1, 3, 6, 1, 4, 1, 25506, 2, 75, 8, 4, 1, 1)).setIndexNames((0, 'HH3C-DOT11-RRM-MIB', 'hh3cDot11MonitorDevMAC'), (0, 'HH3C-DOT11-REF-MIB', 'hh3cDot11APElementIndex')) if mibBuilder.loadTexts: hh3cDot11MonitorDetectedDevEntry.setStatus('current') if mibBuilder.loadTexts: hh3cDot11MonitorDetectedDevEntry.setDescription('Each entry contains information of detected devices.') hh3c_dot11_monitor_dev_mac = mib_table_column((1, 3, 6, 1, 4, 1, 25506, 2, 75, 8, 4, 1, 1, 1), mac_address()) if mibBuilder.loadTexts: hh3cDot11MonitorDevMAC.setStatus('current') if mibBuilder.loadTexts: hh3cDot11MonitorDevMAC.setDescription('Represents MAC address of the device detected.') hh3c_dot11_monitor_dev_type = mib_table_column((1, 3, 6, 1, 4, 1, 25506, 2, 75, 8, 4, 1, 1, 2), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3, 4, 5))).clone(namedValues=named_values(('client', 1), ('ap', 2), ('adhoc', 3), ('wirelessBridge', 4), ('unknown', 5)))).setMaxAccess('readonly') if mibBuilder.loadTexts: hh3cDot11MonitorDevType.setStatus('current') if mibBuilder.loadTexts: hh3cDot11MonitorDevType.setDescription('Represents type of the device detected.') hh3c_dot11_monitor_dev_vendor = mib_table_column((1, 3, 6, 1, 4, 1, 25506, 2, 75, 8, 4, 1, 1, 3), octet_string()).setMaxAccess('readonly') if mibBuilder.loadTexts: hh3cDot11MonitorDevVendor.setStatus('current') if mibBuilder.loadTexts: hh3cDot11MonitorDevVendor.setDescription('Represents vendor of the detected device.') hh3c_dot11_monitor_dev_ssid = mib_table_column((1, 3, 6, 1, 4, 1, 25506, 2, 75, 8, 4, 1, 1, 4), octet_string()).setMaxAccess('readonly') if mibBuilder.loadTexts: hh3cDot11MonitorDevSSID.setStatus('current') if mibBuilder.loadTexts: hh3cDot11MonitorDevSSID.setDescription('Represents the service set identifier for the ESS of the device which type is ap or adhoc.') hh3c_dot11_monitor_dev_bssid = mib_table_column((1, 3, 6, 1, 4, 1, 25506, 2, 75, 8, 4, 1, 1, 5), mac_address()).setMaxAccess('readonly') if mibBuilder.loadTexts: hh3cDot11MonitorDevBSSID.setStatus('current') if mibBuilder.loadTexts: hh3cDot11MonitorDevBSSID.setDescription('Represents the basic service set identifier of the detected device.') hh3c_dot11_monitor_dev_channel = mib_table_column((1, 3, 6, 1, 4, 1, 25506, 2, 75, 8, 4, 1, 1, 6), hh3c_dot11_channel_scope_type()).setMaxAccess('readonly') if mibBuilder.loadTexts: hh3cDot11MonitorDevChannel.setStatus('current') if mibBuilder.loadTexts: hh3cDot11MonitorDevChannel.setDescription('Represents the channel in which the device was last detected. AP will choose the channel which has maximum signal strength as effective channel, as there is interference between adjacent channels.') hh3c_dot11_monitor_radio_id = mib_table_column((1, 3, 6, 1, 4, 1, 25506, 2, 75, 8, 4, 1, 1, 7), hh3c_dot11_radio_scope_type()).setMaxAccess('readonly') if mibBuilder.loadTexts: hh3cDot11MonitorRadioId.setStatus('current') if mibBuilder.loadTexts: hh3cDot11MonitorRadioId.setDescription('Represents the radio ID of the AP that detected the device.') hh3c_dot11_monitor_dev_max_rssi = mib_table_column((1, 3, 6, 1, 4, 1, 25506, 2, 75, 8, 4, 1, 1, 8), integer32()).setUnits('dbm').setMaxAccess('readonly') if mibBuilder.loadTexts: hh3cDot11MonitorDevMaxRSSI.setStatus('current') if mibBuilder.loadTexts: hh3cDot11MonitorDevMaxRSSI.setDescription('Represents the maximum detected RSSI of the device in a scan report cycle.') hh3c_dot11_monitor_dev_beacon_intvl = mib_table_column((1, 3, 6, 1, 4, 1, 25506, 2, 75, 8, 4, 1, 1, 9), integer32()).setUnits('millisecond').setMaxAccess('readonly') if mibBuilder.loadTexts: hh3cDot11MonitorDevBeaconIntvl.setStatus('current') if mibBuilder.loadTexts: hh3cDot11MonitorDevBeaconIntvl.setDescription('Represents the beacon interval for the detected device(not include the device which type is client).') hh3c_dot11_monitor_dev_fst_dct_time = mib_table_column((1, 3, 6, 1, 4, 1, 25506, 2, 75, 8, 4, 1, 1, 10), date_and_time()).setMaxAccess('readonly') if mibBuilder.loadTexts: hh3cDot11MonitorDevFstDctTime.setStatus('current') if mibBuilder.loadTexts: hh3cDot11MonitorDevFstDctTime.setDescription('Represents the time at which the device was first detected.') hh3c_dot11_monitor_dev_lst_dct_time = mib_table_column((1, 3, 6, 1, 4, 1, 25506, 2, 75, 8, 4, 1, 1, 11), date_and_time()).setMaxAccess('readonly') if mibBuilder.loadTexts: hh3cDot11MonitorDevLstDctTime.setStatus('current') if mibBuilder.loadTexts: hh3cDot11MonitorDevLstDctTime.setDescription('Represents the time at which the device was detected last time.') hh3c_dot11_monitor_dev_clear = mib_table_column((1, 3, 6, 1, 4, 1, 25506, 2, 75, 8, 4, 1, 1, 12), truth_value()).setMaxAccess('readwrite') if mibBuilder.loadTexts: hh3cDot11MonitorDevClear.setStatus('current') if mibBuilder.loadTexts: hh3cDot11MonitorDevClear.setDescription('This object is used to clear the information of the device detected in the WLAN. It will return false for get operation.') hh3c_dot11_monitor_dev_snr = mib_table_column((1, 3, 6, 1, 4, 1, 25506, 2, 75, 8, 4, 1, 1, 13), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: hh3cDot11MonitorDevSNR.setStatus('current') if mibBuilder.loadTexts: hh3cDot11MonitorDevSNR.setDescription('Represents the SNR of the device in a scan report cycle.') mibBuilder.exportSymbols('HH3C-DOT11-RRM-MIB', hh3cDot11RRMSDRadioGroupEntry=hh3cDot11RRMSDRadioGroupEntry, hh3cDot11MonitorDetectedDevTable=hh3cDot11MonitorDetectedDevTable, hh3cDot11RrmNbrType=hh3cDot11RrmNbrType, hh3cDot11RRMAPCfgTable=hh3cDot11RRMAPCfgTable, hh3cDot11RRMStaIntfThreshold=hh3cDot11RRMStaIntfThreshold, hh3cDot11RrmNbrChl=hh3cDot11RrmNbrChl, hh3cDot11RRMHistoryEntry=hh3cDot11RRMHistoryEntry, hh3cDot11RRMCfgChlState=hh3cDot11RRMCfgChlState, hh3cDot11MonitorDevClear=hh3cDot11MonitorDevClear, hh3cDot11RRMNotifyGroup=hh3cDot11RRMNotifyGroup, hh3cDot11MonitorDevSSID=hh3cDot11MonitorDevSSID, hh3cDot11RRMHistoryChl=hh3cDot11RRMHistoryChl, hh3cDot11MonitorDevSNR=hh3cDot11MonitorDevSNR, hh3cDot11MonitorDetectedDevEntry=hh3cDot11MonitorDetectedDevEntry, hh3cDot11MonitorDetectedGroup=hh3cDot11MonitorDetectedGroup, hh3cDot11RRMConfigGroup=hh3cDot11RRMConfigGroup, hh3cDot11MonitorDevVendor=hh3cDot11MonitorDevVendor, hh3cDot11RRMResChgNtfPrefix=hh3cDot11RRMResChgNtfPrefix, hh3cDot11RRMCfgPwrState=hh3cDot11RRMCfgPwrState, hh3cDot11RRMChlRptLoad=hh3cDot11RRMChlRptLoad, hh3cDot11RRMCfgNoiseThres=hh3cDot11RRMCfgNoiseThres, hh3cDot11RRMChlRptNbrCnt=hh3cDot11RRMChlRptNbrCnt, hh3cDot11RRMChlRptRadarIndtcr=hh3cDot11RRMChlRptRadarIndtcr, hh3cDot11RRMHistoryNoise=hh3cDot11RRMHistoryNoise, hh3cDot11RRMHistoryChgDateTime=hh3cDot11RRMHistoryChgDateTime, hh3cDot11RRMPowerChange=hh3cDot11RRMPowerChange, hh3cDot11RRMHistoryChgReason=hh3cDot11RRMHistoryChgReason, hh3cDot11RRMHistoryId=hh3cDot11RRMHistoryId, hh3cDot11RRMHistoryRetryRate=hh3cDot11RRMHistoryRetryRate, hh3cDot11MonitorRadioId=hh3cDot11MonitorRadioId, hh3cDot11RRMCfgToleranceFctr=hh3cDot11RRMCfgToleranceFctr, hh3cDot11RRMCfgPERThres=hh3cDot11RRMCfgPERThres, hh3cDot11RRMChlQltyNotifications=hh3cDot11RRMChlQltyNotifications, hh3cDot11MonitorDevMAC=hh3cDot11MonitorDevMAC, hh3cDot11RRMRadioCfgEntry=hh3cDot11RRMRadioCfgEntry, hh3cDot11RRMResChgNotifications=hh3cDot11RRMResChgNotifications, hh3cDot11RRMSDRadioGroupId=hh3cDot11RRMSDRadioGroupId, hh3cDot11RRMIntrfLimit=hh3cDot11RRMIntrfLimit, hh3cDot11RRMSDRdGrpChlHolddownTm=hh3cDot11RRMSDRdGrpChlHolddownTm, hh3cDot11RRMHistoryPwr=hh3cDot11RRMHistoryPwr, hh3cDot11RRMCfgPwrMode=hh3cDot11RRMCfgPwrMode, hh3cDot11RRM11nSuptMaxMcs=hh3cDot11RRM11nSuptMaxMcs, hh3cDot11RRMChlRptPER=hh3cDot11RRMChlRptPER, hh3cDot11RRMCfgIntrvl=hh3cDot11RRMCfgIntrvl, hh3cDot11RRMRadioType=hh3cDot11RRMRadioType, hh3cDot11MonitorDevLstDctTime=hh3cDot11MonitorDevLstDctTime, hh3cDot11RRMHistoryRecIndctr=hh3cDot11RRMHistoryRecIndctr, hh3cDot11RRM11aSpectrumManag=hh3cDot11RRM11aSpectrumManag, hh3cDot11MonitorDevChannel=hh3cDot11MonitorDevChannel, hh3cDot11RRMNotificationsVar=hh3cDot11RRMNotificationsVar, hh3cDot11RRMNbrIntrf=hh3cDot11RRMNbrIntrf, hh3cDot11RRMChlRptChlNum=hh3cDot11RRMChlRptChlNum, hh3cDot11RRMPwrProntoRadioElmt=hh3cDot11RRMPwrProntoRadioElmt, hh3cDot11RrmNbrBSSID=hh3cDot11RrmNbrBSSID, PYSNMP_MODULE_ID=hh3cDot11RRM, hh3cDot11RRMAPWorkMode=hh3cDot11RRMAPWorkMode, hh3cDot11RRMChlRptChlType=hh3cDot11RRMChlRptChlType, hh3cDot11RRMAdjChlIntfTrapThhd=hh3cDot11RRMAdjChlIntfTrapThhd, hh3cDot11RRMPERLimit=hh3cDot11RRMPERLimit, hh3cDot11RRMHistoryIntrf=hh3cDot11RRMHistoryIntrf, hh3cDot11RRMNbrInfoEntry=hh3cDot11RRMNbrInfoEntry, hh3cDot11RRM11nMadtMaxMcs=hh3cDot11RRM11nMadtMaxMcs, hh3cDot11RRMAPCfgEntry=hh3cDot11RRMAPCfgEntry, hh3cDot11RrmNbrSSID=hh3cDot11RrmNbrSSID, hh3cDot11MonitorDevType=hh3cDot11MonitorDevType, hh3cDot11StaInterfNumThreshhd=hh3cDot11StaInterfNumThreshhd, hh3cDot11RRMSDRdGrpPwrHolddownTm=hh3cDot11RRMSDRdGrpPwrHolddownTm, hh3cDot11RRMAPCfg2Table=hh3cDot11RRMAPCfg2Table, hh3cDot11RRM11gProtect=hh3cDot11RRM11gProtect, hh3cDot11MonitorDevBeaconIntvl=hh3cDot11MonitorDevBeaconIntvl, hh3cDot11RRMScanRptIntvel=hh3cDot11RRMScanRptIntvel, hh3cDot11RRMCfgAdjacencyFctr=hh3cDot11RRMCfgAdjacencyFctr, hh3cDot11RRMChlQltyNtfPrefix=hh3cDot11RRMChlQltyNtfPrefix, hh3cDot11RRM11aPwrConstrt=hh3cDot11RRM11aPwrConstrt, hh3cDot11RRMAPSerialID=hh3cDot11RRMAPSerialID, hh3cDot11RRMSDRdGroupRowStatus=hh3cDot11RRMSDRdGroupRowStatus, hh3cDot11RRMNoiseLimit=hh3cDot11RRMNoiseLimit, hh3cDot11RRMChlRptTable=hh3cDot11RRMChlRptTable, hh3cDot11RRMHistoryLoad=hh3cDot11RRMHistoryLoad, hh3cDot11RRMChlRptChlQlty=hh3cDot11RRMChlRptChlQlty, hh3cDot11RRMNbrInfoTable=hh3cDot11RRMNbrInfoTable, hh3cDot11RrmNbrRSSI=hh3cDot11RrmNbrRSSI, hh3cDot11RRMChlRptNoise=hh3cDot11RRMChlRptNoise, hh3cDot11OldPower=hh3cDot11OldPower, hh3cDot11RRMChlProntoRadioElmt=hh3cDot11RRMChlProntoRadioElmt, hh3cDot11RRMChlRptRetryRate=hh3cDot11RRMChlRptRetryRate, hh3cDot11RRMHistoryPER=hh3cDot11RRMHistoryPER, hh3cDot11RRMChlRptIntrf=hh3cDot11RRMChlRptIntrf, hh3cDot11RRMSDRadioGroupDesc=hh3cDot11RRMSDRadioGroupDesc, hh3cDot11RRMAutoChlAvoid11h=hh3cDot11RRMAutoChlAvoid11h, hh3cDot11RRMHistoryTable=hh3cDot11RRMHistoryTable, hh3cDot11RRMRadioCfgTable=hh3cDot11RRMRadioCfgTable, hh3cDot11RRMScanChl=hh3cDot11RRMScanChl, hh3cDot11RRMHistoryUtlz=hh3cDot11RRMHistoryUtlz, hh3cDot11APInterfNumThreshhd=hh3cDot11APInterfNumThreshhd, hh3cDot11MonitorDevMaxRSSI=hh3cDot11MonitorDevMaxRSSI, hh3cDot11RRMRadioIndex=hh3cDot11RRMRadioIndex, hh3cDot11MonitorDevBSSID=hh3cDot11MonitorDevBSSID, hh3cDot11RRMSDRadioGroupTable=hh3cDot11RRMSDRadioGroupTable, hh3cDot11RRMChlRptUtlz=hh3cDot11RRMChlRptUtlz, hh3cDot11RRMChlRptEntry=hh3cDot11RRMChlRptEntry, hh3cDot11NewPower=hh3cDot11NewPower, hh3cDot11RRM=hh3cDot11RRM, hh3cDot11RRMCoChlIntfTrapThhd=hh3cDot11RRMCoChlIntfTrapThhd, hh3cDot11MonitorDevFstDctTime=hh3cDot11MonitorDevFstDctTime, hh3cDot11RRMCfgIntrfThres=hh3cDot11RRMCfgIntrfThres, hh3cDot11RRMGlobalCfgPara=hh3cDot11RRMGlobalCfgPara, hh3cDot11RRMDetectGroup=hh3cDot11RRMDetectGroup, hh3cDot11RRMCfgChlMode=hh3cDot11RRMCfgChlMode, hh3cDot11RRMAPCfg2Entry=hh3cDot11RRMAPCfg2Entry, hh3cDot11RRMAPIntfThreshold=hh3cDot11RRMAPIntfThreshold)
change = 91 coin = 25 print('how many quarters in 91 cents? 3') print('how much change is left after 3 quarters taken out of 91cents? 16') print(91 / 25, 'is not the awnser to either question') print(91//25) print(91%25)
change = 91 coin = 25 print('how many quarters in 91 cents? 3') print('how much change is left after 3 quarters taken out of 91cents? 16') print(91 / 25, 'is not the awnser to either question') print(91 // 25) print(91 % 25)
a = input("Enter a number: ") prev = None flag = True if len(a)==1: flag = False for elm in a: if prev == None: prev = int(elm) else: if prev > int(elm): prev = int(elm) else: flag = False break print(flag)
a = input('Enter a number: ') prev = None flag = True if len(a) == 1: flag = False for elm in a: if prev == None: prev = int(elm) elif prev > int(elm): prev = int(elm) else: flag = False break print(flag)
BATTERY_UUID = "0000ec08-0000-1000-8000-00805f9b34fb" DEVICE_USER_NAME_UUID = "0000ec01-0000-1000-8000-00805f9b34fb" UPDATED_AT_UUID = "0000ec09-0000-1000-8000-00805f9b34fb" MODEL_NUMBER_UUID = "00002a24-0000-1000-8000-00805f9b34fb" MANUFACTURER_UUID = "00002a29-0000-1000-8000-00805f9b34fb" VALVE_MANUAL_SETTINGS_UUID = "0000ec0b-0000-1000-8000-00805f9b34fb" VALVE_ON_OFF_UUID = "0000ec0a-0000-1000-8000-00805f9b34fb" VALVE_MANUAL_STATES_UUID = "0000ec06-0000-1000-8000-00805f9b34fb" VALVE_0_MODE_UUID = "0000ec0f-0000-1000-8000-00805f9b34fb" VALVE_1_MODE_UUID = "0000ec10-0000-1000-8000-00805f9b34fb" VALVE_2_MODE_UUID = "0000ec11-0000-1000-8000-00805f9b34fb" VALVE_3_MODE_UUID = "0000ec12-0000-1000-8000-00805f9b34fb" # Manufacturers EDEN = "Eden" MELNOR = "Melnor" MODEL_BRAND_MAP = { "5901": EDEN, "5902": EDEN, "5903": EDEN, "5904": EDEN, "5905": EDEN, "5906": EDEN, "5907": MELNOR, "5908": MELNOR, "5909": MELNOR, "5910": MELNOR, "5911": MELNOR, "5912": MELNOR, "5913": EDEN, "5914": EDEN, "5915": EDEN, "5916": EDEN, "5917": EDEN, "5918": EDEN, } MODEL_NAME_MAP = { "5901": "25443", "5902": "25439", "5903": "25442", "5904": "25438", "5905": "25441", "5906": "25437", "5907": "93281", "5908": "93280", "5909": "93101", "5910": "93100", "5911": "93016", "5912": "93015", "5913": "25443", "5914": "25439", "5915": "25442", "5916": "25438", "5917": "25441", "5918": "25437", } MODEL_SENSOR_MAP = { "5901": True, "5902": False, "5903": True, "5904": False, "5905": True, "5906": False, "5907": True, "5908": False, "5909": True, "5910": False, "5911": True, "5912": False, "5913": True, "5914": False, "5915": True, "5916": False, "5917": True, "5918": False, } MODEL_VALVE_MAP = { "5901": 4, "5902": 4, "5903": 2, "5904": 2, "5905": 1, "5906": 1, "5907": 4, "5908": 4, "5909": 2, "5910": 2, "5911": 1, "5912": 1, "5913": 4, "5914": 4, "5915": 2, "5916": 2, "5917": 1, "5918": 1, }
battery_uuid = '0000ec08-0000-1000-8000-00805f9b34fb' device_user_name_uuid = '0000ec01-0000-1000-8000-00805f9b34fb' updated_at_uuid = '0000ec09-0000-1000-8000-00805f9b34fb' model_number_uuid = '00002a24-0000-1000-8000-00805f9b34fb' manufacturer_uuid = '00002a29-0000-1000-8000-00805f9b34fb' valve_manual_settings_uuid = '0000ec0b-0000-1000-8000-00805f9b34fb' valve_on_off_uuid = '0000ec0a-0000-1000-8000-00805f9b34fb' valve_manual_states_uuid = '0000ec06-0000-1000-8000-00805f9b34fb' valve_0_mode_uuid = '0000ec0f-0000-1000-8000-00805f9b34fb' valve_1_mode_uuid = '0000ec10-0000-1000-8000-00805f9b34fb' valve_2_mode_uuid = '0000ec11-0000-1000-8000-00805f9b34fb' valve_3_mode_uuid = '0000ec12-0000-1000-8000-00805f9b34fb' eden = 'Eden' melnor = 'Melnor' model_brand_map = {'5901': EDEN, '5902': EDEN, '5903': EDEN, '5904': EDEN, '5905': EDEN, '5906': EDEN, '5907': MELNOR, '5908': MELNOR, '5909': MELNOR, '5910': MELNOR, '5911': MELNOR, '5912': MELNOR, '5913': EDEN, '5914': EDEN, '5915': EDEN, '5916': EDEN, '5917': EDEN, '5918': EDEN} model_name_map = {'5901': '25443', '5902': '25439', '5903': '25442', '5904': '25438', '5905': '25441', '5906': '25437', '5907': '93281', '5908': '93280', '5909': '93101', '5910': '93100', '5911': '93016', '5912': '93015', '5913': '25443', '5914': '25439', '5915': '25442', '5916': '25438', '5917': '25441', '5918': '25437'} model_sensor_map = {'5901': True, '5902': False, '5903': True, '5904': False, '5905': True, '5906': False, '5907': True, '5908': False, '5909': True, '5910': False, '5911': True, '5912': False, '5913': True, '5914': False, '5915': True, '5916': False, '5917': True, '5918': False} model_valve_map = {'5901': 4, '5902': 4, '5903': 2, '5904': 2, '5905': 1, '5906': 1, '5907': 4, '5908': 4, '5909': 2, '5910': 2, '5911': 1, '5912': 1, '5913': 4, '5914': 4, '5915': 2, '5916': 2, '5917': 1, '5918': 1}
# CSC 110 - Practice Activity #2 # Tip Calculator # Section 03 # Justin Clark # 1/14/2020 # input billAmountEntered = float(input('Enter bill amount $: ')) tipPercentEntered = float(input('Enter tip %: ')) # processing tipCalculated = billAmountEntered * (tipPercentEntered / 100) amountToPay = billAmountEntered + tipCalculated # output (build receipt): receipt = \ '--------------------------' + '\n' + \ 'Receipt\n' \ '-------------------' + '\n' + \ 'Bill Entered: ${:.2f}'.format(billAmountEntered) + '\n' + \ 'Tip Entered: {}%'.format(tipPercentEntered) + '\n' + \ '-------------------' + '\n' + \ 'Tip Calculated: ${:.2f}'.format(tipCalculated) + '\n' + \ 'Amount Owed: ${:.2f}'.format(amountToPay) + '\n' + \ '--------------------------' print(receipt)
bill_amount_entered = float(input('Enter bill amount $: ')) tip_percent_entered = float(input('Enter tip %: ')) tip_calculated = billAmountEntered * (tipPercentEntered / 100) amount_to_pay = billAmountEntered + tipCalculated receipt = '--------------------------' + '\n' + 'Receipt\n-------------------' + '\n' + 'Bill Entered: ${:.2f}'.format(billAmountEntered) + '\n' + 'Tip Entered: {}%'.format(tipPercentEntered) + '\n' + '-------------------' + '\n' + 'Tip Calculated: ${:.2f}'.format(tipCalculated) + '\n' + 'Amount Owed: ${:.2f}'.format(amountToPay) + '\n' + '--------------------------' print(receipt)
# -*- coding: utf-8 -*- __version__ = (1, 0, 0) default_app_config = "taiga_contrib_fan.apps.TaigaContribFanAppConfig"
__version__ = (1, 0, 0) default_app_config = 'taiga_contrib_fan.apps.TaigaContribFanAppConfig'
i = 0 n = int(input()) while (n > 0): i += n n -= 1 print('Sum is',i)
i = 0 n = int(input()) while n > 0: i += n n -= 1 print('Sum is', i)
class Point: def __init__(self, x, y): self._cluster = 0 # Not classified yet self._visited = False self._x = x self._y = y def get_cluster(self): return self._cluster def set_cluster(self, cluster): self._cluster = cluster def get_values(self): return (self._x, self._y) def is_visited(self): return self._visited def visit(self): self._visited = True # Point.py
class Point: def __init__(self, x, y): self._cluster = 0 self._visited = False self._x = x self._y = y def get_cluster(self): return self._cluster def set_cluster(self, cluster): self._cluster = cluster def get_values(self): return (self._x, self._y) def is_visited(self): return self._visited def visit(self): self._visited = True
#! /usr/bin/env python3 def add_verticle(a, b) : global verticles if a in verticles : verticles[a].append(b) else : verticles[a] = [b] return verticles def all_paths_util(u, path = []) : global verticles if u in path and not u.upper() == u : return [] path.append(u) if u == 'end': return [path] paths = [] for nextCave in verticles[u]: paths += all_paths_util(nextCave, path[:]) return paths verticles = {} for line in open("input") : a, b = line.strip().split('-') if b != 'start' : verticles = add_verticle(a, b) verticles = add_verticle(b, a) else : verticles = add_verticle(b, a) print(len(all_paths_util('start')))
def add_verticle(a, b): global verticles if a in verticles: verticles[a].append(b) else: verticles[a] = [b] return verticles def all_paths_util(u, path=[]): global verticles if u in path and (not u.upper() == u): return [] path.append(u) if u == 'end': return [path] paths = [] for next_cave in verticles[u]: paths += all_paths_util(nextCave, path[:]) return paths verticles = {} for line in open('input'): (a, b) = line.strip().split('-') if b != 'start': verticles = add_verticle(a, b) verticles = add_verticle(b, a) else: verticles = add_verticle(b, a) print(len(all_paths_util('start')))
class Solution: def totalHammingDistance(self, nums: List[int]) -> int: total = 0 for b in zip(*map('{:030b}'.format, nums)): zeros = b.count('0') total += zeros * (len(b) - zeros) return total
class Solution: def total_hamming_distance(self, nums: List[int]) -> int: total = 0 for b in zip(*map('{:030b}'.format, nums)): zeros = b.count('0') total += zeros * (len(b) - zeros) return total
# # PySNMP MIB module HUAWEI-VO-GENERAL-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/HUAWEI-VO-GENERAL-MIB # Produced by pysmi-0.3.4 at Wed May 1 13:49:30 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") ValueRangeConstraint, ConstraintsUnion, SingleValueConstraint, ConstraintsIntersection, ValueSizeConstraint = mibBuilder.importSymbols("ASN1-REFINEMENT", "ValueRangeConstraint", "ConstraintsUnion", "SingleValueConstraint", "ConstraintsIntersection", "ValueSizeConstraint") voice, = mibBuilder.importSymbols("HUAWEI-3COM-OID-MIB", "voice") ModuleCompliance, NotificationGroup = mibBuilder.importSymbols("SNMPv2-CONF", "ModuleCompliance", "NotificationGroup") TimeTicks, NotificationType, ObjectIdentity, Unsigned32, Integer32, MibScalar, MibTable, MibTableRow, MibTableColumn, ModuleIdentity, IpAddress, iso, Bits, Counter64, MibIdentifier, Counter32, Gauge32 = mibBuilder.importSymbols("SNMPv2-SMI", "TimeTicks", "NotificationType", "ObjectIdentity", "Unsigned32", "Integer32", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "ModuleIdentity", "IpAddress", "iso", "Bits", "Counter64", "MibIdentifier", "Counter32", "Gauge32") TextualConvention, DisplayString = mibBuilder.importSymbols("SNMPv2-TC", "TextualConvention", "DisplayString") hwVoiceGeneralMIB = ModuleIdentity((1, 3, 6, 1, 4, 1, 2011, 5, 25, 1, 1)) hwVoiceGeneralMIB.setRevisions(('2004-04-08 13:45',)) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): if mibBuilder.loadTexts: hwVoiceGeneralMIB.setRevisionsDescriptions(('',)) if mibBuilder.loadTexts: hwVoiceGeneralMIB.setLastUpdated('200410200000Z') if mibBuilder.loadTexts: hwVoiceGeneralMIB.setOrganization('Huawei-3COM Technologies Co., Ltd.') if mibBuilder.loadTexts: hwVoiceGeneralMIB.setContactInfo('PLAT Team Huawei 3Com Technologies co.,Ltd. Shang-Di Information Industry Base, Hai-Dian District Beijing P.R. China http://www.huawei-3com.com Zip:100085') if mibBuilder.loadTexts: hwVoiceGeneralMIB.setDescription(' ') class EntryStatus(Integer32): subtypeSpec = Integer32.subtypeSpec + ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4)) namedValues = NamedValues(("valid", 1), ("createRequest", 2), ("underCreation", 3), ("invalid", 4)) hwVoiceGeneralObjects = MibIdentifier((1, 3, 6, 1, 4, 1, 2011, 5, 25, 1, 1, 1)) hwVoiceGeneralGroup = MibIdentifier((1, 3, 6, 1, 4, 1, 2011, 5, 25, 1, 1, 1, 1)) hwVoGeneralJitterLen = MibScalar((1, 3, 6, 1, 4, 1, 2011, 5, 25, 1, 1, 1, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 10)).clone(3)).setMaxAccess("readwrite") if mibBuilder.loadTexts: hwVoGeneralJitterLen.setStatus('current') if mibBuilder.loadTexts: hwVoGeneralJitterLen.setDescription('This object specifies the length of the Jitter buffer. The default value is 3.') hwVoGeneralMatchPolicy = MibScalar((1, 3, 6, 1, 4, 1, 2011, 5, 25, 1, 1, 1, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("long", 1), ("short", 2))).clone('short')).setMaxAccess("readwrite") if mibBuilder.loadTexts: hwVoGeneralMatchPolicy.setStatus('current') if mibBuilder.loadTexts: hwVoGeneralMatchPolicy.setDescription('This object specifies match number policy of this gateway. The default value is short.') hwVoGeneralSendPerformance = MibScalar((1, 3, 6, 1, 4, 1, 2011, 5, 25, 1, 1, 1, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("normal", 1), ("fast", 2))).clone('normal')).setMaxAccess("readwrite") if mibBuilder.loadTexts: hwVoGeneralSendPerformance.setStatus('current') if mibBuilder.loadTexts: hwVoGeneralSendPerformance.setDescription('This object specifies the performance of sending voice data. The default value is normal.') hwVoGeneralReceivePerformance = MibScalar((1, 3, 6, 1, 4, 1, 2011, 5, 25, 1, 1, 1, 1, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("normal", 1), ("fast", 2))).clone('normal')).setMaxAccess("readwrite") if mibBuilder.loadTexts: hwVoGeneralReceivePerformance.setStatus('current') if mibBuilder.loadTexts: hwVoGeneralReceivePerformance.setDescription('This object specifies the performance of receiving voice data. The default value is normal') hwVoGeneralDataStatistics = MibScalar((1, 3, 6, 1, 4, 1, 2011, 5, 25, 1, 1, 1, 1, 5), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enable", 1), ("disable", 2))).clone('disable')).setMaxAccess("readwrite") if mibBuilder.loadTexts: hwVoGeneralDataStatistics.setStatus('current') if mibBuilder.loadTexts: hwVoGeneralDataStatistics.setDescription('Enable/disable data statistics') hwVoGeneralPacketPrecedence = MibScalar((1, 3, 6, 1, 4, 1, 2011, 5, 25, 1, 1, 1, 1, 6), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 7))).setMaxAccess("readwrite") if mibBuilder.loadTexts: hwVoGeneralPacketPrecedence.setStatus('current') if mibBuilder.loadTexts: hwVoGeneralPacketPrecedence.setDescription('Set global Voip packet precedence') hwVoGeneralDialTerminator = MibScalar((1, 3, 6, 1, 4, 1, 2011, 5, 25, 1, 1, 1, 1, 7), OctetString().subtype(subtypeSpec=ValueSizeConstraint(0, 1))).setMaxAccess("readwrite") if mibBuilder.loadTexts: hwVoGeneralDialTerminator.setStatus('current') if mibBuilder.loadTexts: hwVoGeneralDialTerminator.setDescription('Set global Dial Terminator') hwVoGeneralCallStart = MibScalar((1, 3, 6, 1, 4, 1, 2011, 5, 25, 1, 1, 1, 1, 8), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("fast", 1), ("normal", 2))).clone('fast')).setMaxAccess("readwrite") if mibBuilder.loadTexts: hwVoGeneralCallStart.setStatus('current') if mibBuilder.loadTexts: hwVoGeneralCallStart.setDescription('Set the start mode of called over IP') hwVoGeneralCalledTunnel = MibScalar((1, 3, 6, 1, 4, 1, 2011, 5, 25, 1, 1, 1, 1, 9), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enable", 1), ("disable", 2))).clone('enable')).setMaxAccess("readwrite") if mibBuilder.loadTexts: hwVoGeneralCalledTunnel.setStatus('current') if mibBuilder.loadTexts: hwVoGeneralCalledTunnel.setDescription('Enable/disable Called tunnel function') hwVoGeneralSpecialServiceEnable = MibScalar((1, 3, 6, 1, 4, 1, 2011, 5, 25, 1, 1, 1, 1, 10), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enable", 1), ("disable", 2))).clone('disable')).setMaxAccess("readwrite") if mibBuilder.loadTexts: hwVoGeneralSpecialServiceEnable.setStatus('current') if mibBuilder.loadTexts: hwVoGeneralSpecialServiceEnable.setDescription('This object sepcifies whether special service number function is enable or disable.') hwVoGeneralCallTransferSpecialServiceNumber = MibScalar((1, 3, 6, 1, 4, 1, 2011, 5, 25, 1, 1, 1, 1, 11), OctetString().subtype(subtypeSpec=ValueSizeConstraint(1, 12)).clone('*12*')).setMaxAccess("readwrite") if mibBuilder.loadTexts: hwVoGeneralCallTransferSpecialServiceNumber.setStatus('current') if mibBuilder.loadTexts: hwVoGeneralCallTransferSpecialServiceNumber.setDescription('This object specifies the call-transfer special service number in talking.') hwVoGeneralPeerSearchStop = MibScalar((1, 3, 6, 1, 4, 1, 2011, 5, 25, 1, 1, 1, 1, 12), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 200)).clone(200)).setMaxAccess("readwrite") if mibBuilder.loadTexts: hwVoGeneralPeerSearchStop.setStatus('current') if mibBuilder.loadTexts: hwVoGeneralPeerSearchStop.setDescription('This object specifies the maximum in searching entities.') hwVoGeneralPeerSelectOrderRule = MibScalar((1, 3, 6, 1, 4, 1, 2011, 5, 25, 1, 1, 1, 1, 13), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 18))).setMaxAccess("readwrite") if mibBuilder.loadTexts: hwVoGeneralPeerSelectOrderRule.setStatus('current') if mibBuilder.loadTexts: hwVoGeneralPeerSelectOrderRule.setDescription('This object specifies the rule order applied in voice entity selection. 0 --- explicit match, priority, random 1 --- explicit match, priority, longest no use 2 --- explicit match, longest no use, priority 3 --- explicit match, longest no use, random 4 --- priority, explicit match, random 5 --- priority, explicit match, longest no usep 6 --- riority, longest no use, explicit match 7 --- priority, longest no use, random 8 --- longest no use, explicit match, priority 9 --- longest no use, explicit match, random 10 --- longest no use, priority, explicit match 11 --- longest no use, priority, random 12 --- explicit match, random 13 --- priority, random 14 --- longest no use, random 15 --- explicit match 16 --- priority 17 --- random 18 --- longest no use ') hwVoGeneralPeerSelectTypePriority = MibScalar((1, 3, 6, 1, 4, 1, 2011, 5, 25, 1, 1, 1, 1, 14), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 6))).setMaxAccess("readwrite") if mibBuilder.loadTexts: hwVoGeneralPeerSelectTypePriority.setStatus('current') if mibBuilder.loadTexts: hwVoGeneralPeerSelectTypePriority.setDescription('This object specifies the priority-ranked type of voice entity. 1ST 2DN 3RD 0 --- NONE TYPE 1 --- VOIP POTS VOFR 2 --- VOIP VOFR POTS 3 --- POTS VOIP VOFR 4 --- POTS VOFR VOIP 5 --- VOFR POTS VOIP 6 --- VOFR POTS POTS ') hwVoDialExpansionTable = MibTable((1, 3, 6, 1, 4, 1, 2011, 5, 25, 1, 1, 1, 3), ) if mibBuilder.loadTexts: hwVoDialExpansionTable.setStatus('current') if mibBuilder.loadTexts: hwVoDialExpansionTable.setDescription('The table contains the information of the Dial Expansion Record .') hwVoDialExpansionEntry = MibTableRow((1, 3, 6, 1, 4, 1, 2011, 5, 25, 1, 1, 1, 3, 1), ).setIndexNames((0, "HUAWEI-VO-GENERAL-MIB", "hwVoDialExpansionType"), (0, "HUAWEI-VO-GENERAL-MIB", "hwVoDialExpansionSource")) if mibBuilder.loadTexts: hwVoDialExpansionEntry.setStatus('current') if mibBuilder.loadTexts: hwVoDialExpansionEntry.setDescription('The information regarding a Dial Expansion Record.') hwVoDialExpansionType = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 1, 1, 1, 3, 1, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1))).clone(namedValues=NamedValues(("callin", 0), ("callout", 1)))).setMaxAccess("readonly") if mibBuilder.loadTexts: hwVoDialExpansionType.setStatus('current') if mibBuilder.loadTexts: hwVoDialExpansionType.setDescription('The call direction of the Dial Expansion. ') hwVoDialExpansionSource = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 1, 1, 1, 3, 1, 2), OctetString().subtype(subtypeSpec=ValueSizeConstraint(1, 31))).setMaxAccess("readonly") if mibBuilder.loadTexts: hwVoDialExpansionSource.setStatus('current') if mibBuilder.loadTexts: hwVoDialExpansionSource.setDescription('This source telephone of the Dial Expansion. ') hwVoDialExpansionTarget = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 1, 1, 1, 3, 1, 3), OctetString().subtype(subtypeSpec=ValueSizeConstraint(1, 31))).setMaxAccess("readwrite") if mibBuilder.loadTexts: hwVoDialExpansionTarget.setStatus('current') if mibBuilder.loadTexts: hwVoDialExpansionTarget.setDescription('This target telephone of the Dial Expansion. ') hwVoDialExpansionRowStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 1, 1, 1, 3, 1, 4), EntryStatus()).setMaxAccess("readwrite") if mibBuilder.loadTexts: hwVoDialExpansionRowStatus.setStatus('current') if mibBuilder.loadTexts: hwVoDialExpansionRowStatus.setDescription('This object is used to create a new row or modify or delete an existing row in this table. ') hwVoLtoPTable = MibTable((1, 3, 6, 1, 4, 1, 2011, 5, 25, 1, 1, 1, 2), ) if mibBuilder.loadTexts: hwVoLtoPTable.setStatus('current') if mibBuilder.loadTexts: hwVoLtoPTable.setDescription('The table contains the relation information of Voice logic channel and voice physical channel.') hwVoLtoPEntry = MibTableRow((1, 3, 6, 1, 4, 1, 2011, 5, 25, 1, 1, 1, 2, 1), ).setIndexNames((0, "HUAWEI-VO-GENERAL-MIB", "hwVoLtoPChannel")) if mibBuilder.loadTexts: hwVoLtoPEntry.setStatus('current') if mibBuilder.loadTexts: hwVoLtoPEntry.setDescription('The information regarding a single logic voice channel .') hwVoLtoPChannel = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 1, 1, 1, 2, 1, 1), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: hwVoLtoPChannel.setStatus('current') if mibBuilder.loadTexts: hwVoLtoPChannel.setDescription('The number of this logic voice channel .') hwVoLtoPSlot = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 1, 1, 1, 2, 1, 2), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: hwVoLtoPSlot.setStatus('current') if mibBuilder.loadTexts: hwVoLtoPSlot.setDescription('The physical slot number which this logic voice channel based on.') hwVoLtoPPort = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 1, 1, 1, 2, 1, 3), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: hwVoLtoPPort.setStatus('current') if mibBuilder.loadTexts: hwVoLtoPPort.setDescription('The physical port number which this logic voice channel based on.') hwVoLtoPTimeSlot = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 1, 1, 1, 2, 1, 4), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: hwVoLtoPTimeSlot.setStatus('current') if mibBuilder.loadTexts: hwVoLtoPTimeSlot.setDescription("The timeslots map this logic channel is using . -1 represent this channel cann't be used by voice.") hwVoLtoPStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 1, 1, 1, 2, 1, 5), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("up", 1), ("down", 2)))).setMaxAccess("readonly") if mibBuilder.loadTexts: hwVoLtoPStatus.setStatus('current') if mibBuilder.loadTexts: hwVoLtoPStatus.setDescription('The current status of the physical voice channel.') hwVoLtoPBoardType = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 1, 1, 1, 2, 1, 6), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12))).clone(namedValues=NamedValues(("fxs2", 1), ("fxo2", 2), ("em2", 3), ("fxs4", 4), ("fxo4", 5), ("em4", 6), ("e1vi", 7), ("t1vi", 8), ("sic-fxs1", 9), ("sic-fxo1", 10), ("sic-fxs2", 11), ("sic-fxo2", 12)))).setMaxAccess("readonly") if mibBuilder.loadTexts: hwVoLtoPBoardType.setStatus('current') if mibBuilder.loadTexts: hwVoLtoPBoardType.setDescription('The board type of the physical voice channel.') hwVoLtoPPortNumber = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 1, 1, 1, 2, 1, 7), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: hwVoLtoPPortNumber.setStatus('current') if mibBuilder.loadTexts: hwVoLtoPPortNumber.setDescription("The global port number of the logic voice channel. -1 represent this channel cann't be used by voice.") hwVoLtoPGroupNumber = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 1, 1, 1, 2, 1, 8), Integer32().subtype(subtypeSpec=ConstraintsUnion(ValueRangeConstraint(-1, 30), ValueRangeConstraint(255, 255), ))).setMaxAccess("readonly") if mibBuilder.loadTexts: hwVoLtoPGroupNumber.setStatus('current') if mibBuilder.loadTexts: hwVoLtoPGroupNumber.setDescription("The global group number of the logic voice channel. . -1 represent this channel cann't be used by voice .") hwVoiceNumberSubstGroup = MibIdentifier((1, 3, 6, 1, 4, 1, 2011, 5, 25, 1, 1, 1, 4)) hwVoNumSubstTable = MibTable((1, 3, 6, 1, 4, 1, 2011, 5, 25, 1, 1, 1, 4, 1), ) if mibBuilder.loadTexts: hwVoNumSubstTable.setStatus('current') if mibBuilder.loadTexts: hwVoNumSubstTable.setDescription('The table is the number-substitute rule table. It contains the table index, dot match rule and the first rule tag that the rule is used firstly.') hwVoNumSubstEntry = MibTableRow((1, 3, 6, 1, 4, 1, 2011, 5, 25, 1, 1, 1, 4, 1, 1), ).setIndexNames((0, "HUAWEI-VO-GENERAL-MIB", "hwVoNumSubstIndex")) if mibBuilder.loadTexts: hwVoNumSubstEntry.setStatus('current') if mibBuilder.loadTexts: hwVoNumSubstEntry.setDescription('A number-substitute rule list. One entry per number-substite rule list.') hwVoNumSubstIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 1, 1, 1, 4, 1, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 2147483647))).setMaxAccess("readonly") if mibBuilder.loadTexts: hwVoNumSubstIndex.setStatus('current') if mibBuilder.loadTexts: hwVoNumSubstIndex.setDescription('The index uniquely identifies a number-substitute rule list. It is valid if its value is between 1 and 2147483647.') hwVoNumSubstFirstRule = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 1, 1, 1, 4, 1, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(ValueRangeConstraint(0, 127), ValueRangeConstraint(65535, 65535), )).clone(65535)).setMaxAccess("readwrite") if mibBuilder.loadTexts: hwVoNumSubstFirstRule.setStatus('current') if mibBuilder.loadTexts: hwVoNumSubstFirstRule.setDescription('This object specifies the first rule to be used firstly. It is valid if its value is between 0 and 127.') hwVoNumSubstDotMatchRule = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 1, 1, 1, 4, 1, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("end-only", 1), ("left-right", 2), ("right-left", 3))).clone(1)).setMaxAccess("readwrite") if mibBuilder.loadTexts: hwVoNumSubstDotMatchRule.setStatus('current') if mibBuilder.loadTexts: hwVoNumSubstDotMatchRule.setDescription('This object specifies the dot wildcard match rule. end-only - only end of E.164 number (input format) left-right - match form left to right (input format) right-left - match form right to left (input format) ') hwVoNumSubstRowStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 1, 1, 1, 4, 1, 1, 4), EntryStatus()).setMaxAccess("readwrite") if mibBuilder.loadTexts: hwVoNumSubstRowStatus.setStatus('current') if mibBuilder.loadTexts: hwVoNumSubstRowStatus.setDescription('This object is used to create a new row or modify or delete an existing row in this table.') hwVoNumSubstRuleTable = MibTable((1, 3, 6, 1, 4, 1, 2011, 5, 25, 1, 1, 1, 4, 2), ) if mibBuilder.loadTexts: hwVoNumSubstRuleTable.setStatus('current') if mibBuilder.loadTexts: hwVoNumSubstRuleTable.setDescription('The table contains the number-substitute rule information that is used to create an rule row with an appropriate rule index.') hwVoNumSubstRuleEntry = MibTableRow((1, 3, 6, 1, 4, 1, 2011, 5, 25, 1, 1, 1, 4, 2, 1), ).setIndexNames((0, "HUAWEI-VO-GENERAL-MIB", "hwVoNumSubstIndex"), (0, "HUAWEI-VO-GENERAL-MIB", "hwVoNumSubstRuleIndex")) if mibBuilder.loadTexts: hwVoNumSubstRuleEntry.setStatus('current') if mibBuilder.loadTexts: hwVoNumSubstRuleEntry.setDescription('A single number-substitute rule. One entry per number-substitute rule.') hwVoNumSubstRuleIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 1, 1, 1, 4, 2, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 127))).setMaxAccess("readonly") if mibBuilder.loadTexts: hwVoNumSubstRuleIndex.setStatus('current') if mibBuilder.loadTexts: hwVoNumSubstRuleIndex.setDescription('The index uniquely identifies a number-substitute rule. It is valid if its value is between 0 and 127.') hwVoNumSubstRuleInputFormat = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 1, 1, 1, 4, 2, 1, 2), OctetString().subtype(subtypeSpec=ValueSizeConstraint(1, 31))).setMaxAccess("readwrite") if mibBuilder.loadTexts: hwVoNumSubstRuleInputFormat.setStatus('current') if mibBuilder.loadTexts: hwVoNumSubstRuleInputFormat.setDescription('This object specifies the input match format that must be of the form ^(\\^)!(\\+)!([0-9ABCD.*%!#]+)(\\$)!$.') hwVoNumSubstRuleOutputFormat = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 1, 1, 1, 4, 2, 1, 3), OctetString().subtype(subtypeSpec=ValueSizeConstraint(1, 31))).setMaxAccess("readwrite") if mibBuilder.loadTexts: hwVoNumSubstRuleOutputFormat.setStatus('current') if mibBuilder.loadTexts: hwVoNumSubstRuleOutputFormat.setDescription('This object specifies the output format that must be of the form ^[0-9#.]+$.') hwVoNumSubstRuleRowStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 1, 1, 1, 4, 2, 1, 4), EntryStatus()).setMaxAccess("readwrite") if mibBuilder.loadTexts: hwVoNumSubstRuleRowStatus.setStatus('current') if mibBuilder.loadTexts: hwVoNumSubstRuleRowStatus.setDescription('This object is used to create a new row or modify or delete an existing row in this table.') hwVoMaxCallTable = MibTable((1, 3, 6, 1, 4, 1, 2011, 5, 25, 1, 1, 1, 5), ) if mibBuilder.loadTexts: hwVoMaxCallTable.setStatus('current') if mibBuilder.loadTexts: hwVoMaxCallTable.setDescription('The table stores The table stores the maximum number of allowed connections for a set of voice entities.') hwVoMaxCallEntry = MibTableRow((1, 3, 6, 1, 4, 1, 2011, 5, 25, 1, 1, 1, 5, 1), ).setIndexNames((0, "HUAWEI-VO-GENERAL-MIB", "hwVoMaxCallTableIndex")) if mibBuilder.loadTexts: hwVoMaxCallEntry.setStatus('current') if mibBuilder.loadTexts: hwVoMaxCallEntry.setDescription('A single value of maximum call connections. One entry per maximum call connections.') hwVoMaxCallTableIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 1, 1, 1, 5, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 2147483647))).setMaxAccess("readonly") if mibBuilder.loadTexts: hwVoMaxCallTableIndex.setStatus('current') if mibBuilder.loadTexts: hwVoMaxCallTableIndex.setDescription('The index uniquely identifies a single maximum call value. It is valid if its value is between 1 and 2147483647.') hwVoMaxCallValue = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 1, 1, 1, 5, 1, 2), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 120))).setMaxAccess("readwrite") if mibBuilder.loadTexts: hwVoMaxCallValue.setStatus('current') if mibBuilder.loadTexts: hwVoMaxCallValue.setDescription('This object specifies a single maximum call value. It is valid if its value is between 0 and 120.') hwVoMaxCallTableRowStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 1, 1, 1, 5, 1, 3), EntryStatus()).setMaxAccess("readwrite") if mibBuilder.loadTexts: hwVoMaxCallTableRowStatus.setStatus('current') if mibBuilder.loadTexts: hwVoMaxCallTableRowStatus.setDescription('This object is used to create a new row or modify or delete an existing row in this table.') hwVoIncomingCallingNumSubstTable = MibTable((1, 3, 6, 1, 4, 1, 2011, 5, 25, 1, 1, 1, 6), ) if mibBuilder.loadTexts: hwVoIncomingCallingNumSubstTable.setStatus('current') if mibBuilder.loadTexts: hwVoIncomingCallingNumSubstTable.setDescription('The table stores the number-substitute rule list tag that these number-substitute rule list will be used for incoming-call caller number.The table can hold max 32 rows.') hwVoIncomingCallingNumSubstEntry = MibTableRow((1, 3, 6, 1, 4, 1, 2011, 5, 25, 1, 1, 1, 6, 1), ).setIndexNames((0, "HUAWEI-VO-GENERAL-MIB", "hwVoIncomingCallingNumSubstIndex")) if mibBuilder.loadTexts: hwVoIncomingCallingNumSubstEntry.setStatus('current') if mibBuilder.loadTexts: hwVoIncomingCallingNumSubstEntry.setDescription('A number-substitute rule list tag. One entry per number-substite rule list tag.') hwVoIncomingCallingNumSubstIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 1, 1, 1, 6, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 2147483647))).setMaxAccess("readonly") if mibBuilder.loadTexts: hwVoIncomingCallingNumSubstIndex.setStatus('current') if mibBuilder.loadTexts: hwVoIncomingCallingNumSubstIndex.setDescription('This object specifies a number-substitute rule that apply caller number for incoming call. It is valid if its value is between 1 and 2147483647.') hwVoIncomingCallingNumSubstRowStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 1, 1, 1, 6, 1, 2), EntryStatus()).setMaxAccess("readwrite") if mibBuilder.loadTexts: hwVoIncomingCallingNumSubstRowStatus.setStatus('current') if mibBuilder.loadTexts: hwVoIncomingCallingNumSubstRowStatus.setDescription('This object is used to create a new row or modify or delete an existing row in this table.') hwVoIncomingCalledNumSubstTable = MibTable((1, 3, 6, 1, 4, 1, 2011, 5, 25, 1, 1, 1, 7), ) if mibBuilder.loadTexts: hwVoIncomingCalledNumSubstTable.setStatus('current') if mibBuilder.loadTexts: hwVoIncomingCalledNumSubstTable.setDescription('The table stores the number-substitute rule list tag that these number-substitute rule list will be used for incoming-call caller number.The table can hold max 32 rows.') hwVoIncomingCalledNumSubstEntry = MibTableRow((1, 3, 6, 1, 4, 1, 2011, 5, 25, 1, 1, 1, 7, 1), ).setIndexNames((0, "HUAWEI-VO-GENERAL-MIB", "hwVoIncomingCalledNumSubstIndex")) if mibBuilder.loadTexts: hwVoIncomingCalledNumSubstEntry.setStatus('current') if mibBuilder.loadTexts: hwVoIncomingCalledNumSubstEntry.setDescription('A number-substitute rule list tag. One entry per number-substite rule list tag.') hwVoIncomingCalledNumSubstIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 1, 1, 1, 7, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 2147483647))).setMaxAccess("readonly") if mibBuilder.loadTexts: hwVoIncomingCalledNumSubstIndex.setStatus('current') if mibBuilder.loadTexts: hwVoIncomingCalledNumSubstIndex.setDescription('This object specifies a number-substitute rule that apply caller number for incoming call. It is valid if its value is between 1 and 2147483647.') hwVoIncomingCalledNumSubstRowStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 1, 1, 1, 7, 1, 2), EntryStatus()).setMaxAccess("readwrite") if mibBuilder.loadTexts: hwVoIncomingCalledNumSubstRowStatus.setStatus('current') if mibBuilder.loadTexts: hwVoIncomingCalledNumSubstRowStatus.setDescription('This object is used to create a new row or modify or delete an existing row in this table.') hwVoOutgoingCallingNumSubstTable = MibTable((1, 3, 6, 1, 4, 1, 2011, 5, 25, 1, 1, 1, 8), ) if mibBuilder.loadTexts: hwVoOutgoingCallingNumSubstTable.setStatus('current') if mibBuilder.loadTexts: hwVoOutgoingCallingNumSubstTable.setDescription('The table stores the number-substitute rule list tag that these number-substitute rule list will be used for incoming-call caller number.The table can hold max 32 rows.') hwVoOutgoingCallingNumSubstEntry = MibTableRow((1, 3, 6, 1, 4, 1, 2011, 5, 25, 1, 1, 1, 8, 1), ).setIndexNames((0, "HUAWEI-VO-GENERAL-MIB", "hwVoOutgoingCallingNumSubstIndex")) if mibBuilder.loadTexts: hwVoOutgoingCallingNumSubstEntry.setStatus('current') if mibBuilder.loadTexts: hwVoOutgoingCallingNumSubstEntry.setDescription('A number-substitute rule list tag. One entry per number-substite rule list tag.') hwVoOutgoingCallingNumSubstIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 1, 1, 1, 8, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 2147483647))).setMaxAccess("readonly") if mibBuilder.loadTexts: hwVoOutgoingCallingNumSubstIndex.setStatus('current') if mibBuilder.loadTexts: hwVoOutgoingCallingNumSubstIndex.setDescription('This object specifies a number-substitute rule that apply caller number for incoming call. It is valid if its value is between 1 and 2147483647.') hwVoOutgoingCallingNumSubstRowStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 1, 1, 1, 8, 1, 2), EntryStatus()).setMaxAccess("readwrite") if mibBuilder.loadTexts: hwVoOutgoingCallingNumSubstRowStatus.setStatus('current') if mibBuilder.loadTexts: hwVoOutgoingCallingNumSubstRowStatus.setDescription('This object is used to create a new row or modify or delete an existing row in this table.') hwVoOutgoingCalledNumSubstTable = MibTable((1, 3, 6, 1, 4, 1, 2011, 5, 25, 1, 1, 1, 9), ) if mibBuilder.loadTexts: hwVoOutgoingCalledNumSubstTable.setStatus('current') if mibBuilder.loadTexts: hwVoOutgoingCalledNumSubstTable.setDescription('The table stores the number-substitute rule list tag that these number-substitute rule list will be used for incoming-call caller number.The table can hold max 32 rows.') hwVoOutgoingCalledNumSubstEntry = MibTableRow((1, 3, 6, 1, 4, 1, 2011, 5, 25, 1, 1, 1, 9, 1), ).setIndexNames((0, "HUAWEI-VO-GENERAL-MIB", "hwVoOutgoingCalledNumSubstIndex")) if mibBuilder.loadTexts: hwVoOutgoingCalledNumSubstEntry.setStatus('current') if mibBuilder.loadTexts: hwVoOutgoingCalledNumSubstEntry.setDescription('A number-substitute rule list tag. One entry per number-substite rule list tag.') hwVoOutgoingCalledNumSubstIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 1, 1, 1, 9, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 2147483647))).setMaxAccess("readonly") if mibBuilder.loadTexts: hwVoOutgoingCalledNumSubstIndex.setStatus('current') if mibBuilder.loadTexts: hwVoOutgoingCalledNumSubstIndex.setDescription('This object specifies a number-substitute rule that apply caller number for incoming call. It is valid if its value is between 1 and 2147483647.') hwVoOutgoingCalledNumSubstRowStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 1, 1, 1, 9, 1, 2), EntryStatus()).setMaxAccess("readwrite") if mibBuilder.loadTexts: hwVoOutgoingCalledNumSubstRowStatus.setStatus('current') if mibBuilder.loadTexts: hwVoOutgoingCalledNumSubstRowStatus.setDescription('This object is used to create a new row or modify or delete an existing row in this table.') mibBuilder.exportSymbols("HUAWEI-VO-GENERAL-MIB", hwVoLtoPPort=hwVoLtoPPort, hwVoNumSubstIndex=hwVoNumSubstIndex, hwVoiceGeneralObjects=hwVoiceGeneralObjects, hwVoNumSubstRuleInputFormat=hwVoNumSubstRuleInputFormat, hwVoNumSubstTable=hwVoNumSubstTable, hwVoDialExpansionTarget=hwVoDialExpansionTarget, hwVoGeneralSendPerformance=hwVoGeneralSendPerformance, hwVoDialExpansionEntry=hwVoDialExpansionEntry, hwVoMaxCallEntry=hwVoMaxCallEntry, hwVoIncomingCalledNumSubstEntry=hwVoIncomingCalledNumSubstEntry, hwVoOutgoingCallingNumSubstTable=hwVoOutgoingCallingNumSubstTable, hwVoGeneralCallTransferSpecialServiceNumber=hwVoGeneralCallTransferSpecialServiceNumber, hwVoMaxCallTable=hwVoMaxCallTable, hwVoNumSubstRuleTable=hwVoNumSubstRuleTable, hwVoOutgoingCalledNumSubstIndex=hwVoOutgoingCalledNumSubstIndex, hwVoGeneralPacketPrecedence=hwVoGeneralPacketPrecedence, hwVoIncomingCallingNumSubstIndex=hwVoIncomingCallingNumSubstIndex, hwVoOutgoingCallingNumSubstEntry=hwVoOutgoingCallingNumSubstEntry, hwVoDialExpansionTable=hwVoDialExpansionTable, hwVoGeneralMatchPolicy=hwVoGeneralMatchPolicy, hwVoLtoPEntry=hwVoLtoPEntry, hwVoGeneralPeerSearchStop=hwVoGeneralPeerSearchStop, hwVoLtoPSlot=hwVoLtoPSlot, hwVoLtoPStatus=hwVoLtoPStatus, hwVoNumSubstRuleRowStatus=hwVoNumSubstRuleRowStatus, hwVoMaxCallValue=hwVoMaxCallValue, hwVoMaxCallTableRowStatus=hwVoMaxCallTableRowStatus, hwVoNumSubstEntry=hwVoNumSubstEntry, hwVoGeneralPeerSelectTypePriority=hwVoGeneralPeerSelectTypePriority, hwVoLtoPBoardType=hwVoLtoPBoardType, hwVoOutgoingCalledNumSubstRowStatus=hwVoOutgoingCalledNumSubstRowStatus, hwVoNumSubstRuleIndex=hwVoNumSubstRuleIndex, hwVoDialExpansionRowStatus=hwVoDialExpansionRowStatus, hwVoIncomingCallingNumSubstEntry=hwVoIncomingCallingNumSubstEntry, hwVoOutgoingCallingNumSubstRowStatus=hwVoOutgoingCallingNumSubstRowStatus, hwVoIncomingCallingNumSubstTable=hwVoIncomingCallingNumSubstTable, hwVoLtoPChannel=hwVoLtoPChannel, hwVoNumSubstRowStatus=hwVoNumSubstRowStatus, hwVoNumSubstDotMatchRule=hwVoNumSubstDotMatchRule, hwVoGeneralDialTerminator=hwVoGeneralDialTerminator, hwVoIncomingCallingNumSubstRowStatus=hwVoIncomingCallingNumSubstRowStatus, PYSNMP_MODULE_ID=hwVoiceGeneralMIB, hwVoOutgoingCalledNumSubstTable=hwVoOutgoingCalledNumSubstTable, hwVoGeneralPeerSelectOrderRule=hwVoGeneralPeerSelectOrderRule, hwVoGeneralCallStart=hwVoGeneralCallStart, hwVoLtoPPortNumber=hwVoLtoPPortNumber, hwVoGeneralCalledTunnel=hwVoGeneralCalledTunnel, hwVoGeneralJitterLen=hwVoGeneralJitterLen, hwVoGeneralReceivePerformance=hwVoGeneralReceivePerformance, hwVoDialExpansionType=hwVoDialExpansionType, hwVoLtoPGroupNumber=hwVoLtoPGroupNumber, hwVoiceNumberSubstGroup=hwVoiceNumberSubstGroup, hwVoIncomingCalledNumSubstTable=hwVoIncomingCalledNumSubstTable, hwVoIncomingCalledNumSubstIndex=hwVoIncomingCalledNumSubstIndex, hwVoNumSubstRuleEntry=hwVoNumSubstRuleEntry, hwVoiceGeneralGroup=hwVoiceGeneralGroup, hwVoNumSubstFirstRule=hwVoNumSubstFirstRule, hwVoIncomingCalledNumSubstRowStatus=hwVoIncomingCalledNumSubstRowStatus, hwVoMaxCallTableIndex=hwVoMaxCallTableIndex, hwVoDialExpansionSource=hwVoDialExpansionSource, hwVoLtoPTable=hwVoLtoPTable, hwVoGeneralDataStatistics=hwVoGeneralDataStatistics, hwVoNumSubstRuleOutputFormat=hwVoNumSubstRuleOutputFormat, hwVoGeneralSpecialServiceEnable=hwVoGeneralSpecialServiceEnable, hwVoOutgoingCalledNumSubstEntry=hwVoOutgoingCalledNumSubstEntry, hwVoLtoPTimeSlot=hwVoLtoPTimeSlot, EntryStatus=EntryStatus, hwVoOutgoingCallingNumSubstIndex=hwVoOutgoingCallingNumSubstIndex, hwVoiceGeneralMIB=hwVoiceGeneralMIB)
(octet_string, object_identifier, integer) = mibBuilder.importSymbols('ASN1', 'OctetString', 'ObjectIdentifier', 'Integer') (named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues') (value_range_constraint, constraints_union, single_value_constraint, constraints_intersection, value_size_constraint) = mibBuilder.importSymbols('ASN1-REFINEMENT', 'ValueRangeConstraint', 'ConstraintsUnion', 'SingleValueConstraint', 'ConstraintsIntersection', 'ValueSizeConstraint') (voice,) = mibBuilder.importSymbols('HUAWEI-3COM-OID-MIB', 'voice') (module_compliance, notification_group) = mibBuilder.importSymbols('SNMPv2-CONF', 'ModuleCompliance', 'NotificationGroup') (time_ticks, notification_type, object_identity, unsigned32, integer32, mib_scalar, mib_table, mib_table_row, mib_table_column, module_identity, ip_address, iso, bits, counter64, mib_identifier, counter32, gauge32) = mibBuilder.importSymbols('SNMPv2-SMI', 'TimeTicks', 'NotificationType', 'ObjectIdentity', 'Unsigned32', 'Integer32', 'MibScalar', 'MibTable', 'MibTableRow', 'MibTableColumn', 'ModuleIdentity', 'IpAddress', 'iso', 'Bits', 'Counter64', 'MibIdentifier', 'Counter32', 'Gauge32') (textual_convention, display_string) = mibBuilder.importSymbols('SNMPv2-TC', 'TextualConvention', 'DisplayString') hw_voice_general_mib = module_identity((1, 3, 6, 1, 4, 1, 2011, 5, 25, 1, 1)) hwVoiceGeneralMIB.setRevisions(('2004-04-08 13:45',)) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): if mibBuilder.loadTexts: hwVoiceGeneralMIB.setRevisionsDescriptions(('',)) if mibBuilder.loadTexts: hwVoiceGeneralMIB.setLastUpdated('200410200000Z') if mibBuilder.loadTexts: hwVoiceGeneralMIB.setOrganization('Huawei-3COM Technologies Co., Ltd.') if mibBuilder.loadTexts: hwVoiceGeneralMIB.setContactInfo('PLAT Team Huawei 3Com Technologies co.,Ltd. Shang-Di Information Industry Base, Hai-Dian District Beijing P.R. China http://www.huawei-3com.com Zip:100085') if mibBuilder.loadTexts: hwVoiceGeneralMIB.setDescription(' ') class Entrystatus(Integer32): subtype_spec = Integer32.subtypeSpec + constraints_union(single_value_constraint(1, 2, 3, 4)) named_values = named_values(('valid', 1), ('createRequest', 2), ('underCreation', 3), ('invalid', 4)) hw_voice_general_objects = mib_identifier((1, 3, 6, 1, 4, 1, 2011, 5, 25, 1, 1, 1)) hw_voice_general_group = mib_identifier((1, 3, 6, 1, 4, 1, 2011, 5, 25, 1, 1, 1, 1)) hw_vo_general_jitter_len = mib_scalar((1, 3, 6, 1, 4, 1, 2011, 5, 25, 1, 1, 1, 1, 1), integer32().subtype(subtypeSpec=value_range_constraint(0, 10)).clone(3)).setMaxAccess('readwrite') if mibBuilder.loadTexts: hwVoGeneralJitterLen.setStatus('current') if mibBuilder.loadTexts: hwVoGeneralJitterLen.setDescription('This object specifies the length of the Jitter buffer. The default value is 3.') hw_vo_general_match_policy = mib_scalar((1, 3, 6, 1, 4, 1, 2011, 5, 25, 1, 1, 1, 1, 2), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('long', 1), ('short', 2))).clone('short')).setMaxAccess('readwrite') if mibBuilder.loadTexts: hwVoGeneralMatchPolicy.setStatus('current') if mibBuilder.loadTexts: hwVoGeneralMatchPolicy.setDescription('This object specifies match number policy of this gateway. The default value is short.') hw_vo_general_send_performance = mib_scalar((1, 3, 6, 1, 4, 1, 2011, 5, 25, 1, 1, 1, 1, 3), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('normal', 1), ('fast', 2))).clone('normal')).setMaxAccess('readwrite') if mibBuilder.loadTexts: hwVoGeneralSendPerformance.setStatus('current') if mibBuilder.loadTexts: hwVoGeneralSendPerformance.setDescription('This object specifies the performance of sending voice data. The default value is normal.') hw_vo_general_receive_performance = mib_scalar((1, 3, 6, 1, 4, 1, 2011, 5, 25, 1, 1, 1, 1, 4), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('normal', 1), ('fast', 2))).clone('normal')).setMaxAccess('readwrite') if mibBuilder.loadTexts: hwVoGeneralReceivePerformance.setStatus('current') if mibBuilder.loadTexts: hwVoGeneralReceivePerformance.setDescription('This object specifies the performance of receiving voice data. The default value is normal') hw_vo_general_data_statistics = mib_scalar((1, 3, 6, 1, 4, 1, 2011, 5, 25, 1, 1, 1, 1, 5), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('enable', 1), ('disable', 2))).clone('disable')).setMaxAccess('readwrite') if mibBuilder.loadTexts: hwVoGeneralDataStatistics.setStatus('current') if mibBuilder.loadTexts: hwVoGeneralDataStatistics.setDescription('Enable/disable data statistics') hw_vo_general_packet_precedence = mib_scalar((1, 3, 6, 1, 4, 1, 2011, 5, 25, 1, 1, 1, 1, 6), integer32().subtype(subtypeSpec=value_range_constraint(0, 7))).setMaxAccess('readwrite') if mibBuilder.loadTexts: hwVoGeneralPacketPrecedence.setStatus('current') if mibBuilder.loadTexts: hwVoGeneralPacketPrecedence.setDescription('Set global Voip packet precedence') hw_vo_general_dial_terminator = mib_scalar((1, 3, 6, 1, 4, 1, 2011, 5, 25, 1, 1, 1, 1, 7), octet_string().subtype(subtypeSpec=value_size_constraint(0, 1))).setMaxAccess('readwrite') if mibBuilder.loadTexts: hwVoGeneralDialTerminator.setStatus('current') if mibBuilder.loadTexts: hwVoGeneralDialTerminator.setDescription('Set global Dial Terminator') hw_vo_general_call_start = mib_scalar((1, 3, 6, 1, 4, 1, 2011, 5, 25, 1, 1, 1, 1, 8), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('fast', 1), ('normal', 2))).clone('fast')).setMaxAccess('readwrite') if mibBuilder.loadTexts: hwVoGeneralCallStart.setStatus('current') if mibBuilder.loadTexts: hwVoGeneralCallStart.setDescription('Set the start mode of called over IP') hw_vo_general_called_tunnel = mib_scalar((1, 3, 6, 1, 4, 1, 2011, 5, 25, 1, 1, 1, 1, 9), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('enable', 1), ('disable', 2))).clone('enable')).setMaxAccess('readwrite') if mibBuilder.loadTexts: hwVoGeneralCalledTunnel.setStatus('current') if mibBuilder.loadTexts: hwVoGeneralCalledTunnel.setDescription('Enable/disable Called tunnel function') hw_vo_general_special_service_enable = mib_scalar((1, 3, 6, 1, 4, 1, 2011, 5, 25, 1, 1, 1, 1, 10), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('enable', 1), ('disable', 2))).clone('disable')).setMaxAccess('readwrite') if mibBuilder.loadTexts: hwVoGeneralSpecialServiceEnable.setStatus('current') if mibBuilder.loadTexts: hwVoGeneralSpecialServiceEnable.setDescription('This object sepcifies whether special service number function is enable or disable.') hw_vo_general_call_transfer_special_service_number = mib_scalar((1, 3, 6, 1, 4, 1, 2011, 5, 25, 1, 1, 1, 1, 11), octet_string().subtype(subtypeSpec=value_size_constraint(1, 12)).clone('*12*')).setMaxAccess('readwrite') if mibBuilder.loadTexts: hwVoGeneralCallTransferSpecialServiceNumber.setStatus('current') if mibBuilder.loadTexts: hwVoGeneralCallTransferSpecialServiceNumber.setDescription('This object specifies the call-transfer special service number in talking.') hw_vo_general_peer_search_stop = mib_scalar((1, 3, 6, 1, 4, 1, 2011, 5, 25, 1, 1, 1, 1, 12), integer32().subtype(subtypeSpec=value_range_constraint(1, 200)).clone(200)).setMaxAccess('readwrite') if mibBuilder.loadTexts: hwVoGeneralPeerSearchStop.setStatus('current') if mibBuilder.loadTexts: hwVoGeneralPeerSearchStop.setDescription('This object specifies the maximum in searching entities.') hw_vo_general_peer_select_order_rule = mib_scalar((1, 3, 6, 1, 4, 1, 2011, 5, 25, 1, 1, 1, 1, 13), integer32().subtype(subtypeSpec=value_range_constraint(0, 18))).setMaxAccess('readwrite') if mibBuilder.loadTexts: hwVoGeneralPeerSelectOrderRule.setStatus('current') if mibBuilder.loadTexts: hwVoGeneralPeerSelectOrderRule.setDescription('This object specifies the rule order applied in voice entity selection. 0 --- explicit match, priority, random 1 --- explicit match, priority, longest no use 2 --- explicit match, longest no use, priority 3 --- explicit match, longest no use, random 4 --- priority, explicit match, random 5 --- priority, explicit match, longest no usep 6 --- riority, longest no use, explicit match 7 --- priority, longest no use, random 8 --- longest no use, explicit match, priority 9 --- longest no use, explicit match, random 10 --- longest no use, priority, explicit match 11 --- longest no use, priority, random 12 --- explicit match, random 13 --- priority, random 14 --- longest no use, random 15 --- explicit match 16 --- priority 17 --- random 18 --- longest no use ') hw_vo_general_peer_select_type_priority = mib_scalar((1, 3, 6, 1, 4, 1, 2011, 5, 25, 1, 1, 1, 1, 14), integer32().subtype(subtypeSpec=value_range_constraint(0, 6))).setMaxAccess('readwrite') if mibBuilder.loadTexts: hwVoGeneralPeerSelectTypePriority.setStatus('current') if mibBuilder.loadTexts: hwVoGeneralPeerSelectTypePriority.setDescription('This object specifies the priority-ranked type of voice entity. 1ST 2DN 3RD 0 --- NONE TYPE 1 --- VOIP POTS VOFR 2 --- VOIP VOFR POTS 3 --- POTS VOIP VOFR 4 --- POTS VOFR VOIP 5 --- VOFR POTS VOIP 6 --- VOFR POTS POTS ') hw_vo_dial_expansion_table = mib_table((1, 3, 6, 1, 4, 1, 2011, 5, 25, 1, 1, 1, 3)) if mibBuilder.loadTexts: hwVoDialExpansionTable.setStatus('current') if mibBuilder.loadTexts: hwVoDialExpansionTable.setDescription('The table contains the information of the Dial Expansion Record .') hw_vo_dial_expansion_entry = mib_table_row((1, 3, 6, 1, 4, 1, 2011, 5, 25, 1, 1, 1, 3, 1)).setIndexNames((0, 'HUAWEI-VO-GENERAL-MIB', 'hwVoDialExpansionType'), (0, 'HUAWEI-VO-GENERAL-MIB', 'hwVoDialExpansionSource')) if mibBuilder.loadTexts: hwVoDialExpansionEntry.setStatus('current') if mibBuilder.loadTexts: hwVoDialExpansionEntry.setDescription('The information regarding a Dial Expansion Record.') hw_vo_dial_expansion_type = mib_table_column((1, 3, 6, 1, 4, 1, 2011, 5, 25, 1, 1, 1, 3, 1, 1), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(0, 1))).clone(namedValues=named_values(('callin', 0), ('callout', 1)))).setMaxAccess('readonly') if mibBuilder.loadTexts: hwVoDialExpansionType.setStatus('current') if mibBuilder.loadTexts: hwVoDialExpansionType.setDescription('The call direction of the Dial Expansion. ') hw_vo_dial_expansion_source = mib_table_column((1, 3, 6, 1, 4, 1, 2011, 5, 25, 1, 1, 1, 3, 1, 2), octet_string().subtype(subtypeSpec=value_size_constraint(1, 31))).setMaxAccess('readonly') if mibBuilder.loadTexts: hwVoDialExpansionSource.setStatus('current') if mibBuilder.loadTexts: hwVoDialExpansionSource.setDescription('This source telephone of the Dial Expansion. ') hw_vo_dial_expansion_target = mib_table_column((1, 3, 6, 1, 4, 1, 2011, 5, 25, 1, 1, 1, 3, 1, 3), octet_string().subtype(subtypeSpec=value_size_constraint(1, 31))).setMaxAccess('readwrite') if mibBuilder.loadTexts: hwVoDialExpansionTarget.setStatus('current') if mibBuilder.loadTexts: hwVoDialExpansionTarget.setDescription('This target telephone of the Dial Expansion. ') hw_vo_dial_expansion_row_status = mib_table_column((1, 3, 6, 1, 4, 1, 2011, 5, 25, 1, 1, 1, 3, 1, 4), entry_status()).setMaxAccess('readwrite') if mibBuilder.loadTexts: hwVoDialExpansionRowStatus.setStatus('current') if mibBuilder.loadTexts: hwVoDialExpansionRowStatus.setDescription('This object is used to create a new row or modify or delete an existing row in this table. ') hw_vo_lto_p_table = mib_table((1, 3, 6, 1, 4, 1, 2011, 5, 25, 1, 1, 1, 2)) if mibBuilder.loadTexts: hwVoLtoPTable.setStatus('current') if mibBuilder.loadTexts: hwVoLtoPTable.setDescription('The table contains the relation information of Voice logic channel and voice physical channel.') hw_vo_lto_p_entry = mib_table_row((1, 3, 6, 1, 4, 1, 2011, 5, 25, 1, 1, 1, 2, 1)).setIndexNames((0, 'HUAWEI-VO-GENERAL-MIB', 'hwVoLtoPChannel')) if mibBuilder.loadTexts: hwVoLtoPEntry.setStatus('current') if mibBuilder.loadTexts: hwVoLtoPEntry.setDescription('The information regarding a single logic voice channel .') hw_vo_lto_p_channel = mib_table_column((1, 3, 6, 1, 4, 1, 2011, 5, 25, 1, 1, 1, 2, 1, 1), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: hwVoLtoPChannel.setStatus('current') if mibBuilder.loadTexts: hwVoLtoPChannel.setDescription('The number of this logic voice channel .') hw_vo_lto_p_slot = mib_table_column((1, 3, 6, 1, 4, 1, 2011, 5, 25, 1, 1, 1, 2, 1, 2), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: hwVoLtoPSlot.setStatus('current') if mibBuilder.loadTexts: hwVoLtoPSlot.setDescription('The physical slot number which this logic voice channel based on.') hw_vo_lto_p_port = mib_table_column((1, 3, 6, 1, 4, 1, 2011, 5, 25, 1, 1, 1, 2, 1, 3), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: hwVoLtoPPort.setStatus('current') if mibBuilder.loadTexts: hwVoLtoPPort.setDescription('The physical port number which this logic voice channel based on.') hw_vo_lto_p_time_slot = mib_table_column((1, 3, 6, 1, 4, 1, 2011, 5, 25, 1, 1, 1, 2, 1, 4), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: hwVoLtoPTimeSlot.setStatus('current') if mibBuilder.loadTexts: hwVoLtoPTimeSlot.setDescription("The timeslots map this logic channel is using . -1 represent this channel cann't be used by voice.") hw_vo_lto_p_status = mib_table_column((1, 3, 6, 1, 4, 1, 2011, 5, 25, 1, 1, 1, 2, 1, 5), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('up', 1), ('down', 2)))).setMaxAccess('readonly') if mibBuilder.loadTexts: hwVoLtoPStatus.setStatus('current') if mibBuilder.loadTexts: hwVoLtoPStatus.setDescription('The current status of the physical voice channel.') hw_vo_lto_p_board_type = mib_table_column((1, 3, 6, 1, 4, 1, 2011, 5, 25, 1, 1, 1, 2, 1, 6), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12))).clone(namedValues=named_values(('fxs2', 1), ('fxo2', 2), ('em2', 3), ('fxs4', 4), ('fxo4', 5), ('em4', 6), ('e1vi', 7), ('t1vi', 8), ('sic-fxs1', 9), ('sic-fxo1', 10), ('sic-fxs2', 11), ('sic-fxo2', 12)))).setMaxAccess('readonly') if mibBuilder.loadTexts: hwVoLtoPBoardType.setStatus('current') if mibBuilder.loadTexts: hwVoLtoPBoardType.setDescription('The board type of the physical voice channel.') hw_vo_lto_p_port_number = mib_table_column((1, 3, 6, 1, 4, 1, 2011, 5, 25, 1, 1, 1, 2, 1, 7), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: hwVoLtoPPortNumber.setStatus('current') if mibBuilder.loadTexts: hwVoLtoPPortNumber.setDescription("The global port number of the logic voice channel. -1 represent this channel cann't be used by voice.") hw_vo_lto_p_group_number = mib_table_column((1, 3, 6, 1, 4, 1, 2011, 5, 25, 1, 1, 1, 2, 1, 8), integer32().subtype(subtypeSpec=constraints_union(value_range_constraint(-1, 30), value_range_constraint(255, 255)))).setMaxAccess('readonly') if mibBuilder.loadTexts: hwVoLtoPGroupNumber.setStatus('current') if mibBuilder.loadTexts: hwVoLtoPGroupNumber.setDescription("The global group number of the logic voice channel. . -1 represent this channel cann't be used by voice .") hw_voice_number_subst_group = mib_identifier((1, 3, 6, 1, 4, 1, 2011, 5, 25, 1, 1, 1, 4)) hw_vo_num_subst_table = mib_table((1, 3, 6, 1, 4, 1, 2011, 5, 25, 1, 1, 1, 4, 1)) if mibBuilder.loadTexts: hwVoNumSubstTable.setStatus('current') if mibBuilder.loadTexts: hwVoNumSubstTable.setDescription('The table is the number-substitute rule table. It contains the table index, dot match rule and the first rule tag that the rule is used firstly.') hw_vo_num_subst_entry = mib_table_row((1, 3, 6, 1, 4, 1, 2011, 5, 25, 1, 1, 1, 4, 1, 1)).setIndexNames((0, 'HUAWEI-VO-GENERAL-MIB', 'hwVoNumSubstIndex')) if mibBuilder.loadTexts: hwVoNumSubstEntry.setStatus('current') if mibBuilder.loadTexts: hwVoNumSubstEntry.setDescription('A number-substitute rule list. One entry per number-substite rule list.') hw_vo_num_subst_index = mib_table_column((1, 3, 6, 1, 4, 1, 2011, 5, 25, 1, 1, 1, 4, 1, 1, 1), integer32().subtype(subtypeSpec=value_range_constraint(1, 2147483647))).setMaxAccess('readonly') if mibBuilder.loadTexts: hwVoNumSubstIndex.setStatus('current') if mibBuilder.loadTexts: hwVoNumSubstIndex.setDescription('The index uniquely identifies a number-substitute rule list. It is valid if its value is between 1 and 2147483647.') hw_vo_num_subst_first_rule = mib_table_column((1, 3, 6, 1, 4, 1, 2011, 5, 25, 1, 1, 1, 4, 1, 1, 2), integer32().subtype(subtypeSpec=constraints_union(value_range_constraint(0, 127), value_range_constraint(65535, 65535))).clone(65535)).setMaxAccess('readwrite') if mibBuilder.loadTexts: hwVoNumSubstFirstRule.setStatus('current') if mibBuilder.loadTexts: hwVoNumSubstFirstRule.setDescription('This object specifies the first rule to be used firstly. It is valid if its value is between 0 and 127.') hw_vo_num_subst_dot_match_rule = mib_table_column((1, 3, 6, 1, 4, 1, 2011, 5, 25, 1, 1, 1, 4, 1, 1, 3), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3))).clone(namedValues=named_values(('end-only', 1), ('left-right', 2), ('right-left', 3))).clone(1)).setMaxAccess('readwrite') if mibBuilder.loadTexts: hwVoNumSubstDotMatchRule.setStatus('current') if mibBuilder.loadTexts: hwVoNumSubstDotMatchRule.setDescription('This object specifies the dot wildcard match rule. end-only - only end of E.164 number (input format) left-right - match form left to right (input format) right-left - match form right to left (input format) ') hw_vo_num_subst_row_status = mib_table_column((1, 3, 6, 1, 4, 1, 2011, 5, 25, 1, 1, 1, 4, 1, 1, 4), entry_status()).setMaxAccess('readwrite') if mibBuilder.loadTexts: hwVoNumSubstRowStatus.setStatus('current') if mibBuilder.loadTexts: hwVoNumSubstRowStatus.setDescription('This object is used to create a new row or modify or delete an existing row in this table.') hw_vo_num_subst_rule_table = mib_table((1, 3, 6, 1, 4, 1, 2011, 5, 25, 1, 1, 1, 4, 2)) if mibBuilder.loadTexts: hwVoNumSubstRuleTable.setStatus('current') if mibBuilder.loadTexts: hwVoNumSubstRuleTable.setDescription('The table contains the number-substitute rule information that is used to create an rule row with an appropriate rule index.') hw_vo_num_subst_rule_entry = mib_table_row((1, 3, 6, 1, 4, 1, 2011, 5, 25, 1, 1, 1, 4, 2, 1)).setIndexNames((0, 'HUAWEI-VO-GENERAL-MIB', 'hwVoNumSubstIndex'), (0, 'HUAWEI-VO-GENERAL-MIB', 'hwVoNumSubstRuleIndex')) if mibBuilder.loadTexts: hwVoNumSubstRuleEntry.setStatus('current') if mibBuilder.loadTexts: hwVoNumSubstRuleEntry.setDescription('A single number-substitute rule. One entry per number-substitute rule.') hw_vo_num_subst_rule_index = mib_table_column((1, 3, 6, 1, 4, 1, 2011, 5, 25, 1, 1, 1, 4, 2, 1, 1), integer32().subtype(subtypeSpec=value_range_constraint(0, 127))).setMaxAccess('readonly') if mibBuilder.loadTexts: hwVoNumSubstRuleIndex.setStatus('current') if mibBuilder.loadTexts: hwVoNumSubstRuleIndex.setDescription('The index uniquely identifies a number-substitute rule. It is valid if its value is between 0 and 127.') hw_vo_num_subst_rule_input_format = mib_table_column((1, 3, 6, 1, 4, 1, 2011, 5, 25, 1, 1, 1, 4, 2, 1, 2), octet_string().subtype(subtypeSpec=value_size_constraint(1, 31))).setMaxAccess('readwrite') if mibBuilder.loadTexts: hwVoNumSubstRuleInputFormat.setStatus('current') if mibBuilder.loadTexts: hwVoNumSubstRuleInputFormat.setDescription('This object specifies the input match format that must be of the form ^(\\^)!(\\+)!([0-9ABCD.*%!#]+)(\\$)!$.') hw_vo_num_subst_rule_output_format = mib_table_column((1, 3, 6, 1, 4, 1, 2011, 5, 25, 1, 1, 1, 4, 2, 1, 3), octet_string().subtype(subtypeSpec=value_size_constraint(1, 31))).setMaxAccess('readwrite') if mibBuilder.loadTexts: hwVoNumSubstRuleOutputFormat.setStatus('current') if mibBuilder.loadTexts: hwVoNumSubstRuleOutputFormat.setDescription('This object specifies the output format that must be of the form ^[0-9#.]+$.') hw_vo_num_subst_rule_row_status = mib_table_column((1, 3, 6, 1, 4, 1, 2011, 5, 25, 1, 1, 1, 4, 2, 1, 4), entry_status()).setMaxAccess('readwrite') if mibBuilder.loadTexts: hwVoNumSubstRuleRowStatus.setStatus('current') if mibBuilder.loadTexts: hwVoNumSubstRuleRowStatus.setDescription('This object is used to create a new row or modify or delete an existing row in this table.') hw_vo_max_call_table = mib_table((1, 3, 6, 1, 4, 1, 2011, 5, 25, 1, 1, 1, 5)) if mibBuilder.loadTexts: hwVoMaxCallTable.setStatus('current') if mibBuilder.loadTexts: hwVoMaxCallTable.setDescription('The table stores The table stores the maximum number of allowed connections for a set of voice entities.') hw_vo_max_call_entry = mib_table_row((1, 3, 6, 1, 4, 1, 2011, 5, 25, 1, 1, 1, 5, 1)).setIndexNames((0, 'HUAWEI-VO-GENERAL-MIB', 'hwVoMaxCallTableIndex')) if mibBuilder.loadTexts: hwVoMaxCallEntry.setStatus('current') if mibBuilder.loadTexts: hwVoMaxCallEntry.setDescription('A single value of maximum call connections. One entry per maximum call connections.') hw_vo_max_call_table_index = mib_table_column((1, 3, 6, 1, 4, 1, 2011, 5, 25, 1, 1, 1, 5, 1, 1), integer32().subtype(subtypeSpec=value_range_constraint(1, 2147483647))).setMaxAccess('readonly') if mibBuilder.loadTexts: hwVoMaxCallTableIndex.setStatus('current') if mibBuilder.loadTexts: hwVoMaxCallTableIndex.setDescription('The index uniquely identifies a single maximum call value. It is valid if its value is between 1 and 2147483647.') hw_vo_max_call_value = mib_table_column((1, 3, 6, 1, 4, 1, 2011, 5, 25, 1, 1, 1, 5, 1, 2), integer32().subtype(subtypeSpec=value_range_constraint(0, 120))).setMaxAccess('readwrite') if mibBuilder.loadTexts: hwVoMaxCallValue.setStatus('current') if mibBuilder.loadTexts: hwVoMaxCallValue.setDescription('This object specifies a single maximum call value. It is valid if its value is between 0 and 120.') hw_vo_max_call_table_row_status = mib_table_column((1, 3, 6, 1, 4, 1, 2011, 5, 25, 1, 1, 1, 5, 1, 3), entry_status()).setMaxAccess('readwrite') if mibBuilder.loadTexts: hwVoMaxCallTableRowStatus.setStatus('current') if mibBuilder.loadTexts: hwVoMaxCallTableRowStatus.setDescription('This object is used to create a new row or modify or delete an existing row in this table.') hw_vo_incoming_calling_num_subst_table = mib_table((1, 3, 6, 1, 4, 1, 2011, 5, 25, 1, 1, 1, 6)) if mibBuilder.loadTexts: hwVoIncomingCallingNumSubstTable.setStatus('current') if mibBuilder.loadTexts: hwVoIncomingCallingNumSubstTable.setDescription('The table stores the number-substitute rule list tag that these number-substitute rule list will be used for incoming-call caller number.The table can hold max 32 rows.') hw_vo_incoming_calling_num_subst_entry = mib_table_row((1, 3, 6, 1, 4, 1, 2011, 5, 25, 1, 1, 1, 6, 1)).setIndexNames((0, 'HUAWEI-VO-GENERAL-MIB', 'hwVoIncomingCallingNumSubstIndex')) if mibBuilder.loadTexts: hwVoIncomingCallingNumSubstEntry.setStatus('current') if mibBuilder.loadTexts: hwVoIncomingCallingNumSubstEntry.setDescription('A number-substitute rule list tag. One entry per number-substite rule list tag.') hw_vo_incoming_calling_num_subst_index = mib_table_column((1, 3, 6, 1, 4, 1, 2011, 5, 25, 1, 1, 1, 6, 1, 1), integer32().subtype(subtypeSpec=value_range_constraint(1, 2147483647))).setMaxAccess('readonly') if mibBuilder.loadTexts: hwVoIncomingCallingNumSubstIndex.setStatus('current') if mibBuilder.loadTexts: hwVoIncomingCallingNumSubstIndex.setDescription('This object specifies a number-substitute rule that apply caller number for incoming call. It is valid if its value is between 1 and 2147483647.') hw_vo_incoming_calling_num_subst_row_status = mib_table_column((1, 3, 6, 1, 4, 1, 2011, 5, 25, 1, 1, 1, 6, 1, 2), entry_status()).setMaxAccess('readwrite') if mibBuilder.loadTexts: hwVoIncomingCallingNumSubstRowStatus.setStatus('current') if mibBuilder.loadTexts: hwVoIncomingCallingNumSubstRowStatus.setDescription('This object is used to create a new row or modify or delete an existing row in this table.') hw_vo_incoming_called_num_subst_table = mib_table((1, 3, 6, 1, 4, 1, 2011, 5, 25, 1, 1, 1, 7)) if mibBuilder.loadTexts: hwVoIncomingCalledNumSubstTable.setStatus('current') if mibBuilder.loadTexts: hwVoIncomingCalledNumSubstTable.setDescription('The table stores the number-substitute rule list tag that these number-substitute rule list will be used for incoming-call caller number.The table can hold max 32 rows.') hw_vo_incoming_called_num_subst_entry = mib_table_row((1, 3, 6, 1, 4, 1, 2011, 5, 25, 1, 1, 1, 7, 1)).setIndexNames((0, 'HUAWEI-VO-GENERAL-MIB', 'hwVoIncomingCalledNumSubstIndex')) if mibBuilder.loadTexts: hwVoIncomingCalledNumSubstEntry.setStatus('current') if mibBuilder.loadTexts: hwVoIncomingCalledNumSubstEntry.setDescription('A number-substitute rule list tag. One entry per number-substite rule list tag.') hw_vo_incoming_called_num_subst_index = mib_table_column((1, 3, 6, 1, 4, 1, 2011, 5, 25, 1, 1, 1, 7, 1, 1), integer32().subtype(subtypeSpec=value_range_constraint(1, 2147483647))).setMaxAccess('readonly') if mibBuilder.loadTexts: hwVoIncomingCalledNumSubstIndex.setStatus('current') if mibBuilder.loadTexts: hwVoIncomingCalledNumSubstIndex.setDescription('This object specifies a number-substitute rule that apply caller number for incoming call. It is valid if its value is between 1 and 2147483647.') hw_vo_incoming_called_num_subst_row_status = mib_table_column((1, 3, 6, 1, 4, 1, 2011, 5, 25, 1, 1, 1, 7, 1, 2), entry_status()).setMaxAccess('readwrite') if mibBuilder.loadTexts: hwVoIncomingCalledNumSubstRowStatus.setStatus('current') if mibBuilder.loadTexts: hwVoIncomingCalledNumSubstRowStatus.setDescription('This object is used to create a new row or modify or delete an existing row in this table.') hw_vo_outgoing_calling_num_subst_table = mib_table((1, 3, 6, 1, 4, 1, 2011, 5, 25, 1, 1, 1, 8)) if mibBuilder.loadTexts: hwVoOutgoingCallingNumSubstTable.setStatus('current') if mibBuilder.loadTexts: hwVoOutgoingCallingNumSubstTable.setDescription('The table stores the number-substitute rule list tag that these number-substitute rule list will be used for incoming-call caller number.The table can hold max 32 rows.') hw_vo_outgoing_calling_num_subst_entry = mib_table_row((1, 3, 6, 1, 4, 1, 2011, 5, 25, 1, 1, 1, 8, 1)).setIndexNames((0, 'HUAWEI-VO-GENERAL-MIB', 'hwVoOutgoingCallingNumSubstIndex')) if mibBuilder.loadTexts: hwVoOutgoingCallingNumSubstEntry.setStatus('current') if mibBuilder.loadTexts: hwVoOutgoingCallingNumSubstEntry.setDescription('A number-substitute rule list tag. One entry per number-substite rule list tag.') hw_vo_outgoing_calling_num_subst_index = mib_table_column((1, 3, 6, 1, 4, 1, 2011, 5, 25, 1, 1, 1, 8, 1, 1), integer32().subtype(subtypeSpec=value_range_constraint(1, 2147483647))).setMaxAccess('readonly') if mibBuilder.loadTexts: hwVoOutgoingCallingNumSubstIndex.setStatus('current') if mibBuilder.loadTexts: hwVoOutgoingCallingNumSubstIndex.setDescription('This object specifies a number-substitute rule that apply caller number for incoming call. It is valid if its value is between 1 and 2147483647.') hw_vo_outgoing_calling_num_subst_row_status = mib_table_column((1, 3, 6, 1, 4, 1, 2011, 5, 25, 1, 1, 1, 8, 1, 2), entry_status()).setMaxAccess('readwrite') if mibBuilder.loadTexts: hwVoOutgoingCallingNumSubstRowStatus.setStatus('current') if mibBuilder.loadTexts: hwVoOutgoingCallingNumSubstRowStatus.setDescription('This object is used to create a new row or modify or delete an existing row in this table.') hw_vo_outgoing_called_num_subst_table = mib_table((1, 3, 6, 1, 4, 1, 2011, 5, 25, 1, 1, 1, 9)) if mibBuilder.loadTexts: hwVoOutgoingCalledNumSubstTable.setStatus('current') if mibBuilder.loadTexts: hwVoOutgoingCalledNumSubstTable.setDescription('The table stores the number-substitute rule list tag that these number-substitute rule list will be used for incoming-call caller number.The table can hold max 32 rows.') hw_vo_outgoing_called_num_subst_entry = mib_table_row((1, 3, 6, 1, 4, 1, 2011, 5, 25, 1, 1, 1, 9, 1)).setIndexNames((0, 'HUAWEI-VO-GENERAL-MIB', 'hwVoOutgoingCalledNumSubstIndex')) if mibBuilder.loadTexts: hwVoOutgoingCalledNumSubstEntry.setStatus('current') if mibBuilder.loadTexts: hwVoOutgoingCalledNumSubstEntry.setDescription('A number-substitute rule list tag. One entry per number-substite rule list tag.') hw_vo_outgoing_called_num_subst_index = mib_table_column((1, 3, 6, 1, 4, 1, 2011, 5, 25, 1, 1, 1, 9, 1, 1), integer32().subtype(subtypeSpec=value_range_constraint(1, 2147483647))).setMaxAccess('readonly') if mibBuilder.loadTexts: hwVoOutgoingCalledNumSubstIndex.setStatus('current') if mibBuilder.loadTexts: hwVoOutgoingCalledNumSubstIndex.setDescription('This object specifies a number-substitute rule that apply caller number for incoming call. It is valid if its value is between 1 and 2147483647.') hw_vo_outgoing_called_num_subst_row_status = mib_table_column((1, 3, 6, 1, 4, 1, 2011, 5, 25, 1, 1, 1, 9, 1, 2), entry_status()).setMaxAccess('readwrite') if mibBuilder.loadTexts: hwVoOutgoingCalledNumSubstRowStatus.setStatus('current') if mibBuilder.loadTexts: hwVoOutgoingCalledNumSubstRowStatus.setDescription('This object is used to create a new row or modify or delete an existing row in this table.') mibBuilder.exportSymbols('HUAWEI-VO-GENERAL-MIB', hwVoLtoPPort=hwVoLtoPPort, hwVoNumSubstIndex=hwVoNumSubstIndex, hwVoiceGeneralObjects=hwVoiceGeneralObjects, hwVoNumSubstRuleInputFormat=hwVoNumSubstRuleInputFormat, hwVoNumSubstTable=hwVoNumSubstTable, hwVoDialExpansionTarget=hwVoDialExpansionTarget, hwVoGeneralSendPerformance=hwVoGeneralSendPerformance, hwVoDialExpansionEntry=hwVoDialExpansionEntry, hwVoMaxCallEntry=hwVoMaxCallEntry, hwVoIncomingCalledNumSubstEntry=hwVoIncomingCalledNumSubstEntry, hwVoOutgoingCallingNumSubstTable=hwVoOutgoingCallingNumSubstTable, hwVoGeneralCallTransferSpecialServiceNumber=hwVoGeneralCallTransferSpecialServiceNumber, hwVoMaxCallTable=hwVoMaxCallTable, hwVoNumSubstRuleTable=hwVoNumSubstRuleTable, hwVoOutgoingCalledNumSubstIndex=hwVoOutgoingCalledNumSubstIndex, hwVoGeneralPacketPrecedence=hwVoGeneralPacketPrecedence, hwVoIncomingCallingNumSubstIndex=hwVoIncomingCallingNumSubstIndex, hwVoOutgoingCallingNumSubstEntry=hwVoOutgoingCallingNumSubstEntry, hwVoDialExpansionTable=hwVoDialExpansionTable, hwVoGeneralMatchPolicy=hwVoGeneralMatchPolicy, hwVoLtoPEntry=hwVoLtoPEntry, hwVoGeneralPeerSearchStop=hwVoGeneralPeerSearchStop, hwVoLtoPSlot=hwVoLtoPSlot, hwVoLtoPStatus=hwVoLtoPStatus, hwVoNumSubstRuleRowStatus=hwVoNumSubstRuleRowStatus, hwVoMaxCallValue=hwVoMaxCallValue, hwVoMaxCallTableRowStatus=hwVoMaxCallTableRowStatus, hwVoNumSubstEntry=hwVoNumSubstEntry, hwVoGeneralPeerSelectTypePriority=hwVoGeneralPeerSelectTypePriority, hwVoLtoPBoardType=hwVoLtoPBoardType, hwVoOutgoingCalledNumSubstRowStatus=hwVoOutgoingCalledNumSubstRowStatus, hwVoNumSubstRuleIndex=hwVoNumSubstRuleIndex, hwVoDialExpansionRowStatus=hwVoDialExpansionRowStatus, hwVoIncomingCallingNumSubstEntry=hwVoIncomingCallingNumSubstEntry, hwVoOutgoingCallingNumSubstRowStatus=hwVoOutgoingCallingNumSubstRowStatus, hwVoIncomingCallingNumSubstTable=hwVoIncomingCallingNumSubstTable, hwVoLtoPChannel=hwVoLtoPChannel, hwVoNumSubstRowStatus=hwVoNumSubstRowStatus, hwVoNumSubstDotMatchRule=hwVoNumSubstDotMatchRule, hwVoGeneralDialTerminator=hwVoGeneralDialTerminator, hwVoIncomingCallingNumSubstRowStatus=hwVoIncomingCallingNumSubstRowStatus, PYSNMP_MODULE_ID=hwVoiceGeneralMIB, hwVoOutgoingCalledNumSubstTable=hwVoOutgoingCalledNumSubstTable, hwVoGeneralPeerSelectOrderRule=hwVoGeneralPeerSelectOrderRule, hwVoGeneralCallStart=hwVoGeneralCallStart, hwVoLtoPPortNumber=hwVoLtoPPortNumber, hwVoGeneralCalledTunnel=hwVoGeneralCalledTunnel, hwVoGeneralJitterLen=hwVoGeneralJitterLen, hwVoGeneralReceivePerformance=hwVoGeneralReceivePerformance, hwVoDialExpansionType=hwVoDialExpansionType, hwVoLtoPGroupNumber=hwVoLtoPGroupNumber, hwVoiceNumberSubstGroup=hwVoiceNumberSubstGroup, hwVoIncomingCalledNumSubstTable=hwVoIncomingCalledNumSubstTable, hwVoIncomingCalledNumSubstIndex=hwVoIncomingCalledNumSubstIndex, hwVoNumSubstRuleEntry=hwVoNumSubstRuleEntry, hwVoiceGeneralGroup=hwVoiceGeneralGroup, hwVoNumSubstFirstRule=hwVoNumSubstFirstRule, hwVoIncomingCalledNumSubstRowStatus=hwVoIncomingCalledNumSubstRowStatus, hwVoMaxCallTableIndex=hwVoMaxCallTableIndex, hwVoDialExpansionSource=hwVoDialExpansionSource, hwVoLtoPTable=hwVoLtoPTable, hwVoGeneralDataStatistics=hwVoGeneralDataStatistics, hwVoNumSubstRuleOutputFormat=hwVoNumSubstRuleOutputFormat, hwVoGeneralSpecialServiceEnable=hwVoGeneralSpecialServiceEnable, hwVoOutgoingCalledNumSubstEntry=hwVoOutgoingCalledNumSubstEntry, hwVoLtoPTimeSlot=hwVoLtoPTimeSlot, EntryStatus=EntryStatus, hwVoOutgoingCallingNumSubstIndex=hwVoOutgoingCallingNumSubstIndex, hwVoiceGeneralMIB=hwVoiceGeneralMIB)
#!/usr/bin/env python3 # Day 22: Subarray Sum Equals K # # Given an array of integers and an integer k, you need to find the total # number of continuous subarrays whose sum equals to k. class Solution: def subarraySum(self, nums: [int], k: int) -> int: count = 0 ways_to_sum = {} current_sum = 0 for number in nums: current_sum += number if current_sum == k: count += 1 if current_sum - k in ways_to_sum: count += ways_to_sum[current_sum - k] if current_sum not in ways_to_sum: ways_to_sum[current_sum] = 1 else: ways_to_sum[current_sum] += 1 return count # Tests assert Solution().subarraySum([1,1,1], 2) == 2 assert Solution().subarraySum([1,1], 2) == 1 assert Solution().subarraySum([1,1], 2) == 1 assert Solution().subarraySum([1], 2) == 0 assert Solution().subarraySum([1,2,3], 3) == 2 assert Solution().subarraySum([1,2,3,4,5], 3) == 2 assert Solution().subarraySum([1], 0) == 0 assert Solution().subarraySum([-1,-1,1], 0) == 1
class Solution: def subarray_sum(self, nums: [int], k: int) -> int: count = 0 ways_to_sum = {} current_sum = 0 for number in nums: current_sum += number if current_sum == k: count += 1 if current_sum - k in ways_to_sum: count += ways_to_sum[current_sum - k] if current_sum not in ways_to_sum: ways_to_sum[current_sum] = 1 else: ways_to_sum[current_sum] += 1 return count assert solution().subarraySum([1, 1, 1], 2) == 2 assert solution().subarraySum([1, 1], 2) == 1 assert solution().subarraySum([1, 1], 2) == 1 assert solution().subarraySum([1], 2) == 0 assert solution().subarraySum([1, 2, 3], 3) == 2 assert solution().subarraySum([1, 2, 3, 4, 5], 3) == 2 assert solution().subarraySum([1], 0) == 0 assert solution().subarraySum([-1, -1, 1], 0) == 1
gamemat = [0] * 4 for i in range(4): gamemat[i] = [0] * 4 player = 1 gameEnd = False gameResult = None def readInput(currentPlayer): print("Player " + str(currentPlayer) + " (input x and y, seperated with a space): ", end = "") try: x,y = input().split() x = int(x) y = int(y) except ValueError: print("Invalid move") readInput(currentPlayer) return if x >= 4 or y >= 4 or x <= 0 or y <= 0: print("Invalid move") readInput(currentPlayer) return if gamemat[x][y] != 0: # Occupied print("Invalid move") readInput(currentPlayer) return else: gamemat[x][y] = currentPlayer # 0 => blank / 1 => player 1 / 2 => player 2 global player player = int(not bool(currentPlayer-1)) +1 print("player: " + str(player)) renderGamemat() def printPos(x, y): toPrint = None if gamemat[x][y]: toPrint = "X" if gamemat[x][y] == 1 else "O" else: toPrint = " " return str(toPrint) def renderGamemat(): print(" 1 | 2 | 3 => x-axis") print(" -------------") print(" 1 | " + printPos(1, 1) + " | " + printPos(2, 1) + " | " + printPos(3 ,1) + " |") print(" -------------") print(" 2 | " + printPos(1, 2) + " | " + printPos(2, 2) + " | " + printPos(3, 2) + " |") print(" -------------") print(" 3 | " + printPos(1, 3) + " | " + printPos(2, 3) + " | " + printPos(3, 3) + " |") print(" |") print("y-axis") print() def checkWiningConditions(): g = gamemat # algorithm to be improved later :P for i in range(1,4): # check column if(g[i][1] != 0 and g[i][1] == g[i][2] and g[i][2] == g[i][3] and g[i][1] == g[i][3]): return g[i][1] # check row if(g[1][i] != 0 and g[1][i] == g[2][i] and g[2][i] == g[3][i] and g[1][i] == g[3][i]): return g[1][i] # check diagonal if(g[1][1] != 0 and g[1][1] == g[2][2] and g[2][2] == g[3][3] and g[1][1] == g[3][3]): return g[1][1] if(g[1][3] != 0 and g[1][3] == g[2][2] and g[2][2] == g[3][1] and g[1][3] == g[3][1]): return g[1][3] return 0 def resetAllVar(): global gamemat, player, gameEnd, gameResult gamemat = [0] * 4 for i in range(4): gamemat[i] = [0] * 4 player = 1 gameEnd = False gameResult = None def gameInit(): resetAllVar() gameEnd = False while not gameEnd: for i in range(5): print() renderGamemat() readInput(player) gameResult = checkWiningConditions() if gameResult != 0: gameEnd = True # Game ends print("Player " + str(gameResult) + " wins!") print() print("Do you want to play again? Yes/No/Y/N") tmp = input().lower() if tmp == "yes" or tmp == "y": main() return else: exit() def main(): for i in range(10): print() print("Welcome to Tic Tac Toe") print("This game needs 2 players") print("Press enter to start!") input() gameInit() main()
gamemat = [0] * 4 for i in range(4): gamemat[i] = [0] * 4 player = 1 game_end = False game_result = None def read_input(currentPlayer): print('Player ' + str(currentPlayer) + ' (input x and y, seperated with a space): ', end='') try: (x, y) = input().split() x = int(x) y = int(y) except ValueError: print('Invalid move') read_input(currentPlayer) return if x >= 4 or y >= 4 or x <= 0 or (y <= 0): print('Invalid move') read_input(currentPlayer) return if gamemat[x][y] != 0: print('Invalid move') read_input(currentPlayer) return else: gamemat[x][y] = currentPlayer global player player = int(not bool(currentPlayer - 1)) + 1 print('player: ' + str(player)) render_gamemat() def print_pos(x, y): to_print = None if gamemat[x][y]: to_print = 'X' if gamemat[x][y] == 1 else 'O' else: to_print = ' ' return str(toPrint) def render_gamemat(): print(' 1 | 2 | 3 => x-axis') print(' -------------') print(' 1 | ' + print_pos(1, 1) + ' | ' + print_pos(2, 1) + ' | ' + print_pos(3, 1) + ' |') print(' -------------') print(' 2 | ' + print_pos(1, 2) + ' | ' + print_pos(2, 2) + ' | ' + print_pos(3, 2) + ' |') print(' -------------') print(' 3 | ' + print_pos(1, 3) + ' | ' + print_pos(2, 3) + ' | ' + print_pos(3, 3) + ' |') print(' |') print('y-axis') print() def check_wining_conditions(): g = gamemat for i in range(1, 4): if g[i][1] != 0 and g[i][1] == g[i][2] and (g[i][2] == g[i][3]) and (g[i][1] == g[i][3]): return g[i][1] if g[1][i] != 0 and g[1][i] == g[2][i] and (g[2][i] == g[3][i]) and (g[1][i] == g[3][i]): return g[1][i] if g[1][1] != 0 and g[1][1] == g[2][2] and (g[2][2] == g[3][3]) and (g[1][1] == g[3][3]): return g[1][1] if g[1][3] != 0 and g[1][3] == g[2][2] and (g[2][2] == g[3][1]) and (g[1][3] == g[3][1]): return g[1][3] return 0 def reset_all_var(): global gamemat, player, gameEnd, gameResult gamemat = [0] * 4 for i in range(4): gamemat[i] = [0] * 4 player = 1 game_end = False game_result = None def game_init(): reset_all_var() game_end = False while not gameEnd: for i in range(5): print() render_gamemat() read_input(player) game_result = check_wining_conditions() if gameResult != 0: game_end = True print('Player ' + str(gameResult) + ' wins!') print() print('Do you want to play again? Yes/No/Y/N') tmp = input().lower() if tmp == 'yes' or tmp == 'y': main() return else: exit() def main(): for i in range(10): print() print('Welcome to Tic Tac Toe') print('This game needs 2 players') print('Press enter to start!') input() game_init() main()
## # check_if_correct: # def check_if_correct(): ''' @summary reusable while loop to check if alarm time is correct @desc Infinitely loops as long as the user does not input a "Y" or "N" @author Brandon Benefield @since v1.0.0 @param {void} @return {void} ''' acceptable = False while not acceptable: alarm_accepted = input('Do you confirm? [Y/N]: ').lower() if alarm_accepted == 'y' or alarm_accepted == 'n': return alarm_accepted
def check_if_correct(): """ @summary reusable while loop to check if alarm time is correct @desc Infinitely loops as long as the user does not input a "Y" or "N" @author Brandon Benefield @since v1.0.0 @param {void} @return {void} """ acceptable = False while not acceptable: alarm_accepted = input('Do you confirm? [Y/N]: ').lower() if alarm_accepted == 'y' or alarm_accepted == 'n': return alarm_accepted
# coding: utf-8 __author__ = 'deff' # Andoid-afl.https://github.com/ele7enxxh/android-afl # Fuzzing with libFuzzer. # Droid: Android application fuzzing framework.https://github.com/ajinabraham/Droid-Application-Fuzz-Framework # Writing the worlds worst Android fuzzer, and then improving it, by Gamozo 2018. # Fuzzing Android: a recipe for uncovering vulnerabilities inside system components in Android, by Alexandru Blanda (BlackHat'15). # DoApp (Denial of App): A smart Android Fuzzer for the future.http://www.iswatlab.eu/security-projects/doapp-denial-of-app-a-smart-android-fuzzer-for-the-future/ # Droid-FF.https://github.com/antojoseph/droid-ff
__author__ = 'deff'
def pig_latin(text_input): final = "" # create final string, couples, and split text_input couples = ['bl', 'br', 'ch', 'cl', 'cr', 'dr', 'fl', 'fr', 'gh', 'gl', 'gr', 'ph', 'pl', 'pr', 'qu', 'sh', 'sk', 'sl', 'sm', 'sn', 'sp', 'st', 'sw', 'th', 'tr', 'tw', 'wh', 'wr'] split_text = text_input.strip().lower().split() for i in range(len(split_text)): # test for symbols and numbers if not split_text[i].isalpha(): return "Invalid." for i in range(len(split_text)): # test passed, convert to pig latin word = split_text[i] if word[0] in 'aeiou': # vowel rule if i == 0: final += word.title() else: final += word elif word[0:2] in couples: # first two letters rule if i == 0: final += word[2:].title() else: final += word[2:] final += word[0:2] else: # regular rule if i == 0: final += word[1:].title() else: final += word[1:] final += word[0] final += 'ay ' # add 'ay' return final.strip() if __name__ == '__main__': text = input("Give words: ") print(pig_latin(text))
def pig_latin(text_input): final = '' couples = ['bl', 'br', 'ch', 'cl', 'cr', 'dr', 'fl', 'fr', 'gh', 'gl', 'gr', 'ph', 'pl', 'pr', 'qu', 'sh', 'sk', 'sl', 'sm', 'sn', 'sp', 'st', 'sw', 'th', 'tr', 'tw', 'wh', 'wr'] split_text = text_input.strip().lower().split() for i in range(len(split_text)): if not split_text[i].isalpha(): return 'Invalid.' for i in range(len(split_text)): word = split_text[i] if word[0] in 'aeiou': if i == 0: final += word.title() else: final += word elif word[0:2] in couples: if i == 0: final += word[2:].title() else: final += word[2:] final += word[0:2] else: if i == 0: final += word[1:].title() else: final += word[1:] final += word[0] final += 'ay ' return final.strip() if __name__ == '__main__': text = input('Give words: ') print(pig_latin(text))
lista = [1, 3, 5, 7] lista_animal = ['cachorro', 'gato', 'elefante'] print(lista) print(lista_animal[1]) #Resultado: gato for x in lista_animal: print(x)
lista = [1, 3, 5, 7] lista_animal = ['cachorro', 'gato', 'elefante'] print(lista) print(lista_animal[1]) for x in lista_animal: print(x)
def add(x, y): '''Add two given numbers together ''' return x+y def subtract(x, y): ''' function to substrct x from y and return the remaining value''' return y - x
def add(x, y): """Add two given numbers together """ return x + y def subtract(x, y): """ function to substrct x from y and return the remaining value""" return y - x
# https://leetcode.com/problems/verifying-an-alien-dictionary/ class Solution: def isAlienSorted(self, words: [str], order: str) -> bool: m = {} for i, o in enumerate(order): m[o] = i def is_sorted(w1, w2): for c1, c2 in zip(w1, w2): if m[c1] == m[c2]: continue return m[c1] < m[c2] return len(w1) <= len(w2) for i in range(len(words) - 1): w1 = words[i] w2 = words[i + 1] if not is_sorted(w1, w2): return False return True
class Solution: def is_alien_sorted(self, words: [str], order: str) -> bool: m = {} for (i, o) in enumerate(order): m[o] = i def is_sorted(w1, w2): for (c1, c2) in zip(w1, w2): if m[c1] == m[c2]: continue return m[c1] < m[c2] return len(w1) <= len(w2) for i in range(len(words) - 1): w1 = words[i] w2 = words[i + 1] if not is_sorted(w1, w2): return False return True
# Character Picture Grid Practice Project # Chapter 4 - Lists (Automate the Boring Stuff with Python) # Developer: Valeriy B. def picture_grid(grid): # Creating result list resulted_list = [] # Looping through grid columns for column in range(len(grid[0])): # Creating row string row_grid = "" # Looping through grid rows for row in range(len(grid)): row_grid += grid[row][column] resulted_list.append(row_grid + "\n") print("".join(resulted_list)[:-1]) grid = [[".", ".", ".", ".", ".", "."], [".", "0", "0", ".", ".", "."], ["0", "0", "0", "0", ".", "."], ["0", "0", "0", "0", "0", "."], [".", "0", "0", "0", "0", "0",], ["0", "0", "0", "0", "0", "."], ["0", "0", "0", "0", ".", "."], [".", "0", "0", ".", ".", "."], [".", ".", ".", ".", ".", "."]] picture_grid(grid)
def picture_grid(grid): resulted_list = [] for column in range(len(grid[0])): row_grid = '' for row in range(len(grid)): row_grid += grid[row][column] resulted_list.append(row_grid + '\n') print(''.join(resulted_list)[:-1]) grid = [['.', '.', '.', '.', '.', '.'], ['.', '0', '0', '.', '.', '.'], ['0', '0', '0', '0', '.', '.'], ['0', '0', '0', '0', '0', '.'], ['.', '0', '0', '0', '0', '0'], ['0', '0', '0', '0', '0', '.'], ['0', '0', '0', '0', '.', '.'], ['.', '0', '0', '.', '.', '.'], ['.', '.', '.', '.', '.', '.']] picture_grid(grid)
def index(query): query = query.strip("/") fd = open("css/" + query, "r") return fd.read()
def index(query): query = query.strip('/') fd = open('css/' + query, 'r') return fd.read()
def outer (): def inner(): print(x ) x = 12 inner() outer()
def outer(): def inner(): print(x) x = 12 inner() outer()
print ("--------------------------------------------------") cad1 = "separar" print (cad1) nuevo_string1 = ",".join(cad1) print (nuevo_string1) print ("--------------------------------------------------") cad2 = "mi archivo de texto.txt" print (cad2) nuevo_string2 = cad2.split() nuevo_string2 = "_".join(nuevo_string2) print (nuevo_string2) print ("--------------------------------------------------") cad3 = "su clave es: 1540" print (cad3) nuevo_string3 = cad3.replace(cad3[13:], "XXXX") print (nuevo_string3) print ("--------------------------------------------------") cad4 = "2552552550" print (cad4) nuevo_string4 = cad4.replace("55", "55.") print (nuevo_string4) nuevo_string4 = nuevo_string4.split(".") print (nuevo_string4) nuevo_string4 = ".".join(nuevo_string4) print (nuevo_string4) print ("--------------------------------------------------")
print('--------------------------------------------------') cad1 = 'separar' print(cad1) nuevo_string1 = ','.join(cad1) print(nuevo_string1) print('--------------------------------------------------') cad2 = 'mi archivo de texto.txt' print(cad2) nuevo_string2 = cad2.split() nuevo_string2 = '_'.join(nuevo_string2) print(nuevo_string2) print('--------------------------------------------------') cad3 = 'su clave es: 1540' print(cad3) nuevo_string3 = cad3.replace(cad3[13:], 'XXXX') print(nuevo_string3) print('--------------------------------------------------') cad4 = '2552552550' print(cad4) nuevo_string4 = cad4.replace('55', '55.') print(nuevo_string4) nuevo_string4 = nuevo_string4.split('.') print(nuevo_string4) nuevo_string4 = '.'.join(nuevo_string4) print(nuevo_string4) print('--------------------------------------------------')
def is_even(n): if n % 2 == 0: return True def is_positive(n): if n >= 0: return True def get_result(collection): result = [str(x) for x in collection] return ", ".join(result) numbers = [int(x) for x in input().split(", ")] positive_nums = [] negative_nums = [] even_nums = [] odd_nums = [] for n in numbers: if is_positive(n): positive_nums.append(n) else: negative_nums.append(n) if is_even(n): even_nums.append(n) else: odd_nums.append(n) print(f"Positive: {get_result(positive_nums)}") print(f"Negative: {get_result(negative_nums)}") print(f"Even: {get_result(even_nums)}") print(f"Odd: {get_result(odd_nums)}")
def is_even(n): if n % 2 == 0: return True def is_positive(n): if n >= 0: return True def get_result(collection): result = [str(x) for x in collection] return ', '.join(result) numbers = [int(x) for x in input().split(', ')] positive_nums = [] negative_nums = [] even_nums = [] odd_nums = [] for n in numbers: if is_positive(n): positive_nums.append(n) else: negative_nums.append(n) if is_even(n): even_nums.append(n) else: odd_nums.append(n) print(f'Positive: {get_result(positive_nums)}') print(f'Negative: {get_result(negative_nums)}') print(f'Even: {get_result(even_nums)}') print(f'Odd: {get_result(odd_nums)}')
def multi_print(number = 3, word = "Hallo"): for i in range(0, number): print(str(i) + " " + word) multi_print(1, "Hallo") print("--") multi_print() print("--") multi_print(2) print("--") multi_print(word = "Welt") print("--") multi_print(word = "Welt", number = 5) print("--")
def multi_print(number=3, word='Hallo'): for i in range(0, number): print(str(i) + ' ' + word) multi_print(1, 'Hallo') print('--') multi_print() print('--') multi_print(2) print('--') multi_print(word='Welt') print('--') multi_print(word='Welt', number=5) print('--')
class Solution: def longestSubsequence(self, arr: List[int], diff: int) -> int: dp = {} for num in arr: if num - diff in dp: cnt = dp.pop(num - diff) dp[num] = max(dp.get(num, 0), cnt + 1) else: dp[num] = max(dp.get(num, 0), 1) return max(dp.values())
class Solution: def longest_subsequence(self, arr: List[int], diff: int) -> int: dp = {} for num in arr: if num - diff in dp: cnt = dp.pop(num - diff) dp[num] = max(dp.get(num, 0), cnt + 1) else: dp[num] = max(dp.get(num, 0), 1) return max(dp.values())
numbers = [1, 45, 31, 12, 60] for number in numbers: if number % 8 == 0: print ("THe numbers are unacccepetble") break else: print ("The Numbers are good")
numbers = [1, 45, 31, 12, 60] for number in numbers: if number % 8 == 0: print('THe numbers are unacccepetble') break else: print('The Numbers are good')
class rational: def __init__(self, x, y): gcd = self.__gcd(x, y) self.d = x // gcd # denominator self.n = y // gcd # numerator def __gcd(self, x, y): while y > 0: x, y = y, x % y return x def __add__(self, other): return rational( self.n * other.d + self.d * other.n, self.n * other.n ) def __mul__(self, other): return rational( self.d * other.d, self.n * other.n ) @staticmethod def add(r1, r2): return r1 + r2 @staticmethod def mul(r1, r2): return r1 * r2 def __str__(self): return "{}/{}".format(self.d, self.n) if __name__ == "__main__": r1 = rational(8, 6) r2 = rational(5, 2) print("r1 =", r1) print("r2 =", r2) print("r1 + r2 =", r1 + r2) print("r1 * r2 =", r1 * r2) print("add(r1, r2) =", rational.add(r1, r2)) print("mul(r1, r2) =", rational.mul(r1, r2))
class Rational: def __init__(self, x, y): gcd = self.__gcd(x, y) self.d = x // gcd self.n = y // gcd def __gcd(self, x, y): while y > 0: (x, y) = (y, x % y) return x def __add__(self, other): return rational(self.n * other.d + self.d * other.n, self.n * other.n) def __mul__(self, other): return rational(self.d * other.d, self.n * other.n) @staticmethod def add(r1, r2): return r1 + r2 @staticmethod def mul(r1, r2): return r1 * r2 def __str__(self): return '{}/{}'.format(self.d, self.n) if __name__ == '__main__': r1 = rational(8, 6) r2 = rational(5, 2) print('r1 =', r1) print('r2 =', r2) print('r1 + r2 =', r1 + r2) print('r1 * r2 =', r1 * r2) print('add(r1, r2) =', rational.add(r1, r2)) print('mul(r1, r2) =', rational.mul(r1, r2))
#module for data updating def update_data_set(text_file_name:str, data:{'Time':int, "Mood":int, "Age":int}, class_res:int): '''Given a text file name and data, it will open the text file and update the file with new data in format "int,int,int" ''' file = open(text_file_name, "a") elements_for_data_input=["\n", data['Time'], ',', data['Mood'], ',', data['Age'], ',', class_res] for item in range(len(elements_for_data_input)): file.write(str(elements_for_data_input[item])) file.close()
def update_data_set(text_file_name: str, data: {'Time': int, 'Mood': int, 'Age': int}, class_res: int): """Given a text file name and data, it will open the text file and update the file with new data in format "int,int,int" """ file = open(text_file_name, 'a') elements_for_data_input = ['\n', data['Time'], ',', data['Mood'], ',', data['Age'], ',', class_res] for item in range(len(elements_for_data_input)): file.write(str(elements_for_data_input[item])) file.close()
number_for_fibonacci = int(input("Enter Fibonacci number: ")) first_num = 0 second_num = 1 while second_num <= number_for_fibonacci: print(second_num) first_num, second_num = second_num, first_num + second_num print("Fibonacci number")
number_for_fibonacci = int(input('Enter Fibonacci number: ')) first_num = 0 second_num = 1 while second_num <= number_for_fibonacci: print(second_num) (first_num, second_num) = (second_num, first_num + second_num) print('Fibonacci number')
def collected_materials(key_materials_dict:dict, junk_materials_dict:dict, material:str, quantity:int): if material=="shards" or material=="fragments" or material=="motes": key_materials_dict[material]+=quantity else: if material not in junk_materials.keys(): junk_materials[material]=quantity else: junk_materials[material]+=quantity key_materials = {"shards": 0, "fragments": 0, "motes": 0} junk_materials={} items_obtained="" while items_obtained == "": current_line=input().split() for i in range (0,len(current_line),2): material_quantity=int(current_line[i]) material_name=current_line[i+1].lower() collected_materials(key_materials,junk_materials,material_name,material_quantity) if key_materials['shards']>=250: items_obtained="Shadowmourne" key_materials["shards"]-=250 break elif key_materials['fragments']>=250: items_obtained="Valanyr" key_materials['fragments']-=250 break elif key_materials['motes']>=250: items_obtained="Dragonwrath" key_materials['motes']-=250 break print(f"{items_obtained} obtained!") for (material_name,material_quantity) in sorted(key_materials.items(),key=lambda kvp:(-kvp[1],kvp[0])): print(f"{material_name}: {material_quantity}") for (junk_materials_name,junk_materials_quantity) in sorted(junk_materials.items(), key=lambda kvp: kvp[0]): print(f"{junk_materials_name}: {junk_materials_quantity}")
def collected_materials(key_materials_dict: dict, junk_materials_dict: dict, material: str, quantity: int): if material == 'shards' or material == 'fragments' or material == 'motes': key_materials_dict[material] += quantity elif material not in junk_materials.keys(): junk_materials[material] = quantity else: junk_materials[material] += quantity key_materials = {'shards': 0, 'fragments': 0, 'motes': 0} junk_materials = {} items_obtained = '' while items_obtained == '': current_line = input().split() for i in range(0, len(current_line), 2): material_quantity = int(current_line[i]) material_name = current_line[i + 1].lower() collected_materials(key_materials, junk_materials, material_name, material_quantity) if key_materials['shards'] >= 250: items_obtained = 'Shadowmourne' key_materials['shards'] -= 250 break elif key_materials['fragments'] >= 250: items_obtained = 'Valanyr' key_materials['fragments'] -= 250 break elif key_materials['motes'] >= 250: items_obtained = 'Dragonwrath' key_materials['motes'] -= 250 break print(f'{items_obtained} obtained!') for (material_name, material_quantity) in sorted(key_materials.items(), key=lambda kvp: (-kvp[1], kvp[0])): print(f'{material_name}: {material_quantity}') for (junk_materials_name, junk_materials_quantity) in sorted(junk_materials.items(), key=lambda kvp: kvp[0]): print(f'{junk_materials_name}: {junk_materials_quantity}')
t_host = "localhost" t_port = "5432" t_dbname = "insert_db_name" t_user = "insert_user" t_pw = "insert_pw" photo_request_data = { "CAD6E": { "id": 218, "coords_x": -5.9357153, "coords_y": 54.5974748, "land_hash": "1530850C9A6F5FF56B66AC16301584EC" }, "TEST1": { "id": 1, "coords_x": 11.111111, "coords_y": 22.222222, "land_hash": "11111111111111111111111" } }
t_host = 'localhost' t_port = '5432' t_dbname = 'insert_db_name' t_user = 'insert_user' t_pw = 'insert_pw' photo_request_data = {'CAD6E': {'id': 218, 'coords_x': -5.9357153, 'coords_y': 54.5974748, 'land_hash': '1530850C9A6F5FF56B66AC16301584EC'}, 'TEST1': {'id': 1, 'coords_x': 11.111111, 'coords_y': 22.222222, 'land_hash': '11111111111111111111111'}}
def algorithm(K1,K2, B, weight_vec, datapoints, true_labels, lambda_lasso, penalty_func_name='norm1', calculate_score=False): ''' Outer loop is gradient ascent algorithm, the variable 'new_weight_vec' here is the dual variable we are interested in Inner loop is still our Nlasso algorithm :param K1,K2 : the number of iterations :param D: the block incidence matrix :param weight_vec: a list containing the edges's weights of the graph :param datapoints: a dictionary containing the data of each node in the graph needed for the algorithm 1 :param true_labels: a list containing the true labels of the nodes :param samplingset: the sampling set :param lambda_lasso: the parameter lambda :param penalty_func_name: the name of the penalty function used in the algorithm :return new_w: the predicted weigh vectors for each node ''' ''' Sigma: the block diagonal matrix Sigma ''' Sigma = np.diag(np.full(weight_vec.shape, 0.9 / 2)) T_matrix = np.diag(np.array((1.0 / (np.sum(abs(B), 0)))).ravel()) ''' T_matrix: the block diagonal matrix T ''' E, N = B.shape ''' shape of the graph ''' m, n = datapoints[1]['features'].shape ''' shape of the feature vectors of each node in the graph ''' # # define the penalty function # if penalty_func_name == 'norm1': # penalty_func = Norm1Pelanty(lambda_lasso, weight_vec, Sigma, n) # elif penalty_func_name == 'norm2': # penalty_func = Norm2Pelanty(lambda_lasso, weight_vec, Sigma, n) # elif penalty_func_name == 'mocha': # penalty_func = MOCHAPelanty(lambda_lasso, weight_vec, Sigma, n) # else: # raise Exception('Invalid penalty name') new_w = np.array([np.zeros(n) for i in range(N)]) new_u = np.array([np.zeros(n) for i in range(E)]) new_weight_vec = weight_vec # starting algorithm 1 Loss = {} iteration_scores = [] for j in range(K1): new_B = np.dot(np.diag(new_weight_vec),B) T_matrix = np.diag(np.array((1.0 / (np.sum(abs(new_B), 0)))).ravel()) T = np.array((1.0 / (np.sum(abs(new_B), 0)))).ravel() for iterk in range(K2): # if iterk % 100 == 0: # print ('iter:', iterk) prev_w = np.copy(new_w) # line 2 algorithm 1 hat_w = new_w - np.dot(T_matrix, np.dot(new_B.T, new_u)) for i in range(N): optimizer = datapoints[i]['optimizer'] new_w[i] = optimizer.optimize(datapoints[i]['features'], datapoints[i]['label'], hat_w[i], T[i]) # line 9 algortihm 1 tilde_w = 2 * new_w - prev_w new_u = new_u + np.dot(Sigma, np.dot(new_B, tilde_w)) penalty_func = Norm1Pelanty(lambda_lasso, new_weight_vec, Sigma, n) new_u = penalty_func.update(new_u) new_weight_vec = new_weight_vec +0.1*np.linalg.norm(np.dot(B, new_w),ord=1,axis=1) # # calculate the MSE of the predicted weight vectors # if calculate_score: # Y_pred = [] # for i in range(N): # Y_pred.append(np.dot(datapoints[i]['features'], new_w[i])) # iteration_scores.append(mean_squared_error(true_labels.reshape(N, m), Y_pred)) Loss[j] = total_loss(datapoints,new_w,new_B,new_weight_vec) return new_w, new_weight_vec,Loss,iteration_scores
def algorithm(K1, K2, B, weight_vec, datapoints, true_labels, lambda_lasso, penalty_func_name='norm1', calculate_score=False): """ Outer loop is gradient ascent algorithm, the variable 'new_weight_vec' here is the dual variable we are interested in Inner loop is still our Nlasso algorithm :param K1,K2 : the number of iterations :param D: the block incidence matrix :param weight_vec: a list containing the edges's weights of the graph :param datapoints: a dictionary containing the data of each node in the graph needed for the algorithm 1 :param true_labels: a list containing the true labels of the nodes :param samplingset: the sampling set :param lambda_lasso: the parameter lambda :param penalty_func_name: the name of the penalty function used in the algorithm :return new_w: the predicted weigh vectors for each node """ '\n Sigma: the block diagonal matrix Sigma\n \n \n ' sigma = np.diag(np.full(weight_vec.shape, 0.9 / 2)) t_matrix = np.diag(np.array(1.0 / np.sum(abs(B), 0)).ravel()) '\n T_matrix: the block diagonal matrix T\n ' (e, n) = B.shape '\n shape of the graph\n ' (m, n) = datapoints[1]['features'].shape '\n shape of the feature vectors of each node in the graph\n ' new_w = np.array([np.zeros(n) for i in range(N)]) new_u = np.array([np.zeros(n) for i in range(E)]) new_weight_vec = weight_vec loss = {} iteration_scores = [] for j in range(K1): new_b = np.dot(np.diag(new_weight_vec), B) t_matrix = np.diag(np.array(1.0 / np.sum(abs(new_B), 0)).ravel()) t = np.array(1.0 / np.sum(abs(new_B), 0)).ravel() for iterk in range(K2): prev_w = np.copy(new_w) hat_w = new_w - np.dot(T_matrix, np.dot(new_B.T, new_u)) for i in range(N): optimizer = datapoints[i]['optimizer'] new_w[i] = optimizer.optimize(datapoints[i]['features'], datapoints[i]['label'], hat_w[i], T[i]) tilde_w = 2 * new_w - prev_w new_u = new_u + np.dot(Sigma, np.dot(new_B, tilde_w)) penalty_func = norm1_pelanty(lambda_lasso, new_weight_vec, Sigma, n) new_u = penalty_func.update(new_u) new_weight_vec = new_weight_vec + 0.1 * np.linalg.norm(np.dot(B, new_w), ord=1, axis=1) Loss[j] = total_loss(datapoints, new_w, new_B, new_weight_vec) return (new_w, new_weight_vec, Loss, iteration_scores)
#!/usr/bin/env python2 class RDHSSet: def __init__(self, path): with open(path, 'r') as f: self.regions = [ tuple(line.strip().split()[:4]) for line in f ] self.indexmap = { x: i for i, x in enumerate(self.regions) } self.accessionIndexMap = { x[-1]: i for i, x in enumerate(self.regions) } def __len__(self): return len(self.regions) def indexesForChromosome(self, chromosome): return { self.indexmap[x] for x in self.regions if x[0] == chromosome } def indexesForChromosomes(self, chromosomes): r = set() for x in chromosomes: r = r.union(self.indexesForChromosome(x)) return r def accessionsForChromosome(self, chromosome): return { x[-1] for x in self.regions if x[0] == chromosome }
class Rdhsset: def __init__(self, path): with open(path, 'r') as f: self.regions = [tuple(line.strip().split()[:4]) for line in f] self.indexmap = {x: i for (i, x) in enumerate(self.regions)} self.accessionIndexMap = {x[-1]: i for (i, x) in enumerate(self.regions)} def __len__(self): return len(self.regions) def indexes_for_chromosome(self, chromosome): return {self.indexmap[x] for x in self.regions if x[0] == chromosome} def indexes_for_chromosomes(self, chromosomes): r = set() for x in chromosomes: r = r.union(self.indexesForChromosome(x)) return r def accessions_for_chromosome(self, chromosome): return {x[-1] for x in self.regions if x[0] == chromosome}
def getLeapYear(year): while True: if year%400==0: return year elif year%4==0 and year%100!=0: return year else: year +=1 if __name__=='__main__': leap_year_list = [] cur_year = int(input("Enter any year :")) leap_year = getLeapYear(cur_year) for i in range(15): leap_year_list.append(leap_year) leap_year +=4 print(leap_year_list)
def get_leap_year(year): while True: if year % 400 == 0: return year elif year % 4 == 0 and year % 100 != 0: return year else: year += 1 if __name__ == '__main__': leap_year_list = [] cur_year = int(input('Enter any year :')) leap_year = get_leap_year(cur_year) for i in range(15): leap_year_list.append(leap_year) leap_year += 4 print(leap_year_list)
for number in range(1, 101): if number % 3 == 0 and number % 5 == 0: print(f"{number} FizzBuzz") elif number % 3 == 0: print(f"{number} Fizz") elif number % 5 == 0: print(f"{number} Buzz") else: print(number)
for number in range(1, 101): if number % 3 == 0 and number % 5 == 0: print(f'{number} FizzBuzz') elif number % 3 == 0: print(f'{number} Fizz') elif number % 5 == 0: print(f'{number} Buzz') else: print(number)
{{notice}} workers = 4 errorlog = "{{proj_root}}/run/log/gunicorn.error" accesslog = "{{proj_root}}/run/log/gunicorn.access" loglevel = "debug" bind = ["127.0.0.1:9001"]
{{notice}} workers = 4 errorlog = '{{proj_root}}/run/log/gunicorn.error' accesslog = '{{proj_root}}/run/log/gunicorn.access' loglevel = 'debug' bind = ['127.0.0.1:9001']
class Relevance(object): '''Incooperation with result file and qrels file Attributes: qid, int, query id judgement_docid_list: list of list, judged docids in TREC qrels supervised_docid_list: list, top docids from unsupervised models, e.g. BM25, QL. ''' def __init__(self, qid, judged_docid_list, supervised_docid_list, supervised_score_list): self._qid = qid self._judged_docid_list = judged_docid_list self._supervised_docid_list = supervised_docid_list self._supervised_score_list = supervised_score_list def get_qid(self): return self._qid def get_judged_docid_list(self): return self._judged_docid_list def get_supervised_docid_list(self): return self._supervised_docid_list def get_supervised_score_list(self): return self._supervised_score_list
class Relevance(object): """Incooperation with result file and qrels file Attributes: qid, int, query id judgement_docid_list: list of list, judged docids in TREC qrels supervised_docid_list: list, top docids from unsupervised models, e.g. BM25, QL. """ def __init__(self, qid, judged_docid_list, supervised_docid_list, supervised_score_list): self._qid = qid self._judged_docid_list = judged_docid_list self._supervised_docid_list = supervised_docid_list self._supervised_score_list = supervised_score_list def get_qid(self): return self._qid def get_judged_docid_list(self): return self._judged_docid_list def get_supervised_docid_list(self): return self._supervised_docid_list def get_supervised_score_list(self): return self._supervised_score_list
def our_range(*args): start = 0 end = 10 step = 1 if len(args) == 1: end = args[0] elif 2 <= len(args) <= 3: start = args[0] end = args[1] if len(args) == 3: step = args[2] elif len(args) > 3: raise SyntaxError i = start while i < end: yield i i += step for j in our_range(5): print(j) print() for j in our_range(2, 6): print(j) print() for j in our_range(3, 30, 9): print(j)
def our_range(*args): start = 0 end = 10 step = 1 if len(args) == 1: end = args[0] elif 2 <= len(args) <= 3: start = args[0] end = args[1] if len(args) == 3: step = args[2] elif len(args) > 3: raise SyntaxError i = start while i < end: yield i i += step for j in our_range(5): print(j) print() for j in our_range(2, 6): print(j) print() for j in our_range(3, 30, 9): print(j)
def part1(input_data): numbers, boards = parse_input(input_data) for number in numbers: # Put number on all boards for board in boards: for row in board: for i in range(len(row)): if number == row[i]: row[i] = "x" # Check for bingo for board in boards: for row in board: if "".join(row) == "xxxxx": return int(number) * unmarked_sum(board) for column in zip(*board): if "".join(column) == "xxxxx": return int(number) * unmarked_sum(board) def part2(input_data): numbers, boards = parse_input(input_data) board_scores = [0 for x in boards] last_index = None for number in numbers: # Put number on all boards for board in boards: for row in board: for i in range(len(row)): if number == row[i]: row[i] = "x" # Check for bingo for i, board in enumerate(boards): for row in board: if "".join(row) == "xxxxx" and board_scores[i] == 0: board_scores[i] = int(number) * unmarked_sum(board) last_index = i for column in zip(*board): if "".join(column) == "xxxxx" and board_scores[i] == 0: board_scores[i] = int(number) * unmarked_sum(board) last_index = i return board_scores[last_index] def unmarked_sum(board): return sum( map( lambda x: sum(map(lambda y: int(y) if y != "x" else 0, x)), board, ) ) def parse_input(input_data): numbers = input_data[0].split(",") boards = [] for i in range(1, len(input_data), 6): rows = input_data[i + 1 : i + 6] rows = list( map(lambda x: list(filter(lambda y: len(y) > 0, x.split(" "))), rows) ) boards.append(rows) return numbers, boards if __name__ == "__main__": with open("input", "r") as input_file: input_data = list(map(lambda x: x.strip(), input_file.readlines())) print(part1(input_data)) print(part2(input_data))
def part1(input_data): (numbers, boards) = parse_input(input_data) for number in numbers: for board in boards: for row in board: for i in range(len(row)): if number == row[i]: row[i] = 'x' for board in boards: for row in board: if ''.join(row) == 'xxxxx': return int(number) * unmarked_sum(board) for column in zip(*board): if ''.join(column) == 'xxxxx': return int(number) * unmarked_sum(board) def part2(input_data): (numbers, boards) = parse_input(input_data) board_scores = [0 for x in boards] last_index = None for number in numbers: for board in boards: for row in board: for i in range(len(row)): if number == row[i]: row[i] = 'x' for (i, board) in enumerate(boards): for row in board: if ''.join(row) == 'xxxxx' and board_scores[i] == 0: board_scores[i] = int(number) * unmarked_sum(board) last_index = i for column in zip(*board): if ''.join(column) == 'xxxxx' and board_scores[i] == 0: board_scores[i] = int(number) * unmarked_sum(board) last_index = i return board_scores[last_index] def unmarked_sum(board): return sum(map(lambda x: sum(map(lambda y: int(y) if y != 'x' else 0, x)), board)) def parse_input(input_data): numbers = input_data[0].split(',') boards = [] for i in range(1, len(input_data), 6): rows = input_data[i + 1:i + 6] rows = list(map(lambda x: list(filter(lambda y: len(y) > 0, x.split(' '))), rows)) boards.append(rows) return (numbers, boards) if __name__ == '__main__': with open('input', 'r') as input_file: input_data = list(map(lambda x: x.strip(), input_file.readlines())) print(part1(input_data)) print(part2(input_data))
load("@bazel_skylib//lib:paths.bzl", "paths") load( "//caffe2/test:defs.bzl", "define_tests", ) def define_pipeline_tests(): test_files = native.glob(["**/test_*.py"]) TESTS = {} for test_file in test_files: test_file_name = paths.basename(test_file) test_name = test_file_name.replace("test_", "").replace(".py", "") TESTS[test_name] = [test_file] define_tests( pytest = True, tests = TESTS, external_deps = [("pytest", None)], resources = ["conftest.py"], )
load('@bazel_skylib//lib:paths.bzl', 'paths') load('//caffe2/test:defs.bzl', 'define_tests') def define_pipeline_tests(): test_files = native.glob(['**/test_*.py']) tests = {} for test_file in test_files: test_file_name = paths.basename(test_file) test_name = test_file_name.replace('test_', '').replace('.py', '') TESTS[test_name] = [test_file] define_tests(pytest=True, tests=TESTS, external_deps=[('pytest', None)], resources=['conftest.py'])
# definitions.py IbConfig = { 'telepotChatId': '572145851', 'googleServiceKeyFile' : 'GoogleCloudServiceKey.json', 'telepotToken' : '679545486:AAEbCBdedlJ1lxFXpN1a-J-6LfgFQ4cAp04', 'startMessage' : 'Hallo, ich bin unsere dolmetschende Eule. Stelle mich bitte auf deine Handflaeche und ich sage dir, was dein tauber Gegenueber schreibt. Wenn du etwas sagst, teile ich das deinem Gegenueber mit', 'listenLanguage' : 'de_DE', # de_DE, en_US, en_UK, en_AU, etc. See https://cloud.google.com/speech-to-text/docs/languages 'speakLanguage' : 'de', # de, en_US, en_UK, en_AU. See gtts-cli --all 'micDeviceIndex' : 0, }
ib_config = {'telepotChatId': '572145851', 'googleServiceKeyFile': 'GoogleCloudServiceKey.json', 'telepotToken': '679545486:AAEbCBdedlJ1lxFXpN1a-J-6LfgFQ4cAp04', 'startMessage': 'Hallo, ich bin unsere dolmetschende Eule. Stelle mich bitte auf deine Handflaeche und ich sage dir, was dein tauber Gegenueber schreibt. Wenn du etwas sagst, teile ich das deinem Gegenueber mit', 'listenLanguage': 'de_DE', 'speakLanguage': 'de', 'micDeviceIndex': 0}
class Graph: def __init__(self,nodes,edges): self.graph=[] for i in range(nodes+1): self.graph.append([]) self.visited=[False]*(len(self.graph)) def addEdge(self,v1,v2): self.graph[v1].append(v2) def dfs(self,source): self.visited[source]=True print(source) for i in self.graph[source]: if not self.visited[i]: self.dfs(i) def dfs_stack(self,source): stack=[] stack.append(source) self.visited[source] = True while stack: top=stack.pop() print(top) for i in self.graph[top]: if not self.visited[i]: stack.append(i) self.visited[i]=True g=Graph(4,5) g.addEdge(1,2) g.addEdge(1,3) g.addEdge(1,4) g.addEdge(3,4) g.addEdge(4,2) g.dfs_stack(1)
class Graph: def __init__(self, nodes, edges): self.graph = [] for i in range(nodes + 1): self.graph.append([]) self.visited = [False] * len(self.graph) def add_edge(self, v1, v2): self.graph[v1].append(v2) def dfs(self, source): self.visited[source] = True print(source) for i in self.graph[source]: if not self.visited[i]: self.dfs(i) def dfs_stack(self, source): stack = [] stack.append(source) self.visited[source] = True while stack: top = stack.pop() print(top) for i in self.graph[top]: if not self.visited[i]: stack.append(i) self.visited[i] = True g = graph(4, 5) g.addEdge(1, 2) g.addEdge(1, 3) g.addEdge(1, 4) g.addEdge(3, 4) g.addEdge(4, 2) g.dfs_stack(1)
inp = list(map(float, input().split())) inp.sort(reverse=True) a, b, c = inp if a >= b + c: print('NAO FORMA TRIANGULO') else: if a ** 2 == b ** 2 + c ** 2: print('TRIANGULO RETANGULO') elif a ** 2 > b ** 2 + c ** 2: print('TRIANGULO OBTUSANGULO') else: print('TRIANGULO ACUTANGULO') if a == b and b == c: print('TRIANGULO EQUILATERO') elif a == b or a == c or b == c: print('TRIANGULO ISOSCELES')
inp = list(map(float, input().split())) inp.sort(reverse=True) (a, b, c) = inp if a >= b + c: print('NAO FORMA TRIANGULO') else: if a ** 2 == b ** 2 + c ** 2: print('TRIANGULO RETANGULO') elif a ** 2 > b ** 2 + c ** 2: print('TRIANGULO OBTUSANGULO') else: print('TRIANGULO ACUTANGULO') if a == b and b == c: print('TRIANGULO EQUILATERO') elif a == b or a == c or b == c: print('TRIANGULO ISOSCELES')
__all__ = ['CONFIG', 'get'] CONFIG = { 'model_save_dir': "./output/MicroExpression", 'num_classes': 7, 'total_images': 17245, 'epochs': 20, 'batch_size': 32, 'image_shape': [3, 224, 224], 'LEARNING_RATE': { 'params': { 'lr': 0.00375 } }, 'OPTIMIZER': { 'params': { 'momentum': 0.9 }, 'regularizer': { 'function': 'L2', 'factor': 0.000001 } }, 'LABEL_MAP': [ "disgust", "others", "sadness", "happiness", "surprise", "repression", "fear" ] } def get(full_path): for id, name in enumerate(full_path.split('.')): if id == 0: config = CONFIG config = config[name] return config
__all__ = ['CONFIG', 'get'] config = {'model_save_dir': './output/MicroExpression', 'num_classes': 7, 'total_images': 17245, 'epochs': 20, 'batch_size': 32, 'image_shape': [3, 224, 224], 'LEARNING_RATE': {'params': {'lr': 0.00375}}, 'OPTIMIZER': {'params': {'momentum': 0.9}, 'regularizer': {'function': 'L2', 'factor': 1e-06}}, 'LABEL_MAP': ['disgust', 'others', 'sadness', 'happiness', 'surprise', 'repression', 'fear']} def get(full_path): for (id, name) in enumerate(full_path.split('.')): if id == 0: config = CONFIG config = config[name] return config
n=str(input("Enter the string")) le=len(n) dig=0 alp=0 for i in range(le): if n[i].isdigit(): dig=dig+1 elif n[i].isalpha(): alp=alp+1 else: continue print("Letters count is : %d"%alp) print("Digits count is : %d"%dig)
n = str(input('Enter the string')) le = len(n) dig = 0 alp = 0 for i in range(le): if n[i].isdigit(): dig = dig + 1 elif n[i].isalpha(): alp = alp + 1 else: continue print('Letters count is : %d' % alp) print('Digits count is : %d' % dig)
#Given a decimal number n, your task is to convert it #to its binary equivalent using a recursive function. #The binary number output must be of length 8 bits. def binary(n): if n == 0: return 0 else: return (n % 2 + 10*binary(int(n // 2))) def convert_8_bit(n): s = str(n) while len(s)<8: s = '0' + s return s def dec_to_binary(n): return convert_8_bit(binary(n)) def main(): T = int(input()) n = [] for _ in range(0,T): temp = int(input()) n.append(dec_to_binary(temp)) print(*n,sep="\n") if __name__=='__main__': try: main() except: pass
def binary(n): if n == 0: return 0 else: return n % 2 + 10 * binary(int(n // 2)) def convert_8_bit(n): s = str(n) while len(s) < 8: s = '0' + s return s def dec_to_binary(n): return convert_8_bit(binary(n)) def main(): t = int(input()) n = [] for _ in range(0, T): temp = int(input()) n.append(dec_to_binary(temp)) print(*n, sep='\n') if __name__ == '__main__': try: main() except: pass
''' Author: Shuailin Chen Created Date: 2021-09-14 Last Modified: 2021-12-29 content: ''' # optimizer optimizer = dict(type='SGD', lr=0.01, momentum=0.9, weight_decay=0.0005) optimizer_config = dict() # learning policy lr_config = dict(policy='poly', power=0.9, min_lr=1e-4, by_epoch=False) # runtime settings runner = dict(type='MyIterBasedRunner', max_iters=10000) # runner = dict(type='IterBasedRunner', max_iters=20000) checkpoint_config = dict(by_epoch=False, interval=100000) # evaluation = dict(interval=50, metric='mIoU', pre_eval=True) evaluation = dict(interval=1000, metric='mIoU', pre_eval=True)
""" Author: Shuailin Chen Created Date: 2021-09-14 Last Modified: 2021-12-29 content: """ optimizer = dict(type='SGD', lr=0.01, momentum=0.9, weight_decay=0.0005) optimizer_config = dict() lr_config = dict(policy='poly', power=0.9, min_lr=0.0001, by_epoch=False) runner = dict(type='MyIterBasedRunner', max_iters=10000) checkpoint_config = dict(by_epoch=False, interval=100000) evaluation = dict(interval=1000, metric='mIoU', pre_eval=True)
keys = { "accept": 30, "add": 107, "apps": 93, "attn": 246, "back": 8, "browser_back": 166, "browser_forward": 167, "cancel": 3, "capital": 20, "clear": 12, "control": 17, "convert": 28, "crsel": 247, "decimal": 110, "delete": 46, "divide": 111, "down": 40, "end": 35, "ereof": 249, "escape": 27, "execute": 43, "exsel": 248, "f1": 112, "f10": 121, "f11": 122, "f12": 123, "f13": 124, "f14": 125, "f15": 126, "f16": 127, "f17": 128, "f18": 129, "f19": 130, "f2": 113, "f20": 131, "f21": 132, "f22": 133, "f23": 134, "f24": 135, "f3": 114, "f4": 115, "f5": 116, "f6": 117, "f7": 118, "f8": 119, "f9": 120, "final": 24, "hangeul": 21, "hangul": 21, "hanja": 25, "help": 47, "home": 36, "insert": 45, "junja": 23, "kana": 21, "kanji": 25, "lbutton": 1, "lcontrol": 162, "left": 37, "lmenu": 164, "lshift": 160, "lwin": 91, "mbutton": 4, "media_next_track": 176, "media_play_pause": 179, "media_prev_track": 177, "menu": 18, "modechange": 31, "multiply": 106, "next": 34, "noname": 252, "nonconvert": 29, "numlock": 144, "numpad0": 96, "numpad1": 97, "numpad2": 98, "numpad3": 99, "numpad4": 100, "numpad5": 101, "numpad6": 102, "numpad7": 103, "numpad8": 104, "numpad9": 105, "oem_clear": 254, "pa1": 253, "pagedown": 34, "pageup": 33, "pause": 19, "play": 250, "print": 42, "prior": 33, "processkey": 229, "rbutton": 2, "rcontrol": 163, "return": 13, "right": 39, "rmenu": 165, "rshift": 161, "rwin": 92, "scroll": 145, "select": 41, "separator": 108, "shift": 16, "snapshot": 44, "space": 32, "subtract": 109, "tab": 9, "up": 38, "volume_down": 174, "volume_mute": 173, "volume_up": 175, "xbutton1": 5, "xbutton2": 6, "zoom": 251, "/": 191, ";": 218, "[": 219, "\\": 220, "]": 221, "'": 222, "=": 187, "-": 189, ";": 186, } modifiers = {"alt": 1, "control": 2, "shift": 4, "win": 8}
keys = {'accept': 30, 'add': 107, 'apps': 93, 'attn': 246, 'back': 8, 'browser_back': 166, 'browser_forward': 167, 'cancel': 3, 'capital': 20, 'clear': 12, 'control': 17, 'convert': 28, 'crsel': 247, 'decimal': 110, 'delete': 46, 'divide': 111, 'down': 40, 'end': 35, 'ereof': 249, 'escape': 27, 'execute': 43, 'exsel': 248, 'f1': 112, 'f10': 121, 'f11': 122, 'f12': 123, 'f13': 124, 'f14': 125, 'f15': 126, 'f16': 127, 'f17': 128, 'f18': 129, 'f19': 130, 'f2': 113, 'f20': 131, 'f21': 132, 'f22': 133, 'f23': 134, 'f24': 135, 'f3': 114, 'f4': 115, 'f5': 116, 'f6': 117, 'f7': 118, 'f8': 119, 'f9': 120, 'final': 24, 'hangeul': 21, 'hangul': 21, 'hanja': 25, 'help': 47, 'home': 36, 'insert': 45, 'junja': 23, 'kana': 21, 'kanji': 25, 'lbutton': 1, 'lcontrol': 162, 'left': 37, 'lmenu': 164, 'lshift': 160, 'lwin': 91, 'mbutton': 4, 'media_next_track': 176, 'media_play_pause': 179, 'media_prev_track': 177, 'menu': 18, 'modechange': 31, 'multiply': 106, 'next': 34, 'noname': 252, 'nonconvert': 29, 'numlock': 144, 'numpad0': 96, 'numpad1': 97, 'numpad2': 98, 'numpad3': 99, 'numpad4': 100, 'numpad5': 101, 'numpad6': 102, 'numpad7': 103, 'numpad8': 104, 'numpad9': 105, 'oem_clear': 254, 'pa1': 253, 'pagedown': 34, 'pageup': 33, 'pause': 19, 'play': 250, 'print': 42, 'prior': 33, 'processkey': 229, 'rbutton': 2, 'rcontrol': 163, 'return': 13, 'right': 39, 'rmenu': 165, 'rshift': 161, 'rwin': 92, 'scroll': 145, 'select': 41, 'separator': 108, 'shift': 16, 'snapshot': 44, 'space': 32, 'subtract': 109, 'tab': 9, 'up': 38, 'volume_down': 174, 'volume_mute': 173, 'volume_up': 175, 'xbutton1': 5, 'xbutton2': 6, 'zoom': 251, '/': 191, ';': 218, '[': 219, '\\': 220, ']': 221, "'": 222, '=': 187, '-': 189, ';': 186} modifiers = {'alt': 1, 'control': 2, 'shift': 4, 'win': 8}
N = int(input()) A = list(map(int, input().split())) A.sort() left, right = 0, 2*N-1 moist = A.count(0) // 2 while left < right and A[left] < 0 and A[right] > 0: if abs(A[left]) == A[right]: moist += 1 left += 1 right -= 1 elif abs(A[left]) > A[right]: left += 1 else: right -= 1 left, right = 0, 2*N-1 wet = 0 while left < right: if A[left] + A[right] <= 0: left += 1 else: wet += 1 left += 1 right -= 1 left, right = 0, 2*N-1 dry = 0 while left < right: if A[left] + A[right] >= 0: right -= 1 else: dry += 1 left += 1 right -= 1 print(dry, wet, moist)
n = int(input()) a = list(map(int, input().split())) A.sort() (left, right) = (0, 2 * N - 1) moist = A.count(0) // 2 while left < right and A[left] < 0 and (A[right] > 0): if abs(A[left]) == A[right]: moist += 1 left += 1 right -= 1 elif abs(A[left]) > A[right]: left += 1 else: right -= 1 (left, right) = (0, 2 * N - 1) wet = 0 while left < right: if A[left] + A[right] <= 0: left += 1 else: wet += 1 left += 1 right -= 1 (left, right) = (0, 2 * N - 1) dry = 0 while left < right: if A[left] + A[right] >= 0: right -= 1 else: dry += 1 left += 1 right -= 1 print(dry, wet, moist)
def printSlope(equation): xIndex = equation.find('x') if xIndex == -1: print(0) elif xIndex == 2: print(1) else: slopeString = equation[2:xIndex] if slopeString == "-": print(-1) else: print(slopeString) printSlope("y=2x+5") #prints 2 printSlope("y=-1299x+5") #prints -1299 printSlope("y=x+5") #prints 1 printSlope("y=-x+5") #prints -1 printSlope("y=5") #prints 0
def print_slope(equation): x_index = equation.find('x') if xIndex == -1: print(0) elif xIndex == 2: print(1) else: slope_string = equation[2:xIndex] if slopeString == '-': print(-1) else: print(slopeString) print_slope('y=2x+5') print_slope('y=-1299x+5') print_slope('y=x+5') print_slope('y=-x+5') print_slope('y=5')
def profile_most_probable_kmer(text, k, profile): highest_prob = -1 most_probable_kmer = "" for i in range(len(text) - k + 1): kmer = text[i : i+k] prob = 1 for index, nucleotide in enumerate(kmer): prob *= profile[nucleotide][index] if prob > highest_prob: highest_prob = prob most_probable_kmer = kmer return most_probable_kmer if __name__ == '__main__': with open("dataset_159_3.txt") as f: text = f.readline().strip() k = int(f.readline().strip()) profile = {} for letter in ['A', 'C', 'G', 'T']: profile[letter] = [float(item) for item in f.readline().strip().split()] print(profile_most_probable_kmer(text, k, profile))
def profile_most_probable_kmer(text, k, profile): highest_prob = -1 most_probable_kmer = '' for i in range(len(text) - k + 1): kmer = text[i:i + k] prob = 1 for (index, nucleotide) in enumerate(kmer): prob *= profile[nucleotide][index] if prob > highest_prob: highest_prob = prob most_probable_kmer = kmer return most_probable_kmer if __name__ == '__main__': with open('dataset_159_3.txt') as f: text = f.readline().strip() k = int(f.readline().strip()) profile = {} for letter in ['A', 'C', 'G', 'T']: profile[letter] = [float(item) for item in f.readline().strip().split()] print(profile_most_probable_kmer(text, k, profile))
ROW_COUNT = 128 COLUMN_COUNT = 8 def solve(input): return max(map(lambda i: BoardingPass(i).seat_id, input)) class BoardingPass: def __init__(self, data, row_count=ROW_COUNT, column_count=COLUMN_COUNT): self.row = self._search( data = data[:7], low_char='F', high_char='B', i=0, min_value=0, max_value=row_count ) self.column = self._search( data = data[7:], low_char='L', high_char='R', i=0, min_value=0, max_value=column_count ) self.seat_id = Seat(self.row, self.column).id def _search(self, data, low_char, high_char, i, min_value, max_value): if i == len(data) - 1: assert max_value - min_value == 2 if data[i] == low_char: return min_value elif data[i] == high_char: return max_value - 1 else: raise Exception(f'Expected {low_char} or {high_char} got {data[i]}') mid_value = int((max_value - min_value) / 2) + min_value if data[i] == low_char: return self._search(data, low_char, high_char, i + 1, min_value, mid_value) elif data[i] == high_char: return self._search(data, low_char, high_char, i + 1, mid_value, max_value) else: raise Exception(f'Expected {low_char} or {high_char} got {data[i]}') class Seat: def __init__(self, row, column): self.id = (row * 8) + column
row_count = 128 column_count = 8 def solve(input): return max(map(lambda i: boarding_pass(i).seat_id, input)) class Boardingpass: def __init__(self, data, row_count=ROW_COUNT, column_count=COLUMN_COUNT): self.row = self._search(data=data[:7], low_char='F', high_char='B', i=0, min_value=0, max_value=row_count) self.column = self._search(data=data[7:], low_char='L', high_char='R', i=0, min_value=0, max_value=column_count) self.seat_id = seat(self.row, self.column).id def _search(self, data, low_char, high_char, i, min_value, max_value): if i == len(data) - 1: assert max_value - min_value == 2 if data[i] == low_char: return min_value elif data[i] == high_char: return max_value - 1 else: raise exception(f'Expected {low_char} or {high_char} got {data[i]}') mid_value = int((max_value - min_value) / 2) + min_value if data[i] == low_char: return self._search(data, low_char, high_char, i + 1, min_value, mid_value) elif data[i] == high_char: return self._search(data, low_char, high_char, i + 1, mid_value, max_value) else: raise exception(f'Expected {low_char} or {high_char} got {data[i]}') class Seat: def __init__(self, row, column): self.id = row * 8 + column
f = open('day3.txt', 'r') data = f.readlines() oneCount = 0 threeCount = 0 fiveCount = 0 sevenCount = 0 evenCount = 0 pos1 = 0 pos3 = 0 pos5 = 0 pos7 = 0 posEven = 0 even = True for line in data: line = line.replace("\n", '') if line[pos1 % len(line)] == '#': oneCount += 1 if line[pos3 % len(line)] == '#': threeCount += 1 if line[pos5 % len(line)] == '#': fiveCount += 1 if line[pos7 % len(line)] == '#': sevenCount += 1 if line[posEven % len(line)] == '#' and even: evenCount += 1 pos1 += 1 pos3 += 3 pos5 += 5 pos7 += 7 if not even: posEven += 1 even = not even print(str(evenCount * oneCount * threeCount * fiveCount * sevenCount))
f = open('day3.txt', 'r') data = f.readlines() one_count = 0 three_count = 0 five_count = 0 seven_count = 0 even_count = 0 pos1 = 0 pos3 = 0 pos5 = 0 pos7 = 0 pos_even = 0 even = True for line in data: line = line.replace('\n', '') if line[pos1 % len(line)] == '#': one_count += 1 if line[pos3 % len(line)] == '#': three_count += 1 if line[pos5 % len(line)] == '#': five_count += 1 if line[pos7 % len(line)] == '#': seven_count += 1 if line[posEven % len(line)] == '#' and even: even_count += 1 pos1 += 1 pos3 += 3 pos5 += 5 pos7 += 7 if not even: pos_even += 1 even = not even print(str(evenCount * oneCount * threeCount * fiveCount * sevenCount))
def porrada(seq, passo): atual = 0 while len(seq) > 1: atual += passo - 1 while atual > len(seq) - 1: atual -= len(seq) seq.pop(atual) return seq[0] + 1 quantidade_de_casos = int(input()) for c in range(quantidade_de_casos): entrada = input().split() n = list(range(int(entrada[0]))) m = int(entrada[1]) print(f'Case {c + 1}: {porrada(n, m)}')
def porrada(seq, passo): atual = 0 while len(seq) > 1: atual += passo - 1 while atual > len(seq) - 1: atual -= len(seq) seq.pop(atual) return seq[0] + 1 quantidade_de_casos = int(input()) for c in range(quantidade_de_casos): entrada = input().split() n = list(range(int(entrada[0]))) m = int(entrada[1]) print(f'Case {c + 1}: {porrada(n, m)}')
n = int(input()) arr = list(map(int, input().split(' '))) arr.sort(reverse=True) res = 0 for i in range(n): res += arr[i]*2**i print(res)
n = int(input()) arr = list(map(int, input().split(' '))) arr.sort(reverse=True) res = 0 for i in range(n): res += arr[i] * 2 ** i print(res)
class Solution: def minInsertions(self, s: str) -> int: right = count = 0 for c in s: if c == '(': if right & 1: right -= 1 count += 1 right += 2 else: right -= 1 if right < 0: right = 1 count += 1 return right + count
class Solution: def min_insertions(self, s: str) -> int: right = count = 0 for c in s: if c == '(': if right & 1: right -= 1 count += 1 right += 2 else: right -= 1 if right < 0: right = 1 count += 1 return right + count
S = input() N = len(S) A = [0]*(N+1) B = [0]*(N+1) for i in range(N): if S[i] == '<': A[i+1] = A[i]+1 else: A[i+1] = 0 for i in range(N): if S[N-i-1] == '>': B[N-i-1] = B[N-i]+1 else: B[N-i-1] = 0 ans = 0 for i in range(N+1): ans += max(A[i], B[i]) print(ans)
s = input() n = len(S) a = [0] * (N + 1) b = [0] * (N + 1) for i in range(N): if S[i] == '<': A[i + 1] = A[i] + 1 else: A[i + 1] = 0 for i in range(N): if S[N - i - 1] == '>': B[N - i - 1] = B[N - i] + 1 else: B[N - i - 1] = 0 ans = 0 for i in range(N + 1): ans += max(A[i], B[i]) print(ans)
''' Write a program that takes an integer argument and retums all the primes between 1 and that integer. For example, if the input is 18, you should return [2, 3, 5, 7, 11, 13, 17]. ''' def generate_primes(n): # Time: O(n log log n) | Space: O(n) primes = [] # is_prime[p] represents if p is prime or not. # Initially, set each to true, except for 0 and 1. # Then use sieving to eliminate non-primes. is_prime = [False, False] + [True] * (n - 1) for p in range(2, n + 1): if is_prime[p]: primes.append(p) # Turn false all multiples of p. for i in range(p, n+1, p): is_prime[i] = False return primes assert(generate_primes(18) == [2, 3, 5, 7, 11, 13, 17]) # Ignore even numbers and eliminate multiples of p2 # This will give better performance, but does not # reflect on complexity def generate_primes_square(n): # Time: O(n log log n) | Space: O(n) if n < 2: return [] primes = [2] # Store the first prime number # is_prime[p] represents if (2i + 3) is prime or not. # Initially, set each to true. # Then use sieving to eliminate non-primes. size = (n - 3) // 2 + 1 is_prime = [True] * size for i in range(size): if is_prime[i]: p = i * 2 + 3 primes.append(p) # Sieving fron p^2, where p^2 = (4i^2 + 12i + 9). # The index in is_prime is (2i^2 + 6i + 3) because # is_prime[i] represents 2i + 3. # Note that we need to use long for j because p^2 might overflow. for j in range(2 * i**2 + 6 * i + 3, size, p): is_prime[j] = False return primes assert(generate_primes_square(18) == [2, 3, 5, 7, 11, 13, 17])
""" Write a program that takes an integer argument and retums all the primes between 1 and that integer. For example, if the input is 18, you should return [2, 3, 5, 7, 11, 13, 17]. """ def generate_primes(n): primes = [] is_prime = [False, False] + [True] * (n - 1) for p in range(2, n + 1): if is_prime[p]: primes.append(p) for i in range(p, n + 1, p): is_prime[i] = False return primes assert generate_primes(18) == [2, 3, 5, 7, 11, 13, 17] def generate_primes_square(n): if n < 2: return [] primes = [2] size = (n - 3) // 2 + 1 is_prime = [True] * size for i in range(size): if is_prime[i]: p = i * 2 + 3 primes.append(p) for j in range(2 * i ** 2 + 6 * i + 3, size, p): is_prime[j] = False return primes assert generate_primes_square(18) == [2, 3, 5, 7, 11, 13, 17]
n = int(input()) l = [] for i in range(0, n): l.append(int(input())) for orig_num in l: count = 0 num = orig_num while num != 0: digit = num % 10 if digit == 0: pass elif orig_num % digit == 0: count += 1 num = int(num / 10) print (count)
n = int(input()) l = [] for i in range(0, n): l.append(int(input())) for orig_num in l: count = 0 num = orig_num while num != 0: digit = num % 10 if digit == 0: pass elif orig_num % digit == 0: count += 1 num = int(num / 10) print(count)
class Qseq(str): def __init__(self, seq): self.qkey = None self.parent = None self.parental_id = None self.parental_class = None self.name = None self.item = None def __getitem__(self, item): value = super().__getitem__(item) if self.parental_class == "QUEEN" and self.parent is not None and self.parent.topology == "circular": if type(item) == slice: if item.start is None: start = 0 elif item.start < 0: start = len(self) + item.start else: start = item.start if item.stop is None: stop = len(self) elif item.stop < 0: stop = len(self) + item.stop else: stop = item.stop if item.step is None: step = 1 if start > stop: value = str(self)[start:] + str(self)[:stop] value = value[::step] else: value = super().__getitem__(item) else: pass value = Qseq(value) else: value = Qseq(value) value.qkey = self.qkey value.parent = self.parent value.parental_id = self.parental_id value.parental_class = self.parental_class value.name = self.name if value.item is None: value.item = item else: value.item = slice(value.item.start + item.start, value.item.start + item.stop) return value
class Qseq(str): def __init__(self, seq): self.qkey = None self.parent = None self.parental_id = None self.parental_class = None self.name = None self.item = None def __getitem__(self, item): value = super().__getitem__(item) if self.parental_class == 'QUEEN' and self.parent is not None and (self.parent.topology == 'circular'): if type(item) == slice: if item.start is None: start = 0 elif item.start < 0: start = len(self) + item.start else: start = item.start if item.stop is None: stop = len(self) elif item.stop < 0: stop = len(self) + item.stop else: stop = item.stop if item.step is None: step = 1 if start > stop: value = str(self)[start:] + str(self)[:stop] value = value[::step] else: value = super().__getitem__(item) else: pass value = qseq(value) else: value = qseq(value) value.qkey = self.qkey value.parent = self.parent value.parental_id = self.parental_id value.parental_class = self.parental_class value.name = self.name if value.item is None: value.item = item else: value.item = slice(value.item.start + item.start, value.item.start + item.stop) return value
rios = { 'nilo' : 'egito', 'rio grande' : 'brasil', 'rio parana' : 'brasil' } for key,value in rios.items(): print(' O rio ' + key.title() + ' corre pelo ' + value.title()) for key in rios.keys(): print(key.title()) for value in rios.values(): print(value.title())
rios = {'nilo': 'egito', 'rio grande': 'brasil', 'rio parana': 'brasil'} for (key, value) in rios.items(): print(' O rio ' + key.title() + ' corre pelo ' + value.title()) for key in rios.keys(): print(key.title()) for value in rios.values(): print(value.title())
vowels2 = set('aeiiiouuu') word = input('Provide a word to search for vowels:').lower() found = vowels2.intersection(set(word)) for v in found: print(v)
vowels2 = set('aeiiiouuu') word = input('Provide a word to search for vowels:').lower() found = vowels2.intersection(set(word)) for v in found: print(v)
class Solution: def wordPattern(self, pattern: str, str: str) -> bool: table = {} mapped = set() words = str.split() if len(words) != len(pattern): return False for i, word in enumerate(words): if word in table: if table[word] != pattern[i]: return False else: if pattern[i] in mapped: return False table[word] = pattern[i] mapped.add(pattern[i]) return True
class Solution: def word_pattern(self, pattern: str, str: str) -> bool: table = {} mapped = set() words = str.split() if len(words) != len(pattern): return False for (i, word) in enumerate(words): if word in table: if table[word] != pattern[i]: return False else: if pattern[i] in mapped: return False table[word] = pattern[i] mapped.add(pattern[i]) return True
HOST = 'localhost' PORT = 61613 VERSION = '1.2' BROKER = 'activemq' LOGIN, PASSCODE, VIRTUALHOST = { 'activemq': ('', '', ''), 'apollo': ('admin', 'password', 'mybroker'), 'rabbitmq': ('guest', 'guest', '/') }[BROKER]
host = 'localhost' port = 61613 version = '1.2' broker = 'activemq' (login, passcode, virtualhost) = {'activemq': ('', '', ''), 'apollo': ('admin', 'password', 'mybroker'), 'rabbitmq': ('guest', 'guest', '/')}[BROKER]
def Num2581(): M = int(input()) N = int(input()) minPrimeNum = 0 sumPrimeNum = 0 primeNums = [] for dividend in range(M, N+1): if dividend == 1: continue primeNums.append(dividend) sumPrimeNum += dividend for divisor in range(2, dividend): if dividend % divisor == 0: primeNums.pop() sumPrimeNum -= dividend break if len(primeNums) == 0: print("-1") else: minPrimeNum = primeNums[0] sumPrimeNum = sum(primeNums) print(str(sumPrimeNum)) print(str(minPrimeNum)) Num2581()
def num2581(): m = int(input()) n = int(input()) min_prime_num = 0 sum_prime_num = 0 prime_nums = [] for dividend in range(M, N + 1): if dividend == 1: continue primeNums.append(dividend) sum_prime_num += dividend for divisor in range(2, dividend): if dividend % divisor == 0: primeNums.pop() sum_prime_num -= dividend break if len(primeNums) == 0: print('-1') else: min_prime_num = primeNums[0] sum_prime_num = sum(primeNums) print(str(sumPrimeNum)) print(str(minPrimeNum)) num2581()
#takes a list of options as input which will be printed as a numerical list #Also optionally takes messages as input to be printed after the options but before input request #Ultimately the users choice is returned def selector(options,*messages): rego = 'y' while rego.lower() == "y": n=1 for x in options: print(str(n) + ". " + str(x)) n = n + 1 n=1 print("") for arg in messages: print(arg) choice = input( " :> ") if choice == "": return False try: i_choice = int(choice) except ValueError: print("\nError: Sorry, that's not a valid entry, please enter a number from the list.") rego = input("\nWould you like to try again? Type Y for yes or N for no :> ") if rego.lower() == "y": pass else: break print("") p=1 for x in options: if int(choice) == p: value = x p = p + 1 p=1 if value in options: return value else: if not value: print("\nError: Sorry, that's not a valid entry, please enter a number from the list") rego = input("Would you like to try again? Type Y for yes or N for no :> ") return False
def selector(options, *messages): rego = 'y' while rego.lower() == 'y': n = 1 for x in options: print(str(n) + '. ' + str(x)) n = n + 1 n = 1 print('') for arg in messages: print(arg) choice = input(' :> ') if choice == '': return False try: i_choice = int(choice) except ValueError: print("\nError: Sorry, that's not a valid entry, please enter a number from the list.") rego = input('\nWould you like to try again? Type Y for yes or N for no :> ') if rego.lower() == 'y': pass else: break print('') p = 1 for x in options: if int(choice) == p: value = x p = p + 1 p = 1 if value in options: return value elif not value: print("\nError: Sorry, that's not a valid entry, please enter a number from the list") rego = input('Would you like to try again? Type Y for yes or N for no :> ') return False
class Wrapping(object): def __init__(self, klass, wrapped_klass, dependency_functions): self._klass = klass self._wrapped_klass = wrapped_klass self._dependency_functions = dependency_functions def wrap(self): for dependency_method in self._dependency_functions: self._access_class_dependency(dependency_method) setattr(self._klass, '__getattr__', self._getattr()) setattr(self._klass, '__init__', self._init()) return self._klass def _access_class_dependency(self, method_name): def _call_dependency_method(wrapper_instance, *args, **kwargs): method = getattr(wrapper_instance._wrapped, method_name) return method(wrapper_instance._dependency, *args, **kwargs) setattr(self._klass, method_name, _call_dependency_method) def _getattr(self): def _inner(wrapper_instance, name): if hasattr(wrapper_instance._wrapped, name): return getattr(wrapper_instance._wrapped, name) raise AttributeError(self._missing_attribute_message(name)) return _inner def _missing_attribute_message(self, name): return "'{}' object has no attribute '{}'".format(self._klass.__name__, name) def _init(self): def _inner(wrapper_instance, dependency): wrapper_instance._dependency = dependency wrapper_instance._wrapped = self._wrapped_klass() return _inner def wrap_class_with_dependency(wrapped_klass, *dependency_functions): def _wrap(klass): return Wrapping(klass, wrapped_klass, dependency_functions).wrap() return _wrap
class Wrapping(object): def __init__(self, klass, wrapped_klass, dependency_functions): self._klass = klass self._wrapped_klass = wrapped_klass self._dependency_functions = dependency_functions def wrap(self): for dependency_method in self._dependency_functions: self._access_class_dependency(dependency_method) setattr(self._klass, '__getattr__', self._getattr()) setattr(self._klass, '__init__', self._init()) return self._klass def _access_class_dependency(self, method_name): def _call_dependency_method(wrapper_instance, *args, **kwargs): method = getattr(wrapper_instance._wrapped, method_name) return method(wrapper_instance._dependency, *args, **kwargs) setattr(self._klass, method_name, _call_dependency_method) def _getattr(self): def _inner(wrapper_instance, name): if hasattr(wrapper_instance._wrapped, name): return getattr(wrapper_instance._wrapped, name) raise attribute_error(self._missing_attribute_message(name)) return _inner def _missing_attribute_message(self, name): return "'{}' object has no attribute '{}'".format(self._klass.__name__, name) def _init(self): def _inner(wrapper_instance, dependency): wrapper_instance._dependency = dependency wrapper_instance._wrapped = self._wrapped_klass() return _inner def wrap_class_with_dependency(wrapped_klass, *dependency_functions): def _wrap(klass): return wrapping(klass, wrapped_klass, dependency_functions).wrap() return _wrap
def roman_number(num): if num > 3999: print("enter number less than 3999") return #take 2 list symbol and value symbol having roman of each integer in list value value = [1000,900,500,400,100,90,50,40,10,9,5,4,1] symbol = ["M","CM","D","CD","C","XC","L","XL","X","IX","V","IV","I"] roman = "" i=0 while num>0: #then we have to check the the range of value #divide the number with all values starting from zero div = num//value[i] #mod to get part of number num = num%value[i] while div: roman = roman+symbol[i] #loop goes till div become zero div = div-1 i=i+1 return roman num = int(input("enter an integer number: ")) print(f" Roman Numeral of {num} is {roman_number(num)}")
def roman_number(num): if num > 3999: print('enter number less than 3999') return value = [1000, 900, 500, 400, 100, 90, 50, 40, 10, 9, 5, 4, 1] symbol = ['M', 'CM', 'D', 'CD', 'C', 'XC', 'L', 'XL', 'X', 'IX', 'V', 'IV', 'I'] roman = '' i = 0 while num > 0: div = num // value[i] num = num % value[i] while div: roman = roman + symbol[i] div = div - 1 i = i + 1 return roman num = int(input('enter an integer number: ')) print(f' Roman Numeral of {num} is {roman_number(num)}')
AN_ESCAPED_NEWLINE = "\n" AN_ESCAPED_TAB = "\t" A_COMMA = "," A_QUOTE = "'" A_TAB = "\t" DOUBLE_QUOTES = "\"" NEWLINE = "\n"
an_escaped_newline = '\n' an_escaped_tab = '\t' a_comma = ',' a_quote = "'" a_tab = '\t' double_quotes = '"' newline = '\n'
#!/usr/bin/env python3 # # Copyright 2019 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License.. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. class ScholarshipBuilder: @staticmethod def setName(scholarship, name): scholarship["scholarshipName"] = name @staticmethod def setId(scholarship, id): scholarship["id"] = str(int(id)) @staticmethod def setSchoolsList(scholarship, schoolsList): scholarship["schoolsList"] = schoolsList.split(",") @staticmethod def setURL(scholarship, url): scholarship["URL"] = url @staticmethod def setYear(scholarship, year): scholarship["year"] = year @staticmethod def setIntroduction(scholarship, intro): scholarship["introduction"] = intro @staticmethod def setIsRenewable(scholarship, isRenewable): scholarship["isRenewable"] = isRenewable == "yes" or isRenewable == "Yes" @staticmethod def setNumberOfYears(scholarship, years): scholarship["numberOfYears"] = years @staticmethod def setAmountPerYear(scholarship, amount): scholarship["amountPerYear"] = amount @staticmethod def setLocationRequirements(scholarship, locationRequirements): scholarship["locationRequirements"] = locationRequirements.split(';') @staticmethod def setAcademicRequirements(scholarship, academicRequirements): scholarship["academicRequirements"] = academicRequirements.split(';') @staticmethod def setEthnicityRaceRequirements(scholarship, ethnicityRaceRequirements): scholarship["ethnicityRaceRequirements"] = ethnicityRaceRequirements.split(';') @staticmethod def setGenderRequirements(scholarship, genders): scholarship["genderRequriements"] = genders.split(';') @staticmethod def setNationalOriginRequirements(scholarship, nations): scholarship["nationalOriginRequirements"] = nations.split(';') @staticmethod def setOtherRequirements(scholarship, otherRequirements): scholarship["otherRequirements"] = otherRequirements.split(';') @staticmethod def setFinancialRequirements(scholarship, financialRequirements): scholarship["financialRequirements"] = financialRequirements.split(';') @staticmethod def setApplicationProcess(scholarship, applicationProcess): scholarship["applicationProcess"] = applicationProcess @staticmethod def setSchoolsNameToIDMap(scholarship): nameToIDMap = {} for school in scholarship["schoolsList"]: nameToIDMap[school] = "" scholarship["schoolIdList"] = nameToIDMap
class Scholarshipbuilder: @staticmethod def set_name(scholarship, name): scholarship['scholarshipName'] = name @staticmethod def set_id(scholarship, id): scholarship['id'] = str(int(id)) @staticmethod def set_schools_list(scholarship, schoolsList): scholarship['schoolsList'] = schoolsList.split(',') @staticmethod def set_url(scholarship, url): scholarship['URL'] = url @staticmethod def set_year(scholarship, year): scholarship['year'] = year @staticmethod def set_introduction(scholarship, intro): scholarship['introduction'] = intro @staticmethod def set_is_renewable(scholarship, isRenewable): scholarship['isRenewable'] = isRenewable == 'yes' or isRenewable == 'Yes' @staticmethod def set_number_of_years(scholarship, years): scholarship['numberOfYears'] = years @staticmethod def set_amount_per_year(scholarship, amount): scholarship['amountPerYear'] = amount @staticmethod def set_location_requirements(scholarship, locationRequirements): scholarship['locationRequirements'] = locationRequirements.split(';') @staticmethod def set_academic_requirements(scholarship, academicRequirements): scholarship['academicRequirements'] = academicRequirements.split(';') @staticmethod def set_ethnicity_race_requirements(scholarship, ethnicityRaceRequirements): scholarship['ethnicityRaceRequirements'] = ethnicityRaceRequirements.split(';') @staticmethod def set_gender_requirements(scholarship, genders): scholarship['genderRequriements'] = genders.split(';') @staticmethod def set_national_origin_requirements(scholarship, nations): scholarship['nationalOriginRequirements'] = nations.split(';') @staticmethod def set_other_requirements(scholarship, otherRequirements): scholarship['otherRequirements'] = otherRequirements.split(';') @staticmethod def set_financial_requirements(scholarship, financialRequirements): scholarship['financialRequirements'] = financialRequirements.split(';') @staticmethod def set_application_process(scholarship, applicationProcess): scholarship['applicationProcess'] = applicationProcess @staticmethod def set_schools_name_to_id_map(scholarship): name_to_id_map = {} for school in scholarship['schoolsList']: nameToIDMap[school] = '' scholarship['schoolIdList'] = nameToIDMap
class MyClass: def __init__(self, name): self.__name = name def Show(self): print(self.__name) c1 = MyClass('c1') c2 = MyClass('c2') c3 = MyClass('c3') c4 = MyClass('c4') a = {x.Show() for x in {c1, c2, c3, c4} if x not in {c1, c2}}
class Myclass: def __init__(self, name): self.__name = name def show(self): print(self.__name) c1 = my_class('c1') c2 = my_class('c2') c3 = my_class('c3') c4 = my_class('c4') a = {x.Show() for x in {c1, c2, c3, c4} if x not in {c1, c2}}
@metadata_reactor def install_git(metadata): return { 'apt': { 'packages': { 'git': { 'installed': True, }, } }, }
@metadata_reactor def install_git(metadata): return {'apt': {'packages': {'git': {'installed': True}}}}
if __name__ == '__main__': n,m = map(int,input().split()) l = map(int,input().split()) a = set(map(int,input().split())) b = set(map(int,input().split())) happy = 0 for i in l: if i in a: happy += 1 elif i in b: happy -= 1 print(happy) # print(sum([(i in a) - (i in b) for i in l]))
if __name__ == '__main__': (n, m) = map(int, input().split()) l = map(int, input().split()) a = set(map(int, input().split())) b = set(map(int, input().split())) happy = 0 for i in l: if i in a: happy += 1 elif i in b: happy -= 1 print(happy)
# // This is a generated file, modify: generate/templates/binding.gyp. { "targets": [{ "target_name": "nodegit", "dependencies": [ "<(module_root_dir)/vendor/libgit2.gyp:libgit2" ], "sources": [ "src/nodegit.cc", "src/wrapper.cc", "src/functions/copy.cc", "src/attr.cc", "src/blame.cc", "src/blame_hunk.cc", "src/blame_options.cc", "src/blob.cc", "src/branch.cc", "src/branch_iterator.cc", "src/buf.cc", "src/checkout.cc", "src/checkout_options.cc", "src/cherry.cc", "src/cherry_pick_options.cc", "src/clone.cc", "src/clone_options.cc", "src/commit.cc", "src/config.cc", "src/cred.cc", "src/cred_default.cc", "src/cred_userpass_payload.cc", "src/diff.cc", "src/diff_delta.cc", "src/diff_file.cc", "src/diff_hunk.cc", "src/diff_line.cc", "src/diff_options.cc", "src/diff_perfdata.cc", "src/diff_stats.cc", "src/error.cc", "src/filter.cc", "src/filter_list.cc", "src/giterr.cc", "src/graph.cc", "src/ignore.cc", "src/index.cc", "src/index_conflict_iterator.cc", "src/index_entry.cc", "src/index_time.cc", "src/indexer.cc", "src/libgit2.cc", "src/mempack.cc", "src/merge.cc", "src/merge_file_input.cc", "src/merge_head.cc", "src/merge_options.cc", "src/merge_result.cc", "src/message.cc", "src/note.cc", "src/note_iterator.cc", "src/object.cc", "src/odb.cc", "src/odb_object.cc", "src/oid.cc", "src/oid_shorten.cc", "src/packbuilder.cc", "src/patch.cc", "src/pathspec.cc", "src/pathspec_match_list.cc", "src/push.cc", "src/push_options.cc", "src/refdb.cc", "src/reference.cc", "src/reflog.cc", "src/reflog_entry.cc", "src/refspec.cc", "src/remote.cc", "src/remote_callbacks.cc", "src/repository.cc", "src/repository_init_options.cc", "src/revert.cc", "src/revert_options.cc", "src/revparse.cc", "src/revwalk.cc", "src/signature.cc", "src/smart.cc", "src/stash.cc", "src/status.cc", "src/status_list.cc", "src/strarray.cc", "src/submodule.cc", "src/tag.cc", "src/threads.cc", "src/time.cc", "src/trace.cc", "src/transfer_progress.cc", "src/transport.cc", "src/tree.cc", "src/tree_entry.cc", "src/treebuilder.cc", ], "include_dirs": [ "vendor/libv8-convert", "<!(node -e \"require('nan')\")" ], "cflags": [ "-Wall", "-std=c++11" ], "conditions": [ [ "OS=='mac'", { "xcode_settings": { "GCC_ENABLE_CPP_EXCEPTIONS": "YES", "MACOSX_DEPLOYMENT_TARGET": "10.7", "WARNING_CFLAGS": [ "-Wno-unused-variable", "-Wint-conversions", "-Wmissing-field-initializers" ], "OTHER_CPLUSPLUSFLAGS": [ "-std=gnu++11", "-stdlib=libc++" ], "OTHER_LDFLAGS": [ "-stdlib=libc++" ] } } ] ] }] }
{'targets': [{'target_name': 'nodegit', 'dependencies': ['<(module_root_dir)/vendor/libgit2.gyp:libgit2'], 'sources': ['src/nodegit.cc', 'src/wrapper.cc', 'src/functions/copy.cc', 'src/attr.cc', 'src/blame.cc', 'src/blame_hunk.cc', 'src/blame_options.cc', 'src/blob.cc', 'src/branch.cc', 'src/branch_iterator.cc', 'src/buf.cc', 'src/checkout.cc', 'src/checkout_options.cc', 'src/cherry.cc', 'src/cherry_pick_options.cc', 'src/clone.cc', 'src/clone_options.cc', 'src/commit.cc', 'src/config.cc', 'src/cred.cc', 'src/cred_default.cc', 'src/cred_userpass_payload.cc', 'src/diff.cc', 'src/diff_delta.cc', 'src/diff_file.cc', 'src/diff_hunk.cc', 'src/diff_line.cc', 'src/diff_options.cc', 'src/diff_perfdata.cc', 'src/diff_stats.cc', 'src/error.cc', 'src/filter.cc', 'src/filter_list.cc', 'src/giterr.cc', 'src/graph.cc', 'src/ignore.cc', 'src/index.cc', 'src/index_conflict_iterator.cc', 'src/index_entry.cc', 'src/index_time.cc', 'src/indexer.cc', 'src/libgit2.cc', 'src/mempack.cc', 'src/merge.cc', 'src/merge_file_input.cc', 'src/merge_head.cc', 'src/merge_options.cc', 'src/merge_result.cc', 'src/message.cc', 'src/note.cc', 'src/note_iterator.cc', 'src/object.cc', 'src/odb.cc', 'src/odb_object.cc', 'src/oid.cc', 'src/oid_shorten.cc', 'src/packbuilder.cc', 'src/patch.cc', 'src/pathspec.cc', 'src/pathspec_match_list.cc', 'src/push.cc', 'src/push_options.cc', 'src/refdb.cc', 'src/reference.cc', 'src/reflog.cc', 'src/reflog_entry.cc', 'src/refspec.cc', 'src/remote.cc', 'src/remote_callbacks.cc', 'src/repository.cc', 'src/repository_init_options.cc', 'src/revert.cc', 'src/revert_options.cc', 'src/revparse.cc', 'src/revwalk.cc', 'src/signature.cc', 'src/smart.cc', 'src/stash.cc', 'src/status.cc', 'src/status_list.cc', 'src/strarray.cc', 'src/submodule.cc', 'src/tag.cc', 'src/threads.cc', 'src/time.cc', 'src/trace.cc', 'src/transfer_progress.cc', 'src/transport.cc', 'src/tree.cc', 'src/tree_entry.cc', 'src/treebuilder.cc'], 'include_dirs': ['vendor/libv8-convert', '<!(node -e "require(\'nan\')")'], 'cflags': ['-Wall', '-std=c++11'], 'conditions': [["OS=='mac'", {'xcode_settings': {'GCC_ENABLE_CPP_EXCEPTIONS': 'YES', 'MACOSX_DEPLOYMENT_TARGET': '10.7', 'WARNING_CFLAGS': ['-Wno-unused-variable', '-Wint-conversions', '-Wmissing-field-initializers'], 'OTHER_CPLUSPLUSFLAGS': ['-std=gnu++11', '-stdlib=libc++'], 'OTHER_LDFLAGS': ['-stdlib=libc++']}}]]}]}
a = 10 b = 20 c = 300000
a = 10 b = 20 c = 300000
class Solution: def addBinary(self, a: str, b: str) -> str: x=int(a,2) y=int(b,2) return bin(x+y)[2:]
class Solution: def add_binary(self, a: str, b: str) -> str: x = int(a, 2) y = int(b, 2) return bin(x + y)[2:]
for i in range(int(input())): n = int(input()) s = input() a,b = [-1 for j in range(26)],[1e5 for j in range(26)] for j in range(n): if(a[ord(s[j])-97]==-1): a[ord(s[j])-97] = j else: if(j-a[ord(s[j])-97]<b[ord(s[j])-97]): b[ord(s[j])-97] = j-a[ord(s[j])-97] a[ord(s[j])-97] = j print(max(n-min(b),0))
for i in range(int(input())): n = int(input()) s = input() (a, b) = ([-1 for j in range(26)], [100000.0 for j in range(26)]) for j in range(n): if a[ord(s[j]) - 97] == -1: a[ord(s[j]) - 97] = j else: if j - a[ord(s[j]) - 97] < b[ord(s[j]) - 97]: b[ord(s[j]) - 97] = j - a[ord(s[j]) - 97] a[ord(s[j]) - 97] = j print(max(n - min(b), 0))
class Solution: def minDistance(self, word1: str, word2: str) -> int: edits = [[x for x in range(len(word1) + 1)] for y in range(len(word2) + 1)] for i in range(1, len(word2) + 1): edits[i][0] = edits[i - 1][0] + 1 for i in range(1, len(word2) + 1): for j in range(1, len(word1) + 1): if word2[i - 1] == word1[j - 1]: edits[i][j] = edits[i - 1][j - 1] else: edits[i][j] = 1 + min(edits[i][j - 1], edits[i - 1][j - 1], edits[i - 1][j]) return edits[-1][-1]
class Solution: def min_distance(self, word1: str, word2: str) -> int: edits = [[x for x in range(len(word1) + 1)] for y in range(len(word2) + 1)] for i in range(1, len(word2) + 1): edits[i][0] = edits[i - 1][0] + 1 for i in range(1, len(word2) + 1): for j in range(1, len(word1) + 1): if word2[i - 1] == word1[j - 1]: edits[i][j] = edits[i - 1][j - 1] else: edits[i][j] = 1 + min(edits[i][j - 1], edits[i - 1][j - 1], edits[i - 1][j]) return edits[-1][-1]
ENHANCED_PEER_MOBILIZATION = 'enhanced_peer_mobilization' CHAMP_CAMEROON = 'champ_client_forms' TARGET_XMLNS = 'http://openrosa.org/formdesigner/A79467FD-4CDE-47B6-8218-4394699A5C95' PREVENTION_XMLNS = 'http://openrosa.org/formdesigner/DF2FBEEA-31DE-4537-9913-07D57591502C' POST_TEST_XMLNS = 'http://openrosa.org/formdesigner/E2B4FD32-9A62-4AE8-AAB0-0CE4B8C28AA1' ACCOMPAGNEMENT_XMLNS = 'http://openrosa.org/formdesigner/027DEB76-422B-434C-9F53-ECBBE21F890F' SUIVI_MEDICAL_XMLNS = 'http://openrosa.org/formdesigner/7C8BC256-0E79-4A96-9ECB-D6D8C50CD69E'
enhanced_peer_mobilization = 'enhanced_peer_mobilization' champ_cameroon = 'champ_client_forms' target_xmlns = 'http://openrosa.org/formdesigner/A79467FD-4CDE-47B6-8218-4394699A5C95' prevention_xmlns = 'http://openrosa.org/formdesigner/DF2FBEEA-31DE-4537-9913-07D57591502C' post_test_xmlns = 'http://openrosa.org/formdesigner/E2B4FD32-9A62-4AE8-AAB0-0CE4B8C28AA1' accompagnement_xmlns = 'http://openrosa.org/formdesigner/027DEB76-422B-434C-9F53-ECBBE21F890F' suivi_medical_xmlns = 'http://openrosa.org/formdesigner/7C8BC256-0E79-4A96-9ECB-D6D8C50CD69E'
# You may need this if you really want to use a recursive solution! # It raises the cap on how many recursions can happen. Use this at your own risk! # sys.setrecursionlimit(100000) def read_lines(filename): try: f = open(filename,"r") lines = f.readlines() f.close() filtered_contents = [] for line in lines: line = line.rstrip("\n") filtered_contents.append(list(line)) #read lines converted to cells objects in list of lists return filtered_contents except FileNotFoundError: print("{} does not exist!".format(filename)) exit() def some(grid): i = 0 while i < len(grid): k = 0 while k < len(grid[i]): if (grid[i][k] == "X" ): #Find X row = int(i) col = int(k) return row,col k += 1 i += 1 def solve(filename): grid = read_lines(filename) start_pos = some(grid) x = start_pos[0] y = start_pos[1] ls = ["u","d","r","l"] pass # Base Cases # # if (x,y outside maze) return false # # if (x,y is goal) return true # # if (x,y is wall) return false # # if (x,y is air) return true def solve(mode): pass if __name__ == "__main__": solution_found = False if solution_found: pass # Print your solution... else: print("There is no possible path.")
def read_lines(filename): try: f = open(filename, 'r') lines = f.readlines() f.close() filtered_contents = [] for line in lines: line = line.rstrip('\n') filtered_contents.append(list(line)) return filtered_contents except FileNotFoundError: print('{} does not exist!'.format(filename)) exit() def some(grid): i = 0 while i < len(grid): k = 0 while k < len(grid[i]): if grid[i][k] == 'X': row = int(i) col = int(k) return (row, col) k += 1 i += 1 def solve(filename): grid = read_lines(filename) start_pos = some(grid) x = start_pos[0] y = start_pos[1] ls = ['u', 'd', 'r', 'l'] pass def solve(mode): pass if __name__ == '__main__': solution_found = False if solution_found: pass else: print('There is no possible path.')
class MultiFilterCNNModel(object): def __init__(self, max_sequences, word_index, embed_dim, embedding_matrix, filter_sizes, num_filters, dropout, learning_rate, beta_1, beta_2, epsilon, n_classes): sequence_input = Input(shape=(max_sequences,), dtype='int32') embedding_layer = Embedding(len(word_index)+1, embed_dim, input_length=max_sequences, weights=[embedding_matrix], trainable=True, mask_zero=False)(sequence_input) filter_sizes = filter_sizes.split(',') #embedding_layer_ex = K.expand_dims(embedding_layer, ) #embedding_layer_ex = Reshape()(embedding_layer) conv_0 = Conv1D(num_filters, int(filter_sizes[0]), padding='valid', kernel_initializer='normal', activation='relu')(embedding_layer) conv_1 = Conv1D(num_filters, int(filter_sizes[1]), padding='valid', kernel_initializer='normal', activation='relu')(embedding_layer) conv_2 = Conv1D(num_filters, int(filter_sizes[2]), padding='valid', kernel_initializer='normal', activation='relu')(embedding_layer) maxpool_0 = MaxPooling1D(pool_size=max_sequences - int(filter_sizes[0]) + 1, strides=1, padding='valid')(conv_0) maxpool_1 = MaxPooling1D(pool_size=max_sequences - int(filter_sizes[1]) + 1, strides=1, padding='valid')(conv_1) maxpool_2 = MaxPooling1D(pool_size=max_sequences - int(filter_sizes[2]) + 1, strides=1, padding='valid')(conv_2) merged_tensor = merge([maxpool_0, maxpool_1, maxpool_2], mode='concat', concat_axis=1) flatten = Flatten()(merged_tensor) # average_pooling = AveragePooling2D(pool_size=(sequence_length,1),strides=(1,1), # border_mode='valid', dim_ordering='tf')(inputs) # # reshape = Reshape()(average_pooling) #reshape = Reshape((3*num_filters,))(merged_tensor) dropout_layer = Dropout(dropout)(flatten) softmax_layer = Dense(output_dim=n_classes, activation='softmax')(dropout_layer) # this creates a model that includes model = Model(inputs=sequence_input, outputs=softmax_layer) adam = Adam(lr=learning_rate, beta_1=beta_1, beta_2=beta_2, epsilon=epsilon) #sgd = optimizers.SGD(lr=0.001, decay=1e-5, momentum=0.9, nesterov=True) model.compile(optimizer="adam", loss='categorical_crossentropy', metrics=["accuracy"]) self.model = model
class Multifiltercnnmodel(object): def __init__(self, max_sequences, word_index, embed_dim, embedding_matrix, filter_sizes, num_filters, dropout, learning_rate, beta_1, beta_2, epsilon, n_classes): sequence_input = input(shape=(max_sequences,), dtype='int32') embedding_layer = embedding(len(word_index) + 1, embed_dim, input_length=max_sequences, weights=[embedding_matrix], trainable=True, mask_zero=False)(sequence_input) filter_sizes = filter_sizes.split(',') conv_0 = conv1_d(num_filters, int(filter_sizes[0]), padding='valid', kernel_initializer='normal', activation='relu')(embedding_layer) conv_1 = conv1_d(num_filters, int(filter_sizes[1]), padding='valid', kernel_initializer='normal', activation='relu')(embedding_layer) conv_2 = conv1_d(num_filters, int(filter_sizes[2]), padding='valid', kernel_initializer='normal', activation='relu')(embedding_layer) maxpool_0 = max_pooling1_d(pool_size=max_sequences - int(filter_sizes[0]) + 1, strides=1, padding='valid')(conv_0) maxpool_1 = max_pooling1_d(pool_size=max_sequences - int(filter_sizes[1]) + 1, strides=1, padding='valid')(conv_1) maxpool_2 = max_pooling1_d(pool_size=max_sequences - int(filter_sizes[2]) + 1, strides=1, padding='valid')(conv_2) merged_tensor = merge([maxpool_0, maxpool_1, maxpool_2], mode='concat', concat_axis=1) flatten = flatten()(merged_tensor) dropout_layer = dropout(dropout)(flatten) softmax_layer = dense(output_dim=n_classes, activation='softmax')(dropout_layer) model = model(inputs=sequence_input, outputs=softmax_layer) adam = adam(lr=learning_rate, beta_1=beta_1, beta_2=beta_2, epsilon=epsilon) model.compile(optimizer='adam', loss='categorical_crossentropy', metrics=['accuracy']) self.model = model
norm_cfg = dict(type='BN', requires_grad=True) model = dict( type='EncoderDecoder', pretrained='open-mmlab://resnet50_v1c', backbone=dict( type='ResNetV1c', depth=50, num_stages=4, out_indices=(0, 1, 2, 3), dilations=(1, 1, 2, 4), strides=(1, 2, 1, 1), norm_cfg=dict(type='BN', requires_grad=True), norm_eval=False, style='pytorch', contract_dilation=True), decode_head=dict( type='PSPHead', in_channels=2048, in_index=3, channels=512, pool_scales=(1, 2, 3, 6), dropout_ratio=0.1, num_classes=6, norm_cfg=dict(type='BN', requires_grad=True), align_corners=False, loss_decode=dict( type='CrossEntropyLoss', use_sigmoid=False, loss_weight=1.0)), auxiliary_head=dict( type='FCNHead', in_channels=1024, in_index=2, channels=256, num_convs=1, concat_input=False, dropout_ratio=0.1, num_classes=6, norm_cfg=dict(type='BN', requires_grad=True), align_corners=False, loss_decode=dict( type='CrossEntropyLoss', use_sigmoid=False, loss_weight=0.4)), train_cfg=dict(), test_cfg=dict(mode='whole')) dataset_type = 'CardDataset' data_root = '../card_dataset' img_norm_cfg = dict( mean=[123.675, 116.28, 103.53], std=[58.395, 57.12, 57.375], to_rgb=True) crop_size = (256, 256) train_pipeline = [ dict(type='LoadImageFromFile'), dict(type='LoadAnnotations'), dict(type='Resize', img_scale=(500, 500), ratio_range=(0.5, 2.0)), dict(type='RandomCrop', crop_size=(256, 256), cat_max_ratio=0.75), dict(type='RandomFlip', flip_ratio=0.5), dict(type='PhotoMetricDistortion'), dict( type='Normalize', mean=[123.675, 116.28, 103.53], std=[58.395, 57.12, 57.375], to_rgb=True), dict(type='Pad', size=(256, 256), pad_val=0, seg_pad_val=255), dict(type='DefaultFormatBundle'), dict(type='Collect', keys=['img', 'gt_semantic_seg']) ] test_pipeline = [ dict(type='LoadImageFromFile'), dict( type='MultiScaleFlipAug', img_scale=(500, 500), flip=False, transforms=[ dict(type='Resize', keep_ratio=True), dict(type='RandomFlip'), dict( type='Normalize', mean=[123.675, 116.28, 103.53], std=[58.395, 57.12, 57.375], to_rgb=True), dict(type='ImageToTensor', keys=['img']), dict(type='Collect', keys=['img']) ]) ] data = dict( samples_per_gpu=8, workers_per_gpu=8, train=dict( type='CardDataset', data_root='../card_dataset', img_dir='images', ann_dir='labels', pipeline=[ dict(type='LoadImageFromFile'), dict(type='LoadAnnotations'), dict(type='Resize', img_scale=(500, 500), ratio_range=(0.5, 2.0)), dict(type='RandomCrop', crop_size=(256, 256), cat_max_ratio=0.75), dict(type='RandomFlip', flip_ratio=0.5), dict(type='PhotoMetricDistortion'), dict( type='Normalize', mean=[123.675, 116.28, 103.53], std=[58.395, 57.12, 57.375], to_rgb=True), dict(type='Pad', size=(256, 256), pad_val=0, seg_pad_val=255), dict(type='DefaultFormatBundle'), dict(type='Collect', keys=['img', 'gt_semantic_seg']) ], split='splits/train.txt'), val=dict( type='CardDataset', data_root='../card_dataset', img_dir='images', ann_dir='labels', pipeline=[ dict(type='LoadImageFromFile'), dict( type='MultiScaleFlipAug', img_scale=(500, 500), flip=False, transforms=[ dict(type='Resize', keep_ratio=True), dict(type='RandomFlip'), dict( type='Normalize', mean=[123.675, 116.28, 103.53], std=[58.395, 57.12, 57.375], to_rgb=True), dict(type='ImageToTensor', keys=['img']), dict(type='Collect', keys=['img']) ]) ], split='splits/val.txt'), test=dict( type='CardDataset', data_root='../card_dataset', img_dir='images', ann_dir='labels', pipeline=[ dict(type='LoadImageFromFile'), dict( type='MultiScaleFlipAug', img_scale=(500, 500), flip=False, transforms=[ dict(type='Resize', keep_ratio=True), dict(type='RandomFlip'), dict( type='Normalize', mean=[123.675, 116.28, 103.53], std=[58.395, 57.12, 57.375], to_rgb=True), dict(type='ImageToTensor', keys=['img']), dict(type='Collect', keys=['img']) ]) ], split='splits/val.txt')) log_config = dict( interval=10, hooks=[dict(type='TextLoggerHook', by_epoch=False)]) dist_params = dict(backend='nccl') log_level = 'INFO' load_from = 'checkpoints/pspnet_r50-d8_512x1024_40k_cityscapes_20200605_003338-2966598c.pth' resume_from = None workflow = [('train', 1)] cudnn_benchmark = True optimizer = dict(type='SGD', lr=0.01, momentum=0.9, weight_decay=0.0005) # optimizer=dict( # paramwise_cfg = dict( # custom_keys={ # 'head': dict(lr_mult=10.)})) optimizer_config = dict(type='OptimizerHook') lr_config = dict(policy='poly', power=0.9, min_lr=0.0001, by_epoch=False) runner = dict(type='IterBasedRunner', max_iters=200) checkpoint_config = dict(by_epoch=False, interval=200, type='CheckpointHook') evaluation = dict(interval=200, metric='mIoU', by_epoch=False) work_dir = './work_dirs/tutorial' seed = 0 gpu_ids = range(0, 1)
norm_cfg = dict(type='BN', requires_grad=True) model = dict(type='EncoderDecoder', pretrained='open-mmlab://resnet50_v1c', backbone=dict(type='ResNetV1c', depth=50, num_stages=4, out_indices=(0, 1, 2, 3), dilations=(1, 1, 2, 4), strides=(1, 2, 1, 1), norm_cfg=dict(type='BN', requires_grad=True), norm_eval=False, style='pytorch', contract_dilation=True), decode_head=dict(type='PSPHead', in_channels=2048, in_index=3, channels=512, pool_scales=(1, 2, 3, 6), dropout_ratio=0.1, num_classes=6, norm_cfg=dict(type='BN', requires_grad=True), align_corners=False, loss_decode=dict(type='CrossEntropyLoss', use_sigmoid=False, loss_weight=1.0)), auxiliary_head=dict(type='FCNHead', in_channels=1024, in_index=2, channels=256, num_convs=1, concat_input=False, dropout_ratio=0.1, num_classes=6, norm_cfg=dict(type='BN', requires_grad=True), align_corners=False, loss_decode=dict(type='CrossEntropyLoss', use_sigmoid=False, loss_weight=0.4)), train_cfg=dict(), test_cfg=dict(mode='whole')) dataset_type = 'CardDataset' data_root = '../card_dataset' img_norm_cfg = dict(mean=[123.675, 116.28, 103.53], std=[58.395, 57.12, 57.375], to_rgb=True) crop_size = (256, 256) train_pipeline = [dict(type='LoadImageFromFile'), dict(type='LoadAnnotations'), dict(type='Resize', img_scale=(500, 500), ratio_range=(0.5, 2.0)), dict(type='RandomCrop', crop_size=(256, 256), cat_max_ratio=0.75), dict(type='RandomFlip', flip_ratio=0.5), dict(type='PhotoMetricDistortion'), dict(type='Normalize', mean=[123.675, 116.28, 103.53], std=[58.395, 57.12, 57.375], to_rgb=True), dict(type='Pad', size=(256, 256), pad_val=0, seg_pad_val=255), dict(type='DefaultFormatBundle'), dict(type='Collect', keys=['img', 'gt_semantic_seg'])] test_pipeline = [dict(type='LoadImageFromFile'), dict(type='MultiScaleFlipAug', img_scale=(500, 500), flip=False, transforms=[dict(type='Resize', keep_ratio=True), dict(type='RandomFlip'), dict(type='Normalize', mean=[123.675, 116.28, 103.53], std=[58.395, 57.12, 57.375], to_rgb=True), dict(type='ImageToTensor', keys=['img']), dict(type='Collect', keys=['img'])])] data = dict(samples_per_gpu=8, workers_per_gpu=8, train=dict(type='CardDataset', data_root='../card_dataset', img_dir='images', ann_dir='labels', pipeline=[dict(type='LoadImageFromFile'), dict(type='LoadAnnotations'), dict(type='Resize', img_scale=(500, 500), ratio_range=(0.5, 2.0)), dict(type='RandomCrop', crop_size=(256, 256), cat_max_ratio=0.75), dict(type='RandomFlip', flip_ratio=0.5), dict(type='PhotoMetricDistortion'), dict(type='Normalize', mean=[123.675, 116.28, 103.53], std=[58.395, 57.12, 57.375], to_rgb=True), dict(type='Pad', size=(256, 256), pad_val=0, seg_pad_val=255), dict(type='DefaultFormatBundle'), dict(type='Collect', keys=['img', 'gt_semantic_seg'])], split='splits/train.txt'), val=dict(type='CardDataset', data_root='../card_dataset', img_dir='images', ann_dir='labels', pipeline=[dict(type='LoadImageFromFile'), dict(type='MultiScaleFlipAug', img_scale=(500, 500), flip=False, transforms=[dict(type='Resize', keep_ratio=True), dict(type='RandomFlip'), dict(type='Normalize', mean=[123.675, 116.28, 103.53], std=[58.395, 57.12, 57.375], to_rgb=True), dict(type='ImageToTensor', keys=['img']), dict(type='Collect', keys=['img'])])], split='splits/val.txt'), test=dict(type='CardDataset', data_root='../card_dataset', img_dir='images', ann_dir='labels', pipeline=[dict(type='LoadImageFromFile'), dict(type='MultiScaleFlipAug', img_scale=(500, 500), flip=False, transforms=[dict(type='Resize', keep_ratio=True), dict(type='RandomFlip'), dict(type='Normalize', mean=[123.675, 116.28, 103.53], std=[58.395, 57.12, 57.375], to_rgb=True), dict(type='ImageToTensor', keys=['img']), dict(type='Collect', keys=['img'])])], split='splits/val.txt')) log_config = dict(interval=10, hooks=[dict(type='TextLoggerHook', by_epoch=False)]) dist_params = dict(backend='nccl') log_level = 'INFO' load_from = 'checkpoints/pspnet_r50-d8_512x1024_40k_cityscapes_20200605_003338-2966598c.pth' resume_from = None workflow = [('train', 1)] cudnn_benchmark = True optimizer = dict(type='SGD', lr=0.01, momentum=0.9, weight_decay=0.0005) optimizer_config = dict(type='OptimizerHook') lr_config = dict(policy='poly', power=0.9, min_lr=0.0001, by_epoch=False) runner = dict(type='IterBasedRunner', max_iters=200) checkpoint_config = dict(by_epoch=False, interval=200, type='CheckpointHook') evaluation = dict(interval=200, metric='mIoU', by_epoch=False) work_dir = './work_dirs/tutorial' seed = 0 gpu_ids = range(0, 1)
class Solution: def longestAwesome(self, s: str) -> int: table = {0 : -1} mask = maxLen = 0 for i, c in enumerate(s): mask ^= (1 << int(c)) for j in range(10): mask2 = mask ^ (1 << j) if mask2 in table: maxLen = max(maxLen, i - table[mask2]) if mask in table: maxLen = max(maxLen, i - table[mask]) else: table[mask] = i return maxLen
class Solution: def longest_awesome(self, s: str) -> int: table = {0: -1} mask = max_len = 0 for (i, c) in enumerate(s): mask ^= 1 << int(c) for j in range(10): mask2 = mask ^ 1 << j if mask2 in table: max_len = max(maxLen, i - table[mask2]) if mask in table: max_len = max(maxLen, i - table[mask]) else: table[mask] = i return maxLen
# This is what gets created by TextField.as_tensor with a SingleIdTokenIndexer # and a TokenCharactersIndexer; see the code snippet above. This time we're using # more intuitive names for the indexers and embedders. token_tensor = { 'tokens': {'tokens': torch.LongTensor([[2, 4, 3, 5]])}, 'token_characters': {'token_characters': torch.LongTensor( [[[2, 5, 3], [4, 0, 0], [2, 1, 4], [5, 4, 0]]])} } # This is for embedding each token. embedding = Embedding(num_embeddings=6, embedding_dim=3) # This is for encoding the characters in each token. character_embedding = Embedding(num_embeddings=6, embedding_dim=3) cnn_encoder = CnnEncoder(embedding_dim=3, num_filters=4, ngram_filter_sizes=[3]) token_encoder = TokenCharactersEncoder(character_embedding, cnn_encoder) embedder = BasicTextFieldEmbedder( token_embedders={'tokens': embedding, 'token_characters': token_encoder}) embedded_tokens = embedder(token_tensor) print(embedded_tokens) # This is what gets created by TextField.as_tensor with a SingleIdTokenIndexer, # a TokenCharactersIndexer, and another SingleIdTokenIndexer for PoS tags; # see the code above. token_tensor = { 'tokens': {'tokens': torch.LongTensor([[2, 4, 3, 5]])}, 'token_characters': {'token_characters': torch.LongTensor( [[[2, 5, 3], [4, 0, 0], [2, 1, 4], [5, 4, 0]]])}, 'pos_tag_tokens': {'tokens': torch.tensor([[2, 5, 3, 4]])} } vocab = Vocabulary() vocab.add_tokens_to_namespace( ['This', 'is', 'some', 'text', '.'], namespace='token_vocab') vocab.add_tokens_to_namespace( ['T', 'h', 'i', 's', ' ', 'o', 'm', 'e', 't', 'x', '.'], namespace='character_vocab') vocab.add_tokens_to_namespace( ['DT', 'VBZ', 'NN', '.'], namespace='pos_tag_vocab') # Notice below how the 'vocab_namespace' parameter matches the name used above. # We're showing here how the code works when we're constructing the Embedding from # a configuration file, where the vocabulary object gets passed in behind the # scenes (but the vocab_namespace parameter must be set in the config). If you are # using a `build_model` method (see the quick start chapter) or instantiating the # Embedding yourself directly, you can just grab the vocab size yourself and pass # in num_embeddings, as we do above. # This is for embedding each token. embedding = Embedding(embedding_dim=3, vocab_namespace='token_vocab', vocab=vocab) # This is for encoding the characters in each token. character_embedding = Embedding(embedding_dim=4, vocab_namespace='character_vocab', vocab=vocab) cnn_encoder = CnnEncoder(embedding_dim=4, num_filters=5, ngram_filter_sizes=[3]) token_encoder = TokenCharactersEncoder(character_embedding, cnn_encoder) # This is for embedding the part of speech tag of each token. pos_tag_embedding = Embedding(embedding_dim=6, vocab_namespace='pos_tag_vocab', vocab=vocab) # Notice how these keys match the keys in the token_tensor dictionary above; # these are the keys that you give to your TokenIndexers when constructing # your TextFields in the DatasetReader. embedder = BasicTextFieldEmbedder( token_embedders={'tokens': embedding, 'token_characters': token_encoder, 'pos_tag_tokens': pos_tag_embedding}) embedded_tokens = embedder(token_tensor) print(embedded_tokens)
token_tensor = {'tokens': {'tokens': torch.LongTensor([[2, 4, 3, 5]])}, 'token_characters': {'token_characters': torch.LongTensor([[[2, 5, 3], [4, 0, 0], [2, 1, 4], [5, 4, 0]]])}} embedding = embedding(num_embeddings=6, embedding_dim=3) character_embedding = embedding(num_embeddings=6, embedding_dim=3) cnn_encoder = cnn_encoder(embedding_dim=3, num_filters=4, ngram_filter_sizes=[3]) token_encoder = token_characters_encoder(character_embedding, cnn_encoder) embedder = basic_text_field_embedder(token_embedders={'tokens': embedding, 'token_characters': token_encoder}) embedded_tokens = embedder(token_tensor) print(embedded_tokens) token_tensor = {'tokens': {'tokens': torch.LongTensor([[2, 4, 3, 5]])}, 'token_characters': {'token_characters': torch.LongTensor([[[2, 5, 3], [4, 0, 0], [2, 1, 4], [5, 4, 0]]])}, 'pos_tag_tokens': {'tokens': torch.tensor([[2, 5, 3, 4]])}} vocab = vocabulary() vocab.add_tokens_to_namespace(['This', 'is', 'some', 'text', '.'], namespace='token_vocab') vocab.add_tokens_to_namespace(['T', 'h', 'i', 's', ' ', 'o', 'm', 'e', 't', 'x', '.'], namespace='character_vocab') vocab.add_tokens_to_namespace(['DT', 'VBZ', 'NN', '.'], namespace='pos_tag_vocab') embedding = embedding(embedding_dim=3, vocab_namespace='token_vocab', vocab=vocab) character_embedding = embedding(embedding_dim=4, vocab_namespace='character_vocab', vocab=vocab) cnn_encoder = cnn_encoder(embedding_dim=4, num_filters=5, ngram_filter_sizes=[3]) token_encoder = token_characters_encoder(character_embedding, cnn_encoder) pos_tag_embedding = embedding(embedding_dim=6, vocab_namespace='pos_tag_vocab', vocab=vocab) embedder = basic_text_field_embedder(token_embedders={'tokens': embedding, 'token_characters': token_encoder, 'pos_tag_tokens': pos_tag_embedding}) embedded_tokens = embedder(token_tensor) print(embedded_tokens)
{ "targets": [ { "target_name": "decompressor", "sources": ["decompressor.cpp"] }, { "target_name": "pow_solver", "sources": ["pow_solver.cpp"] } ] }
{'targets': [{'target_name': 'decompressor', 'sources': ['decompressor.cpp']}, {'target_name': 'pow_solver', 'sources': ['pow_solver.cpp']}]}
class C4FileIO(): red_wins = 0 blue_wins = 0 def __init__(self): try: f = open("c4wins.txt", "r") lines = f.readlines() f.close() if type(lines) == list: self.deserialize_file(lines) except FileNotFoundError: print("File not found, writing new file.") def deserialize_file(self, lines): for line in lines: line = line.strip("\n") w = line.split(",") if w[0] == "red_wins": self.red_wins = int(w[1]) elif w[0] == "blue_wins": self.blue_wins = int(w[1]) def serialize_file(self): f = open("c4wins.txt", "w") f_str = "" f_str += "red_wins," + str(self.red_wins) + " \n" f_str += "blue_wins," + str(self.blue_wins) + " \n" print(f_str) f.write(f_str) f.close()
class C4Fileio: red_wins = 0 blue_wins = 0 def __init__(self): try: f = open('c4wins.txt', 'r') lines = f.readlines() f.close() if type(lines) == list: self.deserialize_file(lines) except FileNotFoundError: print('File not found, writing new file.') def deserialize_file(self, lines): for line in lines: line = line.strip('\n') w = line.split(',') if w[0] == 'red_wins': self.red_wins = int(w[1]) elif w[0] == 'blue_wins': self.blue_wins = int(w[1]) def serialize_file(self): f = open('c4wins.txt', 'w') f_str = '' f_str += 'red_wins,' + str(self.red_wins) + ' \n' f_str += 'blue_wins,' + str(self.blue_wins) + ' \n' print(f_str) f.write(f_str) f.close()