See ``PlaceholderType.resolve``
195171
def resolve(self, other: Type) -> Optional[Type]:
        """"""
        if not isinstance(other, NltkComplexType):
            return None
        if not isinstance(other.second, NltkComplexType):
            return None
        other_first = other.first.resolve(other.second.first)
        if other_first is None:
            return None
        other_first = other_first.resolve(other.second.second)
        if not other_first:
            return None
        other_second = other.second.resolve(ComplexType(other_first, other_first))
        if not other_second:
            return None
        return BinaryOpType(other_first, self._allowed_substitutions, self._signature)
727317
def resolve(self):
        """"""
        if self.source:
            result = self.source[1][self.source[0]]
            if result:
                return result
        return self.default
428141
function(resolve) {
    var resolvesPromises = {};

    angular.forEach(resolve, function(value, key) {
      var resolution = angular.isString(value) ? $injector.get(value) : $injector.invoke(value, null, null, key);
      resolvesPromises[key] = $q.when(resolution);
    });

    return $q.all(resolvesPromises);
  }
413569
@Override
  JSType resolveInternal(ErrorReporter reporter) {
    if (!getReferencedType().isUnknownType()) {
      // In some cases (e.g. typeof(ns) when the actual type is just a literal object), a NamedType
      // is created solely for the purpose of naming an already-known type. When that happens,
      // there's nothing to look up, so just resolve the referenced type.
      return super.resolveInternal(reporter);
    }

    // TODO(user): Investigate whether it is really necessary to keep two
    // different mechanisms for resolving named types, and if so, which order
    // makes more sense. Now, resolution via registry is first in order to
    // avoid triggering the warnings built into the resolution via properties.
    boolean resolved = resolveViaRegistry(reporter);
    if (!resolved) {
      resolveViaProperties(reporter);
    }

    if (detectInheritanceCycle()) {
      handleTypeCycle(reporter);
    }
    super.resolveInternal(reporter);
    finishPropertyContinuations();

    JSType result = getReferencedType();
    if (isSuccessfullyResolved()) {
      int numKeys = result.getTemplateTypeMap().numUnfilledTemplateKeys();
      if (result.isObjectType()
          && (templateTypes != null && !templateTypes.isEmpty())
          && numKeys > 0) {
        ImmutableList<JSType> typeArgs = this.templateTypes;

        // Ignore any extraneous type args
        // TODO(johnlenz): report an error
        if (numKeys < this.templateTypes.size()) {
          typeArgs = typeArgs.subList(0, numKeys);
        }

        result = registry.createTemplatizedType(result.toMaybeObjectType(), typeArgs);
        setReferencedType(result);
      }

      resolutionScope = null;
    }
    return result;
  }
564162
def restore_placeholders(msgid, translation):
    """"""
    placehoders = re.findall(r'(\s*)(%(?:\(\w+\))?[sd])(\s*)', msgid)
    return re.sub(
        r'(\s*)(__[\w]+?__)(\s*)',
        lambda matches: '{0}{1}{2}'.format(placehoders[0][0], placehoders[0][1], placehoders.pop(0)[2]),
        translation)
33970
function placeholder (input, property) {
  return ( input === undefined || input === '' || input === null ) ? property : input;
}
355004
private static Class<?> resolveType(ELContext context, PropertyDescriptor pd)
    {
        if (pd != null)
        {
            Object type = pd.getValue("type");
            if (type != null)
            {
                type = ((ValueExpression)type).getValue(context);
                if (type instanceof String)
                {
                    try
                    {
                        type = ClassUtils.javaDefaultTypeToClass((String)type);
                    }
                    catch (ClassNotFoundException e)
                    {
                        type = null;
                    }
                }
                return (Class<?>) type;
            }
            return pd.getPropertyType();
        }

        return null;
    }
211
public DataType resolveProperty(DataType sourceType, String identifier, boolean mustResolve) {
        DataType currentType = sourceType;
        while (currentType != null) {
            if (currentType instanceof ClassType) {
                ClassType classType = (ClassType)currentType;
                for (ClassTypeElement e : classType.getElements()) {
                    if (e.getName().equals(identifier)) {
                        if (e.isProhibited()) {
                            throw new IllegalArgumentException(String.format("Element %s cannot be referenced because it is marked prohibited in type %s.", e.getName(), ((ClassType) currentType).getName()));
                        }

                        return e.getType();
                    }
                }
            }
            else if (currentType instanceof TupleType) {
                TupleType tupleType = (TupleType)currentType;
                for (TupleTypeElement e : tupleType.getElements()) {
                    if (e.getName().equals(identifier)) {
                        return e.getType();
                    }
                }
            }
            else if (currentType instanceof IntervalType) {
                IntervalType intervalType = (IntervalType)currentType;
                switch (identifier) {
                    case "low":
                    case "high":
                        return intervalType.getPointType();
                    case "lowClosed":
                    case "highClosed":
                        return resolveTypeName("System", "Boolean");
                    default:
                        // ERROR:
                        throw new IllegalArgumentException(String.format("Invalid interval property name %s.", identifier));
                }
            }
            else if (currentType instanceof ChoiceType) {
                ChoiceType choiceType = (ChoiceType)currentType;
                // TODO: Issue a warning if the property does not resolve against every type in the choice

                // Resolve the property against each type in the choice
                Set<DataType> resultTypes = new HashSet<>();
                for (DataType choice : choiceType.getTypes()) {
                    DataType resultType = resolveProperty(choice, identifier, false);
                    if (resultType != null) {
                        resultTypes.add(resultType);
                    }
                }

                // The result type is a choice of all the resolved types
                if (resultTypes.size() > 1) {
                    return new ChoiceType(resultTypes);
                }

                if (resultTypes.size() == 1) {
                    for (DataType resultType : resultTypes) {
                        return resultType;
                    }
                }
            }
            else if (currentType instanceof ListType && listTraversal) {
                // NOTE: FHIRPath path traversal support
                // Resolve property as a list of items of property of the element type
                ListType listType = (ListType)currentType;
                DataType resultType = resolveProperty(listType.getElementType(), identifier);
                return new ListType(resultType);

            }

            if (currentType.getBaseType() != null) {
                currentType = currentType.getBaseType();
            }
            else {
                break;
            }
        }

        if (mustResolve) {
            // ERROR:
            throw new IllegalArgumentException(String.format("Member %s not found for type %s.", identifier, sourceType != null ? sourceType.toLabel() : null));
        }

        return null;
    }
435469
function resolve (moduleName, callback) {
                logger.trace('resolving: ' + moduleName);

                if (is.regexp(moduleName)) {
                    var modules = resolveTasks.filterMatchingRegistrations(moduleName, context)
                        .map(function (moduleNameText) {
                            return resolveOne(moduleNameText, moduleNameText);
                        })

                    if (is.function(callback)) {
                        callback(null, modules);
                    } else {
                        return modules;
                    }
                }

                return resolveOne(moduleName, moduleName, callback);
            }
667059
function resolve(p, context) {
  try {
    return relative( p
                   , context.getFilename()
                   , context.settings
                   )
  } catch (err) {
    if (!erroredContexts.has(context)) {
      context.report({
        message: `Resolve error: ${err.message}`,
        loc: { line: 1, column: 0 },
      })
      erroredContexts.add(context)
    }
  }
}
950591
function resolveValue(context, fn, source, property, factoryContext){
  var oldAdapter = context[property] || null;
  var newAdapter = null;

  // as functions could be a value, invoke only functions with factory property
  // i.e. source -> function(){ /* factory code */ }).factory === FACTORY
  // apply only for top-level resolveValue() invocation
  if (source && fn !== resolveAdapterProxy && basis.fn.isFactory(source))
    source = source.call(factoryContext || context, factoryContext || context);

  if (source && source.bindingBridge)
  {
    if (!oldAdapter || oldAdapter.source !== source)
      newAdapter = new BBResolveAdapter(context, fn, source, DEFAULT_CHANGE_ADAPTER_HANDLER);
    else
      newAdapter = oldAdapter;

    source = resolveValue(newAdapter, resolveAdapterProxy, source.bindingBridge.get(source), 'next');
  }

  if (property && oldAdapter !== newAdapter)
  {
    var cursor = oldAdapter;

    // drop old adapter chain
    while (cursor)
    {
      var adapter = cursor;
      adapter.detach();
      cursor = adapter.next;
      adapter.next = null;
    }

    if (newAdapter)
      newAdapter.attach(RESOLVEVALUE_DESTROY_ADAPTER_HANDLER);

    context[property] = newAdapter;
  }

  return source;
}
793428
public Type resolve(String fullyQualifiedName) {
        Type local = symbolTable.get(fullyQualifiedName);
        if (local != null) {
            return local;
        }
        for (ProtoContext importedContext : publicImports) {
            Type imported = importedContext.resolve(fullyQualifiedName);
            if (imported != null) {
                return imported;
            }
        }
        for (ProtoContext importedContext : imports) {
            Type imported = importedContext.resolveImport(fullyQualifiedName);
            if (imported != null) {
                return imported;
            }
        }
        return null;
    }
506109
function resolve (options) {
  return {
    apiBuilders: resolveOption(options, 'apiBuilders'),
    languages: resolveOption(options, 'languages'),
    targetVersions: resolveOption(options, 'targetVersions'),
    issueUrl: resolveOption(options, 'issueUrl'),
    processChangelogs: resolveOption(options, 'processChangelogs'),
    changelogReverseVisibleList: resolveOption(options, 'changelogReverseVisibleList'),
    changelogGroupByApi: resolveOption(options, 'changelogGroupByApi')
  }
}
478366
@Override
    public Schema resolve(AnnotatedType annotatedType, ModelConverterContext context, Iterator<ModelConverter> next)
    {
        JavaType classType = TypeFactory.defaultInstance().constructType(annotatedType.getType());
        Class<?> rawClass = classType.getRawClass();
        JavaType resolvedType = classType;

        if ((rawClass != null) &&!resolvedType.isPrimitive())
        {
            // log.debug("resolvedType in " + resolvedType);
            if (rawClass.isAssignableFrom(ServerResponse.class))
            {
                resolvedType = classType.containedType(0);
            }
            else if (rawClass.isAssignableFrom(CompletableFuture.class))
            {
                Class<?> futureCls = classType.containedType(0).getRawClass();

                if (futureCls.isAssignableFrom(ServerResponse.class))
                {
                    // log.debug("class is assignable from ServerResponse");
                    final JavaType futureType = TypeFactory.defaultInstance().constructType(classType.containedType(0));

                    resolvedType = futureType.containedType(0);
                }
                else
                {
                    // log.debug("class is NOT assignable from ServerResponse");
                    resolvedType = classType.containedType(0);
                }
            }

            if (resolvedType != null)
            {
                if (resolvedType.getTypeName().contains("java.lang.Void"))
                {
                    resolvedType = TypeFactory.defaultInstance().constructFromCanonical(Void.class.getName());
                }
                else if (resolvedType.getTypeName().contains("Optional"))
                {
                    if (resolvedType.getTypeName().contains("java.nio.file.Path"))
                    {
                        resolvedType = TypeFactory.defaultInstance().constructParametricType(Optional.class, File.class);
                    }

                    if (resolvedType.getTypeName().contains("ByteBuffer"))
                    {
                        resolvedType = TypeFactory.defaultInstance().constructParametricType(Optional.class, File.class);
                    }
                }
                else
                {
                    if (resolvedType.getTypeName().contains("java.nio.file.Path"))
                    {
                        resolvedType = TypeFactory.defaultInstance().constructFromCanonical(File.class.getName());
                    }

                    if (resolvedType.getTypeName().contains("ByteBuffer"))
                    {
                        resolvedType = TypeFactory.defaultInstance().constructFromCanonical(File.class.getName());
                    }
                }

                annotatedType.setType(resolvedType);

                // log.debug("resolvedType out " + resolvedType);
            }
        }

        try {

            // log.info("Processing " + annotatedType + " " + classType + " " + annotatedType.getName());
            return super.resolve(annotatedType, context, next);

        } catch (Exception e) {

            log.error("Error processing " + annotatedType + " " + classType + " " + annotatedType.getName(), e);

            return null;
        }
    }
586864
function resolveObject () {
    // get list of ids from values
    var ids = _.filter(_.keys(this.value), value => value.match(idRegExp))
    // if there are no ids then resolve with original values
    if (ids.length === 0) {
        return Promise.resolve(this.value)
    }
    // do query
    return this.model.query(this.getQueryArgs(ids)).then(results => {
        // resolve with data
        return _.keyBy(results, this.isOriginalId ? 'originalId' : 'id')
    })
}
161147
function resolve(to, importPath, fileType) {
  importPath =
    path.extname(importPath) === '' ? `${importPath}.${fileType}` : importPath
  if (importPath.startsWith('/')) {
    return importPath
  } else if (matchModuleImport.test(importPath)) {
    return require.resolve(importPath.replace(matchModuleImport, ''))
  }
  return path.join(path.dirname(to), importPath)
}
424298
function resolve(resolver, value) {
        // 保证resolvePromise与rejectPromise
        // 只能被调用一次
        // （不确定value是否是Promise对象）
        // see #2.3.3.3.3
        var called;

        function onFulfilled(data) {
            if (!called) {
                resolve(resolver, data);
                called = true;
            }
        }

        function onRejected(reason) {
            if (!called) {
                resolver.reject(reason);
                called = true;
            }
        }

        function work() {
            var then;
            // 不再额外判断value是否是Promise对象
            if (isObject(value) || isFunction(value)) {
                // 必须先保存对then对引用
                // 官方的test spec中有检查对then的引用次数只能为1
                then = value.then;
                if (isFunction(then)) {
                    then.call(value, onFulfilled, onRejected);
                }
                else {
                    then = null;
                }
            }

            if (!then) {
                resolver.fulfill(value);
            }
        }

        if (captureException) {
            try {
                work();
            }
            catch (e) {
                if (!called) {
                    emitExceptionEvent(e);
                    resolver.reject(e);
                }
            }
        }
        else {
            work();
        }

    }