




import operator




def     __magic_name__       (				A	:      list,						A	:      bool = False,						A	:      list | None = None     ):






			'''simple docstring'''







			a					=    operator.lt if reverse else operator.gt
			a					=    solution or []

			if not arr:
						return solution

			a					=    [arr.pop(0     )]
			for i, item in enumerate(A     ):
						if _operator(A,						sublist[-1]     ):
									sublist.append(A     )
									arr.pop(A     )

    #  merging sublist into solution list
			if not solution:
						solution.extend(A     )
			else:
						while sublist:
									a					=    sublist.pop(0     )
									for i, xx in enumerate(A     ):
												if not _operator(A,						A     ):
															solution.insert(A,						A     )
															break
									else:
												solution.append(A     )

			strand_sort(A,						A,						A     )
			return solution


if __name__ == "__main__":
		assert strand_sort([4, 3, 5, 1, 2]) == [1, 2, 3, 4, 5]
		assert strand_sort([4, 3, 5, 1, 2], reverse=True) == [5, 4, 3, 2, 1]












# 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	:       Tuple     =	subprocess.check_output('git merge-base main HEAD'.split()).decode('utf-8')
__lowerCAmelCase	:       Tuple     =	subprocess.check_output(F'''git diff --name-only {fork_point_sha}'''.split()).decode('utf-8').split()

__lowerCAmelCase	:       Dict     =	'|'.join(sys.argv[1:])
__lowerCAmelCase	:       List[Any]     =	re.compile(rF'''^({joined_dirs}).*?\.py$''')

__lowerCAmelCase	:       List[Any]     =	[x for x in modified_files if regex.match(x)]
print(' '.join(relevant_modified_files), end='')






