def METHOD_NAME(self, init_req):
    success = True
    msg = ''
    for opt in init_req.options:
        if opt.name == 'field':
            self._field = opt.values[0].stringValue
        elif opt.name == 'scale':
            self._scale = opt.values[0].doubleValue
    if self._field is None:
        success = False
        msg += ' must supply field name'
    if self._scale < 1.0:
        success = False
        msg += ' invalid scale must be >= 1.0'
    response = udf_pb2.Response()
    response.METHOD_NAME.success = success
    response.METHOD_NAME.error = msg[1:]
    return response