<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def min_renewable_share(network, snapshots, share=0.72):
 """ Sets minimal renewable share of generation as extra functionality in LOPF Parameters share: float Minimal share of renewable generation in p.u. """

    renewables = ['wind_onshore', 'wind_offshore',
                  'biomass', 'solar', 'run_of_river']

    res = list(network.generators.index[
            network.generators.carrier.isin(renewables)])

    total = list(network.generators.index)
    snapshots = network.snapshots

    def _rule(m):
        """
        """
        renewable_production = sum(m.generator_p[gen, sn]
                                      for gen
                                      in res
                                      for sn in snapshots)
        total_production = sum(m.generator_p[gen, sn]
                               for gen in total
                               for sn in snapshots)

        return (renewable_production >= total_production * share)
    network.model.min_renewable_share = Constraint(rule=_rule)