original_string: public function getHead()
      {
          $head = $this->dom->getElementsByTagName('head');
          if ($head->length) {
              return $head->item(0);
          }
  
          $headelt = $this->dom->createElement('head');
          $this->dom->documentElement->insertBefore($headelt, $this->dom->documentElement->firstChild);
  
          return $headelt;
      }
code: public function getHead()
      {
          $head = $this->dom->getElementsByTagName('head');
          if ($head->length) {
              return $head->item(0);
          }
  
          $headelt = $this->dom->createElement('head');
          $this->dom->documentElement->insertBefore($headelt, $this->dom->documentElement->firstChild);
  
          return $headelt;
      }
code_tokens: public function getHead ( ) { $ head = $ this -> dom -> getElementsByTagName ( 'head' ) ; if ( $ head -> length ) { return $ head -> item ( 0 ) ; } $ headelt = $ this -> dom -> createElement ( 'head' ) ; $ this -> dom -> documentElement -> insertBefore ( $ headelt , $ this -> dom -> documentElement -> firstChild ) ; return $ headelt ; }
docstring: Returns the HEAD element, or creates one if it doesn't exist.
  
  @return DOMElement  HEAD element.
docstring_tokens: Returns the HEAD element or creates one if it doesn t exist .