<commit_before>//
//  RxTwift.swift
//  Pods
//
//  Created by Mihyaeru on 2/28/16.
//
//

import Foundation
import RxSwift

public class RxTwift {
    let client: Client

    public init(
            consumerKey:       String,
            consumerSecret:    String,
            accessToken:       String,
            accessTokenSecret: String,
            random:            RandomProtocol    = Random(),
            timestamp:         TimestampProtocol = Timestamp()
    ) {
        let oauth = OAuth(
            consumerKey:       consumerKey,
            consumerSecret:    consumerSecret,
            accessToken:       accessToken,
            accessTokenSecret: accessTokenSecret,
            random:            random,
            timestamp:         timestamp
        )
        self.client = Client(oauth: oauth)
    }
}

// /statuses/...
public extension RxTwift {
    public func getHomeTimeline(
        count count:        Int?   = nil,
        sinceId:            Int64? = nil,
        maxId:              Int64? = nil,
        trimUser:           Bool?  = nil,
        excludeReplies:     Bool?  = nil,
        contributorDetails: Bool?  = nil,
        includeEntities:    Bool?  = nil
    ) -> Observable<Tweet> {
        return self.client.get("/statuses/home_timeline.json", params: Dictionary.createWithNotNil(
            "count"              .by(count),
            "since_id"           .by(sinceId),
            "max_id"             .by(maxId),
            "trim_user"          .by(trimUser),
            "exclude_replies"    .by(excludeReplies),
            "contributor_details".by(contributorDetails),
            "include_entities"   .by(includeEntities)
        )).decode().flatMapSequence()
    }

    public func getMentionsTimeline(
        count count:        Int?   = nil,
        sinceId:            Int64? = nil,
        maxId:              Int64? = nil,
        trimUser:           Bool?  = nil,
        contributorDetails: Bool?  = nil,
        includeEntities:    Bool?  = nil
    ) -> Observable<Tweet> {
        return self.client.get("/statuses/mentions_timeline.json", params: Dictionary.createWithNotNil(
            "count"              .by(count),
            "since_id"           .by(sinceId),
            "max_id"             .by(maxId),
            "trim_user"          .by(trimUser),
            "contributor_details".by(contributorDetails),
            "include_entities"   .by(includeEntities)
        )).decode().flatMapSequence()
    }

    public func getUserTimeline(
        userId userId:      Int64?  = nil,
        screenName:         String? = nil,
        count:              Int?    = nil,
        sinceId:            Int64?  = nil,
        maxId:              Int64?  = nil,
        trimUser:           Bool?   = nil,
        excludeReplies:     Bool?   = nil,
        contributorDetails: Bool?   = nil,
        includeRts:         Bool?   = nil

    ) -> Observable<Tweet> {
        return self.client.get("/statuses/user_timeline.json", params: Dictionary.createWithNotNil(
            "user_id"            .by(userId),
            "screen_name"        .by(screenName),
            "count"              .by(count),
            "since_id"           .by(sinceId),
            "max_id"             .by(maxId),
            "trim_user"          .by(trimUser),
            "exclude_replies"    .by(excludeReplies),
            "contributor_details".by(contributorDetails),
            "include_rts"        .by(includeRts)
        )).decode().flatMapSequence()
    }
}<commit_msg>feat(api): implement `GET /statuses/retweets_of_me`<commit_after>//
//  RxTwift.swift
//  Pods
//
//  Created by Mihyaeru on 2/28/16.
//
//

import Foundation
import RxSwift

public class RxTwift {
    let client: Client

    public init(
            consumerKey:       String,
            consumerSecret:    String,
            accessToken:       String,
            accessTokenSecret: String,
            random:            RandomProtocol    = Random(),
            timestamp:         TimestampProtocol = Timestamp()
    ) {
        let oauth = OAuth(
            consumerKey:       consumerKey,
            consumerSecret:    consumerSecret,
            accessToken:       accessToken,
            accessTokenSecret: accessTokenSecret,
            random:            random,
            timestamp:         timestamp
        )
        self.client = Client(oauth: oauth)
    }
}

// /statuses/...
public extension RxTwift {
    public func getHomeTimeline(
        count count:        Int?   = nil,
        sinceId:            Int64? = nil,
        maxId:              Int64? = nil,
        trimUser:           Bool?  = nil,
        excludeReplies:     Bool?  = nil,
        contributorDetails: Bool?  = nil,
        includeEntities:    Bool?  = nil
    ) -> Observable<Tweet> {
        return self.client.get("/statuses/home_timeline.json", params: Dictionary.createWithNotNil(
            "count"              .by(count),
            "since_id"           .by(sinceId),
            "max_id"             .by(maxId),
            "trim_user"          .by(trimUser),
            "exclude_replies"    .by(excludeReplies),
            "contributor_details".by(contributorDetails),
            "include_entities"   .by(includeEntities)
        )).decode().flatMapSequence()
    }

    public func getMentionsTimeline(
        count count:        Int?   = nil,
        sinceId:            Int64? = nil,
        maxId:              Int64? = nil,
        trimUser:           Bool?  = nil,
        contributorDetails: Bool?  = nil,
        includeEntities:    Bool?  = nil
    ) -> Observable<Tweet> {
        return self.client.get("/statuses/mentions_timeline.json", params: Dictionary.createWithNotNil(
            "count"              .by(count),
            "since_id"           .by(sinceId),
            "max_id"             .by(maxId),
            "trim_user"          .by(trimUser),
            "contributor_details".by(contributorDetails),
            "include_entities"   .by(includeEntities)
        )).decode().flatMapSequence()
    }

    public func getUserTimeline(
        userId userId:      Int64?  = nil,
        screenName:         String? = nil,
        count:              Int?    = nil,
        sinceId:            Int64?  = nil,
        maxId:              Int64?  = nil,
        trimUser:           Bool?   = nil,
        excludeReplies:     Bool?   = nil,
        contributorDetails: Bool?   = nil,
        includeRts:         Bool?   = nil
    ) -> Observable<Tweet> {
        return self.client.get("/statuses/user_timeline.json", params: Dictionary.createWithNotNil(
            "user_id"            .by(userId),
            "screen_name"        .by(screenName),
            "count"              .by(count),
            "since_id"           .by(sinceId),
            "max_id"             .by(maxId),
            "trim_user"          .by(trimUser),
            "exclude_replies"    .by(excludeReplies),
            "contributor_details".by(contributorDetails),
            "include_rts"        .by(includeRts)
        )).decode().flatMapSequence()
    }

    public func getRetweetsOfMe(
        count count:         Int?   = nil,
        sinceId:             Int64? = nil,
        maxId:               Int64? = nil,
        trimUser:            Bool?  = nil,
        includeEntities:     Bool?  = nil,
        includeUserEntities: Bool?  = nil
    ) -> Observable<Tweet> {
        return self.client.get("/statuses/retweets_of_me.json", params: Dictionary.createWithNotNil(
            "count"                .by(count),
            "since_id"             .by(sinceId),
            "max_id"               .by(maxId),
            "trim_user"            .by(trimUser),
            "include_entities"     .by(includeEntities),
            "include_user_entities".by(includeUserEntities)
        )).decode().flatMapSequence()
    }
}
{'fraction_non_alphanumeric': 0.1058838447882323, 'fraction_numerical': 0.005325893989348212, 'mean_word_length': 1.4208103130755065, 'pattern_counts': {'":': 0, '<': 10, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4520567', 'n_tokens_mistral': 2281, 'n_tokens_neox': 2224, 'n_words': 428}