<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:

def exhaustive_fragment_check( self,
                                   ontology:pd.DataFrame,
                                   iri_curie_fragment_predicate:str = 'iri',
                                   cross_reference_iris:bool = False,
                                   cross_reference_fragments:bool = False,
                                   diff:bool = True, ) -> Tuple[list]:
        ''' All entities with conflicting fragments gets a full diff to see if they belong

            Args:
                ontology: pandas DataFrame created from an ontology where the colnames are predicates
                    and if classes exist it is also thrown into a the colnames.
                iri_curie_fragment_predicate: usually in qname form and is the colname of the DataFrame for iri
                    Default is "iri" for graph2pandas module
                diff: complete exhaustive diff if between curie matches... will take FOREVER if there are a lot -> n^2
            Returns:
                inside: entities that are inside of InterLex
                outside: entities NOT in InterLex
                diff (optional): List[List[dict]]... so complicated but usefull diff between matches only '''

        inside, outside = [], []
        header = ['Index'] + list(ontology.columns)
        for row in ontology.itertuples():
            row = {header[i]:val for i, val in enumerate(row)}
            entity_suffix = row[iri_curie_fragment_predicate]
            if isinstance(entity_suffix, list):
                if len(entity_suffix) != 0:
                    exit('Need to have only 1 iri in the cell from the onotology.')
                else:
                    entity_suffix = entity_suffix[0]
            entity_fragment = self.extract_fragment(entity_suffix)
            ilx_rows = self.fragment2rows.get(entity_fragment)
            if cross_reference_fragments and ilx_rows:
                ilx_rows = [row for row in ilx_rows if entity_fragment.lower() in row['iri'].lower()]
            if cross_reference_iris and ilx_rows:
                # true suffix of iris
                ilx_rows = [row for row in ilx_rows if entity_suffix.rsplit('/', 1)[-1].lower() in row['iri'].lower()]
            if ilx_rows:
                inside.append({
                    'external_ontology_row': row,
                    'ilx_rows': ilx_rows,
                })
            else:
                outside.append(row)
        if diff:
            diff = self.__exhaustive_diff(inside)
            return inside, outside, diff
        return inside, outside