code: def bivariate_normal(
      mu=[0, 0],
      sigma_1=1,
      sigma_2=1,
      alpha=0,
      size=None,
      return_cov=False,
  ):
      """Sample points from a 2D normal distribution
  
      Parameters
      ----------
      mu : array-like (length 2)
          The mean of the distribution
      sigma_1 : float
          The unrotated x-axis width
      sigma_2 : float
          The unrotated y-axis width
      alpha : float
          The rotation counter-clockwise about the origin
      size : tuple of ints, optional
          Given a shape of, for example, ``(m,n,k)``, ``m*n*k`` samples are
          generated, and packed in an `m`-by-`n`-by-`k` arrangement.  Because
          each sample is `N`-dimensional, the output shape is ``(m,n,k,N)``.
          If no shape is specified, a single (`N`-D) sample is returned.
      return_cov : boolean, optional
          If True, return the computed covariance matrix.
  
      Returns
      -------
      out : ndarray
          The drawn samples, of shape *size*, if that was provided.  If not,
          the shape is ``(N,)``.
  
          In other words, each entry ``out[i,j,...,:]`` is an N-dimensional
          value drawn from the distribution.
  
      cov : ndarray
          The 2x2 covariance matrix.  Returned only if return_cov == True.
  
      Notes
      -----
      This function works by computing a covariance matrix from the inputs,
      and calling ``np.random.multivariate_normal()``.  If the covariance
      matrix is available, this function can be called directly.
      """
      # compute covariance matrix
      sigma_xx = (sigma_1 * np.cos(alpha)) ** 2 + (
          sigma_2 * np.sin(alpha)
      ) ** 2
      sigma_yy = (sigma_1 * np.sin(alpha)) ** 2 + (
          sigma_2 * np.cos(alpha)
      ) ** 2
      sigma_xy = (
          (sigma_1**2 - sigma_2**2) * np.sin(alpha) * np.cos(alpha)
      )
  
      cov = np.array([[sigma_xx, sigma_xy], [sigma_xy, sigma_yy]])
  
      # draw points from the distribution
      x = np.random.multivariate_normal(mu, cov, size)
  
      if return_cov:
          return x, cov
      else:
          return x
  
file_path: astroML/astroML/stats/random.py
imports: import numpy
  from scipy.stats.distributions import rv_continuous
label_desc: Use image node_id 1 for calling a global function with example usage: bivariate_normal(mu, sigma_1, sigma_2, alpha, size, return_cov) and returns: x,  cov, x