<commit_before>#!/usr/bin/env python3
# -*- coding: utf-8 -*-

"""
Written by <NAME>.
MIT Licenced.
"""

# Built-in modules #
import os, shutil, time
import urllib.parse

# Internal modules #
from plumbing.scraping import handle_destination

# First party modules #
from autopaths import Path

# Third party modules #
from selenium import webdriver

###############################################################################
def make_driver():
    """
    Create a headless webdriver with selenium.

    Note: #TODO Change the download dir to a temp dir #
    Otherwise it will append (1) and (2) etc. to the filename before the
    extension e.g. 'data.zip (1).crdownload'
    """
    # Paths #
    chrome_driver_path = shutil.which('chromedriver')
    # Start a service #
    service = webdriver.chrome.service.Service(chrome_driver_path)
    service.start()<commit_msg>Don't import selenium unless we use it<commit_after>#!/usr/bin/env python3
# -*- coding: utf-8 -*-

"""
Written by <NAME>.
MIT Licenced.
"""

# Built-in modules #
import os, shutil, time
import urllib.parse

# Internal modules #
from plumbing.scraping import handle_destination

# First party modules #
from autopaths import Path

###############################################################################
def make_driver():
    """
    Create a headless webdriver with selenium.

    Note: #TODO Change the download dir to a temp dir #
    Otherwise it will append (1) and (2) etc. to the filename before the
    extension e.g. 'data.zip (1).crdownload'
    """
    # Import #
    from selenium import webdriver
    # Paths #
    chrome_driver_path = shutil.which('chromedriver')
    # Start a service #
    service = webdriver.chrome.service.Service(chrome_driver_path)
    service.start()
{'fraction_non_alphanumeric': 0.18556119571347998, 'fraction_numerical': 0.0056401579244218835, 'mean_word_length': 3.8206521739130435, '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': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1334743', 'n_tokens_mistral': 528, 'n_tokens_neox': 500, 'n_words': 165}