Returns list of the number of cores for each host requested in hosts.

def GetNumCoresOnHosts(hosts, private_key):
  """ Returns list of the number of cores for each host requested in hosts. """
  results = runner.Runner(host_list=hosts, private_key=private_key,
                          module_name='setup').run()
  num_cores_list = []
  for _, props in results['contacted'].iteritems():
    cores = props['ansible_facts']['ansible_processor_cores']
    val = 0
    try:
      val = int(cores)
    except ValueError:
      pass
    num_cores_list.append(val)
  return num_cores_list