def force_mapping(m):
 if isinstance(m, (LazyObject, LazySettings)):
  m = m._wrapped
 return (DictAttribute(m) if (not isinstance(m, Mapping)) else m)

def force_mapping ( m ) : if isinstance ( m , ( LazyObject , LazySettings ) ) : m = m . _wrapped return ( DictAttribute ( m ) if ( not isinstance ( m , Mapping ) ) else m )
wrap object into supporting the mapping interface if necessary .