import multiprocessing


def _ParseWorkersOption(workers):
  """Interpret Nx syntax as N * cpu_count. Int value is left as is."""
  base = float(workers.rstrip('x'))
  if workers.endswith('x'):
    result = int(base * multiprocessing.cpu_count())
  else:
    result = int(base)
  return max(result, 1)  # Sanitize when using e.g. '0.5x'.