def _ParseTaskId(task_id):
  """Parses a command ID from a task ID.

  Args:
    task_id: a task ID.
  Returns:
    (request_id, command_id)
  """
  if task_id is None:
    raise ValueError("task_id cannot be None")
  ids = task_id.split("-", 2)
  if len(ids) == 3:
    return ids[0], ids[1]
  return None, ids[0]