def METHOD_NAME(all_commands, config):
    """! Write all commands that were run to a file in the log
     directory. This includes the environment variables that
     were set before each command.
    @param all_commands list of tuples with command run and
     list of environment variables that were set
    @param config METplusConfig object used to write log output
     and get the log timestamp to name the output file
    @returns False if no commands were provided, True otherwise
    """
    if not all_commands:
        config.logger.info("No commands were run. "
                           "Skip writing all_commands file")
        return False
    log_timestamp = config.getstr('config', 'LOG_TIMESTAMP')
    filename = os.path.join(config.getdir('LOG_DIR'),
                            f'.all_commands.{log_timestamp}')
    config.logger.debug(f"Writing all commands and environment to {filename}")
    with open(filename, 'w') as file_handle:
        for command, envs in all_commands:
            for env in envs:
                file_handle.write(f"{env}\n")
            file_handle.write("COMMAND:\n")
            file_handle.write(f"{command}\n\n")
    return True