def __export_log(log, output_file_path, parameters=None):
    """
    Export XES log from a PM4PY log

    Parameters
    ----------
    log: :class:`pm4py.log.log.EventLog`
        PM4PY log
    output_file_path:
        Output file path
    parameters
        Parameters of the algorithm

    """
    parameters = dict() if parameters is None else parameters

    # Gets the XML tree to export
    tree = __export_log_tree(log)
    # Effectively do the export of the event log
    tree.write(output_file_path,
               pretty_print=True,
               xml_declaration=True,
               encoding="utf-8")
    compress = param_util.fetch(Parameters.COMPRESS, parameters)
    if compress:
        compression.compress(output_file_path)
def __export_log(log, output_file_path, parameters=None):
    """
    Export XES log from a PM4PY log

    Parameters
    ----------
    log: :class:`pm4py.log.log.EventLog`
        PM4PY log
    output_file_path:
        Output file path
    parameters
        Parameters of the algorithm

    """
    parameters = dict() if parameters is None else parameters

    # Gets the XML tree to export
    tree = __export_log_tree(log)
    # Effectively do the export of the event log
    if Parameters.COMPRESS in parameters and parameters[Parameters.COMPRESS]:
        if not output_file_path.lower().endswith(".gz"):
            output_file_path = output_file_path + ".gz"
        fp = tempfile.NamedTemporaryFile(suffix=".xes")
        fp.close()
        tree.write(fp.name,
                   pretty_print=True,
                   xml_declaration=True,
                   encoding="utf-8")
        compression.compress(fp.name)
        shutil.copyfile(fp.name + ".gz", output_file_path)
    else:
        tree.write(output_file_path,
                   pretty_print=True,
                   xml_declaration=True,
                   encoding="utf-8")