def strip_arg(arg_list, remove_arg, has_trailing=False):
    """
    Remove arg and arg argument from a list of args. If has_trailing is true then
    remove --arg value else just remove --arg.

    Args:

    arg_list (list) : List of args that we want to remove items from
    remove_arg (str) : Name of arg to remove. Must match element in `arg_list`.
    has_trailing (boolean) : If the arg in `remove_arg` has an arg. Then make sure
    to remove that arg as well
    """
    try:
        location = arg_list.index(remove_arg)
        if has_trailing:
            del arg_list[location + 1]
        del arg_list[location]

    except ValueError:
        pass

    return arg_list