code: def find_deprecated_defs(pkg_dir):
      """
      Return a list of all functions marked with the @deprecated
      decorator, and classes with an immediate Deprecated base class, in
      all Python files in the given directory.
      """
      # Walk through the directory, finding python files.
      for root, dirs, files in os.walk(pkg_dir):
          for filename in files:
              if filename.endswith(".py"):
                  # Search the file for any deprecated definitions.
                  s = open(os.path.join(root, filename)).read()
                  for m in DEPRECATED_DEF_RE.finditer(s):
                      if m.group(2):
                          name = m.group(2)
                          msg = " ".join(
                              strip_quotes(s)
                              for s in STRING_RE.findall(m.group(1))
                          )
                          msg = " ".join(msg.split())
                          if m.group()[0] in " \t":
                              cls = find_class(s, m.start())
                              deprecated_methods[name].add(
                                  (msg, cls, "()")
                              )
                          else:
                              deprecated_funcs[name].add(
                                  (msg, "", "()")
                              )
                      else:
                          name = m.group(3)
                          m2 = STRING_RE.match(s, m.end())
                          if m2:
                              msg = strip_quotes(m2.group())
                          else:
                              msg = ""
                          msg = " ".join(msg.split())
                          deprecated_classes[name].add((msg, "", ""))
  
file_path: nltk/tools/find_deprecated.py
imports: import os
  import re
  import sys
  import textwrap
  import tokenize
  from doctest import DocTestParser, register_optionflag
  from cStringIO import StringIO
  import nltk.corpus
  from nltk import defaultdict
label_desc: Use image node_id 3 for calling a global function with example usage: find_deprecated_defs(pkg_dir) without return types