def filter_actions(actions, behaviors=[], sub_behaviors=[], actors=[], parameters=[]):
    """
    Filter the list of actions by behaviors, actors, or parameters used. An action that has any 
    of the values you give will be present in the filtered list, which will still be sorted in 
    order of their execution in the script.

    @param actions (list) of Action objects
    @param behaviors (list) of Behavior enum values
    @param sub_behaviors (list) of SubBehavior enum values
    @param actors (list) of substrings to look for in the Actor field of the action
    @param parameters (list) of exact matches on parameter names used in the action

    @return (list) filtered actions
    """

    filtered = []
    behavior_filter = set(behaviors)
    sub_behavior_filter = set(sub_behaviors)

    for action in actions:

        # check for a desired behavior
        if set(action.behaviors) & behavior_filter:
            filtered.append(action)
            continue

        # check for a desired sub_behavior
        if set(action.sub_behaviors) & sub_behavior_filter:
            filtered.append(action)
            continue

        # check for a desired actor
        filtered_actors = [a for a in actors if a in action.actor]
        if filtered_actors:
            filtered.append(action)
            continue

        # check for desired parameters
        filtered_parameters = [p for p in parameters if p in action.parameters.keys()]
        if filtered_parameters:
            filtered.append(action)
            continue

    return filtered