code: def externals_use_cassette(name):
      """Helper to pass instruction via env variables to use specified cassette
  
      For instance whenever we are testing custom special remotes invoked by the annex
      but want to minimize their network traffic by using vcr.py
      """
      from unittest.mock import patch
  
      cassette_path = str(
          Path(_get_cassette_path(name)).resolve()
      )  # realpath OK
      with patch.dict(
          "os.environ", {"DATALAD_TESTS_USECASSETTE": cassette_path}
      ):
          yield
  
imports: import logging
  from functools import wraps
  from os.path import isabs
  from contextlib import contextmanager
  from datalad.utils import Path
  from datalad.support.exceptions import CapturedException
label_desc: Use image node_id 2 for calling a global function with example usage: externals_use_cassette(name) without return types