code: def _get_x_data_format(
      dims: int = 2, data_format: str = "channel_first"
  ):
      if dims == 1:
          if data_format == "channel_first":
              return "NCW"
          else:
              return "NWC"
      if dims == 2:
          if data_format == "channel_first":
              return "NCHW"
          else:
              return "NHWC"
      elif dims == 3:
          if data_format == "channel_first":
              return "NCDHW"
          else:
              return "NDHWC"
  
imports: from typing import Optional, Tuple, Union, Sequence
  import ivy
  from ivy.utils.backend import current_backend
  from ivy.func_wrapper import handle_array_function, handle_partial_mixed_function, inputs_to_ivy_arrays, to_native_arrays_and_back, inputs_to_native_shapes, handle_out_argument, handle_nestable, handle_array_like_without_promotion, handle_device, handle_backend_invalid
  from ivy.utils.exceptions import handle_exceptions
label_desc: Use image node_id 23 for calling a global function with example usage: _get_x_data_format(dims, data_format) and returns: str, str, str, str, str, str