<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:

def _pwr_optfcn(df, loc):
    '''
    Function to find power from ``i_from_v``.
    '''

    I = _lambertw_i_from_v(df['r_sh'], df['r_s'],           # noqa: E741, N806
                           df['nNsVth'], df[loc], df['i_0'], df['i_l'])

    return I * df[loc]