code: def _get_bert_dir(model_dir_or_name: str = "en-base-uncased"):
      if model_dir_or_name.lower() in PRETRAINED_BERT_MODEL_DIR:
          model_url = _get_embedding_url(
              "bert", model_dir_or_name.lower()
          )
          model_dir = cached_path(model_url, name="embedding")
          # 检查是否存在
      elif os.path.isdir(
          os.path.abspath(os.path.expanduser(model_dir_or_name))
      ):
          model_dir = os.path.abspath(
              os.path.expanduser(model_dir_or_name)
          )
      else:
          logger.info(
              f"Cannot recognize BERT dir or name ``{model_dir_or_name}``."
          )
          raise ValueError(
              f"Cannot recognize BERT dir or name ``{model_dir_or_name}``."
          )
      return str(model_dir)
  
imports: import os
  import re
  import shutil
  import tempfile
  from pathlib import Path
  from urllib.parse import urlparse
  import requests
  from requests import HTTPError
  from fastNLP.core.log import logger
  from rich.progress import Progress, BarColumn, DownloadColumn, TimeRemainingColumn, TimeElapsedColumn
label_desc: Use image node_id 14 for calling a global function with example usage: _get_bert_dir(model_dir_or_name) and returns: str