human
Complete the below
def find_packages(root_dir, root_name):

    ''''Recursively find packages in *root_dir*.'
    '''
 Give me a Python code to find packages in *root_dir*?
assistant
#Here is Python code to find packages in *root_dir*.
    packages = []
    def rec(path, pkg_name):
        packages.append(pkg_name)
        for fn in sorted(os.listdir(path)):
            subpath = os.path.join(path, fn)
            if os.path.exists(os.path.join(subpath, '__init__.py')):
                subname = ('%s.%s' % (pkg_name, fn))
                rec(subpath, subname)
    rec(root_dir, root_name)
    return packages