code: def get_best_trial(self, study_name):
      if not self.is_study_done:
          return None
  
      study = self.get_study_by_name(study_name)
      study_configuration_dict = json.loads(study.study_configuration)
      study_goal = study_configuration_dict["goal"]
      trials = self.list_trials(study_name)
  
      best_trial = None
      best_objective_value = None
  
      # Get the first not null trial
      for trial in trials:
          if trial.objective_value:
              best_objective_value = trial.objective_value
              best_trial = trial
              break
  
      if best_trial == None:
          return None
  
      for trial in trials:
          if study_goal == "MAXIMIZE":
              if (
                  trial.objective_value
                  and trial.objective_value > best_objective_value
              ):
                  best_trial = trial
                  best_objective_value = trial.objective_value
          elif study_goal == "MINIMIZE":
              if (
                  trial.objective_value
                  and trial.objective_value < best_objective_value
              ):
                  best_trial = trial
                  best_objective_value = trial.objective_value
          else:
              return None
  
      return best_trial
  
imports: import os
  import json
  import requests
  from .model import Study
  from .model import Trial
  from .model import TrialMetric
label_desc: Use image node_id 10 for calling the AdvisorClient obj's underlying member method code with example usage: obj.get_best_trial(study_name) and returns: best_trial, None, None, None