code: def df_insert(df, loc, column, value, allow_duplicates=False):
      """
      Insert column into DataFrame at specified location.
  
      Raises a ValueError if `column` is already contained in the DataFrame,
      unless `allow_duplicates` is set to True.
  
      Parameters
      ----------
      loc : int
          Insertion index. Must verify 0 <= loc <= len(columns).
      column : str, number, or hashable object
          Label of the inserted column.
      value : int, Series, or array-like
      allow_duplicates : bool, optional
      """
      if isinstance(value, TENSOR_TYPE) and value.ndim > 1:
          raise ValueError(
              f"Wrong number of items passed {value.ndim}, placement implies 1"
          )
  
      op = DataFrameInsert(
          loc=loc,
          column=column,
          value=value,
          allow_duplicates=allow_duplicates,
      )
      out_df = op(df)
      df.data = out_df.data
  
imports: import numpy
  import pandas
  from ...None import opcodes
  from ...core import recursive_tile
  from ...serialization.serializables import AnyField, BoolField, Int64Field
  from ...tensor.core import TENSOR_TYPE, TENSOR_CHUNK_TYPE
  from ..core import SERIES_TYPE, SERIES_CHUNK_TYPE
  from ..operands import DataFrameOperand, DataFrameOperandMixin
  from ..utils import build_empty_df, parse_index
label_desc: Use image node_id 1 for calling a global function with example usage: df_insert(df, loc, column, value, allow_duplicates) without return types