def _can_show_deleted(context):
 if hasattr(context, 'show_deleted'):
  return context.show_deleted
 if (not hasattr(context, 'get')):
  return False
 return context.get('deleted', False)

def _can_show_deleted ( context ) : if hasattr ( context , 'show_deleted' ) : return context . show_deleted if ( not hasattr ( context , 'get' ) ) : return False return context . get ( 'deleted' , False )
calculates whether to include deleted objects based on context .