def get_callable(callable):
    if isinstance(callable, basestring):
        module, attr = callable.rsplit('.', 1)
        try:
            mod = import_module(module)
        except __HOLE__, e:
            raise ImproperlyConfigured('Error importing ajaxerrors callable %s: "%s"' % (callable, e))
        try:
            callable = getattr(mod, attr)
        except AttributeError, e:
            raise ImproperlyConfigured('Error importing ajaxerrors callable %s: "%s"' % (callable, e))
    return callable
dataset/ETHPy150Open yaniv-aknin/django-ajaxerrors/ajaxerrors/utils.py/get_callable