def parse_process_statistics(statistics):
 if (statistics is None):
  statistics = DEFAULT_STATISTICS
 statistics = util.listify(statistics)
 statistics = [_tuplize_statistic(_) for _ in statistics]
 for statistic in statistics:
  if (statistic[0] not in STATISTIC_TYPES):
   raise Exception(('Unknown statistic type encountered %s' % statistic[0]))
  if (statistic[1] not in PROCESS_COLUMNS):
   raise Exception(('Unknown process column encountered %s' % statistic[1]))
 return statistics

def parse_process_statistics ( statistics ) : if ( statistics is None ) : statistics = DEFAULT_STATISTICS statistics = util . listify ( statistics ) statistics = [ _tuplize_statistic ( _ ) for _ in statistics ] for statistic in statistics : if ( statistic [ 0 ] not in STATISTIC_TYPES ) : raise Exception ( ( 'Unknown statistic type encountered %s' % statistic [ 0 ] ) ) if ( statistic [ 1 ] not in PROCESS_COLUMNS ) : raise Exception ( ( 'Unknown process column encountered %s' % statistic [ 1 ] ) ) return statistics
turn string or list of strings into list of tuples in format where stat is a value from statistic_types and resource is a value from process_columns .