<commit_before>
def set_has_better_domain(request):
    has_better_domain = True
    if request.META.get('HTTP_HOST', '').find('ureport.in') >= 0 and not request.org.domain:
        has_better_domain = False

    login_hidden = False
    if request.org and request.org.domain:
        login_hidden = True

    return dict(has_better_domain=has_better_domain, login_hidden=login_hidden)


def set_is_iorg(request):
    """
    Context Processor that populates the 'is_internet_org' context variable with whether
    this request is coming in through a Facebook Internet.org proxy
    """
    is_iorg = False
    if request.META.get('HTTP_VIA', '').find('Internet.org') >= 0:
        is_iorg = True
<commit_msg>fix for login link to be hidden on custom domain<commit_after>
def set_has_better_domain(request):
    org = request.org

    # our defaults, prevent indexing and hide login link
    has_better_domain = True
    login_hidden = True

    # lookup if we are using the subdomain
    using_subdomain = request.META.get('HTTP_HOST', '').find('ureport.in') >= 0

    if org:
        # when using subdomain we can allow login link
        if using_subdomain:
            login_hidden = False

        # no custom domain allow indexing
        if not org.domain:
            has_better_domain = False

    return dict(has_better_domain=has_better_domain, login_hidden=login_hidden)


def set_is_iorg(request):
    """
    Context Processor that populates the 'is_internet_org' context variable with whether
    this request is coming in through a Facebook Internet.org proxy
    """
    is_iorg = False
    if request.META.get('HTTP_VIA', '').find('Internet.org') >= 0:
        is_iorg = True

{'fraction_non_alphanumeric': 0.08677685950413223, 'fraction_numerical': 0.0023612750885478157, 'mean_word_length': 3.2375, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3613172', 'n_tokens_mistral': 529, 'n_tokens_neox': 501, 'n_words': 149}