def show_source(buf, (row, col), tempfile, conf):
    filename = _get_source_file(buf, (row, col), conf['marker'])

    # Skip lines we don't care about (- if showing the new version of the file,
    # + if showing the old version), so they don't mess up our final line
    # number.
    for skip_offset, line in enumerate(reversed(buf[:row - 1])):
        if not line.startswith(conf['skip']):
            break

    # Work backward to the nearest range line, counting how many lines we
    # had to move through to get there.
    range_line = None
    offset = 0
    for line in reversed(buf[:row - 1 - skip_offset]):
        props = LineProperties(line)
        if props.is_diff_range:
            range_line = line
            break
        if line.startswith((' ', conf['short'])):
            offset += 1

    if not range_line:
        raise Exception('No range line')

    # Extract the line number from the range line and add our offset to compute
    # the line number we'll want to show.
    match = re.search(conf['range_pattern'], range_line)
    lineno = offset + int(match.group(1))

    # Find the git revision from the index line.
    rev = None
    for line in reversed(buf[:row - 1]):
        match = re.search(conf['index_pattern'], line)
        if match:
            rev = match.group(1)
            break

    if not rev:
        raise Exception('No revision')

    # Use git to dump the version of the file at that revision, and return the
    # line number.
    cmd = """
        git show {rev}:{filename} > {tempfile}
        """.format(rev=rev, filename=filename, tempfile=tempfile)
    _get_output(cmd)
    return lineno


### Shelling out
Writes a version of the file to the path given by `tempfile`, and returns
dataset/ETHPy150Open hut8labs/diffscuss/diffscuss/support/editor.py/show_source