code: def diagflat(v, k=0):
      ret = ivy.diagflat(v, offset=k)
      while len(ivy.shape(ret)) < 2:
          ret = ret.expand_dims(axis=0)
      return ret
  
file_path: ivy/ivy/functional/frontends/numpy/creation_routines/building_matrices.py
imports: import ivy
  from ivy.functional.frontends.numpy.func_wrapper import to_ivy_arrays_and_back, handle_numpy_dtype
label_desc: Use image node_id 2 for calling a global function with example usage: diagflat(v, k) and returns: ret