original_string: public function trans_format($name) {
          $name = trim($name);
  
          if ($name == 'moodle_auto_format') {
              return FORMAT_MOODLE;
          } else if ($name == 'html') {
              return FORMAT_HTML;
          } else if ($name == 'plain_text') {
              return FORMAT_PLAIN;
          } else if ($name == 'wiki_like') {
              return FORMAT_WIKI;
          } else if ($name == 'markdown') {
              return FORMAT_MARKDOWN;
          } else {
              debugging("Unrecognised text format '{$name}' in the import file. Assuming 'html'.");
              return FORMAT_HTML;
          }
      }
code: public function trans_format($name) {
          $name = trim($name);
  
          if ($name == 'moodle_auto_format') {
              return FORMAT_MOODLE;
          } else if ($name == 'html') {
              return FORMAT_HTML;
          } else if ($name == 'plain_text') {
              return FORMAT_PLAIN;
          } else if ($name == 'wiki_like') {
              return FORMAT_WIKI;
          } else if ($name == 'markdown') {
              return FORMAT_MARKDOWN;
          } else {
              debugging("Unrecognised text format '{$name}' in the import file. Assuming 'html'.");
              return FORMAT_HTML;
          }
      }
code_tokens: public function trans_format ( $ name ) { $ name = trim ( $ name ) ; if ( $ name == 'moodle_auto_format' ) { return FORMAT_MOODLE ; } else if ( $ name == 'html' ) { return FORMAT_HTML ; } else if ( $ name == 'plain_text' ) { return FORMAT_PLAIN ; } else if ( $ name == 'wiki_like' ) { return FORMAT_WIKI ; } else if ( $ name == 'markdown' ) { return FORMAT_MARKDOWN ; } else { debugging ( "Unrecognised text format '{$name}' in the import file. Assuming 'html'." ) ; return FORMAT_HTML ; } }
docstring: Translate human readable format name
  into internal Moodle code number
  Note the reverse function is called get_format.
  @param string name format name from xml file
  @return int Moodle format code
docstring_tokens: Translate human readable format name into internal Moodle code number Note the reverse function is called get_format .