docstr: Assign memo[k] = v
  
  This is implementation optionally drops references to the arguments
  "clients" required to compute apply-node `k`, which allows those
  objects to be garbage-collected. This feature is enabled by
  `self.memo_gc`.
docstr_tok: ["Assign","memo","[","k","]","=","v","This","is","implementation","optionally","drops","references","to","the","arguments","''","clients","''","required","to","compute","apply-node","`","k","`",",","which","allows","those","objects","to","be","garbage-collected",".","This","feature","is","enabled","by","`","self.memo_gc","`","."]
code: def set_in_memo(self, memo, k, v):
      """Assign memo[k] = v
  
      This is implementation optionally drops references to the arguments
      "clients" required to compute apply-node `k`, which allows those
      objects to be garbage-collected. This feature is enabled by
      `self.memo_gc`.
  
      """
      if self.memo_gc:
          assert v is not pyll.base.GarbageCollected
          memo[k] = v
          for ii in k.inputs():
              # -- if all clients of ii are already in the memo
              #    then we can free memo[ii] by replacing it
              #    with a dummy symbol
              if all(iic in memo for iic in self.clients[ii]):
                  memo[ii] = pyll.base.GarbageCollected
      else:
          memo[k] = v
  
file_path: hyperopt/hyperopt/algobase.py
imports: import copy
  from collections import deque
  import numpy
  from .None import pyll
  from .base import miscs_update_idxs_vals
label_desc: Use image node_id 3 for calling the ExprEvaluator obj's underlying member method code with example usage: obj.set_in_memo(memo, k, v) without return types