code: def needs_packages(*names: str) -> unittest.skipIf:
      """Decorate a test such that it only runs if the rqeuired package is available."""
      missing = {name for name in names if not is_installed(name=name)}
      return unittest.skipIf(
          condition=missing,
          reason=f"Missing required packages: {sorted(missing)}.",
      )
  
imports: import importlib
  import unittest
  import torch
label_desc: Use image node_id 3 for calling a global function with example usage: needs_packages() and returns: unittest