Get an array of all blocks within a given region

@param string $region a block region that exists on this page.
@return array of block instances.
336680
public function get_blocks_for_region($region) {
        $this->check_is_loaded();
        $this->ensure_instances_exist($region);
        return $this->blockinstances[$region];
    }
806736
public static function findAll($page_request = null)
    {
        if($page_request != null){
            return self::listAllCountries(['page' => $page_request->getPageNumber(), 'size' => $page_request->getSize() ]);
        }else {
            return self::listAllCountries();
        }
    }
1327561
public function getRegionContents()
    {
        $array = array();
        $regions = $this->region->findAll();

        foreach ($regions as $region) {
            $first = $this->contentRegion->findOneBy(array('back' => null, 'region' => $region));

            while ($first != null) {
                $contentType = $this->contentType->findOneBy(array('content' => $first->getContent()));

                if ($contentType) {
                    $type = $contentType->getType()->getName();
                } else {
                    $type = 'default';
                }

                $array[$region->getName()][] = array(
                    'content' => $first->getContent(),
                    'size' => $first->getSize(),
                    'menu' => '',
                    'type' => $type,
                    'region' => $region->getName()
                );

                $first = $first->getNext();
            }
        }

        return $array;
    }
88710
public function loadRegion($id)
    {
        $blocks = $this->entityTypeManager->getStorage('block')->loadByProperties([
            'region' => $id,
            'theme'  => $this->themeName
        ]);

        $result = [];
        foreach($blocks as $id => $values)
        {
            $result[] = $this->loadBlock($id);
        }


        return $result;
    }
138167
public function setRegion($region)
    {
        $this->region = strtolower($region);

        $this->updateApiUrl($region);
        $this->updateApiAccessTokenUrl($region);

        return $this;
    }
1079814
public function getWroteBlocks()
    {
        if (!is_dir($this->blocks)) {
            throw new RuntimeException("cannot obtain the blocks ({$this->blocks})");
        }
        $files = array_filter(array_map(function($file) {
            $basename = basename($file);
            if (!is_numeric($basename)) {
                return false;
            }
            return [
                'offset' => (int)$basename,
                'file' => $file,
                'size' => filesize($file)
            ];
        }, glob($this->blocks . "*")));

        uasort($files, function($a, $b) {
            return $a['offset'] - $b['offset'];
        });

        return $files;
    }
210829
private static String[] getRegions(final String state) {
		if ("ACT".equals(state)) {
			return ACT_REGIONS;

		} else if ("VIC".equals(state)) {
			return VIC_REGIONS;
		} else {
			return null;
		}

	}
191040
public function _processClassDocBlock($block)
    {
        $result = [];
        if ($block instanceof \Zend\Code\Reflection\DocBlockReflection) {
            $docBlockLines = $block->getContents();
            $docBlockLines = explode("\n", $docBlockLines);
            foreach ($docBlockLines as $line) {
                $methodData = $this->_processClassDocLine($line);
                if ($methodData) {
                    $name = $methodData->getName();
                    $result[$name] = $methodData;
                }
            }
        }
        return $result;
    }
1054178
public static function findAll($page_request = null)
    {
        if($page_request != null){
            return self::listAllCountriesGeoZones(['page' => $page_request->getPageNumber(), 'size' => $page_request->getSize() ]);
        }else {
            return self::listAllCountriesGeoZones();
        }
    }
1159459
public function isPageContextRegion($region, $theme)
    {
        $regions = $this->getThemeRegionConfig($theme);
        return (isset($regions[$region]) && ($regions[$region] === self::CONTEXT_PAGE));
    }
1154258
private function get_tags(string $block){
    preg_match_all($this->pattern['tag'], $block, $tags, PREG_OFFSET_CAPTURE);
    if ( !empty($tags[0]) ){
      return $tags[0];
    }
    return [];
  }
879074
public function getBlocks($arHandle = false)
    {
        $blockIDs = $this->getBlockIDs($arHandle);

        $blocks = [];
        if (is_array($blockIDs)) {
            foreach ($blockIDs as $row) {
                $ab = Block::getByID($row['bID'], $this, $row['arHandle']);
                if (is_object($ab)) {
                    $blocks[] = $ab;
                }
            }
        }

        return $blocks;
    }
592570
public function getTotalBlocksInArea($c = false)
    {
        if (!$c) {
            $c = $this->c;
        }

        // exclude the area layout proxy block from counting.
        $this->load($c);
        $db = Database::connection();
        $r = $db->fetchColumn(
            'select count(b.bID) from CollectionVersionBlocks cvb inner join Blocks b on cvb.bID = b.bID inner join BlockTypes bt on b.btID = bt.btID where cID = ? and cvID = ? and arHandle = ? and btHandle <> ?',
            array($c->getCollectionID(), $c->getVersionID(), $this->arHandle, BLOCK_HANDLE_LAYOUT_PROXY)
        );

        // now grab sub-blocks.
        // NOTE: this will only traverse one level. Deal with it.
        $arHandles = $db->GetCol('select arHandle from Areas where arParentID = ?', array($this->arID));
        if (is_array($arHandles) && count($arHandles) > 0) {
            $v = array($c->getCollectionID(), $c->getVersionID());
            $q = 'select count(bID) from CollectionVersionBlocks where cID = ? and cvID = ? and arHandle in (';
            for ($i = 0; $i < count($arHandles); ++$i) {
                $arHandle = $arHandles[$i];
                $v[] = $arHandle;
                $q .= '?';
                if (($i + 1) < count($arHandles)) {
                    $q .= ',';
                }
            }
            $q .= ')';
            $sr = $db->fetchColumn($q, $v);
            $r += $sr;
        }

        return (int) $r;
    }
466788
public static function getCountriesForContinent($continent)
    {
        /** @var RegionDataProvider $regionDataProvider */
        $regionDataProvider = StaticContainer::get('Piwik\Intl\Data\Provider\RegionDataProvider');

        $result = array();
        $continent = strtolower($continent);
        foreach ($regionDataProvider->getCountryList() as $countryCode => $continentCode) {
            if ($continent == $continentCode) {
                $result[] = $countryCode;
            }
        }
        return array('SQL'  => "'" . implode("', '", $result) . "', ?",
                     'bind' => '-'); // HACK: SegmentExpression requires a $bind, even if there's nothing to bind
    }
1094393
private function getRegionUrls()
    {
        $regionObject = new Regions();
        $this->mwsServiceUrls = $regionObject->mwsServiceUrls;
        $this->regionMappings = $regionObject->regionMappings;
        $this->profileEndpointUrls = $regionObject->profileEndpointUrls;
    }
397858
def regions(self):
        """"""
        url = "%s/regions" % self.root
        params = {"f": "json"}
        return self._get(url=url,
                            param_dict=params,
                            proxy_url=self._proxy_url,
                            proxy_port=self._proxy_port)
1137406
public function getBlocks()
    {
        if ($this->blocks !== null) {
            return $this->blocks;
        }
        $this->findBrocks();
        return $this->blocks;
    }