def _maybe_nest_bare_single(items_by_key, parallel):
    """Nest single inputs to avoid confusing single items and lists like files.
    """
    if (parallel == "multi-parallel" and
          (sum([1 for x in items_by_key.values() if not _is_nested_item(x)]) >=
           sum([1 for x in items_by_key.values() if _is_nested_item(x)]))):
        out = {}
        for k, v in items_by_key.items():
            out[k] = [v]
        return out
    else:
        return items_by_key
Nest single inputs to avoid confusing single items and lists like files.