code: def create_input_array(
      sequences: Collection,
      max_input_length: int,
      reverse_input: bool,
      batch_size: int,
      input_dict: Dict,
      end_mark: Any,
  ):
      """Create the array describing the input sequences.
  
      It creates a 2d Matrix empty matrix according to batch size and max_length.
      Then iteratively fills it with the key-values from the input dictionary.
  
      Many NLP Models like SeqToSeq has sentences as there inputs. We need to
      convert these sentences into numbers so that the model can do computation
      on them.
  
      This function takes in the sentence then using the `input_dict` dictionary
      picks up the words/letters equivalent numerical represntation. Then makes
      an numpy array of it.
  
      If the `reverse_input` is True, then the order of the input sequences is
      reversed before sending them into the encoder. This can improve performance
      when working with long sequences.
  
      These values can be used to generate embeddings for further processing.
  
      Models used in:
  
      * SeqToSeq
  
      Parameters
      ----------
      sequences: Collection
          List of sequences to be converted into input array.
      reverse_input: bool
          If True, reverse the order of input sequences before sending them into
          the encoder. This can improve performance when working with long sequences.
      batch_size: int
          Batch size of the input array.
      input_dict: dict
          Dictionary containing the key-value pairs of input sequences.
      end_mark: Any
          End mark for the input sequences.
  
      Returns
      -------
      features: np.Array
          Numeric Representation of the given sequence according to input_dict.
  
      Examples
      --------
      >>> import deepchem as dc
      >>> # Prepare Data
      >>> inputs = [["a", "b"], ["b", "b", "b"]]
      >>> input_dict = {"c": 0, "a": 1, "b": 2}
      >>> # Inputs property
      >>> max_length = max([len(x) for x in inputs])
      >>> # Without reverse input
      >>> output_1 = dc.utils.batch_utils.create_input_array(inputs, max_length,
      ...                                                    False, 2, input_dict,
      ...                                                    "c")
      >>> output_1.shape
      (2, 4)
      >>> # With revercse input
      >>> output_2 = dc.utils.batch_utils.create_input_array(inputs, max_length,
      ...                                                    True, 2, input_dict,
      ...                                                    "c")
      >>> output_2.shape
      (2, 4)
  
      """
      lengths = [len(x) for x in sequences]
      if reverse_input:
          sequences = [reversed(s) for s in sequences]
      features = np.zeros(
          (batch_size, max_input_length + 1), dtype=np.float32
      )
      for i, sequence in enumerate(sequences):
          for j, token in enumerate(sequence):
              features[i, j] = input_dict[token]
      features[np.arange(len(sequences)), lengths] = input_dict[
          end_mark
      ]
      return features
  
imports: import numpy
  from typing import Any, Dict, Collection, List
label_desc: Use image node_id 3 for calling a global function with example usage: create_input_array(sequences, max_input_length, reverse_input, batch_size, input_dict, end_mark) and returns: features