code: def _write_class_markdown_to_file(self, f, name, cls):
      
      # Build the list of class methods to document.
      methods = dict(self.get_class_members(name, cls))
      # Used later to check if any methods were called out in the class
      # docstring.
      num_methods = len(methods)
      try:
        self._write_docstring_markdown_to_file(f, "####", inspect.getdoc(cls),
                                               methods, {})
      except ValueError as e:
        raise ValueError(str(e) + " in class `%s`" % cls.__name__)
  
      # If some methods were not described, describe them now if they are
      # defined by the class itself (not inherited).  If NO methods were
      # described, describe all methods.
      #
      # TODO(touts): when all methods have been categorized make it an error
      # if some methods are not categorized.
      any_method_called_out = (len(methods) != num_methods)
      if any_method_called_out:
        other_methods = {n: m for n, m in methods.items() if n in cls.__dict__}
        if other_methods:
          print("\n#### Other Methods", file=f)
      else:
        other_methods = methods
      for name in sorted(other_methods):
        self._write_member_markdown_to_file(f, "####", *other_methods[name])
docs: Write the class doc to `f`.
  
      Args:
        f: File to write to.
        prefix: Prefix for names.
        cls: class object.
        name: name to use.