def METHOD_NAME(filename, data, metadata):
    """
    It is used to create histograms.
    :param str fileName: the nanme of the file
    :param list data: the data which is used to create the plot
    :param dict metadata: extra information used to create the plot.
    """
    try:
        with open(filename, "wb") as fn:
            checkMetadata(metadata)
            histogram(data, fn, **metadata)
    except OSError as e:
        return S_ERROR(errno.EIO, e)
    return S_OK()