<commit_before>"Provides tools for user to load data as specified."

import os
from datetime import datetime

import pandas as pd

from batch_generator import BatchGenerator

DATASETS_PATH = os.path.join(os.environ['DEEP_QUANT_ROOT'], 'datasets')
OPEN_DF_PATH = os.path.join(DATASETS_PATH, 'open_dataset.dat') 
# TODO: fix so we don't have to assume 'DEEP_QUANT_ROOT' is defined in the
# environment

def get_data_path(data_dir, filename):
    """
    Construct the data path for the experiement. If DEEP_QUANT_ROOT is
    defined in the environment, then the data path is relative to it.

    Args:
      data_dir: the directory name where experimental data is held
      filename: the data file name
    Returns:
      If DEEP_QUANT_ROOT is defined, the fully qualified data path is returned
      Otherwise a path relative to the working directory is returned<commit_msg>20X+ speedup in caching batches :-)<commit_after>"Provides tools for user to load data as specified."

import os
from datetime import datetime

import pandas as pd

from batch_generator_new import BatchGenerator

DATASETS_PATH = os.path.join(os.environ['DEEP_QUANT_ROOT'], 'datasets')
OPEN_DF_PATH = os.path.join(DATASETS_PATH, 'open_dataset.dat') 
# TODO: fix so we don't have to assume 'DEEP_QUANT_ROOT' is defined in the
# environment

def get_data_path(data_dir, filename):
    """
    Construct the data path for the experiement. If DEEP_QUANT_ROOT is
    defined in the environment, then the data path is relative to it.

    Args:
      data_dir: the directory name where experimental data is held
      filename: the data file name
    Returns:
      If DEEP_QUANT_ROOT is defined, the fully qualified data path is returned
      Otherwise a path relative to the working directory is returned
{'fraction_non_alphanumeric': 0.05749718151071026, 'fraction_numerical': 0.0011273957158962795, 'mean_word_length': 4.144927536231884, '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': '2238620', 'n_tokens_mistral': 511, 'n_tokens_neox': 504, 'n_words': 214}