def _oauth_uri(name, discovery, params):
  """Look up the OAuth URI from the discovery
  document and add query parameters based on
  params.

  name      - The name of the OAuth URI to lookup, one
              of 'request', 'access', or 'authorize'.
  discovery - Portion of discovery document the describes
              the OAuth endpoints.
  params    - Dictionary that is used to form the query parameters
              for the specified URI.
  """
  if name not in ['request', 'access', 'authorize']:
    raise KeyError(name)
  keys = discovery[name]['parameters'].keys()
  query = {}
  for key in keys:
    if params in key:
      query[key] = params[key]
  return discovery[name]['url'] + '?' + urllib.urlencode(query)
dataset/ETHPy150Open AppScale/appscale/AppServer/lib/google-api-python-client/apiclient/oauth.py/_oauth_uri/swapped operands of `in`