<commit_before>"""
Module for managing the PROJ data directory.
"""
import os
import sys
from distutils.spawn import find_executable
from pathlib import Path
from typing import Union

from pyproj._datadir import (  # noqa: F401
    _global_context_set_data_dir,
    get_user_data_dir,
)
from pyproj.exceptions import DataDirError

_USER_PROJ_DATA = None
_VALIDATED_PROJ_DATA = None


def set_data_dir(proj_data_dir: Union[str, Path]) -> None:
    """
    Set the data directory for PROJ to use.

    Parameters
    ----------
    proj_data_dir: Union[str, Path]
        The path to the PROJ data directory.
    """
    global _USER_PROJ_DATA
    global _VALIDATED_PROJ_DATA
    _USER_PROJ_DATA = str(proj_data_dir)
    # set to none to re-validate
    _VALIDATED_PROJ_DATA = None<commit_msg>LNT: Address pylint complaints for pyproj/datadir.py<commit_after>"""
Module for managing the PROJ data directory.
"""
# pylint: disable=global-statement
import os
import sys
from distutils.spawn import find_executable
from pathlib import Path
from typing import Union

from pyproj._datadir import (  # noqa: F401  pylint: disable=unused-import
    _global_context_set_data_dir,
    get_user_data_dir,
)
from pyproj.exceptions import DataDirError

_USER_PROJ_DATA = None
_VALIDATED_PROJ_DATA = None


def set_data_dir(proj_data_dir: Union[str, Path]) -> None:
    """
    Set the data directory for PROJ to use.

    Parameters
    ----------
    proj_data_dir: Union[str, Path]
        The path to the PROJ data directory.
    """
    global _USER_PROJ_DATA
    global _VALIDATED_PROJ_DATA
    _USER_PROJ_DATA = str(proj_data_dir)
    # set to none to re-validate
    _VALIDATED_PROJ_DATA = None
{'fraction_non_alphanumeric': 0.07468879668049792, 'fraction_numerical': 0.0035566093657379964, 'mean_word_length': 3.688888888888889, 'pattern_counts': {'":': 0, '<': 3, '<?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': '6110936', 'n_tokens_mistral': 577, 'n_tokens_neox': 556, 'n_words': 160}