Returns site query
550964
def site(self, action):
        
        query = None
        viewdays = 7
        hostpath = self.uri + self.endpoint

        if action == 'siteinfo':
            query = hostpath + (
                '?action=query'
                '&meta=siteinfo|siteviews'
                '&siprop=general|statistics'
                '&list=mostviewed&pvimlimit=max')
            query += '&pvisdays=%d' % viewdays  # meta=siteviews
            self.set_status('query', 'siteinfo|siteviews|mostviewed')
        elif action == 'sitematrix':
            query = hostpath + '?action=sitematrix'
            self.set_status('sitematrix', 'all')
        elif action == 'sitevisitors':
            query = hostpath + (
                '?action=query'
                '&meta=siteviews&pvismetric=uniques')
            query += '&pvisdays=%d' % viewdays  # meta=siteviews
            self.set_status('query', 'siteviews:uniques')

        if not query:
            raise ValueError("Could not form query")

        query += '&format=json&formatversion=2'

        return query
527328
def __query(self, query):
        
        # Switch to lxml for querying
        xml = self.document.toxml()
        return OneLogin_Saml2_Utils.query(fromstring(xml, forbid_dtd=True), query)
67096
def get_return_page(self,prior=False):
        '''  '''
        siteHistory = self.request.session.get('SITE_HISTORY',{})
        return getReturnPage(siteHistory,prior=prior)
141521
def query(self, query, inplace=True):
        
        # TODO: add to queue
        result = self.data.query(query, inplace=inplace)
        return result
100457
def site_info(request):
    ''''''
    site = get_current_site(request)
    context = {
        'WAFER_CONFERENCE_NAME': site.name,
        'WAFER_CONFERENCE_DOMAIN': site.domain,
    }
    return context
798129
public function getRoot(Site $site)
    {
        try {
            $query = $this->createQueryBuilder('s')
                    ->andWhere('s._site = :site')
                    ->andWhere('s._parent is null')
                    ->setMaxResults(1)
                    ->setParameters([
                        'site' => $site,
                    ]);

            return $query->getQuery()->getSingleResult();
        } catch (NoResultException $e) {
            return;
        } catch (\Exception $e) {
            return;
        }
    }
1023328
def current_site_url():
    """"""
    protocol = getattr(settings, 'MY_SITE_PROTOCOL', 'https')
    port     = getattr(settings, 'MY_SITE_PORT', '')
    url = '%s://%s' % (protocol, settings.SITE_DOMAIN)
    if port:
        url += ':%s' % port
    return url
745287
public function siteTitleSearchAction()
    {
        $query = $this->getEvent()->getRouteMatch()->getParam('query');
        $entityMgr = $this->getServiceLocator()->get(
            'Doctrine\ORM\EntityManager'
        );

        $currentSite = $this->getServiceLocator()->get(
            \Rcm\Service\CurrentSite::class
        );
        $siteId = $currentSite->getSiteId();

        $results = $entityMgr->createQuery(
            '
                select page.name, page.pageTitle, page.pageType from Rcm\\Entity\\Page page
                join page.site site
                where (page.name like :query or page.pageTitle like :query) and site.siteId like :siteId
            '
        )->setParameter('query', '%' . $query . '%')
            ->setParameter('siteId', '%' . $siteId . '%')
            ->getResult();

        $pageNames = [];
        foreach ($results as $result) {
            $pageNames[$result['name']] = [
                'title' => $result['pageTitle'],
                'url' => $this->urlToPage($result['name'], $result['pageType'])
            ];
        }

        return new JsonModel($pageNames);
    }
414633
public function scopeWhereSite(Builder $query, SiteInterface $site)
    {
        return $query
            ->join('person_site', 'people.id', '=', 'person_site.person_id')
            ->where('person_site.site_id', '=', $site->getId());
    }
1335527
def get_gql_query(self):
        """"""
        template_string = """query(
            $stops: [String],
            $quays: [String],
            $whitelist: InputWhiteListed,
            $numberOfDepartures: Int = 2,
            $omitNonBoarding: Boolean = true){\n"""
        if self.stops:
            template_string += GRAPHQL_STOP_TEMPLATE
        if self.quays:
            template_string += GRAPHQL_QUAY_TEMPLATE
        template_string += "}"
        template_string += GRAPHQL_CALL_FRAGMENT

        return template_string
1316984
def _query_near(*, session=None, **kwargs):
    """"""
    url_endpoint = 'http://calib.org/marine/index.html'
    if session is not None:
        resp = session.get(url_endpoint, params=kwargs)
    else:
        with requests.Session() as s:
            # Need to get the index page before query. Otherwise get bad query response that seems legit.
            s.get('http://calib.org/marine/index.html')
            resp = s.get(url_endpoint, params=kwargs)
    return resp
122773
def base_query
      ActionLog
        .where(visibility: %w(public-only all))
        .where(organization: options.fetch(:organization))
    end
474640
def get_urls(self, **kwargs):
        
        kwargs["site"] = Site.objects.get(id=current_site_id())
        return super(DisplayableSitemap, self).get_urls(**kwargs)
792862
def find_equivalent_sites(self, site):
        
        for sites in self.equivalent_sites:
            if site in sites:
                return sites

        raise ValueError("Site not in structure")
847567
def sitemap(self):
        """"""
        if (self.sitemap_name is not None):
            return(self.sitemap_name)
        return(self.sitemap_uri(self.resource_list_name))
348023
def _get_query(self, cursor):
        '''
        
        '''
        query = {'q':'*:*',
                'sort':'id desc',
                'rows':self._rows,
                'cursorMark':cursor}
        if self._date_field:
            query['sort'] = "{} asc, id desc".format(self._date_field)
        if self._per_shard:
            query['distrib'] = 'false'
        return query
168133
public function getSite()
    {
        if (!$this->hasRequest()) {
            return false;
        }

        $siteId = null;

        if ('POST' === $this->getRequest()->getMethod()) {
            $values = $this->getRequest()->get($this->getUniqid());
            $siteId = $values['site'] ?? null;
        }

        $siteId = (null !== $siteId) ? $siteId : $this->getRequest()->get('siteId');

        if ($siteId) {
            $site = $this->siteManager->findOneBy(['id' => $siteId]);

            if (!$site) {
                throw new \RuntimeException('Unable to find the site with id='.$this->getRequest()->get('siteId'));
            }

            return $site;
        }

        return false;
    }