input: Write a function called `process_matrix_operations` that performs various matrix operations such as addition, subtraction, multiplication, and transpose on matrix objects. The function should take two matrix objects as input and perform the specified operations on them. The function should return the modified first matrix object after performing the operations.
  assert process_matrix_operations(Matrix(2, 2, [1, 2, 3, 4]), Matrix(2, 2, [5, 6, 7, 8])).mat == [[6, 8], [10, 12]]
  assert process_matrix_operations(Matrix(2, 2, [1, 2, 3, 4]), Matrix(2, 2, [5, 6, 7, 8])).transpose().mat == [[6, 10], [8, 12]]
  assert process_matrix_operations(Matrix(2, 3, [1, 2, 3, 4, 5, 6]), Matrix(3, 2, [7, 8, 9, 10, 11, 12])).mul(Matrix(3, 2, [7, 8, 9, 10, 11, 12])).mat == [[58, 64], [139, 154]]
  assert process_matrix_operations(Matrix(2, 2, [1, 2, 3, 4]), Matrix(2, 2, [4, 3, 2, 1])).sub(Matrix(2, 2, [4, 3, 2, 1])).mat == [[-3, -1], [1, 3]]
  assert process_matrix_operations(Matrix(2, 2, [1, 2, 3, 4]), Matrix(2, 2, [4, 3, 2, 1])).add(Matrix(2, 2, [4, 3, 2, 1])).mat == [[5, 5], [5, 5]]
output: def process_matrix_operations(matrix1, matrix2):
      matrix1.add(matrix2)
      matrix1.sub(matrix2)
      matrix1.mul(matrix2)
      matrix1.transpose()
      return matrix1