docs: def pad_sequences(sequence_vec, maxlen=None, align="end", value="N"):
      """Pad and/or trim a list of sequences to have common length. Procedure:
  
          1. Pad the sequence with N's or any other string or list element (`value`)
          2. Subset the sequence
  
      # Note
          See also: https://keras.io/preprocessing/sequence/
          Aplicable also for lists of characters
  
      # Arguments
          sequence_vec: list of chars or lists
              List of sequences that can have various lengths
          value: Neutral element to pad the sequence with. Can be `str` or `list`.
          maxlen: int or None; Final lenght of sequences.
               If None, maxlen is set to the longest sequence length.
          align: character; 'start', 'end' or 'center'
              To which end to align the sequences when triming/padding. See examples bellow.
  
      # Returns
          List of sequences of the same class as sequence_vec
  
      # Example
  
          ```python
              >>> sequence_vec = ['CTTACTCAGA', 'TCTTTA']
              >>> pad_sequences(sequence_vec, 10, align="start", value="N")
              ['CTTACTCAGA', 'TCTTTANNNN']
              >>> pad_sequences(sequence_vec, 10, align="end", value="N")
              ['CTTACTCAGA', 'NNNNTCTTTA']
              >>> pad_sequences(sequence_vec, 4, align="center", value="N")
              ['ACTC', 'CTTT']
          ```
      """
  
      # neutral element type checking
      assert isinstance(value, list) or isinstance(value, str)
      assert isinstance(value, type(sequence_vec[0]))
      assert not isinstance(sequence_vec, str)
      assert isinstance(sequence_vec[0], list) or isinstance(sequence_vec[0], str)
  
      max_seq_len = max([len(seq) for seq in sequence_vec])
  
      if maxlen is None:
          maxlen = max_seq_len
      else:
          maxlen = int(maxlen)
  
      if max_seq_len < maxlen:
          print("WARNING: Maximum sequence length (%s) is less than maxlen (%s)" % (max_seq_len, maxlen))
          max_seq_len = maxlen
  
      # check the case when len > 1
      for seq in sequence_vec:
          if not len(seq) % len(value) == 0:
              raise ValueError("All sequences need to be dividable by len(value)")
      if not maxlen % len(value) == 0:
          raise ValueError("maxlen needs to be dividable by len(value)")
  
      # pad and subset
      def pad(seq, max_seq_len, value="N", align="end"):
          seq_len = len(seq)
          assert max_seq_len >= seq_len
          if align is "end":
              n_left = max_seq_len - seq_len
              n_right = 0
          elif align is "start":
              n_right = max_seq_len - seq_len
              n_left = 0
          elif align is "center":
              n_left = (max_seq_len - seq_len) // 2 + (max_seq_len - seq_len) % 2
              n_right = (max_seq_len - seq_len) // 2
          else:
              raise ValueError("align can be of: end, start or center")
  
          # normalize for the length
          n_left = n_left // len(value)
          n_right = n_right // len(value)
  
          return value * n_left + seq + value * n_right
  
      def trim(seq, maxlen, align="end"):
          seq_len = len(seq)
  
          assert maxlen <= seq_len
          if align is "end":
              return seq[-maxlen:]
          elif align is "start":
              return seq[0:maxlen]
          elif align is "center":
              dl = seq_len - maxlen
              n_left = dl // 2 + dl % 2
              n_right = seq_len - dl // 2
              return seq[n_left:n_right]
          else:
              raise ValueError("align can be of: end, start or center")
  
      padded_sequence_vec = [pad(seq, max(max_seq_len, maxlen),
                                 value=value, align=align) for seq in sequence_vec]
      padded_sequence_vec = [trim(seq, maxlen, align=align) for seq in padded_sequence_vec]
  
      return padded_sequence_vec