'Search for `series_name` and populate all `series_*` fields in entries when successfully parsed
:param session: SQLAlchemy session
:param entries: List of entries to process
:param series_name: Series name which is being processed
:param config: Series config being processed'

def parse_series(self, entries, series_name, config):

    def get_as_array(config, key):
        u'Return    configuration    key    as    array,    even    if    given    as    a    single    string'
        v = config.get(key, [])
        if isinstance(v, str):
            return [v]
        return v
    identified_by = config.get(u'identified_by', u'auto')
    if (identified_by == u'auto'):
        with Session() as session:
            series = session.query(Series).filter((Series.name == series_name)).first()
            if series:
                identified_by = (series.identified_by or u'auto')
    params = dict(identified_by=identified_by, alternate_names=get_as_array(config, u'alternate_name'), name_regexps=get_as_array(config, u'name_regexp'), strict_name=config.get(u'exact', False), allow_groups=get_as_array(config, u'from_group'), date_yearfirst=config.get(u'date_yearfirst'), date_dayfirst=config.get(u'date_dayfirst'), special_ids=get_as_array(config, u'special_ids'), prefer_specials=config.get(u'prefer_specials'), assume_special=config.get(u'assume_special'))
    for id_type in SERIES_ID_TYPES:
        params[(id_type + u'_regexps')] = get_as_array(config, (id_type + u'_regexp'))
    for entry in entries:
        if (entry.get(u'series_parser') and entry[u'series_parser'].valid and (entry[u'series_parser'].name.lower() != series_name.lower())):
            continue
        parsed = get_plugin_by_name(u'parsing').instance.parse_series(entry[u'title'], name=series_name, **params)
        if (not parsed.valid):
            continue
        parsed.field = u'title'
        log.debug(u'`%s`    detected    as    `%s`,    field:    `%s`', entry[u'title'], parsed, parsed.field)
        populate_entry_fields(entry, parsed, config)
