'Returns the config in standard format.
All regexps are turned into dictionaries in the form of {compiled regexp: options}
:param config: Dict that can optionally contain the following keys
path: will be attached to entries that match
set: a dict of values to be attached to entries that match via set plugin
from: a list of fields in entry for the regexps to match against
not: a list of compiled regexps that if matching, will disqualify the main match
:return: New config dictionary'

def prepare_config(self, config):

    out_config = {}
    if (u'rest' in config):
        out_config[u'rest'] = config[u'rest']
    for (operation, regexps) in config.items():
        if (operation in [u'rest', u'from']):
            continue
        for regexp_item in regexps:
            if (not isinstance(regexp_item, dict)):
                regexp = regexp_item
                regexp_item = {regexp: {}}
            (regexp, opts) = list(regexp_item.items())[0]
            if (not isinstance(opts, dict)):
                opts = {u'path': opts}
            else:
                opts = opts.copy()
            if config.get(u'from'):
                opts.setdefault(u'from', config[u'from'])
            if ((u'from' in opts) and isinstance(opts[u'from'], basestring)):
                opts[u'from'] = [opts[u'from']]
            if ((u'not' in opts) and isinstance(opts[u'not'], basestring)):
                opts[u'not'] = [opts[u'not']]
            if (u'not' in opts):
                opts[u'not'] = [re.compile(not_re, (re.IGNORECASE | re.UNICODE)) for not_re in opts[u'not']]
            try:
                regexp = re.compile(str(regexp), (re.IGNORECASE | re.UNICODE))
            except re.error as e:
                raise plugin.PluginError((u'Invalid    regex    `%s`:    %s' % (regexp, e)))
            out_config.setdefault(operation, []).append({regexp: opts})
    return out_config
