<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _get_required_fn(fn, root_path):
 """ Definition of the MD5 file requires, that all paths will be absolute for the package directory, not for the filesystem. This function converts filesystem-absolute paths to package-absolute paths. Args: fn (str):
 Local/absolute path to the file. root_path (str):
 Local/absolute path to the package directory. Returns: str: Package-absolute path to the file. Raises: ValueError: When `fn` is absolute and `root_path` relative or \ conversely. """

    if not fn.startswith(root_path):
        raise ValueError("Both paths have to be absolute or local!")

    replacer = "/" if root_path.endswith("/") else ""

    return fn.replace(root_path, replacer, 1)