<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def generate(self, clusters, version=None):
 """ Generates HAProxy config file content based on a given list of clusters. """

        now = datetime.datetime.now()

        sections = [
            Section(
                "Auto-generated by Lighthouse (%s)" % now.strftime("%c"),
                self.global_stanza,
                self.defaults_stanza
            )
        ]

        meta_stanzas = [
            MetaFrontendStanza(
                name, self.meta_clusters[name]["port"],
                self.meta_clusters[name].get("frontend", []), members,
                self.bind_address
            )
            for name, members
            in six.iteritems(self.get_meta_clusters(clusters))
        ]
        frontend_stanzas = [
            FrontendStanza(cluster, self.bind_address)
            for cluster in clusters
            if "port" in cluster.haproxy
        ]
        backend_stanzas = [BackendStanza(cluster) for cluster in clusters]

        if version and version >= (1, 5, 0):
            peers_stanzas = [PeersStanza(cluster) for cluster in clusters]
        else:
            peers_stanzas = []

        sections.extend([
            Section("Frontend stanzas for ACL meta clusters", *meta_stanzas),
            Section("Per-cluster frontend definitions", *frontend_stanzas),
            Section("Per-cluster backend definitions", *backend_stanzas),
            Section("Per-cluster peer listings", *peers_stanzas),
            Section("Individual proxy definitions", *self.proxy_stanzas),
        ])
        if self.stats_stanza:
            sections.append(
                Section("Listener for stats web interface", self.stats_stanza)
            )

        return "\n\n\n".join([str(section) for section in sections]) + "\n"