class_docstr: Automatic detection and parsing of API docs to Sphinx-parsable reST
  format.
docstr: Return True if *matchstr* does not match patterns.
  
  ``self.package_name`` removed from front of string if present
  
  Examples
  --------
  >>> dw = ApiDocWriter('sphinx')
  >>> dw._survives_exclude('sphinx.okpkg', 'package')
  True
  >>> dw.package_skip_patterns.append('^\\.badpkg$')
  >>> dw._survives_exclude('sphinx.badpkg', 'package')
  False
  >>> dw._survives_exclude('sphinx.badpkg', 'module')
  True
  >>> dw._survives_exclude('sphinx.badmod', 'module')
  True
  >>> dw.module_skip_patterns.append('^\\.badmod$')
  >>> dw._survives_exclude('sphinx.badmod', 'module')
  False
docstr_tok: ["Return","True","if","*","matchstr","*","does","not","match","patterns",".","``","self.package_name","``","removed","from","front","of","string","if","present","Examples","--","--","--","--",">",">",">","dw","=","ApiDocWriter","(","'sphinx","'",")",">",">",">","dw._survives_exclude","(","'sphinx.okpkg","'",",","'package","'",")","True",">",">",">","dw.package_skip_patterns.append","(","'^\\\\.badpkg","$","'",")",">",">",">","dw._survives_exclude","(","'sphinx.badpkg","'",",","'package","'",")","False",">",">",">","dw._survives_exclude","(","'sphinx.badpkg","'",",","'module","'",")","True",">",">",">","dw._survives_exclude","(","'sphinx.badmod","'",",","'module","'",")","True",">",">",">","dw.module_skip_patterns.append","(","'^\\\\.badmod","$","'",")",">",">",">","dw._survives_exclude","(","'sphinx.badmod","'",",","'module","'",")","False"]
code: def _survives_exclude(self, matchstr, match_type):
      r"""Return True if *matchstr* does not match patterns.
  
      ``self.package_name`` removed from front of string if present
  
      Examples
      --------
      >>> dw = ApiDocWriter('sphinx')
      >>> dw._survives_exclude('sphinx.okpkg', 'package')
      True
      >>> dw.package_skip_patterns.append('^\\.badpkg$')
      >>> dw._survives_exclude('sphinx.badpkg', 'package')
      False
      >>> dw._survives_exclude('sphinx.badpkg', 'module')
      True
      >>> dw._survives_exclude('sphinx.badmod', 'module')
      True
      >>> dw.module_skip_patterns.append('^\\.badmod$')
      >>> dw._survives_exclude('sphinx.badmod', 'module')
      False
      """
      if match_type == "module":
          patterns = self.module_skip_patterns
      elif match_type == "package":
          patterns = self.package_skip_patterns
      else:
          raise ValueError(
              'Cannot interpret match type "%s"' % match_type
          )
      # Match to URI without package name
      L = len(self.package_name)
      if matchstr[:L] == self.package_name:
          matchstr = matchstr[L:]
      for pat in patterns:
          try:
              pat.search
          except AttributeError:
              pat = re.compile(pat)
          if pat.search(matchstr):
              return False
  
      return True
  
imports: import ast
  import os
  import re
  from importlib import import_module
  from types import BuiltinFunctionType, FunctionType
  from inspect import ismethod, getmodule
label_desc: Use image node_id 12 for calling the ApiDocWriter obj's underlying member method code with example usage: obj._survives_exclude(matchstr, match_type) and returns: True, False