# Path: corpkit/process.py
# def classname(cls):
#     """Create the class name str for __repr__"""
#     return '.'.join([cls.__class__.__module__, cls.__class__.__name__])


from collections import OrderedDict
from corpkit.process import classname
        from corpkit.editor import editor
        from corpkit.editor import editor
        from corpkit.plotter import plotter
        from corpkit.plotter import multiplotter
        from corpkit.model import _make_model_from_interro
        from corpkit.other import save
        from corpkit.other import quickview
        from ascii_graph import Pyasciigraph
        from ascii_graph.colors import Gre, Yel, Red, Blu
        from ascii_graph.colordata import vcolor
        from ascii_graph.colordata import hcolor
        from corpkit.other import make_multi
        from corpkit.other import topwords
        from scipy.stats import entropy
        from corpkit.stats import shannon
        from corpkit.other import concprinter
        from corpkit.process import interrogation_from_conclines
        from corpkit.editor import editor
        from corpkit.process import makesafe
        from corpkit.process import makesafe
                from corpkit.process import is_number
        from corpkit.process import makesafe
        from corpkit.editor import editor
        from itertools import product
        from corpkit.interrogation import Interrodict, Interrogation
            from collections import defaultdict
        from corpkit.other import save
        from corpkit.other import topwords
        from corpkit.interrogation import Interrodict
        from corpkit.interrogation import Interrodict
import pandas as pd
        import tabview
        import pydoc
            import math
        import pandas as pd
        import random
        import pydoc
        import pandas as pd
        import numpy as np
        import matplotlib.pyplot as plt
        import pandas as pd
    """
    Stores results of a corpus interrogation, before or after editing. The main 
    attribute, :py:attr:`~corpkit.interrogation.Interrogation.results`, is a 
    Pandas object, which can be edited or plotted.
    """

    def __init__(self, results=None, totals=None, query=None, concordance=None):
        """Initialise the class"""
        self.results = results
        """pandas `DataFrame` containing counts for each subcorpus"""
        self.totals = totals
        """pandas `Series` containing summed results"""
        self.query = query
        """`dict` containing values that generated the result"""
        self.concordance = concordance
        """pandas `DataFrame` containing concordance lines, if concordance lines were requested."""

    def __str__(self):
        if self.query.get('corpus'):
            prst = getattr(self.query['corpus'], 'name', self.query['corpus'])
        else:
            try:
                prst = self.query['interrogation'].query['corpus'].name
            except:
                prst = 'edited'
        st = 'Corpus interrogation: %s\n\n' % (prst)
        return st

    def __repr__(self):
        try:

# Path: corpkit/process.py
# def classname(cls):
#     """Create the class name str for __repr__"""
#     return '.'.join([cls.__class__.__module__, cls.__class__.__name__])


# Path: corpkit/interrogation.py
from collections import OrderedDict
from corpkit.process import classname
        from corpkit.editor import editor
        from corpkit.editor import editor
        from corpkit.plotter import plotter
        from corpkit.plotter import multiplotter
        from corpkit.model import _make_model_from_interro
        from corpkit.other import save
        from corpkit.other import quickview
        from ascii_graph import Pyasciigraph
        from ascii_graph.colors import Gre, Yel, Red, Blu
        from ascii_graph.colordata import vcolor
        from ascii_graph.colordata import hcolor
        from corpkit.other import make_multi
        from corpkit.other import topwords
        from scipy.stats import entropy
        from corpkit.stats import shannon
        from corpkit.other import concprinter
        from corpkit.process import interrogation_from_conclines
        from corpkit.editor import editor
        from corpkit.process import makesafe
        from corpkit.process import makesafe
                from corpkit.process import is_number
        from corpkit.process import makesafe
        from corpkit.editor import editor
        from itertools import product
        from corpkit.interrogation import Interrodict, Interrogation
            from collections import defaultdict
        from corpkit.other import save
        from corpkit.other import topwords
        from corpkit.interrogation import Interrodict
        from corpkit.interrogation import Interrodict
import pandas as pd
        import tabview
        import pydoc
            import math
        import pandas as pd
        import random
        import pydoc
        import pandas as pd
        import numpy as np
        import matplotlib.pyplot as plt
        import pandas as pd

    """
    Stores results of a corpus interrogation, before or after editing. The main 
    attribute, :py:attr:`~corpkit.interrogation.Interrogation.results`, is a 
    Pandas object, which can be edited or plotted.
    """

    def __init__(self, results=None, totals=None, query=None, concordance=None):
        """Initialise the class"""
        self.results = results
        """pandas `DataFrame` containing counts for each subcorpus"""
        self.totals = totals
        """pandas `Series` containing summed results"""
        self.query = query
        """`dict` containing values that generated the result"""
        self.concordance = concordance
        """pandas `DataFrame` containing concordance lines, if concordance lines were requested."""

    def __str__(self):
        if self.query.get('corpus'):
            prst = getattr(self.query['corpus'], 'name', self.query['corpus'])
        else:
            try:
                prst = self.query['interrogation'].query['corpus'].name
            except:
                prst = 'edited'
        st = 'Corpus interrogation: %s\n\n' % (prst)
        return st

    def __repr__(self):
        try:

            return "<%s instance: %d total>" % (classname(self), self.totals.sum())