def METHOD_NAME(buf, flag=1, to_rgb=True, out=None):
    """
    Read and decode an image to an NDArray.
    Input image NDArray should has dim_order of 'HWC'.
    Note: `imread` uses OpenCV (not the CV2 Python library).
    MXNet must have been built with USE_OPENCV=1 for `imdecode` to work.
    :param buf: str/bytes or numpy.ndarray
        Binary image data as string or numpy ndarray.
    :param flag:  {0, 1}, default 1
        1 for three channel color output. 0 for grayscale output.
    :param to_rgb:  bool, default True
        True for RGB formatted output (MXNet default).
        False for BGR formatted output (OpenCV default).
    :param out:  NDArray, optional
        Output buffer. Use `None` for automatic allocation.
    :return: NDArray
        An `NDArray` containing the image.
    Example
    -------
    >>> buf = open("flower.jpg", 'rb').read()
    >>> image.read(buf)
    <NDArray 224x224x3 @cpu(0)>
    """
    return img.imdecode(buf, flag, to_rgb, out)