def find_sysfs_numa_stats():
 try:
  nodes = os.listdir(NUMADIR)
 except OSError as (errno, msg):
  if (errno == 2):
   return []
  raise
 nodes = [node for node in nodes if node.startswith('node')]
 numastats = []
 for node in nodes:
  try:
   numastats.append(os.path.join(NUMADIR, node, 'numastat'))
  except OSError as (errno, msg):
   if (errno == 2):
    continue
   raise
 return numastats

def find_sysfs_numa_stats ( ) : try : nodes = os . listdir ( NUMADIR ) except OSError as ( errno , msg ) : if ( errno == 2 ) : return [ ] raise nodes = [ node for node in nodes if node . startswith ( 'node' ) ] numastats = [ ] for node in nodes : try : numastats . append ( os . path . join ( NUMADIR , node , 'numastat' ) ) except OSError as ( errno , msg ) : if ( errno == 2 ) : continue raise return numastats
returns a possibly empty list of numa stat file names .