'Return a dict of templates coming from the config store and
the auto_conf folder and their source for a given identifier.
Templates from kv_templates take precedence.'

def get_templates(self, identifier):

    templates = {CONFIG_FROM_TEMPLATE: None, CONFIG_FROM_AUTOCONF: None}
    if (identifier not in self.kv_templates):
        try:
            tpls = self._issue_read(identifier)
        except NotImplementedError:
            tpls = None
        except Exception:
            tpls = None
            log.exception(('Failed    to    retrieve    a    template    for    %s.' % identifier))
        self.kv_templates[identifier] = tpls
    templates[CONFIG_FROM_TEMPLATE] = deepcopy(self.kv_templates[identifier])
    if (identifier in self.auto_conf_templates):
        auto_conf_tpls = [[], [], []]
        unfiltered_tpls = self.auto_conf_templates[identifier]
        for (idx, check_name) in enumerate(unfiltered_tpls[0]):
            if ((not templates[CONFIG_FROM_TEMPLATE]) or (check_name not in templates[CONFIG_FROM_TEMPLATE][0])):
                auto_conf_tpls[0].append(check_name)
                auto_conf_tpls[1].append(unfiltered_tpls[1][idx])
                auto_conf_tpls[2].append(unfiltered_tpls[2][idx])
        templates[CONFIG_FROM_AUTOCONF] = deepcopy(auto_conf_tpls)
    if (templates[CONFIG_FROM_TEMPLATE] or templates[CONFIG_FROM_AUTOCONF]):
        return templates
    return None
