code: def filter_objlist(olist, fieldname, fieldval):
      
      return [x for x in olist if getattr(x, fieldname) == fieldval]
docs: Returns a list with of the objects in olist that have a fieldname valued as fieldval
  
      Parameters
      ----------
      olist: list of objects
  
      fieldname: string
  
      fieldval: anything
  
      Returns
      -------
      list of objets