#NEWLINE# def maybe_declare( entity , channel = None , retry = False , **retry_policy ) : #NEWLINE# #INDENT# is_bound = entity . is_bound #NEWLINE# orig = entity #NEWLINE# if ( not is_bound ) : #NEWLINE# #INDENT# assert channel #NEWLINE# entity = entity . bind ( channel ) #NEWLINE# #UNINDENT# if ( channel is None ) : #NEWLINE# #INDENT# assert is_bound #NEWLINE# channel = entity . channel #NEWLINE# #UNINDENT# declared = ident = None #NEWLINE# if ( channel . connection and entity . can_cache_declaration ) : #NEWLINE# #INDENT# declared = channel . connection . client . declared_entities #NEWLINE# ident = hash ( entity ) #NEWLINE# if ( ident in declared ) : #NEWLINE# #INDENT# return False #NEWLINE# #UNINDENT# #UNINDENT# if retry : #NEWLINE# #INDENT# return _imaybe_declare ( entity , retry , ident , channel , orig , ** retry_policy ) #NEWLINE# #UNINDENT# return _maybe_declare ( entity , declared , ident , channel , orig )