code: def parse_validate_offset(
      use_shape,
      max_translate_abs=None,
      max_translate_rel=None,
      default_translate_abs=250,
      default_translate_rel=1.0,
  ):
      # if one passes DataNode (with shapes for instance), the error message would be very vague
      if not isinstance(use_shape, bool):
          raise Exception(
              f"The `use_shape` is a flag that should be set to either True or False, "
              f"got {use_shape}."
          )
      if use_shape:
          if max_translate_abs is not None:
              raise Exception(
                  "The argument `max_translate_abs` cannot be used with image shapes. "
                  "You may use `max_translate_rel` instead."
              )
          if max_translate_rel is None:
              max_translate_rel = default_translate_rel
          return max_translate_hw(max_translate_rel)
      else:
          if max_translate_rel is not None:
              raise Exception(
                  "The argument `max_translate_rel` cannot be used without image shapes. "
                  "You may use `max_translate_abs` instead."
              )
          if max_translate_abs is None:
              max_translate_abs = default_translate_abs
          return max_translate_hw(max_translate_abs)
  
file_path: DALI/dali/python/nvidia/dali/auto_aug/core/_utils.py
imports: from typing import List, Optional
  from nvidia.dali.data_node import DataNode
  from nvidia.dali.auto_aug.core._select import select
  from nvidia.dali.auto_aug.core._args import MissingArgException
  from nvidia.dali.auto_aug.core._augmentation import Augmentation
  import nvidia.dali.auto_aug.augmentations
label_desc: Use image node_id 2 for calling a global function with example usage: parse_validate_offset(use_shape, max_translate_abs, max_translate_rel, default_translate_abs, default_translate_rel) and returns: max_translate_hw, max_translate_hw