def get_random_images(num, release=None, download=None): ''' Get a random set of Images Gets a random set of Marvin Images. Optionally can download them in bulk. Parameters: num (int): The number of random images to grab download (bool): If True, also downloads all the images locally release (str): The release of the data to grab images for Returns: A list of Marvin Images ''' from marvin.tools.image import Image images = Image.get_random(num=num, release=release) if download: _download_images(images, label='by_random') return images
def test_getrandom(self): images = Image.get_random(2) assert len(images) == 2