'Retrieve template configs for an identifier from the config_store or auto configuration.'

def get_check_tpls(self, identifier, **kwargs):

    if (kwargs.get('auto_conf') is True):
        kube_annotations = kwargs.get(KUBE_ANNOTATIONS)
        kube_container_name = kwargs.get(KUBE_CONTAINER_NAME)
        docker_labels = kwargs.get(DOCKER_LABELS)
        source = ''
        config = None
        if kube_annotations:
            config = self._get_kube_config(identifier, kube_annotations, kube_container_name)
            source = CONFIG_FROM_KUBE
        if ((config is None) and (docker_labels is not None)):
            config = self._get_docker_config(identifier, docker_labels)
            source = CONFIG_FROM_LABELS
        if (config is not None):
            (check_names, init_config_tpls, instance_tpls) = config
            return [(source, vs) for vs in zip(check_names, init_config_tpls, instance_tpls)]
        auto_config = self._get_auto_config(identifier)
        if auto_config:
            source = CONFIG_FROM_AUTOCONF
            return [(source, conf) for conf in auto_config]
        else:
            log.debug(('No    auto    config    was    found    for    image    %s,    leaving    it    alone.' % identifier))
            return []
    else:
        configs = self.read_config_from_store(identifier)
        if (not configs):
            return []
    res = []
    for (source, config) in configs.iteritems():
        if (not config):
            continue
        (check_names, init_config_tpls, instance_tpls) = config
        if ((len(check_names) != len(init_config_tpls)) or (len(check_names) != len(instance_tpls))):
            log.error('Malformed    configuration    template:    check_names,    init_configs    and    instances    are    not    all    the    same    length.    Container    with    identifier    {}    will    not    be    configured    by    the    service    discovery'.format(identifier))
            continue
        res += [(source, values) for values in zip(check_names, init_config_tpls, instance_tpls)]
    return res
