code: def pad_features_with_feat_spec(
      input_ids: List[int],
      input_mask: List[int],
      unpadded_segment_ids: List[int],
      feat_spec: FeaturizationSpec,
  ):
      """Apply padding to feature set according to settings from FeaturizationSpec.
  
      Args:
          input_ids (List[int]): sequence unpadded input ids.
          input_mask (List[int]): unpadded input mask sequence.
          unpadded_segment_ids (List[int]): sequence of unpadded segment ids.
          feat_spec (FeaturizationSpec): Tokenization-related metadata.
  
      Returns:
          InputSet: input set containing padded input ids, input mask, and segment ids.
  
      """
      return InputSet(
          input_ids=pad_single_with_feat_spec(
              ls=input_ids,
              feat_spec=feat_spec,
              pad_idx=feat_spec.pad_token_id,
          ),
          input_mask=pad_single_with_feat_spec(
              ls=input_mask,
              feat_spec=feat_spec,
              pad_idx=feat_spec.pad_token_mask_id,
          ),
          segment_ids=pad_single_with_feat_spec(
              ls=unpadded_segment_ids,
              feat_spec=feat_spec,
              pad_idx=feat_spec.pad_token_segment_id,
          ),
      )
  
imports: import numpy
  from dataclasses import dataclass
  from typing import List, NamedTuple
  from jiant.tasks.core import FeaturizationSpec
  from jiant.tasks.utils import truncate_sequences, pad_to_max_seq_length
  from jiant.utils.python.datastructures import BiMap
label_desc: Use image node_id 8 for calling a global function with example usage: pad_features_with_feat_spec(input_ids, input_mask, unpadded_segment_ids, feat_spec) and returns: InputSet