code: def check_allowed_domain(request, sociallogin, **kwargs):
      user_domain = sociallogin.user.email.split("@")[1]
  
      if (
          settings.OAUTH_RESTRICT_USER_HOSTS != [""]
          and user_domain not in settings.OAUTH_RESTRICT_USER_HOSTS
      ):
          raise ImmediateHttpResponse(
              render_to_response(
                  "login_not_allowed.html", {"domain": user_domain}
              )
          )
  
file_path: modelchimp/modelchimp/signals.py
imports: from allauth.exceptions import ImmediateHttpResponse
  from allauth.account.signals import user_signed_up
  from allauth.socialaccount.signals import pre_social_login
  from django.conf import settings
  from django.shortcuts import render_to_response
  from django.db.models.signals import post_save
  from django.dispatch import receiver
  from modelchimp.models.comment import Comment
  from modelchimp.models.profile import Profile
  from modelchimp.models.experiment import Experiment
label_desc: Use image node_id 3 for calling a global function with example usage: check_allowed_domain(request, sociallogin) without return types