@staticmethod
def _get_def(collection: dict[(str, dict[(str, mapping.Definition)])], model_name: str, key: str) -> 'mapping.Definition':
    m = collection.get(model_name)
    if (m is None):
        raise InternalError(f'mapping.unknown_model:{model_name}')
    d = m.get(key)
    if (d is None):
        raise InternalError(f'mapping.unknown_definition:{model_name}.{key}')
    return d
@staticmethod
def _get_def(collection: dict[(str, dict[(str, mapping.Definition)])], model_name: str, key: str) -> 'mapping.Definition':
    m = collection.get(model_name)
    if (m is None):
        raise InternalError(f'mapping.unknown_model:{model_name}')
    d = m.get(key)
    if (d is None):
        raise InternalError(f'mapping.unknown_definition:{model_name}.{key}')
    return d