reformat paths/keys having {} and convert them to :
@param paths
166822
function reformatPaths(paths) {
	let output = {};
	
	if (!paths) {
		return output;
	}
	
	let pathsKeys = Object.keys(paths);
	
	pathsKeys.forEach(function (eachKey) {
		let newKey = eachKey;
		
		if (eachKey.includes("{") && eachKey.includes("}")) {
			// replace : {params} by :params
			newKey = newKey.replace(new RegExp('{', 'g'), ':');
			newKey = newKey.replace(new RegExp('}', 'g'), '');
		}
		
		output[newKey] = paths[eachKey];
	});
	
	return output;
}
716065
public Parameters omit(String... paths) {
		Parameters result = new Parameters(this);
		for (String path : paths)
			result.remove(path);
		return result;
	}
499587
function _splitPath (keys) {
  var out

  if (util.isString(keys)) {
    out = []
    keys
      .split('.')
      .map(_segment('.'))
      .forEach(function (k) {
        k = (k || ' ').trim()
          .replace(/^([^[]+)\[(["']?)(.+)\2\]$/, function (m, m1, m2, m3) {
            if (m1 && m3) {
              out.push(m1, m3)
            }
            return ''
          })
        if (k) {
          out.push(k)
        }
      })
    keys = out
  }
  return keys
}
773704
public static Filter<ArchivePath> includePaths(final String... paths) {
        return getFilterInstance(IMPL_CLASS_NAME_INCLUDE_PATHS, new Class<?>[] { String[].class },
            new Object[] { paths });
    }
66774
def split_paths(paths)
        new_paths = {}
        paths.each do |p|
          if p.split('/').length > 1
            new_paths[p.split('/').last.to_s] = p
          else
            new_paths['home'] = '/'
          end
        end
        new_paths
      end
310493
def path_to_routing_key(path)
      new_path = ""
      path.split('').each_with_index do |c,i|
        if c == '/' and i != 0 and i != path.length-1
          new_path += '.'
        elsif c != '/'
          new_path += c
        end
      end
      new_path
    end
748583
def rename(self, paths, dst):
        ''' 
        '''
        if not isinstance(paths, list):
            raise InvalidInputException("Paths should be a list")
        if not paths:
            raise InvalidInputException("rename: no path given")
        if not dst:
            raise InvalidInputException("rename: no destination given")

        processor = lambda path, node, dst=dst: self._handle_rename(path, node, dst)
        for item in self._find_items(paths, processor, include_toplevel=True):
            if item:
                yield item
1194335
def key_paths
      trees.reduce(Set.new) { |result, tree| result.merge(tree.key_paths) }
    end
1033173
private static String mergePaths(String path1, String path2)
  {
    return path1 + (path1.endsWith(Path.SEPARATOR) ? "" : Path.SEPARATOR) + path2;
  }
393607
protected static String getArray(List<String> paths) {
        StringBuilder builder = new StringBuilder();

        for (String s : paths) {
            if (builder.length() == 0) {
                builder.append(s);
            } else {
                builder.append(",").append(s);
            }
        }

        return builder.toString();
    }
510091
function (path) {
  if (!types.isArray(path)) {
    path = [path]
  }
  return _.map(path, toKey)
}
980590
public static Predicate paths(final String... paths) {
        final PathMatchPredicate[] predicates = new PathMatchPredicate[paths.length];
        for (int i = 0; i < paths.length; ++i) {
            predicates[i] = new PathMatchPredicate(paths[i]);
        }
        return or(predicates);
    }
342328
function toKeyPath (path) {
  if (!ktypes.isArray(path)) {
    path = [path]
  }
  return _.map(path, function (key) {
    return ktypes.toString(key)
  })
}
1328872
public void prependKeyToDataPath(String key) {
    if (dataPath == null) {
      dataPath = key;
    } else {
      dataPath = key + ((dataPath.charAt(0) == '[') ? "" : ".") + dataPath;
    }
  }
249339
@Override
    public T addAsDirectories(final String... paths) throws IllegalArgumentException {
        // Precondition check
        Validate.notNull(paths, "paths must be specified");

        // Represent as array of Paths
        final Collection<ArchivePath> pathsCollection = new ArrayList<ArchivePath>(paths.length);
        for (final String path : paths) {
            pathsCollection.add(ArchivePaths.create(path));
        }

        // Delegate and return
        return this.addAsDirectories(pathsCollection.toArray(new ArchivePath[] {}));
    }
1028827
function stripCommonPath(paths) {
  var prefix = commonPrefix(paths);
  var prefixLength = prefix.lastIndexOf('/') + 1;

  return paths.map(function(str) {
    return str.slice(prefixLength);
  });
}
951266
def allowed_paths=(paths)
      if paths.is_a? String
        # Grab everything between commas that aren't escaped with a backslash
        paths = paths.to_s.split(/(?<!\\),\ ?/).map do |path|
          path.strip.gsub('\,', ',') # remove the escape characters
        end
      end

      @allowed_paths = paths
    end