code: def gen_init(self):
      out = """
  // init {shortname}
  static int
  Py_{shortname}_init (Py_{shortname} * self, PyObject * args, PyObject * kwds)
  {{
  """.format(
          **self.__dict__
      )
      new_name = get_name(self.new_proto)
      new_params = ", ".join(
          ["self->%s" % s["name"] for s in self.input_params]
      )
      out += """
    self->o = {new_name}({new_params});
  """.format(
          new_name=new_name, new_params=new_params
      )
      paramchars = "%s"
      paramvals = "self->method"
      out += """
    // return -1 and set error string on failure
    if (self->o == NULL) {{
      PyErr_Format (PyExc_RuntimeError, "failed creating {shortname}");
      return -1;
    }}
  """.format(
          paramchars=paramchars, paramvals=paramvals, **self.__dict__
      )
      output_create = ""
      for o in self.outputs:
          output_create += """
    self->{name} = {create_fn}({output_size});""".format(
              name=o["name"],
              create_fn=newfromtype_fn[o["type"]],
              output_size=objoutsize[self.shortname],
          )
      out += """
    // TODO get internal params after actual object creation?
  """
      out += """
    // create outputs{output_create}
  """.format(
          output_create=output_create
      )
      out += """
    return 0;
  }
  """
      return out
  
label_desc: Use image node_id 10 for calling the MappedObject obj's underlying member method code with example usage: obj.gen_init() and returns: out