def data_filename(fname, pkgdir="<STR_LIT>"):
for static_dir in STATIC_PATH:<EOL><INDENT>static_filename = os.path.join(static_dir, fname)<EOL>if os.path.exists(static_filename):<EOL><INDENT>return static_filename<EOL><DEDENT>if pkgdir:<EOL><INDENT>static_filename = os.path.join(static_dir, pkgdir, fname)<EOL>if os.path.exists(static_filename):<EOL><INDENT>return static_filename<EOL><DEDENT><DEDENT><DEDENT>raise CoverageException("<STR_LIT>" % fname)<EOL>
Return the path to a data file of ours.

    The file is searched for on `STATIC_PATH`, and the first place it's found,
    is returned.

    Each directory in `STATIC_PATH` is searched as-is, and also, if `pkgdir`
    is provided, at that subdirectory.