def diagflat(a, k=0): if isinstance(a, garray): return a.diagflat(k) else: return numpy.diagflat(a,k)