code: def update_text_dict_pos(t, pos, update_node=False):
      """
      Update text box <t>'s position and set it to <pos>, where the first element of <pos> is the x and the second is the
      y coordinate.
      If <update_node> is True, also set the respective attributes in the respective XML node of the text box.
      """
      t_top = pos[1]
      t_left = pos[0]
      t_bottom = t_top + t["height"]
      t_right = t_left + t["width"]
  
      t.update(
          {
              "top": t_top,
              "left": t_left,
              "bottom": t_bottom,
              "right": t_right,
              "topleft": np.array((t_left, t_top)),
              "bottomleft": np.array((t_left, t_bottom)),
              "topright": np.array((t_right, t_top)),
              "bottomright": np.array((t_right, t_bottom)),
          }
      )
  
      if update_node:
          update_text_xmlnode(t, "left", pos[0])
          update_text_xmlnode(t, "top", pos[1])
  
imports: import xml.etree.ElementTree
  from collections import OrderedDict
  import json
  import struct
  import imghdr
  import numpy
  from .geom import pt, rect
label_desc: Use image node_id 7 for calling a global function with example usage: update_text_dict_pos(t, pos, update_node) without return types