code: def _get_span_lengths(self, x):
      span_lengths = []
      curr_len = 0
      for i in range(1, len(x)):
          # 1 -> 0
          if x[i] == 0 and x[i - 1] == 1:
              span_lengths.append(curr_len)
              curr_len = 0
          # 1 -> 1 or 0 -> 1
          elif (x[i] == 1 and x[i - 1] == 1) or (
              x[i] == 1 and x[i - 1] == 0
          ):
              curr_len += 1
      if curr_len != 0:
          span_lengths.append(curr_len)
      return span_lengths
  
imports: import itertools
  import os
  from absl.testing import absltest
  from absl.testing import parameterized
  import numpy
  from trax import data
label_desc: Use image node_id 34 for calling the InputsTest obj's underlying member method code with example usage: obj._get_span_lengths(x) and returns: span_lengths