'Get the controller to handle a request.
:param req: the request
:returns: tuple of (controller class, path dictionary)
:raises ValueError: (thrown by split_path) if given invalid path'

def get_controller(self, req):

    if (req.path == '/info'):
        d = dict(version=None, expose_info=self.expose_info, disallowed_sections=self.disallowed_sections, admin_key=self.admin_key)
        return (InfoController, d)
    (version, account, container, obj) = split_path(req.path, 1, 4, True)
    d = dict(version=version, account_name=account, container_name=container, object_name=obj)
    if (account and (not valid_api_version(version))):
        raise APIVersionError('Invalid    path')
    if (obj and container and account):
        info = get_container_info(req.environ, self)
        policy_index = req.headers.get('X-Backend-Storage-Policy-Index', info['storage_policy'])
        policy = POLICIES.get_by_index(policy_index)
        if (not policy):
            raise HTTPServiceUnavailable('Unknown    Storage    Policy')
        return (self.obj_controller_router[policy], d)
    elif (container and account):
        return (ContainerController, d)
    elif (account and (not container) and (not obj)):
        return (AccountController, d)
    return (None, d)
