/* ========================================================================
Operations
========================================================================
164863
@Override
  public String saveConfig() {
    try {
      T config = getConfig();
      if (config == null) {
        return "No configuration to save";
      }

      ConfigurationStore cs = getStore();

      config.setName(configName);

      cs.saveConfiguration(config);

      return "saved";
    } catch (Throwable t) {
      error(t);
      return t.getLocalizedMessage();
    }
  }
1314079
public void validateOperations(final List<ModelNode> operations) {
        if (operations == null) {
            return;
        }

        for (ModelNode operation : operations) {
            try {
                validateOperation(operation);
            } catch (RuntimeException e) {
                if (exitOnError) {
                    throw e;
                } else {
                    System.out.println("---- Operation validation error:");
                    System.out.println(e.getMessage());
                }

            }
        }
    }
1058974
function serializeOperation(operation, index) {
  var params = operation.params;

  switch (operation.method) {
  case 'create':
    params.constructorParams = serializeParams(params.constructorParams);
    break;

  default:
    params = serializeParams(params);
    params.operationParams = serializeParams(params.operationParams);
  };

  operation.jsonrpc = "2.0";

  operation.id = index;
}
639521
function execute( op ) {
		writeToA = 0;
		address = 0xf0000;

		debugPC = PC;

		switch( op ) {
		case 0x3e:
			absoluteIndexedX();
			ROL();
			burn(7);
			break;
		case 0x3d:
			absoluteIndexedX();
			AND();
			burn(4);
			break;
		case 0x85:
			zeroPage();
			STA();
			burn(3);
			break;
		case 0x84:
			zeroPage();
			STY();
			burn(3);
			break;
		case 0x28:
			implied();
			PLP();
			burn(4);
			break;
		case 0x29:
			immediate();
			AND();
			burn(2);
			break;
		case 0xf8:
			implied();
			SED();
			burn(2);
			break;
		case 0xf9:
			absoluteIndexedY();
			SBC();
			burn(4);
			break;
		case 0xf6:
			zeroPageIndexedX();
			INC();
			burn(6);
			break;
		case 0x20:
			absolute();
			JSR();
			burn(6);
			break;
		case 0x21:
			indexedIndirectX();
			AND();
			burn(6);
			break;
		case 0x26:
			zeroPage();
			ROL();
			burn(5);
			break;
		case 0x86:
			zeroPage();
			STX();
			burn(3);
			break;
		case 0x24:
			zeroPage();
			BIT();
			burn(3);
			break;
		case 0x25:
			zeroPage();
			AND();
			burn(2);
			break;
		case 0x35:
			zeroPageIndexedX();
			AND();
			burn(3);
			break;
		case 0x36:
			zeroPageIndexedX();
			ROL();
			burn(6);
			break;
		case 0x31:
			indirectIndexedY();
			AND();
			burn(5);
			break;
		case 0x30:
			relative();
			BMI();
			burn(2);
			break;
		case 0x39:
			absoluteIndexedY();
			AND();
			burn(4);
			break;
		case 0x38:
			implied();
			SEC();
			burn(2);
			break;
		case 0x8c:
			absolute();
			STY();
			burn(4);
			break;
		case 0x2c:
			absolute();
			BIT();
			burn(4);
			break;
		case 0xfd:
			absoluteIndexedX();
			SBC();
			burn(4);
			break;
		case 0xfe:
			absoluteIndexedX();
			INC();
			burn(7);
			break;
		case 0x2d:
			absolute();
			AND();
			burn(4);
			break;
		case 0x2e:
			absolute();
			ROL();
			burn(6);
			break;
		case 0xba:
			implied();
			TSX();
			burn(2);
			break;
		case 0x5e:
			absoluteIndexedX();
			LSR();
			burn(7);
			break;
		case 0x5d:
			absoluteIndexedX();
			EOR();
			burn(4);
			break;
		case 0x40:
			implied();
			RTI();
			burn(6);
			break;
		case 0x41:
			indexedIndirectX();
			EOR();
			burn(6);
			break;
		case 0x45:
			zeroPage();
			EOR();
			burn(3);
			break;
		case 0x46:
			zeroPage();
			LSR();
			burn(5);
			break;
		case 0x48:
			implied();
			PHA();
			burn(3);
			break;
		case 0x49:
			immediate();
			EOR();
			burn(2);
			break;
		case 0xae:
			absolute();
			LDX();
			burn(4);
			break;
		case 0xad:
			absolute();
			LDA();
			burn(4);
			break;
		case 0xac:
			absolute();
			LDY();
			burn(4);
			break;
		case 0xaa:
			implied();
			TAX();
			burn(2);
			break;
		case 0x4a:
			accumulator();
			LSR();
			burn(2);
			break;
		case 0x4c:
			absolute();
			JMP();
			burn(3);
			break;
		case 0x4d:
			absolute();
			EOR();
			burn(4);
			break;
		case 0x4e:
			absolute();
			LSR();
			burn(6);
			break;
		case 0x51:
			indirectIndexedY();
			EOR();
			burn(5);
			break;
		case 0x50:
			relative();
			BVC();
			burn(2);
			break;
		case 0x56:
			zeroPageIndexedX();
			LSR();
			burn(6);
			break;
		case 0x55:
			zeroPageIndexedX();
			EOR();
			burn(4);
			break;
		case 0x9a:
			implied();
			TXS();
			burn(2);
			break;
		case 0xe5:
			zeroPage();
			SBC();
			burn(3);
			break;
		case 0x59:
			absoluteIndexedY();
			EOR();
			burn(4);
			break;
		case 0x58:
			implied();
			CLI();
			burn(2);
			break;
		case 0x2a:
			accumulator();
			ROL();
			burn(2);
			break;
		case 0xa9:
			immediate();
			LDA();
			burn(2);
			break;
		case 0xa8:
			implied();
			TAY();
			burn(2);
			break;
		case 0xa6:
			zeroPage();
			LDX();
			burn(3);
			break;
		case 0xa5:
			zeroPage();
			LDA();
			burn(3);
			break;
		case 0xa2:
			immediate();
			LDX();
			burn(2);
			break;
		case 0xa1:
			indexedIndirectX();
			LDA();
			burn(6);
			break;
		case 0xa0:
			immediate();
			LDY();
			burn(2);
			break;
		case 0xa4:
			zeroPage(0);
			LDY();
			burn(3);
			break;
		case 0xf5:
			zeroPageIndexedX();
			SBC();
			burn(4);
			break;
		case 0x7e:
			absoluteIndexedX();
			ROR();
			burn(7);
			break;
		case 0x7d:
			absoluteIndexedX();
			ADC();
			burn(4);
			break;
		case 0xf0:
			relative();
			BEQ();
			burn(2);
			break;
		case 0x68:
			implied();
			PLA();
			burn(4);
			break;
		case 0x69:
			immediate();
			ADC();
			burn(2);
			break;
		case 0x66:
			zeroPage();
			ROR();
			burn(5);
			break;
		case 0x65:
			zeroPage();
			ADC();
			burn(3);
			break;
		case 0x60:
			implied();
			RTS();
			burn(6);
			break;
		case 0x61:
			indexedIndirectX();
			ADC();
			burn(6);
			break;
		case 0xce:
			absolute();
			DEC();
			burn(6);
			break;
		case 0xcd:
			absolute();
			CMP();
			burn(4);
			break;
		case 0xb8:
			implied();
			CLV();
			burn(2);
			break;
		case 0xb9:
			absoluteIndexedY();
			LDA();
			burn(4);
			break;
		case 0xca:
			implied();
			DEX();
			burn(2);
			break;
		case 0xcc:
			absolute();
			CPY();
			burn(4);
			break;
		case 0xb0:
			relative();
			BCS();
			burn(2);
			break;
		case 0xb1:
			indirectIndexedY();
			LDA();
			burn(5);
			break;
		case 0xb6:
			zeroPageIndexedY();
			LDX();
			burn(4);
			break;
		case 0xb4:
			zeroPageIndexedX();
			LDY();
			burn(4);
			break;
		case 0xb5:
			zeroPageIndexedX();
			LDA();
			burn(4);
			break;
		case 0x8a:
			implied();
			TXA();
			burn(2);
			break;
		case 0x6d:
			absolute();
			ADC();
			burn(4);
			break;
		case 0x6e:
			absolute();
			ROR();
			burn(6);
			break;
		case 0x6c:
			indirect();
			JMP();
			burn(5);
			break;
		case 0x6a:
			accumulator();
			ROR();
			burn(2);
			break;
		case 0x79:
			absoluteIndexedY();
			ADC();
			burn(4);
			break;
		case 0x78:
			implied();
			SEI();
			burn(2);
			break;
		case 0x71:
			indirectIndexedY();
			ADC();
			burn(5);
			break;
		case 0x70:
			relative();
			BVS();
			burn(2);
			break;
		case 0x75:
			zeroPageIndexedX();
			ADC();
			burn(4);
			break;
		case 0x76:
			zeroPageIndexedX();
			ROR();
			burn(6);
			break;
		case 0xc5:
			zeroPage();
			CMP();
			burn(3);
			break;
		case 0xc4:
			zeroPage();
			CPY();
			burn(3);
			break;
		case 0xc6:
			zeroPage();
			DEC();
			burn(5);
			break;
		case 0xc1:
			indexedIndirectX();
			CMP();
			burn(6);
			break;
		case 0xc0:
			immediate();
			CPY();
			burn(2);
			break;
		case 0xbc:
			absoluteIndexedX();
			LDY();
			burn(4);
			break;
		case 0xe4:
			zeroPage();
			CPX();
			burn(3);
			break;
		case 0xc9:
			immediate();
			CMP();
			burn(2);
			break;
		case 0xc8:
			implied();
			INY();
			burn(2);
			break;
		case 0xbd:
			absoluteIndexedX();
			LDA();
			burn(4);
			break;
		case 0xbe:
			absoluteIndexedY();
			LDX();
			burn(4);
			break;
		case 0xf1:
			indirectIndexedY();
			SBC();
			burn(5);
			break;
		case 0xe9:
			immediate();
			SBC();
			burn(2);
			break;
		case 0xd0:
			relative();
			BNE();
			burn(2);
			break;
		case 0xd1:
			indirectIndexedY();
			CMP();
			burn(5);
			break;
		case 0x9d:
			absoluteIndexedX();
			STA();
			burn(5);
			break;
		case 0x08:
			implied();
			PHP();
			burn(3);
			break;
		case 0xd5:
			zeroPageIndexedX();
			CMP();
			burn(4);
			break;
		case 0xd6:
			zeroPageIndexedX();
			DEC();
			burn(6);
			break;
		case 0xd8:
			implied();
			CLD();
			burn(2);
			break;
		case 0xd9:
			absoluteIndexedY();
			CMP();
			burn(4);
			break;
		case 0x06:
			zeroPage();
			ASL();
			burn(5);
			break;
		case 0x00:
			implied();
			BRK();
			burn(7);
			break;
		case 0x01:
			indexedIndirectX();
			ORA();
			burn(6);
			break;
		case 0xec:
			absolute();
			CPX();
			burn(4);
			break;
		case 0x05:
			zeroPage();
			ORA();
			burn(2);
			break;
		case 0xea:
			implied();
			NOP();
			burn(2);
			break;
		case 0x81:
			indexedIndirectX();
			STA();
			burn(6);
			break;
		case 0xee:
			absolute();
			INC();
			burn(6);
			break;
		case 0xed:
			absolute();
			SBC();
			burn(4);
			break;
		case 0x1e:
			absoluteIndexedX();
			ASL();
			burn(7);
			break;
		case 0x1d:
			absoluteIndexedX();
			ORA();
			burn(4);
			break;
		case 0x88:
			implied();
			DEY();
			burn(2);
			break;
		case 0x09:
			immediate();
			ORA();
			burn(2);
			break;
		case 0x8d:
			absolute();
			STA();
			burn(4);
			break;
		case 0x8e:
			absolute();
			STX();
			burn(4);
			break;
		case 0xe1:
			indexedIndirectX();
			SBC();
			burn(6);
			break;
		case 0xe0:
			immediate();
			CPX();
			burn(2);
			break;
		case 0xe6:
			zeroPage();
			INC();
			burn(5);
			break;
		case 0x19:
			absoluteIndexedY();
			ORA();
			burn(4);
			break;
		case 0x18:
			implied();
			CLC();
			burn(2);
			break;
		case 0x16:
			zeroPageIndexedX();
			ASL();
			burn(6);
			break;
		case 0x15:
			zeroPageIndexedX();
			ORA();
			burn(3);
			break;
		case 0xe8:
			implied();
			INX();
			burn(2);
			break;
		case 0x11:
			indirectIndexedY();
			ORA();
			burn(5);
			break;
		case 0x10:
			relative();
			BPL();
			burn(2);
			break;
		case 0x96:
			zeroPageIndexedY();
			STX();
			burn(4);
			break;
		case 0x95:
			zeroPageIndexedX();
			STA();
			burn(4);
			break;
		case 0x94:
			zeroPageIndexedX();
			STY();
			burn(4);
			break;
		case 0xdd:
			absoluteIndexedX();
			CMP();
			burn(4);
			break;
		case 0xde:
			absoluteIndexedX();
			DEC();
			burn(7);
			break;
		case 0x91:
			indirectIndexedY();
			STA();
			burn(6);
			break;
		case 0x90:
			relative();
			BCC();
			burn(2);
			break;
		case 0x0d:
			absolute();
			ORA();
			burn(4);
			break;
		case 0x0e:
			absolute();
			ASL();
			burn(6);
			break;
		case 0x0a:
			accumulator();
			ASL();
			burn(2);
			break;
		case 0x99:
			absoluteIndexedY();
			STA();
			burn(5);
			break;
		case 0x98:
			implied();
			TYA();
			burn(2);
			break;
		default:
			PC += 1;
			//throw new Error("Invalid opcode! " + op);
		}
	}
243065
function (module, action, params) {
        "use strict";
    
        var log = localStorage.getItem('log');
        if (log) {
            if (!params) params = {};
            params.log = log;
        }
    
        Object.defineProperty(this, 'action', {
            'get': function () {
                return action;
            }
        });
    
        var serialized = {
            'moduleID': module.ID,
            'action': action,
            'params': params
        };
    
        Object.defineProperty(this, 'params', {
            'get': function () {
                return params;
            }
        });
    
        if (module.ID.substr(0, 10) === 'libraries/') {
            serialized.version = module.library.version;
        }
        else {
            serialized.version = beyond.params.version;
        }
    
        Object.defineProperty(this, 'serialized', {
            'get': function () {
    
                var output = {};
                $.extend(output, serialized, true);
                return output;
    
            }
        });
    
    }
435249
function setOperations(operations, portType) {
  _.forEach(portType.childNodes, node => {
    if (node.localName === 'operation') {
      operations[node.getAttribute('name')] = node;
    }
  });
}
262401
function () {
		if ( server || ( !client.ie || client.version > 8 ) ) {
			return function ( obj, key ) {
				key = ( key === true );
				var o = [];

				if ( !isNaN( obj.length ) ) {
					o = slice.call( obj );
				}
				else if ( key ) {
					o = array.keys( obj );
				}
				else {
					utility.iterate( obj, function ( i ) {
						o.push( i );
					});
				}

				return o;
			};
		}
		else {
			return function ( obj, key ) {
				key   = ( key === true );
				var o = [];

				if ( !isNaN( obj.length ) ) {
					try {
						o = slice.call( obj );
					}
					catch ( e ) {
						utility.iterate( obj, function ( i, idx ) {
							if ( idx !== "length" ) {
								o.push( i );
							}
						});
					}
				}
				else if ( key ) {
					o = array.keys( obj );
				}
				else {
					utility.iterate( obj, function ( i ) {
						o.push( i );
					});
				}

				return o;
			};
		}
	}
562524
@SuppressWarnings("unchecked")
    private List<String> operations(Map<String, Object> ops) {
        List<String> result = new LinkedList<>();
        for (String operation : ops.keySet()) {
            Object operationOrListOfOperations = ops.get(operation);
            List<Map<String, Object>> toStringify;
            if (operationOrListOfOperations instanceof List) {
                toStringify = (List<Map<String, Object>>) operationOrListOfOperations;
            } else {
                toStringify = Collections.singletonList((Map<String, Object>) operationOrListOfOperations);
            }
            for (Map<String, Object> op : toStringify) {
                List<Map<String, String>> args = (List<Map<String, String>>) op.get("args");
                result.add(operation + "(" + argsToString(args) + ")");
            }
        }

        return result;
    }
1000034
function () {
                var negate, p = input.charAt(i + 1);

                if (input.charAt(i) === '-' && (p === '@' || p === '(')) { negate = $('-') }
                var o = $(this.sub) || $(this.entities.dimension) ||
                        $(this.entities.color) || $(this.entities.variable) ||
                        $(this.entities.call);
                return negate ? new(tree.Operation)('*', [new(tree.Dimension)(-1), o])
                              : o;
            }
366741
function () {
            var _data = this._dataElement().data("bind");
            if (typeof _data == "string" && typeof ko == "object") {
                var _vm = ko.dataFor(this._dataElement()[0]);
                if (typeof _vm == "undefined") return true;
                var _all = _data.split(","), _handler;
                for (var i = 0; i < _all.length; i++) {
                    var d = _all[i].split(":");
                    if ($.trim(d[0]) == "value") {
                        _handler = $.trim(d[1]);
                        break;
                    }
                }
                if (_handler) {
                    this._isKO = true;
                    ko.computed(function () { this.option("value", _vm[_handler]()); }, this);
                }
            }
        }
12499
private <T> T execute(Operation<T> operation) throws Exception {
    return execute(operation, null);
  }
173641
function checkPostOrPutOrPatchRequest(req, res, cb) {
            var _keys;
            var _reqElement;

            if (req.body) {
                _keys = Object.keys(req.body);
                _keys.forEach(function (keyElement) {
                    _reqElement = req.body[keyElement];
                    //console.log(/" [a-z]*="/i.spec(_reqElement));
                    _patterns.forEach(function (pattern) {
                        if (pattern.test(_reqElement) && _blocker.blockHost) {
                            _config.attack.handle(req, res);
                        }
                    });
                });
            }
            if (cb) {
                cb();
            }
        }
1175898
function process( $tpl, &$textElements, $functionName, $functionChildren, $functionParameters, $functionPlacement, $rootNamespace, $currentNamespace )
    {
        $children = $functionChildren;
        $params = $functionParameters;
        $name = "";
        if ( isset( $params["name"] ) )
            $name = $tpl->elementValue( $params["name"], $rootNamespace, $currentNamespace, $functionPlacement );
        $varName = false;
        if ( isset( $params["var"] ) )
            $varName = $tpl->elementValue( $params["var"], $rootNamespace, $currentNamespace, $functionPlacement );
        if ( $currentNamespace != "" )
        {
            if ( $name != "" )
                $name = "$currentNamespace:$name";
            else
                $name = $currentNamespace;
        }
        if ( isset( $params["match"] ) )
            $match = $tpl->elementValue( $params["match"], $rootNamespace, $currentNamespace, $functionPlacement );
        else
        {
            $tpl->missingParameter( $this->SwitchName, "match" );
            return false;
        }

        $items = array();
        $in_items = array();
        $def = null;
        $case = null;
        if ( is_array( $children ) )
        {
            foreach( $children as $child )
            {
                $childType = $child[0];
                if ( $childType == eZTemplate::NODE_FUNCTION )
                {
                    switch ( $child[2] )
                    {
                        case "case":
                        {
                            $child_params = $child[3];
                            if ( isset( $child_params["match"] ) )
                            {
                                $child_match = $child_params["match"];
                                $child_match = $tpl->elementValue( $child_match, $rootNamespace, $currentNamespace, $functionPlacement );
                                if ( !isset( $items[$child_match] ) )
                                {
                                    $items[$child_match] = $child;
                                    if ( $case === null and
                                         $match == $child_match )
                                    {
                                        $case = $child;
                                    }
                                }
                                else
                                {
                                    $tpl->warning( $this->SwitchName, "Match value $child_match already set, skipping", $functionPlacement );
                                }
                            }
                            else if ( isset( $child_params["in"] ) )
                            {
                                $key_name = null;
                                if ( isset( $child_params["key"] ) )
                                {
                                    $child_key = $child_params["key"];
                                    $key_name = $tpl->elementValue( $child_key, $rootNamespace, $currentNamespace, $functionPlacement );
                                }
                                $child_in = $child_params["in"];
                                $child_in = $tpl->elementValue( $child_in, $rootNamespace, $currentNamespace, $functionPlacement );
                                if ( !is_array( $child_in ) )
                                    break;
                                if ( $case === null )
                                {
                                    if ( $key_name === null )
                                    {
                                        if ( in_array( $match, $child_in ) )
                                        {
                                            $case = $child;
                                        }
                                    }
                                    else
                                    {
                                        foreach( $child_in as $child_in_element )
                                        {
                                            if ( !is_array( $key_name ) )
                                                $key_name_array = array( $key_name );
                                            else
                                                $key_name_array = $key_name;
                                            $child_value = $tpl->variableAttribute( $child_in_element, $key_name );
                                            if ( $child_value == $match )
                                            {
                                                $case = $child;
                                                break;
                                            }
                                        }
                                    }
                                }
                            }
                            else
                            {
                                $def = $child;
                            }
                        } break;
                        default:
                        {
                            $tpl->warning( $this->SwitchName, "Only case functions are allowed as children, found \""
                                           . $child[2] . "\"", $functionPlacement );
                        } break;
                    }
                }
                else if ( $childType == eZTemplate::NODE_TEXT )
                {
                    // Ignore text.
                }
                else
                {
                    $tpl->warning( $this->SwitchName, "Only functions are allowed as children, found \""
                                   . $childType . "\"", $functionPlacement );
                }
            }
        }

        if ( $case === null )
        {
            $case = $def;
        }

        if ( $case !== null )
        {
            if ( $varName !== false )
                $tpl->setVariable( $varName, $match, $name );
            else
                $tpl->setVariable( "match", $match, $name );
            $case_children = $case[1];
            if ( $case_children )
            {
                foreach( $case_children as $case_child )
                {
                    $tpl->processNode( $case_child, $textElements, $rootNamespace, $name );
                }
            }
        }
        else
            $tpl->warning( $this->SwitchName, "No case match and no default case", $functionPlacement );
        return;
    }
758663
function (db, id, operations, cb) {
			request.patch({
				url: host + 'databases/' + db + '/docs/' + id,
				headers: {
					'Content-Type': 'application/json; charset=utf-8'
				},
				body: JSON.stringify(operations)
			}, function (error, response, resBody) {
				if (!error && response.statusCode === 200) {
					var result = JSON.parse(resBody);
					cb(null, result);
				} else {
					cb(error || new Error(response.statusCode), null);
				}
			});
		}
1034251
function(query) {
	//	console.log(query);
	// Loop over all sources
	// Todo: make this loop smaller and more graspable
	for (var k = 0, klen = query.sources.length; k < klen; k++) {
		var source = query.sources[k];
		delete source.ix;
		// If there is indexation rule
		//console.log('preIndex', source);
		//console.log(source);
		if (k > 0 && source.optimization == 'ix' && source.onleftfn && source.onrightfn) {
			// If there is no table.indices - create it
			if (source.databaseid && alasql.databases[source.databaseid].tables[source.tableid]) {
				if (!alasql.databases[source.databaseid].tables[source.tableid].indices)
					query.database.tables[source.tableid].indices = {};
				// Check if index already exists
				var ixx =
					alasql.databases[source.databaseid].tables[source.tableid].indices[
						hash(source.onrightfns + '`' + source.srcwherefns)
					];
				if (!alasql.databases[source.databaseid].tables[source.tableid].dirty && ixx) {
					source.ix = ixx;
				}
			}

			if (!source.ix) {
				source.ix = {};
				// Walking over source data
				var scope = {};
				var i = 0;
				var ilen = source.data.length;
				var dataw;
				//				while(source.getfn i<ilen) {

				while (
					(dataw = source.data[i]) ||
					(source.getfn && (dataw = source.getfn(i))) ||
					i < ilen
				) {
					if (source.getfn && !source.dontcache) source.data[i] = dataw;
					//					scope[tableid] = dataw;

					//				for(var i=0, ilen=source.data.length; i<ilen; i++) {
					// Prepare scope for indexation
					scope[source.alias || source.tableid] = dataw;

					// Check if it apply to where function
					if (source.srcwherefn(scope, query.params, alasql)) {
						// Create index entry for each address
						var addr = source.onrightfn(scope, query.params, alasql);
						var group = source.ix[addr];
						if (!group) {
							group = source.ix[addr] = [];
						}
						group.push(dataw);
					}
					i++;
				}

				if (
					source.databaseid &&
					alasql.databases[source.databaseid].tables[source.tableid]
				) {
					// Save index to original table
					alasql.databases[source.databaseid].tables[source.tableid].indices[
						hash(source.onrightfns + '`' + source.srcwherefns)
					] =
						source.ix;
				}
			}
			//console.log(38,274,source.ix);

			// Optimization for WHERE column = expression
		} else if (source.wxleftfn) {
			if (!alasql.databases[source.databaseid].engineid) {
				// Check if index exists
				ixx =
					alasql.databases[source.databaseid].tables[source.tableid].indices[
						hash(source.wxleftfns + '`')
					];
			}
			if (!alasql.databases[source.databaseid].tables[source.tableid].dirty && ixx) {
				// Use old index if exists
				source.ix = ixx;
				// Reduce data (apply filter)
				source.data = source.ix[source.wxrightfn(null, query.params, alasql)];
			} else {
				// Create new index
				source.ix = {};
				// Prepare scope
				scope = {};
				// Walking on each source line
				i = 0;
				ilen = source.data.length;
				dataw;
				//				while(source.getfn i<ilen) {

				while (
					(dataw = source.data[i]) ||
					(source.getfn && (dataw = source.getfn(i))) ||
					i < ilen
				) {
					if (source.getfn && !source.dontcache) source.data[i] = dataw;
					//					for(var i=0, ilen=source.data.length; i<ilen; i++) {
					scope[source.alias || source.tableid] = source.data[i];
					// Create index entry
					addr = source.wxleftfn(scope, query.params, alasql);
					group = source.ix[addr];
					if (!group) {
						group = source.ix[addr] = [];
					}
					group.push(source.data[i]);
					i++;
				}
				//					query.database.tables[source.tableid].indices[hash(source.wxleftfns+'`'+source.onwherefns)] = source.ix;
				if (!alasql.databases[source.databaseid].engineid) {
					alasql.databases[source.databaseid].tables[source.tableid].indices[
						hash(source.wxleftfns + '`')
					] =
						source.ix;
				}
			}
			// Apply where filter to reduces rows
			if (source.srcwherefns) {
				if (source.data) {
					scope = {};
					source.data = source.data.filter(function(r) {
						scope[source.alias] = r;
						return source.srcwherefn(scope, query.params, alasql);
					});
				} else {
					source.data = [];
				}
			}
			//			}
			// If there is no any optimization than apply srcwhere filter
		} else if (source.srcwherefns && !source.dontcache) {
			if (source.data) {
				var scope = {};
				// TODO!!!!! Data as Function

				source.data = source.data.filter(function(r) {
					scope[source.alias] = r;
					//					console.log(288,source);
					return source.srcwherefn(scope, query.params, alasql);
				});

				scope = {};
				i = 0;
				ilen = source.data.length;
				//var dataw;
				var res = [];
				//				while(source.getfn i<ilen) {

				while (
					(dataw = source.data[i]) ||
					(source.getfn && (dataw = source.getfn(i))) ||
					i < ilen
				) {
					if (source.getfn && !source.dontcache) source.data[i] = dataw;
					scope[source.alias] = dataw;
					if (source.srcwherefn(scope, query.params, alasql)) res.push(dataw);
					i++;
				}
				source.data = res;
			} else {
				source.data = [];
			}
		}
		// Change this to another place (this is a wrong)
		if (source.databaseid && alasql.databases[source.databaseid].tables[source.tableid]) {
			//query.database.tables[source.tableid].dirty = false;
		} else {
			// this is a subquery?
		}
	}
}
314429
function operationId(given, method, url, allKnown) {
  var id;
  var generate = given == null;
  if (generate) {
    id = toIdentifier(method + url);
  } else {
    id = toIdentifier(given);
  }
  var duplicated = allKnown.has(id);
  if (duplicated) {
    var i = 1;
    while (allKnown.has(id + '_' + i)) {
      i++;
    }
    id = id + '_' + i;
  }
  if (generate) {
    console.warn(
      "Operation '" +
        method +
        "' on '" +
        url +
        "' defines no operationId. Assuming '" +
        id +
        "'."
    );
  } else if (duplicated) {
    console.warn(
      "Operation '" +
        method +
        "' on '" +
        url +
        "' defines a duplicated operationId: " +
        given +
        '. ' +
        "Assuming '" +
        id +
        "'."
    );
  }
  allKnown.add(id);
  return id;
}
347301
function Operation(spec, options, fn) {
  if (typeof options === 'function') {
    fn = [].slice.call(arguments).slice(1);
    options = {};
  } else if (Array.isArray(options)) {
    fn = options;
    options = {};
  } else if (!Array.isArray(fn)) {
    fn = [].slice.call(arguments).slice(2);
  }

  if (!(this instanceof Operation)) {
    return new Operation(spec, options, fn);
  }

  if (typeof spec !== 'object') {
    throw new Error('operation spec must be an object');
  }

  debug('create operation', spec);

  this.spec = spec;
  this.options = options || {};
  this.fn = fn;
  this.middleware = {};
}