def METHOD_NAME(conn, prefix):
    logging.info("clean up security groups")
    for security_group in conn.network.security_groups():
        security_group_name = security_group.to_dict()["name"]
        if not security_group_name.startswith(prefix):
            continue
        logging.info(security_group_name)
        conn.network.delete_security_group(security_group)