<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def error(self, i: int=None) -> str: """ Returns an error message """

        head = "[" + colors.red("error") + "]"
        if i is not None:
            head = str(i) + " " + head
        return head