TODO: why does this do its own sub-dispatch?
494580
@Override
  public S handle(int version, water.api.Route route, Properties parms, String postBody) throws Exception {
    // Only here for train or validate-parms
    if( !route._handler_method.getName().equals("train") )
      throw water.H2O.unimpl();

    // Peek out the desired algo from the URL
    String ss[] = route._url.split("/");
    String algoURLName = ss[3]; // {}/{99}/{Grid}/{gbm}/
    String algoName = ModelBuilder.algoName(algoURLName); // gbm -> GBM; deeplearning -> DeepLearning
    String schemaDir = ModelBuilder.schemaDirectory(algoURLName);
    // Get the latest version of this algo: /99/Grid/gbm  ==> GBMV3
    // String algoSchemaName = SchemaServer.schemaClass(version, algoName).getSimpleName(); // GBMV3
    // int algoVersion = Integer.valueOf(algoSchemaName.substring(algoSchemaName.lastIndexOf("V")+1)); // '3'
    // Ok, i'm replacing one hack with another hack here, because SchemaServer.schema*() calls are getting eliminated.
    // There probably shouldn't be any reference to algoVersion here at all... TODO: unhack all of this
    int algoVersion = 3;
    if (algoName.equals("SVD") || algoName.equals("Aggregator") || algoName.equals("StackedEnsemble")) algoVersion = 99;

    // TODO: this is a horrible hack which is going to cause maintenance problems:
    String paramSchemaName = schemaDir+algoName+"V"+algoVersion+"$"+ModelBuilder.paramName(algoURLName)+"V"+algoVersion;

    // Build the Grid Search schema, and fill it from the parameters
    S gss = (S) new GridSearchSchema();
    gss.init_meta();
    gss.parameters = (P)TypeMap.newFreezable(paramSchemaName);
    gss.parameters.init_meta();
    gss.hyper_parameters = new IcedHashMap<>();

    // Get default parameters, then overlay the passed-in values
    ModelBuilder builder = ModelBuilder.make(algoURLName,null,null); // Default parameter settings
    gss.parameters.fillFromImpl(builder._parms); // Defaults for this builder into schema

    gss.fillFromParms(parms);   // Override defaults from user parms

    // Verify list of hyper parameters
    // Right now only names, no types
    // note: still use _validation_frame and and _training_frame at this point.
    // Do not change those names yet.
    validateHyperParams((P)gss.parameters, gss.hyper_parameters);

    // Get actual parameters
    MP params = (MP) gss.parameters.createAndFillImpl();

    Map<String,Object[]> sortedMap = new TreeMap<>(gss.hyper_parameters);

    // Need to change validation_frame to valid now.  HyperSpacewalker will complain
    // if it encountered an illegal parameter name.  From now on, validation_frame,
    // training_fame are no longer valid names.
    if (sortedMap.containsKey("validation_frame")) {
      sortedMap.put("valid", sortedMap.get("validation_frame"));
      sortedMap.remove("validation_frame");
    }

    // Get/create a grid for given frame
    // FIXME: Grid ID is not pass to grid search builder!
    Key<Grid> destKey = gss.grid_id != null ? gss.grid_id.key() : null;
    // Create target grid search object (keep it private for now)
    // Start grid search and return the schema back with job key
    Job<Grid> gsJob = GridSearch.startGridSearch(
        destKey,
        params,
        sortedMap,
        new DefaultModelParametersBuilderFactory<MP, P>(),
        (HyperSpaceSearchCriteria) gss.search_criteria.createAndFillImpl()
    );

    // Fill schema with job parameters
    // FIXME: right now we have to remove grid parameters which we sent back
    gss.hyper_parameters = null;
    gss.total_models = gsJob._result.get().getModelCount(); // TODO: looks like it's currently always 0
    gss.job = new JobV3(gsJob);

    return gss;
  }
1101663
def dispatch(self, *args, **kwargs):
        
        return super(GetAppListJsonView, self).dispatch(*args, **kwargs)
786117
public function dispatch()
    {
        foreach ($this->getSubscribers() as $channelIdentifier => $subscribers) {
            // Get channel from ChannelFactory
            $channel = $this->getChannelFactory()->getChannel($channelIdentifier);

            // Get proper message for the given channel
            $message = $this->getMessage($channel);

            // Decorate message
            $message = $this->decorate($message, $channel);

            // Dispatch to all subscribers
            /** @var SubscriberInterface $subscriber */
            foreach ($subscribers as $subscriber) {
                // Decorate the message
                $message->decorate();

                // Dispatch to the subscriber
                $channel->dispatch($subscriber, $message);
            }
        }
    }
984125
function byNameDispatcher(keysArray, objectWithDispatchMethods) {
  return function handleOrRecurse(singleSignalK) {
    if (typeof singleSignalK === 'object' && singleSignalKx !== null) {
    var branchName = Object.keys(singleSignalK)[0];
    if (keysArray.indexOf(branchName) != -1) {
      var dispatcherFunction = objectWithDispatchMethods['handle_' + branchName];
      if (typeof dispatcherFunction === 'function') {
        dispatcherFunction.bind(objectWithDispatchMethods);
        dispatcherFunction.call(objectWithDispatchMethods, singleSignalK[branchName].value);
      } else {
        console.error("No method named handle_" + branchName + " found");
        console.error(JSON.stringify(objectWithDispatchMethods));
      }
    } else {
      handleOrRecurse(singleSignalK[branchName]);
    }
  }
  }
}
564486
def dispatch_subcommand(self, parser):
        '''
        
        '''
        # read in the subcommand
        args = parser.parse_args(sys.argv[1:2])

        # check that the subcommand is good
        if not hasattr(self, args.subcommand):
            print('Unrecognized command.')
            parser.print_help()
            exit(1)

        self.configs = ConfigurationLoader(DEFAULT_USER_CONFIG_PATH).load()

        # use dispatch pattern to invoke method with same name
        getattr(self, args.subcommand)()
718675
function DispatchError(message) {
  Error.call(this);
  Error.captureStackTrace(this, arguments.callee);
  this.name = 'DispatchError';
  this.message = message;
}
1134575
def dispatch(self):
        ''
        import flask
        body = flask.request.get_json()
        return self. dispatch_with_args(body, argMap=dict())
1343022
function(view, event_name, event_object, targets) {

		this._dispatchCallback(
			view,
			targets,
			this._callHandleEvent,
			{
				event_name: event_name,
				event_object: event_object
			},
			this._global_event_targets
		);

	}
830089
function ActionProvider(dispatcher){

    this.action1 = function(data){
        console.log("Action 1");
        // this way, the dispatcher establishes dynamically the action binding.
        dispatcher.dispatch('action1', data);
    };

    this.action2 = function(data){
        console.log("Action 2");
        dispatcher.dispatch('action2', data);
    }
}
1095315
def dispatch(args = {})
    rjr_method = args[:rjr_method]

    # *note* not using concurrent access protection,
    # assumes all handlers/enviroments are registered
    # before first dispatch occurs
    handler     = handler_for(rjr_method)
    environment = env_for(rjr_method)

    return Result.method_not_found(rjr_method) if handler.nil?

    request = Request.new args.merge(:rjr_handler  => handler)

    # set request environment
    request.set_env(environment) unless environment.nil?

    begin
      retval = request.handle
      request.result  = Result.new(:result => retval)

    rescue Exception => e
      warning = "Exception Raised in #{rjr_method} handler #{e}"
      RJR::Logger.warn [warning] + e.backtrace

      request.result = Result.new(:error_code  => -32000,
                                  :error_msg   => e.to_s,
                                  :error_class => e.class)
    end

    store_request request
    return request.result
  end
472489
def post_dispatch(self):
        
        middleware = sort_by_priority(self, reverse=True)
        return tuple(m.post_dispatch for m in middleware if hasattr(m, 'post_dispatch'))
265037
def dispatch():
        
        aliases = SignalDispatcher.signals.keys()

        for alias in aliases:
            handlers = SignalDispatcher.handlers.get(alias)
            signal = SignalDispatcher.signals.get(alias)

            if signal is None or handlers.__len__() == 0:
                continue

            for handler in handlers:
                signal.connect(handler)
737941
def dispatch(self, *args, **kwargs):
        self.__line_pk = kwargs.get('pk', None)
        
        return super(LinesUpdateModalBasket, self).dispatch(*args, **kwargs)
345815
def dispatch(self, *args, **kwargs):
        """"""
        return super(AnimalMonthArchive, self).dispatch(*args, **kwargs)
352990
function peg$subclass(child, parent) {
  function ctor() {
    this.constructor = child;
  }
  ctor.prototype = parent.prototype;
  child.prototype = new ctor();
}
831050
function dispatch(request, response) {
    return Promise.resolve()
      .then(resolveRouters.bind(this, request))
      .then(callAction.bind(this, request, response));
  }
311402
def on_self
      scope  = current_scope
      method = scope.lookup(scope.method_call_type, 'self')

      push_value(method.return_value)
    end