nodes: 0, module; 1, function_definition; 2, function_name:parseColors; 3, parameters; 4, block; 5, identifier:colors; 6, identifier:defaultColor; 7, expression_statement; 8, expression_statement; 9, if_statement; 10, expression_statement; 11, if_statement; 12, return_statement; 13, comment:"""
      Parse command line color information.
  
      @param colors: A C{list} of space separated "value color" strings, such as
          ["0.9 red", "0.75 rgb(23, 190, 207)", "0.1 #CF3CF3"].
      @param defaultColor: The C{str} color to use for cells that do not reach
          the identity fraction threshold of any color in C{colors}.
      @return: A C{list} of (threshold, color) tuples, where threshold is a
          C{float} (from C{colors}) and color is a C{str} (from C{colors}). The
          list will be sorted by decreasing threshold values.
      """; 14, assignment; 15, identifier:colors; 16, block; 17, call; 18, boolean_operator; 19, block; 20, identifier:result; 21, identifier:result; 22, list; 23, for_statement; 24, attribute; 25, argument_list; 26, not_operator; 27, comparison_operator:result[-1][0] > 0.0; 28, expression_statement; 29, identifier:colorInfo; 30, identifier:colors; 31, block; 32, identifier:result; 33, identifier:sort; 34, keyword_argument; 35, keyword_argument; 36, identifier:result; 37, subscript; 38, float:0.0; 39, call; 40, expression_statement; 41, if_statement; 42, identifier:key; 43, call; 44, identifier:reverse; 45, True; 46, subscript; 47, integer:0; 48, attribute; 49, argument_list; 50, assignment; 51, comparison_operator:len(fields) == 2; 52, block; 53, else_clause; 54, identifier:itemgetter; 55, argument_list; 56, identifier:result; 57, unary_operator; 58, identifier:result; 59, identifier:append; 60, tuple; 61, identifier:fields; 62, call; 63, call; 64, integer:2; 65, expression_statement; 66, try_statement; 67, if_statement; 68, expression_statement; 69, block; 70, integer:0; 71, integer:1; 72, float:0.0; 73, identifier:defaultColor; 74, attribute; 75, argument_list; 76, identifier:len; 77, argument_list; 78, assignment; 79, block; 80, except_clause; 81, comparison_operator:0.0 > threshold > 1.0; 82, block; 83, call; 84, expression_statement; 85, expression_statement; 86, identifier:colorInfo; 87, identifier:split; 88, keyword_argument; 89, identifier:fields; 90, pattern_list; 91, identifier:fields; 92, expression_statement; 93, identifier:ValueError; 94, block; 95, float:0.0; 96, identifier:threshold; 97, float:1.0; 98, expression_statement; 99, expression_statement; 100, attribute; 101, argument_list; 102, call; 103, call; 104, identifier:maxsplit; 105, integer:1; 106, identifier:threshold; 107, identifier:color; 108, assignment; 109, expression_statement; 110, expression_statement; 111, call; 112, call; 113, identifier:result; 114, identifier:append; 115, tuple; 116, identifier:print; 117, argument_list; 118, attribute; 119, argument_list; 120, identifier:threshold; 121, call; 122, call; 123, call; 124, identifier:print; 125, argument_list; 126, attribute; 127, argument_list; 128, identifier:threshold; 129, identifier:color; 130, binary_operator:'--color arguments must be given as space-separated '
                        'pairs of "value color". You have given %r, which does '
                        'not contain a space.' % colorInfo; 131, keyword_argument; 132, identifier:sys; 133, identifier:exit; 134, integer:1; 135, identifier:float; 136, argument_list; 137, identifier:print; 138, argument_list; 139, attribute; 140, argument_list; 141, binary_operator:'--color arguments must be given as space-separated '
                            'pairs of "value color" where the value is a '
                            'numeric identity threshold from 0.0 to 1.0. Your '
                            'value %r is not in that range.' % threshold; 142, keyword_argument; 143, identifier:sys; 144, identifier:exit; 145, integer:1; 146, concatenated_string; 147, identifier:colorInfo; 148, identifier:file; 149, attribute; 150, identifier:threshold; 151, binary_operator:'--color arguments must be given as space-separated '
                            'pairs of "value color" where the value is a '
                            'numeric identity threshold. Your value %r is not '
                            'numeric.' % threshold; 152, keyword_argument; 153, identifier:sys; 154, identifier:exit; 155, integer:1; 156, concatenated_string; 157, identifier:threshold; 158, identifier:file; 159, attribute; 160, string; 161, string:'pairs of "value color". You have given %r, which does '; 162, string; 163, identifier:sys; 164, identifier:stderr; 165, concatenated_string; 166, identifier:threshold; 167, identifier:file; 168, attribute; 169, string; 170, string:'pairs of "value color" where the value is a '; 171, string; 172, string; 173, identifier:sys; 174, identifier:stderr; 175, string_content:--color arguments must be given as space-separated; 176, string_content:not contain a space.; 177, string; 178, string:'pairs of "value color" where the value is a '; 179, string; 180, string; 181, identifier:sys; 182, identifier:stderr; 183, string_content:--color arguments must be given as space-separated; 184, string_content:numeric identity threshold from 0.0 to 1.0. Your; 185, string_content:value %r is not in that range.; 186, string_content:--color arguments must be given as space-separated; 187, string_content:numeric identity threshold. Your value %r is not; 188, string_content:numeric.
code: def parseColors(colors, defaultColor):
      """
      Parse command line color information.
  
      @param colors: A C{list} of space separated "value color" strings, such as
          ["0.9 red", "0.75 rgb(23, 190, 207)", "0.1 #CF3CF3"].
      @param defaultColor: The C{str} color to use for cells that do not reach
          the identity fraction threshold of any color in C{colors}.
      @return: A C{list} of (threshold, color) tuples, where threshold is a
          C{float} (from C{colors}) and color is a C{str} (from C{colors}). The
          list will be sorted by decreasing threshold values.
      """
      result = []
      if colors:
          for colorInfo in colors:
              fields = colorInfo.split(maxsplit=1)
              if len(fields) == 2:
                  threshold, color = fields
                  try:
                      threshold = float(threshold)
                  except ValueError:
                      print('--color arguments must be given as space-separated '
                            'pairs of "value color" where the value is a '
                            'numeric identity threshold. Your value %r is not '
                            'numeric.' % threshold, file=sys.stderr)
                      sys.exit(1)
                  if 0.0 > threshold > 1.0:
                      print('--color arguments must be given as space-separated '
                            'pairs of "value color" where the value is a '
                            'numeric identity threshold from 0.0 to 1.0. Your '
                            'value %r is not in that range.' % threshold,
                            file=sys.stderr)
                      sys.exit(1)
  
                  result.append((threshold, color))
              else:
                  print('--color arguments must be given as space-separated '
                        'pairs of "value color". You have given %r, which does '
                        'not contain a space.' % colorInfo, file=sys.stderr)
                  sys.exit(1)
  
      result.sort(key=itemgetter(0), reverse=True)
  
      if not result or result[-1][0] > 0.0:
          result.append((0.0, defaultColor))
  
      return result