Based on `key` in ancestral records, format property path to offending entity.
553345
function asPath({ ancestors }) {
  const path = [];

  for (const { key } of ancestors) {
    if (key != null) {
      if (typeof key === 'number') {
        path.push(`[${key}]`);
      } else {
        path.push(`['${stringify(key).slice(1, -1)}']`);
      }
    }
  }

  return path.join('');
}
159232
function baseUnset$1(object, path) {
  path = castPath$3(path, object);
  object = parent(object, path);
  return object == null || delete object[toKey$3(last(path))];
}
788639
function validatePropertyKey(name, element, parentType) {
  if (!NUMERIC_PROPERTY_REGEX.test(name)) {
    return;
  }
  warnAndMonitorForKeyUse(
    'Child objects should have non-numeric keys so ordering is preserved.',
    element,
    parentType
  );
}
61305
function(key) {
      var that = this;

      if (!this._key || !key) {
        return Promise.reject(new Error('No unique key specified'));
      }

      return this.readByKey(key).then(function(doc) {
        return that.delete(doc[that._dbType.id]);
      });
    }
1281014
def delete_from_index(self, key):
        ""
        old_value = self.data[key]
        keys = set(old_value.keys()).intersection(self.indexes.keys())
        for index_name in keys:
            if old_value[index_name] in self.indexes[index_name]:
                del self.indexes[index_name][old_value[index_name]]
1100103
function sibling(node, selector, ancestry) {
            var parent = ancestry[0], listProp, keys, i, l, k, m;
            if (!parent) { return false; }
            keys = estraverse.VisitorKeys[parent.type];
            for (i = 0, l = keys.length; i < l; ++i) {
                listProp = parent[keys[i]];
                if (isArray(listProp)) {
                    for (k = 0, m = listProp.length; k < m; ++k) {
                        if (listProp[k] !== node && matches(listProp[k], selector, ancestry)) {
                            return true;
                        }
                    }
                }
            }
            return false;
        }
354385
def hset(self, key, field, value):
        """"""
        return self.execute(b'HSET', key, field, value)
396847
def ancestors_of(hash_id, options={}, cmd_options={})
      cmd = command_with_limit(["log -r \"ancestors(?)\" --style ?", hash_id, style], options[:limit])
      hg_to_array(cmd, {:separator => changeset_separator}, cmd_options) do |line|
        build(line)
      end
    end
56773
def invalidate(self, key):
        ''''''
        path = self.path(self.xform_key(key))
        try:
            LOG.debug('invalidate %s (%s)', key, path)
            path.unlink()
        except OSError:
            pass
384558
protected String getRelativePath(String dataId)
   {
      StringBuilder buffer = new StringBuilder(256);
      List<String> ancestors = getAncestors(dataId);
      for (int i = 0, length = ancestors.size(); i < length; i++)
      {
         buffer.append(ancestors.get(i));
         if (i != length - 1)
         {
            buffer.append('/');
         }
      }
      return buffer.toString();
   }
486656
def collections(record, key, value):
    """"""
    return {
        'primary': value.get('a'),
        'secondary': value.get('b'),
        'deleted': value.get('c'),
    }
378496
def format_key_from_backend(self, key):
        """"""
        if not self.prefix:
            return key
        if not key.startswith(self.prefix):
            raise StorageError("Key {!r} does not start with expected prefix {!r}".format(key, self.prefix))
        return key[len(self.prefix):]
288928
def ancestry_path(to_s_column = _ct.name_column)
      self_and_ancestors.map { |n| n.send to_s_column.to_sym }.reverse
    end
4
def key_to_kind(cls, key):
    
    if key.kind() == Kind.KIND_NAME:
      return key.id()
    else:
      return key.parent().id()
781225
function populateOriginalKeyDetails (json, originalKey) {
  const properties = [
    'id',
    'name'
  ]

  properties
    .filter(jsonProp => !json.hasOwnProperty(jsonProp))
    .forEach(jsonProp => {
      json[jsonProp] = originalKey
    })
}
1036683
function validateNode(node, path, ancestors) {
  let errors = [];

  if (!node.type) {
    return [{ path, error: 'Node is missing the type property' }];
  }

  if (ancestors.length && node.type === 'Page') {
    errors = [...errors, { path, error: 'Encountered a nested page. Page is only allowed at the top level' }];
  }

  errors = [
    ...errors,
    ...assertProperties(node, path, requiredProperties[node.type]),
    ...assertDeprecations(node, path, deprecatedProperties[node.type]),
  ];

  // Parse logical expressions
  ['hidden', 'disabled', 'test'].forEach((field) => {
    if (!node[field]) {
      return;
    }

    try {
      parseExpression(node[field]);
    } catch (e) {
      errors = [...errors, { path: [...path, field], error: e.message }];
    }
  });

  // Recurse through children
  if (node.children) {
    node.children.forEach((child, index) => {
      errors = [
        ...errors,
        ...validateNode(child, [...path, 'children', index], [...ancestors, node]),
      ];
    });
  }

  // Check and recurse through branches
  if (node.branches) {
    node.branches.forEach((branch, branchIndex) => {
      errors = [
        ...errors,
        ...assertProperties(
          branch,
          [...path, 'branches', branchIndex],
          ['test', 'children'],
        ),
      ];

      // Validate the text expression
      if (branch.test) {
        try {
          parseExpression(branch.test);
        } catch (e) {
          errors = [...errors, { path: [...path, 'branches', branchIndex, 'test'], error: e.message }];
        }
      }

      // Recurse through the branch children
      if (branch.children) {
        branch.children.forEach((child, index) => {
          errors = [
            ...errors,
            ...validateNode(child, [...path, 'branches', branchIndex, 'children', index], [...ancestors, node]),
          ];
        });
      }
    });
  }

  // Recurse over the options
  if (node.options) {
    node.options.forEach((option, index) => {
      errors = [
        ...errors,
        ...validateNode(option, [...path, 'options', index], [...ancestors, node]),
      ];
    });
  }

  // Check image
  if (node.image) {
    if (typeof node.image !== 'object') {
      errors = [
        ...errors,
        { path, error: `an object was expected for the image property. Got ${typeof node.image}` },
      ];
    }

    errors = [
      ...errors,
      ...assertProperties(
        { ...node.image, type: 'Image' },
        [...path, 'image'],
        ['url', 'alt'],
      ),
    ];
  }

  return errors;
}
902252
def cache_key(self):
        """"""
        try:
            return self.path
        except TypeError:
            raise TypeError("self.path is invalild: '{}', '{}'".format(str(self.path), type(self.path)))