def inherit_from_std_ex(node):
 if ((node.name in ('Exception', 'BaseException')) and (node.root().name == EXCEPTIONS_MODULE)):
  return True
 return any((inherit_from_std_ex(parent) for parent in node.ancestors(recurs=False)))

def inherit_from_std_ex ( node ) : if ( ( node . name in ( 'Exception' , 'BaseException' ) ) and ( node . root ( ) . name == EXCEPTIONS_MODULE ) ) : return True return any ( ( inherit_from_std_ex ( parent ) for parent in node . ancestors ( recurs = False ) ) )
return true if the given class node is subclass of exceptions .