code: def is_valid_command(self, word: str) -> Tuple[bool, str]:
          
          valid = False
  
          if not word:
              return False, 'cannot be an empty string'
  
          if word.startswith(constants.COMMENT_CHAR):
              return False, 'cannot start with the comment character'
  
          for (shortcut, _) in self.shortcuts:
              if word.startswith(shortcut):
                  # Build an error string with all shortcuts listed
                  errmsg = 'cannot start with a shortcut: '
                  errmsg += ', '.join(shortcut for (shortcut, _) in self.shortcuts)
                  return False, errmsg
  
          errmsg = 'cannot contain: whitespace, quotes, '
          errchars = []
          errchars.extend(constants.REDIRECTION_CHARS)
          errchars.extend(self.terminators)
          errmsg += ', '.join([shlex.quote(x) for x in errchars])
  
          match = self._command_pattern.search(word)
          if match:
              if word == match.group(1):
                  valid = True
                  errmsg = ''
          return valid, errmsg
docs: Determine whether a word is a valid name for a command.
  
          Commands can not include redirection characters, whitespace,
          or termination characters. They also cannot start with a
          shortcut.
  
          If word is not a valid command, return False and error text
          This string is suitable for inclusion in an error message of your
          choice:
  
          valid, errmsg = statement_parser.is_valid_command('>')
          if not valid:
              errmsg = "Alias {}".format(errmsg)