def detect_cycles(data):
    """
    Detects cycles in the data

    Returns a tuple where the first item is the index at wich the cycle occurs 
    the first time and the second number indicates the lenght of the cycle 
    (it is 1 for a steady state)
    """

    fsize = len(data)

    # maximum size
    for msize in range(1, int(fsize / 2 + 1)):
        for index in range(fsize):
            left = data[index:index + msize]
            right = data[index + msize:index + 2 * msize]
            if left == right:
                return index, msize

    return 0, 0