<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def parse_file(filename, parse_direction=False, **kwargs):
 """ Return an OSM networkx graph from the input OSM file Only works with OSM xml, xml.bz2 and pbf files. This function cannot take OSM QA tile files. Use parse_qa_tile() for QA tiles. """

    importer, parser = make_importer_parser(OSMParser, **kwargs)
    parser.parse(filename)

    return importer.get_graph(parse_direction=parse_direction)