<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def categorical_like(x, p):
 R""" Categorical log-likelihood. The most general discrete distribution. .. math:: f(x=i \mid p) = p_i for :math:`i \in 0 \ldots k-1`. :Parameters: - `x` : [int] :math:`x \in 0\ldots k-1` - `p` : [float] :math:`p > 0`, :math:`\sum p = 1` """


    p = np.atleast_2d(p)
    if np.any(abs(np.sum(p, 1) - 1) > 0.0001):
        print_("Probabilities in categorical_like sum to", np.sum(p, 1))
    return flib.categorical(np.array(x).astype(int), p)