code: def _article_section_to_text(
      section, fact_delimiter: str, knowledge_keys: List[str] = None
  ) -> str:
      """
      Example input:
      {
        "cast": [
          "Ben Affleck as Batman",
          "Henry Cavill as Superman",
        ],
        "director": "Zack Snyder"
      }
      Example output:
      "cast:Ben Affleck as Batman,Henry Cavill as Superman;director:Zack Snyder"
      """
      if not section:
          return section
      if isinstance(section, str):
          return section
      texts = []
      for k, v in section.items():
          if knowledge_keys and k not in knowledge_keys:
              continue
          fact = f"{k}:"
          if isinstance(v, str):
              fact += v
          else:
              fact += ",".join(v)
          texts.append(fact)
      return fact_delimiter.join(texts)
  
imports: import copy
  import json
  import os
  from enum import Enum
  from typing import List, Optional, Tuple
  from parlai.core.message import Message
  from parlai.core.metrics import F1Metric
  from parlai.core.mutators import EpisodeMutator, MessageMutator, register_mutator
  from parlai.core.opt import Opt
  from parlai.core.params import ParlaiParser
  from parlai.core.teachers import DialogTeacher
  from parlai.tasks.cmu_dog.build import build
  from parlai.tasks.wizard_of_wikipedia.agents import RareWordF1Calculator, TOKEN_KNOWLEDGE, TOKEN_END_KNOWLEDGE
  from parlai.utils.data import DatatypeHelper
  from parlai.utils.io import PathManager
  from parlai.utils.logging import logger
  from parlai.utils.typing import TShared
label_desc: Use image node_id 5 for calling a global function with example usage: _article_section_to_text(section, fact_delimiter, knowledge_keys) and returns: fact_delimiter, section, section