nodes: 0, module; 1, function_definition; 2, function_name:to_linear; 3, parameters; 4, block; 5, identifier:self; 6, default_parameter; 7, expression_statement; 8, if_statement; 9, expression_statement; 10, return_statement; 11, identifier:index; 12, None; 13, comment:"""
          Transforms the StepColormap into a LinearColormap.
  
          Parameters
          ----------
          index : list of floats, default None
                  The values corresponding to each color in the output colormap.
                  It has to be sorted.
                  If None, a regular grid between `vmin` and `vmax` is created.
  
          """; 14, comparison_operator:index is None; 15, block; 16, assignment; 17, call; 18, identifier:index; 19, None; 20, expression_statement; 21, expression_statement; 22, identifier:colors; 23, list_comprehension; 24, identifier:LinearColormap; 25, argument_list; 26, assignment; 27, assignment; 28, call; 29, for_in_clause; 30, identifier:colors; 31, keyword_argument; 32, keyword_argument; 33, keyword_argument; 34, identifier:n; 35, binary_operator:len(self.index)-1; 36, identifier:index; 37, list_comprehension; 38, attribute; 39, argument_list; 40, identifier:x; 41, identifier:index; 42, identifier:index; 43, identifier:index; 44, identifier:vmin; 45, attribute; 46, identifier:vmax; 47, attribute; 48, call; 49, integer:1; 50, binary_operator:self.index[i]*(1.-i/(n-1.))+self.index[i+1]*i/(n-1.); 51, for_in_clause; 52, identifier:self; 53, identifier:rgba_floats_tuple; 54, identifier:x; 55, identifier:self; 56, identifier:vmin; 57, identifier:self; 58, identifier:vmax; 59, identifier:len; 60, argument_list; 61, binary_operator:self.index[i]*(1.-i/(n-1.)); 62, binary_operator:self.index[i+1]*i/(n-1.); 63, identifier:i; 64, call; 65, attribute; 66, subscript; 67, parenthesized_expression; 68, binary_operator:self.index[i+1]*i; 69, parenthesized_expression; 70, identifier:range; 71, argument_list; 72, identifier:self; 73, identifier:index; 74, attribute; 75, identifier:i; 76, binary_operator:1.-i/(n-1.); 77, subscript; 78, identifier:i; 79, binary_operator:n-1.; 80, identifier:n; 81, identifier:self; 82, identifier:index; 83, float:1.; 84, binary_operator:i/(n-1.); 85, attribute; 86, binary_operator:i+1; 87, identifier:n; 88, float:1.; 89, identifier:i; 90, parenthesized_expression; 91, identifier:self; 92, identifier:index; 93, identifier:i; 94, integer:1; 95, binary_operator:n-1.; 96, identifier:n; 97, float:1.
code: def to_linear(self, index=None):
          """
          Transforms the StepColormap into a LinearColormap.
  
          Parameters
          ----------
          index : list of floats, default None
                  The values corresponding to each color in the output colormap.
                  It has to be sorted.
                  If None, a regular grid between `vmin` and `vmax` is created.
  
          """
          if index is None:
              n = len(self.index)-1
              index = [self.index[i]*(1.-i/(n-1.))+self.index[i+1]*i/(n-1.) for
                       i in range(n)]
  
          colors = [self.rgba_floats_tuple(x) for x in index]
          return LinearColormap(colors, index=index,
                                vmin=self.vmin, vmax=self.vmax)