<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:

def _get_kvc(kv_arg):
    '''Returns a tuple keys, values, count for kv_arg (which can be a dict or a
        tuple containing keys, values and optinally count.'''
    if isinstance(kv_arg, Mapping):
        return six.iterkeys(kv_arg), six.itervalues(kv_arg), len(kv_arg)
    assert 2 <= len(kv_arg) <= 3, \
        'Argument must be a mapping or a sequence (keys, values, [len])'
    return (
        kv_arg[0],
        kv_arg[1],
        kv_arg[2] if len(kv_arg) == 3 else len(kv_arg[0]))