code: def __getitem__(self, index):
      if index == 0:
          return self.weights
      elif index == 1:
          return self.factors
      else:
          raise IndexError(
              f"You tried to access index {index} of a CP tensor.\n"
              "You can only access index 0 and 1 of a CP tensor"
              "(corresponding respectively to the weights and factors)"
          )
  
imports: from .None import backend
  from .base import fold, tensor_to_vec
  from ._factorized_tensor import FactorizedTensor
  from .tenalg import khatri_rao, unfolding_dot_khatri_rao
  from .metrics.factors import congruence_coefficient
  import numpy
label_desc: Use image node_id 2 for calling the CPTensor obj's underlying member method code with example usage: obj.__getitem__(index) and returns: self, self