code: def _split_real_inputs(inputs, lhs_keys, prototype):
      """
      Finds a splitting set of indices ``(lhs, rhs)`` into the flat real
      dimension such that ``lhs`` indexes into real inputs in ``lhs_keys`` and
      ``rhs`` indexes into everything else.
      """
      lhs_blocks = []
      rhs_blocks = []
      start = 0
      for key, domain in inputs.items():
          if domain.dtype == "real":
              stop = start + domain.num_elements
              (lhs_blocks if key in lhs_keys else rhs_blocks).append(
                  slice(start, stop)
              )
              start = stop
  
      # There are three cases: lhs left of rhs (cheap slices), lhs right of rhs
      # (cheap slices), and interleaved (expensive advanced indexing tensors).
      lhs_start = min(b.start for b in lhs_blocks)
      rhs_start = min(b.start for b in rhs_blocks)
      lhs_stop = max(b.stop for b in lhs_blocks)
      rhs_stop = max(b.stop for b in rhs_blocks)
      if lhs_stop <= rhs_start or rhs_stop <= lhs_start:
          # Construct cheap slices.
          lhs = slice(lhs_start, lhs_stop)
          rhs = slice(rhs_start, rhs_stop)
          return lhs, rhs
  
      # Construct interleaving indices.
      lhs = ops.cat(
          [
              ops.new_arange(prototype, b.start, b.stop)
              for b in lhs_blocks
          ]
      )
      rhs = ops.cat(
          [
              ops.new_arange(prototype, b.start, b.stop)
              for b in rhs_blocks
          ]
      )
      return lhs, rhs
  
imports: import math
  from collections import OrderedDict, defaultdict
  from contextlib import contextmanager
  from functools import reduce
  import funsor.ops
  from funsor.affine import affine_inputs, extract_affine, is_affine
  from funsor.delta import Delta
  from funsor.domains import Real, Reals
  from funsor.interpretations import compress_gaussians
  from funsor.ops import AddOp, SubOp
  from funsor.tensor import Tensor, align_tensor, align_tensors
  from funsor.terms import Binary, Funsor, FunsorMeta, Number, Slice, Subs, Variable, eager, reflect
  from funsor.util import broadcast_shape, get_tracing_state, lazy_property
label_desc: Use image node_id 11 for calling a global function with example usage: _split_real_inputs(inputs, lhs_keys, prototype) and returns: lhs,  rhs, lhs,  rhs