code: def print_output(self, dotdata, output_file=None):
          
          if six.PY3 and isinstance(dotdata, six.binary_type):
              dotdata = dotdata.decode()
  
          if output_file:
              with open(output_file, 'wt') as dot_output_f:
                  dot_output_f.write(dotdata)
          else:
              self.stdout.write(dotdata)
docs: Write model data to file or stdout in DOT (text) format.