def index_of_spaces(text):
    """
    Given text, return all space indices

    @param text is the string to analyze
    @returns a list of integers representing the indices
    """

    res = []
    for i in range(0, len(text)):
        if text[i] == ' ':
            res.append(i)
    return res