'Decrement in-edges for ``term`` after computation.
Parameters
term : zipline.pipeline.Term
The term whose parents should be decref\'ed.
refcounts : dict[Term -> int]
Dictionary of refcounts.
Return
garbage : set[Term]
Terms whose refcounts hit zero after decrefing.'

def decref_dependencies(self, term, refcounts):

    garbage = set()
    for (parent, _) in self.graph.in_edges([term]):
        refcounts[parent] -= 1
        if (refcounts[parent] == 0):
            garbage.add(parent)
    return garbage
