def get_groups_in_same_folder(self, folder_depth=<NUM_LIT:3>):
group_pairs = []<EOL>key_dicoms = list(self.dicom_groups.keys())<EOL>idx = len(key_dicoms)<EOL>while idx > <NUM_LIT:0>:<EOL><INDENT>group1 = key_dicoms.pop()<EOL>dir_group1 = get_folder_subpath(group1, folder_depth)<EOL>for group in key_dicoms:<EOL><INDENT>if group.startswith(dir_group1):<EOL><INDENT>group_pairs.append((group1, group))<EOL><DEDENT><DEDENT>idx -= <NUM_LIT:1><EOL><DEDENT>return group_pairs<EOL>
Returns a list of 2-tuples with pairs of dicom groups that
are in the same folder within given depth.

Parameters
----------
folder_depth: int
Path depth to check for folder equality.

Returns
-------
list of tuples of str