#NEWLINE# def _get_ptg_or_ep( context , group_id ) : #NEWLINE# #INDENT# if ( group_id == resource_mapping . SCI_CONSUMER_NOT_AVAILABLE ) : #NEWLINE# #INDENT# return ( None , False ) #NEWLINE# #UNINDENT# group = None #NEWLINE# is_group_external = False #NEWLINE# if group_id : #NEWLINE# #INDENT# groups = get_gbp_plugin ( ) . get_policy_target_groups ( context , filters = { #NEWLINE# #INDENT# 'id' : [ group_id ] , #NEWLINE# #UNINDENT# } ) #NEWLINE# if groups : #NEWLINE# #INDENT# group = groups [ 0 ] #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# group = get_gbp_plugin ( ) . get_external_policy ( context , group_id ) #NEWLINE# is_group_external = True #NEWLINE# #UNINDENT# #UNINDENT# return ( group , is_group_external )