input: from typing import List, Dict
  
  
  def sort_by_attr(objects: List[Dict[str, any]], attr: str) -> List[Dict[str, any]]:
      """ Sort a list of dictionaries by a specified attribute of the dictionaries.
      >>> result = sort_by_attr([{"name": "Alice", "age": 20}, {"name": "Bob", "age": 21}], "age")
      >>> result == [{"name": "Alice", "age": 20}, {"name": "Bob", "age": 21}]
      True
      """
      return sorted(objects, key=lambda item: item[attr])
output:     return sorted(objects, key=lambda item: item[attr])