code: def add(cls, module_name, msg=''):
          '''
          Until the guard is dropped again,
          disallow imports of the module given by ``module_name``.
  
          If the module is imported while the guard is in place
          an ``ImportGuard`` is raised. An additional message on why
          the module cannot be imported can optionally be specified
          using the parameter ``msg``.
  
          If multiple guards are placed on the same module, all these guards
          have to be dropped before the module can be imported again.
          '''
          if module_name in sys.modules:
              raise ImportGuard(
                  'Module to guard has already been imported: '
                  + module_name
              )
          cls._guards.setdefault(module_name,  [])
          cls._guards[module_name].append(msg)
          cls._num_entries += 1
          cls._install(f add(cls, module_name, msg=''):
          '''
          Until the guard is dropped again,
          disallow imports of the module given by ``module_name``.
  
          If the module is imported while the guard is in place
          an ``ImportGuard`` is raised. An additional message on why
          the module cannot be imported can optionally be specified
          using the parameter ``msg``.
  
          If multiple guards are placed on the same module, all these guards
          have to be dropped before the module can be imported again.
          '''
          if module_name in sys.modules:
              raise ImportGuard(
                  'Module to guard has already been imported: '
                  + module_name
              )
          cls._guards.setdefault(module_name,  [])
          cls._guards[module_name].append(msg)
          cls._num_entries += 1
          cls._install()
docs: Until the guard is dropped again,
          disallow imports of the module given by ``module_name``.
  
          If the module is imported while the guard is in place
          an ``ImportGuard`` is raised. An additional message on why
          the module cannot be imported can optionally be specified
          using the parameter ``msg``.
  
          If multiple guards are placed on the same module, all these guards
          have to be dropped before the module can be imported again.