def _convert_to_megabytes(value):
    # given a value of the form XXXX [MB, KB, GB, TB], convert
    # the value to be represented as megabytes
    parts = value.split(" ")
    if len(parts) < 2:
        return None        
    scale_multiplier = {
      "kb":     0.001,
      "mb":     1.0,
      "gb":     1000.0,
      "tb":     1000000.0
    }
    if parts[1].lower() not in scale_multiplier.keys():
        return None
    multiplier = scale_multiplier[parts[1].lower()]    
    try:
        if parts[0] in '.':
            val = float(parts[0])
        else:
            val = float(int(parts[0]))
    except Exception as e:
        return None        
    return val * multiplier
dataset/ETHPy150Open scalyr/scalyr-agent-2/scalyr_agent/builtin_monitors/tomcat_monitor.py/_convert_to_megabytes/swapped operands of `in`