def string_to_datetime(self, obj):
if isinstance(obj, six.string_types) and len(obj) == <NUM_LIT>:<EOL><INDENT>try:<EOL><INDENT>return datetime.strptime(obj, "<STR_LIT>")<EOL><DEDENT>except ValueError:<EOL><INDENT>pass<EOL><DEDENT><DEDENT>if isinstance(obj, six.string_types) and len(obj) > <NUM_LIT>:<EOL><INDENT>try:<EOL><INDENT>return datetime.strptime(obj, "<STR_LIT>")<EOL><DEDENT>except ValueError:<EOL><INDENT>pass<EOL><DEDENT><DEDENT>if isinstance(obj, six.string_types) and len(obj) == <NUM_LIT:10>:<EOL><INDENT>try:<EOL><INDENT>return datetime.strptime(obj, "<STR_LIT>")<EOL><DEDENT>except ValueError:<EOL><INDENT>pass<EOL><DEDENT><DEDENT>return obj<EOL>
Decode a datetime string to a datetime object