<commit_before>import logging
import socket
import time

import requests

log = logging.getLogger(__name__)


class FMEServer(object):
    def __init__(self, server_name, instance_id, api_token):
        self.api_token = api_token
        self.instance_id = instance_id
        self.server_name = server_name

    def _in_dns(self) -> bool:
        """
        Checks if `self.server_name` is in DNS / name resolves to IP
        :return: bool
        """
        try:
            socket.gethostbyname(self.server_name.split('//')[-1])
            log.debug('DNS is available for server')
            return True
        except socket.gaierror:
            log.warning("No DNS available for server")
            return False

    def _headers(self) -> dict:
        """
        Returns the auth header
        :return: dict
        """
        return {'Authorization': 'bearer {FME_SERVER_API}'.format(FME_SERVER_API=self.api_token)}

    def _url(self, path=None) -> str:<commit_msg>Naar aanleiding op security change van Safe.com aanpassing op: 'Authorization': 'bearer {FME_SERVER_API}'.format(FME_SERVER_API=self.api_token) namelijk bearer change in capital 'B'.<commit_after>import logging
import socket
import time

import requests

log = logging.getLogger(__name__)


class FMEServer(object):
    def __init__(self, server_name, instance_id, api_token):
        self.api_token = api_token
        self.instance_id = instance_id
        self.server_name = server_name

    def _in_dns(self) -> bool:
        """
        Checks if `self.server_name` is in DNS / name resolves to IP
        :return: bool
        """
        try:
            socket.gethostbyname(self.server_name.split('//')[-1])
            log.debug('DNS is available for server')
            return True
        except socket.gaierror:
            log.warning("No DNS available for server")
            return False

    def _headers(self) -> dict:
        """
        Returns the auth header
        :return: dict
        """
        return {'Authorization': 'Bearer {FME_SERVER_API}'.format(FME_SERVER_API=self.api_token)}

    def _url(self, path=None) -> str:
{'fraction_non_alphanumeric': 0.10154422087037904, 'fraction_numerical': 0.0009358914365933552, 'mean_word_length': 2.4483870967741934, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, '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': '621418', 'n_tokens_mistral': 640, 'n_tokens_neox': 633, 'n_words': 162}