def convert_null_to_zero(event, field_or_field_list):
    """ Converts the value in a field or field list from None to 0

    :param event: a dict with the event
    :param field_or_field_list: A single field or list of fields to convert to 0 if null
    :return: the updated event

    Examples:

    .. code-block:: python

        # Example #1
        event = {'a_field': None}
        event = convert_null_to_zero(event, field_or_field_list='a_field')
        event = {'a_field': 0}

        # Example #2
        event = {'a_field': None,
                'another_field': None}
        event = convert_null_to_zero(event, field_list=['a_field', 'another_field'])
        event = {'a_field': 0,
                'another_field': 0}

    """

    if type(field_or_field_list) is str:
        field_or_field_list = [field_or_field_list]

    for field in field_or_field_list:
        if field in event and event[field] is None:
            event[field] = 0

    return event