code: def get_lengths(self, y_true):
      lengths = []
      for y in np.argmax(y_true, -1):
          try:
              i = list(y).index(0)
          except ValueError:
              i = len(y)
          lengths.append(i)
  
      return lengths
  
imports: from ....imports import *
  from ..None import metrics
label_desc: Use image node_id 2 for calling the F1score obj's underlying member method code with example usage: obj.get_lengths(y_true) and returns: lengths