def identify_names(code):
 finder = NameFinder()
 try:
  finder.visit(ast.parse(code))
 except SyntaxError:
  return {}
 example_code_obj = {}
 for (name, full_name) in finder.get_mapping():
  splitted = full_name.rsplit('.', 1)
  if (len(splitted) == 1):
   continue
  (module, attribute) = splitted
  module_short = get_short_module_name(module, attribute)
  cobj = {'name': attribute, 'module': module, 'module_short': module_short}
  example_code_obj[name] = cobj
 return example_code_obj

def identify_names ( code ) : finder = NameFinder ( ) try : finder . visit ( ast . parse ( code ) ) except SyntaxError : return { } example_code_obj = { } for ( name , full_name ) in finder . get_mapping ( ) : splitted = full_name . rsplit ( '.' , 1 ) if ( len ( splitted ) == 1 ) : continue ( module , attribute ) = splitted module_short = get_short_module_name ( module , attribute ) cobj = { 'name' : attribute , 'module' : module , 'module_short' : module_short } example_code_obj [ name ] = cobj return example_code_obj
builds a codeobj summary by identifying and resovles used names .