code: def generate_value_label(self, byteorder, encoding):
          
  
          self._encoding = encoding
          bio = BytesIO()
          null_string = '\x00'
          null_byte = b'\x00'
  
          # len
          bio.write(struct.pack(byteorder + 'i', self.len))
  
          # labname
          labname = self._encode(_pad_bytes(self.labname[:32], 33))
          bio.write(labname)
  
          # padding - 3 bytes
          for i in range(3):
              bio.write(struct.pack('c', null_byte))
  
          # value_label_table
          # n - int32
          bio.write(struct.pack(byteorder + 'i', self.n))
  
          # textlen  - int32
          bio.write(struct.pack(byteorder + 'i', self.text_len))
  
          # off - int32 array (n elements)
          for offset in self.off:
              bio.write(struct.pack(byteorder + 'i', offset))
  
          # val - int32 array (n elements)
          for value in self.val:
              bio.write(struct.pack(byteorder + 'i', value))
  
          # txt - Text labels, null terminated
          for text in self.txt:
              bio.write(self._encode(text + null_string))
  
          bio.seek(0)
          return bio.read()
docs: Parameters
          ----------
          byteorder : str
              Byte order of the output
          encoding : str
              File encoding
  
          Returns
          -------
          value_label : bytes
              Bytes containing the formatted value label