code: def _validate_sort_psrs_kinds(psrs_kinds):
      if psrs_kinds is not None:
          if isinstance(psrs_kinds, (list, tuple)):
              psrs_kinds = list(psrs_kinds)
              if len(psrs_kinds) != 3:
                  raise ValueError("psrs_kinds should have 3 elements")
              for i, psrs_kind in enumerate(psrs_kinds):
                  if psrs_kind is None:
                      if i < 2:
                          continue
                      else:
                          raise ValueError(
                              "3rd element of psrs_kinds should be specified"
                          )
                  upper_psrs_kind = psrs_kind.upper()
                  if upper_psrs_kind not in _AVAILABLE_KINDS:
                      raise ValueError(
                          f"{psrs_kind} is an unrecognized kind in psrs_kinds"
                      )
          else:
              raise TypeError("psrs_kinds should be list or tuple")
      else:
          psrs_kinds = ["quicksort", "mergesort", "mergesort"]
      return psrs_kinds
  
imports: import numpy
  from ...None import opcodes
  from ...serialization.serializables import FieldTypes, Int32Field, StringField, ListField, BoolField
  from ...core import ExecutableTuple
  from ..array_utils import as_same_device, device
  from ..core import TensorOrder
  from ..datasource import tensor
  from ..operands import TensorOperand, TensorShuffleProxy
  from ..utils import validate_axis, validate_order
  from .psrs import TensorPSRSOperandMixin
label_desc: Use image node_id 1 for calling a global function with example usage: _validate_sort_psrs_kinds(psrs_kinds) and returns: psrs_kinds