original_string: public function get_sha1() {
  
          if ($this->plugin && $this->editor) {
              $plugin = $this->get_submission_plugin();
              $options = portfolio_format_text_options();
              $options->context = context_module::instance($this->cmid);
  
              $text = format_text($plugin->get_editor_text($this->editor, $this->sid),
                                  $plugin->get_editor_format($this->editor, $this->sid),
                                  $options);
              $textsha1 = sha1($text);
              $filesha1 = '';
              try {
                  $filesha1 = $this->get_sha1_file();
              } catch (portfolio_caller_exception $e) {
                  // No files.
              }
              return sha1($textsha1 . $filesha1);
          }
          return $this->get_sha1_file();
      }
code: public function get_sha1() {
  
          if ($this->plugin && $this->editor) {
              $plugin = $this->get_submission_plugin();
              $options = portfolio_format_text_options();
              $options->context = context_module::instance($this->cmid);
  
              $text = format_text($plugin->get_editor_text($this->editor, $this->sid),
                                  $plugin->get_editor_format($this->editor, $this->sid),
                                  $options);
              $textsha1 = sha1($text);
              $filesha1 = '';
              try {
                  $filesha1 = $this->get_sha1_file();
              } catch (portfolio_caller_exception $e) {
                  // No files.
              }
              return sha1($textsha1 . $filesha1);
          }
          return $this->get_sha1_file();
      }
code_tokens: public function get_sha1 ( ) { if ( $ this -> plugin && $ this -> editor ) { $ plugin = $ this -> get_submission_plugin ( ) ; $ options = portfolio_format_text_options ( ) ; $ options -> context = context_module :: instance ( $ this -> cmid ) ; $ text = format_text ( $ plugin -> get_editor_text ( $ this -> editor , $ this -> sid ) , $ plugin -> get_editor_format ( $ this -> editor , $ this -> sid ) , $ options ) ; $ textsha1 = sha1 ( $ text ) ; $ filesha1 = '' ; try { $ filesha1 = $ this -> get_sha1_file ( ) ; } catch ( portfolio_caller_exception $ e ) { // No files. } return sha1 ( $ textsha1 . $ filesha1 ) ; } return $ this -> get_sha1_file ( ) ; }
docstring: Calculate a sha1 has of either a single file or a list
  of files based on the data set by load_data.
  
  @return string
docstring_tokens: Calculate a sha1 has of either a single file or a list of files based on the data set by load_data .