def _get_item_kind(item):
    """Return (kind, isunittest) for the given item."""
    try:
        itemtype = item.kind
    except AttributeError:
        itemtype = item.__class__.__name__

    if itemtype == 'DoctestItem':
        return 'doctest', False
    elif itemtype == 'Function':
        return 'function', False
    elif itemtype == 'TestCaseFunction':
        return 'function', True
    elif item.hasattr('function'):
        return 'function', False
    else:
        return None, False