code: def create_plotly_table(
      table_plot, title, series, layout_config=None, data_config=None
  ):
      """
      Create a basic Plotly table json style to be sent
  
      :param table_plot: the output table in pandas.DataFrame structure or list of rows (list) in a table
      :param title: Title (AKA metric)
      :type title: str
      :param series: Series (AKA variant)
      :type series: str
      :param layout_config: additional configuration layout
      :param data_config: additional configuration for the data
      :return: dict with plotly data.
      """
      is_list = isinstance(table_plot, (list, tuple))
      if is_list and (not table_plot or not any(table_plot)):
          # The list if empty
          headers_values = []
          cells_values = []
      elif (
          is_list
          and table_plot[0]
          and isinstance(table_plot[0], (list, tuple))
      ):
          headers_values = table_plot[0]
          cells_values = [list(i) for i in zip(*table_plot[1:])]
      else:
          if not pd:
              raise UsageError(
                  "pandas is required in order to support reporting tables using CSV or a URL, "
                  "please install the pandas python package"
              )
          index_added = not isinstance(table_plot.index, pd.RangeIndex)
          headers_values = list([col] for col in table_plot.columns)
          cells_values = json.loads(
              table_plot.T.to_json(orient="values", date_format="iso")
          )
          if index_added:
              if isinstance(table_plot.index, pd.MultiIndex):
                  headers_values = [
                      n or "" for n in (table_plot.index.names or [])
                  ] + headers_values
                  cells_values = (
                      list(
                          zip(*(table_plot.index.values.tolist() or []))
                      )
                      + cells_values
                  )
              else:
                  headers_values.insert(0, table_plot.index.name or "")
                  cells_values.insert(
                      0, table_plot.index.values.tolist()
                  )
  
      ret = {
          "data": [
              {
                  "type": "table",
                  "header": {
                      "values": headers_values,
                      "align": "left",
                      "line": {"width": 0.5, "color": "#d4d6e0"},
                      "fill": {"color": "#fff"},
                      "font": {
                          "family": "Heebo, verdana, arial, sans-serif",
                          "size": 12,
                          "color": "#333",
                      },
                  },
                  "cells": {
                      "height": 30,
                      "values": cells_values,
                      "align": "left",
                      "line": {"color": "white", "width": 1},
                      "font": {
                          "family": "Heebo, verdana, arial, sans-serif",
                          "size": 14,
                          "color": "#384161",
                      },
                  },
              }
          ],
          "layout": {
              "title.text": title,
              "title": series,
          },
      }
      if layout_config:
          ret["layout"] = merge_dicts(ret["layout"], layout_config)
  
      if data_config and len(ret["data"]) == 1:
          ret["data"][0] = merge_dicts(ret["data"][0], data_config)
  
      return ret
  
imports: import json
  import numpy
  from ..errors import UsageError
  from ..utilities.dicts import merge_dicts
  from attr import attrs, attrib
label_desc: Use image node_id 14 for calling a global function with example usage: create_plotly_table(table_plot, title, series, layout_config, data_config) and returns: ret