code: def _to_int(self, val_str):
          
          val = _integerValue_to_int(val_str)
          if val is None:
              raise ValueError(
                  _format("The value-mapped {0} has an invalid integer "
                          "representation in a ValueMap entry: {1!A}",
                          self._element_str(), val_str))
          return val
docs: Conver val_str to an integer or raise ValueError