import re


def parse_python_func_imports(func_str):
    """Get a list of import statement lines from a (string) Python function."""

    import_lines = func_str.split('def ')[0].strip()
    match = re.search(r'((?:import|from)[\S\s]*)', import_lines)
    out = []
    if match:
        out = match.group(1).splitlines()

    return out