def build_map_type_validator(item_validator):
    """Return a function which validates that the value is a mapping of
    items. The function should return pairs of items that will be
    passed to the `dict` constructor.
    """
    def validate_mapping(value):
        return dict(item_validator(item) for item in validate_list(value))
    return validate_mapping
Return a function which validates that the value is a mapping of
    items. The function should return pairs of items that will be
    passed to the `dict` constructor.