code: def _set_role_variable_by_entity_key(self) -> Dict[str, str]:
          '''Identify and set the good roles for the different entities'''
          if self.role_variable_by_entity_key is None:
              self.role_variable_by_entity_key = dict(
                  (entity.key, entity.key + '_legacy_role') for entity in self.tax_benefit_system.entities)
  
          return self.role_variable_by_entity_kef _set_role_variable_by_entity_key(self) -> Dict[str, str]:
          '''Identify and set the good roles for the different entities'''
          if self.role_variable_by_entity_key is None:
              self.role_variable_by_entity_key = dict(
                  (entity.key, entity.key + '_legacy_role') for entity in self.tax_benefit_system.entities)
  
          return self.role_variable_by_entity_key
docs: Identify and set the good roles for the different entities