Gets all tools associated with a site.
        @param site (TSquareSite) - The site to search for tools
        @returns A list of dictionaries representing Tsquare tools.
199321
def get_tools(self, site):
        
        # hack - gotta bypass the tsquare REST api because it kinda sucks with tools
        url = site.entityURL.replace('direct', 'portal')
        response = self._session.get(url)
        response.raise_for_status()
        # scrape the resulting html
        tools_dict_list = self._html_iface.get_tools(response.text)
        return [TSquareTool(**x) for x in tools_dict_list]
803227
public function getAllSites()
    {
        Piwik::checkUserHasSuperUserAccess();

        $sites  = $this->getModel()->getAllSites();
        $return = array();
        foreach ($sites as $site) {
            $this->enrichSite($site);
            $return[$site['idsite']] = $site;
        }

        $return = Site::setSitesFromArray($return);

        return $return;
    }
249134
def get_queryset(self):
        

        queryset = super(SingletonManager, self).get_queryset()

        # Get current site
        current_site = None
        if getattr(settings, 'SITE_ID', None) is not None:
            current_site = Site.objects.get_current()

        # If site found limit queryset to site.
        if current_site is not None:
            queryset = queryset.filter(sites=settings.SITE_ID)

        if not queryset.exists():
            # Create object (for current site) if it doesn't exist.
            obj = self.model.objects.create()
            if current_site is not None:
                obj.sites.add(current_site)

        return queryset
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;
        }
    }
821818
def get_grades(self, site):
        
        tools = self.get_tools(site)
        grade_tool_filter = [x.href for x in tools if x.name == 'gradebook-tool']
        if not grade_tool_filter:
            return []
        response = self._session.get(grade_tool_filter[0])
        response.raise_for_status()
        iframes = self._html_iface.get_iframes(response.text)
        iframe_url = ''
        for frame in iframes:
            if frame['title'] == 'Gradebook ':
                iframe_url = frame['src']
        if iframe_url == '':
            print "WARNING: NO GRADEBOOK IFRAMES FOUND"
        response = self._session.get(iframe_url)
        response.raise_for_status()
        grade_dict_list = self._html_iface.get_grades(response.text)
        return grade_dict_list
1353276
private List<CmsResourceInfo> getResourceInfos() {

        List<CmsResourceInfo> infos = new ArrayList<CmsResourceInfo>();
        for (CmsSite site : m_sitesToDelete) {
            infos.add(
                new CmsResourceInfo(site.getTitle(), site.getSiteRoot(), m_manager.getFavIcon(site.getSiteRoot())));
        }
        return infos;
    }
94587
public List<ChallengeHandler> lookup(String location) {
        List<ChallengeHandler> result = Collections.emptyList();
        if (location != null) {
            Node<ChallengeHandler, UriElement> resultNode = findBestMatchingNode(location);
            if (resultNode != null) {
                return resultNode.getValues();
            }
        }
        return result;
    }
291656
public String getSiteFromAddress(String url, String site)
    {
        int iStart = url.indexOf("//") + 2;
        iStart = url.indexOf('/', iStart);
        if (iStart == -1)
            iStart = url.length();
        if ((site != null) && (site.length() > 0))
            if (!url.equalsIgnoreCase(site))
                return site; // Return this site if different from URL
        return url.substring(0, iStart);
    }
916033
def add_site (site)
      return nil if @sites.map{|s| s[:name]}.include? site
      raise JSS::InvalidDataError, "No site in the JSS named #{site}" unless JSS::Site.all_names(api: @api).include? site
      @sites << {:name => site}
      @need_to_update = true
    end
644186
def clusters_sites_obj(clusters):
    
    result = {}
    all_clusters = get_all_clusters_sites()
    clusters_sites = {c: s for (c, s) in all_clusters.items()
                        if c in clusters}
    for cluster, site in clusters_sites.items():

        # here we want the site python-grid5000 site object
        result.update({cluster: get_site_obj(site)})
    return result
843143
public function getConnectionsBySite(Site $site)
    {
        $connections = [];

        $solrServers = $this->getConfigurationsBySite($site);
        foreach ($solrServers as $solrServer) {
            $connections[] = $this->getConnectionFromConfiguration($solrServer);
        }

        return $connections;
    }
568548
def get_site_by_id(self, id):
        
        response = self._session.get(BASE_URL_TSQUARE + '/site/{}.json'.format(id))
        response.raise_for_status()
        site_data = response.json()
        return TSquareSite(**site_data)
527522
def get_symbols(self, site='Pro', _async=False):
        
        assert site in ['Pro', 'HADAX']
        params = {}
        path = f'/v1{"/" if site == "Pro" else "/hadax/"}common/symbols'
        return api_key_get(params, path, _async=_async)
1031522
def get_symbols(self, site='Pro'):
        
        assert site in ['Pro', 'HADAX']
        params = {}
        path = f'/v1{"/" if site == "Pro" else "/hadax/"}common/symbols'

        def _wrapper(_func):
            @wraps(_func)
            def handle():
                _func(api_key_get(params, path))

            return handle

        return _wrapper
486600
function getSite(host, path) {
  // note: uses the memoized version
  return _.find(module.exports.sites(), function (site) {
    return site.host === host && site.path === path;
  });
}
431970
protected function getRolesFromSite($site)
	{
		$newDataSet = new AnyDataset();
		$it = $this->user->getRolesIterator($site);
		while ($it->hasNext()) {
			$sr = $it->moveNext();
			$dataArray = $sr->getFieldArray($this->user->getRolesTable()->Role);
			if (sizeof($dataArray) > 0) {
				foreach ($dataArray as $roles) {
					$siteName = $sr->getField($this->user->getRolesTable()->Site);
					if ($siteName == "_all") {
						$siteName = $this->myWords->Value("TEXT_ALLSITES");
					}
					$newDataSet->appendRow();
					$newDataSet->addField($this->user->getRolesTable()->Site, $siteName);
					$newDataSet->addField($this->user->getRolesTable()->Role, $roles);
				}	
			}
		}
		return $newDataSet;
	}
559650
private List<Location> getAllSubLocations(Location location) {
		List<Location> flatSubLocations = new ArrayList<Location>();
		for (Location l : location.getSubLocations()) {
			if (l.isComplex()) {
				flatSubLocations.addAll(getAllSubLocations(l));
			}
			else {
				flatSubLocations.add(l);
			}
		}
		return flatSubLocations;
	}