code: def _check_for_single_nested(target, items_by_key, input_order):
      
      out = utils.deepish_copy(items_by_key)
      for (k, t) in input_order.items():
          if t == "var":
              v = items_by_key[tuple(k.split("__"))]
              if _is_nested_single(v, target):
                  out[tuple(k.split("__"))] = v[0]
      return out
docs: Check for single nested inputs that match our target count and unnest.
  
      Handles complex var inputs where some have an extra layer of nesting.