code: def _update_sleep_age_records(fname=AGE_SLEEP_RECORDS):
      """Help function to download Physionet's age dataset records."""
      import pooch
  
      pd = _check_pandas_installed()
      tmp = _TempDir()
  
      # Download subjects info.
      subjects_fname = op.join(tmp, "SC-subjects.xls")
      downloader = pooch.HTTPDownloader(**_downloader_params())
      pooch.retrieve(
          url=AGE_RECORDS_URL,
          known_hash=f"sha1:{AGE_RECORDS_URL_SHA1}",
          path=tmp,
          downloader=downloader,
          fname=op.basename(subjects_fname),
      )
  
      # Load and Massage the checksums.
      sha1_df = pd.read_csv(
          sha1sums_fname,
          sep="  ",
          header=None,
          names=["sha", "fname"],
          engine="python",
      )
      select_age_records = sha1_df.fname.str.startswith(
          "SC"
      ) & sha1_df.fname.str.endswith("edf")
      sha1_df = sha1_df[select_age_records]
      sha1_df["id"] = [name[:6] for name in sha1_df.fname]
  
      # Load and massage the data.
      data = pd.read_excel(subjects_fname)
      data = data.rename(
          index=str,
          columns={"sex (F=1)": "sex", "LightsOff": "lights off"},
      )
      data["sex"] = data.sex.astype("category").cat.rename_categories(
          {1: "female", 2: "male"}
      )
  
      data["id"] = [
          f"SC4{s:02d}{n:1d}" for s, n in zip(data.subject, data.night)
      ]
  
      data = data.set_index("id").join(sha1_df.set_index("id")).dropna()
  
      data["record type"] = (
          data.fname.str.split("-", expand=True)[1]
          .str.split(".", expand=True)[0]
          .astype("category")
      )
  
      data = data.reset_index().drop(columns=["id"])
      data = data[
          [
              "subject",
              "night",
              "record type",
              "age",
              "sex",
              "lights off",
              "sha",
              "fname",
          ]
      ]
  
      # Save the data.
      data.to_csv(fname, index=False)
  
file_path: mne-python/mne/datasets/sleep_physionet/_utils.py
imports: import os
  import os.path
  import numpy
  from ...utils import _check_pandas_installed, _on_missing, _TempDir, verbose
  from ..utils import _downloader_params, _get_path
label_desc: Use image node_id 4 for calling a global function with example usage: _update_sleep_age_records(fname) without return types