<commit_before><?php

namespace App\Service;

use Symfony\Contracts\HttpClient\HttpClientInterface;
use Symfony\Component\HttpClient\Exception\RedirectionException;
use Symfony\Contracts\HttpClient\Exception\HttpExceptionInterface;
use Symfony\Contracts\HttpClient\Exception\TransportExceptionInterface;

class HttpService
{
    private HttpClientInterface $httpClient;

    public function __construct(HttpClientInterface $httpClient)
    {
        $this->httpClient = $httpClient;
    }

    /**
     * Checks if the given string is a valid IP address or a domain name.
     */
    public function isValidWebsite(string $website)
    {
        // See if the input is a valid IP address.
        if (filter_var($website, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4)) {
            return true;
        }

        // See if the input is a valid domain that resolves to an IPv4 address.
        if (
            preg_match("/^(xn--)?([\w0-9]([\w0-9\-]{0,61}[\w0-9])?\.)+(xn--)?[\w]{2,6}$/i", $website)
            && checkdnsrr($website, "A")
        ) {
            return true;
        }

        return false;
    }
<commit_msg>Remove DNS check<commit_after><?php

namespace App\Service;

use Symfony\Contracts\HttpClient\HttpClientInterface;
use Symfony\Component\HttpClient\Exception\RedirectionException;
use Symfony\Contracts\HttpClient\Exception\HttpExceptionInterface;
use Symfony\Contracts\HttpClient\Exception\TransportExceptionInterface;

class HttpService
{
    private HttpClientInterface $httpClient;

    public function __construct(HttpClientInterface $httpClient)
    {
        $this->httpClient = $httpClient;
    }

    /**
     * Checks if the given string is a valid IP address or a domain name.
     */
    public function isValidWebsite(string $website)
    {
        // See if the input is a valid IP address.
        if (filter_var($website, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4)) {
            return true;
        }

        // See if the input is a valid domain that resolves to an IPv4 address.
        if (preg_match("/^(xn--)?([\w0-9]([\w0-9\-]{0,61}[\w0-9])?\.)+(xn--)?[\w]{2,6}$/i", $website)) {
            return true;
        }

        return false;
    }

{'fraction_non_alphanumeric': 0.11802378774016468, 'fraction_numerical': 0.011893870082342177, 'mean_word_length': 2.7577319587628866, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '4982524', 'n_tokens_mistral': 682, 'n_tokens_neox': 652, 'n_words': 156}