code: def _get_memory_banks_listed_in_dir(path):
      
      # Such directories contain entries named "node<id>" for each memory bank
      return [int(entry[4:]) for entry in os.listdir(path) if entry.startswith('node')]
docs: Get all memory banks the kernel lists in a given directory.
      Such a directory can be /sys/devices/system/node/ (contains all memory banks)
      or /sys/devices/system/cpu/cpu*/ (contains all memory banks on the same NUMA node as that core).