code: 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[locf _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]
docs: Function to find power from ``i_from_v``.