code: def build_handler(ctx, param, value):
      if value:
          try:
              if "^" in value:
                  base, exp_range = value.split("^")
                  exp_min, exp_max = (
                      int(v) for v in exp_range.split("..")
                  )
                  value = [
                      pow(int(base), k)
                      for k in range(exp_min, exp_max + 1)
                  ]
              elif "," in value:
                  value = [int(v) for v in value.split(",")]
              elif value == "auto":
                  pass
              else:
                  raise Exception
          except Exception:
              raise click.BadParameter(
                  "must match 'n,n,n,…', 'n^n..n', or 'auto'."
              )
      return value
  
file_path: rasterio/rasterio/rio/overview.py
imports: from functools import reduce
  import operator
  import click
  from .None import options
  import rasterio
  from rasterio.enums import _OverviewResampling
label_desc: Use image node_id 1 for calling a global function with example usage: build_handler(ctx, param, value) and returns: value