<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def type(self, mpath):
 """Return the manta type for the given manta path. @param mpath {str} The manta path for which to get the type. @returns {str|None} The manta type, e.g. "object" or "directory", or None if the path doesn't exist. """

        try:
            return self.stat(mpath)["type"]
        except errors.MantaResourceNotFoundError:
            return None
        except errors.MantaAPIError:
            _, ex, _ = sys.exc_info()
            if ex.code in ('ResourceNotFound', 'DirectoryDoesNotExist'):
                return None
            else:
                raise