code: def _apply_predicate(op, val, col_stats):
      # Sanitize operator
      if op not in {
          "=",
          "==",
          "!=",
          "<",
          "<=",
          ">",
          ">=",
          "in",
          "not in",
      }:
          raise ValueError(
              f"'{op}' is not a valid operator in predicates."
          )
  
      col_min = col_stats.get("minimum", None)
      col_max = col_stats.get("maximum", None)
      col_sum = col_stats.get("sum", None)
  
      # Apply operator
      if op == "=" or op == "==":
          if _apply_filter_not_eq(val, col_stats):
              return False
          # TODO: Replace pd.isnull with
          # cudf.isnull once it is implemented
          if pd.isnull(val) and not col_stats["has_null"]:
              return False
          if not _apply_filter_bool_eq(val, col_stats):
              return False
      elif op == "!=":
          if (
              col_min is not None
              and col_max is not None
              and val == col_min
              and val == col_max
          ):
              return False
          if _apply_filter_bool_eq(val, col_stats):
              return False
      elif col_min is not None and (
          (op == "<" and val <= col_min)
          or (op == "<=" and val < col_min)
      ):
          return False
      elif col_max is not None and (
          (op == ">" and val >= col_max)
          or (op == ">=" and val > col_max)
      ):
          return False
      elif (
          col_sum is not None
          and op == ">"
          and (
              (col_min is not None and col_min >= 0 and col_sum <= val)
              or (
                  col_max is not None
                  and col_max <= 0
                  and col_sum >= val
              )
          )
      ):
          return False
      elif (
          col_sum is not None
          and op == ">="
          and (
              (col_min is not None and col_min >= 0 and col_sum < val)
              or (
                  col_max is not None and col_max <= 0 and col_sum > val
              )
          )
      ):
          return False
      elif op == "in":
          if (col_max is not None and col_max < min(val)) or (
              col_min is not None and col_min > max(val)
          ):
              return False
          if all(_apply_filter_not_eq(elem, col_stats) for elem in val):
              return False
      elif (
          op == "not in" and col_min is not None and col_max is not None
      ):
          if any(elem == col_min == col_max for elem in val):
              return False
          col_range = None
          if isinstance(col_min, int):
              col_range = range(col_min, col_max)
          elif isinstance(col_min, datetime.datetime):
              col_range = pd.date_range(col_min, col_max)
          if col_range and all(elem in val for elem in col_range):
              return False
      return True
  
imports: import datetime
  import os
  import urllib
  import warnings
  from io import BufferedWriter, BytesIO, IOBase, TextIOWrapper
  from threading import Thread
  import fsspec
  import fsspec.implementations.local
  import numpy
  import pandas
  from fsspec.core import get_fs_token_paths
  from pyarrow import PythonFile
  from pyarrow.lib import NativeFile
  from cudf.utils.docutils import docfmt_partial
label_desc: Use image node_id 17 for calling a global function with example usage: _apply_predicate(op, val, col_stats) and returns: True, False, False, False, False, False, False, False, False, False, False, False, False, False