def decorated_with_property(node):
 if (not node.decorators):
  return False
 for decorator in node.decorators.nodes:
  if (not isinstance(decorator, astroid.Name)):
   continue
  try:
   for infered in decorator.infer():
    if isinstance(infered, astroid.Class):
     if ((infered.root().name == BUILTINS_NAME) and (infered.name == 'property')):
      return True
     for ancestor in infered.ancestors():
      if ((ancestor.name == 'property') and (ancestor.root().name == BUILTINS_NAME)):
       return True
  except astroid.InferenceError:
   pass

def decorated_with_property ( node ) : if ( not node . decorators ) : return False for decorator in node . decorators . nodes : if ( not isinstance ( decorator , astroid . Name ) ) : continue try : for infered in decorator . infer ( ) : if isinstance ( infered , astroid . Class ) : if ( ( infered . root ( ) . name == BUILTINS_NAME ) and ( infered . name == 'property' ) ) : return True for ancestor in infered . ancestors ( ) : if ( ( ancestor . name == 'property' ) and ( ancestor . root ( ) . name == BUILTINS_NAME ) ) : return True except astroid . InferenceError : pass
detect if the given function node is decorated with a property .