# 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
            usa_convert = {v: k for k, v in list(usa_convert.items())}
        fixed = []
        for val in list(df.columns):
            try:
                fixed.append(usa_convert[val])
            except:
                fixed.append(val)
        df.columns = fixed
        return df

    def merge_duplicates(df, print_info=print_info):
        if print_info:
            print('Merging duplicate entries ... \n')
        # now we have to merge all duplicates
        for dup in df.columns.get_duplicates():
            #num_dupes = len(list(df[dup].columns))
            temp = df[dup].sum(axis=1)
            #df = df.drop([dup for d in range(num_dupes)], axis=1)
            df = df.drop(dup, axis=1)
            df[dup] = temp
        return df

    def name_replacer(df, replace_names, print_info=print_info):
        """replace entry names and merge"""
        # get input into list of tuples
        # if it's a string, we want to delete it
        if isinstance(replace_names, STRINGTYPE):
            replace_names = [(replace_names, '')]
        # this is for some malformed list
        if not isinstance(replace_names, dict):

# 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

            usa_convert = {v: k for k, v in list(usa_convert.items())}
        fixed = []
        for val in list(df.columns):
            try:
                fixed.append(usa_convert[val])
            except:
                fixed.append(val)
        df.columns = fixed
        return df

    def merge_duplicates(df, print_info=print_info):
        if print_info:
            print('Merging duplicate entries ... \n')
        # now we have to merge all duplicates
        for dup in df.columns.get_duplicates():
            #num_dupes = len(list(df[dup].columns))
            temp = df[dup].sum(axis=1)
            #df = df.drop([dup for d in range(num_dupes)], axis=1)
            df = df.drop(dup, axis=1)
            df[dup] = temp
        return df

    def name_replacer(df, replace_names, print_info=print_info):
        """replace entry names and merge"""
        # get input into list of tuples
        # if it's a string, we want to delete it
        if isinstance(replace_names, STRINGTYPE):
            replace_names = [(replace_names, '')]
        # this is for some malformed list
        if not isinstance(replace_names, dict):

            if isinstance(replace_names[0], STRINGTYPE):