code: def tagblock(tag):
      
  
      n = len(tag)
      tablelen = 12 * n
  
      # Build the tag table in two parts.  A list of 12-byte tags, and a
      # string of element data.  Offset is the offset from the start of
      # the profile to the start of the element data (so the offset for
      # the next element is this offset plus the length of the element
      # string so far).
      offset = 128 + tablelen + 4
      # The table.  As a string.
      table = ''
      # The element data
      element = ''
      for k, v in tag:
          table += struct.pack('>4s2L', k, offset + len(element), len(v))
          element += v
      return struct.pack('>L', n) + table + element
docs: `tag` should be a list of (*signature*, *element*) pairs, where
      *signature* (the key) is a length 4 string, and *element* is the
      content of the tag element (another string).
  
      The entire tag block (consisting of first a table and then the
      element data) is constructed and returned as a string.