code: def _find_candidates_constant_relative_step(
      histogram: histograms.Histogram, max_candidates: int
  ) -> List[int]:
      """Finds candidates with constant relative step.
  
      Candidates are a sequence starting from 1 where relative difference
      between two neighbouring elements is the same. Mathematically it means
      that candidates are a sequence a_i, where
      a_i = max_value^(i / (max_candidates - 1)), i in [0..(max_candidates - 1)]
      """
      max_value = histogram.max_value()
      assert max_value >= 1, "max_value has to be >= 1."
      max_candidates = min(max_candidates, max_value)
      assert max_candidates > 0, "max_candidates have to be positive"
      if max_candidates == 1:
          return [1]
      step = pow(max_value, 1 / (max_candidates - 1))
      candidates = [1]
      accumulated = 1
      for i in range(1, max_candidates):
          previous_candidate = candidates[-1]
          if previous_candidate >= max_value:
              break
          accumulated *= step
          next_candidate = max(
              previous_candidate + 1, math.ceil(accumulated)
          )
          candidates.append(next_candidate)
      # float calculations might be not precise enough but the last candidate has
      # to be always max_value
      candidates[-1] = max_value
      return candidates
  
imports: import logging
  import math
  from numbers import Number
  import pipeline_dp
  from pipeline_dp import dp_computations
  from pipeline_dp import pipeline_backend
  from pipeline_dp import input_validators
  from pipeline_dp.dataset_histograms import histograms
  import analysis
  from analysis import metrics
  from analysis import utility_analysis
  from analysis import dp_strategy_selector
  import dataclasses
  from dataclasses import dataclass
  from typing import Callable, List, Optional, Tuple, Union, Sequence
  from enum import Enum
  import numpy
label_desc: Use image node_id 4 for calling a global function with example usage: _find_candidates_constant_relative_step(histogram, max_candidates) and returns: candidates, list