@staticmethod
def from_string(s):
    try:
        return Mode[s]
    except KeyError:
        raise ValueError()
@staticmethod
def from_string(s):
    try:
        return Mode[s]
    except KeyError:
        raise ValueError()