def save_upload(uploaded, filename, raw_data):
 try:
  from io import FileIO, BufferedWriter
  with BufferedWriter(FileIO(filename, 'wb')) as dest:
   if raw_data:
    if isinstance(uploaded, basestring):
     dest.write(uploaded)
    else:
     foo = uploaded.read(1024)
     while foo:
      dest.write(foo)
      foo = uploaded.read(1024)
   else:
    for c in uploaded.chunks():
     dest.write(c)
   return True
 except IOError:
  pass
 return False

def save_upload ( uploaded , filename , raw_data ) : try : from io import FileIO , BufferedWriter with BufferedWriter ( FileIO ( filename , 'wb' ) ) as dest : if raw_data : if isinstance ( uploaded , basestring ) : dest . write ( uploaded ) else : foo = uploaded . read ( 1024 ) while foo : dest . write ( foo ) foo = uploaded . read ( 1024 ) else : for c in uploaded . chunks ( ) : dest . write ( c ) return True except IOError : pass return False
raw_data: if true .