def findParam(event, groupName, paramName):
    """
    Finds a Param in a given VOEvent that has the specified groupName
    and paramName. If it is a bare param, the group name is the empty string.
    """
    w = event.get_What()
    if not w:
        print('No <What> section in the event!')
        return None
    if groupName == '':
        for p in event.get_What().get_Param():
            if p.get_name() == paramName:
                return p
    else:
        for g in event.get_What().get_Group():
            if g.get_name == groupName:
                for p in event.get_What().get_Param():
                    if p.get_name() == paramName:
                        return p
    print('Cannot find param named %s/%s' % (groupName, paramName))
    return None
