code: def set_backend(self, backend):
          
          if isinstance(backend, str):
              name = backend
              args = []
              kwargs = {}
          elif isinstance(backend, (tuple, list)):
              name = ''
              args = []
              kwargs = {}
              for i in range(len(backend)):
                  if i == 0:
                      name = backend[i]
                  else:
                      if isinstance(backend[i], dict):
                          kwargs.update(backend[i])
                      else:
                          args += backend[i]
          else:
              raise TypeError("Backend must be string, tuple, or list")
          if name in available_backends:
              self.backend = name
              self._backend = available_backends[name]()
          elif name is None:
              # The base class should not be called.
              raise Exception(("A backend (e.g. 'jNeuroML' or 'NEURON') "
                               "must be selected"))
          else:
              raise Exception("Backend %s not found in backends.py"
                              % name)
          self._backend.model = self
          self._backend.init_backend(*args, **kwargs)
docs: Set the simulation backend.