def frequency_map(text, k):
    """
    Find the frequency of all k-mers in a string.

    Args:
        text (str): text.
        k (int): length of the substring (i.e. kmers).

    Returns:
        Dictionary, a dictionary that contains the count of all the k-mers in text.

    Examples:
        Computes the frequency map of a given string (i.e. text) and integer (i.e. k). Return a dictionary of the k-mers and the corresponding frequency for all k-mers that appears in text.
        
        >>> text = "CGATATATCCATAG" 
        >>> k = 3
        >>> kmers_count_map = frequency_map(text, k)
        >>> kmers_count_map
            {'CGA': 1, 'GAT': 1, 'ATA': 3, 'TAT': 2, 'ATC': 1, 'TCC': 1, 'CCA': 1, 'CAT': 1, 'TAG': 1}
    """
    freq = {}
    n = len(text)
    for i in range(n-k+1):
        pattern = text[i:i+k]
        freq[pattern] = 0
        for m in range(n-k+1):
            if text[m:m+k] == pattern:
                freq[pattern] = freq[pattern] + 1
    return freq