code: def get_5_docs(d):
      docs = extract_docs(d)
      sentences = extract_sentences(d)
      ret_docs = []
      real_docs = []
      sample_docs = []
      for d in docs:
          if any(sentence in d for sentence in sentences):
              real_docs.append(d)
          else:
              sample_docs.append(d)
      ret_docs = (
          random.sample(sample_docs, 5 - len(real_docs))
          if len(sample_docs) >= (5 - len(real_docs))
          else sample_docs
      )
      ret_docs = [
          doc.replace("\n", ". ")[: min([len(d) for d in real_docs])]
          for doc in ret_docs
      ]
      ret_docs = [
          f"{doc}\n"
          for doc in ret_docs
          + [d.replace("\n", ". ") for d in real_docs]
      ]
  
      return f"{EXTERNAL_KNOWLEDGE_PREFIX}: {f'{EXTERNAL_KNOWLEDGE_PREFIX}: '.join(ret_docs)}"
  
imports: from projects.bb3.agents.module import Module
  import random
label_desc: Use image node_id 4 for calling a global function with example usage: get_5_docs(d) and returns: EXTERNAL_KNOWLEDGE_PREFIX, str, EXTERNAL_KNOWLEDGE_PREFIX, str