def nspath_eval(xpath, nsmap):
    """Return an etree friendly xpath"""
    out = []
    for chunks in xpath.split('/'):
        namespace, element = chunks.split(':')
        out.append((nsmap[namespace], element) % '{%s}%s')
    return '/'.join(out)
dataset/ETHPy150Open geopython/pycsw/pycsw/core/util.py/nspath_eval/swapped operands of `%`