code: def fit_transform_assert(
      input_data: DataFrame,
      generator: AbstractFeatureGenerator,
      feature_metadata_in: FeatureMetadata = None,
      expected_feature_metadata_in_full: dict = None,
      expected_feature_metadata_full: dict = None,
  ):
      # Given
      original_input_data = copy.deepcopy(input_data)
  
      # Raise exception
      with pytest.raises(AssertionError):
          # Can't call transform before fit_transform
          generator.transform(input_data)
  
      if len(input_data.columns) > 0:
          # Raise exception
          with pytest.raises(AssertionError):
              input_data_with_duplicate_columns = pd.concat(
                  [input_data, input_data], axis=1
              )
              # Can't call fit_transform with duplicate column names
              generator.fit_transform(
                  input_data_with_duplicate_columns,
                  feature_metadata_in=feature_metadata_in,
              )
  
      assert not generator.is_fit()
      output_data = generator.fit_transform(
          input_data, feature_metadata_in=feature_metadata_in
      )
      assert generator.is_fit()
      with pytest.raises(AssertionError):
          # Can't call fit_transform after fit
          generator.fit_transform(
              input_data, feature_metadata_in=feature_metadata_in
          )
  
      # Ensure input_data is not altered inplace by fit_transform
      assert input_data.equals(original_input_data)
  
      # Ensure unchanged row count
      assert len(input_data) == len(output_data)
  
      # Ensure transform and fit_transform output are the same for training data
      output_data_transform = generator.transform(input_data)
      assert output_data.equals(output_data_transform)
  
      # Ensure input_data is not altered inplace by transform
      assert input_data.equals(original_input_data)
  
      # Ensure transform will be the same if unnecessary columns are removed from input
      input_data_features_in = input_data[generator.features_in]
      original_input_data_features_in = copy.deepcopy(
          input_data_features_in
      )
      output_data_transform = generator.transform(
          input_data_features_in
      )
      assert output_data.equals(output_data_transform)
  
      # Ensure input_data is not altered inplace by transform when features_in match exactly
      assert input_data_features_in.equals(
          original_input_data_features_in
      )
  
      # Ensure transform will be the same if input feature order is not the same as generator.features_in
      reversed_column_names = list(input_data.columns)
      reversed_column_names.reverse()
      input_data_reversed = input_data[reversed_column_names]
      original_input_data_reversed = copy.deepcopy(input_data_reversed)
      output_data_transform = generator.transform(input_data_reversed)
      assert output_data.equals(output_data_transform)
  
      # Ensure input_data is not altered inplace by transform when column order is reversed
      assert input_data_reversed.equals(original_input_data_reversed)
  
      # Ensure output feature order is correct
      assert generator.features_out == list(output_data.columns)
  
      if generator.features_in:
          with pytest.raises(KeyError):
              # Error if missing input feature
              generator.transform(
                  input_data.drop(generator.features_in[0])
              )
          with pytest.raises(KeyError):
              # Error if missing all input features
              generator.transform(pd.DataFrame())
  
      # Ensure unknown input columns don't affect output
      input_data_with_extra = copy.deepcopy(input_data)
      input_data_with_extra["__UNKNOWN_COLUMN__"] = 0
      original_input_data_with_extra = copy.deepcopy(
          input_data_with_extra
      )
      output_data_transform = generator.transform(input_data_with_extra)
      assert output_data.equals(output_data_transform)
  
      # Ensure input_data is not altered inplace by transform when extra columns are present
      assert input_data_with_extra.equals(
          original_input_data_with_extra
      )
  
      # Ensure feature_metadata_in is as expected
      if expected_feature_metadata_in_full is not None:
          assert (
              expected_feature_metadata_in_full
              == generator.feature_metadata_in.to_dict(inverse=True)
          )
      # Ensure feature_metadata is as expected
      if expected_feature_metadata_full is not None:
          assert (
              expected_feature_metadata_full
              == generator.feature_metadata.to_dict(inverse=True)
          )
  
      return output_data
  
imports: import copy
  import numpy
  import pandas
  import pytest
  from pandas import DataFrame, Series
  from autogluon.common.features.feature_metadata import FeatureMetadata
  from autogluon.features.generators import AbstractFeatureGenerator
label_desc: Use image node_id 1 for calling the GeneratorHelper obj's underlying member method code with example usage: obj.fit_transform_assert(input_data, generator, feature_metadata_in, expected_feature_metadata_in_full, expected_feature_metadata_full) and returns: output_data