code: def dropout1d(
      x: np.ndarray,
      prob: float,
      /,
      *,
      training: bool = True,
      data_format: str = "NWC",
      out: Optional[np.ndarray] = None,
  ) -> np.ndarray:
      if training:
          x_shape = x.shape
          is_batched = len(x_shape) == 3
          if data_format == "NCW":
              perm = (0, 2, 1) if is_batched else (1, 0)
              x = np.transpose(x, perm)
              x_shape = x.shape
          mask = np.random.binomial(1, 1 - prob, x_shape)
          res = np.where(mask, x / (1 - prob), 0)
          if data_format == "NCW":
              res = np.transpose(res, perm)
      else:
          res = x
      return res
  
imports: import math
  import numpy
  from typing import Optional, Union, Tuple, List, Literal, Sequence, Callable
  import ivy
  from ivy.functional.ivy.layers import _handle_padding, _get_num_padded_values, _validate_max_pool_params, _depth_max_pooling_helper
  from ivy.functional.backends.numpy.layers import _add_dilations
  from ivy.functional.ivy.experimental.layers import _padding_ceil_mode
  from ivy.func_wrapper import with_supported_dtypes
  from ivy.func_wrapper import with_unsupported_dtypes
  from .None import backend_version
label_desc: Use image node_id 12 for calling a global function with example usage: dropout1d() and returns: res