MCPcopy Create free account
hub / github.com/ActiveState/code / parse

Method parse

recipes/Python/578138_gprof2dotpy/recipe-578138.py:1986–2010  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1984 self.column = {}
1985
1986 def parse(self):
1987 import csv
1988 reader = csv.reader(
1989 self.stream,
1990 delimiter = ',',
1991 quotechar = None,
1992 escapechar = None,
1993 doublequote = False,
1994 skipinitialspace = True,
1995 lineterminator = '\r\n',
1996 quoting = csv.QUOTE_NONE)
1997 it = iter(reader)
1998 row = next(reader)
1999 self.parse_header(row)
2000 for row in it:
2001 self.parse_row(row)
2002
2003 # compute derived data
2004 self.profile.validate()
2005 self.profile.find_cycles()
2006 self.profile.ratio(TIME_RATIO, SAMPLES)
2007 self.profile.call_ratios(SAMPLES2)
2008 self.profile.integrate(TOTAL_TIME_RATIO, TIME_RATIO)
2009
2010 return self.profile
2011
2012 def parse_header(self, row):
2013 for column in range(len(row)):

Callers

nothing calls this directly

Calls 8

parse_headerMethod · 0.95
parse_rowMethod · 0.95
readerMethod · 0.80
find_cyclesMethod · 0.80
ratioMethod · 0.80
call_ratiosMethod · 0.80
validateMethod · 0.45
integrateMethod · 0.45

Tested by

no test coverage detected