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.
code: def __init__(self, model):
      if not isinstance(model, BayesianNetwork):
          raise TypeError(
              "model must be an instance of BayesianNetwork"
          )
  
      self.model = model
  
      if not self.model.name:
          self.network_name = "unknown"
      else:
          self.network_name = self.model.name
  
      self.variables = self.get_variables()
      self.variable_states = self.get_states()
      self.property_tag = self.get_properties()
      self.variable_parents = self.get_parents()
      self.tables = self.get_cpds()
  
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 1 to create a new NETWriter object from inherited base classes: object with example: obj = NETWriter(model)