def METHOD_NAME(
    self,
    src: PurePath,
    is_file: bool = False,
    recurse: bool = False,
) -> PurePath:
    # copy file/folder to a temp location
    tmp_location = PurePath("/tmp")
    if is_file:
        # we want to copy file at
        # location : <tmp_location>/<src.parent.name>/<src.name>
        tmp_dir = tmp_location / src.parent.name
        tmp_location = tmp_dir / src.name
        self.node.tools[Mkdir].create_directory(str(tmp_dir), sudo=True)
    elif not recurse:
        # we want to copy only the files in `src` folder at
        # location : <tmp_location>/<src.name>
        tmp_dir = tmp_location / src.name
        tmp_location = tmp_dir
        src = src / "*"
        self.node.tools[Mkdir].create_directory(str(tmp_dir), sudo=True)
    else:
        # we want to copy the folder at
        # location : <tmp_location>
        tmp_dir = tmp_location
        tmp_location = tmp_dir / src.name
    # copy the required file/folder to the temp directory
    self.node.tools[Cp].copy(src, tmp_dir, sudo=True, recur=recurse)
    # change the owner of the temp directory
    username = self.node.tools[Whoami].get_username()
    self.node.tools[Chown].change_owner(
        tmp_location, user=username, group=username, recurse=True
    )
    return tmp_location