def _do_generate(self, source_list, hang_type, crashed_thread, delimiter='<STR_LIT>'):
notes = []<EOL>debug_notes = []<EOL>sentinel_locations = []<EOL>for a_sentinel in self.signature_sentinels:<EOL><INDENT>if type(a_sentinel) == tuple:<EOL><INDENT>a_sentinel, condition_fn = a_sentinel<EOL>if not condition_fn(source_list):<EOL><INDENT>continue<EOL><DEDENT><DEDENT>try:<EOL><INDENT>sentinel_locations.append(source_list.index(a_sentinel))<EOL><DEDENT>except ValueError:<EOL><INDENT>pass<EOL><DEDENT><DEDENT>if sentinel_locations:<EOL><INDENT>min_index = min(sentinel_locations)<EOL>debug_notes.append(<EOL>'<STR_LIT>'.format(source_list[min_index], min_index)<EOL>)<EOL>source_list = source_list[min_index:]<EOL><DEDENT>new_signature_list = []<EOL>for a_signature in source_list:<EOL><INDENT>if self.irrelevant_signature_re.match(a_signature):<EOL><INDENT>debug_notes.append('<STR_LIT>'.format(a_signature))<EOL>continue<EOL><DEDENT>if '<STR_LIT>' in a_signature.lower():<EOL><INDENT>a_signature = a_signature.split('<STR_LIT:@>')[<NUM_LIT:0>]<EOL>if new_signature_list and a_signature == new_signature_list[-<NUM_LIT:1>]:<EOL><INDENT>continue<EOL><DEDENT><DEDENT>new_signature_list.append(a_signature)<EOL>if not self.prefix_signature_re.match(a_signature):<EOL><INDENT>debug_notes.append('<STR_LIT>'.format(a_signature))<EOL>break<EOL><DEDENT>debug_notes.append('<STR_LIT>'.format(a_signature))<EOL><DEDENT>if hang_type:<EOL><INDENT>debug_notes.append(<EOL>'<STR_LIT>'.format(hang_type, self.hang_prefixes[hang_type])<EOL>)<EOL>new_signature_list.insert(<NUM_LIT:0>, self.hang_prefixes[hang_type])<EOL><DEDENT>signature = delimiter.join(new_signature_list)<EOL>if signature == '<STR_LIT>' or signature is None:<EOL><INDENT>if crashed_thread is None:<EOL><INDENT>notes.append(<EOL>"<STR_LIT>"<EOL>"<STR_LIT>"<EOL>)<EOL>signature = "<STR_LIT>"<EOL><DEDENT>else:<EOL><INDENT>notes.append(<EOL>"<STR_LIT>"<EOL>"<STR_LIT>".format(crashed_thread)<EOL>)<EOL>try:<EOL><INDENT>signature = source_list[<NUM_LIT:0>]<EOL><DEDENT>except IndexError:<EOL><INDENT>signature = "<STR_LIT>"<EOL><DEDENT><DEDENT><DEDENT>return signature, notes, debug_notes<EOL>
each element of signatureList names a frame in the crash stack; and is:
  - a prefix of a relevant frame: Append this element to the signature
  - a relevant frame: Append this element and stop looking
  - irrelevant: Append this element only after seeing a prefix frame
The signature is a ' | ' separated string of frame names.