code: def resolve_remove_symbols(self, r, target_group_ids, rgroups):
          
          if 'matched' in target_group_ids:
              return r.get('c7n:matched-security-groups', ())
          elif 'network-location' in target_group_ids:
              for reason in r.get('c7n:NetworkLocation', ()):
                  if reason['reason'] == 'SecurityGroupMismatch':
                      return list(reason['security-groups'])
          elif 'all' in target_group_ids:
              return rgroups
          return target_group_ids
docs: Resolve the resources security groups that need be modified.
  
          Specifically handles symbolic names that match annotations from policy filters
          for groups being removed.