Details of Mosaic data augmentation technique

Applying Mosaic as an augmentation technique has produced amazing results for me. I somewhat understand how it works, but is there any way to get the details of this technique? For example, it uses random crop, but I can’t specify the range of this random crop, is this range fixed? Another detail I don’t know is what range is being used to select a random centerpoint for the final mosaic image; after 4 randomly selected images are randomly cropped and put in one image, the system picks a random 640x640 square out the image as final image, but how is the centerpoint decided? It looks like the maximum x and y values are not the limits, as then some pictures would have a very small width or length, which never seems to happen. Is there any source code of the mosaic augmentation available to figure all of this out?