class_docstr: Works with _WeakArgsDict to provide a weak cache for function args.
  When any of those args are gc'd, the pair is removed from the cache.
class_docstr_tok: ["Works","with","_WeakArgsDict","to","provide","a","weak","cache","for","function","args",".","When","any","of","those","args","are","gc","'d",",","the","pair","is","removed","from","the","cache","."]
code: def __init__(self, items, dict_remove=None):
      def remove(k, selfref=ref(self), dict_remove=dict_remove):
          self = selfref()
          if self is not None and dict_remove is not None:
              dict_remove(self)
  
      self._items, self._selectors = unzip(
          self._try_ref(item, remove) for item in items
      )
      self._items = tuple(self._items)
      self._selectors = tuple(self._selectors)
  
imports: from collections import OrderedDict, Sequence
  from itertools import compress
  from weakref import WeakKeyDictionary, ref
  from six.moves._thread import allocate_lock
  from toolz.sandbox import unzip
  from trading_calendars.utils.memoize import lazyval
  from zipline.utils.compat import wraps
label_desc: Use image node_id 1 to create a new _WeakArgs object from inherited base classes: Sequence with example: obj = _WeakArgs(items, dict_remove)