def write_static_networks(gtfs, output_dir, fmt=None):
if fmt is None:<EOL><INDENT>fmt = "<STR_LIT>"<EOL><DEDENT>single_layer_networks = stop_to_stop_networks_by_type(gtfs)<EOL>util.makedirs(output_dir)<EOL>for route_type, net in single_layer_networks.items():<EOL><INDENT>tag = route_types.ROUTE_TYPE_TO_LOWERCASE_TAG[route_type]<EOL>file_name = os.path.join(output_dir, "<STR_LIT>" + tag + "<STR_LIT:.>" + fmt)<EOL>if len(net.edges()) > <NUM_LIT:0>:<EOL><INDENT>_write_stop_to_stop_network_edges(net, file_name, fmt=fmt)<EOL><DEDENT><DEDENT>
Parameters
----------
gtfs: gtfspy.GTFS
output_dir: (str, unicode)
    a path where to write
fmt: None, optional
    defaulting to "edg" and writing results as ".edg" files
     If "csv" csv files are produced instead