code: def no_overlap(
      data_source: List[str],
      canidate_text: str,
      non_overlap_threshold: int = 1,
      remove_contractions: bool = True,
  ) -> bool:
      """
      Returns True if tokenized `canidate_text` text has at least `non_overlap_threshold`
      tokens NOT overlapping with all texts in `data_source` list.
  
      We use this for de-duplicating (for example memory entries)
      """
      tokenized_candidate_text = set(
          normal_tokenizer(
              canidate_text,
              remove_contractions=remove_contractions,
          )
      )
      for dst in data_source:
          dst_tokens = set(
              normal_tokenizer(
                  dst,
                  remove_contractions=remove_contractions,
              )
          )
          n_overlap = len(dst_tokens - tokenized_candidate_text)
          logging.debug(
              f'"{dst}" AND "{canidate_text}" ---- non-overlapping tokens: {n_overlap}'
          )
          if n_overlap < non_overlap_threshold:
              logging.info(
                  f'"{canidate_text}" has too much overlap with "{dst}": discarding repeated entry.'
              )
              return False
  
      return True
  
imports: import aiohttp
  import asyncio
  from enum import Enum
  import json
  import math
  from nltk.corpus import stopwords
  from nltk.tokenize import word_tokenize
  from nltk.stem import PorterStemmer
  import os
  import random
  import string
  import time
  from typing import List, Tuple, Optional, Dict, Any, Set, Union
  from parlai.agents.ir_baseline.ir_baseline import score_match, MaxPriorityQueue
  from parlai.core.dict import DictionaryAgent
  from parlai.core.message import Message
  from parlai.core.metrics import F1Metric
  from parlai.core.torch_generator_agent import PPLMetric
  import parlai.utils.logging
  import projects.bb3.constants
  import projects.bb3.prompts
  from projects.bb3.agents.module import Module
label_desc: Use image node_id 2 for calling a global function with example usage: no_overlap(data_source, canidate_text, non_overlap_threshold, remove_contractions) and returns: True, False