def my_cached_func(a, b):
    ...
For more information, see Improve app performance.
How to fix the Cached Object Mutated warning
By default Streamlit expects its cached values to be treated as immutable -- that cached objects remain constant. You received this warning if your code modified a cached object (see Example 5 in Caching). When this happens, you have a few options:
If you don't understand why you're seeing this error, it's very likely that you didn't mean to mutate the cached value in the first place. So you should either:
Preferred: rewrite your code to remove that mutation
Clone the output of the cached function before mutating it. For example:
python
  import copy
  cloned_output = copy.deepcopy(my_cached_function(...))
If you wanted to allow the cached object to mutate, you can disable this check by setting allow_output_mutation=True like this:
