Resolve a circular reference.
Throws an error if the path cannot be resolved
@param {Object} object    An object with a JSON Pointer URI fragment
like {$ref: '#/foo/bar'}
@return {Object | Array}
552955
function parseCircular(object) {
  // if circular references are disabled, just return the refs object
  if (!config().circularRefs) {
    return object;
  }

  let pointerPath = parsePointer(object.$ref);

  // validate whether the path corresponds with current stack
  for (let i = 0; i < pointerPath.length; i++) {
    if (pointerPath[i] !== path[i]) {
      throw new Error('Invalid circular reference "' +  object.$ref + '"');
    }
  }

  return stack[pointerPath.length];
}
1357452
function resolveResolution (
  ref,
  resolver,
  bootedServices
) {
  const refParts = ref.split(':')
  return resolver(refParts, bootedServices)
}
1187349
function resolve(value, conf, ring = []) {
	value.match(CONFIG_VAR_REGEX).forEach((variable) => {
		const key = variable.substring(variable.lastIndexOf('${') + 2, variable.lastIndexOf('}'));

		if (ring.includes(key)) {
			throw `Circular dependency error: cannot resolve variable(s) ${ring}.`;
		}
		ring.push(key);

		let resolved = conf[key];
		if (!resolved) {
			throw `Could not resolve ${key} - make sure this key is defined in _config.yml.`;
		}
		if (CONFIG_VAR_REGEX.test(resolved)) {
			resolved = resolve(resolved, conf, ring);
		}
		value = value.replace(variable, resolved);
		ring.pop();
	});
	return value;
}
324200
def resolve_all_references(obj, browsed: [], cache: {})
            return obj if browsed.include?(obj)
            browsed.push(obj)

            if obj.is_a?(ObjectStream)
                obj.each do |subobj|
                    resolve_all_references(subobj, browsed: browsed, cache: cache)
                end
            end

            if obj.is_a?(Stream)
                resolve_all_references(obj.dictionary, browsed: browsed, cache: cache)
            end

            if obj.is_a?(CompoundObject)
                obj.update_values! do |subobj|
                    if subobj.is_a?(Reference)
                        subobj = (cache[subobj] ||= subobj.solve.copy)
                        subobj.no = subobj.generation = 0
                        subobj.parent = obj
                    end

                    resolve_all_references(subobj, browsed: browsed, cache: cache)
                end
            end

            obj
        end
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')
    })
}
1140077
function (item) {
          const resolvedPath = path.resolve(item);
          const ignore = (resolvedPath.indexOf(srcPath) === -1);
          return ignore;
        }
629451
function resolve() {
            resolvePath(path, function (err, _resolvedPath) {
                if (err) {
                    if (err.code !== "ENOENT") {
                        return error(err);
                    }
                    // If checkSymlinks is on we'll get an ENOENT when creating a new file.
                    // In that case, just resolve the parent path and go from there.
                    resolvePath(dirname(path), function (err, dir) {
                        if (err) return error(err);
                        resolvedPath = join(dir, basename(path));
                        createTempFile();
                    });
                    return;
                }
                
                resolvedPath = _resolvedPath;
                createTempFile();
            });
        }
89883
function dereference (parser, options) {
  // console.log('Dereferencing $ref pointers in %s', parser.$refs._root$Ref.path);
  var dereferenced = crawl(parser.schema, parser.$refs._root$Ref.path, "#", [], parser.$refs, options);
  parser.$refs.circular = dereferenced.circular;
  parser.schema = dereferenced.value;
}
848654
function accessor(object) {
    var ref = object || (1, eval)('this');
    var len = parts.length;
    var idx = 0;

    // iteratively save each segment's reference
    for (; idx < len; idx += 1) {
      if (ref) ref = ref[parts[idx]];
    }

    return ref;
  }
890753
function resolvePathFor(options, src) {
  if (Array.isArray(src)) {
    src.forEach(dir => resolvePathFor(options, dir));
  } else {
    const relativePath = get(options, src);
    if (Array.isArray(relativePath)) {
      set(options, src, relativePath.map(n => getAbsPath(n)));
    } else {
      const _absPath = getAbsPath(relativePath);
      relativePath !== _absPath && set(options, src, _absPath);
    }
  }
}
65340
function findObject(c, obj, path, alreadyParsed) {
    if (!path) {
        path = [];
    }

    // Recursive reference : boooh, very wrong
    if (!alreadyParsed) {
        alreadyParsed = [];
    }
    var keys = Object.keys(obj);
    alreadyParsed.push(obj);
    for (var key = 0; key < keys.length; key++) {
        var i = keys[key];
        if (i == "NativeModule" && isElectron) {
            break;
        }
        if (obj[i] === c) {
            path.push(i);
            return path;
        } else if (["object", "function"].indexOf(typeof(obj[i])) >= 0 && alreadyParsed.indexOf(obj[i]) == -1 && obj[i] !== null && obj[i] !== undefined) {
            path.push(i);
            var founded = findObject(c, obj[i], path, alreadyParsed);
            if (founded) {
                return founded;
            } else {
                path.pop();
            }
        }
    };
    return null;
}
548836
def maybe_resolve(object, resolve):
    
    if isinstance(object, dict) and object.get('$ref'):
        return resolve(object['$ref'])
    return object
907942
function resolveObjectPath (obj, path) {
        var delimeter = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '.';

        var pathArray = Array.isArray(path) ? path : path.split(delimeter);

        return pathArray.reduce(function (p, item) {
            return p && p[item];
        }, obj);
    }
669561
function resolvePath(_path, relativePath = currentWorkDir) {
  if (!isString(_path) || _path.startsWith('~')) {
    return _path;
  }
  const file = nativePath.relative(relativePath, _path);
  return nativePath.join(relativePath, file);
}
838666
function resolve() {
    var resolvedPath = '';
    var resolvedAbsolute = false;
    var hasDomain = false;

    for (var i = arguments.length - 1; i >= -1 && !resolvedAbsolute; i -= 1) {
      var p = (i >= 0) ? arguments[i] : !hasDomain ? cwd() : '';

      if (!hasDomain) {
        hasDomain = isDomain(p);
      }

      if (!isString(p)) {
        throw new TypeError('Arguments to path.resolve must be strings');
      } else if (!p) {
        continue;
      }

      resolvedPath = p + '/' + resolvedPath;
      resolvedAbsolute = p[0] === '/';
    }

    resolvedPath = normalizeArray(resolvedPath.split('/'), !resolvedAbsolute).join('/');
    return ((resolvedAbsolute ? '/' : '') + resolvedPath) || '.';
  }
722462
function (response) {

          var i, j, swagger = response.obj;

          if(swagger === null || Object.keys(swagger).length === 0) {
            try {
              swagger = JSON.parse(response.data);
            }
            catch (e){
              swagger = {};
            }
          }

          processedCalls += 1;

          for (i = 0; i < opt.length; i++) {
            var path = opt[i];
            if(path == null) {
              resolvedRefs[name] = {
                name: name,
                obj: swagger
              };
            }
            else {
              var location = swagger, parts = path.split('/');
              for (j = 0; j < parts.length; j++) {
                var segment = parts[j];
                if(segment.indexOf('~1') !== -1) {
                  segment = parts[j].replace(/~0/g, '~').replace(/~1/g, '/');
                  if(segment.charAt(0) !== '/') {
                    segment = '/' + segment;
                  }
                }

                if (typeof location === 'undefined') {
                  break;
                }

                if (segment.length > 0) {
                  location = location[segment];
                }
              }
              var resolved = host + '#' + path, resolvedName = parts[j-1];

              if (typeof location !== 'undefined') {
                resolvedRefs[resolved] = {
                  name: resolvedName,
                  obj: location
                };
              } else {
                unresolvedRefs[resolved] = null;
              }
            }
          }
          if (processedCalls === expectedCalls) {
            self.finish(spec, resolutionTable, resolvedRefs, unresolvedRefs, callback);
          }
        }
1075872
function(path, object) {
    var pathCallbacks = this.callbacks[path];
    var matchingCallbacks = [];
    if(pathCallbacks) {
      for(var i in pathCallbacks) {
        if(pathCallbacks[0] == object) matchingCallbacks.push(path);
      }
    }
    return matchingCallbacks;
  }