def find_deprecated_defs(pkg_dir):
    # 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, '', ''))
Return a list of all functions marked with the @deprecated
dataset/ETHPy150Open nltk/nltk/tools/find_deprecated.py/find_deprecated_defs