def barcode(self, code, bc, height=<NUM_LIT:64>, width=<NUM_LIT:3>, pos="<STR_LIT>", font="<STR_LIT:A>",<EOL>align_ct=True, function_type=None, check=True):
if function_type is None:<EOL><INDENT>if bc in BARCODE_TYPES['<STR_LIT:A>']:<EOL><INDENT>function_type = '<STR_LIT:A>'<EOL><DEDENT>else:<EOL><INDENT>if bc in BARCODE_TYPES['<STR_LIT:B>']:<EOL><INDENT>if not self.profile.supports(BARCODE_B):<EOL><INDENT>raise BarcodeTypeError((<EOL>"<STR_LIT>"<EOL>"<STR_LIT>").format(bc=bc))<EOL><DEDENT>function_type = '<STR_LIT:B>'<EOL><DEDENT>else:<EOL><INDENT>raise BarcodeTypeError((<EOL>"<STR_LIT>").format(bc=bc))<EOL><DEDENT><DEDENT><DEDENT>bc_types = BARCODE_TYPES[function_type.upper()]<EOL>if bc.upper() not in bc_types.keys():<EOL><INDENT>raise BarcodeTypeError((<EOL>"<STR_LIT>"<EOL>"<STR_LIT>").format(<EOL>bc=bc,<EOL>function_type=function_type,<EOL>))<EOL><DEDENT>if check and not self.check_barcode(bc, code):<EOL><INDENT>raise BarcodeCodeError((<EOL>"<STR_LIT>").format(<EOL>code=code,<EOL>bc=bc,<EOL>))<EOL><DEDENT>if align_ct:<EOL><INDENT>self._raw(TXT_STYLE['<STR_LIT>']['<STR_LIT>'])<EOL><DEDENT>if <NUM_LIT:1> <= height <= <NUM_LIT:255>:<EOL><INDENT>self._raw(BARCODE_HEIGHT + six.int2byte(height))<EOL><DEDENT>else:<EOL><INDENT>raise BarcodeSizeError("<STR_LIT>".format(height=height))<EOL><DEDENT>if <NUM_LIT:2> <= width <= <NUM_LIT:6>:<EOL><INDENT>self._raw(BARCODE_WIDTH + six.int2byte(width))<EOL><DEDENT>else:<EOL><INDENT>raise BarcodeSizeError("<STR_LIT>".format(width=width))<EOL><DEDENT>if font.upper() == "<STR_LIT:B>":<EOL><INDENT>self._raw(BARCODE_FONT_B)<EOL><DEDENT>else:  <EOL><INDENT>self._raw(BARCODE_FONT_A)<EOL><DEDENT>if pos.upper() == "<STR_LIT>":<EOL><INDENT>self._raw(BARCODE_TXT_OFF)<EOL><DEDENT>elif pos.upper() == "<STR_LIT>":<EOL><INDENT>self._raw(BARCODE_TXT_BTH)<EOL><DEDENT>elif pos.upper() == "<STR_LIT>":<EOL><INDENT>self._raw(BARCODE_TXT_ABV)<EOL><DEDENT>else:  <EOL><INDENT>self._raw(BARCODE_TXT_BLW)<EOL><DEDENT>self._raw(bc_types[bc.upper()])<EOL>if function_type.upper() == "<STR_LIT:B>":<EOL><INDENT>self._raw(six.int2byte(len(code)))<EOL><DEDENT>if code:<EOL><INDENT>self._raw(code.encode())<EOL><DEDENT>else:<EOL><INDENT>raise BarcodeCodeError()<EOL><DEDENT>if function_type.upper() == "<STR_LIT:A>":<EOL><INDENT>self._raw(NUL)<EOL><DEDENT>
Print Barcode

        This method allows to print barcodes. The rendering of the barcode is done by the printer and therefore has to
        be supported by the unit. By default, this method will check whether your barcode text is correct, that is
        the characters and lengths are supported by ESCPOS. Call the method with `check=False` to disable the check, but
        note that uncorrect barcodes may lead to unexpected printer behaviour.
        There are two forms of the barcode function. Type A is default but has fewer barcodes,
        while type B has some more to choose from.

        Use the parameters `height` and `width` for adjusting of the barcode size. Please take notice that the barcode
        will not be printed if it is outside of the printable area. (Which should be impossible with this method, so
        this information is probably more useful for debugging purposes.)

        .. todo:: On TM-T88II width from 1 to 6 is accepted. Try to acquire command reference and correct the code.
        .. todo:: Supplying pos does not have an effect for every barcode type. Check and document for which types this
                  is true.

        If you do not want to center the barcode you can call the method with `align_ct=False`, which will disable
        automatic centering. Please note that when you use center alignment, then the alignment of text will be changed
        automatically to centered. You have to manually restore the alignment if necessary.

        .. todo:: If further barcode-types are needed they could be rendered transparently as an image. (This could also
                  be of help if the printer does not support types that others do.)

        :param code: alphanumeric data to be printed as bar code
        :param bc: barcode format, possible values are for type A are:

            * UPC-A
            * UPC-E
            * EAN13
            * EAN8
            * CODE39
            * ITF
            * NW7

            Possible values for type B:

            * All types from function type A
            * CODE93
            * CODE128
            * GS1-128
            * GS1 DataBar Omnidirectional
            * GS1 DataBar Truncated
            * GS1 DataBar Limited
            * GS1 DataBar Expanded

            If none is specified, the method raises :py:exc:`~escpos.exceptions.BarcodeTypeError`.
        :param height: barcode height, has to be between 1 and 255
            *default*: 64
        :type height: int
        :param width: barcode width, has to be between 2 and 6
            *default*: 3
        :type width: int
        :param pos: where to place the text relative to the barcode, *default*: BELOW

            * ABOVE
            * BELOW
            * BOTH
            * OFF

        :param font: select font (see ESC/POS-documentation, the device often has two fonts), *default*: A

            * A
            * B

        :param align_ct: If this parameter is True the barcode will be centered. Otherwise no alignment command will be
                         issued.
        :type align_ct: bool

        :param function_type: Choose between ESCPOS function type A or B,
            depending on printer support and desired barcode. If not given,
            the printer will attempt to automatically choose the correct
            function based on the current profile.
            *default*: A

        :param check: If this parameter is True, the barcode format will be checked to ensure it meets the bc
            requirements as defigned in the esc/pos documentation. See py:func:`~escpos.Escpos.check_barcode`
            for more information. *default*: True.

        :raises: :py:exc:`~escpos.exceptions.BarcodeSizeError`,
                 :py:exc:`~escpos.exceptions.BarcodeTypeError`,
                 :py:exc:`~escpos.exceptions.BarcodeCodeError`