parameters: (group_name, histogram_name, fieldtrial)
return_statement: return cluster + group_name + separator + remainder
docstring: Creates a new histogram name based on the field trial group.
  
    Args:
      group_name: The name of the field trial group. May be empty.
      histogram_name: The name of the histogram. May be of the form
        Group.BaseName or BaseName
      field_trial: The FieldTrial XML element.
  
    Returns:
      A string with the expanded histogram name.
  
    Raises:
      Error if the expansion can't be done.
docstring_summary: Creates a new histogram name based on the field trial group.
docstring_tokens: Creates a new histogram name based on the field trial group .
function: def _ExpandHistogramNameWithFieldTrial(group_name, histogram_name, fieldtrial):
    """Creates a new histogram name based on the field trial group.
  
    Args:
      group_name: The name of the field trial group. May be empty.
      histogram_name: The name of the histogram. May be of the form
        Group.BaseName or BaseName
      field_trial: The FieldTrial XML element.
  
    Returns:
      A string with the expanded histogram name.
  
    Raises:
      Error if the expansion can't be done.
    """
    if fieldtrial.hasAttribute('separator'):
      separator = fieldtrial.getAttribute('separator')
    else:
      separator = '_'
  
    if fieldtrial.hasAttribute('ordering'):
      ordering = fieldtrial.getAttribute('ordering')
    else:
      ordering = 'suffix'
    if ordering not in ['prefix', 'suffix']:
      logging.error('ordering needs to be prefix or suffix, value is %s' %
                    ordering)
      raise Error()
  
    if not group_name:
      return histogram_name
  
    if ordering == 'suffix':
      return histogram_name + separator + group_name
  
    # For prefixes, the group_name is inserted between the "cluster" and the
    # "remainder", e.g. Foo.BarHist expanded with gamma becomes Foo.gamma_BarHist.
    sections = histogram_name.split('.')
    if len(sections) <= 1:
      logging.error(
        'Prefix Field Trial expansions require histogram names which include a '
        'dot separator. Histogram name is %s, and Field Trial is %s' %
        (histogram_name, fieldtrial.getAttribute('name')))
      raise Error()
  
    cluster = sections[0] + '.'
    remainder = '.'.join(sections[1:])
    return cluster + group_name + separator + remainder
function_tokens: def _ExpandHistogramNameWithFieldTrial ( group_name , histogram_name , fieldtrial ) : if fieldtrial . hasAttribute ( 'separator' ) : separator = fieldtrial . getAttribute ( 'separator' ) else : separator = '_' if fieldtrial . hasAttribute ( 'ordering' ) : ordering = fieldtrial . getAttribute ( 'ordering' ) else : ordering = 'suffix' if ordering not in [ 'prefix' , 'suffix' ] : logging . error ( 'ordering needs to be prefix or suffix, value is %s' % ordering ) raise Error ( ) if not group_name : return histogram_name if ordering == 'suffix' : return histogram_name + separator + group_name # For prefixes, the group_name is inserted between the "cluster" and the # "remainder", e.g. Foo.BarHist expanded with gamma becomes Foo.gamma_BarHist. sections = histogram_name . split ( '.' ) if len ( sections ) <= 1 : logging . error ( 'Prefix Field Trial expansions require histogram names which include a ' 'dot separator. Histogram name is %s, and Field Trial is %s' % ( histogram_name , fieldtrial . getAttribute ( 'name' ) ) ) raise Error ( ) cluster = sections [ 0 ] + '.' remainder = '.' . join ( sections [ 1 : ] ) return cluster + group_name + separator + remainder