code: def check_imperative_mood(self, function, docstring):  # def context
          
          if docstring and not function.is_test:
              stripped = ast.literal_eval(docstring).strip()
              if stripped:
                  first_word = stripped.split()[0]
                  check_word = first_word.lower()
  
                  if check_word in IMPERATIVE_BLACKLIST:
                      return violations.D401b(first_word)
  
                  try:
                      correct_form = IMPERATIVE_VERBS.get(stem(check_word))
                  except UnicodeDecodeError:
                      # This is raised when the docstring contains unicode
                      # characters in the first word, but is not a unicode
                      # string. In which case D302 will be reported. Ignoring.
                      return
  
                  if correct_form and correct_form != check_word:
                      return violations.D401(
                          correct_form.capitalize(),
                          first_word
                      )
docs: D401: First line should be in imperative mood: 'Do', not 'Does'.
  
          [Docstring] prescribes the function or method's effect as a command:
          ("Do this", "Return that"), not as a description; e.g. don't write
          "Returns the pathname ...".