class_docstr: Cache up to some maximum count given a grouping key.
  
  This object cache can e.g. be used to cache Ray Tune trainable actors
  given their resource requirements (reuse_actors=True).
  
  If the max number of cached objects for a grouping key is reached,
  no more objects for this group will be cached.
  
  However, if `may_keep_one=True`, one object (globally across all grouping
  keys) may be cached, even if the max number of objects is 0. This is to
  allow to cache an object if the max number of objects of this key
  will increase shortly after (as is the case e.g. in the Ray Tune control
  loop).
  
  Args:
      may_keep_one: If True, one object (globally) may be cached if no desired
          maximum objects are defined.
code: def total_max_objects(self):
      # Counter.total() is only available for python 3.10+
      return sum(self._max_num_objects.values())
  
file_path: ray/python/ray/tune/utils/object_cache.py
imports: from collections import defaultdict, Counter
  from typing import Dict, Generator, List, Optional, TypeVar
label_desc: Use image node_id 3 for calling the _ObjectCache obj's underlying member method code with example usage: obj.total_max_objects() and returns: sum