docs: def initialize(config):
      """
      Initialize a connection to the Redis database.
      """
  
      # Determine the client class to use
      if 'redis_client' in config:
          client = utils.find_entrypoint('turnstile.redis_client',
                                         config['redis_client'], required=True)
      else:
          client = redis.StrictRedis
  
      # Extract relevant connection information from the configuration
      kwargs = {}
      for cfg_var, type_ in REDIS_CONFIGS.items():
          if cfg_var in config:
              kwargs[cfg_var] = type_(config[cfg_var])
  
      # Make sure we have at a minimum the hostname
      if 'host' not in kwargs and 'unix_socket_path' not in kwargs:
          raise redis.ConnectionError("No host specified for redis database")
  
      # Look up the connection pool configuration
      cpool_class = None
      cpool = {}
      extra_kwargs = {}
      for key, value in config.items():
          if key.startswith('connection_pool.'):
              _dummy, _sep, varname = key.partition('.')
              if varname == 'connection_class':
                  cpool[varname] = utils.find_entrypoint(
                      'turnstile.connection_class', value, required=True)
              elif varname == 'max_connections':
                  cpool[varname] = int(value)
              elif varname == 'parser_class':
                  cpool[varname] = utils.find_entrypoint(
                      'turnstile.parser_class', value, required=True)
              else:
                  cpool[varname] = value
          elif key not in REDIS_CONFIGS and key not in REDIS_EXCLUDES:
              extra_kwargs[key] = value
      if cpool:
          cpool_class = redis.ConnectionPool
  
      # Use custom connection pool class if requested...
      if 'connection_pool' in config:
          cpool_class = utils.find_entrypoint('turnstile.connection_pool',
                                              config['connection_pool'],
                                              required=True)
  
      # If we're using a connection pool, we'll need to pass the keyword
      # arguments to that instead of to redis
      if cpool_class:
          cpool.update(kwargs)
  
          # Use a custom connection class?
          if 'connection_class' not in cpool:
              if 'unix_socket_path' in cpool:
                  if 'host' in cpool:
                      del cpool['host']
                  if 'port' in cpool:
                      del cpool['port']
  
                  cpool['path'] = cpool['unix_socket_path']
                  del cpool['unix_socket_path']
  
                  cpool['connection_class'] = redis.UnixDomainSocketConnection
              else:
                  cpool['connection_class'] = redis.Connection
  
          # Build the connection pool to use and set up to pass it into
          # the redis constructor...
          kwargs = dict(connection_pool=cpool_class(**cpool))
  
      # Build and return the database
      kwargs.update(extra_kwargs)
      return client(**kwargs)