Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def getReader(fileformat, **kwargs):
#define your [edgelist] reader here:
readers = {
Format.METIS: METISGraphReader(),
Format.GraphML: GraphMLReader(),
Format.GEXF: GEXFReader(),
Format.SNAP: EdgeListReader('\t',0,'#',False),
Format.EdgeListCommaOne: EdgeListReader(',',1,),
Format.EdgeListSpaceOne: EdgeListReader(' ',1),
Format.EdgeListSpaceZero: EdgeListReader(' ',0),
Format.EdgeListTabOne: EdgeListReader('\t',1),
Format.EdgeListTabZero: EdgeListReader('\t',0),
Format.LFR: EdgeListReader('\t',1),
Format.KONECT: KONECTGraphReader(' '),
Format.GML: GMLGraphReader(),
Format.GraphToolBinary: GraphToolBinaryReader(),
Format.MAT: MatReader()
}
try:
# special case for custom Edge Lists