code: def extract_beam_subtrees(beam: List[List[str]]) -> List[List[str]]:
      return list(
          filter(
              lambda processed_pred: processed_pred is not None,
              map(lambda tree_pred: extract_subtree(tree_pred), beam),
          )
      )
  
imports: from typing import List, Optional, Tuple
label_desc: Use image node_id 1 for calling a global function with example usage: extract_beam_subtrees(beam) and returns: list