<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def add_base_str(self, base_str, pattern='.+', pattern_base=None, append=True):
 """ Add further base string to this instance Parameters base_str: str or list of str Strings that are used as to look for keys to get and set keys in the :attr:`base` dictionary. If a string does not contain ``'%(key)s'``, it will be appended at the end. ``'%(key)s'`` will be replaced by the specific key for getting and setting an item. pattern: str Default: ``'.+'``. This is the pattern that is inserted for ``%(key)s`` in a base string to look for matches (using the :mod:`re` module) in the `base` dictionary. The default `pattern` matches everything without white spaces. pattern_base: str or list or str If None, the whatever is given in the `base_str` is used. Those strings will be used for generating the final search patterns. You can specify this parameter by yourself to avoid the misinterpretation of patterns. For example for a `base_str` like ``'my.str'`` it is recommended to additionally provide the `pattern_base` keyword with ``'my\.str'``. Like for `base_str`, the ``%(key)s`` is appended if not already in the string. append: bool If True, the given `base_str` are appended (i.e. it is first looked for them in the :attr:`base` dictionary), otherwise they are put at the beginning"""

        base_str = safe_list(base_str)
        pattern_base = safe_list(pattern_base or [])
        for i, s in enumerate(base_str):
            if '%(key)s' not in s:
                base_str[i] += '%(key)s'
        if pattern_base:
            for i, s in enumerate(pattern_base):
                if '%(key)s' not in s:
                    pattern_base[i] += '%(key)s'
        else:
            pattern_base = base_str
        self.base_str = base_str + self.base_str
        self.patterns = list(map(lambda s: re.compile(s.replace(
            '%(key)s', '(?P<key>%s)' % pattern)), pattern_base)) + \
            self.patterns