code: def _select_default_adjoint_method(
      sde: base_sde.ForwardSDE,
      method: str,
      adjoint_method: Optional[str],
  ) -> str:
      """Select the default method for adjoint computation based on the noise type of the forward SDE."""
      if adjoint_method is not None:
          return adjoint_method
      elif method == METHODS.reversible_heun:
          return METHODS.adjoint_reversible_heun
      else:
          return {
              SDE_TYPES.ito: {
                  NOISE_TYPES.diagonal: METHODS.milstein,
                  NOISE_TYPES.additive: METHODS.euler,
                  NOISE_TYPES.scalar: METHODS.euler,
                  NOISE_TYPES.general: METHODS.euler,
              }[sde.noise_type],
              SDE_TYPES.stratonovich: METHODS.midpoint,
          }[sde.sde_type]
  
file_path: torchsde/torchsde/_core/adjoint.py
imports: import torch
  from torch import nn
  import warnings
  from .None import base_sde
  from .None import methods
  from .None import misc
  from .None import sdeint
  from .adjoint_sde import AdjointSDE
  from .._brownian import BaseBrownian, ReverseBrownian
  from ..settings import METHODS, NOISE_TYPES, SDE_TYPES
  from ..types import Any, Dict, Optional, Scalar, Tensor, Tensors, TensorOrTensors, Vector
label_desc: Use image node_id 2 for calling a global function with example usage: _select_default_adjoint_method(sde, method, adjoint_method) and returns: adjoint_method, METHODS, dict