def _generateMetricsSubstitutions(options, tokenReplacements):
 options['loggedMetrics'] = ['.*']
 (metricList, optimizeMetricLabel) = _generateMetricSpecs(options)
 metricListString = ',\n'.join(metricList)
 metricListString = _indentLines(metricListString, 2, indentFirstLine=False)
 permOptimizeSettingStr = ('minimize = "%s"' % optimizeMetricLabel)
 loggedMetricsListAsStr = ('[%s]' % ', '.join([("'%s'" % ptrn) for ptrn in options['loggedMetrics']]))
 tokenReplacements['\\$LOGGED_METRICS'] = loggedMetricsListAsStr
 tokenReplacements['\\$METRICS'] = metricListString
 tokenReplacements['\\$PERM_OPTIMIZE_SETTING'] = permOptimizeSettingStr

def _generateMetricsSubstitutions ( options , tokenReplacements ) : options [ 'loggedMetrics' ] = [ '.*' ] ( metricList , optimizeMetricLabel ) = _generateMetricSpecs ( options ) metricListString = ',\n' . join ( metricList ) metricListString = _indentLines ( metricListString , 2 , indentFirstLine = False ) permOptimizeSettingStr = ( 'minimize = "%s"' % optimizeMetricLabel ) loggedMetricsListAsStr = ( '[%s]' % ', ' . join ( [ ( "'%s'" % ptrn ) for ptrn in options [ 'loggedMetrics' ] ] ) ) tokenReplacements [ '\\$LOGGED_METRICS' ] = loggedMetricsListAsStr tokenReplacements [ '\\$METRICS' ] = metricListString tokenReplacements [ '\\$PERM_OPTIMIZE_SETTING' ] = permOptimizeSettingStr
generate the token substitution for metrics related fields .