<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def tree_libs(start_path, filt_func=None):
 """ Return analysis of library dependencies within `start_path` Parameters start_path : str root path of tree to search for libraries depending on other libraries. filt_func : None or callable, optional If None, inspect all files for library dependencies. If callable, accepts filename as argument, returns True if we should inspect the file, False otherwise. Returns ------- lib_dict : dict dictionary with (key, value) pairs of (``libpath``, ``dependings_dict``). ``libpath`` is canonical (``os.path.realpath``) filename of library, or library name starting with {'@rpath', '@loader_path', '@executable_path'}. ``dependings_dict`` is a dict with (key, value) pairs of (``depending_libpath``, ``install_name``), where ``dependings_libpath`` is the canonical (``os.path.realpath``) filename of the library depending on ``libpath``, and ``install_name`` is the "install_name" by which ``depending_libpath`` refers to ``libpath``. Notes ----- See: * https://developer.apple.com/library/mac/documentation/Darwin/Reference/ManPages/man1/dyld.1.html * http://matthew-brett.github.io/pydagogue/mac_runtime_link.html """

    lib_dict = {}
    for dirpath, dirnames, basenames in os.walk(start_path):
        for base in basenames:
            depending_libpath = realpath(pjoin(dirpath, base))
            if not filt_func is None and not filt_func(depending_libpath):
                continue
            rpaths = get_rpaths(depending_libpath)
            for install_name in get_install_names(depending_libpath):
                lib_path = (install_name if install_name.startswith('@')
                            else realpath(install_name))
                lib_path = resolve_rpath(lib_path, rpaths)
                if lib_path in lib_dict:
                    lib_dict[lib_path][depending_libpath] = install_name
                else:
                    lib_dict[lib_path] = {depending_libpath: install_name}
    return lib_dict