code: def test_AddFeatByKey(self):
      add_to_x = [False, True]
      feat_name = ["y", "none"]
      strict = [False, True]
      input_nc_feat = [None, 1, 2]
  
      c = 0
      for atx in add_to_x:
          for fn in feat_name:
              for ine in input_nc_feat:
                  for s in strict:
                      fn_none = False
                      ine_2 = False
                      try:
                          data = Data(
                              x=torch.randn((10)),
                              pos=torch.randn((10)),
                              y=torch.randn((10)),
                          )
                          transform = AddFeatByKey(
                              atx, fn, input_nc_feat=ine, strict=s
                          )
                          data = transform(data)
                      except Exception:
                          if fn == "none":
                              fn_none = True
                          if ine == 2:
                              ine_2 = True
  
                      if fn_none or ine_2:
                          c += 1
                          continue
  
                      if not atx:
                          self.assertEqual(
                              data.x.shape, torch.Size([10])
                          )
                      else:
                          if fn == "none":
                              self.assertEqual(
                                  data.x.shape, torch.Size([10])
                              )
                          else:
                              self.assertEqual(
                                  data.x.shape, torch.Size([10, 2])
                              )
  
                      c += 1
  
imports: import unittest
  import sys
  import os
  import torch_geometric.transforms
  import numpy
  import numpy.testing
  import torch
  from torch_geometric.data import Data
  from omegaconf.dictconfig import DictConfig
  from omegaconf.listconfig import ListConfig
  from omegaconf import OmegaConf
  from torch_points3d.core.data_transform import instantiate_transform, instantiate_transforms, GridSampling3D, MultiScaleTransform, Random3AxisRotation, AddFeatByKey, AddFeatsByKeys, RemoveAttributes, RandomDropout, ShiftVoxels, PCACompute, RandomCoordsFlip, XYZFeature, ScalePos, RandomWalkDropout, NormalizeFeature, SphereCrop, CubeCrop, RandomSphereDropout, DensityFilter, LotteryTransform, ClampBatchSize, RandomParamTransform, Select, ComposeTransform
  from torch_points3d.core.spatial_ops import RadiusNeighbourFinder, KNNInterpolate
  from torch_points3d.utils.enums import ConvolutionFormat
  from torch_points3d.datasets.multiscale_data import MultiScaleBatch
label_desc: Use image node_id 4 for calling the Testhelpers obj's underlying member method code with example usage: obj.test_AddFeatByKey() without return types