code: def gs_k_barcode(symbology, data, **kwargs):
      
      commands = gs_k_barcode_configure(**kwargs)
  
      if symbology in (
              NUL_TERM_UPC_A,
              NUL_TERM_UPC_E,
              NUL_TERM_JAN13_EAN13,
              NUL_TERM_JAN8_EAN8,
              NUL_TERM_CODE39,
              NUL_TERM_ITF,
              NUL_TERM_CODABAR_NW_7,):
          # null-terminated
          commands.append('\x1D\x6B{}{}\x00'.format(symbology, data))
  
      else:
          commands.append('\x1D\x6B{}{}{}\x00'.format(
                  symbology, chr(len(data)), data))
  
      return commands
docs: Build standard ESC/POS barcode through ``GS k`` command set. Keyword
      arguments can be used to configure barcode height, bar widths and HRI
      positioning. User applications should not use this function. This function
      is provided as an ESC/POS "standard barcode command set" to be used by
      specific implementations.
  
      :param symbology: The symbology to build. Should be one of the constants in
          :attr:`NUL_TERM_SYMBOLOGIES` or :attr:`SYMBOLOGIES`.
  
      :param data: The barcode data. You should draw up your data according to
          the symbology. If you do not want to worry about data formating then
          you should use barcode methods provided by the reference ESC/POS
          implementation :class:`~escpos.impl.epson.GenericESCPOS` instead of
          this function.
  
      :param barcode_height: Optional.
      :param barcode_width: Optional.
      :param barcode_hri: Optional.
  
      :return: A list of commands, ready to be sent to the device.
      :rtype: list