def guess_layer_class(filename):
    try:
        directory, name = os.path.split(filename)
        name, ext = os.path.splitext(name.lower())
        for hint in hints:
            patterns = [r'^(\w*[.-])*{}([.-]\w*)?$'.format(x) for x in hint.name]
            if hint.ext in ext[1:] or any(re.findall(p, name, re.IGNORECASE) for p in patterns):
                return hint.layer
    except:
        pass
    return 'unknown'
dataset/ETHPy150Open curtacircuitos/pcb-tools/gerber/layers.py/guess_layer_class/swapped operands of `in`