code: def calculate_out_shape(
      in_shape: Sequence[int] | int | np.ndarray,
      kernel_size: Sequence[int] | int,
      stride: Sequence[int] | int,
      padding: Sequence[int] | int,
  ) -> tuple[int, ...] | int:
      """
      Calculate the output tensor shape when applying a convolution to a tensor of shape `inShape` with kernel size
      `kernel_size`, stride value `stride`, and input padding value `padding`. All arguments can be scalars or multiple
      values, return value is a scalar if all inputs are scalars.
      """
      in_shape_np = np.atleast_1d(in_shape)
      kernel_size_np = np.atleast_1d(kernel_size)
      stride_np = np.atleast_1d(stride)
      padding_np = np.atleast_1d(padding)
  
      out_shape_np = (
          (in_shape_np - kernel_size_np + padding_np + padding_np)
          // stride_np
      ) + 1
      out_shape = tuple(int(s) for s in out_shape_np)
  
      return out_shape
  
file_path: MONAI/monai/networks/layers/convutils.py
imports: from __future__ import annotations
  from collections.abc import Sequence
  import numpy
  import torch
label_desc: Use image node_id 3 for calling a global function with example usage: calculate_out_shape(in_shape, kernel_size, stride, padding) and returns: out_shape