instead of making a query, provide a list of article URIs manually, and then produce the desired results on top of them
349284
def initWithArticleUriWgtList(uriWgtList):
        
        q = QueryArticles()
        assert isinstance(uriWgtList, list), "uriList has to be a list of strings that represent article uris"
        q.queryParams = { "action": "getArticles", "articleUriWgtList": ",".join(uriWgtList) }
        return q
578313
def _build_query_url(self, page = None, verbose = False):
        
        query = []
#        # build the filters
#        for afilter in self.filters.keys():
#            value = self.filters[afilter]
#            print"filter:%s value:%s" % (afilter,value)
#            value = urlencode(value)
#            query_str = u"%s=%s" % (afilter, value)
        if len(self.filters) > 0:
            query.append(urlencode(self.filters))
        if self.sort:
            query_str = u"%s=%s" % (u"sort", self.sort)
            query.append(query_str)
        if self.sort_by:
            query_str = u"%s=%s" % (u"sort_by", self.sort_by)
            query.append(query_str)
        if self.per_page:
            query_str = u"%s=%s" % (u"per_page", self.per_page)
            query.append(query_str)
        if page:
            query_str = u"%s=%s" % (u"page", page)
            query.append(query_str)
        query = u"?%s" % (u"&".join(query))
        url = u"%s%s" % (self.get_list_endpoint()['href'],query)
        url = u"%s%s%s" % (self.__api__.base_url, API_BASE_PATH, url)
        msg = "_build_query_url: url:%s" % url
        log.debug(msg)
        if verbose:
            print msg
        return url
636915
def processSearch(query, tld='com', lang='en', num=10, start=0, stop=50, pause=2.0, only_standard=False):
    ''' 
        

    '''
    uriList = search(query, tld=tld, lang=lang, num=int(num), start=int(start), stop=int(stop), pause=float(pause),only_standard=only_standard)       
    
    # Dictionary containing the URI objects
    results = []
    
    # Building the objects
    for uri in uriList:
        aux = {}
        aux["type"] = "i3visio.uri"
        aux["value"] = uri        
        aux["attributes"] = []
        results.append(aux)

    return results
346832
def all_resource_urls(query):
    '''  '''
    urls = []
    next = True
    while next:
        response = requests.get(query)
        json_data = json.loads(response.content)
        for resource in json_data['results']:
            urls.append(resource['url'])
        if bool(json_data['next']):
            query = json_data['next']
        else:
            next = False
    return urls
558834
def query_string(context, **kwargs):
    """"""
    params = context["request"].GET.copy()

    for key, value in list(kwargs.items()):
        params[key] = value

    return "?" + params.urlencode()
746095
function retrieveByURI(uri, callback) {
  var query = {
    query: {
      term: {
        uri : uri
      }
    }
  };
  getEs().search({ _index : GLOBAL.config.ESEARCH._index, _type : 'contentItem'}, query, function(err, res) {
    if (!err && res && res.hits.total) {
      if (res.hits.total > 1) {
        // That would be weird.
        throw new Error('more than one result for', uri);
      }
      res = res.hits.hits[0];
    }
    callback(err, res);
  });
}
868547
def fetch(self, uri, mode=5, after=0, parent='any',
              order_by='id', asc=1, limit=None):
        
        sql = ['SELECT comments.* FROM comments INNER JOIN threads ON',
               '    threads.uri=? AND comments.tid=threads.id AND (? | comments.mode) = ?',
               '    AND comments.created>?']

        sql_args = [uri, mode, mode, after]

        if parent != 'any':
            if parent is None:
                sql.append('AND comments.parent IS NULL')
            else:
                sql.append('AND comments.parent=?')
                sql_args.append(parent)

        # custom sanitization
        if order_by not in ['id', 'created', 'modified', 'likes', 'dislikes']:
            order_by = 'id'
        sql.append('ORDER BY ')
        sql.append(order_by)
        if not asc:
            sql.append(' DESC')

        if limit:
            sql.append('LIMIT ?')
            sql_args.append(limit)

        rv = self.db.execute(sql, sql_args).fetchall()
        for item in rv:
            yield dict(zip(Comments.fields, item))
1281091
def urlencoded(body, charset='ascii', **kwargs):
    """"""
    return parse_query_string(text(body, charset=charset), False)
273667
def doi_uri_to_doi(value):
    ""
    if value is None:
        return value
    replace_values = ['http://dx.doi.org/', 'https://dx.doi.org/',
                      'http://doi.org/', 'https://doi.org/']
    for replace_value in replace_values:
        value = value.replace(replace_value, '')
    return value
1338958
def http_build_query(params = {})
        params.collect do |k,v|
          "#{URI.encode(k.to_s)}=#{URI.encode(v.to_s)}" unless v.nil?
        end.compact.join('&')
      end
426247
def get(self, uri, query=None, **kwargs):
        """"""
        return self.fetch('get', uri, query, **kwargs)
1022167
def _format(self):
        
        self.log.debug("Formatting URLs to request")
        items = list()
        for i in range(0, self.limit, 10):
            query = '"%s" %s' % (self.domain, self.modifier)
            url = self.host + "/search?q=" + query + "&first=" + str(i)
            items.append(url)
        self.log.debug("URLs were generated")
        return items
471753
def uris(self):
        """"""
        uris = []
        for r in self:
            uris.append(r.uri)
        return(uris)
829031
def match_uriinfo(cls, info):
        
        items = sorted(
            cls._entries.items(),
            key=lambda matcher_entries: matcher_entries[0].priority,
            reverse=True,
        )
        for matcher, value in items:
            if matcher.matches(info):
                return (matcher, info)

        return (None, [])
801829
def _urlnorm(cls, uri):
        """"""
        (scheme, authority, path, query, fragment) = parse_uri(uri)
        if not scheme or not authority:
            raise Exception("Only absolute URIs are allowed. uri = %s" % uri)

        scheme = scheme.lower()
        authority = authority.lower()

        if not path:
            path = "/"

        # Could do syntax based normalization of the URI before
        # computing the digest. See Section 6.2.2 of Std 66.
        request_uri = query and "?".join([path, query]) or path
        defrag_uri = scheme + "://" + authority + request_uri

        return defrag_uri
593076
def _construct_query_for_uris_and_graphs(uris_and_graphs)
      value_pairs = uris_and_graphs.map do |(uri, graph)|
        u = RDF::URI.new(uri).to_base
        g = graph ? RDF::URI.new(graph).to_base : 'UNDEF'
        "(#{u} #{g})"
      end
      query = "CONSTRUCT { ?uri ?p ?o . #{ self.all_triples_construct("?uri") }} WHERE { GRAPH ?g { ?uri ?p ?o . #{ self.all_triples_where("?uri") } VALUES (?uri ?g) { #{ value_pairs.join(' ') } } } }"
    end
369627
def request_uri(self):
        """"""
        uri = self.path or '/'

        if self.query is not None:
            uri += '?' + self.query

        return uri