code: def find_reactions_with_identical_genes(model):
      
      duplicates = dict()
      for rxn_a, rxn_b in combinations(model.reactions, 2):
          if not (rxn_a.genes and rxn_b.genes):
              continue
          if rxn_a.genes == rxn_b.genes:
              # This works because the `genes` are frozen sets.
              identifiers = rxn_a.genes
              duplicates.setdefault(identifiers, set()).update(
                  [rxn_a.id, rxn_b.id])
      # Transform the object for JSON compatibility
      num_duplicated = set()
      duplicated = {}
      for key in duplicates:
          # Object keys must be strings in JSON.
          new_key = ",".join(sorted(g.id for g in key))
          duplicated[new_key] = rxns = list(duplicates[key])
          num_duplicated.update(rxns)
      return duplicated, len(num_duplicated)
docs: Return reactions that have identical genes.
  
      Identify duplicate reactions globally by checking if any
      two reactions have the same genes.
      This can be useful to curate merged models or to clean-up bulk model
      modifications, but also to identify promiscuous enzymes.
      The heuristic compares reactions in a pairwise manner and reports on
      reaction pairs whose genes are identical. Reactions with missing genes are
      skipped.
  
      Parameters
      ----------
      model : cobra.Model
          The metabolic model under investigation.
  
      Returns
      -------
      dict
          A mapping from sets of genes to all the reactions containing those
          genes.
      int
          The total number of unique reactions that appear duplicates based on
          their gene-protein-reaction associations.