<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def __parse_imap_search_result(self, result):
 """ This takes the result of imap_search and returns SANE results @Params result - result from an imap_search call @Returns List of IMAP search results """

        if isinstance(result, types.ListType):
            # Above is same as "type(result) == types.ListType"
            if len(result) == 1:
                return self.__parse_imap_search_result(result[0])
            else:
                return result
        elif isinstance(result, types.StringType):
            # Above is same as "type(result) == types.StringType"
            return result.split()
        else:
            # Fail silently assuming tests will fail if emails are not found
            return []