<commit_before>#!/usr/bin/env python
from __future__ import print_function
from builtins import str
from builtins import object
import pickle
import time
import deepdish as dd
import inspect
import warnings
import pandas as pd
import numpy as np
from .analysis.recmat import recall_matrix
from .analysis.analysis import analyze
from .plot import plot
from .helpers import list2pd, default_dist_funcs, crack_egg, fill_missing, merge_pres_feats, df2list

class Egg(object):
    """
    Data object for the quail package

    An Egg data object contains the data you need to analyze free recall experiments.
    This can be a single subject's data, or a group of subjects.  An Egg is comprised of
    a number of fields: the pres field contains the words/stimuli presented to the subject.
    The rec field contains the words/stimuli recalled by the subject. The feature field
    is optional, but may contain a dictionary of features for each stimulus.  This
    field is necessary to run the fingerprint analyses. Related to the features
    is the dist_funcs dictionary (also optional).  This dictionary specifies
    a set of distance functions required for the fingerprint analyses.  Finally,
    the meta field is an optional dictionary that contains any details useful for
    identifying the egg object

    Parameters
    ----------

    pres : list (subjects) of lists (experiment) of lists (list/block) of strings or dictionaries.
        This is a nested list containing the presented stimuli/stimulus features.
        The outer list groups the data into subjects, the middle list groups the
        data into experiments and the inner list groups the data into stimuli
        presented together in one block (or list). Each item within the list can
        be a string representing the stimulus or a dictionary representing the
        stimuli and its features. If dictionaries are passed, identify the stimulus
        name using the 'stimulus' key and a string label. To represent additional
        stimulus features, use any text (str) label as the key and a value of the
        following types: string, int, float, list, array.

    rec : list (subjects) of lists (experiment) of lists (list/block) of strings or dictionaries.
        This is a nested list containing the recalled stimuli/stimulus features.
        The outer list groups the data into subjects, the middle list groups the
        data into experiments and the inner list groups the data into stimuli
        presented together in one block (or list). Each item within the list can
        be a string representing the stimulus or a dictionary representing the
        stimuli and its features. If dictionaries are passed, identify the stimulus
        name using the 'stimulus' key and a string label. To represent additional
        stimulus features, use any text (str) label as the key and a value of the
        following types: string, int, float, list, array.

    features : list (subjects) of lists (experiment) of lists (list/block) of strings or dictionaries.
        This is DEPRECATED, but left in for legacy support. This is a nested list
        containing the stimuli/stimulus features. The outer list groups the data
        into subjects, the middle list groups the data into experiments and the
        inner list groups the data into stimuli presented together in one block
        (or list). Each item within the list should be a dictionary representing
        stimulus features. Each dictionary should contain a text (str) label as
        the key and a value of the following types: string, int, float, list, array.

    dist_funcs : dict (optional)
        A dictionary of custom distance functions for stimulus features. Each
        key should be the name of a feature and each value should be a string
        representation of an inline distance function
        (e.g. `dist_funcs['feature_n'] = 'lambda a, b: abs(a-b)''`)

    meta : dict (optional)
        Meta data about the study (i.e. version, description, date, etc.) can be saved here.

    subjgroup : list of strings or ints (optional)<commit_msg>fixed typo in egg docstring<commit_after>#!/usr/bin/env python
from __future__ import print_function
from builtins import str
from builtins import object
import pickle
import time
import deepdish as dd
import inspect
import warnings
import pandas as pd
import numpy as np
from .analysis.recmat import recall_matrix
from .analysis.analysis import analyze
from .plot import plot
from .helpers import list2pd, default_dist_funcs, crack_egg, fill_missing, merge_pres_feats, df2list

class Egg(object):
    """
    Data object for the quail package

    An Egg data object contains the data you need to analyze free recall experiments.
    This can be a single subject's data, or a group of subjects.  An Egg is comprised of
    a number of fields: the pres field contains the words/stimuli presented to the subject.
    The rec field contains the words/stimuli recalled by the subject. The feature field
    is optional, but may contain a dictionary of features for each stimulus.  This
    field is necessary to run the fingerprint analyses. Related to the features
    is the dist_funcs dictionary (also optional).  This dictionary specifies
    a set of distance functions required for the fingerprint analyses.  Finally,
    the meta field is an optional dictionary that contains any details useful for
    identifying the egg object

    Parameters
    ----------

    pres : list (subjects) of lists (experiment) of lists (list/block) of strings or dictionaries.
        This is a nested list containing the presented stimuli/stimulus features.
        The outer list groups the data into subjects, the middle list groups the
        data into experiments and the inner list groups the data into stimuli
        presented together in one block (or list). Each item within the list can
        be a string representing the stimulus or a dictionary representing the
        stimuli and its features. If dictionaries are passed, identify the stimulus
        name using the 'item' key and a string label. To represent additional
        stimulus features, use any text (str) label as the key and a value of the
        following types: string, int, float, list, array.

    rec : list (subjects) of lists (experiment) of lists (list/block) of strings or dictionaries.
        This is a nested list containing the recalled stimuli/stimulus features.
        The outer list groups the data into subjects, the middle list groups the
        data into experiments and the inner list groups the data into stimuli
        presented together in one block (or list). Each item within the list can
        be a string representing the stimulus or a dictionary representing the
        stimuli and its features. If dictionaries are passed, identify the stimulus
        name using the 'item' key and a string label. To represent additional
        stimulus features, use any text (str) label as the key and a value of the
        following types: string, int, float, list, array.

    features : list (subjects) of lists (experiment) of lists (list/block) of strings or dictionaries.
        This is DEPRECATED, but left in for legacy support. This is a nested list
        containing the stimuli/stimulus features. The outer list groups the data
        into subjects, the middle list groups the data into experiments and the
        inner list groups the data into stimuli presented together in one block
        (or list). Each item within the list should be a dictionary representing
        stimulus features. Each dictionary should contain a text (str) label as
        the key and a value of the following types: string, int, float, list, array.

    dist_funcs : dict (optional)
        A dictionary of custom distance functions for stimulus features. Each
        key should be the name of a feature and each value should be a string
        representation of an inline distance function
        (e.g. `dist_funcs['feature_n'] = 'lambda a, b: abs(a-b)''`)

    meta : dict (optional)
        Meta data about the study (i.e. version, description, date, etc.) can be saved here.

    subjgroup : list of strings or ints (optional)
{'fraction_non_alphanumeric': 0.04220227989328159, 'fraction_numerical': 0.00048508367693427115, 'mean_word_length': 3.1884205180294565, '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': '7096524', 'n_tokens_mistral': 1987, 'n_tokens_neox': 1903, 'n_words': 1163}