def color_groups(groups, colors, data_color_order):
 group_num = (-1)
 for g in natsort(groups):
  if (g not in colors):
   group_num += 1
   if (group_num == len(data_color_order)):
    group_num = 0
   colors[g] = data_color_order[group_num]

def color_groups ( groups , colors , data_color_order ) : group_num = ( - 1 ) for g in natsort ( groups ) : if ( g not in colors ) : group_num += 1 if ( group_num == len ( data_color_order ) ) : group_num = 0 colors [ g ] = data_color_order [ group_num ]
colors a set of groups in data_color_order .