operation_definition : operation_type name variable_definitions selection_set
347184
def p_operation_definition2(self, p):
        
        p[0] = self.operation_cls(p[1])(
            selections=p[4],
            name=p[2],
            variable_definitions=p[3],
        )
1229951
def perform_set_operation(*args)
      options     = extract_options!(args)
      environment = extract_environment!(options)
      identifier  = normalize_set_identifier(environment)
      # Uses yaml when we have multiple identifiers.
      uses_yaml   = !environment.nil?
      options.merge!(:yaml => true) if uses_yaml
      args.unshift(identifier) unless identifier.nil?
      args << options
      result = rvm(*args)
      uses_yaml ? YAML.load(result.stdout) : result
    end
666968
public Operations getOperationsFor(final PMContext ctx, Object instance, Operation operation) throws PMException {
        final Operations result = new Operations();
        final List<Operation> r = new ArrayList<Operation>();
        if (operation != null) {
            for (Operation op : getOperations()) {
                if (op.isDisplayed(operation.getId()) && op.isEnabled() && !op.equals(operation)) {
                    if (op.getCondition() == null || op.getCondition().check(ctx, instance, op, operation.getId())) {
                        if (instance != null || OperationScope.GENERAL.is(op.getScope()) || OperationScope.SELECTED.is(op.getScope())) {
                            r.add(op);
                        }
                    }
                }
            }
        }
        result.setOperations(r);
        return result;
    }
985479
def parse_operation_definition(lexer: Lexer) -> Node:
    """"""
    start = lexer.token
    if peek(lexer, TokenKind.BRACE_L):
        return Node(
            operation=OperationType.QUERY,
            name=None,
            variable_definitions=[],
            directives=[],
            selection_set=parse_selection_set(lexer),
            loc=loc(lexer, start),
        )
    operation = parse_operation_type(lexer)
    name = parse_name(lexer) if peek(lexer, TokenKind.NAME) else None
    return Node(
        operation=operation,
        name=name,
        variable_definitions=parse_variable_definitions(lexer),
        directives=parse_directives(lexer, False),
        selection_set=parse_selection_set(lexer),
        loc=loc(lexer, start),
    )
755955
def _variable_inputs(self, op):
        
        if op.name not in self._vinputs:
            self._vinputs[op.name] = np.array([t.op in self.between_ops or t in self.model_inputs for t in op.inputs])
        return self._vinputs[op.name]
1060414
private void insertOperationDatatyping(Term term, Function atom, int position) throws UnknownDatatypeException {

        ImmutableTerm immutableTerm = immutabilityTools.convertIntoImmutableTerm(term);

        if (immutableTerm instanceof ImmutableFunctionalTerm) {
            ImmutableFunctionalTerm castTerm = (ImmutableFunctionalTerm) immutableTerm;
            Predicate functionSymbol = castTerm.getFunctionSymbol();
            if (functionSymbol instanceof OperationPredicate) {

                Optional<TermType> inferredType = termTypeInferenceTools.inferType(castTerm);
                if(inferredType.isPresent()){
                    // delete explicit datatypes of the operands
                    deleteExplicitTypes(term, atom, position);
                    // insert the datatype of the evaluated operation
                    atom.setTerm(
                            position,
                            termFactory.getTypedTerm(
                                    term,
                                    // TODO: refactor this cast
                                    (RDFDatatype) inferredType.get()
                            ));
                }
                else
                    {


                    if (defaultDatatypeInferred) {

                        atom.setTerm(position, termFactory.getTypedTerm(term, typeFactory.getXsdStringDatatype()));
                    } else {
                        throw new UnknownDatatypeException("Impossible to determine the expected datatype for the operation " + castTerm + "\n" +
                                "Possible solutions: \n" +
                                "- Add an explicit datatype in the mapping \n" +
                                "- Add in the .properties file the setting: ontop.inferDefaultDatatype = true\n" +
                                " and we will infer the default datatype (xsd:string)"
                        );
                    }
                }
            }
        }
    }
298971
def p_operation_definition3(self, p):
        
        p[0] = self.operation_cls(p[1])(
            selections=p[4],
            name=p[2],
            directives=p[3],
        )
1218007
def variable_names(self):
        
        if self._variable_names is None:

            if self._operator is None:
                if self._operands is None:
                    self._variable_names = tuple()
                else:
                    self._variable_names = self._get_variable_names(self._operands)

            elif self._operator == 'NOT':
                self._variable_names = self._operands.variable_names

            else:
                v = list()
                for op in self._operands:
                    v.extend(op.variable_names)
                self._variable_names = tuple(set(v))

        return self._variable_names
316726
function parse_operator_type(op, def) {
	op = ''+op;
	if(op.indexOf(':') === -1) {
		return def || 'boolean';
	}
	return op.split(':')[1];
}
357375
def p_operation_list(p):
    
    if len(p) == 3:
        p[0] = p[1] + p[2]
    elif len(p) == 2:
        p[0] = p[1]
    else:
        raise RuntimeError("Invalid production rules 'p_operation_list'")
1190688
def op_get_mutate_fields( op_name ):
    
    global MUTATE_FIELDS

    if op_name not in MUTATE_FIELDS.keys():
        raise Exception("No such operation '%s'" % op_name)

    fields = MUTATE_FIELDS[op_name][:]
    return fields
1185230
def get_operation_ast(
    document_ast: DocumentNode, operation_name: Optional[str] = None
) -> Optional[OperationDefinitionNode]:
    
    operation = None
    for definition in document_ast.definitions:
        if isinstance(definition, OperationDefinitionNode):
            if not operation_name:
                # If no operation name was provided, only return an Operation if there
                # is one defined in the document.
                # Upon encountering the second, return None.
                if operation:
                    return None
                operation = definition
            elif definition.name and definition.name.value == operation_name:
                return definition
    return operation
270796
public void setOperationNames(String operationNames) {
		String[] names = operationNames.split(",");
		if (this.operationInfos == null) {
			this.operationInfos = new ArrayList<JmxOperationInfo>();
		}
		for (int i = 0; i < names.length; i++) {
			this.operationInfos.add(new JmxOperationInfo(names[i]));
		}
	}
408054
public <X> DataSet<X> runOperation(CustomUnaryOperation<T, X> operation) {
		Preconditions.checkNotNull(operation, "The custom operator must not be null.");
		operation.setInput(this);
		return operation.createResult();
	}
90585
public static Variable lookup(String varName, BindingSet bindingSet) {
        if (bindingSet == null) {
            return null;
        }
        Binding binding = bindingSet.lookup(varName);
        return (binding != null) ? binding.getVariable() : null;
    }
892754
def apply_cast(scope, input_name, output_name, container, operator_name=None, to=None):
    '''
    
    '''
    name = _create_name_or_use_existing_one(scope, 'Cast', operator_name)
    attrs = {'name': name}

    d = onnx_proto.TensorProto.DataType.DESCRIPTOR
    allowed_type_name_and_type_enum_pairs = {v.number: k for k, v in d.values_by_name.items()}
    if to not in allowed_type_name_and_type_enum_pairs:
        raise ValueError('Attribute "to" must be one of %s' % allowed_type_name_and_type_enum_pairs.keys())

    if container.target_opset < 9:
        if to in [onnx_proto.TensorProto.STRING, onnx_proto.TensorProto.COMPLEX64, onnx_proto.TensorProto.COMPLEX128]:
            raise ValueError('Attribute "to" cannot correspond to a String or Complex TensorProto type.')

        if container.target_opset < 6:
            # Convert enum to string, for example, TensorProto.INT64 to 'INT64'
            attrs['to'] = allowed_type_name_and_type_enum_pairs[to]
            op_version = 1
        else:
            # Enum, for example, TensorProto.INT64
            attrs['to'] = to
            op_version = 6
    else:
        # Enum value, for example, TensorProto.INT64
        # String casting is supported in opset 9
        if to in [onnx_proto.TensorProto.COMPLEX64, onnx_proto.TensorProto.COMPLEX128]:
            raise ValueError('Attribute "to" cannot correspond to a Complex TensorProto type.')
        attrs['to'] = to
        op_version = 9

    container.add_node('Cast', input_name, output_name, op_version=op_version, **attrs)
1149974
public void setOperation(String operation) throws ApplicationException {
	if (StringUtil.isEmpty(operation)) return;
	operation = operation.toLowerCase().trim();
	if (!operation.equals("httprequest")) throw new ApplicationException("attribute operation must have the value [HTTPRequest]");
    }