original_string: protected function get_name($name, $urls) {
          // If there is a specified name, use that.
          if ($name) {
              return $name;
          }
  
          // Get filename of first URL.
          $url = reset($urls);
          $name = core_media_manager::instance()->get_filename($url);
  
          // If there is more than one url, strip the extension as we could be
          // referring to a different one or several at once.
          if (count($urls) > 1) {
              $name = preg_replace('~\.[^.]*$~', '', $name);
          }
  
          return $name;
      }
code: protected function get_name($name, $urls) {
          // If there is a specified name, use that.
          if ($name) {
              return $name;
          }
  
          // Get filename of first URL.
          $url = reset($urls);
          $name = core_media_manager::instance()->get_filename($url);
  
          // If there is more than one url, strip the extension as we could be
          // referring to a different one or several at once.
          if (count($urls) > 1) {
              $name = preg_replace('~\.[^.]*$~', '', $name);
          }
  
          return $name;
      }
code_tokens: protected function get_name ( $ name , $ urls ) { // If there is a specified name, use that. if ( $ name ) { return $ name ; } // Get filename of first URL. $ url = reset ( $ urls ) ; $ name = core_media_manager :: instance ( ) -> get_filename ( $ url ) ; // If there is more than one url, strip the extension as we could be // referring to a different one or several at once. if ( count ( $ urls ) > 1 ) { $ name = preg_replace ( '~\.[^.]*$~' , '' , $ name ) ; } return $ name ; }
docstring: Obtains suitable name for media. Uses specified name if there is one,
  otherwise makes one up.
  @param string $name User-specified name ('' if none)
  @param array $urls Array of moodle_url used to make up name
  @return string Name
docstring_tokens: Obtains suitable name for media . Uses specified name if there is one otherwise makes one up .