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

def baseline_snapshot(name, number=None, tag=None, include_diff=True, config='root', ignore=None):
    '''
    Enforces that no file is modified comparing against a previously
    defined snapshot identified by number.

    number
        Number of selected baseline snapshot.

    tag
        Tag of the selected baseline snapshot. Most recent baseline baseline
        snapshot is used in case of multiple snapshots with the same tag.
        (`tag` and `number` cannot be used at the same time)

    include_diff
        Include a diff in the response (Default: True)

    config
        Snapper config name (Default: root)

    ignore
        List of files to ignore. (Default: None)
    '''
    if not ignore:
        ignore = []

    ret = {'changes': {},
           'comment': '',
           'name': name,
           'result': True}

    if number is None and tag is None:
        ret.update({'result': False,
                    'comment': 'Snapshot tag or number must be specified'})
        return ret

    if number and tag:
        ret.update({'result': False,
                    'comment': 'Cannot use snapshot tag and number at the same time'})
        return ret

    if tag:
        snapshot = _get_baseline_from_tag(config, tag)
        if not snapshot:
            ret.update({'result': False,
                        'comment': 'Baseline tag "{0}" not found'.format(tag)})
            return ret
        number = snapshot['id']

    status = __salt__['snapper.status'](
        config, num_pre=0, num_post=number)

    for target in ignore:
        if os.path.isfile(target):
            status.pop(target, None)
        elif os.path.isdir(target):
            for target_file in [target_file for target_file in status.keys() if target_file.startswith(target)]:
                status.pop(target_file, None)

    for file in status:
        # Only include diff for modified files
        if "modified" in status[file]["status"] and include_diff:
            status[file].pop("status")
            status[file].update(__salt__['snapper.diff'](config,
                                                         num_pre=0,
                                                         num_post=number,
                                                         filename=file).get(file, {}))

    if __opts__['test'] and status:
        ret['changes'] = status
        ret['comment'] = "{0} files changes are set to be undone".format(len(status.keys()))
        ret['result'] = None
    elif __opts__['test'] and not status:
        ret['changes'] = {}
        ret['comment'] = "Nothing to be done"
        ret['result'] = True
    elif not __opts__['test'] and status:
        undo = __salt__['snapper.undo'](config, num_pre=number, num_post=0,
                                        files=status.keys())
        ret['changes']['sumary'] = undo
        ret['changes']['files'] = status
        ret['result'] = True
    else:
        ret['comment'] = "No changes were done"
        ret['result'] = True

    return ret