def get_id(self, entity_name, type_name):
    """Retrieve the index of entity with given name and type.

    Args:
      entity_name: string name of the entity
      type_name: string name of declared type

    Returns:
      integer id for the entity

    Raises:
      TypeNameError: If the type_name cannot be found.
      EntityNameError: If the entity_name has no valid id.
    """
    if not self.is_type(type_name):
      raise TypeNameError(type_name, 'Undeclared type')
    try:
      return self._symtab[type_name].get_id(entity_name)
    except KeyError:
      raise EntityNameError(entity_name, type_name, 'No entity mapping')
Retrieve the index of entity with given name and type.

    Args:
      entity_name: string name of the entity
      type_name: string name of declared type

    Returns:
      integer id for the entity

    Raises:
      TypeNameError: If the type_name cannot be found.
      EntityNameError: If the entity_name has no valid id.
    
language/nql/nql/__init__.py