def identify_gwf(origin, filepath, fileobj, *args, **kwargs):
<EOL>if fileobj is not None:<EOL><INDENT>loc = fileobj.tell()<EOL>fileobj.seek(<NUM_LIT:0>)<EOL>try:<EOL><INDENT>if fileobj.read(<NUM_LIT:4>) == GWF_SIGNATURE:<EOL><INDENT>return True<EOL><DEDENT><DEDENT>finally:<EOL><INDENT>fileobj.seek(loc)<EOL><DEDENT><DEDENT>if filepath is not None:<EOL><INDENT>if filepath.endswith('<STR_LIT>'):<EOL><INDENT>return True<EOL><DEDENT>if filepath.endswith(('<STR_LIT>', '<STR_LIT>')):<EOL><INDENT>try:<EOL><INDENT>cache = read_cache(filepath)<EOL><DEDENT>except IOError:<EOL><INDENT>return False<EOL><DEDENT>else:<EOL><INDENT>if cache[<NUM_LIT:0>].path.endswith('<STR_LIT>'):<EOL><INDENT>return True<EOL><DEDENT><DEDENT><DEDENT><DEDENT>
Identify a filename or file object as GWF

    This function is overloaded in that it will also identify a cache file
    as 'gwf' if the first entry in the cache contains a GWF file extension