code: def generate_bernoulli_distribution(
      prob: float = 0.0, size: int = 1
  ) -> np.ndarray:
      """Generates a Bernoulli distribution based on an input probability.
  
      Args:
          prob: Probability of distribution.
          size: Size of array.
  
      Returns:
          (np.ndarray): Bernoulli distribution n-dimensional array.
  
      """
  
      bernoulli_array = np.zeros(size)
  
      r1 = r.generate_uniform_random_number(0, 1, size)
      bernoulli_array[r1 < prob] = 1
  
      return bernoulli_array
  
imports: from math import gamma, pi, sin
  from typing import Optional
  import numpy
  import opytimizer.math.random
label_desc: Use image node_id 1 for calling a global function with example usage: generate_bernoulli_distribution(prob, size) and returns: bernoulli_array