code: def add_sites_to_meas_table(dir_path):
      
      reqd_tables = ['measurements', 'specimens', 'samples', 'sites']
      con = Contribution(dir_path, read_tables=reqd_tables)
      # check that all required tables are available
      missing_tables = []
      for table in reqd_tables:
          if table not in con.tables:
              missing_tables.append(table)
      if missing_tables:
          return False, "You are missing {} tables".format(", ".join(missing_tables))
  
      # put sample column into the measurements table
      con.propagate_name_down('sample', 'measurements')
      # put site column into the measurements table
      con.propagate_name_down('site', 'measurements')
      # check that column propagation was successful
      if 'site' not in con.tables['measurements'].df.columns:
          return False, "Something went wrong with propagating sites down to the measurement level"
      return True, con.tables['measurements'].df
docs: Add site columns to measurements table (e.g., to plot intensity data),
      or generate an informative error message.
  
      Parameters
      ----------
      dir_path : str
          directory with data files
  
  
      Returns
      ----------
      status : bool
          True if successful, else False
      data : pandas DataFrame
          measurement data with site/sample