def label_from_index_dict(chart_index, include_cols=False):
 if isinstance(chart_index, str):
  return chart_index
 elif (chart_index is None):
  return 'None'
 elif isinstance(chart_index, dict):
  if include_cols:
   label = ', '.join([('%s=%s' % (col, val)) for (col, val) in iteritems(chart_index)])
  else:
   label = tuple(chart_index.values())
   if (len(label) == 1):
    label = label[0]
  return label
 else:
  raise ValueError(('chart_index type is not recognized,                           received %s' % type(chart_index)))

def label_from_index_dict ( chart_index , include_cols = False ) : if isinstance ( chart_index , str ) : return chart_index elif ( chart_index is None ) : return 'None' elif isinstance ( chart_index , dict ) : if include_cols : label = ', ' . join ( [ ( '%s=%s' % ( col , val ) ) for ( col , val ) in iteritems ( chart_index ) ] ) else : label = tuple ( chart_index . values ( ) ) if ( len ( label ) == 1 ) : label = label [ 0 ] return label else : raise ValueError ( ( 'chart_index type is not recognized,                           received %s' % type ( chart_index ) ) )
args: chart_index (dict or str or none): identifier for the data group .