original_string: public function get_related_tags() {
          $manual = $this->get_manual_related_tags();
          $automatic = $this->get_correlated_tags();
          $relatedtags = array_merge($manual, $automatic);
  
          // Remove duplicated tags (multiple instances of the same tag).
          $seen = array();
          foreach ($relatedtags as $instance => $tag) {
              if (isset($seen[$tag->id])) {
                  unset($relatedtags[$instance]);
              } else {
                  $seen[$tag->id] = 1;
              }
          }
  
          return $relatedtags;
      }
code: public function get_related_tags() {
          $manual = $this->get_manual_related_tags();
          $automatic = $this->get_correlated_tags();
          $relatedtags = array_merge($manual, $automatic);
  
          // Remove duplicated tags (multiple instances of the same tag).
          $seen = array();
          foreach ($relatedtags as $instance => $tag) {
              if (isset($seen[$tag->id])) {
                  unset($relatedtags[$instance]);
              } else {
                  $seen[$tag->id] = 1;
              }
          }
  
          return $relatedtags;
      }
code_tokens: public function get_related_tags ( ) { $ manual = $ this -> get_manual_related_tags ( ) ; $ automatic = $ this -> get_correlated_tags ( ) ; $ relatedtags = array_merge ( $ manual , $ automatic ) ; // Remove duplicated tags (multiple instances of the same tag). $ seen = array ( ) ; foreach ( $ relatedtags as $ instance => $ tag ) { if ( isset ( $ seen [ $ tag -> id ] ) ) { unset ( $ relatedtags [ $ instance ] ) ; } else { $ seen [ $ tag -> id ] = 1 ; } } return $ relatedtags ; }
docstring: Returns tags related to a tag
  
  Related tags of a tag come from two sources:
  - manually added related tags, which are tag_instance entries for that tag
  - correlated tags, which are calculated
  
  @return core_tag_tag[] an array of tag objects
docstring_tokens: Returns tags related to a tag