<commit_before>"""
"System" library
----------------

Get configuration and other "system" things. In general, these functions will
load configurations from ``/etc/hadoop/conf``.
"""


import hadmin.rest
from hadmin.util import HXML
from hadmin.yarn import CapacityScheduler, ResourceManager
import os


HADOOP_CONF_DIRS = [
        '.',
        '/etc/hadoop/conf'
        ]

CAPACITY_SCHEDULER_FILENAME = 'capacity-scheduler.xml'
YARN_FILENAME = 'yarn-site.xml'


def find_hxml_dir():
    for d in HADOOP_CONF_DIRS:
        if 'core-site.xml' in os.listdir(d):
            return d<commit_msg>system: catch OSErorr in find_hxml_dir<commit_after>"""
"System" library
----------------

Get configuration and other "system" things. In general, these functions will
load configurations from ``/etc/hadoop/conf``.
"""


import hadmin.rest
from hadmin.util import HXML
from hadmin.yarn import CapacityScheduler, ResourceManager
import os


HADOOP_CONF_DIRS = [
        '.',
        '/etc/hadoop/conf'
        ]

CAPACITY_SCHEDULER_FILENAME = 'capacity-scheduler.xml'
YARN_FILENAME = 'yarn-site.xml'


def find_hxml_dir():
    for d in HADOOP_CONF_DIRS:
        try:
            if 'core-site.xml' in os.listdir(d):
                return d
        except OSError:
            # Probably missing permissions to list the directory
            pass
{'fraction_non_alphanumeric': 0.11791044776119403, 'fraction_numerical': 0.0, 'mean_word_length': 2.735376044568245, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 9}, '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': '181547', 'n_tokens_mistral': 442, 'n_tokens_neox': 425, 'n_words': 112}