code: def template_instances(cls, dataset, capacity=0):
          
          return Instances(
              javabridge.make_instance(
                  "weka/core/Instances", "(Lweka/core/Instances;I)V", dataset.jobject, capacity))
docs: Uses the Instances as template to create an empty dataset.
  
          :param dataset: the original dataset
          :type dataset: Instances
          :param capacity: how many data rows to reserve initially (see compactify)
          :type capacity: int
          :return: the empty dataset
          :rtype: Instances