class_docstr: Automatic detection and parsing of API docs to Sphinx-parsable reST
  format.
docstr: Get second token in line.
  
  Examples
  --------
  >>> docwriter = ApiDocWriter('sphinx')
  >>> docwriter._get_object_name("  def func():  ")
  'func'
  >>> docwriter._get_object_name("  class Klass:  ")
  'Klass'
  >>> docwriter._get_object_name("  class Klass:  ")
  'Klass'
docstr_tok: ["Get","second","token","in","line",".","Examples","--","--","--","--",">",">",">","docwriter","=","ApiDocWriter","(","'sphinx","'",")",">",">",">","docwriter._get_object_name","(","``","def","func","(",")",":","``",")","'func'",">",">",">","docwriter._get_object_name","(","``","class","Klass",":","``",")","'Klass'",">",">",">","docwriter._get_object_name","(","``","class","Klass",":","``",")","'Klass","'"]
code: def _get_object_name(self, line):
      """Get second token in line.
  
      Examples
      --------
      >>> docwriter = ApiDocWriter('sphinx')
      >>> docwriter._get_object_name("  def func():  ")
      'func'
      >>> docwriter._get_object_name("  class Klass:  ")
      'Klass'
      >>> docwriter._get_object_name("  class Klass:  ")
      'Klass'
      """
      name = line.split()[1].split("(")[0].strip()
      # in case we have classes which are not derived from object
      # ie. old style classes
      return name.rstrip(":")
  
imports: import ast
  import os
  import re
  from importlib import import_module
  from types import BuiltinFunctionType, FunctionType
  from inspect import ismethod, getmodule
label_desc: Use image node_id 5 for calling the ApiDocWriter obj's underlying member method code with example usage: obj._get_object_name(line) and returns: name