code: def test_FixedLengthSequenceDenseNormalization(
      self, Preprocessor
  ) -> None:
      # test key mapping
      rand_gen = torch.Generator().manual_seed(0)
  
      a_batch_size = 2
      b_batch_size = 3
  
      a_dim = 13
      b_dim = 11
  
      expected_length = 7
  
      a_T = (
          torch.rand(
              a_batch_size * expected_length, a_dim, generator=rand_gen
          ),  # value
          torch.rand(
              a_batch_size * expected_length, a_dim, generator=rand_gen
          )
          > 0.5,  # presence
      )
      b_T = (
          torch.rand(
              b_batch_size * expected_length, b_dim, generator=rand_gen
          ),  # value
          torch.rand(
              b_batch_size * expected_length, b_dim, generator=rand_gen
          )
          > 0.5,  # presence
      )
  
      # expected values after preprocessing
      a_TN = a_T[0] + 1
      b_TN = b_T[0] + 1
  
      # copy used for checking inplace modifications
      a_TN_copy = deepcopy(a_TN)
      b_TN_copy = deepcopy(b_TN)
  
      a_offsets = torch.arange(
          0, a_batch_size * expected_length, expected_length
      )
      b_offsets = torch.arange(
          0, b_batch_size * expected_length, expected_length
      )
  
      a_in = {1: (a_offsets, a_T), 2: 0}
      b_in = {1: (b_offsets, b_T), 2: 1}
  
      c_out = 2
  
      # input data
      data = {"a": a_in, "b": b_in, "c": c_out}
  
      # copy used for checking inplace modifications
      data_copy = deepcopy(data)
  
      Preprocessor.return_value = Mock(side_effect=[a_TN, b_TN])
  
      flsdn = transforms.FixedLengthSequenceDenseNormalization(
          keys=["a", "b"],
          sequence_id=1,
          normalization_data=Mock(),
      )
  
      out = flsdn(data)
  
      # data is modified inplace and returned
      self.assertEqual(data, out)
  
      # check preprocessor number of calls
      self.assertEqual(Preprocessor.call_count, 1)
      self.assertEqual(Preprocessor.return_value.call_count, 2)
  
      # result contains original keys and new processed keys
      self.assertSetEqual(
          set(out.keys()), {"a", "b", "c", "a:1", "b:1"}
      )
  
      def assertKeySeqIdItem(item_0, item_1):
          self.assertTorchTensorEqual(item_0[0], item_1[0])
          self.assertTorchTensorEqual(item_0[1][0], item_1[1][0])
          self.assertTorchTensorEqual(item_0[1][1], item_1[1][1])
  
      # original keys should keep their value
      for key in ("a", "b"):
          # no change in the output
          # pyre-fixme[16]: Item `int` of `Union[Dict[int,
          #  typing.Union[typing.Tuple[torch.Tensor, typing.Tuple[typing.Any,
          #  typing.Any]], int]], int]` has no attribute `__getitem__`.
          assertKeySeqIdItem(out[key][1], data_copy[key][1])
  
          # no change in untouched seq id
          # pyre-fixme[16]: Item `int` of `Union[Dict[int,
          #  typing.Union[typing.Tuple[torch.Tensor, typing.Tuple[typing.Any,
          #  typing.Any]], int]], int]` has no attribute `__getitem__`.
          self.assertEqual(out[key][2], data_copy[key][2])
  
      # no change in the non-processed key
      self.assertEqual(out["c"], data_copy["c"])
  
      # check output shapes
      self.assertListEqual(
          [*out["a:1"].shape], [a_batch_size, expected_length, a_dim]
      )
      self.assertListEqual(
          [*out["b:1"].shape], [b_batch_size, expected_length, b_dim]
      )
  
      # no inplace change in normalized tensors
      self.assertTorchTensorEqual(a_TN, a_TN_copy)
      self.assertTorchTensorEqual(b_TN, b_TN_copy)
  
      # check if output has been properly slated
      self.assertTorchTensorEqual(
          out["a:1"], a_TN.view(a_batch_size, expected_length, a_dim)
      )
      self.assertTorchTensorEqual(
          out["b:1"], b_TN.view(b_batch_size, expected_length, b_dim)
      )
  
imports: import os
  import unittest
  from copy import deepcopy
  from typing import List
  from unittest.mock import Mock, patch
  import numpy
  import reagent.core.types
  import torch
  from reagent.preprocessing import transforms
  from reagent.preprocessing.types import InputColumn
label_desc: Use image node_id 14 for calling the TestTransforms obj's underlying member method code with example usage: obj.test_FixedLengthSequenceDenseNormalization(Preprocessor) without return types