def indices(lst, element):
    """ A function that searches for all occurrences of an element in a list """
    result = []
    offset = -1
    while True:
        try:
            offset = lst.index(element, offset + 1)
        except ValueError:
            return result
        result.append(offset)