code: def get_encoder():
      root_dir = os.path.dirname(os.path.abspath(__file__))
      with gzip.open(
          os.path.join(root_dir, "encoder.json.gz"), "r"
      ) as f:
          encoder = json.load(f)
      with gzip.open(os.path.join(root_dir, "vocab.bpe.gz"), "r") as f:
          bpe_data = str(f.read(), "utf-8")
      bpe_merges = [
          tuple(merge_str.split())
          for merge_str in bpe_data.split("\n")[1:-1]
      ]
      return Encoder(
          encoder=encoder,
          bpe_merges=bpe_merges,
      )
  
file_path: glide-text2im/glide_text2im/tokenizer/bpe.py
imports: import gzip
  import json
  import os
  from functools import lru_cache
  from typing import List, Tuple
  import regex
label_desc: Use image node_id 3 for calling a global function with example usage: get_encoder() and returns: Encoder