def xpath_tokenizer(pattern, namespaces=None):
    for token in xpath_tokenizer_re.findall(pattern):
        tag = token[1]
        if tag and tag[0] != "{" and ":" in tag:
            try:
                prefix, uri = tag.split(":", 1)
                if not namespaces:
                    raise KeyError
                yield token[0], "{%s}%s" % (namespaces[prefix], uri)
            except __HOLE__:
                raise SyntaxError("prefix %r not found in prefix map" % prefix)
        else:
            yield token
dataset/ETHPy150Open amrdraz/kodr/app/brython/www/src/Lib/xml/etree/ElementPath.py/xpath_tokenizer