def METHOD_NAME(path):
    import sys
    if sys.version_info.major == 2:
        import urlparse
        parse_cmd = urlparse.urlparse
    else:
        import urllib
        parse_cmd = urllib.parse.urlparse
    import boto3
    from botocore.exceptions import ClientError
    # parse the path
    parsed_url = parse_cmd(path)
    # get S3 client
    s3 = boto3.resource("s3")
    # read file content and pass it down
    obj = s3.Object(parsed_url.netloc, parsed_url.path.lstrip("/"))
    print("loading file: " + str(obj))
    try:
        data = obj.get()["Body"]
    except ClientError as ce:
        raise ValueError(
            "Can't download from S3 path: " + path + " : " + ce.response["Error"]["Message"]
        )
    import StringIO
    buf = StringIO(data.read())
    img = gzip.GzipFile(mode="rb", fileobj=buf)
    _, _, rows, cols = struct.unpack(">IIII", img.read(16))
    images = np.fromstring(img.read(), dtype=np.uint8).reshape(10000, rows, cols)
    images = images.reshape(images.shape[0], 1, 28, 28).astype(np.float32) / 255
    return mx.io.NDArrayIter(images, None, 1)