def get_optics(self):
optics_table = junos_views.junos_intf_optics_table(self.device)<EOL>optics_table.get()<EOL>optics_items = optics_table.items()<EOL>optics_items_with_lane = []<EOL>for intf_optic_item in optics_items:<EOL><INDENT>temp_list = list(intf_optic_item)<EOL>temp_list.insert(<NUM_LIT:1>, "<STR_LIT:0>")<EOL>new_intf_optic_item = tuple(temp_list)<EOL>optics_items_with_lane.append(new_intf_optic_item)<EOL><DEDENT>optics_table40G = junos_views.junos_intf_40Goptics_table(self.device)<EOL>optics_table40G.get()<EOL>optics_40Gitems = optics_table40G.items()<EOL>new_optics_40Gitems = []<EOL>for item in optics_40Gitems:<EOL><INDENT>lane = item[<NUM_LIT:0>]<EOL>iface = item[<NUM_LIT:1>].pop(<NUM_LIT:0>)<EOL>new_optics_40Gitems.append((iface[<NUM_LIT:1>], py23_compat.text_type(lane), item[<NUM_LIT:1>]))<EOL><DEDENT>iface_40G = [item[<NUM_LIT:0>] for item in new_optics_40Gitems]<EOL>for intf_optic_item in optics_items_with_lane:<EOL><INDENT>iface_name = intf_optic_item[<NUM_LIT:0>]<EOL>if iface_name not in iface_40G:<EOL><INDENT>new_optics_40Gitems.append(intf_optic_item)<EOL><DEDENT><DEDENT>optics_detail = {}<EOL>for intf_optic_item in new_optics_40Gitems:<EOL><INDENT>lane = intf_optic_item[<NUM_LIT:1>]<EOL>interface_name = py23_compat.text_type(intf_optic_item[<NUM_LIT:0>])<EOL>optics = dict(intf_optic_item[<NUM_LIT:2>])<EOL>if interface_name not in optics_detail:<EOL><INDENT>optics_detail[interface_name] = {}<EOL>optics_detail[interface_name]["<STR_LIT>"] = {}<EOL>optics_detail[interface_name]["<STR_LIT>"]["<STR_LIT>"] = []<EOL><DEDENT>INVALID_LIGHT_LEVEL = [None, C.OPTICS_NULL_LEVEL, C.OPTICS_NULL_LEVEL_SPC]<EOL>intf_optics = {<EOL>"<STR_LIT:index>": int(lane),<EOL>"<STR_LIT:state>": {<EOL>"<STR_LIT>": {<EOL>"<STR_LIT>": (<EOL>float(optics["<STR_LIT>"])<EOL>if optics["<STR_LIT>"] not in INVALID_LIGHT_LEVEL<EOL>else <NUM_LIT:0.0><EOL>),<EOL>"<STR_LIT>": <NUM_LIT:0.0>,<EOL>"<STR_LIT>": <NUM_LIT:0.0>,<EOL>"<STR_LIT>": <NUM_LIT:0.0>,<EOL>},<EOL>"<STR_LIT>": {<EOL>"<STR_LIT>": (<EOL>float(optics["<STR_LIT>"])<EOL>if optics["<STR_LIT>"] not in INVALID_LIGHT_LEVEL<EOL>else <NUM_LIT:0.0><EOL>),<EOL>"<STR_LIT>": <NUM_LIT:0.0>,<EOL>"<STR_LIT>": <NUM_LIT:0.0>,<EOL>"<STR_LIT>": <NUM_LIT:0.0>,<EOL>},<EOL>"<STR_LIT>": {<EOL>"<STR_LIT>": (<EOL>float(optics["<STR_LIT>"])<EOL>if optics["<STR_LIT>"] not in INVALID_LIGHT_LEVEL<EOL>else <NUM_LIT:0.0><EOL>),<EOL>"<STR_LIT>": <NUM_LIT:0.0>,<EOL>"<STR_LIT>": <NUM_LIT:0.0>,<EOL>"<STR_LIT>": <NUM_LIT:0.0>,<EOL>},<EOL>},<EOL>}<EOL>optics_detail[interface_name]["<STR_LIT>"]["<STR_LIT>"].append(<EOL>intf_optics<EOL>)<EOL><DEDENT>return optics_detail<EOL>
Return optics information.