class_docstr: default setting for report constants
docstr: add a block of image with table (table on the left, image on the right)
  
  Args:
      image_path (str): path of the image
      table_header (list(str)):  table header
      table_content: list(list(string)), 2D nested list with table content
      grid_spec (dict): with "table", "image" as key
      - 'table': (w,h), width and height of the table
      - 'image': (w,h), width and height of the image
      caption (str): group caption
      style (str): caption style
  Returns:
      (bool) True if an image-table block written to PDF successfully,
         otherwise False
docstr_tok: ["add","a","block","of","image","with","table","(","table","on","the","left",",","image","on","the","right",")","Args",":","image_path","(","str",")",":","path","of","the","image","table_header","(","list","(","str",")",")",":","table","header","table_content",":","list","(","list","(","string",")",")",",","2D","nested","list","with","table","content","grid_spec","(","dict",")",":","with","``","table","''",",","``","image","''","as","key","-","'table","'",":","(","w",",","h",")",",","width","and","height","of","the","table","-","'image","'",":","(","w",",","h",")",",","width","and","height","of","the","image","caption","(","str",")",":","group","caption","style","(","str",")",":","caption","style","Returns",":","(","bool",")","True","if","an","image-table","block","written","to","PDF","successfully",",","otherwise","False"]
code: def add_table_image_group(
      self,
      image_path,
      table_header,
      table_content,
      grid_spec,
      caption=None,
      style=None,
  ):
      """
      add a block of image with table (table on the left, image on the right)
  
      Args:
          image_path (str): path of the image
          table_header (list(str)):  table header
          table_content: list(list(string)), 2D nested list with table content
          grid_spec (dict): with "table", "image" as key
          - 'table': (w,h), width and height of the table
          - 'image': (w,h), width and height of the image
          caption (str): group caption
          style (str): caption style
      Returns:
          (bool) True if an image-table block written to PDF successfully,
             otherwise False
      """
      local_x = self.x
      local_y = self.y
  
      if "image" not in grid_spec:
          warnings.warn(
              message="Error in image_table_spec: no 'image' key found."
          )
          return False
      else:
          if len(grid_spec["image"]) != 2:
              warnings.warn(
                  message="Error in image_table_spec:'image' "
                  "spec should have 2 elements (width, height)"
              )
              return False
          image_width, image_height = grid_spec["image"]
  
          if type(image_width) not in [float, int] or type(
              image_height
          ) not in [float, int]:
              warnings.warn(
                  message="Error in image_table_spec: image_width and "
                  "image_height should be int or float."
              )
              return False
          if image_width <= 0 or image_height <= 0:
              warnings.warn(
                  message="Error in image_table_spec: image_width and "
                  "image_height should be larger than zeros."
              )
              return False
      if "table" not in grid_spec:
          warnings.warn(
              message="Error in image_table_spec: no 'table' key found."
          )
          return False
      else:
          if len(grid_spec["image"]) != 2:
              warnings.warn(
                  message="Error in image_table_spec:'table' spec "
                  "should have 2 elements (width, height)"
              )
              return False
          table_width, table_height = grid_spec["table"]
  
          if type(table_width) not in [float, int] or type(
              table_height
          ) not in [float, int]:
              warnings.warn(
                  message="Error in image_table_spec: table_width and "
                  "table_height should be int or float."
              )
              return False
          if table_width <= 0 or table_height <= 0:
              warnings.warn(
                  message="Error in image_table_spec: table_width and "
                  "table_height should be larger than zeros."
              )
              return False
  
      if local_x + image_width + table_width > self.w - self.r_margin:
          warnings.warn(
              message="Warning: figure will exceed the page edge "
              "on the right, rescale the whole group."
          )
          total_maximum_width = self.w - self.r_margin - local_x
  
          rescale_ratio = total_maximum_width / (
              image_width + table_width
          )
  
          image_width *= rescale_ratio
          image_height *= rescale_ratio
          table_width *= rescale_ratio
          table_height *= rescale_ratio
  
      block_height = max(table_height, image_height)
  
      if caption is None:
          if local_y + block_height > self.h - self.foot_size:
              warnings.warn(
                  message="Warning: figure will exceed the page bottom, "
                  "adding a new page."
              )
              self.add_page()
      else:
          if (
              local_y + block_height + CustomPdf.LINE_HEIGHT
              > self.h - self.foot_size
          ):
              warnings.warn(
                  message="Warning: figure will exceed the page bottom, "
                  "adding a new page."
              )
              self.add_page()
          self.add_new_line(caption, style=style)
  
      local_x = self.x
      local_y = self.y
  
      if table_header is not None and table_content is not None:
          self.add_table(
              table_header,
              table_content,
              col_width=[table_width / len(table_header)]
              * len(table_header),
              row_height=min(table_height / len(table_content), 6),
              x=local_x,
              y=local_y,
          )
      if image_path is not None:
          self.image(
              image_path,
              x=local_x + table_width,
              y=local_y,
              w=image_width,
              h=image_height,
          )
  
      # reset to original point and advance
      self.x = local_x
      self.y = local_y
      self.ln(block_height)
      return True
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import os
  import warnings
  import datetime
  import re
  from fpdf import FPDF
label_desc: Use image node_id 18 for calling the CustomPdf obj's underlying member method code with example usage: obj.add_table_image_group(image_path, table_header, table_content, grid_spec, caption, style) and returns: True, False, False, False, False, False, False, False, False