def get_task(benchmark, env_id):
    """Get a task by env_id. Return None if the benchmark doesn't have the env"""
    # A lambda function is a small anonymous function.
    # The filter() method constructs an iterator from elements of an iterable for which a function returns true.
    # The next() function returns the next item from the iterator.
    return next(filter(lambda task: task['env_id'] == env_id, benchmark['tasks']), None)