code: def _output_format(self, out, fmt_j=None, fmt_p=None):
          
          if self.output_format == 'pandas':
              if fmt_p is not None:
                  return fmt_p(out)
              else:
                  return self._convert_output(out)
          if fmt_j:
              return fmt_j(out)
          return out
docs: Output formatting handler