input: def compress_sequence(nums):
      """Compresses a given data sequence by grouping consecutive numbers with the same sign.
      If two consecutive numbers have the same sign (both positive or both negative), they are grouped together.
      If the signs differ, a new group is started.
      The sequence is divided into these groups and returned as a list of lists.
      Example:
      >>> compress_sequence([9, -2, 6, 0, -7])
      [[9], [-2, 6, 0], [-7]]
      """
      output = []
      temp = [nums[0]]
  
      for i in range(1, len(nums)):
          if nums[i-1] * nums[i] >= 0:
              temp.append(nums[i])
          else:
              output.append(temp)
              temp = [nums[i]]
      output.append(temp)
  
      return output
output:     output = []
      temp = [nums[0]]
  
      for i in range(1, len(nums)):
          if nums[i-1] * nums[i] >= 0:
              temp.append(nums[i])
          else:
              output.append(temp)
              temp = [nums[i]]
      output.append(temp)
  
      return output