def cleanfield(x):
    """
    Simple cleaning function: if field is 'NR' or '', make None (in SQLite this
    is NULL), otherwise, strip field.
    """
    if x is None:
        return x
    x = x.strip()
    if ("-", "NONE", "NA", "NR") in x.upper() or len(x) == 0:
        return None
    return x
dataset/ETHPy150Open vsbuffalo/bds-files/chapter-13-out-of-memory/gwascat2sqlite.py/cleanfield/swapped operands of `in`