<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def sub(self, path):
 """Returns AppDir instance for given subdirectory name."""


        if is_collection(path):
            path = path_join(path)

        return AppDir(path_join(self.path, path))