def parse_line(line):
    """
    Parses lines of the following form

        Line #|      Hits|         Time| Time per hit|      %|Source code
        ------+----------+-------------+-------------+-------+-----------
             1|         2|   4.1008e-05|   2.0504e-05|  0.00%|import os

    Extracts a dict of (line_number, hits, time, time_per_hit, percentage, code)

    :param line: string
    :return: tuple
    """
    columns = line.split('|')
    return {'line_number': int(columns[0]), 'hits': int(columns[1]), 'time':
        float(columns[2]), 'time_per_hit': float(columns[3]), 'percentage':
        float(columns[4][:-1]), 'code': '|'.join(columns[5:]), 'calls':
        list(), 'calls_from': dict()}
