<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def match_url(self, request):
 """ Match the request against a file in the adapter directory :param request: The request :type request: :class:`requests.Request` :return: Path to the file :rtype: ``str`` """

        parsed_url = urlparse(request.path_url)
        path_url = parsed_url.path
        query_params = parsed_url.query
        match = None

        for path in self.paths:
            for item in self.index:
                target_path = os.path.join(BASE_PATH, path, path_url[1:])

                query_path = target_path.lower() + quote(
                    '?' + query_params).lower()
                if target_path.lower() == item[0]:
                    match = item[1]
                    break
                elif query_path == item[0]:
                    match = item[1]
                    break
        return match