code: def get_project_path(
      config_name="config.yaml", cur_path: Union[Path, str, None] = None
  ) -> Path:
      """
      If users are building a project follow the following pattern.
      - Qlib is a sub folder in project path
      - There is a file named `config.yaml` in qlib.
  
      For example:
          If your project file system structure follows such a pattern
  
              <project_path>/
                - config.yaml
                - ...some folders...
                  - qlib/
  
          This folder will return <project_path>
  
          NOTE: link is not supported here.
  
  
      This method is often used when
      - user want to use a relative config path instead of hard-coding qlib config path in code
  
      Raises
      ------
      FileNotFoundError:
          If project path is not found
      """
      if cur_path is None:
          cur_path = Path(__file__).absolute().resolve()
      cur_path = Path(cur_path)
      while True:
          if (cur_path / config_name).exists():
              return cur_path
          if cur_path == cur_path.parent:
              raise FileNotFoundError("We can't find the project path")
          cur_path = cur_path.parent
  
file_path: qlib/qlib/__init__.py
imports: from pathlib import Path
  import os
  from typing import Union
  import yaml
  import logging
  import platform
  import subprocess
  from .log import get_module_logger
label_desc: Use image node_id 4 for calling a global function with example usage: get_project_path(config_name, cur_path) and returns: cur_path