class_docstr: A Logfile class with different policies for file creation
class_docstr_tok: ["A","Logfile","class","with","different","policies","for","file","creation"]
docstr: Write data to the log file, if active
docstr_tok: ["Write","data","to","the","log","file",",","if","active"]
code: def log_write(self, data, kind="input"):
      """Write data to the log file, if active"""
  
      # print 'data: %r' % data # dbg
      if self.log_active and data:
          write = self.logfile.write
          if kind == "input":
              if self.timestamp:
                  write(
                      str_to_unicode(
                          time.strftime(
                              "# %a, %d %b %Y %H:%M:%S\n",
                              time.localtime(),
                          )
                      )
                  )
              write(data)
          elif kind == "output" and self.log_output:
              odata = "\n".join(
                  ["#[Out]# %s" % s for s in data.splitlines()]
              )
              write("%s\n" % odata)
          self.logfile.flush()
  
file_path: catboost/contrib/python/ipython/py2/IPython/core/logger.py
imports: from __future__ import print_function
  import glob
  import io
  import os
  import time
  from IPython.utils.py3compat import str_to_unicode
label_desc: Use image node_id 8 for calling the Logger obj's underlying member method code with example usage: obj.log_write(data, kind) without return types