remove a followed user from the replica layer

@param followedReplica
replica of the user that will be removed
326749
private void removeFromReplicaLayer(final Node followedReplica) {
		final Node prev = NeoUtils.getPrevSingleNode(followedReplica,
				SocialGraphRelationshipType.GRAPHITY);
		final Node next = NeoUtils.getNextSingleNode(followedReplica,
				SocialGraphRelationshipType.GRAPHITY);

		// bridge the user replica in the replica layer
		prev.getSingleRelationship(SocialGraphRelationshipType.GRAPHITY,
				Direction.OUTGOING).delete();
		if (next != null) {
			next.getSingleRelationship(SocialGraphRelationshipType.GRAPHITY,
					Direction.INCOMING).delete();
			prev.createRelationshipTo(next,
					SocialGraphRelationshipType.GRAPHITY);
		}

		// remove the followship
		followedReplica.getSingleRelationship(
				SocialGraphRelationshipType.FOLLOW, Direction.INCOMING)
				.delete();

		// remove the replica node itself
		followedReplica.getSingleRelationship(
				SocialGraphRelationshipType.REPLICA, Direction.OUTGOING)
				.delete();
		followedReplica.delete();
	}
866457
public void removeUserFromGroup(String username, String groupname) throws CmsException {

        m_securityManager.removeUserFromGroup(m_context, username, groupname, false);
    }
346387
public void clearReplicaSyncRequest(int partitionId, ServiceNamespace namespace, int replicaIndex) {
        ReplicaFragmentSyncInfo syncInfo = new ReplicaFragmentSyncInfo(partitionId, namespace, replicaIndex, null);
        if (!replicaSyncRequests.remove(syncInfo)) {
            return;
        }

        if (logger.isFinestEnabled()) {
            logger.finest("Clearing sync replica request for partitionId=" + partitionId + ", replicaIndex="
                    + replicaIndex + ", namespace=" + namespace);
        }
        releaseReplicaSyncPermits(1);
        replicaSyncTimeoutScheduler.cancelIfExists(syncInfo, null);
    }
813057
private UserProfile removeUserProfile(Session session, String userName, boolean broadcast) throws Exception
   {
      Node profileNode;
      try
      {
         profileNode = utils.getProfileNode(session, userName);
      }
      catch (PathNotFoundException e)
      {
         return null;
      }

      UserProfile profile = readProfile(userName, profileNode);

      if (broadcast)
      {
         preDelete(profile, broadcast);
      }

      profileNode.remove();
      session.save();

      removeFromCache(profile);

      if (broadcast)
      {
         postDelete(profile);
      }

      return profile;
   }
169253
def remove_member_from(self, leaderboard_name, member):
        '''
        
        '''
        member_score = None or self.redis_connection.zscore(
            leaderboard_name, member)
        can_delete_score = member_score and len(
            self.members_from_score_range_in(leaderboard_name, member_score, member_score)) == 1

        pipeline = self.redis_connection.pipeline()
        pipeline.zrem(leaderboard_name, member)
        if can_delete_score:
            pipeline.zrem(self._ties_leaderboard_key(leaderboard_name),
                          str(float(member_score)))
        pipeline.hdel(self._member_data_key(leaderboard_name), member)
        pipeline.execute()
505365
private function cascadeRemove($entity, array &$visited)
    {
        $entitiesToCascade = [];
        $class             = $this->em->getClassMetadata(get_class($entity));

        foreach ($class->getDeclaredPropertiesIterator() as $association) {
            if (! ($association instanceof AssociationMetadata && in_array('remove', $association->getCascade(), true))) {
                continue;
            }

            if ($entity instanceof GhostObjectInterface && ! $entity->isProxyInitialized()) {
                $entity->initializeProxy();
            }

            $relatedEntities = $association->getValue($entity);

            switch (true) {
                case $relatedEntities instanceof Collection:
                case is_array($relatedEntities):
                    // If its a PersistentCollection initialization is intended! No unwrap!
                    foreach ($relatedEntities as $relatedEntity) {
                        $entitiesToCascade[] = $relatedEntity;
                    }
                    break;

                case $relatedEntities !== null:
                    $entitiesToCascade[] = $relatedEntities;
                    break;

                default:
                    // Do nothing
            }
        }

        foreach ($entitiesToCascade as $relatedEntity) {
            $this->doRemove($relatedEntity, $visited);
        }
    }
947838
def remove_outside_collaborator(self, collaborator):
        
        assert isinstance(collaborator, github.NamedUser.NamedUser), collaborator
        headers, data = self._requester.requestJsonAndCheck(
            "DELETE",
            self.url + "/outside_collaborators/" + collaborator._identity
        )
957651
void deleteReplica(Storable replica) throws PersistException {
        // Prevent trigger from being invoked by deleting replica.
        TriggerManager tm = mTriggerManager;
        tm.locallyDisableDelete();
        try {
            replica.delete();
        } finally {
            tm.locallyEnableDelete();
        }
    }
1250868
private void replicateToPeers(Action action, String appName, String id,
                                  InstanceInfo info /* optional */,
                                  InstanceStatus newStatus /* optional */, boolean isReplication) {
        Stopwatch tracer = action.getTimer().start();
        try {
            if (isReplication) {
                numberOfReplicationsLastMin.increment();
            }
            // If it is a replication already, do not replicate again as this will create a poison replication
            if (peerEurekaNodes == Collections.EMPTY_LIST || isReplication) {
                return;
            }

            for (final PeerEurekaNode node : peerEurekaNodes.getPeerEurekaNodes()) {
                // If the url represents this host, do not replicate to yourself.
                if (peerEurekaNodes.isThisMyUrl(node.getServiceUrl())) {
                    continue;
                }
                replicateInstanceActionsToPeers(action, appName, id, info, newStatus, node);
            }
        } finally {
            tracer.stop();
        }
    }
890944
private void removeOldStructure() throws RepositoryException
   {
      ExtendedSession session = (ExtendedSession)service.getStorageSession();
      try
      {
         if (session.itemExists(storagePathOld))
         {
            NodeIterator usersIter = ((ExtendedNode)session.getItem(usersStorageOld)).getNodesLazily();
            while (usersIter.hasNext())
            {
               Node currentUser = usersIter.nextNode();
               currentUser.remove();
               session.save();
            }

            NodeIterator groupsIter = ((ExtendedNode)session.getItem(groupsStorageOld)).getNodesLazily();
            while (groupsIter.hasNext())
            {
               Node currentGroup = groupsIter.nextNode();
               currentGroup.remove();
               session.save();
            }

            NodeIterator membershipTypesIter =
               ((ExtendedNode)session.getItem(membershipTypesStorageOld)).getNodesLazily();
            while (membershipTypesIter.hasNext())
            {
               Node currentMembershipType = membershipTypesIter.nextNode();
               currentMembershipType.remove();
               session.save();
            }

            session.getItem(storagePathOld).remove();
            session.save();
         }
      }
      finally
      {
         session.logout();
      }
   }
533272
public void unblockUser(Integer targetUserId) throws IOException {

        String tailUrl = GitlabUser.USERS_URL + "/" + targetUserId + GitlabUser.UNBLOCK_URL;

        retrieve().method(POST).to(tailUrl, Void.class);
    }
37704
def remove(self, user, status=None, symmetrical=False):
        
        if not status:
            status = RelationshipStatus.objects.following()

        res = Relationship.objects.filter(
            from_user=self.instance,
            to_user=user,
            status=status,
            site__pk=settings.SITE_ID
        ).delete()

        if symmetrical:
            return (res, user.relationships.remove(self.instance, status, False))
        else:
            return res
1083217
private static long getLastUpdateByReplica(final Node userReplica) {
		final Node user = NeoUtils.getNextSingleNode(userReplica,
				SocialGraphRelationshipType.REPLICA);
		if (user.hasProperty(Properties.User.LAST_UPDATE)) {
			return (long) user.getProperty(Properties.User.LAST_UPDATE);
		}
		return 0;
	}
279149
def remove_member_from(self, leaderboard_name, member):
        '''
        
        '''
        pipeline = self.redis_connection.pipeline()
        pipeline.zrem(leaderboard_name, member)
        pipeline.hdel(self._member_data_key(leaderboard_name), member)
        pipeline.execute()
1277908
def remove_user(self, user):
        
        org_user = self._org_user_model.objects.get(user=user, organization=self)
        org_user.delete()

        # User removed signal
        user_removed.send(sender=self, user=user)
695633
public void removeCustomOverride(int path_id, String client_uuid) throws Exception {
        updateRequestResponseTables("custom_response", "", getProfileIdFromPathID(path_id), client_uuid, path_id);
    }
1130729
def remove(self, rel_path, propagate=False):
        ''''''

        key = self._get_boto_key(rel_path)
        if key:
            key.delete()