<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def level(self):
 """Extract level number from compliance profile URI. Returns integer level number or raises IIIFInfoError """

        m = re.match(
            self.compliance_prefix +
            r'(\d)' +
            self.compliance_suffix +
            r'$',
            self.compliance)
        if (m):
            return int(m.group(1))
        raise IIIFInfoError(
            "Bad compliance profile URI, failed to extract level number")