code: function operation(cm1, f) {
      return function() {
        var cm = cm1 || this, withOp = !cm.curOp;
        if (withOp) startOperation(cm);
        try { var result = f.apply(cm, arguments); }
        finally { if (withOp) endOperation(cm); }
        return result;
      };
    }
docs: Wraps a function in an operation. Returns the wrapped function.