code: def get_context_from_passages(passages, keep_only_relevant_passages):
      contexts = []
      if keep_only_relevant_passages:
          for passage in passages:
              if passage["is_selected"] == 1:
                  contexts.append(passage["passage_text"])
      else:
          contexts = [passage["passage_text"] for passage in passages]
  
      return " ".join(contexts)
  
file_path: NeMo/examples/nlp/question_answering/convert_msmarco_to_squad_format.py
imports: import argparse
  import json
  from ast import literal_eval
  from tqdm import tqdm
label_desc: Use image node_id 3 for calling a global function with example usage: get_context_from_passages(passages, keep_only_relevant_passages) and returns: str