def get_library(module_name):
    lib = libraries.get(module_name, None)
    if not lib:
        try:
            mod = __import__(module_name, {}, {}, [''])
        except __HOLE__, e:
            raise InvalidTemplateLibrary("Could not load template library from %s, %s" % (module_name, e))
        try:
            lib = mod.register
            libraries[module_name] = lib
        except AttributeError:
            raise InvalidTemplateLibrary("Template library %s does not have a variable named 'register'" % module_name)
    return lib
dataset/ETHPy150Open dcramer/django-compositepks/django/template/__init__.py/get_library