def METHOD_NAME(self, ns, idx):
    if self._in_context is False:
        return False
    elif len(self._ns_to_idx) > self._max_indexes:
        return False
    self._ns_to_idx[ns] = idx
    return True