docstr: Read existing global leaderboard, add current entry, then sort the updated leaderboard
docstr_tok: ["Read","existing","global","leaderboard",",","add","current","entry",",","then","sort","the","updated","leaderboard"]
code: def format_result(self):
      """Read existing global leaderboard, add current entry, then sort the updated leaderboard"""
      self.result = GlobalLeaderboard.from_path(
          path=self.result_paths["global_leaderboard"]
      )
      self.result.add_entry(self.current_task)
      # Sort rows by first column (target metric), then descending "experiment_#" (newest first)
      self.result.sort(
          by=[list(self.result.data.columns)[0], "experiment_#"],
          ascending=[
              (self.metrics[self.target_metric[-1]].direction == "min"),
              False,
          ],
      )
  
imports: from hyperparameter_hunter.data import OOFDataset, HoldoutDataset, TestDataset
  from hyperparameter_hunter.i_o.exceptions import EnvironmentInactiveError, EnvironmentInvalidError
  from hyperparameter_hunter.i_o.leaderboards import GlobalLeaderboard
  from hyperparameter_hunter.settings import G
  from hyperparameter_hunter.utils.file_utils import write_json, add_to_json, make_dirs, read_json
  from hyperparameter_hunter.utils.file_utils import RetryMakeDirs
  from hyperparameter_hunter.utils.general_utils import subdict
  from abc import ABCMeta, abstractmethod
  from collections import OrderedDict
  from platform import node
  import shutil
  from sys import exc_info
label_desc: Use image node_id 1 for calling the LeaderboardEntryRecorder obj's underlying member method code with example usage: obj.format_result() without return types