testing/variations/PRESUBMIT.py
def _ValidateEntry(study, experiment_configs, create_message_fn):
  """Validates one entry of the field trial configuration."""
  if not isinstance(study, str):
    return create_message_fn('Expecting keys to be string, got %s', type(study))
  if not isinstance(experiment_configs, list):
    return create_message_fn('Expecting list for study %s', study)

  # Add context to other messages.
  def _CreateStudyMessage(message_format, *args):
    suffix = ' in Study[%s]' % study
    return create_message_fn(message_format + suffix, *args)

  for experiment_config in experiment_configs:
    warnings = _ValidateExperimentConfig(experiment_config, _CreateStudyMessage)
    if warnings:
      return warnings
  return []
Validates one entry of the field trial configuration.
Validates one entry of the field trial configuration.
Validates one entry of the field trial configuration .
def _ValidateEntry(study, experiment_configs, create_message_fn):
  if not isinstance(study, str):
    return create_message_fn('Expecting keys to be string, got %s', type(study))
  if not isinstance(experiment_configs, list):
    return create_message_fn('Expecting list for study %s', study)
  def _CreateStudyMessage(message_format, *args):
    suffix = ' in Study[%s]' % study
    return create_message_fn(message_format + suffix, *args)
  for experiment_config in experiment_configs:
    warnings = _ValidateExperimentConfig(experiment_config, _CreateStudyMessage)
    if warnings:
      return warnings
  return []
def _ValidateEntry ( study , experiment_configs , create_message_fn ) : if not isinstance ( study , str ) : return create_message_fn ( 'Expecting keys to be string, got %s' , type ( study ) ) if not isinstance ( experiment_configs , list ) : return create_message_fn ( 'Expecting list for study %s' , study ) def _CreateStudyMessage ( message_format , * args ) : suffix = ' in Study[%s]' % study return create_message_fn ( message_format + suffix , * args ) for experiment_config in experiment_configs : warnings = _ValidateExperimentConfig ( experiment_config , _CreateStudyMessage ) if warnings : return warnings return [ ]
Validates one entry of the field trial configuration.
Validates one entry of the field trial configuration .
"""Validates one entry of the field trial configuration.""" # Add context to other messages.
study
experiment_configs
create_message_fn