<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:

def flush(modifier):
    '''
    Flush the specified packet filter parameters.

    modifier:
        Should be one of the following:

        - all
        - info
        - osfp
        - rules
        - sources
        - states
        - tables

        Please refer to the OpenBSD `pfctl(8) <https://man.openbsd.org/pfctl#T>`_
        documentation for a detailed explanation of each command.

    CLI example:

    .. code-block:: bash

        salt '*' pf.flush states
    '''
    ret = {}

    all_modifiers = ['rules', 'states', 'info', 'osfp', 'all', 'sources', 'tables']

    # Accept the following two modifiers to allow for a consistent interface between
    # pfctl(8) and Salt.
    capital_modifiers = ['Sources', 'Tables']
    all_modifiers += capital_modifiers
    if modifier.title() in capital_modifiers:
        modifier = modifier.title()

    if modifier not in all_modifiers:
        raise SaltInvocationError('Unknown modifier: {0}'.format(modifier))

    cmd = 'pfctl -v -F {0}'.format(modifier)
    result = __salt__['cmd.run_all'](cmd,
                                     output_loglevel='trace',
                                     python_shell=False)

    if result['retcode'] == 0:
        if re.match(r'^0.*', result['stderr']):
            ret['changes'] = False
        else:
            ret['changes'] = True

        ret['comment'] = result['stderr']
    else:
        raise CommandExecutionError(
            'Could not flush {0}'.format(modifier),
            info={'errors': [result['stderr']], 'changes': False}
        )

    return ret