<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _to_int(self, val_str):
 """Conver val_str to an integer or raise ValueError"""

        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