class_docstr: A trial is a process of evaluating an objective function.
  
  This object is passed to an objective function and provides interfaces to get parameter
  suggestion, manage the trial's state, and set/get user-defined attributes of the trial.
  
  Note that the direct use of this constructor is not recommended.
  This object is seamlessly instantiated and passed to the objective function behind
  the :func:`optuna.study.Study.optimize()` method; hence library users do not care about
  instantiation of this object.
  
  Args:
      study:
          A :class:`~optuna.study.Study` object.
      trial_id:
          A trial ID that is automatically generated.
class_docstr_tok: ["A","trial","is","a","process","of","evaluating","an","objective","function",".","This","object","is","passed","to","an","objective","function","and","provides","interfaces","to","get","parameter","suggestion",",","manage","the","trial","'s","state",",","and","set\/get","user-defined","attributes","of","the","trial",".","Note","that","the","direct","use","of","this","constructor","is","not","recommended",".","This","object","is","seamlessly","instantiated","and","passed","to","the","objective","function","behind","the",":","func",":","`","optuna.study.Study.optimize","(",")","`","method",";","hence","library","users","do","not","care","about","instantiation","of","this","object",".","Args",":","study",":","A",":","class",":","`","~optuna.study.Study","`","object",".","trial_id",":","A","trial","ID","that","is","automatically","generated","."]
docstr: Suggest whether the trial should be pruned or not.
  
  The suggestion is made by a pruning algorithm associated with the trial and is based on
  previously reported values. The algorithm can be specified when constructing a
  :class:`~optuna.study.Study`.
  
  .. note::
      If no values have been reported, the algorithm cannot make meaningful suggestions.
      Similarly, if this method is called multiple times with the exact same set of reported
      values, the suggestions will be the same.
  
  .. seealso::
      Please refer to the example code in :func:`optuna.trial.Trial.report`.
  
  .. note::
      :func:`~optuna.trial.Trial.should_prune` does not support multi-objective
      optimization.
  
  Returns:
      A boolean value. If :obj:`True`, the trial should be pruned according to the
      configured pruning algorithm. Otherwise, the trial should continue.
docstr_tok: ["Suggest","whether","the","trial","should","be","pruned","or","not",".","The","suggestion","is","made","by","a","pruning","algorithm","associated","with","the","trial","and","is","based","on","previously","reported","values",".","The","algorithm","can","be","specified","when","constructing","a",":","class",":","`","~optuna.study.Study","`",".","..","note",":",":","If","no","values","have","been","reported",",","the","algorithm","can","not","make","meaningful","suggestions",".","Similarly",",","if","this","method","is","called","multiple","times","with","the","exact","same","set","of","reported","values",",","the","suggestions","will","be","the","same",".","..","seealso",":",":","Please","refer","to","the","example","code","in",":","func",":","`","optuna.trial.Trial.report","`",".","..","note",":",":",":","func",":","`","~optuna.trial.Trial.should_prune","`","does","not","support","multi-objective","optimization",".","Returns",":","A","boolean","value",".","If",":","obj",":","`","True","`",",","the","trial","should","be","pruned","according","to","the","configured","pruning","algorithm",".","Otherwise",",","the","trial","should","continue","."]
code: def should_prune(self) -> bool:
      """Suggest whether the trial should be pruned or not.
  
      The suggestion is made by a pruning algorithm associated with the trial and is based on
      previously reported values. The algorithm can be specified when constructing a
      :class:`~optuna.study.Study`.
  
      .. note::
          If no values have been reported, the algorithm cannot make meaningful suggestions.
          Similarly, if this method is called multiple times with the exact same set of reported
          values, the suggestions will be the same.
  
      .. seealso::
          Please refer to the example code in :func:`optuna.trial.Trial.report`.
  
      .. note::
          :func:`~optuna.trial.Trial.should_prune` does not support multi-objective
          optimization.
  
      Returns:
          A boolean value. If :obj:`True`, the trial should be pruned according to the
          configured pruning algorithm. Otherwise, the trial should continue.
      """
  
      if len(self.study.directions) > 1:
          raise NotImplementedError(
              "Trial.should_prune is not supported for multi-objective optimization."
          )
  
      trial = self._get_latest_trial()
      return self.study.pruner.prune(self.study, trial)
  
imports: from __future__ import annotations
  from collections import UserDict
  import copy
  import datetime
  from typing import Any
  from typing import Dict
  from typing import Optional
  from typing import overload
  from typing import Sequence
  import warnings
  import optuna
  from optuna import distributions
  from optuna import logging
  from optuna import pruners
  from optuna._convert_positional_args import convert_positional_args
  from optuna._deprecated import deprecated_func
  from optuna.distributions import BaseDistribution
  from optuna.distributions import CategoricalChoiceType
  from optuna.distributions import CategoricalDistribution
  from optuna.distributions import FloatDistribution
  from optuna.distributions import IntDistribution
  from optuna.trial import FrozenTrial
  from optuna.trial._base import _SUGGEST_INT_POSITIONAL_ARGS
  from optuna.trial._base import BaseTrial
label_desc: Use image node_id 16 for calling the Trial obj's underlying member method code with example usage: obj.should_prune() and returns: self