code: def _calculate_out_shape(axis, array_shape):
      if type(axis) not in (tuple, list):
          axis = (axis,)
      out_dims = len(axis) + len(array_shape)
      norm_axis = normalize_axis_tuple(axis, out_dims)
      shape_iter = iter(array_shape)
      out_shape = [
          1 if current_ax in norm_axis else next(shape_iter)
          for current_ax in range(out_dims)
      ]
      return out_shape
  
imports: from typing import Union, Optional, Tuple, List, Iterable, Sequence
  from numbers import Number
  from numpy.core.numeric import normalize_axis_tuple
  import ivy
  from ivy.utils.backend import current_backend
  from ivy.func_wrapper import handle_array_function, to_native_arrays_and_back, handle_out_argument, handle_nestable, handle_array_like_without_promotion, handle_view, handle_device, handle_backend_invalid
  from ivy.utils.exceptions import handle_exceptions
label_desc: Use image node_id 1 for calling a global function with example usage: _calculate_out_shape(axis, array_shape) and returns: out_shape