code: def reset_buffers(self, discretize: str, total_step: int) -> None:  # type: ignore
      if discretize == "uniform":
          t = self.model.t
          span = t // (total_step + int(t % total_step == 0) - 1)
          q_timesteps = np.array(list(range(0, t, span)) + [t - 1])
      elif discretize == "quad":
          end = math.sqrt(self.model.t * 0.8)
          q_timesteps = (np.linspace(0, end, total_step) ** 2).astype(
              int
          )
      else:
          raise ValueError(
              f"unrecognized discretize method '{discretize}' occurred"
          )
      q_timesteps += 1
      q_timesteps = np.minimum(q_timesteps, self.model.t - 1)
      alphas = self.model.alphas_cumprod
      self.alphas = alphas[q_timesteps]
      self.timesteps = q_timesteps
      super().reset_buffers(
          torch.sqrt(self.alphas), torch.sqrt(1.0 - self.alphas)
      )
  
imports: import math
  import torch
  import numpy
  import torch.nn.functional
  from abc import abstractmethod
  from abc import ABCMeta
  from torch import Tensor
  from typing import Any
  from typing import Dict
  from typing import Tuple
  from typing import Optional
  from typing import Protocol
  from .basic import merge_ref
  from .schema import ISampler
  from .schema import IDiffusion
  from .schema import DDPMQSampler
  from .schema import UncondSamplerMixin
  from ..utils import cond_type
  from ..utils import get_timesteps
  from ...ae.vq import AutoEncoderVQModel
  from .....misc.toolkit import get_device
label_desc: Use image node_id 1 for calling the DDIMQSampler obj's underlying member method code with example usage: obj.reset_buffers(discretize, total_step) without return types