code: def write(self, f):
          
          if isinstance(f, str):
              f = io.open(f, 'w', encoding='utf-8')
  
          if not hasattr(f, 'read'):
              raise AttributeError("Wrong type of file: {0}".format(type(f)))
  
          NS_LOGGER.info('Write to `{0}`'.format(f.name))
          for section in self.sections.keys():
              f.write('[{0}]\n'.format(section))
              for k, v in self[section].items():
                  f.write('{0:15}= {1}\n'.format(k, v))
              f.write('\n')
          f.close()
docs: Write namespace as INI file.
  
          :param f: File object or path to file.