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

    Insert the entity in the appropriate symbol table if both:
      1. It has not already been added
      2. The table is not frozen.

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

    Returns:
      integer id for the entity
    """
    table = self._symtab[type_name]
    if table.is_frozen():
      return table.get_id(entity_name)
    else:
      return table.get_insert_id(entity_name)
Retrieve the index of entity with given name and type.

    Insert the entity in the appropriate symbol table if both:
      1. It has not already been added
      2. The table is not frozen.

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

    Returns:
      integer id for the entity
    
language/nql/nql/__init__.py