Constructs the "GET" URL. The functions is used by the get_object method
        First Category of "GET" URL construction. Again calling it first category because more
        complex functions  maybe added later.
977400
def get_object_cat1(con, token, cat, kwargs):
        
        req_str = "/"+kwargs['id']+"?"               #/id?
        req_str += "access_token="+token             #/id?@acces_token=......
        del kwargs['id']
        
        key = settings.get_object_cat1_param[cat]    #get the param name for the category(single, multiple)
        req_str += "&"+key+"="                       #/id?@acces_token=......key=
        if key in kwargs.keys():
                length = len( kwargs[key] )
                for i in range(length):
                        if i == 0:
                                req_str +=  kwargs[key][i]
                        else:
                                req_str +=  ","+kwargs[key][i]        
        else:
                return "Parameter Error"
        
        res = wiring.send_request("GET", con, req_str, '')
        return res
738534
def _get(self, version, method, url_or_urls, **kwargs):
        
        if not url_or_urls:
            raise ValueError('%s requires a url or a list of urls given: %s' %
                             (method.title(), url_or_urls))

        # a flag we can use instead of calling isinstance() all the time
        multi = isinstance(url_or_urls, list)

        # throw an error early for too many URLs
        if multi and len(url_or_urls) > 20:
            raise ValueError('Embedly accepts only 20 urls at a time. Url '
                             'Count:%s' % len(url_or_urls))

        query = ''

        key = kwargs.get('key', self.key)

        # make sure that a key was set on the client or passed in
        if not key:
            raise ValueError('Requires a key. None given: %s' % key)

        kwargs['key'] = key

        query += urlencode(kwargs)

        if multi:
            query += '&urls=%s&' % ','.join([quote(url) for url in url_or_urls])
        else:
            query += '&url=%s' % quote(url_or_urls)

        url = 'http://api.embed.ly/%s/%s?%s' % (version, method, query)

        http = httplib2.Http(timeout=self.timeout)

        headers = {'User-Agent': self.user_agent,
                   'Connection': 'close'}

        resp, content = http.request(url, headers=headers)

        if resp['status'] == '200':
            data = json.loads(content.decode('utf-8'))

            if kwargs.get('raw', False):
                data['raw'] = content
        else:
            data = {'type': 'error',
                    'error': True,
                    'error_code': int(resp['status'])}

        if multi:
            return map(lambda url, data: Url(data, method, url),
                       url_or_urls, data)

        return Url(data, method, url_or_urls)
353584
private function constructURL()
    {
        $cat = $this->getCategory()->getCat();
        $dashed = $this->getUrlisedTitle();
        $output = $cat.'/'.$this->getId().'/'.$dashed.'/'; // output: CAT/ID/TITLE/
        return $output;
    }
652653
def object_url(self, object_t, object_id=None, relation=None, **kwargs):
        
        if object_t not in self.objects_types:
            raise TypeError("{} is not a valid type".format(object_t))
        request_items = (
            str(item) for item in [object_t, object_id, relation] if item is not None
        )
        request = "/".join(request_items)
        base_url = self.url(request)
        if self.access_token is not None:
            kwargs["access_token"] = str(self.access_token)
        if kwargs:
            for key, value in kwargs.items():
                if not isinstance(value, str):
                    kwargs[key] = str(value)
            # kwargs are sorted (for consistent tests between Python < 3.7 and >= 3.7)
            sorted_kwargs = SortedDict.from_dict(kwargs)
            result = "{}?{}".format(base_url, urlencode(sorted_kwargs))
        else:
            result = base_url
        return result
946916
def add_get(self, *args, **kwargs):
        
        return self.add_route(hdrs.METH_GET, *args, **kwargs)
96813
def route(self, path_regex, methods=['GET'], doc=True):
        
        def register_func(func):
            """
            Decorator implementation
            """
            if doc:
                self.env['doc'].append({'url': path_regex, 'methods': ', '.join(methods), 'doc': func.__doc__})
            for method in methods:
                self._handlers[method].append((re.compile(path_regex), func))
            return func # Return the original function
        return register_func
74005
def handle_get_request(self):
        
        self.objects = self.get_objects()
        self.response = self.get_response_handler()

        self.response.process(self.objects)

        return self.list_response()
1324327
function request(url, fn) {
    var method = 'GET';

    if ('string' == typeof fn) {
        method = url;
        url = fn;
        fn = arguments[2];
    }

    fn = fn || function () {
    };

    o.ajax({ type: method, url: url })
        .success(function (res) {
            res.error
                ? error(res.error)
                : fn(res);
        });
}
381680
def get(self, request, *args, **kwargs):
        

        self.object = self.get_object()
        return self.render(request, obj=self.object,
                           done_url=self.get_done_url())
755474
def construct_url(self):
        """"""
        path = [self.path]
        path.extend([str(x) for x in self.params])

        url = self.client.base_url + '/'.join(x for x in path if x)
        query = self.kwargs.get('query')

        if query:
            # Dict -> List
            if type(query) is dict:
                query = query.items()

            # Remove items with `None` value
            query = [
                (k, v) for (k, v) in query
                if v is not None
            ]

            # Encode query, append to URL
            url += '?' + urlencode(query)

        return url
823268
def url_for(obj, **kw):
    
    if isinstance(obj, str):
        return flask_url_for(obj, **kw)

    try:
        return current_app.default_view.url_for(obj, **kw)
    except KeyError:
        if hasattr(obj, "_url"):
            return obj._url
        elif hasattr(obj, "url"):
            return obj.url

    raise BuildError(repr(obj), kw, "GET")
85171
def get_object(self, **kwargs) ->Model:
        
        queryset = self.filter_queryset(
            queryset=self.get_queryset(**kwargs),
            **kwargs
        )

        # Perform the lookup filtering.
        lookup_url_kwarg = self.lookup_url_kwarg or self.lookup_field

        assert lookup_url_kwarg in kwargs, (
                'Expected view %s to be called with a URL keyword argument '
                'named "%s". Fix your URL conf, or set the `.lookup_field` '
                'attribute on the view correctly.' %
                (self.__class__.__name__, lookup_url_kwarg)
        )

        filter_kwargs = {self.lookup_field: kwargs[lookup_url_kwarg]}

        obj = get_object_or_404(queryset, **filter_kwargs)
        # TODO check_object_permissions

        return obj
936271
function constructSortingFunction(comp) {
		var funcStr = 'function(arr) { return arr.sort(%comp%); };',
			func;
		funcStr = funcStr.replace('%comp%', comp.toString());
		
		// Eval is evil but necessary in this case
		eval('func = '+ funcStr);
		return func;
	}
1312565
def get_object(self, view_name, view_args, view_kwargs):
        
        lookup_value = view_kwargs[self.lookup_url_kwarg]
        lookup_kwargs = {self.lookup_field: lookup_value}
        return self.get_queryset().get(**lookup_kwargs)
66113
def get_url(self, obj, view_name, request, format):
        
        # Unsaved objects will not yet have a valid URL.
        if hasattr(obj, 'pk') and obj.pk in (None, ''):
            return None

        # default lookup from rest_framework.relations.HyperlinkedRelatedField
        lookup_value = getattr(obj, self.lookup_field)
        kwargs = {self.lookup_url_kwarg: lookup_value}

        # multi-level lookup
        for parent_lookup_kwarg in list(self.parent_lookup_kwargs.keys()):
            underscored_lookup = self.parent_lookup_kwargs[parent_lookup_kwarg]

            # split each lookup by their __, e.g. "parent__pk" will be split into "parent" and "pk", or
            # "parent__super__pk" would be split into "parent", "super" and "pk"
            lookups = underscored_lookup.split('__')

            # use the Django ORM to lookup this value, e.g., obj.parent.pk
            lookup_value = reduce(getattr, [obj] + lookups)

            # store the lookup_name and value in kwargs, which is later passed to the reverse method
            kwargs.update({parent_lookup_kwarg: lookup_value})

        return self.reverse(view_name, kwargs=kwargs, request=request, format=format)
827982
def get(self, url, headers=None, kwargs=None):
        
        return self._request(
            method='get',
            url=url,
            headers=headers,
            kwargs=kwargs
        )
1035505
def import_module_and_get_function(whole_function):
        
        module, function = whole_function.rsplit('.', 1)
        app_module = importlib.import_module(module)
        app_function = getattr(app_module, function)
        return app_function