code: def _flatten_y(self, y):
      if isinstance(y, dict) and self.output_names:
          result = []
          for name in self.output_names:
              if name in y:
                  result.append(y[name])
          return result
      return tree.flatten(y)
  
imports: import tree
  from keras import backend
  from keras import losses
  from keras import metrics
  from keras import ops
  from keras.utils.naming import get_object_name
label_desc: Use image node_id 4 for calling the CompileLoss obj's underlying member method code with example usage: obj._flatten_y(y) and returns: tree, result