repository_name
stringlengths
5
67
func_path_in_repository
stringlengths
4
234
func_name
stringlengths
0
314
whole_func_string
stringlengths
52
3.87M
language
stringclasses
6 values
func_code_string
stringlengths
52
3.87M
func_code_tokens
listlengths
15
672k
func_documentation_string
stringlengths
1
47.2k
func_documentation_tokens
listlengths
1
3.92k
split_name
stringclasses
1 value
func_code_url
stringlengths
85
339
fracpete/python-weka-wrapper3
python/weka/flow/transformer.py
ClassSelector.do_execute
def do_execute(self): """ The actual execution of the actor. :return: None if successful, otherwise error message :rtype: str """ if isinstance(self.input.payload, Instances): inst = None data = self.input.payload elif isinstance(self.inpu...
python
def do_execute(self): """ The actual execution of the actor. :return: None if successful, otherwise error message :rtype: str """ if isinstance(self.input.payload, Instances): inst = None data = self.input.payload elif isinstance(self.inpu...
[ "def", "do_execute", "(", "self", ")", ":", "if", "isinstance", "(", "self", ".", "input", ".", "payload", ",", "Instances", ")", ":", "inst", "=", "None", "data", "=", "self", ".", "input", ".", "payload", "elif", "isinstance", "(", "self", ".", "in...
The actual execution of the actor. :return: None if successful, otherwise error message :rtype: str
[ "The", "actual", "execution", "of", "the", "actor", "." ]
train
https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/flow/transformer.py#L687-L718
fracpete/python-weka-wrapper3
python/weka/flow/transformer.py
Train.fix_config
def fix_config(self, options): """ Fixes the options, if necessary. I.e., it adds all required elements to the dictionary. :param options: the options to fix :type options: dict :return: the (potentially) fixed options :rtype: dict """ options = super(Tra...
python
def fix_config(self, options): """ Fixes the options, if necessary. I.e., it adds all required elements to the dictionary. :param options: the options to fix :type options: dict :return: the (potentially) fixed options :rtype: dict """ options = super(Tra...
[ "def", "fix_config", "(", "self", ",", "options", ")", ":", "options", "=", "super", "(", "Train", ",", "self", ")", ".", "fix_config", "(", "options", ")", "opt", "=", "\"setup\"", "if", "opt", "not", "in", "options", ":", "options", "[", "opt", "]"...
Fixes the options, if necessary. I.e., it adds all required elements to the dictionary. :param options: the options to fix :type options: dict :return: the (potentially) fixed options :rtype: dict
[ "Fixes", "the", "options", "if", "necessary", ".", "I", ".", "e", ".", "it", "adds", "all", "required", "elements", "to", "the", "dictionary", "." ]
train
https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/flow/transformer.py#L761-L778
fracpete/python-weka-wrapper3
python/weka/flow/transformer.py
Train.do_execute
def do_execute(self): """ The actual execution of the actor. :return: None if successful, otherwise error message :rtype: str """ if isinstance(self.input.payload, Instances): inst = None data = self.input.payload else: inst = ...
python
def do_execute(self): """ The actual execution of the actor. :return: None if successful, otherwise error message :rtype: str """ if isinstance(self.input.payload, Instances): inst = None data = self.input.payload else: inst = ...
[ "def", "do_execute", "(", "self", ")", ":", "if", "isinstance", "(", "self", ".", "input", ".", "payload", ",", "Instances", ")", ":", "inst", "=", "None", "data", "=", "self", ".", "input", ".", "payload", "else", ":", "inst", "=", "self", ".", "i...
The actual execution of the actor. :return: None if successful, otherwise error message :rtype: str
[ "The", "actual", "execution", "of", "the", "actor", "." ]
train
https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/flow/transformer.py#L793-L843
fracpete/python-weka-wrapper3
python/weka/flow/transformer.py
Filter.fix_config
def fix_config(self, options): """ Fixes the options, if necessary. I.e., it adds all required elements to the dictionary. :param options: the options to fix :type options: dict :return: the (potentially) fixed options :rtype: dict """ opt = "setup" ...
python
def fix_config(self, options): """ Fixes the options, if necessary. I.e., it adds all required elements to the dictionary. :param options: the options to fix :type options: dict :return: the (potentially) fixed options :rtype: dict """ opt = "setup" ...
[ "def", "fix_config", "(", "self", ",", "options", ")", ":", "opt", "=", "\"setup\"", "if", "opt", "not", "in", "options", ":", "options", "[", "opt", "]", "=", "filters", ".", "Filter", "(", "classname", "=", "\"weka.filters.AllFilter\"", ")", "if", "opt...
Fixes the options, if necessary. I.e., it adds all required elements to the dictionary. :param options: the options to fix :type options: dict :return: the (potentially) fixed options :rtype: dict
[ "Fixes", "the", "options", "if", "necessary", ".", "I", ".", "e", ".", "it", "adds", "all", "required", "elements", "to", "the", "dictionary", "." ]
train
https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/flow/transformer.py#L885-L906
fracpete/python-weka-wrapper3
python/weka/flow/transformer.py
Filter.check_input
def check_input(self, token): """ Performs checks on the input token. Raises an exception if unsupported. :param token: the token to check :type token: Token """ if token is None: raise Exception(self.full_name + ": No token provided!") if isinstance(...
python
def check_input(self, token): """ Performs checks on the input token. Raises an exception if unsupported. :param token: the token to check :type token: Token """ if token is None: raise Exception(self.full_name + ": No token provided!") if isinstance(...
[ "def", "check_input", "(", "self", ",", "token", ")", ":", "if", "token", "is", "None", ":", "raise", "Exception", "(", "self", ".", "full_name", "+", "\": No token provided!\"", ")", "if", "isinstance", "(", "token", ".", "payload", ",", "Instances", ")",...
Performs checks on the input token. Raises an exception if unsupported. :param token: the token to check :type token: Token
[ "Performs", "checks", "on", "the", "input", "token", ".", "Raises", "an", "exception", "if", "unsupported", "." ]
train
https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/flow/transformer.py#L908-L921
fracpete/python-weka-wrapper3
python/weka/flow/transformer.py
Filter.do_execute
def do_execute(self): """ The actual execution of the actor. :return: None if successful, otherwise error message :rtype: str """ if isinstance(self.input.payload, Instance): inst = self.input.payload data = Instances.template_instances(inst.datas...
python
def do_execute(self): """ The actual execution of the actor. :return: None if successful, otherwise error message :rtype: str """ if isinstance(self.input.payload, Instance): inst = self.input.payload data = Instances.template_instances(inst.datas...
[ "def", "do_execute", "(", "self", ")", ":", "if", "isinstance", "(", "self", ".", "input", ".", "payload", ",", "Instance", ")", ":", "inst", "=", "self", ".", "input", ".", "payload", "data", "=", "Instances", ".", "template_instances", "(", "inst", "...
The actual execution of the actor. :return: None if successful, otherwise error message :rtype: str
[ "The", "actual", "execution", "of", "the", "actor", "." ]
train
https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/flow/transformer.py#L923-L966
fracpete/python-weka-wrapper3
python/weka/flow/transformer.py
DeleteFile.fix_config
def fix_config(self, options): """ Fixes the options, if necessary. I.e., it adds all required elements to the dictionary. :param options: the options to fix :type options: dict :return: the (potentially) fixed options :rtype: dict """ options = super(Del...
python
def fix_config(self, options): """ Fixes the options, if necessary. I.e., it adds all required elements to the dictionary. :param options: the options to fix :type options: dict :return: the (potentially) fixed options :rtype: dict """ options = super(Del...
[ "def", "fix_config", "(", "self", ",", "options", ")", ":", "options", "=", "super", "(", "DeleteFile", ",", "self", ")", ".", "fix_config", "(", "options", ")", "opt", "=", "\"regexp\"", "if", "opt", "not", "in", "options", ":", "options", "[", "opt",...
Fixes the options, if necessary. I.e., it adds all required elements to the dictionary. :param options: the options to fix :type options: dict :return: the (potentially) fixed options :rtype: dict
[ "Fixes", "the", "options", "if", "necessary", ".", "I", ".", "e", ".", "it", "adds", "all", "required", "elements", "to", "the", "dictionary", "." ]
train
https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/flow/transformer.py#L1004-L1021
fracpete/python-weka-wrapper3
python/weka/flow/transformer.py
DeleteFile.do_execute
def do_execute(self): """ The actual execution of the actor. :return: None if successful, otherwise error message :rtype: str """ fname = str(self.input.payload) spattern = str(self.resolve_option("regexp")) pattern = None if (spattern is not None...
python
def do_execute(self): """ The actual execution of the actor. :return: None if successful, otherwise error message :rtype: str """ fname = str(self.input.payload) spattern = str(self.resolve_option("regexp")) pattern = None if (spattern is not None...
[ "def", "do_execute", "(", "self", ")", ":", "fname", "=", "str", "(", "self", ".", "input", ".", "payload", ")", "spattern", "=", "str", "(", "self", ".", "resolve_option", "(", "\"regexp\"", ")", ")", "pattern", "=", "None", "if", "(", "spattern", "...
The actual execution of the actor. :return: None if successful, otherwise error message :rtype: str
[ "The", "actual", "execution", "of", "the", "actor", "." ]
train
https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/flow/transformer.py#L1023-L1038
fracpete/python-weka-wrapper3
python/weka/flow/transformer.py
CrossValidate.fix_config
def fix_config(self, options): """ Fixes the options, if necessary. I.e., it adds all required elements to the dictionary. :param options: the options to fix :type options: dict :return: the (potentially) fixed options :rtype: dict """ options = super(Cro...
python
def fix_config(self, options): """ Fixes the options, if necessary. I.e., it adds all required elements to the dictionary. :param options: the options to fix :type options: dict :return: the (potentially) fixed options :rtype: dict """ options = super(Cro...
[ "def", "fix_config", "(", "self", ",", "options", ")", ":", "options", "=", "super", "(", "CrossValidate", ",", "self", ")", ".", "fix_config", "(", "options", ")", "opt", "=", "\"setup\"", "if", "opt", "not", "in", "options", ":", "options", "[", "opt...
Fixes the options, if necessary. I.e., it adds all required elements to the dictionary. :param options: the options to fix :type options: dict :return: the (potentially) fixed options :rtype: dict
[ "Fixes", "the", "options", "if", "necessary", ".", "I", ".", "e", ".", "it", "adds", "all", "required", "elements", "to", "the", "dictionary", "." ]
train
https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/flow/transformer.py#L1078-L1119
fracpete/python-weka-wrapper3
python/weka/flow/transformer.py
CrossValidate.do_execute
def do_execute(self): """ The actual execution of the actor. :return: None if successful, otherwise error message :rtype: str """ data = self.input.payload cls = self.resolve_option("setup") if isinstance(cls, Classifier): cls = Classifier.mak...
python
def do_execute(self): """ The actual execution of the actor. :return: None if successful, otherwise error message :rtype: str """ data = self.input.payload cls = self.resolve_option("setup") if isinstance(cls, Classifier): cls = Classifier.mak...
[ "def", "do_execute", "(", "self", ")", ":", "data", "=", "self", ".", "input", ".", "payload", "cls", "=", "self", ".", "resolve_option", "(", "\"setup\"", ")", "if", "isinstance", "(", "cls", ",", "Classifier", ")", ":", "cls", "=", "Classifier", ".",...
The actual execution of the actor. :return: None if successful, otherwise error message :rtype: str
[ "The", "actual", "execution", "of", "the", "actor", "." ]
train
https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/flow/transformer.py#L1132-L1163
fracpete/python-weka-wrapper3
python/weka/flow/transformer.py
Evaluate.fix_config
def fix_config(self, options): """ Fixes the options, if necessary. I.e., it adds all required elements to the dictionary. :param options: the options to fix :type options: dict :return: the (potentially) fixed options :rtype: dict """ options = super(Eva...
python
def fix_config(self, options): """ Fixes the options, if necessary. I.e., it adds all required elements to the dictionary. :param options: the options to fix :type options: dict :return: the (potentially) fixed options :rtype: dict """ options = super(Eva...
[ "def", "fix_config", "(", "self", ",", "options", ")", ":", "options", "=", "super", "(", "Evaluate", ",", "self", ")", ".", "fix_config", "(", "options", ")", "opt", "=", "\"storage_name\"", "if", "opt", "not", "in", "options", ":", "options", "[", "o...
Fixes the options, if necessary. I.e., it adds all required elements to the dictionary. :param options: the options to fix :type options: dict :return: the (potentially) fixed options :rtype: dict
[ "Fixes", "the", "options", "if", "necessary", ".", "I", ".", "e", ".", "it", "adds", "all", "required", "elements", "to", "the", "dictionary", "." ]
train
https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/flow/transformer.py#L1201-L1230
fracpete/python-weka-wrapper3
python/weka/flow/transformer.py
Evaluate.do_execute
def do_execute(self): """ The actual execution of the actor. :return: None if successful, otherwise error message :rtype: str """ data = self.input.payload if self.storagehandler is None: return "No storage handler available!" sname = str(self...
python
def do_execute(self): """ The actual execution of the actor. :return: None if successful, otherwise error message :rtype: str """ data = self.input.payload if self.storagehandler is None: return "No storage handler available!" sname = str(self...
[ "def", "do_execute", "(", "self", ")", ":", "data", "=", "self", ".", "input", ".", "payload", "if", "self", ".", "storagehandler", "is", "None", ":", "return", "\"No storage handler available!\"", "sname", "=", "str", "(", "self", ".", "resolve_option", "("...
The actual execution of the actor. :return: None if successful, otherwise error message :rtype: str
[ "The", "actual", "execution", "of", "the", "actor", "." ]
train
https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/flow/transformer.py#L1243-L1271
fracpete/python-weka-wrapper3
python/weka/flow/transformer.py
EvaluationSummary.fix_config
def fix_config(self, options): """ Fixes the options, if necessary. I.e., it adds all required elements to the dictionary. :param options: the options to fix :type options: dict :return: the (potentially) fixed options :rtype: dict """ options = super(Eva...
python
def fix_config(self, options): """ Fixes the options, if necessary. I.e., it adds all required elements to the dictionary. :param options: the options to fix :type options: dict :return: the (potentially) fixed options :rtype: dict """ options = super(Eva...
[ "def", "fix_config", "(", "self", ",", "options", ")", ":", "options", "=", "super", "(", "EvaluationSummary", ",", "self", ")", ".", "fix_config", "(", "options", ")", "opt", "=", "\"title\"", "if", "opt", "not", "in", "options", ":", "options", "[", ...
Fixes the options, if necessary. I.e., it adds all required elements to the dictionary. :param options: the options to fix :type options: dict :return: the (potentially) fixed options :rtype: dict
[ "Fixes", "the", "options", "if", "necessary", ".", "I", ".", "e", ".", "it", "adds", "all", "required", "elements", "to", "the", "dictionary", "." ]
train
https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/flow/transformer.py#L1311-L1340
fracpete/python-weka-wrapper3
python/weka/flow/transformer.py
EvaluationSummary.check_input
def check_input(self, token): """ Performs checks on the input token. Raises an exception if unsupported. :param token: the token to check :type token: Token """ if isinstance(token.payload, Evaluation): return None if isinstance(token.payload, Cluste...
python
def check_input(self, token): """ Performs checks on the input token. Raises an exception if unsupported. :param token: the token to check :type token: Token """ if isinstance(token.payload, Evaluation): return None if isinstance(token.payload, Cluste...
[ "def", "check_input", "(", "self", ",", "token", ")", ":", "if", "isinstance", "(", "token", ".", "payload", ",", "Evaluation", ")", ":", "return", "None", "if", "isinstance", "(", "token", ".", "payload", ",", "ClusterEvaluation", ")", ":", "return", "N...
Performs checks on the input token. Raises an exception if unsupported. :param token: the token to check :type token: Token
[ "Performs", "checks", "on", "the", "input", "token", ".", "Raises", "an", "exception", "if", "unsupported", "." ]
train
https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/flow/transformer.py#L1342-L1355
fracpete/python-weka-wrapper3
python/weka/flow/transformer.py
EvaluationSummary.do_execute
def do_execute(self): """ The actual execution of the actor. :return: None if successful, otherwise error message :rtype: str """ evl = self.input.payload if isinstance(evl, Evaluation): summary = evl.summary(title=self.resolve_option("title"), comple...
python
def do_execute(self): """ The actual execution of the actor. :return: None if successful, otherwise error message :rtype: str """ evl = self.input.payload if isinstance(evl, Evaluation): summary = evl.summary(title=self.resolve_option("title"), comple...
[ "def", "do_execute", "(", "self", ")", ":", "evl", "=", "self", ".", "input", ".", "payload", "if", "isinstance", "(", "evl", ",", "Evaluation", ")", ":", "summary", "=", "evl", ".", "summary", "(", "title", "=", "self", ".", "resolve_option", "(", "...
The actual execution of the actor. :return: None if successful, otherwise error message :rtype: str
[ "The", "actual", "execution", "of", "the", "actor", "." ]
train
https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/flow/transformer.py#L1357-L1372
fracpete/python-weka-wrapper3
python/weka/flow/transformer.py
ModelReader.do_execute
def do_execute(self): """ The actual execution of the actor. :return: None if successful, otherwise error message :rtype: str """ fname = self.input.payload data = serialization.read_all(fname) if len(data) == 1: if is_instance_of(data[0], "we...
python
def do_execute(self): """ The actual execution of the actor. :return: None if successful, otherwise error message :rtype: str """ fname = self.input.payload data = serialization.read_all(fname) if len(data) == 1: if is_instance_of(data[0], "we...
[ "def", "do_execute", "(", "self", ")", ":", "fname", "=", "self", ".", "input", ".", "payload", "data", "=", "serialization", ".", "read_all", "(", "fname", ")", "if", "len", "(", "data", ")", "==", "1", ":", "if", "is_instance_of", "(", "data", "[",...
The actual execution of the actor. :return: None if successful, otherwise error message :rtype: str
[ "The", "actual", "execution", "of", "the", "actor", "." ]
train
https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/flow/transformer.py#L1400-L1426
fracpete/python-weka-wrapper3
python/weka/flow/transformer.py
Convert.fix_config
def fix_config(self, options): """ Fixes the options, if necessary. I.e., it adds all required elements to the dictionary. :param options: the options to fix :type options: dict :return: the (potentially) fixed options :rtype: dict """ opt = "setup" ...
python
def fix_config(self, options): """ Fixes the options, if necessary. I.e., it adds all required elements to the dictionary. :param options: the options to fix :type options: dict :return: the (potentially) fixed options :rtype: dict """ opt = "setup" ...
[ "def", "fix_config", "(", "self", ",", "options", ")", ":", "opt", "=", "\"setup\"", "if", "opt", "not", "in", "options", ":", "options", "[", "opt", "]", "=", "conversion", ".", "PassThrough", "(", ")", "if", "opt", "not", "in", "self", ".", "help",...
Fixes the options, if necessary. I.e., it adds all required elements to the dictionary. :param options: the options to fix :type options: dict :return: the (potentially) fixed options :rtype: dict
[ "Fixes", "the", "options", "if", "necessary", ".", "I", ".", "e", ".", "it", "adds", "all", "required", "elements", "to", "the", "dictionary", "." ]
train
https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/flow/transformer.py#L1464-L1479
fracpete/python-weka-wrapper3
python/weka/flow/transformer.py
Convert.check_input
def check_input(self, token): """ Performs checks on the input token. Raises an exception if unsupported. :param token: the token to check :type token: Token """ if token is None: raise Exception(self.full_name + ": No token provided!") self.config["s...
python
def check_input(self, token): """ Performs checks on the input token. Raises an exception if unsupported. :param token: the token to check :type token: Token """ if token is None: raise Exception(self.full_name + ": No token provided!") self.config["s...
[ "def", "check_input", "(", "self", ",", "token", ")", ":", "if", "token", "is", "None", ":", "raise", "Exception", "(", "self", ".", "full_name", "+", "\": No token provided!\"", ")", "self", ".", "config", "[", "\"setup\"", "]", ".", "check_input", "(", ...
Performs checks on the input token. Raises an exception if unsupported. :param token: the token to check :type token: Token
[ "Performs", "checks", "on", "the", "input", "token", ".", "Raises", "an", "exception", "if", "unsupported", "." ]
train
https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/flow/transformer.py#L1481-L1490
fracpete/python-weka-wrapper3
python/weka/flow/transformer.py
Convert.do_execute
def do_execute(self): """ The actual execution of the actor. :return: None if successful, otherwise error message :rtype: str """ conv = self.config["setup"].shallow_copy() conv.input = self._input.payload result = conv.convert() if result is None...
python
def do_execute(self): """ The actual execution of the actor. :return: None if successful, otherwise error message :rtype: str """ conv = self.config["setup"].shallow_copy() conv.input = self._input.payload result = conv.convert() if result is None...
[ "def", "do_execute", "(", "self", ")", ":", "conv", "=", "self", ".", "config", "[", "\"setup\"", "]", ".", "shallow_copy", "(", ")", "conv", ".", "input", "=", "self", ".", "_input", ".", "payload", "result", "=", "conv", ".", "convert", "(", ")", ...
The actual execution of the actor. :return: None if successful, otherwise error message :rtype: str
[ "The", "actual", "execution", "of", "the", "actor", "." ]
train
https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/flow/transformer.py#L1492-L1505
fracpete/python-weka-wrapper3
python/weka/flow/transformer.py
AttributeSelection.quickinfo
def quickinfo(self): """ Returns a short string describing some of the options of the actor. :return: the info, None if not available :rtype: str """ return "search: " + base.to_commandline(self.config["search"]) + ", eval: " \ + base.to_commandline(self.c...
python
def quickinfo(self): """ Returns a short string describing some of the options of the actor. :return: the info, None if not available :rtype: str """ return "search: " + base.to_commandline(self.config["search"]) + ", eval: " \ + base.to_commandline(self.c...
[ "def", "quickinfo", "(", "self", ")", ":", "return", "\"search: \"", "+", "base", ".", "to_commandline", "(", "self", ".", "config", "[", "\"search\"", "]", ")", "+", "\", eval: \"", "+", "base", ".", "to_commandline", "(", "self", ".", "config", "[", "\...
Returns a short string describing some of the options of the actor. :return: the info, None if not available :rtype: str
[ "Returns", "a", "short", "string", "describing", "some", "of", "the", "options", "of", "the", "actor", "." ]
train
https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/flow/transformer.py#L1537-L1545
fracpete/python-weka-wrapper3
python/weka/flow/transformer.py
AttributeSelection.fix_config
def fix_config(self, options): """ Fixes the options, if necessary. I.e., it adds all required elements to the dictionary. :param options: the options to fix :type options: dict :return: the (potentially) fixed options :rtype: dict """ opt = "search" ...
python
def fix_config(self, options): """ Fixes the options, if necessary. I.e., it adds all required elements to the dictionary. :param options: the options to fix :type options: dict :return: the (potentially) fixed options :rtype: dict """ opt = "search" ...
[ "def", "fix_config", "(", "self", ",", "options", ")", ":", "opt", "=", "\"search\"", "if", "opt", "not", "in", "options", ":", "options", "[", "opt", "]", "=", "attsel", ".", "ASSearch", "(", "classname", "=", "\"weka.attributeSelection.BestFirst\"", ")", ...
Fixes the options, if necessary. I.e., it adds all required elements to the dictionary. :param options: the options to fix :type options: dict :return: the (potentially) fixed options :rtype: dict
[ "Fixes", "the", "options", "if", "necessary", ".", "I", ".", "e", ".", "it", "adds", "all", "required", "elements", "to", "the", "dictionary", "." ]
train
https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/flow/transformer.py#L1547-L1568
fracpete/python-weka-wrapper3
python/weka/flow/transformer.py
AttributeSelection.check_input
def check_input(self, token): """ Performs checks on the input token. Raises an exception if unsupported. :param token: the token to check :type token: Token """ if token is None: raise Exception(self.full_name + ": No token provided!") if not isinsta...
python
def check_input(self, token): """ Performs checks on the input token. Raises an exception if unsupported. :param token: the token to check :type token: Token """ if token is None: raise Exception(self.full_name + ": No token provided!") if not isinsta...
[ "def", "check_input", "(", "self", ",", "token", ")", ":", "if", "token", "is", "None", ":", "raise", "Exception", "(", "self", ".", "full_name", "+", "\": No token provided!\"", ")", "if", "not", "isinstance", "(", "token", ".", "payload", ",", "Instances...
Performs checks on the input token. Raises an exception if unsupported. :param token: the token to check :type token: Token
[ "Performs", "checks", "on", "the", "input", "token", ".", "Raises", "an", "exception", "if", "unsupported", "." ]
train
https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/flow/transformer.py#L1570-L1580
fracpete/python-weka-wrapper3
python/weka/flow/transformer.py
AttributeSelection.do_execute
def do_execute(self): """ The actual execution of the actor. :return: None if successful, otherwise error message :rtype: str """ data = self.input.payload search = self.config["search"].shallow_copy() evl = self.config["eval"].shallow_copy() asel...
python
def do_execute(self): """ The actual execution of the actor. :return: None if successful, otherwise error message :rtype: str """ data = self.input.payload search = self.config["search"].shallow_copy() evl = self.config["eval"].shallow_copy() asel...
[ "def", "do_execute", "(", "self", ")", ":", "data", "=", "self", ".", "input", ".", "payload", "search", "=", "self", ".", "config", "[", "\"search\"", "]", ".", "shallow_copy", "(", ")", "evl", "=", "self", ".", "config", "[", "\"eval\"", "]", ".", ...
The actual execution of the actor. :return: None if successful, otherwise error message :rtype: str
[ "The", "actual", "execution", "of", "the", "actor", "." ]
train
https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/flow/transformer.py#L1582-L1603
fracpete/python-weka-wrapper3
python/weka/flow/transformer.py
RenameRelation.fix_config
def fix_config(self, options): """ Fixes the options, if necessary. I.e., it adds all required elements to the dictionary. :param options: the options to fix :type options: dict :return: the (potentially) fixed options :rtype: dict """ options = super(Ren...
python
def fix_config(self, options): """ Fixes the options, if necessary. I.e., it adds all required elements to the dictionary. :param options: the options to fix :type options: dict :return: the (potentially) fixed options :rtype: dict """ options = super(Ren...
[ "def", "fix_config", "(", "self", ",", "options", ")", ":", "options", "=", "super", "(", "RenameRelation", ",", "self", ")", ".", "fix_config", "(", "options", ")", "opt", "=", "\"name\"", "if", "opt", "not", "in", "options", ":", "options", "[", "opt...
Fixes the options, if necessary. I.e., it adds all required elements to the dictionary. :param options: the options to fix :type options: dict :return: the (potentially) fixed options :rtype: dict
[ "Fixes", "the", "options", "if", "necessary", ".", "I", ".", "e", ".", "it", "adds", "all", "required", "elements", "to", "the", "dictionary", "." ]
train
https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/flow/transformer.py#L1641-L1658
fracpete/python-weka-wrapper3
python/weka/flow/transformer.py
RenameRelation.do_execute
def do_execute(self): """ The actual execution of the actor. :return: None if successful, otherwise error message :rtype: str """ relname = self.resolve_option("name") if isinstance(self.input.payload, Instance): self.input.payload.dataset.relationnam...
python
def do_execute(self): """ The actual execution of the actor. :return: None if successful, otherwise error message :rtype: str """ relname = self.resolve_option("name") if isinstance(self.input.payload, Instance): self.input.payload.dataset.relationnam...
[ "def", "do_execute", "(", "self", ")", ":", "relname", "=", "self", ".", "resolve_option", "(", "\"name\"", ")", "if", "isinstance", "(", "self", ".", "input", ".", "payload", ",", "Instance", ")", ":", "self", ".", "input", ".", "payload", ".", "datas...
The actual execution of the actor. :return: None if successful, otherwise error message :rtype: str
[ "The", "actual", "execution", "of", "the", "actor", "." ]
train
https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/flow/transformer.py#L1673-L1686
fracpete/python-weka-wrapper3
python/weka/flow/transformer.py
Copy.do_execute
def do_execute(self): """ The actual execution of the actor. :return: None if successful, otherwise error message :rtype: str """ if isinstance(self.input.payload, classes.JavaObject) and self.input.payload.is_serializable: copy = serialization.deepcopy(self....
python
def do_execute(self): """ The actual execution of the actor. :return: None if successful, otherwise error message :rtype: str """ if isinstance(self.input.payload, classes.JavaObject) and self.input.payload.is_serializable: copy = serialization.deepcopy(self....
[ "def", "do_execute", "(", "self", ")", ":", "if", "isinstance", "(", "self", ".", "input", ".", "payload", ",", "classes", ".", "JavaObject", ")", "and", "self", ".", "input", ".", "payload", ".", "is_serializable", ":", "copy", "=", "serialization", "."...
The actual execution of the actor. :return: None if successful, otherwise error message :rtype: str
[ "The", "actual", "execution", "of", "the", "actor", "." ]
train
https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/flow/transformer.py#L1716-L1729
fracpete/python-weka-wrapper3
python/weka/flow/transformer.py
Predict.fix_config
def fix_config(self, options): """ Fixes the options, if necessary. I.e., it adds all required elements to the dictionary. :param options: the options to fix :type options: dict :return: the (potentially) fixed options :rtype: dict """ options = super(Pre...
python
def fix_config(self, options): """ Fixes the options, if necessary. I.e., it adds all required elements to the dictionary. :param options: the options to fix :type options: dict :return: the (potentially) fixed options :rtype: dict """ options = super(Pre...
[ "def", "fix_config", "(", "self", ",", "options", ")", ":", "options", "=", "super", "(", "Predict", ",", "self", ")", ".", "fix_config", "(", "options", ")", "opt", "=", "\"model\"", "if", "opt", "not", "in", "options", ":", "options", "[", "opt", "...
Fixes the options, if necessary. I.e., it adds all required elements to the dictionary. :param options: the options to fix :type options: dict :return: the (potentially) fixed options :rtype: dict
[ "Fixes", "the", "options", "if", "necessary", ".", "I", ".", "e", ".", "it", "adds", "all", "required", "elements", "to", "the", "dictionary", "." ]
train
https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/flow/transformer.py#L1774-L1797
fracpete/python-weka-wrapper3
python/weka/flow/transformer.py
Predict.check_input
def check_input(self, token): """ Performs checks on the input token. Raises an exception if unsupported. :param token: the token to check :type token: Token """ if isinstance(token.payload, Instance): return raise Exception(self.full_name + ": Unhand...
python
def check_input(self, token): """ Performs checks on the input token. Raises an exception if unsupported. :param token: the token to check :type token: Token """ if isinstance(token.payload, Instance): return raise Exception(self.full_name + ": Unhand...
[ "def", "check_input", "(", "self", ",", "token", ")", ":", "if", "isinstance", "(", "token", ".", "payload", ",", "Instance", ")", ":", "return", "raise", "Exception", "(", "self", ".", "full_name", "+", "\": Unhandled data type: \"", "+", "str", "(", "tok...
Performs checks on the input token. Raises an exception if unsupported. :param token: the token to check :type token: Token
[ "Performs", "checks", "on", "the", "input", "token", ".", "Raises", "an", "exception", "if", "unsupported", "." ]
train
https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/flow/transformer.py#L1799-L1808
fracpete/python-weka-wrapper3
python/weka/flow/transformer.py
Predict.do_execute
def do_execute(self): """ The actual execution of the actor. :return: None if successful, otherwise error message :rtype: str """ inst = self.input.payload if not inst.has_class: return "No class set!" # load model? if self._model is ...
python
def do_execute(self): """ The actual execution of the actor. :return: None if successful, otherwise error message :rtype: str """ inst = self.input.payload if not inst.has_class: return "No class set!" # load model? if self._model is ...
[ "def", "do_execute", "(", "self", ")", ":", "inst", "=", "self", ".", "input", ".", "payload", "if", "not", "inst", ".", "has_class", ":", "return", "\"No class set!\"", "# load model?", "if", "self", ".", "_model", "is", "None", ":", "model", "=", "None...
The actual execution of the actor. :return: None if successful, otherwise error message :rtype: str
[ "The", "actual", "execution", "of", "the", "actor", "." ]
train
https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/flow/transformer.py#L1810-L1852
fracpete/python-weka-wrapper3
python/weka/plot/graph.py
plot_dot_graph
def plot_dot_graph(graph, filename=None): """ Plots a graph in graphviz dot notation. :param graph: the dot notation graph :type graph: str :param filename: the (optional) file to save the generated plot to. The extension determines the file format. :type filename: str """ if not plot.p...
python
def plot_dot_graph(graph, filename=None): """ Plots a graph in graphviz dot notation. :param graph: the dot notation graph :type graph: str :param filename: the (optional) file to save the generated plot to. The extension determines the file format. :type filename: str """ if not plot.p...
[ "def", "plot_dot_graph", "(", "graph", ",", "filename", "=", "None", ")", ":", "if", "not", "plot", ".", "pygraphviz_available", ":", "logger", ".", "error", "(", "\"Pygraphviz is not installed, cannot generate graph plot!\"", ")", "return", "if", "not", "plot", "...
Plots a graph in graphviz dot notation. :param graph: the dot notation graph :type graph: str :param filename: the (optional) file to save the generated plot to. The extension determines the file format. :type filename: str
[ "Plots", "a", "graph", "in", "graphviz", "dot", "notation", "." ]
train
https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/plot/graph.py#L29-L51
fracpete/python-weka-wrapper3
python/weka/core/stemmers.py
Stemmer.stem
def stem(self, s): """ Performs stemming on the string. :param s: the string to stem :type s: str :return: the stemmed string :rtype: str """ return javabridge.get_env().get_string(self.__stem(javabridge.get_env().new_string_utf(s)))
python
def stem(self, s): """ Performs stemming on the string. :param s: the string to stem :type s: str :return: the stemmed string :rtype: str """ return javabridge.get_env().get_string(self.__stem(javabridge.get_env().new_string_utf(s)))
[ "def", "stem", "(", "self", ",", "s", ")", ":", "return", "javabridge", ".", "get_env", "(", ")", ".", "get_string", "(", "self", ".", "__stem", "(", "javabridge", ".", "get_env", "(", ")", ".", "new_string_utf", "(", "s", ")", ")", ")" ]
Performs stemming on the string. :param s: the string to stem :type s: str :return: the stemmed string :rtype: str
[ "Performs", "stemming", "on", "the", "string", "." ]
train
https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/core/stemmers.py#L43-L52
fracpete/python-weka-wrapper3
python/weka/core/dataset.py
create_instances_from_matrices
def create_instances_from_matrices(x, y=None, name="data"): """ Allows the generation of an Instances object from a 2-dimensional matrix for X and a 1-dimensional matrix for Y (optional). All data must be numerical. Attributes can be converted to nominal with the weka.filters.unsupervised.attribute....
python
def create_instances_from_matrices(x, y=None, name="data"): """ Allows the generation of an Instances object from a 2-dimensional matrix for X and a 1-dimensional matrix for Y (optional). All data must be numerical. Attributes can be converted to nominal with the weka.filters.unsupervised.attribute....
[ "def", "create_instances_from_matrices", "(", "x", ",", "y", "=", "None", ",", "name", "=", "\"data\"", ")", ":", "if", "y", "is", "not", "None", ":", "if", "len", "(", "x", ")", "!=", "len", "(", "y", ")", ":", "raise", "Exception", "(", "\"Dimens...
Allows the generation of an Instances object from a 2-dimensional matrix for X and a 1-dimensional matrix for Y (optional). All data must be numerical. Attributes can be converted to nominal with the weka.filters.unsupervised.attribute.NumericToNominal filter. :param x: the input variables :type x:...
[ "Allows", "the", "generation", "of", "an", "Instances", "object", "from", "a", "2", "-", "dimensional", "matrix", "for", "X", "and", "a", "1", "-", "dimensional", "matrix", "for", "Y", "(", "optional", ")", ".", "All", "data", "must", "be", "numerical", ...
train
https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/core/dataset.py#L1528-L1560
fracpete/python-weka-wrapper3
python/weka/core/dataset.py
Instances.attribute_by_name
def attribute_by_name(self, name): """ Returns the specified attribute, None if not found. :param name: the name of the attribute :type name: str :return: the attribute or None :rtype: Attribute """ att = self.__attribute_by_name(javabridge.get_env().new_...
python
def attribute_by_name(self, name): """ Returns the specified attribute, None if not found. :param name: the name of the attribute :type name: str :return: the attribute or None :rtype: Attribute """ att = self.__attribute_by_name(javabridge.get_env().new_...
[ "def", "attribute_by_name", "(", "self", ",", "name", ")", ":", "att", "=", "self", ".", "__attribute_by_name", "(", "javabridge", ".", "get_env", "(", ")", ".", "new_string", "(", "name", ")", ")", "if", "att", "is", "None", ":", "return", "None", "el...
Returns the specified attribute, None if not found. :param name: the name of the attribute :type name: str :return: the attribute or None :rtype: Attribute
[ "Returns", "the", "specified", "attribute", "None", "if", "not", "found", "." ]
train
https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/core/dataset.py#L118-L131
fracpete/python-weka-wrapper3
python/weka/core/dataset.py
Instances.add_instance
def add_instance(self, inst, index=None): """ Adds the specified instance to the dataset. :param inst: the Instance to add :type inst: Instance :param index: the 0-based index where to add the Instance :type index: int """ if index is None: se...
python
def add_instance(self, inst, index=None): """ Adds the specified instance to the dataset. :param inst: the Instance to add :type inst: Instance :param index: the 0-based index where to add the Instance :type index: int """ if index is None: se...
[ "def", "add_instance", "(", "self", ",", "inst", ",", "index", "=", "None", ")", ":", "if", "index", "is", "None", ":", "self", ".", "__append_instance", "(", "inst", ".", "jobject", ")", "else", ":", "self", ".", "__insert_instance", "(", "index", ","...
Adds the specified instance to the dataset. :param inst: the Instance to add :type inst: Instance :param index: the 0-based index where to add the Instance :type index: int
[ "Adds", "the", "specified", "instance", "to", "the", "dataset", "." ]
train
https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/core/dataset.py#L235-L247
fracpete/python-weka-wrapper3
python/weka/core/dataset.py
Instances.set_instance
def set_instance(self, index, inst): """ Sets the Instance at the specified location in the dataset. :param index: the 0-based index of the instance to replace :type index: int :param inst: the Instance to set :type inst: Instance :return: the instance :r...
python
def set_instance(self, index, inst): """ Sets the Instance at the specified location in the dataset. :param index: the 0-based index of the instance to replace :type index: int :param inst: the Instance to set :type inst: Instance :return: the instance :r...
[ "def", "set_instance", "(", "self", ",", "index", ",", "inst", ")", ":", "return", "Instance", "(", "self", ".", "__set_instance", "(", "index", ",", "inst", ".", "jobject", ")", ")" ]
Sets the Instance at the specified location in the dataset. :param index: the 0-based index of the instance to replace :type index: int :param inst: the Instance to set :type inst: Instance :return: the instance :rtype: Instance
[ "Sets", "the", "Instance", "at", "the", "specified", "location", "in", "the", "dataset", "." ]
train
https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/core/dataset.py#L249-L261
fracpete/python-weka-wrapper3
python/weka/core/dataset.py
Instances.delete
def delete(self, index=None): """ Removes either the specified Instance or all Instance objects. :param index: the 0-based index of the instance to remove :type index: int """ if index is None: javabridge.call(self.jobject, "delete", "()V") else: ...
python
def delete(self, index=None): """ Removes either the specified Instance or all Instance objects. :param index: the 0-based index of the instance to remove :type index: int """ if index is None: javabridge.call(self.jobject, "delete", "()V") else: ...
[ "def", "delete", "(", "self", ",", "index", "=", "None", ")", ":", "if", "index", "is", "None", ":", "javabridge", ".", "call", "(", "self", ".", "jobject", ",", "\"delete\"", ",", "\"()V\"", ")", "else", ":", "javabridge", ".", "call", "(", "self", ...
Removes either the specified Instance or all Instance objects. :param index: the 0-based index of the instance to remove :type index: int
[ "Removes", "either", "the", "specified", "Instance", "or", "all", "Instance", "objects", "." ]
train
https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/core/dataset.py#L263-L273
fracpete/python-weka-wrapper3
python/weka/core/dataset.py
Instances.insert_attribute
def insert_attribute(self, att, index): """ Inserts the attribute at the specified location. :param att: the attribute to insert :type att: Attribute :param index: the index to insert the attribute at :type index: int """ javabridge.call(self.jobject, "in...
python
def insert_attribute(self, att, index): """ Inserts the attribute at the specified location. :param att: the attribute to insert :type att: Attribute :param index: the index to insert the attribute at :type index: int """ javabridge.call(self.jobject, "in...
[ "def", "insert_attribute", "(", "self", ",", "att", ",", "index", ")", ":", "javabridge", ".", "call", "(", "self", ".", "jobject", ",", "\"insertAttributeAt\"", ",", "\"(Lweka/core/Attribute;I)V\"", ",", "att", ".", "jobject", ",", "index", ")" ]
Inserts the attribute at the specified location. :param att: the attribute to insert :type att: Attribute :param index: the index to insert the attribute at :type index: int
[ "Inserts", "the", "attribute", "at", "the", "specified", "location", "." ]
train
https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/core/dataset.py#L314-L323
fracpete/python-weka-wrapper3
python/weka/core/dataset.py
Instances.train_cv
def train_cv(self, num_folds, fold, random=None): """ Generates a training fold for cross-validation. :param num_folds: the number of folds of cross-validation, eg 10 :type num_folds: int :param fold: the current fold (0-based) :type fold: int :param random: the ...
python
def train_cv(self, num_folds, fold, random=None): """ Generates a training fold for cross-validation. :param num_folds: the number of folds of cross-validation, eg 10 :type num_folds: int :param fold: the current fold (0-based) :type fold: int :param random: the ...
[ "def", "train_cv", "(", "self", ",", "num_folds", ",", "fold", ",", "random", "=", "None", ")", ":", "if", "random", "is", "None", ":", "return", "Instances", "(", "javabridge", ".", "call", "(", "self", ".", "jobject", ",", "\"trainCV\"", ",", "\"(II)...
Generates a training fold for cross-validation. :param num_folds: the number of folds of cross-validation, eg 10 :type num_folds: int :param fold: the current fold (0-based) :type fold: int :param random: the random number generator :type random: Random :return: ...
[ "Generates", "a", "training", "fold", "for", "cross", "-", "validation", "." ]
train
https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/core/dataset.py#L358-L378
fracpete/python-weka-wrapper3
python/weka/core/dataset.py
Instances.copy_instances
def copy_instances(cls, dataset, from_row=None, num_rows=None): """ Creates a copy of the Instances. If either from_row or num_rows are None, then all of the data is being copied. :param dataset: the original dataset :type dataset: Instances :param from_row: the 0-based ...
python
def copy_instances(cls, dataset, from_row=None, num_rows=None): """ Creates a copy of the Instances. If either from_row or num_rows are None, then all of the data is being copied. :param dataset: the original dataset :type dataset: Instances :param from_row: the 0-based ...
[ "def", "copy_instances", "(", "cls", ",", "dataset", ",", "from_row", "=", "None", ",", "num_rows", "=", "None", ")", ":", "if", "from_row", "is", "None", "or", "num_rows", "is", "None", ":", "return", "Instances", "(", "javabridge", ".", "make_instance", ...
Creates a copy of the Instances. If either from_row or num_rows are None, then all of the data is being copied. :param dataset: the original dataset :type dataset: Instances :param from_row: the 0-based start index of the rows to copy :type from_row: int :param num_rows:...
[ "Creates", "a", "copy", "of", "the", "Instances", ".", "If", "either", "from_row", "or", "num_rows", "are", "None", "then", "all", "of", "the", "data", "is", "being", "copied", "." ]
train
https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/core/dataset.py#L408-L432
fracpete/python-weka-wrapper3
python/weka/core/dataset.py
Instances.template_instances
def template_instances(cls, dataset, capacity=0): """ 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 ...
python
def template_instances(cls, dataset, capacity=0): """ 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 ...
[ "def", "template_instances", "(", "cls", ",", "dataset", ",", "capacity", "=", "0", ")", ":", "return", "Instances", "(", "javabridge", ".", "make_instance", "(", "\"weka/core/Instances\"", ",", "\"(Lweka/core/Instances;I)V\"", ",", "dataset", ".", "jobject", ",",...
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
[ "Uses", "the", "Instances", "as", "template", "to", "create", "an", "empty", "dataset", "." ]
train
https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/core/dataset.py#L435-L448
fracpete/python-weka-wrapper3
python/weka/core/dataset.py
Instances.create_instances
def create_instances(cls, name, atts, capacity): """ Creates a new Instances. :param name: the relation name :type name: str :param atts: the list of attributes to use for the dataset :type atts: list of Attribute :param capacity: how many data rows to reserve in...
python
def create_instances(cls, name, atts, capacity): """ Creates a new Instances. :param name: the relation name :type name: str :param atts: the list of attributes to use for the dataset :type atts: list of Attribute :param capacity: how many data rows to reserve in...
[ "def", "create_instances", "(", "cls", ",", "name", ",", "atts", ",", "capacity", ")", ":", "attributes", "=", "[", "]", "for", "att", "in", "atts", ":", "attributes", ".", "append", "(", "att", ".", "jobject", ")", "return", "Instances", "(", "javabri...
Creates a new Instances. :param name: the relation name :type name: str :param atts: the list of attributes to use for the dataset :type atts: list of Attribute :param capacity: how many data rows to reserve initially (see compactify) :type capacity: int :return:...
[ "Creates", "a", "new", "Instances", "." ]
train
https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/core/dataset.py#L451-L470
fracpete/python-weka-wrapper3
python/weka/core/dataset.py
Instances.merge_instances
def merge_instances(cls, inst1, inst2): """ Merges the two datasets (side-by-side). :param inst1: the first dataset :type inst1: Instances or str :param inst2: the first dataset :type inst2: Instances :return: the combined dataset :rtype: Instances ...
python
def merge_instances(cls, inst1, inst2): """ Merges the two datasets (side-by-side). :param inst1: the first dataset :type inst1: Instances or str :param inst2: the first dataset :type inst2: Instances :return: the combined dataset :rtype: Instances ...
[ "def", "merge_instances", "(", "cls", ",", "inst1", ",", "inst2", ")", ":", "return", "Instances", "(", "javabridge", ".", "static_call", "(", "\"weka/core/Instances\"", ",", "\"mergeInstances\"", ",", "\"(Lweka/core/Instances;Lweka/core/Instances;)Lweka/core/Instances;\"",...
Merges the two datasets (side-by-side). :param inst1: the first dataset :type inst1: Instances or str :param inst2: the first dataset :type inst2: Instances :return: the combined dataset :rtype: Instances
[ "Merges", "the", "two", "datasets", "(", "side", "-", "by", "-", "side", ")", "." ]
train
https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/core/dataset.py#L473-L486
fracpete/python-weka-wrapper3
python/weka/core/dataset.py
Instance.dataset
def dataset(self): """ Returns the dataset that this instance belongs to. :return: the dataset or None if no dataset set :rtype: Instances """ dataset = javabridge.call(self.jobject, "dataset", "()Lweka/core/Instances;") if dataset is None: return Non...
python
def dataset(self): """ Returns the dataset that this instance belongs to. :return: the dataset or None if no dataset set :rtype: Instances """ dataset = javabridge.call(self.jobject, "dataset", "()Lweka/core/Instances;") if dataset is None: return Non...
[ "def", "dataset", "(", "self", ")", ":", "dataset", "=", "javabridge", ".", "call", "(", "self", ".", "jobject", ",", "\"dataset\"", ",", "\"()Lweka/core/Instances;\"", ")", "if", "dataset", "is", "None", ":", "return", "None", "else", ":", "return", "Inst...
Returns the dataset that this instance belongs to. :return: the dataset or None if no dataset set :rtype: Instances
[ "Returns", "the", "dataset", "that", "this", "instance", "belongs", "to", "." ]
train
https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/core/dataset.py#L577-L588
fracpete/python-weka-wrapper3
python/weka/core/dataset.py
Instance.set_string_value
def set_string_value(self, index, s): """ Sets the string value at the specified position (0-based). :param index: the 0-based index of the inernal value :type index: int :param s: the string value :type s: str """ return self.__set_string_value(index, ja...
python
def set_string_value(self, index, s): """ Sets the string value at the specified position (0-based). :param index: the 0-based index of the inernal value :type index: int :param s: the string value :type s: str """ return self.__set_string_value(index, ja...
[ "def", "set_string_value", "(", "self", ",", "index", ",", "s", ")", ":", "return", "self", ".", "__set_string_value", "(", "index", ",", "javabridge", ".", "get_env", "(", ")", ".", "new_string", "(", "s", ")", ")" ]
Sets the string value at the specified position (0-based). :param index: the 0-based index of the inernal value :type index: int :param s: the string value :type s: str
[ "Sets", "the", "string", "value", "at", "the", "specified", "position", "(", "0", "-", "based", ")", "." ]
train
https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/core/dataset.py#L671-L680
fracpete/python-weka-wrapper3
python/weka/core/dataset.py
Instance.create_instance
def create_instance(cls, values, classname="weka.core.DenseInstance", weight=1.0): """ Creates a new instance. :param values: the float values (internal format) to use, numpy array or list. :type values: ndarray or list :param classname: the classname of the instance (eg weka.co...
python
def create_instance(cls, values, classname="weka.core.DenseInstance", weight=1.0): """ Creates a new instance. :param values: the float values (internal format) to use, numpy array or list. :type values: ndarray or list :param classname: the classname of the instance (eg weka.co...
[ "def", "create_instance", "(", "cls", ",", "values", ",", "classname", "=", "\"weka.core.DenseInstance\"", ",", "weight", "=", "1.0", ")", ":", "jni_classname", "=", "classname", ".", "replace", "(", "\".\"", ",", "\"/\"", ")", "if", "type", "(", "values", ...
Creates a new instance. :param values: the float values (internal format) to use, numpy array or list. :type values: ndarray or list :param classname: the classname of the instance (eg weka.core.DenseInstance). :type classname: str :param weight: the weight of the instance ...
[ "Creates", "a", "new", "instance", "." ]
train
https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/core/dataset.py#L764-L783
fracpete/python-weka-wrapper3
python/weka/core/dataset.py
Instance.create_sparse_instance
def create_sparse_instance(cls, values, max_values, classname="weka.core.SparseInstance", weight=1.0): """ Creates a new sparse instance. :param values: the list of tuples (0-based index and internal format float). The indices of the tuples must be in ascending order and ...
python
def create_sparse_instance(cls, values, max_values, classname="weka.core.SparseInstance", weight=1.0): """ Creates a new sparse instance. :param values: the list of tuples (0-based index and internal format float). The indices of the tuples must be in ascending order and ...
[ "def", "create_sparse_instance", "(", "cls", ",", "values", ",", "max_values", ",", "classname", "=", "\"weka.core.SparseInstance\"", ",", "weight", "=", "1.0", ")", ":", "jni_classname", "=", "classname", ".", "replace", "(", "\".\"", ",", "\"/\"", ")", "indi...
Creates a new sparse instance. :param values: the list of tuples (0-based index and internal format float). The indices of the tuples must be in ascending order and "max_values" must be set to the maximum number of attributes in the dataset. :type values: l...
[ "Creates", "a", "new", "sparse", "instance", "." ]
train
https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/core/dataset.py#L786-L813
fracpete/python-weka-wrapper3
python/weka/core/dataset.py
Attribute.values
def values(self): """ Returns the labels, strings or relation-values. :return: all the values, None if not NOMINAL, STRING, or RELATION :rtype: list """ enm = javabridge.call(self.jobject, "enumerateValues", "()Ljava/util/Enumeration;") if enm is None: ...
python
def values(self): """ Returns the labels, strings or relation-values. :return: all the values, None if not NOMINAL, STRING, or RELATION :rtype: list """ enm = javabridge.call(self.jobject, "enumerateValues", "()Ljava/util/Enumeration;") if enm is None: ...
[ "def", "values", "(", "self", ")", ":", "enm", "=", "javabridge", ".", "call", "(", "self", ".", "jobject", ",", "\"enumerateValues\"", ",", "\"()Ljava/util/Enumeration;\"", ")", "if", "enm", "is", "None", ":", "return", "None", "else", ":", "return", "typ...
Returns the labels, strings or relation-values. :return: all the values, None if not NOMINAL, STRING, or RELATION :rtype: list
[ "Returns", "the", "labels", "strings", "or", "relation", "-", "values", "." ]
train
https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/core/dataset.py#L913-L924
fracpete/python-weka-wrapper3
python/weka/core/dataset.py
Attribute.type_str
def type_str(self, short=False): """ Returns the type of the attribute as string. :return: the type :rtype: str """ if short: return javabridge.static_call( "weka/core/Attribute", "typeToStringShort", "(Lweka/core/Attribute;)Ljava/lang/String;...
python
def type_str(self, short=False): """ Returns the type of the attribute as string. :return: the type :rtype: str """ if short: return javabridge.static_call( "weka/core/Attribute", "typeToStringShort", "(Lweka/core/Attribute;)Ljava/lang/String;...
[ "def", "type_str", "(", "self", ",", "short", "=", "False", ")", ":", "if", "short", ":", "return", "javabridge", ".", "static_call", "(", "\"weka/core/Attribute\"", ",", "\"typeToStringShort\"", ",", "\"(Lweka/core/Attribute;)Ljava/lang/String;\"", ",", "self", "."...
Returns the type of the attribute as string. :return: the type :rtype: str
[ "Returns", "the", "type", "of", "the", "attribute", "as", "string", "." ]
train
https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/core/dataset.py#L946-L960
fracpete/python-weka-wrapper3
python/weka/core/dataset.py
Attribute.copy
def copy(self, name=None): """ Creates a copy of this attribute. :param name: the new name, uses the old one if None :type name: str :return: the copy of the attribute :rtype: Attribute """ if name is None: return Attribute( ja...
python
def copy(self, name=None): """ Creates a copy of this attribute. :param name: the new name, uses the old one if None :type name: str :return: the copy of the attribute :rtype: Attribute """ if name is None: return Attribute( ja...
[ "def", "copy", "(", "self", ",", "name", "=", "None", ")", ":", "if", "name", "is", "None", ":", "return", "Attribute", "(", "javabridge", ".", "call", "(", "self", ".", "jobject", ",", "\"copy\"", ",", "\"()Ljava/lang/Object;\"", ")", ")", "else", ":"...
Creates a copy of this attribute. :param name: the new name, uses the old one if None :type name: str :return: the copy of the attribute :rtype: Attribute
[ "Creates", "a", "copy", "of", "this", "attribute", "." ]
train
https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/core/dataset.py#L1119-L1133
fracpete/python-weka-wrapper3
python/weka/core/dataset.py
Attribute.create_nominal
def create_nominal(cls, name, labels): """ Creates a nominal attribute. :param name: the name of the attribute :type name: str :param labels: the list of string labels to use :type labels: list """ return Attribute( javabridge.make_instance( ...
python
def create_nominal(cls, name, labels): """ Creates a nominal attribute. :param name: the name of the attribute :type name: str :param labels: the list of string labels to use :type labels: list """ return Attribute( javabridge.make_instance( ...
[ "def", "create_nominal", "(", "cls", ",", "name", ",", "labels", ")", ":", "return", "Attribute", "(", "javabridge", ".", "make_instance", "(", "\"weka/core/Attribute\"", ",", "\"(Ljava/lang/String;Ljava/util/List;)V\"", ",", "name", ",", "javabridge", ".", "make_li...
Creates a nominal attribute. :param name: the name of the attribute :type name: str :param labels: the list of string labels to use :type labels: list
[ "Creates", "a", "nominal", "attribute", "." ]
train
https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/core/dataset.py#L1162-L1173
fracpete/python-weka-wrapper3
python/weka/core/dataset.py
Attribute.create_relational
def create_relational(cls, name, inst): """ Creates a relational attribute. :param name: the name of the attribute :type name: str :param inst: the structure of the relational attribute :type inst: Instances """ return Attribute( javabridge.ma...
python
def create_relational(cls, name, inst): """ Creates a relational attribute. :param name: the name of the attribute :type name: str :param inst: the structure of the relational attribute :type inst: Instances """ return Attribute( javabridge.ma...
[ "def", "create_relational", "(", "cls", ",", "name", ",", "inst", ")", ":", "return", "Attribute", "(", "javabridge", ".", "make_instance", "(", "\"weka/core/Attribute\"", ",", "\"(Ljava/lang/String;Lweka/core/Instances;)V\"", ",", "name", ",", "inst", ".", "jobject...
Creates a relational attribute. :param name: the name of the attribute :type name: str :param inst: the structure of the relational attribute :type inst: Instances
[ "Creates", "a", "relational", "attribute", "." ]
train
https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/core/dataset.py#L1188-L1199
fracpete/python-weka-wrapper3
python/weka/core/jvm.py
add_bundled_jars
def add_bundled_jars(): """ Adds the bundled jars to the JVM's classpath. """ # determine lib directory with jars rootdir = os.path.split(os.path.dirname(__file__))[0] libdir = rootdir + os.sep + "lib" # add jars from lib directory for l in glob.glob(libdir + os.sep + "*.jar"): ...
python
def add_bundled_jars(): """ Adds the bundled jars to the JVM's classpath. """ # determine lib directory with jars rootdir = os.path.split(os.path.dirname(__file__))[0] libdir = rootdir + os.sep + "lib" # add jars from lib directory for l in glob.glob(libdir + os.sep + "*.jar"): ...
[ "def", "add_bundled_jars", "(", ")", ":", "# determine lib directory with jars", "rootdir", "=", "os", ".", "path", ".", "split", "(", "os", ".", "path", ".", "dirname", "(", "__file__", ")", ")", "[", "0", "]", "libdir", "=", "rootdir", "+", "os", ".", ...
Adds the bundled jars to the JVM's classpath.
[ "Adds", "the", "bundled", "jars", "to", "the", "JVM", "s", "classpath", "." ]
train
https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/core/jvm.py#L31-L42
fracpete/python-weka-wrapper3
python/weka/core/jvm.py
add_system_classpath
def add_system_classpath(): """ Adds the system's classpath to the JVM's classpath. """ if 'CLASSPATH' in os.environ: parts = os.environ['CLASSPATH'].split(os.pathsep) for part in parts: javabridge.JARS.append(part)
python
def add_system_classpath(): """ Adds the system's classpath to the JVM's classpath. """ if 'CLASSPATH' in os.environ: parts = os.environ['CLASSPATH'].split(os.pathsep) for part in parts: javabridge.JARS.append(part)
[ "def", "add_system_classpath", "(", ")", ":", "if", "'CLASSPATH'", "in", "os", ".", "environ", ":", "parts", "=", "os", ".", "environ", "[", "'CLASSPATH'", "]", ".", "split", "(", "os", ".", "pathsep", ")", "for", "part", "in", "parts", ":", "javabridg...
Adds the system's classpath to the JVM's classpath.
[ "Adds", "the", "system", "s", "classpath", "to", "the", "JVM", "s", "classpath", "." ]
train
https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/core/jvm.py#L45-L52
fracpete/python-weka-wrapper3
python/weka/core/jvm.py
start
def start(class_path=None, bundled=True, packages=False, system_cp=False, max_heap_size=None): """ Initializes the javabridge connection (starts up the JVM). :param class_path: the additional classpath elements to add :type class_path: list :param bundled: whether to add jars from the "lib" directo...
python
def start(class_path=None, bundled=True, packages=False, system_cp=False, max_heap_size=None): """ Initializes the javabridge connection (starts up the JVM). :param class_path: the additional classpath elements to add :type class_path: list :param bundled: whether to add jars from the "lib" directo...
[ "def", "start", "(", "class_path", "=", "None", ",", "bundled", "=", "True", ",", "packages", "=", "False", ",", "system_cp", "=", "False", ",", "max_heap_size", "=", "None", ")", ":", "global", "started", "if", "started", "is", "not", "None", ":", "lo...
Initializes the javabridge connection (starts up the JVM). :param class_path: the additional classpath elements to add :type class_path: list :param bundled: whether to add jars from the "lib" directory :type bundled: bool :param packages: whether to add jars from Weka packages as well (bool) or an...
[ "Initializes", "the", "javabridge", "connection", "(", "starts", "up", "the", "JVM", ")", "." ]
train
https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/core/jvm.py#L55-L123
fracpete/python-weka-wrapper3
python/weka/core/classes.py
get_class
def get_class(classname): """ Returns the class object associated with the dot-notation classname. Taken from here: http://stackoverflow.com/a/452981 :param classname: the classname :type classname: str :return: the class object :rtype: object """ parts = classname.split('.') m...
python
def get_class(classname): """ Returns the class object associated with the dot-notation classname. Taken from here: http://stackoverflow.com/a/452981 :param classname: the classname :type classname: str :return: the class object :rtype: object """ parts = classname.split('.') m...
[ "def", "get_class", "(", "classname", ")", ":", "parts", "=", "classname", ".", "split", "(", "'.'", ")", "module", "=", "\".\"", ".", "join", "(", "parts", "[", ":", "-", "1", "]", ")", "m", "=", "__import__", "(", "module", ")", "for", "comp", ...
Returns the class object associated with the dot-notation classname. Taken from here: http://stackoverflow.com/a/452981 :param classname: the classname :type classname: str :return: the class object :rtype: object
[ "Returns", "the", "class", "object", "associated", "with", "the", "dot", "-", "notation", "classname", "." ]
train
https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/core/classes.py#L33-L49
fracpete/python-weka-wrapper3
python/weka/core/classes.py
get_jclass
def get_jclass(classname): """ Returns the Java class object associated with the dot-notation classname. :param classname: the classname :type classname: str :return: the class object :rtype: JB_Object """ try: return javabridge.class_for_name(classname) except: retu...
python
def get_jclass(classname): """ Returns the Java class object associated with the dot-notation classname. :param classname: the classname :type classname: str :return: the class object :rtype: JB_Object """ try: return javabridge.class_for_name(classname) except: retu...
[ "def", "get_jclass", "(", "classname", ")", ":", "try", ":", "return", "javabridge", ".", "class_for_name", "(", "classname", ")", "except", ":", "return", "javabridge", ".", "static_call", "(", "\"Lweka/core/ClassHelper;\"", ",", "\"forName\"", ",", "\"(Ljava/lan...
Returns the Java class object associated with the dot-notation classname. :param classname: the classname :type classname: str :return: the class object :rtype: JB_Object
[ "Returns", "the", "Java", "class", "object", "associated", "with", "the", "dot", "-", "notation", "classname", "." ]
train
https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/core/classes.py#L52-L67
fracpete/python-weka-wrapper3
python/weka/core/classes.py
get_static_field
def get_static_field(classname, fieldname, signature): """ Returns the Java object associated with the static field of the specified class. :param classname: the classname of the class to get the field from :type classname: str :param fieldname: the name of the field to retriev :type fieldname:...
python
def get_static_field(classname, fieldname, signature): """ Returns the Java object associated with the static field of the specified class. :param classname: the classname of the class to get the field from :type classname: str :param fieldname: the name of the field to retriev :type fieldname:...
[ "def", "get_static_field", "(", "classname", ",", "fieldname", ",", "signature", ")", ":", "try", ":", "return", "javabridge", ".", "get_static_field", "(", "classname", ",", "fieldname", ",", "signature", ")", "except", ":", "return", "javabridge", ".", "stat...
Returns the Java object associated with the static field of the specified class. :param classname: the classname of the class to get the field from :type classname: str :param fieldname: the name of the field to retriev :type fieldname: str :return: the object :rtype: JB_Object
[ "Returns", "the", "Java", "object", "associated", "with", "the", "static", "field", "of", "the", "specified", "class", "." ]
train
https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/core/classes.py#L70-L87
fracpete/python-weka-wrapper3
python/weka/core/classes.py
get_classname
def get_classname(obj): """ Returns the classname of the JB_Object, Python class or object. :param obj: the java object or Python class/object to get the classname for :type obj: object :return: the classname :rtype: str """ if isinstance(obj, javabridge.JB_Object): cls = javabr...
python
def get_classname(obj): """ Returns the classname of the JB_Object, Python class or object. :param obj: the java object or Python class/object to get the classname for :type obj: object :return: the classname :rtype: str """ if isinstance(obj, javabridge.JB_Object): cls = javabr...
[ "def", "get_classname", "(", "obj", ")", ":", "if", "isinstance", "(", "obj", ",", "javabridge", ".", "JB_Object", ")", ":", "cls", "=", "javabridge", ".", "call", "(", "obj", ",", "\"getClass\"", ",", "\"()Ljava/lang/Class;\"", ")", "return", "javabridge", ...
Returns the classname of the JB_Object, Python class or object. :param obj: the java object or Python class/object to get the classname for :type obj: object :return: the classname :rtype: str
[ "Returns", "the", "classname", "of", "the", "JB_Object", "Python", "class", "or", "object", "." ]
train
https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/core/classes.py#L90-L105
fracpete/python-weka-wrapper3
python/weka/core/classes.py
is_instance_of
def is_instance_of(obj, class_or_intf_name): """ Checks whether the Java object implements the specified interface or is a subclass of the superclass. :param obj: the Java object to check :type obj: JB_Object :param class_or_intf_name: the superclass or interface to check, dot notation or with forw...
python
def is_instance_of(obj, class_or_intf_name): """ Checks whether the Java object implements the specified interface or is a subclass of the superclass. :param obj: the Java object to check :type obj: JB_Object :param class_or_intf_name: the superclass or interface to check, dot notation or with forw...
[ "def", "is_instance_of", "(", "obj", ",", "class_or_intf_name", ")", ":", "class_or_intf_name", "=", "class_or_intf_name", ".", "replace", "(", "\"/\"", ",", "\".\"", ")", "classname", "=", "get_classname", "(", "obj", ")", "# array? retrieve component type and check ...
Checks whether the Java object implements the specified interface or is a subclass of the superclass. :param obj: the Java object to check :type obj: JB_Object :param class_or_intf_name: the superclass or interface to check, dot notation or with forward slashes :type class_or_intf_name: str :return...
[ "Checks", "whether", "the", "Java", "object", "implements", "the", "specified", "interface", "or", "is", "a", "subclass", "of", "the", "superclass", "." ]
train
https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/core/classes.py#L108-L134
fracpete/python-weka-wrapper3
python/weka/core/classes.py
from_commandline
def from_commandline(cmdline, classname=None): """ Creates an OptionHandler based on the provided commandline string. :param cmdline: the commandline string to use :type cmdline: str :param classname: the classname of the wrapper to return other than OptionHandler (in dot-notation) :type classn...
python
def from_commandline(cmdline, classname=None): """ Creates an OptionHandler based on the provided commandline string. :param cmdline: the commandline string to use :type cmdline: str :param classname: the classname of the wrapper to return other than OptionHandler (in dot-notation) :type classn...
[ "def", "from_commandline", "(", "cmdline", ",", "classname", "=", "None", ")", ":", "params", "=", "split_options", "(", "cmdline", ")", "cls", "=", "params", "[", "0", "]", "params", "=", "params", "[", "1", ":", "]", "handler", "=", "OptionHandler", ...
Creates an OptionHandler based on the provided commandline string. :param cmdline: the commandline string to use :type cmdline: str :param classname: the classname of the wrapper to return other than OptionHandler (in dot-notation) :type classname: str :return: the generated option handler instance...
[ "Creates", "an", "OptionHandler", "based", "on", "the", "provided", "commandline", "string", "." ]
train
https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/core/classes.py#L1683-L1705
fracpete/python-weka-wrapper3
python/weka/core/classes.py
complete_classname
def complete_classname(classname): """ Attempts to complete a partial classname like '.J48' and returns the full classname if a single match was found, otherwise an exception is raised. :param classname: the partial classname to expand :type classname: str :return: the full classname :rtype...
python
def complete_classname(classname): """ Attempts to complete a partial classname like '.J48' and returns the full classname if a single match was found, otherwise an exception is raised. :param classname: the partial classname to expand :type classname: str :return: the full classname :rtype...
[ "def", "complete_classname", "(", "classname", ")", ":", "result", "=", "javabridge", ".", "get_collection_wrapper", "(", "javabridge", ".", "static_call", "(", "\"Lweka/Run;\"", ",", "\"findSchemeMatch\"", ",", "\"(Ljava/lang/String;Z)Ljava/util/List;\"", ",", "classname...
Attempts to complete a partial classname like '.J48' and returns the full classname if a single match was found, otherwise an exception is raised. :param classname: the partial classname to expand :type classname: str :return: the full classname :rtype: str
[ "Attempts", "to", "complete", "a", "partial", "classname", "like", ".", "J48", "and", "returns", "the", "full", "classname", "if", "a", "single", "match", "was", "found", "otherwise", "an", "exception", "is", "raised", "." ]
train
https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/core/classes.py#L1708-L1732
fracpete/python-weka-wrapper3
python/weka/core/classes.py
main
def main(): """ Runs a classifier from the command-line. Calls JVM start/stop automatically. Use -h to see all options. """ parser = argparse.ArgumentParser( description='Performs option handling operations from the command-line. Calls JVM start/stop automatically.') parser.add_argument(...
python
def main(): """ Runs a classifier from the command-line. Calls JVM start/stop automatically. Use -h to see all options. """ parser = argparse.ArgumentParser( description='Performs option handling operations from the command-line. Calls JVM start/stop automatically.') parser.add_argument(...
[ "def", "main", "(", ")", ":", "parser", "=", "argparse", ".", "ArgumentParser", "(", "description", "=", "'Performs option handling operations from the command-line. Calls JVM start/stop automatically.'", ")", "parser", ".", "add_argument", "(", "\"-j\"", ",", "metavar", ...
Runs a classifier from the command-line. Calls JVM start/stop automatically. Use -h to see all options.
[ "Runs", "a", "classifier", "from", "the", "command", "-", "line", ".", "Calls", "JVM", "start", "/", "stop", "automatically", ".", "Use", "-", "h", "to", "see", "all", "options", "." ]
train
https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/core/classes.py#L2031-L2084
fracpete/python-weka-wrapper3
python/weka/core/classes.py
JSONObject.to_json
def to_json(self): """ Returns the options as JSON. :return: the object as string :rtype: str """ return json.dumps(self.to_dict(), sort_keys=True, indent=2, separators=(',', ': '))
python
def to_json(self): """ Returns the options as JSON. :return: the object as string :rtype: str """ return json.dumps(self.to_dict(), sort_keys=True, indent=2, separators=(',', ': '))
[ "def", "to_json", "(", "self", ")", ":", "return", "json", ".", "dumps", "(", "self", ".", "to_dict", "(", ")", ",", "sort_keys", "=", "True", ",", "indent", "=", "2", ",", "separators", "=", "(", "','", ",", "': '", ")", ")" ]
Returns the options as JSON. :return: the object as string :rtype: str
[ "Returns", "the", "options", "as", "JSON", "." ]
train
https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/core/classes.py#L250-L257
fracpete/python-weka-wrapper3
python/weka/core/classes.py
JSONObject.from_json
def from_json(cls, s): """ Restores the object from the given JSON. :param s: the JSON string to parse :type s: str :return: the """ d = json.loads(s) return get_dict_handler(d["type"])(d)
python
def from_json(cls, s): """ Restores the object from the given JSON. :param s: the JSON string to parse :type s: str :return: the """ d = json.loads(s) return get_dict_handler(d["type"])(d)
[ "def", "from_json", "(", "cls", ",", "s", ")", ":", "d", "=", "json", ".", "loads", "(", "s", ")", "return", "get_dict_handler", "(", "d", "[", "\"type\"", "]", ")", "(", "d", ")" ]
Restores the object from the given JSON. :param s: the JSON string to parse :type s: str :return: the
[ "Restores", "the", "object", "from", "the", "given", "JSON", "." ]
train
https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/core/classes.py#L260-L269
fracpete/python-weka-wrapper3
python/weka/core/classes.py
Configurable.to_dict
def to_dict(self): """ Returns a dictionary that represents this object, to be used for JSONification. :return: the object dictionary :rtype: dict """ result = {} result["type"] = "Configurable" result["class"] = get_classname(self) result["config...
python
def to_dict(self): """ Returns a dictionary that represents this object, to be used for JSONification. :return: the object dictionary :rtype: dict """ result = {} result["type"] = "Configurable" result["class"] = get_classname(self) result["config...
[ "def", "to_dict", "(", "self", ")", ":", "result", "=", "{", "}", "result", "[", "\"type\"", "]", "=", "\"Configurable\"", "result", "[", "\"class\"", "]", "=", "get_classname", "(", "self", ")", "result", "[", "\"config\"", "]", "=", "{", "}", "for", ...
Returns a dictionary that represents this object, to be used for JSONification. :return: the object dictionary :rtype: dict
[ "Returns", "a", "dictionary", "that", "represents", "this", "object", "to", "be", "used", "for", "JSONification", "." ]
train
https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/core/classes.py#L352-L369
fracpete/python-weka-wrapper3
python/weka/core/classes.py
Configurable.from_dict
def from_dict(cls, d): """ Restores its state from a dictionary, used in de-JSONification. :param d: the object dictionary :type d: dict """ conf = {} for k in d["config"]: v = d["config"][k] if isinstance(v, dict): conf[st...
python
def from_dict(cls, d): """ Restores its state from a dictionary, used in de-JSONification. :param d: the object dictionary :type d: dict """ conf = {} for k in d["config"]: v = d["config"][k] if isinstance(v, dict): conf[st...
[ "def", "from_dict", "(", "cls", ",", "d", ")", ":", "conf", "=", "{", "}", "for", "k", "in", "d", "[", "\"config\"", "]", ":", "v", "=", "d", "[", "\"config\"", "]", "[", "k", "]", "if", "isinstance", "(", "v", ",", "dict", ")", ":", "conf", ...
Restores its state from a dictionary, used in de-JSONification. :param d: the object dictionary :type d: dict
[ "Restores", "its", "state", "from", "a", "dictionary", "used", "in", "de", "-", "JSONification", "." ]
train
https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/core/classes.py#L372-L386
fracpete/python-weka-wrapper3
python/weka/core/classes.py
Configurable.logger
def logger(self): """ Returns the logger object. :return: the logger :rtype: logger """ if self._logger is None: self._logger = self.new_logger() return self._logger
python
def logger(self): """ Returns the logger object. :return: the logger :rtype: logger """ if self._logger is None: self._logger = self.new_logger() return self._logger
[ "def", "logger", "(", "self", ")", ":", "if", "self", ".", "_logger", "is", "None", ":", "self", ".", "_logger", "=", "self", ".", "new_logger", "(", ")", "return", "self", ".", "_logger" ]
Returns the logger object. :return: the logger :rtype: logger
[ "Returns", "the", "logger", "object", "." ]
train
https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/core/classes.py#L398-L407
fracpete/python-weka-wrapper3
python/weka/core/classes.py
Configurable.generate_help
def generate_help(self): """ Generates a help string for this actor. :return: the help string :rtype: str """ result = [] result.append(self.__class__.__name__) result.append(re.sub(r'.', '=', self.__class__.__name__)) result.append("") re...
python
def generate_help(self): """ Generates a help string for this actor. :return: the help string :rtype: str """ result = [] result.append(self.__class__.__name__) result.append(re.sub(r'.', '=', self.__class__.__name__)) result.append("") re...
[ "def", "generate_help", "(", "self", ")", ":", "result", "=", "[", "]", "result", ".", "append", "(", "self", ".", "__class__", ".", "__name__", ")", "result", ".", "append", "(", "re", ".", "sub", "(", "r'.'", ",", "'='", ",", "self", ".", "__clas...
Generates a help string for this actor. :return: the help string :rtype: str
[ "Generates", "a", "help", "string", "for", "this", "actor", "." ]
train
https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/core/classes.py#L419-L442
fracpete/python-weka-wrapper3
python/weka/core/classes.py
JavaObject.classname
def classname(self): """ Returns the Java classname in dot-notation. :return: the Java classname :rtype: str """ cls = javabridge.call(self.jobject, "getClass", "()Ljava/lang/Class;") return javabridge.call(cls, "getName", "()Ljava/lang/String;")
python
def classname(self): """ Returns the Java classname in dot-notation. :return: the Java classname :rtype: str """ cls = javabridge.call(self.jobject, "getClass", "()Ljava/lang/Class;") return javabridge.call(cls, "getName", "()Ljava/lang/String;")
[ "def", "classname", "(", "self", ")", ":", "cls", "=", "javabridge", ".", "call", "(", "self", ".", "jobject", ",", "\"getClass\"", ",", "\"()Ljava/lang/Class;\"", ")", "return", "javabridge", ".", "call", "(", "cls", ",", "\"getName\"", ",", "\"()Ljava/lang...
Returns the Java classname in dot-notation. :return: the Java classname :rtype: str
[ "Returns", "the", "Java", "classname", "in", "dot", "-", "notation", "." ]
train
https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/core/classes.py#L494-L502
fracpete/python-weka-wrapper3
python/weka/core/classes.py
JavaObject.set_property
def set_property(self, path, jobject): """ Attempts to set the value (jobject, a Java object) of the provided (bean) property path. :param path: the property path, e.g., "filter" for a setFilter(...)/getFilter() method pair :type path: str :param jobject: the Java object to set;...
python
def set_property(self, path, jobject): """ Attempts to set the value (jobject, a Java object) of the provided (bean) property path. :param path: the property path, e.g., "filter" for a setFilter(...)/getFilter() method pair :type path: str :param jobject: the Java object to set;...
[ "def", "set_property", "(", "self", ",", "path", ",", "jobject", ")", ":", "# unwrap?", "if", "isinstance", "(", "jobject", ",", "JavaObject", ")", ":", "jobject", "=", "jobject", ".", "jobject", "javabridge", ".", "static_call", "(", "\"Lweka/core/PropertyPat...
Attempts to set the value (jobject, a Java object) of the provided (bean) property path. :param path: the property path, e.g., "filter" for a setFilter(...)/getFilter() method pair :type path: str :param jobject: the Java object to set; if instance of JavaObject class, the jobject member is aut...
[ "Attempts", "to", "set", "the", "value", "(", "jobject", "a", "Java", "object", ")", "of", "the", "provided", "(", "bean", ")", "property", "path", "." ]
train
https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/core/classes.py#L504-L520
fracpete/python-weka-wrapper3
python/weka/core/classes.py
JavaObject.enforce_type
def enforce_type(cls, jobject, intf_or_class): """ Raises an exception if the object does not implement the specified interface or is not a subclass. :param jobject: the Java object to check :type jobject: JB_Object :param intf_or_class: the classname in Java notation (eg "weka...
python
def enforce_type(cls, jobject, intf_or_class): """ Raises an exception if the object does not implement the specified interface or is not a subclass. :param jobject: the Java object to check :type jobject: JB_Object :param intf_or_class: the classname in Java notation (eg "weka...
[ "def", "enforce_type", "(", "cls", ",", "jobject", ",", "intf_or_class", ")", ":", "if", "not", "cls", ".", "check_type", "(", "jobject", ",", "intf_or_class", ")", ":", "raise", "TypeError", "(", "\"Object does not implement or subclass \"", "+", "intf_or_class",...
Raises an exception if the object does not implement the specified interface or is not a subclass. :param jobject: the Java object to check :type jobject: JB_Object :param intf_or_class: the classname in Java notation (eg "weka.core.DenseInstance") :type intf_or_class: str
[ "Raises", "an", "exception", "if", "the", "object", "does", "not", "implement", "the", "specified", "interface", "or", "is", "not", "a", "subclass", "." ]
train
https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/core/classes.py#L621-L631
fracpete/python-weka-wrapper3
python/weka/core/classes.py
JavaObject.new_instance
def new_instance(cls, classname): """ Creates a new object from the given classname using the default constructor, None in case of error. :param classname: the classname in Java notation (eg "weka.core.DenseInstance") :type classname: str :return: the Java object :rtype:...
python
def new_instance(cls, classname): """ Creates a new object from the given classname using the default constructor, None in case of error. :param classname: the classname in Java notation (eg "weka.core.DenseInstance") :type classname: str :return: the Java object :rtype:...
[ "def", "new_instance", "(", "cls", ",", "classname", ")", ":", "try", ":", "return", "javabridge", ".", "static_call", "(", "\"Lweka/core/Utils;\"", ",", "\"forName\"", ",", "\"(Ljava/lang/Class;Ljava/lang/String;[Ljava/lang/String;)Ljava/lang/Object;\"", ",", "javabridge",...
Creates a new object from the given classname using the default constructor, None in case of error. :param classname: the classname in Java notation (eg "weka.core.DenseInstance") :type classname: str :return: the Java object :rtype: JB_Object
[ "Creates", "a", "new", "object", "from", "the", "given", "classname", "using", "the", "default", "constructor", "None", "in", "case", "of", "error", "." ]
train
https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/core/classes.py#L634-L650
fracpete/python-weka-wrapper3
python/weka/core/classes.py
Environment.add_variable
def add_variable(self, key, value, system_wide=False): """ Adds the environment variable. :param key: the name of the variable :type key: str :param value: the value :type value: str :param system_wide: whether to add the variable system wide :type system...
python
def add_variable(self, key, value, system_wide=False): """ Adds the environment variable. :param key: the name of the variable :type key: str :param value: the value :type value: str :param system_wide: whether to add the variable system wide :type system...
[ "def", "add_variable", "(", "self", ",", "key", ",", "value", ",", "system_wide", "=", "False", ")", ":", "if", "system_wide", ":", "javabridge", ".", "call", "(", "self", ".", "jobject", ",", "\"addVariableSystemWide\"", ",", "\"(Ljava/lang/String;Ljava/lang/St...
Adds the environment variable. :param key: the name of the variable :type key: str :param value: the value :type value: str :param system_wide: whether to add the variable system wide :type system_wide: bool
[ "Adds", "the", "environment", "variable", "." ]
train
https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/core/classes.py#L671-L685
fracpete/python-weka-wrapper3
python/weka/core/classes.py
Environment.variable_names
def variable_names(self): """ Returns the names of all environment variables. :return: the names of the variables :rtype: list """ result = [] names = javabridge.call(self.jobject, "getVariableNames", "()Ljava/util/Set;") for name in javabridge.iterate_co...
python
def variable_names(self): """ Returns the names of all environment variables. :return: the names of the variables :rtype: list """ result = [] names = javabridge.call(self.jobject, "getVariableNames", "()Ljava/util/Set;") for name in javabridge.iterate_co...
[ "def", "variable_names", "(", "self", ")", ":", "result", "=", "[", "]", "names", "=", "javabridge", ".", "call", "(", "self", ".", "jobject", ",", "\"getVariableNames\"", ",", "\"()Ljava/util/Set;\"", ")", "for", "name", "in", "javabridge", ".", "iterate_co...
Returns the names of all environment variables. :return: the names of the variables :rtype: list
[ "Returns", "the", "names", "of", "all", "environment", "variables", "." ]
train
https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/core/classes.py#L707-L718
fracpete/python-weka-wrapper3
python/weka/core/classes.py
JavaArray.component_type
def component_type(self): """ Returns the classname of the elements. :return: the class of the elements :rtype: str """ cls = javabridge.call(self.jobject, "getClass", "()Ljava/lang/Class;") comptype = javabridge.call(cls, "getComponentType", "()Ljava/lang/Class;...
python
def component_type(self): """ Returns the classname of the elements. :return: the class of the elements :rtype: str """ cls = javabridge.call(self.jobject, "getClass", "()Ljava/lang/Class;") comptype = javabridge.call(cls, "getComponentType", "()Ljava/lang/Class;...
[ "def", "component_type", "(", "self", ")", ":", "cls", "=", "javabridge", ".", "call", "(", "self", ".", "jobject", ",", "\"getClass\"", ",", "\"()Ljava/lang/Class;\"", ")", "comptype", "=", "javabridge", ".", "call", "(", "cls", ",", "\"getComponentType\"", ...
Returns the classname of the elements. :return: the class of the elements :rtype: str
[ "Returns", "the", "classname", "of", "the", "elements", "." ]
train
https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/core/classes.py#L843-L852
fracpete/python-weka-wrapper3
python/weka/core/classes.py
JavaArray.new_instance
def new_instance(cls, classname, length): """ Creates a new array with the given classname and length; initial values are null. :param classname: the classname in Java notation (eg "weka.core.DenseInstance") :type classname: str :param length: the length of the array :ty...
python
def new_instance(cls, classname, length): """ Creates a new array with the given classname and length; initial values are null. :param classname: the classname in Java notation (eg "weka.core.DenseInstance") :type classname: str :param length: the length of the array :ty...
[ "def", "new_instance", "(", "cls", ",", "classname", ",", "length", ")", ":", "return", "javabridge", ".", "static_call", "(", "\"Ljava/lang/reflect/Array;\"", ",", "\"newInstance\"", ",", "\"(Ljava/lang/Class;I)Ljava/lang/Object;\"", ",", "get_jclass", "(", "classname"...
Creates a new array with the given classname and length; initial values are null. :param classname: the classname in Java notation (eg "weka.core.DenseInstance") :type classname: str :param length: the length of the array :type length: int :return: the Java array :rtype:...
[ "Creates", "a", "new", "array", "with", "the", "given", "classname", "and", "length", ";", "initial", "values", "are", "null", "." ]
train
https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/core/classes.py#L855-L870
fracpete/python-weka-wrapper3
python/weka/core/classes.py
Enum.values
def values(self): """ Returns list of all enum members. :return: all enum members :rtype: list """ cls = javabridge.call(self.jobject, "getClass", "()Ljava/lang/Class;") clsname = javabridge.call(cls, "getName", "()Ljava/lang/String;") l = javabridge.stat...
python
def values(self): """ Returns list of all enum members. :return: all enum members :rtype: list """ cls = javabridge.call(self.jobject, "getClass", "()Ljava/lang/Class;") clsname = javabridge.call(cls, "getName", "()Ljava/lang/String;") l = javabridge.stat...
[ "def", "values", "(", "self", ")", ":", "cls", "=", "javabridge", ".", "call", "(", "self", ".", "jobject", ",", "\"getClass\"", ",", "\"()Ljava/lang/Class;\"", ")", "clsname", "=", "javabridge", ".", "call", "(", "cls", ",", "\"getName\"", ",", "\"()Ljava...
Returns list of all enum members. :return: all enum members :rtype: list
[ "Returns", "list", "of", "all", "enum", "members", "." ]
train
https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/core/classes.py#L918-L932
fracpete/python-weka-wrapper3
python/weka/core/classes.py
Random.next_int
def next_int(self, n=None): """ Next random integer. if n is provided, then between 0 and n-1. :param n: the upper limit (minus 1) for the random integer :type n: int :return: the next random integer :rtype: int """ if n is None: return javabr...
python
def next_int(self, n=None): """ Next random integer. if n is provided, then between 0 and n-1. :param n: the upper limit (minus 1) for the random integer :type n: int :return: the next random integer :rtype: int """ if n is None: return javabr...
[ "def", "next_int", "(", "self", ",", "n", "=", "None", ")", ":", "if", "n", "is", "None", ":", "return", "javabridge", ".", "call", "(", "self", ".", "jobject", ",", "\"nextInt\"", ",", "\"()I\"", ")", "else", ":", "return", "javabridge", ".", "call"...
Next random integer. if n is provided, then between 0 and n-1. :param n: the upper limit (minus 1) for the random integer :type n: int :return: the next random integer :rtype: int
[ "Next", "random", "integer", ".", "if", "n", "is", "provided", "then", "between", "0", "and", "n", "-", "1", "." ]
train
https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/core/classes.py#L949-L961
fracpete/python-weka-wrapper3
python/weka/core/classes.py
OptionHandler.options
def options(self): """ Obtains the currently set options as list. :return: the list of options :rtype: list """ if self.is_optionhandler: return typeconv.string_array_to_list(javabridge.call(self.jobject, "getOptions", "()[Ljava/lang/String;")) else: ...
python
def options(self): """ Obtains the currently set options as list. :return: the list of options :rtype: list """ if self.is_optionhandler: return typeconv.string_array_to_list(javabridge.call(self.jobject, "getOptions", "()[Ljava/lang/String;")) else: ...
[ "def", "options", "(", "self", ")", ":", "if", "self", ".", "is_optionhandler", ":", "return", "typeconv", ".", "string_array_to_list", "(", "javabridge", ".", "call", "(", "self", ".", "jobject", ",", "\"getOptions\"", ",", "\"()[Ljava/lang/String;\"", ")", "...
Obtains the currently set options as list. :return: the list of options :rtype: list
[ "Obtains", "the", "currently", "set", "options", "as", "list", "." ]
train
https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/core/classes.py#L1077-L1087
fracpete/python-weka-wrapper3
python/weka/core/classes.py
OptionHandler.options
def options(self, options): """ Sets the command-line options (as list). :param options: the list of command-line options to set :type options: list """ if self.is_optionhandler: javabridge.call(self.jobject, "setOptions", "([Ljava/lang/String;)V", typeconv.s...
python
def options(self, options): """ Sets the command-line options (as list). :param options: the list of command-line options to set :type options: list """ if self.is_optionhandler: javabridge.call(self.jobject, "setOptions", "([Ljava/lang/String;)V", typeconv.s...
[ "def", "options", "(", "self", ",", "options", ")", ":", "if", "self", ".", "is_optionhandler", ":", "javabridge", ".", "call", "(", "self", ".", "jobject", ",", "\"setOptions\"", ",", "\"([Ljava/lang/String;)V\"", ",", "typeconv", ".", "string_list_to_array", ...
Sets the command-line options (as list). :param options: the list of command-line options to set :type options: list
[ "Sets", "the", "command", "-", "line", "options", "(", "as", "list", ")", "." ]
train
https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/core/classes.py#L1090-L1098
fracpete/python-weka-wrapper3
python/weka/core/classes.py
OptionHandler.to_help
def to_help(self): """ Returns a string that contains the 'global_info' text and the options. :return: the generated help string :rtype: str """ result = [] result.append(self.classname) result.append("=" * len(self.classname)) result.append("") ...
python
def to_help(self): """ Returns a string that contains the 'global_info' text and the options. :return: the generated help string :rtype: str """ result = [] result.append(self.classname) result.append("=" * len(self.classname)) result.append("") ...
[ "def", "to_help", "(", "self", ")", ":", "result", "=", "[", "]", "result", ".", "append", "(", "self", ".", "classname", ")", "result", ".", "append", "(", "\"=\"", "*", "len", "(", "self", ".", "classname", ")", ")", "result", ".", "append", "(",...
Returns a string that contains the 'global_info' text and the options. :return: the generated help string :rtype: str
[ "Returns", "a", "string", "that", "contains", "the", "global_info", "text", "and", "the", "options", "." ]
train
https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/core/classes.py#L1112-L1136
fracpete/python-weka-wrapper3
python/weka/core/classes.py
OptionHandler.to_dict
def to_dict(self): """ Returns a dictionary that represents this object, to be used for JSONification. :return: the object dictionary :rtype: dict """ result = super(OptionHandler, self).to_dict() result["type"] = "OptionHandler" result["options"] = join_...
python
def to_dict(self): """ Returns a dictionary that represents this object, to be used for JSONification. :return: the object dictionary :rtype: dict """ result = super(OptionHandler, self).to_dict() result["type"] = "OptionHandler" result["options"] = join_...
[ "def", "to_dict", "(", "self", ")", ":", "result", "=", "super", "(", "OptionHandler", ",", "self", ")", ".", "to_dict", "(", ")", "result", "[", "\"type\"", "]", "=", "\"OptionHandler\"", "result", "[", "\"options\"", "]", "=", "join_options", "(", "sel...
Returns a dictionary that represents this object, to be used for JSONification. :return: the object dictionary :rtype: dict
[ "Returns", "a", "dictionary", "that", "represents", "this", "object", "to", "be", "used", "for", "JSONification", "." ]
train
https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/core/classes.py#L1147-L1157
fracpete/python-weka-wrapper3
python/weka/core/classes.py
OptionHandler.from_dict
def from_dict(cls, d): """ Restores an object state from a dictionary, used in de-JSONification. :param d: the object dictionary :type d: dict :return: the object :rtype: object """ result = OptionHandler(cls.new_instance(d["class"])) result.optio...
python
def from_dict(cls, d): """ Restores an object state from a dictionary, used in de-JSONification. :param d: the object dictionary :type d: dict :return: the object :rtype: object """ result = OptionHandler(cls.new_instance(d["class"])) result.optio...
[ "def", "from_dict", "(", "cls", ",", "d", ")", ":", "result", "=", "OptionHandler", "(", "cls", ".", "new_instance", "(", "d", "[", "\"class\"", "]", ")", ")", "result", ".", "options", "=", "split_options", "(", "d", "[", "\"options\"", "]", ")", "r...
Restores an object state from a dictionary, used in de-JSONification. :param d: the object dictionary :type d: dict :return: the object :rtype: object
[ "Restores", "an", "object", "state", "from", "a", "dictionary", "used", "in", "de", "-", "JSONification", "." ]
train
https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/core/classes.py#L1160-L1171
fracpete/python-weka-wrapper3
python/weka/core/classes.py
Tags.find
def find(self, name): """ Returns the Tag that matches the name. :param name: the string representation of the tag :type name: str :return: the tag, None if not found :rtype: Tag """ result = None for t in self.array: if str(t) == name...
python
def find(self, name): """ Returns the Tag that matches the name. :param name: the string representation of the tag :type name: str :return: the tag, None if not found :rtype: Tag """ result = None for t in self.array: if str(t) == name...
[ "def", "find", "(", "self", ",", "name", ")", ":", "result", "=", "None", "for", "t", "in", "self", ".", "array", ":", "if", "str", "(", "t", ")", "==", "name", ":", "result", "=", "Tag", "(", "t", ".", "jobject", ")", "break", "return", "resul...
Returns the Tag that matches the name. :param name: the string representation of the tag :type name: str :return: the tag, None if not found :rtype: Tag
[ "Returns", "the", "Tag", "that", "matches", "the", "name", "." ]
train
https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/core/classes.py#L1471-L1485
fracpete/python-weka-wrapper3
python/weka/core/classes.py
Tags.get_object_tags
def get_object_tags(cls, javaobject, methodname): """ Instantiates the Tag array obtained from the object using the specified method name. Example: cls = Classifier(classname="weka.classifiers.meta.MultiSearch") tags = Tags.get_object_tags(cls, "getMetricsTags") :param ...
python
def get_object_tags(cls, javaobject, methodname): """ Instantiates the Tag array obtained from the object using the specified method name. Example: cls = Classifier(classname="weka.classifiers.meta.MultiSearch") tags = Tags.get_object_tags(cls, "getMetricsTags") :param ...
[ "def", "get_object_tags", "(", "cls", ",", "javaobject", ",", "methodname", ")", ":", "return", "Tags", "(", "jobject", "=", "javabridge", ".", "call", "(", "javaobject", ".", "jobject", ",", "methodname", ",", "\"()[Lweka/core/Tag;\"", ")", ")" ]
Instantiates the Tag array obtained from the object using the specified method name. Example: cls = Classifier(classname="weka.classifiers.meta.MultiSearch") tags = Tags.get_object_tags(cls, "getMetricsTags") :param javaobject: the javaobject to obtain the tags from :type javao...
[ "Instantiates", "the", "Tag", "array", "obtained", "from", "the", "object", "using", "the", "specified", "method", "name", "." ]
train
https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/core/classes.py#L1505-L1520
fracpete/python-weka-wrapper3
python/weka/core/classes.py
SelectedTag.tags
def tags(self): """ Returns the associated tags. :return: the list of Tag objects :rtype: list """ result = [] a = javabridge.call(self.jobject, "getTags", "()Lweka/core/Tag;]") length = javabridge.get_env().get_array_length(a) wrapped = javabridg...
python
def tags(self): """ Returns the associated tags. :return: the list of Tag objects :rtype: list """ result = [] a = javabridge.call(self.jobject, "getTags", "()Lweka/core/Tag;]") length = javabridge.get_env().get_array_length(a) wrapped = javabridg...
[ "def", "tags", "(", "self", ")", ":", "result", "=", "[", "]", "a", "=", "javabridge", ".", "call", "(", "self", ".", "jobject", ",", "\"getTags\"", ",", "\"()Lweka/core/Tag;]\"", ")", "length", "=", "javabridge", ".", "get_env", "(", ")", ".", "get_ar...
Returns the associated tags. :return: the list of Tag objects :rtype: list
[ "Returns", "the", "associated", "tags", "." ]
train
https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/core/classes.py#L1569-L1582
fracpete/python-weka-wrapper3
python/weka/core/classes.py
SetupGenerator.base_object
def base_object(self): """ Returns the base object to apply the setups to. :return: the base object :rtype: JavaObject or OptionHandler """ jobj = javabridge.call(self.jobject, "getBaseObject", "()Ljava/io/Serializable;") if OptionHandler.check_type(jobj, "weka.c...
python
def base_object(self): """ Returns the base object to apply the setups to. :return: the base object :rtype: JavaObject or OptionHandler """ jobj = javabridge.call(self.jobject, "getBaseObject", "()Ljava/io/Serializable;") if OptionHandler.check_type(jobj, "weka.c...
[ "def", "base_object", "(", "self", ")", ":", "jobj", "=", "javabridge", ".", "call", "(", "self", ".", "jobject", ",", "\"getBaseObject\"", ",", "\"()Ljava/io/Serializable;\"", ")", "if", "OptionHandler", ".", "check_type", "(", "jobj", ",", "\"weka.core.OptionH...
Returns the base object to apply the setups to. :return: the base object :rtype: JavaObject or OptionHandler
[ "Returns", "the", "base", "object", "to", "apply", "the", "setups", "to", "." ]
train
https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/core/classes.py#L1961-L1972
fracpete/python-weka-wrapper3
python/weka/core/classes.py
SetupGenerator.base_object
def base_object(self, obj): """ Sets the base object to apply the setups to. :param obj: the object to use (must be serializable!) :type obj: JavaObject """ if not obj.is_serializable: raise Exception("Base object must be serializable: " + obj.classname) ...
python
def base_object(self, obj): """ Sets the base object to apply the setups to. :param obj: the object to use (must be serializable!) :type obj: JavaObject """ if not obj.is_serializable: raise Exception("Base object must be serializable: " + obj.classname) ...
[ "def", "base_object", "(", "self", ",", "obj", ")", ":", "if", "not", "obj", ".", "is_serializable", ":", "raise", "Exception", "(", "\"Base object must be serializable: \"", "+", "obj", ".", "classname", ")", "javabridge", ".", "call", "(", "self", ".", "jo...
Sets the base object to apply the setups to. :param obj: the object to use (must be serializable!) :type obj: JavaObject
[ "Sets", "the", "base", "object", "to", "apply", "the", "setups", "to", "." ]
train
https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/core/classes.py#L1975-L1984
fracpete/python-weka-wrapper3
python/weka/core/classes.py
SetupGenerator.parameters
def parameters(self): """ Returns the list of currently set search parameters. :return: the list of AbstractSearchParameter objects :rtype: list """ array = JavaArray(javabridge.call(self.jobject, "getParameters", "()[Lweka/core/setupgenerator/AbstractParameter;")) ...
python
def parameters(self): """ Returns the list of currently set search parameters. :return: the list of AbstractSearchParameter objects :rtype: list """ array = JavaArray(javabridge.call(self.jobject, "getParameters", "()[Lweka/core/setupgenerator/AbstractParameter;")) ...
[ "def", "parameters", "(", "self", ")", ":", "array", "=", "JavaArray", "(", "javabridge", ".", "call", "(", "self", ".", "jobject", ",", "\"getParameters\"", ",", "\"()[Lweka/core/setupgenerator/AbstractParameter;\"", ")", ")", "result", "=", "[", "]", "for", ...
Returns the list of currently set search parameters. :return: the list of AbstractSearchParameter objects :rtype: list
[ "Returns", "the", "list", "of", "currently", "set", "search", "parameters", "." ]
train
https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/core/classes.py#L1987-L1998
fracpete/python-weka-wrapper3
python/weka/core/classes.py
SetupGenerator.parameters
def parameters(self, params): """ Sets the list of search parameters to use. :param params: list of AbstractSearchParameter objects :type params: list """ array = JavaArray(jobject=JavaArray.new_instance("weka.core.setupgenerator.AbstractParameter", len(params))) ...
python
def parameters(self, params): """ Sets the list of search parameters to use. :param params: list of AbstractSearchParameter objects :type params: list """ array = JavaArray(jobject=JavaArray.new_instance("weka.core.setupgenerator.AbstractParameter", len(params))) ...
[ "def", "parameters", "(", "self", ",", "params", ")", ":", "array", "=", "JavaArray", "(", "jobject", "=", "JavaArray", ".", "new_instance", "(", "\"weka.core.setupgenerator.AbstractParameter\"", ",", "len", "(", "params", ")", ")", ")", "for", "idx", ",", "...
Sets the list of search parameters to use. :param params: list of AbstractSearchParameter objects :type params: list
[ "Sets", "the", "list", "of", "search", "parameters", "to", "use", "." ]
train
https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/core/classes.py#L2001-L2011
fracpete/python-weka-wrapper3
python/weka/core/classes.py
SetupGenerator.setups
def setups(self): """ Generates and returns all the setups according to the parameter search space. :return: the list of configured objects (of type JavaObject) :rtype: list """ result = [] has_options = self.base_object.is_optionhandler enm = javabridge....
python
def setups(self): """ Generates and returns all the setups according to the parameter search space. :return: the list of configured objects (of type JavaObject) :rtype: list """ result = [] has_options = self.base_object.is_optionhandler enm = javabridge....
[ "def", "setups", "(", "self", ")", ":", "result", "=", "[", "]", "has_options", "=", "self", ".", "base_object", ".", "is_optionhandler", "enm", "=", "javabridge", ".", "get_enumeration_wrapper", "(", "javabridge", ".", "call", "(", "self", ".", "jobject", ...
Generates and returns all the setups according to the parameter search space. :return: the list of configured objects (of type JavaObject) :rtype: list
[ "Generates", "and", "returns", "all", "the", "setups", "according", "to", "the", "parameter", "search", "space", "." ]
train
https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/core/classes.py#L2013-L2028
fracpete/python-weka-wrapper3
python/weka/flow/base.py
to_commandline
def to_commandline(o): """ Turns the object into a commandline string. However, first checks whether a string represents a internal value placeholder (@{...}). :param o: the object to turn into commandline :type o: object :return: the commandline :rtype: str """ if isinstance(o, str...
python
def to_commandline(o): """ Turns the object into a commandline string. However, first checks whether a string represents a internal value placeholder (@{...}). :param o: the object to turn into commandline :type o: object :return: the commandline :rtype: str """ if isinstance(o, str...
[ "def", "to_commandline", "(", "o", ")", ":", "if", "isinstance", "(", "o", ",", "str", ")", "and", "o", ".", "startswith", "(", "\"@{\"", ")", "and", "o", ".", "endswith", "(", "\"}\"", ")", ":", "return", "o", "else", ":", "return", "classes", "."...
Turns the object into a commandline string. However, first checks whether a string represents a internal value placeholder (@{...}). :param o: the object to turn into commandline :type o: object :return: the commandline :rtype: str
[ "Turns", "the", "object", "into", "a", "commandline", "string", ".", "However", "first", "checks", "whether", "a", "string", "represents", "a", "internal", "value", "placeholder", "(", "@", "{", "...", "}", ")", "." ]
train
https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/flow/base.py#L662-L675
fracpete/python-weka-wrapper3
python/weka/flow/base.py
Actor.unique_name
def unique_name(self, name): """ Generates a unique name. :param name: the name to check :type name: str :return: the unique name :rtype: str """ result = name if self.parent is not None: index = self.index bname = re.sub(...
python
def unique_name(self, name): """ Generates a unique name. :param name: the name to check :type name: str :return: the unique name :rtype: str """ result = name if self.parent is not None: index = self.index bname = re.sub(...
[ "def", "unique_name", "(", "self", ",", "name", ")", ":", "result", "=", "name", "if", "self", ".", "parent", "is", "not", "None", ":", "index", "=", "self", ".", "index", "bname", "=", "re", ".", "sub", "(", "r'-[0-9]+$'", ",", "''", ",", "name", ...
Generates a unique name. :param name: the name to check :type name: str :return: the unique name :rtype: str
[ "Generates", "a", "unique", "name", "." ]
train
https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/flow/base.py#L99-L123
fracpete/python-weka-wrapper3
python/weka/flow/base.py
Actor.parent
def parent(self, parent): """ Sets the parent of the actor. :param parent: the parent :type parent: Actor """ self._name = self.unique_name(self._name) self._full_name = None self._logger = None self._parent = parent
python
def parent(self, parent): """ Sets the parent of the actor. :param parent: the parent :type parent: Actor """ self._name = self.unique_name(self._name) self._full_name = None self._logger = None self._parent = parent
[ "def", "parent", "(", "self", ",", "parent", ")", ":", "self", ".", "_name", "=", "self", ".", "unique_name", "(", "self", ".", "_name", ")", "self", ".", "_full_name", "=", "None", "self", ".", "_logger", "=", "None", "self", ".", "_parent", "=", ...
Sets the parent of the actor. :param parent: the parent :type parent: Actor
[ "Sets", "the", "parent", "of", "the", "actor", "." ]
train
https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/flow/base.py#L136-L146
fracpete/python-weka-wrapper3
python/weka/flow/base.py
Actor.full_name
def full_name(self): """ Obtains the full name of the actor. :return: the full name :rtype: str """ if self._full_name is None: fn = self.name.replace(".", "\\.") parent = self._parent if parent is not None: fn = parent...
python
def full_name(self): """ Obtains the full name of the actor. :return: the full name :rtype: str """ if self._full_name is None: fn = self.name.replace(".", "\\.") parent = self._parent if parent is not None: fn = parent...
[ "def", "full_name", "(", "self", ")", ":", "if", "self", ".", "_full_name", "is", "None", ":", "fn", "=", "self", ".", "name", ".", "replace", "(", "\".\"", ",", "\"\\\\.\"", ")", "parent", "=", "self", ".", "_parent", "if", "parent", "is", "not", ...
Obtains the full name of the actor. :return: the full name :rtype: str
[ "Obtains", "the", "full", "name", "of", "the", "actor", "." ]
train
https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/flow/base.py#L162-L176
fracpete/python-weka-wrapper3
python/weka/flow/base.py
Actor.fix_config
def fix_config(self, options): """ Fixes the options, if necessary. I.e., it adds all required elements to the dictionary. :param options: the options to fix :type options: dict :return: the (potentially) fixed options :rtype: dict """ opt = "annotation" ...
python
def fix_config(self, options): """ Fixes the options, if necessary. I.e., it adds all required elements to the dictionary. :param options: the options to fix :type options: dict :return: the (potentially) fixed options :rtype: dict """ opt = "annotation" ...
[ "def", "fix_config", "(", "self", ",", "options", ")", ":", "opt", "=", "\"annotation\"", "if", "opt", "not", "in", "options", ":", "options", "[", "opt", "]", "=", "None", "if", "opt", "not", "in", "self", ".", "help", ":", "self", ".", "help", "[...
Fixes the options, if necessary. I.e., it adds all required elements to the dictionary. :param options: the options to fix :type options: dict :return: the (potentially) fixed options :rtype: dict
[ "Fixes", "the", "options", "if", "necessary", ".", "I", ".", "e", ".", "it", "adds", "all", "required", "elements", "to", "the", "dictionary", "." ]
train
https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/flow/base.py#L178-L199
fracpete/python-weka-wrapper3
python/weka/flow/base.py
Actor.to_dict
def to_dict(self): """ Returns a dictionary that represents this object, to be used for JSONification. :return: the object dictionary :rtype: dict """ result = super(Actor, self).to_dict() result["type"] = "Actor" result["name"] = self.name return...
python
def to_dict(self): """ Returns a dictionary that represents this object, to be used for JSONification. :return: the object dictionary :rtype: dict """ result = super(Actor, self).to_dict() result["type"] = "Actor" result["name"] = self.name return...
[ "def", "to_dict", "(", "self", ")", ":", "result", "=", "super", "(", "Actor", ",", "self", ")", ".", "to_dict", "(", ")", "result", "[", "\"type\"", "]", "=", "\"Actor\"", "result", "[", "\"name\"", "]", "=", "self", ".", "name", "return", "result" ...
Returns a dictionary that represents this object, to be used for JSONification. :return: the object dictionary :rtype: dict
[ "Returns", "a", "dictionary", "that", "represents", "this", "object", "to", "be", "used", "for", "JSONification", "." ]
train
https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/flow/base.py#L201-L211
fracpete/python-weka-wrapper3
python/weka/flow/base.py
Actor.from_dict
def from_dict(cls, d): """ Restores an object state from a dictionary, used in de-JSONification. :param d: the object dictionary :type d: dict :return: the object :rtype: object """ conf = {} for k in d["config"]: v = d["config"][k] ...
python
def from_dict(cls, d): """ Restores an object state from a dictionary, used in de-JSONification. :param d: the object dictionary :type d: dict :return: the object :rtype: object """ conf = {} for k in d["config"]: v = d["config"][k] ...
[ "def", "from_dict", "(", "cls", ",", "d", ")", ":", "conf", "=", "{", "}", "for", "k", "in", "d", "[", "\"config\"", "]", ":", "v", "=", "d", "[", "\"config\"", "]", "[", "k", "]", "if", "isinstance", "(", "v", ",", "dict", ")", ":", "if", ...
Restores an object state from a dictionary, used in de-JSONification. :param d: the object dictionary :type d: dict :return: the object :rtype: object
[ "Restores", "an", "object", "state", "from", "a", "dictionary", "used", "in", "de", "-", "JSONification", "." ]
train
https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/flow/base.py#L214-L234
fracpete/python-weka-wrapper3
python/weka/flow/base.py
Actor.resolve_option
def resolve_option(self, name, default=None): """ Resolves the option, i.e., interprets "@{...}" values and retrievs them instead from internal storage. :param name: the name of the option :type name: str :param default: the optional default value :type default: ...
python
def resolve_option(self, name, default=None): """ Resolves the option, i.e., interprets "@{...}" values and retrievs them instead from internal storage. :param name: the name of the option :type name: str :param default: the optional default value :type default: ...
[ "def", "resolve_option", "(", "self", ",", "name", ",", "default", "=", "None", ")", ":", "value", "=", "self", ".", "config", "[", "name", "]", "if", "value", "is", "None", ":", "return", "default", "elif", "isinstance", "(", "value", ",", "str", ")...
Resolves the option, i.e., interprets "@{...}" values and retrievs them instead from internal storage. :param name: the name of the option :type name: str :param default: the optional default value :type default: object :return: the resolved value :rtype: object
[ "Resolves", "the", "option", "i", ".", "e", ".", "interprets", "@", "{", "...", "}", "values", "and", "retrievs", "them", "instead", "from", "internal", "storage", "." ]
train
https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/flow/base.py#L236-L261
fracpete/python-weka-wrapper3
python/weka/flow/base.py
Actor.storagehandler
def storagehandler(self): """ Returns the storage handler available to thise actor. :return: the storage handler, None if not available """ if isinstance(self, StorageHandler): return self elif self.parent is not None: return self.parent.storageha...
python
def storagehandler(self): """ Returns the storage handler available to thise actor. :return: the storage handler, None if not available """ if isinstance(self, StorageHandler): return self elif self.parent is not None: return self.parent.storageha...
[ "def", "storagehandler", "(", "self", ")", ":", "if", "isinstance", "(", "self", ",", "StorageHandler", ")", ":", "return", "self", "elif", "self", ".", "parent", "is", "not", "None", ":", "return", "self", ".", "parent", ".", "storagehandler", "else", "...
Returns the storage handler available to thise actor. :return: the storage handler, None if not available
[ "Returns", "the", "storage", "handler", "available", "to", "thise", "actor", "." ]
train
https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/flow/base.py#L294-L305