def METHOD_NAME(tar, file_path, artifact_path, raise_exc=True):
    """
    Get file obj from tarball.
    Args:
        tar(tarfile): The tarball.
        file_path(str): The desired file.
        artifact_path(str): The artifact path.
    Keyword Args:
        raise_exc(bool): Whether or not raise exception.
    """
    log.info(
        _("Reading {file_path} from {artifact_path}").format(
            file_path=file_path, artifact_path=artifact_path
        )
    )
    for path in [file_path, f"./{file_path}"]:
        try:
            file_obj = tar.extractfile(path)
        except KeyError:
            file_obj = None
        else:
            break
    if not file_obj and raise_exc:
        raise FileNotFoundError(f"{file_path} not found")
    return file_obj