docs: def __get_WIOD_env_extension(root_path, year, ll_co, para):
      """ Parses the wiod environmental extension
  
      Extension can either be given as original .zip files or as extracted
      data in a folder with the same name as the corresponding zip file (with-
      out the extension).
  
      This function is based on the structure of the extensions from _may12.
  
      Note
      ----
      The function deletes 'secQ' which is not present in the economic tables.
  
      Parameters
      ----------
      root_path : string
          Path to the WIOD data or the path with the
          extension data folder or zip file.
      year : str or int
          Year to return for the extension = valid sheetname for the xls file.
      ll_co : list like
          List of countries in WIOD - used for finding and matching
          extension data in the given folder.
      para : dict
          Defining the parameters for reading the extension.
  
      Returns
      -------
      dict with keys
          F : pd.DataFrame with index 'stressor' and columns 'region', 'sector'
          FY : pd.Dataframe with index 'stressor' and column 'region'
              This data is for household stressors - must be applied to the right
              final demand column afterwards.
          unit : pd.DataFrame with index 'stressor' and column 'unit'
  
  
      """
  
      ll_root_content = [ff for ff in os.listdir(root_path) if
                         ff.startswith(para['start'])]
      if len(ll_root_content) < 1:
          warnings.warn(
              'Extension data for {} not found - '
              'Extension not included'.format(para['start']), ParserWarning)
          return None
  
      elif len(ll_root_content) > 1:
          raise ParserError(
              'Several raw data for extension'
              '{} available - clean extension folder.'.format(para['start']))
  
      pf_env = os.path.join(root_path, ll_root_content[0])
  
      if pf_env.endswith('.zip'):
          rf_zip = zipfile.ZipFile(pf_env)
          ll_env_content = [ff for ff in rf_zip.namelist() if
                            ff.endswith(para['ext'])]
      else:
          ll_env_content = [ff for ff in os.listdir(pf_env) if
                            ff.endswith(para['ext'])]
  
      dl_env = dict()
      dl_env_hh = dict()
      for co in ll_co:
          ll_pff_read = [ff for ff in ll_env_content if
                         ff.endswith(para['ext']) and
                         (ff.startswith(co.upper()) or
                          ff.startswith(co.lower()))]
  
          if len(ll_pff_read) < 1:
              raise ParserError('Country data not complete for Extension '
                                '{} - missing {}.'.format(para['start'], co))
  
          elif len(ll_pff_read) > 1:
              raise ParserError('Multiple country data for Extension '
                                '{} - country {}.'.format(para['start'], co))
  
          pff_read = ll_pff_read[0]
  
          if pf_env.endswith('.zip'):
              ff_excel = pd.ExcelFile(rf_zip.open(pff_read))
          else:
              ff_excel = pd.ExcelFile(os.path.join(pf_env, pff_read))
          if str(year) in ff_excel.sheet_names:
              df_env = ff_excel.parse(sheet_name=str(year),
                                      index_col=None,
                                      header=0
                                      )
          else:
              warnings.warn('Extension {} does not include'
                            'data for the year {} - '
                            'Extension not included'.format(para['start'], year),
                            ParserWarning)
              return None
  
          if not df_env.index.is_numeric():
              # upper case letter extensions gets parsed with multiindex, not
              # quite sure why...
              df_env.reset_index(inplace=True)
  
          # unit can be taken from the first cell in the excel sheet
          if df_env.columns[0] != 'level_0':
              para['unit']['all'] = df_env.columns[0]
  
          # two clean up cases - can be identified by lower/upper case extension
          # description
          if para['start'].islower():
              pass
          elif para['start'].isupper():
              df_env = df_env.iloc[:, 1:]
          else:
              raise ParserError('Format of extension not given.')
  
          df_env.dropna(axis=0, how='all', inplace=True)
          df_env = df_env[df_env.iloc[:, 0] != 'total']
          df_env = df_env[df_env.iloc[:, 0] != 'secTOT']
          df_env = df_env[df_env.iloc[:, 0] != 'secQ']
          df_env.iloc[:, 0].astype(str, inplace=True)
          df_env.iloc[:, 0].replace(to_replace='sec',
                                    value='',
                                    regex=True,
                                    inplace=True)
  
          df_env.set_index([df_env.columns[0]], inplace=True)
          df_env.index.names = ['sector']
          df_env = df_env.T
  
          ikc_hh = 'FC_HH'
          dl_env_hh[co] = df_env[ikc_hh]
          del df_env[ikc_hh]
          dl_env[co] = df_env
  
      df_F = pd.concat(dl_env, axis=1)[ll_co]
      df_FY = pd.concat(dl_env_hh, axis=1)[ll_co]
      df_F.fillna(0, inplace=True)
      df_FY.fillna(0, inplace=True)
  
      df_F.columns.names = IDX_NAMES['F_col']
      df_F.index.names = IDX_NAMES['F_row_single']
  
      df_FY.columns.names = IDX_NAMES['Y_col1']
      df_FY.index.names = IDX_NAMES['F_row_single']
  
      # build the unit df
      df_unit = pd.DataFrame(index=df_F.index, columns=['unit'])
      _ss_unit = para['unit'].get('all', 'undef')
      for ikr in df_unit.index:
          df_unit.ix[ikr, 'unit'] = para['unit'].get(ikr, _ss_unit)
  
      df_unit.columns.names = ['unit']
      df_unit.index.names = ['stressor']
  
      if pf_env.endswith('.zip'):
          rf_zip.close()
  
      return {'F': df_F,
              'FY': df_FY,
              'unit': df_unit
              }