code: def compile_proto(source, python_out, proto_path):
    
    if not protoc:
      sys.exit('protoc not found. Is the protobuf-compiler installed?\n')
  
    protoc_command = [
        protoc,
        '--proto_path', proto_path,
        '--python_out', python_out,
        source,
    ]
    if subprocess.call(protoc_command) != 0:
      sys.exit('Make sure your protoc version >= 2.6. You can use a custom '
               'protoc by setting the PROTOC environment variable.')
docs: Invoke Protocol Compiler to generate python from given source .proto.