type check in DPSFormatter.get_context