=== Abstract Operations ===
541093
function nonEnum(obj) {

  Object.getOwnPropertyNames(obj).forEach(k => {
    Object.defineProperty(obj, k, { enumerable: false });
  });

  return obj;
}
777892
private Expression joinOperations(Expression result, String operation, Expression next) {
        if (!(result instanceof Operation)) {
            return new Operation(operation, result, next);
        }
        Operation farRight = (Operation) result;
        while (farRight.getRight() instanceof Operation) {
            farRight = (Operation) farRight.getRight();
        }
        if (!farRight.isProtect() && ("+".equals(farRight.getOperation()) || "-".equals(farRight.getOperation()))) {
            farRight.setRight(new Operation(operation, farRight.getRight(), next));
            return result;
        }

        return new Operation(operation, result, next);
    }
267275
private static Map<Method, OperationId> findMethods(Class<?> type) {
    Map<Method, OperationId> operations = new HashMap<>();
    for (Method method : type.getDeclaredMethods()) {
      OperationId operationId = getOperationId(method);
      if (operationId != null) {
        if (operations.values().stream().anyMatch(operation -> operation.id().equals(operationId.id()))) {
          throw new IllegalStateException("Duplicate operation name '" + operationId.id() + "'");
        }
        operations.put(method, operationId);
      }
    }
    for (Class<?> iface : type.getInterfaces()) {
      operations.putAll(findMethods(iface));
    }
    return operations;
  }
450633
private final V getImplicitVar(ImplicitVar var, boolean allowDeclaredVars) {
    S scope = thisScope();
    while (scope != null) {
      if (var.isMadeByScope(scope)) {
        V result = ((AbstractScope<S, V>) scope).implicitVars.get(var);
        if (result == null) {
          ((AbstractScope<S, V>) scope).implicitVars.put(var, result = scope.makeImplicitVar(var));
        }
        return result;
      }
      V result = allowDeclaredVars ? scope.getOwnSlot(var.name) : null;
      if (result != null) {
        return result;
      }
      // Recurse up the parent Scope
      scope = scope.getParent();
    }
    return null;
  }
403621
function createAbstractClass(params, constructor) {
        if (!isObject(params)) {
            throw new Error('Expected abstract class definition to be an object with the abstract class members.');
        }
        // Validate class name
        if (hasOwn(params, '$name')) {
            if (!isString(params.$name)) {
                throw new Error('Abstract class name must be a string.');
            } else if (/\s+/.test(params.$name)) {
                throw new Error('Abstract class name cannot have spaces.');
            }
        } else {
            params.$name = 'Unnamed';
        }

        var def,
            abstractObj = { methods: {}, staticMethods: {}, unimplemented: 0 },
            saved = {},
            key;

        // If we are extending an abstract class also, inherit the abstract methods
        if (isFunction(params.$extends)) {
            if (params.$extends[$abstract]) {
                mixIn(abstractObj.methods, params.$extends[$abstract].methods);
                mixIn(abstractObj.staticMethods, params.$extends[$abstract].staticMethods);
            }
        }

        // Handle abstract methods
        if (hasOwn(params, '$abstracts')) {
            saved.$abstracts = params.$abstracts;     // Save them for later use
        }

        // Handle interfaces
        if (hasOwn(params, '$implements')) {
            saved.$interfaces = params.$implements;   // Save them for later use
        }

        // Create the class definition
        def = Class.$create(params, constructor, { isAbstract: true });

        abstractObj.check = bind(checkClass, def);

        if (hasDefineProperty) {
            Object.defineProperty(def, $abstract, {
                value: abstractObj,
                writable: false
            });
        } else {
            def[$abstract] = abstractObj;
        }

        // Parse the saved interfaces
        if (hasOwn(saved, '$interfaces')) {
            parseInterfaces(saved.$interfaces, def);
        }

        // Parse the abstract methods
        if (hasOwn(saved, '$abstracts')) {
            parseAbstracts(saved.$abstracts, def);
        }

        // Finally update the unimplemented count
        for (key in def[$abstract].methods) {
            if (!def[$class].methods[key]) {
                abstractObj.unimplemented += 1;
            }
        }
        for (key in def[$abstract].staticMethods) {
            if (!def[$class].staticMethods[key]) {
                abstractObj.unimplemented += 1;
            }
        }

        return def;
    }
761417
private SemanticType checkIntegerOperator(Expr.BinaryOperator expr, Environment environment) {
		checkOperand(Type.Int, expr.getFirstOperand(), environment);
		checkOperand(Type.Int, expr.getSecondOperand(), environment);
		return Type.Int;
	}
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;
    }
316726
function parse_operator_type(op, def) {
	op = ''+op;
	if(op.indexOf(':') === -1) {
		return def || 'boolean';
	}
	return op.split(':')[1];
}
843047
function() {
    var stmt = this.stmt()
      , state = this.prevState
      , block
      , op;

    // special-case statements since it
    // is not an expression. We could
    // implement postfix conditionals at
    // the expression level, however they
    // would then fail to enclose properties
    if (this.allowPostfix) {
      this.allowPostfix = false;
      state = 'expression';
    }

    switch (state) {
      case 'assignment':
      case 'expression':
      case 'function arguments':
        while (op =
             this.accept('if')
          || this.accept('unless')
          || this.accept('for')) {
          switch (op.type) {
            case 'if':
            case 'unless':
              stmt = new nodes.If(this.expression(), stmt);
              stmt.postfix = true;
              stmt.negate = 'unless' == op.type;
              this.accept(';');
              break;
            case 'for':
              var key
                , val = this.id().name;
              if (this.accept(',')) key = this.id().name;
              this.expect('in');
              var each = new nodes.Each(val, key, this.expression());
              block = new nodes.Block(this.parent, each);
              block.push(stmt);
              each.block = block;
              stmt = each;
          }
        }
    }

    return stmt;
  }
379374
@Override
	public Element execute(Context context) {

		assert (ops.length == 2 || ops.length == 3);

		// Pop the condition from the data stack.
		boolean condition = false;
		try {
			condition = ((BooleanProperty) ops[0].execute(context)).getValue();
		} catch (ClassCastException cce) {
			throw new EvaluationException(MessageUtils
					.format(MSG_INVALID_IF_ELSE_TEST), sourceRange);
		}

		// Choose the correct operation and execute it.
		Operation op = null;
		if (condition) {
			op = ops[1];
		} else if (ops.length > 2) {
			op = ops[2];
		} else {
			op = Undef.VALUE;
		}
		return op.execute(context);
	}
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;
    }
238113
function match (obj, query) {
  var queryKeys, queryKey, queryValue, i;

  // Primitive query against a primitive type
  // This is a bit of a hack since we construct an object with an arbitrary key only to dereference it later
  // But I don't have time for a cleaner implementation now
  if (isPrimitiveType(obj) || isPrimitiveType(query)) {
    return matchQueryPart({ needAKey: obj }, 'needAKey', query);
  }
    
  // Normal query
  queryKeys = Object.keys(query);
  for (i = 0; i < queryKeys.length; i += 1) {
    queryKey = queryKeys[i];
    queryValue = query[queryKey];
  
    if (queryKey[0] === '$') {
      if (!logicalOperators[queryKey]) { throw "Unknown logical operator " + queryKey; }
      if (!logicalOperators[queryKey](obj, queryValue)) { return false; }
    } else {
      if (!matchQueryPart(obj, queryKey, queryValue)) { return false; }
    }
  }

  return true;
}
163497
def complete_abstract_value(
    exe_context,  # type: ExecutionContext
    return_type,  # type: Union[GraphQLInterfaceType, GraphQLUnionType]
    field_asts,  # type: List[Field]
    info,  # type: ResolveInfo
    path,  # type: List[Union[int, str]]
    result,  # type: Any
):
    # type: (...) -> Dict[str, Any]
    
    runtime_type = None  # type: Union[str, GraphQLObjectType, None]

    # Field type must be Object, Interface or Union and expect sub-selections.
    if isinstance(return_type, (GraphQLInterfaceType, GraphQLUnionType)):
        if return_type.resolve_type:
            runtime_type = return_type.resolve_type(result, info)
        else:
            runtime_type = get_default_resolve_type_fn(result, info, return_type)

    if isinstance(runtime_type, string_types):
        runtime_type = info.schema.get_type(runtime_type)  # type: ignore

    if not isinstance(runtime_type, GraphQLObjectType):
        raise GraphQLError(
            (
                "Abstract type {} must resolve to an Object type at runtime "
                + 'for field {}.{} with value "{}", received "{}".'
            ).format(
                return_type, info.parent_type, info.field_name, result, runtime_type
            ),
            field_asts,
        )

    if not exe_context.schema.is_possible_type(return_type, runtime_type):
        raise GraphQLError(
            u'Runtime Object type "{}" is not a possible type for "{}".'.format(
                runtime_type, return_type
            ),
            field_asts,
        )

    return complete_object_value(
        exe_context, runtime_type, field_asts, info, path, result
    )
1170648
function(oUnitTest) {
          var _,
              /**
               * An array-like object representing the <abbr title=
               * "abstract syntax tree">AST</abbr> obtained after consolidation.
               * @type {!TSyntacticCodeUnit}
               */
              oSyntacticCodeUnitActual =
                  exports.ast_consolidate(oParser.parse(oUnitTest.sInput)),
              /**
               * An array-like object representing the expected <abbr title=
               * "abstract syntax tree">AST</abbr>.
               * @type {!TSyntacticCodeUnit}
               */
              oSyntacticCodeUnitExpected = oParser.parse(
                  oUnitTest.hasOwnProperty('sOutput') ?
                  oUnitTest.sOutput : oUnitTest.sInput);

          delete oSyntacticCodeUnitActual.scope;
          oWalker = oProcessor.ast_walker();
          oWalker.with_walkers(
              oWalkersPurifiers,
              cContext(oWalker, oSyntacticCodeUnitActual));
          try {
            oAssert.deepEqual(
                oSyntacticCodeUnitActual,
                oSyntacticCodeUnitExpected);
          } catch (oException) {
            console.error(
                '########## A unit test has failed.\n' +
                oUnitTest.sTitle + '\n' +
                '#####  actual code  (' +
                oProcessor.gen_code(oSyntacticCodeUnitActual).length +
                ' bytes)\n' +
                oProcessor.gen_code(
                    oSyntacticCodeUnitActual,
                    oCodeGenerationOptions) + '\n' +
                '##### expected code (' +
                oProcessor.gen_code(oSyntacticCodeUnitExpected).length +
                ' bytes)\n' +
                oProcessor.gen_code(
                    oSyntacticCodeUnitExpected,
                    oCodeGenerationOptions));
          }
        }
1149293
static <T> Object[] arguments(final Class<T> klass, final T instance,
                                  final Class<?>[] types,
                                  final String[] literals)
            throws ReflectiveOperationException {
        final Object[] arguments = new Object[literals.length];
        for (int i = 0; i < literals.length; i++) {
            if ("null".equals(literals[i])) {
                arguments[i] = null;
                continue;
            }
            if (literals[i].startsWith(":")) {
                final String name = literals[i].substring(1);
                final Field field = field(klass, name);
                if (!field.isAccessible()) {
                    field.setAccessible(true);
                }
                arguments[i] = field.get(instance);
                continue;
            }
            if (types[i] == String.class) {
                arguments[i] = literals[i];
                continue;
            }
            if (types[i].isPrimitive()) {
                types[i] = wrapper(types[i]);
            }
            arguments[i] = types[i]
                    .getMethod("valueOf", String.class)
                    .invoke(null, literals[i]);
        }
        return arguments;
    }
1246375
public Formula or(final Collection<? extends Formula> operands) {
    final LinkedHashSet<Formula> ops = new LinkedHashSet<>(operands);
    return this.constructOr(ops);
  }
607561
@Override
    public ImmutableSubstitution<ImmutableTerm> composeWith(ImmutableSubstitution<? extends ImmutableTerm> f) {
        if (isEmpty()) {
            return (ImmutableSubstitution<ImmutableTerm>)f;
        }
        if (f.isEmpty()) {
            return (ImmutableSubstitution<ImmutableTerm>)this;
        }

        Map<Variable, ImmutableTerm> substitutionMap = new HashMap<>();

        /**
         * For all variables in the domain of f
         */

        for (Map.Entry<Variable, ? extends ImmutableTerm> gEntry :  f.getImmutableMap().entrySet()) {
            substitutionMap.put(gEntry.getKey(), apply(gEntry.getValue()));
        }

        /**
         * For the other variables (in the local domain but not in f)
         */
        for (Map.Entry<Variable, ? extends ImmutableTerm> localEntry :  getImmutableMap().entrySet()) {
            Variable localVariable = localEntry.getKey();

            if (substitutionMap.containsKey(localVariable))
                continue;

            substitutionMap.put(localVariable, localEntry.getValue());
        }

        return substitutionFactory.getSubstitution(
                substitutionMap.entrySet().stream()
                        // Clean out entries like t/t
                        .filter(entry -> !entry.getKey().equals(entry.getValue()))
                        .collect(ImmutableCollectors.toMap()));
    }