code: def _search_summary(study):
      """
      Print statistics of trials and retrieve the summary for further analysis.
  
      :param study: the hpo study object
      :return : the summary object (current we return the study directly, so that
          it allows better flexiblity to do visualization and futher analysis)
      """
      if study is not None:
          print(
              "Number of finished trials: {}".format(len(study.trials))
          )
          best = study.best_trial
          print("Best trial:")
          print("  Value: {}".format(best.value))
          print("  Params: ")
          for key, value in best.params.items():
              print("    {}: {}".format(key, value))
          return study
          # return self.study.trials_dataframe(attrs=("number", "value", "params", "state"))
      else:
          print(
              "Seems you have not done any tuning yet.  \
                  Call tune and then call tune_summary to get the statistics."
          )
  
file_path: BigDL/python/nano/src/bigdl/nano/automl/hpo/search.py
imports: import optuna
  from bigdl.nano.utils.common import invalidInputError
label_desc: Use image node_id 2 for calling a global function with example usage: _search_summary(study) and returns: study