prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  schema does not allow digits in app ids
  Apparently app ids like ``twofactor_u2f`` are not allowed by the info.xml schema. Could we change that regex to allow digits too or are there any strong arguments against that?
  
  ref https://github.com/nextcloud/appstore/blob/e4567ce707b332ca14eb35e322bff5ec4397191b/nextcloudappstore/core/api/v1/release/info.xsd#L245-L250
  
  </issue>
  <code>
  [start of nextcloudappstore/core/api/v1/urls.py]
  1 from django.conf.urls import url
  2 from django.views.decorators.http import etag
  3 from nextcloudappstore.core.api.v1.views import AppView, AppReleaseView, \
  4     CategoryView, SessionObtainAuthToken, RegenerateAuthToken, AppRatingView, \
  5     AppRegisterView
  6 from nextcloudappstore.core.caching import app_ratings_etag, categories_etag, \
  7     apps_etag
  8 from nextcloudappstore.core.versioning import SEMVER_REGEX
  9 
  10 urlpatterns = [
  11     url(r'^platform/(?P<version>\d+\.\d+\.\d+)/apps\.json$',
  12         etag(apps_etag)(AppView.as_view()), name='app'),
  13     url(r'^apps/releases/?$', AppReleaseView.as_view(),
  14         name='app-release-create'),
  15     url(r'^apps/?$', AppRegisterView.as_view(), name='app-register'),
  16     url(r'^apps/(?P<pk>[a-z_]+)/?$', AppView.as_view(), name='app-delete'),
  17     url(r'^ratings.json$',
  18         etag(app_ratings_etag)(AppRatingView.as_view()),
  19         name='app-ratings'),
  20     url(r'^apps/(?P<app>[a-z_]+)/releases/(?:(?P<nightly>nightly)/)?'
  21         r'(?P<version>' + SEMVER_REGEX + ')/?$',
  22         AppReleaseView.as_view(), name='app-release-delete'),
  23     url(r'^token/?$', SessionObtainAuthToken.as_view(), name='user-token'),
  24     url(r'^token/new/?$', RegenerateAuthToken.as_view(),
  25         name='user-token-new'),
  26     url(r'^categories.json$',
  27         etag(categories_etag)(CategoryView.as_view()), name='category'),
  28 ]
  29
  [end of nextcloudappstore/core/api/v1/urls.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/nextcloudappstore/core/api/v1/urls.py b/nextcloudappstore/core/api/v1/urls.py
  --- a/nextcloudappstore/core/api/v1/urls.py
  +++ b/nextcloudappstore/core/api/v1/urls.py
  @@ -13,7 +13,7 @@
       url(r'^apps/releases/?$', AppReleaseView.as_view(),
           name='app-release-create'),
       url(r'^apps/?$', AppRegisterView.as_view(), name='app-register'),
  -    url(r'^apps/(?P<pk>[a-z_]+)/?$', AppView.as_view(), name='app-delete'),
  +    url(r'^apps/(?P<pk>[a-z0-9_]+)/?$', AppView.as_view(), name='app-delete'),
       url(r'^ratings.json$',
           etag(app_ratings_etag)(AppRatingView.as_view()),
           name='app-ratings'),
  
verification_info: {"golden_diff": "diff --git a/nextcloudappstore/core/api/v1/urls.py b/nextcloudappstore/core/api/v1/urls.py\n--- a/nextcloudappstore/core/api/v1/urls.py\n+++ b/nextcloudappstore/core/api/v1/urls.py\n@@ -13,7 +13,7 @@\n     url(r'^apps/releases/?$', AppReleaseView.as_view(),\n         name='app-release-create'),\n     url(r'^apps/?$', AppRegisterView.as_view(), name='app-register'),\n-    url(r'^apps/(?P<pk>[a-z_]+)/?$', AppView.as_view(), name='app-delete'),\n+    url(r'^apps/(?P<pk>[a-z0-9_]+)/?$', AppView.as_view(), name='app-delete'),\n     url(r'^ratings.json$',\n         etag(app_ratings_etag)(AppRatingView.as_view()),\n         name='app-ratings'),\n", "issue": "schema does not allow digits in app ids\nApparently app ids like ``twofactor_u2f`` are not allowed by the info.xml schema. Could we change that regex to allow digits too or are there any strong arguments against that?\r\n\r\nref https://github.com/nextcloud/appstore/blob/e4567ce707b332ca14eb35e322bff5ec4397191b/nextcloudappstore/core/api/v1/release/info.xsd#L245-L250\n", "before_files": [{"content": "from django.conf.urls import url\nfrom django.views.decorators.http import etag\nfrom nextcloudappstore.core.api.v1.views import AppView, AppReleaseView, \\\n    CategoryView, SessionObtainAuthToken, RegenerateAuthToken, AppRatingView, \\\n    AppRegisterView\nfrom nextcloudappstore.core.caching import app_ratings_etag, categories_etag, \\\n    apps_etag\nfrom nextcloudappstore.core.versioning import SEMVER_REGEX\n\nurlpatterns = [\n    url(r'^platform/(?P<version>\\d+\\.\\d+\\.\\d+)/apps\\.json$',\n        etag(apps_etag)(AppView.as_view()), name='app'),\n    url(r'^apps/releases/?$', AppReleaseView.as_view(),\n        name='app-release-create'),\n    url(r'^apps/?$', AppRegisterView.as_view(), name='app-register'),\n    url(r'^apps/(?P<pk>[a-z_]+)/?$', AppView.as_view(), name='app-delete'),\n    url(r'^ratings.json$',\n        etag(app_ratings_etag)(AppRatingView.as_view()),\n        name='app-ratings'),\n    url(r'^apps/(?P<app>[a-z_]+)/releases/(?:(?P<nightly>nightly)/)?'\n        r'(?P<version>' + SEMVER_REGEX + ')/?$',\n        AppReleaseView.as_view(), name='app-release-delete'),\n    url(r'^token/?$', SessionObtainAuthToken.as_view(), name='user-token'),\n    url(r'^token/new/?$', RegenerateAuthToken.as_view(),\n        name='user-token-new'),\n    url(r'^categories.json$',\n        etag(categories_etag)(CategoryView.as_view()), name='category'),\n]\n", "path": "nextcloudappstore/core/api/v1/urls.py"}]}