repository_name
stringlengths
7
55
func_path_in_repository
stringlengths
4
223
func_name
stringlengths
1
134
whole_func_string
stringlengths
75
104k
language
stringclasses
1 value
func_code_string
stringlengths
75
104k
func_code_tokens
listlengths
19
28.4k
func_documentation_string
stringlengths
1
46.9k
func_documentation_tokens
listlengths
1
1.97k
split_name
stringclasses
1 value
func_code_url
stringlengths
87
315
noxdafox/clipspy
clips/classes.py
MessageHandler.undefine
def undefine(self): """Undefine the MessageHandler. Python equivalent of the CLIPS undefmessage-handler command. The object becomes unusable after this method has been called. """ if lib.EnvUndefmessageHandler(self._env, self._cls, self._idx) != 1: raise CLIPSError...
python
def undefine(self): """Undefine the MessageHandler. Python equivalent of the CLIPS undefmessage-handler command. The object becomes unusable after this method has been called. """ if lib.EnvUndefmessageHandler(self._env, self._cls, self._idx) != 1: raise CLIPSError...
[ "def", "undefine", "(", "self", ")", ":", "if", "lib", ".", "EnvUndefmessageHandler", "(", "self", ".", "_env", ",", "self", ".", "_cls", ",", "self", ".", "_idx", ")", "!=", "1", ":", "raise", "CLIPSError", "(", "self", ".", "_env", ")", "self", "...
Undefine the MessageHandler. Python equivalent of the CLIPS undefmessage-handler command. The object becomes unusable after this method has been called.
[ "Undefine", "the", "MessageHandler", "." ]
train
https://github.com/noxdafox/clipspy/blob/b22d71a6da821c1715d8fa00d7d75cabc09ed364/clips/classes.py#L729-L740
noxdafox/clipspy
clips/environment.py
Environment.load
def load(self, path): """Load a set of constructs into the CLIPS data base. Constructs can be in text or binary format. The Python equivalent of the CLIPS load command. """ try: self._load_binary(path) except CLIPSError: self._load_text(path)
python
def load(self, path): """Load a set of constructs into the CLIPS data base. Constructs can be in text or binary format. The Python equivalent of the CLIPS load command. """ try: self._load_binary(path) except CLIPSError: self._load_text(path)
[ "def", "load", "(", "self", ",", "path", ")", ":", "try", ":", "self", ".", "_load_binary", "(", "path", ")", "except", "CLIPSError", ":", "self", ".", "_load_text", "(", "path", ")" ]
Load a set of constructs into the CLIPS data base. Constructs can be in text or binary format. The Python equivalent of the CLIPS load command.
[ "Load", "a", "set", "of", "constructs", "into", "the", "CLIPS", "data", "base", "." ]
train
https://github.com/noxdafox/clipspy/blob/b22d71a6da821c1715d8fa00d7d75cabc09ed364/clips/environment.py#L103-L114
noxdafox/clipspy
clips/environment.py
Environment.save
def save(self, path, binary=False): """Save a set of constructs into the CLIPS data base. If binary is True, the constructs will be saved in binary format. The Python equivalent of the CLIPS load command. """ if binary: ret = lib.EnvBsave(self._env, path.encode()) ...
python
def save(self, path, binary=False): """Save a set of constructs into the CLIPS data base. If binary is True, the constructs will be saved in binary format. The Python equivalent of the CLIPS load command. """ if binary: ret = lib.EnvBsave(self._env, path.encode()) ...
[ "def", "save", "(", "self", ",", "path", ",", "binary", "=", "False", ")", ":", "if", "binary", ":", "ret", "=", "lib", ".", "EnvBsave", "(", "self", ".", "_env", ",", "path", ".", "encode", "(", ")", ")", "else", ":", "ret", "=", "lib", ".", ...
Save a set of constructs into the CLIPS data base. If binary is True, the constructs will be saved in binary format. The Python equivalent of the CLIPS load command.
[ "Save", "a", "set", "of", "constructs", "into", "the", "CLIPS", "data", "base", "." ]
train
https://github.com/noxdafox/clipspy/blob/b22d71a6da821c1715d8fa00d7d75cabc09ed364/clips/environment.py#L126-L139
noxdafox/clipspy
clips/environment.py
Environment.batch_star
def batch_star(self, path): """Evaluate the commands contained in the specific path. The Python equivalent of the CLIPS batch* command. """ if lib.EnvBatchStar(self._env, path.encode()) != 1: raise CLIPSError(self._env)
python
def batch_star(self, path): """Evaluate the commands contained in the specific path. The Python equivalent of the CLIPS batch* command. """ if lib.EnvBatchStar(self._env, path.encode()) != 1: raise CLIPSError(self._env)
[ "def", "batch_star", "(", "self", ",", "path", ")", ":", "if", "lib", ".", "EnvBatchStar", "(", "self", ".", "_env", ",", "path", ".", "encode", "(", ")", ")", "!=", "1", ":", "raise", "CLIPSError", "(", "self", ".", "_env", ")" ]
Evaluate the commands contained in the specific path. The Python equivalent of the CLIPS batch* command.
[ "Evaluate", "the", "commands", "contained", "in", "the", "specific", "path", "." ]
train
https://github.com/noxdafox/clipspy/blob/b22d71a6da821c1715d8fa00d7d75cabc09ed364/clips/environment.py#L141-L148
noxdafox/clipspy
clips/environment.py
Environment.build
def build(self, construct): """Build a single construct in CLIPS. The Python equivalent of the CLIPS build command. """ if lib.EnvBuild(self._env, construct.encode()) != 1: raise CLIPSError(self._env)
python
def build(self, construct): """Build a single construct in CLIPS. The Python equivalent of the CLIPS build command. """ if lib.EnvBuild(self._env, construct.encode()) != 1: raise CLIPSError(self._env)
[ "def", "build", "(", "self", ",", "construct", ")", ":", "if", "lib", ".", "EnvBuild", "(", "self", ".", "_env", ",", "construct", ".", "encode", "(", ")", ")", "!=", "1", ":", "raise", "CLIPSError", "(", "self", ".", "_env", ")" ]
Build a single construct in CLIPS. The Python equivalent of the CLIPS build command.
[ "Build", "a", "single", "construct", "in", "CLIPS", "." ]
train
https://github.com/noxdafox/clipspy/blob/b22d71a6da821c1715d8fa00d7d75cabc09ed364/clips/environment.py#L150-L157
noxdafox/clipspy
clips/environment.py
Environment.eval
def eval(self, construct): """Evaluate an expression returning its value. The Python equivalent of the CLIPS eval command. """ data = clips.data.DataObject(self._env) if lib.EnvEval(self._env, construct.encode(), data.byref) != 1: raise CLIPSError(self._env) ...
python
def eval(self, construct): """Evaluate an expression returning its value. The Python equivalent of the CLIPS eval command. """ data = clips.data.DataObject(self._env) if lib.EnvEval(self._env, construct.encode(), data.byref) != 1: raise CLIPSError(self._env) ...
[ "def", "eval", "(", "self", ",", "construct", ")", ":", "data", "=", "clips", ".", "data", ".", "DataObject", "(", "self", ".", "_env", ")", "if", "lib", ".", "EnvEval", "(", "self", ".", "_env", ",", "construct", ".", "encode", "(", ")", ",", "d...
Evaluate an expression returning its value. The Python equivalent of the CLIPS eval command.
[ "Evaluate", "an", "expression", "returning", "its", "value", "." ]
train
https://github.com/noxdafox/clipspy/blob/b22d71a6da821c1715d8fa00d7d75cabc09ed364/clips/environment.py#L159-L170
noxdafox/clipspy
clips/environment.py
Environment.define_function
def define_function(self, function, name=None): """Define the Python function within the CLIPS environment. If a name is given, it will be the function name within CLIPS. Otherwise, the name of the Python function will be used. The Python function will be accessible within CLIPS via it...
python
def define_function(self, function, name=None): """Define the Python function within the CLIPS environment. If a name is given, it will be the function name within CLIPS. Otherwise, the name of the Python function will be used. The Python function will be accessible within CLIPS via it...
[ "def", "define_function", "(", "self", ",", "function", ",", "name", "=", "None", ")", ":", "name", "=", "name", "if", "name", "is", "not", "None", "else", "function", ".", "__name__", "ENVIRONMENT_DATA", "[", "self", ".", "_env", "]", ".", "user_functio...
Define the Python function within the CLIPS environment. If a name is given, it will be the function name within CLIPS. Otherwise, the name of the Python function will be used. The Python function will be accessible within CLIPS via its name as if it was defined via the `deffunction` c...
[ "Define", "the", "Python", "function", "within", "the", "CLIPS", "environment", "." ]
train
https://github.com/noxdafox/clipspy/blob/b22d71a6da821c1715d8fa00d7d75cabc09ed364/clips/environment.py#L188-L202
noxdafox/clipspy
clips/router.py
Router.activate
def activate(self): """Activate the Router.""" if lib.EnvActivateRouter(self._env, self._name.encode()) == 0: raise RuntimeError("Unable to activate router %s" % self._name)
python
def activate(self): """Activate the Router.""" if lib.EnvActivateRouter(self._env, self._name.encode()) == 0: raise RuntimeError("Unable to activate router %s" % self._name)
[ "def", "activate", "(", "self", ")", ":", "if", "lib", ".", "EnvActivateRouter", "(", "self", ".", "_env", ",", "self", ".", "_name", ".", "encode", "(", ")", ")", "==", "0", ":", "raise", "RuntimeError", "(", "\"Unable to activate router %s\"", "%", "se...
Activate the Router.
[ "Activate", "the", "Router", "." ]
train
https://github.com/noxdafox/clipspy/blob/b22d71a6da821c1715d8fa00d7d75cabc09ed364/clips/router.py#L45-L48
noxdafox/clipspy
clips/router.py
Router.deactivate
def deactivate(self): """Deactivate the Router.""" if lib.EnvDeactivateRouter(self._env, self._name.encode()) == 0: raise RuntimeError("Unable to deactivate router %s" % self._name)
python
def deactivate(self): """Deactivate the Router.""" if lib.EnvDeactivateRouter(self._env, self._name.encode()) == 0: raise RuntimeError("Unable to deactivate router %s" % self._name)
[ "def", "deactivate", "(", "self", ")", ":", "if", "lib", ".", "EnvDeactivateRouter", "(", "self", ".", "_env", ",", "self", ".", "_name", ".", "encode", "(", ")", ")", "==", "0", ":", "raise", "RuntimeError", "(", "\"Unable to deactivate router %s\"", "%",...
Deactivate the Router.
[ "Deactivate", "the", "Router", "." ]
train
https://github.com/noxdafox/clipspy/blob/b22d71a6da821c1715d8fa00d7d75cabc09ed364/clips/router.py#L50-L53
noxdafox/clipspy
clips/router.py
Router.delete
def delete(self): """Delete the Router.""" if lib.EnvDeleteRouter(self._env, self._name.encode()) == 0: raise RuntimeError("Unable to delete router %s" % self._name)
python
def delete(self): """Delete the Router.""" if lib.EnvDeleteRouter(self._env, self._name.encode()) == 0: raise RuntimeError("Unable to delete router %s" % self._name)
[ "def", "delete", "(", "self", ")", ":", "if", "lib", ".", "EnvDeleteRouter", "(", "self", ".", "_env", ",", "self", ".", "_name", ".", "encode", "(", ")", ")", "==", "0", ":", "raise", "RuntimeError", "(", "\"Unable to delete router %s\"", "%", "self", ...
Delete the Router.
[ "Delete", "the", "Router", "." ]
train
https://github.com/noxdafox/clipspy/blob/b22d71a6da821c1715d8fa00d7d75cabc09ed364/clips/router.py#L55-L58
noxdafox/clipspy
clips/router.py
Router.add_to_environment
def add_to_environment(self, environment): """Add the router to the given environment.""" self._env = environment._env self._userdata = ffi.new_handle(self) ENVIRONMENT_DATA[self._env].routers[self.name] = self lib.EnvAddRouterWithContext( self._env, self._name.enco...
python
def add_to_environment(self, environment): """Add the router to the given environment.""" self._env = environment._env self._userdata = ffi.new_handle(self) ENVIRONMENT_DATA[self._env].routers[self.name] = self lib.EnvAddRouterWithContext( self._env, self._name.enco...
[ "def", "add_to_environment", "(", "self", ",", "environment", ")", ":", "self", ".", "_env", "=", "environment", ".", "_env", "self", ".", "_userdata", "=", "ffi", ".", "new_handle", "(", "self", ")", "ENVIRONMENT_DATA", "[", "self", ".", "_env", "]", "....
Add the router to the given environment.
[ "Add", "the", "router", "to", "the", "given", "environment", "." ]
train
https://github.com/noxdafox/clipspy/blob/b22d71a6da821c1715d8fa00d7d75cabc09ed364/clips/router.py#L60-L74
noxdafox/clipspy
clips/data.py
DataObject.value
def value(self): """Return the DATA_OBJECT stored value.""" dtype = lib.get_data_type(self._data) dvalue = lib.get_data_value(self._data) if dvalue == ffi.NULL: return None return self.python_value(dtype, dvalue)
python
def value(self): """Return the DATA_OBJECT stored value.""" dtype = lib.get_data_type(self._data) dvalue = lib.get_data_value(self._data) if dvalue == ffi.NULL: return None return self.python_value(dtype, dvalue)
[ "def", "value", "(", "self", ")", ":", "dtype", "=", "lib", ".", "get_data_type", "(", "self", ".", "_data", ")", "dvalue", "=", "lib", ".", "get_data_value", "(", "self", ".", "_data", ")", "if", "dvalue", "==", "ffi", ".", "NULL", ":", "return", ...
Return the DATA_OBJECT stored value.
[ "Return", "the", "DATA_OBJECT", "stored", "value", "." ]
train
https://github.com/noxdafox/clipspy/blob/b22d71a6da821c1715d8fa00d7d75cabc09ed364/clips/data.py#L58-L66
noxdafox/clipspy
clips/data.py
DataObject.value
def value(self, value): """Sets the DATA_OBJECT stored value.""" dtype = TYPES[type(value)] if self._type is None else self._type lib.set_data_type(self._data, dtype) lib.set_data_value(self._data, self.clips_value(value))
python
def value(self, value): """Sets the DATA_OBJECT stored value.""" dtype = TYPES[type(value)] if self._type is None else self._type lib.set_data_type(self._data, dtype) lib.set_data_value(self._data, self.clips_value(value))
[ "def", "value", "(", "self", ",", "value", ")", ":", "dtype", "=", "TYPES", "[", "type", "(", "value", ")", "]", "if", "self", ".", "_type", "is", "None", "else", "self", ".", "_type", "lib", ".", "set_data_type", "(", "self", ".", "_data", ",", ...
Sets the DATA_OBJECT stored value.
[ "Sets", "the", "DATA_OBJECT", "stored", "value", "." ]
train
https://github.com/noxdafox/clipspy/blob/b22d71a6da821c1715d8fa00d7d75cabc09ed364/clips/data.py#L69-L74
noxdafox/clipspy
clips/data.py
DataObject.python_value
def python_value(self, dtype, dvalue): """Convert a CLIPS type into Python.""" try: return CONVERTERS[dtype](dvalue) except KeyError: if dtype == clips.common.CLIPSType.MULTIFIELD: return self.multifield_to_list() if dtype == clips.common.CLIPS...
python
def python_value(self, dtype, dvalue): """Convert a CLIPS type into Python.""" try: return CONVERTERS[dtype](dvalue) except KeyError: if dtype == clips.common.CLIPSType.MULTIFIELD: return self.multifield_to_list() if dtype == clips.common.CLIPS...
[ "def", "python_value", "(", "self", ",", "dtype", ",", "dvalue", ")", ":", "try", ":", "return", "CONVERTERS", "[", "dtype", "]", "(", "dvalue", ")", "except", "KeyError", ":", "if", "dtype", "==", "clips", ".", "common", ".", "CLIPSType", ".", "MULTIF...
Convert a CLIPS type into Python.
[ "Convert", "a", "CLIPS", "type", "into", "Python", "." ]
train
https://github.com/noxdafox/clipspy/blob/b22d71a6da821c1715d8fa00d7d75cabc09ed364/clips/data.py#L76-L88
noxdafox/clipspy
clips/data.py
DataObject.clips_value
def clips_value(self, dvalue): """Convert a Python type into CLIPS.""" try: return VALUES[type(dvalue)](self._env, dvalue) except KeyError: if isinstance(dvalue, (list, tuple)): return self.list_to_multifield(dvalue) if isinstance(dvalue, (clip...
python
def clips_value(self, dvalue): """Convert a Python type into CLIPS.""" try: return VALUES[type(dvalue)](self._env, dvalue) except KeyError: if isinstance(dvalue, (list, tuple)): return self.list_to_multifield(dvalue) if isinstance(dvalue, (clip...
[ "def", "clips_value", "(", "self", ",", "dvalue", ")", ":", "try", ":", "return", "VALUES", "[", "type", "(", "dvalue", ")", "]", "(", "self", ".", "_env", ",", "dvalue", ")", "except", "KeyError", ":", "if", "isinstance", "(", "dvalue", ",", "(", ...
Convert a Python type into CLIPS.
[ "Convert", "a", "Python", "type", "into", "CLIPS", "." ]
train
https://github.com/noxdafox/clipspy/blob/b22d71a6da821c1715d8fa00d7d75cabc09ed364/clips/data.py#L90-L102
noxdafox/clipspy
clips/agenda.py
Agenda.agenda_changed
def agenda_changed(self): """True if any rule activation changes have occurred.""" value = bool(lib.EnvGetAgendaChanged(self._env)) lib.EnvSetAgendaChanged(self._env, int(False)) return value
python
def agenda_changed(self): """True if any rule activation changes have occurred.""" value = bool(lib.EnvGetAgendaChanged(self._env)) lib.EnvSetAgendaChanged(self._env, int(False)) return value
[ "def", "agenda_changed", "(", "self", ")", ":", "value", "=", "bool", "(", "lib", ".", "EnvGetAgendaChanged", "(", "self", ".", "_env", ")", ")", "lib", ".", "EnvSetAgendaChanged", "(", "self", ".", "_env", ",", "int", "(", "False", ")", ")", "return",...
True if any rule activation changes have occurred.
[ "True", "if", "any", "rule", "activation", "changes", "have", "occurred", "." ]
train
https://github.com/noxdafox/clipspy/blob/b22d71a6da821c1715d8fa00d7d75cabc09ed364/clips/agenda.py#L64-L69
noxdafox/clipspy
clips/agenda.py
Agenda.rules
def rules(self): """Iterate over the defined Rules.""" rule = lib.EnvGetNextDefrule(self._env, ffi.NULL) while rule != ffi.NULL: yield Rule(self._env, rule) rule = lib.EnvGetNextDefrule(self._env, rule)
python
def rules(self): """Iterate over the defined Rules.""" rule = lib.EnvGetNextDefrule(self._env, ffi.NULL) while rule != ffi.NULL: yield Rule(self._env, rule) rule = lib.EnvGetNextDefrule(self._env, rule)
[ "def", "rules", "(", "self", ")", ":", "rule", "=", "lib", ".", "EnvGetNextDefrule", "(", "self", ".", "_env", ",", "ffi", ".", "NULL", ")", "while", "rule", "!=", "ffi", ".", "NULL", ":", "yield", "Rule", "(", "self", ".", "_env", ",", "rule", "...
Iterate over the defined Rules.
[ "Iterate", "over", "the", "defined", "Rules", "." ]
train
https://github.com/noxdafox/clipspy/blob/b22d71a6da821c1715d8fa00d7d75cabc09ed364/clips/agenda.py#L125-L132
noxdafox/clipspy
clips/agenda.py
Agenda.find_rule
def find_rule(self, rule): """Find a Rule by name.""" defrule = lib.EnvFindDefrule(self._env, rule.encode()) if defrule == ffi.NULL: raise LookupError("Rule '%s' not found" % defrule) return Rule(self._env, defrule)
python
def find_rule(self, rule): """Find a Rule by name.""" defrule = lib.EnvFindDefrule(self._env, rule.encode()) if defrule == ffi.NULL: raise LookupError("Rule '%s' not found" % defrule) return Rule(self._env, defrule)
[ "def", "find_rule", "(", "self", ",", "rule", ")", ":", "defrule", "=", "lib", ".", "EnvFindDefrule", "(", "self", ".", "_env", ",", "rule", ".", "encode", "(", ")", ")", "if", "defrule", "==", "ffi", ".", "NULL", ":", "raise", "LookupError", "(", ...
Find a Rule by name.
[ "Find", "a", "Rule", "by", "name", "." ]
train
https://github.com/noxdafox/clipspy/blob/b22d71a6da821c1715d8fa00d7d75cabc09ed364/clips/agenda.py#L134-L140
noxdafox/clipspy
clips/agenda.py
Agenda.reorder
def reorder(self, module=None): """Reorder the Activations in the Agenda. If no Module is specified, the current one is used. To be called after changing the conflict resolution strategy. """ module = module._mdl if module is not None else ffi.NULL lib.EnvReorderAgend...
python
def reorder(self, module=None): """Reorder the Activations in the Agenda. If no Module is specified, the current one is used. To be called after changing the conflict resolution strategy. """ module = module._mdl if module is not None else ffi.NULL lib.EnvReorderAgend...
[ "def", "reorder", "(", "self", ",", "module", "=", "None", ")", ":", "module", "=", "module", ".", "_mdl", "if", "module", "is", "not", "None", "else", "ffi", ".", "NULL", "lib", ".", "EnvReorderAgenda", "(", "self", ".", "_env", ",", "module", ")" ]
Reorder the Activations in the Agenda. If no Module is specified, the current one is used. To be called after changing the conflict resolution strategy.
[ "Reorder", "the", "Activations", "in", "the", "Agenda", "." ]
train
https://github.com/noxdafox/clipspy/blob/b22d71a6da821c1715d8fa00d7d75cabc09ed364/clips/agenda.py#L142-L152
noxdafox/clipspy
clips/agenda.py
Agenda.refresh
def refresh(self, module=None): """Recompute the salience values of the Activations on the Agenda and then reorder the agenda. The Python equivalent of the CLIPS refresh-agenda command. If no Module is specified, the current one is used. """ module = module._mdl if modu...
python
def refresh(self, module=None): """Recompute the salience values of the Activations on the Agenda and then reorder the agenda. The Python equivalent of the CLIPS refresh-agenda command. If no Module is specified, the current one is used. """ module = module._mdl if modu...
[ "def", "refresh", "(", "self", ",", "module", "=", "None", ")", ":", "module", "=", "module", ".", "_mdl", "if", "module", "is", "not", "None", "else", "ffi", ".", "NULL", "lib", ".", "EnvRefreshAgenda", "(", "self", ".", "_env", ",", "module", ")" ]
Recompute the salience values of the Activations on the Agenda and then reorder the agenda. The Python equivalent of the CLIPS refresh-agenda command. If no Module is specified, the current one is used.
[ "Recompute", "the", "salience", "values", "of", "the", "Activations", "on", "the", "Agenda", "and", "then", "reorder", "the", "agenda", "." ]
train
https://github.com/noxdafox/clipspy/blob/b22d71a6da821c1715d8fa00d7d75cabc09ed364/clips/agenda.py#L154-L164
noxdafox/clipspy
clips/agenda.py
Agenda.activations
def activations(self): """Iterate over the Activations in the Agenda.""" activation = lib.EnvGetNextActivation(self._env, ffi.NULL) while activation != ffi.NULL: yield Activation(self._env, activation) activation = lib.EnvGetNextActivation(self._env, activation)
python
def activations(self): """Iterate over the Activations in the Agenda.""" activation = lib.EnvGetNextActivation(self._env, ffi.NULL) while activation != ffi.NULL: yield Activation(self._env, activation) activation = lib.EnvGetNextActivation(self._env, activation)
[ "def", "activations", "(", "self", ")", ":", "activation", "=", "lib", ".", "EnvGetNextActivation", "(", "self", ".", "_env", ",", "ffi", ".", "NULL", ")", "while", "activation", "!=", "ffi", ".", "NULL", ":", "yield", "Activation", "(", "self", ".", "...
Iterate over the Activations in the Agenda.
[ "Iterate", "over", "the", "Activations", "in", "the", "Agenda", "." ]
train
https://github.com/noxdafox/clipspy/blob/b22d71a6da821c1715d8fa00d7d75cabc09ed364/clips/agenda.py#L166-L173
noxdafox/clipspy
clips/agenda.py
Agenda.clear
def clear(self): """Deletes all activations in the agenda.""" if lib.EnvDeleteActivation(self._env, ffi.NULL) != 1: raise CLIPSError(self._env)
python
def clear(self): """Deletes all activations in the agenda.""" if lib.EnvDeleteActivation(self._env, ffi.NULL) != 1: raise CLIPSError(self._env)
[ "def", "clear", "(", "self", ")", ":", "if", "lib", ".", "EnvDeleteActivation", "(", "self", ".", "_env", ",", "ffi", ".", "NULL", ")", "!=", "1", ":", "raise", "CLIPSError", "(", "self", ".", "_env", ")" ]
Deletes all activations in the agenda.
[ "Deletes", "all", "activations", "in", "the", "agenda", "." ]
train
https://github.com/noxdafox/clipspy/blob/b22d71a6da821c1715d8fa00d7d75cabc09ed364/clips/agenda.py#L175-L178
noxdafox/clipspy
clips/agenda.py
Rule.name
def name(self): """Rule name.""" return ffi.string(lib.EnvGetDefruleName(self._env, self._rule)).decode()
python
def name(self): """Rule name.""" return ffi.string(lib.EnvGetDefruleName(self._env, self._rule)).decode()
[ "def", "name", "(", "self", ")", ":", "return", "ffi", ".", "string", "(", "lib", ".", "EnvGetDefruleName", "(", "self", ".", "_env", ",", "self", ".", "_rule", ")", ")", ".", "decode", "(", ")" ]
Rule name.
[ "Rule", "name", "." ]
train
https://github.com/noxdafox/clipspy/blob/b22d71a6da821c1715d8fa00d7d75cabc09ed364/clips/agenda.py#L228-L230
noxdafox/clipspy
clips/agenda.py
Rule.module
def module(self): """The module in which the Rule is defined. Python equivalent of the CLIPS defrule-module command. """ modname = ffi.string(lib.EnvDefruleModule(self._env, self._rule)) defmodule = lib.EnvFindDefmodule(self._env, modname) return Module(self._env, defm...
python
def module(self): """The module in which the Rule is defined. Python equivalent of the CLIPS defrule-module command. """ modname = ffi.string(lib.EnvDefruleModule(self._env, self._rule)) defmodule = lib.EnvFindDefmodule(self._env, modname) return Module(self._env, defm...
[ "def", "module", "(", "self", ")", ":", "modname", "=", "ffi", ".", "string", "(", "lib", ".", "EnvDefruleModule", "(", "self", ".", "_env", ",", "self", ".", "_rule", ")", ")", "defmodule", "=", "lib", ".", "EnvFindDefmodule", "(", "self", ".", "_en...
The module in which the Rule is defined. Python equivalent of the CLIPS defrule-module command.
[ "The", "module", "in", "which", "the", "Rule", "is", "defined", "." ]
train
https://github.com/noxdafox/clipspy/blob/b22d71a6da821c1715d8fa00d7d75cabc09ed364/clips/agenda.py#L233-L242
noxdafox/clipspy
clips/agenda.py
Rule.watch_firings
def watch_firings(self, flag): """Whether or not the Rule firings are being watched.""" lib.EnvSetDefruleWatchFirings(self._env, int(flag), self._rule)
python
def watch_firings(self, flag): """Whether or not the Rule firings are being watched.""" lib.EnvSetDefruleWatchFirings(self._env, int(flag), self._rule)
[ "def", "watch_firings", "(", "self", ",", "flag", ")", ":", "lib", ".", "EnvSetDefruleWatchFirings", "(", "self", ".", "_env", ",", "int", "(", "flag", ")", ",", "self", ".", "_rule", ")" ]
Whether or not the Rule firings are being watched.
[ "Whether", "or", "not", "the", "Rule", "firings", "are", "being", "watched", "." ]
train
https://github.com/noxdafox/clipspy/blob/b22d71a6da821c1715d8fa00d7d75cabc09ed364/clips/agenda.py#L255-L257
noxdafox/clipspy
clips/agenda.py
Rule.watch_activations
def watch_activations(self, flag): """Whether or not the Rule Activations are being watched.""" lib.EnvSetDefruleWatchActivations(self._env, int(flag), self._rule)
python
def watch_activations(self, flag): """Whether or not the Rule Activations are being watched.""" lib.EnvSetDefruleWatchActivations(self._env, int(flag), self._rule)
[ "def", "watch_activations", "(", "self", ",", "flag", ")", ":", "lib", ".", "EnvSetDefruleWatchActivations", "(", "self", ".", "_env", ",", "int", "(", "flag", ")", ",", "self", ".", "_rule", ")" ]
Whether or not the Rule Activations are being watched.
[ "Whether", "or", "not", "the", "Rule", "Activations", "are", "being", "watched", "." ]
train
https://github.com/noxdafox/clipspy/blob/b22d71a6da821c1715d8fa00d7d75cabc09ed364/clips/agenda.py#L265-L267
noxdafox/clipspy
clips/agenda.py
Rule.matches
def matches(self, verbosity=Verbosity.TERSE): """Shows partial matches and activations. Returns a tuple containing the combined sum of the matches for each pattern, the combined sum of partial matches and the number of activations. The verbosity parameter controls how much to o...
python
def matches(self, verbosity=Verbosity.TERSE): """Shows partial matches and activations. Returns a tuple containing the combined sum of the matches for each pattern, the combined sum of partial matches and the number of activations. The verbosity parameter controls how much to o...
[ "def", "matches", "(", "self", ",", "verbosity", "=", "Verbosity", ".", "TERSE", ")", ":", "data", "=", "clips", ".", "data", ".", "DataObject", "(", "self", ".", "_env", ")", "lib", ".", "EnvMatches", "(", "self", ".", "_env", ",", "self", ".", "_...
Shows partial matches and activations. Returns a tuple containing the combined sum of the matches for each pattern, the combined sum of partial matches and the number of activations. The verbosity parameter controls how much to output: * Verbosity.VERBOSE: detailed matches a...
[ "Shows", "partial", "matches", "and", "activations", "." ]
train
https://github.com/noxdafox/clipspy/blob/b22d71a6da821c1715d8fa00d7d75cabc09ed364/clips/agenda.py#L269-L287
noxdafox/clipspy
clips/agenda.py
Rule.refresh
def refresh(self): """Refresh the Rule. The Python equivalent of the CLIPS refresh command. """ if lib.EnvRefresh(self._env, self._rule) != 1: raise CLIPSError(self._env)
python
def refresh(self): """Refresh the Rule. The Python equivalent of the CLIPS refresh command. """ if lib.EnvRefresh(self._env, self._rule) != 1: raise CLIPSError(self._env)
[ "def", "refresh", "(", "self", ")", ":", "if", "lib", ".", "EnvRefresh", "(", "self", ".", "_env", ",", "self", ".", "_rule", ")", "!=", "1", ":", "raise", "CLIPSError", "(", "self", ".", "_env", ")" ]
Refresh the Rule. The Python equivalent of the CLIPS refresh command.
[ "Refresh", "the", "Rule", "." ]
train
https://github.com/noxdafox/clipspy/blob/b22d71a6da821c1715d8fa00d7d75cabc09ed364/clips/agenda.py#L289-L296
noxdafox/clipspy
clips/agenda.py
Rule.undefine
def undefine(self): """Undefine the Rule. Python equivalent of the CLIPS undefrule command. The object becomes unusable after this method has been called. """ if lib.EnvUndefrule(self._env, self._rule) != 1: raise CLIPSError(self._env) self._env = None
python
def undefine(self): """Undefine the Rule. Python equivalent of the CLIPS undefrule command. The object becomes unusable after this method has been called. """ if lib.EnvUndefrule(self._env, self._rule) != 1: raise CLIPSError(self._env) self._env = None
[ "def", "undefine", "(", "self", ")", ":", "if", "lib", ".", "EnvUndefrule", "(", "self", ".", "_env", ",", "self", ".", "_rule", ")", "!=", "1", ":", "raise", "CLIPSError", "(", "self", ".", "_env", ")", "self", ".", "_env", "=", "None" ]
Undefine the Rule. Python equivalent of the CLIPS undefrule command. The object becomes unusable after this method has been called.
[ "Undefine", "the", "Rule", "." ]
train
https://github.com/noxdafox/clipspy/blob/b22d71a6da821c1715d8fa00d7d75cabc09ed364/clips/agenda.py#L315-L326
noxdafox/clipspy
clips/agenda.py
Activation.name
def name(self): """Activation Rule name.""" return ffi.string( lib.EnvGetActivationName(self._env, self._act)).decode()
python
def name(self): """Activation Rule name.""" return ffi.string( lib.EnvGetActivationName(self._env, self._act)).decode()
[ "def", "name", "(", "self", ")", ":", "return", "ffi", ".", "string", "(", "lib", ".", "EnvGetActivationName", "(", "self", ".", "_env", ",", "self", ".", "_act", ")", ")", ".", "decode", "(", ")" ]
Activation Rule name.
[ "Activation", "Rule", "name", "." ]
train
https://github.com/noxdafox/clipspy/blob/b22d71a6da821c1715d8fa00d7d75cabc09ed364/clips/agenda.py#L355-L358
noxdafox/clipspy
clips/agenda.py
Activation.salience
def salience(self, salience): """Activation salience value.""" lib.EnvSetActivationSalience(self._env, self._act, salience)
python
def salience(self, salience): """Activation salience value.""" lib.EnvSetActivationSalience(self._env, self._act, salience)
[ "def", "salience", "(", "self", ",", "salience", ")", ":", "lib", ".", "EnvSetActivationSalience", "(", "self", ".", "_env", ",", "self", ".", "_act", ",", "salience", ")" ]
Activation salience value.
[ "Activation", "salience", "value", "." ]
train
https://github.com/noxdafox/clipspy/blob/b22d71a6da821c1715d8fa00d7d75cabc09ed364/clips/agenda.py#L366-L368
noxdafox/clipspy
clips/agenda.py
Activation.delete
def delete(self): """Remove the activation from the agenda.""" if lib.EnvDeleteActivation(self._env, self._act) != 1: raise CLIPSError(self._env) self._env = None
python
def delete(self): """Remove the activation from the agenda.""" if lib.EnvDeleteActivation(self._env, self._act) != 1: raise CLIPSError(self._env) self._env = None
[ "def", "delete", "(", "self", ")", ":", "if", "lib", ".", "EnvDeleteActivation", "(", "self", ".", "_env", ",", "self", ".", "_act", ")", "!=", "1", ":", "raise", "CLIPSError", "(", "self", ".", "_env", ")", "self", ".", "_env", "=", "None" ]
Remove the activation from the agenda.
[ "Remove", "the", "activation", "from", "the", "agenda", "." ]
train
https://github.com/noxdafox/clipspy/blob/b22d71a6da821c1715d8fa00d7d75cabc09ed364/clips/agenda.py#L370-L375
noxdafox/clipspy
clips/modules.py
Modules.globals_changed
def globals_changed(self): """True if any Global has changed.""" value = bool(lib.EnvGetGlobalsChanged(self._env)) lib.EnvSetGlobalsChanged(self._env, int(False)) return value
python
def globals_changed(self): """True if any Global has changed.""" value = bool(lib.EnvGetGlobalsChanged(self._env)) lib.EnvSetGlobalsChanged(self._env, int(False)) return value
[ "def", "globals_changed", "(", "self", ")", ":", "value", "=", "bool", "(", "lib", ".", "EnvGetGlobalsChanged", "(", "self", ".", "_env", ")", ")", "lib", ".", "EnvSetGlobalsChanged", "(", "self", ".", "_env", ",", "int", "(", "False", ")", ")", "retur...
True if any Global has changed.
[ "True", "if", "any", "Global", "has", "changed", "." ]
train
https://github.com/noxdafox/clipspy/blob/b22d71a6da821c1715d8fa00d7d75cabc09ed364/clips/modules.py#L78-L83
noxdafox/clipspy
clips/modules.py
Modules.globals
def globals(self): """Iterates over the defined Globals.""" defglobal = lib.EnvGetNextDefglobal(self._env, ffi.NULL) while defglobal != ffi.NULL: yield Global(self._env, defglobal) defglobal = lib.EnvGetNextDefglobal(self._env, defglobal)
python
def globals(self): """Iterates over the defined Globals.""" defglobal = lib.EnvGetNextDefglobal(self._env, ffi.NULL) while defglobal != ffi.NULL: yield Global(self._env, defglobal) defglobal = lib.EnvGetNextDefglobal(self._env, defglobal)
[ "def", "globals", "(", "self", ")", ":", "defglobal", "=", "lib", ".", "EnvGetNextDefglobal", "(", "self", ".", "_env", ",", "ffi", ".", "NULL", ")", "while", "defglobal", "!=", "ffi", ".", "NULL", ":", "yield", "Global", "(", "self", ".", "_env", ",...
Iterates over the defined Globals.
[ "Iterates", "over", "the", "defined", "Globals", "." ]
train
https://github.com/noxdafox/clipspy/blob/b22d71a6da821c1715d8fa00d7d75cabc09ed364/clips/modules.py#L85-L92
noxdafox/clipspy
clips/modules.py
Modules.find_global
def find_global(self, name): """Find the Global by its name.""" defglobal = lib.EnvFindDefglobal(self._env, name.encode()) if defglobal == ffi.NULL: raise LookupError("Global '%s' not found" % name) return Global(self._env, defglobal)
python
def find_global(self, name): """Find the Global by its name.""" defglobal = lib.EnvFindDefglobal(self._env, name.encode()) if defglobal == ffi.NULL: raise LookupError("Global '%s' not found" % name) return Global(self._env, defglobal)
[ "def", "find_global", "(", "self", ",", "name", ")", ":", "defglobal", "=", "lib", ".", "EnvFindDefglobal", "(", "self", ".", "_env", ",", "name", ".", "encode", "(", ")", ")", "if", "defglobal", "==", "ffi", ".", "NULL", ":", "raise", "LookupError", ...
Find the Global by its name.
[ "Find", "the", "Global", "by", "its", "name", "." ]
train
https://github.com/noxdafox/clipspy/blob/b22d71a6da821c1715d8fa00d7d75cabc09ed364/clips/modules.py#L94-L100
noxdafox/clipspy
clips/modules.py
Modules.modules
def modules(self): """Iterates over the defined Modules.""" defmodule = lib.EnvGetNextDefmodule(self._env, ffi.NULL) while defmodule != ffi.NULL: yield Module(self._env, defmodule) defmodule = lib.EnvGetNextDefmodule(self._env, defmodule)
python
def modules(self): """Iterates over the defined Modules.""" defmodule = lib.EnvGetNextDefmodule(self._env, ffi.NULL) while defmodule != ffi.NULL: yield Module(self._env, defmodule) defmodule = lib.EnvGetNextDefmodule(self._env, defmodule)
[ "def", "modules", "(", "self", ")", ":", "defmodule", "=", "lib", ".", "EnvGetNextDefmodule", "(", "self", ".", "_env", ",", "ffi", ".", "NULL", ")", "while", "defmodule", "!=", "ffi", ".", "NULL", ":", "yield", "Module", "(", "self", ".", "_env", ",...
Iterates over the defined Modules.
[ "Iterates", "over", "the", "defined", "Modules", "." ]
train
https://github.com/noxdafox/clipspy/blob/b22d71a6da821c1715d8fa00d7d75cabc09ed364/clips/modules.py#L102-L109
noxdafox/clipspy
clips/modules.py
Modules.find_module
def find_module(self, name): """Find the Module by its name.""" defmodule = lib.EnvFindDefmodule(self._env, name.encode()) if defmodule == ffi.NULL: raise LookupError("Module '%s' not found" % name) return Module(self._env, defmodule)
python
def find_module(self, name): """Find the Module by its name.""" defmodule = lib.EnvFindDefmodule(self._env, name.encode()) if defmodule == ffi.NULL: raise LookupError("Module '%s' not found" % name) return Module(self._env, defmodule)
[ "def", "find_module", "(", "self", ",", "name", ")", ":", "defmodule", "=", "lib", ".", "EnvFindDefmodule", "(", "self", ".", "_env", ",", "name", ".", "encode", "(", ")", ")", "if", "defmodule", "==", "ffi", ".", "NULL", ":", "raise", "LookupError", ...
Find the Module by its name.
[ "Find", "the", "Module", "by", "its", "name", "." ]
train
https://github.com/noxdafox/clipspy/blob/b22d71a6da821c1715d8fa00d7d75cabc09ed364/clips/modules.py#L111-L117
noxdafox/clipspy
clips/modules.py
Global.value
def value(self): """Global value.""" data = clips.data.DataObject(self._env) if lib.EnvGetDefglobalValue( self._env, self.name.encode(), data.byref) != 1: raise CLIPSError(self._env) return data.value
python
def value(self): """Global value.""" data = clips.data.DataObject(self._env) if lib.EnvGetDefglobalValue( self._env, self.name.encode(), data.byref) != 1: raise CLIPSError(self._env) return data.value
[ "def", "value", "(", "self", ")", ":", "data", "=", "clips", ".", "data", ".", "DataObject", "(", "self", ".", "_env", ")", "if", "lib", ".", "EnvGetDefglobalValue", "(", "self", ".", "_env", ",", "self", ".", "name", ".", "encode", "(", ")", ",", ...
Global value.
[ "Global", "value", "." ]
train
https://github.com/noxdafox/clipspy/blob/b22d71a6da821c1715d8fa00d7d75cabc09ed364/clips/modules.py#L151-L159
noxdafox/clipspy
clips/modules.py
Global.name
def name(self): """Global name.""" return ffi.string( lib.EnvGetDefglobalName(self._env, self._glb)).decode()
python
def name(self): """Global name.""" return ffi.string( lib.EnvGetDefglobalName(self._env, self._glb)).decode()
[ "def", "name", "(", "self", ")", ":", "return", "ffi", ".", "string", "(", "lib", ".", "EnvGetDefglobalName", "(", "self", ".", "_env", ",", "self", ".", "_glb", ")", ")", ".", "decode", "(", ")" ]
Global name.
[ "Global", "name", "." ]
train
https://github.com/noxdafox/clipspy/blob/b22d71a6da821c1715d8fa00d7d75cabc09ed364/clips/modules.py#L172-L175
noxdafox/clipspy
clips/modules.py
Global.module
def module(self): """The module in which the Global is defined. Python equivalent of the CLIPS defglobal-module command. """ modname = ffi.string(lib.EnvDefglobalModule(self._env, self._glb)) defmodule = lib.EnvFindDefmodule(self._env, modname) return Module(self._env,...
python
def module(self): """The module in which the Global is defined. Python equivalent of the CLIPS defglobal-module command. """ modname = ffi.string(lib.EnvDefglobalModule(self._env, self._glb)) defmodule = lib.EnvFindDefmodule(self._env, modname) return Module(self._env,...
[ "def", "module", "(", "self", ")", ":", "modname", "=", "ffi", ".", "string", "(", "lib", ".", "EnvDefglobalModule", "(", "self", ".", "_env", ",", "self", ".", "_glb", ")", ")", "defmodule", "=", "lib", ".", "EnvFindDefmodule", "(", "self", ".", "_e...
The module in which the Global is defined. Python equivalent of the CLIPS defglobal-module command.
[ "The", "module", "in", "which", "the", "Global", "is", "defined", "." ]
train
https://github.com/noxdafox/clipspy/blob/b22d71a6da821c1715d8fa00d7d75cabc09ed364/clips/modules.py#L178-L187
noxdafox/clipspy
clips/modules.py
Global.watch
def watch(self, flag): """Whether or not the Global is being watched.""" lib.EnvSetDefglobalWatch(self._env, int(flag), self._glb)
python
def watch(self, flag): """Whether or not the Global is being watched.""" lib.EnvSetDefglobalWatch(self._env, int(flag), self._glb)
[ "def", "watch", "(", "self", ",", "flag", ")", ":", "lib", ".", "EnvSetDefglobalWatch", "(", "self", ".", "_env", ",", "int", "(", "flag", ")", ",", "self", ".", "_glb", ")" ]
Whether or not the Global is being watched.
[ "Whether", "or", "not", "the", "Global", "is", "being", "watched", "." ]
train
https://github.com/noxdafox/clipspy/blob/b22d71a6da821c1715d8fa00d7d75cabc09ed364/clips/modules.py#L200-L202
noxdafox/clipspy
clips/modules.py
Global.undefine
def undefine(self): """Undefine the Global. Python equivalent of the CLIPS undefglobal command. The object becomes unusable after this method has been called. """ if lib.EnvUndefglobal(self._env, self._glb) != 1: raise CLIPSError(self._env) self._env = Non...
python
def undefine(self): """Undefine the Global. Python equivalent of the CLIPS undefglobal command. The object becomes unusable after this method has been called. """ if lib.EnvUndefglobal(self._env, self._glb) != 1: raise CLIPSError(self._env) self._env = Non...
[ "def", "undefine", "(", "self", ")", ":", "if", "lib", ".", "EnvUndefglobal", "(", "self", ".", "_env", ",", "self", ".", "_glb", ")", "!=", "1", ":", "raise", "CLIPSError", "(", "self", ".", "_env", ")", "self", ".", "_env", "=", "None" ]
Undefine the Global. Python equivalent of the CLIPS undefglobal command. The object becomes unusable after this method has been called.
[ "Undefine", "the", "Global", "." ]
train
https://github.com/noxdafox/clipspy/blob/b22d71a6da821c1715d8fa00d7d75cabc09ed364/clips/modules.py#L204-L215
noxdafox/clipspy
clips/modules.py
Module.name
def name(self): """Global name.""" return ffi.string( lib.EnvGetDefmoduleName(self._env, self._mdl)).decode()
python
def name(self): """Global name.""" return ffi.string( lib.EnvGetDefmoduleName(self._env, self._mdl)).decode()
[ "def", "name", "(", "self", ")", ":", "return", "ffi", ".", "string", "(", "lib", ".", "EnvGetDefmoduleName", "(", "self", ".", "_env", ",", "self", ".", "_mdl", ")", ")", ".", "decode", "(", ")" ]
Global name.
[ "Global", "name", "." ]
train
https://github.com/noxdafox/clipspy/blob/b22d71a6da821c1715d8fa00d7d75cabc09ed364/clips/modules.py#L244-L247
noxdafox/clipspy
clips/functions.py
Functions.functions
def functions(self): """Iterates over the defined Globals.""" deffunction = lib.EnvGetNextDeffunction(self._env, ffi.NULL) while deffunction != ffi.NULL: yield Function(self._env, deffunction) deffunction = lib.EnvGetNextDeffunction(self._env, deffunction)
python
def functions(self): """Iterates over the defined Globals.""" deffunction = lib.EnvGetNextDeffunction(self._env, ffi.NULL) while deffunction != ffi.NULL: yield Function(self._env, deffunction) deffunction = lib.EnvGetNextDeffunction(self._env, deffunction)
[ "def", "functions", "(", "self", ")", ":", "deffunction", "=", "lib", ".", "EnvGetNextDeffunction", "(", "self", ".", "_env", ",", "ffi", ".", "NULL", ")", "while", "deffunction", "!=", "ffi", ".", "NULL", ":", "yield", "Function", "(", "self", ".", "_...
Iterates over the defined Globals.
[ "Iterates", "over", "the", "defined", "Globals", "." ]
train
https://github.com/noxdafox/clipspy/blob/b22d71a6da821c1715d8fa00d7d75cabc09ed364/clips/functions.py#L61-L68
noxdafox/clipspy
clips/functions.py
Functions.find_function
def find_function(self, name): """Find the Function by its name.""" deffunction = lib.EnvFindDeffunction(self._env, name.encode()) if deffunction == ffi.NULL: raise LookupError("Function '%s' not found" % name) return Function(self._env, deffunction)
python
def find_function(self, name): """Find the Function by its name.""" deffunction = lib.EnvFindDeffunction(self._env, name.encode()) if deffunction == ffi.NULL: raise LookupError("Function '%s' not found" % name) return Function(self._env, deffunction)
[ "def", "find_function", "(", "self", ",", "name", ")", ":", "deffunction", "=", "lib", ".", "EnvFindDeffunction", "(", "self", ".", "_env", ",", "name", ".", "encode", "(", ")", ")", "if", "deffunction", "==", "ffi", ".", "NULL", ":", "raise", "LookupE...
Find the Function by its name.
[ "Find", "the", "Function", "by", "its", "name", "." ]
train
https://github.com/noxdafox/clipspy/blob/b22d71a6da821c1715d8fa00d7d75cabc09ed364/clips/functions.py#L70-L76
noxdafox/clipspy
clips/functions.py
Functions.generics
def generics(self): """Iterates over the defined Generics.""" defgeneric = lib.EnvGetNextDefgeneric(self._env, ffi.NULL) while defgeneric != ffi.NULL: yield Generic(self._env, defgeneric) defgeneric = lib.EnvGetNextDefgeneric(self._env, defgeneric)
python
def generics(self): """Iterates over the defined Generics.""" defgeneric = lib.EnvGetNextDefgeneric(self._env, ffi.NULL) while defgeneric != ffi.NULL: yield Generic(self._env, defgeneric) defgeneric = lib.EnvGetNextDefgeneric(self._env, defgeneric)
[ "def", "generics", "(", "self", ")", ":", "defgeneric", "=", "lib", ".", "EnvGetNextDefgeneric", "(", "self", ".", "_env", ",", "ffi", ".", "NULL", ")", "while", "defgeneric", "!=", "ffi", ".", "NULL", ":", "yield", "Generic", "(", "self", ".", "_env",...
Iterates over the defined Generics.
[ "Iterates", "over", "the", "defined", "Generics", "." ]
train
https://github.com/noxdafox/clipspy/blob/b22d71a6da821c1715d8fa00d7d75cabc09ed364/clips/functions.py#L78-L85
noxdafox/clipspy
clips/functions.py
Functions.find_generic
def find_generic(self, name): """Find the Generic by its name.""" defgeneric = lib.EnvFindDefgeneric(self._env, name.encode()) if defgeneric == ffi.NULL: raise LookupError("Generic '%s' not found" % name) return Generic(self._env, defgeneric)
python
def find_generic(self, name): """Find the Generic by its name.""" defgeneric = lib.EnvFindDefgeneric(self._env, name.encode()) if defgeneric == ffi.NULL: raise LookupError("Generic '%s' not found" % name) return Generic(self._env, defgeneric)
[ "def", "find_generic", "(", "self", ",", "name", ")", ":", "defgeneric", "=", "lib", ".", "EnvFindDefgeneric", "(", "self", ".", "_env", ",", "name", ".", "encode", "(", ")", ")", "if", "defgeneric", "==", "ffi", ".", "NULL", ":", "raise", "LookupError...
Find the Generic by its name.
[ "Find", "the", "Generic", "by", "its", "name", "." ]
train
https://github.com/noxdafox/clipspy/blob/b22d71a6da821c1715d8fa00d7d75cabc09ed364/clips/functions.py#L87-L93
noxdafox/clipspy
clips/functions.py
Function.name
def name(self): """Function name.""" return ffi.string( lib.EnvGetDeffunctionName(self._env, self._fnc)).decode()
python
def name(self): """Function name.""" return ffi.string( lib.EnvGetDeffunctionName(self._env, self._fnc)).decode()
[ "def", "name", "(", "self", ")", ":", "return", "ffi", ".", "string", "(", "lib", ".", "EnvGetDeffunctionName", "(", "self", ".", "_env", ",", "self", ".", "_fnc", ")", ")", ".", "decode", "(", ")" ]
Function name.
[ "Function", "name", "." ]
train
https://github.com/noxdafox/clipspy/blob/b22d71a6da821c1715d8fa00d7d75cabc09ed364/clips/functions.py#L142-L145
noxdafox/clipspy
clips/functions.py
Function.module
def module(self): """The module in which the Function is defined. Python equivalent of the CLIPS deffunction-module command. """ modname = ffi.string(lib.EnvDeffunctionModule(self._env, self._fnc)) defmodule = lib.EnvFindDefmodule(self._env, modname) return Module(self...
python
def module(self): """The module in which the Function is defined. Python equivalent of the CLIPS deffunction-module command. """ modname = ffi.string(lib.EnvDeffunctionModule(self._env, self._fnc)) defmodule = lib.EnvFindDefmodule(self._env, modname) return Module(self...
[ "def", "module", "(", "self", ")", ":", "modname", "=", "ffi", ".", "string", "(", "lib", ".", "EnvDeffunctionModule", "(", "self", ".", "_env", ",", "self", ".", "_fnc", ")", ")", "defmodule", "=", "lib", ".", "EnvFindDefmodule", "(", "self", ".", "...
The module in which the Function is defined. Python equivalent of the CLIPS deffunction-module command.
[ "The", "module", "in", "which", "the", "Function", "is", "defined", "." ]
train
https://github.com/noxdafox/clipspy/blob/b22d71a6da821c1715d8fa00d7d75cabc09ed364/clips/functions.py#L148-L157
noxdafox/clipspy
clips/functions.py
Function.watch
def watch(self, flag): """Whether or not the Function is being watched.""" lib.EnvSetDeffunctionWatch(self._env, int(flag), self._fnc)
python
def watch(self, flag): """Whether or not the Function is being watched.""" lib.EnvSetDeffunctionWatch(self._env, int(flag), self._fnc)
[ "def", "watch", "(", "self", ",", "flag", ")", ":", "lib", ".", "EnvSetDeffunctionWatch", "(", "self", ".", "_env", ",", "int", "(", "flag", ")", ",", "self", ".", "_fnc", ")" ]
Whether or not the Function is being watched.
[ "Whether", "or", "not", "the", "Function", "is", "being", "watched", "." ]
train
https://github.com/noxdafox/clipspy/blob/b22d71a6da821c1715d8fa00d7d75cabc09ed364/clips/functions.py#L170-L172
noxdafox/clipspy
clips/functions.py
Function.undefine
def undefine(self): """Undefine the Function. Python equivalent of the CLIPS undeffunction command. The object becomes unusable after this method has been called. """ if lib.EnvUndeffunction(self._env, self._fnc) != 1: raise CLIPSError(self._env) self._env...
python
def undefine(self): """Undefine the Function. Python equivalent of the CLIPS undeffunction command. The object becomes unusable after this method has been called. """ if lib.EnvUndeffunction(self._env, self._fnc) != 1: raise CLIPSError(self._env) self._env...
[ "def", "undefine", "(", "self", ")", ":", "if", "lib", ".", "EnvUndeffunction", "(", "self", ".", "_env", ",", "self", ".", "_fnc", ")", "!=", "1", ":", "raise", "CLIPSError", "(", "self", ".", "_env", ")", "self", ".", "_env", "=", "None" ]
Undefine the Function. Python equivalent of the CLIPS undeffunction command. The object becomes unusable after this method has been called.
[ "Undefine", "the", "Function", "." ]
train
https://github.com/noxdafox/clipspy/blob/b22d71a6da821c1715d8fa00d7d75cabc09ed364/clips/functions.py#L174-L185
noxdafox/clipspy
clips/functions.py
Generic.undefine
def undefine(self): """Undefine the Generic. Python equivalent of the CLIPS undefgeneric command. The object becomes unusable after this method has been called. """ if lib.EnvUndefgeneric(self._env, self._gnc) != 1: raise CLIPSError(self._env) self._env = ...
python
def undefine(self): """Undefine the Generic. Python equivalent of the CLIPS undefgeneric command. The object becomes unusable after this method has been called. """ if lib.EnvUndefgeneric(self._env, self._gnc) != 1: raise CLIPSError(self._env) self._env = ...
[ "def", "undefine", "(", "self", ")", ":", "if", "lib", ".", "EnvUndefgeneric", "(", "self", ".", "_env", ",", "self", ".", "_gnc", ")", "!=", "1", ":", "raise", "CLIPSError", "(", "self", ".", "_env", ")", "self", ".", "_env", "=", "None" ]
Undefine the Generic. Python equivalent of the CLIPS undefgeneric command. The object becomes unusable after this method has been called.
[ "Undefine", "the", "Generic", "." ]
train
https://github.com/noxdafox/clipspy/blob/b22d71a6da821c1715d8fa00d7d75cabc09ed364/clips/functions.py#L265-L276
noxdafox/clipspy
clips/functions.py
Method.undefine
def undefine(self): """Undefine the Method. Python equivalent of the CLIPS undefmethod command. The object becomes unusable after this method has been called. """ if lib.EnvUndefmethod(self._env, self._gnc, self._idx) != 1: raise CLIPSError(self._env) self...
python
def undefine(self): """Undefine the Method. Python equivalent of the CLIPS undefmethod command. The object becomes unusable after this method has been called. """ if lib.EnvUndefmethod(self._env, self._gnc, self._idx) != 1: raise CLIPSError(self._env) self...
[ "def", "undefine", "(", "self", ")", ":", "if", "lib", ".", "EnvUndefmethod", "(", "self", ".", "_env", ",", "self", ".", "_gnc", ",", "self", ".", "_idx", ")", "!=", "1", ":", "raise", "CLIPSError", "(", "self", ".", "_env", ")", "self", ".", "_...
Undefine the Method. Python equivalent of the CLIPS undefmethod command. The object becomes unusable after this method has been called.
[ "Undefine", "the", "Method", "." ]
train
https://github.com/noxdafox/clipspy/blob/b22d71a6da821c1715d8fa00d7d75cabc09ed364/clips/functions.py#L341-L352
mouradmourafiq/pandas-summary
pandas_summary/__init__.py
DataFrameSummary._get_deviation_of_mean
def _get_deviation_of_mean(self, series, multiplier=3): """ Returns count of values deviating of the mean, i.e. larger than `multiplier` * `std`. :type series: :param multiplier: :return: """ capped_series = np.minimum( series, series.mean() + multipli...
python
def _get_deviation_of_mean(self, series, multiplier=3): """ Returns count of values deviating of the mean, i.e. larger than `multiplier` * `std`. :type series: :param multiplier: :return: """ capped_series = np.minimum( series, series.mean() + multipli...
[ "def", "_get_deviation_of_mean", "(", "self", ",", "series", ",", "multiplier", "=", "3", ")", ":", "capped_series", "=", "np", ".", "minimum", "(", "series", ",", "series", ".", "mean", "(", ")", "+", "multiplier", "*", "series", ".", "std", "(", ")",...
Returns count of values deviating of the mean, i.e. larger than `multiplier` * `std`. :type series: :param multiplier: :return:
[ "Returns", "count", "of", "values", "deviating", "of", "the", "mean", "i", ".", "e", ".", "larger", "than", "multiplier", "*", "std", ".", ":", "type", "series", ":", ":", "param", "multiplier", ":", ":", "return", ":" ]
train
https://github.com/mouradmourafiq/pandas-summary/blob/554ae9ed94cb53d93f38b6aaab6f483b7b42609a/pandas_summary/__init__.py#L126-L138
mouradmourafiq/pandas-summary
pandas_summary/__init__.py
DataFrameSummary._get_median_absolute_deviation
def _get_median_absolute_deviation(self, series, multiplier=3): """ Returns count of values larger than `multiplier` * `mad` :type series: :param multiplier: :return (array): """ capped_series = np.minimum( series, series.median() + multiplier * series...
python
def _get_median_absolute_deviation(self, series, multiplier=3): """ Returns count of values larger than `multiplier` * `mad` :type series: :param multiplier: :return (array): """ capped_series = np.minimum( series, series.median() + multiplier * series...
[ "def", "_get_median_absolute_deviation", "(", "self", ",", "series", ",", "multiplier", "=", "3", ")", ":", "capped_series", "=", "np", ".", "minimum", "(", "series", ",", "series", ".", "median", "(", ")", "+", "multiplier", "*", "series", ".", "mad", "...
Returns count of values larger than `multiplier` * `mad` :type series: :param multiplier: :return (array):
[ "Returns", "count", "of", "values", "larger", "than", "multiplier", "*", "mad", ":", "type", "series", ":", ":", "param", "multiplier", ":", ":", "return", "(", "array", ")", ":" ]
train
https://github.com/mouradmourafiq/pandas-summary/blob/554ae9ed94cb53d93f38b6aaab6f483b7b42609a/pandas_summary/__init__.py#L140-L152
mouradmourafiq/pandas-summary
pandas_summary/__init__.py
DataFrameSummary.get_columns
def get_columns(self, df, usage, columns=None): """ Returns a `data_frame.columns`. :param df: dataframe to select columns from :param usage: should be a value from [ALL, INCLUDE, EXCLUDE]. this value only makes sense if attr `columns` is also set. ...
python
def get_columns(self, df, usage, columns=None): """ Returns a `data_frame.columns`. :param df: dataframe to select columns from :param usage: should be a value from [ALL, INCLUDE, EXCLUDE]. this value only makes sense if attr `columns` is also set. ...
[ "def", "get_columns", "(", "self", ",", "df", ",", "usage", ",", "columns", "=", "None", ")", ":", "columns_excluded", "=", "pd", ".", "Index", "(", "[", "]", ")", "columns_included", "=", "df", ".", "columns", "if", "usage", "==", "self", ".", "INCL...
Returns a `data_frame.columns`. :param df: dataframe to select columns from :param usage: should be a value from [ALL, INCLUDE, EXCLUDE]. this value only makes sense if attr `columns` is also set. otherwise, should be used with default value ALL. ...
[ "Returns", "a", "data_frame", ".", "columns", ".", ":", "param", "df", ":", "dataframe", "to", "select", "columns", "from", ":", "param", "usage", ":", "should", "be", "a", "value", "from", "[", "ALL", "INCLUDE", "EXCLUDE", "]", ".", "this", "value", "...
train
https://github.com/mouradmourafiq/pandas-summary/blob/554ae9ed94cb53d93f38b6aaab6f483b7b42609a/pandas_summary/__init__.py#L279-L308
taborlab/FlowCal
FlowCal/mef.py
clustering_gmm
def clustering_gmm(data, n_clusters, tol=1e-7, min_covar=None, scale='logicle'): """ Find clusters in an array using a Gaussian Mixture Model. Before clustering, `data` can be automatically rescaled as specified by the `scale` ...
python
def clustering_gmm(data, n_clusters, tol=1e-7, min_covar=None, scale='logicle'): """ Find clusters in an array using a Gaussian Mixture Model. Before clustering, `data` can be automatically rescaled as specified by the `scale` ...
[ "def", "clustering_gmm", "(", "data", ",", "n_clusters", ",", "tol", "=", "1e-7", ",", "min_covar", "=", "None", ",", "scale", "=", "'logicle'", ")", ":", "# Initialize min_covar parameter", "# Parameter is initialized differently depending on scikit's version", "if", "...
Find clusters in an array using a Gaussian Mixture Model. Before clustering, `data` can be automatically rescaled as specified by the `scale` argument. Parameters ---------- data : FCSData or array_like Data to cluster. n_clusters : int Number of clusters to find. tol : flo...
[ "Find", "clusters", "in", "an", "array", "using", "a", "Gaussian", "Mixture", "Model", "." ]
train
https://github.com/taborlab/FlowCal/blob/031a7af82acb1d46879a8e384a1a00f27f0bdc7a/FlowCal/mef.py#L36-L213
taborlab/FlowCal
FlowCal/mef.py
selection_std
def selection_std(populations, low=None, high=None, n_std_low=2.5, n_std_high=2.5, scale='logicle'): """ Select populations if most of their elements are between two values. This function selects populations from `pop...
python
def selection_std(populations, low=None, high=None, n_std_low=2.5, n_std_high=2.5, scale='logicle'): """ Select populations if most of their elements are between two values. This function selects populations from `pop...
[ "def", "selection_std", "(", "populations", ",", "low", "=", "None", ",", "high", "=", "None", ",", "n_std_low", "=", "2.5", ",", "n_std_high", "=", "2.5", ",", "scale", "=", "'logicle'", ")", ":", "# Generate scaling functions", "if", "scale", "==", "'lin...
Select populations if most of their elements are between two values. This function selects populations from `populations` if their means are more than `n_std_low` standard deviations greater than `low` and `n_std_high` standard deviations lower than `high`. Optionally, all elements in `populations` ca...
[ "Select", "populations", "if", "most", "of", "their", "elements", "are", "between", "two", "values", "." ]
train
https://github.com/taborlab/FlowCal/blob/031a7af82acb1d46879a8e384a1a00f27f0bdc7a/FlowCal/mef.py#L215-L337
taborlab/FlowCal
FlowCal/mef.py
fit_beads_autofluorescence
def fit_beads_autofluorescence(fl_rfi, fl_mef): """ Fit a standard curve using a beads model with autofluorescence. Parameters ---------- fl_rfi : array Fluorescence values of bead populations in units of Relative Fluorescence Intensity (RFI). fl_mef : array Fluorescence...
python
def fit_beads_autofluorescence(fl_rfi, fl_mef): """ Fit a standard curve using a beads model with autofluorescence. Parameters ---------- fl_rfi : array Fluorescence values of bead populations in units of Relative Fluorescence Intensity (RFI). fl_mef : array Fluorescence...
[ "def", "fit_beads_autofluorescence", "(", "fl_rfi", ",", "fl_mef", ")", ":", "# Check that the input data has consistent dimensions", "if", "len", "(", "fl_rfi", ")", "!=", "len", "(", "fl_mef", ")", ":", "raise", "ValueError", "(", "\"fl_rfi and fl_mef have different l...
Fit a standard curve using a beads model with autofluorescence. Parameters ---------- fl_rfi : array Fluorescence values of bead populations in units of Relative Fluorescence Intensity (RFI). fl_mef : array Fluorescence values of bead populations in MEF units. Returns -...
[ "Fit", "a", "standard", "curve", "using", "a", "beads", "model", "with", "autofluorescence", "." ]
train
https://github.com/taborlab/FlowCal/blob/031a7af82acb1d46879a8e384a1a00f27f0bdc7a/FlowCal/mef.py#L339-L485
taborlab/FlowCal
FlowCal/mef.py
plot_standard_curve
def plot_standard_curve(fl_rfi, fl_mef, beads_model, std_crv, xscale='linear', yscale='linear', xlim=None, ylim=(1.,1e8)): """ Plot a standard c...
python
def plot_standard_curve(fl_rfi, fl_mef, beads_model, std_crv, xscale='linear', yscale='linear', xlim=None, ylim=(1.,1e8)): """ Plot a standard c...
[ "def", "plot_standard_curve", "(", "fl_rfi", ",", "fl_mef", ",", "beads_model", ",", "std_crv", ",", "xscale", "=", "'linear'", ",", "yscale", "=", "'linear'", ",", "xlim", "=", "None", ",", "ylim", "=", "(", "1.", ",", "1e8", ")", ")", ":", "# Plot fl...
Plot a standard curve with fluorescence of calibration beads. Parameters ---------- fl_rfi : array_like Fluorescence of the calibration beads' subpopulations, in RFI units. fl_mef : array_like Fluorescence of the calibration beads' subpopulations, in MEF units. beads...
[ "Plot", "a", "standard", "curve", "with", "fluorescence", "of", "calibration", "beads", "." ]
train
https://github.com/taborlab/FlowCal/blob/031a7af82acb1d46879a8e384a1a00f27f0bdc7a/FlowCal/mef.py#L487-L554
taborlab/FlowCal
FlowCal/mef.py
get_transform_fxn
def get_transform_fxn(data_beads, mef_values, mef_channels, clustering_fxn=clustering_gmm, clustering_params={}, clustering_channels=None, statistic_fxn=FlowCal.stats.median, ...
python
def get_transform_fxn(data_beads, mef_values, mef_channels, clustering_fxn=clustering_gmm, clustering_params={}, clustering_channels=None, statistic_fxn=FlowCal.stats.median, ...
[ "def", "get_transform_fxn", "(", "data_beads", ",", "mef_values", ",", "mef_channels", ",", "clustering_fxn", "=", "clustering_gmm", ",", "clustering_params", "=", "{", "}", ",", "clustering_channels", "=", "None", ",", "statistic_fxn", "=", "FlowCal", ".", "stats...
Get a transformation function to convert flow cytometry data to MEF. Parameters ---------- data_beads : FCSData object Flow cytometry data describing calibration beads. mef_values : sequence of sequences Known MEF values for the calibration bead subpopulations, for each channel ...
[ "Get", "a", "transformation", "function", "to", "convert", "flow", "cytometry", "data", "to", "MEF", "." ]
train
https://github.com/taborlab/FlowCal/blob/031a7af82acb1d46879a8e384a1a00f27f0bdc7a/FlowCal/mef.py#L556-L1220
taborlab/FlowCal
FlowCal/excel_ui.py
read_table
def read_table(filename, sheetname, index_col=None): """ Return the contents of an Excel table as a pandas DataFrame. Parameters ---------- filename : str Name of the Excel file to read. sheetname : str or int Name or index of the sheet inside the Excel file to read. index_c...
python
def read_table(filename, sheetname, index_col=None): """ Return the contents of an Excel table as a pandas DataFrame. Parameters ---------- filename : str Name of the Excel file to read. sheetname : str or int Name or index of the sheet inside the Excel file to read. index_c...
[ "def", "read_table", "(", "filename", ",", "sheetname", ",", "index_col", "=", "None", ")", ":", "# Catch sheetname as list or None", "if", "sheetname", "is", "None", "or", "(", "hasattr", "(", "sheetname", ",", "'__iter__'", ")", "and", "not", "isinstance", "...
Return the contents of an Excel table as a pandas DataFrame. Parameters ---------- filename : str Name of the Excel file to read. sheetname : str or int Name or index of the sheet inside the Excel file to read. index_col : str, optional Column name or index to be used as row...
[ "Return", "the", "contents", "of", "an", "Excel", "table", "as", "a", "pandas", "DataFrame", "." ]
train
https://github.com/taborlab/FlowCal/blob/031a7af82acb1d46879a8e384a1a00f27f0bdc7a/FlowCal/excel_ui.py#L118-L172
taborlab/FlowCal
FlowCal/excel_ui.py
write_workbook
def write_workbook(filename, table_list, column_width=None): """ Write an Excel workbook from a list of tables. Parameters ---------- filename : str Name of the Excel file to write. table_list : list of ``(str, DataFrame)`` tuples Tables to be saved as individual sheets in the E...
python
def write_workbook(filename, table_list, column_width=None): """ Write an Excel workbook from a list of tables. Parameters ---------- filename : str Name of the Excel file to write. table_list : list of ``(str, DataFrame)`` tuples Tables to be saved as individual sheets in the E...
[ "def", "write_workbook", "(", "filename", ",", "table_list", ",", "column_width", "=", "None", ")", ":", "# Modify default header format", "# Pandas' default header format is bold text with thin borders. Here we", "# use bold text only, without borders.", "# The header style structure ...
Write an Excel workbook from a list of tables. Parameters ---------- filename : str Name of the Excel file to write. table_list : list of ``(str, DataFrame)`` tuples Tables to be saved as individual sheets in the Excel table. Each tuple contains two values: the name of the sheet...
[ "Write", "an", "Excel", "workbook", "from", "a", "list", "of", "tables", "." ]
train
https://github.com/taborlab/FlowCal/blob/031a7af82acb1d46879a8e384a1a00f27f0bdc7a/FlowCal/excel_ui.py#L174-L249
taborlab/FlowCal
FlowCal/excel_ui.py
process_beads_table
def process_beads_table(beads_table, instruments_table, base_dir=".", verbose=False, plot=False, plot_dir=None, full_output=False, get_transform_fxn_kwa...
python
def process_beads_table(beads_table, instruments_table, base_dir=".", verbose=False, plot=False, plot_dir=None, full_output=False, get_transform_fxn_kwa...
[ "def", "process_beads_table", "(", "beads_table", ",", "instruments_table", ",", "base_dir", "=", "\".\"", ",", "verbose", "=", "False", ",", "plot", "=", "False", ",", "plot_dir", "=", "None", ",", "full_output", "=", "False", ",", "get_transform_fxn_kwargs", ...
Process calibration bead samples, as specified by an input table. This function processes the entries in `beads_table`. For each row, the function does the following: - Load the FCS file specified in the field "File Path". - Transform the forward scatter/side scatter and fluorescence ...
[ "Process", "calibration", "bead", "samples", "as", "specified", "by", "an", "input", "table", "." ]
train
https://github.com/taborlab/FlowCal/blob/031a7af82acb1d46879a8e384a1a00f27f0bdc7a/FlowCal/excel_ui.py#L251-L584
taborlab/FlowCal
FlowCal/excel_ui.py
process_samples_table
def process_samples_table(samples_table, instruments_table, mef_transform_fxns=None, beads_table=None, base_dir=".", verbose=False, plot=False, ...
python
def process_samples_table(samples_table, instruments_table, mef_transform_fxns=None, beads_table=None, base_dir=".", verbose=False, plot=False, ...
[ "def", "process_samples_table", "(", "samples_table", ",", "instruments_table", ",", "mef_transform_fxns", "=", "None", ",", "beads_table", "=", "None", ",", "base_dir", "=", "\".\"", ",", "verbose", "=", "False", ",", "plot", "=", "False", ",", "plot_dir", "=...
Process flow cytometry samples, as specified by an input table. The function processes each entry in `samples_table`, and does the following: - Load the FCS file specified in the field "File Path". - Transform the forward scatter/side scatter to RFI. - Transform the fluorescence channel...
[ "Process", "flow", "cytometry", "samples", "as", "specified", "by", "an", "input", "table", "." ]
train
https://github.com/taborlab/FlowCal/blob/031a7af82acb1d46879a8e384a1a00f27f0bdc7a/FlowCal/excel_ui.py#L586-L907
taborlab/FlowCal
FlowCal/excel_ui.py
add_beads_stats
def add_beads_stats(beads_table, beads_samples, mef_outputs=None): """ Add stats fields to beads table. The following information is added to each row: - Notes (warnings, errors) resulting from the analysis - Number of Events - Acquisition Time (s) The following information is...
python
def add_beads_stats(beads_table, beads_samples, mef_outputs=None): """ Add stats fields to beads table. The following information is added to each row: - Notes (warnings, errors) resulting from the analysis - Number of Events - Acquisition Time (s) The following information is...
[ "def", "add_beads_stats", "(", "beads_table", ",", "beads_samples", ",", "mef_outputs", "=", "None", ")", ":", "# The index name is not preserved if beads_table is empty.", "# Save the index name for later", "beads_table_index_name", "=", "beads_table", ".", "index", ".", "na...
Add stats fields to beads table. The following information is added to each row: - Notes (warnings, errors) resulting from the analysis - Number of Events - Acquisition Time (s) The following information is added for each row, for each channel in which MEF values have been specifi...
[ "Add", "stats", "fields", "to", "beads", "table", "." ]
train
https://github.com/taborlab/FlowCal/blob/031a7af82acb1d46879a8e384a1a00f27f0bdc7a/FlowCal/excel_ui.py#L909-L1086
taborlab/FlowCal
FlowCal/excel_ui.py
add_samples_stats
def add_samples_stats(samples_table, samples): """ Add stats fields to samples table. The following information is added to each row: - Notes (warnings, errors) resulting from the analysis - Number of Events - Acquisition Time (s) The following information is added for each ro...
python
def add_samples_stats(samples_table, samples): """ Add stats fields to samples table. The following information is added to each row: - Notes (warnings, errors) resulting from the analysis - Number of Events - Acquisition Time (s) The following information is added for each ro...
[ "def", "add_samples_stats", "(", "samples_table", ",", "samples", ")", ":", "# The index name is not preserved if samples_table is empty.", "# Save the index name for later", "samples_table_index_name", "=", "samples_table", ".", "index", ".", "name", "# Add per-row info", "notes...
Add stats fields to samples table. The following information is added to each row: - Notes (warnings, errors) resulting from the analysis - Number of Events - Acquisition Time (s) The following information is added for each row, for each channel in which fluorescence units have be...
[ "Add", "stats", "fields", "to", "samples", "table", "." ]
train
https://github.com/taborlab/FlowCal/blob/031a7af82acb1d46879a8e384a1a00f27f0bdc7a/FlowCal/excel_ui.py#L1088-L1307
taborlab/FlowCal
FlowCal/excel_ui.py
generate_histograms_table
def generate_histograms_table(samples_table, samples, max_bins=1024): """ Generate a table of histograms as a DataFrame. Parameters ---------- samples_table : DataFrame Table specifying samples to analyze. For more information about the fields required in this table, please consult ...
python
def generate_histograms_table(samples_table, samples, max_bins=1024): """ Generate a table of histograms as a DataFrame. Parameters ---------- samples_table : DataFrame Table specifying samples to analyze. For more information about the fields required in this table, please consult ...
[ "def", "generate_histograms_table", "(", "samples_table", ",", "samples", ",", "max_bins", "=", "1024", ")", ":", "# Extract channels that require stats histograms", "headers", "=", "list", "(", "samples_table", ".", "columns", ")", "hist_headers", "=", "[", "h", "f...
Generate a table of histograms as a DataFrame. Parameters ---------- samples_table : DataFrame Table specifying samples to analyze. For more information about the fields required in this table, please consult the module's documentation. samples : list FCSData objects fro...
[ "Generate", "a", "table", "of", "histograms", "as", "a", "DataFrame", "." ]
train
https://github.com/taborlab/FlowCal/blob/031a7af82acb1d46879a8e384a1a00f27f0bdc7a/FlowCal/excel_ui.py#L1309-L1394
taborlab/FlowCal
FlowCal/excel_ui.py
generate_about_table
def generate_about_table(extra_info={}): """ Make a table with information about FlowCal and the current analysis. Parameters ---------- extra_info : dict, optional Additional keyword:value pairs to include in the table. Returns ------- about_table : DataFrame Table wit...
python
def generate_about_table(extra_info={}): """ Make a table with information about FlowCal and the current analysis. Parameters ---------- extra_info : dict, optional Additional keyword:value pairs to include in the table. Returns ------- about_table : DataFrame Table wit...
[ "def", "generate_about_table", "(", "extra_info", "=", "{", "}", ")", ":", "# Make keyword and value arrays", "keywords", "=", "[", "]", "values", "=", "[", "]", "# FlowCal version", "keywords", ".", "append", "(", "'FlowCal version'", ")", "values", ".", "appen...
Make a table with information about FlowCal and the current analysis. Parameters ---------- extra_info : dict, optional Additional keyword:value pairs to include in the table. Returns ------- about_table : DataFrame Table with information about FlowCal and the current analysis,...
[ "Make", "a", "table", "with", "information", "about", "FlowCal", "and", "the", "current", "analysis", "." ]
train
https://github.com/taborlab/FlowCal/blob/031a7af82acb1d46879a8e384a1a00f27f0bdc7a/FlowCal/excel_ui.py#L1396-L1437
taborlab/FlowCal
FlowCal/excel_ui.py
show_open_file_dialog
def show_open_file_dialog(filetypes): """ Show an open file dialog and return the path of the file selected. Parameters ---------- filetypes : list of tuples Types of file to show on the dialog. Each tuple on the list must have two elements associated with a filetype: the first elem...
python
def show_open_file_dialog(filetypes): """ Show an open file dialog and return the path of the file selected. Parameters ---------- filetypes : list of tuples Types of file to show on the dialog. Each tuple on the list must have two elements associated with a filetype: the first elem...
[ "def", "show_open_file_dialog", "(", "filetypes", ")", ":", "# The following line is used to Tk's main window is not shown", "Tk", "(", ")", ".", "withdraw", "(", ")", "# OSX ONLY: Call bash script to prevent file select window from sticking", "# after use.", "if", "platform", "....
Show an open file dialog and return the path of the file selected. Parameters ---------- filetypes : list of tuples Types of file to show on the dialog. Each tuple on the list must have two elements associated with a filetype: the first element is a description, and the second is th...
[ "Show", "an", "open", "file", "dialog", "and", "return", "the", "path", "of", "the", "file", "selected", "." ]
train
https://github.com/taborlab/FlowCal/blob/031a7af82acb1d46879a8e384a1a00f27f0bdc7a/FlowCal/excel_ui.py#L1439-L1471
taborlab/FlowCal
FlowCal/excel_ui.py
run
def run(input_path=None, output_path=None, verbose=True, plot=True, hist_sheet=False): """ Run the MS Excel User Interface. This function performs the following: 1. If `input_path` is not specified, show a dialog to choose an input Excel file. 2. Extract d...
python
def run(input_path=None, output_path=None, verbose=True, plot=True, hist_sheet=False): """ Run the MS Excel User Interface. This function performs the following: 1. If `input_path` is not specified, show a dialog to choose an input Excel file. 2. Extract d...
[ "def", "run", "(", "input_path", "=", "None", ",", "output_path", "=", "None", ",", "verbose", "=", "True", ",", "plot", "=", "True", ",", "hist_sheet", "=", "False", ")", ":", "# If input file has not been specified, show open file dialog", "if", "input_path", ...
Run the MS Excel User Interface. This function performs the following: 1. If `input_path` is not specified, show a dialog to choose an input Excel file. 2. Extract data from the Instruments, Beads, and Samples tables. 3. Process all the bead samples specified in the Beads table. 4. Gen...
[ "Run", "the", "MS", "Excel", "User", "Interface", "." ]
train
https://github.com/taborlab/FlowCal/blob/031a7af82acb1d46879a8e384a1a00f27f0bdc7a/FlowCal/excel_ui.py#L1473-L1602
taborlab/FlowCal
FlowCal/excel_ui.py
run_command_line
def run_command_line(args=None): """ Entry point for the FlowCal and flowcal console scripts. Parameters ---------- args: list of strings, optional Command line arguments. If None or not specified, get arguments from ``sys.argv``. See Also ---------- FlowCal.excel_ui.ru...
python
def run_command_line(args=None): """ Entry point for the FlowCal and flowcal console scripts. Parameters ---------- args: list of strings, optional Command line arguments. If None or not specified, get arguments from ``sys.argv``. See Also ---------- FlowCal.excel_ui.ru...
[ "def", "run_command_line", "(", "args", "=", "None", ")", ":", "# Get arguments from ``sys.argv`` if necessary.", "# ``sys.argv`` has the name of the script as its first element. We remove", "# this element because it will break ``parser.parse_args()`` later. In fact,", "# ``parser.parse_args(...
Entry point for the FlowCal and flowcal console scripts. Parameters ---------- args: list of strings, optional Command line arguments. If None or not specified, get arguments from ``sys.argv``. See Also ---------- FlowCal.excel_ui.run() http://amir.rachum.com/blog/2017/07/...
[ "Entry", "point", "for", "the", "FlowCal", "and", "flowcal", "console", "scripts", "." ]
train
https://github.com/taborlab/FlowCal/blob/031a7af82acb1d46879a8e384a1a00f27f0bdc7a/FlowCal/excel_ui.py#L1605-L1668
taborlab/FlowCal
FlowCal/io.py
read_fcs_header_segment
def read_fcs_header_segment(buf, begin=0): """ Read HEADER segment of FCS file. Parameters ---------- buf : file-like object Buffer containing data to interpret as HEADER segment. begin : int Offset (in bytes) to first byte of HEADER segment in `buf`. Returns ------- ...
python
def read_fcs_header_segment(buf, begin=0): """ Read HEADER segment of FCS file. Parameters ---------- buf : file-like object Buffer containing data to interpret as HEADER segment. begin : int Offset (in bytes) to first byte of HEADER segment in `buf`. Returns ------- ...
[ "def", "read_fcs_header_segment", "(", "buf", ",", "begin", "=", "0", ")", ":", "fields", "=", "[", "'version'", ",", "'text_begin'", ",", "'text_end'", ",", "'data_begin'", ",", "'data_end'", ",", "'analysis_begin'", ",", "'analysis_end'", "]", "FCSHeader", "...
Read HEADER segment of FCS file. Parameters ---------- buf : file-like object Buffer containing data to interpret as HEADER segment. begin : int Offset (in bytes) to first byte of HEADER segment in `buf`. Returns ------- header : namedtuple Version information and b...
[ "Read", "HEADER", "segment", "of", "FCS", "file", "." ]
train
https://github.com/taborlab/FlowCal/blob/031a7af82acb1d46879a8e384a1a00f27f0bdc7a/FlowCal/io.py#L23-L97
taborlab/FlowCal
FlowCal/io.py
read_fcs_text_segment
def read_fcs_text_segment(buf, begin, end, delim=None, supplemental=False): """ Read TEXT segment of FCS file. Parameters ---------- buf : file-like object Buffer containing data to interpret as TEXT segment. begin : int Offset (in bytes) to first byte of TEXT segment in `buf`. ...
python
def read_fcs_text_segment(buf, begin, end, delim=None, supplemental=False): """ Read TEXT segment of FCS file. Parameters ---------- buf : file-like object Buffer containing data to interpret as TEXT segment. begin : int Offset (in bytes) to first byte of TEXT segment in `buf`. ...
[ "def", "read_fcs_text_segment", "(", "buf", ",", "begin", ",", "end", ",", "delim", "=", "None", ",", "supplemental", "=", "False", ")", ":", "if", "delim", "is", "None", ":", "if", "supplemental", ":", "raise", "ValueError", "(", "\"must specify ``delim`` i...
Read TEXT segment of FCS file. Parameters ---------- buf : file-like object Buffer containing data to interpret as TEXT segment. begin : int Offset (in bytes) to first byte of TEXT segment in `buf`. end : int Offset (in bytes) to last byte of TEXT segment in `buf`. delim...
[ "Read", "TEXT", "segment", "of", "FCS", "file", "." ]
train
https://github.com/taborlab/FlowCal/blob/031a7af82acb1d46879a8e384a1a00f27f0bdc7a/FlowCal/io.py#L99-L352
taborlab/FlowCal
FlowCal/io.py
read_fcs_data_segment
def read_fcs_data_segment(buf, begin, end, datatype, num_events, param_bit_widths, big_endian, param_ranges=None): """ Read DATA s...
python
def read_fcs_data_segment(buf, begin, end, datatype, num_events, param_bit_widths, big_endian, param_ranges=None): """ Read DATA s...
[ "def", "read_fcs_data_segment", "(", "buf", ",", "begin", ",", "end", ",", "datatype", ",", "num_events", ",", "param_bit_widths", ",", "big_endian", ",", "param_ranges", "=", "None", ")", ":", "num_params", "=", "len", "(", "param_bit_widths", ")", "if", "(...
Read DATA segment of FCS file. Parameters ---------- buf : file-like object Buffer containing data to interpret as DATA segment. begin : int Offset (in bytes) to first byte of DATA segment in `buf`. end : int Offset (in bytes) to last byte of DATA segment in `buf`. datat...
[ "Read", "DATA", "segment", "of", "FCS", "file", "." ]
train
https://github.com/taborlab/FlowCal/blob/031a7af82acb1d46879a8e384a1a00f27f0bdc7a/FlowCal/io.py#L354-L616
taborlab/FlowCal
FlowCal/io.py
FCSData.acquisition_time
def acquisition_time(self): """ Acquisition time, in seconds. The acquisition time is calculated using the 'time' channel by default (channel name is case independent). If the 'time' channel is not available, the acquisition_start_time and acquisition_end_time, extracted...
python
def acquisition_time(self): """ Acquisition time, in seconds. The acquisition time is calculated using the 'time' channel by default (channel name is case independent). If the 'time' channel is not available, the acquisition_start_time and acquisition_end_time, extracted...
[ "def", "acquisition_time", "(", "self", ")", ":", "# Get time channels indices", "time_channel_idx", "=", "[", "idx", "for", "idx", ",", "channel", "in", "enumerate", "(", "self", ".", "channels", ")", "if", "channel", ".", "lower", "(", ")", "==", "'time'",...
Acquisition time, in seconds. The acquisition time is calculated using the 'time' channel by default (channel name is case independent). If the 'time' channel is not available, the acquisition_start_time and acquisition_end_time, extracted from the $BTIM and $ETIM keyword parame...
[ "Acquisition", "time", "in", "seconds", "." ]
train
https://github.com/taborlab/FlowCal/blob/031a7af82acb1d46879a8e384a1a00f27f0bdc7a/FlowCal/io.py#L1160-L1190
taborlab/FlowCal
FlowCal/io.py
FCSData.amplification_type
def amplification_type(self, channels=None): """ Get the amplification type used for the specified channel(s). Each channel uses one of two amplification types: linear or logarithmic. This function returns, for each channel, a tuple of two numbers, in which the first number indi...
python
def amplification_type(self, channels=None): """ Get the amplification type used for the specified channel(s). Each channel uses one of two amplification types: linear or logarithmic. This function returns, for each channel, a tuple of two numbers, in which the first number indi...
[ "def", "amplification_type", "(", "self", ",", "channels", "=", "None", ")", ":", "# Check default", "if", "channels", "is", "None", ":", "channels", "=", "self", ".", "_channels", "# Get numerical indices of channels", "channels", "=", "self", ".", "_name_to_inde...
Get the amplification type used for the specified channel(s). Each channel uses one of two amplification types: linear or logarithmic. This function returns, for each channel, a tuple of two numbers, in which the first number indicates the number of decades covered by the logarithmic am...
[ "Get", "the", "amplification", "type", "used", "for", "the", "specified", "channel", "(", "s", ")", "." ]
train
https://github.com/taborlab/FlowCal/blob/031a7af82acb1d46879a8e384a1a00f27f0bdc7a/FlowCal/io.py#L1200-L1244
taborlab/FlowCal
FlowCal/io.py
FCSData.detector_voltage
def detector_voltage(self, channels=None): """ Get the detector voltage used for the specified channel(s). The detector voltage for channel "n" is extracted from the $PnV parameter, if available. Parameters ---------- channels : int, str, list of int, list of st...
python
def detector_voltage(self, channels=None): """ Get the detector voltage used for the specified channel(s). The detector voltage for channel "n" is extracted from the $PnV parameter, if available. Parameters ---------- channels : int, str, list of int, list of st...
[ "def", "detector_voltage", "(", "self", ",", "channels", "=", "None", ")", ":", "# Check default", "if", "channels", "is", "None", ":", "channels", "=", "self", ".", "_channels", "# Get numerical indices of channels", "channels", "=", "self", ".", "_name_to_index"...
Get the detector voltage used for the specified channel(s). The detector voltage for channel "n" is extracted from the $PnV parameter, if available. Parameters ---------- channels : int, str, list of int, list of str Channel(s) for which to get the detector voltage....
[ "Get", "the", "detector", "voltage", "used", "for", "the", "specified", "channel", "(", "s", ")", "." ]
train
https://github.com/taborlab/FlowCal/blob/031a7af82acb1d46879a8e384a1a00f27f0bdc7a/FlowCal/io.py#L1246-L1280
taborlab/FlowCal
FlowCal/io.py
FCSData.amplifier_gain
def amplifier_gain(self, channels=None): """ Get the amplifier gain used for the specified channel(s). The amplifier gain for channel "n" is extracted from the $PnG parameter, if available. Parameters ---------- channels : int, str, list of int, list of str ...
python
def amplifier_gain(self, channels=None): """ Get the amplifier gain used for the specified channel(s). The amplifier gain for channel "n" is extracted from the $PnG parameter, if available. Parameters ---------- channels : int, str, list of int, list of str ...
[ "def", "amplifier_gain", "(", "self", ",", "channels", "=", "None", ")", ":", "# Check default", "if", "channels", "is", "None", ":", "channels", "=", "self", ".", "_channels", "# Get numerical indices of channels", "channels", "=", "self", ".", "_name_to_index", ...
Get the amplifier gain used for the specified channel(s). The amplifier gain for channel "n" is extracted from the $PnG parameter, if available. Parameters ---------- channels : int, str, list of int, list of str Channel(s) for which to get the amplifier gain. If No...
[ "Get", "the", "amplifier", "gain", "used", "for", "the", "specified", "channel", "(", "s", ")", "." ]
train
https://github.com/taborlab/FlowCal/blob/031a7af82acb1d46879a8e384a1a00f27f0bdc7a/FlowCal/io.py#L1282-L1316
taborlab/FlowCal
FlowCal/io.py
FCSData.range
def range(self, channels=None): """ Get the range of the specified channel(s). The range is a two-element list specifying the smallest and largest values that an event in a channel should have. Note that with floating point data, some events could have values outside the ...
python
def range(self, channels=None): """ Get the range of the specified channel(s). The range is a two-element list specifying the smallest and largest values that an event in a channel should have. Note that with floating point data, some events could have values outside the ...
[ "def", "range", "(", "self", ",", "channels", "=", "None", ")", ":", "# Check default", "if", "channels", "is", "None", ":", "channels", "=", "self", ".", "_channels", "# Get numerical indices of channels", "channels", "=", "self", ".", "_name_to_index", "(", ...
Get the range of the specified channel(s). The range is a two-element list specifying the smallest and largest values that an event in a channel should have. Note that with floating point data, some events could have values outside the range in either direction due to instrument compens...
[ "Get", "the", "range", "of", "the", "specified", "channel", "(", "s", ")", "." ]
train
https://github.com/taborlab/FlowCal/blob/031a7af82acb1d46879a8e384a1a00f27f0bdc7a/FlowCal/io.py#L1318-L1358
taborlab/FlowCal
FlowCal/io.py
FCSData.resolution
def resolution(self, channels=None): """ Get the resolution of the specified channel(s). The resolution specifies the number of different values that the events can take. The resolution is directly obtained from the $PnR parameter. Parameters ---------- ...
python
def resolution(self, channels=None): """ Get the resolution of the specified channel(s). The resolution specifies the number of different values that the events can take. The resolution is directly obtained from the $PnR parameter. Parameters ---------- ...
[ "def", "resolution", "(", "self", ",", "channels", "=", "None", ")", ":", "# Check default", "if", "channels", "is", "None", ":", "channels", "=", "self", ".", "_channels", "# Get numerical indices of channels", "channels", "=", "self", ".", "_name_to_index", "(...
Get the resolution of the specified channel(s). The resolution specifies the number of different values that the events can take. The resolution is directly obtained from the $PnR parameter. Parameters ---------- channels : int, str, list of int, list of str ...
[ "Get", "the", "resolution", "of", "the", "specified", "channel", "(", "s", ")", "." ]
train
https://github.com/taborlab/FlowCal/blob/031a7af82acb1d46879a8e384a1a00f27f0bdc7a/FlowCal/io.py#L1360-L1393
taborlab/FlowCal
FlowCal/io.py
FCSData.hist_bins
def hist_bins(self, channels=None, nbins=None, scale='logicle', **kwargs): """ Get histogram bin edges for the specified channel(s). These cover the range specified in ``FCSData.range(channels)`` with a number of bins `nbins`, with linear, logarithmic, or logicle spacing. ...
python
def hist_bins(self, channels=None, nbins=None, scale='logicle', **kwargs): """ Get histogram bin edges for the specified channel(s). These cover the range specified in ``FCSData.range(channels)`` with a number of bins `nbins`, with linear, logarithmic, or logicle spacing. ...
[ "def", "hist_bins", "(", "self", ",", "channels", "=", "None", ",", "nbins", "=", "None", ",", "scale", "=", "'logicle'", ",", "*", "*", "kwargs", ")", ":", "# Default: all channels", "if", "channels", "is", "None", ":", "channels", "=", "list", "(", "...
Get histogram bin edges for the specified channel(s). These cover the range specified in ``FCSData.range(channels)`` with a number of bins `nbins`, with linear, logarithmic, or logicle spacing. Parameters ---------- channels : int, str, list of int, list of str ...
[ "Get", "histogram", "bin", "edges", "for", "the", "specified", "channel", "(", "s", ")", "." ]
train
https://github.com/taborlab/FlowCal/blob/031a7af82acb1d46879a8e384a1a00f27f0bdc7a/FlowCal/io.py#L1395-L1545
taborlab/FlowCal
FlowCal/io.py
FCSData._parse_time_string
def _parse_time_string(time_str): """ Get a datetime.time object from a string time representation. The start and end of acquisition are stored in the optional keyword parameters $BTIM and $ETIM. The following formats are used according to the FCS standard: - FCS 2.0...
python
def _parse_time_string(time_str): """ Get a datetime.time object from a string time representation. The start and end of acquisition are stored in the optional keyword parameters $BTIM and $ETIM. The following formats are used according to the FCS standard: - FCS 2.0...
[ "def", "_parse_time_string", "(", "time_str", ")", ":", "# If input is None, return None", "if", "time_str", "is", "None", ":", "return", "None", "time_l", "=", "time_str", ".", "split", "(", "':'", ")", "if", "len", "(", "time_l", ")", "==", "3", ":", "# ...
Get a datetime.time object from a string time representation. The start and end of acquisition are stored in the optional keyword parameters $BTIM and $ETIM. The following formats are used according to the FCS standard: - FCS 2.0: 'hh:mm:ss' - FCS 3.0: 'hh:mm:ss[:tt]', w...
[ "Get", "a", "datetime", ".", "time", "object", "from", "a", "string", "time", "representation", "." ]
train
https://github.com/taborlab/FlowCal/blob/031a7af82acb1d46879a8e384a1a00f27f0bdc7a/FlowCal/io.py#L1765-L1824
taborlab/FlowCal
FlowCal/io.py
FCSData._parse_date_string
def _parse_date_string(date_str): """ Get a datetime.date object from a string date representation. The FCS standard includes an optional keyword parameter $DATE in which the acquistion date is stored. In FCS 2.0, the date is saved as 'dd-mmm-yy', whereas in FCS 3.0 and 3.1 the ...
python
def _parse_date_string(date_str): """ Get a datetime.date object from a string date representation. The FCS standard includes an optional keyword parameter $DATE in which the acquistion date is stored. In FCS 2.0, the date is saved as 'dd-mmm-yy', whereas in FCS 3.0 and 3.1 the ...
[ "def", "_parse_date_string", "(", "date_str", ")", ":", "# If input is None, return None", "if", "date_str", "is", "None", ":", "return", "None", "# Standard format for FCS2.0", "try", ":", "return", "datetime", ".", "datetime", ".", "strptime", "(", "date_str", ","...
Get a datetime.date object from a string date representation. The FCS standard includes an optional keyword parameter $DATE in which the acquistion date is stored. In FCS 2.0, the date is saved as 'dd-mmm-yy', whereas in FCS 3.0 and 3.1 the date is saved as 'dd-mmm-yyyy'. This ...
[ "Get", "a", "datetime", ".", "date", "object", "from", "a", "string", "date", "representation", "." ]
train
https://github.com/taborlab/FlowCal/blob/031a7af82acb1d46879a8e384a1a00f27f0bdc7a/FlowCal/io.py#L1827-L1877
taborlab/FlowCal
FlowCal/io.py
FCSData._name_to_index
def _name_to_index(self, channels): """ Return the channel indices for the specified channel names. Integers contained in `channel` are returned unmodified, if they are within the range of ``self.channels``. Parameters ---------- channels : int or str or list of...
python
def _name_to_index(self, channels): """ Return the channel indices for the specified channel names. Integers contained in `channel` are returned unmodified, if they are within the range of ``self.channels``. Parameters ---------- channels : int or str or list of...
[ "def", "_name_to_index", "(", "self", ",", "channels", ")", ":", "# Check if list, then run recursively", "if", "hasattr", "(", "channels", ",", "'__iter__'", ")", "and", "not", "isinstance", "(", "channels", ",", "six", ".", "string_types", ")", ":", "return", ...
Return the channel indices for the specified channel names. Integers contained in `channel` are returned unmodified, if they are within the range of ``self.channels``. Parameters ---------- channels : int or str or list of int or list of str Name(s) of the channel(s...
[ "Return", "the", "channel", "indices", "for", "the", "specified", "channel", "names", "." ]
train
https://github.com/taborlab/FlowCal/blob/031a7af82acb1d46879a8e384a1a00f27f0bdc7a/FlowCal/io.py#L1880-L1920
taborlab/FlowCal
setup.py
find_version
def find_version(file_path): """ Scrape version information from specified file path. """ with open(file_path, 'r') as f: file_contents = f.read() version_match = re.search(r"^__version__\s*=\s*['\"]([^'\"]*)['\"]", file_contents, re.M) if version_match: ...
python
def find_version(file_path): """ Scrape version information from specified file path. """ with open(file_path, 'r') as f: file_contents = f.read() version_match = re.search(r"^__version__\s*=\s*['\"]([^'\"]*)['\"]", file_contents, re.M) if version_match: ...
[ "def", "find_version", "(", "file_path", ")", ":", "with", "open", "(", "file_path", ",", "'r'", ")", "as", "f", ":", "file_contents", "=", "f", ".", "read", "(", ")", "version_match", "=", "re", ".", "search", "(", "r\"^__version__\\s*=\\s*['\\\"]([^'\\\"]*...
Scrape version information from specified file path.
[ "Scrape", "version", "information", "from", "specified", "file", "path", "." ]
train
https://github.com/taborlab/FlowCal/blob/031a7af82acb1d46879a8e384a1a00f27f0bdc7a/setup.py#L14-L26
taborlab/FlowCal
FlowCal/gate.py
start_end
def start_end(data, num_start=250, num_end=100, full_output=False): """ Gate out first and last events. Parameters ---------- data : FCSData or numpy array NxD flow cytometry data where N is the number of events and D is the number of parameters (aka channels). num_start, num_en...
python
def start_end(data, num_start=250, num_end=100, full_output=False): """ Gate out first and last events. Parameters ---------- data : FCSData or numpy array NxD flow cytometry data where N is the number of events and D is the number of parameters (aka channels). num_start, num_en...
[ "def", "start_end", "(", "data", ",", "num_start", "=", "250", ",", "num_end", "=", "100", ",", "full_output", "=", "False", ")", ":", "if", "num_start", "<", "0", ":", "num_start", "=", "0", "if", "num_end", "<", "0", ":", "num_end", "=", "0", "if...
Gate out first and last events. Parameters ---------- data : FCSData or numpy array NxD flow cytometry data where N is the number of events and D is the number of parameters (aka channels). num_start, num_end : int, optional Number of events to gate out from beginning and end of...
[ "Gate", "out", "first", "and", "last", "events", "." ]
train
https://github.com/taborlab/FlowCal/blob/031a7af82acb1d46879a8e384a1a00f27f0bdc7a/FlowCal/gate.py#L31-L86
taborlab/FlowCal
FlowCal/gate.py
high_low
def high_low(data, channels=None, high=None, low=None, full_output=False): """ Gate out high and low values across all specified channels. Gate out events in `data` with values in the specified channels which are larger than or equal to `high` or less than or equal to `low`. Parameters -------...
python
def high_low(data, channels=None, high=None, low=None, full_output=False): """ Gate out high and low values across all specified channels. Gate out events in `data` with values in the specified channels which are larger than or equal to `high` or less than or equal to `low`. Parameters -------...
[ "def", "high_low", "(", "data", ",", "channels", "=", "None", ",", "high", "=", "None", ",", "low", "=", "None", ",", "full_output", "=", "False", ")", ":", "# Extract channels in which to gate", "if", "channels", "is", "None", ":", "data_ch", "=", "data",...
Gate out high and low values across all specified channels. Gate out events in `data` with values in the specified channels which are larger than or equal to `high` or less than or equal to `low`. Parameters ---------- data : FCSData or numpy array NxD flow cytometry data where N is the nu...
[ "Gate", "out", "high", "and", "low", "values", "across", "all", "specified", "channels", "." ]
train
https://github.com/taborlab/FlowCal/blob/031a7af82acb1d46879a8e384a1a00f27f0bdc7a/FlowCal/gate.py#L88-L151
taborlab/FlowCal
FlowCal/gate.py
ellipse
def ellipse(data, channels, center, a, b, theta=0, log=False, full_output=False): """ Gate that preserves events inside an ellipse-shaped region. Events are kept if they satisfy the following relationship:: (x/a)**2 + (y/b)**2 <= 1 where `x` and `y` are the coordinates...
python
def ellipse(data, channels, center, a, b, theta=0, log=False, full_output=False): """ Gate that preserves events inside an ellipse-shaped region. Events are kept if they satisfy the following relationship:: (x/a)**2 + (y/b)**2 <= 1 where `x` and `y` are the coordinates...
[ "def", "ellipse", "(", "data", ",", "channels", ",", "center", ",", "a", ",", "b", ",", "theta", "=", "0", ",", "log", "=", "False", ",", "full_output", "=", "False", ")", ":", "# Extract channels in which to gate", "if", "len", "(", "channels", ")", "...
Gate that preserves events inside an ellipse-shaped region. Events are kept if they satisfy the following relationship:: (x/a)**2 + (y/b)**2 <= 1 where `x` and `y` are the coordinates of the event list, after substracting `center` and rotating by -`theta`. This is mathematically equivalent to...
[ "Gate", "that", "preserves", "events", "inside", "an", "ellipse", "-", "shaped", "region", "." ]
train
https://github.com/taborlab/FlowCal/blob/031a7af82acb1d46879a8e384a1a00f27f0bdc7a/FlowCal/gate.py#L153-L241
taborlab/FlowCal
FlowCal/gate.py
density2d
def density2d(data, channels=[0,1], bins=1024, gate_fraction=0.65, xscale='logicle', yscale='logicle', sigma=10.0, full_output=False): """ Gate that preserves events in the region with highest density. Gate ou...
python
def density2d(data, channels=[0,1], bins=1024, gate_fraction=0.65, xscale='logicle', yscale='logicle', sigma=10.0, full_output=False): """ Gate that preserves events in the region with highest density. Gate ou...
[ "def", "density2d", "(", "data", ",", "channels", "=", "[", "0", ",", "1", "]", ",", "bins", "=", "1024", ",", "gate_fraction", "=", "0.65", ",", "xscale", "=", "'logicle'", ",", "yscale", "=", "'logicle'", ",", "sigma", "=", "10.0", ",", "full_outpu...
Gate that preserves events in the region with highest density. Gate out all events in `data` but those near regions of highest density for the two specified channels. Parameters ---------- data : FCSData or numpy array NxD flow cytometry data where N is the number of events and D is ...
[ "Gate", "that", "preserves", "events", "in", "the", "region", "with", "highest", "density", "." ]
train
https://github.com/taborlab/FlowCal/blob/031a7af82acb1d46879a8e384a1a00f27f0bdc7a/FlowCal/gate.py#L243-L537
taborlab/FlowCal
FlowCal/transform.py
transform
def transform(data, channels, transform_fxn, def_channels = None): """ Apply some transformation function to flow cytometry data. This function is a template transformation function, intended to be used by other specific transformation functions. It performs basic checks on `channels` and `data`. I...
python
def transform(data, channels, transform_fxn, def_channels = None): """ Apply some transformation function to flow cytometry data. This function is a template transformation function, intended to be used by other specific transformation functions. It performs basic checks on `channels` and `data`. I...
[ "def", "transform", "(", "data", ",", "channels", ",", "transform_fxn", ",", "def_channels", "=", "None", ")", ":", "# Copy data array", "data_t", "=", "data", ".", "copy", "(", ")", ".", "astype", "(", "np", ".", "float64", ")", "# Default", "if", "chan...
Apply some transformation function to flow cytometry data. This function is a template transformation function, intended to be used by other specific transformation functions. It performs basic checks on `channels` and `data`. It then applies `transform_fxn` to the specified channels. Finally, it resca...
[ "Apply", "some", "transformation", "function", "to", "flow", "cytometry", "data", "." ]
train
https://github.com/taborlab/FlowCal/blob/031a7af82acb1d46879a8e384a1a00f27f0bdc7a/FlowCal/transform.py#L22-L79
taborlab/FlowCal
FlowCal/transform.py
to_rfi
def to_rfi(data, channels=None, amplification_type=None, amplifier_gain=None, resolution=None): """ Transform flow cytometry data to Relative Fluorescence Units (RFI). If ``amplification_type[0]`` is different from zero, data has been taken using a log amplif...
python
def to_rfi(data, channels=None, amplification_type=None, amplifier_gain=None, resolution=None): """ Transform flow cytometry data to Relative Fluorescence Units (RFI). If ``amplification_type[0]`` is different from zero, data has been taken using a log amplif...
[ "def", "to_rfi", "(", "data", ",", "channels", "=", "None", ",", "amplification_type", "=", "None", ",", "amplifier_gain", "=", "None", ",", "resolution", "=", "None", ")", ":", "# Default: all channels", "if", "channels", "is", "None", ":", "channels", "=",...
Transform flow cytometry data to Relative Fluorescence Units (RFI). If ``amplification_type[0]`` is different from zero, data has been taken using a log amplifier. Therefore, to transform to RFI, the following operation is applied:: y = a[1]*10^(a[0] * (x/r)) Where ``x`` and ``y`` are the ori...
[ "Transform", "flow", "cytometry", "data", "to", "Relative", "Fluorescence", "Units", "(", "RFI", ")", "." ]
train
https://github.com/taborlab/FlowCal/blob/031a7af82acb1d46879a8e384a1a00f27f0bdc7a/FlowCal/transform.py#L81-L247
taborlab/FlowCal
FlowCal/transform.py
to_mef
def to_mef(data, channels, sc_list, sc_channels = None): """ Transform flow cytometry data using a standard curve function. This function accepts a list of standard curves (`sc_list`) and a list of channels to which those standard curves should be applied (`sc_channels`). `to_mef` automatically che...
python
def to_mef(data, channels, sc_list, sc_channels = None): """ Transform flow cytometry data using a standard curve function. This function accepts a list of standard curves (`sc_list`) and a list of channels to which those standard curves should be applied (`sc_channels`). `to_mef` automatically che...
[ "def", "to_mef", "(", "data", ",", "channels", ",", "sc_list", ",", "sc_channels", "=", "None", ")", ":", "# Default sc_channels", "if", "sc_channels", "is", "None", ":", "if", "data", ".", "ndim", "==", "1", ":", "sc_channels", "=", "range", "(", "data"...
Transform flow cytometry data using a standard curve function. This function accepts a list of standard curves (`sc_list`) and a list of channels to which those standard curves should be applied (`sc_channels`). `to_mef` automatically checks whether a standard curve is available for each channel specif...
[ "Transform", "flow", "cytometry", "data", "using", "a", "standard", "curve", "function", "." ]
train
https://github.com/taborlab/FlowCal/blob/031a7af82acb1d46879a8e384a1a00f27f0bdc7a/FlowCal/transform.py#L250-L338
taborlab/FlowCal
FlowCal/plot.py
hist1d
def hist1d(data_list, channel=0, xscale='logicle', bins=256, histtype='stepfilled', normed_area=False, normed_height=False, xlabel=None, ylabel=None, xlim=None, ylim=None, title=None, lege...
python
def hist1d(data_list, channel=0, xscale='logicle', bins=256, histtype='stepfilled', normed_area=False, normed_height=False, xlabel=None, ylabel=None, xlim=None, ylim=None, title=None, lege...
[ "def", "hist1d", "(", "data_list", ",", "channel", "=", "0", ",", "xscale", "=", "'logicle'", ",", "bins", "=", "256", ",", "histtype", "=", "'stepfilled'", ",", "normed_area", "=", "False", ",", "normed_height", "=", "False", ",", "xlabel", "=", "None",...
Plot one 1D histogram from one or more flow cytometry data sets. Parameters ---------- data_list : FCSData or numpy array or list of FCSData or numpy array Flow cytometry data to plot. channel : int or str, optional Channel from where to take the events to plot. If ndim == 1, ch...
[ "Plot", "one", "1D", "histogram", "from", "one", "or", "more", "flow", "cytometry", "data", "sets", "." ]
train
https://github.com/taborlab/FlowCal/blob/031a7af82acb1d46879a8e384a1a00f27f0bdc7a/FlowCal/plot.py#L741-L1005
taborlab/FlowCal
FlowCal/plot.py
density2d
def density2d(data, channels=[0,1], bins=1024, mode='mesh', normed=False, smooth=True, sigma=10.0, colorbar=False, xscale='logicle', yscale='logicle', xlabel=None, y...
python
def density2d(data, channels=[0,1], bins=1024, mode='mesh', normed=False, smooth=True, sigma=10.0, colorbar=False, xscale='logicle', yscale='logicle', xlabel=None, y...
[ "def", "density2d", "(", "data", ",", "channels", "=", "[", "0", ",", "1", "]", ",", "bins", "=", "1024", ",", "mode", "=", "'mesh'", ",", "normed", "=", "False", ",", "smooth", "=", "True", ",", "sigma", "=", "10.0", ",", "colorbar", "=", "False...
Plot a 2D density plot from two channels of a flow cytometry data set. `density2d` has two plotting modes which are selected using the `mode` argument. With ``mode=='mesh'``, this function plots the data as a true 2D histogram, in which a plane is divided into bins and the color of each bin is directly...
[ "Plot", "a", "2D", "density", "plot", "from", "two", "channels", "of", "a", "flow", "cytometry", "data", "set", "." ]
train
https://github.com/taborlab/FlowCal/blob/031a7af82acb1d46879a8e384a1a00f27f0bdc7a/FlowCal/plot.py#L1007-L1257
taborlab/FlowCal
FlowCal/plot.py
scatter2d
def scatter2d(data_list, channels=[0,1], xscale='logicle', yscale='logicle', xlabel=None, ylabel=None, xlim=None, ylim=None, title=None, color=None, savefig=None, **...
python
def scatter2d(data_list, channels=[0,1], xscale='logicle', yscale='logicle', xlabel=None, ylabel=None, xlim=None, ylim=None, title=None, color=None, savefig=None, **...
[ "def", "scatter2d", "(", "data_list", ",", "channels", "=", "[", "0", ",", "1", "]", ",", "xscale", "=", "'logicle'", ",", "yscale", "=", "'logicle'", ",", "xlabel", "=", "None", ",", "ylabel", "=", "None", ",", "xlim", "=", "None", ",", "ylim", "=...
Plot 2D scatter plot from one or more FCSData objects or numpy arrays. Parameters ---------- data_list : array or FCSData or list of array or list of FCSData Flow cytometry data to plot. channels : list of int, list of str Two channels to use for the plot. savefig : str, optional ...
[ "Plot", "2D", "scatter", "plot", "from", "one", "or", "more", "FCSData", "objects", "or", "numpy", "arrays", "." ]
train
https://github.com/taborlab/FlowCal/blob/031a7af82acb1d46879a8e384a1a00f27f0bdc7a/FlowCal/plot.py#L1259-L1405
taborlab/FlowCal
FlowCal/plot.py
scatter3d
def scatter3d(data_list, channels=[0,1,2], xscale='logicle', yscale='logicle', zscale='logicle', xlabel=None, ylabel=None, zlabel=None, xlim=None, ylim=None, zlim=None, ...
python
def scatter3d(data_list, channels=[0,1,2], xscale='logicle', yscale='logicle', zscale='logicle', xlabel=None, ylabel=None, zlabel=None, xlim=None, ylim=None, zlim=None, ...
[ "def", "scatter3d", "(", "data_list", ",", "channels", "=", "[", "0", ",", "1", ",", "2", "]", ",", "xscale", "=", "'logicle'", ",", "yscale", "=", "'logicle'", ",", "zscale", "=", "'logicle'", ",", "xlabel", "=", "None", ",", "ylabel", "=", "None", ...
Plot 3D scatter plot from one or more FCSData objects or numpy arrays. Parameters ---------- data_list : array or FCSData or list of array or list of FCSData Flow cytometry data to plot. channels : list of int, list of str Three channels to use for the plot. savefig : str, optional ...
[ "Plot", "3D", "scatter", "plot", "from", "one", "or", "more", "FCSData", "objects", "or", "numpy", "arrays", "." ]
train
https://github.com/taborlab/FlowCal/blob/031a7af82acb1d46879a8e384a1a00f27f0bdc7a/FlowCal/plot.py#L1407-L1619
taborlab/FlowCal
FlowCal/plot.py
density_and_hist
def density_and_hist(data, gated_data=None, gate_contour=None, density_channels=None, density_params={}, hist_channels=None, hist_params={}, figsize=None, ...
python
def density_and_hist(data, gated_data=None, gate_contour=None, density_channels=None, density_params={}, hist_channels=None, hist_params={}, figsize=None, ...
[ "def", "density_and_hist", "(", "data", ",", "gated_data", "=", "None", ",", "gate_contour", "=", "None", ",", "density_channels", "=", "None", ",", "density_params", "=", "{", "}", ",", "hist_channels", "=", "None", ",", "hist_params", "=", "{", "}", ",",...
Make a combined density/histogram plot of a FCSData object. This function calls `hist1d` and `density2d` to plot a density diagram and a number of histograms in different subplots of the same plot using one single function call. Setting `density_channels` to None will not produce a density diagram, and...
[ "Make", "a", "combined", "density", "/", "histogram", "plot", "of", "a", "FCSData", "object", "." ]
train
https://github.com/taborlab/FlowCal/blob/031a7af82acb1d46879a8e384a1a00f27f0bdc7a/FlowCal/plot.py#L1625-L1759
taborlab/FlowCal
FlowCal/plot.py
scatter3d_and_projections
def scatter3d_and_projections(data_list, channels=[0,1,2], xscale='logicle', yscale='logicle', zscale='logicle', xlabel=None, ylabel=None, ...
python
def scatter3d_and_projections(data_list, channels=[0,1,2], xscale='logicle', yscale='logicle', zscale='logicle', xlabel=None, ylabel=None, ...
[ "def", "scatter3d_and_projections", "(", "data_list", ",", "channels", "=", "[", "0", ",", "1", ",", "2", "]", ",", "xscale", "=", "'logicle'", ",", "yscale", "=", "'logicle'", ",", "zscale", "=", "'logicle'", ",", "xlabel", "=", "None", ",", "ylabel", ...
Plot a 3D scatter plot and 2D projections from FCSData objects. `scatter3d_and_projections` creates a 3D scatter plot and three 2D projected scatter plots in four different axes for each FCSData object in `data_list`, in the same figure. Parameters ---------- data_list : FCSData object, or lis...
[ "Plot", "a", "3D", "scatter", "plot", "and", "2D", "projections", "from", "FCSData", "objects", "." ]
train
https://github.com/taborlab/FlowCal/blob/031a7af82acb1d46879a8e384a1a00f27f0bdc7a/FlowCal/plot.py#L1761-L1902
taborlab/FlowCal
FlowCal/plot.py
_InterpolatedInverseTransform.transform_non_affine
def transform_non_affine(self, x, mask_out_of_range=True): """ Transform a Nx1 numpy array. Parameters ---------- x : array Data to be transformed. mask_out_of_range : bool, optional Whether to mask input values out of range. Return ...
python
def transform_non_affine(self, x, mask_out_of_range=True): """ Transform a Nx1 numpy array. Parameters ---------- x : array Data to be transformed. mask_out_of_range : bool, optional Whether to mask input values out of range. Return ...
[ "def", "transform_non_affine", "(", "self", ",", "x", ",", "mask_out_of_range", "=", "True", ")", ":", "# Mask out-of-range values", "if", "mask_out_of_range", ":", "x_masked", "=", "np", ".", "ma", ".", "masked_where", "(", "(", "x", "<", "self", ".", "_xmi...
Transform a Nx1 numpy array. Parameters ---------- x : array Data to be transformed. mask_out_of_range : bool, optional Whether to mask input values out of range. Return ------ array or masked array Transformed data.
[ "Transform", "a", "Nx1", "numpy", "array", "." ]
train
https://github.com/taborlab/FlowCal/blob/031a7af82acb1d46879a8e384a1a00f27f0bdc7a/FlowCal/plot.py#L130-L154