Creates a new Path.
 @param path [String] path i.e. `'/store/inventory'`
 @param operations [Hash] path operations
 Path operations
 @return [Array<Operation>] list of operations for the path
422238
def operations
      validate_operations
      @operations ||= @raw_operations.map do |operation, properties|
        Operation.new(verb: operation, properties: properties, path: self)
      end
    end
513660
private void createPathQuery(String path, int operation)
   {
      MergingPathQueryNode pathNode =
         new MergingPathQueryNode(operation, factory.createPathQueryNode(null).getValidJcrSystemNodeTypeNames());
      pathNode.setAbsolute(true);

      if (path.equals("/"))
      {
         pathNode.addPathStep(factory.createLocationStepQueryNode(pathNode));
         pathConstraints.add(pathNode);
         return;
      }

      String[] names = path.split("/");

      for (int i = 0; i < names.length; i++)
      {
         if (names[i].length() == 0)
         {
            if (i == 0)
            {
               // root
               pathNode.addPathStep(factory.createLocationStepQueryNode(pathNode));
            }
            else
            {
               // descendant '//' -> invalid path
               // todo throw or ignore?
               // we currently do not throw and add location step for an
               // empty name (which is basically the root node)
               pathNode.addPathStep(factory.createLocationStepQueryNode(pathNode));
            }
         }
         else
         {
            int idx = names[i].indexOf('[');
            String name;
            int index = LocationStepQueryNode.NONE;
            if (idx > -1)
            {
               // contains index
               name = names[i].substring(0, idx);
               String suffix = names[i].substring(idx);
               String indexStr = suffix.substring(1, suffix.length() - 1);
               if (indexStr.equals("%"))
               {
                  // select all same name siblings
                  index = LocationStepQueryNode.NONE;
               }
               else
               {
                  try
                  {
                     index = Integer.parseInt(indexStr);
                  }
                  catch (NumberFormatException e)
                  {
                     log.warn("Unable to parse index for path element: " + names[i]);
                  }
               }
               if (name.equals("%"))
               {
                  name = null;
               }
            }
            else
            {
               // no index specified
               // - index defaults to 1 if there is an explicit name test
               // - index defaults to NONE if name test is %
               name = names[i];
               if (name.equals("%"))
               {
                  name = null;
               }
               else
               {
                  index = 1;
               }
            }
            InternalQName qName = null;
            if (name != null)
            {
               try
               {
                  qName = resolver.parseJCRName(name).getInternalName();
               }
               catch (NamespaceException e)
               {
                  throw new IllegalArgumentException("Illegal name: " + name, e);
               }
               catch (RepositoryException e)
               {
                  throw new IllegalArgumentException("Illegal name: " + name, e);
               }

            }
            // if name test is % this means also search descendants
            boolean descendant = name == null;
            LocationStepQueryNode step = factory.createLocationStepQueryNode(pathNode);
            step.setNameTest(qName);
            step.setIncludeDescendants(descendant);
            if (index > 0)
            {
               step.setIndex(index);
            }
            pathNode.addPathStep(step);
         }
      }
      pathConstraints.add(pathNode);
   }
1047854
def get(path)
      tmp = Rudy::Backup.new path
      backups = Rudy::Backups.list :path => path
      return nil unless backups.is_a?(Array) && !backups.empty?
      backups.first
    end
286972
def prepend_path(path)
      self.config = hash_reassoc(config, :paths) do |paths|
        path = File.expand_path(path, config[:root]).freeze
        paths.unshift(path)
      end
    end
1046025
def make_path(*sub_paths):
        
        queued_params = [quote(c.encode('utf-8'), '') for c in sub_paths if c not in NULL_VALUES]
        queued_params.insert(0, '')
        return '/'.join(queued_params)
227414
def expand_path(path, params = {})
      path = path.dup
      path = "/#{path}" unless path =~ /^\// # make sure path starts with /
      path = "/#{option(:api_version)}#{path}" unless path =~ /^\/v[\d.]+\// # preprend api version
      params.each do |key, value|
        path << (path['?'] ? '&' : '?')
        path << expand_param(key, value)
      end
      path
    end
832491
def add_paths(paths, base_path, operations):
    
    for operation, ns, rule, func in operations:
        path = build_path(operation, ns)
        if not path.startswith(base_path):
            continue
        method = operation.value.method.lower()
        # If there is no version number or prefix, we'd expect the base path to be ""
        # However, OpenAPI requires the minimal base path to be "/"
        # This means we need branching logic for that special case
        suffix_start = 0 if len(base_path) == 1 else len(base_path)
        paths.setdefault(
            path[suffix_start:],
            swagger.PathItem(),
        )[method] = build_operation(operation, ns, rule, func)
597686
def set_path(self, path):
        ''''''
        self._path = path
        return self._listitem.setPath(path)
1162976
def stash(self, path):
        
        if os.path.isdir(path):
            new_path = self._get_directory_stash(path)
        else:
            new_path = self._get_file_stash(path)

        self._moves.append((path, new_path))
        if os.path.isdir(path) and os.path.isdir(new_path):
            # If we're moving a directory, we need to
            # remove the destination first or else it will be
            # moved to inside the existing directory.
            # We just created new_path ourselves, so it will
            # be removable.
            os.rmdir(new_path)
        renames(path, new_path)
        return new_path
1050735
def op_paths(self, path_base=None):
        # type: (Union[str, UrlPath]) -> Generator[Tuple[UrlPath, Operation]]
        
        if path_base:
            path_base += self.path_prefix
        else:
            path_base = self.path_prefix or UrlPath()

        for container in self.containers:
            for op_path in container.op_paths(path_base):
                yield op_path
553018
def find_git_dir(path)
      path = Pathname.new(path).realpath
      while path.parent != path && !(path + ".git").directory?
        path = path.parent
      end
      
      path = path + ".git"
      
      raise "Could not find suitable .git dir in #{path}" if !path.directory?

      path
    end
1131728
def pushPath(self, path):
        
        # normalize the path
        path = os.path.normcase(nstr(path)).strip()
        if path and path != '.' and path not in sys.path:
            sys.path.append(path)
            self._addedpaths.insert(0, path)
            return True
        return False
265515
private static Collection<String> findPaths(Path path)
    {
        List<String> paths = findPaths(path, false);
        Collections.sort(paths);
        return paths;
    }
234310
def dfs_paths(path)
      paths = []
      stack = [path]
      seen  = Set.new

      while path = stack.pop
        seen.add(path.last)
        paths << path

        children = yield path.last
        children.reverse_each do |node|
          stack.push(path + [node]) unless seen.include?(node)
        end
      end

      paths
    end
601726
function makePath(object, path, index) {
		index = index || 0;
		var obj;

		if (path.length > index + 1) {
			obj = object[path[index]];

			// we always want the last object in an array
			if (_.isArray(obj)) obj = _.last(obj);

			makePath(obj, path, index + 1);
		} else {
			obj = object[path[index]];

			if (!obj) {
				// object doesn't exist yet so make it
				object[path[index]] = {};
			} else {
				if (!_.isArray(obj)) {
					// object isn't an array yet so make an array with the object as the first element
					object[path[index]] = [obj];
				}

				// append the new object
				object[path[index]].push({});
			}
		}
	}
1280401
def op_paths(self, path_prefix=None):
        # type: (Path) -> Generator[Tuple[UrlPath, Operation]]
        
        url_path = self.path
        if path_prefix:
            url_path = path_prefix + url_path

        yield url_path, self
1178972
function(/**Array*/ path) {
		if (path.constructor != Array) path = path.split(/[\\\/]/);
		var make = "";
		for (var i = 0, l = path.length; i < l; i++) {
			make += path[i] + SYS.slash;
			if (! IO.exists(make)) {
				IO.makeDir(make);
			}
		}
	}