def get_barcodes(barcodes_path):
    """
    Create a dictionary with the barcodes.

    Where the key is name that will be given to the output files, and
    the value is the barcode. If the text file have a 2nd column this
    value will be used as name, if not the same barcode will be the name.
    """
    barcodes_file = open(barcodes_path, 'r')
    barcodes_lines = [line.split() for line in barcodes_file.readlines()]
    return {
        (line[1] if len(line) == 2 else line[0]): line[0]
        for line in barcodes_lines
    }