# Path: corpkit/constants.py
# STRINGTYPE = str if PYTHON_VERSION == 3 else basestring
# 
# PYTHON_VERSION = sys.version_info.major


from corpkit.constants import STRINGTYPE, PYTHON_VERSION
    from pandas import DataFrame, Series
    from time import localtime, strftime
        from IPython.display import display, clear_output
    from corpkit.interrogation import Interrodict, Interrogation, Concordance
        from collections import OrderedDict
        from process import checkstack
        from corpkit.process import checkstack
        from corpkit.dictionaries.process_types import Wordlist
        from corpkit.dictionaries.process_types import Wordlist
        from nltk.corpus import wordnet as wn
        from collections import Counter
        from dictionaries.word_transforms import usa_convert
        from scipy.stats import linregress
        from pandas import Series
            from scipy.stats import linregress
        from corpkit.keys import keywords
    import corpkit
    import re
    import collections
    import pandas as pd
    import numpy as np
                import warnings
                    import warnings
        import re
        import re
            import operator
        if span_subcorpora:
            df = df.iloc[span_subcorpora[0]:span_subcorpora[1],:]
        return df

    def parse_input(df, the_input):
        """turn whatever has been passed in into list of words that can 
           be used as pandas indices---maybe a bad way to go about it"""
        parsed_input = False
        if the_input == 'all':
            the_input = r'.*'
        if isinstance(the_input, int):
            try:
                the_input = str(the_input)
            except:
                pass
            the_input = [the_input]
        elif isinstance(the_input, STRINGTYPE):
            regex = re.compile(the_input)
            parsed_input = [w for w in list(df) if re.search(regex, w)]
            return parsed_input
        if isinstance(the_input, Wordlist) or the_input.__class__ == Wordlist:
            the_input = list(the_input)
        if isinstance(the_input, list):
            if isinstance(the_input[0], int):
                parsed_input = [word for index, word in enumerate(list(df)) if index in the_input]
            elif isinstance(the_input[0], STRINGTYPE):
                try:
                    parsed_input = [word for word in the_input if word in df.columns]
                except AttributeError: # if series
                    parsed_input = [word for word in the_input if word in df.index]

# Path: corpkit/constants.py
# STRINGTYPE = str if PYTHON_VERSION == 3 else basestring
# 
# PYTHON_VERSION = sys.version_info.major


# Path: corpkit/editor.py
from corpkit.constants import STRINGTYPE, PYTHON_VERSION
    from pandas import DataFrame, Series
    from time import localtime, strftime
        from IPython.display import display, clear_output
    from corpkit.interrogation import Interrodict, Interrogation, Concordance
        from collections import OrderedDict
        from process import checkstack
        from corpkit.process import checkstack
        from corpkit.dictionaries.process_types import Wordlist
        from corpkit.dictionaries.process_types import Wordlist
        from nltk.corpus import wordnet as wn
        from collections import Counter
        from dictionaries.word_transforms import usa_convert
        from scipy.stats import linregress
        from pandas import Series
            from scipy.stats import linregress
        from corpkit.keys import keywords
    import corpkit
    import re
    import collections
    import pandas as pd
    import numpy as np
                import warnings
                    import warnings
        import re
        import re
            import operator

        if span_subcorpora:
            df = df.iloc[span_subcorpora[0]:span_subcorpora[1],:]
        return df

    def parse_input(df, the_input):
        """turn whatever has been passed in into list of words that can 
           be used as pandas indices---maybe a bad way to go about it"""
        parsed_input = False
        if the_input == 'all':
            the_input = r'.*'
        if isinstance(the_input, int):
            try:
                the_input = str(the_input)
            except:
                pass
            the_input = [the_input]
        elif isinstance(the_input, STRINGTYPE):
            regex = re.compile(the_input)
            parsed_input = [w for w in list(df) if re.search(regex, w)]
            return parsed_input
        if isinstance(the_input, Wordlist) or the_input.__class__ == Wordlist:
            the_input = list(the_input)
        if isinstance(the_input, list):
            if isinstance(the_input[0], int):
                parsed_input = [word for index, word in enumerate(list(df)) if index in the_input]
            elif isinstance(the_input[0], STRINGTYPE):
                try:
                    parsed_input = [word for word in the_input if word in df.columns]
                except AttributeError: # if series
                    parsed_input = [word for word in the_input if word in df.index]

        return parsed_input