code: def test_sequence_input_feature(
      input_sequence: tuple, encoder: str, sequence_type: str
  ):
      # test assumes "sequence data" has been tokenized and converted to
      # numeric representation.  Focus of this test is primarily on
      # integration with encoder with correctly sized encoder tensor and
      # required properties are present
  
      input_sequence, idx2str = input_sequence
  
      # setup input sequence feature definition
      # use sequence_feature() to generate baseline
      # sequence definition and then augment with
      # pre-processing metadata parameters
      input_feature_def = sequence_feature(
          encoder={
              "type": encoder,
              "max_len": SEQ_SIZE,
              # augment with emulated pre-processing metadata
              "max_sequence_length": SEQ_SIZE,
              "vocab": idx2str,
          }
      )
      input_feature_def[TYPE] = sequence_type
  
      # create sequence input feature object
      feature_cls = (
          SequenceInputFeature
          if sequence_type == SEQUENCE
          else TextInputFeature
      )
      schema_cls = (
          SequenceInputFeatureConfig
          if sequence_type == SEQUENCE
          else ECDTextInputFeatureConfig
      )
      sequence_config = schema_cls.from_dict(input_feature_def)
      input_feature_obj = feature_cls(sequence_config).to(DEVICE)
  
      # confirm dtype property
      assert input_feature_obj.input_dtype == torch.int32
  
      # confirm input_shape property
      assert input_feature_obj.input_shape == (SEQ_SIZE,)
  
      # confirm output_shape property default output shape
      # from sequence_feature() function
      encoder_output = input_feature_obj(input_sequence)
      assert encoder_output[ENCODER_OUTPUT].shape == (
          BATCH_SIZE,
          *input_feature_obj.output_shape,
      )
  
imports: from typing import List, Tuple
  import numpy
  import pytest
  import torch
  import torchtext
  from ludwig.constants import ENCODER_OUTPUT, LAST_HIDDEN, LOGITS, SEQUENCE, TEXT, TYPE
  from ludwig.features.sequence_feature import _SequencePreprocessing, SequenceInputFeature, SequenceOutputFeature
  from ludwig.features.text_feature import TextInputFeature, TextOutputFeature
  from ludwig.schema.features.sequence_feature import SequenceInputFeatureConfig, SequenceOutputFeatureConfig
  from ludwig.schema.features.text_feature import ECDTextInputFeatureConfig, ECDTextOutputFeatureConfig
  from ludwig.utils.torch_utils import get_torch_device
  from tests.integration_tests.utils import ENCODERS, sequence_feature
label_desc: Use image node_id 2 for calling a global function with example usage: test_sequence_input_feature(input_sequence, encoder, sequence_type) without return types