def append(self, matrix, axis):

        axis_to_be_synced = int(not axis)
        mat = matrix.synchronize_word_order(self, axis_to_be_synced)

        if axis == 0:
            if len(set.intersection(set(self.row2word), set(matrix.row2word))) != 0:
                raise ValueError("The row to append doesn't only contain unique values.")

            return self._new_instance(sp.vstack([self.matrix, matrix.matrix], format='csr'),
                                      row2word=self.row2word + matrix.row2word)
        elif axis == 1:
            if len(set.intersection(set(self.col2word), set(matrix.col2word))) != 0:
                raise ValueError("The column to append doesn't only contain unique values.")

            return self._new_instance(sp.hstack([self.matrix, mat.matrix], format='csr'),
                                      col2word=self.col2word + matrix.col2word)
        else:
            raise ValueError("Axis must be 0 or 1.")
Wait up to `timeout` seconds until `socket` is ready for writing.
dataset/ETHPy150Open jimmycallin/pydsm/pydsm/indexmatrix.py/IndexMatrix.append--crossover with--dataset/ETHPy150Open kuri65536/python-for-android/python3-alpha/python-libs/pyxmpp2/mainloop/wait.py/wait_for_write