<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def import_class(classpath, package=None):
 """ Load and return a class """

    if '.' in classpath:
        module, classname = classpath.rsplit('.', 1)
        if package and not module.startswith('.'):
            module = '.{0}'.format(module)
        mod = import_module(module, package)
    else:
        classname = classpath
        mod = import_module(package)

    return getattr(mod, classname)