code: def df_isin(df, values):
      """
      Whether each element in the DataFrame is contained in values.
  
      Parameters
      ----------
      values : iterable, Series, DataFrame or dict
          The result will only be true at a location if all the
          labels match. If `values` is a Series, that's the index. If
          `values` is a dict, the keys must be the column names,
          which must match. If `values` is a DataFrame,
          then both the index and column labels must match.
  
      Returns
      -------
      DataFrame
          DataFrame of booleans showing whether each element in the DataFrame
          is contained in values.
  
      See Also
      --------
      DataFrame.eq: Equality test for DataFrame.
      Series.isin: Equivalent method on Series.
      Series.str.contains: Test if pattern or regex is contained within a
          string of a Series or Index.
  
      Examples
      --------
      >>> import mars.dataframe as md
      >>> df = md.DataFrame({'num_legs': [2, 4], 'num_wings': [2, 0]},
      ...                   index=['falcon', 'dog'])
      >>> df.execute()
              num_legs  num_wings
      falcon         2          2
      dog            4          0
  
      When ``values`` is a list check whether every value in the DataFrame
      is present in the list (which animals have 0 or 2 legs or wings)
  
      >>> df.isin([0, 2]).execute()
              num_legs  num_wings
      falcon      True       True
      dog        False       True
  
      When ``values`` is a dict, we can pass values to check for each
      column separately:
  
      >>> df.isin({'num_wings': [0, 3]}).execute()
              num_legs  num_wings
      falcon     False      False
      dog        False       True
  
      When ``values`` is a Series or DataFrame the index and column must
      match. Note that 'falcon' does not match based on the number of legs
      in df2.
  
      >>> other = md.DataFrame({'num_legs': [8, 2], 'num_wings': [0, 2]},
      ...                      index=['spider', 'falcon'])
      >>> df.isin(other).execute()
              num_legs  num_wings
      falcon      True       True
      dog        False      False
      """
      if is_list_like(values) and not isinstance(values, dict):
          values = list(values)
      elif not isinstance(
          values,
          (SERIES_TYPE, DATAFRAME_TYPE, TENSOR_TYPE, INDEX_TYPE, dict),
      ):
          raise TypeError(
              "only list-like objects or dict are allowed to be passed to isin(), "
              f"you passed a [{type(values)}]"
          )
      op = DataFrameIsin(values=values)
      return op(df)
  
imports: import itertools
  import numpy
  import pandas
  from pandas.api.types import is_list_like
  from ...None import opcodes
  from ...core import ENTITY_TYPE
  from ...serialization.serializables import KeyField, AnyField
  from ...tensor.core import TENSOR_TYPE
  from ..core import DATAFRAME_TYPE, SERIES_TYPE, INDEX_TYPE, OutputType
  from ..operands import DataFrameOperand, DataFrameOperandMixin
  from .drop_duplicates import DataFrameDropDuplicates
label_desc: Use image node_id 2 for calling a global function with example usage: df_isin(df, values) and returns: op