def lineno(loc,strg):
    return strg.count("\n",0,loc) + 1
Returns current line number within a string, counting newlines as line separators.
dataset/ETHPy150Open pypa/pip/pip/_vendor/pyparsing.py/lineno