code: def query_if_not_none(
      query: Optional[str], df: DataFrameT
  ) -> DataFrameT:
      if query is None:
          return df
      return df.query(query)
  
file_path: pygraphistry/graphistry/compute/hop.py
imports: import logging
  from typing import Any, List, Optional, TYPE_CHECKING, Union
  import pandas
  from graphistry.Engine import Engine, EngineAbstract, df_concat, df_cons, df_to_engine, resolve_engine
  from graphistry.Plottable import Plottable
  from graphistry.util import setup_logger
  from .filter_by_dict import filter_by_dict
  from .typing import DataFrameT
label_desc: Use image node_id 1 for calling a global function with example usage: query_if_not_none(query, df) and returns: df, df