def add_marker(self, marker, append=True):
from _pytest.mark import MarkDecorator, MARK_GEN<EOL>if isinstance(marker, six.string_types):<EOL><INDENT>marker = getattr(MARK_GEN, marker)<EOL><DEDENT>elif not isinstance(marker, MarkDecorator):<EOL><INDENT>raise ValueError("<STR_LIT>")<EOL><DEDENT>self.keywords[marker.name] = marker<EOL>if append:<EOL><INDENT>self.own_markers.append(marker.mark)<EOL><DEDENT>else:<EOL><INDENT>self.own_markers.insert(<NUM_LIT:0>, marker.mark)<EOL><DEDENT>
dynamically add a marker object to the node.

        :type marker: ``str`` or ``pytest.mark.*``  object
        :param marker:
            ``append=True`` whether to append the marker,
            if ``False`` insert at position ``0``.