import re


def find_functions(text):
    """Find all function names defined on all lines of the given text"""

    return list(set([
        re.split('[ (]*', line)[1]
        for line in [
            line.strip()
            for line in text.splitlines()
            if 'def ' in line
            ]
        if line.startswith('def ')
        ]))