code: def border_positions_from_texts(texts, direction, only_attr=None):
      """
      From a list of textboxes in <texts>, get the border positions for the respective direction.
      For vertical direction, return the text boxes' top and bottom border positions.
      For horizontal direction, return the text boxes' left and right border positions.
  
      <direction> must be DIRECTION_HORIZONTAL or DIRECTION_VERTICAL from pdftabextract.common.
  
      optional <only_attr> must be either 'low' (only return 'top' or 'left' borders) or 'high' (only return 'bottom' or
      'right').
  
      Border positions are returned as sorted NumPy array.
      """
      if direction not in (DIRECTION_HORIZONTAL, DIRECTION_VERTICAL):
          raise ValueError(
              "direction must be DIRECTION_HORIZONTAL or DIRECTION_VERTICAL (see pdftabextract.common)"
          )
  
      if only_attr is not None and only_attr not in ("low", "high"):
          raise ValueError(
              "only_attr must be either 'low' or 'high' if not set to None (default)"
          )
  
      if direction == DIRECTION_VERTICAL:
          attr_lo = "top"
          attr_hi = "bottom"
      else:
          attr_lo = "left"
          attr_hi = "right"
  
      positions = []
      for t in texts:
          if only_attr is None or only_attr == "low":
              positions.append(t[attr_lo])
          if only_attr is None or only_attr == "high":
              positions.append(t[attr_hi])
  
      return np.array(sorted(positions))
  
file_path: pdftabextract/pdftabextract/textboxes.py
imports: import math
  import numpy
  from pdftabextract.common import update_text_dict_pos, sorted_by_attr, DIRECTION_HORIZONTAL, DIRECTION_VERTICAL, SKEW_X, SKEW_Y
  from pdftabextract.geom import pt, vecrotate
label_desc: Use image node_id 1 for calling a global function with example usage: border_positions_from_texts(texts, direction, only_attr) and returns: np