<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _build_flavors(p, flist, qualdecl=None):
 """ Build and return a dictionary defining the flavors from the flist argument. This function maps from the input keyword definitions for the flavors (ex. EnableOverride) to the PyWBEM internal definitions (ex. overridable) Uses the qualdecl argument as a basis if it exists. This is to define qualifier flavors if qualfier declaractions exist. This applies the values from the qualifierDecl to the the qualifier flavor list. This function and the defaultflavor function insure that all flavors are defined in the created dictionary that is returned. This is important because the PyWBEM classes allow `None` as a flavor definition. """


    flavors = {}
    if ('disableoverride' in flist and 'enableoverride' in flist) \
        or \
        ('restricted' in flist and 'tosubclass' in flist):  # noqa: E125

        raise MOFParseError(parser_token=p, msg="Conflicting flavors are"
                            "invalid")

    if qualdecl is not None:
        flavors = {'overridable': qualdecl.overridable,
                   'translatable': qualdecl.translatable,
                   'tosubclass': qualdecl.tosubclass,
                   'toinstance': qualdecl.toinstance}
    if 'disableoverride' in flist:
        flavors['overridable'] = False
    if 'enableoverride' in flist:
        flavors['overridable'] = True
    if 'translatable' in flist:
        flavors['translatable'] = True
    if 'restricted' in flist:
        flavors['tosubclass'] = False
    if 'tosubclass' in flist:
        flavors['tosubclass'] = True
    if 'toinstance' in flist:
        flavors['toinstance'] = True
    # issue #193 ks 5/16 removed tosubclass & set toinstance.

    return flavors