def pick(record, field, default=None):
    """Get the value for a key in a dict, or None if there is no dict.

    !!! warning
        But if the value for `field` in the record is `None`, `None` will be returned.

    Parameters
    ----------
    record: dict | `None`
        `pick` should work in both cases.
    field: string
        The field in `record` we want to extract.
    default: mixed
        Default value.

    Returns
    -------
    value | `None`
        The value is the default if the record is `None`, or if the record has no
        `field`.
        Otherwise it is the value for `field` from the record.
    """

    return default if record is None else record.get(field, default)