docs: def report_accounts(self, path, per_region=True, per_capita=False,
                          pic_size=1000, format='rst', ffname=None,  **kwargs):
          """ Writes a report to the given path for the regional accounts
  
          The report consists of a text file and a folder with the pics
          (both names following parameter name)
  
          Notes
          ----
              This looks prettier with the seaborn module
              (import seaborn before calling this method)
  
  
          Parameters
          ----------
          path : pathlib.Path or string
              Root path for the report
          per_region : boolean, optional
              If true, reports the accounts per region
          per_capita : boolean, optional
              If true, reports the accounts per capita
              If per_capita and per_region are False, nothing will be done
          pic_size : int, optional
              size for the figures in px, 1000 by default
          format : string, optional
              file format of the report:
              'rst'(default), 'html', 'latex', ...
              except for rst all depend on the module docutils (all writer_name
              from docutils can be used as format)
          ffname : string, optional
              root file name (without extension, per_capita or per_region will be
              attached) and folder names If None gets passed (default), self.name
              with be modified to get a valid name for the operation system
              without blanks
          **kwargs : key word arguments, optional
              This will be passed directly to the pd.DataFrame.plot method
              (through the self.plot_account method)
  
          """
  
          if not per_region and not per_capita:
              return
  
          _plt = plt.isinteractive()
          _rcParams = mpl.rcParams.copy()
          rcParams = {
              'figure.figsize': (10, 5),
              'figure.dpi': 350,
              'axes.titlesize': 20,
              'axes.labelsize': 20,
          }
          plt.ioff()
  
          if type(path) is str:
              path = path.rstrip('\\')
              path = Path(path)
  
          path.mkdir(parents=True, exist_ok=True)
  
          if ffname is None:
              valid_char = string.ascii_letters + string.digits + '_'
              ffname = self.name.replace(' ', '_')
              ffname = "".join([r for r in ffname if r in valid_char])
  
          rep_spec = collections.namedtuple('rep_spec',
                                            ['make',
                                             'spec_string',
                                             'is_per_capita'])
  
          reports_to_write = {'per region accounts': rep_spec(
              per_region, '_per_region', False),
                              'per capita accounts': rep_spec(
              per_capita, '_per_capita', True)}
          logging.info('Write report for {}'.format(self.name))
          fig_name_list = []
          for arep in reports_to_write:
              if not reports_to_write[arep].make:
                  continue
  
              report_txt = []
              report_txt.append('###########')
              report_txt.append('MRIO report')
              report_txt.append('###########')
              report_txt.append('\n')
              _ext = 'Extension: ' + self.name + ' - ' + str(arep)
              report_txt.append(_ext)
              report_txt.append('='*len(_ext))
  
              report_txt.append('.. contents::\n\n')
  
              curr_ffname = ffname + reports_to_write[arep].spec_string
              subfolder = path / curr_ffname
  
              subfolder.mkdir(parents=True, exist_ok=True)
  
              for row in self.get_rows():
                  name_row = (str(row).
                              replace('(', '').
                              replace(')', '').
                              replace("'", "").
                              replace(' ', '_').
                              replace(', ', '_').
                              replace('__', '_'))
                  graph_name = (self.name + ' - ' + str(row).
                                replace('(', '').
                                replace(')', '').
                                replace("'", ""))
  
                  # get valid file name
                  def clean(varStr):
                      return re.sub('\W|^(?=\d)', '_', varStr)
                  file_name = (clean(name_row +
                                     reports_to_write[arep].spec_string))
                  # possibility of still having __ in there:
                  file_name = re.sub('_+', '_', file_name)
  
                  # restrict file length
                  file_name = file_name[:50]
  
                  def file_name_nr(a, c):
                      return a + '_' + str(c)
                  _loopco = 0
                  while file_name_nr(file_name, _loopco) in fig_name_list:
                      _loopco += 1
                  file_name = file_name_nr(file_name, _loopco)
                  fig_name_list.append(file_name)
                  file_name = file_name + '.png'
  
                  file_name = subfolder / file_name
                  file_name_rel = file_name.relative_to(path)
  
                  self.plot_account(row, file_name=file_name,
                                    per_capita=reports_to_write[arep].
                                    is_per_capita, **kwargs)
                  plt.close()
  
                  report_txt.append(graph_name)
                  report_txt.append('-'*len(graph_name) + '\n\n')
  
                  report_txt.append('.. image:: ' + file_name_rel)
                  report_txt.append('   :width: {} \n'.format(int(pic_size)))
  
              # write report file and convert to given format
              report_txt.append('\nReport written on ' +
                                time.strftime("%Y%m%d %H%M%S"))
              fin_txt = '\n'.join(report_txt)
              if format is not 'rst':
                  try:
                      import docutils.core as dc
                      if format == 'tex':
                          format == 'latex'
                      fin_txt = dc.publish_string(
                          fin_txt, writer_name=format,
                          settings_overrides={'output_encoding': 'unicode'})
                  except:
                      logging.warn(
                          'Module docutils not available - write rst instead')
                      format = 'rst'
              format_str = {'latex': 'tex',
                            'tex': 'tex',
                            'rst': 'txt',
                            'txt': 'txt',
                            'html': 'html'}
              _repfile = curr_ffname + '.' + format_str.get(format, str(format))
              with open(path / _repfile, 'w') as out_file:
                  out_file.write(fin_txt)
              logging.info('Report for {what} written to {file_where}'.
                           format(what=arep, file_where=str(_repfile)))
  
          # restore plot status
          mpl.rcParams.update(_rcParams)
          if _plt:
              plt.ion()