code: def write_padding(fp, size, divisor=2):
      
      remainder = size % divisor
      if remainder:
          return write_bytes(fp, struct.pack('%dx' % (divisor - remainder)))
      return 0
docs: Writes padding bytes given the currently written size.
  
      :param fp: file-like object
      :param divisor: divisor of the byte alignment
      :return: written byte size