  
  
  from argparse import Namespace
  from shutil import copyfile, rmtree
  from typing import List, Optional, TYPE_CHECKING
  
  from tqdm import tqdm
  
  # faceswap imports
  from lib.serializer import Serializer, get_serializer_from_filename
 
</s> remove from typing import cast, Dict, List, Optional, TYPE_CHECKING, Union
 </s> add from typing import cast, Dict, List, Optional, Tuple, TYPE_CHECKING, Union </s> remove from typing import Any, Dict, Generator, List, Optional, Tuple, TYPE_CHECKING, Union
 </s> add from typing import (Any, cast, Dict, Generator, Iterator, List,
                    Optional, Tuple, TYPE_CHECKING, Union) </s> remove from lib.align.alignments import _VERSION
 </s> add from lib.align.alignments import _VERSION, PNGHeaderDict </s> remove     from imageio.plugins.pillowmulti import GIFFormat
 </s> add     from imageio.core import format as im_format  # noqa:F401 </s> remove                 logger.trace("Extracted frame_no %s from filename '%s'",  # type: ignore
                             frame_no, filename)
 </s> add                 logger.trace(  # type:ignore[attr-defined]
                    "Extracted frame_no %s from filename '%s'", frame_no, filename)
from typing import Dict, List, Optional, TYPE_CHECKING
  
  
  from argparse import Namespace
  from shutil import copyfile, rmtree
from typing import Dict, List, Optional, TYPE_CHECKING
  
  from tqdm import tqdm
  
  # faceswap imports
  from lib.serializer import Serializer, get_serializer_from_filename
keep keep keep keep replace keep keep keep keep keep
 tests:
  - unit test: tools.alignments.media
  - Add mypy test
  - Typing fixes 
tools/sort/sort.py