def assemble(self, ops, target=None):
        """
        Assemble a series of operations and labels into bytecode, analyse its
        stack usage and replace the bytecode and stack size of this code
        object. Can also (optionally) change the target python version.

        Arguments:
            ops(list): The opcodes (and labels) to assemble into bytecode.
            target: The opcode specification of the targeted python
                version. If this is ``None`` the specification of the currently
                running python version will be used.

        Returns:
            CodeObject: A reference to this :class:`CodeObject`.
        """

        self.internals = target = get_py_internals(target, self.internals)
        self.co_code = assemble(ops, target)
        self.co_stacksize = calculate_max_stack_depth(ops, target)
        return self
Assemble a series of operations and labels into bytecode, analyse its
        stack usage and replace the bytecode and stack size of this code
        object. Can also (optionally) change the target python version.

        Arguments:
            ops(list): The opcodes (and labels) to assemble into bytecode.
            target: The opcode specification of the targeted python
                version. If this is ``None`` the specification of the currently
                running python version will be used.

        Returns:
            CodeObject: A reference to this :class:`CodeObject`.