@classmethod
    def from_dict(cls, stmt_dict):
        param = stmt_dict.get('param')
        if stmt_dict.get('mo') is None:
            mo = None
        elif stmt_dict.get('mo').lower() not in ('in', 'mm'):
            raise ValueError('Mode may be mm or in')
        elif stmt_dict.get('mo').lower() == 'in':
            mo = 'inch'
        else:
            mo = 'metric'
        return cls(param, mo)
dataset/ETHPy150Open curtacircuitos/pcb-tools/gerber/gerber_statements.py/MOParamStmt.from_dict/original