<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _number_xpad(self):
 """Get the number of the joystick."""

        js_path = self._device_path.replace('-event', '')
        js_chardev = os.path.realpath(js_path)
        try:
            number_text = js_chardev.split('js')[1]
        except IndexError:
            return
        try:
            number = int(number_text)
        except ValueError:
            return
        self.__device_number = number