human
I wrote the below code

    def _ResultHook(rpc):
        mapped_errors = [modules_service_pb.ModulesServiceError.INVALID_VERSION, modules_service_pb.ModulesServiceError.TRANSIENT_ERROR]
        _CheckAsyncResult(rpc, mapped_errors, {})
    if (not isinstance(instances, (long, int))):
        raise TypeError("'instances'    arg    must    be    of    type    long    or    int.")
    request = modules_service_pb.SetNumInstancesRequest()
    request.set_instances(instances)
    if module:
        request.set_module(module)
    if version:
        request.set_version(version)
    response = modules_service_pb.SetNumInstancesResponse()
    return _MakeAsyncCall('SetNumInstances', request, response, _ResultHook)

What's a good function header?
assistant
#Here's a good function header.

def set_num_instances_async(instances, module=None, version=None):