'Raise or lower indices with the metric ``g``
Parameters
g :  metric
contract_all : if True, eliminate all ``g`` which are contracted
Notes
see the ``TensorIndexType`` docstring for the contraction conventions'

def contract_metric(self, g):

    args = [contract_metric(x, g) for x in self.args]
    t = TensAdd(*args)
    return canon_bp(t)
