code: def _test_block(
      *args,
      kls=None,
      sid=None,
      stitle=None,
      mappings=None,
      plots=None,
      scope="section",
      fnres=mkresult,
  ):
      figs = {arg._mock_name: arg for arg in args}
      result, df = fnres()
      if scope == "section":
          data = df
          section = kls(result=result, meta={}, df=data)
          content = result.result.frame
          assert (
              section._id == sid
          ), f"_id expecting {sid} got {section._id}"
          assert (
              section._title == stitle
          ), f"_title expecting {stitle} got {section._title}"
      else:
          data = df.iloc[:, 0]
          section = kls(
              result=result.result.series[data.name],
              name=data.name,
              ser=data,
          )
          content = result.result.series[data.name]
      for k, val in mappings.items():
          if callable(val):
              expected = val(content)
          elif val is None:
              expected = content[k]
          else:
              expected = content[val]
          actual = getattr(section, k)
          compare = (
              (lambda x, y: x.equals(y))
              if isinstance(expected, pd.DataFrame)
              else (lambda x, y: x == y)
          )
          assert compare(
              actual, expected
          ), f"Attribute {k}, expecting {expected} got {actual}"
      for plot, counts in plots.items():
          actual = figs[plot].call_count
          assert (
              actual == counts
          ), f"Plot {plot} expecting count {counts} got {actual}"
      return result, df, section
  
file_path: tslumen/tests/unit/report/html/test_sections.py
imports: import mock
  import pandas
  from tslumen.report.html.sections import SectionSummary, SectionTSFeatures, SectionRelations, SectionTimeSeries, SubTimeSeries, TabTSStatistics, TabTSDistribution, TabTSFeatures, TabTSAutoCorrelation, TabTSLagPlots, TabTSComponents, TabTSSeasonality, TabTSSmoothing, _FTS_MAIN, _FTS_STAT, _FTS_ACF, _PROFILERS_TSFEATURES
  from ..util import mkresult
label_desc: Use image node_id 3 for calling a global function with example usage: _test_block() and returns: result,  df,  section