nodes: 0, module; 1, function_definition; 2, function_name:_findSamesetProteins; 3, parameters; 4, block; 5, identifier:protToPeps; 6, default_parameter; 7, expression_statement; 8, expression_statement; 9, expression_statement; 10, for_statement; 11, expression_statement; 12, for_statement; 13, return_statement; 14, identifier:proteins; 15, None; 16, comment:"""Find proteins that are mapped to an identical set of peptides.
  
      :param protToPeps: dict, for each protein (=key) contains a set of
          associated peptides (=value). For Example {protein: {peptide, ...}, ...}
      :param proteins: iterable, proteins that are tested for having equal
          evidence. If not specified all proteins are tested
      :returns: a list of sorted protein tuples that share equal peptide evidence
      """; 17, assignment; 18, assignment; 19, identifier:protein; 20, identifier:proteins; 21, block; 22, assignment; 23, identifier:proteins; 24, call; 25, block; 26, identifier:equalProteins; 27, identifier:proteins; 28, conditional_expression:viewkeys(protToPeps) if proteins is None else proteins; 29, identifier:equalEvidence; 30, call; 31, expression_statement; 32, expression_statement; 33, identifier:equalProteins; 34, call; 35, identifier:viewvalues; 36, argument_list; 37, if_statement; 38, call; 39, comparison_operator:proteins is None; 40, identifier:proteins; 41, identifier:ddict; 42, argument_list; 43, assignment; 44, call; 45, identifier:list; 46, argument_list; 47, identifier:equalEvidence; 48, comparison_operator:len(proteins) > 1; 49, block; 50, identifier:viewkeys; 51, argument_list; 52, identifier:proteins; 53, None; 54, identifier:set; 55, identifier:peptides; 56, subscript; 57, attribute; 58, argument_list; 59, call; 60, integer:1; 61, expression_statement; 62, identifier:protToPeps; 63, identifier:protToPeps; 64, identifier:protein; 65, subscript; 66, identifier:add; 67, identifier:protein; 68, identifier:len; 69, argument_list; 70, call; 71, identifier:equalEvidence; 72, call; 73, identifier:proteins; 74, attribute; 75, argument_list; 76, identifier:tuple; 77, argument_list; 78, identifier:equalProteins; 79, identifier:append; 80, call; 81, call; 82, identifier:tuple; 83, argument_list; 84, identifier:sorted; 85, argument_list; 86, call; 87, identifier:peptides; 88, identifier:sorted; 89, argument_list; 90, identifier:proteins
code: def _findSamesetProteins(protToPeps, proteins=None):
      """Find proteins that are mapped to an identical set of peptides.
  
      :param protToPeps: dict, for each protein (=key) contains a set of
          associated peptides (=value). For Example {protein: {peptide, ...}, ...}
      :param proteins: iterable, proteins that are tested for having equal
          evidence. If not specified all proteins are tested
      :returns: a list of sorted protein tuples that share equal peptide evidence
      """
      proteins = viewkeys(protToPeps) if proteins is None else proteins
  
      equalEvidence = ddict(set)
      for protein in proteins:
          peptides = protToPeps[protein]
          equalEvidence[tuple(sorted(peptides))].add(protein)
      equalProteins = list()
      for proteins in viewvalues(equalEvidence):
          if len(proteins) > 1:
              equalProteins.append(tuple(sorted(proteins)))
      return equalProteins