class_docstr: base class for Collector and Item the test collection tree.
  Collector subclasses have children, Items are terminal nodes.
docstr: get the next parent node (including ourself)
  which is an instance of the given class
docstr_tok: ["get","the","next","parent","node","(","including","ourself",")","which","is","an","instance","of","the","given","class"]
code: def getparent(self, cls):
      """get the next parent node (including ourself)
      which is an instance of the given class"""
      current = self
      while current and not isinstance(current, cls):
          current = current.parent
      return current
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import os
  import warnings
  import py
  import six
  import _pytest._code
  from _pytest.compat import getfslineno
  from _pytest.mark.structures import NodeKeywords
  from _pytest.outcomes import fail
label_desc: Use image node_id 17 for calling the Node obj's underlying member method code with example usage: obj.getparent(cls) and returns: current