code: def check_column(
      df: pd.DataFrame,
      column_names: Union[Iterable, str],
      present: bool = True,
  ):
      """One-liner syntactic sugar for checking the presence or absence
      of columns.
  
      Examples:
          ```python
          check(df, ['a', 'b'], present=True)
          ```
  
      This will check whether columns `'a'` and `'b'` are present in
      `df`'s columns.
  
      One can also guarantee that `'a'` and `'b'` are not present
      by switching to `present=False`.
  
      Args:
          df: The name of the variable.
          column_names: A list of column names we want to check to see if
              present (or absent) in `df`.
          present: If `True` (default), checks to see if all of `column_names`
              are in `df.columns`. If `False`, checks that none of `column_names`
              are in `df.columns`.
  
      Raises:
          ValueError: If data is not the expected type.
      """
      if isinstance(column_names, str) or not isinstance(
          column_names, Iterable
      ):
          column_names = [column_names]
  
      for column_name in column_names:
          if (
              present and column_name not in df.columns
          ):  # skipcq: PYL-R1720
              raise ValueError(
                  f"{column_name} not present in dataframe columns!"
              )
          elif not present and column_name in df.columns:
              raise ValueError(
                  f"{column_name} already present in dataframe columns!"
              )
  
imports: from __future__ import annotations
  import importlib
  import os
  import socket
  import sys
  from functools import singledispatch, wraps
  from pathlib import Path
  from typing import Any, Callable, Dict, Iterable, List, Union
  from warnings import warn
  import numpy
  import pandas
label_desc: Use image node_id 14 for calling a global function with example usage: check_column(df, column_names, present) without return types