code: def update_obj_states(obj, actuals, preds, sample_weight=None):
      obj.update_state(actuals, preds, sample_weight=sample_weight)
  
imports: import numpy
  import pytest
  import tensorflow
  from sklearn.metrics import r2_score
  from tensorflow_addons.metrics import RSquare
  from tensorflow_addons.metrics.r_square import _VALID_MULTIOUTPUT
label_desc: Use image node_id 3 for calling a global function with example usage: update_obj_states(obj, actuals, preds, sample_weight) without return types