code: def concat(objs, axis=0, join="outer", ignore_index=False, sort=None):
      """Concatenate DataFrames, Series, or Indices row-wise.
  
      Parameters
      ----------
      objs : list of DataFrame, Series, or Index
      axis : {0/'index', 1/'columns'}, default 0
          The axis to concatenate along.
      join : {'inner', 'outer'}, default 'outer'
          How to handle indexes on other axis (or axes).
      ignore_index : bool, default False
          Set True to ignore the index of the *objs* and provide a
          default range index instead.
      sort : bool, default False
          Sort non-concatenation axis if it is not already aligned.
  
      Returns
      -------
      A new object of like type with rows from each object in ``objs``.
  
      Examples
      --------
      Combine two ``Series``.
  
      >>> import cudf
      >>> s1 = cudf.Series(['a', 'b'])
      >>> s2 = cudf.Series(['c', 'd'])
      >>> s1
      0    a
      1    b
      dtype: object
      >>> s2
      0    c
      1    d
      dtype: object
      >>> cudf.concat([s1, s2])
      0    a
      1    b
      0    c
      1    d
      dtype: object
  
      Clear the existing index and reset it in the
      result by setting the ``ignore_index`` option to ``True``.
  
      >>> cudf.concat([s1, s2], ignore_index=True)
      0    a
      1    b
      2    c
      3    d
      dtype: object
  
      Combine two DataFrame objects with identical columns.
  
      >>> df1 = cudf.DataFrame([['a', 1], ['b', 2]],
      ...                    columns=['letter', 'number'])
      >>> df1
        letter  number
      0      a       1
      1      b       2
      >>> df2 = cudf.DataFrame([['c', 3], ['d', 4]],
      ...                    columns=['letter', 'number'])
      >>> df2
        letter  number
      0      c       3
      1      d       4
      >>> cudf.concat([df1, df2])
        letter  number
      0      a       1
      1      b       2
      0      c       3
      1      d       4
  
      Combine DataFrame objects with overlapping columns and return
      everything. Columns outside the intersection will
      be filled with ``null`` values.
  
      >>> df3 = cudf.DataFrame([['c', 3, 'cat'], ['d', 4, 'dog']],
      ...                    columns=['letter', 'number', 'animal'])
      >>> df3
        letter  number animal
      0      c       3    cat
      1      d       4    dog
      >>> cudf.concat([df1, df3], sort=False)
        letter  number animal
      0      a       1   <NA>
      1      b       2   <NA>
      0      c       3    cat
      1      d       4    dog
  
      Combine ``DataFrame`` objects with overlapping columns
      and return only those that are shared by passing ``inner`` to
      the ``join`` keyword argument.
  
      >>> cudf.concat([df1, df3], join="inner")
        letter  number
      0      a       1
      1      b       2
      0      c       3
      1      d       4
  
      Combine ``DataFrame`` objects horizontally along the
      x axis by passing in ``axis=1``.
  
      >>> df4 = cudf.DataFrame([['bird', 'polly'], ['monkey', 'george']],
      ...                    columns=['animal', 'name'])
      >>> df4
         animal    name
      0    bird   polly
      1  monkey  george
      >>> cudf.concat([df1, df4], axis=1)
        letter  number  animal    name
      0      a       1    bird   polly
      1      b       2  monkey  george
      """
      # TODO: Do we really need to have different error messages for an empty
      # list and a list of None?
      if not objs:
          raise ValueError("No objects to concatenate")
  
      objs = [obj for obj in objs if obj is not None]
  
      if not objs:
          raise ValueError("All objects passed were None")
  
      axis = _AXIS_MAP.get(axis, None)
      if axis is None:
          raise ValueError(
              f'`axis` must be 0 / "index" or 1 / "columns", got: {axis}'
          )
  
      # Return for single object
      if len(objs) == 1:
          obj = objs[0]
  
          if ignore_index:
              if axis == 1:
                  result = cudf.DataFrame._from_data(
                      data=obj._data.copy(deep=True),
                      index=obj.index.copy(deep=True),
                  )
                  # The DataFrame constructor for dict-like data (such as the
                  # ColumnAccessor given by obj._data here) will drop any columns
                  # in the data that are not in `columns`, so we have to rename
                  # after construction.
                  result.columns = pd.RangeIndex(len(obj._data.names))
              else:
                  if isinstance(obj, cudf.Series):
                      result = cudf.Series._from_data(
                          data=obj._data.copy(deep=True),
                          index=cudf.RangeIndex(len(obj)),
                      )
                  elif isinstance(obj, pd.Series):
                      result = cudf.Series(
                          data=obj,
                          index=cudf.RangeIndex(len(obj)),
                      )
                  else:
                      result = cudf.DataFrame._from_data(
                          data=obj._data.copy(deep=True),
                          index=cudf.RangeIndex(len(obj)),
                      )
          else:
              if axis == 0:
                  result = obj.copy()
              else:
                  data = obj._data.copy(deep=True)
                  if isinstance(obj, cudf.Series) and obj.name is None:
                      # If the Series has no name, pandas renames it to 0.
                      data[0] = data.pop(None)
                  result = cudf.DataFrame._from_data(
                      data, index=obj.index.copy(deep=True)
                  )
  
          if isinstance(result, cudf.Series) and axis == 0:
              # sort has no effect for series concatted along axis 0
              return result
          else:
              return (
                  result.sort_index(axis=(1 - axis)) if sort else result
              )
  
      # Retrieve the base types of `objs`. In order to support sub-types
      # and object wrappers, we use `isinstance()` instead of comparing
      # types directly
      typs = set()
      for o in objs:
          if isinstance(o, cudf.MultiIndex):
              typs.add(cudf.MultiIndex)
          elif isinstance(o, cudf.BaseIndex):
              typs.add(type(o))
          elif isinstance(o, cudf.DataFrame):
              typs.add(cudf.DataFrame)
          elif isinstance(o, cudf.Series):
              typs.add(cudf.Series)
          else:
              raise TypeError(
                  f"cannot concatenate object of type {type(o)}"
              )
  
      allowed_typs = {cudf.Series, cudf.DataFrame}
  
      # when axis is 1 (column) we can concat with Series and Dataframes
      if axis == 1:
          if not typs.issubset(allowed_typs):
              raise TypeError(
                  "Can only concatenate Series and DataFrame objects when axis=1"
              )
          df = cudf.DataFrame()
          _normalize_series_and_dataframe(objs, axis=axis)
  
          # Inner joins involving empty data frames always return empty dfs, but
          # We must delay returning until we have set the column names.
          empty_inner = (
              any(obj.empty for obj in objs) and join == "inner"
          )
  
          objs = [obj for obj in objs if obj.shape != (0, 0)]
  
          if len(objs) == 0:
              return df
  
          # Don't need to align indices of all `objs` since we
          # would anyway return an empty dataframe below
          if not empty_inner:
              objs = _align_objs(objs, how=join, sort=sort)
              df.index = objs[0].index
  
          for o in objs:
              for name, col in o._data.items():
                  if name in df._data:
                      raise NotImplementedError(
                          f"A Column with duplicate name found: {name}, cuDF "
                          f"doesn't support having multiple columns with "
                          f"same names yet."
                      )
                  if empty_inner:
                      # if join is inner and it contains an empty df
                      # we return an empty df, hence creating an empty
                      # column with dtype metadata retained.
                      df[name] = cudf.core.column.column_empty_like(
                          col, newsize=0
                      )
                  else:
                      df[name] = col
  
          result_columns = (
              objs[0]
              ._data.to_pandas_index()
              .append([obj._data.to_pandas_index() for obj in objs[1:]])
          )
  
          if ignore_index:
              # with ignore_index the column names change to numbers
              df.columns = pd.RangeIndex(len(result_columns.unique()))
          else:
              df.columns = result_columns.unique()
  
          if empty_inner:
              # if join is inner and it contains an empty df
              # we return an empty df
              return df.head(0)
  
          return df
  
      # If we get here, we are always concatenating along axis 0 (the rows).
      typ = list(typs)[0]
      if len(typs) > 1:
          if allowed_typs == typs:
              # This block of code will run when `objs` has
              # both Series & DataFrame kind of inputs.
              _normalize_series_and_dataframe(objs, axis=axis)
              typ = cudf.DataFrame
          else:
              raise TypeError(
                  f"`concat` cannot concatenate objects of "
                  f"types: {sorted([t.__name__ for t in typs])}."
              )
  
      if typ is cudf.DataFrame:
          old_objs = objs
          objs = [obj for obj in objs if obj.shape != (0, 0)]
          if len(objs) == 0:
              # If objs is empty, that indicates all of
              # objs are empty dataframes.
              return cudf.DataFrame()
          elif len(objs) == 1:
              obj = objs[0]
              result = cudf.DataFrame._from_data(
                  data=None
                  if join == "inner"
                  else obj._data.copy(deep=True),
                  index=cudf.RangeIndex(len(obj))
                  if ignore_index
                  else obj.index.copy(deep=True),
              )
              return result
          else:
              if join == "inner" and len(old_objs) != len(objs):
                  # don't filter out empty df's
                  objs = old_objs
              result = cudf.DataFrame._concat(
                  objs,
                  axis=axis,
                  join=join,
                  ignore_index=ignore_index,
                  # Explicitly cast rather than relying on None being falsy.
                  sort=bool(sort),
              )
          return result
  
      elif typ is cudf.Series:
          objs = [obj for obj in objs if len(obj)]
          if len(objs) == 0:
              return cudf.Series()
          elif len(objs) == 1 and not ignore_index:
              return objs[0]
          else:
              return cudf.Series._concat(
                  objs, axis=axis, index=None if ignore_index else True
              )
      elif typ is cudf.MultiIndex:
          return cudf.MultiIndex._concat(objs)
      elif issubclass(typ, cudf.Index):
          return cudf.core.index.GenericIndex._concat(objs)
      else:
          raise TypeError(f"cannot concatenate object of type {typ}")
  
imports: import itertools
  import warnings
  from collections import abc
  from typing import Dict, Optional
  import cupy
  import numpy
  import pandas
  import cudf
  from cudf._lib.transform import one_hot_encode
  from cudf._lib.types import size_type_dtype
  from cudf._typing import Dtype
  from cudf.api.extensions import no_default
  from cudf.core.column import ColumnBase, as_column, column_empty_like
  from cudf.core.column.categorical import CategoricalColumn
  from cudf.utils.dtypes import min_unsigned_type
label_desc: Use image node_id 4 for calling a global function with example usage: concat(objs, axis, join, ignore_index, sort) and returns: df, result, result, unknown, df, df, cudf, result, cudf, cudf, objs, cudf, cudf