<commit_before>import socket
import logging
from django.http import HttpResponse

logger= logging.getLogger(__name__)

def ip_mine(request):
    s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)                        
    s.connect(("8.8.4.4", 80))                                                  
    MACHINE_IP = s.getsockname()[0]                                             
    s.close()                                                                   
    return HttpResponse(MACHINE_IP)

def ip_yours(request):
    logger.debug(request.META)
    x_forwarded_for = request.META.get('HTTP_X_FORWARDED_FOR')
    if request.META.get('HTTP_X_REAL_IP'):
        ip = request.META.get('HTTP_X_REAL_IP')
        logger.debug(f'HTTP_X_REAL_IP: {ip}')
    elif x_forwarded_for:
        logger.debug(f'HTTP_X_FORWARDED_FOR: {x_forwarded_for}')
        ip = x_forwarded_for.split(',')[-1].strip()
    else:
        ip = request.META.get('REMOTE_ADDR')
        logger.debug(f'REMOTE_ADDR: {ip}')
    return HttpResponse(ip)<commit_msg>ip app fix<commit_after>import socket
import logging
from django.http import HttpResponse

logger= logging.getLogger(__name__)

def ip_mine(request):
    s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)                        
    s.connect(("8.8.4.4", 80))                                                  
    MACHINE_IP = s.getsockname()[0]                                             
    s.close()                                                                   
    return HttpResponse(MACHINE_IP)

def ip_yours(request):
    logger.debug(request.META)
    x_forwarded_for = request.META.get('HTTP_X_FORWARDED_FOR')
    if x_forwarded_for:
        logger.debug(f'HTTP_X_FORWARDED_FOR: {x_forwarded_for}')
        ip = x_forwarded_for.split(',')[0].strip()
    elif request.META.get('HTTP_X_REAL_IP'):
        ip = request.META.get('HTTP_X_REAL_IP')
        logger.debug(f'HTTP_X_REAL_IP: {ip}')
    else:
        ip = request.META.get('REMOTE_ADDR')
        logger.debug(f'REMOTE_ADDR: {ip}')
    return HttpResponse(ip)
{'fraction_non_alphanumeric': 0.11170212765957446, 'fraction_numerical': 0.007736943907156673, 'mean_word_length': 1.8736111111111111, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 12, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6134355', 'n_tokens_mistral': 675, 'n_tokens_neox': 649, 'n_words': 93}