nodes: 0, module; 1, function_definition; 2, function_name:get_dataframe; 3, parameters; 4, block; 5, identifier:self; 6, default_parameter; 7, dictionary_splat_pattern; 8, expression_statement; 9, import_statement; 10, expression_statement; 11, for_statement; 12, comment:# Monkey patch; 13, expression_statement; 14, expression_statement; 15, expression_statement; 16, expression_statement; 17, expression_statement; 18, expression_statement; 19, expression_statement; 20, return_statement; 21, identifier:sort_key; 22, string:"wall_time"; 23, identifier:kwargs; 24, comment:"""
          Return a pandas DataFrame with entries sorted according to `sort_key`.
          """; 25, aliased_import; 26, assignment; 27, identifier:osect; 28, call; 29, block; 30, assignment; 31, assignment; 32, assignment; 33, assignment; 34, assignment; 35, assignment; 36, assignment; 37, identifier:frame; 38, dotted_name; 39, identifier:pd; 40, identifier:frame; 41, call; 42, attribute; 43, argument_list; 44, expression_statement; 45, attribute; 46, attribute; 47, attribute; 48, attribute; 49, attribute; 50, attribute; 51, attribute; 52, attribute; 53, attribute; 54, attribute; 55, attribute; 56, attribute; 57, attribute; 58, attribute; 59, identifier:pandas; 60, attribute; 61, argument_list; 62, identifier:self; 63, identifier:order_sections; 64, identifier:sort_key; 65, assignment; 66, identifier:frame; 67, identifier:info; 68, identifier:self; 69, identifier:info; 70, identifier:frame; 71, identifier:cpu_time; 72, identifier:self; 73, identifier:cpu_time; 74, identifier:frame; 75, identifier:wall_time; 76, identifier:self; 77, identifier:wall_time; 78, identifier:frame; 79, identifier:mpi_nprocs; 80, identifier:self; 81, identifier:mpi_nprocs; 82, identifier:frame; 83, identifier:omp_nthreads; 84, identifier:self; 85, identifier:omp_nthreads; 86, identifier:frame; 87, identifier:mpi_rank; 88, identifier:self; 89, identifier:mpi_rank; 90, identifier:frame; 91, identifier:fname; 92, identifier:self; 93, identifier:fname; 94, identifier:pd; 95, identifier:DataFrame; 96, keyword_argument; 97, identifier:frame; 98, call; 99, identifier:columns; 100, attribute; 101, attribute; 102, argument_list; 103, identifier:AbinitTimerSection; 104, identifier:FIELDS; 105, identifier:frame; 106, identifier:append; 107, call; 108, keyword_argument; 109, attribute; 110, argument_list; 111, identifier:ignore_index; 112, True; 113, identifier:osect; 114, identifier:to_dict
code: def get_dataframe(self, sort_key="wall_time", **kwargs):
          """
          Return a pandas DataFrame with entries sorted according to `sort_key`.
          """
          import pandas as pd
          frame = pd.DataFrame(columns=AbinitTimerSection.FIELDS)
  
          for osect in self.order_sections(sort_key):
              frame = frame.append(osect.to_dict(), ignore_index=True)
  
          # Monkey patch
          frame.info =  self.info
          frame.cpu_time =  self.cpu_time
          frame.wall_time =  self.wall_time
          frame.mpi_nprocs =  self.mpi_nprocs
          frame.omp_nthreads =  self.omp_nthreads
          frame.mpi_rank =  self.mpi_rank
          frame.fname =  self.fname
  
          return frame