'Determine if ancestor_datatypes is the same as or a subset of current_datatypes.'

def compare_datatypes(self, ancestor_datatypes, current_datatypes):

    if (len(ancestor_datatypes) <= len(current_datatypes)):
        for ancestor_datatype in ancestor_datatypes:
            ancestor_datatype_dtype = ancestor_datatype['dtype']
            ancestor_datatype_extension = ancestor_datatype['extension']
            ancestor_datatype_mimetype = ancestor_datatype.get('mimetype', None)
            found_in_current = False
            for current_datatype in current_datatypes:
                if ((current_datatype['dtype'] == ancestor_datatype_dtype) and (current_datatype['extension'] == ancestor_datatype_extension) and (current_datatype.get('mimetype', None) == ancestor_datatype_mimetype)):
                    found_in_current = True
                    break
            if (not found_in_current):
                return self.NOT_EQUAL_AND_NOT_SUBSET
        if (len(ancestor_datatypes) == len(current_datatypes)):
            return self.EQUAL
        else:
            return self.SUBSET
    return self.NOT_EQUAL_AND_NOT_SUBSET
