code: def scale_bound(stroke, average_dimension=10.0):
      """Scale an entire image to be less than a certain size."""
      # stroke is a numpy array of [dx, dy, pstate], average_dimension is a float.
      # modifies stroke directly.
      bounds = get_bounds(stroke, 1)
      max_dimension = max(bounds[1] - bounds[0], bounds[3] - bounds[2])
      stroke[:, 0:2] /= max_dimension / average_dimension
  
imports: import random
  import numpy
label_desc: Use image node_id 7 for calling a global function with example usage: scale_bound(stroke, average_dimension) without return types