docstr: Return available memories.
  
  :param text:
      incoming partner text
  :param memories:
      list of all memories
  :param in_session_memories:
      set of memories generated within the current conversation session
  :param ignore_in_session_memories:
      whether to ignore memories generated within the session
docstr_tok: ["Return","available","memories",".",":","param","text",":","incoming","partner","text",":","param","memories",":","list","of","all","memories",":","param","in_session_memories",":","set","of","memories","generated","within","the","current","conversation","session",":","param","ignore_in_session_memories",":","whether","to","ignore","memories","generated","within","the","session"]
code: def get_available_memories(
      cls,
      text: str,
      memories: Dict[str, int],
      in_session_memories: Set[str],
      dictionary: Optional[DictionaryAgent] = None,
      ignore_in_session_memories: bool = False,
      memory_overlap_threshold: float = 0.0,
      memory_hard_block_for_n_turns: int = 0,
      memory_soft_block_decay_factor: float = 0.0,
  ) -> List[str]:
      """
      Return available memories.
  
      :param text:
          incoming partner text
      :param memories:
          list of all memories
      :param in_session_memories:
          set of memories generated within the current conversation session
      :param ignore_in_session_memories:
          whether to ignore memories generated within the session
      """
      available_memory = []
      for memory, turns_since_used in memories.items():
          turns_since_used = int(turns_since_used)
          # check if we should ignore in session memories
          if (
              ignore_in_session_memories
              and memory in in_session_memories
          ):
              continue
          # check overlap
          if memory_overlap_threshold > 0:
              non_stopword_memory = " ".join(
                  normal_tokenizer(
                      memory.split(":")[-1], include_pronouns=True
                  )
              )
              non_stopword_text = " ".join(
                  normal_tokenizer(text, include_pronouns=True)
              )
              if (
                  F1Metric.compute(
                      non_stopword_memory, [non_stopword_text]
                  ).value()
                  < memory_overlap_threshold
              ):
                  continue
          # check hard block
          if turns_since_used < memory_hard_block_for_n_turns:
              continue
          # check soft block
          if memory_soft_block_decay_factor > 0 and random.random() < (
              memory_soft_block_decay_factor**turns_since_used
          ):
              continue
  
          available_memory.append(memory)
      return MemoryUtils.maybe_reduce_memories(
          text, available_memory, dictionary
      )
  
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 12 for calling the MemoryUtils obj's underlying member method code with example usage: obj.get_available_memories(cls, text, memories, in_session_memories, dictionary, ignore_in_session_memories, memory_overlap_threshold, memory_hard_block_for_n_turns, memory_soft_block_decay_factor) and returns: MemoryUtils