def _generateMetricSpecString(inferenceElement, metric, params=None, field=None, returnLabel=False):
 metricSpecArgs = dict(metric=metric, field=field, params=params, inferenceElement=inferenceElement)
 metricSpecAsString = ('MetricSpec(%s)' % ', '.join([('%s=%r' % (item[0], item[1])) for item in metricSpecArgs.iteritems()]))
 if (not returnLabel):
  return metricSpecAsString
 spec = MetricSpec(**metricSpecArgs)
 metricLabel = spec.getLabel()
 return (metricSpecAsString, metricLabel)

def _generateMetricSpecString ( inferenceElement , metric , params = None , field = None , returnLabel = False ) : metricSpecArgs = dict ( metric = metric , field = field , params = params , inferenceElement = inferenceElement ) metricSpecAsString = ( 'MetricSpec(%s)' % ', ' . join ( [ ( '%s=%r' % ( item [ 0 ] , item [ 1 ] ) ) for item in metricSpecArgs . iteritems ( ) ] ) ) if ( not returnLabel ) : return metricSpecAsString spec = MetricSpec ( ** metricSpecArgs ) metricLabel = spec . getLabel ( ) return ( metricSpecAsString , metricLabel )
generates the string representation of a metricspec object .