class_docstr: Base class for writing network file in net format
  
  Parameters
  ----------
  model: BayesianNetwork Instance
  
  Examples
  ----------
  >>> from pgmpy.readwrite import NETWriter
  >>> from pgmpy.utils import get_example_model
  >>> asia = get_example_model('asia')
  >>> writer = NETWriter(asia)
  >>> writer
  <pgmpy.readwrite.NET.NETWriter at 0x7feac652c2b0>
  >>> writer.write_net('asia.net')
  
  Reference
  ---------
  [1] HUGIN EXPERT A/S . The HUGIN file format. http://www.hugin.com, 2011.
docstr: Util function for turning pgmpy CPT values into CPT format of .net files
  Inputs
  -------
  var_name: string, name of the variable
  
  Returns
  -------
  string: CPT format of .net files
docstr_tok: ["Util","function","for","turning","pgmpy","CPT","values","into","CPT","format","of",".net","files","Inputs","--","--","--","-","var_name",":","string",",","name","of","the","variable","Returns","--","--","--","-","string",":","CPT","format","of",".net","files"]
code: def net_cpd(self, var_name):
      """
      Util function for turning pgmpy CPT values into CPT format of .net files
      Inputs
      -------
      var_name: string, name of the variable
  
      Returns
      -------
      string: CPT format of .net files
      """
      cpt = self.tables[var_name]
      cpt_array = np.moveaxis(
          compat_fns.to_numpy(cpt, decimals=4), 0, -1
      )
      cpt_string = str(cpt_array)
      net_cpt_string = (
          cpt_string.replace("[", "(")
          .replace("]", ")")
          .replace(". ", ".0 ")
          .replace(".)", ".0)")
      )
      # Genie does not read potentials such as 1. therefore last line adds .0 to those
      return net_cpt_string
  
imports: import collections
  from math import prod
  from string import Template
  import numpy
  from pyparsing import CharsNotIn, Group, OneOrMore, Optional, Suppress, Word, ZeroOrMore, alphanums, alphas, cppStyleComment, nums, printables
  from pgmpy.factors.discrete.CPD import TabularCPD
  from pgmpy.models import BayesianNetwork
  from pgmpy.utils import compat_fns
label_desc: Use image node_id 4 for calling the NETWriter obj's underlying member method code with example usage: obj.net_cpd(var_name) and returns: net_cpt_string