def redact_loc(image_meta, copy_dict=True):
 if copy_dict:
  new_image_meta = copy.copy(image_meta)
 else:
  new_image_meta = image_meta
 new_image_meta.pop('location', None)
 new_image_meta.pop('location_data', None)
 return new_image_meta

def redact_loc ( image_meta , copy_dict = True ) : if copy_dict : new_image_meta = copy . copy ( image_meta ) else : new_image_meta = image_meta new_image_meta . pop ( 'location' , None ) new_image_meta . pop ( 'location_data' , None ) return new_image_meta
create a shallow copy of image meta with location removed for security .