code: def sort_diclist(undecorated, sort_on):
      decorated = [(len(dict_[sort_on]) if hasattr(dict_[sort_on], '__len__') else dict_[
                    sort_on], index) for (index, dict_) in enumerate(undecorated)]
      decorated.sort()
      return[undecorated[index] for (key, index) in decorated]