code: def get_tokenizer(
      model_name: str, **kwargs
  ) -> transformers.PreTrainedTokenizer:
      from allennlp.common.util import hash_object
  
      cache_key = (model_name, hash_object(kwargs))
  
      global _tokenizer_cache
      tokenizer = _tokenizer_cache.get(cache_key, None)
      if tokenizer is None:
          tokenizer = transformers.AutoTokenizer.from_pretrained(
              model_name,
              **kwargs,
          )
          _tokenizer_cache[cache_key] = tokenizer
      return tokenizer
  
file_path: allennlp/allennlp/common/cached_transformers.py
imports: import logging
  import re
  import warnings
  from typing import Dict, NamedTuple, Optional, Tuple, Union, cast
  import transformers
  from allennlp.common.checks import ConfigurationError
  from transformers import AutoConfig, AutoModel
label_desc: Use image node_id 2 for calling a global function with example usage: get_tokenizer(model_name) and returns: tokenizer