class_docstr: Shape the sequence of indices to a fixed length.
  If the original sequence is longer than the target length, it will be truncated from
  the beginning or the end.
  If the original sequence is shorter than the target length, it will be padded to the end.
  Need to word2idx first.
  The original indices sequence will be replaced by the shaped sequence.
  
  # Arguments
  len: Positive int. The target length.
  trunc_mode: Truncation mode. String. Either 'pre' or 'post'. Default is 'pre'.
              If 'pre', the sequence will be truncated from the beginning.
              If 'post', the sequence will be truncated from the end.
  pad_element: Int. The element to be padded to the sequence if the original length is
               smaller than the target length.
               Default is 0 with the convention that we reserve index 0 for unknown words.
  >>> sequence_shaper = SequenceShaper(len=6, trunc_mode="post", pad_element=10000)
  creating: createSequenceShaper
class_docstr_tok: ["Shape","the","sequence","of","indices","to","a","fixed","length",".","If","the","original","sequence","is","longer","than","the","target","length",",","it","will","be","truncated","from","the","beginning","or","the","end",".","If","the","original","sequence","is","shorter","than","the","target","length",",","it","will","be","padded","to","the","end",".","Need","to","word2idx","first",".","The","original","indices","sequence","will","be","replaced","by","the","shaped","sequence",".","#","Arguments","len",":","Positive","int",".","The","target","length",".","trunc_mode",":","Truncation","mode",".","String",".","Either","'pre","'","or","'post","'",".","Default","is","'pre","'",".","If","'pre","'",",","the","sequence","will","be","truncated","from","the","beginning",".","If","'post","'",",","the","sequence","will","be","truncated","from","the","end",".","pad_element",":","Int",".","The","element","to","be","padded","to","the","sequence","if","the","original","length","is","smaller","than","the","target","length",".","Default","is","0","with","the","convention","that","we","reserve","index","0","for","unknown","words",".",">",">",">","sequence_shaper","=","SequenceShaper","(","len=6",",","trunc_mode=","''","post","''",",","pad_element=10000",")","creating",":","createSequenceShaper"]
code: def __init__(
      self, len, trunc_mode="pre", pad_element=0, bigdl_type="float"
  ):
      assert isinstance(
          pad_element, int
      ), "pad_element should be an int"
      super(SequenceShaper, self).__init__(
          bigdl_type, len, trunc_mode, pad_element
      )
  
imports: import sys
  import six
  from zoo.feature.common import Preprocessing
  from zoo.feature.text import TextFeature
  from zoo.common.utils import callZooFunc
label_desc: Use image node_id 1 to create a new SequenceShaper object from inherited base classes: TextTransformer with example: obj = SequenceShaper(len, trunc_mode, pad_element, bigdl_type)