def METHOD_NAME(
    self, output_sequences, nl_to_sql_dict, available_snippets, anonymize, anonymizer, anon_tok_to_ent
):
    # Get entities in the input sequence:
    #    anonymized entity types
    #    othe recognized entities (this includes "flight")
    entities_in_input = [[tok] for tok in self.input_seq_to_use if tok in anon_tok_to_ent]
    entities_in_input.extend(nl_to_sql_dict.get_sql_entities(self.input_seq_to_use))
    # Get the shortest gold query (this is what we use to train)
    shortest_gold_and_results = min(output_sequences, key=lambda x: len(x[0]))
    # Tokenize and anonymize it if necessary.
    self.original_gold_query = shortest_gold_and_results[0]
    self.gold_sql_results = shortest_gold_and_results[1]
    self.contained_entities = entities_in_input
    # Keep track of all gold queries and the resulting tables so that we can
    # give credit if it predicts a different correct sequence.
    self.all_gold_queries = output_sequences
    self.anonymized_gold_query = self.original_gold_query
    if anonymize:
        self.anonymized_gold_query = anonymizer.anonymize(
            self.original_gold_query, anon_tok_to_ent, OUTPUT_KEY, add_new_anon_toks=False
        )
    # Add snippets to it.
    self.gold_query_to_use = sql_util.add_snippets_to_query(
        available_snippets, entities_in_input, self.anonymized_gold_query
    )