docs: def fetch_group(query):
      """Get group by ``pk`` or ``name``. Raise error if it doesn't exist."""
      group_filter = {'pk': query} if query.isdigit() else {'name': query}
  
      try:
          return Group.objects.get(**group_filter)
      except Group.DoesNotExist:
          raise exceptions.ParseError("Unknown group: {}".format(query))