@classmethod
def bernoulli(cls, k, p):
    """
        Visualization for a Bernoulli distribution
        Args:
            k, p (float): parameters to a Bernoulli distribution
        Returns:
            image (IPython.display.Image): The image that can be displayed inline in a Jupyter notebook
        """
    if k not in (0, 1):
        raise ValueError(
            'For a Bernoulli distribution, k should always be either 0 or 1.')
    if not 0 <= p <= 1:
        raise ValueError(
            'For a Bernoulli distribution, p should always be between 0 and 1.'
            )
    return cls._call_post(dist='bernoulli', k=k, p=p)
