code: def broadcast_shapes(
      *shapes: Union[List[int], List[Tuple]]
  ) -> Tuple[int]:
      def _broadcast_shape(s1, s2):
          len_1 = len(s1)
          len_2 = len(s2)
          if len_1 == 0:
              return () if len_2 == 0 else s2
          elif len_1 != 0 and len_2 == 0:
              return s1
          else:
              return paddle.broadcast_shape(s1, s2)
  
      if len(shapes) == 0:
          raise ValueError("shapes=[] must be non-empty")
      elif len(shapes) == 1:
          return shapes[0]
      result = _broadcast_shape(shapes[0], shapes[1])
      for i in range(2, len(shapes)):
          result = _broadcast_shape(result, shapes[i])
      # paddle outputs -1 if the output dimension is 0
      result = [0 if dim == -1 else dim for dim in result]
      return tuple(result)
  
imports: from collections import namedtuple
  from typing import Iterable, Optional, Union, Sequence, Tuple, NamedTuple, List, Any, Literal, Callable
  from numbers import Number
  from ..None import backend_version
  from ivy.func_wrapper import with_supported_device_and_dtypes, with_unsupported_device_and_dtypes, with_supported_dtypes, with_unsupported_dtypes
  import paddle
  import ivy
  import ivy.functional.backends.paddle
  from ivy.functional.ivy.experimental.manipulation import _check_paddle_pad, _to_paddle_padding
label_desc: Use image node_id 20 for calling a global function with example usage: broadcast_shapes() and returns: tuple, unknown, shapes, s1, paddle