<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def load(self, paths, params=None):
 """ Load data from configuration files. Configuration values are read from a sequence of one or more YAML files. Files are read in the given order, and a duplicate value will overwrite the existing value. The optional 'params' argument is a dict-like object to use for parameter substitution in the config files. Any text matching "%key;" will be replaced with the value for 'key' in params. """

        def replace(match):
            """ Callback for re.sub to do parameter replacement. """
            # This allows for multi-pattern substitution in a single pass.
            return params[match.group(0)]

        params = {r"%{:s};".format(key): val for (key, val)
                  in params.iteritems()} if params else {}
        regex = compile("|".join(params) or r"^(?!)")
        for path in paths:
            with open(path, "r") as stream:
                # Global text substitution is used for parameter replacement.
                # Two drawbacks of this are 1) the entire config file has to be
                # read into memory first; 2) it might be nice if comments were
                # excluded from replacement. A more elegant (but complex)
                # approach would be to use PyYAML's various hooks to do the
                # substitution as the file is parsed.
                logger.info("reading config data from {:s}".format(path))
                yaml = regex.sub(replace, stream.read())
            try:
                self.update(load(yaml))
            except TypeError:  # load() returned None
                logger.warn("config file '{:s}' is empty".format(yaml))
        return