text:
namespace AzureFunctionsApi
{
    #pragma warning disable // Disable all warnings

    [System.CodeDom.Compiler.GeneratedCode("NSwag", "11.3.3.0")]
    public partial class Client
    {
        private System.Lazy<Newtonsoft.Json.JsonSerializerSettings> _settings;
        private string _baseUrl = "https://dotvvmazurefunctionstest.azurewebsites.net";

        public Client()
        {
    		_settings = new System.Lazy<Newtonsoft.Json.JsonSerializerSettings>(() =>
            {
                var settings = new Newtonsoft.Json.JsonSerializerSettings();
                UpdateJsonSerializerSettings(settings);
                return settings;
            });
    	}

        public string BaseUrl
        {
            get { return _baseUrl; }
            set { _baseUrl = value; }
        }

        partial void UpdateJsonSerializerSettings(Newtonsoft.Json.JsonSerializerSettings settings);
        partial void PrepareRequest(System.Net.Http.HttpClient client, System.Net.Http.HttpRequestMessage request, string url);
        partial void PrepareRequest(System.Net.Http.HttpClient client, System.Net.Http.HttpRequestMessage request, System.Text.StringBuilder urlBuilder);
        partial void ProcessResponse(System.Net.Http.HttpClient client, System.Net.Http.HttpResponseMessage response);

        /// <returns>Success operation</returns>
        /// <exception cref="SwaggerException">A server side error occurred.</exception>
        public void _api_AddTableEntity_post(CreateFormModel data)
        {
            System.Threading.Tasks.Task.Run(async () => await _api_AddTableEntity_postAsync(data, System.Threading.CancellationToken.None)).GetAwaiter().GetResult();
        }

        /// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param>
        /// <returns>Success operation</returns>
        /// <exception cref="SwaggerException">A server side error occurred.</exception>
        public async System.Threading.Tasks.Task _api_AddTableEntity_postAsync(CreateFormModel data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
        {
            var urlBuilder_ = new System.Text.StringBuilder();
            urlBuilder_.Append(BaseUrl).Append("/api/AddTableEntity");

            var client_ = new System.Net.Http.HttpClient();
            try
            {
                using (var request_ = new System.Net.Http.HttpRequestMessage())
                {
                    var content_ = new System.Net.Http.StringContent(Newtonsoft.Json.JsonConvert.SerializeObject(data, _settings.Value));
                    content_.Headers.ContentType.MediaType = "application/json";
                    request_.Content = content_;
                    request_.Method = new System.Net.Http.HttpMethod("POST");

                    PrepareRequest(client_, request_, urlBuilder_);
                    var url_ = urlBuilder_.ToString();
                    request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute);
                    PrepareRequest(client_, request_, url_);

                    var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false);
                    try
                    {
                        var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value);
                        foreach (var item_ in response_.Content.Headers)
                            headers_[item_.Key] = item_.Value;

                        ProcessResponse(client_, response_);

                        var status_ = ((int)response_.StatusCode).ToString();
                        if (status_ == "204")
                        {
                            return;
                        }
                        else
                        if (status_ != "200" && status_ != "204")
                        {
                            var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false);
                            throw new SwaggerException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", status_, responseData_, headers_, null);
                        }
                    }
                    finally
                    {
                        if (response_ != null)
                            response_.Dispose();
                    }
                }
            }
            finally
            {
                if (client_ != null)
                    client_.Dispose();
            }
        }

        /// <returns>Success operation</returns>
        /// <exception cref="SwaggerException">A server side error occurred.</exception>
        public void _api_DeleteEntities_delete()
        {
            System.Threading.Tasks.Task.Run(async () => await _api_DeleteEntities_deleteAsync(System.Threading.CancellationToken.None)).GetAwaiter().GetResult();
        }

        /// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param>
        /// <returns>Success operation</returns>
        /// <exception cref="SwaggerException">A server side error occurred.</exception>
        public async System.Threading.Tasks.Task _api_DeleteEntities_deleteAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
        {
            var urlBuilder_ = new System.Text.StringBuilder();
            urlBuilder_.Append(BaseUrl).Append("/api/DeleteEntities");

            var client_ = new System.Net.Http.HttpClient();
            try
            {
                using (var request_ = new System.Net.Http.HttpRequestMessage())
                {
                    request_.Method = new System.Net.Http.HttpMethod("DELETE");

                    PrepareRequest(client_, request_, urlBuilder_);
                    var url_ = urlBuilder_.ToString();
                    request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute);
                    PrepareRequest(client_, request_, url_);

                    var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false);
                    try
                    {
                        var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value);
                        foreach (var item_ in response_.Content.Headers)
                            headers_[item_.Key] = item_.Value;

                        ProcessResponse(client_, response_);

                        var status_ = ((int)response_.StatusCode).ToString();
                        if (status_ == "204")
                        {
                            return;
                        }
                        else
                        if (status_ != "200" && status_ != "204")
                        {
                            var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false);
                            throw new SwaggerException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", status_, responseData_, headers_, null);
                        }
                    }
                    finally
                    {
                        if (response_ != null)
                            response_.Dispose();
                    }
                }
            }
            finally
            {
                if (client_ != null)
                    client_.Dispose();
            }
        }

        /// <returns>Success operation</returns>
        /// <exception cref="SwaggerException">A server side error occurred.</exception>
        public System.Collections.Generic.List<FormModel> _api_GetTable_get()
        {
            return System.Threading.Tasks.Task.Run(async () => await _api_GetTable_getAsync(System.Threading.CancellationToken.None)).GetAwaiter().GetResult();
        }

        /// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param>
        /// <returns>Success operation</returns>
        /// <exception cref="SwaggerException">A server side error occurred.</exception>
        public async System.Threading.Tasks.Task<System.Collections.Generic.List<FormModel>> _api_GetTable_getAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
        {
            var urlBuilder_ = new System.Text.StringBuilder();
            urlBuilder_.Append(BaseUrl).Append("/api/GetTable");

            var client_ = new System.Net.Http.HttpClient();
            try
            {
                using (var request_ = new System.Net.Http.HttpRequestMessage())
                {
                    request_.Method = new System.Net.Http.HttpMethod("GET");
                    request_.Headers.Accept.Add(new System.Net.Http.Headers.MediaTypeWithQualityHeaderValue("application/json"));

                    PrepareRequest(client_, request_, urlBuilder_);
                    var url_ = urlBuilder_.ToString();
                    request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute);
                    PrepareRequest(client_, request_, url_);

                    var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false);
                    try
                    {
                        var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value);
                        foreach (var item_ in response_.Content.Headers)
                            headers_[item_.Key] = item_.Value;

                        ProcessResponse(client_, response_);

                        var status_ = ((int)response_.StatusCode).ToString();
                        if (status_ == "200")
                        {
                            var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false);
                            var result_ = default(System.Collections.Generic.List<FormModel>);
                            try
                            {
                                result_ = Newtonsoft.Json.JsonConvert.DeserializeObject<System.Collections.Generic.List<FormModel>>(responseData_, _settings.Value);
                                return result_;
                            }
                            catch (System.Exception exception)
                            {
                                throw new SwaggerException("Could not deserialize the response body.", status_, responseData_, headers_, exception);
                            }
                        }
                        else
                        if (status_ != "200" && status_ != "204")
                        {
                            var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false);
                            throw new SwaggerException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", status_, responseData_, headers_, null);
                        }

                        return default(System.Collections.Generic.List<FormModel>);
                    }
                    finally
                    {
                        if (response_ != null)
                            response_.Dispose();
                    }
                }
            }
            finally
            {
                if (client_ != null)
                    client_.Dispose();
            }
        }

        /// <returns>Success operation</returns>
        /// <exception cref="SwaggerException">A server side error occurred.</exception>
        public DataModel _api_HttpGet_get()
        {
            return System.Threading.Tasks.Task.Run(async () => await _api_HttpGet_getAsync(System.Threading.CancellationToken.None)).GetAwaiter().GetResult();
        }

        /// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param>
        /// <returns>Success operation</returns>
        /// <exception cref="SwaggerException">A server side error occurred.</exception>
        public async System.Threading.Tasks.Task<DataModel> _api_HttpGet_getAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
        {
            var urlBuilder_ = new System.Text.StringBuilder();
            urlBuilder_.Append(BaseUrl).Append("/api/HttpGet");

            var client_ = new System.Net.Http.HttpClient();
            try
            {
                using (var request_ = new System.Net.Http.HttpRequestMessage())
                {
                    request_.Method = new System.Net.Http.HttpMethod("GET");
                    request_.Headers.Accept.Add(new System.Net.Http.Headers.MediaTypeWithQualityHeaderValue("application/json"));

                    PrepareRequest(client_, request_, urlBuilder_);
                    var url_ = urlBuilder_.ToString();
                    request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute);
                    PrepareRequest(client_, request_, url_);

                    var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false);
                    try
                    {
                        var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value);
                        foreach (var item_ in response_.Content.Headers)
                            headers_[item_.Key] = item_.Value;

                        ProcessResponse(client_, response_);

                        var status_ = ((int)response_.StatusCode).ToString();
                        if (status_ == "200")
                        {
                            var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false);
                            var result_ = default(DataModel);
                            try
                            {
                                result_ = Newtonsoft.Json.JsonConvert.DeserializeObject<DataModel>(responseData_, _settings.Value);
                                return result_;
                            }
                            catch (System.Exception exception)
                            {
                                throw new SwaggerException("Could not deserialize the response body.", status_, responseData_, headers_, exception);
                            }
                        }
                        else
                        if (status_ != "200" && status_ != "204")
                        {
                            var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false);
                            throw new SwaggerException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", status_, responseData_, headers_, null);
                        }

                        return default(DataModel);
                    }
                    finally
                    {
                        if (response_ != null)
                            response_.Dispose();
                    }
                }
            }
            finally
            {
                if (client_ != null)
                    client_.Dispose();
            }
        }

        /// <returns>Success operation</returns>
        /// <exception cref="SwaggerException">A server side error occurred.</exception>
        public Country _api_HttpGetCountry_get()
        {
            return System.Threading.Tasks.Task.Run(async () => await _api_HttpGetCountry_getAsync(System.Threading.CancellationToken.None)).GetAwaiter().GetResult();
        }

        /// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param>
        /// <returns>Success operation</returns>
        /// <exception cref="SwaggerException">A server side error occurred.</exception>
        public async System.Threading.Tasks.Task<Country> _api_HttpGetCountry_getAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
        {
            var urlBuilder_ = new System.Text.StringBuilder();
            urlBuilder_.Append(BaseUrl).Append("/api/HttpGetCountry");

            var client_ = new System.Net.Http.HttpClient();
            try
            {
                using (var request_ = new System.Net.Http.HttpRequestMessage())
                {
                    request_.Method = new System.Net.Http.HttpMethod("GET");
                    request_.Headers.Accept.Add(new System.Net.Http.Headers.MediaTypeWithQualityHeaderValue("application/json"));

                    PrepareRequest(client_, request_, urlBuilder_);
                    var url_ = urlBuilder_.ToString();
                    request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute);
                    PrepareRequest(client_, request_, url_);

                    var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false);
                    try
                    {
                        var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value);
                        foreach (var item_ in response_.Content.Headers)
                            headers_[item_.Key] = item_.Value;

                        ProcessResponse(client_, response_);

                        var status_ = ((int)response_.StatusCode).ToString();
                        if (status_ == "200")
                        {
                            var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false);
                            var result_ = default(Country);
                            try
                            {
                                result_ = Newtonsoft.Json.JsonConvert.DeserializeObject<Country>(responseData_, _settings.Value);
                                return result_;
                            }
                            catch (System.Exception exception)
                            {
                                throw new SwaggerException("Could not deserialize the response body.", status_, responseData_, headers_, exception);
                            }
                        }
                        else
                        if (status_ != "200" && status_ != "204")
                        {
                            var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false);
                            throw new SwaggerException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", status_, responseData_, headers_, null);
                        }

                        return default(Country);
                    }
                    finally
                    {
                        if (response_ != null)
                            response_.Dispose();
                    }
                }
            }
            finally
            {
                if (client_ != null)
                    client_.Dispose();
            }
        }

        /// <returns>Success operation</returns>
        /// <exception cref="SwaggerException">A server side error occurred.</exception>
        public DataModel _api_HttpPost_post(DataModel data)
        {
            return System.Threading.Tasks.Task.Run(async () => await _api_HttpPost_postAsync(data, System.Threading.CancellationToken.None)).GetAwaiter().GetResult();
        }

        /// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param>
        /// <returns>Success operation</returns>
        /// <exception cref="SwaggerException">A server side error occurred.</exception>
        public async System.Threading.Tasks.Task<DataModel> _api_HttpPost_postAsync(DataModel data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
        {
            var urlBuilder_ = new System.Text.StringBuilder();
            urlBuilder_.Append(BaseUrl).Append("/api/HttpPost");

            var client_ = new System.Net.Http.HttpClient();
            try
            {
                using (var request_ = new System.Net.Http.HttpRequestMessage())
                {
                    var content_ = new System.Net.Http.StringContent(Newtonsoft.Json.JsonConvert.SerializeObject(data, _settings.Value));
                    content_.Headers.ContentType.MediaType = "application/json";
                    request_.Content = content_;
                    request_.Method = new System.Net.Http.HttpMethod("POST");
                    request_.Headers.Accept.Add(new System.Net.Http.Headers.MediaTypeWithQualityHeaderValue("application/json"));

                    PrepareRequest(client_, request_, urlBuilder_);
                    var url_ = urlBuilder_.ToString();
                    request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute);
                    PrepareRequest(client_, request_, url_);

                    var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false);
                    try
                    {
                        var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value);
                        foreach (var item_ in response_.Content.Headers)
                            headers_[item_.Key] = item_.Value;

                        ProcessResponse(client_, response_);

                        var status_ = ((int)response_.StatusCode).ToString();
                        if (status_ == "200")
                        {
                            var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false);
                            var result_ = default(DataModel);
                            try
                            {
                                result_ = Newtonsoft.Json.JsonConvert.DeserializeObject<DataModel>(responseData_, _settings.Value);
                                return result_;
                            }
                            catch (System.Exception exception)
                            {
                                throw new SwaggerException("Could not deserialize the response body.", status_, responseData_, headers_, exception);
                            }
                        }
                        else
                        if (status_ != "200" && status_ != "204")
                        {
                            var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false);
                            throw new SwaggerException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", status_, responseData_, headers_, null);
                        }

                        return default(DataModel);
                    }
                    finally
                    {
                        if (response_ != null)
                            response_.Dispose();
                    }
                }
            }
            finally
            {
                if (client_ != null)
                    client_.Dispose();
            }
        }

        /// <returns>Success operation</returns>
        /// <exception cref="SwaggerException">A server side error occurred.</exception>
        public void _api_UpdateTableEntity_post(FormModel data)
        {
            System.Threading.Tasks.Task.Run(async () => await _api_UpdateTableEntity_postAsync(data, System.Threading.CancellationToken.None)).GetAwaiter().GetResult();
        }

        /// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param>
        /// <returns>Success operation</returns>
        /// <exception cref="SwaggerException">A server side error occurred.</exception>
        public async System.Threading.Tasks.Task _api_UpdateTableEntity_postAsync(FormModel data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
        {
            var urlBuilder_ = new System.Text.StringBuilder();
            urlBuilder_.Append(BaseUrl).Append("/api/UpdateTableEntity");

            var client_ = new System.Net.Http.HttpClient();
            try
            {
                using (var request_ = new System.Net.Http.HttpRequestMessage())
                {
                    var content_ = new System.Net.Http.StringContent(Newtonsoft.Json.JsonConvert.SerializeObject(data, _settings.Value));
                    content_.Headers.ContentType.MediaType = "application/json";
                    request_.Content = content_;
                    request_.Method = new System.Net.Http.HttpMethod("POST");

                    PrepareRequest(client_, request_, urlBuilder_);
                    var url_ = urlBuilder_.ToString();
                    request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute);
                    PrepareRequest(client_, request_, url_);

                    var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false);
                    try
                    {
                        var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value);
                        foreach (var item_ in response_.Content.Headers)
                            headers_[item_.Key] = item_.Value;

                        ProcessResponse(client_, response_);

                        var status_ = ((int)response_.StatusCode).ToString();
                        if (status_ == "200")
                        {
                            return;
                        }
                        else
                        if (status_ != "200" && status_ != "204")
                        {
                            var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false);
                            throw new SwaggerException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", status_, responseData_, headers_, null);
                        }
                    }
                    finally
                    {
                        if (response_ != null)
                            response_.Dispose();
                    }
                }
            }
            finally
            {
                if (client_ != null)
                    client_.Dispose();
            }
        }

    }

    [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "9.4.2.0")]
    public partial class CreateFormModel
    {
        [Newtonsoft.Json.JsonProperty("Text", Required = Newtonsoft.Json.Required.Always)]
        [System.ComponentModel.DataAnnotations.Required]
        public string Text { get; set; }

        [Newtonsoft.Json.JsonProperty("Number", Required = Newtonsoft.Json.Required.Always)]
        public int Number { get; set; }

        [Newtonsoft.Json.JsonProperty("Date", Required = Newtonsoft.Json.Required.Always)]
        [System.ComponentModel.DataAnnotations.Required]
        public System.DateTime Date { get; set; }

        [Newtonsoft.Json.JsonProperty("ToDelete", Required = Newtonsoft.Json.Required.Always)]
        public bool ToDelete { get; set; }

        public string ToJson()
        {
            return Newtonsoft.Json.JsonConvert.SerializeObject(this);
        }

        public static CreateFormModel FromJson(string data)
        {
            return Newtonsoft.Json.JsonConvert.DeserializeObject<CreateFormModel>(data);
        }
    }

    [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "9.4.2.0")]
    public partial class FormModel
    {
        [Newtonsoft.Json.JsonProperty("PartitionsKey", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
        public string PartitionsKey { get; set; }

        [Newtonsoft.Json.JsonProperty("RowKey", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
        public string RowKey { get; set; }

        [Newtonsoft.Json.JsonProperty("Timestamp", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
        public System.DateTime? Timestamp { get; set; }

        [Newtonsoft.Json.JsonProperty("Text", Required = Newtonsoft.Json.Required.Always)]
        [System.ComponentModel.DataAnnotations.Required]
        public string Text { get; set; }

        [Newtonsoft.Json.JsonProperty("Number", Required = Newtonsoft.Json.Required.Always)]
        public int Number { get; set; }

        [Newtonsoft.Json.JsonProperty("Date", Required = Newtonsoft.Json.Required.Always)]
        [System.ComponentModel.DataAnnotations.Required]
        public System.DateTime Date { get; set; }

        [Newtonsoft.Json.JsonProperty("ToDelete", Required = Newtonsoft.Json.Required.Always)]
        public bool ToDelete { get; set; }

        public string ToJson()
        {
            return Newtonsoft.Json.JsonConvert.SerializeObject(this);
        }

        public static FormModel FromJson(string data)
        {
            return Newtonsoft.Json.JsonConvert.DeserializeObject<FormModel>(data);
        }
    }

    [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "9.4.2.0")]
    public partial class DataModel
    {
        [Newtonsoft.Json.JsonProperty("Text", Required = Newtonsoft.Json.Required.Always)]
        [System.ComponentModel.DataAnnotations.Required]
        public string Text { get; set; }

        [Newtonsoft.Json.JsonProperty("Number", Required = Newtonsoft.Json.Required.Always)]
        public int Number { get; set; }

        [Newtonsoft.Json.JsonProperty("Date", Required = Newtonsoft.Json.Required.Always)]
        [System.ComponentModel.DataAnnotations.Required]
        public System.DateTime Date { get; set; }

        [Newtonsoft.Json.JsonProperty("Bool", Required = Newtonsoft.Json.Required.Always)]
        public bool Bool { get; set; }

        public string ToJson()
        {
            return Newtonsoft.Json.JsonConvert.SerializeObject(this);
        }

        public static DataModel FromJson(string data)
        {
            return Newtonsoft.Json.JsonConvert.DeserializeObject<DataModel>(data);
        }
    }

    [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "9.4.2.0")]
    public partial class Country
    {
        [Newtonsoft.Json.JsonProperty("Name", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
        public string Name { get; set; }

        [Newtonsoft.Json.JsonProperty("Regions", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
        public System.Collections.Generic.List<Region> Regions { get; set; }

        public string ToJson()
        {
            return Newtonsoft.Json.JsonConvert.SerializeObject(this);
        }

        public static Country FromJson(string data)
        {
            return Newtonsoft.Json.JsonConvert.DeserializeObject<Country>(data);
        }
    }

    [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "9.4.2.0")]
    public partial class Region
    {
        [Newtonsoft.Json.JsonProperty("Id", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
        public int? Id { get; set; }

        [Newtonsoft.Json.JsonProperty("Name", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
        public string Name { get; set; }

        public string ToJson()
        {
            return Newtonsoft.Json.JsonConvert.SerializeObject(this);
        }

        public static Region FromJson(string data)
        {
            return Newtonsoft.Json.JsonConvert.DeserializeObject<Region>(data);
        }
    }

    [System.CodeDom.Compiler.GeneratedCode("NSwag", "11.3.3.0")]
    public class SwaggerException : System.Exception
    {
        public string StatusCode { get; private set; }

        public string Response { get; private set; }

        public System.Collections.Generic.Dictionary<string, System.Collections.Generic.IEnumerable<string>> Headers { get; private set; }

        public SwaggerException(string message, string statusCode, string response, System.Collections.Generic.Dictionary<string, System.Collections.Generic.IEnumerable<string>> headers, System.Exception innerException)
            : base(message, innerException)
        {
            StatusCode = statusCode;
            Response = response;
            Headers = headers;
        }

        public override string ToString()
        {
            return string.Format("HTTP Response: \n\n{0}\n\n{1}", Response, base.ToString());
        }
    }

    [System.CodeDom.Compiler.GeneratedCode("NSwag", "11.3.3.0")]
    public class SwaggerException<TResult> : SwaggerException
    {
        public TResult Result { get; private set; }

        public SwaggerException(string message, string statusCode, string response, System.Collections.Generic.Dictionary<string, System.Collections.Generic.IEnumerable<string>> headers, TResult result, System.Exception innerException)
            : base(message, statusCode, response, headers, innerException)
        {
            Result = result;
        }
    }

}


text:
module Hyrax
  # Provide select options for the license (dcterms:rights) field
  class LicenseService < QaSelectService
    def initialize(_authority_name = nil)
      super('licenses')
    end
  end
end

redpajama_set_name: RedPajamaGithub


text:
package be.fluid_it.mvn.cd.x.freeze.pom;

import be.fluid_it.mvn.cd.x.freeze.model.GroupIdArtifactIdVersion;
import be.fluid_it.mvn.cd.x.freeze.stamp.Stamp;
import be.fluid_it.mvn.cd.x.freeze.stamp.Stamper;

import java.io.ByteArrayInputStream;
import java.io.InputStream;
import java.util.Properties;

public class SamplePom_ArtifactInheritsVersion extends SamplePomSupport {
    public static InputStream asStream() {
        String pom = "<project xmlns=\"http://maven.apache.org/POM/4.0.0\"\n" +
                "  xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n" +
                "  xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd\">\n" +
                "  <modelVersion>4.0.0</modelVersion>\n" +
                "  <parent>\n" +
                "    <groupId>" + GROUP_ID + "</groupId>\n" +
                "    <artifactId>" + PARENT_ARTIFACT_ID + "</artifactId>\n" +
                "    <version>" + VERSION + "</version>\n" +
                "    <relativePath>../" + PARENT_ARTIFACT_ID + "/pom.xml</relativePath>\n" +
                "  </parent>\n" +
                "  <artifactId>" + ARTIFACT_ID + "</artifactId>\n" +
                "  <packaging>jar</packaging>\n" +
                "  <dependencies>\n" +
                "    <dependency>\n" +
                "      <groupId>" + LIBRARY_GROUP_ID + "</groupId>\n" +
                "      <artifactId>" + LIBRARY_ARTIFACT_ID + "</artifactId>\n" +
                "      <version>" + LIBRARY_VERSION + "</version>\n" +
                "    </dependency>\n" +
                "  </dependencies>\n" +
                "</project>";
        return new ByteArrayInputStream(pom.getBytes());
    }
}


text:
<!DOCTYPE html>

        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
        <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1.0"/>
        <meta http-equiv="content-language" content="pt-br">
        <meta name="robots" content="index, follow">
        <meta name="description" content="{{ META_DESCRIPTION }}"/>
        <meta name="keywords" content="{{ META_KEYWORDS|join(', ') }}"/>
        <meta name="author" content="{{ AUTHOR }}">
        <meta name="generator" content="Feito com Materialize, Pelican,
        Python e VIM. ">
        <meta name="theme-color" content="{{ MALT_BASE_COLOR }}"/>
        <title>{% block title %}{{ SITENAME }}{% endblock %}</title>

        {% if FEED_ALL_ATOM %}
            <link href="{{ SITEURL }}/{{ FEED_ALL_ATOM }}" type="application/atom+xml" rel="alternate" title="{{ SITENAME }} ATOM Feed"/>
        {% endif %}
        {% if FEED_ALL_RSS %}
            <link href="{{ SITEURL }}/{{ FEED_ALL_RSS }}" type="application/rss+xml" rel="alternate" title="{{ SITENAME }} RSS Feed"/>
        {% endif %}

        {% block styles %}
        <link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
        <link rel="stylesheet" href="{{ SITEURL }}/theme/css/font-awesome.min.css">
        <link href="{{ SITEURL }}/theme/css/materialize.min.css" type="text/css" rel="stylesheet" media="screen,projection"/>
        <link href="{{ SITEURL }}/theme/css/style.css" type="text/css" rel="stylesheet" media="screen,projection"/>
        <link href="{{ SITEURL }}/theme/css/animate.css" type="text/css" rel="stylesheet" media="screen,projection"/>
        <link href="{{ SITEURL }}/theme/css/pygments/{{ PYGMENTS_STYLE }}.css" type="text/css" rel="stylesheet" media="screen,projection"/>
        {% endblock %}

        {# TODO: Implement this #}
        {% block seo %}
        <meta property="og:type" content="website"/>
        {% endblock %}
        {% include 'google_tools.html' %}
        {% if GOOGLE_SITE_VERIFICATION %}
        <meta name="google-site-verification" content="{{ GOOGLE_SITE_VERIFICATION }}"/>
        {% endif %}

            {% block navbar %}
            {% include "includes/navbar-blog.html" %}
            {% endblock %}

            {% block banner %}

{#                        {% block bannerimage %}#}
{#                        #}
{#                        {% endblock %}#}
                        {% block bannertext %}

{{ WELCOME_TITLE }}

{{ WELCOME_TEXT }}

                        {% endblock %}

            {% endblock %}

            {% block content %}
            {% endblock %}

            {% block footer %}
            {% include "includes/footer.html" %}
            {% endblock %}

            {% block scripts %}

            {% endblock %}


text:
This user manual is made to correspond to Docker's [API docs][1] (e.g. [API 1.18][2]).

* [Creating a DockerClient](#creating-a-docker-client)
  * [Unix socket support](#unix-socket-support)
  * [HTTPS support](#https-support)
  * [Connection pooling](#connection-pooling)
* [Authentication to private registries](#authentication-to-private-registries)
* [Containers](#containers)
  * [List containers](#list-containers)
  * [Create a container](#create-a-container)
  * [Inspect a container](#inspect-a-container)
  * [List processes running inside a container](#list-processes-running-inside-a-container)
  * [Get container logs](#get-container-logs)
  * [Inspect changes on a container's filesystem](#inspect-changes-on-a-containers-filesystem)
  * [Export a container](#export-a-container)
  * [Get container stats based on resource usage](#get-container-stats-based-on-resource-usage)
  * [Resize a container TTY](#resize-a-container-tty)
  * [Start a container](#start-a-container)
  * [Stop a container](#stop-a-container)
  * [Restart a container](#restart-a-container)
  * [Kill a container](#kill-a-container)
  * [Rename a container](#rename-a-container)
  * [Pause a container](#pause-a-container)
  * [Unpause a container](#unpause-a-container)
  * [Attach to a container](#attach-to-a-container)
  * [Attach to a container (websocket)](#attach-to-a-container-websocket)
  * [Wait a container](#wait-a-container)
  * [Remove a container](#remove-a-container)
  * [Copy files or folders from a container](#copy-files-or-folders-from-a-container)
* [Secrets](#secrets)
  * [Create Secret](#create-secret)
* [Images](#images)
  * [List Images](#list-images)
  * [Build image from a Dockerfile](#build-image-from-a-dockerfile)
  * [Create an image](#create-an-image)
  * [Inspect an image](#inspect-an-image)
  * [Get the history of an image](#get-the-history-of-an-image)
  * [Push an image on the registry](#push-an-image-on-the-registry)
  * [Tag an image into a repository](#tag-an-image-into-a-repository)
  * [Remove an image](#remove-an-image)
  * [Search images](#search-images)
* [Miscellaneous](#miscellaneous)
  * [Check auth configuration](#check-auth-configuration)
  * [Display system-wide information](#display-system-wide-information)
  * [Show the docker version information](#show-the-docker-version-information)
  * [Ping the docker server](#ping-the-docker-server)
  * [Create a new image from a container's changes](#create-a-new-image-from-a-containers-changes)
  * [Monitor Docker's events](#monitor-dockers-events)
  * [Get a tarball containing all images in a repository](#get-a-tarball-containing-all-images-in-a-repository)
  * [Get a tarball containing all images.](#get-a-tarball-containing-all-images)
  * [Load a tarball with a set of images and tags into docker](#load-a-tarball-with-a-set-of-images-and-tags-into-docker)
  * [Image tarball format](#image-tarball-format)
  * [Exec Create](#exec-create)
  * [Exec Start](#exec-start)
  * [Exec Resize](#exec-resize)
  * [Exec Inspect](#exec-inspect)
  * [Mounting volumes in a container](#mounting-volumes-in-a-container)
* [Troubleshooting](#troubleshooting)

## Creating a docker-client

```java
// Create a client based on DOCKER_HOST and DOCKER_CERT_PATH env vars
final DockerClient docker = DefaultDockerClient.fromEnv().build();

// or use the builder
final DockerClient docker = DefaultDockerClient.builder()
  // Set various options
  .build();
```

Both `DefaultDockerClient.builder()` and `DefaultDockerClient.fromEnv()` return a
`DefaultDockerClient.Builder`. The builder can be used to configure and build clients with custom
timeouts, connection pool sizes, and other parameters.

### Unix socket support

Unix socket support is available on Linux since v2.5.0:

```java
final DockerClient docker = new DefaultDockerClient("unix:///var/run/docker.sock");
```

### HTTPS support

We can connect to [HTTPS-secured Docker instances](https://docs.docker.com/articles/https/)
with client-server authentication. The semantics are similar to using [the `DOCKER_CERT_PATH`
environment variable](https://docs.docker.com/articles/https/#client-modes):

```java
final DockerClient docker = DefaultDockerClient.builder()
    .uri(URI.create("https://boot2docker:2376"))
    .dockerCertificates(new DockerCertificates(Paths.get("/Users/rohan/.docker/boot2docker-vm/")))
    .build();
```

### Connection pooling

We use the [Apache HTTP client](https://hc.apache.org/) under the covers, with a shared connection
pool per instance of the Docker client. The default size of this pool is 100 connections, so each
instance of the Docker client can only have 100 concurrent requests in flight.

If you plan on waiting on more than 100 containers at a time (`DockerClient.waitContainer`), or
otherwise need a higher number of concurrent requests, you can modify the connection pool size:

```java
final DockerClient docker = DefaultDockerClient.fromEnv()
    .connectionPoolSize(SOME_LARGE_NUMBER)
    .build()
```

Note that the connect timeout is also applied to acquiring a connection from the pool. If the pool
is exhausted and it takes too long to acquire a new connection for a request, we throw a
`DockerTimeoutException` instead of just waiting forever on a connection becoming available.

## Authentication to private registries

Authentication info when building, pushing, or pulling images, or when using
Swarm, is provided by a `RegistryAuthSupplier` class.

Docker-client is packaged with a few implementations of this interface

- `auth.ConfigFileRegistryAuthSupplier`, which reads authentication info from
  the the config files used by docker-cli (`~/.dockercfg` or
  `~/.docker/config.json`)
- `auth.FixedRegistryAuthSupplier` which uses a fixed instance of the
  `RegistryAuth` and `RegistryConfigs` POJOs
- `auth.gcr.ContainerRegistryAuthSupplier`, which programmatically fetches
  access tokens for use with Google Container Registry based on given Google
  Cloud account credentials
- `auth.MultiRegistryAuthSupplier`, which can be used to combine multiple other
  implementations

Users are encouraged to implement the `RegistryAuthSupplier` interface
themselves to support custom authentication logic, and we would be happy to
review and accept pull requests to add support in the library for additional
schemes.

Since version 8.7.0, docker-client will automatically enable the
`ConfigFileRegistryAuthSupplier` class in `DefaultDockerClient` as long as none
of the other authentication-related methods in the
`DefaultDockerClient.Builder` class (`dockerAuth(boolean)`,
`registryAuth(RegistryAuth)`, or `registryAuthSupplier(RegistryAuthSupplier)`)
are used.

## Containers

### List containers

```java
final List<Container> containers = docker.listContainers();

// List all containers. Only running containers are shown by default.
final List<Container> containers = docker.listContainers(ListContainersParam.allContainers());
```

### Create a container

```java
final ContainerCreation container = docker.createContainer(ContainerConfig.builder().build());
```

### Inspect a container

```java
final ContainerInfo info = docker.inspectContainer("containerID");
```

### List processes running inside a container

```java
final TopResults topResults = docker.topContainer("containerID", "ps_args");
```

### Get container logs

```java
final String logs;
try (LogStream stream = client.logs("containerID", LogsParam.stdout(), LogsParam.stderr())) {
  logs = stream.readFully();
}
```

### Inspect changes on a container's filesystem

```java
final List<ContainerChange> changes = docker.inspectContainerChanges("containerId");
```

### Export a container

```java
ImmutableSet.Builder<String> files = ImmutableSet.builder();
try (TarArchiveInputStream tarStream = new TarArchiveInputStream(docker.exportContainer(id))) {
  TarArchiveEntry entry;
  while ((entry = tarStream.getNextTarEntry()) != null) {
    files.add(entry.getName());
  }
}
```

### Get container stats based on resource usage

```java
final ContainerStats stats = docker.stats("containerID");
```

### Resize a container TTY

```java
final int height = 10;
final int width = 10;
docker.resizeTty("containerID", height, width);
```

### Start a container

```java
docker.startContainer("containerID");
```

### Stop a container

```java
docker.stopContainer("containerID", 10); // kill after 10 seconds
```

### Restart a container

```java
docker.restartContainer("containerID");
// or with a seconds to wait before restarting parameter
docker.restartContainer("containerID", 10);
```

### Kill a container

```java
docker.killContainer("containerID");
```

### Rename a container

```java
docker.renameContainer("oldContainerID", "newContainerID");
```

### Pause a container

```java
docker.pauseContainer("containerID");
```

### Unpause a container

```java
docker.unpauseContainer("containerID");
```

### Attach to a container

```java
final String logs;
try (LogStream stream = docker.attachContainer(volumeContainer,
      AttachParameter.LOGS, AttachParameter.STDOUT,
      AttachParameter.STDERR, AttachParameter.STREAM)) {
  logs = stream.readFully();
}
```

### Attach to a container (websocket)

Not implemented. PRs welcome.

### Wait a container

```java
final ContainerExit exit = docker.waitContainer("containerID");
```

### Remove a container

```java
docker.removeContainer("containerID");
```

### Copy files or folders from a container

_NOTE: deprecated in favor of [archive](#get-an-archive-of-a-filesystem-resource-in-a-container)_

```java
ImmutableSet.Builder<String> files = ImmutableSet.builder();
try (TarArchiveInputStream tarStream =
    new TarArchiveInputStream(docker.copyContainer(id, "/bin"))) {
  TarArchiveEntry entry;
  while ((entry = tarStream.getNextTarEntry()) != null) {
    files.add(entry.getName());
  }
}
```

### Retrieving information about files and folders in a container

Not implemented. PRs welcome.

### Get an archive of a filesystem resource in a container

```java
try (final TarArchiveInputStream tarStream = new TarArchiveInputStream(docker.archiveContainer("containerID", "/file/path"))) {
  TarArchiveEntry entry;
  while ((entry = tarStream.getNextTarEntry()) != null) {
    // Do stuff with the files in the stream
  }
}
```

### Extract an archive of files or folders to a directory in a container

```java
docker.copyToContainer(new java.io.File("/local/path").toPath(), "containerID", "/path/in/container");
```

## Networks

### Inspect a network

```java
docker.inspectNetwork("networkID");
```

### Create a network

```java
NetworkConfig networkConfig = NetworkConfig.builder()
                                           .checkDuplicate(true)
                                           .attachable(true)
                                           .name("newNetwork")
                                           .build();
docker.createNetwork(networkConfig);
```

### Remove a network

```java
docker.removeNetwork("networkID");
```

### Attach a container to an existing network

This should be called before starting a container, but may fail silently if duplicate networks exist.

```java
docker.connectToNetwork("containerID", "networkID");
```

### Detach a container from a network

```java
docker.disconnectFromNetwork("containerID", "networkID");
```

## Secrets

### Create secret

```java
final SecretSpec secret = SecretSpec.builder().name("asecret").data(base64encodeddata).build();
docker.createSecret(secret);
```

## Images

### List images

```java
final List<Image> quxImages = docker.listImages(ListImagesParam.withLabel("foo", "qux"));
```

### Build image from a Dockerfile

```java
final AtomicReference<String> imageIdFromMessage = new AtomicReference<>();

final String returnedImageId = docker.build(
    Paths.get(dockerDirectory), "test", new ProgressHandler() {
      @Override
      public void progress(ProgressMessage message) throws DockerException {
        final String imageId = message.buildImageId();
        if (imageId != null) {
          imageIdFromMessage.set(imageId);
        }
      }
    });
```

### Create an image

```java
// By pulling
final RegistryAuth registryAuth = RegistryAuth.builder()
  .email(AUTH_EMAIL)
  .username(AUTH_USERNAME)
  .password(AUTH_PASSWORD)
  .build();
docker.pull("dxia2/scratch-private:latest", registryAuth);

// or by loading from a source
final File imageFile = new File("/path/to/image/file");
final String image = "busybox-test" + System.nanoTime();
try (InputStream imagePayload = new BufferedInputStream(new FileInputStream(imageFile))) {
  docker.create(image, imagePayload);
}
```

### Inspect an image

```java
final ImageInfo info = docker.inspectImage("imageID")
```

### Get the history of an image

```java
final List<ImageHistory> imageHistoryList = docker.history("imageID");
```

### Push an image on the registry

```java
docker.push("imageID");
```

### Tag an image into a repository

```java
docker.pull("busybox:latest");

final String name = "testRepo/tagForce:sometag";
// Assign name to first image
docker.tag("busybox:latest", name);

// Force-re-assign tag to another image
docker.tag("busybox:buildroot-2014.02", name, true);
```

### Remove an image

```java
docker.removeImage("imageID");
```

### Search images

```java
final List<ImageSearchResult> searchResult = docker.searchImages("busybox");
```

## Miscellaneous

### Check auth configuration

```java
final RegistryAuth registryAuth = RegistryAuth.builder()
  .email(AUTH_EMAIL)
  .username(AUTH_USERNAME)
  .password(AUTH_PASSWORD)
  .build();
final int statusCode = docker.auth(registryAuth);
assertThat(statusCode, equalTo(200));
```

### Display system-wide information

```java
final Info info = docker.info();
```

### Show the docker version information

```java
final Version version = docker.version();
```

### Ping the docker server

```java
final String pingResponse = docker.ping();
assertThat(pingResponse, equalTo("OK"));
```

### Create a new image from a container's changes

```java
// Pull image
docker.pull("busybox:latest");

// Create container
final ContainerConfig config = ContainerConfig.builder()
    .image("busybox:latest")
    .build();
final String name = randomName();
final ContainerCreation creation = docker.createContainer(config, name);
final String id = creation.id();

final String tag = "foobar";
final ContainerCreation newContainer = docker.commitContainer(
    id, "mosheeshel/busybox", tag, config, "CommitedByTest-" + tag, "newContainer");

final ImageInfo imageInfo = docker.inspectImage(newContainer.id());
assertThat(imageInfo.author(), is("newContainer"));
assertThat(imageInfo.comment(), is("CommitedByTest-" + "foobar"));
```

### Monitor Docker's events

```java
docker.pull("busybox:latest");
final EventStream eventStream = docker.events();
final ContainerConfig config = ContainerConfig.builder()
    .image("busybox:latest")
    .build();
final ContainerCreation container = docker.createContainer(config, randomName());
docker.startContainer(container.id());

final Event createEvent = eventStream.next();
assertThat(createEvent.status(), equalTo("create"));
assertThat(createEvent.id(), equalTo(container.id()));
assertThat(createEvent.from(), startsWith("busybox:"));
assertThat(createEvent.time(), notNullValue());

final Event startEvent = eventStream.next();
assertThat(startEvent.status(), equalTo("start"));
assertThat(startEvent.id(), equalTo(container.id()));
assertThat(startEvent.from(), startsWith("busybox:"));
assertThat(startEvent.time(), notNullValue());

eventStream.close();
```

### Get a tarball containing all images in a repository

```java
final File imageFile = save(BUSYBOX);
assertTrue(imageFile.length() > 0);

final File tmpDir = new File(System.getProperty("java.io.tmpdir"));
assertTrue("Temp directory " + tmpDir.getAbsolutePath() + " does not exist", tmpDir.exists());
final File imageFile = new File(tmpDir, "busybox-" + System.nanoTime() + ".tar");

imageFile.createNewFile();
imageFile.deleteOnExit();
final byte[] buffer = new byte[2048];
int read;

try (OutputStream imageOutput = new BufferedOutputStream(new FileOutputStream(imageFile))) {
  try (InputStream imageInput = docker.save("busybox")) {
    while ((read = imageInput.read(buffer)) > -1) {
      imageOutput.write(buffer, 0, read);
    }
  }
}
```

### Get a tarball containing all images.

```java
try (InputStream imageInput = docker.saveMultiple("image0", "image1")) {
    while ((read = imageInput.read(buffer)) > -1) {
      // Do stuff with the tar stream of images
    }
}
```

### Load a tarball with a set of images and tags into docker

```java
final File tarFileWithMultipleImages = new File("/path/to/tarball");
try (InputStream imagePayload = new BufferedInputStream(new FileInputStream(tarFileWithMultipleImages))) {
  docker.load(InputStream imagePayload);
}
```

### Exec Create

```java
final String execId = docker.execCreate(containerId, new String[]{"sh", "-c", "exit 2"}).id();

try (final LogStream stream = docker.execStart(execId)) {
  stream.readFully();
}

final ExecState state = docker.execInspect(execId);
assertThat(state.id(), is(execId));
assertThat(state.running(), is(false));
assertThat(state.exitCode(), is(2));
assertThat(state.openStdin(), is(true));
assertThat(state.openStderr(), is(true));
assertThat(state.openStdout(), is(true));
}
```

### Exec Start

See [example above](#exec-create).

### Exec Resize

```java
final int height = 10;
final int width = 10;
docker.execResizeTty("execID", height, width);
```

### Exec Inspect

See [example above](#exec-create).

## Volumes

### List volumes

```java
final VolumeList volumeList = docker.listVolumes();
final List<String> warnings = volumeList.warnings();
final List<Volume> volumes = volumeList.volumes();
```

### Create a volume
Create a volume with specified properties:
```java
final Volume toCreate = Volume.builder()
  .name("volumeName")
  .driver("local")
  .labels(ImmutableMap.of("foo", "bar"))
  .build();
final Volume created = docker.createVolume(toCreate);
```

Or create an anonymous volume:
```java
final Volume created = docker.createVolume();
```

### Inspect a volume

```java
final Volume volume = docker.inspectVolume("volumeName");
```

### Remove a volume
By name
```java
docker.removeVolume("volumeName");
```

Or by object reference
```java
docker.removeVolume(volume);
```

# Going Further
## Mounting directories in a container
To mount a host directory into a container, create the container with a `HostConfig`.
You can set the local path and remote path in the `binds()` method on the `HostConfig.Builder`.
There are two ways to make a bind:
1. Pass `binds()` a set of strings of the form `"local_path:container_path"` for read/write or `"local_path:container_path:ro"` for read only.
2. Create a `Bind` object and pass it to `binds()` (or `appendBinds()` if you want to incrementally add multiple `Bind`s).

When you create a `Bind`, you are making a connection from outside the container to inside; as such, you must give a `Bind` object a `from` and a `to`. `from` can be given either by a `String` containing the path to a local file or directory, or a pre-existing `Volume` object. `to` must be a `String` containing the path to be bound inside the container.

If you only need to create a volume to be mounted in a container, but you don't need it to be bound to any particular directory on the host, you can use the `ContainerConfig.Builder.volumes("/path")` method. The path you give to this method will be created inside the container, but does not correspond to anything outside.

```java
final HostConfig hostConfig =
  HostConfig.builder()
    .appendBinds("/local/path:/remote/path")
    .appendBinds(Bind.from("/another/local/path")
               .to("/another/remote/path")
               .readOnly(true)
               .build())
    .appendBinds(Bind.from(aVolume)
               .to("/yet/another/remote/path")
               .readOnly(false)
               .build())
    .build();
final ContainerConfig volumeConfig =
  ContainerConfig.builder()
    .image("busybox:latest")
    .volumes("/foo")   // This volume will not mount any host directory
    .hostConfig(hostConfig)
    .build();
```

### A note on mounts
Be aware that, starting with API version 1.20 (docker version 1.8.x), information
about a container's volumes is returned with the key `"Mounts"`, not `"Volumes"`.
As such, the `ContainerInfo.volumes()` method is deprecated. Instead, use
`ContainerInfo.mounts()`.

  [1]: https://docs.docker.com/engine/reference/api/docker_remote_api/
  [2]: https://docs.docker.com/engine/reference/api/docker_remote_api_v1.18/

# Troubleshooting

## HTTP 500 errors returned from the Docker Remote API

docker-client communicates with your local Docker daemon using the HTTP Remote
API and any unexpected errors that the daemon encounters will be reported as a
500 Internal Server Error, which bubbles up from docker-client as an exception
like:

> Caused by: com.spotify.docker.client.shaded.javax.ws.rs.InternalServerErrorException: HTTP 500 Internal Server Error

Check the Docker daemon log (typically at `/var/log/docker.log` or
`/var/log/upstart/docker.log`) for more details as to the root cause.


text:
<!DOCTYPE html>

  <meta charset="utf-8">
  <title>Plato - lib/appenders/file.js</title>

  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta name="description" content="">
  <meta name="author" content="">

  <link href="../../assets/css/vendor/morris.css" rel="stylesheet">
  <link href="../../assets/css/vendor/bootstrap.css" rel="stylesheet">
  <link href="../../assets/css/vendor/font-awesome.css" rel="stylesheet">
  <link href="../../assets/css/vendor/codemirror.css" rel="stylesheet">
  <link href="../../assets/css/plato.css" rel="stylesheet">
  <link href="../../assets/css/plato-file.css" rel="stylesheet">

    Plato on Github

        Report Home

lib/appenders/file.js

Maintainability

74.41

Lines of code

101

Difficulty

20.82

Estimated Errors

0.71

Function weight

By Complexity

By SLOC

    <textarea id="file-source" class="col-md-12">"use strict";
var layouts = require('../layouts')
, async = require('async')
, path = require('path')
, fs = require('fs')
, streams = require('../streams')
, os = require('os')
, eol = os.EOL || '\n'
, openFiles = []
, levels = require('../levels');

//close open files on process exit.
process.on('exit', function() {
  openFiles.forEach(function (file) {
    file.end();
  });
});

/**
 * File Appender writing the logs to a text file. Supports rolling of logs by size.
 *
 * @param file file log messages will be written to
 * @param layout a function that takes a logevent and returns a string
 *   (defaults to basicLayout).
 * @param logSize - the maximum size (in bytes) for a log file,
 *   if not provided then logs won't be rotated.
 * @param numBackups - the number of log files to keep after logSize
 *   has been reached (default 5)
 * @param compress - flag that controls log file compression
 * @param timezoneOffset - optional timezone offset in minutes (default system local)
 */
function fileAppender (file, layout, logSize, numBackups, compress, timezoneOffset) {
  var bytesWritten = 0;
  file = path.normalize(file);
  layout = layout || layouts.basicLayout;
  numBackups = numBackups === undefined ? 5 : numBackups;
  //there has to be at least one backup if logSize has been specified
  numBackups = numBackups === 0 ? 1 : numBackups;

  function openTheStream(file, fileSize, numFiles) {
    var stream;
    if (fileSize) {
      stream = new streams.RollingFileStream(
        file,
        fileSize,
        numFiles,
        { "compress": compress }
      );
    } else {
      stream = fs.createWriteStream(
        file,
        { encoding: "utf8",
          mode: parseInt('0644', 8),
          flags: 'a' }
      );
    }
    stream.on("error", function (err) {
      console.error("log4js.fileAppender - Writing to file %s, error happened ", file, err);
    });
    return stream;
  }

  var logFile = openTheStream(file, logSize, numBackups);

  // push file to the stack of open handlers
  openFiles.push(logFile);

  return function(loggingEvent) {
    logFile.write(layout(loggingEvent, timezoneOffset) + eol, "utf8");
  };

}

function configure(config, options) {
  var layout;
  if (config.layout) {
    layout = layouts.layout(config.layout.type, config.layout);
  }

  if (options && options.cwd && !config.absolute) {
    config.filename = path.join(options.cwd, config.filename);
  }

  return fileAppender(config.filename, layout, config.maxLogSize, config.backups, config.compress, config.timezoneOffset);
}

function shutdown(cb) {
  async.each(openFiles, function(file, done) {
    if (!file.write(eol, "utf-8")) {
      file.once('drain', function() {
        file.end(done);
      });
    } else {
      file.end(done);
    }
  }, cb);
}

exports.appender = fileAppender;
exports.configure = configure;
exports.shutdown = shutdown;</textarea>

.


text:
/**
	_enyo.Select_ implements an HTML selection widget, using
	[enyo.Option](#enyo.Option) kinds by default.

	Example:

		{kind: "Select", onchange: "selectChanged", components: [
			{content: "Descending", value: "d"},
			{content: "Ascending", value: "a"}
		]}

		selectChanged: function(inSender, inEvent) {
			var s = inSender.getValue();
			if (s == "d") {
				this.sortListDescending();
			} else {
				this.sortListAscending();
			}
		}

	Note: This uses the `<select>` tag, which isn't implemented
	for native webOS applications, although it does work in the
	webOS Web browser.
*/

enyo.kind({
	name: "enyo.Select",
	published: {
		//* Index of the selected option in the list
		selected: 0
	},
	//* @protected
	handlers: {
		onchange: "change"
	},
	tag: "select",
	defaultKind: "enyo.Option",
	rendered: function() {
		this.inherited(arguments);
		//Trick to force IE8 onchange event bubble
		if(enyo.platform.ie == 8){
			this.setAttribute("onchange", enyo.bubbler);
		}
		this.selectedChanged();
	},
	getSelected: function() {
		return Number(this.getNodeProperty("selectedIndex", this.selected));
	},
	setSelected: function(inIndex) {
		// default property mechanism can't track changed correctly for virtual properties
		this.setPropertyValue("selected", Number(inIndex), "selectedChanged");
	},
	selectedChanged: function() {
		this.setNodeProperty("selectedIndex", this.selected);
	},
	change: function() {
		this.selected = this.getSelected();
	},
	render: function() {
		// work around IE bug with innerHTML setting of <select>, rerender parent instead
		// http://support.microsoft.com/default.aspx?scid=kb;en-us;276228
		if (enyo.platform.ie) {
			this.parent.render();
		} else {
			this.inherited(arguments);
		}
	},
	//* @public
	//* Returns the value of the selected option.
	getValue: function() {
		if (this.hasNode()) {
			return this.node.value;
		}
	}
});

/**
	_enyo.Option_ implements the options in an HTML select widget.
*/
enyo.kind({
	name: "enyo.Option",
	published: {
		//* Value of the option
		value: ""
	},
	//* @protected
	tag: "option",
	create: function() {
		this.inherited(arguments);
		this.valueChanged();
	},
	valueChanged: function() {
		this.setAttribute("value", this.value);
	}
});

/**
	_enyo.OptionGroup_ allows for the grouping of options in a select widget,
	and for the disabling of blocks of options.
*/
enyo.kind({
	name: "enyo.OptionGroup",
	published: {
		label: ""
	},
	//* @protected
	tag: "optgroup",
	defaultKind: "enyo.Option",
	create: function() {
		this.inherited(arguments);
		this.labelChanged();
	},
	labelChanged: function() {
		this.setAttribute("label", this.label);
	}
});


text:
namespace _02.StudentsAndWorkers.Model
{
    using Common;
    using Contracts;

    public abstract class Human : IHuman
    {
        private string firstName;
        private string lastName;

        protected Human(string firstName, string lastName)
        {
            this.FirstName = firstName;
            this.LastName = lastName;
        }

        public string FirstName
        {
            get => this.firstName;

            private set
            {
                Validator.CheckIfStringIsNullOrEmpty(value, "First name");
                this.firstName = value;
            }
        }

        public string LastName
        {
            get => this.lastName;

            private set
            {
                Validator.CheckIfStringIsNullOrEmpty(value, "Last name");
                this.lastName = value;
            }
        }

        public override string ToString()
        {
            return $"Name: {this.FirstName} {this.LastName}\n";
        }
    }
}


text:
package constant_instructions

import (
	"github.com/Frederick-S/jvmgo/instructions/base_instructions"
	"github.com/Frederick-S/jvmgo/runtime_data_area"
)

// fconst_2
// Push the float constant <f> (2.0) onto the operand stack
type FConst2 struct {
	base_instructions.NoOperandsInstruction
}

func (fConst2 *FConst2) Execute(frame *runtime_data_area.Frame) {
	frame.GetOperandStack().PushFloatValue(2.0)
}


text:
angular.module('CodeQuiz').directive('cqLanguageSelector', function(){
  return {
    replace: true,
    restrict: "E",
    require: "?ngModel",
    templateUrl: 'assets/templates/directives/cqLanguageSelector.html',
    link: function(scope, element, attrs, ngModelCtrl){
      var activeLanguage = "";
      scope.languages = ["any", "javascript", "html", "css", "ruby", "other"];
      scope.isActive = function(language){
        return (activeLanguage && activeLanguage === language);
      };
      scope.toggleLanguage = function(language){
        if(language === activeLanguage){
          activeLanguage = "";
        }
        else{
          activeLanguage = language;
        }
        ngModelCtrl.$setViewValue(activeLanguage);
      };

      ngModelCtrl.$render = function(){
        activeLanguage = ngModelCtrl.$viewValue;
      };
    }

  }
});


text:
Kubernetes concepts like Deployments and StatefulSets provide perfect platform to deploy Minio server in standalone, distributed or shared mode. There are multiple options to deploy Minio on Kubernetes, you can choose the one that suits you the most.

- Minio [Helm](https://helm.sh) Chart offers a customizable and easy Minio deployment, with a single command. Read more about Minio Helm deployment [here](#prerequisites).

- You can also explore Kubernetes [Minio example](https://github.com/minio/minio/blob/master/docs/orchestration/kubernetes-yaml/README.md) to deploy Minio using `.yaml` files.

- If you'd like to get started with Minio on Kubernetes without having to create a real container cluster, you can also [deploy Minio locally](https://raw.githubusercontent.com/minio/minio/master/docs/orchestration/minikube/README.md) with MiniKube.

## 1. Prerequisites

* Kubernetes 1.4+ with Beta APIs enabled for default standalone mode.
* Kubernetes 1.5+ with Beta APIs enabled to run Minio in [distributed mode](#distributed-minio).
* PV provisioner support in the underlying infrastructure.
* Helm package manager [installed](https://github.com/kubernetes/helm#install) on your Kubernetes cluster.

## 2. Deploy Minio using Helm Chart

Install Minio chart by

```bash
$ helm install stable/minio
```
Above command deploys Minio on the Kubernetes cluster in the default configuration. Below section lists all the configurable parameters of the Minio chart and their default values.

### Configuration

| Parameter                  | Description                         | Default                                                 |
|----------------------------|-------------------------------------|---------------------------------------------------------|
| `image`                    | Minio image name                    | `minio/minio`                                           |
| `imageTag`                 | Minio image tag. Possible values listed [here](https://hub.docker.com/r/minio/minio/tags/).| `RELEASE.2017-01-25T03-14-52Z`|
| `imagePullPolicy`          | Image pull policy                   | `Always`                                                |
| `mode`                     | Minio server mode (`standalone`, `shared` or `distributed`)| `standalone`                     |
| `numberOfNodes`            | Number of nodes (applicable only for Minio distributed mode). Should be 4 <= x <= 16 | `4`    |
| `accessKey`                | Default access key                  | `AKIAIOSFODNN7EXAMPLE`                                  |
| `secretKey`                | Default secret key                  | `wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY`              |
| `configPath`               | Default config file location        | `~/.minio`                                              |
| `mountPath`                | Default mount location for persistent drive| `/export`                                        |
| `serviceType`              | Kubernetes service type             | `LoadBalancer`                                          |
| `servicePort`              | Kubernetes port where service is exposed| `9000`                                              |
| `persistence.enabled`      | Use persistent volume to store data | `true`                                                  |
| `persistence.size`         | Size of persistent volume claim     | `10Gi`                                                  |
| `persistence.storageClass` | Type of persistent volume claim     | `generic`                                               |
| `persistence.accessMode`   | ReadWriteOnce or ReadOnly           | `ReadWriteOnce`                                         |
| `resources`                | CPU/Memory resource requests/limits | Memory: `256Mi`, CPU: `100m`                            |

You can specify each parameter using the `--set key=value[,key=value]` argument to `helm install`. For example,

```bash
$ helm install --name my-release \
  --set persistence.size=100Gi \
    stable/minio
```

The above command deploys Minio server with a 100Gi backing persistent volume.

Alternately, you can provide a YAML file that specifies parameter values while installing the chart. For example,

```bash
$ helm install --name my-release -f values.yaml stable/minio
```

### Distributed Minio

This chart provisions a Minio server in standalone mode, by default. To provision Minio server in [distributed mode](https://docs.minio.io/docs/distributed-minio-quickstart-guide), set the `mode` field to `distributed`,

```bash
$ helm install --set mode=distributed stable/minio
```

This provisions Minio server in distributed mode with 4 nodes. To change the number of nodes in your distributed Minio server, set the `numberOfNodes` field,

```bash
$ helm install --set mode=distributed,numberOfNodes=8 stable/minio
```

This provisions Minio server in distributed mode with 8 nodes. Note that the `numberOfNodes` value should be an integer between 4 and 16 (inclusive).

#### StatefulSet [limitations](http://kubernetes.io/docs/concepts/abstractions/controllers/statefulsets/#limitations) applicable to distributed Minio

* StatefulSets need persistent storage, so the `persistence.enabled` flag is ignored when `mode` is set to `distributed`.
* When uninstalling a distributed Minio release, you'll need to manually delete volumes associated with the StatefulSet.

### Shared Minio

To provision Minio servers in [shared mode](https://github.com/minio/minio/blob/master/docs/shared-backend/README.md), set the `mode` field to `shared`,

```bash
$ helm install --set mode=shared stable/minio
```

This provisions 4 Minio server nodes backed by single storage. To change the number of nodes in your shared Minio deployment, set the `numberOfNodes` field,

```bash
$ helm install --set mode=shared,numberOfNodes=8 stable/minio
```

This provisions Minio server in shared mode with 8 nodes.

### Persistence

This chart provisions a PersistentVolumeClaim and mounts corresponding persistent volume to default location `/export`. You'll need physical storage available in the Kubernetes cluster for this to work. If you'd rather use `emptyDir`, disable PersistentVolumeClaim by:

```bash
$ helm install --set persistence.enabled=false stable/minio
```

> *"An emptyDir volume is first created when a Pod is assigned to a Node, and exists as long as that Pod is running on that node. When a Pod is removed from a node for any reason, the data in the emptyDir is deleted forever."*

## 3. Updating Minio Release using Helm

You can update an existing Minio Helm Release to use a newer Minio Docker image. To do this, use the `helm upgrade` command:

```bash
$ helm upgrade --set imageTag=<replace-with-minio-docker-image-tag> <helm-release-name> stable/minio
```

On successful update, you should see the output below

```bash
Release "your-helm-release" has been upgraded. Happy Helming!
```

## 4. Uninstalling the Chart

Assuming your release is named as `my-release`, delete it using the command:

```bash
$ helm delete my-release
```

The command removes all the Kubernetes components associated with the chart and deletes the release.

### Notes

* An instance of a chart running in a Kubernetes cluster is called a release. Helm automatically assigns a unique release name after installing the chart. You can also set your preferred name by:

```bash
$ helm install --name my-release stable/minio
```

* To override the default keys, pass the access and secret keys as arguments to helm install.

```bash
$ helm install --set accessKey=myaccesskey,secretKey=mysecretkey \
    stable/minio
```

### Explore Further
- [Minio Erasure Code QuickStart Guide](https://docs.minio.io/docs/minio-erasure-code-quickstart-guide)
- [Kubernetes Documentation](https://kubernetes.io/docs/home/)
- [Helm package manager for kubernetes](https://helm.sh/)


text:
The Microsoft Bot Builder SDK is one of three main components of the Microsoft Bot Framework.

The Microsoft Bot Framework provides just what you need to build and connect intelligent bots that interact naturally wherever your users are talking, from text/sms to Skype, Slack, Office 365 mail and other popular services.

![Bot Framework Diagram](http://docs.botframework.com/en-us/images/faq-overview/botframework_overview_july.png)

Bots (or conversation agents) are rapidly becoming an integral part of one's digital experience – they are as vital a way for users to interact with a service or application as is a web site or a mobile experience. Developers writing bots all face the same problems: bots require basic I/O; they must have language and dialog skills; and they must connect to users – preferably in any conversation experience and language the user chooses. The Bot Framework provides tools to easily solve these problems and more for developers e.g., automatic translation to more than 30 languages, user and conversation state management, debugging tools, an embeddable web chat control and a way for users to discover, try, and add bots to the conversation experiences they love.

**[Review the documentation](http://docs.botframework.com)** to get started with the Bot Builder SDK!

Get started quickly with our samples:

* Samples within the SDK [C#](https://github.com/Microsoft/BotBuilder/tree/master/CSharp/Samples), [Node.js](https://github.com/Microsoft/BotBuilder/tree/master/Node/examples)
* Task-focused samples [GitHub repo](https://github.com/Microsoft/BotBuilder-Samples)

Join the conversation on **[Gitter] (https://gitter.im/Microsoft/BotBuilder)**.

See all the support options **[here](https://docs.botframework.com/en-us/support/)**.


text:
{% if field.settings %}
    {% set smartMapSubfields = [] %}
    {% for subfield,settings in field.settings.layout %}
        {% if settings.enable %}
            {% set smartMapSubfields = smartMapSubfields|merge([subfield]) %}
        {% endif %}
    {% endfor %}
{% else %}
    {% set smartMapSubfields = ['street1','street2','city','state','zip','country','lat','lng'] %}
{% endif %}

{% for subfield in smartMapSubfields %}
    {% set optionLabel  = field.name ~ ' (' ~ craft.smartMap.labelFromHandle(subfield) ~ ')' %}
    {% set optionLabelHandle = field.handle ~ '[' ~ subfield ~ ']' %}
    {% set optionHandle = field.handle ~ '--' ~ subfield %}

                    {{ optionLabel }}

                        {{ optionLabelHandle }}

            {% namespace 'fieldMapping' %}
                {{ forms.selectField({
                    id: optionHandle,
                    name: optionHandle,
                    value: feed.fieldMapping[optionHandle] ?? '',
                    options: feedData,
                }) }}
            {% endnamespace %}

{% endfor %}


text:
from   settings import *
import tweepy

class RWWauthor(object):
    """
    This class handles checking ReadWriteWeb for new posts and updating Twitter
    accordingly, further using any specified delays in order to avoid being
    abusive to the services in use.

    RWWauthor maintains state between calls and, through a data file, instances
    of the class, in order to avoid repetitive reposts.
    """

    def __init__(self):
        """
        Initializes the class and loads data from previos usage from
        `settings.POST_DATA_FILE`, if such a file is valid and available.
        """
        self.twitter   = None # will be authenticated when needed
        self.data_file = POST_DATA_FILE
        self._load()

    def _twitter_auth(self):
        """
        Authenticate with the Twitter API and provide access via
        `self.twitter`.
        """
        import tweepy
        auth = tweepy.OAuthHandler(CONSUMER_KEY, CONSUMER_SEC)
        auth.set_access_token(ACCESS_TOKEN, ACCESS_TOKEN_SEC)
        self.twitter = tweepy.API(auth)

    def _load(self):
        """
        Laod data used in between calls to and instances of this class from an
        external data file.
        """
        import pickle
        try:
            dfile = open(self.data_file, 'rb')
            data            = pickle.load(dfile)
        except:
            self.etag       = None
            self.last_post  = None
        else:
            self.etag       = data['etag']
            self.last_post  = data['last_post']
            dfile.close()

    def _save(self):
        """
        Save data used in between calls to and instances of this class to an
        external data file in order to prevent duplicates once the updating is
        resumed.
        """
        import pickle
        dfile = open(self.data_file, 'wb')
        data  = {
            'etag':      self.etag,
            'last_post': self.last_post,
        }
        pickle.dump(data, dfile)
        dfile.close()

    def _get_new_posts(self):
        """
        Retrieve all new posts from the URL specified in `settings.FEED_URL`,
        returned as a list of links to each post.

        The links are ordered chronologically so that the oldest posts are
        tweeted first. Further, they are limited to `settings.POST_LIMIT` posts
        to prevent being abusive toward any services in use.
        """
        import requests
        rsp      = requests.head(FEED_URL)
        new_etag = rsp.headers['etag']
        posts    = []

        # Retrieve new posts
        if new_etag != self.etag:
            import feedparser
            self.etag   = new_etag
            feed        = feedparser.parse(FEED_URL)
            entries     = feed['entries']

            for entry in entries:
                link = entry['link']
                if link == self.last_post:
                    break
                posts.append(link)

        # Reverse ordering for chronological tweeting; only up to [P] posts.
        return posts[:POST_LIMIT][::-1]

    def _tweet_post(self, url):
        """
        Given a URL to a RWW post, retrieves the necessary tweet data and sends
        a status update to the authorized account.
        """
        # Retrieve tweet author and other related data from post on website
        from urllib     import urlopen
        from lxml.html  import document_fromstring
        content = urlopen(url).read()
        html    = document_fromstring(content)
        try:
            phead   = html.get_element_by_id('metadata_digg_left')
            tweet   = phead.xpath('div/div[@class="share-tweet-mini"]/a')[0]
        except KeyError:
            pass
        else:
            tdata   = dict(tweet.items())

            # "Post Title by @author via @via"
            tweet_text = "%(data-text)s %(data-url)s via @%(data-via)s" % tdata
            from tweepy.error import TweepError
            try:
                self.twitter.update_status(tweet_text)
            except TweepError, e: # Problem tweeting; let's move on
                pass

    def update(self):
        """
        Checks for any new posts from ReadWriteWeb and, if available, tweets
        them in chronological order with a mention to the post author.

        To be curteous to the services in use, this will sleep in between each
        tweet for `settings.TWEET_DELAY` seconds.
        """
        posts = self._get_new_posts()

        # If there are any posts, note most recen
        if posts:
            # Only post if a previous post was detected, otherwise just set
            # a last post
            if self.last_post is not None:
                self._twitter_auth()

                for post in posts:
                    self._tweet_post(post)

                    # Delay in between tweets to avoid any trouble
                    from time import sleep
                    sleep(TWEET_DELAY)
            self.last_post = posts[-1]

        self._save()

if __name__ == '__main__':
    from time import sleep
    rww = RWWauthor()
    while True:
        rww.update()

        # Delay in between checking for new posts
        sleep(POST_DELAY)