def notification_factory(code, subcode):
 notification = BGPNotification(code, subcode)
 if (not notification.reason):
  raise ValueError('Invalid code/sub-code.')
 return notification

def notification_factory ( code , subcode ) : notification = BGPNotification ( code , subcode ) if ( not notification . reason ) : raise ValueError ( 'Invalid code/sub-code.' ) return notification
returns a notification message corresponding to given codes .