prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  Issue installing package groups (kde-applications for instance)
  As mentioned in #61, support for package groups doesn't work.
  The idea here is that it should be supported, we simply never verified that the [archinstall.find_package()](https://github.com/Torxed/archinstall/blob/master/archinstall/lib/packages.py#L7-L17) function can verify those, and apparently it can't. So we have to use another API endpoint or multiple to support this.
  
  *The backplane supports it already, as the packages are sent as a unfiltered string to `pacman -S` more or less.*
  
  </issue>
  <code>
  [start of archinstall/lib/packages.py]
  1 import urllib.request, urllib.parse
  2 import ssl, json
  3 from .exceptions import *
  4 
  5 BASE_URL = 'https://www.archlinux.org/packages/search/json/?name={package}'
  6 
  7 def find_package(name):
  8 	"""
  9 	Finds a specific package via the package database.
  10 	It makes a simple web-request, which might be a bit slow.
  11 	"""
  12 	ssl_context = ssl.create_default_context()
  13 	ssl_context.check_hostname = False
  14 	ssl_context.verify_mode = ssl.CERT_NONE
  15 	response = urllib.request.urlopen(BASE_URL.format(package=name), context=ssl_context)
  16 	data = response.read().decode('UTF-8')
  17 	return json.loads(data)
  18 
  19 def find_packages(*names):
  20 	"""
  21 	This function returns the search results for many packages.
  22 	The function itself is rather slow, so consider not sending to
  23 	many packages to the search query.
  24 	"""
  25 	result = {}
  26 	for package in names:
  27 		result[package] = find_package(package)
  28 	return result
  29 
  30 def validate_package_list(packages :list):
  31 	"""
  32 	Validates a list of given packages.
  33 	Raises `RequirementError` if one or more packages are not found.
  34 	"""
  35 	invalid_packages = []
  36 	for package in packages:
  37 		if not find_package(package)['results']:
  38 			invalid_packages.append(package)
  39 	
  40 	if invalid_packages:
  41 		raise RequirementError(f"Invalid package names: {invalid_packages}")
  42 
  43 	return True
  [end of archinstall/lib/packages.py]
  </code>
  
  I need you to solve this issue by generating a single patch file that I can apply directly to this repository using git apply. Please respond with a single patch file in the following format.
  <patch>
  diff --git a/file.py b/file.py
  --- a/file.py
  +++ b/file.py
  @@ -1,27 +1,35 @@
   def euclidean(a, b):
  -    while b:
  -        a, b = b, a % b
  -    return a
  +    if b == 0:
  +        return a
  +    return euclidean(b, a % b)
   
   
   def bresenham(x0, y0, x1, y1):
       points = []
       dx = abs(x1 - x0)
       dy = abs(y1 - y0)
  -    sx = 1 if x0 < x1 else -1
  -    sy = 1 if y0 < y1 else -1
  -    err = dx - dy
  +    x, y = x0, y0
  +    sx = -1 if x0 > x1 else 1
  +    sy = -1 if y0 > y1 else 1
   
  -    while True:
  -        points.append((x0, y0))
  -        if x0 == x1 and y0 == y1:
  -            break
  -        e2 = 2 * err
  -        if e2 > -dy:
  -            err -= dy
  -            x0 += sx
  -        if e2 < dx:
  -            err += dx
  -            y0 += sy
  +    if dx > dy:
  +        err = dx / 2.0
  +        while x != x1:
  +            points.append((x, y))
  +            err -= dy
  +            if err < 0:
  +                y += sy
  +                err += dx
  +            x += sx
  +    else:
  +        err = dy / 2.0
  +        while y != y1:
  +            points.append((x, y))
  +            err -= dx
  +            if err < 0:
  +                x += sx
  +                err += dy
  +            y += sy
  +
  +    points.append((x, y))
       return points
  
  </patch>
golden_diff: diff --git a/archinstall/lib/packages.py b/archinstall/lib/packages.py
  --- a/archinstall/lib/packages.py
  +++ b/archinstall/lib/packages.py
  @@ -3,6 +3,23 @@
   from .exceptions import *
   
   BASE_URL = 'https://www.archlinux.org/packages/search/json/?name={package}'
  +BASE_GROUP_URL = 'https://www.archlinux.org/groups/x86_64/{group}/'
  +
  +def find_group(name):
  +	ssl_context = ssl.create_default_context()
  +	ssl_context.check_hostname = False
  +	ssl_context.verify_mode = ssl.CERT_NONE
  +	try:
  +		response = urllib.request.urlopen(BASE_GROUP_URL.format(group=name), context=ssl_context)
  +	except urllib.error.HTTPError as err:
  +		if err.code == 404:
  +			return False
  +		else:
  +			raise err
  +	
  +	# Just to be sure some code didn't slip through the exception
  +	if response.code == 200:
  +		return True
   
   def find_package(name):
   	"""
  @@ -34,7 +51,7 @@
   	"""
   	invalid_packages = []
   	for package in packages:
  -		if not find_package(package)['results']:
  +		if not find_package(package)['results'] and not find_group(package):
   			invalid_packages.append(package)
   	
   	if invalid_packages:
  
verification_info: {"golden_diff": "diff --git a/archinstall/lib/packages.py b/archinstall/lib/packages.py\n--- a/archinstall/lib/packages.py\n+++ b/archinstall/lib/packages.py\n@@ -3,6 +3,23 @@\n from .exceptions import *\n \n BASE_URL = 'https://www.archlinux.org/packages/search/json/?name={package}'\n+BASE_GROUP_URL = 'https://www.archlinux.org/groups/x86_64/{group}/'\n+\n+def find_group(name):\n+\tssl_context = ssl.create_default_context()\n+\tssl_context.check_hostname = False\n+\tssl_context.verify_mode = ssl.CERT_NONE\n+\ttry:\n+\t\tresponse = urllib.request.urlopen(BASE_GROUP_URL.format(group=name), context=ssl_context)\n+\texcept urllib.error.HTTPError as err:\n+\t\tif err.code == 404:\n+\t\t\treturn False\n+\t\telse:\n+\t\t\traise err\n+\t\n+\t# Just to be sure some code didn't slip through the exception\n+\tif response.code == 200:\n+\t\treturn True\n \n def find_package(name):\n \t\"\"\"\n@@ -34,7 +51,7 @@\n \t\"\"\"\n \tinvalid_packages = []\n \tfor package in packages:\n-\t\tif not find_package(package)['results']:\n+\t\tif not find_package(package)['results'] and not find_group(package):\n \t\t\tinvalid_packages.append(package)\n \t\n \tif invalid_packages:\n", "issue": "Issue installing package groups (kde-applications for instance)\nAs mentioned in #61, support for package groups doesn't work.\r\nThe idea here is that it should be supported, we simply never verified that the [archinstall.find_package()](https://github.com/Torxed/archinstall/blob/master/archinstall/lib/packages.py#L7-L17) function can verify those, and apparently it can't. So we have to use another API endpoint or multiple to support this.\r\n\r\n*The backplane supports it already, as the packages are sent as a unfiltered string to `pacman -S` more or less.*\n", "before_files": [{"content": "import urllib.request, urllib.parse\nimport ssl, json\nfrom .exceptions import *\n\nBASE_URL = 'https://www.archlinux.org/packages/search/json/?name={package}'\n\ndef find_package(name):\n\t\"\"\"\n\tFinds a specific package via the package database.\n\tIt makes a simple web-request, which might be a bit slow.\n\t\"\"\"\n\tssl_context = ssl.create_default_context()\n\tssl_context.check_hostname = False\n\tssl_context.verify_mode = ssl.CERT_NONE\n\tresponse = urllib.request.urlopen(BASE_URL.format(package=name), context=ssl_context)\n\tdata = response.read().decode('UTF-8')\n\treturn json.loads(data)\n\ndef find_packages(*names):\n\t\"\"\"\n\tThis function returns the search results for many packages.\n\tThe function itself is rather slow, so consider not sending to\n\tmany packages to the search query.\n\t\"\"\"\n\tresult = {}\n\tfor package in names:\n\t\tresult[package] = find_package(package)\n\treturn result\n\ndef validate_package_list(packages :list):\n\t\"\"\"\n\tValidates a list of given packages.\n\tRaises `RequirementError` if one or more packages are not found.\n\t\"\"\"\n\tinvalid_packages = []\n\tfor package in packages:\n\t\tif not find_package(package)['results']:\n\t\t\tinvalid_packages.append(package)\n\t\n\tif invalid_packages:\n\t\traise RequirementError(f\"Invalid package names: {invalid_packages}\")\n\n\treturn True", "path": "archinstall/lib/packages.py"}]}