code: def bernoulli(
      probs: Union[float, np.ndarray],
      *,
      logits: Optional[Union[float, np.ndarray]] = None,
      shape: Optional[Union[ivy.NativeShape, Sequence[int]]] = None,
      device: Optional[str] = None,
      dtype: Optional[np.dtype] = None,
      seed: Optional[int] = None,
      out: Optional[np.ndarray] = None,
  ) -> np.ndarray:
      if seed is not None:
          np.random.seed(seed)
      if logits is not None:
          probs = np.asarray(ivy.softmax(logits), dtype=dtype)
      if not _check_shapes_broadcastable(shape, probs.shape):
          shape = probs.shape
      return np.asarray(
          np.random.binomial(1, p=probs, size=shape), dtype=dtype
      )
  
file_path: ivy/ivy/functional/backends/numpy/experimental/random.py
imports: from typing import Optional, Union, Sequence
  import numpy
  import ivy
  from ivy.functional.ivy.random import _check_bounds_and_get_shape, _check_shapes_broadcastable
label_desc: Use image node_id 5 for calling a global function with example usage: bernoulli(probs) and returns: np