import requests
import io


def getImage(image_url):
    """Download the image from NASA.
    
    Args:
        image_url: The string URI to download, or a path to a local file for testing.
        
    Returns:
        A BufferedIO object containing the image data.

        N.B. Be sure to close() the buffer when you are done with it.
    """
    if image_url.startswith('http'):
        req = requests.get(image_url)
        return io.BytesIO(req.content)
    return open(image_url, 'rb')