def write_to_table(
            self,
            query,
            dataset=None,
            table=None,
            external_udf_uris=[],
            allow_large_results=None,
            use_query_cache=None,
            priority=None,
            create_disposition=None,
            write_disposition=None,
    ):

        configuration = {
            "query": query,
        }

        if dataset and table:
            configuration['destinationTable'] = {
                "projectId": self.project_id,
                "tableId": table,
                "datasetId": dataset
            }

        if allow_large_results is not None:
            configuration['allowLargeResults'] = allow_large_results

        if use_query_cache is not None:
            configuration['useQueryCache'] = use_query_cache

        if priority:
            configuration['priority'] = priority

        if create_disposition:
            configuration['createDisposition'] = create_disposition

        if write_disposition:
            configuration['writeDisposition'] = write_disposition

        configuration['userDefinedFunctionResources'] = []
        for external_udf_uri in external_udf_uris:
            configuration['userDefinedFunctionResources'].append(
                {
                    "resourceUri": external_udf_uri
                }
            )

        body = {
            "configuration": {
                'query': configuration
            }
        }

        logger.info("Creating write to table job %s" % body)
        job_resource = self._insert_job(body)
        self._raise_insert_exception_if_error(job_resource)
        return job_resource
Create a categorical MC moments to categorical moments conversion node.
dataset/ETHPy150Open tylertreat/BigQuery-Python/bigquery/client.py/BigQueryClient.write_to_table--crossover with--dataset/ETHPy150Open bayespy/bayespy/bayespy/inference/vmp/nodes/bernoulli.py/CategoricalToBernoulli.__init__