<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _get_length_sequences_where(x):
 """ This method calculates the length of all sub-sequences where the array x is either True or 1. Examples -------- :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. """

    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]