code: def remove_members_outside_rank_in(self, leaderboard_name, rank):
          '''
          Remove members from the named leaderboard in a given rank range.
  
          @param leaderboard_name [String] Name of the leaderboard.
          @param rank [int] the rank (inclusive) which we should keep.
          @return the total member count which was removed.
          '''
          if self.order == self.DESC:
              rank = -(rank) - 1
              return self.redis_connection.zremrangebyrank(
                  leaderboard_name, 0, rank)
          else:
              return self.redis_connection.zremrangebyrank(
                  leaderboard_name, rank, -1f remove_members_outside_rank_in(self, leaderboard_name, rank):
          '''
          Remove members from the named leaderboard in a given rank range.
  
          @param leaderboard_name [String] Name of the leaderboard.
          @param rank [int] the rank (inclusive) which we should keep.
          @return the total member count which was removed.
          '''
          if self.order == self.DESC:
              rank = -(rank) - 1
              return self.redis_connection.zremrangebyrank(
                  leaderboard_name, 0, rank)
          else:
              return self.redis_connection.zremrangebyrank(
                  leaderboard_name, rank, -1)
docs: Remove members from the named leaderboard in a given rank range.
  
          @param leaderboard_name [String] Name of the leaderboard.
          @param rank [int] the rank (inclusive) which we should keep.
          @return the total member count which was removed.