<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_stats(self, pattern, with_descriptions):
 """Get the VM statistics in a XMLish format. in pattern of type str The selection pattern. A bit similar to filename globbing. in with_descriptions of type bool Whether to include the descriptions. return stats of type str The XML document containing the statistics. """

        if not isinstance(pattern, basestring):
            raise TypeError("pattern can only be an instance of type basestring")
        if not isinstance(with_descriptions, bool):
            raise TypeError("with_descriptions can only be an instance of type bool")
        stats = self._call("getStats",
                     in_p=[pattern, with_descriptions])
        return stats