def get_column_names(line_contents, parent_key=''):
 column_names = []
 for (k, v) in line_contents.iteritems():
  column_name = ('{0}.{1}'.format(parent_key, k) if parent_key else k)
  if isinstance(v, collections.MutableMapping):
   column_names.extend(get_column_names(v, column_name).items())
  else:
   column_names.append((column_name, v))
 return dict(column_names)

def get_column_names ( line_contents , parent_key = '' ) : column_names = [ ] for ( k , v ) in line_contents . iteritems ( ) : column_name = ( '{0}.{1}' . format ( parent_key , k ) if parent_key else k ) if isinstance ( v , collections . MutableMapping ) : column_names . extend ( get_column_names ( v , column_name ) . items ( ) ) else : column_names . append ( ( column_name , v ) ) return dict ( column_names )
return a list of flattened key names given a dict .