code: def apply_filter(
      table: pa.Table,
      filters: Optional[pa.dataset.Expression] = None,
      drop_null: bool = True,
  ) -> pa.Table:
      if drop_null:
          table = table.drop_null()
      if filters is not None:
          table = table.filter(filters)
      return table
  
imports: from contextlib import contextmanager
  from typing import Dict, Generator, List, Optional, Union
  import numpy
  import pandas
  import pyarrow
  import pyarrow.parquet
  import torch
  from numpy.typing import NDArray
  from pyarrow.dataset import get_partition_keys
  from fairseq2.data import CString
  from fairseq2.data.data_pipeline import DataPipeline, DataPipelineBuilder, read_sequence
label_desc: Use image node_id 10 for calling a global function with example usage: apply_filter(table, filters, drop_null) and returns: table