def SetLocationList(diagnostics):
 vim.eval(u'setloclist( 0, {0} )'.format(json.dumps(diagnostics)))

def SetLocationList ( diagnostics ) : vim . eval ( u'setloclist( 0, {0} )' . format ( json . dumps ( diagnostics ) ) )
diagnostics should be in qflist format; see ":h setqflist" for details .