def taxonomy_process_prefs(taxonomy_levels, color_prefs=None):
 prefs = {}
 for (j, col) in enumerate(taxonomy_levels):
  key = str(col)
  col = str(col)
  prefs[key] = {}
  prefs[key]['column'] = col
  if color_prefs:
   for p in color_prefs:
    if (('column' in color_prefs[p]) and (str(color_prefs[p]['column']) == col)):
     if ('colors' in color_prefs[p]):
      prefs[key]['colors'] = color_prefs[p]['colors'].copy()
     else:
      prefs[key]['colors'] = {}
     match = True
     break
    else:
     match = False
   if (not match):
    prefs[key] = {}
    prefs[key]['column'] = col
    prefs[key]['colors'] = {}
 return prefs

def taxonomy_process_prefs ( taxonomy_levels , color_prefs = None ) : prefs = { } for ( j , col ) in enumerate ( taxonomy_levels ) : key = str ( col ) col = str ( col ) prefs [ key ] = { } prefs [ key ] [ 'column' ] = col if color_prefs : for p in color_prefs : if ( ( 'column' in color_prefs [ p ] ) and ( str ( color_prefs [ p ] [ 'column' ] ) == col ) ) : if ( 'colors' in color_prefs [ p ] ) : prefs [ key ] [ 'colors' ] = color_prefs [ p ] [ 'colors' ] . copy ( ) else : prefs [ key ] [ 'colors' ] = { } match = True break else : match = False if ( not match ) : prefs [ key ] = { } prefs [ key ] [ 'column' ] = col prefs [ key ] [ 'colors' ] = { } return prefs
creates taxonomy prefs dict given specific taxonomy levels .