class_docstr: Hold all parsed data to serve for user requests.
class_docstr_tok: ["Hold","all","parsed","data","to","serve","for","user","requests","."]
code: def get_event_type_model_perspective(self, time_unit):  # noqa: C901
      if not self.overview_parser:
          return
      data = OrderedDict()
      data["order"] = []
      data["phase_type"] = []
      try:
          for event_type in CPUType:
              if (
                  event_type
                  in self.merged_events_per_stage["ProfileStep"]["CPU"][
                      "ALL"
                  ]
              ):
                  data["order"].append(event_type)
                  data[event_type] = []
          if self.overview_parser.has_device:
              for event_type in GPUType:
                  if (
                      event_type
                      in self.merged_events_per_stage["ProfileStep"][
                          "GPU"
                      ]["ALL"]
                  ):
                      data["order"].append(event_type)
                      data[event_type] = []
          for stage_name in [
              "ProfileStep",
              "Dataloader",
              "Forward",
              "Backward",
              "Optimization",
              "Other",
          ]:
              if stage_name in self.merged_events_per_stage:
                  data["phase_type"].append(stage_name)
                  for event_type in data["order"]:
                      if event_type in CPUType:
                          if (
                              event_type
                              in self.merged_events_per_stage[
                                  stage_name
                              ]["CPU"]["ALL"]
                          ):
                              data[event_type].append(
                                  format_time(
                                      self.merged_events_per_stage[
                                          stage_name
                                      ]["CPU"]["ALL"][event_type][
                                          "total_time"
                                      ],
                                      time_unit,
                                  )
                              )
                          else:
                              data[event_type].append(0)
                      elif event_type in GPUType:
                          if (
                              event_type
                              in self.merged_events_per_stage[
                                  stage_name
                              ]["GPU"]["ALL"]
                          ):
                              data[event_type].append(
                                  format_time(
                                      self.merged_events_per_stage[
                                          stage_name
                                      ]["GPU"]["ALL"][event_type][
                                          "total_time"
                                      ],
                                      time_unit,
                                  )
                              )
                          else:
                              data[event_type].append(0)
          newdata = OrderedDict()
          newdata["order"] = data["order"]
          newdata["phase_type"] = data["phase_type"]
          newdata["data"] = []
          for key in newdata["order"]:
              newdata["data"].append(data[key])
  
      except Exception as e:
          print("error in get_event_type_model_perspective", e)
      return newdata
  
imports: from collections import defaultdict
  from collections import OrderedDict
  from .parser.distributed_parser import DistributedParser
  from .parser.kernel_parser import KernelParser
  from .parser.memory_parser import MemoryParser
  from .parser.operator_parser import OperatorParser
  from .parser.overview_parser import CPUType
  from .parser.overview_parser import GPUType
  from .parser.overview_parser import OverviewParser
  from .parser.trace_parser import TraceParser
  from .parser.utils import format_float
  from .parser.utils import format_memory
  from .parser.utils import format_ratio
  from .parser.utils import format_time
  from .parser.utils import traverse_tree
label_desc: Use image node_id 7 for calling the ProfilerData obj's underlying member method code with example usage: obj.get_event_type_model_perspective(time_unit) and returns: newdata