input: 
  def compress_sequence(nums):
      output = []
      temp = [nums[0]]
      
      for i in range(1, len(nums)):
          if nums[i] * nums[i-1] >= 0:
              temp.append(nums[i])
          else:
              output.append(temp)
              temp = [nums[i]]
      output.append(temp)
      
      return output
  
  print(compress_sequence([9, -2, 6, 0, -7]))
  
output:     for i in range(len(output)):
          if len(output[i]) == 1:
              output[i] = output[i][0]
          else:
              output[i] = (len(output[i]), output[i][0])
      return output