code: def _pad(
      data: List[List[Union[int, float]]], value: Union[int, float] = 0
  ):
      max_len = max(map(len, data))
      res = np.ones([len(data), max_len], dtype=type(value)) * value
      for i, item in enumerate(data):
          res[i][: len(item)] = item
      return res
  
file_path: DeepPavlov/deeppavlov/models/preprocessors/transformers_preprocessor.py
imports: from logging import getLogger
  from typing import List, Union, Tuple
  import numpy
  from transformers import BertTokenizer
  from deeppavlov.core.commands.utils import expand_path
  from deeppavlov.core.common.registry import register
  from deeppavlov.core.models.component import Component
label_desc: Use image node_id 1 for calling a global function with example usage: _pad(data, value) and returns: res