code: def assign(df, *pairs):
      # Only deep copy when updating an element
      # (to avoid modifying the original)
      # Setitem never modifies an array inplace with pandas 1.4 and up
      pairs = dict(partition(2, pairs))
      deep = bool(set(pairs) & set(df.columns)) and not PANDAS_GE_140
      df = df.copy(deep=bool(deep))
      with warnings.catch_warnings():
          warnings.filterwarnings(
              "ignore",
              message="DataFrame is highly fragmented *",
              category=PerformanceWarning,
          )
          for name, val in pairs.items():
              df[name] = val
      return df
  
imports: from __future__ import annotations
  import warnings
  from functools import partial
  import numpy
  import pandas
  from pandas.api.types import is_extension_array_dtype
  from pandas.errors import PerformanceWarning
  from tlz import partition
  from dask.dataframe._compat import PANDAS_GE_131, PANDAS_GE_140, PANDAS_GE_200, check_apply_dataframe_deprecation, check_applymap_dataframe_deprecation, check_convert_dtype_deprecation, check_observed_deprecation
  from dask.dataframe.dispatch import concat, concat_dispatch, group_split_dispatch, hash_object_dispatch, is_categorical_dtype, is_categorical_dtype_dispatch, tolist, tolist_dispatch, union_categoricals
  from dask.dataframe.utils import is_dataframe_like, is_index_like, is_series_like
label_desc: Use image node_id 21 for calling a global function with example usage: assign(df) and returns: df