<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def ls(self):
 """List the children entities of the directory. Raises exception if the object is a file. :return: """

        if self.isfile():
            raise NotDirectoryError('Cannot ls() on non-directory node: {path}'.format(path=self._pyerarchy_path))

        return os.listdir(self._pyerarchy_path)