Delete all specs and notes for self recursively
12841
def delete_all_specs_and_notes(obj = nil)
      obj = self if obj.nil?
      obj.delete_all_specs
      obj.delete_all_notes
      obj.delete_all_exhibits
      obj.children.each do |_name, child|
        next unless child.has_specs?
        delete_all_specs_and_notes(child)
      end
    end
621799
def remove(self, spec_or_id, multi=True, *args, **kwargs):
        """"""
        if multi:
            return self.delete_many(spec_or_id)
        return self.delete_one(spec_or_id)
1007318
function clean(obj) {
  var ret = {};

  // Remove traits/properties that are already represented
  // outside of the data container
  // TODO: Refactor into `omit` call
  var excludeKeys = ['id', 'name', 'firstName', 'lastName'];
  each(excludeKeys, function(omitKey) {
    clear(obj, omitKey);
  });

  // Flatten nested hierarchy, preserving arrays
  obj = flatten(obj);

  // Discard nulls, represent arrays as comma-separated strings
  // FIXME: This also discards `undefined`s. Is that OK?
  for (var key in obj) {
    if (has.call(obj, key)) {
      var val = obj[key];
      if (val == null) {
        continue;
      }

      if (is.array(val)) {
        ret[key] = val.toString();
        continue;
      }

      ret[key] = val;
    }
  }

  return ret;
}
986873
def delete_all(self):
        '''
        '''
        try:
            self.conn.indices.delete_mapping(
                index=self.index, doc_type=self.type_tag)
        except TransportError:
            logger.warn('type %r in index %r already deleted',
                        self.index, self.type_tag, exc_info=True)
        try:
            self.conn.indices.delete_mapping(
                index=self.index, doc_type=self.type_assoc)
        except TransportError:
            logger.warn('type %r in index %r already deleted',
                        self.index, self.type_assoc, exc_info=True)
1350362
def clean(self):
        """"""
        doc = self._resource
        result = {k: v for k, v in doc.iteritems() if k not in
                  self.internal_fields}

        if '_id' in doc and 'id' not in result:
            result['id'] = doc['_id']

        return result
650017
def cleanup(test_data, udfs, tmp_data, tmp_db):
    """"""
    con = make_ibis_client(ENV)

    if udfs:
        # this comes before test_data bc the latter clobbers this too
        con.hdfs.rmdir(os.path.join(ENV.test_data_dir, 'udf'))

    if test_data:
        con.drop_database(ENV.test_data_db, force=True)
        con.hdfs.rmdir(ENV.test_data_dir)

    if tmp_data:
        con.hdfs.rmdir(ENV.tmp_dir)

    if tmp_db:
        con.drop_database(ENV.tmp_db, force=True)
346182
def delete_all_versions(self, model_name, obj_pk):
        """"""
        if self.cache:
            for version in self.versions:
                key = self.key_for(version, model_name, obj_pk)
                self.cache.delete(key)
897837
def clean():
    """"""
    run('rm -rf build/')
    run('rm -rf dist/')
    run('rm -rf puzzle.egg-info')
    run('find . -name __pycache__ -delete')
    run('find . -name *.pyc -delete')
    run('find . -name *.pyo -delete')
    run('find . -name *~ -delete')

    log.info('cleaned up')
92523
def clean():
    ""
    src_dir = easy.options.setdefault("docs", {}).get('src_dir', None)
    if src_dir is None:
        src_dir = 'src' if easy.path('src').exists() else '.'

    with easy.pushd(src_dir):
        for pkg in set(easy.options.setup.packages) | set(("tests",)):
            for filename in glob.glob(pkg.replace('.', os.sep) + "/*.py[oc~]"):
                easy.path(filename).remove()
425432
def clean(session):
    
    clean_dirs = (
        get_path(".cache"),
        get_path(".coverage"),
        get_path(".pytest_cache"),
        get_path("__pycache__"),
        get_path("build"),
        get_path("dist"),
        get_path("docs", "__pycache__"),
        get_path("docs", "build"),
        get_path("scripts", "macos", "__pycache__"),
        get_path("scripts", "macos", "dist_wheels"),
        get_path("scripts", "macos", "fixed_wheels"),
        get_path("src", "bezier.egg-info"),
        get_path("src", "bezier", "__pycache__"),
        get_path("src", "bezier", "extra-dll"),
        get_path("src", "bezier", "lib"),
        get_path("tests", "__pycache__"),
        get_path("tests", "functional", "__pycache__"),
        get_path("tests", "unit", "__pycache__"),
        get_path("wheelhouse"),
    )
    clean_globs = (
        get_path(".coverage"),
        get_path("*.mod"),
        get_path("*.pyc"),
        get_path("src", "bezier", "*.pyc"),
        get_path("src", "bezier", "*.pyd"),
        get_path("src", "bezier", "*.so"),
        get_path("src", "bezier", "quadpack", "*.o"),
        get_path("src", "bezier", "*.o"),
        get_path("tests", "*.pyc"),
        get_path("tests", "functional", "*.pyc"),
        get_path("tests", "unit", "*.pyc"),
    )
    for dir_path in clean_dirs:
        session.run(shutil.rmtree, dir_path, ignore_errors=True)
    for glob_path in clean_globs:
        for filename in glob.glob(glob_path):
            session.run(os.remove, filename)
425616
def remove(self, path, recursive=True, skip_trash=True):
        
        if recursive:
            to_delete = []
            for s in self.get_all_data().keys():
                if s.startswith(path):
                    to_delete.append(s)
            for s in to_delete:
                self.get_all_data().pop(s)
        else:
            self.get_all_data().pop(path)
1219791
def cleanup(self):
        

        all([delete_file_or_tree(f) for f in self.to_delete])
        self.to_delete = []
530236
def clear_caches(self):
        
        for element_name in dir(self.components):
            element = getattr(self.components, element_name)
            if hasattr(element, 'cache_val'):
                delattr(element, 'cache_val')
260981
def delete_all_renditions(self):
        ''''''
        if self.renditions:
            for r in self.renditions.values():
                default_storage.delete(r)
            self.renditions = {}
85160
def strip_system_metadata(etree_obj):
    
    for series_id_el in etree_obj.findall('seriesId'):
        etree_obj.remove(series_id_el)
    for media_type_el in etree_obj.findall('mediaType'):
        etree_obj.remove(media_type_el)
    for file_name_el in etree_obj.findall('fileName'):
        etree_obj.remove(file_name_el)
512349
function purgeDeps(opts, diff, meta) {
    if (!diff) {
        return;
    }

    var depsKey = 'dependencies' in diff ?
        'dependencies' : 'dependencies__deleted' in diff ?
        'dependencies__deleted' : 'dependencies__added' in diff ?
        'dependencies__added' : null;
    if (!depsKey) {
        return diff;
    }

    var deps = diff[depsKey];

    diff[depsKey] = Object.keys(deps).reduce(function (acc, key) {
        var deleted = meta.deleted ? meta.deleted :
            (key.indexOf('__deleted') !== -1 ||
            depsKey === 'dependencies__deleted');
        var added = meta.added ? meta.added :
            (key.indexOf('__added') !== -1 ||
            depsKey === 'dependencies__added');
        if (deleted || added) {
            if (meta.depth >= opts.depth) {
                if (!opts.short) {
                    deps[key].dependencies = '[NestedObject]';
                    acc[key] = deps[key];
                } else {
                    acc[key] = (deleted ? '[Deleted' : '[Added') +
                        '@' + deps[key].version + ']';
                }
            } else {
                acc[key] = purgeDeps(opts, deps[key], {
                    depth: meta.depth + 1,
                    added: added,
                    deleted: deleted
                });
            }
        } else {
            acc[key] = purgeDeps(opts, deps[key], {
                depth: meta.depth + 1
            });
        }

        return acc;
    }, {});

    return diff;
}
805656
def cleanup(self):
        
        if getattr(self._finalizer, "detach", None) and self._finalizer.detach():
            if os.path.exists(self.path):
                try:
                    rmtree(self.path)
                except OSError:
                    pass
                else:
                    self.path = None