code: def _dup_coil_set(coils, coord_frame, t):
      """Make a duplicate."""
      if t is not None and coord_frame != t["from"]:
          raise RuntimeError(
              "transformation frame does not match the coil set"
          )
      coils = deepcopy(coils)
      if t is not None:
          coord_frame = t["to"]
          for coil in coils:
              for key in ("ex", "ey", "ez"):
                  if key in coil:
                      coil[key] = apply_trans(
                          t["trans"], coil[key], False
                      )
              coil["r0"] = apply_trans(t["trans"], coil["r0"])
              coil["rmag"] = apply_trans(t["trans"], coil["rmag"])
              coil["cosmag"] = apply_trans(
                  t["trans"], coil["cosmag"], False
              )
              coil["coord_frame"] = t["to"]
      return coils, coord_frame
  
imports: from copy import deepcopy
  import numpy
  from .._fiff.constants import FIFF
  from ..bem import _import_openmeeg, _make_openmeeg_geometry
  from ..fixes import bincount, jit
  from ..parallel import parallel_func
  from ..surface import _jit_cross, _project_onto_surface
  from ..transforms import apply_trans, invert_transform
  from ..utils import _check_option, _pl, fill_doc, logger, verbose, warn
label_desc: Use image node_id 1 for calling a global function with example usage: _dup_coil_set(coils, coord_frame, t) and returns: coils,  coord_frame