def METHOD_NAME(path):
    """
    Obtains the set of shared libraries referenced by a Mach-O binary. Returns
    a list of Library objects.
    """
    libs = []
    proc = subprocess.Popen(
        ['otool', '-L', path],
        stdout=subprocess.PIPE,
        text=True,
    )
    for line in proc.stdout:
        # Output looks like (note that actual indent uses '\t')::
        #
        #   /path/to/input.dylib
        #       @rpath/libfoo.0.dylib <version>
        #   /usr/lib/libbar.5.dylib <version>
        #   ...
        #
        # <version> looks like '(compatibility version 1.0.0, '
        # 'current version 5.0.0)'.
        m = re.match('^\t(.*)[(]([^)]+)[)]\\s*$', line)
        if m is not None:
            path = m.group(1).strip()
            m = re.match('^compatibility version (.*), current version (.*)$',
                         m.group(2).strip())
            if m is not None:
                compat = m.group(1)
                current = m.group(2)
            else:
                compat = None
                current = None
            libs.append(
                Library(
                    path=path,
                    basename=os.path.basename(path),
                    version_compat=compat,
                    version_current=current))
    _join(proc)
    return libs