






'''simple docstring'''







# this script reports modified .py files under the desired list of top-level sub-dirs passed as a list of arguments, e.g.:
#   python ./utils/get_modified_files.py utils src tests examples
#
# it uses git to find the forking point and which files were modified - i.e. files not under git won't be considered
# since the output of this script is fed into Makefile commands it doesn't print a newline after the results

import re
import subprocess
import sys


__lowerCAmelCase        =							subprocess.check_output("git merge-base main HEAD".split()).decode("utf-8")
__lowerCAmelCase        =							(
    subprocess.check_output(f"""git diff --diff-filter=d --name-only {fork_point_sha}""".split()).decode("utf-8").split()
)

__lowerCAmelCase        =							"|".join(sys.argv[1:])
__lowerCAmelCase        =							re.compile(Rf"""^({joined_dirs}).*?\.py$""")

__lowerCAmelCase        =							[x for x in modified_files if regex.match(x)]
print(" ".join(relevant_modified_files), end="")












'''simple docstring'''







from __future__ import annotations

from collections.abc import Iterator
from typing import Generic, TypeVar

__lowerCAmelCase        =							TypeVar("T")




class   __SCREAMING_SNAKE_CASE       (Generic[T]       ):


  """simple docstring"""


  def __init__(			self   ,	UpperCamelCase__	):






         """simple docstring"""


         a_						     =			data
         a_						     =			None







  def __str__(			self	):






         """simple docstring"""


         return f'{self.data}'





class   __SCREAMING_SNAKE_CASE       (Generic[T]       ):


  """simple docstring"""


  def __init__(			self	):






         """simple docstring"""


         a_						     =			None







  def __iter__(			self	):






         """simple docstring"""


         a_						     =			self.top
         while node:
                yield node.data
                a_						     =			node.next







  def __str__(			self	):






         """simple docstring"""


         return "->".join([str(UpperCamelCase__	) for item in self]	)







  def __len__(			self	):






         """simple docstring"""


         return len(tuple(iter(self	)	)	)







  def    _a       (			self	):






         """simple docstring"""


         return self.top is None







  def    _a       (			self   ,	UpperCamelCase__	):






         """simple docstring"""


         a_						     =			Node(UpperCamelCase__	)
         if not self.is_empty():
                a_						     =			self.top
         a_						     =			node







  def    _a       (			self	):






         """simple docstring"""


         if self.is_empty():
                raise IndexError('pop from empty stack'	)
         assert isinstance(self.top   ,	UpperCamelCase__	)
         a_						     =			self.top
         a_						     =			self.top.next
         return pop_node.data







  def    _a       (			self	):






         """simple docstring"""


         if self.is_empty():
                raise IndexError('peek from empty stack'	)

         assert self.top is not None
         return self.top.data







  def    _a       (			self	):






         """simple docstring"""


         a_						     =			None


if __name__ == "__main__":
  from doctest import testmod

  testmod()




