original_string: public static function is_tgz_file($archivefile) {
          if (is_a($archivefile, 'stored_file')) {
              $fp = $archivefile->get_content_file_handle();
          } else {
              $fp = fopen($archivefile, 'rb');
          }
          $firstbytes = fread($fp, 2);
          fclose($fp);
          return ($firstbytes[0] == "\x1f" && $firstbytes[1] == "\x8b");
      }
code: public static function is_tgz_file($archivefile) {
          if (is_a($archivefile, 'stored_file')) {
              $fp = $archivefile->get_content_file_handle();
          } else {
              $fp = fopen($archivefile, 'rb');
          }
          $firstbytes = fread($fp, 2);
          fclose($fp);
          return ($firstbytes[0] == "\x1f" && $firstbytes[1] == "\x8b");
      }
code_tokens: public static function is_tgz_file ( $ archivefile ) { if ( is_a ( $ archivefile , 'stored_file' ) ) { $ fp = $ archivefile -> get_content_file_handle ( ) ; } else { $ fp = fopen ( $ archivefile , 'rb' ) ; } $ firstbytes = fread ( $ fp , 2 ) ; fclose ( $ fp ) ; return ( $ firstbytes [ 0 ] == "\x1f" && $ firstbytes [ 1 ] == "\x8b" ) ; }
docstring: Checks whether a file appears to be a .tar.gz file.
  
  @param string|stored_file $archivefile
  @return bool True if file contains the gzip magic number
docstring_tokens: Checks whether a file appears to be a . tar . gz file .