code: def attempt_to_load_balance(
      remote_function,
      args,
      total_tasks,
      num_nodes,
      minimum_count,
      num_attempts=100,
  ):
      attempts = 0
      while attempts < num_attempts:
          locations = ray.get(
              [
                  remote_function.remote(*args)
                  for _ in range(total_tasks)
              ]
          )
          counts = collections.Counter(locations)
          print(f"Counts are {counts}")
          if (
              len(counts) == num_nodes
              and counts.most_common()[-1][1] >= minimum_count
          ):
              break
          attempts += 1
      assert attempts < num_attempts
  
imports: import collections
  import logging
  import platform
  import subprocess
  import sys
  import time
  import unittest
  import numpy
  import pytest
  import ray
  import ray.cluster_utils
  import ray.util.accelerators
  from ray._private.internal_api import memory_summary
  from ray.util.scheduling_strategies import PlacementGroupSchedulingStrategy
  from ray._private.test_utils import Semaphore, SignalActor, object_memory_usage, get_metric_check_condition, wait_for_condition, MetricSamplePattern
label_desc: Use image node_id 1 for calling a global function with example usage: attempt_to_load_balance(remote_function, args, total_tasks, num_nodes, minimum_count, num_attempts) without return types