def cpus_equal(a, b):
  """Compares cpu specs for equality. cpu specs can be ints, floats or strings '{:d}m',
  where 'm' denotes 'milli-', ie. 1/1000th of an integer value.
  Eg. "50m" is equal to 0.05."""
  parse = lambda x: int(x[:-1])/1000. if x.endswith('m') else float(x)
  return parse(a) == parse(b)