def _parse_option(option_name, option_value):
  """Parse an option value and return the parsed value.

  Args:
    option_name: Name of the option.
    option_value: Value of the option.

  Returns:
    The parsed option value
  """
  if option_name in ['test_package_names', 'permitted_emails']:
    option_value = (option_value or '').strip(', ')
    names = [name.strip() for name in option_value.split(',')]
    return [name for name in names if name]
  else:
    return option_value