code: def _inputrc_enables_vi_mode():
      '''
      Emulate a small bit of readline behavior.
  
      Returns:
          (bool) True if current user enabled vi mode ("set editing-mode vi") in .inputrc
      '''
      for filepath in (os.path.expanduser('~/.inputrc'), '/etc/inputrc'):
          try:
              with open(filepath) as f:
                  for line in f:
                      if _setre.fullmatch(line):
                          return True
          except IOError:
              continue
      return Falsf _inputrc_enables_vi_mode():
      '''
      Emulate a small bit of readline behavior.
  
      Returns:
          (bool) True if current user enabled vi mode ("set editing-mode vi") in .inputrc
      '''
      for filepath in (os.path.expanduser('~/.inputrc'), '/etc/inputrc'):
          try:
              with open(filepath) as f:
                  for line in f:
                      if _setre.fullmatch(line):
                          return True
          except IOError:
              continue
      return False
docs: Emulate a small bit of readline behavior.
  
      Returns:
          (bool) True if current user enabled vi mode ("set editing-mode vi") in .inputrc