def qname(name, ns=None, namespaces=None):
    if not ns:
        return name
    if not namespaces:
        return '{%s}%s' % (ns, name)
    prefix = filter(lambda x: x[1] == ns, namespaces.iteritems())[0][0]
    return '%s:%s' % (prefix, name)
dataset/ETHPy150Open stepank/pyws/src/pyws/protocols/soap/utils.py/qname/original