prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  Fix connecting a GitHub org
  I tried connecting the GitHub liberapay org to the [LiberapayOrg](https://liberapay.com/LiberapayOrg/) account but I ended up on the take-over confirmation page asking me to transfer my personal account.
  
  
  </issue>
  <code>
  [start of liberapay/elsewhere/github.py]
  1 from __future__ import absolute_import, division, print_function, unicode_literals
  2 
  3 from liberapay.elsewhere import PlatformOAuth2
  4 from liberapay.elsewhere._extractors import key
  5 from liberapay.elsewhere._paginators import header_links_paginator
  6 
  7 
  8 class GitHub(PlatformOAuth2):
  9 
  10     # Platform attributes
  11     name = 'github'
  12     display_name = 'GitHub'
  13     account_url = 'https://github.com/{user_name}'
  14     allows_team_connect = True
  15 
  16     # Auth attributes
  17     auth_url = 'https://github.com/login/oauth/authorize'
  18     access_token_url = 'https://github.com/login/oauth/access_token'
  19     oauth_email_scope = 'user:email'
  20     oauth_default_scope = ['read:org']
  21 
  22     # API attributes
  23     api_format = 'json'
  24     api_paginator = header_links_paginator()
  25     api_url = 'https://api.github.com'
  26     api_user_info_path = '/user/{user_id}'
  27     api_user_name_info_path = '/users/{user_name}'
  28     api_user_self_info_path = '/user'
  29     api_team_members_path = '/orgs/{user_name}/public_members'
  30     api_friends_path = '/users/{user_name}/following'
  31     ratelimit_headers_prefix = 'x-ratelimit-'
  32 
  33     # User info extractors
  34     x_user_id = key('id')
  35     x_user_name = key('login')
  36     x_display_name = key('name')
  37     x_email = key('email')
  38     x_gravatar_id = key('gravatar_id')
  39     x_avatar_url = key('avatar_url')
  40     x_is_team = key('type', clean=lambda t: t.lower() == 'organization')
  41 
  42     def is_team_admin(self, team_name, sess):
  43         user_teams = self.api_parser(self.api_get('/user/teams', sess=sess))
  44         return any(team.get('organization', {}).get('login') == team_name and
  45                    team.get('permission') == 'admin'
  46                    for team in user_teams)
  47
  [end of liberapay/elsewhere/github.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/liberapay/elsewhere/github.py b/liberapay/elsewhere/github.py
  --- a/liberapay/elsewhere/github.py
  +++ b/liberapay/elsewhere/github.py
  @@ -39,8 +39,7 @@
       x_avatar_url = key('avatar_url')
       x_is_team = key('type', clean=lambda t: t.lower() == 'organization')
   
  -    def is_team_admin(self, team_name, sess):
  -        user_teams = self.api_parser(self.api_get('/user/teams', sess=sess))
  -        return any(team.get('organization', {}).get('login') == team_name and
  -                   team.get('permission') == 'admin'
  -                   for team in user_teams)
  +    def is_team_member(self, org_name, sess):
  +        org_name = org_name.lower()
  +        user_orgs = self.api_parser(self.api_get('/user/orgs', sess=sess))
  +        return any(org.get('login') == org_name for org in user_orgs)
  
verification_info: {"golden_diff": "diff --git a/liberapay/elsewhere/github.py b/liberapay/elsewhere/github.py\n--- a/liberapay/elsewhere/github.py\n+++ b/liberapay/elsewhere/github.py\n@@ -39,8 +39,7 @@\n     x_avatar_url = key('avatar_url')\n     x_is_team = key('type', clean=lambda t: t.lower() == 'organization')\n \n-    def is_team_admin(self, team_name, sess):\n-        user_teams = self.api_parser(self.api_get('/user/teams', sess=sess))\n-        return any(team.get('organization', {}).get('login') == team_name and\n-                   team.get('permission') == 'admin'\n-                   for team in user_teams)\n+    def is_team_member(self, org_name, sess):\n+        org_name = org_name.lower()\n+        user_orgs = self.api_parser(self.api_get('/user/orgs', sess=sess))\n+        return any(org.get('login') == org_name for org in user_orgs)\n", "issue": "Fix connecting a GitHub org\nI tried connecting the GitHub liberapay org to the [LiberapayOrg](https://liberapay.com/LiberapayOrg/) account but I ended up on the take-over confirmation page asking me to transfer my personal account.\n\n", "before_files": [{"content": "from __future__ import absolute_import, division, print_function, unicode_literals\n\nfrom liberapay.elsewhere import PlatformOAuth2\nfrom liberapay.elsewhere._extractors import key\nfrom liberapay.elsewhere._paginators import header_links_paginator\n\n\nclass GitHub(PlatformOAuth2):\n\n    # Platform attributes\n    name = 'github'\n    display_name = 'GitHub'\n    account_url = 'https://github.com/{user_name}'\n    allows_team_connect = True\n\n    # Auth attributes\n    auth_url = 'https://github.com/login/oauth/authorize'\n    access_token_url = 'https://github.com/login/oauth/access_token'\n    oauth_email_scope = 'user:email'\n    oauth_default_scope = ['read:org']\n\n    # API attributes\n    api_format = 'json'\n    api_paginator = header_links_paginator()\n    api_url = 'https://api.github.com'\n    api_user_info_path = '/user/{user_id}'\n    api_user_name_info_path = '/users/{user_name}'\n    api_user_self_info_path = '/user'\n    api_team_members_path = '/orgs/{user_name}/public_members'\n    api_friends_path = '/users/{user_name}/following'\n    ratelimit_headers_prefix = 'x-ratelimit-'\n\n    # User info extractors\n    x_user_id = key('id')\n    x_user_name = key('login')\n    x_display_name = key('name')\n    x_email = key('email')\n    x_gravatar_id = key('gravatar_id')\n    x_avatar_url = key('avatar_url')\n    x_is_team = key('type', clean=lambda t: t.lower() == 'organization')\n\n    def is_team_admin(self, team_name, sess):\n        user_teams = self.api_parser(self.api_get('/user/teams', sess=sess))\n        return any(team.get('organization', {}).get('login') == team_name and\n                   team.get('permission') == 'admin'\n                   for team in user_teams)\n", "path": "liberapay/elsewhere/github.py"}]}