<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def power_curve(wind_speed, power_curve_wind_speeds, power_curve_values, density=None, density_correction=False):
 r""" Calculates the turbine power output using a power curve. This function is carried out when the parameter `power_output_model` of an instance of the :class:`~.modelchain.ModelChain` class is 'power_curve'. If the parameter `density_correction` is True the density corrected power curve (See :py:func:`~.power_curve_density_correction`) is used. Parameters wind_speed : pandas.Series or numpy.array Wind speed at hub height in m/s. power_curve_wind_speeds : pandas.Series or numpy.array Wind speeds in m/s for which the power curve values are provided in `power_curve_values`. power_curve_values : pandas.Series or numpy.array Power curve values corresponding to wind speeds in `power_curve_wind_speeds`. density : pandas.Series or numpy.array Density of air at hub height in kg/m³. This parameter is needed if `density_correction` is True. Default: None. density_correction : boolean If the parameter is True the density corrected power curve is used for the calculation of the turbine power output. In this case `density` cannot be None. Default: False. Returns ------- pandas.Series or numpy.array Electrical power output of the wind turbine in W. Data type depends on type of `wind_speed`. Notes ------- It is assumed that the power output for wind speeds above the maximum and below the minimum wind speed given in the power curve is zero. """

    if density_correction is False:
        power_output = np.interp(wind_speed, power_curve_wind_speeds,
                                 power_curve_values, left=0, right=0)
        # Power_output as pd.Series if wind_speed is pd.Series (else: np.array)
        if isinstance(wind_speed, pd.Series):
            power_output = pd.Series(data=power_output, index=wind_speed.index,
                                     name='feedin_power_plant')
        else:
            power_output = np.array(power_output)
    elif density_correction is True:
        power_output = power_curve_density_correction(
            wind_speed, power_curve_wind_speeds, power_curve_values, density)
    else:
        raise TypeError("'{0}' is an invalid type. ".format(type(
                        density_correction)) + "`density_correction` must " +
                        "be Boolean (True or False).")
    return power_output