def _check_for_single_nested(target, items_by_key, input_order):
    """Check for single nested inputs that match our target count and unnest.

    Handles complex var inputs where some have an extra layer of nesting.
    """
    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
Check for single nested inputs that match our target count and unnest.

    Handles complex var inputs where some have an extra layer of nesting.