code: def encode_text(text, encoding_name):
      """Encode tokens with the given encoding."""
      # tiktoken.get_encoding is only available in python 3.8 and above.
      # This means that for python < 3.8, the batching is just using chunk_length chars each time.
      if sys.version_info >= (3, 8):
          import tiktoken  # pylint: disable=import-outside-toplevel
  
          encoding = tiktoken.get_encoding(encoding_name)
          return encoding.encode(text)
      else:
          return text
  
file_path: deepchecks/deepchecks/nlp/utils/text_embeddings.py
imports: import re
  import sys
  import warnings
  from itertools import islice
  from typing import Optional
  import numpy
  from tqdm import tqdm
label_desc: Use image node_id 2 for calling a global function with example usage: encode_text(text, encoding_name) and returns: encoding, text