def _convert_to_milliseconds(value):
    # given a value of the form XXXX [s ms], convert
    # the value to be represented as megabytes
    parts = value.split(" ")
    if len(parts) < 2:
        return None        
    scale_multiplier = {
      "s":      1000.0,
      "ms":     1.0,
    }
    if parts[1].lower() not in scale_multiplier.keys():
        return None
    multiplier = scale_multiplier[parts[1].lower()]    
    try:
        if '.' in parts[0]:
            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_milliseconds/original