def _match_in_cache(cache_tree, list_of_names):
    head_item = list_of_names[0]
    # print "head_item is {0}".format(head_item)
    head_item_matches = [ m for m in cache_tree.keys() if fnmatch.fnmatch(m, head_item) ]
    if head_item not in cache_tree.keys():
        # print "A"
        return [] # Empty List to signify we're done here
    elif len(list_of_names) == 1:
        # print "B"
        return cache_tree[head_item].keys()
    else:
        # print "C"
        tail_list = list_of_names[1:]
        return _match_in_cache(cache_tree[head_item], tail_list)
:type cache_tree: defaultdict
dataset/ETHPy150Open pcn/pyKairosDB/pyKairosDB/util.py/_match_in_cache