repo stringlengths 7 55 | path stringlengths 4 127 | func_name stringlengths 1 88 | original_string stringlengths 75 19.8k | language stringclasses 1
value | code stringlengths 75 19.8k | code_tokens list | docstring stringlengths 3 17.3k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 87 242 | partition stringclasses 1
value |
|---|---|---|---|---|---|---|---|---|---|---|---|
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",
"."
] | b22d71a6da821c1715d8fa00d7d75cabc09ed364 | https://github.com/noxdafox/clipspy/blob/b22d71a6da821c1715d8fa00d7d75cabc09ed364/clips/agenda.py#L265-L267 | train |
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",
"."
] | b22d71a6da821c1715d8fa00d7d75cabc09ed364 | https://github.com/noxdafox/clipspy/blob/b22d71a6da821c1715d8fa00d7d75cabc09ed364/clips/agenda.py#L269-L287 | train |
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",
"."
] | b22d71a6da821c1715d8fa00d7d75cabc09ed364 | https://github.com/noxdafox/clipspy/blob/b22d71a6da821c1715d8fa00d7d75cabc09ed364/clips/agenda.py#L289-L296 | train |
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",
"."
] | b22d71a6da821c1715d8fa00d7d75cabc09ed364 | https://github.com/noxdafox/clipspy/blob/b22d71a6da821c1715d8fa00d7d75cabc09ed364/clips/agenda.py#L315-L326 | train |
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",
"."
] | b22d71a6da821c1715d8fa00d7d75cabc09ed364 | https://github.com/noxdafox/clipspy/blob/b22d71a6da821c1715d8fa00d7d75cabc09ed364/clips/agenda.py#L355-L358 | train |
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",
"."
] | b22d71a6da821c1715d8fa00d7d75cabc09ed364 | https://github.com/noxdafox/clipspy/blob/b22d71a6da821c1715d8fa00d7d75cabc09ed364/clips/agenda.py#L366-L368 | train |
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",
"."
] | b22d71a6da821c1715d8fa00d7d75cabc09ed364 | https://github.com/noxdafox/clipspy/blob/b22d71a6da821c1715d8fa00d7d75cabc09ed364/clips/agenda.py#L370-L375 | train |
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",
"."
] | b22d71a6da821c1715d8fa00d7d75cabc09ed364 | https://github.com/noxdafox/clipspy/blob/b22d71a6da821c1715d8fa00d7d75cabc09ed364/clips/modules.py#L78-L83 | train |
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",
"."
] | b22d71a6da821c1715d8fa00d7d75cabc09ed364 | https://github.com/noxdafox/clipspy/blob/b22d71a6da821c1715d8fa00d7d75cabc09ed364/clips/modules.py#L94-L100 | train |
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",
"."
] | b22d71a6da821c1715d8fa00d7d75cabc09ed364 | https://github.com/noxdafox/clipspy/blob/b22d71a6da821c1715d8fa00d7d75cabc09ed364/clips/modules.py#L102-L109 | train |
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",
"."
] | b22d71a6da821c1715d8fa00d7d75cabc09ed364 | https://github.com/noxdafox/clipspy/blob/b22d71a6da821c1715d8fa00d7d75cabc09ed364/clips/modules.py#L111-L117 | train |
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",
"."
] | b22d71a6da821c1715d8fa00d7d75cabc09ed364 | https://github.com/noxdafox/clipspy/blob/b22d71a6da821c1715d8fa00d7d75cabc09ed364/clips/modules.py#L151-L159 | train |
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",
"."
] | b22d71a6da821c1715d8fa00d7d75cabc09ed364 | https://github.com/noxdafox/clipspy/blob/b22d71a6da821c1715d8fa00d7d75cabc09ed364/clips/modules.py#L178-L187 | train |
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",
"."
] | b22d71a6da821c1715d8fa00d7d75cabc09ed364 | https://github.com/noxdafox/clipspy/blob/b22d71a6da821c1715d8fa00d7d75cabc09ed364/clips/modules.py#L200-L202 | train |
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",
"."
] | b22d71a6da821c1715d8fa00d7d75cabc09ed364 | https://github.com/noxdafox/clipspy/blob/b22d71a6da821c1715d8fa00d7d75cabc09ed364/clips/modules.py#L204-L215 | train |
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",
"."
] | b22d71a6da821c1715d8fa00d7d75cabc09ed364 | https://github.com/noxdafox/clipspy/blob/b22d71a6da821c1715d8fa00d7d75cabc09ed364/clips/functions.py#L70-L76 | train |
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",
"."
] | b22d71a6da821c1715d8fa00d7d75cabc09ed364 | https://github.com/noxdafox/clipspy/blob/b22d71a6da821c1715d8fa00d7d75cabc09ed364/clips/functions.py#L78-L85 | train |
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",
"."
] | b22d71a6da821c1715d8fa00d7d75cabc09ed364 | https://github.com/noxdafox/clipspy/blob/b22d71a6da821c1715d8fa00d7d75cabc09ed364/clips/functions.py#L87-L93 | train |
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",
"."
] | b22d71a6da821c1715d8fa00d7d75cabc09ed364 | https://github.com/noxdafox/clipspy/blob/b22d71a6da821c1715d8fa00d7d75cabc09ed364/clips/functions.py#L142-L145 | train |
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",
"."
] | b22d71a6da821c1715d8fa00d7d75cabc09ed364 | https://github.com/noxdafox/clipspy/blob/b22d71a6da821c1715d8fa00d7d75cabc09ed364/clips/functions.py#L148-L157 | train |
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",
"."
] | b22d71a6da821c1715d8fa00d7d75cabc09ed364 | https://github.com/noxdafox/clipspy/blob/b22d71a6da821c1715d8fa00d7d75cabc09ed364/clips/functions.py#L170-L172 | train |
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",
"."
] | b22d71a6da821c1715d8fa00d7d75cabc09ed364 | https://github.com/noxdafox/clipspy/blob/b22d71a6da821c1715d8fa00d7d75cabc09ed364/clips/functions.py#L174-L185 | train |
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",
"."
] | b22d71a6da821c1715d8fa00d7d75cabc09ed364 | https://github.com/noxdafox/clipspy/blob/b22d71a6da821c1715d8fa00d7d75cabc09ed364/clips/functions.py#L265-L276 | train |
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",
"."
] | b22d71a6da821c1715d8fa00d7d75cabc09ed364 | https://github.com/noxdafox/clipspy/blob/b22d71a6da821c1715d8fa00d7d75cabc09ed364/clips/functions.py#L341-L352 | train |
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'",
")",
":",
"if",
"scale",
"==",
"'linear'",
":",
"sf",
"=",
"la... | 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",
"."
] | 031a7af82acb1d46879a8e384a1a00f27f0bdc7a | https://github.com/taborlab/FlowCal/blob/031a7af82acb1d46879a8e384a1a00f27f0bdc7a/FlowCal/mef.py#L215-L337 | train |
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",
")",
":",
"if",
"len",
"(",
"fl_rfi",
")",
"!=",
"len",
"(",
"fl_mef",
")",
":",
"raise",
"ValueError",
"(",
"\"fl_rfi and fl_mef have different lengths\"",
")",
"if",
"len",
"(",
"fl_rfi",
")"... | 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",
"."
] | 031a7af82acb1d46879a8e384a1a00f27f0bdc7a | https://github.com/taborlab/FlowCal/blob/031a7af82acb1d46879a8e384a1a00f27f0bdc7a/FlowCal/mef.py#L339-L485 | train |
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",
")",
")",
":",
"plt",
"... | 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",
"."
] | 031a7af82acb1d46879a8e384a1a00f27f0bdc7a | https://github.com/taborlab/FlowCal/blob/031a7af82acb1d46879a8e384a1a00f27f0bdc7a/FlowCal/mef.py#L487-L554 | train |
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",
")",
":",
"if",
"sheetname",
"is",
"None",
"or",
"(",
"hasattr",
"(",
"sheetname",
",",
"'__iter__'",
")",
"and",
"not",
"isinstance",
"(",
"sheetname",
",",
"six",
".... | 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",
"."
] | 031a7af82acb1d46879a8e384a1a00f27f0bdc7a | https://github.com/taborlab/FlowCal/blob/031a7af82acb1d46879a8e384a1a00f27f0bdc7a/FlowCal/excel_ui.py#L118-L172 | train |
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",
")",
":",
"format_module_found",
"=",
"False",
"try",
":",
"if",
"packaging",
".",
"version",
".",
"parse",
"(",
"pd",
".",
"__version__",
")",
"<=",
"packaging",
... | 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",
"."
] | 031a7af82acb1d46879a8e384a1a00f27f0bdc7a | https://github.com/taborlab/FlowCal/blob/031a7af82acb1d46879a8e384a1a00f27f0bdc7a/FlowCal/excel_ui.py#L174-L249 | train |
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",
")",
":",
"headers",
"=",
"list",
"(",
"samples_table",
".",
"columns",
")",
"hist_headers",
"=",
"[",
"h",
"for",
"h",
"in",
"headers",
"if",
"re_units",... | 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",
"."
] | 031a7af82acb1d46879a8e384a1a00f27f0bdc7a | https://github.com/taborlab/FlowCal/blob/031a7af82acb1d46879a8e384a1a00f27f0bdc7a/FlowCal/excel_ui.py#L1309-L1394 | train |
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",
"=",
"{",
"}",
")",
":",
"keywords",
"=",
"[",
"]",
"values",
"=",
"[",
"]",
"keywords",
".",
"append",
"(",
"'FlowCal version'",
")",
"values",
".",
"append",
"(",
"FlowCal",
".",
"__version__",
")",
"ke... | 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",
"."
] | 031a7af82acb1d46879a8e384a1a00f27f0bdc7a | https://github.com/taborlab/FlowCal/blob/031a7af82acb1d46879a8e384a1a00f27f0bdc7a/FlowCal/excel_ui.py#L1396-L1437 | train |
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",
")",
":",
"Tk",
"(",
")",
".",
"withdraw",
"(",
")",
"if",
"platform",
".",
"system",
"(",
")",
"==",
"'Darwin'",
":",
"subprocess",
".",
"call",
"(",
"\"defaults write org.python.python \"",
"+",
"\"ApplePersi... | 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",
"."
] | 031a7af82acb1d46879a8e384a1a00f27f0bdc7a | https://github.com/taborlab/FlowCal/blob/031a7af82acb1d46879a8e384a1a00f27f0bdc7a/FlowCal/excel_ui.py#L1439-L1471 | train |
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_path",
"is",
"None",
":",
"input_path",
"=",
"show_open_file_dia... | 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",
"."
] | 031a7af82acb1d46879a8e384a1a00f27f0bdc7a | https://github.com/taborlab/FlowCal/blob/031a7af82acb1d46879a8e384a1a00f27f0bdc7a/FlowCal/excel_ui.py#L1473-L1602 | train |
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",
")",
":",
"if",
"args",
"is",
"None",
":",
"args",
"=",
"sys",
".",
"argv",
"[",
"1",
":",
"]",
"import",
"argparse",
"parser",
"=",
"argparse",
".",
"ArgumentParser",
"(",
"description",
"=",
"\"pro... | 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",
"."
] | 031a7af82acb1d46879a8e384a1a00f27f0bdc7a | https://github.com/taborlab/FlowCal/blob/031a7af82acb1d46879a8e384a1a00f27f0bdc7a/FlowCal/excel_ui.py#L1605-L1668 | train |
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",
"."
] | 031a7af82acb1d46879a8e384a1a00f27f0bdc7a | https://github.com/taborlab/FlowCal/blob/031a7af82acb1d46879a8e384a1a00f27f0bdc7a/FlowCal/io.py#L23-L97 | train |
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",
"."
] | 031a7af82acb1d46879a8e384a1a00f27f0bdc7a | https://github.com/taborlab/FlowCal/blob/031a7af82acb1d46879a8e384a1a00f27f0bdc7a/FlowCal/io.py#L99-L352 | train |
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",
")",
":",
"time_channel_idx",
"=",
"[",
"idx",
"for",
"idx",
",",
"channel",
"in",
"enumerate",
"(",
"self",
".",
"channels",
")",
"if",
"channel",
".",
"lower",
"(",
")",
"==",
"'time'",
"]",
"if",
"len",
"(",
... | 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",
"."
] | 031a7af82acb1d46879a8e384a1a00f27f0bdc7a | https://github.com/taborlab/FlowCal/blob/031a7af82acb1d46879a8e384a1a00f27f0bdc7a/FlowCal/io.py#L1160-L1190 | train |
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",
"time_str",
"is",
"None",
":",
"return",
"None",
"time_l",
"=",
"time_str",
".",
"split",
"(",
"':'",
")",
"if",
"len",
"(",
"time_l",
")",
"==",
"3",
":",
"if",
"'.'",
"in",
"time_l",
"["... | 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",
"."
] | 031a7af82acb1d46879a8e384a1a00f27f0bdc7a | https://github.com/taborlab/FlowCal/blob/031a7af82acb1d46879a8e384a1a00f27f0bdc7a/FlowCal/io.py#L1765-L1824 | train |
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",
"date_str",
"is",
"None",
":",
"return",
"None",
"try",
":",
"return",
"datetime",
".",
"datetime",
".",
"strptime",
"(",
"date_str",
",",
"'%d-%b-%y'",
")",
"except",
"ValueError",
":",
"pass",
... | 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",
"."
] | 031a7af82acb1d46879a8e384a1a00f27f0bdc7a | https://github.com/taborlab/FlowCal/blob/031a7af82acb1d46879a8e384a1a00f27f0bdc7a/FlowCal/io.py#L1827-L1877 | train |
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",
")",
":",
"if",
"hasattr",
"(",
"channels",
",",
"'__iter__'",
")",
"and",
"not",
"isinstance",
"(",
"channels",
",",
"six",
".",
"string_types",
")",
":",
"return",
"[",
"self",
".",
"_name_to_index",... | 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",
"."
] | 031a7af82acb1d46879a8e384a1a00f27f0bdc7a | https://github.com/taborlab/FlowCal/blob/031a7af82acb1d46879a8e384a1a00f27f0bdc7a/FlowCal/io.py#L1880-L1920 | train |
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",
"."
] | 031a7af82acb1d46879a8e384a1a00f27f0bdc7a | https://github.com/taborlab/FlowCal/blob/031a7af82acb1d46879a8e384a1a00f27f0bdc7a/setup.py#L14-L26 | train |
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",
"."
] | 031a7af82acb1d46879a8e384a1a00f27f0bdc7a | https://github.com/taborlab/FlowCal/blob/031a7af82acb1d46879a8e384a1a00f27f0bdc7a/FlowCal/gate.py#L31-L86 | train |
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",
")",
":",
"if",
"channels",
"is",
"None",
":",
"data_ch",
"=",
"data",
"else",
":",
"data_ch",
"=",
"... | 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",
"."
] | 031a7af82acb1d46879a8e384a1a00f27f0bdc7a | https://github.com/taborlab/FlowCal/blob/031a7af82acb1d46879a8e384a1a00f27f0bdc7a/FlowCal/gate.py#L88-L151 | train |
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",
")",
":",
"if",
"len",
"(",
"channels",
")",
"!=",
"2",
":",
"raise",
"ValueErr... | 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",
"."
] | 031a7af82acb1d46879a8e384a1a00f27f0bdc7a | https://github.com/taborlab/FlowCal/blob/031a7af82acb1d46879a8e384a1a00f27f0bdc7a/FlowCal/gate.py#L153-L241 | train |
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",
")",
":",
"data_t",
"=",
"data",
".",
"copy",
"(",
")",
".",
"astype",
"(",
"np",
".",
"float64",
")",
"if",
"channels",
"is",
"None",
":",
"if"... | 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",
"."
] | 031a7af82acb1d46879a8e384a1a00f27f0bdc7a | https://github.com/taborlab/FlowCal/blob/031a7af82acb1d46879a8e384a1a00f27f0bdc7a/FlowCal/transform.py#L22-L79 | train |
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",
")",
":",
"if",
"sc_channels",
"is",
"None",
":",
"if",
"data",
".",
"ndim",
"==",
"1",
":",
"sc_channels",
"=",
"range",
"(",
"data",
".",
"shape",
"[",
... | 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",
"."
] | 031a7af82acb1d46879a8e384a1a00f27f0bdc7a | https://github.com/taborlab/FlowCal/blob/031a7af82acb1d46879a8e384a1a00f27f0bdc7a/FlowCal/transform.py#L250-L338 | train |
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",
"."
] | 031a7af82acb1d46879a8e384a1a00f27f0bdc7a | https://github.com/taborlab/FlowCal/blob/031a7af82acb1d46879a8e384a1a00f27f0bdc7a/FlowCal/plot.py#L1761-L1902 | train |
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",
")",
":",
"if",
"mask_out_of_range",
":",
"x_masked",
"=",
"np",
".",
"ma",
".",
"masked_where",
"(",
"(",
"x",
"<",
"self",
".",
"_xmin",
")",
"|",
"(",
"x",
... | 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",
"."
] | 031a7af82acb1d46879a8e384a1a00f27f0bdc7a | https://github.com/taborlab/FlowCal/blob/031a7af82acb1d46879a8e384a1a00f27f0bdc7a/FlowCal/plot.py#L130-L154 | train |
taborlab/FlowCal | FlowCal/plot.py | _LogicleTransform.transform_non_affine | def transform_non_affine(self, s):
"""
Apply transformation to a Nx1 numpy array.
Parameters
----------
s : array
Data to be transformed in display scale units.
Return
------
array or masked array
Transformed data, in data value u... | python | def transform_non_affine(self, s):
"""
Apply transformation to a Nx1 numpy array.
Parameters
----------
s : array
Data to be transformed in display scale units.
Return
------
array or masked array
Transformed data, in data value u... | [
"def",
"transform_non_affine",
"(",
"self",
",",
"s",
")",
":",
"T",
"=",
"self",
".",
"_T",
"M",
"=",
"self",
".",
"_M",
"W",
"=",
"self",
".",
"_W",
"p",
"=",
"self",
".",
"_p",
"return",
"T",
"*",
"10",
"**",
"(",
"-",
"(",
"M",
"-",
"W"... | Apply transformation to a Nx1 numpy array.
Parameters
----------
s : array
Data to be transformed in display scale units.
Return
------
array or masked array
Transformed data, in data value units. | [
"Apply",
"transformation",
"to",
"a",
"Nx1",
"numpy",
"array",
"."
] | 031a7af82acb1d46879a8e384a1a00f27f0bdc7a | https://github.com/taborlab/FlowCal/blob/031a7af82acb1d46879a8e384a1a00f27f0bdc7a/FlowCal/plot.py#L349-L369 | train |
taborlab/FlowCal | FlowCal/plot.py | _LogicleLocator.set_params | def set_params(self, subs=None, numticks=None):
"""
Set parameters within this locator.
Parameters
----------
subs : array, optional
Subtick values, as multiples of the main ticks.
numticks : array, optional
Number of ticks.
"""
i... | python | def set_params(self, subs=None, numticks=None):
"""
Set parameters within this locator.
Parameters
----------
subs : array, optional
Subtick values, as multiples of the main ticks.
numticks : array, optional
Number of ticks.
"""
i... | [
"def",
"set_params",
"(",
"self",
",",
"subs",
"=",
"None",
",",
"numticks",
"=",
"None",
")",
":",
"if",
"numticks",
"is",
"not",
"None",
":",
"self",
".",
"numticks",
"=",
"numticks",
"if",
"subs",
"is",
"not",
"None",
":",
"self",
".",
"_subs",
... | Set parameters within this locator.
Parameters
----------
subs : array, optional
Subtick values, as multiples of the main ticks.
numticks : array, optional
Number of ticks. | [
"Set",
"parameters",
"within",
"this",
"locator",
"."
] | 031a7af82acb1d46879a8e384a1a00f27f0bdc7a | https://github.com/taborlab/FlowCal/blob/031a7af82acb1d46879a8e384a1a00f27f0bdc7a/FlowCal/plot.py#L407-L422 | train |
taborlab/FlowCal | FlowCal/plot.py | _LogicleLocator.view_limits | def view_limits(self, vmin, vmax):
"""
Try to choose the view limits intelligently.
"""
b = self._transform.base
if vmax < vmin:
vmin, vmax = vmax, vmin
if not matplotlib.ticker.is_decade(abs(vmin), b):
if vmin < 0:
vmin = -matplo... | python | def view_limits(self, vmin, vmax):
"""
Try to choose the view limits intelligently.
"""
b = self._transform.base
if vmax < vmin:
vmin, vmax = vmax, vmin
if not matplotlib.ticker.is_decade(abs(vmin), b):
if vmin < 0:
vmin = -matplo... | [
"def",
"view_limits",
"(",
"self",
",",
"vmin",
",",
"vmax",
")",
":",
"b",
"=",
"self",
".",
"_transform",
".",
"base",
"if",
"vmax",
"<",
"vmin",
":",
"vmin",
",",
"vmax",
"=",
"vmax",
",",
"vmin",
"if",
"not",
"matplotlib",
".",
"ticker",
".",
... | Try to choose the view limits intelligently. | [
"Try",
"to",
"choose",
"the",
"view",
"limits",
"intelligently",
"."
] | 031a7af82acb1d46879a8e384a1a00f27f0bdc7a | https://github.com/taborlab/FlowCal/blob/031a7af82acb1d46879a8e384a1a00f27f0bdc7a/FlowCal/plot.py#L611-L639 | train |
taborlab/FlowCal | FlowCal/plot.py | _LogicleScale.get_transform | def get_transform(self):
"""
Get a new object to perform the scaling transformation.
"""
return _InterpolatedInverseTransform(transform=self._transform,
smin=0,
smax=self._transform._M) | python | def get_transform(self):
"""
Get a new object to perform the scaling transformation.
"""
return _InterpolatedInverseTransform(transform=self._transform,
smin=0,
smax=self._transform._M) | [
"def",
"get_transform",
"(",
"self",
")",
":",
"return",
"_InterpolatedInverseTransform",
"(",
"transform",
"=",
"self",
".",
"_transform",
",",
"smin",
"=",
"0",
",",
"smax",
"=",
"self",
".",
"_transform",
".",
"_M",
")"
] | Get a new object to perform the scaling transformation. | [
"Get",
"a",
"new",
"object",
"to",
"perform",
"the",
"scaling",
"transformation",
"."
] | 031a7af82acb1d46879a8e384a1a00f27f0bdc7a | https://github.com/taborlab/FlowCal/blob/031a7af82acb1d46879a8e384a1a00f27f0bdc7a/FlowCal/plot.py#L681-L688 | train |
taborlab/FlowCal | FlowCal/plot.py | _LogicleScale.set_default_locators_and_formatters | def set_default_locators_and_formatters(self, axis):
"""
Set up the locators and formatters for the scale.
Parameters
----------
axis: matplotlib.axis
Axis for which to set locators and formatters.
"""
axis.set_major_locator(_LogicleLocator(self._tra... | python | def set_default_locators_and_formatters(self, axis):
"""
Set up the locators and formatters for the scale.
Parameters
----------
axis: matplotlib.axis
Axis for which to set locators and formatters.
"""
axis.set_major_locator(_LogicleLocator(self._tra... | [
"def",
"set_default_locators_and_formatters",
"(",
"self",
",",
"axis",
")",
":",
"axis",
".",
"set_major_locator",
"(",
"_LogicleLocator",
"(",
"self",
".",
"_transform",
")",
")",
"axis",
".",
"set_minor_locator",
"(",
"_LogicleLocator",
"(",
"self",
".",
"_tr... | Set up the locators and formatters for the scale.
Parameters
----------
axis: matplotlib.axis
Axis for which to set locators and formatters. | [
"Set",
"up",
"the",
"locators",
"and",
"formatters",
"for",
"the",
"scale",
"."
] | 031a7af82acb1d46879a8e384a1a00f27f0bdc7a | https://github.com/taborlab/FlowCal/blob/031a7af82acb1d46879a8e384a1a00f27f0bdc7a/FlowCal/plot.py#L690-L704 | train |
taborlab/FlowCal | FlowCal/plot.py | _LogicleScale.limit_range_for_scale | def limit_range_for_scale(self, vmin, vmax, minpos):
"""
Return minimum and maximum bounds for the logicle axis.
Parameters
----------
vmin : float
Minimum data value.
vmax : float
Maximum data value.
minpos : float
Minimum pos... | python | def limit_range_for_scale(self, vmin, vmax, minpos):
"""
Return minimum and maximum bounds for the logicle axis.
Parameters
----------
vmin : float
Minimum data value.
vmax : float
Maximum data value.
minpos : float
Minimum pos... | [
"def",
"limit_range_for_scale",
"(",
"self",
",",
"vmin",
",",
"vmax",
",",
"minpos",
")",
":",
"vmin_bound",
"=",
"self",
".",
"_transform",
".",
"transform_non_affine",
"(",
"0",
")",
"vmax_bound",
"=",
"self",
".",
"_transform",
".",
"transform_non_affine",... | Return minimum and maximum bounds for the logicle axis.
Parameters
----------
vmin : float
Minimum data value.
vmax : float
Maximum data value.
minpos : float
Minimum positive value in the data. Ignored by this function.
Return
... | [
"Return",
"minimum",
"and",
"maximum",
"bounds",
"for",
"the",
"logicle",
"axis",
"."
] | 031a7af82acb1d46879a8e384a1a00f27f0bdc7a | https://github.com/taborlab/FlowCal/blob/031a7af82acb1d46879a8e384a1a00f27f0bdc7a/FlowCal/plot.py#L706-L731 | train |
taborlab/FlowCal | FlowCal/stats.py | mean | def mean(data, channels=None):
"""
Calculate the mean of the events in an FCSData object.
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).
channels : int or str or list o... | python | def mean(data, channels=None):
"""
Calculate the mean of the events in an FCSData object.
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).
channels : int or str or list o... | [
"def",
"mean",
"(",
"data",
",",
"channels",
"=",
"None",
")",
":",
"if",
"channels",
"is",
"None",
":",
"data_stats",
"=",
"data",
"else",
":",
"data_stats",
"=",
"data",
"[",
":",
",",
"channels",
"]",
"return",
"np",
".",
"mean",
"(",
"data_stats"... | Calculate the mean of the events in an FCSData object.
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).
channels : int or str or list of int or list of str, optional
Chan... | [
"Calculate",
"the",
"mean",
"of",
"the",
"events",
"in",
"an",
"FCSData",
"object",
"."
] | 031a7af82acb1d46879a8e384a1a00f27f0bdc7a | https://github.com/taborlab/FlowCal/blob/031a7af82acb1d46879a8e384a1a00f27f0bdc7a/FlowCal/stats.py#L9-L35 | train |
taborlab/FlowCal | FlowCal/stats.py | gmean | def gmean(data, channels=None):
"""
Calculate the geometric mean of the events in an FCSData object.
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).
channels : int or st... | python | def gmean(data, channels=None):
"""
Calculate the geometric mean of the events in an FCSData object.
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).
channels : int or st... | [
"def",
"gmean",
"(",
"data",
",",
"channels",
"=",
"None",
")",
":",
"if",
"channels",
"is",
"None",
":",
"data_stats",
"=",
"data",
"else",
":",
"data_stats",
"=",
"data",
"[",
":",
",",
"channels",
"]",
"return",
"scipy",
".",
"stats",
".",
"gmean"... | Calculate the geometric mean of the events in an FCSData object.
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).
channels : int or str or list of int or list of str, optional
... | [
"Calculate",
"the",
"geometric",
"mean",
"of",
"the",
"events",
"in",
"an",
"FCSData",
"object",
"."
] | 031a7af82acb1d46879a8e384a1a00f27f0bdc7a | https://github.com/taborlab/FlowCal/blob/031a7af82acb1d46879a8e384a1a00f27f0bdc7a/FlowCal/stats.py#L37-L64 | train |
taborlab/FlowCal | FlowCal/stats.py | median | def median(data, channels=None):
"""
Calculate the median of the events in an FCSData object.
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).
channels : int or str or li... | python | def median(data, channels=None):
"""
Calculate the median of the events in an FCSData object.
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).
channels : int or str or li... | [
"def",
"median",
"(",
"data",
",",
"channels",
"=",
"None",
")",
":",
"if",
"channels",
"is",
"None",
":",
"data_stats",
"=",
"data",
"else",
":",
"data_stats",
"=",
"data",
"[",
":",
",",
"channels",
"]",
"return",
"np",
".",
"median",
"(",
"data_st... | Calculate the median of the events in an FCSData object.
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).
channels : int or str or list of int or list of str, optional
Ch... | [
"Calculate",
"the",
"median",
"of",
"the",
"events",
"in",
"an",
"FCSData",
"object",
"."
] | 031a7af82acb1d46879a8e384a1a00f27f0bdc7a | https://github.com/taborlab/FlowCal/blob/031a7af82acb1d46879a8e384a1a00f27f0bdc7a/FlowCal/stats.py#L66-L92 | train |
taborlab/FlowCal | FlowCal/stats.py | mode | def mode(data, channels=None):
"""
Calculate the mode of the events in an FCSData object.
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).
channels : int or str or list o... | python | def mode(data, channels=None):
"""
Calculate the mode of the events in an FCSData object.
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).
channels : int or str or list o... | [
"def",
"mode",
"(",
"data",
",",
"channels",
"=",
"None",
")",
":",
"if",
"channels",
"is",
"None",
":",
"data_stats",
"=",
"data",
"else",
":",
"data_stats",
"=",
"data",
"[",
":",
",",
"channels",
"]",
"return",
"scipy",
".",
"stats",
".",
"mode",
... | Calculate the mode of the events in an FCSData object.
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).
channels : int or str or list of int or list of str, optional
Chan... | [
"Calculate",
"the",
"mode",
"of",
"the",
"events",
"in",
"an",
"FCSData",
"object",
"."
] | 031a7af82acb1d46879a8e384a1a00f27f0bdc7a | https://github.com/taborlab/FlowCal/blob/031a7af82acb1d46879a8e384a1a00f27f0bdc7a/FlowCal/stats.py#L94-L125 | train |
taborlab/FlowCal | FlowCal/stats.py | std | def std(data, channels=None):
"""
Calculate the standard deviation of the events in an FCSData object.
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).
channels : int or ... | python | def std(data, channels=None):
"""
Calculate the standard deviation of the events in an FCSData object.
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).
channels : int or ... | [
"def",
"std",
"(",
"data",
",",
"channels",
"=",
"None",
")",
":",
"if",
"channels",
"is",
"None",
":",
"data_stats",
"=",
"data",
"else",
":",
"data_stats",
"=",
"data",
"[",
":",
",",
"channels",
"]",
"return",
"np",
".",
"std",
"(",
"data_stats",
... | Calculate the standard deviation of the events in an FCSData object.
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).
channels : int or str or list of int or list of str, optiona... | [
"Calculate",
"the",
"standard",
"deviation",
"of",
"the",
"events",
"in",
"an",
"FCSData",
"object",
"."
] | 031a7af82acb1d46879a8e384a1a00f27f0bdc7a | https://github.com/taborlab/FlowCal/blob/031a7af82acb1d46879a8e384a1a00f27f0bdc7a/FlowCal/stats.py#L127-L154 | train |
taborlab/FlowCal | FlowCal/stats.py | cv | def cv(data, channels=None):
"""
Calculate the Coeff. of Variation of the events in an FCSData object.
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).
channels : int or ... | python | def cv(data, channels=None):
"""
Calculate the Coeff. of Variation of the events in an FCSData object.
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).
channels : int or ... | [
"def",
"cv",
"(",
"data",
",",
"channels",
"=",
"None",
")",
":",
"if",
"channels",
"is",
"None",
":",
"data_stats",
"=",
"data",
"else",
":",
"data_stats",
"=",
"data",
"[",
":",
",",
"channels",
"]",
"return",
"np",
".",
"std",
"(",
"data_stats",
... | Calculate the Coeff. of Variation of the events in an FCSData object.
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).
channels : int or str or list of int or list of str, option... | [
"Calculate",
"the",
"Coeff",
".",
"of",
"Variation",
"of",
"the",
"events",
"in",
"an",
"FCSData",
"object",
"."
] | 031a7af82acb1d46879a8e384a1a00f27f0bdc7a | https://github.com/taborlab/FlowCal/blob/031a7af82acb1d46879a8e384a1a00f27f0bdc7a/FlowCal/stats.py#L156-L188 | train |
taborlab/FlowCal | FlowCal/stats.py | gstd | def gstd(data, channels=None):
"""
Calculate the geometric std. dev. of the events in an FCSData object.
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).
channels : int o... | python | def gstd(data, channels=None):
"""
Calculate the geometric std. dev. of the events in an FCSData object.
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).
channels : int o... | [
"def",
"gstd",
"(",
"data",
",",
"channels",
"=",
"None",
")",
":",
"if",
"channels",
"is",
"None",
":",
"data_stats",
"=",
"data",
"else",
":",
"data_stats",
"=",
"data",
"[",
":",
",",
"channels",
"]",
"return",
"np",
".",
"exp",
"(",
"np",
".",
... | Calculate the geometric std. dev. of the events in an FCSData object.
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).
channels : int or str or list of int or list of str, option... | [
"Calculate",
"the",
"geometric",
"std",
".",
"dev",
".",
"of",
"the",
"events",
"in",
"an",
"FCSData",
"object",
"."
] | 031a7af82acb1d46879a8e384a1a00f27f0bdc7a | https://github.com/taborlab/FlowCal/blob/031a7af82acb1d46879a8e384a1a00f27f0bdc7a/FlowCal/stats.py#L190-L217 | train |
taborlab/FlowCal | FlowCal/stats.py | gcv | def gcv(data, channels=None):
"""
Calculate the geometric CV of the events in an FCSData object.
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).
channels : int or str or... | python | def gcv(data, channels=None):
"""
Calculate the geometric CV of the events in an FCSData object.
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).
channels : int or str or... | [
"def",
"gcv",
"(",
"data",
",",
"channels",
"=",
"None",
")",
":",
"if",
"channels",
"is",
"None",
":",
"data_stats",
"=",
"data",
"else",
":",
"data_stats",
"=",
"data",
"[",
":",
",",
"channels",
"]",
"return",
"np",
".",
"sqrt",
"(",
"np",
".",
... | Calculate the geometric CV of the events in an FCSData object.
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).
channels : int or str or list of int or list of str, optional
... | [
"Calculate",
"the",
"geometric",
"CV",
"of",
"the",
"events",
"in",
"an",
"FCSData",
"object",
"."
] | 031a7af82acb1d46879a8e384a1a00f27f0bdc7a | https://github.com/taborlab/FlowCal/blob/031a7af82acb1d46879a8e384a1a00f27f0bdc7a/FlowCal/stats.py#L219-L246 | train |
taborlab/FlowCal | FlowCal/stats.py | iqr | def iqr(data, channels=None):
"""
Calculate the Interquartile Range of the events in an FCSData object.
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).
channels : int or... | python | def iqr(data, channels=None):
"""
Calculate the Interquartile Range of the events in an FCSData object.
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).
channels : int or... | [
"def",
"iqr",
"(",
"data",
",",
"channels",
"=",
"None",
")",
":",
"if",
"channels",
"is",
"None",
":",
"data_stats",
"=",
"data",
"else",
":",
"data_stats",
"=",
"data",
"[",
":",
",",
"channels",
"]",
"q75",
",",
"q25",
"=",
"np",
".",
"percentil... | Calculate the Interquartile Range of the events in an FCSData object.
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).
channels : int or str or list of int or list of str, option... | [
"Calculate",
"the",
"Interquartile",
"Range",
"of",
"the",
"events",
"in",
"an",
"FCSData",
"object",
"."
] | 031a7af82acb1d46879a8e384a1a00f27f0bdc7a | https://github.com/taborlab/FlowCal/blob/031a7af82acb1d46879a8e384a1a00f27f0bdc7a/FlowCal/stats.py#L248-L281 | train |
taborlab/FlowCal | FlowCal/stats.py | rcv | def rcv(data, channels=None):
"""
Calculate the RCV of the events in an FCSData object.
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).
channels : int or str or list of ... | python | def rcv(data, channels=None):
"""
Calculate the RCV of the events in an FCSData object.
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).
channels : int or str or list of ... | [
"def",
"rcv",
"(",
"data",
",",
"channels",
"=",
"None",
")",
":",
"if",
"channels",
"is",
"None",
":",
"data_stats",
"=",
"data",
"else",
":",
"data_stats",
"=",
"data",
"[",
":",
",",
"channels",
"]",
"q75",
",",
"q25",
"=",
"np",
".",
"percentil... | Calculate the RCV of the events in an FCSData object.
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).
channels : int or str or list of int or list of str, optional
Chann... | [
"Calculate",
"the",
"RCV",
"of",
"the",
"events",
"in",
"an",
"FCSData",
"object",
"."
] | 031a7af82acb1d46879a8e384a1a00f27f0bdc7a | https://github.com/taborlab/FlowCal/blob/031a7af82acb1d46879a8e384a1a00f27f0bdc7a/FlowCal/stats.py#L283-L316 | train |
Roguelazer/muttdown | muttdown/main.py | convert_tree | def convert_tree(message, config, indent=0, wrap_alternative=True, charset=None):
"""Recursively convert a potentially-multipart tree.
Returns a tuple of (the converted tree, whether any markdown was found)
"""
ct = message.get_content_type()
cs = message.get_content_subtype()
if charset is Non... | python | def convert_tree(message, config, indent=0, wrap_alternative=True, charset=None):
"""Recursively convert a potentially-multipart tree.
Returns a tuple of (the converted tree, whether any markdown was found)
"""
ct = message.get_content_type()
cs = message.get_content_subtype()
if charset is Non... | [
"def",
"convert_tree",
"(",
"message",
",",
"config",
",",
"indent",
"=",
"0",
",",
"wrap_alternative",
"=",
"True",
",",
"charset",
"=",
"None",
")",
":",
"ct",
"=",
"message",
".",
"get_content_type",
"(",
")",
"cs",
"=",
"message",
".",
"get_content_s... | Recursively convert a potentially-multipart tree.
Returns a tuple of (the converted tree, whether any markdown was found) | [
"Recursively",
"convert",
"a",
"potentially",
"-",
"multipart",
"tree",
"."
] | 5aeb514ba5c4eac00db8dc3690daba60f778076c | https://github.com/Roguelazer/muttdown/blob/5aeb514ba5c4eac00db8dc3690daba60f778076c/muttdown/main.py#L75-L128 | train |
Roguelazer/muttdown | muttdown/main.py | smtp_connection | def smtp_connection(c):
"""Create an SMTP connection from a Config object"""
if c.smtp_ssl:
klass = smtplib.SMTP_SSL
else:
klass = smtplib.SMTP
conn = klass(c.smtp_host, c.smtp_port, timeout=c.smtp_timeout)
if not c.smtp_ssl:
conn.ehlo()
conn.starttls()
conn.e... | python | def smtp_connection(c):
"""Create an SMTP connection from a Config object"""
if c.smtp_ssl:
klass = smtplib.SMTP_SSL
else:
klass = smtplib.SMTP
conn = klass(c.smtp_host, c.smtp_port, timeout=c.smtp_timeout)
if not c.smtp_ssl:
conn.ehlo()
conn.starttls()
conn.e... | [
"def",
"smtp_connection",
"(",
"c",
")",
":",
"if",
"c",
".",
"smtp_ssl",
":",
"klass",
"=",
"smtplib",
".",
"SMTP_SSL",
"else",
":",
"klass",
"=",
"smtplib",
".",
"SMTP",
"conn",
"=",
"klass",
"(",
"c",
".",
"smtp_host",
",",
"c",
".",
"smtp_port",
... | Create an SMTP connection from a Config object | [
"Create",
"an",
"SMTP",
"connection",
"from",
"a",
"Config",
"object"
] | 5aeb514ba5c4eac00db8dc3690daba60f778076c | https://github.com/Roguelazer/muttdown/blob/5aeb514ba5c4eac00db8dc3690daba60f778076c/muttdown/main.py#L138-L151 | train |
mollie/mollie-api-python | mollie/api/objects/method.py | Method.issuers | def issuers(self):
"""Return the list of available issuers for this payment method."""
issuers = self._get_property('issuers') or []
result = {
'_embedded': {
'issuers': issuers,
},
'count': len(issuers),
}
return List(result, I... | python | def issuers(self):
"""Return the list of available issuers for this payment method."""
issuers = self._get_property('issuers') or []
result = {
'_embedded': {
'issuers': issuers,
},
'count': len(issuers),
}
return List(result, I... | [
"def",
"issuers",
"(",
"self",
")",
":",
"issuers",
"=",
"self",
".",
"_get_property",
"(",
"'issuers'",
")",
"or",
"[",
"]",
"result",
"=",
"{",
"'_embedded'",
":",
"{",
"'issuers'",
":",
"issuers",
",",
"}",
",",
"'count'",
":",
"len",
"(",
"issuer... | Return the list of available issuers for this payment method. | [
"Return",
"the",
"list",
"of",
"available",
"issuers",
"for",
"this",
"payment",
"method",
"."
] | 307836b70f0439c066718f1e375fa333dc6e5d77 | https://github.com/mollie/mollie-api-python/blob/307836b70f0439c066718f1e375fa333dc6e5d77/mollie/api/objects/method.py#L65-L74 | train |
mollie/mollie-api-python | mollie/api/resources/payments.py | Payments.delete | def delete(self, payment_id, data=None):
"""Cancel payment and return the payment object.
Deleting a payment causes the payment status to change to canceled.
The updated payment object is returned.
"""
if not payment_id or not payment_id.startswith(self.RESOURCE_ID_PREFIX):
... | python | def delete(self, payment_id, data=None):
"""Cancel payment and return the payment object.
Deleting a payment causes the payment status to change to canceled.
The updated payment object is returned.
"""
if not payment_id or not payment_id.startswith(self.RESOURCE_ID_PREFIX):
... | [
"def",
"delete",
"(",
"self",
",",
"payment_id",
",",
"data",
"=",
"None",
")",
":",
"if",
"not",
"payment_id",
"or",
"not",
"payment_id",
".",
"startswith",
"(",
"self",
".",
"RESOURCE_ID_PREFIX",
")",
":",
"raise",
"IdentifierError",
"(",
"\"Invalid paymen... | Cancel payment and return the payment object.
Deleting a payment causes the payment status to change to canceled.
The updated payment object is returned. | [
"Cancel",
"payment",
"and",
"return",
"the",
"payment",
"object",
"."
] | 307836b70f0439c066718f1e375fa333dc6e5d77 | https://github.com/mollie/mollie-api-python/blob/307836b70f0439c066718f1e375fa333dc6e5d77/mollie/api/resources/payments.py#L20-L32 | train |
mollie/mollie-api-python | mollie/api/objects/payment.py | Payment.mandate | def mandate(self):
"""Return the mandate for this payment."""
return self.client.customer_mandates.with_parent_id(self.customer_id).get(self.mandate_id) | python | def mandate(self):
"""Return the mandate for this payment."""
return self.client.customer_mandates.with_parent_id(self.customer_id).get(self.mandate_id) | [
"def",
"mandate",
"(",
"self",
")",
":",
"return",
"self",
".",
"client",
".",
"customer_mandates",
".",
"with_parent_id",
"(",
"self",
".",
"customer_id",
")",
".",
"get",
"(",
"self",
".",
"mandate_id",
")"
] | Return the mandate for this payment. | [
"Return",
"the",
"mandate",
"for",
"this",
"payment",
"."
] | 307836b70f0439c066718f1e375fa333dc6e5d77 | https://github.com/mollie/mollie-api-python/blob/307836b70f0439c066718f1e375fa333dc6e5d77/mollie/api/objects/payment.py#L178-L180 | train |
mollie/mollie-api-python | mollie/api/objects/payment.py | Payment.subscription | def subscription(self):
"""Return the subscription for this payment."""
return self.client.customer_subscriptions.with_parent_id(self.customer_id).get(self.subscription_id) | python | def subscription(self):
"""Return the subscription for this payment."""
return self.client.customer_subscriptions.with_parent_id(self.customer_id).get(self.subscription_id) | [
"def",
"subscription",
"(",
"self",
")",
":",
"return",
"self",
".",
"client",
".",
"customer_subscriptions",
".",
"with_parent_id",
"(",
"self",
".",
"customer_id",
")",
".",
"get",
"(",
"self",
".",
"subscription_id",
")"
] | Return the subscription for this payment. | [
"Return",
"the",
"subscription",
"for",
"this",
"payment",
"."
] | 307836b70f0439c066718f1e375fa333dc6e5d77 | https://github.com/mollie/mollie-api-python/blob/307836b70f0439c066718f1e375fa333dc6e5d77/mollie/api/objects/payment.py#L183-L185 | train |
mollie/mollie-api-python | mollie/api/objects/payment.py | Payment.order | def order(self):
"""Return the order for this payment. """
from ..resources.orders import Order
url = self._get_link('order')
if url:
resp = self.client.orders.perform_api_call(self.client.orders.REST_READ, url)
return Order(resp, self.client) | python | def order(self):
"""Return the order for this payment. """
from ..resources.orders import Order
url = self._get_link('order')
if url:
resp = self.client.orders.perform_api_call(self.client.orders.REST_READ, url)
return Order(resp, self.client) | [
"def",
"order",
"(",
"self",
")",
":",
"from",
".",
".",
"resources",
".",
"orders",
"import",
"Order",
"url",
"=",
"self",
".",
"_get_link",
"(",
"'order'",
")",
"if",
"url",
":",
"resp",
"=",
"self",
".",
"client",
".",
"orders",
".",
"perform_api_... | Return the order for this payment. | [
"Return",
"the",
"order",
"for",
"this",
"payment",
"."
] | 307836b70f0439c066718f1e375fa333dc6e5d77 | https://github.com/mollie/mollie-api-python/blob/307836b70f0439c066718f1e375fa333dc6e5d77/mollie/api/objects/payment.py#L193-L199 | train |
mollie/mollie-api-python | mollie/api/objects/order.py | Order.create_refund | def create_refund(self, data=None, **params):
"""Create a refund for the order. When no data arg is given, a refund for all order lines is assumed."""
if data is None:
data = {'lines': []}
refund = OrderRefunds(self.client).on(self).create(data, **params)
return refund | python | def create_refund(self, data=None, **params):
"""Create a refund for the order. When no data arg is given, a refund for all order lines is assumed."""
if data is None:
data = {'lines': []}
refund = OrderRefunds(self.client).on(self).create(data, **params)
return refund | [
"def",
"create_refund",
"(",
"self",
",",
"data",
"=",
"None",
",",
"**",
"params",
")",
":",
"if",
"data",
"is",
"None",
":",
"data",
"=",
"{",
"'lines'",
":",
"[",
"]",
"}",
"refund",
"=",
"OrderRefunds",
"(",
"self",
".",
"client",
")",
".",
"... | Create a refund for the order. When no data arg is given, a refund for all order lines is assumed. | [
"Create",
"a",
"refund",
"for",
"the",
"order",
".",
"When",
"no",
"data",
"arg",
"is",
"given",
"a",
"refund",
"for",
"all",
"order",
"lines",
"is",
"assumed",
"."
] | 307836b70f0439c066718f1e375fa333dc6e5d77 | https://github.com/mollie/mollie-api-python/blob/307836b70f0439c066718f1e375fa333dc6e5d77/mollie/api/objects/order.py#L153-L158 | train |
mollie/mollie-api-python | mollie/api/objects/order.py | Order.cancel_lines | def cancel_lines(self, data=None):
"""Cancel the lines given. When no lines are given, cancel all the lines.
Canceling an order line causes the order line status to change to canceled.
An empty dictionary will be returned.
"""
from ..resources.order_lines import OrderLines
... | python | def cancel_lines(self, data=None):
"""Cancel the lines given. When no lines are given, cancel all the lines.
Canceling an order line causes the order line status to change to canceled.
An empty dictionary will be returned.
"""
from ..resources.order_lines import OrderLines
... | [
"def",
"cancel_lines",
"(",
"self",
",",
"data",
"=",
"None",
")",
":",
"from",
".",
".",
"resources",
".",
"order_lines",
"import",
"OrderLines",
"if",
"data",
"is",
"None",
":",
"data",
"=",
"{",
"'lines'",
":",
"[",
"]",
"}",
"canceled",
"=",
"Ord... | Cancel the lines given. When no lines are given, cancel all the lines.
Canceling an order line causes the order line status to change to canceled.
An empty dictionary will be returned. | [
"Cancel",
"the",
"lines",
"given",
".",
"When",
"no",
"lines",
"are",
"given",
"cancel",
"all",
"the",
"lines",
"."
] | 307836b70f0439c066718f1e375fa333dc6e5d77 | https://github.com/mollie/mollie-api-python/blob/307836b70f0439c066718f1e375fa333dc6e5d77/mollie/api/objects/order.py#L160-L171 | train |
mollie/mollie-api-python | mollie/api/objects/order.py | Order.update_line | def update_line(self, resource_id, data):
"""Update a line for an order."""
return OrderLines(self.client).on(self).update(resource_id, data) | python | def update_line(self, resource_id, data):
"""Update a line for an order."""
return OrderLines(self.client).on(self).update(resource_id, data) | [
"def",
"update_line",
"(",
"self",
",",
"resource_id",
",",
"data",
")",
":",
"return",
"OrderLines",
"(",
"self",
".",
"client",
")",
".",
"on",
"(",
"self",
")",
".",
"update",
"(",
"resource_id",
",",
"data",
")"
] | Update a line for an order. | [
"Update",
"a",
"line",
"for",
"an",
"order",
"."
] | 307836b70f0439c066718f1e375fa333dc6e5d77 | https://github.com/mollie/mollie-api-python/blob/307836b70f0439c066718f1e375fa333dc6e5d77/mollie/api/objects/order.py#L189-L191 | train |
mollie/mollie-api-python | mollie/api/objects/order.py | Order.create_shipment | def create_shipment(self, data=None):
"""Create a shipment for an order. When no data arg is given, a shipment for all order lines is assumed."""
if data is None:
data = {'lines': []}
return Shipments(self.client).on(self).create(data) | python | def create_shipment(self, data=None):
"""Create a shipment for an order. When no data arg is given, a shipment for all order lines is assumed."""
if data is None:
data = {'lines': []}
return Shipments(self.client).on(self).create(data) | [
"def",
"create_shipment",
"(",
"self",
",",
"data",
"=",
"None",
")",
":",
"if",
"data",
"is",
"None",
":",
"data",
"=",
"{",
"'lines'",
":",
"[",
"]",
"}",
"return",
"Shipments",
"(",
"self",
".",
"client",
")",
".",
"on",
"(",
"self",
")",
".",... | Create a shipment for an order. When no data arg is given, a shipment for all order lines is assumed. | [
"Create",
"a",
"shipment",
"for",
"an",
"order",
".",
"When",
"no",
"data",
"arg",
"is",
"given",
"a",
"shipment",
"for",
"all",
"order",
"lines",
"is",
"assumed",
"."
] | 307836b70f0439c066718f1e375fa333dc6e5d77 | https://github.com/mollie/mollie-api-python/blob/307836b70f0439c066718f1e375fa333dc6e5d77/mollie/api/objects/order.py#L198-L202 | train |
mollie/mollie-api-python | mollie/api/objects/order.py | Order.get_shipment | def get_shipment(self, resource_id):
"""Retrieve a single shipment by a shipment's ID."""
return Shipments(self.client).on(self).get(resource_id) | python | def get_shipment(self, resource_id):
"""Retrieve a single shipment by a shipment's ID."""
return Shipments(self.client).on(self).get(resource_id) | [
"def",
"get_shipment",
"(",
"self",
",",
"resource_id",
")",
":",
"return",
"Shipments",
"(",
"self",
".",
"client",
")",
".",
"on",
"(",
"self",
")",
".",
"get",
"(",
"resource_id",
")"
] | Retrieve a single shipment by a shipment's ID. | [
"Retrieve",
"a",
"single",
"shipment",
"by",
"a",
"shipment",
"s",
"ID",
"."
] | 307836b70f0439c066718f1e375fa333dc6e5d77 | https://github.com/mollie/mollie-api-python/blob/307836b70f0439c066718f1e375fa333dc6e5d77/mollie/api/objects/order.py#L204-L206 | train |
mollie/mollie-api-python | mollie/api/objects/order.py | Order.update_shipment | def update_shipment(self, resource_id, data):
"""Update the tracking information of a shipment."""
return Shipments(self.client).on(self).update(resource_id, data) | python | def update_shipment(self, resource_id, data):
"""Update the tracking information of a shipment."""
return Shipments(self.client).on(self).update(resource_id, data) | [
"def",
"update_shipment",
"(",
"self",
",",
"resource_id",
",",
"data",
")",
":",
"return",
"Shipments",
"(",
"self",
".",
"client",
")",
".",
"on",
"(",
"self",
")",
".",
"update",
"(",
"resource_id",
",",
"data",
")"
] | Update the tracking information of a shipment. | [
"Update",
"the",
"tracking",
"information",
"of",
"a",
"shipment",
"."
] | 307836b70f0439c066718f1e375fa333dc6e5d77 | https://github.com/mollie/mollie-api-python/blob/307836b70f0439c066718f1e375fa333dc6e5d77/mollie/api/objects/order.py#L208-L210 | train |
mollie/mollie-api-python | mollie/api/objects/order.py | Order.create_payment | def create_payment(self, data):
""" Creates a new payment object for an order. """
return OrderPayments(self.client).on(self).create(data) | python | def create_payment(self, data):
""" Creates a new payment object for an order. """
return OrderPayments(self.client).on(self).create(data) | [
"def",
"create_payment",
"(",
"self",
",",
"data",
")",
":",
"return",
"OrderPayments",
"(",
"self",
".",
"client",
")",
".",
"on",
"(",
"self",
")",
".",
"create",
"(",
"data",
")"
] | Creates a new payment object for an order. | [
"Creates",
"a",
"new",
"payment",
"object",
"for",
"an",
"order",
"."
] | 307836b70f0439c066718f1e375fa333dc6e5d77 | https://github.com/mollie/mollie-api-python/blob/307836b70f0439c066718f1e375fa333dc6e5d77/mollie/api/objects/order.py#L212-L214 | train |
mollie/mollie-api-python | mollie/api/resources/order_lines.py | OrderLines.delete | def delete(self, data, *args):
"""
Custom handling for deleting orderlines.
Orderlines are deleted by issuing a DELETE on the orders/*/lines endpoint,
with the orderline IDs and quantities in the request body.
"""
path = self.get_resource_name()
result = self.per... | python | def delete(self, data, *args):
"""
Custom handling for deleting orderlines.
Orderlines are deleted by issuing a DELETE on the orders/*/lines endpoint,
with the orderline IDs and quantities in the request body.
"""
path = self.get_resource_name()
result = self.per... | [
"def",
"delete",
"(",
"self",
",",
"data",
",",
"*",
"args",
")",
":",
"path",
"=",
"self",
".",
"get_resource_name",
"(",
")",
"result",
"=",
"self",
".",
"perform_api_call",
"(",
"self",
".",
"REST_DELETE",
",",
"path",
",",
"data",
"=",
"data",
")... | Custom handling for deleting orderlines.
Orderlines are deleted by issuing a DELETE on the orders/*/lines endpoint,
with the orderline IDs and quantities in the request body. | [
"Custom",
"handling",
"for",
"deleting",
"orderlines",
"."
] | 307836b70f0439c066718f1e375fa333dc6e5d77 | https://github.com/mollie/mollie-api-python/blob/307836b70f0439c066718f1e375fa333dc6e5d77/mollie/api/resources/order_lines.py#L22-L31 | train |
mollie/mollie-api-python | mollie/api/resources/order_lines.py | OrderLines.update | def update(self, resource_id, data=None, **params):
"""
Custom handling for updating orderlines.
The API returns an Order object. Since we are sending the request through an orderline object, it makes more
sense to convert the returned object to to the updated orderline object.
... | python | def update(self, resource_id, data=None, **params):
"""
Custom handling for updating orderlines.
The API returns an Order object. Since we are sending the request through an orderline object, it makes more
sense to convert the returned object to to the updated orderline object.
... | [
"def",
"update",
"(",
"self",
",",
"resource_id",
",",
"data",
"=",
"None",
",",
"**",
"params",
")",
":",
"path",
"=",
"self",
".",
"get_resource_name",
"(",
")",
"+",
"'/'",
"+",
"str",
"(",
"resource_id",
")",
"result",
"=",
"self",
".",
"perform_... | Custom handling for updating orderlines.
The API returns an Order object. Since we are sending the request through an orderline object, it makes more
sense to convert the returned object to to the updated orderline object.
If you wish to retrieve the order object, you can do so by using the or... | [
"Custom",
"handling",
"for",
"updating",
"orderlines",
"."
] | 307836b70f0439c066718f1e375fa333dc6e5d77 | https://github.com/mollie/mollie-api-python/blob/307836b70f0439c066718f1e375fa333dc6e5d77/mollie/api/resources/order_lines.py#L33-L48 | train |
mollie/mollie-api-python | mollie/api/objects/list.py | List.get_next | def get_next(self):
"""Return the next set of objects in a list"""
url = self._get_link('next')
resource = self.object_type.get_resource_class(self.client)
resp = resource.perform_api_call(resource.REST_READ, url)
return List(resp, self.object_type, self.client) | python | def get_next(self):
"""Return the next set of objects in a list"""
url = self._get_link('next')
resource = self.object_type.get_resource_class(self.client)
resp = resource.perform_api_call(resource.REST_READ, url)
return List(resp, self.object_type, self.client) | [
"def",
"get_next",
"(",
"self",
")",
":",
"url",
"=",
"self",
".",
"_get_link",
"(",
"'next'",
")",
"resource",
"=",
"self",
".",
"object_type",
".",
"get_resource_class",
"(",
"self",
".",
"client",
")",
"resp",
"=",
"resource",
".",
"perform_api_call",
... | Return the next set of objects in a list | [
"Return",
"the",
"next",
"set",
"of",
"objects",
"in",
"a",
"list"
] | 307836b70f0439c066718f1e375fa333dc6e5d77 | https://github.com/mollie/mollie-api-python/blob/307836b70f0439c066718f1e375fa333dc6e5d77/mollie/api/objects/list.py#L49-L54 | train |
mollie/mollie-api-python | mollie/api/resources/customer_subscriptions.py | CustomerSubscriptions.delete | def delete(self, subscription_id, data=None):
"""Cancel subscription and return the subscription object.
Deleting a subscription causes the subscription status to changed to 'canceled'.
The updated subscription object is returned.
"""
if not subscription_id or not subscription_i... | python | def delete(self, subscription_id, data=None):
"""Cancel subscription and return the subscription object.
Deleting a subscription causes the subscription status to changed to 'canceled'.
The updated subscription object is returned.
"""
if not subscription_id or not subscription_i... | [
"def",
"delete",
"(",
"self",
",",
"subscription_id",
",",
"data",
"=",
"None",
")",
":",
"if",
"not",
"subscription_id",
"or",
"not",
"subscription_id",
".",
"startswith",
"(",
"self",
".",
"RESOURCE_ID_PREFIX",
")",
":",
"raise",
"IdentifierError",
"(",
"\... | Cancel subscription and return the subscription object.
Deleting a subscription causes the subscription status to changed to 'canceled'.
The updated subscription object is returned. | [
"Cancel",
"subscription",
"and",
"return",
"the",
"subscription",
"object",
"."
] | 307836b70f0439c066718f1e375fa333dc6e5d77 | https://github.com/mollie/mollie-api-python/blob/307836b70f0439c066718f1e375fa333dc6e5d77/mollie/api/resources/customer_subscriptions.py#L21-L33 | train |
mollie/mollie-api-python | mollie/api/resources/chargebacks.py | Chargebacks.get | def get(self, chargeback_id, **params):
"""Verify the chargeback ID and retrieve the chargeback from the API."""
if not chargeback_id or not chargeback_id.startswith(self.RESOURCE_ID_PREFIX):
raise IdentifierError(
"Invalid chargeback ID: '{id}'. A chargeback ID should start ... | python | def get(self, chargeback_id, **params):
"""Verify the chargeback ID and retrieve the chargeback from the API."""
if not chargeback_id or not chargeback_id.startswith(self.RESOURCE_ID_PREFIX):
raise IdentifierError(
"Invalid chargeback ID: '{id}'. A chargeback ID should start ... | [
"def",
"get",
"(",
"self",
",",
"chargeback_id",
",",
"**",
"params",
")",
":",
"if",
"not",
"chargeback_id",
"or",
"not",
"chargeback_id",
".",
"startswith",
"(",
"self",
".",
"RESOURCE_ID_PREFIX",
")",
":",
"raise",
"IdentifierError",
"(",
"\"Invalid chargeb... | Verify the chargeback ID and retrieve the chargeback from the API. | [
"Verify",
"the",
"chargeback",
"ID",
"and",
"retrieve",
"the",
"chargeback",
"from",
"the",
"API",
"."
] | 307836b70f0439c066718f1e375fa333dc6e5d77 | https://github.com/mollie/mollie-api-python/blob/307836b70f0439c066718f1e375fa333dc6e5d77/mollie/api/resources/chargebacks.py#L12-L19 | train |
mollie/mollie-api-python | mollie/api/client.py | generate_querystring | def generate_querystring(params):
"""
Generate a querystring suitable for use in the v2 api.
The Requests library doesn't know how to generate querystrings that encode dictionaries using square brackets:
https://api.mollie.com/v2/methods?amount[value]=100.00&amount[currency]=USD
Note: we use `sort... | python | def generate_querystring(params):
"""
Generate a querystring suitable for use in the v2 api.
The Requests library doesn't know how to generate querystrings that encode dictionaries using square brackets:
https://api.mollie.com/v2/methods?amount[value]=100.00&amount[currency]=USD
Note: we use `sort... | [
"def",
"generate_querystring",
"(",
"params",
")",
":",
"if",
"not",
"params",
":",
"return",
"None",
"parts",
"=",
"[",
"]",
"for",
"param",
",",
"value",
"in",
"sorted",
"(",
"params",
".",
"items",
"(",
")",
")",
":",
"if",
"not",
"isinstance",
"(... | Generate a querystring suitable for use in the v2 api.
The Requests library doesn't know how to generate querystrings that encode dictionaries using square brackets:
https://api.mollie.com/v2/methods?amount[value]=100.00&amount[currency]=USD
Note: we use `sorted()` to work around a difference in iteration... | [
"Generate",
"a",
"querystring",
"suitable",
"for",
"use",
"in",
"the",
"v2",
"api",
"."
] | 307836b70f0439c066718f1e375fa333dc6e5d77 | https://github.com/mollie/mollie-api-python/blob/307836b70f0439c066718f1e375fa333dc6e5d77/mollie/api/client.py#L172-L194 | train |
mollie/mollie-api-python | mollie/api/client.py | Client.set_user_agent_component | def set_user_agent_component(self, key, value, sanitize=True):
"""Add or replace new user-agent component strings.
Given strings are formatted along the format agreed upon by Mollie and implementers:
- key and values are separated by a forward slash ("/").
- multiple key/values are sepa... | python | def set_user_agent_component(self, key, value, sanitize=True):
"""Add or replace new user-agent component strings.
Given strings are formatted along the format agreed upon by Mollie and implementers:
- key and values are separated by a forward slash ("/").
- multiple key/values are sepa... | [
"def",
"set_user_agent_component",
"(",
"self",
",",
"key",
",",
"value",
",",
"sanitize",
"=",
"True",
")",
":",
"if",
"sanitize",
":",
"key",
"=",
"''",
".",
"join",
"(",
"_x",
".",
"capitalize",
"(",
")",
"for",
"_x",
"in",
"re",
".",
"findall",
... | Add or replace new user-agent component strings.
Given strings are formatted along the format agreed upon by Mollie and implementers:
- key and values are separated by a forward slash ("/").
- multiple key/values are separated by a space.
- keys are camel-cased, and cannot contain space... | [
"Add",
"or",
"replace",
"new",
"user",
"-",
"agent",
"component",
"strings",
"."
] | 307836b70f0439c066718f1e375fa333dc6e5d77 | https://github.com/mollie/mollie-api-python/blob/307836b70f0439c066718f1e375fa333dc6e5d77/mollie/api/client.py#L110-L125 | train |
mollie/mollie-api-python | mollie/api/client.py | Client.user_agent | def user_agent(self):
"""Return the formatted user agent string."""
components = ["/".join(x) for x in self.user_agent_components.items()]
return " ".join(components) | python | def user_agent(self):
"""Return the formatted user agent string."""
components = ["/".join(x) for x in self.user_agent_components.items()]
return " ".join(components) | [
"def",
"user_agent",
"(",
"self",
")",
":",
"components",
"=",
"[",
"\"/\"",
".",
"join",
"(",
"x",
")",
"for",
"x",
"in",
"self",
".",
"user_agent_components",
".",
"items",
"(",
")",
"]",
"return",
"\" \"",
".",
"join",
"(",
"components",
")"
] | Return the formatted user agent string. | [
"Return",
"the",
"formatted",
"user",
"agent",
"string",
"."
] | 307836b70f0439c066718f1e375fa333dc6e5d77 | https://github.com/mollie/mollie-api-python/blob/307836b70f0439c066718f1e375fa333dc6e5d77/mollie/api/client.py#L128-L131 | train |
mollie/mollie-api-python | mollie/api/error.py | ResponseError.factory | def factory(resp):
"""
Return a ResponseError subclass based on the API payload.
All errors are documented: https://docs.mollie.com/guides/handling-errors#all-possible-status-codes
More exceptions should be added here when appropriate, and when useful examples of API errors are availabl... | python | def factory(resp):
"""
Return a ResponseError subclass based on the API payload.
All errors are documented: https://docs.mollie.com/guides/handling-errors#all-possible-status-codes
More exceptions should be added here when appropriate, and when useful examples of API errors are availabl... | [
"def",
"factory",
"(",
"resp",
")",
":",
"status",
"=",
"resp",
"[",
"'status'",
"]",
"if",
"status",
"==",
"401",
":",
"return",
"UnauthorizedError",
"(",
"resp",
")",
"elif",
"status",
"==",
"404",
":",
"return",
"NotFoundError",
"(",
"resp",
")",
"e... | Return a ResponseError subclass based on the API payload.
All errors are documented: https://docs.mollie.com/guides/handling-errors#all-possible-status-codes
More exceptions should be added here when appropriate, and when useful examples of API errors are available. | [
"Return",
"a",
"ResponseError",
"subclass",
"based",
"on",
"the",
"API",
"payload",
"."
] | 307836b70f0439c066718f1e375fa333dc6e5d77 | https://github.com/mollie/mollie-api-python/blob/307836b70f0439c066718f1e375fa333dc6e5d77/mollie/api/error.py#L63-L79 | train |
mollie/mollie-api-python | mollie/api/resources/orders.py | Orders.delete | def delete(self, order_id, data=None):
"""Cancel order and return the order object.
Deleting an order causes the order status to change to canceled.
The updated order object is returned.
"""
if not order_id or not order_id.startswith(self.RESOURCE_ID_PREFIX):
raise I... | python | def delete(self, order_id, data=None):
"""Cancel order and return the order object.
Deleting an order causes the order status to change to canceled.
The updated order object is returned.
"""
if not order_id or not order_id.startswith(self.RESOURCE_ID_PREFIX):
raise I... | [
"def",
"delete",
"(",
"self",
",",
"order_id",
",",
"data",
"=",
"None",
")",
":",
"if",
"not",
"order_id",
"or",
"not",
"order_id",
".",
"startswith",
"(",
"self",
".",
"RESOURCE_ID_PREFIX",
")",
":",
"raise",
"IdentifierError",
"(",
"\"Invalid order ID: '{... | Cancel order and return the order object.
Deleting an order causes the order status to change to canceled.
The updated order object is returned. | [
"Cancel",
"order",
"and",
"return",
"the",
"order",
"object",
"."
] | 307836b70f0439c066718f1e375fa333dc6e5d77 | https://github.com/mollie/mollie-api-python/blob/307836b70f0439c066718f1e375fa333dc6e5d77/mollie/api/resources/orders.py#L20-L32 | train |
mollie/mollie-api-python | mollie/api/objects/subscription.py | Subscription.customer | def customer(self):
"""Return the customer for this subscription."""
url = self._get_link('customer')
if url:
resp = self.client.customers.perform_api_call(self.client.customers.REST_READ, url)
return Customer(resp) | python | def customer(self):
"""Return the customer for this subscription."""
url = self._get_link('customer')
if url:
resp = self.client.customers.perform_api_call(self.client.customers.REST_READ, url)
return Customer(resp) | [
"def",
"customer",
"(",
"self",
")",
":",
"url",
"=",
"self",
".",
"_get_link",
"(",
"'customer'",
")",
"if",
"url",
":",
"resp",
"=",
"self",
".",
"client",
".",
"customers",
".",
"perform_api_call",
"(",
"self",
".",
"client",
".",
"customers",
".",
... | Return the customer for this subscription. | [
"Return",
"the",
"customer",
"for",
"this",
"subscription",
"."
] | 307836b70f0439c066718f1e375fa333dc6e5d77 | https://github.com/mollie/mollie-api-python/blob/307836b70f0439c066718f1e375fa333dc6e5d77/mollie/api/objects/subscription.py#L85-L90 | train |
mollie/mollie-api-python | mollie/api/objects/subscription.py | Subscription.payments | def payments(self):
"""Return a list of payments for this subscription."""
payments = self.client.subscription_payments.on(self).list()
return payments | python | def payments(self):
"""Return a list of payments for this subscription."""
payments = self.client.subscription_payments.on(self).list()
return payments | [
"def",
"payments",
"(",
"self",
")",
":",
"payments",
"=",
"self",
".",
"client",
".",
"subscription_payments",
".",
"on",
"(",
"self",
")",
".",
"list",
"(",
")",
"return",
"payments"
] | Return a list of payments for this subscription. | [
"Return",
"a",
"list",
"of",
"payments",
"for",
"this",
"subscription",
"."
] | 307836b70f0439c066718f1e375fa333dc6e5d77 | https://github.com/mollie/mollie-api-python/blob/307836b70f0439c066718f1e375fa333dc6e5d77/mollie/api/objects/subscription.py#L93-L96 | train |
jhuapl-boss/intern | intern/service/boss/v1/project.py | ProjectService_1.list_permissions | def list_permissions(self, group_name=None, resource=None,
url_prefix=None, auth=None, session=None, send_opts=None):
"""List the permission sets for the logged in user
Optionally filter by resource or group.
Args:
group_name (string): Name of group to filte... | python | def list_permissions(self, group_name=None, resource=None,
url_prefix=None, auth=None, session=None, send_opts=None):
"""List the permission sets for the logged in user
Optionally filter by resource or group.
Args:
group_name (string): Name of group to filte... | [
"def",
"list_permissions",
"(",
"self",
",",
"group_name",
"=",
"None",
",",
"resource",
"=",
"None",
",",
"url_prefix",
"=",
"None",
",",
"auth",
"=",
"None",
",",
"session",
"=",
"None",
",",
"send_opts",
"=",
"None",
")",
":",
"filter_params",
"=",
... | List the permission sets for the logged in user
Optionally filter by resource or group.
Args:
group_name (string): Name of group to filter on
resource (intern.resource.boss.BossResource): Identifies which data model object to filter on
url_prefix (string): Protocol ... | [
"List",
"the",
"permission",
"sets",
"for",
"the",
"logged",
"in",
"user"
] | d8fc6df011d8f212c87e6a1fd4cc21cfb5d103ed | https://github.com/jhuapl-boss/intern/blob/d8fc6df011d8f212c87e6a1fd4cc21cfb5d103ed/intern/service/boss/v1/project.py#L381-L421 | train |
jhuapl-boss/intern | intern/service/boss/v1/project.py | ProjectService_1.list | def list(self, resource, url_prefix, auth, session, send_opts):
"""List all resources of the same type as the given resource.
Args:
resource (intern.resource.boss.BossResource): List resources of the same type as this..
url_prefix (string): Protocol + host such as https://api.th... | python | def list(self, resource, url_prefix, auth, session, send_opts):
"""List all resources of the same type as the given resource.
Args:
resource (intern.resource.boss.BossResource): List resources of the same type as this..
url_prefix (string): Protocol + host such as https://api.th... | [
"def",
"list",
"(",
"self",
",",
"resource",
",",
"url_prefix",
",",
"auth",
",",
"session",
",",
"send_opts",
")",
":",
"req",
"=",
"self",
".",
"get_request",
"(",
"resource",
",",
"'GET'",
",",
"'application/json'",
",",
"url_prefix",
",",
"auth",
","... | List all resources of the same type as the given resource.
Args:
resource (intern.resource.boss.BossResource): List resources of the same type as this..
url_prefix (string): Protocol + host such as https://api.theboss.io
auth (string): Token to send in the request header.
... | [
"List",
"all",
"resources",
"of",
"the",
"same",
"type",
"as",
"the",
"given",
"resource",
"."
] | d8fc6df011d8f212c87e6a1fd4cc21cfb5d103ed | https://github.com/jhuapl-boss/intern/blob/d8fc6df011d8f212c87e6a1fd4cc21cfb5d103ed/intern/service/boss/v1/project.py#L711-L738 | train |
jhuapl-boss/intern | intern/service/boss/v1/project.py | ProjectService_1._get_resource_params | def _get_resource_params(self, resource, for_update=False):
"""Get dictionary containing all parameters for the given resource.
When getting params for a coordinate frame update, only name and
description are returned because they are the only fields that can
be updated.
Args:
... | python | def _get_resource_params(self, resource, for_update=False):
"""Get dictionary containing all parameters for the given resource.
When getting params for a coordinate frame update, only name and
description are returned because they are the only fields that can
be updated.
Args:
... | [
"def",
"_get_resource_params",
"(",
"self",
",",
"resource",
",",
"for_update",
"=",
"False",
")",
":",
"if",
"isinstance",
"(",
"resource",
",",
"CollectionResource",
")",
":",
"return",
"self",
".",
"_get_collection_params",
"(",
"resource",
")",
"if",
"isin... | Get dictionary containing all parameters for the given resource.
When getting params for a coordinate frame update, only name and
description are returned because they are the only fields that can
be updated.
Args:
resource (intern.resource.boss.resource.BossResource): A su... | [
"Get",
"dictionary",
"containing",
"all",
"parameters",
"for",
"the",
"given",
"resource",
"."
] | d8fc6df011d8f212c87e6a1fd4cc21cfb5d103ed | https://github.com/jhuapl-boss/intern/blob/d8fc6df011d8f212c87e6a1fd4cc21cfb5d103ed/intern/service/boss/v1/project.py#L858-L889 | train |
jhuapl-boss/intern | intern/service/boss/v1/project.py | ProjectService_1._get_resource_list | def _get_resource_list(self, rsrc_dict):
"""Extracts list of resources from the HTTP response.
Args:
rsrc_dict (dict): HTTP response encoded in a dictionary.
Returns:
(list[string]): List of a type of resource (collections, experiments, etc).
Raises:
... | python | def _get_resource_list(self, rsrc_dict):
"""Extracts list of resources from the HTTP response.
Args:
rsrc_dict (dict): HTTP response encoded in a dictionary.
Returns:
(list[string]): List of a type of resource (collections, experiments, etc).
Raises:
... | [
"def",
"_get_resource_list",
"(",
"self",
",",
"rsrc_dict",
")",
":",
"if",
"'collections'",
"in",
"rsrc_dict",
":",
"return",
"rsrc_dict",
"[",
"'collections'",
"]",
"if",
"'experiments'",
"in",
"rsrc_dict",
":",
"return",
"rsrc_dict",
"[",
"'experiments'",
"]"... | Extracts list of resources from the HTTP response.
Args:
rsrc_dict (dict): HTTP response encoded in a dictionary.
Returns:
(list[string]): List of a type of resource (collections, experiments, etc).
Raises:
(RuntimeError): If rsrc_dict does not contain any ... | [
"Extracts",
"list",
"of",
"resources",
"from",
"the",
"HTTP",
"response",
"."
] | d8fc6df011d8f212c87e6a1fd4cc21cfb5d103ed | https://github.com/jhuapl-boss/intern/blob/d8fc6df011d8f212c87e6a1fd4cc21cfb5d103ed/intern/service/boss/v1/project.py#L1024-L1045 | train |
jhuapl-boss/intern | intern/__init__.py | check_version | def check_version():
"""
Tells you if you have an old version of intern.
"""
import requests
r = requests.get('https://pypi.python.org/pypi/intern/json').json()
r = r['info']['version']
if r != __version__:
print("You are using version {}. A newer version of intern is available: {} "... | python | def check_version():
"""
Tells you if you have an old version of intern.
"""
import requests
r = requests.get('https://pypi.python.org/pypi/intern/json').json()
r = r['info']['version']
if r != __version__:
print("You are using version {}. A newer version of intern is available: {} "... | [
"def",
"check_version",
"(",
")",
":",
"import",
"requests",
"r",
"=",
"requests",
".",
"get",
"(",
"'https://pypi.python.org/pypi/intern/json'",
")",
".",
"json",
"(",
")",
"r",
"=",
"r",
"[",
"'info'",
"]",
"[",
"'version'",
"]",
"if",
"r",
"!=",
"__ve... | Tells you if you have an old version of intern. | [
"Tells",
"you",
"if",
"you",
"have",
"an",
"old",
"version",
"of",
"intern",
"."
] | d8fc6df011d8f212c87e6a1fd4cc21cfb5d103ed | https://github.com/jhuapl-boss/intern/blob/d8fc6df011d8f212c87e6a1fd4cc21cfb5d103ed/intern/__init__.py#L8-L18 | train |
jhuapl-boss/intern | intern/service/boss/volume.py | check_channel | def check_channel(fcn):
"""Decorator that ensures a valid channel passed in.
Args:
fcn (function): Function that has a ChannelResource as its second argument.
Returns:
(function): Wraps given function with one that checks for a valid channel.
"""
def wrapper(*args, **kwargs):
... | python | def check_channel(fcn):
"""Decorator that ensures a valid channel passed in.
Args:
fcn (function): Function that has a ChannelResource as its second argument.
Returns:
(function): Wraps given function with one that checks for a valid channel.
"""
def wrapper(*args, **kwargs):
... | [
"def",
"check_channel",
"(",
"fcn",
")",
":",
"def",
"wrapper",
"(",
"*",
"args",
",",
"**",
"kwargs",
")",
":",
"if",
"not",
"isinstance",
"(",
"args",
"[",
"1",
"]",
",",
"ChannelResource",
")",
":",
"raise",
"RuntimeError",
"(",
"'resource must be an ... | Decorator that ensures a valid channel passed in.
Args:
fcn (function): Function that has a ChannelResource as its second argument.
Returns:
(function): Wraps given function with one that checks for a valid channel. | [
"Decorator",
"that",
"ensures",
"a",
"valid",
"channel",
"passed",
"in",
"."
] | d8fc6df011d8f212c87e6a1fd4cc21cfb5d103ed | https://github.com/jhuapl-boss/intern/blob/d8fc6df011d8f212c87e6a1fd4cc21cfb5d103ed/intern/service/boss/volume.py#L20-L40 | train |
jhuapl-boss/intern | intern/service/boss/v1/metadata.py | MetadataService_1.create | def create(self, resource, keys_vals, url_prefix, auth, session, send_opts):
"""Create the given key-value pairs for the given resource.
Will attempt to create all key-value pairs even if a failure is encountered.
Args:
resource (intern.resource.boss.BossResource): List keys associ... | python | def create(self, resource, keys_vals, url_prefix, auth, session, send_opts):
"""Create the given key-value pairs for the given resource.
Will attempt to create all key-value pairs even if a failure is encountered.
Args:
resource (intern.resource.boss.BossResource): List keys associ... | [
"def",
"create",
"(",
"self",
",",
"resource",
",",
"keys_vals",
",",
"url_prefix",
",",
"auth",
",",
"session",
",",
"send_opts",
")",
":",
"success",
"=",
"True",
"exc",
"=",
"HTTPErrorList",
"(",
"'At least one key-value create failed.'",
")",
"for",
"pair"... | Create the given key-value pairs for the given resource.
Will attempt to create all key-value pairs even if a failure is encountered.
Args:
resource (intern.resource.boss.BossResource): List keys associated with this resource.
keys_vals (dictionary): The metadata to associate w... | [
"Create",
"the",
"given",
"key",
"-",
"value",
"pairs",
"for",
"the",
"given",
"resource",
"."
] | d8fc6df011d8f212c87e6a1fd4cc21cfb5d103ed | https://github.com/jhuapl-boss/intern/blob/d8fc6df011d8f212c87e6a1fd4cc21cfb5d103ed/intern/service/boss/v1/metadata.py#L61-L98 | train |
jhuapl-boss/intern | intern/service/boss/v1/volume.py | VolumeService_1.get_bit_width | def get_bit_width(self, resource):
"""Method to return the bit width for blosc based on the Resource"""
datatype = resource.datatype
if "uint" in datatype:
bit_width = int(datatype.split("uint")[1])
else:
raise ValueError("Unsupported datatype: {}".format(datatyp... | python | def get_bit_width(self, resource):
"""Method to return the bit width for blosc based on the Resource"""
datatype = resource.datatype
if "uint" in datatype:
bit_width = int(datatype.split("uint")[1])
else:
raise ValueError("Unsupported datatype: {}".format(datatyp... | [
"def",
"get_bit_width",
"(",
"self",
",",
"resource",
")",
":",
"datatype",
"=",
"resource",
".",
"datatype",
"if",
"\"uint\"",
"in",
"datatype",
":",
"bit_width",
"=",
"int",
"(",
"datatype",
".",
"split",
"(",
"\"uint\"",
")",
"[",
"1",
"]",
")",
"el... | Method to return the bit width for blosc based on the Resource | [
"Method",
"to",
"return",
"the",
"bit",
"width",
"for",
"blosc",
"based",
"on",
"the",
"Resource"
] | d8fc6df011d8f212c87e6a1fd4cc21cfb5d103ed | https://github.com/jhuapl-boss/intern/blob/d8fc6df011d8f212c87e6a1fd4cc21cfb5d103ed/intern/service/boss/v1/volume.py#L38-L47 | train |
falkr/stmpy | stmpy/__init__.py | get_graphviz_dot | def get_graphviz_dot(machine):
"""
Return the graph of the state machine.
The format is the dot format for Graphviz, and can be directly used as input
to Graphviz.
To learn more about Graphviz, visit https://graphviz.gitlab.io.
**Display in Jupyter Notebook**
Install Python support for Gr... | python | def get_graphviz_dot(machine):
"""
Return the graph of the state machine.
The format is the dot format for Graphviz, and can be directly used as input
to Graphviz.
To learn more about Graphviz, visit https://graphviz.gitlab.io.
**Display in Jupyter Notebook**
Install Python support for Gr... | [
"def",
"get_graphviz_dot",
"(",
"machine",
")",
":",
"s",
"=",
"[",
"]",
"s",
".",
"append",
"(",
"'digraph G {\\n'",
")",
"s",
".",
"append",
"(",
"'node [shape=box style=rounded fontname=Helvetica];\\n'",
")",
"s",
".",
"append",
"(",
"'edge [ fontname=Helvetica... | Return the graph of the state machine.
The format is the dot format for Graphviz, and can be directly used as input
to Graphviz.
To learn more about Graphviz, visit https://graphviz.gitlab.io.
**Display in Jupyter Notebook**
Install Python support for Graphviz via `pip install graphviz`.
Inst... | [
"Return",
"the",
"graph",
"of",
"the",
"state",
"machine",
"."
] | 78b016f7bf6fa7b6eba8dae58997fb99f7215bf7 | https://github.com/falkr/stmpy/blob/78b016f7bf6fa7b6eba8dae58997fb99f7215bf7/stmpy/__init__.py#L80-L139 | train |
falkr/stmpy | stmpy/__init__.py | _parse_arg_list | def _parse_arg_list(arglist):
"""
Parses a list of arguments.
Arguments are expected to be split by a comma, surrounded by any amount
of whitespace. Arguments are then run through Python's eval() method.
"""
args = []
for arg in arglist.split(','):
arg = arg.strip()
if arg: ... | python | def _parse_arg_list(arglist):
"""
Parses a list of arguments.
Arguments are expected to be split by a comma, surrounded by any amount
of whitespace. Arguments are then run through Python's eval() method.
"""
args = []
for arg in arglist.split(','):
arg = arg.strip()
if arg: ... | [
"def",
"_parse_arg_list",
"(",
"arglist",
")",
":",
"args",
"=",
"[",
"]",
"for",
"arg",
"in",
"arglist",
".",
"split",
"(",
"','",
")",
":",
"arg",
"=",
"arg",
".",
"strip",
"(",
")",
"if",
"arg",
":",
"args",
".",
"append",
"(",
"eval",
"(",
... | Parses a list of arguments.
Arguments are expected to be split by a comma, surrounded by any amount
of whitespace. Arguments are then run through Python's eval() method. | [
"Parses",
"a",
"list",
"of",
"arguments",
"."
] | 78b016f7bf6fa7b6eba8dae58997fb99f7215bf7 | https://github.com/falkr/stmpy/blob/78b016f7bf6fa7b6eba8dae58997fb99f7215bf7/stmpy/__init__.py#L141-L153 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.