def __deserialize_datatime(self, string):
try:<EOL><INDENT>from dateutil.parser import parse<EOL>return parse(string)<EOL><DEDENT>except ImportError:<EOL><INDENT>return string<EOL><DEDENT>except ValueError:<EOL><INDENT>raise ApiException(<EOL>status=<NUM_LIT:0>,<EOL>reason=(<EOL>"<STR_LIT>"<EOL>.format(string)<EOL>)<EOL>)<EOL><DEDENT>
Deserializes string to datetime.

The string should be in iso8601 datetime format.

:param string: str.
:return: datetime.