def add_column_based_on_null(event, field, new_field, new_value_if_null, new_value_if_not_null):
    """ Checks and adds a value to a new field based on NULL

    :param event: A dictionary
    :param field: The name of the field to check
    :param new_field: The name of the new field
    :param new_value_if_null: The value for the new_field if field IS NULL
    :param new_value_if_not_null: The value for the new_field if field IS NOT NULL
    :return: An altered dictionary

    Examples:

    .. code-block:: python

        # Example #1
        event = {'do i have digits?': '1234'}
        event = add_column_based_on_null(event, field='do i have digits?', new_field='digits', new_value_if_null='N', new_value_if_not_null='Y')
        event = {'digits': 'Y',
                'do i have digits?': '1234'}

        # Example #2
        event = {'do i have digits?': None}
        event = add_column_based_on_null(event, field='do i have digits?', new_field='digits', new_value_if_null='N', new_value_if_not_null='Y')
        event = {'digits': 'N',
                'do i have digits?': None}

    """
    if field in event:
        if event[field] is None:
            event[new_field] = new_value_if_null
        else:
            event[new_field] = new_value_if_not_null

    return event