def METHOD_NAME(df: pd.DataFrame, filename: str, output_path: str, output_format: Optional[str] = None, index: bool =False):
    _, file_extension = os.path.splitext(filename)
    if output_format is None:
        if not file_extension:
            default_format = 'txt'
            default_extension = '.{}'.format(default_format)
            separator = get_separator(default_extension)
            filename = '{}{}'.format(filename, default_extension)
        else:
            separator = get_separator(file_extension)
    else:
        selected_extension = '.{}'.format(output_format)
        if file_extension != selected_extension:
            separator = get_separator(selected_extension)
            filename = '{}{}'.format(filename, selected_extension)
            if file_extension:
                logger.warning(
                    'Selected extension missmatches output filename ({}, {}): It will be added => {}'.format(
                        selected_extension, file_extension, filename))
        else:
            separator = get_separator(selected_extension)
    df.to_csv('{}/{}'.format(output_path, filename), sep=separator, index=index)