code: def safe_model_name(model_name: str, remove_source: bool = True):
      # return a filename / path safe model name
      def make_safe(name):
          return "".join(
              c if c.isalnum() else "_" for c in name
          ).rstrip("_")
  
      if remove_source:
          model_name = parse_model_name(model_name)[-1]
      return make_safe(model_name)
  
file_path: pytorch-image-models/timm/models/_factory.py
imports: import os
  from typing import Any, Dict, Optional, Union
  from urllib.parse import urlsplit
  from timm.layers import set_layer_config
  from ._helpers import load_checkpoint
  from ._hub import load_model_config_from_hf
  from ._pretrained import PretrainedCfg
  from ._registry import is_model, model_entrypoint, split_model_name_tag
label_desc: Use image node_id 2 for calling a global function with example usage: safe_model_name(model_name, remove_source) and returns: make_safe, str