<commit_before>"""
Manage resources like CPUs and Memory.  Default values, detection, tracking,
policy, etc.
"""

from __future__ import absolute_import, division, print_function

import os
import time
import math
from copy import deepcopy

import subprocess
import tempfile
import shutil
from collections import deque
import logging

try:
    import psutil
except ImportError:
    psutil = None

logger = logging.getLogger('resources')

class Resources:
    """
    Task (and node) resource definition and tracking.
    """

    defaults = {
        'cpu': 1,
        'gpu': [],
        'memory': 1.0,
        'disk': 10.0,
        'time': 1.0,
    }<commit_msg>fix defaultdict<commit_after>"""
Manage resources like CPUs and Memory.  Default values, detection, tracking,
policy, etc.
"""

from __future__ import absolute_import, division, print_function

import os
import time
import math
from copy import deepcopy

import subprocess
import tempfile
import shutil
from collections import deque, defaultdict
import logging

try:
    import psutil
except ImportError:
    psutil = None

logger = logging.getLogger('resources')

class Resources:
    """
    Task (and node) resource definition and tracking.
    """

    defaults = {
        'cpu': 1,
        'gpu': [],
        'memory': 1.0,
        'disk': 10.0,
        'time': 1.0,
    }
{'fraction_non_alphanumeric': 0.09619686800894854, 'fraction_numerical': 0.011931394481730051, 'mean_word_length': 3.154798761609907, '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': '1173858', 'n_tokens_mistral': 398, 'n_tokens_neox': 386, 'n_words': 140}