content stringlengths 7 1.05M | fixed_cases stringlengths 1 1.28M |
|---|---|
# Copyright 2017 The LUCI Authors. All rights reserved.
# Use of this source code is governed under the Apache License, Version 2.0
# that can be found in the LICENSE file.
DEPS = [
'properties',
'step',
'url',
]
def RunSteps(api):
api.url.validate_url(api.properties['url_to_validate'])
def GenTests(api):
yield (api.test('basic') +
api.properties(url_to_validate='https://example.com'))
yield (api.test('no_scheme') +
api.properties(url_to_validate='example.com') +
api.expect_exception('ValueError'))
yield (api.test('invalid_scheme') +
api.properties(url_to_validate='ftp://example.com') +
api.expect_exception('ValueError'))
yield (api.test('no_host') +
api.properties(url_to_validate='https://') +
api.expect_exception('ValueError'))
| deps = ['properties', 'step', 'url']
def run_steps(api):
api.url.validate_url(api.properties['url_to_validate'])
def gen_tests(api):
yield (api.test('basic') + api.properties(url_to_validate='https://example.com'))
yield (api.test('no_scheme') + api.properties(url_to_validate='example.com') + api.expect_exception('ValueError'))
yield (api.test('invalid_scheme') + api.properties(url_to_validate='ftp://example.com') + api.expect_exception('ValueError'))
yield (api.test('no_host') + api.properties(url_to_validate='https://') + api.expect_exception('ValueError')) |
class Option(object):
"""A Class implementing some sort of field interface"""
def __init__(self,
name, label, type,
description=None, category='general', required=False,
choices=None, default=None, field_options=None):
kwargs = locals()
kwargs.pop('self')
for attr, value in kwargs.items():
setattr(self, attr, value)
| class Option(object):
"""A Class implementing some sort of field interface"""
def __init__(self, name, label, type, description=None, category='general', required=False, choices=None, default=None, field_options=None):
kwargs = locals()
kwargs.pop('self')
for (attr, value) in kwargs.items():
setattr(self, attr, value) |
#!/usr/bin/env python
def plain_merge(array_a: list, array_b: list) -> list:
pointer_a, pointer_b = 0, 0
length_a, length_b = len(array_a), len(array_b)
result = []
while pointer_a < length_a and pointer_b < length_b:
if array_a[pointer_a] <= array_b[pointer_b]:
result.append(array_a[pointer_a])
pointer_a += 1
else:
result.append(array_b[pointer_b])
pointer_b += 1
if pointer_a != length_a:
result += array_a[pointer_a:]
elif pointer_b != length_b:
result += array_b[pointer_b:]
return result
| def plain_merge(array_a: list, array_b: list) -> list:
(pointer_a, pointer_b) = (0, 0)
(length_a, length_b) = (len(array_a), len(array_b))
result = []
while pointer_a < length_a and pointer_b < length_b:
if array_a[pointer_a] <= array_b[pointer_b]:
result.append(array_a[pointer_a])
pointer_a += 1
else:
result.append(array_b[pointer_b])
pointer_b += 1
if pointer_a != length_a:
result += array_a[pointer_a:]
elif pointer_b != length_b:
result += array_b[pointer_b:]
return result |
# does this even work?
class InvalidToken(Exception, object):
"""Raise an invalid token """
def __init__(self, message, payload):
super(InvalidToken, self).__init__(message, payload)
self.message = message
self.payload = payload | class Invalidtoken(Exception, object):
"""Raise an invalid token """
def __init__(self, message, payload):
super(InvalidToken, self).__init__(message, payload)
self.message = message
self.payload = payload |
""" Stat objects make life a little easier """
class CoreStat():
""" Core stats are what go up and down to modify the character """
def __init__(self, points=0):
points = int(points)
if points < 0:
points = 0
self._points = points
self._current = self.base
self._derived = DerivedStat(self.base)
@property
def base(self):
""" Force use of setter/getter """
return self._points + 1
@property
def current(self):
""" current getter """
return self._current
@current.setter
def current(self, value):
""" current setter """
self._current = value
if self._current < 0:
self._current = 0
@property
def derived(self):
""" Grab the derived stat """
return self._derived
def set_derived(self, factor, offset):
""" Set's the multiplication factor for the derived stat """
self.derived._base = self.base
new_factor = self._derived.factor = factor
new_offset = self._derived.offset = offset
self.derived.restore()
return new_factor, new_offset
def upgrade(self, points=1):
""" Increases the core stat by upgrading it """
points = int(points)
if points < 1:
points = 1
# Update the core stat
self._points += points
self.restore()
# Update the derived stat
self.derived._base = self.base
self.derived.restore()
return True
def restart(self):
""" Removes all upgrades on this stat """
old_points = self._points
# Update the core stat
self._points = 0
self.restore()
# Update the derived stat
self.derived._base = self.base
self.derived.restore()
# Return what was removed for keeping track of stat restarts
return old_points
def restore(self):
""" Restores the current value back to baseline """
self.current = self._points + 1
def __getstate__(self):
""" Serialize core stat """
return {
"points": self._points,
"derived_factor": self._derived.factor,
"derived_offset": self._derived.offset
}
def __setstate__(self, state):
""" Deserialize core stat """
# Update the core stat
self._points = state["points"]
self.restore()
# Update the derived stat
factor = state["derived_factor"]
offset = state["derived_offset"]
self.set_derived(factor, offset)
self.derived.restore()
class DerivedStat():
""" Derived stats are based off core stats, and change when their core changes """
def __init__(self, base, factor=1.0, offset=0):
self._factor = factor
self._offset = offset
self._base = base
self._current = self.base
@property
def base(self):
""" Programmatically calculates the base value """
return (self._base * self._factor) + self._offset
@property
def current(self):
""" Update than grab the current value """
return self._current
@current.setter
def current(self, value):
""" Sets the current value """
self._current = int(value)
if self._current < 0:
self._current = 0
@property
def factor(self):
""" Get the multiplication factor """
return self._factor
@factor.setter
def factor(self, value):
""" Set the multiplication factor """
value = int(value)
if value < 1:
value = 1
self._factor = value
return value
@property
def offset(self):
""" Get the offset """
return self._offset
@offset.setter
def offset(self, value):
""" Set the addition offset """
value = int(value)
if value < 0:
value = 0
self._offset = value
return value
def restore(self):
""" Restores the current value back to the given amount """
self._current = self.base
| """ Stat objects make life a little easier """
class Corestat:
""" Core stats are what go up and down to modify the character """
def __init__(self, points=0):
points = int(points)
if points < 0:
points = 0
self._points = points
self._current = self.base
self._derived = derived_stat(self.base)
@property
def base(self):
""" Force use of setter/getter """
return self._points + 1
@property
def current(self):
""" current getter """
return self._current
@current.setter
def current(self, value):
""" current setter """
self._current = value
if self._current < 0:
self._current = 0
@property
def derived(self):
""" Grab the derived stat """
return self._derived
def set_derived(self, factor, offset):
""" Set's the multiplication factor for the derived stat """
self.derived._base = self.base
new_factor = self._derived.factor = factor
new_offset = self._derived.offset = offset
self.derived.restore()
return (new_factor, new_offset)
def upgrade(self, points=1):
""" Increases the core stat by upgrading it """
points = int(points)
if points < 1:
points = 1
self._points += points
self.restore()
self.derived._base = self.base
self.derived.restore()
return True
def restart(self):
""" Removes all upgrades on this stat """
old_points = self._points
self._points = 0
self.restore()
self.derived._base = self.base
self.derived.restore()
return old_points
def restore(self):
""" Restores the current value back to baseline """
self.current = self._points + 1
def __getstate__(self):
""" Serialize core stat """
return {'points': self._points, 'derived_factor': self._derived.factor, 'derived_offset': self._derived.offset}
def __setstate__(self, state):
""" Deserialize core stat """
self._points = state['points']
self.restore()
factor = state['derived_factor']
offset = state['derived_offset']
self.set_derived(factor, offset)
self.derived.restore()
class Derivedstat:
""" Derived stats are based off core stats, and change when their core changes """
def __init__(self, base, factor=1.0, offset=0):
self._factor = factor
self._offset = offset
self._base = base
self._current = self.base
@property
def base(self):
""" Programmatically calculates the base value """
return self._base * self._factor + self._offset
@property
def current(self):
""" Update than grab the current value """
return self._current
@current.setter
def current(self, value):
""" Sets the current value """
self._current = int(value)
if self._current < 0:
self._current = 0
@property
def factor(self):
""" Get the multiplication factor """
return self._factor
@factor.setter
def factor(self, value):
""" Set the multiplication factor """
value = int(value)
if value < 1:
value = 1
self._factor = value
return value
@property
def offset(self):
""" Get the offset """
return self._offset
@offset.setter
def offset(self, value):
""" Set the addition offset """
value = int(value)
if value < 0:
value = 0
self._offset = value
return value
def restore(self):
""" Restores the current value back to the given amount """
self._current = self.base |
"""
weather.exceptions
------------------
Exceptions for weather django app
"""
class CityDoesNotExistsException(Exception):
def __init__(self, message: str = None, *args, **kwargs):
if message is None:
message = "The queried city object doesn exists"
Exception.__init__(self, message, *args, **kwargs)
class APIRequestException(Exception):
def __init__(self, message: str = None, *args, **kwargs):
if message is None:
message = "The call to the API didn't return 200"
Exception.__init__(self, message, *args, **kwargs)
| """
weather.exceptions
------------------
Exceptions for weather django app
"""
class Citydoesnotexistsexception(Exception):
def __init__(self, message: str=None, *args, **kwargs):
if message is None:
message = 'The queried city object doesn exists'
Exception.__init__(self, message, *args, **kwargs)
class Apirequestexception(Exception):
def __init__(self, message: str=None, *args, **kwargs):
if message is None:
message = "The call to the API didn't return 200"
Exception.__init__(self, message, *args, **kwargs) |
x={"a","b","c"}
y=(1,2,3)
z=[4,5,2]
print(type(x));
print(type(y));
print(type(z));
x.add("d")
print(x)
z.append(5)
print(y)
print(z)
for i in x:
print (i)
if 5 in z:
print("yes")
x.remove("b")
print(x)
z.remove(4)
print(z)
z.insert(1,7)
print(z)
z.extend(y)
print(z)
print(z.count(2))
del y
print(y)
| x = {'a', 'b', 'c'}
y = (1, 2, 3)
z = [4, 5, 2]
print(type(x))
print(type(y))
print(type(z))
x.add('d')
print(x)
z.append(5)
print(y)
print(z)
for i in x:
print(i)
if 5 in z:
print('yes')
x.remove('b')
print(x)
z.remove(4)
print(z)
z.insert(1, 7)
print(z)
z.extend(y)
print(z)
print(z.count(2))
del y
print(y) |
first = ord('A')
last = ord('Z')
for i in range(first, last + 1):
for j in range(last, first - 1, -1):
if j <= i:
print(chr(i), end=' ')
else:
print('', end=' ')
print()
| first = ord('A')
last = ord('Z')
for i in range(first, last + 1):
for j in range(last, first - 1, -1):
if j <= i:
print(chr(i), end=' ')
else:
print('', end=' ')
print() |
coordinates_01EE00 = ((123, 116),
(123, 124), (123, 127), (123, 128), (123, 136), (123, 137), (124, 115), (124, 117), (124, 119), (124, 120), (124, 121), (124, 122), (124, 130), (124, 134), (124, 135), (124, 138), (125, 114), (125, 116), (125, 124), (125, 125), (125, 126), (125, 127), (125, 128), (125, 131), (125, 132), (125, 136), (125, 138), (126, 114), (126, 116), (126, 117), (126, 118), (126, 119), (126, 120), (126, 121), (126, 122), (126, 123), (126, 124), (126, 125), (126, 126), (126, 127), (126, 128), (126, 129), (126, 130), (126, 133), (126, 134), (126, 135), (126, 137), (127, 115), (127, 117), (127, 118), (127, 119), (127, 120), (127, 121), (127, 122), (127, 123), (127, 124), (127, 125), (127, 126), (127, 127), (127, 128), (127, 129), (127, 130), (127, 131), (127, 132), (127, 133), (127, 134), (127, 135), (127, 137), (128, 115), (128, 117), (128, 118), (128, 119), (128, 120),
(128, 121), (128, 122), (128, 123), (128, 124), (128, 125), (128, 126), (128, 127), (128, 128), (128, 129), (128, 130), (128, 131), (128, 132), (128, 133), (128, 134), (128, 136), (129, 115), (129, 117), (129, 118), (129, 119), (129, 120), (129, 121), (129, 122), (129, 123), (129, 124), (129, 125), (129, 126), (129, 127), (129, 128), (129, 129), (129, 130), (129, 131), (129, 132), (129, 133), (129, 134), (129, 136), (130, 115), (130, 117), (130, 118), (130, 119), (130, 120), (130, 121), (130, 122), (130, 123), (130, 124), (130, 125), (130, 126), (130, 127), (130, 128), (130, 129), (130, 130), (130, 131), (130, 132), (130, 133), (130, 135), (131, 116), (131, 118), (131, 119), (131, 120), (131, 121), (131, 122), (131, 123), (131, 124), (131, 125), (131, 126), (131, 127), (131, 128), (131, 129), (131, 130), (131, 131), (131, 132), (131, 134), (132, 117),
(132, 119), (132, 120), (132, 121), (132, 122), (132, 123), (132, 124), (132, 125), (132, 126), (132, 127), (132, 128), (132, 129), (132, 130), (132, 131), (132, 133), (133, 118), (133, 120), (133, 121), (133, 122), (133, 123), (133, 124), (133, 125), (133, 126), (133, 127), (133, 128), (133, 129), (133, 130), (133, 132), (134, 119), (134, 121), (134, 122), (134, 123), (134, 126), (134, 127), (134, 128), (134, 129), (134, 131), (135, 120), (135, 122), (135, 123), (135, 125), (135, 126), (135, 127), (135, 128), (135, 130), (136, 120), (136, 123), (136, 126), (136, 129), (137, 119), (137, 121), (137, 123), (137, 126), (137, 128), (138, 119), (138, 122), (138, 126), (138, 128), (139, 119), (139, 122), (139, 126), (140, 120), (140, 122), (140, 126), (140, 127), )
coordinates_00EE00 = ((107, 122),
(108, 122), (108, 124), (109, 122), (109, 125), (110, 114), (110, 122), (110, 124), (110, 126), (111, 113), (111, 122), (111, 124), (111, 125), (111, 127), (112, 112), (112, 115), (112, 123), (112, 127), (113, 112), (113, 114), (113, 118), (113, 124), (113, 127), (114, 118), (115, 116), (115, 117), )
coordinates_E0E1E1 = ()
| coordinates_01_ee00 = ((123, 116), (123, 124), (123, 127), (123, 128), (123, 136), (123, 137), (124, 115), (124, 117), (124, 119), (124, 120), (124, 121), (124, 122), (124, 130), (124, 134), (124, 135), (124, 138), (125, 114), (125, 116), (125, 124), (125, 125), (125, 126), (125, 127), (125, 128), (125, 131), (125, 132), (125, 136), (125, 138), (126, 114), (126, 116), (126, 117), (126, 118), (126, 119), (126, 120), (126, 121), (126, 122), (126, 123), (126, 124), (126, 125), (126, 126), (126, 127), (126, 128), (126, 129), (126, 130), (126, 133), (126, 134), (126, 135), (126, 137), (127, 115), (127, 117), (127, 118), (127, 119), (127, 120), (127, 121), (127, 122), (127, 123), (127, 124), (127, 125), (127, 126), (127, 127), (127, 128), (127, 129), (127, 130), (127, 131), (127, 132), (127, 133), (127, 134), (127, 135), (127, 137), (128, 115), (128, 117), (128, 118), (128, 119), (128, 120), (128, 121), (128, 122), (128, 123), (128, 124), (128, 125), (128, 126), (128, 127), (128, 128), (128, 129), (128, 130), (128, 131), (128, 132), (128, 133), (128, 134), (128, 136), (129, 115), (129, 117), (129, 118), (129, 119), (129, 120), (129, 121), (129, 122), (129, 123), (129, 124), (129, 125), (129, 126), (129, 127), (129, 128), (129, 129), (129, 130), (129, 131), (129, 132), (129, 133), (129, 134), (129, 136), (130, 115), (130, 117), (130, 118), (130, 119), (130, 120), (130, 121), (130, 122), (130, 123), (130, 124), (130, 125), (130, 126), (130, 127), (130, 128), (130, 129), (130, 130), (130, 131), (130, 132), (130, 133), (130, 135), (131, 116), (131, 118), (131, 119), (131, 120), (131, 121), (131, 122), (131, 123), (131, 124), (131, 125), (131, 126), (131, 127), (131, 128), (131, 129), (131, 130), (131, 131), (131, 132), (131, 134), (132, 117), (132, 119), (132, 120), (132, 121), (132, 122), (132, 123), (132, 124), (132, 125), (132, 126), (132, 127), (132, 128), (132, 129), (132, 130), (132, 131), (132, 133), (133, 118), (133, 120), (133, 121), (133, 122), (133, 123), (133, 124), (133, 125), (133, 126), (133, 127), (133, 128), (133, 129), (133, 130), (133, 132), (134, 119), (134, 121), (134, 122), (134, 123), (134, 126), (134, 127), (134, 128), (134, 129), (134, 131), (135, 120), (135, 122), (135, 123), (135, 125), (135, 126), (135, 127), (135, 128), (135, 130), (136, 120), (136, 123), (136, 126), (136, 129), (137, 119), (137, 121), (137, 123), (137, 126), (137, 128), (138, 119), (138, 122), (138, 126), (138, 128), (139, 119), (139, 122), (139, 126), (140, 120), (140, 122), (140, 126), (140, 127))
coordinates_00_ee00 = ((107, 122), (108, 122), (108, 124), (109, 122), (109, 125), (110, 114), (110, 122), (110, 124), (110, 126), (111, 113), (111, 122), (111, 124), (111, 125), (111, 127), (112, 112), (112, 115), (112, 123), (112, 127), (113, 112), (113, 114), (113, 118), (113, 124), (113, 127), (114, 118), (115, 116), (115, 117))
coordinates_e0_e1_e1 = () |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue Oct 19 17:46:22 2021
@author: rezanmoustafa
"""
# Endret fra 8b til 9
class Sporsmaal:
def __init__(self, sporsmaal, svar, valg=[]):
self.sporsmaal=sporsmaal
self.svar=svar
self.valg=valg
def HentSporsmaal(self):
print(self.sporsmaal)
for i in range(len(self.valg)):
print(i, self.valg[i])
# Deloppgave 9e)
def korrekt_svar_tekst(self):
return self.valg[self.svar]
# Deloppgave 9d)
def les_filen(sporsmaalsfil):
sporsmaalene = []
file = open('sporsmaalsfil.txt','r')
for line in file:
line = line.strip().split(':')
sporsmaal = line[0];
svar = int(line[1])
lst = []
for val in line[2].split(","):
lst.append(val)
sporsmaalene.append(Sporsmaal(sporsmaal,svar,lst))
file.close()
return sporsmaalene
# Deloppgave 9f)
if __name__=="__main__":
sporsmaalene = les_filen("sporsmaalsfil.txt")
spiller1Score = 0
spiller2Score = 0
for i in range(len(sporsmaalene)):
sporsmaalene[i].HentSporsmaal()
spiller1 = int(input('\nSpiller 1: '))
spiller2 = int(input('Spiller 2: '))
print("\nRiktig svar: ",sporsmaalene[i].korrekt_svar_tekst())
if spiller1 == sporsmaalene[i].svar:
spiller1Score += 1
if spiller2 == sporsmaalene[i].svar:
spiller2Score += 1
print()
print("\nSpiller 1 har ",spiller1Score,' av ',len(sporsmaalene))
print("Spiller 2 har ",spiller2Score,' av ',len(sporsmaalene))
if spiller1Score > spiller2Score:
print("\nSpiller 1 er vinneren!!!")
elif spiller2Score > spiller1Score:
print("\nSpiller 2 er vinneren!!!")
else:
print("\nDet ble uavgjort!!!")
| """
Created on Tue Oct 19 17:46:22 2021
@author: rezanmoustafa
"""
class Sporsmaal:
def __init__(self, sporsmaal, svar, valg=[]):
self.sporsmaal = sporsmaal
self.svar = svar
self.valg = valg
def hent_sporsmaal(self):
print(self.sporsmaal)
for i in range(len(self.valg)):
print(i, self.valg[i])
def korrekt_svar_tekst(self):
return self.valg[self.svar]
def les_filen(sporsmaalsfil):
sporsmaalene = []
file = open('sporsmaalsfil.txt', 'r')
for line in file:
line = line.strip().split(':')
sporsmaal = line[0]
svar = int(line[1])
lst = []
for val in line[2].split(','):
lst.append(val)
sporsmaalene.append(sporsmaal(sporsmaal, svar, lst))
file.close()
return sporsmaalene
if __name__ == '__main__':
sporsmaalene = les_filen('sporsmaalsfil.txt')
spiller1_score = 0
spiller2_score = 0
for i in range(len(sporsmaalene)):
sporsmaalene[i].HentSporsmaal()
spiller1 = int(input('\nSpiller 1: '))
spiller2 = int(input('Spiller 2: '))
print('\nRiktig svar: ', sporsmaalene[i].korrekt_svar_tekst())
if spiller1 == sporsmaalene[i].svar:
spiller1_score += 1
if spiller2 == sporsmaalene[i].svar:
spiller2_score += 1
print()
print('\nSpiller 1 har ', spiller1Score, ' av ', len(sporsmaalene))
print('Spiller 2 har ', spiller2Score, ' av ', len(sporsmaalene))
if spiller1Score > spiller2Score:
print('\nSpiller 1 er vinneren!!!')
elif spiller2Score > spiller1Score:
print('\nSpiller 2 er vinneren!!!')
else:
print('\nDet ble uavgjort!!!') |
# -*- coding: utf-8 -*-
Consent_form_Out = { # From Operator_CR to UI
"source": {
"service_id": "String",
"rs_id": "String",
"dataset": [
{
"dataset_id": "String",
"title": "String",
"description": "String",
"keyword": [],
"publisher": "String",
"distribution": {
"distribution_id": "String",
"access_url": "String"
},
"component_specification_label": "String",
"selected": True
}
]
},
"sink": {
"service_id": "String",
"dataset": [
{
"datase_id": "String",
"title": "String",
"description": "String",
"keyword": [],
"publisher": "String",
"purposes": [
{
"title": "All your cats are belong to us",
"selected": True,
"required": True
},
{
"title": "Something random",
"selected": True,
"required": True
}
]
}
]
}
}
| consent_form__out = {'source': {'service_id': 'String', 'rs_id': 'String', 'dataset': [{'dataset_id': 'String', 'title': 'String', 'description': 'String', 'keyword': [], 'publisher': 'String', 'distribution': {'distribution_id': 'String', 'access_url': 'String'}, 'component_specification_label': 'String', 'selected': True}]}, 'sink': {'service_id': 'String', 'dataset': [{'datase_id': 'String', 'title': 'String', 'description': 'String', 'keyword': [], 'publisher': 'String', 'purposes': [{'title': 'All your cats are belong to us', 'selected': True, 'required': True}, {'title': 'Something random', 'selected': True, 'required': True}]}]}} |
class Ionic:
"""Ionic radius class. Stores: charge, spin, coordination"""
def __init__(self, charge=0, coordination="", radius=0.0):
self.charge = charge
self.coordination = coordination
self.radius = radius
def set_radius(self, value: float):
self.radius = value
class Atom_Data:
"""Atom data class. Stores Radius: covalent; Color: tuple, RGBA values"""
def __init__(self, radius: float, vanDerWaals=0.00, color=(0.5,0.5,0.5, 1), ionicData=[Ionic()]): # Gray is the default color if none is specified
self.radius = radius #covalent radius
self.vanDerWaals = vanDerWaals #default is set temprarilly as 0.00 is radius is not reported
self.color = color #RGBA values: default is gray
self.ionicData = ionicData
def get_radius(self):
"""
returns: <float> atom's covalent radius
"""
return self.radius
def get_color(self):
"""
returns: <tuple size 4> rgba values for color
"""
return self.color
def get_vanDerWaals(self):
"""
returns: vanDerWaals radius for element.
"""
return self.vanDerWaals
def get_ionicData(self):
return self.ionicData
IonicRadii = { #element symbols, their covalent radii & their RGBA color values
"Ac": [Ionic(3,"VI",1.12)],
"Al": [Ionic(3,"IV",0.39),Ionic(3,"V",0.48),Ionic(3,"VI",0.535)],
"Am": [Ionic(2,"VII",1.21),Ionic(2,"VIII",1.26),Ionic(2,"IX",1.31),Ionic(3,"VI",0.975),Ionic(3,"VIII",1.09),
Ionic(4,"VI",0.85),Ionic(4,"VIII",0.95)],
"Sb": [Ionic(3,"IVPY",0.76),Ionic(3,"V",0.8),Ionic(3,"VI",0.76),Ionic(5,"VI",0.6)],
"Ar": [Ionic()],
"As": [Ionic(3,"VI",0.58),Ionic(5,"IV",0.335),Ionic(5,"VI",0.46)],
"At": [Ionic(7,"VI",0.62)],
"Ba": [Ionic(2,"VI",1.35),Ionic(2,"VII",1.38),Ionic(2,"VIII",1.42),Ionic(2,"IX",1.47),Ionic(2,"X",1.52),Ionic(2,"XI",1.57),
Ionic(2,"XII",1.61)],
"Bk": [Ionic(3,"VI",0.96),Ionic(4,"VI",0.83),Ionic(4,"VIII",0.93)],
"Be": [Ionic(2,"III",0.16),Ionic(2,"IV",0.27),Ionic(2,"VI",0.45)],
"Bi": [Ionic(3,"V",0.96),Ionic(3,"VI",1.03),Ionic(3,"VIII",1.17),Ionic(5,"VI",0.76)],
"Bh": [Ionic()],
"B": [Ionic(3,"III",0.01),Ionic(3,"IV",0.11),Ionic(3,"VI",0.27)],
"Br": [Ionic(-1,"VI",1.96),Ionic(3,"IVSQ",0.59),Ionic(5,"IIIPY",0.31),Ionic(7,"IV",0.25),Ionic(7,"VI",0.39)],
"Cd": [Ionic(2,"IV",0.78),Ionic(2,"V",0.87),Ionic(2,"VI",0.95),Ionic(2,"VII",1.03),Ionic(2,"VIII",1.1),Ionic(2,"XII",1.31)],
"Ca": [Ionic(2,"VI",1),Ionic(2,"VII",1.06),Ionic(2,"VIII",1.12),Ionic(2,"IX",1.18),Ionic(2,"X",1.23),Ionic(2,"XII",1.34)],
"Cf": [Ionic(3,"VI",0.95),Ionic(4,"VI",0.821),Ionic(4,"VIII",0.92)],
"C": [Ionic(4,"III",0.08),Ionic(4,"IV",0.15),Ionic(4,"VI",0.16)],
"Ce": [Ionic(3,"VI",1.01),Ionic(3,"VII",1.07),Ionic(3,"VIII",1.143),Ionic(3,"IX",1.196),Ionic(3,"X",1.25),Ionic(3,"XII",1.34),
Ionic(4,"VI",0.87),Ionic(4,"VIII",0.97),Ionic(4,"X",1.07),Ionic(4,"XII",1.14)],
"Cs": [Ionic(1,"VI",1.67),Ionic(1,"VIII",1.74),Ionic(1,"IX",1.78),Ionic(1,"X",1.81),Ionic(1,"XI",1.85),Ionic(1,"XII",1.88)],
"Cl": [Ionic(-1,"VI",1.81),Ionic(5,"IIIPY",0.12),Ionic(7,"IV",0.08),Ionic(7,"VI",0.27)],
"Cr": [Ionic(2,"VI-ls",0.73),Ionic(2,"0-hs",0.8),Ionic(3,"VI",0.615),Ionic(4,"IV",0.41),Ionic(4,"VI",0.55),
Ionic(5,"IV",0.345),Ionic(5,"VI",0.49),Ionic(5,"VIII",0.57),Ionic(6,"IV",0.26),Ionic(6,"VI",0.44)],
"Co": [Ionic(2,"IV-hs",0.58),Ionic(2,"V",0.67),Ionic(2,"VI-ls",0.65),Ionic(2,"0-hs",0.745),Ionic(2,"VIII",0.9),
Ionic(3,"VI-ls",0.545),Ionic(3,"0-hs",0.61),Ionic(4,"IV",0.4),Ionic(4,"VI-hs",0.53)],
"Cn": [Ionic()],
"Cu": [Ionic(1,"II",0.46),Ionic(1,"IV",0.6),Ionic(1,"VI",0.77),Ionic(2,"IV",0.57),Ionic(2,"IVSQ",0.57),Ionic(2,"V",0.65),
Ionic(2,"VI",0.73),Ionic(3,"VI-ls",0.54)],
"Cm": [Ionic(3,"VI",0.97),Ionic(4,"VI",0.85),Ionic(4,"VIII",0.95)],
"Ds": [Ionic()],
"Db": [Ionic()],
"Dy": [Ionic(2,"VI",1.07),Ionic(2,"VII",1.13),Ionic(2,"VIII",1.19),Ionic(3,"VI",0.912),Ionic(3,"VII",0.97),Ionic(3,"VIII",1.027),
Ionic(3,"IX",1.083)],
"Es": [Ionic()],
"Er": [Ionic(3,"VI",0.89),Ionic(3,"VII",0.945),Ionic(3,"VIII",1.004),Ionic(3,"IX",1.062)],
"Eu": [Ionic(2,"VI",1.17),Ionic(2,"VII",1.2),Ionic(2,"VIII",1.25),Ionic(2,"IX",1.3),Ionic(2,"X",1.35),Ionic(3,"VI",0.947),
Ionic(3,"VII",1.01),Ionic(3,"VIII",1.066),Ionic(3,"IX",1.12)],
"Fm": [Ionic()],
"Fl": [Ionic()],
"F": [Ionic(-1,"II",1.285),Ionic(-1,"III",1.3),Ionic(-1,"IV",1.31),Ionic(-1,"VI",1.33),Ionic(7,"VI",0.08)],
"Fr": [Ionic(1,"VI",1.8)],
"Gd": [Ionic(3,"VI",0.938),Ionic(3,"VII",1),Ionic(3,"VIII",1.053),Ionic(3,"IX",1.107)],
"Ga": [Ionic(3,"IV",0.47),Ionic(3,"V",0.55),Ionic(3,"VI",0.62)],
"Ge": [Ionic(2,"VI",0.73),Ionic(4,"IV",0.39),Ionic(4,"VI",0.53)],
"Au": [Ionic(1,"VI",1.37),Ionic(3,"IVSQ",0.68),Ionic(3,"VI",0.85),Ionic(5,"VI",0.57)],
"Hf": [Ionic(4,"IV",0.58),Ionic(4,"VI",0.71),Ionic(4,"VII",0.76),Ionic(4,"VIII",0.83)],
"Hs": [Ionic()],
"He": [Ionic()],
"Ho": [Ionic(3,"VI",0.901),Ionic(3,"VIII",1.015),Ionic(3,"IX",1.072),Ionic(3,"X",1.12)],
"H": [Ionic(1,"I",0.38),Ionic(1,"II",0.18)],
"In": [Ionic(3,"IV",0.62),Ionic(3,"VI",0.8),Ionic(3,"VIII",0.92)],
"I": [Ionic(-1,"VI",2.2),Ionic(5,"IIIPY",0.44),Ionic(5,"VI",0.95),Ionic(7,"IV",0.42),Ionic(7,"VI",0.53)],
"Ir": [Ionic(3,"VI",0.68),Ionic(4,"VI",0.625),Ionic(5,"VI",0.57)],
"Fe": [Ionic(2,"IV-hs",0.63),Ionic(2,"IVSQ-hs",0.64),Ionic(2,"VI-ls",0.61),Ionic(2,"0-hs",0.78),
Ionic(2,"VIII-hs",0.92),Ionic(3,"IV-hs",0.49),Ionic(3,"V",0.58),Ionic(3,"VI-ls",0.55),
Ionic(3,"0-hs",0.645),Ionic(3,"VIII-hs",0.78),Ionic(4,"VI",0.585),Ionic(6,"IV",0.25)],
"Kr": [Ionic()],
"La": [Ionic(3,"VI",1.032),Ionic(3,"VII",1.1),Ionic(3,"VIII",1.16),Ionic(3,"IX",1.216),Ionic(3,"X",1.27),Ionic(3,"XII",1.36)],
"Lr": [Ionic()],
"Pb": [Ionic(2,"IVPY",0.98),Ionic(2,"VI",1.19),Ionic(2,"VII",1.23),Ionic(2,"VIII",1.29),Ionic(2,"IX",1.35),
Ionic(2,"X",1.4),Ionic(2,"XI",1.45),Ionic(2,"XII",1.49),Ionic(4,"IV",0.65),Ionic(4,"V",0.73),Ionic(4,"VI",0.775),
Ionic(4,"VIII",0.94)],
"Li": [Ionic(1,"IV",0.59),Ionic(1,"VI",0.76),Ionic(1,"VIII",0.92)],
"Lv": [Ionic()],
"Lu": [Ionic(3,"VI",0.861),Ionic(3,"VIII",0.977),Ionic(3,"IX",1.032)],
"Mg": [Ionic(2,"IV",0.57),Ionic(2,"V",0.66),Ionic(2,"VI",0.72),Ionic(2,"VIII",0.89)],
"Mn": [Ionic(2,"IV-hs",0.66),Ionic(2,"V-hs",0.75),Ionic(2,"VI-hs",0.83),Ionic(2,"0-ls",0.67),
Ionic(2,"VII-hs",0.9),Ionic(2,"VIII",0.96),Ionic(3,"V",0.58),Ionic(3,"VI-ls",0.58),Ionic(3,"0-hs",0.645),
Ionic(4,"IV",0.39),Ionic(4,"VI",0.53),Ionic(5,"IV",0.33),Ionic(6,"IV",0.255),Ionic(7,"IV",0.25),Ionic(7,"VI",0.46)],
"Mt": [Ionic()],
"Md": [Ionic()],
"Hg": [Ionic(1,"III",0.97),Ionic(1,"VI",1.19),Ionic(2,"II",0.69),Ionic(2,"IV",0.96),Ionic(2,"VI",1.02),Ionic(2,"VIII",1.14)],
"Mo": [Ionic(3,"VI",0.69),Ionic(4,"VI",0.65),Ionic(5,"IV",0.46),Ionic(5,"VI",0.61),Ionic(6,"IV",0.41),Ionic(6,"V",0.5),
Ionic(6,"VI",0.59),Ionic(6,"VII",0.73)],
"Mc": [Ionic()],
"Nd": [Ionic(2,"VIII",1.29),Ionic(2,"IX",1.35),Ionic(3,"VI",0.983),Ionic(3,"VIII",1.109),Ionic(3,"IX",1.163),Ionic(3,"XII",1.27)],
"Ne": [Ionic()],
"Np": [Ionic(2,"VI",1.1),Ionic(3,"VI",1.01),Ionic(4,"VI",0.87),Ionic(4,"VIII",0.98),Ionic(5,"VI",0.75),
Ionic(6,"VI",0.72),Ionic(7,"VI",0.71)],
"Ni": [Ionic(2,"IV",0.55),Ionic(2,"IVSQ",0.49),Ionic(2,"V",0.63),Ionic(2,"VI",0.69),Ionic(3,"VI-ls",0.56),
Ionic(3,"0-hs",0.6),Ionic(4,"VI-ls",0.48)],
"Nh": [Ionic()],
"Nb": [Ionic(3,"VI",0.72),Ionic(4,"VI",0.68),Ionic(4,"VIII",0.79),Ionic(5,"IV",0.48),Ionic(5,"VI",0.64),
Ionic(5,"VII",0.69),Ionic(5,"VIII",0.74)],
"N": [Ionic(-3,"IV",1.46),Ionic(3,"VI",0.16),Ionic(5,"III",0.104),Ionic(5,"VI",0.13)],
"No": [Ionic(2,"VI",1.1)],
"Og": [Ionic()],
"Os": [Ionic(4,"VI",0.63),Ionic(5,"VI",0.575),Ionic(6,"V",0.49),Ionic(6,"VI",0.545),Ionic(7,"VI",0.525),Ionic(8,"IV",0.39)],
"O": [Ionic(-2,"II",1.35),Ionic(-2,"III",1.36),Ionic(-2,"IV",1.38),Ionic(-2,"VI",1.4),Ionic(-2,"VIII",1.42)],
"Pd": [Ionic(1,"II",0.59),Ionic(2,"IVSQ",0.64),Ionic(2,"VI",0.86),Ionic(3,"VI",0.76),Ionic(4,"VI",0.615)],
"P": [Ionic(3,"VI",0.44),Ionic(5,"IV",0.17),Ionic(5,"V",0.29),Ionic(5,"VI",0.38)],
"Pt": [Ionic(2,"IVSQ",0.6),Ionic(2,"VI",0.8),Ionic(4,"VI",0.625),Ionic(5,"VI",0.57)],
"Pu": [Ionic(3,"VI",1),Ionic(4,"VI",0.86),Ionic(4,"VIII",0.96),Ionic(5,"VI",0.74),Ionic(6,"VI",0.71)],
"Po": [Ionic(4,"VI",0.94),Ionic(4,"VIII",1.08),Ionic(6,"VI",0.67)],
"K": [Ionic(1,"IV",1.37),Ionic(1,"VI",1.38),Ionic(1,"VII",1.46),Ionic(1,"VIII",1.51),Ionic(1,"IX",1.55),
Ionic(1,"X",1.59),Ionic(1,"XII",1.64)],
"Pr": [Ionic(3,"VI",0.99),Ionic(3,"VIII",1.126),Ionic(3,"IX",1.179),Ionic(4,"VI",0.85),Ionic(4,"VIII",0.96)],
"Pm": [Ionic(3,"VI",0.97),Ionic(3,"VIII",1.093),Ionic(3,"IX",1.144)],
"Pa": [Ionic(3,"VI",1.04),Ionic(4,"VI",0.9),Ionic(4,"VIII",1.01),Ionic(5,"VI",0.78),Ionic(5,"VIII",0.91),Ionic(5,"IX",0.95)],
"Ra": [Ionic(2,"VIII",1.48),Ionic(2,"XII",1.7)],
"Rn": [Ionic()],
"Re": [Ionic(4,"VI",0.63),Ionic(5,"VI",0.58),Ionic(6,"VI",0.55),Ionic(7,"IV",0.38),Ionic(7,"VI",0.53)],
"Rh": [Ionic(3,"VI",0.665),Ionic(4,"VI",0.6),Ionic(5,"VI",0.55)],
"Rg": [Ionic()],
"Rb": [Ionic(1,"VI",1.52),Ionic(1,"VII",1.56),Ionic(1,"VIII",1.61),Ionic(1,"IX",1.63),Ionic(1,"X",1.66),
Ionic(1,"XI",1.69),Ionic(1,"XII",1.72),Ionic(1,"XIV",1.83)],
"Ru": [Ionic(3,"VI",0.68),Ionic(4,"VI",0.62),Ionic(5,"VI",0.565),Ionic(7,"IV",0.38),Ionic(8,"IV",0.36)],
"Rf": [Ionic()],
"Sm": [Ionic(2,"VII",1.22),Ionic(2,"VIII",1.27),Ionic(2,"IX",1.32),Ionic(3,"VI",0.958),Ionic(3,"VII",1.02),
Ionic(3,"VIII",1.079),Ionic(3,"IX",1.132),Ionic(3,"XII",1.24)],
"Sc": [Ionic(3,"VI",0.745),Ionic(3,"VIII",0.87)],
"Sg": [Ionic()],
"Se": [Ionic(-2,"VI",1.98),Ionic(4,"VI",0.5),Ionic(6,"IV",0.28),Ionic(6,"VI",0.42)],
"Si": [Ionic(4,"IV",0.26),Ionic(4,"VI",0.4)],
"Ag": [Ionic(1,"II",0.67),Ionic(1,"IV",1),Ionic(1,"IVSQ",1.02),Ionic(1,"V",1.09),Ionic(1,"VI",1.15),Ionic(1,"VII",1.22),
Ionic(1,"VIII",1.28),Ionic(2,"IVSQ",0.79),Ionic(2,"VI",0.94),Ionic(3,"IVSQ",0.67),Ionic(3,"VI",0.75)],
"Na": [Ionic(1,"IV",0.99),Ionic(1,"V",1),Ionic(1,"VI",1.02),Ionic(1,"VII",1.12),Ionic(1,"VIII",1.18),Ionic(1,"IX",1.24),
Ionic(1,"XII",1.39)],
"Sr": [Ionic(2,"VI",1.18),Ionic(2,"VII",1.21),Ionic(2,"VIII",1.26),Ionic(2,"IX",1.31),Ionic(2,"X",1.36),Ionic(2,"XII",1.44)],
"S": [Ionic(-2,"VI",1.84),Ionic(4,"VI",0.37),Ionic(6,"IV",0.12),Ionic(6,"VI",0.29)],
"Ta": [Ionic(3,"VI",0.72),Ionic(4,"VI",0.68),Ionic(5,"VI",0.64),Ionic(5,"VII",0.69),Ionic(5,"VIII",0.74)],
"Tc": [Ionic(4,"VI",0.645),Ionic(5,"VI",0.6),Ionic(7,"IV",0.37),Ionic(7,"VI",0.56)],
"Te": [Ionic(-2,"VI",2.21),Ionic(4,"III",0.52),Ionic(4,"IV",0.66),Ionic(4,"VI",0.97),Ionic(6,"IV",0.43),Ionic(6,"VI",0.56)],
"Ts": [Ionic()],
"Tb": [Ionic(3,"VI",0.923),Ionic(3,"VII",0.98),Ionic(3,"VIII",1.04),Ionic(3,"IX",1.095),Ionic(4,"VI",0.76),Ionic(4,"VIII",0.88)],
"Tl": [Ionic(1,"VI",1.5),Ionic(1,"VIII",1.59),Ionic(1,"XII",1.7),Ionic(3,"IV",0.75),Ionic(3,"VI",0.885),Ionic(3,"VIII",0.98)],
"Th": [Ionic(4,"VI",0.94),Ionic(4,"VIII",1.05),Ionic(4,"IX",1.09),Ionic(4,"X",1.13),Ionic(4,"XI",1.18),Ionic(4,"XII",1.21)],
"Tm": [Ionic(2,"VI",1.03),Ionic(2,"VII",1.09),Ionic(3,"VI",0.88),Ionic(3,"VIII",0.994),Ionic(3,"IX",1.052)],
"Sn": [Ionic(4,"IV",0.55),Ionic(4,"V",0.62),Ionic(4,"VI",0.69),Ionic(4,"VII",0.75),Ionic(4,"VIII",0.81)],
"Ti": [Ionic(2,"VI",0.86),Ionic(3,"VI",0.67),Ionic(4,"IV",0.42),Ionic(4,"V",0.51),Ionic(4,"VI",0.605),Ionic(4,"VIII",0.74)],
"W": [Ionic(4,"VI",0.66),Ionic(5,"VI",0.62),Ionic(6,"IV",0.42),Ionic(6,"V",0.51),Ionic(6,"VI",0.6)],
"U": [Ionic(3,"VI",1.025),Ionic(4,"VI",0.89),Ionic(4,"VII",0.95),Ionic(4,"VIII",1),Ionic(4,"IX",1.05),Ionic(4,"XII",1.17),
Ionic(5,"VI",0.76),Ionic(5,"VII",0.84),Ionic(6,"II",0.45),Ionic(6,"IV",0.52),Ionic(6,"VI",0.73),Ionic(6,"VII",0.81),
Ionic(6,"VIII",0.86)],
"V": [Ionic(2,"VI",0.79),Ionic(3,"VI",0.64),Ionic(4,"V",0.53),Ionic(4,"VI",0.58),Ionic(4,"VIII",0.72),Ionic(5,"IV",0.355),
Ionic(5,"V",0.46),Ionic(5,"VI",0.54)],
"Xe": [Ionic(8,"IV",0.4),Ionic(8,"VI",0.48)],
"Yb": [Ionic(2,"VI",1.02),Ionic(2,"VII",1.08),Ionic(2,"VIII",1.14),Ionic(3,"VI",0.868),Ionic(3,"VII",0.925),Ionic(3,"VIII",0.985),
Ionic(3,"IX",1.042)],
"Y": [Ionic(3,"VI",0.9),Ionic(3,"VII",0.96),Ionic(3,"VIII",1.019),Ionic(3,"IX",1.075)],
"Zn": [Ionic(2,"IV",0.6),Ionic(2,"V",0.68),Ionic(2,"VI",0.74),Ionic(2,"VIII",0.9)],
"Zr": [Ionic(4,"IV",0.59),Ionic(4,"V",0.66),Ionic(4,"VI",0.72),Ionic(4,"VII",0.78),Ionic(4,"VIII",0.84),Ionic(4,"IX",0.89)],
}
# Atom data: radii measured in Angstroms, taken from the reference below:
# "Atomic Radii of the Elements," in CRC Handbook of Chemistry and Physics, 101st Edition
# (Internet Version 2020), John R. Rumble, ed., CRC Press/Taylor & Francis, Boca Raton, FL
# Elements arranged alphabetically, except for 'Dummy' which is a placeholder for non-elements
Dummy = Atom_Data(radius=0.01, color=(1.0, 0.65, 1.0, 1))
Actinium = Atom_Data(2.01, 2.47, ionicData=IonicRadii["Ac"])
Aluminum = Atom_Data(1.24, 1.84, ionicData=IonicRadii["Al"])
Americium = Atom_Data(1.73, 2.44, ionicData=IonicRadii["Am"])
Antimony = Atom_Data(1.40, 2.06, ionicData=IonicRadii["Sb"])
Argon = Atom_Data(1.01, 1.88, ionicData=IonicRadii["Ar"])
Arsenic = Atom_Data(1.20, 1.85, ionicData=IonicRadii["As"])
Astatine = Atom_Data(1.48, 2.02, (0.99, 0.28, 0.11, 1), ionicData=IonicRadii["At"])
Barium = Atom_Data(2.06, 2.68, ionicData=IonicRadii["Ba"])
Berkelium = Atom_Data(1.68, 2.44, ionicData=IonicRadii["Bk"])
Beryllium = Atom_Data(0.99, 1.53, (0.13, 0.96, 0.55, 1), ionicData=IonicRadii["Be"])
Bismuth = Atom_Data(1.50, 2.07, (0.53, 0.84, 0.55, 1), ionicData=IonicRadii["Bi"])
Bohrium = Atom_Data(1.41, ionicData=IonicRadii["Bh"])
Boron = Atom_Data(0.84, 1.92, (1.00, 0.70, 0.70, 1), ionicData=IonicRadii["B"])
Bromine = Atom_Data(1.17, 1.85, (0.76, 0.00, 0.14, 1), ionicData=IonicRadii["Br"])
Cadmium = Atom_Data(1.40, 2.18, ionicData=IonicRadii["Cd"])
Calcium = Atom_Data(1.74, 2.31, (0.94, 0.00, 0.36, 1), ionicData=IonicRadii["Ca"])
Californium = Atom_Data(1.68, 2.45, ionicData=IonicRadii["Cf"])
Carbon = Atom_Data(0.75, 1.70, (0.10, 0.10, 0.10, 1), ionicData=IonicRadii["Ac"])
Cerium = Atom_Data(1.84, 2.42, ionicData=IonicRadii["Ce"])
Cesium = Atom_Data(2.38, 3.43, ionicData=IonicRadii["Cs"])
Chlorine = Atom_Data(1.00, 1.75, (0.00, 0.94, 0.26, 1), ionicData=IonicRadii["Cl"])
Chromium = Atom_Data(1.30, 2.06, ionicData=IonicRadii["Cr"])
Cobalt = Atom_Data(1.18, 2.00, (0.00, 0.39, 0.94, 1), ionicData=IonicRadii["Co"])
Copernicium = Atom_Data(1.22, ionicData=IonicRadii["Cn"])
Copper = Atom_Data(1.22, 1.96, (0.00, 0.94, 0.75, 1), ionicData=IonicRadii["Cu"])
Curium = Atom_Data(1.68, 2.45, ionicData=IonicRadii["Cm"])
Darmstadtium = Atom_Data(1.28, ionicData=IonicRadii["Ds"])
Dubnium = Atom_Data(1.49, ionicData=IonicRadii["Db"])
Dysprosium = Atom_Data(1.80, 2.31, ionicData=IonicRadii["Dy"])
Einsteinium = Atom_Data(1.65, 2.45, ionicData=IonicRadii["Es"])
Erbium = Atom_Data(1.77, 2.29, ionicData=IonicRadii["Er"])
Europium = Atom_Data(1.83, 2.35, (1.00, 0.18, 0.39, 1), ionicData=IonicRadii["Eu"])
Fermium = Atom_Data(1.67, 2.45, ionicData=IonicRadii["Fm"])
Flerovium = Atom_Data(1.43, ionicData=IonicRadii["Fl"])
Fluorine = Atom_Data(0.60, 1.47, (0.00, 0.90, 0.00, 1), ionicData=IonicRadii["F"])
Francium = Atom_Data(2.42, 3.48, ionicData=IonicRadii["Fr"])
Gadolinium = Atom_Data(1.82, 2.34, ionicData=IonicRadii["Gd"])
Gallium = Atom_Data(1.23, 1.87, ionicData=IonicRadii["Ga"])
Germanium = Atom_Data(1.20, 2.11, ionicData=IonicRadii["Ge"])
Gold = Atom_Data(1.30, 2.14, (0.99, 0.95, 0.11, 1), ionicData=IonicRadii["Au"])
Hafnium = Atom_Data(1.64, 2.23, ionicData=IonicRadii["Hf"])
Hassium = Atom_Data(1.34, ionicData=IonicRadii["Hs"])
Helium = Atom_Data(0.37, 1.40, ionicData=IonicRadii["He"])
Holmium = Atom_Data(1.79, 2.30, ionicData=IonicRadii["Ho"])
Hydrogen = Atom_Data(0.32, 1.10, (0.80, 0.80, 0.80, 1), ionicData=IonicRadii["H"])
Indium = Atom_Data(1.42, 1.93, ionicData=IonicRadii["In"])
Iodine = Atom_Data(1.36, 1.98, (0.49, 0.03, 0.73, 1), ionicData=IonicRadii["I"])
Iridium = Atom_Data(1.32, 2.13, ionicData=IonicRadii["Ir"])
Iron = Atom_Data(1.24, 2.04, (0.47, 0.05, 0.13, 1), ionicData=IonicRadii["Fe"])
Krypton = Atom_Data(1.16, 2.02, ionicData=IonicRadii["Kr"])
Lanthanum = Atom_Data(1.94, 2.43, ionicData=IonicRadii["La"])
Lawrencium = Atom_Data(1.61, 2.46, ionicData=IonicRadii["Lr"])
Lead = Atom_Data(1.45, 2.02, (0.06, 0.06, 0.06, 1), ionicData=IonicRadii["Pb"])
Lithium = Atom_Data(1.30, 1.82, (0.96, 0.13, 0.76, 1), ionicData=IonicRadii["Li"])
Livermorium = Atom_Data(1.75, ionicData=IonicRadii["Lv"])
Lutetium = Atom_Data(1.74, 2.24, ionicData=IonicRadii["Lu"])
Magnesium = Atom_Data(1.40, 1.73, (0.90, 0.90, 0.90, 1), ionicData=IonicRadii["Mg"])
Manganese = Atom_Data(1.29, 2.05, (0.94, 0.00, 0.80, 1), ionicData=IonicRadii["Mn"])
Meitnerium = Atom_Data(1.29, ionicData=IonicRadii["Mt"])
Mendelevium = Atom_Data(1.73, 2.46, ionicData=IonicRadii["Md"])
Mercury = Atom_Data(1.32, 2.23, ionicData=IonicRadii["Hg"])
Molybdenum = Atom_Data(1.46, 2.17, ionicData=IonicRadii["Mo"])
Moscovium = Atom_Data(1.62, ionicData=IonicRadii["Mc"])
Neodymium = Atom_Data(1.88, 2.39, ionicData=IonicRadii["Nd"])
Neon = Atom_Data(0.62, 1.54, ionicData=IonicRadii["Ne"])
Neptunium = Atom_Data(1.80, 2.39, ionicData=IonicRadii["Np"])
Nickel = Atom_Data(1.17, 1.97, ionicData=IonicRadii["Ni"])
Nihonium = Atom_Data(1.36, ionicData=IonicRadii["Nh"])
Niobium = Atom_Data(1.56, 2.18, ionicData=IonicRadii["Nb"])
Nitrogen = Atom_Data(0.71, 1.55, (0.00, 0.00, 0.90, 1), ionicData=IonicRadii["N"])
Nobelium = Atom_Data(1.76, 2.46, ionicData=IonicRadii["No"])
Oganesson = Atom_Data(1.57, ionicData=IonicRadii["Og"])
Osmium = Atom_Data(1.36, 2.16, ionicData=IonicRadii["Os"])
Oxygen = Atom_Data(0.64, 1.52, (0.90, 0.00, 0.00 ,1), ionicData=IonicRadii["O"])
Palladium = Atom_Data(1.30, 2.10, ionicData=IonicRadii["Pd"])
Phosphorus = Atom_Data(1.09, 1.80, (0.85, 0.00, 0.95, 1), ionicData=IonicRadii["P"])
Platinum = Atom_Data(1.30, 2.13, ionicData=IonicRadii["Pt"])
Plutonium = Atom_Data(1.80, 2.43, (1.00, 0.80, 0.00, 1), ionicData=IonicRadii["Pu"])
Polonium = Atom_Data(1.42, 1.97, (0.53, 1.00, 0.32, 1), ionicData=IonicRadii["Po"])
Potassium = Atom_Data(2.00, 2.75, (0.60, 0.00, 0.94, 1), ionicData=IonicRadii["K"])
Praseodymium = Atom_Data(1.90, 2.40, ionicData=IonicRadii["Pr"])
Promethium = Atom_Data(1.86, 2.38, ionicData=IonicRadii["Pm"])
Protactinium = Atom_Data(1.84, 2.43, ionicData=IonicRadii["Pa"])
Radium = Atom_Data(2.11, 2.83, ionicData=IonicRadii["Ra"])
Radon = Atom_Data(1.46, 2.20, (0.57, 0.99, 0.10, 1), ionicData=IonicRadii["Rn"])
Rhenium = Atom_Data(1.41, ionicData=IonicRadii["Re"])
Rhodium = Atom_Data(1.34, 2.10, ionicData=IonicRadii["Rh"])
Roentgenium = Atom_Data(1.21, ionicData=IonicRadii["Rg"])
Rubidium = Atom_Data(2.15, 3.03, ionicData=IonicRadii["Rb"])
Ruthenium = Atom_Data(1.36, 2.13, ionicData=IonicRadii["Ru"])
Rutherfordium = Atom_Data(1.57, ionicData=IonicRadii["Rf"])
Samarium = Atom_Data(1.85, 2.36, ionicData=IonicRadii["Sm"])
Scandium = Atom_Data(1.59, 2.15, (0.94, 0.70, 0.00, 1), ionicData=IonicRadii["Sc"])
Seaborgium = Atom_Data(1.43, ionicData=IonicRadii["Sg"])
Selenium = Atom_Data(1.18, 1.90, ionicData=IonicRadii["Se"])
Silicon = Atom_Data(1.14, 2.10, (0.95, 1.00, 0.48, 1), ionicData=IonicRadii["Si"])
Silver = Atom_Data(1.36, 2.11, (0.83, 0.83, 0.83, 1), ionicData=IonicRadii["Ag"])
Sodium = Atom_Data(1.60, 2.27, (0.00, 0.50, 0.76, 1), ionicData=IonicRadii["Na"])
Strontium = Atom_Data(1.90, 2.49, ionicData=IonicRadii["Sr"])
Sulfur = Atom_Data(1.04, 1.80, (0.94, 0.94, 0.00, 1), ionicData=IonicRadii["S"])
Tantalum = Atom_Data(1.58, 2.22, ionicData=IonicRadii["Ta"])
Technetium = Atom_Data(1.38, 2.16, ionicData=IonicRadii["Tc"])
Tellurium = Atom_Data(1.37, 2.06, ionicData=IonicRadii["Te"])
Tennessine = Atom_Data(1.65, ionicData=IonicRadii["Ts"])
Terbium = Atom_Data(1.81, 2.33, ionicData=IonicRadii["Tb"])
Thallium = Atom_Data(1.44, 1.96, ionicData=IonicRadii["Tl"])
Thorium = Atom_Data(1.90, 2.45, ionicData=IonicRadii["Th"])
Thulium = Atom_Data(1.77, 2.27, ionicData=IonicRadii["Tm"])
Tin = Atom_Data(1.40, 2.17, ionicData=IonicRadii["Sn"])
Titanium = Atom_Data(1.48, 2.11, ionicData=IonicRadii["Ti"])
Tungsten = Atom_Data(1.50, 2.18, ionicData=IonicRadii["W"])
Uranium = Atom_Data(1.83, 2.41, (0.53, 1.00, 0.32, 1), ionicData=IonicRadii["U"])
Vanadium = Atom_Data(1.44, 2.07, ionicData=IonicRadii["V"])
Xenon = Atom_Data(1.36, 2.16, ionicData=IonicRadii["Xe"])
Ytterbium = Atom_Data(1.78, 2.26, ionicData=IonicRadii["Yb"])
Yttrium = Atom_Data(1.76, 2.32, ionicData=IonicRadii["Y"])
Zinc = Atom_Data(1.20, 2.01, ionicData=IonicRadii["Zn"])
Zirconium = Atom_Data(1.64, 2.23, ionicData=IonicRadii["Zr"])
Elements = { #element symbols, their covalent radii & their RGBA color values
"Xx": Dummy,
"Ac": Actinium,
"Al": Aluminum,
"Am": Americium,
"Sb": Antimony,
"Ar": Argon,
"As": Arsenic,
"At": Astatine,
"Ba": Barium,
"Bk": Berkelium,
"Be": Beryllium,
"Bi": Bismuth,
"Bh": Bohrium,
"B": Boron,
"Br": Bromine,
"Cd": Cadmium,
"Ca": Calcium,
"Cf": Californium,
"C": Carbon,
"Ce": Cerium,
"Cs": Cesium,
"Cl": Chlorine,
"Cr": Chromium,
"Co": Cobalt,
"Cn": Copernicium,
"Cu": Copper,
"Cm": Curium,
"Ds": Darmstadtium,
"Db": Dubnium,
"Dy": Dysprosium,
"Es": Einsteinium,
"Er": Erbium,
"Eu": Europium,
"Fm": Fermium,
"Fl": Flerovium,
"F": Fluorine,
"Fr": Francium,
"Gd": Gadolinium,
"Ga": Gallium,
"Ge": Germanium,
"Au": Gold,
"Hf": Hafnium,
"Hs": Hassium,
"He": Helium,
"Ho": Holmium,
"H": Hydrogen,
"In": Indium,
"I": Iodine,
"Ir": Iridium,
"Fe": Iron,
"Kr": Krypton,
"La": Lanthanum,
"Lr": Lawrencium,
"Pb": Lead,
"Li": Lithium,
"Lv": Livermorium,
"Lu": Lutetium,
"Mg": Magnesium,
"Mn": Manganese,
"Mt": Meitnerium,
"Md": Mendelevium,
"Hg": Mercury,
"Mo": Molybdenum,
"Mc": Moscovium,
"Nd": Neodymium,
"Ne": Neon,
"Np": Neptunium,
"Ni": Nickel,
"Nh": Nihonium,
"Nb": Niobium,
"N": Nitrogen,
"No": Nobelium,
"Og": Oganesson,
"Os": Osmium,
"O": Oxygen,
"Pd": Palladium,
"P": Phosphorus,
"Pt": Platinum,
"Pu": Plutonium,
"Po": Polonium,
"K": Potassium,
"Pr": Praseodymium,
"Pm": Promethium,
"Pa": Protactinium,
"Ra": Radium,
"Rn": Radon,
"Re": Rhenium,
"Rh": Rhodium,
"Rg": Roentgenium,
"Rb": Rubidium,
"Ru": Ruthenium,
"Rf": Rutherfordium,
"Sm": Samarium,
"Sc": Scandium,
"Sg": Seaborgium,
"Se": Selenium,
"Si": Silicon,
"Ag": Silver,
"Na": Sodium,
"Sr": Strontium,
"S": Sulfur,
"Ta": Tantalum,
"Tc": Technetium,
"Te": Tellurium,
"Ts": Tennessine,
"Tb": Terbium,
"Tl": Thallium,
"Th": Thorium,
"Tm": Thulium,
"Sn": Tin,
"Ti": Titanium,
"W": Tungsten,
"U": Uranium,
"V": Vanadium,
"Xe": Xenon,
"Yb": Ytterbium,
"Y": Yttrium,
"Zn": Zinc,
"Zr": Zirconium,
} | class Ionic:
"""Ionic radius class. Stores: charge, spin, coordination"""
def __init__(self, charge=0, coordination='', radius=0.0):
self.charge = charge
self.coordination = coordination
self.radius = radius
def set_radius(self, value: float):
self.radius = value
class Atom_Data:
"""Atom data class. Stores Radius: covalent; Color: tuple, RGBA values"""
def __init__(self, radius: float, vanDerWaals=0.0, color=(0.5, 0.5, 0.5, 1), ionicData=[ionic()]):
self.radius = radius
self.vanDerWaals = vanDerWaals
self.color = color
self.ionicData = ionicData
def get_radius(self):
"""
returns: <float> atom's covalent radius
"""
return self.radius
def get_color(self):
"""
returns: <tuple size 4> rgba values for color
"""
return self.color
def get_van_der_waals(self):
"""
returns: vanDerWaals radius for element.
"""
return self.vanDerWaals
def get_ionic_data(self):
return self.ionicData
ionic_radii = {'Ac': [ionic(3, 'VI', 1.12)], 'Al': [ionic(3, 'IV', 0.39), ionic(3, 'V', 0.48), ionic(3, 'VI', 0.535)], 'Am': [ionic(2, 'VII', 1.21), ionic(2, 'VIII', 1.26), ionic(2, 'IX', 1.31), ionic(3, 'VI', 0.975), ionic(3, 'VIII', 1.09), ionic(4, 'VI', 0.85), ionic(4, 'VIII', 0.95)], 'Sb': [ionic(3, 'IVPY', 0.76), ionic(3, 'V', 0.8), ionic(3, 'VI', 0.76), ionic(5, 'VI', 0.6)], 'Ar': [ionic()], 'As': [ionic(3, 'VI', 0.58), ionic(5, 'IV', 0.335), ionic(5, 'VI', 0.46)], 'At': [ionic(7, 'VI', 0.62)], 'Ba': [ionic(2, 'VI', 1.35), ionic(2, 'VII', 1.38), ionic(2, 'VIII', 1.42), ionic(2, 'IX', 1.47), ionic(2, 'X', 1.52), ionic(2, 'XI', 1.57), ionic(2, 'XII', 1.61)], 'Bk': [ionic(3, 'VI', 0.96), ionic(4, 'VI', 0.83), ionic(4, 'VIII', 0.93)], 'Be': [ionic(2, 'III', 0.16), ionic(2, 'IV', 0.27), ionic(2, 'VI', 0.45)], 'Bi': [ionic(3, 'V', 0.96), ionic(3, 'VI', 1.03), ionic(3, 'VIII', 1.17), ionic(5, 'VI', 0.76)], 'Bh': [ionic()], 'B': [ionic(3, 'III', 0.01), ionic(3, 'IV', 0.11), ionic(3, 'VI', 0.27)], 'Br': [ionic(-1, 'VI', 1.96), ionic(3, 'IVSQ', 0.59), ionic(5, 'IIIPY', 0.31), ionic(7, 'IV', 0.25), ionic(7, 'VI', 0.39)], 'Cd': [ionic(2, 'IV', 0.78), ionic(2, 'V', 0.87), ionic(2, 'VI', 0.95), ionic(2, 'VII', 1.03), ionic(2, 'VIII', 1.1), ionic(2, 'XII', 1.31)], 'Ca': [ionic(2, 'VI', 1), ionic(2, 'VII', 1.06), ionic(2, 'VIII', 1.12), ionic(2, 'IX', 1.18), ionic(2, 'X', 1.23), ionic(2, 'XII', 1.34)], 'Cf': [ionic(3, 'VI', 0.95), ionic(4, 'VI', 0.821), ionic(4, 'VIII', 0.92)], 'C': [ionic(4, 'III', 0.08), ionic(4, 'IV', 0.15), ionic(4, 'VI', 0.16)], 'Ce': [ionic(3, 'VI', 1.01), ionic(3, 'VII', 1.07), ionic(3, 'VIII', 1.143), ionic(3, 'IX', 1.196), ionic(3, 'X', 1.25), ionic(3, 'XII', 1.34), ionic(4, 'VI', 0.87), ionic(4, 'VIII', 0.97), ionic(4, 'X', 1.07), ionic(4, 'XII', 1.14)], 'Cs': [ionic(1, 'VI', 1.67), ionic(1, 'VIII', 1.74), ionic(1, 'IX', 1.78), ionic(1, 'X', 1.81), ionic(1, 'XI', 1.85), ionic(1, 'XII', 1.88)], 'Cl': [ionic(-1, 'VI', 1.81), ionic(5, 'IIIPY', 0.12), ionic(7, 'IV', 0.08), ionic(7, 'VI', 0.27)], 'Cr': [ionic(2, 'VI-ls', 0.73), ionic(2, '0-hs', 0.8), ionic(3, 'VI', 0.615), ionic(4, 'IV', 0.41), ionic(4, 'VI', 0.55), ionic(5, 'IV', 0.345), ionic(5, 'VI', 0.49), ionic(5, 'VIII', 0.57), ionic(6, 'IV', 0.26), ionic(6, 'VI', 0.44)], 'Co': [ionic(2, 'IV-hs', 0.58), ionic(2, 'V', 0.67), ionic(2, 'VI-ls', 0.65), ionic(2, '0-hs', 0.745), ionic(2, 'VIII', 0.9), ionic(3, 'VI-ls', 0.545), ionic(3, '0-hs', 0.61), ionic(4, 'IV', 0.4), ionic(4, 'VI-hs', 0.53)], 'Cn': [ionic()], 'Cu': [ionic(1, 'II', 0.46), ionic(1, 'IV', 0.6), ionic(1, 'VI', 0.77), ionic(2, 'IV', 0.57), ionic(2, 'IVSQ', 0.57), ionic(2, 'V', 0.65), ionic(2, 'VI', 0.73), ionic(3, 'VI-ls', 0.54)], 'Cm': [ionic(3, 'VI', 0.97), ionic(4, 'VI', 0.85), ionic(4, 'VIII', 0.95)], 'Ds': [ionic()], 'Db': [ionic()], 'Dy': [ionic(2, 'VI', 1.07), ionic(2, 'VII', 1.13), ionic(2, 'VIII', 1.19), ionic(3, 'VI', 0.912), ionic(3, 'VII', 0.97), ionic(3, 'VIII', 1.027), ionic(3, 'IX', 1.083)], 'Es': [ionic()], 'Er': [ionic(3, 'VI', 0.89), ionic(3, 'VII', 0.945), ionic(3, 'VIII', 1.004), ionic(3, 'IX', 1.062)], 'Eu': [ionic(2, 'VI', 1.17), ionic(2, 'VII', 1.2), ionic(2, 'VIII', 1.25), ionic(2, 'IX', 1.3), ionic(2, 'X', 1.35), ionic(3, 'VI', 0.947), ionic(3, 'VII', 1.01), ionic(3, 'VIII', 1.066), ionic(3, 'IX', 1.12)], 'Fm': [ionic()], 'Fl': [ionic()], 'F': [ionic(-1, 'II', 1.285), ionic(-1, 'III', 1.3), ionic(-1, 'IV', 1.31), ionic(-1, 'VI', 1.33), ionic(7, 'VI', 0.08)], 'Fr': [ionic(1, 'VI', 1.8)], 'Gd': [ionic(3, 'VI', 0.938), ionic(3, 'VII', 1), ionic(3, 'VIII', 1.053), ionic(3, 'IX', 1.107)], 'Ga': [ionic(3, 'IV', 0.47), ionic(3, 'V', 0.55), ionic(3, 'VI', 0.62)], 'Ge': [ionic(2, 'VI', 0.73), ionic(4, 'IV', 0.39), ionic(4, 'VI', 0.53)], 'Au': [ionic(1, 'VI', 1.37), ionic(3, 'IVSQ', 0.68), ionic(3, 'VI', 0.85), ionic(5, 'VI', 0.57)], 'Hf': [ionic(4, 'IV', 0.58), ionic(4, 'VI', 0.71), ionic(4, 'VII', 0.76), ionic(4, 'VIII', 0.83)], 'Hs': [ionic()], 'He': [ionic()], 'Ho': [ionic(3, 'VI', 0.901), ionic(3, 'VIII', 1.015), ionic(3, 'IX', 1.072), ionic(3, 'X', 1.12)], 'H': [ionic(1, 'I', 0.38), ionic(1, 'II', 0.18)], 'In': [ionic(3, 'IV', 0.62), ionic(3, 'VI', 0.8), ionic(3, 'VIII', 0.92)], 'I': [ionic(-1, 'VI', 2.2), ionic(5, 'IIIPY', 0.44), ionic(5, 'VI', 0.95), ionic(7, 'IV', 0.42), ionic(7, 'VI', 0.53)], 'Ir': [ionic(3, 'VI', 0.68), ionic(4, 'VI', 0.625), ionic(5, 'VI', 0.57)], 'Fe': [ionic(2, 'IV-hs', 0.63), ionic(2, 'IVSQ-hs', 0.64), ionic(2, 'VI-ls', 0.61), ionic(2, '0-hs', 0.78), ionic(2, 'VIII-hs', 0.92), ionic(3, 'IV-hs', 0.49), ionic(3, 'V', 0.58), ionic(3, 'VI-ls', 0.55), ionic(3, '0-hs', 0.645), ionic(3, 'VIII-hs', 0.78), ionic(4, 'VI', 0.585), ionic(6, 'IV', 0.25)], 'Kr': [ionic()], 'La': [ionic(3, 'VI', 1.032), ionic(3, 'VII', 1.1), ionic(3, 'VIII', 1.16), ionic(3, 'IX', 1.216), ionic(3, 'X', 1.27), ionic(3, 'XII', 1.36)], 'Lr': [ionic()], 'Pb': [ionic(2, 'IVPY', 0.98), ionic(2, 'VI', 1.19), ionic(2, 'VII', 1.23), ionic(2, 'VIII', 1.29), ionic(2, 'IX', 1.35), ionic(2, 'X', 1.4), ionic(2, 'XI', 1.45), ionic(2, 'XII', 1.49), ionic(4, 'IV', 0.65), ionic(4, 'V', 0.73), ionic(4, 'VI', 0.775), ionic(4, 'VIII', 0.94)], 'Li': [ionic(1, 'IV', 0.59), ionic(1, 'VI', 0.76), ionic(1, 'VIII', 0.92)], 'Lv': [ionic()], 'Lu': [ionic(3, 'VI', 0.861), ionic(3, 'VIII', 0.977), ionic(3, 'IX', 1.032)], 'Mg': [ionic(2, 'IV', 0.57), ionic(2, 'V', 0.66), ionic(2, 'VI', 0.72), ionic(2, 'VIII', 0.89)], 'Mn': [ionic(2, 'IV-hs', 0.66), ionic(2, 'V-hs', 0.75), ionic(2, 'VI-hs', 0.83), ionic(2, '0-ls', 0.67), ionic(2, 'VII-hs', 0.9), ionic(2, 'VIII', 0.96), ionic(3, 'V', 0.58), ionic(3, 'VI-ls', 0.58), ionic(3, '0-hs', 0.645), ionic(4, 'IV', 0.39), ionic(4, 'VI', 0.53), ionic(5, 'IV', 0.33), ionic(6, 'IV', 0.255), ionic(7, 'IV', 0.25), ionic(7, 'VI', 0.46)], 'Mt': [ionic()], 'Md': [ionic()], 'Hg': [ionic(1, 'III', 0.97), ionic(1, 'VI', 1.19), ionic(2, 'II', 0.69), ionic(2, 'IV', 0.96), ionic(2, 'VI', 1.02), ionic(2, 'VIII', 1.14)], 'Mo': [ionic(3, 'VI', 0.69), ionic(4, 'VI', 0.65), ionic(5, 'IV', 0.46), ionic(5, 'VI', 0.61), ionic(6, 'IV', 0.41), ionic(6, 'V', 0.5), ionic(6, 'VI', 0.59), ionic(6, 'VII', 0.73)], 'Mc': [ionic()], 'Nd': [ionic(2, 'VIII', 1.29), ionic(2, 'IX', 1.35), ionic(3, 'VI', 0.983), ionic(3, 'VIII', 1.109), ionic(3, 'IX', 1.163), ionic(3, 'XII', 1.27)], 'Ne': [ionic()], 'Np': [ionic(2, 'VI', 1.1), ionic(3, 'VI', 1.01), ionic(4, 'VI', 0.87), ionic(4, 'VIII', 0.98), ionic(5, 'VI', 0.75), ionic(6, 'VI', 0.72), ionic(7, 'VI', 0.71)], 'Ni': [ionic(2, 'IV', 0.55), ionic(2, 'IVSQ', 0.49), ionic(2, 'V', 0.63), ionic(2, 'VI', 0.69), ionic(3, 'VI-ls', 0.56), ionic(3, '0-hs', 0.6), ionic(4, 'VI-ls', 0.48)], 'Nh': [ionic()], 'Nb': [ionic(3, 'VI', 0.72), ionic(4, 'VI', 0.68), ionic(4, 'VIII', 0.79), ionic(5, 'IV', 0.48), ionic(5, 'VI', 0.64), ionic(5, 'VII', 0.69), ionic(5, 'VIII', 0.74)], 'N': [ionic(-3, 'IV', 1.46), ionic(3, 'VI', 0.16), ionic(5, 'III', 0.104), ionic(5, 'VI', 0.13)], 'No': [ionic(2, 'VI', 1.1)], 'Og': [ionic()], 'Os': [ionic(4, 'VI', 0.63), ionic(5, 'VI', 0.575), ionic(6, 'V', 0.49), ionic(6, 'VI', 0.545), ionic(7, 'VI', 0.525), ionic(8, 'IV', 0.39)], 'O': [ionic(-2, 'II', 1.35), ionic(-2, 'III', 1.36), ionic(-2, 'IV', 1.38), ionic(-2, 'VI', 1.4), ionic(-2, 'VIII', 1.42)], 'Pd': [ionic(1, 'II', 0.59), ionic(2, 'IVSQ', 0.64), ionic(2, 'VI', 0.86), ionic(3, 'VI', 0.76), ionic(4, 'VI', 0.615)], 'P': [ionic(3, 'VI', 0.44), ionic(5, 'IV', 0.17), ionic(5, 'V', 0.29), ionic(5, 'VI', 0.38)], 'Pt': [ionic(2, 'IVSQ', 0.6), ionic(2, 'VI', 0.8), ionic(4, 'VI', 0.625), ionic(5, 'VI', 0.57)], 'Pu': [ionic(3, 'VI', 1), ionic(4, 'VI', 0.86), ionic(4, 'VIII', 0.96), ionic(5, 'VI', 0.74), ionic(6, 'VI', 0.71)], 'Po': [ionic(4, 'VI', 0.94), ionic(4, 'VIII', 1.08), ionic(6, 'VI', 0.67)], 'K': [ionic(1, 'IV', 1.37), ionic(1, 'VI', 1.38), ionic(1, 'VII', 1.46), ionic(1, 'VIII', 1.51), ionic(1, 'IX', 1.55), ionic(1, 'X', 1.59), ionic(1, 'XII', 1.64)], 'Pr': [ionic(3, 'VI', 0.99), ionic(3, 'VIII', 1.126), ionic(3, 'IX', 1.179), ionic(4, 'VI', 0.85), ionic(4, 'VIII', 0.96)], 'Pm': [ionic(3, 'VI', 0.97), ionic(3, 'VIII', 1.093), ionic(3, 'IX', 1.144)], 'Pa': [ionic(3, 'VI', 1.04), ionic(4, 'VI', 0.9), ionic(4, 'VIII', 1.01), ionic(5, 'VI', 0.78), ionic(5, 'VIII', 0.91), ionic(5, 'IX', 0.95)], 'Ra': [ionic(2, 'VIII', 1.48), ionic(2, 'XII', 1.7)], 'Rn': [ionic()], 'Re': [ionic(4, 'VI', 0.63), ionic(5, 'VI', 0.58), ionic(6, 'VI', 0.55), ionic(7, 'IV', 0.38), ionic(7, 'VI', 0.53)], 'Rh': [ionic(3, 'VI', 0.665), ionic(4, 'VI', 0.6), ionic(5, 'VI', 0.55)], 'Rg': [ionic()], 'Rb': [ionic(1, 'VI', 1.52), ionic(1, 'VII', 1.56), ionic(1, 'VIII', 1.61), ionic(1, 'IX', 1.63), ionic(1, 'X', 1.66), ionic(1, 'XI', 1.69), ionic(1, 'XII', 1.72), ionic(1, 'XIV', 1.83)], 'Ru': [ionic(3, 'VI', 0.68), ionic(4, 'VI', 0.62), ionic(5, 'VI', 0.565), ionic(7, 'IV', 0.38), ionic(8, 'IV', 0.36)], 'Rf': [ionic()], 'Sm': [ionic(2, 'VII', 1.22), ionic(2, 'VIII', 1.27), ionic(2, 'IX', 1.32), ionic(3, 'VI', 0.958), ionic(3, 'VII', 1.02), ionic(3, 'VIII', 1.079), ionic(3, 'IX', 1.132), ionic(3, 'XII', 1.24)], 'Sc': [ionic(3, 'VI', 0.745), ionic(3, 'VIII', 0.87)], 'Sg': [ionic()], 'Se': [ionic(-2, 'VI', 1.98), ionic(4, 'VI', 0.5), ionic(6, 'IV', 0.28), ionic(6, 'VI', 0.42)], 'Si': [ionic(4, 'IV', 0.26), ionic(4, 'VI', 0.4)], 'Ag': [ionic(1, 'II', 0.67), ionic(1, 'IV', 1), ionic(1, 'IVSQ', 1.02), ionic(1, 'V', 1.09), ionic(1, 'VI', 1.15), ionic(1, 'VII', 1.22), ionic(1, 'VIII', 1.28), ionic(2, 'IVSQ', 0.79), ionic(2, 'VI', 0.94), ionic(3, 'IVSQ', 0.67), ionic(3, 'VI', 0.75)], 'Na': [ionic(1, 'IV', 0.99), ionic(1, 'V', 1), ionic(1, 'VI', 1.02), ionic(1, 'VII', 1.12), ionic(1, 'VIII', 1.18), ionic(1, 'IX', 1.24), ionic(1, 'XII', 1.39)], 'Sr': [ionic(2, 'VI', 1.18), ionic(2, 'VII', 1.21), ionic(2, 'VIII', 1.26), ionic(2, 'IX', 1.31), ionic(2, 'X', 1.36), ionic(2, 'XII', 1.44)], 'S': [ionic(-2, 'VI', 1.84), ionic(4, 'VI', 0.37), ionic(6, 'IV', 0.12), ionic(6, 'VI', 0.29)], 'Ta': [ionic(3, 'VI', 0.72), ionic(4, 'VI', 0.68), ionic(5, 'VI', 0.64), ionic(5, 'VII', 0.69), ionic(5, 'VIII', 0.74)], 'Tc': [ionic(4, 'VI', 0.645), ionic(5, 'VI', 0.6), ionic(7, 'IV', 0.37), ionic(7, 'VI', 0.56)], 'Te': [ionic(-2, 'VI', 2.21), ionic(4, 'III', 0.52), ionic(4, 'IV', 0.66), ionic(4, 'VI', 0.97), ionic(6, 'IV', 0.43), ionic(6, 'VI', 0.56)], 'Ts': [ionic()], 'Tb': [ionic(3, 'VI', 0.923), ionic(3, 'VII', 0.98), ionic(3, 'VIII', 1.04), ionic(3, 'IX', 1.095), ionic(4, 'VI', 0.76), ionic(4, 'VIII', 0.88)], 'Tl': [ionic(1, 'VI', 1.5), ionic(1, 'VIII', 1.59), ionic(1, 'XII', 1.7), ionic(3, 'IV', 0.75), ionic(3, 'VI', 0.885), ionic(3, 'VIII', 0.98)], 'Th': [ionic(4, 'VI', 0.94), ionic(4, 'VIII', 1.05), ionic(4, 'IX', 1.09), ionic(4, 'X', 1.13), ionic(4, 'XI', 1.18), ionic(4, 'XII', 1.21)], 'Tm': [ionic(2, 'VI', 1.03), ionic(2, 'VII', 1.09), ionic(3, 'VI', 0.88), ionic(3, 'VIII', 0.994), ionic(3, 'IX', 1.052)], 'Sn': [ionic(4, 'IV', 0.55), ionic(4, 'V', 0.62), ionic(4, 'VI', 0.69), ionic(4, 'VII', 0.75), ionic(4, 'VIII', 0.81)], 'Ti': [ionic(2, 'VI', 0.86), ionic(3, 'VI', 0.67), ionic(4, 'IV', 0.42), ionic(4, 'V', 0.51), ionic(4, 'VI', 0.605), ionic(4, 'VIII', 0.74)], 'W': [ionic(4, 'VI', 0.66), ionic(5, 'VI', 0.62), ionic(6, 'IV', 0.42), ionic(6, 'V', 0.51), ionic(6, 'VI', 0.6)], 'U': [ionic(3, 'VI', 1.025), ionic(4, 'VI', 0.89), ionic(4, 'VII', 0.95), ionic(4, 'VIII', 1), ionic(4, 'IX', 1.05), ionic(4, 'XII', 1.17), ionic(5, 'VI', 0.76), ionic(5, 'VII', 0.84), ionic(6, 'II', 0.45), ionic(6, 'IV', 0.52), ionic(6, 'VI', 0.73), ionic(6, 'VII', 0.81), ionic(6, 'VIII', 0.86)], 'V': [ionic(2, 'VI', 0.79), ionic(3, 'VI', 0.64), ionic(4, 'V', 0.53), ionic(4, 'VI', 0.58), ionic(4, 'VIII', 0.72), ionic(5, 'IV', 0.355), ionic(5, 'V', 0.46), ionic(5, 'VI', 0.54)], 'Xe': [ionic(8, 'IV', 0.4), ionic(8, 'VI', 0.48)], 'Yb': [ionic(2, 'VI', 1.02), ionic(2, 'VII', 1.08), ionic(2, 'VIII', 1.14), ionic(3, 'VI', 0.868), ionic(3, 'VII', 0.925), ionic(3, 'VIII', 0.985), ionic(3, 'IX', 1.042)], 'Y': [ionic(3, 'VI', 0.9), ionic(3, 'VII', 0.96), ionic(3, 'VIII', 1.019), ionic(3, 'IX', 1.075)], 'Zn': [ionic(2, 'IV', 0.6), ionic(2, 'V', 0.68), ionic(2, 'VI', 0.74), ionic(2, 'VIII', 0.9)], 'Zr': [ionic(4, 'IV', 0.59), ionic(4, 'V', 0.66), ionic(4, 'VI', 0.72), ionic(4, 'VII', 0.78), ionic(4, 'VIII', 0.84), ionic(4, 'IX', 0.89)]}
dummy = atom__data(radius=0.01, color=(1.0, 0.65, 1.0, 1))
actinium = atom__data(2.01, 2.47, ionicData=IonicRadii['Ac'])
aluminum = atom__data(1.24, 1.84, ionicData=IonicRadii['Al'])
americium = atom__data(1.73, 2.44, ionicData=IonicRadii['Am'])
antimony = atom__data(1.4, 2.06, ionicData=IonicRadii['Sb'])
argon = atom__data(1.01, 1.88, ionicData=IonicRadii['Ar'])
arsenic = atom__data(1.2, 1.85, ionicData=IonicRadii['As'])
astatine = atom__data(1.48, 2.02, (0.99, 0.28, 0.11, 1), ionicData=IonicRadii['At'])
barium = atom__data(2.06, 2.68, ionicData=IonicRadii['Ba'])
berkelium = atom__data(1.68, 2.44, ionicData=IonicRadii['Bk'])
beryllium = atom__data(0.99, 1.53, (0.13, 0.96, 0.55, 1), ionicData=IonicRadii['Be'])
bismuth = atom__data(1.5, 2.07, (0.53, 0.84, 0.55, 1), ionicData=IonicRadii['Bi'])
bohrium = atom__data(1.41, ionicData=IonicRadii['Bh'])
boron = atom__data(0.84, 1.92, (1.0, 0.7, 0.7, 1), ionicData=IonicRadii['B'])
bromine = atom__data(1.17, 1.85, (0.76, 0.0, 0.14, 1), ionicData=IonicRadii['Br'])
cadmium = atom__data(1.4, 2.18, ionicData=IonicRadii['Cd'])
calcium = atom__data(1.74, 2.31, (0.94, 0.0, 0.36, 1), ionicData=IonicRadii['Ca'])
californium = atom__data(1.68, 2.45, ionicData=IonicRadii['Cf'])
carbon = atom__data(0.75, 1.7, (0.1, 0.1, 0.1, 1), ionicData=IonicRadii['Ac'])
cerium = atom__data(1.84, 2.42, ionicData=IonicRadii['Ce'])
cesium = atom__data(2.38, 3.43, ionicData=IonicRadii['Cs'])
chlorine = atom__data(1.0, 1.75, (0.0, 0.94, 0.26, 1), ionicData=IonicRadii['Cl'])
chromium = atom__data(1.3, 2.06, ionicData=IonicRadii['Cr'])
cobalt = atom__data(1.18, 2.0, (0.0, 0.39, 0.94, 1), ionicData=IonicRadii['Co'])
copernicium = atom__data(1.22, ionicData=IonicRadii['Cn'])
copper = atom__data(1.22, 1.96, (0.0, 0.94, 0.75, 1), ionicData=IonicRadii['Cu'])
curium = atom__data(1.68, 2.45, ionicData=IonicRadii['Cm'])
darmstadtium = atom__data(1.28, ionicData=IonicRadii['Ds'])
dubnium = atom__data(1.49, ionicData=IonicRadii['Db'])
dysprosium = atom__data(1.8, 2.31, ionicData=IonicRadii['Dy'])
einsteinium = atom__data(1.65, 2.45, ionicData=IonicRadii['Es'])
erbium = atom__data(1.77, 2.29, ionicData=IonicRadii['Er'])
europium = atom__data(1.83, 2.35, (1.0, 0.18, 0.39, 1), ionicData=IonicRadii['Eu'])
fermium = atom__data(1.67, 2.45, ionicData=IonicRadii['Fm'])
flerovium = atom__data(1.43, ionicData=IonicRadii['Fl'])
fluorine = atom__data(0.6, 1.47, (0.0, 0.9, 0.0, 1), ionicData=IonicRadii['F'])
francium = atom__data(2.42, 3.48, ionicData=IonicRadii['Fr'])
gadolinium = atom__data(1.82, 2.34, ionicData=IonicRadii['Gd'])
gallium = atom__data(1.23, 1.87, ionicData=IonicRadii['Ga'])
germanium = atom__data(1.2, 2.11, ionicData=IonicRadii['Ge'])
gold = atom__data(1.3, 2.14, (0.99, 0.95, 0.11, 1), ionicData=IonicRadii['Au'])
hafnium = atom__data(1.64, 2.23, ionicData=IonicRadii['Hf'])
hassium = atom__data(1.34, ionicData=IonicRadii['Hs'])
helium = atom__data(0.37, 1.4, ionicData=IonicRadii['He'])
holmium = atom__data(1.79, 2.3, ionicData=IonicRadii['Ho'])
hydrogen = atom__data(0.32, 1.1, (0.8, 0.8, 0.8, 1), ionicData=IonicRadii['H'])
indium = atom__data(1.42, 1.93, ionicData=IonicRadii['In'])
iodine = atom__data(1.36, 1.98, (0.49, 0.03, 0.73, 1), ionicData=IonicRadii['I'])
iridium = atom__data(1.32, 2.13, ionicData=IonicRadii['Ir'])
iron = atom__data(1.24, 2.04, (0.47, 0.05, 0.13, 1), ionicData=IonicRadii['Fe'])
krypton = atom__data(1.16, 2.02, ionicData=IonicRadii['Kr'])
lanthanum = atom__data(1.94, 2.43, ionicData=IonicRadii['La'])
lawrencium = atom__data(1.61, 2.46, ionicData=IonicRadii['Lr'])
lead = atom__data(1.45, 2.02, (0.06, 0.06, 0.06, 1), ionicData=IonicRadii['Pb'])
lithium = atom__data(1.3, 1.82, (0.96, 0.13, 0.76, 1), ionicData=IonicRadii['Li'])
livermorium = atom__data(1.75, ionicData=IonicRadii['Lv'])
lutetium = atom__data(1.74, 2.24, ionicData=IonicRadii['Lu'])
magnesium = atom__data(1.4, 1.73, (0.9, 0.9, 0.9, 1), ionicData=IonicRadii['Mg'])
manganese = atom__data(1.29, 2.05, (0.94, 0.0, 0.8, 1), ionicData=IonicRadii['Mn'])
meitnerium = atom__data(1.29, ionicData=IonicRadii['Mt'])
mendelevium = atom__data(1.73, 2.46, ionicData=IonicRadii['Md'])
mercury = atom__data(1.32, 2.23, ionicData=IonicRadii['Hg'])
molybdenum = atom__data(1.46, 2.17, ionicData=IonicRadii['Mo'])
moscovium = atom__data(1.62, ionicData=IonicRadii['Mc'])
neodymium = atom__data(1.88, 2.39, ionicData=IonicRadii['Nd'])
neon = atom__data(0.62, 1.54, ionicData=IonicRadii['Ne'])
neptunium = atom__data(1.8, 2.39, ionicData=IonicRadii['Np'])
nickel = atom__data(1.17, 1.97, ionicData=IonicRadii['Ni'])
nihonium = atom__data(1.36, ionicData=IonicRadii['Nh'])
niobium = atom__data(1.56, 2.18, ionicData=IonicRadii['Nb'])
nitrogen = atom__data(0.71, 1.55, (0.0, 0.0, 0.9, 1), ionicData=IonicRadii['N'])
nobelium = atom__data(1.76, 2.46, ionicData=IonicRadii['No'])
oganesson = atom__data(1.57, ionicData=IonicRadii['Og'])
osmium = atom__data(1.36, 2.16, ionicData=IonicRadii['Os'])
oxygen = atom__data(0.64, 1.52, (0.9, 0.0, 0.0, 1), ionicData=IonicRadii['O'])
palladium = atom__data(1.3, 2.1, ionicData=IonicRadii['Pd'])
phosphorus = atom__data(1.09, 1.8, (0.85, 0.0, 0.95, 1), ionicData=IonicRadii['P'])
platinum = atom__data(1.3, 2.13, ionicData=IonicRadii['Pt'])
plutonium = atom__data(1.8, 2.43, (1.0, 0.8, 0.0, 1), ionicData=IonicRadii['Pu'])
polonium = atom__data(1.42, 1.97, (0.53, 1.0, 0.32, 1), ionicData=IonicRadii['Po'])
potassium = atom__data(2.0, 2.75, (0.6, 0.0, 0.94, 1), ionicData=IonicRadii['K'])
praseodymium = atom__data(1.9, 2.4, ionicData=IonicRadii['Pr'])
promethium = atom__data(1.86, 2.38, ionicData=IonicRadii['Pm'])
protactinium = atom__data(1.84, 2.43, ionicData=IonicRadii['Pa'])
radium = atom__data(2.11, 2.83, ionicData=IonicRadii['Ra'])
radon = atom__data(1.46, 2.2, (0.57, 0.99, 0.1, 1), ionicData=IonicRadii['Rn'])
rhenium = atom__data(1.41, ionicData=IonicRadii['Re'])
rhodium = atom__data(1.34, 2.1, ionicData=IonicRadii['Rh'])
roentgenium = atom__data(1.21, ionicData=IonicRadii['Rg'])
rubidium = atom__data(2.15, 3.03, ionicData=IonicRadii['Rb'])
ruthenium = atom__data(1.36, 2.13, ionicData=IonicRadii['Ru'])
rutherfordium = atom__data(1.57, ionicData=IonicRadii['Rf'])
samarium = atom__data(1.85, 2.36, ionicData=IonicRadii['Sm'])
scandium = atom__data(1.59, 2.15, (0.94, 0.7, 0.0, 1), ionicData=IonicRadii['Sc'])
seaborgium = atom__data(1.43, ionicData=IonicRadii['Sg'])
selenium = atom__data(1.18, 1.9, ionicData=IonicRadii['Se'])
silicon = atom__data(1.14, 2.1, (0.95, 1.0, 0.48, 1), ionicData=IonicRadii['Si'])
silver = atom__data(1.36, 2.11, (0.83, 0.83, 0.83, 1), ionicData=IonicRadii['Ag'])
sodium = atom__data(1.6, 2.27, (0.0, 0.5, 0.76, 1), ionicData=IonicRadii['Na'])
strontium = atom__data(1.9, 2.49, ionicData=IonicRadii['Sr'])
sulfur = atom__data(1.04, 1.8, (0.94, 0.94, 0.0, 1), ionicData=IonicRadii['S'])
tantalum = atom__data(1.58, 2.22, ionicData=IonicRadii['Ta'])
technetium = atom__data(1.38, 2.16, ionicData=IonicRadii['Tc'])
tellurium = atom__data(1.37, 2.06, ionicData=IonicRadii['Te'])
tennessine = atom__data(1.65, ionicData=IonicRadii['Ts'])
terbium = atom__data(1.81, 2.33, ionicData=IonicRadii['Tb'])
thallium = atom__data(1.44, 1.96, ionicData=IonicRadii['Tl'])
thorium = atom__data(1.9, 2.45, ionicData=IonicRadii['Th'])
thulium = atom__data(1.77, 2.27, ionicData=IonicRadii['Tm'])
tin = atom__data(1.4, 2.17, ionicData=IonicRadii['Sn'])
titanium = atom__data(1.48, 2.11, ionicData=IonicRadii['Ti'])
tungsten = atom__data(1.5, 2.18, ionicData=IonicRadii['W'])
uranium = atom__data(1.83, 2.41, (0.53, 1.0, 0.32, 1), ionicData=IonicRadii['U'])
vanadium = atom__data(1.44, 2.07, ionicData=IonicRadii['V'])
xenon = atom__data(1.36, 2.16, ionicData=IonicRadii['Xe'])
ytterbium = atom__data(1.78, 2.26, ionicData=IonicRadii['Yb'])
yttrium = atom__data(1.76, 2.32, ionicData=IonicRadii['Y'])
zinc = atom__data(1.2, 2.01, ionicData=IonicRadii['Zn'])
zirconium = atom__data(1.64, 2.23, ionicData=IonicRadii['Zr'])
elements = {'Xx': Dummy, 'Ac': Actinium, 'Al': Aluminum, 'Am': Americium, 'Sb': Antimony, 'Ar': Argon, 'As': Arsenic, 'At': Astatine, 'Ba': Barium, 'Bk': Berkelium, 'Be': Beryllium, 'Bi': Bismuth, 'Bh': Bohrium, 'B': Boron, 'Br': Bromine, 'Cd': Cadmium, 'Ca': Calcium, 'Cf': Californium, 'C': Carbon, 'Ce': Cerium, 'Cs': Cesium, 'Cl': Chlorine, 'Cr': Chromium, 'Co': Cobalt, 'Cn': Copernicium, 'Cu': Copper, 'Cm': Curium, 'Ds': Darmstadtium, 'Db': Dubnium, 'Dy': Dysprosium, 'Es': Einsteinium, 'Er': Erbium, 'Eu': Europium, 'Fm': Fermium, 'Fl': Flerovium, 'F': Fluorine, 'Fr': Francium, 'Gd': Gadolinium, 'Ga': Gallium, 'Ge': Germanium, 'Au': Gold, 'Hf': Hafnium, 'Hs': Hassium, 'He': Helium, 'Ho': Holmium, 'H': Hydrogen, 'In': Indium, 'I': Iodine, 'Ir': Iridium, 'Fe': Iron, 'Kr': Krypton, 'La': Lanthanum, 'Lr': Lawrencium, 'Pb': Lead, 'Li': Lithium, 'Lv': Livermorium, 'Lu': Lutetium, 'Mg': Magnesium, 'Mn': Manganese, 'Mt': Meitnerium, 'Md': Mendelevium, 'Hg': Mercury, 'Mo': Molybdenum, 'Mc': Moscovium, 'Nd': Neodymium, 'Ne': Neon, 'Np': Neptunium, 'Ni': Nickel, 'Nh': Nihonium, 'Nb': Niobium, 'N': Nitrogen, 'No': Nobelium, 'Og': Oganesson, 'Os': Osmium, 'O': Oxygen, 'Pd': Palladium, 'P': Phosphorus, 'Pt': Platinum, 'Pu': Plutonium, 'Po': Polonium, 'K': Potassium, 'Pr': Praseodymium, 'Pm': Promethium, 'Pa': Protactinium, 'Ra': Radium, 'Rn': Radon, 'Re': Rhenium, 'Rh': Rhodium, 'Rg': Roentgenium, 'Rb': Rubidium, 'Ru': Ruthenium, 'Rf': Rutherfordium, 'Sm': Samarium, 'Sc': Scandium, 'Sg': Seaborgium, 'Se': Selenium, 'Si': Silicon, 'Ag': Silver, 'Na': Sodium, 'Sr': Strontium, 'S': Sulfur, 'Ta': Tantalum, 'Tc': Technetium, 'Te': Tellurium, 'Ts': Tennessine, 'Tb': Terbium, 'Tl': Thallium, 'Th': Thorium, 'Tm': Thulium, 'Sn': Tin, 'Ti': Titanium, 'W': Tungsten, 'U': Uranium, 'V': Vanadium, 'Xe': Xenon, 'Yb': Ytterbium, 'Y': Yttrium, 'Zn': Zinc, 'Zr': Zirconium} |
class Adapter(object):
def __init__(self):
self.interfaces = []
| class Adapter(object):
def __init__(self):
self.interfaces = [] |
with open("10.in") as file:
lines = file.readlines()
lines = [line.rstrip() for line in lines]
# Part 1
luc = {"(": ")", ")": "(", "[": "]", "]": "[",
"{": "}", "}": "{", "<": ">", ">": "<"}
lup = {")": 3, "]": 57, "}": 1197, ">": 25137}
score = 0
for line in lines:
stack = []
for i in range(0, len(line)):
if line[i] in ["(", "[", "{", "<"]:
stack.append(line[i])
elif len(stack) > 0 and luc[line[i]] == stack[len(stack)-1]:
stack.pop(len(stack)-1)
else:
score += lup[line[i]]
break
print(score)
# Part 2
lup = {")": 1, "]": 2, "}": 3, ">": 4}
scores = []
for line in lines:
stack = []
score = 0
for i in range(0, len(line)):
if line[i] in ["(", "[", "{", "<"]:
stack.append(line[i])
elif len(stack) > 0 and luc[line[i]] == stack[len(stack)-1]:
stack.pop(len(stack)-1)
else:
break
if i == len(line)-1:
for i in range(len(stack)-1, -1, -1):
score = score * 5 + lup[luc[stack[i]]]
scores.append(score)
scores.sort()
print(scores[int((len(scores) - 1)/2)])
| with open('10.in') as file:
lines = file.readlines()
lines = [line.rstrip() for line in lines]
luc = {'(': ')', ')': '(', '[': ']', ']': '[', '{': '}', '}': '{', '<': '>', '>': '<'}
lup = {')': 3, ']': 57, '}': 1197, '>': 25137}
score = 0
for line in lines:
stack = []
for i in range(0, len(line)):
if line[i] in ['(', '[', '{', '<']:
stack.append(line[i])
elif len(stack) > 0 and luc[line[i]] == stack[len(stack) - 1]:
stack.pop(len(stack) - 1)
else:
score += lup[line[i]]
break
print(score)
lup = {')': 1, ']': 2, '}': 3, '>': 4}
scores = []
for line in lines:
stack = []
score = 0
for i in range(0, len(line)):
if line[i] in ['(', '[', '{', '<']:
stack.append(line[i])
elif len(stack) > 0 and luc[line[i]] == stack[len(stack) - 1]:
stack.pop(len(stack) - 1)
else:
break
if i == len(line) - 1:
for i in range(len(stack) - 1, -1, -1):
score = score * 5 + lup[luc[stack[i]]]
scores.append(score)
scores.sort()
print(scores[int((len(scores) - 1) / 2)]) |
__all__ = [
'config_enums',
'feed_enums',
'file_enums'
]
| __all__ = ['config_enums', 'feed_enums', 'file_enums'] |
#Flag
#Use a flag that stores on the nodes to know if we visited or not.
#time: O(N).
#space: O(N), for each node we use O(1) and there are N nodes.
class Solution(object):
def detectCycle(self, head):
curr = head
while curr:
if hasattr(curr, 'visited') and curr.visited: return curr
curr.visited = True
curr = curr.next
return None
#HashSet
#Use a hash-set to store the visited nodes
#time: O(N).
#space: O(N).
class Solution(object):
def detectCycle(self, head):
visited = set()
curr = head
while curr:
if curr in visited: return curr
visited.add(curr)
curr = curr.next
return None | class Solution(object):
def detect_cycle(self, head):
curr = head
while curr:
if hasattr(curr, 'visited') and curr.visited:
return curr
curr.visited = True
curr = curr.next
return None
class Solution(object):
def detect_cycle(self, head):
visited = set()
curr = head
while curr:
if curr in visited:
return curr
visited.add(curr)
curr = curr.next
return None |
class Solution:
def binarySearchableNumbers(self, nums: List[int]) -> int:
maximums = [nums[0]] # from the left
minimums = [0] * len(nums) # from the right
min_n = nums[-1]
result = 0
for n in nums[1::]:
maximums.append(max(maximums[-1], n))
for idx in range(len(nums)-1, -1, -1):
min_n = min(min_n, nums[idx])
minimums[idx] = min_n
if nums[idx] == maximums[idx] and nums[idx] == minimums[idx]:
result += 1
return result | class Solution:
def binary_searchable_numbers(self, nums: List[int]) -> int:
maximums = [nums[0]]
minimums = [0] * len(nums)
min_n = nums[-1]
result = 0
for n in nums[1:]:
maximums.append(max(maximums[-1], n))
for idx in range(len(nums) - 1, -1, -1):
min_n = min(min_n, nums[idx])
minimums[idx] = min_n
if nums[idx] == maximums[idx] and nums[idx] == minimums[idx]:
result += 1
return result |
# def candies(s): # worst case = three passes of 's', len, max, sum
# length = len(s)
# if length <= 1:
# return -1
# return max(s) * length - sum(s)
def candies(seq):
length = 0
maximum = 0
total = 0
for i, a in enumerate(seq):
try:
current = int(a)
except TypeError:
return -1
length += 1
total += current
if current > maximum:
maximum = current
return maximum * length - total if length > 1 else -1
| def candies(seq):
length = 0
maximum = 0
total = 0
for (i, a) in enumerate(seq):
try:
current = int(a)
except TypeError:
return -1
length += 1
total += current
if current > maximum:
maximum = current
return maximum * length - total if length > 1 else -1 |
def convert2meter(s, input_unit="in"):
'''
Function to convert inches, feet and cubic feet to meters and cubic meters
'''
if input_unit == "in":
return s*0.0254
elif input_unit == "ft":
return s*0.3048
elif input_unit == "cft":
return s*0.0283168
else:
print("Error: Input unit is unknown.")
## Apply function
measurement_unit = {"Girth":"in",
"Height":"ft",
"Volume":"cft"}
trees = trees_raw.copy()
for feature in ["Girth", "Height", "Volume"]:
trees[feature] = trees_raw[feature].apply(lambda x: convert2meter(s=x,
input_unit=measurement_unit.get(feature)))
| def convert2meter(s, input_unit='in'):
"""
Function to convert inches, feet and cubic feet to meters and cubic meters
"""
if input_unit == 'in':
return s * 0.0254
elif input_unit == 'ft':
return s * 0.3048
elif input_unit == 'cft':
return s * 0.0283168
else:
print('Error: Input unit is unknown.')
measurement_unit = {'Girth': 'in', 'Height': 'ft', 'Volume': 'cft'}
trees = trees_raw.copy()
for feature in ['Girth', 'Height', 'Volume']:
trees[feature] = trees_raw[feature].apply(lambda x: convert2meter(s=x, input_unit=measurement_unit.get(feature))) |
# [Stone Colusses] It Ain't Natural
CHIEF_TATOMO = 2081000
sm.setSpeakerID(CHIEF_TATOMO)
sm.sendNext("Well, you don't look like you just spoke to an ancient nature spirit, but I suppose we'll know soon enough. "
"Are you ready for a little adventure?\r\n\r\n"
"#bYou know it! How do I get to the Stone Colossus?")
sm.sendSay("Ah, humans. No patience, and not enough hair. "
"I would advise you to seek out the Halflinger expedition that has already traveled to the area. "
"They could help you.\r\n\r\n"
"#bThese are Halflinger explorers?")
response = sm.sendAskYesNo("Don't act so surprised! "
"Our people are peaceful home-bodies for the most part, but the blood of the explorer can show up where you least expect it. "
"What kind of chief would I be if I held them back?\r\n"
"If you'd like, I can send you to their camp right away.")
if response:
sm.sendNext("That's the spirit. Do an old-timer a favour and check on my villagers for me.")
sm.completeQuest(parentID)
sm.warp(240090000) # Stone Colossus Exploration Site
else:
sm.sendNext("Oh.. Okay.. I mean.. I thought you were all about adventures.. I guess I was wrong..\r\n\r\n"
"This is so sad.\r\n"
"Alexa, play Despacito 5!") | chief_tatomo = 2081000
sm.setSpeakerID(CHIEF_TATOMO)
sm.sendNext("Well, you don't look like you just spoke to an ancient nature spirit, but I suppose we'll know soon enough. Are you ready for a little adventure?\r\n\r\n#bYou know it! How do I get to the Stone Colossus?")
sm.sendSay('Ah, humans. No patience, and not enough hair. I would advise you to seek out the Halflinger expedition that has already traveled to the area. They could help you.\r\n\r\n#bThese are Halflinger explorers?')
response = sm.sendAskYesNo("Don't act so surprised! Our people are peaceful home-bodies for the most part, but the blood of the explorer can show up where you least expect it. What kind of chief would I be if I held them back?\r\nIf you'd like, I can send you to their camp right away.")
if response:
sm.sendNext("That's the spirit. Do an old-timer a favour and check on my villagers for me.")
sm.completeQuest(parentID)
sm.warp(240090000)
else:
sm.sendNext('Oh.. Okay.. I mean.. I thought you were all about adventures.. I guess I was wrong..\r\n\r\nThis is so sad.\r\nAlexa, play Despacito 5!') |
# a = [1,2,2,3,4,5]
# # print(list(set(a)))
# def correct_list(a):
# return(list(set(a)))
# print(correct_list(a))
a = [1,2,2,3,4,5]
def correct_list(a):
s = []
for i in a:
if i not in s:
s.append(i)
return(s)
print(correct_list(a)) | a = [1, 2, 2, 3, 4, 5]
def correct_list(a):
s = []
for i in a:
if i not in s:
s.append(i)
return s
print(correct_list(a)) |
'''
Title: %s
Given: %s
Return %s
Sample Dataset: %s
Sample Output: %s
'''
def compute():
pass
if __name__ == "__main__":
pass
| """
Title: %s
Given: %s
Return %s
Sample Dataset: %s
Sample Output: %s
"""
def compute():
pass
if __name__ == '__main__':
pass |
def read_color(input_func):
"""
Reads input color and lower cases it
"""
user_supplied_color = input_func()
return user_supplied_color.casefold()
def is_quit(user_supplied_color):
return 'quit' == user_supplied_color
def print_colors():
"""
In the while loop ask the user to enter a color,
lowercase it and store it in a variable. Next check:
- if 'quit' was entered for color, print 'bye' and break.
- if the color is not in VALID_COLORS, print 'Not a valid color' and continue.
- otherwise print the color in lower case.
"""
pass
| def read_color(input_func):
"""
Reads input color and lower cases it
"""
user_supplied_color = input_func()
return user_supplied_color.casefold()
def is_quit(user_supplied_color):
return 'quit' == user_supplied_color
def print_colors():
"""
In the while loop ask the user to enter a color,
lowercase it and store it in a variable. Next check:
- if 'quit' was entered for color, print 'bye' and break.
- if the color is not in VALID_COLORS, print 'Not a valid color' and continue.
- otherwise print the color in lower case.
"""
pass |
class Solution(object):
def findSubstring(self, s, words):
"""
:type s: str
:type words: List[str]
:rtype: List[int]
"""
ret = [];
wl = len(words[0])
wordsused = []
for i in range (0, len(s) - len(words) * wl + 1):
test = s[i:i+wl]
if test in words:
for j in range(0, len(words) * wl, wl):
curr = s[i+j:i+j+wl]
if curr in words:
words.remove(curr)
wordsused.append(curr);
else:
break
if len(words) == 0:
ret.append(i)
words = wordsused
wordsused = []
else:
for w in wordsused:
words.append(w)
wordsused = []
return ret;
| class Solution(object):
def find_substring(self, s, words):
"""
:type s: str
:type words: List[str]
:rtype: List[int]
"""
ret = []
wl = len(words[0])
wordsused = []
for i in range(0, len(s) - len(words) * wl + 1):
test = s[i:i + wl]
if test in words:
for j in range(0, len(words) * wl, wl):
curr = s[i + j:i + j + wl]
if curr in words:
words.remove(curr)
wordsused.append(curr)
else:
break
if len(words) == 0:
ret.append(i)
words = wordsused
wordsused = []
else:
for w in wordsused:
words.append(w)
wordsused = []
return ret |
# encoding: utf-8
##################################################
# This script shows an example of a header section. This sections is a group of commented lines (lines starting with
# the "#" character) that describes general features of the script such as the type of licence (defined by the
# developer), authors, credits, versions among others
##################################################
#
##################################################
# Author: Soroush Garivani
# Copyright: Copyright 2019, IAAC
# Credits: [Institute for Advanced Architecture of Catalonia - IAAC, Advanced Architecture group]
# License: Apache License Version 2.0
# Version: 1.0.0
# Maintainer: Soroush Garivani
# Email: soroush.garivani@iaac.net
# Status: development
##################################################
# End of header section
# tuples
print("tuples are very similar to lists")
print("the are defined by ()")
my_tuple = (1, 2, 3)
print(my_tuple)
data_type = type(my_tuple)
print(data_type, '\n')
print("tuples can have different data types as items")
my_tuple = ('One', 'Two', 3)
print(my_tuple, '\n')
print("you can use indexing and slicing for tuples")
print(my_tuple[0])
print(my_tuple[-1])
print(my_tuple[0:2], '\n')
# print ("the difference between tuples and lists is that tuples are 'immutable'. This means once they are assigned they cannot be reassigned.")
# my_list = [1,2,3,4]
# my_tuple = (1,2,3,4)
# my_list[0] = 'ONE'
# print (my_list)
# my_tuple[0] = 'ONE'
# print (my_tuple)
# # tuples are useful when you want to make sure your elements will not change during the program
| print('tuples are very similar to lists')
print('the are defined by ()')
my_tuple = (1, 2, 3)
print(my_tuple)
data_type = type(my_tuple)
print(data_type, '\n')
print('tuples can have different data types as items')
my_tuple = ('One', 'Two', 3)
print(my_tuple, '\n')
print('you can use indexing and slicing for tuples')
print(my_tuple[0])
print(my_tuple[-1])
print(my_tuple[0:2], '\n') |
def result(text):
count=0
for i in range(len(metin)):
if(ord(metin[i])>=65 and ord(metin[i])<=90):
count=count+1
return count
| def result(text):
count = 0
for i in range(len(metin)):
if ord(metin[i]) >= 65 and ord(metin[i]) <= 90:
count = count + 1
return count |
def genTest():
print('Block of code before first yield statement')
yield 1
print('Block of code after first yield statement and before second yield statement')
yield 2
print('Block of code after all yield statements')
# foo = genTest returns <function gen at 0x101faf400>
foo = genTest() # returns <generator object gen at 0x101f9f408>
print(foo.__next__())
print()
print(foo.__next__())
print('\n')
for f in foo:
print(f)
# **OUTPUT**
# Block of code before first yield statement
# 1
# Block of code after first yield statement and before second yield statement
# 2
#
#
# Block of code after all yield statements
| def gen_test():
print('Block of code before first yield statement')
yield 1
print('Block of code after first yield statement and before second yield statement')
yield 2
print('Block of code after all yield statements')
foo = gen_test()
print(foo.__next__())
print()
print(foo.__next__())
print('\n')
for f in foo:
print(f) |
class PropertyReference:
def __init__(self, var_name, property_name):
self.var_name = var_name
self.property_name = property_name
def __str__(self):
return f'{self.var_name}.{self.property_name}'
def code_gen_string(self):
return str(self)
class FunctionCallArgument:
def __init__(self, arg_type, value):
self.arg_type = arg_type
self.value = value
def __str__(self):
return f'{self.arg_type}: {self.value}'
def code_gen_string(self):
if isinstance(self.value, str) or isinstance(self.value, int) or isinstance(self.value, float):
return f'{self.value}'
return self.value.code_gen_string()
class FunctionCall:
def __init__(self, name, args, result):
self.name = name
self.args = args
self.result = result
def __str__(self):
return_str = ''
args = ', '.join(map(str, self.args))
return f'{return_str}{self.name}({args})'
def code_gen_string(self):
args = ', '.join(map(lambda x: x.code_gen_string(), self.args))
return f'{self.name}({args})'
class AssignVariable:
def __init__(self, var_name, var_type, value):
self.var_name = var_name
self.var_type = var_type
self.value = value
def __str__(self):
val = self.value
if isinstance(val, list):
val = ', '.join(map(str, self.value))
return f'{self.var_type}: {self.var_name} = {val}'
def code_gen_string(self):
if isinstance(self.value, list):
val = f"[{', '.join(map(lambda x: x.code_gen_string(), self.value))}]"
elif isinstance(self.value, str):
val = self.value
else:
val = self.value.code_gen_string()
return f'{self.var_name} = {val}'
class ModifyString:
def __init__(self, insert_mode, int_val, str_val, obj):
self.insert_mode = insert_mode
self.int_val = int_val
self.str_val = str_val
self.obj = obj
def __str__(self):
return f'modify_string_59({self.insert_mode}, {self.int_val}, {self.str_val}, {self.obj})'
def code_gen_string(self):
return str(self)
class BinaryIntermediate:
def __init__(self, op, left, right):
self.op = op
self.left = left
self.right = right
def __str__(self):
return f'{self.left} {self.op} {self.right}'
def code_gen_string(self):
return f'{self.left.code_gen_string()} {self.op} {self.right.code_gen_string()}'
class UnaryIntermediate:
def __init__(self, operator, operand):
self.operator = operator
self.operand = operand
def __str__(self):
return f'{self.operator} {self.operand}'
def code_gen_string(self):
return f'{self.operator} {self.operand.code_gen_string()}'
class EndControlStatement:
def __init__(self, control_statement):
self.control_statement = control_statement
def __str__(self):
return f'end{self.control_statement}'
def code_gen_string(self):
return str(self)
class BreakStatement:
def __str__(self):
return 'break'
def code_gen_string(self):
return str(self)
class LoopOpenStatement:
def __init__(self, cond):
self.cond = cond
def __str__(self):
return f'loop while( {self.cond} )'
def code_gen_string(self):
return f'repeat while ( {self.cond.code_gen_string()} )'
class LoopEndStatement(EndControlStatement):
def __init__(self):
super().__init__('repeat')
class LoopCounterIncrement:
def __init__(self, var):
self.var = var
def __str__(self):
return f'increment( {self.var.name} )'
def code_gen_string(self):
return f'{self.var.name}++'
class IfEndStatement(EndControlStatement):
def __init__(self):
super().__init__('if')
class IfControlStatement:
def __init__(self, expr):
self.expr = expr
def __str__(self):
return f'if( {self.expr} )'
def code_gen_string(self):
return f'if ({self.expr.code_gen_string()})'
class ElseifControlStatement:
def __init__(self, expr):
self.expr = expr
def __str__(self):
return f'elseif( {self.expr} )'
def code_gen_string(self):
return f'elseif ({self.expr.code_gen_string()})'
class ElseControlStatement:
def __str__(self):
return 'else'
def code_gen_string(self):
return str(self)
class SwitchOpenStatement:
def __init__(self, cond):
self.cond = cond
def __str__(self):
return f'switch ( {self.cond} ):'
def code_gen_string(self):
if isinstance(self.cond, str):
val = self.cond
else:
val = self.cond.code_gen_string()
return f'switch ({val})'
class SwitchCaseStatement:
def __init__(self, case_opt):
self.case_opt = case_opt
def __str__(self):
return f'case {self.case_opt.code_gen_string()}:'
def code_gen_string(self):
return str(self)
class SwitchEndStatement(EndControlStatement):
def __init__(self):
super().__init__('switch')
class SwitchBreakStatement(BreakStatement):
pass
class ReturnStatement:
def __str__(self):
return 'return'
def code_gen_string(self):
return str(self)
class GotoStatement:
def __init__(self, label):
self.label = label
def __str__(self):
return f'goto {self.label}'
def code_gen_string(self):
return str(self)
| class Propertyreference:
def __init__(self, var_name, property_name):
self.var_name = var_name
self.property_name = property_name
def __str__(self):
return f'{self.var_name}.{self.property_name}'
def code_gen_string(self):
return str(self)
class Functioncallargument:
def __init__(self, arg_type, value):
self.arg_type = arg_type
self.value = value
def __str__(self):
return f'{self.arg_type}: {self.value}'
def code_gen_string(self):
if isinstance(self.value, str) or isinstance(self.value, int) or isinstance(self.value, float):
return f'{self.value}'
return self.value.code_gen_string()
class Functioncall:
def __init__(self, name, args, result):
self.name = name
self.args = args
self.result = result
def __str__(self):
return_str = ''
args = ', '.join(map(str, self.args))
return f'{return_str}{self.name}({args})'
def code_gen_string(self):
args = ', '.join(map(lambda x: x.code_gen_string(), self.args))
return f'{self.name}({args})'
class Assignvariable:
def __init__(self, var_name, var_type, value):
self.var_name = var_name
self.var_type = var_type
self.value = value
def __str__(self):
val = self.value
if isinstance(val, list):
val = ', '.join(map(str, self.value))
return f'{self.var_type}: {self.var_name} = {val}'
def code_gen_string(self):
if isinstance(self.value, list):
val = f"[{', '.join(map(lambda x: x.code_gen_string(), self.value))}]"
elif isinstance(self.value, str):
val = self.value
else:
val = self.value.code_gen_string()
return f'{self.var_name} = {val}'
class Modifystring:
def __init__(self, insert_mode, int_val, str_val, obj):
self.insert_mode = insert_mode
self.int_val = int_val
self.str_val = str_val
self.obj = obj
def __str__(self):
return f'modify_string_59({self.insert_mode}, {self.int_val}, {self.str_val}, {self.obj})'
def code_gen_string(self):
return str(self)
class Binaryintermediate:
def __init__(self, op, left, right):
self.op = op
self.left = left
self.right = right
def __str__(self):
return f'{self.left} {self.op} {self.right}'
def code_gen_string(self):
return f'{self.left.code_gen_string()} {self.op} {self.right.code_gen_string()}'
class Unaryintermediate:
def __init__(self, operator, operand):
self.operator = operator
self.operand = operand
def __str__(self):
return f'{self.operator} {self.operand}'
def code_gen_string(self):
return f'{self.operator} {self.operand.code_gen_string()}'
class Endcontrolstatement:
def __init__(self, control_statement):
self.control_statement = control_statement
def __str__(self):
return f'end{self.control_statement}'
def code_gen_string(self):
return str(self)
class Breakstatement:
def __str__(self):
return 'break'
def code_gen_string(self):
return str(self)
class Loopopenstatement:
def __init__(self, cond):
self.cond = cond
def __str__(self):
return f'loop while( {self.cond} )'
def code_gen_string(self):
return f'repeat while ( {self.cond.code_gen_string()} )'
class Loopendstatement(EndControlStatement):
def __init__(self):
super().__init__('repeat')
class Loopcounterincrement:
def __init__(self, var):
self.var = var
def __str__(self):
return f'increment( {self.var.name} )'
def code_gen_string(self):
return f'{self.var.name}++'
class Ifendstatement(EndControlStatement):
def __init__(self):
super().__init__('if')
class Ifcontrolstatement:
def __init__(self, expr):
self.expr = expr
def __str__(self):
return f'if( {self.expr} )'
def code_gen_string(self):
return f'if ({self.expr.code_gen_string()})'
class Elseifcontrolstatement:
def __init__(self, expr):
self.expr = expr
def __str__(self):
return f'elseif( {self.expr} )'
def code_gen_string(self):
return f'elseif ({self.expr.code_gen_string()})'
class Elsecontrolstatement:
def __str__(self):
return 'else'
def code_gen_string(self):
return str(self)
class Switchopenstatement:
def __init__(self, cond):
self.cond = cond
def __str__(self):
return f'switch ( {self.cond} ):'
def code_gen_string(self):
if isinstance(self.cond, str):
val = self.cond
else:
val = self.cond.code_gen_string()
return f'switch ({val})'
class Switchcasestatement:
def __init__(self, case_opt):
self.case_opt = case_opt
def __str__(self):
return f'case {self.case_opt.code_gen_string()}:'
def code_gen_string(self):
return str(self)
class Switchendstatement(EndControlStatement):
def __init__(self):
super().__init__('switch')
class Switchbreakstatement(BreakStatement):
pass
class Returnstatement:
def __str__(self):
return 'return'
def code_gen_string(self):
return str(self)
class Gotostatement:
def __init__(self, label):
self.label = label
def __str__(self):
return f'goto {self.label}'
def code_gen_string(self):
return str(self) |
##Retrieve region of sequences delimited by a forward and reverse pattern
#v0.0.1
f = [ [x.split('\n')[0], ''.join(x.split('\n')[1:])] for x in open('gg-13-8-99.fasta', 'r').read().rstrip('\n').split('>') ][1:]
fw = ['AGAGTTTGATCMTGGCTCAG']
rv = ['GWATTACCGCGGCKGCTG']
mtol = 1
endstr = 3
w = open('ggmb.fa', 'w')
nl = []
print('Forward:' + fw[0])
print('Reverse:' + rv[0])
print('Mismatches tolerated:' + str(mtol))
print('3\' end stringency length:' + str(endstr))
def degenerate(primer):
r = []
for it in primer:
p = list(it)
for i in range(len(p)):
if p[i] == 'R':
r.append(''.join([p[x] if x!=i else 'A' for x in range(len(p))]))
r.append(''.join([p[x] if x!=i else 'G' for x in range(len(p))]))
break
if p[i] == 'Y':
r.append(''.join([p[x] if x!=i else 'C' for x in range(len(p))]))
r.append(''.join([p[x] if x!=i else 'T' for x in range(len(p))]))
break
if p[i] == 'S':
r.append(''.join([p[x] if x!=i else 'G' for x in range(len(p))]))
r.append(''.join([p[x] if x!=i else 'C' for x in range(len(p))]))
break
if p[i] == 'W':
r.append(''.join([p[x] if x!=i else 'A' for x in range(len(p))]))
r.append(''.join([p[x] if x!=i else 'T' for x in range(len(p))]))
break
if p[i] == 'K':
r.append(''.join([p[x] if x!=i else 'G' for x in range(len(p))]))
r.append(''.join([p[x] if x!=i else 'T' for x in range(len(p))]))
break
if p[i] == 'M':
r.append(''.join([p[x] if x!=i else 'A' for x in range(len(p))]))
r.append(''.join([p[x] if x!=i else 'C' for x in range(len(p))]))
break
if p[i] == 'B':
r.append(''.join([p[x] if x!=i else 'C' for x in range(len(p))]))
r.append(''.join([p[x] if x!=i else 'G' for x in range(len(p))]))
r.append(''.join([p[x] if x!=i else 'T' for x in range(len(p))]))
break
if p[i] == 'D':
r.append(''.join([p[x] if x!=i else 'A' for x in range(len(p))]))
r.append(''.join([p[x] if x!=i else 'G' for x in range(len(p))]))
r.append(''.join([p[x] if x!=i else 'T' for x in range(len(p))]))
break
if p[i] == 'H':
r.append(''.join([p[x] if x!=i else 'A' for x in range(len(p))]))
r.append(''.join([p[x] if x!=i else 'C' for x in range(len(p))]))
r.append(''.join([p[x] if x!=i else 'T' for x in range(len(p))]))
break
if p[i] == 'V':
r.append(''.join([p[x] if x!=i else 'A' for x in range(len(p))]))
r.append(''.join([p[x] if x!=i else 'C' for x in range(len(p))]))
r.append(''.join([p[x] if x!=i else 'G' for x in range(len(p))]))
break
if p[i] == 'N':
r.append(''.join([p[x] if x!=i else 'A' for x in range(len(p))]))
r.append(''.join([p[x] if x!=i else 'C' for x in range(len(p))]))
r.append(''.join([p[x] if x!=i else 'G' for x in range(len(p))]))
r.append(''.join([p[x] if x!=i else 'T' for x in range(len(p))]))
break
return r
def mismatch(primer):
r = []
for it in primer:
p = list(it)
for i in range(len(p) - endstr):
r.append(''.join([p[x] if x!=i else 'A' for x in range(len(p))]))
r.append(''.join([p[x] if x!=i else 'C' for x in range(len(p))]))
r.append(''.join([p[x] if x!=i else 'G' for x in range(len(p))]))
r.append(''.join([p[x] if x!=i else 'T' for x in range(len(p))]))
return r
a = ['A','C','G','T']
fwndeg = len([x for x in list(fw[0])if x not in a])
rvndeg = len([x for x in list(rv[0])if x not in a])
for i in range(fwndeg):
fw = degenerate(fw)
for i in range(rvndeg):
rv = degenerate(rv)
for i in range(mtol):
fw = mismatch(fw)
rv = mismatch(rv)
rv = [ x[::-1].replace('A','t').replace('C','g').replace('G','c').replace('T','a').upper() for x in rv ]
for it in f:
rt = ''
cut = 0
for i in range(len(it[1])-len(fw[0])):
if it[1][i:i+len(fw[0])] in fw:
rt = it[1][i:]
cut += 0
break
for i in range(len(rt)-len(rv[0])):
if rt[i:i+len(rv[0])] in rv:
rt = rt[:i+len(rv[0])]
cut += 2
break
if cut == 2:
nl.append([it[0], rt])
lnl = [len(x[1]) for x in nl]
print('Matches:' + str(len(nl))+ '/' + str(len(f)))
print('Min:' + str(min(lnl)))
print('Max:' + str(max(lnl)))
print('Mean:' + str(sum(lnl) / len(nl)))
print('Matches shorter than 300:' + str(len([x for x in lnl if x < 300])))
print('Matches longer than 580:' + str(len([x for x in lnl if x > 580])))
w.write('\n'.join(['>' + '\n'.join(x) for x in nl]))
w.close() | f = [[x.split('\n')[0], ''.join(x.split('\n')[1:])] for x in open('gg-13-8-99.fasta', 'r').read().rstrip('\n').split('>')][1:]
fw = ['AGAGTTTGATCMTGGCTCAG']
rv = ['GWATTACCGCGGCKGCTG']
mtol = 1
endstr = 3
w = open('ggmb.fa', 'w')
nl = []
print('Forward:' + fw[0])
print('Reverse:' + rv[0])
print('Mismatches tolerated:' + str(mtol))
print("3' end stringency length:" + str(endstr))
def degenerate(primer):
r = []
for it in primer:
p = list(it)
for i in range(len(p)):
if p[i] == 'R':
r.append(''.join([p[x] if x != i else 'A' for x in range(len(p))]))
r.append(''.join([p[x] if x != i else 'G' for x in range(len(p))]))
break
if p[i] == 'Y':
r.append(''.join([p[x] if x != i else 'C' for x in range(len(p))]))
r.append(''.join([p[x] if x != i else 'T' for x in range(len(p))]))
break
if p[i] == 'S':
r.append(''.join([p[x] if x != i else 'G' for x in range(len(p))]))
r.append(''.join([p[x] if x != i else 'C' for x in range(len(p))]))
break
if p[i] == 'W':
r.append(''.join([p[x] if x != i else 'A' for x in range(len(p))]))
r.append(''.join([p[x] if x != i else 'T' for x in range(len(p))]))
break
if p[i] == 'K':
r.append(''.join([p[x] if x != i else 'G' for x in range(len(p))]))
r.append(''.join([p[x] if x != i else 'T' for x in range(len(p))]))
break
if p[i] == 'M':
r.append(''.join([p[x] if x != i else 'A' for x in range(len(p))]))
r.append(''.join([p[x] if x != i else 'C' for x in range(len(p))]))
break
if p[i] == 'B':
r.append(''.join([p[x] if x != i else 'C' for x in range(len(p))]))
r.append(''.join([p[x] if x != i else 'G' for x in range(len(p))]))
r.append(''.join([p[x] if x != i else 'T' for x in range(len(p))]))
break
if p[i] == 'D':
r.append(''.join([p[x] if x != i else 'A' for x in range(len(p))]))
r.append(''.join([p[x] if x != i else 'G' for x in range(len(p))]))
r.append(''.join([p[x] if x != i else 'T' for x in range(len(p))]))
break
if p[i] == 'H':
r.append(''.join([p[x] if x != i else 'A' for x in range(len(p))]))
r.append(''.join([p[x] if x != i else 'C' for x in range(len(p))]))
r.append(''.join([p[x] if x != i else 'T' for x in range(len(p))]))
break
if p[i] == 'V':
r.append(''.join([p[x] if x != i else 'A' for x in range(len(p))]))
r.append(''.join([p[x] if x != i else 'C' for x in range(len(p))]))
r.append(''.join([p[x] if x != i else 'G' for x in range(len(p))]))
break
if p[i] == 'N':
r.append(''.join([p[x] if x != i else 'A' for x in range(len(p))]))
r.append(''.join([p[x] if x != i else 'C' for x in range(len(p))]))
r.append(''.join([p[x] if x != i else 'G' for x in range(len(p))]))
r.append(''.join([p[x] if x != i else 'T' for x in range(len(p))]))
break
return r
def mismatch(primer):
r = []
for it in primer:
p = list(it)
for i in range(len(p) - endstr):
r.append(''.join([p[x] if x != i else 'A' for x in range(len(p))]))
r.append(''.join([p[x] if x != i else 'C' for x in range(len(p))]))
r.append(''.join([p[x] if x != i else 'G' for x in range(len(p))]))
r.append(''.join([p[x] if x != i else 'T' for x in range(len(p))]))
return r
a = ['A', 'C', 'G', 'T']
fwndeg = len([x for x in list(fw[0]) if x not in a])
rvndeg = len([x for x in list(rv[0]) if x not in a])
for i in range(fwndeg):
fw = degenerate(fw)
for i in range(rvndeg):
rv = degenerate(rv)
for i in range(mtol):
fw = mismatch(fw)
rv = mismatch(rv)
rv = [x[::-1].replace('A', 't').replace('C', 'g').replace('G', 'c').replace('T', 'a').upper() for x in rv]
for it in f:
rt = ''
cut = 0
for i in range(len(it[1]) - len(fw[0])):
if it[1][i:i + len(fw[0])] in fw:
rt = it[1][i:]
cut += 0
break
for i in range(len(rt) - len(rv[0])):
if rt[i:i + len(rv[0])] in rv:
rt = rt[:i + len(rv[0])]
cut += 2
break
if cut == 2:
nl.append([it[0], rt])
lnl = [len(x[1]) for x in nl]
print('Matches:' + str(len(nl)) + '/' + str(len(f)))
print('Min:' + str(min(lnl)))
print('Max:' + str(max(lnl)))
print('Mean:' + str(sum(lnl) / len(nl)))
print('Matches shorter than 300:' + str(len([x for x in lnl if x < 300])))
print('Matches longer than 580:' + str(len([x for x in lnl if x > 580])))
w.write('\n'.join(['>' + '\n'.join(x) for x in nl]))
w.close() |
def say(message, times = 1):
print(message * times)
say('Hello', 4)
say('World', 4)
def func(a, b=5, c=10):
print('a is', a, 'and b is', b, 'and c is', c)
func(3)
func(3, c=13)
def maximum(x, y):
if x > y:
return x
elif x == y:
return 'The numbers are equal'
else:
return y
a = maximum(2, 3) + 5
print(a)
| def say(message, times=1):
print(message * times)
say('Hello', 4)
say('World', 4)
def func(a, b=5, c=10):
print('a is', a, 'and b is', b, 'and c is', c)
func(3)
func(3, c=13)
def maximum(x, y):
if x > y:
return x
elif x == y:
return 'The numbers are equal'
else:
return y
a = maximum(2, 3) + 5
print(a) |
"""Wrapper Exceptions"""
class ApiRequestFailed(Exception):
"""
Denotes a failure interacting with the API, such as the HTTP 4xx Series
"""
pass
class ApiRequest400(ApiRequestFailed):
"""
Denotes a HTTP 400 error while interacting with the API
"""
pass
class ImportDeleteError(ApiRequestFailed):
"""
The API call to mark an import as deleted did not complete correctly
"""
pass
class MemberChangeStatusError(ApiRequestFailed):
"""
The API call to change a member's status did not complete correctly
"""
pass
class MemberCopyToGroupError(ApiRequestFailed):
"""
The API call to copy members into a group did not complete correctly
"""
pass
class MemberDeleteError(ApiRequestFailed):
"""
The API call to delete a member did not complete correctly
"""
pass
class MemberDropGroupError(ApiRequestFailed):
"""
The API call to drop groups from a member did not complete correctly
"""
pass
class MemberUpdateError(ApiRequestFailed):
"""
The API call to update a member's information did not complete correctly
"""
pass
class GroupUpdateError(ApiRequestFailed):
"""
The API call to update a group's information did not complete correctly
"""
pass
class NoMemberEmailError(ApiRequestFailed):
"""
An API call was attempted with missing required parameters (email)
"""
pass
class NoMemberIdError(ApiRequestFailed):
"""
An API call was attempted with missing required parameters (member_id)
"""
pass
class NoMemberStatusError(ApiRequestFailed):
"""
An API call was attempted with missing required parameters (status)
"""
pass
class NoGroupIdError(ApiRequestFailed):
"""
An API call was attempted with missing required parameters (member_group_id)
"""
pass
class NoGroupNameError(ApiRequestFailed):
"""
An API call was attempted with missing required parameters (group_name)
"""
pass
class NoImportIdError(ApiRequestFailed):
"""
An API call was attempted with missing required parameters (import_id)
"""
pass
class NoFieldIdError(ApiRequestFailed):
"""
An API call was attempted with missing required parameters (field_id)
"""
pass
class NoMailingIdError(ApiRequestFailed):
"""
An API call was attempted with missing required parameters (mailing_id)
"""
pass
class NoSearchIdError(ApiRequestFailed):
"""
An API call was attempted with missing required parameters (search_id)
"""
pass
class NoTriggerIdError(ApiRequestFailed):
"""
An API call was attempted with missing required parameters (trigger_id)
"""
pass
class NoWebHookIdError(ApiRequestFailed):
"""
An API call was attempted with missing required parameters (webhook_id)
"""
pass
class ClearMemberFieldInformationError(ApiRequestFailed):
"""
An API call to clear member info from a field did not complete correctly
"""
pass
class MailingArchiveError(ApiRequestFailed):
"""
An API call to archive a mailing did not complete correctly
"""
pass
class MailingCancelError(ApiRequestFailed):
"""
An API call to cancel a mailing did not complete correctly
"""
pass
class MailingForwardError(ApiRequestFailed):
"""
An API call to forward a mailing did not complete correctly
"""
pass
class SyntaxValidationError(ApiRequestFailed):
"""
An API call to validate message syntax did not complete correctly
"""
pass
class WebHookDeleteError(ApiRequestFailed):
"""
An API call to delete a webhook did not complete correctly
"""
pass | """Wrapper Exceptions"""
class Apirequestfailed(Exception):
"""
Denotes a failure interacting with the API, such as the HTTP 4xx Series
"""
pass
class Apirequest400(ApiRequestFailed):
"""
Denotes a HTTP 400 error while interacting with the API
"""
pass
class Importdeleteerror(ApiRequestFailed):
"""
The API call to mark an import as deleted did not complete correctly
"""
pass
class Memberchangestatuserror(ApiRequestFailed):
"""
The API call to change a member's status did not complete correctly
"""
pass
class Membercopytogrouperror(ApiRequestFailed):
"""
The API call to copy members into a group did not complete correctly
"""
pass
class Memberdeleteerror(ApiRequestFailed):
"""
The API call to delete a member did not complete correctly
"""
pass
class Memberdropgrouperror(ApiRequestFailed):
"""
The API call to drop groups from a member did not complete correctly
"""
pass
class Memberupdateerror(ApiRequestFailed):
"""
The API call to update a member's information did not complete correctly
"""
pass
class Groupupdateerror(ApiRequestFailed):
"""
The API call to update a group's information did not complete correctly
"""
pass
class Nomemberemailerror(ApiRequestFailed):
"""
An API call was attempted with missing required parameters (email)
"""
pass
class Nomemberiderror(ApiRequestFailed):
"""
An API call was attempted with missing required parameters (member_id)
"""
pass
class Nomemberstatuserror(ApiRequestFailed):
"""
An API call was attempted with missing required parameters (status)
"""
pass
class Nogroupiderror(ApiRequestFailed):
"""
An API call was attempted with missing required parameters (member_group_id)
"""
pass
class Nogroupnameerror(ApiRequestFailed):
"""
An API call was attempted with missing required parameters (group_name)
"""
pass
class Noimportiderror(ApiRequestFailed):
"""
An API call was attempted with missing required parameters (import_id)
"""
pass
class Nofieldiderror(ApiRequestFailed):
"""
An API call was attempted with missing required parameters (field_id)
"""
pass
class Nomailingiderror(ApiRequestFailed):
"""
An API call was attempted with missing required parameters (mailing_id)
"""
pass
class Nosearchiderror(ApiRequestFailed):
"""
An API call was attempted with missing required parameters (search_id)
"""
pass
class Notriggeriderror(ApiRequestFailed):
"""
An API call was attempted with missing required parameters (trigger_id)
"""
pass
class Nowebhookiderror(ApiRequestFailed):
"""
An API call was attempted with missing required parameters (webhook_id)
"""
pass
class Clearmemberfieldinformationerror(ApiRequestFailed):
"""
An API call to clear member info from a field did not complete correctly
"""
pass
class Mailingarchiveerror(ApiRequestFailed):
"""
An API call to archive a mailing did not complete correctly
"""
pass
class Mailingcancelerror(ApiRequestFailed):
"""
An API call to cancel a mailing did not complete correctly
"""
pass
class Mailingforwarderror(ApiRequestFailed):
"""
An API call to forward a mailing did not complete correctly
"""
pass
class Syntaxvalidationerror(ApiRequestFailed):
"""
An API call to validate message syntax did not complete correctly
"""
pass
class Webhookdeleteerror(ApiRequestFailed):
"""
An API call to delete a webhook did not complete correctly
"""
pass |
# write program reading an integer from standard input - a
# printing sum of squares of natural numbers smaller than a
# for example, for a=4, result = 1*1 + 2*2 + 3*3 = 14
a = int(input("pass a - "))
element = 1
result = 0
while element < a:
result = result + element * element
element = element + 1
print("result = " + str(result))
| a = int(input('pass a - '))
element = 1
result = 0
while element < a:
result = result + element * element
element = element + 1
print('result = ' + str(result)) |
# implement strip() to remove the white spaces in the head and tail of a string.
def strip(s):
while len(s) != 0 and (s[0] == ' ' or s[-1] == ' '):
s = s[1:] if s[0] == ' ' else s
s = s[:-1] if s[-1] == ' ' else s
return s
if __name__ == "__main__":
if strip('hello ') != 'hello':
print('fail!')
elif strip(' hello') != 'hello':
print('fail!')
elif strip(' hello ') != 'hello':
print('fail!')
elif strip(' hello world ') != 'hello world':
print('fail!')
elif strip('') != '':
print('fail!')
elif strip(' ') != '':
print('fail!')
else:
print('success!')
| def strip(s):
while len(s) != 0 and (s[0] == ' ' or s[-1] == ' '):
s = s[1:] if s[0] == ' ' else s
s = s[:-1] if s[-1] == ' ' else s
return s
if __name__ == '__main__':
if strip('hello ') != 'hello':
print('fail!')
elif strip(' hello') != 'hello':
print('fail!')
elif strip(' hello ') != 'hello':
print('fail!')
elif strip(' hello world ') != 'hello world':
print('fail!')
elif strip('') != '':
print('fail!')
elif strip(' ') != '':
print('fail!')
else:
print('success!') |
a = [1,2,3,4,5]
k =2
del a[0]
for i in range(0,len(a)):
print(a[i])
| a = [1, 2, 3, 4, 5]
k = 2
del a[0]
for i in range(0, len(a)):
print(a[i]) |
# Copyright (c) 2018 Lotus Load
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
load("@io_bazel_rules_docker//go:image.bzl", "go_image")
load("@io_bazel_rules_docker//container:container.bzl", "container_bundle")
load("@io_bazel_rules_docker//contrib:push-all.bzl", "docker_push")
def app_image(name, binary, repository, **kwargs):
go_image(
name = "image",
binary = binary,
**kwargs)
container_bundle(
name = "bundle",
images = {
"$(DOCKER_REGISTRY)/%s:{STABLE_GIT_COMMIT}" % repository: ":image",
"$(DOCKER_REGISTRY)/%s:{STABLE_GIT_COMMIT_FULL}" % repository: ":image",
},
)
docker_push(
name = "push",
bundle = ":bundle",
**kwargs)
| load('@io_bazel_rules_docker//go:image.bzl', 'go_image')
load('@io_bazel_rules_docker//container:container.bzl', 'container_bundle')
load('@io_bazel_rules_docker//contrib:push-all.bzl', 'docker_push')
def app_image(name, binary, repository, **kwargs):
go_image(name='image', binary=binary, **kwargs)
container_bundle(name='bundle', images={'$(DOCKER_REGISTRY)/%s:{STABLE_GIT_COMMIT}' % repository: ':image', '$(DOCKER_REGISTRY)/%s:{STABLE_GIT_COMMIT_FULL}' % repository: ':image'})
docker_push(name='push', bundle=':bundle', **kwargs) |
"""
Exceptions
----------
"""
class FactoryException(Exception):
"""General exception for a factory being not able to produce a penalty model."""
class ImpossiblePenaltyModel(FactoryException):
"""PenaltyModel is impossible to build."""
class MissingPenaltyModel(FactoryException):
"""PenaltyModel is missing from the cache or otherwise unavailable."""
| """
Exceptions
----------
"""
class Factoryexception(Exception):
"""General exception for a factory being not able to produce a penalty model."""
class Impossiblepenaltymodel(FactoryException):
"""PenaltyModel is impossible to build."""
class Missingpenaltymodel(FactoryException):
"""PenaltyModel is missing from the cache or otherwise unavailable.""" |
# working-with-Data-structure
#union
def union(set1,set2):
return set(set1)&(set2)
# driver code
Set1={0,2,3,4,5,6,8}
Set2={1,2,3,4,5}
Print(union(set1,set2))
#intersection
def intersection(set1,set2):
return set(set1)&(set2)
#driver code
Set1={0,2,4,6,8}
Set2={1,2,4,4,5}
Print(intersection(set1,set2))
#difference
Set1={0,2,3,4,5,6,8}
Set2={1,2,3,4,5}
Set_difference=(set1)-(set2)
Set_difference=set(set_difference)
Print(set_difference)
#python code to find the symmetric_difference
#use of symmetric_difference()method
Set_A={0,2,4,6,8}
Set_B={1,2,3,4,5}
Print(set_A,symmetric_difference(set_B))
| def union(set1, set2):
return set(set1) & set2
set1 = {0, 2, 3, 4, 5, 6, 8}
set2 = {1, 2, 3, 4, 5}
print(union(set1, set2))
def intersection(set1, set2):
return set(set1) & set2
set1 = {0, 2, 4, 6, 8}
set2 = {1, 2, 4, 4, 5}
print(intersection(set1, set2))
set1 = {0, 2, 3, 4, 5, 6, 8}
set2 = {1, 2, 3, 4, 5}
set_difference = set1 - set2
set_difference = set(set_difference)
print(set_difference)
set_a = {0, 2, 4, 6, 8}
set_b = {1, 2, 3, 4, 5}
print(set_A, symmetric_difference(set_B)) |
class Qint(int):
def __init__(self, num):
self.qkey = None
self.parent = None
self.parental_id = None
self.name = None
self._qint = True
| class Qint(int):
def __init__(self, num):
self.qkey = None
self.parent = None
self.parental_id = None
self.name = None
self._qint = True |
def testDoc():
"""
Test __doc__
"""
pass
print(abs.__doc__)
print(help(abs))
print(int.__doc__)
print(testDoc.__doc__)
print(help(testDoc))
| def test_doc():
"""
Test __doc__
"""
pass
print(abs.__doc__)
print(help(abs))
print(int.__doc__)
print(testDoc.__doc__)
print(help(testDoc)) |
#!/usr/bin/env python
# Analyse des accidents corporels de la circulation a partir des fichiers csv open data
# - telecharger les fichiers csv depuis :
# https://www.data.gouv.fr/en/datasets/bases-de-donnees-annuelles-des-accidents-corporels-de-la-circulation-routiere-annees-de-2005-a-2019/
# - changer la commune et l'annee :
commune = '92012'
annee = 2019
id_acc = []
accidents = {}
gravite = {'1' : 'indemne', '2' : 'tue', '3' : 'grave', '4' : 'leger'}
def get_header(line):
h = line.rstrip().replace('"', '').split(';')
h = dict(zip(h, range(len(h))))
return h
with open('caracteristiques-' + str(annee) + '.csv') as f:
head = get_header(f.readline())
for l in f:
data = l.rstrip().replace('"', '').split(';')
try:
com = data[head['com']]
except:
break
if com == commune:
Num_Acc = data[head['Num_Acc']]
id_acc.append(Num_Acc)
accidents[Num_Acc] = {}
accidents[Num_Acc]['lat'] = data[head['lat']].replace(',','.')
accidents[Num_Acc]['long'] = data[head['long']].replace(',','.')
accidents[Num_Acc]['usagers'] = []
accidents[Num_Acc]['catv'] = []
#print id_acc
velos = []
with open('vehicules-' + str(annee) + '.csv') as f:
head = get_header(f.readline())
for l in f:
data = l.rstrip().replace('"', '').split(';')
try:
Num_Acc = data[head['Num_Acc']]
except:
break
if not Num_Acc in id_acc:
continue
catv = data[head['catv']]
id_vehicule = data[head['id_vehicule']]
accidents[Num_Acc]['catv'].append(catv)
if catv == '1' or catv == '80':
velos.append(id_vehicule)
cyclistes = []
with open('usagers-' + str(annee) + '.csv') as f:
head = get_header(f.readline())
for l in f:
data = l.rstrip().replace('"', '').split(';')
try:
Num_Acc = data[head['Num_Acc']]
except:
break
if not Num_Acc in id_acc:
continue
catu = data[head['catu']]
grav = gravite[data[head['grav']]]
id_vehicule = data[head['id_vehicule']]
accidents[Num_Acc]['usagers'].append([catu, grav])
if id_vehicule in velos and catu != '3':
cyclistes.append([Num_Acc, grav])
#print accidents
with open('pietons.csv', 'w') as f:
f.write("lat,long,grav,catv\n")
for v in accidents.values():
catv = v['catv']
if '1' in catv or '80' in catv:
catv = 'velo'
else:
catv = 'vehicule'
for u in v['usagers']:
if u[0] == '3':
f.write('%s,%s,%s,%s\n' % (v['lat'], v['long'],u[1],catv))
with open('cyclistes.csv', 'w') as f:
f.write("lat,long,grav\n")
for Num_Acc, grav in cyclistes:
v = accidents[Num_Acc]
f.write('%s,%s,%s\n' % (v['lat'], v['long'],grav))
| commune = '92012'
annee = 2019
id_acc = []
accidents = {}
gravite = {'1': 'indemne', '2': 'tue', '3': 'grave', '4': 'leger'}
def get_header(line):
h = line.rstrip().replace('"', '').split(';')
h = dict(zip(h, range(len(h))))
return h
with open('caracteristiques-' + str(annee) + '.csv') as f:
head = get_header(f.readline())
for l in f:
data = l.rstrip().replace('"', '').split(';')
try:
com = data[head['com']]
except:
break
if com == commune:
num__acc = data[head['Num_Acc']]
id_acc.append(Num_Acc)
accidents[Num_Acc] = {}
accidents[Num_Acc]['lat'] = data[head['lat']].replace(',', '.')
accidents[Num_Acc]['long'] = data[head['long']].replace(',', '.')
accidents[Num_Acc]['usagers'] = []
accidents[Num_Acc]['catv'] = []
velos = []
with open('vehicules-' + str(annee) + '.csv') as f:
head = get_header(f.readline())
for l in f:
data = l.rstrip().replace('"', '').split(';')
try:
num__acc = data[head['Num_Acc']]
except:
break
if not Num_Acc in id_acc:
continue
catv = data[head['catv']]
id_vehicule = data[head['id_vehicule']]
accidents[Num_Acc]['catv'].append(catv)
if catv == '1' or catv == '80':
velos.append(id_vehicule)
cyclistes = []
with open('usagers-' + str(annee) + '.csv') as f:
head = get_header(f.readline())
for l in f:
data = l.rstrip().replace('"', '').split(';')
try:
num__acc = data[head['Num_Acc']]
except:
break
if not Num_Acc in id_acc:
continue
catu = data[head['catu']]
grav = gravite[data[head['grav']]]
id_vehicule = data[head['id_vehicule']]
accidents[Num_Acc]['usagers'].append([catu, grav])
if id_vehicule in velos and catu != '3':
cyclistes.append([Num_Acc, grav])
with open('pietons.csv', 'w') as f:
f.write('lat,long,grav,catv\n')
for v in accidents.values():
catv = v['catv']
if '1' in catv or '80' in catv:
catv = 'velo'
else:
catv = 'vehicule'
for u in v['usagers']:
if u[0] == '3':
f.write('%s,%s,%s,%s\n' % (v['lat'], v['long'], u[1], catv))
with open('cyclistes.csv', 'w') as f:
f.write('lat,long,grav\n')
for (num__acc, grav) in cyclistes:
v = accidents[Num_Acc]
f.write('%s,%s,%s\n' % (v['lat'], v['long'], grav)) |
# n = int(input('Enter the number of time you want to display Hello World!'))
# i = 0
##While Loop
# while i < n :
# print('Hello World\n')
# x += 1
n = input('Enter a number: ')
#Check if the input is empty
if n == "":
print('Nothing to display')
else:
#For Loop
for i in range(int(n)):
print('Hello World!') | n = input('Enter a number: ')
if n == '':
print('Nothing to display')
else:
for i in range(int(n)):
print('Hello World!') |
"""
Datos de entrada
nombre-->nom-->string
monto_comra-->mc-->float
Datos de salida
nombre-->nom-->string
monto_compra-->mp-->float
monto_pagar-->mg-->float
descuento-->de-->float
"""
#Entrada
nom=str(input("Ingrese nombre del cliente: "))
mc=float(input("Ingrese el monto de compra: "))
#Caja negra
if(mc<50000):
mg=mc
de=0
elif(mc>50000) and (mc<=100000):
mgg=mc*0.05
mg=mc-mgg
de=0.05*100
elif(mc>100000) and (mc<=700000):
mgg=mc*0.11
mg=mc-mgg
de=0.11*100
elif(mc>700000) and (mc<=1500000):
mgg=mc*0.18
mg=mc-mgg
de=0.18*100
elif(mc>1500000):
mgg=mc*0.25
mg=mc-mgg
de=0.35*100
#Salida
print("Nombre del cliente: ", nom)
print("El monto de compra es: ", mc)
print("El monto a pagar es: ", mg)
print(f"El descuento fue de: {de}%") | """
Datos de entrada
nombre-->nom-->string
monto_comra-->mc-->float
Datos de salida
nombre-->nom-->string
monto_compra-->mp-->float
monto_pagar-->mg-->float
descuento-->de-->float
"""
nom = str(input('Ingrese nombre del cliente: '))
mc = float(input('Ingrese el monto de compra: '))
if mc < 50000:
mg = mc
de = 0
elif mc > 50000 and mc <= 100000:
mgg = mc * 0.05
mg = mc - mgg
de = 0.05 * 100
elif mc > 100000 and mc <= 700000:
mgg = mc * 0.11
mg = mc - mgg
de = 0.11 * 100
elif mc > 700000 and mc <= 1500000:
mgg = mc * 0.18
mg = mc - mgg
de = 0.18 * 100
elif mc > 1500000:
mgg = mc * 0.25
mg = mc - mgg
de = 0.35 * 100
print('Nombre del cliente: ', nom)
print('El monto de compra es: ', mc)
print('El monto a pagar es: ', mg)
print(f'El descuento fue de: {de}%') |
class MenuItem:
pass
# Buat instance untuk class MenuItem
menu_item1 = MenuItem()
| class Menuitem:
pass
menu_item1 = menu_item() |
# Copyright 2020 Rubrik, Inc.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to
# deal in the Software without restriction, including without limitation the
# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
# sell copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
# DEALINGS IN THE SOFTWARE.
"""
Collection of methods for sonar on demand scan
"""
ERROR_MESSAGES = {
'MISSING_PARAMETERS_IN_SCAN': 'scan_name, resources, and analyzer_groups fields are required.',
'MISSING_PARAMETERS_IN_SCAN_STATUS': 'crawl_id field is required.',
'MISSING_PARAMETERS_IN_SCAN_RESULT': 'crawl_id and filters fields are required.',
"INVALID_FILE_TYPE": "'{}' is an invalid value for 'file type'. Value must be in {}."
}
def trigger_on_demand_scan(self, scan_name, resources, analyzer_groups):
"""
Trigger an on-demand scan of a system (specifying policies to search for).
Args:
scan_name (str): Name of the scan.
analyzer_groups (list): List of sonar policy analyzer groups.
resources (list): List of object IDs to scan.
Returns:
dict: Response from the API.
Raises:
ValueError: If input is invalid
RequestException: If the query to Polaris returned an error
"""
try:
if not scan_name or not resources or not analyzer_groups:
raise ValueError(ERROR_MESSAGES['MISSING_PARAMETERS_IN_SCAN'])
query_name = "sonar_on_demand_scan"
variables = {
"crawlName": scan_name,
"resources": resources,
"analyzerGroups": analyzer_groups
}
query = self._query_raw(query_name=query_name, variables=variables)
return query
except Exception:
raise
def get_on_demand_scan_status(self, crawl_id):
"""Retrieve the list of scan status details.
Args:
crawl_id (str): ID for which scan status is to be obtained.
Returns:
dict: Dictionary of list of scan status details.
Raises:
ValueError: If input is invalid
RequestException: If the query to Polaris returned an error.
"""
try:
if not crawl_id:
raise ValueError(ERROR_MESSAGES['MISSING_PARAMETERS_IN_SCAN_STATUS'])
query_name = "sonar_on_demand_scan_status"
variables = {
"crawlId": crawl_id
}
response = self._query_raw(query_name=query_name, variables=variables)
return response
except Exception:
raise
def get_on_demand_scan_result(self, crawl_id, filters):
"""
Retrieve the download link for the requested scanned file.
Args:
crawl_id (str): ID for which file needs to be downloaded.
filters (dict): Dictionary of filter containing file type.
Returns:
dict: Dictionary containing download link for the result file.
Raises:
ValueError: If input is invalid
RequestException: If the query to Polaris returned an error.
"""
try:
if not crawl_id or not filters:
raise ValueError(ERROR_MESSAGES['MISSING_PARAMETERS_IN_SCAN_RESULT'])
file_type = filters.get('fileType')
file_type_enum = self.get_enum_values(name="FileCountTypeEnum")
if file_type not in file_type_enum:
raise ValueError(ERROR_MESSAGES['INVALID_FILE_TYPE'].format(file_type, file_type_enum))
query_name = "sonar_on_demand_scan_result"
variables = {
"crawlId": crawl_id,
"filter": filters
}
query = self._query_raw(query_name=query_name, variables=variables)
return query
except Exception:
raise
| """
Collection of methods for sonar on demand scan
"""
error_messages = {'MISSING_PARAMETERS_IN_SCAN': 'scan_name, resources, and analyzer_groups fields are required.', 'MISSING_PARAMETERS_IN_SCAN_STATUS': 'crawl_id field is required.', 'MISSING_PARAMETERS_IN_SCAN_RESULT': 'crawl_id and filters fields are required.', 'INVALID_FILE_TYPE': "'{}' is an invalid value for 'file type'. Value must be in {}."}
def trigger_on_demand_scan(self, scan_name, resources, analyzer_groups):
"""
Trigger an on-demand scan of a system (specifying policies to search for).
Args:
scan_name (str): Name of the scan.
analyzer_groups (list): List of sonar policy analyzer groups.
resources (list): List of object IDs to scan.
Returns:
dict: Response from the API.
Raises:
ValueError: If input is invalid
RequestException: If the query to Polaris returned an error
"""
try:
if not scan_name or not resources or (not analyzer_groups):
raise value_error(ERROR_MESSAGES['MISSING_PARAMETERS_IN_SCAN'])
query_name = 'sonar_on_demand_scan'
variables = {'crawlName': scan_name, 'resources': resources, 'analyzerGroups': analyzer_groups}
query = self._query_raw(query_name=query_name, variables=variables)
return query
except Exception:
raise
def get_on_demand_scan_status(self, crawl_id):
"""Retrieve the list of scan status details.
Args:
crawl_id (str): ID for which scan status is to be obtained.
Returns:
dict: Dictionary of list of scan status details.
Raises:
ValueError: If input is invalid
RequestException: If the query to Polaris returned an error.
"""
try:
if not crawl_id:
raise value_error(ERROR_MESSAGES['MISSING_PARAMETERS_IN_SCAN_STATUS'])
query_name = 'sonar_on_demand_scan_status'
variables = {'crawlId': crawl_id}
response = self._query_raw(query_name=query_name, variables=variables)
return response
except Exception:
raise
def get_on_demand_scan_result(self, crawl_id, filters):
"""
Retrieve the download link for the requested scanned file.
Args:
crawl_id (str): ID for which file needs to be downloaded.
filters (dict): Dictionary of filter containing file type.
Returns:
dict: Dictionary containing download link for the result file.
Raises:
ValueError: If input is invalid
RequestException: If the query to Polaris returned an error.
"""
try:
if not crawl_id or not filters:
raise value_error(ERROR_MESSAGES['MISSING_PARAMETERS_IN_SCAN_RESULT'])
file_type = filters.get('fileType')
file_type_enum = self.get_enum_values(name='FileCountTypeEnum')
if file_type not in file_type_enum:
raise value_error(ERROR_MESSAGES['INVALID_FILE_TYPE'].format(file_type, file_type_enum))
query_name = 'sonar_on_demand_scan_result'
variables = {'crawlId': crawl_id, 'filter': filters}
query = self._query_raw(query_name=query_name, variables=variables)
return query
except Exception:
raise |
"""This module demonstrates usage of if-else statements, while loop and break."""
def calculate_grade(grade):
"""Function that calculates final grades based on points earned."""
if grade >= 90:
if grade == 100:
return 'A+'
return 'A'
if grade >= 80:
return 'B'
if grade >= 70:
return 'C'
return 'F'
if __name__ == '__main__':
while True:
grade_str = input('Number of points (<ENTER> for END): ')
if len(grade_str) == 0:
break
points = int(grade_str)
print(calculate_grade(points))
print('Good Bye!')
| """This module demonstrates usage of if-else statements, while loop and break."""
def calculate_grade(grade):
"""Function that calculates final grades based on points earned."""
if grade >= 90:
if grade == 100:
return 'A+'
return 'A'
if grade >= 80:
return 'B'
if grade >= 70:
return 'C'
return 'F'
if __name__ == '__main__':
while True:
grade_str = input('Number of points (<ENTER> for END): ')
if len(grade_str) == 0:
break
points = int(grade_str)
print(calculate_grade(points))
print('Good Bye!') |
"""
Write a Python program to get variable unique identification number or string.
"""
x = 100
print(format(id(x), "x")) | """
Write a Python program to get variable unique identification number or string.
"""
x = 100
print(format(id(x), 'x')) |
class FederationClientServiceVariables:
def __init__(self):
self.FederationClientServiceStatus = ''
self.FederationClientServicePort = 9000
self.FederationClientServiceIP = None | class Federationclientservicevariables:
def __init__(self):
self.FederationClientServiceStatus = ''
self.FederationClientServicePort = 9000
self.FederationClientServiceIP = None |
class Format:
def skip(self, line):
False
def before(self, line):
return s, None
def after(self, line, data):
return s
class fastText(Format):
LABEL_PREFIX = '__label__'
def before(self, line):
labels = []
_ = []
for w in line.split(' '):
if w.startswith(fastText.LABEL_PREFIX):
labels.append(w)
else:
_.append(w)
return ' '.join(_), labels
def after(self, line, data):
return ' '.join(data) + ' ' + line
| class Format:
def skip(self, line):
False
def before(self, line):
return (s, None)
def after(self, line, data):
return s
class Fasttext(Format):
label_prefix = '__label__'
def before(self, line):
labels = []
_ = []
for w in line.split(' '):
if w.startswith(fastText.LABEL_PREFIX):
labels.append(w)
else:
_.append(w)
return (' '.join(_), labels)
def after(self, line, data):
return ' '.join(data) + ' ' + line |
# Time complexity: O(n)
# Approach: Backtracking. Similar to DP 2D array solution.
class Solution:
def findIp(self, s, index, i, tmp, ans):
if i==4:
if index >= len(s):
ans.append(tmp[1:])
return
if index >= len(s):
return
if s[index]=='0':
self.findIp(s, index+1, i+1, tmp+'.'+s[index], ans)
else:
if int(s[index])>=0 and int(s[index])<=255:
self.findIp(s, index+1, i+1, tmp+'.'+s[index], ans)
if index+2<=len(s) and int(s[index:index+2])>=0 and int(s[index:index+2])<=255:
self.findIp(s, index+2, i+1, tmp+'.'+s[index:index+2], ans)
if index+3<=len(s) and int(s[index:index+3])>=0 and int(s[index:index+3])<=255:
self.findIp(s, index+3, i+1, tmp+'.'+s[index:index+3], ans)
def restoreIpAddresses(self, s: str) -> List[str]:
ans = []
self.findIp(s, 0, 0, "", ans)
return ans | class Solution:
def find_ip(self, s, index, i, tmp, ans):
if i == 4:
if index >= len(s):
ans.append(tmp[1:])
return
if index >= len(s):
return
if s[index] == '0':
self.findIp(s, index + 1, i + 1, tmp + '.' + s[index], ans)
else:
if int(s[index]) >= 0 and int(s[index]) <= 255:
self.findIp(s, index + 1, i + 1, tmp + '.' + s[index], ans)
if index + 2 <= len(s) and int(s[index:index + 2]) >= 0 and (int(s[index:index + 2]) <= 255):
self.findIp(s, index + 2, i + 1, tmp + '.' + s[index:index + 2], ans)
if index + 3 <= len(s) and int(s[index:index + 3]) >= 0 and (int(s[index:index + 3]) <= 255):
self.findIp(s, index + 3, i + 1, tmp + '.' + s[index:index + 3], ans)
def restore_ip_addresses(self, s: str) -> List[str]:
ans = []
self.findIp(s, 0, 0, '', ans)
return ans |
# Just to implement while loop
answer = 'no'
while answer != 'yes':
answer = input( 'Are you done?' )
print( 'Finally Exited.' );
| answer = 'no'
while answer != 'yes':
answer = input('Are you done?')
print('Finally Exited.') |
base_tree = [{
'url_delete': 'http://example.com/adminpages/delete/id/1',
'list_of_pk': ('["id", 1]', ),
'id': 1,
'label': u'Hello Traversal World!',
'url_update': 'http://example.com/adminpages/update/id/1',
'children': [{
'url_delete': 'http://example.com/adminpages/delete/id/2',
'list_of_pk': ('["id", 2]', ),
'id': 2,
'label': u'We \u2665 gevent',
'url_update': 'http://example.com/adminpages/update/id/2',
'children': [{
'url_delete': 'http://example.com/adminpages/delete/id/3',
'list_of_pk': ('["id", 3]', ),
'id': 3,
'label': u'And Pyramid',
'url_update': 'http://example.com/adminpages/update/id/3',
'children': [{
'url_delete': 'http://example.com/adminpages/delete/id/12',
'list_of_pk': ('["id", 12]', ),
'id': 12,
'label': u'and aiohttp!',
'url_update': 'http://example.com/adminpages/update/id/12',
'children': [{
'url_delete': 'http://example.com/adminpages/delete/id/14',
'list_of_pk': ('["id", 14]', ),
'id': 14,
'label': u'and beer!',
'url_update': 'http://example.com/adminpages/update/id/14',
'children': [{
'url_delete': 'http://example.com/adminpages/delete/id/15',
'url_update': 'http://example.com/adminpages/update/id/15',
'id': 15,
'list_of_pk': ('["id", 15]', ),
'label': u'and bear to!'
}]
}]
}, {
'url_delete': 'http://example.com/adminpages/delete/id/13',
'url_update': 'http://example.com/adminpages/update/id/13',
'id': 13,
'list_of_pk': ('["id", 13]', ),
'label': u'and asyncio!'
}]
}]
}, {
'url_delete': 'http://example.com/adminpages/delete/id/4',
'list_of_pk': ('["id", 4]', ),
'id': 4,
'label': u'Redirect 301 to we-love-gevent',
'url_update': 'http://example.com/adminpages/update/id/4',
'children': [{
'url_delete': 'http://example.com/adminpages/delete/id/5',
'url_update': 'http://example.com/adminpages/update/id/5',
'id': 5,
'list_of_pk': ('["id", 5]', ),
'label': u'Redirect 200 to about-company'
}, {
'url_delete': 'http://example.com/adminpages/delete/id/6',
'url_update': 'http://example.com/adminpages/update/id/6',
'id': 6,
'list_of_pk': ('["id", 6]', ),
'label': u'\u041a\u043e\u043c\u043f\u0430\u043d\u0438\u044f ITCase'
}]
}, {
'url_delete': 'http://example.com/adminpages/delete/id/7',
'list_of_pk': ('["id", 7]', ),
'id': 7,
'label': u'Our strategy',
'url_update': 'http://example.com/adminpages/update/id/7',
'children': [{
'url_delete': 'http://example.com/adminpages/delete/id/8',
'list_of_pk': ('["id", 8]', ),
'id': 8,
'label': u'Wordwide',
'url_update': 'http://example.com/adminpages/update/id/8',
'children': [{
'url_delete': 'http://example.com/adminpages/delete/id/9',
'url_update': 'http://example.com/adminpages/update/id/9',
'id': 9,
'list_of_pk': ('["id", 9]', ),
'label': u'Technology'
}]
}, {
'url_delete': 'http://example.com/adminpages/delete/id/10',
'list_of_pk': ('["id", 10]', ),
'id': 10,
'label': u'What we do',
'url_update': 'http://example.com/adminpages/update/id/10',
'children': [{
'url_delete': 'http://example.com/adminpages/delete/id/11',
'url_update': 'http://example.com/adminpages/update/id/11',
'id': 11,
'list_of_pk': ('["id", 11]', ),
'label': u'at a glance'
}]
}]
}]
}, {
'url_delete': 'http://example.com/adminpages/delete/id/100',
'list_of_pk': ('["id", 100]', ),
'id': 100,
'label': u'Countries',
'url_update': 'http://example.com/adminpages/update/id/100',
'children': [{
'url_delete': 'http://example.com/adminpages/delete/id/101',
'list_of_pk': ('["id", 101]', ),
'id': 101,
'label': u'Africa',
'url_update': 'http://example.com/adminpages/update/id/101',
'children': [{
'url_delete': 'http://example.com/adminpages/delete/id/102',
'url_update': 'http://example.com/adminpages/update/id/102',
'id': 102,
'list_of_pk': ('["id", 102]', ),
'label': u'Algeria'
}, {
'url_delete': 'http://example.com/adminpages/delete/id/103',
'url_update': 'http://example.com/adminpages/update/id/103',
'id': 103,
'list_of_pk': ('["id", 103]', ),
'label': u'Marocco'
}, {
'url_delete': 'http://example.com/adminpages/delete/id/104',
'url_update': 'http://example.com/adminpages/update/id/104',
'id': 104,
'list_of_pk': ('["id", 104]', ),
'label': u'Libya'
}, {
'url_delete': 'http://example.com/adminpages/delete/id/105',
'url_update': 'http://example.com/adminpages/update/id/105',
'id': 105,
'list_of_pk': ('["id", 105]', ),
'label': u'Somalia'
}, {
'url_delete': 'http://example.com/adminpages/delete/id/106',
'url_update': 'http://example.com/adminpages/update/id/106',
'id': 106,
'list_of_pk': ('["id", 106]', ),
'label': u'Kenya'
}, {
'url_delete': 'http://example.com/adminpages/delete/id/107',
'url_update': 'http://example.com/adminpages/update/id/107',
'id': 107,
'list_of_pk': ('["id", 107]', ),
'label': u'Mauritania'
}, {
'url_delete': 'http://example.com/adminpages/delete/id/108',
'url_update': 'http://example.com/adminpages/update/id/108',
'id': 108,
'list_of_pk': ('["id", 108]', ),
'label': u'South Africa'
}]
}, {
'url_delete': 'http://example.com/adminpages/delete/id/200',
'list_of_pk': ('["id", 200]', ),
'id': 200,
'label': u'America',
'url_update': 'http://example.com/adminpages/update/id/200',
'children': [{
'url_delete': 'http://example.com/adminpages/delete/id/201',
'list_of_pk': ('["id", 201]', ),
'id': 201,
'label': u'North-America',
'url_update': 'http://example.com/adminpages/update/id/201',
'children': [{
'url_delete': 'http://example.com/adminpages/delete/id/202',
'url_update': 'http://example.com/adminpages/update/id/202',
'id': 202,
'list_of_pk': ('["id", 202]', ),
'label': u'Canada'
}, {
'url_delete': 'http://example.com/adminpages/delete/id/203',
'url_update': 'http://example.com/adminpages/update/id/203',
'id': 203,
'list_of_pk': ('["id", 203]', ),
'label': u'USA'
}]
}, {
'url_delete': 'http://example.com/adminpages/delete/id/300',
'list_of_pk': ('["id", 300]', ),
'id': 300,
'label': u'Middle-America',
'url_update': 'http://example.com/adminpages/update/id/300',
'children': [{
'url_delete': 'http://example.com/adminpages/delete/id/301',
'url_update': 'http://example.com/adminpages/update/id/301',
'id': 301,
'list_of_pk': ('["id", 301]', ),
'label': u'Mexico'
}, {
'url_delete': 'http://example.com/adminpages/delete/id/302',
'url_update': 'http://example.com/adminpages/update/id/302',
'id': 302,
'list_of_pk': ('["id", 302]', ),
'label': u'Honduras'
}, {
'url_delete': 'http://example.com/adminpages/delete/id/303',
'url_update': 'http://example.com/adminpages/update/id/303',
'id': 303,
'list_of_pk': ('["id", 303]', ),
'label': u'Guatemala'
}]
}, {
'url_delete': 'http://example.com/adminpages/delete/id/400',
'list_of_pk': ('["id", 400]', ),
'id': 400,
'label': u'South-America',
'url_update': 'http://example.com/adminpages/update/id/400',
'children': [{
'url_delete': 'http://example.com/adminpages/delete/id/401',
'url_update': 'http://example.com/adminpages/update/id/401',
'id': 401,
'list_of_pk': ('["id", 401]', ),
'label': u'Brazil'
}, {
'url_delete': 'http://example.com/adminpages/delete/id/402',
'url_update': 'http://example.com/adminpages/update/id/402',
'id': 402,
'list_of_pk': ('["id", 402]', ),
'label': u'Argentina'
}, {
'url_delete': 'http://example.com/adminpages/delete/id/403',
'url_update': 'http://example.com/adminpages/update/id/403',
'id': 403,
'list_of_pk': ('["id", 403]', ),
'label': u'Uruguay'
}, {
'url_delete': 'http://example.com/adminpages/delete/id/404',
'url_update': 'http://example.com/adminpages/update/id/404',
'id': 404,
'list_of_pk': ('["id", 404]', ),
'label': u'Chile'
}]
}]
}, {
'url_delete': 'http://example.com/adminpages/delete/id/500',
'list_of_pk': ('["id", 500]', ),
'id': 500,
'label': u'Asia',
'url_update': 'http://example.com/adminpages/update/id/500',
'children': [{
'url_delete': 'http://example.com/adminpages/delete/id/501',
'url_update': 'http://example.com/adminpages/update/id/501',
'id': 501,
'list_of_pk': ('["id", 501]', ),
'label': u'China'
}, {
'url_delete': 'http://example.com/adminpages/delete/id/502',
'url_update': 'http://example.com/adminpages/update/id/502',
'id': 502,
'list_of_pk': ('["id", 502]', ),
'label': u'India'
}, {
'url_delete': 'http://example.com/adminpages/delete/id/503',
'url_update': 'http://example.com/adminpages/update/id/503',
'id': 503,
'list_of_pk': ('["id", 503]', ),
'label': u'Malaysia'
}, {
'url_delete': 'http://example.com/adminpages/delete/id/504',
'url_update': 'http://example.com/adminpages/update/id/504',
'id': 504,
'list_of_pk': ('["id", 504]', ),
'label': u'Thailand'
}, {
'url_delete': 'http://example.com/adminpages/delete/id/505',
'url_update': 'http://example.com/adminpages/update/id/505',
'id': 505,
'list_of_pk': ('["id", 505]', ),
'label': u'Vietnam'
}, {
'url_delete': 'http://example.com/adminpages/delete/id/506',
'url_update': 'http://example.com/adminpages/update/id/506',
'id': 506,
'list_of_pk': ('["id", 506]', ),
'label': u'Singapore'
}, {
'url_delete': 'http://example.com/adminpages/delete/id/507',
'url_update': 'http://example.com/adminpages/update/id/507',
'id': 507,
'list_of_pk': ('["id", 507]', ),
'label': u'Indonesia'
}, {
'url_delete': 'http://example.com/adminpages/delete/id/508',
'url_update': 'http://example.com/adminpages/update/id/508',
'id': 508,
'list_of_pk': ('["id", 508]', ),
'label': u'Mongolia'
}]
}]
}]
| base_tree = [{'url_delete': 'http://example.com/adminpages/delete/id/1', 'list_of_pk': ('["id", 1]',), 'id': 1, 'label': u'Hello Traversal World!', 'url_update': 'http://example.com/adminpages/update/id/1', 'children': [{'url_delete': 'http://example.com/adminpages/delete/id/2', 'list_of_pk': ('["id", 2]',), 'id': 2, 'label': u'We ♥ gevent', 'url_update': 'http://example.com/adminpages/update/id/2', 'children': [{'url_delete': 'http://example.com/adminpages/delete/id/3', 'list_of_pk': ('["id", 3]',), 'id': 3, 'label': u'And Pyramid', 'url_update': 'http://example.com/adminpages/update/id/3', 'children': [{'url_delete': 'http://example.com/adminpages/delete/id/12', 'list_of_pk': ('["id", 12]',), 'id': 12, 'label': u'and aiohttp!', 'url_update': 'http://example.com/adminpages/update/id/12', 'children': [{'url_delete': 'http://example.com/adminpages/delete/id/14', 'list_of_pk': ('["id", 14]',), 'id': 14, 'label': u'and beer!', 'url_update': 'http://example.com/adminpages/update/id/14', 'children': [{'url_delete': 'http://example.com/adminpages/delete/id/15', 'url_update': 'http://example.com/adminpages/update/id/15', 'id': 15, 'list_of_pk': ('["id", 15]',), 'label': u'and bear to!'}]}]}, {'url_delete': 'http://example.com/adminpages/delete/id/13', 'url_update': 'http://example.com/adminpages/update/id/13', 'id': 13, 'list_of_pk': ('["id", 13]',), 'label': u'and asyncio!'}]}]}, {'url_delete': 'http://example.com/adminpages/delete/id/4', 'list_of_pk': ('["id", 4]',), 'id': 4, 'label': u'Redirect 301 to we-love-gevent', 'url_update': 'http://example.com/adminpages/update/id/4', 'children': [{'url_delete': 'http://example.com/adminpages/delete/id/5', 'url_update': 'http://example.com/adminpages/update/id/5', 'id': 5, 'list_of_pk': ('["id", 5]',), 'label': u'Redirect 200 to about-company'}, {'url_delete': 'http://example.com/adminpages/delete/id/6', 'url_update': 'http://example.com/adminpages/update/id/6', 'id': 6, 'list_of_pk': ('["id", 6]',), 'label': u'Компания ITCase'}]}, {'url_delete': 'http://example.com/adminpages/delete/id/7', 'list_of_pk': ('["id", 7]',), 'id': 7, 'label': u'Our strategy', 'url_update': 'http://example.com/adminpages/update/id/7', 'children': [{'url_delete': 'http://example.com/adminpages/delete/id/8', 'list_of_pk': ('["id", 8]',), 'id': 8, 'label': u'Wordwide', 'url_update': 'http://example.com/adminpages/update/id/8', 'children': [{'url_delete': 'http://example.com/adminpages/delete/id/9', 'url_update': 'http://example.com/adminpages/update/id/9', 'id': 9, 'list_of_pk': ('["id", 9]',), 'label': u'Technology'}]}, {'url_delete': 'http://example.com/adminpages/delete/id/10', 'list_of_pk': ('["id", 10]',), 'id': 10, 'label': u'What we do', 'url_update': 'http://example.com/adminpages/update/id/10', 'children': [{'url_delete': 'http://example.com/adminpages/delete/id/11', 'url_update': 'http://example.com/adminpages/update/id/11', 'id': 11, 'list_of_pk': ('["id", 11]',), 'label': u'at a glance'}]}]}]}, {'url_delete': 'http://example.com/adminpages/delete/id/100', 'list_of_pk': ('["id", 100]',), 'id': 100, 'label': u'Countries', 'url_update': 'http://example.com/adminpages/update/id/100', 'children': [{'url_delete': 'http://example.com/adminpages/delete/id/101', 'list_of_pk': ('["id", 101]',), 'id': 101, 'label': u'Africa', 'url_update': 'http://example.com/adminpages/update/id/101', 'children': [{'url_delete': 'http://example.com/adminpages/delete/id/102', 'url_update': 'http://example.com/adminpages/update/id/102', 'id': 102, 'list_of_pk': ('["id", 102]',), 'label': u'Algeria'}, {'url_delete': 'http://example.com/adminpages/delete/id/103', 'url_update': 'http://example.com/adminpages/update/id/103', 'id': 103, 'list_of_pk': ('["id", 103]',), 'label': u'Marocco'}, {'url_delete': 'http://example.com/adminpages/delete/id/104', 'url_update': 'http://example.com/adminpages/update/id/104', 'id': 104, 'list_of_pk': ('["id", 104]',), 'label': u'Libya'}, {'url_delete': 'http://example.com/adminpages/delete/id/105', 'url_update': 'http://example.com/adminpages/update/id/105', 'id': 105, 'list_of_pk': ('["id", 105]',), 'label': u'Somalia'}, {'url_delete': 'http://example.com/adminpages/delete/id/106', 'url_update': 'http://example.com/adminpages/update/id/106', 'id': 106, 'list_of_pk': ('["id", 106]',), 'label': u'Kenya'}, {'url_delete': 'http://example.com/adminpages/delete/id/107', 'url_update': 'http://example.com/adminpages/update/id/107', 'id': 107, 'list_of_pk': ('["id", 107]',), 'label': u'Mauritania'}, {'url_delete': 'http://example.com/adminpages/delete/id/108', 'url_update': 'http://example.com/adminpages/update/id/108', 'id': 108, 'list_of_pk': ('["id", 108]',), 'label': u'South Africa'}]}, {'url_delete': 'http://example.com/adminpages/delete/id/200', 'list_of_pk': ('["id", 200]',), 'id': 200, 'label': u'America', 'url_update': 'http://example.com/adminpages/update/id/200', 'children': [{'url_delete': 'http://example.com/adminpages/delete/id/201', 'list_of_pk': ('["id", 201]',), 'id': 201, 'label': u'North-America', 'url_update': 'http://example.com/adminpages/update/id/201', 'children': [{'url_delete': 'http://example.com/adminpages/delete/id/202', 'url_update': 'http://example.com/adminpages/update/id/202', 'id': 202, 'list_of_pk': ('["id", 202]',), 'label': u'Canada'}, {'url_delete': 'http://example.com/adminpages/delete/id/203', 'url_update': 'http://example.com/adminpages/update/id/203', 'id': 203, 'list_of_pk': ('["id", 203]',), 'label': u'USA'}]}, {'url_delete': 'http://example.com/adminpages/delete/id/300', 'list_of_pk': ('["id", 300]',), 'id': 300, 'label': u'Middle-America', 'url_update': 'http://example.com/adminpages/update/id/300', 'children': [{'url_delete': 'http://example.com/adminpages/delete/id/301', 'url_update': 'http://example.com/adminpages/update/id/301', 'id': 301, 'list_of_pk': ('["id", 301]',), 'label': u'Mexico'}, {'url_delete': 'http://example.com/adminpages/delete/id/302', 'url_update': 'http://example.com/adminpages/update/id/302', 'id': 302, 'list_of_pk': ('["id", 302]',), 'label': u'Honduras'}, {'url_delete': 'http://example.com/adminpages/delete/id/303', 'url_update': 'http://example.com/adminpages/update/id/303', 'id': 303, 'list_of_pk': ('["id", 303]',), 'label': u'Guatemala'}]}, {'url_delete': 'http://example.com/adminpages/delete/id/400', 'list_of_pk': ('["id", 400]',), 'id': 400, 'label': u'South-America', 'url_update': 'http://example.com/adminpages/update/id/400', 'children': [{'url_delete': 'http://example.com/adminpages/delete/id/401', 'url_update': 'http://example.com/adminpages/update/id/401', 'id': 401, 'list_of_pk': ('["id", 401]',), 'label': u'Brazil'}, {'url_delete': 'http://example.com/adminpages/delete/id/402', 'url_update': 'http://example.com/adminpages/update/id/402', 'id': 402, 'list_of_pk': ('["id", 402]',), 'label': u'Argentina'}, {'url_delete': 'http://example.com/adminpages/delete/id/403', 'url_update': 'http://example.com/adminpages/update/id/403', 'id': 403, 'list_of_pk': ('["id", 403]',), 'label': u'Uruguay'}, {'url_delete': 'http://example.com/adminpages/delete/id/404', 'url_update': 'http://example.com/adminpages/update/id/404', 'id': 404, 'list_of_pk': ('["id", 404]',), 'label': u'Chile'}]}]}, {'url_delete': 'http://example.com/adminpages/delete/id/500', 'list_of_pk': ('["id", 500]',), 'id': 500, 'label': u'Asia', 'url_update': 'http://example.com/adminpages/update/id/500', 'children': [{'url_delete': 'http://example.com/adminpages/delete/id/501', 'url_update': 'http://example.com/adminpages/update/id/501', 'id': 501, 'list_of_pk': ('["id", 501]',), 'label': u'China'}, {'url_delete': 'http://example.com/adminpages/delete/id/502', 'url_update': 'http://example.com/adminpages/update/id/502', 'id': 502, 'list_of_pk': ('["id", 502]',), 'label': u'India'}, {'url_delete': 'http://example.com/adminpages/delete/id/503', 'url_update': 'http://example.com/adminpages/update/id/503', 'id': 503, 'list_of_pk': ('["id", 503]',), 'label': u'Malaysia'}, {'url_delete': 'http://example.com/adminpages/delete/id/504', 'url_update': 'http://example.com/adminpages/update/id/504', 'id': 504, 'list_of_pk': ('["id", 504]',), 'label': u'Thailand'}, {'url_delete': 'http://example.com/adminpages/delete/id/505', 'url_update': 'http://example.com/adminpages/update/id/505', 'id': 505, 'list_of_pk': ('["id", 505]',), 'label': u'Vietnam'}, {'url_delete': 'http://example.com/adminpages/delete/id/506', 'url_update': 'http://example.com/adminpages/update/id/506', 'id': 506, 'list_of_pk': ('["id", 506]',), 'label': u'Singapore'}, {'url_delete': 'http://example.com/adminpages/delete/id/507', 'url_update': 'http://example.com/adminpages/update/id/507', 'id': 507, 'list_of_pk': ('["id", 507]',), 'label': u'Indonesia'}, {'url_delete': 'http://example.com/adminpages/delete/id/508', 'url_update': 'http://example.com/adminpages/update/id/508', 'id': 508, 'list_of_pk': ('["id", 508]',), 'label': u'Mongolia'}]}]}] |
@metadata_reactor
def add_backup_key(metadata):
return {
'users': {
'root': {
'authorized_keys': {
'ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDM70gDI1cuIKu15VAEYnlWMFi3zGPf6shtQCzrHBv1nOOkfPdXlXACC4H5+MiTV5foAIA8PUaqOV9gow1w639TnWDL2DwPJ5RsT+P5g4eWszW5xQPo0zAKuvlTMB9JkDXGx1OpOE4e9n3++71yuvF/wVlqYxJwxeWXCdHf2ayx6OrTMcSMUIi+zqD494YBhKt+QJAiRrXGNU82FczJeK3iRMTtd+LUeGtnEoskcDOwhGfOXGsUGt3BMWLiDhGXp4ZvKUhNSTz5Kr9OCQT/uWam3nXciZrx1a2kVFJhd1ur81LRqxxDMGQjS29z6Vpd2vxG/P8mP3w2r7fvoqE33hpv': {}
}
}
}
}
| @metadata_reactor
def add_backup_key(metadata):
return {'users': {'root': {'authorized_keys': {'ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDM70gDI1cuIKu15VAEYnlWMFi3zGPf6shtQCzrHBv1nOOkfPdXlXACC4H5+MiTV5foAIA8PUaqOV9gow1w639TnWDL2DwPJ5RsT+P5g4eWszW5xQPo0zAKuvlTMB9JkDXGx1OpOE4e9n3++71yuvF/wVlqYxJwxeWXCdHf2ayx6OrTMcSMUIi+zqD494YBhKt+QJAiRrXGNU82FczJeK3iRMTtd+LUeGtnEoskcDOwhGfOXGsUGt3BMWLiDhGXp4ZvKUhNSTz5Kr9OCQT/uWam3nXciZrx1a2kVFJhd1ur81LRqxxDMGQjS29z6Vpd2vxG/P8mP3w2r7fvoqE33hpv': {}}}}} |
"""
CCC '01 J1 - Dressing Up
Find this problem at:
https://dmoj.ca/problem/ccc01j1
"""
height = int(input())
# These are the two parts of the bow tie
for half in (range(1, height, 2), range(height, -1, -2)):
# Print each line accordingly
for i in half:
print('*' * i + ' ' * ((height-i)*2) + '*' * i)
| """
CCC '01 J1 - Dressing Up
Find this problem at:
https://dmoj.ca/problem/ccc01j1
"""
height = int(input())
for half in (range(1, height, 2), range(height, -1, -2)):
for i in half:
print('*' * i + ' ' * ((height - i) * 2) + '*' * i) |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Starting with the number 1 and moving to the right in a clockwise direction a 5 by 5 spiral is formed as follows:
21 22 23 24 25
20 7 8 9 10
19 6 1 2 11
18 5 4 3 12
17 16 15 14 13
It can be verified that the sum of the numbers on the diagonals is 101.
What is the sum of the numbers on the diagonals in a 1001 by 1001 spiral formed in the same way?
"""
def main():
dimension = 1001
curr = 1
result = curr
for n in range(1, dimension/2 + 1):
for i in range(4):
curr += n * 2
result += curr
print(result)
if __name__ == '__main__':
main()
| """
Starting with the number 1 and moving to the right in a clockwise direction a 5 by 5 spiral is formed as follows:
21 22 23 24 25
20 7 8 9 10
19 6 1 2 11
18 5 4 3 12
17 16 15 14 13
It can be verified that the sum of the numbers on the diagonals is 101.
What is the sum of the numbers on the diagonals in a 1001 by 1001 spiral formed in the same way?
"""
def main():
dimension = 1001
curr = 1
result = curr
for n in range(1, dimension / 2 + 1):
for i in range(4):
curr += n * 2
result += curr
print(result)
if __name__ == '__main__':
main() |
# This file mainly exists to allow python setup.py test to work.
# flake8: noqa
def runtests():
pass
if __name__ == '__main__':
runtests()
| def runtests():
pass
if __name__ == '__main__':
runtests() |
line = open("day10.txt", "r").readline()
def day10(iterate, sequence):
for i in range(iterate):
concat = ""
first = True
second = False
sameNumberCounter = 0
secondNum = 0
numCounter = 0
for num in sequence:
numCounter += 1
if second and secondNum != num:
concat += str(sameNumberCounter) + str(secondNum)
first = True
second = False
if numCounter == len(sequence):
sameNumberCounter = 1
concat += str(sameNumberCounter) + str(num)
sameNumberCounter = 0
secondNum = 0
elif secondNum == num:
sameNumberCounter += 1
continue
if first:
firstNum = num
sameNumberCounter += 1
first = False
continue
elif firstNum == num:
sameNumberCounter += 1
continue
else:
concat += str(sameNumberCounter) + str(firstNum)
secondNum = num
second = True
sameNumberCounter = 1
if numCounter == len(sequence):
concat += str(sameNumberCounter) + str(secondNum)
sequence = concat
print(len(concat))
print("Part 1:")
day10(40, line)
print("Part 2:")
day10(50, line)
| line = open('day10.txt', 'r').readline()
def day10(iterate, sequence):
for i in range(iterate):
concat = ''
first = True
second = False
same_number_counter = 0
second_num = 0
num_counter = 0
for num in sequence:
num_counter += 1
if second and secondNum != num:
concat += str(sameNumberCounter) + str(secondNum)
first = True
second = False
if numCounter == len(sequence):
same_number_counter = 1
concat += str(sameNumberCounter) + str(num)
same_number_counter = 0
second_num = 0
elif secondNum == num:
same_number_counter += 1
continue
if first:
first_num = num
same_number_counter += 1
first = False
continue
elif firstNum == num:
same_number_counter += 1
continue
else:
concat += str(sameNumberCounter) + str(firstNum)
second_num = num
second = True
same_number_counter = 1
if numCounter == len(sequence):
concat += str(sameNumberCounter) + str(secondNum)
sequence = concat
print(len(concat))
print('Part 1:')
day10(40, line)
print('Part 2:')
day10(50, line) |
"""Base class for writing hooks."""
class BaseHook(object):
"""Base class for all hooks."""
KEY = 'hook'
NAME = 'Hook'
def __init__(self, extension):
self.extension = extension
@property
def pod(self):
"""Reference to the pod."""
return self.extension.pod
# pylint:disable=no-self-use, unused-argument
def should_trigger(self, previous_result, *_args, **_kwargs):
"""Determine if the hook should trigger."""
return True
def trigger(self, previous_result, *_args, **_kwargs):
"""Trigger the hook."""
raise NotImplementedError()
| """Base class for writing hooks."""
class Basehook(object):
"""Base class for all hooks."""
key = 'hook'
name = 'Hook'
def __init__(self, extension):
self.extension = extension
@property
def pod(self):
"""Reference to the pod."""
return self.extension.pod
def should_trigger(self, previous_result, *_args, **_kwargs):
"""Determine if the hook should trigger."""
return True
def trigger(self, previous_result, *_args, **_kwargs):
"""Trigger the hook."""
raise not_implemented_error() |
# Copyright 2015-2021 Mathieu Bernard
#
# This file is part of phonemizer: you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# Phonemizer is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with phonemizer. If not, see <http://www.gnu.org/licenses/>.
"""Parse a Scheme expression as a nested list
The main function of this module is lispy.parse, other ones should be
considered private. This module is a dependency of the festival
backend.
From http://www.norvig.com/lispy.html
"""
def parse(program):
"""Read a Scheme expression from a string
Return a nested list
Raises an IndexError if the expression is not valid scheme
(unbalanced parenthesis).
>>> parse('(+ 2 (* 5 2))')
['+', '2', ['*', '5', '2']]
"""
return _read_from_tokens(_tokenize(program))
def _tokenize(chars):
"Convert a string of characters into a list of tokens."
return chars.replace('(', ' ( ').replace(')', ' ) ').split()
def _read_from_tokens(tokens):
"Read an expression from a sequence of tokens"
if len(tokens) == 0: # pragma: nocover
raise SyntaxError('unexpected EOF while reading')
token = tokens.pop(0)
if token == '(':
L = []
while tokens[0] != ')':
L.append(_read_from_tokens(tokens))
tokens.pop(0) # pop off ')'
return L
if token == ')': # pragma: nocover
raise SyntaxError('unexpected )')
return token
| """Parse a Scheme expression as a nested list
The main function of this module is lispy.parse, other ones should be
considered private. This module is a dependency of the festival
backend.
From http://www.norvig.com/lispy.html
"""
def parse(program):
"""Read a Scheme expression from a string
Return a nested list
Raises an IndexError if the expression is not valid scheme
(unbalanced parenthesis).
>>> parse('(+ 2 (* 5 2))')
['+', '2', ['*', '5', '2']]
"""
return _read_from_tokens(_tokenize(program))
def _tokenize(chars):
"""Convert a string of characters into a list of tokens."""
return chars.replace('(', ' ( ').replace(')', ' ) ').split()
def _read_from_tokens(tokens):
"""Read an expression from a sequence of tokens"""
if len(tokens) == 0:
raise syntax_error('unexpected EOF while reading')
token = tokens.pop(0)
if token == '(':
l = []
while tokens[0] != ')':
L.append(_read_from_tokens(tokens))
tokens.pop(0)
return L
if token == ')':
raise syntax_error('unexpected )')
return token |
#
# PySNMP MIB module ALCATEL-IND1-IPMS-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/ALCATEL-IND1-IPMS-MIB
# Produced by pysmi-0.3.4 at Mon Apr 29 17:02:25 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)
#
softentIND1Ipms, = mibBuilder.importSymbols("ALCATEL-IND1-BASE", "softentIND1Ipms")
OctetString, ObjectIdentifier, Integer = mibBuilder.importSymbols("ASN1", "OctetString", "ObjectIdentifier", "Integer")
NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues")
SingleValueConstraint, ConstraintsIntersection, ValueRangeConstraint, ConstraintsUnion, ValueSizeConstraint = mibBuilder.importSymbols("ASN1-REFINEMENT", "SingleValueConstraint", "ConstraintsIntersection", "ValueRangeConstraint", "ConstraintsUnion", "ValueSizeConstraint")
InterfaceIndex, = mibBuilder.importSymbols("IF-MIB", "InterfaceIndex")
ObjectGroup, NotificationGroup, ModuleCompliance = mibBuilder.importSymbols("SNMPv2-CONF", "ObjectGroup", "NotificationGroup", "ModuleCompliance")
MibScalar, MibTable, MibTableRow, MibTableColumn, IpAddress, TimeTicks, Counter32, Counter64, MibIdentifier, Bits, Integer32, ObjectIdentity, NotificationType, Gauge32, iso, ModuleIdentity, Unsigned32 = mibBuilder.importSymbols("SNMPv2-SMI", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "IpAddress", "TimeTicks", "Counter32", "Counter64", "MibIdentifier", "Bits", "Integer32", "ObjectIdentity", "NotificationType", "Gauge32", "iso", "ModuleIdentity", "Unsigned32")
TextualConvention, RowStatus, DisplayString, MacAddress = mibBuilder.importSymbols("SNMPv2-TC", "TextualConvention", "RowStatus", "DisplayString", "MacAddress")
alcatelIND1IPMSMIB = ModuleIdentity((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1))
alcatelIND1IPMSMIB.setRevisions(('2007-04-03 00:00',))
if mibBuilder.loadTexts: alcatelIND1IPMSMIB.setLastUpdated('200704030000Z')
if mibBuilder.loadTexts: alcatelIND1IPMSMIB.setOrganization('Alcatel-Lucent')
alcatelIND1IPMSMIBObjects = MibIdentifier((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1))
alaIpmsConfig = MibIdentifier((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 1))
alaIpmsStatus = MibScalar((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 1, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enable", 1), ("disable", 2))).clone('disable')).setMaxAccess("readwrite")
if mibBuilder.loadTexts: alaIpmsStatus.setStatus('current')
alaIpmsLeaveTimeout = MibScalar((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 1, 2), Unsigned32().clone(1)).setMaxAccess("readwrite")
if mibBuilder.loadTexts: alaIpmsLeaveTimeout.setStatus('current')
alaIpmsQueryInterval = MibScalar((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 1, 3), Unsigned32().clone(125)).setMaxAccess("readwrite")
if mibBuilder.loadTexts: alaIpmsQueryInterval.setStatus('current')
alaIpmsNeighborTimer = MibScalar((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 1, 4), Unsigned32().clone(90)).setMaxAccess("readwrite")
if mibBuilder.loadTexts: alaIpmsNeighborTimer.setStatus('current')
alaIpmsQuerierTimer = MibScalar((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 1, 5), Unsigned32().clone(260)).setMaxAccess("readwrite")
if mibBuilder.loadTexts: alaIpmsQuerierTimer.setStatus('current')
alaIpmsMembershipTimer = MibScalar((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 1, 6), Unsigned32().clone(260)).setMaxAccess("readwrite")
if mibBuilder.loadTexts: alaIpmsMembershipTimer.setStatus('current')
alaIpmsPriority = MibScalar((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 1, 7), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(4, 3, 2, 1, 0))).clone(namedValues=NamedValues(("unsupported", 4), ("urgent", 3), ("high", 2), ("medium", 1), ("low", 0))).clone('low')).setMaxAccess("readwrite")
if mibBuilder.loadTexts: alaIpmsPriority.setStatus('current')
alaIpmsMaxBandwidth = MibScalar((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 1, 8), Unsigned32().clone(10)).setMaxAccess("readwrite")
if mibBuilder.loadTexts: alaIpmsMaxBandwidth.setStatus('current')
alaIpmsHardwareRoute = MibScalar((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 1, 9), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2))).clone(namedValues=NamedValues(("unsupported", 0), ("enable", 1), ("disable", 2))).clone('disable')).setMaxAccess("readwrite")
if mibBuilder.loadTexts: alaIpmsHardwareRoute.setStatus('current')
alaIpmsIGMPMembershipProxyVersion = MibScalar((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 1, 10), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("igmpv1", 1), ("igmpv2", 2), ("igmpv3", 3))).clone('igmpv2')).setMaxAccess("readwrite")
if mibBuilder.loadTexts: alaIpmsIGMPMembershipProxyVersion.setStatus('current')
alaIpmsOtherQuerierTimer = MibScalar((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 1, 11), Unsigned32().clone(255)).setMaxAccess("readwrite")
if mibBuilder.loadTexts: alaIpmsOtherQuerierTimer.setStatus('current')
alaIpmsGroup = MibIdentifier((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 2))
alaIpmsGroupTable = MibTable((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 2, 1), )
if mibBuilder.loadTexts: alaIpmsGroupTable.setStatus('current')
alaIpmsGroupEntry = MibTableRow((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 2, 1, 1), ).setIndexNames((0, "ALCATEL-IND1-IPMS-MIB", "alaIpmsGroupDestIpAddr"), (0, "ALCATEL-IND1-IPMS-MIB", "alaIpmsGroupClientIpAddr"), (0, "ALCATEL-IND1-IPMS-MIB", "alaIpmsGroupClientVlan"), (0, "ALCATEL-IND1-IPMS-MIB", "alaIpmsGroupClientIfIndex"), (0, "ALCATEL-IND1-IPMS-MIB", "alaIpmsGroupClientVci"), (0, "ALCATEL-IND1-IPMS-MIB", "alaIpmsGroupIGMPVersion"), (0, "ALCATEL-IND1-IPMS-MIB", "alaIpmsGroupIGMPv3SrcIP"), (0, "ALCATEL-IND1-IPMS-MIB", "alaIpmsGroupIGMPv3SrcType"))
if mibBuilder.loadTexts: alaIpmsGroupEntry.setStatus('current')
alaIpmsGroupDestIpAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 2, 1, 1, 1), IpAddress())
if mibBuilder.loadTexts: alaIpmsGroupDestIpAddr.setStatus('current')
alaIpmsGroupClientIpAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 2, 1, 1, 2), IpAddress())
if mibBuilder.loadTexts: alaIpmsGroupClientIpAddr.setStatus('current')
alaIpmsGroupClientMacAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 2, 1, 1, 3), MacAddress()).setMaxAccess("readonly")
if mibBuilder.loadTexts: alaIpmsGroupClientMacAddr.setStatus('current')
alaIpmsGroupClientVlan = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 2, 1, 1, 4), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 4094)))
if mibBuilder.loadTexts: alaIpmsGroupClientVlan.setStatus('current')
alaIpmsGroupClientIfIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 2, 1, 1, 5), InterfaceIndex())
if mibBuilder.loadTexts: alaIpmsGroupClientIfIndex.setStatus('current')
alaIpmsGroupClientVci = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 2, 1, 1, 6), Unsigned32())
if mibBuilder.loadTexts: alaIpmsGroupClientVci.setStatus('current')
alaIpmsGroupIGMPVersion = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 2, 1, 1, 7), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("igmpv1", 1), ("igmpv2", 2), ("igmpv3", 3)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: alaIpmsGroupIGMPVersion.setStatus('current')
alaIpmsGroupIGMPv3SrcIP = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 2, 1, 1, 8), IpAddress())
if mibBuilder.loadTexts: alaIpmsGroupIGMPv3SrcIP.setStatus('current')
alaIpmsGroupIGMPv3SrcType = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 2, 1, 1, 9), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2))).clone(namedValues=NamedValues(("na", 0), ("include", 1), ("exclude", 2)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: alaIpmsGroupIGMPv3SrcType.setStatus('current')
alaIpmsGroupIGMPv3SrcTimeout = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 2, 1, 1, 10), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: alaIpmsGroupIGMPv3SrcTimeout.setStatus('current')
alaIpmsGroupIGMPv3GroupType = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 2, 1, 1, 11), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2))).clone(namedValues=NamedValues(("na", 0), ("include", 1), ("exclude", 2)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: alaIpmsGroupIGMPv3GroupType.setStatus('current')
alaIpmsGroupTimeout = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 2, 1, 1, 12), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: alaIpmsGroupTimeout.setStatus('current')
alaIpmsNeighbor = MibIdentifier((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 3))
alaIpmsNeighborTable = MibTable((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 3, 1), )
if mibBuilder.loadTexts: alaIpmsNeighborTable.setStatus('current')
alaIpmsNeighborEntry = MibTableRow((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 3, 1, 1), ).setIndexNames((0, "ALCATEL-IND1-IPMS-MIB", "alaIpmsNeighborIpAddr"))
if mibBuilder.loadTexts: alaIpmsNeighborEntry.setStatus('current')
alaIpmsNeighborIpAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 3, 1, 1, 1), IpAddress())
if mibBuilder.loadTexts: alaIpmsNeighborIpAddr.setStatus('current')
alaIpmsNeighborVlan = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 3, 1, 1, 2), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 4094))).setMaxAccess("readonly")
if mibBuilder.loadTexts: alaIpmsNeighborVlan.setStatus('current')
alaIpmsNeighborIfIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 3, 1, 1, 3), InterfaceIndex()).setMaxAccess("readonly")
if mibBuilder.loadTexts: alaIpmsNeighborIfIndex.setStatus('current')
alaIpmsNeighborVci = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 3, 1, 1, 4), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: alaIpmsNeighborVci.setStatus('current')
alaIpmsNeighborType = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 3, 1, 1, 5), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3))).clone(namedValues=NamedValues(("native", 0), ("ipip", 1), ("pim", 2), ("cmm", 3)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: alaIpmsNeighborType.setStatus('current')
alaIpmsNeighborTimeout = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 3, 1, 1, 6), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: alaIpmsNeighborTimeout.setStatus('current')
alaIpmsStaticNeighbor = MibIdentifier((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 4))
alaIpmsStaticNeighborTable = MibTable((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 4, 1), )
if mibBuilder.loadTexts: alaIpmsStaticNeighborTable.setStatus('current')
alaIpmsStaticNeighborEntry = MibTableRow((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 4, 1, 1), ).setIndexNames((0, "ALCATEL-IND1-IPMS-MIB", "alaIpmsStaticNeighborVlan"), (0, "ALCATEL-IND1-IPMS-MIB", "alaIpmsStaticNeighborIfIndex"), (0, "ALCATEL-IND1-IPMS-MIB", "alaIpmsStaticNeighborVci"))
if mibBuilder.loadTexts: alaIpmsStaticNeighborEntry.setStatus('current')
alaIpmsStaticNeighborVlan = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 4, 1, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 4094)))
if mibBuilder.loadTexts: alaIpmsStaticNeighborVlan.setStatus('current')
alaIpmsStaticNeighborIfIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 4, 1, 1, 2), InterfaceIndex())
if mibBuilder.loadTexts: alaIpmsStaticNeighborIfIndex.setStatus('current')
alaIpmsStaticNeighborVci = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 4, 1, 1, 3), Unsigned32())
if mibBuilder.loadTexts: alaIpmsStaticNeighborVci.setStatus('current')
alaIpmsStaticNeighborIGMPVersion = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 4, 1, 1, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(2, 3))).clone(namedValues=NamedValues(("igmpv2", 2), ("igmpv3", 3)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: alaIpmsStaticNeighborIGMPVersion.setStatus('current')
alaIpmsStaticNeighborRowStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 4, 1, 1, 5), RowStatus()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: alaIpmsStaticNeighborRowStatus.setStatus('current')
alaIpmsQuerier = MibIdentifier((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 5))
alaIpmsQuerierTable = MibTable((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 5, 1), )
if mibBuilder.loadTexts: alaIpmsQuerierTable.setStatus('current')
alaIpmsQuerierEntry = MibTableRow((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 5, 1, 1), ).setIndexNames((0, "ALCATEL-IND1-IPMS-MIB", "alaIpmsQuerierIpAddr"))
if mibBuilder.loadTexts: alaIpmsQuerierEntry.setStatus('current')
alaIpmsQuerierIpAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 5, 1, 1, 1), IpAddress())
if mibBuilder.loadTexts: alaIpmsQuerierIpAddr.setStatus('current')
alaIpmsQuerierVlan = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 5, 1, 1, 2), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 4094))).setMaxAccess("readonly")
if mibBuilder.loadTexts: alaIpmsQuerierVlan.setStatus('current')
alaIpmsQuerierIfIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 5, 1, 1, 3), InterfaceIndex()).setMaxAccess("readonly")
if mibBuilder.loadTexts: alaIpmsQuerierIfIndex.setStatus('current')
alaIpmsQuerierVci = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 5, 1, 1, 4), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: alaIpmsQuerierVci.setStatus('current')
alaIpmsQuerierType = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 5, 1, 1, 5), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3))).clone(namedValues=NamedValues(("native", 0), ("ipip", 1), ("pim", 2), ("cmm", 3)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: alaIpmsQuerierType.setStatus('current')
alaIpmsQuerierTimeout = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 5, 1, 1, 6), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: alaIpmsQuerierTimeout.setStatus('current')
alaIpmsStaticQuerier = MibIdentifier((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 6))
alaIpmsStaticQuerierTable = MibTable((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 6, 1), )
if mibBuilder.loadTexts: alaIpmsStaticQuerierTable.setStatus('current')
alaIpmsStaticQuerierEntry = MibTableRow((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 6, 1, 1), ).setIndexNames((0, "ALCATEL-IND1-IPMS-MIB", "alaIpmsStaticQuerierVlan"), (0, "ALCATEL-IND1-IPMS-MIB", "alaIpmsStaticQuerierIfIndex"), (0, "ALCATEL-IND1-IPMS-MIB", "alaIpmsStaticQuerierVci"))
if mibBuilder.loadTexts: alaIpmsStaticQuerierEntry.setStatus('current')
alaIpmsStaticQuerierVlan = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 6, 1, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 4094)))
if mibBuilder.loadTexts: alaIpmsStaticQuerierVlan.setStatus('current')
alaIpmsStaticQuerierIfIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 6, 1, 1, 2), InterfaceIndex())
if mibBuilder.loadTexts: alaIpmsStaticQuerierIfIndex.setStatus('current')
alaIpmsStaticQuerierVci = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 6, 1, 1, 3), Unsigned32())
if mibBuilder.loadTexts: alaIpmsStaticQuerierVci.setStatus('current')
alaIpmsStaticQuerierIGMPVersion = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 6, 1, 1, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(2, 3))).clone(namedValues=NamedValues(("igmpv2", 2), ("igmpv3", 3)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: alaIpmsStaticQuerierIGMPVersion.setStatus('current')
alaIpmsStaticQuerierRowStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 6, 1, 1, 5), RowStatus()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: alaIpmsStaticQuerierRowStatus.setStatus('current')
alaIpmsSource = MibIdentifier((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 7))
alaIpmsSourceTable = MibTable((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 7, 1), )
if mibBuilder.loadTexts: alaIpmsSourceTable.setStatus('current')
alaIpmsSourceEntry = MibTableRow((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 7, 1, 1), ).setIndexNames((0, "ALCATEL-IND1-IPMS-MIB", "alaIpmsSourceDestIpAddr"), (0, "ALCATEL-IND1-IPMS-MIB", "alaIpmsSourceSrcIpAddr"), (0, "ALCATEL-IND1-IPMS-MIB", "alaIpmsSourceSrcVlan"), (0, "ALCATEL-IND1-IPMS-MIB", "alaIpmsSourceSrcIfIndex"), (0, "ALCATEL-IND1-IPMS-MIB", "alaIpmsSourceUniIpAddr"), (0, "ALCATEL-IND1-IPMS-MIB", "alaIpmsSourceSrcVci"), (0, "ALCATEL-IND1-IPMS-MIB", "alaIpmsSourceSrcType"))
if mibBuilder.loadTexts: alaIpmsSourceEntry.setStatus('current')
alaIpmsSourceDestIpAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 7, 1, 1, 1), IpAddress())
if mibBuilder.loadTexts: alaIpmsSourceDestIpAddr.setStatus('current')
alaIpmsSourceSrcIpAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 7, 1, 1, 2), IpAddress())
if mibBuilder.loadTexts: alaIpmsSourceSrcIpAddr.setStatus('current')
alaIpmsSourceSrcMacAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 7, 1, 1, 3), MacAddress()).setMaxAccess("readonly")
if mibBuilder.loadTexts: alaIpmsSourceSrcMacAddr.setStatus('current')
alaIpmsSourceSrcVlan = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 7, 1, 1, 4), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 4094)))
if mibBuilder.loadTexts: alaIpmsSourceSrcVlan.setStatus('current')
alaIpmsSourceSrcIfIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 7, 1, 1, 5), InterfaceIndex())
if mibBuilder.loadTexts: alaIpmsSourceSrcIfIndex.setStatus('current')
alaIpmsSourceUniIpAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 7, 1, 1, 6), IpAddress())
if mibBuilder.loadTexts: alaIpmsSourceUniIpAddr.setStatus('current')
alaIpmsSourceSrcVci = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 7, 1, 1, 7), Unsigned32())
if mibBuilder.loadTexts: alaIpmsSourceSrcVci.setStatus('current')
alaIpmsSourceSrcType = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 7, 1, 1, 8), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3))).clone(namedValues=NamedValues(("native", 0), ("ipip", 1), ("pim", 2), ("cmm", 3))))
if mibBuilder.loadTexts: alaIpmsSourceSrcType.setStatus('current')
alaIpmsSourceTimeout = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 7, 1, 1, 9), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: alaIpmsSourceTimeout.setStatus('current')
alaIpmsForward = MibIdentifier((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 8))
alaIpmsForwardTable = MibTable((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 8, 1), )
if mibBuilder.loadTexts: alaIpmsForwardTable.setStatus('current')
alaIpmsForwardEntry = MibTableRow((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 8, 1, 1), ).setIndexNames((0, "ALCATEL-IND1-IPMS-MIB", "alaIpmsForwardDestIpAddr"), (0, "ALCATEL-IND1-IPMS-MIB", "alaIpmsForwardSrcIpAddr"), (0, "ALCATEL-IND1-IPMS-MIB", "alaIpmsForwardDestVlan"), (0, "ALCATEL-IND1-IPMS-MIB", "alaIpmsForwardSrcVlan"), (0, "ALCATEL-IND1-IPMS-MIB", "alaIpmsForwardSrcIfIndex"), (0, "ALCATEL-IND1-IPMS-MIB", "alaIpmsForwardUniIpAddr"), (0, "ALCATEL-IND1-IPMS-MIB", "alaIpmsForwardSrcVci"), (0, "ALCATEL-IND1-IPMS-MIB", "alaIpmsForwardDestType"), (0, "ALCATEL-IND1-IPMS-MIB", "alaIpmsForwardSrcType"), (0, "ALCATEL-IND1-IPMS-MIB", "alaIpmsForwardDestIfIndex"), (0, "ALCATEL-IND1-IPMS-MIB", "alaIpmsForwardDestTunIpAddr"))
if mibBuilder.loadTexts: alaIpmsForwardEntry.setStatus('current')
alaIpmsForwardDestIpAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 8, 1, 1, 1), IpAddress())
if mibBuilder.loadTexts: alaIpmsForwardDestIpAddr.setStatus('current')
alaIpmsForwardSrcIpAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 8, 1, 1, 2), IpAddress())
if mibBuilder.loadTexts: alaIpmsForwardSrcIpAddr.setStatus('current')
alaIpmsForwardDestVlan = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 8, 1, 1, 3), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 4094)))
if mibBuilder.loadTexts: alaIpmsForwardDestVlan.setStatus('current')
alaIpmsForwardSrcVlan = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 8, 1, 1, 4), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 4094)))
if mibBuilder.loadTexts: alaIpmsForwardSrcVlan.setStatus('current')
alaIpmsForwardSrcIfIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 8, 1, 1, 5), InterfaceIndex())
if mibBuilder.loadTexts: alaIpmsForwardSrcIfIndex.setStatus('current')
alaIpmsForwardUniIpAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 8, 1, 1, 6), IpAddress())
if mibBuilder.loadTexts: alaIpmsForwardUniIpAddr.setStatus('current')
alaIpmsForwardSrcVci = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 8, 1, 1, 7), Unsigned32())
if mibBuilder.loadTexts: alaIpmsForwardSrcVci.setStatus('current')
alaIpmsForwardDestType = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 8, 1, 1, 8), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3))).clone(namedValues=NamedValues(("native", 0), ("ipip", 1), ("pim", 2), ("cmm", 3))))
if mibBuilder.loadTexts: alaIpmsForwardDestType.setStatus('current')
alaIpmsForwardSrcType = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 8, 1, 1, 9), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3))).clone(namedValues=NamedValues(("native", 0), ("ipip", 1), ("pim", 2), ("cmm", 3))))
if mibBuilder.loadTexts: alaIpmsForwardSrcType.setStatus('current')
alaIpmsForwardDestTunIpAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 8, 1, 1, 10), IpAddress())
if mibBuilder.loadTexts: alaIpmsForwardDestTunIpAddr.setStatus('current')
alaIpmsForwardSrcTunIpAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 8, 1, 1, 11), IpAddress()).setMaxAccess("readonly")
if mibBuilder.loadTexts: alaIpmsForwardSrcTunIpAddr.setStatus('current')
alaIpmsForwardRtrMacAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 8, 1, 1, 12), MacAddress()).setMaxAccess("readonly")
if mibBuilder.loadTexts: alaIpmsForwardRtrMacAddr.setStatus('current')
alaIpmsForwardRtrTtl = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 8, 1, 1, 13), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 255))).setMaxAccess("readonly")
if mibBuilder.loadTexts: alaIpmsForwardRtrTtl.setStatus('current')
alaIpmsForwardDestIfIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 8, 1, 1, 14), InterfaceIndex())
if mibBuilder.loadTexts: alaIpmsForwardDestIfIndex.setStatus('current')
alaIpmsPolicy = MibIdentifier((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 9))
alaIpmsPolicyTable = MibTable((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 9, 1), )
if mibBuilder.loadTexts: alaIpmsPolicyTable.setStatus('current')
alaIpmsPolicyEntry = MibTableRow((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 9, 1, 1), ).setIndexNames((0, "ALCATEL-IND1-IPMS-MIB", "alaIpmsPolicyDestIpAddr"), (0, "ALCATEL-IND1-IPMS-MIB", "alaIpmsPolicySrcIpAddr"), (0, "ALCATEL-IND1-IPMS-MIB", "alaIpmsPolicySrcVlan"), (0, "ALCATEL-IND1-IPMS-MIB", "alaIpmsPolicySrcIfIndex"), (0, "ALCATEL-IND1-IPMS-MIB", "alaIpmsPolicyUniIpAddr"), (0, "ALCATEL-IND1-IPMS-MIB", "alaIpmsPolicySrcVci"), (0, "ALCATEL-IND1-IPMS-MIB", "alaIpmsPolicySrcType"), (0, "ALCATEL-IND1-IPMS-MIB", "alaIpmsPolicyPolicy"))
if mibBuilder.loadTexts: alaIpmsPolicyEntry.setStatus('current')
alaIpmsPolicyDestIpAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 9, 1, 1, 1), IpAddress())
if mibBuilder.loadTexts: alaIpmsPolicyDestIpAddr.setStatus('current')
alaIpmsPolicySrcIpAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 9, 1, 1, 2), IpAddress())
if mibBuilder.loadTexts: alaIpmsPolicySrcIpAddr.setStatus('current')
alaIpmsPolicySrcMacAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 9, 1, 1, 3), MacAddress()).setMaxAccess("readonly")
if mibBuilder.loadTexts: alaIpmsPolicySrcMacAddr.setStatus('current')
alaIpmsPolicySrcVlan = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 9, 1, 1, 4), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 4094)))
if mibBuilder.loadTexts: alaIpmsPolicySrcVlan.setStatus('current')
alaIpmsPolicySrcIfIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 9, 1, 1, 5), InterfaceIndex())
if mibBuilder.loadTexts: alaIpmsPolicySrcIfIndex.setStatus('current')
alaIpmsPolicyUniIpAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 9, 1, 1, 6), IpAddress())
if mibBuilder.loadTexts: alaIpmsPolicyUniIpAddr.setStatus('current')
alaIpmsPolicySrcVci = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 9, 1, 1, 7), Unsigned32())
if mibBuilder.loadTexts: alaIpmsPolicySrcVci.setStatus('current')
alaIpmsPolicySrcType = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 9, 1, 1, 8), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3))).clone(namedValues=NamedValues(("native", 0), ("ipip", 1), ("pim", 2), ("cmm", 3))))
if mibBuilder.loadTexts: alaIpmsPolicySrcType.setStatus('current')
alaIpmsPolicyPolicy = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 9, 1, 1, 9), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1))).clone(namedValues=NamedValues(("membership", 1))))
if mibBuilder.loadTexts: alaIpmsPolicyPolicy.setStatus('current')
alaIpmsPolicyDisposition = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 9, 1, 1, 10), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1))).clone(namedValues=NamedValues(("drop", 0), ("accept", 1)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: alaIpmsPolicyDisposition.setStatus('current')
alaIpmsPolicyTimeout = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 9, 1, 1, 11), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: alaIpmsPolicyTimeout.setStatus('current')
alaIpmsStaticMember = MibIdentifier((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 10))
alaIpmsStaticMemberTable = MibTable((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 10, 1), )
if mibBuilder.loadTexts: alaIpmsStaticMemberTable.setStatus('current')
alaIpmsStaticMemberEntry = MibTableRow((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 10, 1, 1), ).setIndexNames((0, "ALCATEL-IND1-IPMS-MIB", "alaIpmsStaticMemberGroupAddr"), (0, "ALCATEL-IND1-IPMS-MIB", "alaIpmsStaticMemberVlan"), (0, "ALCATEL-IND1-IPMS-MIB", "alaIpmsStaticMemberIfIndex"), (0, "ALCATEL-IND1-IPMS-MIB", "alaIpmsStaticMemberVci"))
if mibBuilder.loadTexts: alaIpmsStaticMemberEntry.setStatus('current')
alaIpmsStaticMemberGroupAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 10, 1, 1, 1), IpAddress())
if mibBuilder.loadTexts: alaIpmsStaticMemberGroupAddr.setStatus('current')
alaIpmsStaticMemberIGMPVersion = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 10, 1, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(2, 3))).clone(namedValues=NamedValues(("igmpv2", 2), ("igmpv3", 3))))
if mibBuilder.loadTexts: alaIpmsStaticMemberIGMPVersion.setStatus('current')
alaIpmsStaticMemberVlan = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 10, 1, 1, 3), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 4094)))
if mibBuilder.loadTexts: alaIpmsStaticMemberVlan.setStatus('current')
alaIpmsStaticMemberIfIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 10, 1, 1, 4), InterfaceIndex())
if mibBuilder.loadTexts: alaIpmsStaticMemberIfIndex.setStatus('current')
alaIpmsStaticMemberVci = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 10, 1, 1, 5), Unsigned32())
if mibBuilder.loadTexts: alaIpmsStaticMemberVci.setStatus('current')
alaIpmsStaticMemberRowStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 10, 1, 1, 6), RowStatus()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: alaIpmsStaticMemberRowStatus.setStatus('current')
alcatelIND1IPMSMIBConformance = MibIdentifier((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 2))
alcatelIND1IPMSMIBCompliances = MibIdentifier((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 2, 1))
alcatelIND1IPMSMIBGroups = MibIdentifier((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 2, 2))
alaIpmsCompliance = ModuleCompliance((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 2, 1, 1)).setObjects(("ALCATEL-IND1-IPMS-MIB", "alaIpmsConfig"), ("ALCATEL-IND1-IPMS-MIB", "alaIpmsGroup"), ("ALCATEL-IND1-IPMS-MIB", "alaIpmsNeighbor"), ("ALCATEL-IND1-IPMS-MIB", "alaIpmsStaticNeighbor"), ("ALCATEL-IND1-IPMS-MIB", "alaIpmsQuerier"), ("ALCATEL-IND1-IPMS-MIB", "alaIpmsStaticQuerier"), ("ALCATEL-IND1-IPMS-MIB", "alaIpmsSource"), ("ALCATEL-IND1-IPMS-MIB", "alaIpmsForward"), ("ALCATEL-IND1-IPMS-MIB", "alaIpmsPolicy"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
alaIpmsCompliance = alaIpmsCompliance.setStatus('current')
alaIpmsConfigGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 2, 2, 1)).setObjects(("ALCATEL-IND1-IPMS-MIB", "alaIpmsStatus"), ("ALCATEL-IND1-IPMS-MIB", "alaIpmsLeaveTimeout"), ("ALCATEL-IND1-IPMS-MIB", "alaIpmsQueryInterval"), ("ALCATEL-IND1-IPMS-MIB", "alaIpmsNeighborTimer"), ("ALCATEL-IND1-IPMS-MIB", "alaIpmsQuerierTimer"), ("ALCATEL-IND1-IPMS-MIB", "alaIpmsMembershipTimer"), ("ALCATEL-IND1-IPMS-MIB", "alaIpmsOtherQuerierTimer"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
alaIpmsConfigGroup = alaIpmsConfigGroup.setStatus('current')
alaIpmsGroupGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 2, 2, 2)).setObjects(("ALCATEL-IND1-IPMS-MIB", "alaIpmsGroupClientMacAddr"), ("ALCATEL-IND1-IPMS-MIB", "alaIpmsGroupTimeout"), ("ALCATEL-IND1-IPMS-MIB", "alaIpmsGroupIGMPv3GroupType"), ("ALCATEL-IND1-IPMS-MIB", "alaIpmsGroupIGMPv3SrcTimeout"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
alaIpmsGroupGroup = alaIpmsGroupGroup.setStatus('current')
alaIpmsNeighborGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 2, 2, 3)).setObjects(("ALCATEL-IND1-IPMS-MIB", "alaIpmsNeighborVlan"), ("ALCATEL-IND1-IPMS-MIB", "alaIpmsNeighborIfIndex"), ("ALCATEL-IND1-IPMS-MIB", "alaIpmsNeighborVci"), ("ALCATEL-IND1-IPMS-MIB", "alaIpmsNeighborType"), ("ALCATEL-IND1-IPMS-MIB", "alaIpmsNeighborTimeout"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
alaIpmsNeighborGroup = alaIpmsNeighborGroup.setStatus('current')
alaIpmsStaticNeighborGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 2, 2, 4)).setObjects(("ALCATEL-IND1-IPMS-MIB", "alaIpmsStaticNeighborRowStatus"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
alaIpmsStaticNeighborGroup = alaIpmsStaticNeighborGroup.setStatus('current')
alaIpmsQuerierGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 2, 2, 5)).setObjects(("ALCATEL-IND1-IPMS-MIB", "alaIpmsQuerierVlan"), ("ALCATEL-IND1-IPMS-MIB", "alaIpmsQuerierIfIndex"), ("ALCATEL-IND1-IPMS-MIB", "alaIpmsQuerierVci"), ("ALCATEL-IND1-IPMS-MIB", "alaIpmsQuerierType"), ("ALCATEL-IND1-IPMS-MIB", "alaIpmsQuerierTimeout"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
alaIpmsQuerierGroup = alaIpmsQuerierGroup.setStatus('current')
alaIpmsStaticQuerierGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 2, 2, 6)).setObjects(("ALCATEL-IND1-IPMS-MIB", "alaIpmsStaticQuerierRowStatus"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
alaIpmsStaticQuerierGroup = alaIpmsStaticQuerierGroup.setStatus('current')
alaIpmsSourceGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 2, 2, 7)).setObjects(("ALCATEL-IND1-IPMS-MIB", "alaIpmsSourceSrcMacAddr"), ("ALCATEL-IND1-IPMS-MIB", "alaIpmsSourceTimeout"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
alaIpmsSourceGroup = alaIpmsSourceGroup.setStatus('current')
alaIpmsForwardGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 2, 2, 8)).setObjects(("ALCATEL-IND1-IPMS-MIB", "alaIpmsForwardSrcTunIpAddr"), ("ALCATEL-IND1-IPMS-MIB", "alaIpmsForwardRtrMacAddr"), ("ALCATEL-IND1-IPMS-MIB", "alaIpmsForwardRtrTtl"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
alaIpmsForwardGroup = alaIpmsForwardGroup.setStatus('current')
alaIpmsPolicyGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 2, 2, 9)).setObjects(("ALCATEL-IND1-IPMS-MIB", "alaIpmsPolicySrcMacAddr"), ("ALCATEL-IND1-IPMS-MIB", "alaIpmsPolicyDisposition"), ("ALCATEL-IND1-IPMS-MIB", "alaIpmsPolicyTimeout"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
alaIpmsPolicyGroup = alaIpmsPolicyGroup.setStatus('current')
mibBuilder.exportSymbols("ALCATEL-IND1-IPMS-MIB", alaIpmsStaticNeighborRowStatus=alaIpmsStaticNeighborRowStatus, alaIpmsQuerierVlan=alaIpmsQuerierVlan, alaIpmsStaticQuerier=alaIpmsStaticQuerier, alaIpmsGroupClientMacAddr=alaIpmsGroupClientMacAddr, alaIpmsNeighbor=alaIpmsNeighbor, alaIpmsStaticNeighborVci=alaIpmsStaticNeighborVci, alaIpmsPolicyUniIpAddr=alaIpmsPolicyUniIpAddr, alaIpmsForwardSrcVlan=alaIpmsForwardSrcVlan, alaIpmsGroupDestIpAddr=alaIpmsGroupDestIpAddr, alaIpmsNeighborVci=alaIpmsNeighborVci, alaIpmsStaticNeighbor=alaIpmsStaticNeighbor, alaIpmsGroupGroup=alaIpmsGroupGroup, alaIpmsForwardDestVlan=alaIpmsForwardDestVlan, alaIpmsStaticQuerierIfIndex=alaIpmsStaticQuerierIfIndex, alcatelIND1IPMSMIBCompliances=alcatelIND1IPMSMIBCompliances, alaIpmsSourceSrcVlan=alaIpmsSourceSrcVlan, alaIpmsForwardSrcIfIndex=alaIpmsForwardSrcIfIndex, alaIpmsHardwareRoute=alaIpmsHardwareRoute, alaIpmsNeighborTimeout=alaIpmsNeighborTimeout, alaIpmsStaticMemberIGMPVersion=alaIpmsStaticMemberIGMPVersion, alaIpmsStaticNeighborTable=alaIpmsStaticNeighborTable, alaIpmsNeighborIpAddr=alaIpmsNeighborIpAddr, alaIpmsForwardDestTunIpAddr=alaIpmsForwardDestTunIpAddr, alaIpmsSourceEntry=alaIpmsSourceEntry, alaIpmsPolicySrcVci=alaIpmsPolicySrcVci, alaIpmsForwardSrcType=alaIpmsForwardSrcType, alaIpmsQuerierIpAddr=alaIpmsQuerierIpAddr, alaIpmsOtherQuerierTimer=alaIpmsOtherQuerierTimer, alaIpmsGroupClientIfIndex=alaIpmsGroupClientIfIndex, alaIpmsForwardSrcVci=alaIpmsForwardSrcVci, alaIpmsStaticMember=alaIpmsStaticMember, alaIpmsPolicySrcIpAddr=alaIpmsPolicySrcIpAddr, alaIpmsForwardSrcIpAddr=alaIpmsForwardSrcIpAddr, alaIpmsPolicySrcMacAddr=alaIpmsPolicySrcMacAddr, alaIpmsStaticQuerierGroup=alaIpmsStaticQuerierGroup, alaIpmsStaticMemberVci=alaIpmsStaticMemberVci, alaIpmsPolicyTable=alaIpmsPolicyTable, alaIpmsMembershipTimer=alaIpmsMembershipTimer, alaIpmsStaticNeighborIGMPVersion=alaIpmsStaticNeighborIGMPVersion, alaIpmsSourceSrcVci=alaIpmsSourceSrcVci, alaIpmsForwardUniIpAddr=alaIpmsForwardUniIpAddr, alaIpmsPolicySrcType=alaIpmsPolicySrcType, alaIpmsGroupEntry=alaIpmsGroupEntry, alaIpmsNeighborGroup=alaIpmsNeighborGroup, alaIpmsSourceSrcMacAddr=alaIpmsSourceSrcMacAddr, alaIpmsStaticNeighborVlan=alaIpmsStaticNeighborVlan, alaIpmsStaticNeighborIfIndex=alaIpmsStaticNeighborIfIndex, alaIpmsQueryInterval=alaIpmsQueryInterval, alaIpmsPolicyGroup=alaIpmsPolicyGroup, alaIpmsForwardRtrMacAddr=alaIpmsForwardRtrMacAddr, alaIpmsStaticMemberEntry=alaIpmsStaticMemberEntry, alaIpmsNeighborTimer=alaIpmsNeighborTimer, alaIpmsConfig=alaIpmsConfig, alaIpmsForwardTable=alaIpmsForwardTable, alaIpmsQuerierGroup=alaIpmsQuerierGroup, alaIpmsGroup=alaIpmsGroup, alaIpmsGroupClientVlan=alaIpmsGroupClientVlan, alaIpmsNeighborVlan=alaIpmsNeighborVlan, alaIpmsMaxBandwidth=alaIpmsMaxBandwidth, alaIpmsSourceGroup=alaIpmsSourceGroup, alaIpmsGroupTable=alaIpmsGroupTable, alaIpmsPolicy=alaIpmsPolicy, alaIpmsConfigGroup=alaIpmsConfigGroup, alaIpmsForwardDestIfIndex=alaIpmsForwardDestIfIndex, alaIpmsSourceSrcType=alaIpmsSourceSrcType, alaIpmsSourceDestIpAddr=alaIpmsSourceDestIpAddr, alaIpmsPolicyDisposition=alaIpmsPolicyDisposition, alaIpmsQuerierTimeout=alaIpmsQuerierTimeout, alaIpmsGroupIGMPv3SrcTimeout=alaIpmsGroupIGMPv3SrcTimeout, alaIpmsStaticMemberRowStatus=alaIpmsStaticMemberRowStatus, alcatelIND1IPMSMIBObjects=alcatelIND1IPMSMIBObjects, PYSNMP_MODULE_ID=alcatelIND1IPMSMIB, alaIpmsSourceSrcIfIndex=alaIpmsSourceSrcIfIndex, alaIpmsPolicyEntry=alaIpmsPolicyEntry, alaIpmsPolicyPolicy=alaIpmsPolicyPolicy, alaIpmsStaticQuerierVci=alaIpmsStaticQuerierVci, alaIpmsQuerierEntry=alaIpmsQuerierEntry, alaIpmsSource=alaIpmsSource, alaIpmsGroupClientIpAddr=alaIpmsGroupClientIpAddr, alaIpmsIGMPMembershipProxyVersion=alaIpmsIGMPMembershipProxyVersion, alaIpmsNeighborEntry=alaIpmsNeighborEntry, alaIpmsNeighborType=alaIpmsNeighborType, alaIpmsStaticQuerierVlan=alaIpmsStaticQuerierVlan, alaIpmsGroupTimeout=alaIpmsGroupTimeout, alaIpmsPolicySrcVlan=alaIpmsPolicySrcVlan, alaIpmsForwardEntry=alaIpmsForwardEntry, alaIpmsQuerierTable=alaIpmsQuerierTable, alaIpmsForwardGroup=alaIpmsForwardGroup, alaIpmsGroupIGMPv3SrcIP=alaIpmsGroupIGMPv3SrcIP, alaIpmsSourceSrcIpAddr=alaIpmsSourceSrcIpAddr, alaIpmsGroupIGMPVersion=alaIpmsGroupIGMPVersion, alaIpmsSourceTimeout=alaIpmsSourceTimeout, alcatelIND1IPMSMIBConformance=alcatelIND1IPMSMIBConformance, alaIpmsQuerierTimer=alaIpmsQuerierTimer, alaIpmsStaticNeighborGroup=alaIpmsStaticNeighborGroup, alaIpmsPolicySrcIfIndex=alaIpmsPolicySrcIfIndex, alaIpmsForwardRtrTtl=alaIpmsForwardRtrTtl, alaIpmsPolicyTimeout=alaIpmsPolicyTimeout, alaIpmsStaticMemberTable=alaIpmsStaticMemberTable, alaIpmsStatus=alaIpmsStatus, alaIpmsStaticMemberGroupAddr=alaIpmsStaticMemberGroupAddr, alaIpmsGroupIGMPv3GroupType=alaIpmsGroupIGMPv3GroupType, alaIpmsForwardDestType=alaIpmsForwardDestType, alaIpmsForwardDestIpAddr=alaIpmsForwardDestIpAddr, alaIpmsStaticQuerierTable=alaIpmsStaticQuerierTable, alcatelIND1IPMSMIB=alcatelIND1IPMSMIB, alaIpmsQuerierVci=alaIpmsQuerierVci, alaIpmsStaticQuerierRowStatus=alaIpmsStaticQuerierRowStatus, alaIpmsStaticMemberVlan=alaIpmsStaticMemberVlan, alaIpmsLeaveTimeout=alaIpmsLeaveTimeout, alaIpmsStaticMemberIfIndex=alaIpmsStaticMemberIfIndex, alcatelIND1IPMSMIBGroups=alcatelIND1IPMSMIBGroups, alaIpmsPolicyDestIpAddr=alaIpmsPolicyDestIpAddr, alaIpmsStaticQuerierEntry=alaIpmsStaticQuerierEntry, alaIpmsForward=alaIpmsForward, alaIpmsGroupClientVci=alaIpmsGroupClientVci, alaIpmsGroupIGMPv3SrcType=alaIpmsGroupIGMPv3SrcType, alaIpmsForwardSrcTunIpAddr=alaIpmsForwardSrcTunIpAddr, alaIpmsStaticQuerierIGMPVersion=alaIpmsStaticQuerierIGMPVersion, alaIpmsSourceUniIpAddr=alaIpmsSourceUniIpAddr, alaIpmsQuerier=alaIpmsQuerier, alaIpmsPriority=alaIpmsPriority, alaIpmsQuerierIfIndex=alaIpmsQuerierIfIndex, alaIpmsNeighborIfIndex=alaIpmsNeighborIfIndex, alaIpmsCompliance=alaIpmsCompliance, alaIpmsNeighborTable=alaIpmsNeighborTable, alaIpmsSourceTable=alaIpmsSourceTable, alaIpmsQuerierType=alaIpmsQuerierType, alaIpmsStaticNeighborEntry=alaIpmsStaticNeighborEntry)
| (softent_ind1_ipms,) = mibBuilder.importSymbols('ALCATEL-IND1-BASE', 'softentIND1Ipms')
(octet_string, object_identifier, integer) = mibBuilder.importSymbols('ASN1', 'OctetString', 'ObjectIdentifier', 'Integer')
(named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues')
(single_value_constraint, constraints_intersection, value_range_constraint, constraints_union, value_size_constraint) = mibBuilder.importSymbols('ASN1-REFINEMENT', 'SingleValueConstraint', 'ConstraintsIntersection', 'ValueRangeConstraint', 'ConstraintsUnion', 'ValueSizeConstraint')
(interface_index,) = mibBuilder.importSymbols('IF-MIB', 'InterfaceIndex')
(object_group, notification_group, module_compliance) = mibBuilder.importSymbols('SNMPv2-CONF', 'ObjectGroup', 'NotificationGroup', 'ModuleCompliance')
(mib_scalar, mib_table, mib_table_row, mib_table_column, ip_address, time_ticks, counter32, counter64, mib_identifier, bits, integer32, object_identity, notification_type, gauge32, iso, module_identity, unsigned32) = mibBuilder.importSymbols('SNMPv2-SMI', 'MibScalar', 'MibTable', 'MibTableRow', 'MibTableColumn', 'IpAddress', 'TimeTicks', 'Counter32', 'Counter64', 'MibIdentifier', 'Bits', 'Integer32', 'ObjectIdentity', 'NotificationType', 'Gauge32', 'iso', 'ModuleIdentity', 'Unsigned32')
(textual_convention, row_status, display_string, mac_address) = mibBuilder.importSymbols('SNMPv2-TC', 'TextualConvention', 'RowStatus', 'DisplayString', 'MacAddress')
alcatel_ind1_ipmsmib = module_identity((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1))
alcatelIND1IPMSMIB.setRevisions(('2007-04-03 00:00',))
if mibBuilder.loadTexts:
alcatelIND1IPMSMIB.setLastUpdated('200704030000Z')
if mibBuilder.loadTexts:
alcatelIND1IPMSMIB.setOrganization('Alcatel-Lucent')
alcatel_ind1_ipmsmib_objects = mib_identifier((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1))
ala_ipms_config = mib_identifier((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 1))
ala_ipms_status = mib_scalar((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 1, 1), 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:
alaIpmsStatus.setStatus('current')
ala_ipms_leave_timeout = mib_scalar((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 1, 2), unsigned32().clone(1)).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
alaIpmsLeaveTimeout.setStatus('current')
ala_ipms_query_interval = mib_scalar((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 1, 3), unsigned32().clone(125)).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
alaIpmsQueryInterval.setStatus('current')
ala_ipms_neighbor_timer = mib_scalar((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 1, 4), unsigned32().clone(90)).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
alaIpmsNeighborTimer.setStatus('current')
ala_ipms_querier_timer = mib_scalar((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 1, 5), unsigned32().clone(260)).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
alaIpmsQuerierTimer.setStatus('current')
ala_ipms_membership_timer = mib_scalar((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 1, 6), unsigned32().clone(260)).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
alaIpmsMembershipTimer.setStatus('current')
ala_ipms_priority = mib_scalar((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 1, 7), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(4, 3, 2, 1, 0))).clone(namedValues=named_values(('unsupported', 4), ('urgent', 3), ('high', 2), ('medium', 1), ('low', 0))).clone('low')).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
alaIpmsPriority.setStatus('current')
ala_ipms_max_bandwidth = mib_scalar((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 1, 8), unsigned32().clone(10)).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
alaIpmsMaxBandwidth.setStatus('current')
ala_ipms_hardware_route = mib_scalar((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 1, 9), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(0, 1, 2))).clone(namedValues=named_values(('unsupported', 0), ('enable', 1), ('disable', 2))).clone('disable')).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
alaIpmsHardwareRoute.setStatus('current')
ala_ipms_igmp_membership_proxy_version = mib_scalar((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 1, 10), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3))).clone(namedValues=named_values(('igmpv1', 1), ('igmpv2', 2), ('igmpv3', 3))).clone('igmpv2')).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
alaIpmsIGMPMembershipProxyVersion.setStatus('current')
ala_ipms_other_querier_timer = mib_scalar((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 1, 11), unsigned32().clone(255)).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
alaIpmsOtherQuerierTimer.setStatus('current')
ala_ipms_group = mib_identifier((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 2))
ala_ipms_group_table = mib_table((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 2, 1))
if mibBuilder.loadTexts:
alaIpmsGroupTable.setStatus('current')
ala_ipms_group_entry = mib_table_row((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 2, 1, 1)).setIndexNames((0, 'ALCATEL-IND1-IPMS-MIB', 'alaIpmsGroupDestIpAddr'), (0, 'ALCATEL-IND1-IPMS-MIB', 'alaIpmsGroupClientIpAddr'), (0, 'ALCATEL-IND1-IPMS-MIB', 'alaIpmsGroupClientVlan'), (0, 'ALCATEL-IND1-IPMS-MIB', 'alaIpmsGroupClientIfIndex'), (0, 'ALCATEL-IND1-IPMS-MIB', 'alaIpmsGroupClientVci'), (0, 'ALCATEL-IND1-IPMS-MIB', 'alaIpmsGroupIGMPVersion'), (0, 'ALCATEL-IND1-IPMS-MIB', 'alaIpmsGroupIGMPv3SrcIP'), (0, 'ALCATEL-IND1-IPMS-MIB', 'alaIpmsGroupIGMPv3SrcType'))
if mibBuilder.loadTexts:
alaIpmsGroupEntry.setStatus('current')
ala_ipms_group_dest_ip_addr = mib_table_column((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 2, 1, 1, 1), ip_address())
if mibBuilder.loadTexts:
alaIpmsGroupDestIpAddr.setStatus('current')
ala_ipms_group_client_ip_addr = mib_table_column((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 2, 1, 1, 2), ip_address())
if mibBuilder.loadTexts:
alaIpmsGroupClientIpAddr.setStatus('current')
ala_ipms_group_client_mac_addr = mib_table_column((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 2, 1, 1, 3), mac_address()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
alaIpmsGroupClientMacAddr.setStatus('current')
ala_ipms_group_client_vlan = mib_table_column((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 2, 1, 1, 4), integer32().subtype(subtypeSpec=value_range_constraint(1, 4094)))
if mibBuilder.loadTexts:
alaIpmsGroupClientVlan.setStatus('current')
ala_ipms_group_client_if_index = mib_table_column((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 2, 1, 1, 5), interface_index())
if mibBuilder.loadTexts:
alaIpmsGroupClientIfIndex.setStatus('current')
ala_ipms_group_client_vci = mib_table_column((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 2, 1, 1, 6), unsigned32())
if mibBuilder.loadTexts:
alaIpmsGroupClientVci.setStatus('current')
ala_ipms_group_igmp_version = mib_table_column((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 2, 1, 1, 7), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3))).clone(namedValues=named_values(('igmpv1', 1), ('igmpv2', 2), ('igmpv3', 3)))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
alaIpmsGroupIGMPVersion.setStatus('current')
ala_ipms_group_igm_pv3_src_ip = mib_table_column((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 2, 1, 1, 8), ip_address())
if mibBuilder.loadTexts:
alaIpmsGroupIGMPv3SrcIP.setStatus('current')
ala_ipms_group_igm_pv3_src_type = mib_table_column((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 2, 1, 1, 9), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(0, 1, 2))).clone(namedValues=named_values(('na', 0), ('include', 1), ('exclude', 2)))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
alaIpmsGroupIGMPv3SrcType.setStatus('current')
ala_ipms_group_igm_pv3_src_timeout = mib_table_column((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 2, 1, 1, 10), unsigned32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
alaIpmsGroupIGMPv3SrcTimeout.setStatus('current')
ala_ipms_group_igm_pv3_group_type = mib_table_column((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 2, 1, 1, 11), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(0, 1, 2))).clone(namedValues=named_values(('na', 0), ('include', 1), ('exclude', 2)))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
alaIpmsGroupIGMPv3GroupType.setStatus('current')
ala_ipms_group_timeout = mib_table_column((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 2, 1, 1, 12), unsigned32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
alaIpmsGroupTimeout.setStatus('current')
ala_ipms_neighbor = mib_identifier((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 3))
ala_ipms_neighbor_table = mib_table((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 3, 1))
if mibBuilder.loadTexts:
alaIpmsNeighborTable.setStatus('current')
ala_ipms_neighbor_entry = mib_table_row((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 3, 1, 1)).setIndexNames((0, 'ALCATEL-IND1-IPMS-MIB', 'alaIpmsNeighborIpAddr'))
if mibBuilder.loadTexts:
alaIpmsNeighborEntry.setStatus('current')
ala_ipms_neighbor_ip_addr = mib_table_column((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 3, 1, 1, 1), ip_address())
if mibBuilder.loadTexts:
alaIpmsNeighborIpAddr.setStatus('current')
ala_ipms_neighbor_vlan = mib_table_column((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 3, 1, 1, 2), integer32().subtype(subtypeSpec=value_range_constraint(1, 4094))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
alaIpmsNeighborVlan.setStatus('current')
ala_ipms_neighbor_if_index = mib_table_column((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 3, 1, 1, 3), interface_index()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
alaIpmsNeighborIfIndex.setStatus('current')
ala_ipms_neighbor_vci = mib_table_column((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 3, 1, 1, 4), unsigned32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
alaIpmsNeighborVci.setStatus('current')
ala_ipms_neighbor_type = mib_table_column((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 3, 1, 1, 5), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(0, 1, 2, 3))).clone(namedValues=named_values(('native', 0), ('ipip', 1), ('pim', 2), ('cmm', 3)))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
alaIpmsNeighborType.setStatus('current')
ala_ipms_neighbor_timeout = mib_table_column((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 3, 1, 1, 6), unsigned32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
alaIpmsNeighborTimeout.setStatus('current')
ala_ipms_static_neighbor = mib_identifier((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 4))
ala_ipms_static_neighbor_table = mib_table((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 4, 1))
if mibBuilder.loadTexts:
alaIpmsStaticNeighborTable.setStatus('current')
ala_ipms_static_neighbor_entry = mib_table_row((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 4, 1, 1)).setIndexNames((0, 'ALCATEL-IND1-IPMS-MIB', 'alaIpmsStaticNeighborVlan'), (0, 'ALCATEL-IND1-IPMS-MIB', 'alaIpmsStaticNeighborIfIndex'), (0, 'ALCATEL-IND1-IPMS-MIB', 'alaIpmsStaticNeighborVci'))
if mibBuilder.loadTexts:
alaIpmsStaticNeighborEntry.setStatus('current')
ala_ipms_static_neighbor_vlan = mib_table_column((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 4, 1, 1, 1), integer32().subtype(subtypeSpec=value_range_constraint(1, 4094)))
if mibBuilder.loadTexts:
alaIpmsStaticNeighborVlan.setStatus('current')
ala_ipms_static_neighbor_if_index = mib_table_column((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 4, 1, 1, 2), interface_index())
if mibBuilder.loadTexts:
alaIpmsStaticNeighborIfIndex.setStatus('current')
ala_ipms_static_neighbor_vci = mib_table_column((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 4, 1, 1, 3), unsigned32())
if mibBuilder.loadTexts:
alaIpmsStaticNeighborVci.setStatus('current')
ala_ipms_static_neighbor_igmp_version = mib_table_column((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 4, 1, 1, 4), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(2, 3))).clone(namedValues=named_values(('igmpv2', 2), ('igmpv3', 3)))).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
alaIpmsStaticNeighborIGMPVersion.setStatus('current')
ala_ipms_static_neighbor_row_status = mib_table_column((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 4, 1, 1, 5), row_status()).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
alaIpmsStaticNeighborRowStatus.setStatus('current')
ala_ipms_querier = mib_identifier((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 5))
ala_ipms_querier_table = mib_table((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 5, 1))
if mibBuilder.loadTexts:
alaIpmsQuerierTable.setStatus('current')
ala_ipms_querier_entry = mib_table_row((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 5, 1, 1)).setIndexNames((0, 'ALCATEL-IND1-IPMS-MIB', 'alaIpmsQuerierIpAddr'))
if mibBuilder.loadTexts:
alaIpmsQuerierEntry.setStatus('current')
ala_ipms_querier_ip_addr = mib_table_column((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 5, 1, 1, 1), ip_address())
if mibBuilder.loadTexts:
alaIpmsQuerierIpAddr.setStatus('current')
ala_ipms_querier_vlan = mib_table_column((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 5, 1, 1, 2), integer32().subtype(subtypeSpec=value_range_constraint(1, 4094))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
alaIpmsQuerierVlan.setStatus('current')
ala_ipms_querier_if_index = mib_table_column((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 5, 1, 1, 3), interface_index()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
alaIpmsQuerierIfIndex.setStatus('current')
ala_ipms_querier_vci = mib_table_column((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 5, 1, 1, 4), unsigned32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
alaIpmsQuerierVci.setStatus('current')
ala_ipms_querier_type = mib_table_column((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 5, 1, 1, 5), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(0, 1, 2, 3))).clone(namedValues=named_values(('native', 0), ('ipip', 1), ('pim', 2), ('cmm', 3)))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
alaIpmsQuerierType.setStatus('current')
ala_ipms_querier_timeout = mib_table_column((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 5, 1, 1, 6), unsigned32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
alaIpmsQuerierTimeout.setStatus('current')
ala_ipms_static_querier = mib_identifier((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 6))
ala_ipms_static_querier_table = mib_table((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 6, 1))
if mibBuilder.loadTexts:
alaIpmsStaticQuerierTable.setStatus('current')
ala_ipms_static_querier_entry = mib_table_row((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 6, 1, 1)).setIndexNames((0, 'ALCATEL-IND1-IPMS-MIB', 'alaIpmsStaticQuerierVlan'), (0, 'ALCATEL-IND1-IPMS-MIB', 'alaIpmsStaticQuerierIfIndex'), (0, 'ALCATEL-IND1-IPMS-MIB', 'alaIpmsStaticQuerierVci'))
if mibBuilder.loadTexts:
alaIpmsStaticQuerierEntry.setStatus('current')
ala_ipms_static_querier_vlan = mib_table_column((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 6, 1, 1, 1), integer32().subtype(subtypeSpec=value_range_constraint(1, 4094)))
if mibBuilder.loadTexts:
alaIpmsStaticQuerierVlan.setStatus('current')
ala_ipms_static_querier_if_index = mib_table_column((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 6, 1, 1, 2), interface_index())
if mibBuilder.loadTexts:
alaIpmsStaticQuerierIfIndex.setStatus('current')
ala_ipms_static_querier_vci = mib_table_column((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 6, 1, 1, 3), unsigned32())
if mibBuilder.loadTexts:
alaIpmsStaticQuerierVci.setStatus('current')
ala_ipms_static_querier_igmp_version = mib_table_column((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 6, 1, 1, 4), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(2, 3))).clone(namedValues=named_values(('igmpv2', 2), ('igmpv3', 3)))).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
alaIpmsStaticQuerierIGMPVersion.setStatus('current')
ala_ipms_static_querier_row_status = mib_table_column((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 6, 1, 1, 5), row_status()).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
alaIpmsStaticQuerierRowStatus.setStatus('current')
ala_ipms_source = mib_identifier((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 7))
ala_ipms_source_table = mib_table((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 7, 1))
if mibBuilder.loadTexts:
alaIpmsSourceTable.setStatus('current')
ala_ipms_source_entry = mib_table_row((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 7, 1, 1)).setIndexNames((0, 'ALCATEL-IND1-IPMS-MIB', 'alaIpmsSourceDestIpAddr'), (0, 'ALCATEL-IND1-IPMS-MIB', 'alaIpmsSourceSrcIpAddr'), (0, 'ALCATEL-IND1-IPMS-MIB', 'alaIpmsSourceSrcVlan'), (0, 'ALCATEL-IND1-IPMS-MIB', 'alaIpmsSourceSrcIfIndex'), (0, 'ALCATEL-IND1-IPMS-MIB', 'alaIpmsSourceUniIpAddr'), (0, 'ALCATEL-IND1-IPMS-MIB', 'alaIpmsSourceSrcVci'), (0, 'ALCATEL-IND1-IPMS-MIB', 'alaIpmsSourceSrcType'))
if mibBuilder.loadTexts:
alaIpmsSourceEntry.setStatus('current')
ala_ipms_source_dest_ip_addr = mib_table_column((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 7, 1, 1, 1), ip_address())
if mibBuilder.loadTexts:
alaIpmsSourceDestIpAddr.setStatus('current')
ala_ipms_source_src_ip_addr = mib_table_column((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 7, 1, 1, 2), ip_address())
if mibBuilder.loadTexts:
alaIpmsSourceSrcIpAddr.setStatus('current')
ala_ipms_source_src_mac_addr = mib_table_column((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 7, 1, 1, 3), mac_address()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
alaIpmsSourceSrcMacAddr.setStatus('current')
ala_ipms_source_src_vlan = mib_table_column((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 7, 1, 1, 4), integer32().subtype(subtypeSpec=value_range_constraint(1, 4094)))
if mibBuilder.loadTexts:
alaIpmsSourceSrcVlan.setStatus('current')
ala_ipms_source_src_if_index = mib_table_column((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 7, 1, 1, 5), interface_index())
if mibBuilder.loadTexts:
alaIpmsSourceSrcIfIndex.setStatus('current')
ala_ipms_source_uni_ip_addr = mib_table_column((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 7, 1, 1, 6), ip_address())
if mibBuilder.loadTexts:
alaIpmsSourceUniIpAddr.setStatus('current')
ala_ipms_source_src_vci = mib_table_column((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 7, 1, 1, 7), unsigned32())
if mibBuilder.loadTexts:
alaIpmsSourceSrcVci.setStatus('current')
ala_ipms_source_src_type = mib_table_column((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 7, 1, 1, 8), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(0, 1, 2, 3))).clone(namedValues=named_values(('native', 0), ('ipip', 1), ('pim', 2), ('cmm', 3))))
if mibBuilder.loadTexts:
alaIpmsSourceSrcType.setStatus('current')
ala_ipms_source_timeout = mib_table_column((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 7, 1, 1, 9), unsigned32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
alaIpmsSourceTimeout.setStatus('current')
ala_ipms_forward = mib_identifier((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 8))
ala_ipms_forward_table = mib_table((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 8, 1))
if mibBuilder.loadTexts:
alaIpmsForwardTable.setStatus('current')
ala_ipms_forward_entry = mib_table_row((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 8, 1, 1)).setIndexNames((0, 'ALCATEL-IND1-IPMS-MIB', 'alaIpmsForwardDestIpAddr'), (0, 'ALCATEL-IND1-IPMS-MIB', 'alaIpmsForwardSrcIpAddr'), (0, 'ALCATEL-IND1-IPMS-MIB', 'alaIpmsForwardDestVlan'), (0, 'ALCATEL-IND1-IPMS-MIB', 'alaIpmsForwardSrcVlan'), (0, 'ALCATEL-IND1-IPMS-MIB', 'alaIpmsForwardSrcIfIndex'), (0, 'ALCATEL-IND1-IPMS-MIB', 'alaIpmsForwardUniIpAddr'), (0, 'ALCATEL-IND1-IPMS-MIB', 'alaIpmsForwardSrcVci'), (0, 'ALCATEL-IND1-IPMS-MIB', 'alaIpmsForwardDestType'), (0, 'ALCATEL-IND1-IPMS-MIB', 'alaIpmsForwardSrcType'), (0, 'ALCATEL-IND1-IPMS-MIB', 'alaIpmsForwardDestIfIndex'), (0, 'ALCATEL-IND1-IPMS-MIB', 'alaIpmsForwardDestTunIpAddr'))
if mibBuilder.loadTexts:
alaIpmsForwardEntry.setStatus('current')
ala_ipms_forward_dest_ip_addr = mib_table_column((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 8, 1, 1, 1), ip_address())
if mibBuilder.loadTexts:
alaIpmsForwardDestIpAddr.setStatus('current')
ala_ipms_forward_src_ip_addr = mib_table_column((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 8, 1, 1, 2), ip_address())
if mibBuilder.loadTexts:
alaIpmsForwardSrcIpAddr.setStatus('current')
ala_ipms_forward_dest_vlan = mib_table_column((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 8, 1, 1, 3), integer32().subtype(subtypeSpec=value_range_constraint(1, 4094)))
if mibBuilder.loadTexts:
alaIpmsForwardDestVlan.setStatus('current')
ala_ipms_forward_src_vlan = mib_table_column((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 8, 1, 1, 4), integer32().subtype(subtypeSpec=value_range_constraint(1, 4094)))
if mibBuilder.loadTexts:
alaIpmsForwardSrcVlan.setStatus('current')
ala_ipms_forward_src_if_index = mib_table_column((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 8, 1, 1, 5), interface_index())
if mibBuilder.loadTexts:
alaIpmsForwardSrcIfIndex.setStatus('current')
ala_ipms_forward_uni_ip_addr = mib_table_column((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 8, 1, 1, 6), ip_address())
if mibBuilder.loadTexts:
alaIpmsForwardUniIpAddr.setStatus('current')
ala_ipms_forward_src_vci = mib_table_column((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 8, 1, 1, 7), unsigned32())
if mibBuilder.loadTexts:
alaIpmsForwardSrcVci.setStatus('current')
ala_ipms_forward_dest_type = mib_table_column((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 8, 1, 1, 8), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(0, 1, 2, 3))).clone(namedValues=named_values(('native', 0), ('ipip', 1), ('pim', 2), ('cmm', 3))))
if mibBuilder.loadTexts:
alaIpmsForwardDestType.setStatus('current')
ala_ipms_forward_src_type = mib_table_column((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 8, 1, 1, 9), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(0, 1, 2, 3))).clone(namedValues=named_values(('native', 0), ('ipip', 1), ('pim', 2), ('cmm', 3))))
if mibBuilder.loadTexts:
alaIpmsForwardSrcType.setStatus('current')
ala_ipms_forward_dest_tun_ip_addr = mib_table_column((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 8, 1, 1, 10), ip_address())
if mibBuilder.loadTexts:
alaIpmsForwardDestTunIpAddr.setStatus('current')
ala_ipms_forward_src_tun_ip_addr = mib_table_column((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 8, 1, 1, 11), ip_address()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
alaIpmsForwardSrcTunIpAddr.setStatus('current')
ala_ipms_forward_rtr_mac_addr = mib_table_column((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 8, 1, 1, 12), mac_address()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
alaIpmsForwardRtrMacAddr.setStatus('current')
ala_ipms_forward_rtr_ttl = mib_table_column((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 8, 1, 1, 13), integer32().subtype(subtypeSpec=value_range_constraint(1, 255))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
alaIpmsForwardRtrTtl.setStatus('current')
ala_ipms_forward_dest_if_index = mib_table_column((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 8, 1, 1, 14), interface_index())
if mibBuilder.loadTexts:
alaIpmsForwardDestIfIndex.setStatus('current')
ala_ipms_policy = mib_identifier((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 9))
ala_ipms_policy_table = mib_table((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 9, 1))
if mibBuilder.loadTexts:
alaIpmsPolicyTable.setStatus('current')
ala_ipms_policy_entry = mib_table_row((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 9, 1, 1)).setIndexNames((0, 'ALCATEL-IND1-IPMS-MIB', 'alaIpmsPolicyDestIpAddr'), (0, 'ALCATEL-IND1-IPMS-MIB', 'alaIpmsPolicySrcIpAddr'), (0, 'ALCATEL-IND1-IPMS-MIB', 'alaIpmsPolicySrcVlan'), (0, 'ALCATEL-IND1-IPMS-MIB', 'alaIpmsPolicySrcIfIndex'), (0, 'ALCATEL-IND1-IPMS-MIB', 'alaIpmsPolicyUniIpAddr'), (0, 'ALCATEL-IND1-IPMS-MIB', 'alaIpmsPolicySrcVci'), (0, 'ALCATEL-IND1-IPMS-MIB', 'alaIpmsPolicySrcType'), (0, 'ALCATEL-IND1-IPMS-MIB', 'alaIpmsPolicyPolicy'))
if mibBuilder.loadTexts:
alaIpmsPolicyEntry.setStatus('current')
ala_ipms_policy_dest_ip_addr = mib_table_column((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 9, 1, 1, 1), ip_address())
if mibBuilder.loadTexts:
alaIpmsPolicyDestIpAddr.setStatus('current')
ala_ipms_policy_src_ip_addr = mib_table_column((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 9, 1, 1, 2), ip_address())
if mibBuilder.loadTexts:
alaIpmsPolicySrcIpAddr.setStatus('current')
ala_ipms_policy_src_mac_addr = mib_table_column((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 9, 1, 1, 3), mac_address()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
alaIpmsPolicySrcMacAddr.setStatus('current')
ala_ipms_policy_src_vlan = mib_table_column((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 9, 1, 1, 4), integer32().subtype(subtypeSpec=value_range_constraint(1, 4094)))
if mibBuilder.loadTexts:
alaIpmsPolicySrcVlan.setStatus('current')
ala_ipms_policy_src_if_index = mib_table_column((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 9, 1, 1, 5), interface_index())
if mibBuilder.loadTexts:
alaIpmsPolicySrcIfIndex.setStatus('current')
ala_ipms_policy_uni_ip_addr = mib_table_column((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 9, 1, 1, 6), ip_address())
if mibBuilder.loadTexts:
alaIpmsPolicyUniIpAddr.setStatus('current')
ala_ipms_policy_src_vci = mib_table_column((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 9, 1, 1, 7), unsigned32())
if mibBuilder.loadTexts:
alaIpmsPolicySrcVci.setStatus('current')
ala_ipms_policy_src_type = mib_table_column((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 9, 1, 1, 8), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(0, 1, 2, 3))).clone(namedValues=named_values(('native', 0), ('ipip', 1), ('pim', 2), ('cmm', 3))))
if mibBuilder.loadTexts:
alaIpmsPolicySrcType.setStatus('current')
ala_ipms_policy_policy = mib_table_column((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 9, 1, 1, 9), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1))).clone(namedValues=named_values(('membership', 1))))
if mibBuilder.loadTexts:
alaIpmsPolicyPolicy.setStatus('current')
ala_ipms_policy_disposition = mib_table_column((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 9, 1, 1, 10), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(0, 1))).clone(namedValues=named_values(('drop', 0), ('accept', 1)))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
alaIpmsPolicyDisposition.setStatus('current')
ala_ipms_policy_timeout = mib_table_column((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 9, 1, 1, 11), unsigned32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
alaIpmsPolicyTimeout.setStatus('current')
ala_ipms_static_member = mib_identifier((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 10))
ala_ipms_static_member_table = mib_table((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 10, 1))
if mibBuilder.loadTexts:
alaIpmsStaticMemberTable.setStatus('current')
ala_ipms_static_member_entry = mib_table_row((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 10, 1, 1)).setIndexNames((0, 'ALCATEL-IND1-IPMS-MIB', 'alaIpmsStaticMemberGroupAddr'), (0, 'ALCATEL-IND1-IPMS-MIB', 'alaIpmsStaticMemberVlan'), (0, 'ALCATEL-IND1-IPMS-MIB', 'alaIpmsStaticMemberIfIndex'), (0, 'ALCATEL-IND1-IPMS-MIB', 'alaIpmsStaticMemberVci'))
if mibBuilder.loadTexts:
alaIpmsStaticMemberEntry.setStatus('current')
ala_ipms_static_member_group_addr = mib_table_column((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 10, 1, 1, 1), ip_address())
if mibBuilder.loadTexts:
alaIpmsStaticMemberGroupAddr.setStatus('current')
ala_ipms_static_member_igmp_version = mib_table_column((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 10, 1, 1, 2), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(2, 3))).clone(namedValues=named_values(('igmpv2', 2), ('igmpv3', 3))))
if mibBuilder.loadTexts:
alaIpmsStaticMemberIGMPVersion.setStatus('current')
ala_ipms_static_member_vlan = mib_table_column((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 10, 1, 1, 3), integer32().subtype(subtypeSpec=value_range_constraint(1, 4094)))
if mibBuilder.loadTexts:
alaIpmsStaticMemberVlan.setStatus('current')
ala_ipms_static_member_if_index = mib_table_column((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 10, 1, 1, 4), interface_index())
if mibBuilder.loadTexts:
alaIpmsStaticMemberIfIndex.setStatus('current')
ala_ipms_static_member_vci = mib_table_column((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 10, 1, 1, 5), unsigned32())
if mibBuilder.loadTexts:
alaIpmsStaticMemberVci.setStatus('current')
ala_ipms_static_member_row_status = mib_table_column((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 10, 1, 1, 6), row_status()).setMaxAccess('readcreate')
if mibBuilder.loadTexts:
alaIpmsStaticMemberRowStatus.setStatus('current')
alcatel_ind1_ipmsmib_conformance = mib_identifier((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 2))
alcatel_ind1_ipmsmib_compliances = mib_identifier((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 2, 1))
alcatel_ind1_ipmsmib_groups = mib_identifier((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 2, 2))
ala_ipms_compliance = module_compliance((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 2, 1, 1)).setObjects(('ALCATEL-IND1-IPMS-MIB', 'alaIpmsConfig'), ('ALCATEL-IND1-IPMS-MIB', 'alaIpmsGroup'), ('ALCATEL-IND1-IPMS-MIB', 'alaIpmsNeighbor'), ('ALCATEL-IND1-IPMS-MIB', 'alaIpmsStaticNeighbor'), ('ALCATEL-IND1-IPMS-MIB', 'alaIpmsQuerier'), ('ALCATEL-IND1-IPMS-MIB', 'alaIpmsStaticQuerier'), ('ALCATEL-IND1-IPMS-MIB', 'alaIpmsSource'), ('ALCATEL-IND1-IPMS-MIB', 'alaIpmsForward'), ('ALCATEL-IND1-IPMS-MIB', 'alaIpmsPolicy'))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ala_ipms_compliance = alaIpmsCompliance.setStatus('current')
ala_ipms_config_group = object_group((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 2, 2, 1)).setObjects(('ALCATEL-IND1-IPMS-MIB', 'alaIpmsStatus'), ('ALCATEL-IND1-IPMS-MIB', 'alaIpmsLeaveTimeout'), ('ALCATEL-IND1-IPMS-MIB', 'alaIpmsQueryInterval'), ('ALCATEL-IND1-IPMS-MIB', 'alaIpmsNeighborTimer'), ('ALCATEL-IND1-IPMS-MIB', 'alaIpmsQuerierTimer'), ('ALCATEL-IND1-IPMS-MIB', 'alaIpmsMembershipTimer'), ('ALCATEL-IND1-IPMS-MIB', 'alaIpmsOtherQuerierTimer'))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ala_ipms_config_group = alaIpmsConfigGroup.setStatus('current')
ala_ipms_group_group = object_group((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 2, 2, 2)).setObjects(('ALCATEL-IND1-IPMS-MIB', 'alaIpmsGroupClientMacAddr'), ('ALCATEL-IND1-IPMS-MIB', 'alaIpmsGroupTimeout'), ('ALCATEL-IND1-IPMS-MIB', 'alaIpmsGroupIGMPv3GroupType'), ('ALCATEL-IND1-IPMS-MIB', 'alaIpmsGroupIGMPv3SrcTimeout'))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ala_ipms_group_group = alaIpmsGroupGroup.setStatus('current')
ala_ipms_neighbor_group = object_group((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 2, 2, 3)).setObjects(('ALCATEL-IND1-IPMS-MIB', 'alaIpmsNeighborVlan'), ('ALCATEL-IND1-IPMS-MIB', 'alaIpmsNeighborIfIndex'), ('ALCATEL-IND1-IPMS-MIB', 'alaIpmsNeighborVci'), ('ALCATEL-IND1-IPMS-MIB', 'alaIpmsNeighborType'), ('ALCATEL-IND1-IPMS-MIB', 'alaIpmsNeighborTimeout'))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ala_ipms_neighbor_group = alaIpmsNeighborGroup.setStatus('current')
ala_ipms_static_neighbor_group = object_group((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 2, 2, 4)).setObjects(('ALCATEL-IND1-IPMS-MIB', 'alaIpmsStaticNeighborRowStatus'))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ala_ipms_static_neighbor_group = alaIpmsStaticNeighborGroup.setStatus('current')
ala_ipms_querier_group = object_group((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 2, 2, 5)).setObjects(('ALCATEL-IND1-IPMS-MIB', 'alaIpmsQuerierVlan'), ('ALCATEL-IND1-IPMS-MIB', 'alaIpmsQuerierIfIndex'), ('ALCATEL-IND1-IPMS-MIB', 'alaIpmsQuerierVci'), ('ALCATEL-IND1-IPMS-MIB', 'alaIpmsQuerierType'), ('ALCATEL-IND1-IPMS-MIB', 'alaIpmsQuerierTimeout'))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ala_ipms_querier_group = alaIpmsQuerierGroup.setStatus('current')
ala_ipms_static_querier_group = object_group((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 2, 2, 6)).setObjects(('ALCATEL-IND1-IPMS-MIB', 'alaIpmsStaticQuerierRowStatus'))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ala_ipms_static_querier_group = alaIpmsStaticQuerierGroup.setStatus('current')
ala_ipms_source_group = object_group((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 2, 2, 7)).setObjects(('ALCATEL-IND1-IPMS-MIB', 'alaIpmsSourceSrcMacAddr'), ('ALCATEL-IND1-IPMS-MIB', 'alaIpmsSourceTimeout'))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ala_ipms_source_group = alaIpmsSourceGroup.setStatus('current')
ala_ipms_forward_group = object_group((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 2, 2, 8)).setObjects(('ALCATEL-IND1-IPMS-MIB', 'alaIpmsForwardSrcTunIpAddr'), ('ALCATEL-IND1-IPMS-MIB', 'alaIpmsForwardRtrMacAddr'), ('ALCATEL-IND1-IPMS-MIB', 'alaIpmsForwardRtrTtl'))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ala_ipms_forward_group = alaIpmsForwardGroup.setStatus('current')
ala_ipms_policy_group = object_group((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 2, 2, 9)).setObjects(('ALCATEL-IND1-IPMS-MIB', 'alaIpmsPolicySrcMacAddr'), ('ALCATEL-IND1-IPMS-MIB', 'alaIpmsPolicyDisposition'), ('ALCATEL-IND1-IPMS-MIB', 'alaIpmsPolicyTimeout'))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ala_ipms_policy_group = alaIpmsPolicyGroup.setStatus('current')
mibBuilder.exportSymbols('ALCATEL-IND1-IPMS-MIB', alaIpmsStaticNeighborRowStatus=alaIpmsStaticNeighborRowStatus, alaIpmsQuerierVlan=alaIpmsQuerierVlan, alaIpmsStaticQuerier=alaIpmsStaticQuerier, alaIpmsGroupClientMacAddr=alaIpmsGroupClientMacAddr, alaIpmsNeighbor=alaIpmsNeighbor, alaIpmsStaticNeighborVci=alaIpmsStaticNeighborVci, alaIpmsPolicyUniIpAddr=alaIpmsPolicyUniIpAddr, alaIpmsForwardSrcVlan=alaIpmsForwardSrcVlan, alaIpmsGroupDestIpAddr=alaIpmsGroupDestIpAddr, alaIpmsNeighborVci=alaIpmsNeighborVci, alaIpmsStaticNeighbor=alaIpmsStaticNeighbor, alaIpmsGroupGroup=alaIpmsGroupGroup, alaIpmsForwardDestVlan=alaIpmsForwardDestVlan, alaIpmsStaticQuerierIfIndex=alaIpmsStaticQuerierIfIndex, alcatelIND1IPMSMIBCompliances=alcatelIND1IPMSMIBCompliances, alaIpmsSourceSrcVlan=alaIpmsSourceSrcVlan, alaIpmsForwardSrcIfIndex=alaIpmsForwardSrcIfIndex, alaIpmsHardwareRoute=alaIpmsHardwareRoute, alaIpmsNeighborTimeout=alaIpmsNeighborTimeout, alaIpmsStaticMemberIGMPVersion=alaIpmsStaticMemberIGMPVersion, alaIpmsStaticNeighborTable=alaIpmsStaticNeighborTable, alaIpmsNeighborIpAddr=alaIpmsNeighborIpAddr, alaIpmsForwardDestTunIpAddr=alaIpmsForwardDestTunIpAddr, alaIpmsSourceEntry=alaIpmsSourceEntry, alaIpmsPolicySrcVci=alaIpmsPolicySrcVci, alaIpmsForwardSrcType=alaIpmsForwardSrcType, alaIpmsQuerierIpAddr=alaIpmsQuerierIpAddr, alaIpmsOtherQuerierTimer=alaIpmsOtherQuerierTimer, alaIpmsGroupClientIfIndex=alaIpmsGroupClientIfIndex, alaIpmsForwardSrcVci=alaIpmsForwardSrcVci, alaIpmsStaticMember=alaIpmsStaticMember, alaIpmsPolicySrcIpAddr=alaIpmsPolicySrcIpAddr, alaIpmsForwardSrcIpAddr=alaIpmsForwardSrcIpAddr, alaIpmsPolicySrcMacAddr=alaIpmsPolicySrcMacAddr, alaIpmsStaticQuerierGroup=alaIpmsStaticQuerierGroup, alaIpmsStaticMemberVci=alaIpmsStaticMemberVci, alaIpmsPolicyTable=alaIpmsPolicyTable, alaIpmsMembershipTimer=alaIpmsMembershipTimer, alaIpmsStaticNeighborIGMPVersion=alaIpmsStaticNeighborIGMPVersion, alaIpmsSourceSrcVci=alaIpmsSourceSrcVci, alaIpmsForwardUniIpAddr=alaIpmsForwardUniIpAddr, alaIpmsPolicySrcType=alaIpmsPolicySrcType, alaIpmsGroupEntry=alaIpmsGroupEntry, alaIpmsNeighborGroup=alaIpmsNeighborGroup, alaIpmsSourceSrcMacAddr=alaIpmsSourceSrcMacAddr, alaIpmsStaticNeighborVlan=alaIpmsStaticNeighborVlan, alaIpmsStaticNeighborIfIndex=alaIpmsStaticNeighborIfIndex, alaIpmsQueryInterval=alaIpmsQueryInterval, alaIpmsPolicyGroup=alaIpmsPolicyGroup, alaIpmsForwardRtrMacAddr=alaIpmsForwardRtrMacAddr, alaIpmsStaticMemberEntry=alaIpmsStaticMemberEntry, alaIpmsNeighborTimer=alaIpmsNeighborTimer, alaIpmsConfig=alaIpmsConfig, alaIpmsForwardTable=alaIpmsForwardTable, alaIpmsQuerierGroup=alaIpmsQuerierGroup, alaIpmsGroup=alaIpmsGroup, alaIpmsGroupClientVlan=alaIpmsGroupClientVlan, alaIpmsNeighborVlan=alaIpmsNeighborVlan, alaIpmsMaxBandwidth=alaIpmsMaxBandwidth, alaIpmsSourceGroup=alaIpmsSourceGroup, alaIpmsGroupTable=alaIpmsGroupTable, alaIpmsPolicy=alaIpmsPolicy, alaIpmsConfigGroup=alaIpmsConfigGroup, alaIpmsForwardDestIfIndex=alaIpmsForwardDestIfIndex, alaIpmsSourceSrcType=alaIpmsSourceSrcType, alaIpmsSourceDestIpAddr=alaIpmsSourceDestIpAddr, alaIpmsPolicyDisposition=alaIpmsPolicyDisposition, alaIpmsQuerierTimeout=alaIpmsQuerierTimeout, alaIpmsGroupIGMPv3SrcTimeout=alaIpmsGroupIGMPv3SrcTimeout, alaIpmsStaticMemberRowStatus=alaIpmsStaticMemberRowStatus, alcatelIND1IPMSMIBObjects=alcatelIND1IPMSMIBObjects, PYSNMP_MODULE_ID=alcatelIND1IPMSMIB, alaIpmsSourceSrcIfIndex=alaIpmsSourceSrcIfIndex, alaIpmsPolicyEntry=alaIpmsPolicyEntry, alaIpmsPolicyPolicy=alaIpmsPolicyPolicy, alaIpmsStaticQuerierVci=alaIpmsStaticQuerierVci, alaIpmsQuerierEntry=alaIpmsQuerierEntry, alaIpmsSource=alaIpmsSource, alaIpmsGroupClientIpAddr=alaIpmsGroupClientIpAddr, alaIpmsIGMPMembershipProxyVersion=alaIpmsIGMPMembershipProxyVersion, alaIpmsNeighborEntry=alaIpmsNeighborEntry, alaIpmsNeighborType=alaIpmsNeighborType, alaIpmsStaticQuerierVlan=alaIpmsStaticQuerierVlan, alaIpmsGroupTimeout=alaIpmsGroupTimeout, alaIpmsPolicySrcVlan=alaIpmsPolicySrcVlan, alaIpmsForwardEntry=alaIpmsForwardEntry, alaIpmsQuerierTable=alaIpmsQuerierTable, alaIpmsForwardGroup=alaIpmsForwardGroup, alaIpmsGroupIGMPv3SrcIP=alaIpmsGroupIGMPv3SrcIP, alaIpmsSourceSrcIpAddr=alaIpmsSourceSrcIpAddr, alaIpmsGroupIGMPVersion=alaIpmsGroupIGMPVersion, alaIpmsSourceTimeout=alaIpmsSourceTimeout, alcatelIND1IPMSMIBConformance=alcatelIND1IPMSMIBConformance, alaIpmsQuerierTimer=alaIpmsQuerierTimer, alaIpmsStaticNeighborGroup=alaIpmsStaticNeighborGroup, alaIpmsPolicySrcIfIndex=alaIpmsPolicySrcIfIndex, alaIpmsForwardRtrTtl=alaIpmsForwardRtrTtl, alaIpmsPolicyTimeout=alaIpmsPolicyTimeout, alaIpmsStaticMemberTable=alaIpmsStaticMemberTable, alaIpmsStatus=alaIpmsStatus, alaIpmsStaticMemberGroupAddr=alaIpmsStaticMemberGroupAddr, alaIpmsGroupIGMPv3GroupType=alaIpmsGroupIGMPv3GroupType, alaIpmsForwardDestType=alaIpmsForwardDestType, alaIpmsForwardDestIpAddr=alaIpmsForwardDestIpAddr, alaIpmsStaticQuerierTable=alaIpmsStaticQuerierTable, alcatelIND1IPMSMIB=alcatelIND1IPMSMIB, alaIpmsQuerierVci=alaIpmsQuerierVci, alaIpmsStaticQuerierRowStatus=alaIpmsStaticQuerierRowStatus, alaIpmsStaticMemberVlan=alaIpmsStaticMemberVlan, alaIpmsLeaveTimeout=alaIpmsLeaveTimeout, alaIpmsStaticMemberIfIndex=alaIpmsStaticMemberIfIndex, alcatelIND1IPMSMIBGroups=alcatelIND1IPMSMIBGroups, alaIpmsPolicyDestIpAddr=alaIpmsPolicyDestIpAddr, alaIpmsStaticQuerierEntry=alaIpmsStaticQuerierEntry, alaIpmsForward=alaIpmsForward, alaIpmsGroupClientVci=alaIpmsGroupClientVci, alaIpmsGroupIGMPv3SrcType=alaIpmsGroupIGMPv3SrcType, alaIpmsForwardSrcTunIpAddr=alaIpmsForwardSrcTunIpAddr, alaIpmsStaticQuerierIGMPVersion=alaIpmsStaticQuerierIGMPVersion, alaIpmsSourceUniIpAddr=alaIpmsSourceUniIpAddr, alaIpmsQuerier=alaIpmsQuerier, alaIpmsPriority=alaIpmsPriority, alaIpmsQuerierIfIndex=alaIpmsQuerierIfIndex, alaIpmsNeighborIfIndex=alaIpmsNeighborIfIndex, alaIpmsCompliance=alaIpmsCompliance, alaIpmsNeighborTable=alaIpmsNeighborTable, alaIpmsSourceTable=alaIpmsSourceTable, alaIpmsQuerierType=alaIpmsQuerierType, alaIpmsStaticNeighborEntry=alaIpmsStaticNeighborEntry) |
num = int(input( "Digite um valor de 0 a 9999: "))
num1 = str(num)
num2 = num1.zfill(4)
print('Unidade: {}'.format(num2[3]))
print('Dezena: {}'.format(num2[2]))
print('Centena: {}'.format(num2[1]))
print('Milhar: {}'.format(num2[0]))
| num = int(input('Digite um valor de 0 a 9999: '))
num1 = str(num)
num2 = num1.zfill(4)
print('Unidade: {}'.format(num2[3]))
print('Dezena: {}'.format(num2[2]))
print('Centena: {}'.format(num2[1]))
print('Milhar: {}'.format(num2[0])) |
builder_layers = {
# P-CAD ASCII layer types:
# Signal, Plane, NonSignal
-1: "null", # LT_UNDEFINED
0: "Signal", # LT_SIGNAL
1: "Plane", # LT_POWER
2: "NonSignal", # LT_MIXED
3: "Plane" # LT_JUMPER
}
builder_padshapes = {
# P-CAD ASCII padshape types:
# padViaShapeType(
# Ellipse, Oval, Rect, RndRect, Thrm2, Thrm2_90,
# Thrm4, Thrm4_45, Direct, NoConnect, Polygon
# )
0: "Ellipse", # PAD_SHAPE_CIRCLE
1: "Rect", # PAD_SHAPE_RECT
2: "Oval", # PAD_SHAPE_OVAL
3: "", # PAD_SHAPE_TRAPEZOID
4: "RndRect", # PAD_SHAPE_ROUNDRECT
5: "", # PAD_SHAPE_CHAMFERED_RECT
6: "Polygon" # PAD_SHPAE_CUSTOM
}
builder_fontRenderer_Stroke = 0
builder_fontRenderer_TrueType = 2
builder_fontFamily_Serif = 0
builder_fontFamily_Sanserif = 1
builder_fontFamily_Modern = 2
builder_fontRenderers = {
builder_fontRenderer_Stroke: "Stroke",
builder_fontRenderer_TrueType: "TrueType"
}
builder_fontFamilies = {
builder_fontFamily_Serif: "Serif",
builder_fontFamily_Sanserif: "Sanserif",
builder_fontFamily_Modern: "Modern"
}
class builder_param:
is_mm = True
used_fontFamily = builder_fontFamily_Sanserif
| builder_layers = {-1: 'null', 0: 'Signal', 1: 'Plane', 2: 'NonSignal', 3: 'Plane'}
builder_padshapes = {0: 'Ellipse', 1: 'Rect', 2: 'Oval', 3: '', 4: 'RndRect', 5: '', 6: 'Polygon'}
builder_font_renderer__stroke = 0
builder_font_renderer__true_type = 2
builder_font_family__serif = 0
builder_font_family__sanserif = 1
builder_font_family__modern = 2
builder_font_renderers = {builder_fontRenderer_Stroke: 'Stroke', builder_fontRenderer_TrueType: 'TrueType'}
builder_font_families = {builder_fontFamily_Serif: 'Serif', builder_fontFamily_Sanserif: 'Sanserif', builder_fontFamily_Modern: 'Modern'}
class Builder_Param:
is_mm = True
used_font_family = builder_fontFamily_Sanserif |
class Solution(object):
def myAtoi(self, str):
"""
:type str: str
:rtype: int
"""
temp = str.strip()
if not temp:
return 0
negative = False
resint = 0
head = temp[0]
if head == "-":
negative = True
elif head == "+":
negative = False
elif not head.isnumeric():
return 0
else:
resint += ord(head) - ord('0')
for i in range(1,len(temp)):
if temp[i].isnumeric():
resint = 10*resint + ord(temp[i]) - ord('0')
if not negative and resint >= 2147483647:
return 2147483647
if negative and resint >= 2147483648:
return -2147483648
else:
break
if not negative:
return resint
else:
return -resint | class Solution(object):
def my_atoi(self, str):
"""
:type str: str
:rtype: int
"""
temp = str.strip()
if not temp:
return 0
negative = False
resint = 0
head = temp[0]
if head == '-':
negative = True
elif head == '+':
negative = False
elif not head.isnumeric():
return 0
else:
resint += ord(head) - ord('0')
for i in range(1, len(temp)):
if temp[i].isnumeric():
resint = 10 * resint + ord(temp[i]) - ord('0')
if not negative and resint >= 2147483647:
return 2147483647
if negative and resint >= 2147483648:
return -2147483648
else:
break
if not negative:
return resint
else:
return -resint |
def calc_no(val):
temp = val
s = 0
while temp > 0:
s += temp%10
temp //= 10
return not(val%s)
row = int(input())
arr = [] # storing input values
for i in range(row):
arr.append(list(map(int,input().split())))
bool_tab = [] # storing their resp boolean value if it is divisible by the sum of digits than True else False
for i in range(row):
x = []
for j in range(len(arr[0])):
x.append(calc_no(arr[i][j]))
bool_tab.append(x)
res = []
for i in range(row-1):
for j in range(len(arr[0])-1):
if bool_tab[i][j] and bool_tab[i][j+1] and bool_tab[i+1][j] and bool_tab[i+1][j+1]:
res.append([arr[i][j], arr[i][j+1],arr[i+1][j],arr[i+1][j+1]])
if len(res) > 0:
for i in res:
print(i[0], i[1])
print(i[2], i[3])
print()
else:
print('No matrix found')
''' Input
3
42 54 2
30 24 27
180 190 40
Output
42 54
30 24
54 2
24 27
30 24
180 190
24 27
190 40''' | def calc_no(val):
temp = val
s = 0
while temp > 0:
s += temp % 10
temp //= 10
return not val % s
row = int(input())
arr = []
for i in range(row):
arr.append(list(map(int, input().split())))
bool_tab = []
for i in range(row):
x = []
for j in range(len(arr[0])):
x.append(calc_no(arr[i][j]))
bool_tab.append(x)
res = []
for i in range(row - 1):
for j in range(len(arr[0]) - 1):
if bool_tab[i][j] and bool_tab[i][j + 1] and bool_tab[i + 1][j] and bool_tab[i + 1][j + 1]:
res.append([arr[i][j], arr[i][j + 1], arr[i + 1][j], arr[i + 1][j + 1]])
if len(res) > 0:
for i in res:
print(i[0], i[1])
print(i[2], i[3])
print()
else:
print('No matrix found')
' Input\n 3\n 42 54 2\n 30 24 27\n 180 190 40\n\n Output\n 42 54\n 30 24\n\n 54 2\n 24 27\n\n 30 24\n 180 190\n\n 24 27\n 190 40' |
def weather_conditions(temp):
if temp > 7:
print("Warm")
else:
print("Cold")
x = int(input("Enter a temparature"))
weather_conditions(x)
| def weather_conditions(temp):
if temp > 7:
print('Warm')
else:
print('Cold')
x = int(input('Enter a temparature'))
weather_conditions(x) |
T = int(input())
for kase in range(1, T + 1):
n = int(input())
[input() for i in range(0, n + 1)]
if n & 1:
print(f'Case #{kase}: 1\n0.0')
else:
print(f'Case #{kase}: 0') | t = int(input())
for kase in range(1, T + 1):
n = int(input())
[input() for i in range(0, n + 1)]
if n & 1:
print(f'Case #{kase}: 1\n0.0')
else:
print(f'Case #{kase}: 0') |
# https://app.codility.com/demo/results/trainingUJUBFH-2H3/
def solution(X, A):
"""
DINAKAR
Clue -> Find the earliest time when the frog can jump to the other side of the river. The frog can cross only when leaves appear at every position across the river from 1 to X
[1, 3, 1, 4, 2, 3, 5, 4]
X = 5 ie. {1, 2, 3, 4, 5} here 1 to X/5 is completed so we return the index which is time
"""
positions = set()
for index, item in enumerate(A):
print("Current Time " + str(index))
print("Position " + str(item))
positions.add(item)
print("Positions covered..." + str(positions))
if len(positions) == X:
return index
return -1
result = solution(5, [1, 3, 1, 4, 2, 3, 5, 4])
print("Sol " + str(result))
"""
Current Time 0
Position 1
Positions covered...{1}
Current Time 1
Position 3
Positions covered...{1, 3}
Current Time 2
Position 1
Positions covered...{1, 3}
Current Time 3
Position 4
Positions covered...{1, 3, 4}
Current Time 4
Position 2
Positions covered...{1, 2, 3, 4}
Current Time 5
Position 3
Positions covered...{1, 2, 3, 4}
Current Time 6
Position 5
Positions covered...{1, 2, 3, 4, 5}
Sol 6
"""
| def solution(X, A):
"""
DINAKAR
Clue -> Find the earliest time when the frog can jump to the other side of the river. The frog can cross only when leaves appear at every position across the river from 1 to X
[1, 3, 1, 4, 2, 3, 5, 4]
X = 5 ie. {1, 2, 3, 4, 5} here 1 to X/5 is completed so we return the index which is time
"""
positions = set()
for (index, item) in enumerate(A):
print('Current Time ' + str(index))
print('Position ' + str(item))
positions.add(item)
print('Positions covered...' + str(positions))
if len(positions) == X:
return index
return -1
result = solution(5, [1, 3, 1, 4, 2, 3, 5, 4])
print('Sol ' + str(result))
'\nCurrent Time 0\nPosition 1\nPositions covered...{1}\nCurrent Time 1\nPosition 3\nPositions covered...{1, 3}\nCurrent Time 2\nPosition 1\nPositions covered...{1, 3}\nCurrent Time 3\nPosition 4\nPositions covered...{1, 3, 4}\nCurrent Time 4\nPosition 2\nPositions covered...{1, 2, 3, 4}\nCurrent Time 5\nPosition 3\nPositions covered...{1, 2, 3, 4}\nCurrent Time 6\nPosition 5\nPositions covered...{1, 2, 3, 4, 5}\nSol 6\n\n' |
# Atharv Kolhar
# Python Bytes
# https://www.youtube.com/channel/UC71nPTNDEG7oyusXTifvB7g?sub_confirmation=1
"""
Tuple
"""
# Declaration
var_tuple = (1, 2, 3)
print(var_tuple)
print(type(var_tuple))
var_tuple_1 = 1, 2, 3
print(var_tuple_1)
print(type(var_tuple_1))
# Function for Tuples
# Counting the element repeated in the tuple
var_tuple_2 = (1, 1, 2, 3, 2, 1, 4, 1)
print(var_tuple_2.count(1))
print(var_tuple_2.count(4))
# Index finding
print(var_tuple_2.index(1))
print(var_tuple_2.index(1, 2, 6))
# Changing the Data Type
# Tuple to List
var_list_from_tuple = list(var_tuple_2)
print(var_list_from_tuple)
print(type(var_list_from_tuple))
# List to Tuple
var_tuple_from_list = tuple(var_list_from_tuple)
print(var_tuple_from_list)
print(type(var_tuple_from_list))
# End | """
Tuple
"""
var_tuple = (1, 2, 3)
print(var_tuple)
print(type(var_tuple))
var_tuple_1 = (1, 2, 3)
print(var_tuple_1)
print(type(var_tuple_1))
var_tuple_2 = (1, 1, 2, 3, 2, 1, 4, 1)
print(var_tuple_2.count(1))
print(var_tuple_2.count(4))
print(var_tuple_2.index(1))
print(var_tuple_2.index(1, 2, 6))
var_list_from_tuple = list(var_tuple_2)
print(var_list_from_tuple)
print(type(var_list_from_tuple))
var_tuple_from_list = tuple(var_list_from_tuple)
print(var_tuple_from_list)
print(type(var_tuple_from_list)) |
school_class = {}
while True:
name = input("Enter the student's name: ")
if name == '':
break
score = int(input("Enter the student's score (0-10): "))
if score not in range(0, 11):
break
if name in school_class:
school_class[name] += (score,)
else:
school_class[name] = (score,)
for name in sorted(school_class.keys()):
adding = 0
counter = 0
for score in school_class[name]:
adding += score
counter += 1
print(name, ":", adding / counter)
################
pol_eng_dictionary = {
"kwiat": "flower",
"woda": "water",
"gleba": "soil"
}
item_1 = pol_eng_dictionary["gleba"] # ex. 1
print(item_1) # outputs: soil
item_2 = pol_eng_dictionary.get("woda")
print(item_2) # outputs: water
############
phonebook = {} # an empty dictionary
phonebook["Adam"] = 3456783958 # create/add a key-value pair
print(phonebook) # outputs: {'Adam': 3456783958}
del phonebook["Adam"]
print(phonebook) # outputs: {}
##########
pol_eng_dictionary = {
"zamek": "castle",
"woda": "water",
"gleba": "soil"
}
copy_dictionary = pol_eng_dictionary.copy()
| school_class = {}
while True:
name = input("Enter the student's name: ")
if name == '':
break
score = int(input("Enter the student's score (0-10): "))
if score not in range(0, 11):
break
if name in school_class:
school_class[name] += (score,)
else:
school_class[name] = (score,)
for name in sorted(school_class.keys()):
adding = 0
counter = 0
for score in school_class[name]:
adding += score
counter += 1
print(name, ':', adding / counter)
pol_eng_dictionary = {'kwiat': 'flower', 'woda': 'water', 'gleba': 'soil'}
item_1 = pol_eng_dictionary['gleba']
print(item_1)
item_2 = pol_eng_dictionary.get('woda')
print(item_2)
phonebook = {}
phonebook['Adam'] = 3456783958
print(phonebook)
del phonebook['Adam']
print(phonebook)
pol_eng_dictionary = {'zamek': 'castle', 'woda': 'water', 'gleba': 'soil'}
copy_dictionary = pol_eng_dictionary.copy() |
with open("day6_input") as infile:
cycles = [[int(x) for x in infile.readline().split('\t') if x != '\n']]
steps = 0
while True:
current_cycle = cycles[-1]
max_ = max(current_cycle)
maxindex = current_cycle.index(max_)
new_cycle = current_cycle[:]
new_cycle[maxindex] = 0
for i in range(maxindex + 1, maxindex + 1 + max_):
new_cycle[i % len(new_cycle)] += 1
cycles.append(new_cycle)
steps += 1
if steps > 1 and new_cycle in cycles[:-1]: break
print(steps)
print(steps - cycles[:-1].index(cycles[-1]))
| with open('day6_input') as infile:
cycles = [[int(x) for x in infile.readline().split('\t') if x != '\n']]
steps = 0
while True:
current_cycle = cycles[-1]
max_ = max(current_cycle)
maxindex = current_cycle.index(max_)
new_cycle = current_cycle[:]
new_cycle[maxindex] = 0
for i in range(maxindex + 1, maxindex + 1 + max_):
new_cycle[i % len(new_cycle)] += 1
cycles.append(new_cycle)
steps += 1
if steps > 1 and new_cycle in cycles[:-1]:
break
print(steps)
print(steps - cycles[:-1].index(cycles[-1])) |
pattern = []
with open('day_3.txt') as f:
for line in f:
pattern.append([line.rstrip()])
def count_trees(pattern, right, down):
'''Use dictionary to redefine positions outside base pattern,
count all trees in pattern (#) which we meet, when we follow defined number of moves to right and down'''
# for making dictionary
len_line = len(''.join(pattern[0]))
border_pos = len_line - right - 1 # border positions - need to be translated
keys = [*range(border_pos, len_line)] # keys up to length of line
values = []
for key in keys:
values.append(key - border_pos - 1)
# make dictionary
dictionary = dict(zip(keys, values))
# count trees and change current position
count = 0
pos = 0
for index, line in enumerate(pattern):
if index % down == 0:
# count met tree
if line[0][pos] == '#':
count += 1
# define new position after move
if pos > border_pos: # redefine border position, if needed
pos = dictionary[pos]
else:
pos += right
return count
def follow_instructions(instructions):
'''Call function count_trees() for every instruction, return product of multiplication of all trees'''
for i, instruction in enumerate(instructions):
right, down = instruction
if i == 0:
total = count_trees(pattern, right, down)
else:
total *= count_trees(pattern, right, down)
return total
part1_instructions = [(3, 1)]
part2_instructions = [(1, 1), (3, 1), (5, 1), (7, 1), (1, 2)]
print(follow_instructions(part1_instructions))
print(follow_instructions(part2_instructions))
| pattern = []
with open('day_3.txt') as f:
for line in f:
pattern.append([line.rstrip()])
def count_trees(pattern, right, down):
"""Use dictionary to redefine positions outside base pattern,
count all trees in pattern (#) which we meet, when we follow defined number of moves to right and down"""
len_line = len(''.join(pattern[0]))
border_pos = len_line - right - 1
keys = [*range(border_pos, len_line)]
values = []
for key in keys:
values.append(key - border_pos - 1)
dictionary = dict(zip(keys, values))
count = 0
pos = 0
for (index, line) in enumerate(pattern):
if index % down == 0:
if line[0][pos] == '#':
count += 1
if pos > border_pos:
pos = dictionary[pos]
else:
pos += right
return count
def follow_instructions(instructions):
"""Call function count_trees() for every instruction, return product of multiplication of all trees"""
for (i, instruction) in enumerate(instructions):
(right, down) = instruction
if i == 0:
total = count_trees(pattern, right, down)
else:
total *= count_trees(pattern, right, down)
return total
part1_instructions = [(3, 1)]
part2_instructions = [(1, 1), (3, 1), (5, 1), (7, 1), (1, 2)]
print(follow_instructions(part1_instructions))
print(follow_instructions(part2_instructions)) |
'''
Dictionary that keeps the cost of individual parts of cars.
'''
car_body = {
'Honda' : 500,
'Nissan' : 1000,
'Suzuki' : 600,
'Toyota' : 500
}
car_tyres = {
'Honda' : 1400,
'Nissan' : 500,
'Suzuki' : 600,
'Toyota' : 1000
}
car_doors = {
'Honda' : 400,
'Nissan': 300,
'Suzuki' : 600,
'Toyota' : 800
} | """
Dictionary that keeps the cost of individual parts of cars.
"""
car_body = {'Honda': 500, 'Nissan': 1000, 'Suzuki': 600, 'Toyota': 500}
car_tyres = {'Honda': 1400, 'Nissan': 500, 'Suzuki': 600, 'Toyota': 1000}
car_doors = {'Honda': 400, 'Nissan': 300, 'Suzuki': 600, 'Toyota': 800} |
class Solution:
def findKthPositive(self, arr: List[int], k: int) -> int:
missing = []
limit = arr[-1]
nums = set(arr)
for i in range(1,limit):
if i not in nums:
missing.append(i)
if len(missing) >= k:
return missing[k-1]
else:
return limit + k - len(missing) | class Solution:
def find_kth_positive(self, arr: List[int], k: int) -> int:
missing = []
limit = arr[-1]
nums = set(arr)
for i in range(1, limit):
if i not in nums:
missing.append(i)
if len(missing) >= k:
return missing[k - 1]
else:
return limit + k - len(missing) |
# mendapatkan tagihan bulanan
# selamat satu unit lagi dan anda sudah membuat sebuah program! ketika
# kita bilang anda bisa membuat apa saja dengan python, kita bersungguh-sungguh!
# batas dari apa yang anda bisa bangun adalah di imajinasi anda
# terus belajar ke bab berikutnya dan akhirnya anda akan bisa membuat program yang
# lebih keren lagi!
'''
instruksi
-oke sekarang kita buat variabel
total_tagihan
yang merupakan jumlah dari
sisa_cicilan
dan
jumlah_bunga
-setelahnya kita buat
tagihan_bulanan
yang merupakan
total_tagihan
dibagi
12
-jalankan codenya dan lihat tagihan bulananan anda
-ubah angkanya sesuasi yang anda mau dan bermain mainlah dengan apa yang telah anda pelajari
'''
# harga_laptop = 5000000
# uang_muka = 1000000
# sisa_cicilan = harga_laptop-uang_muka
# suku_bunga = 10
# jumlah_bunga = sisa_cicilan * suku_bunga /100
# total_tagihan = sisa_cicilan + jumlah_bunga
# tagihan_bulanan = total_tagihan /12
# print(tagihan_bulanan)
while True:
print('''
menghitung total tagihan''')
harga = int(input('harga barang: '))
uang_muka = int(input('uang muka: '))
sisa_cicilan = harga-uang_muka
print('sisa cicilan {} - {} = {}'.format(harga,uang_muka,sisa_cicilan))
suku_bunga = int(input('bunga: '))
jumlah_bunga = sisa_cicilan * suku_bunga / 100
total_tagihan = sisa_cicilan + jumlah_bunga
tagihan_bulanan = total_tagihan / 12
print('jumlah bunga {} x {} / 100 = {}'.format(sisa_cicilan,suku_bunga,jumlah_bunga))
print('total tagihan: {} + {} = {}'.format(sisa_cicilan,jumlah_bunga,total_tagihan))
print('tagihan bulanan: {} / 12 = %.2f'.format(total_tagihan)%(tagihan_bulanan))
d = input('try again(y/n)? ')
if d=='y' or d=='Y':
print()
elif d=='n' or d=='N':
exit()
| """
instruksi
-oke sekarang kita buat variabel
total_tagihan
yang merupakan jumlah dari
sisa_cicilan
dan
jumlah_bunga
-setelahnya kita buat
tagihan_bulanan
yang merupakan
total_tagihan
dibagi
12
-jalankan codenya dan lihat tagihan bulananan anda
-ubah angkanya sesuasi yang anda mau dan bermain mainlah dengan apa yang telah anda pelajari
"""
while True:
print('\n menghitung total tagihan')
harga = int(input('harga barang: '))
uang_muka = int(input('uang muka: '))
sisa_cicilan = harga - uang_muka
print('sisa cicilan {} - {} = {}'.format(harga, uang_muka, sisa_cicilan))
suku_bunga = int(input('bunga: '))
jumlah_bunga = sisa_cicilan * suku_bunga / 100
total_tagihan = sisa_cicilan + jumlah_bunga
tagihan_bulanan = total_tagihan / 12
print('jumlah bunga {} x {} / 100 = {}'.format(sisa_cicilan, suku_bunga, jumlah_bunga))
print('total tagihan: {} + {} = {}'.format(sisa_cicilan, jumlah_bunga, total_tagihan))
print('tagihan bulanan: {} / 12 = %.2f'.format(total_tagihan) % tagihan_bulanan)
d = input('try again(y/n)? ')
if d == 'y' or d == 'Y':
print()
elif d == 'n' or d == 'N':
exit() |
def find(n, m, x, y, dx, dy):
if x < 0 or x == 20 or y < 0 or y == 20:
return -1
elif n == 0:
return 1
else:
return m[y][x] * find(n - 1, m, x + dx, y + dy, dx, dy)
directions = [None] * 8
for i in range(0, 8):
if i == 0:
directions[i] = [0, 1]
elif i == 1:
directions[i] = [1, 0]
elif i == 2:
directions[i] = [0, -1]
elif i == 3:
directions[i] = [-1, 0]
elif i == 4:
directions[i] = [1, 1]
elif i == 5:
directions[i] = [1, -1]
elif i == 6:
directions[i] = [-1, 1]
else:
directions[i] = [-1, -1]
max0 = 0
m = [list(map(int, input().split())) for i in range(20)]
for j in range(0, 8):
(dx, dy) = directions[j]
for x in range(0, 20):
for y in range(0, 20):
max0 = max(max0, find(4, m, x, y, dx, dy))
print("%d\n" % max0, end='')
| def find(n, m, x, y, dx, dy):
if x < 0 or x == 20 or y < 0 or (y == 20):
return -1
elif n == 0:
return 1
else:
return m[y][x] * find(n - 1, m, x + dx, y + dy, dx, dy)
directions = [None] * 8
for i in range(0, 8):
if i == 0:
directions[i] = [0, 1]
elif i == 1:
directions[i] = [1, 0]
elif i == 2:
directions[i] = [0, -1]
elif i == 3:
directions[i] = [-1, 0]
elif i == 4:
directions[i] = [1, 1]
elif i == 5:
directions[i] = [1, -1]
elif i == 6:
directions[i] = [-1, 1]
else:
directions[i] = [-1, -1]
max0 = 0
m = [list(map(int, input().split())) for i in range(20)]
for j in range(0, 8):
(dx, dy) = directions[j]
for x in range(0, 20):
for y in range(0, 20):
max0 = max(max0, find(4, m, x, y, dx, dy))
print('%d\n' % max0, end='') |
cue_words=["call it as",
"call this as",
"called as the",
"call it as",
"referred to as",
"is defined as",
"known as the",
"defined as",
"known as",
"mean by",
"concept of",
"talk about",
"called as",
"called the",
"called an",
"called a",
"call as",
"called"]
| cue_words = ['call it as', 'call this as', 'called as the', 'call it as', 'referred to as', 'is defined as', 'known as the', 'defined as', 'known as', 'mean by', 'concept of', 'talk about', 'called as', 'called the', 'called an', 'called a', 'call as', 'called'] |
def nonrep():
checklist=[]
my_string={"pythonprograming"}
for s in my_string:
if s in my_string:
my_string[s]+=1
else:
my_string=1
checklist.appened(my_string[s])
for s in checklist:
if s==1:
return True
else:
False
result=nonrep()
print(result)
| def nonrep():
checklist = []
my_string = {'pythonprograming'}
for s in my_string:
if s in my_string:
my_string[s] += 1
else:
my_string = 1
checklist.appened(my_string[s])
for s in checklist:
if s == 1:
return True
else:
False
result = nonrep()
print(result) |
# -*- coding: utf-8 -*-
"""DQ0 SDK Data Utils Package
This package contains general data helper functions.
"""
__all__ = [
'util',
'plotting'
]
| """DQ0 SDK Data Utils Package
This package contains general data helper functions.
"""
__all__ = ['util', 'plotting'] |
REQUEST_BODY_JSON = """
{
"verification_details": {
"amount": 1.1,
"payment_transaction_id": "string",
"transaction_type": "PHONE_PAY",
"screenshot_url": "string"
}
}
"""
| request_body_json = '\n{\n "verification_details": {\n "amount": 1.1,\n "payment_transaction_id": "string",\n "transaction_type": "PHONE_PAY",\n "screenshot_url": "string"\n }\n}\n' |
#!/usr/bin/env python3
CONVERSION_TABLE = {
'I': 1,
'II': 2,
'III': 3,
'IV': 4,
'V': 5,
'VI': 6,
'VII': 7,
'VIII': 8,
'IX': 9,
'X': 10,
'XX': 20,
'XXX': 30,
'XL': 40,
'L': 50,
'LX': 60,
'LXX': 70,
'LXXX': 80,
'XC': 90,
'C': 100,
'D': 500,
'M': 1000,
}
def roman_to_arabic(roman_value: str) -> int:
"""
>>> roman_to_arabic("I")
1
>>> roman_to_arabic("IX")
9
>>> roman_to_arabic("MDL")
1550
>>> roman_to_arabic("XIV")
14
"""
roman_value.capitalize()
arabic_value = []
for letter in roman_value:
if letter in CONVERSION_TABLE:
arabic_value.append(CONVERSION_TABLE[letter])
last_value = CONVERSION_TABLE["M"] * 2
cumulative_value = 0
for value in arabic_value:
if last_value < value:
cumulative_value -= 2 * last_value
cumulative_value += value
last_value = value
return cumulative_value
| conversion_table = {'I': 1, 'II': 2, 'III': 3, 'IV': 4, 'V': 5, 'VI': 6, 'VII': 7, 'VIII': 8, 'IX': 9, 'X': 10, 'XX': 20, 'XXX': 30, 'XL': 40, 'L': 50, 'LX': 60, 'LXX': 70, 'LXXX': 80, 'XC': 90, 'C': 100, 'D': 500, 'M': 1000}
def roman_to_arabic(roman_value: str) -> int:
"""
>>> roman_to_arabic("I")
1
>>> roman_to_arabic("IX")
9
>>> roman_to_arabic("MDL")
1550
>>> roman_to_arabic("XIV")
14
"""
roman_value.capitalize()
arabic_value = []
for letter in roman_value:
if letter in CONVERSION_TABLE:
arabic_value.append(CONVERSION_TABLE[letter])
last_value = CONVERSION_TABLE['M'] * 2
cumulative_value = 0
for value in arabic_value:
if last_value < value:
cumulative_value -= 2 * last_value
cumulative_value += value
last_value = value
return cumulative_value |
'''
This file contains any primitives for Lyanna that aren't just
borrowed from the language. Basically this is Nothing and Undefined,
which are singletons. That is, their classes are stuck here and only
selected instances are exported through __all__
'''
class NothingType(object):
def __str__(self):
return "Nothing"
class UndefinedType(object):
def __str__(self):
return "Undefined"
Nothing = NothingType()
Undefined = UndefinedType()
def is_primitive(item):
return isinstance(item, (NothingType, UndefinedType, bool, int, basestring))
__all__ = ['Nothing', 'Undefined']
| """
This file contains any primitives for Lyanna that aren't just
borrowed from the language. Basically this is Nothing and Undefined,
which are singletons. That is, their classes are stuck here and only
selected instances are exported through __all__
"""
class Nothingtype(object):
def __str__(self):
return 'Nothing'
class Undefinedtype(object):
def __str__(self):
return 'Undefined'
nothing = nothing_type()
undefined = undefined_type()
def is_primitive(item):
return isinstance(item, (NothingType, UndefinedType, bool, int, basestring))
__all__ = ['Nothing', 'Undefined'] |
def settingDecoder(data):
# data can be:
# raw string
# list of strings
data = data.strip()
if (len(data) > 1) and (data[0] == '[') and (data[-1] == ']'):
data = [x.strip() for x in data[1:-1].split(',')]
return data
def loadSetting(filename = "SETTINGS"):
res = dict()
with open(filename, 'r') as f:
for line in f:
sline = line.strip()
if sline.startswith('#'):
continue
if sline.find('=') != -1:
eIdx = sline.find('=')
res[line[:eIdx]] = settingDecoder(sline[(eIdx + 1):])
return res
settings = loadSetting()
def getSetting(key, value = None):
if key in settings:
return settings[key]
else:
return value
if __name__ == '__main__':
print(loadSetting()) | def setting_decoder(data):
data = data.strip()
if len(data) > 1 and data[0] == '[' and (data[-1] == ']'):
data = [x.strip() for x in data[1:-1].split(',')]
return data
def load_setting(filename='SETTINGS'):
res = dict()
with open(filename, 'r') as f:
for line in f:
sline = line.strip()
if sline.startswith('#'):
continue
if sline.find('=') != -1:
e_idx = sline.find('=')
res[line[:eIdx]] = setting_decoder(sline[eIdx + 1:])
return res
settings = load_setting()
def get_setting(key, value=None):
if key in settings:
return settings[key]
else:
return value
if __name__ == '__main__':
print(load_setting()) |
messages = 'game.apps.core.signals.messages.%s' # user.id
planet = 'game.apps.core.signals.planet_details.%s' # planetID_requestID
account_data = 'game.apps.core.signals.account_data.%s'
building = 'game.apps.core.signals.building.%s' # buildingID
task_updated = 'game.apps.core.signals.task_updated.%s' # user.id
| messages = 'game.apps.core.signals.messages.%s'
planet = 'game.apps.core.signals.planet_details.%s'
account_data = 'game.apps.core.signals.account_data.%s'
building = 'game.apps.core.signals.building.%s'
task_updated = 'game.apps.core.signals.task_updated.%s' |
# 39. Combination Sum
# Time: O((len(candidates))^(target/avg(candidates))) Review
# Space: O(target/avg(candidates))) [depth of recursion tree?]Review
class Solution:
def combinationSum(self, candidates: List[int], target: int) -> List[List[int]]:
result = []
self.util(candidates, target, 0 , [], result)
return result
def util(self, candidates, target, start, cur_res, result):
if target<0:
return
if target==0:
result.append(cur_res)
return
for i in range(start, len(candidates)):
self.util(candidates, target-candidates[i], i, cur_res+[candidates[i]], result)
| class Solution:
def combination_sum(self, candidates: List[int], target: int) -> List[List[int]]:
result = []
self.util(candidates, target, 0, [], result)
return result
def util(self, candidates, target, start, cur_res, result):
if target < 0:
return
if target == 0:
result.append(cur_res)
return
for i in range(start, len(candidates)):
self.util(candidates, target - candidates[i], i, cur_res + [candidates[i]], result) |
class audo:
def __init__(self, form, data = None):
self.form = form
self.values = []
if data:
self.load(data)
def load(self, data):
for i in range(data.readUInt32()):
while (data.offset & 3) != 0:
data.offset += 1
data.push(data.readUInt32())
self.values.append(data.readBytes(data.readUInt32()))
data.pop()
def __getitem__(self, index):
return self.values[index]
| class Audo:
def __init__(self, form, data=None):
self.form = form
self.values = []
if data:
self.load(data)
def load(self, data):
for i in range(data.readUInt32()):
while data.offset & 3 != 0:
data.offset += 1
data.push(data.readUInt32())
self.values.append(data.readBytes(data.readUInt32()))
data.pop()
def __getitem__(self, index):
return self.values[index] |
# Copyright (C) 2012 Nippon Telegraph and Telephone Corporation.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
# implied.
# See the License for the specific language governing permissions and
# limitations under the License.
IPPROTO_IP = 0
IPPROTO_HOPOPTS = 0
IPPROTO_ICMP = 1
IPPROTO_IGMP = 2
IPPROTO_TCP = 6
IPPROTO_UDP = 17
IPPROTO_ROUTING = 43
IPPROTO_FRAGMENT = 44
IPPROTO_GRE = 47
IPPROTO_AH = 51
IPPROTO_ICMPV6 = 58
IPPROTO_NONE = 59
IPPROTO_DSTOPTS = 60
IPPROTO_OSPF = 89
IPPROTO_VRRP = 112
IPPROTO_SCTP = 132
| ipproto_ip = 0
ipproto_hopopts = 0
ipproto_icmp = 1
ipproto_igmp = 2
ipproto_tcp = 6
ipproto_udp = 17
ipproto_routing = 43
ipproto_fragment = 44
ipproto_gre = 47
ipproto_ah = 51
ipproto_icmpv6 = 58
ipproto_none = 59
ipproto_dstopts = 60
ipproto_ospf = 89
ipproto_vrrp = 112
ipproto_sctp = 132 |
"""
MainWindow.setWindowTitle('Physics')
self.centralwidget.setLayout(self.gridLayout)
version = "v1"
""" | """
MainWindow.setWindowTitle('Physics')
self.centralwidget.setLayout(self.gridLayout)
version = "v1"
""" |
lst = [90, 180, 0]
empty = []
lst.append(empty)
def function_a():
for empty in lst:
if empty in lst:
print(lst)
function_b()
function_b()
print(lst)
def function_b():
for empty in lst:
if empty in lst:
print(lst)
function_b()
function_a()
| lst = [90, 180, 0]
empty = []
lst.append(empty)
def function_a():
for empty in lst:
if empty in lst:
print(lst)
function_b()
function_b()
print(lst)
def function_b():
for empty in lst:
if empty in lst:
print(lst)
function_b()
function_a() |
def options_displ():
print(
'''
weather now: Displays the current weather
weather today: Displays the weather for this day
weather tenday: Displays weather for next ten days
detailed tenday: Displays ten day weather with extended info
weather -t: Displays current temperature
weather -dew: Displays cloud dew point currently
weather -prs: Displays precipitation percentage currently
weather -par: Displays current atmospheric pressure (bar)
weather -mnp: Displays moon phase
weather -ws: Displays current wind speed and direction
weather -hdu: Displays current humidity percentage
weather -vis: Displays current visibility (km)
weather -uv: Displays current UV index out of 10 (0 - Minimum, 10 - Maximum)
weather -dsc: Displays current weather description
weather -tab: Displays startup table again
--h or -help: Displays help page
--o or -options: Displays options(current) page
clear(): clear screen
loc -p: Change permanent location
loc -t: Change temporary location
loc -pr: Return to permanent location
--loc: View if location is permanent or temporary
settings: Turn toggle on or off
exit: Exit application
'''
)
_ = input('Press enter to continue >> ')
def help_application():
print(
'''
Startup:
When you first start up the app, it will ask you for your country and location. This is stored permanently and can be changed in the future.
This system helps to reduce time when logging in to check the current weather
NOTE:You can view all the commands by entering --o or -options in the terminal. Use -help only when needing assistance with the app.
'''
)
_ = input('Press enter to read more >> ')
print(
'''
Command line modifications:
When in the MAIN command line you will see a > which denotes an input suggestion. Here you can enter any command from the list below!
When in sections like weather ten day or weather today, you will see a >> which means you are in the terminal for that particular weather section.
'''
)
_ = input('Press enter to read more >> ')
print(
'''
Settings:
This app currently has a toggle feature which is enabled by default and can be changed later.
Toggle helps to change the way the day/hour navigation system works under the weather ten day and weather today sections.
If you have settings toggle enabled you can navigate using the letter P(Previous hr/day), N(Next hr/day), E(Extended info), Q(exit to main cli).
If you have settings disabled then you can navigate using Enter(next day) or Q(exit to main cli).
'''
)
_ = input('Press enter to read more >> ')
print(
'''
Location change:
There are primarily 2 location change commands in this app. loc -p and loc -t
Loc -p changes your permanent location, this changes every section in the app from the startup menu weather and the weather sections
Loc -t changes your location temporarily, this is useful when you want to view another location temporarily
To know if you're in a temporary location or not just scroll up and you'll see your location near the title
If there is a text which says 'Temporary Location', it means you're currently not in the permanent selected location, an alternate way to check is by typing the command --loc,
this will tell you if you have permanent location selected or not
To change back to permanent selected location type the command loc -pr and you'll be taken back.
'''
)
_ = input('Press enter to read more >> ')
print(
'''
Title screen weather:
When you load up the app, you will see a dropdown box which displays the hourly weather. This box is dynamic and the amount of information changes according to the size of your terminal.
It is recommended to have your terminal on full screen or at least extended beyond the default size.
'''
)
_ = input('Press enter to read more >> ')
print(
'''
Other information:
Under the weather hourly section, if toggle is enabled and if it's the last hour of the day. The section will display only the particular weather for the next hour and exit the section
Since weather.com uses a separate tag for the current weather, you can view it only by typing the command weather now.
Exiting the app:
Please try to use only the EXIT command to exit the app, you can use CTRL-Z ent or CTRL-C to exit but these exit methods create issues when in the loc -p section.
If CTRL-C or CTRL-Z in pressed in the loc -p section, it leads to a corrupt file issue sometimes. The next time you open the app an error will be displayed on the screen.
'''
)
_ = input('Press enter to read more >> ')
print(
'''
Errors:
1. Port connection:
If you try to use the app without access to the internet or have a very slow connection. Sometimes you'll get a port connection error
Make sure you're connected to the internet or just wait for sometime for the issue to get resolved
2. File error:
As mentioned in the above section (exiting the app), CTRL-Z ent or CTRL-C can produce errors when used in the loc -p section.
When this occurs the app will close automatically and the next time you open it, the app will be reset meaning that you'd have to enter your permanent location again.
Other than that there's no major issue using CTRL-Z ent or CTRL-C
3. Requests error:
This error can only occur if you modify the contents of any of the location files.
If this occurs, make sure to delete the gotloc.txt file when launching the application again.
'''
)
_ = input('Press enter to exit help >> ')
| def options_displ():
print('\n weather now: Displays the current weather\n weather today: Displays the weather for this day\n weather tenday: Displays weather for next ten days\n detailed tenday: Displays ten day weather with extended info\n \n weather -t: Displays current temperature\n weather -dew: Displays cloud dew point currently\n weather -prs: Displays precipitation percentage currently\n weather -par: Displays current atmospheric pressure (bar)\n weather -mnp: Displays moon phase\n weather -ws: Displays current wind speed and direction\n weather -hdu: Displays current humidity percentage \n weather -vis: Displays current visibility (km)\n weather -uv: Displays current UV index out of 10 (0 - Minimum, 10 - Maximum)\n weather -dsc: Displays current weather description\n weather -tab: Displays startup table again\n \n --h or -help: Displays help page\n --o or -options: Displays options(current) page\n \n clear(): clear screen\n loc -p: Change permanent location\n loc -t: Change temporary location\n loc -pr: Return to permanent location\n --loc: View if location is permanent or temporary\n \n settings: Turn toggle on or off\n exit: Exit application\n \n ')
_ = input('Press enter to continue >> ')
def help_application():
print('\n Startup:\n When you first start up the app, it will ask you for your country and location. This is stored permanently and can be changed in the future.\n This system helps to reduce time when logging in to check the current weather\n\t\n\t NOTE:You can view all the commands by entering --o or -options in the terminal. Use -help only when needing assistance with the app.\n ')
_ = input('Press enter to read more >> ')
print('\n Command line modifications:\n When in the MAIN command line you will see a > which denotes an input suggestion. Here you can enter any command from the list below!\n When in sections like weather ten day or weather today, you will see a >> which means you are in the terminal for that particular weather section.\n ')
_ = input('Press enter to read more >> ')
print('\n Settings:\n This app currently has a toggle feature which is enabled by default and can be changed later.\n Toggle helps to change the way the day/hour navigation system works under the weather ten day and weather today sections.\n If you have settings toggle enabled you can navigate using the letter P(Previous hr/day), N(Next hr/day), E(Extended info), Q(exit to main cli).\n If you have settings disabled then you can navigate using Enter(next day) or Q(exit to main cli).\n ')
_ = input('Press enter to read more >> ')
print("\n Location change:\n There are primarily 2 location change commands in this app. loc -p and loc -t\n Loc -p changes your permanent location, this changes every section in the app from the startup menu weather and the weather sections\n Loc -t changes your location temporarily, this is useful when you want to view another location temporarily\n To know if you're in a temporary location or not just scroll up and you'll see your location near the title\n If there is a text which says 'Temporary Location', it means you're currently not in the permanent selected location, an alternate way to check is by typing the command --loc, \n this will tell you if you have permanent location selected or not\n \n To change back to permanent selected location type the command loc -pr and you'll be taken back.\n ")
_ = input('Press enter to read more >> ')
print('\n Title screen weather:\n When you load up the app, you will see a dropdown box which displays the hourly weather. This box is dynamic and the amount of information changes according to the size of your terminal.\n It is recommended to have your terminal on full screen or at least extended beyond the default size.\n ')
_ = input('Press enter to read more >> ')
print("\n Other information:\n Under the weather hourly section, if toggle is enabled and if it's the last hour of the day. The section will display only the particular weather for the next hour and exit the section\n Since weather.com uses a separate tag for the current weather, you can view it only by typing the command weather now.\n \n \n Exiting the app:\n Please try to use only the EXIT command to exit the app, you can use CTRL-Z ent or CTRL-C to exit but these exit methods create issues when in the loc -p section.\n If CTRL-C or CTRL-Z in pressed in the loc -p section, it leads to a corrupt file issue sometimes. The next time you open the app an error will be displayed on the screen.\n ")
_ = input('Press enter to read more >> ')
print("\n Errors:\n 1. Port connection: \n If you try to use the app without access to the internet or have a very slow connection. Sometimes you'll get a port connection error\n Make sure you're connected to the internet or just wait for sometime for the issue to get resolved\n \n 2. File error:\n As mentioned in the above section (exiting the app), CTRL-Z ent or CTRL-C can produce errors when used in the loc -p section.\n When this occurs the app will close automatically and the next time you open it, the app will be reset meaning that you'd have to enter your permanent location again.\n Other than that there's no major issue using CTRL-Z ent or CTRL-C\n \n 3. Requests error:\n This error can only occur if you modify the contents of any of the location files.\n If this occurs, make sure to delete the gotloc.txt file when launching the application again.\n \n ")
_ = input('Press enter to exit help >> ') |
class TimelineService(object):
@classmethod
def get_timeline(cls, officer_allegations):
allegations_date = officer_allegations\
.values_list('allegation__incident_date_only', 'start_date')\
.order_by('allegation__incident_date')
items = []
for date in allegations_date:
if not date[0] and date[1]:
items.append(date[1])
elif date[0]:
items.append(date[0])
return sorted(items)
| class Timelineservice(object):
@classmethod
def get_timeline(cls, officer_allegations):
allegations_date = officer_allegations.values_list('allegation__incident_date_only', 'start_date').order_by('allegation__incident_date')
items = []
for date in allegations_date:
if not date[0] and date[1]:
items.append(date[1])
elif date[0]:
items.append(date[0])
return sorted(items) |
l = [int(e) for e in input().split()]
for i in range(1, len(l), 2):
l[i], l[i - 1] = l[i - 1], l[i]
[print(n) for n in l]
| l = [int(e) for e in input().split()]
for i in range(1, len(l), 2):
(l[i], l[i - 1]) = (l[i - 1], l[i])
[print(n) for n in l] |
# Description
# You are given a map in form of a two-dimensional integer grid where 1 represents land and 0 represents water. Grid cells are connected horizontally/vertically (not diagonally). The grid is completely surrounded by water, and there is exactly one island (i.e., one or more connected land cells). The island doesn't have "lakes" (water inside that isn't connected to the water around the island). One cell is a square with side length 1. The grid is rectangular, width and height don't exceed 100. Determine the perimeter of the island.
# Example
# [[0,1,0,0],
# [1,1,1,0],
# [0,1,0,0],
# [1,1,0,0]]
# Answer: 16
class Solution:
"""
@param grid: a 2D array
@return: the perimeter of the island
"""
def islandPerimeter(self, grid):
# Write your code here
count = 0
for y in range(len(grid)):
for x in range(len(grid[0])):
if grid[y][x]:
if x == 0:
count = count + 1
elif grid[y][x-1] == 0:
count = count + 1
if y == 0:
count = count + 1
elif grid[y-1][x] == 0:
count = count + 1
if x == len(grid[0])-1:
count = count + 1
elif grid[y][x+1] == 0:
count = count + 1
if y == len(grid)-1:
count = count + 1
elif grid[y+1][x] == 0:
count = count + 1
return count | class Solution:
"""
@param grid: a 2D array
@return: the perimeter of the island
"""
def island_perimeter(self, grid):
count = 0
for y in range(len(grid)):
for x in range(len(grid[0])):
if grid[y][x]:
if x == 0:
count = count + 1
elif grid[y][x - 1] == 0:
count = count + 1
if y == 0:
count = count + 1
elif grid[y - 1][x] == 0:
count = count + 1
if x == len(grid[0]) - 1:
count = count + 1
elif grid[y][x + 1] == 0:
count = count + 1
if y == len(grid) - 1:
count = count + 1
elif grid[y + 1][x] == 0:
count = count + 1
return count |
# 94. Binary Tree Inorder Traversal
# Definition for a binary tree node.
class TreeNode:
def __init__(self, x):
self.val = x
self.left = None
self.right = None
class Solution:
# recursive
def inorderTraversal(self, root):
"""
:type root: TreeNode
:rtype: List[int]
"""
ans = []
def helper(root):
if root.left: helper(root.left)
ans.append(root.val)
if root.right: helper(root.right)
if root: helper(root)
return ans
# iterative
def inorderTraversal2(self, root):
stack, ans = [], []
curr = root
while curr or stack:
while curr:
stack.append(curr)
curr = curr.left
curr = stack.pop()
ans.append(curr.val)
curr = curr.right
return ans
sol = Solution()
root = TreeNode(1)
root.left = TreeNode(2)
root.right = TreeNode(3)
root.left.left = TreeNode(4)
root.left.right = TreeNode(5)
root.right.left = TreeNode(6)
root.right.right = TreeNode(7)
print(sol.inorderTraversal2(root))
| class Treenode:
def __init__(self, x):
self.val = x
self.left = None
self.right = None
class Solution:
def inorder_traversal(self, root):
"""
:type root: TreeNode
:rtype: List[int]
"""
ans = []
def helper(root):
if root.left:
helper(root.left)
ans.append(root.val)
if root.right:
helper(root.right)
if root:
helper(root)
return ans
def inorder_traversal2(self, root):
(stack, ans) = ([], [])
curr = root
while curr or stack:
while curr:
stack.append(curr)
curr = curr.left
curr = stack.pop()
ans.append(curr.val)
curr = curr.right
return ans
sol = solution()
root = tree_node(1)
root.left = tree_node(2)
root.right = tree_node(3)
root.left.left = tree_node(4)
root.left.right = tree_node(5)
root.right.left = tree_node(6)
root.right.right = tree_node(7)
print(sol.inorderTraversal2(root)) |
tag = list(map(str, (input())))
vowels = ['A', 'E', 'I', 'O', 'U', 'Y']
if tag[2] in vowels:
print("invalid")
else:
if (int(tag[0])+int(tag[1]))%2==0 and (int(tag[3])+int(tag[4]))%2==0 and (int(tag[4])+int(tag[5]))%2==0 and (int(tag[7])+int(tag[8]))%2==0:
print("valid")
else:
print("invalid") | tag = list(map(str, input()))
vowels = ['A', 'E', 'I', 'O', 'U', 'Y']
if tag[2] in vowels:
print('invalid')
elif (int(tag[0]) + int(tag[1])) % 2 == 0 and (int(tag[3]) + int(tag[4])) % 2 == 0 and ((int(tag[4]) + int(tag[5])) % 2 == 0) and ((int(tag[7]) + int(tag[8])) % 2 == 0):
print('valid')
else:
print('invalid') |
__all__ = ['Simple']
class Simple(object):
def __init__(self, func):
self.func = func
def __call__(self, inputs, params, other):
return self.forward(inputs)
def forward(self, inputs):
return self.func(inputs), None
def backward(self, grad_out, cache):
return grad_out
| __all__ = ['Simple']
class Simple(object):
def __init__(self, func):
self.func = func
def __call__(self, inputs, params, other):
return self.forward(inputs)
def forward(self, inputs):
return (self.func(inputs), None)
def backward(self, grad_out, cache):
return grad_out |
class Stats:
def getLevelStats():
return [
"Str",
"Str",
"Str",
"Str",
"Str",
"Str",
"Str",
"Str",
"Str",
"Str",
"Str",
"Str",
"Str",
"Str",
"Str",
"Str",
"Str",
"Str",
"Str",
"Str",
"Str",
"Str",
"Str",
"Str",
"Str",
"Mag",
"Mag",
"Mag",
"Mag",
"Mag",
"Mag",
"Mag",
"Mag",
"Mag",
"Mag",
"Mag",
"Mag",
"Mag",
"Mag",
"Mag",
"Mag",
"Mag",
"Mag",
"Mag",
"Mag",
"Mag",
"Mag",
"Mag",
"Mag",
"Def",
"Def",
"Def",
"Def",
"Def",
"Def",
"Def",
"Def",
"Def",
"Def",
"Def",
"Def",
"Def",
"Def",
"Def",
"Def",
"Def",
"Def",
"Def",
"Def",
"Def",
"Def",
"Def",
"Def",
"Def",
"Def",
"Def",
"Def",
"Def",
"Def",
"Def",
"Def",
"Def",
"Def",
"Def",
"Def",
"Def",
"Def",
"Def",
"Def",
"Def",
"Def",
"Def",
"Def",
"Def",
"Def",
"Def",
"Def",
"Def",
"Def",
"Def",
]
def getAp():
return [
"Ap",
"Ap",
"Ap",
"Ap",
"Ap",
"Ap",
"Ap",
"Ap",
"Ap",
"Ap",
"Ap",
"Ap",
"Ap",
"Ap",
"Ap",
"Ap",
"Ap",
"Ap",
"Ap",
"Ap",
"Ap",
"Ap",
"Ap",
"Ap",
"Ap",
"Ap",
"Ap",
"Ap",
"Ap",
"Ap",
"Ap",
"Ap",
"Ap",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"Ap",
"",
"Ap",
"",
"Ap",
"",
"Ap",
"",
"Ap",
"",
"Ap",
"",
"Ap",
"",
"Ap",
"",
"Ap",
"",
"Ap",
"",
"Ap",
"",
"Ap",
"",
"Ap",
"",
"Ap",
"",
"Ap",
"",
"Ap",
"",
"Ap",
"",
"Ap",
"",
"Ap",
"",
"Ap",
"",
"Ap",
"",
"Ap",
"",
"Ap",
"",
"Ap",
"",
"Ap",
"",
"Ap",
"",
"Ap",
"",
"Ap",
"",
"Ap",
"",
"Ap",
"",
"Ap",
"",
"Ap",
"",
"Ap",
"",
"Ap",
"",
"Ap",
"",
"Ap",
"",
"Ap",
"",
"Ap",
"",
"Ap",
"",
"Ap",
"",
"Ap",
"",
"Ap",
"",
"Ap",
"",
"Ap",
"",
"Ap",
"",
"Ap",
"",
"Ap",
"",
"Ap",
"",
"Ap",
"",
"Ap",
"",
"Ap",
"",
"Ap",
"",
"Ap",
"",
"Ap",
"",
"Ap",
"",
"Ap",
"",
"Ap",
"",
"Ap",
"",
]
def getBonusStats():
return ["HP"]*20+["MP"]*4+["Armor"]*3 +["Accessory"]*3+["Item"]*5+["Drive"]*6 # Added missing drive gauge up and mp up | class Stats:
def get_level_stats():
return ['Str', 'Str', 'Str', 'Str', 'Str', 'Str', 'Str', 'Str', 'Str', 'Str', 'Str', 'Str', 'Str', 'Str', 'Str', 'Str', 'Str', 'Str', 'Str', 'Str', 'Str', 'Str', 'Str', 'Str', 'Str', 'Mag', 'Mag', 'Mag', 'Mag', 'Mag', 'Mag', 'Mag', 'Mag', 'Mag', 'Mag', 'Mag', 'Mag', 'Mag', 'Mag', 'Mag', 'Mag', 'Mag', 'Mag', 'Mag', 'Mag', 'Mag', 'Mag', 'Mag', 'Mag', 'Def', 'Def', 'Def', 'Def', 'Def', 'Def', 'Def', 'Def', 'Def', 'Def', 'Def', 'Def', 'Def', 'Def', 'Def', 'Def', 'Def', 'Def', 'Def', 'Def', 'Def', 'Def', 'Def', 'Def', 'Def', 'Def', 'Def', 'Def', 'Def', 'Def', 'Def', 'Def', 'Def', 'Def', 'Def', 'Def', 'Def', 'Def', 'Def', 'Def', 'Def', 'Def', 'Def', 'Def', 'Def', 'Def', 'Def', 'Def', 'Def', 'Def', 'Def']
def get_ap():
return ['Ap', 'Ap', 'Ap', 'Ap', 'Ap', 'Ap', 'Ap', 'Ap', 'Ap', 'Ap', 'Ap', 'Ap', 'Ap', 'Ap', 'Ap', 'Ap', 'Ap', 'Ap', 'Ap', 'Ap', 'Ap', 'Ap', 'Ap', 'Ap', 'Ap', 'Ap', 'Ap', 'Ap', 'Ap', 'Ap', 'Ap', 'Ap', 'Ap', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', 'Ap', '', 'Ap', '', 'Ap', '', 'Ap', '', 'Ap', '', 'Ap', '', 'Ap', '', 'Ap', '', 'Ap', '', 'Ap', '', 'Ap', '', 'Ap', '', 'Ap', '', 'Ap', '', 'Ap', '', 'Ap', '', 'Ap', '', 'Ap', '', 'Ap', '', 'Ap', '', 'Ap', '', 'Ap', '', 'Ap', '', 'Ap', '', 'Ap', '', 'Ap', '', 'Ap', '', 'Ap', '', 'Ap', '', 'Ap', '', 'Ap', '', 'Ap', '', 'Ap', '', 'Ap', '', 'Ap', '', 'Ap', '', 'Ap', '', 'Ap', '', 'Ap', '', 'Ap', '', 'Ap', '', 'Ap', '', 'Ap', '', 'Ap', '', 'Ap', '', 'Ap', '', 'Ap', '', 'Ap', '', 'Ap', '', 'Ap', '', 'Ap', '', 'Ap', '', 'Ap', '', 'Ap', '', 'Ap', '', 'Ap', '', 'Ap', '', 'Ap', '']
def get_bonus_stats():
return ['HP'] * 20 + ['MP'] * 4 + ['Armor'] * 3 + ['Accessory'] * 3 + ['Item'] * 5 + ['Drive'] * 6 |
#1. Kod
l=[[1,'a',['cat'],2],[[[3]],'dog'],4,5]
m = []
def flaten(x):
for i in x:
if type(i) == list:
flaten(i)
else:
m.append(i)
flaten(l)
print(m)
[1, 'a', 'cat', 2, 3, 'dog', 4, 5]
#2.Kod
a = [[1, 2], [3, 4], [5, 6, 7]]
l=[]
for i in range(0,len(a)):
a[i].reverse()
l.append(a[i])
l.reverse()
print(l)
[[7, 6, 5], [4, 3], [2, 1]]
| l = [[1, 'a', ['cat'], 2], [[[3]], 'dog'], 4, 5]
m = []
def flaten(x):
for i in x:
if type(i) == list:
flaten(i)
else:
m.append(i)
flaten(l)
print(m)
[1, 'a', 'cat', 2, 3, 'dog', 4, 5]
a = [[1, 2], [3, 4], [5, 6, 7]]
l = []
for i in range(0, len(a)):
a[i].reverse()
l.append(a[i])
l.reverse()
print(l)
[[7, 6, 5], [4, 3], [2, 1]] |
def anagramSolution(s1,s2):
c1 = {}
for i in s1:
if i in c1:
c1[i] = c1[i] + 1
else:
c1[i] = 1
for i in s2:
anagram = True
if i not in c1:
anagram = False
return anagram
return anagram
print(anagramSolution('apple','pleap')) | def anagram_solution(s1, s2):
c1 = {}
for i in s1:
if i in c1:
c1[i] = c1[i] + 1
else:
c1[i] = 1
for i in s2:
anagram = True
if i not in c1:
anagram = False
return anagram
return anagram
print(anagram_solution('apple', 'pleap')) |
slimearm = Actor('alien')
slimearm.topright = 0, 10
WIDTH = 712
HEIGHT = 508
def draw():
screen.fill((240, 6, 253))
slimearm.draw()
def update():
slimearm.left += 2
if slimearm.left > WIDTH:
slimearm.right = 0
def on_mouse_down(pos):
if slimearm.collidepoint(pos):
set_alien_hurt()
else:
print("you missed me!")
def set_alien_hurt():
print("Eek!")
sounds.eep.play()
slimearm.image = 'alien_hurt'
clock.schedule_unique(set_alien_normal, 1.0)
def set_alien_normal():
slimearm.image = 'alien' | slimearm = actor('alien')
slimearm.topright = (0, 10)
width = 712
height = 508
def draw():
screen.fill((240, 6, 253))
slimearm.draw()
def update():
slimearm.left += 2
if slimearm.left > WIDTH:
slimearm.right = 0
def on_mouse_down(pos):
if slimearm.collidepoint(pos):
set_alien_hurt()
else:
print('you missed me!')
def set_alien_hurt():
print('Eek!')
sounds.eep.play()
slimearm.image = 'alien_hurt'
clock.schedule_unique(set_alien_normal, 1.0)
def set_alien_normal():
slimearm.image = 'alien' |
class StringMult:
def times(self, sFactor, iFactor):
if(sFactor == ""):
return ""
elif(iFactor == 0):
return ""
elif(iFactor > 0):
return sFactor * iFactor
else:
reverse = sFactor[::-1]
return reverse * abs(iFactor)
| class Stringmult:
def times(self, sFactor, iFactor):
if sFactor == '':
return ''
elif iFactor == 0:
return ''
elif iFactor > 0:
return sFactor * iFactor
else:
reverse = sFactor[::-1]
return reverse * abs(iFactor) |
#!/usr/bin/python
# -*- coding: utf-8 -*-
class Chapter:
def __init__(
self,
client,
json_data,
):
"""
Constructs all the necessary attributes for the Chapter object.
Parameters
----------
json_data : json
data in json format.
"""
self.__json = json_data
self.chapter_number = int(json_data["chapter_number"])
self.chapter_summary = json_data["chapter_summary"]
self.name = json_data["name"]
self.verses_count = json_data["verses_count"]
self.name_meaning = json_data["name_meaning"]
self.name_translation = json_data["name_translation"]
self.client = client
self.name_transliterated = json_data["name_transliterated"]
self.name_meaning = json_data["name_meaning"]
def json(self):
return self.__json
def __str__(self):
"""Returns the name of chapter."""
return self.name
| class Chapter:
def __init__(self, client, json_data):
"""
Constructs all the necessary attributes for the Chapter object.
Parameters
----------
json_data : json
data in json format.
"""
self.__json = json_data
self.chapter_number = int(json_data['chapter_number'])
self.chapter_summary = json_data['chapter_summary']
self.name = json_data['name']
self.verses_count = json_data['verses_count']
self.name_meaning = json_data['name_meaning']
self.name_translation = json_data['name_translation']
self.client = client
self.name_transliterated = json_data['name_transliterated']
self.name_meaning = json_data['name_meaning']
def json(self):
return self.__json
def __str__(self):
"""Returns the name of chapter."""
return self.name |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.