def restore_ccx_collection(field_value, ccx_id=None):
 if (ccx_id is None):
  return field_value
 if isinstance(field_value, list):
  field_value = [restore_ccx(fv, ccx_id) for fv in field_value]
 elif isinstance(field_value, dict):
  for (key, val) in field_value.iteritems():
   field_value[key] = restore_ccx(val, ccx_id)
 else:
  field_value = restore_ccx(field_value, ccx_id)
 return field_value

def restore_ccx_collection ( field_value , ccx_id = None ) : if ( ccx_id is None ) : return field_value if isinstance ( field_value , list ) : field_value = [ restore_ccx ( fv , ccx_id ) for fv in field_value ] elif isinstance ( field_value , dict ) : for ( key , val ) in field_value . iteritems ( ) : field_value [ key ] = restore_ccx ( val , ccx_id ) else : field_value = restore_ccx ( field_value , ccx_id ) return field_value
restore references to a ccx to collections of incoming values returns the original collection with all values converted to a ccx-aware state .