class_docstr: The :obj:`Layout` class id designed for processing a list of layout elements
  on a page. It stores the layout elements in a list and the related `page_data`,
  and provides handy APIs for processing all the layout elements in batch. `
  
  Args:
      blocks (:obj:`list`):
          A list of layout element blocks
      page_data (Dict, optional):
          A dictionary storing the page (canvas) related information
          like `height`, `width`, etc. It should be passed in as a
          keyword argument to avoid any confusion.
          Defaults to None.
class_docstr_tok: ["The",":","obj",":","`","Layout","`","class","id","designed","for","processing","a","list","of","layout","elements","on","a","page",".","It","stores","the","layout","elements","in","a","list","and","the","related","`","page_data","`",",","and","provides","handy","APIs","for","processing","all","the","layout","elements","in","batch",".","`","Args",":","blocks","(",":","obj",":","`","list","`",")",":","A","list","of","layout","element","blocks","page_data","(","Dict",",","optional",")",":","A","dictionary","storing","the","page","(","canvas",")","related","information","like","`","height","`",",","`","width","`",",","etc",".","It","should","be","passed","in","as","a","keyword","argument","to","avoid","any","confusion",".","Defaults","to","None","."]
docstr: Pad all layout elements on the four sides of the polygon with the user-defined pixels. If
  safe_mode is set to True, the function will cut off the excess padding that falls on the negative
  side of the coordinates.
  
  Args:
      left (:obj:`int`, `optional`, defaults to 0): The number of pixels to pad on the upper side of the polygon.
      right (:obj:`int`, `optional`, defaults to 0): The number of pixels to pad on the lower side of the polygon.
      top (:obj:`int`, `optional`, defaults to 0): The number of pixels to pad on the left side of the polygon.
      bottom (:obj:`int`, `optional`, defaults to 0): The number of pixels to pad on the right side of the polygon.
      safe_mode (:obj:`bool`, `optional`, defaults to True): A bool value to toggle the safe_mode.
  
  Returns:
      :obj:`Layout`:
          A new layout object with all the elements padded in the specified values.
docstr_tok: ["Pad","all","layout","elements","on","the","four","sides","of","the","polygon","with","the","user-defined","pixels",".","If","safe_mode","is","set","to","True",",","the","function","will","cut","off","the","excess","padding","that","falls","on","the","negative","side","of","the","coordinates",".","Args",":","left","(",":","obj",":","`","int","`",",","`","optional","`",",","defaults","to","0",")",":","The","number","of","pixels","to","pad","on","the","upper","side","of","the","polygon",".","right","(",":","obj",":","`","int","`",",","`","optional","`",",","defaults","to","0",")",":","The","number","of","pixels","to","pad","on","the","lower","side","of","the","polygon",".","top","(",":","obj",":","`","int","`",",","`","optional","`",",","defaults","to","0",")",":","The","number","of","pixels","to","pad","on","the","left","side","of","the","polygon",".","bottom","(",":","obj",":","`","int","`",",","`","optional","`",",","defaults","to","0",")",":","The","number","of","pixels","to","pad","on","the","right","side","of","the","polygon",".","safe_mode","(",":","obj",":","`","bool","`",",","`","optional","`",",","defaults","to","True",")",":","A","bool","value","to","toggle","the","safe_mode",".","Returns",":",":","obj",":","`","Layout","`",":","A","new","layout","object","with","all","the","elements","padded","in","the","specified","values","."]
code: def pad(self, left=0, right=0, top=0, bottom=0, safe_mode=True):
      """Pad all layout elements on the four sides of the polygon with the user-defined pixels. If
      safe_mode is set to True, the function will cut off the excess padding that falls on the negative
      side of the coordinates.
  
      Args:
          left (:obj:`int`, `optional`, defaults to 0): The number of pixels to pad on the upper side of the polygon.
          right (:obj:`int`, `optional`, defaults to 0): The number of pixels to pad on the lower side of the polygon.
          top (:obj:`int`, `optional`, defaults to 0): The number of pixels to pad on the left side of the polygon.
          bottom (:obj:`int`, `optional`, defaults to 0): The number of pixels to pad on the right side of the polygon.
          safe_mode (:obj:`bool`, `optional`, defaults to True): A bool value to toggle the safe_mode.
  
      Returns:
          :obj:`Layout`:
              A new layout object with all the elements padded in the specified values.
      """
      return self.__class__(
          [
              ele.pad(left, right, top, bottom, safe_mode)
              for ele in self
          ],
          page_data=self.page_data,
      )
  
imports: from typing import List, Union, Dict, Dict, Any, Optional
  from collections.abc import MutableSequence, Iterable
  from copy import copy
  import pandas
  from .base import BaseCoordElement, BaseLayoutElement
  from .layout_elements import Interval, Rectangle, Quadrilateral, TextBlock, ALL_BASECOORD_ELEMENTS, BASECOORD_ELEMENT_NAMEMAP, BASECOORD_ELEMENT_INDEXMAP
label_desc: Use image node_id 18 for calling the Layout obj's underlying member method code with example usage: obj.pad(left, right, top, bottom, safe_mode) and returns: self