@classmethod<EOL><INDENT>def _convert_to_fill(cls, fill_dict):<DEDENT>
from openpyxl.styles import PatternFill, GradientFill<EOL>_pattern_fill_key_map = {<EOL>'<STR_LIT>': '<STR_LIT>',<EOL>'<STR_LIT>': '<STR_LIT>',<EOL>'<STR_LIT>': '<STR_LIT>',<EOL>'<STR_LIT>': '<STR_LIT>',<EOL>'<STR_LIT>': '<STR_LIT>',<EOL>'<STR_LIT>': '<STR_LIT>',<EOL>}<EOL>_gradient_fill_key_map = {<EOL>'<STR_LIT>': '<STR_LIT:type>',<EOL>}<EOL>pfill_kwargs = {}<EOL>gfill_kwargs = {}<EOL>for k, v in fill_dict.items():<EOL><INDENT>pk = gk = None<EOL>if k in _pattern_fill_key_map:<EOL><INDENT>pk = _pattern_fill_key_map[k]<EOL><DEDENT>if k in _gradient_fill_key_map:<EOL><INDENT>gk = _gradient_fill_key_map[k]<EOL><DEDENT>if pk in ['<STR_LIT>', '<STR_LIT>']:<EOL><INDENT>v = cls._convert_to_color(v)<EOL><DEDENT>if gk == '<STR_LIT>':<EOL><INDENT>v = cls._convert_to_stop(v)<EOL><DEDENT>if pk:<EOL><INDENT>pfill_kwargs[pk] = v<EOL><DEDENT>elif gk:<EOL><INDENT>gfill_kwargs[gk] = v<EOL><DEDENT>else:<EOL><INDENT>pfill_kwargs[k] = v<EOL>gfill_kwargs[k] = v<EOL><DEDENT><DEDENT>try:<EOL><INDENT>return PatternFill(**pfill_kwargs)<EOL><DEDENT>except TypeError:<EOL><INDENT>return GradientFill(**gfill_kwargs)<EOL><DEDENT>
Convert ``fill_dict`` to an openpyxl v2 Fill object
Parameters
----------
fill_dict : dict
    A dict with one or more of the following keys (or their synonyms),
        'fill_type' ('patternType', 'patterntype')
        'start_color' ('fgColor', 'fgcolor')
        'end_color' ('bgColor', 'bgcolor')
    or one or more of the following keys (or their synonyms).
        'type' ('fill_type')
        'degree'
        'left'
        'right'
        'top'
        'bottom'
        'stop'
Returns
-------
fill : openpyxl.styles.Fill