keras/src/trainers/compile_utils.py/is_function_like
def is_function_like(value):
    if value is None:
        return True
    if isinstance(value, str):
        return True
    if callable(value):
        return True
    return False