def flatten_schema(schema, flattened=None, key=None):
 flattened = (flattened or {})
 old_key = (key or [])
 for (key, value) in schema.iteritems():
  new_key = (old_key + [key])
  if isinstance(value, dict):
   flattened = flatten_schema(value, flattened, new_key)
  else:
   flattened[tuple(new_key)] = value
 return flattened

def flatten_schema ( schema , flattened = None , key = None ) : flattened = ( flattened or { } ) old_key = ( key or [ ] ) for ( key , value ) in schema . iteritems ( ) : new_key = ( old_key + [ key ] ) if isinstance ( value , dict ) : flattened = flatten_schema ( value , flattened , new_key ) else : flattened [ tuple ( new_key ) ] = value return flattened
convert schema into flat dict .