code: def test_factor_orthogonality():
      """Tests that components are orthogonal."""
      x, y, _, _ = _get_standard_synthetic()
      pls = CP_PLSR(n_components=N_LATENT)
      pls.fit(x, y)
      x_cp = CPTensor((None, pls.X_factors))
      x_cp = cp_normalize(x_cp)
  
      for component_1 in range(x_cp.rank):
          for component_2 in range(component_1 + 1, x_cp.rank):
              factor_product = 1
              for factor in x_cp.factors:
                  factor_product *= np.dot(
                      factor[:, component_1], factor[:, component_2]
                  )
              assert abs(factor_product) < 1e-8
  
imports: import numpy
  import pytest
  import tensorly
  from ...testing import assert_allclose
  from ...cp_tensor import CPTensor, cp_normalize, cp_to_tensor
  from ...metrics.factors import congruence_coefficient
  from ...random import random_cp
  from ..cp_plsr import CP_PLSR
label_desc: Use image node_id 5 for calling a global function with example usage: test_factor_orthogonality() without return types