def _SetupNodeBulk(self, num_nodes, node_fn):
    node_list = []
    key_map = {}

    for i in range(num_nodes):
      (new_node_name, new_node_uuid, new_node_key, is_master_candidate,
       is_potential_master_candidate, is_master) = \
          node_fn(i)

      self._AddNewNodeToTestData(
          new_node_name, new_node_uuid, new_node_key,
          is_potential_master_candidate, is_master_candidate,
          is_master)

      node_list.append(
          backend.SshAddNodeInfo(
              uuid=new_node_uuid,
              name=new_node_name,
              to_authorized_keys=is_master_candidate,
              to_public_keys=is_potential_master_candidate,
              get_public_keys=is_potential_master_candidate))

      key_map[new_node_name] = new_node_key

    return (node_list, key_map)
Converts a list of numbers to a list of ranges::
dataset/ETHPy150Open ganeti/ganeti/test/py/ganeti.backend_unittest.py/TestAddRemoveGenerateNodeSshKey._SetupNodeBulk--crossover with--dataset/ETHPy150Open kmike/port-for/port_for/utils.py/to_ranges