code: def _respect_weak_type(dtype, weak_type):
      """Return the weak dtype of `dtype` if `weak_type==True`."""
      if weak_type:
          if dtype == "bool":
              return dtype
          elif "float" in dtype:
              return "float"
          elif "int" in dtype:
              return "int"
          else:
              raise ValueError(
                  "Invalid value for argument `dtype`. Expected one of "
                  f"{ALLOWED_DTYPES}. Received: dtype={dtype}"
              )
      return dtype
  
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 5 for calling a global function with example usage: _respect_weak_type(dtype, weak_type) and returns: dtype, dtype, str, str