code: def _build_landmarker_result(
      output_packets: Mapping[str, packet_module.Packet]
  ) -> HolisticLandmarkerResult:
      """Constructs a `HolisticLandmarksDetectionResult` from output packets."""
      holistic_landmarker_result = HolisticLandmarkerResult(
          [], [], [], [], [], [], []
      )
  
      face_landmarks_proto_list = packet_getter.get_proto(
          output_packets[_FACE_LANDMARKS_STREAM_NAME]
      )
  
      pose_landmarks_proto_list = packet_getter.get_proto(
          output_packets[_POSE_LANDMARKS_STREAM_NAME]
      )
  
      pose_world_landmarks_proto_list = packet_getter.get_proto(
          output_packets[_POSE_WORLD_LANDMARKS_STREAM_NAME]
      )
  
      left_hand_landmarks_proto_list = packet_getter.get_proto(
          output_packets[_LEFT_HAND_LANDMARKS_STREAM_NAME]
      )
  
      left_hand_world_landmarks_proto_list = packet_getter.get_proto(
          output_packets[_LEFT_HAND_WORLD_LANDMARKS_STREAM_NAME]
      )
  
      right_hand_landmarks_proto_list = packet_getter.get_proto(
          output_packets[_RIGHT_HAND_LANDMARKS_STREAM_NAME]
      )
  
      right_hand_world_landmarks_proto_list = packet_getter.get_proto(
          output_packets[_RIGHT_HAND_WORLD_LANDMARKS_STREAM_NAME]
      )
  
      face_landmarks = landmark_pb2.NormalizedLandmarkList()
      face_landmarks.MergeFrom(face_landmarks_proto_list)
      for face_landmark in face_landmarks.landmark:
          holistic_landmarker_result.face_landmarks.append(
              landmark_module.NormalizedLandmark.create_from_pb2(
                  face_landmark
              )
          )
  
      pose_landmarks = landmark_pb2.NormalizedLandmarkList()
      pose_landmarks.MergeFrom(pose_landmarks_proto_list)
      for pose_landmark in pose_landmarks.landmark:
          holistic_landmarker_result.pose_landmarks.append(
              landmark_module.NormalizedLandmark.create_from_pb2(
                  pose_landmark
              )
          )
  
      pose_world_landmarks = landmark_pb2.LandmarkList()
      pose_world_landmarks.MergeFrom(pose_world_landmarks_proto_list)
      for pose_world_landmark in pose_world_landmarks.landmark:
          holistic_landmarker_result.pose_world_landmarks.append(
              landmark_module.Landmark.create_from_pb2(
                  pose_world_landmark
              )
          )
  
      left_hand_landmarks = landmark_pb2.NormalizedLandmarkList()
      left_hand_landmarks.MergeFrom(left_hand_landmarks_proto_list)
      for hand_landmark in left_hand_landmarks.landmark:
          holistic_landmarker_result.left_hand_landmarks.append(
              landmark_module.NormalizedLandmark.create_from_pb2(
                  hand_landmark
              )
          )
  
      left_hand_world_landmarks = landmark_pb2.LandmarkList()
      left_hand_world_landmarks.MergeFrom(
          left_hand_world_landmarks_proto_list
      )
      for (
          left_hand_world_landmark
      ) in left_hand_world_landmarks.landmark:
          holistic_landmarker_result.left_hand_world_landmarks.append(
              landmark_module.Landmark.create_from_pb2(
                  left_hand_world_landmark
              )
          )
  
      right_hand_landmarks = landmark_pb2.NormalizedLandmarkList()
      right_hand_landmarks.MergeFrom(right_hand_landmarks_proto_list)
      for hand_landmark in right_hand_landmarks.landmark:
          holistic_landmarker_result.right_hand_landmarks.append(
              landmark_module.NormalizedLandmark.create_from_pb2(
                  hand_landmark
              )
          )
  
      right_hand_world_landmarks = landmark_pb2.LandmarkList()
      right_hand_world_landmarks.MergeFrom(
          right_hand_world_landmarks_proto_list
      )
      for (
          right_hand_world_landmark
      ) in right_hand_world_landmarks.landmark:
          holistic_landmarker_result.right_hand_world_landmarks.append(
              landmark_module.Landmark.create_from_pb2(
                  right_hand_world_landmark
              )
          )
  
      if _FACE_BLENDSHAPES_STREAM_NAME in output_packets:
          face_blendshapes_proto_list = packet_getter.get_proto(
              output_packets[_FACE_BLENDSHAPES_STREAM_NAME]
          )
          face_blendshapes_classifications = (
              classification_pb2.ClassificationList()
          )
          face_blendshapes_classifications.MergeFrom(
              face_blendshapes_proto_list
          )
          holistic_landmarker_result.face_blendshapes = []
          for (
              face_blendshapes
          ) in face_blendshapes_classifications.classification:
              holistic_landmarker_result.face_blendshapes.append(
                  category_module.Category(
                      index=face_blendshapes.index,
                      score=face_blendshapes.score,
                      display_name=face_blendshapes.display_name,
                      category_name=face_blendshapes.label,
                  )
              )
  
      if _POSE_SEGMENTATION_MASK_STREAM_NAME in output_packets:
          holistic_landmarker_result.segmentation_mask = (
              packet_getter.get_image(
                  output_packets[_POSE_SEGMENTATION_MASK_STREAM_NAME]
              )
          )
  
      return holistic_landmarker_result
  
imports: import dataclasses
  from typing import Callable, List, Mapping, Optional
  from mediapipe.framework.formats import classification_pb2
  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.holistic_landmarker.proto import holistic_landmarker_graph_options_pb2
  from mediapipe.tasks.cc.vision.holistic_landmarker.proto import holistic_result_pb2
  from mediapipe.tasks.python.components.containers import category
  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: holistic_landmarker_result