Figures out the names of the subpackages of a package

    Args:
        dir_: (str) path to package directory

    Source: http://stackoverflow.com/questions/832004/python-finding-all-packages-inside-a-package

def get_subpackages_names(dir_):
    """Figures out the names of the subpackages of a package

    Args:
        dir_: (str) path to package directory

    Source: http://stackoverflow.com/questions/832004/python-finding-all-packages-inside-a-package
    """

    def is_package(d):
        d = os.path.join(dir_, d)
        return os.path.isdir(d) and glob.glob(os.path.join(d, '__init__.py*'))

    ret = list(filter(is_package, os.listdir(dir_)))
    ret.sort()
    return ret