code: def _get_length_sequences_where(x):
      
      if len(x) == 0:
          return [0]
      else:
          res = [len(list(group)) for value, group in itertools.groupby(x) if value == 1]
          return res if len(res) > 0 else [0]
docs: This method calculates the length of all sub-sequences where the array x is either True or 1.
  
      Examples
      --------
      >>> x = [0,1,0,0,1,1,1,0,0,1,0,1,1]
      >>> _get_length_sequences_where(x)
      >>> [1, 3, 1, 2]
  
      >>> x = [0,True,0,0,True,True,True,0,0,True,0,True,True]
      >>> _get_length_sequences_where(x)
      >>> [1, 3, 1, 2]
  
      >>> x = [0,True,0,0,1,True,1,0,0,True,0,1,True]
      >>> _get_length_sequences_where(x)
      >>> [1, 3, 1, 2]
  
      :param x: An iterable containing only 1, True, 0 and False values
      :return: A list with the length of all sub-sequences where the array is either True or False. If no ones or Trues
      contained, the list [0] is returned.