<commit_before># HTTP::Server::Context is the class which holds HTTP::Request and HTTP::Server::Response alongside with
# information such as request params, request/response content_type, session e.g
#
# Instances of this class are passed to an `HTTP::Server` handler.
class HTTP::Server
  class Context
    alias StoreTypes = Nil | String | Int32 | Float64 | Bool
    getter store = {} of String => StoreTypes

    def params
      @request.url_params ||= route_lookup.params
      @params ||= Kemal::ParamParser.new(@request)
    end

    def redirect(url, status_code = 302)
      @response.headers.add "Location", url
      @response.status_code = status_code
    end

    def route_lookup
      Kemal::RouteHandler::INSTANCE.lookup_route(@request.override_method.as(String), @request.path)
    end

    def route_defined?
      route_lookup.found?
    end

    def session
      @session ||= Kemal::Sessions.new(self)
      @session.not_nil!<commit_msg>Add Int64 type to context store<commit_after># HTTP::Server::Context is the class which holds HTTP::Request and HTTP::Server::Response alongside with
# information such as request params, request/response content_type, session e.g
#
# Instances of this class are passed to an `HTTP::Server` handler.
class HTTP::Server
  class Context
    alias StoreTypes = Nil | String | Int32 | Int64 | Float64 | Bool
    getter store = {} of String => StoreTypes

    def params
      @request.url_params ||= route_lookup.params
      @params ||= Kemal::ParamParser.new(@request)
    end

    def redirect(url, status_code = 302)
      @response.headers.add "Location", url
      @response.status_code = status_code
    end

    def route_lookup
      Kemal::RouteHandler::INSTANCE.lookup_route(@request.override_method.as(String), @request.path)
    end

    def route_defined?
      route_lookup.found?
    end

    def session
      @session ||= Kemal::Sessions.new(self)
      @session.not_nil!
{'fraction_non_alphanumeric': 0.10030864197530864, 'fraction_numerical': 0.009259259259259259, 'mean_word_length': 3.5872641509433962, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '6233792', 'n_tokens_mistral': 582, 'n_tokens_neox': 553, 'n_words': 161}