def getObjs(objs, attr, val=''):
    """
    one liner to get list of all the objects whose attribute attr has value val
    Example call: getObjs(objs, 'class', 'load')
    """
    if val:
        return [obj for obj in objs if attr in obj and obj[attr] == val]
    else:
        return [obj for obj in objs if attr in obj]