code: def _cast_to_type(g: jit_utils.GraphContext, input, to_type):
      if to_type is None:
          return input
      return getattr(opset9, f"_cast_{to_type}")(g, input, False)
  
imports: import functools
  import warnings
  import torch
  from torch._C import _onnx
  from torch.onnx import _type_utils, errors, symbolic_helper, symbolic_opset9
  from torch.onnx._internal import jit_utils, registration
label_desc: Use image node_id 5 for calling a global function with example usage: _cast_to_type(g, input, to_type) and returns: getattr, input