class_docstr: Ecco's central class. A wrapper around language models. We use it to run the language models
  and collect important data like input saliency and neuron activations.
  
  A LM object is typically not created directly by users,
  it is returned by `ecco.from_pretrained()`.
  
  Usage:
  
  ```python
  import ecco
  
  lm = ecco.from_pretrained('distilgpt2')
  output = lm.generate("Hello computer")
  ```
docstr: Analyzes a predicted token.
  Currently this methods computes the primary attribution explainability scores for each given token.
code: def _analyze_token(
      self,
      encoder_input_embeds: torch.Tensor,
      encoder_attention_mask: Optional,  # TODO: use encoder mask and also decoder mask
      decoder_input_embeds: Optional[torch.Tensor],
      prediction_id: torch.Tensor,
      attribution_flags: Optional[List[str]] = [],
  ) -> None:
      """
      Analyzes a predicted token.
      Currently this methods computes the primary attribution explainability scores for each given token.
      """
      for attr_method in attribution_flags:
          # deactivate hooks: attr method can perform multiple forward steps
          self._remove_hooks()
  
          # Add attribution scores to self.attributions
          self.attributions[attr_method].append(
              compute_primary_attributions_scores(
                  attr_method=attr_method,
                  model=self.model,
                  forward_kwargs={
                      "inputs_embeds": encoder_input_embeds,
                      "decoder_inputs_embeds": decoder_input_embeds,
                  },
                  prediction_id=prediction_id,
              )
              .cpu()
              .detach()
              .numpy()
          )
  
imports: from collections import defaultdict
  import inspect
  import json
  import os
  import random
  import torch
  import transformers
  from transformers import BatchEncoding
  import ecco
  import numpy
  from IPython import display
  from torch.nn import functional
  from ecco.attribution import compute_primary_attributions_scores
  from ecco.output import OutputSeq
  from typing import Optional, Any, List, Tuple, Dict, Union
  from operator import attrgetter
  import re
  from ecco.util import is_partial_token, strip_tokenizer_prefix
  from packaging import version
label_desc: Use image node_id 4 for calling the LM obj's underlying member method code with example usage: obj._analyze_token(encoder_input_embeds, encoder_attention_mask, decoder_input_embeds, prediction_id, attribution_flags) without return types