def indices(a, func):
    """
    Returns the indices of a which verify a condition defined by a lambda function.

    Args:
        a: The list to be interrogated
        func: The function to be applied to the list
    Returns:
        List of the indices of the list that satisfy the function
    Example:
        year = indices(self.model.times, lambda x: x >= 2003)[0]  returns the smallest index where x >=2003
    """

    return [i for (i, val) in enumerate(a) if func(val)]