<commit_before>use crate::azure::core::{
    errors::{check_status_extract_body, AzureError},
    util::RequestBuilderExt,
    COMPLETE_ENCODE_SET,
};

use super::{
    collection::Collection,
    database::Database,
    query::Query,
    request_response::{Document, ListCollectionsResponse, ListDatabasesResponse},
    requests::*,
    AuthorizationToken, TokenType,
};

use base64;
use http::request::Builder as RequestBuilder;
use hyper::{
    self,
    header::{self, HeaderValue},
    StatusCode,
};
use ring::{digest::SHA256, hmac};
use serde::{de::DeserializeOwned, Serialize};
use serde_json;
use std::sync::Arc;

use chrono;
use hyper_tls::HttpsConnector;
use url::percent_encoding::utf8_percent_encode;

use futures::future::*;

const AZURE_VERSION: &str = "2017-02-22";
const VERSION: &str = "1.0";
const TIME_FORMAT: &str = "%a, %d %h %Y %T GMT";

pub(crate) mod headers {
    pub const HEADER_VERSION: &str = "x-ms-version"; // Cow[str]
    pub const HEADER_DATE: &str = "x-ms-date"; // [String]
    pub const HEADER_OFFER_THROUGHPUT: &str = "x-ms-offer-throughput"; // [u64]
    pub const HEADER_DOCUMENTDB_IS_UPSERT: &str = "x-ms-documentdb-is-upsert"; // [bool]
    pub const HEADER_INDEXING_DIRECTIVE: &str = "x-ms-indexing-directive"; // [IndexingDirective]
    pub const HEADER_MAX_ITEM_COUNT: &str = "x-ms-max-item-count"; // [u64]
    pub const HEADER_CONTINUATION: &str = "x-ms-continuation"; // [ContinuationToken]
    pub const HEADER_CONSISTENCY_LEVEL: &str = "x-ms-consistency-level"; // [ConsistencyLevel]
    pub const HEADER_SESSION_TOKEN: &str = "x-ms-session-token"; // [ContinuationToken]
    pub const HEADER_ALLOW_MULTIPLE_WRITES: &str = "x-ms-cosmos-allow-tentative-writes"; // [bool]
    pub const HEADER_A_IM: &str = "A-IM"; // Cow[str]
    pub const HEADER_DOCUMENTDB_PARTITIONRANGEID: &str = "x-ms-documentdb-partitionkeyrangeid"; // [String]
    pub const HEADER_REQUEST_CHARGE: &str = "x-ms-request-charge"; // [f64]
    pub const HEADER_DOCUMENTDB_PARTITIONKEY: &str = "x-ms-documentdb-partitionkey"; // [String]
    pub const HEADER_DOCUMENTDB_ISQUERY: &str = "x-ms-documentdb-isquery"; // [bool]
    pub const HEADER_DOCUMENTDB_QUERY_ENABLECROSSPARTITION: &str = "x-ms-documentdb-query-enablecrosspartition"; // [bool]
    pub const HEADER_DOCUMENTDB_QUERY_PARALLELIZECROSSPARTITIONQUERY: &str = "x-ms-documentdb-query-parallelizecrosspartitionquery"; // [bool]

}
use self::headers::*;

#[derive(Clone, Copy)]
enum ResourceType {
    Databases,
    Collections,
    Documents,
    StoredProcedures,
}

pub struct Client {
    hyper_client: Arc<hyper::Client<HttpsConnector<hyper::client::HttpConnector>>>,
    auth_token: AuthorizationToken,
}

impl Client {
    pub fn new(auth_token: AuthorizationToken) -> Result<Client, AzureError> {
        let client = hyper::Client::builder().build(HttpsConnector::new(4)?);

        Ok(Client {
            hyper_client: Arc::new(client),
            auth_token,
        })
    }

    pub fn set_auth_token(&mut self, at: AuthorizationToken) {
        self.auth_token = at;<commit_msg>Remove whitespace change<commit_after>use crate::azure::core::{
    errors::{check_status_extract_body, AzureError},
    util::RequestBuilderExt,
    COMPLETE_ENCODE_SET,
};

use super::{
    collection::Collection,
    database::Database,
    query::Query,
    request_response::{Document, ListCollectionsResponse, ListDatabasesResponse},
    requests::*,
    AuthorizationToken, TokenType,
};

use base64;
use http::request::Builder as RequestBuilder;
use hyper::{
    self,
    header::{self, HeaderValue},
    StatusCode,
};
use ring::{digest::SHA256, hmac};
use serde::{de::DeserializeOwned, Serialize};
use serde_json;
use std::sync::Arc;

use chrono;
use hyper_tls::HttpsConnector;
use url::percent_encoding::utf8_percent_encode;

use futures::future::*;

const AZURE_VERSION: &str = "2017-02-22";
const VERSION: &str = "1.0";
const TIME_FORMAT: &str = "%a, %d %h %Y %T GMT";

pub(crate) mod headers {
    pub const HEADER_VERSION: &str = "x-ms-version"; // Cow[str]
    pub const HEADER_DATE: &str = "x-ms-date"; // [String]
    pub const HEADER_OFFER_THROUGHPUT: &str = "x-ms-offer-throughput"; // [u64]
    pub const HEADER_DOCUMENTDB_IS_UPSERT: &str = "x-ms-documentdb-is-upsert"; // [bool]
    pub const HEADER_INDEXING_DIRECTIVE: &str = "x-ms-indexing-directive"; // [IndexingDirective]
    pub const HEADER_MAX_ITEM_COUNT: &str = "x-ms-max-item-count"; // [u64]
    pub const HEADER_CONTINUATION: &str = "x-ms-continuation"; // [ContinuationToken]
    pub const HEADER_CONSISTENCY_LEVEL: &str = "x-ms-consistency-level"; // [ConsistencyLevel]
    pub const HEADER_SESSION_TOKEN: &str = "x-ms-session-token"; // [ContinuationToken]
    pub const HEADER_ALLOW_MULTIPLE_WRITES: &str = "x-ms-cosmos-allow-tentative-writes"; // [bool]
    pub const HEADER_A_IM: &str = "A-IM"; // Cow[str]
    pub const HEADER_DOCUMENTDB_PARTITIONRANGEID: &str = "x-ms-documentdb-partitionkeyrangeid"; // [String]
    pub const HEADER_REQUEST_CHARGE: &str = "x-ms-request-charge"; // [f64]
    pub const HEADER_DOCUMENTDB_PARTITIONKEY: &str = "x-ms-documentdb-partitionkey"; // [String]
    pub const HEADER_DOCUMENTDB_ISQUERY: &str = "x-ms-documentdb-isquery"; // [bool]
    pub const HEADER_DOCUMENTDB_QUERY_ENABLECROSSPARTITION: &str = "x-ms-documentdb-query-enablecrosspartition"; // [bool]
    pub const HEADER_DOCUMENTDB_QUERY_PARALLELIZECROSSPARTITIONQUERY: &str = "x-ms-documentdb-query-parallelizecrosspartitionquery"; // [bool]
}
use self::headers::*;

#[derive(Clone, Copy)]
enum ResourceType {
    Databases,
    Collections,
    Documents,
    StoredProcedures,
}

pub struct Client {
    hyper_client: Arc<hyper::Client<HttpsConnector<hyper::client::HttpConnector>>>,
    auth_token: AuthorizationToken,
}

impl Client {
    pub fn new(auth_token: AuthorizationToken) -> Result<Client, AzureError> {
        let client = hyper::Client::builder().build(HttpsConnector::new(4)?);

        Ok(Client {
            hyper_client: Arc::new(client),
            auth_token,
        })
    }

    pub fn set_auth_token(&mut self, at: AuthorizationToken) {
        self.auth_token = at;
{'fraction_non_alphanumeric': 0.14327485380116958, 'fraction_numerical': 0.007472384665367121, 'mean_word_length': 4.344618055555555, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 13, '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': '4771874', 'n_tokens_mistral': 2173, 'n_tokens_neox': 2155, 'n_words': 419}