def sum_to_1(x):
    """
    Normalize an array x such that the sum of all values is 1.

    :param x: Input array
    :type x: :class:`~numpy.ndarray`
    :returns: Normalized version of x
    """

    return x / sum(x)