def _filter_locals(filter_: str, locals_) -> bool:
    """
    Evaluate a condition string.
    :param filter_: Python code to evaluate.
    :param locals_: Locals to supply to the code.
    :return: True if the condition is true, False otherwise.
    """
    return eval(filter_, {}, locals_)