class_docstr: Allow users to create a specific file as a signal to pause
  and iteratively debug the training.
  Once the :meth:`trigger` method is called, it detects whether the file exists, and opens an
  IPython/pdb shell if yes.
  In the shell, ``self`` is this callback, ``self.trainer`` is the trainer, and
  from that you can access everything else.
  
  Example:
  
  .. code-block:: none
  
      callbacks=[InjectShell('/path/to/pause-training.tmp'), ...]
  
      # the following command will pause the training and start a shell when the epoch finishes:
      $ touch /path/to/pause-training.tmp
docstr: Args:
     file (str): if this file exists, will open a shell.
     shell (str): one of 'ipython', 'pdb'
docstr_tok: ["Args",":","file","(","str",")",":","if","this","file","exists",",","will","open","a","shell",".","shell","(","str",")",":","one","of","'ipython","'",",","'pdb","'"]
code: def __init__(self, file="INJECT_SHELL.tmp", shell="ipython"):
      """
      Args:
         file (str): if this file exists, will open a shell.
         shell (str): one of 'ipython', 'pdb'
      """
      self._file = file
      assert shell in ["ipython", "pdb"]
      self._shell = shell
      logger.info(
          "Create a file '{}' to open {} shell.".format(file, shell)
      )
  
imports: import numpy
  import os
  import time
  from collections import deque
  from ..utils import logger
  from ..utils.utils import humanize_time_delta
  from .base import Callback
label_desc: Use image node_id 1 to create a new InjectShell object from inherited base classes: Callback with example: obj = InjectShell(file, shell)