<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def normalize_subpath(self, subpath):
 """ Normalizes the specified subpath, or None if subpath is None. This allows Readme files to be inferred from directories while still allowing relative paths to work properly. Raises werkzeug.exceptions.NotFound if the resulting path would fall out of the root directory. """

        if subpath is None:
            return None

        # Normalize the subpath
        subpath = posixpath.normpath(subpath)

        # Add or remove trailing slash to properly support relative links
        filename = os.path.normpath(safe_join(self.root_directory, subpath))
        if os.path.isdir(filename):
            subpath += '/'

        return subpath