def guess_export_format(filename, data, **kwargs):
<EOL>(_,filename) = os.path.split(filename)<EOL>fnm = filename.lower()<EOL>fmt = None<EOL>es = sorted(((k,e) for (k,es) in six.iteritems(exporters) for e in es[<NUM_LIT:1>]),<EOL>key=lambda x:-len(x[<NUM_LIT:1>]))<EOL>for (k,e) in es:<EOL><INDENT>if fnm.endswith(('<STR_LIT:.>' + e) if e[<NUM_LIT:0>] != '<STR_LIT:.>' else e):<EOL><INDENT>return k<EOL><DEDENT><DEDENT>for (k,(_,_,sniff)) in six.iteritems(exporters):<EOL><INDENT>try:<EOL><INDENT>if sniff(filename, data, **kwargs): return k<EOL><DEDENT>except Exception: pass<EOL><DEDENT>return None<EOL>
guess_export_format(filename, data) attempts to guess the export file format for the given
  filename and data (to be exported); it does this guessing by looking at the file extension and
  using registered sniff-tests from exporters.  It will not attempt to save the file, so if the
  extension of the filename is missing, it is less likely that this function will deduce the
  file-type (though save will often succeeed at extracting the data by trying all types
  exhaustively). If guess_export_format cannot deduce the format, it yields None.

Note that if the filename has an extension that is recognized by neuropythy but the data itself
is inappropriate for that format, this function will never look beyond the extention in the
filename; neither this function nor save perform that level of deduction.

Keyword arguments that are passed to save should also be passed to guess_export_format.