code: def remove_repeated_and_leq(tokens: List[int], blank_id: int = 0):
      """Generate valid token sequence.
  
      Result may be used as input of transformer decoder and neural language model.
      Fristly, remove repeated token from a "token alignment" seqs;
      Then remove blank symbols.
  
      This fuction may be replaced by tokenizing word_seqs with tokenizer
      or composeing word_seqs_fsas with L_inv.fst
      or composing token_seqs with ctc_topo.
      Current method is slelected other than previous three methods
      because it won't need an extra object, i.e. tokenizer, L.fst or ctc_topo.
      """
      new_tokens = []
      previous = None
      for token in tokens:
          if token != previous:
              new_tokens.append(token)
              previous = token
      new_tokens = [token for token in new_tokens if token > blank_id]
      return new_tokens
  
imports: import math
  from typing import List, Tuple
  import torch
label_desc: Use image node_id 1 for calling a global function with example usage: remove_repeated_and_leq(tokens, blank_id) and returns: new_tokens