Spaces:
Runtime error
Runtime error
File size: 365 Bytes
abca9bf |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
from typing import List
def handle_args_to_ignore(args: List[str]):
indices_to_remove = []
for i, arg in enumerate(args):
if "_ignore_" in arg:
indices_to_remove.append(i)
if not arg.startswith("-"):
indices_to_remove.append(i - 1)
for i in sorted(indices_to_remove, reverse=True):
del args[i]
|