<commit_before># -*- coding: utf-8 -*-
'''
Detect MDADM RAIDs
'''

# Import python libs
import logging

# Import salt libs
import salt.utils

log = logging.getLogger(__name__)


def mdadm():
    '''
    Return list of mdadm devices
    '''
    devices = set()
    try:
        with salt.utils.fopen('/proc/mdstat', 'r') as mdstat:
            for line in mdstat:
                if line.startswith('Personalities : '):
                    continue
                if line.startswith('unused devices:'):
                    continue
                if ' : ' in line:
                    devices.add(line.split(' : ')[0])
    except IOError:<commit_msg>Making salt.grains.mdadm python3 compatible<commit_after># -*- coding: utf-8 -*-
'''
Detect MDADM RAIDs
'''
from __future__ import absolute_import

# Import python libs
import logging

# Import salt libs
import salt.utils

log = logging.getLogger(__name__)


def mdadm():
    '''
    Return list of mdadm devices
    '''
    devices = set()
    try:
        with salt.utils.fopen('/proc/mdstat', 'r') as mdstat:
            for line in mdstat:
                if line.startswith('Personalities : '):
                    continue
                if line.startswith('unused devices:'):
                    continue
                if ' : ' in line:
                    devices.add(line.split(' : ')[0])
    except IOError:
{'fraction_non_alphanumeric': 0.11962071480671042, 'fraction_numerical': 0.0036469730123997084, 'mean_word_length': 1.823045267489712, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '1030312', 'n_tokens_mistral': 412, 'n_tokens_neox': 387, 'n_words': 108}