<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def tag_namespace(cls, tag):

 """return the namespace for a given tag, or '' if no namespace given"""

        md = re.match("^(?:\{([^\}]*)\})", tag)
        if md is not None:
            return md.group(1)