code: def from_pretrained(
      model_tag,
      download=True,
      out_file=None,
      weight_name="latest",
      mock_dataset=True,
  ):
      # Convert inputs to registry format
  
      if PretainedRegistry.MODELS.get(model_tag) is not None:
          url = PretainedRegistry.MODELS.get(model_tag)
      else:
          raise Exception(
              "model_tag {} doesn't exist within available models. Here is the list of pre-trained models {}".format(
                  model_tag, PretainedRegistry.available_models()
              )
          )
  
      checkpoint_name = model_tag + ".pt"
      out_file = os.path.join(CHECKPOINT_DIR, checkpoint_name)
  
      if download:
          download_file(url, out_file)
  
          weight_name = (
              weight_name if weight_name is not None else "latest"
          )
  
          checkpoint: ModelCheckpoint = ModelCheckpoint(
              CHECKPOINT_DIR,
              model_tag,
              weight_name if weight_name is not None else "latest",
              resume=False,
          )
          if mock_dataset:
              dataset = checkpoint.dataset_properties.copy()
              if (
                  PretainedRegistry.MOCK_USED_PROPERTIES.get(model_tag)
                  is not None
              ):
                  for (
                      k,
                      v,
                  ) in PretainedRegistry.MOCK_USED_PROPERTIES.get(
                      model_tag
                  ).items():
                      dataset[k] = v
  
          else:
              dataset = instantiate_dataset(checkpoint.data_config)
  
          model: BaseModel = checkpoint.create_model(
              dataset, weight_name=weight_name
          )
  
          Wandb.set_urls_to_model(model, url)
  
          BaseDataset.set_transform(model, checkpoint.data_config)
  
          return model
  
file_path: torch-points3d/torch_points3d/applications/pretrained_api.py
imports: import os
  import logging
  import urllib.request
  from omegaconf import DictConfig
  from torch_points3d.datasets.dataset_factory import instantiate_dataset
  from torch_points3d.models.model_factory import instantiate_model
  from torch_points3d.models.base_model import BaseModel
  from torch_points3d.datasets.base_dataset import BaseDataset
  from torch_points3d.utils.wandb_utils import Wandb
  from torch_points3d.metrics.model_checkpoint import ModelCheckpoint
label_desc: Use image node_id 1 for calling the PretainedRegistry obj's underlying member method code with example usage: obj.from_pretrained(model_tag, download, out_file, weight_name, mock_dataset) and returns: model