def open_sysfs_numa_stats():
    """Returns a possibly empty list of opened files."""
    try:
        nodes = os.listdir(NUMADIR)
    except __HOLE__, (errno, msg):
        if errno == 2:  # No such file or directory
            return []   # We don't have NUMA stats.
        raise

    nodes = [node for node in nodes if node.startswith("node")]
    numastats = []
    for node in nodes:
        try:
            numastats.append(open(os.path.join(NUMADIR, node, "numastat")))
        except OSError, (errno, msg):
            if errno == 2:  # No such file or directory
                continue
            raise
    return numastats
dataset/ETHPy150Open scalyr/scalyr-agent-2/scalyr_agent/third_party/tcollector/collectors/0/procstats.py/open_sysfs_numa_stats