code: def _convert_to_interface(res, interface):
      """
      Recursively convert res to the given interface.
      """
      interface = INTERFACE_MAP[interface]
  
      if interface in ["Numpy"]:
          return res
  
      if isinstance(res, (list, tuple)):
          return type(res)(
              _convert_to_interface(r, interface) for r in res
          )
  
      if isinstance(res, dict):
          return {
              k: _convert_to_interface(v, interface)
              for k, v in res.items()
          }
  
      return qml.math.asarray(
          res, like=interface if interface != "tf" else "tensorflow"
      )
  
imports: import copy
  import functools
  import inspect
  import warnings
  from collections.abc import Sequence
  from typing import Union
  import logging
  import pennylane
  from pennylane import Device
  from pennylane.measurements import CountsMP, MidMeasureMP, Shots
  from pennylane.tape import QuantumTape, QuantumScript
  from .execution import INTERFACE_MAP, SUPPORTED_INTERFACES
  from .set_shots import set_shots
label_desc: Use image node_id 1 for calling a global function with example usage: _convert_to_interface(res, interface) and returns: qml, res, type, unknown