code: def get_create_model_storage(
      models_storage: Union[pathlib.Path, str, None] = None
  ):
      """Get the models storage directory and create it if needed."""
      if models_storage is None:
          models_storage = MODELS_STORAGE
      else:
          if isinstance(models_storage, str):
              models_storage = pathlib.Path(models_storage)
          if not isinstance(models_storage, pathlib.Path):
              raise ValueError(
                  f'Unexpected type of the "models_storage" parameter - {type(models_storage)}'
              )
          if not models_storage.exists():
              models_storage.mkdir(parents=True)
          if not models_storage.is_dir():
              raise ValueError(
                  '"model_storage" expected to be a directory'
              )
  
      return models_storage
  
file_path: deepchecks/deepchecks/nlp/utils/text_properties_models.py
imports: import logging
  import pathlib
  import warnings
  from contextlib import contextmanager
  from functools import lru_cache
  from importlib import import_module
  from typing import Optional, Union
  import requests
  from nltk import corpus
  from transformers.utils import logging
label_desc: Use image node_id 1 for calling a global function with example usage: get_create_model_storage(models_storage) and returns: models_storage