<commit_before># -*- coding: utf-8 -*-

__all__ = ['Request', 'Response']

import logging
from webob import Request, Response

logger = logging.getLogger(__name__)


class RouteState(object):
    def __init__(self, request):
        self._prefixes = []
        self._subdomain = ''
        self._domain = request.host.split(':', 1)[0].decode('idna')
        self.request = request

    def add_prefix(self, prefix):
        self._prefixes.append(prefix)

    def pop_prefix(self):
        self._prefixes.pop()

    def add_subdomain(self, subdomain):
        if self._subdomain and subdomain:
            self._subdomain = subdomain + '.' + self._subdomain
        elif subdomain:
            self._subdomain = subdomain

    @property
    def path(self):
        path = self.request.path
        if self._prefixes:
            length = sum(map(len, self._prefixes))
            path = path[length:]
        return path

    @property
    def path_qs(self):
        path = self.request.path_qs
        if self._prefixes:
            length = sum(map(len, self._prefixes))
            path = path[length:]
        return path

    @property
    def subdomain(self):
        if self._subdomain:
            return self._domain[:-len(self._subdomain)-1]
        return self._domain

<commit_msg>removed unused property of RouteState<commit_after># -*- coding: utf-8 -*-

__all__ = ['Request', 'Response']

import logging
from webob import Request, Response

logger = logging.getLogger(__name__)


class RouteState(object):
    def __init__(self, request):
        self._prefixes = []
        self._subdomain = ''
        self._domain = request.host.split(':', 1)[0].decode('idna')
        self.request = request

    def add_prefix(self, prefix):
        self._prefixes.append(prefix)

    def pop_prefix(self):
        self._prefixes.pop()

    def add_subdomain(self, subdomain):
        if self._subdomain and subdomain:
            self._subdomain = subdomain + '.' + self._subdomain
        elif subdomain:
            self._subdomain = subdomain

    @property
    def path(self):
        path = self.request.path
        if self._prefixes:
            length = sum(map(len, self._prefixes))
            path = path[length:]
        return path

    @property
    def subdomain(self):
        if self._subdomain:
            return self._domain[:-len(self._subdomain)-1]
        return self._domain


{'fraction_non_alphanumeric': 0.1140241364960466, 'fraction_numerical': 0.0033291718684977114, 'mean_word_length': 2.253044654939107, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '4779501', 'n_tokens_mistral': 705, 'n_tokens_neox': 686, 'n_words': 160}