(opt_array)
return kwargs
Convert any options that can't be parsed by argparse into a kwargs dict; if an option is specified
    multiple times, it will appear as a list in the results

    :param opt_array: a list of "option=value" strings
    :returns: a dict mapping from options -> values
Convert any options that can't be parsed by argparse into a kwargs dict; if an option is specified
    multiple times, it will appear as a list in the results
Convert any options that can t be parsed by argparse into a kwargs dict ; if an option is specified multiple times it will appear as a list in the results
def _parse_extra_options(opt_array):
    """ Convert any options that can't be parsed by argparse into a kwargs dict; if an option is specified
    multiple times, it will appear as a list in the results

    :param opt_array: a list of "option=value" strings
    :returns: a dict mapping from options -> values
    """
    kwargs = {}
    for opt_string in opt_array:
        opt, val = [s.strip() for s in opt_string.split("=")]
        if opt in kwargs:
            if not isinstance(kwargs[opt], list):
                kwargs[opt] = [kwargs[opt]]
            kwargs[opt].append(val)
        else:
            kwargs[opt] = val
    return kwargs
def _parse_extra_options ( opt_array ) : kwargs = { } for opt_string in opt_array : opt , val = [ s . strip ( ) for s in opt_string . split ( "=" ) ] if opt in kwargs : if not isinstance ( kwargs [ opt ] , list ) : kwargs [ opt ] = [ kwargs [ opt ] ] kwargs [ opt ] . append ( val ) else : kwargs [ opt ] = val return kwargs