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

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