def applyconfiguration(targets, conf=None, *args, **kwargs):
    """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
    """

    result = []

    for target in targets:

        configurables = Configurable.get_annotations(target)

        if not configurables:
            configurables = [Configurable()]

        for configurable in configurables:

            configuredtargets = configurable.applyconfiguration(
                targets=[target], conf=conf, *args, **kwargs
            )
            result += configuredtargets

    return result
def applyconfiguration ( targets , conf = None , * args , ** kwargs ) : result = [ ] for target in targets : configurables = Configurable . get_annotations ( target ) if not configurables : configurables = [ Configurable ( ) ] for configurable in configurables : configuredtargets = configurable . applyconfiguration ( targets = [ target ] , conf = conf , * args , ** kwargs ) result += configuredtargets return result
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