def parse_gradient(line, world_size):
    """
    Takes a string representing a GRADIENT_RESOURCE (as specified in Avida
    environment files) and a tuple representing the x and y dimensions of the
    world, and returns the name of the gradient resource and a list of
    tuples representing the cells it's in.
    """
    # remove "GRADIENT_RESOURCE"
    line = line[18:]

    sline = [el.strip() for el in line.split(":")]
    name = sline[0]
    name = reduce_resource_name_to_task(name)
    radius = None
    x = None
    y = None

    # Extract data
    for item in sline:
        if item.startswith("height"):
            radius = int(item.split("=")[1])
        elif item.startswith("peakx"):
            x = int(item.split("=")[1])
        elif item.startswith("peaky"):
            y = int(item.split("=")[1])

    # Translate circle to cells)
    cells = []
    for i in range(world_size[0]):
        for j in range(world_size[1]):
            if (dist((i, j), (x, y))) <= radius-1:
                cells.append((i, j))

    return (name, cells)