<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:

def _create_navigator(self, response, raise_exc=True):
        '''Create the appropriate navigator from an api response'''
        method = response.request.method
        # TODO: refactor once hooks in place
        if method in (POST, PUT, PATCH, DELETE) \
           and response.status_code in (
                http_client.CREATED,
                http_client.FOUND,
                http_client.SEE_OTHER,
                http_client.NO_CONTENT) \
           and 'Location' in response.headers:
            uri = urlparse.urljoin(self._core.root, response.headers['Location'])
            nav = HALNavigator(
                link=Link(uri=uri),
                core=self._core
            )
            # We don't ingest the response because we haven't fetched
            # the newly created resource yet
        elif method in (POST, PUT, PATCH, DELETE):
            nav = OrphanHALNavigator(
                link=None,
                core=self._core,
                response=response,
                parent=self,
            )
            nav._ingest_response(response)
        elif method == GET:
            nav = self
            nav._ingest_response(response)
        else: # pragma: nocover
            assert False, "This shouldn't happen"

        return nav