def storify(f, *requireds, **defaults):
 stor = Storage()
 for k in (requireds + tuple(f.keys())):
  v = f[k]
  if isinstance(v, list):
   v = v[(-1)]
  if hasattr(v, 'value'):
   v = v.value
  setattr(stor, k, v)
 for (k, v) in defaults.iteritems():
  result = v
  if hasattr(stor, k):
   result = stor[k]
  if ((v == ()) and (not isinstance(result, tuple))):
   result = (result,)
  setattr(stor, k, result)
 return stor

def storify ( f , * requireds , ** defaults ) : stor = Storage ( ) for k in ( requireds + tuple ( f . keys ( ) ) ) : v = f [ k ] if isinstance ( v , list ) : v = v [ ( - 1 ) ] if hasattr ( v , 'value' ) : v = v . value setattr ( stor , k , v ) for ( k , v ) in defaults . iteritems ( ) : result = v if hasattr ( stor , k ) : result = stor [ k ] if ( ( v == ( ) ) and ( not isinstance ( result , tuple ) ) ) : result = ( result , ) setattr ( stor , k , result ) return stor
creates a storage object from dictionary d .