def METHOD_NAME(path: str, try_local_path: bool = False) -> str:
    """
    Downloads the specified file from the system where the current process is
    being debugged.
    If the `path` is prefixed with "target:" the prefix is stripped
    (to support remote target paths properly).
    If the `try_local_path` is set to `True` and the `path` exists locally and "target:" prefix is not present, it will return the local path instead of downloading the file.
    Returns:
        The local path to the file
    """
    assert path.startswith(("/", "./")) or path.startswith(
        "target:"
    ), "get_file called with incorrect path"
    has_target_prefix = path.startswith("target:")
    if has_target_prefix:
        path = path[7:]  # len('target:') == 7
    local_path = path
    qemu_root = pwndbg.gdblib.qemu.root()
    if qemu_root:
        return os.path.join(qemu_root, path)
    elif pwndbg.gdblib.remote.is_remote():
        if not pwndbg.gdblib.qemu.is_qemu():
            if try_local_path and not has_target_prefix and os.path.exists(local_path):
                return local_path
            local_path = tempfile.mktemp(dir=remote_files_dir())
            error = None
            try:
                error = gdb.execute(f'remote get "{path}" "{local_path}"', to_string=True)
            except gdb.error as e:
                error = str(e)
            if error:
                # If the client is configured with set debug remote 1, we need to
                # skip [remote] lines, and not interpret as missing file. Maybe
                # better to search for error strings. A real error will say:
                # "Remote I/O error: No such file or directory"
                real_error = []
                for line in error.splitlines():
                    if not line.startswith("[remote]"):
                        real_error.append(line)
                if len(real_error):
                    error = "\n".join(real_error)
                    raise OSError(
                        "Could not download remote file %r:\n" "Error: %s" % (path, error)
                    )
        else:
            print(
                message.warn(
                    f"pwndbg.gdblib.file.get_file({path}) returns local path as we can't download file from QEMU"
                )
            )
    return local_path