Returns the encoded and decoded paths keys of the given object.

@param {object} $refs - The object whose keys are URL-encoded paths
@param {...string|string[]} [types] - Only return paths of the given types ("file", "http", etc.)
@returns {object[]}
173457
function getPaths ($refs, types) {
  var paths = Object.keys($refs);

  // Filter the paths by type
  types = Array.isArray(types[0]) ? types[0] : Array.prototype.slice.call(types);
  if (types.length > 0 && types[0]) {
    paths = paths.filter(function (key) {
      return types.indexOf($refs[key].pathType) !== -1;
    });
  }

  // Decode local filesystem paths
  return paths.map(function (path) {
    return {
      encoded: path,
      decoded: $refs[path].pathType === "file" ? url.toFileSystemPath(path, true) : path
    };
  });
}
1206145
static protected function refDefs($childs=null) {
		$gname = get_called_class();
		$key = $gname . ( $childs ? '::' . $childs : '' );
		if (key_exists($key, static::$refDefCache)) { return static::$refDefCache[$key]; }
		$defs = static::selfRefDefs($key);
		foreach (class_uses($gname) as $trait) {
			if ('dt' != substr($trait, 0, 2)) { continue; }
			$traitName = substr($trait, 2);
			$callable = [ $gname, 'refDefs' . $traitName, ];
			$defs = array_merge($defs, call_user_func($callable, $key));
		}
		if ($parent = get_parent_class($gname)) {
			$defs = array_merge($defs, $parent::refDefs($key));
		}
		static::$refDefCache[$key] = $defs;
		return $defs;
	}
1300602
private function getPaths($type)
    {
        $typeConfigs = $this->typePaths[$type];
        $paths = [];

        foreach ($typeConfigs as $typeConfig) {
            $paths[] = $typeConfig['path'];
        }

        return $paths;
    }
1046712
protected function getKeyLookup($keys)
	{
		// First pass, create a lookup of the keys.
		$lookup = array();

		foreach ($keys as $key)
		{
			if ($key instanceof \SimpleXMLElement)
			{
				$kName = (string) $key['Index'];
			}
			else
			{
				$kName = $key->Index;
			}

			if (empty($lookup[$kName]))
			{
				$lookup[$kName] = array();
			}

			$lookup[$kName][] = $key;
		}

		return $lookup;
	}
707177
function convertRef (data) {
  let loc = data['$ref']
  let split = loc.split('#')
  delete data['$ref']

  if (loc[0] === '#') {
    data['type'] = utils.typeNameFromRef(loc)
    return data
  } else if (loc.slice(0, 4) === 'http') {
    return JSON.parse(request('GET', split[0]).getBody('utf8'))
  } else {
    return JSON.parse(fs.readFileSync(path.join(basePath, split[0])))
  }
}
447178
protected function getRootMapping($mappings)
    {
        $properties = array();

        foreach ($mappings as $rootMapping) {
            $propertyName = $rootMapping['fieldName'];
            $mapping = array();

            if (isset($rootMapping['value'])) {
                $mapping = $rootMapping['value'];
            }

            if (isset($rootMapping['match'])) {
                $mapping['match'] = $rootMapping['match'];
            }

            if (isset($rootMapping['pathMatch'])) {
                $mapping['path_match'] = $rootMapping['pathMatch'];
            }

            if (isset($rootMapping['unmatch'])) {
                $mapping['unmatch'] = $rootMapping['unmatch'];
            }

            if (isset($rootMapping['pathUnmatch'])) {
                $mapping['path_unmatch'] = $rootMapping['pathUnmatch'];
            }

            if (isset($rootMapping['matchPattern'])) {
                $mapping['match_pattern'] = $rootMapping['matchPattern'];
            }

            if (isset($rootMapping['matchMappingType'])) {
                $mapping['match_mapping_type'] = $rootMapping['matchMappingType'];
            }

            if (isset($rootMapping['mapping'])) {
                $mapping['mapping'] = current($this->getMapping(array($rootMapping['mapping'])));
            }

            if (isset($rootMapping['id'])) {
                $properties[$propertyName][][$rootMapping['id']] = $mapping;
            } else {
                $properties[$propertyName] = $mapping;
            }
        }

        return $properties;
    }
239960
public function getUrls(array $locales = [])
    {
        if (!is_null($this->urls)) {
            return $this->urls;
        }

        $locales = $locales ?: $this->locales;
        $this->urls = [];

        // By resource
        if ($this->resource) {
            $this->resourceHelper->getEntityManager()->refresh($this->resource);

            foreach ($locales as $locale) {
                $this->urls[$locale] = $this->resourceHelper->generatePublicUrl($this->resource, false, $locale);
            }
        } // By route and parameters
        elseif ($request = $this->requestStack->getMasterRequest()) {
            $route = $request->attributes->get('_route');
            $parameters = $request->attributes->get('_route_params');

            foreach ($locales as $locale) {
                $params = array_replace($parameters, ['_locale' => $locale]);
                $this->urls[$locale] = $this->urlGenerator->generate($route, $params,
                    UrlGeneratorInterface::ABSOLUTE_PATH);
            }
        }

        return $this->urls;
    }
745450
private function decodePropertyPaths($propertyPathString)
    {
        $paths = array();
        foreach (explode('/', trim($propertyPathString, '/')) as $path) {
            $path = $this->decodePath($path);
            if (is_string($path) && '' !== $path) {
                $paths[] = $path;
            }
        }

        return $paths;
    }
826347
public static function path(...$paths)
    {
        $protocol = '';
        $path = trim(implode(DIRECTORY_SEPARATOR, $paths));
        if (preg_match('@^([a-z0-9]+://|/)(.*)@i', $path, $m)) {
            $protocol = $m[1];
            $path = $m[2];
        }
        $path = str_replace(array('/', '\\'), DIRECTORY_SEPARATOR, $path);
        $parts = array_filter(explode(DIRECTORY_SEPARATOR, $path), 'strlen');
        $absolutes = [];
        foreach ($parts as $part) {
            if ('.' == $part) {
                continue;
            }
            if ('..' == $part) {
                array_pop($absolutes);
            } else {
                $absolutes[] = $part;
            }
        }
        $path = implode(DIRECTORY_SEPARATOR, $absolutes);
        if (DIRECTORY_SEPARATOR == '\\' && isset($protocol[4])) {
            $path = str_replace(DIRECTORY_SEPARATOR, '/', $path);
        }
        return $protocol . $path;
    }
198111
function Pointer ($ref, path, friendlyPath) {
  /**
   * The {@link $Ref} object that contains this {@link Pointer} object.
   * @type {$Ref}
   */
  this.$ref = $ref;

  /**
   * The file path or URL, containing the JSON pointer in the hash.
   * This path is relative to the path of the main JSON schema file.
   * @type {string}
   */
  this.path = path;

  /**
   * The original path or URL, used for error messages.
   * @type {string}
   */
  this.originalPath = friendlyPath || path;

  /**
   * The value of the JSON pointer.
   * Can be any JSON type, not just objects. Unknown file types are represented as Buffers (byte arrays).
   * @type {?*}
   */
  this.value = undefined;

  /**
   * Indicates whether the pointer references itself.
   * @type {boolean}
   */
  this.circular = false;

  /**
   * The number of indirect references that were traversed to resolve the value.
   * Resolving a single pointer may require resolving multiple $Refs.
   * @type {number}
   */
  this.indirections = 0;
}
548994
public function listPaths($preserveDuplicates = false)
    {
        if (!$this->checked) {
            // make sure we don't have a circular reference here
            $stk = [];
            $stk[] = $this;
            $this->dieOnCircularReference($stk, $this->project);
        }

        $result = [];
        for ($i = 0, $elSize = count($this->elements); $i < $elSize; $i++) {
            $o = $this->elements[$i];
            if ($o instanceof Reference) {
                $refId = $o->getRefId();
                $o = $o->getReferencedObject($this->project);
                // we only support references to paths right now
                if (!($o instanceof Path)) {
                    $msg = $refId . " doesn't denote a path";
                    throw new BuildException($msg);
                }
            }

            if (is_string($o)) {
                $result[] = $o;
            } elseif ($o instanceof PathElement) {
                $parts = $o->getParts();
                if ($parts === null) {
                    throw new BuildException(
                        "You must either set location or"
                        . " path on <pathelement>"
                    );
                }
                foreach ($parts as $part) {
                    $result[] = $part;
                }
            } elseif ($o instanceof Path) {
                $p = $o;
                if ($p->getProject() === null) {
                    $p->setProject($this->getProject());
                }
                $parts = $p->listPaths();
                foreach ($parts as $part) {
                    $result[] = $part;
                }
            } elseif ($o instanceof DirSet) {
                $dset = $o;
                $ds = $dset->getDirectoryScanner($this->project);
                $dirstrs = $ds->getIncludedDirectories();
                $dir = $dset->getDir($this->project);
                foreach ($dirstrs as $dstr) {
                    $d = new PhingFile($dir, $dstr);
                    $result[] = $d->getAbsolutePath();
                }
            } elseif ($o instanceof FileSet) {
                $fs = $o;
                $ds = $fs->getDirectoryScanner($this->getProject());
                $filestrs = $ds->getIncludedFiles();
                $dir = $fs->getDir($this->getProject());
                foreach ($filestrs as $fstr) {
                    $d = new PhingFile($dir, $fstr);
                    $result[] = $d->getAbsolutePath();
                }
            } elseif ($o instanceof FileList) {
                $fl = $o;
                $dirstrs = $fl->getFiles($this->project);
                $dir = $fl->getDir($this->project);
                foreach ($dirstrs as $dstr) {
                    $d = new PhingFile($dir, $dstr);
                    $result[] = $d->getAbsolutePath();
                }
            }
        }

        return $preserveDuplicates ? $result : array_unique($result);
    }
1002262
public static function isRemoteUrlReadable($url, array $refs = null) {
		exec(self::processCommand([
				'GIT_TERMINAL_PROMPT=0 git ls-remote',
				'--heads',
				'--quiet',
				'--exit-code',
				$url,
				$refs,
			]) . ' 2>&1', $output, $returnCode);
		return $returnCode === 0;
	}
711
private function getPaths(&$s, $r = "#")
    {
        $this->paths[$r] = &$s;
        if (is_array($s) || is_object($s)) {
            foreach ($s as $k => &$v) {
                if ($k !== "\$ref") {
                    $this->getPaths($v, $r == "#" ? "#{$k}" : "{$r}.{$k}");
                }
            }
        }
    }
133698
static public function getPropertyStorageMap($triples)
    {
        $referencer = ServiceManager::getServiceManager()->get(FileReferenceSerializer::SERVICE_ID);
        $map = [];
        foreach ($triples as $triple) {
            if (self::isFileReference($triple)) {
                $source = $referencer->unserialize($triple->object);
                $map[$triple->predicate] = $source->getFileSystemId();
            }
        }
        return $map;
    }
932115
public static function getFromPath($pathKeys, $source)
    {
        $mappedValue = $source;

        foreach ($pathKeys as $key) {
            if (isset($mappedValue[$key])) {
                $mappedValue = $mappedValue[$key];
            } else {

                return false;
            }
        }

        return $mappedValue;
    }
308006
private static function getCacheKeyForCall(array $params)
    {
        static $domainLevel = null;

        $params += $_GET;
        $keyStr = '';
        foreach ($params as $param) {
            $keyStr .= serialize($param);
        }

        $keyStr .= Request::domainPrefix(
            $domainLevel ?? $domainLevel = count(explode('.', Config::application('domain')))
        );

        return md5($keyStr);
    }
1161499
protected function generateRelationLink($refs)
    {
        $pairs = [];
        foreach ($refs as $a => $b) {
            $pairs[] = "'$a' => '$b'";
        }

        return '[' . implode(', ', $pairs) . ']';
    }