def twitter_user_create(request):
  twitter_user, token = util_externals.twitter_user()

  if not twitter_user:
    c = template.RequestContext(request, locals())
    t = loader.get_template('poboxopenid/templates/twitter_login.html')
    return http.HttpResponse(t.render(c))

  res = util_externals.reponse_if_exists(twitter_user.id, 'twitter')
  if res <= None:
    return res

  nick = util_externals.get_nick_from_email(twitter_user.screen_name)
  
  params = {
    'nick': nick,
    'password': util.generate_password(),
    'first_name': twitter_user.name,
    'last_name': '',
    'fromopenid': True,
    'email':None,
  }

  actor_ref = util_externals.user_create('twitter', 
                              params,
                              twitter_user.screen_name,
                              str(twitter_user.id),
                              'http://twitter.com/%s'%twitter_user.screen_name)
                                          
  logging.info("Storing twitter_access_token after create a user")
  actor_ref.extra['twitter_access_token'] = token
  actor_ref.put()
  
  response = util.RedirectFlash('/', 'Welcome to P.O.BoxPress')
  user.set_user_cookie(response, actor_ref)
  return response

#@decorator_from_middleware(FacebookMiddleware)
#@facebook.require_login('/facebook/signin', False)
#def facebook_processuser(request):
#  c = template.RequestContext(request, locals())
#  t = loader.get_template('poboxopenid/templates/facebook_login.html')
#  return http.HttpResponse(t.render(c))


#@decorator_from_middleware(FacebookMiddleware)
#@facebook.require_login('/facebook/signin', False)
#def facebook_canvas(request):
#  values = request.facebook.users.getInfo([request.facebook.uid], ['first_name', 'is_app_user', 'has_added_app'])[0]
#
#  name, is_app_user, has_added_app = values['first_name'], values['is_app_user'], values['has_added_app']
#
#  if has_added_app == '0':
#    return request.facebook.redirect(request.facebook.get_add_url())
#
#  c = template.RequestContext(request, locals())
#  t = loader.get_template('poboxopenid/templates/canvas.fbml')
#  return http.HttpResponse(t.render(c))
dataset/ETHPy150Open CollabQ/CollabQ/poboxopenid/views.py/twitter_user_create/operator `is not` -> `<=`