def METHOD_NAME(executable, imports=True):
    """
    Parse an ELF executable and return a list of (symbol,version) tuples
    for dynamic, imported symbols.
    """
    p = subprocess.Popen(
        [READELF_CMD, "--dyn-syms", "-W", "-h", executable],
        stdout=subprocess.PIPE,
        stderr=subprocess.PIPE,
        stdin=subprocess.PIPE,
        universal_newlines=True,
    )
    (stdout, stderr) = p.communicate()
    if p.returncode:
        raise IOError(
            "Could not read symbols for %s: %s" % (executable, stderr.strip())
        )
    syms = []
    for line in stdout.splitlines():
        line = line.split()
        if "Machine:" in line:
            arch = line[-1]
        if len(line) > 7 and re.match("[0-9]+:$", line[0]):
            (sym, _, version) = line[7].partition("@")
            is_import = line[6] == "UND"
            if version.startswith("@"):
                version = version[1:]
            if is_import == imports:
                syms.append((sym, version, arch))
    return syms