Repository: Project-MONAI/MONAI

Issue:
B026 unrecommanded star-arg unpacking after a keyword argument
```
/home/runner/work/MONAI/MONAI/monai/data/image_reader.py:1303:83: B026 Star-arg unpacking after a keyword argument is strongly discouraged, because it only works when the keyword parameter is declared after all parameters supplied by the unpacked sequence, and this change of ordering can surprise and mislead readers.
/home/runner/work/MONAI/MONAI/monai/inferers/inferer.py:590:21: B026 Star-arg unpacking after a keyword argument is strongly discouraged, because it only works when the keyword parameter is declared after all parameters supplied by the unpacked sequence, and this change of ordering can surprise and mislead readers.
/home/runner/work/MONAI/MONAI/tests/test_video_datasets.py:42:88: B026 Star-arg unpacking after a keyword argument is strongly discouraged, because it only works when the keyword parameter is declared after all parameters supplied by the unpacked sequence, and this change of ordering can surprise and mislead readers.
3     B026 Star-arg unpacking after a keyword argument is strongly discouraged, because it only works when the keyword parameter is declared after all parameters supplied by the unpacked sequence, and this change of ordering can surprise and mislead readers.
```

Refer to https://github.com/python/cpython/issues/82741.
B026 unrecommanded star-arg unpacking after a keyword argument
```
/home/runner/work/MONAI/MONAI/monai/data/image_reader.py:1303:83: B026 Star-arg unpacking after a keyword argument is strongly discouraged, because it only works when the keyword parameter is declared after all parameters supplied by the unpacked sequence, and this change of ordering can surprise and mislead readers.
/home/runner/work/MONAI/MONAI/monai/inferers/inferer.py:590:21: B026 Star-arg unpacking after a keyword argument is strongly discouraged, because it only works when the keyword parameter is declared after all parameters supplied by the unpacked sequence, and this change of ordering can surprise and mislead readers.
/home/runner/work/MONAI/MONAI/tests/test_video_datasets.py:42:88: B026 Star-arg unpacking after a keyword argument is strongly discouraged, because it only works when the keyword parameter is declared after all parameters supplied by the unpacked sequence, and this change of ordering can surprise and mislead readers.
3     B026 Star-arg unpacking after a keyword argument is strongly discouraged, because it only works when the keyword parameter is declared after all parameters supplied by the unpacked sequence, and this change of ordering can surprise and mislead readers.
```

Refer to https://github.com/python/cpython/issues/82741.


Discussion:

Resolving patch:
diff --git a/monai/data/image_reader.py b/monai/data/image_reader.py
--- a/monai/data/image_reader.py
+++ b/monai/data/image_reader.py
@@ -1300,7 +1300,7 @@ def read(self, data: Sequence[PathLike] | PathLike, **kwargs) -> Sequence[Any] |
         kwargs_ = self.kwargs.copy()
         kwargs_.update(kwargs)
         for name in filenames:
-            nrrd_image = NrrdImage(*nrrd.read(name, index_order=self.index_order, *kwargs_))
+            nrrd_image = NrrdImage(*nrrd.read(name, index_order=self.index_order, **kwargs_))
             img_.append(nrrd_image)
         return img_ if len(filenames) > 1 else img_[0]
 
diff --git a/monai/inferers/inferer.py b/monai/inferers/inferer.py
--- a/monai/inferers/inferer.py
+++ b/monai/inferers/inferer.py
@@ -584,10 +584,10 @@ def __call__(
                 return super().__call__(
                     inputs,
                     network,
+                    *args,
                     device=inputs.device if gpu_stitching else torch.device("cpu"),
                     buffer_steps=buffer_steps if buffered_stitching else None,
                     buffer_dim=buffer_dim,
-                    *args,
                     **kwargs,
                 )
             except RuntimeError as e:


Test patch:
diff --git a/tests/test_video_datasets.py b/tests/test_video_datasets.py
--- a/tests/test_video_datasets.py
+++ b/tests/test_video_datasets.py
@@ -39,7 +39,7 @@ def get_video_source(self):
             return self.video_source
 
         def get_ds(self, *args, **kwargs) -> VideoDataset:
-            return self.ds(video_source=self.get_video_source(), transform=TRANSFORMS, *args, **kwargs)  # type: ignore
+            return self.ds(*args, video_source=self.get_video_source(), transform=TRANSFORMS, **kwargs)  # type: ignore
 
         @unittest.skipIf(has_cv2, "Only tested when OpenCV not installed.")
         def test_no_opencv_raises(self):