code: def create_failures_dataframe(
      failures: t.Sequence[
          t.Union["check_types.CheckFailure", "check_types.CheckResult"]
      ]
  ) -> pd.DataFrame:
      """Create dataframe with check failures.
  
      Parameters
      ----------
      failures : Sequence[Union[CheckFailure, CheckResult]]
          check failures
  
      Returns
      -------
      pd.Dataframe:
          the condition table.
      """
      data = []
  
      for it in failures:
          if isinstance(it, check_types.CheckResult):
              data.append([it.get_header(), "Nothing found", 2])
          elif isinstance(it, check_types.CheckFailure):
              message = (
                  it.exception.html
                  if isinstance(
                      it.exception, errors.DeepchecksBaseError
                  )
                  else str(it.exception)
              )
              error_types = (
                  errors.DatasetValidationError,
                  errors.DeepchecksProcessError,
              )
              if isinstance(it.exception, error_types):
                  message = f"{type(it.exception).__name__}: {message}"
              data.append((it.header, message, 1))
          else:
              raise TypeError(
                  f"Unknown result type - {type(it).__name__}"
              )
  
      df = pd.DataFrame(
          data=data, columns=["Check", "Reason", "priority"]
      )
      df.sort_values(by=["priority"], inplace=True)
      df.drop("priority", axis=1, inplace=True)
      return df
  
imports: import io
  import json
  import textwrap
  import typing
  from contextlib import contextmanager
  import matplotlib
  import matplotlib.pyplot
  import numpy
  import pandas
  import plotly.io._html
  from ipywidgets import DOMWidget
  from jsonpickle.pickler import Pickler
  from pandas.io.formats.style import Styler
  from plotly.io._utils import plotly_cdn_url
  from plotly.offline.offline import get_plotlyjs
  from deepchecks.core import check_result
  from deepchecks.core import errors
  from deepchecks.utils.dataframes import hide_index_for_display, un_numpy
  from deepchecks.utils.html import linktag
  from deepchecks.utils.strings import truncate_string
label_desc: Use image node_id 7 for calling a global function with example usage: create_failures_dataframe(failures) and returns: df