code: def is_nonnegative(acq_function: AcquisitionFunction) -> bool:
      r"""Determine whether a given acquisition function is non-negative.
  
      Args:
          acq_function: The `AcquisitionFunction` instance.
  
      Returns:
          True if `acq_function` is non-negative, False if not, or if the behavior
          is unknown (for custom acquisition functions).
  
      Example:
          >>> qEI = qExpectedImprovement(model, best_f=0.1)
          >>> is_nonnegative(qEI)  # returns True
      """
      return isinstance(
          acq_function,
          (
              analytic.ExpectedImprovement,
              analytic.ConstrainedExpectedImprovement,
              analytic.ProbabilityOfImprovement,
              analytic.NoisyExpectedImprovement,
              monte_carlo.qExpectedImprovement,
              monte_carlo.qNoisyExpectedImprovement,
              monte_carlo.qProbabilityOfImprovement,
              multi_objective.analytic.ExpectedHypervolumeImprovement,
              multi_objective.monte_carlo.qExpectedHypervolumeImprovement,
              multi_objective.monte_carlo.qNoisyExpectedHypervolumeImprovement,
          ),
      )
  
imports: from __future__ import annotations
  import warnings
  from math import ceil
  from typing import Callable, Dict, List, Optional, Tuple, Union
  import torch
  from botorch import settings
  from botorch.acquisition import analytic, monte_carlo, multi_objective
  from botorch.acquisition.acquisition import AcquisitionFunction
  from botorch.acquisition.fixed_feature import FixedFeatureAcquisitionFunction
  from botorch.acquisition.knowledge_gradient import _get_value_function, qKnowledgeGradient
  from botorch.acquisition.multi_objective.hypervolume_knowledge_gradient import _get_hv_value_function, qHypervolumeKnowledgeGradient, qMultiFidelityHypervolumeKnowledgeGradient
  from botorch.exceptions.errors import BotorchTensorDimensionError, UnsupportedError
  from botorch.exceptions.warnings import BadInitialCandidatesWarning, BotorchWarning, SamplingWarning
  from botorch.models.model import Model
  from botorch.optim.utils import fix_features, get_X_baseline
  from botorch.utils.multi_objective.pareto import is_non_dominated
  from botorch.utils.sampling import batched_multinomial, draw_sobol_samples, get_polytope_samples, manual_seed
  from botorch.utils.transforms import normalize, standardize, unnormalize
  from torch import Tensor
  from torch.distributions import Normal
  from torch.quasirandom import SobolEngine
label_desc: Use image node_id 14 for calling a global function with example usage: is_nonnegative(acq_function) and returns: isinstance