Resolves an object.

    If this is an array or dictionary, it may still contains
    some indirect objects inside.
960189
def resolve1(x, default=None):
    
    while isinstance(x, PDFObjRef):
        x = x.resolve(default=default)
    return x
1110901
def _resolve_objects(self, new_objects, superclass_objects, new_class,
                         superclass, classrepo, qualifier_repo, type_str,
                         verbose=None):
        
        if new_objects:   # TODO Future REMOVE. This is test code
            assert isinstance(new_objects, (dict, NocaseDict))
            keys = new_objects.keys()
            assert isinstance(new_objects[keys[0]], (CIMMethod, CIMProperty,
                                                     CIMParameter))

        if not superclass:
            for new_obj in six.itervalues(new_objects):
                self._set_new_object(new_obj, None, new_class, None,
                                     qualifier_repo,
                                     False, type_str)
            return

        # process objects if superclass exists
        for oname, new_obj in six.iteritems(new_objects):
            if oname not in superclass_objects:
                self._set_new_object(new_obj, None, new_class,
                                     superclass, qualifier_repo,
                                     False, type_str)
                continue

            # oname in superclass_objects
            # TODO: We may have object naming because of override.
            if 'Override' not in new_objects[oname].qualifiers:
                if not isinstance(new_objects[oname], CIMParameter):
                    raise CIMError(
                        CIM_ERR_INVALID_PARAMETER,
                        _format("{0} {1!A} in {2!A} duplicates {0} in "
                                "{3!A} without override.",
                                type_str, oname, new_class.classname,
                                superclass.classname))

                # TODO need to finish this.  For now just let
                # parameter slide. Keep the new one.
                continue

            # process object override
            # get override name
            override_name = new_objects[oname].qualifiers["override"].value
            if isinstance(new_obj, (CIMParameter, CIMProperty)):
                if new_obj.type == 'reference':
                    if override_name != oname:
                        raise CIMError(
                            CIM_ERR_INVALID_PARAMETER,
                            _format("Invalid new_class reference "
                                    "{0} {1!A}. in class {2!A}"
                                    "Override must not change {0} "
                                    "name but override name is {3!A}",
                                    type_str, oname, superclass.classname,
                                    override_name))
            try:
                super_obj = superclass_objects[override_name]
            except KeyError:
                raise CIMError(
                    CIM_ERR_INVALID_PARAMETER,
                    _format("Invalid new_class override  {0} {1!A}. in class "
                            "{2!A}. Override name {3!A}} not found in  {3!A}.",
                            type_str, oname, new_class.classname, override_name,
                            superclass.classname))

            # Test if new object characteristics consistent with
            # requirements for that object type
            if isinstance(super_obj, CIMProperty):
                if super_obj.type != new_obj.type \
                    or super_obj.is_array != new_obj.is_array \
                        or super_obj.embedded_object != \
                        new_obj.embedded_object:
                    raise CIMError(
                        CIM_ERR_INVALID_PARAMETER,
                        _format("Invalid new_class property {0!A}. "
                                "Does not match overridden property "
                                "{1!A} in class {2!A}",
                                oname, super_obj.name,
                                superclass.classname))
            elif isinstance(super_obj, CIMMethod):
                if super_obj.return_type != new_obj.return_type:
                    raise CIMError(
                        CIM_ERR_INVALID_PARAMETER,
                        _format("Invalid new_class method {0!A}. "
                                "Mismatch method  return typein "
                                "class {1!A}.", oname,
                                superclass.classname))
            elif isinstance(super_obj, CIMParameter):
                if super_obj.type != new_obj.type or \
                   super_obj.is_array != new_obj.is_array or \
                   super_obj.array_size != new_obj.array_size or \
                   super_obj.embedded_object != new_obj.embedded_object:
                    mname = None
                    raise CIMError(
                        CIM_ERR_INVALID_PARAMETER,
                        _format("Invalid new_class parameter "
                                "{0!A} param {1|A}. "
                                "Does not match signature of "
                                "overridden method parameters "
                                "in class {2!A}.", mname, oname,
                                superclass.classname))
            else:
                assert True, "Invalid Type {0}" .format(type(super_obj))

            self._set_new_object(new_obj, super_obj,
                                 new_class,
                                 superclass, qualifier_repo,
                                 True, type_str)

            # if type is method, resolve the parameters.
            if isinstance(new_obj, CIMMethod):
                self._resolve_objects(
                    new_obj.parameters,
                    superclass_objects[new_obj.name].parameters,
                    new_class,
                    superclass, classrepo, qualifier_repo,
                    "Parameter", verbose=verbose)

        # Copy objects from from superclass that are not in new_class
        # Placed after loop with items in new_object so they are not part
        # of that loop.
        for oname, ovalue in six.iteritems(superclass_objects):
            if oname not in new_objects:
                new_value = ovalue.copy()
                new_value.propagated = True
                assert ovalue.class_origin
                new_value.class_origin = ovalue.class_origin
                for qualifier in new_value.qualifiers.values():
                    qualifier.propagated = True
                new_objects[oname] = new_value
1001859
function structureResolve(resolve, sPathStartWith) {
    var aToResolve = [];
    var aResolved = [];

    if (typeof resolve === 'object' && resolve instanceof Array) {
        aToResolve = resolve;
    } else if (typeof resolve === 'string') {
        aToResolve.push(resolve);
    } else {
        return null;
    }

    // resolve
    aToResolve.forEach(function (item) {
        var aSplit = item.split('/');

        for (var i = 0; i < aSplit.length; i++) {
            var aConc = aSplit.slice(0, i + 1);
            var sConc = (aConc.length > 1) ? aConc.join('/') : aConc[0];

            if (sConc.length > 0) {
                aResolved.push({
                    type: (i < (aSplit.length - 1)) ? OBJECT_TYPE.folder : OBJECT_TYPE.file,
                    id: (sConc.charAt(0) !== sPathStartWith) ? sPathStartWith + sConc : sConc
                });
            }
        }
    });

    // remove dups
    aResolved = aResolved.sort(function (sVal1, sVal2) {
        var sA = JSON.stringify(sVal1);
        var sB = JSON.stringify(sVal2);

        if (sA === sB) {
            return 0;
        } else if (sA <= sB) {
            return -1;
        } else {
            return 1;
        }
    })
        .filter(function (oItem, iPos) {
            if (iPos > 0) {
                return JSON.stringify(aResolved[iPos - 1]) !== JSON.stringify(oItem);
            } else {
                return true;
            }
        });

    return aResolved;
}
1326038
def serialize_objects_and_references
      obj_dir = {}
      objid_cache = {}
      # create a dictionary for referenced objects (no value resolution at this point)
      # at the same time, delete duplicates and old versions when objects have multiple versions
      @parsed.uniq!
      @parsed.length.times do |i|
        o = @parsed[i]
        objid_cache[o.object_id] = i
        tmp_key = [o[:indirect_reference_id], o[:indirect_generation_number]]
        if tmp_found = obj_dir[tmp_key]
          tmp_found.clear
          @parsed[objid_cache[tmp_found.object_id]] = nil
        end
        obj_dir[tmp_key] = o
      end
      @parsed.compact!
      objid_cache.clear

      should_resolve = [@parsed, @root_object]
      while should_resolve.count > 0
        obj = should_resolve.pop
        if obj.is_a?(Hash)
          obj.keys.each do |k|
            o = obj[k]
            if o.is_a?(Hash)
              if o[:is_reference_only]
                if o[:indirect_reference_id].nil?
                  o = nil
                else
                  o[:referenced_object] = obj_dir[[o[:indirect_reference_id], o[:indirect_generation_number]]]
                  warn "Couldn't connect reference for #{o}" if o[:referenced_object].nil? && (o[:indirect_reference_id] + o[:indirect_generation_number] != 0)
                  o.delete :indirect_reference_id
                  o.delete :indirect_generation_number
                  o = (o[:referenced_object] && o[:referenced_object][:indirect_without_dictionary]) || o
                end
                obj[k] = o
              else
                should_resolve << o
              end
            elsif o.is_a?(Array)
              should_resolve << o
            end
          end
        elsif obj.is_a?(Array)
          obj.map! do |o|
            if o.is_a?(Hash)
              if o[:is_reference_only]
                if o[:indirect_reference_id].nil?
                  o = nil
                else
                  o[:referenced_object] = obj_dir[[o[:indirect_reference_id], o[:indirect_generation_number]]]
                  warn "Couldn't connect reference for #{o}" if o[:referenced_object].nil?
                  o.delete :indirect_reference_id
                  o.delete :indirect_generation_number
                  o = (o[:referenced_object] && o[:referenced_object][:indirect_without_dictionary]) || o
                end
              else
                should_resolve << o
              end
            elsif o.is_a?(Array)
              should_resolve << o
            end
            o
          end
        end
      end
    end
47374
function resolveArray () {
    // get list of ids from value
    var ids = _.filter(this.value, value => typeof value === 'string' && value.match(idRegExp))
    // if there are no ids then resolve with original value
    if (ids.length === 0) {
        return Promise.resolve(this.value)
    }
    // do query
    return this.model.query(this.getQueryArgs(ids))
}
1159507
def resolve_nested_dict(nested_dict):
    
    res = {}
    for k, v in nested_dict.items():
        if isinstance(v, dict):
            for k_, v_ in resolve_nested_dict(v).items():
                res[(k, ) + k_] = v_
        else:
            res[(k, )] = v
    return res
20210
def do_resolve(self, definitions):
        
        filtered = []
        for p in self.ports:
            ref = qualify(p.binding, self.root, definitions.tns)
            binding = definitions.bindings.get(ref)
            if binding is None:
                raise Exception("binding '%s', not-found" % (p.binding,))
            if binding.soap is None:
                log.debug("binding '%s' - not a SOAP binding, discarded",
                    binding.name)
                continue
            # After we have been resolved, our caller will expect that the
            # binding we are referencing has been fully constructed, i.e.
            # resolved, as well. The only scenario where the operations binding
            # might possibly not have already resolved its references, and
            # where this explicit resolve() call is required, is if we are
            # dealing with a recursive WSDL import chain.
            binding.resolve(definitions)
            p.binding = binding
            filtered.append(p)
        self.ports = filtered
1001181
def resolve(self, key, keylist):
        """"""
        raise AmbiguousKeyError("Ambiguous key "+ repr(key) +
                ", could be any of " + str(sorted(keylist)))
961595
def resolve_model(model, fields):
    
    for (f, v) in fields:
        if v is not None:
            try:
                kwargs = {f: v}
                obj = model.objects.get(**kwargs)
                return obj
            except model.DoesNotExist:
                pass
            except model.MultipleObjectsReturned:
                pass
    raise model.DoesNotExist()
1125648
def resolve(self, definitions):
        
        if not self.__resolved:
            self.do_resolve(definitions)
            self.__resolved = True
169776
def resolve(self, pointer):
        

        dp = DocumentPointer(pointer)
        obj, fetcher = self.prototype(dp)

        for token in dp.pointer:
            obj = token.extract(obj, bypass_ref=True)
            reference = ref(obj)
            if reference:
                obj = fetcher.resolve(reference)
        return obj
383515
function resolveExtendedParameters(obj) {

                // assume all references are resolved, just copy parameters down the
                // inheritence chain. If I am derived check base first.
                if (obj["extends"]) {
                    resolveExtendedParameters(obj["extends"]);
                    obj.parameters = obj.parameters || [];
                    obj.parameters = obj.parameters.concat(obj["extends"].parameters);
                }
            }
1357452
function resolveResolution (
  ref,
  resolver,
  bootedServices
) {
  const refParts = ref.split(':')
  return resolver(refParts, bootedServices)
}
1119943
public F resolve(R resolvable, boolean cache) {
        R wrappedResolvable = wrap(resolvable);
        if (cache) {
            return resolved.getValue(wrappedResolvable);
        } else {
            return resolverFunction.apply(wrappedResolvable);
        }
    }
438709
def resolve(self, ts):
        
        if isinstance(ts, six.string_types):
            ts = [ts]

        obj = self
        while len(ts) > 0:
            t = ts.pop(0)

            if issubclass(obj.__class__, BaseObj):
                obj = getattr(obj, t)
            elif isinstance(obj, list):
                obj = obj[int(t)]
            elif isinstance(obj, dict):
                obj = obj[t]

        return obj
1256344
@SuppressWarnings("unchecked")
    private static <V> V resolve(ProvidenceConfigContext context,
                                 Token token,
                                 Tokenizer tokenizer,
                                 PDescriptor descriptor) throws TokenizerException {
        Object value = resolveAny(context, token, tokenizer);
        if (value == null) {
            return null;
        }
        return (V) asType(descriptor, value);
    }
171449
def resolve_args(self, args):
        
        def resolve(a):
            if isinstance(a, dict):
                _id = a.get('i', None)
                # If it's a compound type (including dict)
                # Check if it has id (i) to determine that it has
                # a reference in object storage. If it's None, then it's
                # a dict originated at the remote
                return self.objects[_id] if _id else a['v']
            # if array, resolve it's elements
            if isinstance(a, (list, tuple)):
                return [resolve(i) for i in a]
            return a

        return [resolve(a) for a in args]