class_docstr: Models a perception module inference graph.
          Conditions on using the InferenceGraph object:
              1. All keys of the perception_blocks dictionary have to be unique
              2. All out_keys used when creating the blocks have to be unique
              3. All out_keys of a given block have to be sub-strings of the blocks key in the perception_blocks dict
  
  :param inference_block: An inference perception block to build the graph for.
class_docstr_tok: ["Models","a","perception","module","inference","graph",".","Conditions","on","using","the","InferenceGraph","object",":","1",".","All","keys","of","the","perception_blocks","dictionary","have","to","be","unique","2",".","All","out_keys","used","when","creating","the","blocks","have","to","be","unique","3",".","All","out_keys","of","a","given","block","have","to","be","sub-strings","of","the","blocks","key","in","the","perception_blocks","dict",":","param","inference_block",":","An","inference","perception","block","to","build","the","graph","for","."]
docstr: Retrieve the block key for a given out_key
  
  :param out_key: The out_key of an unknown block
  :return: The block key corresponding to the out_key
docstr_tok: ["Retrieve","the","block","key","for","a","given","out_key",":","param","out_key",":","The","out_key","of","an","unknown","block",":","return",":","The","block","key","corresponding","to","the","out_key"]
code: def _get_block_name_for_out_key(self, out_key: str) -> str:
      """Retrieve the block key for a given out_key
  
      :param out_key: The out_key of an unknown block
      :return: The block key corresponding to the out_key
      """
      for block_name, block in self.perception_blocks.items():
          if out_key in block.out_keys:
              return block_name
  
imports: import os
  import pickle
  from typing import Union, List, Dict, Optional, Sequence, Tuple
  import networkx
  import torch
  from matplotlib import pyplot
  from torch import nn
  from maze.core.annotations import override
  from maze.perception.blocks.base import PerceptionBlock
label_desc: Use image node_id 6 for calling the InferenceGraph obj's underlying member method code with example usage: obj._get_block_name_for_out_key(out_key) and returns: block_name