':param function:
:param networkx.MultiDiGraph data_graph:
:return:'

def _constant_propagation(self, function, data_graph):

    for n0 in data_graph.nodes_iter():
        if (not isinstance(n0.variable, SimConstantVariable)):
            continue
        n1s = data_graph.successors(n0)
        if (len(n1s) != 1):
            continue
        n1 = n1s[0]
        if (not isinstance(n1.variable, SimRegisterVariable)):
            continue
        if (len(data_graph.predecessors(n1)) != 1):
            continue
        n2s = data_graph.successors(n1)
        if (len(n2s) != 1):
            continue
        n2 = n2s[0]
        if (not isinstance(n2.variable, SimMemoryVariable)):
            continue
        n2_inedges = data_graph.in_edges(n2, data=True)
        if (len([0 for (_, _, data) in n2_inedges if (('type' in data) and (data['type'] == 'mem_data'))]) != 1):
            continue
        cp = ConstantPropagation(n0.variable.value, n0.location, n2.location)
        self.constant_propagations.append(cp)
