code: def load_requirements(
      path_dir: str,
      file_name: str = "base.txt",
      comment_char: str = "#",
      unfreeze: bool = True,
  ) -> List[str]:
      """Load requirements from a file."""
      path = os.path.join(path_dir, file_name)
      if not os.path.isfile(path):
          return []
  
      with open(path) as file:
          lines = [ln.strip() for ln in file.readlines()]
      reqs = []
      for ln in lines:
          # filer all comments
          comment = ""
          if comment_char in ln:
              comment = ln[ln.index(comment_char) :]
              ln = ln[: ln.index(comment_char)]
          req = ln.strip()
          # skip directly installed dependencies
          if not req or req.startswith("http") or "@http" in req:
              continue
          # remove version restrictions unless they are strict
          if unfreeze and "<" in req and "strict" not in comment:
              req = re.sub(r",? *<=? *[\d\.\*]+", "", req).strip()
          reqs.append(req)
      return reqs
  
imports: import inspect
  import os
  import re
  from dataclasses import asdict, dataclass, field
  from pathlib import Path
  from typing import TYPE_CHECKING, Dict, List, Optional, Union
  from typing_extensions import Self
  from lightning.app.utilities.app_helpers import Logger
  from lightning.app.utilities.packaging.cloud_compute import CloudCompute
label_desc: Use image node_id 1 for calling a global function with example usage: load_requirements(path_dir, file_name, comment_char, unfreeze) and returns: reqs, list