scpt = applescript.AppleScript(
    """
    on run {arg1, arg2}
        say arg1 & " " & arg2
    end run
    on foo()
        return "bar"
    end foo
    on Baz(x, y)
        return x * y
    end bar
"""
    )
print(scpt.run('Hello', 'World'))
Calling AppleScript from Python without using osascript or appscript?