input: def compress_sequence(nums):
      """ Compresses a given data sequence into sublists where each sublist
      contains only positive or only negative numbers.
      >>> compress_sequence([9, -2, 6, 0, -7])
      [[9], [-2, 6, 0], [-7]]
      """
output:     result = []
      current_sublist = []
      for num in nums:
          if not current_sublist or (num > 0 and current_sublist[0] > 0) or (num < 0 and current_sublist[0] < 0):
              current_sublist.append(num)
          else:
              result.append(current_sublist)
              current_sublist = [num]
      if current_sublist:
          result.append(current_sublist)
      return result