def lod_to_dod(_list, indexkey):
 results = {}
 for item in _list:
  results[item[indexkey]] = item
 return results

def lod_to_dod ( _list , indexkey ) : results = { } for item in _list : results [ item [ indexkey ] ] = item return results
things like get_distros() returns a list of a dictionaries convert this to a dict of dicts keyed off of an arbitrary field ex: [ { "a" : 2 } .