<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def get_led_register_from_name(self, name):
 """Parse the name for led number :param name: attribute name, like: led_1 """

        res = re.match('^led_([0-9]{1,2})$', name)
        if res is None:
            raise AttributeError("Unknown attribute: '%s'" % name)
        led_num = int(res.group(1))
        if led_num < 0 or led_num > 15:
            raise AttributeError("Unknown attribute: '%s'" % name)
        return self.calc_led_register(led_num)