def applyconfiguration(targets, conf=None, *args, **kwargs):
result = []<EOL>for target in targets:<EOL><INDENT>configurables = Configurable.get_annotations(target)<EOL>if not configurables:<EOL><INDENT>configurables = [Configurable()]<EOL><DEDENT>for configurable in configurables:<EOL><INDENT>configuredtargets = configurable.applyconfiguration(<EOL>targets=[target], conf=conf, *args, **kwargs<EOL>)<EOL>result += configuredtargets<EOL><DEDENT><DEDENT>return result<EOL>
Apply configuration on input targets.

    If targets are not annotated by a Configurable, a new one is instanciated.

    :param Iterable targets: targets to configurate.
    :param tuple args: applyconfiguration var args.
    :param dict kwargs: applyconfiguration keywords.
    :return: configured targets.
    :rtype: list