def using(path):
    """
    Import a function from another .air script, the ``using`` interface will find the image path from the imported function.

    Args:
        path: relative or absolute. This function transforms a given relative path, searching in the project root, \
        current working directory, or the current script's directory, into an absolute path \
         and adds it to the sys.path and G.BASEDIR.

    Returns:

    Examples:

        Suppose our project structure is as follows::

            demo/
                foo/
                    bar.air
                baz.air
                main.py

        If we want to reference `foo/bar.air` and `baz.air` in main.py, we can set the project root path to ``ST.PROJECT_ROOT``, \
        or make sure the project root path is the `current working directory`. We can write::

            # main.py
            from airtest.core.api import *
            ST.PROJECT_ROOT = r"D:\demo"  # This line can be ignored if it is the current working directory
            using("foo/bar.air")
            using("baz.air")

        If we want to reference `baz.air` in `foo/bar.air`, we can write::

            # foo/bar.air
            from airtest.core.api import *
            using("../baz.air")

    """
    if not os.path.isabs(path):
        # if path is relative, try to find it in project root
        # e.g. path: PROJECT_ROOT/foo/bar.air, using("foo/bar.air")
        if os.path.exists(os.path.join(ST.PROJECT_ROOT, path)):
            path = os.path.join(ST.PROJECT_ROOT, path)
        # try to find it in current working directory
        # e.g. path: CWD/foo/bar.air, using("foo/bar.air")
        elif os.path.exists(os.path.join(os.getcwd(), path)):
            path = os.path.abspath(os.path.join(os.getcwd(), path))
        else:
            # try to find it relative to the current script
            # e.g. path: foo/bar1.air, foo/bar2.air, in bar1.air: using("../bar2.air")
            script_path = os.path.abspath(inspect.stack()[1].filename)
            script_dir = os.path.dirname(script_path)
            if os.path.exists(os.path.join(script_dir, path)):
                path = os.path.abspath(os.path.join(script_dir, path))
            elif os.path.exists(os.path.join(script_path, path)):
                path = os.path.abspath(os.path.join(script_path, path))

    G.LOGGING.debug("using path: %s", path)
    if path not in sys.path:
        sys.path.append(path)
    G.BASEDIR.append(path)

    Import a function from another .air script, the ``using`` interface will find the image path from the imported function.

    Args:
        path: relative or absolute. This function transforms a given relative path, searching in the project root,         current working directory, or the current script's directory, into an absolute path          and adds it to the sys.path and G.BASEDIR.

    Returns:

    Examples:

        Suppose our project structure is as follows::

            demo/
                foo/
                    bar.air
                baz.air
                main.py

        If we want to reference `foo/bar.air` and `baz.air` in main.py, we can set the project root path to ``ST.PROJECT_ROOT``,         or make sure the project root path is the `current working directory`. We can write::

            # main.py
            from airtest.core.api import *
            ST.PROJECT_ROOT = r"D:\demo"  # This line can be ignored if it is the current working directory
            using("foo/bar.air")
            using("baz.air")

        If we want to reference `baz.air` in `foo/bar.air`, we can write::

            # foo/bar.air
            from airtest.core.api import *
            using("../baz.air")

    
airtest/core/helper.py