code: def refresh_model_names():
      import glob
  
      from timm.models import list_models
  
      def read_models_from_docs():
          models = set()
          # TODO - set the path to pytorch-image-models repo
          for fn in glob.glob(
              "../pytorch-image-models/docs/models/*.md"
          ):
              with open(fn) as f:
                  while True:
                      line = f.readline()
                      if not line:
                          break
                      if not line.startswith(
                          "model = timm.create_model("
                      ):
                          continue
  
                      model = line.split("'")[1]
                      # print(model)
                      models.add(model)
          return models
  
      def get_family_name(name):
          known_families = [
              "darknet",
              "densenet",
              "dla",
              "dpn",
              "ecaresnet",
              "halo",
              "regnet",
              "efficientnet",
              "deit",
              "mobilevit",
              "mnasnet",
              "convnext",
              "resnet",
              "resnest",
              "resnext",
              "selecsls",
              "vgg",
              "xception",
          ]
  
          for known_family in known_families:
              if known_family in name:
                  return known_family
  
          if name.startswith("gluon_"):
              return "gluon_" + name.split("_")[1]
          return name.split("_")[0]
  
      def populate_family(models):
          family = dict()
          for model_name in models:
              family_name = get_family_name(model_name)
              if family_name not in family:
                  family[family_name] = []
              family[family_name].append(model_name)
          return family
  
      docs_models = read_models_from_docs()
      all_models = list_models(
          pretrained=True, exclude_filters=["*in21k"]
      )
  
      all_models_family = populate_family(all_models)
      docs_models_family = populate_family(docs_models)
  
      for key in docs_models_family:
          del all_models_family[key]
  
      chosen_models = set()
      for value in docs_models_family.values():
          chosen_models.add(value[0])
  
      for key, value in all_models_family.items():
          chosen_models.add(value[0])
  
      filename = "timm_models_list.txt"
      if os.path.exists("benchmarks"):
          filename = "benchmarks/" + filename
      with open(filename, "w") as fw:
          for model_name in sorted(chosen_models):
              fw.write(model_name + "\n")
  
imports: import importlib
  import logging
  import os
  import re
  import subprocess
  import sys
  import warnings
  import torch
  from common import BenchmarkRunner, download_retry_decorator, main
  from torch._dynamo.testing import collect_results, reduce_to_scalar_loss
  from torch._dynamo.utils import clone_inputs
label_desc: Use image node_id 2 for calling a global function with example usage: refresh_model_names() and returns: models, name, family, unknown, known_family