def isstr(obj):
    try:
        return isinstance(obj, basestring)
    except NameError:
        return isinstance(obj, str)
Check for stringy-ness in python 2.7 or 3
dataset/ETHPy150Open gallantlab/pycortex/cortex/xfm.py/isstr