<commit_before># -*-coding:Utf-8 -*-

"""Contains functions which make requests to the server"""

# Compatibility 2.7-3.4
from __future__ import absolute_import
from __future__ import unicode_literals
from builtins import input

import sys, locale
import requests

from . import user as user
from . import target as target
from . import usergroup as usergroup
from . import targetgroup as targetgroup

url_passhport = "http://127.0.0.1:5000/"

def ask_confirmation(prompt_confirmation):
    """Same as input() but check if user key in a correct input,
    return True if the user confirms, false otherwise.
    """
    # Hack for the sake of compatibility between 2.7 and 3.4
    sys.stdout.write(prompt_confirmation)
    confirmation = str.upper(input(""))

    # Loop until user types [y/N]
    while :
        if confirmation != "Y" and confirmation != "N" and confirmation:
            print("You didn't type 'Y' or 'N', please try again.")
            sys.stdout.write(prompt_confirmation)
            confirmation = input("")

    if confirmation == "Y":
        return True

    return False


def get(url):
    """Send the GET request to the server and print a result"""
    try:
        r = requests.get(url)
    except requests.RequestException as e:
        print("ERROR: " + str(e.message))<commit_msg>Fix merge<commit_after># -*-coding:Utf-8 -*-

"""Contains functions which make requests to the server"""

# Compatibility 2.7-3.4
from __future__ import absolute_import
from __future__ import unicode_literals
from builtins import input

import sys, locale
import requests

from . import user as user
from . import target as target
from . import usergroup as usergroup
from . import targetgroup as targetgroup

url_passhport = "http://127.0.0.1:5000/"

def ask_confirmation(prompt_confirmation):
    """Same as input() but check if user key in a correct input,
    return True if the user confirms, false otherwise.
    """
    # Hack for the sake of compatibility between 2.7 and 3.4
    sys.stdout.write(prompt_confirmation)
    confirmation = str.upper(input(""))

    # Loop until user types [y/N]
    while confirmation != "Y" and confirmation != "N" and confirmation:
        print("You didn't type 'Y' or 'N', please try again.")
        sys.stdout.write(prompt_confirmation)
        confirmation = input("")

    if confirmation == "Y":
        return True

    return False


def get(url):
    """Send the GET request to the server and print a result"""
    try:
        r = requests.get(url)
    except requests.RequestException as e:
        print("ERROR: " + str(e.message))
{'fraction_non_alphanumeric': 0.10042323970757984, 'fraction_numerical': 0.014621008080030782, 'mean_word_length': 3.180064308681672, 'pattern_counts': {'":': 2, '<': 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': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3945365', 'n_tokens_mistral': 770, 'n_tokens_neox': 729, 'n_words': 281}