<commit_before>class Solution:

    def get_start_pos(self, A, target):
        start, end = 0, len(A) - 1
        while start <= end:
            mid = (start + end) / 2
            if A[mid] == target:
                if start == end:
                    return mid
                end = mid
            elif A[mid] < target:
                start = mid + 1
            else: # >
                end = mid - 1
        return -1


    def get_end_pos(self, A, target):
        start, end = 0, len(A) - 1
        while start <= end:
            mid = (start + end + 1) / 2
            if A[mid] == target:
                if start == end:
                    return mid
                start = mid
            elif A[mid] < target:
                start = mid + 1
            else: # ><commit_msg>annotated search for a range<commit_after>class Solution:

    def get_start_pos(self, A, target):
        start, end = 0, len(A) - 1
        while start <= end:
            mid = (start + end) / 2 # left median
            if A[mid] == target:
                if start == end: # till one element is left
                    return mid
                end = mid
            elif A[mid] < target:
                start = mid + 1
            else: # >
                end = mid - 1
        return -1


    def get_end_pos(self, A, target):
        start, end = 0, len(A) - 1
        while start <= end:
            mid = (start + end + 1) / 2 # right median
            if A[mid] == target:
                if start == end:
                    return mid
                start = mid
            elif A[mid] < target:
                start = mid + 1
            else: # >
{'fraction_non_alphanumeric': 0.1003003003003003, 'fraction_numerical': 0.013213213213213212, 'mean_word_length': 0.9952095808383233, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 7, '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': '4025414', 'n_tokens_mistral': 496, 'n_tokens_neox': 451, 'n_words': 161}