Pad the data in DataFrame with [None} to ensure that all columns have the same length.

        :param max_len: If provided will extend all columns to this length, if not then will use the longest column
        :return: nothing
348110
def _pad_data(self, max_len=None):
        
        if not max_len:
            max_len = max([len(x) for x in self._data])
        for _, col in enumerate(self._data):
            col.extend([None] * (max_len - len(col)))
782862
def check_columns(column, line, columns):
    
    return column <= min(len(line), max(columns))
1227316
def setMaximumLength( self, length ):
        
        self._maximumLength = length
        self._filenames = self._filenames[:length]
        self.refresh()
764567
def max_column_widths(columns, header, opts = {})
      row_column_widths = columns.map do |c| 
        c.reduce(0) { |m, v| [m, v.nil? ? 0 : v.length].max }
      end

      header_column_widths = header.map { |h| h.length }

      row_column_widths = header_column_widths if row_column_widths.empty?

      widths = row_column_widths.zip(header_column_widths).map do |column|
        column.reduce(0) { |m, v| [m, v].max }
      end

      widths.empty? ? [] : scale_widths(widths, opts)
    end
408005
def length_range(string, minimum, maximum):
    
    int_range(len(string), minimum, maximum)
    return string
88160
def _maxlength(X):
    
    return np.fromiter((map(lambda x: len(x), X)), dtype=int).max()
1061493
def max_value_length(cls):
        
        if not hasattr(cls, '__max_value_length_'):
            cls.__max_value_length_ = max([len(c.value) for c in list(cls)])
        return cls.__max_value_length_
147296
def width_max(self, width_max):
        
        if width_max is None:
            self._width_limits[1] = None
            return

        width_max = float(width_max)
        assert(self.width_min <= width_max)

        self._width_limits[1] = width_max
        self._update_layout()
914256
def max_length_discard(records, max_length):
    
    logging.info('Applying _max_length_discard generator: '
                 'discarding records longer than '
                 '.')
    for record in records:
        if len(record) > max_length:
            # Discard
            logging.debug('Discarding long sequence: %s, length=%d',
                record.id, len(record))
        else:
            yield record
863280
def block_lengths(self):
        
        if self._lengths_cache is None:
            # The first column will have the correct lengths. We have an
            # invariant that requires that all blocks be the same length in a
            # row of blocks.
            self._lengths_cache = (
                [obj.length() for obj in self._partitions_cache.T[0]]
                if len(self._partitions_cache.T) > 0
                else []
            )
        return self._lengths_cache
230500
def limit(self, r=5):
        
        try:
            self.df = self.df[:r]
        except Exception as e:
            self.err(e, "Can not limit data")
1139600
final int getColumnMaxSize(int index) {
        if (m_extraMetadata != null) {
            return m_extraMetadata.originalColumnInfos[index].size;
        }
        return VoltType.MAX_VALUE_LENGTH;
    }
1197774
def _pad_arrs_to_max_length(arrs, pad_axis, pad_val, use_shared_mem, dtype):
    
    if isinstance(arrs[0], mx.nd.NDArray):
        dtype = arrs[0].dtype if dtype is None else dtype
        arrs = [arr.asnumpy() for arr in arrs]
    elif not isinstance(arrs[0], np.ndarray):
        arrs = [np.asarray(ele) for ele in arrs]
    else:
        dtype = arrs[0].dtype if dtype is None else dtype

    original_length = [ele.shape[pad_axis] for ele in arrs]
    max_size = max(original_length)

    ret_shape = list(arrs[0].shape)
    ret_shape[pad_axis] = max_size
    ret_shape = (len(arrs), ) + tuple(ret_shape)

    ret = np.full(shape=ret_shape, fill_value=pad_val, dtype=dtype)

    for i, arr in enumerate(arrs):
        if arr.shape[pad_axis] == max_size:
            ret[i] = arr
        else:
            slices = [slice(None) for _ in range(arr.ndim)]
            slices[pad_axis] = slice(0, arr.shape[pad_axis])
            if slices[pad_axis].start != slices[pad_axis].stop:
                slices = [slice(i, i + 1)] + slices
                ret[tuple(slices)] = arr

    ctx = mx.Context('cpu_shared', 0) if use_shared_mem else mx.cpu()
    ret = mx.nd.array(ret, ctx=ctx, dtype=dtype)
    original_length = mx.nd.array(original_length, ctx=ctx, dtype=np.int32)

    return ret, original_length
1102714
def pad(self, data, block_size):
		
		pad_byte = block_size - (len(data) % block_size)
		return data + bytes([pad_byte] * pad_byte)
918030
def get_max_seq_len(self) -> Optional[int]:
        
        max_seq_len = min((encoder.get_max_seq_len()
                           for encoder in self.encoders if encoder.get_max_seq_len() is not None), default=None)
        return max_seq_len
1120444
def _check_column_lengths(self):
        
        column_lengths_dict = {
            name: len(xs)
            for (name, xs)
            in self.columns_dict.items()
        }
        unique_column_lengths = set(column_lengths_dict.values())
        if len(unique_column_lengths) != 1:
            raise ValueError(
                "Mismatch between lengths of columns: %s" % (column_lengths_dict,))
2951
def _max_lengths():
    
    max_header_length = max([len(x.byte_match) + x.offset
                             for x in magic_header_array])
    max_footer_length = max([len(x.byte_match) + abs(x.offset)
                             for x in magic_footer_array])
    return max_header_length, max_footer_length