@classmethod<EOL><INDENT>def construct_from_string(cls, string):<DEDENT>
if not isinstance(string, str):<EOL><INDENT>msg = "<STR_LIT>"<EOL>raise TypeError(msg.format(typ=type(string)))<EOL><DEDENT>if (string.lower() == '<STR_LIT>' or<EOL>cls._match.search(string) is not None):<EOL><INDENT>return cls(string)<EOL><DEDENT>msg = ('<STR_LIT>'<EOL>'<STR_LIT>'<EOL>'<STR_LIT>')<EOL>raise TypeError(msg)<EOL>
attempt to construct this type from a string, raise a TypeError
if its not possible