Rearranging list based on order of another list
try to use key with sorted:
sorted(_list2,key=_list1.index)
for nested list you can use list comphresnion:
[sorted(x,key=_lis1.index) for x in _list2]
In [84]: _list1 = ["keyName", "test1", "test2"]
In [85]: d = {k:v for v,k in enumerate(_list1)}
In [86]: _list2 = ["keyName", "test2", "test1"]
In [87]: _list2.sort(key=d.get)
In [88]: _list2
Out[88]: ['keyName', 'test1', 'test2']