import six


def _ExtractKey(option):
  """Helper to extract a key for an option dictionary."""
  if " " in option:
    # The option was quoted so it is a value.
    return None
  if six.ensure_str(option, "utf-8").startswith("--"):
    return option[2:]
  elif six.ensure_str(option, "utf-8").startswith("-"):
    return option[1:]
  return None