code: def retrieve_resource(collection, key):
      
      session = _get_session()
      cls = endpoint_class(collection)
      resource = session.query(cls).get(key)
      if resource is None:
          raise InvalidAPIUsage(404)
      return resource
docs: Return the resource in *collection* identified by key *key*.
  
      :param string collection: a :class:`sandman.model.Model` endpoint
      :param string key: primary key of resource
      :rtype: class:`sandman.model.Model`