<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def mandelbrot_iterate(c, max_iterations, julia_seed=None):
 """ Returns the number of iterations before escaping the Mandelbrot fractal. :param c: Coordinates as a complex number :type c: complex :param max_iterations: Limit of how many tries are attempted. :return: Tuple containing the last complex number in the sequence and the number of iterations. """

    z = c
    if julia_seed is not None:
        c = julia_seed
    for iterations in range(max_iterations):
        z = z * z + c
        if abs(z) > 1000:
            return z, iterations
    return z, max_iterations