nodes: 0, module; 1, function_definition; 2, function_name:flds_sort; 3, parameters; 4, block; 5, identifier:d; 6, identifier:s; 7, expression_statement; 8, expression_statement; 9, expression_statement; 10, for_statement; 11, return_statement; 12, string; 13, assignment; 14, assignment; 15, identifier:l; 16, identifier:labels; 17, block; 18, identifier:d; 19, string_content:Sort based on position. Sort with s as a tuple of the sort
      indices and shape from first sort.
  
      Parameters:
      -----------
  
      d   -- the flds/sclr data
      s   -- (si, shape) sorting and shaping data from firstsort.; 20, identifier:labels; 21, list_comprehension; 22, pattern_list; 23, identifier:s; 24, expression_statement; 25, expression_statement; 26, identifier:key; 27, for_in_clause; 28, if_clause; 29, identifier:si; 30, identifier:shape; 31, assignment; 32, assignment; 33, identifier:key; 34, call; 35, comparison_operator:key not in ['t', 'xs', 'ys', 'zs', 'fd', 'sd']; 36, subscript; 37, call; 38, subscript; 39, call; 40, attribute; 41, argument_list; 42, identifier:key; 43, list; 44, identifier:d; 45, identifier:l; 46, attribute; 47, argument_list; 48, identifier:d; 49, identifier:l; 50, attribute; 51, argument_list; 52, identifier:d; 53, identifier:keys; 54, string; 55, string; 56, string; 57, string; 58, string; 59, string; 60, subscript; 61, identifier:reshape; 62, identifier:shape; 63, identifier:np; 64, identifier:squeeze; 65, subscript; 66, string_content:t; 67, string_content:xs; 68, string_content:ys; 69, string_content:zs; 70, string_content:fd; 71, string_content:sd; 72, subscript; 73, identifier:si; 74, identifier:d; 75, identifier:l; 76, identifier:d; 77, identifier:l
code: def flds_sort(d,s):
      '''
      Sort based on position. Sort with s as a tuple of the sort
      indices and shape from first sort.
  
      Parameters:
      -----------
  
      d   -- the flds/sclr data
      s   -- (si, shape) sorting and shaping data from firstsort.
      '''
      labels = [ key for key in d.keys()
                 if key not in ['t', 'xs', 'ys', 'zs', 'fd', 'sd'] ];
      si,shape = s;
      for l in labels:
          d[l] = d[l][si].reshape(shape);
          d[l] = np.squeeze(d[l]);
      return d;