code: def get_batch_grid(
      items: List[Renderable],
      batch_size: int,
      titles: bool,
      subtitles: bool,
  ) -> widgets.GridBox:
      layout = widgets.Layout(
          width="100%",
          grid_template_columns=" ".join(
              [f"{int(100 / batch_size)}%"] * batch_size
          ),
      )
      out = []
      for item in items:
          if subtitles:
              out.append(
                  widgets.VBox(
                      [
                          widgets.HTML(
                              f"<h5><em>{ item.name }</em></h5>"
                          ),
                          item.render(),
                      ]
                  )
              )
          elif titles:
              out.append(
                  widgets.VBox(
                      [
                          widgets.HTML(f"<h4>{ item.name }</h4>"),
                          item.render(),
                      ]
                  )
              )
          else:
              out.append(item.render())
  
      return widgets.GridBox(out, layout=layout)
  
file_path: ydata-profiling/src/ydata_profiling/report/presentation/flavours/widget/container.py
imports: from typing import List
  from ipywidgets import widgets
  from ydata_profiling.report.presentation.core.container import Container
  from ydata_profiling.report.presentation.core.renderable import Renderable
label_desc: Use image node_id 6 for calling a global function with example usage: get_batch_grid(items, batch_size, titles, subtitles) and returns: widgets