def _make_percentage_energy(network, sun):
    """
    Calculates the percentage of the energy
    consumed by the electrical network and
    by solar system.
    """

    sun_percentage = sun/network
    network_percentage = 1 - sun_percentage

    if sun_percentage >= 1:
        return 1, 0
    else:
        return sun_percentage, network_percentage