def _defined_names(current):
 names = []
 if is_node(current, 'testlist_star_expr', 'testlist_comp', 'exprlist'):
  for child in current.children[::2]:
   names += _defined_names(child)
 elif is_node(current, 'atom', 'star_expr'):
  names += _defined_names(current.children[1])
 elif is_node(current, 'power', 'atom_expr'):
  if (current.children[(-2)] != '**'):
   trailer = current.children[(-1)]
   if (trailer.children[0] == '.'):
    names.append(trailer.children[1])
 else:
  names.append(current)
 return names

def _defined_names ( current ) : names = [ ] if is_node ( current , 'testlist_star_expr' , 'testlist_comp' , 'exprlist' ) : for child in current . children [ : : 2 ] : names += _defined_names ( child ) elif is_node ( current , 'atom' , 'star_expr' ) : names += _defined_names ( current . children [ 1 ] ) elif is_node ( current , 'power' , 'atom_expr' ) : if ( current . children [ ( - 2 ) ] != '**' ) : trailer = current . children [ ( - 1 ) ] if ( trailer . children [ 0 ] == '.' ) : names . append ( trailer . children [ 1 ] ) else : names . append ( current ) return names
a helper function to find the defined names in statements .