def might_set_subportal(kwdict):
    """
    The given keyword arguments indicate that a subportal *might* be set.

    I might not, even if this function returns True, because:

    - the subportal is already added
    - the `set_subportal` key is callable and might return False

    The kwdict dictionary is not consumed.

    >>> dic1 = {'only_other_keys': 42}
    >>> might_set_subportal(dic1)
    False
    >>> dic1
    {'only_other_keys': 42}
    >>> dic2 = {'subportal': 'some-subportal-id'}
    >>> might_set_subportal(dic2)
    True

    If `set_subportal` is callable, it *might* return True,
    but we don't try it (we don't have an object):
    >>> dic3 = {'subportal': 'other-subportal-id',
    ...         'set_subportal': lambda: False}
    >>> might_set_subportal(dic3)
    True

    However, if no subportal is available, it can't be set:
    >>> dic4 = {'set_subportal': True}
    >>> might_set_subportal(dic4)
    False
    """
    get = kwdict.get
    subportal = get('subportal')
    set_subportal = get('set_subportal')
    if set_subportal is None:
        return bool(subportal)
    elif (not set_subportal  # False
           or not subportal):
        return False
    else:
        return True