Returns whether the given call to goog.object.createSet can be converted to an object literal.
170628
private boolean canOptimizeObjectCreateSet(Node firstParam) {
    if (firstParam != null
        && firstParam.getNext() == null
        && !(firstParam.isNumber() || firstParam.isString())) {
      // if there is only one argument, and it's an array, then the method uses the array elements
      // as keys. Don't optimize it to {[arr]: true}. We only special-case number and string
      // arguments in order to not regress ES5-out behavior
      return false;
    }

    Node curParam = firstParam;
    Set<String> keys = new HashSet<>();
    while (curParam != null) {
      // All keys must be strings or numbers, otherwise we can't optimize the call.
      if (!isOptimizableKey(curParam)) {
        return false;
      }
      if (curParam.isString() || curParam.isNumber()) {
        String key =
            curParam.isString() ? curParam.getString() : numberToString(curParam.getDouble());
        if (!keys.add(key)) {
          compiler.report(JSError.make(firstParam.getPrevious(), DUPLICATE_SET_MEMBER, key));
          return false;
        }
      }
      curParam = curParam.getNext();
    }
    return true;
  }
570609
function _any(o) {
        if (typeof o!=='object') throw new Error('Invalid Arg: not an object');
        // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/keys
        if (Object.keys(o).length===0) return false;
        for (var x in o) {
          if (o[x]!==null && !/undefined|boolean/.test(typeof o[x]) || typeof o[x]==='boolean' && o[x].toString()!=='false') {
            return true;
          }
        }
        return false;
      }
301590
function (it, S) {
  if (!_isObject(it)) return it;
  var fn, val;
  if (S && typeof (fn = it.toString) == 'function' && !_isObject(val = fn.call(it))) return val;
  if (typeof (fn = it.valueOf) == 'function' && !_isObject(val = fn.call(it))) return val;
  if (!S && typeof (fn = it.toString) == 'function' && !_isObject(val = fn.call(it))) return val;
  throw TypeError("Can't convert object to primitive value");
}
768945
function(oElement, sType) {
			var oInstance = ObjectPath.get(sType);
			if (typeof oInstance === "function") {
				return oElement instanceof oInstance;
			} else {
				return false;
			}
		}
583359
function isReactCreateClassCallBuiltIn(path: NodePath): boolean {
  if (t.ExpressionStatement.check(path.node)) {
    path = path.get('expression');
  }

  if (!match(path.node, { callee: { property: { name: 'createClass' } } })) {
    return false;
  }
  const module = resolveToModule(path.get('callee', 'object'));
  return Boolean(module && isReactModuleName(module));
}
1311255
public static <T> Set<T> immutableSetCopy(Set<T> set) {
      if (set == null) return null;
      if (set.isEmpty()) return Collections.emptySet();
      if (set.size() == 1) return Collections.singleton(set.iterator().next());
      Set<? extends T> copy = ObjectDuplicator.duplicateSet(set);
      if (copy == null)
         // Set uses Collection copy-ctor
         copy = attemptCopyConstructor(set, Collection.class);
      if (copy == null)
         copy = new HashSet<>(set);

      return new ImmutableSetWrapper<>(copy);
   }
410506
public static boolean isObjectMethod(Method method) {
        return OBJECT_METHOD.stream().filter(meta -> meta.equals(method)).limit(1).count() > 0;
    }
64546
private boolean validateAliasiablePrimitiveCall(NodeTraversal t, Node n, String methodName) {
    return validatePrimitiveCallWithMessage(
        t,
        n,
        methodName,
        ProcessClosurePrimitives.CLOSURE_CALL_CANNOT_BE_ALIASED_OUTSIDE_MODULE_ERROR);
  }
12303
private AstNode memberExpr(boolean allowCallSyntax)
        throws IOException
    {
        int tt = peekToken(), lineno = ts.lineno;
        AstNode pn;

        if (tt != Token.NEW) {
            pn = primaryExpr();
        } else {
            consumeToken();
            int pos = ts.tokenBeg;
            NewExpression nx = new NewExpression(pos);

            AstNode target = memberExpr(false);
            int end = getNodeEnd(target);
            nx.setTarget(target);

            int lp = -1;
            if (matchToken(Token.LP, true)) {
                lp = ts.tokenBeg;
                List<AstNode> args = argumentList();
                if (args != null && args.size() > ARGC_LIMIT)
                    reportError("msg.too.many.constructor.args");
                int rp = ts.tokenBeg;
                end = ts.tokenEnd;
                if (args != null)
                    nx.setArguments(args);
                nx.setParens(lp - pos, rp - pos);
            }

            // Experimental syntax: allow an object literal to follow a new
            // expression, which will mean a kind of anonymous class built with
            // the JavaAdapter.  the object literal will be passed as an
            // additional argument to the constructor.
            if (matchToken(Token.LC, true)) {
                ObjectLiteral initializer = objectLiteral();
                end = getNodeEnd(initializer);
                nx.setInitializer(initializer);
            }
            nx.setLength(end - pos);
            pn = nx;
        }
        pn.setLineno(lineno);
        AstNode tail = memberExprTail(allowCallSyntax, pn);
        return tail;
    }
1341507
private static boolean isApplicable(Method method, Property property, boolean strict) {
        if (method.getArguments().size() != 1) {
            return false;
        }

        if (!method.getArguments().get(0).getTypeRef().equals(property.getTypeRef())) {
            return false;
        }

        String capitalized = capitalizeFirst(property.getName());
        if (method.getName().endsWith("set" + capitalized)) {
            return true;
        }

        if (!strict && method.getName().endsWith("set" + property.getNameCapitalized())) {
            return true;
        }
        return false;
    }
843636
def p_object_literal(self, p):
        
        if len(p) == 3:
            p[0] = ast.Object()
        else:
            p[0] = ast.Object(properties=p[2])
824838
function jsify(arg) {
        if (_.isArray(arg)) {
            return _.map(arg, jsify);
        }
        else if (!_.isObject(arg)) {
            return arg;
        }
        else if (Tinkerpop.isLongValue(arg)) {
            // Represent longValue_t as string
            return arg.longValue;
        }
        else if (isType(arg, 'java.util.List')) {
            return _jsifyCollection(arg);
        }
        else if (isType(arg, 'java.util.Map')) {
            return _jsifyMap(arg);
        }
        else if (isType(arg, 'java.util.Map$Entry')) {
            return _jsifyMapEntry(arg);
        }
        else if (isType(arg, 'org.apache.tinkerpop.gremlin.process.traversal.step.util.BulkSet')) {
            // BulkSet is used to hold groupCount result, so it is given special treatment.
            return _jsifyBulkSet(arg);
        }
        else if (isType(arg, 'java.util.Set')) {
            return _jsifyCollection(arg);
        }
        else if (isType(arg, 'org.apache.tinkerpop.gremlin.process.traversal.Path')) {
            return _jsifyPath(arg);
        }
        else {
            return arg;
        }
    }
665960
private boolean canBeConvertedToJUnit4(VisitorState state, List<Type> argumentTypes) {
    // Delta argument is used.
    if (argumentTypes.size() > 2) {
      return true;
    }
    Type firstType = argumentTypes.get(0);
    Type secondType = argumentTypes.get(1);
    // Neither argument is floating-point.
    if (!isFloatingPoint(state, firstType) && !isFloatingPoint(state, secondType)) {
      return true;
    }
    // One argument is not numeric.
    if (!isNumeric(state, firstType) || !isNumeric(state, secondType)) {
      return true;
    }
    // Neither argument is primitive.
    if (!firstType.isPrimitive() && !secondType.isPrimitive()) {
      return true;
    }
    return false;
  }
1295259
private static boolean isCoercibleFrom(EvaluationContext ctx, Object src, Class<?> target) {
        // TODO: This isn't pretty but it works. Significant refactoring would
        //       be required to avoid the exception.
        try {
            ELSupport.coerceToType(ctx, src, target);
        } catch (ELException e) {
            return false;
        }
        return true;
    }
815745
def _instance_callable(obj):
    """"""
    if not isinstance(obj, ClassTypes):
        # already an instance
        return getattr(obj, '__call__', None) is not None

    klass = obj
    # uses __bases__ instead of __mro__ so that we work with old style classes
    if klass.__dict__.get('__call__') is not None:
        return True

    for base in klass.__bases__:
        if _instance_callable(base):
            return True
    return False
32787
void readOTreeSet(int iSize, ObjectInputStream s, V defaultVal) throws java.io.IOException, ClassNotFoundException {
    buildFromSorted(iSize, null, s, defaultVal);
  }
527692
def p_object_literal(self, p):
        
        if len(p) == 3:
            p[0] = self.asttypes.Object()
        else:
            p[0] = self.asttypes.Object(properties=p[2])
        p[0].setpos(p)