def get_cui( cache , word ): # If already in cache if cache.has_key( word + '--cuis' ): cuis = cache.get_map( word + '--cuis' ) else: # Get cui cuis = interface_umls.cui_lookup(word) cuis = [c[0] for c in cuis] # Eliminate duplicates cuis = list(set(cuis)) # Store result in cache cache.add_map( word + '--cuis', cuis ) return cuis