code: def get_pairs(word):
      """
      Return set of symbol pairs in a word. word is represented as tuple of symbols (symbols being variable-length
      strings)
      """
      pairs = set()
      prev_char = word[0]
      for char in word[1:]:
          pairs.add((prev_char, char))
          prev_char = char
      return pairs
  
imports: import json
  import os
  import re
  import unicodedata
  from typing import List, Optional, Tuple
  from ...tokenization_utils import PreTrainedTokenizer, _is_control, _is_punctuation, _is_whitespace
  from ...utils import logging
label_desc: Use image node_id 1 for calling a global function with example usage: get_pairs(word) and returns: pairs