code: def is_none(node):
      '''Check whether an AST node corresponds to None.
  
      In Python 2 None uses the same ast.Name class that variables etc. use,
      but in Python 3 there is a new ast.NameConstant class.
      '''
      if PY2:
          return isinstance(node, ast.Name) and node.id == 'None'
      return isinstance(node, ast.NameConstant) and node.value is Nonf is_none(node):
      '''Check whether an AST node corresponds to None.
  
      In Python 2 None uses the same ast.Name class that variables etc. use,
      but in Python 3 there is a new ast.NameConstant class.
      '''
      if PY2:
          return isinstance(node, ast.Name) and node.id == 'None'
      return isinstance(node, ast.NameConstant) and node.value is None
docs: Check whether an AST node corresponds to None.
  
      In Python 2 None uses the same ast.Name class that variables etc. use,
      but in Python 3 there is a new ast.NameConstant class.