code: def createBatchSystem(config):
          
          kwargs = dict(config=config,
                        maxCores=config.maxCores,
                        maxMemory=config.maxMemory,
                        maxDisk=config.maxDisk)
  
          from toil.batchSystems.registry import batchSystemFactoryFor
  
          try:
              factory = batchSystemFactoryFor(config.batchSystem)
              batchSystemClass = factory()
          except:
              raise RuntimeError('Unrecognised batch system: %s' % config.batchSystem)
  
          if not config.disableCaching and not batchSystemClass.supportsWorkerCleanup():
              raise RuntimeError('%s currently does not support shared caching.  Set the '
                                 '--disableCaching flag if you want to '
                                 'use this batch system.' % config.batchSystem)
          logger.debug('Using the %s' %
                      re.sub("([a-z])([A-Z])", "\g<1> \g<2>", batchSystemClass.__name__).lower())
  
          return batchSystemClass(**kwargs)
docs: Creates an instance of the batch system specified in the given config.
  
          :param toil.common.Config config: the current configuration
  
          :rtype: batchSystems.abstractBatchSystem.AbstractBatchSystem
  
          :return: an instance of a concrete subclass of AbstractBatchSystem