original_string: protected function _isMboxFile($file, $fileIsString = true)
      {
          if ($fileIsString) {
              $file = @fopen($file, 'r');
              if (!$file) {
                  return false;
              }
          } else {
              fseek($file, 0);
          }
  
          $result = false;
  
          $line = fgets($file);
          if (strpos($line, 'From ') === 0) {
              $result = true;
          }
  
          if ($fileIsString) {
              @fclose($file);
          }
  
          return $result;
      }
code: protected function _isMboxFile($file, $fileIsString = true)
      {
          if ($fileIsString) {
              $file = @fopen($file, 'r');
              if (!$file) {
                  return false;
              }
          } else {
              fseek($file, 0);
          }
  
          $result = false;
  
          $line = fgets($file);
          if (strpos($line, 'From ') === 0) {
              $result = true;
          }
  
          if ($fileIsString) {
              @fclose($file);
          }
  
          return $result;
      }
code_tokens: protected function _isMboxFile ( $ file , $ fileIsString = true ) { if ( $ fileIsString ) { $ file = @ fopen ( $ file , 'r' ) ; if ( ! $ file ) { return false ; } } else { fseek ( $ file , 0 ) ; } $ result = false ; $ line = fgets ( $ file ) ; if ( strpos ( $ line , 'From ' ) === 0 ) { $ result = true ; } if ( $ fileIsString ) { @ fclose ( $ file ) ; } return $ result ; }
docstring: check if given file is a mbox file
  
  if $file is a resource its file pointer is moved after the first line
  
  @param  resource|string $file stream resource of name of file
  @param  bool $fileIsString file is string or resource
  @return bool file is mbox file
docstring_tokens: check if given file is a mbox file