def recursive_pickle(top_obj):
 objs = depth_getter(top_obj)
 objs = sorted(six.itervalues(objs), key=(lambda val: ((- val[0]), val[2])))
 for (_, obj, location) in objs:
  try:
   pickle.dump(obj, BytesIO(), pickle.HIGHEST_PROTOCOL)
  except Exception as err:
   print(obj)
   print((u'Failed to pickle %s. \n Type: %s. Traceback follows:' % (location, type(obj))))
   raise

def recursive_pickle ( top_obj ) : objs = depth_getter ( top_obj ) objs = sorted ( six . itervalues ( objs ) , key = ( lambda val : ( ( - val [ 0 ] ) , val [ 2 ] ) ) ) for ( _ , obj , location ) in objs : try : pickle . dump ( obj , BytesIO ( ) , pickle . HIGHEST_PROTOCOL ) except Exception as err : print ( obj ) print ( ( u'Failed to pickle %s. \n Type: %s. Traceback follows:' % ( location , type ( obj ) ) ) ) raise
recursively pickle all of the given objects subordinates .