MCPcopy Create free account
hub / github.com/1a1a11a/libCacheSim / _get_num_of_lines

Function _get_num_of_lines

scripts/traceAnalysis/access_pattern.py:27–35  ·  view source on GitHub ↗

get number of lines in a file

(datapath)

Source from the content-addressed store, hash-verified

25
26
27def _get_num_of_lines(datapath):
28 """get number of lines in a file"""
29 ifile = open(datapath)
30 num_of_lines = 0
31 for _ in ifile:
32 num_of_lines += 1
33 ifile.close()
34
35 return num_of_lines
36
37
38def _load_access_pattern_data(datapath: str, n_obj_to_plot: int) -> List[List[float]]:

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected