code: def load_metadata(self, path, *args, **kwargs):
          
          if not os.path.exists(path):
              raise ValueError("no metadata file '" + path + "' found!")
  
          if path.endswith('csv'):
              df = pd.read_csv(path, *args, **kwargs)
          else:
              xl = pd.ExcelFile(path)
              if len(xl.sheet_names) > 1 and 'sheet_name' not in kwargs:
                  kwargs['sheet_name'] = 'meta'
              df = pd.read_excel(path, *args, **kwargs)
  
          req_cols = ['model', 'scenario', 'exclude']
          if not set(req_cols).issubset(set(df.columns)):
              e = 'File `{}` does not have required columns ({})!'
              raise ValueError(e.format(path, req_cols))
  
          # set index, filter to relevant scenarios from imported metadata file
          df.set_index(META_IDX, inplace=True)
          idx = self.meta.index.intersection(df.index)
  
          n_invalid = len(df) - len(idx)
          if n_invalid > 0:
              msg = 'Ignoring {} scenario{} from imported metadata'
              logger().info(msg.format(n_invalid, 's' if n_invalid > 1 else ''))
  
          if idx.empty:
              raise ValueError('No valid scenarios in imported metadata file!')
  
          df = df.loc[idx]
  
          # Merge in imported metadata
          msg = 'Importing metadata for {} scenario{} (for total of {})'
          logger().info(msg.format(len(df), 's' if len(df) > 1 else '',
                                   len(self.meta)))
  
          for col in df.columns:
              self._new_meta_column(col)
              self.meta[col] = df[col].combine_first(self.meta[col])
          # set column `exclude` to bool
          self.meta.exclude = self.meta.exclude.astype('bool')
docs: Load metadata exported from `pyam.IamDataFrame` instance
  
          Parameters
          ----------
          path: string
              xlsx file with metadata exported from `pyam.IamDataFrame` instance