input: def count_occurrences(base: str, sub: str) -> int:
      """ Determine the number of times a specific substring appears within a given string, including overlaps.
      >>> count_occurrences('', 'a')
      0
      >>> count_occurrences('aaa', 'a')
      3
      >>> count_occurrences('aaaa', 'aa')
      3
      """
output:     
      count = 0
      sub_len = len(sub)
      for i in range(len(base) - sub_len + 1):
          if base[i:i + sub_len] == sub:
              count += 1
      return count
  