Given a page UUID (and optional version), returns a JSON object of
    results, as in xpath_book()
518487
def xpath_page(request, uuid, version):
    """"""
    xpath_string = request.params.get('q')
    return execute_xpath(xpath_string, 'xpath-module', uuid, version)
1283964
def load_pages_json(pages_json_path)
      basename = File.basename pages_json_path
      rel_dir = File.dirname pages_json_path
      rel_dir = rel_dir[self.source.size..rel_dir.size]
      page = ::JekyllPagesApi::PageWithoutAFile.new(
        self, self.source, rel_dir, basename)
      page.output = File.read(pages_json_path)
      self.pages << page
    end
392591
async function getReadersUuids(channelName, paths) {
    paths = paths || getPaths(channelName);
    const readersPath = paths.readers;
    const files = await readdir(readersPath);

    return files
        .map(file => file.split('.'))
        .filter(split => split[1] === 'json') // do not scan .socket-files
        .map(split => split[0]);
}
1357111
def get_foreign_page_id_from_type(self, page_type):
        '''
        
        '''
        # TODO: log this
        response = requests.get("{}pages/?type={}".format(
            self.api_url, page_type))
        content = json.loads(response.content)
        return content["items"][0]["id"]
976739
def get_pyquery(self, tree=None, page_numbers=None):
        
        if not page_numbers:
            page_numbers = []
        if tree is None:
            if not page_numbers and self.tree is not None:
                tree = self.tree
            else:
                tree = self.get_tree(page_numbers)
        if hasattr(tree, 'getroot'):
            tree = tree.getroot()
        return PyQuery(tree, css_translator=PDFQueryTranslator())
946323
def _parse_reverse_json(self, page, exactly_one=True):
        
        place = page.get('result')

        if not place:
            self._check_status(page.get('status'))
            return None

        location = place.get('formatted_address').encode('utf-8')
        latitude = place['location']['lat']
        longitude = place['location']['lng']

        location = Location(location, (latitude, longitude), place)
        if exactly_one:
            return location
        else:
            return [location]
894840
def get_page(self, start_element=0, num_elements=None):
        """"""
        if num_elements is None:
            num_elements = self.batch_size
        specs = self.specs.copy()
        specs.update(start_element=start_element, num_elements=num_elements)
        return self.client.get(self.service_name, **specs)
1354849
def get_books_containing_page(cursor, uuid, version,
                              context_uuid=None, context_version=None):
    """"""
    with db_connect() as db_connection:
        # Uses a RealDictCursor instead of the regular cursor
        with db_connection.cursor(
                    cursor_factory=psycopg2.extras.RealDictCursor
                ) as real_dict_cursor:
            # In the future the books-containing-page SQL might handle
            # all of these cases. For now we branch the code out in here.
            if context_uuid and context_version:
                return [get_book_info(cursor, real_dict_cursor, context_uuid,
                                      context_version, uuid, version)]
            else:
                portal_type = get_portal_type(cursor, uuid, version)
                if portal_type == 'Module':
                    real_dict_cursor.execute(SQL['get-books-containing-page'],
                                             {'document_uuid': uuid,
                                              'document_version': version})
                    return real_dict_cursor.fetchall()
                else:
                    # Books are currently not in any other book
                    return []
421033
def document
      json = Net::HTTP.get_response URI.parse(query_string(@query))
      json.body
    end
1099015
def getICMByUUID(uuid: str):
    
    _metadata = ICMMetadata.query.filter_by(id=uuid).first().deserialize()
    del _metadata["model_id"]
    return jsonify(_metadata)
310086
def get_page(url):
    
    response = requests.get(url)
    handle_error(response, 200)
    data = response.json()
    return data
941730
def _get_results(self, page):
		""""""

		soup = _get_soup(page)
		details = soup.find_all("tr", class_="odd")
		even = soup.find_all("tr", class_="even")
		# Join the results
		for i in range(len(even)):
			details.insert((i * 2)+1, even[i])

		return self._parse_details(details)
345712
def execute_xpath(xpath_string, sql_function, uuid, version):
    """"""
    settings = get_current_registry().settings
    with db_connect() as db_connection:
        with db_connection.cursor() as cursor:

            try:
                cursor.execute(SQL[sql_function],
                               {'document_uuid': uuid,
                                'document_version': version,
                                'xpath_string': xpath_string})
            except psycopg2.Error as e:
                exc = httpexceptions.HTTPBadRequest()
                exc.explanation = e.pgerror
                raise exc

            for res in cursor.fetchall():
                yield {'name': res[0],
                       'uuid': res[1],
                       'version': res[2],
                       'xpath_results': res[3]}
335209
def get_tree(ident_hash, cursor, as_collated=False):
    """"""
    uuid, version = split_ident_hash(ident_hash)
    cursor.execute(SQL['get-tree-by-uuid-n-version'],
                   (uuid, version, as_collated,))
    try:
        tree = cursor.fetchone()[0]
    except TypeError:  # NoneType
        raise ContentNotFound()
    if type(tree) in (type(''), type(u'')):
        return json.loads(tree)
    else:
        return tree
1085582
def _load(self, id, data):
        
        if isinstance(data, bytes):  # pragma: no cover Python >= 3.0
            data = data.decode('utf-8')

        document = json.loads(data)
        document['_id'] = id
        return document
1172814
def getJson(cls, url, method='GET', headers={}, data=None, socket=None, timeout=120):
        
        if not 'Content-Type' in headers:
            headers['Content-Type'] = ['application/json']

        body = yield cls().getBody(url, method, headers, data, socket, timeout)

        defer.returnValue(json.loads(body))
96442
def get_page_from_string_or_id(page_string, lang=None):
    """"""
    if type(page_string) == int:
        return Page.objects.get(pk=int(page_string))
    # if we have a string coming from some templates templates
    is_text = isinstance(page_string, SafeText)
    import sys
    PY3 = sys.version > '3'
    if PY3:
        is_string = isinstance(page_string, str)
    else:
        is_string = isinstance(page_string, unicode) or isinstance(page_string, str)
    if is_text or is_string:
        if page_string.isdigit():
            return Page.objects.get(pk=int(page_string))
        return Page.objects.from_path(page_string, lang)
    # in any other case we return the input becasue it's probably
    # a Page object.
    return page_string