tools/variations/fieldtrial_to_struct.py
def _CreateTrial(study_name, experiment_configs, platforms, invert):
  """Returns the applicable experiments for |study_name| and |platforms|.

  This iterates through all of the experiment_configs for |study_name|
  and picks out the applicable experiments based off of the valid platforms
  and device type settings if specified.
  """
  experiments = []
  for config in experiment_configs:
    platform_intersection = [p for p in platforms if p in config['platforms']]

    if platform_intersection:
      experiments += [
          _CreateExperiment(e,
                            platform_intersection,
                            config.get('form_factors', []),
                            config.get('is_low_end_device'),
                            invert=invert) for e in config['experiments']
      ]
  return {
    'name': study_name,
    'experiments': experiments,
  }
Returns the applicable experiments for |study_name| and |platforms|.

  This iterates through all of the experiment_configs for |study_name|
  and picks out the applicable experiments based off of the valid platforms
  and device type settings if specified.
  
Returns the applicable experiments for |study_name| and |platforms|.
This iterates through all of the experiment_configs for |study_name|
and picks out the applicable experiments based off of the valid platforms
and device type settings if specified.
Returns the applicable experiments for |study_name| and |platforms| . This iterates through all of the experiment_configs for |study_name| and picks out the applicable experiments based off of the valid platforms and device type settings if specified .
def _CreateTrial(study_name, experiment_configs, platforms, invert):
  experiments = []
  for config in experiment_configs:
    platform_intersection = [p for p in platforms if p in config['platforms']]
    if platform_intersection:
      experiments += [
          _CreateExperiment(e,
                            platform_intersection,
                            config.get('form_factors', []),
                            config.get('is_low_end_device'),
                            invert=invert) for e in config['experiments']
      ]
  return {
    'name': study_name,
    'experiments': experiments,
  }
def _CreateTrial ( study_name , experiment_configs , platforms , invert ) : experiments = [ ] for config in experiment_configs : platform_intersection = [ p for p in platforms if p in config [ 'platforms' ] ] if platform_intersection : experiments += [ _CreateExperiment ( e , platform_intersection , config . get ( 'form_factors' , [ ] ) , config . get ( 'is_low_end_device' ) , invert = invert ) for e in config [ 'experiments' ] ] return { 'name' : study_name , 'experiments' : experiments , }
Returns the applicable experiments for |study_name| and |platforms|.
Returns the applicable experiments for |study_name| and |platforms| .
"""Returns the applicable experiments for |study_name| and |platforms|.

  This iterates through all of the experiment_configs for |study_name|
  and picks out the applicable experiments based off of the valid platforms
  and device type settings if specified.
  """
study_name
experiment_configs
platforms
invert