code: def _select_from_rows_if_any(
      frame: pd.DataFrame, rows_to_select: List[str]
  ) -> pd.DataFrame:
      cols_have_any = frame.loc[rows_to_select].any()
      return frame.loc[:, cols_have_any]
  
imports: from __future__ import annotations
  from collections.abc import Sequence
  from typing import TYPE_CHECKING, Dict, List, Optional, Tuple
  import numpy
  import pandas
  from golem.core.log import LoggerAdapter, default_log
  from fedot.core.repository.tasks import Task, TaskTypesEnum
label_desc: Use image node_id 3 for calling a global function with example usage: _select_from_rows_if_any(frame, rows_to_select) and returns: frame