(this: Trie, path: Path, val: Value) => Trie
433134
function put(path, val) {
  var pos = splitPath(path).reduce(function (t, segment) {
    if (!t[segment]) { t[segment] = {} }
    return t[segment]
  }, this)
  pos['@'] = val;
  return this;
}
746727
def []=(key, value)
      raise ArgumentError, "key must be string" unless key.instance_of?(String)
      raise ArgumentError, "value must be string" unless value.instance_of?(String)

      @root_node = update_and_delete_storage(
        @root_node,
        NibbleKey.from_string(key),
        value
      )

      update_root_hash
    end
317318
function getValue(item, keyOrPath) {
  const keys = keyOrPath.split('.');
  const used = [];
  while (keys.length > 0) {
    const key = keys.shift();
    used.push(key);
    if (!isValid(item[key])) {
      throw new Error(`path ${used.join('.')} is not an object`);
    }
    item = item[key];
  }
  return item[keys[0]];
}
483090
def insert_trie(trie, value):  # aka get_subtrie_or_insert
    
    if value in trie:
        return trie[value]
    multi_check = False
    for key in tuple(trie.keys()):
        if len(value) > len(key) and value.startswith(key):
            return insert_trie(trie[key], value)
        elif key.startswith(value):  # we know the value is not in the trie
            if not multi_check:
                trie[value] = {}
                multi_check = True  # there can be multiple longer existing prefixes
            dict_ = trie.pop(key)  # does not break strie since key<->dict_ remains unchanged
            trie[value][key] = dict_
    if value not in trie:
        trie[value] = {}
    return trie[value]
510091
function (path) {
  if (!types.isArray(path)) {
    path = [path]
  }
  return _.map(path, toKey)
}
668094
function castPath$1(value, object) {
  if (isArray$4(value)) {
    return value;
  }
  return isKey(value, object) ? [value] : stringToPath(toString(value));
}
594804
def value_from_hash(hash, path)
      value = hash

      begin
        path.each do |p|
          value = value[p]
        end
        value
      rescue NoMethodError
        nil
      end
    end
1145163
def set_path(self, data, path, value):
        
        self.say('set_path:value:' + str(value) +
                 ' at:' + str(path) + ' in:' + str(data))

        if isinstance(path, str):
            path = path.split('.')
        if len(path) > 1:
            self.set_path(data.setdefault(path[0], {}), path[1:], value)
        else:
            data[path[0]] = value
        return data
314764
function findPath(value, node) {
    var e_2, _a;
    if (value === node.value)
        return [node];
    try {
        for (var _b = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__values"])(node.children), _c = _b.next(); !_c.done; _c = _b.next()) {
            var child = _c.value;
            var path = findPath(value, child);
            if (path.length) {
                path.unshift(node);
                return path;
            }
        }
    }
    catch (e_2_1) { e_2 = { error: e_2_1 }; }
    finally {
        try {
            if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
        }
        finally { if (e_2) throw e_2.error; }
    }
    return [];
}
912346
function PathExpression(path) {
  const iterPattern = /^(.*)\[(\d+)]$/;
  const paths = path.split('.').reduce((prev, key) => {
    const matches = key.match(iterPattern);
    if (matches) {
      const [, rest, index] = matches;
      return [...prev, t.stringLiteral(rest), c.KEY_I(index)];
    }
    return [...prev, t.stringLiteral(key)];
  }, []);

  return paths;
}
42054
def derive_new_map(trie)
      if trie.equal?(@trie)
        return self
      elsif trie.empty?
        if @default
          return self.class.alloc(EmptyTrie, @default)
        else
          return self.class.empty
        end
      else
        return self.class.alloc(trie, @default)
      end
    end
533094
function(path) {
            if (!path.inList) {
              return;
            }

            const { node } = path;
            if (node.kind !== "var") {
              return;
            }

            const next = path.getSibling(path.key + 1);
            if (!next.isForStatement()) {
              return;
            }

            const init = next.get("init");
            if (!init.isVariableDeclaration({ kind: node.kind })) {
              return;
            }

            const declarations = node.declarations.concat(
              init.node.declarations
            );

            // temporary workaround to forces babel recalculate scope,
            // references and binding until babel/babel#4818 resolved
            path.remove();
            init.replaceWith(t.variableDeclaration("var", declarations));
          }
411746
function toReturn(path) {
    const { node } = path;

    if (
      !path.getSibling(path.key + 1).node &&
      path.parentPath &&
      path.parentPath.parentPath &&
      path.parentPath.parentPath.isFunction()
    ) {
      // Only the consequent is a return, void the alternate.
      if (
        t.isReturnStatement(node.consequent) &&
        t.isExpressionStatement(node.alternate)
      ) {
        if (!node.consequent.argument) {
          path.replaceWith(
            t.expressionStatement(
              t.logicalExpression("||", node.test, node.alternate.expression)
            )
          );
          return REPLACED;
        }

        path.replaceWith(
          t.returnStatement(
            t.conditionalExpression(
              node.test,
              node.consequent.argument || h.VOID_0(t),
              t.unaryExpression("void", node.alternate.expression, true)
            )
          )
        );
        return REPLACED;
      }

      // Only the alternate is a return, void the consequent.
      if (
        t.isReturnStatement(node.alternate) &&
        t.isExpressionStatement(node.consequent)
      ) {
        if (!node.alternate.argument) {
          path.replaceWith(
            t.expressionStatement(
              t.logicalExpression("&&", node.test, node.consequent.expression)
            )
          );
          return REPLACED;
        }

        path.replaceWith(
          t.returnStatement(
            t.conditionalExpression(
              node.test,
              t.unaryExpression("void", node.consequent.expression, true),
              node.alternate.argument || h.VOID_0(t)
            )
          )
        );
        return REPLACED;
      }

      if (t.isReturnStatement(node.consequent) && !node.alternate) {
        if (!node.consequent.argument) {
          path.replaceWith(t.expressionStatement(node.test));
          return REPLACED;
        }

        // This would only be worth it if the previous statement was an if
        // because then we may merge to create a conditional.
        if (path.getSibling(path.key - 1).isIfStatement()) {
          path.replaceWith(
            t.returnStatement(
              t.conditionalExpression(
                node.test,
                node.consequent.argument || h.VOID_0(t),
                h.VOID_0(t)
              )
            )
          );
          return REPLACED;
        }
      }

      if (t.isReturnStatement(node.alternate) && !node.consequent) {
        if (!node.alternate.argument) {
          path.replaceWith(t.expressionStatement(node.test));
          return REPLACED;
        }

        // Same as above.
        if (path.getSibling(path.key - 1).isIfStatement()) {
          path.replaceWith(
            t.returnStatement(
              t.conditionalExpression(
                node.test,
                node.alternate.argument || h.VOID_0(t),
                h.VOID_0(t)
              )
            )
          );
          return REPLACED;
        }
      }
    }

    let next = path.getSibling(path.key + 1);

    // If the next satatement(s) is an if statement and we can simplify that
    // to potentailly be an expression (or a return) then this will make it
    // easier merge.
    if (next.isIfStatement()) {
      next.pushContext(path.context);
      next.visit();
      next.popContext();
      next = path.getSibling(path.key + 1);
    }

    // Some other visitor might have deleted our node. OUR NODE ;_;
    if (!path.node) {
      return;
    }

    // No alternate but the next statement is a return
    // also turn into a return conditional
    if (
      t.isReturnStatement(node.consequent) &&
      !node.alternate &&
      next.isReturnStatement()
    ) {
      const nextArg = next.node.argument || h.VOID_0(t);
      next.remove();
      path.replaceWith(
        t.returnStatement(
          t.conditionalExpression(
            node.test,
            node.consequent.argument || h.VOID_0(t),
            nextArg
          )
        )
      );
      return REPLACED;
    }

    // Next is the last expression, turn into a return while void'ing the exprs
    if (
      path.parentPath &&
      path.parentPath.parentPath &&
      path.parentPath.parentPath.isFunction() &&
      !path.getSibling(path.key + 2).node &&
      t.isReturnStatement(node.consequent) &&
      !node.alternate &&
      next.isExpressionStatement()
    ) {
      const nextExpr = next.node.expression;
      next.remove();

      if (node.consequent.argument) {
        path.replaceWith(
          t.returnStatement(
            t.conditionalExpression(
              node.test,
              node.consequent.argument,
              t.unaryExpression("void", nextExpr, true)
            )
          )
        );
        return REPLACED;
      }

      path.replaceWith(t.logicalExpression("||", node.test, nextExpr));
      return REPLACED;
    }
  }
297634
def is_path(value):
    
    return value and isinstance(value, six.string_types) and (value[0] == posixpath.sep or value[:2] == CURRENT_DIR)
634242
function(path) {
            const { node } = path;
            if (isVoid0(node.consequent) && isVoid0(node.alternate)) {
              path.replaceWith(t.sequenceExpression([path.node.test, VOID_0]));
            }
          }
835068
def path=(new_path)
      if new_path && !new_path.respond_to?(:to_str)
        raise TypeError, "Can't convert #{new_path.class} into String."
      end
      @path = (new_path || EMPTY_STR).to_str
      if !@path.empty? && @path[0..0] != SLASH && host != nil
        @path = "/#{@path}"
      end

      # Reset dependent values
      remove_instance_variable(:@normalized_path) if defined?(@normalized_path)
      remove_composite_values

      # Ensure we haven't created an invalid URI
      validate()
    end
81147
function (subpath) {
    var value = this.sub(subpath).get();
    return Imm.Iterable.isIterable(value) ? value.toJS() : value;
  }