original_string: public function parse_result($str) {
          if (empty($str)) {
              throw new moodle_exception('error');
          }
          $parts = explode('&', $str);
          $result = array();
          foreach ($parts as $part){
              list($k, $v) = explode('=', $part, 2);
              $result[urldecode($k)] = urldecode($v);
          }
          if (empty($result)) {
              throw new moodle_exception('error');
          }
          return $result;
      }
code: public function parse_result($str) {
          if (empty($str)) {
              throw new moodle_exception('error');
          }
          $parts = explode('&', $str);
          $result = array();
          foreach ($parts as $part){
              list($k, $v) = explode('=', $part, 2);
              $result[urldecode($k)] = urldecode($v);
          }
          if (empty($result)) {
              throw new moodle_exception('error');
          }
          return $result;
      }
code_tokens: public function parse_result ( $ str ) { if ( empty ( $ str ) ) { throw new moodle_exception ( 'error' ) ; } $ parts = explode ( '&' , $ str ) ; $ result = array ( ) ; foreach ( $ parts as $ part ) { list ( $ k , $ v ) = explode ( '=' , $ part , 2 ) ; $ result [ urldecode ( $ k ) ] = urldecode ( $ v ) ; } if ( empty ( $ result ) ) { throw new moodle_exception ( 'error' ) ; } return $ result ; }
docstring: A method to parse oauth response to get oauth_token and oauth_token_secret
  @param string $str
  @return array
docstring_tokens: A method to parse oauth response to get oauth_token and oauth_token_secret