code: def load_weights(mdl, name):
      """Download pretrained state_dict and load into model.
  
      Arguments:
          mdl {torch.nn.Module} -- Pytorch model.
          name {str} -- Name of dataset that was used to generate pretrained state_dict.
  
      Raises:
          ValueError: If 'pretrained' not equal to 'vggface2' or 'casia-webface'.
      """
      if name == "vggface2":
          path = "https://github.com/timesler/facenet-pytorch/releases/download/v2.2.9/20180402-114759-vggface2.pt"
      elif name == "casia-webface":
          path = "https://github.com/timesler/facenet-pytorch/releases/download/v2.2.9/20180408-102900-casia-webface.pt"
      else:
          raise ValueError(
              'Pretrained models only exist for "vggface2" and "casia-webface"'
          )
  
      model_dir = os.path.join(get_torch_home(), "checkpoints")
      os.makedirs(model_dir, exist_ok=True)
  
      cached_file = os.path.join(model_dir, os.path.basename(path))
      if not os.path.exists(cached_file):
          download_url_to_file(path, cached_file)
  
      state_dict = torch.load(cached_file)
      mdl.load_state_dict(state_dict)
  
imports: import os
  import requests
  from requests.adapters import HTTPAdapter
  import torch
  from torch import nn
  from torch.nn import functional
  from .utils.download import download_url_to_file
label_desc: Use image node_id 1 for calling a global function with example usage: load_weights(mdl, name) without return types