def configure(<EOL>self, conf=None, targets=None, logger=None, callconf=False,<EOL>keepstate=None, modules=None<EOL>):
result = []<EOL>self.loadmodules(modules=modules)<EOL>modules = []<EOL>conf = self._toconf(conf)<EOL>if conf is None:<EOL><INDENT>conf = self.conf<EOL><DEDENT>if targets is None:<EOL><INDENT>targets = self.targets<EOL><DEDENT>if logger is None:<EOL><INDENT>logger = self.logger<EOL><DEDENT>if keepstate is None:<EOL><INDENT>keepstate = self.keepstate<EOL><DEDENT>for target in targets:<EOL><INDENT>try:<EOL><INDENT>configured = self._configure(<EOL>conf=conf, logger=logger, target=target, callconf=callconf,<EOL>keepstate=keepstate, modules=modules<EOL>)<EOL><DEDENT>except Exception:<EOL><INDENT>if logger is not None:<EOL><INDENT>logger.error(<EOL>'<STR_LIT>'.format(<EOL>format_exc(), self, targets<EOL>)<EOL>)<EOL><DEDENT><DEDENT>else:<EOL><INDENT>result.append(configured)<EOL><DEDENT><DEDENT>return result<EOL>
Apply input conf on targets objects.

        Specialization of this method is done in the _configure method.

        :param conf: configuration model to configure. Default is this conf.
        :type conf: Configuration, Category or Parameter
        :param Iterable targets: objects to configure. self targets by default.
        :param Logger logger: specific logger to use.
        :param bool callconf: if True (False by default), the configuration is
            used in the callable target parameters while calling it.
        :param bool keepstate: if True (default), do not instanciate sub objects
            if they already exist.
        :param list modules: modules to reload before.
        :return: configured targets.
        :rtype: list
        :raises: Parameter.Error for any raised exception.