def object_kind(object_path):
    """
    Parse the kind of object from an UDisks2 object path.

    Example:
        /org/freedesktop/UDisks2/block_devices/sdb1 => device
        /org/freedesktop/UDisks2/drives/WDC_WD...   => drive
        /org/freedesktop/UDisks2/jobs/5             => job
    """
    try:
        return {'block_devices': 'device', 'drives': 'drive', 'jobs': 'job'
            }.get(object_path.split('/')[4])
    except IndexError:
        return None
