lib/plugins/aws/invokeLocal/index.js/AwsInvokeLocal/invokeLocalPython
class AwsInvokeLocal:  invokeLocalPython(runtime, handlerPath, handlerName, event, context) {
    const input = JSON.stringify({
      event: event || {},
      context,
    });

    if (process.env.VIRTUAL_ENV) {
      const runtimeDir = os.platform() === 'win32' ? 'Scripts' : 'bin';
      process.env.PATH = [
        path.join(process.env.VIRTUAL_ENV, runtimeDir),
        path.delimiter,
        process.env.PATH,
      ].join('');
    }

    return new BbPromise(resolve => {
      const python = spawn(runtime,
        ['-u', path.join(__dirname, 'invoke.py'), handlerPath, handlerName],
        { env: process.env }, { shell: true });
      python.stdout.on('data', (buf) => this.serverless.cli.consoleLog(buf.toString()));
      python.stderr.on('data', (buf) => this.serverless.cli.consoleLog(buf.toString()));
      python.stdin.write(input);
      python.stdin.end();
      python.on('close', () => resolve());
    });
  }