code: def create_sub_tiles(
      data_array, level, tile_info, output_path, post_render_func=None
  ):
      # validate / createoutput_dir
      _create_dir(output_path)
  
      # create tile source
      tile_def = MercatorTileDefinition(
          x_range=tile_info["x_range"],
          y_range=tile_info["y_range"],
          tile_size=256,
      )
  
      # create Tile Renderer
      if output_path.startswith("s3:"):
          renderer = S3TileRenderer(
              tile_def,
              output_location=output_path,
              post_render_func=post_render_func,
          )
      else:
          renderer = FileSystemTileRenderer(
              tile_def,
              output_location=output_path,
              post_render_func=post_render_func,
          )
  
      return renderer.render(data_array, level=level)
  
imports: from __future__ import annotations
  from io import BytesIO
  import math
  import os
  import dask
  import dask.bag
  import numpy
  from PIL.Image import fromarray
label_desc: Use image node_id 7 for calling a global function with example usage: create_sub_tiles(data_array, level, tile_info, output_path, post_render_func) and returns: renderer