code: def has_columns(df, columns):
      """Check if DataFrame has necessary columns
  
      Args:
          df (pandas.DataFrame): DataFrame
          columns (iterable(str)): columns to check for
  
      Returns:
          bool: True if DataFrame has specified columns.
      """
      if not isinstance(columns, set):
          columns = set(columns)
      return columns.issubset(df.columns)
  
imports: import logging
  import pandas
  import numpy
  from functools import lru_cache, wraps
  from recommenders.utils.constants import DEFAULT_USER_COL, DEFAULT_ITEM_COL, DEFAULT_RATING_COL, DEFAULT_LABEL_COL
label_desc: Use image node_id 4 for calling a global function with example usage: has_columns(df, columns) and returns: columns