code: def _make_lattice_upper_bounds():
      lattice = _type_promotion_lattice()
      upper_bounds = {node: {node} for node in lattice}
      for n in lattice:
          while True:
              new_upper_bounds = set().union(
                  *(lattice[b] for b in upper_bounds[n])
              )
              if n in new_upper_bounds:
                  raise ValueError(
                      f"cycle detected in type promotion lattice for node {n}"
                  )
              if new_upper_bounds.issubset(upper_bounds[n]):
                  break
              upper_bounds[n] |= new_upper_bounds
      return upper_bounds
  
file_path: keras/keras/backend/common/dtypes.py
imports: import functools
  from keras import backend
  from keras.api_export import keras_export
  from keras.backend.common.variables import ALLOWED_DTYPES
  from keras.backend.common.variables import standardize_dtype
label_desc: Use image node_id 2 for calling a global function with example usage: _make_lattice_upper_bounds() and returns: upper_bounds