Dispatch to function held internally depending upon the value of stream.

        Matching on directories is strict. This means dictionaries will
        match if they are exactly the same.
347806
def dispatch_strict(self, stream, *args, **kwargs):
        
        for f, pat in self.functions:
            matched, matched_stream = self._match(stream, pat, 
                                                  {'strict': True}, {})
            if matched:
                return f(matched_stream, *args, **kwargs)

        raise DispatchFailed()
743598
def _dispatch(self, tree):
        ""
        if isinstance(tree, list):
            for t in tree:
                self._dispatch(t)
            return
        meth = getattr(self, "_"+tree.__class__.__name__)
        if tree.__class__.__name__ == 'NoneType' and not self._do_indent:
            return
        meth(tree)
901575
def op_match_funcdef_handle(self, original, loc, tokens):
        """"""
        if len(tokens) == 3:
            func, args = get_infix_items(tokens)
            cond = None
        elif len(tokens) == 4:
            func, args = get_infix_items(tokens[:-1])
            cond = tokens[-1]
        else:
            raise CoconutInternalException("invalid infix match function definition tokens", tokens)
        name_tokens = [func, args]
        if cond is not None:
            name_tokens.append(cond)
        return self.name_match_funcdef_handle(original, loc, name_tokens)
1055824
function onDirectory() {
      var this_SendStream = this;
      if (!/\/$/.test(reqUrl.pathname)) {
        // No trailing slash? Redirect to add one
        res.writeHead(301, {
          'Location': reqUrl.pathname + '/' + (reqUrl.search || '')
        });
        res.end();
        deferred.resolve(true);
        return;
      }

      var indexPath = path.normalize(path.join(
        self.$root, unescape(this.path), 'index.html'));

      fs.exists(indexPath, function(exists) {
        if (exists) {
          // index.html exists, just serve that. This is the same as
          // the below call except without onDirectory and without
          // .index(false)
          send(req, suffix, {root: self.$root})
            .on('error', onError)
            .on('stream', onStream)
            .pipe(res);
          deferred.resolve(true);
        } else {
          // Either serve up 404, or the directory auto-index
          if (!self.$dirIndex) {
            deferred.resolve(null);
          } else {
            deferred.resolve(
              self.$autoindex_p(req, res, this_SendStream.path, self.$blacklist)
            );
          }
        }
      });
    }
95924
@Override
  public void dispatch()
  {
    Result<InputStreamClient> result = _result;
    
    if (result != null) {
      result.ok(_is);
    }
  }
470130
function createStream(func) {
    var dir = Path.dirname(this.options.path);
    Mkdirp.sync(dir);
    return Fs[func](this.options.path, Ul.deepMerge(
        {}
      , this.options.options
      , { flags: this.options.flags }
    ));
}
492038
def transformWith(self, func, other, keepSerializer=False):
        
        if func.__code__.co_argcount == 2:
            two_arg_func = func
            func = lambda _, rdd_a, rdd_b: two_arg_func(rdd_a, rdd_b)

        return TransformedWithDStream(self, func, other)
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]);
    }
  }
  }
}
59864
function getCurrentValue(stream, key) {
	if (stream._currentEvent && stream._currentEvent.type === key) {
		return stream._currentEvent.value;
	} else {
		var names = keyNames[key];
		if (!names) {
			return stream[key];
		}
		var VALUE,
			valueHandler = function(value) {
				VALUE = value;
			};
		stream[names.on](valueHandler);
		stream[names.off](valueHandler);
		return VALUE;
	}
}
524821
def _handle_function_exists(self, node, scope, ctxt, stream):
        
        res = fields.Int()
        try:
            func = self._handle_node(node.expr, scope, ctxt, stream)
            if isinstance(func, functions.BaseFunction):
                res._pfp__set_value(1)
            else:
                res._pfp__set_value(0)
        except errors.UnresolvedID:
            res._pfp__set_value(0)
        return res
816660
def bind(self, func: Callable[[Any], IO]) -> IO:
        """"""

        filename, g = self._get_value()
        return ReadFile(filename, lambda s: g(s).bind(func))
529777
function fork$(parent$, mapFunction) {
  let initValue =
    parent$.value !== undefined ? mapFunction(parent$.value) : undefined;
  return stream(initValue);
}
327600
def _handle_func_def(self, node, scope, ctxt, stream):
        
        self._dlog("handling function definition")
        func = self._handle_node(node.decl, scope, ctxt, stream)
        func.body = node.body
1071991
function (needle, haystack, strict) {

            var found = false;

            strict = !!strict;

            $this.each(haystack, function (key) {
                /* jshint -W116 */
                if ((strict && haystack[key] === needle) || (!strict && haystack[key] == needle)) {
                    found = true;
                    return false;
                }
                /* jshint +W116 */
            });

            return found;
        }
387589
function(values, func) {
        "use strict";
        if (values.forEach) {
            return values.forEach(func);
        } else {
            for (var i=0, len=values.length; i < len; i++) {
                func(values[i], i, values);
            }
        }
    }
1003421
def dispatch_hook(key, hooks, hook_data):
    """"""

    hooks = hooks or dict()

    if key in hooks:
        try:
            return hooks.get(key).__call__(hook_data) or hook_data

        except Exception, why:
            warnings.warn(str(why))

    return hook_data
826966
public boolean compare(FixupStream fs)
   {
      boolean b = true;
      if (fs.getItemSateId() != this.getItemSateId())
         b = false;
      if (fs.getValueDataId() != this.getValueDataId())
         b = false;
      return b;
   }