code: def _get_safe_alternatives(filename: str) -> Iterable[str]:
      """Returns potential safetensors alternatives for a given filename.
  
      Use case:
          When downloading a model from the Huggingface Hub, we first look if a .safetensors file exists and if yes, we use it.
          Main use case is filename "pytorch_model.bin" => check for "model.safetensors" or "pytorch_model.safetensors".
      """
      if filename == HF_WEIGHTS_NAME:
          yield HF_SAFE_WEIGHTS_NAME
      if filename == HF_OPEN_CLIP_WEIGHTS_NAME:
          yield HF_OPEN_CLIP_SAFE_WEIGHTS_NAME
      if filename not in (
          HF_WEIGHTS_NAME,
          HF_OPEN_CLIP_WEIGHTS_NAME,
      ) and filename.endswith(".bin"):
          yield filename[:-4] + ".safetensors"
  
imports: import hashlib
  import json
  import logging
  import os
  from functools import partial
  from pathlib import Path
  from tempfile import TemporaryDirectory
  from typing import Iterable, Optional, Union
  import torch
  from torch.hub import HASH_REGEX, download_url_to_file, urlparse
  from timm import __version__
  from timm.models._pretrained import filter_pretrained_cfg
label_desc: Use image node_id 14 for calling a global function with example usage: _get_safe_alternatives(filename) without return types