code: def _squeeze_helper(query, x_ndim):
      # as of paddle v2.5, paddle returns 1d tensors instead of scalars
      return_scalar = (
          (isinstance(query, Number) and x_ndim == 1)
          or (
              isinstance(query, tuple)
              and all(isinstance(index, int) for index in query)
              and len(query) == x_ndim
          )
          or (isinstance(query, paddle.Tensor) and query.ndim == x_ndim)
      )
  
      # checks if any slice has step > 1, this keeps all the dimensions
      # in the paddle array which is not desirable
      if not isinstance(query, Sequence):
          query = [query]
      slice_squeeze = list(
          map(
              lambda idx: isinstance(idx, slice)
              and idx.step is not None
              and idx.step != 1,
              query,
          )
      )
  
      if any(slice_squeeze):
          squeeze_indices = tuple(
              [
                  idx
                  for idx, val in enumerate(slice_squeeze)
                  if (val is False and query[idx] is not None)
              ]
          )
      elif return_scalar:
          squeeze_indices = ()
      else:
          squeeze_indices = None
  
      return squeeze_indices
  
imports: from numbers import Number
  from typing import Optional, Union, Sequence, Callable, List, Tuple
  import paddle
  import numpy
  import multiprocessing
  import ivy
  import ivy.functional.backends.paddle
  from ivy.func_wrapper import with_unsupported_device_and_dtypes
  from ivy.functional.ivy.general import _broadcast_to
  from ivy.utils.exceptions import _check_inplace_update_support
  from .None import backend_version
label_desc: Use image node_id 6 for calling a global function with example usage: _squeeze_helper(query, x_ndim) and returns: squeeze_indices