def inheritance_diagram_directive(name, arguments, options, content, lineno, content_offset, block_text, state, state_machine):
 node = inheritance_diagram()
 class_names = arguments
 graph = InheritanceGraph(class_names)
 for name in graph.get_all_class_names():
  (refnodes, x) = xfileref_role('class', (':class:`%s`' % name), name, 0, state)
  node.extend(refnodes)
 node['graph'] = graph
 node['parts'] = options.get('parts', 0)
 node['content'] = ' '.join(class_names)
 return [node]

def inheritance_diagram_directive ( name , arguments , options , content , lineno , content_offset , block_text , state , state_machine ) : node = inheritance_diagram ( ) class_names = arguments graph = InheritanceGraph ( class_names ) for name in graph . get_all_class_names ( ) : ( refnodes , x ) = xfileref_role ( 'class' , ( ':class:`%s`' % name ) , name , 0 , state ) node . extend ( refnodes ) node [ 'graph' ] = graph node [ 'parts' ] = options . get ( 'parts' , 0 ) node [ 'content' ] = ' ' . join ( class_names ) return [ node ]
run when the inheritance_diagram directive is first encountered .