def resolve_format(format, path):
if format is None:<EOL><INDENT>if (re.match(r'<STR_LIT>', path)):<EOL><INDENT>return '<STR_LIT>'<EOL><DEDENT>elif (re.match(r'<STR_LIT>', path)):<EOL><INDENT>return '<STR_LIT>'<EOL><DEDENT><DEDENT>else:<EOL><INDENT>return format.lower()<EOL><DEDENT>
Looks at a file's extension and format (if any) and returns format.