<commit_before>import os
import imp
import sys
import re
import doctest
import traceback
import datetime

from tcunittest import TeamcityTestResult
from tcmessages import TeamcityServiceMessages

class TeamcityDocTestResult(TeamcityTestResult):
    """
    DocTests Result extends TeamcityTestResult,
    overrides some methods, specific for doc tests,
    such as getTestName, getTestId.
    """
    def getTestName(self, test):
      name = self.current_suite.name + test.source
      return name

    def getSuiteName(self, suite):
      if test.source.rfind(".") == -1:
        name = self.current_suite.name + test.source
      else:
        name = test.source
      return name

    def getTestId(self, test):
        file = os.path.realpath(self.current_suite.filename)
        return "file://" + file + ":" + str( self.current_suite.lineno + test.lineno)

    def getSuiteLocation(self):
      file = os.path.realpath(self.current_suite.filename)
      return "file://" + file + ":" + str(self.current_suite.lineno)
<commit_msg>fixed PY-3811 AE at com.intellij.execution.testframework.sm.FileUrlProvider.createLocationFor<commit_after>import os
import imp
import sys
import re
import doctest
import traceback
import datetime

from tcunittest import TeamcityTestResult
from tcmessages import TeamcityServiceMessages

class TeamcityDocTestResult(TeamcityTestResult):
    """
    DocTests Result extends TeamcityTestResult,
    overrides some methods, specific for doc tests,
    such as getTestName, getTestId.
    """
    def getTestName(self, test):
      name = self.current_suite.name + test.source
      return name

    def getSuiteName(self, suite):
      if test.source.rfind(".") == -1:
        name = self.current_suite.name + test.source
      else:
        name = test.source
      return name

    def getTestId(self, test):
        file = os.path.realpath(self.current_suite.filename)
        return "file://" + file + ":" + str( self.current_suite.lineno + test.lineno)

    def getSuiteLocation(self):
      file = os.path.realpath(self.current_suite.filename)
      location = "file://" + file
      if self.current_suite.lineno:
        location += ":" + str(self.current_suite.lineno)
      return location

{'fraction_non_alphanumeric': 0.0967741935483871, 'fraction_numerical': 0.002688172043010753, 'mean_word_length': 3.2452471482889735, 'pattern_counts': {'":': 4, '<': 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': '5090358', 'n_tokens_mistral': 668, 'n_tokens_neox': 659, 'n_words': 169}