code: def _build_landmarker_result(
      output_packets: Mapping[str, packet_module.Packet]
  ) -> PoseLandmarkerResult:
      """Constructs a `PoseLandmarkerResult` from output packets."""
      pose_landmarker_result = PoseLandmarkerResult([], [])
  
      if _SEGMENTATION_MASK_STREAM_NAME in output_packets:
          pose_landmarker_result.segmentation_masks = (
              packet_getter.get_image_list(
                  output_packets[_SEGMENTATION_MASK_STREAM_NAME]
              )
          )
  
      pose_landmarks_proto_list = packet_getter.get_proto_list(
          output_packets[_NORM_LANDMARKS_STREAM_NAME]
      )
      pose_world_landmarks_proto_list = packet_getter.get_proto_list(
          output_packets[_POSE_WORLD_LANDMARKS_STREAM_NAME]
      )
  
      for proto in pose_landmarks_proto_list:
          pose_landmarks = landmark_pb2.NormalizedLandmarkList()
          pose_landmarks.MergeFrom(proto)
          pose_landmarks_list = []
          for pose_landmark in pose_landmarks.landmark:
              pose_landmarks_list.append(
                  landmark_module.NormalizedLandmark.create_from_pb2(
                      pose_landmark
                  )
              )
          pose_landmarker_result.pose_landmarks.append(
              pose_landmarks_list
          )
  
      for proto in pose_world_landmarks_proto_list:
          pose_world_landmarks = landmark_pb2.LandmarkList()
          pose_world_landmarks.MergeFrom(proto)
          pose_world_landmarks_list = []
          for pose_world_landmark in pose_world_landmarks.landmark:
              pose_world_landmarks_list.append(
                  landmark_module.Landmark.create_from_pb2(
                      pose_world_landmark
                  )
              )
          pose_landmarker_result.pose_world_landmarks.append(
              pose_world_landmarks_list
          )
  
      return pose_landmarker_result
  
imports: import dataclasses
  from typing import Callable, Mapping, Optional, List
  from mediapipe.framework.formats import landmark_pb2
  from mediapipe.python import packet_creator
  from mediapipe.python import packet_getter
  from mediapipe.python._framework_bindings import image
  from mediapipe.python._framework_bindings import packet
  from mediapipe.tasks.cc.vision.pose_landmarker.proto import pose_landmarker_graph_options_pb2
  from mediapipe.tasks.python.components.containers import landmark
  from mediapipe.tasks.python.core import base_options
  from mediapipe.tasks.python.core import task_info
  from mediapipe.tasks.python.core.optional_dependencies import doc_controls
  from mediapipe.tasks.python.vision.core import base_vision_task_api
  from mediapipe.tasks.python.vision.core import image_processing_options
  from mediapipe.tasks.python.vision.core import vision_task_running_mode
label_desc: Use image node_id 1 for calling a global function with example usage: _build_landmarker_result(output_packets) and returns: pose_landmarker_result