code: def get_allowed_depth(
      num_completed_trials, depth_thresholds=None, max_depth=20
  ):
      """Returns the current allowed depth of the architecture."""
      if not depth_thresholds:
          depth_thresholds = _default_depth_thresholds(max_depth)
      if len(depth_thresholds) > max_depth:
          raise ValueError(
              "phoenix_spec.increase_complexity_min_trials cannot have more "
              "thresholds than phoenix_spec.maximum_depth."
          )
      if num_completed_trials >= depth_thresholds[-1]:
          allowed_depth = max_depth
      else:
          allowed_depth = next(
              depth
              for depth, trial_threshold in enumerate(depth_thresholds)
              if trial_threshold > num_completed_trials
          )
      return allowed_depth
  
file_path: model_search/model_search/search/common.py
imports: import os
  from model_search import block_builder
  from model_search.architecture import architecture_utils
  import numpy
  import tensorflow.compat.v2
label_desc: Use image node_id 5 for calling a global function with example usage: get_allowed_depth(num_completed_trials, depth_thresholds, max_depth) and returns: allowed_depth