code: def s_res(self, components=None):
          
  
          if components is not None:
              labels_included = []
              labels_not_included = []
              labels = [repr(l) for l in components]
              for label in labels:
                  if (label in list(self.pfa_p.columns) and
                          label in list(self.pfa_q.columns)):
                      labels_included.append(label)
                  else:
                      labels_not_included.append(label)
              if labels_not_included:
                  logging.warning(
                      "Apparent power for {lines} are not returned from "
                      "PFA".format(lines=labels_not_included))
          else:
              labels_included = self.pfa_p.columns
  
          s_res = ((self.pfa_p[labels_included] ** 2 + self.pfa_q[
              labels_included] ** 2)).applymap(sqrt)
  
          return s_res
docs: Get resulting apparent power in kVA at line(s) and transformer(s).
  
          The apparent power at a line (or transformer) is determined from the
          maximum values of active power P and reactive power Q.
  
          .. math::
  
              S = max(\sqrt{p_0^2 + q_0^2}, \sqrt{p_1^2 + q_1^2})
  
          Parameters
          ----------
          components : :obj:`list`
              List with all components (of type :class:`~.grid.components.Line`
              or :class:`~.grid.components.Transformer`) to get apparent power
              for. If not provided defaults to return apparent power of all lines
              and transformers in the grid.
  
          Returns
          -------
          :pandas:`pandas.DataFrame<dataframe>`
              Apparent power in kVA for lines and/or transformers.