original_string: public function find_instance($instanceid) {
          foreach ($this->regions as $region => $notused) {
              $this->ensure_instances_exist($region);
              foreach($this->blockinstances[$region] as $instance) {
                  if ($instance->instance->id == $instanceid) {
                      return $instance;
                  }
              }
          }
          throw new block_not_on_page_exception($instanceid, $this->page);
      }
code: public function find_instance($instanceid) {
          foreach ($this->regions as $region => $notused) {
              $this->ensure_instances_exist($region);
              foreach($this->blockinstances[$region] as $instance) {
                  if ($instance->instance->id == $instanceid) {
                      return $instance;
                  }
              }
          }
          throw new block_not_on_page_exception($instanceid, $this->page);
      }
code_tokens: public function find_instance ( $ instanceid ) { foreach ( $ this -> regions as $ region => $ notused ) { $ this -> ensure_instances_exist ( $ region ) ; foreach ( $ this -> blockinstances [ $ region ] as $ instance ) { if ( $ instance -> instance -> id == $ instanceid ) { return $ instance ; } } } throw new block_not_on_page_exception ( $ instanceid , $ this -> page ) ; }
docstring: Find a given block by its instance id
  
  @param integer $instanceid
  @return block_base
docstring_tokens: Find a given block by its instance id