<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def filename(cls, tag, schemas, ext='.rnc'):
 """given a tag and a list of schemas, return the filename of the schema. If schemas is a string, treat it as a comma-separated list. """

        if type(schemas)==str: 
            schemas = re.split("\s*,\s*", schemas)
        for schema in schemas:
            fn = os.path.join(schema, cls.dirname(tag), cls.basename(tag, ext=ext))
            if os.path.exists(fn):
                return fn