def use_obj_for_literal_in_memo(expr, obj, lit, memo):
 for node in pyll.dfs(expr):
  try:
   if (node.obj == lit):
    memo[node] = obj
  except AttributeError:
   pass
 return memo

def use_obj_for_literal_in_memo ( expr , obj , lit , memo ) : for node in pyll . dfs ( expr ) : try : if ( node . obj == lit ) : memo [ node ] = obj except AttributeError : pass return memo
set memo[node] = obj for all nodes in expr such that node .