code: def cb_layer(ctx, param, value):
      """Let --layer be a name or index."""
      if value is None or not value.isdigit():
          return value
      else:
          return int(value)
  
imports: from collections import defaultdict
  import click
label_desc: Use image node_id 1 for calling a global function with example usage: cb_layer(ctx, param, value) and returns: value, int