code: def check_exceptions(
      df,
      allow_duplicates,
      unlimited_data=False,
      data_limit=15000,
      limit_msg=LIMIT_MSG,
      dupes_msg=DUPES_MSG,
  ):
      """
      Checker function to test the output of any chart aggregations to see if it is one of the following:
          - too large to be rendered by web client
          - contains duplicate data points which can't be rendered (ex: multiple points for a single point on the x-axis
            of a bar chart within the same series)
  
      :param df: dataframe whose data needs to be checked
      :type df: :class:`pandas:pandas.DataFrame`
      :param allow_duplicates: flag to allow duplicates to be ignored (usually for scatter plots)
      :type allow_duplicates: bool
      :param data_limit: maximum rows allowed for chart rendering (default: 15,000)
      :type data_limit: int, optional
      :param limit_msg: error message template
      :type limit_msg: str, optional
      :raises Exception: if any failure condition is met
      """
      if not allow_duplicates and any(df.duplicated()):
          raise ChartBuildingError(
              dupes_msg.format(", ".join(df.columns))
          )
      if not unlimited_data and len(df) > data_limit:
          raise ChartBuildingError(limit_msg.format(data_limit))
  
imports: import copy
  import numpy
  import pandas
  import dtale.global_state
  import dtale.pandas_util
  from dtale.column_analysis import handle_cleaners
  from dtale.constants import CHART_JOINER_CHAR
  from dtale.query import build_col_key, run_query
  from dtale.utils import ChartBuildingError, build_formatters, classify_type, find_dtype, find_dtype_formatter, flatten_lists, get_dtypes, json_int, make_list, triple_quote
label_desc: Use image node_id 10 for calling a global function with example usage: check_exceptions(df, allow_duplicates, unlimited_data, data_limit, limit_msg, dupes_msg) without return types