

def _create_navigator(self, response, raise_exc=True):
    'Create the appropriate navigator from an api response'
    method = response.request.method
    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)):
        nav = HALNavigator(link=Link(uri=response.headers['Location']), core=self._core)
    elif (method in (POST, PUT, PATCH, DELETE)):
        nav = OrphanHALNavigator(link=None, core=self._core, response=response, parent=self)
        nav._ingest_response(response)
    elif (nav == GET):
        nav = self
        nav._ingest_response(response)
    else:
        assert False, "This shouldn't happen"
    return nav

dataset/ETHPy150Open deontologician/restnavigator/restnavigator/halnav.py HALNavigator._create_navigator/VarMisuse@153/211 `method`->`nav`