code: def universal_test_midcast(a, b, c, op1, op2, d1: DType, d2: DType):
      if not isinstance(op1, tuple):
          op1 = (op1, op1)
      if not isinstance(op2, tuple):
          op2 = (op2, op2)
      at, bt, ct = (
          Tensor([a], dtype=d1),
          Tensor([b], dtype=d1),
          Tensor([c], dtype=d2),
      )
      an, bn, cn = (
          np.array([a]).astype(d1.np),
          np.array([b]).astype(d1.np),
          np.array([c]).astype(d2.np),
      )
      tensor_value = op2[0](op1[0](at, bt).cast(d2), ct).numpy()
      numpy_value = op2[1](op1[1](an, bn).astype(d2.np), cn)
      np.testing.assert_allclose(
          tensor_value,
          numpy_value,
          rtol=1e-6 if getenv("PTX") else 1e-7,
      )
  
imports: import unittest
  from tinygrad import Tensor, dtypes, Device
  import operator
  import numpy
  from hypothesis import given, strategies, settings
  from tinygrad.dtype import DType
  from tinygrad.helpers import CI, getenv, OSX
  from tinygrad.ops import UnaryOps, get_lazyop_info
label_desc: Use image node_id 4 for calling a global function with example usage: universal_test_midcast(a, b, c, op1, op2, d1, d2) without return types