Return the object corresponding to a matched URL.

        Takes the matched URL conf arguments, and should return an
        object instance, or raise an `ObjectDoesNotExist` exception.
543235
def get_object(self, view_name, view_args, view_kwargs):
        
        lookup_value = view_kwargs.get(self.lookup_url_kwarg)
        parent_lookup_value = view_kwargs.get(self.parent_lookup_field)
        lookup_kwargs = {
            self.lookup_field: lookup_value,
        }
        # Try to lookup parent attr
        if parent_lookup_value:
            lookup_kwargs.update({self.parent_lookup_field: parent_lookup_value})
        return self.get_queryset().get(**lookup_kwargs)
689451
def get_object(self):
        
        obj = super(PreviewWrapper, self).get_object()

        if not obj:
            raise http.Http404

        return obj
231831
def get(self, url):
        
        return requests.get(url, params=self.data, headers=self.config.HEADERS)
1002386
def get_url(self, name, view_name, kwargs, request):
        

        # Return None if the view name is not supplied
        if not view_name:
            return None

        # Return the hyperlink, or error if incorrectly configured.
        try:
            url = self.reverse(view_name, kwargs=kwargs, request=request)
        except NoReverseMatch:
            msg = (
                'Could not resolve URL for hyperlinked relationship using '
                'view name "%s". You may have failed to include the related '
                'model in your API, or incorrectly configured the '
                '`lookup_field` attribute on this field.'
            )
            raise ImproperlyConfigured(msg % view_name)

        if url is None:
            return None

        return Hyperlink(url, name)
339779
def match_url(self, request):
        
        matched = False
        if self.exact_url:
            if re.match("%s$" % (self.url,), request.path):
                matched = True
        elif re.match("%s" % self.url, request.path):
            matched = True
        return matched
733245
def url(ref)
      config = self.class.config(@repo, ref)

      lookup = config.keys.inject({}) do |acc, key|
        id = config[key]['id']
        acc[id] = config[key]['url']
        acc
      end

      lookup[@id]
    end
581051
def get_object(self, queryset=None):
        
        # Determine the base queryset to use.
        assert queryset is None, "Passing a queryset is disabled"
        queryset = self.filter_queryset(self.get_queryset())

        # Perform the lookup filtering.
        lookup_url_kwarg = self.lookup_url_kwarg or self.lookup_field
        lookup = self.kwargs.get(lookup_url_kwarg, None)
        assert lookup is not None, "Other lookup methods are disabled"
        filter_kwargs = {self.lookup_field: lookup}
        obj = self.get_object_or_404(queryset, **filter_kwargs)

        # May raise a permission denied
        self.check_object_permissions(self.request, obj)

        return obj
603888
def get_obj_url(request, obj):
    
    if (is_callable(getattr(obj, 'get_absolute_url', None)) and
            (not hasattr(obj, 'can_see_edit_link') or
             (is_callable(getattr(obj, 'can_see_edit_link', None)) and obj.can_see_edit_link(request)))):
        return call_method_with_unknown_input(obj.get_absolute_url, request=request)
    else:
        return get_url_from_model_core(request, obj)
754869
def get_object(self, queryset=None):
        
        try:
            pk = self.kwargs.get('pk', None)

            # allow serializer without service
            obj = self.service.get(pk)
            return obj
        except self.model.DoesNotExist:
            raise Http404()
523374
def match_url(self, path, method='GET'):
        
        path = path.strip().lstrip('/')
        handler, param = self.routes.match(method + ';' + path)
        if handler: return handler, param
        if method == 'HEAD':
            handler, param = self.routes.match('GET;' + path)
            if handler: return handler, param
        handler, param = self.routes.match('ANY;' + path)
        if handler: return handler, param
        return None, {}
1335882
def get(self, model, **spec):
        

        handles = self.__find_handles(model, **spec)
        if len(handles) > 1:
            raise MultipleObjectsReturned()
        if not handles:
            raise ObjectDoesNotExist()
        return self.get_instance(model, handles[0])
431931
def get(self, **url_params):
        
        if url_params:
            self.http_method_args["params"].update(url_params)
        return self.http_method("GET")
525169
def _get_url(url):
        
        if isinstance(url, urlparse.ParseResult):
            return urlparse.urlunparse(url)
        else:
            return url
371194
def from_urlsafe(cls, urlsafe):
        
        try:
            key = ndb.Key(urlsafe=urlsafe)
        except:
            return None
        obj = key.get()
        if obj and isinstance(obj, cls):
            return obj
494228
def _get_request_url(self, instance, url):
        
        parsed = urlparse(url)

        _url = url
        if not (parsed.netloc and parsed.scheme) and is_affirmative(instance.get('spark_proxy_enabled', False)):
            master_address = self._get_master_address(instance)
            _url = urljoin(master_address, parsed.path)

        self.log.debug('Request URL returned: %s', _url)
        return _url
983320
def get_object_url(self):
        

        if self.kwargs.get(self.slug_url_kwarg, False) == \
                    unicode(getattr(self.object, self.slug_field, "")) \
                    and not self.force_add:
            url = self.request.build_absolute_uri()
        else:
            url = self.bundle.get_view_url('edit', self.request.user,
                                           {'object': self.object},
                                           self.kwargs)
        return url
1169863
def parse(self, url):
        
        parsed_url = urlparse.urlparse(url)
        try:
            default_config = self.CONFIG[parsed_url.scheme]
        except KeyError:
            raise ValueError(
                'unrecognised URL scheme for {}: {}'.format(
                    self.__class__.__name__, url))
        handler = self.get_handler_for_scheme(parsed_url.scheme)
        config = copy.deepcopy(default_config)
        return handler(parsed_url, config)