def format_norm(kwargs, current=None):
norm = kwargs.pop('<STR_LIT>', current) or '<STR_LIT>'<EOL>vmin = kwargs.pop('<STR_LIT>', None)<EOL>vmax = kwargs.pop('<STR_LIT>', None)<EOL>clim = kwargs.pop('<STR_LIT>', (vmin, vmax)) or (None, None)<EOL>clip = kwargs.pop('<STR_LIT>', None)<EOL>if norm == '<STR_LIT>':<EOL><INDENT>norm = colors.Normalize()<EOL><DEDENT>elif norm == '<STR_LIT>':<EOL><INDENT>norm = colors.LogNorm()<EOL><DEDENT>elif not isinstance(norm, colors.Normalize):<EOL><INDENT>raise ValueError("<STR_LIT>".format(norm))<EOL><DEDENT>for attr, value in (('<STR_LIT>', clim[<NUM_LIT:0>]), ('<STR_LIT>', clim[<NUM_LIT:1>]), ('<STR_LIT>', clip)):<EOL><INDENT>if value is not None:<EOL><INDENT>setattr(norm, attr, value)<EOL><DEDENT><DEDENT>return norm, kwargs<EOL>
Format a `~matplotlib.colors.Normalize` from a set of kwargs

    Returns
    -------
    norm, kwargs
        the formatted `Normalize` instance, and the remaining keywords