content
stringlengths 7
1.05M
| fixed_cases
stringlengths 1
1.28M
|
|---|---|
class TP_Texts:
# __init__()
init_error1 = "Start and End must be of type datetime.datetime!"
init_error2 = "End must be larger than start!"
# start()
start_error1 = "Time must be of type datetime.datetime!"
start_error2 = "start must be smaller than end of Time_Period!"
# end()
end_error1 = "end must be larger than start of TimePeriod!"
# general
general_error1 = "'another' must be of type datetime.datetime or sptemp.zeit.Time_Period!"
general_error2 = "'another' must be of type sptemp.zeit.Time_Period!"
class TS_Texts:
# __init__()
init_error1 = "ts must be of type datetime.datetime or sptemp.zeit.Time_Period!"
# value()
v_error1 = "value must be of same type as old value of the TS_Object!"
class Unit_Texts:
# __init__()
init_error1 = "value must be of type 'types.FunctionType'!"
init_error2 = "ts must be of type sptemp.zeit.Time_Period!"
#interpolate()
i_error1 = "start_ts AND end_ts must be of type sptemp.zeit.TS_Object!"
i_error2 = "Time must be of type datetime.datetime!"
i_error3 = "start_ts.end_time() must be included in self.ts!"
#i_error4 = "end_ts.start_time() must be included in self.ts!"
i_error5 = "time must be included in self.ts!"
class IP_Texts:
# __init__()
init_error1 = "Empty instantiation not possible!"
init_error2 = "ts_unit_list must be list holding objects of type sptemp.zeit.TS_Unit!"
init_error3 = "TS_Unit elements of ts_unit_list must be time-sorted and end_times of units must equal start_times of next unit!"
# setitem()
set_error1 = "Index must be of type integer! Slices not allowed"
set_error2 = "Value must be of type TS_Unit!"
set_error3 = "Index out of range!"
set_error4 = "Value must cover same time_period as the value it replaces!"
# delitem()
del_error1 = "Only first and last item can be deleted!"
del_error2 = "Interpolator object cannot be empty!"
# interpolate()
ip_error1 = "start_ts and end_ts must be of type sptemp.zeit.TS_Object!"
ip_error2 = "time must be of type datetime.datetime!"
ip_error3 = "start_ts.end_time() must be >= self.start_time()!"
ip_error4 = "time must be >= start_ts.end_time() and <= end_ts.start_time()!"
ip_error5 = "time must be >= self.start_time() and <= self.end_time()!"
ip_error6 = "start_ts.end_time() must be < end_ts.start_time()!"
# value()
val_error1 = "time must be of type datetime.datetime!"
# value()
slice_error1 = "time must be of type sptemp.zeit.Time_Period!"
slice_error2 = "slice produces empty Interpolator. Either time.start or time.end must be contained in timespan of Interpolator!"
# append()
app_error1 = "Value must be of type sptemp.zeit.TS_Unit!"
app_error2 = "Value.start_time() must equal Interpolator.end_time()"
# insert()
in_error1 = "Value must be of type sptemp.zeit.TS_Unit!"
in_error2 = "Either value.start_time() or value.end_time() must be >= Interpolator.start_time() and <= Interpolator.end_time()!"
# delete()
delete_error1 = "time must be of type sptemp.zeit.Time_Period!"
delete_error2 = "Interpolator object cannot be empty!"
delete_error3 = "Invalid time. Time must overlap Interpolator.start_time() or Interpolator.end_time()!"
class MO_Texts:
# init()
init_error1 = "Empty instantiation not possible!"
init_error2 = "ts_object_list must be list holding objects of type sptemp.zeit.TS_Object!"
init_error3 = "interpolator must be of type sptemp.zeit.Interpolator!"
init_error4 = "TS_Objects must have same type!"
init_error5 = "ts_object_list must be time-sorted and TS_Objects must be disjoint!"
# setitem()
set_error1 = "Index must be of type integer! Slices not allowed"
set_error2 = "Value must be of type TS_Object!"
set_error3 = "Value.type must be equal to self.type!"
set_error4 = "Index out of range!"
set_error5 = "Value and existing TS_Objects in Moving_Object are not disjoint!"
# delitem()
del_error1 = "key must be of type interger or slice!"
del_error2 = "Moving_Object cannot become empty!"
# interpolate()
i_error1 = "time must be of type datetime.datetime!"
i_error2 = "time must be >= self.start_time() and <= self.end_time()!"
i_error3 = "Interpolator must return TSO_object with same type as self.type!"
# slice()
slice_error1 = "Time must be of type sptemp.zeit.Time_Period!"
slice_error2 = "interpolator must be of type sptemp.zeit.Interpolator!"
slice_error3 = "Slice is empty!"
# resampled_slice()
re_slice_error1 = "Times must be of type slice!"
re_slice_error2 = "Lenght of times must be > 1!"
re_slice_error3 = "interpolator must be of type sptemp.zeit.Interpolator!"
# prev_ts()
prev_error1 = "Time must be of type datetime.datetime!"
# append()
app_error1 = "Value must be of type spetemp.zeit.TS_Object!"
app_error2 = "Value.start_time() must be > Moving_Object.end_time()"
# insert()
in_error1 = "Value must be of type spetemp.zeit.TS_Object!"
in_error2 = "Value.ts and timestamps of esisting TS_Objects in Moving_Object must be disjoint!"
in_error3 = "Value.type must be equal to self.type!"
# delete()
delete_error1 = "Time must be of type sptemp.zeit.Time_Period!"
delete_error2 = "Moving_Object cannot become empty!"
class TS_Geometry_Texts:
# __init__():
init_error1 = "Value must be of type shapely.geometry!"
init_error2 = "Value must not be empty!"
init_error3 = "crs must be of type pyproj.Proj!"
# value()
v_error1 = "value must be equal to self.type!"
v_error2 = "self.has_z and value.has_z must be equal!"
# reproject()
r_error1 = "TS_Geometry has no coordinate reference system!"
r_error2 = "to_crs must be of type pyproj.Proj!"
class TS_Point_Texts:
# __init__():
init_error1 = "Value must be of type shapely.geometry.Point!"
init_error2 = "Point must not be empty!"
init_error3 = "crs must be of type pyproj.Proj!"
# value()
v_error1 = "value must be of type shapey.geometry.Point!"
v_error2 = "self.has_z and value.has_z must be equal!"
# reproject()
r_error1 = "TS_Point has no coordinate reference system!"
r_error2 = "to_crs must be of type pyproj.Proj!"
class MG_Texts:
# within
w_error1 = "another must be of type shapely.geometry or TS_Geometry or Moving_Geometry or Moving_Collection!"
w_error2 = "timedelta must be positive!"
w_error3 = "td1 must be larger or equal to td2!"
class MP_Texts:
# __init__()
init_error1 = "ts_objects_list can only elements of type sptemp.moving_geometry.TS_Points!"
init_error2 = "coordinate reference system of all TS_Points in ts_object_list must be equal!"
init_error3 = "TS_Point.has_z must be equal for all TS_Points in ts_object_list!"
# __setitem__()
set_error1 = "value must be of type sptemp.moving_geometry.TS_Point!"
# __append__()
app_error1 = "value must be of type sptemp.moving_geometry.TS_Point!"
# insert()
in_error1 = "value must be of type sptemp.moving_geometry.TS_Point!"
# reproject()
re_error1 = "Moving_Object has no coorinate reference system!"
class TS_LineString_Texts:
# __init__():
init_error1 = "Value must be of type shapely.geometry.LineString!"
init_error2 = "LineString must not be empty!"
init_error3 = "crs must be of type pyproj.Proj!"
# value()
v_error1 = "value must be of type shapey.geometry.LineString!"
v_error2 = "self.has_z and value.has_z must be equal!"
# reproject()
r_error1 = "TS_LineString has no coordinate reference system!"
r_error2 = "to_crs must be of type pyproj.Proj!"
class ML_Texts:
# __init__()
init_error1 = "ts_objects_list can only elements of type sptemp.moving_geometry.TS_LineString!"
init_error2 = "coordinate reference system of all TS_LineStrings in ts_object_list must be equal!"
init_error3 = "TS_LineSTring.has_z must be equal for all TS_LineStrings in ts_object_list!"
# __setitem__()
set_error1 = "value must be of type sptemp.moving_geometry.TS_LineString!"
# __append__()
app_error1 = "value must be of type sptemp.moving_geometry.TS_LineString!"
# insert()
in_error1 = "value must be of type sptemp.moving_geometry.TS_LineString!"
# reproject()
re_error1 = "Moving_Object has no coordinate reference system!"
class TS_LinearRing_Texts:
# __init__():
init_error1 = "Value must be of type shapely.geometry.LinearRing!"
class MLR_Texts:
# __init__()
init_error1 = "ts_objects_list can only elements of type sptemp.moving_geometry.TS_LinearRing!"
init_error2 = "coordinate reference system of all TS_LinearRings in ts_object_list must be equal!"
init_error3 = "TS_LinearRing.has_z must be equal for all TS_LinearRings in ts_object_list!"
# __setitem__()
set_error1 = "value must be of type sptemp.moving_geometry.TS_LinearRing!"
# __append__()
app_error1 = "value must be of type sptemp.moving_geometry.TS_LinearRing!"
# insert()
in_error1 = "value must be of type sptemp.moving_geometry.TS_LinearRing!"
class MC_Texts:
# __init__()
init_error1 = "moving_list cannot be empty!"
init_error2 = "moving_list must be of type list!"
init_error3 = "moving_list can only contain values of type Moving_Point, Moving_LineString and Moving_Polygon!"
# interpolate()
ip_error1 = "time must be of type datetime.datetime!"
ip_error2 = "args_dict must be of type dict!"
# slice()
slice_error1 = "time must be type sptemp.zeit.TimePeriod!"
slice_error2 = "interpolator_dict must be of type dict!"
# resampled_slice()
re_slice_error1 = "Times must be of type slice!"
re_slice_error2 = "Lenght of times must be > 1!"
re_slice_error3 = "interpolator must be of type dict!"
class MPL_Texts:
# __init__()
init_error1 = "exterior ring must be of type sptemp.moving_geometry.Moving_LinearRing!"
init_error2 = "interior rings must be of type list!"
init_error3 = "interior ring must be of type sptemp.moving_geometry.Moving_LinearRing!"
# interpolate()
ip_error1 = "time must be of type datetime.datetime!"
ip_error2 = "args_dict must be of type dict!"
# slice()
slice_error1 = "time must be of type sptemp.zeit.Time_Period!"
slice_error2 = "interpolator_dict must be of type dict!"
class MMP_Texts:
# __init__()
init_error1 = "moving_list cannot be empty!"
init_error2 = "moving_list must be of type list!"
init_error3 = "moving_list can only contain values of type Moving_Point!"
class MML_Texts:
# __init__()
init_error1 = "moving_list cannot be empty!"
init_error2 = "moving_list must be of type list!"
init_error3 = "moving_list can only contain values of type Moving_LineString!"
class MMPL_Texts:
# __init__()
init_error1 = "moving_list cannot be empty!"
init_error2 = "moving_list must be of type list!"
init_error3 = "moving_list can only contain values of type Moving_Polygon!"
# slice()
slice_error1 = "time must be type sptemp.zeit.TimePeriod!"
slice_error2 = "interpolator_dict must be of type dict!"
class MG_Helper_Texts:
# has_z_equal()
hz_error1 = "has_z and has_z must be consistent!"
# crs_equal()
crs_error1 = "crs must be consistent!"
class IC_Texts:
# linear()
error1 = "start_ts AND end_ts must be of type sptemp.zeit.TS_Object!"
error2 = "Time must be of type datetime.datetime!"
error3 = "start_ts.type must be equal to end_ts.type"
error4 = "start_ts must lay before end_ts on the time_axis"
class IPoint_Texts:
# linear_point()
lp_error1 = "start_ts and end_ts must be of type sptemp.moving_geometry.TS_Point!"
lp_error2 = "time must be of type datetime.datetime!"
lp_error3 = "start_ts.has_z must be equal to end_ts.has_z!"
lp_error4 = "start_ts must lay before end_ts on the time_axis!"
lp_error5 = "time must be >= start_ts.end_time() and <= end_ts.start_time()!"
lp_error6 = "start_ts.crs must be equal to end_ts.crs!"
# curve_point()
c_error1 = "start_ts and end_ts must be of type sptemp.moving_geometry.TS_Point!"
c_error2 = "time must be of type datetime.datetime!"
c_error3 = "curve must be of type shpely.geometry.LineString!"
c_error4 = "start_ts.has_z, end_ts.has_z and curve.has_z must be equal!"
c_error5 = "start_ts.crs must be equal to end_ts.crs!"
c_error6 = "start_ts must lay before end_ts on the time_axis"
c_error7 = "time must be >= start_ts.end_time() and <= end_ts.start_time()!"
c_error8 = "start_ts.value must be equal to start point of curve and end_ts.value must be equal to end point of curve!"
class ICurve_Texts:
# basic_linear()
bl_error1 = "start_ts and end_ts must be of type sptemp.moving_geometry.TS_LineString!"
bl_error2 = "time must be of type datetime.datetime!"
bl_error3 = "start_ts.has_z and end_ts.has_z must be equal!"
bl_error4 = "start_ts.crs must be equal to end_ts.crs!"
bl_error5 = "start_ts must lay before end_ts on the time_axis"
bl_error6 = "time must be >= start_ts.end_time() and <= end_ts.start_time()!"
bl_error7 = "s_type must be in ['angle', 'distance']!"
class IRing_Texts:
# linear_translation()
lt_error1 = "start_ts and end_ts must be of type sptemp.moving_geometry.TS_LinearRing!"
lt_error2 = "time must be of type datetime.datetime!"
lt_error3 = "start_ts.has_z and end_ts.has_z must be equal!"
lt_error4 = "start_ts.crs must be equal to end_ts.crs!"
lt_error5 = "start_ts must lay before end_ts on the time_axis"
lt_error6 = "time must be >= start_ts.end_time() and <= end_ts.start_time()!"
lt_error7 = "s_type must be in ['angle', 'distance']!"
class IHelper_Texts:
# linear_point()
lp_error1 = "invalid coordinate dimensions!"
# angle()
ang_error1 = "invalid coordinate dimensions!"
class SPT_Texts:
# __init__()
init_error1 = "dataframe must be of type pandas.DataFrame!"
init_error2 = "Geometry column must have name 'geometry'!"
#init_error3 = "empty instantiation not possible!"
init_error4 = "crs must be of type pyproj.Proj!"
init_error5 = "Geometry type must be shapely.geometry or Moving_Point, Moving_LineString, Moving_LinearRing or Moving_Collection!"
# interpolate
ip_error1 = "time must be of type datetime.datetime!"
ip_error2 = "args must be stored in dict for Moving_Collections and in list for Moving_Objects!"
# slice
slice_error1 = "time must be of type sptemp.zeit.Time_Period!"
# reproject
re_error1 = "If geometry column holds values of type shapely.geometry SPT_DataFrame.crs has to be set for reprojection!"
re_error2 = "to_crs must be of type pyproj.Proj!"
# read_from_json
rj_error1 = "File does not exist!"
rj_error2 = "interpolator_dict must of type dict!"
rj_error3 = "For empty instantiation, column_names must be defined!"
|
class Tp_Texts:
init_error1 = 'Start and End must be of type datetime.datetime!'
init_error2 = 'End must be larger than start!'
start_error1 = 'Time must be of type datetime.datetime!'
start_error2 = 'start must be smaller than end of Time_Period!'
end_error1 = 'end must be larger than start of TimePeriod!'
general_error1 = "'another' must be of type datetime.datetime or sptemp.zeit.Time_Period!"
general_error2 = "'another' must be of type sptemp.zeit.Time_Period!"
class Ts_Texts:
init_error1 = 'ts must be of type datetime.datetime or sptemp.zeit.Time_Period!'
v_error1 = 'value must be of same type as old value of the TS_Object!'
class Unit_Texts:
init_error1 = "value must be of type 'types.FunctionType'!"
init_error2 = 'ts must be of type sptemp.zeit.Time_Period!'
i_error1 = 'start_ts AND end_ts must be of type sptemp.zeit.TS_Object!'
i_error2 = 'Time must be of type datetime.datetime!'
i_error3 = 'start_ts.end_time() must be included in self.ts!'
i_error5 = 'time must be included in self.ts!'
class Ip_Texts:
init_error1 = 'Empty instantiation not possible!'
init_error2 = 'ts_unit_list must be list holding objects of type sptemp.zeit.TS_Unit!'
init_error3 = 'TS_Unit elements of ts_unit_list must be time-sorted and end_times of units must equal start_times of next unit!'
set_error1 = 'Index must be of type integer! Slices not allowed'
set_error2 = 'Value must be of type TS_Unit!'
set_error3 = 'Index out of range!'
set_error4 = 'Value must cover same time_period as the value it replaces!'
del_error1 = 'Only first and last item can be deleted!'
del_error2 = 'Interpolator object cannot be empty!'
ip_error1 = 'start_ts and end_ts must be of type sptemp.zeit.TS_Object!'
ip_error2 = 'time must be of type datetime.datetime!'
ip_error3 = 'start_ts.end_time() must be >= self.start_time()!'
ip_error4 = 'time must be >= start_ts.end_time() and <= end_ts.start_time()!'
ip_error5 = 'time must be >= self.start_time() and <= self.end_time()!'
ip_error6 = 'start_ts.end_time() must be < end_ts.start_time()!'
val_error1 = 'time must be of type datetime.datetime!'
slice_error1 = 'time must be of type sptemp.zeit.Time_Period!'
slice_error2 = 'slice produces empty Interpolator. Either time.start or time.end must be contained in timespan of Interpolator!'
app_error1 = 'Value must be of type sptemp.zeit.TS_Unit!'
app_error2 = 'Value.start_time() must equal Interpolator.end_time()'
in_error1 = 'Value must be of type sptemp.zeit.TS_Unit!'
in_error2 = 'Either value.start_time() or value.end_time() must be >= Interpolator.start_time() and <= Interpolator.end_time()!'
delete_error1 = 'time must be of type sptemp.zeit.Time_Period!'
delete_error2 = 'Interpolator object cannot be empty!'
delete_error3 = 'Invalid time. Time must overlap Interpolator.start_time() or Interpolator.end_time()!'
class Mo_Texts:
init_error1 = 'Empty instantiation not possible!'
init_error2 = 'ts_object_list must be list holding objects of type sptemp.zeit.TS_Object!'
init_error3 = 'interpolator must be of type sptemp.zeit.Interpolator!'
init_error4 = 'TS_Objects must have same type!'
init_error5 = 'ts_object_list must be time-sorted and TS_Objects must be disjoint!'
set_error1 = 'Index must be of type integer! Slices not allowed'
set_error2 = 'Value must be of type TS_Object!'
set_error3 = 'Value.type must be equal to self.type!'
set_error4 = 'Index out of range!'
set_error5 = 'Value and existing TS_Objects in Moving_Object are not disjoint!'
del_error1 = 'key must be of type interger or slice!'
del_error2 = 'Moving_Object cannot become empty!'
i_error1 = 'time must be of type datetime.datetime!'
i_error2 = 'time must be >= self.start_time() and <= self.end_time()!'
i_error3 = 'Interpolator must return TSO_object with same type as self.type!'
slice_error1 = 'Time must be of type sptemp.zeit.Time_Period!'
slice_error2 = 'interpolator must be of type sptemp.zeit.Interpolator!'
slice_error3 = 'Slice is empty!'
re_slice_error1 = 'Times must be of type slice!'
re_slice_error2 = 'Lenght of times must be > 1!'
re_slice_error3 = 'interpolator must be of type sptemp.zeit.Interpolator!'
prev_error1 = 'Time must be of type datetime.datetime!'
app_error1 = 'Value must be of type spetemp.zeit.TS_Object!'
app_error2 = 'Value.start_time() must be > Moving_Object.end_time()'
in_error1 = 'Value must be of type spetemp.zeit.TS_Object!'
in_error2 = 'Value.ts and timestamps of esisting TS_Objects in Moving_Object must be disjoint!'
in_error3 = 'Value.type must be equal to self.type!'
delete_error1 = 'Time must be of type sptemp.zeit.Time_Period!'
delete_error2 = 'Moving_Object cannot become empty!'
class Ts_Geometry_Texts:
init_error1 = 'Value must be of type shapely.geometry!'
init_error2 = 'Value must not be empty!'
init_error3 = 'crs must be of type pyproj.Proj!'
v_error1 = 'value must be equal to self.type!'
v_error2 = 'self.has_z and value.has_z must be equal!'
r_error1 = 'TS_Geometry has no coordinate reference system!'
r_error2 = 'to_crs must be of type pyproj.Proj!'
class Ts_Point_Texts:
init_error1 = 'Value must be of type shapely.geometry.Point!'
init_error2 = 'Point must not be empty!'
init_error3 = 'crs must be of type pyproj.Proj!'
v_error1 = 'value must be of type shapey.geometry.Point!'
v_error2 = 'self.has_z and value.has_z must be equal!'
r_error1 = 'TS_Point has no coordinate reference system!'
r_error2 = 'to_crs must be of type pyproj.Proj!'
class Mg_Texts:
w_error1 = 'another must be of type shapely.geometry or TS_Geometry or Moving_Geometry or Moving_Collection!'
w_error2 = 'timedelta must be positive!'
w_error3 = 'td1 must be larger or equal to td2!'
class Mp_Texts:
init_error1 = 'ts_objects_list can only elements of type sptemp.moving_geometry.TS_Points!'
init_error2 = 'coordinate reference system of all TS_Points in ts_object_list must be equal!'
init_error3 = 'TS_Point.has_z must be equal for all TS_Points in ts_object_list!'
set_error1 = 'value must be of type sptemp.moving_geometry.TS_Point!'
app_error1 = 'value must be of type sptemp.moving_geometry.TS_Point!'
in_error1 = 'value must be of type sptemp.moving_geometry.TS_Point!'
re_error1 = 'Moving_Object has no coorinate reference system!'
class Ts_Linestring_Texts:
init_error1 = 'Value must be of type shapely.geometry.LineString!'
init_error2 = 'LineString must not be empty!'
init_error3 = 'crs must be of type pyproj.Proj!'
v_error1 = 'value must be of type shapey.geometry.LineString!'
v_error2 = 'self.has_z and value.has_z must be equal!'
r_error1 = 'TS_LineString has no coordinate reference system!'
r_error2 = 'to_crs must be of type pyproj.Proj!'
class Ml_Texts:
init_error1 = 'ts_objects_list can only elements of type sptemp.moving_geometry.TS_LineString!'
init_error2 = 'coordinate reference system of all TS_LineStrings in ts_object_list must be equal!'
init_error3 = 'TS_LineSTring.has_z must be equal for all TS_LineStrings in ts_object_list!'
set_error1 = 'value must be of type sptemp.moving_geometry.TS_LineString!'
app_error1 = 'value must be of type sptemp.moving_geometry.TS_LineString!'
in_error1 = 'value must be of type sptemp.moving_geometry.TS_LineString!'
re_error1 = 'Moving_Object has no coordinate reference system!'
class Ts_Linearring_Texts:
init_error1 = 'Value must be of type shapely.geometry.LinearRing!'
class Mlr_Texts:
init_error1 = 'ts_objects_list can only elements of type sptemp.moving_geometry.TS_LinearRing!'
init_error2 = 'coordinate reference system of all TS_LinearRings in ts_object_list must be equal!'
init_error3 = 'TS_LinearRing.has_z must be equal for all TS_LinearRings in ts_object_list!'
set_error1 = 'value must be of type sptemp.moving_geometry.TS_LinearRing!'
app_error1 = 'value must be of type sptemp.moving_geometry.TS_LinearRing!'
in_error1 = 'value must be of type sptemp.moving_geometry.TS_LinearRing!'
class Mc_Texts:
init_error1 = 'moving_list cannot be empty!'
init_error2 = 'moving_list must be of type list!'
init_error3 = 'moving_list can only contain values of type Moving_Point, Moving_LineString and Moving_Polygon!'
ip_error1 = 'time must be of type datetime.datetime!'
ip_error2 = 'args_dict must be of type dict!'
slice_error1 = 'time must be type sptemp.zeit.TimePeriod!'
slice_error2 = 'interpolator_dict must be of type dict!'
re_slice_error1 = 'Times must be of type slice!'
re_slice_error2 = 'Lenght of times must be > 1!'
re_slice_error3 = 'interpolator must be of type dict!'
class Mpl_Texts:
init_error1 = 'exterior ring must be of type sptemp.moving_geometry.Moving_LinearRing!'
init_error2 = 'interior rings must be of type list!'
init_error3 = 'interior ring must be of type sptemp.moving_geometry.Moving_LinearRing!'
ip_error1 = 'time must be of type datetime.datetime!'
ip_error2 = 'args_dict must be of type dict!'
slice_error1 = 'time must be of type sptemp.zeit.Time_Period!'
slice_error2 = 'interpolator_dict must be of type dict!'
class Mmp_Texts:
init_error1 = 'moving_list cannot be empty!'
init_error2 = 'moving_list must be of type list!'
init_error3 = 'moving_list can only contain values of type Moving_Point!'
class Mml_Texts:
init_error1 = 'moving_list cannot be empty!'
init_error2 = 'moving_list must be of type list!'
init_error3 = 'moving_list can only contain values of type Moving_LineString!'
class Mmpl_Texts:
init_error1 = 'moving_list cannot be empty!'
init_error2 = 'moving_list must be of type list!'
init_error3 = 'moving_list can only contain values of type Moving_Polygon!'
slice_error1 = 'time must be type sptemp.zeit.TimePeriod!'
slice_error2 = 'interpolator_dict must be of type dict!'
class Mg_Helper_Texts:
hz_error1 = 'has_z and has_z must be consistent!'
crs_error1 = 'crs must be consistent!'
class Ic_Texts:
error1 = 'start_ts AND end_ts must be of type sptemp.zeit.TS_Object!'
error2 = 'Time must be of type datetime.datetime!'
error3 = 'start_ts.type must be equal to end_ts.type'
error4 = 'start_ts must lay before end_ts on the time_axis'
class Ipoint_Texts:
lp_error1 = 'start_ts and end_ts must be of type sptemp.moving_geometry.TS_Point!'
lp_error2 = 'time must be of type datetime.datetime!'
lp_error3 = 'start_ts.has_z must be equal to end_ts.has_z!'
lp_error4 = 'start_ts must lay before end_ts on the time_axis!'
lp_error5 = 'time must be >= start_ts.end_time() and <= end_ts.start_time()!'
lp_error6 = 'start_ts.crs must be equal to end_ts.crs!'
c_error1 = 'start_ts and end_ts must be of type sptemp.moving_geometry.TS_Point!'
c_error2 = 'time must be of type datetime.datetime!'
c_error3 = 'curve must be of type shpely.geometry.LineString!'
c_error4 = 'start_ts.has_z, end_ts.has_z and curve.has_z must be equal!'
c_error5 = 'start_ts.crs must be equal to end_ts.crs!'
c_error6 = 'start_ts must lay before end_ts on the time_axis'
c_error7 = 'time must be >= start_ts.end_time() and <= end_ts.start_time()!'
c_error8 = 'start_ts.value must be equal to start point of curve and end_ts.value must be equal to end point of curve!'
class Icurve_Texts:
bl_error1 = 'start_ts and end_ts must be of type sptemp.moving_geometry.TS_LineString!'
bl_error2 = 'time must be of type datetime.datetime!'
bl_error3 = 'start_ts.has_z and end_ts.has_z must be equal!'
bl_error4 = 'start_ts.crs must be equal to end_ts.crs!'
bl_error5 = 'start_ts must lay before end_ts on the time_axis'
bl_error6 = 'time must be >= start_ts.end_time() and <= end_ts.start_time()!'
bl_error7 = "s_type must be in ['angle', 'distance']!"
class Iring_Texts:
lt_error1 = 'start_ts and end_ts must be of type sptemp.moving_geometry.TS_LinearRing!'
lt_error2 = 'time must be of type datetime.datetime!'
lt_error3 = 'start_ts.has_z and end_ts.has_z must be equal!'
lt_error4 = 'start_ts.crs must be equal to end_ts.crs!'
lt_error5 = 'start_ts must lay before end_ts on the time_axis'
lt_error6 = 'time must be >= start_ts.end_time() and <= end_ts.start_time()!'
lt_error7 = "s_type must be in ['angle', 'distance']!"
class Ihelper_Texts:
lp_error1 = 'invalid coordinate dimensions!'
ang_error1 = 'invalid coordinate dimensions!'
class Spt_Texts:
init_error1 = 'dataframe must be of type pandas.DataFrame!'
init_error2 = "Geometry column must have name 'geometry'!"
init_error4 = 'crs must be of type pyproj.Proj!'
init_error5 = 'Geometry type must be shapely.geometry or Moving_Point, Moving_LineString, Moving_LinearRing or Moving_Collection!'
ip_error1 = 'time must be of type datetime.datetime!'
ip_error2 = 'args must be stored in dict for Moving_Collections and in list for Moving_Objects!'
slice_error1 = 'time must be of type sptemp.zeit.Time_Period!'
re_error1 = 'If geometry column holds values of type shapely.geometry SPT_DataFrame.crs has to be set for reprojection!'
re_error2 = 'to_crs must be of type pyproj.Proj!'
rj_error1 = 'File does not exist!'
rj_error2 = 'interpolator_dict must of type dict!'
rj_error3 = 'For empty instantiation, column_names must be defined!'
|
#
# PySNMP MIB module CISCO-OTV-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/CISCO-OTV-MIB
# Produced by pysmi-0.3.4 at Wed May 1 12:09:07 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 (default, Mar 27 2019, 09:23:15)
#
Integer, ObjectIdentifier, OctetString = mibBuilder.importSymbols("ASN1", "Integer", "ObjectIdentifier", "OctetString")
NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues")
ValueRangeConstraint, ConstraintsIntersection, SingleValueConstraint, ValueSizeConstraint, ConstraintsUnion = mibBuilder.importSymbols("ASN1-REFINEMENT", "ValueRangeConstraint", "ConstraintsIntersection", "SingleValueConstraint", "ValueSizeConstraint", "ConstraintsUnion")
ciscoMgmt, = mibBuilder.importSymbols("CISCO-SMI", "ciscoMgmt")
Cisco2KVlanList, = mibBuilder.importSymbols("CISCO-TC", "Cisco2KVlanList")
InterfaceIndexOrZero, = mibBuilder.importSymbols("IF-MIB", "InterfaceIndexOrZero")
InetAddress, InetAddressType, InetAddressPrefixLength = mibBuilder.importSymbols("INET-ADDRESS-MIB", "InetAddress", "InetAddressType", "InetAddressPrefixLength")
VlanIndex, = mibBuilder.importSymbols("Q-BRIDGE-MIB", "VlanIndex")
SnmpAdminString, = mibBuilder.importSymbols("SNMP-FRAMEWORK-MIB", "SnmpAdminString")
ObjectGroup, ModuleCompliance, NotificationGroup = mibBuilder.importSymbols("SNMPv2-CONF", "ObjectGroup", "ModuleCompliance", "NotificationGroup")
Bits, IpAddress, Unsigned32, ModuleIdentity, Counter32, MibScalar, MibTable, MibTableRow, MibTableColumn, Integer32, TimeTicks, Gauge32, ObjectIdentity, NotificationType, Counter64, iso, MibIdentifier = mibBuilder.importSymbols("SNMPv2-SMI", "Bits", "IpAddress", "Unsigned32", "ModuleIdentity", "Counter32", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "Integer32", "TimeTicks", "Gauge32", "ObjectIdentity", "NotificationType", "Counter64", "iso", "MibIdentifier")
TextualConvention, RowStatus, DisplayString, MacAddress, TruthValue, StorageType = mibBuilder.importSymbols("SNMPv2-TC", "TextualConvention", "RowStatus", "DisplayString", "MacAddress", "TruthValue", "StorageType")
ciscoOtvMIB = ModuleIdentity((1, 3, 6, 1, 4, 1, 9, 9, 810))
ciscoOtvMIB.setRevisions(('2013-08-05 00:00',))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
if mibBuilder.loadTexts: ciscoOtvMIB.setRevisionsDescriptions(('Initial version of this MIB module.',))
if mibBuilder.loadTexts: ciscoOtvMIB.setLastUpdated('201308050000Z')
if mibBuilder.loadTexts: ciscoOtvMIB.setOrganization('Cisco Systems, Inc.')
if mibBuilder.loadTexts: ciscoOtvMIB.setContactInfo('Cisco Systems Customer Service Postal: 170 W Tasman Drive San Jose, CA 95134 USA Tel: +1 800 553-NETS E-mail: cs-snmp@cisco.com')
if mibBuilder.loadTexts: ciscoOtvMIB.setDescription("This MIB module is for configuration & statistic query of Overlay Transport Virtualization (OTV) functionality on Cisco routers and switches. Overlay Transport Virtualization is a Cisco's innovative LAN extension technology. It is an IP-based functionality that provides Layer 2 extension capabilities over any transport infrastructure: Layer 2 based, Layer 3 based, IP switched, label switched, and so on. OTV provides an overlay that enables Layer 2 connectivity between separate Layer 2 domains while keeping these domains independent and preserving the fault- isolation, resiliency, and load-balancing benefits of an IP- based interconnection. OTV introduces the concept of MAC routing, which means a control plane protocol is used to exchange MAC reachability information between network devices providing LAN extension functionality. This is a significant shift from Layer 2 switching that traditionally leverages data plane learning, and it is justified by the need to limit flooding of Layer 2 traffic across the transport infrastructure. OTV also introduces the concept of dynamic encapsulation for Layer 2 flows that need to be sent to remote locations. Each Ethernet frame is individually encapsulated into an IP packet and delivered across the transport network. Finally, OTV provides a native built-in multi-homing capability with automatic detection, critical to increasing high availability of the overall solution. Two or more devices can be leveraged in each data center to provide LAN extension functionality without running the risk of creating an end-to-end loop that would jeopardize the overall stability of the design. The followings detail the OTV specific terminology: Edge Device The edge device performs OTV functions: it receives the Layer 2 traffic for all VLANs that need to be extended to remote locations and dynamically encapsulates the Ethernet frames into IP packets that are then sent across the transport infrastructure. Internal Interfaces To perform OTV functionality, the edge device must receive the Layer 2 traffic for all VLANs that need to be extended to remote locations. The Layer 2 interfaces, where the Layer 2 traffic is usually received, are named internal interfaces. Join Interface The Join interface is used to source the OTV encapsulated traffic and send it to the Layer 3 domain of the data center network. Overlay Interface The Overlay interface is a logical multi-access and multicast- capable interface that must be explicitly defined by the user and where the entire OTV configuration is applied. The following terms are used throughout this MIB: AED Authoritative Edge Device ARP Address Resolution Protocol DNS Domain Name System ISIS Intermediate System to Intermediate System Routing Protocol LSPDB Link State PDU Database OTV Overlay Transport Virtualization VLAN Virtual Local Area Network VPN Virtual Private Network")
ciscoOtvMIBNotifs = MibIdentifier((1, 3, 6, 1, 4, 1, 9, 9, 810, 0))
ciscoOtvMIBObjects = MibIdentifier((1, 3, 6, 1, 4, 1, 9, 9, 810, 1))
ciscoOtvMIBConform = MibIdentifier((1, 3, 6, 1, 4, 1, 9, 9, 810, 2))
cotvGlobalObjects = MibIdentifier((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 1))
cotvOverlayObjects = MibIdentifier((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 2))
cotvAdjacencyObjects = MibIdentifier((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 3))
cotvArpNdObjects = MibIdentifier((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 4))
cotvRouteObjects = MibIdentifier((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 5))
cotvSiteObjects = MibIdentifier((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 1, 1))
cotvGlobalStatsObjects = MibIdentifier((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 1, 2))
cotvSiteIdAdmin = MibScalar((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 1, 1, 1), OctetString().subtype(subtypeSpec=ConstraintsUnion(ValueSizeConstraint(4, 4), ValueSizeConstraint(6, 6), ))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: cotvSiteIdAdmin.setStatus('current')
if mibBuilder.loadTexts: cotvSiteIdAdmin.setDescription('This object specifies OTV site identifier for this device. The OTV site identifier could be either a four octets value or a six octets valid MAC address. If the OTV site identifier is not configured, this object will have four zero octets.')
cotvSiteIdOper = MibScalar((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 1, 1, 2), OctetString().subtype(subtypeSpec=ValueSizeConstraint(6, 6)).setFixedLength(6)).setMaxAccess("readonly")
if mibBuilder.loadTexts: cotvSiteIdOper.setStatus('current')
if mibBuilder.loadTexts: cotvSiteIdOper.setDescription('This object indicates OTV site identifier in use for this device. There is no operational OTV site identifier if the value of this object contains all zeros.')
cotvSiteVlan = MibScalar((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 1, 1, 3), VlanIndex()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: cotvSiteVlan.setStatus('current')
if mibBuilder.loadTexts: cotvSiteVlan.setDescription('This object specifies the OTV site VLAN for this device.')
cotvSiteVlanState = MibScalar((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 1, 1, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("up", 1), ("down", 2)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: cotvSiteVlanState.setStatus('current')
if mibBuilder.loadTexts: cotvSiteVlanState.setDescription("This object indicates the state of OTV site VLAN. 'up' - OTV site VLAN is up 'down' - OTV site VLAN is down")
cotvOverlayTable = MibTable((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 2, 1), )
if mibBuilder.loadTexts: cotvOverlayTable.setStatus('current')
if mibBuilder.loadTexts: cotvOverlayTable.setDescription('A list of Overlay interfaces configured on this device.')
cotvOverlayEntry = MibTableRow((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 2, 1, 1), ).setIndexNames((0, "CISCO-OTV-MIB", "cotvOverlayNumber"))
if mibBuilder.loadTexts: cotvOverlayEntry.setStatus('current')
if mibBuilder.loadTexts: cotvOverlayEntry.setDescription('An entry containing management information for a particular Overlay interface.')
cotvOverlayNumber = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 2, 1, 1, 1), Unsigned32())
if mibBuilder.loadTexts: cotvOverlayNumber.setStatus('current')
if mibBuilder.loadTexts: cotvOverlayNumber.setDescription('A unique number to identify an Overlay interface.')
cotvOverlayVpnName = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 2, 1, 1, 2), SnmpAdminString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cotvOverlayVpnName.setStatus('current')
if mibBuilder.loadTexts: cotvOverlayVpnName.setDescription('This object indicates the name of the Virtual Private Network associated with this Overlay interface.')
cotvOverlayVpnState = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 2, 1, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2))).clone(namedValues=NamedValues(("other", 0), ("down", 1), ("up", 2)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: cotvOverlayVpnState.setStatus('current')
if mibBuilder.loadTexts: cotvOverlayVpnState.setDescription("This object indicates the state of Virtual Private Network which is associated with this Overlay interface. 'other' - Any other state not covered by below enumerations. 'up' - The Overlay Virtual Private Network is up 'down' - The Overlay Virtual Private Network is down")
cotvOverlayVpnDownReason = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 2, 1, 1, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19))).clone(namedValues=NamedValues(("other", 0), ("configChange", 1), ("missingControlGroup", 2), ("missingDataGroupRange", 3), ("missingJoinOrSourceInterface", 4), ("missingVpnName", 5), ("missingJoinInterfaceAddr", 6), ("joinInterfaceDown", 7), ("adminDown", 8), ("deleteHoldDown", 9), ("reinit", 10), ("missingSiteId", 11), ("siteIdMismatch", 12), ("missingSourceInterfaceAddr", 13), ("sourceInterfaceDown", 14), ("changingSiteId", 15), ("changingControlGroup", 16), ("missingDeviceId", 17), ("changingDeviceId", 18), ("cleanupInProgress", 19)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: cotvOverlayVpnDownReason.setStatus('current')
if mibBuilder.loadTexts: cotvOverlayVpnDownReason.setDescription("This object indicates the reason why this Overlay Virtual Private Network is down. 'other' - Any other reason not covered by below enumerations 'configChange' - Configuration changed 'missingControlGroup' - Control Group information is unavailable 'missingDataGroupRange' - Data Group range information is unavailable 'misssingJoinOrSourceInterface' - Join or Source interface information is unavailable 'missingVpnName' - VPN name is unavailable 'missingJoinInterfaceAddr' - IP address is missing for Join Interface 'joinInterfaceDown' - Join Interface is down 'adminDown' - Overlay is administratively shutdown 'deleteHoldDown' - Overlay is in delete hold down phase 'reinit' - VPN is reinitializing 'missingSiteId' - Site ID information is unavailable 'siteIdMismatch' - Site ID mismatch has occurred 'missingSourceInterfaceAddr' - IP address is missing for Source Interface 'sourceInterfaceDown' - Source interface is down 'changingSiteId' - Changing site identifier 'changingControlGroup' - Changing control group 'missingDeviceId' - Device ID information is unavailable 'changingDeviceId' - Changing device ID 'cleanupInProgress' - Cleanup in progress")
cotvOverlayVlansExtendedFirst2k = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 2, 1, 1, 5), Cisco2KVlanList()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: cotvOverlayVlansExtendedFirst2k.setStatus('current')
if mibBuilder.loadTexts: cotvOverlayVlansExtendedFirst2k.setDescription('This object specifies the list of VLANs extended on this Overlay interface. It is a string of octets containing one bit per VLAN with VlanIndex values of 0 through 2047. If the bit corresponding to a VLAN is set to 1, it indicates that VLAN is being extended on this Overlay interface. If the bit corresponding to a VLAN is set to 0, it indicates that VLAN is not being extended on this Overlay interface.')
cotvOverlayVlansExtendedSecond2k = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 2, 1, 1, 6), Cisco2KVlanList()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: cotvOverlayVlansExtendedSecond2k.setStatus('current')
if mibBuilder.loadTexts: cotvOverlayVlansExtendedSecond2k.setDescription('This object specifies the list of VLANs extended on this Overlay interface. It is a string of octets containing one bit per VLAN with VlanIndex values of 2048 through 4095. If the bit corresponding to a VLAN is set to 1, it indicates that VLAN is being extended on this Overlay interface. If the bit corresponding to a VLAN is set to 0, it indicates that VLAN is not being extended on this Overlay interface.')
cotvOverlayControlGroupAddrType = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 2, 1, 1, 7), InetAddressType().clone('unknown')).setMaxAccess("readcreate")
if mibBuilder.loadTexts: cotvOverlayControlGroupAddrType.setStatus('current')
if mibBuilder.loadTexts: cotvOverlayControlGroupAddrType.setDescription('This object specifies the type of Internet address of Control Group.')
cotvOverlayControlGroupAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 2, 1, 1, 8), InetAddress()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: cotvOverlayControlGroupAddr.setStatus('current')
if mibBuilder.loadTexts: cotvOverlayControlGroupAddr.setDescription('This object specifies the Internet address of Control Group. The type of this address is determined by cotvOverlayControlGroupAddrType.')
cotvOverlayBroadcastGroupAddrType = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 2, 1, 1, 9), InetAddressType().clone('unknown')).setMaxAccess("readcreate")
if mibBuilder.loadTexts: cotvOverlayBroadcastGroupAddrType.setStatus('current')
if mibBuilder.loadTexts: cotvOverlayBroadcastGroupAddrType.setDescription('This object specifies the type of Internet address to be used as Broadcast Group Address.')
cotvOverlayBroadcastGroupAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 2, 1, 1, 10), InetAddress()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: cotvOverlayBroadcastGroupAddr.setStatus('current')
if mibBuilder.loadTexts: cotvOverlayBroadcastGroupAddr.setDescription('This object specifies the Internet address to be used as Broadcast Group Address. The type of this address is determined by cotvOverlayBroadcastGroupAddrType.')
cotvOverlayJoinInterface = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 2, 1, 1, 11), InterfaceIndexOrZero()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: cotvOverlayJoinInterface.setStatus('current')
if mibBuilder.loadTexts: cotvOverlayJoinInterface.setDescription('This object specifies the OTV Join Interface for this Overlay interface.')
cotvOverlaySourceInterface = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 2, 1, 1, 12), InterfaceIndexOrZero()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: cotvOverlaySourceInterface.setStatus('current')
if mibBuilder.loadTexts: cotvOverlaySourceInterface.setDescription('This object specifies the Source Interface for this Overlay interface.')
cotvOverlayAedCapable = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 2, 1, 1, 13), TruthValue()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cotvOverlayAedCapable.setStatus('current')
if mibBuilder.loadTexts: cotvOverlayAedCapable.setDescription("This object indicates AED (Authoritative Edge Device) capability on this Overlay interface. A value of 'true' indicates that the edge device has capability to act as an AED on this Overlay interface. A value of 'false' indicates that the edge device does not have the capability to act as an AED on this Overlay interface.")
cotvOverlayAedIncapableReason = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 2, 1, 1, 14), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10))).clone(namedValues=NamedValues(("other", 0), ("overlayDown", 1), ("siteIdNotConfigured", 2), ("siteIdMismatch", 3), ("versionMismatch", 4), ("siteVlanDown", 5), ("noExtendedVlanUp", 6), ("noOverlayAdjacencyUp", 7), ("lspdbSyncIncomplete", 8), ("overlayDownInProgress", 9), ("isisControlGroupSyncPending", 10)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: cotvOverlayAedIncapableReason.setStatus('current')
if mibBuilder.loadTexts: cotvOverlayAedIncapableReason.setDescription("This object indicates the reason why the overlay is AED-incapable. 'other' - Any other reason not covered by below enumerations 'overlayDown' - Overlay is Down 'siteIdNotConfigured' - Site ID is not configured 'siteIdMismatch' - Site ID mismatch 'versionMismatch' - Version mismatch 'siteVlanDown' - Site VLAN is Down 'noExtendedVlanUp' - No extended VLAN is operationally up 'noOverlayAdjacencyUp' - No Overlay Adjacency is up 'lspdbSyncIncomplete' - LSPDB sync incomplete 'overlayDownInProgress' - Overlay state down event in progress 'isisControlGroupSyncPending' - ISIS control group sync pending")
cotvOverlayAdjServerTransportType = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 2, 1, 1, 15), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("multicastAndUnicast", 1), ("unicastOnly", 2))).clone('multicastAndUnicast')).setMaxAccess("readcreate")
if mibBuilder.loadTexts: cotvOverlayAdjServerTransportType.setStatus('current')
if mibBuilder.loadTexts: cotvOverlayAdjServerTransportType.setDescription("The type of transport OTV control plane can use to exchange Adjacency Server information. 'multicastAndUnicast' - OTV control plane can use both multicast and unicast to exchange Adjacency Server information 'unicastOnly' - OTV control plane can use only unicast to exchange Adjacency Server information. Value of this object can be set to 'unicastOnly' only if the value of cotvOverlayPrimaryAdjServerAddrType is 'unknown'.")
cotvOverlayAdjServerEnable = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 2, 1, 1, 16), TruthValue().clone('false')).setMaxAccess("readcreate")
if mibBuilder.loadTexts: cotvOverlayAdjServerEnable.setStatus('current')
if mibBuilder.loadTexts: cotvOverlayAdjServerEnable.setDescription("This object specifies Adjacency Server functionality for this Overlay interface. Setting the object to 'true' enables Adjacency Server functionality. Setting the object to 'false' disables Adjacency Server functionality.")
cotvOverlayPrimaryAdjServerAddrType = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 2, 1, 1, 17), InetAddressType().clone('unknown')).setMaxAccess("readcreate")
if mibBuilder.loadTexts: cotvOverlayPrimaryAdjServerAddrType.setStatus('current')
if mibBuilder.loadTexts: cotvOverlayPrimaryAdjServerAddrType.setDescription('This object specifies the type of Internet address of the Primary Adjacency Server for this Overlay interface.')
cotvOverlayPrimaryAdjServerAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 2, 1, 1, 18), InetAddress()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: cotvOverlayPrimaryAdjServerAddr.setStatus('current')
if mibBuilder.loadTexts: cotvOverlayPrimaryAdjServerAddr.setDescription('This object specifies the Internet address of the Primary Adjacency Server for this Overlay interface. The type of this address is determined by the value of cotvOverlayPrimaryAdjServerAddrType.')
cotvOverlaySecondaryAdjServerAddrType = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 2, 1, 1, 19), InetAddressType().clone('unknown')).setMaxAccess("readcreate")
if mibBuilder.loadTexts: cotvOverlaySecondaryAdjServerAddrType.setStatus('current')
if mibBuilder.loadTexts: cotvOverlaySecondaryAdjServerAddrType.setDescription('This object specifies the type of Internet address of the Secondary Adjacency Server for this Overlay interface.')
cotvOverlaySecondaryAdjServerAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 2, 1, 1, 20), InetAddress()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: cotvOverlaySecondaryAdjServerAddr.setStatus('current')
if mibBuilder.loadTexts: cotvOverlaySecondaryAdjServerAddr.setDescription('This object specifies the Internet address of the Secondary Adjacency Server for this Overlay interface. The type of this address is determined by cotvOverlaySecondaryAdjServerAddrType.')
cotvOverlaySuppressArpND = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 2, 1, 1, 21), TruthValue().clone('false')).setMaxAccess("readcreate")
if mibBuilder.loadTexts: cotvOverlaySuppressArpND.setStatus('current')
if mibBuilder.loadTexts: cotvOverlaySuppressArpND.setDescription("This object specifies ARP Neighbor Discovery behavior on this Overlay interface. Setting the object to 'true' enables suppression of ARP Neighbor Discovery on this Overlay interface. Setting the object to 'false' disables suppression of ARP Neighbor Discovery on this Overlay interface.")
cotvOverlayStorageType = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 2, 1, 1, 22), StorageType().clone('volatile')).setMaxAccess("readcreate")
if mibBuilder.loadTexts: cotvOverlayStorageType.setStatus('current')
if mibBuilder.loadTexts: cotvOverlayStorageType.setDescription('This object specifies the storage type for this conceptual row.')
cotvOverlayRowStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 2, 1, 1, 23), RowStatus()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: cotvOverlayRowStatus.setStatus('current')
if mibBuilder.loadTexts: cotvOverlayRowStatus.setDescription('This object specifies the status of this conceptual row.')
cotvVlansTable = MibTable((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 2, 2), )
if mibBuilder.loadTexts: cotvVlansTable.setStatus('current')
if mibBuilder.loadTexts: cotvVlansTable.setDescription('A list of VLANs extended on Overlay interfaces.')
cotvVlansEntry = MibTableRow((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 2, 2, 1), ).setIndexNames((0, "CISCO-OTV-MIB", "cotvOverlayNumber"), (0, "CISCO-OTV-MIB", "cotvVlanId"))
if mibBuilder.loadTexts: cotvVlansEntry.setStatus('current')
if mibBuilder.loadTexts: cotvVlansEntry.setDescription('An entry containing management information for a particular VLAN extended on an Overlay interface.')
cotvVlanId = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 2, 2, 1, 1), VlanIndex())
if mibBuilder.loadTexts: cotvVlanId.setStatus('current')
if mibBuilder.loadTexts: cotvVlanId.setDescription('This object indicates the VLAN ID of the extended VLAN.')
cotvVlanState = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 2, 2, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("active", 1), ("inactive", 2)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: cotvVlanState.setStatus('current')
if mibBuilder.loadTexts: cotvVlanState.setDescription("This object indicates the state of the extended VLAN. 'active' - OTV is ready to forward traffic for this VLAN 'inactive' - OTV can not forward traffic for this VLAN")
cotvVlanInactiveReason = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 2, 2, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6))).clone(namedValues=NamedValues(("other", 1), ("nonAed", 2), ("vlanDisabled", 3), ("overlayDown", 4), ("deleteHoldDown", 5), ("hwDown", 6)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: cotvVlanInactiveReason.setStatus('current')
if mibBuilder.loadTexts: cotvVlanInactiveReason.setDescription("This object indicates the reason the VLAN is in 'inactive' state. 'other' - Any other reason not covered by the below enumerations 'nonAed' - Device is not an AED on this VLAN 'vlanDisabled' - Vlan is in disabled state 'overlayDown' - Overlay is currently down 'deleteHoldDown' - The VLAN is in delete hold-down state 'hwDown' - An issue with hardware is preventing VLAN from becoming 'active' Value of this object should be ignored if the value of cotvVlanInactiveReason is not 'inactive'.")
cotvVlanAedAddrType = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 2, 2, 1, 4), InetAddressType()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cotvVlanAedAddrType.setStatus('current')
if mibBuilder.loadTexts: cotvVlanAedAddrType.setDescription('This object indicates the type of Internet address of Authoritative Edge Device (AED) on this VLAN.')
cotvVlanAedAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 2, 2, 1, 5), InetAddress()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cotvVlanAedAddr.setStatus('current')
if mibBuilder.loadTexts: cotvVlanAedAddr.setDescription('This object indicates the Internet address of Authoritative Edge Device (AED) on this VLAN. The type of this address is determined by the value of cotvVlanAedAddrType.')
cotvVlanEdgeDevIsAed = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 2, 2, 1, 6), TruthValue()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cotvVlanEdgeDevIsAed.setStatus('current')
if mibBuilder.loadTexts: cotvVlanEdgeDevIsAed.setDescription("This object indicates if this device is acting as an AED for the VLAN. A value of 'true' indicates that this device is acting as an AED for the VLAN. A value of 'false' indicates that this device is not acting as an AED for the VLAN.")
cotvDataGroupConfigTable = MibTable((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 2, 3), )
if mibBuilder.loadTexts: cotvDataGroupConfigTable.setStatus('current')
if mibBuilder.loadTexts: cotvDataGroupConfigTable.setDescription('A list of multicast data-group ranges configured for each Overlay interface.')
cotvDataGroupConfigEntry = MibTableRow((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 2, 3, 1), ).setIndexNames((0, "CISCO-OTV-MIB", "cotvOverlayNumber"), (0, "CISCO-OTV-MIB", "cotvDataGroupMcastRangeAddrType"), (0, "CISCO-OTV-MIB", "cotvDataGroupMcastRangeAddr"), (0, "CISCO-OTV-MIB", "cotvDataGroupMcastRangePrefixLength"))
if mibBuilder.loadTexts: cotvDataGroupConfigEntry.setStatus('current')
if mibBuilder.loadTexts: cotvDataGroupConfigEntry.setDescription('An entry containing management information for a particular multicast data-group range configured for an Overlay interface.')
cotvDataGroupMcastRangeAddrType = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 2, 3, 1, 1), InetAddressType())
if mibBuilder.loadTexts: cotvDataGroupMcastRangeAddrType.setStatus('current')
if mibBuilder.loadTexts: cotvDataGroupMcastRangeAddrType.setDescription('The type of Internet address of multicast data-group range.')
cotvDataGroupMcastRangeAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 2, 3, 1, 2), InetAddress().subtype(subtypeSpec=ConstraintsUnion(ValueSizeConstraint(4, 4), ValueSizeConstraint(16, 16), )))
if mibBuilder.loadTexts: cotvDataGroupMcastRangeAddr.setStatus('current')
if mibBuilder.loadTexts: cotvDataGroupMcastRangeAddr.setDescription('The Internet address of multicast data-group range. The type of this address is determined by the value of the cotvDataGroupMcastRangeAddrType object.')
cotvDataGroupMcastRangePrefixLength = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 2, 3, 1, 3), InetAddressPrefixLength())
if mibBuilder.loadTexts: cotvDataGroupMcastRangePrefixLength.setStatus('current')
if mibBuilder.loadTexts: cotvDataGroupMcastRangePrefixLength.setDescription('The length of the prefix associated with cotvDataGroupMcastRangeAddr. The type of this address prefix is determined by the value of the cotvDataGroupMcastRangeAddrType object.')
cotvDataGroupStorageType = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 2, 3, 1, 4), StorageType().clone('volatile')).setMaxAccess("readcreate")
if mibBuilder.loadTexts: cotvDataGroupStorageType.setStatus('current')
if mibBuilder.loadTexts: cotvDataGroupStorageType.setDescription('This object specifies the storage type for this conceptual row.')
cotvDataGroupRowStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 2, 3, 1, 5), RowStatus()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: cotvDataGroupRowStatus.setStatus('current')
if mibBuilder.loadTexts: cotvDataGroupRowStatus.setDescription('This object specifies the status of this conceptual row.')
cotvDataGroupInfoTable = MibTable((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 2, 4), )
if mibBuilder.loadTexts: cotvDataGroupInfoTable.setStatus('current')
if mibBuilder.loadTexts: cotvDataGroupInfoTable.setDescription('A table listing management information for active multicast sources and multicast groups on each Overlay interface.')
cotvDataGroupInfoEntry = MibTableRow((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 2, 4, 1), ).setIndexNames((0, "CISCO-OTV-MIB", "cotvOverlayNumber"), (0, "CISCO-OTV-MIB", "cotvDataGroupActiveSrcLocation"), (0, "CISCO-OTV-MIB", "cotvDataGroupVlanId"), (0, "CISCO-OTV-MIB", "cotvDataGroupActiveGroupAddrType"), (0, "CISCO-OTV-MIB", "cotvDataGroupActiveGroupAddr"), (0, "CISCO-OTV-MIB", "cotvDataGroupActiveSrcAddrType"), (0, "CISCO-OTV-MIB", "cotvDataGroupActiveSrcAddr"), (0, "CISCO-OTV-MIB", "cotvDataGroupDeliveryGroupAddrType"), (0, "CISCO-OTV-MIB", "cotvDataGroupDeliveryGroupAddr"), (0, "CISCO-OTV-MIB", "cotvDataGroupDeliverySrcAddrType"), (0, "CISCO-OTV-MIB", "cotvDataGroupDeliverySrcAddr"))
if mibBuilder.loadTexts: cotvDataGroupInfoEntry.setStatus('current')
if mibBuilder.loadTexts: cotvDataGroupInfoEntry.setDescription('An entry containing management information for an active multicast data-group.')
cotvDataGroupActiveSrcLocation = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 2, 4, 1, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("local", 1), ("remote", 2))))
if mibBuilder.loadTexts: cotvDataGroupActiveSrcLocation.setStatus('current')
if mibBuilder.loadTexts: cotvDataGroupActiveSrcLocation.setDescription('The location of Active Multicast source.')
cotvDataGroupVlanId = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 2, 4, 1, 2), VlanIndex())
if mibBuilder.loadTexts: cotvDataGroupVlanId.setStatus('current')
if mibBuilder.loadTexts: cotvDataGroupVlanId.setDescription('The VLAN associated with Active Multicast data-group.')
cotvDataGroupActiveGroupAddrType = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 2, 4, 1, 3), InetAddressType())
if mibBuilder.loadTexts: cotvDataGroupActiveGroupAddrType.setStatus('current')
if mibBuilder.loadTexts: cotvDataGroupActiveGroupAddrType.setDescription('The type of Internet address of the active multicast group (multicast group of the active multicast source).')
cotvDataGroupActiveGroupAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 2, 4, 1, 4), InetAddress().subtype(subtypeSpec=ConstraintsUnion(ValueSizeConstraint(4, 4), ValueSizeConstraint(16, 16), )))
if mibBuilder.loadTexts: cotvDataGroupActiveGroupAddr.setStatus('current')
if mibBuilder.loadTexts: cotvDataGroupActiveGroupAddr.setDescription('The Internet address of the active multicast group of the (multicast group of the active multicast source). The type of this address is determined by the value of cotvDataGroupActiveGroupAddrType.')
cotvDataGroupActiveSrcAddrType = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 2, 4, 1, 5), InetAddressType())
if mibBuilder.loadTexts: cotvDataGroupActiveSrcAddrType.setStatus('current')
if mibBuilder.loadTexts: cotvDataGroupActiveSrcAddrType.setDescription('The type of Internet address of active multicast source.')
cotvDataGroupActiveSrcAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 2, 4, 1, 6), InetAddress().subtype(subtypeSpec=ConstraintsUnion(ValueSizeConstraint(4, 4), ValueSizeConstraint(16, 16), )))
if mibBuilder.loadTexts: cotvDataGroupActiveSrcAddr.setStatus('current')
if mibBuilder.loadTexts: cotvDataGroupActiveSrcAddr.setDescription('The Internet address of active multicast source. The type of this address is determined by the value of cotvDataGroupActiveSrcAddrType.')
cotvDataGroupDeliveryGroupAddrType = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 2, 4, 1, 7), InetAddressType())
if mibBuilder.loadTexts: cotvDataGroupDeliveryGroupAddrType.setStatus('current')
if mibBuilder.loadTexts: cotvDataGroupDeliveryGroupAddrType.setDescription('The type of Internet address of the delivery group that is mapped to active multicast group.')
cotvDataGroupDeliveryGroupAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 2, 4, 1, 8), InetAddress().subtype(subtypeSpec=ConstraintsUnion(ValueSizeConstraint(4, 4), ValueSizeConstraint(16, 16), )))
if mibBuilder.loadTexts: cotvDataGroupDeliveryGroupAddr.setStatus('current')
if mibBuilder.loadTexts: cotvDataGroupDeliveryGroupAddr.setDescription('The Internet address of delivery group that is mapped to active multicast group. The type of this address is determined by cotvDataGroupDeliveryGroupAddrType.')
cotvDataGroupDeliverySrcAddrType = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 2, 4, 1, 9), InetAddressType())
if mibBuilder.loadTexts: cotvDataGroupDeliverySrcAddrType.setStatus('current')
if mibBuilder.loadTexts: cotvDataGroupDeliverySrcAddrType.setDescription('The type of Internet address of the delivery source that is mapped to the active multicast source.')
cotvDataGroupDeliverySrcAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 2, 4, 1, 10), InetAddress().subtype(subtypeSpec=ConstraintsUnion(ValueSizeConstraint(4, 4), ValueSizeConstraint(16, 16), )))
if mibBuilder.loadTexts: cotvDataGroupDeliverySrcAddr.setStatus('current')
if mibBuilder.loadTexts: cotvDataGroupDeliverySrcAddr.setDescription('The Internet address of the delivery source that is mapped to the active multicast source. The type of this address is determined by the value of cotvDataGroupDeliverySrcAddrType.')
cotvDataGroupJoinInterface = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 2, 4, 1, 11), InterfaceIndexOrZero()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cotvDataGroupJoinInterface.setStatus('current')
if mibBuilder.loadTexts: cotvDataGroupJoinInterface.setDescription('This object indicates the OTV Join interface on which active multicast source is located.')
cotvDataGroupLocalActiveSrcState = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 2, 4, 1, 12), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4))).clone(namedValues=NamedValues(("none", 1), ("local", 2), ("remote", 3), ("orphan", 4)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: cotvDataGroupLocalActiveSrcState.setStatus('current')
if mibBuilder.loadTexts: cotvDataGroupLocalActiveSrcState.setDescription("This object indicates the state of the local Active Multicast source. 'none' - State of the multicast source is not applicable 'local' - multicast source state is local 'remote' - multicast source state is remote 'orphan' - multicast source state is orphan Value of this object should be 'none' if cotvDataGroupActiveSrcLocation is 'remote'.")
cotvAdjacencyDatabaseTable = MibTable((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 3, 1), )
if mibBuilder.loadTexts: cotvAdjacencyDatabaseTable.setStatus('current')
if mibBuilder.loadTexts: cotvAdjacencyDatabaseTable.setDescription('A table containing OTV adjacency database information.')
cotvAdjacencyDatabaseEntry = MibTableRow((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 3, 1, 1), ).setIndexNames((0, "CISCO-OTV-MIB", "cotvOverlayNumber"), (0, "CISCO-OTV-MIB", "cotvAdjacentDevAddrType"), (0, "CISCO-OTV-MIB", "cotvAdjacentDevAddr"))
if mibBuilder.loadTexts: cotvAdjacencyDatabaseEntry.setStatus('current')
if mibBuilder.loadTexts: cotvAdjacencyDatabaseEntry.setDescription('An entry containing management information about a particular OTV adjacency.')
cotvAdjacentDevAddrType = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 3, 1, 1, 1), InetAddressType())
if mibBuilder.loadTexts: cotvAdjacentDevAddrType.setStatus('current')
if mibBuilder.loadTexts: cotvAdjacentDevAddrType.setDescription('The type of Internet address of adjacent edge device.')
cotvAdjacentDevAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 3, 1, 1, 2), InetAddress().subtype(subtypeSpec=ValueSizeConstraint(1, 64)))
if mibBuilder.loadTexts: cotvAdjacentDevAddr.setStatus('current')
if mibBuilder.loadTexts: cotvAdjacentDevAddr.setDescription('The Internet address of adjacent edge device. The type of this address is determined by the value of cotvAdjacentDevAddrType.')
cotvAdjacentDevSystemID = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 3, 1, 1, 3), OctetString().subtype(subtypeSpec=ConstraintsUnion(ValueSizeConstraint(0, 0), ValueSizeConstraint(6, 6), ))).setMaxAccess("readonly")
if mibBuilder.loadTexts: cotvAdjacentDevSystemID.setStatus('current')
if mibBuilder.loadTexts: cotvAdjacentDevSystemID.setDescription('This object indicates the system identifier of the adjacent edge device. The value of this object contains zero length octet, if the system identifier of the adjacent edge devices is not available.')
cotvAdjacentDevName = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 3, 1, 1, 4), SnmpAdminString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cotvAdjacentDevName.setStatus('current')
if mibBuilder.loadTexts: cotvAdjacentDevName.setDescription('This object indicates the DNS name of the adjacent edge device.')
cotvAdjacentDevState = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 3, 1, 1, 5), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2))).clone(namedValues=NamedValues(("other", 0), ("up", 1), ("down", 2)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: cotvAdjacentDevState.setStatus('current')
if mibBuilder.loadTexts: cotvAdjacentDevState.setDescription("This object indicates the state of adjacent edge device. 'other' - Any other state not covered by below enumeration. 'up' - The adjacent device is up 'down' - The adjacent device is down.")
cotvAdjacentDevUpTime = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 3, 1, 1, 6), Unsigned32()).setUnits('seconds').setMaxAccess("readonly")
if mibBuilder.loadTexts: cotvAdjacentDevUpTime.setStatus('current')
if mibBuilder.loadTexts: cotvAdjacentDevUpTime.setDescription('This object indicates the amount of time for which the adjacent device has been up.')
cotvArpNdCacheTable = MibTable((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 4, 1), )
if mibBuilder.loadTexts: cotvArpNdCacheTable.setStatus('current')
if mibBuilder.loadTexts: cotvArpNdCacheTable.setDescription('A table containing ARP Neighbor Discovery cache information.')
cotvArpNdCacheEntry = MibTableRow((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 4, 1, 1), ).setIndexNames((0, "CISCO-OTV-MIB", "cotvOverlayNumber"), (0, "CISCO-OTV-MIB", "cotvVlanId"), (0, "CISCO-OTV-MIB", "cotvArpNdCacheL3AddrType"), (0, "CISCO-OTV-MIB", "cotvArpNdCacheL3Addr"))
if mibBuilder.loadTexts: cotvArpNdCacheEntry.setStatus('current')
if mibBuilder.loadTexts: cotvArpNdCacheEntry.setDescription('An entry containing management information about a particular entry in ARP Neighbor Discovery cache.')
cotvArpNdCacheL3AddrType = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 4, 1, 1, 1), InetAddressType())
if mibBuilder.loadTexts: cotvArpNdCacheL3AddrType.setStatus('current')
if mibBuilder.loadTexts: cotvArpNdCacheL3AddrType.setDescription('The type of Internet address (IPv4/IPv6 address) of host discovered using ARP Neighbor discovery.')
cotvArpNdCacheL3Addr = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 4, 1, 1, 2), InetAddress().subtype(subtypeSpec=ValueSizeConstraint(0, 64)))
if mibBuilder.loadTexts: cotvArpNdCacheL3Addr.setStatus('current')
if mibBuilder.loadTexts: cotvArpNdCacheL3Addr.setDescription('The Internet address (IPv4/IPv6 address) of the host discovered using ARP Neighbor discovery. The type of this address is determined by the value of cotvArpNdCacheL3AddrType.')
cotvArpNdCacheMacAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 4, 1, 1, 3), MacAddress()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cotvArpNdCacheMacAddr.setStatus('current')
if mibBuilder.loadTexts: cotvArpNdCacheMacAddr.setDescription('This object indicates the MAC address discovered using ARP Neighbor discovery and cached in this table.')
cotvArpNdCacheAge = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 4, 1, 1, 4), Unsigned32()).setUnits('seconds').setMaxAccess("readonly")
if mibBuilder.loadTexts: cotvArpNdCacheAge.setStatus('current')
if mibBuilder.loadTexts: cotvArpNdCacheAge.setDescription('This object indicates the amount of time for which this entry has existed on the system.')
cotvArpNdCacheTimeToExpire = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 4, 1, 1, 5), Unsigned32()).setUnits('seconds').setMaxAccess("readonly")
if mibBuilder.loadTexts: cotvArpNdCacheTimeToExpire.setStatus('current')
if mibBuilder.loadTexts: cotvArpNdCacheTimeToExpire.setDescription('This object indicates the amount of time left for this cache entry to be expired.')
cotvRouteTable = MibTable((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 5, 1), )
if mibBuilder.loadTexts: cotvRouteTable.setStatus('current')
if mibBuilder.loadTexts: cotvRouteTable.setDescription('A table listing route (unicast) information in OTV Routing Information Base (ORIB).')
cotvRouteEntry = MibTableRow((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 5, 1, 1), ).setIndexNames((0, "CISCO-OTV-MIB", "cotvRouteVlanId"), (0, "CISCO-OTV-MIB", "cotvRouteMacAddr"))
if mibBuilder.loadTexts: cotvRouteEntry.setStatus('current')
if mibBuilder.loadTexts: cotvRouteEntry.setDescription('An entry containing management information about a particular route (unicast) in ORIB.')
cotvRouteVlanId = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 5, 1, 1, 1), VlanIndex())
if mibBuilder.loadTexts: cotvRouteVlanId.setStatus('current')
if mibBuilder.loadTexts: cotvRouteVlanId.setDescription('The object indicates VLAN associated with this route.')
cotvRouteMacAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 5, 1, 1, 2), MacAddress())
if mibBuilder.loadTexts: cotvRouteMacAddr.setStatus('current')
if mibBuilder.loadTexts: cotvRouteMacAddr.setDescription('This object indicates the MAC address to be routed.')
cotvRouteMetric = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 5, 1, 1, 3), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cotvRouteMetric.setStatus('current')
if mibBuilder.loadTexts: cotvRouteMetric.setDescription('This object indicates the metric associated with this route.')
cotvRouteUpTime = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 5, 1, 1, 4), Unsigned32()).setUnits('seconds').setMaxAccess("readonly")
if mibBuilder.loadTexts: cotvRouteUpTime.setStatus('current')
if mibBuilder.loadTexts: cotvRouteUpTime.setDescription('This object indicates the amount of time elapsed since the MAC route entry was installed in this table.')
cotvRouteOwner = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 5, 1, 1, 5), SnmpAdminString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cotvRouteOwner.setStatus('current')
if mibBuilder.loadTexts: cotvRouteOwner.setDescription('This object indicates the type of owner (source) from where the MAC address was learnt.')
cotvRouteNextHopIf = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 5, 1, 1, 6), InterfaceIndexOrZero()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cotvRouteNextHopIf.setStatus('current')
if mibBuilder.loadTexts: cotvRouteNextHopIf.setDescription("This object indicates the interface on the device through which the MAC address will be routed. Value of this object should be ignored if cotvRouteOwner is other than 'site' or 'static'.")
cotvRouteNextHopAddrType = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 5, 1, 1, 7), InetAddressType()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cotvRouteNextHopAddrType.setStatus('current')
if mibBuilder.loadTexts: cotvRouteNextHopAddrType.setDescription("This object indicates the type of Internet address of the edge device through which the MAC address will be routed. Value of this object should be ignored if cotvRouteOwner is other than 'overlay'.")
cotvRouteNextHopAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 5, 1, 1, 8), InetAddress()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cotvRouteNextHopAddr.setStatus('current')
if mibBuilder.loadTexts: cotvRouteNextHopAddr.setDescription("This object indicates the Internet address of the edge device through which the MAC address will be routed. The type of this address is determined by the value of cotvRouteNextHopAddrType. Value of this object should be ignored if cotvRouteOwner is other than 'overlay'.")
cotvMcastRouteTable = MibTable((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 5, 2), )
if mibBuilder.loadTexts: cotvMcastRouteTable.setStatus('current')
if mibBuilder.loadTexts: cotvMcastRouteTable.setDescription('A table listing multicast route information in OTV Routing Information Base (ORIB).')
cotvMcastRouteEntry = MibTableRow((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 5, 2, 1), ).setIndexNames((0, "CISCO-OTV-MIB", "cotvMcastRouteVlanId"), (0, "CISCO-OTV-MIB", "cotvMcastRouteActiveSrcAddrType"), (0, "CISCO-OTV-MIB", "cotvMcastRouteActiveSrcAddr"), (0, "CISCO-OTV-MIB", "cotvMcastRouteActiveGroupAddrType"), (0, "CISCO-OTV-MIB", "cotvMcastRouteActiveGroupAddr"))
if mibBuilder.loadTexts: cotvMcastRouteEntry.setStatus('current')
if mibBuilder.loadTexts: cotvMcastRouteEntry.setDescription('An entry containing information about a particular multicast route in ORIB.')
cotvMcastRouteVlanId = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 5, 2, 1, 1), VlanIndex())
if mibBuilder.loadTexts: cotvMcastRouteVlanId.setStatus('current')
if mibBuilder.loadTexts: cotvMcastRouteVlanId.setDescription('The object indicates VLAN associated with this multicast route.')
cotvMcastRouteActiveSrcAddrType = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 5, 2, 1, 2), InetAddressType())
if mibBuilder.loadTexts: cotvMcastRouteActiveSrcAddrType.setStatus('current')
if mibBuilder.loadTexts: cotvMcastRouteActiveSrcAddrType.setDescription('The type of Internet address of active multicast source.')
cotvMcastRouteActiveSrcAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 5, 2, 1, 3), InetAddress().subtype(subtypeSpec=ConstraintsUnion(ValueSizeConstraint(4, 4), ValueSizeConstraint(16, 16), )))
if mibBuilder.loadTexts: cotvMcastRouteActiveSrcAddr.setStatus('current')
if mibBuilder.loadTexts: cotvMcastRouteActiveSrcAddr.setDescription('The Internet address of active multicast source. The type of this address is determined by the value of cotvMcastRouteActiveSrcAddrType.')
cotvMcastRouteActiveGroupAddrType = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 5, 2, 1, 4), InetAddressType())
if mibBuilder.loadTexts: cotvMcastRouteActiveGroupAddrType.setStatus('current')
if mibBuilder.loadTexts: cotvMcastRouteActiveGroupAddrType.setDescription('The type of Internet address of the active multicast group (multicast group of the active multicast source).')
cotvMcastRouteActiveGroupAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 5, 2, 1, 5), InetAddress().subtype(subtypeSpec=ConstraintsUnion(ValueSizeConstraint(4, 4), ValueSizeConstraint(16, 16), )))
if mibBuilder.loadTexts: cotvMcastRouteActiveGroupAddr.setStatus('current')
if mibBuilder.loadTexts: cotvMcastRouteActiveGroupAddr.setDescription('The Internet address of the active multicast group of the (multicast group of the active multicast source). The type of this address is determined by the value of cotvMcastRouteActiveGroupAddrType.')
cotvMcastRouteOwners = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 5, 2, 1, 6), SnmpAdminString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cotvMcastRouteOwners.setStatus('current')
if mibBuilder.loadTexts: cotvMcastRouteOwners.setDescription('This object indicates the type of owner(s) (sources) from where this route was learnt.')
cotvMcastRouteMetric = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 5, 2, 1, 7), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cotvMcastRouteMetric.setStatus('current')
if mibBuilder.loadTexts: cotvMcastRouteMetric.setDescription('This object indicates the metric associated with this multicast route.')
cotvMcastRouteUpTime = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 5, 2, 1, 8), Unsigned32()).setUnits('seconds').setMaxAccess("readonly")
if mibBuilder.loadTexts: cotvMcastRouteUpTime.setStatus('current')
if mibBuilder.loadTexts: cotvMcastRouteUpTime.setDescription('This object indicates the amount of time elapsed since this multicast route was installed in this table.')
cotvMcastRouteInfoTable = MibTable((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 5, 3), )
if mibBuilder.loadTexts: cotvMcastRouteInfoTable.setStatus('current')
if mibBuilder.loadTexts: cotvMcastRouteInfoTable.setDescription('A table listing next-hop information associated with each multicast route in OTV Routing Information Base (ORIB).')
cotvMcastRouteInfoEntry = MibTableRow((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 5, 3, 1), ).setIndexNames((0, "CISCO-OTV-MIB", "cotvMcastRouteInfoVlanId"), (0, "CISCO-OTV-MIB", "cotvMcastRouteInfoActiveSrcAddrType"), (0, "CISCO-OTV-MIB", "cotvMcastRouteInfoActiveSrcAddr"), (0, "CISCO-OTV-MIB", "cotvMcastRouteInfoActiveGroupAddrType"), (0, "CISCO-OTV-MIB", "cotvMcastRouteInfoActiveGroupAddr"), (0, "CISCO-OTV-MIB", "cotvMcastRouteInfoIf"))
if mibBuilder.loadTexts: cotvMcastRouteInfoEntry.setStatus('current')
if mibBuilder.loadTexts: cotvMcastRouteInfoEntry.setDescription('An entry containing next-hop information about a particular multicast route in ORIB.')
cotvMcastRouteInfoVlanId = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 5, 3, 1, 1), VlanIndex())
if mibBuilder.loadTexts: cotvMcastRouteInfoVlanId.setStatus('current')
if mibBuilder.loadTexts: cotvMcastRouteInfoVlanId.setDescription('The object indicates VLAN associated with this multicast route.')
cotvMcastRouteInfoActiveSrcAddrType = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 5, 3, 1, 2), InetAddressType())
if mibBuilder.loadTexts: cotvMcastRouteInfoActiveSrcAddrType.setStatus('current')
if mibBuilder.loadTexts: cotvMcastRouteInfoActiveSrcAddrType.setDescription('The type of Internet address of active multicast source.')
cotvMcastRouteInfoActiveSrcAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 5, 3, 1, 3), InetAddress().subtype(subtypeSpec=ConstraintsUnion(ValueSizeConstraint(4, 4), ValueSizeConstraint(16, 16), )))
if mibBuilder.loadTexts: cotvMcastRouteInfoActiveSrcAddr.setStatus('current')
if mibBuilder.loadTexts: cotvMcastRouteInfoActiveSrcAddr.setDescription('The Internet address of active multicast source. The type of this address is determined by the value of cotvMcastRouteInfoActiveSrcAddrType.')
cotvMcastRouteInfoActiveGroupAddrType = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 5, 3, 1, 4), InetAddressType())
if mibBuilder.loadTexts: cotvMcastRouteInfoActiveGroupAddrType.setStatus('current')
if mibBuilder.loadTexts: cotvMcastRouteInfoActiveGroupAddrType.setDescription('The type of Internet address of the active multicast group (multicast group of the active multicast source).')
cotvMcastRouteInfoActiveGroupAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 5, 3, 1, 5), InetAddress().subtype(subtypeSpec=ConstraintsUnion(ValueSizeConstraint(4, 4), ValueSizeConstraint(16, 16), )))
if mibBuilder.loadTexts: cotvMcastRouteInfoActiveGroupAddr.setStatus('current')
if mibBuilder.loadTexts: cotvMcastRouteInfoActiveGroupAddr.setDescription('The Internet address of the active multicast group of the (multicast group of the active multicast source). The type of this address is determined by the value of cotvMcastRouteInfoActiveGroupAddrType.')
cotvMcastRouteInfoIf = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 5, 3, 1, 6), InterfaceIndexOrZero())
if mibBuilder.loadTexts: cotvMcastRouteInfoIf.setStatus('current')
if mibBuilder.loadTexts: cotvMcastRouteInfoIf.setDescription('This object indicates the next-hop interface on the device through which the multicast group will be routed.')
cotvMcastRouteInfoHostAddrType = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 5, 3, 1, 7), InetAddressType()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cotvMcastRouteInfoHostAddrType.setStatus('current')
if mibBuilder.loadTexts: cotvMcastRouteInfoHostAddrType.setDescription("This object indicates the type of Internet address of the next-hop edge device through which the multicast group will be routed. Value of this object will be 'unknown' if no next-hop edge device information is associated with this route.")
cotvMcastRouteInfoHostAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 5, 3, 1, 8), InetAddress()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cotvMcastRouteInfoHostAddr.setStatus('current')
if mibBuilder.loadTexts: cotvMcastRouteInfoHostAddr.setDescription('This object indicates the Internet address of the next-hop edge device through which the multicast group will be routed. The type of this address is determined by the value of cotvMcastRouteInfoHostAddrType. Value of this object will be a zero length string if no next-hop edge device information is associated with this route.')
cotvMcastRouteInfoProtocolOwners = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 5, 3, 1, 9), SnmpAdminString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cotvMcastRouteInfoProtocolOwners.setStatus('current')
if mibBuilder.loadTexts: cotvMcastRouteInfoProtocolOwners.setDescription('This object indicates the protocols used by multicast route owner to learn this route information.')
cotvMcastRouteInfoMetric = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 5, 3, 1, 10), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cotvMcastRouteInfoMetric.setStatus('current')
if mibBuilder.loadTexts: cotvMcastRouteInfoMetric.setDescription('This object indicates the metric associated with this multicast route.')
cotvMcastRouteInfoUpTime = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 5, 3, 1, 11), Unsigned32()).setUnits('seconds').setMaxAccess("readonly")
if mibBuilder.loadTexts: cotvMcastRouteInfoUpTime.setStatus('current')
if mibBuilder.loadTexts: cotvMcastRouteInfoUpTime.setDescription('This object indicates the amount of time elapsed since this multicast route entry was installed in this table.')
ciscoOtvMIBCompliances = MibIdentifier((1, 3, 6, 1, 4, 1, 9, 9, 810, 2, 1))
ciscoOtvMIBGroups = MibIdentifier((1, 3, 6, 1, 4, 1, 9, 9, 810, 2, 2))
ciscoOtvMIBCompliance = ModuleCompliance((1, 3, 6, 1, 4, 1, 9, 9, 810, 2, 1, 1)).setObjects(("CISCO-OTV-MIB", "ciscoOtvSiteGroup"), ("CISCO-OTV-MIB", "ciscoOtvOverlayGroup"), ("CISCO-OTV-MIB", "ciscoOtvVlanGroup"), ("CISCO-OTV-MIB", "ciscoOtvDataGroupConfigGroup"), ("CISCO-OTV-MIB", "ciscoOtvDataGroupInfoGroup"), ("CISCO-OTV-MIB", "ciscoOtvAdjacencyGroup"), ("CISCO-OTV-MIB", "ciscoOtvArpNdCacheGroup"), ("CISCO-OTV-MIB", "ciscoOtvRouteGroup"), ("CISCO-OTV-MIB", "ciscoOtvMcastRouteGroup"), ("CISCO-OTV-MIB", "ciscoOtvMcastRouteInfoGroup"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ciscoOtvMIBCompliance = ciscoOtvMIBCompliance.setStatus('current')
if mibBuilder.loadTexts: ciscoOtvMIBCompliance.setDescription('The compliance statement for CISCO-OTV-MIB.')
ciscoOtvSiteGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 9, 9, 810, 2, 2, 1)).setObjects(("CISCO-OTV-MIB", "cotvSiteIdAdmin"), ("CISCO-OTV-MIB", "cotvSiteIdOper"), ("CISCO-OTV-MIB", "cotvSiteVlan"), ("CISCO-OTV-MIB", "cotvSiteVlanState"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ciscoOtvSiteGroup = ciscoOtvSiteGroup.setStatus('current')
if mibBuilder.loadTexts: ciscoOtvSiteGroup.setDescription('A collection of objects providing OTV site information.')
ciscoOtvOverlayGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 9, 9, 810, 2, 2, 2)).setObjects(("CISCO-OTV-MIB", "cotvOverlayVpnName"), ("CISCO-OTV-MIB", "cotvOverlayVpnState"), ("CISCO-OTV-MIB", "cotvOverlayVpnDownReason"), ("CISCO-OTV-MIB", "cotvOverlayVlansExtendedFirst2k"), ("CISCO-OTV-MIB", "cotvOverlayVlansExtendedSecond2k"), ("CISCO-OTV-MIB", "cotvOverlayControlGroupAddrType"), ("CISCO-OTV-MIB", "cotvOverlayControlGroupAddr"), ("CISCO-OTV-MIB", "cotvOverlayBroadcastGroupAddrType"), ("CISCO-OTV-MIB", "cotvOverlayBroadcastGroupAddr"), ("CISCO-OTV-MIB", "cotvOverlayJoinInterface"), ("CISCO-OTV-MIB", "cotvOverlaySourceInterface"), ("CISCO-OTV-MIB", "cotvOverlayAedCapable"), ("CISCO-OTV-MIB", "cotvOverlayAedIncapableReason"), ("CISCO-OTV-MIB", "cotvOverlayAdjServerTransportType"), ("CISCO-OTV-MIB", "cotvOverlayAdjServerEnable"), ("CISCO-OTV-MIB", "cotvOverlayPrimaryAdjServerAddrType"), ("CISCO-OTV-MIB", "cotvOverlayPrimaryAdjServerAddr"), ("CISCO-OTV-MIB", "cotvOverlaySecondaryAdjServerAddrType"), ("CISCO-OTV-MIB", "cotvOverlaySecondaryAdjServerAddr"), ("CISCO-OTV-MIB", "cotvOverlaySuppressArpND"), ("CISCO-OTV-MIB", "cotvOverlayStorageType"), ("CISCO-OTV-MIB", "cotvOverlayRowStatus"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ciscoOtvOverlayGroup = ciscoOtvOverlayGroup.setStatus('current')
if mibBuilder.loadTexts: ciscoOtvOverlayGroup.setDescription('A collection of objects providing OTV overlay information.')
ciscoOtvVlanGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 9, 9, 810, 2, 2, 3)).setObjects(("CISCO-OTV-MIB", "cotvVlanState"), ("CISCO-OTV-MIB", "cotvVlanInactiveReason"), ("CISCO-OTV-MIB", "cotvVlanAedAddrType"), ("CISCO-OTV-MIB", "cotvVlanAedAddr"), ("CISCO-OTV-MIB", "cotvVlanEdgeDevIsAed"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ciscoOtvVlanGroup = ciscoOtvVlanGroup.setStatus('current')
if mibBuilder.loadTexts: ciscoOtvVlanGroup.setDescription('A collection of objects providing OTV extended VLANs.')
ciscoOtvDataGroupConfigGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 9, 9, 810, 2, 2, 4)).setObjects(("CISCO-OTV-MIB", "cotvDataGroupStorageType"), ("CISCO-OTV-MIB", "cotvDataGroupRowStatus"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ciscoOtvDataGroupConfigGroup = ciscoOtvDataGroupConfigGroup.setStatus('current')
if mibBuilder.loadTexts: ciscoOtvDataGroupConfigGroup.setDescription('A collection of objects providing overlay multicast data-group configuration information.')
ciscoOtvDataGroupInfoGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 9, 9, 810, 2, 2, 5)).setObjects(("CISCO-OTV-MIB", "cotvDataGroupJoinInterface"), ("CISCO-OTV-MIB", "cotvDataGroupLocalActiveSrcState"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ciscoOtvDataGroupInfoGroup = ciscoOtvDataGroupInfoGroup.setStatus('current')
if mibBuilder.loadTexts: ciscoOtvDataGroupInfoGroup.setDescription('A collection of objects providing active data-group related information.')
ciscoOtvAdjacencyGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 9, 9, 810, 2, 2, 6)).setObjects(("CISCO-OTV-MIB", "cotvAdjacentDevSystemID"), ("CISCO-OTV-MIB", "cotvAdjacentDevName"), ("CISCO-OTV-MIB", "cotvAdjacentDevState"), ("CISCO-OTV-MIB", "cotvAdjacentDevUpTime"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ciscoOtvAdjacencyGroup = ciscoOtvAdjacencyGroup.setStatus('current')
if mibBuilder.loadTexts: ciscoOtvAdjacencyGroup.setDescription('A collection of objects providing information about OTV Adjacency Database.')
ciscoOtvArpNdCacheGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 9, 9, 810, 2, 2, 7)).setObjects(("CISCO-OTV-MIB", "cotvArpNdCacheMacAddr"), ("CISCO-OTV-MIB", "cotvArpNdCacheAge"), ("CISCO-OTV-MIB", "cotvArpNdCacheTimeToExpire"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ciscoOtvArpNdCacheGroup = ciscoOtvArpNdCacheGroup.setStatus('current')
if mibBuilder.loadTexts: ciscoOtvArpNdCacheGroup.setDescription('A collection of objects providing ARP/ND cache information.')
ciscoOtvRouteGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 9, 9, 810, 2, 2, 8)).setObjects(("CISCO-OTV-MIB", "cotvRouteMetric"), ("CISCO-OTV-MIB", "cotvRouteUpTime"), ("CISCO-OTV-MIB", "cotvRouteOwner"), ("CISCO-OTV-MIB", "cotvRouteNextHopIf"), ("CISCO-OTV-MIB", "cotvRouteNextHopAddrType"), ("CISCO-OTV-MIB", "cotvRouteNextHopAddr"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ciscoOtvRouteGroup = ciscoOtvRouteGroup.setStatus('current')
if mibBuilder.loadTexts: ciscoOtvRouteGroup.setDescription('A collection of objects providing information about unicast routes in ORIB.')
ciscoOtvMcastRouteGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 9, 9, 810, 2, 2, 9)).setObjects(("CISCO-OTV-MIB", "cotvMcastRouteOwners"), ("CISCO-OTV-MIB", "cotvMcastRouteMetric"), ("CISCO-OTV-MIB", "cotvMcastRouteUpTime"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ciscoOtvMcastRouteGroup = ciscoOtvMcastRouteGroup.setStatus('current')
if mibBuilder.loadTexts: ciscoOtvMcastRouteGroup.setDescription('A collection of objects providing information about multicast routes in ORIB.')
ciscoOtvMcastRouteInfoGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 9, 9, 810, 2, 2, 10)).setObjects(("CISCO-OTV-MIB", "cotvMcastRouteInfoHostAddrType"), ("CISCO-OTV-MIB", "cotvMcastRouteInfoHostAddr"), ("CISCO-OTV-MIB", "cotvMcastRouteInfoProtocolOwners"), ("CISCO-OTV-MIB", "cotvMcastRouteInfoMetric"), ("CISCO-OTV-MIB", "cotvMcastRouteInfoUpTime"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ciscoOtvMcastRouteInfoGroup = ciscoOtvMcastRouteInfoGroup.setStatus('current')
if mibBuilder.loadTexts: ciscoOtvMcastRouteInfoGroup.setDescription('A collection of objects providing interface level information for multicast routes in ORIB.')
mibBuilder.exportSymbols("CISCO-OTV-MIB", cotvDataGroupActiveSrcLocation=cotvDataGroupActiveSrcLocation, cotvMcastRouteInfoActiveGroupAddrType=cotvMcastRouteInfoActiveGroupAddrType, cotvMcastRouteInfoTable=cotvMcastRouteInfoTable, cotvArpNdCacheMacAddr=cotvArpNdCacheMacAddr, ciscoOtvMIBNotifs=ciscoOtvMIBNotifs, cotvOverlayBroadcastGroupAddr=cotvOverlayBroadcastGroupAddr, cotvArpNdCacheL3Addr=cotvArpNdCacheL3Addr, cotvOverlayAedCapable=cotvOverlayAedCapable, cotvDataGroupActiveSrcAddrType=cotvDataGroupActiveSrcAddrType, cotvMcastRouteInfoActiveSrcAddrType=cotvMcastRouteInfoActiveSrcAddrType, cotvArpNdCacheEntry=cotvArpNdCacheEntry, cotvVlansTable=cotvVlansTable, cotvRouteEntry=cotvRouteEntry, cotvDataGroupDeliveryGroupAddrType=cotvDataGroupDeliveryGroupAddrType, cotvVlanId=cotvVlanId, PYSNMP_MODULE_ID=ciscoOtvMIB, ciscoOtvMIBGroups=ciscoOtvMIBGroups, cotvOverlayControlGroupAddrType=cotvOverlayControlGroupAddrType, cotvDataGroupDeliverySrcAddr=cotvDataGroupDeliverySrcAddr, cotvDataGroupLocalActiveSrcState=cotvDataGroupLocalActiveSrcState, cotvRouteNextHopAddrType=cotvRouteNextHopAddrType, cotvMcastRouteInfoMetric=cotvMcastRouteInfoMetric, cotvAdjacentDevUpTime=cotvAdjacentDevUpTime, cotvVlanState=cotvVlanState, cotvRouteNextHopIf=cotvRouteNextHopIf, cotvMcastRouteInfoProtocolOwners=cotvMcastRouteInfoProtocolOwners, cotvArpNdCacheTable=cotvArpNdCacheTable, ciscoOtvMcastRouteInfoGroup=ciscoOtvMcastRouteInfoGroup, cotvDataGroupMcastRangeAddrType=cotvDataGroupMcastRangeAddrType, ciscoOtvMIBCompliance=ciscoOtvMIBCompliance, cotvRouteUpTime=cotvRouteUpTime, cotvMcastRouteOwners=cotvMcastRouteOwners, cotvOverlayVpnDownReason=cotvOverlayVpnDownReason, cotvVlansEntry=cotvVlansEntry, cotvDataGroupActiveGroupAddr=cotvDataGroupActiveGroupAddr, cotvOverlayVpnState=cotvOverlayVpnState, cotvOverlaySecondaryAdjServerAddrType=cotvOverlaySecondaryAdjServerAddrType, cotvOverlayAedIncapableReason=cotvOverlayAedIncapableReason, cotvSiteObjects=cotvSiteObjects, ciscoOtvArpNdCacheGroup=ciscoOtvArpNdCacheGroup, cotvAdjacentDevSystemID=cotvAdjacentDevSystemID, cotvMcastRouteEntry=cotvMcastRouteEntry, ciscoOtvMIBObjects=ciscoOtvMIBObjects, cotvMcastRouteTable=cotvMcastRouteTable, cotvVlanAedAddrType=cotvVlanAedAddrType, cotvVlanInactiveReason=cotvVlanInactiveReason, ciscoOtvSiteGroup=ciscoOtvSiteGroup, cotvDataGroupMcastRangeAddr=cotvDataGroupMcastRangeAddr, cotvOverlaySecondaryAdjServerAddr=cotvOverlaySecondaryAdjServerAddr, cotvAdjacentDevName=cotvAdjacentDevName, ciscoOtvMIBConform=ciscoOtvMIBConform, cotvRouteTable=cotvRouteTable, cotvMcastRouteInfoIf=cotvMcastRouteInfoIf, cotvMcastRouteInfoHostAddrType=cotvMcastRouteInfoHostAddrType, cotvDataGroupMcastRangePrefixLength=cotvDataGroupMcastRangePrefixLength, cotvSiteVlanState=cotvSiteVlanState, ciscoOtvDataGroupConfigGroup=ciscoOtvDataGroupConfigGroup, cotvSiteIdOper=cotvSiteIdOper, cotvDataGroupActiveSrcAddr=cotvDataGroupActiveSrcAddr, cotvOverlayControlGroupAddr=cotvOverlayControlGroupAddr, cotvVlanAedAddr=cotvVlanAedAddr, cotvMcastRouteInfoActiveSrcAddr=cotvMcastRouteInfoActiveSrcAddr, cotvDataGroupRowStatus=cotvDataGroupRowStatus, cotvOverlayVlansExtendedSecond2k=cotvOverlayVlansExtendedSecond2k, cotvOverlayJoinInterface=cotvOverlayJoinInterface, cotvMcastRouteMetric=cotvMcastRouteMetric, cotvAdjacentDevAddrType=cotvAdjacentDevAddrType, ciscoOtvMIB=ciscoOtvMIB, cotvDataGroupDeliverySrcAddrType=cotvDataGroupDeliverySrcAddrType, cotvDataGroupStorageType=cotvDataGroupStorageType, cotvOverlayNumber=cotvOverlayNumber, cotvMcastRouteUpTime=cotvMcastRouteUpTime, cotvOverlayRowStatus=cotvOverlayRowStatus, cotvOverlayBroadcastGroupAddrType=cotvOverlayBroadcastGroupAddrType, cotvMcastRouteInfoVlanId=cotvMcastRouteInfoVlanId, cotvDataGroupDeliveryGroupAddr=cotvDataGroupDeliveryGroupAddr, cotvAdjacencyObjects=cotvAdjacencyObjects, cotvOverlayPrimaryAdjServerAddrType=cotvOverlayPrimaryAdjServerAddrType, cotvMcastRouteInfoEntry=cotvMcastRouteInfoEntry, cotvMcastRouteActiveGroupAddrType=cotvMcastRouteActiveGroupAddrType, cotvOverlayAdjServerTransportType=cotvOverlayAdjServerTransportType, cotvRouteMacAddr=cotvRouteMacAddr, ciscoOtvMIBCompliances=ciscoOtvMIBCompliances, cotvOverlayVlansExtendedFirst2k=cotvOverlayVlansExtendedFirst2k, cotvOverlaySourceInterface=cotvOverlaySourceInterface, ciscoOtvVlanGroup=ciscoOtvVlanGroup, cotvArpNdCacheL3AddrType=cotvArpNdCacheL3AddrType, cotvSiteVlan=cotvSiteVlan, cotvDataGroupJoinInterface=cotvDataGroupJoinInterface, ciscoOtvRouteGroup=ciscoOtvRouteGroup, cotvAdjacentDevState=cotvAdjacentDevState, cotvDataGroupVlanId=cotvDataGroupVlanId, cotvOverlayStorageType=cotvOverlayStorageType, cotvArpNdCacheTimeToExpire=cotvArpNdCacheTimeToExpire, cotvMcastRouteActiveSrcAddr=cotvMcastRouteActiveSrcAddr, ciscoOtvAdjacencyGroup=ciscoOtvAdjacencyGroup, cotvMcastRouteVlanId=cotvMcastRouteVlanId, cotvOverlayVpnName=cotvOverlayVpnName, cotvRouteOwner=cotvRouteOwner, ciscoOtvMcastRouteGroup=ciscoOtvMcastRouteGroup, cotvDataGroupInfoEntry=cotvDataGroupInfoEntry, cotvDataGroupActiveGroupAddrType=cotvDataGroupActiveGroupAddrType, cotvRouteObjects=cotvRouteObjects, cotvMcastRouteActiveGroupAddr=cotvMcastRouteActiveGroupAddr, cotvOverlayPrimaryAdjServerAddr=cotvOverlayPrimaryAdjServerAddr, cotvMcastRouteActiveSrcAddrType=cotvMcastRouteActiveSrcAddrType, cotvGlobalStatsObjects=cotvGlobalStatsObjects, cotvAdjacencyDatabaseTable=cotvAdjacencyDatabaseTable, cotvRouteNextHopAddr=cotvRouteNextHopAddr, cotvArpNdObjects=cotvArpNdObjects, cotvGlobalObjects=cotvGlobalObjects, cotvMcastRouteInfoUpTime=cotvMcastRouteInfoUpTime, cotvSiteIdAdmin=cotvSiteIdAdmin, cotvRouteMetric=cotvRouteMetric, cotvOverlayObjects=cotvOverlayObjects, cotvOverlayEntry=cotvOverlayEntry, cotvOverlayTable=cotvOverlayTable, cotvMcastRouteInfoHostAddr=cotvMcastRouteInfoHostAddr, cotvRouteVlanId=cotvRouteVlanId, cotvDataGroupConfigTable=cotvDataGroupConfigTable, cotvOverlaySuppressArpND=cotvOverlaySuppressArpND, cotvVlanEdgeDevIsAed=cotvVlanEdgeDevIsAed, ciscoOtvDataGroupInfoGroup=ciscoOtvDataGroupInfoGroup, cotvArpNdCacheAge=cotvArpNdCacheAge, ciscoOtvOverlayGroup=ciscoOtvOverlayGroup, cotvAdjacencyDatabaseEntry=cotvAdjacencyDatabaseEntry, cotvAdjacentDevAddr=cotvAdjacentDevAddr, cotvOverlayAdjServerEnable=cotvOverlayAdjServerEnable, cotvDataGroupConfigEntry=cotvDataGroupConfigEntry, cotvMcastRouteInfoActiveGroupAddr=cotvMcastRouteInfoActiveGroupAddr, cotvDataGroupInfoTable=cotvDataGroupInfoTable)
|
(integer, object_identifier, octet_string) = mibBuilder.importSymbols('ASN1', 'Integer', 'ObjectIdentifier', 'OctetString')
(named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues')
(value_range_constraint, constraints_intersection, single_value_constraint, value_size_constraint, constraints_union) = mibBuilder.importSymbols('ASN1-REFINEMENT', 'ValueRangeConstraint', 'ConstraintsIntersection', 'SingleValueConstraint', 'ValueSizeConstraint', 'ConstraintsUnion')
(cisco_mgmt,) = mibBuilder.importSymbols('CISCO-SMI', 'ciscoMgmt')
(cisco2_k_vlan_list,) = mibBuilder.importSymbols('CISCO-TC', 'Cisco2KVlanList')
(interface_index_or_zero,) = mibBuilder.importSymbols('IF-MIB', 'InterfaceIndexOrZero')
(inet_address, inet_address_type, inet_address_prefix_length) = mibBuilder.importSymbols('INET-ADDRESS-MIB', 'InetAddress', 'InetAddressType', 'InetAddressPrefixLength')
(vlan_index,) = mibBuilder.importSymbols('Q-BRIDGE-MIB', 'VlanIndex')
(snmp_admin_string,) = mibBuilder.importSymbols('SNMP-FRAMEWORK-MIB', 'SnmpAdminString')
(object_group, module_compliance, notification_group) = mibBuilder.importSymbols('SNMPv2-CONF', 'ObjectGroup', 'ModuleCompliance', 'NotificationGroup')
(bits, ip_address, unsigned32, module_identity, counter32, mib_scalar, mib_table, mib_table_row, mib_table_column, integer32, time_ticks, gauge32, object_identity, notification_type, counter64, iso, mib_identifier) = mibBuilder.importSymbols('SNMPv2-SMI', 'Bits', 'IpAddress', 'Unsigned32', 'ModuleIdentity', 'Counter32', 'MibScalar', 'MibTable', 'MibTableRow', 'MibTableColumn', 'Integer32', 'TimeTicks', 'Gauge32', 'ObjectIdentity', 'NotificationType', 'Counter64', 'iso', 'MibIdentifier')
(textual_convention, row_status, display_string, mac_address, truth_value, storage_type) = mibBuilder.importSymbols('SNMPv2-TC', 'TextualConvention', 'RowStatus', 'DisplayString', 'MacAddress', 'TruthValue', 'StorageType')
cisco_otv_mib = module_identity((1, 3, 6, 1, 4, 1, 9, 9, 810))
ciscoOtvMIB.setRevisions(('2013-08-05 00:00',))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
if mibBuilder.loadTexts:
ciscoOtvMIB.setRevisionsDescriptions(('Initial version of this MIB module.',))
if mibBuilder.loadTexts:
ciscoOtvMIB.setLastUpdated('201308050000Z')
if mibBuilder.loadTexts:
ciscoOtvMIB.setOrganization('Cisco Systems, Inc.')
if mibBuilder.loadTexts:
ciscoOtvMIB.setContactInfo('Cisco Systems Customer Service Postal: 170 W Tasman Drive San Jose, CA 95134 USA Tel: +1 800 553-NETS E-mail: cs-snmp@cisco.com')
if mibBuilder.loadTexts:
ciscoOtvMIB.setDescription("This MIB module is for configuration & statistic query of Overlay Transport Virtualization (OTV) functionality on Cisco routers and switches. Overlay Transport Virtualization is a Cisco's innovative LAN extension technology. It is an IP-based functionality that provides Layer 2 extension capabilities over any transport infrastructure: Layer 2 based, Layer 3 based, IP switched, label switched, and so on. OTV provides an overlay that enables Layer 2 connectivity between separate Layer 2 domains while keeping these domains independent and preserving the fault- isolation, resiliency, and load-balancing benefits of an IP- based interconnection. OTV introduces the concept of MAC routing, which means a control plane protocol is used to exchange MAC reachability information between network devices providing LAN extension functionality. This is a significant shift from Layer 2 switching that traditionally leverages data plane learning, and it is justified by the need to limit flooding of Layer 2 traffic across the transport infrastructure. OTV also introduces the concept of dynamic encapsulation for Layer 2 flows that need to be sent to remote locations. Each Ethernet frame is individually encapsulated into an IP packet and delivered across the transport network. Finally, OTV provides a native built-in multi-homing capability with automatic detection, critical to increasing high availability of the overall solution. Two or more devices can be leveraged in each data center to provide LAN extension functionality without running the risk of creating an end-to-end loop that would jeopardize the overall stability of the design. The followings detail the OTV specific terminology: Edge Device The edge device performs OTV functions: it receives the Layer 2 traffic for all VLANs that need to be extended to remote locations and dynamically encapsulates the Ethernet frames into IP packets that are then sent across the transport infrastructure. Internal Interfaces To perform OTV functionality, the edge device must receive the Layer 2 traffic for all VLANs that need to be extended to remote locations. The Layer 2 interfaces, where the Layer 2 traffic is usually received, are named internal interfaces. Join Interface The Join interface is used to source the OTV encapsulated traffic and send it to the Layer 3 domain of the data center network. Overlay Interface The Overlay interface is a logical multi-access and multicast- capable interface that must be explicitly defined by the user and where the entire OTV configuration is applied. The following terms are used throughout this MIB: AED Authoritative Edge Device ARP Address Resolution Protocol DNS Domain Name System ISIS Intermediate System to Intermediate System Routing Protocol LSPDB Link State PDU Database OTV Overlay Transport Virtualization VLAN Virtual Local Area Network VPN Virtual Private Network")
cisco_otv_mib_notifs = mib_identifier((1, 3, 6, 1, 4, 1, 9, 9, 810, 0))
cisco_otv_mib_objects = mib_identifier((1, 3, 6, 1, 4, 1, 9, 9, 810, 1))
cisco_otv_mib_conform = mib_identifier((1, 3, 6, 1, 4, 1, 9, 9, 810, 2))
cotv_global_objects = mib_identifier((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 1))
cotv_overlay_objects = mib_identifier((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 2))
cotv_adjacency_objects = mib_identifier((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 3))
cotv_arp_nd_objects = mib_identifier((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 4))
cotv_route_objects = mib_identifier((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 5))
cotv_site_objects = mib_identifier((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 1, 1))
cotv_global_stats_objects = mib_identifier((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 1, 2))
cotv_site_id_admin = mib_scalar((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 1, 1, 1), octet_string().subtype(subtypeSpec=constraints_union(value_size_constraint(4, 4), value_size_constraint(6, 6)))).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
cotvSiteIdAdmin.setStatus('current')
if mibBuilder.loadTexts:
cotvSiteIdAdmin.setDescription('This object specifies OTV site identifier for this device. The OTV site identifier could be either a four octets value or a six octets valid MAC address. If the OTV site identifier is not configured, this object will have four zero octets.')
cotv_site_id_oper = mib_scalar((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 1, 1, 2), octet_string().subtype(subtypeSpec=value_size_constraint(6, 6)).setFixedLength(6)).setMaxAccess('readonly')
if mibBuilder.loadTexts:
cotvSiteIdOper.setStatus('current')
if mibBuilder.loadTexts:
cotvSiteIdOper.setDescription('This object indicates OTV site identifier in use for this device. There is no operational OTV site identifier if the value of this object contains all zeros.')
cotv_site_vlan = mib_scalar((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 1, 1, 3), vlan_index()).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
cotvSiteVlan.setStatus('current')
if mibBuilder.loadTexts:
cotvSiteVlan.setDescription('This object specifies the OTV site VLAN for this device.')
cotv_site_vlan_state = mib_scalar((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 1, 1, 4), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('up', 1), ('down', 2)))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
cotvSiteVlanState.setStatus('current')
if mibBuilder.loadTexts:
cotvSiteVlanState.setDescription("This object indicates the state of OTV site VLAN. 'up' - OTV site VLAN is up 'down' - OTV site VLAN is down")
cotv_overlay_table = mib_table((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 2, 1))
if mibBuilder.loadTexts:
cotvOverlayTable.setStatus('current')
if mibBuilder.loadTexts:
cotvOverlayTable.setDescription('A list of Overlay interfaces configured on this device.')
cotv_overlay_entry = mib_table_row((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 2, 1, 1)).setIndexNames((0, 'CISCO-OTV-MIB', 'cotvOverlayNumber'))
if mibBuilder.loadTexts:
cotvOverlayEntry.setStatus('current')
if mibBuilder.loadTexts:
cotvOverlayEntry.setDescription('An entry containing management information for a particular Overlay interface.')
cotv_overlay_number = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 2, 1, 1, 1), unsigned32())
if mibBuilder.loadTexts:
cotvOverlayNumber.setStatus('current')
if mibBuilder.loadTexts:
cotvOverlayNumber.setDescription('A unique number to identify an Overlay interface.')
cotv_overlay_vpn_name = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 2, 1, 1, 2), snmp_admin_string()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
cotvOverlayVpnName.setStatus('current')
if mibBuilder.loadTexts:
cotvOverlayVpnName.setDescription('This object indicates the name of the Virtual Private Network associated with this Overlay interface.')
cotv_overlay_vpn_state = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 2, 1, 1, 3), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(0, 1, 2))).clone(namedValues=named_values(('other', 0), ('down', 1), ('up', 2)))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
cotvOverlayVpnState.setStatus('current')
if mibBuilder.loadTexts:
cotvOverlayVpnState.setDescription("This object indicates the state of Virtual Private Network which is associated with this Overlay interface. 'other' - Any other state not covered by below enumerations. 'up' - The Overlay Virtual Private Network is up 'down' - The Overlay Virtual Private Network is down")
cotv_overlay_vpn_down_reason = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 2, 1, 1, 4), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19))).clone(namedValues=named_values(('other', 0), ('configChange', 1), ('missingControlGroup', 2), ('missingDataGroupRange', 3), ('missingJoinOrSourceInterface', 4), ('missingVpnName', 5), ('missingJoinInterfaceAddr', 6), ('joinInterfaceDown', 7), ('adminDown', 8), ('deleteHoldDown', 9), ('reinit', 10), ('missingSiteId', 11), ('siteIdMismatch', 12), ('missingSourceInterfaceAddr', 13), ('sourceInterfaceDown', 14), ('changingSiteId', 15), ('changingControlGroup', 16), ('missingDeviceId', 17), ('changingDeviceId', 18), ('cleanupInProgress', 19)))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
cotvOverlayVpnDownReason.setStatus('current')
if mibBuilder.loadTexts:
cotvOverlayVpnDownReason.setDescription("This object indicates the reason why this Overlay Virtual Private Network is down. 'other' - Any other reason not covered by below enumerations 'configChange' - Configuration changed 'missingControlGroup' - Control Group information is unavailable 'missingDataGroupRange' - Data Group range information is unavailable 'misssingJoinOrSourceInterface' - Join or Source interface information is unavailable 'missingVpnName' - VPN name is unavailable 'missingJoinInterfaceAddr' - IP address is missing for Join Interface 'joinInterfaceDown' - Join Interface is down 'adminDown' - Overlay is administratively shutdown 'deleteHoldDown' - Overlay is in delete hold down phase 'reinit' - VPN is reinitializing 'missingSiteId' - Site ID information is unavailable 'siteIdMismatch' - Site ID mismatch has occurred 'missingSourceInterfaceAddr' - IP address is missing for Source Interface 'sourceInterfaceDown' - Source interface is down 'changingSiteId' - Changing site identifier 'changingControlGroup' - Changing control group 'missingDeviceId' - Device ID information is unavailable 'changingDeviceId' - Changing device ID 'cleanupInProgress' - Cleanup in progress")
cotv_overlay_vlans_extended_first2k = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 2, 1, 1, 5), cisco2_k_vlan_list()).setMaxAccess('readcreate')
if mibBuilder.loadTexts:
cotvOverlayVlansExtendedFirst2k.setStatus('current')
if mibBuilder.loadTexts:
cotvOverlayVlansExtendedFirst2k.setDescription('This object specifies the list of VLANs extended on this Overlay interface. It is a string of octets containing one bit per VLAN with VlanIndex values of 0 through 2047. If the bit corresponding to a VLAN is set to 1, it indicates that VLAN is being extended on this Overlay interface. If the bit corresponding to a VLAN is set to 0, it indicates that VLAN is not being extended on this Overlay interface.')
cotv_overlay_vlans_extended_second2k = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 2, 1, 1, 6), cisco2_k_vlan_list()).setMaxAccess('readcreate')
if mibBuilder.loadTexts:
cotvOverlayVlansExtendedSecond2k.setStatus('current')
if mibBuilder.loadTexts:
cotvOverlayVlansExtendedSecond2k.setDescription('This object specifies the list of VLANs extended on this Overlay interface. It is a string of octets containing one bit per VLAN with VlanIndex values of 2048 through 4095. If the bit corresponding to a VLAN is set to 1, it indicates that VLAN is being extended on this Overlay interface. If the bit corresponding to a VLAN is set to 0, it indicates that VLAN is not being extended on this Overlay interface.')
cotv_overlay_control_group_addr_type = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 2, 1, 1, 7), inet_address_type().clone('unknown')).setMaxAccess('readcreate')
if mibBuilder.loadTexts:
cotvOverlayControlGroupAddrType.setStatus('current')
if mibBuilder.loadTexts:
cotvOverlayControlGroupAddrType.setDescription('This object specifies the type of Internet address of Control Group.')
cotv_overlay_control_group_addr = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 2, 1, 1, 8), inet_address()).setMaxAccess('readcreate')
if mibBuilder.loadTexts:
cotvOverlayControlGroupAddr.setStatus('current')
if mibBuilder.loadTexts:
cotvOverlayControlGroupAddr.setDescription('This object specifies the Internet address of Control Group. The type of this address is determined by cotvOverlayControlGroupAddrType.')
cotv_overlay_broadcast_group_addr_type = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 2, 1, 1, 9), inet_address_type().clone('unknown')).setMaxAccess('readcreate')
if mibBuilder.loadTexts:
cotvOverlayBroadcastGroupAddrType.setStatus('current')
if mibBuilder.loadTexts:
cotvOverlayBroadcastGroupAddrType.setDescription('This object specifies the type of Internet address to be used as Broadcast Group Address.')
cotv_overlay_broadcast_group_addr = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 2, 1, 1, 10), inet_address()).setMaxAccess('readcreate')
if mibBuilder.loadTexts:
cotvOverlayBroadcastGroupAddr.setStatus('current')
if mibBuilder.loadTexts:
cotvOverlayBroadcastGroupAddr.setDescription('This object specifies the Internet address to be used as Broadcast Group Address. The type of this address is determined by cotvOverlayBroadcastGroupAddrType.')
cotv_overlay_join_interface = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 2, 1, 1, 11), interface_index_or_zero()).setMaxAccess('readcreate')
if mibBuilder.loadTexts:
cotvOverlayJoinInterface.setStatus('current')
if mibBuilder.loadTexts:
cotvOverlayJoinInterface.setDescription('This object specifies the OTV Join Interface for this Overlay interface.')
cotv_overlay_source_interface = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 2, 1, 1, 12), interface_index_or_zero()).setMaxAccess('readcreate')
if mibBuilder.loadTexts:
cotvOverlaySourceInterface.setStatus('current')
if mibBuilder.loadTexts:
cotvOverlaySourceInterface.setDescription('This object specifies the Source Interface for this Overlay interface.')
cotv_overlay_aed_capable = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 2, 1, 1, 13), truth_value()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
cotvOverlayAedCapable.setStatus('current')
if mibBuilder.loadTexts:
cotvOverlayAedCapable.setDescription("This object indicates AED (Authoritative Edge Device) capability on this Overlay interface. A value of 'true' indicates that the edge device has capability to act as an AED on this Overlay interface. A value of 'false' indicates that the edge device does not have the capability to act as an AED on this Overlay interface.")
cotv_overlay_aed_incapable_reason = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 2, 1, 1, 14), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10))).clone(namedValues=named_values(('other', 0), ('overlayDown', 1), ('siteIdNotConfigured', 2), ('siteIdMismatch', 3), ('versionMismatch', 4), ('siteVlanDown', 5), ('noExtendedVlanUp', 6), ('noOverlayAdjacencyUp', 7), ('lspdbSyncIncomplete', 8), ('overlayDownInProgress', 9), ('isisControlGroupSyncPending', 10)))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
cotvOverlayAedIncapableReason.setStatus('current')
if mibBuilder.loadTexts:
cotvOverlayAedIncapableReason.setDescription("This object indicates the reason why the overlay is AED-incapable. 'other' - Any other reason not covered by below enumerations 'overlayDown' - Overlay is Down 'siteIdNotConfigured' - Site ID is not configured 'siteIdMismatch' - Site ID mismatch 'versionMismatch' - Version mismatch 'siteVlanDown' - Site VLAN is Down 'noExtendedVlanUp' - No extended VLAN is operationally up 'noOverlayAdjacencyUp' - No Overlay Adjacency is up 'lspdbSyncIncomplete' - LSPDB sync incomplete 'overlayDownInProgress' - Overlay state down event in progress 'isisControlGroupSyncPending' - ISIS control group sync pending")
cotv_overlay_adj_server_transport_type = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 2, 1, 1, 15), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('multicastAndUnicast', 1), ('unicastOnly', 2))).clone('multicastAndUnicast')).setMaxAccess('readcreate')
if mibBuilder.loadTexts:
cotvOverlayAdjServerTransportType.setStatus('current')
if mibBuilder.loadTexts:
cotvOverlayAdjServerTransportType.setDescription("The type of transport OTV control plane can use to exchange Adjacency Server information. 'multicastAndUnicast' - OTV control plane can use both multicast and unicast to exchange Adjacency Server information 'unicastOnly' - OTV control plane can use only unicast to exchange Adjacency Server information. Value of this object can be set to 'unicastOnly' only if the value of cotvOverlayPrimaryAdjServerAddrType is 'unknown'.")
cotv_overlay_adj_server_enable = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 2, 1, 1, 16), truth_value().clone('false')).setMaxAccess('readcreate')
if mibBuilder.loadTexts:
cotvOverlayAdjServerEnable.setStatus('current')
if mibBuilder.loadTexts:
cotvOverlayAdjServerEnable.setDescription("This object specifies Adjacency Server functionality for this Overlay interface. Setting the object to 'true' enables Adjacency Server functionality. Setting the object to 'false' disables Adjacency Server functionality.")
cotv_overlay_primary_adj_server_addr_type = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 2, 1, 1, 17), inet_address_type().clone('unknown')).setMaxAccess('readcreate')
if mibBuilder.loadTexts:
cotvOverlayPrimaryAdjServerAddrType.setStatus('current')
if mibBuilder.loadTexts:
cotvOverlayPrimaryAdjServerAddrType.setDescription('This object specifies the type of Internet address of the Primary Adjacency Server for this Overlay interface.')
cotv_overlay_primary_adj_server_addr = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 2, 1, 1, 18), inet_address()).setMaxAccess('readcreate')
if mibBuilder.loadTexts:
cotvOverlayPrimaryAdjServerAddr.setStatus('current')
if mibBuilder.loadTexts:
cotvOverlayPrimaryAdjServerAddr.setDescription('This object specifies the Internet address of the Primary Adjacency Server for this Overlay interface. The type of this address is determined by the value of cotvOverlayPrimaryAdjServerAddrType.')
cotv_overlay_secondary_adj_server_addr_type = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 2, 1, 1, 19), inet_address_type().clone('unknown')).setMaxAccess('readcreate')
if mibBuilder.loadTexts:
cotvOverlaySecondaryAdjServerAddrType.setStatus('current')
if mibBuilder.loadTexts:
cotvOverlaySecondaryAdjServerAddrType.setDescription('This object specifies the type of Internet address of the Secondary Adjacency Server for this Overlay interface.')
cotv_overlay_secondary_adj_server_addr = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 2, 1, 1, 20), inet_address()).setMaxAccess('readcreate')
if mibBuilder.loadTexts:
cotvOverlaySecondaryAdjServerAddr.setStatus('current')
if mibBuilder.loadTexts:
cotvOverlaySecondaryAdjServerAddr.setDescription('This object specifies the Internet address of the Secondary Adjacency Server for this Overlay interface. The type of this address is determined by cotvOverlaySecondaryAdjServerAddrType.')
cotv_overlay_suppress_arp_nd = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 2, 1, 1, 21), truth_value().clone('false')).setMaxAccess('readcreate')
if mibBuilder.loadTexts:
cotvOverlaySuppressArpND.setStatus('current')
if mibBuilder.loadTexts:
cotvOverlaySuppressArpND.setDescription("This object specifies ARP Neighbor Discovery behavior on this Overlay interface. Setting the object to 'true' enables suppression of ARP Neighbor Discovery on this Overlay interface. Setting the object to 'false' disables suppression of ARP Neighbor Discovery on this Overlay interface.")
cotv_overlay_storage_type = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 2, 1, 1, 22), storage_type().clone('volatile')).setMaxAccess('readcreate')
if mibBuilder.loadTexts:
cotvOverlayStorageType.setStatus('current')
if mibBuilder.loadTexts:
cotvOverlayStorageType.setDescription('This object specifies the storage type for this conceptual row.')
cotv_overlay_row_status = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 2, 1, 1, 23), row_status()).setMaxAccess('readcreate')
if mibBuilder.loadTexts:
cotvOverlayRowStatus.setStatus('current')
if mibBuilder.loadTexts:
cotvOverlayRowStatus.setDescription('This object specifies the status of this conceptual row.')
cotv_vlans_table = mib_table((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 2, 2))
if mibBuilder.loadTexts:
cotvVlansTable.setStatus('current')
if mibBuilder.loadTexts:
cotvVlansTable.setDescription('A list of VLANs extended on Overlay interfaces.')
cotv_vlans_entry = mib_table_row((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 2, 2, 1)).setIndexNames((0, 'CISCO-OTV-MIB', 'cotvOverlayNumber'), (0, 'CISCO-OTV-MIB', 'cotvVlanId'))
if mibBuilder.loadTexts:
cotvVlansEntry.setStatus('current')
if mibBuilder.loadTexts:
cotvVlansEntry.setDescription('An entry containing management information for a particular VLAN extended on an Overlay interface.')
cotv_vlan_id = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 2, 2, 1, 1), vlan_index())
if mibBuilder.loadTexts:
cotvVlanId.setStatus('current')
if mibBuilder.loadTexts:
cotvVlanId.setDescription('This object indicates the VLAN ID of the extended VLAN.')
cotv_vlan_state = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 2, 2, 1, 2), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('active', 1), ('inactive', 2)))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
cotvVlanState.setStatus('current')
if mibBuilder.loadTexts:
cotvVlanState.setDescription("This object indicates the state of the extended VLAN. 'active' - OTV is ready to forward traffic for this VLAN 'inactive' - OTV can not forward traffic for this VLAN")
cotv_vlan_inactive_reason = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 2, 2, 1, 3), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3, 4, 5, 6))).clone(namedValues=named_values(('other', 1), ('nonAed', 2), ('vlanDisabled', 3), ('overlayDown', 4), ('deleteHoldDown', 5), ('hwDown', 6)))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
cotvVlanInactiveReason.setStatus('current')
if mibBuilder.loadTexts:
cotvVlanInactiveReason.setDescription("This object indicates the reason the VLAN is in 'inactive' state. 'other' - Any other reason not covered by the below enumerations 'nonAed' - Device is not an AED on this VLAN 'vlanDisabled' - Vlan is in disabled state 'overlayDown' - Overlay is currently down 'deleteHoldDown' - The VLAN is in delete hold-down state 'hwDown' - An issue with hardware is preventing VLAN from becoming 'active' Value of this object should be ignored if the value of cotvVlanInactiveReason is not 'inactive'.")
cotv_vlan_aed_addr_type = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 2, 2, 1, 4), inet_address_type()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
cotvVlanAedAddrType.setStatus('current')
if mibBuilder.loadTexts:
cotvVlanAedAddrType.setDescription('This object indicates the type of Internet address of Authoritative Edge Device (AED) on this VLAN.')
cotv_vlan_aed_addr = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 2, 2, 1, 5), inet_address()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
cotvVlanAedAddr.setStatus('current')
if mibBuilder.loadTexts:
cotvVlanAedAddr.setDescription('This object indicates the Internet address of Authoritative Edge Device (AED) on this VLAN. The type of this address is determined by the value of cotvVlanAedAddrType.')
cotv_vlan_edge_dev_is_aed = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 2, 2, 1, 6), truth_value()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
cotvVlanEdgeDevIsAed.setStatus('current')
if mibBuilder.loadTexts:
cotvVlanEdgeDevIsAed.setDescription("This object indicates if this device is acting as an AED for the VLAN. A value of 'true' indicates that this device is acting as an AED for the VLAN. A value of 'false' indicates that this device is not acting as an AED for the VLAN.")
cotv_data_group_config_table = mib_table((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 2, 3))
if mibBuilder.loadTexts:
cotvDataGroupConfigTable.setStatus('current')
if mibBuilder.loadTexts:
cotvDataGroupConfigTable.setDescription('A list of multicast data-group ranges configured for each Overlay interface.')
cotv_data_group_config_entry = mib_table_row((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 2, 3, 1)).setIndexNames((0, 'CISCO-OTV-MIB', 'cotvOverlayNumber'), (0, 'CISCO-OTV-MIB', 'cotvDataGroupMcastRangeAddrType'), (0, 'CISCO-OTV-MIB', 'cotvDataGroupMcastRangeAddr'), (0, 'CISCO-OTV-MIB', 'cotvDataGroupMcastRangePrefixLength'))
if mibBuilder.loadTexts:
cotvDataGroupConfigEntry.setStatus('current')
if mibBuilder.loadTexts:
cotvDataGroupConfigEntry.setDescription('An entry containing management information for a particular multicast data-group range configured for an Overlay interface.')
cotv_data_group_mcast_range_addr_type = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 2, 3, 1, 1), inet_address_type())
if mibBuilder.loadTexts:
cotvDataGroupMcastRangeAddrType.setStatus('current')
if mibBuilder.loadTexts:
cotvDataGroupMcastRangeAddrType.setDescription('The type of Internet address of multicast data-group range.')
cotv_data_group_mcast_range_addr = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 2, 3, 1, 2), inet_address().subtype(subtypeSpec=constraints_union(value_size_constraint(4, 4), value_size_constraint(16, 16))))
if mibBuilder.loadTexts:
cotvDataGroupMcastRangeAddr.setStatus('current')
if mibBuilder.loadTexts:
cotvDataGroupMcastRangeAddr.setDescription('The Internet address of multicast data-group range. The type of this address is determined by the value of the cotvDataGroupMcastRangeAddrType object.')
cotv_data_group_mcast_range_prefix_length = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 2, 3, 1, 3), inet_address_prefix_length())
if mibBuilder.loadTexts:
cotvDataGroupMcastRangePrefixLength.setStatus('current')
if mibBuilder.loadTexts:
cotvDataGroupMcastRangePrefixLength.setDescription('The length of the prefix associated with cotvDataGroupMcastRangeAddr. The type of this address prefix is determined by the value of the cotvDataGroupMcastRangeAddrType object.')
cotv_data_group_storage_type = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 2, 3, 1, 4), storage_type().clone('volatile')).setMaxAccess('readcreate')
if mibBuilder.loadTexts:
cotvDataGroupStorageType.setStatus('current')
if mibBuilder.loadTexts:
cotvDataGroupStorageType.setDescription('This object specifies the storage type for this conceptual row.')
cotv_data_group_row_status = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 2, 3, 1, 5), row_status()).setMaxAccess('readcreate')
if mibBuilder.loadTexts:
cotvDataGroupRowStatus.setStatus('current')
if mibBuilder.loadTexts:
cotvDataGroupRowStatus.setDescription('This object specifies the status of this conceptual row.')
cotv_data_group_info_table = mib_table((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 2, 4))
if mibBuilder.loadTexts:
cotvDataGroupInfoTable.setStatus('current')
if mibBuilder.loadTexts:
cotvDataGroupInfoTable.setDescription('A table listing management information for active multicast sources and multicast groups on each Overlay interface.')
cotv_data_group_info_entry = mib_table_row((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 2, 4, 1)).setIndexNames((0, 'CISCO-OTV-MIB', 'cotvOverlayNumber'), (0, 'CISCO-OTV-MIB', 'cotvDataGroupActiveSrcLocation'), (0, 'CISCO-OTV-MIB', 'cotvDataGroupVlanId'), (0, 'CISCO-OTV-MIB', 'cotvDataGroupActiveGroupAddrType'), (0, 'CISCO-OTV-MIB', 'cotvDataGroupActiveGroupAddr'), (0, 'CISCO-OTV-MIB', 'cotvDataGroupActiveSrcAddrType'), (0, 'CISCO-OTV-MIB', 'cotvDataGroupActiveSrcAddr'), (0, 'CISCO-OTV-MIB', 'cotvDataGroupDeliveryGroupAddrType'), (0, 'CISCO-OTV-MIB', 'cotvDataGroupDeliveryGroupAddr'), (0, 'CISCO-OTV-MIB', 'cotvDataGroupDeliverySrcAddrType'), (0, 'CISCO-OTV-MIB', 'cotvDataGroupDeliverySrcAddr'))
if mibBuilder.loadTexts:
cotvDataGroupInfoEntry.setStatus('current')
if mibBuilder.loadTexts:
cotvDataGroupInfoEntry.setDescription('An entry containing management information for an active multicast data-group.')
cotv_data_group_active_src_location = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 2, 4, 1, 1), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('local', 1), ('remote', 2))))
if mibBuilder.loadTexts:
cotvDataGroupActiveSrcLocation.setStatus('current')
if mibBuilder.loadTexts:
cotvDataGroupActiveSrcLocation.setDescription('The location of Active Multicast source.')
cotv_data_group_vlan_id = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 2, 4, 1, 2), vlan_index())
if mibBuilder.loadTexts:
cotvDataGroupVlanId.setStatus('current')
if mibBuilder.loadTexts:
cotvDataGroupVlanId.setDescription('The VLAN associated with Active Multicast data-group.')
cotv_data_group_active_group_addr_type = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 2, 4, 1, 3), inet_address_type())
if mibBuilder.loadTexts:
cotvDataGroupActiveGroupAddrType.setStatus('current')
if mibBuilder.loadTexts:
cotvDataGroupActiveGroupAddrType.setDescription('The type of Internet address of the active multicast group (multicast group of the active multicast source).')
cotv_data_group_active_group_addr = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 2, 4, 1, 4), inet_address().subtype(subtypeSpec=constraints_union(value_size_constraint(4, 4), value_size_constraint(16, 16))))
if mibBuilder.loadTexts:
cotvDataGroupActiveGroupAddr.setStatus('current')
if mibBuilder.loadTexts:
cotvDataGroupActiveGroupAddr.setDescription('The Internet address of the active multicast group of the (multicast group of the active multicast source). The type of this address is determined by the value of cotvDataGroupActiveGroupAddrType.')
cotv_data_group_active_src_addr_type = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 2, 4, 1, 5), inet_address_type())
if mibBuilder.loadTexts:
cotvDataGroupActiveSrcAddrType.setStatus('current')
if mibBuilder.loadTexts:
cotvDataGroupActiveSrcAddrType.setDescription('The type of Internet address of active multicast source.')
cotv_data_group_active_src_addr = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 2, 4, 1, 6), inet_address().subtype(subtypeSpec=constraints_union(value_size_constraint(4, 4), value_size_constraint(16, 16))))
if mibBuilder.loadTexts:
cotvDataGroupActiveSrcAddr.setStatus('current')
if mibBuilder.loadTexts:
cotvDataGroupActiveSrcAddr.setDescription('The Internet address of active multicast source. The type of this address is determined by the value of cotvDataGroupActiveSrcAddrType.')
cotv_data_group_delivery_group_addr_type = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 2, 4, 1, 7), inet_address_type())
if mibBuilder.loadTexts:
cotvDataGroupDeliveryGroupAddrType.setStatus('current')
if mibBuilder.loadTexts:
cotvDataGroupDeliveryGroupAddrType.setDescription('The type of Internet address of the delivery group that is mapped to active multicast group.')
cotv_data_group_delivery_group_addr = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 2, 4, 1, 8), inet_address().subtype(subtypeSpec=constraints_union(value_size_constraint(4, 4), value_size_constraint(16, 16))))
if mibBuilder.loadTexts:
cotvDataGroupDeliveryGroupAddr.setStatus('current')
if mibBuilder.loadTexts:
cotvDataGroupDeliveryGroupAddr.setDescription('The Internet address of delivery group that is mapped to active multicast group. The type of this address is determined by cotvDataGroupDeliveryGroupAddrType.')
cotv_data_group_delivery_src_addr_type = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 2, 4, 1, 9), inet_address_type())
if mibBuilder.loadTexts:
cotvDataGroupDeliverySrcAddrType.setStatus('current')
if mibBuilder.loadTexts:
cotvDataGroupDeliverySrcAddrType.setDescription('The type of Internet address of the delivery source that is mapped to the active multicast source.')
cotv_data_group_delivery_src_addr = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 2, 4, 1, 10), inet_address().subtype(subtypeSpec=constraints_union(value_size_constraint(4, 4), value_size_constraint(16, 16))))
if mibBuilder.loadTexts:
cotvDataGroupDeliverySrcAddr.setStatus('current')
if mibBuilder.loadTexts:
cotvDataGroupDeliverySrcAddr.setDescription('The Internet address of the delivery source that is mapped to the active multicast source. The type of this address is determined by the value of cotvDataGroupDeliverySrcAddrType.')
cotv_data_group_join_interface = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 2, 4, 1, 11), interface_index_or_zero()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
cotvDataGroupJoinInterface.setStatus('current')
if mibBuilder.loadTexts:
cotvDataGroupJoinInterface.setDescription('This object indicates the OTV Join interface on which active multicast source is located.')
cotv_data_group_local_active_src_state = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 2, 4, 1, 12), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3, 4))).clone(namedValues=named_values(('none', 1), ('local', 2), ('remote', 3), ('orphan', 4)))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
cotvDataGroupLocalActiveSrcState.setStatus('current')
if mibBuilder.loadTexts:
cotvDataGroupLocalActiveSrcState.setDescription("This object indicates the state of the local Active Multicast source. 'none' - State of the multicast source is not applicable 'local' - multicast source state is local 'remote' - multicast source state is remote 'orphan' - multicast source state is orphan Value of this object should be 'none' if cotvDataGroupActiveSrcLocation is 'remote'.")
cotv_adjacency_database_table = mib_table((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 3, 1))
if mibBuilder.loadTexts:
cotvAdjacencyDatabaseTable.setStatus('current')
if mibBuilder.loadTexts:
cotvAdjacencyDatabaseTable.setDescription('A table containing OTV adjacency database information.')
cotv_adjacency_database_entry = mib_table_row((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 3, 1, 1)).setIndexNames((0, 'CISCO-OTV-MIB', 'cotvOverlayNumber'), (0, 'CISCO-OTV-MIB', 'cotvAdjacentDevAddrType'), (0, 'CISCO-OTV-MIB', 'cotvAdjacentDevAddr'))
if mibBuilder.loadTexts:
cotvAdjacencyDatabaseEntry.setStatus('current')
if mibBuilder.loadTexts:
cotvAdjacencyDatabaseEntry.setDescription('An entry containing management information about a particular OTV adjacency.')
cotv_adjacent_dev_addr_type = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 3, 1, 1, 1), inet_address_type())
if mibBuilder.loadTexts:
cotvAdjacentDevAddrType.setStatus('current')
if mibBuilder.loadTexts:
cotvAdjacentDevAddrType.setDescription('The type of Internet address of adjacent edge device.')
cotv_adjacent_dev_addr = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 3, 1, 1, 2), inet_address().subtype(subtypeSpec=value_size_constraint(1, 64)))
if mibBuilder.loadTexts:
cotvAdjacentDevAddr.setStatus('current')
if mibBuilder.loadTexts:
cotvAdjacentDevAddr.setDescription('The Internet address of adjacent edge device. The type of this address is determined by the value of cotvAdjacentDevAddrType.')
cotv_adjacent_dev_system_id = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 3, 1, 1, 3), octet_string().subtype(subtypeSpec=constraints_union(value_size_constraint(0, 0), value_size_constraint(6, 6)))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
cotvAdjacentDevSystemID.setStatus('current')
if mibBuilder.loadTexts:
cotvAdjacentDevSystemID.setDescription('This object indicates the system identifier of the adjacent edge device. The value of this object contains zero length octet, if the system identifier of the adjacent edge devices is not available.')
cotv_adjacent_dev_name = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 3, 1, 1, 4), snmp_admin_string()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
cotvAdjacentDevName.setStatus('current')
if mibBuilder.loadTexts:
cotvAdjacentDevName.setDescription('This object indicates the DNS name of the adjacent edge device.')
cotv_adjacent_dev_state = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 3, 1, 1, 5), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(0, 1, 2))).clone(namedValues=named_values(('other', 0), ('up', 1), ('down', 2)))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
cotvAdjacentDevState.setStatus('current')
if mibBuilder.loadTexts:
cotvAdjacentDevState.setDescription("This object indicates the state of adjacent edge device. 'other' - Any other state not covered by below enumeration. 'up' - The adjacent device is up 'down' - The adjacent device is down.")
cotv_adjacent_dev_up_time = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 3, 1, 1, 6), unsigned32()).setUnits('seconds').setMaxAccess('readonly')
if mibBuilder.loadTexts:
cotvAdjacentDevUpTime.setStatus('current')
if mibBuilder.loadTexts:
cotvAdjacentDevUpTime.setDescription('This object indicates the amount of time for which the adjacent device has been up.')
cotv_arp_nd_cache_table = mib_table((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 4, 1))
if mibBuilder.loadTexts:
cotvArpNdCacheTable.setStatus('current')
if mibBuilder.loadTexts:
cotvArpNdCacheTable.setDescription('A table containing ARP Neighbor Discovery cache information.')
cotv_arp_nd_cache_entry = mib_table_row((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 4, 1, 1)).setIndexNames((0, 'CISCO-OTV-MIB', 'cotvOverlayNumber'), (0, 'CISCO-OTV-MIB', 'cotvVlanId'), (0, 'CISCO-OTV-MIB', 'cotvArpNdCacheL3AddrType'), (0, 'CISCO-OTV-MIB', 'cotvArpNdCacheL3Addr'))
if mibBuilder.loadTexts:
cotvArpNdCacheEntry.setStatus('current')
if mibBuilder.loadTexts:
cotvArpNdCacheEntry.setDescription('An entry containing management information about a particular entry in ARP Neighbor Discovery cache.')
cotv_arp_nd_cache_l3_addr_type = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 4, 1, 1, 1), inet_address_type())
if mibBuilder.loadTexts:
cotvArpNdCacheL3AddrType.setStatus('current')
if mibBuilder.loadTexts:
cotvArpNdCacheL3AddrType.setDescription('The type of Internet address (IPv4/IPv6 address) of host discovered using ARP Neighbor discovery.')
cotv_arp_nd_cache_l3_addr = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 4, 1, 1, 2), inet_address().subtype(subtypeSpec=value_size_constraint(0, 64)))
if mibBuilder.loadTexts:
cotvArpNdCacheL3Addr.setStatus('current')
if mibBuilder.loadTexts:
cotvArpNdCacheL3Addr.setDescription('The Internet address (IPv4/IPv6 address) of the host discovered using ARP Neighbor discovery. The type of this address is determined by the value of cotvArpNdCacheL3AddrType.')
cotv_arp_nd_cache_mac_addr = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 4, 1, 1, 3), mac_address()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
cotvArpNdCacheMacAddr.setStatus('current')
if mibBuilder.loadTexts:
cotvArpNdCacheMacAddr.setDescription('This object indicates the MAC address discovered using ARP Neighbor discovery and cached in this table.')
cotv_arp_nd_cache_age = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 4, 1, 1, 4), unsigned32()).setUnits('seconds').setMaxAccess('readonly')
if mibBuilder.loadTexts:
cotvArpNdCacheAge.setStatus('current')
if mibBuilder.loadTexts:
cotvArpNdCacheAge.setDescription('This object indicates the amount of time for which this entry has existed on the system.')
cotv_arp_nd_cache_time_to_expire = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 4, 1, 1, 5), unsigned32()).setUnits('seconds').setMaxAccess('readonly')
if mibBuilder.loadTexts:
cotvArpNdCacheTimeToExpire.setStatus('current')
if mibBuilder.loadTexts:
cotvArpNdCacheTimeToExpire.setDescription('This object indicates the amount of time left for this cache entry to be expired.')
cotv_route_table = mib_table((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 5, 1))
if mibBuilder.loadTexts:
cotvRouteTable.setStatus('current')
if mibBuilder.loadTexts:
cotvRouteTable.setDescription('A table listing route (unicast) information in OTV Routing Information Base (ORIB).')
cotv_route_entry = mib_table_row((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 5, 1, 1)).setIndexNames((0, 'CISCO-OTV-MIB', 'cotvRouteVlanId'), (0, 'CISCO-OTV-MIB', 'cotvRouteMacAddr'))
if mibBuilder.loadTexts:
cotvRouteEntry.setStatus('current')
if mibBuilder.loadTexts:
cotvRouteEntry.setDescription('An entry containing management information about a particular route (unicast) in ORIB.')
cotv_route_vlan_id = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 5, 1, 1, 1), vlan_index())
if mibBuilder.loadTexts:
cotvRouteVlanId.setStatus('current')
if mibBuilder.loadTexts:
cotvRouteVlanId.setDescription('The object indicates VLAN associated with this route.')
cotv_route_mac_addr = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 5, 1, 1, 2), mac_address())
if mibBuilder.loadTexts:
cotvRouteMacAddr.setStatus('current')
if mibBuilder.loadTexts:
cotvRouteMacAddr.setDescription('This object indicates the MAC address to be routed.')
cotv_route_metric = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 5, 1, 1, 3), unsigned32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
cotvRouteMetric.setStatus('current')
if mibBuilder.loadTexts:
cotvRouteMetric.setDescription('This object indicates the metric associated with this route.')
cotv_route_up_time = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 5, 1, 1, 4), unsigned32()).setUnits('seconds').setMaxAccess('readonly')
if mibBuilder.loadTexts:
cotvRouteUpTime.setStatus('current')
if mibBuilder.loadTexts:
cotvRouteUpTime.setDescription('This object indicates the amount of time elapsed since the MAC route entry was installed in this table.')
cotv_route_owner = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 5, 1, 1, 5), snmp_admin_string()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
cotvRouteOwner.setStatus('current')
if mibBuilder.loadTexts:
cotvRouteOwner.setDescription('This object indicates the type of owner (source) from where the MAC address was learnt.')
cotv_route_next_hop_if = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 5, 1, 1, 6), interface_index_or_zero()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
cotvRouteNextHopIf.setStatus('current')
if mibBuilder.loadTexts:
cotvRouteNextHopIf.setDescription("This object indicates the interface on the device through which the MAC address will be routed. Value of this object should be ignored if cotvRouteOwner is other than 'site' or 'static'.")
cotv_route_next_hop_addr_type = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 5, 1, 1, 7), inet_address_type()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
cotvRouteNextHopAddrType.setStatus('current')
if mibBuilder.loadTexts:
cotvRouteNextHopAddrType.setDescription("This object indicates the type of Internet address of the edge device through which the MAC address will be routed. Value of this object should be ignored if cotvRouteOwner is other than 'overlay'.")
cotv_route_next_hop_addr = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 5, 1, 1, 8), inet_address()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
cotvRouteNextHopAddr.setStatus('current')
if mibBuilder.loadTexts:
cotvRouteNextHopAddr.setDescription("This object indicates the Internet address of the edge device through which the MAC address will be routed. The type of this address is determined by the value of cotvRouteNextHopAddrType. Value of this object should be ignored if cotvRouteOwner is other than 'overlay'.")
cotv_mcast_route_table = mib_table((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 5, 2))
if mibBuilder.loadTexts:
cotvMcastRouteTable.setStatus('current')
if mibBuilder.loadTexts:
cotvMcastRouteTable.setDescription('A table listing multicast route information in OTV Routing Information Base (ORIB).')
cotv_mcast_route_entry = mib_table_row((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 5, 2, 1)).setIndexNames((0, 'CISCO-OTV-MIB', 'cotvMcastRouteVlanId'), (0, 'CISCO-OTV-MIB', 'cotvMcastRouteActiveSrcAddrType'), (0, 'CISCO-OTV-MIB', 'cotvMcastRouteActiveSrcAddr'), (0, 'CISCO-OTV-MIB', 'cotvMcastRouteActiveGroupAddrType'), (0, 'CISCO-OTV-MIB', 'cotvMcastRouteActiveGroupAddr'))
if mibBuilder.loadTexts:
cotvMcastRouteEntry.setStatus('current')
if mibBuilder.loadTexts:
cotvMcastRouteEntry.setDescription('An entry containing information about a particular multicast route in ORIB.')
cotv_mcast_route_vlan_id = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 5, 2, 1, 1), vlan_index())
if mibBuilder.loadTexts:
cotvMcastRouteVlanId.setStatus('current')
if mibBuilder.loadTexts:
cotvMcastRouteVlanId.setDescription('The object indicates VLAN associated with this multicast route.')
cotv_mcast_route_active_src_addr_type = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 5, 2, 1, 2), inet_address_type())
if mibBuilder.loadTexts:
cotvMcastRouteActiveSrcAddrType.setStatus('current')
if mibBuilder.loadTexts:
cotvMcastRouteActiveSrcAddrType.setDescription('The type of Internet address of active multicast source.')
cotv_mcast_route_active_src_addr = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 5, 2, 1, 3), inet_address().subtype(subtypeSpec=constraints_union(value_size_constraint(4, 4), value_size_constraint(16, 16))))
if mibBuilder.loadTexts:
cotvMcastRouteActiveSrcAddr.setStatus('current')
if mibBuilder.loadTexts:
cotvMcastRouteActiveSrcAddr.setDescription('The Internet address of active multicast source. The type of this address is determined by the value of cotvMcastRouteActiveSrcAddrType.')
cotv_mcast_route_active_group_addr_type = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 5, 2, 1, 4), inet_address_type())
if mibBuilder.loadTexts:
cotvMcastRouteActiveGroupAddrType.setStatus('current')
if mibBuilder.loadTexts:
cotvMcastRouteActiveGroupAddrType.setDescription('The type of Internet address of the active multicast group (multicast group of the active multicast source).')
cotv_mcast_route_active_group_addr = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 5, 2, 1, 5), inet_address().subtype(subtypeSpec=constraints_union(value_size_constraint(4, 4), value_size_constraint(16, 16))))
if mibBuilder.loadTexts:
cotvMcastRouteActiveGroupAddr.setStatus('current')
if mibBuilder.loadTexts:
cotvMcastRouteActiveGroupAddr.setDescription('The Internet address of the active multicast group of the (multicast group of the active multicast source). The type of this address is determined by the value of cotvMcastRouteActiveGroupAddrType.')
cotv_mcast_route_owners = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 5, 2, 1, 6), snmp_admin_string()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
cotvMcastRouteOwners.setStatus('current')
if mibBuilder.loadTexts:
cotvMcastRouteOwners.setDescription('This object indicates the type of owner(s) (sources) from where this route was learnt.')
cotv_mcast_route_metric = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 5, 2, 1, 7), unsigned32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
cotvMcastRouteMetric.setStatus('current')
if mibBuilder.loadTexts:
cotvMcastRouteMetric.setDescription('This object indicates the metric associated with this multicast route.')
cotv_mcast_route_up_time = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 5, 2, 1, 8), unsigned32()).setUnits('seconds').setMaxAccess('readonly')
if mibBuilder.loadTexts:
cotvMcastRouteUpTime.setStatus('current')
if mibBuilder.loadTexts:
cotvMcastRouteUpTime.setDescription('This object indicates the amount of time elapsed since this multicast route was installed in this table.')
cotv_mcast_route_info_table = mib_table((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 5, 3))
if mibBuilder.loadTexts:
cotvMcastRouteInfoTable.setStatus('current')
if mibBuilder.loadTexts:
cotvMcastRouteInfoTable.setDescription('A table listing next-hop information associated with each multicast route in OTV Routing Information Base (ORIB).')
cotv_mcast_route_info_entry = mib_table_row((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 5, 3, 1)).setIndexNames((0, 'CISCO-OTV-MIB', 'cotvMcastRouteInfoVlanId'), (0, 'CISCO-OTV-MIB', 'cotvMcastRouteInfoActiveSrcAddrType'), (0, 'CISCO-OTV-MIB', 'cotvMcastRouteInfoActiveSrcAddr'), (0, 'CISCO-OTV-MIB', 'cotvMcastRouteInfoActiveGroupAddrType'), (0, 'CISCO-OTV-MIB', 'cotvMcastRouteInfoActiveGroupAddr'), (0, 'CISCO-OTV-MIB', 'cotvMcastRouteInfoIf'))
if mibBuilder.loadTexts:
cotvMcastRouteInfoEntry.setStatus('current')
if mibBuilder.loadTexts:
cotvMcastRouteInfoEntry.setDescription('An entry containing next-hop information about a particular multicast route in ORIB.')
cotv_mcast_route_info_vlan_id = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 5, 3, 1, 1), vlan_index())
if mibBuilder.loadTexts:
cotvMcastRouteInfoVlanId.setStatus('current')
if mibBuilder.loadTexts:
cotvMcastRouteInfoVlanId.setDescription('The object indicates VLAN associated with this multicast route.')
cotv_mcast_route_info_active_src_addr_type = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 5, 3, 1, 2), inet_address_type())
if mibBuilder.loadTexts:
cotvMcastRouteInfoActiveSrcAddrType.setStatus('current')
if mibBuilder.loadTexts:
cotvMcastRouteInfoActiveSrcAddrType.setDescription('The type of Internet address of active multicast source.')
cotv_mcast_route_info_active_src_addr = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 5, 3, 1, 3), inet_address().subtype(subtypeSpec=constraints_union(value_size_constraint(4, 4), value_size_constraint(16, 16))))
if mibBuilder.loadTexts:
cotvMcastRouteInfoActiveSrcAddr.setStatus('current')
if mibBuilder.loadTexts:
cotvMcastRouteInfoActiveSrcAddr.setDescription('The Internet address of active multicast source. The type of this address is determined by the value of cotvMcastRouteInfoActiveSrcAddrType.')
cotv_mcast_route_info_active_group_addr_type = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 5, 3, 1, 4), inet_address_type())
if mibBuilder.loadTexts:
cotvMcastRouteInfoActiveGroupAddrType.setStatus('current')
if mibBuilder.loadTexts:
cotvMcastRouteInfoActiveGroupAddrType.setDescription('The type of Internet address of the active multicast group (multicast group of the active multicast source).')
cotv_mcast_route_info_active_group_addr = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 5, 3, 1, 5), inet_address().subtype(subtypeSpec=constraints_union(value_size_constraint(4, 4), value_size_constraint(16, 16))))
if mibBuilder.loadTexts:
cotvMcastRouteInfoActiveGroupAddr.setStatus('current')
if mibBuilder.loadTexts:
cotvMcastRouteInfoActiveGroupAddr.setDescription('The Internet address of the active multicast group of the (multicast group of the active multicast source). The type of this address is determined by the value of cotvMcastRouteInfoActiveGroupAddrType.')
cotv_mcast_route_info_if = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 5, 3, 1, 6), interface_index_or_zero())
if mibBuilder.loadTexts:
cotvMcastRouteInfoIf.setStatus('current')
if mibBuilder.loadTexts:
cotvMcastRouteInfoIf.setDescription('This object indicates the next-hop interface on the device through which the multicast group will be routed.')
cotv_mcast_route_info_host_addr_type = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 5, 3, 1, 7), inet_address_type()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
cotvMcastRouteInfoHostAddrType.setStatus('current')
if mibBuilder.loadTexts:
cotvMcastRouteInfoHostAddrType.setDescription("This object indicates the type of Internet address of the next-hop edge device through which the multicast group will be routed. Value of this object will be 'unknown' if no next-hop edge device information is associated with this route.")
cotv_mcast_route_info_host_addr = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 5, 3, 1, 8), inet_address()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
cotvMcastRouteInfoHostAddr.setStatus('current')
if mibBuilder.loadTexts:
cotvMcastRouteInfoHostAddr.setDescription('This object indicates the Internet address of the next-hop edge device through which the multicast group will be routed. The type of this address is determined by the value of cotvMcastRouteInfoHostAddrType. Value of this object will be a zero length string if no next-hop edge device information is associated with this route.')
cotv_mcast_route_info_protocol_owners = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 5, 3, 1, 9), snmp_admin_string()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
cotvMcastRouteInfoProtocolOwners.setStatus('current')
if mibBuilder.loadTexts:
cotvMcastRouteInfoProtocolOwners.setDescription('This object indicates the protocols used by multicast route owner to learn this route information.')
cotv_mcast_route_info_metric = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 5, 3, 1, 10), unsigned32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
cotvMcastRouteInfoMetric.setStatus('current')
if mibBuilder.loadTexts:
cotvMcastRouteInfoMetric.setDescription('This object indicates the metric associated with this multicast route.')
cotv_mcast_route_info_up_time = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 5, 3, 1, 11), unsigned32()).setUnits('seconds').setMaxAccess('readonly')
if mibBuilder.loadTexts:
cotvMcastRouteInfoUpTime.setStatus('current')
if mibBuilder.loadTexts:
cotvMcastRouteInfoUpTime.setDescription('This object indicates the amount of time elapsed since this multicast route entry was installed in this table.')
cisco_otv_mib_compliances = mib_identifier((1, 3, 6, 1, 4, 1, 9, 9, 810, 2, 1))
cisco_otv_mib_groups = mib_identifier((1, 3, 6, 1, 4, 1, 9, 9, 810, 2, 2))
cisco_otv_mib_compliance = module_compliance((1, 3, 6, 1, 4, 1, 9, 9, 810, 2, 1, 1)).setObjects(('CISCO-OTV-MIB', 'ciscoOtvSiteGroup'), ('CISCO-OTV-MIB', 'ciscoOtvOverlayGroup'), ('CISCO-OTV-MIB', 'ciscoOtvVlanGroup'), ('CISCO-OTV-MIB', 'ciscoOtvDataGroupConfigGroup'), ('CISCO-OTV-MIB', 'ciscoOtvDataGroupInfoGroup'), ('CISCO-OTV-MIB', 'ciscoOtvAdjacencyGroup'), ('CISCO-OTV-MIB', 'ciscoOtvArpNdCacheGroup'), ('CISCO-OTV-MIB', 'ciscoOtvRouteGroup'), ('CISCO-OTV-MIB', 'ciscoOtvMcastRouteGroup'), ('CISCO-OTV-MIB', 'ciscoOtvMcastRouteInfoGroup'))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
cisco_otv_mib_compliance = ciscoOtvMIBCompliance.setStatus('current')
if mibBuilder.loadTexts:
ciscoOtvMIBCompliance.setDescription('The compliance statement for CISCO-OTV-MIB.')
cisco_otv_site_group = object_group((1, 3, 6, 1, 4, 1, 9, 9, 810, 2, 2, 1)).setObjects(('CISCO-OTV-MIB', 'cotvSiteIdAdmin'), ('CISCO-OTV-MIB', 'cotvSiteIdOper'), ('CISCO-OTV-MIB', 'cotvSiteVlan'), ('CISCO-OTV-MIB', 'cotvSiteVlanState'))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
cisco_otv_site_group = ciscoOtvSiteGroup.setStatus('current')
if mibBuilder.loadTexts:
ciscoOtvSiteGroup.setDescription('A collection of objects providing OTV site information.')
cisco_otv_overlay_group = object_group((1, 3, 6, 1, 4, 1, 9, 9, 810, 2, 2, 2)).setObjects(('CISCO-OTV-MIB', 'cotvOverlayVpnName'), ('CISCO-OTV-MIB', 'cotvOverlayVpnState'), ('CISCO-OTV-MIB', 'cotvOverlayVpnDownReason'), ('CISCO-OTV-MIB', 'cotvOverlayVlansExtendedFirst2k'), ('CISCO-OTV-MIB', 'cotvOverlayVlansExtendedSecond2k'), ('CISCO-OTV-MIB', 'cotvOverlayControlGroupAddrType'), ('CISCO-OTV-MIB', 'cotvOverlayControlGroupAddr'), ('CISCO-OTV-MIB', 'cotvOverlayBroadcastGroupAddrType'), ('CISCO-OTV-MIB', 'cotvOverlayBroadcastGroupAddr'), ('CISCO-OTV-MIB', 'cotvOverlayJoinInterface'), ('CISCO-OTV-MIB', 'cotvOverlaySourceInterface'), ('CISCO-OTV-MIB', 'cotvOverlayAedCapable'), ('CISCO-OTV-MIB', 'cotvOverlayAedIncapableReason'), ('CISCO-OTV-MIB', 'cotvOverlayAdjServerTransportType'), ('CISCO-OTV-MIB', 'cotvOverlayAdjServerEnable'), ('CISCO-OTV-MIB', 'cotvOverlayPrimaryAdjServerAddrType'), ('CISCO-OTV-MIB', 'cotvOverlayPrimaryAdjServerAddr'), ('CISCO-OTV-MIB', 'cotvOverlaySecondaryAdjServerAddrType'), ('CISCO-OTV-MIB', 'cotvOverlaySecondaryAdjServerAddr'), ('CISCO-OTV-MIB', 'cotvOverlaySuppressArpND'), ('CISCO-OTV-MIB', 'cotvOverlayStorageType'), ('CISCO-OTV-MIB', 'cotvOverlayRowStatus'))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
cisco_otv_overlay_group = ciscoOtvOverlayGroup.setStatus('current')
if mibBuilder.loadTexts:
ciscoOtvOverlayGroup.setDescription('A collection of objects providing OTV overlay information.')
cisco_otv_vlan_group = object_group((1, 3, 6, 1, 4, 1, 9, 9, 810, 2, 2, 3)).setObjects(('CISCO-OTV-MIB', 'cotvVlanState'), ('CISCO-OTV-MIB', 'cotvVlanInactiveReason'), ('CISCO-OTV-MIB', 'cotvVlanAedAddrType'), ('CISCO-OTV-MIB', 'cotvVlanAedAddr'), ('CISCO-OTV-MIB', 'cotvVlanEdgeDevIsAed'))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
cisco_otv_vlan_group = ciscoOtvVlanGroup.setStatus('current')
if mibBuilder.loadTexts:
ciscoOtvVlanGroup.setDescription('A collection of objects providing OTV extended VLANs.')
cisco_otv_data_group_config_group = object_group((1, 3, 6, 1, 4, 1, 9, 9, 810, 2, 2, 4)).setObjects(('CISCO-OTV-MIB', 'cotvDataGroupStorageType'), ('CISCO-OTV-MIB', 'cotvDataGroupRowStatus'))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
cisco_otv_data_group_config_group = ciscoOtvDataGroupConfigGroup.setStatus('current')
if mibBuilder.loadTexts:
ciscoOtvDataGroupConfigGroup.setDescription('A collection of objects providing overlay multicast data-group configuration information.')
cisco_otv_data_group_info_group = object_group((1, 3, 6, 1, 4, 1, 9, 9, 810, 2, 2, 5)).setObjects(('CISCO-OTV-MIB', 'cotvDataGroupJoinInterface'), ('CISCO-OTV-MIB', 'cotvDataGroupLocalActiveSrcState'))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
cisco_otv_data_group_info_group = ciscoOtvDataGroupInfoGroup.setStatus('current')
if mibBuilder.loadTexts:
ciscoOtvDataGroupInfoGroup.setDescription('A collection of objects providing active data-group related information.')
cisco_otv_adjacency_group = object_group((1, 3, 6, 1, 4, 1, 9, 9, 810, 2, 2, 6)).setObjects(('CISCO-OTV-MIB', 'cotvAdjacentDevSystemID'), ('CISCO-OTV-MIB', 'cotvAdjacentDevName'), ('CISCO-OTV-MIB', 'cotvAdjacentDevState'), ('CISCO-OTV-MIB', 'cotvAdjacentDevUpTime'))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
cisco_otv_adjacency_group = ciscoOtvAdjacencyGroup.setStatus('current')
if mibBuilder.loadTexts:
ciscoOtvAdjacencyGroup.setDescription('A collection of objects providing information about OTV Adjacency Database.')
cisco_otv_arp_nd_cache_group = object_group((1, 3, 6, 1, 4, 1, 9, 9, 810, 2, 2, 7)).setObjects(('CISCO-OTV-MIB', 'cotvArpNdCacheMacAddr'), ('CISCO-OTV-MIB', 'cotvArpNdCacheAge'), ('CISCO-OTV-MIB', 'cotvArpNdCacheTimeToExpire'))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
cisco_otv_arp_nd_cache_group = ciscoOtvArpNdCacheGroup.setStatus('current')
if mibBuilder.loadTexts:
ciscoOtvArpNdCacheGroup.setDescription('A collection of objects providing ARP/ND cache information.')
cisco_otv_route_group = object_group((1, 3, 6, 1, 4, 1, 9, 9, 810, 2, 2, 8)).setObjects(('CISCO-OTV-MIB', 'cotvRouteMetric'), ('CISCO-OTV-MIB', 'cotvRouteUpTime'), ('CISCO-OTV-MIB', 'cotvRouteOwner'), ('CISCO-OTV-MIB', 'cotvRouteNextHopIf'), ('CISCO-OTV-MIB', 'cotvRouteNextHopAddrType'), ('CISCO-OTV-MIB', 'cotvRouteNextHopAddr'))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
cisco_otv_route_group = ciscoOtvRouteGroup.setStatus('current')
if mibBuilder.loadTexts:
ciscoOtvRouteGroup.setDescription('A collection of objects providing information about unicast routes in ORIB.')
cisco_otv_mcast_route_group = object_group((1, 3, 6, 1, 4, 1, 9, 9, 810, 2, 2, 9)).setObjects(('CISCO-OTV-MIB', 'cotvMcastRouteOwners'), ('CISCO-OTV-MIB', 'cotvMcastRouteMetric'), ('CISCO-OTV-MIB', 'cotvMcastRouteUpTime'))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
cisco_otv_mcast_route_group = ciscoOtvMcastRouteGroup.setStatus('current')
if mibBuilder.loadTexts:
ciscoOtvMcastRouteGroup.setDescription('A collection of objects providing information about multicast routes in ORIB.')
cisco_otv_mcast_route_info_group = object_group((1, 3, 6, 1, 4, 1, 9, 9, 810, 2, 2, 10)).setObjects(('CISCO-OTV-MIB', 'cotvMcastRouteInfoHostAddrType'), ('CISCO-OTV-MIB', 'cotvMcastRouteInfoHostAddr'), ('CISCO-OTV-MIB', 'cotvMcastRouteInfoProtocolOwners'), ('CISCO-OTV-MIB', 'cotvMcastRouteInfoMetric'), ('CISCO-OTV-MIB', 'cotvMcastRouteInfoUpTime'))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
cisco_otv_mcast_route_info_group = ciscoOtvMcastRouteInfoGroup.setStatus('current')
if mibBuilder.loadTexts:
ciscoOtvMcastRouteInfoGroup.setDescription('A collection of objects providing interface level information for multicast routes in ORIB.')
mibBuilder.exportSymbols('CISCO-OTV-MIB', cotvDataGroupActiveSrcLocation=cotvDataGroupActiveSrcLocation, cotvMcastRouteInfoActiveGroupAddrType=cotvMcastRouteInfoActiveGroupAddrType, cotvMcastRouteInfoTable=cotvMcastRouteInfoTable, cotvArpNdCacheMacAddr=cotvArpNdCacheMacAddr, ciscoOtvMIBNotifs=ciscoOtvMIBNotifs, cotvOverlayBroadcastGroupAddr=cotvOverlayBroadcastGroupAddr, cotvArpNdCacheL3Addr=cotvArpNdCacheL3Addr, cotvOverlayAedCapable=cotvOverlayAedCapable, cotvDataGroupActiveSrcAddrType=cotvDataGroupActiveSrcAddrType, cotvMcastRouteInfoActiveSrcAddrType=cotvMcastRouteInfoActiveSrcAddrType, cotvArpNdCacheEntry=cotvArpNdCacheEntry, cotvVlansTable=cotvVlansTable, cotvRouteEntry=cotvRouteEntry, cotvDataGroupDeliveryGroupAddrType=cotvDataGroupDeliveryGroupAddrType, cotvVlanId=cotvVlanId, PYSNMP_MODULE_ID=ciscoOtvMIB, ciscoOtvMIBGroups=ciscoOtvMIBGroups, cotvOverlayControlGroupAddrType=cotvOverlayControlGroupAddrType, cotvDataGroupDeliverySrcAddr=cotvDataGroupDeliverySrcAddr, cotvDataGroupLocalActiveSrcState=cotvDataGroupLocalActiveSrcState, cotvRouteNextHopAddrType=cotvRouteNextHopAddrType, cotvMcastRouteInfoMetric=cotvMcastRouteInfoMetric, cotvAdjacentDevUpTime=cotvAdjacentDevUpTime, cotvVlanState=cotvVlanState, cotvRouteNextHopIf=cotvRouteNextHopIf, cotvMcastRouteInfoProtocolOwners=cotvMcastRouteInfoProtocolOwners, cotvArpNdCacheTable=cotvArpNdCacheTable, ciscoOtvMcastRouteInfoGroup=ciscoOtvMcastRouteInfoGroup, cotvDataGroupMcastRangeAddrType=cotvDataGroupMcastRangeAddrType, ciscoOtvMIBCompliance=ciscoOtvMIBCompliance, cotvRouteUpTime=cotvRouteUpTime, cotvMcastRouteOwners=cotvMcastRouteOwners, cotvOverlayVpnDownReason=cotvOverlayVpnDownReason, cotvVlansEntry=cotvVlansEntry, cotvDataGroupActiveGroupAddr=cotvDataGroupActiveGroupAddr, cotvOverlayVpnState=cotvOverlayVpnState, cotvOverlaySecondaryAdjServerAddrType=cotvOverlaySecondaryAdjServerAddrType, cotvOverlayAedIncapableReason=cotvOverlayAedIncapableReason, cotvSiteObjects=cotvSiteObjects, ciscoOtvArpNdCacheGroup=ciscoOtvArpNdCacheGroup, cotvAdjacentDevSystemID=cotvAdjacentDevSystemID, cotvMcastRouteEntry=cotvMcastRouteEntry, ciscoOtvMIBObjects=ciscoOtvMIBObjects, cotvMcastRouteTable=cotvMcastRouteTable, cotvVlanAedAddrType=cotvVlanAedAddrType, cotvVlanInactiveReason=cotvVlanInactiveReason, ciscoOtvSiteGroup=ciscoOtvSiteGroup, cotvDataGroupMcastRangeAddr=cotvDataGroupMcastRangeAddr, cotvOverlaySecondaryAdjServerAddr=cotvOverlaySecondaryAdjServerAddr, cotvAdjacentDevName=cotvAdjacentDevName, ciscoOtvMIBConform=ciscoOtvMIBConform, cotvRouteTable=cotvRouteTable, cotvMcastRouteInfoIf=cotvMcastRouteInfoIf, cotvMcastRouteInfoHostAddrType=cotvMcastRouteInfoHostAddrType, cotvDataGroupMcastRangePrefixLength=cotvDataGroupMcastRangePrefixLength, cotvSiteVlanState=cotvSiteVlanState, ciscoOtvDataGroupConfigGroup=ciscoOtvDataGroupConfigGroup, cotvSiteIdOper=cotvSiteIdOper, cotvDataGroupActiveSrcAddr=cotvDataGroupActiveSrcAddr, cotvOverlayControlGroupAddr=cotvOverlayControlGroupAddr, cotvVlanAedAddr=cotvVlanAedAddr, cotvMcastRouteInfoActiveSrcAddr=cotvMcastRouteInfoActiveSrcAddr, cotvDataGroupRowStatus=cotvDataGroupRowStatus, cotvOverlayVlansExtendedSecond2k=cotvOverlayVlansExtendedSecond2k, cotvOverlayJoinInterface=cotvOverlayJoinInterface, cotvMcastRouteMetric=cotvMcastRouteMetric, cotvAdjacentDevAddrType=cotvAdjacentDevAddrType, ciscoOtvMIB=ciscoOtvMIB, cotvDataGroupDeliverySrcAddrType=cotvDataGroupDeliverySrcAddrType, cotvDataGroupStorageType=cotvDataGroupStorageType, cotvOverlayNumber=cotvOverlayNumber, cotvMcastRouteUpTime=cotvMcastRouteUpTime, cotvOverlayRowStatus=cotvOverlayRowStatus, cotvOverlayBroadcastGroupAddrType=cotvOverlayBroadcastGroupAddrType, cotvMcastRouteInfoVlanId=cotvMcastRouteInfoVlanId, cotvDataGroupDeliveryGroupAddr=cotvDataGroupDeliveryGroupAddr, cotvAdjacencyObjects=cotvAdjacencyObjects, cotvOverlayPrimaryAdjServerAddrType=cotvOverlayPrimaryAdjServerAddrType, cotvMcastRouteInfoEntry=cotvMcastRouteInfoEntry, cotvMcastRouteActiveGroupAddrType=cotvMcastRouteActiveGroupAddrType, cotvOverlayAdjServerTransportType=cotvOverlayAdjServerTransportType, cotvRouteMacAddr=cotvRouteMacAddr, ciscoOtvMIBCompliances=ciscoOtvMIBCompliances, cotvOverlayVlansExtendedFirst2k=cotvOverlayVlansExtendedFirst2k, cotvOverlaySourceInterface=cotvOverlaySourceInterface, ciscoOtvVlanGroup=ciscoOtvVlanGroup, cotvArpNdCacheL3AddrType=cotvArpNdCacheL3AddrType, cotvSiteVlan=cotvSiteVlan, cotvDataGroupJoinInterface=cotvDataGroupJoinInterface, ciscoOtvRouteGroup=ciscoOtvRouteGroup, cotvAdjacentDevState=cotvAdjacentDevState, cotvDataGroupVlanId=cotvDataGroupVlanId, cotvOverlayStorageType=cotvOverlayStorageType, cotvArpNdCacheTimeToExpire=cotvArpNdCacheTimeToExpire, cotvMcastRouteActiveSrcAddr=cotvMcastRouteActiveSrcAddr, ciscoOtvAdjacencyGroup=ciscoOtvAdjacencyGroup, cotvMcastRouteVlanId=cotvMcastRouteVlanId, cotvOverlayVpnName=cotvOverlayVpnName, cotvRouteOwner=cotvRouteOwner, ciscoOtvMcastRouteGroup=ciscoOtvMcastRouteGroup, cotvDataGroupInfoEntry=cotvDataGroupInfoEntry, cotvDataGroupActiveGroupAddrType=cotvDataGroupActiveGroupAddrType, cotvRouteObjects=cotvRouteObjects, cotvMcastRouteActiveGroupAddr=cotvMcastRouteActiveGroupAddr, cotvOverlayPrimaryAdjServerAddr=cotvOverlayPrimaryAdjServerAddr, cotvMcastRouteActiveSrcAddrType=cotvMcastRouteActiveSrcAddrType, cotvGlobalStatsObjects=cotvGlobalStatsObjects, cotvAdjacencyDatabaseTable=cotvAdjacencyDatabaseTable, cotvRouteNextHopAddr=cotvRouteNextHopAddr, cotvArpNdObjects=cotvArpNdObjects, cotvGlobalObjects=cotvGlobalObjects, cotvMcastRouteInfoUpTime=cotvMcastRouteInfoUpTime, cotvSiteIdAdmin=cotvSiteIdAdmin, cotvRouteMetric=cotvRouteMetric, cotvOverlayObjects=cotvOverlayObjects, cotvOverlayEntry=cotvOverlayEntry, cotvOverlayTable=cotvOverlayTable, cotvMcastRouteInfoHostAddr=cotvMcastRouteInfoHostAddr, cotvRouteVlanId=cotvRouteVlanId, cotvDataGroupConfigTable=cotvDataGroupConfigTable, cotvOverlaySuppressArpND=cotvOverlaySuppressArpND, cotvVlanEdgeDevIsAed=cotvVlanEdgeDevIsAed, ciscoOtvDataGroupInfoGroup=ciscoOtvDataGroupInfoGroup, cotvArpNdCacheAge=cotvArpNdCacheAge, ciscoOtvOverlayGroup=ciscoOtvOverlayGroup, cotvAdjacencyDatabaseEntry=cotvAdjacencyDatabaseEntry, cotvAdjacentDevAddr=cotvAdjacentDevAddr, cotvOverlayAdjServerEnable=cotvOverlayAdjServerEnable, cotvDataGroupConfigEntry=cotvDataGroupConfigEntry, cotvMcastRouteInfoActiveGroupAddr=cotvMcastRouteInfoActiveGroupAddr, cotvDataGroupInfoTable=cotvDataGroupInfoTable)
|
class ServerError(Exception):
def __init__(self, details, model, response):
self.details = details
self.model = model
self.response = response
super(ServerError, self).__init__(self.details)
def encode(self):
return {
"details": self.details,
"expected": str(self.model),
"actual": self.response
}
class BadRequest(Exception):
def __init__(self, message, **kwargs):
self.kwargs = kwargs
self.message = message
def encode(self):
encoded ={"details": self.message}
encoded.update(self.kwargs)
return encoded
|
class Servererror(Exception):
def __init__(self, details, model, response):
self.details = details
self.model = model
self.response = response
super(ServerError, self).__init__(self.details)
def encode(self):
return {'details': self.details, 'expected': str(self.model), 'actual': self.response}
class Badrequest(Exception):
def __init__(self, message, **kwargs):
self.kwargs = kwargs
self.message = message
def encode(self):
encoded = {'details': self.message}
encoded.update(self.kwargs)
return encoded
|
"""
jsonable.py:
Folder with helper methods that allow for seamless conversion of F prime types to JSON types. This allows us to produce
data in JSON format with ease, assuming that the correct encoder is registered.
Note: JSON types must use only the following data types
1. booleans
2. numbers
3. strings
4. lists
5. anonymous objects (dictionaries)
@author mstarch
"""
def fprime_to_jsonable(obj):
"""
Takes an F prime object and converts it to a jsonable type.
:param obj: object to convert
:return: object in jsonable format (can call json.dump(obj))
"""
# Otherwise try and scrape all "get_" getters in a smart way
anonymous = {}
getters = [attr for attr in dir(obj) if attr.startswith("get_")]
for getter in getters:
# Call the get_ functions, and call all non-static methods
try:
func = getattr(obj, getter)
item = func()
# If there is a property named "args" it needs to be handled specifically unless an incoming command
if (
getter == "get_args"
and not "fprime_gds.common.data_types.cmd_data.CmdData"
in str(type(obj))
):
args = []
for arg_spec in item:
arg_dict = {
"name": arg_spec[0],
"description": arg_spec[1],
"value": arg_spec[2].val,
"type": str(arg_spec[2]),
}
if arg_dict["type"] == "Enum":
arg_dict["possible"] = arg_spec[2].keys()
args.append(arg_dict)
# Fill in our special handling
item = args
anonymous[getter.replace("get_", "")] = item
except TypeError:
continue
return anonymous
|
"""
jsonable.py:
Folder with helper methods that allow for seamless conversion of F prime types to JSON types. This allows us to produce
data in JSON format with ease, assuming that the correct encoder is registered.
Note: JSON types must use only the following data types
1. booleans
2. numbers
3. strings
4. lists
5. anonymous objects (dictionaries)
@author mstarch
"""
def fprime_to_jsonable(obj):
"""
Takes an F prime object and converts it to a jsonable type.
:param obj: object to convert
:return: object in jsonable format (can call json.dump(obj))
"""
anonymous = {}
getters = [attr for attr in dir(obj) if attr.startswith('get_')]
for getter in getters:
try:
func = getattr(obj, getter)
item = func()
if getter == 'get_args' and (not 'fprime_gds.common.data_types.cmd_data.CmdData' in str(type(obj))):
args = []
for arg_spec in item:
arg_dict = {'name': arg_spec[0], 'description': arg_spec[1], 'value': arg_spec[2].val, 'type': str(arg_spec[2])}
if arg_dict['type'] == 'Enum':
arg_dict['possible'] = arg_spec[2].keys()
args.append(arg_dict)
item = args
anonymous[getter.replace('get_', '')] = item
except TypeError:
continue
return anonymous
|
# Ariant Treasure Vault Entrance (915020100) => Ariant Treasure Vault
if 2400 <= chr.getJob() <= 2412 and not sm.hasMobsInField():
sm.warp(915020101, 1)
elif sm.hasMobsInField():
sm.chat("Eliminate all of the intruders first.")
|
if 2400 <= chr.getJob() <= 2412 and (not sm.hasMobsInField()):
sm.warp(915020101, 1)
elif sm.hasMobsInField():
sm.chat('Eliminate all of the intruders first.')
|
# Copyright (c) 2011 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
{
'targets': [
{
'target_name': 'libflac',
'product_name': 'flac',
'type': 'static_library',
'sources': [
'include/FLAC/all.h',
'include/FLAC/assert.h',
'include/FLAC/callback.h',
'include/FLAC/export.h',
'include/FLAC/format.h',
'include/FLAC/metadata.h',
'include/FLAC/ordinals.h',
'include/FLAC/stream_decoder.h',
'include/FLAC/stream_encoder.h',
'include/share/alloc.h',
'include/share/compat.h',
'include/share/endswap.h',
'include/share/private.h',
'src/libFLAC/alloc.c',
'src/libFLAC/bitmath.c',
'src/libFLAC/bitreader.c',
'src/libFLAC/bitwriter.c',
'src/libFLAC/cpu.c',
'src/libFLAC/crc.c',
'src/libFLAC/fixed.c',
'src/libFLAC/float.c',
'src/libFLAC/format.c',
'src/libFLAC/lpc.c',
'src/libFLAC/md5.c',
'src/libFLAC/memory.c',
'src/libFLAC/stream_decoder.c',
'src/libFLAC/stream_encoder.c',
'src/libFLAC/stream_encoder_framing.c',
'src/libFLAC/window.c',
'src/libFLAC/include/private/all.h',
'src/libFLAC/include/private/bitmath.h',
'src/libFLAC/include/private/bitreader.h',
'src/libFLAC/include/private/bitwriter.h',
'src/libFLAC/include/private/cpu.h',
'src/libFLAC/include/private/crc.h',
'src/libFLAC/include/private/fixed.h',
'src/libFLAC/include/private/float.h',
'src/libFLAC/include/private/format.h',
'src/libFLAC/include/private/lpc.h',
'src/libFLAC/include/private/macros.h',
'src/libFLAC/include/private/md5.h',
'src/libFLAC/include/private/memory.h',
'src/libFLAC/include/private/metadata.h',
'src/libFLAC/include/private/stream_encoder.h',
'src/libFLAC/include/private/stream_encoder_framing.h',
'src/libFLAC/include/private/window.h',
'src/libFLAC/include/protected/all.h',
'src/libFLAC/include/protected/stream_decoder.h',
'src/libFLAC/include/protected/stream_encoder.h',
],
'defines': [
'FLAC__NO_DLL',
'FLAC__OVERFLOW_DETECT',
'VERSION="1.3.1"',
'HAVE_LROUND',
],
'conditions': [
['OS=="win"', {
'sources': [
'include/share/win_utf8_io.h',
'src/share/win_utf8_io/win_utf8_io.c',
],
'defines!': [
'WIN32_LEAN_AND_MEAN', # win_utf8_io.c defines this itself.
],
'msvs_settings': {
'VCCLCompilerTool': {
'AdditionalOptions': [
'/wd4334', # 32-bit shift converted to 64 bits.
'/wd4267', # Converting from size_t to unsigned on 64-bit.
],
},
},
}, {
'defines': [
'HAVE_INTTYPES_H',
],
}],
],
'include_dirs': [
'include',
'src/libFLAC/include',
],
'direct_dependent_settings': {
'defines': [
'FLAC__NO_DLL',
],
},
'variables': {
'clang_warning_flags': [
# libflac converts between FLAC__StreamDecoderState and
# FLAC__StreamDecoderInitStatus a lot in stream_decoder.c.
'-Wno-conversion',
# libflac contains constants that are only used in certain
# compile-time cases, which triggers unused-const-variable warnings in
# other cases.
'-Wno-unused-const-variable',
],
},
},
],
}
# Local Variables:
# tab-width:2
# indent-tabs-mode:nil
# End:
# vim: set expandtab tabstop=2 shiftwidth=2:
|
{'targets': [{'target_name': 'libflac', 'product_name': 'flac', 'type': 'static_library', 'sources': ['include/FLAC/all.h', 'include/FLAC/assert.h', 'include/FLAC/callback.h', 'include/FLAC/export.h', 'include/FLAC/format.h', 'include/FLAC/metadata.h', 'include/FLAC/ordinals.h', 'include/FLAC/stream_decoder.h', 'include/FLAC/stream_encoder.h', 'include/share/alloc.h', 'include/share/compat.h', 'include/share/endswap.h', 'include/share/private.h', 'src/libFLAC/alloc.c', 'src/libFLAC/bitmath.c', 'src/libFLAC/bitreader.c', 'src/libFLAC/bitwriter.c', 'src/libFLAC/cpu.c', 'src/libFLAC/crc.c', 'src/libFLAC/fixed.c', 'src/libFLAC/float.c', 'src/libFLAC/format.c', 'src/libFLAC/lpc.c', 'src/libFLAC/md5.c', 'src/libFLAC/memory.c', 'src/libFLAC/stream_decoder.c', 'src/libFLAC/stream_encoder.c', 'src/libFLAC/stream_encoder_framing.c', 'src/libFLAC/window.c', 'src/libFLAC/include/private/all.h', 'src/libFLAC/include/private/bitmath.h', 'src/libFLAC/include/private/bitreader.h', 'src/libFLAC/include/private/bitwriter.h', 'src/libFLAC/include/private/cpu.h', 'src/libFLAC/include/private/crc.h', 'src/libFLAC/include/private/fixed.h', 'src/libFLAC/include/private/float.h', 'src/libFLAC/include/private/format.h', 'src/libFLAC/include/private/lpc.h', 'src/libFLAC/include/private/macros.h', 'src/libFLAC/include/private/md5.h', 'src/libFLAC/include/private/memory.h', 'src/libFLAC/include/private/metadata.h', 'src/libFLAC/include/private/stream_encoder.h', 'src/libFLAC/include/private/stream_encoder_framing.h', 'src/libFLAC/include/private/window.h', 'src/libFLAC/include/protected/all.h', 'src/libFLAC/include/protected/stream_decoder.h', 'src/libFLAC/include/protected/stream_encoder.h'], 'defines': ['FLAC__NO_DLL', 'FLAC__OVERFLOW_DETECT', 'VERSION="1.3.1"', 'HAVE_LROUND'], 'conditions': [['OS=="win"', {'sources': ['include/share/win_utf8_io.h', 'src/share/win_utf8_io/win_utf8_io.c'], 'defines!': ['WIN32_LEAN_AND_MEAN'], 'msvs_settings': {'VCCLCompilerTool': {'AdditionalOptions': ['/wd4334', '/wd4267']}}}, {'defines': ['HAVE_INTTYPES_H']}]], 'include_dirs': ['include', 'src/libFLAC/include'], 'direct_dependent_settings': {'defines': ['FLAC__NO_DLL']}, 'variables': {'clang_warning_flags': ['-Wno-conversion', '-Wno-unused-const-variable']}}]}
|
class LUISEmulator(object):
def __init__(self):
self.name='luis'
def normalise_request_json(self,data):
_data = {}
_data["text"]=data['q'][0]
return _data
def normalise_response_json(self,data):
return {
"query": data["text"],
"topScoringIntent": {
"intent": "inform",
"score": None
},
"entities": [
{
"entity": e[0],
"type": e[1],
"startIndex": None,
"endIndex": None,
"score": None
} for e in data["entities"]
]
}
|
class Luisemulator(object):
def __init__(self):
self.name = 'luis'
def normalise_request_json(self, data):
_data = {}
_data['text'] = data['q'][0]
return _data
def normalise_response_json(self, data):
return {'query': data['text'], 'topScoringIntent': {'intent': 'inform', 'score': None}, 'entities': [{'entity': e[0], 'type': e[1], 'startIndex': None, 'endIndex': None, 'score': None} for e in data['entities']]}
|
def test_vm_reconfigured(controller, vm_service, vn_service, vmi_service, vrouter_port_service,
vm_reconfigured_update):
controller.handle_update(vm_reconfigured_update)
vm_service.update_vm_models_interfaces.assert_called_once()
vn_service.update_vns.assert_called_once()
vmi_service.update_vmis.assert_called_once()
vrouter_port_service.sync_ports.assert_called_once()
|
def test_vm_reconfigured(controller, vm_service, vn_service, vmi_service, vrouter_port_service, vm_reconfigured_update):
controller.handle_update(vm_reconfigured_update)
vm_service.update_vm_models_interfaces.assert_called_once()
vn_service.update_vns.assert_called_once()
vmi_service.update_vmis.assert_called_once()
vrouter_port_service.sync_ports.assert_called_once()
|
"""
Module: 'flowlib.units._adc' on M5 FlowUI v1.4.0-beta
"""
# MCU: (sysname='esp32', nodename='esp32', release='1.11.0', version='v1.11-284-g5d8e1c867 on 2019-08-30', machine='ESP32 module with ESP32')
# Stubber: 1.3.1
ADDRESS = 72
class Adc:
''
def _available():
pass
def _read_u16():
pass
def _write_u8():
pass
def deinit():
pass
def measure_set():
pass
voltage = None
GAIN_EIGHT = 3
GAIN_FOUR = 2
GAIN_ONE = 0
GAIN_TWO = 1
MODE_CONTIN = 0
MODE_SINGLE = 16
OSMODE_STATE = 128
RATE_15 = 12
RATE_240 = 0
RATE_30 = 8
RATE_60 = 4
def const():
pass
i2c_bus = None
struct = None
unit = None
|
"""
Module: 'flowlib.units._adc' on M5 FlowUI v1.4.0-beta
"""
address = 72
class Adc:
""""""
def _available():
pass
def _read_u16():
pass
def _write_u8():
pass
def deinit():
pass
def measure_set():
pass
voltage = None
gain_eight = 3
gain_four = 2
gain_one = 0
gain_two = 1
mode_contin = 0
mode_single = 16
osmode_state = 128
rate_15 = 12
rate_240 = 0
rate_30 = 8
rate_60 = 4
def const():
pass
i2c_bus = None
struct = None
unit = None
|
with open('lexical.csv') as f:
string=f.read()
arr=string.split('\n')
arr=arr[:10000]
result='\n'.join(arr)
with open('sub.csv','w') as f:
f.write(result)
|
with open('lexical.csv') as f:
string = f.read()
arr = string.split('\n')
arr = arr[:10000]
result = '\n'.join(arr)
with open('sub.csv', 'w') as f:
f.write(result)
|
# program to restore the original string by entering the compressed string with this rule. However,
# the # character does not appear in the restored character string.
def restore_original_str(a1):
result = ""
ind = 0
end = len(a1)
while ind < end:
if a1[ind] == "#":
result += a1[ind + 2] * int(a1[ind + 1])
ind += 3
else:
result += a1[ind]
ind += 1
return result
print("Original text:","XY#6Z1#4023")
print(restore_original_str("XY#6Z1#4023"))
print("Original text:","#39+1=1#30")
print(restore_original_str("#39+1=1#30"))
|
def restore_original_str(a1):
result = ''
ind = 0
end = len(a1)
while ind < end:
if a1[ind] == '#':
result += a1[ind + 2] * int(a1[ind + 1])
ind += 3
else:
result += a1[ind]
ind += 1
return result
print('Original text:', 'XY#6Z1#4023')
print(restore_original_str('XY#6Z1#4023'))
print('Original text:', '#39+1=1#30')
print(restore_original_str('#39+1=1#30'))
|
# Given an array of integers, every element appears twice except for one. Find that single one.
#
# Note:
# Your algorithm should have a linear runtime complexity. Could you implement it without using extra memory?
#
# Python, Python3 all accepted.
class SingleNumber:
def singleNumber(self, nums):
"""
:type nums: List[int]
:rtype: int
"""
s = 0
if nums is None:
return s
for i in nums:
s ^= i
return s
|
class Singlenumber:
def single_number(self, nums):
"""
:type nums: List[int]
:rtype: int
"""
s = 0
if nums is None:
return s
for i in nums:
s ^= i
return s
|
def example2(n):
h = lambda : print(n)
return(h)
ourfunc = example2(5)
ourfunc()
|
def example2(n):
h = lambda : print(n)
return h
ourfunc = example2(5)
ourfunc()
|
# -*- coding: utf-8 -*-
""" Platform specific utility functions, dummy version
This has empty implementation of the platutils functions, used for
unsupported operating systems.
Authors
-------
- Ville Vainio <vivainio@gmail.com>
"""
#*****************************************************************************
# Copyright (C) 2008-2009 The IPython Development Team
# Copyright (C) 2001-2007 Fernando Perez <fperez@colorado.edu>
#
# Distributed under the terms of the BSD License. The full license is in
# the file COPYING, distributed as part of this software.
#*****************************************************************************
# This variable is part of the expected API of the module:
ignore_termtitle = True
def set_term_title(*args,**kw):
"""Dummy no-op."""
pass
def find_cmd(cmd):
"""Find the full path to a command using which."""
return os.popen('which %s' % cmd).read().strip()
def get_long_path_name(path):
"""Dummy no-op."""
return path
|
""" Platform specific utility functions, dummy version
This has empty implementation of the platutils functions, used for
unsupported operating systems.
Authors
-------
- Ville Vainio <vivainio@gmail.com>
"""
ignore_termtitle = True
def set_term_title(*args, **kw):
"""Dummy no-op."""
pass
def find_cmd(cmd):
"""Find the full path to a command using which."""
return os.popen('which %s' % cmd).read().strip()
def get_long_path_name(path):
"""Dummy no-op."""
return path
|
"""Axes behaviour."""
def lines(
*,
base_width=0.5,
line_base_ratio=2.0,
tick_major_base_ratio=1.0,
tick_minor_base_ratio=0.5,
tick_size_width_ratio=3.0,
tick_major_size_min=3.0,
tick_minor_size_min=2.0,
axisbelow=True,
):
"""Adjust linewidth(s) according to a base width."""
tick_major_width = tick_major_base_ratio * base_width
tick_minor_width = tick_minor_base_ratio * base_width
tick_major_size = max(tick_major_size_min, tick_size_width_ratio * tick_major_width)
tick_minor_size = max(tick_minor_size_min, tick_size_width_ratio * tick_minor_width)
return {
# Set the line-widths appropriately (including the grid)
"axes.linewidth": base_width,
"lines.linewidth": line_base_ratio * base_width,
"xtick.major.width": tick_major_width,
"ytick.major.width": tick_major_width,
"xtick.minor.width": tick_minor_width,
"ytick.minor.width": tick_minor_width,
"xtick.major.size": tick_major_size,
"ytick.major.size": tick_major_size,
"xtick.minor.size": tick_minor_size,
"ytick.minor.size": tick_minor_size,
"grid.linewidth": base_width,
# Legend frame linewidth
"patch.linewidth": base_width,
"legend.edgecolor": "inherit", # inherit color from axes. passing 'color' leads to awkward future warnings.
# Control the zorder of the ticks and gridlines
# This is somewhat out of place in this function, but creating a new function
# seems a bit unnecessary here... suggestions welcome!
"axes.axisbelow": axisbelow,
}
def grid(*, grid_alpha=0.2, grid_linestyle="solid"):
"""Adjust the grid-style."""
return {
# Update the linestyle of the grid
# (it shares a color with the frame, and needs to be distinguishable)
"grid.linestyle": grid_linestyle,
"grid.alpha": grid_alpha,
}
def legend(*, shadow=False, frameon=True, fancybox=False):
"""Adjust the legend-style."""
return {
"legend.shadow": shadow,
"legend.frameon": frameon,
"legend.fancybox": fancybox,
}
def color(*, base="black", face="none"):
"""Adjust the axes' color."""
return {
"text.color": base,
"axes.edgecolor": base,
"axes.labelcolor": base,
"xtick.color": base,
"ytick.color": base,
"grid.color": base,
"axes.facecolor": face,
}
def spines(*, left=True, right=True, top=True, bottom=True):
"""Adjust the visibility of the axes' spines."""
return {
"axes.spines.left": left,
"axes.spines.right": right,
"axes.spines.top": top,
"axes.spines.bottom": bottom,
}
def tick_direction(*, x="inout", y="inout"):
"""Adjust the tick direction."""
return {
"xtick.direction": x,
"ytick.direction": y,
}
|
"""Axes behaviour."""
def lines(*, base_width=0.5, line_base_ratio=2.0, tick_major_base_ratio=1.0, tick_minor_base_ratio=0.5, tick_size_width_ratio=3.0, tick_major_size_min=3.0, tick_minor_size_min=2.0, axisbelow=True):
"""Adjust linewidth(s) according to a base width."""
tick_major_width = tick_major_base_ratio * base_width
tick_minor_width = tick_minor_base_ratio * base_width
tick_major_size = max(tick_major_size_min, tick_size_width_ratio * tick_major_width)
tick_minor_size = max(tick_minor_size_min, tick_size_width_ratio * tick_minor_width)
return {'axes.linewidth': base_width, 'lines.linewidth': line_base_ratio * base_width, 'xtick.major.width': tick_major_width, 'ytick.major.width': tick_major_width, 'xtick.minor.width': tick_minor_width, 'ytick.minor.width': tick_minor_width, 'xtick.major.size': tick_major_size, 'ytick.major.size': tick_major_size, 'xtick.minor.size': tick_minor_size, 'ytick.minor.size': tick_minor_size, 'grid.linewidth': base_width, 'patch.linewidth': base_width, 'legend.edgecolor': 'inherit', 'axes.axisbelow': axisbelow}
def grid(*, grid_alpha=0.2, grid_linestyle='solid'):
"""Adjust the grid-style."""
return {'grid.linestyle': grid_linestyle, 'grid.alpha': grid_alpha}
def legend(*, shadow=False, frameon=True, fancybox=False):
"""Adjust the legend-style."""
return {'legend.shadow': shadow, 'legend.frameon': frameon, 'legend.fancybox': fancybox}
def color(*, base='black', face='none'):
"""Adjust the axes' color."""
return {'text.color': base, 'axes.edgecolor': base, 'axes.labelcolor': base, 'xtick.color': base, 'ytick.color': base, 'grid.color': base, 'axes.facecolor': face}
def spines(*, left=True, right=True, top=True, bottom=True):
"""Adjust the visibility of the axes' spines."""
return {'axes.spines.left': left, 'axes.spines.right': right, 'axes.spines.top': top, 'axes.spines.bottom': bottom}
def tick_direction(*, x='inout', y='inout'):
"""Adjust the tick direction."""
return {'xtick.direction': x, 'ytick.direction': y}
|
#!/usr/bin/env python
"""
Base class and common functions for compressor implementations.
"""
# pylint: disable=W0311
class BaseProcessor(object):
"Base class for compression processors."
def __init__(self, options, is_request, params):
self.options = options
self.is_request = is_request
name = self.__module__.split(".")[-1]
if params:
self.name = name + " (" + ", ".join(params) + ")"
else:
self.name = name
self.params = params
def compress(self, in_headers, host):
"""
'in_headers' are the headers that will be processed. They are expected
to be a dictionary whose keys are header names (all lowercase), and
whose values are strings. Multiple instances of a header field will
be delimited by \0 (null) characters.
There are a number of special header names, indicated by ':' as the
first character in the name.
'host' is the host header value for the request (or associated request,
if it is a response).
Return value is the resulting compressed headers.
"""
raise NotImplementedError
def decompress(self, compressed):
"""
'compressed' is the compressed headers.
Return value is a header dictionary, as described above.
"""
raise NotImplementedError
def format_http1(frame,
delimiter="\r\n",
valsep=": ",
host='host',
version="HTTP/1.1"):
"""Take the frame and format it as HTTP/1-ish"""
out_frame = []
top_line = ''
avoid_list = []
if ':method' in frame:
top_line = '%s %s %s%s' % (
frame.get(':method',""), frame.get(':path', ""),
frame.get(':version', version), delimiter)
avoid_list = [':method', ':path', ':version']
else:
top_line = '%s %s %s%s' % (
frame.get(':version', version), frame.get(':status',""),
frame.get(':status-text', '?'), delimiter)
avoid_list = [':version', ':status', ':status-text']
out_frame.append(top_line)
for (key, val) in frame.items():
if key in avoid_list:
continue
if key == ':host':
key = host
for individual_val in val.split('\x00'):
out_frame.append(key)
out_frame.append(valsep)
out_frame.append(individual_val)
out_frame.append(delimiter)
out_frame.append(delimiter)
return ''.join(out_frame)
def parse_http1(message, is_request, host='host'):
"""Take a HTTP1 message and return the header structure for it."""
out = {}
lines = message.strip().split("\n")
top_line = lines.pop(0).split(None, 2)
for line in lines:
if not line:
break
if line[0] == ':':
name, value = line[1:].split(":", 1)
name = ":" + name
else:
name, value = line.split(":", 1)
name = name.lower()
if name in out:
out[name] += "\0" + value.strip()
else:
out[name] = value.strip()
if is_request:
out[':method'] = top_line[0]
out[':path'] = top_line[1]
out[':version'] = top_line[2].strip()
if host in out:
out[':host'] = out[host]
del out[host]
else:
out[':version'] = top_line[0]
out[':status'] = top_line[1]
out[':status-text'] = top_line[2].strip()
return out
|
"""
Base class and common functions for compressor implementations.
"""
class Baseprocessor(object):
"""Base class for compression processors."""
def __init__(self, options, is_request, params):
self.options = options
self.is_request = is_request
name = self.__module__.split('.')[-1]
if params:
self.name = name + ' (' + ', '.join(params) + ')'
else:
self.name = name
self.params = params
def compress(self, in_headers, host):
"""
'in_headers' are the headers that will be processed. They are expected
to be a dictionary whose keys are header names (all lowercase), and
whose values are strings. Multiple instances of a header field will
be delimited by \x00 (null) characters.
There are a number of special header names, indicated by ':' as the
first character in the name.
'host' is the host header value for the request (or associated request,
if it is a response).
Return value is the resulting compressed headers.
"""
raise NotImplementedError
def decompress(self, compressed):
"""
'compressed' is the compressed headers.
Return value is a header dictionary, as described above.
"""
raise NotImplementedError
def format_http1(frame, delimiter='\r\n', valsep=': ', host='host', version='HTTP/1.1'):
"""Take the frame and format it as HTTP/1-ish"""
out_frame = []
top_line = ''
avoid_list = []
if ':method' in frame:
top_line = '%s %s %s%s' % (frame.get(':method', ''), frame.get(':path', ''), frame.get(':version', version), delimiter)
avoid_list = [':method', ':path', ':version']
else:
top_line = '%s %s %s%s' % (frame.get(':version', version), frame.get(':status', ''), frame.get(':status-text', '?'), delimiter)
avoid_list = [':version', ':status', ':status-text']
out_frame.append(top_line)
for (key, val) in frame.items():
if key in avoid_list:
continue
if key == ':host':
key = host
for individual_val in val.split('\x00'):
out_frame.append(key)
out_frame.append(valsep)
out_frame.append(individual_val)
out_frame.append(delimiter)
out_frame.append(delimiter)
return ''.join(out_frame)
def parse_http1(message, is_request, host='host'):
"""Take a HTTP1 message and return the header structure for it."""
out = {}
lines = message.strip().split('\n')
top_line = lines.pop(0).split(None, 2)
for line in lines:
if not line:
break
if line[0] == ':':
(name, value) = line[1:].split(':', 1)
name = ':' + name
else:
(name, value) = line.split(':', 1)
name = name.lower()
if name in out:
out[name] += '\x00' + value.strip()
else:
out[name] = value.strip()
if is_request:
out[':method'] = top_line[0]
out[':path'] = top_line[1]
out[':version'] = top_line[2].strip()
if host in out:
out[':host'] = out[host]
del out[host]
else:
out[':version'] = top_line[0]
out[':status'] = top_line[1]
out[':status-text'] = top_line[2].strip()
return out
|
# Outputs the sum of the range of all numbers from 1 to n.
# Source: https://pynative.com/python-program-to-calculate-sum-and-average-of-numbers/
def main():
print("\n")
input_string = input('Enter numbers separated by space ')
print("\n")
# Take input numbers into list
numbers = input_string.split()
# convert each item to int type
for i in range(len(numbers)):
# convert each item to int type
numbers[i] = int(numbers[i])
# Calculating the sum and average
print("Sum = ", sum(numbers))
print("Average = ", sum(numbers) / len(numbers))
if __name__ == '__main__' :
main()
|
def main():
print('\n')
input_string = input('Enter numbers separated by space ')
print('\n')
numbers = input_string.split()
for i in range(len(numbers)):
numbers[i] = int(numbers[i])
print('Sum = ', sum(numbers))
print('Average = ', sum(numbers) / len(numbers))
if __name__ == '__main__':
main()
|
# https://leetcode.com/problems/find-n-unique-integers-sum-up-to-zero/
class Solution:
def sumZero(self, n: int) -> List[int]:
res = []
if n % 2 == 0:
for i in range(1, (n // 2) + 1):
res.append(i)
for i in range(-(n // 2), 0):
res.append(i)
return res
else:
for i in range(1, (n // 2) + 1):
res.append(i)
res.append(0)
for i in range(-(n // 2), 0):
res.append(i)
return res
|
class Solution:
def sum_zero(self, n: int) -> List[int]:
res = []
if n % 2 == 0:
for i in range(1, n // 2 + 1):
res.append(i)
for i in range(-(n // 2), 0):
res.append(i)
return res
else:
for i in range(1, n // 2 + 1):
res.append(i)
res.append(0)
for i in range(-(n // 2), 0):
res.append(i)
return res
|
#
# PySNMP MIB module ARBOR-SMI (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/ARBOR-SMI
# Produced by pysmi-0.3.4 at Mon Apr 29 17:08:55 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 (default, Mar 27 2019, 09:23:15)
#
OctetString, Integer, ObjectIdentifier = mibBuilder.importSymbols("ASN1", "OctetString", "Integer", "ObjectIdentifier")
NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues")
ValueRangeConstraint, ValueSizeConstraint, ConstraintsUnion, ConstraintsIntersection, SingleValueConstraint = mibBuilder.importSymbols("ASN1-REFINEMENT", "ValueRangeConstraint", "ValueSizeConstraint", "ConstraintsUnion", "ConstraintsIntersection", "SingleValueConstraint")
NotificationGroup, ModuleCompliance = mibBuilder.importSymbols("SNMPv2-CONF", "NotificationGroup", "ModuleCompliance")
ModuleIdentity, ObjectIdentity, Counter32, Gauge32, enterprises, Integer32, IpAddress, MibIdentifier, Counter64, NotificationType, iso, MibScalar, MibTable, MibTableRow, MibTableColumn, Unsigned32, TimeTicks, Bits = mibBuilder.importSymbols("SNMPv2-SMI", "ModuleIdentity", "ObjectIdentity", "Counter32", "Gauge32", "enterprises", "Integer32", "IpAddress", "MibIdentifier", "Counter64", "NotificationType", "iso", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "Unsigned32", "TimeTicks", "Bits")
TextualConvention, DisplayString = mibBuilder.importSymbols("SNMPv2-TC", "TextualConvention", "DisplayString")
arbornetworks = ModuleIdentity((1, 3, 6, 1, 4, 1, 9694))
arbornetworks.setRevisions(('2013-08-19 00:00', '2011-07-20 00:00', '2009-03-30 00:00', '2008-11-13 00:00', '2005-09-12 00:00',))
if mibBuilder.loadTexts: arbornetworks.setLastUpdated('201308190000Z')
if mibBuilder.loadTexts: arbornetworks.setOrganization('Arbor Networks, Inc.')
arbornetworksProducts = ObjectIdentity((1, 3, 6, 1, 4, 1, 9694, 1))
if mibBuilder.loadTexts: arbornetworksProducts.setStatus('current')
arborExperimental = ObjectIdentity((1, 3, 6, 1, 4, 1, 9694, 2))
if mibBuilder.loadTexts: arborExperimental.setStatus('current')
mibBuilder.exportSymbols("ARBOR-SMI", arborExperimental=arborExperimental, arbornetworks=arbornetworks, arbornetworksProducts=arbornetworksProducts, PYSNMP_MODULE_ID=arbornetworks)
|
(octet_string, integer, object_identifier) = mibBuilder.importSymbols('ASN1', 'OctetString', 'Integer', 'ObjectIdentifier')
(named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues')
(value_range_constraint, value_size_constraint, constraints_union, constraints_intersection, single_value_constraint) = mibBuilder.importSymbols('ASN1-REFINEMENT', 'ValueRangeConstraint', 'ValueSizeConstraint', 'ConstraintsUnion', 'ConstraintsIntersection', 'SingleValueConstraint')
(notification_group, module_compliance) = mibBuilder.importSymbols('SNMPv2-CONF', 'NotificationGroup', 'ModuleCompliance')
(module_identity, object_identity, counter32, gauge32, enterprises, integer32, ip_address, mib_identifier, counter64, notification_type, iso, mib_scalar, mib_table, mib_table_row, mib_table_column, unsigned32, time_ticks, bits) = mibBuilder.importSymbols('SNMPv2-SMI', 'ModuleIdentity', 'ObjectIdentity', 'Counter32', 'Gauge32', 'enterprises', 'Integer32', 'IpAddress', 'MibIdentifier', 'Counter64', 'NotificationType', 'iso', 'MibScalar', 'MibTable', 'MibTableRow', 'MibTableColumn', 'Unsigned32', 'TimeTicks', 'Bits')
(textual_convention, display_string) = mibBuilder.importSymbols('SNMPv2-TC', 'TextualConvention', 'DisplayString')
arbornetworks = module_identity((1, 3, 6, 1, 4, 1, 9694))
arbornetworks.setRevisions(('2013-08-19 00:00', '2011-07-20 00:00', '2009-03-30 00:00', '2008-11-13 00:00', '2005-09-12 00:00'))
if mibBuilder.loadTexts:
arbornetworks.setLastUpdated('201308190000Z')
if mibBuilder.loadTexts:
arbornetworks.setOrganization('Arbor Networks, Inc.')
arbornetworks_products = object_identity((1, 3, 6, 1, 4, 1, 9694, 1))
if mibBuilder.loadTexts:
arbornetworksProducts.setStatus('current')
arbor_experimental = object_identity((1, 3, 6, 1, 4, 1, 9694, 2))
if mibBuilder.loadTexts:
arborExperimental.setStatus('current')
mibBuilder.exportSymbols('ARBOR-SMI', arborExperimental=arborExperimental, arbornetworks=arbornetworks, arbornetworksProducts=arbornetworksProducts, PYSNMP_MODULE_ID=arbornetworks)
|
# default value from class context
class A:
FOO = 1
def foo(self, param=F<ref>OO):
pass
|
class A:
foo = 1
def foo(self, param=F < ref > OO):
pass
|
class InfectionObserver:
"""
As the output.hdf table for a distributed run has only one row per run,
this data needs to be saved in wide format
For each step, it will have one column for infection prevalence, and one column for infection incidence
"""
def __init__(self):
self.step = 0
self.data = {'prevalence_0': 0, 'incidence_0': 0} # TODO - make it initial prevalence
def setup(self, builder):
self.population_view = builder.population.get_view(['infected'])
builder.event.register_listener('collect_metrics', self.on_collect_metrics)
builder.value.register_value_modifier('metrics', self.metrics)
def on_collect_metrics(self, event):
self.step += 1
pop = self.population_view.get(event.index)
prevalence = pop.infected.mean() # TODO - should it be absolute or relative?
incidence = prevalence - self.data[f'prevalence_{self.step - 1}'] # TODO - should it be the hazard?
self.data[f'prevalence_{self.step}'] = prevalence
self.data[f'incidence_{self.step}'] = incidence
def metrics(self, index, metrics):
# Recall that metrics is a dictionary
for key in self.data.keys():
value = self.data[key]
metrics[key] = value
return metrics
|
class Infectionobserver:
"""
As the output.hdf table for a distributed run has only one row per run,
this data needs to be saved in wide format
For each step, it will have one column for infection prevalence, and one column for infection incidence
"""
def __init__(self):
self.step = 0
self.data = {'prevalence_0': 0, 'incidence_0': 0}
def setup(self, builder):
self.population_view = builder.population.get_view(['infected'])
builder.event.register_listener('collect_metrics', self.on_collect_metrics)
builder.value.register_value_modifier('metrics', self.metrics)
def on_collect_metrics(self, event):
self.step += 1
pop = self.population_view.get(event.index)
prevalence = pop.infected.mean()
incidence = prevalence - self.data[f'prevalence_{self.step - 1}']
self.data[f'prevalence_{self.step}'] = prevalence
self.data[f'incidence_{self.step}'] = incidence
def metrics(self, index, metrics):
for key in self.data.keys():
value = self.data[key]
metrics[key] = value
return metrics
|
class EvaluationTask:
"""EvaluationTask class, containing EvaluationTask information."""
def __init__(self, json, client):
self._json = json
self.id = json["id"]
self.initial_response = getattr(json, "initial_response", None)
self.expected_response = json["expected_response"]
self._client = client
def __hash__(self):
return hash(self.id)
def __str__(self):
return f"EvaluationTask(id={self.id})"
def __repr__(self):
return f"EvaluationTask({self._json})"
def as_dict(self):
"""Returns all attributes as a dictionary"""
return self._json
|
class Evaluationtask:
"""EvaluationTask class, containing EvaluationTask information."""
def __init__(self, json, client):
self._json = json
self.id = json['id']
self.initial_response = getattr(json, 'initial_response', None)
self.expected_response = json['expected_response']
self._client = client
def __hash__(self):
return hash(self.id)
def __str__(self):
return f'EvaluationTask(id={self.id})'
def __repr__(self):
return f'EvaluationTask({self._json})'
def as_dict(self):
"""Returns all attributes as a dictionary"""
return self._json
|
LOREM_IPSUM = """
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna
aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint
occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Sed ut perspiciatis
unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab
illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo. Nemo enim ipsam voluptatem quia
voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem sequi
nesciunt. Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit, sed quia non
numquam eius modi tempora incidunt ut labore et dolore magnam aliquam quaerat voluptatem. Ut enim ad minima veniam,
quis nostrum exercitationem ullam corporis suscipit laboriosam, nisi ut aliquid ex ea commodi consequatur? Quis autem
vel eum iure reprehenderit qui in ea voluptate velit esse quam nihil molestiae consequatur, vel illum qui dolorem eum
fugiat quo voluptas nulla pariatur?
"""
|
lorem_ipsum = '\nLorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna\naliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.\nDuis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint\noccaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Sed ut perspiciatis\nunde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab\nillo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo. Nemo enim ipsam voluptatem quia\nvoluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem sequi\nnesciunt. Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit, sed quia non\nnumquam eius modi tempora incidunt ut labore et dolore magnam aliquam quaerat voluptatem. Ut enim ad minima veniam,\nquis nostrum exercitationem ullam corporis suscipit laboriosam, nisi ut aliquid ex ea commodi consequatur? Quis autem\nvel eum iure reprehenderit qui in ea voluptate velit esse quam nihil molestiae consequatur, vel illum qui dolorem eum\nfugiat quo voluptas nulla pariatur?\n'
|
class Solution:
def climbStairs(self, n: int) -> int:
if n == 1 or n == 0:
return 1
prev, curr = 1, 1
for i in range(2, n + 1):
temp = curr
curr += prev
prev = temp
return curr
|
class Solution:
def climb_stairs(self, n: int) -> int:
if n == 1 or n == 0:
return 1
(prev, curr) = (1, 1)
for i in range(2, n + 1):
temp = curr
curr += prev
prev = temp
return curr
|
#Given two cells of a chessboard. If they are painted in one color, print the word YES, and if in a different color - NO.
r = int(input("Row number of the first cell on Chessboard, r = ?"))
if ((r > 8) or (r < 1)):
print("Invalid row number for a Chessboard!")
exit()
c = int(input("The column number for the first cell on Chessboard, c = ?"))
if((c > 8) or (c <1)):
print("Invalid column number for a Chessboard!")
exit()
R = int(input("THe row number for the second cell on Chessboard, R = ?"))
if ((R > 8) or (R < 1)):
print("Invalid row number for a Chessboard!")
exit()
C = int(input("The column for the second cell on Chessboard, C = ?"))
if ((C > 8) or (C <1 )):
print("Invalid column number for a Chessboard!")
exit()
if ( ( r % 2 == 0) and ( (c % 2 == 0)) )or ( (r % 2 != 0) and (c % 2 != 0)):
if ( ((R %2 == 0)and(C% 2 ==0)) or (( R % 2 != 0)and(C %2 != 0)) ):
print("YES, The two given cells has the SAME color.")
else:
print("NO, The two given cells are NOT the same color")
elif ( ((r % 2 == 0) and(c %2 != 0)) or ((r % 2 != 0) and (c% 2 ==0)) ):
if ( ((R %2 == 0)and(C% 2 !=0)) or (( R % 2 != 0)and(C %2 == 0)) ):
print("YES, The two given cells has the SAME color.")
else:
print("NO, The two given cells are NOT the same color")
exit()
|
r = int(input('Row number of the first cell on Chessboard, r = ?'))
if r > 8 or r < 1:
print('Invalid row number for a Chessboard!')
exit()
c = int(input('The column number for the first cell on Chessboard, c = ?'))
if c > 8 or c < 1:
print('Invalid column number for a Chessboard!')
exit()
r = int(input('THe row number for the second cell on Chessboard, R = ?'))
if R > 8 or R < 1:
print('Invalid row number for a Chessboard!')
exit()
c = int(input('The column for the second cell on Chessboard, C = ?'))
if C > 8 or C < 1:
print('Invalid column number for a Chessboard!')
exit()
if r % 2 == 0 and c % 2 == 0 or (r % 2 != 0 and c % 2 != 0):
if R % 2 == 0 and C % 2 == 0 or (R % 2 != 0 and C % 2 != 0):
print('YES, The two given cells has the SAME color.')
else:
print('NO, The two given cells are NOT the same color')
elif r % 2 == 0 and c % 2 != 0 or (r % 2 != 0 and c % 2 == 0):
if R % 2 == 0 and C % 2 != 0 or (R % 2 != 0 and C % 2 == 0):
print('YES, The two given cells has the SAME color.')
else:
print('NO, The two given cells are NOT the same color')
exit()
|
#!/usr/bin/python3
def sin(x):
"""
sin(x)
"""
return 42
|
def sin(x):
"""
sin(x)
"""
return 42
|
def extractBinhjamin(item):
"""
# Binhjamin
"""
vol, chp, frag, postfix = extractVolChapterFragmentPostfix(item['title'])
if not (vol or chp or frag or postfix):
return False
if ('SRKJ' in item['title'] or 'SRKJ-Sayonara Ryuu' in item['tags']) and (chp or vol):
return buildReleaseMessageWithType(item, 'Sayonara Ryuusei Konnichiwa Jinsei', vol, chp, frag=frag, postfix=postfix)
if 'Unborn' in item['title']:
return buildReleaseMessageWithType(item, 'Unborn', vol, chp, frag=frag, postfix=postfix)
if 'Bu ni Mi' in item['title'] or '100 Years Of Martial Arts' in item['title']:
return buildReleaseMessageWithType(item, '100 Years Of Martial Arts', vol, chp, frag=frag, postfix=postfix)
return False
|
def extract_binhjamin(item):
"""
# Binhjamin
"""
(vol, chp, frag, postfix) = extract_vol_chapter_fragment_postfix(item['title'])
if not (vol or chp or frag or postfix):
return False
if ('SRKJ' in item['title'] or 'SRKJ-Sayonara Ryuu' in item['tags']) and (chp or vol):
return build_release_message_with_type(item, 'Sayonara Ryuusei Konnichiwa Jinsei', vol, chp, frag=frag, postfix=postfix)
if 'Unborn' in item['title']:
return build_release_message_with_type(item, 'Unborn', vol, chp, frag=frag, postfix=postfix)
if 'Bu ni Mi' in item['title'] or '100 Years Of Martial Arts' in item['title']:
return build_release_message_with_type(item, '100 Years Of Martial Arts', vol, chp, frag=frag, postfix=postfix)
return False
|
def int_to_byte(i):
return i.to_bytes(1, byteorder='big')
def byte_to_int(b):
return int.from_bytes(b, byteorder='big', signed=False)
|
def int_to_byte(i):
return i.to_bytes(1, byteorder='big')
def byte_to_int(b):
return int.from_bytes(b, byteorder='big', signed=False)
|
class ServicePrincipal:
def __init__(self, client_id=None, tenant_id=None, credential=None):
self.client_id = client_id
self.tenant_id = tenant_id
self.credential = credential
def from_dict(self, service_principal_dict):
self.client_id = service_principal_dict['client_id']
self.tenant_id = service_principal_dict['tenant_id']
self.credential = service_principal_dict['credential']
return self
|
class Serviceprincipal:
def __init__(self, client_id=None, tenant_id=None, credential=None):
self.client_id = client_id
self.tenant_id = tenant_id
self.credential = credential
def from_dict(self, service_principal_dict):
self.client_id = service_principal_dict['client_id']
self.tenant_id = service_principal_dict['tenant_id']
self.credential = service_principal_dict['credential']
return self
|
class _MockRouter:
root_viewset_cls = None
class NestedRouteTestCaseMixin:
def wrap_with_parents(self, child_class, *parent_classes):
"""
Wraps the child_class to be a nested route below the given
parent classes, where the last parent class is the "top route"
"""
all_viewsets = [child_class] + list(parent_classes)
all_viewsets.reverse()
most_child = None
for i, viewset in enumerate(all_viewsets):
if i == 0:
most_child = view_class = type(
f'{viewset.__name__}__TestWrapper',
(viewset,), dict(vars(viewset))
)
continue
parent_viewset = most_child
router = _MockRouter()
router.root_viewset_cls = parent_viewset
view_class = type(
f'{viewset.__name__}__NestedTestWrapper',
(viewset,), dict(vars(viewset))
)
view_class.check_parent_permissions = False
view_class.router = router
most_child = view_class
return most_child
def with_request_kwargs(self, view, request, kwargs):
request.parser_context = {'kwargs': kwargs}
return view(request, **request.parser_context['kwargs'])
|
class _Mockrouter:
root_viewset_cls = None
class Nestedroutetestcasemixin:
def wrap_with_parents(self, child_class, *parent_classes):
"""
Wraps the child_class to be a nested route below the given
parent classes, where the last parent class is the "top route"
"""
all_viewsets = [child_class] + list(parent_classes)
all_viewsets.reverse()
most_child = None
for (i, viewset) in enumerate(all_viewsets):
if i == 0:
most_child = view_class = type(f'{viewset.__name__}__TestWrapper', (viewset,), dict(vars(viewset)))
continue
parent_viewset = most_child
router = __mock_router()
router.root_viewset_cls = parent_viewset
view_class = type(f'{viewset.__name__}__NestedTestWrapper', (viewset,), dict(vars(viewset)))
view_class.check_parent_permissions = False
view_class.router = router
most_child = view_class
return most_child
def with_request_kwargs(self, view, request, kwargs):
request.parser_context = {'kwargs': kwargs}
return view(request, **request.parser_context['kwargs'])
|
num_inpt = a = 7484
num_inpt_2 = b = 12312
while num_inpt != num_inpt_2: # nod
if num_inpt > num_inpt_2:
num_inpt = num_inpt - num_inpt_2
elif num_inpt_2 > num_inpt:
num_inpt_2 = num_inpt_2 - num_inpt
nok = a * b // num_inpt_2 #nok
print(nok)
|
num_inpt = a = 7484
num_inpt_2 = b = 12312
while num_inpt != num_inpt_2:
if num_inpt > num_inpt_2:
num_inpt = num_inpt - num_inpt_2
elif num_inpt_2 > num_inpt:
num_inpt_2 = num_inpt_2 - num_inpt
nok = a * b // num_inpt_2
print(nok)
|
"""This problem was asked by Dropbox.
Given a list of words, determine whether the words can be chained to form a circle.
A word X can be placed in front of another word Y in a circle if the last character
of X is same as the first character of Y.
For example, the words ['chair', 'height', 'racket', touch', 'tunic'] can form the
following circle: chair --> racket --> touch --> height --> tunic --> chair."""
|
"""This problem was asked by Dropbox.
Given a list of words, determine whether the words can be chained to form a circle.
A word X can be placed in front of another word Y in a circle if the last character
of X is same as the first character of Y.
For example, the words ['chair', 'height', 'racket', touch', 'tunic'] can form the
following circle: chair --> racket --> touch --> height --> tunic --> chair."""
|
def count_and_print(f, l):
c=0
for e in l:
f.write(e)
f.write("\n")
c+=1
f.close()
return c
|
def count_and_print(f, l):
c = 0
for e in l:
f.write(e)
f.write('\n')
c += 1
f.close()
return c
|
def readFlat(filename, delimiter):
f = open(filename)
ans = []
for line in f:
ans.append(map(lambda x:float(x), filter(lambda x:len(x)>0,line.split(delimiter))))
return ans
|
def read_flat(filename, delimiter):
f = open(filename)
ans = []
for line in f:
ans.append(map(lambda x: float(x), filter(lambda x: len(x) > 0, line.split(delimiter))))
return ans
|
"""
test_multi_group.py
Author: Jordan Mirocha
Affiliation: University of Colorado at Boulder
Created on: Sun Mar 24 01:04:54 2013
Description:
"""
|
"""
test_multi_group.py
Author: Jordan Mirocha
Affiliation: University of Colorado at Boulder
Created on: Sun Mar 24 01:04:54 2013
Description:
"""
|
# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0
# For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt
def b(x):
msg = "x is %s" % x
print(msg)
|
def b(x):
msg = 'x is %s' % x
print(msg)
|
class DoubleNode:
def __init__(self, value):
self.value = value
self.next = None
self.previous = None
class DoublyLinkedList:
def __init__(self):
self.head = None
self.tail = None
def append(self, value):
if self.head == None:
self.head = DoubleNode(value)
self.tail = self.head
return
new_node = DoubleNode(value)
new_node.previous = self.tail
self.tail.next = new_node
self.tail = self.tail.next
def to_list(self):
#Write a function to convert DoublyLinkedList to Python list
list = []
node = self.head
while node:
list.append(node.value)
node = node.next
return list
def to_list_reverse(self):
list = []
node = self.tail
while node:
list.append(node.value)
node = node.previous
return list
|
class Doublenode:
def __init__(self, value):
self.value = value
self.next = None
self.previous = None
class Doublylinkedlist:
def __init__(self):
self.head = None
self.tail = None
def append(self, value):
if self.head == None:
self.head = double_node(value)
self.tail = self.head
return
new_node = double_node(value)
new_node.previous = self.tail
self.tail.next = new_node
self.tail = self.tail.next
def to_list(self):
list = []
node = self.head
while node:
list.append(node.value)
node = node.next
return list
def to_list_reverse(self):
list = []
node = self.tail
while node:
list.append(node.value)
node = node.previous
return list
|
# Authors: Soledad Galli <solegalli@protonmail.com>
# License: BSD 3 clause
# functions shared across transformers
def _define_variables(variables):
# Check that variable names are passed in a list.
# Can take None as value
if not variables or isinstance(variables, list):
variables = variables
else:
variables = [variables]
return variables
def _find_numerical_variables(X, variables=None):
# Find numerical variables in a data set or check that
# the variables entered by the user are numerical.
if not variables:
variables = list(X.select_dtypes(include='number').columns)
else:
if len(X[variables].select_dtypes(exclude='number').columns) != 0:
raise TypeError("Some of the variables are not numerical. Please cast them as numerical "
"before calling this transformer")
return variables
def _find_categorical_variables(X, variables=None):
# Find categorical variables in a data set or check that
# the variables entered by user are categorical.
if not variables:
variables = list(X.select_dtypes(include='O').columns)
else:
# variables indicated by user
if len(X[variables].select_dtypes(exclude='O').columns) != 0:
raise TypeError("Some of the variables are not categorical. Please cast them as object "
"before calling this transformer")
return variables
|
def _define_variables(variables):
if not variables or isinstance(variables, list):
variables = variables
else:
variables = [variables]
return variables
def _find_numerical_variables(X, variables=None):
if not variables:
variables = list(X.select_dtypes(include='number').columns)
elif len(X[variables].select_dtypes(exclude='number').columns) != 0:
raise type_error('Some of the variables are not numerical. Please cast them as numerical before calling this transformer')
return variables
def _find_categorical_variables(X, variables=None):
if not variables:
variables = list(X.select_dtypes(include='O').columns)
elif len(X[variables].select_dtypes(exclude='O').columns) != 0:
raise type_error('Some of the variables are not categorical. Please cast them as object before calling this transformer')
return variables
|
K, A, B = map(int, input().split())
if B-A <= 2:
print(K+1)
exit(0)
if 1+(K-2) < A:
print(K+1)
exit(0)
exchange_times, last = divmod(K-(A-1), 2)
profit = B - A
ans = A + exchange_times * profit + last
print(ans)
|
(k, a, b) = map(int, input().split())
if B - A <= 2:
print(K + 1)
exit(0)
if 1 + (K - 2) < A:
print(K + 1)
exit(0)
(exchange_times, last) = divmod(K - (A - 1), 2)
profit = B - A
ans = A + exchange_times * profit + last
print(ans)
|
def foo():
"""
Parameters:
a: foo
Returns:
None
"""
|
def foo():
"""
Parameters:
a: foo
Returns:
None
"""
|
m = "sdjlwdd"
c
print(mBytes)
mInt = int.from_bytes(mBytes, byteorder="big")
mBytes2 = mInt.to_bytes(((mInt.bit_length() + 7) // 8), byteorder="big")
m2 = mBytes2.decode("utf-8")
print(m == m2)
|
m = 'sdjlwdd'
c
print(mBytes)
m_int = int.from_bytes(mBytes, byteorder='big')
m_bytes2 = mInt.to_bytes((mInt.bit_length() + 7) // 8, byteorder='big')
m2 = mBytes2.decode('utf-8')
print(m == m2)
|
"""
Given the names and grades for each student in a Physics class of N students, store them in a nested list
and print the name(s) of any student(s) having the second lowest grade.
Note: If there are multiple students with the same grade, order their names alphabetically and print each name on a new line.
"""
python_students = [['Harry', 37.21], ['Berry', 37.21],
['Tina', 37.2], ['Akriti', 41], ['Harsh', 39]]
new_list = [name for record in python_students for name in record]
print(new_list)
|
"""
Given the names and grades for each student in a Physics class of N students, store them in a nested list
and print the name(s) of any student(s) having the second lowest grade.
Note: If there are multiple students with the same grade, order their names alphabetically and print each name on a new line.
"""
python_students = [['Harry', 37.21], ['Berry', 37.21], ['Tina', 37.2], ['Akriti', 41], ['Harsh', 39]]
new_list = [name for record in python_students for name in record]
print(new_list)
|
# -*- coding: UTF-8 -*-
# vim: ts=4 sts=4 sw=4 tw=100 sta et
class NotInRole(Exception):
pass
def check_role(my_roles, requested_roles):
if not my_roles:
return True
for role in my_roles:
if role in requested_roles:
return True
raise NotInRole()
|
class Notinrole(Exception):
pass
def check_role(my_roles, requested_roles):
if not my_roles:
return True
for role in my_roles:
if role in requested_roles:
return True
raise not_in_role()
|
"""Write a program which will find all such numbers which are divisible
by 7 but are not a multiple of 5, between 2000 and 3200 (both included).
The numbers obtained should be printed in a comma-separated sequence on a
single line."""
for num in range(2000, 3201):
if num % 7 == 0 and num % 5 != 0:
print(f"{num}", end=",")
|
"""Write a program which will find all such numbers which are divisible
by 7 but are not a multiple of 5, between 2000 and 3200 (both included).
The numbers obtained should be printed in a comma-separated sequence on a
single line."""
for num in range(2000, 3201):
if num % 7 == 0 and num % 5 != 0:
print(f'{num}', end=',')
|
# -*- coding: utf-8 -*-
{
'name': "odoo-s3",
'summary': """
Stores attachments in Amazon S3 instead of the local drive""",
'description': """
In large deployments, Odoo workers need to share a distributed
filestore. Amazon S3 can store files (e.g. attachments and
pictures), such that all Odoo workers can access the same files.
This module lets you configure access to an S3 bucket from Odoo,
by settings a System parameter.
""",
'author': "Marc Lijour",
'website': "https://github.com/marclijour/odoo-s3",
# Categories can be used to filter modules in modules listing
# Check https://github.com/odoo/odoo/blob/master/odoo/addons/base/module/module_data.xml
# for the full list
'category': 'Technical Settings',
'version': '0.1',
# any module necessary for this one to work correctly
'depends': ['base'],
# only the admin user should be having access -so default is ok
# 'data': [
# 'security/ir.model.access.csv',
# ],
}
|
{'name': 'odoo-s3', 'summary': '\n Stores attachments in Amazon S3 instead of the local drive', 'description': '\n In large deployments, Odoo workers need to share a distributed\n filestore. Amazon S3 can store files (e.g. attachments and\n pictures), such that all Odoo workers can access the same files.\n\n This module lets you configure access to an S3 bucket from Odoo,\n by settings a System parameter.\n ', 'author': 'Marc Lijour', 'website': 'https://github.com/marclijour/odoo-s3', 'category': 'Technical Settings', 'version': '0.1', 'depends': ['base']}
|
class PingError(Exception):
pass
class TimeExceeded(PingError):
pass
class TimeToLiveExpired(TimeExceeded):
def __init__(self, message="Time exceeded: Time To Live expired.", ip_header=None, icmp_header=None):
self.ip_header = ip_header
self.icmp_header = icmp_header
self.message = message
super().__init__(self.message)
class DestinationUnreachable(PingError):
def __init__(self, message="Destination unreachable.", ip_header=None, icmp_header=None):
self.ip_header = ip_header
self.icmp_header = icmp_header
self.message = message if self.ip_header is None else message + " (Host='{}')".format(self.ip_header.get("src_addr"))
super().__init__(self.message)
class DestinationHostUnreachable(DestinationUnreachable):
def __init__(self, message="Destination unreachable: Host unreachable.", ip_header=None, icmp_header=None):
self.ip_header = ip_header
self.icmp_header = icmp_header
self.message = message if self.ip_header is None else message + " (Host='{}')".format(self.ip_header.get("src_addr"))
super().__init__(self.message)
class HostUnknown(PingError):
def __init__(self, message="Cannot resolve: Unknown host.", dest_addr=None):
self.dest_addr = dest_addr
self.message = message if self.dest_addr is None else message + " (Host='{}')".format(self.dest_addr)
super().__init__(self.message)
class Timeout(PingError):
def __init__(self, message="Request timeout for ICMP packet.", timeout=None):
self.timeout = timeout
self.message = message if self.timeout is None else message + " (Timeout={}s)".format(self.timeout)
super().__init__(self.message)
|
class Pingerror(Exception):
pass
class Timeexceeded(PingError):
pass
class Timetoliveexpired(TimeExceeded):
def __init__(self, message='Time exceeded: Time To Live expired.', ip_header=None, icmp_header=None):
self.ip_header = ip_header
self.icmp_header = icmp_header
self.message = message
super().__init__(self.message)
class Destinationunreachable(PingError):
def __init__(self, message='Destination unreachable.', ip_header=None, icmp_header=None):
self.ip_header = ip_header
self.icmp_header = icmp_header
self.message = message if self.ip_header is None else message + " (Host='{}')".format(self.ip_header.get('src_addr'))
super().__init__(self.message)
class Destinationhostunreachable(DestinationUnreachable):
def __init__(self, message='Destination unreachable: Host unreachable.', ip_header=None, icmp_header=None):
self.ip_header = ip_header
self.icmp_header = icmp_header
self.message = message if self.ip_header is None else message + " (Host='{}')".format(self.ip_header.get('src_addr'))
super().__init__(self.message)
class Hostunknown(PingError):
def __init__(self, message='Cannot resolve: Unknown host.', dest_addr=None):
self.dest_addr = dest_addr
self.message = message if self.dest_addr is None else message + " (Host='{}')".format(self.dest_addr)
super().__init__(self.message)
class Timeout(PingError):
def __init__(self, message='Request timeout for ICMP packet.', timeout=None):
self.timeout = timeout
self.message = message if self.timeout is None else message + ' (Timeout={}s)'.format(self.timeout)
super().__init__(self.message)
|
# -*- coding: utf-8 -*-
description = 'Sample table'
group = 'lowlevel'
devices = dict(
st_phi = device('nicos.devices.generic.VirtualMotor',
unit = 'deg',
abslimits = (-50, 116.1),
speed = 1.5,
visibility = (),
),
co_phi = device('nicos.devices.generic.VirtualCoder',
motor = 'st_phi',
visibility = (),
),
phi = device('nicos.devices.generic.Axis',
description = 'Sample scattering angle Two Theta',
motor = 'st_phi',
coder = 'co_phi',
precision = 0.005,
offset = 0.21, #May 2017 done by GE
maxtries = 10,
loopdelay = 1,
jitter = 0.2,
dragerror = 1,
),
st_psi = device('nicos.devices.generic.VirtualMotor',
unit = 'deg',
abslimits = (-1000, 1000),
userlimits = (5, 355),
speed = 2,
visibility = (),
),
psi_puma = device('nicos.devices.generic.Axis',
description = 'Sample rocking angle Theta',
motor = 'st_psi',
precision = 0.005,
offset = 0,
maxtries = 5,
),
psi = device('nicos.devices.generic.DeviceAlias',
description = 'Sample rocking angle Theta',
alias = 'psi_puma',
# when magnet is on :
# alias = 'sth_m7T5_ccr',
devclass = 'nicos.devices.generic.Axis',
# when magnet is on :
# devclass = 'nicos.devices.taco.Axis',
),
# Tilting
st_sgx = device('nicos.devices.generic.VirtualMotor',
unit = 'deg',
abslimits = (-15.6, 15.6),
speed = 1,
visibility = (),
),
st_sgy = device('nicos.devices.generic.VirtualMotor',
unit = 'deg',
abslimits = (-15.6, 15.6),
speed = 1,
visibility = (),
),
sgx = device('nicos.devices.generic.Axis',
description = 'Sample tilt around X',
motor = 'st_sgx',
precision = 0.02,
offset = 0,
fmtstr = '%.3f',
maxtries = 5,
),
sgy = device('nicos.devices.generic.Axis',
description = 'Sample tilt around Y',
motor = 'st_sgy',
precision = 0.02,
offset = 0,
fmtstr = '%.3f',
maxtries = 5,
),
# Translation
st_stx = device('nicos.devices.generic.VirtualMotor',
unit = 'mm',
abslimits = (-18.1, 18.1),
speed = 1,
visibility = (),
),
st_sty = device('nicos.devices.generic.VirtualMotor',
unit = 'mm',
abslimits = (-18.1, 18.1),
speed = 1,
visibility = (),
),
st_stz = device('nicos.devices.generic.VirtualMotor',
unit = 'mm',
abslimits = (-20, 20),
speed = 1,
visibility = (),
),
stx = device('nicos.devices.generic.Axis',
description = 'Sample translation along X',
motor = 'st_stx',
precision = 0.05,
offset = 0.0,
fmtstr = '%.3f',
maxtries = 9,
loopdelay = 1,
abslimits = (-18.1, 18.1),
),
sty = device('nicos.devices.generic.Axis',
description = 'Sample translation along Y',
motor = 'st_sty',
precision = 0.05,
offset = 0.0,
fmtstr = '%.3f',
maxtries = 9,
loopdelay = 1,
),
stz = device('nicos.devices.generic.Axis',
description = 'Sample translation along Z',
motor = 'st_stz',
precision = 0.1,
offset = 0,
fmtstr = '%.2f',
maxtries = 10,
loopdelay = 2,
),
vg1 = device('nicos.devices.tas.VirtualGonio',
description = 'Gonio along orient1 reflex',
cell = 'Sample',
gx = 'sgx',
gy = 'sgy',
axis = 1,
unit = 'deg',
),
vg2 = device('nicos.devices.tas.VirtualGonio',
description = 'Gonio along orient2 reflex',
cell = 'Sample',
gx = 'sgx',
gy = 'sgy',
axis = 2,
unit = 'deg',
),
)
alias_config = {
'psi': {'psi_puma': 0},
}
|
description = 'Sample table'
group = 'lowlevel'
devices = dict(st_phi=device('nicos.devices.generic.VirtualMotor', unit='deg', abslimits=(-50, 116.1), speed=1.5, visibility=()), co_phi=device('nicos.devices.generic.VirtualCoder', motor='st_phi', visibility=()), phi=device('nicos.devices.generic.Axis', description='Sample scattering angle Two Theta', motor='st_phi', coder='co_phi', precision=0.005, offset=0.21, maxtries=10, loopdelay=1, jitter=0.2, dragerror=1), st_psi=device('nicos.devices.generic.VirtualMotor', unit='deg', abslimits=(-1000, 1000), userlimits=(5, 355), speed=2, visibility=()), psi_puma=device('nicos.devices.generic.Axis', description='Sample rocking angle Theta', motor='st_psi', precision=0.005, offset=0, maxtries=5), psi=device('nicos.devices.generic.DeviceAlias', description='Sample rocking angle Theta', alias='psi_puma', devclass='nicos.devices.generic.Axis'), st_sgx=device('nicos.devices.generic.VirtualMotor', unit='deg', abslimits=(-15.6, 15.6), speed=1, visibility=()), st_sgy=device('nicos.devices.generic.VirtualMotor', unit='deg', abslimits=(-15.6, 15.6), speed=1, visibility=()), sgx=device('nicos.devices.generic.Axis', description='Sample tilt around X', motor='st_sgx', precision=0.02, offset=0, fmtstr='%.3f', maxtries=5), sgy=device('nicos.devices.generic.Axis', description='Sample tilt around Y', motor='st_sgy', precision=0.02, offset=0, fmtstr='%.3f', maxtries=5), st_stx=device('nicos.devices.generic.VirtualMotor', unit='mm', abslimits=(-18.1, 18.1), speed=1, visibility=()), st_sty=device('nicos.devices.generic.VirtualMotor', unit='mm', abslimits=(-18.1, 18.1), speed=1, visibility=()), st_stz=device('nicos.devices.generic.VirtualMotor', unit='mm', abslimits=(-20, 20), speed=1, visibility=()), stx=device('nicos.devices.generic.Axis', description='Sample translation along X', motor='st_stx', precision=0.05, offset=0.0, fmtstr='%.3f', maxtries=9, loopdelay=1, abslimits=(-18.1, 18.1)), sty=device('nicos.devices.generic.Axis', description='Sample translation along Y', motor='st_sty', precision=0.05, offset=0.0, fmtstr='%.3f', maxtries=9, loopdelay=1), stz=device('nicos.devices.generic.Axis', description='Sample translation along Z', motor='st_stz', precision=0.1, offset=0, fmtstr='%.2f', maxtries=10, loopdelay=2), vg1=device('nicos.devices.tas.VirtualGonio', description='Gonio along orient1 reflex', cell='Sample', gx='sgx', gy='sgy', axis=1, unit='deg'), vg2=device('nicos.devices.tas.VirtualGonio', description='Gonio along orient2 reflex', cell='Sample', gx='sgx', gy='sgy', axis=2, unit='deg'))
alias_config = {'psi': {'psi_puma': 0}}
|
# demo of looping through the characters of a string, using the sorted and reversed functions
s = input("Enter a string:")
n = len(s)
print("The first character of", s, "is", s[0])
print("The entered string will appear character wise as:")
for i in range(0, n):
print(s[i])
print("The entered string will appear character wise as:")
for i in s:
print(i)
print("String with its characters sorted is", sorted(s))
print("String in reverse form is", "".join(reversed(s)))
|
s = input('Enter a string:')
n = len(s)
print('The first character of', s, 'is', s[0])
print('The entered string will appear character wise as:')
for i in range(0, n):
print(s[i])
print('The entered string will appear character wise as:')
for i in s:
print(i)
print('String with its characters sorted is', sorted(s))
print('String in reverse form is', ''.join(reversed(s)))
|
# ------------------------------------------------------------------------------------
# Tutorial: How to make a recursive function
# A recursive function is a function that calls itself
# ------------------------------------------------------------------------------------
# find the factorial of a user entered number
# the 'def' keyword is used to declare a function. the structure of a function is:
mul = 1
def fact(num):
if num == 1:
return num
else:
return num * fact(num - 1)
num = int(input('Enter a number to get the factorial of it: '))
if num == 0:
print("Factorial of 0: 1")
else:
print("Factorial of ", num, ":", fact(num))
# -----------------------------------------------------------------------------------
# Challenge: create a recursive function that makes a countdown from a user entered number till zero
# ------------------------------------------------------------------------------------
|
mul = 1
def fact(num):
if num == 1:
return num
else:
return num * fact(num - 1)
num = int(input('Enter a number to get the factorial of it: '))
if num == 0:
print('Factorial of 0: 1')
else:
print('Factorial of ', num, ':', fact(num))
|
class BaseError(Exception):
"""Base Error Class"""
def __init__(self, code=400, message='', status='', field=None):
Exception.__init__(self)
self.code = code
self.message = message
self.status = status
self.field = field
def to_dict(self):
return {'code': self.code,
'message': self.message,
'status': self.status,
'field': self.field, }
def __str__(self):
return self.message
class NotFoundError(BaseError):
def __init__(self, message='Not found'):
BaseError.__init__(self)
self.code = 404
self.message = message
self.status = 'NOT_FOUND'
class NotAuthorizedError(BaseError):
def __init__(self, message='Unauthorized'):
BaseError.__init__(self)
self.code = 401
self.message = message
self.status = 'NOT_AUTHORIZED'
class PermissionDeniedError(BaseError):
def __init__(self, message='Permission denied'):
BaseError.__init__(self)
self.code = 403
self.message = message
self.status = 'PERMISSION_DENIED'
class ValidationError(BaseError):
def __init__(self, field, message='Invalid field'):
BaseError.__init__(self)
self.code = 400
self.message = message
self.status = 'INVALID_FIELD'
self.field = field
class ServerError(BaseError):
def __init__(self, message='Internal server error'):
BaseError.__init__(self)
self.code = 500
self.message = message
self.status = 'SERVER_ERROR'
|
class Baseerror(Exception):
"""Base Error Class"""
def __init__(self, code=400, message='', status='', field=None):
Exception.__init__(self)
self.code = code
self.message = message
self.status = status
self.field = field
def to_dict(self):
return {'code': self.code, 'message': self.message, 'status': self.status, 'field': self.field}
def __str__(self):
return self.message
class Notfounderror(BaseError):
def __init__(self, message='Not found'):
BaseError.__init__(self)
self.code = 404
self.message = message
self.status = 'NOT_FOUND'
class Notauthorizederror(BaseError):
def __init__(self, message='Unauthorized'):
BaseError.__init__(self)
self.code = 401
self.message = message
self.status = 'NOT_AUTHORIZED'
class Permissiondeniederror(BaseError):
def __init__(self, message='Permission denied'):
BaseError.__init__(self)
self.code = 403
self.message = message
self.status = 'PERMISSION_DENIED'
class Validationerror(BaseError):
def __init__(self, field, message='Invalid field'):
BaseError.__init__(self)
self.code = 400
self.message = message
self.status = 'INVALID_FIELD'
self.field = field
class Servererror(BaseError):
def __init__(self, message='Internal server error'):
BaseError.__init__(self)
self.code = 500
self.message = message
self.status = 'SERVER_ERROR'
|
"""
Write a function that takes an integer as input, and returns the number of bits that are equal to one in the binary
representation of that number. You can guarantee that input is non-negative.
Example: The binary representation of 1234 is 10011010010, so the function should return 5 in this case
"""
def count_bits(n):
return sum([int(n) for n in bin(n)[2:]])
print(count_bits(0))
print(count_bits(4))
print(count_bits(7))
print(count_bits(9))
print(count_bits(10))
|
"""
Write a function that takes an integer as input, and returns the number of bits that are equal to one in the binary
representation of that number. You can guarantee that input is non-negative.
Example: The binary representation of 1234 is 10011010010, so the function should return 5 in this case
"""
def count_bits(n):
return sum([int(n) for n in bin(n)[2:]])
print(count_bits(0))
print(count_bits(4))
print(count_bits(7))
print(count_bits(9))
print(count_bits(10))
|
#03_personal-info.py
space= " "
firstName = input("What is your first name?")
lastName = input("What is your last name?")
location = input("What is your location?")
age = input("What is your age?")
print("Hi "+ firstName + space + lastName +"! Your location is "+ location + " and you are "+age + " years old!")
|
space = ' '
first_name = input('What is your first name?')
last_name = input('What is your last name?')
location = input('What is your location?')
age = input('What is your age?')
print('Hi ' + firstName + space + lastName + '! Your location is ' + location + ' and you are ' + age + ' years old!')
|
class Reply(object):
"""{
"kind": "drive#commentReply",
"replyId": string,
"createdDate": datetime,
"modifiedDate": datetime,
"author": {
"kind": "drive#user",
"displayName": string,
"picture": {
"url": string
},
"isAuthenticatedUser": boolean,
"permissionId": string,
"emailAddress": string
},
"htmlContent": string,
"content": string,
"deleted": boolean,
"verb": string
}"""
def __init__(self, _reply):
self._reply = _reply
class Comment(object):
"""{
"kind": "drive#comment",
"selfLink": string,
"commentId": string,
"createdDate": datetime,
"modifiedDate": datetime,
"author": {
"kind": "drive#user",
"displayName": string,
"picture": {
"url": string
},
"isAuthenticatedUser": boolean,
"permissionId": string,
"emailAddress": string
},
"htmlContent": string,
"content": string,
"deleted": boolean,
"status": string,
"context": {
"type": string,
"value": string
},
"anchor": string,
"fileId": string,
"fileTitle": string,
"replies": [
replies Resource
]
}"""
def __init__(self, _comment):
self._comment = _comment
@property
def text(self):
return self._comment.get("content")
@property
def status(self):
return self._comment.get("status")
@property
def author(self):
return self._comment["author"].get("displayName")
@property
def link(self):
return self._comment.get("selfLink")
@property
def replies(self):
return [Reply(obj) for obj in self._comment.get("replies", []) if not obj.get("deleted")]
|
class Reply(object):
"""{
"kind": "drive#commentReply",
"replyId": string,
"createdDate": datetime,
"modifiedDate": datetime,
"author": {
"kind": "drive#user",
"displayName": string,
"picture": {
"url": string
},
"isAuthenticatedUser": boolean,
"permissionId": string,
"emailAddress": string
},
"htmlContent": string,
"content": string,
"deleted": boolean,
"verb": string
}"""
def __init__(self, _reply):
self._reply = _reply
class Comment(object):
"""{
"kind": "drive#comment",
"selfLink": string,
"commentId": string,
"createdDate": datetime,
"modifiedDate": datetime,
"author": {
"kind": "drive#user",
"displayName": string,
"picture": {
"url": string
},
"isAuthenticatedUser": boolean,
"permissionId": string,
"emailAddress": string
},
"htmlContent": string,
"content": string,
"deleted": boolean,
"status": string,
"context": {
"type": string,
"value": string
},
"anchor": string,
"fileId": string,
"fileTitle": string,
"replies": [
replies Resource
]
}"""
def __init__(self, _comment):
self._comment = _comment
@property
def text(self):
return self._comment.get('content')
@property
def status(self):
return self._comment.get('status')
@property
def author(self):
return self._comment['author'].get('displayName')
@property
def link(self):
return self._comment.get('selfLink')
@property
def replies(self):
return [reply(obj) for obj in self._comment.get('replies', []) if not obj.get('deleted')]
|
# Space : O(len(word))
# Time : O(n * len(word))
class Solution:
def findAndReplacePattern(self, words: List[str], pattern: str) -> List[str]:
ans = []
pn = len(pattern)
for word in words:
if len(word) != pn:
continue
mem1, mem2 = {}, {}
defect = False
for i in range(pn):
if word[i] not in mem1:
mem1[word[i]] = pattern[i]
elif mem1[word[i]] != pattern[i]:
defect = True
break
if pattern[i] not in mem2:
mem2[pattern[i]] = word[i]
elif mem2[pattern[i]] != word[i]:
defect = True
break
if defect:
continue
if len(mem1) == len(mem2):
ans.append(word)
return ans
|
class Solution:
def find_and_replace_pattern(self, words: List[str], pattern: str) -> List[str]:
ans = []
pn = len(pattern)
for word in words:
if len(word) != pn:
continue
(mem1, mem2) = ({}, {})
defect = False
for i in range(pn):
if word[i] not in mem1:
mem1[word[i]] = pattern[i]
elif mem1[word[i]] != pattern[i]:
defect = True
break
if pattern[i] not in mem2:
mem2[pattern[i]] = word[i]
elif mem2[pattern[i]] != word[i]:
defect = True
break
if defect:
continue
if len(mem1) == len(mem2):
ans.append(word)
return ans
|
def indent(string, level=1, lstrip_first=False):
"""Multiline string indent.
Indent each line of the provided string by the specified level.
Args:
string: The string to indent, possibly containing linebreaks.
level: The level to indent (``level * ' '``). Defaults to 1.
lstrip_first: If this is `True`, then the first line is not indented.
Defaults to `False`.
Returns:
Indented string.
"""
out = '\n'.join((level * ' ') + i for i in string.splitlines())
if lstrip_first:
return out.lstrip()
return out
def is_namedtuple(x):
"""Return whether ``x`` is an instance of a namedtuple."""
return isinstance(x, tuple) and hasattr(x, '_fields')
def print_ast(tree, level=0, inline=False):
"""Recursive function to print the AST.
Args:
tree: An abstract syntax tree consisting of tuples, namedtuples and other objects.
level: The indent level, used for the recursive calls.
inline: Whether or not to indent the first line.
Returns:
Nothing. The AST is printed directly to stdout.
"""
if is_namedtuple(tree):
print(indent('{0.__class__.__name__}('.format(tree), level, inline))
for key, value in tree._asdict().items():
print(indent(key + '=', level + 1), end='')
print_ast(value, level + 1, True)
print(indent(')', level))
elif isinstance(tree, (tuple, list)):
if isinstance(tree, tuple):
braces = '()'
else:
braces = '[]'
if len(tree) == 0:
print(braces)
else:
print(indent(braces[0], level, inline))
for obj in tree:
print_ast(obj, level + 1)
print(indent(braces[1], level))
else:
print(indent(repr(tree), level, inline))
def find_column(input_text, token):
line_start = input_text.rfind('\n', 0, token.lexpos) + 1
return (token.lexpos - line_start) + 1
def find_last_line(input_text):
if not input_text:
return 0
line_no = input_text.count('\n')
return line_no
|
def indent(string, level=1, lstrip_first=False):
"""Multiline string indent.
Indent each line of the provided string by the specified level.
Args:
string: The string to indent, possibly containing linebreaks.
level: The level to indent (``level * ' '``). Defaults to 1.
lstrip_first: If this is `True`, then the first line is not indented.
Defaults to `False`.
Returns:
Indented string.
"""
out = '\n'.join((level * ' ' + i for i in string.splitlines()))
if lstrip_first:
return out.lstrip()
return out
def is_namedtuple(x):
"""Return whether ``x`` is an instance of a namedtuple."""
return isinstance(x, tuple) and hasattr(x, '_fields')
def print_ast(tree, level=0, inline=False):
"""Recursive function to print the AST.
Args:
tree: An abstract syntax tree consisting of tuples, namedtuples and other objects.
level: The indent level, used for the recursive calls.
inline: Whether or not to indent the first line.
Returns:
Nothing. The AST is printed directly to stdout.
"""
if is_namedtuple(tree):
print(indent('{0.__class__.__name__}('.format(tree), level, inline))
for (key, value) in tree._asdict().items():
print(indent(key + '=', level + 1), end='')
print_ast(value, level + 1, True)
print(indent(')', level))
elif isinstance(tree, (tuple, list)):
if isinstance(tree, tuple):
braces = '()'
else:
braces = '[]'
if len(tree) == 0:
print(braces)
else:
print(indent(braces[0], level, inline))
for obj in tree:
print_ast(obj, level + 1)
print(indent(braces[1], level))
else:
print(indent(repr(tree), level, inline))
def find_column(input_text, token):
line_start = input_text.rfind('\n', 0, token.lexpos) + 1
return token.lexpos - line_start + 1
def find_last_line(input_text):
if not input_text:
return 0
line_no = input_text.count('\n')
return line_no
|
'''Crie um programa que leia idade e sexo de varias pessoas
e pergunte se o usuario quer conrinuar
no final mostre
quantas pessoas tem mais de 18 anos
quantos homens foram cadastrados
e quantas mulheres tem menos de 20 anos'''
pessoas_18 = mulher_20 = homen = 0
while True:
idade = int(input('Digite a Idade: '))
sexo = str(input('Escolha um sexo\n'
'[ M ] / [ F ] : ')).strip().upper()[0]
continuar = str(input('Quer continuar cadastrando?\n'
'[ S ] / [ N ] : ')).upper().strip()[0]
if continuar in 'N':
break
if idade > 18:
pessoas_18 += 1
if sexo in 'M':
homen += 1
if sexo in 'F' and idade < 20:
mulher_20 +=1
print(f'{pessoas_18} tem mais de 18 anos')
print(f'{homen} homens foram cadastrados')
print(f'{mulher_20} Mulher tem menos de 18 anos')
|
"""Crie um programa que leia idade e sexo de varias pessoas
e pergunte se o usuario quer conrinuar
no final mostre
quantas pessoas tem mais de 18 anos
quantos homens foram cadastrados
e quantas mulheres tem menos de 20 anos"""
pessoas_18 = mulher_20 = homen = 0
while True:
idade = int(input('Digite a Idade: '))
sexo = str(input('Escolha um sexo\n[ M ] / [ F ] : ')).strip().upper()[0]
continuar = str(input('Quer continuar cadastrando?\n[ S ] / [ N ] : ')).upper().strip()[0]
if continuar in 'N':
break
if idade > 18:
pessoas_18 += 1
if sexo in 'M':
homen += 1
if sexo in 'F' and idade < 20:
mulher_20 += 1
print(f'{pessoas_18} tem mais de 18 anos')
print(f'{homen} homens foram cadastrados')
print(f'{mulher_20} Mulher tem menos de 18 anos')
|
class GuidAttribute:
"""
Supplies an explicit System.Guid when an automatic GUID is undesirable.
GuidAttribute(guid: str)
"""
def ZZZ(self):
"""hardcoded/mock instance of the class"""
return GuidAttribute()
instance=ZZZ()
"""hardcoded/returns an instance of the class"""
def __init__(self,*args):
""" x.__init__(...) initializes x; see x.__class__.__doc__ for signaturex.__init__(...) initializes x; see x.__class__.__doc__ for signaturex.__init__(...) initializes x; see x.__class__.__doc__ for signature """
pass
@staticmethod
def __new__(self,guid):
""" __new__(cls: type,guid: str) """
pass
Value=property(lambda self: object(),lambda self,v: None,lambda self: None)
"""Gets the System.Guid of the class.
Get: Value(self: GuidAttribute) -> str
"""
|
class Guidattribute:
"""
Supplies an explicit System.Guid when an automatic GUID is undesirable.
GuidAttribute(guid: str)
"""
def zzz(self):
"""hardcoded/mock instance of the class"""
return guid_attribute()
instance = zzz()
'hardcoded/returns an instance of the class'
def __init__(self, *args):
""" x.__init__(...) initializes x; see x.__class__.__doc__ for signaturex.__init__(...) initializes x; see x.__class__.__doc__ for signaturex.__init__(...) initializes x; see x.__class__.__doc__ for signature """
pass
@staticmethod
def __new__(self, guid):
""" __new__(cls: type,guid: str) """
pass
value = property(lambda self: object(), lambda self, v: None, lambda self: None)
'Gets the System.Guid of the class.\n\n\n\nGet: Value(self: GuidAttribute) -> str\n\n\n\n'
|
# Common use case - File IO
# "Everything not saved will be lost."
#
# Prereq:
# string operations: split(), strip(), format(), join()
# list operations: append()
# built-in functions: len(), open()
#
# Reading:
# open()
# https://docs.python.org/3/library/functions.html#open
# string.strip()
# https://stackoverflow.com/a/13013812/4570438
#
# Advanced topic: the "with" construct
# https://docs.python.org/3/reference/compound_stmts.html#with
#
# Stanley H.I. Lio
# hlio@hawaii.edu
# OCN318, S18, S19
# to write to a file:
f = open('offshore_assets.txt', 'w') # homework: look up the 'r' and 'a' options
f.write('squirrel tail')
f.write('basilisk hide')
f.write('kikimore claw')
f.write('may contain peanut')
f.close()
# Exercise: put the strings on separate lines using the new line character: '\n'
# to read from a file:
f = open('offshore_assets.txt')
while True:
line = f.readline()
if len(line) > 0:
print(line)
else:
break
f.close()
# more succinctly,
for line in open('offshore_assets.txt'):
print(line)
# Exercise: copy THE THIRD column from serial_log.txt into temperature.csv
D = []
for line in open('serial_log.txt'):
line = line.strip().split(',')
if 10 == len(line):
D.append(line[2])
print(len(D))
print(D[:10])
f = open('temperature.csv', 'w')
for d in D:
f.write('{}\n'.format(d))
f.close()
# Homework: extract the FIRST FOUR columns from serial_log.txt and place them in output1.csv
# Hint: you might need the join() method for strings. Try this: ','.join(['a', 'b', 'c'])
# Challenge: merge the first two columns by adding them, write it and the second and thrid columns to output2.csv
# Like so:
# INPUT:
'''
256,0,24.525,103.70,251,270,1382,1573,582,2215
256,20,24.559,103.63,252,272,1381,1570,581,2212
256,40,24.547,103.60,252,272,1380,1569,580,2210
256,60,24.539,103.72,252,271,1379,1569,579,2208
...
'''
# OUTPUT:
'''
256,24.525,103.70
276,24.559,103.63
296,24.547,103.60
316,24.539,103.72
...
'''
# Note:
# The first and second columns are index, which is a proxy of time.
# The third is temperature in Deg.C, and the fourth, pressure in kPa.
|
f = open('offshore_assets.txt', 'w')
f.write('squirrel tail')
f.write('basilisk hide')
f.write('kikimore claw')
f.write('may contain peanut')
f.close()
f = open('offshore_assets.txt')
while True:
line = f.readline()
if len(line) > 0:
print(line)
else:
break
f.close()
for line in open('offshore_assets.txt'):
print(line)
d = []
for line in open('serial_log.txt'):
line = line.strip().split(',')
if 10 == len(line):
D.append(line[2])
print(len(D))
print(D[:10])
f = open('temperature.csv', 'w')
for d in D:
f.write('{}\n'.format(d))
f.close()
'\n256,0,24.525,103.70,251,270,1382,1573,582,2215\n256,20,24.559,103.63,252,272,1381,1570,581,2212\n256,40,24.547,103.60,252,272,1380,1569,580,2210\n256,60,24.539,103.72,252,271,1379,1569,579,2208\n...\n'
'\n256,24.525,103.70\n276,24.559,103.63\n296,24.547,103.60\n316,24.539,103.72\n...\n'
|
class admin():
def __init__(self):
pass
def get_id(self):
pass
|
class Admin:
def __init__(self):
pass
def get_id(self):
pass
|
def get_hello():
return 'Hello'
class HelloSayer():
def say_hello(self):
print('Hello')
|
def get_hello():
return 'Hello'
class Hellosayer:
def say_hello(self):
print('Hello')
|
####################################
### The router base class
class Router(object):
'''Common superclass of routers'''
pass
|
class Router(object):
"""Common superclass of routers"""
pass
|
# Global parameter
examples_root = None
process_type_name_ns_to_clean = None
synopsis_maxlen_function = 120
synopsis_class_list = None
|
examples_root = None
process_type_name_ns_to_clean = None
synopsis_maxlen_function = 120
synopsis_class_list = None
|
sum=0
i=0
while i<=4:
if sum<=5000:
item=int(input("Enter the item amount"))
sum=sum+item
i=i+1
print("Total items",i,"selected and total amount is:",sum)
else:
print("Account limit crossed")
break
|
sum = 0
i = 0
while i <= 4:
if sum <= 5000:
item = int(input('Enter the item amount'))
sum = sum + item
i = i + 1
print('Total items', i, 'selected and total amount is:', sum)
else:
print('Account limit crossed')
break
|
class Coord(tuple):
def __add__(self, other):
if isinstance(other, Coord) and len(self) == len(other):
return Coord(i+j for i, j in zip(self, other))
def trees(inp, step: tuple):
step = Coord(step)
current = step
while current[0] < len(inp):
yield inp[current[0]][current[1] % len(inp[0])] == "#"
current += step
example_data = """\
..##.......
#...#...#..
.#....#..#.
..#.#...#.#
.#...##..#.
..#.##.....
.#.#.#....#
.#........#
#.##...#...
#...##....#
.#..#...#.#\
"""
data = """\
....#.#..#.#.#.#......#....##.#
..##..#.#..#.##.....#.....#....
....#..#...#..#..####.##.#.##..
...............#.....##..##..#.
##...####..##.#..#...####...#.#
..#.#....##....##.........#...#
.#..#.##..............#.....###
##..##..#.....#..#...#....#....
.#.........#..#...#.#.#.....#..
......#...#..#.##..#.....#.#...
.#...#.#.#.##.##.....###...#...
..........#.......#...#....#..#
.....##..#.#...#...##.##.......
...#.###.#.#..##...#.#.........
###.###....#...###.#.##...#....
...........#....#.....##....###
#..#.......#.....#.....##....#.
.##.#....#...#....#......#..##.
..#....#..#..#......#..........
#..#.........#.#....#.##...#.#.
#....#.#.......#.#.#.#.......#.
.#....#....#..##.##.#....#.#...
............#....#.#.#........#
#..#..#.....#....#.##.##.#....#
....#......#..##..#....#...#...
.............#.##....####...##.
#.##..##..##.#.....#...........
#.#...#......####.##..#.#......
.......#.#..#...#.#.###.......#
#..#..........#...#....#.......
###...#.....#....#...#..#...#..
...##..#.#.....#..#..#...#.#.##
#.......#......##...##......#..
.....#..#.....#......#.....##..
..#.....###......#.#..###....#.
....##........#...##.#..#..#...
#...#.##...##..#####...##..##..
...#.#.#.#.....#.#.........##..
.............#......#..##...#..
.#..#...##....#......#......#..
#.....#...##......#............
.#.#....##.#.#..##..#####..##..
..#..#.....#..#.##..#.#......##
.......#...#...#..#..##.#..##..
...#.##....#....#..#..#..#.....
.....#......#.....#.....#..#.#.
..........#####.#..#....##...##
....#...#...#....#.......#.....
#.......#........#.##.####..###
.#........#...##...#.....#....#
...#.............#........#.#.#
..##........#..##..##.##...#.#.
......##......#####.........##.
...##.....#.#.##....#####......
.#.#........####.......#.#....#
.....#..#.#.#.......##...#...#.
.....####.#...#.#..#...#..#...#
#..#.....#...#..#..#.#....#..#.
.....#.......#..#.##..#.#.....#
.......#..##..###......#.......
.......##.#.##..##.#.###...##..
..#.....#.....#....##.##.#..#.#
###.#...#..##..#....#.#.#..#.#.
#...#.#.........##........#....
#...#.#..###.....###..##.......
.....##..#.#...#.....#....#...#
##...##..#.#.#..#.#.##..#....##
.#.......#.#.........#.##..#...
....##.#............###.#...##.
#.....##.###.#..#....##.....#..
....#.#......##.####....#....#.
.....#......##.#...#....##.#...
##...#.............#...#.......
..#..#......#.#..#..#.....###..
....#...#.#...#...#.....#..###.
.....#.......#....#...#...#...#
..####......#.#..###...........
..........#....###.#.#.....###.
#.............#...#..#.###.#..#
.......#...#.#.#.#...##...#..#.
...#.#..#..#...###.#.#.........
#.###.#..#...#..#....#..#.#....
...#.#.##..#...#.#......###.##.
.##..#..##..#.....##.##....#.##
..##.........####..............
.#.#..###...#.........#...##.#.
....##.........#.........##...#
...#.#.......#..#...###.#.##.#.
..#....###......#.##...........
.......#...#.....#.#..#.#...#..
.##..#...#..#...#..#...#.#..##.
.##...#..##..##.#.#...##.......
.#.##.#...#..#..#..........#.#.
#.#.#...#......##...##..##.....
.##..#............#.##....#.#..
.##.........##..#.....#...#...#
##.#.#.#.#...#.....##....##.#..
#..##......#..##.........#.#...
...#....#.#.#.##.....##........
...#...#...#.##.#.#.#..#..#....
.......#..#.......##...#....##.
#.....#.#......#.......#.##.#.#
.##..#.....#.....#.#####.#....#
......#.#....#..............##.
##..#...........#.#.#.......#..
..##...###...#.#.........#....#
..##..#.#....##.....#.#.......#
....###...#.###....###.......#.
..#.#.....#..#..#...........##.
.###..#.#........#..#.....##.#.
#.##........###.#..#.....#....#
.#.#.....#.#.#..#...##.#...#...
#.#.#...#.#........#..##..##...
..#.##....###.#.......#.#.#....
.....#...##...................#
#..####.....###.#..........#...
#.##.........###.#........#..#.
..##........#.......#..###..#.#
##..##..#.#..#..#.....#.#..#...
....#......#....#...#.#.#..##.#
.##....#.##.#.#..###..#......##
###....###.##....##......###..#
.##....#..###..##..#.###...##..
.#.......##..##.............##.
.###..#.....#.....#.#.#..#...##
......##.###.#........#..#.....
#####.....##.#.#...#...#.#.#...
##..##.####...##....#...#.#...#
.#.##...#...#..#...............
##.##.#..#........#...#........
..#.##.#....#...#.#.###..#....#
.......#.#..#.....##.#.#...#.#.
..#.##...#...#......#...#.#.#..
.##.......##......#.....#......
.#....................#.#...###
..#.....#..##.#......##..#....#
.....#.#...#...........#.#...##
...#..#....#.#..#.......#..#..#
.#..#.#...#.#.#.....###........
.#.#.....#..#.##..#.#..##......
..##..#..#.....###.##..#.....##
.#..#.#...#.....#..#......##.#.
.##.##.#.#.#.#.#...###..##...#.
......#.##.#..#.##.#...#.#..#.#
..#.....#.##....#......#..#....
.#.....#..###.............#...#
.#.....#...#...#.#.#.#..#.#....
.#.....#......##.....#...#.#..#
.#.#......##...#......#......#.
##....#...#..##.#...#..#.......
....#.#......#.##...#.........#
#.#.##.#..#......#....#.......#
.#..#.##..#..#........#.#...#..
..#..#.#.#...#....#...#..#..###
....#....#..#......#..........#
#.....#.......#..#....#.#.#..#.
....#.#..###.#.....#.####......
##.#.#....##.#.#........#..#..#
#.#...#...#.#...##..#.#..#.#...
##.#......###.##.......#..#....
#..#...#.......##....#.###.....
.####.##....#..#..####.#....#.#
#...#.#..#.....................
..###..#...##.....##...........
..#....#...###.#.........##.##.
......#.....#....#.#....##...##
#..#.....#...#..##.....#....#.#
..#.#..#....##...###.#..##....#
#....#..#..#..#.##.##.....#...#
......#.#..#..##.#.....#.#..###
.....##...##..#...##..#...#....
##....#...#..#...##..#...###..#
.##.####..#......#.#..#.##....#
..###........###..#....##.#....
...#.....##...##..##..##..#....
.#..#.#..##..#..#..##.....#...#
##.#..##...#..#...........##...
....#..#..###.....#....#..#..##
......##..#....##........#.#.##
.#.##....##.#......#..##..#..##
.....##.#..#.#.##.##.##..#...#.
.#..##.#.....#####...#.........
....#....#...#..##.#.#..##...#.
...#..#...#............#..#....
....#.#.#.##....##.###..#.#....
.........#...###.........#..#.#
...........#...##.#..#.#.#..#..
#..#.###..#.#..#..##.....#....#
.#.#....#.#....#...............
...#.#..#.#..##.#.#.#.......#..
.#......#...#.####......#..#...
..##..#.#...#..#.......###.....
.#.....#.#..##....##.####.##.#.
.............##.#.#.....#..#.#.
#.....##.#...#.#.#.######.##...
.##...........#..#..##.####....
#.#............#....#.........#
..#.##.##.#..#....##....#..#.##
#...#.##..##.##.#.....##.#....#
##.#..##.###..#.#.#..........#.
...##...#..#...#.#.#.###.###...
#.....##......#...#.#...#......
#.#.#.#.#.#...#..#....###...#..
...##.#...#.......#..#...##.#..
..#..#..##.....#......##...###.
.............#.##...#.#.###..#.
..#.#.....##..#.##..#...##..#..
..#...#.##..###..........#..#..
#.##.##...###...........#....#.
#.....##...#.#..............#..
##..##.....#...#..####.#...##..
...........#......##.###..####.
#...#..##.##.######.....#.....#
#.##.........##.#.#....##...#..
.##.#.......###.#.....#.....###
###.#.#.#.#.#.##......#..#..#.#
....#.###...#....#.##...##.##..
....#..#.....#.#.#..#..##.#....
....#..#..#.....#.#..##........
..........#..##..##......##..#.
#...##.......#...##.#...###..#.
..#.#.##.....##....#..#.##...#.
.#.#.....#.......##.....##...#.
#......#.........#.#.........#.
.......#...##......#.........#.
..##..........#....#..#.......#
.......#............#..#.#...#.
#..#....#.#..#....##..#........
....#..###.##..#.#..#.##..###..
....###............##.#....#.#.
..#..#.##...#....#..####...#...
..#....#...#...##...#.#.#..#...
..#.........#.#.......#........
.........##.##.#..#.#...#.#..##
#.....#.#....##.#####.......##.
.#..#....#......#.##..#....#...
........#....#...........#...#.
.......#......#..........#..##.
.###.#......#..#.##..#...#.#...
.....#..#..###...........#...#.
..#...##....###......#....#....
...#.#..#.#.#......#.##.###.#.#
.##....#...#..#.#..#........#..
......##.###...##.#.#.........#
.#...#..####..#.#..##........#.
#..#...#..#..#.#...#..##...#..#
..###...###....#.#.#.##....#..#
.#.#....#.#.#......##....#..#.#
##.#.#.####....#........#....#.
...#......#........#...........
#.#............##......#.##....
..##.#...#.....#.#..#.#..#.#.#.
#.......##.....##...#.#.#...###
............#..#..#....#......#
.#.##...###...#...###..#.......
...............#....#...#.#.#..
#..##..##.###...#..##...#.#.##.
..#..#.......#.##......#..#..#.
#.....#............#......#...#
.###.##......##.#...#.#.##..#..
.#..##..#..#..#.............#..
#...#...##..##........#........
...#........#..###...........#.
#.#..#.#...................#.##
#...#.#..#.......##...###..#.#.
..####......#....#.#....#..#..#
....#...........#...#..#.......
...#..#....#.#.##...#.#.#.#....
#...##.#.##..#.......#.....#...
.##....#...#.#....#....#.#...#.
##.#...#.#...##..#..##...##..#.
#..#.#.........#.......#.......
.....##.....#..#......##....#.#
.###...##.#.#.#....#....#....#.
#.#.#.............#.#..#.......
#.......#..............#...#.##
.#.#...#....#.........###...#.#
..##..###..#...#...#.#....##..#
.#..#.#...#..#.....#....#..##..
##.......##....#....###..#.#..#
#.#.#####..........#.#...##..##
......#..#..#...#...##...#....#
#..#......#...#...#..###.......
...####.....#.......#.#...##.#.
......#..#.....##..#...........
#........#..#...#.....#...#.#..
..#.....#..#......#.#.#.....#..
..#.........#..##...#...#...#..
##..##......#.........#........
..#..#....#.##.#....###.#..#.##
..##..#..#.......###....#..#...
...#.#...#.....####.#..........
........#..#..#.#.....#........
...##..........#.#.#.....#..#..
..#....#.......#...............
.#..#.#.#.##..#..#.....#.......
#.##.#.#..#..............#.....
.#.#..#.....##..##....##.....#.
.##.#..#........##.##...##.....
#....##..#............#....#...
...............##.#...#..#.....
..#..##.##...#.#.....#.........
.##..#.#.#.##.....#.#.#..#..##.
......#####.#...#..........##..
..........##.##...#.....#.#....
..##......#..#.###..#...#.##...
.#...........#.....#.#........#
.#...#................#......#.
#...#.#..##.#####..##....#.....
...##...##..#.#..........#.....
##............#......##..##...#
###.#.......#..#...#..#..#...#.
.#..##.....###.#.#............#
##.###.#.........#.......#.#..#
...#..##..#.....#.......#......
......#.#..#.....##..#..##.....
...#........##..###.#....#..#..
..#...##.##....#.##..###......#
..#...#.....#.####.....#...#.##
..........##....###..#...#####.
....#.#.#.#.#.##.............##
.#.#.#.##......#......#....#.#.
.##...##....#...#....#..###.#.#\
"""
|
class Coord(tuple):
def __add__(self, other):
if isinstance(other, Coord) and len(self) == len(other):
return coord((i + j for (i, j) in zip(self, other)))
def trees(inp, step: tuple):
step = coord(step)
current = step
while current[0] < len(inp):
yield (inp[current[0]][current[1] % len(inp[0])] == '#')
current += step
example_data = '..##.......\n#...#...#..\n.#....#..#.\n..#.#...#.#\n.#...##..#.\n..#.##.....\n.#.#.#....#\n.#........#\n#.##...#...\n#...##....#\n.#..#...#.#'
data = '....#.#..#.#.#.#......#....##.#\n..##..#.#..#.##.....#.....#....\n....#..#...#..#..####.##.#.##..\n...............#.....##..##..#.\n##...####..##.#..#...####...#.#\n..#.#....##....##.........#...#\n.#..#.##..............#.....###\n##..##..#.....#..#...#....#....\n.#.........#..#...#.#.#.....#..\n......#...#..#.##..#.....#.#...\n.#...#.#.#.##.##.....###...#...\n..........#.......#...#....#..#\n.....##..#.#...#...##.##.......\n...#.###.#.#..##...#.#.........\n###.###....#...###.#.##...#....\n...........#....#.....##....###\n#..#.......#.....#.....##....#.\n.##.#....#...#....#......#..##.\n..#....#..#..#......#..........\n#..#.........#.#....#.##...#.#.\n#....#.#.......#.#.#.#.......#.\n.#....#....#..##.##.#....#.#...\n............#....#.#.#........#\n#..#..#.....#....#.##.##.#....#\n....#......#..##..#....#...#...\n.............#.##....####...##.\n#.##..##..##.#.....#...........\n#.#...#......####.##..#.#......\n.......#.#..#...#.#.###.......#\n#..#..........#...#....#.......\n###...#.....#....#...#..#...#..\n...##..#.#.....#..#..#...#.#.##\n#.......#......##...##......#..\n.....#..#.....#......#.....##..\n..#.....###......#.#..###....#.\n....##........#...##.#..#..#...\n#...#.##...##..#####...##..##..\n...#.#.#.#.....#.#.........##..\n.............#......#..##...#..\n.#..#...##....#......#......#..\n#.....#...##......#............\n.#.#....##.#.#..##..#####..##..\n..#..#.....#..#.##..#.#......##\n.......#...#...#..#..##.#..##..\n...#.##....#....#..#..#..#.....\n.....#......#.....#.....#..#.#.\n..........#####.#..#....##...##\n....#...#...#....#.......#.....\n#.......#........#.##.####..###\n.#........#...##...#.....#....#\n...#.............#........#.#.#\n..##........#..##..##.##...#.#.\n......##......#####.........##.\n...##.....#.#.##....#####......\n.#.#........####.......#.#....#\n.....#..#.#.#.......##...#...#.\n.....####.#...#.#..#...#..#...#\n#..#.....#...#..#..#.#....#..#.\n.....#.......#..#.##..#.#.....#\n.......#..##..###......#.......\n.......##.#.##..##.#.###...##..\n..#.....#.....#....##.##.#..#.#\n###.#...#..##..#....#.#.#..#.#.\n#...#.#.........##........#....\n#...#.#..###.....###..##.......\n.....##..#.#...#.....#....#...#\n##...##..#.#.#..#.#.##..#....##\n.#.......#.#.........#.##..#...\n....##.#............###.#...##.\n#.....##.###.#..#....##.....#..\n....#.#......##.####....#....#.\n.....#......##.#...#....##.#...\n##...#.............#...#.......\n..#..#......#.#..#..#.....###..\n....#...#.#...#...#.....#..###.\n.....#.......#....#...#...#...#\n..####......#.#..###...........\n..........#....###.#.#.....###.\n#.............#...#..#.###.#..#\n.......#...#.#.#.#...##...#..#.\n...#.#..#..#...###.#.#.........\n#.###.#..#...#..#....#..#.#....\n...#.#.##..#...#.#......###.##.\n.##..#..##..#.....##.##....#.##\n..##.........####..............\n.#.#..###...#.........#...##.#.\n....##.........#.........##...#\n...#.#.......#..#...###.#.##.#.\n..#....###......#.##...........\n.......#...#.....#.#..#.#...#..\n.##..#...#..#...#..#...#.#..##.\n.##...#..##..##.#.#...##.......\n.#.##.#...#..#..#..........#.#.\n#.#.#...#......##...##..##.....\n.##..#............#.##....#.#..\n.##.........##..#.....#...#...#\n##.#.#.#.#...#.....##....##.#..\n#..##......#..##.........#.#...\n...#....#.#.#.##.....##........\n...#...#...#.##.#.#.#..#..#....\n.......#..#.......##...#....##.\n#.....#.#......#.......#.##.#.#\n.##..#.....#.....#.#####.#....#\n......#.#....#..............##.\n##..#...........#.#.#.......#..\n..##...###...#.#.........#....#\n..##..#.#....##.....#.#.......#\n....###...#.###....###.......#.\n..#.#.....#..#..#...........##.\n.###..#.#........#..#.....##.#.\n#.##........###.#..#.....#....#\n.#.#.....#.#.#..#...##.#...#...\n#.#.#...#.#........#..##..##...\n..#.##....###.#.......#.#.#....\n.....#...##...................#\n#..####.....###.#..........#...\n#.##.........###.#........#..#.\n..##........#.......#..###..#.#\n##..##..#.#..#..#.....#.#..#...\n....#......#....#...#.#.#..##.#\n.##....#.##.#.#..###..#......##\n###....###.##....##......###..#\n.##....#..###..##..#.###...##..\n.#.......##..##.............##.\n.###..#.....#.....#.#.#..#...##\n......##.###.#........#..#.....\n#####.....##.#.#...#...#.#.#...\n##..##.####...##....#...#.#...#\n.#.##...#...#..#...............\n##.##.#..#........#...#........\n..#.##.#....#...#.#.###..#....#\n.......#.#..#.....##.#.#...#.#.\n..#.##...#...#......#...#.#.#..\n.##.......##......#.....#......\n.#....................#.#...###\n..#.....#..##.#......##..#....#\n.....#.#...#...........#.#...##\n...#..#....#.#..#.......#..#..#\n.#..#.#...#.#.#.....###........\n.#.#.....#..#.##..#.#..##......\n..##..#..#.....###.##..#.....##\n.#..#.#...#.....#..#......##.#.\n.##.##.#.#.#.#.#...###..##...#.\n......#.##.#..#.##.#...#.#..#.#\n..#.....#.##....#......#..#....\n.#.....#..###.............#...#\n.#.....#...#...#.#.#.#..#.#....\n.#.....#......##.....#...#.#..#\n.#.#......##...#......#......#.\n##....#...#..##.#...#..#.......\n....#.#......#.##...#.........#\n#.#.##.#..#......#....#.......#\n.#..#.##..#..#........#.#...#..\n..#..#.#.#...#....#...#..#..###\n....#....#..#......#..........#\n#.....#.......#..#....#.#.#..#.\n....#.#..###.#.....#.####......\n##.#.#....##.#.#........#..#..#\n#.#...#...#.#...##..#.#..#.#...\n##.#......###.##.......#..#....\n#..#...#.......##....#.###.....\n.####.##....#..#..####.#....#.#\n#...#.#..#.....................\n..###..#...##.....##...........\n..#....#...###.#.........##.##.\n......#.....#....#.#....##...##\n#..#.....#...#..##.....#....#.#\n..#.#..#....##...###.#..##....#\n#....#..#..#..#.##.##.....#...#\n......#.#..#..##.#.....#.#..###\n.....##...##..#...##..#...#....\n##....#...#..#...##..#...###..#\n.##.####..#......#.#..#.##....#\n..###........###..#....##.#....\n...#.....##...##..##..##..#....\n.#..#.#..##..#..#..##.....#...#\n##.#..##...#..#...........##...\n....#..#..###.....#....#..#..##\n......##..#....##........#.#.##\n.#.##....##.#......#..##..#..##\n.....##.#..#.#.##.##.##..#...#.\n.#..##.#.....#####...#.........\n....#....#...#..##.#.#..##...#.\n...#..#...#............#..#....\n....#.#.#.##....##.###..#.#....\n.........#...###.........#..#.#\n...........#...##.#..#.#.#..#..\n#..#.###..#.#..#..##.....#....#\n.#.#....#.#....#...............\n...#.#..#.#..##.#.#.#.......#..\n.#......#...#.####......#..#...\n..##..#.#...#..#.......###.....\n.#.....#.#..##....##.####.##.#.\n.............##.#.#.....#..#.#.\n#.....##.#...#.#.#.######.##...\n.##...........#..#..##.####....\n#.#............#....#.........#\n..#.##.##.#..#....##....#..#.##\n#...#.##..##.##.#.....##.#....#\n##.#..##.###..#.#.#..........#.\n...##...#..#...#.#.#.###.###...\n#.....##......#...#.#...#......\n#.#.#.#.#.#...#..#....###...#..\n...##.#...#.......#..#...##.#..\n..#..#..##.....#......##...###.\n.............#.##...#.#.###..#.\n..#.#.....##..#.##..#...##..#..\n..#...#.##..###..........#..#..\n#.##.##...###...........#....#.\n#.....##...#.#..............#..\n##..##.....#...#..####.#...##..\n...........#......##.###..####.\n#...#..##.##.######.....#.....#\n#.##.........##.#.#....##...#..\n.##.#.......###.#.....#.....###\n###.#.#.#.#.#.##......#..#..#.#\n....#.###...#....#.##...##.##..\n....#..#.....#.#.#..#..##.#....\n....#..#..#.....#.#..##........\n..........#..##..##......##..#.\n#...##.......#...##.#...###..#.\n..#.#.##.....##....#..#.##...#.\n.#.#.....#.......##.....##...#.\n#......#.........#.#.........#.\n.......#...##......#.........#.\n..##..........#....#..#.......#\n.......#............#..#.#...#.\n#..#....#.#..#....##..#........\n....#..###.##..#.#..#.##..###..\n....###............##.#....#.#.\n..#..#.##...#....#..####...#...\n..#....#...#...##...#.#.#..#...\n..#.........#.#.......#........\n.........##.##.#..#.#...#.#..##\n#.....#.#....##.#####.......##.\n.#..#....#......#.##..#....#...\n........#....#...........#...#.\n.......#......#..........#..##.\n.###.#......#..#.##..#...#.#...\n.....#..#..###...........#...#.\n..#...##....###......#....#....\n...#.#..#.#.#......#.##.###.#.#\n.##....#...#..#.#..#........#..\n......##.###...##.#.#.........#\n.#...#..####..#.#..##........#.\n#..#...#..#..#.#...#..##...#..#\n..###...###....#.#.#.##....#..#\n.#.#....#.#.#......##....#..#.#\n##.#.#.####....#........#....#.\n...#......#........#...........\n#.#............##......#.##....\n..##.#...#.....#.#..#.#..#.#.#.\n#.......##.....##...#.#.#...###\n............#..#..#....#......#\n.#.##...###...#...###..#.......\n...............#....#...#.#.#..\n#..##..##.###...#..##...#.#.##.\n..#..#.......#.##......#..#..#.\n#.....#............#......#...#\n.###.##......##.#...#.#.##..#..\n.#..##..#..#..#.............#..\n#...#...##..##........#........\n...#........#..###...........#.\n#.#..#.#...................#.##\n#...#.#..#.......##...###..#.#.\n..####......#....#.#....#..#..#\n....#...........#...#..#.......\n...#..#....#.#.##...#.#.#.#....\n#...##.#.##..#.......#.....#...\n.##....#...#.#....#....#.#...#.\n##.#...#.#...##..#..##...##..#.\n#..#.#.........#.......#.......\n.....##.....#..#......##....#.#\n.###...##.#.#.#....#....#....#.\n#.#.#.............#.#..#.......\n#.......#..............#...#.##\n.#.#...#....#.........###...#.#\n..##..###..#...#...#.#....##..#\n.#..#.#...#..#.....#....#..##..\n##.......##....#....###..#.#..#\n#.#.#####..........#.#...##..##\n......#..#..#...#...##...#....#\n#..#......#...#...#..###.......\n...####.....#.......#.#...##.#.\n......#..#.....##..#...........\n#........#..#...#.....#...#.#..\n..#.....#..#......#.#.#.....#..\n..#.........#..##...#...#...#..\n##..##......#.........#........\n..#..#....#.##.#....###.#..#.##\n..##..#..#.......###....#..#...\n...#.#...#.....####.#..........\n........#..#..#.#.....#........\n...##..........#.#.#.....#..#..\n..#....#.......#...............\n.#..#.#.#.##..#..#.....#.......\n#.##.#.#..#..............#.....\n.#.#..#.....##..##....##.....#.\n.##.#..#........##.##...##.....\n#....##..#............#....#...\n...............##.#...#..#.....\n..#..##.##...#.#.....#.........\n.##..#.#.#.##.....#.#.#..#..##.\n......#####.#...#..........##..\n..........##.##...#.....#.#....\n..##......#..#.###..#...#.##...\n.#...........#.....#.#........#\n.#...#................#......#.\n#...#.#..##.#####..##....#.....\n...##...##..#.#..........#.....\n##............#......##..##...#\n###.#.......#..#...#..#..#...#.\n.#..##.....###.#.#............#\n##.###.#.........#.......#.#..#\n...#..##..#.....#.......#......\n......#.#..#.....##..#..##.....\n...#........##..###.#....#..#..\n..#...##.##....#.##..###......#\n..#...#.....#.####.....#...#.##\n..........##....###..#...#####.\n....#.#.#.#.#.##.............##\n.#.#.#.##......#......#....#.#.\n.##...##....#...#....#..###.#.#'
|
DOWNLOAD_CHUNK_SIZE = 32768
FETCH_LIMIT = 200
def count_motions(db, project_ids=None, institution_ids=None, description_filter=None):
count = db.countMotions(None, project_ids, institution_ids, None, None, description_filter)
return count
def fetch_motions(db, project_ids=None, institution_ids=None, description_filter=None, max_subjects=None, max_objects=None):
offset = 0
motions = []
while True:
ms = db.listMotions(None, project_ids, institution_ids, None, None, description_filter, 'id', FETCH_LIMIT, offset)
filtered_ms = ms
if max_subjects is not None:
filtered_ms = [m for m in filtered_ms if len(m.associatedSubjects) <= max_subjects]
if max_objects is not None:
filtered_ms = [m for m in filtered_ms if len(m.associatedObjects) <= max_objects]
motions.extend(filtered_ms)
offset += FETCH_LIMIT
if len(ms) != FETCH_LIMIT:
break
return motions
def read_file(reader):
size = reader.getSize()
data = ''
try:
# We cannot just read the entire file b/c readChunk() seems to have an limit.
remaining_size = size
while remaining_size > 0:
s = min(remaining_size, DOWNLOAD_CHUNK_SIZE)
data += reader.readChunk(s)
remaining_size -= s
except:
data = None
return data
|
download_chunk_size = 32768
fetch_limit = 200
def count_motions(db, project_ids=None, institution_ids=None, description_filter=None):
count = db.countMotions(None, project_ids, institution_ids, None, None, description_filter)
return count
def fetch_motions(db, project_ids=None, institution_ids=None, description_filter=None, max_subjects=None, max_objects=None):
offset = 0
motions = []
while True:
ms = db.listMotions(None, project_ids, institution_ids, None, None, description_filter, 'id', FETCH_LIMIT, offset)
filtered_ms = ms
if max_subjects is not None:
filtered_ms = [m for m in filtered_ms if len(m.associatedSubjects) <= max_subjects]
if max_objects is not None:
filtered_ms = [m for m in filtered_ms if len(m.associatedObjects) <= max_objects]
motions.extend(filtered_ms)
offset += FETCH_LIMIT
if len(ms) != FETCH_LIMIT:
break
return motions
def read_file(reader):
size = reader.getSize()
data = ''
try:
remaining_size = size
while remaining_size > 0:
s = min(remaining_size, DOWNLOAD_CHUNK_SIZE)
data += reader.readChunk(s)
remaining_size -= s
except:
data = None
return data
|
# Recursive function to perform pre-order traversal of the tree
def preorder(root):
# return if the current node is empty
if root is None:
return
# Display the data part of the root (or current node)
print(root.data, end=' ')
# Traverse the left subtree
preorder(root.left)
# Traverse the right subtree
preorder(root.right)
|
def preorder(root):
if root is None:
return
print(root.data, end=' ')
preorder(root.left)
preorder(root.right)
|
# defining object file1 to
# open GeeksforGeeks file in
# read mode
file1 = open('GeeksforGeeks.txt',
'r')
# defining object file2 to
# open GeeksforGeeksUpdated file
# in write mode
file2 = open('GeeksforGeeksUpdated.txt',
'w')
# reading each line from original
# text file
for line in file1.readlines():
# reading all lines that do not
# begin with "TextGenerator"
if not (line.startswith('TextGenerator')):
# printing those lines
print(line)
# storing only those lines that
# do not begin with "TextGenerator"
file2.write(line)
# close and save the files
file2.close()
file1.close()
|
file1 = open('GeeksforGeeks.txt', 'r')
file2 = open('GeeksforGeeksUpdated.txt', 'w')
for line in file1.readlines():
if not line.startswith('TextGenerator'):
print(line)
file2.write(line)
file2.close()
file1.close()
|
template_string = '''#!/bin/bash
#PBS -S /bin/bash
#PBS -N ${jobname}
#PBS -m n
#PBS -l walltime=$walltime
#PBS -l select=${nodes_per_block}:ncpus=${ncpus}${select_options}
#PBS -o ${submit_script_dir}/${jobname}.submit.stdout
#PBS -e ${submit_script_dir}/${jobname}.submit.stderr
${scheduler_options}
${worker_init}
export JOBNAME="${jobname}"
${user_script}
'''
|
template_string = '#!/bin/bash\n\n#PBS -S /bin/bash\n#PBS -N ${jobname}\n#PBS -m n\n#PBS -l walltime=$walltime\n#PBS -l select=${nodes_per_block}:ncpus=${ncpus}${select_options}\n#PBS -o ${submit_script_dir}/${jobname}.submit.stdout\n#PBS -e ${submit_script_dir}/${jobname}.submit.stderr\n${scheduler_options}\n\n${worker_init}\n\nexport JOBNAME="${jobname}"\n\n${user_script}\n\n'
|
number = "7316717653133062491922511967442657474235534919493496983520312774506326239578318016984801869478851843858615607891129494954595017379583319528532088055111254069874715852386305071569329096329522744304355766896648950445244523161731856403098711121722383113622298934233803081353362766142828064444866452387493035890729629049156044077239071381051585930796086670172427121883998797908792274921901699720888093776657273330010533678812202354218097512545405947522435258490771167055601360483958644670632441572215539753697817977846174064955149290862569321978468622482839722413756570560574902614079729686524145351004748216637048440319989000889524345065854122758866688116427171479924442928230863465674813919123162824586178664583591245665294765456828489128831426076900422421902267105562632111110937054421750694165896040807198403850962455444362981230987879927244284909188845801561660979191338754992005240636899125607176060588611646710940507754100225698315520005593572972571636269561882670428252483600823257530420752963450"
number = [int(digit) for digit in number]
print(type(number))
highest = 0
i = 0
product = 1
while i < len(number)-12:
for index in range(13):
product = product * number[i + index]
if product > highest:
highest = product
print(highest)
product = 1
i = i + 1
print(highest)
|
number = '7316717653133062491922511967442657474235534919493496983520312774506326239578318016984801869478851843858615607891129494954595017379583319528532088055111254069874715852386305071569329096329522744304355766896648950445244523161731856403098711121722383113622298934233803081353362766142828064444866452387493035890729629049156044077239071381051585930796086670172427121883998797908792274921901699720888093776657273330010533678812202354218097512545405947522435258490771167055601360483958644670632441572215539753697817977846174064955149290862569321978468622482839722413756570560574902614079729686524145351004748216637048440319989000889524345065854122758866688116427171479924442928230863465674813919123162824586178664583591245665294765456828489128831426076900422421902267105562632111110937054421750694165896040807198403850962455444362981230987879927244284909188845801561660979191338754992005240636899125607176060588611646710940507754100225698315520005593572972571636269561882670428252483600823257530420752963450'
number = [int(digit) for digit in number]
print(type(number))
highest = 0
i = 0
product = 1
while i < len(number) - 12:
for index in range(13):
product = product * number[i + index]
if product > highest:
highest = product
print(highest)
product = 1
i = i + 1
print(highest)
|
# This program demonstrates the use of the == operator using numbers
print (5 == 6)
# Using variables
x = 5
y = 8
print(x == y)
|
print(5 == 6)
x = 5
y = 8
print(x == y)
|
class Core:
def gen_range(self, StartNumber, EndNumber, GapNumber):
number_range_result = []
row_number_sp = StartNumber
gap = int(EndNumber) - int(StartNumber)
if gap > GapNumber:
for X in range(int(gap / GapNumber)):
temp = []
temp.append(row_number_sp)
temp.append(row_number_sp + GapNumber)
number_range_result.append(temp)
row_number_sp += GapNumber
temp = []
temp.append(row_number_sp)
temp.append(row_number_sp + int(gap % GapNumber))
number_range_result.append(temp)
row_number_sp += int(gap % GapNumber)
else:
number_range_result.append([StartNumber, EndNumber])
return number_range_result
def byte_to_gb(self, data, round_num=0):
if type(data) is int:
return round(int(data) / 1024 / 1024 / 1024, round_num)
else:
raise TypeError
|
class Core:
def gen_range(self, StartNumber, EndNumber, GapNumber):
number_range_result = []
row_number_sp = StartNumber
gap = int(EndNumber) - int(StartNumber)
if gap > GapNumber:
for x in range(int(gap / GapNumber)):
temp = []
temp.append(row_number_sp)
temp.append(row_number_sp + GapNumber)
number_range_result.append(temp)
row_number_sp += GapNumber
temp = []
temp.append(row_number_sp)
temp.append(row_number_sp + int(gap % GapNumber))
number_range_result.append(temp)
row_number_sp += int(gap % GapNumber)
else:
number_range_result.append([StartNumber, EndNumber])
return number_range_result
def byte_to_gb(self, data, round_num=0):
if type(data) is int:
return round(int(data) / 1024 / 1024 / 1024, round_num)
else:
raise TypeError
|
"""
Day 14 - Part 1
https://adventofcode.com/2021/day/14
By NORXND @ 14.12.2021
(C) NORXND 2021 - Under The MIT License
"""
input_file = open("Day14/input.txt", "r")
input_segments = input_file.read().split("\n\n")
template = input_segments[0]
rules = {}
for raw_rule in input_segments[1].splitlines():
rule = raw_rule.split(" -> ")
rules[rule[0]] = rule[1]
new_template = template
for step in range(10):
for i, char in enumerate(template):
# If last
if i+1 >= len(template):
continue
rule = char + template[i+1]
if rule in rules:
to_insert = rules[rule].lower()
start = new_template.find(rule)
end = (start + 2)
new_template = new_template[:start+1] + to_insert + new_template[end-1:]
template = new_template.upper()
new_template = template
chars = {}
for char in template:
if char in chars:
chars[char] = chars[char] + 1
else:
chars[char] = 1
print(max(chars.values())-min(chars.values()))
|
"""
Day 14 - Part 1
https://adventofcode.com/2021/day/14
By NORXND @ 14.12.2021
(C) NORXND 2021 - Under The MIT License
"""
input_file = open('Day14/input.txt', 'r')
input_segments = input_file.read().split('\n\n')
template = input_segments[0]
rules = {}
for raw_rule in input_segments[1].splitlines():
rule = raw_rule.split(' -> ')
rules[rule[0]] = rule[1]
new_template = template
for step in range(10):
for (i, char) in enumerate(template):
if i + 1 >= len(template):
continue
rule = char + template[i + 1]
if rule in rules:
to_insert = rules[rule].lower()
start = new_template.find(rule)
end = start + 2
new_template = new_template[:start + 1] + to_insert + new_template[end - 1:]
template = new_template.upper()
new_template = template
chars = {}
for char in template:
if char in chars:
chars[char] = chars[char] + 1
else:
chars[char] = 1
print(max(chars.values()) - min(chars.values()))
|
manager_num1 =10
manager_num2 =11
zhangsan_num1 = 22
num3 = 30
pp = 36
ll = 23
nishuia
|
manager_num1 = 10
manager_num2 = 11
zhangsan_num1 = 22
num3 = 30
pp = 36
ll = 23
nishuia
|
class FilterModule:
def filters(self):
return {
'user_home': self.user_home
}
def user_home(self, d, username):
for user in d["results"]:
if user["item"] == username:
return user["home"]
return ValueError("Cannot find the home directory for user {}".format(username))
|
class Filtermodule:
def filters(self):
return {'user_home': self.user_home}
def user_home(self, d, username):
for user in d['results']:
if user['item'] == username:
return user['home']
return value_error('Cannot find the home directory for user {}'.format(username))
|
class Solution:
def depthSumInverse(self, nestedList: List[NestedInteger]) -> int:
dic = {}
level = 0
q = collections.deque()
q.append(nestedList)
res = 0
while q:
size = len(q)
level += 1
sums = 0
for _ in range(size):
nl = q.popleft()
for n in nl:
if n.isInteger():
sums += n.getInteger()
else:
q.append(n.getList())
dic[level] = sums
for k, v in dic.items():
res += (level+1-k)*v
return res
|
class Solution:
def depth_sum_inverse(self, nestedList: List[NestedInteger]) -> int:
dic = {}
level = 0
q = collections.deque()
q.append(nestedList)
res = 0
while q:
size = len(q)
level += 1
sums = 0
for _ in range(size):
nl = q.popleft()
for n in nl:
if n.isInteger():
sums += n.getInteger()
else:
q.append(n.getList())
dic[level] = sums
for (k, v) in dic.items():
res += (level + 1 - k) * v
return res
|
class Solution:
def reverseWords(self, s: str) -> str:
# Using Python's built-in string manipulation methods
# Split the string into words at the spaces, reverse and join the
# individual words, then rejoin the words with a space
s = s.split(' ')
for i, word in enumerate(s):
s[i] = ''.join(list(reversed(word)))
return ' '.join(s)
|
class Solution:
def reverse_words(self, s: str) -> str:
s = s.split(' ')
for (i, word) in enumerate(s):
s[i] = ''.join(list(reversed(word)))
return ' '.join(s)
|
KEY_QUESTION_TYPE = 'question_type'
KEY_QUESTION = 'question'
KEY_ANSWER = 'answer'
KEY_OPTIONS = 'options'
KEY_COMPREHENSION = 'comprehension'
KEY_EXPLANATION = 'explanation'
|
key_question_type = 'question_type'
key_question = 'question'
key_answer = 'answer'
key_options = 'options'
key_comprehension = 'comprehension'
key_explanation = 'explanation'
|
def isExistingClassification(t):
pass
def getSrcNodeName(dst):
"""
Get the name of the node connected to the argument dst plug.
"""
pass
def getCollectionsRecursive(parent):
pass
def disconnect(src, dst):
pass
def findVolumeShader(shadingEngine, search='False'):
"""
Returns the volume shader (as MObject) of the given shading engine (as MObject).
"""
pass
def transferPlug(src, dst):
"""
Transfer the connection or value set on plug 'src' on to the plug 'dst'.
"""
pass
def findSurfaceShader(shadingEngine, search='False'):
"""
Returns the surface shader (as MObject) of the given shading engine (as MObject).
"""
pass
def findPlug(userNode, attr):
"""
Return plug corresponding to attr on argument userNode.
If the argument userNode is None, or the attribute is not found, None
is returned.
"""
pass
def disconnectSrc(src):
"""
Disconnect a source (readable) plug from all its destinations.
Note that a single plug can be both source and destination, so this
interface makes the disconnection intent explicit.
"""
pass
def isSurfaceShaderNode(obj):
pass
def getSrcUserNode(dst):
"""
Get the user node connected to the argument dst plug.
Note: Only applies to MPxNode derived nodes
If the dst plug is unconnected, None is returned.
"""
pass
def plugSrc(dstPlug):
"""
Return the source of a connected destination plug.
If the destination is unconnected, returns None.
"""
pass
def getOverridesRecursive(parent):
pass
def nameToUserNode(name):
pass
def isShadingType(typeName):
pass
def canOverrideNode(node):
pass
def createSrcMsgAttr(longName, shortName):
"""
Create a source (a.k.a. output, or readable) message attribute.
"""
pass
def deleteNode(node):
"""
Remove the argument node from the graph.
This function is undoable.
"""
pass
def connect(src, dst):
"""
Connect source plug to destination plug.
If the dst plug is None, the src plug will be disconnected from all its
destinations (if any). If the src plug is None, the dst plug will be
disconnected from its source (if any). If both are None, this function
does nothing. If the destination is already connected, it will be
disconnected.
"""
pass
def isExistingType(t):
pass
def getDstUserNodes(src):
"""
Get the user nodes connected to the argument src plug.
Note: Only applies to MPxNode derived nodes
If the src plug is unconnected, None is returned.
"""
pass
def plugDst(srcPlug):
"""
Return the destinations of a connected source plug.
If the source is unconnected, returns None.
"""
pass
def _recursiveSearch(colList):
"""
# Fonctions to compute the number of operations when layer are switched
"""
pass
def getTotalNumberOperations(model):
pass
def _isDestination(plug):
"""
Returns True if the given plug is a destination plug, and False otherwise.
If the plug is a compond attribute it returns True if any of it's children is a
destination plug.
"""
pass
def isShadingNode(obj):
pass
def disconnectDst(dst):
"""
Disconnect a destination (writable) plug from its source.
Note that a single plug can be both source and destination, so this
interface makes the disconnection intent explicit.
"""
pass
def findDisplacementShader(shadingEngine, search='False'):
"""
Returns the displacement shader (as MObject) of the given shading engine (as MObject).
"""
pass
def _findShader(shadingEngine, attribute, classification='None'):
"""
Returns the shader connected to given attribute on given shading engine.
Optionally search for nodes from input connections to the shading engines
satisfying classification if plug to attribute is not a destination and
a classification string is specified.
"""
pass
def isInheritedType(parentTypeName, childTypeName):
pass
def getSrcNode(dst):
"""
Get the node connected to the argument dst plug.
"""
pass
def createGenericAttr(longName, shortName):
pass
def nameToExistingUserNode(name):
pass
def _transferConnectedPlug(src, dst):
pass
def connectMsgToDst(userNode, dst):
"""
Connect the argument userNode's message attribute to the
argument dst plug.
If the userNode is None the dst plug is disconnected
from its sources.
If the dst plug is None the userNode's message plug
is disconnected from its destinations
"""
pass
def isSurfaceShaderType(typeName):
pass
def notUndoRedoing(f):
"""
Decorator that will call the decorated method only if not currently in undoing or redoing.
Particularly useful to prevent callbacks from generating commands since that would clear the redo stack.
"""
pass
def createDstMsgAttr(longName, shortName):
"""
Create a destination (a.k.a. input, or writable) message attribute.
"""
pass
kNoSuchNode = []
kSupportedVectorTypes = set()
kSupportedSimpleTypes = set()
kPlugTypeMismatch = []
|
def is_existing_classification(t):
pass
def get_src_node_name(dst):
"""
Get the name of the node connected to the argument dst plug.
"""
pass
def get_collections_recursive(parent):
pass
def disconnect(src, dst):
pass
def find_volume_shader(shadingEngine, search='False'):
"""
Returns the volume shader (as MObject) of the given shading engine (as MObject).
"""
pass
def transfer_plug(src, dst):
"""
Transfer the connection or value set on plug 'src' on to the plug 'dst'.
"""
pass
def find_surface_shader(shadingEngine, search='False'):
"""
Returns the surface shader (as MObject) of the given shading engine (as MObject).
"""
pass
def find_plug(userNode, attr):
"""
Return plug corresponding to attr on argument userNode.
If the argument userNode is None, or the attribute is not found, None
is returned.
"""
pass
def disconnect_src(src):
"""
Disconnect a source (readable) plug from all its destinations.
Note that a single plug can be both source and destination, so this
interface makes the disconnection intent explicit.
"""
pass
def is_surface_shader_node(obj):
pass
def get_src_user_node(dst):
"""
Get the user node connected to the argument dst plug.
Note: Only applies to MPxNode derived nodes
If the dst plug is unconnected, None is returned.
"""
pass
def plug_src(dstPlug):
"""
Return the source of a connected destination plug.
If the destination is unconnected, returns None.
"""
pass
def get_overrides_recursive(parent):
pass
def name_to_user_node(name):
pass
def is_shading_type(typeName):
pass
def can_override_node(node):
pass
def create_src_msg_attr(longName, shortName):
"""
Create a source (a.k.a. output, or readable) message attribute.
"""
pass
def delete_node(node):
"""
Remove the argument node from the graph.
This function is undoable.
"""
pass
def connect(src, dst):
"""
Connect source plug to destination plug.
If the dst plug is None, the src plug will be disconnected from all its
destinations (if any). If the src plug is None, the dst plug will be
disconnected from its source (if any). If both are None, this function
does nothing. If the destination is already connected, it will be
disconnected.
"""
pass
def is_existing_type(t):
pass
def get_dst_user_nodes(src):
"""
Get the user nodes connected to the argument src plug.
Note: Only applies to MPxNode derived nodes
If the src plug is unconnected, None is returned.
"""
pass
def plug_dst(srcPlug):
"""
Return the destinations of a connected source plug.
If the source is unconnected, returns None.
"""
pass
def _recursive_search(colList):
"""
# Fonctions to compute the number of operations when layer are switched
"""
pass
def get_total_number_operations(model):
pass
def _is_destination(plug):
"""
Returns True if the given plug is a destination plug, and False otherwise.
If the plug is a compond attribute it returns True if any of it's children is a
destination plug.
"""
pass
def is_shading_node(obj):
pass
def disconnect_dst(dst):
"""
Disconnect a destination (writable) plug from its source.
Note that a single plug can be both source and destination, so this
interface makes the disconnection intent explicit.
"""
pass
def find_displacement_shader(shadingEngine, search='False'):
"""
Returns the displacement shader (as MObject) of the given shading engine (as MObject).
"""
pass
def _find_shader(shadingEngine, attribute, classification='None'):
"""
Returns the shader connected to given attribute on given shading engine.
Optionally search for nodes from input connections to the shading engines
satisfying classification if plug to attribute is not a destination and
a classification string is specified.
"""
pass
def is_inherited_type(parentTypeName, childTypeName):
pass
def get_src_node(dst):
"""
Get the node connected to the argument dst plug.
"""
pass
def create_generic_attr(longName, shortName):
pass
def name_to_existing_user_node(name):
pass
def _transfer_connected_plug(src, dst):
pass
def connect_msg_to_dst(userNode, dst):
"""
Connect the argument userNode's message attribute to the
argument dst plug.
If the userNode is None the dst plug is disconnected
from its sources.
If the dst plug is None the userNode's message plug
is disconnected from its destinations
"""
pass
def is_surface_shader_type(typeName):
pass
def not_undo_redoing(f):
"""
Decorator that will call the decorated method only if not currently in undoing or redoing.
Particularly useful to prevent callbacks from generating commands since that would clear the redo stack.
"""
pass
def create_dst_msg_attr(longName, shortName):
"""
Create a destination (a.k.a. input, or writable) message attribute.
"""
pass
k_no_such_node = []
k_supported_vector_types = set()
k_supported_simple_types = set()
k_plug_type_mismatch = []
|
# 1. Property-specific details
# Timezone string follows TZ format (see https://en.wikipedia.org/wiki/List_of_tz_database_time_zones)
PROP_NAME = "Ascott Raffles Place Singapore"
TIMEZONE = "Asia/Singapore"
# 2. Languages expected to be in use at this property
BABEL_LOCALES = ('en', 'zh', 'ms', 'ta')
BABEL_DEFAULT_LOCALE = "en"
# 3. MySQL DB connection details
DEBUG = False
MYSQL_DATABASE_USER = 'root'
MYSQL_DATABASE_PASSWORD = 'classroom'
MYSQL_DATABASE_DB = 'Ascott_InvMgmt'
MYSQL_DATABASE_HOST = 'ascott.coxb3venarbl.ap-southeast-1.rds.amazonaws.com'
# ADVANCED SETTINGS
SECRET_KEY = 'development-key'
UPLOADS_DEFAULT_DEST = 'static/img/items/'
UPLOADS_DEFAULT_URL = 'http://localhost:5000/static/img/items/'
UPLOADED_IMAGES_DEST = 'static/img/items/'
UPLOADED_IMAGES_URL = 'http://localhost:5000/static/img/items/'
|
prop_name = 'Ascott Raffles Place Singapore'
timezone = 'Asia/Singapore'
babel_locales = ('en', 'zh', 'ms', 'ta')
babel_default_locale = 'en'
debug = False
mysql_database_user = 'root'
mysql_database_password = 'classroom'
mysql_database_db = 'Ascott_InvMgmt'
mysql_database_host = 'ascott.coxb3venarbl.ap-southeast-1.rds.amazonaws.com'
secret_key = 'development-key'
uploads_default_dest = 'static/img/items/'
uploads_default_url = 'http://localhost:5000/static/img/items/'
uploaded_images_dest = 'static/img/items/'
uploaded_images_url = 'http://localhost:5000/static/img/items/'
|
# -*- coding: utf-8 -*-
"""
Created on Fri May 31 16:00:39 2019
@author: Administrator
"""
class Solution:
def flipAndInvertImage(self, A: list) -> list:
for a in A:
p, q = 0, len(a)-1
while p<=q:
if p == q:
a[p] = 1 - a[p]
break
a[p], a[q] = a[q], a[p]
a[p] = 1 - a[p]
a[q] = 1 - a[q]
p += 1
q -= 1
return A
solu = Solution()
#A = [[1,1,0],[1,0,1],[0,0,0]]
A = [[1,1,0,0],[1,0,0,1],[0,1,1,1],[1,0,1,0]]
print(solu.flipAndInvertImage(A))
|
"""
Created on Fri May 31 16:00:39 2019
@author: Administrator
"""
class Solution:
def flip_and_invert_image(self, A: list) -> list:
for a in A:
(p, q) = (0, len(a) - 1)
while p <= q:
if p == q:
a[p] = 1 - a[p]
break
(a[p], a[q]) = (a[q], a[p])
a[p] = 1 - a[p]
a[q] = 1 - a[q]
p += 1
q -= 1
return A
solu = solution()
a = [[1, 1, 0, 0], [1, 0, 0, 1], [0, 1, 1, 1], [1, 0, 1, 0]]
print(solu.flipAndInvertImage(A))
|
"""
Given a 32-bit signed integer, reverse digits of an integer.
"""
class Solution:
def isPalindrome(self, x: int) -> bool:
if x < 0:
s = str(x)
s = s[1:]
a = int(s[::-1])
return -a
else:
s = str(x)
return int(s[::-1])
print(Solution().isPalindrome(123))
print(Solution().isPalindrome(-321))
|
"""
Given a 32-bit signed integer, reverse digits of an integer.
"""
class Solution:
def is_palindrome(self, x: int) -> bool:
if x < 0:
s = str(x)
s = s[1:]
a = int(s[::-1])
return -a
else:
s = str(x)
return int(s[::-1])
print(solution().isPalindrome(123))
print(solution().isPalindrome(-321))
|
result = []
for count in range (1,100):
if count % 3 == 0:
result.append("Fizz")
if count % 5 == 0:
result.append("Buzz")
else:
result.append(count)
print(result)
|
result = []
for count in range(1, 100):
if count % 3 == 0:
result.append('Fizz')
if count % 5 == 0:
result.append('Buzz')
else:
result.append(count)
print(result)
|
def on_data_received():
global cmd
cmd = serial.read_until(serial.delimiters(Delimiters.HASH))
basic.show_string(cmd)
if cmd == "0":
basic.show_leds("""
. # # # .
. # . # .
. # . # .
. # . # .
. # # # .
""")
elif cmd == "1":
basic.show_leds("""
. . # . .
. # # . .
. . # . .
. . # . .
. # # # .
""")
elif cmd == "2":
basic.show_leds("""
. # # # .
. . . # .
. # # # .
. # . . .
. # # # .
""")
elif cmd == "3":
basic.show_leds("""
. # # # .
. . . # .
. # # # .
. . . # .
. # # # .
""")
serial.on_data_received(serial.delimiters(Delimiters.HASH), on_data_received)
cmd = ""
isTemp = 1
period = 5
def on_forever():
global period, isTemp
if period >= 5:
period = 0
if isTemp == 1:
serial.write_string("!1:TEMP:" + ("" + str(input.temperature())) + "#")
isTemp = 0
else:
serial.write_string("!1:LIGHT:" + ("" + str(input.light_level())) + "#")
isTemp = 1
period = period + 1
basic.pause(1000)
basic.forever(on_forever)
|
def on_data_received():
global cmd
cmd = serial.read_until(serial.delimiters(Delimiters.HASH))
basic.show_string(cmd)
if cmd == '0':
basic.show_leds('\n . # # # .\n . # . # .\n . # . # .\n . # . # .\n . # # # .\n ')
elif cmd == '1':
basic.show_leds('\n . . # . .\n . # # . .\n . . # . .\n . . # . .\n . # # # .\n ')
elif cmd == '2':
basic.show_leds('\n . # # # .\n . . . # .\n . # # # .\n . # . . .\n . # # # .\n ')
elif cmd == '3':
basic.show_leds('\n . # # # .\n . . . # .\n . # # # .\n . . . # .\n . # # # .\n ')
serial.on_data_received(serial.delimiters(Delimiters.HASH), on_data_received)
cmd = ''
is_temp = 1
period = 5
def on_forever():
global period, isTemp
if period >= 5:
period = 0
if isTemp == 1:
serial.write_string('!1:TEMP:' + ('' + str(input.temperature())) + '#')
is_temp = 0
else:
serial.write_string('!1:LIGHT:' + ('' + str(input.light_level())) + '#')
is_temp = 1
period = period + 1
basic.pause(1000)
basic.forever(on_forever)
|
class SgfTree(object):
def __init__(self, properties=None, children=None):
self.properties = properties or {}
self.children = children or []
def __eq__(self, other):
if not isinstance(other, SgfTree):
return False
for k, v in self.properties.items():
if k not in other.properties:
return False
if other.properties[k] != v:
return False
for k in other.properties.keys():
if k not in self.properties:
return False
if len(self.children) != len(other.children):
return False
for a, b in zip(self.children, other.children):
if not (a == b):
return False
return True
def __repr__(self):
"""Ironically, encoding to SGF is much easier"""
rep = '(;'
for k, vs in self.properties.items():
rep += k
for v in vs:
rep += '[{}]'.format(v)
if self.children:
if len(self.children) > 1:
rep += '('
for c in self.children:
rep += repr(c)[1:-1]
if len(self.children) > 1:
rep += ')'
return rep + ')'
def is_upper(s):
a, z = map(ord, 'AZ')
return all(
a <= o and o <= z
for o in map(ord, s)
)
def parse(input_string):
root = None
current = None
stack = list(input_string)
def assert_that(condition):
if not condition:
raise ValueError(
'invalid format at {}:{}: {}'.format(
repr(input_string),
len(input_string) - len(stack),
repr(''.join(stack))
)
)
assert_that(stack)
def pop():
if stack[0] == '\\':
stack.pop(0)
ch = stack.pop(0)
return ' ' if ch in ['\t'] else ch
def peek():
return stack[0]
def pop_until(ch):
try:
v = ''
while peek() != ch:
v += pop()
return v
except IndexError:
raise ValueError('Unable to find {}'.format(ch))
while stack:
assert_that(pop() == '(' and peek() == ';')
while pop() == ';':
properties = {}
while is_upper(peek()):
key = pop_until('[')
assert_that(is_upper(key))
values = []
while peek() == '[':
pop()
values.append(pop_until(']'))
pop()
properties[key] = values
if root is None:
current = root = SgfTree(properties)
else:
current = SgfTree(properties)
root.children.append(current)
while peek() == '(':
child_input = pop() + pop_until(')') + pop()
current.children.append(parse(child_input))
return root
|
class Sgftree(object):
def __init__(self, properties=None, children=None):
self.properties = properties or {}
self.children = children or []
def __eq__(self, other):
if not isinstance(other, SgfTree):
return False
for (k, v) in self.properties.items():
if k not in other.properties:
return False
if other.properties[k] != v:
return False
for k in other.properties.keys():
if k not in self.properties:
return False
if len(self.children) != len(other.children):
return False
for (a, b) in zip(self.children, other.children):
if not a == b:
return False
return True
def __repr__(self):
"""Ironically, encoding to SGF is much easier"""
rep = '(;'
for (k, vs) in self.properties.items():
rep += k
for v in vs:
rep += '[{}]'.format(v)
if self.children:
if len(self.children) > 1:
rep += '('
for c in self.children:
rep += repr(c)[1:-1]
if len(self.children) > 1:
rep += ')'
return rep + ')'
def is_upper(s):
(a, z) = map(ord, 'AZ')
return all((a <= o and o <= z for o in map(ord, s)))
def parse(input_string):
root = None
current = None
stack = list(input_string)
def assert_that(condition):
if not condition:
raise value_error('invalid format at {}:{}: {}'.format(repr(input_string), len(input_string) - len(stack), repr(''.join(stack))))
assert_that(stack)
def pop():
if stack[0] == '\\':
stack.pop(0)
ch = stack.pop(0)
return ' ' if ch in ['\t'] else ch
def peek():
return stack[0]
def pop_until(ch):
try:
v = ''
while peek() != ch:
v += pop()
return v
except IndexError:
raise value_error('Unable to find {}'.format(ch))
while stack:
assert_that(pop() == '(' and peek() == ';')
while pop() == ';':
properties = {}
while is_upper(peek()):
key = pop_until('[')
assert_that(is_upper(key))
values = []
while peek() == '[':
pop()
values.append(pop_until(']'))
pop()
properties[key] = values
if root is None:
current = root = sgf_tree(properties)
else:
current = sgf_tree(properties)
root.children.append(current)
while peek() == '(':
child_input = pop() + pop_until(')') + pop()
current.children.append(parse(child_input))
return root
|
# <<<DBGL8R>>>
def add_floats(float_1, float_2):
""" Add two floating point numbers together. """
return float_1 + float_2
print('Hello world') # <<<DBGL8R
|
def add_floats(float_1, float_2):
""" Add two floating point numbers together. """
return float_1 + float_2
print('Hello world')
|
class ListView:
__slots__ = ['_list']
def __init__(self, list_object):
self._list = list_object
def __add__(self, other):
return self._list.__add__(other)
def __getitem__(self, other):
return self._list.__getitem__(other)
def __contains__(self, item):
return self._list.__contains__(item)
def __eq__(self, other):
return self._list.__eq__(other)
def __hash__(self):
return self._list.__hash__()
def __ge__(self, other):
if isinstance(other, ListView):
return self._list.__ge__(other._list)
return self._list.__ge__(other)
def __gt__(self, other):
if isinstance(other, ListView):
return self._list.__gt__(other._list)
return self._list.__gt__(other)
def __iter__(self):
return self._list.__iter__()
def __le__(self, other):
if isinstance(other, ListView):
return self._list.__le__(other._list)
return self._list.__le__(other)
def __len__(self):
return self._list.__len__()
def __lt__(self, other):
if isinstance(other, ListView):
return self._list.__lt__(other._list)
return self._list.__lt__(other)
def __ne__(self, other):
return self._list.__ne__(other)
def __mul__(self, other):
return self._list.__mul__(other)
def __rmul__(self, n):
return self._list.__rmul__(n)
def __reversed__(self):
return self._list.__reversed__()
def __repr__(self):
return self._list.__repr__()
def __str__(self):
return self._list.__str__()
def __radd__(self, other):
return other + self._list
def __iadd__(self, other):
raise TypeError("unsupported operator for type SetView")
def __imul__(self, other):
raise TypeError("unsupported operator for type SetView")
def copy(self):
return self._list.copy()
def count(self, object):
return self._list.count(object)
def index(self, *args, **kwargs):
return self._list.index(*args, **kwargs)
|
class Listview:
__slots__ = ['_list']
def __init__(self, list_object):
self._list = list_object
def __add__(self, other):
return self._list.__add__(other)
def __getitem__(self, other):
return self._list.__getitem__(other)
def __contains__(self, item):
return self._list.__contains__(item)
def __eq__(self, other):
return self._list.__eq__(other)
def __hash__(self):
return self._list.__hash__()
def __ge__(self, other):
if isinstance(other, ListView):
return self._list.__ge__(other._list)
return self._list.__ge__(other)
def __gt__(self, other):
if isinstance(other, ListView):
return self._list.__gt__(other._list)
return self._list.__gt__(other)
def __iter__(self):
return self._list.__iter__()
def __le__(self, other):
if isinstance(other, ListView):
return self._list.__le__(other._list)
return self._list.__le__(other)
def __len__(self):
return self._list.__len__()
def __lt__(self, other):
if isinstance(other, ListView):
return self._list.__lt__(other._list)
return self._list.__lt__(other)
def __ne__(self, other):
return self._list.__ne__(other)
def __mul__(self, other):
return self._list.__mul__(other)
def __rmul__(self, n):
return self._list.__rmul__(n)
def __reversed__(self):
return self._list.__reversed__()
def __repr__(self):
return self._list.__repr__()
def __str__(self):
return self._list.__str__()
def __radd__(self, other):
return other + self._list
def __iadd__(self, other):
raise type_error('unsupported operator for type SetView')
def __imul__(self, other):
raise type_error('unsupported operator for type SetView')
def copy(self):
return self._list.copy()
def count(self, object):
return self._list.count(object)
def index(self, *args, **kwargs):
return self._list.index(*args, **kwargs)
|
def print_with_linenumbers(*args, numberwidth=3):
"""Prints every argument in a new line and adds line numbers"""
for i,arg in enumerate(args):
print(f"{i:0{numberwidth}d}: {arg}")
|
def print_with_linenumbers(*args, numberwidth=3):
"""Prints every argument in a new line and adds line numbers"""
for (i, arg) in enumerate(args):
print(f'{i:0{numberwidth}d}: {arg}')
|
class DSSnet_hosts:
'class for meta process/IED info'
p_id = 0
def __init__(self, msg, IED_id, command, ip, pipe = True):
self.properties= msg
self.IED_id = IED_id
self.process_id= DSSnet_hosts.p_id
self.command = command
self.ip = ip
self.pipe = pipe
DSSnet_hosts.p_id +=1
def number_processes(self):
return DSSnet_hosts.p_id
def get_host_name(self):
return self.IED_id
def get_ip(self):
return self.ip
def get_process_command(self):
return self.command
def display_process(self):
return('%s : %s : %s \n' % (self.process_id , self.IED_id, self.properties))
|
class Dssnet_Hosts:
"""class for meta process/IED info"""
p_id = 0
def __init__(self, msg, IED_id, command, ip, pipe=True):
self.properties = msg
self.IED_id = IED_id
self.process_id = DSSnet_hosts.p_id
self.command = command
self.ip = ip
self.pipe = pipe
DSSnet_hosts.p_id += 1
def number_processes(self):
return DSSnet_hosts.p_id
def get_host_name(self):
return self.IED_id
def get_ip(self):
return self.ip
def get_process_command(self):
return self.command
def display_process(self):
return '%s : %s : %s \n' % (self.process_id, self.IED_id, self.properties)
|
'''
Longest Increasing Subarray
Find the longest increasing subarray (subarray is when all elements are neighboring in the original array).
Input: [10, 1, 3, 8, 2, 0, 5, 7, 12, 3]
Output: 4
=========================================
Only in one iteration, check if the current element is bigger than the previous and increase the counter if true.
Time Complexity: O(N)
Space Complexity: O(1)
'''
############
# Solution #
############
def longest_increasing_subarray(arr):
n = len(arr)
longest = 0
current = 1
i = 1
while i < n:
if arr[i] < arr[i - 1]:
longest = max(longest, current)
current = 1
else:
current += 1
i += 1
# check again for max, maybe the last element is a part of the longest subarray
return max(longest, current)
###########
# Testing #
###########
# Test 1
# Correct result => 4
print(longest_increasing_subarray([10, 1, 3, 8, 2, 0, 5, 7, 12, 3]))
|
"""
Longest Increasing Subarray
Find the longest increasing subarray (subarray is when all elements are neighboring in the original array).
Input: [10, 1, 3, 8, 2, 0, 5, 7, 12, 3]
Output: 4
=========================================
Only in one iteration, check if the current element is bigger than the previous and increase the counter if true.
Time Complexity: O(N)
Space Complexity: O(1)
"""
def longest_increasing_subarray(arr):
n = len(arr)
longest = 0
current = 1
i = 1
while i < n:
if arr[i] < arr[i - 1]:
longest = max(longest, current)
current = 1
else:
current += 1
i += 1
return max(longest, current)
print(longest_increasing_subarray([10, 1, 3, 8, 2, 0, 5, 7, 12, 3]))
|
# This method breaks up text into words for us
def break_words(text):
words = text.split()
return words
# Counts the number of words
def count_words(words):
return len(words)
# Sorts the words (alphabetically)
def sort_words(words):
words.sort()
return words
# Takes in a full sentence and returns the sorted words
def sort_sentence(sentence):
words = break_words(sentence)
return words
# Prints the first word after popping it off
def print_first_word(words):
word = words.pop(0)
return word
# Prints the last word after popping it off
def print_last_word(words):
word = words.pop()
return word
# Prints the first and last words of the sentence
def print_first_and_last_word(sentence):
words = break_words(sentence)
return ("{}\n{}".format(print_first_word(words), print_last_word(words)))
demitri_martin_joke = """I used to play sports.
Then I realized you can buy trophies. Now I am good at everything."""
print("----------")
print(demitri_martin_joke)
print("----------")
bottles_of_beer = 100 + 10 - 15 + 4
print("This should be ninety-nine:", bottles_of_beer)
def sing(bottles):
for number in reversed(range(bottles + 1)):
if number > 0:
print_verse(number)
else:
print_last_verse()
def print_verse(bottles):
print(bottles, "bottles of beer on the wall,", end=' ')
print(bottles, "bottles of beer.")
print("Take one down and pass it around,", end=' ')
print(bottles - 1, "bottles of beer on the wall.\n")
def print_last_verse():
print("No more bottles of beer on the wall,", end=' ')
print("no more bottles of beer.")
print("Go to the store and buy some more,", end=' ')
print("99 bottles of beer on the wall.\n")
# sing(bottles)
sing(99)
sentence = "I think it's interesting that 'cologne' rhymes with 'alone'"
words = break_words(sentence)
sorted_words = sort_words(sort_sentence(sentence))
print("\"{}\" has {} words".format(sentence, count_words(words)))
print("The words are:", words)
print("The sorted words are:", sorted_words)
print(print_first_word(words))
print(print_last_word(words))
print(print_first_and_last_word(sentence))
|
def break_words(text):
words = text.split()
return words
def count_words(words):
return len(words)
def sort_words(words):
words.sort()
return words
def sort_sentence(sentence):
words = break_words(sentence)
return words
def print_first_word(words):
word = words.pop(0)
return word
def print_last_word(words):
word = words.pop()
return word
def print_first_and_last_word(sentence):
words = break_words(sentence)
return '{}\n{}'.format(print_first_word(words), print_last_word(words))
demitri_martin_joke = 'I used to play sports.\nThen I realized you can buy trophies. Now I am good at everything.'
print('----------')
print(demitri_martin_joke)
print('----------')
bottles_of_beer = 100 + 10 - 15 + 4
print('This should be ninety-nine:', bottles_of_beer)
def sing(bottles):
for number in reversed(range(bottles + 1)):
if number > 0:
print_verse(number)
else:
print_last_verse()
def print_verse(bottles):
print(bottles, 'bottles of beer on the wall,', end=' ')
print(bottles, 'bottles of beer.')
print('Take one down and pass it around,', end=' ')
print(bottles - 1, 'bottles of beer on the wall.\n')
def print_last_verse():
print('No more bottles of beer on the wall,', end=' ')
print('no more bottles of beer.')
print('Go to the store and buy some more,', end=' ')
print('99 bottles of beer on the wall.\n')
sing(99)
sentence = "I think it's interesting that 'cologne' rhymes with 'alone'"
words = break_words(sentence)
sorted_words = sort_words(sort_sentence(sentence))
print('"{}" has {} words'.format(sentence, count_words(words)))
print('The words are:', words)
print('The sorted words are:', sorted_words)
print(print_first_word(words))
print(print_last_word(words))
print(print_first_and_last_word(sentence))
|
def esc_kw(kw):
""" Take a keyword and escape all the
Solr parts we want to escape!"""
kw = kw.replace('\\', '\\\\') # be sure to do this first, as we inject \!
kw = kw.replace('(', '\(')
kw = kw.replace(')', '\)')
kw = kw.replace('+', '\+')
kw = kw.replace('-', '\-')
kw = kw.replace(':', '\:')
kw = kw.replace('/', '\/')
kw = kw.replace(']', '\]')
kw = kw.replace('[', '\[')
kw = kw.replace('*', '\*')
kw = kw.replace('?', '\?')
kw = kw.replace('{', '\{')
kw = kw.replace('}', '\}')
kw = kw.replace('~', '\~')
return kw
|
def esc_kw(kw):
""" Take a keyword and escape all the
Solr parts we want to escape!"""
kw = kw.replace('\\', '\\\\')
kw = kw.replace('(', '\\(')
kw = kw.replace(')', '\\)')
kw = kw.replace('+', '\\+')
kw = kw.replace('-', '\\-')
kw = kw.replace(':', '\\:')
kw = kw.replace('/', '\\/')
kw = kw.replace(']', '\\]')
kw = kw.replace('[', '\\[')
kw = kw.replace('*', '\\*')
kw = kw.replace('?', '\\?')
kw = kw.replace('{', '\\{')
kw = kw.replace('}', '\\}')
kw = kw.replace('~', '\\~')
return kw
|
def main():
# input
a, b = input().split()
# compute
# output
print('H' if a==b else 'D')
if __name__ == '__main__':
main()
|
def main():
(a, b) = input().split()
print('H' if a == b else 'D')
if __name__ == '__main__':
main()
|
# -*- coding: utf-8 -*-
description = 'DNS detector setup'
group = 'lowlevel'
includes = ['counter']
sysconfig = dict(
datasinks = ['LiveView'],
)
tango_base = 'tango://phys.dns.frm2:10000/dns/'
devices = dict(
LiveView = device('nicos.devices.datasinks.LiveViewSink',
),
dettof = device('nicos_mlz.dns.devices.detector.TofChannel',
description = 'TOF data channel',
tangodevice = tango_base + 'sis/det',
readchannels = (0, 23),
readtimechan = (0, 1000),
),
det = device('nicos_mlz.dns.devices.detector.DNSDetector',
description = 'Tof detector',
timers = ['timer'],
monitors = ['mon1'],
images = ['dettof'],
others = ['chopctr'],
flipper = 'flipper',
),
)
extended = dict(
poller_cache_reader = ['flipper'],
representative = 'dettof',
)
startupcode = '''
SetDetectors(det)
'''
|
description = 'DNS detector setup'
group = 'lowlevel'
includes = ['counter']
sysconfig = dict(datasinks=['LiveView'])
tango_base = 'tango://phys.dns.frm2:10000/dns/'
devices = dict(LiveView=device('nicos.devices.datasinks.LiveViewSink'), dettof=device('nicos_mlz.dns.devices.detector.TofChannel', description='TOF data channel', tangodevice=tango_base + 'sis/det', readchannels=(0, 23), readtimechan=(0, 1000)), det=device('nicos_mlz.dns.devices.detector.DNSDetector', description='Tof detector', timers=['timer'], monitors=['mon1'], images=['dettof'], others=['chopctr'], flipper='flipper'))
extended = dict(poller_cache_reader=['flipper'], representative='dettof')
startupcode = '\nSetDetectors(det)\n'
|
#/* n=int(input("Enter the number to print the tables for:"))
#for i in range(1,11):
# print(n,"x",i,"=",n*i)
n=int(input("Enter the number"))
for i in range(1,11):
print (n ,"x", i, "=", n * i)
|
n = int(input('Enter the number'))
for i in range(1, 11):
print(n, 'x', i, '=', n * i)
|
# -*- coding: utf-8 -*-
"""
File: config.sample.py
- Copy `config.sample.py` to `config.py`.
"""
# Subscription Key for calling the Cognitive Face API.
FACE_API_KEY = "your_face_api_key"
# subscription key for speach API
SPEACH_API_KEY = "your_speach_api_key"
# Base URL for calling the Cognitive Face API.
BASE_URL = "your_base_url"
# Time (in seconds) for sleep between each call to avoid exceeding quota.
# Default to 3 as free subscription have limit of 20 calls per minute.
TIME_SLEEP = 3
# group id can be set by user but has to be a string, e.g. "foo_bar" or "hello_world"
GROUP_ID = "your_group_id"
|
"""
File: config.sample.py
- Copy `config.sample.py` to `config.py`.
"""
face_api_key = 'your_face_api_key'
speach_api_key = 'your_speach_api_key'
base_url = 'your_base_url'
time_sleep = 3
group_id = 'your_group_id'
|
class CMDDiffLevelEnum:
BreakingChange = 1 # diff breaking change part
Structure = 2 #
Associate = 5 # include diff for links
All = 10 # including description and help messages
|
class Cmddifflevelenum:
breaking_change = 1
structure = 2
associate = 5
all = 10
|
def isColoured(mult,i,j):
if i//mult%2==j//mult%2:
return True
return False
def colour(i,j):
col = False
for each in mults:
if isColoured(each,i,j):
col = (col==False)
return col
data = open("DATA21.txt")
input = data.readline
for j in range(10):
n = int(input())
mults = []
for i in range(1,int(n**0.5)+1):
if n%i==0:
mults.append(i)
mults.append(n/i)
mults.append(n)
mults = list(set(mults))
for i in range(5):
a,b = list(map(int,input().strip().split(" ")))
col = colour(a-1,b-1)
if col:
print("B",end="")
else:
print("G",end="")
print("")
|
def is_coloured(mult, i, j):
if i // mult % 2 == j // mult % 2:
return True
return False
def colour(i, j):
col = False
for each in mults:
if is_coloured(each, i, j):
col = col == False
return col
data = open('DATA21.txt')
input = data.readline
for j in range(10):
n = int(input())
mults = []
for i in range(1, int(n ** 0.5) + 1):
if n % i == 0:
mults.append(i)
mults.append(n / i)
mults.append(n)
mults = list(set(mults))
for i in range(5):
(a, b) = list(map(int, input().strip().split(' ')))
col = colour(a - 1, b - 1)
if col:
print('B', end='')
else:
print('G', end='')
print('')
|
def is_narcissistic_number(n):
original_number = n
number_of_digits = get_number_of_digits(n)
sum = 0
while n != 0:
sum += (n % 10) ** number_of_digits
n //= 10
return original_number == sum
def get_number_of_digits(n):
return len(str(n))
if __name__ == "__main__":
n = int(input("Enter number: "))
print("Is a Narcissistic Number" if is_narcissistic_number(n) else "Is NOT a Narcissistic Number")
|
def is_narcissistic_number(n):
original_number = n
number_of_digits = get_number_of_digits(n)
sum = 0
while n != 0:
sum += (n % 10) ** number_of_digits
n //= 10
return original_number == sum
def get_number_of_digits(n):
return len(str(n))
if __name__ == '__main__':
n = int(input('Enter number: '))
print('Is a Narcissistic Number' if is_narcissistic_number(n) else 'Is NOT a Narcissistic Number')
|
# Program to work with file input / output (i/o)
# This is pulling the days.txt file in this directory in this repo
path = 'days.txt'
days_file = open(path,'r')
days = days_file.read()
new_path = 'new_days.txt'
new_days = open(new_path,'w')
title = 'Days of the Week\n'
new_days.write(title)
print(title)
new_days.write(days)
print(days)
days_file.close()
new_days.close()
|
path = 'days.txt'
days_file = open(path, 'r')
days = days_file.read()
new_path = 'new_days.txt'
new_days = open(new_path, 'w')
title = 'Days of the Week\n'
new_days.write(title)
print(title)
new_days.write(days)
print(days)
days_file.close()
new_days.close()
|
#!/usr/bin/env python
# coding: utf-8
# In[3]:
# DEMO OF WEAK TYPING in PYTHON
# int age = 4 <-strongly typed variables, declare type along with id
age = 4; # we CANNOT declare a type for variable age
print(age)
print(type(age))
age = ('calico','calico','himalyian')
print(age)
print(type(age))
# # Allegheny county EMS dispatch analysis
# In[ ]:
# HIGH LEVEL GOAL:
# Source: WPRDC Data set on EMS/Fire dispatch via
# https://data.wprdc.org/dataset/allegheny-county-911-dispatches-ems-and-fire/resource/ff33ca18-2e0c-4cb5-bdcd-60a5dc3c0418?view_id=5007870f-c48b-4849-bb25-3e46c37f2dc7
# Determine the rate of redacted call descriptions across
# EMS dispatches
# Has the rate of redaction changed year over year?
# if so, how?
# TODO: download CSV file from WPRDC into a raw data directory
# Review the fields in the file on WPRDC
# In[ ]:
# Raw input: CSV file containing a header row of column names
# and 1 or more rows, each row representing a single EMS dispatch
# in Allegheny County in year X
# In[ ]:
def iterate_EMS_records(file_path):
'''
Retrieve each record from a CSV of EMS records from the filepath
Intended for use with the WPRDC's record of EMS dispatches
in Allegheny County and will provide a dictionary of each record
for use by processing functions
'''
# Open file at filepath
# Use for loop over each record
# In[ ]:
def test_for_redacted_description(ems_rec):
'''
Examine EMS dispatch record and look for redacted or blank
descriptions
'''
# In[ ]:
# Based on record check, increment count by year
def red_year_total(redaction_year):
'''
Maintains a dictionary of counts by year passed when called
Assumes that each call corresponds with a single record
in the EMS dispatch data set, so a call with input of '2019'
means, add 1 to the 2019 total of redacted records
'''
# In[ ]:
# Based on record check, write record ID to log file
def write_redacted_rec_to_log(ems_rec):
'''
Extract record ID and write to log file specific in global dict
'''
# In[ ]:
def display_redaction_count_by_year(year_counts):
'''
Given a dictionary of year(key):['total','redactions']
make a pretty output to the console
'''
# In[ ]:
# Desired output
# 1) Dictionary of format: { year:count_of_removed_records}
# 2) Text file whose rows are the record IDs of EMS
# dispatches whose description was removed/redacted
|
age = 4
print(age)
print(type(age))
age = ('calico', 'calico', 'himalyian')
print(age)
print(type(age))
def iterate_ems_records(file_path):
"""
Retrieve each record from a CSV of EMS records from the filepath
Intended for use with the WPRDC's record of EMS dispatches
in Allegheny County and will provide a dictionary of each record
for use by processing functions
"""
def test_for_redacted_description(ems_rec):
"""
Examine EMS dispatch record and look for redacted or blank
descriptions
"""
def red_year_total(redaction_year):
"""
Maintains a dictionary of counts by year passed when called
Assumes that each call corresponds with a single record
in the EMS dispatch data set, so a call with input of '2019'
means, add 1 to the 2019 total of redacted records
"""
def write_redacted_rec_to_log(ems_rec):
"""
Extract record ID and write to log file specific in global dict
"""
def display_redaction_count_by_year(year_counts):
"""
Given a dictionary of year(key):['total','redactions']
make a pretty output to the console
"""
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.