def get_class(datatype):
    # already done?
    if not isinstance(datatype, basestring):
        return datatype

    # parse datatype string "v31/Election" --> from v31 import Election
    parsed_datatype = datatype.split("/")
    
    # get the module
    dynamic_module = __import__(".".join(parsed_datatype[:-1]), globals(), locals(), [], level=-1)
    
    if not dynamic_module:
        raise Exception("no module for %s" % datatpye)

    # go down the attributes to get to the class
    try:
        dynamic_ptr = dynamic_module
        for attr in parsed_datatype[1:]:
            dynamic_ptr = getattr(dynamic_ptr, attr)
        dynamic_cls = dynamic_ptr
    except __HOLE__:
        raise Exception ("no module for %s" % datatype)    

    dynamic_cls.datatype = datatype
        
    return dynamic_cls
dataset/ETHPy150Open benadida/helios-server/helios/datatypes/__init__.py/get_class