def compare(context, object_field, raw_data, raw_field):
    """
    Compare an object field value against the raw field value it should have come from.

    Args:
        context (str): The context of the comparison, used for printing error messages.
        object_field (Any): The value of the object field being compared.
        raw_data (dict): Raw data structure we're comparing a field from.
        raw_field (str): Name of the raw field we're doing the comparison on.

    Returns:
        bool: True if comparison was successful, False if not.
    """
    if raw_field in raw_data:
        result = (object_field == raw_data[raw_field])
    else:
        result = (object_field is None)
    if not result:
        print(f"field value {raw_field} did not match in {context} - object value {object_field}, "
              f"raw value {raw_data.get(raw_field, None)}")
    return result