if the full path to the entry is not contained in any of the paths to retain - remove it from the object
this step does not remove entries whose full path is contained in a path to retain but are not equal to an
entry to retain
480423
protected boolean discardPath(String pathToEntry, Entry<String, Object> entry)
	{
		if (!foundAsPrefix(pathToEntry) || !delim.accept(entry.getKey()))
		{
			//skip traversal of subtree and remove from the traversal iterator
			return true;
		}
		return false;
	}
1089691
synchronized LeaseOpenTime removeLease(Lease lease, String src) {
    LeaseOpenTime leaseOpenTime = sortedLeasesByPath.remove(src);
    if (!lease.removePath(src)) {
      LOG.error(src + " not found in lease.paths (=" + lease.paths + ")");
    }

    if (!lease.hasPath()) {
      leases.remove(lease.holder);
      if (!sortedLeases.remove(lease)) {
        LOG.error(lease + " not found in sortedLeases");
      }
    }
    return leaseOpenTime;
  }
1167824
def delete(self, key):
    '''
    '''
    path = self.object_path(key)
    if os.path.exists(path):
      os.remove(path)
588270
protected Entry<K, V> removeEntry(Entry<K, V> pEntry) {
        if (pEntry == null) {
            return null;
        }

        // Find candidate entry for this key
        Entry<K, V> candidate = getEntry(pEntry.getKey());
        if (candidate == pEntry || (candidate != null && candidate.equals(pEntry))) {
            // Remove
            remove(pEntry.getKey());
            return pEntry;
        }
        return null;
    }
634938
def remove(self, path):
        

        entry = self.find(path)

        if not entry:
            raise ValueError("%s does not exists" % path)

        if entry.type == 'root storage':
            raise ValueError("can no remove root entry")

        if entry.type == "storage" and not entry.child_id is None:
            raise ValueError("storage contains children")

        entry.pop()

        # remove stream data
        if entry.type == "stream":
            self.free_fat_chain(entry.sector_id, entry.byte_size < self.min_stream_max_size)

        self.free_dir_entry(entry)
289397
private void removeEntry(EntryImpl<K, V> entry) {

    // Removes from bucket.
    EntryImpl<K, V> previous = entry._previous;
    EntryImpl<K, V> next = entry._next;
    if (previous != null) {
      previous._next = next;
      entry._previous = null;
    } else { // First in bucket.
      _entries[entry._index] = next;
    }
    if (next != null) {
      next._previous = previous;
      entry._next = null;
    } // Else do nothing, no last pointer.

    // Removes from collection.
    EntryImpl<K, V> before = entry._before;
    EntryImpl<K, V> after = entry._after;
    if (before != null) {
      before._after = after;
      entry._before = null;
    } else { // First in collection.
      _mapFirst = after;
    }
    if (after != null) {
      after._before = before;
    } else { // Last in collection.
      _mapLast = before;
    }

    // Clears value and key.
    entry._key = null;
    entry._value = null;

    // Recycles.
    entry._after = _poolFirst;
    _poolFirst = entry;

    // Updates size.
    _size--;
    sizeChanged();
  }
703103
def clear(self):
        '''
        
        '''
        if os.path.exists(self.path):
            os.remove(self.path)
68936
@Override
  public boolean removeEldestEntry(Map.Entry eldest) {
    boolean mustBeRemoved = this.size() > maxSize;

    if (mustBeRemoved) {
      ServerPrepareResult serverPrepareResult = ((ServerPrepareResult) eldest.getValue());
      serverPrepareResult.setRemoveFromCache();
      if (serverPrepareResult.canBeDeallocate()) {
        try {
          protocol.forceReleasePrepareStatement(serverPrepareResult.getStatementId());
        } catch (SQLException e) {
          //eat exception
        }
      }
    }
    return mustBeRemoved;
  }
1008216
def path_entry(self, path):
        
        if path[0] != '/':
            return None
        path_parts = path.split('/')
        # Note that here the first element will be '' because it's before the
        # first separator.  That's OK, the join puts it back together.
        directory = '/'.join(path_parts[:-1])
        name = path_parts[-1]
        if directory not in self.listings:
            return None
        if name not in self.listings[directory]['entries']:
            return None
        return self.listings[directory]['entries'][name]
1336767
private void takeNextStep(int lastStep, int nextStep)
    {
        if (!pathStoppedRequested)
        {
            removeObjectId(path.getX(lastStep), path.getY(lastStep));
            assignObjectId(path.getX(nextStep), path.getY(nextStep));
        }
    }
1192782
def _must_be_deleted(local_path, r_st):
        """"""
        # if the file doesn't exists
        if not os.path.lexists(local_path):
            return True

        # or if the file type is different
        l_st = os.lstat(local_path)
        if S_IFMT(r_st.st_mode) != S_IFMT(l_st.st_mode):
            return True

        return False
191834
private void avoidObstacle(int nextStep, int max)
    {
        if (nextStep >= max - 1)
        {
            pathStoppedRequested = true;
        }
        final Collection<Integer> cid = mapPath.getObjectsId(path.getX(nextStep), path.getY(nextStep));
        if (sharedPathIds.containsAll(cid))
        {
            setDestination(destX, destY);
        }
        else
        {
            if (!ignoredIds.containsAll(cid))
            {
                setDestination(destX, destY);
            }
        }
    }
864704
function _removeDotSegments(path, hasAuthority) {
  var rval = '';

  if(path.indexOf('/') === 0) {
    rval = '/';
  }

  // RFC 3986 5.2.4 (reworked)
  var input = path.split('/');
  var output = [];
  while(input.length > 0) {
    if(input[0] === '.' || (input[0] === '' && input.length > 1)) {
      input.shift();
      continue;
    }
    if(input[0] === '..') {
      input.shift();
      if(hasAuthority ||
        (output.length > 0 && output[output.length - 1] !== '..')) {
        output.pop();
      }
      // leading relative URL '..'
      else {
        output.push('..');
      }
      continue;
    }
    output.push(input.shift());
  }

  return rval + output.join('/');
}
870358
def forget(self, key):
        
        path = self._path(key)

        if os.path.exists(path):
            os.remove(path)

            return True

        return False
676743
def removeDepartment(self, dep):
        
        if api.is_uid(dep):
            dep = api.get_object_by_uid(dep)
        deps = self.getDepartments()
        if dep not in deps:
            return False
        deps.remove(dep)
        self.setDepartments(deps)
        return True
1214075
protected void entryRemoved (V entry)
    {
        if (entry != null) {
            _size -= _sizer.computeSize(entry);
            if (_remobs != null) {
                _remobs.removedFromMap(this, entry);
            }
        }
    }
1044365
private boolean pathExists(T u, T v, boolean includeAdjacent) {
        if (!nodes.contains(u) || !nodes.contains(v)) {
            return false;
        }
        if (includeAdjacent && isAdjacent(u, v)) {
            return true;
        }
        Deque<T> stack = new LinkedList<>();
        Set<T> visited = new HashSet<>();
        stack.push(u);
        while (!stack.isEmpty()) {
            T node = stack.pop();
            if (node.equals(v)) {
                return true;
            }
            if (!visited.contains(node)) {
                visited.add(node);
                edges.get(node).stream()
                     .filter(e -> includeAdjacent || !node.equals(u) || !e.equals(v))
                     .forEach(stack::push);
            }
        }
        assert !visited.contains(v);
        return false;
    }