input: Write a function called compress_sequence that takes a list of integers as input and returns a list of lists where each sublist contains consecutive elements from the input list that share the same sign. If the element is zero, it should be grouped with the previous consecutive positive or negative sequence if it exists. The function should handle the case where the input list is empty by returning an empty list. 
  
  def compress_sequence(nums):
      output = []
      temp = []
  
      for i in range(1, len(nums)):
          if nums[i-1] * nums[i] >= 0:
              temp.append(nums[i-1])
          else:
              temp.append(nums[i-1])
              output.append(temp)
              temp = []
      temp.append(nums[i])
      output.append(temp)
  
      return output
  
  assert compress_sequence([9, -2, 6, 0, -7]) == [[9], [-2], [6, 0], [-7]]
  assert compress_sequence([1, 2, 3, -1, -2, -3]) == [[1, 2, 3], [-1, -2, -3]]
  assert compress_sequence([]) == []
  assert compress_sequence([0]) == [[0]]
  assert compress_sequence([0, 0, 0]) == [[0, 0, 0]]
output: def compress_sequence(nums):
      output = []
      temp = []
  
      for i in range(len(nums)):
          if temp and (nums[i] * temp[-1] >= 0):
              temp.append(nums[i])
          else:
              if temp:
                  output.append(temp)
              temp = [nums[i]]
      if temp:
          output.append(temp)
  
      return output