code: def find_duplicate_metabolites_in_compartments(model):
      
      unique_identifiers = ["inchikey", "inchi"]
      duplicates = []
      for met_1, met_2 in combinations(model.metabolites, 2):
          if met_1.compartment == met_2.compartment:
              for key in unique_identifiers:
                  if key in met_1.annotation and key in met_2.annotation:
                      if met_1.annotation[key] == met_2.annotation[key]:
                          duplicates.append((met_1.id, met_2.id))
                          break
      return duplicates
docs: Return list of metabolites with duplicates in the same compartment.
  
      This function identifies duplicate metabolites in each compartment by
      determining if any two metabolites have identical InChI-key annotations.
      For instance, this function would find compounds with IDs ATP1 and ATP2 in
      the cytosolic compartment, with both having the same InChI annotations.
  
      Parameters
      ----------
      model : cobra.Model
          The metabolic model under investigation.
  
      Returns
      -------
      list
          A list of tuples of duplicate metabolites.