def check_namespace_for_storage_ref(space, storage_ref):
    """Check if storage ref exists as a NLP ref or NLU ref in a given namespace"""
    for lang, mappings in space.items():
        for nlu_ref, nlp_ref in mappings.items():
            if nlu_ref == storage_ref or nlp_ref == storage_ref : return True
    return False