class_docstr: Visitor to gather node matching with a given pattern.
  
  Examples
  --------
  >>> import gast as ast
  >>> code = "[(i, j) for i in range(a) for j in range(b)]"
  >>> pattern = ast.Call(func=ast.Name('range', ctx=ast.Load(),
  ...                                  annotation=None,
  ...                                  type_comment=None),
  ...                    args=AST_any(), keywords=[])
  >>> len(ASTMatcher(pattern).search(ast.parse(code)))
  2
  >>> code = "[(i, j) for i in range(a) for j in range(b)]"
  >>> pattern = ast.Call(func=ast.Name(id=AST_or('range', 'range'),
  ...                                  ctx=ast.Load(),
  ...                                  annotation=None,
  ...                                  type_comment=None),
  ...                    args=AST_any(), keywords=[])
  >>> len(ASTMatcher(pattern).search(ast.parse(code)))
  2
  >>> code = "{1:2, 3:4}"
  >>> pattern = ast.Dict(keys=[ast.Constant(3, None), ast.Constant(1, None)],
  ...                    values=[ast.Constant(4, None),
  ...                            ast.Constant(2, None)])
  >>> len(ASTMatcher(pattern).search(ast.parse(code)))
  1
  >>> code = "{1, 2, 3}"
  >>> pattern = ast.Set(elts=[ast.Constant(3, None),
  ...                         ast.Constant(2, None),
  ...                         ast.Constant(1, None)])
  >>> len(ASTMatcher(pattern).search(ast.parse(code)))
  1
class_docstr_tok: ["Visitor","to","gather","node","matching","with","a","given","pattern",".","Examples","--","--","--","--",">",">",">","import","gast","as","ast",">",">",">","code","=","``","[","(","i",",","j",")","for","i","in","range","(","a",")","for","j","in","range","(","b",")","]","''",">",">",">","pattern","=","ast.Call","(","func=ast.Name","(","'range","'",",","ctx=ast.Load","(",")",",","...","annotation=None",",","...","type_comment=None",")",",","...","args=AST_any","(",")",",","keywords=","[","]",")",">",">",">","len","(","ASTMatcher","(","pattern",")",".search","(","ast.parse","(","code",")",")",")","2",">",">",">","code","=","``","[","(","i",",","j",")","for","i","in","range","(","a",")","for","j","in","range","(","b",")","]","''",">",">",">","pattern","=","ast.Call","(","func=ast.Name","(","id=AST_or","(","'range","'",",","'range","'",")",",","...","ctx=ast.Load","(",")",",","...","annotation=None",",","...","type_comment=None",")",",","...","args=AST_any","(",")",",","keywords=","[","]",")",">",">",">","len","(","ASTMatcher","(","pattern",")",".search","(","ast.parse","(","code",")",")",")","2",">",">",">","code","=","``","{","1:2",",","3:4","}","''",">",">",">","pattern","=","ast.Dict","(","keys=","[","ast.Constant","(","3",",","None",")",",","ast.Constant","(","1",",","None",")","]",",","...","values=","[","ast.Constant","(","4",",","None",")",",","...","ast.Constant","(","2",",","None",")","]",")",">",">",">","len","(","ASTMatcher","(","pattern",")",".search","(","ast.parse","(","code",")",")",")","1",">",">",">","code","=","``","{","1",",","2",",","3","}","''",">",">",">","pattern","=","ast.Set","(","elts=","[","ast.Constant","(","3",",","None",")",",","...","ast.Constant","(","2",",","None",")",",","...","ast.Constant","(","1",",","None",")","]",")",">",">",">","len","(","ASTMatcher","(","pattern",")",".search","(","ast.parse","(","code",")",")",")","1"]
docstr: Basic initialiser saving pattern and initialising result set. 
docstr_tok: ["Basic","initialiser","saving","pattern","and","initialising","result","set","."]
code: def __init__(self, pattern):
      """Basic initialiser saving pattern and initialising result set."""
      self.pattern = pattern
      self.result = set()
      super(ASTMatcher, self).__init__()
  
imports: from gast import AST, iter_fields, NodeVisitor, Dict, Set
  from itertools import permutations
  from math import isnan
label_desc: Use image node_id 1 to create a new ASTMatcher object from inherited base classes: NodeVisitor with example: obj = ASTMatcher(pattern)