def str_to_class(klassname):
    """Returns class of string parameter. Requires class to be in module namespace"""
    import sys
    try:
        identifier = getattr(sys.modules[__name__], klassname)
    except AttributeError:
        raise NameError("%s doesn't exist." % klassname)
    if isinstance(identifier, six.class_types):
        return identifier
    raise TypeError("%s is not a class." % klassname)
dataset/ETHPy150Open activefrequency/pyavatax/pyavatax/base.py/str_to_class/original