code: def convert_keypoint_to_albumentations(
      keypoint: Sequence,
      source_format: str,
      rows: int,
      cols: int,
      check_validity: bool = False,
      angle_in_degrees: bool = True,
  ) -> Tuple:
      if source_format not in keypoint_formats:
          raise ValueError(
              "Unknown target_format {}. Supported formats are: {}".format(
                  source_format, keypoint_formats
              )
          )
  
      if source_format == "xy":
          (x, y), tail = keypoint[:2], tuple(keypoint[2:])
          a, s = 0.0, 0.0
      elif source_format == "yx":
          (y, x), tail = keypoint[:2], tuple(keypoint[2:])
          a, s = 0.0, 0.0
      elif source_format == "xya":
          (x, y, a), tail = keypoint[:3], tuple(keypoint[3:])
          s = 0.0
      elif source_format == "xys":
          (x, y, s), tail = keypoint[:3], tuple(keypoint[3:])
          a = 0.0
      elif source_format == "xyas":
          (x, y, a, s), tail = keypoint[:4], tuple(keypoint[4:])
      elif source_format == "xysa":
          (x, y, s, a), tail = keypoint[:4], tuple(keypoint[4:])
      else:
          raise ValueError(
              f"Unsupported source format. Got {source_format}"
          )
  
      if angle_in_degrees:
          a = math.radians(a)
  
      keypoint = (x, y, angle_to_2pi_range(a), s) + tail
      if check_validity:
          check_keypoint(keypoint, rows, cols)
      return keypoint
  
imports: from __future__ import division
  import math
  import typing
  import warnings
  from typing import Any, Dict, List, Optional, Sequence, Tuple
  from .utils import DataProcessor, Params
label_desc: Use image node_id 5 for calling a global function with example usage: convert_keypoint_to_albumentations(keypoint, source_format, rows, cols, check_validity, angle_in_degrees) and returns: keypoint