code: def concat(
      dfs,
      axis=0,
      join="outer",
      interleave_partitions=False,
      ignore_unknown_divisions=False,
      ignore_order=False,
      **kwargs,
  ):
      """Concatenate DataFrames along rows.
  
      - When axis=0 (default), concatenate DataFrames row-wise:
  
        - If all divisions are known and ordered, concatenate DataFrames keeping
          divisions. When divisions are not ordered, specifying
          interleave_partition=True allows concatenate divisions each by each.
  
        - If any of division is unknown, concatenate DataFrames resetting its
          division to unknown (None)
  
      - When axis=1, concatenate DataFrames column-wise:
  
        - Allowed if all divisions are known.
  
        - If any of division is unknown, it raises ValueError.
  
      Parameters
      ----------
      dfs : list
          List of dask.DataFrames to be concatenated
      axis : {0, 1, 'index', 'columns'}, default 0
          The axis to concatenate along
      join : {'inner', 'outer'}, default 'outer'
          How to handle indexes on other axis
      interleave_partitions : bool, default False
          Whether to concatenate DataFrames ignoring its order. If True, every
          divisions are concatenated each by each.
      ignore_unknown_divisions : bool, default False
          By default a warning is raised if any input has unknown divisions.
          Set to True to disable this warning.
      ignore_order : bool, default False
          Whether to ignore order when doing the union of categoricals.
  
      Notes
      -----
      This differs in from ``pd.concat`` in the when concatenating Categoricals
      with different categories. Pandas currently coerces those to objects
      before concatenating. Coercing to objects is very expensive for large
      arrays, so dask preserves the Categoricals by taking the union of
      the categories.
  
      Examples
      --------
      If all divisions are known and ordered, divisions are kept.
  
      >>> import dask.dataframe as dd
      >>> a                                               # doctest: +SKIP
      dd.DataFrame<x, divisions=(1, 3, 5)>
      >>> b                                               # doctest: +SKIP
      dd.DataFrame<y, divisions=(6, 8, 10)>
      >>> dd.concat([a, b])                               # doctest: +SKIP
      dd.DataFrame<concat-..., divisions=(1, 3, 6, 8, 10)>
  
      Unable to concatenate if divisions are not ordered.
  
      >>> a                                               # doctest: +SKIP
      dd.DataFrame<x, divisions=(1, 3, 5)>
      >>> b                                               # doctest: +SKIP
      dd.DataFrame<y, divisions=(2, 3, 6)>
      >>> dd.concat([a, b])                               # doctest: +SKIP
      ValueError: All inputs have known divisions which cannot be concatenated
      in order. Specify interleave_partitions=True to ignore order
  
      Specify interleave_partitions=True to ignore the division order.
  
      >>> dd.concat([a, b], interleave_partitions=True)   # doctest: +SKIP
      dd.DataFrame<concat-..., divisions=(1, 2, 3, 5, 6)>
  
      If any of division is unknown, the result division will be unknown
  
      >>> a                                               # doctest: +SKIP
      dd.DataFrame<x, divisions=(None, None)>
      >>> b                                               # doctest: +SKIP
      dd.DataFrame<y, divisions=(1, 4, 10)>
      >>> dd.concat([a, b])                               # doctest: +SKIP
      dd.DataFrame<concat-..., divisions=(None, None, None, None)>
  
      By default concatenating with unknown divisions will raise a warning.
      Set ``ignore_unknown_divisions=True`` to disable this:
  
      >>> dd.concat([a, b], ignore_unknown_divisions=True)# doctest: +SKIP
      dd.DataFrame<concat-..., divisions=(None, None, None, None)>
  
      Different categoricals are unioned
  
      >>> dd.concat([
      ...     dd.from_pandas(pd.Series(['a', 'b'], dtype='category'), 1),
      ...     dd.from_pandas(pd.Series(['a', 'c'], dtype='category'), 1),
      ... ], interleave_partitions=True).dtype
      CategoricalDtype(categories=['a', 'b', 'c'], ordered=False, categories_dtype=object)
      """
  
      if not isinstance(dfs, list):
          raise TypeError(
              "dfs must be a list of DataFrames/Series objects"
          )
      if len(dfs) == 0:
          raise ValueError("No objects to concatenate")
      if len(dfs) == 1:
          if axis == 1 and isinstance(dfs[0], Series):
              return dfs[0].to_frame()
          else:
              return dfs[0]
  
      if join not in ("inner", "outer"):
          raise ValueError("'join' must be 'inner' or 'outer'")
  
      axis = DataFrame._validate_axis(axis)
  
      if axis == 1:
          try:
              # remove any empty DataFrames
              dfs = [df for df in dfs if bool(len(df.columns))]
          except AttributeError:
              # 'Series' object has no attribute 'columns'
              pass
      dasks = [df for df in dfs if isinstance(df, _Frame)]
      dfs = _maybe_from_pandas(dfs)
  
      if axis == 1:
          if all(df.known_divisions for df in dasks):
              return concat_indexed_dataframes(
                  dfs,
                  axis=axis,
                  join=join,
                  ignore_order=ignore_order,
                  **kwargs,
              )
          elif (
              len(dasks) == len(dfs)
              and all(not df.known_divisions for df in dfs)
              and len({df.npartitions for df in dasks}) == 1
          ):
              if not ignore_unknown_divisions:
                  warnings.warn(
                      "Concatenating dataframes with unknown divisions.\n"
                      "We're assuming that the indices of each dataframes"
                      " are \n aligned. This assumption is not generally "
                      "safe."
                  )
              return concat_unindexed_dataframes(
                  dfs, ignore_order=ignore_order, **kwargs
              )
          else:
              raise ValueError(
                  "Unable to concatenate DataFrame with unknown "
                  "division specifying axis=1"
              )
      else:
          if all(df.known_divisions for df in dasks):
              # each DataFrame's division must be greater than previous one
              if all(
                  dfs[i].divisions[-1] < dfs[i + 1].divisions[0]
                  for i in range(len(dfs) - 1)
              ):
                  divisions = []
                  for df in dfs[:-1]:
                      # remove last to concatenate with next
                      divisions += df.divisions[:-1]
                  divisions += dfs[-1].divisions
                  return stack_partitions(
                      dfs,
                      divisions,
                      join=join,
                      ignore_order=ignore_order,
                      **kwargs,
                  )
              elif interleave_partitions:
                  return concat_indexed_dataframes(
                      dfs,
                      join=join,
                      ignore_order=ignore_order,
                      **kwargs,
                  )
              else:
                  divisions = [None] * (
                      sum(df.npartitions for df in dfs) + 1
                  )
                  return stack_partitions(
                      dfs,
                      divisions,
                      join=join,
                      ignore_order=ignore_order,
                      **kwargs,
                  )
          else:
              divisions = [None] * (
                  sum(df.npartitions for df in dfs) + 1
              )
              return stack_partitions(
                  dfs,
                  divisions,
                  join=join,
                  ignore_order=ignore_order,
                  **kwargs,
              )
  
imports: from __future__ import annotations
  import math
  import pickle
  import warnings
  from functools import partial, wraps
  import numpy
  import pandas
  from pandas.api.types import is_dtype_equal
  from tlz import merge_sorted, unique
  from dask.base import is_dask_collection, tokenize
  from dask.dataframe import methods
  from dask.dataframe.core import DataFrame, Index, Series, _concat, _deprecated_kwarg, _Frame, _maybe_from_pandas, is_broadcastable, map_partitions, new_dd_object, prefix_reduction, suffix_reduction
  from dask.dataframe.dispatch import group_split_dispatch, hash_object_dispatch
  from dask.dataframe.io import from_pandas
  from dask.dataframe.shuffle import partitioning_index, rearrange_by_divisions, shuffle, shuffle_group
  from dask.dataframe.utils import asciitable, check_meta, is_dataframe_like, is_series_like, make_meta, strip_unknown_categories
  from dask.highlevelgraph import HighLevelGraph
  from dask.layers import BroadcastJoinLayer
  from dask.utils import M, apply, get_default_shuffle_method
label_desc: Use image node_id 25 for calling a global function with example usage: concat(dfs, axis, join, interleave_partitions, ignore_unknown_divisions, ignore_order) and returns: dfs, dfs, concat_indexed_dataframes, stack_partitions, concat_unindexed_dataframes, stack_partitions, concat_indexed_dataframes, stack_partitions